diff --git a/Buffs/Amidias/AmidiasBlessing.cs b/Buffs/Amidias/AmidiasBlessing.cs new file mode 100644 index 0000000000..a001c3d95d --- /dev/null +++ b/Buffs/Amidias/AmidiasBlessing.cs @@ -0,0 +1,28 @@ +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod; +using CalamityMod.NPCs; + +namespace CalamityMod.Buffs.Amidias +{ + public class AmidiasBlessing : ModBuff + { + public override void SetDefaults() + { + DisplayName.SetDefault("Amidias' Blessing"); + Description.SetDefault("You are blessed by Amidias\n" + +"Lets you breath underwater, even in the Abyss!\n" + +"Just don't get hit..."); + Main.debuff[Type] = false; + Main.buffNoSave[Type] = false; + } + + public override void Update(Player player, ref int buffIndex) + { + player.GetModPlayer(mod).amidiasBlessing = true; + player.breath = player.breathMax + 91; + } + } +} \ No newline at end of file diff --git a/Buffs/Amidias/AmidiasBlessing.png b/Buffs/Amidias/AmidiasBlessing.png new file mode 100644 index 0000000000..135deaa5fb Binary files /dev/null and b/Buffs/Amidias/AmidiasBlessing.png differ diff --git a/Buffs/Amidias/HermitCrab.cs b/Buffs/Amidias/HermitCrab.cs new file mode 100644 index 0000000000..e9d4531fbb --- /dev/null +++ b/Buffs/Amidias/HermitCrab.cs @@ -0,0 +1,34 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Buffs.Amidias +{ + public class HermitCrab : ModBuff + { + public override void SetDefaults() + { + DisplayName.SetDefault("Hermit Crab"); + Description.SetDefault("The hermit crab will protect you"); + Main.buffNoTimeDisplay[Type] = true; + Main.buffNoSave[Type] = true; + } + + public override void Update(Player player, ref int buffIndex) + { + CalamityPlayer modPlayer = player.GetModPlayer(mod); + if (player.ownedProjectileCounts[mod.ProjectileType("HermitCrab")] > 0) + { + modPlayer.hCrab = true; + } + if (!modPlayer.hCrab) + { + player.DelBuff(buffIndex); + buffIndex--; + } + else + { + player.buffTime[buffIndex] = 18000; + } + } + } +} \ No newline at end of file diff --git a/Buffs/Amidias/HermitCrab.png b/Buffs/Amidias/HermitCrab.png new file mode 100644 index 0000000000..95040cdc60 Binary files /dev/null and b/Buffs/Amidias/HermitCrab.png differ diff --git a/Buffs/Amidias/SnapClamDebuff.cs b/Buffs/Amidias/SnapClamDebuff.cs new file mode 100644 index 0000000000..14040c9307 --- /dev/null +++ b/Buffs/Amidias/SnapClamDebuff.cs @@ -0,0 +1,26 @@ +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod; +using CalamityMod.NPCs; + +namespace CalamityMod.Buffs.Amidias +{ + public class SnapClamDebuff : ModBuff + { + public override void SetDefaults() + { + DisplayName.SetDefault("Clammed"); + Description.SetDefault("Clam clap"); + Main.debuff[Type] = true; + Main.pvpBuff[Type] = true; + Main.buffNoSave[Type] = true; + } + + public override void Update(NPC npc, ref int buffIndex) + { + npc.GetGlobalNPC(mod).clamDebuff = true; + } + } +} \ No newline at end of file diff --git a/Buffs/Amidias/SnapClamDebuff.png b/Buffs/Amidias/SnapClamDebuff.png new file mode 100644 index 0000000000..01f38bb960 Binary files /dev/null and b/Buffs/Amidias/SnapClamDebuff.png differ diff --git a/Buffs/BearBuff.cs b/Buffs/BearBuff.cs index 2ba70444f3..adb0951ac1 100644 --- a/Buffs/BearBuff.cs +++ b/Buffs/BearBuff.cs @@ -1,30 +1,30 @@ -using System; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod; - -namespace CalamityMod.Buffs -{ - public class BearBuff : ModBuff - { - public override void SetDefaults() - { - DisplayName.SetDefault("Bear"); - Description.SetDefault("A guardian angel is following you."); - Main.buffNoTimeDisplay[Type] = true; - Main.vanityPet[Type] = true; - } - - public override void Update(Player player, ref int buffIndex) - { - player.buffTime[buffIndex] = 18000; - player.GetModPlayer(mod).bearPet = true; - bool petProjectileNotSpawned = player.ownedProjectileCounts[mod.ProjectileType("Bear")] <= 0; - if (petProjectileNotSpawned && player.whoAmI == Main.myPlayer) - { - Projectile.NewProjectile(player.position.X + (float)(player.width / 2), player.position.Y + (float)(player.height / 2), 0f, 0f, mod.ProjectileType("Bear"), 0, 0f, player.whoAmI, 0f, 0f); - } - } - } +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod; + +namespace CalamityMod.Buffs +{ + public class BearBuff : ModBuff + { + public override void SetDefaults() + { + DisplayName.SetDefault("Bear"); + Description.SetDefault("A guardian angel is following you."); + Main.buffNoTimeDisplay[Type] = true; + Main.vanityPet[Type] = true; + } + + public override void Update(Player player, ref int buffIndex) + { + player.buffTime[buffIndex] = 18000; + player.GetModPlayer(mod).bearPet = true; + bool petProjectileNotSpawned = player.ownedProjectileCounts[mod.ProjectileType("Bear")] <= 0; + if (petProjectileNotSpawned && player.whoAmI == Main.myPlayer) + { + Projectile.NewProjectile(player.position.X + (float)(player.width / 2), player.position.Y + (float)(player.height / 2), 0f, 0f, mod.ProjectileType("Bear"), 0, 0f, player.whoAmI, 0f, 0f); + } + } + } } \ No newline at end of file diff --git a/Buffs/BrimstoneWaifu.cs b/Buffs/BrimstoneWaifu.cs index 730eb5e944..a9f40a7278 100644 --- a/Buffs/BrimstoneWaifu.cs +++ b/Buffs/BrimstoneWaifu.cs @@ -7,7 +7,7 @@ namespace CalamityMod.Buffs { public override void SetDefaults() { - DisplayName.SetDefault("Brimstone Waifu"); + DisplayName.SetDefault("Miss Brimmy"); Description.SetDefault("The brimstone elemental will protect you"); Main.buffNoTimeDisplay[Type] = true; Main.buffNoSave[Type] = true; diff --git a/Buffs/BurntOut.cs b/Buffs/BurntOut.cs index f870507598..c4ae2ab4f9 100644 --- a/Buffs/BurntOut.cs +++ b/Buffs/BurntOut.cs @@ -1,28 +1,28 @@ -using System; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod; -using CalamityMod.NPCs; - -namespace CalamityMod.Buffs -{ - public class BurntOut : ModBuff - { - public override void SetDefaults() - { - DisplayName.SetDefault("Burnt Out"); - Description.SetDefault("You've been burnt out and your guardians are less effective"); - Main.debuff[Type] = true; - Main.pvpBuff[Type] = true; - Main.buffNoSave[Type] = true; - longerExpertDebuff = false; - canBeCleared = false; - } - - public override void Update(Player player, ref int buffIndex) - { - player.GetModPlayer(mod).bOut = true; - } - } +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod; +using CalamityMod.NPCs; + +namespace CalamityMod.Buffs +{ + public class BurntOut : ModBuff + { + public override void SetDefaults() + { + DisplayName.SetDefault("Burnt Out"); + Description.SetDefault("You've been burnt out and your guardians are less effective"); + Main.debuff[Type] = true; + Main.pvpBuff[Type] = true; + Main.buffNoSave[Type] = true; + longerExpertDebuff = false; + canBeCleared = false; + } + + public override void Update(Player player, ref int buffIndex) + { + player.GetModPlayer(mod).bOut = true; + } + } } \ No newline at end of file diff --git a/Buffs/CalamityGlobalBuff.cs b/Buffs/CalamityGlobalBuff.cs index 0c15461d9e..a21d641c0d 100644 --- a/Buffs/CalamityGlobalBuff.cs +++ b/Buffs/CalamityGlobalBuff.cs @@ -21,34 +21,71 @@ namespace CalamityMod.Buffs { player.GetModPlayer(mod).shine = true; } - if (type == BuffID.IceBarrier) + else if (type == BuffID.IceBarrier) { player.endurance -= 0.1f; } - if (type == BuffID.Rage) + else if (type == BuffID.ObsidianSkin) + { + player.lavaMax += 420; + } + else if (type == BuffID.Rage) { CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 10; } - if (type == BuffID.Wrath) + else if (type == BuffID.Wrath) { CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.1f; } - if (type == BuffID.WellFed) + else if (type == BuffID.WellFed) { CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.05f; CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 2; } - if (type >= BuffID.NebulaUpDmg1 && type <= BuffID.NebulaUpDmg3) + else if (type >= BuffID.NebulaUpDmg1 && type <= BuffID.NebulaUpDmg3) { - float nebulaDamage = 0.15f * (float)player.nebulaLevelDamage; + float nebulaDamage = 0.075f * (float)player.nebulaLevelDamage; //7.5% to 22.5% CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += nebulaDamage; - } - if (type == BuffID.Warmth) + player.meleeDamage -= nebulaDamage; + player.rangedDamage -= nebulaDamage; + player.magicDamage -= nebulaDamage; + player.minionDamage -= nebulaDamage; + } + else if (type >= BuffID.NebulaUpLife1 && type <= BuffID.NebulaUpLife3) + { + player.lifeRegen -= 5 * player.nebulaLevelLife; //10 to 30 changed to 5 to 15 + } + else if (type == BuffID.Warmth) { player.buffImmune[mod.BuffType("GlacialState")] = true; player.buffImmune[BuffID.Frozen] = true; player.buffImmune[BuffID.Chilled] = true; } } - } + + public override void ModifyBuffTip(int type, ref string tip, ref int rare) + { + if (type == BuffID.NebulaUpDmg1) + tip = "7.5% increased damage"; + if (type == BuffID.NebulaUpDmg2) + tip = "15% increased damage"; + if (type == BuffID.NebulaUpDmg3) + tip = "22.5% increased damage"; + if (type == BuffID.ChaosState) + { + if (CalamityWorld.revenge) + { + int closestPlayer = (int)Player.FindClosest(new Vector2((float)(Main.maxTilesX / 2), (float)Main.worldSurface / 2f) * 16f, 0, 0); + if (!Main.player[closestPlayer].GetModPlayer(mod).normalityRelocator) + tip = "Using the Rod of Discord will take life and damage taken is increased by 50%"; + else + tip = "Using the Rod of Discord or Normality Relocator will take life"; + } + else + { + tip = "Using the Rod of Discord or Normality Relocator will take life"; + } + } + } + } } diff --git a/Buffs/ChaosCandle.cs b/Buffs/ChaosCandle.cs new file mode 100644 index 0000000000..3a0126669b --- /dev/null +++ b/Buffs/ChaosCandle.cs @@ -0,0 +1,28 @@ +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod; +using CalamityMod.NPCs; + +namespace CalamityMod.Buffs +{ + public class ChaosCandle : ModBuff + { + public override void SetDefaults() + { + DisplayName.SetDefault("Chaos Candle"); + Description.SetDefault("Spawn rates around the candle are boosted!"); + Main.buffNoTimeDisplay[Type] = true; + Main.debuff[Type] = true; + Main.pvpBuff[Type] = true; + Main.buffNoSave[Type] = false; + longerExpertDebuff = false; + } + + public override void Update(Player player, ref int buffIndex) + { + player.GetModPlayer(mod).chaosCandle = true; + } + } +} \ No newline at end of file diff --git a/Buffs/ChaosCandle.png b/Buffs/ChaosCandle.png new file mode 100644 index 0000000000..f5271e8717 Binary files /dev/null and b/Buffs/ChaosCandle.png differ diff --git a/Buffs/ChaosSpirit.png b/Buffs/ChaosSpirit.png index e19ae1278c..d568ca3861 100644 Binary files a/Buffs/ChaosSpirit.png and b/Buffs/ChaosSpirit.png differ diff --git a/Buffs/ChibiiBuff.cs b/Buffs/ChibiiBuff.cs index 5e3f247ef9..8096a1c82e 100644 --- a/Buffs/ChibiiBuff.cs +++ b/Buffs/ChibiiBuff.cs @@ -25,14 +25,6 @@ namespace CalamityMod.Buffs { Projectile.NewProjectile(player.position.X + (float)(player.width / 2), player.position.Y + (float)(player.height / 2), 0f, 0f, mod.ProjectileType("ChibiiDoggo"), 0, 0f, player.whoAmI, 0f, 0f); } - - //immunizes player to red devil buff - int devilbuff = mod.BuffType("RedDevil"); - player.buffImmune[devilbuff] = true; - - //makes game think red devil minion is always active so it doesnt spawn one - int devilprojectile = mod.ProjectileType("RedDevil"); - player.ownedProjectileCounts[devilprojectile] = 1; } } } diff --git a/Buffs/CloudyWaifu.cs b/Buffs/CloudyWaifu.cs index 7ca0c59ea0..3cb4079e96 100644 --- a/Buffs/CloudyWaifu.cs +++ b/Buffs/CloudyWaifu.cs @@ -7,7 +7,7 @@ namespace CalamityMod.Buffs { public override void SetDefaults() { - DisplayName.SetDefault("Cloudy Waifu"); + DisplayName.SetDefault("Miss Cloudy"); Description.SetDefault("The cloud elemental will protect you"); Main.buffNoTimeDisplay[Type] = true; Main.buffNoSave[Type] = true; diff --git a/Buffs/DannyDevito.cs b/Buffs/DannyDevito.cs new file mode 100644 index 0000000000..a29a46cb9c --- /dev/null +++ b/Buffs/DannyDevito.cs @@ -0,0 +1,30 @@ +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod; + +namespace CalamityMod.Buffs +{ + public class DannyDevito : ModBuff + { + public override void SetDefaults() + { + DisplayName.SetDefault("Danny Devito"); + Description.SetDefault("The trash man is following you."); + Main.buffNoTimeDisplay[Type] = true; + Main.vanityPet[Type] = true; + } + + public override void Update(Player player, ref int buffIndex) + { + player.buffTime[buffIndex] = 18000; + player.GetModPlayer(mod).trashMan = true; + bool petProjectileNotSpawned = player.ownedProjectileCounts[mod.ProjectileType("DannyDevito")] <= 0; + if (petProjectileNotSpawned && player.whoAmI == Main.myPlayer) + { + Projectile.NewProjectile(player.position.X + (float)(player.width / 2), player.position.Y + (float)(player.height / 2), 0f, 0f, mod.ProjectileType("DannyDevito"), 0, 0f, player.whoAmI, 0f, 0f); + } + } + } +} \ No newline at end of file diff --git a/Buffs/DannyDevito.png b/Buffs/DannyDevito.png new file mode 100644 index 0000000000..d22e92e934 Binary files /dev/null and b/Buffs/DannyDevito.png differ diff --git a/Buffs/DrewsSandyWaifu.cs b/Buffs/DrewsSandyWaifu.cs index 20c06a78e7..2ac8a75749 100644 --- a/Buffs/DrewsSandyWaifu.cs +++ b/Buffs/DrewsSandyWaifu.cs @@ -7,8 +7,8 @@ namespace CalamityMod.Buffs { public override void SetDefaults() { - DisplayName.SetDefault("Sandy Waifu"); - Description.SetDefault("The sand elemental will protect you"); + DisplayName.SetDefault("Madame Sandy"); + Description.SetDefault("The sand elemental will heal you"); Main.buffNoTimeDisplay[Type] = true; Main.buffNoSave[Type] = true; } diff --git a/Buffs/Fabsol/BlueSpeedCandle.cs b/Buffs/Fabsol/BlueSpeedCandle.cs new file mode 100644 index 0000000000..899566fab4 --- /dev/null +++ b/Buffs/Fabsol/BlueSpeedCandle.cs @@ -0,0 +1,29 @@ +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod; +using CalamityMod.NPCs; + +namespace CalamityMod.Buffs.Fabsol +{ + public class BlueSpeedCandle : ModBuff + { + public override void SetDefaults() + { + DisplayName.SetDefault("Limber"); + Description.SetDefault("The floating flame seems to uplift your very spirit"); + Main.buffNoTimeDisplay[Type] = true; + Main.debuff[Type] = true; + Main.pvpBuff[Type] = true; + Main.buffNoSave[Type] = false; + longerExpertDebuff = false; + canBeCleared = false; + } + + public override void Update(Player player, ref int buffIndex) + { + player.GetModPlayer(mod).blueCandle = true; + } + } +} \ No newline at end of file diff --git a/Buffs/Fabsol/BlueSpeedCandle.png b/Buffs/Fabsol/BlueSpeedCandle.png new file mode 100644 index 0000000000..49bd55dfe6 Binary files /dev/null and b/Buffs/Fabsol/BlueSpeedCandle.png differ diff --git a/Buffs/Fabsol/PinkHealthCandle.cs b/Buffs/Fabsol/PinkHealthCandle.cs new file mode 100644 index 0000000000..a54c4da03e --- /dev/null +++ b/Buffs/Fabsol/PinkHealthCandle.cs @@ -0,0 +1,29 @@ +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod; +using CalamityMod.NPCs; + +namespace CalamityMod.Buffs.Fabsol +{ + public class PinkHealthCandle : ModBuff + { + public override void SetDefaults() + { + DisplayName.SetDefault("Vigor"); + Description.SetDefault("Its brilliant light suffuses those nearby with hope"); + Main.buffNoTimeDisplay[Type] = true; + Main.debuff[Type] = true; + Main.pvpBuff[Type] = true; + Main.buffNoSave[Type] = false; + longerExpertDebuff = false; + canBeCleared = false; + } + + public override void Update(Player player, ref int buffIndex) + { + player.GetModPlayer(mod).pinkCandle = true; + } + } +} \ No newline at end of file diff --git a/Buffs/Fabsol/PinkHealthCandle.png b/Buffs/Fabsol/PinkHealthCandle.png new file mode 100644 index 0000000000..93720eb840 Binary files /dev/null and b/Buffs/Fabsol/PinkHealthCandle.png differ diff --git a/Buffs/Fabsol/PurpleDefenseCandle.cs b/Buffs/Fabsol/PurpleDefenseCandle.cs new file mode 100644 index 0000000000..bd7ff40153 --- /dev/null +++ b/Buffs/Fabsol/PurpleDefenseCandle.cs @@ -0,0 +1,29 @@ +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod; +using CalamityMod.NPCs; + +namespace CalamityMod.Buffs.Fabsol +{ + public class PurpleDefenseCandle : ModBuff + { + public override void SetDefaults() + { + DisplayName.SetDefault("Adamant Will"); + Description.SetDefault("Neither rain nor wind can snuff its undying flame"); + Main.buffNoTimeDisplay[Type] = true; + Main.debuff[Type] = true; + Main.pvpBuff[Type] = true; + Main.buffNoSave[Type] = false; + longerExpertDebuff = false; + canBeCleared = false; + } + + public override void Update(Player player, ref int buffIndex) + { + player.GetModPlayer(mod).purpleCandle = true; + } + } +} \ No newline at end of file diff --git a/Buffs/Fabsol/PurpleDefenseCandle.png b/Buffs/Fabsol/PurpleDefenseCandle.png new file mode 100644 index 0000000000..b0eccec1a3 Binary files /dev/null and b/Buffs/Fabsol/PurpleDefenseCandle.png differ diff --git a/Buffs/Fabsol/Trippy.cs b/Buffs/Fabsol/Trippy.cs new file mode 100644 index 0000000000..17a9cfaf69 --- /dev/null +++ b/Buffs/Fabsol/Trippy.cs @@ -0,0 +1,27 @@ +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod; +using CalamityMod.NPCs; + +namespace CalamityMod.Buffs.Fabsol +{ + public class Trippy : ModBuff + { + public override void SetDefaults() + { + DisplayName.SetDefault("Trippy"); + Description.SetDefault("You see the world for what it truly is...and you also have a 50% increase to all damage"); + Main.debuff[Type] = false; + Main.pvpBuff[Type] = true; + Main.buffNoSave[Type] = false; + longerExpertDebuff = false; + } + + public override void Update(Player player, ref int buffIndex) + { + player.GetModPlayer(mod).trippy = true; + } + } +} \ No newline at end of file diff --git a/Buffs/Fabsol/Trippy.png b/Buffs/Fabsol/Trippy.png new file mode 100644 index 0000000000..641781ec77 Binary files /dev/null and b/Buffs/Fabsol/Trippy.png differ diff --git a/Buffs/Fabsol/YellowDamageCandle.cs b/Buffs/Fabsol/YellowDamageCandle.cs new file mode 100644 index 0000000000..17e4532ba6 --- /dev/null +++ b/Buffs/Fabsol/YellowDamageCandle.cs @@ -0,0 +1,34 @@ +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod; +using CalamityMod.NPCs; + +namespace CalamityMod.Buffs.Fabsol +{ + public class YellowDamageCandle : ModBuff + { + public override void SetDefaults() + { + DisplayName.SetDefault("Spite"); + Description.SetDefault("Its hateful glow flickers with ire"); + Main.buffNoTimeDisplay[Type] = true; + Main.debuff[Type] = true; + Main.pvpBuff[Type] = true; + Main.buffNoSave[Type] = false; + longerExpertDebuff = false; + canBeCleared = false; + } + + public override void Update(Player player, ref int buffIndex) + { + player.GetModPlayer(mod).yellowCandle = true; + } + + public override void Update(NPC npc, ref int buffIndex) + { + npc.GetGlobalNPC(mod).yellowCandle = true; + } + } +} \ No newline at end of file diff --git a/Buffs/Fabsol/YellowDamageCandle.png b/Buffs/Fabsol/YellowDamageCandle.png new file mode 100644 index 0000000000..691d19958d Binary files /dev/null and b/Buffs/Fabsol/YellowDamageCandle.png differ diff --git a/Buffs/GuardianDefense.cs b/Buffs/GuardianDefense.cs index 62a0e32712..ae37553273 100644 --- a/Buffs/GuardianDefense.cs +++ b/Buffs/GuardianDefense.cs @@ -1,34 +1,34 @@ -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Buffs -{ - public class GuardianDefense : ModBuff - { - public override void SetDefaults() - { - DisplayName.SetDefault("Defensive Guardian"); - Description.SetDefault("The defender will protect you"); - Main.buffNoTimeDisplay[Type] = true; - Main.buffNoSave[Type] = true; - } - - public override void Update(Player player, ref int buffIndex) - { - CalamityPlayer modPlayer = player.GetModPlayer(mod); - if (player.ownedProjectileCounts[mod.ProjectileType("MiniGuardianDefense")] > 0) - { - modPlayer.gDefense = true; - } - if (!modPlayer.gDefense) - { - player.DelBuff(buffIndex); - buffIndex--; - } - else - { - player.buffTime[buffIndex] = 18000; - } - } - } +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Buffs +{ + public class GuardianDefense : ModBuff + { + public override void SetDefaults() + { + DisplayName.SetDefault("Defensive Guardian"); + Description.SetDefault("The defender will protect you"); + Main.buffNoTimeDisplay[Type] = true; + Main.buffNoSave[Type] = true; + } + + public override void Update(Player player, ref int buffIndex) + { + CalamityPlayer modPlayer = player.GetModPlayer(mod); + if (player.ownedProjectileCounts[mod.ProjectileType("MiniGuardianDefense")] > 0) + { + modPlayer.gDefense = true; + } + if (!modPlayer.gDefense) + { + player.DelBuff(buffIndex); + buffIndex--; + } + else + { + player.buffTime[buffIndex] = 18000; + } + } + } } \ No newline at end of file diff --git a/Buffs/GuardianHealer.cs b/Buffs/GuardianHealer.cs index e43c3a9bb7..4282cb716d 100644 --- a/Buffs/GuardianHealer.cs +++ b/Buffs/GuardianHealer.cs @@ -1,34 +1,34 @@ -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Buffs -{ - public class GuardianHealer : ModBuff - { - public override void SetDefaults() - { - DisplayName.SetDefault("Healer Guardian"); - Description.SetDefault("The guardian will heal you"); - Main.buffNoTimeDisplay[Type] = true; - Main.buffNoSave[Type] = true; - } - - public override void Update(Player player, ref int buffIndex) - { - CalamityPlayer modPlayer = player.GetModPlayer(mod); - if (player.ownedProjectileCounts[mod.ProjectileType("MiniGuardianHealer")] > 0) - { - modPlayer.gHealer = true; - } - if (!modPlayer.gHealer) - { - player.DelBuff(buffIndex); - buffIndex--; - } - else - { - player.buffTime[buffIndex] = 18000; - } - } - } +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Buffs +{ + public class GuardianHealer : ModBuff + { + public override void SetDefaults() + { + DisplayName.SetDefault("Healer Guardian"); + Description.SetDefault("The guardian will heal you"); + Main.buffNoTimeDisplay[Type] = true; + Main.buffNoSave[Type] = true; + } + + public override void Update(Player player, ref int buffIndex) + { + CalamityPlayer modPlayer = player.GetModPlayer(mod); + if (player.ownedProjectileCounts[mod.ProjectileType("MiniGuardianHealer")] > 0) + { + modPlayer.gHealer = true; + } + if (!modPlayer.gHealer) + { + player.DelBuff(buffIndex); + buffIndex--; + } + else + { + player.buffTime[buffIndex] = 18000; + } + } + } } \ No newline at end of file diff --git a/Buffs/GuardianOffense.cs b/Buffs/GuardianOffense.cs index 2c87bce3d6..f7145dfe9a 100644 --- a/Buffs/GuardianOffense.cs +++ b/Buffs/GuardianOffense.cs @@ -1,34 +1,34 @@ -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Buffs -{ - public class GuardianOffense : ModBuff - { - public override void SetDefaults() - { - DisplayName.SetDefault("Offensive Guardian"); - Description.SetDefault("The attacker will protect you"); - Main.buffNoTimeDisplay[Type] = true; - Main.buffNoSave[Type] = true; - } - - public override void Update(Player player, ref int buffIndex) - { - CalamityPlayer modPlayer = player.GetModPlayer(mod); - if (player.ownedProjectileCounts[mod.ProjectileType("MiniGuardianAttack")] > 0) - { - modPlayer.gOffense = true; - } - if (!modPlayer.gOffense) - { - player.DelBuff(buffIndex); - buffIndex--; - } - else - { - player.buffTime[buffIndex] = 18000; - } - } - } +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Buffs +{ + public class GuardianOffense : ModBuff + { + public override void SetDefaults() + { + DisplayName.SetDefault("Offensive Guardian"); + Description.SetDefault("The attacker will protect you"); + Main.buffNoTimeDisplay[Type] = true; + Main.buffNoSave[Type] = true; + } + + public override void Update(Player player, ref int buffIndex) + { + CalamityPlayer modPlayer = player.GetModPlayer(mod); + if (player.ownedProjectileCounts[mod.ProjectileType("MiniGuardianAttack")] > 0) + { + modPlayer.gOffense = true; + } + if (!modPlayer.gOffense) + { + player.DelBuff(buffIndex); + buffIndex--; + } + else + { + player.buffTime[buffIndex] = 18000; + } + } + } } \ No newline at end of file diff --git a/Buffs/LethalLavaBurn.cs b/Buffs/LethalLavaBurn.cs new file mode 100644 index 0000000000..a278dd1c5a --- /dev/null +++ b/Buffs/LethalLavaBurn.cs @@ -0,0 +1,27 @@ +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod; +using CalamityMod.NPCs; + +namespace CalamityMod.Buffs +{ + public class LethalLavaBurn : ModBuff + { + public override void SetDefaults() + { + DisplayName.SetDefault("Lethal Lava Burn"); + Description.SetDefault("Losing life"); + Main.debuff[Type] = true; + Main.pvpBuff[Type] = true; + Main.buffNoSave[Type] = true; + longerExpertDebuff = false; + } + + public override void Update(Player player, ref int buffIndex) + { + player.GetModPlayer(mod).lethalLavaBurn = true; + } + } +} \ No newline at end of file diff --git a/Buffs/LethalLavaBurn.png b/Buffs/LethalLavaBurn.png new file mode 100644 index 0000000000..76863aee75 Binary files /dev/null and b/Buffs/LethalLavaBurn.png differ diff --git a/Buffs/Mechworm.png b/Buffs/Mechworm.png index ebdc6150b0..5eeae4fa2b 100644 Binary files a/Buffs/Mechworm.png and b/Buffs/Mechworm.png differ diff --git a/Buffs/Permafrost/Popo.cs b/Buffs/Permafrost/Popo.cs index df27ce67fb..6ec7c0773d 100644 --- a/Buffs/Permafrost/Popo.cs +++ b/Buffs/Permafrost/Popo.cs @@ -1,36 +1,36 @@ -using System; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod; -using CalamityMod.NPCs; - -namespace CalamityMod.Buffs.Permafrost -{ - public class Popo : ModBuff - { - public override void SetDefaults() - { - DisplayName.SetDefault("Popo"); - Description.SetDefault("You are a snowman now!"); - Main.debuff[Type] = true; - Main.buffNoSave[Type] = true; - Main.buffNoTimeDisplay[Type] = true; - canBeCleared = false; - } - - public override void Update(Player player, ref int buffIndex) - { - CalamityPlayer modPlayer = player.GetModPlayer(); - if (modPlayer.snowmanPrevious) - { - modPlayer.snowmanPower = true; - } - else - { - player.DelBuff(buffIndex); - buffIndex--; - } - } - } +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod; +using CalamityMod.NPCs; + +namespace CalamityMod.Buffs.Permafrost +{ + public class Popo : ModBuff + { + public override void SetDefaults() + { + DisplayName.SetDefault("Popo"); + Description.SetDefault("You are a snowman now!"); + Main.debuff[Type] = true; + Main.buffNoSave[Type] = true; + Main.buffNoTimeDisplay[Type] = true; + canBeCleared = false; + } + + public override void Update(Player player, ref int buffIndex) + { + CalamityPlayer modPlayer = player.GetModPlayer(); + if (modPlayer.snowmanPrevious) + { + modPlayer.snowmanPower = true; + } + else + { + player.DelBuff(buffIndex); + buffIndex--; + } + } + } } \ No newline at end of file diff --git a/Buffs/Permafrost/PopoNoseless.cs b/Buffs/Permafrost/PopoNoseless.cs index f63dd3851c..e316a2666f 100644 --- a/Buffs/Permafrost/PopoNoseless.cs +++ b/Buffs/Permafrost/PopoNoseless.cs @@ -1,36 +1,36 @@ -using System; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod; -using CalamityMod.NPCs; - -namespace CalamityMod.Buffs.Permafrost -{ - public class PopoNoseless : ModBuff - { - public override void SetDefaults() - { - DisplayName.SetDefault("Noseless Popo"); - Description.SetDefault("Your nose has been stolen!"); - Main.debuff[Type] = true; - Main.buffNoSave[Type] = true; - canBeCleared = false; - } - - public override void Update(Player player, ref int buffIndex) - { - CalamityPlayer modPlayer = player.GetModPlayer(); - if (modPlayer.snowmanPrevious) - { - modPlayer.snowmanPower = true; - modPlayer.snowmanNoseless = true; - } - else - { - player.DelBuff(buffIndex); - buffIndex--; - } - } - } +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod; +using CalamityMod.NPCs; + +namespace CalamityMod.Buffs.Permafrost +{ + public class PopoNoseless : ModBuff + { + public override void SetDefaults() + { + DisplayName.SetDefault("Noseless Popo"); + Description.SetDefault("Your nose has been stolen!"); + Main.debuff[Type] = true; + Main.buffNoSave[Type] = true; + canBeCleared = false; + } + + public override void Update(Player player, ref int buffIndex) + { + CalamityPlayer modPlayer = player.GetModPlayer(); + if (modPlayer.snowmanPrevious) + { + modPlayer.snowmanPower = true; + modPlayer.snowmanNoseless = true; + } + else + { + player.DelBuff(buffIndex); + buffIndex--; + } + } + } } \ No newline at end of file diff --git a/Buffs/SandyWaifu.cs b/Buffs/SandyWaifu.cs index b345cfba66..12694c5816 100644 --- a/Buffs/SandyWaifu.cs +++ b/Buffs/SandyWaifu.cs @@ -7,7 +7,7 @@ namespace CalamityMod.Buffs { public override void SetDefaults() { - DisplayName.SetDefault("Sandy Waifu"); + DisplayName.SetDefault("Miss Sandy"); Description.SetDefault("The sand elemental will protect you"); Main.buffNoTimeDisplay[Type] = true; Main.buffNoSave[Type] = true; diff --git a/Buffs/SilvaRevival.cs b/Buffs/SilvaRevival.cs index 48a8703ef5..ef7e78ecb7 100644 --- a/Buffs/SilvaRevival.cs +++ b/Buffs/SilvaRevival.cs @@ -1,22 +1,22 @@ -using System; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod; -using CalamityMod.NPCs; - -namespace CalamityMod.Buffs -{ - public class SilvaRevival : ModBuff - { - public override void SetDefaults() - { - DisplayName.SetDefault("Silva Invulnerability"); - Description.SetDefault("You are invulnerable"); - Main.debuff[Type] = false; - Main.pvpBuff[Type] = true; - Main.buffNoSave[Type] = false; - longerExpertDebuff = false; - } - } +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod; +using CalamityMod.NPCs; + +namespace CalamityMod.Buffs +{ + public class SilvaRevival : ModBuff + { + public override void SetDefaults() + { + DisplayName.SetDefault("Silva Invulnerability"); + Description.SetDefault("You are invulnerable"); + Main.debuff[Type] = false; + Main.pvpBuff[Type] = true; + Main.buffNoSave[Type] = false; + longerExpertDebuff = false; + } + } } \ No newline at end of file diff --git a/Buffs/SirenBobs.cs b/Buffs/SirenBobs.cs index baecc4a97e..5bca6c7334 100644 --- a/Buffs/SirenBobs.cs +++ b/Buffs/SirenBobs.cs @@ -27,8 +27,8 @@ namespace CalamityMod.Buffs modPlayer.sirenBoobsPower = true; player.statDefense += 1 + (NPC.downedBoss3 ? 4 : 0) + - (Main.hardMode ? 10 : 0) + - (NPC.downedMoonlord ? 15 : 0); + (Main.hardMode ? 5 : 0) + + (NPC.downedMoonlord ? 5 : 0); player.detectCreature = true; player.lifeRegen += 0 + (NPC.downedBoss3 ? 1 : 0) + diff --git a/Buffs/SirenBobs.png b/Buffs/SirenBobs.png index 11e1933bb4..4792bcfe23 100644 Binary files a/Buffs/SirenBobs.png and b/Buffs/SirenBobs.png differ diff --git a/Buffs/SirenBobsAlt.cs b/Buffs/SirenBobsAlt.cs index 6a22f11c7c..46585d9285 100644 --- a/Buffs/SirenBobsAlt.cs +++ b/Buffs/SirenBobsAlt.cs @@ -27,8 +27,8 @@ namespace CalamityMod.Buffs modPlayer.sirenBoobsAltPower = true; player.statDefense += 1 + (NPC.downedBoss3 ? 4 : 0) + - (Main.hardMode ? 10 : 0) + - (NPC.downedMoonlord ? 15 : 0); + (Main.hardMode ? 5 : 0) + + (NPC.downedMoonlord ? 5 : 0); player.dangerSense = true; player.lifeRegen += 0 + (NPC.downedBoss3 ? 1 : 0) + diff --git a/Buffs/SirenBobsAlt.png b/Buffs/SirenBobsAlt.png index d5d30aa456..7d79587604 100644 Binary files a/Buffs/SirenBobsAlt.png and b/Buffs/SirenBobsAlt.png differ diff --git a/Buffs/SirenLure.cs b/Buffs/SirenLure.cs index 698bee1b82..c06a00c5ea 100644 --- a/Buffs/SirenLure.cs +++ b/Buffs/SirenLure.cs @@ -7,8 +7,8 @@ namespace CalamityMod.Buffs { public override void SetDefaults() { - DisplayName.SetDefault("Siren Lure"); - Description.SetDefault("The siren lure will protect you"); + DisplayName.SetDefault("Siren"); + Description.SetDefault("The siren will protect you"); Main.buffNoTimeDisplay[Type] = true; Main.buffNoSave[Type] = true; } diff --git a/Buffs/StrangeOrb.png b/Buffs/StrangeOrb.png index 85758b072f..d3f7aa5885 100644 Binary files a/Buffs/StrangeOrb.png and b/Buffs/StrangeOrb.png differ diff --git a/Buffs/SunkenSea/Clamity.cs b/Buffs/SunkenSea/Clamity.cs new file mode 100644 index 0000000000..3406905703 --- /dev/null +++ b/Buffs/SunkenSea/Clamity.cs @@ -0,0 +1,29 @@ +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod; +using CalamityMod.NPCs; + +namespace CalamityMod.Buffs.SunkenSea +{ + public class Clamity : ModBuff + { + public override void SetDefaults() + { + DisplayName.SetDefault("Clamity"); + Description.SetDefault("The clams have been angered!"); + Main.buffNoTimeDisplay[Type] = true; + Main.debuff[Type] = true; + Main.pvpBuff[Type] = true; + Main.buffNoSave[Type] = true; + longerExpertDebuff = false; + canBeCleared = false; + } + + public override void Update(Player player, ref int buffIndex) + { + player.GetModPlayer(mod).clamity = true; + } + } +} \ No newline at end of file diff --git a/Buffs/SunkenSea/Clamity.png b/Buffs/SunkenSea/Clamity.png new file mode 100644 index 0000000000..01f38bb960 Binary files /dev/null and b/Buffs/SunkenSea/Clamity.png differ diff --git a/Buffs/SunkenSea/PearlAura.cs b/Buffs/SunkenSea/PearlAura.cs new file mode 100644 index 0000000000..466799460c --- /dev/null +++ b/Buffs/SunkenSea/PearlAura.cs @@ -0,0 +1,26 @@ +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod; +using CalamityMod.NPCs; + +namespace CalamityMod.Buffs.SunkenSea +{ + public class PearlAura : ModBuff + { + public override void SetDefaults() + { + DisplayName.SetDefault("Pearl Aura"); + Description.SetDefault("Slowed down"); + Main.debuff[Type] = true; + Main.pvpBuff[Type] = true; + Main.buffNoSave[Type] = true; + } + + public override void Update(NPC npc, ref int buffIndex) + { + npc.GetGlobalNPC(mod).pearlAura = true; + } + } +} \ No newline at end of file diff --git a/Buffs/SunkenSea/PearlAura.png b/Buffs/SunkenSea/PearlAura.png new file mode 100644 index 0000000000..ff6e7d8dec Binary files /dev/null and b/Buffs/SunkenSea/PearlAura.png differ diff --git a/Buffs/SunkenSea/Shellfish.cs b/Buffs/SunkenSea/Shellfish.cs new file mode 100644 index 0000000000..2b34c04d54 --- /dev/null +++ b/Buffs/SunkenSea/Shellfish.cs @@ -0,0 +1,34 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Buffs.SunkenSea +{ + public class Shellfish : ModBuff + { + public override void SetDefaults() + { + DisplayName.SetDefault("Shellfish"); + Description.SetDefault("The shellfish will protect you"); + Main.buffNoTimeDisplay[Type] = true; + Main.buffNoSave[Type] = true; + } + + public override void Update(Player player, ref int buffIndex) + { + CalamityPlayer modPlayer = player.GetModPlayer(mod); + if (player.ownedProjectileCounts[mod.ProjectileType("Shellfish")] > 0) + { + modPlayer.shellfish = true; + } + if (!modPlayer.shellfish) + { + player.DelBuff(buffIndex); + buffIndex--; + } + else + { + player.buffTime[buffIndex] = 18000; + } + } + } +} \ No newline at end of file diff --git a/Buffs/SunkenSea/Shellfish.png b/Buffs/SunkenSea/Shellfish.png new file mode 100644 index 0000000000..3c28db9c53 Binary files /dev/null and b/Buffs/SunkenSea/Shellfish.png differ diff --git a/Buffs/SunkenSea/ShellfishEating.cs b/Buffs/SunkenSea/ShellfishEating.cs new file mode 100644 index 0000000000..2dfd47adfc --- /dev/null +++ b/Buffs/SunkenSea/ShellfishEating.cs @@ -0,0 +1,26 @@ +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod; +using CalamityMod.NPCs; + +namespace CalamityMod.Buffs.SunkenSea +{ + public class ShellfishEating : ModBuff + { + public override void SetDefaults() + { + DisplayName.SetDefault("Shellfish Claps"); + Description.SetDefault("Clamfest"); + Main.debuff[Type] = true; + Main.pvpBuff[Type] = true; + Main.buffNoSave[Type] = true; + } + + public override void Update(NPC npc, ref int buffIndex) + { + npc.GetGlobalNPC(mod).shellfishVore = true; + } + } +} \ No newline at end of file diff --git a/Buffs/SunkenSea/ShellfishEating.png b/Buffs/SunkenSea/ShellfishEating.png new file mode 100644 index 0000000000..846f95f87e Binary files /dev/null and b/Buffs/SunkenSea/ShellfishEating.png differ diff --git a/Buffs/TranquilityCandle.cs b/Buffs/TranquilityCandle.cs new file mode 100644 index 0000000000..4309c4c3ff --- /dev/null +++ b/Buffs/TranquilityCandle.cs @@ -0,0 +1,28 @@ +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod; +using CalamityMod.NPCs; + +namespace CalamityMod.Buffs +{ + public class TranquilityCandle : ModBuff + { + public override void SetDefaults() + { + DisplayName.SetDefault("Tranquility Candle"); + Description.SetDefault("Spawn rates around the candle are reduced!"); + Main.buffNoTimeDisplay[Type] = true; + Main.debuff[Type] = true; + Main.pvpBuff[Type] = true; + Main.buffNoSave[Type] = false; + longerExpertDebuff = false; + } + + public override void Update(Player player, ref int buffIndex) + { + player.GetModPlayer(mod).tranquilityCandle = true; + } + } +} \ No newline at end of file diff --git a/Buffs/TranquilityCandle.png b/Buffs/TranquilityCandle.png new file mode 100644 index 0000000000..2cf02e775e Binary files /dev/null and b/Buffs/TranquilityCandle.png differ diff --git a/Buffs/Valkyrie.png b/Buffs/Valkyrie.png index cf96d8137b..39423ecdd7 100644 Binary files a/Buffs/Valkyrie.png and b/Buffs/Valkyrie.png differ diff --git a/Buffs/WhisperingDeath.png b/Buffs/WhisperingDeath.png index 57f10f7cff..e0afe62974 100644 Binary files a/Buffs/WhisperingDeath.png and b/Buffs/WhisperingDeath.png differ diff --git a/CalamityCollision.cs b/CalamityCollision.cs new file mode 100644 index 0000000000..8f2fa69768 --- /dev/null +++ b/CalamityCollision.cs @@ -0,0 +1,88 @@ +using System; +using System.Reflection; +using System.Collections.Generic; +using System.Text; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; + +using Terraria; +using Terraria.UI.Chat; +using Terraria.ObjectData; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.UI; +using Terraria.ModLoader; +using Terraria.Graphics.Shaders; +using Terraria.Localization; +using Terraria.GameContent.UI; + +namespace CalamityMod +{ + public class CalamityCollision + { + public static bool HotWetCollision(Vector2 Position, int Width, int Height) + { + Vector2 vector = new Vector2(Position.X + (float)(Width / 2), Position.Y + (float)(Height / 2)); + int num = 10; + int num2 = Height / 2; + if (num > Width) + { + num = Width; + } + if (num2 > Height) + { + num2 = Height; + } + vector = new Vector2(vector.X - (float)(num / 2), vector.Y - (float)(num2 / 2)); + int arg_A3_0 = (int)(Position.X / 16f) - 1; + int num3 = (int)((Position.X + (float)Width) / 16f) + 2; + int num4 = (int)(Position.Y / 16f) - 1; + int num5 = (int)((Position.Y + (float)Height) / 16f) + 2; + int arg_DB_0 = Utils.Clamp(arg_A3_0, 0, Main.maxTilesX - 1); + num3 = Utils.Clamp(num3, 0, Main.maxTilesX - 1); + num4 = Utils.Clamp(num4, 0, Main.maxTilesY - 1); + num5 = Utils.Clamp(num5, 0, Main.maxTilesY - 1); + for (int i = arg_DB_0; i < num3; i++) + { + for (int j = num4; j < num5; j++) + { + if (Main.tile[i, j] != null) + { + if (Main.tile[i, j + 2].lava() || + Main.tile[i, j + 3].lava() || + Main.tile[i, j + 4].lava()) + { + if (Main.tile[i, j].liquid > 0) + { + Vector2 vector2; + vector2.X = (float)(i * 16); + vector2.Y = (float)(j * 16); + int num6 = 16; + float num7 = (float)(256 - (int)Main.tile[i, j].liquid); + num7 /= 32f; + vector2.Y += num7 * 2f; + num6 -= (int)(num7 * 2f); + if (vector.X + (float)num > vector2.X && vector.X < vector2.X + 16f && vector.Y + (float)num2 > vector2.Y && vector.Y < vector2.Y + (float)num6) + { + return true; + } + } + else if (Main.tile[i, j].active() && Main.tile[i, j].slope() != 0 && j > 0 && Main.tile[i, j - 1] != null && Main.tile[i, j - 1].liquid > 0) + { + Vector2 vector2; + vector2.X = (float)(i * 16); + vector2.Y = (float)(j * 16); + int num8 = 16; + if (vector.X + (float)num > vector2.X && vector.X < vector2.X + 16f && vector.Y + (float)num2 > vector2.Y && vector.Y < vector2.Y + (float)num8) + { + return true; + } + } + } + } + } + } + return false; + } + } +} \ No newline at end of file diff --git a/CalamityLocalization.cs b/CalamityLocalization.cs new file mode 100644 index 0000000000..3c2356cddc --- /dev/null +++ b/CalamityLocalization.cs @@ -0,0 +1,134 @@ +using Terraria.ModLoader; + +namespace CalamityMod +{ + public class CalamityLocalization + { + private static string[][] _localizations; + + public static void Load() + { + _localizations = new[] + { + new [] { "SkyOreText", "The ground is glittering with cyan light." }, + new [] { "IceOreText", "The ice caves are crackling with frigid energy." }, + new [] { "PlantOreText", "Energized plant matter has formed in the underground." }, + new [] { "TreeOreText", "Fossilized tree bark is bursting through the jungle's mud." }, + new [] { "AuricOreText", "A godly aura has blessed the world's caverns." }, + new [] { "FutureOreText", "A cold and dark energy has materialized in space." }, + new [] { "UglyBossText", "Calamitous creatures now roam free!" }, + new [] { "UglyBossText2", "The ancient ice spirits have been unbound!" }, + new [] { "SteelSkullBossText", "A blood red inferno lingers in the night..." }, + new [] { "PlantBossText", "The ocean depths are trembling." }, + new [] { "BabyBossText", "A plague has befallen the Jungle." }, + new [] { "BabyBossText2", "An ancient automaton roams the land." }, + new [] { "MoonBossText", "The profaned flame blazes fiercely!" }, + new [] { "MoonBossText2", "Cosmic terrors are watching..." }, + new [] { "MoonBossText3", "The bloody moon beckons..." }, + new [] { "PlagueBossText", "PLAGUE NUKE BARRAGE ARMED, PREPARING FOR LAUNCH!!!" }, + new [] { "PlagueBossText2", "MISSILES LAUNCHED, TARGETING ROUTINE INITIATED!!!" }, + new [] { "ProfanedBossText", "The air is burning..." }, + new [] { "ProfanedBossText2", "Shrieks are echoing from the dungeon." }, + new [] { "ProfanedBossText3", "The calamitous beings have been inundated with bloodstone." }, + new [] { "GhostBossText", "The abyssal spirits have been disturbed." }, + new [] { "SupremeBossText3", "Alright, let's get started. Not sure why you're bothering." }, // start + new [] { "SupremeBossText4", "You seem so confident, even though you are painfully ignorant of what has yet to transpire." }, //75% + new [] { "SupremeBossText5", "Everything was going well until you came along." }, //75% + new [] { "SupremeBossText6", "Brothers, could you assist me for a moment? This ordeal is growing tiresome." }, //45% + new [] { "SupremeBossText", "Don't worry, I still have plenty of tricks left." }, //40% + new [] { "SupremeBossText7", "Hmm...perhaps I should let the little ones out to play for a while." },//30% + new [] { "SupremeBossText8", "Impressive...but still not good enough!" }, //20% + new [] { "SupremeBossText9", "I'm just getting started!" }, //10% + new [] { "SupremeBossText20", "How are you still alive!?" }, //8% + new [] { "SupremeBossText21", "Just stop!" }, //6% + new [] { "SupremeBossText22", "Even if you defeat me you would still have the lord to contend with!" }, //4% + new [] { "SupremeBossText23", "He has never lost a battle!" }, //2% + new [] { "SupremeBossText24", "Not even I could defeat him! What hope do you have!?" }, //1% + new [] { "SupremeBossText25", "He has grown far stronger since we last fought...you stand no chance." }, //1% after 10 seconds + new [] { "SupremeBossText26", "Well...I suppose this is the end..." }, //1% after 15 seconds + new [] { "SupremeBossText27", "Perhaps one of these times I'll change my mind..." }, //1% after first win + new [] { "SupremeBossText28", "You aren't hurting as much as I'd like...are you cheating?" }, //not taking enough damage + new [] { "SupremeBossText2", "Go to hell." }, //cheater + new [] { "SupremeBossText10", "At long last I am free...for a time. I'll keep coming back, just like you. Until we meet again, farewell." }, //end after 20 seconds + new [] { "SupremeBossText11", "Do you enjoy going through hell?" }, //rebattle after killing once + new [] { "SupremeBossText12", "Don't get me wrong, I like pain too, but you're just ridiculous." }, //rebattle after killing four times + new [] { "SupremeBossText13", "You must enjoy dying more than most people, huh?" }, //rebattle five deaths + new [] { "SupremeBossText14", "Do you have a fetish for getting killed or something?" }, //rebattle twenty deaths + new [] { "SupremeBossText15", "Alright, I'm done counting. You probably died this much just to see what I'd say." }, //rebattle fifty deaths + new [] { "SupremeBossText16", "You didn't die at all huh? Welp, you probably cheated. Do it again, for real this time...but here's your reward I guess." }, //die 0 times + new [] { "SupremeBossText17", "One death? That's it? ...I guess you earned this then." }, //die 1 time and win + new [] { "SupremeBossText18", "Two deaths, nice job. Here's your reward." }, //die 2 times and win + new [] { "SupremeBossText19", "Third time's the charm. Here's a special reward." }, //die 3 times and win + new [] { "EdgyBossText", "Don't get cocky, kid!" }, + new [] { "EdgyBossText2", "You think...you can butcher...ME!?" }, + new [] { "EdgyBossText3", "A fatal mistake!" }, + new [] { "EdgyBossText4", "Good luck recovering from that!" }, + new [] { "EdgyBossText5", "Delicious..." }, + new [] { "EdgyBossText6", "Did that hurt?" }, + new [] { "EdgyBossText7", "Nothing personal, kid." }, + new [] { "EdgyBossText8", "Are you honestly that bad at dodging?" }, + new [] { "EdgyBossText9", "Of all my segments to get hit by..." }, + new [] { "EdgyBossText10", "It's not over yet, kid!" }, + new [] { "EdgyBossText11", "A GOD DOES NOT FEAR DEATH!" }, + new [] { "EdgyBossText12", "You are no god...but I shall feast upon your essence regardless!" }, + new [] { "DoGBossText", "The frigid moon shimmers brightly." }, + new [] { "DoGBossText2", "The harvest moon glows eerily." }, + new [] { "AstralText", "A star has fallen from the heavens!" }, + new [] { "AstralBossText", "The seal of the stars has been broken!" }, + new [] { "CalamitasBossText", "You underestimate my power..." }, + new [] { "CalamitasBossText2", "The brothers have awoken!" }, + new [] { "CalamitasBossText3", "Impressive child, most impressive..." }, + new [] { "CalamitasBossText4", "The brothers have been reborn!" }, + new [] { "CryogenBossText", "Cryogen is derping out!" }, + new [] { "BloodMoonText", "The Blood Moon is rising..." }, + new [] { "DargonBossText", "The dark sun awaits." }, + new [] { "DargonBossText2", "My dragon deems you an unworthy opponent. You must acquire the power of the dark sun to witness his true power." }, + new [] { "DargonBossText3", "My dragon deems you an unworthy opponent. Snuff out the profaned flame and destroy the god devourer to witness his true power." }, + new [] { "DeathText", "Death is active, enjoy the fun." }, + new [] { "DeathText2", "Death is not active, not fun enough for you?" }, + new [] { "ArmageddonText", "Bosses will now kill you instantly." }, + new [] { "ArmageddonText2", "Bosses will no longer kill you instantly." }, + new [] { "DefiledText", "Your soul is mine..." }, + new [] { "DefiledText2", "Your soul is yours once more..." }, + new [] { "FlameText", "The air is getting warmer around you." }, + new [] { "BossRushStartText", "Hmm? Ah, another contender. Very well, may the ritual commence!" }, + new [] { "BossRushTierOneEndText", "Hmm? Oh, you're still alive. Unexpected, but don't get complacent just yet." }, + new [] { "BossRushTierTwoEndText", "Hmm? Persistent aren't you? Perhaps you have some hope of prosperity, unlike past challengers." }, + new [] { "BossRushTierThreeEndText", "Hmm? Your perseverance is truly a trait to behold. You've come further than even the demigods in such a short time." }, + new [] { "BossRushTierThreeEndText2", "May your skills remain sharp for the last challenges." }, + new [] { "BossRushTierFourEndText", "Hmm? So you've made it to the final tier, a remarkable feat enviable by even the mightiest of the gods." }, + new [] { "BossRushTierFourEndText2", "Go forth and conquer 'til the ritual's end!" }, + new [] { "BossRushTierFiveEndText", "Hmm? You expected a reward beyond this mere pebble? Patience, the true reward will become apparent in time..." }, + new [] { "BossSpawnText", "Something is approaching..." }, + new [] { "MeleeLevelUp", "Melee weapon proficiency level up!" }, + new [] { "MeleeLevelUpFinal", "Melee weapon proficiency maxed out!" }, + new [] { "RangedLevelUp", "Ranged weapon proficiency level up!" }, + new [] { "RangedLevelUpFinal", "Ranged weapon proficiency maxed out!" }, + new [] { "MagicLevelUp", "Magic weapon proficiency level up!" }, + new [] { "MagicLevelUpFinal", "Magic weapon proficiency maxed out!" }, + new [] { "SummonLevelUp", "Summoner weapon proficiency level up!" }, + new [] { "SummonLevelUpFinal", "Summoner weapon proficiency maxed out!" }, + new [] { "RogueLevelUp", "Rogue weapon proficiency level up!" }, + new [] { "RogueLevelUpFinal", "Rogue weapon proficiency maxed out!" }, + new [] { "OpenSunkenSea", "The depths of the underground desert are rumbling..." } + }; + } + + public static void Unload() + { + _localizations = null; + } + + public static void AddLocalizations() + { + Load(); + foreach (string[] localization in _localizations) + { + ModTranslation text = CalamityMod.Instance.CreateTranslation(localization[0]); + text.SetDefault(localization[1]); + CalamityMod.Instance.AddTranslation(text); + } + Unload(); + } + } +} diff --git a/CalamityMod.cs b/CalamityMod.cs index 86d31bf9ce..d1b8a2f8f7 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -32,1903 +32,1303 @@ using CalamityMod.Skies; namespace CalamityMod { - public class CalamityMod : Mod - { - public static ModHotKey AegisHotKey; + public class CalamityMod : Mod + { + //Hotkeys + public static ModHotKey NormalityRelocatorHotKey; + public static ModHotKey AegisHotKey; + public static ModHotKey TarraHotKey; + public static ModHotKey RageHotKey; + public static ModHotKey AdrenalineHotKey; + public static ModHotKey AstralTeleportHotKey; + public static ModHotKey AstralArcanumUIHotkey; + public static ModHotKey BossBarToggleHotKey; + public static ModHotKey BossBarToggleSmallTextHotKey; - public static ModHotKey TarraHotKey; + //Boss Spawners + public static int ghostKillCount = 0; + public static int sharkKillCount = 0; - public static ModHotKey RageHotKey; + //Textures & Shaders + public static Texture2D heartOriginal2; + public static Texture2D heartOriginal; + public static Texture2D rainOriginal; + public static Texture2D manaOriginal; + public static Texture2D carpetOriginal; + public static Texture2D AstralCactusTexture; + public static Texture2D AstralCactusGlowTexture; + public static Texture2D AstralSky; + public static Effect CustomShader; - public static ModHotKey AdrenalineHotKey; + //Lists + public static IList donatorList; + public static List rangedProjectileExceptionList; + public static List projectileMinionList; + public static List enemyImmunityList; + public static List dungeonEnemyBuffList; + public static List bossScaleList; + public static List beeEnemyList; + public static List beeProjectileList; + public static List hardModeNerfList; + public static List debuffList; + public static List fireWeaponList; + public static List natureWeaponList; + public static List alcoholList; + public static List doubleDamageBuffList; //100% buff + public static List sixtySixDamageBuffList; //66% buff + public static List fiftyDamageBuffList; //50% buff + public static List thirtyThreeDamageBuffList; //33% buff + public static List twentyFiveDamageBuffList; //25% buff + public static List twentyDamageBuffList; //20% buff + public static List weaponAutoreuseList; + public static List quarterDamageNerfList; //25% nerf + public static List pumpkinMoonBuffList; + public static List frostMoonBuffList; + public static List eclipseBuffList; + public static List eventProjectileBuffList; + public static List revengeanceEnemyBuffList; + public static List revengeanceProjectileBuffList; + public static List trapProjectileList; + public static List scopedWeaponList; - public static ModHotKey AstralTeleportHotKey; + public static CalamityMod Instance; - public static ModHotKey AstralArcanumUIHotkey; - - public static ModHotKey BossBarToggleHotKey; - - public static ModHotKey BossBarToggleSmallTextHotKey; - - public static int ghostKillCount = 0; - - public static int sharkKillCount = 0; - - public static Texture2D heartOriginal2; - - public static Texture2D heartOriginal; - - public static Texture2D rainOriginal; - - public static Texture2D manaOriginal; - - public static Texture2D carpetOriginal; - - public static Texture2D AstralCactusTexture; - - public static Texture2D AstralCactusGlowTexture; - - public static Texture2D AstralSky; - - public static Effect CustomShader; - - public static IList donatorList; - - public static List rangedProjectileExceptionList; - - public static List projectileMinionList; - - public static List enemyImmunityList; - - public static List hardModeNerfExceptionList; - - public static List dungeonEnemyBuffList; - - public static List bossScaleList; - - public static List beeEnemyList; - - public static List beeProjectileList; - - public static List hardModeNerfList; - - public static List debuffList; - - public static List fireWeaponList; - - public static List natureWeaponList; - - public static List alcoholList; - - public static List doubleDamageBuffList; //100% buff - - public static List sixtySixDamageBuffList; //66% buff - - public static List fiftyDamageBuffList; //50% buff - - public static List thirtyThreeDamageBuffList; //33% buff - - public static List twentyFiveDamageBuffList; //25% buff - - public static List twentyDamageBuffList; //20% buff - - public static List weaponAutoreuseList; - - public static List quarterDamageNerfList; //25% nerf - - public static List lightGreenThrowingRarityList; - - public static List greenThrowingRarityList; - - public static List blueThrowingRarityList; - - public static List purpleThrowingRarityList; - - public static List throwingProjectileList; - - public static List throwingItemList; - - public static List pumpkinMoonBuffList; - - public static List frostMoonBuffList; - - public static List eclipseBuffList; - - public static List eventProjectileBuffList; - - public static List revengeanceEnemyBuffList; - - public static List revengeanceProjectileBuffList; - - public static List trapProjectileList; - - public static CalamityMod Instance; - - public CalamityMod() - { - Instance = this; - } - - #region Load - public override void Load() + public CalamityMod() { - Main.tile = new Tile[8401, 2601]; - Main.Map = new Terraria.Map.WorldMap(Main.maxTilesX, 2601); - Main.mapTargetY = 3; - Main.instance.mapTarget = new RenderTarget2D[Main.mapTargetX, Main.mapTargetY]; - Main.initMap = new bool[Main.mapTargetX, Main.mapTargetY]; - Main.mapWasContentLost = new bool[Main.mapTargetX, Main.mapTargetY]; - - heartOriginal2 = Main.heartTexture; - heartOriginal = Main.heart2Texture; - rainOriginal = Main.rainTexture; - manaOriginal = Main.manaTexture; - carpetOriginal = Main.flyingCarpetTexture; - - RageHotKey = RegisterHotKey("Rage Mode", "V"); - AdrenalineHotKey = RegisterHotKey("Adrenaline Mode", "B"); - AegisHotKey = RegisterHotKey("Elysian Guard", "N"); - TarraHotKey = RegisterHotKey("Armor Set Bonus", "Y"); - AstralTeleportHotKey = RegisterHotKey("Astral Teleport", "P"); - AstralArcanumUIHotkey = RegisterHotKey("Astral Arcanum UI Toggle", "O"); - BossBarToggleHotKey = RegisterHotKey("Boss Health Bar Toggle", "NumPad0"); - BossBarToggleSmallTextHotKey = RegisterHotKey("Boss Health Bar Small Text Toggle", "NumPad1"); - - if (!Main.dedServ) - { - AddEquipTexture(new Items.Armor.AbyssalDivingSuitHead(), null, EquipType.Head, "AbyssalDivingSuitHead", "CalamityMod/Items/Armor/AbyssalDivingSuit_Head"); - AddEquipTexture(new Items.Armor.AbyssalDivingSuitBody(), null, EquipType.Body, "AbyssalDivingSuitBody", "CalamityMod/Items/Armor/AbyssalDivingSuit_Body", "CalamityMod/Items/Armor/AbyssalDivingSuit_Arms"); - AddEquipTexture(new Items.Armor.AbyssalDivingSuitLegs(), null, EquipType.Legs, "AbyssalDivingSuitLeg", "CalamityMod/Items/Armor/AbyssalDivingSuit_Legs"); - - AddEquipTexture(new Items.Armor.SirenHead(), null, EquipType.Head, "SirenHead", "CalamityMod/Items/Armor/SirenTrans_Head"); - AddEquipTexture(new Items.Armor.SirenBody(), null, EquipType.Body, "SirenBody", "CalamityMod/Items/Armor/SirenTrans_Body", "CalamityMod/Items/Armor/SirenTrans_Arms"); - AddEquipTexture(new Items.Armor.SirenLegs(), null, EquipType.Legs, "SirenLeg", "CalamityMod/Items/Armor/SirenTrans_Legs"); - - AddEquipTexture(new Items.Armor.SirenHeadAlt(), null, EquipType.Head, "SirenHeadAlt", "CalamityMod/Items/Armor/SirenTransAlt_Head"); - AddEquipTexture(new Items.Armor.SirenBodyAlt(), null, EquipType.Body, "SirenBodyAlt", "CalamityMod/Items/Armor/SirenTransAlt_Body", "CalamityMod/Items/Armor/SirenTransAlt_Arms"); - AddEquipTexture(new Items.Armor.SirenLegsAlt(), null, EquipType.Legs, "SirenLegAlt", "CalamityMod/Items/Armor/SirenTransAlt_Legs"); - - AddEquipTexture(new Items.Permafrost.PopoHead(), null, EquipType.Head, "PopoHead", "CalamityMod/Items/Permafrost/Popo_Head"); - AddEquipTexture(new Items.Permafrost.PopoNoselessHead(), null, EquipType.Head, "PopoNoselessHead", "CalamityMod/Items/Permafrost/PopoNoseless_Head"); - AddEquipTexture(new Items.Permafrost.PopoBody(), null, EquipType.Body, "PopoBody", "CalamityMod/Items/Permafrost/Popo_Body", "CalamityMod/Items/Permafrost/Popo_Arms"); - AddEquipTexture(new Items.Permafrost.PopoLegs(), null, EquipType.Legs, "PopoLeg", "CalamityMod/Items/Permafrost/Popo_Legs"); - - AstralCactusTexture = GetTexture("ExtraTextures/Tiles/AstralCactus"); - AstralCactusGlowTexture = GetTexture("ExtraTextures/Tiles/AstralCactusGlow"); - AstralSky = GetTexture("ExtraTextures/AstralSky"); - CustomShader = GetEffect("Effects/CustomShader"); - - Filters.Scene["CalamityMod:DevourerofGodsHead"] = new Filter(new DoGScreenShaderData("FilterMiniTower").UseColor(0.4f, 0.1f, 1.0f).UseOpacity(0.5f), EffectPriority.VeryHigh); - SkyManager.Instance["CalamityMod:DevourerofGodsHead"] = new DoGSky(); - - Filters.Scene["CalamityMod:DevourerofGodsHeadS"] = new Filter(new DoGScreenShaderDataS("FilterMiniTower").UseColor(0.4f, 0.1f, 1.0f).UseOpacity(0.5f), EffectPriority.VeryHigh); - SkyManager.Instance["CalamityMod:DevourerofGodsHeadS"] = new DoGSkyS(); - - Filters.Scene["CalamityMod:CalamitasRun3"] = new Filter(new CalScreenShaderData("FilterMiniTower").UseColor(1.1f, 0.3f, 0.3f).UseOpacity(0.6f), EffectPriority.VeryHigh); - SkyManager.Instance["CalamityMod:CalamitasRun3"] = new CalSky(); - - Filters.Scene["CalamityMod:PlaguebringerGoliath"] = new Filter(new PbGScreenShaderData("FilterMiniTower").UseColor(0.2f, 0.6f, 0.2f).UseOpacity(0.65f), EffectPriority.VeryHigh); - SkyManager.Instance["CalamityMod:PlaguebringerGoliath"] = new PbGSky(); - - Filters.Scene["CalamityMod:Yharon"] = new Filter(new YScreenShaderData("FilterMiniTower").UseColor(1f, 0.4f, 0f).UseOpacity(0.75f), EffectPriority.VeryHigh); - SkyManager.Instance["CalamityMod:Yharon"] = new YSky(); - - Filters.Scene["CalamityMod:Leviathan"] = new Filter(new LevScreenShaderData("FilterMiniTower").UseColor(0f, 0f, 0.5f).UseOpacity(0.5f), EffectPriority.VeryHigh); - SkyManager.Instance["CalamityMod:Leviathan"] = new LevSky(); - - Filters.Scene["CalamityMod:Providence"] = new Filter(new ProvScreenShaderData("FilterMiniTower").UseColor(0.6f, 0.45f, 0f).UseOpacity(0.5f), EffectPriority.VeryHigh); - SkyManager.Instance["CalamityMod:Providence"] = new ProvSky(); - - Filters.Scene["CalamityMod:SupremeCalamitas"] = new Filter(new SCalScreenShaderData("FilterMiniTower").UseColor(1.1f, 0.3f, 0.3f).UseOpacity(0.65f), EffectPriority.VeryHigh); - SkyManager.Instance["CalamityMod:SupremeCalamitas"] = new SCalSky(); - - Filters.Scene["CalamityMod:Astral"] = new Filter(new AstralScreenShaderData(new Ref(CustomShader), "AstralPass").UseColor(0.18f, 0.08f, 0.24f), EffectPriority.VeryHigh); - SkyManager.Instance["CalamityMod:Astral"] = new AstralSky(); - - Mod mod = ModLoader.GetMod("CalamityMod"); - UIHandler.OnLoad(mod); - - AstralArcanumUI.Load(this); - base.Load(); - } - - BossHealthBarManager.Load(this); - base.Load(); - - SetupLists(); - - #region Text - ModTranslation text = CreateTranslation("SkyOreText"); - text.SetDefault("The ground is glittering with cyan light."); - AddTranslation(text); - - text = CreateTranslation("IceOreText"); - text.SetDefault("The ice caves are crackling with frigid energy."); - AddTranslation(text); - - text = CreateTranslation("PlantOreText"); - text.SetDefault("Energized plant matter has formed in the underground."); - AddTranslation(text); - - text = CreateTranslation("TreeOreText"); - text.SetDefault("Fossilized tree bark is bursting through the jungle's mud."); - AddTranslation(text); - - text = CreateTranslation("AuricOreText"); - text.SetDefault("A godly aura has blessed the world's caverns."); - AddTranslation(text); - - text = CreateTranslation("FutureOreText"); - text.SetDefault("A cold and dark energy has materialized in space."); - AddTranslation(text); - - text = CreateTranslation("UglyBossText"); - text.SetDefault("Calamitous creatures now roam free!"); - AddTranslation(text); - - text = CreateTranslation("UglyBossText2"); - text.SetDefault("The ancient ice spirits have been unbound!"); - AddTranslation(text); - - text = CreateTranslation("SteelSkullBossText"); - text.SetDefault("A blood red inferno lingers in the night..."); - AddTranslation(text); - - text = CreateTranslation("PlantBossText"); - text.SetDefault("The ocean depths are trembling."); - AddTranslation(text); - - text = CreateTranslation("BabyBossText"); - text.SetDefault("A plague has befallen the Jungle."); - AddTranslation(text); - - text = CreateTranslation("BabyBossText2"); - text.SetDefault("An ancient automaton roams the land."); - AddTranslation(text); - - text = CreateTranslation("MoonBossText"); - text.SetDefault("The profaned flame blazes fiercely!"); - AddTranslation(text); - - text = CreateTranslation("MoonBossText2"); - text.SetDefault("Cosmic terrors are watching..."); - AddTranslation(text); - - text = CreateTranslation("MoonBossText3"); - text.SetDefault("The bloody moon beckons..."); - AddTranslation(text); - - text = CreateTranslation("PlagueBossText"); - text.SetDefault("PLAGUE NUKE BARRAGE ARMED, PREPARING FOR LAUNCH!!!"); - AddTranslation(text); - - text = CreateTranslation("PlagueBossText2"); - text.SetDefault("MISSILES LAUNCHED, TARGETING ROUTINE INITIATED!!!"); - AddTranslation(text); - - text = CreateTranslation("ProfanedBossText"); - text.SetDefault("The air is burning..."); - AddTranslation(text); - - text = CreateTranslation("ProfanedBossText2"); - text.SetDefault("Shrieks are echoing from the dungeon."); - AddTranslation(text); - - text = CreateTranslation("ProfanedBossText3"); - text.SetDefault("The calamitous beings have been inundated with bloodstone."); - AddTranslation(text); - - text = CreateTranslation("GhostBossText"); - text.SetDefault("The abyssal spirits have been disturbed."); - AddTranslation(text); - - text = CreateTranslation("SupremeBossText3"); //start - text.SetDefault("Alright, let's get started. Not sure why you're bothering."); - AddTranslation(text); - - text = CreateTranslation("SupremeBossText4"); //75% - text.SetDefault("You seem so confident...yet painfully ignorant of what has yet to transpire."); - AddTranslation(text); - - text = CreateTranslation("SupremeBossText5"); //50% - text.SetDefault("Couldn't leave well enough alone could you? Everything was going well until you came along."); - AddTranslation(text); - - text = CreateTranslation("SupremeBossText6"); //45% - text.SetDefault("Brothers, could you assist me for a moment? Dealing with this fool is growing tiresome."); - AddTranslation(text); - - text = CreateTranslation("SupremeBossText"); //40% - text.SetDefault("Don't worry, I still have plenty of tricks left."); - AddTranslation(text); - - text = CreateTranslation("SupremeBossText7"); //30% - text.SetDefault("Hmm...perhaps I should let the little ones out to play for a while."); - AddTranslation(text); - - text = CreateTranslation("SupremeBossText8"); //20% - text.SetDefault("Impressive...but still not good enough!"); - AddTranslation(text); - - text = CreateTranslation("SupremeBossText9"); //10% - text.SetDefault("I'm just getting started!"); - AddTranslation(text); - - text = CreateTranslation("SupremeBossText20"); //8% - text.SetDefault("What!? How are you still alive!?"); - AddTranslation(text); - - text = CreateTranslation("SupremeBossText21"); //6% - text.SetDefault("Just stop!"); - AddTranslation(text); - - text = CreateTranslation("SupremeBossText22"); //4% - text.SetDefault("Even if you defeat me you still have my lord to contend with!"); - AddTranslation(text); - - text = CreateTranslation("SupremeBossText23"); //2% - text.SetDefault("To this day he has yet to lose a battle!"); - AddTranslation(text); - - text = CreateTranslation("SupremeBossText24"); //1% - text.SetDefault("Not even I could defeat him! What hope do YOU have!?"); - AddTranslation(text); - - text = CreateTranslation("SupremeBossText25"); //1% after 10 seconds - text.SetDefault("He has grown far stronger since we fought...I can't see you defeating him, at least not with your current strength."); - AddTranslation(text); - - text = CreateTranslation("SupremeBossText26"); //1% after 15 seconds - text.SetDefault("Well...I guess this is the end..."); - AddTranslation(text); - - text = CreateTranslation("SupremeBossText27"); //1% after first win - text.SetDefault("Perhaps one of these times I'll change my mind after all these deaths..."); - AddTranslation(text); - - text = CreateTranslation("SupremeBossText28"); //not taking enough damage - text.SetDefault("You aren't hurting as much as I'd like...are you cheating?"); - AddTranslation(text); - - text = CreateTranslation("SupremeBossText2"); //cheater - text.SetDefault("Go to hell."); - AddTranslation(text); - - text = CreateTranslation("SupremeBossText10"); //end after 20 seconds - text.SetDefault("At long last I am free...no...wait. I'll just keep coming back, like you. Funny how that works...isn't it?"); - AddTranslation(text); - - text = CreateTranslation("SupremeBossText11"); //rebattle after killing once - text.SetDefault("Do you enjoy going through hell?"); - AddTranslation(text); - - text = CreateTranslation("SupremeBossText12"); //rebattle after killing four times - text.SetDefault("Don't get me wrong, I like pain too, but you're just ridiculous."); - AddTranslation(text); - - text = CreateTranslation("SupremeBossText13"); //rebattle five deaths - text.SetDefault("You must enjoy dying more than most people, huh?"); - AddTranslation(text); - - text = CreateTranslation("SupremeBossText14"); //rebattle twenty deaths - text.SetDefault("Do you have a fetish for getting killed or something?"); - AddTranslation(text); - - text = CreateTranslation("SupremeBossText15"); //rebattle fifty deaths - text.SetDefault("Alright, I'm done counting. You probably died this much just to see what I'd say."); - AddTranslation(text); - - text = CreateTranslation("SupremeBossText16"); //die 0 times - text.SetDefault("You didn't die at all huh? Welp, you probably cheated then. Do it again, for real this time...but here's your reward I guess."); - AddTranslation(text); - - text = CreateTranslation("SupremeBossText17"); //die 1 time and win - text.SetDefault("One death? That's it? ...I guess you earned this then."); - AddTranslation(text); - - text = CreateTranslation("SupremeBossText18"); //die 2 times and win - text.SetDefault("Two deaths. Good job. Here's your reward."); - AddTranslation(text); - - text = CreateTranslation("SupremeBossText19"); //die 3 times and win - text.SetDefault("Third time's the charm huh? I guess it is. Here's a special reward."); - AddTranslation(text); - - text = CreateTranslation("EdgyBossText"); - text.SetDefault("Don't get cocky, kid!"); - AddTranslation(text); - - text = CreateTranslation("EdgyBossText2"); - text.SetDefault("You think...you can butcher...ME!?"); - AddTranslation(text); - - text = CreateTranslation("EdgyBossText3"); - text.SetDefault("A fatal mistake!"); - AddTranslation(text); - - text = CreateTranslation("EdgyBossText4"); - text.SetDefault("Good luck recovering from that!"); - AddTranslation(text); - - text = CreateTranslation("EdgyBossText5"); - text.SetDefault("Delicious..."); - AddTranslation(text); - - text = CreateTranslation("EdgyBossText6"); - text.SetDefault("Did that hurt?"); - AddTranslation(text); - - text = CreateTranslation("EdgyBossText7"); - text.SetDefault("Nothing personal, kid."); - AddTranslation(text); - - text = CreateTranslation("EdgyBossText8"); - text.SetDefault("Are you honestly that bad at dodging?"); - AddTranslation(text); - - text = CreateTranslation("EdgyBossText9"); - text.SetDefault("Of all my segments to get hit by..."); - AddTranslation(text); - - text = CreateTranslation("EdgyBossText10"); - text.SetDefault("It's not over yet, kid!"); - AddTranslation(text); - - text = CreateTranslation("EdgyBossText11"); - text.SetDefault("A GOD DOES NOT FEAR DEATH!"); - AddTranslation(text); - - text = CreateTranslation("EdgyBossText12"); - text.SetDefault("You are no god...but I shall feast upon your essence regardless!"); - AddTranslation(text); - - text = CreateTranslation("EdgyBossText13"); - text.SetDefault("SO WEAK!"); - AddTranslation(text); - - text = CreateTranslation("EdgyBossText14"); - text.SetDefault("YOU FOOL!"); - AddTranslation(text); - - text = CreateTranslation("EdgyBossText15"); - text.SetDefault("DOES IT HURT!?"); - AddTranslation(text); - - text = CreateTranslation("EdgyBossText16"); - text.SetDefault("WHY DIDN'T YOU DODGE!?"); - AddTranslation(text); - - text = CreateTranslation("EdgyBossText17"); - text.SetDefault("NO! I AM THE ONE ABOVE ALL! I WILL CONSUME YOUR UNIVERSE!"); - AddTranslation(text); - - text = CreateTranslation("EdgyBossText18"); - text.SetDefault("YOU CAN'T BUTCHER A GOD!"); - AddTranslation(text); - - text = CreateTranslation("DoGBossText"); - text.SetDefault("The frigid moon shimmers brightly."); - AddTranslation(text); - - text = CreateTranslation("DoGBossText2"); - text.SetDefault("The harvest moon glows eerily."); - AddTranslation(text); - - text = CreateTranslation("AstralText"); - text.SetDefault("A star has fallen from the heavens!"); - AddTranslation(text); - - text = CreateTranslation("AstralBossText"); - text.SetDefault("The seal of the stars has been broken! You can now mine Astral Ore!"); - AddTranslation(text); - - text = CreateTranslation("CalamitasBossText"); - text.SetDefault("You underestimate my power..."); - AddTranslation(text); - - text = CreateTranslation("CalamitasBossText2"); - text.SetDefault("The brothers have awoken!"); - AddTranslation(text); - - text = CreateTranslation("CalamitasBossText3"); - text.SetDefault("Impressive child, most impressive..."); - AddTranslation(text); - - text = CreateTranslation("CalamitasBossText4"); - text.SetDefault("The brothers have been reborn!"); - AddTranslation(text); - - text = CreateTranslation("CryogenBossText"); - text.SetDefault("Cryogen is derping out!"); - AddTranslation(text); - - text = CreateTranslation("BloodMoonText"); - text.SetDefault("The Blood Moon is rising..."); - AddTranslation(text); - - text = CreateTranslation("DargonBossText"); - text.SetDefault("The dark sun awaits."); - AddTranslation(text); - - text = CreateTranslation("DargonBossText2"); - text.SetDefault("My dragon deems you an unworthy opponent. You must acquire the power of the dark sun to witness his true power."); - AddTranslation(text); - - text = CreateTranslation("DargonBossText3"); - text.SetDefault("My dragon deems you an unworthy opponent. Snuff out the profaned flame and destroy the god devourer to witness his true power."); - AddTranslation(text); - - text = CreateTranslation("DeathText"); - text.SetDefault("Death is active, enjoy the fun."); - AddTranslation(text); - - text = CreateTranslation("DeathText2"); - text.SetDefault("Death is not active, not fun enough for you?"); - AddTranslation(text); - - text = CreateTranslation("ArmageddonText"); - text.SetDefault("Bosses will now kill you instantly."); - AddTranslation(text); - - text = CreateTranslation("ArmageddonText2"); - text.SetDefault("Bosses will no longer kill you instantly."); - AddTranslation(text); - - text = CreateTranslation("DefiledText"); - text.SetDefault("Your soul is mine..."); - AddTranslation(text); - - text = CreateTranslation("DefiledText2"); - text.SetDefault("Your soul is yours once more..."); - AddTranslation(text); - - text = CreateTranslation("FlameText"); - text.SetDefault("The air is getting warmer around you."); - AddTranslation(text); - - text = CreateTranslation("BossRushStartText"); - text.SetDefault("Hmm? Ah, another contender. Very well, may the ritual commence!"); - AddTranslation(text); - - text = CreateTranslation("BossRushTierOneEndText"); - text.SetDefault("Hmm? Oh, you're still alive. Unexpected and exhilarating, but don't get complacent just yet."); - AddTranslation(text); - - text = CreateTranslation("BossRushTierTwoEndText"); - text.SetDefault("Hmm? Persistent aren't you? Perhaps you have some hope of prosperity, unlike past challengers."); - AddTranslation(text); - - text = CreateTranslation("BossRushTierThreeEndText"); - text.SetDefault("Hmm? Your perseverance is truly a trait to behold. You've come further than even the demigods in such a short time."); - AddTranslation(text); - - text = CreateTranslation("BossRushTierThreeEndText2"); - text.SetDefault("May your skills remain sharp for the last challenges."); - AddTranslation(text); - - text = CreateTranslation("BossRushTierFourEndText"); - text.SetDefault("Hmm? So you've made it to the final tier, a remarkable feat enviable by even the mightiest of the gods."); - AddTranslation(text); - - text = CreateTranslation("BossRushTierFourEndText2"); - text.SetDefault("Go forth and conquer 'til the ritual's end!"); - AddTranslation(text); - - text = CreateTranslation("BossRushTierFiveEndText"); - text.SetDefault("Hmm? You expected a reward beyond this mere pebble? Patience, the true reward will come apparent in time..."); - AddTranslation(text); - - text = CreateTranslation("BossSpawnText"); - text.SetDefault("Something is approaching..."); - AddTranslation(text); - - text = CreateTranslation("MeleeLevelUp"); - text.SetDefault("Melee weapon proficiency level up!"); - AddTranslation(text); - - text = CreateTranslation("MeleeLevelUpFinal"); - text.SetDefault("Melee weapon proficiency maxed out!"); - AddTranslation(text); - - text = CreateTranslation("RangedLevelUp"); - text.SetDefault("Ranged weapon proficiency level up!"); - AddTranslation(text); - - text = CreateTranslation("RangedLevelUpFinal"); - text.SetDefault("Ranged weapon proficiency maxed out!"); - AddTranslation(text); - - text = CreateTranslation("MagicLevelUp"); - text.SetDefault("Magic weapon proficiency level up!"); - AddTranslation(text); - - text = CreateTranslation("MagicLevelUpFinal"); - text.SetDefault("Magic weapon proficiency maxed out!"); - AddTranslation(text); - - text = CreateTranslation("SummonLevelUp"); - text.SetDefault("Summoner weapon proficiency level up!"); - AddTranslation(text); - - text = CreateTranslation("SummonLevelUpFinal"); - text.SetDefault("Summoner weapon proficiency maxed out!"); - AddTranslation(text); - - text = CreateTranslation("RogueLevelUp"); - text.SetDefault("Rogue weapon proficiency level up!"); - AddTranslation(text); - - text = CreateTranslation("RogueLevelUpFinal"); - text.SetDefault("Rogue weapon proficiency maxed out!"); - AddTranslation(text); - #endregion - } - #endregion - - #region Unload - public override void Unload() - { - RageHotKey = null; - AdrenalineHotKey = null; - AegisHotKey = null; - TarraHotKey = null; - AstralTeleportHotKey = null; - AstralArcanumUIHotkey = null; - BossBarToggleHotKey = null; - BossBarToggleSmallTextHotKey = null; - - AstralCactusTexture = null; - AstralCactusGlowTexture = null; - AstralSky = null; - - donatorList = null; - - rangedProjectileExceptionList = null; - projectileMinionList = null; - enemyImmunityList = null; - hardModeNerfExceptionList = null; - dungeonEnemyBuffList = null; - bossScaleList = null; - beeEnemyList = null; - beeProjectileList = null; - hardModeNerfList = null; - debuffList = null; - fireWeaponList = null; - natureWeaponList = null; - alcoholList = null; - doubleDamageBuffList = null; - sixtySixDamageBuffList = null; - fiftyDamageBuffList = null; - thirtyThreeDamageBuffList = null; - twentyFiveDamageBuffList = null; - weaponAutoreuseList = null; - quarterDamageNerfList = null; - lightGreenThrowingRarityList = null; - greenThrowingRarityList = null; - blueThrowingRarityList = null; - purpleThrowingRarityList = null; - throwingProjectileList = null; - throwingItemList = null; - pumpkinMoonBuffList = null; - frostMoonBuffList = null; - eclipseBuffList = null; - eventProjectileBuffList = null; - revengeanceEnemyBuffList = null; - revengeanceProjectileBuffList = null; - trapProjectileList = null; - - BossHealthBarManager.Unload(); - base.Unload(); - - AstralArcanumUI.Unload(); - base.Unload(); - - Instance = null; - - //Injections.Unload(); - //base.Unload(); - - if (!Main.dedServ) - { - Main.music[MusicID.Hell] = Main.soundBank.GetCue("Music_" + MusicID.Hell); //remove in 1.4.1 - - Main.heartTexture = heartOriginal2; - Main.heart2Texture = heartOriginal; - Main.rainTexture = rainOriginal; - Main.manaTexture = manaOriginal; - Main.flyingCarpetTexture = carpetOriginal; - } - } - #endregion - - #region SetupLists - public static void SetupLists() - { - donatorList = new List(); - - donatorList.Add("Vorbis"); - donatorList.Add("SoloMael"); - donatorList.Add("Chaotic Reks"); - donatorList.Add("The Buildmonger"); - donatorList.Add("Yuh"); - donatorList.Add("Littlepiggy"); - donatorList.Add("LompL"); - donatorList.Add("Lilith Saintclaire"); - donatorList.Add("Ben Shapiro"); - donatorList.Add("Frederik Henschel"); - donatorList.Add("Faye"); - donatorList.Add("Gibb50"); - donatorList.Add("Braden Hajer"); - donatorList.Add("Hannes Holmlund"); - donatorList.Add("profoundmango69"); - donatorList.Add("Jack M Sargent"); - donatorList.Add("Hans Volter"); - donatorList.Add("Krankwagon"); - donatorList.Add("MishiroUsui"); - donatorList.Add("pixlgray"); - donatorList.Add("Arkhine"); - donatorList.Add("Lodude"); - donatorList.Add("DevAesthetic"); - donatorList.Add("Mister Winchester"); - donatorList.Add("Zacky"); - donatorList.Add("Veine"); - - rangedProjectileExceptionList = new List(); - - rangedProjectileExceptionList.Add(ProjectileID.Phantasm); - rangedProjectileExceptionList.Add(ProjectileID.VortexBeater); - rangedProjectileExceptionList.Add(ProjectileID.DD2PhoenixBow); - - projectileMinionList = new List(); - - projectileMinionList.Add(ProjectileID.PygmySpear); - projectileMinionList.Add(ProjectileID.UFOMinion); - projectileMinionList.Add(ProjectileID.UFOLaser); - projectileMinionList.Add(ProjectileID.StardustCellMinionShot); - projectileMinionList.Add(ProjectileID.MiniSharkron); - projectileMinionList.Add(ProjectileID.MiniRetinaLaser); - projectileMinionList.Add(ProjectileID.ImpFireball); - projectileMinionList.Add(ProjectileID.HornetStinger); - projectileMinionList.Add(ProjectileID.DD2FlameBurstTowerT1Shot); - projectileMinionList.Add(ProjectileID.DD2FlameBurstTowerT2Shot); - projectileMinionList.Add(ProjectileID.DD2FlameBurstTowerT3Shot); - projectileMinionList.Add(ProjectileID.DD2BallistraProj); - projectileMinionList.Add(ProjectileID.DD2ExplosiveTrapT1Explosion); - projectileMinionList.Add(ProjectileID.DD2ExplosiveTrapT2Explosion); - projectileMinionList.Add(ProjectileID.DD2ExplosiveTrapT3Explosion); - projectileMinionList.Add(ProjectileID.SpiderEgg); - projectileMinionList.Add(ProjectileID.BabySpider); - projectileMinionList.Add(ProjectileID.FrostBlastFriendly); - projectileMinionList.Add(ProjectileID.MoonlordTurretLaser); - projectileMinionList.Add(ProjectileID.RainbowCrystalExplosion); - - enemyImmunityList = new List(); - - enemyImmunityList.Add(NPCID.QueenBee); - enemyImmunityList.Add(NPCID.WallofFlesh); - enemyImmunityList.Add(NPCID.WallofFleshEye); - enemyImmunityList.Add(NPCID.Retinazer); - enemyImmunityList.Add(NPCID.Spazmatism); - enemyImmunityList.Add(NPCID.SkeletronPrime); - enemyImmunityList.Add(NPCID.PrimeCannon); - enemyImmunityList.Add(NPCID.PrimeSaw); - enemyImmunityList.Add(NPCID.PrimeLaser); - enemyImmunityList.Add(NPCID.PrimeVice); - enemyImmunityList.Add(NPCID.Plantera); - enemyImmunityList.Add(NPCID.IceQueen); - enemyImmunityList.Add(NPCID.Pumpking); - enemyImmunityList.Add(NPCID.Mothron); - enemyImmunityList.Add(NPCID.Golem); - enemyImmunityList.Add(NPCID.GolemHead); - enemyImmunityList.Add(NPCID.GolemFistRight); - enemyImmunityList.Add(NPCID.GolemFistLeft); - enemyImmunityList.Add(NPCID.DukeFishron); - enemyImmunityList.Add(NPCID.CultistBoss); - enemyImmunityList.Add(NPCID.MoonLordHead); - enemyImmunityList.Add(NPCID.MoonLordHand); - enemyImmunityList.Add(NPCID.MoonLordCore); - enemyImmunityList.Add(NPCID.MoonLordFreeEye); - - hardModeNerfExceptionList = new List(); - - hardModeNerfExceptionList.Add(NPCID.Probe); - hardModeNerfExceptionList.Add(NPCID.TheHungry); - hardModeNerfExceptionList.Add(NPCID.TheHungryII); - hardModeNerfExceptionList.Add(NPCID.WallofFleshEye); - hardModeNerfExceptionList.Add(NPCID.Creeper); - hardModeNerfExceptionList.Add(NPCID.EaterofWorldsHead); - hardModeNerfExceptionList.Add(NPCID.EaterofWorldsBody); - hardModeNerfExceptionList.Add(NPCID.EaterofWorldsTail); - hardModeNerfExceptionList.Add(NPCID.SkeletronHand); - - dungeonEnemyBuffList = new List(); - - dungeonEnemyBuffList.Add(NPCID.SkeletonSniper); - dungeonEnemyBuffList.Add(NPCID.TacticalSkeleton); - dungeonEnemyBuffList.Add(NPCID.SkeletonCommando); - dungeonEnemyBuffList.Add(NPCID.Paladin); - dungeonEnemyBuffList.Add(NPCID.GiantCursedSkull); - dungeonEnemyBuffList.Add(NPCID.BoneLee); - dungeonEnemyBuffList.Add(NPCID.DiabolistWhite); - dungeonEnemyBuffList.Add(NPCID.DiabolistRed); - dungeonEnemyBuffList.Add(NPCID.NecromancerArmored); - dungeonEnemyBuffList.Add(NPCID.Necromancer); - dungeonEnemyBuffList.Add(NPCID.RaggedCasterOpenCoat); - dungeonEnemyBuffList.Add(NPCID.RaggedCaster); - dungeonEnemyBuffList.Add(NPCID.HellArmoredBonesSword); - dungeonEnemyBuffList.Add(NPCID.HellArmoredBonesMace); - dungeonEnemyBuffList.Add(NPCID.HellArmoredBonesSpikeShield); - dungeonEnemyBuffList.Add(NPCID.HellArmoredBones); - dungeonEnemyBuffList.Add(NPCID.BlueArmoredBonesSword); - dungeonEnemyBuffList.Add(NPCID.BlueArmoredBonesNoPants); - dungeonEnemyBuffList.Add(NPCID.BlueArmoredBonesMace); - dungeonEnemyBuffList.Add(NPCID.BlueArmoredBones); - dungeonEnemyBuffList.Add(NPCID.RustyArmoredBonesSwordNoArmor); - dungeonEnemyBuffList.Add(NPCID.RustyArmoredBonesSword); - dungeonEnemyBuffList.Add(NPCID.RustyArmoredBonesFlail); - dungeonEnemyBuffList.Add(NPCID.RustyArmoredBonesAxe); - - bossScaleList = new List(); - - bossScaleList.Add(NPCID.EaterofWorldsHead); - bossScaleList.Add(NPCID.EaterofWorldsBody); - bossScaleList.Add(NPCID.EaterofWorldsTail); - bossScaleList.Add(NPCID.Creeper); - bossScaleList.Add(NPCID.SkeletronHand); - bossScaleList.Add(NPCID.WallofFleshEye); - bossScaleList.Add(NPCID.TheHungry); - bossScaleList.Add(NPCID.TheHungryII); - bossScaleList.Add(NPCID.TheDestroyerBody); - bossScaleList.Add(NPCID.TheDestroyerTail); - bossScaleList.Add(NPCID.PrimeCannon); - bossScaleList.Add(NPCID.PrimeVice); - bossScaleList.Add(NPCID.PrimeSaw); - bossScaleList.Add(NPCID.PrimeLaser); - bossScaleList.Add(NPCID.PlanterasTentacle); - bossScaleList.Add(NPCID.Pumpking); - bossScaleList.Add(NPCID.IceQueen); - bossScaleList.Add(NPCID.Mothron); - bossScaleList.Add(NPCID.GolemHead); - - beeEnemyList = new List(); - - beeEnemyList.Add(NPCID.GiantMossHornet); - beeEnemyList.Add(NPCID.BigMossHornet); - beeEnemyList.Add(NPCID.LittleMossHornet); - beeEnemyList.Add(NPCID.TinyMossHornet); - beeEnemyList.Add(NPCID.MossHornet); - beeEnemyList.Add(NPCID.VortexHornetQueen); - beeEnemyList.Add(NPCID.VortexHornet); - beeEnemyList.Add(NPCID.Bee); - beeEnemyList.Add(NPCID.BeeSmall); - beeEnemyList.Add(NPCID.QueenBee); - - beeProjectileList = new List(); - - beeProjectileList.Add(ProjectileID.Stinger); - beeProjectileList.Add(ProjectileID.HornetStinger); - - hardModeNerfList = new List(); - - hardModeNerfList.Add(ProjectileID.WebSpit); - hardModeNerfList.Add(ProjectileID.PinkLaser); - hardModeNerfList.Add(ProjectileID.FrostBlastHostile); - hardModeNerfList.Add(ProjectileID.RuneBlast); - hardModeNerfList.Add(ProjectileID.GoldenShowerHostile); - hardModeNerfList.Add(ProjectileID.RainNimbus); - hardModeNerfList.Add(ProjectileID.Stinger); - hardModeNerfList.Add(ProjectileID.FlamingArrow); - hardModeNerfList.Add(ProjectileID.BulletDeadeye); - hardModeNerfList.Add(ProjectileID.CannonballHostile); - - debuffList = new List(); - - debuffList.Add(BuffID.Poisoned); - debuffList.Add(BuffID.Darkness); - debuffList.Add(BuffID.Cursed); - debuffList.Add(BuffID.OnFire); - debuffList.Add(BuffID.Bleeding); - debuffList.Add(BuffID.Confused); - debuffList.Add(BuffID.Slow); - debuffList.Add(BuffID.Weak); - debuffList.Add(BuffID.Silenced); - debuffList.Add(BuffID.BrokenArmor); - debuffList.Add(BuffID.CursedInferno); - debuffList.Add(BuffID.Frostburn); - debuffList.Add(BuffID.Chilled); - debuffList.Add(BuffID.Frozen); - debuffList.Add(BuffID.Burning); - debuffList.Add(BuffID.Suffocation); - debuffList.Add(BuffID.Ichor); - debuffList.Add(BuffID.Venom); - debuffList.Add(BuffID.Blackout); - debuffList.Add(BuffID.Electrified); - debuffList.Add(BuffID.Rabies); - debuffList.Add(BuffID.Webbed); - debuffList.Add(BuffID.Stoned); - debuffList.Add(BuffID.Dazed); - debuffList.Add(BuffID.VortexDebuff); - debuffList.Add(BuffID.WitheredArmor); - debuffList.Add(BuffID.WitheredWeapon); - debuffList.Add(BuffID.OgreSpit); - debuffList.Add(BuffID.BetsysCurse); - - fireWeaponList = new List(); - - fireWeaponList.Add(ItemID.FieryGreatsword); - fireWeaponList.Add(ItemID.DD2SquireDemonSword); - fireWeaponList.Add(ItemID.TheHorsemansBlade); - fireWeaponList.Add(ItemID.DD2SquireBetsySword); - fireWeaponList.Add(ItemID.Cascade); - fireWeaponList.Add(ItemID.HelFire); - fireWeaponList.Add(ItemID.MonkStaffT2); - fireWeaponList.Add(ItemID.Flamarang); - fireWeaponList.Add(ItemID.MoltenFury); - fireWeaponList.Add(ItemID.Sunfury); - fireWeaponList.Add(ItemID.PhoenixBlaster); - fireWeaponList.Add(ItemID.Flamelash); - fireWeaponList.Add(ItemID.SolarEruption); - fireWeaponList.Add(ItemID.DayBreak); - fireWeaponList.Add(ItemID.MonkStaffT3); - fireWeaponList.Add(ItemID.HellwingBow); - fireWeaponList.Add(ItemID.DD2PhoenixBow); - fireWeaponList.Add(ItemID.DD2BetsyBow); - fireWeaponList.Add(ItemID.FlareGun); - fireWeaponList.Add(ItemID.Flamethrower); - fireWeaponList.Add(ItemID.EldMelter); - fireWeaponList.Add(ItemID.FlowerofFire); - fireWeaponList.Add(ItemID.MeteorStaff); - fireWeaponList.Add(ItemID.ApprenticeStaffT3); - fireWeaponList.Add(ItemID.InfernoFork); - fireWeaponList.Add(ItemID.HeatRay); - fireWeaponList.Add(ItemID.BookofSkulls); - fireWeaponList.Add(ItemID.ImpStaff); - fireWeaponList.Add(ItemID.DD2FlameburstTowerT1Popper); - fireWeaponList.Add(ItemID.DD2FlameburstTowerT2Popper); - fireWeaponList.Add(ItemID.DD2FlameburstTowerT3Popper); - fireWeaponList.Add(ItemID.MolotovCocktail); - - natureWeaponList = new List(); - - natureWeaponList.Add(ItemID.BladeofGrass); - natureWeaponList.Add(ItemID.ChlorophyteClaymore); - natureWeaponList.Add(ItemID.ChlorophyteSaber); - natureWeaponList.Add(ItemID.ChlorophytePartisan); - natureWeaponList.Add(ItemID.ChlorophyteShotbow); - natureWeaponList.Add(ItemID.Seedler); - natureWeaponList.Add(ItemID.ChristmasTreeSword); - natureWeaponList.Add(ItemID.TerraBlade); - natureWeaponList.Add(ItemID.JungleYoyo); - natureWeaponList.Add(ItemID.Yelets); - natureWeaponList.Add(ItemID.MushroomSpear); - natureWeaponList.Add(ItemID.ThornChakram); - natureWeaponList.Add(ItemID.Bananarang); - natureWeaponList.Add(ItemID.FlowerPow); - natureWeaponList.Add(ItemID.BeesKnees); - natureWeaponList.Add(ItemID.Toxikarp); - natureWeaponList.Add(ItemID.Bladetongue); - natureWeaponList.Add(ItemID.PoisonStaff); - natureWeaponList.Add(ItemID.VenomStaff); - natureWeaponList.Add(ItemID.StaffofEarth); - natureWeaponList.Add(ItemID.BeeGun); - natureWeaponList.Add(ItemID.LeafBlower); - natureWeaponList.Add(ItemID.WaspGun); - natureWeaponList.Add(ItemID.CrystalSerpent); - natureWeaponList.Add(ItemID.Razorpine); - natureWeaponList.Add(ItemID.HornetStaff); - natureWeaponList.Add(ItemID.QueenSpiderStaff); - natureWeaponList.Add(ItemID.SlimeStaff); - natureWeaponList.Add(ItemID.PygmyStaff); - natureWeaponList.Add(ItemID.RavenStaff); - natureWeaponList.Add(ItemID.BatScepter); - natureWeaponList.Add(ItemID.SpiderStaff); - natureWeaponList.Add(ItemID.Beenade); - natureWeaponList.Add(ItemID.FrostDaggerfish); - - alcoholList = new List(); - - doubleDamageBuffList = new List(); - - doubleDamageBuffList.Add(ItemID.BallOHurt); - doubleDamageBuffList.Add(ItemID.TheMeatball); - doubleDamageBuffList.Add(ItemID.BlueMoon); - doubleDamageBuffList.Add(ItemID.Sunfury); - doubleDamageBuffList.Add(ItemID.DaoofPow); - doubleDamageBuffList.Add(ItemID.FlowerPow); - doubleDamageBuffList.Add(ItemID.Anchor); - doubleDamageBuffList.Add(ItemID.KOCannon); - doubleDamageBuffList.Add(ItemID.GolemFist); - doubleDamageBuffList.Add(ItemID.BreakerBlade); - doubleDamageBuffList.Add(ItemID.SpectreStaff); - doubleDamageBuffList.Add(ItemID.MonkStaffT2); - doubleDamageBuffList.Add(ItemID.ProximityMineLauncher); - doubleDamageBuffList.Add(ItemID.FireworksLauncher); - - sixtySixDamageBuffList = new List(); - - sixtySixDamageBuffList.Add(ItemID.TerraBlade); - sixtySixDamageBuffList.Add(ItemID.TrueNightsEdge); - sixtySixDamageBuffList.Add(ItemID.WandofSparking); - sixtySixDamageBuffList.Add(ItemID.MedusaHead); - sixtySixDamageBuffList.Add(ItemID.StaffofEarth); - sixtySixDamageBuffList.Add(ItemID.ChristmasTreeSword); - sixtySixDamageBuffList.Add(ItemID.MonkStaffT1); - sixtySixDamageBuffList.Add(ItemID.InfernoFork); - sixtySixDamageBuffList.Add(ItemID.VenomStaff); - - fiftyDamageBuffList = new List(); - - fiftyDamageBuffList.Add(ItemID.NightsEdge); - fiftyDamageBuffList.Add(ItemID.EldMelter); - fiftyDamageBuffList.Add(ItemID.Flamethrower); - fiftyDamageBuffList.Add(ItemID.MoonlordTurretStaff); - fiftyDamageBuffList.Add(ItemID.WaspGun); - fiftyDamageBuffList.Add(ItemID.Keybrand); - fiftyDamageBuffList.Add(ItemID.PulseBow); - fiftyDamageBuffList.Add(ItemID.PaladinsHammer); - - thirtyThreeDamageBuffList = new List(); - - thirtyThreeDamageBuffList.Add(ItemID.CrystalVileShard); - thirtyThreeDamageBuffList.Add(ItemID.SoulDrain); - thirtyThreeDamageBuffList.Add(ItemID.ClingerStaff); - thirtyThreeDamageBuffList.Add(ItemID.ChargedBlasterCannon); - thirtyThreeDamageBuffList.Add(ItemID.NettleBurst); - thirtyThreeDamageBuffList.Add(ItemID.Excalibur); - thirtyThreeDamageBuffList.Add(ItemID.AmberStaff); - thirtyThreeDamageBuffList.Add(ItemID.BluePhasesaber); - thirtyThreeDamageBuffList.Add(ItemID.RedPhasesaber); - thirtyThreeDamageBuffList.Add(ItemID.GreenPhasesaber); - thirtyThreeDamageBuffList.Add(ItemID.WhitePhasesaber); - thirtyThreeDamageBuffList.Add(ItemID.YellowPhasesaber); - thirtyThreeDamageBuffList.Add(ItemID.PurplePhasesaber); - thirtyThreeDamageBuffList.Add(ItemID.TheRottedFork); - thirtyThreeDamageBuffList.Add(ItemID.VampireKnives); - - twentyFiveDamageBuffList = new List(); - - twentyFiveDamageBuffList.Add(ItemID.Muramasa); - twentyFiveDamageBuffList.Add(ItemID.StakeLauncher); - - twentyDamageBuffList = new List(); - - twentyDamageBuffList.Add(ItemID.ChainGuillotines); - twentyDamageBuffList.Add(ItemID.FlowerofFrost); - twentyDamageBuffList.Add(ItemID.PoisonStaff); - twentyDamageBuffList.Add(ItemID.Gungnir); - twentyDamageBuffList.Add(ItemID.BookStaff); - - weaponAutoreuseList = new List(); - - weaponAutoreuseList.Add(ItemID.NightsEdge); - weaponAutoreuseList.Add(ItemID.TrueNightsEdge); - weaponAutoreuseList.Add(ItemID.TrueExcalibur); - weaponAutoreuseList.Add(ItemID.PhoenixBlaster); - weaponAutoreuseList.Add(ItemID.VenusMagnum); - weaponAutoreuseList.Add(ItemID.MagicDagger); - weaponAutoreuseList.Add(ItemID.BeamSword); - weaponAutoreuseList.Add(ItemID.MonkStaffT2); - weaponAutoreuseList.Add(ItemID.PaladinsHammer); - - quarterDamageNerfList = new List(); - - quarterDamageNerfList.Add(ItemID.DaedalusStormbow); - quarterDamageNerfList.Add(ItemID.PhoenixBlaster); - quarterDamageNerfList.Add(ItemID.VenusMagnum); - quarterDamageNerfList.Add(ItemID.BlizzardStaff); - - pumpkinMoonBuffList = new List(); - - pumpkinMoonBuffList.Add(NPCID.Scarecrow1); - pumpkinMoonBuffList.Add(NPCID.Scarecrow2); - pumpkinMoonBuffList.Add(NPCID.Scarecrow3); - pumpkinMoonBuffList.Add(NPCID.Scarecrow4); - pumpkinMoonBuffList.Add(NPCID.Scarecrow5); - pumpkinMoonBuffList.Add(NPCID.Scarecrow6); - pumpkinMoonBuffList.Add(NPCID.Scarecrow7); - pumpkinMoonBuffList.Add(NPCID.Scarecrow8); - pumpkinMoonBuffList.Add(NPCID.Scarecrow9); - pumpkinMoonBuffList.Add(NPCID.Scarecrow10); - pumpkinMoonBuffList.Add(NPCID.HeadlessHorseman); - pumpkinMoonBuffList.Add(NPCID.MourningWood); - pumpkinMoonBuffList.Add(NPCID.Splinterling); - pumpkinMoonBuffList.Add(NPCID.Pumpking); - pumpkinMoonBuffList.Add(NPCID.Hellhound); - pumpkinMoonBuffList.Add(NPCID.Poltergeist); - - frostMoonBuffList = new List(); - - frostMoonBuffList.Add(NPCID.ZombieElf); - frostMoonBuffList.Add(NPCID.ZombieElfBeard); - frostMoonBuffList.Add(NPCID.ZombieElfGirl); - frostMoonBuffList.Add(NPCID.PresentMimic); - frostMoonBuffList.Add(NPCID.GingerbreadMan); - frostMoonBuffList.Add(NPCID.Yeti); - frostMoonBuffList.Add(NPCID.Everscream); - frostMoonBuffList.Add(NPCID.IceQueen); - frostMoonBuffList.Add(NPCID.SantaNK1); - frostMoonBuffList.Add(NPCID.ElfCopter); - frostMoonBuffList.Add(NPCID.Nutcracker); - frostMoonBuffList.Add(NPCID.NutcrackerSpinning); - frostMoonBuffList.Add(NPCID.ElfArcher); - frostMoonBuffList.Add(NPCID.Krampus); - frostMoonBuffList.Add(NPCID.Flocko); - - eclipseBuffList = new List(); - - eclipseBuffList.Add(NPCID.Eyezor); - eclipseBuffList.Add(NPCID.Reaper); - eclipseBuffList.Add(NPCID.Frankenstein); - eclipseBuffList.Add(NPCID.SwampThing); - eclipseBuffList.Add(NPCID.Vampire); - eclipseBuffList.Add(NPCID.VampireBat); - eclipseBuffList.Add(NPCID.Butcher); - eclipseBuffList.Add(NPCID.CreatureFromTheDeep); - eclipseBuffList.Add(NPCID.Fritz); - eclipseBuffList.Add(NPCID.Nailhead); - eclipseBuffList.Add(NPCID.Psycho); - eclipseBuffList.Add(NPCID.DeadlySphere); - eclipseBuffList.Add(NPCID.DrManFly); - eclipseBuffList.Add(NPCID.ThePossessed); - eclipseBuffList.Add(NPCID.Mothron); - eclipseBuffList.Add(NPCID.MothronEgg); - eclipseBuffList.Add(NPCID.MothronSpawn); - - eventProjectileBuffList = new List(); - - eventProjectileBuffList.Add(ProjectileID.FlamingWood); - eventProjectileBuffList.Add(ProjectileID.GreekFire1); - eventProjectileBuffList.Add(ProjectileID.GreekFire2); - eventProjectileBuffList.Add(ProjectileID.GreekFire3); - eventProjectileBuffList.Add(ProjectileID.FlamingScythe); - eventProjectileBuffList.Add(ProjectileID.FlamingArrow); - eventProjectileBuffList.Add(ProjectileID.PineNeedleHostile); - eventProjectileBuffList.Add(ProjectileID.OrnamentHostile); - eventProjectileBuffList.Add(ProjectileID.OrnamentHostileShrapnel); - eventProjectileBuffList.Add(ProjectileID.FrostWave); - eventProjectileBuffList.Add(ProjectileID.FrostShard); - eventProjectileBuffList.Add(ProjectileID.Missile); - eventProjectileBuffList.Add(ProjectileID.Present); - eventProjectileBuffList.Add(ProjectileID.Spike); - eventProjectileBuffList.Add(ProjectileID.BulletDeadeye); - eventProjectileBuffList.Add(ProjectileID.EyeLaser); - eventProjectileBuffList.Add(ProjectileID.Nail); - eventProjectileBuffList.Add(ProjectileID.DrManFlyFlask); - - revengeanceEnemyBuffList = new List(); - - revengeanceEnemyBuffList.Add(NPCID.ServantofCthulhu); - revengeanceEnemyBuffList.Add(NPCID.EyeofCthulhu); - revengeanceEnemyBuffList.Add(NPCID.EaterofWorldsHead); - revengeanceEnemyBuffList.Add(NPCID.DevourerHead); - revengeanceEnemyBuffList.Add(NPCID.GiantWormHead); - revengeanceEnemyBuffList.Add(NPCID.MeteorHead); - revengeanceEnemyBuffList.Add(NPCID.SkeletronHead); - revengeanceEnemyBuffList.Add(NPCID.SkeletronHand); - revengeanceEnemyBuffList.Add(NPCID.BoneSerpentHead); - revengeanceEnemyBuffList.Add(NPCID.ManEater); - revengeanceEnemyBuffList.Add(NPCID.KingSlime); - revengeanceEnemyBuffList.Add(NPCID.Snatcher); - revengeanceEnemyBuffList.Add(NPCID.Piranha); - revengeanceEnemyBuffList.Add(NPCID.Shark); - revengeanceEnemyBuffList.Add(NPCID.SpikeBall); - revengeanceEnemyBuffList.Add(NPCID.BlazingWheel); - revengeanceEnemyBuffList.Add(NPCID.Mimic); - revengeanceEnemyBuffList.Add(NPCID.WyvernHead); - revengeanceEnemyBuffList.Add(NPCID.DiggerHead); - revengeanceEnemyBuffList.Add(NPCID.SeekerHead); - revengeanceEnemyBuffList.Add(NPCID.AnglerFish); - revengeanceEnemyBuffList.Add(NPCID.Werewolf); - revengeanceEnemyBuffList.Add(NPCID.Wraith); - revengeanceEnemyBuffList.Add(NPCID.WallofFlesh); - revengeanceEnemyBuffList.Add(NPCID.TheHungry); - revengeanceEnemyBuffList.Add(NPCID.TheHungryII); - revengeanceEnemyBuffList.Add(NPCID.LeechHead); - revengeanceEnemyBuffList.Add(NPCID.Spazmatism); - revengeanceEnemyBuffList.Add(NPCID.Retinazer); - revengeanceEnemyBuffList.Add(NPCID.SkeletronPrime); - revengeanceEnemyBuffList.Add(NPCID.PrimeSaw); - revengeanceEnemyBuffList.Add(NPCID.PrimeVice); - revengeanceEnemyBuffList.Add(NPCID.TheDestroyer); - revengeanceEnemyBuffList.Add(NPCID.Arapaima); - revengeanceEnemyBuffList.Add(NPCID.BlackRecluse); - revengeanceEnemyBuffList.Add(NPCID.WallCreeper); - revengeanceEnemyBuffList.Add(NPCID.WallCreeperWall); - revengeanceEnemyBuffList.Add(NPCID.BlackRecluseWall); - revengeanceEnemyBuffList.Add(NPCID.AngryTrapper); - revengeanceEnemyBuffList.Add(NPCID.Lihzahrd); - revengeanceEnemyBuffList.Add(NPCID.LihzahrdCrawler); - revengeanceEnemyBuffList.Add(NPCID.PirateCaptain); - revengeanceEnemyBuffList.Add(NPCID.QueenBee); - revengeanceEnemyBuffList.Add(NPCID.FlyingSnake); - revengeanceEnemyBuffList.Add(NPCID.Golem); - revengeanceEnemyBuffList.Add(NPCID.GolemFistLeft); - revengeanceEnemyBuffList.Add(NPCID.GolemFistRight); - revengeanceEnemyBuffList.Add(NPCID.Reaper); - revengeanceEnemyBuffList.Add(NPCID.Plantera); - revengeanceEnemyBuffList.Add(NPCID.PlanterasHook); - revengeanceEnemyBuffList.Add(NPCID.PlanterasTentacle); - revengeanceEnemyBuffList.Add(NPCID.BrainofCthulhu); - revengeanceEnemyBuffList.Add(NPCID.Paladin); - revengeanceEnemyBuffList.Add(NPCID.BoneLee); - revengeanceEnemyBuffList.Add(NPCID.MourningWood); - revengeanceEnemyBuffList.Add(NPCID.Pumpking); - revengeanceEnemyBuffList.Add(NPCID.PumpkingBlade); - revengeanceEnemyBuffList.Add(NPCID.PresentMimic); - revengeanceEnemyBuffList.Add(NPCID.Everscream); - revengeanceEnemyBuffList.Add(NPCID.IceQueen); - revengeanceEnemyBuffList.Add(NPCID.SantaNK1); - revengeanceEnemyBuffList.Add(NPCID.DukeFishron); - revengeanceEnemyBuffList.Add(NPCID.MoonLordHand); - revengeanceEnemyBuffList.Add(NPCID.StardustWormHead); - revengeanceEnemyBuffList.Add(NPCID.SolarCrawltipedeHead); - revengeanceEnemyBuffList.Add(NPCID.CultistDragonHead); - revengeanceEnemyBuffList.Add(NPCID.Butcher); - revengeanceEnemyBuffList.Add(NPCID.Psycho); - revengeanceEnemyBuffList.Add(NPCID.DeadlySphere); - revengeanceEnemyBuffList.Add(NPCID.BigMimicCorruption); - revengeanceEnemyBuffList.Add(NPCID.BigMimicCrimson); - revengeanceEnemyBuffList.Add(NPCID.BigMimicHallow); - revengeanceEnemyBuffList.Add(NPCID.Mothron); - revengeanceEnemyBuffList.Add(NPCID.DuneSplicerHead); - revengeanceEnemyBuffList.Add(NPCID.SlimeSpiked); - revengeanceEnemyBuffList.Add(NPCID.SandShark); - revengeanceEnemyBuffList.Add(NPCID.SandsharkCorrupt); - revengeanceEnemyBuffList.Add(NPCID.SandsharkCrimson); - revengeanceEnemyBuffList.Add(NPCID.SandsharkHallow); - revengeanceEnemyBuffList.Add(NPCID.DD2Betsy); - - revengeanceProjectileBuffList = new List(); - - revengeanceProjectileBuffList.Add(ProjectileID.SandBallFalling); - revengeanceProjectileBuffList.Add(ProjectileID.AshBallFalling); - revengeanceProjectileBuffList.Add(ProjectileID.DemonSickle); - revengeanceProjectileBuffList.Add(ProjectileID.EbonsandBallFalling); - revengeanceProjectileBuffList.Add(ProjectileID.PearlSandBallFalling); - revengeanceProjectileBuffList.Add(ProjectileID.CursedFlameHostile); - revengeanceProjectileBuffList.Add(ProjectileID.EyeFire); - revengeanceProjectileBuffList.Add(ProjectileID.Boulder); - revengeanceProjectileBuffList.Add(ProjectileID.DeathLaser); - revengeanceProjectileBuffList.Add(ProjectileID.PoisonDartTrap); - revengeanceProjectileBuffList.Add(ProjectileID.SpikyBallTrap); - revengeanceProjectileBuffList.Add(ProjectileID.SpearTrap); - revengeanceProjectileBuffList.Add(ProjectileID.FlamethrowerTrap); - revengeanceProjectileBuffList.Add(ProjectileID.FlamesTrap); - revengeanceProjectileBuffList.Add(ProjectileID.CrimsandBallFalling); - revengeanceProjectileBuffList.Add(ProjectileID.Fireball); - revengeanceProjectileBuffList.Add(ProjectileID.EyeBeam); - revengeanceProjectileBuffList.Add(ProjectileID.PoisonSeedPlantera); - revengeanceProjectileBuffList.Add(ProjectileID.ThornBall); - revengeanceProjectileBuffList.Add(ProjectileID.PaladinsHammerHostile); - revengeanceProjectileBuffList.Add(ProjectileID.RocketSkeleton); - revengeanceProjectileBuffList.Add(ProjectileID.FlamingWood); - revengeanceProjectileBuffList.Add(ProjectileID.FlamingScythe); - revengeanceProjectileBuffList.Add(ProjectileID.FrostWave); - revengeanceProjectileBuffList.Add(ProjectileID.Present); - revengeanceProjectileBuffList.Add(ProjectileID.Spike); - revengeanceProjectileBuffList.Add(ProjectileID.SaucerDeathray); - revengeanceProjectileBuffList.Add(ProjectileID.PhantasmalEye); - revengeanceProjectileBuffList.Add(ProjectileID.PhantasmalSphere); - revengeanceProjectileBuffList.Add(ProjectileID.PhantasmalDeathray); - revengeanceProjectileBuffList.Add(ProjectileID.CultistBossIceMist); - revengeanceProjectileBuffList.Add(ProjectileID.CultistBossLightningOrbArc); - revengeanceProjectileBuffList.Add(ProjectileID.CultistBossFireBall); - revengeanceProjectileBuffList.Add(ProjectileID.NebulaBolt); - revengeanceProjectileBuffList.Add(ProjectileID.NebulaSphere); - revengeanceProjectileBuffList.Add(ProjectileID.NebulaLaser); - revengeanceProjectileBuffList.Add(ProjectileID.StardustSoldierLaser); - revengeanceProjectileBuffList.Add(ProjectileID.VortexLaser); - revengeanceProjectileBuffList.Add(ProjectileID.VortexVortexLightning); - revengeanceProjectileBuffList.Add(ProjectileID.VortexLightning); - revengeanceProjectileBuffList.Add(ProjectileID.VortexAcid); - revengeanceProjectileBuffList.Add(ProjectileID.GeyserTrap); - revengeanceProjectileBuffList.Add(ProjectileID.SandnadoHostile); - revengeanceProjectileBuffList.Add(ProjectileID.DD2BetsyFireball); - revengeanceProjectileBuffList.Add(ProjectileID.DD2BetsyFlameBreath); - - trapProjectileList = new List(); - - trapProjectileList.Add(ProjectileID.PoisonDartTrap); - trapProjectileList.Add(ProjectileID.SpikyBallTrap); - trapProjectileList.Add(ProjectileID.SpearTrap); - trapProjectileList.Add(ProjectileID.FlamethrowerTrap); - trapProjectileList.Add(ProjectileID.FlamesTrap); - trapProjectileList.Add(ProjectileID.PoisonDart); - trapProjectileList.Add(ProjectileID.GeyserTrap); - - lightGreenThrowingRarityList = new List(); - greenThrowingRarityList = new List(); - blueThrowingRarityList = new List(); - purpleThrowingRarityList = new List(); - - throwingProjectileList = new List(); - throwingItemList = new List(); - - Mod calamity = ModLoader.GetMod("CalamityMod"); - if (calamity != null) - { - rangedProjectileExceptionList.Add(calamity.ProjectileType("Phangasm")); - rangedProjectileExceptionList.Add(calamity.ProjectileType("Contagion")); - rangedProjectileExceptionList.Add(calamity.ProjectileType("DaemonsFlame")); - rangedProjectileExceptionList.Add(calamity.ProjectileType("ExoTornado")); - rangedProjectileExceptionList.Add(calamity.ProjectileType("Drataliornus")); - rangedProjectileExceptionList.Add(calamity.ProjectileType("FlakKrakenGun")); - rangedProjectileExceptionList.Add(calamity.ProjectileType("Butcher")); - rangedProjectileExceptionList.Add(calamity.ProjectileType("StarfleetMK2")); - - beeEnemyList.Add(calamity.NPCType("PlaguebringerGoliath")); - beeEnemyList.Add(calamity.NPCType("PlaguebringerShade")); - beeEnemyList.Add(calamity.NPCType("PlagueBeeLargeG")); - beeEnemyList.Add(calamity.NPCType("PlagueBeeLarge")); - beeEnemyList.Add(calamity.NPCType("PlagueBeeG")); - beeEnemyList.Add(calamity.NPCType("PlagueBee")); - - beeProjectileList.Add(calamity.ProjectileType("PlagueStingerGoliath")); - beeProjectileList.Add(calamity.ProjectileType("PlagueStingerGoliathV2")); - beeProjectileList.Add(calamity.ProjectileType("PlagueExplosion")); - - debuffList.Add(calamity.BuffType("BrimstoneFlames")); - debuffList.Add(calamity.BuffType("BurningBlood")); - debuffList.Add(calamity.BuffType("GlacialState")); - debuffList.Add(calamity.BuffType("GodSlayerInferno")); - debuffList.Add(calamity.BuffType("HolyLight")); - debuffList.Add(calamity.BuffType("Irradiated")); - debuffList.Add(calamity.BuffType("Plague")); - debuffList.Add(calamity.BuffType("AbyssalFlames")); - debuffList.Add(calamity.BuffType("CrushDepth")); - debuffList.Add(calamity.BuffType("Horror")); - debuffList.Add(calamity.BuffType("MarkedforDeath")); - - fireWeaponList.Add(calamity.ItemType("AegisBlade")); - fireWeaponList.Add(calamity.ItemType("BalefulHarvester")); - fireWeaponList.Add(calamity.ItemType("Chaotrix")); - fireWeaponList.Add(calamity.ItemType("CometQuasher")); - fireWeaponList.Add(calamity.ItemType("DraconicDestruction")); - fireWeaponList.Add(calamity.ItemType("Drataliornus")); - fireWeaponList.Add(calamity.ItemType("EnergyStaff")); - fireWeaponList.Add(calamity.ItemType("ExsanguinationLance")); - fireWeaponList.Add(calamity.ItemType("FirestormCannon")); - fireWeaponList.Add(calamity.ItemType("FlameburstShortsword")); - fireWeaponList.Add(calamity.ItemType("FlameScythe")); - fireWeaponList.Add(calamity.ItemType("FlameScytheMelee")); - fireWeaponList.Add(calamity.ItemType("FlareBolt")); - fireWeaponList.Add(calamity.ItemType("FlarefrostBlade")); - fireWeaponList.Add(calamity.ItemType("FlarewingBow")); - fireWeaponList.Add(calamity.ItemType("ForbiddenSun")); - fireWeaponList.Add(calamity.ItemType("FrigidflashBolt")); - fireWeaponList.Add(calamity.ItemType("GreatbowofTurmoil")); - fireWeaponList.Add(calamity.ItemType("HarvestStaff")); - fireWeaponList.Add(calamity.ItemType("HellBurst")); - fireWeaponList.Add(calamity.ItemType("HellfireFlamberge")); - fireWeaponList.Add(calamity.ItemType("Hellkite")); - fireWeaponList.Add(calamity.ItemType("HellwingStaff")); - fireWeaponList.Add(calamity.ItemType("Helstorm")); - fireWeaponList.Add(calamity.ItemType("InfernaCutter")); - fireWeaponList.Add(calamity.ItemType("Lazhar")); - fireWeaponList.Add(calamity.ItemType("MeteorFist")); - fireWeaponList.Add(calamity.ItemType("Mourningstar")); - fireWeaponList.Add(calamity.ItemType("PhoenixBlade")); - fireWeaponList.Add(calamity.ItemType("Photoviscerator")); - fireWeaponList.Add(calamity.ItemType("RedSun")); - fireWeaponList.Add(calamity.ItemType("SpectralstormCannon")); - fireWeaponList.Add(calamity.ItemType("SunGodStaff")); - fireWeaponList.Add(calamity.ItemType("SunSpiritStaff")); - fireWeaponList.Add(calamity.ItemType("TearsofHeaven")); - fireWeaponList.Add(calamity.ItemType("TerraFlameburster")); - fireWeaponList.Add(calamity.ItemType("TheEmpyrean")); - fireWeaponList.Add(calamity.ItemType("TheWand")); - fireWeaponList.Add(calamity.ItemType("VenusianTrident")); - fireWeaponList.Add(calamity.ItemType("Vesuvius")); - fireWeaponList.Add(calamity.ItemType("BlissfulBombardier")); - fireWeaponList.Add(calamity.ItemType("HolyCollider")); - fireWeaponList.Add(calamity.ItemType("MoltenAmputator")); - fireWeaponList.Add(calamity.ItemType("PurgeGuzzler")); - fireWeaponList.Add(calamity.ItemType("SolarFlare")); - fireWeaponList.Add(calamity.ItemType("TelluricGlare")); - fireWeaponList.Add(calamity.ItemType("AngryChickenStaff")); - fireWeaponList.Add(calamity.ItemType("ChickenCannon")); - fireWeaponList.Add(calamity.ItemType("DragonRage")); - fireWeaponList.Add(calamity.ItemType("DragonsBreath")); - fireWeaponList.Add(calamity.ItemType("PhoenixFlameBarrage")); - fireWeaponList.Add(calamity.ItemType("ProfanedTrident")); - fireWeaponList.Add(calamity.ItemType("TheBurningSky")); - - natureWeaponList.Add(calamity.ItemType("DepthBlade")); - natureWeaponList.Add(calamity.ItemType("AbyssBlade")); - natureWeaponList.Add(calamity.ItemType("NeptunesBounty")); - natureWeaponList.Add(calamity.ItemType("AquaticDissolution")); - natureWeaponList.Add(calamity.ItemType("ArchAmaryllis")); - natureWeaponList.Add(calamity.ItemType("BiomeBlade")); - natureWeaponList.Add(calamity.ItemType("TrueBiomeBlade")); - natureWeaponList.Add(calamity.ItemType("OmegaBiomeBlade")); - natureWeaponList.Add(calamity.ItemType("BladedgeGreatbow")); - natureWeaponList.Add(calamity.ItemType("BlossomFlux")); - natureWeaponList.Add(calamity.ItemType("EvergladeSpray")); - natureWeaponList.Add(calamity.ItemType("FeralthornClaymore")); - natureWeaponList.Add(calamity.ItemType("Floodtide")); - natureWeaponList.Add(calamity.ItemType("FourSeasonsGalaxia")); - natureWeaponList.Add(calamity.ItemType("GammaFusillade")); - natureWeaponList.Add(calamity.ItemType("GleamingMagnolia")); - natureWeaponList.Add(calamity.ItemType("HarvestStaff")); - natureWeaponList.Add(calamity.ItemType("HellionFlowerSpear")); - natureWeaponList.Add(calamity.ItemType("Lazhar")); - natureWeaponList.Add(calamity.ItemType("LifefruitScythe")); - natureWeaponList.Add(calamity.ItemType("ManaRose")); - natureWeaponList.Add(calamity.ItemType("MangroveChakram")); - natureWeaponList.Add(calamity.ItemType("MangroveChakramMelee")); - natureWeaponList.Add(calamity.ItemType("MantisClaws")); - natureWeaponList.Add(calamity.ItemType("Mariana")); - natureWeaponList.Add(calamity.ItemType("Mistlestorm")); - natureWeaponList.Add(calamity.ItemType("Monsoon")); - natureWeaponList.Add(calamity.ItemType("Alluvion")); - natureWeaponList.Add(calamity.ItemType("Needler")); - natureWeaponList.Add(calamity.ItemType("NettlelineGreatbow")); - natureWeaponList.Add(calamity.ItemType("Quagmire")); - natureWeaponList.Add(calamity.ItemType("Shroomer")); - natureWeaponList.Add(calamity.ItemType("SolsticeClaymore")); - natureWeaponList.Add(calamity.ItemType("SporeKnife")); - natureWeaponList.Add(calamity.ItemType("Spyker")); - natureWeaponList.Add(calamity.ItemType("StormSaber")); - natureWeaponList.Add(calamity.ItemType("StormRuler")); - natureWeaponList.Add(calamity.ItemType("StormSurge")); - natureWeaponList.Add(calamity.ItemType("TarragonThrowingDart")); - natureWeaponList.Add(calamity.ItemType("TerraEdge")); - natureWeaponList.Add(calamity.ItemType("TerraLance")); - natureWeaponList.Add(calamity.ItemType("TerraRay")); - natureWeaponList.Add(calamity.ItemType("TerraShiv")); - natureWeaponList.Add(calamity.ItemType("Terratomere")); - natureWeaponList.Add(calamity.ItemType("TerraFlameburster")); - natureWeaponList.Add(calamity.ItemType("TheSwarmer")); - natureWeaponList.Add(calamity.ItemType("Verdant")); - natureWeaponList.Add(calamity.ItemType("Barinautical")); - natureWeaponList.Add(calamity.ItemType("DeepseaStaff")); - natureWeaponList.Add(calamity.ItemType("Downpour")); - natureWeaponList.Add(calamity.ItemType("SubmarineShocker")); - natureWeaponList.Add(calamity.ItemType("Archerfish")); - natureWeaponList.Add(calamity.ItemType("BallOFugu")); - natureWeaponList.Add(calamity.ItemType("BlackAnurian")); - natureWeaponList.Add(calamity.ItemType("CalamarisLament")); - natureWeaponList.Add(calamity.ItemType("HerringStaff")); - natureWeaponList.Add(calamity.ItemType("Lionfish")); - - alcoholList.Add(calamity.BuffType("BloodyMary")); - alcoholList.Add(calamity.BuffType("CaribbeanRum")); - alcoholList.Add(calamity.BuffType("CinnamonRoll")); - alcoholList.Add(calamity.BuffType("Everclear")); - alcoholList.Add(calamity.BuffType("EvergreenGin")); - alcoholList.Add(calamity.BuffType("Fireball")); - alcoholList.Add(calamity.BuffType("GrapeBeer")); - alcoholList.Add(calamity.BuffType("Margarita")); - alcoholList.Add(calamity.BuffType("Moonshine")); - alcoholList.Add(calamity.BuffType("MoscowMule")); - alcoholList.Add(calamity.BuffType("RedWine")); - alcoholList.Add(calamity.BuffType("Rum")); - alcoholList.Add(calamity.BuffType("Screwdriver")); - alcoholList.Add(calamity.BuffType("StarBeamRye")); - alcoholList.Add(calamity.BuffType("Tequila")); - alcoholList.Add(calamity.BuffType("TequilaSunrise")); - alcoholList.Add(calamity.BuffType("Vodka")); - alcoholList.Add(calamity.BuffType("Whiskey")); - alcoholList.Add(calamity.BuffType("WhiteWine")); - - lightGreenThrowingRarityList.Add(calamity.ItemType("TarragonThrowingDart")); - lightGreenThrowingRarityList.Add(calamity.ItemType("MoltenAmputator")); - lightGreenThrowingRarityList.Add(calamity.ItemType("AccretionDisk")); - - greenThrowingRarityList.Add(calamity.ItemType("CosmicKunai")); - greenThrowingRarityList.Add(calamity.ItemType("Eradicator")); - greenThrowingRarityList.Add(calamity.ItemType("Valediction")); - greenThrowingRarityList.Add(calamity.ItemType("GhoulishGouger")); - - blueThrowingRarityList.Add(calamity.ItemType("EmpyreanKnivesThrown")); - blueThrowingRarityList.Add(calamity.ItemType("ExecutionersBlade")); - blueThrowingRarityList.Add(calamity.ItemType("ProfanedTrident")); - blueThrowingRarityList.Add(calamity.ItemType("ScourgeoftheCosmosThrown")); - - purpleThrowingRarityList.Add(calamity.ItemType("RoyalKnives")); - purpleThrowingRarityList.Add(calamity.ItemType("TriactisTruePaladinianMageHammerofMight")); - - throwingProjectileList.Add(calamity.ProjectileType("XerocPitchforkProjectile")); - throwingProjectileList.Add(calamity.ProjectileType("WulfrumKnife")); - throwingProjectileList.Add(calamity.ProjectileType("Valediction")); - throwingProjectileList.Add(calamity.ProjectileType("UrchinStinger")); - throwingProjectileList.Add(calamity.ProjectileType("OPHammer")); - throwingProjectileList.Add(calamity.ProjectileType("TriactisOPHammer")); - throwingProjectileList.Add(calamity.ProjectileType("ToothBallProjectile")); - throwingProjectileList.Add(calamity.ProjectileType("TitaniumShurikenProjectile")); - throwingProjectileList.Add(calamity.ProjectileType("TarragonThrowingDartProjectile")); - throwingProjectileList.Add(calamity.ProjectileType("FossilShardThrown")); - throwingProjectileList.Add(calamity.ProjectileType("SpearofPaleolith")); - throwingProjectileList.Add(calamity.ProjectileType("SeashellBoomerangProjectile")); - throwingProjectileList.Add(calamity.ProjectileType("ScourgeoftheDesert")); - throwingProjectileList.Add(calamity.ProjectileType("ScourgeoftheCosmosMini")); - throwingProjectileList.Add(calamity.ProjectileType("ScourgeoftheCosmos")); - throwingProjectileList.Add(calamity.ProjectileType("RoyalKnife")); - throwingProjectileList.Add(calamity.ProjectileType("RotBallProjectile")); - throwingProjectileList.Add(calamity.ProjectileType("Pwnagehammer")); - throwingProjectileList.Add(calamity.ProjectileType("ProfanedTrident")); - throwingProjectileList.Add(calamity.ProjectileType("PalladiumJavelinProjectile")); - throwingProjectileList.Add(calamity.ProjectileType("OrichalcumSpikedGemstoneProjectile")); - throwingProjectileList.Add(calamity.ProjectileType("MythrilKnifeProjectile")); - throwingProjectileList.Add(calamity.ProjectileType("Mycoroot")); - throwingProjectileList.Add(calamity.ProjectileType("MoltenBlobThrown")); - throwingProjectileList.Add(calamity.ProjectileType("MoltenAmputator")); - throwingProjectileList.Add(calamity.ProjectileType("MangroveChakramProjectile")); - throwingProjectileList.Add(calamity.ProjectileType("MalachiteBolt")); - throwingProjectileList.Add(calamity.ProjectileType("Malachite")); - throwingProjectileList.Add(calamity.ProjectileType("Lionfish")); - throwingProjectileList.Add(calamity.ProjectileType("IchorSpear")); - throwingProjectileList.Add(calamity.ProjectileType("IceStarProjectile")); - throwingProjectileList.Add(calamity.ProjectileType("GhoulishGouger")); - throwingProjectileList.Add(calamity.ProjectileType("GelDartProjectile")); - throwingProjectileList.Add(calamity.ProjectileType("FlameScytheProjectile")); - throwingProjectileList.Add(calamity.ProjectileType("FeatherKnifeProjectile")); - throwingProjectileList.Add(calamity.ProjectileType("ExecutionersBlade")); - throwingProjectileList.Add(calamity.ProjectileType("EmpyreanKnives")); - throwingProjectileList.Add(calamity.ProjectileType("EradicatorProjectile")); - throwingProjectileList.Add(calamity.ProjectileType("DuststormCloud")); - throwingProjectileList.Add(calamity.ProjectileType("DuststormInABottle")); - throwingProjectileList.Add(calamity.ProjectileType("CursedDagger")); - throwingProjectileList.Add(calamity.ProjectileType("CrystalPiercerProjectile")); - throwingProjectileList.Add(calamity.ProjectileType("Crystalline2")); - throwingProjectileList.Add(calamity.ProjectileType("Crystalline")); - throwingProjectileList.Add(calamity.ProjectileType("Crushax")); - throwingProjectileList.Add(calamity.ProjectileType("CosmicKunai")); - throwingProjectileList.Add(calamity.ProjectileType("CobaltKunaiProjectile")); - throwingProjectileList.Add(calamity.ProjectileType("Celestus2")); - throwingProjectileList.Add(calamity.ProjectileType("Celestus")); - throwingProjectileList.Add(calamity.ProjectileType("Brimblade2")); - throwingProjectileList.Add(calamity.ProjectileType("Brimblade")); - throwingProjectileList.Add(calamity.ProjectileType("BrackishWaterBlast")); - throwingProjectileList.Add(calamity.ProjectileType("BrackishWater")); - throwingProjectileList.Add(calamity.ProjectileType("BrackishFlask")); - throwingProjectileList.Add(calamity.ProjectileType("BallisticPoisonBombSpike")); - throwingProjectileList.Add(calamity.ProjectileType("BallisticPoisonBomb")); - throwingProjectileList.Add(calamity.ProjectileType("AccretionDisk2")); - throwingProjectileList.Add(calamity.ProjectileType("AccretionDisk")); - throwingProjectileList.Add(calamity.ProjectileType("AdamantiteThrowingAxeProjectile")); - throwingProjectileList.Add(calamity.ProjectileType("FrostyFlare")); - throwingProjectileList.Add(calamity.ProjectileType("FrostShardFriendly")); - - throwingItemList.Add(calamity.ItemType("AccretionDisk")); - throwingItemList.Add(calamity.ItemType("AdamantiteThrowingAxe")); - throwingItemList.Add(calamity.ItemType("BallisticPoisonBomb")); - throwingItemList.Add(calamity.ItemType("BrackishFlask")); - throwingItemList.Add(calamity.ItemType("Brimblade")); - throwingItemList.Add(calamity.ItemType("Celestus")); - throwingItemList.Add(calamity.ItemType("CobaltKunai")); - throwingItemList.Add(calamity.ItemType("CosmicKunai")); - throwingItemList.Add(calamity.ItemType("CrushsawCrasher")); - throwingItemList.Add(calamity.ItemType("Crystalline")); - throwingItemList.Add(calamity.ItemType("CrystalPiercer")); - throwingItemList.Add(calamity.ItemType("CursedDagger")); - throwingItemList.Add(calamity.ItemType("DuststormInABottle")); - throwingItemList.Add(calamity.ItemType("EmpyreanKnivesThrown")); - throwingItemList.Add(calamity.ItemType("Eradicator")); - throwingItemList.Add(calamity.ItemType("ExecutionersBlade")); - throwingItemList.Add(calamity.ItemType("FeatherKnife")); - throwingItemList.Add(calamity.ItemType("FlameScythe")); - throwingItemList.Add(calamity.ItemType("GelDart")); - throwingItemList.Add(calamity.ItemType("GhoulishGouger")); - throwingItemList.Add(calamity.ItemType("IceStar")); - throwingItemList.Add(calamity.ItemType("IchorSpear")); - throwingItemList.Add(calamity.ItemType("Lionfish")); - throwingItemList.Add(calamity.ItemType("Malachite")); - throwingItemList.Add(calamity.ItemType("MangroveChakram")); - throwingItemList.Add(calamity.ItemType("MoltenAmputator")); - throwingItemList.Add(calamity.ItemType("Mycoroot")); - throwingItemList.Add(calamity.ItemType("MythrilKnife")); - throwingItemList.Add(calamity.ItemType("OrichalcumSpikedGemstone")); - throwingItemList.Add(calamity.ItemType("PalladiumJavelin")); - throwingItemList.Add(calamity.ItemType("ProfanedTrident")); - throwingItemList.Add(calamity.ItemType("PwnageHammer")); - throwingItemList.Add(calamity.ItemType("RotBall")); - throwingItemList.Add(calamity.ItemType("RoyalKnives")); - throwingItemList.Add(calamity.ItemType("ScourgeoftheCosmosThrown")); - throwingItemList.Add(calamity.ItemType("ScourgeoftheDesert")); - throwingItemList.Add(calamity.ItemType("SeashellBoomerang")); - throwingItemList.Add(calamity.ItemType("SpearofPaleolith")); - throwingItemList.Add(calamity.ItemType("TarragonThrowingDart")); - throwingItemList.Add(calamity.ItemType("TitaniumShuriken")); - throwingItemList.Add(calamity.ItemType("ToothBall")); - throwingItemList.Add(calamity.ItemType("TriactisTruePaladinianMageHammerofMight")); - throwingItemList.Add(calamity.ItemType("TruePaladinsHammer")); - throwingItemList.Add(calamity.ItemType("UrchinStinger")); - throwingItemList.Add(calamity.ItemType("Valediction")); - throwingItemList.Add(calamity.ItemType("WulfrumKnife")); - throwingItemList.Add(calamity.ItemType("XerocPitchfork")); - throwingItemList.Add(calamity.ItemType("FrostyFlare")); - - revengeanceEnemyBuffList.Add(calamity.NPCType("Astrageldon")); - revengeanceEnemyBuffList.Add(calamity.NPCType("AstrumDeusHead")); - revengeanceEnemyBuffList.Add(calamity.NPCType("AstrumDeusHeadSpectral")); - revengeanceEnemyBuffList.Add(calamity.NPCType("Bumblefuck")); - revengeanceEnemyBuffList.Add(calamity.NPCType("CalamitasRun3")); - revengeanceEnemyBuffList.Add(calamity.NPCType("CosmicWraith")); - revengeanceEnemyBuffList.Add(calamity.NPCType("CrabulonIdle")); - revengeanceEnemyBuffList.Add(calamity.NPCType("Cryogen")); - revengeanceEnemyBuffList.Add(calamity.NPCType("DesertScourgeHead")); - revengeanceEnemyBuffList.Add(calamity.NPCType("GreatSandShark")); - revengeanceEnemyBuffList.Add(calamity.NPCType("HiveMindP2")); - revengeanceEnemyBuffList.Add(calamity.NPCType("DankCreeper")); - revengeanceEnemyBuffList.Add(calamity.NPCType("AquaticAberration")); - revengeanceEnemyBuffList.Add(calamity.NPCType("Leviathan")); - revengeanceEnemyBuffList.Add(calamity.NPCType("Siren")); - revengeanceEnemyBuffList.Add(calamity.NPCType("PerforatorHeadLarge")); - revengeanceEnemyBuffList.Add(calamity.NPCType("PerforatorHeadMedium")); - revengeanceEnemyBuffList.Add(calamity.NPCType("PerforatorHeadSmall")); - revengeanceEnemyBuffList.Add(calamity.NPCType("PlaguebringerGoliath")); - revengeanceEnemyBuffList.Add(calamity.NPCType("PlagueHomingMissile")); - revengeanceEnemyBuffList.Add(calamity.NPCType("PlagueMine")); - revengeanceEnemyBuffList.Add(calamity.NPCType("Polterghast")); - revengeanceEnemyBuffList.Add(calamity.NPCType("PolterghastHook")); - revengeanceEnemyBuffList.Add(calamity.NPCType("PolterPhantom")); - revengeanceEnemyBuffList.Add(calamity.NPCType("ProfanedGuardianBoss")); - revengeanceEnemyBuffList.Add(calamity.NPCType("RockPillar")); - revengeanceEnemyBuffList.Add(calamity.NPCType("ScavengerBody")); - revengeanceEnemyBuffList.Add(calamity.NPCType("ScavengerClawRight")); - revengeanceEnemyBuffList.Add(calamity.NPCType("ScavengerClawLeft")); - revengeanceEnemyBuffList.Add(calamity.NPCType("ProfanedGuardianBoss2")); - revengeanceEnemyBuffList.Add(calamity.NPCType("ProvSpawnDefense")); - revengeanceEnemyBuffList.Add(calamity.NPCType("ProvSpawnOffense")); - revengeanceEnemyBuffList.Add(calamity.NPCType("SlimeGod")); - revengeanceEnemyBuffList.Add(calamity.NPCType("SlimeGodRun")); - revengeanceEnemyBuffList.Add(calamity.NPCType("SlimeGodCore")); - revengeanceEnemyBuffList.Add(calamity.NPCType("SlimeGodSplit")); - revengeanceEnemyBuffList.Add(calamity.NPCType("SlimeGodRunSplit")); - revengeanceEnemyBuffList.Add(calamity.NPCType("StormWeaverHead")); - revengeanceEnemyBuffList.Add(calamity.NPCType("StormWeaverHeadNaked")); - revengeanceEnemyBuffList.Add(calamity.NPCType("SupremeCalamitas")); - revengeanceEnemyBuffList.Add(calamity.NPCType("DevourerofGodsHead")); - revengeanceEnemyBuffList.Add(calamity.NPCType("DevourerofGodsHead2")); - revengeanceEnemyBuffList.Add(calamity.NPCType("DevourerofGodsHeadS")); - revengeanceEnemyBuffList.Add(calamity.NPCType("Yharon")); - revengeanceEnemyBuffList.Add(calamity.NPCType("AquaticScourgeHead")); - revengeanceEnemyBuffList.Add(calamity.NPCType("BobbitWormHead")); - revengeanceEnemyBuffList.Add(calamity.NPCType("AquaticSeekerHead")); - revengeanceEnemyBuffList.Add(calamity.NPCType("ColossalSquid")); - revengeanceEnemyBuffList.Add(calamity.NPCType("EidolonWyrmHead")); - revengeanceEnemyBuffList.Add(calamity.NPCType("EidolonWyrmHeadHuge")); - revengeanceEnemyBuffList.Add(calamity.NPCType("GulperEelHead")); - revengeanceEnemyBuffList.Add(calamity.NPCType("Mauler")); - revengeanceEnemyBuffList.Add(calamity.NPCType("Reaper")); - revengeanceEnemyBuffList.Add(calamity.NPCType("Atlas")); - revengeanceEnemyBuffList.Add(calamity.NPCType("ArmoredDiggerHead")); - revengeanceEnemyBuffList.Add(calamity.NPCType("Cnidrion")); - revengeanceEnemyBuffList.Add(calamity.NPCType("Horse")); - revengeanceEnemyBuffList.Add(calamity.NPCType("ScornEater")); - revengeanceEnemyBuffList.Add(calamity.NPCType("OldDuke")); - revengeanceEnemyBuffList.Add(calamity.NPCType("DukeUrchin")); - - revengeanceProjectileBuffList.Add(calamity.ProjectileType("AbyssMine")); - revengeanceProjectileBuffList.Add(calamity.ProjectileType("AbyssMine2")); - revengeanceProjectileBuffList.Add(calamity.ProjectileType("AstralFlame")); - revengeanceProjectileBuffList.Add(calamity.ProjectileType("BloodGeyser")); - revengeanceProjectileBuffList.Add(calamity.ProjectileType("BrimstoneBarrage")); - revengeanceProjectileBuffList.Add(calamity.ProjectileType("BrimstoneFireblast")); - revengeanceProjectileBuffList.Add(calamity.ProjectileType("BrimstoneGigaBlast")); - revengeanceProjectileBuffList.Add(calamity.ProjectileType("BrimstoneHellblast")); - revengeanceProjectileBuffList.Add(calamity.ProjectileType("BrimstoneHellblast2")); - revengeanceProjectileBuffList.Add(calamity.ProjectileType("BrimstoneHellfireball")); - revengeanceProjectileBuffList.Add(calamity.ProjectileType("BrimstoneLaser")); - revengeanceProjectileBuffList.Add(calamity.ProjectileType("BrimstoneLaserSplit")); - revengeanceProjectileBuffList.Add(calamity.ProjectileType("BrimstoneMonster")); - revengeanceProjectileBuffList.Add(calamity.ProjectileType("BrimstoneWave")); - revengeanceProjectileBuffList.Add(calamity.ProjectileType("DarkEnergyBall")); - revengeanceProjectileBuffList.Add(calamity.ProjectileType("DeusMine")); - revengeanceProjectileBuffList.Add(calamity.ProjectileType("DoGDeath")); - revengeanceProjectileBuffList.Add(calamity.ProjectileType("DoGFire")); - revengeanceProjectileBuffList.Add(calamity.ProjectileType("CosmicFlameBurst")); - revengeanceProjectileBuffList.Add(calamity.ProjectileType("FlareBomb")); - revengeanceProjectileBuffList.Add(calamity.ProjectileType("Flarenado")); - revengeanceProjectileBuffList.Add(calamity.ProjectileType("HiveBombGoliath")); - revengeanceProjectileBuffList.Add(calamity.ProjectileType("HolyBlast")); - revengeanceProjectileBuffList.Add(calamity.ProjectileType("HolyBomb")); - revengeanceProjectileBuffList.Add(calamity.ProjectileType("HolyShot")); - revengeanceProjectileBuffList.Add(calamity.ProjectileType("HolySpear")); - revengeanceProjectileBuffList.Add(calamity.ProjectileType("IceBomb")); - revengeanceProjectileBuffList.Add(calamity.ProjectileType("IchorShot")); - revengeanceProjectileBuffList.Add(calamity.ProjectileType("Infernado")); - revengeanceProjectileBuffList.Add(calamity.ProjectileType("LeviathanBomb")); - revengeanceProjectileBuffList.Add(calamity.ProjectileType("MoltenBlast")); - revengeanceProjectileBuffList.Add(calamity.ProjectileType("Mushmash")); - revengeanceProjectileBuffList.Add(calamity.ProjectileType("PhantomMine")); - revengeanceProjectileBuffList.Add(calamity.ProjectileType("PhantomBlast")); - revengeanceProjectileBuffList.Add(calamity.ProjectileType("PhantomBlast2")); - revengeanceProjectileBuffList.Add(calamity.ProjectileType("ProfanedSpear")); - revengeanceProjectileBuffList.Add(calamity.ProjectileType("ProvidenceCrystalShard")); - revengeanceProjectileBuffList.Add(calamity.ProjectileType("ProvidenceHolyRay")); - revengeanceProjectileBuffList.Add(calamity.ProjectileType("RedLightningFeather")); - revengeanceProjectileBuffList.Add(calamity.ProjectileType("SandPoisonCloud")); - revengeanceProjectileBuffList.Add(calamity.ProjectileType("ScavengerNuke")); - revengeanceProjectileBuffList.Add(calamity.ProjectileType("SirenSong")); - revengeanceProjectileBuffList.Add(calamity.ProjectileType("YharonFireball")); - revengeanceProjectileBuffList.Add(calamity.ProjectileType("YharonFireball2")); - revengeanceProjectileBuffList.Add(calamity.ProjectileType("YharonFireballHoming")); - } - } - #endregion - - #region Music - public override void UpdateMusic(ref int music, ref MusicPriority priority) - { - Mod calamityModMusic = ModLoader.GetMod("CalamityModMusic"); - if (Main.musicVolume != 0) - { - if (Main.myPlayer != -1 && !Main.gameMenu && Main.LocalPlayer.active) - { - if (NPC.AnyNPCs(NPCID.CultistBoss)) - { - if (calamityModMusic != null) - music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/Doomsayer"); - else - music = MusicID.Boss4; - priority = MusicPriority.BossMedium; - } - if (Main.LocalPlayer.GetModPlayer(this).ZoneCalamity) - { - if (!CalamityPlayer.areThereAnyDamnBosses) - { - if (calamityModMusic != null) - music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/Crag"); - else - music = MusicID.Eerie; - priority = MusicPriority.Environment; - } - } - if (Main.LocalPlayer.GetModPlayer(this).ZoneAstral) - { - if (!CalamityPlayer.areThereAnyDamnBosses) - { - if (calamityModMusic != null) - music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/Astral"); - else - music = MusicID.Space; - priority = MusicPriority.Environment; - } - } - if (Main.LocalPlayer.GetModPlayer(this).ZoneAbyssLayer1 || Main.LocalPlayer.GetModPlayer(this).ZoneAbyssLayer2) - { - if (!CalamityPlayer.areThereAnyDamnBosses) - { - if (calamityModMusic != null) - music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/TheAbyss"); - else - music = MusicID.Hell; - priority = MusicPriority.BiomeHigh; - } - } - if (Main.LocalPlayer.GetModPlayer(this).ZoneAbyssLayer3) - { - if (!CalamityPlayer.areThereAnyDamnBosses) - { - if (calamityModMusic != null) - music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/TheDeepAbyss"); - else - music = MusicID.Hell; - priority = MusicPriority.BiomeHigh; - } - } - if (Main.LocalPlayer.GetModPlayer(this).ZoneAbyssLayer4) - { - if (!CalamityPlayer.areThereAnyDamnBosses) - { - if (calamityModMusic != null) - music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/TheVoid"); - else - music = MusicID.Hell; - priority = MusicPriority.BiomeHigh; - } - } - if (Main.LocalPlayer.GetModPlayer(this).ZoneSulphur) - { - if (!CalamityPlayer.areThereAnyDamnBosses) - { - if (calamityModMusic != null) - music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/Sulphur"); - else - music = MusicID.Desert; - priority = MusicPriority.BiomeHigh; - } - } - if (CalamityWorld.DoGSecondStageCountdown <= 540 && CalamityWorld.DoGSecondStageCountdown > 60) //8 seconds before DoG spawns - { - if (!CalamityPlayer.areThereAnyDamnBosses) - { - if (calamityModMusic != null) - music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/UniversalCollapse"); - else - music = MusicID.LunarBoss; - priority = MusicPriority.BossMedium; - } - } - } - } + Instance = this; } - #endregion - #region PostSetupContent - public override void PostSetupContent() - { - Mod mod = ModLoader.GetMod("CalamityMod"); - Mod bossChecklist = ModLoader.GetMod("BossChecklist"); + #region Load + public override void Load() + { + heartOriginal2 = Main.heartTexture; + heartOriginal = Main.heart2Texture; + rainOriginal = Main.rainTexture; + manaOriginal = Main.manaTexture; + carpetOriginal = Main.flyingCarpetTexture; - if (bossChecklist != null) - { - #region NormalModes - // 14 is moonlord, 12 is duke fishron - bossChecklist.Call("AddBossWithInfo", "Desert Scourge", 1.5f, (Func)(() => CalamityWorld.downedDesertScourge), "Use a [i:" + mod.ItemType("DriedSeafood") + "] in the Desert Biome"); //1 - bossChecklist.Call("AddBossWithInfo", "Crabulon", 2.5f, (Func)(() => CalamityWorld.downedCrabulon), "Use a [i:" + mod.ItemType("DecapoditaSprout") + "] in the Mushroom Biome"); //1.5 - bossChecklist.Call("AddBossWithInfo", "Hive Mind / Perforator", 3.5f, (Func)(() => (CalamityWorld.downedPerforator || CalamityWorld.downedHiveMind)), "By killing a Cyst in the World's Evil Biome"); //2 - bossChecklist.Call("AddBossWithInfo", "Slime God", 5.5f, (Func)(() => CalamityWorld.downedSlimeGod), "Use an [i:" + mod.ItemType("OverloadedSludge") + "]"); //4 - bossChecklist.Call("AddBossWithInfo", "Cryogen", 6.5f, (Func)(() => CalamityWorld.downedCryogen), "Use a [i:" + mod.ItemType("CryoKey") + "] in the Snow Biome"); //5 - bossChecklist.Call("AddBossWithInfo", "Brimstone Elemental", 7.5f, (Func)(() => CalamityWorld.downedBrimstoneElemental), "Use a [i:" + mod.ItemType("CharredIdol") + "] in the Hell Crag"); //6 - bossChecklist.Call("AddBossWithInfo", "Aquatic Scourge", 8.5f, (Func)(() => CalamityWorld.downedAquaticScourge), "Use a [i:" + mod.ItemType("Seafood") + "] in the Sulphuric Sea or wait for it to spawn in the Sulphuric Sea"); //6 - bossChecklist.Call("AddBossWithInfo", "Calamitas", 9.7f, (Func)(() => CalamityWorld.downedCalamitas), "Use an [i:" + mod.ItemType("BlightedEyeball") + "] at Night"); //7 - bossChecklist.Call("AddBossWithInfo", "Leviathan", 10.5f, (Func)(() => CalamityWorld.downedLeviathan), "By killing an unknown entity in the Ocean Biome"); //8 - bossChecklist.Call("AddBossWithInfo", "Astrum Aureus", 10.55f, (Func)(() => CalamityWorld.downedAstrageldon), "Use an [i:" + mod.ItemType("AstralChunk") + "] at Night"); //8.25 - bossChecklist.Call("AddBossWithInfo", "Astrum Deus", 10.6f, (Func)(() => CalamityWorld.downedStarGod), "Use a [i:" + mod.ItemType("Starcore") + "] at Night"); //8.5 - bossChecklist.Call("AddBossWithInfo", "Plaguebringer Goliath", 11.5f, (Func)(() => CalamityWorld.downedPlaguebringer), "Use an [i:" + mod.ItemType("Abomination") + "] in the Jungle Biome"); //9 - bossChecklist.Call("AddBossWithInfo", "Ravager", 12.5f, (Func)(() => CalamityWorld.downedScavenger), "Use an [i:" + mod.ItemType("AncientMedallion") + "]"); //9.5 - //bossChecklist.Call("AddBossWithInfo", "The Old Duke", 13.5f, (Func)(() => CalamityWorld.downedOldDuke), "Fishing with some type of bait in the Sulphuric Sea"); //9.6 - bossChecklist.Call("AddBossWithInfo", "Profaned Guardians", 14.5f, (Func)(() => CalamityWorld.downedGuardians), "Use a [i:" + mod.ItemType("ProfanedShard") + "] in the Hallow or Underworld Biomes"); //10 - bossChecklist.Call("AddBossWithInfo", "Providence", 15f, (Func)(() => CalamityWorld.downedProvidence), "Use a [i:" + mod.ItemType("ProfanedCore") + "] in the Hallow or Underworld Biomes"); //11 - bossChecklist.Call("AddBossWithInfo", "Ceaseless Void", 15.1f, (Func)(() => CalamityWorld.downedSentinel1), "Use a [i:" + mod.ItemType("RuneofCos") + "] in the Dungeon"); //12 - bossChecklist.Call("AddBossWithInfo", "Storm Weaver", 15.2f, (Func)(() => CalamityWorld.downedSentinel2), "Use a [i:" + mod.ItemType("RuneofCos") + "] in Space"); //13 - bossChecklist.Call("AddBossWithInfo", "Signus", 15.3f, (Func)(() => CalamityWorld.downedSentinel3), "Use a [i:" + mod.ItemType("RuneofCos") + "] in the Underworld"); //14 - bossChecklist.Call("AddBossWithInfo", "Polterghast", 15.5f, (Func)(() => CalamityWorld.downedPolterghast), "Use a [i:" + mod.ItemType("NecroplasmicBeacon") + "] in the Dungeon or kill 30 phantom spirits"); //11 - bossChecklist.Call("AddBossWithInfo", "Devourer of Gods", 16f, (Func)(() => CalamityWorld.downedDoG), "Use a [i:" + mod.ItemType("CosmicWorm") + "]"); //15 - bossChecklist.Call("AddBossWithInfo", "Bumblebirb", 16.5f, (Func)(() => CalamityWorld.downedBumble), "Use [i:" + mod.ItemType("BirbPheromones") + "] in the Jungle Biome or find it in the Jungle Biome"); //16 - bossChecklist.Call("AddBossWithInfo", "Yharon", 17f, (Func)(() => CalamityWorld.downedYharon), "Use a [i:" + mod.ItemType("ChickenEgg") + "] in the Jungle Biome"); //17 - bossChecklist.Call("AddBossWithInfo", "Supreme Calamitas", 18f, (Func)(() => CalamityWorld.downedSCal), "Use an [i:" + mod.ItemType("EyeofExtinction") + "]"); //18 - //bossChecklist.Call("AddBossWithInfo", "MEME GOD", 19f, (Func)(() => CalamityWorld.downedLORDE), "Use [i:" + mod.ItemType("NO") + "]"); //19 - #endregion - } - } - #endregion + NormalityRelocatorHotKey = RegisterHotKey("Normality Relocator", "Z"); + RageHotKey = RegisterHotKey("Rage Mode", "V"); + AdrenalineHotKey = RegisterHotKey("Adrenaline Mode", "B"); + AegisHotKey = RegisterHotKey("Elysian Guard", "N"); + TarraHotKey = RegisterHotKey("Armor Set Bonus", "Y"); + AstralTeleportHotKey = RegisterHotKey("Astral Teleport", "P"); + AstralArcanumUIHotkey = RegisterHotKey("Astral Arcanum UI Toggle", "O"); + BossBarToggleHotKey = RegisterHotKey("Boss Health Bar Toggle", "NumPad0"); + BossBarToggleSmallTextHotKey = RegisterHotKey("Boss Health Bar Small Text Toggle", "NumPad1"); - #region DrawingStuff - public override void ModifyInterfaceLayers(List layers) - { - Mod mod = ModLoader.GetMod("CalamityMod"); - if (CalamityWorld.revenge) + if (!Main.dedServ) { - UIHandler.ModifyInterfaceLayers(mod, layers); + LoadClient(); } - int index = layers.FindIndex(layer => layer.Name == "Vanilla: Mouse Text"); - if (index != -1) - { - layers.Insert(index, new LegacyGameInterfaceLayer("Boss HP Bars", delegate () - { - if (Main.LocalPlayer.GetModPlayer(mod).drawBossHPBar) - { - BossHealthBarManager.Update(); - BossHealthBarManager.Draw(Main.spriteBatch); - } - return true; - }, InterfaceScaleType.None)); - } - base.ModifyInterfaceLayers(layers); - layers.Insert(index, new LegacyGameInterfaceLayer("Astral Arcanum UI", delegate () - { - AstralArcanumUI.UpdateAndDraw(Main.spriteBatch); - return true; - }, InterfaceScaleType.None)); - } - public static Color GetNPCColor(NPC npc, Vector2? position = null, bool effects = true, float shadowOverride = 0f) - { - return npc.GetAlpha(BuffEffects(npc, GetLightColor(position != null ? (Vector2)position : npc.Center), (shadowOverride != 0f ? shadowOverride : 0f), effects, npc.poisoned, npc.onFire, npc.onFire2, Main.player[Main.myPlayer].detectCreature, false, false, false, npc.venom, npc.midas, npc.ichor, npc.onFrostBurn, false, false, npc.dripping, npc.drippingSlime, npc.loveStruck, npc.stinky)); - } - - public static Color GetLightColor(Vector2 position) - { - return Lighting.GetColor((int)(position.X / 16f), (int)(position.Y / 16f)); - } - - public static Color BuffEffects(Entity codable, Color lightColor, float shadow = 0f, bool effects = true, bool poisoned = false, bool onFire = false, bool onFire2 = false, bool hunter = false, bool noItems = false, bool blind = false, bool bleed = false, bool venom = false, bool midas = false, bool ichor = false, bool onFrostBurn = false, bool burned = false, bool honey = false, bool dripping = false, bool drippingSlime = false, bool loveStruck = false, bool stinky = false) - { - float cr = 1f; float cg = 1f; float cb = 1f; float ca = 1f; + BossHealthBarManager.Load(this); + + SetupLists(); + + CalamityLocalization.AddLocalizations(); + } + + private void LoadClient() + { + AddEquipTexture(new Items.Armor.AbyssalDivingSuitHead(), null, EquipType.Head, "AbyssalDivingSuitHead", "CalamityMod/Items/Armor/AbyssalDivingSuit_Head"); + AddEquipTexture(new Items.Armor.AbyssalDivingSuitBody(), null, EquipType.Body, "AbyssalDivingSuitBody", "CalamityMod/Items/Armor/AbyssalDivingSuit_Body", "CalamityMod/Items/Armor/AbyssalDivingSuit_Arms"); + AddEquipTexture(new Items.Armor.AbyssalDivingSuitLegs(), null, EquipType.Legs, "AbyssalDivingSuitLeg", "CalamityMod/Items/Armor/AbyssalDivingSuit_Legs"); + + AddEquipTexture(new Items.Armor.SirenHead(), null, EquipType.Head, "SirenHead", "CalamityMod/Items/Armor/SirenTrans_Head"); + AddEquipTexture(new Items.Armor.SirenBody(), null, EquipType.Body, "SirenBody", "CalamityMod/Items/Armor/SirenTrans_Body", "CalamityMod/Items/Armor/SirenTrans_Arms"); + AddEquipTexture(new Items.Armor.SirenLegs(), null, EquipType.Legs, "SirenLeg", "CalamityMod/Items/Armor/SirenTrans_Legs"); + + AddEquipTexture(new Items.Armor.SirenHeadAlt(), null, EquipType.Head, "SirenHeadAlt", "CalamityMod/Items/Armor/SirenTransAlt_Head"); + AddEquipTexture(new Items.Armor.SirenBodyAlt(), null, EquipType.Body, "SirenBodyAlt", "CalamityMod/Items/Armor/SirenTransAlt_Body", "CalamityMod/Items/Armor/SirenTransAlt_Arms"); + AddEquipTexture(new Items.Armor.SirenLegsAlt(), null, EquipType.Legs, "SirenLegAlt", "CalamityMod/Items/Armor/SirenTransAlt_Legs"); + + AddEquipTexture(new Items.Permafrost.PopoHead(), null, EquipType.Head, "PopoHead", "CalamityMod/Items/Permafrost/Popo_Head"); + AddEquipTexture(new Items.Permafrost.PopoNoselessHead(), null, EquipType.Head, "PopoNoselessHead", "CalamityMod/Items/Permafrost/PopoNoseless_Head"); + AddEquipTexture(new Items.Permafrost.PopoBody(), null, EquipType.Body, "PopoBody", "CalamityMod/Items/Permafrost/Popo_Body", "CalamityMod/Items/Permafrost/Popo_Arms"); + AddEquipTexture(new Items.Permafrost.PopoLegs(), null, EquipType.Legs, "PopoLeg", "CalamityMod/Items/Permafrost/Popo_Legs"); + + AstralCactusTexture = GetTexture("ExtraTextures/Tiles/AstralCactus"); + AstralCactusGlowTexture = GetTexture("ExtraTextures/Tiles/AstralCactusGlow"); + AstralSky = GetTexture("ExtraTextures/AstralSky"); + CustomShader = GetEffect("Effects/CustomShader"); + + Filters.Scene["CalamityMod:DevourerofGodsHead"] = new Filter(new DoGScreenShaderData("FilterMiniTower").UseColor(0.4f, 0.1f, 1.0f).UseOpacity(0.5f), EffectPriority.VeryHigh); + SkyManager.Instance["CalamityMod:DevourerofGodsHead"] = new DoGSky(); + + Filters.Scene["CalamityMod:DevourerofGodsHeadS"] = new Filter(new DoGScreenShaderDataS("FilterMiniTower").UseColor(0.4f, 0.1f, 1.0f).UseOpacity(0.5f), EffectPriority.VeryHigh); + SkyManager.Instance["CalamityMod:DevourerofGodsHeadS"] = new DoGSkyS(); + + Filters.Scene["CalamityMod:CalamitasRun3"] = new Filter(new CalScreenShaderData("FilterMiniTower").UseColor(1.1f, 0.3f, 0.3f).UseOpacity(0.6f), EffectPriority.VeryHigh); + SkyManager.Instance["CalamityMod:CalamitasRun3"] = new CalSky(); + + Filters.Scene["CalamityMod:PlaguebringerGoliath"] = new Filter(new PbGScreenShaderData("FilterMiniTower").UseColor(0.2f, 0.6f, 0.2f).UseOpacity(0.65f), EffectPriority.VeryHigh); + SkyManager.Instance["CalamityMod:PlaguebringerGoliath"] = new PbGSky(); + + Filters.Scene["CalamityMod:Yharon"] = new Filter(new YScreenShaderData("FilterMiniTower").UseColor(1f, 0.4f, 0f).UseOpacity(0.75f), EffectPriority.VeryHigh); + SkyManager.Instance["CalamityMod:Yharon"] = new YSky(); + + Filters.Scene["CalamityMod:Leviathan"] = new Filter(new LevScreenShaderData("FilterMiniTower").UseColor(0f, 0f, 0.5f).UseOpacity(0.5f), EffectPriority.VeryHigh); + SkyManager.Instance["CalamityMod:Leviathan"] = new LevSky(); + + Filters.Scene["CalamityMod:Providence"] = new Filter(new ProvScreenShaderData("FilterMiniTower").UseColor(0.6f, 0.45f, 0f).UseOpacity(0.5f), EffectPriority.VeryHigh); + SkyManager.Instance["CalamityMod:Providence"] = new ProvSky(); + + Filters.Scene["CalamityMod:SupremeCalamitas"] = new Filter(new SCalScreenShaderData("FilterMiniTower").UseColor(1.1f, 0.3f, 0.3f).UseOpacity(0.65f), EffectPriority.VeryHigh); + SkyManager.Instance["CalamityMod:SupremeCalamitas"] = new SCalSky(); + + Filters.Scene["CalamityMod:Astral"] = new Filter(new AstralScreenShaderData(new Ref(CustomShader), "AstralPass").UseColor(0.18f, 0.08f, 0.24f), EffectPriority.VeryHigh); + SkyManager.Instance["CalamityMod:Astral"] = new AstralSky(); + + Mod mod = ModLoader.GetMod("CalamityMod"); + UIHandler.OnLoad(mod); + + AstralArcanumUI.Load(this); + } + #endregion + + #region Unload + public override void Unload() + { + NormalityRelocatorHotKey = null; + RageHotKey = null; + AdrenalineHotKey = null; + AegisHotKey = null; + TarraHotKey = null; + AstralTeleportHotKey = null; + AstralArcanumUIHotkey = null; + BossBarToggleHotKey = null; + BossBarToggleSmallTextHotKey = null; + + AstralCactusTexture = null; + AstralCactusGlowTexture = null; + AstralSky = null; + + donatorList = null; + + rangedProjectileExceptionList = null; + projectileMinionList = null; + enemyImmunityList = null; + dungeonEnemyBuffList = null; + bossScaleList = null; + beeEnemyList = null; + beeProjectileList = null; + hardModeNerfList = null; + debuffList = null; + fireWeaponList = null; + natureWeaponList = null; + alcoholList = null; + doubleDamageBuffList = null; + sixtySixDamageBuffList = null; + fiftyDamageBuffList = null; + thirtyThreeDamageBuffList = null; + twentyFiveDamageBuffList = null; + weaponAutoreuseList = null; + quarterDamageNerfList = null; + pumpkinMoonBuffList = null; + frostMoonBuffList = null; + eclipseBuffList = null; + eventProjectileBuffList = null; + revengeanceEnemyBuffList = null; + revengeanceProjectileBuffList = null; + trapProjectileList = null; + scopedWeaponList = null; + + BossHealthBarManager.Unload(); + base.Unload(); + + AstralArcanumUI.Unload(); + base.Unload(); + + Instance = null; + + if (!Main.dedServ) + { + Main.music[MusicID.Hell] = Main.soundBank.GetCue("Music_" + MusicID.Hell); //remove in 1.4.1 + + Main.heartTexture = heartOriginal2; + Main.heart2Texture = heartOriginal; + Main.rainTexture = rainOriginal; + Main.manaTexture = manaOriginal; + Main.flyingCarpetTexture = carpetOriginal; + } + } + #endregion + + #region SetupLists + public static void SetupLists() + { + Mod calamity = ModLoader.GetMod("CalamityMod"); + if (calamity != null) + { + donatorList = new List() + { + "Vorbis", + "SoloMael", + "Chaotic Reks", + "The Buildmonger", + "Yuh", + "Littlepiggy", + "LompL", + "Lilith Saintclaire", + "Ben Shapiro", + "Frederik Henschel", + "Faye", + "Gibb50", + "Braden Hajer", + "Hannes Holmlund", + "profoundmango69", + "Jack M Sargent", + "Hans Volter", + "Krankwagon", + "MishiroUsui", + "pixlgray", + "Arkhine", + "Lodude", + "DevAesthetic", + "Mister Winchester", + "Zacky", + "Veine", + "Javyz", + "Shifter", + "Crysthamyr", + "Elfinlocks", + "Ein", + "2Larry2", + "Jenonen", + "Dodu", + "Arti", + "Tervastator" + }; + + rangedProjectileExceptionList = new List() + { + ProjectileID.Phantasm, + ProjectileID.VortexBeater, + ProjectileID.DD2PhoenixBow, + calamity.ProjectileType("Phangasm"), + calamity.ProjectileType("Contagion"), + calamity.ProjectileType("DaemonsFlame"), + calamity.ProjectileType("ExoTornado"), + calamity.ProjectileType("Drataliornus"), + calamity.ProjectileType("FlakKrakenGun"), + calamity.ProjectileType("Butcher"), + calamity.ProjectileType("StarfleetMK2"), + calamity.ProjectileType("TerraBulletSplit"), + calamity.ProjectileType("TerraArrow2"), + calamity.ProjectileType("OMGWTH") + }; + + projectileMinionList = new List() + { + ProjectileID.PygmySpear, + ProjectileID.UFOMinion, + ProjectileID.UFOLaser, + ProjectileID.StardustCellMinionShot, + ProjectileID.MiniSharkron, + ProjectileID.MiniRetinaLaser, + ProjectileID.ImpFireball, + ProjectileID.HornetStinger, + ProjectileID.DD2FlameBurstTowerT1Shot, + ProjectileID.DD2FlameBurstTowerT2Shot, + ProjectileID.DD2FlameBurstTowerT3Shot, + ProjectileID.DD2BallistraProj, + ProjectileID.DD2ExplosiveTrapT1Explosion, + ProjectileID.DD2ExplosiveTrapT2Explosion, + ProjectileID.DD2ExplosiveTrapT3Explosion, + ProjectileID.SpiderEgg, + ProjectileID.BabySpider, + ProjectileID.FrostBlastFriendly, + ProjectileID.MoonlordTurretLaser, + ProjectileID.RainbowCrystalExplosion + }; + + enemyImmunityList = new List() + { + NPCID.QueenBee, + NPCID.WallofFlesh, + NPCID.WallofFleshEye, + NPCID.Retinazer, + NPCID.Spazmatism, + NPCID.SkeletronPrime, + NPCID.PrimeCannon, + NPCID.PrimeSaw, + NPCID.PrimeLaser, + NPCID.PrimeVice, + NPCID.Plantera, + NPCID.IceQueen, + NPCID.Pumpking, + NPCID.Mothron, + NPCID.Golem, + NPCID.GolemHead, + NPCID.GolemFistRight, + NPCID.GolemFistLeft, + NPCID.DukeFishron, + NPCID.CultistBoss, + NPCID.MoonLordHead, + NPCID.MoonLordHand, + NPCID.MoonLordCore, + NPCID.MoonLordFreeEye, + NPCID.DD2Betsy + }; + + dungeonEnemyBuffList = new List() + { + NPCID.SkeletonSniper, + NPCID.TacticalSkeleton, + NPCID.SkeletonCommando, + NPCID.Paladin, + NPCID.GiantCursedSkull, + NPCID.BoneLee, + NPCID.DiabolistWhite, + NPCID.DiabolistRed, + NPCID.NecromancerArmored, + NPCID.Necromancer, + NPCID.RaggedCasterOpenCoat, + NPCID.RaggedCaster, + NPCID.HellArmoredBonesSword, + NPCID.HellArmoredBonesMace, + NPCID.HellArmoredBonesSpikeShield, + NPCID.HellArmoredBones, + NPCID.BlueArmoredBonesSword, + NPCID.BlueArmoredBonesNoPants, + NPCID.BlueArmoredBonesMace, + NPCID.BlueArmoredBones, + NPCID.RustyArmoredBonesSwordNoArmor, + NPCID.RustyArmoredBonesSword, + NPCID.RustyArmoredBonesFlail, + NPCID.RustyArmoredBonesAxe + }; + + bossScaleList = new List() + { + NPCID.EaterofWorldsHead, + NPCID.EaterofWorldsBody, + NPCID.EaterofWorldsTail, + NPCID.Creeper, + NPCID.SkeletronHand, + NPCID.WallofFleshEye, + NPCID.TheHungry, + NPCID.TheHungryII, + NPCID.TheDestroyerBody, + NPCID.TheDestroyerTail, + NPCID.PrimeCannon, + NPCID.PrimeVice, + NPCID.PrimeSaw, + NPCID.PrimeLaser, + NPCID.PlanterasTentacle, + NPCID.Pumpking, + NPCID.IceQueen, + NPCID.Mothron, + NPCID.GolemHead + }; + + beeEnemyList = new List() + { + NPCID.GiantMossHornet, + NPCID.BigMossHornet, + NPCID.LittleMossHornet, + NPCID.TinyMossHornet, + NPCID.MossHornet, + NPCID.VortexHornetQueen, + NPCID.VortexHornet, + NPCID.Bee, + NPCID.BeeSmall, + NPCID.QueenBee, + calamity.NPCType("PlaguebringerGoliath"), + calamity.NPCType("PlaguebringerShade"), + calamity.NPCType("PlagueBeeLargeG"), + calamity.NPCType("PlagueBeeLarge"), + calamity.NPCType("PlagueBeeG"), + calamity.NPCType("PlagueBee") + }; + + beeProjectileList = new List() + { + ProjectileID.Stinger, + ProjectileID.HornetStinger, + calamity.ProjectileType("PlagueStingerGoliath"), + calamity.ProjectileType("PlagueStingerGoliathV2"), + calamity.ProjectileType("PlagueExplosion") + }; + + hardModeNerfList = new List() + { + ProjectileID.WebSpit, + ProjectileID.PinkLaser, + ProjectileID.FrostBlastHostile, + ProjectileID.RuneBlast, + ProjectileID.GoldenShowerHostile, + ProjectileID.RainNimbus, + ProjectileID.Stinger, + ProjectileID.FlamingArrow, + ProjectileID.BulletDeadeye, + ProjectileID.CannonballHostile + }; + + debuffList = new List() + { + BuffID.Poisoned, + BuffID.Darkness, + BuffID.Cursed, + BuffID.OnFire, + BuffID.Bleeding, + BuffID.Confused, + BuffID.Slow, + BuffID.Weak, + BuffID.Silenced, + BuffID.BrokenArmor, + BuffID.CursedInferno, + BuffID.Frostburn, + BuffID.Chilled, + BuffID.Frozen, + BuffID.Burning, + BuffID.Suffocation, + BuffID.Ichor, + BuffID.Venom, + BuffID.Blackout, + BuffID.Electrified, + BuffID.Rabies, + BuffID.Webbed, + BuffID.Stoned, + BuffID.Dazed, + BuffID.VortexDebuff, + BuffID.WitheredArmor, + BuffID.WitheredWeapon, + BuffID.OgreSpit, + BuffID.BetsysCurse, + calamity.BuffType("BrimstoneFlames"), + calamity.BuffType("BurningBlood"), + calamity.BuffType("GlacialState"), + calamity.BuffType("GodSlayerInferno"), + calamity.BuffType("HolyLight"), + calamity.BuffType("Irradiated"), + calamity.BuffType("Plague"), + calamity.BuffType("AbyssalFlames"), + calamity.BuffType("CrushDepth"), + calamity.BuffType("Horror"), + calamity.BuffType("MarkedforDeath") + }; + + fireWeaponList = new List() + { + ItemID.FieryGreatsword, + ItemID.DD2SquireDemonSword, + ItemID.TheHorsemansBlade, + ItemID.DD2SquireBetsySword, + ItemID.Cascade, + ItemID.HelFire, + ItemID.MonkStaffT2, + ItemID.Flamarang, + ItemID.MoltenFury, + ItemID.Sunfury, + ItemID.PhoenixBlaster, + ItemID.Flamelash, + ItemID.SolarEruption, + ItemID.DayBreak, + ItemID.MonkStaffT3, + ItemID.HellwingBow, + ItemID.DD2PhoenixBow, + ItemID.DD2BetsyBow, + ItemID.FlareGun, + ItemID.Flamethrower, + ItemID.EldMelter, + ItemID.FlowerofFire, + ItemID.MeteorStaff, + ItemID.ApprenticeStaffT3, + ItemID.InfernoFork, + ItemID.HeatRay, + ItemID.BookofSkulls, + ItemID.ImpStaff, + ItemID.DD2FlameburstTowerT1Popper, + ItemID.DD2FlameburstTowerT2Popper, + ItemID.DD2FlameburstTowerT3Popper, + ItemID.MolotovCocktail, + calamity.ItemType("AegisBlade"), + calamity.ItemType("BalefulHarvester"), + calamity.ItemType("Chaotrix"), + calamity.ItemType("CometQuasher"), + calamity.ItemType("DraconicDestruction"), + calamity.ItemType("Drataliornus"), + calamity.ItemType("EnergyStaff"), + calamity.ItemType("ExsanguinationLance"), + calamity.ItemType("FirestormCannon"), + calamity.ItemType("FlameburstShortsword"), + calamity.ItemType("FlameScythe"), + calamity.ItemType("FlameScytheMelee"), + calamity.ItemType("FlareBolt"), + calamity.ItemType("FlarefrostBlade"), + calamity.ItemType("FlarewingBow"), + calamity.ItemType("ForbiddenSun"), + calamity.ItemType("FrigidflashBolt"), + calamity.ItemType("GreatbowofTurmoil"), + calamity.ItemType("HarvestStaff"), + calamity.ItemType("HellBurst"), + calamity.ItemType("HellfireFlamberge"), + calamity.ItemType("Hellkite"), + calamity.ItemType("HellwingStaff"), + calamity.ItemType("Helstorm"), + calamity.ItemType("InfernaCutter"), + calamity.ItemType("Lazhar"), + calamity.ItemType("MeteorFist"), + calamity.ItemType("Mourningstar"), + calamity.ItemType("PhoenixBlade"), + calamity.ItemType("Photoviscerator"), + calamity.ItemType("RedSun"), + calamity.ItemType("SpectralstormCannon"), + calamity.ItemType("SunGodStaff"), + calamity.ItemType("SunSpiritStaff"), + calamity.ItemType("TearsofHeaven"), + calamity.ItemType("TerraFlameburster"), + calamity.ItemType("TheEmpyrean"), + calamity.ItemType("TheWand"), + calamity.ItemType("VenusianTrident"), + calamity.ItemType("Vesuvius"), + calamity.ItemType("BlissfulBombardier"), + calamity.ItemType("HolyCollider"), + calamity.ItemType("MoltenAmputator"), + calamity.ItemType("PurgeGuzzler"), + calamity.ItemType("SolarFlare"), + calamity.ItemType("TelluricGlare"), + calamity.ItemType("AngryChickenStaff"), + calamity.ItemType("ChickenCannon"), + calamity.ItemType("DragonRage"), + calamity.ItemType("DragonsBreath"), + calamity.ItemType("PhoenixFlameBarrage"), + calamity.ItemType("ProfanedTrident"), + calamity.ItemType("TheBurningSky") + }; + + natureWeaponList = new List() + { + ItemID.BladeofGrass, + ItemID.ChlorophyteClaymore, + ItemID.ChlorophyteSaber, + ItemID.ChlorophytePartisan, + ItemID.ChlorophyteShotbow, + ItemID.Seedler, + ItemID.ChristmasTreeSword, + ItemID.TerraBlade, + ItemID.JungleYoyo, + ItemID.Yelets, + ItemID.MushroomSpear, + ItemID.ThornChakram, + ItemID.Bananarang, + ItemID.FlowerPow, + ItemID.BeesKnees, + ItemID.Toxikarp, + ItemID.Bladetongue, + ItemID.PoisonStaff, + ItemID.VenomStaff, + ItemID.StaffofEarth, + ItemID.BeeGun, + ItemID.LeafBlower, + ItemID.WaspGun, + ItemID.CrystalSerpent, + ItemID.Razorpine, + ItemID.HornetStaff, + ItemID.QueenSpiderStaff, + ItemID.SlimeStaff, + ItemID.PygmyStaff, + ItemID.RavenStaff, + ItemID.BatScepter, + ItemID.SpiderStaff, + ItemID.Beenade, + ItemID.FrostDaggerfish, + calamity.ItemType("DepthBlade"), + calamity.ItemType("AbyssBlade"), + calamity.ItemType("NeptunesBounty"), + calamity.ItemType("AquaticDissolution"), + calamity.ItemType("ArchAmaryllis"), + calamity.ItemType("BiomeBlade"), + calamity.ItemType("TrueBiomeBlade"), + calamity.ItemType("OmegaBiomeBlade"), + calamity.ItemType("BladedgeGreatbow"), + calamity.ItemType("BlossomFlux"), + calamity.ItemType("EvergladeSpray"), + calamity.ItemType("FeralthornClaymore"), + calamity.ItemType("Floodtide"), + calamity.ItemType("FourSeasonsGalaxia"), + calamity.ItemType("GammaFusillade"), + calamity.ItemType("GleamingMagnolia"), + calamity.ItemType("HarvestStaff"), + calamity.ItemType("HellionFlowerSpear"), + calamity.ItemType("Lazhar"), + calamity.ItemType("LifefruitScythe"), + calamity.ItemType("ManaRose"), + calamity.ItemType("MangroveChakram"), + calamity.ItemType("MangroveChakramMelee"), + calamity.ItemType("MantisClaws"), + calamity.ItemType("Mariana"), + calamity.ItemType("Mistlestorm"), + calamity.ItemType("Monsoon"), + calamity.ItemType("Alluvion"), + calamity.ItemType("Needler"), + calamity.ItemType("NettlelineGreatbow"), + calamity.ItemType("Quagmire"), + calamity.ItemType("Shroomer"), + calamity.ItemType("SolsticeClaymore"), + calamity.ItemType("SporeKnife"), + calamity.ItemType("Spyker"), + calamity.ItemType("StormSaber"), + calamity.ItemType("StormRuler"), + calamity.ItemType("StormSurge"), + calamity.ItemType("TarragonThrowingDart"), + calamity.ItemType("TerraEdge"), + calamity.ItemType("TerraLance"), + calamity.ItemType("TerraRay"), + calamity.ItemType("TerraShiv"), + calamity.ItemType("Terratomere"), + calamity.ItemType("TerraFlameburster"), + calamity.ItemType("TheSwarmer"), + calamity.ItemType("Verdant"), + calamity.ItemType("Barinautical"), + calamity.ItemType("DeepseaStaff"), + calamity.ItemType("Downpour"), + calamity.ItemType("SubmarineShocker"), + calamity.ItemType("Archerfish"), + calamity.ItemType("BallOFugu"), + calamity.ItemType("BlackAnurian"), + calamity.ItemType("CalamarisLament"), + calamity.ItemType("HerringStaff"), + calamity.ItemType("Lionfish") + }; + + alcoholList = new List() + { + calamity.BuffType("BloodyMary"), + calamity.BuffType("CaribbeanRum"), + calamity.BuffType("CinnamonRoll"), + calamity.BuffType("Everclear"), + calamity.BuffType("EvergreenGin"), + calamity.BuffType("Fireball"), + calamity.BuffType("GrapeBeer"), + calamity.BuffType("Margarita"), + calamity.BuffType("Moonshine"), + calamity.BuffType("MoscowMule"), + calamity.BuffType("RedWine"), + calamity.BuffType("Rum"), + calamity.BuffType("Screwdriver"), + calamity.BuffType("StarBeamRye"), + calamity.BuffType("Tequila"), + calamity.BuffType("TequilaSunrise"), + calamity.BuffType("Vodka"), + calamity.BuffType("Whiskey"), + calamity.BuffType("WhiteWine") + }; + + doubleDamageBuffList = new List() + { + ItemID.BallOHurt, + ItemID.TheMeatball, + ItemID.BlueMoon, + ItemID.Sunfury, + ItemID.DaoofPow, + ItemID.FlowerPow, + ItemID.Anchor, + ItemID.KOCannon, + ItemID.GolemFist, + ItemID.BreakerBlade, + ItemID.SpectreStaff, + ItemID.MonkStaffT2, + ItemID.ProximityMineLauncher, + ItemID.FireworksLauncher + }; + + sixtySixDamageBuffList = new List() + { + ItemID.TerraBlade, + ItemID.TrueNightsEdge, + ItemID.WandofSparking, + ItemID.MedusaHead, + ItemID.StaffofEarth, + ItemID.ChristmasTreeSword, + ItemID.MonkStaffT1, + ItemID.InfernoFork, + ItemID.VenomStaff + }; + + fiftyDamageBuffList = new List() + { + ItemID.NightsEdge, + ItemID.EldMelter, + ItemID.Flamethrower, + ItemID.MoonlordTurretStaff, + ItemID.WaspGun, + ItemID.Keybrand, + ItemID.PulseBow, + ItemID.PaladinsHammer + }; + + thirtyThreeDamageBuffList = new List() + { + ItemID.CrystalVileShard, + ItemID.SoulDrain, + ItemID.ClingerStaff, + ItemID.ChargedBlasterCannon, + ItemID.NettleBurst, + ItemID.Excalibur, + ItemID.AmberStaff, + ItemID.BluePhasesaber, + ItemID.RedPhasesaber, + ItemID.GreenPhasesaber, + ItemID.WhitePhasesaber, + ItemID.YellowPhasesaber, + ItemID.PurplePhasesaber, + ItemID.TheRottedFork, + ItemID.VampireKnives + }; + + twentyFiveDamageBuffList = new List() + { + ItemID.Muramasa, + ItemID.StakeLauncher + }; + + twentyDamageBuffList = new List() + { + ItemID.ChainGuillotines, + ItemID.FlowerofFrost, + ItemID.PoisonStaff, + ItemID.Gungnir, + ItemID.BookStaff + }; + + weaponAutoreuseList = new List() + { + ItemID.NightsEdge, + ItemID.TrueNightsEdge, + ItemID.TrueExcalibur, + ItemID.PhoenixBlaster, + ItemID.VenusMagnum, + ItemID.MagicDagger, + ItemID.BeamSword, + ItemID.MonkStaffT2, + ItemID.PaladinsHammer + }; + + quarterDamageNerfList = new List() + { + ItemID.DaedalusStormbow, + ItemID.PhoenixBlaster, + ItemID.VenusMagnum, + ItemID.BlizzardStaff + }; + + pumpkinMoonBuffList = new List() + { + NPCID.Scarecrow1, + NPCID.Scarecrow2, + NPCID.Scarecrow3, + NPCID.Scarecrow4, + NPCID.Scarecrow5, + NPCID.Scarecrow6, + NPCID.Scarecrow7, + NPCID.Scarecrow8, + NPCID.Scarecrow9, + NPCID.Scarecrow10, + NPCID.HeadlessHorseman, + NPCID.MourningWood, + NPCID.Splinterling, + NPCID.Pumpking, + NPCID.Hellhound, + NPCID.Poltergeist + }; + + frostMoonBuffList = new List() + { + NPCID.ZombieElf, + NPCID.ZombieElfBeard, + NPCID.ZombieElfGirl, + NPCID.PresentMimic, + NPCID.GingerbreadMan, + NPCID.Yeti, + NPCID.Everscream, + NPCID.IceQueen, + NPCID.SantaNK1, + NPCID.ElfCopter, + NPCID.Nutcracker, + NPCID.NutcrackerSpinning, + NPCID.ElfArcher, + NPCID.Krampus, + NPCID.Flocko + }; + + eclipseBuffList = new List() + { + NPCID.Eyezor, + NPCID.Reaper, + NPCID.Frankenstein, + NPCID.SwampThing, + NPCID.Vampire, + NPCID.VampireBat, + NPCID.Butcher, + NPCID.CreatureFromTheDeep, + NPCID.Fritz, + NPCID.Nailhead, + NPCID.Psycho, + NPCID.DeadlySphere, + NPCID.DrManFly, + NPCID.ThePossessed, + NPCID.Mothron, + NPCID.MothronEgg, + NPCID.MothronSpawn + }; + + eventProjectileBuffList = new List() + { + ProjectileID.FlamingWood, + ProjectileID.GreekFire1, + ProjectileID.GreekFire2, + ProjectileID.GreekFire3, + ProjectileID.FlamingScythe, + ProjectileID.FlamingArrow, + ProjectileID.PineNeedleHostile, + ProjectileID.OrnamentHostile, + ProjectileID.OrnamentHostileShrapnel, + ProjectileID.FrostWave, + ProjectileID.FrostShard, + ProjectileID.Missile, + ProjectileID.Present, + ProjectileID.Spike, + ProjectileID.BulletDeadeye, + ProjectileID.EyeLaser, + ProjectileID.Nail, + ProjectileID.DrManFlyFlask + }; + + revengeanceEnemyBuffList = new List() + { + NPCID.ServantofCthulhu, + NPCID.EyeofCthulhu, + NPCID.EaterofWorldsHead, + NPCID.DevourerHead, + NPCID.GiantWormHead, + NPCID.MeteorHead, + NPCID.SkeletronHead, + NPCID.SkeletronHand, + NPCID.BoneSerpentHead, + NPCID.ManEater, + NPCID.KingSlime, + NPCID.Snatcher, + NPCID.Piranha, + NPCID.Shark, + NPCID.SpikeBall, + NPCID.BlazingWheel, + NPCID.Mimic, + NPCID.WyvernHead, + NPCID.DiggerHead, + NPCID.SeekerHead, + NPCID.AnglerFish, + NPCID.Werewolf, + NPCID.Wraith, + NPCID.WallofFlesh, + NPCID.TheHungry, + NPCID.TheHungryII, + NPCID.LeechHead, + NPCID.Spazmatism, + NPCID.Retinazer, + NPCID.SkeletronPrime, + NPCID.PrimeSaw, + NPCID.PrimeVice, + NPCID.TheDestroyer, + NPCID.Arapaima, + NPCID.BlackRecluse, + NPCID.WallCreeper, + NPCID.WallCreeperWall, + NPCID.BlackRecluseWall, + NPCID.AngryTrapper, + NPCID.Lihzahrd, + NPCID.LihzahrdCrawler, + NPCID.PirateCaptain, + NPCID.QueenBee, + NPCID.FlyingSnake, + NPCID.Golem, + NPCID.GolemFistLeft, + NPCID.GolemFistRight, + NPCID.Reaper, + NPCID.Plantera, + NPCID.PlanterasHook, + NPCID.PlanterasTentacle, + NPCID.BrainofCthulhu, + NPCID.Paladin, + NPCID.BoneLee, + NPCID.MourningWood, + NPCID.Pumpking, + NPCID.PumpkingBlade, + NPCID.PresentMimic, + NPCID.Everscream, + NPCID.IceQueen, + NPCID.SantaNK1, + NPCID.DukeFishron, + NPCID.MoonLordHand, + NPCID.StardustWormHead, + NPCID.SolarCrawltipedeHead, + NPCID.CultistDragonHead, + NPCID.Butcher, + NPCID.Psycho, + NPCID.DeadlySphere, + NPCID.BigMimicCorruption, + NPCID.BigMimicCrimson, + NPCID.BigMimicHallow, + NPCID.Mothron, + NPCID.DuneSplicerHead, + NPCID.SlimeSpiked, + NPCID.SandShark, + NPCID.SandsharkCorrupt, + NPCID.SandsharkCrimson, + NPCID.SandsharkHallow, + NPCID.DD2Betsy, + calamity.NPCType("Astrageldon"), + calamity.NPCType("AstrumDeusHead"), + calamity.NPCType("AstrumDeusHeadSpectral"), + calamity.NPCType("Bumblefuck"), + calamity.NPCType("CalamitasRun3"), + calamity.NPCType("CosmicWraith"), + calamity.NPCType("CrabulonIdle"), + calamity.NPCType("Cryogen"), + calamity.NPCType("DesertScourgeHead"), + calamity.NPCType("GreatSandShark"), + calamity.NPCType("HiveMindP2"), + calamity.NPCType("DankCreeper"), + calamity.NPCType("AquaticAberration"), + calamity.NPCType("Leviathan"), + calamity.NPCType("Siren"), + calamity.NPCType("PerforatorHeadLarge"), + calamity.NPCType("PerforatorHeadMedium"), + calamity.NPCType("PerforatorHeadSmall"), + calamity.NPCType("PlaguebringerGoliath"), + calamity.NPCType("PlagueHomingMissile"), + calamity.NPCType("PlagueMine"), + calamity.NPCType("Polterghast"), + calamity.NPCType("PolterghastHook"), + calamity.NPCType("PolterPhantom"), + calamity.NPCType("ProfanedGuardianBoss"), + calamity.NPCType("RockPillar"), + calamity.NPCType("ScavengerBody"), + calamity.NPCType("ScavengerClawRight"), + calamity.NPCType("ScavengerClawLeft"), + calamity.NPCType("ProfanedGuardianBoss2"), + calamity.NPCType("ProvSpawnDefense"), + calamity.NPCType("ProvSpawnOffense"), + calamity.NPCType("SlimeGod"), + calamity.NPCType("SlimeGodRun"), + calamity.NPCType("SlimeGodCore"), + calamity.NPCType("SlimeGodSplit"), + calamity.NPCType("SlimeGodRunSplit"), + calamity.NPCType("StormWeaverHead"), + calamity.NPCType("StormWeaverHeadNaked"), + calamity.NPCType("SupremeCalamitas"), + calamity.NPCType("DevourerofGodsHead"), + calamity.NPCType("DevourerofGodsHead2"), + calamity.NPCType("DevourerofGodsHeadS"), + calamity.NPCType("Yharon"), + calamity.NPCType("AquaticScourgeHead"), + calamity.NPCType("BobbitWormHead"), + calamity.NPCType("AquaticSeekerHead"), + calamity.NPCType("ColossalSquid"), + calamity.NPCType("EidolonWyrmHead"), + calamity.NPCType("EidolonWyrmHeadHuge"), + calamity.NPCType("GulperEelHead"), + calamity.NPCType("Mauler"), + calamity.NPCType("Reaper"), + calamity.NPCType("Atlas"), + calamity.NPCType("ArmoredDiggerHead"), + calamity.NPCType("Cnidrion"), + calamity.NPCType("Horse"), + calamity.NPCType("ScornEater"), + calamity.NPCType("OldDuke"), + calamity.NPCType("DukeUrchin"), + calamity.NPCType("PrismTurtle"), + calamity.NPCType("GhostBell"), + calamity.NPCType("EutrophicRay"), + calamity.NPCType("Clam"), + calamity.NPCType("SeaSerpent1"), + calamity.NPCType("BlindedAngler"), + calamity.NPCType("GiantClam") + }; + + revengeanceProjectileBuffList = new List() + { + ProjectileID.SandBallFalling, + ProjectileID.AshBallFalling, + ProjectileID.DemonSickle, + ProjectileID.EbonsandBallFalling, + ProjectileID.PearlSandBallFalling, + ProjectileID.CursedFlameHostile, + ProjectileID.EyeFire, + ProjectileID.Boulder, + ProjectileID.DeathLaser, + ProjectileID.PoisonDartTrap, + ProjectileID.SpikyBallTrap, + ProjectileID.SpearTrap, + ProjectileID.FlamethrowerTrap, + ProjectileID.FlamesTrap, + ProjectileID.CrimsandBallFalling, + ProjectileID.Fireball, + ProjectileID.EyeBeam, + ProjectileID.PoisonSeedPlantera, + ProjectileID.ThornBall, + ProjectileID.PaladinsHammerHostile, + ProjectileID.RocketSkeleton, + ProjectileID.FlamingWood, + ProjectileID.FlamingScythe, + ProjectileID.FrostWave, + ProjectileID.Present, + ProjectileID.Spike, + ProjectileID.SaucerDeathray, + ProjectileID.PhantasmalEye, + ProjectileID.PhantasmalSphere, + ProjectileID.PhantasmalDeathray, + ProjectileID.CultistBossIceMist, + ProjectileID.CultistBossLightningOrbArc, + ProjectileID.CultistBossFireBall, + ProjectileID.NebulaBolt, + ProjectileID.NebulaSphere, + ProjectileID.NebulaLaser, + ProjectileID.StardustSoldierLaser, + ProjectileID.VortexLaser, + ProjectileID.VortexVortexLightning, + ProjectileID.VortexLightning, + ProjectileID.VortexAcid, + ProjectileID.GeyserTrap, + ProjectileID.SandnadoHostile, + ProjectileID.DD2BetsyFireball, + ProjectileID.DD2BetsyFlameBreath, + calamity.ProjectileType("AbyssMine"), + calamity.ProjectileType("AbyssMine2"), + calamity.ProjectileType("AstralFlame"), + calamity.ProjectileType("BloodGeyser"), + calamity.ProjectileType("BrimstoneBarrage"), + calamity.ProjectileType("BrimstoneFireblast"), + calamity.ProjectileType("BrimstoneGigaBlast"), + calamity.ProjectileType("BrimstoneHellblast"), + calamity.ProjectileType("BrimstoneHellblast2"), + calamity.ProjectileType("BrimstoneHellfireball"), + calamity.ProjectileType("BrimstoneLaser"), + calamity.ProjectileType("BrimstoneLaserSplit"), + calamity.ProjectileType("BrimstoneMonster"), + calamity.ProjectileType("BrimstoneWave"), + calamity.ProjectileType("DarkEnergyBall"), + calamity.ProjectileType("DeusMine"), + calamity.ProjectileType("DoGDeath"), + calamity.ProjectileType("DoGFire"), + calamity.ProjectileType("CosmicFlameBurst"), + calamity.ProjectileType("FlareBomb"), + calamity.ProjectileType("Flarenado"), + calamity.ProjectileType("HiveBombGoliath"), + calamity.ProjectileType("HolyBlast"), + calamity.ProjectileType("HolyBomb"), + calamity.ProjectileType("HolyShot"), + calamity.ProjectileType("HolySpear"), + calamity.ProjectileType("IceBomb"), + calamity.ProjectileType("IchorShot"), + calamity.ProjectileType("Infernado"), + calamity.ProjectileType("LeviathanBomb"), + calamity.ProjectileType("MoltenBlast"), + calamity.ProjectileType("Mushmash"), + calamity.ProjectileType("PhantomMine"), + calamity.ProjectileType("PhantomBlast"), + calamity.ProjectileType("PhantomBlast2"), + calamity.ProjectileType("ProfanedSpear"), + calamity.ProjectileType("ProvidenceCrystalShard"), + calamity.ProjectileType("ProvidenceHolyRay"), + calamity.ProjectileType("RedLightningFeather"), + calamity.ProjectileType("SandPoisonCloud"), + calamity.ProjectileType("ScavengerNuke"), + calamity.ProjectileType("SirenSong"), + calamity.ProjectileType("YharonFireball"), + calamity.ProjectileType("YharonFireball2"), + calamity.ProjectileType("YharonFireballHoming"), + calamity.ProjectileType("PearlBurst"), + calamity.ProjectileType("PearlRain") + }; + + trapProjectileList = new List() + { + ProjectileID.PoisonDartTrap, + ProjectileID.SpikyBallTrap, + ProjectileID.SpearTrap, + ProjectileID.FlamethrowerTrap, + ProjectileID.FlamesTrap, + ProjectileID.PoisonDart, + ProjectileID.GeyserTrap + }; + + scopedWeaponList = new List() + { + calamity.ItemType("AMR"), + calamity.ItemType("Shroomer"), + calamity.ItemType("SpectreRifle"), + calamity.ItemType("Svantechnical") + }; + } + } + #endregion + + #region Music + public override void UpdateMusic(ref int music, ref MusicPriority priority) + { + Mod calamityModMusic = ModLoader.GetMod("CalamityModMusic"); + if (Main.musicVolume != 0) + { + if (Main.myPlayer != -1 && !Main.gameMenu && Main.LocalPlayer.active) + { + if (NPC.AnyNPCs(NPCID.CultistBoss)) + { + if (calamityModMusic != null) + music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/Doomsayer"); + else + music = MusicID.Boss4; + priority = MusicPriority.BossMedium; + } + if (Main.LocalPlayer.GetModPlayer(this).ZoneCalamity) + { + if (!CalamityPlayer.areThereAnyDamnBosses) + { + if (calamityModMusic != null) + music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/Crag"); + else + music = MusicID.Eerie; + priority = MusicPriority.Environment; + } + } + if (Main.LocalPlayer.GetModPlayer(this).ZoneSunkenSea) + { + if (!CalamityPlayer.areThereAnyDamnBosses) + { + if (calamityModMusic != null) + music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/SunkenSea"); + else + music = MusicID.Temple; + priority = MusicPriority.Environment; + } + } + if (Main.LocalPlayer.GetModPlayer(this).ZoneAstral) + { + if (!CalamityPlayer.areThereAnyDamnBosses) + { + if (calamityModMusic != null) + music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/Astral"); + else + music = MusicID.Space; + priority = MusicPriority.Environment; + } + } + if (Main.LocalPlayer.GetModPlayer(this).ZoneAbyssLayer1 || Main.LocalPlayer.GetModPlayer(this).ZoneAbyssLayer2) + { + if (!CalamityPlayer.areThereAnyDamnBosses) + { + if (calamityModMusic != null) + music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/TheAbyss"); + else + music = MusicID.Hell; + priority = MusicPriority.BiomeHigh; + } + } + if (Main.LocalPlayer.GetModPlayer(this).ZoneAbyssLayer3) + { + if (!CalamityPlayer.areThereAnyDamnBosses) + { + if (calamityModMusic != null) + music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/TheDeepAbyss"); + else + music = MusicID.Hell; + priority = MusicPriority.BiomeHigh; + } + } + if (Main.LocalPlayer.GetModPlayer(this).ZoneAbyssLayer4) + { + if (!CalamityPlayer.areThereAnyDamnBosses) + { + if (calamityModMusic != null) + music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/TheVoid"); + else + music = MusicID.Hell; + priority = MusicPriority.BiomeHigh; + } + } + if (Main.LocalPlayer.GetModPlayer(this).ZoneSulphur) + { + if (!CalamityPlayer.areThereAnyDamnBosses) + { + if (calamityModMusic != null) + music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/Sulphur"); + else + music = MusicID.Desert; + priority = MusicPriority.BiomeHigh; + } + } + if (CalamityWorld.DoGSecondStageCountdown <= 540 && CalamityWorld.DoGSecondStageCountdown > 60) //8 seconds before DoG spawns + { + if (!CalamityPlayer.areThereAnyDamnBosses) + { + if (calamityModMusic != null) + music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/UniversalCollapse"); + else + music = MusicID.LunarBoss; + priority = MusicPriority.BossMedium; + } + } + } + } + } + #endregion + + #region ModSupport + public override void PostSetupContent() + { + WeakReferenceSupport.Setup(); + } + + public override object Call(params object[] args) + { + return ModSupport.Call(args); + } + #endregion + + #region DrawingStuff + public override void ModifyInterfaceLayers(List layers) + { + Mod mod = ModLoader.GetMod("CalamityMod"); + if (CalamityWorld.revenge) + { + UIHandler.ModifyInterfaceLayers(mod, layers); + } + int index = layers.FindIndex(layer => layer.Name == "Vanilla: Mouse Text"); + if (index != -1) + { + layers.Insert(index, new LegacyGameInterfaceLayer("Boss HP Bars", delegate () + { + if (Main.LocalPlayer.GetModPlayer(mod).drawBossHPBar) + { + BossHealthBarManager.Update(); + BossHealthBarManager.Draw(Main.spriteBatch); + } + return true; + }, InterfaceScaleType.None)); + } + base.ModifyInterfaceLayers(layers); + layers.Insert(index, new LegacyGameInterfaceLayer("Astral Arcanum UI", delegate () + { + AstralArcanumUI.UpdateAndDraw(Main.spriteBatch); + return true; + }, InterfaceScaleType.None)); + } + + public static Color GetNPCColor(NPC npc, Vector2? position = null, bool effects = true, float shadowOverride = 0f) + { + return npc.GetAlpha(BuffEffects(npc, GetLightColor(position != null ? (Vector2)position : npc.Center), (shadowOverride != 0f ? shadowOverride : 0f), effects, npc.poisoned, npc.onFire, npc.onFire2, Main.player[Main.myPlayer].detectCreature, false, false, false, npc.venom, npc.midas, npc.ichor, npc.onFrostBurn, false, false, npc.dripping, npc.drippingSlime, npc.loveStruck, npc.stinky)); + } + + public static Color GetLightColor(Vector2 position) + { + return Lighting.GetColor((int)(position.X / 16f), (int)(position.Y / 16f)); + } + + public static Color BuffEffects(Entity codable, Color lightColor, float shadow = 0f, bool effects = true, bool poisoned = false, bool onFire = false, bool onFire2 = false, bool hunter = false, bool noItems = false, bool blind = false, bool bleed = false, bool venom = false, bool midas = false, bool ichor = false, bool onFrostBurn = false, bool burned = false, bool honey = false, bool dripping = false, bool drippingSlime = false, bool loveStruck = false, bool stinky = false) + { + float cr = 1f; float cg = 1f; float cb = 1f; float ca = 1f; if (effects && honey && Main.rand.Next(30) == 0) { int dustID = Dust.NewDust(codable.position, codable.width, codable.height, 152, 0f, 0f, 150, default(Color), 1f); @@ -1938,26 +1338,26 @@ namespace CalamityMod Main.dust[dustID].alpha = 100; Main.dust[dustID].noGravity = true; Main.dust[dustID].velocity += codable.velocity * 0.1f; - if (codable is Player) + if (codable is Player) { Main.playerDrawDust.Add(dustID); } } - if (poisoned) - { + if (poisoned) + { if (effects && Main.rand.Next(30) == 0) { int dustID = Dust.NewDust(codable.position, codable.width, codable.height, 46, 0f, 0f, 120, default(Color), 0.2f); Main.dust[dustID].noGravity = true; Main.dust[dustID].fadeIn = 1.9f; - if (codable is Player) + if (codable is Player) { Main.playerDrawDust.Add(dustID); } } - cr *= 0.65f; - cb *= 0.75f; - } + cr *= 0.65f; + cb *= 0.75f; + } if (venom) { if (effects && Main.rand.Next(10) == 0) @@ -1965,7 +1365,7 @@ namespace CalamityMod int dustID = Dust.NewDust(codable.position, codable.width, codable.height, 171, 0f, 0f, 100, default(Color), 0.5f); Main.dust[dustID].noGravity = true; Main.dust[dustID].fadeIn = 1.5f; - if (codable is Player) + if (codable is Player) { Main.playerDrawDust.Add(dustID); } @@ -1980,13 +1380,13 @@ namespace CalamityMod } if (ichor) { - if (codable is NPC) - { - lightColor = new Color(255, 255, 0, 255); - } + if (codable is NPC) + { + lightColor = new Color(255, 255, 0, 255); + } else - { - cb = 0f; + { + cb = 0f; } } if (burned) @@ -1997,7 +1397,7 @@ namespace CalamityMod Main.dust[dustID].noGravity = true; Main.dust[dustID].velocity *= 1.8f; Main.dust[dustID].velocity.Y -= 0.75f; - if (codable is Player) + if (codable is Player) { Main.playerDrawDust.Add(dustID); } @@ -2037,8 +1437,8 @@ namespace CalamityMod cg *= 0.7f; } } - if (onFire) - { + if (onFire) + { if (effects) { if (Main.rand.Next(4) != 0) @@ -2064,7 +1464,7 @@ namespace CalamityMod cb *= 0.6f; cg *= 0.7f; } - } + } if (dripping && shadow == 0f && Main.rand.Next(4) != 0) { Vector2 position = codable.position; @@ -2072,11 +1472,11 @@ namespace CalamityMod if (Main.rand.Next(2) == 0) { int dustID = Dust.NewDust(position, codable.width + 4, codable.height + 2, 211, 0f, 0f, 50, default(Color), 0.8f); - if (Main.rand.Next(2) == 0) + if (Main.rand.Next(2) == 0) { Main.dust[dustID].alpha += 25; } - if (Main.rand.Next(2) == 0) + if (Main.rand.Next(2) == 0) { Main.dust[dustID].alpha += 25; } @@ -2084,7 +1484,7 @@ namespace CalamityMod Main.dust[dustID].velocity *= 0.2f; Main.dust[dustID].velocity.Y += 0.2f; Main.dust[dustID].velocity += codable.velocity; - if(codable is Player) + if (codable is Player) { Main.playerDrawDust.Add(dustID); } @@ -2092,11 +1492,11 @@ namespace CalamityMod else { int dustID = Dust.NewDust(position, codable.width + 8, codable.height + 8, 211, 0f, 0f, 50, default(Color), 1.1f); - if (Main.rand.Next(2) == 0) + if (Main.rand.Next(2) == 0) { Main.dust[dustID].alpha += 25; } - if (Main.rand.Next(2) == 0) + if (Main.rand.Next(2) == 0) { Main.dust[dustID].alpha += 25; } @@ -2105,7 +1505,7 @@ namespace CalamityMod Main.dust[dustID].velocity *= 0.2f; Main.dust[dustID].velocity.Y += 1f; Main.dust[dustID].velocity += codable.velocity; - if(codable is Player) + if (codable is Player) { Main.playerDrawDust.Add(dustID); } @@ -2122,11 +1522,11 @@ namespace CalamityMod Vector2 position2 = codable.position; position2.X -= 2f; position2.Y -= 2f; int dustID = Dust.NewDust(position2, codable.width + 4, codable.height + 2, 4, 0f, 0f, alpha, newColor, 1.4f); - if (Main.rand.Next(2) == 0) + if (Main.rand.Next(2) == 0) { Main.dust[dustID].alpha += 25; } - if (Main.rand.Next(2) == 0) + if (Main.rand.Next(2) == 0) { Main.dust[dustID].alpha += 25; } @@ -2134,7 +1534,7 @@ namespace CalamityMod Main.dust[dustID].velocity *= 0.2f; Main.dust[dustID].velocity.Y += 0.2f; Main.dust[dustID].velocity += codable.velocity; - if(codable is Player) + if (codable is Player) { Main.playerDrawDust.Add(dustID); } @@ -2143,8 +1543,8 @@ namespace CalamityMod cr *= 0.8f; cg *= 0.8f; } - if (onFire2) - { + if (onFire2) + { if (effects) { if (Main.rand.Next(4) != 0) @@ -2158,7 +1558,7 @@ namespace CalamityMod Main.dust[dustID].noGravity = false; Main.dust[dustID].scale *= 0.5f; } - if (codable is Player) + if (codable is Player) { Main.playerDrawDust.Add(dustID); } @@ -2170,33 +1570,33 @@ namespace CalamityMod cb *= 0.6f; cg *= 0.7f; } - } - if (noItems) - { - cr *= 0.65f; - cg *= 0.8f; - } - if (blind) - { - cr *= 0.7f; - cg *= 0.65f; - } - if (bleed) - { + } + if (noItems) + { + cr *= 0.65f; + cg *= 0.8f; + } + if (blind) + { + cr *= 0.7f; + cg *= 0.65f; + } + if (bleed) + { bool dead = (codable is Player ? ((Player)codable).dead : codable is NPC ? ((NPC)codable).life <= 0 : false); if (effects && !dead && Main.rand.Next(30) == 0) { int dustID = Dust.NewDust(codable.position, codable.width, codable.height, 5, 0f, 0f, 0, default(Color), 1f); Main.dust[dustID].velocity.Y += 0.5f; Main.dust[dustID].velocity *= 0.25f; - if (codable is Player) + if (codable is Player) { Main.playerDrawDust.Add(dustID); } } - cg *= 0.9f; - cb *= 0.9f; - } + cg *= 0.9f; + cb *= 0.9f; + } if (loveStruck && effects && shadow == 0f && Main.instance.IsActive && !Main.gamePaused && Main.rand.Next(5) == 0) { Vector2 value = new Vector2((float)Main.rand.Next(-10, 11), (float)Main.rand.Next(-10, 11)); @@ -2206,7 +1606,7 @@ namespace CalamityMod Main.gore[goreID].sticky = false; Main.gore[goreID].velocity *= 0.4f; Main.gore[goreID].velocity.Y -= 0.6f; - if (codable is Player) + if (codable is Player) { Main.playerDrawGore.Add(goreID); } @@ -2223,7 +1623,7 @@ namespace CalamityMod int dustID = Dust.NewDust(codable.position, codable.width, codable.height, 188, vector.X, vector.Y * 0.5f, 100, default(Color), 1.5f); Main.dust[dustID].velocity *= 0.1f; Main.dust[dustID].velocity.Y -= 0.5f; - if (codable is Player) + if (codable is Player) { Main.playerDrawDust.Add(dustID); } @@ -2232,64 +1632,64 @@ namespace CalamityMod lightColor.R = (byte)((float)lightColor.R * cr); lightColor.G = (byte)((float)lightColor.G * cg); lightColor.B = (byte)((float)lightColor.B * cb); - lightColor.A = (byte)((float)lightColor.A * ca); - if (codable is NPC) + lightColor.A = (byte)((float)lightColor.A * ca); + if (codable is NPC) { NPCLoader.DrawEffects((NPC)codable, ref lightColor); } - if (hunter && (codable is NPC ? ((NPC)codable).lifeMax > 1 : true)) - { + if (hunter && (codable is NPC ? ((NPC)codable).lifeMax > 1 : true)) + { if (effects && !Main.gamePaused && Main.instance.IsActive && Main.rand.Next(50) == 0) { int dustID = Dust.NewDust(codable.position, codable.width, codable.height, 15, 0f, 0f, 150, default(Color), 0.8f); Main.dust[dustID].velocity *= 0.1f; Main.dust[dustID].noLight = true; - if (codable is Player) + if (codable is Player) { Main.playerDrawDust.Add(dustID); } } byte colorR = 50, colorG = 255, colorB = 50; - if(codable is NPC && !(((NPC)codable).friendly || ((NPC)codable).catchItem > 0 || (((NPC)codable).damage == 0 && ((NPC)codable).lifeMax == 5))) + if (codable is NPC && !(((NPC)codable).friendly || ((NPC)codable).catchItem > 0 || (((NPC)codable).damage == 0 && ((NPC)codable).lifeMax == 5))) { colorR = 255; colorG = 50; } - if (!(codable is NPC) && lightColor.R < 150) - { - lightColor.A = Main.mouseTextColor; - } - if (lightColor.R < colorR) - { - lightColor.R = colorR; - } - if (lightColor.G < colorG) - { - lightColor.G = colorG; - } - if (lightColor.B < colorB) - { - lightColor.B = colorB; - } - } - return lightColor; - } - - public static void DrawTexture(object sb, Texture2D texture, int shader, Entity codable, Color? overrideColor = null, bool drawCentered = false) - { - Color lightColor = (overrideColor != null ? (Color)overrideColor : codable is NPC ? GetNPCColor(((NPC)codable), codable.Center, false) : codable is Projectile ? ((Projectile)codable).GetAlpha(GetLightColor(codable.Center)) : GetLightColor(codable.Center)); - int frameCount = (codable is NPC ? Main.npcFrameCount[((NPC)codable).type] : 1); - Rectangle frame = (codable is NPC ? ((NPC)codable).frame : new Rectangle(0, 0, texture.Width, texture.Height)); - float scale = (codable is NPC ? ((NPC)codable).scale : ((Projectile)codable).scale); - float rotation = (codable is NPC ? ((NPC)codable).rotation : ((Projectile)codable).rotation); - int spriteDirection = (codable is NPC ? ((NPC)codable).spriteDirection : ((Projectile)codable).spriteDirection); + if (!(codable is NPC) && lightColor.R < 150) + { + lightColor.A = Main.mouseTextColor; + } + if (lightColor.R < colorR) + { + lightColor.R = colorR; + } + if (lightColor.G < colorG) + { + lightColor.G = colorG; + } + if (lightColor.B < colorB) + { + lightColor.B = colorB; + } + } + return lightColor; + } + + public static void DrawTexture(object sb, Texture2D texture, int shader, Entity codable, Color? overrideColor = null, bool drawCentered = false) + { + Color lightColor = (overrideColor != null ? (Color)overrideColor : codable is NPC ? GetNPCColor(((NPC)codable), codable.Center, false) : codable is Projectile ? ((Projectile)codable).GetAlpha(GetLightColor(codable.Center)) : GetLightColor(codable.Center)); + int frameCount = (codable is NPC ? Main.npcFrameCount[((NPC)codable).type] : 1); + Rectangle frame = (codable is NPC ? ((NPC)codable).frame : new Rectangle(0, 0, texture.Width, texture.Height)); + float scale = (codable is NPC ? ((NPC)codable).scale : ((Projectile)codable).scale); + float rotation = (codable is NPC ? ((NPC)codable).rotation : ((Projectile)codable).rotation); + int spriteDirection = (codable is NPC ? ((NPC)codable).spriteDirection : ((Projectile)codable).spriteDirection); float offsetY = (codable is NPC ? ((NPC)codable).gfxOffY : 0f); - DrawTexture(sb, texture, shader, codable.position + new Vector2(0f, offsetY), codable.width, codable.height, scale, rotation, spriteDirection, frameCount, frame, lightColor, drawCentered); - } - - public static void DrawTexture(object sb, Texture2D texture, int shader, Vector2 position, int width, int height, float scale, float rotation, int direction, int framecount, Rectangle frame, Color? overrideColor = null, bool drawCentered = false) - { - Vector2 origin = new Vector2((float)(texture.Width / 2), (float)(texture.Height / framecount / 2)); - Color lightColor = overrideColor != null ? (Color)overrideColor : GetLightColor(position + new Vector2(width * 0.5f, height * 0.5f)); + DrawTexture(sb, texture, shader, codable.position + new Vector2(0f, offsetY), codable.width, codable.height, scale, rotation, spriteDirection, frameCount, frame, lightColor, drawCentered); + } + + public static void DrawTexture(object sb, Texture2D texture, int shader, Vector2 position, int width, int height, float scale, float rotation, int direction, int framecount, Rectangle frame, Color? overrideColor = null, bool drawCentered = false) + { + Vector2 origin = new Vector2((float)(texture.Width / 2), (float)(texture.Height / framecount / 2)); + Color lightColor = overrideColor != null ? (Color)overrideColor : GetLightColor(position + new Vector2(width * 0.5f, height * 0.5f)); if (sb is List) { DrawData dd = new DrawData(texture, GetDrawPosition(position, origin, width, height, texture.Width, texture.Height, framecount, scale, drawCentered), frame, lightColor, rotation, origin, scale, direction == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0); @@ -2303,984 +1703,197 @@ namespace CalamityMod { ((SpriteBatch)sb).End(); ((SpriteBatch)sb).Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend); - GameShaders.Armor.ApplySecondary(shader, Main.player[Main.myPlayer], null); + GameShaders.Armor.ApplySecondary(shader, Main.player[Main.myPlayer], null); } - ((SpriteBatch)sb).Draw(texture, GetDrawPosition(position, origin, width, height, texture.Width, texture.Height, framecount, scale, drawCentered), frame, lightColor, rotation, origin, scale, direction == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0); + ((SpriteBatch)sb).Draw(texture, GetDrawPosition(position, origin, width, height, texture.Width, texture.Height, framecount, scale, drawCentered), frame, lightColor, rotation, origin, scale, direction == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0); if (applyDye) { ((SpriteBatch)sb).End(); ((SpriteBatch)sb).Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend); } } - } - - public static Vector2 GetDrawPosition(Vector2 position, Vector2 origin, int width, int height, int texWidth, int texHeight, int framecount, float scale, bool drawCentered = false) - { + } + + public static Vector2 GetDrawPosition(Vector2 position, Vector2 origin, int width, int height, int texWidth, int texHeight, int framecount, float scale, bool drawCentered = false) + { Vector2 screenPos = new Vector2((int)Main.screenPosition.X, (int)Main.screenPosition.Y); if (drawCentered) { Vector2 texHalf = new Vector2(texWidth / 2, texHeight / framecount / 2); - return (position + new Vector2(width * 0.5f, height * 0.5f)) - (texHalf * scale) + (origin * scale) - screenPos; + return (position + new Vector2(width * 0.5f, height * 0.5f)) - (texHalf * scale) + (origin * scale) - screenPos; } return position - screenPos + new Vector2(width * 0.5f, height) - new Vector2(texWidth * scale / 2f, texHeight * scale / (float)framecount) + (origin * scale) + new Vector2(0f, 5f); - } - #endregion - - #region RecipeGroups - public override void AddRecipeGroups() - { - RecipeGroup group = new RecipeGroup(() => Lang.misc[37] + (" Silt"), new int[] - { - 424, - 1103 - }); - RecipeGroup.RegisterGroup("SiltGroup", group); - - group = new RecipeGroup(() => Lang.misc[37] + (" Lunar Pickaxe"), new int[] - { - 2776, - 2781, - 2786, - 3466 - }); - RecipeGroup.RegisterGroup("LunarPickaxe", group); - - group = new RecipeGroup(() => Lang.misc[37] + (" Lunar Axe"), new int[] - { - 3522, - 3523, - 3524, - 3525 - }); - RecipeGroup.RegisterGroup("LunarAxe", group); - - group = new RecipeGroup(() => Lang.misc[37] + (" Wings"), new int[] - { - 492, - 493, - 665, - 749, - 761, - 785, - 786, - 821, - 822, - 823, - 948, - 1162, - 1165, - 1515, - 1583, - 1584, - 1585, - 1586, - 1797, - 1830, - 1866, - 1871, - 2280, - 2494, - 2609, - 2770, - 3468, - 3469, - 3470, - 3471, - 3580, - 3582, - 3588, - 3592, - 3883, - 3924, - 3928, - ItemType("SkylineWings"), - ItemType("StarlightWings"), - ItemType("AureateWings"), - ItemType("DiscordianWings"), - ItemType("TarragonWings"), - ItemType("XerocWings") - }); - RecipeGroup.RegisterGroup("WingsGroup", group); } - #endregion + #endregion - #region Recipes - public override void AddRecipes() + #region Recipes + public override void AddRecipeGroups() { - ModRecipe recipe = new ModRecipe(this); - recipe.AddIngredient(ItemID.SunplateBlock, 10); - recipe.AddIngredient(ItemID.Cloud, 5); - recipe.AddIngredient(ItemID.RainCloud, 3); - recipe.AddTile(TileID.Anvils); - recipe.SetResult(ItemID.SkyMill); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(ItemID.IceBlock, 20); - recipe.AddIngredient(ItemID.Leather, 5); - recipe.AddIngredient(ItemID.IronBar, 5); - recipe.anyIronBar = true; - recipe.AddTile(TileID.IceMachine); - recipe.SetResult(ItemID.IceSkates); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(ItemID.IceBlock, 20); - recipe.AddIngredient(ItemID.Glass, 10); - recipe.AddIngredient(ItemID.FallenStar, 10); - recipe.AddIngredient(ItemID.IronBar, 5); - recipe.anyIronBar = true; - recipe.AddTile(TileID.Anvils); - recipe.SetResult(ItemID.IceMirror); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(ItemID.IronBar, 10); - recipe.AddIngredient(ItemID.Glass, 10); - recipe.AddIngredient(ItemID.FallenStar, 10); - recipe.anyIronBar = true; - recipe.AddTile(TileID.Anvils); - recipe.SetResult(ItemID.MagicMirror); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(ItemID.Lens); - recipe.AddIngredient(ItemID.BlackDye); - recipe.AddTile(TileID.DyeVat); - recipe.SetResult(ItemID.BlackLens); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(ItemID.Vertebrae, 5); - recipe.AddTile(TileID.WorkBenches); - recipe.SetResult(ItemID.Leather); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(ItemID.IceBlock, 25); - recipe.AddIngredient(ItemID.SnowBlock, 15); - recipe.AddIngredient(ItemID.IronBar, 3); - recipe.anyIronBar = true; - recipe.AddTile(TileID.Anvils); - recipe.SetResult(ItemID.IceMachine); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(ItemID.GoldBroadsword); - recipe.AddIngredient(ItemID.FallenStar, 10); - recipe.AddIngredient(null, "VictoryShard", 3); - recipe.AddTile(TileID.Anvils); - recipe.SetResult(ItemID.Starfury); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(ItemID.PlatinumBroadsword); - recipe.AddIngredient(ItemID.FallenStar, 10); - recipe.AddIngredient(null, "VictoryShard", 3); - recipe.AddTile(TileID.Anvils); - recipe.SetResult(ItemID.Starfury); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(ItemID.Feather, 2); - recipe.AddIngredient(ItemID.Bottle); - recipe.AddIngredient(ItemID.Cloud, 25); - recipe.AddTile(TileID.Anvils); - recipe.SetResult(ItemID.CloudinaBottle); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(ItemID.Feather, 4); - recipe.AddIngredient(ItemID.Bottle); - recipe.AddIngredient(ItemID.SnowBlock, 50); - recipe.AddTile(TileID.Anvils); - recipe.SetResult(ItemID.BlizzardinaBottle); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(null, "DesertFeather", 10); - recipe.AddIngredient(ItemID.Feather, 6); - recipe.AddIngredient(ItemID.Bottle); - recipe.AddIngredient(ItemID.SandBlock, 70); - recipe.AddTile(TileID.Anvils); - recipe.SetResult(ItemID.SandstorminaBottle); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(ItemID.WhiteString); - recipe.AddIngredient(ItemID.Gel, 80); - recipe.AddIngredient(ItemID.Cloud, 40); - recipe.AddTile(TileID.Solidifier); - recipe.SetResult(ItemID.ShinyRedBalloon); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(ItemID.Leather, 5); - recipe.AddIngredient(ItemID.WaterWalkingPotion, 8); - recipe.AddTile(TileID.Anvils); - recipe.SetResult(ItemID.WaterWalkingBoots); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(ItemID.LavaBucket, 5); - recipe.AddIngredient(ItemID.Obsidian, 25); - recipe.AddIngredient(ItemID.IronBar, 5); - recipe.anyIronBar = true; - recipe.AddTile(TileID.Anvils); - recipe.SetResult(ItemID.LavaCharm); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(ItemID.GoldenKey); - recipe.AddIngredient(ItemID.Obsidian, 20); - recipe.AddIngredient(ItemID.Bone, 5); - recipe.AddTile(TileID.Anvils); - recipe.SetResult(ItemID.ShadowKey); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(null, "CryoBar", 6); - recipe.AddIngredient(ItemID.FrostCore); - recipe.AddTile(TileID.IceMachine); - recipe.SetResult(ItemID.FrostHelmet); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(null, "CryoBar", 10); - recipe.AddIngredient(ItemID.FrostCore); - recipe.AddTile(TileID.IceMachine); - recipe.SetResult(ItemID.FrostBreastplate); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(null, "CryoBar", 8); - recipe.AddIngredient(ItemID.FrostCore); - recipe.AddTile(TileID.IceMachine); - recipe.SetResult(ItemID.FrostLeggings); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(ItemID.CobaltBar, 10); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(ItemID.CobaltShield); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(ItemID.PalladiumBar, 10); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(ItemID.CobaltShield); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(ItemID.CobaltBar, 15); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(ItemID.Muramasa); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(ItemID.PalladiumBar, 15); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(ItemID.Muramasa); - recipe.AddRecipe(); - - Mod calamity = ModLoader.GetMod("CalamityMod"); - - //Change Terra Blade's recipe to require 7 living shards - List rec = Main.recipe.ToList(); - rec.Where(x => x.createItem.type == ItemID.TerraBlade).ToList().ForEach(s => - { - for (int i = 0; i < s.requiredItem.Length; i++) - { - s.requiredItem[i] = new Item(); - } - s.requiredItem[0].SetDefaults(ItemID.TrueNightsEdge, false); - s.requiredItem[0].stack = 1; - s.requiredItem[1].SetDefaults(ItemID.TrueExcalibur, false); - s.requiredItem[1].stack = 1; - s.requiredItem[2].SetDefaults(calamity.ItemType("LivingShard"), false); - s.requiredItem[2].stack = 7; - - s.createItem.SetDefaults(ItemID.TerraBlade, false); - s.createItem.stack = 1; - }); - - recipe = new ModRecipe(this); - recipe.AddIngredient(null, "TrueBloodyEdge"); - recipe.AddIngredient(ItemID.TrueExcalibur); - recipe.AddIngredient(null, "LivingShard", 7); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(ItemID.TerraBlade); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(null, "Ectoblood", 3); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(ItemID.Ectoplasm); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(ItemID.EmptyBullet); - recipe.AddIngredient(ItemID.ExplosivePowder, 3); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(ItemID.RocketI, 5); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(null, "VictoryShard", 10); - recipe.AddIngredient(ItemID.SoulofLight, 15); - recipe.AddIngredient(ItemID.UnicornHorn, 3); - recipe.AddIngredient(ItemID.LightShard); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(ItemID.EnchantedSword); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(null, "BloodOrb", 10); - recipe.AddIngredient(ItemID.BottledWater); - recipe.AddTile(TileID.AlchemyTable); - recipe.SetResult(ItemID.WormholePotion); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(null, "BloodOrb", 10); - recipe.AddIngredient(ItemID.BottledWater); - recipe.AddTile(TileID.AlchemyTable); - recipe.SetResult(ItemID.WarmthPotion); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(null, "BloodOrb", 10); - recipe.AddIngredient(ItemID.BottledWater); - recipe.AddTile(TileID.AlchemyTable); - recipe.SetResult(ItemID.CratePotion); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(null, "BloodOrb", 10); - recipe.AddIngredient(ItemID.BottledWater); - recipe.AddTile(TileID.AlchemyTable); - recipe.SetResult(ItemID.SonarPotion); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(null, "BloodOrb", 10); - recipe.AddIngredient(ItemID.BottledWater); - recipe.AddTile(TileID.AlchemyTable); - recipe.SetResult(ItemID.FishingPotion); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(null, "BloodOrb", 10); - recipe.AddIngredient(ItemID.BottledWater); - recipe.AddTile(TileID.AlchemyTable); - recipe.SetResult(ItemID.TeleportationPotion); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(null, "BloodOrb", 10); - recipe.AddIngredient(ItemID.BottledWater); - recipe.AddTile(TileID.AlchemyTable); - recipe.SetResult(ItemID.StinkPotion); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(null, "BloodOrb", 10); - recipe.AddIngredient(ItemID.BottledWater); - recipe.AddTile(TileID.AlchemyTable); - recipe.SetResult(ItemID.LovePotion); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(null, "BloodOrb", 10); - recipe.AddIngredient(ItemID.BottledWater); - recipe.AddTile(TileID.AlchemyTable); - recipe.SetResult(ItemID.WrathPotion); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(null, "BloodOrb", 10); - recipe.AddIngredient(ItemID.BottledWater); - recipe.AddTile(TileID.AlchemyTable); - recipe.SetResult(ItemID.InfernoPotion); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(null, "BloodOrb", 10); - recipe.AddIngredient(ItemID.BottledWater); - recipe.AddTile(TileID.AlchemyTable); - recipe.SetResult(ItemID.RagePotion); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(null, "BloodOrb", 10); - recipe.AddIngredient(ItemID.BottledWater); - recipe.AddTile(TileID.AlchemyTable); - recipe.SetResult(ItemID.EndurancePotion); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(null, "BloodOrb", 10); - recipe.AddIngredient(ItemID.BottledWater); - recipe.AddTile(TileID.AlchemyTable); - recipe.SetResult(ItemID.LifeforcePotion); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(null, "BloodOrb", 10); - recipe.AddIngredient(ItemID.BottledWater); - recipe.AddTile(TileID.AlchemyTable); - recipe.SetResult(ItemID.AmmoReservationPotion); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(null, "BloodOrb", 10); - recipe.AddIngredient(ItemID.BottledWater); - recipe.AddTile(TileID.AlchemyTable); - recipe.SetResult(ItemID.TrapsightPotion); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(null, "BloodOrb", 10); - recipe.AddIngredient(ItemID.BottledWater); - recipe.AddTile(TileID.AlchemyTable); - recipe.SetResult(ItemID.SummoningPotion); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(null, "BloodOrb", 10); - recipe.AddIngredient(ItemID.BottledWater); - recipe.AddTile(TileID.AlchemyTable); - recipe.SetResult(ItemID.FlipperPotion); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(null, "BloodOrb", 10); - recipe.AddIngredient(ItemID.BottledWater); - recipe.AddTile(TileID.AlchemyTable); - recipe.SetResult(ItemID.TitanPotion); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(null, "BloodOrb", 10); - recipe.AddIngredient(ItemID.BottledWater); - recipe.AddTile(TileID.AlchemyTable); - recipe.SetResult(ItemID.BuilderPotion); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(null, "BloodOrb", 10); - recipe.AddIngredient(ItemID.BottledWater); - recipe.AddTile(TileID.AlchemyTable); - recipe.SetResult(ItemID.CalmingPotion); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(null, "BloodOrb", 10); - recipe.AddIngredient(ItemID.BottledWater); - recipe.AddTile(TileID.AlchemyTable); - recipe.SetResult(ItemID.HeartreachPotion); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(null, "BloodOrb", 10); - recipe.AddIngredient(ItemID.BottledWater); - recipe.AddTile(TileID.AlchemyTable); - recipe.SetResult(ItemID.MiningPotion); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(null, "BloodOrb", 10); - recipe.AddIngredient(ItemID.BottledWater); - recipe.AddTile(TileID.AlchemyTable); - recipe.SetResult(ItemID.GenderChangePotion); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(null, "BloodOrb", 10); - recipe.AddIngredient(ItemID.BottledWater); - recipe.AddTile(TileID.AlchemyTable); - recipe.SetResult(ItemID.GravitationPotion); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(null, "BloodOrb", 10); - recipe.AddIngredient(ItemID.BottledWater); - recipe.AddTile(TileID.AlchemyTable); - recipe.SetResult(ItemID.HunterPotion); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(null, "BloodOrb", 10); - recipe.AddIngredient(ItemID.BottledWater); - recipe.AddTile(TileID.AlchemyTable); - recipe.SetResult(ItemID.ArcheryPotion); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(null, "BloodOrb", 10); - recipe.AddIngredient(ItemID.BottledWater); - recipe.AddTile(TileID.AlchemyTable); - recipe.SetResult(ItemID.WaterWalkingPotion); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(null, "BloodOrb", 10); - recipe.AddIngredient(ItemID.BottledWater); - recipe.AddTile(TileID.AlchemyTable); - recipe.SetResult(ItemID.ThornsPotion); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(null, "BloodOrb", 10); - recipe.AddIngredient(ItemID.BottledWater); - recipe.AddTile(TileID.AlchemyTable); - recipe.SetResult(ItemID.BattlePotion); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(null, "BloodOrb", 10); - recipe.AddIngredient(ItemID.BottledWater); - recipe.AddTile(TileID.AlchemyTable); - recipe.SetResult(ItemID.NightOwlPotion); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(null, "BloodOrb", 10); - recipe.AddIngredient(ItemID.BottledWater); - recipe.AddTile(TileID.AlchemyTable); - recipe.SetResult(ItemID.ShinePotion); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(null, "BloodOrb", 10); - recipe.AddIngredient(ItemID.BottledWater); - recipe.AddTile(TileID.AlchemyTable); - recipe.SetResult(ItemID.InvisibilityPotion); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(null, "BloodOrb", 10); - recipe.AddIngredient(ItemID.BottledWater); - recipe.AddTile(TileID.AlchemyTable); - recipe.SetResult(ItemID.SpelunkerPotion); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(null, "BloodOrb", 10); - recipe.AddIngredient(ItemID.BottledWater); - recipe.AddTile(TileID.AlchemyTable); - recipe.SetResult(ItemID.FeatherfallPotion); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(null, "BloodOrb", 10); - recipe.AddIngredient(ItemID.BottledWater); - recipe.AddTile(TileID.AlchemyTable); - recipe.SetResult(ItemID.MagicPowerPotion); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(null, "BloodOrb", 10); - recipe.AddIngredient(ItemID.BottledWater); - recipe.AddTile(TileID.AlchemyTable); - recipe.SetResult(ItemID.ManaRegenerationPotion); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(null, "BloodOrb", 10); - recipe.AddIngredient(ItemID.BottledWater); - recipe.AddTile(TileID.AlchemyTable); - recipe.SetResult(ItemID.IronskinPotion); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(null, "BloodOrb", 10); - recipe.AddIngredient(ItemID.BottledWater); - recipe.AddTile(TileID.AlchemyTable); - recipe.SetResult(ItemID.GillsPotion); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(null, "BloodOrb", 10); - recipe.AddIngredient(ItemID.BottledWater); - recipe.AddTile(TileID.AlchemyTable); - recipe.SetResult(ItemID.SwiftnessPotion); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(null, "BloodOrb", 10); - recipe.AddIngredient(ItemID.BottledWater); - recipe.AddTile(TileID.AlchemyTable); - recipe.SetResult(ItemID.RegenerationPotion); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(null, "BloodOrb", 10); - recipe.AddIngredient(ItemID.BottledWater); - recipe.AddTile(TileID.AlchemyTable); - recipe.SetResult(ItemID.ObsidianSkinPotion); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(ItemID.AncientCloth, 10); - recipe.AddIngredient(ItemID.SoulofLight, 10); - recipe.AddIngredient(ItemID.SoulofNight, 10); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(ItemID.FlyingCarpet); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(ItemID.LihzahrdBrick, 15); - recipe.AddIngredient(null, "CoreofCinder"); - recipe.AddTile(TileID.LihzahrdFurnace); - recipe.SetResult(ItemID.LihzahrdPowerCell); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(ItemID.GlowingMushroom, 15); - recipe.AddIngredient(ItemID.Worm); - recipe.AddTile(TileID.Autohammer); - recipe.SetResult(ItemID.TruffleWorm); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(ItemID.IronBar, 5); - recipe.anyIronBar = true; - recipe.AddTile(TileID.Anvils); - recipe.SetResult(ItemID.Aglet); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(ItemID.JungleSpores, 15); - recipe.AddIngredient(ItemID.Cloud, 15); - recipe.AddIngredient(ItemID.PinkGel, 5); - recipe.AddTile(TileID.Anvils); - recipe.SetResult(ItemID.AnkletoftheWind); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(ItemID.SunplateBlock, 10); - recipe.AddIngredient(ItemID.Cloud, 10); - recipe.AddIngredient(ItemID.GoldBar, 5); - recipe.AddTile(TileID.Anvils); - recipe.SetResult(ItemID.LuckyHorseshoe); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(ItemID.SunplateBlock, 10); - recipe.AddIngredient(ItemID.Cloud, 10); - recipe.AddIngredient(ItemID.PlatinumBar, 5); - recipe.AddTile(TileID.Anvils); - recipe.SetResult(ItemID.LuckyHorseshoe); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(ItemID.SoulofLight, 30); - recipe.AddIngredient(ItemID.ChaosFish, 5); - recipe.AddIngredient(ItemID.PixieDust, 50); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(ItemID.RodofDiscord); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(ItemID.TurtleShell, 3); - recipe.AddIngredient(null, "EssenceofEleum", 9); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(ItemID.FrozenTurtleShell); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(null, "PlantyMush", 10); - recipe.AddIngredient(null, "LivingShard"); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(ItemID.LifeFruit); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(ItemID.FallenStar, 20); - recipe.AddIngredient(ItemID.SoulofMight, 10); - recipe.AddIngredient(ItemID.SoulofLight, 5); - recipe.AddIngredient(ItemID.SoulofNight, 5); - recipe.AddIngredient(null, "CryoBar", 3); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(ItemID.CelestialMagnet); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); //ankh 1 - recipe.AddIngredient(ItemID.Silk, 20); - recipe.AddIngredient(ItemID.SoulofLight, 3); - recipe.AddIngredient(ItemID.SoulofNight, 3); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(ItemID.TrifoldMap); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); //ankh 2 - recipe.AddIngredient(ItemID.Bone, 50); - recipe.AddIngredient(null, "AncientBoneDust", 3); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(ItemID.ArmorPolish); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); //ankh 3 - recipe.AddIngredient(ItemID.SoulofNight, 20); - recipe.AddIngredient(ItemID.Lens, 5); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(ItemID.Nazar); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); //ankh 4 - recipe.AddIngredient(ItemID.Stinger, 15); - recipe.AddIngredient(null, "MurkyPaste"); - recipe.AddTile(TileID.Anvils); - recipe.SetResult(ItemID.Bezoar); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); //ankh 5 - recipe.AddIngredient(ItemID.BottledWater); - recipe.AddIngredient(ItemID.Waterleaf, 5); - recipe.AddIngredient(ItemID.Blinkroot, 5); - recipe.AddIngredient(ItemID.Daybloom, 5); - recipe.AddIngredient(null, "BeetleJuice", 3); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(ItemID.Vitamins); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); //ankh 6 - recipe.AddIngredient(ItemID.Silk, 30); - recipe.AddIngredient(ItemID.SoulofNight, 5); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(ItemID.Blindfold); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); //ankh 7 - recipe.AddIngredient(ItemID.Timer1Second); - recipe.AddIngredient(ItemID.PixieDust, 15); - recipe.AddIngredient(ItemID.SoulofLight, 5); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(ItemID.FastClock); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); //ankh 8 - recipe.AddIngredient(ItemID.Wire, 10); - recipe.AddIngredient(ItemID.HallowedBar, 5); - recipe.AddIngredient(ItemID.Ruby, 3); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(ItemID.Megaphone); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); //ankh 9 - recipe.AddIngredient(ItemID.Silk, 10); - recipe.AddIngredient(ItemID.Gel, 50); - recipe.AddIngredient(ItemID.GreaterHealingPotion); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(ItemID.AdhesiveBandage); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(ItemID.Frog, 10); - recipe.AddTile(TileID.Anvils); - recipe.SetResult(ItemID.FrogLeg); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); //hermesboots - recipe.AddIngredient(ItemID.Silk, 10); - recipe.AddTile(TileID.Loom); - recipe.SetResult(ItemID.HermesBoots); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); //radar - recipe.AddIngredient(ItemID.IronBar, 5); - recipe.anyIronBar = true; - recipe.AddTile(TileID.Anvils); - recipe.SetResult(ItemID.Radar); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(ItemID.Bone, 5); - recipe.AddIngredient(ItemID.PinkGel); - recipe.AddIngredient(ItemID.HealingPotion); - recipe.AddIngredient(ItemID.Ruby); - recipe.AddTile(TileID.Anvils); - recipe.SetResult(ItemID.LifeCrystal); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(ItemID.Wood, 5); - recipe.AddIngredient(ItemID.Torch, 3); - recipe.AddIngredient(ItemID.FallenStar); - recipe.AddTile(TileID.Anvils); - recipe.SetResult(ItemID.WandofSparking); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(ItemID.IronBar); - recipe.anyIronBar = true; - recipe.AddTile(TileID.Anvils); - recipe.SetResult(ItemID.ThrowingKnife, 50); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(ItemID.IronBar); - recipe.anyIronBar = true; - recipe.AddTile(TileID.Anvils); - recipe.SetResult(ItemID.Shuriken, 50); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(ItemID.Leather, 10); - recipe.AddTile(TileID.Anvils); - recipe.SetResult(ItemID.FeralClaws); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(ItemID.Leather, 5); - recipe.AddIngredient(null, "BloodOrb", 10); - recipe.AddTile(TileID.Hellforge); - recipe.SetResult(ItemID.GuideVoodooDoll); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(ItemID.JungleSpores, 15); - recipe.AddIngredient(ItemID.RichMahogany, 15); - recipe.AddIngredient(ItemID.SoulofNight, 15); - recipe.AddIngredient(ItemID.SoulofLight, 15); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(ItemID.TempleKey); - recipe.AddRecipe(); - - recipe = new ModRecipe(this); - recipe.AddIngredient(null, "RogueEmblem"); - recipe.AddIngredient(ItemID.SoulofMight, 5); - recipe.AddIngredient(ItemID.SoulofSight, 5); - recipe.AddIngredient(ItemID.SoulofFright, 5); - recipe.AddTile(TileID.TinkerersWorkbench); - recipe.SetResult(ItemID.AvengerEmblem); - recipe.AddRecipe(); - } - #endregion - - #region Packets - public override void HandlePacket(BinaryReader reader, int whoAmI) + CalamityRecipes.AddRecipeGroups(); + } + + public override void AddRecipes() + { + CalamityRecipes.AddRecipes(); + } + #endregion + + #region Seasons + public static Season season + { + get + { + DateTime date = DateTime.Now; + int day = date.DayOfYear - Convert.ToInt32((DateTime.IsLeapYear(date.Year)) && date.DayOfYear > 59); + + if (day < 80 || day >= 355) + { + return Season.Winter; + } + + else if (day >= 80 && day < 172) + { + return Season.Spring; + } + + else if (day >= 172 && day < 266) + { + return Season.Summer; + } + + else + { + return Season.Fall; + } + } + } + #endregion + + #region Packets + public override void HandlePacket(BinaryReader reader, int whoAmI) { CalamityModMessageType msgType = (CalamityModMessageType)reader.ReadByte(); - switch (msgType) + switch (msgType) { - case CalamityModMessageType.MeleeLevelSync: - Main.player[reader.ReadInt32()].GetModPlayer().HandleLevels(reader, 0); - break; - case CalamityModMessageType.RangedLevelSync: - Main.player[reader.ReadInt32()].GetModPlayer().HandleLevels(reader, 1); - break; - case CalamityModMessageType.MagicLevelSync: - Main.player[reader.ReadInt32()].GetModPlayer().HandleLevels(reader, 2); - break; - case CalamityModMessageType.SummonLevelSync: - Main.player[reader.ReadInt32()].GetModPlayer().HandleLevels(reader, 3); - break; - case CalamityModMessageType.RogueLevelSync: - Main.player[reader.ReadInt32()].GetModPlayer().HandleLevels(reader, 4); - break; - case CalamityModMessageType.ExactMeleeLevelSync: - Main.player[reader.ReadInt32()].GetModPlayer().HandleExactLevels(reader, 0); - break; - case CalamityModMessageType.ExactRangedLevelSync: - Main.player[reader.ReadInt32()].GetModPlayer().HandleExactLevels(reader, 1); - break; - case CalamityModMessageType.ExactMagicLevelSync: - Main.player[reader.ReadInt32()].GetModPlayer().HandleExactLevels(reader, 2); - break; - case CalamityModMessageType.ExactSummonLevelSync: - Main.player[reader.ReadInt32()].GetModPlayer().HandleExactLevels(reader, 3); - break; - case CalamityModMessageType.ExactRogueLevelSync: - Main.player[reader.ReadInt32()].GetModPlayer().HandleExactLevels(reader, 4); - break; - case CalamityModMessageType.StressSync: - Main.player[reader.ReadInt32()].GetModPlayer().HandleStress(reader); - break; - case CalamityModMessageType.Ravager: - int ravagerAlive = reader.ReadInt32(); - CalamityGlobalNPC.scavenger = ravagerAlive; - break; - case CalamityModMessageType.DoG: - int DoGAlive = reader.ReadInt32(); - CalamityGlobalNPC.DoGHead = DoGAlive; - break; - case CalamityModMessageType.Polterghast: - int polterAlive = reader.ReadInt32(); - CalamityGlobalNPC.ghostBoss = polterAlive; - break; - case CalamityModMessageType.LORDE: - int lordeAlive = reader.ReadInt32(); - CalamityGlobalNPC.lordeBoss = lordeAlive; - break; - case CalamityModMessageType.Providence: - int provAlive = reader.ReadInt32(); - CalamityGlobalNPC.holyBoss = provAlive; - break; - case CalamityModMessageType.BossRushStage: - int stage = reader.ReadInt32(); - CalamityWorld.bossRushStage = stage; - break; - case CalamityModMessageType.AdrenalineSync: - Main.player[reader.ReadInt32()].GetModPlayer().HandleAdrenaline(reader); - break; - case CalamityModMessageType.TeleportPlayer: - Main.player[reader.ReadInt32()].GetModPlayer().HandleTeleport(reader.ReadInt32(), true, whoAmI); - break; - case CalamityModMessageType.SupremeCal: - int SCalAlive = reader.ReadInt32(); - CalamityGlobalNPC.SCal = SCalAlive; - break; - case CalamityModMessageType.DoGCountdownSync: - int countdown = reader.ReadInt32(); - CalamityWorld.DoGSecondStageCountdown = countdown; - break; - case CalamityModMessageType.BossSpawnCountdownSync: - int countdown2 = reader.ReadInt32(); - CalamityWorld.bossSpawnCountdown = countdown2; - break; - case CalamityModMessageType.BossTypeSync: - int type = reader.ReadInt32(); - CalamityWorld.bossType = type; - break; - default: + case CalamityModMessageType.MeleeLevelSync: + Main.player[reader.ReadInt32()].GetModPlayer().HandleLevels(reader, 0); + break; + case CalamityModMessageType.RangedLevelSync: + Main.player[reader.ReadInt32()].GetModPlayer().HandleLevels(reader, 1); + break; + case CalamityModMessageType.MagicLevelSync: + Main.player[reader.ReadInt32()].GetModPlayer().HandleLevels(reader, 2); + break; + case CalamityModMessageType.SummonLevelSync: + Main.player[reader.ReadInt32()].GetModPlayer().HandleLevels(reader, 3); + break; + case CalamityModMessageType.RogueLevelSync: + Main.player[reader.ReadInt32()].GetModPlayer().HandleLevels(reader, 4); + break; + case CalamityModMessageType.ExactMeleeLevelSync: + Main.player[reader.ReadInt32()].GetModPlayer().HandleExactLevels(reader, 0); + break; + case CalamityModMessageType.ExactRangedLevelSync: + Main.player[reader.ReadInt32()].GetModPlayer().HandleExactLevels(reader, 1); + break; + case CalamityModMessageType.ExactMagicLevelSync: + Main.player[reader.ReadInt32()].GetModPlayer().HandleExactLevels(reader, 2); + break; + case CalamityModMessageType.ExactSummonLevelSync: + Main.player[reader.ReadInt32()].GetModPlayer().HandleExactLevels(reader, 3); + break; + case CalamityModMessageType.ExactRogueLevelSync: + Main.player[reader.ReadInt32()].GetModPlayer().HandleExactLevels(reader, 4); + break; + case CalamityModMessageType.StressSync: + Main.player[reader.ReadInt32()].GetModPlayer().HandleStress(reader); + break; + case CalamityModMessageType.Ravager: + int ravagerAlive = reader.ReadInt32(); + CalamityGlobalNPC.scavenger = ravagerAlive; + break; + case CalamityModMessageType.DoG: + int DoGAlive = reader.ReadInt32(); + CalamityGlobalNPC.DoGHead = DoGAlive; + break; + case CalamityModMessageType.Polterghast: + int polterAlive = reader.ReadInt32(); + CalamityGlobalNPC.ghostBoss = polterAlive; + break; + case CalamityModMessageType.LORDE: + int lordeAlive = reader.ReadInt32(); + CalamityGlobalNPC.lordeBoss = lordeAlive; + break; + case CalamityModMessageType.Providence: + int provAlive = reader.ReadInt32(); + CalamityGlobalNPC.holyBoss = provAlive; + break; + case CalamityModMessageType.BossRushStage: + int stage = reader.ReadInt32(); + CalamityWorld.bossRushStage = stage; + break; + case CalamityModMessageType.AdrenalineSync: + Main.player[reader.ReadInt32()].GetModPlayer().HandleAdrenaline(reader); + break; + case CalamityModMessageType.TeleportPlayer: + Main.player[reader.ReadInt32()].GetModPlayer().HandleTeleport(reader.ReadInt32(), true, whoAmI); + break; + case CalamityModMessageType.SupremeCal: + int SCalAlive = reader.ReadInt32(); + CalamityGlobalNPC.SCal = SCalAlive; + break; + case CalamityModMessageType.DoGCountdownSync: + int countdown = reader.ReadInt32(); + CalamityWorld.DoGSecondStageCountdown = countdown; + break; + case CalamityModMessageType.BossSpawnCountdownSync: + int countdown2 = reader.ReadInt32(); + CalamityWorld.bossSpawnCountdown = countdown2; + break; + case CalamityModMessageType.BossTypeSync: + int type = reader.ReadInt32(); + CalamityWorld.bossType = type; + break; + default: ErrorLogger.Log("CalamityMod: Unknown Message type: " + msgType); break; } - } - #endregion - - public override object Call(params object[] args) - { - return ModSupport.Call(args); } - } - - enum CalamityModMessageType : byte + #endregion + } + + public enum Season : byte { - MeleeLevelSync, - RangedLevelSync, - MagicLevelSync, - SummonLevelSync, - RogueLevelSync, - ExactMeleeLevelSync, - ExactRangedLevelSync, - ExactMagicLevelSync, - ExactSummonLevelSync, - ExactRogueLevelSync, - StressSync, - Ravager, - DoG, - Polterghast, - LORDE, - Providence, - AdrenalineSync, - TeleportPlayer, - BossRushStage, - SupremeCal, - DoGCountdownSync, - BossSpawnCountdownSync, - BossTypeSync - } + Winter, + Spring, + Summer, + Fall + } + + enum CalamityModMessageType : byte + { + MeleeLevelSync, + RangedLevelSync, + MagicLevelSync, + SummonLevelSync, + RogueLevelSync, + ExactMeleeLevelSync, + ExactRangedLevelSync, + ExactMagicLevelSync, + ExactSummonLevelSync, + ExactRogueLevelSync, + StressSync, + Ravager, + DoG, + Polterghast, + LORDE, + Providence, + AdrenalineSync, + TeleportPlayer, + BossRushStage, + SupremeCal, + DoGCountdownSync, + BossSpawnCountdownSync, + BossTypeSync + } } \ No newline at end of file diff --git a/CalamityPlayer.cs b/CalamityPlayer.cs index 3a6558199e..d51d96571a 100644 --- a/CalamityPlayer.cs +++ b/CalamityPlayer.cs @@ -20,6 +20,8 @@ using CalamityMod.NPCs.Calamitas; using CalamityMod.NPCs.PlaguebringerGoliath; using CalamityMod.NPCs.Yharon; using CalamityMod.NPCs.Leviathan; +using CalamityMod.Projectiles; +using CalamityMod.Items; using CalamityMod.Items.Armor; using CalamityMod.UI; using CalamityMod.Items.CalamityCustomThrowingDamage; @@ -29,799 +31,849 @@ namespace CalamityMod { public class CalamityPlayer : ModPlayer { - #region InstanceVars + #region InstanceVars - #region NormalVars - public int meleeLevel = 0; + #region NormalVars + public float rogueStealth = 0f; - public int rangedLevel = 0; + public float rogueStealthMax = 0f; - public int magicLevel = 0; + public bool playRogueStealthSound = false; - public int rogueLevel = 0; + public int nebulaManaNerfCounter = 0; - public int summonLevel = 0; + public int alcoholPoisonLevel = 0; - public int gainLevelCooldown = 120; //120 frames before gaining another stat point, avoiding i-frame nonsense + public static bool areThereAnyDamnBosses = false; - public bool shootFireworksLevelUpMelee = true; + private const int saveVersion = 0; - public bool shootFireworksLevelUpRanged = true; - - public bool shootFireworksLevelUpMagic = true; - - public bool shootFireworksLevelUpSummon = true; - - public bool shootFireworksLevelUpRogue = true; - - public int exactMeleeLevel = 0; - - public int exactRangedLevel = 0; - - public int exactMagicLevel = 0; - - public int exactSummonLevel = 0; - - public int exactRogueLevel = 0; - - public int alcoholPoisonLevel = 0; - - public static bool areThereAnyDamnBosses = false; - - private const int saveVersion = 0; - public int modStealthTimer; - public int hInfernoBoost = 0; + public int hInfernoBoost = 0; + + public int pissWaterBoost = 0; - public int pissWaterBoost = 0; - - public int runCheck = 0; - public int packetTimer = 0; - public int sCalDeathCount = 0; + public int sCalDeathCount = 0; - public int sCalKillCount = 0; + public int sCalKillCount = 0; - public int bloodflareHeartTimer = 180; + public int bloodflareHeartTimer = 180; - public int bloodflareManaTimer = 180; + public int bloodflareManaTimer = 180; public float modStealth = 1f; - public float aquaticBoost = 1f; - + public float aquaticBoost = 1f; + public float shieldInvinc = 5f; - + public int dashMod; - + public int dashTimeMod; public const float defEndurance = 0.33f; - public bool playFullRageSound = true; + public bool playFullRageSound = true; - public bool playFullAdrenalineSound = true; + public bool playFullAdrenalineSound = true; - public bool fab = false; + public bool playAdrenalineBurnoutSound = true; - public bool drawBossHPBar = true; + public bool playFullAdrenalineBurnoutSound = true; - public bool shouldDrawSmallText = true; - #endregion + public bool fab = false; - #region PetStuff - public bool leviPet = false; + public bool drawBossHPBar = true; - public bool sirenPet = false; + public bool shouldDrawSmallText = true; - public bool fox = false; + public float ataraxiaDamageBoost = 0f; - public bool chibii = false; + public int ataraxiaDamageBoostCooldown = 0; - public bool brimling = false; + public int ataraxiaDamageBoostCancelTimer = 1200; + #endregion - public bool bearPet = false; - #endregion + #region ProficiencyStuff + public int meleeLevel = 0; + public int rangedLevel = 0; + public int magicLevel = 0; + public int rogueLevel = 0; + public int summonLevel = 0; - #region StressStuff - public const int stressMax = 10000; + public bool shootFireworksLevelUpMelee = true; + public bool shootFireworksLevelUpRanged = true; + public bool shootFireworksLevelUpMagic = true; + public bool shootFireworksLevelUpSummon = true; + public bool shootFireworksLevelUpRogue = true; - public int stress; + public int exactMeleeLevel = 0; + public int exactRangedLevel = 0; + public int exactMagicLevel = 0; + public int exactSummonLevel = 0; + public int exactRogueLevel = 0; - public int stressCD; + public int gainLevelCooldown = 120; // 120 frames before gaining another stat point, avoiding i-frame nonsense + #endregion - public bool heartOfDarkness = false; + #region PetStuff + public bool leviPet = false; - public bool draedonsHeart = false; + public bool sirenPet = false; + + public bool fox = false; + + public bool chibii = false; + + public bool brimling = false; + + public bool bearPet = false; + + public bool trashMan = false; + + public int trashManChest = -1; + #endregion + + #region StressStuff + public const int stressMax = 10000; + + public int stress; + + public int stressCD; + + public bool heartOfDarkness = false; + + public bool draedonsHeart = false; + + public bool draedonsStressGain = false; - public bool draedonsStressGain = false; - public bool afflicted = false; - + public bool affliction = false; - + public bool afflictedBuff = false; - public bool stressPills = false; + public bool stressPills = false; + + public bool laudanum = false; - public bool laudanum = false; - public bool stressLevel500 = false; - public bool rageMode = false; + public bool rageMode = false; + #endregion - //public bool despawnProj = false; - #endregion + #region AdrenalineStuff + public const int adrenalineMax = 10000; - #region AdrenalineStuff - public const int adrenalineMax = 10000; + public int adrenalineMaxTimer = 300; - public int adrenalineMaxTimer = 180; + public int adrenalineDmgDown = 600; - public int adrenalineDmgDown = 600; + public float adrenalineDmgMult = 1f; - public float adrenalineDmgMult = 1f; + public int adrenaline; - public int adrenaline; + public int adrenalineCD; - public int adrenalineCD; + public bool adrenalineMode = false; + #endregion - public bool adrenalineMode = false; - #endregion + #region PermanentStuff + public bool extraAccessoryML = false; - #region PermanentStuff - public bool extraAccessoryML = false; - public bool eCore = false; - + public bool pHeart = false; - + public bool cShard = false; - + public bool mFruit = false; - + public bool bOrange = false; - + public bool eBerry = false; - + public bool dFruit = false; - public bool revJamDrop = false; + public bool revJamDrop = false; - public bool rageBoostOne = false; + public bool rageBoostOne = false; - public bool rageBoostTwo = false; + public bool rageBoostTwo = false; - public bool rageBoostThree = false; + public bool rageBoostThree = false; - public bool adrenalineBoostOne = false; + public bool adrenalineBoostOne = false; - public bool adrenalineBoostTwo = false; + public bool adrenalineBoostTwo = false; - public bool adrenalineBoostThree = false; - #endregion + public bool adrenalineBoostThree = false; + #endregion - #region AccessoryStuff - public bool fasterMeleeLevel = false; + #region AccessoryStuff + public bool fasterMeleeLevel = false; - public bool fasterRangedLevel = false; + public bool fasterRangedLevel = false; - public bool fasterMagicLevel = false; + public bool fasterMagicLevel = false; - public bool fasterSummonLevel = false; + public bool fasterSummonLevel = false; - public bool fasterRogueLevel = false; + public bool fasterRogueLevel = false; - public bool dodgeScarf = false; + public bool rBrain = false; - public bool badgeOfBravery = false; + public bool bloodyWormTooth = false; - public bool scarfCooldown = false; + public bool rampartOfDeities = false; + + public bool vexation = false; + + public bool fBulwark = false; + + public bool dodgeScarf = false; + + public bool badgeOfBravery = false; + + public bool scarfCooldown = false; + + public bool cryogenSoul = false; - public bool cryogenSoul = false; - public bool yInsignia = false; - + public bool eGauntlet = false; - + public bool eTalisman = false; - public bool statisBeltOfCurses = false; + public bool statisBeltOfCurses = false; - public bool elysianAegis = false; + public bool elysianAegis = false; - public bool elysianGuard = false; + public bool elysianGuard = false; - public bool nCore = false; + public bool nCore = false; - public bool abyssalDivingSuitPlates = false; + public bool abyssalDivingSuitPlates = false; - public bool abyssalDivingSuitCooldown = false; + public bool abyssalDivingSuitCooldown = false; - public int abyssalDivingSuitPlateHits = 0; + public int abyssalDivingSuitPlateHits = 0; - public bool sirenWaterBuff = false; + public bool sirenWaterBuff = false; - public bool sirenIce = false; + public bool sirenIce = false; - public bool sirenIceCooldown = false; + public bool sirenIceCooldown = false; - public bool aSpark = false; + public bool aSpark = false; - public bool aBulwark = false; + public bool aBulwark = false; - public bool dAmulet = false; + public bool dAmulet = false; - public bool fCarapace = false; + public bool fCarapace = false; - public bool gShell = false; + public bool gShell = false; - public bool absorber = false; + public bool absorber = false; - public bool aAmpoule = false; + public bool aAmpoule = false; - public bool pAmulet = false; + public bool pAmulet = false; - public bool fBarrier = false; + public bool fBarrier = false; - public bool aBrain = false; + public bool aBrain = false; - public bool lol = false; + public bool lol = false; - public bool raiderTalisman = false; + public bool raiderTalisman = false; - public int raiderStack = 0; + public int raiderStack = 0; - public bool sGenerator = false; + public bool sGenerator = false; - public bool sDefense = false; + public bool sDefense = false; - public bool sPower = false; + public bool sPower = false; - public bool sRegen = false; + public bool sRegen = false; - public bool IBoots = false; + public bool IBoots = false; - public bool elysianFire = false; + public bool elysianFire = false; - public bool sTracers = false; + public bool sTracers = false; - public bool eTracers = false; + public bool eTracers = false; - public bool cTracers = false; + public bool cTracers = false; - public bool frostFlare = false; + public bool frostFlare = false; - public bool beeResist = false; + public bool beeResist = false; - public bool uberBees = false; + public bool uberBees = false; - public bool projRef = false; + public bool projRef = false; - public bool nanotech = false; + public bool nanotech = false; - public bool eQuiver = false; + public bool eQuiver = false; - public bool shadowMinions = false; + public bool shadowMinions = false; - public bool tearMinions = false; + public bool tearMinions = false; - public bool alchFlask = false; + public bool alchFlask = false; - public bool community = false; + public bool community = false; - public bool fleshTotem = false; + public bool fleshTotem = false; - public int fleshTotemCooldown = 0; + public int fleshTotemCooldown = 0; - public bool bloodPact = false; + public bool bloodPact = false; - public bool bloodflareCore = false; + public bool bloodflareCore = false; - public bool coreOfTheBloodGod = false; + public bool coreOfTheBloodGod = false; - public bool elementalHeart = false; + public bool elementalHeart = false; - public bool crownJewel = false; + public bool crownJewel = false; - public bool celestialJewel = false; + public bool celestialJewel = false; - public bool astralArcanum = false; + public bool astralArcanum = false; - public bool harpyRing = false; + public bool harpyRing = false; - public bool ironBoots = false; + public bool ironBoots = false; - public bool depthCharm = false; + public bool depthCharm = false; - public bool anechoicPlating = false; + public bool anechoicPlating = false; - public bool jellyfishNecklace = false; + public bool jellyfishNecklace = false; - public bool abyssalAmulet = false; + public bool abyssalAmulet = false; - public bool lumenousAmulet = false; + public bool lumenousAmulet = false; - public bool reaperToothNecklace = false; + public bool reaperToothNecklace = false; - public bool aquaticEmblem = false; + public bool aquaticEmblem = false; - public bool darkSunRing = false; + public bool darkSunRing = false; - public bool calamityRing = false; + public bool calamityRing = false; - public bool eArtifact = false; + public bool eArtifact = false; - public bool dArtifact = false; + public bool dArtifact = false; - public bool gArtifact = false; + public bool gArtifact = false; - public bool pArtifact = false; - #endregion + public bool pArtifact = false; - #region ArmorSetStuff - public bool victideSet = false; + public bool giantPearl = false; - public bool aeroSet = false; + public bool normalityRelocator = false; + #endregion + + #region ArmorSetStuff + public bool victideSet = false; + + public bool aeroSet = false; + + public bool statigelSet = false; - public bool statigelSet = false; - public bool tarraSet = false; - public bool tarraMelee = false; + public bool tarraMelee = false; - public bool tarraDefense = false; + public bool tarraDefense = false; - public int tarraCooldown = 0; + public int tarraCooldown = 0; - public int tarraDefenseTime = 600; + public int tarraDefenseTime = 600; - public bool tarraMage = false; + public bool tarraMage = false; - public int tarraMageHealCooldown = 0; + public int tarraMageHealCooldown = 0; - public int tarraCrits = 0; + public int tarraCrits = 0; - public bool tarraRanged = false; + public bool tarraRanged = false; - public bool tarraThrowing = false; + public bool tarraThrowing = false; - public int tarraThrowingCrits = 0; + public int tarraThrowingCrits = 0; - public int tarraThrowingCritTimer = 0; + public int tarraThrowingCritTimer = 0; + + public bool tarraSummon = false; - public bool tarraSummon = false; - public bool bloodflareSet = false; - public bool bloodflareMelee = false; + public bool bloodflareMelee = false; - public int bloodflareMeleeHits = 0; + public int bloodflareMeleeHits = 0; - public int bloodflareFrenzyTimer = 0; + public int bloodflareFrenzyTimer = 0; - public int bloodflareFrenzyCooldown = 0; + public int bloodflareFrenzyCooldown = 0; - public bool bloodflareRanged = false; + public bool bloodflareRanged = false; - public int bloodflareRangedCooldown = 0; + public int bloodflareRangedCooldown = 0; - public bool bloodflareThrowing = false; + public bool bloodflareThrowing = false; - public bool bloodflareMage = false; + public bool bloodflareMage = false; - public int bloodflareMageCooldown = 0; + public int bloodflareMageCooldown = 0; - public bool bloodflareSummon = false; + public bool bloodflareSummon = false; + + public int bloodflareSummonTimer = 0; - public int bloodflareSummonTimer = 0; - public bool godSlayer = false; - + public bool godSlayerDamage = false; - public bool godSlayerMage = false; + public bool godSlayerMage = false; - public bool godSlayerRanged = false; + public bool godSlayerRanged = false; - public bool godSlayerThrowing = false; + public bool godSlayerThrowing = false; - public bool godSlayerSummon = false; + public bool godSlayerSummon = false; - public float godSlayerDmg; + public float godSlayerDmg; + + public bool godSlayerReflect = false; - public bool godSlayerReflect = false; - public bool godSlayerCooldown = false; - + public bool ataxiaBolt = false; - + public bool ataxiaFire = false; - + public bool ataxiaVolley = false; - + public bool ataxiaBlaze = false; - + public bool daedalusAbsorb = false; - + public bool daedalusShard = false; - + public bool reaverSpore = false; - + public bool reaverDoubleTap = false; - public bool flamethrowerBoost = false; + public bool flamethrowerBoost = false; - public bool shadeRegen = false; + public bool shadeRegen = false; - public bool shadowSpeed = false; + public bool shadowSpeed = false; - public bool dsSetBonus = false; + public bool dsSetBonus = false; - public bool auricBoost = false; + public bool auricBoost = false; - public bool daedalusReflect = false; + public bool daedalusReflect = false; - public bool daedalusSplit = false; + public bool daedalusSplit = false; - public bool reaverBlast = false; + public bool reaverBlast = false; - public bool reaverBurst = false; + public bool reaverBurst = false; - public bool astralStarRain = false; + public bool astralStarRain = false; - public int astralStarRainCooldown = 0; + public int astralStarRainCooldown = 0; - public float ataxiaDmg; + public float ataxiaDmg; - public bool ataxiaMage = false; + public bool ataxiaMage = false; - public bool ataxiaGeyser = false; + public bool ataxiaGeyser = false; - public float xerocDmg; + public float xerocDmg; - public bool xerocSet = false; + public bool xerocSet = false; - public bool silvaSet = false; + public bool silvaSet = false; - public bool silvaMelee = false; + public bool silvaMelee = false; - public bool silvaRanged = false; + public bool silvaRanged = false; - public bool silvaThrowing = false; + public bool silvaThrowing = false; - public bool silvaMage = false; + public bool silvaMage = false; - public bool silvaSummon = false; + public bool silvaSummon = false; - public bool hasSilvaEffect = false; + public bool hasSilvaEffect = false; - public int silvaCountdown = 600; + public int silvaCountdown = 600; - public int silvaHitCounter = 0; + public int silvaHitCounter = 0; - public bool auricSet = false; + public bool auricSet = false; - public bool omegaBlueChestplate = false; + public bool omegaBlueChestplate = false; - public bool omegaBlueSet = false; + public bool omegaBlueSet = false; - public bool omegaBlueHentai = false; + public bool omegaBlueHentai = false; - public int omegaBlueCooldown = 0; - #endregion + public int omegaBlueCooldown = 0; - #region DebuffStuff - public bool aCrunch = false; + public bool molluskSet = false; + #endregion + + #region DebuffStuff + public bool lethalLavaBurn = false; + + public bool aCrunch = false; + + public bool NOU = false; - public bool NOU = false; - public bool hAttack = false; - + public bool horror = false; - + public bool irradiated = false; - + public bool bFlames = false; - + public bool aFlames = false; - + public bool gsInferno = false; - + public bool pFlames = false; - + public bool hFlames = false; - public bool hInferno = false; - + public bool hInferno = false; + public bool gState = false; - + public bool bBlood = false; - public bool eGravity = false; + public bool eGravity = false; - public bool weakPetrification = false; + public bool weakPetrification = false; - public bool vHex = false; + public bool vHex = false; - public bool eGrav = false; + public bool eGrav = false; - public bool warped = false; + public bool warped = false; - public bool marked = false; + public bool marked = false; - public bool cDepth = false; + public bool cDepth = false; - public bool fishAlert = false; + public bool fishAlert = false; - public bool bOut = false; - #endregion + public bool bOut = false; + + public bool clamity = false; + #endregion + + #region BuffStuff + public bool rRage = false; - #region BuffStuff - public bool rRage = false; - public bool tRegen = false; - + public bool xRage = false; - + public bool xWrath = false; - + public bool graxDefense = false; - public bool sMeleeBoost = false; + public bool sMeleeBoost = false; - public bool tFury = false; + public bool tFury = false; - public bool cadence = false; + public bool cadence = false; - public bool omniscience = false; + public bool omniscience = false; - public bool zerg = false; + public bool zerg = false; - public bool zen = false; + public bool zen = false; - public bool yPower = false; + public bool yPower = false; - public bool aWeapon = false; + public bool aWeapon = false; - public bool tScale = false; + public bool tScale = false; - public bool fabsolVodka = false; + public bool fabsolVodka = false; - public bool mushy = false; + public bool mushy = false; - public bool molten = false; + public bool molten = false; - public bool shellBoost = false; + public bool shellBoost = false; - public bool cFreeze = false; + public bool cFreeze = false; - public bool invincible = false; + public bool invincible = false; - public bool shine = false; + public bool shine = false; - public bool anechoicCoating = false; + public bool anechoicCoating = false; - public bool enraged = false; + public bool enraged = false; - public int revivifyTimer = 0; + public int revivifyTimer = 0; - public bool permafrostsConcoction; + public bool permafrostsConcoction; - public bool vodka = false; + public bool vodka = false; - public bool redWine = false; + public bool redWine = false; - public bool grapeBeer = false; + public bool grapeBeer = false; - public bool moonshine = false; + public bool moonshine = false; - public bool rum = false; + public bool rum = false; - public bool whiskey = false; + public bool whiskey = false; - public bool fireball = false; + public bool fireball = false; - public bool everclear = false; + public bool everclear = false; - public bool bloodyMary = false; + public bool bloodyMary = false; - public bool tequila = false; + public bool tequila = false; - public bool caribbeanRum = false; + public bool caribbeanRum = false; - public bool cinnamonRoll = false; + public bool cinnamonRoll = false; - public bool tequilaSunrise = false; + public bool tequilaSunrise = false; - public bool margarita = false; + public bool margarita = false; - public bool starBeamRye = false; + public bool starBeamRye = false; - public bool screwdriver = false; + public bool screwdriver = false; - public bool moscowMule = false; + public bool moscowMule = false; - public bool whiteWine = false; + public bool whiteWine = false; - public bool evergreenGin = false; - #endregion + public bool evergreenGin = false; - #region SummonStuff - public bool mWorm = false; + public bool tranquilityCandle = false; - public bool iClasper = false; + public bool chaosCandle = false; - public bool herring = false; + public bool purpleCandle = false; + + public bool blueCandle = false; + + public bool pinkCandle = false; + + public int pinkCandleTimer = 60; + + public bool yellowCandle = false; + + public bool trippy = false; + + public bool amidiasBlessing = false; + #endregion + + #region SummonStuff + public bool mWorm = false; + + public bool iClasper = false; + + public bool herring = false; + + public bool calamari = false; - public bool calamari = false; - public bool cEyes = false; - + public bool cSlime = false; - + public bool cSlime2 = false; - + public bool bStar = false; - public bool aStar = false; - + public bool aStar = false; + public bool SP = false; - + public bool dCreeper = false; - + public bool bClot = false; - + public bool eAxe = false; - + public bool SPG = false; - + public bool aChicken = false; - + public bool cLamp = false; - + public bool pGuy = false; - public bool gDefense = false; + public bool gDefense = false; - public bool gOffense = false; + public bool gOffense = false; - public bool gHealer = false; + public bool gHealer = false; + + public bool cEnergy = false; - public bool cEnergy = false; - public bool sWaifu = false; - + public bool dWaifu = false; - + public bool cWaifu = false; - + public bool bWaifu = false; - + public bool slWaifu = false; - + public bool fClump = false; - + public bool rDevil = false; - + public bool aValkyrie = false; - public bool sCrystal = false; - + public bool sCrystal = false; + public bool sGod = false; - public bool sandnado = false; - + public bool sandnado = false; + public bool vUrchin = false; - + public bool cSpirit = false; - + public bool rOrb = false; - + public bool dCrystal = false; - + public bool sandWaifu = false; - + public bool sandBoobWaifu = false; - + public bool cloudWaifu = false; - + public bool brimstoneWaifu = false; - + public bool sirenWaifu = false; - public bool allWaifus = false; - + public bool allWaifus = false; + public bool fungalClump = false; - + public bool redDevil = false; - + public bool valkyrie = false; - + public bool slimeGod = false; - + public bool urchin = false; - + public bool chaosSpirit = false; - + public bool reaverOrb = false; - + public bool daedalusCrystal = false; - public int healCounter = 300; - #endregion + public int healCounter = 300; + + public bool shellfish = false; + + public bool hCrab = false; + #endregion + + #region BiomeStuff + public bool ZoneCalamity = false; - #region BiomeStuff - public bool ZoneCalamity = false; - public bool ZoneAstral = false; - public bool ZoneGreatSea = false; + public bool ZoneSunkenSea = false; - public bool ZoneSulphur = false; + public bool ZoneSulphur = false; - public bool ZoneAbyss = false; + public bool ZoneAbyss = false; - public bool ZoneAbyssLayer1 = false; + public bool ZoneAbyssLayer1 = false; - public bool ZoneAbyssLayer2 = false; + public bool ZoneAbyssLayer2 = false; - public bool ZoneAbyssLayer3 = false; + public bool ZoneAbyssLayer3 = false; - public bool ZoneAbyssLayer4 = false; + public bool ZoneAbyssLayer4 = false; - public int abyssBreathCD; - #endregion + public int abyssBreathCD; + #endregion - #region TransformationStuff - public bool abyssalDivingSuitPrevious; + #region TransformationStuff + public bool abyssalDivingSuitPrevious; - public bool abyssalDivingSuit; + public bool abyssalDivingSuit; - public bool abyssalDivingSuitHide; + public bool abyssalDivingSuitHide; - public bool abyssalDivingSuitForce; + public bool abyssalDivingSuitForce; - public bool abyssalDivingSuitPower; + public bool abyssalDivingSuitPower; - public bool sirenBoobsPrevious; + public bool sirenBoobsPrevious; - public bool sirenBoobs; + public bool sirenBoobs; - public bool sirenBoobsHide; + public bool sirenBoobsHide; - public bool sirenBoobsForce; + public bool sirenBoobsForce; - public bool sirenBoobsPower; + public bool sirenBoobsPower; - public bool sirenBoobsAltPrevious; + public bool sirenBoobsAltPrevious; - public bool sirenBoobsAlt; + public bool sirenBoobsAlt; - public bool sirenBoobsAltHide; + public bool sirenBoobsAltHide; - public bool sirenBoobsAltForce; + public bool sirenBoobsAltForce; - public bool sirenBoobsAltPower; + public bool sirenBoobsAltPower; - public bool snowmanPrevious; + public bool snowmanPrevious; - public bool snowman; + public bool snowman; - public bool snowmanHide; + public bool snowmanHide; - public bool snowmanForce; + public bool snowmanForce; - public bool snowmanNoseless; + public bool snowmanNoseless; - public bool snowmanPower; - #endregion - #endregion + public bool snowmanPower; + #endregion + #endregion - #region SavingAndLoading - public override void Initialize() + #region SavingAndLoading + public override void Initialize() { extraAccessoryML = false; eCore = false; @@ -831,17 +883,17 @@ namespace CalamityMod dFruit = false; pHeart = false; cShard = false; - revJamDrop = false; - rageBoostOne = false; - rageBoostTwo = false; - rageBoostThree = false; - adrenalineBoostOne = false; - adrenalineBoostTwo = false; - adrenalineBoostThree = false; - drawBossHPBar = true; - shouldDrawSmallText = true; + revJamDrop = false; + rageBoostOne = false; + rageBoostTwo = false; + rageBoostThree = false; + adrenalineBoostOne = false; + adrenalineBoostTwo = false; + adrenalineBoostThree = false; + drawBossHPBar = true; + shouldDrawSmallText = true; } - + public override TagCompound Save() { var boost = new List(); @@ -853,17 +905,17 @@ namespace CalamityMod if (dFruit) boost.Add("dragonFruit"); if (pHeart) boost.Add("phantomHeart"); if (cShard) boost.Add("cometShard"); - if (revJamDrop) boost.Add("revJam"); - if (rageBoostOne) boost.Add("rageOne"); - if (rageBoostTwo) boost.Add("rageTwo"); - if (rageBoostThree) boost.Add("rageThree"); - if (adrenalineBoostOne) boost.Add("adrenalineOne"); - if (adrenalineBoostTwo) boost.Add("adrenalineTwo"); - if (adrenalineBoostThree) boost.Add("adrenalineThree"); - if (drawBossHPBar) boost.Add("bossHPBar"); - if (shouldDrawSmallText) boost.Add("drawSmallText"); + if (revJamDrop) boost.Add("revJam"); + if (rageBoostOne) boost.Add("rageOne"); + if (rageBoostTwo) boost.Add("rageTwo"); + if (rageBoostThree) boost.Add("rageThree"); + if (adrenalineBoostOne) boost.Add("adrenalineOne"); + if (adrenalineBoostTwo) boost.Add("adrenalineTwo"); + if (adrenalineBoostThree) boost.Add("adrenalineThree"); + if (drawBossHPBar) boost.Add("bossHPBar"); + if (shouldDrawSmallText) boost.Add("drawSmallText"); - return new TagCompound + return new TagCompound { { "boost", boost @@ -871,45 +923,45 @@ namespace CalamityMod { "stress", stress }, - { - "adrenaline", adrenaline - }, - { - "sCalDeathCount", sCalDeathCount - }, - { - "sCalKillCount", sCalKillCount - }, - { - "meleeLevel", meleeLevel - }, - { - "exactMeleeLevel", exactMeleeLevel - }, - { - "rangedLevel", rangedLevel - }, - { - "exactRangedLevel", exactRangedLevel - }, - { - "magicLevel", magicLevel - }, - { - "exactMagicLevel", exactMagicLevel - }, - { - "summonLevel", summonLevel - }, - { - "exactSummonLevel", exactSummonLevel - }, - { - "rogueLevel", rogueLevel - }, - { - "exactRogueLevel", exactRogueLevel - } + { + "adrenaline", adrenaline + }, + { + "sCalDeathCount", sCalDeathCount + }, + { + "sCalKillCount", sCalKillCount + }, + { + "meleeLevel", meleeLevel + }, + { + "exactMeleeLevel", exactMeleeLevel + }, + { + "rangedLevel", rangedLevel + }, + { + "exactRangedLevel", exactRangedLevel + }, + { + "magicLevel", magicLevel + }, + { + "exactMagicLevel", exactMagicLevel + }, + { + "summonLevel", summonLevel + }, + { + "exactSummonLevel", exactSummonLevel + }, + { + "rogueLevel", rogueLevel + }, + { + "exactRogueLevel", exactRogueLevel + } }; } @@ -924,53 +976,53 @@ namespace CalamityMod dFruit = boost.Contains("dragonFruit"); pHeart = boost.Contains("phantomHeart"); cShard = boost.Contains("cometShard"); - revJamDrop = boost.Contains("revJam"); - rageBoostOne = boost.Contains("rageOne"); - rageBoostTwo = boost.Contains("rageTwo"); - rageBoostThree = boost.Contains("rageThree"); - adrenalineBoostOne = boost.Contains("adrenalineOne"); - adrenalineBoostTwo = boost.Contains("adrenalineTwo"); - adrenalineBoostThree = boost.Contains("adrenalineThree"); - drawBossHPBar = boost.Contains("bossHPBar"); - shouldDrawSmallText = boost.Contains("drawSmallText"); + revJamDrop = boost.Contains("revJam"); + rageBoostOne = boost.Contains("rageOne"); + rageBoostTwo = boost.Contains("rageTwo"); + rageBoostThree = boost.Contains("rageThree"); + adrenalineBoostOne = boost.Contains("adrenalineOne"); + adrenalineBoostTwo = boost.Contains("adrenalineTwo"); + adrenalineBoostThree = boost.Contains("adrenalineThree"); + drawBossHPBar = boost.Contains("bossHPBar"); + shouldDrawSmallText = boost.Contains("drawSmallText"); - stress = tag.GetInt("stress"); - adrenaline = tag.GetInt("adrenaline"); - sCalDeathCount = tag.GetInt("sCalDeathCount"); - sCalKillCount = tag.GetInt("sCalKillCount"); + stress = tag.GetInt("stress"); + adrenaline = tag.GetInt("adrenaline"); + sCalDeathCount = tag.GetInt("sCalDeathCount"); + sCalKillCount = tag.GetInt("sCalKillCount"); - meleeLevel = tag.GetInt("meleeLevel"); - rangedLevel = tag.GetInt("rangedLevel"); - magicLevel = tag.GetInt("magicLevel"); - summonLevel = tag.GetInt("summonLevel"); - rogueLevel = tag.GetInt("rogueLevel"); - exactMeleeLevel = tag.GetInt("exactMeleeLevel"); - exactRangedLevel = tag.GetInt("exactRangedLevel"); - exactMagicLevel = tag.GetInt("exactMagicLevel"); - exactSummonLevel = tag.GetInt("exactSummonLevel"); - exactRogueLevel = tag.GetInt("exactRogueLevel"); - } + meleeLevel = tag.GetInt("meleeLevel"); + rangedLevel = tag.GetInt("rangedLevel"); + magicLevel = tag.GetInt("magicLevel"); + summonLevel = tag.GetInt("summonLevel"); + rogueLevel = tag.GetInt("rogueLevel"); + exactMeleeLevel = tag.GetInt("exactMeleeLevel"); + exactRangedLevel = tag.GetInt("exactRangedLevel"); + exactMagicLevel = tag.GetInt("exactMagicLevel"); + exactSummonLevel = tag.GetInt("exactSummonLevel"); + exactRogueLevel = tag.GetInt("exactRogueLevel"); + } public override void LoadLegacy(BinaryReader reader) { int loadVersion = reader.ReadInt32(); stress = reader.ReadInt32(); - adrenaline = reader.ReadInt32(); - sCalDeathCount = reader.ReadInt32(); - sCalKillCount = reader.ReadInt32(); + adrenaline = reader.ReadInt32(); + sCalDeathCount = reader.ReadInt32(); + sCalKillCount = reader.ReadInt32(); - meleeLevel = reader.ReadInt32(); - rangedLevel = reader.ReadInt32(); - magicLevel = reader.ReadInt32(); - summonLevel = reader.ReadInt32(); - rogueLevel = reader.ReadInt32(); - exactMeleeLevel = reader.ReadInt32(); - exactRangedLevel = reader.ReadInt32(); - exactMagicLevel = reader.ReadInt32(); - exactSummonLevel = reader.ReadInt32(); - exactRogueLevel = reader.ReadInt32(); + meleeLevel = reader.ReadInt32(); + rangedLevel = reader.ReadInt32(); + magicLevel = reader.ReadInt32(); + summonLevel = reader.ReadInt32(); + rogueLevel = reader.ReadInt32(); + exactMeleeLevel = reader.ReadInt32(); + exactRangedLevel = reader.ReadInt32(); + exactMagicLevel = reader.ReadInt32(); + exactSummonLevel = reader.ReadInt32(); + exactRogueLevel = reader.ReadInt32(); - if (loadVersion == 0) + if (loadVersion == 0) { BitsByte flags = reader.ReadByte(); extraAccessoryML = flags[0]; @@ -982,112 +1034,121 @@ namespace CalamityMod pHeart = flags[6]; cShard = flags[7]; - BitsByte flags2 = reader.ReadByte(); - revJamDrop = flags2[0]; - rageBoostOne = flags2[1]; - rageBoostTwo = flags2[2]; - rageBoostThree = flags2[3]; - adrenalineBoostOne = flags2[4]; - adrenalineBoostTwo = flags2[5]; - adrenalineBoostThree = flags2[6]; - drawBossHPBar = flags2[7]; + BitsByte flags2 = reader.ReadByte(); + revJamDrop = flags2[0]; + rageBoostOne = flags2[1]; + rageBoostTwo = flags2[2]; + rageBoostThree = flags2[3]; + adrenalineBoostOne = flags2[4]; + adrenalineBoostTwo = flags2[5]; + adrenalineBoostThree = flags2[6]; + drawBossHPBar = flags2[7]; - BitsByte flags3 = reader.ReadByte(); - shouldDrawSmallText = flags3[0]; - } + BitsByte flags3 = reader.ReadByte(); + shouldDrawSmallText = flags3[0]; + } else { ErrorLogger.Log("CalamityMod: Unknown loadVersion: " + loadVersion); } } - #endregion + #endregion - #region ResetEffects - public override void ResetEffects() + #region ResetEffects + public override void ResetEffects() { if (extraAccessoryML && player.extraAccessory && (Main.expertMode || Main.gameMenu)) { player.extraAccessorySlots = 2; } - runCheck = 0; + rogueStealthMax = 0f; + dashMod = 0; - alcoholPoisonLevel = 0; + alcoholPoisonLevel = 0; - leviPet = false; - sirenPet = false; - fox = false; - chibii = false; - brimling = false; - bearPet = false; - fab = false; + leviPet = false; + sirenPet = false; + fox = false; + chibii = false; + brimling = false; + bearPet = false; + trashMan = false; + fab = false; - abyssalDivingSuitPlates = false; - abyssalDivingSuitCooldown = false; + abyssalDivingSuitPlates = false; + abyssalDivingSuitCooldown = false; - sirenWaterBuff = false; - sirenIce = false; - sirenIceCooldown = false; + sirenWaterBuff = false; + sirenIce = false; + sirenIceCooldown = false; - draedonsHeart = false; - draedonsStressGain = false; + draedonsHeart = false; + draedonsStressGain = false; afflicted = false; affliction = false; afflictedBuff = false; - fasterMeleeLevel = false; - fasterRangedLevel = false; - fasterMagicLevel = false; - fasterSummonLevel = false; - fasterRogueLevel = false; + fasterMeleeLevel = false; + fasterRangedLevel = false; + fasterMagicLevel = false; + fasterSummonLevel = false; + fasterRogueLevel = false; dodgeScarf = false; - scarfCooldown = false; + scarfCooldown = false; - elysianAegis = false; + elysianAegis = false; nCore = false; - godSlayer = false; - godSlayerDamage = false; - godSlayerMage = false; - godSlayerRanged = false; - godSlayerThrowing = false; - godSlayerSummon = false; + godSlayer = false; + godSlayerDamage = false; + godSlayerMage = false; + godSlayerRanged = false; + godSlayerThrowing = false; + godSlayerSummon = false; godSlayerReflect = false; godSlayerCooldown = false; silvaSet = false; - silvaMelee = false; - silvaRanged = false; - silvaThrowing = false; - silvaMage = false; - silvaSummon = false; + silvaMelee = false; + silvaRanged = false; + silvaThrowing = false; + silvaMage = false; + silvaSummon = false; auricSet = false; - auricBoost = false; + auricBoost = false; - omegaBlueChestplate = false; - omegaBlueSet = false; - omegaBlueHentai = false; + omegaBlueChestplate = false; + omegaBlueSet = false; + omegaBlueHentai = false; - ataxiaBolt = false; + molluskSet = false; + + ataxiaBolt = false; ataxiaGeyser = false; - ataxiaFire = false; - ataxiaVolley = false; - ataxiaBlaze = false; - ataxiaMage = false; + ataxiaFire = false; + ataxiaVolley = false; + ataxiaBlaze = false; + ataxiaMage = false; + + shadeRegen = false; - shadeRegen = false; - flamethrowerBoost = false; shadowSpeed = false; - dsSetBonus = false; + dsSetBonus = false; - badgeOfBravery = false; - aSpark = false; + rBrain = false; + bloodyWormTooth = false; + rampartOfDeities = false; + vexation = false; + fBulwark = false; + badgeOfBravery = false; + aSpark = false; aBulwark = false; dAmulet = false; fCarapace = false; @@ -1103,92 +1164,95 @@ namespace CalamityMod projRef = false; nanotech = false; eQuiver = false; - cryogenSoul = false; - yInsignia = false; - eGauntlet = false; - eTalisman = false; - statisBeltOfCurses = false; - heartOfDarkness = false; - shadowMinions = false; - tearMinions = false; - alchFlask = false; - community = false; - stressPills = false; - laudanum = false; - fleshTotem = false; - bloodPact = false; - bloodflareCore = false; - coreOfTheBloodGod = false; - elementalHeart = false; - crownJewel = false; - celestialJewel = false; - astralArcanum = false; - harpyRing = false; - darkSunRing = false; - calamityRing = false; - eArtifact = false; - dArtifact = false; - gArtifact = false; - pArtifact = false; - lol = false; - raiderTalisman = false; - sGenerator = false; - sDefense = false; - sRegen = false; - sPower = false; - IBoots = false; - elysianFire = false; - sTracers = false; - eTracers = false; - cTracers = false; + cryogenSoul = false; + yInsignia = false; + eGauntlet = false; + eTalisman = false; + statisBeltOfCurses = false; + heartOfDarkness = false; + shadowMinions = false; + tearMinions = false; + alchFlask = false; + community = false; + stressPills = false; + laudanum = false; + fleshTotem = false; + bloodPact = false; + bloodflareCore = false; + coreOfTheBloodGod = false; + elementalHeart = false; + crownJewel = false; + celestialJewel = false; + astralArcanum = false; + harpyRing = false; + darkSunRing = false; + calamityRing = false; + eArtifact = false; + dArtifact = false; + gArtifact = false; + pArtifact = false; + giantPearl = false; + normalityRelocator = false; + lol = false; + raiderTalisman = false; + sGenerator = false; + sDefense = false; + sRegen = false; + sPower = false; + IBoots = false; + elysianFire = false; + sTracers = false; + eTracers = false; + cTracers = false; - daedalusReflect = false; + daedalusReflect = false; daedalusSplit = false; daedalusAbsorb = false; daedalusShard = false; reaverSpore = false; reaverDoubleTap = false; - reaverBlast = false; - reaverBurst = false; + reaverBlast = false; + reaverBurst = false; - ironBoots = false; - depthCharm = false; - anechoicPlating = false; - jellyfishNecklace = false; - abyssalAmulet = false; - lumenousAmulet = false; - reaperToothNecklace = false; - aquaticEmblem = false; + ironBoots = false; + depthCharm = false; + anechoicPlating = false; + jellyfishNecklace = false; + abyssalAmulet = false; + lumenousAmulet = false; + reaperToothNecklace = false; + aquaticEmblem = false; astralStarRain = false; - - victideSet = false; - aeroSet = false; + victideSet = false; - statigelSet = false; + aeroSet = false; + + statigelSet = false; tarraSet = false; - tarraMelee = false; - tarraMage = false; - tarraRanged = false; - tarraThrowing = false; - tarraSummon = false; + tarraMelee = false; + tarraMage = false; + tarraRanged = false; + tarraThrowing = false; + tarraSummon = false; bloodflareSet = false; - bloodflareMelee = false; - bloodflareRanged = false; - bloodflareThrowing = false; - bloodflareMage = false; - bloodflareSummon = false; + bloodflareMelee = false; + bloodflareRanged = false; + bloodflareThrowing = false; + bloodflareMage = false; + bloodflareSummon = false; xerocSet = false; - NOU = false; - weakPetrification = false; + NOU = false; + weakPetrification = false; - aCrunch = false; + lethalLavaBurn = false; + aCrunch = false; hAttack = false; horror = false; irradiated = false; @@ -1197,21 +1261,22 @@ namespace CalamityMod gsInferno = false; pFlames = false; hFlames = false; - hInferno = false; + hInferno = false; gState = false; bBlood = false; - eGravity = false; - vHex = false; - eGrav = false; - warped = false; - marked = false; - cDepth = false; - fishAlert = false; - bOut = false; - enraged = false; - snowmanNoseless = false; + eGravity = false; + vHex = false; + eGrav = false; + warped = false; + marked = false; + cDepth = false; + fishAlert = false; + bOut = false; + clamity = false; + enraged = false; + snowmanNoseless = false; - rRage = false; + rRage = false; xRage = false; xWrath = false; graxDefense = false; @@ -1220,34 +1285,42 @@ namespace CalamityMod cadence = false; omniscience = false; zerg = false; - zen = false; - permafrostsConcoction = false; - vodka = false; - redWine = false; - grapeBeer = false; - moonshine = false; - rum = false; - whiskey = false; - fireball = false; - everclear = false; - bloodyMary = false; - tequila = false; - caribbeanRum = false; - cinnamonRoll = false; - tequilaSunrise = false; - margarita = false; - starBeamRye = false; - screwdriver = false; - moscowMule = false; - whiteWine = false; - evergreenGin = false; - yPower = false; + zen = false; + permafrostsConcoction = false; + vodka = false; + redWine = false; + grapeBeer = false; + moonshine = false; + rum = false; + whiskey = false; + fireball = false; + everclear = false; + bloodyMary = false; + tequila = false; + caribbeanRum = false; + cinnamonRoll = false; + tequilaSunrise = false; + margarita = false; + starBeamRye = false; + screwdriver = false; + moscowMule = false; + whiteWine = false; + evergreenGin = false; + tranquilityCandle = false; + chaosCandle = false; + purpleCandle = false; + blueCandle = false; + pinkCandle = false; + yellowCandle = false; + trippy = false; + amidiasBlessing = false; + yPower = false; aWeapon = false; tScale = false; fabsolVodka = false; - invincible = false; - shine = false; - anechoicCoating = false; + invincible = false; + shine = false; + anechoicCoating = false; mushy = false; molten = false; shellBoost = false; @@ -1255,14 +1328,14 @@ namespace CalamityMod tRegen = false; mWorm = false; - iClasper = false; - herring = false; - calamari = false; + iClasper = false; + herring = false; + calamari = false; cEyes = false; cSlime = false; cSlime2 = false; bStar = false; - aStar = false; + aStar = false; SP = false; dCreeper = false; bClot = false; @@ -1271,10 +1344,10 @@ namespace CalamityMod aChicken = false; cLamp = false; pGuy = false; - cEnergy = false; - gDefense = false; - gOffense = false; - gHealer = false; + cEnergy = false; + gDefense = false; + gOffense = false; + gHealer = false; sWaifu = false; dWaifu = false; cWaifu = false; @@ -1283,9 +1356,9 @@ namespace CalamityMod fClump = false; rDevil = false; aValkyrie = false; - sCrystal = false; + sCrystal = false; sGod = false; - sandnado = false; + sandnado = false; vUrchin = false; cSpirit = false; rOrb = false; @@ -1295,7 +1368,7 @@ namespace CalamityMod cloudWaifu = false; brimstoneWaifu = false; sirenWaifu = false; - allWaifus = false; + allWaifus = false; fungalClump = false; redDevil = false; valkyrie = false; @@ -1304,38 +1377,44 @@ namespace CalamityMod chaosSpirit = false; reaverOrb = false; daedalusCrystal = false; + shellfish = false; + hCrab = false; - abyssalDivingSuitPrevious = abyssalDivingSuit; - abyssalDivingSuit = abyssalDivingSuitHide = abyssalDivingSuitForce = abyssalDivingSuitPower = false; + abyssalDivingSuitPrevious = abyssalDivingSuit; + abyssalDivingSuit = abyssalDivingSuitHide = abyssalDivingSuitForce = abyssalDivingSuitPower = false; - sirenBoobsPrevious = sirenBoobs; - sirenBoobs = sirenBoobsHide = sirenBoobsForce = sirenBoobsPower = false; - sirenBoobsAltPrevious = sirenBoobsAlt; - sirenBoobsAlt = sirenBoobsAltHide = sirenBoobsAltForce = sirenBoobsAltPower = false; + sirenBoobsPrevious = sirenBoobs; + sirenBoobs = sirenBoobsHide = sirenBoobsForce = sirenBoobsPower = false; + sirenBoobsAltPrevious = sirenBoobsAlt; + sirenBoobsAlt = sirenBoobsAltHide = sirenBoobsAltForce = sirenBoobsAltPower = false; - snowmanPrevious = snowman; - snowman = snowmanHide = snowmanForce = snowmanPower = false; + snowmanPrevious = snowman; + snowman = snowmanHide = snowmanForce = snowmanPower = false; - rageMode = false; - adrenalineMode = false; - } - #endregion + rageMode = false; + adrenalineMode = false; + } + #endregion - #region UpdateDead - public override void UpdateDead() + #region UpdateDead + public override void UpdateDead() { - #region Debuffs - stress = 0; - adrenaline = 0; - adrenalineMaxTimer = 180; - adrenalineDmgDown = 600; - adrenalineDmgMult = 1f; + #region Debuffs + stress = 0; + adrenaline = 0; + adrenalineMaxTimer = 300; + adrenalineDmgDown = 600; + adrenalineDmgMult = 1f; raiderStack = 0; - fleshTotemCooldown = 0; - astralStarRainCooldown = 0; - bloodflareMageCooldown = 0; - tarraMageHealCooldown = 0; - aCrunch = false; + fleshTotemCooldown = 0; + astralStarRainCooldown = 0; + bloodflareMageCooldown = 0; + tarraMageHealCooldown = 0; + ataraxiaDamageBoost = 0f; + ataraxiaDamageBoostCooldown = 0; + ataraxiaDamageBoostCancelTimer = 1200; + lethalLavaBurn = false; + aCrunch = false; hAttack = false; horror = false; irradiated = false; @@ -1344,33 +1423,34 @@ namespace CalamityMod gsInferno = false; pFlames = false; hFlames = false; - hInferno = false; + hInferno = false; gState = false; bBlood = false; eGravity = false; vHex = false; eGrav = false; warped = false; - marked = false; - cDepth = false; - fishAlert = false; - bOut = false; - snowmanNoseless = false; - scarfCooldown = false; + marked = false; + cDepth = false; + fishAlert = false; + bOut = false; + clamity = false; + snowmanNoseless = false; + scarfCooldown = false; godSlayerCooldown = false; - abyssalDivingSuitCooldown = false; - abyssalDivingSuitPlateHits = 0; - sirenIceCooldown = false; - #endregion + abyssalDivingSuitCooldown = false; + abyssalDivingSuitPlateHits = 0; + sirenIceCooldown = false; + #endregion - #region Buffs - sDefense = false; - sRegen = false; - sPower = false; - fab = false; - abyssalDivingSuitPlates = false; - sirenWaterBuff = false; - sirenIce = false; + #region Buffs + sDefense = false; + sRegen = false; + sPower = false; + fab = false; + abyssalDivingSuitPlates = false; + sirenWaterBuff = false; + sirenIce = false; afflictedBuff = false; rRage = false; xRage = false; @@ -1381,70 +1461,80 @@ namespace CalamityMod cadence = false; omniscience = false; zerg = false; - zen = false; + zen = false; yPower = false; aWeapon = false; tScale = false; fabsolVodka = false; - invincible = false; - shine = false; - anechoicCoating = false; + invincible = false; + shine = false; + anechoicCoating = false; mushy = false; molten = false; - enraged = false; + enraged = false; shellBoost = false; cFreeze = false; tRegen = false; - rageMode = false; - adrenalineMode = false; - vodka = false; - redWine = false; - grapeBeer = false; - moonshine = false; - rum = false; - whiskey = false; - fireball = false; - everclear = false; - bloodyMary = false; - tequila = false; - caribbeanRum = false; - cinnamonRoll = false; - tequilaSunrise = false; - margarita = false; - starBeamRye = false; - screwdriver = false; - moscowMule = false; - whiteWine = false; - evergreenGin = false; - revivifyTimer = 0; - healCounter = 300; + rageMode = false; + adrenalineMode = false; + vodka = false; + redWine = false; + grapeBeer = false; + moonshine = false; + rum = false; + whiskey = false; + fireball = false; + everclear = false; + bloodyMary = false; + tequila = false; + caribbeanRum = false; + cinnamonRoll = false; + tequilaSunrise = false; + margarita = false; + starBeamRye = false; + screwdriver = false; + moscowMule = false; + whiteWine = false; + evergreenGin = false; + tranquilityCandle = false; + chaosCandle = false; + purpleCandle = false; + blueCandle = false; + pinkCandle = false; + pinkCandleTimer = 60; + yellowCandle = false; + trippy = false; + amidiasBlessing = false; + revivifyTimer = 0; + healCounter = 300; #endregion - + #region Armorbonuses flamethrowerBoost = false; shadowSpeed = false; godSlayer = false; godSlayerDamage = false; - godSlayerMage = false; - godSlayerRanged = false; - godSlayerThrowing = false; - godSlayerSummon = false; + godSlayerMage = false; + godSlayerRanged = false; + godSlayerThrowing = false; + godSlayerSummon = false; godSlayerReflect = false; auricBoost = false; silvaSet = false; - silvaMelee = false; - silvaRanged = false; - silvaThrowing = false; - silvaMage = false; - silvaSummon = false; - hasSilvaEffect = false; - silvaCountdown = 600; - silvaHitCounter = 0; + silvaMelee = false; + silvaRanged = false; + silvaThrowing = false; + silvaMage = false; + silvaSummon = false; + hasSilvaEffect = false; + silvaCountdown = 600; + silvaHitCounter = 0; auricSet = false; - omegaBlueChestplate = false; - omegaBlueSet = false; - omegaBlueCooldown = 0; - daedalusReflect = false; + omegaBlueChestplate = false; + omegaBlueSet = false; + omegaBlueCooldown = 0; + molluskSet = false; + daedalusReflect = false; daedalusSplit = false; daedalusAbsorb = false; daedalusShard = false; @@ -1461,178 +1551,176 @@ namespace CalamityMod ataxiaFire = false; ataxiaVolley = false; ataxiaBlaze = false; - victideSet = false; - aeroSet = false; - statigelSet = false; + victideSet = false; + aeroSet = false; + statigelSet = false; tarraSet = false; - tarraMelee = false; - tarraMage = false; - tarraRanged = false; - tarraThrowing = false; - tarraThrowingCrits = 0; - tarraThrowingCritTimer = 0; - tarraSummon = false; + tarraMelee = false; + tarraMage = false; + tarraRanged = false; + tarraThrowing = false; + tarraThrowingCrits = 0; + tarraThrowingCritTimer = 0; + tarraSummon = false; bloodflareSet = false; - bloodflareMelee = false; - bloodflareMeleeHits = 0; - bloodflareFrenzyTimer = 0; - bloodflareFrenzyCooldown = 0; - bloodflareRanged = false; - bloodflareRangedCooldown = 0; - bloodflareThrowing = false; - bloodflareMage = false; - bloodflareSummon = false; - bloodflareSummonTimer = 0; + bloodflareMelee = false; + bloodflareMeleeHits = 0; + bloodflareFrenzyTimer = 0; + bloodflareFrenzyCooldown = 0; + bloodflareRanged = false; + bloodflareRangedCooldown = 0; + bloodflareThrowing = false; + bloodflareMage = false; + bloodflareSummon = false; + bloodflareSummonTimer = 0; xerocSet = false; IBoots = false; elysianFire = false; elysianAegis = false; elysianGuard = false; - #endregion + #endregion - if (CalamityWorld.bossRushActive) - { - if (!CalamityGlobalNPC.AnyLivingPlayers()) - { - CalamityWorld.bossRushActive = false; - CalamityWorld.bossRushStage = 0; - if (Main.netMode == 2) - { - NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); - var netMessage = mod.GetPacket(); - netMessage.Write((byte)CalamityModMessageType.BossRushStage); - netMessage.Write(CalamityWorld.bossRushStage); - netMessage.Send(); - } - for (int doom = 0; doom < 200; doom++) - { - if (Main.npc[doom].active && Main.npc[doom].boss) - { - Main.npc[doom].active = false; - Main.npc[doom].netUpdate = true; - } - } - } - } - if (CalamityWorld.armageddon && !areThereAnyDamnBosses) - { - player.respawnTimer -= 5; - } - else if (player.respawnTimer > 300 && Main.expertMode) //600 normal 900 expert - { - player.respawnTimer--; - } - } - #endregion + if (CalamityWorld.bossRushActive) + { + if (!CalamityGlobalNPC.AnyLivingPlayers()) + { + CalamityWorld.bossRushActive = false; + CalamityWorld.bossRushStage = 0; + if (Main.netMode == 2) + { + NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + var netMessage = mod.GetPacket(); + netMessage.Write((byte)CalamityModMessageType.BossRushStage); + netMessage.Write(CalamityWorld.bossRushStage); + netMessage.Send(); + } + for (int doom = 0; doom < 200; doom++) + { + if (Main.npc[doom].active && Main.npc[doom].boss) + { + Main.npc[doom].active = false; + Main.npc[doom].netUpdate = true; + } + } + } + } + if (CalamityWorld.armageddon && !areThereAnyDamnBosses) + { + player.respawnTimer -= 5; + } + else if (player.respawnTimer > 300 && Main.expertMode) //600 normal 900 expert + { + player.respawnTimer--; + } + } + #endregion - #region BiomeStuff - public override void UpdateBiomeVisuals() + #region BiomeStuff + public override void UpdateBiomeVisuals() { - Point point = player.Center.ToTileCoordinates(); - bool aboveGround = point.Y > Main.maxTilesY - 320; - bool overworld = player.ZoneOverworldHeight && (point.X < 380 || point.X > Main.maxTilesX - 380); - bool useNebula = NPC.AnyNPCs(mod.NPCType("DevourerofGodsHead")); + Point point = player.Center.ToTileCoordinates(); + bool aboveGround = point.Y > Main.maxTilesY - 320; + bool overworld = player.ZoneOverworldHeight && (point.X < 380 || point.X > Main.maxTilesX - 380); + bool useNebula = NPC.AnyNPCs(mod.NPCType("DevourerofGodsHead")); player.ManageSpecialBiomeVisuals("CalamityMod:DevourerofGodsHead", useNebula); - bool useNebulaS = NPC.AnyNPCs(mod.NPCType("DevourerofGodsHeadS")); - player.ManageSpecialBiomeVisuals("CalamityMod:DevourerofGodsHeadS", useNebulaS); - bool useBrimstone = NPC.AnyNPCs(mod.NPCType("CalamitasRun3")); + bool useNebulaS = NPC.AnyNPCs(mod.NPCType("DevourerofGodsHeadS")); + player.ManageSpecialBiomeVisuals("CalamityMod:DevourerofGodsHeadS", useNebulaS); + bool useBrimstone = NPC.AnyNPCs(mod.NPCType("CalamitasRun3")); player.ManageSpecialBiomeVisuals("CalamityMod:CalamitasRun3", useBrimstone); bool usePlague = NPC.AnyNPCs(mod.NPCType("PlaguebringerGoliath")); player.ManageSpecialBiomeVisuals("CalamityMod:PlaguebringerGoliath", usePlague); bool useFire = NPC.AnyNPCs(mod.NPCType("Yharon")); player.ManageSpecialBiomeVisuals("CalamityMod:Yharon", useFire); - player.ManageSpecialBiomeVisuals("HeatDistortion", Main.UseHeatDistortion && (useFire || - (aboveGround || ((double)point.Y < Main.worldSurface && player.ZoneDesert && !overworld && !Main.raining && !Filters.Scene["Sandstorm"].IsActive())))); - bool useWater = NPC.AnyNPCs(mod.NPCType("Leviathan")); + player.ManageSpecialBiomeVisuals("HeatDistortion", Main.UseHeatDistortion && (useFire || trippy || + (aboveGround || ((double)point.Y < Main.worldSurface && player.ZoneDesert && !overworld && !Main.raining && !Filters.Scene["Sandstorm"].IsActive())))); + bool useWater = NPC.AnyNPCs(mod.NPCType("Leviathan")); player.ManageSpecialBiomeVisuals("CalamityMod:Leviathan", useWater); bool useHoly = NPC.AnyNPCs(mod.NPCType("Providence")); player.ManageSpecialBiomeVisuals("CalamityMod:Providence", useHoly); bool useSBrimstone = NPC.AnyNPCs(mod.NPCType("SupremeCalamitas")); player.ManageSpecialBiomeVisuals("CalamityMod:SupremeCalamitas", useSBrimstone); - bool inAstral = ZoneAstral; - player.ManageSpecialBiomeVisuals("CalamityMod:Astral", inAstral); - } - + bool inAstral = ZoneAstral; + player.ManageSpecialBiomeVisuals("CalamityMod:Astral", inAstral); + } + public override void UpdateBiomes() - { - Point point = player.Center.ToTileCoordinates(); - ZoneCalamity = CalamityWorld.calamityTiles > 50; - ZoneAstral = CalamityWorld.astralTiles > 950 || (player.ZoneSnow && CalamityWorld.astralTiles > 300); - //ZoneGreatSea = CalamityWorld.seaTiles > 30; + { + Point point = player.Center.ToTileCoordinates(); + ZoneCalamity = CalamityWorld.calamityTiles > 50; + ZoneAstral = !player.ZoneDungeon && (CalamityWorld.astralTiles > 950 || (player.ZoneSnow && CalamityWorld.astralTiles > 300)); - int x = Main.maxTilesX; - int y = Main.maxTilesY; - int genLimit = x / 2; - int abyssChasmSteps = y / 4; - int abyssChasmY = ((y - abyssChasmSteps) + (int)((double)y * 0.055)); //132 = 1932 large - if (y < 1500) - { - abyssChasmY = ((y - abyssChasmSteps) + (int)((double)y * 0.095)); //114 = 1014 small - } - else if (y < 2100) - { - abyssChasmY = ((y - abyssChasmSteps) + (int)((double)y * 0.0735)); //132 = 1482 medium - } - int abyssChasmX = (CalamityWorld.abyssSide ? genLimit - (genLimit - 135) : genLimit + (genLimit - 135)); + bool inSunkenSea = false; + int playerPosX = (int)player.Center.X / 16; + int playerPosY = (int)player.Center.Y / 16; + Tile tile = Framing.GetTileSafely(playerPosX, playerPosY); + if (tile.wall == mod.WallType("EutrophicSandWall") || tile.wall == mod.WallType("NavystoneWall")) + { + inSunkenSea = true; + } + ZoneSunkenSea = CalamityWorld.sunkenSeaTiles > 300 || inSunkenSea; - bool abyssPosX = false; - bool sulphurPosX = false; - bool abyssPosY = (point.Y <= abyssChasmY); - if (CalamityWorld.abyssSide) - { - if (point.X < 380) - { - sulphurPosX = true; - } - if (point.X < abyssChasmX + 80) - { - abyssPosX = true; - } - } - else - { - if (point.X > Main.maxTilesX - 380) - { - sulphurPosX = true; - } - if (point.X > abyssChasmX - 80) - { - abyssPosX = true; - } - } + int x = Main.maxTilesX; + int y = Main.maxTilesY; + int genLimit = x / 2; + int abyssChasmY = y - 250; + int abyssChasmX = (CalamityWorld.abyssSide ? genLimit - (genLimit - 135) : genLimit + (genLimit - 135)); - //0.4 is the lowest location the rocklayer can be, 0.3 is the highest - ZoneAbyss = (((double)point.Y > ((Main.rockLayer - (double)y * 0.05) /*+ 35*/)) && //rocklayer = (0.4 to 0.3) - 0.04 = 0.36 to 0.26 - !player.lavaWet && - !player.honeyWet && - abyssPosY && - abyssPosX); + bool abyssPosX = false; + bool sulphurPosX = false; + bool abyssPosY = (point.Y <= abyssChasmY); + if (CalamityWorld.abyssSide) + { + if (point.X < 380) + { + sulphurPosX = true; + } + if (point.X < abyssChasmX + 80) + { + abyssPosX = true; + } + } + else + { + if (point.X > Main.maxTilesX - 380) + { + sulphurPosX = true; + } + if (point.X > abyssChasmX - 80) + { + abyssPosX = true; + } + } - ZoneAbyssLayer1 = ZoneAbyss && - (double)point.Y <= (Main.rockLayer + (double)y * 0.03); //(0.36 to 0.26) to (0.436 to 0.336) + ZoneAbyss = (((double)point.Y > (Main.rockLayer - (double)y * 0.05)) && + !player.lavaWet && + !player.honeyWet && + abyssPosY && + abyssPosX); - ZoneAbyssLayer2 = ZoneAbyss && - (double)point.Y > (Main.rockLayer + (double)y * 0.03) && - (double)point.Y <= (Main.rockLayer + (double)y * 0.13); //(0.436 to 0.336) to (0.543 to 0.443) + ZoneAbyssLayer1 = ZoneAbyss && + (double)point.Y <= (Main.rockLayer + (double)y * 0.03); - ZoneAbyssLayer3 = ZoneAbyss && - (double)point.Y > (Main.rockLayer + (double)y * 0.13) && - (double)point.Y <= (Main.rockLayer + (double)y * 0.23); //(0.543 to 0.443) to (0.662 to 0.562) + ZoneAbyssLayer2 = ZoneAbyss && + (double)point.Y > (Main.rockLayer + (double)y * 0.03) && + (double)point.Y <= (Main.rockLayer + (double)y * 0.14); - ZoneAbyssLayer4 = ZoneAbyss && - point.Y <= Main.maxTilesY - 200 && - (double)point.Y > (Main.rockLayer + (double)y * 0.23); //(0.662 to 0.562) to just above underworld + ZoneAbyssLayer3 = ZoneAbyss && + (double)point.Y > (Main.rockLayer + (double)y * 0.14) && + (double)point.Y <= (Main.rockLayer + (double)y * 0.26); + + ZoneAbyssLayer4 = ZoneAbyss && + (double)point.Y > (Main.rockLayer + (double)y * 0.26); + + ZoneSulphur = (CalamityWorld.sulphurTiles > 30 || (player.ZoneOverworldHeight && sulphurPosX)) && !ZoneAbyss; + } - ZoneSulphur = (CalamityWorld.sulphurTiles > 30 || (player.ZoneOverworldHeight && sulphurPosX)) && !ZoneAbyss; - } - public override bool CustomBiomesMatch(Player other) { CalamityPlayer modOther = other.GetModPlayer(mod); - return ZoneCalamity == modOther.ZoneCalamity || ZoneAstral == modOther.ZoneAstral || ZoneAbyss == modOther.ZoneAbyss || - ZoneAbyssLayer1 == modOther.ZoneAbyssLayer1 || ZoneAbyssLayer2 == modOther.ZoneAbyssLayer2 || - ZoneAbyssLayer3 == modOther.ZoneAbyssLayer3 || ZoneAbyssLayer4 == modOther.ZoneAbyssLayer4 || - ZoneSulphur == modOther.ZoneSulphur; + return ZoneCalamity == modOther.ZoneCalamity || ZoneAstral == modOther.ZoneAstral || ZoneAbyss == modOther.ZoneAbyss || + ZoneAbyssLayer1 == modOther.ZoneAbyssLayer1 || ZoneAbyssLayer2 == modOther.ZoneAbyssLayer2 || + ZoneAbyssLayer3 == modOther.ZoneAbyssLayer3 || ZoneAbyssLayer4 == modOther.ZoneAbyssLayer4 || + ZoneSulphur == modOther.ZoneSulphur || ZoneSunkenSea == modOther.ZoneSunkenSea; } public override void CopyCustomBiomesTo(Player other) @@ -1640,26 +1728,32 @@ namespace CalamityMod CalamityPlayer modOther = other.GetModPlayer(mod); modOther.ZoneCalamity = ZoneCalamity; modOther.ZoneAstral = ZoneAstral; - modOther.ZoneSulphur = ZoneSulphur; - modOther.ZoneAbyss = ZoneAbyss; - modOther.ZoneAbyssLayer1 = ZoneAbyssLayer1; - modOther.ZoneAbyssLayer2 = ZoneAbyssLayer2; - modOther.ZoneAbyssLayer3 = ZoneAbyssLayer3; - modOther.ZoneAbyssLayer4 = ZoneAbyssLayer4; - } + modOther.ZoneSulphur = ZoneSulphur; + modOther.ZoneSunkenSea = ZoneSunkenSea; + modOther.ZoneAbyss = ZoneAbyss; + modOther.ZoneAbyssLayer1 = ZoneAbyssLayer1; + modOther.ZoneAbyssLayer2 = ZoneAbyssLayer2; + modOther.ZoneAbyssLayer3 = ZoneAbyssLayer3; + modOther.ZoneAbyssLayer4 = ZoneAbyssLayer4; + } public override void SendCustomBiomes(BinaryWriter writer) { BitsByte flags = new BitsByte(); flags[0] = ZoneCalamity; flags[1] = ZoneAstral; - flags[2] = ZoneAbyss; - flags[3] = ZoneAbyssLayer1; - flags[4] = ZoneAbyssLayer2; - flags[5] = ZoneAbyssLayer3; - flags[6] = ZoneAbyssLayer4; - flags[7] = ZoneSulphur; + flags[2] = ZoneAbyss; + flags[3] = ZoneAbyssLayer1; + flags[4] = ZoneAbyssLayer2; + flags[5] = ZoneAbyssLayer3; + flags[6] = ZoneAbyssLayer4; + flags[7] = ZoneSulphur; + + BitsByte flags2 = new BitsByte(); + flags2[0] = ZoneSunkenSea; + writer.Write(flags); + writer.Write(flags2); } public override void ReceiveCustomBiomes(BinaryReader reader) @@ -1667,192 +1761,195 @@ namespace CalamityMod BitsByte flags = reader.ReadByte(); ZoneCalamity = flags[0]; ZoneAstral = flags[1]; - ZoneAbyss = flags[2]; - ZoneAbyssLayer1 = flags[3]; - ZoneAbyssLayer2 = flags[4]; - ZoneAbyssLayer3 = flags[5]; - ZoneAbyssLayer4 = flags[6]; - ZoneSulphur = flags[7]; - } + ZoneAbyss = flags[2]; + ZoneAbyssLayer1 = flags[3]; + ZoneAbyssLayer2 = flags[4]; + ZoneAbyssLayer3 = flags[5]; + ZoneAbyssLayer4 = flags[6]; + ZoneSulphur = flags[7]; - public override Texture2D GetMapBackgroundImage() - { - if (ZoneSulphur) - { - return mod.GetTexture("Backgrounds/MapBackgrounds/SulphurBG"); - } - if (ZoneAstral) - { - return mod.GetTexture("Backgrounds/MapBackgrounds/AstralBG"); - } - return null; - } - #endregion - - #region InventoryStartup - public override void SetupStartInventory(IList items, bool mediumcoreDeath) - { - if (!mediumcoreDeath) - { - player.inventory[9].SetDefaults(mod.ItemType("Revenge")); - player.inventory[8].SetDefaults(mod.ItemType("IronHeart")); - player.inventory[7].SetDefaults(mod.ItemType("StarterBag")); - } - } - #endregion + BitsByte flags2 = reader.ReadByte(); + ZoneSunkenSea = flags[0]; + } - #region LifeRegen - public override void UpdateBadLifeRegen() + public override Texture2D GetMapBackgroundImage() { - #region FirstDebuffs - if (bFlames || aFlames) - { - if (player.lifeRegen > 0) - { - player.lifeRegen = 0; - } - player.lifeRegenTime = 0; - player.lifeRegen -= 16; - } - if (gsInferno || (ZoneCalamity && player.lavaWet)) - { - if (player.lifeRegen > 0) - { - player.lifeRegen = 0; - } - player.lifeRegenTime = 0; - player.lifeRegen -= 30; - } - if (ZoneSulphur && Collision.DrownCollision(player.position, player.width, player.height, player.gravDir)) - { - player.AddBuff(BuffID.Poisoned, 2, true); - pissWaterBoost++; - if (player.lifeRegen > 0) - { - player.lifeRegen = 0; - } - player.lifeRegenTime = 0; - if (pissWaterBoost > 1800) - { - player.lifeRegen -= 6; - } - else if (pissWaterBoost > 1440) - { - player.lifeRegen -= 4; - } - else if (pissWaterBoost > 1080) - { - player.lifeRegen -= 3; - } - else if (pissWaterBoost > 720) - { - player.lifeRegen -= 2; - } - else if (pissWaterBoost > 360) - { - player.lifeRegen -= 1; - } - } - else - { - pissWaterBoost = 0; - } - if (hFlames) - { - if (player.lifeRegen > 0) - { - player.lifeRegen = 0; - } - player.lifeRegenTime = 0; - player.lifeRegen -= 20; - } - if (pFlames) - { - if (player.lifeRegen > 0) - { - player.lifeRegen = 0; - } - player.lifeRegenTime = 0; - player.lifeRegen -= 20; - player.blind = true; - player.statDefense -= 8; - player.moveSpeed -= 0.15f; - } - if (bBlood) - { - if (player.lifeRegen > 0) - { - player.lifeRegen = 0; - } - player.lifeRegenTime = 0; - player.lifeRegen -= 8; - player.blind = true; - player.statDefense -= 3; - player.moveSpeed += 0.2f; - player.meleeSpeed -= 0.025f; - player.meleeDamage += 0.05f; - player.rangedDamage -= 0.1f; - player.magicDamage -= 0.1f; - } - if (horror) - { - player.blind = true; - player.statDefense -= 15; - player.moveSpeed -= 0.15f; - } - if (aCrunch) - { - player.statDefense /= 3; - player.endurance *= 0.33f; - } - if (vHex) - { - if (player.lifeRegen > 0) - { - player.lifeRegen = 0; - } - player.lifeRegenTime = 0; - player.lifeRegen -= 16; - player.blind = true; - player.statDefense -= 30; - player.moveSpeed -= 0.1f; - player.endurance -= 0.3f; - if (player.wingTimeMax <= 0) - { - player.wingTimeMax = 0; - } - player.wingTimeMax /= 2; - } - if (cDepth) - { - if (player.statDefense > 0) - { - int depthDamage = depthCharm ? 9 : 18; - int subtractDefense = (int)((double)player.statDefense * 0.05); //240 defense = 0 damage taken with depth charm - int calcDepthDamage = depthDamage - subtractDefense; - if (calcDepthDamage < 0) - { - calcDepthDamage = 0; - } - if (player.lifeRegen > 0) - { - player.lifeRegen = 0; - } - player.lifeRegenTime = 0; - player.lifeRegen -= calcDepthDamage; - } - } - #endregion - #region Buffs + if (ZoneSulphur) + { + return mod.GetTexture("Backgrounds/MapBackgrounds/SulphurBG"); + } + if (ZoneAstral) + { + return mod.GetTexture("Backgrounds/MapBackgrounds/AstralBG"); + } + return null; + } + #endregion + + #region InventoryStartup + public override void SetupStartInventory(IList items, bool mediumcoreDeath) + { + if (!mediumcoreDeath) + { + player.inventory[9].SetDefaults(mod.ItemType("Revenge")); + player.inventory[8].SetDefaults(mod.ItemType("IronHeart")); + player.inventory[7].SetDefaults(mod.ItemType("StarterBag")); + } + } + #endregion + + #region LifeRegen + public override void UpdateBadLifeRegen() + { + Point point = player.Center.ToTileCoordinates(); + #region FirstDebuffs + if (bFlames || aFlames) + { + if (player.lifeRegen > 0) + { + player.lifeRegen = 0; + } + player.lifeRegenTime = 0; + player.lifeRegen -= 16; + } + if (gsInferno || (ZoneCalamity && player.lavaWet)) + { + if (player.lifeRegen > 0) + { + player.lifeRegen = 0; + } + player.lifeRegenTime = 0; + player.lifeRegen -= 30; + } + if (ZoneSulphur && Collision.DrownCollision(player.position, player.width, player.height, player.gravDir)) + { + player.AddBuff(BuffID.Poisoned, 2, true); + pissWaterBoost++; + if (player.lifeRegen > 0) + { + player.lifeRegen = 0; + } + player.lifeRegenTime = 0; + if (pissWaterBoost > 1800) + { + player.lifeRegen -= 6; + } + else if (pissWaterBoost > 1440) + { + player.lifeRegen -= 4; + } + else if (pissWaterBoost > 1080) + { + player.lifeRegen -= 3; + } + else if (pissWaterBoost > 720) + { + player.lifeRegen -= 2; + } + else if (pissWaterBoost > 360) + { + player.lifeRegen -= 1; + } + } + else + { + pissWaterBoost = 0; + } + if (hFlames) + { + if (player.lifeRegen > 0) + { + player.lifeRegen = 0; + } + player.lifeRegenTime = 0; + player.lifeRegen -= 20; + } + if (pFlames) + { + if (player.lifeRegen > 0) + { + player.lifeRegen = 0; + } + player.lifeRegenTime = 0; + player.lifeRegen -= 20; + player.blind = true; + player.statDefense -= 8; + player.moveSpeed -= 0.15f; + } + if (bBlood) + { + if (player.lifeRegen > 0) + { + player.lifeRegen = 0; + } + player.lifeRegenTime = 0; + player.lifeRegen -= 8; + player.blind = true; + player.statDefense -= 3; + player.moveSpeed += 0.2f; + player.meleeDamage += 0.05f; + player.rangedDamage -= 0.1f; + player.magicDamage -= 0.1f; + } + if (horror) + { + player.blind = true; + player.statDefense -= 15; + player.moveSpeed -= 0.15f; + } + if (aCrunch) + { + player.statDefense /= 3; + player.endurance *= 0.33f; + } + if (vHex) + { + if (player.lifeRegen > 0) + { + player.lifeRegen = 0; + } + player.lifeRegenTime = 0; + player.lifeRegen -= 16; + player.blind = true; + player.statDefense -= 30; + player.moveSpeed -= 0.1f; + player.endurance -= 0.3f; + if (player.wingTimeMax <= 0) + { + player.wingTimeMax = 0; + } + player.wingTimeMax /= 2; + } + if (cDepth) + { + if (player.statDefense > 0) + { + int depthDamage = depthCharm ? 9 : 18; + int subtractDefense = (int)((double)player.statDefense * 0.05); //240 defense = 0 damage taken with depth charm + int calcDepthDamage = depthDamage - subtractDefense; + if (calcDepthDamage < 0) + { + calcDepthDamage = 0; + } + if (player.lifeRegen > 0) + { + player.lifeRegen = 0; + } + player.lifeRegenTime = 0; + player.lifeRegen -= calcDepthDamage; + } + } + #endregion + #region Buffs if (tRegen) { player.lifeRegen += 10; } - if (sRegen) - { - player.lifeRegen += 2; - } - if (tarraSet) + if (sRegen) + { + player.lifeRegen += 2; + } + if (tarraSet) { player.calmed = (tarraMelee ? false : true); player.lifeMagnet = true; @@ -1895,3483 +1992,3977 @@ namespace CalamityMod { player.moveSpeed += 0.9f; } - if (celestialJewel || astralArcanum) - { - bool lesserEffect = false; - for (int l = 0; l < 22; l++) - { - int hasBuff = player.buffType[l]; - bool shouldAffect = CalamityMod.alcoholList.Contains(hasBuff); - if (shouldAffect) - { - lesserEffect = true; - } - } - if (lesserEffect) - { - player.lifeRegen += 1; - player.statDefense += 20; - } - else - { - if (player.lifeRegen < 0) - { - if (player.lifeRegenTime < 1800) - { - player.lifeRegenTime = 1800; - } - player.lifeRegen += 4; - player.statDefense += 20; - } - else - { - player.lifeRegen += 2; - } - } - } - else if (crownJewel) - { - bool lesserEffect = false; - for (int l = 0; l < 22; l++) - { - int hasBuff = player.buffType[l]; - bool shouldAffect = CalamityMod.alcoholList.Contains(hasBuff); - if (shouldAffect) - { - lesserEffect = true; - } - } - if (lesserEffect) - { - player.statDefense += 10; - } - else - { - if (player.lifeRegen < 0) - { - if (player.lifeRegenTime < 1800) - { - player.lifeRegenTime = 1800; - } - player.lifeRegen += 2; - player.statDefense += 10; - } - else - { - player.lifeRegen += 1; - } - } - } - if (permafrostsConcoction) - { - if (player.statLife < player.statLifeMax2 / 2) - player.lifeRegen++; - if (player.statLife < player.statLifeMax2 / 4) - player.lifeRegen++; - if (player.statLife < player.statLifeMax2 / 10) - player.lifeRegen += 2; - if (player.poisoned || player.onFire || bFlames) - player.lifeRegen += 4; - } - #endregion - #region LastDebuffs - if (omegaBlueChestplate) - { - if (player.lifeRegen > 0) - player.lifeRegen = 0; + if (celestialJewel || astralArcanum) + { + bool lesserEffect = false; + for (int l = 0; l < 22; l++) + { + int hasBuff = player.buffType[l]; + bool shouldAffect = CalamityMod.alcoholList.Contains(hasBuff); + if (shouldAffect) + { + lesserEffect = true; + } + } + if (lesserEffect) + { + player.lifeRegen += 1; + player.statDefense += 20; + } + else + { + if (player.lifeRegen < 0) + { + if (player.lifeRegenTime < 1800) + { + player.lifeRegenTime = 1800; + } + player.lifeRegen += 4; + player.statDefense += 20; + } + else + { + player.lifeRegen += 2; + } + } + } + else if (crownJewel) + { + bool lesserEffect = false; + for (int l = 0; l < 22; l++) + { + int hasBuff = player.buffType[l]; + bool shouldAffect = CalamityMod.alcoholList.Contains(hasBuff); + if (shouldAffect) + { + lesserEffect = true; + } + } + if (lesserEffect) + { + player.statDefense += 10; + } + else + { + if (player.lifeRegen < 0) + { + if (player.lifeRegenTime < 1800) + { + player.lifeRegenTime = 1800; + } + player.lifeRegen += 2; + player.statDefense += 10; + } + else + { + player.lifeRegen += 1; + } + } + } + if (permafrostsConcoction) + { + if (player.statLife < player.statLifeMax2 / 2) + player.lifeRegen++; + if (player.statLife < player.statLifeMax2 / 4) + player.lifeRegen++; + if (player.statLife < player.statLifeMax2 / 10) + player.lifeRegen += 2; + if (player.poisoned || player.onFire || bFlames) + player.lifeRegen += 4; + } + if (CalamityCollision.HotWetCollision(player.position, player.width, player.height) || (ZoneAbyssLayer4 && point.Y > Main.maxTilesY - 300) || ZoneSunkenSea) + { + if (player.lifeRegen < 0) + { + player.lifeRegen += 2; + if (player.lifeRegen > 0) + { + player.lifeRegen = 0; + } + } + player.lifeRegenTime += 1; + player.lifeRegen += 1; + } + #endregion + #region LastDebuffs + if (omegaBlueChestplate) + { + if (player.lifeRegen > 0) + player.lifeRegen = 0; - player.lifeRegenTime = 0; + player.lifeRegenTime = 0; - if (player.lifeRegenCount > 0) - player.lifeRegenCount = 0; - } - if (hInferno) - { - hInfernoBoost++; - if (player.lifeRegen > 0) - { - player.lifeRegen = 0; - } - player.lifeRegenTime = 0; - if (hInfernoBoost > 240) - { - player.lifeRegen -= 192; - } - else if (hInfernoBoost > 180) - { - player.lifeRegen -= 96; - } - else if (hInfernoBoost > 120) - { - player.lifeRegen -= 48; - } - else if (hInfernoBoost > 60) - { - player.lifeRegen -= 24; - } - else if (hInfernoBoost > 0) - { - player.lifeRegen -= 12; - } - } - else - { - hInfernoBoost = 0; - } - if (gState) - { - player.statDefense /= 2; - player.velocity.Y = 0f; - player.velocity.X = 0f; - } - if (eGravity) - { - player.velocity.X *= 0.99f; - if (player.wingTimeMax < 0) - { - player.wingTimeMax = 0; - } - player.wingTimeMax /= 4; - if (player.wingTimeMax > 400) - { - player.wingTimeMax = 100; - } - } - if (eGrav) - { - if (player.wingTimeMax < 0) - { - player.wingTimeMax = 0; - } - player.wingTimeMax /= 3; - if (player.wingTimeMax > 400) - { - player.wingTimeMax = 200; - } - } - if (warped || caribbeanRum) - { - player.velocity.Y *= 1.01f; - } - if (weakPetrification || CalamityWorld.bossRushActive) - { - if (player.mount.Active) - { - player.mount.Dismount(player); - } - } - if (CalamityGlobalNPC.DoGHead > -1) - { - player.velocity.X *= 0.99f; - } - if (silvaCountdown > 0 && hasSilvaEffect && silvaSet) - { - if (player.lifeRegen < 0) - { - player.lifeRegen = 0; - } - } - #endregion - } + if (player.lifeRegenCount > 0) + player.lifeRegenCount = 0; + } + if (Main.myPlayer == player.whoAmI) + { + if (Collision.LavaCollision(player.position, player.width, (player.waterWalk ? (player.height - 6) : player.height))) + { + if (player.lavaImmune && !player.immune) + { + if (player.lavaTime > 0) + { + player.lavaTime--; + } + } + if (player.lavaTime <= 0) + { + player.AddBuff(mod.BuffType("LethalLavaBurn"), 2, true); + } + } + } + if (lethalLavaBurn) + { + if (player.lifeRegen > 0) + { + player.lifeRegen = 0; + } + player.lifeRegenTime = 0; + int lifeRegenDown = (player.lavaImmune ? 9 : 18); + if (player.lavaRose) + { + lifeRegenDown = 3; + } + player.lifeRegen -= lifeRegenDown; + } + if (hInferno) + { + hInfernoBoost++; + if (player.lifeRegen > 0) + { + player.lifeRegen = 0; + } + player.lifeRegenTime = 0; + if (hInfernoBoost > 240) + { + player.lifeRegen -= 192; + } + else if (hInfernoBoost > 180) + { + player.lifeRegen -= 96; + } + else if (hInfernoBoost > 120) + { + player.lifeRegen -= 48; + } + else if (hInfernoBoost > 60) + { + player.lifeRegen -= 24; + } + else if (hInfernoBoost > 0) + { + player.lifeRegen -= 12; + } + } + else + { + hInfernoBoost = 0; + } + if (gState) + { + player.statDefense /= 2; + player.velocity.Y = 0f; + player.velocity.X = 0f; + } + if (eGravity) + { + player.velocity.X *= 0.99f; + if (player.wingTimeMax < 0) + { + player.wingTimeMax = 0; + } + player.wingTimeMax /= 4; + if (player.wingTimeMax > 400) + { + player.wingTimeMax = 100; + } + } + if (eGrav) + { + if (player.wingTimeMax < 0) + { + player.wingTimeMax = 0; + } + player.wingTimeMax /= 3; + if (player.wingTimeMax > 400) + { + player.wingTimeMax = 200; + } + } + if ((warped || caribbeanRum) && !player.slowFall) + { + player.velocity.Y *= 1.01f; + } + if (weakPetrification || CalamityWorld.bossRushActive) + { + if (player.mount.Active) + { + player.mount.Dismount(player); + } + } + if (CalamityGlobalNPC.DoGHead > -1) + { + player.velocity.X *= 0.99f; + } + if (silvaCountdown > 0 && hasSilvaEffect && silvaSet) + { + if (player.lifeRegen < 0) + { + player.lifeRegen = 0; + } + } + #endregion + } - #region UpdateLifeRegen - public override void UpdateLifeRegen() + #region UpdateLifeRegen + public override void UpdateLifeRegen() { bool shinyStoned = player.shinyStone; float num2 = 0f; - if (player.lifeRegenTime >= 300) - { - num2 += 1f; - } - if (player.lifeRegenTime >= 600) - { - num2 += 1f; - } - if (player.lifeRegenTime >= 900) - { - num2 += 1f; - } - if (player.lifeRegenTime >= 1200) - { - num2 += 1f; - } - if (player.lifeRegenTime >= 1500) - { - num2 += 1f; - } - if (player.lifeRegenTime >= 1800) - { - num2 += 1f; - } - if (player.lifeRegenTime >= 2400) - { - num2 += 1f; - } - if (player.lifeRegenTime >= 3000) - { - num2 += 1f; - } - if (player.lifeRegenTime >= 3600) - { - num2 += 1f; - } - if (player.velocity.X == 0f || player.grappling[0] > 0) - { - num2 *= 1.25f; - } - else - { - num2 *= 0.5f; - } - if (!shinyStoned) - { - if (draedonsHeart && !shadeRegen && !cFreeze && - (double)Math.Abs(player.velocity.X) < 0.05 && (double)Math.Abs(player.velocity.Y) < 0.05 && player.itemAnimation == 0) - { - if (!areThereAnyDamnBosses) - { - if (player.lifeRegen < 0) - { - player.lifeRegen /= 2; - } - if (player.lifeRegenTime > 90 && player.lifeRegenTime < 1800) - { - player.lifeRegenTime = 1800; - } - player.lifeRegenTime += 4; - player.lifeRegen += 4; - float num3 = (float)(player.lifeRegenTime - 3000); - num3 /= 300f; - if (num3 > 0f) - { - if (num3 > 30f) - { - num3 = 30f; - } - num2 += num3; - } - } - else - { - if (player.lifeRegenTime > 90 && player.lifeRegenTime < 360) - { - player.lifeRegenTime = 360; - } - player.lifeRegenTime += 2; - player.lifeRegen += 2; - float num3 = (float)(player.lifeRegenTime - 1800); - num3 /= 180f; - if (num3 > 0f) - { - if (num3 > 5f) - { - num3 = 5f; - } - num2 += num3; - } - } - float num4 = (float)player.statLifeMax2 / 400f * 0.85f + 0.15f; - num2 *= num4; - player.lifeRegen += (int)Math.Round((double)num2); - player.lifeRegenCount += player.lifeRegen; - if (player.lifeRegen > 0 && player.statLife < player.statLifeMax2) - { - player.lifeRegenCount++; - if ((Main.rand.Next(30000) < player.lifeRegenTime || Main.rand.Next(2) == 0)) - { - int num5 = Dust.NewDust(player.position, player.width, player.height, 107, 0f, 0f, 200, default(Color), 1f); - Main.dust[num5].noGravity = true; - Main.dust[num5].velocity *= 0.75f; - Main.dust[num5].fadeIn = 1.3f; - Vector2 vector = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - vector.Normalize(); - vector *= (float)Main.rand.Next(50, 100) * 0.04f; - Main.dust[num5].velocity = vector; - vector.Normalize(); - vector *= 34f; - Main.dust[num5].position = player.Center - vector; - } - } - } - if (shadeRegen && !draedonsHeart && !cFreeze && - (double)Math.Abs(player.velocity.X) < 0.05 && (double)Math.Abs(player.velocity.Y) < 0.05 && player.itemAnimation == 0) - { - if (player.lifeRegen < 0) - { - player.lifeRegen /= 2; - } - if (player.lifeRegenTime > 90 && player.lifeRegenTime < 1800) - { - player.lifeRegenTime = 1800; - } - player.lifeRegenTime += 4; - player.lifeRegen += 4; - float num3 = (float)(player.lifeRegenTime - 3000); - num3 /= 300f; - if (num3 > 0f) - { - if (num3 > 30f) - { - num3 = 30f; - } - num2 += num3; - } - float num4 = (float)player.statLifeMax2 / 400f * 0.85f + 0.15f; - num2 *= num4; - player.lifeRegen += (int)Math.Round((double)num2); - player.lifeRegenCount += player.lifeRegen; - if (player.lifeRegen > 0 && player.statLife < player.statLifeMax2) - { - player.lifeRegenCount++; - if ((Main.rand.Next(30000) < player.lifeRegenTime || Main.rand.Next(30) == 0)) - { - int num5 = Dust.NewDust(player.position, player.width, player.height, 173, 0f, 0f, 200, default(Color), 1f); - Main.dust[num5].noGravity = true; - Main.dust[num5].velocity *= 0.75f; - Main.dust[num5].fadeIn = 1.3f; - Vector2 vector = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - vector.Normalize(); - vector *= (float)Main.rand.Next(50, 100) * 0.04f; - Main.dust[num5].velocity = vector; - vector.Normalize(); - vector *= 34f; - Main.dust[num5].position = player.Center - vector; - } - } - } - if (cFreeze && !shadeRegen && !draedonsHeart && - (double)Math.Abs(player.velocity.X) < 0.05 && (double)Math.Abs(player.velocity.Y) < 0.05 && player.itemAnimation == 0) - { - if (player.lifeRegen < 0) - { - player.lifeRegen /= 2; - } - if (player.lifeRegenTime > 90 && player.lifeRegenTime < 1800) - { - player.lifeRegenTime = 1800; - } - player.lifeRegenTime += 4; - player.lifeRegen += 4; - float num3 = (float)(player.lifeRegenTime - 3000); - num3 /= 300f; - if (num3 > 0f) - { - if (num3 > 30f) - { - num3 = 30f; - } - num2 += num3; - } - float num4 = (float)player.statLifeMax2 / 400f * 0.85f + 0.15f; - num2 *= num4; - player.lifeRegen += (int)Math.Round((double)num2); - player.lifeRegenCount += player.lifeRegen; - if (player.lifeRegen > 0 && player.statLife < player.statLifeMax2) - { - player.lifeRegenCount++; - if ((Main.rand.Next(30000) < player.lifeRegenTime || Main.rand.Next(30) == 0)) - { - int num5 = Dust.NewDust(player.position, player.width, player.height, 67, 0f, 0f, 200, new Color(150, Main.DiscoG, 255), 0.75f); - Main.dust[num5].noGravity = true; - Main.dust[num5].velocity *= 0.75f; - Main.dust[num5].fadeIn = 1.3f; - Vector2 vector = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - vector.Normalize(); - vector *= (float)Main.rand.Next(50, 100) * 0.04f; - Main.dust[num5].velocity = vector; - vector.Normalize(); - vector *= 34f; - Main.dust[num5].position = player.Center - vector; - } - } - } - } - } - #endregion - #endregion + if (player.lifeRegenTime >= 300) + { + num2 += 1f; + } + if (player.lifeRegenTime >= 600) + { + num2 += 1f; + } + if (player.lifeRegenTime >= 900) + { + num2 += 1f; + } + if (player.lifeRegenTime >= 1200) + { + num2 += 1f; + } + if (player.lifeRegenTime >= 1500) + { + num2 += 1f; + } + if (player.lifeRegenTime >= 1800) + { + num2 += 1f; + } + if (player.lifeRegenTime >= 2400) + { + num2 += 1f; + } + if (player.lifeRegenTime >= 3000) + { + num2 += 1f; + } + if (player.lifeRegenTime >= 3600) + { + num2 += 1f; + } + if (player.velocity.X == 0f || player.grappling[0] > 0) + { + num2 *= 1.25f; + } + else + { + num2 *= 0.5f; + } + if (!shinyStoned) + { + if (draedonsHeart && !shadeRegen && !cFreeze && + (double)Math.Abs(player.velocity.X) < 0.05 && (double)Math.Abs(player.velocity.Y) < 0.05 && player.itemAnimation == 0) + { + if (player.lifeRegen < 0) + { + player.lifeRegen /= 2; + } + if (player.lifeRegenTime > 90 && player.lifeRegenTime < 1800) + { + player.lifeRegenTime = 1800; + } + player.lifeRegenTime += 4; + player.lifeRegen += 4; + float num3 = (float)(player.lifeRegenTime - 3000); + num3 /= 300f; + if (num3 > 0f) + { + if (num3 > 30f) + { + num3 = 30f; + } + num2 += num3; + } + float num4 = (float)player.statLifeMax2 / 400f * 0.85f + 0.15f; + num2 *= num4; + player.lifeRegen += (int)Math.Round((double)num2); + player.lifeRegenCount += player.lifeRegen; + if (player.lifeRegen > 0 && player.statLife < player.statLifeMax2) + { + player.lifeRegenCount++; + if ((Main.rand.Next(30000) < player.lifeRegenTime || Main.rand.Next(2) == 0)) + { + int num5 = Dust.NewDust(player.position, player.width, player.height, 107, 0f, 0f, 200, default(Color), 1f); + Main.dust[num5].noGravity = true; + Main.dust[num5].velocity *= 0.75f; + Main.dust[num5].fadeIn = 1.3f; + Vector2 vector = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + vector.Normalize(); + vector *= (float)Main.rand.Next(50, 100) * 0.04f; + Main.dust[num5].velocity = vector; + vector.Normalize(); + vector *= 34f; + Main.dust[num5].position = player.Center - vector; + } + } + } + if (shadeRegen && !draedonsHeart && !cFreeze && + (double)Math.Abs(player.velocity.X) < 0.05 && (double)Math.Abs(player.velocity.Y) < 0.05 && player.itemAnimation == 0) + { + if (player.lifeRegen < 0) + { + player.lifeRegen /= 2; + } + if (player.lifeRegenTime > 90 && player.lifeRegenTime < 1800) + { + player.lifeRegenTime = 1800; + } + player.lifeRegenTime += 4; + player.lifeRegen += 4; + float num3 = (float)(player.lifeRegenTime - 3000); + num3 /= 300f; + if (num3 > 0f) + { + if (num3 > 30f) + { + num3 = 30f; + } + num2 += num3; + } + float num4 = (float)player.statLifeMax2 / 400f * 0.85f + 0.15f; + num2 *= num4; + player.lifeRegen += (int)Math.Round((double)num2); + player.lifeRegenCount += player.lifeRegen; + if (player.lifeRegen > 0 && player.statLife < player.statLifeMax2) + { + player.lifeRegenCount++; + if ((Main.rand.Next(30000) < player.lifeRegenTime || Main.rand.Next(30) == 0)) + { + int num5 = Dust.NewDust(player.position, player.width, player.height, 173, 0f, 0f, 200, default(Color), 1f); + Main.dust[num5].noGravity = true; + Main.dust[num5].velocity *= 0.75f; + Main.dust[num5].fadeIn = 1.3f; + Vector2 vector = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + vector.Normalize(); + vector *= (float)Main.rand.Next(50, 100) * 0.04f; + Main.dust[num5].velocity = vector; + vector.Normalize(); + vector *= 34f; + Main.dust[num5].position = player.Center - vector; + } + } + } + if (cFreeze && !shadeRegen && !draedonsHeart && + (double)Math.Abs(player.velocity.X) < 0.05 && (double)Math.Abs(player.velocity.Y) < 0.05 && player.itemAnimation == 0) + { + if (player.lifeRegen < 0) + { + player.lifeRegen /= 2; + } + if (player.lifeRegenTime > 90 && player.lifeRegenTime < 1800) + { + player.lifeRegenTime = 1800; + } + player.lifeRegenTime += 4; + player.lifeRegen += 4; + float num3 = (float)(player.lifeRegenTime - 3000); + num3 /= 300f; + if (num3 > 0f) + { + if (num3 > 30f) + { + num3 = 30f; + } + num2 += num3; + } + float num4 = (float)player.statLifeMax2 / 400f * 0.85f + 0.15f; + num2 *= num4; + player.lifeRegen += (int)Math.Round((double)num2); + player.lifeRegenCount += player.lifeRegen; + if (player.lifeRegen > 0 && player.statLife < player.statLifeMax2) + { + player.lifeRegenCount++; + if ((Main.rand.Next(30000) < player.lifeRegenTime || Main.rand.Next(30) == 0)) + { + int num5 = Dust.NewDust(player.position, player.width, player.height, 67, 0f, 0f, 200, new Color(150, Main.DiscoG, 255), 0.75f); + Main.dust[num5].noGravity = true; + Main.dust[num5].velocity *= 0.75f; + Main.dust[num5].fadeIn = 1.3f; + Vector2 vector = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + vector.Normalize(); + vector *= (float)Main.rand.Next(50, 100) * 0.04f; + Main.dust[num5].velocity = vector; + vector.Normalize(); + vector *= 34f; + Main.dust[num5].position = player.Center - vector; + } + } + } + } + } + #endregion + #endregion - #region HotKeys - public override void ProcessTriggers(TriggersSet triggersSet) - { - if (CalamityMod.BossBarToggleHotKey.JustPressed) - { - if (drawBossHPBar) - { - drawBossHPBar = false; - } - else - { - drawBossHPBar = true; - } - } - if (CalamityMod.BossBarToggleSmallTextHotKey.JustPressed) - { - if (shouldDrawSmallText) - { - shouldDrawSmallText = false; - } - else - { - shouldDrawSmallText = true; - } - } - if (CalamityMod.TarraHotKey.JustPressed) - { - if (tarraMelee && tarraCooldown <= 0) - { - tarraDefense = true; - } - if (bloodflareRanged && bloodflareRangedCooldown <= 0) - { - bloodflareRangedCooldown = 1800; - Main.PlaySound(29, (int)player.position.X, (int)player.position.Y, 104); - for (int num502 = 0; num502 < 64; num502++) - { - int dust = Dust.NewDust(new Vector2(player.position.X, player.position.Y + 16f), player.width, player.height - 16, 60, 0f, 0f, 0, default(Color), 1f); - Main.dust[dust].velocity *= 3f; - Main.dust[dust].scale *= 1.15f; - } - int num226 = 36; - for (int num227 = 0; num227 < num226; num227++) - { - Vector2 vector6 = Vector2.Normalize(player.velocity) * new Vector2((float)player.width / 2f, (float)player.height) * 0.75f; - vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default(Vector2)) + player.Center; - Vector2 vector7 = vector6 - player.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 60, vector7.X * 1.5f, vector7.Y * 1.5f, 100, default(Color), 1.4f); - Main.dust[num228].noGravity = true; - Main.dust[num228].noLight = true; - Main.dust[num228].velocity = vector7; - } - float spread = 45f * 0.0174f; - double startAngle = Math.Atan2(player.velocity.X, player.velocity.Y) - spread / 2; - double deltaAngle = spread / 8f; - double offsetAngle; - int i; - int damage = 800; - if (player.whoAmI == Main.myPlayer) - { - for (i = 0; i < 8; i++) - { - float ai1 = (Main.rand.NextFloat() + 0.5f); - float randomSpeed = (float)Main.rand.Next(1, 7); - float randomSpeed2 = (float)Main.rand.Next(1, 7); - offsetAngle = (startAngle + deltaAngle * (i + i * i) / 2f) + 32f * i; - Projectile.NewProjectile(player.Center.X, player.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f) + randomSpeed, mod.ProjectileType("BloodflareSoul"), damage, 0f, player.whoAmI, 0f, ai1); - Projectile.NewProjectile(player.Center.X, player.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f) + randomSpeed2, mod.ProjectileType("BloodflareSoul"), damage, 0f, player.whoAmI, 0f, ai1); - } - } - } - if (omegaBlueSet && omegaBlueCooldown <= 0) - { - omegaBlueCooldown = 1800; - Main.PlaySound(29, (int)player.position.X, (int)player.position.Y, 104); - for (int i = 0; i < 66; i++) - { - int d = Dust.NewDust(player.position, player.width, player.height, 20, 0, 0, 100, Color.Transparent, 2.6f); - Main.dust[d].noGravity = true; - Main.dust[d].noLight = true; - Main.dust[d].fadeIn = 1f; - Main.dust[d].velocity *= 6.6f; - } - } - if (dsSetBonus) - { - Main.PlaySound(29, (int)player.position.X, (int)player.position.Y, 104); - for (int num502 = 0; num502 < 36; num502++) - { - int dust = Dust.NewDust(new Vector2(player.position.X, player.position.Y + 16f), player.width, player.height - 16, 235, 0f, 0f, 0, default(Color), 1f); - Main.dust[dust].velocity *= 3f; - Main.dust[dust].scale *= 1.15f; - } - int num226 = 36; - for (int num227 = 0; num227 < num226; num227++) - { - Vector2 vector6 = Vector2.Normalize(player.velocity) * new Vector2((float)player.width / 2f, (float)player.height) * 0.75f; - vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default(Vector2)) + player.Center; - Vector2 vector7 = vector6 - player.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 235, vector7.X * 1.5f, vector7.Y * 1.5f, 100, default(Color), 1.4f); - Main.dust[num228].noGravity = true; - Main.dust[num228].noLight = true; - Main.dust[num228].velocity = vector7; - } - if (player.whoAmI == Main.myPlayer) - { - player.AddBuff(mod.BuffType("Enraged"), 600, false); - } - if (Main.netMode != 1) - { - for (int l = 0; l < 200; l++) - { - NPC nPC = Main.npc[l]; - if (nPC.active && !nPC.friendly && !nPC.dontTakeDamage && Vector2.Distance(player.Center, nPC.Center) <= 3000f) - { - nPC.AddBuff(mod.BuffType("Enraged"), 600, false); - } - } - } - } - } - if (CalamityMod.AstralArcanumUIHotkey.JustPressed && astralArcanum) - { - AstralArcanumUI.Toggle(); - } - if (CalamityMod.AstralTeleportHotKey.JustPressed) - { - if (celestialJewel) - { - if (Main.netMode == 0) - { - player.TeleportationPotion(); - Main.PlaySound(2, (int)player.position.X, (int)player.position.Y, 6); - } - else if (Main.netMode == 1 && player.whoAmI == Main.myPlayer) - { - NetMessage.SendData(73, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); - } - } - } - if (CalamityMod.AegisHotKey.JustPressed) - { - if (elysianAegis && !player.mount.Active) - { - elysianGuard = !elysianGuard; - } - } - if (CalamityMod.RageHotKey.JustPressed) - { - if (stress == stressMax && !rageMode) - { - Main.PlaySound(29, (int)player.position.X, (int)player.position.Y, 104); - for (int num502 = 0; num502 < 64; num502++) - { - int dust = Dust.NewDust(new Vector2(player.position.X, player.position.Y + 16f), player.width, player.height - 16, 235, 0f, 0f, 0, default(Color), 1f); - Main.dust[dust].velocity *= 3f; - Main.dust[dust].scale *= 1.15f; - } - int num226 = 36; - for (int num227 = 0; num227 < num226; num227++) - { - Vector2 vector6 = Vector2.Normalize(player.velocity) * new Vector2((float)player.width / 2f, (float)player.height) * 0.75f; - vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default(Vector2)) + player.Center; - Vector2 vector7 = vector6 - player.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 235, vector7.X * 1.5f, vector7.Y * 1.5f, 100, default(Color), 1.4f); - Main.dust[num228].noGravity = true; - Main.dust[num228].noLight = true; - Main.dust[num228].velocity = vector7; - } - player.AddBuff(mod.BuffType("RageMode"), 300); - } - } - if (CalamityMod.AdrenalineHotKey.JustPressed) - { - if (adrenaline == adrenalineMax && !adrenalineMode) - { - Main.PlaySound(29, (int)player.position.X, (int)player.position.Y, 104); - for (int num502 = 0; num502 < 64; num502++) - { - int dust = Dust.NewDust(new Vector2(player.position.X, player.position.Y + 16f), player.width, player.height - 16, 206, 0f, 0f, 0, default(Color), 1f); - Main.dust[dust].velocity *= 3f; - Main.dust[dust].scale *= 2f; - } - int num226 = 36; - for (int num227 = 0; num227 < num226; num227++) - { - Vector2 vector6 = Vector2.Normalize(player.velocity) * new Vector2((float)player.width / 2f, (float)player.height) * 0.75f; - vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default(Vector2)) + player.Center; - Vector2 vector7 = vector6 - player.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 206, vector7.X * 1.5f, vector7.Y * 1.5f, 100, default(Color), 1.4f); - Main.dust[num228].noGravity = true; - Main.dust[num228].noLight = true; - Main.dust[num228].velocity = vector7; - } - player.AddBuff(mod.BuffType("AdrenalineMode"), 300); - } - } - } - #endregion + #region HotKeys + public override void ProcessTriggers(TriggersSet triggersSet) + { + if (CalamityMod.NormalityRelocatorHotKey.JustPressed && normalityRelocator && Main.myPlayer == player.whoAmI) + { + Vector2 teleportLocation; + teleportLocation.X = (float)Main.mouseX + Main.screenPosition.X; + if (player.gravDir == 1f) + { + teleportLocation.Y = (float)Main.mouseY + Main.screenPosition.Y - (float)player.height; + } + else + { + teleportLocation.Y = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY; + } + teleportLocation.X -= (float)(player.width / 2); + if (teleportLocation.X > 50f && teleportLocation.X < (float)(Main.maxTilesX * 16 - 50) && teleportLocation.Y > 50f && teleportLocation.Y < (float)(Main.maxTilesY * 16 - 50)) + { + int x = (int)(teleportLocation.X / 16f); + int y = (int)(teleportLocation.Y / 16f); + if (!Collision.SolidCollision(teleportLocation, player.width, player.height)) + { + player.Teleport(teleportLocation, 4, 0); + NetMessage.SendData(65, -1, -1, null, 0, (float)player.whoAmI, teleportLocation.X, teleportLocation.Y, 1, 0, 0); + if (player.chaosState) + { + player.statLife -= player.statLifeMax2 / 4; + PlayerDeathReason damageSource = PlayerDeathReason.ByOther(13); + if (Main.rand.Next(2) == 0) + { + damageSource = PlayerDeathReason.ByOther(player.Male ? 14 : 15); + } + if (player.statLife <= 0) + { + player.KillMe(damageSource, 1.0, 0, false); + } + player.lifeRegenCount = 0; + player.lifeRegenTime = 0; + } + player.AddBuff(BuffID.ChaosState, 360, true); + } + } + } + if (CalamityMod.BossBarToggleHotKey.JustPressed) + { + if (drawBossHPBar) + { + drawBossHPBar = false; + } + else + { + drawBossHPBar = true; + } + } + if (CalamityMod.BossBarToggleSmallTextHotKey.JustPressed) + { + if (shouldDrawSmallText) + { + shouldDrawSmallText = false; + } + else + { + shouldDrawSmallText = true; + } + } + if (CalamityMod.TarraHotKey.JustPressed) + { + if (tarraMelee && tarraCooldown <= 0) + { + tarraDefense = true; + } + if (bloodflareRanged && bloodflareRangedCooldown <= 0) + { + bloodflareRangedCooldown = 1800; + Main.PlaySound(29, (int)player.position.X, (int)player.position.Y, 104); + for (int num502 = 0; num502 < 64; num502++) + { + int dust = Dust.NewDust(new Vector2(player.position.X, player.position.Y + 16f), player.width, player.height - 16, 60, 0f, 0f, 0, default(Color), 1f); + Main.dust[dust].velocity *= 3f; + Main.dust[dust].scale *= 1.15f; + } + int num226 = 36; + for (int num227 = 0; num227 < num226; num227++) + { + Vector2 vector6 = Vector2.Normalize(player.velocity) * new Vector2((float)player.width / 2f, (float)player.height) * 0.75f; + vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default(Vector2)) + player.Center; + Vector2 vector7 = vector6 - player.Center; + int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 60, vector7.X * 1.5f, vector7.Y * 1.5f, 100, default(Color), 1.4f); + Main.dust[num228].noGravity = true; + Main.dust[num228].noLight = true; + Main.dust[num228].velocity = vector7; + } + float spread = 45f * 0.0174f; + double startAngle = Math.Atan2(player.velocity.X, player.velocity.Y) - spread / 2; + double deltaAngle = spread / 8f; + double offsetAngle; + int i; + int damage = 800; + if (player.whoAmI == Main.myPlayer) + { + for (i = 0; i < 8; i++) + { + float ai1 = (Main.rand.NextFloat() + 0.5f); + float randomSpeed = (float)Main.rand.Next(1, 7); + float randomSpeed2 = (float)Main.rand.Next(1, 7); + offsetAngle = (startAngle + deltaAngle * (i + i * i) / 2f) + 32f * i; + Projectile.NewProjectile(player.Center.X, player.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f) + randomSpeed, mod.ProjectileType("BloodflareSoul"), damage, 0f, player.whoAmI, 0f, ai1); + Projectile.NewProjectile(player.Center.X, player.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f) + randomSpeed2, mod.ProjectileType("BloodflareSoul"), damage, 0f, player.whoAmI, 0f, ai1); + } + } + } + if (omegaBlueSet && omegaBlueCooldown <= 0) + { + omegaBlueCooldown = 1800; + Main.PlaySound(29, (int)player.position.X, (int)player.position.Y, 104); + for (int i = 0; i < 66; i++) + { + int d = Dust.NewDust(player.position, player.width, player.height, 20, 0, 0, 100, Color.Transparent, 2.6f); + Main.dust[d].noGravity = true; + Main.dust[d].noLight = true; + Main.dust[d].fadeIn = 1f; + Main.dust[d].velocity *= 6.6f; + } + } + if (dsSetBonus) + { + Main.PlaySound(29, (int)player.position.X, (int)player.position.Y, 104); + for (int num502 = 0; num502 < 36; num502++) + { + int dust = Dust.NewDust(new Vector2(player.position.X, player.position.Y + 16f), player.width, player.height - 16, 235, 0f, 0f, 0, default(Color), 1f); + Main.dust[dust].velocity *= 3f; + Main.dust[dust].scale *= 1.15f; + } + int num226 = 36; + for (int num227 = 0; num227 < num226; num227++) + { + Vector2 vector6 = Vector2.Normalize(player.velocity) * new Vector2((float)player.width / 2f, (float)player.height) * 0.75f; + vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default(Vector2)) + player.Center; + Vector2 vector7 = vector6 - player.Center; + int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 235, vector7.X * 1.5f, vector7.Y * 1.5f, 100, default(Color), 1.4f); + Main.dust[num228].noGravity = true; + Main.dust[num228].noLight = true; + Main.dust[num228].velocity = vector7; + } + if (player.whoAmI == Main.myPlayer) + { + player.AddBuff(mod.BuffType("Enraged"), 600, false); + } + if (Main.netMode != 1) + { + for (int l = 0; l < 200; l++) + { + NPC nPC = Main.npc[l]; + if (nPC.active && !nPC.friendly && !nPC.dontTakeDamage && Vector2.Distance(player.Center, nPC.Center) <= 3000f) + { + nPC.AddBuff(mod.BuffType("Enraged"), 600, false); + } + } + } + } + } + if (CalamityMod.AstralArcanumUIHotkey.JustPressed && astralArcanum) + { + AstralArcanumUI.Toggle(); + } + if (CalamityMod.AstralTeleportHotKey.JustPressed) + { + if (celestialJewel) + { + if (Main.netMode == 0) + { + player.TeleportationPotion(); + Main.PlaySound(2, (int)player.position.X, (int)player.position.Y, 6); + } + else if (Main.netMode == 1 && player.whoAmI == Main.myPlayer) + { + NetMessage.SendData(73, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + } + } + } + if (CalamityMod.AegisHotKey.JustPressed) + { + if (elysianAegis && !player.mount.Active) + { + elysianGuard = !elysianGuard; + } + } + if (CalamityMod.RageHotKey.JustPressed) + { + if (stress == stressMax && !rageMode) + { + Main.PlaySound(29, (int)player.position.X, (int)player.position.Y, 104); + for (int num502 = 0; num502 < 64; num502++) + { + int dust = Dust.NewDust(new Vector2(player.position.X, player.position.Y + 16f), player.width, player.height - 16, 235, 0f, 0f, 0, default(Color), 1f); + Main.dust[dust].velocity *= 3f; + Main.dust[dust].scale *= 1.15f; + } + int num226 = 36; + for (int num227 = 0; num227 < num226; num227++) + { + Vector2 vector6 = Vector2.Normalize(player.velocity) * new Vector2((float)player.width / 2f, (float)player.height) * 0.75f; + vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default(Vector2)) + player.Center; + Vector2 vector7 = vector6 - player.Center; + int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 235, vector7.X * 1.5f, vector7.Y * 1.5f, 100, default(Color), 1.4f); + Main.dust[num228].noGravity = true; + Main.dust[num228].noLight = true; + Main.dust[num228].velocity = vector7; + } + player.AddBuff(mod.BuffType("RageMode"), 300); + } + } + if (CalamityMod.AdrenalineHotKey.JustPressed) + { + if (adrenaline == adrenalineMax && !adrenalineMode) + { + Main.PlaySound(29, (int)player.position.X, (int)player.position.Y, 104); + for (int num502 = 0; num502 < 64; num502++) + { + int dust = Dust.NewDust(new Vector2(player.position.X, player.position.Y + 16f), player.width, player.height - 16, 206, 0f, 0f, 0, default(Color), 1f); + Main.dust[dust].velocity *= 3f; + Main.dust[dust].scale *= 2f; + } + int num226 = 36; + for (int num227 = 0; num227 < num226; num227++) + { + Vector2 vector6 = Vector2.Normalize(player.velocity) * new Vector2((float)player.width / 2f, (float)player.height) * 0.75f; + vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default(Vector2)) + player.Center; + Vector2 vector7 = vector6 - player.Center; + int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 206, vector7.X * 1.5f, vector7.Y * 1.5f, 100, default(Color), 1.4f); + Main.dust[num228].noGravity = true; + Main.dust[num228].noLight = true; + Main.dust[num228].velocity = vector7; + } + player.AddBuff(mod.BuffType("AdrenalineMode"), 300); + } + } + } + #endregion - #region TeleportMethods - public void HandleTeleport(int teleportType, bool forceHandle = false, int whoAmI = 0) - { - bool syncData = forceHandle || Main.netMode == 0; - if (syncData) - { - TeleportPlayer(teleportType, forceHandle, whoAmI); - } - else - { - SyncTeleport(teleportType); - } - } + #region TeleportMethods + public void HandleTeleport(int teleportType, bool forceHandle = false, int whoAmI = 0) + { + bool syncData = forceHandle || Main.netMode == 0; + if (syncData) + { + TeleportPlayer(teleportType, forceHandle, whoAmI); + } + else + { + SyncTeleport(teleportType); + } + } - public static void TeleportPlayer(int teleportType, bool syncData = false, int whoAmI = 0) - { - Player player; - if (!syncData) - { - player = Main.LocalPlayer; - } - else - { - player = Main.player[whoAmI]; - } - switch (teleportType) - { - case 0: UnderworldTeleport(player, syncData); break; - case 1: DungeonTeleport(player, syncData); break; - case 2: JungleTeleport(player, syncData); break; - default: break; - } - } + public static void TeleportPlayer(int teleportType, bool syncData = false, int whoAmI = 0) + { + Player player; + if (!syncData) + { + player = Main.LocalPlayer; + } + else + { + player = Main.player[whoAmI]; + } + switch (teleportType) + { + case 0: UnderworldTeleport(player, syncData); break; + case 1: DungeonTeleport(player, syncData); break; + case 2: JungleTeleport(player, syncData); break; + default: break; + } + } - public void SyncTeleport(int teleportType) - { - ModPacket netMessage = mod.GetPacket(); - netMessage.Write((byte)CalamityModMessageType.TeleportPlayer); - netMessage.Write(teleportType); - netMessage.Send(); - } + public void SyncTeleport(int teleportType) + { + ModPacket netMessage = mod.GetPacket(); + netMessage.Write((byte)CalamityModMessageType.TeleportPlayer); + netMessage.Write(teleportType); + netMessage.Send(); + } - public static void UnderworldTeleport(Player player, bool syncData = false) - { - int teleportStartX = 100; - int teleportRangeX = Main.maxTilesX - 200; - int teleportStartY = Main.maxTilesY - 200; - int teleportRangeY = 50; - bool flag = false; - int num = 0; - int num2 = 0; - int num3 = 0; - int width = player.width; - Vector2 vector = new Vector2((float)num2, (float)num3) * 16f + new Vector2((float)(-(float)width / 2 + 8), (float)(-(float)player.height)); - while (!flag && num < 1000) - { - num++; - num2 = teleportStartX + Main.rand.Next(teleportRangeX); - num3 = teleportStartY + Main.rand.Next(teleportRangeY); - vector = new Vector2((float)num2, (float)num3) * 16f + new Vector2((float)(-(float)width / 2 + 8), (float)(-(float)player.height)); - if (!Collision.SolidCollision(vector, width, player.height)) - { - if (Main.tile[num2, num3] == null) - { - Main.tile[num2, num3] = new Tile(); - } - int i = 0; - while (i < 100) - { - if (Main.tile[num2, num3 + i] == null) - { - Main.tile[num2, num3 + i] = new Tile(); - } - Tile tile = Main.tile[num2, num3 + i]; - vector = new Vector2((float)num2, (float)(num3 + i)) * 16f + new Vector2((float)(-(float)width / 2 + 8), (float)(-(float)player.height)); - Vector4 vector2 = Collision.SlopeCollision(vector, player.velocity, width, player.height, player.gravDir, false); - bool arg_1FF_0 = !Collision.SolidCollision(vector, width, player.height); - if (vector2.Z == player.velocity.X && vector2.Y == player.velocity.Y && vector2.X == vector.X) - { - bool arg_1FE_0 = vector2.Y == vector.Y; - } - if (arg_1FF_0) - { - i++; - } - else - { - if (tile.active() && !tile.inActive() && Main.tileSolid[(int)tile.type]) - { - break; - } - i++; - } - } - if (!Collision.LavaCollision(vector, width, player.height) && Collision.HurtTiles(vector, player.velocity, width, player.height, false).Y <= 0f) - { - Collision.SlopeCollision(vector, player.velocity, width, player.height, player.gravDir, false); - if (Collision.SolidCollision(vector, width, player.height) && i < 99) - { - Vector2 vector3 = Vector2.UnitX * 16f; - if (!(Collision.TileCollision(vector - vector3, vector3, player.width, player.height, false, false, (int)player.gravDir) != vector3)) - { - vector3 = -Vector2.UnitX * 16f; - if (!(Collision.TileCollision(vector - vector3, vector3, player.width, player.height, false, false, (int)player.gravDir) != vector3)) - { - vector3 = Vector2.UnitY * 16f; - if (!(Collision.TileCollision(vector - vector3, vector3, player.width, player.height, false, false, (int)player.gravDir) != vector3)) - { - vector3 = -Vector2.UnitY * 16f; - if (!(Collision.TileCollision(vector - vector3, vector3, player.width, player.height, false, false, (int)player.gravDir) != vector3)) - { - flag = true; - num3 += i; - break; - } - } - } - } - } - } - } - } - if (!flag) - { - return; - } - ModTeleport(player, vector, syncData, false); - } + public static void UnderworldTeleport(Player player, bool syncData = false) + { + int teleportStartX = 100; + int teleportRangeX = Main.maxTilesX - 200; + int teleportStartY = Main.maxTilesY - 200; + int teleportRangeY = 50; + bool flag = false; + int num = 0; + int num2 = 0; + int num3 = 0; + int width = player.width; + Vector2 vector = new Vector2((float)num2, (float)num3) * 16f + new Vector2((float)(-(float)width / 2 + 8), (float)(-(float)player.height)); + while (!flag && num < 1000) + { + num++; + num2 = teleportStartX + Main.rand.Next(teleportRangeX); + num3 = teleportStartY + Main.rand.Next(teleportRangeY); + vector = new Vector2((float)num2, (float)num3) * 16f + new Vector2((float)(-(float)width / 2 + 8), (float)(-(float)player.height)); + if (!Collision.SolidCollision(vector, width, player.height)) + { + if (Main.tile[num2, num3] == null) + { + Main.tile[num2, num3] = new Tile(); + } + int i = 0; + while (i < 100) + { + if (Main.tile[num2, num3 + i] == null) + { + Main.tile[num2, num3 + i] = new Tile(); + } + Tile tile = Main.tile[num2, num3 + i]; + vector = new Vector2((float)num2, (float)(num3 + i)) * 16f + new Vector2((float)(-(float)width / 2 + 8), (float)(-(float)player.height)); + Vector4 vector2 = Collision.SlopeCollision(vector, player.velocity, width, player.height, player.gravDir, false); + bool arg_1FF_0 = !Collision.SolidCollision(vector, width, player.height); + if (vector2.Z == player.velocity.X && vector2.Y == player.velocity.Y && vector2.X == vector.X) + { + bool arg_1FE_0 = vector2.Y == vector.Y; + } + if (arg_1FF_0) + { + i++; + } + else + { + if (tile.active() && !tile.inActive() && Main.tileSolid[(int)tile.type]) + { + break; + } + i++; + } + } + if (!Collision.LavaCollision(vector, width, player.height) && Collision.HurtTiles(vector, player.velocity, width, player.height, false).Y <= 0f) + { + Collision.SlopeCollision(vector, player.velocity, width, player.height, player.gravDir, false); + if (Collision.SolidCollision(vector, width, player.height) && i < 99) + { + Vector2 vector3 = Vector2.UnitX * 16f; + if (!(Collision.TileCollision(vector - vector3, vector3, player.width, player.height, false, false, (int)player.gravDir) != vector3)) + { + vector3 = -Vector2.UnitX * 16f; + if (!(Collision.TileCollision(vector - vector3, vector3, player.width, player.height, false, false, (int)player.gravDir) != vector3)) + { + vector3 = Vector2.UnitY * 16f; + if (!(Collision.TileCollision(vector - vector3, vector3, player.width, player.height, false, false, (int)player.gravDir) != vector3)) + { + vector3 = -Vector2.UnitY * 16f; + if (!(Collision.TileCollision(vector - vector3, vector3, player.width, player.height, false, false, (int)player.gravDir) != vector3)) + { + flag = true; + num3 += i; + break; + } + } + } + } + } + } + } + } + if (!flag) + { + return; + } + ModTeleport(player, vector, syncData, false); + } - public static void DungeonTeleport(Player player, bool syncData = false) - { - ModTeleport(player, new Vector2(Main.dungeonX, Main.dungeonY), syncData, true); - } + public static void DungeonTeleport(Player player, bool syncData = false) + { + ModTeleport(player, new Vector2(Main.dungeonX, Main.dungeonY), syncData, true); + } - public static void JungleTeleport(Player player, bool syncData = false) - { - int jungleSide = CalamityWorld.abyssSide ? ((Main.maxTilesX / 2) + (Main.maxTilesX / 4)) : (Main.maxTilesX / 5); - int teleportStartX = jungleSide; - int teleportRangeX = 200; - int teleportStartY = (int)Main.worldSurface; - int teleportRangeY = 50; - bool flag = false; - int num = 0; - int num2 = 0; - int num3 = 0; - int width = player.width; - Vector2 vector = new Vector2((float)num2, (float)num3) * 16f + new Vector2((float)(-(float)width / 2 + 8), (float)(-(float)player.height)); - while (!flag && num < 1000) - { - num++; - num2 = teleportStartX + Main.rand.Next(teleportRangeX); - num3 = teleportStartY + Main.rand.Next(teleportRangeY); - vector = new Vector2((float)num2, (float)num3) * 16f + new Vector2((float)(-(float)width / 2 + 8), (float)(-(float)player.height)); - if (!Collision.SolidCollision(vector, width, player.height)) - { - if (Main.tile[num2, num3] == null) - { - Main.tile[num2, num3] = new Tile(); - } - int i = 0; - while (i < 100) - { - if (Main.tile[num2, num3 + i] == null) - { - Main.tile[num2, num3 + i] = new Tile(); - } - Tile tile = Main.tile[num2, num3 + i]; - vector = new Vector2((float)num2, (float)(num3 + i)) * 16f + new Vector2((float)(-(float)width / 2 + 8), (float)(-(float)player.height)); - Vector4 vector2 = Collision.SlopeCollision(vector, player.velocity, width, player.height, player.gravDir, false); - bool arg_1FF_0 = !Collision.SolidCollision(vector, width, player.height); - if (vector2.Z == player.velocity.X && vector2.Y == player.velocity.Y && vector2.X == vector.X) - { - bool arg_1FE_0 = vector2.Y == vector.Y; - } - if (arg_1FF_0) - { - i++; - } - else - { - if (tile.active() && !tile.inActive() && Main.tileSolid[(int)tile.type]) - { - break; - } - i++; - } - } - if (!Collision.LavaCollision(vector, width, player.height) && Collision.HurtTiles(vector, player.velocity, width, player.height, false).Y <= 0f) - { - Collision.SlopeCollision(vector, player.velocity, width, player.height, player.gravDir, false); - if (Collision.SolidCollision(vector, width, player.height) && i < 99) - { - Vector2 vector3 = Vector2.UnitX * 16f; - if (!(Collision.TileCollision(vector - vector3, vector3, player.width, player.height, false, false, (int)player.gravDir) != vector3)) - { - vector3 = -Vector2.UnitX * 16f; - if (!(Collision.TileCollision(vector - vector3, vector3, player.width, player.height, false, false, (int)player.gravDir) != vector3)) - { - vector3 = Vector2.UnitY * 16f; - if (!(Collision.TileCollision(vector - vector3, vector3, player.width, player.height, false, false, (int)player.gravDir) != vector3)) - { - vector3 = -Vector2.UnitY * 16f; - if (!(Collision.TileCollision(vector - vector3, vector3, player.width, player.height, false, false, (int)player.gravDir) != vector3)) - { - flag = true; - num3 += i; - break; - } - } - } - } - } - } - } - } - if (!flag) - { - return; - } - ModTeleport(player, vector, syncData, false); - } + public static void JungleTeleport(Player player, bool syncData = false) + { + int jungleSide = CalamityWorld.abyssSide ? ((Main.maxTilesX / 2) + (Main.maxTilesX / 4)) : (Main.maxTilesX / 5); + int teleportStartX = jungleSide; + int teleportRangeX = 200; + int teleportStartY = (int)Main.worldSurface; + int teleportRangeY = 50; + bool flag = false; + int num = 0; + int num2 = 0; + int num3 = 0; + int width = player.width; + Vector2 vector = new Vector2((float)num2, (float)num3) * 16f + new Vector2((float)(-(float)width / 2 + 8), (float)(-(float)player.height)); + while (!flag && num < 1000) + { + num++; + num2 = teleportStartX + Main.rand.Next(teleportRangeX); + num3 = teleportStartY + Main.rand.Next(teleportRangeY); + vector = new Vector2((float)num2, (float)num3) * 16f + new Vector2((float)(-(float)width / 2 + 8), (float)(-(float)player.height)); + if (!Collision.SolidCollision(vector, width, player.height)) + { + if (Main.tile[num2, num3] == null) + { + Main.tile[num2, num3] = new Tile(); + } + int i = 0; + while (i < 100) + { + if (Main.tile[num2, num3 + i] == null) + { + Main.tile[num2, num3 + i] = new Tile(); + } + Tile tile = Main.tile[num2, num3 + i]; + vector = new Vector2((float)num2, (float)(num3 + i)) * 16f + new Vector2((float)(-(float)width / 2 + 8), (float)(-(float)player.height)); + Vector4 vector2 = Collision.SlopeCollision(vector, player.velocity, width, player.height, player.gravDir, false); + bool arg_1FF_0 = !Collision.SolidCollision(vector, width, player.height); + if (vector2.Z == player.velocity.X && vector2.Y == player.velocity.Y && vector2.X == vector.X) + { + bool arg_1FE_0 = vector2.Y == vector.Y; + } + if (arg_1FF_0) + { + i++; + } + else + { + if (tile.active() && !tile.inActive() && Main.tileSolid[(int)tile.type]) + { + break; + } + i++; + } + } + if (!Collision.LavaCollision(vector, width, player.height) && Collision.HurtTiles(vector, player.velocity, width, player.height, false).Y <= 0f) + { + Collision.SlopeCollision(vector, player.velocity, width, player.height, player.gravDir, false); + if (Collision.SolidCollision(vector, width, player.height) && i < 99) + { + Vector2 vector3 = Vector2.UnitX * 16f; + if (!(Collision.TileCollision(vector - vector3, vector3, player.width, player.height, false, false, (int)player.gravDir) != vector3)) + { + vector3 = -Vector2.UnitX * 16f; + if (!(Collision.TileCollision(vector - vector3, vector3, player.width, player.height, false, false, (int)player.gravDir) != vector3)) + { + vector3 = Vector2.UnitY * 16f; + if (!(Collision.TileCollision(vector - vector3, vector3, player.width, player.height, false, false, (int)player.gravDir) != vector3)) + { + vector3 = -Vector2.UnitY * 16f; + if (!(Collision.TileCollision(vector - vector3, vector3, player.width, player.height, false, false, (int)player.gravDir) != vector3)) + { + flag = true; + num3 += i; + break; + } + } + } + } + } + } + } + } + if (!flag) + { + return; + } + ModTeleport(player, vector, syncData, false); + } - public static void ModTeleport(Player player, Vector2 pos, bool syncData = false, bool convertFromTiles = false) - { - bool postImmune = player.immune; - int postImmunteTime = player.immuneTime; - if (convertFromTiles) - { - pos = new Vector2(pos.X * 16 + 8 - player.width / 2, pos.Y * 16 - player.height); - } - player.grappling[0] = -1; - player.grapCount = 0; - for (int index = 0; index < 1000; ++index) - { - if (Main.projectile[index].active && Main.projectile[index].owner == player.whoAmI && Main.projectile[index].aiStyle == 7) - { - Main.projectile[index].Kill(); - } - } - player.Teleport(pos, 2, 0); - player.velocity = Vector2.Zero; - player.immune = postImmune; - player.immuneTime = postImmunteTime; - for (int index = 0; index < 100; ++index) - { - Main.dust[Dust.NewDust(player.position, player.width, player.height, 164, player.velocity.X * 0.2f, player.velocity.Y * 0.2f, 150, Color.Cyan, 1.2f)].velocity *= 0.5f; - } - Main.TeleportEffect(player.getRect(), 1); - Main.TeleportEffect(player.getRect(), 3); - Main.PlaySound(2, (int)player.position.X, (int)player.position.Y, 6); - if (Main.netMode != 2) - { - return; - } - if (syncData) - { - RemoteClient.CheckSection(player.whoAmI, player.position, 1); - NetMessage.SendData(65, -1, -1, null, 0, (float)player.whoAmI, pos.X, pos.Y, 3, 0, 0); - } - } - #endregion + public static void ModTeleport(Player player, Vector2 pos, bool syncData = false, bool convertFromTiles = false) + { + bool postImmune = player.immune; + int postImmunteTime = player.immuneTime; + if (convertFromTiles) + { + pos = new Vector2(pos.X * 16 + 8 - player.width / 2, pos.Y * 16 - player.height); + } + player.grappling[0] = -1; + player.grapCount = 0; + for (int index = 0; index < 1000; ++index) + { + if (Main.projectile[index].active && Main.projectile[index].owner == player.whoAmI && Main.projectile[index].aiStyle == 7) + { + Main.projectile[index].Kill(); + } + } + player.Teleport(pos, 2, 0); + player.velocity = Vector2.Zero; + player.immune = postImmune; + player.immuneTime = postImmunteTime; + for (int index = 0; index < 100; ++index) + { + Main.dust[Dust.NewDust(player.position, player.width, player.height, 164, player.velocity.X * 0.2f, player.velocity.Y * 0.2f, 150, Color.Cyan, 1.2f)].velocity *= 0.5f; + } + Main.TeleportEffect(player.getRect(), 1); + Main.TeleportEffect(player.getRect(), 3); + Main.PlaySound(2, (int)player.position.X, (int)player.position.Y, 6); + if (Main.netMode != 2) + { + return; + } + if (syncData) + { + RemoteClient.CheckSection(player.whoAmI, player.position, 1); + NetMessage.SendData(65, -1, -1, null, 0, (float)player.whoAmI, pos.X, pos.Y, 3, 0, 0); + } + } + #endregion - #region UpdateEquips - public override void UpdateVanityAccessories() - { - for (int n = 13; n < 18 + player.extraAccessorySlots; n++) - { - Item item = player.armor[n]; - if (item.type == mod.ItemType()) - { - snowmanHide = false; - snowmanForce = true; - } - else if (item.type == mod.ItemType()) - { - abyssalDivingSuitHide = false; - abyssalDivingSuitForce = true; - } - else if (item.type == mod.ItemType()) - { - sirenBoobsHide = false; - sirenBoobsForce = true; - } - else if (item.type == mod.ItemType()) - { - sirenBoobsAltHide = false; - sirenBoobsAltForce = true; - } - } - } + #region UpdateEquips + public override void UpdateVanityAccessories() + { + for (int n = 13; n < 18 + player.extraAccessorySlots; n++) + { + Item item = player.armor[n]; + if (item.type == mod.ItemType()) + { + snowmanHide = false; + snowmanForce = true; + } + else if (item.type == mod.ItemType()) + { + abyssalDivingSuitHide = false; + abyssalDivingSuitForce = true; + } + else if (item.type == mod.ItemType()) + { + sirenBoobsHide = false; + sirenBoobsForce = true; + } + else if (item.type == mod.ItemType()) + { + sirenBoobsAltHide = false; + sirenBoobsAltForce = true; + } + } + } - public override void UpdateEquips(ref bool wallSpeedBuff, ref bool tileSpeedBuff, ref bool tileRangeBuff) - { - if (snowman) - { - if (player.whoAmI == Main.myPlayer && !snowmanNoseless) - { - player.AddBuff(mod.BuffType(), 60, true); - } - } - if (abyssalDivingSuit) - { - player.AddBuff(mod.BuffType(), 60, true); - if (player.whoAmI == Main.myPlayer) - { - if (abyssalDivingSuitCooldown) - { - for (int l = 0; l < 22; l++) - { - int hasBuff = player.buffType[l]; - if (player.buffTime[l] < 30 && hasBuff == mod.BuffType("AbyssalDivingSuitPlatesBroken")) - { - abyssalDivingSuitPlateHits = 0; - player.DelBuff(l); - l = -1; - } - } - } - else - { - player.AddBuff(mod.BuffType("AbyssalDivingSuitPlates"), 2); - } - } - } - if (sirenBoobs) - { - player.AddBuff(mod.BuffType(), 60, true); - } - else if (sirenBoobsAlt) - { - player.AddBuff(mod.BuffType(), 60, true); - } - if ((sirenBoobs || sirenBoobsAlt) && NPC.downedBoss3) - { - if (player.whoAmI == Main.myPlayer && !sirenIceCooldown) - { - player.AddBuff(mod.BuffType("IceShieldBuff"), 2); - } - } - } - #endregion + public override void UpdateEquips(ref bool wallSpeedBuff, ref bool tileSpeedBuff, ref bool tileRangeBuff) + { + #region MeleeSpeed + float meleeSpeedMult = 0f; + if (bBlood) + { + meleeSpeedMult += 0.025f; + } + if (rRage) + { + meleeSpeedMult += 0.05f; + } + if (graxDefense) + { + meleeSpeedMult += 0.05f; + } + if (sMeleeBoost) + { + meleeSpeedMult += 0.05f; + } + if (yPower) + { + meleeSpeedMult += 0.05f; + } + if (darkSunRing) + { + meleeSpeedMult += 0.1f; + } + if (badgeOfBravery) + { + meleeSpeedMult += 0.15f; + } + if (eGauntlet) + { + meleeSpeedMult += 0.15f; + } + if (yInsignia) + { + meleeSpeedMult += 0.1f; + } + if (bloodyMary) + { + if (Main.bloodMoon) + { + meleeSpeedMult += 0.15f; + } + } + if (community) + { + float floatTypeBoost = 0.01f + + (NPC.downedSlimeKing ? 0.01f : 0f) + + (NPC.downedBoss1 ? 0.01f : 0f) + + (NPC.downedBoss2 ? 0.01f : 0f) + + (NPC.downedQueenBee ? 0.01f : 0f) + //0.05 + (NPC.downedBoss3 ? 0.01f : 0f) + + (Main.hardMode ? 0.01f : 0f) + + (NPC.downedMechBossAny ? 0.01f : 0f) + + (NPC.downedPlantBoss ? 0.01f : 0f) + + (NPC.downedGolemBoss ? 0.01f : 0f) + //0.1 + (NPC.downedFishron ? 0.01f : 0f) + + (NPC.downedAncientCultist ? 0.01f : 0f) + + (NPC.downedMoonlord ? 0.01f : 0f) + + (CalamityWorld.downedProvidence ? 0.02f : 0f) + //0.15 + (CalamityWorld.downedDoG ? 0.02f : 0f) + //0.17 + (CalamityWorld.downedYharon ? 0.03f : 0f); //0.2 + meleeSpeedMult += (floatTypeBoost * 0.25f); + } + if (meleeLevel >= 12500) + { + meleeSpeedMult += 0.12f; + } + else if (meleeLevel >= 10500) + { + meleeSpeedMult += 0.1f; + } + else if (meleeLevel >= 9100) + { + meleeSpeedMult += 0.09f; + } + else if (meleeLevel >= 7800) + { + meleeSpeedMult += 0.08f; + } + else if (meleeLevel >= 6600) + { + meleeSpeedMult += 0.07f; + } + else if (meleeLevel >= 5500) //hm limit + { + meleeSpeedMult += 0.06f; + } + else if (meleeLevel >= 4500) + { + meleeSpeedMult += 0.05f; + } + else if (meleeLevel >= 3600) + { + meleeSpeedMult += 0.05f; + } + else if (meleeLevel >= 2800) + { + meleeSpeedMult += 0.04f; + } + else if (meleeLevel >= 2100) + { + meleeSpeedMult += 0.03f; + } + else if (meleeLevel >= 1500) //prehm limit + { + meleeSpeedMult += 0.02f; + } + else if (meleeLevel >= 1000) + { + meleeSpeedMult += 0.01f; + } + else if (meleeLevel >= 600) + { + meleeSpeedMult += 0.01f; + } + if (eArtifact) + { + meleeSpeedMult += 0.1f; + } + player.meleeSpeed += meleeSpeedMult; + #endregion - #region PreUpdateBuffs - public override void PreUpdateBuffs() - { - //Remove the mighty wind buff if the player is in the astral desert. - if (player.ZoneDesert && ZoneAstral && player.HasBuff(BuffID.WindPushed)) - { - player.ClearBuff(BuffID.WindPushed); - } - } - #endregion + if (snowman) + { + if (player.whoAmI == Main.myPlayer && !snowmanNoseless) + { + player.AddBuff(mod.BuffType(), 60, true); + } + } + if (abyssalDivingSuit) + { + player.AddBuff(mod.BuffType(), 60, true); + if (player.whoAmI == Main.myPlayer) + { + if (abyssalDivingSuitCooldown) + { + for (int l = 0; l < 22; l++) + { + int hasBuff = player.buffType[l]; + if (player.buffTime[l] < 30 && hasBuff == mod.BuffType("AbyssalDivingSuitPlatesBroken")) + { + abyssalDivingSuitPlateHits = 0; + player.DelBuff(l); + l = -1; + } + } + } + else + { + player.AddBuff(mod.BuffType("AbyssalDivingSuitPlates"), 2); + } + } + } + if (sirenBoobs) + { + player.AddBuff(mod.BuffType(), 60, true); + } + else if (sirenBoobsAlt) + { + player.AddBuff(mod.BuffType(), 60, true); + } + if ((sirenBoobs || sirenBoobsAlt) && NPC.downedBoss3) + { + if (player.whoAmI == Main.myPlayer && !sirenIceCooldown) + { + player.AddBuff(mod.BuffType("IceShieldBuff"), 2); + } + } + } + #endregion + + #region PreUpdateBuffs + public override void PreUpdateBuffs() + { + //Remove the mighty wind buff if the player is in the astral desert. + if (player.ZoneDesert && ZoneAstral && player.HasBuff(BuffID.WindPushed)) + { + player.ClearBuff(BuffID.WindPushed); + } + } + #endregion + + #region PostUpdateEffects + public override void PostUpdateBuffs() + { + if (NOU) + NOULOL(); + + if (CalamityWorld.defiled) + Defiled(); + + if (weakPetrification) + WeakPetrification(); + + if (player.mount.Active || player.mount.Cart) + { + player.dashDelay = 60; + dashMod = 0; + } + + if (silvaCountdown > 0 && hasSilvaEffect && silvaSet) + { + if (player.lifeRegen < 0) + player.lifeRegen = 0; + } + } - #region PostUpdateEffects - public override void PostUpdateBuffs() - { - if (NOU) - NOULOL(); - if (CalamityWorld.defiled) - Defiled(); - if (weakPetrification) - WeakPetrification(); - if (player.mount.Active || player.mount.Cart) - { - player.dashDelay = 60; - dashMod = 0; - } - if (silvaCountdown > 0 && hasSilvaEffect && silvaSet) - { - if (player.lifeRegen < 0) - player.lifeRegen = 0; - } - } - public override void PostUpdateEquips() { - if (NOU) - NOULOL(); - if (CalamityWorld.defiled) - Defiled(); - if (weakPetrification) - WeakPetrification(); - if (player.mount.Active || player.mount.Cart) - { - player.dashDelay = 60; - dashMod = 0; - } - if (silvaCountdown > 0 && hasSilvaEffect && silvaSet) - { - if (player.lifeRegen < 0) - player.lifeRegen = 0; - } - } + if (NOU) + NOULOL(); - private void ExactLevelUp(int levelUpType, int level, bool final) - { - Color messageColor = Color.Orange; - switch (levelUpType) - { - case 0: - exactMeleeLevel = level; - if (shootFireworksLevelUpMelee) - { - string key = (final ? "Mods.CalamityMod.MeleeLevelUpFinal" : "Mods.CalamityMod.MeleeLevelUp"); - shootFireworksLevelUpMelee = false; - if (player.whoAmI == Main.myPlayer) - { - if (final) - { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -5f, ProjectileID.RocketFireworkRed + Main.rand.Next(4), - 0, 0f, Main.myPlayer, 0f, 1f); - } - else - { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -5f, ProjectileID.RocketFireworksBoxRed + Main.rand.Next(4), - 0, 0f, Main.myPlayer, 0f, 0f); - } - } - if (Main.netMode == 0) - { - Main.NewText(Language.GetTextValue(key), messageColor); - } - else if (Main.netMode == 2) - { - NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); - } - } - break; - case 1: - exactRangedLevel = level; - if (shootFireworksLevelUpRanged) - { - string key = (final ? "Mods.CalamityMod.RangedLevelUpFinal" : "Mods.CalamityMod.RangedLevelUp"); - messageColor = Color.GreenYellow; - shootFireworksLevelUpRanged = false; - if (player.whoAmI == Main.myPlayer) - { - if (final) - { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -5f, ProjectileID.RocketFireworkRed + Main.rand.Next(4), - 0, 0f, Main.myPlayer, 0f, 1f); - } - else - { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -5f, ProjectileID.RocketFireworksBoxRed + Main.rand.Next(4), - 0, 0f, Main.myPlayer, 0f, 0f); - } - } - if (Main.netMode == 0) - { - Main.NewText(Language.GetTextValue(key), messageColor); - } - else if (Main.netMode == 2) - { - NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); - } - } - break; - case 2: - exactMagicLevel = level; - if (shootFireworksLevelUpMagic) - { - string key = (final ? "Mods.CalamityMod.MagicLevelUpFinal" : "Mods.CalamityMod.MagicLevelUp"); - messageColor = Color.DodgerBlue; - shootFireworksLevelUpMagic = false; - if (player.whoAmI == Main.myPlayer) - { - if (final) - { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -5f, ProjectileID.RocketFireworkRed + Main.rand.Next(4), - 0, 0f, Main.myPlayer, 0f, 1f); - } - else - { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -5f, ProjectileID.RocketFireworksBoxRed + Main.rand.Next(4), - 0, 0f, Main.myPlayer, 0f, 0f); - } - } - if (Main.netMode == 0) - { - Main.NewText(Language.GetTextValue(key), messageColor); - } - else if (Main.netMode == 2) - { - NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); - } - } - break; - case 3: - exactSummonLevel = level; - if (shootFireworksLevelUpSummon) - { - string key = (final ? "Mods.CalamityMod.SummonLevelUpFinal" : "Mods.CalamityMod.SummonLevelUp"); - messageColor = Color.Aquamarine; - shootFireworksLevelUpSummon = false; - if (player.whoAmI == Main.myPlayer) - { - if (final) - { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -5f, ProjectileID.RocketFireworkRed + Main.rand.Next(4), - 0, 0f, Main.myPlayer, 0f, 1f); - } - else - { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -5f, ProjectileID.RocketFireworksBoxRed + Main.rand.Next(4), - 0, 0f, Main.myPlayer, 0f, 0f); - } - } - if (Main.netMode == 0) - { - Main.NewText(Language.GetTextValue(key), messageColor); - } - else if (Main.netMode == 2) - { - NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); - } - } - break; - case 4: - exactRogueLevel = level; - if (shootFireworksLevelUpRogue) - { - string key = (final ? "Mods.CalamityMod.RogueLevelUpFinal" : "Mods.CalamityMod.RogueLevelUp"); - messageColor = Color.Orchid; - shootFireworksLevelUpRogue = false; - if (player.whoAmI == Main.myPlayer) - { - if (final) - { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -5f, ProjectileID.RocketFireworkRed + Main.rand.Next(4), - 0, 0f, Main.myPlayer, 0f, 1f); - } - else - { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -5f, ProjectileID.RocketFireworksBoxRed + Main.rand.Next(4), - 0, 0f, Main.myPlayer, 0f, 0f); - } - } - if (Main.netMode == 0) - { - Main.NewText(Language.GetTextValue(key), messageColor); - } - else if (Main.netMode == 2) - { - NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); - } - } - break; - } - if (Main.netMode == 1) - { - ExactLevelPacket(false, levelUpType); - } - } + if (CalamityWorld.defiled) + Defiled(); - public override void PostUpdateMiscEffects() - { - Main.expertDebuffTime = 1f; - areThereAnyDamnBosses = CalamityGlobalNPC.AnyBossNPCS(); - #region RevengeanceEffects - if (CalamityWorld.revenge && player.whoAmI == Main.myPlayer) - { - if (player.onHitDodge) - { - for (int l = 0; l < 22; l++) - { - int hasBuff = player.buffType[l]; - if (player.buffTime[l] > 360 && hasBuff == BuffID.ShadowDodge) - { - player.buffTime[l] = 360; - } - } - } - if (player.immuneTime > 120) - { - player.immuneTime = 120; - } - int stressGain = 0; - if (rageMode) - { - stressGain = -2000; - } - else - { - if (draedonsHeart) - { - if (draedonsStressGain) - { - stressGain += 50; - } - } - else if (heartOfDarkness) - { - stressGain += 25; - } - } - stressCD++; - if (stressCD >= 60) - { - stressCD = 0; - stress += stressGain; - if (stress < 0) - { - stress = 0; - } - if (stress >= stressMax) - { - if (playFullRageSound) - { - playFullRageSound = false; - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/FullRage"), (int)player.position.X, (int)player.position.Y); - } - stress = stressMax; - } - else - { - playFullRageSound = true; - } - } - stressLevel500 = stress >= 9800; - if (stressLevel500 && !hAttack) - { - if (Main.rand.Next(10000) == 0) - { - player.AddBuff(mod.BuffType("HeartAttack"), 18000); - } - } - if (adrenaline >= adrenalineMax) - { - adrenalineMaxTimer--; - if (adrenalineMaxTimer <= 0) - { - adrenalineDmgDown--; - if (adrenalineDmgDown < 0) - adrenalineDmgDown = 0; - adrenalineMaxTimer = 0; - } - } - else if (!adrenalineMode && adrenaline <= 0) - { - adrenalineDmgDown = 600; - adrenalineMaxTimer = 180; - adrenalineDmgMult = 1f; - } - adrenalineDmgMult = 0.1f * (float)(adrenalineDmgDown / 60); - if (adrenalineDmgMult < 0.33f) - adrenalineDmgMult = 0.33f; - int adrenalineGain = 0; - if (adrenalineMode) - { - adrenalineGain = (CalamityGlobalNPC.SCal > -1 ? -10000 : -2000); - } - else - { - if (Main.wof >= 0 && player.position.Y < (float)((Main.maxTilesY - 200) * 16)) // > - { - adrenaline = 0; - } - else if (areThereAnyDamnBosses || CalamityWorld.DoGSecondStageCountdown > 0) - { - int adrenalineTickBoost = 0 + - (adrenalineBoostOne ? 63 : 0) + //286 - (adrenalineBoostTwo ? 115 : 0) + //401 - (adrenalineBoostThree ? 100 : 0); //501 - adrenalineGain = 223 + adrenalineTickBoost; //pre-slime god = 45, pre-astrum deus = 35, pre-polterghast = 25, post-polter = 20 - } - else - { - adrenaline = 0; - } - } - adrenalineCD++; - if (adrenalineCD >= (CalamityGlobalNPC.SCal > -1 ? 135 : 60)) - { - adrenalineCD = 0; - adrenaline += adrenalineGain; - if (adrenaline < 0) - { - adrenaline = 0; - } - if (adrenaline >= adrenalineMax) - { - if (playFullAdrenalineSound) - { - playFullAdrenalineSound = false; - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/FullAdrenaline"), (int)player.position.X, (int)player.position.Y); - } - adrenaline = adrenalineMax; - } - else - { - playFullAdrenalineSound = true; - } - } - } - else if (!CalamityWorld.revenge && player.whoAmI == Main.myPlayer) - { - stressCD++; - if (stressCD >= 60) - { - stressCD = 0; - stress += -30; - if (stress < 0) - { - stress = 0; - } - } - adrenalineCD++; - if (adrenalineCD >= 60) - { - adrenalineCD = 0; - adrenaline += -30; - if (adrenaline < 0) - { - adrenaline = 0; - } - } - } - if (player.whoAmI == Main.myPlayer && Main.netMode == 1) - { - packetTimer++; - if (packetTimer == 60) - { - packetTimer = 0; - StressPacket(false); - AdrenalinePacket(false); - } - } - if (CalamityWorld.revenge) - { - if (player.lifeSteal > (CalamityWorld.death ? 30f : 40f)) - { - player.lifeSteal = (CalamityWorld.death ? 30f : 40f); - } - } - #endregion - #region StressTiedEffects - if (stressPills) - { - player.statDefense += 5; - player.meleeDamage += 0.06f; - player.magicDamage += 0.06f; - player.rangedDamage += 0.06f; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.06f; - player.minionDamage += 0.06f; - } - if (laudanum) - { - player.statDefense += 8; - player.meleeDamage += 0.06f; - player.magicDamage += 0.06f; - player.rangedDamage += 0.06f; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.06f; - player.minionDamage += 0.06f; - } - if (!stressLevel500 && player.FindBuffIndex(mod.BuffType("HeartAttack")) > -1) { player.ClearBuff(mod.BuffType("HeartAttack")); } - if (draedonsHeart && (double)Math.Abs(player.velocity.X) < 0.05 && (double)Math.Abs(player.velocity.Y) < 0.05 && player.itemAnimation == 0) - { - player.statDefense += 50; - } - if (hAttack) - { - if (heartOfDarkness || draedonsHeart) - { - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.1f; - player.rangedDamage += 0.1f; - player.meleeDamage += 0.1f; - player.magicDamage += 0.1f; - player.minionDamage += 0.1f; - } - player.statLifeMax2 += player.statLifeMax / 5 / 20 * 5; - } - if (affliction) - { - player.lifeRegen += 1; - player.endurance += CalamityWorld.revenge ? 0.07f : 0.05f; - player.statDefense += CalamityWorld.revenge ? 20 : 15; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += CalamityWorld.revenge ? 0.12f : 0.1f; - player.rangedDamage += CalamityWorld.revenge ? 0.12f : 0.1f; - player.meleeDamage += CalamityWorld.revenge ? 0.12f : 0.1f; - player.magicDamage += CalamityWorld.revenge ? 0.12f : 0.1f; - player.minionDamage += CalamityWorld.revenge ? 0.12f : 0.1f; - player.statLifeMax2 += CalamityWorld.revenge ? (player.statLifeMax / 5 / 20 * 10) : (player.statLifeMax / 5 / 20 * 5); - } - else if (afflicted) - { - player.lifeRegen += 1; - player.endurance += CalamityWorld.revenge ? 0.07f : 0.05f; - player.statDefense += CalamityWorld.revenge ? 20 : 15; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += CalamityWorld.revenge ? 0.12f : 0.1f; - player.rangedDamage += CalamityWorld.revenge ? 0.12f : 0.1f; - player.meleeDamage += CalamityWorld.revenge ? 0.12f : 0.1f; - player.magicDamage += CalamityWorld.revenge ? 0.12f : 0.1f; - player.minionDamage += CalamityWorld.revenge ? 0.12f : 0.1f; - player.statLifeMax2 += CalamityWorld.revenge ? (player.statLifeMax / 5 / 20 * 10) : (player.statLifeMax / 5 / 20 * 5); - } - if (afflictedBuff) { afflicted = true; } - #endregion - #region MaxLifeAndManaBoosts - player.statLifeMax2 += - (mFruit ? 25 : 0) + - (bOrange ? 25 : 0) + - (eBerry ? 25 : 0) + - (dFruit ? 25 : 0); - if (silvaHitCounter > 0) - { - player.statLifeMax2 -= silvaHitCounter * 100; - if (player.statLifeMax2 < 200) - { - player.statLifeMax2 = 200; - } - } - player.statManaMax2 += - (pHeart ? 50 : 0) + - (eCore ? 50 : 0) + - (cShard ? 50 : 0) + - (starBeamRye ? 50 : 0); - if (Main.netMode != 2 && player.whoAmI == Main.myPlayer) - { - Texture2D rain3 = mod.GetTexture("ExtraTextures/Rain3"); - Texture2D rainOriginal = mod.GetTexture("ExtraTextures/RainOriginal"); - Texture2D mana2 = mod.GetTexture("ExtraTextures/Mana2"); - Texture2D mana3 = mod.GetTexture("ExtraTextures/Mana3"); - Texture2D mana4 = mod.GetTexture("ExtraTextures/Mana4"); - Texture2D manaOriginal = mod.GetTexture("ExtraTextures/ManaOriginal"); - Texture2D carpetAuric = mod.GetTexture("ExtraTextures/AuricCarpet"); - Texture2D carpetOriginal = mod.GetTexture("ExtraTextures/Carpet"); - int totalManaBoost = - (pHeart ? 1 : 0) + - (eCore ? 1 : 0) + - (cShard ? 1 : 0); - switch (totalManaBoost) - { - default: - Main.manaTexture = manaOriginal; - break; - case 3: - Main.manaTexture = mana4; - break; - case 2: - Main.manaTexture = mana3; - break; - case 1: - Main.manaTexture = mana2; - break; - } - if (Main.bloodMoon) { Main.rainTexture = rainOriginal; } - else if (Main.raining && ZoneSulphur) { Main.rainTexture = rain3; } - else { Main.rainTexture = rainOriginal; } - if (auricSet) { Main.flyingCarpetTexture = carpetAuric; } - else { Main.flyingCarpetTexture = carpetOriginal; } - } - #endregion - #region MiscEffects - if (gainLevelCooldown > 0) - gainLevelCooldown--; - #region MeleeLevels - switch (meleeLevel) - { - case 100: - ExactLevelUp(0, 1, false); - break; - case 300: - ExactLevelUp(0, 2, false); - break; - case 600: - ExactLevelUp(0, 3, false); - break; - case 1000: - ExactLevelUp(0, 4, false); - break; - case 1500: - ExactLevelUp(0, 5, false); - break; - case 2100: - ExactLevelUp(0, 6, false); - break; - case 2800: - ExactLevelUp(0, 7, false); - break; - case 3600: - ExactLevelUp(0, 8, false); - break; - case 4500: - ExactLevelUp(0, 9, false); - break; - case 5500: - ExactLevelUp(0, 10, false); - break; - case 6600: - ExactLevelUp(0, 11, false); - break; - case 7800: - ExactLevelUp(0, 12, false); - break; - case 9100: - ExactLevelUp(0, 13, false); - break; - case 10500: - ExactLevelUp(0, 14, false); - break; - case 12500: //celebration or some shit for final level, yay - ExactLevelUp(0, 15, true); - break; - default: - break; - } - #endregion - #region RangedLevels - switch (rangedLevel) - { - case 100: - ExactLevelUp(1, 1, false); - break; - case 300: - ExactLevelUp(1, 2, false); - break; - case 600: - ExactLevelUp(1, 3, false); - break; - case 1000: - ExactLevelUp(1, 4, false); - break; - case 1500: - ExactLevelUp(1, 5, false); - break; - case 2100: - ExactLevelUp(1, 6, false); - break; - case 2800: - ExactLevelUp(1, 7, false); - break; - case 3600: - ExactLevelUp(1, 8, false); - break; - case 4500: - ExactLevelUp(1, 9, false); - break; - case 5500: - ExactLevelUp(1, 10, false); - break; - case 6600: - ExactLevelUp(1, 11, false); - break; - case 7800: - ExactLevelUp(1, 12, false); - break; - case 9100: - ExactLevelUp(1, 13, false); - break; - case 10500: - ExactLevelUp(1, 14, false); - break; - case 12500: //celebration or some shit for final level, yay - ExactLevelUp(1, 15, true); - break; - default: - break; - } - #endregion - #region MagicLevels - switch (magicLevel) - { - case 100: - ExactLevelUp(2, 1, false); - break; - case 300: - ExactLevelUp(2, 2, false); - break; - case 600: - ExactLevelUp(2, 3, false); - break; - case 1000: - ExactLevelUp(2, 4, false); - break; - case 1500: - ExactLevelUp(2, 5, false); - break; - case 2100: - ExactLevelUp(2, 6, false); - break; - case 2800: - ExactLevelUp(2, 7, false); - break; - case 3600: - ExactLevelUp(2, 8, false); - break; - case 4500: - ExactLevelUp(2, 9, false); - break; - case 5500: - ExactLevelUp(2, 10, false); - break; - case 6600: - ExactLevelUp(2, 11, false); - break; - case 7800: - ExactLevelUp(2, 12, false); - break; - case 9100: - ExactLevelUp(2, 13, false); - break; - case 10500: - ExactLevelUp(2, 14, false); - break; - case 12500: //celebration or some shit for final level, yay - ExactLevelUp(2, 15, true); - break; - default: - break; - } - #endregion - #region SummonLevels - switch (summonLevel) - { - case 100: - ExactLevelUp(3, 1, false); - break; - case 300: - ExactLevelUp(3, 2, false); - break; - case 600: - ExactLevelUp(3, 3, false); - break; - case 1000: - ExactLevelUp(3, 4, false); - break; - case 1500: - ExactLevelUp(3, 5, false); - break; - case 2100: - ExactLevelUp(3, 6, false); - break; - case 2800: - ExactLevelUp(3, 7, false); - break; - case 3600: - ExactLevelUp(3, 8, false); - break; - case 4500: - ExactLevelUp(3, 9, false); - break; - case 5500: - ExactLevelUp(3, 10, false); - break; - case 6600: - ExactLevelUp(3, 11, false); - break; - case 7800: - ExactLevelUp(3, 12, false); - break; - case 9100: - ExactLevelUp(3, 13, false); - break; - case 10500: - ExactLevelUp(3, 14, false); - break; - case 12500: //celebration or some shit for final level, yay - ExactLevelUp(3, 15, true); - break; - default: - break; - } - #endregion - #region RogueLevels - switch (rogueLevel) - { - case 100: - ExactLevelUp(4, 1, false); - break; - case 300: - ExactLevelUp(4, 2, false); - break; - case 600: - ExactLevelUp(4, 3, false); - break; - case 1000: - ExactLevelUp(4, 4, false); - break; - case 1500: - ExactLevelUp(4, 5, false); - break; - case 2100: - ExactLevelUp(4, 6, false); - break; - case 2800: - ExactLevelUp(4, 7, false); - break; - case 3600: - ExactLevelUp(4, 8, false); - break; - case 4500: - ExactLevelUp(4, 9, false); - break; - case 5500: - ExactLevelUp(4, 10, false); - break; - case 6600: - ExactLevelUp(4, 11, false); - break; - case 7800: - ExactLevelUp(4, 12, false); - break; - case 9100: - ExactLevelUp(4, 13, false); - break; - case 10500: - ExactLevelUp(4, 14, false); - break; - case 12500: //celebration or some shit for final level, yay - ExactLevelUp(4, 15, true); - break; - default: - break; - } - #endregion - if (Main.myPlayer == player.whoAmI) - { - BossHealthBarManager.SHOULD_DRAW_SMALLTEXT_HEALTH = shouldDrawSmallText; - } - if (silvaSet || invincible || margarita) - { - foreach (int debuff in CalamityMod.debuffList) { player.buffImmune[debuff] = true; } - } - if (Main.expertMode && player.ZoneSnow && player.wet && !player.lavaWet && !player.honeyWet && !player.arcticDivingGear) - { - player.buffImmune[BuffID.Chilled] = true; - if (Collision.DrownCollision(player.position, player.width, player.height, player.gravDir)) - { - if (Main.myPlayer == player.whoAmI && !player.gills && !player.merman) - { - if (player.breath > 0) - player.breath--; - } - } - } - if (ZoneAbyss) - { - if (abyssalAmulet) { player.statLifeMax2 += player.statLifeMax2 / 5 / 20 * (lumenousAmulet ? 15 : 10); } - if (Main.myPlayer == player.whoAmI) //4200 total tiles small world - { - int breathLoss = 2; - int lightStrength = 0 + - ((player.lightOrb || player.crimsonHeart || player.magicLantern) ? 1 : 0) + //1 - (player.arcticDivingGear ? 1 : 0) + //2 - (jellyfishNecklace ? 1 : 0) + //3 - ((player.blueFairy || player.greenFairy || player.redFairy || player.petFlagDD2Ghost) ? 2 : 0) + //5 - ((shine || lumenousAmulet) ? 2 : 0) + //7 - ((player.wisp || player.suspiciouslookingTentacle || sirenPet) ? 3 : 0); //10 - bool lightLevelOne = lightStrength > 0; //1+ - bool lightLevelTwo = lightStrength > 2; //3+ - bool lightLevelThree = lightStrength > 4; //5+ - bool lightLevelFour = lightStrength > 6; //7+ - if (ZoneAbyssLayer4) //3200 and below - { - breathLoss = 54; - if (!lightLevelFour) { player.blind = true; } - if (!lightLevelThree) { player.headcovered = true; } - if (!depthCharm) { player.bleed = true; } - player.statDefense -= (anechoicPlating ? 40 : 120); - } - else if (ZoneAbyssLayer3) //2700 to 3200 - { - breathLoss = 18; - if (!lightLevelThree) { player.blind = true; } - if (!lightLevelTwo) { player.headcovered = true; } - if (!depthCharm) { player.bleed = true; } - player.statDefense -= (anechoicPlating ? 20 : 60); - } - else if (ZoneAbyssLayer2) //2100 to 2700 - { - breathLoss = 6; - if (!lightLevelTwo) { player.blind = true; } - if (!depthCharm) { player.bleed = true; } - player.statDefense -= (anechoicPlating ? 10 : 30); - } - else if (ZoneAbyssLayer1) //1500 to 2100 - { - if (!lightLevelOne) { player.blind = true; } - player.statDefense -= (anechoicPlating ? 5 : 15); - } - double breathLossMult = 1.0 - - (player.gills ? 0.2 : 0.0) - //0.8 - (player.accDivingHelm ? 0.25 : 0.0) - //0.75 - (player.arcticDivingGear ? 0.25 : 0.0) - //0.75 - (player.accMerman ? 0.3 : 0.0) - //0.7 - (victideSet ? 0.2 : 0.0) - //0.85 - (((sirenBoobs || sirenBoobsAlt) && NPC.downedBoss3) ? 0.3 : 0.0) - //0.7 - (abyssalDivingSuit ? 0.3 : 0.0); //0.7 - if (breathLossMult < 0.05) { breathLossMult = 0.05; } - breathLoss = (int)((double)breathLoss * breathLossMult); - int tick = 6; - double tickMult = 1.0 + - (player.gills ? 4.0 : 0.0) + //5 - (player.ignoreWater ? 5.0 : 0.0) + //10 - (player.accDivingHelm ? 10.0 : 0.0) + //20 - (player.arcticDivingGear ? 10.0 : 0.0) + //30 - (player.accMerman ? 15.0 : 0.0) + //45 - (victideSet ? 5.0 : 0.0) + //50 - (((sirenBoobs || sirenBoobsAlt) && NPC.downedBoss3) ? 15.0 : 0.0) + //65 - (abyssalDivingSuit ? 15.0 : 0.0); //80 - if (tickMult > 50.0) { tickMult = 50.0; } - tick = (int)((double)tick * tickMult); - abyssBreathCD++; - if (player.gills || player.merman) - { - if (player.breath > 0) - player.breath -= 3; - } - if (!Collision.DrownCollision(player.position, player.width, player.height, player.gravDir)) - { - if (player.statLife > 100) - { - if (player.lifeRegen > 0) - { - player.lifeRegen = 0; - } - player.lifeRegenTime = 0; - player.lifeRegen -= 160; - } - } - if (abyssBreathCD >= tick) - { - abyssBreathCD = 0; - if (player.breath > 0) - player.breath -= breathLoss; - if (cDepth) - { - if (player.breath > 0) - player.breath--; - } - if (player.breath <= 0) - { - int lifeLoss = 6 + - (player.bleed ? 6 : 0) - - (depthCharm ? 3 : 0); - player.statLife -= lifeLoss; - if (player.statLife <= 0) - { - KillPlayer(); - } - } - } - } - } - else - { - abyssBreathCD = 0; - } - if ((Collision.DrownCollision(player.position, player.width, player.height, player.gravDir) && ironBoots) || - (aeroSet && !Collision.DrownCollision(player.position, player.width, player.height, player.gravDir))) - { - player.maxFallSpeed = 15f; - } - if (omegaBlueSet) //should apply after rev caps, actually those are gone so AAAAA - { - //add tentacles - if (player.ownedProjectileCounts[mod.ProjectileType("OmegaBlueTentacle")] < 6) - { - bool[] tentaclesPresent = new bool[6]; - for (int i = 0; i < 1000; i++) - { - Projectile projectile = Main.projectile[i]; - if (projectile.active && projectile.type == mod.ProjectileType("OmegaBlueTentacle") && projectile.owner == Main.myPlayer && projectile.ai[1] >= 0f && projectile.ai[1] < 6f) - { - tentaclesPresent[(int)projectile.ai[1]] = true; - } - } - for (int i = 0; i < 6; i++) - { - if (!tentaclesPresent[i]) - { - float modifier = player.meleeDamage + player.magicDamage + player.rangedDamage + - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage + player.minionDamage; - modifier /= 5f; - int damage = (int)(666 * modifier); - Vector2 vel = new Vector2(Main.rand.Next(-13, 14), Main.rand.Next(-13, 14)) * 0.25f; - Projectile.NewProjectile(player.Center, vel, mod.ProjectileType("OmegaBlueTentacle"), damage, 8f, Main.myPlayer, Main.rand.Next(120), i); - } - } - } - float damageUp = 0.1f; - int critUp = 10; - if (omegaBlueHentai) - { - damageUp *= 2f; - critUp *= 2; - } - player.meleeDamage += damageUp; - player.rangedDamage += damageUp; - player.magicDamage += damageUp; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += damageUp; - player.minionDamage += damageUp; - player.meleeCrit += critUp; - player.rangedCrit += critUp; - player.magicCrit += critUp; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += critUp; - } - if (!bOut) - { - if (gHealer) - { - if (healCounter > 0) { healCounter--; } - if (healCounter <= 0) - { - healCounter = 300; - if (player.whoAmI == Main.myPlayer) - { - int healAmount = 5 + - (gDefense ? 5 : 0) + - (gOffense ? 5 : 0); - player.statLife += healAmount; - player.HealEffect(healAmount); - } - } - } - if (gDefense) - { - player.moveSpeed += 0.1f + - (gOffense ? 0.1f : 0f); - player.endurance += 0.025f + - (gOffense ? 0.025f : 0f); - } - if (gOffense) - { - player.minionDamage += 0.1f + - (gDefense ? 0.05f : 0f); - player.maxMinions++; - } - } - if (revivifyTimer > 0) { revivifyTimer--; } - if (fleshTotemCooldown > 0) { fleshTotemCooldown--; } - if (astralStarRainCooldown > 0) { astralStarRainCooldown--; } - if (bloodflareMageCooldown > 0) { bloodflareMageCooldown--; } - if (tarraMageHealCooldown > 0) { tarraMageHealCooldown--; } - if (ataxiaDmg > 0) { ataxiaDmg--; } - if (xerocDmg > 0) { xerocDmg--; } - if (godSlayerDmg > 0) { godSlayerDmg--; } - if (silvaCountdown > 0 && hasSilvaEffect && silvaSet) - { - player.buffImmune[mod.BuffType("VulnerabilityHex")] = true; - silvaCountdown--; - for (int j = 0; j < 2; j++) - { - int num = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, 157, 0f, 0f, 100, new Color(Main.DiscoR, 203, 103), 2f); - Dust expr_A4_cp_0 = Main.dust[num]; - expr_A4_cp_0.position.X = expr_A4_cp_0.position.X + (float)Main.rand.Next(-20, 21); - Dust expr_CB_cp_0 = Main.dust[num]; - expr_CB_cp_0.position.Y = expr_CB_cp_0.position.Y + (float)Main.rand.Next(-20, 21); - Main.dust[num].velocity *= 0.9f; - Main.dust[num].noGravity = true; - Main.dust[num].scale *= 1f + (float)Main.rand.Next(40) * 0.01f; - Main.dust[num].shader = GameShaders.Armor.GetSecondaryShader(player.cWaist, player); - if (Main.rand.Next(2) == 0) - { - Main.dust[num].scale *= 1f + (float)Main.rand.Next(40) * 0.01f; - } - } - } - if (tarraMelee) - { - if (tarraDefense) - { - tarraDefenseTime--; - if (tarraDefenseTime <= 0) - { - tarraDefenseTime = 600; - tarraCooldown = 1800; - tarraDefense = false; - } - for (int j = 0; j < 2; j++) - { - int num = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, 157, 0f, 0f, 100, new Color(Main.DiscoR, 203, 103), 2f); - Dust expr_A4_cp_0 = Main.dust[num]; - expr_A4_cp_0.position.X = expr_A4_cp_0.position.X + (float)Main.rand.Next(-20, 21); - Dust expr_CB_cp_0 = Main.dust[num]; - expr_CB_cp_0.position.Y = expr_CB_cp_0.position.Y + (float)Main.rand.Next(-20, 21); - Main.dust[num].velocity *= 0.9f; - Main.dust[num].noGravity = true; - Main.dust[num].scale *= 1f + (float)Main.rand.Next(40) * 0.01f; - Main.dust[num].shader = GameShaders.Armor.GetSecondaryShader(player.cWaist, player); - if (Main.rand.Next(2) == 0) - { - Main.dust[num].scale *= 1f + (float)Main.rand.Next(40) * 0.01f; - } - } - } - if (tarraCooldown > 0) { tarraCooldown--; } - } - if (tarraThrowing) - { - if (tarraThrowingCritTimer > 0) { tarraThrowingCritTimer--; } - if (tarraThrowingCrits >= 25) - { - tarraThrowingCrits = 0; - tarraThrowingCritTimer = 1800; - player.immune = true; - player.immuneTime = 300; - } - for (int l = 0; l < 22; l++) - { - int hasBuff = player.buffType[l]; - bool shouldAffect = CalamityMod.debuffList.Contains(hasBuff); - if (shouldAffect) - { - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.1f; - } - } - } - if (bloodflareSet) - { - if (bloodflareHeartTimer > 0) { bloodflareHeartTimer--; } - if (bloodflareManaTimer > 0) { bloodflareManaTimer--; } - } - if (bloodflareMelee) - { - if (bloodflareMeleeHits >= 15) - { - bloodflareMeleeHits = 0; - bloodflareFrenzyTimer = 300; - } - if (bloodflareFrenzyTimer > 0) - { - bloodflareFrenzyTimer--; - if (bloodflareFrenzyTimer <= 0) - { - bloodflareFrenzyCooldown = 1800; - } - player.meleeCrit += 25; - player.meleeDamage += 0.25f; - for (int j = 0; j < 2; j++) - { - int num = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, 5, 0f, 0f, 100, default(Color), 2f); - Dust expr_A4_cp_0 = Main.dust[num]; - expr_A4_cp_0.position.X = expr_A4_cp_0.position.X + (float)Main.rand.Next(-20, 21); - Dust expr_CB_cp_0 = Main.dust[num]; - expr_CB_cp_0.position.Y = expr_CB_cp_0.position.Y + (float)Main.rand.Next(-20, 21); - Main.dust[num].velocity *= 0.9f; - Main.dust[num].noGravity = true; - Main.dust[num].scale *= 1f + (float)Main.rand.Next(40) * 0.01f; - Main.dust[num].shader = GameShaders.Armor.GetSecondaryShader(player.cWaist, player); - if (Main.rand.Next(2) == 0) - { - Main.dust[num].scale *= 1f + (float)Main.rand.Next(40) * 0.01f; - } - } - } - if (bloodflareFrenzyCooldown > 0) { bloodflareFrenzyCooldown--; } - } - if (bloodflareRanged) - { - if (bloodflareRangedCooldown > 0) { bloodflareRangedCooldown--; } - } - if (Main.raining && ZoneSulphur) - { - if (player.ZoneOverworldHeight || player.ZoneSkyHeight) { player.AddBuff(mod.BuffType("Irradiated"), 2); } - } - if (raiderTalisman) { CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += ((float)raiderStack / 250f) * 0.15f; } - if (silvaCountdown <= 0 && hasSilvaEffect && silvaSummon) - { - player.maxMinions += 2; - } - if (sDefense) - { - player.statDefense += 5; - player.endurance += 0.05f; - } - if (absorber) - { - player.moveSpeed += 0.12f; - player.jumpSpeedBoost += 1.2f; - player.statLifeMax2 += 20; - player.thorns = 0.5f; - player.endurance += 0.05f; - if ((double)Math.Abs(player.velocity.X) < 0.05 && (double)Math.Abs(player.velocity.Y) < 0.05 && player.itemAnimation == 0) - { - player.lifeRegen += 2; - player.manaRegenBonus += 2; - } - if (Collision.DrownCollision(player.position, player.width, player.height, player.gravDir)) - { - player.statDefense += 5; - player.endurance += 0.05f; - player.moveSpeed += 0.2f; - } - } - if (coreOfTheBloodGod) { player.statLifeMax2 += player.statLifeMax2 / 5 / 20 * 10; } - if (bloodPact) { player.statLifeMax2 += player.statLifeMax2 / 5 / 20 * 100; } - if (aAmpoule) - { - Lighting.AddLight((int)(player.position.X + (float)(player.width / 2)) / 16, (int)(player.position.Y + (float)(player.height / 2)) / 16, 1f, 1f, 0.6f); - player.endurance += 0.05f; - player.pickSpeed -= 0.5f; - player.buffImmune[70] = true; - player.buffImmune[47] = true; - player.buffImmune[46] = true; - player.buffImmune[44] = true; - player.buffImmune[20] = true; - if (!player.honey && player.lifeRegen < 0) - { - player.lifeRegen += 2; - if (player.lifeRegen > 0) - { - player.lifeRegen = 0; - } - } - player.lifeRegenTime += 1; - player.lifeRegen += 2; - } - else if (cFreeze) - { - Lighting.AddLight((int)(player.Center.X / 16f), (int)(player.Center.Y / 16f), 0.3f, ((float)Main.DiscoG / 400f), 0.5f); - } - else if (sirenIce) - { - Lighting.AddLight((int)(player.position.X + (float)(player.width / 2)) / 16, (int)(player.position.Y + (float)(player.height / 2)) / 16, 0.35f, 1f, 1.25f); - } - else if (sirenBoobs || sirenBoobsAlt) - { - Lighting.AddLight((int)(player.position.X + (float)(player.width / 2)) / 16, (int)(player.position.Y + (float)(player.height / 2)) / 16, 1.5f, 1f, 0.1f); - } - else if (tarraSummon) - { - Lighting.AddLight((int)(player.Center.X / 16f), (int)(player.Center.Y / 16f), 0f, 3f, 0f); - } - if (cFreeze) - { - int num = mod.BuffType("GlacialState"); - float num2 = 200f; - int random = Main.rand.Next(5); - if (player.whoAmI == Main.myPlayer) - { - if (random == 0) - { - for (int l = 0; l < 200; l++) - { - NPC nPC = Main.npc[l]; - if (nPC.active && !nPC.friendly && nPC.damage > 0 && !nPC.dontTakeDamage && !nPC.buffImmune[num] && Vector2.Distance(player.Center, nPC.Center) <= num2) - { - if (nPC.FindBuffIndex(num) == -1) - { - nPC.AddBuff(num, 120, false); - } - } - } - } - } - } - if (invincible || lol) - { - player.thorns = 0f; - player.turtleThorns = false; - } - if (player.vortexStealthActive) - { - player.rangedDamage -= (1f - player.stealth) * 0.4f; //change 80 to 40 - player.rangedCrit -= (int)((1f - player.stealth) * 5f); //change 20 to 15 - } - #endregion - #region StandingStillEffects - if (aquaticEmblem) - { - if (Collision.DrownCollision(player.position, player.width, player.height, player.gravDir) && !player.mount.Active) - { - if (aquaticBoost > 0f) - { - aquaticBoost -= 0.0002f; //0.015 - if ((double)aquaticBoost <= 0.0) - { - aquaticBoost = 0f; - if (Main.netMode == 1) - { - NetMessage.SendData(84, -1, -1, null, player.whoAmI, 0f, 0f, 0f, 0, 0, 0); - } - } - } - } - else - { - aquaticBoost += 0.0002f; - if (aquaticBoost > 1f) - { - aquaticBoost = 1f; - } - if (player.mount.Active) - { - aquaticBoost = 1f; - } - } - player.statDefense += (int)((1f - aquaticBoost) * 40f); - player.moveSpeed -= (1f - aquaticBoost) * 0.15f; - } - if (auricBoost) - { - if (player.itemAnimation > 0) - { - modStealthTimer = 5; - } - if ((double)player.velocity.X > -0.1 && (double)player.velocity.X < 0.1 && (double)player.velocity.Y > -0.1 && (double)player.velocity.Y < 0.1 && !player.mount.Active) - { - if (modStealthTimer == 0 && modStealth > 0f) - { - modStealth -= 0.015f; - if ((double)modStealth <= 0.0) - { - modStealth = 0f; - if (Main.netMode == 1) - { - NetMessage.SendData(84, -1, -1, null, player.whoAmI, 0f, 0f, 0f, 0, 0, 0); - } - } - } - } - else - { - float num27 = Math.Abs(player.velocity.X) + Math.Abs(player.velocity.Y); - modStealth += num27 * 0.0075f; - if (modStealth > 1f) - { - modStealth = 1f; - } - if (player.mount.Active) - { - modStealth = 1f; - } - } - player.meleeDamage += (1f - modStealth) * 0.2f; - player.meleeCrit += (int)((1f - modStealth) * 10f); - player.rangedDamage += (1f - modStealth) * 0.2f; - player.rangedCrit += (int)((1f - modStealth) * 10f); - player.magicDamage += (1f - modStealth) * 0.2f; - player.magicCrit += (int)((1f - modStealth) * 10f); - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += (1f - modStealth) * 0.2f; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += (int)((1f - modStealth) * 10f); - player.minionDamage += (1f - modStealth) * 0.2f; - if (modStealthTimer > 0) - { - modStealthTimer--; - } - } - else if (pAmulet) - { - if (player.itemAnimation > 0) - { - modStealthTimer = 5; - } - if ((double)player.velocity.X > -0.1 && (double)player.velocity.X < 0.1 && (double)player.velocity.Y > -0.1 && (double)player.velocity.Y < 0.1 && !player.mount.Active) - { - if (modStealthTimer == 0 && modStealth > 0f) - { - modStealth -= 0.015f; - if ((double)modStealth <= 0.0) - { - modStealth = 0f; - if (Main.netMode == 1) - { - NetMessage.SendData(84, -1, -1, null, player.whoAmI, 0f, 0f, 0f, 0, 0, 0); - } - } - } - } - else - { - float num27 = Math.Abs(player.velocity.X) + Math.Abs(player.velocity.Y); - modStealth += num27 * 0.0075f; - if (modStealth > 1f) - { - modStealth = 1f; - } - if (player.mount.Active) - { - modStealth = 1f; - } - } - player.meleeDamage += (1f - modStealth) * 0.2f; - player.meleeCrit += (int)((1f - modStealth) * 10f); - player.aggro -= (int)((1f - modStealth) * 750f); - if (modStealthTimer > 0) - { - modStealthTimer--; - } - } - else - { - modStealth = 1f; - } - #endregion - #region ElysianAegis - if (elysianAegis) - { - bool flag14 = false; - if (elysianGuard) - { - float num29 = shieldInvinc; - shieldInvinc -= 0.08f; - if (shieldInvinc < 0f) - { - shieldInvinc = 0f; - } - else - { - flag14 = true; - } - if (shieldInvinc == 0f && num29 != shieldInvinc && Main.netMode == 1) - { - NetMessage.SendData(84, -1, -1, null, player.whoAmI, 0f, 0f, 0f, 0, 0, 0); - } - player.rangedDamage += (5f - shieldInvinc) * 0.02f; - player.rangedCrit += (int)((5f - shieldInvinc) * 2f); - player.meleeDamage += (5f - shieldInvinc) * 0.02f; - player.meleeCrit += (int)((5f - shieldInvinc) * 2f); - player.magicDamage += (5f - shieldInvinc) * 0.02f; - player.magicCrit += (int)((5f - shieldInvinc) * 2f); - player.minionDamage += (5f - shieldInvinc) * 0.02f; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += (5f - shieldInvinc) * 0.02f; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += (int)((5f - shieldInvinc) * 2f); - player.aggro += (int)((5f - shieldInvinc) * 220f); - player.statDefense += (int)((5f - shieldInvinc) * 5f); - player.moveSpeed *= 0.85f; - if (player.mount.Active) - { - elysianGuard = false; - } - } - else - { - float num30 = shieldInvinc; - shieldInvinc += 0.08f; - if (shieldInvinc > 5f) - { - shieldInvinc = 5f; - } - else - { - flag14 = true; - } - if (shieldInvinc == 5f && num30 != shieldInvinc && Main.netMode == 1) - { - NetMessage.SendData(84, -1, -1, null, player.whoAmI, 0f, 0f, 0f, 0, 0, 0); - } - } - if (flag14) - { - if (Main.rand.Next(2) == 0) - { - Vector2 vector = Vector2.UnitY.RotatedByRandom(6.2831854820251465); - Dust dust = Main.dust[Dust.NewDust(player.Center - vector * 30f, 0, 0, 244, 0f, 0f, 0, default(Color), 1f)]; - dust.noGravity = true; - dust.position = player.Center - vector * (float)Main.rand.Next(5, 11); - dust.velocity = vector.RotatedBy(1.5707963705062866, default(Vector2)) * 4f; - dust.scale = 0.5f + Main.rand.NextFloat(); - dust.fadeIn = 0.5f; - } - if (Main.rand.Next(2) == 0) - { - Vector2 vector2 = Vector2.UnitY.RotatedByRandom(6.2831854820251465); - Dust dust2 = Main.dust[Dust.NewDust(player.Center - vector2 * 30f, 0, 0, 246, 0f, 0f, 0, default(Color), 1f)]; - dust2.noGravity = true; - dust2.position = player.Center - vector2 * 12f; - dust2.velocity = vector2.RotatedBy(-1.5707963705062866, default(Vector2)) * 2f; - dust2.scale = 0.5f + Main.rand.NextFloat(); - dust2.fadeIn = 0.5f; - } - } - } - else - { - elysianGuard = false; - } - #endregion - #region SeasonalChecks - if (Main.netMode != 2) - { - if (Main.time == 0.0) - { - runCheck = 0; - } - if (runCheck == 0) - { - CalamityWorld.checkSpring(); - CalamityWorld.checkSummer(); - CalamityWorld.checkFall(); - CalamityWorld.checkWinter(); - runCheck++; - } - } - #endregion - #region OtherBuffs - if (irradiated) - { - player.statDefense -= 10; - player.endurance -= 0.1f; - player.meleeDamage += 0.05f; - player.magicDamage += 0.05f; - player.rangedDamage += 0.05f; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.05f; - player.minionDamage += 0.05f; - player.minionKB += 0.5f; - player.moveSpeed += 0.05f; - } - if (rRage) - { - player.meleeDamage += 0.05f; - player.magicDamage += 0.05f; - player.rangedDamage += 0.05f; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.05f; - player.minionDamage += 0.05f; - player.meleeSpeed -= 0.05f; - player.moveSpeed += 0.05f; - } - if (xRage) - { - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.1f; - player.rangedDamage += 0.1f; - player.meleeDamage += 0.1f; - player.magicDamage += 0.1f; - player.minionDamage += 0.1f; - } - if (xWrath) - { - player.meleeCrit += 5; - player.magicCrit += 5; - player.rangedCrit += 5; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 5; - } - if (godSlayerCooldown) - { - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.1f; - player.rangedDamage += 0.1f; - player.meleeDamage += 0.1f; - player.magicDamage += 0.1f; - player.minionDamage += 0.1f; - } - if (graxDefense) - { - player.statDefense += 15; - player.endurance += 0.05f; - player.meleeSpeed -= 0.05f; - player.meleeDamage += 0.1f; - } - if (sMeleeBoost) - { - player.meleeSpeed -= 0.05f; - player.meleeDamage += 0.1f; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.1f; - player.rangedDamage += 0.1f; - player.magicDamage += 0.1f; - player.minionDamage += 0.1f; - player.meleeCrit += 5; - player.magicCrit += 5; - player.rangedCrit += 5; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 5; - } - if (tFury) - { - player.meleeDamage += 0.3f; - player.meleeCrit += 10; - } - if (yPower) - { - player.endurance += 0.05f; - player.statDefense += 5; - player.meleeCrit += 2; - player.meleeDamage += 0.06f; - player.meleeSpeed -= 0.05f; - player.magicCrit += 2; - player.magicDamage += 0.06f; - player.rangedCrit += 2; - player.rangedDamage += 0.06f; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 2; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.06f; - player.minionDamage += 0.06f; - player.minionKB += 1f; - player.moveSpeed += 0.15f; - } - if (tScale) - { - player.endurance += 0.05f; - player.statDefense += 5; - player.kbBuff = true; - } - if (darkSunRing) - { - player.maxMinions += 1; - player.lifeRegen += 1; - player.statDefense += 8; - player.meleeSpeed -= 0.08f; - player.meleeDamage += 0.08f; - player.rangedDamage += 0.08f; - player.magicDamage += 0.08f; - player.pickSpeed -= 0.3f; - player.minionDamage += 0.08f; - player.minionKB += 1f; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.08f; - if (Main.dayTime) - { - player.lifeRegen += 1; - } - else - { - player.statDefense += 20; - } - } - if (badgeOfBravery) - { - if (player.statLife <= (player.statLifeMax2 * 0.8f) && player.statLife > (player.statLifeMax2 * 0.6f)) - { - player.meleeSpeed -= 0.05f; - } - else if (player.statLife <= (player.statLifeMax2 * 0.6f) && player.statLife > (player.statLifeMax2 * 0.4f)) - { - player.meleeSpeed -= 0.1f; - } - else if (player.statLife <= (player.statLifeMax2 * 0.4f) && player.statLife > (player.statLifeMax2 * 0.2f)) - { - player.meleeSpeed -= 0.15f; - } - else if (player.statLife <= (player.statLifeMax2 * 0.2f)) - { - player.meleeSpeed -= 0.2f; - } - } - if (eGauntlet) - { - player.longInvince = true; - player.kbGlove = true; - player.meleeDamage += 0.15f; - player.meleeCrit += 5; - player.meleeSpeed -= 0.15f; - player.lavaImmune = true; - } - if (yInsignia) - { - player.longInvince = true; - player.kbGlove = true; - player.meleeDamage += 0.05f; - player.meleeSpeed -= 0.05f; - player.lavaImmune = true; - if (player.statLife <= (player.statLifeMax2 * 0.5f)) - { - player.meleeDamage += 0.1f; - player.magicDamage += 0.1f; - player.rangedDamage += 0.1f; - player.thrownDamage += 0.1f; - player.minionDamage += 0.1f; - } - if (player.statLife <= (player.statLifeMax2 * 0.8f) && player.statLife > (player.statLifeMax2 * 0.6f)) - { - player.meleeSpeed -= 0.05f; - } - else if (player.statLife <= (player.statLifeMax2 * 0.6f) && player.statLife > (player.statLifeMax2 * 0.4f)) - { - player.meleeSpeed -= 0.1f; - } - else if (player.statLife <= (player.statLifeMax2 * 0.4f) && player.statLife > (player.statLifeMax2 * 0.2f)) - { - player.meleeSpeed -= 0.15f; - } - else if (player.statLife <= (player.statLifeMax2 * 0.2f)) - { - player.meleeSpeed -= 0.2f; - } - } - if (fabsolVodka) - { - alcoholPoisonLevel++; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.1f; - player.rangedDamage += 0.1f; - player.meleeDamage += 0.1f; - player.magicDamage += 0.1f; - player.minionDamage += 0.1f; - player.statDefense -= 20; - } - if (vodka) - { - alcoholPoisonLevel++; - player.lifeRegen -= 2; - player.statDefense -= 4; - player.meleeCrit += 2; - player.meleeDamage += 0.08f; - player.magicCrit += 2; - player.magicDamage += 0.08f; - player.rangedCrit += 2; - player.rangedDamage += 0.08f; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 2; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.08f; - player.minionDamage += 0.08f; - } - if (redWine) - { - alcoholPoisonLevel++; - player.lifeRegen -= 2; - } - if (grapeBeer) - { - alcoholPoisonLevel++; - player.lifeRegen -= 1; - player.statDefense -= 2; - player.moveSpeed -= 0.05f; - } - if (moonshine) - { - alcoholPoisonLevel++; - player.lifeRegen -= 2; - player.statDefense += 10; - player.endurance += 0.05f; - } - if (rum) - { - alcoholPoisonLevel++; - player.lifeRegen += 2; - player.moveSpeed += 0.1f; - player.statDefense -= 8; - } - if (fireball) - { - alcoholPoisonLevel++; - player.lifeRegen -= 3; - } - if (whiskey) - { - alcoholPoisonLevel++; - player.statDefense -= 8; - player.meleeCrit += 2; - player.meleeDamage += 0.04f; - player.magicCrit += 2; - player.magicDamage += 0.04f; - player.rangedCrit += 2; - player.rangedDamage += 0.04f; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 2; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.04f; - player.minionDamage += 0.04f; - } - if (everclear) - { - alcoholPoisonLevel += 2; - player.lifeRegen -= 20; - player.statDefense -= 40; - player.meleeDamage += 0.25f; - player.magicDamage += 0.25f; - player.rangedDamage += 0.25f; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.25f; - player.minionDamage += 0.25f; - } - if (bloodyMary) - { - alcoholPoisonLevel++; - player.lifeRegen -= 3; - if (Main.bloodMoon) - { - player.statDefense -= 6; - player.meleeCrit += 7; - player.meleeDamage += 0.15f; - player.meleeSpeed -= 0.15f; - player.magicCrit += 7; - player.magicDamage += 0.15f; - player.rangedCrit += 7; - player.rangedDamage += 0.15f; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 7; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.15f; - player.minionDamage += 0.15f; - player.moveSpeed += 0.15f; - } - } - if (tequila) - { - alcoholPoisonLevel++; - player.lifeRegen -= 2; - if (Main.dayTime) - { - player.statDefense += 5; - player.meleeCrit += 2; - player.meleeDamage += 0.04f; - player.magicCrit += 2; - player.magicDamage += 0.04f; - player.rangedCrit += 2; - player.rangedDamage += 0.04f; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 2; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.04f; - player.minionDamage += 0.04f; - player.endurance += 0.04f; - } - } - if (tequilaSunrise) - { - alcoholPoisonLevel++; - player.lifeRegen -= 3; - if (Main.dayTime) - { - player.statDefense += 15; - player.meleeCrit += 3; - player.meleeDamage += 0.09f; - player.magicCrit += 3; - player.magicDamage += 0.09f; - player.rangedCrit += 3; - player.rangedDamage += 0.09f; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 3; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.09f; - player.minionDamage += 0.09f; - player.endurance += 0.09f; - } - } - if (screwdriver) - { - alcoholPoisonLevel++; - player.lifeRegen -= 3; - } - if (caribbeanRum) - { - alcoholPoisonLevel++; - player.lifeRegen += 2; - player.moveSpeed += 0.2f; - player.statDefense -= 12; - } - if (cinnamonRoll) - { - alcoholPoisonLevel++; - player.statDefense -= 12; - player.manaRegenDelay--; - player.manaRegenBonus += 10; - } - if (margarita) - { - alcoholPoisonLevel++; - player.lifeRegen -= 3; - player.statDefense -= 6; - } - if (starBeamRye) - { - alcoholPoisonLevel++; - player.lifeRegen -= 3; - player.statDefense -= 6; - player.magicDamage += 0.08f; - player.manaCost *= 0.9f; - } - if (moscowMule) - { - alcoholPoisonLevel++; - player.lifeRegen -= 3; - player.meleeCrit += 3; - player.meleeDamage += 0.12f; - player.magicCrit += 3; - player.magicDamage += 0.12f; - player.rangedCrit += 3; - player.rangedDamage += 0.12f; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 3; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.12f; - player.minionDamage += 0.12f; - } - if (whiteWine) - { - alcoholPoisonLevel++; - player.lifeRegen -= 3; - player.statDefense -= 6; - player.magicDamage += 0.1f; - } - if (evergreenGin) - { - alcoholPoisonLevel++; - player.lifeRegen -= 3; - player.endurance += 0.05f; - } - if (alcoholPoisonLevel > 3) - { - if (player.lifeRegen > 0) - { - player.lifeRegen = 0; - } - player.lifeRegenTime = 0; - player.lifeRegen -= 3 * alcoholPoisonLevel; - } - if (nanotech) - { - if (CalamityMod.throwingItemList.Contains(player.inventory[player.selectedItem].type)) - { - player.endurance += 0.1f; - player.statDefense += 15; - } - } - if (harpyRing) - { - if (player.wingTimeMax > 0) - { - player.wingTimeMax = (int)((double)player.wingTimeMax * 1.25); - } - player.moveSpeed += 0.2f; - } - if (community) - { - float floatTypeBoost = 0.01f + - (NPC.downedSlimeKing ? 0.01f : 0f) + - (NPC.downedBoss1 ? 0.01f : 0f) + - (NPC.downedBoss2 ? 0.01f : 0f) + - (NPC.downedQueenBee ? 0.01f : 0f) + //0.05 - (NPC.downedBoss3 ? 0.01f : 0f) + - (Main.hardMode ? 0.01f : 0f) + - (NPC.downedMechBossAny ? 0.01f : 0f) + - (NPC.downedPlantBoss ? 0.01f : 0f) + - (NPC.downedGolemBoss ? 0.01f : 0f) + //0.1 - (NPC.downedFishron ? 0.01f : 0f) + - (NPC.downedAncientCultist ? 0.01f : 0f) + - (NPC.downedMoonlord ? 0.01f : 0f) + - (CalamityWorld.downedProvidence ? 0.02f : 0f) + //0.15 - (CalamityWorld.downedDoG ? 0.02f : 0f) + //0.17 - (CalamityWorld.downedYharon ? 0.03f : 0f); //0.2 - int integerTypeBoost = (int)(floatTypeBoost * 50f); - int critBoost = integerTypeBoost / 2; - int regenBoost = 1 + (integerTypeBoost / 5); - float damageBoost = floatTypeBoost * 0.5f; - player.endurance += (floatTypeBoost * 0.25f); - player.statDefense += integerTypeBoost; - player.meleeCrit += critBoost; - player.meleeDamage += damageBoost; - player.meleeSpeed -= (floatTypeBoost * 0.25f); - player.magicCrit += critBoost; - player.magicDamage += damageBoost; - player.rangedCrit += critBoost; - player.rangedDamage += damageBoost; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += critBoost; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += damageBoost; - player.minionDamage += damageBoost; - player.minionKB += floatTypeBoost; - player.moveSpeed += floatTypeBoost; - player.statLifeMax2 += player.statLifeMax / 5 / 20 * integerTypeBoost; - bool lesserEffect = false; - for (int l = 0; l < 22; l++) - { - int hasBuff = player.buffType[l]; - bool shouldAffect = CalamityMod.alcoholList.Contains(hasBuff); - if (shouldAffect) - { - lesserEffect = true; - } - } - if (player.lifeRegen < 0) - { - player.lifeRegen += lesserEffect ? 1 : regenBoost; - } - if (player.wingTimeMax > 0) - { - player.wingTimeMax = (int)((double)player.wingTimeMax * 1.15); - } - } - if (bloodflareThrowing) - { - if (player.statLife > (int)((double)player.statLifeMax2 * 0.8)) - { - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 5; - player.statDefense += 30; - } - else - { - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.1f; - } - } - if (bloodflareSummon) - { - if (player.statLife >= (int)((double)player.statLifeMax2 * 0.9)) - { - player.minionDamage += 0.1f; - } - else if (player.statLife <= (int)((double)player.statLifeMax2 * 0.5)) - { - player.statDefense += 20; - player.lifeRegen += 2; - } - if (bloodflareSummonTimer > 0) { bloodflareSummonTimer--; } - if (player.whoAmI == Main.myPlayer && bloodflareSummonTimer <= 0) - { - bloodflareSummonTimer = 900; - for (int I = 0; I < 3; I++) - { - float ai1 = (float)(I * 120); - Projectile.NewProjectile(player.Center.X + (float)(Math.Sin(I * 120) * 550), player.Center.Y + (float)(Math.Cos(I * 120) * 550), 0f, 0f, - mod.ProjectileType("GhostlyMine"), (int)((auricSet ? 15000f : 5000f) * player.minionDamage), 1f, player.whoAmI, ai1, 0f); - } - } - } - if (reaperToothNecklace) - { - player.meleeDamage += 0.25f; - player.magicDamage += 0.25f; - player.rangedDamage += 0.25f; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.25f; - player.minionDamage += 0.25f; - player.statDefense /= 2; - } - if (coreOfTheBloodGod) - { - player.endurance += 0.05f; - player.meleeDamage += 0.07f; - player.magicDamage += 0.07f; - player.rangedDamage += 0.07f; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.07f; - player.minionDamage += 0.07f; - if (player.statDefense < 100) - { - player.meleeDamage += 0.15f; - player.magicDamage += 0.15f; - player.rangedDamage += 0.15f; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.15f; - player.minionDamage += 0.15f; - } - } - else if (bloodflareCore) - { - if (player.statDefense < 100) - { - player.meleeDamage += 0.15f; - player.magicDamage += 0.15f; - player.rangedDamage += 0.15f; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.15f; - player.minionDamage += 0.15f; - } - if (player.statLife <= (int)((double)player.statLifeMax2 * 0.15)) - { - player.endurance += 0.1f; - player.meleeDamage += 0.2f; - player.magicDamage += 0.2f; - player.rangedDamage += 0.2f; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.2f; - player.minionDamage += 0.2f; - } - else if (player.statLife <= (int)((double)player.statLifeMax2 * 0.5)) - { - player.endurance += 0.05f; - player.meleeDamage += 0.1f; - player.magicDamage += 0.1f; - player.rangedDamage += 0.1f; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.1f; - player.minionDamage += 0.1f; - } - } - if (godSlayerThrowing) - { - if (player.statLife >= player.statLifeMax2) - { - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 10; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.1f; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingVelocity += 0.1f; - } - } - if (tarraSummon) - { - int lifeCounter = 0; - float num2 = 300f; - bool flag = lifeCounter % 60 == 0; - int num3 = 200; - if (player.whoAmI == Main.myPlayer) - { - for (int l = 0; l < 200; l++) - { - NPC nPC = Main.npc[l]; - if (nPC.active && !nPC.friendly && nPC.damage > 0 && !nPC.dontTakeDamage && Vector2.Distance(player.Center, nPC.Center) <= num2) - { - if (flag) - { - nPC.StrikeNPC(num3, 0f, 0, false, false, false); - if (Main.netMode != 0) - { - NetMessage.SendData(28, -1, -1, null, l, (float)num3, 0f, 0f, 0, 0, 0); - } - } - } - } - } - lifeCounter++; - if (lifeCounter >= 180) - { - lifeCounter = 0; - } - if (player.statLife >= player.statLifeMax2) - { - player.minionDamage += 0.1f; - player.maxMinions += 2; - } - } - #endregion - #region DRLimitAndOtherShit - if (auricSet && silvaMelee) - { - double multiplier = (double)player.statLife / (double)player.statLifeMax2; - player.meleeDamage += (float)(multiplier * 0.5); //ranges from 1.5 times to 1 times - } - if (player.endurance > defEndurance) //0.33 - { - float damageReductionAboveCap = player.endurance - defEndurance; //0.6 - 0.33 = 0.27 - player.endurance = defEndurance + (damageReductionAboveCap * 0.1f); //0.33 + (0.27 * 0.1) = 0.357 - } - #region MeleeLevelBoosts - if (meleeLevel >= 12500) - { - player.meleeDamage += 0.12f; - player.meleeSpeed -= 0.12f; - player.meleeCrit += 6; - } - else if (meleeLevel >= 10500) - { - player.meleeDamage += 0.1f; - player.meleeSpeed -= 0.1f; - player.meleeCrit += 5; - } - else if (meleeLevel >= 9100) - { - player.meleeDamage += 0.09f; - player.meleeSpeed -= 0.09f; - player.meleeCrit += 5; - } - else if (meleeLevel >= 7800) - { - player.meleeDamage += 0.08f; - player.meleeSpeed -= 0.08f; - player.meleeCrit += 4; - } - else if (meleeLevel >= 6600) - { - player.meleeDamage += 0.07f; - player.meleeSpeed -= 0.07f; - player.meleeCrit += 4; - } - else if (meleeLevel >= 5500) //hm limit - { - player.meleeDamage += 0.06f; - player.meleeSpeed -= 0.06f; - player.meleeCrit += 3; - } - else if (meleeLevel >= 4500) - { - player.meleeDamage += 0.05f; - player.meleeSpeed -= 0.05f; - player.meleeCrit += 3; - } - else if (meleeLevel >= 3600) - { - player.meleeDamage += 0.05f; - player.meleeSpeed -= 0.05f; - player.meleeCrit += 2; - } - else if (meleeLevel >= 2800) - { - player.meleeDamage += 0.04f; - player.meleeSpeed -= 0.04f; - player.meleeCrit += 2; - } - else if (meleeLevel >= 2100) - { - player.meleeDamage += 0.04f; - player.meleeSpeed -= 0.03f; - player.meleeCrit += 1; - } - else if (meleeLevel >= 1500) //prehm limit - { - player.meleeDamage += 0.03f; - player.meleeSpeed -= 0.02f; - player.meleeCrit += 1; - } - else if (meleeLevel >= 1000) - { - player.meleeDamage += 0.03f; - player.meleeSpeed -= 0.01f; - player.meleeCrit += 1; - } - else if (meleeLevel >= 600) - { - player.meleeDamage += 0.02f; - player.meleeSpeed -= 0.01f; - } - else if (meleeLevel >= 300) - player.meleeDamage += 0.02f; - else if (meleeLevel >= 100) - player.meleeDamage += 0.01f; - #endregion - #region RangedLevelBoosts - if (rangedLevel >= 12500) - { - player.rangedDamage += 0.12f; - player.moveSpeed += 0.12f; - player.rangedCrit += 6; - } - else if (rangedLevel >= 10500) - { - player.rangedDamage += 0.1f; - player.moveSpeed += 0.1f; - player.rangedCrit += 5; - } - else if (rangedLevel >= 9100) - { - player.rangedDamage += 0.09f; - player.moveSpeed += 0.09f; - player.rangedCrit += 5; - } - else if (rangedLevel >= 7800) - { - player.rangedDamage += 0.08f; - player.moveSpeed += 0.08f; - player.rangedCrit += 4; - } - else if (rangedLevel >= 6600) - { - player.rangedDamage += 0.07f; - player.moveSpeed += 0.07f; - player.rangedCrit += 4; - } - else if (rangedLevel >= 5500) - { - player.rangedDamage += 0.06f; - player.moveSpeed += 0.06f; - player.rangedCrit += 3; - } - else if (rangedLevel >= 4500) - { - player.rangedDamage += 0.05f; - player.moveSpeed += 0.05f; - player.rangedCrit += 3; - } - else if (rangedLevel >= 3600) - { - player.rangedDamage += 0.05f; - player.moveSpeed += 0.05f; - player.rangedCrit += 2; - } - else if (rangedLevel >= 2800) - { - player.rangedDamage += 0.04f; - player.moveSpeed += 0.04f; - player.rangedCrit += 2; - } - else if (rangedLevel >= 2100) - { - player.rangedDamage += 0.04f; - player.moveSpeed += 0.03f; - player.rangedCrit += 1; - } - else if (rangedLevel >= 1500) - { - player.rangedDamage += 0.03f; - player.moveSpeed += 0.02f; - player.rangedCrit += 1; - } - else if (rangedLevel >= 1000) - { - player.rangedDamage += 0.03f; - player.moveSpeed += 0.01f; - player.rangedCrit += 1; - } - else if (rangedLevel >= 600) - { - player.rangedDamage += 0.02f; - player.rangedCrit += 1; - } - else if (rangedLevel >= 300) - player.rangedDamage += 0.02f; - else if (rangedLevel >= 100) - player.rangedDamage += 0.01f; - #endregion - #region MagicLevelBoosts - if (magicLevel >= 12500) - { - player.magicDamage += 0.12f; - player.manaCost *= 0.88f; - player.magicCrit += 6; - } - else if (magicLevel >= 10500) - { - player.magicDamage += 0.1f; - player.manaCost *= 0.9f; - player.magicCrit += 5; - } - else if (magicLevel >= 9100) - { - player.magicDamage += 0.09f; - player.manaCost *= 0.91f; - player.magicCrit += 5; - } - else if (magicLevel >= 7800) - { - player.magicDamage += 0.08f; - player.manaCost *= 0.92f; - player.magicCrit += 4; - } - else if (magicLevel >= 6600) - { - player.magicDamage += 0.07f; - player.manaCost *= 0.93f; - player.magicCrit += 4; - } - else if (magicLevel >= 5500) - { - player.magicDamage += 0.06f; - player.manaCost *= 0.94f; - player.magicCrit += 3; - } - else if (magicLevel >= 4500) - { - player.magicDamage += 0.05f; - player.manaCost *= 0.95f; - player.magicCrit += 3; - } - else if (magicLevel >= 3600) - { - player.magicDamage += 0.05f; - player.manaCost *= 0.95f; - player.magicCrit += 2; - } - else if (magicLevel >= 2800) - { - player.magicDamage += 0.04f; - player.manaCost *= 0.96f; - player.magicCrit += 2; - } - else if (magicLevel >= 2100) - { - player.magicDamage += 0.04f; - player.manaCost *= 0.97f; - player.magicCrit += 1; - } - else if (magicLevel >= 1500) - { - player.magicDamage += 0.03f; - player.manaCost *= 0.98f; - player.magicCrit += 1; - } - else if (magicLevel >= 1000) - { - player.magicDamage += 0.03f; - player.manaCost *= 0.99f; - player.magicCrit += 1; - } - else if (magicLevel >= 600) - { - player.magicDamage += 0.02f; - player.manaCost *= 0.99f; - } - else if (magicLevel >= 300) - player.magicDamage += 0.02f; - else if (magicLevel >= 100) - player.magicDamage += 0.01f; - #endregion - #region SummonLevelBoosts - if (summonLevel >= 12500) - { - player.minionDamage += 0.12f; - player.minionKB += 3.0f; - player.maxMinions += 3; - } - else if (summonLevel >= 10500) - { - player.minionDamage += 0.1f; - player.minionKB += 3.0f; - player.maxMinions += 2; - } - else if (summonLevel >= 9100) - { - player.minionDamage += 0.09f; - player.minionKB += 2.7f; - player.maxMinions += 2; - } - else if (summonLevel >= 7800) - { - player.minionDamage += 0.08f; - player.minionKB += 2.4f; - player.maxMinions += 2; - } - else if (summonLevel >= 6600) - { - player.minionDamage += 0.07f; - player.minionKB += 2.1f; - player.maxMinions += 2; - } - else if (summonLevel >= 5500) - { - player.minionDamage += 0.06f; - player.minionKB += 1.8f; - player.maxMinions += 2; - } - else if (summonLevel >= 4500) - { - player.minionDamage += 0.06f; - player.minionKB += 1.8f; - player.maxMinions++; - } - else if (summonLevel >= 3600) - { - player.minionDamage += 0.05f; - player.minionKB += 1.5f; - player.maxMinions++; - } - else if (summonLevel >= 2800) - { - player.minionDamage += 0.04f; - player.minionKB += 1.2f; - player.maxMinions++; - } - else if (summonLevel >= 2100) - { - player.minionDamage += 0.04f; - player.minionKB += 0.9f; - player.maxMinions++; - } - else if (summonLevel >= 1500) - { - player.minionDamage += 0.03f; - player.minionKB += 0.6f; - } - else if (summonLevel >= 1000) - { - player.minionDamage += 0.03f; - player.minionKB += 0.3f; - } - else if (summonLevel >= 600) - { - player.minionDamage += 0.02f; - player.minionKB += 0.3f; - } - else if (summonLevel >= 300) - player.minionDamage += 0.02f; - else if (summonLevel >= 100) - player.minionDamage += 0.01f; - #endregion - #region RogueLevelBoosts - if (rogueLevel >= 12500) - { - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.12f; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingVelocity += 0.12f; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 6; - } - else if (rogueLevel >= 10500) - { - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.1f; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingVelocity += 0.1f; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 5; - } - else if (rogueLevel >= 9100) - { - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.09f; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingVelocity += 0.09f; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 5; - } - else if (rogueLevel >= 7800) - { - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.08f; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingVelocity += 0.08f; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 4; - } - else if (rogueLevel >= 6600) - { - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.07f; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingVelocity += 0.07f; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 4; - } - else if (rogueLevel >= 5500) - { - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.06f; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingVelocity += 0.06f; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 3; - } - else if (rogueLevel >= 4500) - { - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.05f; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingVelocity += 0.05f; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 3; - } - else if (rogueLevel >= 3600) - { - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.05f; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingVelocity += 0.05f; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 2; - } - else if (rogueLevel >= 2800) - { - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.04f; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingVelocity += 0.04f; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 2; - } - else if (rogueLevel >= 2100) - { - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.04f; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingVelocity += 0.03f; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 1; - } - else if (rogueLevel >= 1500) - { - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.03f; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingVelocity += 0.02f; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 1; - } - else if (rogueLevel >= 1000) - { - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.03f; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingVelocity += 0.01f; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 1; - } - else if (rogueLevel >= 600) - { - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.02f; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingVelocity += 0.01f; - } - else if (rogueLevel >= 300) - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.02f; - else if (rogueLevel >= 100) - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.01f; - #endregion - if (dArtifact) - { - player.meleeDamage += 0.25f; - player.magicDamage += 0.25f; - player.rangedDamage += 0.25f; - player.minionDamage += 0.25f; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.25f; - } - if (eArtifact) - { - player.meleeSpeed -= 0.1f; - player.manaCost *= 0.85f; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.15f; - player.maxMinions += 2; - } - if (gArtifact) - { - player.maxMinions += 8; - if (player.whoAmI == Main.myPlayer) - { - if (player.FindBuffIndex(mod.BuffType("AngryChicken")) == -1) - { - player.AddBuff(mod.BuffType("AngryChicken"), 3600, true); - } - if (player.ownedProjectileCounts[mod.ProjectileType("AngryChicken")] < 2) - { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, 0f, mod.ProjectileType("AngryChicken"), (int)(232f * player.minionDamage), 2f, Main.myPlayer, 0f, 0f); - } - } - } - if (pArtifact) - { - if (player.whoAmI == Main.myPlayer) - { - if (player.FindBuffIndex(mod.BuffType("GuardianHealer")) == -1) - { - player.AddBuff(mod.BuffType("GuardianHealer"), 3600, true); - } - if (player.ownedProjectileCounts[mod.ProjectileType("MiniGuardianHealer")] < 1) - { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -6f, mod.ProjectileType("MiniGuardianHealer"), 0, 0f, Main.myPlayer, 0f, 0f); - } - float baseDamage = 150f + - (CalamityWorld.downedDoG ? 100f : 0f) + - (CalamityWorld.downedYharon ? 100f : 0f); - if (player.maxMinions >= 8) - { - if (player.FindBuffIndex(mod.BuffType("GuardianDefense")) == -1) - { - player.AddBuff(mod.BuffType("GuardianDefense"), 3600, true); - } - if (player.ownedProjectileCounts[mod.ProjectileType("MiniGuardianDefense")] < 1) - { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -3f, mod.ProjectileType("MiniGuardianDefense"), (int)(baseDamage * player.minionDamage), 1f, Main.myPlayer, 0f, 0f); - } - } - if (tarraSummon || bloodflareSummon || godSlayerSummon || silvaSummon || dsSetBonus) - { - if (player.FindBuffIndex(mod.BuffType("GuardianOffense")) == -1) - { - player.AddBuff(mod.BuffType("GuardianOffense"), 3600, true); - } - if (player.ownedProjectileCounts[mod.ProjectileType("MiniGuardianAttack")] < 1) - { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, mod.ProjectileType("MiniGuardianAttack"), (int)(baseDamage * player.minionDamage), 1f, Main.myPlayer, 0f, 0f); - } - } - } - } - if (marked || reaperToothNecklace) - { - player.endurance *= 0.5f; - } - #endregion - } + if (weakPetrification) + WeakPetrification(); - public override void PostUpdateRunSpeeds() + if (player.mount.Active || player.mount.Cart) + { + player.dashDelay = 60; + dashMod = 0; + } + + if (silvaCountdown > 0 && hasSilvaEffect && silvaSet) + { + if (player.lifeRegen < 0) + player.lifeRegen = 0; + } + } + + #region ExactLevelUp + private void ExactLevelUp(int levelUpType, int level, bool final) { - #region SpeedBoosts - if (hAttack) + Color messageColor = Color.Orange; + switch (levelUpType) + { + case 0: + exactMeleeLevel = level; + if (shootFireworksLevelUpMelee) + { + string key = (final ? "Mods.CalamityMod.MeleeLevelUpFinal" : "Mods.CalamityMod.MeleeLevelUp"); + shootFireworksLevelUpMelee = false; + if (player.whoAmI == Main.myPlayer) + { + if (final) + { + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -5f, ProjectileID.RocketFireworkRed + Main.rand.Next(4), + 0, 0f, Main.myPlayer, 0f, 1f); + } + else + { + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -5f, ProjectileID.RocketFireworksBoxRed + Main.rand.Next(4), + 0, 0f, Main.myPlayer, 0f, 0f); + } + } + if (Main.netMode == 0) + { + Main.NewText(Language.GetTextValue(key), messageColor); + } + else if (Main.netMode == 2) + { + NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); + } + } + break; + case 1: + exactRangedLevel = level; + if (shootFireworksLevelUpRanged) + { + string key = (final ? "Mods.CalamityMod.RangedLevelUpFinal" : "Mods.CalamityMod.RangedLevelUp"); + messageColor = Color.GreenYellow; + shootFireworksLevelUpRanged = false; + if (player.whoAmI == Main.myPlayer) + { + if (final) + { + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -5f, ProjectileID.RocketFireworkRed + Main.rand.Next(4), + 0, 0f, Main.myPlayer, 0f, 1f); + } + else + { + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -5f, ProjectileID.RocketFireworksBoxRed + Main.rand.Next(4), + 0, 0f, Main.myPlayer, 0f, 0f); + } + } + if (Main.netMode == 0) + { + Main.NewText(Language.GetTextValue(key), messageColor); + } + else if (Main.netMode == 2) + { + NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); + } + } + break; + case 2: + exactMagicLevel = level; + if (shootFireworksLevelUpMagic) + { + string key = (final ? "Mods.CalamityMod.MagicLevelUpFinal" : "Mods.CalamityMod.MagicLevelUp"); + messageColor = Color.DodgerBlue; + shootFireworksLevelUpMagic = false; + if (player.whoAmI == Main.myPlayer) + { + if (final) + { + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -5f, ProjectileID.RocketFireworkRed + Main.rand.Next(4), + 0, 0f, Main.myPlayer, 0f, 1f); + } + else + { + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -5f, ProjectileID.RocketFireworksBoxRed + Main.rand.Next(4), + 0, 0f, Main.myPlayer, 0f, 0f); + } + } + if (Main.netMode == 0) + { + Main.NewText(Language.GetTextValue(key), messageColor); + } + else if (Main.netMode == 2) + { + NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); + } + } + break; + case 3: + exactSummonLevel = level; + if (shootFireworksLevelUpSummon) + { + string key = (final ? "Mods.CalamityMod.SummonLevelUpFinal" : "Mods.CalamityMod.SummonLevelUp"); + messageColor = Color.Aquamarine; + shootFireworksLevelUpSummon = false; + if (player.whoAmI == Main.myPlayer) + { + if (final) + { + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -5f, ProjectileID.RocketFireworkRed + Main.rand.Next(4), + 0, 0f, Main.myPlayer, 0f, 1f); + } + else + { + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -5f, ProjectileID.RocketFireworksBoxRed + Main.rand.Next(4), + 0, 0f, Main.myPlayer, 0f, 0f); + } + } + if (Main.netMode == 0) + { + Main.NewText(Language.GetTextValue(key), messageColor); + } + else if (Main.netMode == 2) + { + NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); + } + } + break; + case 4: + exactRogueLevel = level; + if (shootFireworksLevelUpRogue) + { + string key = (final ? "Mods.CalamityMod.RogueLevelUpFinal" : "Mods.CalamityMod.RogueLevelUp"); + messageColor = Color.Orchid; + shootFireworksLevelUpRogue = false; + if (player.whoAmI == Main.myPlayer) + { + if (final) + { + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -5f, ProjectileID.RocketFireworkRed + Main.rand.Next(4), + 0, 0f, Main.myPlayer, 0f, 1f); + } + else + { + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -5f, ProjectileID.RocketFireworksBoxRed + Main.rand.Next(4), + 0, 0f, Main.myPlayer, 0f, 0f); + } + } + if (Main.netMode == 0) + { + Main.NewText(Language.GetTextValue(key), messageColor); + } + else if (Main.netMode == 2) + { + NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); + } + } + break; + } + if (Main.netMode == 1) + { + ExactLevelPacket(false, levelUpType); + } + } + #endregion + + public override void PostUpdateMiscEffects() + { + Main.expertDebuffTime = 1f; + areThereAnyDamnBosses = CalamityGlobalNPC.AnyBossNPCS(); + #region RevengeanceEffects + if (CalamityWorld.revenge && player.whoAmI == Main.myPlayer) + { + if (player.onHitDodge) + { + for (int l = 0; l < 22; l++) + { + int hasBuff = player.buffType[l]; + if (player.buffTime[l] > 360 && hasBuff == BuffID.ShadowDodge) + { + player.buffTime[l] = 360; + } + } + } + if (player.immuneTime > (tarraThrowing ? 300 : 120)) + { + player.immuneTime = (tarraThrowing ? 300 : 120); + } + int stressGain = 0; + if (rageMode) + { + stressGain = -2000; + } + else + { + if (draedonsHeart) + { + if (draedonsStressGain) + { + stressGain += 60; + } + } + else if (heartOfDarkness) + { + stressGain += 30; + } + } + stressCD++; + if (stressCD >= 60) + { + stressCD = 0; + stress += stressGain; + if (stress < 0) + { + stress = 0; + } + if (stress >= stressMax) + { + if (playFullRageSound) + { + playFullRageSound = false; + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/FullRage"), (int)player.position.X, (int)player.position.Y); + } + stress = stressMax; + } + else + { + playFullRageSound = true; + } + } + stressLevel500 = stress >= 9800; + if (stressLevel500 && !hAttack) + { + int heartAttackChance = ((draedonsHeart || heartOfDarkness) ? 2000 : 10000); + if (Main.rand.Next(heartAttackChance) == 0) + { + player.AddBuff(mod.BuffType("HeartAttack"), 18000); + } + } + if (adrenaline >= adrenalineMax) + { + adrenalineMaxTimer--; + if (adrenalineMaxTimer <= 0) + { + if (playAdrenalineBurnoutSound) + { + playAdrenalineBurnoutSound = false; + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/AdrenalineBurnout1"), (int)player.position.X, (int)player.position.Y); + } + adrenalineDmgDown--; + if (adrenalineDmgDown < 0) + { + if (playFullAdrenalineBurnoutSound) + { + playFullAdrenalineBurnoutSound = false; + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/AdrenalineBurnout2"), (int)player.position.X, (int)player.position.Y); + } + adrenalineDmgDown = 0; + } + adrenalineMaxTimer = 0; + } + } + else if (!adrenalineMode && adrenaline <= 0) + { + playAdrenalineBurnoutSound = true; + playFullAdrenalineBurnoutSound = true; + adrenalineDmgDown = 600; + adrenalineMaxTimer = 300; + adrenalineDmgMult = 1f; + } + adrenalineDmgMult = 0.1f * (float)(adrenalineDmgDown / 60); + if (adrenalineDmgMult < 0.33f) + adrenalineDmgMult = 0.33f; + int adrenalineGain = 0; + if (adrenalineMode) + { + adrenalineGain = (CalamityGlobalNPC.SCal > -1 ? -10000 : -2000); + } + else + { + if (Main.wof >= 0 && player.position.Y < (float)((Main.maxTilesY - 200) * 16)) // > + { + adrenaline = 0; + } + else if (areThereAnyDamnBosses || CalamityWorld.DoGSecondStageCountdown > 0) + { + int adrenalineTickBoost = 0 + + (adrenalineBoostOne ? 63 : 0) + //286 + (adrenalineBoostTwo ? 115 : 0) + //401 + (adrenalineBoostThree ? 100 : 0); //501 + adrenalineGain = 223 + adrenalineTickBoost; //pre-slime god = 45, pre-astrum deus = 35, pre-polterghast = 25, post-polter = 20 + } + else + { + adrenaline = 0; + } + } + adrenalineCD++; + if (adrenalineCD >= (CalamityGlobalNPC.SCal > -1 ? 135 : 60)) + { + adrenalineCD = 0; + adrenaline += adrenalineGain; + if (adrenaline < 0) + { + adrenaline = 0; + } + if (adrenaline >= adrenalineMax) + { + if (playFullAdrenalineSound) + { + playFullAdrenalineSound = false; + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/FullAdrenaline"), (int)player.position.X, (int)player.position.Y); + } + adrenaline = adrenalineMax; + } + else + { + playFullAdrenalineSound = true; + } + } + } + else if (!CalamityWorld.revenge && player.whoAmI == Main.myPlayer) + { + stressCD++; + if (stressCD >= 60) + { + stressCD = 0; + stress += -30; + if (stress < 0) + { + stress = 0; + } + } + adrenalineCD++; + if (adrenalineCD >= 60) + { + adrenalineCD = 0; + adrenaline += -30; + if (adrenaline < 0) + { + adrenaline = 0; + } + } + } + if (player.whoAmI == Main.myPlayer && Main.netMode == 1) + { + packetTimer++; + if (packetTimer == 60) + { + packetTimer = 0; + StressPacket(false); + AdrenalinePacket(false); + } + } + if (CalamityWorld.revenge) + { + if (player.lifeSteal > (CalamityWorld.death ? 30f : 40f)) + { + player.lifeSteal = (CalamityWorld.death ? 30f : 40f); + } + } + #endregion + #region StressTiedEffects + if (stressPills) + { + player.statDefense += 8; + player.meleeDamage += 0.08f; + player.magicDamage += 0.08f; + player.rangedDamage += 0.08f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.08f; + player.minionDamage += 0.08f; + } + if (laudanum) + { + player.statDefense += 6; + player.meleeDamage += 0.06f; + player.magicDamage += 0.06f; + player.rangedDamage += 0.06f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.06f; + player.minionDamage += 0.06f; + } + if (draedonsHeart) + { + player.meleeDamage += 0.1f; + player.magicDamage += 0.1f; + player.rangedDamage += 0.1f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.1f; + player.minionDamage += 0.1f; + } + if (!stressLevel500 && player.FindBuffIndex(mod.BuffType("HeartAttack")) > -1) { player.ClearBuff(mod.BuffType("HeartAttack")); } + if (draedonsHeart && (double)Math.Abs(player.velocity.X) < 0.05 && (double)Math.Abs(player.velocity.Y) < 0.05 && player.itemAnimation == 0) + { + player.statDefense += 25; + } + if (hAttack) + { + if (heartOfDarkness || draedonsHeart) + { + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.1f; + player.rangedDamage += 0.1f; + player.meleeDamage += 0.1f; + player.magicDamage += 0.1f; + player.minionDamage += 0.1f; + } + player.statLifeMax2 += player.statLifeMax / 5 / 20 * 5; + } + if (affliction) + { + player.lifeRegen += 1; + player.endurance += CalamityWorld.revenge ? 0.07f : 0.05f; + player.statDefense += CalamityWorld.revenge ? 20 : 15; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += CalamityWorld.revenge ? 0.12f : 0.1f; + player.rangedDamage += CalamityWorld.revenge ? 0.12f : 0.1f; + player.meleeDamage += CalamityWorld.revenge ? 0.12f : 0.1f; + player.magicDamage += CalamityWorld.revenge ? 0.12f : 0.1f; + player.minionDamage += CalamityWorld.revenge ? 0.12f : 0.1f; + player.statLifeMax2 += CalamityWorld.revenge ? (player.statLifeMax / 5 / 20 * 10) : (player.statLifeMax / 5 / 20 * 5); + } + else if (afflicted) + { + player.lifeRegen += 1; + player.endurance += CalamityWorld.revenge ? 0.07f : 0.05f; + player.statDefense += CalamityWorld.revenge ? 20 : 15; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += CalamityWorld.revenge ? 0.12f : 0.1f; + player.rangedDamage += CalamityWorld.revenge ? 0.12f : 0.1f; + player.meleeDamage += CalamityWorld.revenge ? 0.12f : 0.1f; + player.magicDamage += CalamityWorld.revenge ? 0.12f : 0.1f; + player.minionDamage += CalamityWorld.revenge ? 0.12f : 0.1f; + player.statLifeMax2 += CalamityWorld.revenge ? (player.statLifeMax / 5 / 20 * 10) : (player.statLifeMax / 5 / 20 * 5); + } + if (afflictedBuff) { afflicted = true; } + #endregion + #region MaxLifeAndManaBoosts + player.statLifeMax2 += + (mFruit ? 25 : 0) + + (bOrange ? 25 : 0) + + (eBerry ? 25 : 0) + + (dFruit ? 25 : 0); + if (silvaHitCounter > 0) + { + player.statLifeMax2 -= silvaHitCounter * 100; + if (player.statLifeMax2 < 200) + { + player.statLifeMax2 = 200; + } + } + player.statManaMax2 += + (pHeart ? 50 : 0) + + (eCore ? 50 : 0) + + (cShard ? 50 : 0) + + (starBeamRye ? 50 : 0); + if (Main.netMode != 2 && player.whoAmI == Main.myPlayer) + { + Texture2D rain3 = mod.GetTexture("ExtraTextures/Rain3"); + Texture2D rainOriginal = mod.GetTexture("ExtraTextures/RainOriginal"); + Texture2D mana2 = mod.GetTexture("ExtraTextures/Mana2"); + Texture2D mana3 = mod.GetTexture("ExtraTextures/Mana3"); + Texture2D mana4 = mod.GetTexture("ExtraTextures/Mana4"); + Texture2D manaOriginal = mod.GetTexture("ExtraTextures/ManaOriginal"); + Texture2D carpetAuric = mod.GetTexture("ExtraTextures/AuricCarpet"); + Texture2D carpetOriginal = mod.GetTexture("ExtraTextures/Carpet"); + int totalManaBoost = + (pHeart ? 1 : 0) + + (eCore ? 1 : 0) + + (cShard ? 1 : 0); + switch (totalManaBoost) + { + default: + Main.manaTexture = manaOriginal; + break; + case 3: + Main.manaTexture = mana4; + break; + case 2: + Main.manaTexture = mana3; + break; + case 1: + Main.manaTexture = mana2; + break; + } + if (Main.bloodMoon) { Main.rainTexture = rainOriginal; } + else if (Main.raining && ZoneSulphur) { Main.rainTexture = rain3; } + else { Main.rainTexture = rainOriginal; } + if (auricSet) { Main.flyingCarpetTexture = carpetAuric; } + else { Main.flyingCarpetTexture = carpetOriginal; } + } + #endregion + #region MiscEffects + if (gainLevelCooldown > 0) + gainLevelCooldown--; + #region MeleeLevels + switch (meleeLevel) + { + case 100: + ExactLevelUp(0, 1, false); + break; + case 300: + ExactLevelUp(0, 2, false); + break; + case 600: + ExactLevelUp(0, 3, false); + break; + case 1000: + ExactLevelUp(0, 4, false); + break; + case 1500: + ExactLevelUp(0, 5, false); + break; + case 2100: + ExactLevelUp(0, 6, false); + break; + case 2800: + ExactLevelUp(0, 7, false); + break; + case 3600: + ExactLevelUp(0, 8, false); + break; + case 4500: + ExactLevelUp(0, 9, false); + break; + case 5500: + ExactLevelUp(0, 10, false); + break; + case 6600: + ExactLevelUp(0, 11, false); + break; + case 7800: + ExactLevelUp(0, 12, false); + break; + case 9100: + ExactLevelUp(0, 13, false); + break; + case 10500: + ExactLevelUp(0, 14, false); + break; + case 12500: //celebration or some shit for final level, yay + ExactLevelUp(0, 15, true); + break; + default: + break; + } + #endregion + #region RangedLevels + switch (rangedLevel) + { + case 100: + ExactLevelUp(1, 1, false); + break; + case 300: + ExactLevelUp(1, 2, false); + break; + case 600: + ExactLevelUp(1, 3, false); + break; + case 1000: + ExactLevelUp(1, 4, false); + break; + case 1500: + ExactLevelUp(1, 5, false); + break; + case 2100: + ExactLevelUp(1, 6, false); + break; + case 2800: + ExactLevelUp(1, 7, false); + break; + case 3600: + ExactLevelUp(1, 8, false); + break; + case 4500: + ExactLevelUp(1, 9, false); + break; + case 5500: + ExactLevelUp(1, 10, false); + break; + case 6600: + ExactLevelUp(1, 11, false); + break; + case 7800: + ExactLevelUp(1, 12, false); + break; + case 9100: + ExactLevelUp(1, 13, false); + break; + case 10500: + ExactLevelUp(1, 14, false); + break; + case 12500: //celebration or some shit for final level, yay + ExactLevelUp(1, 15, true); + break; + default: + break; + } + #endregion + #region MagicLevels + switch (magicLevel) + { + case 100: + ExactLevelUp(2, 1, false); + break; + case 300: + ExactLevelUp(2, 2, false); + break; + case 600: + ExactLevelUp(2, 3, false); + break; + case 1000: + ExactLevelUp(2, 4, false); + break; + case 1500: + ExactLevelUp(2, 5, false); + break; + case 2100: + ExactLevelUp(2, 6, false); + break; + case 2800: + ExactLevelUp(2, 7, false); + break; + case 3600: + ExactLevelUp(2, 8, false); + break; + case 4500: + ExactLevelUp(2, 9, false); + break; + case 5500: + ExactLevelUp(2, 10, false); + break; + case 6600: + ExactLevelUp(2, 11, false); + break; + case 7800: + ExactLevelUp(2, 12, false); + break; + case 9100: + ExactLevelUp(2, 13, false); + break; + case 10500: + ExactLevelUp(2, 14, false); + break; + case 12500: //celebration or some shit for final level, yay + ExactLevelUp(2, 15, true); + break; + default: + break; + } + #endregion + #region SummonLevels + switch (summonLevel) + { + case 100: + ExactLevelUp(3, 1, false); + break; + case 300: + ExactLevelUp(3, 2, false); + break; + case 600: + ExactLevelUp(3, 3, false); + break; + case 1000: + ExactLevelUp(3, 4, false); + break; + case 1500: + ExactLevelUp(3, 5, false); + break; + case 2100: + ExactLevelUp(3, 6, false); + break; + case 2800: + ExactLevelUp(3, 7, false); + break; + case 3600: + ExactLevelUp(3, 8, false); + break; + case 4500: + ExactLevelUp(3, 9, false); + break; + case 5500: + ExactLevelUp(3, 10, false); + break; + case 6600: + ExactLevelUp(3, 11, false); + break; + case 7800: + ExactLevelUp(3, 12, false); + break; + case 9100: + ExactLevelUp(3, 13, false); + break; + case 10500: + ExactLevelUp(3, 14, false); + break; + case 12500: //celebration or some shit for final level, yay + ExactLevelUp(3, 15, true); + break; + default: + break; + } + #endregion + #region RogueLevels + switch (rogueLevel) + { + case 100: + ExactLevelUp(4, 1, false); + break; + case 300: + ExactLevelUp(4, 2, false); + break; + case 600: + ExactLevelUp(4, 3, false); + break; + case 1000: + ExactLevelUp(4, 4, false); + break; + case 1500: + ExactLevelUp(4, 5, false); + break; + case 2100: + ExactLevelUp(4, 6, false); + break; + case 2800: + ExactLevelUp(4, 7, false); + break; + case 3600: + ExactLevelUp(4, 8, false); + break; + case 4500: + ExactLevelUp(4, 9, false); + break; + case 5500: + ExactLevelUp(4, 10, false); + break; + case 6600: + ExactLevelUp(4, 11, false); + break; + case 7800: + ExactLevelUp(4, 12, false); + break; + case 9100: + ExactLevelUp(4, 13, false); + break; + case 10500: + ExactLevelUp(4, 14, false); + break; + case 12500: //celebration or some shit for final level, yay + ExactLevelUp(4, 15, true); + break; + default: + break; + } + #endregion + if (player.nebulaLevelMana > 0 && player.statMana < player.statManaMax2) + { + int num = 12; + nebulaManaNerfCounter += player.nebulaLevelMana; + if (nebulaManaNerfCounter >= num) + { + nebulaManaNerfCounter -= num; + player.statMana--; + if (player.statMana < 0) + { + player.statMana = 0; + } + } + } + else + { + nebulaManaNerfCounter = 0; + } + if (Main.myPlayer == player.whoAmI) + { + BossHealthBarManager.SHOULD_DRAW_SMALLTEXT_HEALTH = shouldDrawSmallText; + /*if (player.chest != -1) + { + if (player.chest != -2) + { + trashManChest = -1; + } + if (trashManChest >= 0) + { + if (!Main.projectile[trashManChest].active || Main.projectile[trashManChest].type != mod.ProjectileType("DannyDevito")) + { + Main.PlaySound(SoundID.Item11, -1, -1); + player.chest = -1; + Recipe.FindRecipes(); + } + else + { + int num16 = (int)(((double)player.position.X + (double)player.width * 0.5) / 16.0); + int num17 = (int)(((double)player.position.Y + (double)player.height * 0.5) / 16.0); + player.chestX = (int)Main.projectile[trashManChest].Center.X / 16; + player.chestY = (int)Main.projectile[trashManChest].Center.Y / 16; + if (num16 < player.chestX - Player.tileRangeX || num16 > player.chestX + Player.tileRangeX + 1 || num17 < player.chestY - Player.tileRangeY || num17 > player.chestY + Player.tileRangeY + 1) + { + if (player.chest != -1) + { + Main.PlaySound(SoundID.Item11, -1, -1); + } + player.chest = -1; + Recipe.FindRecipes(); + } + } + } + } + else + { + trashManChest = -1; + }*/ + } + if (silvaSet || invincible || margarita) + { + foreach (int debuff in CalamityMod.debuffList) { player.buffImmune[debuff] = true; } + } + if (Main.expertMode && player.ZoneSnow && player.wet && !player.lavaWet && !player.honeyWet && !player.arcticDivingGear) + { + player.buffImmune[BuffID.Chilled] = true; + if (Collision.DrownCollision(player.position, player.width, player.height, player.gravDir)) + { + if (Main.myPlayer == player.whoAmI && !player.gills && !player.merman) + { + if (player.breath > 0) + player.breath--; + } + } + } + if (ZoneAbyss) + { + if (abyssalAmulet) { player.statLifeMax2 += player.statLifeMax2 / 5 / 20 * (lumenousAmulet ? 25 : 10); } + if (Main.myPlayer == player.whoAmI) //4200 total tiles small world + { + int breathLoss = 2; + int lightStrength = 0 + + ((player.lightOrb || player.crimsonHeart || player.magicLantern) ? 1 : 0) + //1 + (aquaticEmblem ? 1 : 0) + //2 + (player.arcticDivingGear ? 1 : 0) + //3 + (jellyfishNecklace ? 1 : 0) + //4 + ((player.blueFairy || player.greenFairy || player.redFairy || player.petFlagDD2Ghost) ? 2 : 0) + //6 + ((shine || lumenousAmulet) ? 2 : 0) + //8 + ((player.wisp || player.suspiciouslookingTentacle || sirenPet) ? 3 : 0); //11 + bool lightLevelOne = lightStrength > 0; //1+ + bool lightLevelTwo = lightStrength > 2; //3+ + bool lightLevelThree = lightStrength > 4; //5+ + bool lightLevelFour = lightStrength > 6; //7+ + if (ZoneAbyssLayer4) //3200 and below + { + breathLoss = 54; + if (!lightLevelFour) { player.blind = true; } + if (!lightLevelThree) { player.headcovered = true; } + if (!depthCharm) { player.bleed = true; } + player.statDefense -= (anechoicPlating ? 40 : 120); + } + else if (ZoneAbyssLayer3) //2700 to 3200 + { + breathLoss = 18; + if (!lightLevelThree) { player.blind = true; } + if (!lightLevelTwo) { player.headcovered = true; } + if (!depthCharm) { player.bleed = true; } + player.statDefense -= (anechoicPlating ? 20 : 60); + } + else if (ZoneAbyssLayer2) //2100 to 2700 + { + breathLoss = 6; + if (!lightLevelTwo) { player.blind = true; } + if (!depthCharm) { player.bleed = true; } + player.statDefense -= (anechoicPlating ? 10 : 30); + } + else if (ZoneAbyssLayer1) //1500 to 2100 + { + if (!lightLevelOne) { player.blind = true; } + player.statDefense -= (anechoicPlating ? 5 : 15); + } + double breathLossMult = 1.0 - + (player.gills ? 0.2 : 0.0) - //0.8 + (player.accDivingHelm ? 0.25 : 0.0) - //0.75 + (player.arcticDivingGear ? 0.25 : 0.0) - //0.75 + (aquaticEmblem ? 0.25 : 0.0) - //0.75 + (player.accMerman ? 0.3 : 0.0) - //0.7 + (victideSet ? 0.2 : 0.0) - //0.85 + (((sirenBoobs || sirenBoobsAlt) && NPC.downedBoss3) ? 0.3 : 0.0) - //0.7 + (abyssalDivingSuit ? 0.3 : 0.0); //0.7 + if (breathLossMult < 0.05) { breathLossMult = 0.05; } + breathLoss = (int)((double)breathLoss * breathLossMult); + int tick = 6; + double tickMult = 1.0 + + (player.gills ? 4.0 : 0.0) + //5 + (player.ignoreWater ? 5.0 : 0.0) + //10 + (player.accDivingHelm ? 10.0 : 0.0) + //20 + (player.arcticDivingGear ? 10.0 : 0.0) + //30 + (aquaticEmblem ? 10.0 : 0.0) + //40 + (player.accMerman ? 15.0 : 0.0) + //55 + (victideSet ? 5.0 : 0.0) + //60 + (((sirenBoobs || sirenBoobsAlt) && NPC.downedBoss3) ? 15.0 : 0.0) + //75 + (abyssalDivingSuit ? 15.0 : 0.0); //90 + if (tickMult > 50.0) { tickMult = 50.0; } + tick = (int)((double)tick * tickMult); + abyssBreathCD++; + if (player.gills || player.merman) + { + if (player.breath > 0) + player.breath -= 3; + } + if (!Collision.DrownCollision(player.position, player.width, player.height, player.gravDir)) + { + if (player.statLife > 100) + { + if (player.lifeRegen > 0) + { + player.lifeRegen = 0; + } + player.lifeRegenTime = 0; + player.lifeRegen -= 160; + } + } + if (abyssBreathCD >= tick) + { + abyssBreathCD = 0; + if (player.breath > 0) + player.breath -= breathLoss; + if (cDepth) + { + if (player.breath > 0) + player.breath--; + } + if (player.breath <= 0) + { + int lifeLoss = 6 + + (player.bleed ? 6 : 0) - + (depthCharm ? 3 : 0); + player.statLife -= lifeLoss; + if (player.statLife <= 0) + { + KillPlayer(); + } + } + } + } + } + else + { + abyssBreathCD = 0; + } + if ((Collision.DrownCollision(player.position, player.width, player.height, player.gravDir) && ironBoots) || + (aeroSet && !Collision.DrownCollision(player.position, player.width, player.height, player.gravDir))) + { + player.maxFallSpeed = 15f; + } + if (omegaBlueSet) //should apply after rev caps, actually those are gone so AAAAA + { + //add tentacles + if (player.ownedProjectileCounts[mod.ProjectileType("OmegaBlueTentacle")] < 6) + { + bool[] tentaclesPresent = new bool[6]; + for (int i = 0; i < 1000; i++) + { + Projectile projectile = Main.projectile[i]; + if (projectile.active && projectile.type == mod.ProjectileType("OmegaBlueTentacle") && projectile.owner == Main.myPlayer && projectile.ai[1] >= 0f && projectile.ai[1] < 6f) + { + tentaclesPresent[(int)projectile.ai[1]] = true; + } + } + for (int i = 0; i < 6; i++) + { + if (!tentaclesPresent[i]) + { + float modifier = player.meleeDamage + player.magicDamage + player.rangedDamage + + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage + player.minionDamage; + modifier /= 5f; + int damage = (int)(666 * modifier); + Vector2 vel = new Vector2(Main.rand.Next(-13, 14), Main.rand.Next(-13, 14)) * 0.25f; + Projectile.NewProjectile(player.Center, vel, mod.ProjectileType("OmegaBlueTentacle"), damage, 8f, Main.myPlayer, Main.rand.Next(120), i); + } + } + } + float damageUp = 0.1f; + int critUp = 10; + if (omegaBlueHentai) + { + damageUp *= 2f; + critUp *= 2; + } + player.meleeDamage += damageUp; + player.rangedDamage += damageUp; + player.magicDamage += damageUp; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += damageUp; + player.minionDamage += damageUp; + player.meleeCrit += critUp; + player.rangedCrit += critUp; + player.magicCrit += critUp; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += critUp; + } + if (!bOut) + { + if (gHealer) + { + if (healCounter > 0) { healCounter--; } + if (healCounter <= 0) + { + healCounter = 300; + if (player.whoAmI == Main.myPlayer) + { + int healAmount = 5 + + (gDefense ? 5 : 0) + + (gOffense ? 5 : 0); + player.statLife += healAmount; + player.HealEffect(healAmount); + } + } + } + if (gDefense) + { + player.moveSpeed += 0.1f + + (gOffense ? 0.1f : 0f); + player.endurance += 0.025f + + (gOffense ? 0.025f : 0f); + } + if (gOffense) + { + player.minionDamage += 0.1f + + (gDefense ? 0.05f : 0f); + player.maxMinions++; + } + } + if (revivifyTimer > 0) { revivifyTimer--; } + if (fleshTotemCooldown > 0) { fleshTotemCooldown--; } + if (astralStarRainCooldown > 0) { astralStarRainCooldown--; } + if (bloodflareMageCooldown > 0) { bloodflareMageCooldown--; } + if (tarraMageHealCooldown > 0) { tarraMageHealCooldown--; } + if (ataxiaDmg > 0) { ataxiaDmg--; } + if (xerocDmg > 0) { xerocDmg--; } + if (godSlayerDmg > 0) { godSlayerDmg--; } + if (silvaCountdown > 0 && hasSilvaEffect && silvaSet) + { + player.buffImmune[mod.BuffType("VulnerabilityHex")] = true; + silvaCountdown--; + if (silvaCountdown <= 0) + { + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/SilvaDispel"), (int)player.position.X, (int)player.position.Y); + } + for (int j = 0; j < 2; j++) + { + int num = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, 157, 0f, 0f, 100, new Color(Main.DiscoR, 203, 103), 2f); + Dust expr_A4_cp_0 = Main.dust[num]; + expr_A4_cp_0.position.X = expr_A4_cp_0.position.X + (float)Main.rand.Next(-20, 21); + Dust expr_CB_cp_0 = Main.dust[num]; + expr_CB_cp_0.position.Y = expr_CB_cp_0.position.Y + (float)Main.rand.Next(-20, 21); + Main.dust[num].velocity *= 0.9f; + Main.dust[num].noGravity = true; + Main.dust[num].scale *= 1f + (float)Main.rand.Next(40) * 0.01f; + Main.dust[num].shader = GameShaders.Armor.GetSecondaryShader(player.cWaist, player); + if (Main.rand.Next(2) == 0) + { + Main.dust[num].scale *= 1f + (float)Main.rand.Next(40) * 0.01f; + } + } + } + if (tarraMelee) + { + if (tarraDefense) + { + tarraDefenseTime--; + if (tarraDefenseTime <= 0) + { + tarraDefenseTime = 600; + tarraCooldown = 1800; + tarraDefense = false; + } + for (int j = 0; j < 2; j++) + { + int num = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, 157, 0f, 0f, 100, new Color(Main.DiscoR, 203, 103), 2f); + Dust expr_A4_cp_0 = Main.dust[num]; + expr_A4_cp_0.position.X = expr_A4_cp_0.position.X + (float)Main.rand.Next(-20, 21); + Dust expr_CB_cp_0 = Main.dust[num]; + expr_CB_cp_0.position.Y = expr_CB_cp_0.position.Y + (float)Main.rand.Next(-20, 21); + Main.dust[num].velocity *= 0.9f; + Main.dust[num].noGravity = true; + Main.dust[num].scale *= 1f + (float)Main.rand.Next(40) * 0.01f; + Main.dust[num].shader = GameShaders.Armor.GetSecondaryShader(player.cWaist, player); + if (Main.rand.Next(2) == 0) + { + Main.dust[num].scale *= 1f + (float)Main.rand.Next(40) * 0.01f; + } + } + } + if (tarraCooldown > 0) { tarraCooldown--; } + } + if (tarraThrowing) + { + if (tarraThrowingCritTimer > 0) { tarraThrowingCritTimer--; } + if (tarraThrowingCrits >= 25) + { + tarraThrowingCrits = 0; + tarraThrowingCritTimer = 1800; + player.immune = true; + player.immuneTime = 300; + } + for (int l = 0; l < 22; l++) + { + int hasBuff = player.buffType[l]; + bool shouldAffect = CalamityMod.debuffList.Contains(hasBuff); + if (shouldAffect) + { + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.1f; + } + } + } + if (bloodflareSet) + { + if (bloodflareHeartTimer > 0) { bloodflareHeartTimer--; } + if (bloodflareManaTimer > 0) { bloodflareManaTimer--; } + } + if (bloodflareMelee) + { + if (bloodflareMeleeHits >= 15) + { + bloodflareMeleeHits = 0; + bloodflareFrenzyTimer = 300; + } + if (bloodflareFrenzyTimer > 0) + { + bloodflareFrenzyTimer--; + if (bloodflareFrenzyTimer <= 0) + { + bloodflareFrenzyCooldown = 1800; + } + player.meleeCrit += 25; + player.meleeDamage += 0.25f; + for (int j = 0; j < 2; j++) + { + int num = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, 5, 0f, 0f, 100, default(Color), 2f); + Dust expr_A4_cp_0 = Main.dust[num]; + expr_A4_cp_0.position.X = expr_A4_cp_0.position.X + (float)Main.rand.Next(-20, 21); + Dust expr_CB_cp_0 = Main.dust[num]; + expr_CB_cp_0.position.Y = expr_CB_cp_0.position.Y + (float)Main.rand.Next(-20, 21); + Main.dust[num].velocity *= 0.9f; + Main.dust[num].noGravity = true; + Main.dust[num].scale *= 1f + (float)Main.rand.Next(40) * 0.01f; + Main.dust[num].shader = GameShaders.Armor.GetSecondaryShader(player.cWaist, player); + if (Main.rand.Next(2) == 0) + { + Main.dust[num].scale *= 1f + (float)Main.rand.Next(40) * 0.01f; + } + } + } + if (bloodflareFrenzyCooldown > 0) { bloodflareFrenzyCooldown--; } + } + if (bloodflareRanged) + { + if (bloodflareRangedCooldown > 0) { bloodflareRangedCooldown--; } + } + if (Main.raining && ZoneSulphur) + { + if (player.ZoneOverworldHeight || player.ZoneSkyHeight) { player.AddBuff(mod.BuffType("Irradiated"), 2); } + } + if (raiderTalisman) { CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += ((float)raiderStack / 250f) * 0.15f; } + if (silvaCountdown <= 0 && hasSilvaEffect && silvaSummon) + { + player.maxMinions += 2; + } + if (sDefense) + { + player.statDefense += 5; + player.endurance += 0.05f; + } + if (absorber) + { + player.moveSpeed += 0.12f; + player.jumpSpeedBoost += 1.2f; + player.statLifeMax2 += 20; + player.thorns = 0.5f; + player.endurance += 0.05f; + if ((double)Math.Abs(player.velocity.X) < 0.05 && (double)Math.Abs(player.velocity.Y) < 0.05 && player.itemAnimation == 0) + { + player.lifeRegen += 2; + player.manaRegenBonus += 2; + } + if (Collision.DrownCollision(player.position, player.width, player.height, player.gravDir)) + { + player.statDefense += 5; + player.endurance += 0.05f; + player.moveSpeed += 0.2f; + } + } + if (coreOfTheBloodGod) { player.statLifeMax2 += player.statLifeMax2 / 5 / 20 * 10; } + if (bloodPact) { player.statLifeMax2 += player.statLifeMax2 / 5 / 20 * 100; } + if (aAmpoule) + { + Lighting.AddLight((int)(player.position.X + (float)(player.width / 2)) / 16, (int)(player.position.Y + (float)(player.height / 2)) / 16, 1f, 1f, 0.6f); + player.endurance += 0.05f; + player.pickSpeed -= 0.5f; + player.buffImmune[70] = true; + player.buffImmune[47] = true; + player.buffImmune[46] = true; + player.buffImmune[44] = true; + player.buffImmune[20] = true; + if (!player.honey && player.lifeRegen < 0) + { + player.lifeRegen += 2; + if (player.lifeRegen > 0) + { + player.lifeRegen = 0; + } + } + player.lifeRegenTime += 1; + player.lifeRegen += 2; + } + else if (cFreeze) + { + Lighting.AddLight((int)(player.Center.X / 16f), (int)(player.Center.Y / 16f), 0.3f, ((float)Main.DiscoG / 400f), 0.5f); + } + else if (sirenIce) + { + Lighting.AddLight((int)(player.position.X + (float)(player.width / 2)) / 16, (int)(player.position.Y + (float)(player.height / 2)) / 16, 0.35f, 1f, 1.25f); + } + else if (sirenBoobs || sirenBoobsAlt) + { + Lighting.AddLight((int)(player.position.X + (float)(player.width / 2)) / 16, (int)(player.position.Y + (float)(player.height / 2)) / 16, 1.5f, 1f, 0.1f); + } + else if (tarraSummon) + { + Lighting.AddLight((int)(player.Center.X / 16f), (int)(player.Center.Y / 16f), 0f, 3f, 0f); + } + if (cFreeze) + { + int num = mod.BuffType("GlacialState"); + float num2 = 200f; + int random = Main.rand.Next(5); + if (player.whoAmI == Main.myPlayer) + { + if (random == 0) + { + for (int l = 0; l < 200; l++) + { + NPC nPC = Main.npc[l]; + if (nPC.active && !nPC.friendly && nPC.damage > 0 && !nPC.dontTakeDamage && !nPC.buffImmune[num] && Vector2.Distance(player.Center, nPC.Center) <= num2) + { + if (nPC.FindBuffIndex(num) == -1) + { + nPC.AddBuff(num, 120, false); + } + } + } + } + } + } + if (invincible || lol) + { + player.thorns = 0f; + player.turtleThorns = false; + } + if (player.vortexStealthActive) + { + player.rangedDamage -= (1f - player.stealth) * 0.4f; //change 80 to 40 + player.rangedCrit -= (int)((1f - player.stealth) * 5f); //change 20 to 15 + } + if (player.inventory[player.selectedItem].type != mod.ItemType("Ataraxia")) + { + ataraxiaDamageBoost = 0f; + ataraxiaDamageBoostCancelTimer = 1200; + } + else + { + if (ataraxiaDamageBoostCancelTimer > 0) + ataraxiaDamageBoostCancelTimer--; + if (ataraxiaDamageBoostCancelTimer <= 0) + { + if (ataraxiaDamageBoost > 0f) + ataraxiaDamageBoost -= 0.01f; + if (ataraxiaDamageBoost < 0f) + ataraxiaDamageBoost = 0f; + } + if (ataraxiaDamageBoostCooldown > 0) + ataraxiaDamageBoostCooldown--; + if (ataraxiaDamageBoost > 0.3f) + ataraxiaDamageBoost = 0.3f; + } + #endregion + #region StandingStillEffects + if (rogueStealthMax > 0f) + { + if (rogueStealth >= rogueStealthMax) //full stealth does more damage + { + if (playRogueStealthSound) + { + playRogueStealthSound = false; + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/RogueStealth"), (int)player.position.X, (int)player.position.Y); + } + //The first projectile thrown will inherit this damage, not the crit. Crit is calculated on enemy hits and is not tied to the projectile + //The moment you use any item/weapon the crit multiplier from stealth will decrease, meaning you will never get the optimal boost + //To remedy this, make stealth increase crit by a larger amount so that it means more + //If not you risk the crit boost feeling negligible + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += rogueStealth * 1f; //100% max damage boost, 160% with Auric + } + else + { + playRogueStealthSound = true; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += rogueStealth * 0.75f; //0% to 75% damage boost, 120% with Auric + } + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += (int)(rogueStealth * 30f); //0% to 30% crit boost, 48% with Auric + player.moveSpeed += rogueStealth * 0.05f; + player.aggro -= (int)((rogueStealth / rogueStealthMax) * 900f); + if (player.itemAnimation > 0) + { + if (rogueStealth > 0f) + { + rogueStealth -= rogueStealthMax * 0.006f; + if (rogueStealth < 0f) + { + rogueStealth = 0f; + } + } + } + else if ((double)Math.Abs(player.velocity.X) < 0.1 && (double)Math.Abs(player.velocity.Y) < 0.1 && !player.mount.Active) + { + if (rogueStealth < rogueStealthMax) + { + rogueStealth += rogueStealthMax * 0.006f; //180 ticks, 3 seconds to reach full stealth + if (rogueStealth > rogueStealthMax) + { + rogueStealth = rogueStealthMax; + } + } + } + } + else + { + rogueStealth = 0f; + } + if (aquaticEmblem) + { + if ((Collision.DrownCollision(player.position, player.width, player.height, player.gravDir) && player.wet && !player.lavaWet && !player.honeyWet) && + !player.mount.Active) + { + if (aquaticBoost > 0f) + { + aquaticBoost -= 0.0002f; //0.015 + if ((double)aquaticBoost <= 0.0) + { + aquaticBoost = 0f; + if (Main.netMode == 1) + { + NetMessage.SendData(84, -1, -1, null, player.whoAmI, 0f, 0f, 0f, 0, 0, 0); + } + } + } + } + else + { + aquaticBoost += 0.0002f; + if (aquaticBoost > 1f) + { + aquaticBoost = 1f; + } + if (player.mount.Active) + { + aquaticBoost = 1f; + } + } + player.statDefense += (int)((1f - aquaticBoost) * 30f); + player.moveSpeed -= (1f - aquaticBoost) * 0.1f; + } + if (auricBoost) + { + if (player.itemAnimation > 0) + { + modStealthTimer = 5; + } + if ((double)Math.Abs(player.velocity.X) < 0.1 && (double)Math.Abs(player.velocity.Y) < 0.1 && !player.mount.Active) + { + if (modStealthTimer == 0 && modStealth > 0f) + { + modStealth -= 0.015f; + if ((double)modStealth <= 0.0) + { + modStealth = 0f; + if (Main.netMode == 1) + { + NetMessage.SendData(84, -1, -1, null, player.whoAmI, 0f, 0f, 0f, 0, 0, 0); + } + } + } + } + else + { + float num27 = Math.Abs(player.velocity.X) + Math.Abs(player.velocity.Y); + modStealth += num27 * 0.0075f; + if (modStealth > 1f) + { + modStealth = 1f; + } + if (player.mount.Active) + { + modStealth = 1f; + } + } + player.meleeDamage += (1f - modStealth) * 0.2f; + player.meleeCrit += (int)((1f - modStealth) * 10f); + player.rangedDamage += (1f - modStealth) * 0.2f; + player.rangedCrit += (int)((1f - modStealth) * 10f); + player.magicDamage += (1f - modStealth) * 0.2f; + player.magicCrit += (int)((1f - modStealth) * 10f); + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += (1f - modStealth) * 0.2f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += (int)((1f - modStealth) * 10f); + player.minionDamage += (1f - modStealth) * 0.2f; + if (modStealthTimer > 0) + { + modStealthTimer--; + } + } + else if (pAmulet) + { + if (player.itemAnimation > 0) + { + modStealthTimer = 5; + } + if ((double)Math.Abs(player.velocity.X) < 0.1 && (double)Math.Abs(player.velocity.Y) < 0.1 && !player.mount.Active) + { + if (modStealthTimer == 0 && modStealth > 0f) + { + modStealth -= 0.015f; + if ((double)modStealth <= 0.0) + { + modStealth = 0f; + if (Main.netMode == 1) + { + NetMessage.SendData(84, -1, -1, null, player.whoAmI, 0f, 0f, 0f, 0, 0, 0); + } + } + } + } + else + { + float num27 = Math.Abs(player.velocity.X) + Math.Abs(player.velocity.Y); + modStealth += num27 * 0.0075f; + if (modStealth > 1f) + { + modStealth = 1f; + } + if (player.mount.Active) + { + modStealth = 1f; + } + } + player.meleeDamage += (1f - modStealth) * 0.2f; + player.meleeCrit += (int)((1f - modStealth) * 10f); + player.aggro -= (int)((1f - modStealth) * 750f); + if (modStealthTimer > 0) + { + modStealthTimer--; + } + } + else + { + modStealth = 1f; + } + #endregion + #region ElysianAegis + if (elysianAegis) + { + bool flag14 = false; + if (elysianGuard) + { + float num29 = shieldInvinc; + shieldInvinc -= 0.08f; + if (shieldInvinc < 0f) + { + shieldInvinc = 0f; + } + else + { + flag14 = true; + } + if (shieldInvinc == 0f && num29 != shieldInvinc && Main.netMode == 1) + { + NetMessage.SendData(84, -1, -1, null, player.whoAmI, 0f, 0f, 0f, 0, 0, 0); + } + player.rangedDamage += (5f - shieldInvinc) * 0.03f; + player.rangedCrit += (int)((5f - shieldInvinc) * 2f); + player.meleeDamage += (5f - shieldInvinc) * 0.03f; + player.meleeCrit += (int)((5f - shieldInvinc) * 2f); + player.magicDamage += (5f - shieldInvinc) * 0.03f; + player.magicCrit += (int)((5f - shieldInvinc) * 2f); + player.minionDamage += (5f - shieldInvinc) * 0.03f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += (5f - shieldInvinc) * 0.03f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += (int)((5f - shieldInvinc) * 2f); + player.aggro += (int)((5f - shieldInvinc) * 220f); + player.statDefense += (int)((5f - shieldInvinc) * 4f); + player.moveSpeed *= 0.85f; + if (player.mount.Active) + { + elysianGuard = false; + } + } + else + { + float num30 = shieldInvinc; + shieldInvinc += 0.08f; + if (shieldInvinc > 5f) + { + shieldInvinc = 5f; + } + else + { + flag14 = true; + } + if (shieldInvinc == 5f && num30 != shieldInvinc && Main.netMode == 1) + { + NetMessage.SendData(84, -1, -1, null, player.whoAmI, 0f, 0f, 0f, 0, 0, 0); + } + } + if (flag14) + { + if (Main.rand.Next(2) == 0) + { + Vector2 vector = Vector2.UnitY.RotatedByRandom(6.2831854820251465); + Dust dust = Main.dust[Dust.NewDust(player.Center - vector * 30f, 0, 0, 244, 0f, 0f, 0, default(Color), 1f)]; + dust.noGravity = true; + dust.position = player.Center - vector * (float)Main.rand.Next(5, 11); + dust.velocity = vector.RotatedBy(1.5707963705062866, default(Vector2)) * 4f; + dust.scale = 0.5f + Main.rand.NextFloat(); + dust.fadeIn = 0.5f; + } + if (Main.rand.Next(2) == 0) + { + Vector2 vector2 = Vector2.UnitY.RotatedByRandom(6.2831854820251465); + Dust dust2 = Main.dust[Dust.NewDust(player.Center - vector2 * 30f, 0, 0, 246, 0f, 0f, 0, default(Color), 1f)]; + dust2.noGravity = true; + dust2.position = player.Center - vector2 * 12f; + dust2.velocity = vector2.RotatedBy(-1.5707963705062866, default(Vector2)) * 2f; + dust2.scale = 0.5f + Main.rand.NextFloat(); + dust2.fadeIn = 0.5f; + } + } + } + else + { + elysianGuard = false; + } + #endregion + #region OtherBuffs + if (irradiated) + { + player.statDefense -= 10; + player.endurance -= 0.1f; + player.meleeDamage += 0.05f; + player.magicDamage += 0.05f; + player.rangedDamage += 0.05f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.05f; + player.minionDamage += 0.05f; + player.minionKB += 0.5f; + player.moveSpeed += 0.05f; + } + if (rRage) + { + player.meleeDamage += 0.05f; + player.magicDamage += 0.05f; + player.rangedDamage += 0.05f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.05f; + player.minionDamage += 0.05f; + player.moveSpeed += 0.05f; + } + if (xRage) + { + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.1f; + player.rangedDamage += 0.1f; + player.meleeDamage += 0.1f; + player.magicDamage += 0.1f; + player.minionDamage += 0.1f; + } + if (xWrath) + { + player.meleeCrit += 5; + player.magicCrit += 5; + player.rangedCrit += 5; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 5; + } + if (godSlayerCooldown) + { + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.1f; + player.rangedDamage += 0.1f; + player.meleeDamage += 0.1f; + player.magicDamage += 0.1f; + player.minionDamage += 0.1f; + } + if (graxDefense) + { + player.statDefense += 15; + player.endurance += 0.05f; + player.meleeDamage += 0.1f; + } + if (sMeleeBoost) + { + player.meleeDamage += 0.1f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.1f; + player.rangedDamage += 0.1f; + player.magicDamage += 0.1f; + player.minionDamage += 0.1f; + player.meleeCrit += 5; + player.magicCrit += 5; + player.rangedCrit += 5; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 5; + } + if (tFury) + { + player.meleeDamage += 0.3f; + player.meleeCrit += 10; + } + if (yPower) + { + player.endurance += 0.05f; + player.statDefense += 5; + player.meleeCrit += 2; + player.meleeDamage += 0.06f; + player.magicCrit += 2; + player.magicDamage += 0.06f; + player.rangedCrit += 2; + player.rangedDamage += 0.06f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 2; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.06f; + player.minionDamage += 0.06f; + player.minionKB += 1f; + player.moveSpeed += 0.15f; + } + if (tScale) + { + player.endurance += 0.05f; + player.statDefense += 5; + player.kbBuff = true; + } + if (darkSunRing) + { + player.maxMinions += 2; + player.meleeDamage += 0.1f; + player.rangedDamage += 0.1f; + player.magicDamage += 0.1f; + player.minionDamage += 0.1f; + player.minionKB += 1f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.1f; + player.pickSpeed -= 0.3f; + if (Main.dayTime) + { + player.lifeRegen += 2; + } + else + { + player.statDefense += 20; + } + } + if (eGauntlet) + { + player.longInvince = true; + player.kbGlove = true; + player.meleeDamage += 0.15f; + player.meleeCrit += 5; + player.lavaMax += 240; + } + if (yInsignia) + { + player.longInvince = true; + player.kbGlove = true; + player.meleeDamage += 0.05f; + player.lavaMax += 240; + if (player.statLife <= (player.statLifeMax2 * 0.5f)) + { + player.meleeDamage += 0.1f; + player.magicDamage += 0.1f; + player.rangedDamage += 0.1f; + player.thrownDamage += 0.1f; + player.minionDamage += 0.1f; + } + } + if (fabsolVodka) + { + alcoholPoisonLevel++; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.08f; + player.rangedDamage += 0.08f; + player.meleeDamage += 0.08f; + player.magicDamage += 0.08f; + player.minionDamage += 0.08f; + player.statDefense -= 20; + } + if (vodka) + { + alcoholPoisonLevel++; + player.lifeRegen -= 1; + player.statDefense -= 4; + player.meleeCrit += 2; + player.meleeDamage += 0.06f; + player.magicCrit += 2; + player.magicDamage += 0.06f; + player.rangedCrit += 2; + player.rangedDamage += 0.06f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 2; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.06f; + player.minionDamage += 0.06f; + } + if (redWine) + { + alcoholPoisonLevel++; + player.lifeRegen -= 1; + } + if (grapeBeer) + { + alcoholPoisonLevel++; + player.statDefense -= 2; + player.moveSpeed -= 0.05f; + } + if (moonshine) + { + alcoholPoisonLevel++; + player.lifeRegen -= 1; + player.statDefense += 10; + player.endurance += 0.05f; + } + if (rum) + { + alcoholPoisonLevel++; + player.lifeRegen += 2; + player.moveSpeed += 0.1f; + player.statDefense -= 8; + } + if (fireball) + { + alcoholPoisonLevel++; + player.lifeRegen -= 1; + } + if (whiskey) + { + alcoholPoisonLevel++; + player.statDefense -= 8; + player.meleeCrit += 2; + player.meleeDamage += 0.04f; + player.magicCrit += 2; + player.magicDamage += 0.04f; + player.rangedCrit += 2; + player.rangedDamage += 0.04f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 2; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.04f; + player.minionDamage += 0.04f; + } + if (everclear) + { + alcoholPoisonLevel += 2; + player.lifeRegen -= 10; + player.statDefense -= 40; + player.meleeDamage += 0.25f; + player.magicDamage += 0.25f; + player.rangedDamage += 0.25f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.25f; + player.minionDamage += 0.25f; + } + if (bloodyMary) + { + alcoholPoisonLevel++; + player.lifeRegen -= 2; + if (Main.bloodMoon) + { + player.statDefense -= 6; + player.meleeCrit += 7; + player.meleeDamage += 0.15f; + player.magicCrit += 7; + player.magicDamage += 0.15f; + player.rangedCrit += 7; + player.rangedDamage += 0.15f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 7; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.15f; + player.minionDamage += 0.15f; + player.moveSpeed += 0.15f; + } + } + if (tequila) + { + alcoholPoisonLevel++; + player.lifeRegen -= 1; + if (Main.dayTime) + { + player.statDefense += 5; + player.meleeCrit += 2; + player.meleeDamage += 0.03f; + player.magicCrit += 2; + player.magicDamage += 0.03f; + player.rangedCrit += 2; + player.rangedDamage += 0.03f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 2; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.03f; + player.minionDamage += 0.03f; + player.endurance += 0.03f; + } + } + if (tequilaSunrise) + { + alcoholPoisonLevel++; + player.lifeRegen -= 1; + if (Main.dayTime) + { + player.statDefense += 15; + player.meleeCrit += 3; + player.meleeDamage += 0.07f; + player.magicCrit += 3; + player.magicDamage += 0.07f; + player.rangedCrit += 3; + player.rangedDamage += 0.07f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 3; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.07f; + player.minionDamage += 0.07f; + player.endurance += 0.07f; + } + } + if (screwdriver) + { + alcoholPoisonLevel++; + player.lifeRegen -= 1; + } + if (caribbeanRum) + { + alcoholPoisonLevel++; + player.lifeRegen += 2; + player.moveSpeed += 0.2f; + player.statDefense -= 12; + } + if (cinnamonRoll) + { + alcoholPoisonLevel++; + player.statDefense -= 12; + player.manaRegenDelay--; + player.manaRegenBonus += 10; + } + if (margarita) + { + alcoholPoisonLevel++; + player.lifeRegen -= 1; + player.statDefense -= 6; + } + if (starBeamRye) + { + alcoholPoisonLevel++; + player.lifeRegen -= 1; + player.statDefense -= 6; + player.magicDamage += 0.08f; + player.manaCost *= 0.9f; + } + if (moscowMule) + { + alcoholPoisonLevel++; + player.lifeRegen -= 2; + player.meleeCrit += 3; + player.meleeDamage += 0.09f; + player.magicCrit += 3; + player.magicDamage += 0.09f; + player.rangedCrit += 3; + player.rangedDamage += 0.09f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 3; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.09f; + player.minionDamage += 0.09f; + } + if (whiteWine) + { + alcoholPoisonLevel++; + player.lifeRegen -= 1; + player.statDefense -= 6; + player.magicDamage += 0.1f; + } + if (evergreenGin) + { + alcoholPoisonLevel++; + player.lifeRegen -= 1; + player.endurance += 0.05f; + } + if (alcoholPoisonLevel > 3) + { + if (player.lifeRegen > 0) + { + player.lifeRegen = 0; + } + player.lifeRegenTime = 0; + player.lifeRegen -= 3 * alcoholPoisonLevel; + } + if (giantPearl) + { + if (Main.netMode != 1) + { + for (int m = 0; m < 200; m++) + { + if (Main.npc[m].active && !Main.npc[m].friendly) + { + float distance = (Main.npc[m].Center - player.Center).Length(); + if (distance < 120f) + { + Main.npc[m].AddBuff(mod.BuffType("PearlAura"), 2, false); + } + } + } + } + } + if (normalityRelocator) + { + player.moveSpeed += 0.1f; + player.maxFallSpeed *= 1.1f; + } + if (CalamityMod.scopedWeaponList.Contains(player.inventory[player.selectedItem].type)) + { + player.scope = true; + } + if (harpyRing) + { + if (player.wingTimeMax > 0) + { + player.wingTimeMax = (int)((double)player.wingTimeMax * 1.25); + } + player.moveSpeed += 0.2f; + } + if (blueCandle) + { + if (player.wingTimeMax > 0) + { + player.wingTimeMax = (int)((double)player.wingTimeMax * 1.1); + } + player.moveSpeed += 0.15f; + } + if (community) + { + float floatTypeBoost = 0.01f + + (NPC.downedSlimeKing ? 0.01f : 0f) + + (NPC.downedBoss1 ? 0.01f : 0f) + + (NPC.downedBoss2 ? 0.01f : 0f) + + (NPC.downedQueenBee ? 0.01f : 0f) + //0.05 + (NPC.downedBoss3 ? 0.01f : 0f) + + (Main.hardMode ? 0.01f : 0f) + + (NPC.downedMechBossAny ? 0.01f : 0f) + + (NPC.downedPlantBoss ? 0.01f : 0f) + + (NPC.downedGolemBoss ? 0.01f : 0f) + //0.1 + (NPC.downedFishron ? 0.01f : 0f) + + (NPC.downedAncientCultist ? 0.01f : 0f) + + (NPC.downedMoonlord ? 0.01f : 0f) + + (CalamityWorld.downedProvidence ? 0.02f : 0f) + //0.15 + (CalamityWorld.downedDoG ? 0.02f : 0f) + //0.17 + (CalamityWorld.downedYharon ? 0.03f : 0f); //0.2 + int integerTypeBoost = (int)(floatTypeBoost * 50f); + int critBoost = integerTypeBoost / 2; + int regenBoost = 1 + (integerTypeBoost / 5); + float damageBoost = floatTypeBoost * 0.5f; + player.endurance += (floatTypeBoost * 0.25f); + player.statDefense += integerTypeBoost; + player.meleeCrit += critBoost; + player.meleeDamage += damageBoost; + player.magicCrit += critBoost; + player.magicDamage += damageBoost; + player.rangedCrit += critBoost; + player.rangedDamage += damageBoost; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += critBoost; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += damageBoost; + player.minionDamage += damageBoost; + player.minionKB += floatTypeBoost; + player.moveSpeed += floatTypeBoost; + player.statLifeMax2 += player.statLifeMax / 5 / 20 * integerTypeBoost; + bool lesserEffect = false; + for (int l = 0; l < 22; l++) + { + int hasBuff = player.buffType[l]; + bool shouldAffect = CalamityMod.alcoholList.Contains(hasBuff); + if (shouldAffect) + { + lesserEffect = true; + } + } + if (player.lifeRegen < 0) + { + player.lifeRegen += lesserEffect ? 1 : regenBoost; + } + if (player.wingTimeMax > 0) + { + player.wingTimeMax = (int)((double)player.wingTimeMax * 1.15); + } + } + if (pinkCandle) + { + if (pinkCandleTimer > 0) { pinkCandleTimer--; } // 1 per second + if (pinkCandleTimer <= 0) + { + if (player.statLife < player.statLifeMax2) + { + float regen = (float)player.statLifeMax2 * 0.004f; + player.statLife += (int)regen; + } + pinkCandleTimer = 60; + } + } + if (rBrain) + { + if (player.statLife <= (int)((double)player.statLifeMax2 * 0.75)) + { + player.meleeDamage += 0.1f; + player.magicDamage += 0.1f; + player.rangedDamage += 0.1f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.1f; + player.minionDamage += 0.1f; + } + if (player.statLife <= (int)((double)player.statLifeMax2 * 0.5)) + { + player.moveSpeed -= 0.05f; + } + } + if (bloodyWormTooth) + { + if (player.statLife < (int)((double)player.statLifeMax2 * 0.5)) + { + player.meleeDamage += 0.1f; + player.meleeSpeed += 0.1f; + player.endurance += 0.1f; + } + else + { + player.meleeDamage += 0.05f; + player.meleeSpeed += 0.05f; + player.endurance += 0.05f; + } + } + if (rampartOfDeities) + { + player.panic = true; + player.armorPenetration += 50; + player.manaMagnet = true; + player.magicCuffs = true; + if (Collision.DrownCollision(player.position, player.width, player.height, player.gravDir)) + { + Lighting.AddLight((int)player.Center.X / 16, (int)player.Center.Y / 16, 1.35f, 0.3f, 0.9f); + } + player.noKnockback = true; + if (player.statLife > (int)((double)player.statLifeMax2 * 0.25)) + { + player.hasPaladinShield = true; + if (player.whoAmI != Main.myPlayer && player.miscCounter % 10 == 0) + { + int myPlayer = Main.myPlayer; + if (Main.player[myPlayer].team == player.team && player.team != 0) + { + float arg = player.position.X - Main.player[myPlayer].position.X; + float num3 = player.position.Y - Main.player[myPlayer].position.Y; + if ((float)Math.Sqrt((double)(arg * arg + num3 * num3)) < 800f) + { + Main.player[myPlayer].AddBuff(43, 20, true); + } + } + } + } + if (player.statLife <= (int)((double)player.statLifeMax2 * 0.5)) + { + player.AddBuff(62, 5, true); + } + if (player.statLife <= (int)((double)player.statLifeMax2 * 0.15)) + { + player.endurance += 0.05f; + } + } + else if (fBulwark) + { + player.noKnockback = true; + if (player.statLife > (int)((double)player.statLifeMax2 * 0.25)) + { + player.hasPaladinShield = true; + if (player.whoAmI != Main.myPlayer && player.miscCounter % 10 == 0) + { + int myPlayer = Main.myPlayer; + if (Main.player[myPlayer].team == player.team && player.team != 0) + { + float arg = player.position.X - Main.player[myPlayer].position.X; + float num3 = player.position.Y - Main.player[myPlayer].position.Y; + if ((float)Math.Sqrt((double)(arg * arg + num3 * num3)) < 800f) + { + Main.player[myPlayer].AddBuff(43, 20, true); + } + } + } + } + if (player.statLife <= (int)((double)player.statLifeMax2 * 0.5)) + { + player.AddBuff(62, 5, true); + } + if (player.statLife <= (int)((double)player.statLifeMax2 * 0.15)) + { + player.endurance += 0.05f; + } + } + if (frostFlare) + { + player.resistCold = true; + player.buffImmune[44] = true; + player.buffImmune[46] = true; + player.buffImmune[47] = true; + if (player.statLife > (int)((double)player.statLifeMax2 * 0.75)) + { + player.meleeDamage += 0.1f; + player.magicDamage += 0.1f; + player.rangedDamage += 0.1f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.1f; + player.minionDamage += 0.1f; + } + if (player.statLife < (int)((double)player.statLifeMax2 * 0.25)) + { + player.statDefense += 10; + } + } + if (vexation) + { + if (player.statLife < (int)((double)player.statLifeMax2 * 0.5)) + { + player.meleeDamage += 0.15f; + player.magicDamage += 0.15f; + player.rangedDamage += 0.15f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.15f; + player.minionDamage += 0.15f; + } + } + if (ataxiaBlaze) + { + if (player.statLife <= (int)((double)player.statLifeMax2 * 0.5)) + { + player.AddBuff(BuffID.Inferno, 2); + } + } + if (bloodflareThrowing) + { + if (player.statLife > (int)((double)player.statLifeMax2 * 0.8)) + { + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 5; + player.statDefense += 30; + } + else + { + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.1f; + } + } + if (bloodflareSummon) + { + if (player.statLife >= (int)((double)player.statLifeMax2 * 0.9)) + { + player.minionDamage += 0.1f; + } + else if (player.statLife <= (int)((double)player.statLifeMax2 * 0.5)) + { + player.statDefense += 20; + player.lifeRegen += 2; + } + if (bloodflareSummonTimer > 0) { bloodflareSummonTimer--; } + if (player.whoAmI == Main.myPlayer && bloodflareSummonTimer <= 0) + { + bloodflareSummonTimer = 900; + for (int I = 0; I < 3; I++) + { + float ai1 = (float)(I * 120); + Projectile.NewProjectile(player.Center.X + (float)(Math.Sin(I * 120) * 550), player.Center.Y + (float)(Math.Cos(I * 120) * 550), 0f, 0f, + mod.ProjectileType("GhostlyMine"), (int)((auricSet ? 15000f : 5000f) * player.minionDamage), 1f, player.whoAmI, ai1, 0f); + } + } + } + if (reaperToothNecklace) + { + player.meleeDamage += 0.25f; + player.magicDamage += 0.25f; + player.rangedDamage += 0.25f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.25f; + player.minionDamage += 0.25f; + player.statDefense /= 2; + } + if (coreOfTheBloodGod) + { + player.endurance += 0.05f; + player.meleeDamage += 0.07f; + player.magicDamage += 0.07f; + player.rangedDamage += 0.07f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.07f; + player.minionDamage += 0.07f; + if (player.statDefense < 100) + { + player.meleeDamage += 0.15f; + player.magicDamage += 0.15f; + player.rangedDamage += 0.15f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.15f; + player.minionDamage += 0.15f; + } + } + else if (bloodflareCore) + { + if (player.statDefense < 100) + { + player.meleeDamage += 0.15f; + player.magicDamage += 0.15f; + player.rangedDamage += 0.15f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.15f; + player.minionDamage += 0.15f; + } + if (player.statLife <= (int)((double)player.statLifeMax2 * 0.15)) + { + player.endurance += 0.1f; + player.meleeDamage += 0.2f; + player.magicDamage += 0.2f; + player.rangedDamage += 0.2f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.2f; + player.minionDamage += 0.2f; + } + else if (player.statLife <= (int)((double)player.statLifeMax2 * 0.5)) + { + player.endurance += 0.05f; + player.meleeDamage += 0.1f; + player.magicDamage += 0.1f; + player.rangedDamage += 0.1f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.1f; + player.minionDamage += 0.1f; + } + } + if (godSlayerThrowing) + { + if (player.statLife >= player.statLifeMax2) + { + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 10; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.1f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingVelocity += 0.1f; + } + } + if (tarraSummon) + { + int lifeCounter = 0; + float num2 = 300f; + bool flag = lifeCounter % 60 == 0; + int num3 = 200; + if (player.whoAmI == Main.myPlayer) + { + for (int l = 0; l < 200; l++) + { + NPC nPC = Main.npc[l]; + if (nPC.active && !nPC.friendly && nPC.damage > 0 && !nPC.dontTakeDamage && Vector2.Distance(player.Center, nPC.Center) <= num2) + { + if (flag) + { + nPC.StrikeNPC(num3, 0f, 0, false, false, false); + if (Main.netMode != 0) + { + NetMessage.SendData(28, -1, -1, null, l, (float)num3, 0f, 0f, 0, 0, 0); + } + } + } + } + } + lifeCounter++; + if (lifeCounter >= 180) + { + lifeCounter = 0; + } + if (player.statLife >= player.statLifeMax2) + { + player.minionDamage += 0.1f; + player.maxMinions += 2; + } + } + #endregion + #region LimitsAndOtherShit + if (player.meleeSpeed < 0.5f) + { + player.meleeSpeed = 0.5f; + } + if (auricSet && silvaMelee) + { + double multiplier = (double)player.statLife / (double)player.statLifeMax2; + player.meleeDamage += (float)(multiplier * 0.2); //ranges from 1.2 times to 1 times + } + if (player.endurance > defEndurance) //0.33 + { + float damageReductionAboveCap = player.endurance - defEndurance; //0.6 - 0.33 = 0.27 + player.endurance = defEndurance + (damageReductionAboveCap * 0.1f); //0.33 + (0.27 * 0.1) = 0.357 + } + if (player.statLife < player.statLifeMax2 && CalamityWorld.revenge) + { + bool noLifeRegenCap = ((player.shinyStone || draedonsHeart || cFreeze || shadeRegen) && + (double)Math.Abs(player.velocity.X) < 0.05 && (double)Math.Abs(player.velocity.Y) < 0.05 && player.itemAnimation == 0); + if (!noLifeRegenCap) + { + //Max HP = 400 + //350 HP = 1 - 0.875 * 10 = 1.25 = 1 + //100 HP = 1 - 0.25 * 10 = 7.5 = 7 + //200 HP = 1 - 0.5 * 10 = 5 + int lifeRegenScale = (int)(1f - ((float)player.statLife / (float)player.statLifeMax2)) * 10; //9 to 0 (1% HP to 100%) + if (player.lifeRegen > lifeRegenScale) + { + double lifeRegenScalar = (double)(1f + ((float)player.statLife / (float)player.statLifeMax2)); //1 to 2 (1% HP to 100%) + int defLifeRegen = (int)((double)player.lifeRegen / lifeRegenScalar); + player.lifeRegen = defLifeRegen; + } + } + } + #region MeleeLevelBoosts + if (meleeLevel >= 12500) + { + player.meleeDamage += 0.12f; + player.meleeCrit += 6; + } + else if (meleeLevel >= 10500) + { + player.meleeDamage += 0.1f; + player.meleeCrit += 5; + } + else if (meleeLevel >= 9100) + { + player.meleeDamage += 0.09f; + player.meleeCrit += 5; + } + else if (meleeLevel >= 7800) + { + player.meleeDamage += 0.08f; + player.meleeCrit += 4; + } + else if (meleeLevel >= 6600) + { + player.meleeDamage += 0.07f; + player.meleeCrit += 4; + } + else if (meleeLevel >= 5500) //hm limit + { + player.meleeDamage += 0.06f; + player.meleeCrit += 3; + } + else if (meleeLevel >= 4500) + { + player.meleeDamage += 0.05f; + player.meleeCrit += 3; + } + else if (meleeLevel >= 3600) + { + player.meleeDamage += 0.05f; + player.meleeCrit += 2; + } + else if (meleeLevel >= 2800) + { + player.meleeDamage += 0.04f; + player.meleeCrit += 2; + } + else if (meleeLevel >= 2100) + { + player.meleeDamage += 0.04f; + player.meleeCrit += 1; + } + else if (meleeLevel >= 1500) //prehm limit + { + player.meleeDamage += 0.03f; + player.meleeCrit += 1; + } + else if (meleeLevel >= 1000) + { + player.meleeDamage += 0.03f; + player.meleeCrit += 1; + } + else if (meleeLevel >= 600) + { + player.meleeDamage += 0.02f; + } + else if (meleeLevel >= 300) + player.meleeDamage += 0.02f; + else if (meleeLevel >= 100) + player.meleeDamage += 0.01f; + #endregion + #region RangedLevelBoosts + if (rangedLevel >= 12500) + { + player.rangedDamage += 0.12f; + player.moveSpeed += 0.12f; + player.rangedCrit += 6; + } + else if (rangedLevel >= 10500) + { + player.rangedDamage += 0.1f; + player.moveSpeed += 0.1f; + player.rangedCrit += 5; + } + else if (rangedLevel >= 9100) + { + player.rangedDamage += 0.09f; + player.moveSpeed += 0.09f; + player.rangedCrit += 5; + } + else if (rangedLevel >= 7800) + { + player.rangedDamage += 0.08f; + player.moveSpeed += 0.08f; + player.rangedCrit += 4; + } + else if (rangedLevel >= 6600) + { + player.rangedDamage += 0.07f; + player.moveSpeed += 0.07f; + player.rangedCrit += 4; + } + else if (rangedLevel >= 5500) + { + player.rangedDamage += 0.06f; + player.moveSpeed += 0.06f; + player.rangedCrit += 3; + } + else if (rangedLevel >= 4500) + { + player.rangedDamage += 0.05f; + player.moveSpeed += 0.05f; + player.rangedCrit += 3; + } + else if (rangedLevel >= 3600) + { + player.rangedDamage += 0.05f; + player.moveSpeed += 0.05f; + player.rangedCrit += 2; + } + else if (rangedLevel >= 2800) + { + player.rangedDamage += 0.04f; + player.moveSpeed += 0.04f; + player.rangedCrit += 2; + } + else if (rangedLevel >= 2100) + { + player.rangedDamage += 0.04f; + player.moveSpeed += 0.03f; + player.rangedCrit += 1; + } + else if (rangedLevel >= 1500) + { + player.rangedDamage += 0.03f; + player.moveSpeed += 0.02f; + player.rangedCrit += 1; + } + else if (rangedLevel >= 1000) + { + player.rangedDamage += 0.03f; + player.moveSpeed += 0.01f; + player.rangedCrit += 1; + } + else if (rangedLevel >= 600) + { + player.rangedDamage += 0.02f; + player.rangedCrit += 1; + } + else if (rangedLevel >= 300) + player.rangedDamage += 0.02f; + else if (rangedLevel >= 100) + player.rangedDamage += 0.01f; + #endregion + #region MagicLevelBoosts + if (magicLevel >= 12500) + { + player.magicDamage += 0.12f; + player.manaCost *= 0.88f; + player.magicCrit += 6; + } + else if (magicLevel >= 10500) + { + player.magicDamage += 0.1f; + player.manaCost *= 0.9f; + player.magicCrit += 5; + } + else if (magicLevel >= 9100) + { + player.magicDamage += 0.09f; + player.manaCost *= 0.91f; + player.magicCrit += 5; + } + else if (magicLevel >= 7800) + { + player.magicDamage += 0.08f; + player.manaCost *= 0.92f; + player.magicCrit += 4; + } + else if (magicLevel >= 6600) + { + player.magicDamage += 0.07f; + player.manaCost *= 0.93f; + player.magicCrit += 4; + } + else if (magicLevel >= 5500) + { + player.magicDamage += 0.06f; + player.manaCost *= 0.94f; + player.magicCrit += 3; + } + else if (magicLevel >= 4500) + { + player.magicDamage += 0.05f; + player.manaCost *= 0.95f; + player.magicCrit += 3; + } + else if (magicLevel >= 3600) + { + player.magicDamage += 0.05f; + player.manaCost *= 0.95f; + player.magicCrit += 2; + } + else if (magicLevel >= 2800) + { + player.magicDamage += 0.04f; + player.manaCost *= 0.96f; + player.magicCrit += 2; + } + else if (magicLevel >= 2100) + { + player.magicDamage += 0.04f; + player.manaCost *= 0.97f; + player.magicCrit += 1; + } + else if (magicLevel >= 1500) + { + player.magicDamage += 0.03f; + player.manaCost *= 0.98f; + player.magicCrit += 1; + } + else if (magicLevel >= 1000) + { + player.magicDamage += 0.03f; + player.manaCost *= 0.99f; + player.magicCrit += 1; + } + else if (magicLevel >= 600) + { + player.magicDamage += 0.02f; + player.manaCost *= 0.99f; + } + else if (magicLevel >= 300) + player.magicDamage += 0.02f; + else if (magicLevel >= 100) + player.magicDamage += 0.01f; + #endregion + #region SummonLevelBoosts + if (summonLevel >= 12500) + { + player.minionDamage += 0.12f; + player.minionKB += 3.0f; + player.maxMinions += 3; + } + else if (summonLevel >= 10500) + { + player.minionDamage += 0.1f; + player.minionKB += 3.0f; + player.maxMinions += 2; + } + else if (summonLevel >= 9100) + { + player.minionDamage += 0.09f; + player.minionKB += 2.7f; + player.maxMinions += 2; + } + else if (summonLevel >= 7800) + { + player.minionDamage += 0.08f; + player.minionKB += 2.4f; + player.maxMinions += 2; + } + else if (summonLevel >= 6600) + { + player.minionDamage += 0.07f; + player.minionKB += 2.1f; + player.maxMinions += 2; + } + else if (summonLevel >= 5500) + { + player.minionDamage += 0.06f; + player.minionKB += 1.8f; + player.maxMinions += 2; + } + else if (summonLevel >= 4500) + { + player.minionDamage += 0.06f; + player.minionKB += 1.8f; + player.maxMinions++; + } + else if (summonLevel >= 3600) + { + player.minionDamage += 0.05f; + player.minionKB += 1.5f; + player.maxMinions++; + } + else if (summonLevel >= 2800) + { + player.minionDamage += 0.04f; + player.minionKB += 1.2f; + player.maxMinions++; + } + else if (summonLevel >= 2100) + { + player.minionDamage += 0.04f; + player.minionKB += 0.9f; + player.maxMinions++; + } + else if (summonLevel >= 1500) + { + player.minionDamage += 0.03f; + player.minionKB += 0.6f; + } + else if (summonLevel >= 1000) + { + player.minionDamage += 0.03f; + player.minionKB += 0.3f; + } + else if (summonLevel >= 600) + { + player.minionDamage += 0.02f; + player.minionKB += 0.3f; + } + else if (summonLevel >= 300) + player.minionDamage += 0.02f; + else if (summonLevel >= 100) + player.minionDamage += 0.01f; + #endregion + #region RogueLevelBoosts + if (rogueLevel >= 12500) + { + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.12f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingVelocity += 0.12f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 6; + } + else if (rogueLevel >= 10500) + { + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.1f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingVelocity += 0.1f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 5; + } + else if (rogueLevel >= 9100) + { + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.09f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingVelocity += 0.09f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 5; + } + else if (rogueLevel >= 7800) + { + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.08f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingVelocity += 0.08f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 4; + } + else if (rogueLevel >= 6600) + { + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.07f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingVelocity += 0.07f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 4; + } + else if (rogueLevel >= 5500) + { + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.06f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingVelocity += 0.06f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 3; + } + else if (rogueLevel >= 4500) + { + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.05f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingVelocity += 0.05f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 3; + } + else if (rogueLevel >= 3600) + { + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.05f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingVelocity += 0.05f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 2; + } + else if (rogueLevel >= 2800) + { + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.04f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingVelocity += 0.04f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 2; + } + else if (rogueLevel >= 2100) + { + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.04f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingVelocity += 0.03f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 1; + } + else if (rogueLevel >= 1500) + { + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.03f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingVelocity += 0.02f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 1; + } + else if (rogueLevel >= 1000) + { + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.03f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingVelocity += 0.01f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 1; + } + else if (rogueLevel >= 600) + { + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.02f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingVelocity += 0.01f; + } + else if (rogueLevel >= 300) + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.02f; + else if (rogueLevel >= 100) + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.01f; + #endregion + if (dArtifact) + { + player.meleeDamage += 0.25f; + player.magicDamage += 0.25f; + player.rangedDamage += 0.25f; + player.minionDamage += 0.25f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.25f; + } + if (trippy) + { + player.meleeDamage += 0.5f; + player.magicDamage += 0.5f; + player.rangedDamage += 0.5f; + player.minionDamage += 0.5f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.5f; + } + if (eArtifact) + { + player.manaCost *= 0.85f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.15f; + player.maxMinions += 2; + } + if (gArtifact) + { + player.maxMinions += 8; + if (player.whoAmI == Main.myPlayer) + { + if (player.FindBuffIndex(mod.BuffType("AngryChicken")) == -1) + { + player.AddBuff(mod.BuffType("AngryChicken"), 3600, true); + } + if (player.ownedProjectileCounts[mod.ProjectileType("AngryChicken")] < 2) + { + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, 0f, mod.ProjectileType("AngryChicken"), (int)(232f * player.minionDamage), 2f, Main.myPlayer, 0f, 0f); + } + } + } + if (pArtifact) + { + if (player.whoAmI == Main.myPlayer) + { + if (player.FindBuffIndex(mod.BuffType("GuardianHealer")) == -1) + { + player.AddBuff(mod.BuffType("GuardianHealer"), 3600, true); + } + if (player.ownedProjectileCounts[mod.ProjectileType("MiniGuardianHealer")] < 1) + { + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -6f, mod.ProjectileType("MiniGuardianHealer"), 0, 0f, Main.myPlayer, 0f, 0f); + } + float baseDamage = 100f + + (CalamityWorld.downedDoG ? 100f : 0f) + + (CalamityWorld.downedYharon ? 100f : 0f); + if (player.maxMinions >= 8) + { + if (player.FindBuffIndex(mod.BuffType("GuardianDefense")) == -1) + { + player.AddBuff(mod.BuffType("GuardianDefense"), 3600, true); + } + if (player.ownedProjectileCounts[mod.ProjectileType("MiniGuardianDefense")] < 1) + { + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -3f, mod.ProjectileType("MiniGuardianDefense"), (int)(baseDamage * player.minionDamage), 1f, Main.myPlayer, 0f, 0f); + } + } + if (tarraSummon || bloodflareSummon || godSlayerSummon || silvaSummon || dsSetBonus || omegaBlueSet) + { + if (player.FindBuffIndex(mod.BuffType("GuardianOffense")) == -1) + { + player.AddBuff(mod.BuffType("GuardianOffense"), 3600, true); + } + if (player.ownedProjectileCounts[mod.ProjectileType("MiniGuardianAttack")] < 1) + { + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, mod.ProjectileType("MiniGuardianAttack"), (int)(baseDamage * player.minionDamage), 1f, Main.myPlayer, 0f, 0f); + } + } + } + } + if (player.ownedProjectileCounts[mod.ProjectileType("BigBustyRose")] > 1 || player.ownedProjectileCounts[mod.ProjectileType("SirenLure")] > 1 || + player.ownedProjectileCounts[mod.ProjectileType("DrewsSandyWaifu")] > 1 || player.ownedProjectileCounts[mod.ProjectileType("SandyWaifu")] > 1 || + player.ownedProjectileCounts[mod.ProjectileType("CloudWaifu")] > 1 || player.ownedProjectileCounts[mod.ProjectileType("FungalClump")] > 1) + { + for (int projIndex = 0; projIndex < 1000; projIndex++) + { + if (Main.projectile[projIndex].active && Main.projectile[projIndex].owner == player.whoAmI) + { + if (Main.projectile[projIndex].type == mod.ProjectileType("BigBustyRose") || Main.projectile[projIndex].type == mod.ProjectileType("SirenLure") || + Main.projectile[projIndex].type == mod.ProjectileType("DrewsSandyWaifu") || Main.projectile[projIndex].type == mod.ProjectileType("SandyWaifu") || + Main.projectile[projIndex].type == mod.ProjectileType("CloudWaifu") || Main.projectile[projIndex].type == mod.ProjectileType("FungalClump")) + { + Main.projectile[projIndex].Kill(); + } + } + } + } + if (marked || reaperToothNecklace) + { + player.endurance *= 0.5f; + } + #endregion + } + + public override void PostUpdateRunSpeeds() + { + #region SpeedBoosts + if (hAttack) { if (!Main.dayTime) { @@ -5379,106 +5970,127 @@ namespace CalamityMod player.maxRunSpeed *= 1.05f; } } - if (stressPills || laudanum) + if (stressPills || laudanum || draedonsHeart) { player.runAcceleration *= 1.05f; player.maxRunSpeed *= 1.05f; } - if (abyssalDivingSuit) - { - player.runAcceleration *= Collision.DrownCollision(player.position, player.width, player.height, player.gravDir) ? 1.05f : 0.4f; - player.maxRunSpeed *= Collision.DrownCollision(player.position, player.width, player.height, player.gravDir) ? 1.05f : 0.4f; - } - if (sirenWaterBuff) - { - player.runAcceleration *= 1.15f; - player.maxRunSpeed *= 1.15f; - } - if (frostFlare && player.statLife < (int)((double)player.statLifeMax2 * 0.25)) - { - player.runAcceleration *= 1.15f; - player.maxRunSpeed *= 1.15f; - } - if (shadowSpeed) - { - player.runAcceleration *= 1.5f; - player.maxRunSpeed *= 1.5f; - } - else if (auricSet) - { - player.runAcceleration *= 1.1f; - player.maxRunSpeed *= 1.1f; - } - else if (silvaSet) + if (abyssalDivingSuit) + { + player.runAcceleration *= Collision.DrownCollision(player.position, player.width, player.height, player.gravDir) ? 1.05f : 0.4f; + player.maxRunSpeed *= Collision.DrownCollision(player.position, player.width, player.height, player.gravDir) ? 1.05f : 0.4f; + } + if (sirenWaterBuff) + { + player.runAcceleration *= 1.15f; + player.maxRunSpeed *= 1.15f; + } + if (frostFlare && player.statLife < (int)((double)player.statLifeMax2 * 0.25)) + { + player.runAcceleration *= 1.15f; + player.maxRunSpeed *= 1.15f; + } + if (shadowSpeed) + { + player.runAcceleration *= 1.5f; + player.maxRunSpeed *= 1.5f; + } + else if (auricSet) + { + player.runAcceleration *= 1.1f; + player.maxRunSpeed *= 1.1f; + } + else if (silvaSet) { player.runAcceleration *= 1.05f; player.maxRunSpeed *= 1.05f; } - if (cTracers) - { - player.runAcceleration *= 1.1f; - player.maxRunSpeed *= 1.1f; - } - else if (eTracers) - { - player.runAcceleration *= 1.05f; - player.maxRunSpeed *= 1.05f; - } - if (horror) - { - player.runAcceleration *= 0.85f; - player.maxRunSpeed *= 0.85f; - } - if (elysianGuard) - { - player.runAcceleration *= 0.5f; - player.maxRunSpeed *= 0.5f; - } - #endregion - #region DashEffects - if (player.pulley && dashMod > 0) - { - ModDashMovement(); - } - else if (player.grappling[0] == -1 && !player.tongued) - { - if (dashMod > 0) - { - ModHorizontalMovement(); - ModDashMovement(); - } - if (pAmulet && modStealth < 1f) - { - float num43 = player.maxRunSpeed / 2f * (1f - modStealth); - player.maxRunSpeed -= num43; - player.accRunSpeed = player.maxRunSpeed; - } - } - #endregion - } - #endregion + if (cTracers) + { + player.runAcceleration *= 1.1f; + player.maxRunSpeed *= 1.1f; + } + else if (eTracers) + { + player.runAcceleration *= 1.05f; + player.maxRunSpeed *= 1.05f; + } + if (blueCandle) + { + player.runAcceleration *= 1.05f; + } + if (horror) + { + player.runAcceleration *= 0.85f; + player.maxRunSpeed *= 0.85f; + } + if (elysianGuard) + { + player.runAcceleration *= 0.5f; + player.maxRunSpeed *= 0.5f; + } + if (player.powerrun) //asphalt + { + player.maxRunSpeed *= 0.6666667f; //base is 3 * 3.5 = 10.5 * 0.6666667 = 7.0 + } + if (rogueStealthMax > 0f) + { + if (rogueStealth >= rogueStealthMax) //full stealth, more speed + { + player.runAcceleration *= 1f + (rogueStealth * 0.05f); + player.maxRunSpeed *= 1f + (rogueStealth * 0.05f); + } + else + { + player.runAcceleration *= 1f + (rogueStealth * 0.025f); + player.maxRunSpeed *= 1f + (rogueStealth * 0.025f); + } + } + #endregion + #region DashEffects + if (player.pulley && dashMod > 0) + { + ModDashMovement(); + } + else if (player.grappling[0] == -1 && !player.tongued) + { + if (dashMod > 0) + { + ModHorizontalMovement(); + ModDashMovement(); + } + if (pAmulet && modStealth < 1f) + { + float num43 = player.maxRunSpeed / 2f * (1f - modStealth); + player.maxRunSpeed -= num43; + player.accRunSpeed = player.maxRunSpeed; + } + } + #endregion + } + #endregion - #region PreKill - public override bool PreKill(double damage, int hitDirection, bool pvp, ref bool playSound, ref bool genGore, ref PlayerDeathReason damageSource) + #region PreKill + public override bool PreKill(double damage, int hitDirection, bool pvp, ref bool playSound, ref bool genGore, ref PlayerDeathReason damageSource) { - if (invincible && player.inventory[player.selectedItem].type != mod.ItemType("ColdheartIcicle")) - { - if (player.statLife <= 0) - { - player.statLife = 1; - } - return false; - } - if (hInferno) - { - for (int x = 0; x < 200; x++) - { - if (Main.npc[x].active && Main.npc[x].type == mod.NPCType("Providence")) - { - Main.npc[x].active = false; - } - } - } + if (invincible && player.inventory[player.selectedItem].type != mod.ItemType("ColdheartIcicle")) + { + if (player.statLife <= 0) + { + player.statLife = 1; + } + return false; + } + if (hInferno) + { + for (int x = 0; x < 200; x++) + { + if (Main.npc[x].active && Main.npc[x].type == mod.NPCType("Providence")) + { + Main.npc[x].active = false; + } + } + } if (nCore && Main.rand.Next(10) == 0) { Main.PlaySound(2, (int)player.position.X, (int)player.position.Y, 67); @@ -5498,10 +6110,10 @@ namespace CalamityMod } } player.statLife += 100; - player.HealEffect(100); + player.HealEffect(100); return false; } - if (godSlayer && !godSlayerCooldown) + if (godSlayer && !godSlayerCooldown) { Main.PlaySound(2, (int)player.position.X, (int)player.position.Y, 67); for (int j = 0; j < 50; j++) @@ -5520,40 +6132,43 @@ namespace CalamityMod } } player.statLife += 150; - player.HealEffect(150); - player.AddBuff(mod.BuffType("GodSlayerCooldown"), 2700); + player.HealEffect(150); + player.AddBuff(mod.BuffType("GodSlayerCooldown"), 2700); return false; } - if (silvaSet && silvaCountdown > 0) - { - if (hasSilvaEffect) - { - silvaHitCounter++; - } - if (player.FindBuffIndex(mod.BuffType("SilvaRevival")) == -1) - player.AddBuff(mod.BuffType("SilvaRevival"), 600); - hasSilvaEffect = true; - if (player.statLife < 1) - { - player.statLife = 1; - } - return false; - } - if (permafrostsConcoction && player.FindBuffIndex(mod.BuffType("ConcoctionCooldown")) == -1) - { - player.AddBuff(mod.BuffType("ConcoctionCooldown"), 10800); - player.AddBuff(mod.BuffType("Encased"), 300); - player.statLife = player.statLifeMax2 * 3 / 10; - Main.PlaySound(SoundID.Item92, player.position); - for (int i = 0; i < 60; i++) - { - int d = Dust.NewDust(player.position, player.width, player.height, 88, 0f, 0f, 0, default(Color), 2.5f); - Main.dust[d].noGravity = true; - Main.dust[d].velocity *= 5f; - } - return false; - } - if (bBlood && damage == 10.0 && hitDirection == 0 && damageSource.SourceOtherIndex == 8) + if (silvaSet && silvaCountdown > 0) + { + if (hasSilvaEffect) + { + silvaHitCounter++; + } + if (player.FindBuffIndex(mod.BuffType("SilvaRevival")) == -1) + { + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/SilvaActivation"), (int)player.position.X, (int)player.position.Y); + player.AddBuff(mod.BuffType("SilvaRevival"), 600); + } + hasSilvaEffect = true; + if (player.statLife < 1) + { + player.statLife = 1; + } + return false; + } + if (permafrostsConcoction && player.FindBuffIndex(mod.BuffType("ConcoctionCooldown")) == -1) + { + player.AddBuff(mod.BuffType("ConcoctionCooldown"), 10800); + player.AddBuff(mod.BuffType("Encased"), 300); + player.statLife = player.statLifeMax2 * 3 / 10; + Main.PlaySound(SoundID.Item92, player.position); + for (int i = 0; i < 60; i++) + { + int d = Dust.NewDust(player.position, player.width, player.height, 88, 0f, 0f, 0, default(Color), 2.5f); + Main.dust[d].noGravity = true; + Main.dust[d].velocity *= 5f; + } + return false; + } + if (bBlood && damage == 10.0 && hitDirection == 0 && damageSource.SourceOtherIndex == 8) { damageSource = PlayerDeathReason.ByCustomReason(player.name + " became a blood geyser."); } @@ -5569,72 +6184,61 @@ namespace CalamityMod { damageSource = PlayerDeathReason.ByCustomReason(player.name + " fell prey to their sins."); } - if (CalamityGlobalNPC.SCal > -1) - { - if (sCalDeathCount < 51) - { - sCalDeathCount++; - } - } - if (CalamityWorld.ironHeart && areThereAnyDamnBosses) - { - KillPlayer(); - return false; - } - return true; + if (CalamityGlobalNPC.SCal > -1) + { + if (sCalDeathCount < 51) + { + sCalDeathCount++; + } + } + if (CalamityWorld.ironHeart && areThereAnyDamnBosses) + { + KillPlayer(); + return false; + } + return true; } - #endregion + #endregion - #region UseTimeMult - public override float UseTimeMultiplier(Item item) - { - if (silvaRanged) - { - if (item.ranged && !CalamityMod.throwingItemList.Contains(item.type) && item.useTime > 3) - return (auricSet ? 1.2f : 1.1f); - } - if (silvaThrowing) - { - if (player.statLife > (int)((double)player.statLifeMax2 * 0.9) && - CalamityMod.throwingItemList.Contains(item.type) && item.useTime > 3) - return 1.1f; - } - return 1f; - } - #endregion - - #region MeleeSpeedMult - public override float MeleeSpeedMultiplier(Item item) - { - if (player.meleeSpeed > 1.5f) - { - return (1.5f / player.meleeSpeed); - } - return 1f; - } - #endregion - - #region GetWeaponDamageAndKB - public override void GetWeaponDamage(Item item, ref int damage) + #region UseTimeMult + public override float UseTimeMultiplier(Item item) { - if (flamethrowerBoost && item.ranged && item.useAmmo == 23) - { - damage = (int)((double)damage * 1.25); - } - if (dodgeScarf && item.melee && item.shoot == 0) - { - damage = (int)((double)damage * 1.2); - } - if ((cinnamonRoll && CalamityMod.fireWeaponList.Contains(item.type)) || (evergreenGin && CalamityMod.natureWeaponList.Contains(item.type))) - { - damage = (int)((double)damage * 1.15); - } - if (fireball && CalamityMod.fireWeaponList.Contains(item.type)) - { - damage = (int)((double)damage * 1.1); - } - } - + if (silvaRanged) + { + if (item.ranged && !item.GetGlobalItem(mod).rogue && item.useTime > 3) + return (auricSet ? 1.2f : 1.1f); + } + if (silvaThrowing) + { + if (player.statLife > (int)((double)player.statLifeMax2 * 0.5) && + item.GetGlobalItem(mod).rogue && item.useTime > 3) + return 1.1f; + } + return 1f; + } + #endregion + + #region GetWeaponDamageAndKB + public override void GetWeaponDamage(Item item, ref int damage) + { + if (flamethrowerBoost && item.ranged && item.useAmmo == 23) + { + damage = (int)((double)damage * 1.25); + } + if (dodgeScarf && item.melee && item.shoot == 0) + { + damage = (int)((double)damage * 1.2); + } + if ((cinnamonRoll && CalamityMod.fireWeaponList.Contains(item.type)) || (evergreenGin && CalamityMod.natureWeaponList.Contains(item.type))) + { + damage = (int)((double)damage * 1.15); + } + if (fireball && CalamityMod.fireWeaponList.Contains(item.type)) + { + damage = (int)((double)damage * 1.1); + } + } + public override void GetWeaponKnockback(Item item, ref float knockback) { if (pAmulet && item.melee) @@ -5645,950 +6249,828 @@ namespace CalamityMod { knockback *= 1f + (1f - modStealth) * 0.5f; } - if (whiskey) - { - knockback *= 1.04f; - } - if (tequila && Main.dayTime) - { - knockback *= 1.04f; - } - if (tequilaSunrise && Main.dayTime) - { - knockback *= 1.09f; - } - if (moscowMule) - { - knockback *= 1.12f; - } - } - #endregion + if (whiskey) + { + knockback *= 1.04f; + } + if (tequila && Main.dayTime) + { + knockback *= 1.03f; + } + if (tequilaSunrise && Main.dayTime) + { + knockback *= 1.07f; + } + if (moscowMule) + { + knockback *= 1.09f; + } + } + #endregion - #region Shoot - public override bool Shoot(Item item, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + #region Shoot + public override bool Shoot(Item item, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - if (CalamityMod.throwingItemList.Contains(item.type)) - { - speedX *= CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingVelocity; - speedY *= CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingVelocity; - } - if (eArtifact && item.ranged && !CalamityMod.throwingItemList.Contains(item.type)) - { - speedX *= 1.25f; - speedY *= 1.25f; - } - if (bloodflareMage) //0 - 99 - { - if (item.magic && Main.rand.Next(0, 100) >= 95) - { - if (player.whoAmI == Main.myPlayer) - { - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, mod.ProjectileType("GhostlyBolt"), (int)((double)damage * (auricSet ? 4.2 : 2.6)), 1f, player.whoAmI, 0f, 0f); - } - } - } - if (bloodflareRanged) //0 - 99 - { - if (item.ranged && !CalamityMod.throwingItemList.Contains(item.type) && Main.rand.Next(0, 100) >= 98) - { - if (player.whoAmI == Main.myPlayer) - { - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, mod.ProjectileType("BloodBomb"), (int)((double)damage * (auricSet ? 2.2 : 1.6)), 2f, player.whoAmI, 0f, 0f); - } - } - } - if (tarraMage) - { - if (tarraCrits >= 5 && player.whoAmI == Main.myPlayer) - { - tarraCrits = 0; - int num106 = 9 + Main.rand.Next(3); - for (int num107 = 0; num107 < num106; num107++) - { - float num110 = 0.025f * (float)num107; - float hardar = speedX + (float)Main.rand.Next(-25, 26) * num110; - float hordor = speedY + (float)Main.rand.Next(-25, 26) * num110; - float num84 = (float)Math.Sqrt((double)(speedX * speedX + speedY * speedY)); - num84 = item.shootSpeed / num84; - hardar *= num84; - hordor *= num84; - Projectile.NewProjectile(position.X, position.Y, hardar, hordor, 206, (int)((double)damage * 0.2), knockBack, player.whoAmI, 0.0f, 0.0f); - } - } - } + if (item.GetGlobalItem(mod).rogue) + { + speedX *= CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingVelocity; + speedY *= CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingVelocity; + } + if (eArtifact && item.ranged && !item.GetGlobalItem(mod).rogue) + { + speedX *= 1.25f; + speedY *= 1.25f; + } + if (bloodflareMage) //0 - 99 + { + if (item.magic && Main.rand.Next(0, 100) >= 95) + { + if (player.whoAmI == Main.myPlayer) + { + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, mod.ProjectileType("GhostlyBolt"), (int)((double)damage * (auricSet ? 4.2 : 2.6)), 1f, player.whoAmI, 0f, 0f); + } + } + } + if (bloodflareRanged) //0 - 99 + { + if (item.ranged && !item.GetGlobalItem(mod).rogue && Main.rand.Next(0, 100) >= 98) + { + if (player.whoAmI == Main.myPlayer) + { + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, mod.ProjectileType("BloodBomb"), (int)((double)damage * (auricSet ? 2.2 : 1.6)), 2f, player.whoAmI, 0f, 0f); + } + } + } + if (tarraMage) + { + if (tarraCrits >= 5 && player.whoAmI == Main.myPlayer) + { + tarraCrits = 0; + int num106 = 9 + Main.rand.Next(3); + for (int num107 = 0; num107 < num106; num107++) + { + float num110 = 0.025f * (float)num107; + float hardar = speedX + (float)Main.rand.Next(-25, 26) * num110; + float hordor = speedY + (float)Main.rand.Next(-25, 26) * num110; + float num84 = (float)Math.Sqrt((double)(speedX * speedX + speedY * speedY)); + num84 = item.shootSpeed / num84; + hardar *= num84; + hordor *= num84; + Projectile.NewProjectile(position.X, position.Y, hardar, hordor, 206, (int)((double)damage * 0.2), knockBack, player.whoAmI, 0.0f, 0.0f); + } + } + } if (ataxiaBolt) { - if (item.ranged && !CalamityMod.throwingItemList.Contains(item.type) && Main.rand.Next(2) == 0) - { - if (player.whoAmI == Main.myPlayer) - { - Projectile.NewProjectile(position.X, position.Y, speedX * 1.25f, speedY * 1.25f, mod.ProjectileType("ChaosFlare"), (int)((double)damage * 0.25), 2f, player.whoAmI, 0f, 0f); - } - } + if (item.ranged && !item.GetGlobalItem(mod).rogue && Main.rand.Next(2) == 0) + { + if (player.whoAmI == Main.myPlayer) + { + Projectile.NewProjectile(position.X, position.Y, speedX * 1.25f, speedY * 1.25f, mod.ProjectileType("ChaosFlare"), (int)((double)damage * 0.25), 2f, player.whoAmI, 0f, 0f); + } + } } - if (godSlayerRanged) //0 - 99 - { - if (item.ranged && !CalamityMod.throwingItemList.Contains(item.type) && Main.rand.Next(0, 100) >= 95) - { - if (player.whoAmI == Main.myPlayer) - { - Projectile.NewProjectile(position.X, position.Y, speedX * 1.25f, speedY * 1.25f, mod.ProjectileType("GodSlayerShrapnelRound"), (int)((double)damage * (auricSet ? 3.2 : 2.1)), 2f, player.whoAmI, 0f, 0f); - } - } - } - if (ataxiaVolley) + if (godSlayerRanged) //0 - 99 { - if (CalamityMod.throwingItemList.Contains(item.type) && Main.rand.Next(10) == 0) - { - if (player.whoAmI == Main.myPlayer) - { - Main.PlaySound(2, (int)player.position.X, (int)player.position.Y, 20); - float spread = 45f * 0.0174f; - double startAngle = Math.Atan2(player.velocity.X, player.velocity.Y) - spread / 2; - double deltaAngle = spread / 8f; - double offsetAngle; - int i; - for (i = 0; i < 4; i++) - { - Vector2 vector2 = new Vector2(player.Center.X, player.Center.Y); - offsetAngle = (startAngle + deltaAngle * (i + i * i) / 2f) + 32f * i; - Projectile.NewProjectile(vector2.X, vector2.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), mod.ProjectileType("ChaosFlare2"), (int)((double)damage * 0.5), 1.25f, player.whoAmI, 0f, 0f); - Projectile.NewProjectile(vector2.X, vector2.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), mod.ProjectileType("ChaosFlare2"), (int)((double)damage * 0.5), 1.25f, player.whoAmI, 0f, 0f); - } - } - } + if (item.ranged && !item.GetGlobalItem(mod).rogue && Main.rand.Next(0, 100) >= 95) + { + if (player.whoAmI == Main.myPlayer) + { + Projectile.NewProjectile(position.X, position.Y, speedX * 1.25f, speedY * 1.25f, mod.ProjectileType("GodSlayerShrapnelRound"), (int)((double)damage * (auricSet ? 3.2 : 2.1)), 2f, player.whoAmI, 0f, 0f); + } + } + } + if (ataxiaVolley) + { + if (item.GetGlobalItem(mod).rogue && Main.rand.Next(10) == 0) + { + if (player.whoAmI == Main.myPlayer) + { + Main.PlaySound(2, (int)player.position.X, (int)player.position.Y, 20); + float spread = 45f * 0.0174f; + double startAngle = Math.Atan2(player.velocity.X, player.velocity.Y) - spread / 2; + double deltaAngle = spread / 8f; + double offsetAngle; + int i; + for (i = 0; i < 4; i++) + { + Vector2 vector2 = new Vector2(player.Center.X, player.Center.Y); + offsetAngle = (startAngle + deltaAngle * (i + i * i) / 2f) + 32f * i; + Projectile.NewProjectile(vector2.X, vector2.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), mod.ProjectileType("ChaosFlare2"), (int)((double)damage * 0.5), 1.25f, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(vector2.X, vector2.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), mod.ProjectileType("ChaosFlare2"), (int)((double)damage * 0.5), 1.25f, player.whoAmI, 0f, 0f); + } + } + } } if (reaverDoubleTap) //0 - 99 { - if (item.ranged && !CalamityMod.throwingItemList.Contains(item.type) && Main.rand.Next(0, 100) >= 90) - { - if (player.whoAmI == Main.myPlayer) - { - Projectile.NewProjectile(position.X, position.Y, speedX * 1.25f, speedY * 1.25f, mod.ProjectileType("MiniRocket"), (int)((double)damage * 1.3), 2f, player.whoAmI, 0f, 0f); - } - } + if (item.ranged && !item.GetGlobalItem(mod).rogue && Main.rand.Next(0, 100) >= 90) + { + if (player.whoAmI == Main.myPlayer) + { + Projectile.NewProjectile(position.X, position.Y, speedX * 1.25f, speedY * 1.25f, mod.ProjectileType("MiniRocket"), (int)((double)damage * 1.3), 2f, player.whoAmI, 0f, 0f); + } + } + } + if (victideSet) + { + if ((item.ranged || item.melee || item.magic || + item.GetGlobalItem(mod).rogue || + item.summon) && item.rare < 8 && Main.rand.Next(10) == 0) + { + if (player.whoAmI == Main.myPlayer) + { + Projectile.NewProjectile(position.X, position.Y, speedX * 1.25f, speedY * 1.25f, mod.ProjectileType("Seashell"), damage * 2, 1f, player.whoAmI, 0f, 0f); + } + } } - if (victideSet) - { - if ((item.ranged || item.melee || item.magic || - CalamityMod.throwingItemList.Contains(item.type) || - item.summon) && Main.rand.Next(10) == 0) - { - if (player.whoAmI == Main.myPlayer) - { - Projectile.NewProjectile(position.X, position.Y, speedX * 1.25f, speedY * 1.25f, mod.ProjectileType("Seashell"), damage * 2, 1f, player.whoAmI, 0f, 0f); - } - } - } return true; } - #endregion + #endregion - #region MeleeEffects - public override void MeleeEffects(Item item, Rectangle hitbox) + #region MeleeEffects + public override void MeleeEffects(Item item, Rectangle hitbox) { if (aWeapon && item.melee && !item.noMelee && !item.noUseGraphic) { if (Main.rand.Next(3) == 0) - { - int num280 = Dust.NewDust(new Vector2((float)hitbox.X, (float)hitbox.Y), hitbox.Width, hitbox.Height, mod.DustType("BrimstoneFlame"), player.velocity.X * 0.2f + (float)(player.direction * 3), player.velocity.Y * 0.2f, 100, default(Color), 0.75f); - } + { + int num280 = Dust.NewDust(new Vector2((float)hitbox.X, (float)hitbox.Y), hitbox.Width, hitbox.Height, mod.DustType("BrimstoneFlame"), player.velocity.X * 0.2f + (float)(player.direction * 3), player.velocity.Y * 0.2f, 100, default(Color), 0.75f); + } } if (aChicken && item.melee && !item.noMelee && !item.noUseGraphic) { if (Main.rand.Next(3) == 0) - { - int num280 = Dust.NewDust(new Vector2((float)hitbox.X, (float)hitbox.Y), hitbox.Width, hitbox.Height, 244, player.velocity.X * 0.2f + (float)(player.direction * 3), player.velocity.Y * 0.2f, 100, default(Color), 0.75f); - } + { + int num280 = Dust.NewDust(new Vector2((float)hitbox.X, (float)hitbox.Y), hitbox.Width, hitbox.Height, 244, player.velocity.X * 0.2f + (float)(player.direction * 3), player.velocity.Y * 0.2f, 100, default(Color), 0.75f); + } } if (eGauntlet && item.melee && !item.noMelee && !item.noUseGraphic) { if (Main.rand.Next(3) == 0) - { + { int num280 = Dust.NewDust(new Vector2((float)hitbox.X, (float)hitbox.Y), hitbox.Width, hitbox.Height, 66, player.velocity.X * 0.2f + (float)(player.direction * 3), player.velocity.Y * 0.2f, 100, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 1.25f); - Main.dust[num280].noGravity = true; - } + Main.dust[num280].noGravity = true; + } } if (cryogenSoul && item.melee && !item.noMelee && !item.noUseGraphic) { if (Main.rand.Next(3) == 0) - { - int num280 = Dust.NewDust(new Vector2((float)hitbox.X, (float)hitbox.Y), hitbox.Width, hitbox.Height, 67, player.velocity.X * 0.2f + (float)(player.direction * 3), player.velocity.Y * 0.2f, 100, default(Color), 0.75f); - } + { + int num280 = Dust.NewDust(new Vector2((float)hitbox.X, (float)hitbox.Y), hitbox.Width, hitbox.Height, 67, player.velocity.X * 0.2f + (float)(player.direction * 3), player.velocity.Y * 0.2f, 100, default(Color), 0.75f); + } } if (xerocSet && item.melee && !item.noMelee && !item.noUseGraphic) { if (Main.rand.Next(3) == 0) - { - int num280 = Dust.NewDust(new Vector2((float)hitbox.X, (float)hitbox.Y), hitbox.Width, hitbox.Height, 58, player.velocity.X * 0.2f + (float)(player.direction * 3), player.velocity.Y * 0.2f, 100, default(Color), 1.25f); - } + { + int num280 = Dust.NewDust(new Vector2((float)hitbox.X, (float)hitbox.Y), hitbox.Width, hitbox.Height, 58, player.velocity.X * 0.2f + (float)(player.direction * 3), player.velocity.Y * 0.2f, 100, default(Color), 1.25f); + } } if (reaverBlast && item.melee && !item.noMelee && !item.noUseGraphic) { if (Main.rand.Next(3) == 0) - { - int num280 = Dust.NewDust(new Vector2((float)hitbox.X, (float)hitbox.Y), hitbox.Width, hitbox.Height, 74, player.velocity.X * 0.2f + (float)(player.direction * 3), player.velocity.Y * 0.2f, 100, default(Color), 0.75f); - } + { + int num280 = Dust.NewDust(new Vector2((float)hitbox.X, (float)hitbox.Y), hitbox.Width, hitbox.Height, 74, player.velocity.X * 0.2f + (float)(player.direction * 3), player.velocity.Y * 0.2f, 100, default(Color), 0.75f); + } } if (dsSetBonus && item.melee && !item.noMelee && !item.noUseGraphic) { if (Main.rand.Next(3) == 0) - { - int num280 = Dust.NewDust(new Vector2((float)hitbox.X, (float)hitbox.Y), hitbox.Width, hitbox.Height, 27, player.velocity.X * 0.2f + (float)(player.direction * 3), player.velocity.Y * 0.2f, 100, default(Color), 2.5f); - } + { + int num280 = Dust.NewDust(new Vector2((float)hitbox.X, (float)hitbox.Y), hitbox.Width, hitbox.Height, 27, player.velocity.X * 0.2f + (float)(player.direction * 3), player.velocity.Y * 0.2f, 100, default(Color), 2.5f); + } } } - #endregion + #endregion - #region OnHitNPC - public override void OnHitNPC(Item item, NPC target, int damage, float knockback, bool crit) - { - if (omegaBlueChestplate) - target.AddBuff(mod.BuffType("CrushDepth"), 240); + #region OnHitNPC + public override void OnHitNPC(Item item, NPC target, int damage, float knockback, bool crit) + { + if (omegaBlueChestplate) + target.AddBuff(mod.BuffType("CrushDepth"), 240); - if (eGauntlet) - { - target.AddBuff(mod.BuffType("AbyssalFlames"), 120, false); - target.AddBuff(mod.BuffType("HolyLight"), 120, false); - target.AddBuff(mod.BuffType("Plague"), 120, false); - target.AddBuff(mod.BuffType("BrimstoneFlames"), 120, false); - if (Main.rand.Next(5) == 0) - { - target.AddBuff(mod.BuffType("GlacialState"), 120, false); - } - target.AddBuff(mod.BuffType("GodSlayerInferno"), 120, false); - target.AddBuff(BuffID.Poisoned, 120, false); - target.AddBuff(BuffID.OnFire, 120, false); - target.AddBuff(BuffID.CursedInferno, 120, false); - target.AddBuff(BuffID.Frostburn, 120, false); - target.AddBuff(BuffID.Ichor, 120, false); - target.AddBuff(BuffID.Venom, 120, false); - } - if (aWeapon) - { - if (Main.rand.Next(4) == 0) - { - target.AddBuff(mod.BuffType("AbyssalFlames"), 360, false); - } - else if (Main.rand.Next(2) == 0) - { - target.AddBuff(mod.BuffType("AbyssalFlames"), 240, false); - } - else - { - target.AddBuff(mod.BuffType("AbyssalFlames"), 120, false); - } - } - if (abyssalAmulet) - { - if (Main.rand.Next(4) == 0) - { - target.AddBuff(mod.BuffType("CrushDepth"), 360, false); - } - else if (Main.rand.Next(2) == 0) - { - target.AddBuff(mod.BuffType("CrushDepth"), 240, false); - } - else - { - target.AddBuff(mod.BuffType("CrushDepth"), 120, false); - } - } - if (dsSetBonus) - { - if (Main.rand.Next(4) == 0) - { - target.AddBuff(mod.BuffType("DemonFlames"), 360, false); - } - else if (Main.rand.Next(2) == 0) - { - target.AddBuff(mod.BuffType("DemonFlames"), 240, false); - } - else - { - target.AddBuff(mod.BuffType("DemonFlames"), 120, false); - } - } - if (cryogenSoul || frostFlare) - { - if (Main.rand.Next(4) == 0) - { - target.AddBuff(44, 360, false); - } - else if (Main.rand.Next(2) == 0) - { - target.AddBuff(44, 240, false); - } - else - { - target.AddBuff(44, 120, false); - } - } - if (yInsignia) - { - if (Main.rand.Next(4) == 0) - { - target.AddBuff(mod.BuffType("HolyLight"), 360, false); - } - else if (Main.rand.Next(2) == 0) - { - target.AddBuff(mod.BuffType("HolyLight"), 240, false); - } - else - { - target.AddBuff(mod.BuffType("HolyLight"), 120, false); - } - } - if (ataxiaFire) - { - if (Main.rand.Next(4) == 0) - { - target.AddBuff(BuffID.OnFire, 720, false); - } - else if (Main.rand.Next(2) == 0) - { - target.AddBuff(BuffID.OnFire, 480, false); - } - else - { - target.AddBuff(BuffID.OnFire, 240, false); - } - } - if (alchFlask) - { - if (Main.rand.Next(4) == 0) - { - target.AddBuff(mod.BuffType("Plague"), 360, false); - } - else if (Main.rand.Next(2) == 0) - { - target.AddBuff(mod.BuffType("Plague"), 240, false); - } - else - { - target.AddBuff(mod.BuffType("Plague"), 120, false); - } - } - if (ataxiaGeyser && item.melee && !item.noMelee && !item.noUseGraphic) - { - if (player.whoAmI == Main.myPlayer && player.ownedProjectileCounts[mod.ProjectileType("ChaosGeyser")] < 3) - { - Projectile.NewProjectile(target.Center.X, target.Center.Y, 0f, 0f, mod.ProjectileType("ChaosGeyser"), (int)((double)item.damage * 0.15), 2f, player.whoAmI, 0f, 0f); - } - } - - if (target.type == NPCID.TargetDummy) - return; - - if (bloodflareMelee) - { - if (bloodflareMeleeHits < 15 && bloodflareFrenzyTimer <= 0 && bloodflareFrenzyCooldown <= 0) - { - bloodflareMeleeHits++; - } - if (player.whoAmI == Main.myPlayer) - { - int healAmount = (Main.rand.Next(3) + 1); - player.statLife += healAmount; - player.HealEffect(healAmount); - } - } + if (eGauntlet) + { + target.AddBuff(mod.BuffType("AbyssalFlames"), 120, false); + target.AddBuff(mod.BuffType("HolyLight"), 120, false); + target.AddBuff(mod.BuffType("Plague"), 120, false); + target.AddBuff(mod.BuffType("BrimstoneFlames"), 120, false); + if (Main.rand.Next(5) == 0) + { + target.AddBuff(mod.BuffType("GlacialState"), 120, false); + } + target.AddBuff(mod.BuffType("GodSlayerInferno"), 120, false); + target.AddBuff(BuffID.Poisoned, 120, false); + target.AddBuff(BuffID.OnFire, 120, false); + target.AddBuff(BuffID.CursedInferno, 120, false); + target.AddBuff(BuffID.Frostburn, 120, false); + target.AddBuff(BuffID.Ichor, 120, false); + target.AddBuff(BuffID.Venom, 120, false); + } + if (aWeapon) + { + if (Main.rand.Next(4) == 0) + { + target.AddBuff(mod.BuffType("AbyssalFlames"), 360, false); + } + else if (Main.rand.Next(2) == 0) + { + target.AddBuff(mod.BuffType("AbyssalFlames"), 240, false); + } + else + { + target.AddBuff(mod.BuffType("AbyssalFlames"), 120, false); + } + } + if (abyssalAmulet) + { + if (Main.rand.Next(4) == 0) + { + target.AddBuff(mod.BuffType("CrushDepth"), 360, false); + } + else if (Main.rand.Next(2) == 0) + { + target.AddBuff(mod.BuffType("CrushDepth"), 240, false); + } + else + { + target.AddBuff(mod.BuffType("CrushDepth"), 120, false); + } + } + if (dsSetBonus) + { + if (Main.rand.Next(4) == 0) + { + target.AddBuff(mod.BuffType("DemonFlames"), 360, false); + } + else if (Main.rand.Next(2) == 0) + { + target.AddBuff(mod.BuffType("DemonFlames"), 240, false); + } + else + { + target.AddBuff(mod.BuffType("DemonFlames"), 120, false); + } + } + if (cryogenSoul || frostFlare) + { + if (Main.rand.Next(4) == 0) + { + target.AddBuff(44, 360, false); + } + else if (Main.rand.Next(2) == 0) + { + target.AddBuff(44, 240, false); + } + else + { + target.AddBuff(44, 120, false); + } + } + if (yInsignia) + { + if (Main.rand.Next(4) == 0) + { + target.AddBuff(mod.BuffType("HolyLight"), 360, false); + } + else if (Main.rand.Next(2) == 0) + { + target.AddBuff(mod.BuffType("HolyLight"), 240, false); + } + else + { + target.AddBuff(mod.BuffType("HolyLight"), 120, false); + } + } + if (ataxiaFire) + { + if (Main.rand.Next(4) == 0) + { + target.AddBuff(BuffID.OnFire, 720, false); + } + else if (Main.rand.Next(2) == 0) + { + target.AddBuff(BuffID.OnFire, 480, false); + } + else + { + target.AddBuff(BuffID.OnFire, 240, false); + } + } + if (alchFlask) + { + if (Main.rand.Next(4) == 0) + { + target.AddBuff(mod.BuffType("Plague"), 360, false); + } + else if (Main.rand.Next(2) == 0) + { + target.AddBuff(mod.BuffType("Plague"), 240, false); + } + else + { + target.AddBuff(mod.BuffType("Plague"), 120, false); + } + } } - #endregion + #endregion - #region OnHitNPCWithProj - public override void OnHitNPCWithProj(Projectile proj, NPC target, int damage, float knockback, bool crit) - { - if (omegaBlueChestplate && proj.friendly && !target.friendly) - target.AddBuff(mod.BuffType("CrushDepth"), 240); + #region OnHitNPCWithProj + public override void OnHitNPCWithProj(Projectile proj, NPC target, int damage, float knockback, bool crit) + { + if (omegaBlueChestplate && proj.friendly && !target.friendly) + target.AddBuff(mod.BuffType("CrushDepth"), 240); - if (proj.melee && silvaMelee && Main.rand.Next(4) == 0) - target.AddBuff(mod.BuffType("SilvaStun"), 20); + if (proj.melee && silvaMelee && Main.rand.Next(4) == 0) + target.AddBuff(mod.BuffType("SilvaStun"), 20); - if (abyssalAmulet) - { - if (Main.rand.Next(4) == 0) - { - target.AddBuff(mod.BuffType("CrushDepth"), 360, false); - } - else if (Main.rand.Next(2) == 0) - { - target.AddBuff(mod.BuffType("CrushDepth"), 240, false); - } - else - { - target.AddBuff(mod.BuffType("CrushDepth"), 120, false); - } - } - if (dsSetBonus) - { - if (Main.rand.Next(4) == 0) - { - target.AddBuff(mod.BuffType("DemonFlames"), 360, false); - } - else if (Main.rand.Next(2) == 0) - { - target.AddBuff(mod.BuffType("DemonFlames"), 240, false); - } - else - { - target.AddBuff(mod.BuffType("DemonFlames"), 120, false); - } - } - if (alchFlask) - { - if (Main.rand.Next(4) == 0) - { - target.AddBuff(mod.BuffType("Plague"), 360, false); - } - else if (Main.rand.Next(2) == 0) - { - target.AddBuff(mod.BuffType("Plague"), 240, false); - } - else - { - target.AddBuff(mod.BuffType("Plague"), 120, false); - } - } - if (proj.melee) - { - if (eGauntlet) - { - target.AddBuff(mod.BuffType("AbyssalFlames"), 120, false); - target.AddBuff(mod.BuffType("HolyLight"), 120, false); - target.AddBuff(mod.BuffType("Plague"), 120, false); - target.AddBuff(mod.BuffType("BrimstoneFlames"), 120, false); - if (Main.rand.Next(5) == 0) - { - target.AddBuff(mod.BuffType("GlacialState"), 120, false); - } - target.AddBuff(mod.BuffType("GodSlayerInferno"), 120, false); - target.AddBuff(BuffID.Poisoned, 120, false); - target.AddBuff(BuffID.OnFire, 120, false); - target.AddBuff(BuffID.CursedInferno, 120, false); - target.AddBuff(BuffID.Frostburn, 120, false); - target.AddBuff(BuffID.Ichor, 120, false); - target.AddBuff(BuffID.Venom, 120, false); - } - if (aWeapon) - { - if (Main.rand.Next(4) == 0) - { - target.AddBuff(mod.BuffType("AbyssalFlames"), 360, false); - } - else if (Main.rand.Next(2) == 0) - { - target.AddBuff(mod.BuffType("AbyssalFlames"), 240, false); - } - else - { - target.AddBuff(mod.BuffType("AbyssalFlames"), 120, false); - } - } - if (cryogenSoul || frostFlare) - { - if (Main.rand.Next(4) == 0) - { - target.AddBuff(44, 360, false); - } - else if (Main.rand.Next(2) == 0) - { - target.AddBuff(44, 240, false); - } - else - { - target.AddBuff(44, 120, false); - } - } - if (yInsignia) - { - if (Main.rand.Next(4) == 0) - { - target.AddBuff(mod.BuffType("HolyLight"), 360, false); - } - else if (Main.rand.Next(2) == 0) - { - target.AddBuff(mod.BuffType("HolyLight"), 240, false); - } - else - { - target.AddBuff(mod.BuffType("HolyLight"), 120, false); - } - } - if (ataxiaFire) - { - if (Main.rand.Next(4) == 0) - { - target.AddBuff(BuffID.OnFire, 720, false); - } - else if (Main.rand.Next(2) == 0) - { - target.AddBuff(BuffID.OnFire, 480, false); - } - else - { - target.AddBuff(BuffID.OnFire, 240, false); - } - } - } - if ((target.damage > 5 || target.boss) && player.whoAmI == Main.myPlayer && !target.SpawnedFromStatue) - { - if (gainLevelCooldown <= 0) //max is 12501 to avoid setting off fireworks forever - { - 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.Next(10) == 0) //add only to non-multiples of 100 - meleeLevel++; - shootFireworksLevelUpMelee = true; - if (Main.netMode == 1) - { - LevelPacket(false, 0); - } - } - 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.Next(10) == 0) //add only to non-multiples of 100 - rangedLevel++; - shootFireworksLevelUpRanged = true; - if (Main.netMode == 1) - { - LevelPacket(false, 1); - } - } - 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.Next(10) == 0) //add only to non-multiples of 100 - magicLevel++; - shootFireworksLevelUpMagic = true; - if (Main.netMode == 1) - { - LevelPacket(false, 2); - } - } - else if ((proj.minion || proj.sentry || CalamityMod.projectileMinionList.Contains(proj.type)) && 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.Next(10) == 0) //add only to non-multiples of 100 - summonLevel++; - shootFireworksLevelUpSummon = true; - if (Main.netMode == 1) - { - LevelPacket(false, 3); - } - } - else if (CalamityMod.throwingProjectileList.Contains(proj.type) && !proj.melee && 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.Next(10) == 0) //add only to non-multiples of 100 - rogueLevel++; - shootFireworksLevelUpRogue = true; - if (Main.netMode == 1) - { - LevelPacket(false, 4); - } - } - } - if (raiderTalisman && raiderStack < 250 && CalamityMod.throwingProjectileList.Contains(proj.type) && !proj.melee && crit) - { - raiderStack++; - } - if (CalamityWorld.revenge) - { - if ((proj.melee && proj.ownerHitCheck) || proj.aiStyle == 15 || (proj.aiStyle == 75 && proj.melee) || - proj.type == mod.ProjectileType("Nebulash") || proj.type == mod.ProjectileType("CosmicDischarge") || - proj.type == mod.ProjectileType("MourningStar")) - { - int stressGain = (int)((double)damage * 0.1); - int stressMaxGain = 10; - if (stressGain < 1) - { - stressGain = 1; - } - if (stressGain > stressMaxGain) - { - stressGain = stressMaxGain; - } - stress += stressGain; - if (stress >= stressMax) - { - stress = stressMax; - } - } - } - } - } - #endregion + if (abyssalAmulet) + { + if (Main.rand.Next(4) == 0) + { + target.AddBuff(mod.BuffType("CrushDepth"), 360, false); + } + else if (Main.rand.Next(2) == 0) + { + target.AddBuff(mod.BuffType("CrushDepth"), 240, false); + } + else + { + target.AddBuff(mod.BuffType("CrushDepth"), 120, false); + } + } + if (dsSetBonus) + { + if (Main.rand.Next(4) == 0) + { + target.AddBuff(mod.BuffType("DemonFlames"), 360, false); + } + else if (Main.rand.Next(2) == 0) + { + target.AddBuff(mod.BuffType("DemonFlames"), 240, false); + } + else + { + target.AddBuff(mod.BuffType("DemonFlames"), 120, false); + } + } + if (alchFlask) + { + if (Main.rand.Next(4) == 0) + { + target.AddBuff(mod.BuffType("Plague"), 360, false); + } + else if (Main.rand.Next(2) == 0) + { + target.AddBuff(mod.BuffType("Plague"), 240, false); + } + else + { + target.AddBuff(mod.BuffType("Plague"), 120, false); + } + } + if (proj.melee) + { + if (eGauntlet) + { + target.AddBuff(mod.BuffType("AbyssalFlames"), 120, false); + target.AddBuff(mod.BuffType("HolyLight"), 120, false); + target.AddBuff(mod.BuffType("Plague"), 120, false); + target.AddBuff(mod.BuffType("BrimstoneFlames"), 120, false); + if (Main.rand.Next(5) == 0) + { + target.AddBuff(mod.BuffType("GlacialState"), 120, false); + } + target.AddBuff(mod.BuffType("GodSlayerInferno"), 120, false); + target.AddBuff(BuffID.Poisoned, 120, false); + target.AddBuff(BuffID.OnFire, 120, false); + target.AddBuff(BuffID.CursedInferno, 120, false); + target.AddBuff(BuffID.Frostburn, 120, false); + target.AddBuff(BuffID.Ichor, 120, false); + target.AddBuff(BuffID.Venom, 120, false); + } + if (aWeapon) + { + if (Main.rand.Next(4) == 0) + { + target.AddBuff(mod.BuffType("AbyssalFlames"), 360, false); + } + else if (Main.rand.Next(2) == 0) + { + target.AddBuff(mod.BuffType("AbyssalFlames"), 240, false); + } + else + { + target.AddBuff(mod.BuffType("AbyssalFlames"), 120, false); + } + } + if (cryogenSoul || frostFlare) + { + if (Main.rand.Next(4) == 0) + { + target.AddBuff(44, 360, false); + } + else if (Main.rand.Next(2) == 0) + { + target.AddBuff(44, 240, false); + } + else + { + target.AddBuff(44, 120, false); + } + } + if (yInsignia) + { + if (Main.rand.Next(4) == 0) + { + target.AddBuff(mod.BuffType("HolyLight"), 360, false); + } + else if (Main.rand.Next(2) == 0) + { + target.AddBuff(mod.BuffType("HolyLight"), 240, false); + } + else + { + target.AddBuff(mod.BuffType("HolyLight"), 120, false); + } + } + if (ataxiaFire) + { + if (Main.rand.Next(4) == 0) + { + target.AddBuff(BuffID.OnFire, 720, false); + } + else if (Main.rand.Next(2) == 0) + { + target.AddBuff(BuffID.OnFire, 480, false); + } + else + { + target.AddBuff(BuffID.OnFire, 240, false); + } + } + } + } + #endregion - #region PvP - public override void OnHitPvp(Item item, Player target, int damage, bool crit) - { - if (omegaBlueChestplate) - target.AddBuff(mod.BuffType("CrushDepth"), 240); + #region PvP + public override void OnHitPvp(Item item, Player target, int damage, bool crit) + { + if (omegaBlueChestplate) + target.AddBuff(mod.BuffType("CrushDepth"), 240); - if (eGauntlet) - { - target.AddBuff(mod.BuffType("AbyssalFlames"), 120, false); - target.AddBuff(mod.BuffType("HolyLight"), 120, false); - target.AddBuff(mod.BuffType("Plague"), 120, false); - target.AddBuff(mod.BuffType("BrimstoneFlames"), 120, false); - if (Main.rand.Next(5) == 0) - { - target.AddBuff(mod.BuffType("GlacialState"), 120, false); - } - target.AddBuff(mod.BuffType("GodSlayerInferno"), 120, false); - target.AddBuff(BuffID.Poisoned, 120, false); - target.AddBuff(BuffID.OnFire, 120, false); - target.AddBuff(BuffID.CursedInferno, 120, false); - target.AddBuff(BuffID.Frostburn, 120, false); - target.AddBuff(BuffID.Ichor, 120, false); - target.AddBuff(BuffID.Venom, 120, false); - } - if (aWeapon) - { - if (Main.rand.Next(4) == 0) - { - target.AddBuff(mod.BuffType("AbyssalFlames"), 360, false); - } - else if (Main.rand.Next(2) == 0) - { - target.AddBuff(mod.BuffType("AbyssalFlames"), 240, false); - } - else - { - target.AddBuff(mod.BuffType("AbyssalFlames"), 120, false); - } - } - if (abyssalAmulet) - { - if (Main.rand.Next(4) == 0) - { - target.AddBuff(mod.BuffType("CrushDepth"), 360, false); - } - else if (Main.rand.Next(2) == 0) - { - target.AddBuff(mod.BuffType("CrushDepth"), 240, false); - } - else - { - target.AddBuff(mod.BuffType("CrushDepth"), 120, false); - } - } - if (cryogenSoul || frostFlare) - { - if (Main.rand.Next(4) == 0) - { - target.AddBuff(44, 360, false); - } - else if (Main.rand.Next(2) == 0) - { - target.AddBuff(44, 240, false); - } - else - { - target.AddBuff(44, 120, false); - } - } - if (yInsignia) - { - if (Main.rand.Next(4) == 0) - { - target.AddBuff(mod.BuffType("HolyLight"), 360, false); - } - else if (Main.rand.Next(2) == 0) - { - target.AddBuff(mod.BuffType("HolyLight"), 240, false); - } - else - { - target.AddBuff(mod.BuffType("HolyLight"), 120, false); - } - } - if (ataxiaFire) - { - if (Main.rand.Next(4) == 0) - { - target.AddBuff(BuffID.OnFire, 720, false); - } - else if (Main.rand.Next(2) == 0) - { - target.AddBuff(BuffID.OnFire, 480, false); - } - else - { - target.AddBuff(BuffID.OnFire, 240, false); - } - } - if (alchFlask) - { - if (Main.rand.Next(4) == 0) - { - target.AddBuff(mod.BuffType("Plague"), 360, false); - } - else if (Main.rand.Next(2) == 0) - { - target.AddBuff(mod.BuffType("Plague"), 240, false); - } - else - { - target.AddBuff(mod.BuffType("Plague"), 120, false); - } - } - } + if (eGauntlet) + { + target.AddBuff(mod.BuffType("AbyssalFlames"), 120, false); + target.AddBuff(mod.BuffType("HolyLight"), 120, false); + target.AddBuff(mod.BuffType("Plague"), 120, false); + target.AddBuff(mod.BuffType("BrimstoneFlames"), 120, false); + if (Main.rand.Next(5) == 0) + { + target.AddBuff(mod.BuffType("GlacialState"), 120, false); + } + target.AddBuff(mod.BuffType("GodSlayerInferno"), 120, false); + target.AddBuff(BuffID.Poisoned, 120, false); + target.AddBuff(BuffID.OnFire, 120, false); + target.AddBuff(BuffID.CursedInferno, 120, false); + target.AddBuff(BuffID.Frostburn, 120, false); + target.AddBuff(BuffID.Ichor, 120, false); + target.AddBuff(BuffID.Venom, 120, false); + } + if (aWeapon) + { + if (Main.rand.Next(4) == 0) + { + target.AddBuff(mod.BuffType("AbyssalFlames"), 360, false); + } + else if (Main.rand.Next(2) == 0) + { + target.AddBuff(mod.BuffType("AbyssalFlames"), 240, false); + } + else + { + target.AddBuff(mod.BuffType("AbyssalFlames"), 120, false); + } + } + if (abyssalAmulet) + { + if (Main.rand.Next(4) == 0) + { + target.AddBuff(mod.BuffType("CrushDepth"), 360, false); + } + else if (Main.rand.Next(2) == 0) + { + target.AddBuff(mod.BuffType("CrushDepth"), 240, false); + } + else + { + target.AddBuff(mod.BuffType("CrushDepth"), 120, false); + } + } + if (cryogenSoul || frostFlare) + { + if (Main.rand.Next(4) == 0) + { + target.AddBuff(44, 360, false); + } + else if (Main.rand.Next(2) == 0) + { + target.AddBuff(44, 240, false); + } + else + { + target.AddBuff(44, 120, false); + } + } + if (yInsignia) + { + if (Main.rand.Next(4) == 0) + { + target.AddBuff(mod.BuffType("HolyLight"), 360, false); + } + else if (Main.rand.Next(2) == 0) + { + target.AddBuff(mod.BuffType("HolyLight"), 240, false); + } + else + { + target.AddBuff(mod.BuffType("HolyLight"), 120, false); + } + } + if (ataxiaFire) + { + if (Main.rand.Next(4) == 0) + { + target.AddBuff(BuffID.OnFire, 720, false); + } + else if (Main.rand.Next(2) == 0) + { + target.AddBuff(BuffID.OnFire, 480, false); + } + else + { + target.AddBuff(BuffID.OnFire, 240, false); + } + } + if (alchFlask) + { + if (Main.rand.Next(4) == 0) + { + target.AddBuff(mod.BuffType("Plague"), 360, false); + } + else if (Main.rand.Next(2) == 0) + { + target.AddBuff(mod.BuffType("Plague"), 240, false); + } + else + { + target.AddBuff(mod.BuffType("Plague"), 120, false); + } + } + } - public override void OnHitPvpWithProj(Projectile proj, Player target, int damage, bool crit) - { - if (omegaBlueChestplate) - target.AddBuff(mod.BuffType("CrushDepth"), 240); + public override void OnHitPvpWithProj(Projectile proj, Player target, int damage, bool crit) + { + if (omegaBlueChestplate) + target.AddBuff(mod.BuffType("CrushDepth"), 240); - if (proj.melee && silvaMelee && Main.rand.Next(4) == 0) - target.AddBuff(mod.BuffType("SilvaStun"), 20); + if (proj.melee && silvaMelee && Main.rand.Next(4) == 0) + target.AddBuff(mod.BuffType("SilvaStun"), 20); - if (abyssalAmulet) - { - if (Main.rand.Next(4) == 0) - { - target.AddBuff(mod.BuffType("CrushDepth"), 360, false); - } - else if (Main.rand.Next(2) == 0) - { - target.AddBuff(mod.BuffType("CrushDepth"), 240, false); - } - else - { - target.AddBuff(mod.BuffType("CrushDepth"), 120, false); - } - } - if (alchFlask) - { - if (Main.rand.Next(4) == 0) - { - target.AddBuff(mod.BuffType("Plague"), 360, false); - } - else if (Main.rand.Next(2) == 0) - { - target.AddBuff(mod.BuffType("Plague"), 240, false); - } - else - { - target.AddBuff(mod.BuffType("Plague"), 120, false); - } - } - if (proj.melee) - { - if (eGauntlet) - { - target.AddBuff(mod.BuffType("AbyssalFlames"), 120, false); - target.AddBuff(mod.BuffType("HolyLight"), 120, false); - target.AddBuff(mod.BuffType("Plague"), 120, false); - target.AddBuff(mod.BuffType("BrimstoneFlames"), 120, false); - if (Main.rand.Next(5) == 0) - { - target.AddBuff(mod.BuffType("GlacialState"), 120, false); - } - target.AddBuff(mod.BuffType("GodSlayerInferno"), 120, false); - target.AddBuff(BuffID.Poisoned, 120, false); - target.AddBuff(BuffID.OnFire, 120, false); - target.AddBuff(BuffID.CursedInferno, 120, false); - target.AddBuff(BuffID.Frostburn, 120, false); - target.AddBuff(BuffID.Ichor, 120, false); - target.AddBuff(BuffID.Venom, 120, false); - } - if (aWeapon) - { - if (Main.rand.Next(4) == 0) - { - target.AddBuff(mod.BuffType("AbyssalFlames"), 360, false); - } - else if (Main.rand.Next(2) == 0) - { - target.AddBuff(mod.BuffType("AbyssalFlames"), 240, false); - } - else - { - target.AddBuff(mod.BuffType("AbyssalFlames"), 120, false); - } - } - if (cryogenSoul || frostFlare) - { - if (Main.rand.Next(4) == 0) - { - target.AddBuff(44, 360, false); - } - else if (Main.rand.Next(2) == 0) - { - target.AddBuff(44, 240, false); - } - else - { - target.AddBuff(44, 120, false); - } - } - if (yInsignia) - { - if (Main.rand.Next(4) == 0) - { - target.AddBuff(mod.BuffType("HolyLight"), 360, false); - } - else if (Main.rand.Next(2) == 0) - { - target.AddBuff(mod.BuffType("HolyLight"), 240, false); - } - else - { - target.AddBuff(mod.BuffType("HolyLight"), 120, false); - } - } - if (ataxiaFire) - { - if (Main.rand.Next(4) == 0) - { - target.AddBuff(BuffID.OnFire, 720, false); - } - else if (Main.rand.Next(2) == 0) - { - target.AddBuff(BuffID.OnFire, 480, false); - } - else - { - target.AddBuff(BuffID.OnFire, 240, false); - } - } - } - } - #endregion + if (abyssalAmulet) + { + if (Main.rand.Next(4) == 0) + { + target.AddBuff(mod.BuffType("CrushDepth"), 360, false); + } + else if (Main.rand.Next(2) == 0) + { + target.AddBuff(mod.BuffType("CrushDepth"), 240, false); + } + else + { + target.AddBuff(mod.BuffType("CrushDepth"), 120, false); + } + } + if (alchFlask) + { + if (Main.rand.Next(4) == 0) + { + target.AddBuff(mod.BuffType("Plague"), 360, false); + } + else if (Main.rand.Next(2) == 0) + { + target.AddBuff(mod.BuffType("Plague"), 240, false); + } + else + { + target.AddBuff(mod.BuffType("Plague"), 120, false); + } + } + if (proj.melee) + { + if (eGauntlet) + { + target.AddBuff(mod.BuffType("AbyssalFlames"), 120, false); + target.AddBuff(mod.BuffType("HolyLight"), 120, false); + target.AddBuff(mod.BuffType("Plague"), 120, false); + target.AddBuff(mod.BuffType("BrimstoneFlames"), 120, false); + if (Main.rand.Next(5) == 0) + { + target.AddBuff(mod.BuffType("GlacialState"), 120, false); + } + target.AddBuff(mod.BuffType("GodSlayerInferno"), 120, false); + target.AddBuff(BuffID.Poisoned, 120, false); + target.AddBuff(BuffID.OnFire, 120, false); + target.AddBuff(BuffID.CursedInferno, 120, false); + target.AddBuff(BuffID.Frostburn, 120, false); + target.AddBuff(BuffID.Ichor, 120, false); + target.AddBuff(BuffID.Venom, 120, false); + } + if (aWeapon) + { + if (Main.rand.Next(4) == 0) + { + target.AddBuff(mod.BuffType("AbyssalFlames"), 360, false); + } + else if (Main.rand.Next(2) == 0) + { + target.AddBuff(mod.BuffType("AbyssalFlames"), 240, false); + } + else + { + target.AddBuff(mod.BuffType("AbyssalFlames"), 120, false); + } + } + if (cryogenSoul || frostFlare) + { + if (Main.rand.Next(4) == 0) + { + target.AddBuff(44, 360, false); + } + else if (Main.rand.Next(2) == 0) + { + target.AddBuff(44, 240, false); + } + else + { + target.AddBuff(44, 120, false); + } + } + if (yInsignia) + { + if (Main.rand.Next(4) == 0) + { + target.AddBuff(mod.BuffType("HolyLight"), 360, false); + } + else if (Main.rand.Next(2) == 0) + { + target.AddBuff(mod.BuffType("HolyLight"), 240, false); + } + else + { + target.AddBuff(mod.BuffType("HolyLight"), 120, false); + } + } + if (ataxiaFire) + { + if (Main.rand.Next(4) == 0) + { + target.AddBuff(BuffID.OnFire, 720, false); + } + else if (Main.rand.Next(2) == 0) + { + target.AddBuff(BuffID.OnFire, 480, false); + } + else + { + target.AddBuff(BuffID.OnFire, 240, false); + } + } + } + } + #endregion - #region ModifyHitNPC - public override void ModifyHitNPC(Item item, NPC target, ref int damage, ref float knockback, ref bool crit) - { - if (silvaMelee && Main.rand.Next(4) == 0) - { - damage *= 5; - } - if (CalamityWorld.revenge) - { - if (rageMode && adrenalineMode) - { - if (item.melee) - { - damage = (int)((double)damage * (CalamityWorld.death ? 9.0 : 3.0)); - } - } - else if (rageMode) - { - if (item.melee) - { - double rageDamageBoost = 0.0 + - (rageBoostOne ? (CalamityWorld.death ? 0.6 : 0.15) : 0.0) + //3.6 or 1.65 - (rageBoostTwo ? (CalamityWorld.death ? 0.6 : 0.15) : 0.0) + //4.2 or 1.8 - (rageBoostThree ? (CalamityWorld.death ? 0.6 : 0.15) : 0.0); //4.8 or 1.95 - double rageDamage = (CalamityWorld.death ? 3.0 : 1.5) + rageDamageBoost; - damage = (int)((double)damage * rageDamage); - } - } - else if (adrenalineMode) - { - if (item.melee) - { - damage = (int)((double)damage * ((CalamityWorld.death ? 7.0 : 2.5) * adrenalineDmgMult)); - } - } - } - if ((target.damage > 5 || target.boss) && player.whoAmI == Main.myPlayer && !target.SpawnedFromStatue) - { - if (gainLevelCooldown <= 0) - { - 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 - } - meleeLevel++; - if (fasterMeleeLevel && meleeLevel % 100 != 0 && Main.rand.Next(10) == 0) //add only to non-multiples of 100 - meleeLevel++; - shootFireworksLevelUpMelee = true; - if (Main.netMode == 1) - { - LevelPacket(false, 0); - } - } - } - if (CalamityWorld.revenge) - { - if (item.shoot == 0 || item.shoot == mod.ProjectileType("NobodyKnows")) - { - int stressGain = (int)((double)damage * 0.1); - int stressMaxGain = 10; - if (stressGain < 1) - { - stressGain = 1; - } - if (stressGain > stressMaxGain) - { - stressGain = stressMaxGain; - } - stress += stressGain; - if (stress >= stressMax) - { - stress = stressMax; - } - } - } - } - if (astralStarRain && crit && astralStarRainCooldown <= 0) + #region ModifyHitNPC + public override void ModifyHitNPC(Item item, NPC target, ref int damage, ref float knockback, ref bool crit) + { + if (silvaMelee && Main.rand.Next(4) == 0) + { + damage *= 5; + } + if (ataxiaGeyser && item.melee && !item.noMelee && !item.noUseGraphic) + { + if (player.whoAmI == Main.myPlayer && player.ownedProjectileCounts[mod.ProjectileType("ChaosGeyser")] < 3) + { + Projectile.NewProjectile(target.Center.X, target.Center.Y, 0f, 0f, mod.ProjectileType("ChaosGeyser"), (int)((double)item.damage * 0.15), 2f, player.whoAmI, 0f, 0f); + } + } + if (CalamityWorld.revenge) + { + bool DHorHoD = (draedonsHeart || heartOfDarkness); + if (rageMode && adrenalineMode) + { + if (item.melee) + { + damage = (int)((double)damage * (CalamityWorld.death ? (DHorHoD ? 9.9 : 9.0) : (DHorHoD ? 3.3 : 3.0))); + } + } + else if (rageMode) + { + if (item.melee) + { + double rageDamageBoost = 0.0 + + (rageBoostOne ? (CalamityWorld.death ? 0.6 : 0.15) : 0.0) + //3.6 or 1.65 + (rageBoostTwo ? (CalamityWorld.death ? 0.6 : 0.15) : 0.0) + //4.2 or 1.8 + (rageBoostThree ? (CalamityWorld.death ? 0.6 : 0.15) : 0.0); //4.8 or 1.95 + double rageDamage = (CalamityWorld.death ? (DHorHoD ? 3.3 : 3.0) : (DHorHoD ? 1.65 : 1.5)) + rageDamageBoost; + damage = (int)((double)damage * rageDamage); + } + } + else if (adrenalineMode) + { + if (item.melee) + { + damage = (int)((double)damage * ((CalamityWorld.death ? 7.0 : 2.5) * adrenalineDmgMult)); + } + } + } + if ((target.damage > 5 || target.boss) && player.whoAmI == Main.myPlayer && !target.SpawnedFromStatue) + { + if (item.type == mod.ItemType("Ataraxia")) + { + ataraxiaDamageBoostCancelTimer = 1200; + if (ataraxiaDamageBoostCooldown <= 0) + { + ataraxiaDamageBoostCooldown = 90; + if (ataraxiaDamageBoost < 0.3f) + ataraxiaDamageBoost += 0.01f; + } + } + if (bloodflareMelee) + { + if (bloodflareMeleeHits < 15 && bloodflareFrenzyTimer <= 0 && bloodflareFrenzyCooldown <= 0) + { + bloodflareMeleeHits++; + } + if (player.whoAmI == Main.myPlayer) + { + int healAmount = (Main.rand.Next(3) + 1); + player.statLife += healAmount; + player.HealEffect(healAmount); + } + } + if (gainLevelCooldown <= 0) + { + 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 + } + meleeLevel++; + if (fasterMeleeLevel && meleeLevel % 100 != 0 && Main.rand.Next(10) == 0) //add only to non-multiples of 100 + meleeLevel++; + shootFireworksLevelUpMelee = true; + if (Main.netMode == 1) + { + LevelPacket(false, 0); + } + } + } + if (CalamityWorld.revenge) + { + if (item.shoot == 0 || item.shoot == mod.ProjectileType("NobodyKnows")) + { + int stressGain = (int)((double)damage * 0.1); + int stressMaxGain = 10; + if (stressGain < 1) + { + stressGain = 1; + } + if (stressGain > stressMaxGain) + { + stressGain = stressMaxGain; + } + stress += stressGain; + if (stress >= stressMax) + { + stress = stressMax; + } + } + } + } + if (astralStarRain && crit && astralStarRainCooldown <= 0) { if (player.whoAmI == Main.myPlayer) { - astralStarRainCooldown = 60; + astralStarRainCooldown = 60; for (int n = 0; n < 3; n++) { float x = target.position.X + (float)Main.rand.Next(-400, 400); @@ -6622,337 +7104,476 @@ namespace CalamityMod } } - public override void ModifyHitNPCWithProj(Projectile proj, NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) - { - if (auricSet && silvaThrowing && CalamityMod.throwingProjectileList.Contains(proj.type) && !proj.melee && - crit && player.statLife > (int)((double)player.statLifeMax2 * 0.9)) - { - damage = (int)((double)damage * 3.0); - } - if (auricSet && silvaMelee && proj.melee) - { - double multiplier = (double)player.statLife / (double)player.statLifeMax2; - if (multiplier < 0.5) - { - multiplier = 0.5; - } - damage = (int)(((double)damage * multiplier) * 2.0); //ranges from 2.0 times to 1 times - } - if (godSlayerRanged && crit && proj.ranged) - { - int randomChance = 100 - player.rangedCrit; //100 min to 15 max with cap - if (randomChance < 15) - { - randomChance = 15; - } - if (Main.rand.Next(randomChance) == 0) - { - damage *= 2; - } - } - if (tarraMage && crit && proj.magic) - { - tarraCrits++; - } - if (tarraRanged && crit && proj.ranged && player.whoAmI == Main.myPlayer) - { - int num251 = Main.rand.Next(2, 4); - for (int num252 = 0; num252 < num251; num252++) - { - Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - while (value15.X == 0f && value15.Y == 0f) - { - value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - } - value15.Normalize(); - value15 *= (float)Main.rand.Next(70, 101) * 0.1f; - int FUCKYOU = Projectile.NewProjectile(target.position.X + (float)(target.width / 2), target.position.Y + (float)(target.height / 2), - value15.X, value15.Y, 206, (int)((double)damage * (auricSet ? 0.4 : 0.25)), 0f, player.whoAmI, 0f, 0f); - Main.projectile[FUCKYOU].magic = false; - Main.projectile[FUCKYOU].netUpdate = true; - } - } - if (tarraThrowing && tarraThrowingCritTimer <= 0 && tarraThrowingCrits < 25 && crit && - CalamityMod.throwingProjectileList.Contains(proj.type) && !proj.melee) - { - tarraThrowingCrits++; - } - if (bloodflareThrowing && CalamityMod.throwingProjectileList.Contains(proj.type) && !proj.melee && crit && Main.rand.Next(2) == 0) - { - if (player.whoAmI == Main.myPlayer) - { - float num11 = 0.03f; - num11 -= (float)proj.numHits * 0.015f; - if (num11 < 0f) - { - num11 = 0f; - } - float num12 = (float)proj.damage * num11; - if (num12 < 0f) - { - num12 = 0f; - } - if (player.lifeSteal > 0f) - { - player.statLife += 1; - player.HealEffect(1); - player.lifeSteal -= num12 * 2f; - } - } - } - if (bloodflareMage && bloodflareMageCooldown <= 0 && crit && proj.magic && player.whoAmI == Main.myPlayer) - { - bloodflareMageCooldown = 120; - for (int i = 0; i < 3; i++) - { - Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - while (value15.X == 0f && value15.Y == 0f) - { - value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - } - value15.Normalize(); - value15 *= (float)Main.rand.Next(70, 101) * 0.1f; - int fire = Projectile.NewProjectile(target.position.X + (float)(target.width / 2), target.position.Y + (float)(target.height / 2), - value15.X, value15.Y, 15, (int)((double)damage * (auricSet ? 11.0 : 6.0)), 0f, player.whoAmI, 0f, 0f); - Main.projectile[fire].magic = false; - Main.projectile[fire].netUpdate = true; - } - } - if (silvaCountdown > 0 && hasSilvaEffect && silvaRanged && proj.ranged) - { - damage = (int)((double)damage * 1.4); - } - if (silvaCountdown <= 0 && hasSilvaEffect && silvaThrowing && CalamityMod.throwingProjectileList.Contains(proj.type) && !proj.melee) - { - damage = (int)((double)damage * 1.1); - } - if (silvaCountdown <= 0 && hasSilvaEffect && silvaMage && proj.magic) - { - damage = (int)((double)damage * 1.1); - } - if (silvaCountdown <= 0 && hasSilvaEffect && silvaSummon && proj.minion) - { - damage = (int)((double)damage * 1.1); - } - } - #endregion - - #region ModifyHitByNPC - public override void ModifyHitByNPC(NPC npc, ref int damage, ref bool crit) - { - if (fleshTotem && fleshTotemCooldown <= 0) - { - fleshTotemCooldown = 900; //15 seconds - damage /= 2; - } - if (tarraDefense && tarraMelee) - { - damage /= 2; - } - if (bloodflareMelee && bloodflareFrenzyTimer > 0) - { - damage /= 2; - } - if (silvaMelee && silvaCountdown <= 0 && hasSilvaEffect) - { - damage /= 2; - } - if (CalamityWorld.revenge) - { - if (CalamityMod.revengeanceEnemyBuffList.Contains(npc.type)) - damage = (int)((double)damage * 1.25); - } - if (player.whoAmI == Main.myPlayer && !player.immune && !lol && !invincible && !hasSilvaEffect) - { - if (CalamityWorld.revenge && !npc.SpawnedFromStatue) - { - int stressGain = (int)((double)damage * 2.5); - int stressMaxGain = 2500; - if (stressGain < 1) - { - stressGain = 1; - } - if (stressGain > stressMaxGain) - { - stressGain = stressMaxGain; - } - stress += stressGain; - if (stress >= stressMax) - { - stress = stressMax; - } - } - } - } - #endregion - - #region ModifyHitByProj - public override void ModifyHitByProjectile(Projectile proj, ref int damage, ref bool crit) - { - if (proj.type == ProjectileID.Nail) - { - damage = (int)((double)damage * 0.75); - } - if (cEnergy && proj.active && !proj.friendly && proj.hostile && damage > 0) - { - damage = (int)((double)damage * 0.75); - } - if (beeResist) - { - if (CalamityMod.beeProjectileList.Contains(proj.type)) - damage = (int)((double)damage * 0.75); - } - if (Main.hardMode && !CalamityWorld.spawnedHardBoss && proj.active && !proj.friendly && proj.hostile && damage > 0) - { - if (CalamityMod.hardModeNerfList.Contains(proj.type)) - damage = (int)((double)damage * 0.75); - } - if (CalamityWorld.downedDoG && (Main.pumpkinMoon || Main.snowMoon || Main.eclipse)) - { - if (CalamityMod.eventProjectileBuffList.Contains(proj.type)) - damage = (int)((double)damage * 1.5); - } - if (CalamityWorld.revenge) - { - if (CalamityMod.revengeanceProjectileBuffList.Contains(proj.type)) - damage = (int)((double)damage * 1.25); - } - if (player.whoAmI == Main.myPlayer && !player.immune && !lol && !invincible && !hasSilvaEffect) - { - if (CalamityWorld.revenge && !CalamityMod.trapProjectileList.Contains(proj.type)) - { - int stressGain = (int)((double)damage * 2.5); - int stressMaxGain = 2500; - if (stressGain < 1) - { - stressGain = 1; - } - if (stressGain > stressMaxGain) - { - stressGain = stressMaxGain; - } - stress += stressGain; - if (stress >= stressMax) - { - stress = stressMax; - } - } - } - } - #endregion - - #region OnHit - public override void OnHitByNPC(NPC npc, int damage, bool crit) - { - if (CalamityWorld.revenge) - { - if (npc.type == NPCID.SkeletronPrime || npc.type == NPCID.PrimeVice || npc.type == NPCID.PrimeSaw) - { - player.AddBuff(BuffID.Bleeding, 300); - } - else if (npc.type == NPCID.Spazmatism && npc.ai[0] != 1f && npc.ai[0] != 2f && npc.ai[0] != 0f) - { - player.AddBuff(BuffID.Bleeding, 300); - } - else if (npc.type == NPCID.Plantera && npc.life < npc.lifeMax / 2) - { - player.AddBuff(BuffID.Poisoned, 180); - player.AddBuff(BuffID.Bleeding, 300); - } - else if (npc.type == NPCID.PlanterasTentacle) - { - player.AddBuff(BuffID.Poisoned, 90); - player.AddBuff(BuffID.Bleeding, 150); - } - else if (npc.type == NPCID.Golem || npc.type == NPCID.GolemFistLeft || npc.type == NPCID.GolemFistRight || - npc.type == NPCID.GolemHead || npc.type == NPCID.GolemHeadFree) - { - player.AddBuff(BuffID.BrokenArmor, 180); - } - } - } - - public override void OnHitByProjectile(Projectile proj, int damage, bool crit) - { - if (CalamityWorld.revenge && proj.hostile) - { - if (proj.type == ProjectileID.FrostBeam && !player.frozen && !gState) - { - player.AddBuff(mod.BuffType("GlacialState"), 120); - } - else if (proj.type == ProjectileID.DeathLaser) - { - player.AddBuff(BuffID.OnFire, 180); - } - else if (proj.type == ProjectileID.Skull) - { - player.AddBuff(BuffID.Weak, 120); - } - else if (proj.type == ProjectileID.ThornBall) - { - player.AddBuff(BuffID.Poisoned, 180); - } - else if (proj.type == ProjectileID.CultistBossIceMist) - { - player.AddBuff(BuffID.Frozen, 60); - player.AddBuff(BuffID.Chilled, 120); - player.AddBuff(BuffID.Frostburn, 240); - } - else if (proj.type == ProjectileID.CultistBossLightningOrbArc) - { - player.AddBuff(BuffID.Electrified, 120); - } - } - if (projRef && proj.active && !proj.friendly && proj.hostile && damage > 0 && Main.rand.Next(20) == 0) - { - player.statLife += damage; - player.HealEffect(damage); - proj.hostile = false; - proj.friendly = true; - proj.velocity.X = -proj.velocity.X; - proj.velocity.Y = -proj.velocity.Y; - } - if (daedalusReflect && proj.active && !proj.friendly && proj.hostile && damage > 0 && Main.rand.Next(3) == 0) - { - int healAmt = damage / 5; - player.statLife += healAmt; - player.HealEffect(healAmt); - proj.hostile = false; - proj.friendly = true; - proj.velocity.X = -proj.velocity.X; - proj.velocity.Y = -proj.velocity.Y; - } - } - #endregion - - #region Fishing - public override void CatchFish(Item fishingRod, Item bait, int power, int liquidType, int poolSize, int worldLayer, int questFish, ref int caughtType, ref bool junk) + public override void ModifyHitNPCWithProj(Projectile proj, NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) { - Point point = player.Center.ToTileCoordinates(); - bool abyssPosX = false; - if (CalamityWorld.abyssSide) - { - if (point.X < 380) - { - abyssPosX = true; - } - } - else - { - if (point.X > Main.maxTilesX - 380) - { - abyssPosX = true; - } - } - if (junk) + if (auricSet && silvaThrowing && proj.GetGlobalProjectile(mod).rogue && + crit && player.statLife > (int)((double)player.statLifeMax2 * 0.5)) { - if (abyssPosX && liquidType == 0 && power < 40) - { - caughtType = mod.ItemType("PlantyMush"); - } - return; + damage = (int)((double)damage * 1.25); } - /*if (abyssPosX && liquidType == 0 && (bait.type == ItemID.GoldWorm || bait.type == ItemID.GoldGrasshopper || bait.type == ItemID.GoldButterfly) && power > 150) + if (auricSet && silvaMelee && proj.melee) + { + double multiplier = (double)player.statLife / (double)player.statLifeMax2; + if (multiplier < 0.84) + { + multiplier = 0.84; + } + damage = (int)(((double)damage * multiplier) * 1.2); //ranges from 1.2 times to 1 times + } + if (godSlayerRanged && crit && proj.ranged) + { + int randomChance = 100 - player.rangedCrit; //100 min to 15 max with cap + if (randomChance < 15) + { + randomChance = 15; + } + if (Main.rand.Next(randomChance) == 0) + { + damage *= 2; + } + } + if (tarraMage && crit && proj.magic) + { + tarraCrits++; + } + if (tarraRanged && crit && proj.ranged && player.whoAmI == Main.myPlayer) + { + int num251 = Main.rand.Next(2, 4); + for (int num252 = 0; num252 < num251; num252++) + { + Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + while (value15.X == 0f && value15.Y == 0f) + { + value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + } + value15.Normalize(); + value15 *= (float)Main.rand.Next(70, 101) * 0.1f; + int FUCKYOU = Projectile.NewProjectile(target.position.X + (float)(target.width / 2), target.position.Y + (float)(target.height / 2), + value15.X, value15.Y, 206, (int)((double)damage * (auricSet ? 0.4 : 0.25)), 0f, player.whoAmI, 0f, 0f); + Main.projectile[FUCKYOU].magic = false; + Main.projectile[FUCKYOU].netUpdate = true; + } + } + if (tarraThrowing && tarraThrowingCritTimer <= 0 && tarraThrowingCrits < 25 && crit && + proj.GetGlobalProjectile(mod).rogue) + { + tarraThrowingCrits++; + } + if (bloodflareThrowing && proj.GetGlobalProjectile(mod).rogue && crit && Main.rand.Next(2) == 0) + { + if (player.whoAmI == Main.myPlayer && target.canGhostHeal) + { + float num11 = 0.03f; + num11 -= (float)proj.numHits * 0.015f; + if (num11 < 0f) + { + num11 = 0f; + } + float num12 = (float)proj.damage * num11; + if (num12 < 0f) + { + num12 = 0f; + } + if (player.lifeSteal > 0f) + { + player.statLife += 1; + player.HealEffect(1); + player.lifeSteal -= num12 * 2f; + } + } + } + if (bloodflareMage && bloodflareMageCooldown <= 0 && crit && proj.magic && player.whoAmI == Main.myPlayer) + { + bloodflareMageCooldown = 120; + for (int i = 0; i < 3; i++) + { + Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + while (value15.X == 0f && value15.Y == 0f) + { + value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + } + value15.Normalize(); + value15 *= (float)Main.rand.Next(70, 101) * 0.1f; + int fire = Projectile.NewProjectile(target.position.X + (float)(target.width / 2), target.position.Y + (float)(target.height / 2), + value15.X, value15.Y, 15, (int)((double)damage * (auricSet ? 11.0 : 6.0)), 0f, player.whoAmI, 0f, 0f); + Main.projectile[fire].magic = false; + Main.projectile[fire].netUpdate = true; + } + } + if (silvaCountdown > 0 && hasSilvaEffect && silvaRanged && proj.ranged) + { + damage = (int)((double)damage * 1.4); + } + if (silvaCountdown <= 0 && hasSilvaEffect && silvaThrowing && proj.GetGlobalProjectile(mod).rogue) + { + damage = (int)((double)damage * 1.1); + } + if (silvaCountdown <= 0 && hasSilvaEffect && silvaMage && proj.magic) + { + damage = (int)((double)damage * 1.1); + } + if (silvaCountdown <= 0 && hasSilvaEffect && silvaSummon && proj.minion) + { + damage = (int)((double)damage * 1.1); + } + if ((target.damage > 5 || target.boss) && player.whoAmI == Main.myPlayer && !target.SpawnedFromStatue) + { + if (proj.type == mod.ProjectileType("AtaraxiaMain") || proj.type == mod.ProjectileType("AtaraxiaHoming") || + proj.type == mod.ProjectileType("AtaraxiaSplit") || proj.type == mod.ProjectileType("AtaraxiaSide")) + { + ataraxiaDamageBoostCancelTimer = 1200; + if (proj.type == mod.ProjectileType("AtaraxiaMain")) + { + if (ataraxiaDamageBoost < 0.3f) + ataraxiaDamageBoost += 0.0025f; + } + } + if (gainLevelCooldown <= 0) //max is 12501 to avoid setting off fireworks forever + { + 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.Next(10) == 0) //add only to non-multiples of 100 + meleeLevel++; + shootFireworksLevelUpMelee = true; + if (Main.netMode == 1) + { + LevelPacket(false, 0); + } + } + 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.Next(10) == 0) //add only to non-multiples of 100 + rangedLevel++; + shootFireworksLevelUpRanged = true; + if (Main.netMode == 1) + { + LevelPacket(false, 1); + } + } + 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.Next(10) == 0) //add only to non-multiples of 100 + magicLevel++; + shootFireworksLevelUpMagic = true; + if (Main.netMode == 1) + { + LevelPacket(false, 2); + } + } + else if ((proj.minion || proj.sentry || CalamityMod.projectileMinionList.Contains(proj.type)) && 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.Next(10) == 0) //add only to non-multiples of 100 + summonLevel++; + shootFireworksLevelUpSummon = true; + if (Main.netMode == 1) + { + LevelPacket(false, 3); + } + } + else if (proj.GetGlobalProjectile(mod).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.Next(10) == 0) //add only to non-multiples of 100 + rogueLevel++; + shootFireworksLevelUpRogue = true; + if (Main.netMode == 1) + { + LevelPacket(false, 4); + } + } + } + if (raiderTalisman && raiderStack < 250 && proj.GetGlobalProjectile(mod).rogue && crit) + { + raiderStack++; + } + if (CalamityWorld.revenge) + { + if ((proj.melee && proj.ownerHitCheck) || proj.aiStyle == 15 || (proj.aiStyle == 75 && proj.melee) || + proj.type == mod.ProjectileType("Nebulash") || proj.type == mod.ProjectileType("CosmicDischarge") || + proj.type == mod.ProjectileType("MourningStar")) + { + int stressGain = (int)((double)damage * 0.1); + int stressMaxGain = 10; + if (stressGain < 1) + { + stressGain = 1; + } + if (stressGain > stressMaxGain) + { + stressGain = stressMaxGain; + } + stress += stressGain; + if (stress >= stressMax) + { + stress = stressMax; + } + } + } + } + } + #endregion + + #region ModifyHitByNPC + public override void ModifyHitByNPC(NPC npc, ref int damage, ref bool crit) + { + if (fleshTotem && fleshTotemCooldown <= 0) + { + fleshTotemCooldown = 1200; //20 seconds + damage /= 2; + } + if (tarraDefense && tarraMelee) + { + damage /= 2; + } + if (bloodflareMelee && bloodflareFrenzyTimer > 0) + { + damage /= 2; + } + if (silvaMelee && silvaCountdown <= 0 && hasSilvaEffect) + { + damage = (int)((double)damage * 0.8); + } + if (CalamityWorld.revenge) + { + if (CalamityMod.revengeanceEnemyBuffList.Contains(npc.type)) + damage = (int)((double)damage * 1.25); + } + if (player.whoAmI == Main.myPlayer && !player.immune && !lol && !invincible && !hasSilvaEffect) + { + if (CalamityWorld.revenge && !npc.SpawnedFromStatue) + { + int stressGain = (int)((double)damage * 2.0); + int stressMaxGain = 2500; + if (stressGain < 1) + { + stressGain = 1; + } + if (stressGain > stressMaxGain) + { + stressGain = stressMaxGain; + } + stress += stressGain; + if (stress >= stressMax) + { + stress = stressMax; + } + } + } + } + #endregion + + #region ModifyHitByProj + public override void ModifyHitByProjectile(Projectile proj, ref int damage, ref bool crit) + { + if (proj.type == ProjectileID.Nail) + { + damage = (int)((double)damage * 0.75); + } + if (cEnergy && proj.active && !proj.friendly && proj.hostile && damage > 0) + { + damage = (int)((double)damage * 0.75); + } + if (beeResist) + { + if (CalamityMod.beeProjectileList.Contains(proj.type)) + damage = (int)((double)damage * 0.75); + } + if (Main.hardMode && Main.expertMode && !CalamityWorld.spawnedHardBoss && proj.active && !proj.friendly && proj.hostile && damage > 0) + { + if (CalamityMod.hardModeNerfList.Contains(proj.type)) + damage = (int)((double)damage * 0.75); + } + if (CalamityWorld.downedDoG && (Main.pumpkinMoon || Main.snowMoon || Main.eclipse)) + { + if (CalamityMod.eventProjectileBuffList.Contains(proj.type)) + damage = (int)((double)damage * 1.5); + } + if (CalamityWorld.revenge) + { + if (CalamityMod.revengeanceProjectileBuffList.Contains(proj.type)) + damage = (int)((double)damage * 1.25); + } + if (player.whoAmI == Main.myPlayer && !player.immune && !lol && !invincible && !hasSilvaEffect) + { + if (CalamityWorld.revenge && !CalamityMod.trapProjectileList.Contains(proj.type)) + { + int stressGain = (int)((double)damage * 2.0); + int stressMaxGain = 2500; + if (stressGain < 1) + { + stressGain = 1; + } + if (stressGain > stressMaxGain) + { + stressGain = stressMaxGain; + } + stress += stressGain; + if (stress >= stressMax) + { + stress = stressMax; + } + } + } + } + #endregion + + #region OnHit + public override void OnHitByNPC(NPC npc, int damage, bool crit) + { + if (CalamityWorld.revenge) + { + if (npc.type == NPCID.SkeletronPrime || npc.type == NPCID.PrimeVice || npc.type == NPCID.PrimeSaw) + { + player.AddBuff(BuffID.Bleeding, 300); + } + else if (npc.type == NPCID.Spazmatism && npc.ai[0] != 1f && npc.ai[0] != 2f && npc.ai[0] != 0f) + { + player.AddBuff(BuffID.Bleeding, 300); + } + else if (npc.type == NPCID.Plantera && npc.life < npc.lifeMax / 2) + { + player.AddBuff(BuffID.Poisoned, 180); + player.AddBuff(BuffID.Bleeding, 300); + } + else if (npc.type == NPCID.PlanterasTentacle) + { + player.AddBuff(BuffID.Poisoned, 90); + player.AddBuff(BuffID.Bleeding, 150); + } + else if (npc.type == NPCID.Golem || npc.type == NPCID.GolemFistLeft || npc.type == NPCID.GolemFistRight || + npc.type == NPCID.GolemHead || npc.type == NPCID.GolemHeadFree) + { + player.AddBuff(BuffID.BrokenArmor, 180); + } + } + } + + public override void OnHitByProjectile(Projectile proj, int damage, bool crit) + { + if (CalamityWorld.revenge && proj.hostile) + { + if (proj.type == ProjectileID.FrostBeam && !player.frozen && !gState) + { + player.AddBuff(mod.BuffType("GlacialState"), 120); + } + else if (proj.type == ProjectileID.DeathLaser) + { + player.AddBuff(BuffID.OnFire, 180); + } + else if (proj.type == ProjectileID.Skull) + { + player.AddBuff(BuffID.Weak, 120); + } + else if (proj.type == ProjectileID.ThornBall) + { + player.AddBuff(BuffID.Poisoned, 180); + } + else if (proj.type == ProjectileID.CultistBossIceMist) + { + player.AddBuff(BuffID.Frozen, 60); + player.AddBuff(BuffID.Chilled, 120); + player.AddBuff(BuffID.Frostburn, 240); + } + else if (proj.type == ProjectileID.CultistBossLightningOrbArc) + { + player.AddBuff(BuffID.Electrified, 120); + } + } + if (projRef && proj.active && !proj.friendly && proj.hostile && damage > 0 && Main.rand.Next(20) == 0) + { + player.statLife += damage; + player.HealEffect(damage); + proj.hostile = false; + proj.friendly = true; + proj.velocity.X = -proj.velocity.X; + proj.velocity.Y = -proj.velocity.Y; + } + if (daedalusReflect && proj.active && !proj.friendly && proj.hostile && damage > 0 && Main.rand.Next(3) == 0) + { + int healAmt = damage / 5; + player.statLife += healAmt; + player.HealEffect(healAmt); + proj.hostile = false; + proj.friendly = true; + proj.velocity.X = -proj.velocity.X; + proj.velocity.Y = -proj.velocity.Y; + } + } + #endregion + + #region Fishing + public override void CatchFish(Item fishingRod, Item bait, int power, int liquidType, int poolSize, int worldLayer, int questFish, ref int caughtType, ref bool junk) + { + Point point = player.Center.ToTileCoordinates(); + bool abyssPosX = false; + if (CalamityWorld.abyssSide) + { + if (point.X < 380) + { + abyssPosX = true; + } + } + else + { + if (point.X > Main.maxTilesX - 380) + { + abyssPosX = true; + } + } + if (junk) + { + if (abyssPosX && liquidType == 0 && power < 40) + { + caughtType = mod.ItemType("PlantyMush"); + } + return; + } + /*if (abyssPosX && liquidType == 0 && (bait.type == ItemID.GoldWorm || bait.type == ItemID.GoldGrasshopper || bait.type == ItemID.GoldButterfly) && power > 150) { if (Main.netMode != 1) { @@ -6971,306 +7592,306 @@ namespace CalamityMod } return; }*/ - if (power >= 20) - { - if (power >= 40) - { - if (abyssPosX && liquidType == 0 && Main.rand.Next(15) == 0 && power < 80) - { - caughtType = mod.ItemType("PlantyMush"); - } - if (power >= 60) - { - if (player.FindBuffIndex(BuffID.Gills) > -1 && NPC.downedPlantBoss && liquidType == 0 && Main.rand.Next(25) == 0 && power < 160) - { - caughtType = mod.ItemType("Floodtide"); - } - if (abyssPosX && liquidType == 0 && Main.rand.Next(25) == 0 && power < 160) - { - caughtType = mod.ItemType("AlluringBait"); - } - if (power >= 80) - { - if (abyssPosX && Main.hardMode && liquidType == 0 && Main.rand.Next(15) == 0 && power < 210) - { - switch (Main.rand.Next(4)) - { - case 0: caughtType = mod.ItemType("IronBoots"); break; //movement acc - case 1: caughtType = mod.ItemType("DepthCharm"); break; //regen acc - case 2: caughtType = mod.ItemType("AnechoicPlating"); break; //defense acc - case 3: caughtType = mod.ItemType("StrangeOrb"); break; //light pet - } - } - if (power >= 110) - { - if (abyssPosX && liquidType == 0 && Main.rand.Next(25) == 0 && power < 240) - { - caughtType = mod.ItemType("AbyssalAmulet"); - } - } - } - } - } - } - } - #endregion - - #region FrameEffects - public override void FrameEffects() - { - if ((snowmanPower || snowmanForce) && !snowmanHide) - { - player.legs = mod.GetEquipSlot("PopoLeg", EquipType.Legs); - player.body = mod.GetEquipSlot("PopoBody", EquipType.Body); - player.head = (snowmanNoseless ? mod.GetEquipSlot("PopoNoselessHead", EquipType.Head) : mod.GetEquipSlot("PopoHead", EquipType.Head)); - } - else if ((abyssalDivingSuitPower || abyssalDivingSuitForce) && !abyssalDivingSuitHide) - { - player.legs = mod.GetEquipSlot("AbyssalDivingSuitLeg", EquipType.Legs); - player.body = mod.GetEquipSlot("AbyssalDivingSuitBody", EquipType.Body); - player.head = mod.GetEquipSlot("AbyssalDivingSuitHead", EquipType.Head); - } - else if ((sirenBoobsPower || sirenBoobsForce) && !sirenBoobsHide) - { - player.legs = mod.GetEquipSlot("SirenLeg", EquipType.Legs); - player.body = mod.GetEquipSlot("SirenBody", EquipType.Body); - player.head = mod.GetEquipSlot("SirenHead", EquipType.Head); - } - else if ((sirenBoobsAltPower || sirenBoobsAltForce) && !sirenBoobsAltHide) - { - player.legs = mod.GetEquipSlot("SirenLegAlt", EquipType.Legs); - player.body = mod.GetEquipSlot("SirenBodyAlt", EquipType.Body); - player.head = mod.GetEquipSlot("SirenHeadAlt", EquipType.Head); - } - if (NOU) - NOULOL(); - if (CalamityWorld.defiled) - Defiled(); - if (weakPetrification) - WeakPetrification(); - } - #endregion - - #region NOULOL - private void NOULOL() - { - player.ResetEffects(); - player.head = -1; - player.body = -1; - player.legs = -1; - player.handon = -1; - player.handoff = -1; - player.back = -1; - player.front = -1; - player.shoe = -1; - player.waist = -1; - player.shield = -1; - player.neck = -1; - player.face = -1; - player.balloon = -1; - NOU = true; - } - - private void WeakPetrification() - { - player.doubleJumpCloud = false; - player.doubleJumpSandstorm = false; - player.doubleJumpBlizzard = false; - player.rocketBoots = 0; - player.jumpBoost = false; - player.slowFall = false; - player.gravControl = false; - player.gravControl2 = false; - player.jumpSpeedBoost = 0f; - player.wingTimeMax = (int)((double)player.wingTimeMax * 0.5); - player.balloon = -1; - weakPetrification = true; - } - - private void Defiled() - { - player.wingTimeMax = 0; - } - #endregion - - #region HurtMethods - public override bool PreHurt(bool pvp, bool quiet, ref int damage, ref int hitDirection, ref bool crit, ref bool customDamage, ref bool playSound, ref bool genGore, ref PlayerDeathReason damageSource) - { - if (CalamityWorld.armageddon) - { - if (areThereAnyDamnBosses) - { - KillPlayer(); - } - } - if (lol || (invincible && player.inventory[player.selectedItem].type != mod.ItemType("ColdheartIcicle"))) - { - return false; - } - if (godSlayerReflect && Main.rand.Next(50) == 0) - { - return false; - } - if (player.beetleDefense && player.beetleOrbs > 0) - { - float newMult = 0.05f * (float)player.beetleOrbs; //.05 .1 .15 - damage = (int)((double)(1f + newMult) * (double)damage); //damage added for one orb : 100 damage = 1.05 * 100 = 105 - } - if (CalamityGlobalNPC.DraedonMayhem) - { - damage = (int)((double)damage * 1.2); - } - if (dArtifact) - { - damage = (int)((double)damage * 1.25); - } - if (CalamityWorld.bossRushActive) - { - switch (CalamityWorld.bossRushStage) - { - case 0: - damage = (int)((double)damage * 5.0); //Tier 1 Queen Bee values adjusted for a median of 250 damage - break; - case 1: - damage = (int)((double)damage * 4.0); //BoC - break; - case 2: - damage = (int)((double)damage * 4.0); //King Slime - break; - case 3: - damage = (int)((double)damage * 6.0); //EoC - break; - case 4: - damage = (int)((double)damage * 2.5); //Prime - break; - case 5: - damage = (int)((double)damage * 2.5); //Golem - break; - case 6: - damage = (int)((double)damage * 1.75); //Guardians - break; - case 7: - damage = (int)((double)damage * 5.0); //EoW - break; - case 8: - damage = (int)((double)damage * 2.0); //Tier 2 Astrageldon values adjusted for a median of 300 damage - break; - case 9: - damage = (int)((double)damage * 3.0); //Destroyer - break; - case 10: - damage = (int)((double)damage * 3.0); //Twins - break; - case 11: - damage = (int)((double)damage * 1.0); //Birb - break; - case 12: - damage = (int)((double)damage * 4.0); //WoF - break; - case 13: - damage = (int)((double)damage * 4.5); //Hive Mind - break; - case 14: - damage = (int)((double)damage * 4.0); //Skeletron - break; - case 15: - damage = (int)((double)damage * 1.25); //Storm Weaver - break; - case 16: - damage = (int)((double)damage * 3.0); //Tier 3 Aquatic Scourge values adjusted for a median of 350 damage - break; - case 17: - damage = (int)((double)damage * 6.0); //Desert Scourge - break; - case 18: - damage = (int)((double)damage * 3.5); //Cultist - break; - case 19: - damage = (int)((double)damage * 4.5); //Crabulon - break; - case 20: - damage = (int)((double)damage * 3.5); //Plantera - break; - case 21: - damage = (int)((double)damage * 2.0); //Void - break; - case 22: - damage = (int)((double)damage * 5.0); //Perfs - break; - case 23: - damage = (int)((double)damage * 4.0); //Cryogen - break; - case 24: - damage = (int)((double)damage * 4.0); //Tier 4 Brimstone Elemental values adjusted for a median of 400 damage - break; - case 25: - damage = (int)((double)damage * 2.0); //Signus - break; - case 26: - damage = (int)((double)damage * 2.5); //Ravager - break; - case 27: - damage = (int)((double)damage * 2.0); //Fishron - break; - case 28: - damage = (int)((double)damage * 2.5); //Moon Lord - break; - case 29: - damage = (int)((double)damage * 2.75); //Astrum Deus - break; - case 30: - damage = (int)((double)damage * 2.0); //Polter - break; - case 31: - damage = (int)((double)damage * 2.5); //Plaguebringer - break; - case 32: - damage = (int)((double)damage * 4.0); //Tier 5 Calamitas values adjusted for a median of 450 to 500 damage - break; - case 33: - damage = (int)((double)damage * 3.75); //Levi and Siren - break; - case 34: - damage = (int)((double)damage * 5.25); //Slime God - break; - case 35: - damage = (int)((double)damage * 2.5); //Providence - break; - case 36: - damage = (int)((double)damage * 1.0); //SCal - break; - case 37: - damage = (int)((double)damage * 1.1); //Yharon - break; - case 38: - damage = (int)((double)damage * 2.0); //DoG - break; - } - } - if (enraged) - { - damage = (int)((double)damage * 1.5); - } - if (CalamityWorld.revenge) + if (power >= 20) { - if (player.chaosState) - { - damage = (int)((double)damage * 1.25); - } - if (player.ichor) - { - damage = (int)((double)damage * 1.25); - } - else if (player.onFire2) - { - damage = (int)((double)damage * 1.2); - } - customDamage = true; + if (power >= 40) + { + if (abyssPosX && liquidType == 0 && Main.rand.Next(15) == 0 && power < 80) + { + caughtType = mod.ItemType("PlantyMush"); + } + if (power >= 60) + { + if (player.FindBuffIndex(BuffID.Gills) > -1 && NPC.downedPlantBoss && liquidType == 0 && Main.rand.Next(25) == 0 && power < 160) + { + caughtType = mod.ItemType("Floodtide"); + } + if (abyssPosX && liquidType == 0 && Main.rand.Next(25) == 0 && power < 160) + { + caughtType = mod.ItemType("AlluringBait"); + } + if (power >= 80) + { + if (abyssPosX && Main.hardMode && liquidType == 0 && Main.rand.Next(15) == 0 && power < 210) + { + switch (Main.rand.Next(4)) + { + case 0: caughtType = mod.ItemType("IronBoots"); break; //movement acc + case 1: caughtType = mod.ItemType("DepthCharm"); break; //regen acc + case 2: caughtType = mod.ItemType("AnechoicPlating"); break; //defense acc + case 3: caughtType = mod.ItemType("StrangeOrb"); break; //light pet + } + } + if (power >= 110) + { + if (abyssPosX && liquidType == 0 && Main.rand.Next(25) == 0 && power < 240) + { + caughtType = mod.ItemType("AbyssalAmulet"); + } + } + } + } + } + } + } + #endregion + + #region FrameEffects + public override void FrameEffects() + { + if ((snowmanPower || snowmanForce) && !snowmanHide) + { + player.legs = mod.GetEquipSlot("PopoLeg", EquipType.Legs); + player.body = mod.GetEquipSlot("PopoBody", EquipType.Body); + player.head = (snowmanNoseless ? mod.GetEquipSlot("PopoNoselessHead", EquipType.Head) : mod.GetEquipSlot("PopoHead", EquipType.Head)); + } + else if ((abyssalDivingSuitPower || abyssalDivingSuitForce) && !abyssalDivingSuitHide) + { + player.legs = mod.GetEquipSlot("AbyssalDivingSuitLeg", EquipType.Legs); + player.body = mod.GetEquipSlot("AbyssalDivingSuitBody", EquipType.Body); + player.head = mod.GetEquipSlot("AbyssalDivingSuitHead", EquipType.Head); + } + else if ((sirenBoobsPower || sirenBoobsForce) && !sirenBoobsHide) + { + player.legs = mod.GetEquipSlot("SirenLeg", EquipType.Legs); + player.body = mod.GetEquipSlot("SirenBody", EquipType.Body); + player.head = mod.GetEquipSlot("SirenHead", EquipType.Head); + } + else if ((sirenBoobsAltPower || sirenBoobsAltForce) && !sirenBoobsAltHide) + { + player.legs = mod.GetEquipSlot("SirenLegAlt", EquipType.Legs); + player.body = mod.GetEquipSlot("SirenBodyAlt", EquipType.Body); + player.head = mod.GetEquipSlot("SirenHeadAlt", EquipType.Head); + } + if (NOU) + NOULOL(); + if (CalamityWorld.defiled) + Defiled(); + if (weakPetrification) + WeakPetrification(); + } + #endregion + + #region NOULOL + private void NOULOL() + { + player.ResetEffects(); + player.head = -1; + player.body = -1; + player.legs = -1; + player.handon = -1; + player.handoff = -1; + player.back = -1; + player.front = -1; + player.shoe = -1; + player.waist = -1; + player.shield = -1; + player.neck = -1; + player.face = -1; + player.balloon = -1; + NOU = true; + } + + private void WeakPetrification() + { + player.doubleJumpCloud = false; + player.doubleJumpSandstorm = false; + player.doubleJumpBlizzard = false; + player.rocketBoots = 0; + player.jumpBoost = false; + player.slowFall = false; + player.gravControl = false; + player.gravControl2 = false; + player.jumpSpeedBoost = 0f; + player.wingTimeMax = (int)((double)player.wingTimeMax * 0.5); + player.balloon = -1; + weakPetrification = true; + } + + private void Defiled() + { + player.wingTimeMax = 0; + } + #endregion + + #region HurtMethods + public override bool PreHurt(bool pvp, bool quiet, ref int damage, ref int hitDirection, ref bool crit, ref bool customDamage, ref bool playSound, ref bool genGore, ref PlayerDeathReason damageSource) + { + if (CalamityWorld.armageddon) + { + if (areThereAnyDamnBosses) + { + KillPlayer(); + } + } + if (lol || (invincible && player.inventory[player.selectedItem].type != mod.ItemType("ColdheartIcicle"))) + { + return false; + } + if (godSlayerReflect && Main.rand.Next(50) == 0) + { + return false; + } + if (player.beetleDefense && player.beetleOrbs > 0) + { + float newMult = 0.05f * (float)player.beetleOrbs; //.05 .1 .15 + damage = (int)((double)(1f + newMult) * (double)damage); //damage added for one orb : 100 damage = 1.05 * 100 = 105 + } + if (CalamityGlobalNPC.DraedonMayhem) + { + damage = (int)((double)damage * 1.2); + } + if (dArtifact) + { + damage = (int)((double)damage * 1.25); + } + if (CalamityWorld.bossRushActive) + { + switch (CalamityWorld.bossRushStage) + { + case 0: + damage = (int)((double)damage * 5.0); //Tier 1 Queen Bee values adjusted for a median of 250 damage + break; + case 1: + damage = (int)((double)damage * 4.0); //BoC + break; + case 2: + damage = (int)((double)damage * 4.0); //King Slime + break; + case 3: + damage = (int)((double)damage * 6.0); //EoC + break; + case 4: + damage = (int)((double)damage * 2.5); //Prime + break; + case 5: + damage = (int)((double)damage * 2.5); //Golem + break; + case 6: + damage = (int)((double)damage * 1.75); //Guardians + break; + case 7: + damage = (int)((double)damage * 5.0); //EoW + break; + case 8: + damage = (int)((double)damage * 2.0); //Tier 2 Astrageldon values adjusted for a median of 300 damage + break; + case 9: + damage = (int)((double)damage * 3.0); //Destroyer + break; + case 10: + damage = (int)((double)damage * 3.0); //Twins + break; + case 11: + damage = (int)((double)damage * 1.0); //Birb + break; + case 12: + damage = (int)((double)damage * 4.0); //WoF + break; + case 13: + damage = (int)((double)damage * 4.5); //Hive Mind + break; + case 14: + damage = (int)((double)damage * 4.0); //Skeletron + break; + case 15: + damage = (int)((double)damage * 1.25); //Storm Weaver + break; + case 16: + damage = (int)((double)damage * 3.0); //Tier 3 Aquatic Scourge values adjusted for a median of 350 damage + break; + case 17: + damage = (int)((double)damage * 6.0); //Desert Scourge + break; + case 18: + damage = (int)((double)damage * 3.5); //Cultist + break; + case 19: + damage = (int)((double)damage * 4.5); //Crabulon + break; + case 20: + damage = (int)((double)damage * 3.5); //Plantera + break; + case 21: + damage = (int)((double)damage * 2.0); //Void + break; + case 22: + damage = (int)((double)damage * 5.0); //Perfs + break; + case 23: + damage = (int)((double)damage * 4.0); //Cryogen + break; + case 24: + damage = (int)((double)damage * 4.0); //Tier 4 Brimstone Elemental values adjusted for a median of 400 damage + break; + case 25: + damage = (int)((double)damage * 2.0); //Signus + break; + case 26: + damage = (int)((double)damage * 2.5); //Ravager + break; + case 27: + damage = (int)((double)damage * 2.0); //Fishron + break; + case 28: + damage = (int)((double)damage * 2.5); //Moon Lord + break; + case 29: + damage = (int)((double)damage * 2.75); //Astrum Deus + break; + case 30: + damage = (int)((double)damage * 2.0); //Polter + break; + case 31: + damage = (int)((double)damage * 2.5); //Plaguebringer + break; + case 32: + damage = (int)((double)damage * 4.0); //Tier 5 Calamitas values adjusted for a median of 450 to 500 damage + break; + case 33: + damage = (int)((double)damage * 3.75); //Levi and Siren + break; + case 34: + damage = (int)((double)damage * 5.25); //Slime God + break; + case 35: + damage = (int)((double)damage * 2.5); //Providence + break; + case 36: + damage = (int)((double)damage * 1.0); //SCal + break; + case 37: + damage = (int)((double)damage * 1.1); //Yharon + break; + case 38: + damage = (int)((double)damage * 2.0); //DoG + break; + } + } + if (enraged) + { + damage = (int)((double)damage * 1.25); + } + if (CalamityWorld.revenge) + { + if (player.chaosState && !normalityRelocator) + { + damage = (int)((double)damage * 1.5); //ono + } + if (player.ichor) + { + damage = (int)((double)damage * 1.25); + } + else if (player.onFire2) + { + damage = (int)((double)damage * 1.2); + } + customDamage = true; float damageMult = CalamityWorld.downedBossAny ? 1f : 0.8f; - if (CalamityWorld.death) - { - damageMult = 1.25f; - } + if (CalamityWorld.death) + { + damageMult = 1.25f; + } damage = (int)((double)damage * damageMult); double newDamage = (double)damage - (double)player.statDefense * (Main.hardMode ? 0.75 : 0.5); double newDamageLimit = 5.0 + (Main.hardMode ? 5.0 : 0.0) + (NPC.downedPlantBoss ? 5.0 : 0.0) + (NPC.downedMoonlord ? 5.0 : 0.0); //5, 10, 15, 20 @@ -7280,381 +7901,401 @@ namespace CalamityMod } damage = (int)newDamage; } - if (bloodPact) - { - if (Main.rand.Next(4) == 0) - { - damage = (int)((double)damage * 3.0); - } - } - if (godSlayerDamage && damage <= 80) - { - damage = 1; - } - if ((abyssalDivingSuitPower || abyssalDivingSuitForce) && !abyssalDivingSuitHide) - { - playSound = false; - Main.PlaySound(3, (int)player.position.X, (int)player.position.Y, 4, 1f, 0f); //metal hit noise - } - else if (((sirenBoobsPower || sirenBoobsForce) && !sirenBoobsHide) || ((sirenBoobsAltPower || sirenBoobsAltForce) && !sirenBoobsAltHide)) - { - playSound = false; - Main.PlaySound(20, (int)player.position.X, (int)player.position.Y, 1, 1f, 0f); //female hit noise - } - if (abyssalDivingSuitPlates) - { - damage = (int)((double)damage * 0.85); - } - if (sirenIce) - { - damage = (int)((double)damage * 0.8); - } - if (auricSet || silvaSet) - { - damage = (int)((double)damage * 0.95); - } - if (revivifyTimer > 0) - { - int healAmt = damage / 20; - player.statLife += healAmt; - player.HealEffect(healAmt); - } - if (daedalusAbsorb && Main.rand.Next(10) == 0) + if (CalamityWorld.defiled) + { + if (Main.rand.Next(4) == 0) + { + damage = (int)((double)damage * 3.0); + } + } + if (bloodPact) + { + if (Main.rand.Next(4) == 0) + { + damage = (int)((double)damage * 3.0); + } + } + if (godSlayerDamage && damage <= 80) + { + damage = 1; + } + if ((abyssalDivingSuitPower || abyssalDivingSuitForce) && !abyssalDivingSuitHide) + { + playSound = false; + Main.PlaySound(3, (int)player.position.X, (int)player.position.Y, 4, 1f, 0f); //metal hit noise + } + else if (((sirenBoobsPower || sirenBoobsForce) && !sirenBoobsHide) || ((sirenBoobsAltPower || sirenBoobsAltForce) && !sirenBoobsAltHide)) + { + playSound = false; + Main.PlaySound(20, (int)player.position.X, (int)player.position.Y, 1, 1f, 0f); //female hit noise + } + if (abyssalDivingSuitPlates) + { + damage = (int)((double)damage * 0.85); + } + if (sirenIce) + { + damage = (int)((double)damage * 0.8); + } + if (auricSet || silvaSet) + { + damage = (int)((double)damage * 0.95); + } + if (purpleCandle) + { + damage = (int)((double)damage - ((double)player.statDefense * 0.05)); + } + if (revivifyTimer > 0) + { + int healAmt = damage / 20; + player.statLife += healAmt; + player.HealEffect(healAmt); + } + if (daedalusAbsorb && Main.rand.Next(10) == 0) { int healAmt = damage / 2; player.statLife += healAmt; - player.HealEffect(healAmt); + player.HealEffect(healAmt); } if (absorber) { int healAmt = damage / 20; player.statLife += healAmt; - player.HealEffect(healAmt); + player.HealEffect(healAmt); + } + if (CalamityGlobalNPC.SCal > -1) + { + int newDamageLimit = 300; + if (damage < newDamageLimit) + { + damage = newDamageLimit; + } } - if (CalamityGlobalNPC.SCal > -1) - { - int newDamageLimit = 300; - if (damage < newDamageLimit) - { - damage = newDamageLimit; - } - } return true; } - + public override void Hurt(bool pvp, bool quiet, double damage, int hitDirection, bool crit) { modStealth = 1f; - if (player.whoAmI == Main.myPlayer && rageMode) - { - stress = 0; - if (player.FindBuffIndex(mod.BuffType("RageMode")) > -1) { player.ClearBuff(mod.BuffType("RageMode")); } - } - if (player.whoAmI == Main.myPlayer && !adrenalineMode && adrenaline != adrenalineMax) - { - adrenaline = 0; - } - if (player.whoAmI == Main.myPlayer && gShell && !player.panic) + ataraxiaDamageBoost = 0f; + if (player.whoAmI == Main.myPlayer) { - player.AddBuff(mod.BuffType("ShellBoost"), 300); - } - if (player.whoAmI == Main.myPlayer && abyssalDivingSuitPlates && damage > 50) - { - abyssalDivingSuitPlateHits++; - if (abyssalDivingSuitPlateHits >= 3) - { - Main.PlaySound(4, (int)player.position.X, (int)player.position.Y, 14); - player.AddBuff(mod.BuffType("AbyssalDivingSuitPlatesBroken"), 10830); - for (int num621 = 0; num621 < 20; num621++) - { - int num622 = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, 31, 0f, 0f, 100, default(Color), 2f); - Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) - { - Main.dust[num622].scale = 0.5f; - Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; - } - } - for (int num623 = 0; num623 < 35; num623++) - { - int num624 = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, 6, 0f, 0f, 100, default(Color), 3f); - Main.dust[num624].noGravity = true; - Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, 6, 0f, 0f, 100, default(Color), 2f); - Main.dust[num624].velocity *= 2f; - } - for (int num625 = 0; num625 < 3; num625++) - { - float scaleFactor10 = 0.33f; - if (num625 == 1) - { - scaleFactor10 = 0.66f; - } - if (num625 == 2) - { - scaleFactor10 = 1f; - } - int num626 = Gore.NewGore(new Vector2(player.position.X + (float)(player.width / 2) - 24f, player.position.Y + (float)(player.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13AB6_cp_0 = Main.gore[num626]; - expr_13AB6_cp_0.velocity.X = expr_13AB6_cp_0.velocity.X + 1f; - Gore expr_13AD6_cp_0 = Main.gore[num626]; - expr_13AD6_cp_0.velocity.Y = expr_13AD6_cp_0.velocity.Y + 1f; - num626 = Gore.NewGore(new Vector2(player.position.X + (float)(player.width / 2) - 24f, player.position.Y + (float)(player.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13B79_cp_0 = Main.gore[num626]; - expr_13B79_cp_0.velocity.X = expr_13B79_cp_0.velocity.X - 1f; - Gore expr_13B99_cp_0 = Main.gore[num626]; - expr_13B99_cp_0.velocity.Y = expr_13B99_cp_0.velocity.Y + 1f; - num626 = Gore.NewGore(new Vector2(player.position.X + (float)(player.width / 2) - 24f, player.position.Y + (float)(player.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13C3C_cp_0 = Main.gore[num626]; - expr_13C3C_cp_0.velocity.X = expr_13C3C_cp_0.velocity.X + 1f; - Gore expr_13C5C_cp_0 = Main.gore[num626]; - expr_13C5C_cp_0.velocity.Y = expr_13C5C_cp_0.velocity.Y - 1f; - num626 = Gore.NewGore(new Vector2(player.position.X + (float)(player.width / 2) - 24f, player.position.Y + (float)(player.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13CFF_cp_0 = Main.gore[num626]; - expr_13CFF_cp_0.velocity.X = expr_13CFF_cp_0.velocity.X - 1f; - Gore expr_13D1F_cp_0 = Main.gore[num626]; - expr_13D1F_cp_0.velocity.Y = expr_13D1F_cp_0.velocity.Y - 1f; - } - } - } - if (player.whoAmI == Main.myPlayer && sirenIce) - { - Main.PlaySound(4, (int)player.position.X, (int)player.position.Y, 7); - player.AddBuff(mod.BuffType("IceShieldBrokenBuff"), 1800); - for (int num621 = 0; num621 < 10; num621++) - { - int num622 = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, 67, 0f, 0f, 100, default(Color), 2f); - Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) - { - Main.dust[num622].scale = 0.5f; - Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; - } - } - for (int num623 = 0; num623 < 15; num623++) - { - int num624 = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, 67, 0f, 0f, 100, default(Color), 3f); - Main.dust[num624].noGravity = true; - Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, 67, 0f, 0f, 100, default(Color), 2f); - Main.dust[num624].velocity *= 2f; - } - } - if (tarraMelee && player.whoAmI == Main.myPlayer) - { - if (Main.rand.Next(4) == 0) - { - player.AddBuff(mod.BuffType("TarraLifeRegen"), Main.rand.Next(120, 360)); - } - } - if (player.whoAmI == Main.myPlayer && xerocSet) - { - player.AddBuff(mod.BuffType("XerocRage"), 240); - player.AddBuff(mod.BuffType("XerocWrath"), 240); - } - else if (player.whoAmI == Main.myPlayer && reaverBlast) - { - player.AddBuff(mod.BuffType("ReaverRage"), 180); - } - if ((fBarrier || ((sirenBoobs || sirenBoobsAlt) && NPC.downedBoss3)) && Main.myPlayer == player.whoAmI) - { - Main.PlaySound(2, (int)player.position.X, (int)player.position.Y, 27); - for (int m = 0; m < 200; m++) + if (rageMode) { - if (Main.npc[m].active && !Main.npc[m].friendly) + stress = 0; + if (player.FindBuffIndex(mod.BuffType("RageMode")) > -1) { player.ClearBuff(mod.BuffType("RageMode")); } + } + if (amidiasBlessing) + { + player.ClearBuff(mod.BuffType("AmidiasBlessing")); + Main.PlaySound(2, (int)player.position.X, (int)player.position.Y, 96); + } + if (!adrenalineMode && adrenaline != adrenalineMax) + { + adrenaline = 0; + } + if (gShell && !player.panic) + { + player.AddBuff(mod.BuffType("ShellBoost"), 300); + } + if (abyssalDivingSuitPlates && damage > 50) + { + abyssalDivingSuitPlateHits++; + if (abyssalDivingSuitPlateHits >= 3) { - float distance = (Main.npc[m].Center - player.Center).Length(); - float num10 = (float)Main.rand.Next(200 + (int)damage / 2, 301 + (int)damage * 2); - if (num10 > 500f) + Main.PlaySound(4, (int)player.position.X, (int)player.position.Y, 14); + player.AddBuff(mod.BuffType("AbyssalDivingSuitPlatesBroken"), 10830); + for (int num621 = 0; num621 < 20; num621++) { - num10 = 500f + (num10 - 500f) * 0.75f; + int num622 = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, 31, 0f, 0f, 100, default(Color), 2f); + Main.dust[num622].velocity *= 3f; + if (Main.rand.Next(2) == 0) + { + Main.dust[num622].scale = 0.5f; + Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + } } - if (num10 > 700f) + for (int num623 = 0; num623 < 35; num623++) { - num10 = 700f + (num10 - 700f) * 0.5f; + int num624 = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, 6, 0f, 0f, 100, default(Color), 3f); + Main.dust[num624].noGravity = true; + Main.dust[num624].velocity *= 5f; + num624 = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, 6, 0f, 0f, 100, default(Color), 2f); + Main.dust[num624].velocity *= 2f; } - if (num10 > 900f) + for (int num625 = 0; num625 < 3; num625++) { - num10 = 900f + (num10 - 900f) * 0.25f; - } - if (distance < num10) - { - float num11 = (float)Main.rand.Next(90 + (int)damage / 3, 240 + (int)damage / 2); - Main.npc[m].AddBuff(mod.BuffType("GlacialState"), (int)num11, false); + float scaleFactor10 = 0.33f; + if (num625 == 1) + { + scaleFactor10 = 0.66f; + } + if (num625 == 2) + { + scaleFactor10 = 1f; + } + int num626 = Gore.NewGore(new Vector2(player.position.X + (float)(player.width / 2) - 24f, player.position.Y + (float)(player.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num626].velocity *= scaleFactor10; + Gore expr_13AB6_cp_0 = Main.gore[num626]; + expr_13AB6_cp_0.velocity.X = expr_13AB6_cp_0.velocity.X + 1f; + Gore expr_13AD6_cp_0 = Main.gore[num626]; + expr_13AD6_cp_0.velocity.Y = expr_13AD6_cp_0.velocity.Y + 1f; + num626 = Gore.NewGore(new Vector2(player.position.X + (float)(player.width / 2) - 24f, player.position.Y + (float)(player.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num626].velocity *= scaleFactor10; + Gore expr_13B79_cp_0 = Main.gore[num626]; + expr_13B79_cp_0.velocity.X = expr_13B79_cp_0.velocity.X - 1f; + Gore expr_13B99_cp_0 = Main.gore[num626]; + expr_13B99_cp_0.velocity.Y = expr_13B99_cp_0.velocity.Y + 1f; + num626 = Gore.NewGore(new Vector2(player.position.X + (float)(player.width / 2) - 24f, player.position.Y + (float)(player.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num626].velocity *= scaleFactor10; + Gore expr_13C3C_cp_0 = Main.gore[num626]; + expr_13C3C_cp_0.velocity.X = expr_13C3C_cp_0.velocity.X + 1f; + Gore expr_13C5C_cp_0 = Main.gore[num626]; + expr_13C5C_cp_0.velocity.Y = expr_13C5C_cp_0.velocity.Y - 1f; + num626 = Gore.NewGore(new Vector2(player.position.X + (float)(player.width / 2) - 24f, player.position.Y + (float)(player.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num626].velocity *= scaleFactor10; + Gore expr_13CFF_cp_0 = Main.gore[num626]; + expr_13CFF_cp_0.velocity.X = expr_13CFF_cp_0.velocity.X - 1f; + Gore expr_13D1F_cp_0 = Main.gore[num626]; + expr_13D1F_cp_0.velocity.Y = expr_13D1F_cp_0.velocity.Y - 1f; } } } - } - if (aBrain && Main.myPlayer == player.whoAmI) - { - for (int m = 0; m < 200; m++) + if (sirenIce) { - if (Main.npc[m].active && !Main.npc[m].friendly) + Main.PlaySound(4, (int)player.position.X, (int)player.position.Y, 7); + player.AddBuff(mod.BuffType("IceShieldBrokenBuff"), 1800); + for (int num621 = 0; num621 < 10; num621++) { - float arg_67A_0 = (Main.npc[m].Center - player.Center).Length(); - float num10 = (float)Main.rand.Next(200 + (int)damage / 2, 301 + (int)damage * 2); - if (num10 > 500f) + int num622 = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, 67, 0f, 0f, 100, default(Color), 2f); + Main.dust[num622].velocity *= 3f; + if (Main.rand.Next(2) == 0) { - num10 = 500f + (num10 - 500f) * 0.75f; + Main.dust[num622].scale = 0.5f; + Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; } - if (num10 > 700f) + } + for (int num623 = 0; num623 < 15; num623++) + { + int num624 = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, 67, 0f, 0f, 100, default(Color), 3f); + Main.dust[num624].noGravity = true; + Main.dust[num624].velocity *= 5f; + num624 = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, 67, 0f, 0f, 100, default(Color), 2f); + Main.dust[num624].velocity *= 2f; + } + } + if (tarraMelee) + { + if (Main.rand.Next(4) == 0) + { + player.AddBuff(mod.BuffType("TarraLifeRegen"), Main.rand.Next(90, 180)); + } + } + else if (xerocSet) + { + player.AddBuff(mod.BuffType("XerocRage"), 240); + player.AddBuff(mod.BuffType("XerocWrath"), 240); + } + else if (reaverBlast) + { + player.AddBuff(mod.BuffType("ReaverRage"), 180); + } + if (fBarrier || ((sirenBoobs || sirenBoobsAlt) && NPC.downedBoss3)) + { + Main.PlaySound(2, (int)player.position.X, (int)player.position.Y, 27); + for (int m = 0; m < 200; m++) + { + if (Main.npc[m].active && !Main.npc[m].friendly) { - num10 = 700f + (num10 - 700f) * 0.5f; - } - if (num10 > 900f) - { - num10 = 900f + (num10 - 900f) * 0.25f; - } - if (arg_67A_0 < num10) - { - float num11 = (float)Main.rand.Next(90 + (int)damage / 3, 300 + (int)damage / 2); - Main.npc[m].AddBuff(31, (int)num11, false); + float distance = (Main.npc[m].Center - player.Center).Length(); + float num10 = (float)Main.rand.Next(200 + (int)damage / 2, 301 + (int)damage * 2); + if (num10 > 500f) + { + num10 = 500f + (num10 - 500f) * 0.75f; + } + if (num10 > 700f) + { + num10 = 700f + (num10 - 700f) * 0.5f; + } + if (num10 > 900f) + { + num10 = 900f + (num10 - 900f) * 0.25f; + } + if (distance < num10) + { + float num11 = (float)Main.rand.Next(90 + (int)damage / 3, 240 + (int)damage / 2); + Main.npc[m].AddBuff(mod.BuffType("GlacialState"), (int)num11, false); + } } } } - Projectile.NewProjectile(player.Center.X + (float)Main.rand.Next(-40, 40), player.Center.Y - (float)Main.rand.Next(20, 60), player.velocity.X * 0.3f, player.velocity.Y * 0.3f, 565, 0, 0f, player.whoAmI, 0f, 0f); + if (aBrain) + { + for (int m = 0; m < 200; m++) + { + if (Main.npc[m].active && !Main.npc[m].friendly) + { + float arg_67A_0 = (Main.npc[m].Center - player.Center).Length(); + float num10 = (float)Main.rand.Next(200 + (int)damage / 2, 301 + (int)damage * 2); + if (num10 > 500f) + { + num10 = 500f + (num10 - 500f) * 0.75f; + } + if (num10 > 700f) + { + num10 = 700f + (num10 - 700f) * 0.5f; + } + if (num10 > 900f) + { + num10 = 900f + (num10 - 900f) * 0.25f; + } + if (arg_67A_0 < num10) + { + float num11 = (float)Main.rand.Next(90 + (int)damage / 3, 300 + (int)damage / 2); + Main.npc[m].AddBuff(31, (int)num11, false); + } + } + } + Projectile.NewProjectile(player.Center.X + (float)Main.rand.Next(-40, 40), player.Center.Y - (float)Main.rand.Next(20, 60), player.velocity.X * 0.3f, player.velocity.Y * 0.3f, 565, 0, 0f, player.whoAmI, 0f, 0f); + } } - if (player.ownedProjectileCounts[mod.ProjectileType("Drataliornus")] != 0) - { - for (int i = 0; i < 1000; i++) - { - if (Main.projectile[i].active && Main.projectile[i].type == mod.ProjectileType("Drataliornus") && Main.projectile[i].owner == player.whoAmI) - { - Main.projectile[i].Kill(); - break; - } - } - player.AddBuff(mod.BuffType("Backfire"), 360); - if (player.wingTime > player.wingTimeMax / 2) - player.wingTime = player.wingTimeMax / 2; - } - } - + if (player.ownedProjectileCounts[mod.ProjectileType("Drataliornus")] != 0) + { + for (int i = 0; i < 1000; i++) + { + if (Main.projectile[i].active && Main.projectile[i].type == mod.ProjectileType("Drataliornus") && Main.projectile[i].owner == player.whoAmI) + { + Main.projectile[i].Kill(); + break; + } + } + player.AddBuff(mod.BuffType("Backfire"), 360); + if (player.wingTime > player.wingTimeMax / 2) + player.wingTime = player.wingTimeMax / 2; + } + } + public override void PostHurt(bool pvp, bool quiet, double damage, int hitDirection, bool crit) { - if (pArtifact) - { - player.AddBuff(mod.BuffType("BurntOut"), 300, true); - } - if (CalamityGlobalNPC.SCal > -1 && CalamityWorld.revenge) - { - if (damage < 100) - { - KillPlayer(); - string key = "Mods.CalamityMod.SupremeBossText28"; - Color messageColor = Color.Orange; - if (Main.netMode == 0) - { - Main.NewText(Language.GetTextValue(key), messageColor); - } - else if (Main.netMode == 2) - { - NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); - } - } - } - bool hardMode = Main.hardMode; - if (player.whoAmI == Main.myPlayer) - { - if (cTracers && damage > 200) - { - player.immuneTime += 60; - } - if (godSlayerThrowing && damage > 80) - { - player.immuneTime += 30; - } - if (statigelSet && damage > 100) - { - player.immuneTime += 30; - } - if (dAmulet) - { - if (damage == 1.0) - { - player.immuneTime += 10; - } - else - { - player.immuneTime += 20; - } - } - if (fabsolVodka) - { - if (damage == 1.0) - { - player.immuneTime += 5; - } - else - { - player.immuneTime += 10; - } - } - if (damage > 25) - { - if (aeroSet) - { - for (int n = 0; n < 4; n++) - { - float x = player.position.X + (float)Main.rand.Next(-400, 400); - float y = player.position.Y - (float)Main.rand.Next(500, 800); - Vector2 vector = new Vector2(x, y); - float num13 = player.position.X + (float)(player.width / 2) - vector.X; - float num14 = player.position.Y + (float)(player.height / 2) - vector.Y; - num13 += (float)Main.rand.Next(-100, 101); - int num15 = 20; - float num16 = (float)Math.Sqrt((double)(num13 * num13 + num14 * num14)); - num16 = (float)num15 / num16; - num13 *= num16; - num14 *= num16; - int num17 = Projectile.NewProjectile(x, y, num13, num14, mod.ProjectileType("StickyFeatherAero"), 20, 1f, player.whoAmI, 0f, 0f); - } - } - } - if (aBulwark) - { - for (int n = 0; n < 4; n++) - { - float x = player.position.X + (float)Main.rand.Next(-400, 400); - float y = player.position.Y - (float)Main.rand.Next(500, 800); - Vector2 vector = new Vector2(x, y); - float num13 = player.position.X + (float)(player.width / 2) - vector.X; - float num14 = player.position.Y + (float)(player.height / 2) - vector.Y; - num13 += (float)Main.rand.Next(-100, 101); - int num15 = 29; - float num16 = (float)Math.Sqrt((double)(num13 * num13 + num14 * num14)); - num16 = (float)num15 / num16; - num13 *= num16; - num14 *= num16; - int num17 = Projectile.NewProjectile(x, y, num13, num14, mod.ProjectileType("AstralStar"), 320, 5f, player.whoAmI, 0f, 0f); - } - } - if (dAmulet) - { - for (int n = 0; n < 3; n++) - { - float x = player.position.X + (float)Main.rand.Next(-400, 400); - float y = player.position.Y - (float)Main.rand.Next(500, 800); - Vector2 vector = new Vector2(x, y); - float num13 = player.position.X + (float)(player.width / 2) - vector.X; - float num14 = player.position.Y + (float)(player.height / 2) - vector.Y; - num13 += (float)Main.rand.Next(-100, 101); - int num15 = 29; - float num16 = (float)Math.Sqrt((double)(num13 * num13 + num14 * num14)); - num16 = (float)num15 / num16; - num13 *= num16; - num14 *= num16; - int num17 = Projectile.NewProjectile(x, y, num13, num14, 92, 130, 4f, player.whoAmI, 0f, 0f); - Main.projectile[num17].usesLocalNPCImmunity = true; - Main.projectile[num17].localNPCHitCooldown = 5; - Main.projectile[num17].ranged = false; - } - } - } + if (pArtifact) + { + player.AddBuff(mod.BuffType("BurntOut"), 300, true); + } + if (CalamityGlobalNPC.SCal > -1 && CalamityWorld.revenge) + { + if (damage < 100) + { + KillPlayer(); + string key = "Mods.CalamityMod.SupremeBossText28"; + Color messageColor = Color.Orange; + if (Main.netMode == 0) + { + Main.NewText(Language.GetTextValue(key), messageColor); + } + else if (Main.netMode == 2) + { + NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); + } + } + } + bool hardMode = Main.hardMode; + if (player.whoAmI == Main.myPlayer) + { + if (cTracers && damage > 200) + { + player.immuneTime += 60; + } + if (godSlayerThrowing && damage > 80) + { + player.immuneTime += 30; + } + if (statigelSet && damage > 100) + { + player.immuneTime += 30; + } + if (dAmulet) + { + if (damage == 1.0) + { + player.immuneTime += 10; + } + else + { + player.immuneTime += 20; + } + } + if (fabsolVodka) + { + if (damage == 1.0) + { + player.immuneTime += 5; + } + else + { + player.immuneTime += 10; + } + } + if (damage > 25) + { + if (aeroSet) + { + for (int n = 0; n < 4; n++) + { + float x = player.position.X + (float)Main.rand.Next(-400, 400); + float y = player.position.Y - (float)Main.rand.Next(500, 800); + Vector2 vector = new Vector2(x, y); + float num13 = player.position.X + (float)(player.width / 2) - vector.X; + float num14 = player.position.Y + (float)(player.height / 2) - vector.Y; + num13 += (float)Main.rand.Next(-100, 101); + int num15 = 20; + float num16 = (float)Math.Sqrt((double)(num13 * num13 + num14 * num14)); + num16 = (float)num15 / num16; + num13 *= num16; + num14 *= num16; + int num17 = Projectile.NewProjectile(x, y, num13, num14, mod.ProjectileType("StickyFeatherAero"), 20, 1f, player.whoAmI, 0f, 0f); + } + } + } + if (aBulwark) + { + for (int n = 0; n < 4; n++) + { + float x = player.position.X + (float)Main.rand.Next(-400, 400); + float y = player.position.Y - (float)Main.rand.Next(500, 800); + Vector2 vector = new Vector2(x, y); + float num13 = player.position.X + (float)(player.width / 2) - vector.X; + float num14 = player.position.Y + (float)(player.height / 2) - vector.Y; + num13 += (float)Main.rand.Next(-100, 101); + int num15 = 29; + float num16 = (float)Math.Sqrt((double)(num13 * num13 + num14 * num14)); + num16 = (float)num15 / num16; + num13 *= num16; + num14 *= num16; + int num17 = Projectile.NewProjectile(x, y, num13, num14, mod.ProjectileType("AstralStar"), 320, 5f, player.whoAmI, 0f, 0f); + } + } + if (dAmulet) + { + for (int n = 0; n < 3; n++) + { + float x = player.position.X + (float)Main.rand.Next(-400, 400); + float y = player.position.Y - (float)Main.rand.Next(500, 800); + Vector2 vector = new Vector2(x, y); + float num13 = player.position.X + (float)(player.width / 2) - vector.X; + float num14 = player.position.Y + (float)(player.height / 2) - vector.Y; + num13 += (float)Main.rand.Next(-100, 101); + int num15 = 29; + float num16 = (float)Math.Sqrt((double)(num13 * num13 + num14 * num14)); + num16 = (float)num15 / num16; + num13 *= num16; + num14 *= num16; + int num17 = Projectile.NewProjectile(x, y, num13, num14, 92, 130, 4f, player.whoAmI, 0f, 0f); + Main.projectile[num17].usesLocalNPCImmunity = true; + Main.projectile[num17].localNPCHitCooldown = 5; + Main.projectile[num17].ranged = false; + } + } + } if (fCarapace) { if (damage > 0) @@ -7668,13 +8309,13 @@ namespace CalamityMod int fDamage = 56; if (player.whoAmI == Main.myPlayer) { - for (i = 0; i < 4; i++) + for (i = 0; i < 4; i++) { float xPos = Main.rand.Next(2) == 0 ? player.Center.X + 100 : player.Center.X - 100; - Vector2 vector2 = new Vector2(xPos, player.Center.Y + Main.rand.Next(-100, 101)); + Vector2 vector2 = new Vector2(xPos, player.Center.Y + Main.rand.Next(-100, 101)); offsetAngle = (startAngle + deltaAngle * (i + i * i) / 2f) + 32f * i; int spore1 = Projectile.NewProjectile(vector2.X, vector2.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), 590, fDamage, 1.25f, player.whoAmI, 0f, 0f); - int spore2 = Projectile.NewProjectile(vector2.X, vector2.Y, (float)( -Math.Sin(offsetAngle) * 5f ), (float)( -Math.Cos(offsetAngle) * 5f ), 590, fDamage, 1.25f, player.whoAmI, 0f, 0f); + int spore2 = Projectile.NewProjectile(vector2.X, vector2.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), 590, fDamage, 1.25f, player.whoAmI, 0f, 0f); Main.projectile[spore1].timeLeft = 120; Main.projectile[spore2].timeLeft = 120; } @@ -7694,80 +8335,80 @@ namespace CalamityMod int sDamage = hardMode ? 36 : 6; if (player.whoAmI == Main.myPlayer) { - for (i = 0; i < 4; i++) + for (i = 0; i < 4; i++) { offsetAngle = (startAngle + deltaAngle * (i + i * i) / 2f) + 32f * i; int spark1 = Projectile.NewProjectile(player.Center.X, player.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), mod.ProjectileType("Spark"), sDamage, 1.25f, player.whoAmI, 0f, 0f); - int spark2 = Projectile.NewProjectile(player.Center.X, player.Center.Y, (float)( -Math.Sin(offsetAngle) * 5f ), (float)( -Math.Cos(offsetAngle) * 5f ), mod.ProjectileType("Spark"), sDamage, 1.25f, player.whoAmI, 0f, 0f); + int spark2 = Projectile.NewProjectile(player.Center.X, player.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), mod.ProjectileType("Spark"), sDamage, 1.25f, player.whoAmI, 0f, 0f); Main.projectile[spark1].timeLeft = 120; Main.projectile[spark2].timeLeft = 120; } } } } - if (ataxiaBlaze && Main.rand.Next(5) == 0) - { - if (damage > 0) - { - Main.PlaySound(2, (int)player.position.X, (int)player.position.Y, 74); - int eDamage = 100; - if (player.whoAmI == Main.myPlayer) - { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, 0f, mod.ProjectileType("ChaosBlaze"), eDamage, 1f, player.whoAmI, 0f, 0f); - } - } - } - else if (daedalusShard) - { - if (damage > 0) - { - Main.PlaySound(2, (int)player.position.X, (int)player.position.Y, 27); - float spread = 45f * 0.0174f; - double startAngle = Math.Atan2(player.velocity.X, player.velocity.Y) - spread / 2; - double deltaAngle = spread / 8f; - double offsetAngle; - int i; - int sDamage = 27; - if (player.whoAmI == Main.myPlayer) - { - for (i = 0; i < 8; i++) - { - float randomSpeed = (float)Main.rand.Next(1, 7); - float randomSpeed2 = (float)Main.rand.Next(1, 7); - offsetAngle = (startAngle + deltaAngle * (i + i * i) / 2f) + 32f * i; - int shard = Projectile.NewProjectile(player.Center.X, player.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f) + randomSpeed, 90, sDamage, 1f, player.whoAmI, 0f, 0f); - int shard2 = Projectile.NewProjectile(player.Center.X, player.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f) + randomSpeed2, 90, sDamage, 1f, player.whoAmI, 0f, 0f); - Main.projectile[shard].ranged = false; - Main.projectile[shard2].ranged = false; - } - } - } - } - else if (reaverSpore) - { - if (damage > 0) - { - Main.PlaySound(3, (int)player.position.X, (int)player.position.Y, 1); - float spread = 45f * 0.0174f; - double startAngle = Math.Atan2(player.velocity.X, player.velocity.Y) - spread / 2; - double deltaAngle = spread / 8f; - double offsetAngle; - int i; - int rDamage = 58; - if (player.whoAmI == Main.myPlayer) - { - for (i = 0; i < 4; i++) - { - float xPos = Main.rand.Next(2) == 0 ? player.Center.X + 100 : player.Center.X - 100; - Vector2 vector2 = new Vector2(xPos, player.Center.Y + Main.rand.Next(-100, 101)); - offsetAngle = (startAngle + deltaAngle * (i + i * i) / 2f) + 32f * i; - Projectile.NewProjectile(vector2.X, vector2.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), 567, rDamage, 2f, player.whoAmI, 0f, 0f); - Projectile.NewProjectile(vector2.X, vector2.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), 568, rDamage, 2f, player.whoAmI, 0f, 0f); - } - } - } - } - else if (godSlayerDamage) + if (ataxiaBlaze && Main.rand.Next(5) == 0) + { + if (damage > 0) + { + Main.PlaySound(2, (int)player.position.X, (int)player.position.Y, 74); + int eDamage = 100; + if (player.whoAmI == Main.myPlayer) + { + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, 0f, mod.ProjectileType("ChaosBlaze"), eDamage, 1f, player.whoAmI, 0f, 0f); + } + } + } + else if (daedalusShard) + { + if (damage > 0) + { + Main.PlaySound(2, (int)player.position.X, (int)player.position.Y, 27); + float spread = 45f * 0.0174f; + double startAngle = Math.Atan2(player.velocity.X, player.velocity.Y) - spread / 2; + double deltaAngle = spread / 8f; + double offsetAngle; + int i; + int sDamage = 27; + if (player.whoAmI == Main.myPlayer) + { + for (i = 0; i < 8; i++) + { + float randomSpeed = (float)Main.rand.Next(1, 7); + float randomSpeed2 = (float)Main.rand.Next(1, 7); + offsetAngle = (startAngle + deltaAngle * (i + i * i) / 2f) + 32f * i; + int shard = Projectile.NewProjectile(player.Center.X, player.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f) + randomSpeed, 90, sDamage, 1f, player.whoAmI, 0f, 0f); + int shard2 = Projectile.NewProjectile(player.Center.X, player.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f) + randomSpeed2, 90, sDamage, 1f, player.whoAmI, 0f, 0f); + Main.projectile[shard].ranged = false; + Main.projectile[shard2].ranged = false; + } + } + } + } + else if (reaverSpore) + { + if (damage > 0) + { + Main.PlaySound(3, (int)player.position.X, (int)player.position.Y, 1); + float spread = 45f * 0.0174f; + double startAngle = Math.Atan2(player.velocity.X, player.velocity.Y) - spread / 2; + double deltaAngle = spread / 8f; + double offsetAngle; + int i; + int rDamage = 58; + if (player.whoAmI == Main.myPlayer) + { + for (i = 0; i < 4; i++) + { + float xPos = Main.rand.Next(2) == 0 ? player.Center.X + 100 : player.Center.X - 100; + Vector2 vector2 = new Vector2(xPos, player.Center.Y + Main.rand.Next(-100, 101)); + offsetAngle = (startAngle + deltaAngle * (i + i * i) / 2f) + 32f * i; + Projectile.NewProjectile(vector2.X, vector2.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), 567, rDamage, 2f, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(vector2.X, vector2.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), 568, rDamage, 2f, player.whoAmI, 0f, 0f); + } + } + } + } + else if (godSlayerDamage) { if (damage > 80) { @@ -7779,30 +8420,30 @@ namespace CalamityMod int i; if (player.whoAmI == Main.myPlayer) { - for (i = 0; i < 4; i++) + for (i = 0; i < 4; i++) { offsetAngle = (startAngle + deltaAngle * (i + i * i) / 2f) + 32f * i; Projectile.NewProjectile(player.Center.X, player.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), mod.ProjectileType("GodKiller"), 900, 5f, player.whoAmI, 0f, 0f); - Projectile.NewProjectile(player.Center.X, player.Center.Y, (float)( -Math.Sin(offsetAngle) * 5f ), (float)( -Math.Cos(offsetAngle) * 5f ), mod.ProjectileType("GodKiller"), 900, 5f, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(player.Center.X, player.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), mod.ProjectileType("GodKiller"), 900, 5f, player.whoAmI, 0f, 0f); } } } } - else if (godSlayerMage) - { - if (damage > 0) - { - Main.PlaySound(2, (int)player.position.X, (int)player.position.Y, 74); - if (player.whoAmI == Main.myPlayer) - { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, 0f, mod.ProjectileType("GodSlayerBlaze"), (auricSet ? 2400 : 1200), 1f, player.whoAmI, 0f, 0f); - } - } - } - else if (dsSetBonus) + else if (godSlayerMage) + { + if (damage > 0) + { + Main.PlaySound(2, (int)player.position.X, (int)player.position.Y, 74); + if (player.whoAmI == Main.myPlayer) + { + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, 0f, mod.ProjectileType("GodSlayerBlaze"), (auricSet ? 2400 : 1200), 1f, player.whoAmI, 0f, 0f); + } + } + } + else if (dsSetBonus) { if (player.whoAmI == Main.myPlayer) - { + { for (int l = 0; l < 2; l++) { float x = player.position.X + (float)Main.rand.Next(-400, 400); @@ -7819,7 +8460,7 @@ namespace CalamityMod int num19 = Projectile.NewProjectile(x, y, num15, num16, 294, 3000, 7f, player.whoAmI, 0f, 0f); Main.projectile[num19].ai[1] = player.position.Y; } - for (int l = 0; l < 5; l++) + for (int l = 0; l < 5; l++) { float x = player.position.X + (float)Main.rand.Next(-400, 400); float y = player.position.Y - (float)Main.rand.Next(500, 800); @@ -7838,137 +8479,137 @@ namespace CalamityMod } } } - #endregion + #endregion - #region KillPlayer - public void KillPlayer() - { - player.lastDeathPostion = player.Center; - player.lastDeathTime = DateTime.Now; - player.showLastDeath = true; - bool specialDeath = CalamityWorld.ironHeart && areThereAnyDamnBosses; - bool flag; - int coinsOwned = (int)Utils.CoinsCount(out flag, player.inventory, new int[0]); - if (Main.myPlayer == player.whoAmI) - { - player.lostCoins = coinsOwned; - player.lostCoinString = Main.ValueToCoins(player.lostCoins); - } - if (Main.myPlayer == player.whoAmI) - { - Main.mapFullscreen = false; - } - if (Main.myPlayer == player.whoAmI) - { - player.trashItem.SetDefaults(0, false); - if (specialDeath) - { - player.difficulty = 2; - player.DropItems(); - player.KillMeForGood(); - } - else if (player.difficulty == 0) - { - for (int i = 0; i < 59; i++) - { - if (player.inventory[i].stack > 0 && ((player.inventory[i].type >= 1522 && player.inventory[i].type <= 1527) || player.inventory[i].type == 3643)) - { - int num = Item.NewItem((int)player.position.X, (int)player.position.Y, player.width, player.height, player.inventory[i].type, 1, false, 0, false, false); - Main.item[num].netDefaults(player.inventory[i].netID); - Main.item[num].Prefix((int)player.inventory[i].prefix); - Main.item[num].stack = player.inventory[i].stack; - Main.item[num].velocity.Y = (float)Main.rand.Next(-20, 1) * 0.2f; - Main.item[num].velocity.X = (float)Main.rand.Next(-20, 21) * 0.2f; - Main.item[num].noGrabDelay = 100; - Main.item[num].favorited = false; - Main.item[num].newAndShiny = false; - if (Main.netMode == 1) - { - NetMessage.SendData(21, -1, -1, null, num, 0f, 0f, 0f, 0, 0, 0); - } - player.inventory[i].SetDefaults(0, false); - } - } - } - else if (player.difficulty == 1) - { - player.DropItems(); - } - else if (player.difficulty == 2) - { - player.DropItems(); - player.KillMeForGood(); - } - } - if (specialDeath) - { - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/IronHeartDeath"), (int)player.position.X, (int)player.position.Y); - } - else - { - Main.PlaySound(5, (int)player.position.X, (int)player.position.Y, 1, 1f, 0f); - } - player.headVelocity.Y = (float)Main.rand.Next(-40, -10) * 0.1f; - player.bodyVelocity.Y = (float)Main.rand.Next(-40, -10) * 0.1f; - player.legVelocity.Y = (float)Main.rand.Next(-40, -10) * 0.1f; - player.headVelocity.X = (float)Main.rand.Next(-20, 21) * 0.1f + (float)(2 * 0); - player.bodyVelocity.X = (float)Main.rand.Next(-20, 21) * 0.1f + (float)(2 * 0); - player.legVelocity.X = (float)Main.rand.Next(-20, 21) * 0.1f + (float)(2 * 0); - if (player.stoned) - { - player.headPosition = Vector2.Zero; - player.bodyPosition = Vector2.Zero; - player.legPosition = Vector2.Zero; - } - for (int j = 0; j < 100; j++) - { - Dust.NewDust(player.position, player.width, player.height, (specialDeath ? 91 : 235), (float)(2 * 0), -2f, 0, default(Color), 1f); - } - player.mount.Dismount(player); - player.dead = true; - player.respawnTimer = 600; - if (Main.expertMode) - { - player.respawnTimer = (int)((double)player.respawnTimer * 1.5); - } - player.immuneAlpha = 0; - player.palladiumRegen = false; - player.iceBarrier = false; - player.crystalLeaf = false; - PlayerDeathReason damageSource = PlayerDeathReason.ByOther(player.Male ? 14 : 15); - NetworkText deathText = damageSource.GetDeathText(player.name); - if (Main.netMode == 2) - { - NetMessage.BroadcastChatMessage(deathText, new Color(225, 25, 25), -1); - } - else if (Main.netMode == 0) - { - Main.NewText(deathText.ToString(), 225, 25, 25, false); - } - if (Main.netMode == 1 && player.whoAmI == Main.myPlayer) - { - NetMessage.SendPlayerDeath(player.whoAmI, damageSource, (int)1000.0, 0, false, -1, -1); - } - if (player.whoAmI == Main.myPlayer && player.difficulty == 0) - { - player.DropCoins(); - } - player.DropTombstone(coinsOwned, deathText, 0); - if (player.whoAmI == Main.myPlayer) - { - try - { - WorldGen.saveToonWhilePlaying(); - } - catch - { - } - } - } - #endregion + #region KillPlayer + public void KillPlayer() + { + player.lastDeathPostion = player.Center; + player.lastDeathTime = DateTime.Now; + player.showLastDeath = true; + bool specialDeath = CalamityWorld.ironHeart && areThereAnyDamnBosses; + bool flag; + int coinsOwned = (int)Utils.CoinsCount(out flag, player.inventory, new int[0]); + if (Main.myPlayer == player.whoAmI) + { + player.lostCoins = coinsOwned; + player.lostCoinString = Main.ValueToCoins(player.lostCoins); + } + if (Main.myPlayer == player.whoAmI) + { + Main.mapFullscreen = false; + } + if (Main.myPlayer == player.whoAmI) + { + player.trashItem.SetDefaults(0, false); + if (specialDeath) + { + player.difficulty = 2; + player.DropItems(); + player.KillMeForGood(); + } + else if (player.difficulty == 0) + { + for (int i = 0; i < 59; i++) + { + if (player.inventory[i].stack > 0 && ((player.inventory[i].type >= 1522 && player.inventory[i].type <= 1527) || player.inventory[i].type == 3643)) + { + int num = Item.NewItem((int)player.position.X, (int)player.position.Y, player.width, player.height, player.inventory[i].type, 1, false, 0, false, false); + Main.item[num].netDefaults(player.inventory[i].netID); + Main.item[num].Prefix((int)player.inventory[i].prefix); + Main.item[num].stack = player.inventory[i].stack; + Main.item[num].velocity.Y = (float)Main.rand.Next(-20, 1) * 0.2f; + Main.item[num].velocity.X = (float)Main.rand.Next(-20, 21) * 0.2f; + Main.item[num].noGrabDelay = 100; + Main.item[num].favorited = false; + Main.item[num].newAndShiny = false; + if (Main.netMode == 1) + { + NetMessage.SendData(21, -1, -1, null, num, 0f, 0f, 0f, 0, 0, 0); + } + player.inventory[i].SetDefaults(0, false); + } + } + } + else if (player.difficulty == 1) + { + player.DropItems(); + } + else if (player.difficulty == 2) + { + player.DropItems(); + player.KillMeForGood(); + } + } + if (specialDeath) + { + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/IronHeartDeath"), (int)player.position.X, (int)player.position.Y); + } + else + { + Main.PlaySound(5, (int)player.position.X, (int)player.position.Y, 1, 1f, 0f); + } + player.headVelocity.Y = (float)Main.rand.Next(-40, -10) * 0.1f; + player.bodyVelocity.Y = (float)Main.rand.Next(-40, -10) * 0.1f; + player.legVelocity.Y = (float)Main.rand.Next(-40, -10) * 0.1f; + player.headVelocity.X = (float)Main.rand.Next(-20, 21) * 0.1f + (float)(2 * 0); + player.bodyVelocity.X = (float)Main.rand.Next(-20, 21) * 0.1f + (float)(2 * 0); + player.legVelocity.X = (float)Main.rand.Next(-20, 21) * 0.1f + (float)(2 * 0); + if (player.stoned) + { + player.headPosition = Vector2.Zero; + player.bodyPosition = Vector2.Zero; + player.legPosition = Vector2.Zero; + } + for (int j = 0; j < 100; j++) + { + Dust.NewDust(player.position, player.width, player.height, (specialDeath ? 91 : 235), (float)(2 * 0), -2f, 0, default(Color), 1f); + } + player.mount.Dismount(player); + player.dead = true; + player.respawnTimer = 600; + if (Main.expertMode) + { + player.respawnTimer = (int)((double)player.respawnTimer * 1.5); + } + player.immuneAlpha = 0; + player.palladiumRegen = false; + player.iceBarrier = false; + player.crystalLeaf = false; + PlayerDeathReason damageSource = PlayerDeathReason.ByOther(player.Male ? 14 : 15); + NetworkText deathText = damageSource.GetDeathText(player.name); + if (Main.netMode == 2) + { + NetMessage.BroadcastChatMessage(deathText, new Color(225, 25, 25), -1); + } + else if (Main.netMode == 0) + { + Main.NewText(deathText.ToString(), 225, 25, 25, false); + } + if (Main.netMode == 1 && player.whoAmI == Main.myPlayer) + { + NetMessage.SendPlayerDeath(player.whoAmI, damageSource, (int)1000.0, 0, false, -1, -1); + } + if (player.whoAmI == Main.myPlayer && player.difficulty == 0) + { + player.DropCoins(); + } + player.DropTombstone(coinsOwned, deathText, 0); + if (player.whoAmI == Main.myPlayer) + { + try + { + WorldGen.saveToonWhilePlaying(); + } + catch + { + } + } + } + #endregion - #region DashStuff - public void ModDashMovement() + #region DashStuff + public void ModDashMovement() { if (dashMod == 4 && player.dashDelay < 0 && player.whoAmI == Main.myPlayer) { @@ -8013,8 +8654,8 @@ namespace CalamityMod Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, 0f, mod.ProjectileType("HolyEruption"), 780, 5f, Main.myPlayer, 0f, 0f); } nPC.immune[player.whoAmI] = 6; - nPC.AddBuff(mod.BuffType("GodSlayerInferno"), 300); - player.immune = true; + nPC.AddBuff(mod.BuffType("GodSlayerInferno"), 300); + player.immune = true; player.immuneNoBlink = true; player.immuneTime = 4; } @@ -8123,33 +8764,33 @@ namespace CalamityMod if (dashMod == 1 && player.dashDelay < 0 && player.whoAmI == Main.myPlayer) { Rectangle rectangle = new Rectangle((int)((double)player.position.X + (double)player.velocity.X * 0.5 - 4.0), (int)((double)player.position.Y + (double)player.velocity.Y * 0.5 - 4.0), player.width + 8, player.height + 8); - for (int i = 0; i < 200; i++) - { - if ((Main.npc[i].active && !Main.npc[i].dontTakeDamage && !Main.npc[i].friendly && !Main.npc[i].townNPC && Main.npc[i].immune[player.whoAmI] <= 0 && Main.npc[i].damage > 0)) - { - NPC nPC = Main.npc[i]; - Rectangle rect = nPC.getRect(); - if (rectangle.Intersects(rect) && (nPC.noTileCollide || player.CanHit(nPC))) - { - OnDodge(); - break; - } - } - } - for (int i = 0; i < 1000; i++) - { - if ((Main.projectile[i].active && !Main.projectile[i].friendly && Main.projectile[i].hostile && Main.projectile[i].damage > 0)) - { - Projectile proj = Main.projectile[i]; - Rectangle rect = proj.getRect(); - if (rectangle.Intersects(rect)) - { - OnDodge(); - break; - } - } - } - } + for (int i = 0; i < 200; i++) + { + if ((Main.npc[i].active && !Main.npc[i].dontTakeDamage && !Main.npc[i].friendly && !Main.npc[i].townNPC && Main.npc[i].immune[player.whoAmI] <= 0 && Main.npc[i].damage > 0)) + { + NPC nPC = Main.npc[i]; + Rectangle rect = nPC.getRect(); + if (rectangle.Intersects(rect) && (nPC.noTileCollide || player.CanHit(nPC))) + { + OnDodge(); + break; + } + } + } + for (int i = 0; i < 1000; i++) + { + if ((Main.projectile[i].active && !Main.projectile[i].friendly && Main.projectile[i].hostile && Main.projectile[i].damage > 0)) + { + Projectile proj = Main.projectile[i]; + Rectangle rect = proj.getRect(); + if (rectangle.Intersects(rect)) + { + OnDodge(); + break; + } + } + } + } if (player.dashDelay > 0) { return; @@ -8208,8 +8849,8 @@ namespace CalamityMod Main.dust[num14].fadeIn = 0.5f; } } - num7 = 14f; //14 - } + num7 = 14f; //14 + } else if (dashMod == 4) { for (int m = 0; m < 24; m++) @@ -8224,8 +8865,8 @@ namespace CalamityMod Main.dust[num14].fadeIn = 0.5f; } } - num7 = 16f; //14 - } + num7 = 16f; //14 + } if (dashMod > 0) { player.vortexStealthActive = false; @@ -8508,51 +9149,51 @@ namespace CalamityMod } } - private void OnDodge() - { - if (player.whoAmI == Main.myPlayer && dodgeScarf && !scarfCooldown) - { - player.AddBuff(mod.BuffType("ScarfMeleeBoost"), Main.rand.Next(480, 561)); - player.AddBuff(mod.BuffType("ScarfCooldown"), (player.chaosState ? 1800 : 900)); - player.immune = true; - player.immuneTime = 60; - if (player.longInvince) - { - player.immuneTime += 40; - } - for (int k = 0; k < player.hurtCooldowns.Length; k++) - { - player.hurtCooldowns[k] = player.immuneTime; - } - for (int j = 0; j < 100; j++) - { - int num = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, 235, 0f, 0f, 100, default(Color), 2f); - Dust expr_A4_cp_0 = Main.dust[num]; - expr_A4_cp_0.position.X = expr_A4_cp_0.position.X + (float)Main.rand.Next(-20, 21); - Dust expr_CB_cp_0 = Main.dust[num]; - expr_CB_cp_0.position.Y = expr_CB_cp_0.position.Y + (float)Main.rand.Next(-20, 21); - Main.dust[num].velocity *= 0.4f; - Main.dust[num].scale *= 1f + (float)Main.rand.Next(40) * 0.01f; - Main.dust[num].shader = GameShaders.Armor.GetSecondaryShader(player.cWaist, player); - if (Main.rand.Next(2) == 0) - { - Main.dust[num].scale *= 1f + (float)Main.rand.Next(40) * 0.01f; - Main.dust[num].noGravity = true; - } - } - if (player.whoAmI == Main.myPlayer) - { - NetMessage.SendData(62, -1, -1, null, player.whoAmI, 1f, 0f, 0f, 0, 0, 0); - } - } - } + private void OnDodge() + { + if (player.whoAmI == Main.myPlayer && dodgeScarf && !scarfCooldown) + { + player.AddBuff(mod.BuffType("ScarfMeleeBoost"), Main.rand.Next(480, 561)); + player.AddBuff(mod.BuffType("ScarfCooldown"), (player.chaosState ? 1800 : 900)); + player.immune = true; + player.immuneTime = 60; + if (player.longInvince) + { + player.immuneTime += 40; + } + for (int k = 0; k < player.hurtCooldowns.Length; k++) + { + player.hurtCooldowns[k] = player.immuneTime; + } + for (int j = 0; j < 100; j++) + { + int num = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, 235, 0f, 0f, 100, default(Color), 2f); + Dust expr_A4_cp_0 = Main.dust[num]; + expr_A4_cp_0.position.X = expr_A4_cp_0.position.X + (float)Main.rand.Next(-20, 21); + Dust expr_CB_cp_0 = Main.dust[num]; + expr_CB_cp_0.position.Y = expr_CB_cp_0.position.Y + (float)Main.rand.Next(-20, 21); + Main.dust[num].velocity *= 0.4f; + Main.dust[num].scale *= 1f + (float)Main.rand.Next(40) * 0.01f; + Main.dust[num].shader = GameShaders.Armor.GetSecondaryShader(player.cWaist, player); + if (Main.rand.Next(2) == 0) + { + Main.dust[num].scale *= 1f + (float)Main.rand.Next(40) * 0.01f; + Main.dust[num].noGravity = true; + } + } + if (player.whoAmI == Main.myPlayer) + { + NetMessage.SendData(62, -1, -1, null, player.whoAmI, 1f, 0f, 0f, 0, 0, 0); + } + } + } - public void ModHorizontalMovement() + public void ModHorizontalMovement() { float num = (player.accRunSpeed + player.maxRunSpeed) / 2f; if (player.controlLeft && player.velocity.X > -player.accRunSpeed && player.dashDelay >= 0) { - if (player.velocity.X < -num && player.velocity.Y == 0f && !player.mount.Active) + if (player.velocity.X < -num && player.velocity.Y == 0f && !player.mount.Active) { int num3 = 0; if (player.gravDir == -1f) @@ -8591,7 +9232,7 @@ namespace CalamityMod } else if (player.controlRight && player.velocity.X < player.accRunSpeed && player.dashDelay >= 0) { - if (player.velocity.X > num && player.velocity.Y == 0f && !player.mount.Active) + if (player.velocity.X > num && player.velocity.Y == 0f && !player.mount.Active) { int num8 = 0; if (player.gravDir == -1f) @@ -8629,122 +9270,282 @@ namespace CalamityMod } } } - #endregion + #endregion - #region Drawing - public static readonly PlayerLayer MiscEffectsBack = new PlayerLayer("CalamityMod", "MiscEffectsBack", PlayerLayer.MiscEffectsBack, delegate (PlayerDrawInfo drawInfo) - { - if (drawInfo.shadow != 0f) - { - return; - } - Player drawPlayer = drawInfo.drawPlayer; - Mod mod = ModLoader.GetMod("CalamityMod"); - CalamityPlayer modPlayer = drawPlayer.GetModPlayer(mod); - if (modPlayer.sirenIce) - { - Texture2D texture = mod.GetTexture("ExtraTextures/IceShield"); - int drawX = (int)(drawInfo.position.X + drawPlayer.width / 2f - Main.screenPosition.X); - int drawY = (int)(drawInfo.position.Y + drawPlayer.height / 2f - Main.screenPosition.Y); //4 - DrawData data = new DrawData(texture, new Vector2(drawX, drawY), null, Color.Cyan, 0f, new Vector2(texture.Width / 2f, texture.Height / 2f), 1f, SpriteEffects.None, 0); - Main.playerDrawData.Add(data); - } - }); - - public override void ModifyDrawLayers(List list) - { - MiscEffectsBack.visible = true; - list.Insert(0, MiscEffectsBack); - if (fab) { AddPlayerLayer(list, clAfterAll, list[list.Count - 1], false); } - } - - public PlayerLayer clAfterAll = new PlayerLayer("Calamity", "clAfterAll", PlayerLayer.MiscEffectsFront, delegate (PlayerDrawInfo edi) - { - Mod mod = ModLoader.GetMod("CalamityMod"); - Player drawPlayer = edi.drawPlayer; - if (drawPlayer.mount != null && drawPlayer.GetModPlayer(mod).fab) { drawPlayer.mount.Draw(Main.playerDrawData, 3, drawPlayer, edi.position, edi.mountColor, edi.spriteEffects, edi.shadow); } - }); - - public static void AddPlayerLayer(List list, PlayerLayer layer, PlayerLayer parent, bool first) - { - int insertAt = -1; - for (int m = 0; m < list.Count; m++) - { - PlayerLayer dl = list[m]; - if (dl.Name.Equals(parent.Name)) { insertAt = m; break; } - } - if (insertAt == -1) list.Add(layer); else list.Insert(first ? insertAt : insertAt + 1, layer); - } - - public override void DrawEffects(PlayerDrawInfo drawInfo, ref float r, ref float g, ref float b, ref float a, ref bool fullBright) + #region Drawing + public static readonly PlayerLayer MiscEffectsBack = new PlayerLayer("CalamityMod", "MiscEffectsBack", PlayerLayer.MiscEffectsBack, delegate (PlayerDrawInfo drawInfo) { - if (CalamityWorld.ironHeart && !Main.gameMenu) - { - Texture2D ironHeart = mod.GetTexture("ExtraTextures/IronHeart"); - Main.heartTexture = Main.heart2Texture = ironHeart; - } - else - { - Texture2D heart3 = mod.GetTexture("ExtraTextures/Heart3"); - Texture2D heart4 = mod.GetTexture("ExtraTextures/Heart4"); - Texture2D heart5 = mod.GetTexture("ExtraTextures/Heart5"); - Texture2D heart6 = mod.GetTexture("ExtraTextures/Heart6"); - Texture2D heartOriginal = mod.GetTexture("ExtraTextures/HeartOriginal"); - Texture2D heartOriginal2 = mod.GetTexture("ExtraTextures/HeartOriginal2"); - - int totalFruit = - (mFruit ? 1 : 0) + - (bOrange ? 1 : 0) + - (eBerry ? 1 : 0) + - (dFruit ? 1 : 0); - switch (totalFruit) - { - default: - Main.heart2Texture = heartOriginal; Main.heartTexture = heartOriginal2; - break; - case 4: - Main.heart2Texture = heart6; Main.heartTexture = heartOriginal2; - break; - case 3: - Main.heart2Texture = heart5; Main.heartTexture = heartOriginal2; - break; - case 2: - Main.heart2Texture = heart4; Main.heartTexture = heartOriginal2; - break; - case 1: - Main.heart2Texture = heart3; Main.heartTexture = heartOriginal2; - break; - } - } - if (revivifyTimer > 0) - { - if (Main.rand.Next(2) == 0 && drawInfo.shadow == 0f) - { - int dust = Dust.NewDust(drawInfo.position - new Vector2(2f, 2f), player.width + 4, player.height + 4, 91, player.velocity.X * 0.2f, player.velocity.Y * 0.2f, 100, default(Color), 1f); - Main.dust[dust].noGravity = true; - Main.dust[dust].velocity.Y -= 0.5f; - Main.playerDrawDust.Add(dust); - } - } - if (tRegen) + if (drawInfo.shadow != 0f) { - if (Main.rand.Next(10) == 0 && drawInfo.shadow == 0f) - { - int dust = Dust.NewDust(drawInfo.position - new Vector2(2f, 2f), player.width + 4, player.height + 4, 107, player.velocity.X * 0.4f, player.velocity.Y * 0.4f, 100, default(Color), 1f); - Main.dust[dust].noGravity = true; - Main.dust[dust].velocity *= 0.75f; - Main.dust[dust].velocity.Y -= 0.35f; - Main.playerDrawDust.Add(dust); - } - r *= 0.025f; - g *= 0.15f; - b *= 0.035f; - fullBright = true; + return; + } + Player drawPlayer = drawInfo.drawPlayer; + Mod mod = ModLoader.GetMod("CalamityMod"); + CalamityPlayer modPlayer = drawPlayer.GetModPlayer(mod); + if (modPlayer.sirenIce) + { + Texture2D texture = mod.GetTexture("ExtraTextures/IceShield"); + int drawX = (int)(drawInfo.position.X + drawPlayer.width / 2f - Main.screenPosition.X); + int drawY = (int)(drawInfo.position.Y + drawPlayer.height / 2f - Main.screenPosition.Y); //4 + DrawData data = new DrawData(texture, new Vector2(drawX, drawY), null, Color.Cyan, 0f, new Vector2(texture.Width / 2f, texture.Height / 2f), 1f, SpriteEffects.None, 0); + Main.playerDrawData.Add(data); + } + if (modPlayer.amidiasBlessing) + { + Texture2D texture = mod.GetTexture("ExtraTextures/AmidiasBubble"); + int drawX = (int)(drawInfo.position.X + drawPlayer.width / 2f - Main.screenPosition.X); + int drawY = (int)(drawInfo.position.Y + drawPlayer.height / 2f - Main.screenPosition.Y); //4 + DrawData data = new DrawData(texture, new Vector2(drawX, drawY), null, Color.White, 0f, new Vector2(texture.Width / 2f, texture.Height / 2f), 1f, SpriteEffects.None, 0); + Main.playerDrawData.Add(data); + } + }); + + public static readonly PlayerLayer MiscEffects = new PlayerLayer("CalamityMod", "MiscEffects", PlayerLayer.MiscEffectsFront, delegate (PlayerDrawInfo drawInfo) + { + if (drawInfo.shadow != 0f) + { + return; + } + Player drawPlayer = drawInfo.drawPlayer; + Mod mod = ModLoader.GetMod("CalamityMod"); + Item item = drawPlayer.inventory[drawPlayer.selectedItem]; + if (!drawPlayer.frozen && + ((drawPlayer.itemAnimation > 0 && item.useStyle != 0) || (item.holdStyle > 0 && !drawPlayer.pulley)) && + item.type > 0 && + !drawPlayer.dead && + !item.noUseGraphic && + (!drawPlayer.wet || !item.noWet)) + { + Vector2 vector = drawPlayer.position + (drawPlayer.itemLocation - drawPlayer.position); + SpriteEffects effect = SpriteEffects.FlipHorizontally; + if (drawPlayer.gravDir == 1f) + { + if (drawPlayer.direction == 1) + { + effect = SpriteEffects.None; + } + else + { + effect = SpriteEffects.FlipHorizontally; + } + } + else + { + if (drawPlayer.direction == 1) + { + effect = SpriteEffects.FlipVertically; + } + else + { + effect = (SpriteEffects.FlipHorizontally | SpriteEffects.FlipVertically); + } + } + if (item.type == mod.ItemType("DeathhailStaff")) + { + Texture2D texture = mod.GetTexture("Items/Weapons/DevourerofGods/DeathhailStaffGlow"); + float num104 = drawPlayer.itemRotation + 0.785f * (float)drawPlayer.direction; + int num105 = 0; + int num106 = 0; + Vector2 zero3 = new Vector2(0f, (float)Main.itemTexture[item.type].Height); + if (drawPlayer.gravDir == -1f) + { + if (drawPlayer.direction == -1) + { + num104 += 1.57f; + zero3 = new Vector2((float)Main.itemTexture[item.type].Width, 0f); + num105 -= Main.itemTexture[item.type].Width; + } + else + { + num104 -= 1.57f; + zero3 = Vector2.Zero; + } + } + else if (drawPlayer.direction == -1) + { + zero3 = new Vector2((float)Main.itemTexture[item.type].Width, (float)Main.itemTexture[item.type].Height); + num105 -= Main.itemTexture[item.type].Width; + } + DrawData data = new DrawData(texture, + new Vector2((float)((int)(vector.X - Main.screenPosition.X + zero3.X + (float)num105)), (float)((int)(vector.Y - Main.screenPosition.Y + (float)num106))), + new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.itemTexture[item.type].Width, Main.itemTexture[item.type].Height)), + Color.White, + num104, + zero3, + item.scale, + effect, + 0); + Main.playerDrawData.Add(data); + } + else if (item.type == mod.ItemType("Deathwind")) + { + Texture2D texture = mod.GetTexture("Items/Weapons/DevourerofGods/DeathwindGlow"); + Vector2 vector13 = new Vector2((float)(Main.itemTexture[item.type].Width / 2), (float)(Main.itemTexture[item.type].Height / 2)); + Vector2 vector14 = new Vector2((float)(Main.itemTexture[item.type].Width / 2), (float)(Main.itemTexture[item.type].Height / 2)); + int num107 = (int)vector14.X; + vector13.Y = vector14.Y; + Vector2 origin4 = new Vector2((float)(-(float)num107), (float)(Main.itemTexture[item.type].Height / 2)); + if (drawPlayer.direction == -1) + { + origin4 = new Vector2((float)(Main.itemTexture[item.type].Width + num107), (float)(Main.itemTexture[item.type].Height / 2)); + } + DrawData data = new DrawData(texture, + new Vector2((float)((int)(vector.X - Main.screenPosition.X + vector13.X)), (float)((int)(vector.Y - Main.screenPosition.Y + vector13.Y))), + new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.itemTexture[item.type].Width, Main.itemTexture[item.type].Height)), + Color.White, + drawPlayer.itemRotation, + origin4, + item.scale, + effect, + 0); + Main.playerDrawData.Add(data); + } + else if (item.type == mod.ItemType("Excelsus")) + { + Vector2 zero2 = Vector2.Zero; + Texture2D texture = mod.GetTexture("Items/Weapons/DevourerofGods/ExcelsusGlow"); + if (drawPlayer.gravDir == -1f) + { + DrawData data = new DrawData(texture, + new Vector2((float)((int)(vector.X - Main.screenPosition.X)), (float)((int)(vector.Y - Main.screenPosition.Y))), + new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.itemTexture[item.type].Width, Main.itemTexture[item.type].Height)), + Color.White, + drawPlayer.itemRotation, + new Vector2((float)Main.itemTexture[item.type].Width * 0.5f - (float)Main.itemTexture[item.type].Width * 0.5f * (float)drawPlayer.direction, 0f) + zero2, + item.scale, + effect, + 0); + Main.playerDrawData.Add(data); + } + else + { + DrawData data = new DrawData(texture, + new Vector2((float)((int)(vector.X - Main.screenPosition.X)), (float)((int)(vector.Y - Main.screenPosition.Y))), + new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.itemTexture[item.type].Width, Main.itemTexture[item.type].Height)), + Color.White, + drawPlayer.itemRotation, + new Vector2((float)Main.itemTexture[item.type].Width * 0.5f - (float)Main.itemTexture[item.type].Width * 0.5f * (float)drawPlayer.direction, (float)Main.itemTexture[item.type].Height) + zero2, + item.scale, + effect, + 0); + Main.playerDrawData.Add(data); + } + } + } + }); + + public override void ModifyDrawLayers(List list) + { + MiscEffectsBack.visible = true; + list.Insert(0, MiscEffectsBack); + MiscEffects.visible = true; + list.Add(MiscEffects); + if (fab) { AddPlayerLayer(list, clAfterAll, list[list.Count - 1], false); } + } + + public PlayerLayer clAfterAll = new PlayerLayer("Calamity", "clAfterAll", PlayerLayer.MiscEffectsFront, delegate (PlayerDrawInfo edi) + { + Mod mod = ModLoader.GetMod("CalamityMod"); + Player drawPlayer = edi.drawPlayer; + if (drawPlayer.mount != null && drawPlayer.GetModPlayer(mod).fab) { drawPlayer.mount.Draw(Main.playerDrawData, 3, drawPlayer, edi.position, edi.mountColor, edi.spriteEffects, edi.shadow); } + }); + + public static void AddPlayerLayer(List list, PlayerLayer layer, PlayerLayer parent, bool first) + { + int insertAt = -1; + for (int m = 0; m < list.Count; m++) + { + PlayerLayer dl = list[m]; + if (dl.Name.Equals(parent.Name)) { insertAt = m; break; } + } + if (insertAt == -1) list.Add(layer); else list.Insert(first ? insertAt : insertAt + 1, layer); + } + + public override void DrawEffects(PlayerDrawInfo drawInfo, ref float r, ref float g, ref float b, ref float a, ref bool fullBright) + { + bool noRogueStealth = rogueStealth == 0f || player.townNPCs > 2f; + if (rogueStealth > 0f && rogueStealthMax > 0f && player.townNPCs < 3f) + { + //A translucent orchid color, the rogue class color + float colorValue = (rogueStealth / rogueStealthMax) * 0.9f; //0 to 0.9 + r *= 1f - (colorValue * 0.89f); //255 to 50 + g *= 1f - colorValue; //255 to 25 + b *= 1f - (colorValue * 0.89f); //255 to 50 + a *= 1f - colorValue; //255 to 25 + player.armorEffectDrawOutlines = false; + player.armorEffectDrawShadow = false; + player.armorEffectDrawShadowSubtle = false; + } + if (CalamityWorld.ironHeart && !Main.gameMenu) + { + Texture2D ironHeart = mod.GetTexture("ExtraTextures/IronHeart"); + Main.heartTexture = Main.heart2Texture = ironHeart; + } + else + { + Texture2D heart3 = mod.GetTexture("ExtraTextures/Heart3"); + Texture2D heart4 = mod.GetTexture("ExtraTextures/Heart4"); + Texture2D heart5 = mod.GetTexture("ExtraTextures/Heart5"); + Texture2D heart6 = mod.GetTexture("ExtraTextures/Heart6"); + Texture2D heartOriginal = mod.GetTexture("ExtraTextures/HeartOriginal"); + Texture2D heartOriginal2 = mod.GetTexture("ExtraTextures/HeartOriginal2"); + + int totalFruit = + (mFruit ? 1 : 0) + + (bOrange ? 1 : 0) + + (eBerry ? 1 : 0) + + (dFruit ? 1 : 0); + switch (totalFruit) + { + default: + Main.heart2Texture = heartOriginal; Main.heartTexture = heartOriginal2; + break; + case 4: + Main.heart2Texture = heart6; Main.heartTexture = heartOriginal2; + break; + case 3: + Main.heart2Texture = heart5; Main.heartTexture = heartOriginal2; + break; + case 2: + Main.heart2Texture = heart4; Main.heartTexture = heartOriginal2; + break; + case 1: + Main.heart2Texture = heart3; Main.heartTexture = heartOriginal2; + break; + } + } + if (revivifyTimer > 0) + { + if (Main.rand.Next(2) == 0 && drawInfo.shadow == 0f) + { + int dust = Dust.NewDust(drawInfo.position - new Vector2(2f, 2f), player.width + 4, player.height + 4, 91, player.velocity.X * 0.2f, player.velocity.Y * 0.2f, 100, default(Color), 1f); + Main.dust[dust].noGravity = true; + Main.dust[dust].velocity.Y -= 0.5f; + Main.playerDrawDust.Add(dust); + } + } + if (tRegen) + { + if (Main.rand.Next(10) == 0 && drawInfo.shadow == 0f) + { + int dust = Dust.NewDust(drawInfo.position - new Vector2(2f, 2f), player.width + 4, player.height + 4, 107, player.velocity.X * 0.4f, player.velocity.Y * 0.4f, 100, default(Color), 1f); + Main.dust[dust].noGravity = true; + Main.dust[dust].velocity *= 0.75f; + Main.dust[dust].velocity.Y -= 0.35f; + Main.playerDrawDust.Add(dust); + } + if (noRogueStealth) + { + r *= 0.025f; + g *= 0.15f; + b *= 0.035f; + fullBright = true; + } } if (IBoots) { if (((double)Math.Abs(player.velocity.X) > 0.05 || (double)Math.Abs(player.velocity.Y) > 0.05) && !player.mount.Active) - { + { if (Main.rand.Next(2) == 0 && drawInfo.shadow == 0f) { int dust = Dust.NewDust(drawInfo.position - new Vector2(2f, 2f), player.width + 4, player.height + 4, 229, player.velocity.X * 0.4f, player.velocity.Y * 0.4f, 100, default(Color), 1f); @@ -8752,16 +9553,19 @@ namespace CalamityMod Main.dust[dust].velocity *= 0.5f; Main.playerDrawDust.Add(dust); } - r *= 0.05f; - g *= 0.05f; - b *= 0.05f; - fullBright = true; + if (noRogueStealth) + { + r *= 0.05f; + g *= 0.05f; + b *= 0.05f; + fullBright = true; + } } } if (elysianFire) { if (((double)Math.Abs(player.velocity.X) > 0.05 || (double)Math.Abs(player.velocity.Y) > 0.05) && !player.mount.Active) - { + { if (Main.rand.Next(2) == 0 && drawInfo.shadow == 0f) { int dust = Dust.NewDust(drawInfo.position - new Vector2(2f, 2f), player.width + 4, player.height + 4, 246, player.velocity.X * 0.4f, player.velocity.Y * 0.4f, 100, default(Color), 1f); @@ -8769,16 +9573,19 @@ namespace CalamityMod Main.dust[dust].velocity *= 0.5f; Main.playerDrawDust.Add(dust); } - r *= 0.75f; - g *= 0.55f; - b *= 0f; - fullBright = true; + if (noRogueStealth) + { + r *= 0.75f; + g *= 0.55f; + b *= 0f; + fullBright = true; + } } } if (dsSetBonus) { if (((double)Math.Abs(player.velocity.X) > 0.05 || (double)Math.Abs(player.velocity.Y) > 0.05) && !player.mount.Active) - { + { if (Main.rand.Next(2) == 0 && drawInfo.shadow == 0f) { int dust = Dust.NewDust(drawInfo.position - new Vector2(2f, 2f), player.width + 4, player.height + 4, 27, player.velocity.X * 0.4f, player.velocity.Y * 0.4f, 100, default(Color), 1.5f); @@ -8786,16 +9593,19 @@ namespace CalamityMod Main.dust[dust].velocity *= 0.5f; Main.playerDrawDust.Add(dust); } - r *= 0.15f; - g *= 0.025f; - b *= 0.1f; - fullBright = true; + if (noRogueStealth) + { + r *= 0.15f; + g *= 0.025f; + b *= 0.1f; + fullBright = true; + } } } if (auricSet) { if (((double)Math.Abs(player.velocity.X) > 0.05 || (double)Math.Abs(player.velocity.Y) > 0.05) && !player.mount.Active) - { + { if (drawInfo.shadow == 0f) { int dust = Dust.NewDust(drawInfo.position - new Vector2(2f, 2f), player.width + 4, player.height + 4, Main.rand.Next(2) == 0 ? 57 : 244, player.velocity.X * 0.4f, player.velocity.Y * 0.4f, 100, default(Color), 1.5f); @@ -8803,10 +9613,13 @@ namespace CalamityMod Main.dust[dust].velocity *= 0.5f; Main.playerDrawDust.Add(dust); } - r *= 0.15f; - g *= 0.025f; - b *= 0.1f; - fullBright = true; + if (noRogueStealth) + { + r *= 0.15f; + g *= 0.025f; + b *= 0.1f; + fullBright = true; + } } } if (bFlames || aFlames || rageMode) @@ -8819,26 +9632,32 @@ namespace CalamityMod Main.dust[dust].velocity.Y -= 0.5f; Main.playerDrawDust.Add(dust); } - r *= 0.25f; - g *= 0.01f; - b *= 0.01f; - fullBright = true; + if (noRogueStealth) + { + r *= 0.25f; + g *= 0.01f; + b *= 0.01f; + fullBright = true; + } } - if (adrenalineMode) - { - if (Main.rand.Next(4) == 0 && drawInfo.shadow == 0f) - { - int dust = Dust.NewDust(drawInfo.position - new Vector2(2f, 2f), player.width + 4, player.height + 4, 206, player.velocity.X * 0.4f, player.velocity.Y * 0.4f, 100, default(Color), 3f); - Main.dust[dust].velocity *= 1.8f; - Main.dust[dust].velocity.Y -= 0.5f; - Main.playerDrawDust.Add(dust); - } - r *= 0.01f; - g *= 0.15f; - b *= 0.1f; - fullBright = true; - } - if (gsInferno) + if (adrenalineMode) + { + if (Main.rand.Next(4) == 0 && drawInfo.shadow == 0f) + { + int dust = Dust.NewDust(drawInfo.position - new Vector2(2f, 2f), player.width + 4, player.height + 4, 206, player.velocity.X * 0.4f, player.velocity.Y * 0.4f, 100, default(Color), 3f); + Main.dust[dust].velocity *= 1.8f; + Main.dust[dust].velocity.Y -= 0.5f; + Main.playerDrawDust.Add(dust); + } + if (noRogueStealth) + { + r *= 0.01f; + g *= 0.15f; + b *= 0.1f; + fullBright = true; + } + } + if (gsInferno) { if (Main.rand.Next(4) == 0 && drawInfo.shadow == 0f) { @@ -8848,10 +9667,13 @@ namespace CalamityMod Main.dust[dust].velocity.Y -= 0.5f; Main.playerDrawDust.Add(dust); } - r *= 0.25f; - g *= 0.01f; - b *= 0.01f; - fullBright = true; + if (noRogueStealth) + { + r *= 0.25f; + g *= 0.01f; + b *= 0.01f; + fullBright = true; + } } if (hFlames || hInferno) { @@ -8863,10 +9685,13 @@ namespace CalamityMod Main.dust[dust].velocity.Y -= 0.5f; Main.playerDrawDust.Add(dust); } - r *= 0.25f; - g *= 0.25f; - b *= 0.1f; - fullBright = true; + if (noRogueStealth) + { + r *= 0.25f; + g *= 0.25f; + b *= 0.1f; + fullBright = true; + } } if (pFlames) { @@ -8878,26 +9703,35 @@ namespace CalamityMod Main.dust[dust].velocity.Y -= 0.15f; Main.playerDrawDust.Add(dust); } - r *= 0.07f; - g *= 0.15f; - b *= 0.01f; - fullBright = true; + if (noRogueStealth) + { + r *= 0.07f; + g *= 0.15f; + b *= 0.01f; + fullBright = true; + } } if (gState || cDepth) { - r *= 0f; - g *= 0.05f; - b *= 0.3f; - fullBright = true; + if (noRogueStealth) + { + r *= 0f; + g *= 0.05f; + b *= 0.3f; + fullBright = true; + } } - if (draedonsHeart && !shadeRegen && !cFreeze && (double)Math.Abs(player.velocity.X) < 0.05 && (double)Math.Abs(player.velocity.Y) < 0.05 && player.itemAnimation == 0) - { - r *= 0f; - g *= 0.5f; - b *= 0f; - fullBright = true; - } - if (bBlood) + if (draedonsHeart && !shadeRegen && !cFreeze && (double)Math.Abs(player.velocity.X) < 0.05 && (double)Math.Abs(player.velocity.Y) < 0.05 && player.itemAnimation == 0) + { + if (noRogueStealth) + { + r *= 0f; + g *= 0.5f; + b *= 0f; + fullBright = true; + } + } + if (bBlood) { if (Main.rand.Next(6) == 0 && drawInfo.shadow == 0f) { @@ -8907,10 +9741,13 @@ namespace CalamityMod Main.dust[dust].velocity.Y -= 0.5f; Main.playerDrawDust.Add(dust); } - r *= 0.15f; - g *= 0.01f; - b *= 0.01f; - fullBright = true; + if (noRogueStealth) + { + r *= 0.15f; + g *= 0.01f; + b *= 0.01f; + fullBright = true; + } } if (mushy) { @@ -8922,217 +9759,220 @@ namespace CalamityMod Main.dust[dust].velocity.Y -= 0.1f; Main.playerDrawDust.Add(dust); } - r *= 0.15f; - g *= 0.01f; - b *= 0.01f; - fullBright = true; + if (noRogueStealth) + { + r *= 0.15f; + g *= 0.01f; + b *= 0.01f; + fullBright = true; + } } } - #endregion + #endregion - #region PacketStuff - private void ExactLevelPacket(bool server, int levelType) - { - ModPacket packet = mod.GetPacket(256); - switch (levelType) - { - case 0: - packet.Write((byte)CalamityModMessageType.ExactMeleeLevelSync); - packet.Write(player.whoAmI); - packet.Write(exactMeleeLevel); - break; - case 1: - packet.Write((byte)CalamityModMessageType.ExactRangedLevelSync); - packet.Write(player.whoAmI); - packet.Write(exactRangedLevel); - break; - case 2: - packet.Write((byte)CalamityModMessageType.ExactMagicLevelSync); - packet.Write(player.whoAmI); - packet.Write(exactMagicLevel); - break; - case 3: - packet.Write((byte)CalamityModMessageType.ExactSummonLevelSync); - packet.Write(player.whoAmI); - packet.Write(exactSummonLevel); - break; - case 4: - packet.Write((byte)CalamityModMessageType.ExactRogueLevelSync); - packet.Write(player.whoAmI); - packet.Write(exactRogueLevel); - break; - } - if (!server) - { - packet.Send(); - } - else - { - packet.Send(-1, player.whoAmI); - } - } - - private void LevelPacket(bool server, int levelType) - { - ModPacket packet = mod.GetPacket(256); - switch (levelType) - { - case 0: - packet.Write((byte)CalamityModMessageType.MeleeLevelSync); - packet.Write(player.whoAmI); - packet.Write(meleeLevel); - break; - case 1: - packet.Write((byte)CalamityModMessageType.RangedLevelSync); - packet.Write(player.whoAmI); - packet.Write(rangedLevel); - break; - case 2: - packet.Write((byte)CalamityModMessageType.MagicLevelSync); - packet.Write(player.whoAmI); - packet.Write(magicLevel); - break; - case 3: - packet.Write((byte)CalamityModMessageType.SummonLevelSync); - packet.Write(player.whoAmI); - packet.Write(summonLevel); - break; - case 4: - packet.Write((byte)CalamityModMessageType.RogueLevelSync); - packet.Write(player.whoAmI); - packet.Write(rogueLevel); - break; - } - if (!server) - { - packet.Send(); - } - else - { - packet.Send(-1, player.whoAmI); - } - } - - private void StressPacket(bool server) + #region PacketStuff + private void ExactLevelPacket(bool server, int levelType) { - ModPacket packet = mod.GetPacket(256); - packet.Write((byte)CalamityModMessageType.StressSync); - packet.Write(player.whoAmI); - packet.Write(stress); - if (!server) - { - packet.Send(); - } - else - { - packet.Send(-1, player.whoAmI); - } + ModPacket packet = mod.GetPacket(256); + switch (levelType) + { + case 0: + packet.Write((byte)CalamityModMessageType.ExactMeleeLevelSync); + packet.Write(player.whoAmI); + packet.Write(exactMeleeLevel); + break; + case 1: + packet.Write((byte)CalamityModMessageType.ExactRangedLevelSync); + packet.Write(player.whoAmI); + packet.Write(exactRangedLevel); + break; + case 2: + packet.Write((byte)CalamityModMessageType.ExactMagicLevelSync); + packet.Write(player.whoAmI); + packet.Write(exactMagicLevel); + break; + case 3: + packet.Write((byte)CalamityModMessageType.ExactSummonLevelSync); + packet.Write(player.whoAmI); + packet.Write(exactSummonLevel); + break; + case 4: + packet.Write((byte)CalamityModMessageType.ExactRogueLevelSync); + packet.Write(player.whoAmI); + packet.Write(exactRogueLevel); + break; + } + if (!server) + { + packet.Send(); + } + else + { + packet.Send(-1, player.whoAmI); + } } - private void AdrenalinePacket(bool server) - { - ModPacket packet = mod.GetPacket(256); - packet.Write((byte)CalamityModMessageType.AdrenalineSync); - packet.Write(player.whoAmI); - packet.Write(adrenaline); - if (!server) - { - packet.Send(); - } - else - { - packet.Send(-1, player.whoAmI); - } - } - - internal void HandleExactLevels(BinaryReader reader, int levelType) - { - switch (levelType) - { - case 0: - exactMeleeLevel = reader.ReadInt32(); - break; - case 1: - exactRangedLevel = reader.ReadInt32(); - break; - case 2: - exactMagicLevel = reader.ReadInt32(); - break; - case 3: - exactSummonLevel = reader.ReadInt32(); - break; - case 4: - exactRogueLevel = reader.ReadInt32(); - break; - } - if (Main.netMode == 2) - { - ExactLevelPacket(true, levelType); - } - } - - internal void HandleLevels(BinaryReader reader, int levelType) - { - switch (levelType) - { - case 0: - meleeLevel = reader.ReadInt32(); - break; - case 1: - rangedLevel = reader.ReadInt32(); - break; - case 2: - magicLevel = reader.ReadInt32(); - break; - case 3: - summonLevel = reader.ReadInt32(); - break; - case 4: - rogueLevel = reader.ReadInt32(); - break; - } - if (Main.netMode == 2) - { - LevelPacket(true, levelType); - } - } - - internal void HandleStress(BinaryReader reader) + private void LevelPacket(bool server, int levelType) { - stress = reader.ReadInt32(); - if (Main.netMode == 2) - { - StressPacket(true); - } + ModPacket packet = mod.GetPacket(256); + switch (levelType) + { + case 0: + packet.Write((byte)CalamityModMessageType.MeleeLevelSync); + packet.Write(player.whoAmI); + packet.Write(meleeLevel); + break; + case 1: + packet.Write((byte)CalamityModMessageType.RangedLevelSync); + packet.Write(player.whoAmI); + packet.Write(rangedLevel); + break; + case 2: + packet.Write((byte)CalamityModMessageType.MagicLevelSync); + packet.Write(player.whoAmI); + packet.Write(magicLevel); + break; + case 3: + packet.Write((byte)CalamityModMessageType.SummonLevelSync); + packet.Write(player.whoAmI); + packet.Write(summonLevel); + break; + case 4: + packet.Write((byte)CalamityModMessageType.RogueLevelSync); + packet.Write(player.whoAmI); + packet.Write(rogueLevel); + break; + } + if (!server) + { + packet.Send(); + } + else + { + packet.Send(-1, player.whoAmI); + } } - internal void HandleAdrenaline(BinaryReader reader) - { - adrenaline = reader.ReadInt32(); - if (Main.netMode == 2) - { - AdrenalinePacket(true); - } - } - - public override void OnEnterWorld(Player player) + private void StressPacket(bool server) { - if (Main.netMode == 1) - { - ExactLevelPacket(false, 0); - ExactLevelPacket(false, 1); - ExactLevelPacket(false, 2); - ExactLevelPacket(false, 3); - ExactLevelPacket(false, 4); - LevelPacket(false, 0); - LevelPacket(false, 1); - LevelPacket(false, 2); - LevelPacket(false, 3); - LevelPacket(false, 4); - StressPacket(false); - AdrenalinePacket(false); - } + ModPacket packet = mod.GetPacket(256); + packet.Write((byte)CalamityModMessageType.StressSync); + packet.Write(player.whoAmI); + packet.Write(stress); + if (!server) + { + packet.Send(); + } + else + { + packet.Send(-1, player.whoAmI); + } } - #endregion - } + + private void AdrenalinePacket(bool server) + { + ModPacket packet = mod.GetPacket(256); + packet.Write((byte)CalamityModMessageType.AdrenalineSync); + packet.Write(player.whoAmI); + packet.Write(adrenaline); + if (!server) + { + packet.Send(); + } + else + { + packet.Send(-1, player.whoAmI); + } + } + + internal void HandleExactLevels(BinaryReader reader, int levelType) + { + switch (levelType) + { + case 0: + exactMeleeLevel = reader.ReadInt32(); + break; + case 1: + exactRangedLevel = reader.ReadInt32(); + break; + case 2: + exactMagicLevel = reader.ReadInt32(); + break; + case 3: + exactSummonLevel = reader.ReadInt32(); + break; + case 4: + exactRogueLevel = reader.ReadInt32(); + break; + } + if (Main.netMode == 2) + { + ExactLevelPacket(true, levelType); + } + } + + internal void HandleLevels(BinaryReader reader, int levelType) + { + switch (levelType) + { + case 0: + meleeLevel = reader.ReadInt32(); + break; + case 1: + rangedLevel = reader.ReadInt32(); + break; + case 2: + magicLevel = reader.ReadInt32(); + break; + case 3: + summonLevel = reader.ReadInt32(); + break; + case 4: + rogueLevel = reader.ReadInt32(); + break; + } + if (Main.netMode == 2) + { + LevelPacket(true, levelType); + } + } + + internal void HandleStress(BinaryReader reader) + { + stress = reader.ReadInt32(); + if (Main.netMode == 2) + { + StressPacket(true); + } + } + + internal void HandleAdrenaline(BinaryReader reader) + { + adrenaline = reader.ReadInt32(); + if (Main.netMode == 2) + { + AdrenalinePacket(true); + } + } + + public override void OnEnterWorld(Player player) + { + if (Main.netMode == 1) + { + ExactLevelPacket(false, 0); + ExactLevelPacket(false, 1); + ExactLevelPacket(false, 2); + ExactLevelPacket(false, 3); + ExactLevelPacket(false, 4); + LevelPacket(false, 0); + LevelPacket(false, 1); + LevelPacket(false, 2); + LevelPacket(false, 3); + LevelPacket(false, 4); + StressPacket(false); + AdrenalinePacket(false); + } + } + #endregion + } } diff --git a/CalamityRecipes.cs b/CalamityRecipes.cs new file mode 100644 index 0000000000..44a298b45b --- /dev/null +++ b/CalamityRecipes.cs @@ -0,0 +1,725 @@ +using System.Collections.Generic; +using System.Linq; +using Terraria; +using Terraria.ID; +using Terraria.Localization; +using Terraria.ModLoader; + +namespace CalamityMod +{ + internal class CalamityRecipes + { + private static ModRecipe GetNewRecipe() + { + return new ModRecipe(CalamityMod.Instance); + } + + public static void AddRecipes() + { + EditTerraBladeRecipe(); + AddPotionRecipes(); + AddToolRecipes(); + AddProgressionRecipes(); + AddEarlyGameWeaponRecipes(); + AddEarlyGameAccessoryRecipes(); + AddAnkhShieldRecipes(); + AddAlternateHardmodeRecipes(); + + // Leather from Vertebrae, for Crimson worlds + ModRecipe r = GetNewRecipe(); + r.AddIngredient(ItemID.Vertebrae, 5); + r.AddTile(TileID.WorkBenches); + r.SetResult(ItemID.Leather); + r.AddRecipe(); + + // Black Lens + r = GetNewRecipe(); + r.AddIngredient(ItemID.Lens); + r.AddIngredient(ItemID.BlackDye); + r.AddTile(TileID.DyeVat); + r.SetResult(ItemID.BlackLens); + r.AddRecipe(); + + // Ectoplasm from Ectoblood + r = GetNewRecipe(); + r.AddIngredient(null, "Ectoblood", 3); + r.AddTile(TileID.MythrilAnvil); + r.SetResult(ItemID.Ectoplasm); + r.AddRecipe(); + + // Rocket I from Empty Bullet + r = GetNewRecipe(); + r.AddIngredient(ItemID.EmptyBullet, 20); + r.AddIngredient(ItemID.ExplosivePowder, 1); + r.AddTile(TileID.MythrilAnvil); + r.SetResult(ItemID.RocketI, 20); + r.AddRecipe(); + + // Life Crystal + r = GetNewRecipe(); + r.AddIngredient(ItemID.Bone, 5); + r.AddIngredient(ItemID.PinkGel); + r.AddIngredient(ItemID.HealingPotion); + r.AddIngredient(ItemID.Ruby); + r.AddTile(TileID.Anvils); + r.SetResult(ItemID.LifeCrystal); + r.AddRecipe(); + + // Life Fruit + r = GetNewRecipe(); + r.AddIngredient(null, "PlantyMush", 10); + r.AddIngredient(null, "LivingShard"); + r.AddTile(TileID.MythrilAnvil); + r.SetResult(ItemID.LifeFruit); + r.AddRecipe(); + } + + // Change Terra Blade's recipe to require 7 Living Shards (forces the Blade to be post-Plantera) + private static void EditTerraBladeRecipe() + { + List rec = Main.recipe.ToList(); + rec.Where(x => x.createItem.type == ItemID.TerraBlade).ToList().ForEach(s => + { + for (int i = 0; i < s.requiredItem.Length; i++) + { + s.requiredItem[i] = new Item(); + } + s.requiredItem[0].SetDefaults(ItemID.TrueNightsEdge, false); + s.requiredItem[0].stack = 1; + s.requiredItem[1].SetDefaults(ItemID.TrueExcalibur, false); + s.requiredItem[1].stack = 1; + s.requiredItem[2].SetDefaults(CalamityMod.Instance.ItemType("LivingShard"), false); + s.requiredItem[2].stack = 7; + + s.createItem.SetDefaults(ItemID.TerraBlade, false); + s.createItem.stack = 1; + }); + } + + #region Potions + // Equivalent Blood Orb recipes for almost all vanilla potions + private static void AddPotionRecipes() + { + short[] potions = new[] + { + ItemID.WormholePotion, + ItemID.TeleportationPotion, + ItemID.SwiftnessPotion, + ItemID.FeatherfallPotion, + ItemID.GravitationPotion, + ItemID.ShinePotion, + ItemID.InvisibilityPotion, + ItemID.NightOwlPotion, + ItemID.SpelunkerPotion, + ItemID.HunterPotion, + ItemID.TrapsightPotion, + ItemID.BattlePotion, + ItemID.CalmingPotion, + ItemID.WrathPotion, + ItemID.RagePotion, + ItemID.ThornsPotion, + ItemID.IronskinPotion, + ItemID.EndurancePotion, + ItemID.RegenerationPotion, + ItemID.LifeforcePotion, + ItemID.HeartreachPotion, + ItemID.TitanPotion, + ItemID.ArcheryPotion, + ItemID.AmmoReservationPotion, + ItemID.MagicPowerPotion, + ItemID.ManaRegenerationPotion, + ItemID.SummoningPotion, + ItemID.InfernoPotion, + ItemID.WarmthPotion, + ItemID.ObsidianSkinPotion, + ItemID.GillsPotion, + ItemID.WaterWalkingPotion, + ItemID.FlipperPotion, + ItemID.BuilderPotion, + ItemID.MiningPotion, + ItemID.FishingPotion, + ItemID.CratePotion, + ItemID.SonarPotion, + ItemID.GenderChangePotion, + ItemID.LovePotion, + ItemID.StinkPotion + }; + ModRecipe r; + + foreach (var potion in potions) + { + r = GetNewRecipe(); + r.AddIngredient(null, "BloodOrb", 10); + r.AddIngredient(ItemID.BottledWater); + r.AddTile(TileID.AlchemyTable); + r.SetResult(potion); + r.AddRecipe(); + } + } + #endregion + + #region Tools + // Essential tools such as the Magic Mirror and Rod of Discord + private static void AddToolRecipes() + { + // Magic Mirror + ModRecipe r = GetNewRecipe(); + r.AddIngredient(ItemID.IronBar, 10); + r.AddIngredient(ItemID.Glass, 10); + r.AddIngredient(ItemID.FallenStar, 10); + r.anyIronBar = true; + r.AddTile(TileID.Anvils); + r.SetResult(ItemID.MagicMirror); + r.AddRecipe(); + + // Ice Mirror + r = GetNewRecipe(); + r.AddIngredient(ItemID.IceBlock, 20); + r.AddIngredient(ItemID.Glass, 10); + r.AddIngredient(ItemID.FallenStar, 10); + r.AddIngredient(ItemID.IronBar, 5); + r.anyIronBar = true; + r.AddTile(TileID.Anvils); + r.SetResult(ItemID.IceMirror); + r.AddRecipe(); + + // Shadow Key + r = GetNewRecipe(); + r.AddIngredient(ItemID.GoldenKey); + r.AddIngredient(ItemID.Obsidian, 20); + r.AddIngredient(ItemID.Bone, 5); + r.AddTile(TileID.Anvils); + r.SetResult(ItemID.ShadowKey); + r.AddRecipe(); + + // Rod of Discord + r = GetNewRecipe(); + r.AddIngredient(ItemID.SoulofLight, 30); + r.AddIngredient(ItemID.ChaosFish, 5); + r.AddIngredient(ItemID.PixieDust, 50); + r.AddTile(TileID.MythrilAnvil); + r.SetResult(ItemID.RodofDiscord); + r.AddRecipe(); + + // Sky Mill + r = GetNewRecipe(); + r.AddIngredient(ItemID.SunplateBlock, 10); + r.AddIngredient(ItemID.Cloud, 5); + r.AddIngredient(ItemID.RainCloud, 3); + r.AddTile(TileID.Anvils); + r.SetResult(ItemID.SkyMill); + r.AddRecipe(); + + // Ice Machine + r = GetNewRecipe(); + r.AddIngredient(ItemID.IceBlock, 25); + r.AddIngredient(ItemID.SnowBlock, 15); + r.AddIngredient(ItemID.IronBar, 3); + r.anyIronBar = true; + r.AddTile(TileID.Anvils); + r.SetResult(ItemID.IceMachine); + r.AddRecipe(); + } + #endregion + + #region ProgressionItems + // Boss summon and progression items + private static void AddProgressionRecipes() + { + // Guide Voodoo Doll + ModRecipe r = GetNewRecipe(); + r.AddIngredient(ItemID.Leather, 5); + r.AddIngredient(null, "BloodOrb", 10); + r.AddTile(TileID.Hellforge); + r.SetResult(ItemID.GuideVoodooDoll); + r.AddRecipe(); + + // Temple Key + r = GetNewRecipe(); + r.AddIngredient(ItemID.JungleSpores, 15); + r.AddIngredient(ItemID.RichMahogany, 15); + r.AddIngredient(ItemID.SoulofNight, 15); + r.AddIngredient(ItemID.SoulofLight, 15); + r.AddTile(TileID.MythrilAnvil); + r.SetResult(ItemID.TempleKey); + r.AddRecipe(); + + // Lihzahrd Power Cell (NOT Calamity's Old Power Cell) + r = GetNewRecipe(); + r.AddIngredient(ItemID.LihzahrdBrick, 15); + r.AddIngredient(null, "CoreofCinder"); + r.AddTile(TileID.LihzahrdFurnace); + r.SetResult(ItemID.LihzahrdPowerCell); + r.AddRecipe(); + + // Truffle Worm + r = GetNewRecipe(); + r.AddIngredient(ItemID.GlowingMushroom, 15); + r.AddIngredient(ItemID.Worm); + r.AddTile(TileID.Autohammer); + r.SetResult(ItemID.TruffleWorm); + r.AddRecipe(); + } + #endregion + + #region EarlyGameWeapons + // Early game weapons such as Enchanted Sword + private static void AddEarlyGameWeaponRecipes() + { + // Shuriken + ModRecipe r = GetNewRecipe(); + r.AddIngredient(ItemID.IronBar); + r.anyIronBar = true; + r.AddTile(TileID.Anvils); + r.SetResult(ItemID.Shuriken, 50); + r.AddRecipe(); + + // Throwing Knife + r = GetNewRecipe(); + r.AddIngredient(ItemID.IronBar); + r.anyIronBar = true; + r.AddTile(TileID.Anvils); + r.SetResult(ItemID.ThrowingKnife, 50); + r.AddRecipe(); + + // Wand of Sparking + r = GetNewRecipe(); + r.AddIngredient(ItemID.Wood, 5); + r.AddIngredient(ItemID.Torch, 3); + r.AddIngredient(ItemID.FallenStar); + r.AddTile(TileID.Anvils); + r.SetResult(ItemID.WandofSparking); + r.AddRecipe(); + + // Starfury w/ Gold Broadsword + r = GetNewRecipe(); + r.AddIngredient(ItemID.GoldBroadsword); + r.AddIngredient(ItemID.FallenStar, 10); + r.AddIngredient(null, "VictoryShard", 3); + r.AddTile(TileID.Anvils); + r.SetResult(ItemID.Starfury); + r.AddRecipe(); + + // Starfury w/ Platinum Broadsword + r = GetNewRecipe(); + r.AddIngredient(ItemID.PlatinumBroadsword); + r.AddIngredient(ItemID.FallenStar, 10); + r.AddIngredient(null, "VictoryShard", 3); + r.AddTile(TileID.Anvils); + r.SetResult(ItemID.Starfury); + r.AddRecipe(); + + // Enchanted Sword (requires Hardmode materials) + r = GetNewRecipe(); + r.AddIngredient(null, "VictoryShard", 10); + r.AddIngredient(ItemID.SoulofLight, 15); + r.AddIngredient(ItemID.UnicornHorn, 3); + r.AddIngredient(ItemID.LightShard); + r.AddTile(TileID.MythrilAnvil); + r.SetResult(ItemID.EnchantedSword); + r.AddRecipe(); + + // Muramasa w/ Cobalt Bars + r = GetNewRecipe(); + r.AddIngredient(ItemID.CobaltBar, 15); + r.AddTile(TileID.MythrilAnvil); + r.SetResult(ItemID.Muramasa); + r.AddRecipe(); + + // Muramasa w/ Palladium Bars + r = GetNewRecipe(); + r.AddIngredient(ItemID.PalladiumBar, 15); + r.AddTile(TileID.MythrilAnvil); + r.SetResult(ItemID.Muramasa); + r.AddRecipe(); + } + #endregion + + #region EarlyGameAccessories + // Early game accessories such as Cloud in a Bottle + private static void AddEarlyGameAccessoryRecipes() + { + // Cloud in a Bottle + ModRecipe r = GetNewRecipe(); + r.AddIngredient(ItemID.Feather, 2); + r.AddIngredient(ItemID.Bottle); + r.AddIngredient(ItemID.Cloud, 25); + r.AddTile(TileID.Anvils); + r.SetResult(ItemID.CloudinaBottle); + r.AddRecipe(); + + // Hermes Boots + r = GetNewRecipe(); + r.AddIngredient(ItemID.Silk, 10); + r.AddTile(TileID.Loom); + r.SetResult(ItemID.HermesBoots); + r.AddRecipe(); + + // Blizzard in a Bottle + r = GetNewRecipe(); + r.AddIngredient(ItemID.Feather, 4); + r.AddIngredient(ItemID.Bottle); + r.AddIngredient(ItemID.SnowBlock, 50); + r.AddTile(TileID.Anvils); + r.SetResult(ItemID.BlizzardinaBottle); + r.AddRecipe(); + + // Sandstorm in a Bottle + r = GetNewRecipe(); + r.AddIngredient(null, "DesertFeather", 10); + r.AddIngredient(ItemID.Feather, 6); + r.AddIngredient(ItemID.Bottle); + r.AddIngredient(ItemID.SandBlock, 70); + r.AddTile(TileID.Anvils); + r.SetResult(ItemID.SandstorminaBottle); + r.AddRecipe(); + + // Frog Leg + r = GetNewRecipe(); + r.AddIngredient(ItemID.Frog, 10); + r.AddTile(TileID.Anvils); + r.SetResult(ItemID.FrogLeg); + r.AddRecipe(); + + // Flying Carpet + r = GetNewRecipe(); + r.AddIngredient(ItemID.AncientCloth, 10); + r.AddIngredient(ItemID.SoulofLight, 10); + r.AddIngredient(ItemID.SoulofNight, 10); + r.AddTile(TileID.MythrilAnvil); + r.SetResult(ItemID.FlyingCarpet); + r.AddRecipe(); + + // Aglet + r = GetNewRecipe(); + r.AddIngredient(ItemID.IronBar, 5); + r.anyIronBar = true; + r.AddTile(TileID.Anvils); + r.SetResult(ItemID.Aglet); + r.AddRecipe(); + + // Anklet of the Wind + r = GetNewRecipe(); + r.AddIngredient(ItemID.JungleSpores, 15); + r.AddIngredient(ItemID.Cloud, 15); + r.AddIngredient(ItemID.PinkGel, 5); + r.AddTile(TileID.Anvils); + r.SetResult(ItemID.AnkletoftheWind); + r.AddRecipe(); + + // Water Walking Boots + r = GetNewRecipe(); + r.AddIngredient(ItemID.Leather, 5); + r.AddIngredient(ItemID.WaterWalkingPotion, 8); + r.AddTile(TileID.Anvils); + r.SetResult(ItemID.WaterWalkingBoots); + r.AddRecipe(); + + // Ice Skates + r = GetNewRecipe(); + r.AddIngredient(ItemID.IceBlock, 20); + r.AddIngredient(ItemID.Leather, 5); + r.AddIngredient(ItemID.IronBar, 5); + r.anyIronBar = true; + r.AddTile(TileID.IceMachine); + r.SetResult(ItemID.IceSkates); + r.AddRecipe(); + + // Lucky Horseshoe w/ Gold Bars + r = GetNewRecipe(); + r.AddIngredient(ItemID.SunplateBlock, 10); + r.AddIngredient(ItemID.Cloud, 10); + r.AddIngredient(ItemID.GoldBar, 5); + r.AddTile(TileID.Anvils); + r.SetResult(ItemID.LuckyHorseshoe); + r.AddRecipe(); + + // Lucky Horseshoe w/ Platinum Bars + r = GetNewRecipe(); + r.AddIngredient(ItemID.SunplateBlock, 10); + r.AddIngredient(ItemID.Cloud, 10); + r.AddIngredient(ItemID.PlatinumBar, 5); + r.AddTile(TileID.Anvils); + r.SetResult(ItemID.LuckyHorseshoe); + r.AddRecipe(); + + // Shiny Red Balloon + r = GetNewRecipe(); + r.AddIngredient(ItemID.WhiteString); + r.AddIngredient(ItemID.Gel, 80); + r.AddIngredient(ItemID.Cloud, 40); + r.AddTile(TileID.Solidifier); + r.SetResult(ItemID.ShinyRedBalloon); + r.AddRecipe(); + + // Lava Charm + r = GetNewRecipe(); + r.AddIngredient(ItemID.LavaBucket, 5); + r.AddIngredient(ItemID.Obsidian, 25); + r.AddIngredient(ItemID.IronBar, 5); + r.anyIronBar = true; + r.AddTile(TileID.Anvils); + r.SetResult(ItemID.LavaCharm); + r.AddRecipe(); + + // Feral Claws + r = GetNewRecipe(); + r.AddIngredient(ItemID.Leather, 10); + r.AddTile(TileID.Anvils); + r.SetResult(ItemID.FeralClaws); + r.AddRecipe(); + + // Radar + r = GetNewRecipe(); + r.AddIngredient(ItemID.IronBar, 5); + r.anyIronBar = true; + r.AddTile(TileID.Anvils); + r.SetResult(ItemID.Radar); + r.AddRecipe(); + } + #endregion + + #region AnkhShield + // Every base component for the Ankh Shield + private static void AddAnkhShieldRecipes() + { + // Cobalt Shield w/ Cobalt + ModRecipe r = GetNewRecipe(); + r.AddIngredient(ItemID.CobaltBar, 10); + r.AddTile(TileID.MythrilAnvil); + r.SetResult(ItemID.CobaltShield); + r.AddRecipe(); + + // Cobalt Shield w/ Palladium + r = GetNewRecipe(); + r.AddIngredient(ItemID.PalladiumBar, 10); + r.AddTile(TileID.MythrilAnvil); + r.SetResult(ItemID.CobaltShield); + r.AddRecipe(); + + // Armor Polish (broken armor) + r = GetNewRecipe(); + r.AddIngredient(ItemID.Bone, 50); + r.AddIngredient(null, "AncientBoneDust", 3); + r.AddTile(TileID.MythrilAnvil); + r.SetResult(ItemID.ArmorPolish); + r.AddRecipe(); + + // Adhesive Bandage (bleeding) + r = GetNewRecipe(); + r.AddIngredient(ItemID.Silk, 10); + r.AddIngredient(ItemID.Gel, 50); + r.AddIngredient(ItemID.GreaterHealingPotion); + r.AddTile(TileID.MythrilAnvil); + r.SetResult(ItemID.AdhesiveBandage); + r.AddRecipe(); + + // Bezoar (poison) + r = GetNewRecipe(); + r.AddIngredient(ItemID.Stinger, 15); + r.AddIngredient(null, "MurkyPaste"); + r.AddTile(TileID.Anvils); + r.SetResult(ItemID.Bezoar); + r.AddRecipe(); + + // Nazar (curse) + r = GetNewRecipe(); + r.AddIngredient(ItemID.SoulofNight, 20); + r.AddIngredient(ItemID.Lens, 5); + r.AddTile(TileID.MythrilAnvil); + r.SetResult(ItemID.Nazar); + r.AddRecipe(); + + // Vitamins (weakness) + r = GetNewRecipe(); + r.AddIngredient(ItemID.BottledWater); + r.AddIngredient(ItemID.Waterleaf, 5); + r.AddIngredient(ItemID.Blinkroot, 5); + r.AddIngredient(ItemID.Daybloom, 5); + r.AddIngredient(null, "BeetleJuice", 3); + r.AddTile(TileID.MythrilAnvil); + r.SetResult(ItemID.Vitamins); + r.AddRecipe(); + + // Blindfold (darkness) + r = GetNewRecipe(); + r.AddIngredient(ItemID.Silk, 30); + r.AddIngredient(ItemID.SoulofNight, 5); + r.AddTile(TileID.MythrilAnvil); + r.SetResult(ItemID.Blindfold); + r.AddRecipe(); + + // Trifold Map (confusion) + r = GetNewRecipe(); + r.AddIngredient(ItemID.Silk, 20); + r.AddIngredient(ItemID.SoulofLight, 3); + r.AddIngredient(ItemID.SoulofNight, 3); + r.AddTile(TileID.MythrilAnvil); + r.SetResult(ItemID.TrifoldMap); + r.AddRecipe(); + + // Fast Clock (slow) + r = GetNewRecipe(); + r.AddIngredient(ItemID.Timer1Second); + r.AddIngredient(ItemID.PixieDust, 15); + r.AddIngredient(ItemID.SoulofLight, 5); + r.AddTile(TileID.MythrilAnvil); + r.SetResult(ItemID.FastClock); + r.AddRecipe(); + + // Megaphone (silence) + r = GetNewRecipe(); + r.AddIngredient(ItemID.Wire, 10); + r.AddIngredient(ItemID.HallowedBar, 5); + r.AddIngredient(ItemID.Ruby, 3); + r.AddTile(TileID.MythrilAnvil); + r.SetResult(ItemID.Megaphone); + r.AddRecipe(); + } + #endregion + + #region HardmodeEquipment + // Alternate recipes for vanilla Hardmode equipment + private static void AddAlternateHardmodeRecipes() + { + // Avenger Emblem made with Rogue Emblem + ModRecipe r = GetNewRecipe(); + r.AddIngredient(null, "RogueEmblem"); + r.AddIngredient(ItemID.SoulofMight, 5); + r.AddIngredient(ItemID.SoulofSight, 5); + r.AddIngredient(ItemID.SoulofFright, 5); + r.AddTile(TileID.TinkerersWorkbench); + r.SetResult(ItemID.AvengerEmblem); + r.AddRecipe(); + + // Celestial Magnet + r = GetNewRecipe(); + r.AddIngredient(ItemID.FallenStar, 20); + r.AddIngredient(ItemID.SoulofMight, 10); + r.AddIngredient(ItemID.SoulofLight, 5); + r.AddIngredient(ItemID.SoulofNight, 5); + r.AddIngredient(null, "CryoBar", 3); + r.AddTile(TileID.MythrilAnvil); + r.SetResult(ItemID.CelestialMagnet); + r.AddRecipe(); + + // Frozen Turtle Shell + r = GetNewRecipe(); + r.AddIngredient(ItemID.TurtleShell, 3); + r.AddIngredient(null, "EssenceofEleum", 9); + r.AddTile(TileID.MythrilAnvil); + r.SetResult(ItemID.FrozenTurtleShell); + r.AddRecipe(); + + // Frost Helmet w/ Frigid Bars + r = GetNewRecipe(); + r.AddIngredient(null, "CryoBar", 6); + r.AddIngredient(ItemID.FrostCore); + r.AddTile(TileID.IceMachine); + r.SetResult(ItemID.FrostHelmet); + r.AddRecipe(); + + // Frost Breastplate w/ Frigid Bars + r = GetNewRecipe(); + r.AddIngredient(null, "CryoBar", 10); + r.AddIngredient(ItemID.FrostCore); + r.AddTile(TileID.IceMachine); + r.SetResult(ItemID.FrostBreastplate); + r.AddRecipe(); + + // Frost Leggings w/ Frigid Bars + r = GetNewRecipe(); + r.AddIngredient(null, "CryoBar", 8); + r.AddIngredient(ItemID.FrostCore); + r.AddTile(TileID.IceMachine); + r.SetResult(ItemID.FrostLeggings); + r.AddRecipe(); + + // Terra Blade w/ True Bloody Edge + r = GetNewRecipe(); + r.AddIngredient(null, "TrueBloodyEdge"); + r.AddIngredient(ItemID.TrueExcalibur); + r.AddIngredient(null, "LivingShard", 7); + r.AddTile(TileID.MythrilAnvil); + r.SetResult(ItemID.TerraBlade); + r.AddRecipe(); + } + #endregion + + public static void AddRecipeGroups() + { + RecipeGroup group = new RecipeGroup(() => Lang.misc[37] + (" Silt"), new int[] + { + ItemID.SiltBlock, + ItemID.SlushBlock + }); + RecipeGroup.RegisterGroup("SiltGroup", group); + + group = new RecipeGroup(() => Lang.misc[37] + (" Lunar Pickaxe"), new int[] + { + ItemID.SolarFlarePickaxe, + ItemID.VortexPickaxe, + ItemID.NebulaPickaxe, + ItemID.StardustPickaxe + }); + RecipeGroup.RegisterGroup("LunarPickaxe", group); + + group = new RecipeGroup(() => Lang.misc[37] + (" Lunar Hamaxe"), new int[] + { + ItemID.LunarHamaxeSolar, + ItemID.LunarHamaxeVortex, + ItemID.LunarHamaxeNebula, + ItemID.LunarHamaxeStardust + }); + RecipeGroup.RegisterGroup("LunarHamaxe", group); + + group = new RecipeGroup(() => Lang.misc[37] + (" Wings"), new int[] + { + ItemID.DemonWings, + ItemID.AngelWings, + ItemID.RedsWings, + ItemID.ButterflyWings, + ItemID.FairyWings, + ItemID.HarpyWings, + ItemID.BoneWings, + ItemID.FlameWings, + ItemID.FrozenWings, + ItemID.GhostWings, + ItemID.SteampunkWings, + ItemID.LeafWings, + ItemID.BatWings, + ItemID.BeeWings, + ItemID.DTownsWings, + ItemID.WillsWings, + ItemID.CrownosWings, + ItemID.CenxsWings, + ItemID.TatteredFairyWings, + ItemID.SpookyWings, + ItemID.Hoverboard, + ItemID.FestiveWings, + ItemID.BeetleWings, + ItemID.FinWings, + ItemID.FishronWings, + ItemID.MothronWings, + ItemID.WingsSolar, + ItemID.WingsVortex, + ItemID.WingsNebula, + ItemID.WingsStardust, + ItemID.Yoraiz0rWings, + ItemID.JimsWings, + ItemID.SkiphsWings, + ItemID.LokisWings, + ItemID.BetsyWings, + ItemID.ArkhalisWings, + ItemID.LeinforsWings, + CalamityMod.Instance.ItemType("SkylineWings"), + CalamityMod.Instance.ItemType("StarlightWings"), + CalamityMod.Instance.ItemType("AureateWings"), + CalamityMod.Instance.ItemType("DiscordianWings"), + CalamityMod.Instance.ItemType("TarragonWings"), + CalamityMod.Instance.ItemType("XerocWings") + }); + RecipeGroup.RegisterGroup("WingsGroup", group); + } + } +} diff --git a/CalamityWorld.cs b/CalamityWorld.cs index ab37f130d1..0f90a02f33 100644 --- a/CalamityWorld.cs +++ b/CalamityWorld.cs @@ -16,219 +16,157 @@ using Terraria.GameContent.Events; using Terraria.ModLoader.IO; using CalamityMod.Tiles; using CalamityMod.NPCs; +using CalamityMod.World; using CalamityMod.World.Planets; namespace CalamityMod { public class CalamityWorld : ModWorld { - #region InstanceVars + #region InstanceVars + //private const int ExpandWorldBy = 200; - #region NormalVars - public static int DoGSecondStageCountdown = 0; + public static int DoGSecondStageCountdown = 0; - public static bool bossRushActive = false; + private const int saveVersion = 0; - public static bool deactivateStupidFuckingBullshit = false; + //Boss Rush + public static bool bossRushActive = false; //Whether Boss Rush is active or not + public static bool deactivateStupidFuckingBullshit = false; //Force Boss Rush to inactive + public static int bossRushStage = 0; //Boss Rush Stage + public static int bossRushSpawnCountdown = 180; //Delay before another Boss Rush boss can spawn - public static int bossRushStage = 0; + //Death Mode natural boss spawns + public static int bossSpawnCountdown = 0; //Death Mode natural boss spawn countdown + public static int bossType = 0; //Death Mmode natural boss spawn type - public static int bossRushSpawnCountdown = 180; + //Modes + public static bool demonMode = false; //Spawn rate boost + public static bool onionMode = false; //Extra accessory from Moon Lord + public static bool revenge = false; //Revengeance Mode + public static bool death = false; //Death Mode + public static bool defiled = false; //Defiled Mode + public static bool armageddon = false; //Armageddon Mode + public static bool ironHeart = false; //Iron Heart Mode - public static int bossSpawnCountdown = 0; + //Evil Islands + private static int fehX = 0; + private static int fehY = 0; - public static int bossType = 0; + //Brimstone Crag + private static int fuhX = 0; + private static int fuhY = 0; + public static int calamityTiles = 0; - private const int ExpandWorldBy = 200; + //Abyss & Sulphur + private static int numAbyssIslands = 0; + private static int[] AbyssIslandX = new int[20]; + private static int[] AbyssIslandY = new int[20]; + private static int[] AbyssItemArray = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; + public static int sulphurTiles = 0; + public static int abyssTiles = 0; + public static bool abyssSide = false; + public static int abyssChasmBottom = 0; - private const int saveVersion = 0; - - private static int fehX = 0; - - private static int fehY = 0; - - private static int fuhX = 0; - - private static int fuhY = 0; - - private static int numAbyssIslands = 0; - - private static int[] AbyssIslandX = new int[20]; - - private static int[] AbyssIslandY = new int[20]; - - private static int[] AbyssItemArray = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; - - private static bool genIcePyramid = true; - - private static int[] SChestX = new int[10]; - - private static int[] SChestY = new int[10]; - - private static bool genHellHut = true; - - private static bool genSandHut = true; - - private static bool genEvilHut = true; - - private static bool genPureHut = true; //forest - - private static bool genIceHut = true; - - private static bool genMushroomHut = true; - - private static bool genGraniteHut = true; - - private static bool genMarbleHut = true; - - private static bool genSwordHut = true; - - private static bool genAbyssHut = true; - - public static int calamityTiles = 0; - + //Astral public static int astralTiles = 0; - - public static int seaTiles = 0; - - public static int sulphurTiles = 0; - - public static int abyssTiles = 0; - - public static bool abyssSide = false; - - public static bool spring = false; - - public static bool summer = false; - - public static bool fall = false; - - public static bool winter = false; - - public static bool downedDesertScourge = false; - - public static bool downedAquaticScourge = false; - - public static bool downedHiveMind = false; - - public static bool downedPerforator = false; - - public static bool downedSlimeGod = false; - - public static bool downedCryogen = false; - - public static bool downedBrimstoneElemental = false; - - public static bool downedCalamitas = false; - - public static bool downedLeviathan = false; - - public static bool downedDoG = false; - - public static bool downedPlaguebringer = false; - - public static bool downedYharon = false; - - public static bool buffedEclipse = false; - - public static bool downedProvidence = false; - - public static bool downedGuardians = false; - - public static bool downedSentinel1 = false; - - public static bool downedSentinel2 = false; - - public static bool downedSentinel3 = false; - - public static bool downedSCal = false; - - public static bool downedBumble = false; - - public static bool downedCrabulon = false; - - public static bool downedBetsy = false; - - public static bool downedScavenger = false; - - public static bool downedWhar = false; //boss 2 - - public static bool downedSkullHead = false; //boss 3 - - public static bool downedUgly = false; //Wall - - public static bool downedSkeletor = false; //Skele of tron Prime - - public static bool downedPlantThing = false; //planter - - public static bool downedGolemBaby = false; //Baby - - public static bool downedMoonDude = false; //Moon guy - - public static bool downedBossAny = false; //Any boss - - public static bool spawnedHardBoss = false; //Hardmode boss spawned - - public static bool demonMode = false; - - public static bool onionMode = false; - - public static bool revenge = false; - - public static bool death = false; - - public static bool defiled = false; - - public static bool armageddon = false; - - public static bool downedStarGod = false; - - public static bool downedAstrageldon = false; - - public static bool spawnAstralMeteor = false; - + public static bool spawnAstralMeteor = false; public static bool spawnAstralMeteor2 = false; - public static bool spawnAstralMeteor3 = false; - + + //Sunken Sea + public static int sunkenSeaTiles = 0; + public static Rectangle SunkenSeaLocation = Rectangle.Empty; + + //Ice Tomb + private static bool genIcePyramid = true; + + //Shrines + private static int[] SChestX = new int[10]; + private static int[] SChestY = new int[10]; + private static bool genHellHut = true; + private static bool genSandHut = true; + private static bool genEvilHut = true; + private static bool genPureHut = true; //forest + private static bool genIceHut = true; + private static bool genMushroomHut = true; + private static bool genGraniteHut = true; + private static bool genMarbleHut = true; + private static bool genSwordHut = true; + private static bool genAbyssHut = true; + + #region Downed Bools + public static bool downedBossAny = false; //Any boss + public static bool downedDesertScourge = false; + public static bool downedCrabulon = false; + public static bool downedHiveMind = false; + public static bool downedPerforator = false; + public static bool downedSlimeGod = false; + public static bool spawnedHardBoss = false; //Hardmode boss spawned + public static bool downedCryogen = false; + public static bool downedAquaticScourge = false; + public static bool downedBrimstoneElemental = false; + public static bool downedCalamitas = false; + public static bool downedLeviathan = false; + public static bool downedAstrageldon = false; + public static bool downedStarGod = false; + public static bool downedPlaguebringer = false; + public static bool downedScavenger = false; + public static bool downedOldDuke = false; + public static bool downedGuardians = false; + public static bool downedProvidence = false; + public static bool downedSentinel1 = false; + public static bool downedSentinel2 = false; + public static bool downedSentinel3 = false; public static bool downedPolterghast = false; + public static bool downedDoG = false; + public static bool downedBumble = false; + public static bool buffedEclipse = false; + public static bool downedBuffedMothron = false; + public static bool downedYharon = false; + public static bool downedSCal = false; + public static bool downedLORDE = false; + public static bool downedCLAM = false; - public static bool downedLORDE = false; + //Vanilla + public static bool downedWhar = false; //BoC or EoW + public static bool downedSkullHead = false; //Skeletron + public static bool downedUgly = false; //Wall of Flesh + public static bool downedSkeletor = false; //Skeletron Prime + public static bool downedPlantThing = false; //Plantera + public static bool downedGolemBaby = false; //Golem + public static bool downedMoonDude = false; //Moon Lord + public static bool downedBetsy = false; //Betsy + #endregion - public static bool downedBuffedMothron = false; + #endregion - public static bool downedOldDuke = false; - - public static bool ironHeart = false; - #endregion - - #endregion - - #region Initialize - public override void Initialize() + #region Initialize + public override void Initialize() { - NPC.LunarShieldPowerExpert = 100; - bossRushStage = 0; - DoGSecondStageCountdown = 0; - CalamityGlobalNPC.holyBoss = -1; - CalamityGlobalNPC.doughnutBoss = -1; - CalamityGlobalNPC.voidBoss = -1; - CalamityGlobalNPC.energyFlame = -1; - CalamityGlobalNPC.hiveMind = -1; - CalamityGlobalNPC.hiveMind2 = -1; - CalamityGlobalNPC.scavenger = -1; - CalamityGlobalNPC.DoGHead = -1; - CalamityGlobalNPC.ghostBoss = -1; - CalamityGlobalNPC.laserEye = -1; - CalamityGlobalNPC.fireEye = -1; - CalamityGlobalNPC.brimstoneElemental = -1; - bossRushActive = false; - bossRushSpawnCountdown = 180; - bossSpawnCountdown = 0; - bossType = 0; - abyssSide = false; - downedDesertScourge = false; - downedAquaticScourge = false; + NPC.LunarShieldPowerExpert = 100; + bossRushStage = 0; + DoGSecondStageCountdown = 0; + CalamityGlobalNPC.holyBoss = -1; + CalamityGlobalNPC.doughnutBoss = -1; + CalamityGlobalNPC.voidBoss = -1; + CalamityGlobalNPC.energyFlame = -1; + CalamityGlobalNPC.hiveMind = -1; + CalamityGlobalNPC.hiveMind2 = -1; + CalamityGlobalNPC.scavenger = -1; + CalamityGlobalNPC.DoGHead = -1; + CalamityGlobalNPC.ghostBoss = -1; + CalamityGlobalNPC.laserEye = -1; + CalamityGlobalNPC.fireEye = -1; + CalamityGlobalNPC.brimstoneElemental = -1; + bossRushActive = false; + bossRushSpawnCountdown = 180; + bossSpawnCountdown = 0; + bossType = 0; + abyssChasmBottom = 0; + abyssSide = false; + downedDesertScourge = false; + downedAquaticScourge = false; downedHiveMind = false; downedPerforator = false; downedSlimeGod = false; @@ -244,8 +182,9 @@ namespace CalamityMod downedSentinel2 = false; downedSentinel3 = false; downedYharon = false; - buffedEclipse = false; + buffedEclipse = false; downedSCal = false; + downedCLAM = false; downedBumble = false; downedCrabulon = false; downedBetsy = false; @@ -263,28 +202,28 @@ namespace CalamityMod onionMode = false; revenge = false; downedStarGod = false; - downedAstrageldon = false; + downedAstrageldon = false; spawnAstralMeteor = false; spawnAstralMeteor2 = false; spawnAstralMeteor3 = false; downedPolterghast = false; - downedLORDE = false; - downedBuffedMothron = false; - downedOldDuke = false; - death = false; - defiled = false; - armageddon = false; - ironHeart = false; - } - #endregion + downedLORDE = false; + downedBuffedMothron = false; + downedOldDuke = false; + death = false; + defiled = false; + armageddon = false; + ironHeart = false; + } + #endregion - #region Save - public override TagCompound Save() + #region Save + public override TagCompound Save() { var downed = new List(); if (downedDesertScourge) downed.Add("desertScourge"); - if (downedAquaticScourge) downed.Add("aquaticScourge"); - if (downedHiveMind) downed.Add("hiveMind"); + if (downedAquaticScourge) downed.Add("aquaticScourge"); + if (downedHiveMind) downed.Add("hiveMind"); if (downedPerforator) downed.Add("perforator"); if (downedSlimeGod) downed.Add("slimeGod"); if (downedCryogen) downed.Add("cryogen"); @@ -299,7 +238,7 @@ namespace CalamityMod if (downedSentinel2) downed.Add("stormWeaver"); if (downedSentinel3) downed.Add("signus"); if (downedYharon) downed.Add("yharon"); - if (buffedEclipse) downed.Add("eclipse"); + if (buffedEclipse) downed.Add("eclipse"); if (downedSCal) downed.Add("supremeCalamitas"); if (downedBumble) downed.Add("bumblebirb"); if (downedCrabulon) downed.Add("crabulon"); @@ -317,38 +256,42 @@ namespace CalamityMod if (onionMode) downed.Add("onionMode"); if (revenge) downed.Add("revenge"); if (downedStarGod) downed.Add("starGod"); - if (downedAstrageldon) downed.Add("astrageldon"); + if (downedAstrageldon) downed.Add("astrageldon"); if (spawnAstralMeteor) downed.Add("astralMeteor"); if (spawnAstralMeteor2) downed.Add("astralMeteor2"); if (spawnAstralMeteor3) downed.Add("astralMeteor3"); if (spawnedHardBoss) downed.Add("hardBoss"); if (downedPolterghast) downed.Add("polterghast"); - if (downedLORDE) downed.Add("lorde"); - if (downedBuffedMothron) downed.Add("moth"); - if (downedOldDuke) downed.Add("oldDuke"); - if (death) downed.Add("death"); - if (defiled) downed.Add("defiled"); - if (armageddon) downed.Add("armageddon"); - if (ironHeart) downed.Add("ironHeart"); - if (abyssSide) downed.Add("abyssSide"); - if (bossRushActive) downed.Add("bossRushActive"); + if (downedLORDE) downed.Add("lorde"); + if (downedBuffedMothron) downed.Add("moth"); + if (downedOldDuke) downed.Add("oldDuke"); + if (death) downed.Add("death"); + if (defiled) downed.Add("defiled"); + if (armageddon) downed.Add("armageddon"); + if (ironHeart) downed.Add("ironHeart"); + if (abyssSide) downed.Add("abyssSide"); + if (bossRushActive) downed.Add("bossRushActive"); + if (downedCLAM) downed.Add("clam"); return new TagCompound { { "downed", downed + }, + { + "abyssChasmBottom", abyssChasmBottom } }; } - #endregion + #endregion - #region Load - public override void Load(TagCompound tag) + #region Load + public override void Load(TagCompound tag) { var downed = tag.GetList("downed"); downedDesertScourge = downed.Contains("desertScourge"); - downedAquaticScourge = downed.Contains("aquaticScourge"); - downedHiveMind = downed.Contains("hiveMind"); + downedAquaticScourge = downed.Contains("aquaticScourge"); + downedHiveMind = downed.Contains("hiveMind"); downedPerforator = downed.Contains("perforator"); downedSlimeGod = downed.Contains("slimeGod"); downedCryogen = downed.Contains("cryogen"); @@ -363,7 +306,7 @@ namespace CalamityMod downedSentinel2 = downed.Contains("stormWeaver"); downedSentinel3 = downed.Contains("signus"); downedYharon = downed.Contains("yharon"); - buffedEclipse = downed.Contains("eclipse"); + buffedEclipse = downed.Contains("eclipse"); downedSCal = downed.Contains("supremeCalamitas"); downedBumble = downed.Contains("bumblebirb"); downedCrabulon = downed.Contains("crabulon"); @@ -381,29 +324,34 @@ namespace CalamityMod onionMode = downed.Contains("onionMode"); revenge = downed.Contains("revenge"); downedStarGod = downed.Contains("starGod"); - downedAstrageldon = downed.Contains("astrageldon"); + downedAstrageldon = downed.Contains("astrageldon"); spawnAstralMeteor = downed.Contains("astralMeteor"); spawnAstralMeteor2 = downed.Contains("astralMeteor2"); spawnAstralMeteor3 = downed.Contains("astralMeteor3"); spawnedHardBoss = downed.Contains("hardBoss"); downedPolterghast = downed.Contains("polterghast"); - downedLORDE = downed.Contains("lorde"); - downedBuffedMothron = downed.Contains("moth"); - downedOldDuke = downed.Contains("oldDuke"); - death = downed.Contains("death"); - defiled = downed.Contains("defiled"); - armageddon = downed.Contains("armageddon"); - ironHeart = downed.Contains("ironHeart"); - abyssSide = downed.Contains("abyssSide"); - bossRushActive = downed.Contains("bossRushActive"); - } - #endregion + downedLORDE = downed.Contains("lorde"); + downedBuffedMothron = downed.Contains("moth"); + downedOldDuke = downed.Contains("oldDuke"); + death = downed.Contains("death"); + defiled = downed.Contains("defiled"); + armageddon = downed.Contains("armageddon"); + ironHeart = downed.Contains("ironHeart"); + abyssSide = downed.Contains("abyssSide"); + bossRushActive = downed.Contains("bossRushActive"); + downedCLAM = downed.Contains("clam"); - #region LoadLegacy - public override void LoadLegacy(BinaryReader reader) + abyssChasmBottom = tag.GetInt("abyssChasmBottom"); + } + #endregion + + #region LoadLegacy + public override void LoadLegacy(BinaryReader reader) { int loadVersion = reader.ReadInt32(); - if (loadVersion == 0) + abyssChasmBottom = reader.ReadInt32(); + + if (loadVersion == 0) { BitsByte flags = reader.ReadByte(); downedDesertScourge = flags[0]; @@ -414,7 +362,7 @@ namespace CalamityMod downedBrimstoneElemental = flags[5]; downedCalamitas = flags[6]; downedLeviathan = flags[7]; - + BitsByte flags2 = reader.ReadByte(); downedDoG = flags2[0]; downedPlaguebringer = flags2[1]; @@ -424,7 +372,7 @@ namespace CalamityMod downedSentinel2 = flags2[5]; downedSentinel3 = flags2[6]; downedYharon = flags2[7]; - + BitsByte flags3 = reader.ReadByte(); downedSCal = flags3[0]; downedBumble = flags3[1]; @@ -434,7 +382,7 @@ namespace CalamityMod downedWhar = flags3[5]; downedSkullHead = flags3[6]; downedUgly = flags3[7]; - + BitsByte flags4 = reader.ReadByte(); downedSkeletor = flags4[0]; downedPlantThing = flags4[1]; @@ -444,7 +392,7 @@ namespace CalamityMod demonMode = flags4[5]; onionMode = flags4[6]; revenge = flags4[7]; - + BitsByte flags5 = reader.ReadByte(); downedStarGod = flags5[0]; spawnAstralMeteor = flags5[1]; @@ -452,34 +400,35 @@ namespace CalamityMod spawnAstralMeteor3 = flags5[3]; spawnedHardBoss = flags5[4]; downedPolterghast = flags5[5]; - death = flags5[6]; - downedLORDE = flags5[7]; + death = flags5[6]; + downedLORDE = flags5[7]; - BitsByte flags6 = reader.ReadByte(); - abyssSide = flags6[0]; - downedAquaticScourge = flags6[1]; - downedAstrageldon = flags6[2]; - buffedEclipse = flags6[3]; - armageddon = flags6[4]; - defiled = flags6[5]; - downedBuffedMothron = flags6[6]; - ironHeart = flags6[7]; + BitsByte flags6 = reader.ReadByte(); + abyssSide = flags6[0]; + downedAquaticScourge = flags6[1]; + downedAstrageldon = flags6[2]; + buffedEclipse = flags6[3]; + armageddon = flags6[4]; + defiled = flags6[5]; + downedBuffedMothron = flags6[6]; + ironHeart = flags6[7]; - BitsByte flags7 = reader.ReadByte(); - bossRushActive = flags7[0]; - downedOldDuke = flags7[1]; - } + BitsByte flags7 = reader.ReadByte(); + bossRushActive = flags7[0]; + downedOldDuke = flags7[1]; + downedCLAM = flags7[2]; + } else { ErrorLogger.Log("CalamityMod: Unknown loadVersion: " + loadVersion); } } - #endregion + #endregion - #region NetSend - public override void NetSend(BinaryWriter writer) + #region NetSend + public override void NetSend(BinaryWriter writer) { - BitsByte flags = new BitsByte(); + BitsByte flags = new BitsByte(); flags[0] = downedDesertScourge; flags[1] = downedHiveMind; flags[2] = downedPerforator; @@ -488,7 +437,7 @@ namespace CalamityMod flags[5] = downedBrimstoneElemental; flags[6] = downedCalamitas; flags[7] = downedLeviathan; - + BitsByte flags2 = new BitsByte(); flags2[0] = downedDoG; flags2[1] = downedPlaguebringer; @@ -498,7 +447,7 @@ namespace CalamityMod flags2[5] = downedSentinel2; flags2[6] = downedSentinel3; flags2[7] = downedYharon; - + BitsByte flags3 = new BitsByte(); flags3[0] = downedSCal; flags3[1] = downedBumble; @@ -508,7 +457,7 @@ namespace CalamityMod flags3[5] = downedWhar; flags3[6] = downedSkullHead; flags3[7] = downedUgly; - + BitsByte flags4 = new BitsByte(); flags4[0] = downedSkeletor; flags4[1] = downedPlantThing; @@ -518,7 +467,7 @@ namespace CalamityMod flags4[5] = demonMode; flags4[6] = onionMode; flags4[7] = revenge; - + BitsByte flags5 = new BitsByte(); flags5[0] = downedStarGod; flags5[1] = spawnAstralMeteor; @@ -526,37 +475,39 @@ namespace CalamityMod flags5[3] = spawnAstralMeteor3; flags5[4] = spawnedHardBoss; flags5[5] = downedPolterghast; - flags5[6] = death; - flags5[7] = downedLORDE; + flags5[6] = death; + flags5[7] = downedLORDE; - BitsByte flags6 = new BitsByte(); - flags6[0] = abyssSide; - flags6[1] = downedAquaticScourge; - flags6[2] = downedAstrageldon; - flags6[3] = buffedEclipse; - flags6[4] = armageddon; - flags6[5] = defiled; - flags6[6] = downedBuffedMothron; - flags6[7] = ironHeart; + BitsByte flags6 = new BitsByte(); + flags6[0] = abyssSide; + flags6[1] = downedAquaticScourge; + flags6[2] = downedAstrageldon; + flags6[3] = buffedEclipse; + flags6[4] = armageddon; + flags6[5] = defiled; + flags6[6] = downedBuffedMothron; + flags6[7] = ironHeart; - BitsByte flags7 = new BitsByte(); - flags7[0] = bossRushActive; - flags7[1] = downedOldDuke; + BitsByte flags7 = new BitsByte(); + flags7[0] = bossRushActive; + flags7[1] = downedOldDuke; + flags7[2] = downedCLAM; - writer.Write(flags); + writer.Write(flags); writer.Write(flags2); writer.Write(flags3); writer.Write(flags4); writer.Write(flags5); - writer.Write(flags6); - writer.Write(flags7); - } - #endregion + writer.Write(flags6); + writer.Write(flags7); + writer.Write(abyssChasmBottom); + } + #endregion - #region NetReceive - public override void NetReceive(BinaryReader reader) + #region NetReceive + public override void NetReceive(BinaryReader reader) { - BitsByte flags = reader.ReadByte(); + BitsByte flags = reader.ReadByte(); downedDesertScourge = flags[0]; downedHiveMind = flags[1]; downedPerforator = flags[2]; @@ -565,7 +516,7 @@ namespace CalamityMod downedBrimstoneElemental = flags[5]; downedCalamitas = flags[6]; downedLeviathan = flags[7]; - + BitsByte flags2 = reader.ReadByte(); downedDoG = flags2[0]; downedPlaguebringer = flags2[1]; @@ -575,7 +526,7 @@ namespace CalamityMod downedSentinel2 = flags2[5]; downedSentinel3 = flags2[6]; downedYharon = flags2[7]; - + BitsByte flags3 = reader.ReadByte(); downedSCal = flags3[0]; downedBumble = flags3[1]; @@ -585,7 +536,7 @@ namespace CalamityMod downedWhar = flags3[5]; downedSkullHead = flags3[6]; downedUgly = flags3[7]; - + BitsByte flags4 = reader.ReadByte(); downedSkeletor = flags4[0]; downedPlantThing = flags4[1]; @@ -595,7 +546,7 @@ namespace CalamityMod demonMode = flags4[5]; onionMode = flags4[6]; revenge = flags4[7]; - + BitsByte flags5 = reader.ReadByte(); downedStarGod = flags5[0]; spawnAstralMeteor = flags5[1]; @@ -603,1043 +554,1053 @@ namespace CalamityMod spawnAstralMeteor3 = flags5[3]; spawnedHardBoss = flags5[4]; downedPolterghast = flags5[5]; - death = flags5[6]; - downedLORDE = flags5[7]; + death = flags5[6]; + downedLORDE = flags5[7]; - BitsByte flags6 = reader.ReadByte(); - abyssSide = flags6[0]; - downedAquaticScourge = flags6[1]; - downedAstrageldon = flags6[2]; - buffedEclipse = flags6[3]; - armageddon = flags6[4]; - defiled = flags6[5]; - downedBuffedMothron = flags6[6]; - ironHeart = flags6[7]; + BitsByte flags6 = reader.ReadByte(); + abyssSide = flags6[0]; + downedAquaticScourge = flags6[1]; + downedAstrageldon = flags6[2]; + buffedEclipse = flags6[3]; + armageddon = flags6[4]; + defiled = flags6[5]; + downedBuffedMothron = flags6[6]; + ironHeart = flags6[7]; - BitsByte flags7 = reader.ReadByte(); - bossRushActive = flags7[0]; - downedOldDuke = flags7[1]; - } - #endregion + BitsByte flags7 = reader.ReadByte(); + bossRushActive = flags7[0]; + downedOldDuke = flags7[1]; + downedCLAM = flags7[2]; - #region Tiles - public override void ResetNearbyTileEffects() + abyssChasmBottom = reader.ReadInt32(); + } + #endregion + + #region Tiles + public override void ResetNearbyTileEffects() { calamityTiles = 0; astralTiles = 0; - seaTiles = 0; - sulphurTiles = 0; - abyssTiles = 0; + sunkenSeaTiles = 0; + sulphurTiles = 0; + abyssTiles = 0; } - + public override void TileCountsAvailable(int[] tileCounts) { calamityTiles = tileCounts[mod.TileType("CharredOre")] + tileCounts[mod.TileType("BrimstoneSlag")]; - seaTiles = tileCounts[mod.TileType("EutrophicSand")] + tileCounts[mod.TileType("SeaPrism")]; - abyssTiles = tileCounts[mod.TileType("AbyssGravel")]; - sulphurTiles = tileCounts[mod.TileType("SulphurousSand")]; + sunkenSeaTiles = tileCounts[mod.TileType("EutrophicSand")] + tileCounts[mod.TileType("Navystone")] + tileCounts[mod.TileType("SeaPrism")]; + abyssTiles = tileCounts[mod.TileType("AbyssGravel")]; + sulphurTiles = tileCounts[mod.TileType("SulphurousSand")]; - #region Astral Stuff - int astralDesertTiles = tileCounts[mod.TileType("AstralSand")] + tileCounts[mod.TileType("AstralSandstone")] + tileCounts[mod.TileType("HardenedAstralSand")]; - int astralSnowTiles = tileCounts[mod.TileType("AstralIce")]; - - Main.sandTiles += astralDesertTiles; - Main.snowTiles += astralSnowTiles; - - astralTiles = astralDesertTiles + astralSnowTiles + tileCounts[mod.TileType("AstralDirt")] + tileCounts[mod.TileType("AstralStone")] + tileCounts[mod.TileType("AstralGrass")] + tileCounts[mod.TileType("AstralOre")]; - #endregion - } - #endregion + #region Astral Stuff + int astralDesertTiles = tileCounts[mod.TileType("AstralSand")] + tileCounts[mod.TileType("AstralSandstone")] + tileCounts[mod.TileType("HardenedAstralSand")]; + int astralSnowTiles = tileCounts[mod.TileType("AstralIce")]; - #region PreWorldGen - public override void PreWorldGen() - { - CalamityWorld.numAbyssIslands = 0; - CalamityWorld.genIcePyramid = true; - CalamityWorld.genHellHut = true; - CalamityWorld.genSandHut = true; - CalamityWorld.genEvilHut = true; - CalamityWorld.genPureHut = true; - CalamityWorld.genIceHut = true; - CalamityWorld.genMushroomHut = true; - CalamityWorld.genGraniteHut = true; - CalamityWorld.genMarbleHut = true; - } - #endregion + Main.sandTiles += astralDesertTiles; + Main.snowTiles += astralSnowTiles; - #region ModifyWorldGenTasks - public override void ModifyWorldGenTasks(List tasks, ref float totalWeight) + astralTiles = astralDesertTiles + astralSnowTiles + tileCounts[mod.TileType("AstralDirt")] + tileCounts[mod.TileType("AstralStone")] + tileCounts[mod.TileType("AstralGrass")] + tileCounts[mod.TileType("AstralOre")]; + #endregion + } + #endregion + + #region PreWorldGen + public override void PreWorldGen() { - int ShiniesIndex = tasks.FindIndex(genpass => genpass.Name.Equals("Shinies")); + CalamityWorld.numAbyssIslands = 0; + CalamityWorld.genIcePyramid = true; + CalamityWorld.genHellHut = true; + CalamityWorld.genSandHut = true; + CalamityWorld.genEvilHut = true; + CalamityWorld.genPureHut = true; + CalamityWorld.genIceHut = true; + CalamityWorld.genMushroomHut = true; + CalamityWorld.genGraniteHut = true; + CalamityWorld.genMarbleHut = true; + CalamityWorld.genSwordHut = true; + CalamityWorld.genAbyssHut = true; + } + #endregion + + #region ModifyWorldGenTasks + public override void ModifyWorldGenTasks(List tasks, ref float totalWeight) + { + int ShiniesIndex = tasks.FindIndex(genpass => genpass.Name.Equals("Shinies")); if (ShiniesIndex != -1) { tasks.Insert(ShiniesIndex + 1, new PassLegacy("CalamityOres", delegate (GenerationProgress progress) - { - progress.Message = "Ice Tomb"; - int x = Main.maxTilesX; - int y = Main.maxTilesY; - int genLimit = x / 2; - int generateBack = genLimit - 80; //Small = 2020 - int generateForward = genLimit + 80; //Small = 2180 - #region IceTomb - for (int k = 0; k < (int)((double)(x * y) * 50E-05); k++) - { - int tilesX = WorldGen.genRand.Next(0, generateBack); - int tilesX2 = WorldGen.genRand.Next(generateForward, x); - int tilesY2 = WorldGen.genRand.Next((int)(y * .4f), (int)(y * .5f)); - if ((Main.tile[tilesX, tilesY2].type == 147 || Main.tile[tilesX, tilesY2].type == 161) && CalamityWorld.genIcePyramid) - { - CalamityWorld.genIcePyramid = false; - IcePyramid(tilesX, tilesY2); - } - if ((Main.tile[tilesX2, tilesY2].type == 147 || Main.tile[tilesX2, tilesY2].type == 161) && CalamityWorld.genIcePyramid) - { - CalamityWorld.genIcePyramid = false; - IcePyramid(tilesX2, tilesY2); - } - } - #endregion - #region EvilIslandGen - int xIslandGen = WorldGen.crimson ? - WorldGen.genRand.Next((int)((double)x * 0.1), (int)((double)x * 0.4)) : - WorldGen.genRand.Next((int)((double)x * 0.6), (int)((double)x * 0.9)); - int yIslandGen = WorldGen.genRand.Next(90, 151); - yIslandGen = Math.Min(yIslandGen, (int)WorldGen.worldSurfaceLow - 50); - int tileXLookup = xIslandGen; - if (WorldGen.crimson) - { - while (Main.tile[tileXLookup, yIslandGen].active()) - { - tileXLookup++; - } - } - else - { - while (Main.tile[tileXLookup, yIslandGen].active()) - { - tileXLookup--; - } - } - xIslandGen = tileXLookup; - CalamityWorld.fehX = xIslandGen; - CalamityWorld.fehY = yIslandGen; - EvilIsland(xIslandGen, yIslandGen); - EvilIslandHouse(CalamityWorld.fehX, CalamityWorld.fehY); - #endregion - })); + { + progress.Message = "Ice Tomb"; + int x = Main.maxTilesX; + int y = Main.maxTilesY; + int genLimit = x / 2; + int generateBack = genLimit - 80; //Small = 2020 + int generateForward = genLimit + 80; //Small = 2180 + + #region IceTomb + for (int k = 0; k < (int)((double)(x * y) * 50E-05); k++) + { + int tilesX = WorldGen.genRand.Next(0, generateBack); + int tilesX2 = WorldGen.genRand.Next(generateForward, x); + int tilesY2 = WorldGen.genRand.Next((int)(y * .4f), (int)(y * .5f)); + if ((Main.tile[tilesX, tilesY2].type == TileID.SnowBlock || Main.tile[tilesX, tilesY2].type == TileID.IceBlock) && CalamityWorld.genIcePyramid) + { + CalamityWorld.genIcePyramid = false; + IcePyramid(tilesX, tilesY2); + } + if ((Main.tile[tilesX2, tilesY2].type == TileID.SnowBlock || Main.tile[tilesX2, tilesY2].type == TileID.IceBlock) && CalamityWorld.genIcePyramid) + { + CalamityWorld.genIcePyramid = false; + IcePyramid(tilesX2, tilesY2); + } + } + #endregion + + #region EvilIslandGen + int xIslandGen = WorldGen.crimson ? + WorldGen.genRand.Next((int)((double)x * 0.15), (int)((double)x * 0.2)) : + WorldGen.genRand.Next((int)((double)x * 0.8), (int)((double)x * 0.85)); + int yIslandGen = WorldGen.genRand.Next(90, 151); + yIslandGen = Math.Min(yIslandGen, (int)WorldGen.worldSurfaceLow - 50); + int tileXLookup = xIslandGen; + if (WorldGen.crimson) + { + while (Main.tile[tileXLookup, yIslandGen].active()) + { + tileXLookup++; + } + } + else + { + while (Main.tile[tileXLookup, yIslandGen].active()) + { + tileXLookup--; + } + } + xIslandGen = tileXLookup; + CalamityWorld.fehX = xIslandGen; + CalamityWorld.fehY = yIslandGen; + EvilIsland(xIslandGen, yIslandGen); + EvilIslandHouse(CalamityWorld.fehX, CalamityWorld.fehY); + #endregion + + })); } - int SulphurIndex = tasks.FindIndex(genpass => genpass.Name.Equals("Micro Biomes")); - if (SulphurIndex != -1) - { - tasks.Insert(SulphurIndex + 1, new PassLegacy("Sulphur", delegate (GenerationProgress progress) - { - progress.Message = "Sulphur Beach"; - int x = Main.maxTilesX; - int y = Main.maxTilesY; - int genLimit = x / 2; - if (WorldGen.dungeonX < genLimit) { abyssSide = true; } - int abyssChasmX = (abyssSide ? genLimit - (genLimit - 135) : genLimit + (genLimit - 135)); //2100 - 1965 = 135 : 2100 + 1965 = 4065 - if (abyssSide) - { - for (int abyssIndexSand = 0; abyssIndexSand < abyssChasmX + 240; abyssIndexSand++) - { - for (int abyssIndexSand2 = 0; abyssIndexSand2 < y - 200; abyssIndexSand2++) - { - Tile tile = Framing.GetTileSafely(abyssIndexSand, abyssIndexSand2); - if (abyssIndexSand > abyssChasmX + 225) - { - if (tile.active() && - tile.type == 53 && - WorldGen.genRand.Next(4) == 0) - { - tile.type = (ushort)mod.TileType("SulphurousSand"); - } - else if (tile.active() && - tile.type == 323) - { - tile.active(false); - } - } - else if (abyssIndexSand > abyssChasmX + 210) - { - if (tile.active() && - tile.type == 53 && - WorldGen.genRand.Next(2) == 0) - { - tile.type = (ushort)mod.TileType("SulphurousSand"); - } - else if (tile.active() && - tile.type == 323) - { - tile.active(false); - } - } - else - { - if (tile.active() && - tile.type == 53) - { - tile.type = (ushort)mod.TileType("SulphurousSand"); - } - else if (tile.active() && - tile.type == 323) - { - tile.active(false); - } - } - } - } - } - else - { - for (int abyssIndexSand = abyssChasmX - 240; abyssIndexSand < x; abyssIndexSand++) - { - for (int abyssIndexSand2 = 0; abyssIndexSand2 < y - 200; abyssIndexSand2++) - { - Tile tile = Framing.GetTileSafely(abyssIndexSand, abyssIndexSand2); - if (abyssIndexSand < abyssChasmX - 225) - { - if (tile.active() && - tile.type == 53 && - WorldGen.genRand.Next(4) == 0) - { - tile.type = (ushort)mod.TileType("SulphurousSand"); - } - else if (tile.active() && - tile.type == 323) - { - tile.active(false); - } - } - else if (abyssIndexSand < abyssChasmX - 210) - { - if (tile.active() && - tile.type == 53 && - WorldGen.genRand.Next(2) == 0) - { - tile.type = (ushort)mod.TileType("SulphurousSand"); - } - else if (tile.active() && - tile.type == 323) - { - tile.active(false); - } - } - else - { - if (tile.active() && - tile.type == 53) - { - tile.type = (ushort)mod.TileType("SulphurousSand"); - } - else if (tile.active() && - tile.type == 323) - { - tile.active(false); - } - } - } - } - } - })); - } - int CragIndex = tasks.FindIndex(genpass => genpass.Name.Equals("Final Cleanup")); - if (CragIndex != -1) + int dungeonChestIndex = tasks.FindIndex(genpass => genpass.Name.Equals("Dungeon")); + if (dungeonChestIndex != -1) { - tasks.Insert(CragIndex + 1, new PassLegacy("HellCrag", delegate(GenerationProgress progress) + tasks.Insert(dungeonChestIndex + 1, new PassLegacy("Calamity Mod: Biome Chests", GenerateBiomeChests)); + } + int SulphurIndex = tasks.FindIndex(genpass => genpass.Name.Equals("Micro Biomes")); + if (SulphurIndex != -1) + { + tasks.Insert(SulphurIndex + 1, new PassLegacy("Sulphur", delegate (GenerationProgress progress) + { + progress.Message = "Sulphur Beach"; + int x = Main.maxTilesX; + int y = Main.maxTilesY; + int genLimit = x / 2; + + if (WorldGen.dungeonX < genLimit) + abyssSide = true; + + int abyssChasmX = (abyssSide ? genLimit - (genLimit - 135) : genLimit + (genLimit - 135)); //2100 - 1965 = 135 : 2100 + 1965 = 4065 + + #region SulphurGen + if (abyssSide) + { + for (int abyssIndexSand = 0; abyssIndexSand < abyssChasmX + 240; abyssIndexSand++) + { + for (int abyssIndexSand2 = 0; abyssIndexSand2 < y - 200; abyssIndexSand2++) + { + Tile tile = Framing.GetTileSafely(abyssIndexSand, abyssIndexSand2); + if (abyssIndexSand > abyssChasmX + 225) + { + if (tile.active() && + tile.type == TileID.Sand && + WorldGen.genRand.Next(4) == 0) + { + tile.type = (ushort)mod.TileType("SulphurousSand"); + } + else if (tile.active() && + tile.type == TileID.PalmTree) + { + tile.active(false); + } + } + else if (abyssIndexSand > abyssChasmX + 210) + { + if (tile.active() && + tile.type == TileID.Sand && + WorldGen.genRand.Next(2) == 0) + { + tile.type = (ushort)mod.TileType("SulphurousSand"); + } + else if (tile.active() && + tile.type == TileID.PalmTree) + { + tile.active(false); + } + } + else + { + if (tile.active() && + tile.type == TileID.Sand) + { + tile.type = (ushort)mod.TileType("SulphurousSand"); + } + else if (tile.active() && + tile.type == TileID.PalmTree) + { + tile.active(false); + } + } + } + } + } + else + { + for (int abyssIndexSand = abyssChasmX - 240; abyssIndexSand < x; abyssIndexSand++) + { + for (int abyssIndexSand2 = 0; abyssIndexSand2 < y - 200; abyssIndexSand2++) + { + Tile tile = Framing.GetTileSafely(abyssIndexSand, abyssIndexSand2); + if (abyssIndexSand < abyssChasmX - 225) + { + if (tile.active() && + tile.type == TileID.Sand && + WorldGen.genRand.Next(4) == 0) + { + tile.type = (ushort)mod.TileType("SulphurousSand"); + } + else if (tile.active() && + tile.type == TileID.PalmTree) + { + tile.active(false); + } + } + else if (abyssIndexSand < abyssChasmX - 210) + { + if (tile.active() && + tile.type == TileID.Sand && + WorldGen.genRand.Next(2) == 0) + { + tile.type = (ushort)mod.TileType("SulphurousSand"); + } + else if (tile.active() && + tile.type == TileID.PalmTree) + { + tile.active(false); + } + } + else + { + if (tile.active() && + tile.type == TileID.Sand) + { + tile.type = (ushort)mod.TileType("SulphurousSand"); + } + else if (tile.active() && + tile.type == TileID.PalmTree) + { + tile.active(false); + } + } + } + } + } + #endregion + + })); + } + int FinalIndex = tasks.FindIndex(genpass => genpass.Name.Equals("Final Cleanup")); + if (FinalIndex != -1) + { + tasks.Insert(FinalIndex + 1, new PassLegacy("HellCrag", delegate (GenerationProgress progress) { progress.Message = "Brimstone Crag, Abyss, and Structures"; - int x = Main.maxTilesX; - int y = Main.maxTilesY; - int genLimit = x / 2; - int generateBack = genLimit - 80; //Small = 2020 - int generateForward = genLimit + 80; //Small = 2180 - int rockLayer = (int)Main.rockLayer; - #region AbyssGen - int abyssChasmSteps = y / 4; - int abyssChasmY = (y - abyssChasmSteps) + 100; // (y / 12) - int abyssChasmX = (abyssSide ? genLimit - (genLimit - 135) : genLimit + (genLimit - 135)); //2100 - 1965 = 135 : 2100 + 1965 = 4065 - bool tenebrisSide = true; - if (abyssChasmX < genLimit) { tenebrisSide = false; } - if (abyssSide) - { - for (int abyssIndex = 0; abyssIndex < abyssChasmX + 80; abyssIndex++) //235 - { - for (int abyssIndex2 = 0; abyssIndex2 < abyssChasmY; abyssIndex2++) - { - Tile tile = Framing.GetTileSafely(abyssIndex, abyssIndex2); - if (abyssIndex > abyssChasmX + 75) - { - if (WorldGen.genRand.Next(4) == 0) - { - if (tile.active() && - tile.type != 227 && //dye plants - tile.type != 323 && //trees - tile.type != 53 && //sand - tile.type != 21 && //chests - tile.type != 81 && //coral - tile.type != 324 && //seashells and starfish - tile.type != (ushort)mod.TileType("SulphurousSand")) - { - tile.wall = (ushort)mod.WallType("AbyssGravelWall"); - tile.type = (ushort)mod.TileType("AbyssGravel"); - } - else if (!tile.active() && - abyssIndex2 > rockLayer) - { - tile.active(true); - tile.wall = (ushort)mod.WallType("AbyssGravelWall"); - tile.type = (ushort)mod.TileType("AbyssGravel"); - } - } - } - else if (abyssIndex > abyssChasmX + 70) - { - if (WorldGen.genRand.Next(2) == 0) - { - if (tile.active() && - tile.type != 227 && //dye plants - tile.type != 323 && //trees - tile.type != 53 && //sand - tile.type != 21 && //chests - tile.type != 81 && //coral - tile.type != 324 && //seashells and starfish - tile.type != (ushort)mod.TileType("SulphurousSand")) - { - tile.wall = (ushort)mod.WallType("AbyssGravelWall"); - tile.type = (ushort)mod.TileType("AbyssGravel"); - } - else if (!tile.active() && - abyssIndex2 > rockLayer) - { - tile.active(true); - tile.wall = (ushort)mod.WallType("AbyssGravelWall"); - tile.type = (ushort)mod.TileType("AbyssGravel"); - } - } - } - else - { - if (tile.active() && - tile.type != 227 && //dye plants - tile.type != 323 && //trees - tile.type != 53 && //sand - tile.type != 21 && //chests - tile.type != 81 && //coral - tile.type != 324 && //seashells and starfish - tile.type != (ushort)mod.TileType("SulphurousSand")) - { - if (abyssIndex2 > (rockLayer + y * 0.262)) - { - tile.type = (ushort)mod.TileType("Voidstone"); - tile.wall = (ushort)mod.WallType("VoidstoneWallUnsafe"); - } - else if (abyssIndex2 > (rockLayer + y * 0.143) && WorldGen.genRand.Next(3) == 0) - { - tile.type = (ushort)mod.TileType("Voidstone"); - tile.wall = (ushort)mod.WallType("VoidstoneWallUnsafe"); - } - else - { - tile.type = (ushort)mod.TileType("AbyssGravel"); - tile.wall = (ushort)mod.WallType("AbyssGravelWall"); - } - } - else if (!tile.active() && - abyssIndex2 > rockLayer) - { - tile.active(true); - if (abyssIndex2 > (rockLayer + y * 0.262)) - { - tile.type = (ushort)mod.TileType("Voidstone"); - tile.wall = (ushort)mod.WallType("VoidstoneWallUnsafe"); - } - else if (abyssIndex2 > (rockLayer + y * 0.143) && WorldGen.genRand.Next(3) == 0) - { - tile.type = (ushort)mod.TileType("Voidstone"); - tile.wall = (ushort)mod.WallType("VoidstoneWallUnsafe"); - } - else - { - tile.wall = (ushort)mod.WallType("AbyssGravelWall"); - tile.type = (ushort)mod.TileType("AbyssGravel"); - } - } - } - } - } - } - else - { - for (int abyssIndex = abyssChasmX - 80; abyssIndex < x; abyssIndex++) //3965 - { - for (int abyssIndex2 = 0; abyssIndex2 < abyssChasmY; abyssIndex2++) - { - Tile tile = Framing.GetTileSafely(abyssIndex, abyssIndex2); - if (abyssIndex < abyssChasmX - 75) - { - if (WorldGen.genRand.Next(4) == 0) - { - if (tile.active() && - tile.type != 227 && //dye plants - tile.type != 323 && //trees - tile.type != 53 && //sand - tile.type != 21 && //chests - tile.type != 81 && //coral - tile.type != 324 && //seashells and starfish - tile.type != (ushort)mod.TileType("SulphurousSand")) - { - tile.wall = (ushort)mod.WallType("AbyssGravelWall"); - tile.type = (ushort)mod.TileType("AbyssGravel"); - } - else if (!tile.active() && - abyssIndex2 > rockLayer) - { - tile.active(true); - tile.wall = (ushort)mod.WallType("AbyssGravelWall"); - tile.type = (ushort)mod.TileType("AbyssGravel"); - } - } - } - else if (abyssIndex < abyssChasmX - 70) - { - if (WorldGen.genRand.Next(2) == 0) - { - if (tile.active() && - tile.type != 227 && //dye plants - tile.type != 323 && //trees - tile.type != 53 && //sand - tile.type != 21 && //chests - tile.type != 81 && //coral - tile.type != 324 && //seashells and starfish - tile.type != (ushort)mod.TileType("SulphurousSand")) - { - tile.wall = (ushort)mod.WallType("AbyssGravelWall"); - tile.type = (ushort)mod.TileType("AbyssGravel"); - } - else if (!tile.active() && - abyssIndex2 > rockLayer) - { - tile.active(true); - tile.wall = (ushort)mod.WallType("AbyssGravelWall"); - tile.type = (ushort)mod.TileType("AbyssGravel"); - } - } - } - else - { - if (tile.active() && - tile.type != 227 && //dye plants - tile.type != 323 && //trees - tile.type != 53 && //sand - tile.type != 21 && //chests - tile.type != 81 && //coral - tile.type != 324 && //seashells and starfish - tile.type != (ushort)mod.TileType("SulphurousSand")) - { - if (abyssIndex2 > (rockLayer + y * 0.262)) - { - tile.type = (ushort)mod.TileType("Voidstone"); - tile.wall = (ushort)mod.WallType("VoidstoneWallUnsafe"); - } - else if (abyssIndex2 > (rockLayer + y * 0.143) && WorldGen.genRand.Next(3) == 0) - { - tile.type = (ushort)mod.TileType("Voidstone"); - tile.wall = (ushort)mod.WallType("VoidstoneWallUnsafe"); - } - else - { - tile.type = (ushort)mod.TileType("AbyssGravel"); - tile.wall = (ushort)mod.WallType("AbyssGravelWall"); - } - } - else if (!tile.active() && - abyssIndex2 > rockLayer) - { - tile.active(true); - if (abyssIndex2 > (rockLayer + y * 0.262)) - { - tile.type = (ushort)mod.TileType("Voidstone"); - tile.wall = (ushort)mod.WallType("VoidstoneWallUnsafe"); - } - else if (abyssIndex2 > (rockLayer + y * 0.143) && WorldGen.genRand.Next(3) == 0) - { - tile.type = (ushort)mod.TileType("Voidstone"); - tile.wall = (ushort)mod.WallType("VoidstoneWallUnsafe"); - } - else - { - tile.wall = (ushort)mod.WallType("AbyssGravelWall"); - tile.type = (ushort)mod.TileType("AbyssGravel"); - } - } - } - } - } - } - ChasmGenerator(abyssChasmX, (int)WorldGen.worldSurfaceLow, abyssChasmSteps, true); - int maxAbyssIslands = 11; - if (y > 1500) { maxAbyssIslands = 16; if (y > 2100) { maxAbyssIslands = 20; } } - int islandLocationOffset = 30; - int islandLocationY = rockLayer; - if (CalamityWorld.genAbyssHut) - { - int shrineDepthBoost = 60; - if (y > 1500) { shrineDepthBoost = 120; if (y > 2100) { shrineDepthBoost = 240; } } - CalamityWorld.genAbyssHut = false; - SpecialHut((ushort)mod.TileType("SmoothVoidstone"), (ushort)mod.TileType("Voidstone"), - (ushort)mod.WallType("VoidstoneWallUnsafe"), 9, abyssChasmX, (islandLocationY + (30 * maxAbyssIslands) + shrineDepthBoost)); - } - for (int islands = 0; islands < maxAbyssIslands; islands++) - { - int islandLocationX = abyssChasmX; - int randomIsland = WorldGen.genRand.Next(5); //0 1 2 3 4 - bool hasVoidstone = islandLocationY > (rockLayer + y * 0.143); - CalamityWorld.AbyssIslandY[CalamityWorld.numAbyssIslands] = islandLocationY; - switch (randomIsland) - { - case 0: - AbyssIsland(islandLocationX, islandLocationY, 60, 66, 30, 36, true, false, hasVoidstone); - AbyssIsland(islandLocationX + 40, islandLocationY + 15, 60, 66, 30, 36, false, tenebrisSide, hasVoidstone); - AbyssIsland(islandLocationX - 40, islandLocationY + 15, 60, 66, 30, 36, false, !tenebrisSide, hasVoidstone); - break; - case 1: - AbyssIsland(islandLocationX + 30, islandLocationY, 60, 66, 30, 36, true, false, hasVoidstone); - AbyssIsland(islandLocationX, islandLocationY + 15, 60, 66, 30, 36, false, tenebrisSide, hasVoidstone); - AbyssIsland(islandLocationX - 40, islandLocationY + 10, 60, 66, 30, 36, false, !tenebrisSide, hasVoidstone); - islandLocationX += 30; - break; - case 2: - AbyssIsland(islandLocationX - 30, islandLocationY, 60, 66, 30, 36, true, false, hasVoidstone); - AbyssIsland(islandLocationX + 30, islandLocationY + 10, 60, 66, 30, 36, false, tenebrisSide, hasVoidstone); - AbyssIsland(islandLocationX, islandLocationY + 15, 60, 66, 30, 36, false, !tenebrisSide, hasVoidstone); - islandLocationX -= 30; - break; - case 3: - AbyssIsland(islandLocationX + 25, islandLocationY, 60, 66, 30, 36, true, false, hasVoidstone); - AbyssIsland(islandLocationX - 5, islandLocationY + 5, 60, 66, 30, 36, false, tenebrisSide, hasVoidstone); - AbyssIsland(islandLocationX - 35, islandLocationY + 15, 60, 66, 30, 36, false, !tenebrisSide, hasVoidstone); - islandLocationX += 25; - break; - case 4: - AbyssIsland(islandLocationX - 25, islandLocationY, 60, 66, 30, 36, true, false, hasVoidstone); - AbyssIsland(islandLocationX + 5, islandLocationY + 15, 60, 66, 30, 36, false, tenebrisSide, hasVoidstone); - AbyssIsland(islandLocationX + 35, islandLocationY + 5, 60, 66, 30, 36, false, !tenebrisSide, hasVoidstone); - islandLocationX -= 25; - break; - } - CalamityWorld.AbyssIslandX[CalamityWorld.numAbyssIslands] = islandLocationX; - CalamityWorld.numAbyssIslands++; - islandLocationY += islandLocationOffset; - } - CalamityWorld.AbyssItemArray = ShuffleArray(CalamityWorld.AbyssItemArray); - for (int abyssHouse = 0; abyssHouse < CalamityWorld.numAbyssIslands; abyssHouse++) //11 15 19 - { - if (abyssHouse != 20) - AbyssIslandHouse(CalamityWorld.AbyssIslandX[abyssHouse], - CalamityWorld.AbyssIslandY[abyssHouse], - CalamityWorld.AbyssItemArray[(abyssHouse > 9 ? (abyssHouse - 10) : abyssHouse)], //10 choices 0 to 9 - CalamityWorld.AbyssIslandY[abyssHouse] > (rockLayer + y * 0.143)); - } - if (abyssSide) - { - for (int abyssIndex = 0; abyssIndex < abyssChasmX + 80; abyssIndex++) //235 - { - for (int abyssIndex2 = 0; abyssIndex2 < abyssChasmY; abyssIndex2++) - { - if (!Main.tile[abyssIndex, abyssIndex2].active()) - { - if (WorldGen.SolidTile(abyssIndex, abyssIndex2 + 1) && - abyssIndex2 > rockLayer) - { - if (WorldGen.genRand.Next(5) == 0) - { - int style = WorldGen.genRand.Next(13, 16); - WorldGen.PlacePot(abyssIndex, abyssIndex2, 28, style); - SafeSquareTileFrame(abyssIndex, abyssIndex2, true); - } - } - else if (WorldGen.SolidTile(abyssIndex, abyssIndex2 + 1) && - abyssIndex2 < (int)Main.worldSurface) - { - if (WorldGen.genRand.Next(3) == 0) - { - int style = WorldGen.genRand.Next(25, 28); - WorldGen.PlacePot(abyssIndex, abyssIndex2, 28, style); - SafeSquareTileFrame(abyssIndex, abyssIndex2, true); - } - } - } - } - } - } - else - { - for (int abyssIndex = abyssChasmX - 80; abyssIndex < x; abyssIndex++) //3965 - { - for (int abyssIndex2 = 0; abyssIndex2 < abyssChasmY; abyssIndex2++) - { - if (!Main.tile[abyssIndex, abyssIndex2].active()) - { - if (WorldGen.SolidTile(abyssIndex, abyssIndex2 + 1) && - abyssIndex2 > rockLayer) - { - if (WorldGen.genRand.Next(5) == 0) - { - int style = WorldGen.genRand.Next(13, 16); - WorldGen.PlacePot(abyssIndex, abyssIndex2, 28, style); - SafeSquareTileFrame(abyssIndex, abyssIndex2, true); - } - } - else if (WorldGen.SolidTile(abyssIndex, abyssIndex2 + 1) && - abyssIndex2 < (int)Main.worldSurface) - { - if (WorldGen.genRand.Next(3) == 0) - { - int style = WorldGen.genRand.Next(25, 28); - WorldGen.PlacePot(abyssIndex, abyssIndex2, 28, style); - SafeSquareTileFrame(abyssIndex, abyssIndex2, true); - } - } - } - } - } - } - #endregion - #region Shrines - for (int k = 0; k < (int)((double)(x * y) * 50E-05); k++) - { - int tilesX = WorldGen.genRand.Next(0, generateBack); - int tilesX2 = WorldGen.genRand.Next(generateForward, x); - int tilesX3 = WorldGen.genRand.Next((int)((double)x * 0.3), generateBack); - int tilesX4 = WorldGen.genRand.Next(generateForward, (int)((double)x * 0.6)); - int tilesX5 = WorldGen.genRand.Next((int)((double)x * 0.97), (int)((double)x * 0.98)); - int tilesY3 = WorldGen.genRand.Next((int)(y * .3f), (int)(y * .35f)); - int tilesY4 = WorldGen.genRand.Next((int)(y * .35f), (int)(y * .5f)); - int tilesY5 = WorldGen.genRand.Next((int)(y * .55f), (int)(y * .8f)); - int tilesY6 = y - 60; - if ((Main.tile[tilesX3, tilesY3].type == 0 || Main.tile[tilesX3, tilesY3].type == 1) && CalamityWorld.genPureHut) - { - CalamityWorld.genPureHut = false; - SpecialHut((ushort)39, (ushort)0, (byte)6, 0, tilesX3, tilesY3); //red brick, dirt, red brick wall - } - if ((Main.tile[tilesX4, tilesY3].type == 0 || Main.tile[tilesX4, tilesY3].type == 1) && CalamityWorld.genPureHut) - { - CalamityWorld.genPureHut = false; - SpecialHut((ushort)39, (ushort)0, (byte)6, 0, tilesX4, tilesY3); - } - if (Main.tile[tilesX, tilesY3].type == (ushort)(WorldGen.crimson ? 203 : 25) && CalamityWorld.genEvilHut) - { - CalamityWorld.genEvilHut = false; - SpecialHut((ushort)(WorldGen.crimson ? 347 : 140), (ushort)(WorldGen.crimson ? 203 : 25), (byte)(WorldGen.crimson ? 174 : 33), 1, tilesX, tilesY3); //crimstone brick, crimstone, crimstone brick wall - } - if (Main.tile[tilesX2, tilesY3].type == (ushort)(WorldGen.crimson ? 203 : 25) && CalamityWorld.genEvilHut) - { - CalamityWorld.genEvilHut = false; - SpecialHut((ushort)(WorldGen.crimson ? 347 : 140), (ushort)(WorldGen.crimson ? 203 : 25), (byte)(WorldGen.crimson ? 174 : 33), 1, tilesX2, tilesY3); - } - if (Main.tile[tilesX3, tilesY5].type == 1 && CalamityWorld.genHellHut) - { - CalamityWorld.genHellHut = false; - SpecialHut((ushort)75, (ushort)56, (byte)20, 2, tilesX3, tilesY5); //obsidian brick, obsidian, obsidian brick wall - } - if (Main.tile[tilesX4, tilesY5].type == 1 && CalamityWorld.genHellHut) - { - CalamityWorld.genHellHut = false; - SpecialHut((ushort)75, (ushort)56, (byte)20, 2, tilesX4, tilesY5); - } - if (Main.tile[tilesX, tilesY4].type == 161 && CalamityWorld.genIceHut) - { - CalamityWorld.genIceHut = false; - SpecialHut((ushort)206, (ushort)161, (byte)84, 3, tilesX, tilesY4); //ice brick, ice, ice brick wall - } - if (Main.tile[tilesX2, tilesY4].type == 161 && CalamityWorld.genIceHut) - { - CalamityWorld.genIceHut = false; - SpecialHut((ushort)206, (ushort)161, (byte)84, 3, tilesX2, tilesY4); - } - if (Main.tile[tilesX, tilesY4].type == 404 && CalamityWorld.genSandHut) - { - CalamityWorld.genSandHut = false; - SpecialHut((ushort)404, (ushort)396, (byte)223, 4, tilesX, tilesY4); //fossil, sand, fossil wall - } - if (Main.tile[tilesX2, tilesY4].type == 404 && CalamityWorld.genSandHut) - { - CalamityWorld.genSandHut = false; - SpecialHut((ushort)404, (ushort)396, (byte)223, 4, tilesX2, tilesY4); - } - if (Main.tile[tilesX3, tilesY4].type == 59 && CalamityWorld.genMushroomHut) - { - CalamityWorld.genMushroomHut = false; - SpecialHut((ushort)190, (ushort)59, (byte)74, 5, tilesX3, tilesY4); //mushroom block, mud, mushroom wall - } - if (Main.tile[tilesX4, tilesY4].type == 59 && CalamityWorld.genMushroomHut) - { - CalamityWorld.genMushroomHut = false; - SpecialHut((ushort)190, (ushort)59, (byte)74, 5, tilesX4, tilesY4); - } - if (Main.tile[tilesX, tilesY4].type == 368 && CalamityWorld.genGraniteHut) - { - CalamityWorld.genGraniteHut = false; - SpecialHut((ushort)369, (ushort)368, (byte)181, 6, tilesX, tilesY4); //granite brick, granite, granite brick wall - } - if (Main.tile[tilesX2, tilesY4].type == 368 && CalamityWorld.genGraniteHut) - { - CalamityWorld.genGraniteHut = false; - SpecialHut((ushort)369, (ushort)368, (byte)181, 6, tilesX2, tilesY4); - } - if (Main.tile[tilesX, tilesY4].type == 367 && CalamityWorld.genMarbleHut) - { - CalamityWorld.genMarbleHut = false; - SpecialHut((ushort)357, (ushort)367, (byte)179, 7, tilesX, tilesY4); //marble brick, marble, marble brick wall - } - if (Main.tile[tilesX2, tilesY4].type == 367 && CalamityWorld.genMarbleHut) - { - CalamityWorld.genMarbleHut = false; - SpecialHut((ushort)357, (ushort)367, (byte)179, 7, tilesX2, tilesY4); - } - if (CalamityWorld.genSwordHut) - { - CalamityWorld.genSwordHut = false; - SpecialHut((ushort)76, (ushort)58, (byte)177, 8, tilesX5, tilesY6); - } - } - #endregion - #region Crag - int xUnderworldGen = WorldGen.genRand.Next((int)((double)x * 0.1), (int)((double)x * 0.15)); - int yUnderworldGen = y - 100; - CalamityWorld.fuhX = xUnderworldGen; - CalamityWorld.fuhY = yUnderworldGen; - UnderworldIsland(xUnderworldGen, yUnderworldGen, 180, 201, 120, 136); - UnderworldIsland(xUnderworldGen - 50, yUnderworldGen - 30, 100, 111, 60, 71); - UnderworldIsland(xUnderworldGen + 50, yUnderworldGen - 30, 100, 111, 60, 71); - ChasmGenerator(CalamityWorld.fuhX - 110, CalamityWorld.fuhY - 10, WorldGen.genRand.Next(150) + 150); - ChasmGenerator(CalamityWorld.fuhX + 110, CalamityWorld.fuhY - 10, WorldGen.genRand.Next(150) + 150); - UnderworldIsland(xUnderworldGen - 150, yUnderworldGen - 30, 60, 66, 35, 41); - UnderworldIsland(xUnderworldGen + 150, yUnderworldGen - 30, 60, 66, 35, 41); - UnderworldIsland(xUnderworldGen - 180, yUnderworldGen - 20, 60, 66, 35, 41); - UnderworldIsland(xUnderworldGen + 180, yUnderworldGen - 20, 60, 66, 35, 41); - UnderworldIslandHouse(CalamityWorld.fuhX, CalamityWorld.fuhY + 30, 1323); - UnderworldIslandHouse(CalamityWorld.fuhX - 22, CalamityWorld.fuhY + 15, 1322); - UnderworldIslandHouse(CalamityWorld.fuhX + 22, CalamityWorld.fuhY + 15, 535); - UnderworldIslandHouse(CalamityWorld.fuhX - 50, CalamityWorld.fuhY - 30, 112); - UnderworldIslandHouse(CalamityWorld.fuhX + 50, CalamityWorld.fuhY - 30, 906); - UnderworldIslandHouse(CalamityWorld.fuhX - 150, CalamityWorld.fuhY - 30, 218); - UnderworldIslandHouse(CalamityWorld.fuhX + 150, CalamityWorld.fuhY - 30, 3019); - UnderworldIslandHouse(CalamityWorld.fuhX - 180, CalamityWorld.fuhY - 20, 274); - UnderworldIslandHouse(CalamityWorld.fuhX + 180, CalamityWorld.fuhY - 20, 220); - #endregion - })); + int x = Main.maxTilesX; + int y = Main.maxTilesY; + int genLimit = x / 2; + int generateBack = genLimit - 80; //Small = 2020 + int generateForward = genLimit + 80; //Small = 2180 + int rockLayer = (int)Main.rockLayer; + + #region AbyssGen + int abyssChasmY = y - 250; //Underworld = y - 200 + abyssChasmBottom = abyssChasmY - 100; //850 small 1450 medium 2050 large + int abyssChasmX = (abyssSide ? genLimit - (genLimit - 135) : genLimit + (genLimit - 135)); //2100 - 1965 = 135 : 2100 + 1965 = 4065 + bool tenebrisSide = true; + if (abyssChasmX < genLimit) { tenebrisSide = false; } + if (abyssSide) + { + for (int abyssIndex = 0; abyssIndex < abyssChasmX + 80; abyssIndex++) //235 + { + for (int abyssIndex2 = 0; abyssIndex2 < abyssChasmY; abyssIndex2++) + { + Tile tile = Framing.GetTileSafely(abyssIndex, abyssIndex2); + bool canConvert = tile.active() && + tile.type < TileID.Count && + tile.type != TileID.DyePlants && + tile.type != TileID.Trees && + tile.type != TileID.PalmTree && + tile.type != TileID.Sand && + tile.type != TileID.Containers && + tile.type != TileID.Coral && + tile.type != TileID.BeachPiles; + if (abyssIndex > abyssChasmX + 75) + { + if (WorldGen.genRand.Next(4) == 0) + { + if (canConvert) + { + tile.wall = (ushort)mod.WallType("AbyssGravelWall"); + tile.type = (ushort)mod.TileType("AbyssGravel"); + } + else if (!tile.active() && + abyssIndex2 > rockLayer) + { + tile.active(true); + tile.wall = (ushort)mod.WallType("AbyssGravelWall"); + tile.type = (ushort)mod.TileType("AbyssGravel"); + } + } + } + else if (abyssIndex > abyssChasmX + 70) + { + if (WorldGen.genRand.Next(2) == 0) + { + if (canConvert) + { + tile.wall = (ushort)mod.WallType("AbyssGravelWall"); + tile.type = (ushort)mod.TileType("AbyssGravel"); + } + else if (!tile.active() && + abyssIndex2 > rockLayer) + { + tile.active(true); + tile.wall = (ushort)mod.WallType("AbyssGravelWall"); + tile.type = (ushort)mod.TileType("AbyssGravel"); + } + } + } + else + { + if (canConvert) + { + if (abyssIndex2 > (rockLayer + y * 0.262)) + { + tile.type = (ushort)mod.TileType("Voidstone"); + tile.wall = (ushort)mod.WallType("VoidstoneWallUnsafe"); + } + else if (abyssIndex2 > (rockLayer + y * 0.143) && WorldGen.genRand.Next(3) == 0) + { + tile.type = (ushort)mod.TileType("Voidstone"); + tile.wall = (ushort)mod.WallType("VoidstoneWallUnsafe"); + } + else + { + tile.type = (ushort)mod.TileType("AbyssGravel"); + tile.wall = (ushort)mod.WallType("AbyssGravelWall"); + } + } + else if (!tile.active() && + abyssIndex2 > rockLayer) + { + tile.active(true); + if (abyssIndex2 > (rockLayer + y * 0.262)) + { + tile.type = (ushort)mod.TileType("Voidstone"); + tile.wall = (ushort)mod.WallType("VoidstoneWallUnsafe"); + } + else if (abyssIndex2 > (rockLayer + y * 0.143) && WorldGen.genRand.Next(3) == 0) + { + tile.type = (ushort)mod.TileType("Voidstone"); + tile.wall = (ushort)mod.WallType("VoidstoneWallUnsafe"); + } + else + { + tile.wall = (ushort)mod.WallType("AbyssGravelWall"); + tile.type = (ushort)mod.TileType("AbyssGravel"); + } + } + } + } + } + } + else + { + for (int abyssIndex = abyssChasmX - 80; abyssIndex < x; abyssIndex++) //3965 + { + for (int abyssIndex2 = 0; abyssIndex2 < abyssChasmY; abyssIndex2++) + { + Tile tile = Framing.GetTileSafely(abyssIndex, abyssIndex2); + bool canConvert = tile.active() && + tile.type < TileID.Count && + tile.type != TileID.DyePlants && + tile.type != TileID.Trees && + tile.type != TileID.PalmTree && + tile.type != TileID.Sand && + tile.type != TileID.Containers && + tile.type != TileID.Coral && + tile.type != TileID.BeachPiles; + if (abyssIndex < abyssChasmX - 75) + { + if (WorldGen.genRand.Next(4) == 0) + { + if (canConvert) + { + tile.wall = (ushort)mod.WallType("AbyssGravelWall"); + tile.type = (ushort)mod.TileType("AbyssGravel"); + } + else if (!tile.active() && + abyssIndex2 > rockLayer) + { + tile.active(true); + tile.wall = (ushort)mod.WallType("AbyssGravelWall"); + tile.type = (ushort)mod.TileType("AbyssGravel"); + } + } + } + else if (abyssIndex < abyssChasmX - 70) + { + if (WorldGen.genRand.Next(2) == 0) + { + if (canConvert) + { + tile.wall = (ushort)mod.WallType("AbyssGravelWall"); + tile.type = (ushort)mod.TileType("AbyssGravel"); + } + else if (!tile.active() && + abyssIndex2 > rockLayer) + { + tile.active(true); + tile.wall = (ushort)mod.WallType("AbyssGravelWall"); + tile.type = (ushort)mod.TileType("AbyssGravel"); + } + } + } + else + { + if (canConvert) + { + if (abyssIndex2 > (rockLayer + y * 0.262)) + { + tile.type = (ushort)mod.TileType("Voidstone"); + tile.wall = (ushort)mod.WallType("VoidstoneWallUnsafe"); + } + else if (abyssIndex2 > (rockLayer + y * 0.143) && WorldGen.genRand.Next(3) == 0) + { + tile.type = (ushort)mod.TileType("Voidstone"); + tile.wall = (ushort)mod.WallType("VoidstoneWallUnsafe"); + } + else + { + tile.type = (ushort)mod.TileType("AbyssGravel"); + tile.wall = (ushort)mod.WallType("AbyssGravelWall"); + } + } + else if (!tile.active() && + abyssIndex2 > rockLayer) + { + tile.active(true); + if (abyssIndex2 > (rockLayer + y * 0.262)) + { + tile.type = (ushort)mod.TileType("Voidstone"); + tile.wall = (ushort)mod.WallType("VoidstoneWallUnsafe"); + } + else if (abyssIndex2 > (rockLayer + y * 0.143) && WorldGen.genRand.Next(3) == 0) + { + tile.type = (ushort)mod.TileType("Voidstone"); + tile.wall = (ushort)mod.WallType("VoidstoneWallUnsafe"); + } + else + { + tile.wall = (ushort)mod.WallType("AbyssGravelWall"); + tile.type = (ushort)mod.TileType("AbyssGravel"); + } + } + } + } + } + } + ChasmGenerator(abyssChasmX, (int)WorldGen.worldSurfaceLow, abyssChasmBottom, true); + int maxAbyssIslands = 11; + if (y > 1500) { maxAbyssIslands = 16; if (y > 2100) { maxAbyssIslands = 20; } } + int islandLocationOffset = 30; + int islandLocationY = rockLayer; + if (CalamityWorld.genAbyssHut) //sometimes it works, sometimes it doesn't, wtf + { + CalamityWorld.genAbyssHut = false; + SpecialHut((ushort)mod.TileType("SmoothVoidstone"), (ushort)mod.TileType("Voidstone"), + (ushort)mod.WallType("VoidstoneWallUnsafe"), 9, abyssChasmX, abyssChasmBottom); + } + for (int islands = 0; islands < maxAbyssIslands; islands++) + { + int islandLocationX = abyssChasmX; + int randomIsland = WorldGen.genRand.Next(5); //0 1 2 3 4 + bool hasVoidstone = islandLocationY > (rockLayer + y * 0.143); + CalamityWorld.AbyssIslandY[CalamityWorld.numAbyssIslands] = islandLocationY; + switch (randomIsland) + { + case 0: + AbyssIsland(islandLocationX, islandLocationY, 60, 66, 30, 36, true, false, hasVoidstone); + AbyssIsland(islandLocationX + 40, islandLocationY + 15, 60, 66, 30, 36, false, tenebrisSide, hasVoidstone); + AbyssIsland(islandLocationX - 40, islandLocationY + 15, 60, 66, 30, 36, false, !tenebrisSide, hasVoidstone); + break; + case 1: + AbyssIsland(islandLocationX + 30, islandLocationY, 60, 66, 30, 36, true, false, hasVoidstone); + AbyssIsland(islandLocationX, islandLocationY + 15, 60, 66, 30, 36, false, tenebrisSide, hasVoidstone); + AbyssIsland(islandLocationX - 40, islandLocationY + 10, 60, 66, 30, 36, false, !tenebrisSide, hasVoidstone); + islandLocationX += 30; + break; + case 2: + AbyssIsland(islandLocationX - 30, islandLocationY, 60, 66, 30, 36, true, false, hasVoidstone); + AbyssIsland(islandLocationX + 30, islandLocationY + 10, 60, 66, 30, 36, false, tenebrisSide, hasVoidstone); + AbyssIsland(islandLocationX, islandLocationY + 15, 60, 66, 30, 36, false, !tenebrisSide, hasVoidstone); + islandLocationX -= 30; + break; + case 3: + AbyssIsland(islandLocationX + 25, islandLocationY, 60, 66, 30, 36, true, false, hasVoidstone); + AbyssIsland(islandLocationX - 5, islandLocationY + 5, 60, 66, 30, 36, false, tenebrisSide, hasVoidstone); + AbyssIsland(islandLocationX - 35, islandLocationY + 15, 60, 66, 30, 36, false, !tenebrisSide, hasVoidstone); + islandLocationX += 25; + break; + case 4: + AbyssIsland(islandLocationX - 25, islandLocationY, 60, 66, 30, 36, true, false, hasVoidstone); + AbyssIsland(islandLocationX + 5, islandLocationY + 15, 60, 66, 30, 36, false, tenebrisSide, hasVoidstone); + AbyssIsland(islandLocationX + 35, islandLocationY + 5, 60, 66, 30, 36, false, !tenebrisSide, hasVoidstone); + islandLocationX -= 25; + break; + } + CalamityWorld.AbyssIslandX[CalamityWorld.numAbyssIslands] = islandLocationX; + CalamityWorld.numAbyssIslands++; + islandLocationY += islandLocationOffset; + } + CalamityWorld.AbyssItemArray = ShuffleArray(CalamityWorld.AbyssItemArray); + for (int abyssHouse = 0; abyssHouse < CalamityWorld.numAbyssIslands; abyssHouse++) //11 15 19 + { + if (abyssHouse != 20) + AbyssIslandHouse(CalamityWorld.AbyssIslandX[abyssHouse], + CalamityWorld.AbyssIslandY[abyssHouse], + CalamityWorld.AbyssItemArray[(abyssHouse > 9 ? (abyssHouse - 10) : abyssHouse)], //10 choices 0 to 9 + CalamityWorld.AbyssIslandY[abyssHouse] > (rockLayer + y * 0.143)); + } + if (abyssSide) + { + for (int abyssIndex = 0; abyssIndex < abyssChasmX + 80; abyssIndex++) //235 + { + for (int abyssIndex2 = 0; abyssIndex2 < abyssChasmY; abyssIndex2++) + { + if (!Main.tile[abyssIndex, abyssIndex2].active()) + { + if (WorldGen.SolidTile(abyssIndex, abyssIndex2 + 1) && + abyssIndex2 > rockLayer) + { + if (WorldGen.genRand.Next(5) == 0) + { + int style = WorldGen.genRand.Next(13, 16); + WorldGen.PlacePot(abyssIndex, abyssIndex2, 28, style); + SafeSquareTileFrame(abyssIndex, abyssIndex2, true); + } + } + else if (WorldGen.SolidTile(abyssIndex, abyssIndex2 + 1) && + abyssIndex2 < (int)Main.worldSurface) + { + if (WorldGen.genRand.Next(3) == 0) + { + int style = WorldGen.genRand.Next(25, 28); + WorldGen.PlacePot(abyssIndex, abyssIndex2, 28, style); + SafeSquareTileFrame(abyssIndex, abyssIndex2, true); + } + } + } + } + } + } + else + { + for (int abyssIndex = abyssChasmX - 80; abyssIndex < x; abyssIndex++) //3965 + { + for (int abyssIndex2 = 0; abyssIndex2 < abyssChasmY; abyssIndex2++) + { + if (!Main.tile[abyssIndex, abyssIndex2].active()) + { + if (WorldGen.SolidTile(abyssIndex, abyssIndex2 + 1) && + abyssIndex2 > rockLayer) + { + if (WorldGen.genRand.Next(5) == 0) + { + int style = WorldGen.genRand.Next(13, 16); + WorldGen.PlacePot(abyssIndex, abyssIndex2, 28, style); + SafeSquareTileFrame(abyssIndex, abyssIndex2, true); + } + } + else if (WorldGen.SolidTile(abyssIndex, abyssIndex2 + 1) && + abyssIndex2 < (int)Main.worldSurface) + { + if (WorldGen.genRand.Next(3) == 0) + { + int style = WorldGen.genRand.Next(25, 28); + WorldGen.PlacePot(abyssIndex, abyssIndex2, 28, style); + SafeSquareTileFrame(abyssIndex, abyssIndex2, true); + } + } + } + } + } + } + #endregion + + #region Shrines + for (int k = 0; k < (int)((double)(x * y) * 50E-05); k++) + { + int tilesX = WorldGen.genRand.Next(0, generateBack); + int tilesX2 = WorldGen.genRand.Next(generateForward, x); + int tilesX3 = WorldGen.genRand.Next((int)((double)x * 0.3), generateBack); + int tilesX4 = WorldGen.genRand.Next(generateForward, (int)((double)x * 0.6)); + int tilesX5 = WorldGen.genRand.Next((int)((double)x * 0.97), (int)((double)x * 0.98)); + int tilesY3 = WorldGen.genRand.Next((int)(y * .3f), (int)(y * .35f)); + int tilesY4 = WorldGen.genRand.Next((int)(y * .35f), (int)(y * .5f)); + int tilesY5 = WorldGen.genRand.Next((int)(y * .55f), (int)(y * .8f)); + int tilesY6 = y - 60; + if ((Main.tile[tilesX3, tilesY3].type == TileID.Dirt || Main.tile[tilesX3, tilesY3].type == TileID.Stone) && CalamityWorld.genPureHut) + { + CalamityWorld.genPureHut = false; + SpecialHut(TileID.RedBrick, TileID.Dirt, WallID.RedBrick, 0, tilesX3, tilesY3); //red brick, dirt, red brick wall + } + if ((Main.tile[tilesX4, tilesY3].type == TileID.Dirt || Main.tile[tilesX4, tilesY3].type == TileID.Stone) && CalamityWorld.genPureHut) + { + CalamityWorld.genPureHut = false; + SpecialHut(TileID.RedBrick, TileID.Dirt, WallID.RedBrick, 0, tilesX4, tilesY3); + } + if (Main.tile[tilesX, tilesY3].type == (WorldGen.crimson ? TileID.Crimstone : TileID.Ebonstone) && CalamityWorld.genEvilHut) + { + CalamityWorld.genEvilHut = false; + SpecialHut(WorldGen.crimson ? TileID.CrimtaneBrick : TileID.DemoniteBrick, + WorldGen.crimson ? TileID.Crimstone : TileID.Ebonstone, + WorldGen.crimson ? WallID.CrimtaneBrick : WallID.DemoniteBrick, 1, tilesX, tilesY3); //crimstone brick, crimstone, crimstone brick wall + } + if (Main.tile[tilesX2, tilesY3].type == (WorldGen.crimson ? TileID.Crimstone : TileID.Ebonstone) && CalamityWorld.genEvilHut) + { + CalamityWorld.genEvilHut = false; + SpecialHut(WorldGen.crimson ? TileID.CrimtaneBrick : TileID.DemoniteBrick, + WorldGen.crimson ? TileID.Crimstone : TileID.Ebonstone, + WorldGen.crimson ? WallID.CrimtaneBrick : WallID.DemoniteBrick, 1, tilesX2, tilesY3); + } + if (Main.tile[tilesX3, tilesY5].type == TileID.Stone && CalamityWorld.genHellHut) + { + CalamityWorld.genHellHut = false; + SpecialHut(TileID.ObsidianBrick, TileID.Obsidian, WallID.ObsidianBrick, 2, tilesX3, tilesY5); //obsidian brick, obsidian, obsidian brick wall + } + if (Main.tile[tilesX4, tilesY5].type == TileID.Stone && CalamityWorld.genHellHut) + { + CalamityWorld.genHellHut = false; + SpecialHut(TileID.ObsidianBrick, TileID.Obsidian, WallID.ObsidianBrick, 2, tilesX4, tilesY5); + } + if (Main.tile[tilesX, tilesY4].type == TileID.IceBlock && CalamityWorld.genIceHut) + { + CalamityWorld.genIceHut = false; + SpecialHut(TileID.IceBrick, TileID.IceBlock, WallID.IceBrick, 3, tilesX, tilesY4); + } + if (Main.tile[tilesX2, tilesY4].type == TileID.IceBlock && CalamityWorld.genIceHut) + { + CalamityWorld.genIceHut = false; + SpecialHut(TileID.IceBrick, TileID.IceBlock, WallID.IceBrick, 3, tilesX2, tilesY4); + } + if (Main.tile[tilesX, tilesY4].type == TileID.DesertFossil && CalamityWorld.genSandHut) + { + CalamityWorld.genSandHut = false; + SpecialHut(TileID.DesertFossil, TileID.Sandstone, WallID.DesertFossil, 4, tilesX, tilesY4); + } + if (Main.tile[tilesX2, tilesY4].type == TileID.DesertFossil && CalamityWorld.genSandHut) + { + CalamityWorld.genSandHut = false; + SpecialHut(TileID.DesertFossil, TileID.Sandstone, WallID.DesertFossil, 4, tilesX2, tilesY4); + } + if (Main.tile[tilesX3, tilesY4].type == TileID.MushroomGrass && CalamityWorld.genMushroomHut) + { + CalamityWorld.genMushroomHut = false; + SpecialHut(TileID.MushroomBlock, TileID.Mud, WallID.MushroomUnsafe, 5, tilesX3, tilesY4); + } + if (Main.tile[tilesX4, tilesY4].type == TileID.MushroomGrass && CalamityWorld.genMushroomHut) + { + CalamityWorld.genMushroomHut = false; + SpecialHut(TileID.MushroomBlock, TileID.Mud, WallID.MushroomUnsafe, 5, tilesX4, tilesY4); + } + if (Main.tile[tilesX, tilesY4].type == TileID.Granite && CalamityWorld.genGraniteHut) + { + CalamityWorld.genGraniteHut = false; + SpecialHut(TileID.GraniteBlock, TileID.Granite, WallID.GraniteUnsafe, 6, tilesX, tilesY4); + } + if (Main.tile[tilesX2, tilesY4].type == TileID.Granite && CalamityWorld.genGraniteHut) + { + CalamityWorld.genGraniteHut = false; + SpecialHut(TileID.GraniteBlock, TileID.Granite, WallID.GraniteUnsafe, 6, tilesX2, tilesY4); + } + if (Main.tile[tilesX, tilesY4].type == TileID.Marble && CalamityWorld.genMarbleHut) + { + CalamityWorld.genMarbleHut = false; + SpecialHut(TileID.MarbleBlock, TileID.Marble, WallID.MarbleUnsafe, 7, tilesX, tilesY4); + } + if (Main.tile[tilesX2, tilesY4].type == TileID.Marble && CalamityWorld.genMarbleHut) + { + CalamityWorld.genMarbleHut = false; + SpecialHut(TileID.MarbleBlock, TileID.Marble, WallID.MarbleUnsafe, 7, tilesX2, tilesY4); + } + if (CalamityWorld.genSwordHut) + { + CalamityWorld.genSwordHut = false; + SpecialHut(TileID.HellstoneBrick, TileID.Hellstone, WallID.HellstoneBrick, 8, tilesX5, tilesY6); + } + } + #endregion + + #region Crag + int xUnderworldGen = WorldGen.genRand.Next((int)((double)x * 0.1), (int)((double)x * 0.15)); + int yUnderworldGen = y - 100; + CalamityWorld.fuhX = xUnderworldGen; + CalamityWorld.fuhY = yUnderworldGen; + UnderworldIsland(xUnderworldGen, yUnderworldGen, 180, 201, 120, 136); + UnderworldIsland(xUnderworldGen - 50, yUnderworldGen - 30, 100, 111, 60, 71); + UnderworldIsland(xUnderworldGen + 50, yUnderworldGen - 30, 100, 111, 60, 71); + ChasmGenerator(CalamityWorld.fuhX - 110, CalamityWorld.fuhY - 10, WorldGen.genRand.Next(150) + 150); + ChasmGenerator(CalamityWorld.fuhX + 110, CalamityWorld.fuhY - 10, WorldGen.genRand.Next(150) + 150); + UnderworldIsland(xUnderworldGen - 150, yUnderworldGen - 30, 60, 66, 35, 41); + UnderworldIsland(xUnderworldGen + 150, yUnderworldGen - 30, 60, 66, 35, 41); + UnderworldIsland(xUnderworldGen - 180, yUnderworldGen - 20, 60, 66, 35, 41); + UnderworldIsland(xUnderworldGen + 180, yUnderworldGen - 20, 60, 66, 35, 41); + UnderworldIslandHouse(CalamityWorld.fuhX, CalamityWorld.fuhY + 30, 1323); + UnderworldIslandHouse(CalamityWorld.fuhX - 22, CalamityWorld.fuhY + 15, 1322); + UnderworldIslandHouse(CalamityWorld.fuhX + 22, CalamityWorld.fuhY + 15, 535); + UnderworldIslandHouse(CalamityWorld.fuhX - 50, CalamityWorld.fuhY - 30, 112); + UnderworldIslandHouse(CalamityWorld.fuhX + 50, CalamityWorld.fuhY - 30, 906); + UnderworldIslandHouse(CalamityWorld.fuhX - 150, CalamityWorld.fuhY - 30, 218); + UnderworldIslandHouse(CalamityWorld.fuhX + 150, CalamityWorld.fuhY - 30, 3019); + UnderworldIslandHouse(CalamityWorld.fuhX - 180, CalamityWorld.fuhY - 20, 274); + UnderworldIslandHouse(CalamityWorld.fuhX + 180, CalamityWorld.fuhY - 20, 220); + #endregion + + })); + tasks.Insert(FinalIndex + 2, new PassLegacy("SunkenSea", delegate (GenerationProgress progress) + { + progress.Message = "Making the world more wet"; + SunkenSea.Place(new Point(WorldGen.UndergroundDesertLocation.Left, WorldGen.UndergroundDesertLocation.Bottom)); + })); } - //RE-ENABLE IF YOU WANT QUICK TESTING FOR WORLD GEN C: - //RemoveMostTasks(tasks); + + tasks.Add(new PassLegacy("Planetoid Test", Planetoids)); - tasks.Add(new PassLegacy("Expand World", ExpandWorld)); - //EVERYTHING THAT WILL SPAWN IN EXPANDED HEIGHT AREA MUST BE DONE AFTER THIS SO: - tasks.Add(new PassLegacy("Planetoid Test", Planetoids)); - - //FIX THE POTS BEING A PROBLEM USING A CUSTOM FIX - int pots = tasks.FindIndex(task => task.Name == "Pots"); - if (pots != -1) - { - tasks.RemoveAt(pots); - tasks.Insert(pots, new PassLegacy("Pots", PotFix)); - } - } - #endregion - - #region SafeTileFrame - public static void SafeSquareTileFrame(int i, int j, bool resetFrame = true) - { - if (Main.tile[i, j] != null) - { - for (int x = i - 1; x <= i + 1; x++) - { - for (int y = j - 1; y <= j + 1; y++) - { - if (x < 0 || y < 0 || x >= Main.maxTilesX || y >= Main.maxTilesY) continue; - if (x == i && y == j) - { - WorldGen.TileFrame(i, j, resetFrame, false); - } - else - { - WorldGen.TileFrame(x, y, false, false); - } - } - } - } - } - #endregion - - #region ShuffleArray - public static int[] ShuffleArray(int[] array) - { - Random random = new Random(); - for (int index = array.Length; index > 0; index--) - { - int j = random.Next(index); - int k = array[j]; - array[j] = array[index - 1]; - array[index - 1] = k; - } - return array; - } - #endregion - - #region Seasons - public static void checkSpring() - { - DateTime now = DateTime.Now; - int day = now.Day; - int month = now.Month; - if (month >= 3 && month <= 6) - { - if (month == 3 && day >= 20) - { - spring = true; - return; - } - if (month == 4) - { - spring = true; - return; - } - if (month == 5) - { - spring = true; - return; - } - if (month == 6 && day <= 20) - { - spring = true; - return; - } - } - spring = false; } - - public static void checkSummer() + #endregion + + #region BiomeChests + private void GenerateBiomeChests(GenerationProgress progress) { - DateTime now = DateTime.Now; - int day = now.Day; - int month = now.Month; - if (month >= 6 && month <= 9) + Mod mod = ModLoader.GetMod("CalamityMod"); + // Get dungeon size field infos. These fields are private for some reason + int MinX = (int)typeof(WorldGen).GetField("dMinX", BindingFlags.Static | BindingFlags.NonPublic).GetValue(null) + 25; + int MaxX = (int)typeof(WorldGen).GetField("dMaxX", BindingFlags.Static | BindingFlags.NonPublic).GetValue(null) - 25; + int MaxY = (int)typeof(WorldGen).GetField("dMaxY", BindingFlags.Static | BindingFlags.NonPublic).GetValue(null) - 25; + int[] ChestTypes = new int[] { mod.TileType("AstralChestLocked") }; + int[] ItemTypes = new int[] { mod.ItemType("HeavenfallenStardisk") }; + + progress.Message = "Calamity Mod: Biome Chests"; + + int rounds = 1; + for (int i = 0; i < ChestTypes.Length * rounds; i++) { - if (month == 6 && day >= 21) + Chest chest = null; + int attempts = 0; + while (chest == null && attempts < 1000) { - summer = true; - return; + attempts++; + int x = WorldGen.genRand.Next(MinX, MaxX); + int y = WorldGen.genRand.Next((int)Main.worldSurface, MaxY); + if (Main.wallDungeon[Main.tile[x, y].wall] && !Main.tile[x, y].active()) + { + chest = AddChestWithDefaultLoot(x, y, (ushort)ChestTypes[i % ChestTypes.Length], 1, 2); + } } - if (month == 7) + if (chest != null) { - summer = true; - return; - } - if (month == 8) - { - summer = true; - return; - } - if (month == 9 && day <= 21) - { - summer = true; - return; + chest.item[0].SetDefaults(ItemTypes[i % ChestTypes.Length]); + chest.item[0].Prefix(-1); } } - summer = false; } - - public static void checkFall() + + internal static Chest AddChestWithDefaultLoot(int i, int j, ushort type = TileID.Containers, uint emptySlots = 1, int Style = 0) { - DateTime now = DateTime.Now; - int day = now.Day; - int month = now.Month; - if (month >= 9 && month <= 12) + Chest chest = null; + while (j < Main.maxTilesY - 210) { - if (month == 9 && day >= 22) + if (!WorldGen.SolidTile(i, j)) { - fall = true; - return; + j++; + continue; } - if (month == 10) + int chestIndex = WorldGen.PlaceChest(i - 1, j - 1, type, false, Style); + if (chestIndex < 0) { - fall = true; - return; + break; } - if (month == 11) + chest = Main.chest[chestIndex]; + uint itemIndex = emptySlots; + while (itemIndex == emptySlots) { - fall = true; - return; - } - if (month == 12 && day <= 20) - { - fall = true; - return; + Mod mod = ModLoader.GetMod("CalamityMod"); + bool AstralChest = type == mod.TileType("AstralChestLocked"); + int cItem; + cItem = WorldGen.genRand.NextBool() ? WorldGen.goldBar : WorldGen.silverBar; + int addAmount = 0; + if (AstralChest) + { + cItem = mod.ItemType("AstralBar"); + addAmount = 4; + } + chest.item[itemIndex].SetDefaults(cItem, false); + chest.item[itemIndex].stack = WorldGen.genRand.Next(3 + addAmount, 11 + addAmount * 2); + itemIndex++; + if (WorldGen.genRand.NextBool()) + { + cItem = ItemID.HolyArrow; + int addAmount2 = 0; + if (AstralChest) + addAmount2 = 25; + chest.item[itemIndex].SetDefaults(cItem, false); + chest.item[itemIndex].stack = WorldGen.genRand.Next(25 + addAmount2, 51 + addAmount2 * 2); + itemIndex++; + } + if (AstralChest) + { + chest.item[itemIndex].SetDefaults(mod.ItemType("AstralJelly"), false); + chest.item[itemIndex].stack = WorldGen.genRand.Next(3, 6); + itemIndex++; + } + if (WorldGen.genRand.NextBool()) + { + int[] items = new int[] { + ItemID.SpelunkerPotion, ItemID.FeatherfallPotion, ItemID.NightOwlPotion, + ItemID.WaterWalkingPotion, ItemID.ArcheryPotion, ItemID.GravitationPotion + }; + if (AstralChest) + { + items[1] = mod.ItemType("RevivifyPotion"); + items[4] = ItemID.ShinePotion; + items[5] = ItemID.HunterPotion; + } + chest.item[itemIndex].SetDefaults(WorldGen.genRand.Next(items), false); + chest.item[itemIndex].stack = WorldGen.genRand.Next(1, 3); + itemIndex++; + } + if (WorldGen.genRand.NextBool()) + { + int[] items = new int[] { + ItemID.ThornsPotion, ItemID.WaterWalkingPotion, ItemID.InvisibilityPotion, + ItemID.ManaRegenerationPotion, ItemID.TeleportationPotion, ItemID.TrapsightPotion, ItemID.TrapsightPotion // yes, dangersense potions have double the chance as other potions in vanilla for some reason + }; + if (AstralChest) + { + items[1] = ItemID.MagicPowerPotion; + items[2] = mod.ItemType("ZenPotion"); + items[5] = mod.ItemType("CadencePotion"); + } + chest.item[itemIndex].SetDefaults(WorldGen.genRand.Next(items), false); + chest.item[itemIndex].stack = WorldGen.genRand.Next(1, 3); + itemIndex++; + } + if (WorldGen.genRand.NextBool()) + { + cItem = ItemID.RecallPotion; + int addAmount2 = 0; + if (AstralChest) + { + cItem = ItemID.BouncyDynamite; + addAmount2 = 2; + } + chest.item[itemIndex].SetDefaults(cItem, false); + chest.item[itemIndex].stack = WorldGen.genRand.Next(1, 3) * addAmount2; + itemIndex++; + } + if (AstralChest) + addAmount = 2; + chest.item[itemIndex].SetDefaults(ItemID.GoldCoin, false); + chest.item[itemIndex].stack = WorldGen.genRand.Next(1, 3) * addAmount; + itemIndex++; } } - fall = false; + return chest; } - - public static void checkWinter() + #endregion + + #region SafeTileFrame + public static void SafeSquareTileFrame(int i, int j, bool resetFrame = true) { - DateTime now = DateTime.Now; - int day = now.Day; - int month = now.Month; - if (month == 12 || (month >= 1 && month <= 3)) + if (Main.tile[i, j] != null) { - if (month == 12 && day >= 21) + for (int x = i - 1; x <= i + 1; x++) { - winter = true; - return; - } - if (month == 1) - { - winter = true; - return; - } - if (month == 2) - { - winter = true; - return; - } - if (month == 3 && day <= 19) - { - winter = true; - return; + for (int y = j - 1; y <= j + 1; y++) + { + if (x < 0 || y < 0 || x >= Main.maxTilesX || y >= Main.maxTilesY) continue; + if (x == i && y == j) + { + WorldGen.TileFrame(i, j, resetFrame, false); + } + else + { + WorldGen.TileFrame(x, y, false, false); + } + } } } - winter = false; } - #endregion + #endregion - #region OreSpawn - public static void spawnOre(int type, double frequency, float depth, float depthLimit) - { - Mod mod = ModLoader.GetMod("CalamityMod"); - bool genCenter = false; - int x = Main.maxTilesX; - int y = Main.maxTilesY; - int genLimit = x / 2; - int generateBack = genLimit - 80; //Small = 2020 - int generateForward = genLimit + 80; //Small = 2180 - if (type == mod.TileType("ExodiumOre")) - { - genCenter = true; - depthLimit = 0.14f; - if (y > 1500) { depthLimit = 0.1f; if (y > 2100) { depthLimit = 0.07f; } } - } - if (Main.netMode != 1) - { - for (int k = 0; k < (int)((double)(x * y) * frequency); k++) - { - int tilesX = WorldGen.genRand.Next(0, (genCenter ? genLimit : generateBack)); - int tilesX2 = WorldGen.genRand.Next((genCenter ? genLimit : generateForward), x); - int tilesY = WorldGen.genRand.Next((int)(y * depth), (int)(y * depthLimit)); - if (type == mod.TileType("AuricOre")) - { - WorldGen.OreRunner(tilesX, tilesY, (double)WorldGen.genRand.Next(12, 18), WorldGen.genRand.Next(12, 18), (ushort)type); - WorldGen.OreRunner(tilesX2, tilesY, (double)WorldGen.genRand.Next(12, 18), WorldGen.genRand.Next(12, 18), (ushort)type); - } - else if (type == mod.TileType("UelibloomOre")) - { - if (Main.tile[tilesX, tilesY].type == 59) - { - WorldGen.OreRunner(tilesX, tilesY, (double)WorldGen.genRand.Next(3, 8), WorldGen.genRand.Next(3, 8), (ushort)type); - } - if (Main.tile[tilesX2, tilesY].type == 59) - { - WorldGen.OreRunner(tilesX2, tilesY, (double)WorldGen.genRand.Next(3, 8), WorldGen.genRand.Next(3, 8), (ushort)type); - } - } - else if (type == mod.TileType("PerennialOre")) - { - if (Main.tile[tilesX, tilesY].type == 0 || Main.tile[tilesX, tilesY].type == 1) - { - WorldGen.OreRunner(tilesX, tilesY, (double)WorldGen.genRand.Next(3, 8), WorldGen.genRand.Next(3, 8), (ushort)type); - } - if (Main.tile[tilesX2, tilesY].type == 0 || Main.tile[tilesX2, tilesY].type == 1) - { - WorldGen.OreRunner(tilesX2, tilesY, (double)WorldGen.genRand.Next(3, 8), WorldGen.genRand.Next(3, 8), (ushort)type); - } - } - else if (type == mod.TileType("CryonicOre")) - { - if (Main.tile[tilesX, tilesY].type == 147 || Main.tile[tilesX, tilesY].type == 161 || Main.tile[tilesX, tilesY].type == 163 || Main.tile[tilesX, tilesY].type == 164 || Main.tile[tilesX, tilesY].type == 200) - { - WorldGen.OreRunner(tilesX, tilesY, (double)WorldGen.genRand.Next(3, 8), WorldGen.genRand.Next(3, 8), (ushort)type); - } - if (Main.tile[tilesX2, tilesY].type == 147 || Main.tile[tilesX2, tilesY].type == 161 || Main.tile[tilesX2, tilesY].type == 163 || Main.tile[tilesX2, tilesY].type == 164 || Main.tile[tilesX2, tilesY].type == 200) - { - WorldGen.OreRunner(tilesX2, tilesY, (double)WorldGen.genRand.Next(3, 8), WorldGen.genRand.Next(3, 8), (ushort)type); - } - } - else - { - WorldGen.OreRunner(tilesX, tilesY, (double)WorldGen.genRand.Next(3, 8), WorldGen.genRand.Next(3, 8), (ushort)type); - WorldGen.OreRunner(tilesX2, tilesY, (double)WorldGen.genRand.Next(3, 8), WorldGen.genRand.Next(3, 8), (ushort)type); - } - } - } - } - #endregion + #region ShuffleArray + public static int[] ShuffleArray(int[] array) + { + Random random = new Random(); + for (int index = array.Length; index > 0; index--) + { + int j = random.Next(index); + int k = array[j]; + array[j] = array[index - 1]; + array[index - 1] = k; + } + return array; + } + #endregion - #region AstralMeteor - public static bool checkAstralMeteor() - { - Mod mod = ModLoader.GetMod("CalamityMod"); - int num = 0; - float num2 = (float)(Main.maxTilesX / 4200); - int num3 = (int)(200f * num2); //Small = 201 Medium = 305 Large = 401 - for (int j = 5; j < Main.maxTilesX - 5; j++) - { - int num4 = 5; - while ((double)num4 < Main.worldSurface) - { - if (Main.tile[j, num4].active() && Main.tile[j, num4].type == mod.TileType("AstralOre")) - { - num++; - if (num > num3) - { - return false; - } - } - num4++; - } - } - return true; - } + #region OreSpawn + public static void spawnOre(int type, double frequency, float depth, float depthLimit) + { + Mod mod = ModLoader.GetMod("CalamityMod"); + bool genCenter = false; + int x = Main.maxTilesX; + int y = Main.maxTilesY; + int genLimit = x / 2; + int generateBack = genLimit - 80; //Small = 2020 + int generateForward = genLimit + 80; //Small = 2180 + if (type == mod.TileType("ExodiumOre")) + { + genCenter = true; + depthLimit = 0.14f; + if (y > 1500) { depthLimit = 0.1f; if (y > 2100) { depthLimit = 0.07f; } } + } + if (Main.netMode != 1) + { + for (int k = 0; k < (int)((double)(x * y) * frequency); k++) + { + int tilesX = WorldGen.genRand.Next(0, (genCenter ? genLimit : generateBack)); + int tilesX2 = WorldGen.genRand.Next((genCenter ? genLimit : generateForward), x); + int tilesY = WorldGen.genRand.Next((int)(y * depth), (int)(y * depthLimit)); + if (type == mod.TileType("AuricOre")) + { + WorldGen.OreRunner(tilesX, tilesY, (double)WorldGen.genRand.Next(12, 18), WorldGen.genRand.Next(12, 18), (ushort)type); + WorldGen.OreRunner(tilesX2, tilesY, (double)WorldGen.genRand.Next(12, 18), WorldGen.genRand.Next(12, 18), (ushort)type); + } + else if (type == mod.TileType("UelibloomOre")) + { + if (Main.tile[tilesX, tilesY].type == 59) + { + WorldGen.OreRunner(tilesX, tilesY, (double)WorldGen.genRand.Next(3, 8), WorldGen.genRand.Next(3, 8), (ushort)type); + } + if (Main.tile[tilesX2, tilesY].type == 59) + { + WorldGen.OreRunner(tilesX2, tilesY, (double)WorldGen.genRand.Next(3, 8), WorldGen.genRand.Next(3, 8), (ushort)type); + } + } + else if (type == mod.TileType("PerennialOre")) + { + if (Main.tile[tilesX, tilesY].type == 0 || Main.tile[tilesX, tilesY].type == 1) + { + WorldGen.OreRunner(tilesX, tilesY, (double)WorldGen.genRand.Next(3, 8), WorldGen.genRand.Next(3, 8), (ushort)type); + } + if (Main.tile[tilesX2, tilesY].type == 0 || Main.tile[tilesX2, tilesY].type == 1) + { + WorldGen.OreRunner(tilesX2, tilesY, (double)WorldGen.genRand.Next(3, 8), WorldGen.genRand.Next(3, 8), (ushort)type); + } + } + else if (type == mod.TileType("CryonicOre")) + { + if (Main.tile[tilesX, tilesY].type == 147 || Main.tile[tilesX, tilesY].type == 161 || Main.tile[tilesX, tilesY].type == 163 || Main.tile[tilesX, tilesY].type == 164 || Main.tile[tilesX, tilesY].type == 200) + { + WorldGen.OreRunner(tilesX, tilesY, (double)WorldGen.genRand.Next(3, 8), WorldGen.genRand.Next(3, 8), (ushort)type); + } + if (Main.tile[tilesX2, tilesY].type == 147 || Main.tile[tilesX2, tilesY].type == 161 || Main.tile[tilesX2, tilesY].type == 163 || Main.tile[tilesX2, tilesY].type == 164 || Main.tile[tilesX2, tilesY].type == 200) + { + WorldGen.OreRunner(tilesX2, tilesY, (double)WorldGen.genRand.Next(3, 8), WorldGen.genRand.Next(3, 8), (ushort)type); + } + } + else + { + WorldGen.OreRunner(tilesX, tilesY, (double)WorldGen.genRand.Next(3, 8), WorldGen.genRand.Next(3, 8), (ushort)type); + WorldGen.OreRunner(tilesX2, tilesY, (double)WorldGen.genRand.Next(3, 8), WorldGen.genRand.Next(3, 8), (ushort)type); + } + } + } + } + #endregion - public static bool checkAstralBiomeSpawn() - { - Mod mod = ModLoader.GetMod("CalamityMod"); - int num = 0; - float num2 = (float)(Main.maxTilesX / 4200); - int num3 = (int)(400f * num2); //Small = 401 Medium = 605 Large = 801 - for (int j = 5; j < Main.maxTilesX - 5; j++) - { - int num4 = 5; - while ((double)num4 < Main.worldSurface) - { - if (Main.tile[j, num4].active() && - (Main.tile[j, num4].type == mod.TileType("AstralSand") || Main.tile[j, num4].type == mod.TileType("AstralSandstone") || - Main.tile[j, num4].type == mod.TileType("HardenedAstralSand") || Main.tile[j, num4].type == mod.TileType("AstralIce") || - Main.tile[j, num4].type == mod.TileType("AstralDirt") || Main.tile[j, num4].type == mod.TileType("AstralStone") || - Main.tile[j, num4].type == mod.TileType("AstralGrass"))) - { - num++; - if (num > num3) - { - return false; - } - } - num4++; - } - } - return true; - } + #region AstralMeteor + public static bool checkAstralMeteor() + { + Mod mod = ModLoader.GetMod("CalamityMod"); + int num = 0; + float num2 = (float)(Main.maxTilesX / 4200); + int num3 = (int)(200f * num2); //Small = 201 Medium = 305 Large = 401 + for (int j = 5; j < Main.maxTilesX - 5; j++) + { + int num4 = 5; + while ((double)num4 < Main.worldSurface) + { + if (Main.tile[j, num4].active() && Main.tile[j, num4].type == mod.TileType("AstralOre")) + { + num++; + if (num > num3) + { + return false; + } + } + num4++; + } + } + return true; + } - public static void dropAstralMeteor() + public static bool checkAstralBiomeSpawn() + { + Mod mod = ModLoader.GetMod("CalamityMod"); + int num = 0; + float num2 = (float)(Main.maxTilesX / 4200); + int num3 = (int)(400f * num2); //Small = 401 Medium = 605 Large = 801 + for (int j = 5; j < Main.maxTilesX - 5; j++) + { + int num4 = 5; + while ((double)num4 < Main.worldSurface) + { + if (Main.tile[j, num4].active() && + (Main.tile[j, num4].type == mod.TileType("AstralSand") || Main.tile[j, num4].type == mod.TileType("AstralSandstone") || + Main.tile[j, num4].type == mod.TileType("HardenedAstralSand") || Main.tile[j, num4].type == mod.TileType("AstralIce") || + Main.tile[j, num4].type == mod.TileType("AstralDirt") || Main.tile[j, num4].type == mod.TileType("AstralStone") || + Main.tile[j, num4].type == mod.TileType("AstralGrass"))) + { + num++; + if (num > num3) + { + return false; + } + } + num4++; + } + } + return true; + } + + public static void dropAstralMeteor() { Mod mod = ModLoader.GetMod("CalamityMod"); bool flag = true; @@ -1655,21 +1616,21 @@ namespace CalamityMod break; } } - if (!checkAstralMeteor()) - { - return; - } + if (!checkAstralMeteor()) + { + return; + } float num5 = 600f; while (!flag) { float num6 = (float)Main.maxTilesX * 0.08f; - int xLimit = Main.maxTilesX / 2; + int xLimit = Main.maxTilesX / 2; int num7 = (abyssSide ? Main.rand.Next(150, xLimit) : Main.rand.Next(xLimit, Main.maxTilesX - 150)); while ((float)num7 > (float)Main.spawnTileX - num6 && (float)num7 < (float)Main.spawnTileX + num6) { num7 = (abyssSide ? Main.rand.Next(150, xLimit) : Main.rand.Next(xLimit, Main.maxTilesX - 150)); } - //world surface = 920 large 740 medium 560 small + //world surface = 920 large 740 medium 560 small int k = (int)(Main.worldSurface * 0.6); //Large = 522, Medium = 444, Small = 336 while (k < Main.maxTilesY) { @@ -1718,7 +1679,7 @@ namespace CalamityMod } } } - + public static bool astralMeteor(int i, int j) { Mod mod = ModLoader.GetMod("CalamityMod"); @@ -1776,14 +1737,14 @@ namespace CalamityMod float num6 = (float)Math.Sqrt((double)(num4 * num4 + num5 * num5)); if ((double)num6 < (double)num * 0.9 + (double)Main.rand.Next(-4, 5)) { - if (Main.tile[num2, num3] != null) - { - if (!Main.tileSolid[(int)Main.tile[num2, num3].type]) - { - Main.tile[num2, num3].active(false); - } - Main.tile[num2, num3].type = (ushort)mod.TileType("AstralOre"); - } + if (Main.tile[num2, num3] != null) + { + if (!Main.tileSolid[(int)Main.tile[num2, num3].type]) + { + Main.tile[num2, num3].active(false); + } + Main.tile[num2, num3].type = (ushort)mod.TileType("AstralOre"); + } } } } @@ -1800,8 +1761,8 @@ namespace CalamityMod float num11 = (float)Math.Sqrt((double)(num9 * num9 + num10 * num10)); if ((double)num11 < (double)num * 0.8 + (double)Main.rand.Next(-3, 4)) { - if (Main.tile[num7, num8] != null) - Main.tile[num7, num8].active(false); + if (Main.tile[num7, num8] != null) + Main.tile[num7, num8].active(false); } } } @@ -1814,30 +1775,30 @@ namespace CalamityMod float num14 = (float)Math.Abs(i - num12); float num15 = (float)Math.Abs(j - num13); float num16 = (float)Math.Sqrt((double)(num14 * num14 + num15 * num15)); - if (Main.tile[num12, num13] != null) - { - if ((double)num16 < (double)num * 0.7) - { - if (Main.tile[num12, num13].type == 5 || Main.tile[num12, num13].type == 32 || Main.tile[num12, num13].type == 352) - { - WorldGen.KillTile(num12, num13, false, false, false); - } - Main.tile[num12, num13].liquid = 0; - } - if (Main.tile[num12, num13].type == (ushort)mod.TileType("AstralOre")) - { - if (!WorldGen.SolidTile(num12 - 1, num13) && !WorldGen.SolidTile(num12 + 1, num13) && !WorldGen.SolidTile(num12, num13 - 1) && !WorldGen.SolidTile(num12, num13 + 1)) - { - Main.tile[num12, num13].active(false); - } - else if ((Main.tile[num12, num13].halfBrick() || Main.tile[num12 - 1, num13].topSlope()) && !WorldGen.SolidTile(num12, num13 + 1)) - { - Main.tile[num12, num13].active(false); - } - } - WorldGen.SquareTileFrame(num12, num13, true); - WorldGen.SquareWallFrame(num12, num13, true); - } + if (Main.tile[num12, num13] != null) + { + if ((double)num16 < (double)num * 0.7) + { + if (Main.tile[num12, num13].type == 5 || Main.tile[num12, num13].type == 32 || Main.tile[num12, num13].type == 352) + { + WorldGen.KillTile(num12, num13, false, false, false); + } + Main.tile[num12, num13].liquid = 0; + } + if (Main.tile[num12, num13].type == (ushort)mod.TileType("AstralOre")) + { + if (!WorldGen.SolidTile(num12 - 1, num13) && !WorldGen.SolidTile(num12 + 1, num13) && !WorldGen.SolidTile(num12, num13 - 1) && !WorldGen.SolidTile(num12, num13 + 1)) + { + Main.tile[num12, num13].active(false); + } + else if ((Main.tile[num12, num13].halfBrick() || Main.tile[num12 - 1, num13].topSlope()) && !WorldGen.SolidTile(num12, num13 + 1)) + { + Main.tile[num12, num13].active(false); + } + } + WorldGen.SquareTileFrame(num12, num13, true); + WorldGen.SquareWallFrame(num12, num13, true); + } } } num = WorldGen.genRand.Next(23, 32); @@ -1852,15 +1813,15 @@ namespace CalamityMod float num21 = (float)Math.Sqrt((double)(num19 * num19 + num20 * num20)); if ((double)num21 < (double)num * 0.8) { - if (Main.tile[num17, num18] != null) - { - if (Main.tile[num17, num18].type == 5 || Main.tile[num17, num18].type == 32 || Main.tile[num17, num18].type == 352) - { - WorldGen.KillTile(num17, num18, false, false, false); - } - Main.tile[num17, num18].type = (ushort)mod.TileType("AstralOre"); - WorldGen.SquareTileFrame(num17, num18, true); - } + if (Main.tile[num17, num18] != null) + { + if (Main.tile[num17, num18].type == 5 || Main.tile[num17, num18].type == 32 || Main.tile[num17, num18].type == 352) + { + WorldGen.KillTile(num17, num18, false, false, false); + } + Main.tile[num17, num18].type = (ushort)mod.TileType("AstralOre"); + WorldGen.SquareTileFrame(num17, num18, true); + } } } } @@ -1877,15 +1838,15 @@ namespace CalamityMod float num26 = (float)Math.Sqrt((double)(num24 * num24 + num25 * num25)); if ((double)num26 < (double)num * 0.85) { - if (Main.tile[num22, num23] != null) - { - if (Main.tile[num22, num23].type == 5 || Main.tile[num22, num23].type == 32 || Main.tile[num22, num23].type == 352) - { - WorldGen.KillTile(num22, num23, false, false, false); - } - Main.tile[num22, num23].type = (ushort)mod.TileType("AstralOre"); - WorldGen.SquareTileFrame(num22, num23, true); - } + if (Main.tile[num22, num23] != null) + { + if (Main.tile[num22, num23].type == 5 || Main.tile[num22, num23].type == 32 || Main.tile[num22, num23].type == 352) + { + WorldGen.KillTile(num22, num23, false, false, false); + } + Main.tile[num22, num23].type = (ushort)mod.TileType("AstralOre"); + WorldGen.SquareTileFrame(num22, num23, true); + } } } } @@ -1893,3645 +1854,3519 @@ namespace CalamityMod if (Main.netMode != 1) { NetMessage.SendTileSquare(-1, i, j, 40, TileChangeType.None); - if (checkAstralBiomeSpawn()) - DoAstralConversion(new Point(i, j)); - } + if (checkAstralBiomeSpawn()) + DoAstralConversion(new Point(i, j)); + } return true; } - public static void DoAstralConversion(object obj) - { - //Pre-calculate all variables necessary for elliptical area checking - Point origin = (Point)obj; - Vector2 center = origin.ToVector2() * 16f + new Vector2(8f); - - float angle = MathHelper.Pi * 0.15f; - float otherAngle = MathHelper.PiOver2 - angle; - - int distanceInTiles = 150 + ((Main.maxTilesX - 4200) / 4200) * 200; - float distance = distanceInTiles * 16f; - float constant = (distance * 2f) / (float)Math.Sin(angle); - - float fociSpacing = ((distance * (float)Math.Sin(otherAngle)) / (float)Math.Sin(angle)); - int verticalRadius = (int)(constant / 16f); - - Vector2 fociOffset = Vector2.UnitY * fociSpacing; - Vector2 topFoci = center - fociOffset; - Vector2 bottomFoci = center + fociOffset; - - for (int x = origin.X - distanceInTiles - 2; x <= origin.X + distanceInTiles + 2; x++) - { - for (int y = (int)(origin.Y - verticalRadius * 0.4f) - 3; y <= origin.Y + verticalRadius + 3; y++) - { - float dist; - if (CheckInEllipse(new Point(x, y), topFoci, bottomFoci, constant, center, out dist, y < origin.Y)) - { - //If we're in the outer blurPercent% of the ellipse - float percent = dist / constant; - float blurPercent = 0.98f; - if (percent > blurPercent) - { - float outerEdgePercent = (percent - blurPercent) / (1f - blurPercent); - if (Main.rand.NextFloat(1f) > outerEdgePercent) - { - ConvertToAstral(x, y); - } - } - else - { - ConvertToAstral(x, y); - } - } - } - } - } - - public static void ConvertToAstral(int startX, int endX, int startY, int endY) - { - for (int x = startX; x <= endX; x++) - { - for (int y = startY; y <= endY; y++) - { - ConvertToAstral(x, y); - } - } - } - - public static void ConvertToAstral(int x, int y, bool tileframe = true) - { - Mod mod = ModLoader.GetMod("CalamityMod"); - if (WorldGen.InWorld(x, y, 1)) - { - int type = Main.tile[x, y].type; - int wallType = Main.tile[x, y].wall; - - if (Main.tile[x, y] != null) - { - if (WallID.Sets.Conversion.Grass[wallType]) - { - Main.tile[x, y].wall = (ushort)mod.WallType("AstralGrassWallUnsafe"); - } - else if (WallID.Sets.Conversion.HardenedSand[wallType]) - { - Main.tile[x, y].wall = (ushort)mod.WallType("HardenedAstralSandWallUnsafe"); - } - else if (WallID.Sets.Conversion.Sandstone[wallType]) - { - Main.tile[x, y].wall = (ushort)mod.WallType("AstralSandstoneWallUnsafe"); - } - else if (WallID.Sets.Conversion.Stone[wallType]) - { - Main.tile[x, y].wall = (ushort)mod.WallType("AstralStoneWallUnsafe"); - } - else - { - switch (wallType) - { - case WallID.DirtUnsafe: - case WallID.DirtUnsafe1: - case WallID.DirtUnsafe2: - case WallID.DirtUnsafe3: - case WallID.DirtUnsafe4: - case WallID.Cave6Unsafe: - case WallID.Dirt: - Main.tile[x, y].wall = (ushort)mod.WallType("AstralDirtWallUnsafe"); - break; - case WallID.IceUnsafe: - Main.tile[x, y].wall = (ushort)mod.WallType("AstralIceWallUnsafe"); - break; - } - } - if (TileID.Sets.Conversion.Grass[type] && !TileID.Sets.GrassSpecial[type]) - { - Main.tile[x, y].type = (ushort)mod.TileType("AstralGrass"); - } - else if (TileID.Sets.Conversion.Stone[type] || Main.tileMoss[type]) - { - Main.tile[x, y].type = (ushort)mod.TileType("AstralStone"); - } - else if (TileID.Sets.Conversion.Sand[type]) - { - Main.tile[x, y].type = (ushort)mod.TileType("AstralSand"); - } - else if (TileID.Sets.Conversion.HardenedSand[type]) - { - Main.tile[x, y].type = (ushort)mod.TileType("HardenedAstralSand"); - } - else if (TileID.Sets.Conversion.Sandstone[type]) - { - Main.tile[x, y].type = (ushort)mod.TileType("AstralSandstone"); - } - else if (TileID.Sets.Conversion.Ice[type]) - { - Main.tile[x, y].type = (ushort)mod.TileType("AstralIce"); - } - else - { - Tile tile = Main.tile[x, y]; - switch (type) - { - case TileID.Dirt: - Main.tile[x, y].type = (ushort)mod.TileType("AstralDirt"); - break; - case TileID.Vines: - Main.tile[x, y].type = (ushort)mod.TileType("AstralVines"); - break; - case TileID.LargePiles: - if (tile.frameX <= 1170) - { - RecursiveReplaceToAstral(TileID.LargePiles, (ushort)mod.TileType("AstralNormalLargePiles"), x, y, 324, 0, 1170, 0, 18); - } - if (tile.frameX >= 1728) - { - RecursiveReplaceToAstral(TileID.LargePiles, (ushort)mod.TileType("AstralNormalLargePiles"), x, y, 324, 1728, 1872, 0, 18); - } - if (tile.frameX >= 1404 && tile.frameX <= 1710) - { - RecursiveReplaceToAstral(TileID.LargePiles, (ushort)mod.TileType("AstralIceLargePiles"), x, y, 324, 1404, 1710, 0, 18); - } - break; - case TileID.LargePiles2: - if (tile.frameX >= 1566 && tile.frameY < 36) - { - RecursiveReplaceToAstral(TileID.LargePiles2, (ushort)mod.TileType("AstralDesertLargePiles"), x, y, 324, 1566, 1872, 0, 18); - } - if (tile.frameX >= 756 && tile.frameX <= 900) - { - RecursiveReplaceToAstral(TileID.LargePiles2, (ushort)mod.TileType("AstralNormalLargePiles"), x, y, 324, 756, 900, 0, 18); - } - break; - case TileID.SmallPiles: - if (tile.frameY == 18) - { - ushort newType = 9999; - if (tile.frameX >= 1476 && tile.frameX <= 1674) - { - newType = (ushort)mod.TileType("AstralDesertMediumPiles"); - } - else if (tile.frameX <= 558 || (tile.frameX >= 1368 && tile.frameX <= 1458)) - { - newType = (ushort)mod.TileType("AstralNormalMediumPiles"); - } - else if (tile.frameX >= 900 && tile.frameX <= 1098) - { - newType = (ushort)mod.TileType("AstralIceMediumPiles"); - } - else - { - break; - } - int leftMost = x; - if (tile.frameX % 36 != 0) //this means it's the right tile of the two - { - leftMost--; - } - if (Main.tile[leftMost, y] != null) - Main.tile[leftMost, y].type = newType; - if (Main.tile[leftMost + 1, y] != null) - Main.tile[leftMost + 1, y].type = newType; - while (Main.tile[leftMost, y].frameX >= 216) - { - if (Main.tile[leftMost, y] != null) - Main.tile[leftMost, y].frameX -= 216; - if (Main.tile[leftMost + 1, y] != null) - Main.tile[leftMost + 1, y].frameX -= 216; - } - } - else if (tile.frameY == 0) - { - ushort newType3 = 9999; - if (tile.frameX >= 972 && tile.frameX <= 1062) - { - newType3 = (ushort)mod.TileType("AstralDesertSmallPiles"); - } - else if (tile.frameX <= 486) - { - newType3 = (ushort)mod.TileType("AstralNormalSmallPiles"); - } - else if (tile.frameX >= 648 && tile.frameX <= 846) - { - newType3 = (ushort)mod.TileType("AstralIceSmallPiles"); - } - else - { - break; - } - Main.tile[x, y].type = newType3; - while (Main.tile[x, y].frameX >= 108) //REFRAME IT - { - Main.tile[x, y].frameX -= 108; - } - } - break; - case TileID.Stalactite: - int topMost = tile.frameY <= 54 ? (tile.frameY % 36 == 0 ? y : y - 1) : y; - bool twoTall = tile.frameY <= 54; - bool hanging = tile.frameY <= 18 || tile.frameY == 72; - ushort newType2 = 9999; - if (tile.frameX >= 378 && tile.frameX <= 414) //DESERT - { - newType2 = (ushort)mod.TileType("AstralDesertStalactite"); - } - else if ((tile.frameX >= 54 && tile.frameX <= 90) || (tile.frameX >= 216 && tile.frameX <= 360)) - { - newType2 = (ushort)mod.TileType("AstralNormalStalactite"); - } - else if (tile.frameX <= 36) - { - newType2 = (ushort)mod.TileType("AstralIceStalactite"); - } - else - { - break; - } - - //Set types - if (Main.tile[x, topMost] != null) - Main.tile[x, topMost].type = newType2; - if (twoTall) - { - if (Main.tile[x, topMost + 1] != null) - Main.tile[x, topMost + 1].type = newType2; - } - - //Fix frames - while (Main.tile[x, topMost].frameX >= 54) - { - if (Main.tile[x, topMost] != null) - Main.tile[x, topMost].frameX -= 54; - if (twoTall) - { - if (Main.tile[x, topMost + 1] != null) - Main.tile[x, topMost + 1].frameX -= 54; - } - } - - if (hanging) - { - ConvertToAstral(x, topMost - 1); - break; - } - else - { - if (twoTall) - { - ConvertToAstral(x, topMost + 2); - break; - } - ConvertToAstral(x, topMost + 1); - break; - } - } - } - if (tileframe) - { - if (Main.netMode == 0) - { - WorldGen.SquareTileFrame(x, y, true); - } - else if (Main.netMode == 2) - { - NetMessage.SendTileSquare(-1, x, y, 1); - } - } - } - } - } - - public static void ConvertFromAstral(int x, int y, ConvertType convert) - { - Tile tile = Main.tile[x, y]; - int type = tile.type; - int wallType = tile.wall; - Mod mod = CalamityMod.Instance; - - if (WorldGen.InWorld(x, y, 1)) - { - #region WALL - if (Main.tile[x, y] != null) - { - if (wallType == mod.WallType("AstralDirtWall")) - { - Main.tile[x, y].wall = WallID.DirtUnsafe; - } - else if (wallType == mod.WallType("AstralGrassWall")) - { - switch (convert) - { - case ConvertType.Corrupt: - Main.tile[x, y].wall = WallID.CorruptGrassUnsafe; - break; - case ConvertType.Crimson: - Main.tile[x, y].wall = WallID.CrimsonGrassUnsafe; - break; - case ConvertType.Hallow: - Main.tile[x, y].wall = WallID.HallowedGrassUnsafe; - break; - case ConvertType.Pure: - Main.tile[x, y].wall = WallID.GrassUnsafe; - break; - } - } - else if (wallType == mod.WallType("AstralIceWall")) - { - Main.tile[x, y].wall = WallID.IceUnsafe; - } - else if (wallType == mod.WallType("AstralStoneWall")) - { - switch (convert) - { - case ConvertType.Corrupt: - Main.tile[x, y].wall = WallID.EbonstoneUnsafe; - break; - case ConvertType.Crimson: - Main.tile[x, y].wall = WallID.CrimstoneUnsafe; - break; - case ConvertType.Hallow: - Main.tile[x, y].wall = WallID.PearlstoneBrickUnsafe; - break; - case ConvertType.Pure: - Main.tile[x, y].wall = WallID.Stone; - break; - } - } - } - #endregion - - #region TILE - if (Main.tile[x, y] != null) - { - if (type == mod.TileType("AstralDirt")) - { - tile.type = TileID.Dirt; - } - else if (type == mod.TileType("AstralGrass")) - { - SetTileFromConvert(x, y, convert, TileID.CorruptGrass, TileID.FleshGrass, TileID.HallowedGrass, TileID.Grass); - } - else if (type == mod.TileType("AstralStone")) - { - SetTileFromConvert(x, y, convert, TileID.Ebonstone, TileID.Crimstone, TileID.Pearlstone, TileID.Stone); - } - else if (type == mod.TileType("AstralSand")) - { - SetTileFromConvert(x, y, convert, TileID.Ebonsand, TileID.Crimsand, TileID.Pearlsand, TileID.Sand); - } - else if (type == mod.TileType("AstralSandstone")) - { - SetTileFromConvert(x, y, convert, TileID.CorruptSandstone, TileID.CrimsonSandstone, TileID.HallowSandstone, TileID.Sandstone); - } - else if (type == mod.TileType("HardenedAstralSand")) - { - SetTileFromConvert(x, y, convert, TileID.CorruptHardenedSand, TileID.CrimsonHardenedSand, TileID.HallowHardenedSand, TileID.HardenedSand); - } - else if (type == mod.TileType("AstralIce")) - { - SetTileFromConvert(x, y, convert, TileID.CorruptIce, TileID.FleshIce, TileID.HallowedIce, TileID.IceBlock); - } - else if (type == mod.TileType("AstralVines")) - { - SetTileFromConvert(x, y, convert, ushort.MaxValue, TileID.CrimsonVines, TileID.HallowedVines, TileID.Vines); - } - else if (type == mod.TileType("AstralShortPlants")) - { - SetTileFromConvert(x, y, convert, TileID.CorruptPlants, ushort.MaxValue, TileID.HallowedPlants, TileID.Plants); - } - else if (type == mod.TileType("AstralTallPlants")) - { - SetTileFromConvert(x, y, convert, ushort.MaxValue, ushort.MaxValue, TileID.HallowedPlants2, TileID.Plants2); - } - else if (type == mod.TileType("AstralNormalLargePiles")) - { - RecursiveReplaceFromAstral((ushort)type, TileID.LargePiles, x, y, 378, 0); - } - else if (type == mod.TileType("AstralNormalMediumPiles")) - { - RecursiveReplaceFromAstral((ushort)type, TileID.SmallPiles, x, y, 0, 18); - } - else if (type == mod.TileType("AstralNormalSmallPiles")) - { - RecursiveReplaceFromAstral((ushort)type, TileID.SmallPiles, x, y, 0, 0); - } - else if (type == mod.TileType("AstralDesertLargePiles")) - { - RecursiveReplaceFromAstral((ushort)type, TileID.LargePiles2, x, y, 1566, 0); - } - else if (type == mod.TileType("AstralDesertMediumPiles")) - { - RecursiveReplaceFromAstral((ushort)type, TileID.SmallPiles, x, y, 1476, 18); - } - else if (type == mod.TileType("AstralDesertSmallPiles")) - { - RecursiveReplaceFromAstral((ushort)type, TileID.SmallPiles, x, y, 972, 0); - } - else if (type == mod.TileType("AstralIceLargePiles")) - { - RecursiveReplaceFromAstral((ushort)type, TileID.LargePiles, x, y, 1404, 0); - } - else if (type == mod.TileType("AstralIceMediumPiles")) - { - RecursiveReplaceFromAstral((ushort)type, TileID.SmallPiles, x, y, 900, 18); - } - else if (type == mod.TileType("AstralIceSmallPiles")) - { - RecursiveReplaceFromAstral((ushort)type, TileID.SmallPiles, x, y, 648, 0); - } - else if (type == mod.TileType("AstralNormalStalactite")) - { - ushort originType = TileID.Stone; - int frameXAdd = 54; - switch (convert) - { - case ConvertType.Corrupt: - originType = TileID.Ebonstone; - frameXAdd = 324; - break; - case ConvertType.Crimson: - originType = TileID.Crimstone; - frameXAdd = 270; - break; - case ConvertType.Hallow: - originType = TileID.Pearlstone; - frameXAdd = 216; - break; - } - ReplaceAstralStalactite((ushort)type, TileID.Stalactite, originType, x, y, frameXAdd, 0); - } - else if (type == mod.TileType("AstralDesertStalactite")) - { - ushort originType = TileID.Sandstone; - int frameXAdd = 378; - switch (convert) - { - case ConvertType.Corrupt: - originType = TileID.CorruptSandstone; - frameXAdd = 324; - break; - case ConvertType.Crimson: - originType = TileID.CrimsonSandstone; - frameXAdd = 270; - break; - case ConvertType.Hallow: - originType = TileID.HallowSandstone; - frameXAdd = 216; - break; - } - ReplaceAstralStalactite((ushort)type, TileID.Stalactite, originType, x, y, frameXAdd, 0); - } - else if (type == mod.TileType("AstralIceStalactite")) - { - ReplaceAstralStalactite((ushort)type, TileID.Stalactite, TileID.IceBlock, x, y, 0, 0); - } - if (TileID.Sets.Conversion.Grass[type] || type == TileID.Dirt) - { - WorldGen.SquareTileFrame(x, y); - } - } - #endregion - } - } - - private static void SetTileFromConvert(int x, int y, ConvertType convert, ushort corrupt, ushort crimson, ushort hallow, ushort pure) - { - switch (convert) - { - case ConvertType.Corrupt: - if (corrupt != ushort.MaxValue) - { - Main.tile[x, y].type = corrupt; - WorldGen.SquareTileFrame(x, y); - } - break; - case ConvertType.Crimson: - if (crimson != ushort.MaxValue) - { - Main.tile[x, y].type = crimson; - WorldGen.SquareTileFrame(x, y); - } - break; - case ConvertType.Hallow: - if (hallow != ushort.MaxValue) - { - Main.tile[x, y].type = hallow; - WorldGen.SquareTileFrame(x, y); - } - break; - case ConvertType.Pure: - if (pure != ushort.MaxValue) - { - Main.tile[x, y].type = pure; - WorldGen.SquareTileFrame(x, y); - } - break; - } - } - - private static void RecursiveReplaceToAstral(ushort checkType, ushort replaceType, int x, int y, int replaceTextureWidth, int minFrameX = 0, int maxFrameX = int.MaxValue, int minFrameY = 0, int maxFrameY = int.MaxValue) - { - Tile tile = Main.tile[x, y]; - if (tile == null || !tile.active() || tile.type != checkType || tile.frameX < minFrameX || tile.frameX > maxFrameX || tile.frameY < minFrameY || tile.frameY > maxFrameY) - return; - - Main.tile[x, y].type = replaceType; - while (Main.tile[x, y].frameX >= replaceTextureWidth) - { - Main.tile[x, y].frameX -= (short)replaceTextureWidth; - } - - if (Main.tile[x - 1, y] != null) - RecursiveReplaceToAstral(checkType, replaceType, x - 1, y, replaceTextureWidth, minFrameX, maxFrameX, minFrameY, maxFrameY); - if (Main.tile[x + 1, y] != null) - RecursiveReplaceToAstral(checkType, replaceType, x + 1, y, replaceTextureWidth, minFrameX, maxFrameX, minFrameY, maxFrameY); - if (Main.tile[x, y - 1] != null) - RecursiveReplaceToAstral(checkType, replaceType, x, y - 1, replaceTextureWidth, minFrameX, maxFrameX, minFrameY, maxFrameY); - if (Main.tile[x, y + 1] != null) - RecursiveReplaceToAstral(checkType, replaceType, x, y + 1, replaceTextureWidth, minFrameX, maxFrameX, minFrameY, maxFrameY); - } - - private static void RecursiveReplaceFromAstral(ushort checkType, ushort replaceType, int x, int y, int addFrameX, int addFrameY) - { - Tile tile = Main.tile[x, y]; - if (tile == null || !tile.active() || tile.type != checkType) - return; - - Main.tile[x, y].type = replaceType; - Main.tile[x, y].frameX += (short)addFrameX; - Main.tile[x, y].frameY += (short)addFrameY; - - if (Main.tile[x - 1, y] != null) - RecursiveReplaceFromAstral(checkType, replaceType, x - 1, y, addFrameX, addFrameY); - if (Main.tile[x + 1, y] != null) - RecursiveReplaceFromAstral(checkType, replaceType, x + 1, y, addFrameX, addFrameY); - if (Main.tile[x, y - 1] != null) - RecursiveReplaceFromAstral(checkType, replaceType, x, y - 1, addFrameX, addFrameY); - if (Main.tile[x, y + 1] != null) - RecursiveReplaceFromAstral(checkType, replaceType, x, y + 1, addFrameX, addFrameY); - } - - private static void ReplaceAstralStalactite(ushort checkType, ushort replaceType, ushort replaceOriginTile, int x, int y, int addFrameX, int addFrameY) - { - Tile tile = Main.tile[x, y]; - - int topMost = tile.frameY <= 54 ? (tile.frameY % 36 == 0 ? y : y - 1) : y; - bool twoTall = tile.frameY <= 54; - bool hanging = tile.frameY <= 18 || tile.frameY == 72; - - int yOriginTile = (hanging ? topMost - 1 : (twoTall ? topMost + 2 : y + 1)); - - if (Main.tile[x, topMost++] != null) - Main.tile[x, topMost++].type = replaceType; - if (twoTall) - { - if (Main.tile[x, topMost] != null) - Main.tile[x, topMost].type = replaceType; - } - if (Main.tile[x, yOriginTile] != null) - Main.tile[x, yOriginTile].type = replaceOriginTile; - } - - private static bool CheckInEllipse(Point tile, Vector2 focus1, Vector2 focus2, float distanceConstant, Vector2 center, out float distance, bool collapse = false) - { - Vector2 point = tile.ToVector2() * 16f + new Vector2(8f); - if (collapse) //Collapse ensures the ellipse is shrunk down a lot in terms of distance. - { - float distY = center.Y - point.Y; - point.Y -= distY * 8f; - } - float distance1 = Vector2.Distance(point, focus1); - float distance2 = Vector2.Distance(point, focus2); - distance = distance1 + distance2; - return distance <= distanceConstant; - } - #endregion - - #region EvilIsland - public static void EvilIsland(int i, int j) - { - double num = (double)WorldGen.genRand.Next(100, 150); //100 150 - float num2 = (float)WorldGen.genRand.Next(20, 30); //20 30 - int num3 = i; - int num4 = i; - int num5 = i; - int num6 = j; - Vector2 vector; - vector.X = (float)i; - vector.Y = (float)j; - Vector2 vector2; - vector2.X = (float)WorldGen.genRand.Next(-20, 21) * 0.2f; - while (vector2.X > -2f && vector2.X < 2f) - { - vector2.X = (float)WorldGen.genRand.Next(-20, 21) * 0.2f; - } - vector2.Y = (float)WorldGen.genRand.Next(-20, -10) * 0.02f; - while (num > 0.0 && num2 > 0f) - { - num -= (double)WorldGen.genRand.Next(4); - num2 -= 1f; - int num7 = (int)((double)vector.X - num * 0.5); - int num8 = (int)((double)vector.X + num * 0.5); - int num9 = (int)((double)vector.Y - num * 0.5); - int num10 = (int)((double)vector.Y + num * 0.5); - if (num7 < 0) - { - num7 = 0; - } - if (num8 > Main.maxTilesX) - { - num8 = Main.maxTilesX; - } - if (num9 < 0) - { - num9 = 0; - } - if (num10 > Main.maxTilesY) - { - num10 = Main.maxTilesY; - } - double num11 = num * (double)WorldGen.genRand.Next(80, 120) * 0.01; //80 120 - float num12 = vector.Y + 1f; - for (int k = num7; k < num8; k++) - { - if (WorldGen.genRand.Next(2) == 0) - { - num12 += (float)WorldGen.genRand.Next(-1, 2); - } - if (num12 < vector.Y) - { - num12 = vector.Y; - } - if (num12 > vector.Y + 2f) - { - num12 = vector.Y + 2f; - } - for (int l = num9; l < num10; l++) - { - if ((float)l > num12) - { - float arg_218_0 = Math.Abs((float)k - vector.X); - float num13 = Math.Abs((float)l - vector.Y) * 3f; - if (Math.Sqrt((double)(arg_218_0 * arg_218_0 + num13 * num13)) < num11 * 0.4) - { - if (k < num3) - { - num3 = k; - } - if (k > num4) - { - num4 = k; - } - if (l < num5) - { - num5 = l; - } - if (l > num6) - { - num6 = l; - } - Main.tile[k, l].active(true); - Main.tile[k, l].type = (ushort)(WorldGen.crimson ? 400 : 401); //ebonstone or crimstone - WorldGen.SquareTileFrame(k, l, true); - } - } - } - } - vector += vector2; - vector2.X += (float)WorldGen.genRand.Next(-20, 21) * 0.05f; - if (vector2.X > 1f) - { - vector2.X = 1f; - } - if (vector2.X < -1f) - { - vector2.X = -1f; - } - if ((double)vector2.Y > 0.2) - { - vector2.Y = -0.2f; - } - if ((double)vector2.Y < -0.2) - { - vector2.Y = -0.2f; - } - } - int m = num3; - int num15; - for (m += WorldGen.genRand.Next(5); m < num4; m += WorldGen.genRand.Next(num15, (int)((double)num15 * 1.5))) - { - int num14 = num6; - while (!Main.tile[m, num14].active()) - { - num14--; - } - num14 += WorldGen.genRand.Next(-3, 4); - num15 = WorldGen.genRand.Next(4, 8); - int num16 = (WorldGen.crimson ? 400 : 401); - if (WorldGen.genRand.Next(4) == 0) - { - num16 = (WorldGen.crimson ? 398 : 399); - } - for (int n = m - num15; n <= m + num15; n++) - { - for (int num17 = num14 - num15; num17 <= num14 + num15; num17++) - { - if (num17 > num5) - { - float arg_409_0 = (float)Math.Abs(n - m); - float num18 = (float)(Math.Abs(num17 - num14) * 2); - if (Math.Sqrt((double)(arg_409_0 * arg_409_0 + num18 * num18)) < (double)(num15 + WorldGen.genRand.Next(2))) - { - Main.tile[n, num17].active(true); - Main.tile[n, num17].type = (ushort)num16; - WorldGen.SquareTileFrame(n, num17, true); - } - } - } - } - } - num = (double)WorldGen.genRand.Next(80, 95); - num2 = (float)WorldGen.genRand.Next(10, 15); - vector.X = (float)i; - vector.Y = (float)num5; - vector2.X = (float)WorldGen.genRand.Next(-20, 21) * 0.2f; - while (vector2.X > -2f && vector2.X < 2f) - { - vector2.X = (float)WorldGen.genRand.Next(-20, 21) * 0.2f; - } - vector2.Y = (float)WorldGen.genRand.Next(-20, -10) * 0.02f; - while (num > 0.0 && num2 > 0f) - { - num -= (double)WorldGen.genRand.Next(4); - num2 -= 1f; - int num7 = (int)((double)vector.X - num * 0.5); - int num8 = (int)((double)vector.X + num * 0.5); - int num9 = num5 - 1; - int num10 = (int)((double)vector.Y + num * 0.5); - if (num7 < 0) - { - num7 = 0; - } - if (num8 > Main.maxTilesX) - { - num8 = Main.maxTilesX; - } - if (num9 < 0) - { - num9 = 0; - } - if (num10 > Main.maxTilesY) - { - num10 = Main.maxTilesY; - } - double num11 = num * (double)WorldGen.genRand.Next(80, 120) * 0.01; - float num19 = vector.Y + 1f; - for (int num20 = num7; num20 < num8; num20++) - { - if (WorldGen.genRand.Next(2) == 0) - { - num19 += (float)WorldGen.genRand.Next(-1, 2); - } - if (num19 < vector.Y) - { - num19 = vector.Y; - } - if (num19 > vector.Y + 2f) - { - num19 = vector.Y + 2f; - } - for (int num21 = num9; num21 < num10; num21++) - { - if ((float)num21 > num19) - { - float arg_69E_0 = Math.Abs((float)num20 - vector.X); - float num22 = Math.Abs((float)num21 - vector.Y) * 3f; - if (Math.Sqrt((double)(arg_69E_0 * arg_69E_0 + num22 * num22)) < num11 * 0.4 && - Main.tile[num20, num21].type == (WorldGen.crimson ? 400 : 401)) - { - Main.tile[num20, num21].type = (ushort)(WorldGen.crimson ? 22 : 204); //ore - WorldGen.SquareTileFrame(num20, num21, true); - } - } - } - } - vector += vector2; - vector2.X += (float)WorldGen.genRand.Next(-20, 21) * 0.05f; - if (vector2.X > 1f) - { - vector2.X = 1f; - } - if (vector2.X < -1f) - { - vector2.X = -1f; - } - if ((double)vector2.Y > 0.2) - { - vector2.Y = -0.2f; - } - if ((double)vector2.Y < -0.2) - { - vector2.Y = -0.2f; - } - } - int num23 = num3; - num23 += WorldGen.genRand.Next(5); - while (num23 < num4) - { - int num24 = num6; - while ((!Main.tile[num23, num24].active() || Main.tile[num23, num24].type != 0) && num23 < num4) - { - num24--; - if (num24 < num5) - { - num24 = num6; - num23 += WorldGen.genRand.Next(1, 4); - } - } - if (num23 < num4) - { - num24 += WorldGen.genRand.Next(0, 4); - int num25 = WorldGen.genRand.Next(2, 5); - int num26 = (WorldGen.crimson ? 400 : 401); - for (int num27 = num23 - num25; num27 <= num23 + num25; num27++) - { - for (int num28 = num24 - num25; num28 <= num24 + num25; num28++) - { - if (num28 > num5) - { - float arg_890_0 = (float)Math.Abs(num27 - num23); - float num29 = (float)(Math.Abs(num28 - num24) * 2); - if (Math.Sqrt((double)(arg_890_0 * arg_890_0 + num29 * num29)) < (double)num25) - { - Main.tile[num27, num28].type = (ushort)num26; - WorldGen.SquareTileFrame(num27, num28, true); - } - } - } - } - num23 += WorldGen.genRand.Next(num25, (int)((double)num25 * 1.5)); - } - } - for (int num30 = num3 - 20; num30 <= num4 + 20; num30++) - { - for (int num31 = num5 - 20; num31 <= num6 + 20; num31++) - { - bool flag = true; - for (int num32 = num30 - 1; num32 <= num30 + 1; num32++) - { - for (int num33 = num31 - 1; num33 <= num31 + 1; num33++) - { - if (!Main.tile[num32, num33].active()) - { - flag = false; - } - } - } - if (flag) - { - Main.tile[num30, num31].wall = (ushort)(WorldGen.crimson ? 220 : 221); - WorldGen.SquareWallFrame(num30, num31, true); - } - } - } - for (int num34 = num3; num34 <= num4; num34++) - { - int num35 = num5 - 10; - while (!Main.tile[num34, num35 + 1].active()) - { - num35++; - } - if (num35 < num6 && Main.tile[num34, num35 + 1].type == (WorldGen.crimson ? 400 : 401)) - { - if (WorldGen.genRand.Next(10) == 0) - { - int num36 = WorldGen.genRand.Next(1, 3); - for (int num37 = num34 - num36; num37 <= num34 + num36; num37++) - { - if (Main.tile[num37, num35].type == (WorldGen.crimson ? 400 : 401)) - { - Main.tile[num37, num35].active(false); - Main.tile[num37, num35].liquid = 255; - Main.tile[num37, num35].lava(false); - WorldGen.SquareTileFrame(num34, num35, true); - } - if (Main.tile[num37, num35 + 1].type == (WorldGen.crimson ? 400 : 401)) - { - Main.tile[num37, num35 + 1].active(false); - Main.tile[num37, num35 + 1].liquid = 255; - Main.tile[num37, num35 + 1].lava(false); - WorldGen.SquareTileFrame(num34, num35 + 1, true); - } - if (num37 > num34 - num36 && num37 < num34 + 2 && Main.tile[num37, num35 + 2].type == (WorldGen.crimson ? 400 : 401)) - { - Main.tile[num37, num35 + 2].active(false); - Main.tile[num37, num35 + 2].liquid = 255; - Main.tile[num37, num35 + 2].lava(false); - WorldGen.SquareTileFrame(num34, num35 + 2, true); - } - } - } - if (WorldGen.genRand.Next(5) == 0) - { - Main.tile[num34, num35].liquid = 255; - } - Main.tile[num34, num35].lava(false); - WorldGen.SquareTileFrame(num34, num35, true); - } - } - int num38 = WorldGen.genRand.Next(4); - for (int num39 = 0; num39 <= num38; num39++) - { - int num40 = WorldGen.genRand.Next(num3 - 5, num4 + 5); - int num41 = num5 - WorldGen.genRand.Next(20, 40); - int num42 = WorldGen.genRand.Next(4, 8); - int num43 = (WorldGen.crimson ? 400 : 401); - if (WorldGen.genRand.Next(2) == 0) - { - num43 = (WorldGen.crimson ? 398 : 399); - } - for (int num44 = num40 - num42; num44 <= num40 + num42; num44++) - { - for (int num45 = num41 - num42; num45 <= num41 + num42; num45++) - { - float arg_C74_0 = (float)Math.Abs(num44 - num40); - float num46 = (float)(Math.Abs(num45 - num41) * 2); - if (Math.Sqrt((double)(arg_C74_0 * arg_C74_0 + num46 * num46)) < (double)(num42 + WorldGen.genRand.Next(-1, 2))) - { - Main.tile[num44, num45].active(true); - Main.tile[num44, num45].type = (ushort)num43; - WorldGen.SquareTileFrame(num44, num45, true); - } - } - } - for (int num47 = num40 - num42 + 2; num47 <= num40 + num42 - 2; num47++) - { - int num48 = num41 - num42; - while (!Main.tile[num47, num48].active()) - { - num48++; - } - Main.tile[num47, num48].active(false); - Main.tile[num47, num48].liquid = 255; - WorldGen.SquareTileFrame(num47, num48, true); - } - } - } - #endregion - - #region EvilIslandHouse - public static void EvilIslandHouse(int i, int j) - { - ushort type = (ushort)(WorldGen.crimson ? 152 : 347); //tile - byte wall = (byte)(WorldGen.crimson ? 35 : 174); //wall - Vector2 vector = new Vector2((float)i, (float)j); - int num = 1; - if (WorldGen.genRand.Next(2) == 0) - { - num = -1; - } - int num2 = WorldGen.genRand.Next(7, 12); - int num3 = WorldGen.genRand.Next(5, 7); - vector.X = (float)(i + (num2 + 2) * num); - for (int k = j - 15; k < j + 30; k++) - { - if (Main.tile[(int)vector.X, k].active()) - { - vector.Y = (float)(k - 1); - break; - } - } - vector.X = (float)i; - int num4 = (int)(vector.X - (float)num2 - 1f); - int num5 = (int)(vector.X + (float)num2 + 1f); - int num6 = (int)(vector.Y - (float)num3 - 1f); - int num7 = (int)(vector.Y + 2f); - if (num4 < 0) - { - num4 = 0; - } - if (num5 > Main.maxTilesX) - { - num5 = Main.maxTilesX; - } - if (num6 < 0) - { - num6 = 0; - } - if (num7 > Main.maxTilesY) - { - num7 = Main.maxTilesY; - } - for (int l = num4; l <= num5; l++) - { - for (int m = num6 - 1; m < num7 + 1; m++) - { - if (m != num6 - 1 || (l != num4 && l != num5)) - { - Main.tile[l, m].active(true); - Main.tile[l, m].liquid = 0; - Main.tile[l, m].type = type; - Main.tile[l, m].wall = 0; - Main.tile[l, m].halfBrick(false); - Main.tile[l, m].slope(0); - } - } - } - num4 = (int)(vector.X - (float)num2); - num5 = (int)(vector.X + (float)num2); - num6 = (int)(vector.Y - (float)num3); - num7 = (int)(vector.Y + 1f); - if (num4 < 0) - { - num4 = 0; - } - if (num5 > Main.maxTilesX) - { - num5 = Main.maxTilesX; - } - if (num6 < 0) - { - num6 = 0; - } - if (num7 > Main.maxTilesY) - { - num7 = Main.maxTilesY; - } - for (int n = num4; n <= num5; n++) - { - for (int num8 = num6; num8 < num7; num8++) - { - if ((num8 != num6 || (n != num4 && n != num5)) && Main.tile[n, num8].wall == 0) - { - Main.tile[n, num8].active(false); - Main.tile[n, num8].wall = wall; - } - } - } - int num9 = i + (num2 + 1) * num; - int num10 = (int)vector.Y; - for (int num11 = num9 - 2; num11 <= num9 + 2; num11++) - { - Main.tile[num11, num10].active(false); - Main.tile[num11, num10 - 1].active(false); - Main.tile[num11, num10 - 2].active(false); - } - WorldGen.PlaceTile(num9, num10, 10, true, false, -1, (WorldGen.crimson ? 1 : 10)); //door - num9 = i + (num2 + 1) * -num - num; - for (int num12 = num6; num12 <= num7 + 1; num12++) - { - Main.tile[num9, num12].active(true); - Main.tile[num9, num12].liquid = 0; - Main.tile[num9, num12].type = type; - Main.tile[num9, num12].wall = 0; - Main.tile[num9, num12].halfBrick(false); - Main.tile[num9, num12].slope(0); - } - int contain = 0; - if (WorldGen.crimson) - { - contain = 1571; //scourge - } - else - { - contain = 1569; //vampire - } - WorldGen.AddBuriedChest(i, num10 - 3, contain, false, (WorldGen.crimson ? 19 : 20)); //chest - int num14 = i - num2 / 2 + 1; - int num15 = i + num2 / 2 - 1; - int num16 = 1; - if (num2 > 10) - { - num16 = 2; - } - int num17 = (num6 + num7) / 2 - 1; - for (int num18 = num14 - num16; num18 <= num14 + num16; num18++) - { - for (int num19 = num17 - 1; num19 <= num17 + 1; num19++) - { - Main.tile[num18, num19].wall = 21; //glass - } - } - for (int num20 = num15 - num16; num20 <= num15 + num16; num20++) - { - for (int num21 = num17 - 1; num21 <= num17 + 1; num21++) - { - Main.tile[num20, num21].wall = 21; //glass - } - } - int num22 = i + (num2 / 2 + 1) * -num; - WorldGen.PlaceTile(num22, num7 - 1, 14, true, false, -1, (WorldGen.crimson ? 1 : 8)); //table - WorldGen.PlaceTile(num22 - 2, num7 - 1, 15, true, false, 0, (WorldGen.crimson ? 2 : 11)); //chair - Tile expr_510 = Main.tile[num22 - 2, num7 - 1]; - expr_510.frameX += 18; - Tile expr_531 = Main.tile[num22 - 2, num7 - 2]; - expr_531.frameX += 18; - WorldGen.PlaceTile(num22 + 2, num7 - 1, 15, true, false, 0, (WorldGen.crimson ? 2 : 11)); //chair - } - #endregion - - #region UnderworldIsland - public static void UnderworldIsland(int i, int j, int sizeMin, int sizeMax, int sizeMin2, int sizeMax2) - { - Mod mod = ModLoader.GetMod("CalamityMod"); - double num = (double)WorldGen.genRand.Next(sizeMin, sizeMax); //100 150 - float num2 = (float)WorldGen.genRand.Next(sizeMin / 5, sizeMax / 5); //20 30 - int num3 = i; - int num4 = i; - int num5 = i; - int num6 = j; - Vector2 vector; - vector.X = (float)i; - vector.Y = (float)j; - Vector2 vector2; - vector2.X = (float)WorldGen.genRand.Next(-20, 21) * 0.2f; - while (vector2.X > -2f && vector2.X < 2f) - { - vector2.X = (float)WorldGen.genRand.Next(-20, 21) * 0.2f; - } - vector2.Y = (float)WorldGen.genRand.Next(-20, -10) * 0.02f; - while (num > 0.0 && num2 > 0f) - { - num -= (double)WorldGen.genRand.Next(4); - num2 -= 1f; - int num7 = (int)((double)vector.X - num * 0.5); - int num8 = (int)((double)vector.X + num * 0.5); - int num9 = (int)((double)vector.Y - num * 0.5); - int num10 = (int)((double)vector.Y + num * 0.5); - if (num7 < 0) - { - num7 = 0; - } - if (num8 > Main.maxTilesX) - { - num8 = Main.maxTilesX; - } - if (num9 < 0) - { - num9 = 0; - } - if (num10 > Main.maxTilesY) - { - num10 = Main.maxTilesY; - } - double num11 = num * (double)WorldGen.genRand.Next(sizeMin, sizeMax) * 0.01; //80 120 - float num12 = vector.Y + 1f; - for (int k = num7; k < num8; k++) - { - if (WorldGen.genRand.Next(2) == 0) - { - num12 += (float)WorldGen.genRand.Next(-1, 2); - } - if (num12 < vector.Y) - { - num12 = vector.Y; - } - if (num12 > vector.Y + 2f) - { - num12 = vector.Y + 2f; - } - for (int l = num9; l < num10; l++) - { - if ((float)l > num12) - { - float arg_218_0 = Math.Abs((float)k - vector.X); - float num13 = Math.Abs((float)l - vector.Y) * 3f; - if (Math.Sqrt((double)(arg_218_0 * arg_218_0 + num13 * num13)) < num11 * 0.4) - { - if (k < num3) - { - num3 = k; - } - if (k > num4) - { - num4 = k; - } - if (l < num5) - { - num5 = l; - } - if (l > num6) - { - num6 = l; - } - Main.tile[k, l].active(true); - Main.tile[k, l].type = (ushort)mod.TileType("BrimstoneSlag"); - WorldGen.SquareTileFrame(k, l, true); - } - } - } - } - vector += vector2; - vector2.X += (float)WorldGen.genRand.Next(-20, 21) * 0.05f; - if (vector2.X > 1f) - { - vector2.X = 1f; - } - if (vector2.X < -1f) - { - vector2.X = -1f; - } - if ((double)vector2.Y > 0.2) - { - vector2.Y = -0.2f; - } - if ((double)vector2.Y < -0.2) - { - vector2.Y = -0.2f; - } - } - int m = num3; - int num15; - for (m += WorldGen.genRand.Next(5); m < num4; m += WorldGen.genRand.Next(num15, (int)((double)num15 * 1.5))) - { - int num14 = num6; - while (!Main.tile[m, num14].active()) - { - num14--; - } - num14 += WorldGen.genRand.Next(-3, 4); - num15 = WorldGen.genRand.Next(4, 8); - int num16 = mod.TileType("BrimstoneSlag"); - if (WorldGen.genRand.Next(4) == 0) - { - num16 = mod.TileType("CharredOre"); - } - for (int n = m - num15; n <= m + num15; n++) - { - for (int num17 = num14 - num15; num17 <= num14 + num15; num17++) - { - if (num17 > num5) - { - float arg_409_0 = (float)Math.Abs(n - m); - float num18 = (float)(Math.Abs(num17 - num14) * 2); - if (Math.Sqrt((double)(arg_409_0 * arg_409_0 + num18 * num18)) < (double)(num15 + WorldGen.genRand.Next(2))) - { - Main.tile[n, num17].active(true); - Main.tile[n, num17].type = (ushort)num16; - WorldGen.SquareTileFrame(n, num17, true); - } - } - } - } - } - num = (double)WorldGen.genRand.Next(sizeMin2, sizeMax2); - num2 = (float)WorldGen.genRand.Next(sizeMin2 / 8, sizeMax2 / 8); - vector.X = (float)i; - vector.Y = (float)num5; - vector2.X = (float)WorldGen.genRand.Next(-20, 21) * 0.2f; - while (vector2.X > -2f && vector2.X < 2f) - { - vector2.X = (float)WorldGen.genRand.Next(-20, 21) * 0.2f; - } - vector2.Y = (float)WorldGen.genRand.Next(-20, -10) * 0.02f; - while (num > 0.0 && num2 > 0f) - { - num -= (double)WorldGen.genRand.Next(4); - num2 -= 1f; - vector += vector2; - vector2.X += (float)WorldGen.genRand.Next(-20, 21) * 0.05f; - if (vector2.X > 1f) - { - vector2.X = 1f; - } - if (vector2.X < -1f) - { - vector2.X = -1f; - } - if ((double)vector2.Y > 0.2) - { - vector2.Y = -0.2f; - } - if ((double)vector2.Y < -0.2) - { - vector2.Y = -0.2f; - } - } - int num23 = num3; - num23 += WorldGen.genRand.Next(5); - while (num23 < num4) - { - int num24 = num6; - while ((!Main.tile[num23, num24].active() || Main.tile[num23, num24].type != 0) && num23 < num4) - { - num24--; - if (num24 < num5) - { - num24 = num6; - num23 += WorldGen.genRand.Next(1, 4); - } - } - if (num23 < num4) - { - num24 += WorldGen.genRand.Next(0, 4); - int num25 = WorldGen.genRand.Next(2, 5); - int num26 = mod.TileType("BrimstoneSlag"); - for (int num27 = num23 - num25; num27 <= num23 + num25; num27++) - { - for (int num28 = num24 - num25; num28 <= num24 + num25; num28++) - { - if (num28 > num5) - { - float arg_890_0 = (float)Math.Abs(num27 - num23); - float num29 = (float)(Math.Abs(num28 - num24) * 2); - if (Math.Sqrt((double)(arg_890_0 * arg_890_0 + num29 * num29)) < (double)num25) - { - Main.tile[num27, num28].type = (ushort)num26; - WorldGen.SquareTileFrame(num27, num28, true); - } - } - } - } - num23 += WorldGen.genRand.Next(num25, (int)((double)num25 * 1.5)); - } - } - for (int num34 = num3; num34 <= num4; num34++) - { - int num35 = num5 - 10; - while (!Main.tile[num34, num35 + 1].active()) - { - num35++; - } - if (num35 < num6 && Main.tile[num34, num35 + 1].type == (ushort)mod.TileType("BrimstoneSlag")) - { - if (WorldGen.genRand.Next(10) == 0) - { - int num36 = WorldGen.genRand.Next(1, 3); - for (int num37 = num34 - num36; num37 <= num34 + num36; num37++) - { - if (Main.tile[num37, num35].type == (ushort)mod.TileType("BrimstoneSlag")) - { - Main.tile[num37, num35].active(false); - Main.tile[num37, num35].liquid = 255; - Main.tile[num37, num35].lava(false); - WorldGen.SquareTileFrame(num34, num35, true); - } - if (Main.tile[num37, num35 + 1].type == (ushort)mod.TileType("BrimstoneSlag")) - { - Main.tile[num37, num35 + 1].active(false); - Main.tile[num37, num35 + 1].liquid = 255; - Main.tile[num37, num35 + 1].lava(false); - WorldGen.SquareTileFrame(num34, num35 + 1, true); - } - if (num37 > num34 - num36 && num37 < num34 + 2 && Main.tile[num37, num35 + 2].type == (ushort)mod.TileType("BrimstoneSlag")) - { - Main.tile[num37, num35 + 2].active(false); - Main.tile[num37, num35 + 2].liquid = 255; - Main.tile[num37, num35 + 2].lava(false); - WorldGen.SquareTileFrame(num34, num35 + 2, true); - } - } - } - if (WorldGen.genRand.Next(5) == 0) - { - Main.tile[num34, num35].liquid = 255; - } - Main.tile[num34, num35].lava(false); - WorldGen.SquareTileFrame(num34, num35, true); - } - } - } - #endregion - - #region UnderworldIslandHouse - public static void UnderworldIslandHouse(int i, int j, int item) - { - Mod mod = ModLoader.GetMod("CalamityMod"); - ushort type = (ushort)mod.TileType("BrimstoneSlag"); //tile - byte wall = (byte)14; //wall - Vector2 vector = new Vector2((float)i, (float)j); - int num = 1; - if (WorldGen.genRand.Next(2) == 0) - { - num = -1; - } - int num2 = WorldGen.genRand.Next(7, 12); - int num3 = WorldGen.genRand.Next(5, 7); - vector.X = (float)(i + (num2 + 2) * num); - for (int k = j - 15; k < j + 30; k++) - { - if (Main.tile[(int)vector.X, k].active()) - { - vector.Y = (float)(k - 1); - break; - } - } - vector.X = (float)i; - int num4 = (int)(vector.X - (float)num2 - 1f); - int num5 = (int)(vector.X + (float)num2 + 1f); - int num6 = (int)(vector.Y - (float)num3 - 1f); - int num7 = (int)(vector.Y + 2f); - if (num4 < 0) - { - num4 = 0; - } - if (num5 > Main.maxTilesX) - { - num5 = Main.maxTilesX; - } - if (num6 < 0) - { - num6 = 0; - } - if (num7 > Main.maxTilesY) - { - num7 = Main.maxTilesY; - } - for (int l = num4; l <= num5; l++) - { - for (int m = num6 - 1; m < num7 + 1; m++) - { - if (m != num6 - 1 || (l != num4 && l != num5)) - { - Main.tile[l, m].active(true); - Main.tile[l, m].liquid = 0; - Main.tile[l, m].type = type; - Main.tile[l, m].wall = 0; - Main.tile[l, m].halfBrick(false); - Main.tile[l, m].slope(0); - } - } - } - num4 = (int)(vector.X - (float)num2); - num5 = (int)(vector.X + (float)num2); - num6 = (int)(vector.Y - (float)num3); - num7 = (int)(vector.Y + 1f); - if (num4 < 0) - { - num4 = 0; - } - if (num5 > Main.maxTilesX) - { - num5 = Main.maxTilesX; - } - if (num6 < 0) - { - num6 = 0; - } - if (num7 > Main.maxTilesY) - { - num7 = Main.maxTilesY; - } - for (int n = num4; n <= num5; n++) - { - for (int num8 = num6; num8 < num7; num8++) - { - if ((num8 != num6 || (n != num4 && n != num5)) && Main.tile[n, num8].wall == 0) - { - Main.tile[n, num8].active(false); - Main.tile[n, num8].wall = wall; - } - } - } - int num9 = i + (num2 + 1) * num; - int num10 = (int)vector.Y; - for (int num11 = num9 - 2; num11 <= num9 + 2; num11++) - { - Main.tile[num11, num10].active(false); - Main.tile[num11, num10 - 1].active(false); - Main.tile[num11, num10 - 2].active(false); - } - WorldGen.PlaceTile(num9, num10, 10, true, false, -1, 19); //door - num9 = i + (num2 + 1) * -num - num; - for (int num12 = num6; num12 <= num7 + 1; num12++) - { - Main.tile[num9, num12].active(true); - Main.tile[num9, num12].liquid = 0; - Main.tile[num9, num12].type = type; - Main.tile[num9, num12].wall = 0; - Main.tile[num9, num12].halfBrick(false); - Main.tile[num9, num12].slope(0); - } - WorldGen.AddBuriedChest(i, num10 - 3, item, false, 4); //chest - int num22 = i + (num2 / 2 + 1) * -num; - WorldGen.PlaceTile(num22, num7 - 1, 14, true, false, -1, 13); //table - WorldGen.PlaceTile(num22 - 2, num7 - 1, 15, true, false, 0, 16); //chair - Tile expr_510 = Main.tile[num22 - 2, num7 - 1]; - expr_510.frameX += 18; - Tile expr_531 = Main.tile[num22 - 2, num7 - 2]; - expr_531.frameX += 18; - WorldGen.PlaceTile(num22 + 2, num7 - 1, 15, true, false, 0, 16); //chair - } - #endregion - - #region AbyssIsland - public static void AbyssIsland(int i, int j, int sizeMin, int sizeMax, int sizeMin2, int sizeMax2, bool hasChest, bool hasTenebris, bool isVoid) - { - Mod mod = ModLoader.GetMod("CalamityMod"); - int sizeMinSmall = sizeMin / 5; - int sizeMaxSmall = sizeMax / 5; - double num = (double)WorldGen.genRand.Next(sizeMin, sizeMax); //100 150 - float num2 = (float)WorldGen.genRand.Next(sizeMinSmall, sizeMaxSmall); //20 30 - int num3 = i; - int num4 = i; - int num5 = i; - int num6 = j; - Vector2 vector; - vector.X = (float)i; - vector.Y = (float)j; - Vector2 vector2; - vector2.X = (float)WorldGen.genRand.Next(-20, 21) * 0.2f; - while (vector2.X > -2f && vector2.X < 2f) - { - vector2.X = (float)WorldGen.genRand.Next(-20, 21) * 0.2f; - } - vector2.Y = (float)WorldGen.genRand.Next(-20, -10) * 0.02f; - while (num > 0.0 && num2 > 0f) - { - num -= (double)WorldGen.genRand.Next(4); - num2 -= 1f; - int num7 = (int)((double)vector.X - num * 0.5); - int num8 = (int)((double)vector.X + num * 0.5); - int num9 = (int)((double)vector.Y - num * 0.5); - int num10 = (int)((double)vector.Y + num * 0.5); - if (num7 < 0) - { - num7 = 0; - } - if (num8 > Main.maxTilesX) - { - num8 = Main.maxTilesX; - } - if (num9 < 0) - { - num9 = 0; - } - if (num10 > Main.maxTilesY) - { - num10 = Main.maxTilesY; - } - double num11 = num * (double)WorldGen.genRand.Next(sizeMin, sizeMax) * 0.01; //80 120 - float num12 = vector.Y + 1f; - for (int k = num7; k < num8; k++) - { - if (WorldGen.genRand.Next(2) == 0) - { - num12 += (float)WorldGen.genRand.Next(-1, 2); - } - if (num12 < vector.Y) - { - num12 = vector.Y; - } - if (num12 > vector.Y + 2f) - { - num12 = vector.Y + 2f; - } - for (int l = num9; l < num10; l++) - { - if ((float)l > num12) - { - float arg_218_0 = Math.Abs((float)k - vector.X); - float num13 = Math.Abs((float)l - vector.Y) * 3f; - if (Math.Sqrt((double)(arg_218_0 * arg_218_0 + num13 * num13)) < num11 * 0.4) - { - if (k < num3) - { - num3 = k; - } - if (k > num4) - { - num4 = k; - } - if (l < num5) - { - num5 = l; - } - if (l > num6) - { - num6 = l; - } - Main.tile[k, l].active(true); - Main.tile[k, l].type = (ushort)(isVoid ? mod.TileType("Voidstone") : mod.TileType("AbyssGravel")); - SafeSquareTileFrame(k, l, true); - } - } - } - } - vector += vector2; - vector2.X += (float)WorldGen.genRand.Next(-20, 21) * 0.05f; - if (vector2.X > 1f) - { - vector2.X = 1f; - } - if (vector2.X < -1f) - { - vector2.X = -1f; - } - if ((double)vector2.Y > 0.2) - { - vector2.Y = -0.2f; - } - if ((double)vector2.Y < -0.2) - { - vector2.Y = -0.2f; - } - } - int m = num3; - int num15; - for (m += WorldGen.genRand.Next(5); m < num4; m += WorldGen.genRand.Next(num15, (int)((double)num15 * 1.5))) - { - int num14 = num6; - while (!Main.tile[m, num14].active()) - { - num14--; - } - num14 += WorldGen.genRand.Next(-3, 4); - num15 = WorldGen.genRand.Next(4, 8); - int num16 = (isVoid ? mod.TileType("Voidstone") : mod.TileType("AbyssGravel")); - if (WorldGen.genRand.Next(4) == 0) - { - num16 = (hasChest ? mod.TileType("ChaoticOre") : mod.TileType("PlantyMush")); - } - for (int n = m - num15; n <= m + num15; n++) - { - for (int num17 = num14 - num15; num17 <= num14 + num15; num17++) - { - if (num17 > num5) - { - float arg_409_0 = (float)Math.Abs(n - m); - float num18 = (float)(Math.Abs(num17 - num14) * 2); - if (Math.Sqrt((double)(arg_409_0 * arg_409_0 + num18 * num18)) < (double)(num15 + WorldGen.genRand.Next(2))) - { - Main.tile[n, num17].active(true); - Main.tile[n, num17].type = (ushort)num16; - SafeSquareTileFrame(n, num17, true); - } - } - } - } - } - if (hasTenebris) - { - int p = num3; - int num150; - for (p += WorldGen.genRand.Next(5); p < num4; p += WorldGen.genRand.Next(num150, (int)((double)num150 * 1.5))) - { - int num14 = num6; - while (!Main.tile[p, num14].active()) - { - num14--; - } - num14 += WorldGen.genRand.Next(-3, 4); //-3 4 - num150 = 1; //4 8 - int num16 = mod.TileType("Tenebris"); - for (int n = p - num150; n <= p + num150; n++) - { - for (int num17 = num14 - num150; num17 <= num14 + num150; num17++) - { - if (num17 > num5) - { - float arg_409_0 = (float)Math.Abs(n - p); - float num18 = (float)(Math.Abs(num17 - num14) * 2); - if (Math.Sqrt((double)(arg_409_0 * arg_409_0 + num18 * num18)) < (double)(num150 + WorldGen.genRand.Next(2))) - { - Main.tile[n, num17].active(true); - Main.tile[n, num17].type = (ushort)num16; - SafeSquareTileFrame(n, num17, true); - } - } - } - } - } - } - int sizeMinSmall2 = sizeMin2 / 8; - int sizeMaxSmall2 = sizeMax2 / 8; - num = (double)WorldGen.genRand.Next(sizeMin2, sizeMax2); - num2 = (float)WorldGen.genRand.Next(sizeMinSmall2, sizeMaxSmall2); - vector.X = (float)i; - vector.Y = (float)num5; - vector2.X = (float)WorldGen.genRand.Next(-20, 21) * 0.2f; - while (vector2.X > -2f && vector2.X < 2f) - { - vector2.X = (float)WorldGen.genRand.Next(-20, 21) * 0.2f; - } - vector2.Y = (float)WorldGen.genRand.Next(-20, -10) * 0.02f; - while (num > 0.0 && num2 > 0f) - { - num -= (double)WorldGen.genRand.Next(4); - num2 -= 1f; - vector += vector2; - vector2.X += (float)WorldGen.genRand.Next(-20, 21) * 0.05f; - if (vector2.X > 1f) - { - vector2.X = 1f; - } - if (vector2.X < -1f) - { - vector2.X = -1f; - } - if ((double)vector2.Y > 0.2) - { - vector2.Y = -0.2f; - } - if ((double)vector2.Y < -0.2) - { - vector2.Y = -0.2f; - } - } - int num23 = num3; - num23 += WorldGen.genRand.Next(5); - while (num23 < num4) - { - int num24 = num6; - while ((!Main.tile[num23, num24].active() || Main.tile[num23, num24].type != 0) && num23 < num4) - { - num24--; - if (num24 < num5) - { - num24 = num6; - num23 += WorldGen.genRand.Next(1, 4); - } - } - if (num23 < num4) - { - num24 += WorldGen.genRand.Next(0, 4); - int num25 = WorldGen.genRand.Next(2, 5); - int num26 = (isVoid ? mod.TileType("Voidstone") : mod.TileType("AbyssGravel")); - for (int num27 = num23 - num25; num27 <= num23 + num25; num27++) - { - for (int num28 = num24 - num25; num28 <= num24 + num25; num28++) - { - if (num28 > num5) - { - float arg_890_0 = (float)Math.Abs(num27 - num23); - float num29 = (float)(Math.Abs(num28 - num24) * 2); - if (Math.Sqrt((double)(arg_890_0 * arg_890_0 + num29 * num29)) < (double)num25) - { - Main.tile[num27, num28].type = (ushort)num26; - SafeSquareTileFrame(num27, num28, true); - } - } - } - } - num23 += WorldGen.genRand.Next(num25, (int)((double)num25 * 1.5)); - } - } - for (int num30 = num3 - 20; num30 <= num4 + 20; num30++) - { - for (int num31 = num5 - 20; num31 <= num6 + 20; num31++) - { - bool flag = true; - for (int num32 = num30 - 1; num32 <= num30 + 1; num32++) - { - for (int num33 = num31 - 1; num33 <= num31 + 1; num33++) - { - if (!Main.tile[num32, num33].active()) - { - flag = false; - } - } - } - if (flag) - { - Main.tile[num30, num31].wall = (ushort)(isVoid ? mod.WallType("VoidstoneWallUnsafe") : mod.WallType("AbyssGravelWall")); - WorldGen.SquareWallFrame(num30, num31, true); - } - } - } - for (int num34 = num3; num34 <= num4; num34++) - { - int num35 = num5 - 10; - while (!Main.tile[num34, num35 + 1].active()) - { - num35++; - } - if (num35 < num6 && Main.tile[num34, num35 + 1].type == (ushort)(isVoid ? mod.TileType("Voidstone") : mod.TileType("AbyssGravel"))) - { - if (WorldGen.genRand.Next(10) == 0) - { - int num36 = WorldGen.genRand.Next(1, 3); - for (int num37 = num34 - num36; num37 <= num34 + num36; num37++) - { - if (Main.tile[num37, num35].type == (ushort)(isVoid ? mod.TileType("Voidstone") : mod.TileType("AbyssGravel"))) - { - Main.tile[num37, num35].active(false); - Main.tile[num37, num35].liquid = 255; - Main.tile[num37, num35].lava(false); - SafeSquareTileFrame(num34, num35, true); - } - if (Main.tile[num37, num35 + 1].type == (ushort)(isVoid ? mod.TileType("Voidstone") : mod.TileType("AbyssGravel"))) - { - Main.tile[num37, num35 + 1].active(false); - Main.tile[num37, num35 + 1].liquid = 255; - Main.tile[num37, num35 + 1].lava(false); - SafeSquareTileFrame(num34, num35 + 1, true); - } - if (num37 > num34 - num36 && num37 < num34 + 2 && Main.tile[num37, num35 + 2].type == (ushort)(isVoid ? mod.TileType("Voidstone") : mod.TileType("AbyssGravel"))) - { - Main.tile[num37, num35 + 2].active(false); - Main.tile[num37, num35 + 2].liquid = 255; - Main.tile[num37, num35 + 2].lava(false); - SafeSquareTileFrame(num34, num35 + 2, true); - } - } - } - if (WorldGen.genRand.Next(5) == 0) - { - Main.tile[num34, num35].liquid = 255; - } - Main.tile[num34, num35].lava(false); - SafeSquareTileFrame(num34, num35, true); - } - } - } - #endregion - - #region AbyssIslandHouse - public static void AbyssIslandHouse(int i, int j, int itemChoice, bool isVoid) - { - Mod mod = ModLoader.GetMod("CalamityMod"); - ushort type = (ushort)(isVoid ? mod.TileType("Voidstone") : mod.TileType("AbyssGravel")); //tile - ushort wall = (ushort)(isVoid ? mod.WallType("VoidstoneWallUnsafe") : mod.WallType("AbyssGravelWall")); //wall - Vector2 vector = new Vector2((float)i, (float)j); - int num = 1; - if (WorldGen.genRand.Next(2) == 0) - { - num = -1; - } - int num2 = WorldGen.genRand.Next(5, 9); - int num3 = 3; - vector.X = (float)(i + (num2 + 2) * num); - for (int k = j - 15; k < j + 30; k++) - { - if (Main.tile[(int)vector.X, k].active()) - { - vector.Y = (float)(k - 1); - break; - } - } - vector.X = (float)i; - int num4 = (int)(vector.X - (float)num2 - 1f); - int num5 = (int)(vector.X + (float)num2 + 1f); - int num6 = (int)(vector.Y - (float)num3 - 1f); - int num7 = (int)(vector.Y + 2f); - if (num4 < 0) - { - num4 = 0; - } - if (num5 > Main.maxTilesX) - { - num5 = Main.maxTilesX; - } - if (num6 < 0) - { - num6 = 0; - } - if (num7 > Main.maxTilesY) - { - num7 = Main.maxTilesY; - } - for (int l = num4; l <= num5; l++) - { - for (int m = num6 - 1; m < num7 + 1; m++) - { - if (m != num6 - 1 || (l != num4 && l != num5)) - { - Main.tile[l, m].active(true); - Main.tile[l, m].type = type; - Main.tile[l, m].wall = wall; - Main.tile[l, m].halfBrick(false); - Main.tile[l, m].slope(0); - } - } - } - num4 = (int)(vector.X - (float)num2); - num5 = (int)(vector.X + (float)num2); - num6 = (int)(vector.Y - (float)num3); - num7 = (int)(vector.Y + 1f); - if (num4 < 0) - { - num4 = 0; - } - if (num5 > Main.maxTilesX) - { - num5 = Main.maxTilesX; - } - if (num6 < 0) - { - num6 = 0; - } - if (num7 > Main.maxTilesY) - { - num7 = Main.maxTilesY; - } - for (int n = num4; n <= num5; n++) - { - for (int num8 = num6; num8 < num7; num8++) - { - if ((num8 != num6 || (n != num4 && n != num5)) && Main.tile[n, num8].wall == wall) - { - Main.tile[n, num8].active(false); - } - } - } - int num9 = i + (num2 + 1) * num; - int num10 = (int)vector.Y; - for (int num11 = num9 - 2; num11 <= num9 + 2; num11++) - { - Main.tile[num11, num10].active(false); - Main.tile[num11, num10 - 1].active(false); - Main.tile[num11, num10 - 2].active(false); - } - switch (itemChoice) - { - case 0: itemChoice = mod.ItemType("TorrentialTear"); break; //rain item - case 1: itemChoice = mod.ItemType("IronBoots"); break; //movement acc - case 2: itemChoice = mod.ItemType("DepthCharm"); break; //regen acc - case 3: itemChoice = mod.ItemType("Archerfish"); break; //ranged - case 4: itemChoice = mod.ItemType("AnechoicPlating"); break; //defense acc - case 5: itemChoice = mod.ItemType("BallOFugu"); break; //melee - case 6: itemChoice = mod.ItemType("StrangeOrb"); break; //light pet - case 7: itemChoice = mod.ItemType("HerringStaff"); break; //summon - case 8: itemChoice = mod.ItemType("BlackAnurian"); break; //magic - case 9: itemChoice = mod.ItemType("Lionfish"); break; //throwing - default: itemChoice = 497; break; - } - WorldGen.AddBuriedChest(i, num10 - 3, itemChoice, false, 4); //chest - } - #endregion - - #region IcePyramid - public static bool IcePyramid(int i, int j) - { - ushort num = 161; - int arg_36_0 = j - WorldGen.genRand.Next(0, 7); - int num2 = WorldGen.genRand.Next(9, 13); - int num3 = 1; - int num4 = j + WorldGen.genRand.Next(75, 125); //75 125 - for (int k = arg_36_0; k < num4; k++) - { - for (int l = i - num3; l < i + num3 - 1; l++) - { - Main.tile[l, k].type = num; - Main.tile[l, k].active(true); - Main.tile[l, k].halfBrick(false); - Main.tile[l, k].slope(0); - } - num3++; - } - for (int m = i - num3 - 5; m <= i + num3 + 5; m++) - { - for (int n = j - 1; n <= num4 + 1; n++) - { - bool flag = true; - for (int num5 = m - 1; num5 <= m + 1; num5++) - { - for (int num6 = n - 1; num6 <= n + 1; num6++) - { - if (Main.tile[num5, num6].type != num) - { - flag = false; - } - } - } - if (flag) - { - Main.tile[m, n].wall = 71; - WorldGen.SquareWallFrame(m, n, true); - } - } - } - int num7 = 1; - if (WorldGen.genRand.Next(2) == 0) - { - num7 = -1; - } - int num8 = i - num2 * num7; - int num9 = j + num2; - int num10 = WorldGen.genRand.Next(5, 8); - bool flag2 = true; - int num11 = WorldGen.genRand.Next(20, 30); - while (flag2) - { - flag2 = false; - bool flag3 = false; - for (int num12 = num9; num12 <= num9 + num10; num12++) - { - int num13 = num8; - if (Main.tile[num13, num12 - 1].type == 161) - { - flag3 = true; - } - if (Main.tile[num13, num12].type == num) - { - Main.tile[num13, num12 + 1].wall = 71; - Main.tile[num13 + num7, num12].wall = 71; - Main.tile[num13, num12].active(false); - flag2 = true; - } - if (flag3) - { - Main.tile[num13, num12].type = 161; - Main.tile[num13, num12].active(true); - Main.tile[num13, num12].halfBrick(false); - Main.tile[num13, num12].slope(0); - } - } - num8 -= num7; - } - num8 = i - num2 * num7; - bool flag4 = true; - bool flag5 = false; - flag2 = true; - while (flag2) - { - for (int num14 = num9; num14 <= num9 + num10; num14++) - { - int num15 = num8; - Main.tile[num15, num14].active(false); - } - num8 += num7; - num9++; - num11--; - if (num9 >= num4 - num10 * 2) - { - num11 = 10; - } - if (num11 <= 0) - { - bool flag6 = false; - if (!flag4 && !flag5) - { - flag5 = true; - flag6 = true; - int num16 = WorldGen.genRand.Next(7, 13); - int num17 = WorldGen.genRand.Next(23, 28); - int num18 = num17; - int num19 = num8; - while (num17 > 0) - { - for (int num20 = num9 - num16 + num10; num20 <= num9 + num10; num20++) - { - if (num17 == num18 || num17 == 1) - { - if (num20 >= num9 - num16 + num10 + 2) - { - Main.tile[num8, num20].active(false); - } - } - else if (num17 == num18 - 1 || num17 == 2 || num17 == num18 - 2 || num17 == 3) - { - if (num20 >= num9 - num16 + num10 + 1) - { - Main.tile[num8, num20].active(false); - } - } - else - { - Main.tile[num8, num20].active(false); - } - } - num17--; - num8 += num7; - } - int num21 = num8 - num7; - int num22 = num21; - int num23 = num19; - if (num21 > num19) - { - num22 = num19; - num23 = num21; - } - int num24 = WorldGen.genRand.Next(3); - if (num24 == 0) - { - num24 = 1861; //diving gear - } - else if (num24 == 1) - { - num24 = 1163; //balloon - } - else if (num24 == 2) - { - num24 = 1253; //shell - } - WorldGen.AddBuriedChest((num22 + num23) / 2, num9, num24, false, 22); - int num25 = WorldGen.genRand.Next(1, 10); - for (int num26 = 0; num26 < num25; num26++) - { - int arg_49B_0 = WorldGen.genRand.Next(num22, num23); - int j2 = num9 + num10; - WorldGen.PlaceSmallPile(arg_49B_0, j2, WorldGen.genRand.Next(16, 19), 1, 185); - } - for (int num27 = num22; num27 <= num23; num27++) - { - WorldGen.PlacePot(num27, num9 + num10, 28, WorldGen.genRand.Next(4, 7)); - } - } - if (flag4) - { - flag4 = false; - num7 *= -1; - num11 = WorldGen.genRand.Next(15, 20); - } - else if (flag6) - { - num11 = WorldGen.genRand.Next(10, 15); - } - else - { - num7 *= -1; - num11 = WorldGen.genRand.Next(20, 40); - } - } - if (num9 >= num4 - num10) - { - flag2 = false; - } - } - int num28 = WorldGen.genRand.Next(20, 40); //100 200 - int num29 = WorldGen.genRand.Next(100, 160); //500 800 - flag2 = true; - int num30 = num10; - num11 = WorldGen.genRand.Next(10, 50); - if (num7 == 1) - { - num8 -= num30; - } - int num31 = WorldGen.genRand.Next(5, 10); - while (flag2) - { - num28--; - num29--; - num11--; - for (int num32 = num8 - num31 - WorldGen.genRand.Next(0, 2); num32 <= num8 + num30 + num31 + WorldGen.genRand.Next(0, 2); num32++) - { - int num33 = num9; - if (num32 >= num8 && num32 <= num8 + num30) - { - Main.tile[num32, num33].active(false); - } - else - { - Main.tile[num32, num33].type = num; - Main.tile[num32, num33].active(true); - Main.tile[num32, num33].halfBrick(false); - Main.tile[num32, num33].slope(0); - } - if (num32 >= num8 - 1 && num32 <= num8 + 1 + num30) - { - Main.tile[num32, num33].wall = 71; - } - } - num9++; - num8 += num7; - if (num28 <= 0) - { - flag2 = false; - for (int num34 = num8 + 1; num34 <= num8 + num30 - 1; num34++) - { - if (Main.tile[num34, num9].active()) - { - flag2 = true; - } - } - } - if (num11 < 0) - { - num11 = WorldGen.genRand.Next(10, 50); - num7 *= -1; - } - if (num29 <= 0) - { - flag2 = false; - } - } - return true; - } - #endregion - - #region SpecialHut - public static void SpecialHut(ushort tile, ushort tile2, ushort wall, int hutType, int chestX, int chestY) - { - int m = WorldGen.genRand.Next(2, 4); - int num6 = WorldGen.genRand.Next(2, 4); - for (int n = chestX - m - 1; n <= chestX + m + 1; n++) - { - for (int num8 = chestY - num6 - 1; num8 <= chestY + num6 + 1; num8++) - { - Main.tile[n, num8].active(true); - Main.tile[n, num8].type = tile; //change - Main.tile[n, num8].liquid = 0; - Main.tile[n, num8].lava(false); - } - } - for (int num9 = chestX - m; num9 <= chestX + m; num9++) - { - for (int num10 = chestY - num6; num10 <= chestY + num6; num10++) - { - Main.tile[num9, num10].active(false); - Main.tile[num9, num10].wall = wall; //change - } - } - for (int num14 = chestX - m - 1; num14 <= chestX + m + 1; num14++) - { - for (int num15 = chestY + num6 - 2; num15 <= chestY + num6; num15++) - { - Main.tile[num14, num15].active(false); - } - } - for (int num16 = chestX - m - 1; num16 <= chestX + m + 1; num16++) - { - for (int num17 = chestY + num6 - 2; num17 <= chestY + num6 - 1; num17++) - { - Main.tile[num16, num17].active(false); - } - } - for (int num18 = chestX - m - 1; num18 <= chestX + m + 1; num18++) - { - int num19 = 4; - int num20 = chestY + num6 + 2; - while (!Main.tile[num18, num20].active() && num20 < Main.maxTilesY && num19 > 0) - { - Main.tile[num18, num20].active(true); - Main.tile[num18, num20].type = tile2; //change - num20++; - num19--; - } - } - m -= WorldGen.genRand.Next(1, 3); - int num21 = chestY - num6 - 2; - while (m > -1) - { - for (int num22 = chestX - m - 1; num22 <= chestX + m + 1; num22++) - { - Main.tile[num22, num21].active(true); - Main.tile[num22, num21].type = tile; //change - } - m -= WorldGen.genRand.Next(1, 3); - num21--; - } - CalamityWorld.SChestX[hutType] = chestX; - CalamityWorld.SChestY[hutType] = chestY; - SpecialChest(hutType); - } - #endregion - - #region SpecialChest - public static void SpecialChest(int itemChoice) - { - Mod mod = ModLoader.GetMod("CalamityMod"); - int item = 0; - int chestType = 0; - switch (itemChoice) //0 to 9 - { - case 0: item = 976; break; //climbing gear - case 1: item = (WorldGen.crimson ? 3016 : 3015); chestType = (WorldGen.crimson ? 43 : 3); break; //flesh knuckles or putrid scent - case 2: item = 908; chestType = 44; break; //lava waders - case 3: item = 1595; chestType = 47; break; //cuffs - case 4: item = 899; chestType = 30; break; //sun stone - case 5: item = 1864; chestType = 32; break; //scarab - case 6: item = 532; chestType = 50; break; //fuck you, star cloak - case 7: item = 554; chestType = 51; break; //fuck you, cross necklace - case 8: item = mod.ItemType("Murasama"); chestType = 44; break; - case 9: item = mod.ItemType("BossRush"); chestType = 4; break; - } - for (int j = CalamityWorld.SChestX[itemChoice] - 1; j <= CalamityWorld.SChestX[itemChoice] + 1; j++) - { - for (int k = CalamityWorld.SChestY[itemChoice]; k <= CalamityWorld.SChestY[itemChoice] + 2; k++) - { - WorldGen.KillTile(j, k, false, false, false); - } - } - for (int l = CalamityWorld.SChestX[itemChoice] - 1; l <= CalamityWorld.SChestX[itemChoice] + 1; l++) - { - for (int m = CalamityWorld.SChestY[itemChoice]; m <= CalamityWorld.SChestY[itemChoice] + 3; m++) - { - if (m < Main.maxTilesY) - { - Main.tile[l, m].slope(0); - Main.tile[l, m].halfBrick(false); - } - } - } - WorldGen.AddBuriedChest(CalamityWorld.SChestX[itemChoice], CalamityWorld.SChestY[itemChoice], item, false, chestType); - } - #endregion - - #region ChasmGenerator - public static void ChasmGenerator(int i, int j, int steps, bool ocean = false) - { - Mod mod = ModLoader.GetMod("CalamityMod"); - float num = (float)steps; //y / 4, small = 300, medium = 450, large = 600 - if (Main.maxTilesY > 1500) { num += 100f; if (Main.maxTilesY > 2100) { num += 100f; } } //small = 300, medium = 550, large = 800 - if (ocean) - { - int tileYLookup = j; - if (abyssSide) - { - while (!Main.tile[i + 125, tileYLookup].active()) - { - tileYLookup++; - } - } - else - { - while (!Main.tile[i - 125, tileYLookup].active()) - { - tileYLookup++; - } - } - j = tileYLookup; - } - Vector2 vector; - vector.X = (float)i; - vector.Y = (float)j; - Vector2 vector2; - vector2.X = (float)WorldGen.genRand.Next(-1, 2) * 0.1f; - vector2.Y = (float)WorldGen.genRand.Next(3, 8) * 0.2f + 0.5f; - int num2 = 5; - double num3 = (double)(WorldGen.genRand.Next(5, 7) + 40); //start width - while (num3 > 0.0) - { - if (num > 0f) - { - num3 += (double)WorldGen.genRand.Next(2); - num3 -= (double)WorldGen.genRand.Next(2); - float smallHoleLimit = 240f; //small - if (Main.maxTilesY > 1500) { smallHoleLimit = 460f; if (Main.maxTilesY > 2100) { smallHoleLimit = 700f; } } - if (ocean && num > smallHoleLimit) //dig small hole, small = 225, medium = 450, large = 675, 80% of first number - { - if (num3 < 4.0) //min width - { - num3 = 4.0; //min width - } - if (num3 > 6.0) //max width - { - num3 = 6.0; //max width - } - } - else //dig large hole - { - if (num3 < (ocean ? 42.0 : 14.0)) //min width - { - num3 = (ocean ? 42.0 : 14.0); //min width - } - if (num3 > (ocean ? 60.0 : 40.0)) //max width - { - num3 = (ocean ? 60.0 : 40.0); //max width - } - if (num == 1f && num3 < (ocean ? 50.0 : 20.0)) - { - num3 = (ocean ? 50.0 : 20.0); - } - } - } - else - { - if (Main.maxTilesY > 2100) - { - if ((double)vector.Y > (Main.rockLayer + (double)Main.maxTilesY * 0.35)) //960 + 840 = 1800 - { - num3 -= (double)(WorldGen.genRand.Next(5) + 8); - } - } - else if (Main.maxTilesY > 1500) - { - if ((double)vector.Y > (Main.rockLayer + (double)Main.maxTilesY * 0.331)) - { - num3 -= (double)(WorldGen.genRand.Next(5) + 8); - } - } - else - { - if ((double)vector.Y > (Main.rockLayer + (double)Main.maxTilesY * 0.312)) //960 - { - num3 -= (double)(WorldGen.genRand.Next(5) + 8); - } - } - } - if (Main.maxTilesY > 2100) - { - if (((double)vector.Y > (Main.rockLayer + (double)Main.maxTilesY * 0.38) && num > 0f && ocean) || //960 + 912 = 1872 limit is 1944 - ((double)vector.Y >= (double)Main.maxTilesY && num > 0f && !ocean)) - { - num = 0f; - } - } - else if (Main.maxTilesY > 1500) - { - if (((double)vector.Y > (Main.rockLayer + (double)Main.maxTilesY * 0.34) && num > 0f && ocean) || - ((double)vector.Y >= (double)Main.maxTilesY && num > 0f && !ocean)) - { - num = 0f; - } - } - else - { - if (((double)vector.Y > (Main.rockLayer + (double)Main.maxTilesY * 0.3) && num > 0f && ocean) || - ((double)vector.Y >= (double)Main.maxTilesY && num > 0f && !ocean)) - { - num = 0f; - } - } - num -= 1f; - int num4; - int num5; - int num6; - int num7; - if (num > (float)num2) - { - num4 = (int)((double)vector.X - num3 * 0.5); - num5 = (int)((double)vector.X + num3 * 0.5); - num6 = (int)((double)vector.Y - num3 * 0.5); - num7 = (int)((double)vector.Y + num3 * 0.5); - if (num4 < 0) - { - num4 = 0; - } - if (num5 > Main.maxTilesX - 1) - { - num5 = Main.maxTilesX - 1; - } - if (num6 < 0) - { - num6 = 0; - } - if (num7 > Main.maxTilesY) - { - num7 = Main.maxTilesY; - } - for (int k = num4; k < num5; k++) - { - for (int l = num6; l < num7; l++) - { - if ((double)(Math.Abs((float)k - vector.X) + Math.Abs((float)l - vector.Y)) < num3 * 0.5 * (1.0 + (double)WorldGen.genRand.Next(-5, 6) * 0.015)) - { - if (ocean) - { - Main.tile[k, l].active(false); - Main.tile[k, l].liquid = 255; - Main.tile[k, l].lava(false); - } - else - { - Main.tile[k, l].active(false); - Main.tile[k, l].liquid = 255; - Main.tile[k, l].lava(true); - } - } - } - } - } - if (num <= 2f && (double)vector.Y < (Main.rockLayer + (double)Main.maxTilesY * 0.312)) //1260 - { - num = 2f; - } - vector += vector2; - vector2.X += (float)WorldGen.genRand.Next(-1, 2) * 0.01f; - if ((double)vector2.X > 0.02) - { - vector2.X = 0.02f; - } - if ((double)vector2.X < -0.02) - { - vector2.X = -0.02f; - } - num4 = (int)((double)vector.X - num3 * 1.1); - num5 = (int)((double)vector.X + num3 * 1.1); - num6 = (int)((double)vector.Y - num3 * 1.1); - num7 = (int)((double)vector.Y + num3 * 1.1); - if (num4 < 1) - { - num4 = 1; - } - if (num5 > Main.maxTilesX - 1) - { - num5 = Main.maxTilesX - 1; - } - if (num6 < 0) - { - num6 = 0; - } - if (num7 > Main.maxTilesY) - { - num7 = Main.maxTilesY; - } - for (int m = num4; m < num5; m++) - { - for (int n = num6; n < num7; n++) - { - if ((double)(Math.Abs((float)m - vector.X) + Math.Abs((float)n - vector.Y)) < num3 * 1.1 * (1.0 + (double)WorldGen.genRand.Next(-5, 6) * 0.015)) - { - if (n > j + WorldGen.genRand.Next(7, 16)) - { - Main.tile[m, n].active(false); - } - if (steps <= num2) - { - Main.tile[m, n].active(false); - } - if (ocean) - { - Main.tile[m, n].liquid = 255; - Main.tile[m, n].lava(false); - } - else - { - Main.tile[m, n].liquid = 255; - Main.tile[m, n].lava(true); - } - } - } - } - for (int num11 = num4; num11 < num5; num11++) - { - for (int num12 = num6; num12 < num7; num12++) - { - if ((double)(Math.Abs((float)num11 - vector.X) + Math.Abs((float)num12 - vector.Y)) < num3 * 1.1 * (1.0 + (double)WorldGen.genRand.Next(-5, 6) * 0.015)) - { - if (ocean) - { - Main.tile[num11, num12].liquid = 255; - Main.tile[num11, num12].lava(false); - } - else - { - Main.tile[num11, num12].liquid = 255; - Main.tile[num11, num12].lava(true); - } - if (steps <= num2) - { - Main.tile[num11, num12].active(false); - } - } - } - } - } - } - #endregion - - #region PlanetoidMethods - //WORLD GENERATION PASSES - private static void ExpandWorld(GenerationProgress progress) - { - int newHeight = Main.maxTilesY + ExpandWorldBy; - - //--------------------- - //MISC. FIXES - //--------------------- - - //TILES - FieldInfo worldSizeY = typeof(WorldFileData).GetField("WorldSizeY", BindingFlags.Instance | BindingFlags.Public); - worldSizeY.SetValue(Main.ActiveWorldFileData, newHeight); - - FieldInfo lastMaxTilesY = typeof(WorldGen).GetField("lastMaxTilesY", BindingFlags.Static | BindingFlags.NonPublic); - lastMaxTilesY.SetValue(null, newHeight); - - Main.maxTilesY = newHeight; - - Main.bottomWorld = newHeight * 16; - Main.maxSectionsY = Main.maxTilesY / 150; - // - - //MAP - MethodInfo methodInfo = typeof(Main).GetMethod("InitMap", BindingFlags.NonPublic | BindingFlags.Instance); - methodInfo.Invoke(Main.instance, null); - // - - //MOVING THE TILES DOWN - Tile[,] newTiles = new Tile[8401, 2401 + ExpandWorldBy]; - for (int x = 0; x < Main.maxTilesX; x++) - { - for (int y = 0; y < Main.maxTilesY; y++) - { - newTiles[x, y] = new Tile(); - if (y >= ExpandWorldBy) - { - newTiles[x, y].CopyFrom(Main.tile[x, y - ExpandWorldBy]); - Main.tile[x, y - ExpandWorldBy] = null; - } - } - } - - Main.tile = newTiles; - - for (int i = 0; i < Main.chest.Length; i++) - { - if (Main.chest[i] != null) - Main.chest[i].y += ExpandWorldBy; - } - // - - //FIXING VARIABLES - Main.worldSurface += ExpandWorldBy; - Main.rockLayer += ExpandWorldBy; - WorldGen.worldSurface += ExpandWorldBy; - WorldGen.worldSurfaceHigh += ExpandWorldBy; - WorldGen.worldSurfaceLow += ExpandWorldBy; - WorldGen.rockLayer += ExpandWorldBy; - WorldGen.rockLayerHigh += ExpandWorldBy; - WorldGen.rockLayerLow += ExpandWorldBy; - Main.spawnTileY += ExpandWorldBy; - Main.dungeonY += ExpandWorldBy; - // - - //FIXING THE GUIDE'S CURRENT POSITION - for (int i = 0; i < Main.npc.Length; i++) - { - if (Main.npc[i].type == NPCID.Guide) - { - Main.npc[i].homeTileY = Main.spawnTileY; - Main.npc[i].position.Y += ExpandWorldBy * 16f; - break; - } - } - // - } - - private static void Planetoids(GenerationProgress progress) - { - progress.Message = "Generating Planetoids..."; - - int GrassPlanetoidCount = Main.maxTilesX / 1100; - int LCPlanetoidCount = Main.maxTilesX / 800; - int MudPlanetoidCount = Main.maxTilesX / 1100; - - //It might seem scary but fuck making an extra boolean - while (true) - { - if (Biomes.Place(new Point(WorldGen.genRand.Next(Main.maxTilesX / 2 - 100, Main.maxTilesX / 2 + 100), WorldGen.genRand.Next(128, 134)), WorldGen.structures)) - { - break; - } - } - while (LCPlanetoidCount > 0) - { - int x = WorldGen.genRand.Next((int)(Main.maxTilesX * 0.2), (int)(Main.maxTilesX * 0.8)); - int y = WorldGen.genRand.Next(70, ExpandWorldBy); - - bool placed = Biomes.Place(x, y, WorldGen.structures); - - if (placed) - LCPlanetoidCount--; - } - while (GrassPlanetoidCount > 0) - { - int x = WorldGen.genRand.Next((int)(Main.maxTilesX * 0.333), (int)(Main.maxTilesX * 0.666)); - int y = WorldGen.genRand.Next(100, ExpandWorldBy); - - - bool placed = Biomes.Place(x, y, WorldGen.structures); - - if (placed) - GrassPlanetoidCount--; - } - while (MudPlanetoidCount > 0) - { - int x = WorldGen.genRand.Next((int)(Main.maxTilesX * 0.3f), (int)(Main.maxTilesX * 0.7f)); - int y = WorldGen.genRand.Next(100, ExpandWorldBy); - - bool placed = Biomes.Place(x, y, WorldGen.structures); - - if (placed) - MudPlanetoidCount--; - } - } - - private static void PotFix(GenerationProgress progress) - { - Main.tileSolid[137] = true; - Main.tileSolid[130] = true; - progress.Message = Lang.gen[35].Value; - for (int i = 0; i < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 0.0008); i++) - { - float num = (float)((double)i / ((double)(Main.maxTilesX * Main.maxTilesY) * 0.0008)); - progress.Set(num); - bool flag = false; - int num2 = 0; - while (!flag) - { - int num3 = WorldGen.genRand.Next((int)WorldGen.worldSurfaceHigh, Main.maxTilesY - 10); - if ((double)num > 0.93) - { - num3 = Main.maxTilesY - 150; - } - else if ((double)num > 0.75) - { - num3 = (int)WorldGen.worldSurfaceLow; - } - int num4 = WorldGen.genRand.Next(1, Main.maxTilesX - 1); - bool flag2 = false; - for (int j = num3; j < Main.maxTilesY; j++) - { - if (!flag2) - { - if (Main.tile[num4, j].active() && Main.tileSolid[(int)Main.tile[num4, j].type] && !Main.tile[num4, j - 1].lava()) - { - flag2 = true; - } - } - else - { - int style = WorldGen.genRand.Next(0, 4); - int num5 = 0; - if (j < Main.maxTilesY - 5) - { - num5 = (int)Main.tile[num4, j + 1].type; - } - if (num5 == 147 || num5 == 161 || num5 == 162) - { - style = WorldGen.genRand.Next(4, 7); - } - if (num5 == 60) - { - style = WorldGen.genRand.Next(7, 10); - } - if (Main.wallDungeon[(int)Main.tile[num4, j].wall]) - { - style = WorldGen.genRand.Next(10, 13); - } - if (num5 == 41 || num5 == 43 || num5 == 44) - { - style = WorldGen.genRand.Next(10, 13); - } - if (num5 == 22 || num5 == 23 || num5 == 25) - { - style = WorldGen.genRand.Next(16, 19); - } - if (num5 == 199 || num5 == 203 || num5 == 204 || num5 == 200) - { - style = WorldGen.genRand.Next(22, 25); - } - if (num5 == 367) - { - style = WorldGen.genRand.Next(31, 34); - } - if (num5 == 226) - { - style = WorldGen.genRand.Next(28, 31); - } - if (j > Main.maxTilesY - 200) - { - style = WorldGen.genRand.Next(13, 16); - } - if (WorldGen.PlacePot(num4, j, 28, style)) - { - flag = true; - break; - } - num2++; - if (num2 >= 10000) - { - flag = true; - break; - } - } - } - } - } - } - - private static void RemoveMostTasks(List tasks) - { - int value = 15; - while (tasks.Count > value) - { - if (tasks[value].Name == "Spawn Point") - { - value++; - } - tasks.RemoveAt(value); - } - } - #endregion - - #region PostUpdate - public override void PostUpdate() + public static void DoAstralConversion(object obj) { - int closestPlayer = (int)Player.FindClosest(new Vector2((float)(Main.maxTilesX / 2), (float)Main.worldSurface / 2f) * 16f, 0, 0); - #region BossRush - if (!deactivateStupidFuckingBullshit) - { - deactivateStupidFuckingBullshit = true; - bossRushActive = false; - if (Main.netMode == 2) - { - NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); - } - } - if (bossRushActive) - { - if (NPC.MoonLordCountdown > 0) - { - NPC.MoonLordCountdown = 0; - } - if (!CalamityPlayer.areThereAnyDamnBosses) - { - if (bossRushSpawnCountdown > 0) - { - bossRushSpawnCountdown--; - if (bossRushSpawnCountdown == 180 && bossRushStage == 26) - { - string key = "Mods.CalamityMod.BossRushTierThreeEndText2"; - Color messageColor = Color.LightCoral; - if (Main.netMode == 0) - { - Main.NewText(Language.GetTextValue(key), messageColor); - } - else if (Main.netMode == 2) - { - NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); - } - } - if (bossRushSpawnCountdown == 210 && bossRushStage == 33) - { - string key = "Mods.CalamityMod.BossRushTierFourEndText2"; - Color messageColor = Color.LightCoral; - if (Main.netMode == 0) - { - Main.NewText(Language.GetTextValue(key), messageColor); - } - else if (Main.netMode == 2) - { - NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); - } - } - } - if (bossRushSpawnCountdown <= 0) - { - bossRushSpawnCountdown = 60; - if (bossRushStage > 25) - { - bossRushSpawnCountdown += 120; //3 seconds - } - if (bossRushStage > 32) - { - bossRushSpawnCountdown += 180; //6 seconds - } - switch (bossRushStage) - { - case 9: - bossRushSpawnCountdown = 240; - break; - case 18: - bossRushSpawnCountdown = 300; - break; - case 25: - bossRushSpawnCountdown = 360; - break; - case 32: - bossRushSpawnCountdown = 420; - break; - default: - break; - } - if (bossRushStage == 13) - { - for (int playerIndex = 0; playerIndex < 255; playerIndex++) - { - if (Main.player[playerIndex].active) - { - Player player = Main.player[playerIndex]; - player.Spawn(); - } - } - } - else if (bossRushStage == 36) - { - for (int playerIndex = 0; playerIndex < 255; playerIndex++) - { - if (Main.player[playerIndex].active) - { - Player player = Main.player[playerIndex]; - if (player.FindBuffIndex(mod.BuffType("ExtremeGravity")) > -1) - { - player.ClearBuff(mod.BuffType("ExtremeGravity")); - } - } - } - } - if (Main.netMode != 1) - { - Main.PlaySound(SoundID.Roar, Main.player[closestPlayer].position, 0); - switch (bossRushStage) - { - case 0: - NPC.SpawnOnPlayer(closestPlayer, NPCID.QueenBee); - break; - case 1: - NPC.SpawnOnPlayer(closestPlayer, NPCID.BrainofCthulhu); - break; - case 2: - NPC.SpawnOnPlayer(closestPlayer, NPCID.KingSlime); - break; - case 3: - ChangeTime(false); - NPC.SpawnOnPlayer(closestPlayer, NPCID.EyeofCthulhu); - break; - case 4: - ChangeTime(false); - NPC.SpawnOnPlayer(closestPlayer, NPCID.SkeletronPrime); - break; - case 5: - NPC.NewNPC((int)(Main.player[closestPlayer].position.X + (float)(Main.rand.Next(-100, 101))), - (int)(Main.player[closestPlayer].position.Y - 400f), - NPCID.Golem, 0, 0f, 0f, 0f, 0f, 255); - break; - case 6: - ChangeTime(true); - NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("ProfanedGuardianBoss")); - NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("ProfanedGuardianBoss2")); - NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("ProfanedGuardianBoss3")); - break; - case 7: - NPC.SpawnOnPlayer(closestPlayer, NPCID.EaterofWorldsHead); - break; - case 8: - ChangeTime(false); - NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("Astrageldon")); - break; - case 9: - ChangeTime(false); - NPC.SpawnOnPlayer(closestPlayer, NPCID.TheDestroyer); - break; - case 10: - ChangeTime(false); - NPC.SpawnOnPlayer(closestPlayer, NPCID.Spazmatism); - NPC.SpawnOnPlayer(closestPlayer, NPCID.Retinazer); - break; - case 11: - NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("Bumblefuck")); - break; - case 12: - NPC.SpawnWOF(Main.player[closestPlayer].position); - break; - case 13: - NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("HiveMind")); - break; - case 14: - ChangeTime(false); - NPC.SpawnOnPlayer(closestPlayer, NPCID.SkeletronHead); - break; - case 15: - NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("StormWeaverHead")); - break; - case 16: - NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("AquaticScourgeHead")); - break; - case 17: - NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("DesertScourgeHead")); - NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("DesertScourgeHeadSmall")); - NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("DesertScourgeHeadSmall")); - break; - case 18: - int num1302 = NPC.NewNPC((int)Main.player[closestPlayer].Center.X, (int)Main.player[closestPlayer].Center.Y - 400, NPCID.CultistBoss, 0, 0f, 0f, 0f, 0f, 255); - Main.npc[num1302].direction = (Main.npc[num1302].spriteDirection = Math.Sign(Main.player[closestPlayer].Center.X - (float)Main.player[closestPlayer].Center.X - 90f)); - break; - case 19: - for (int doom = 0; doom < 200; doom++) - { - if (Main.npc[doom].active && (Main.npc[doom].type == 493 || Main.npc[doom].type == 422 || Main.npc[doom].type == 507 || - Main.npc[doom].type == 517)) - { - Main.npc[doom].active = false; - Main.npc[doom].netUpdate = true; - } - } - NPC.NewNPC((int)(Main.player[closestPlayer].position.X + (float)(Main.rand.Next(-100, 101))), (int)(Main.player[closestPlayer].position.Y - 400f), mod.NPCType("CrabulonIdle"), 0, 0f, 0f, 0f, 0f, 255); - break; - case 20: - NPC.SpawnOnPlayer(closestPlayer, NPCID.Plantera); - break; - case 21: - NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("CeaselessVoid")); - break; - case 22: - NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("PerforatorHive")); - break; - case 23: - NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("Cryogen")); - break; - case 24: - NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("BrimstoneElemental")); - break; - case 25: - NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("CosmicWraith")); - break; - case 26: - NPC.NewNPC((int)(Main.player[closestPlayer].position.X + (float)(Main.rand.Next(-100, 101))), (int)(Main.player[closestPlayer].position.Y - 400f), mod.NPCType("ScavengerBody"), 0, 0f, 0f, 0f, 0f, 255); - break; - case 27: - NPC.NewNPC((int)(Main.player[closestPlayer].position.X + (float)(Main.rand.Next(-100, 101))), (int)(Main.player[closestPlayer].position.Y - 400f), NPCID.DukeFishron, 0, 0f, 0f, 0f, 0f, 255); - break; - case 28: - NPC.SpawnOnPlayer(closestPlayer, NPCID.MoonLordCore); - break; - case 29: - ChangeTime(false); - for (int x = 0; x < 10; x++) - { - NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("AstrumDeusHead")); - } - NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("AstrumDeusHeadSpectral")); - break; - case 30: - NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("Polterghast")); - break; - case 31: - NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("PlaguebringerGoliath")); - break; - case 32: - ChangeTime(false); - NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("Calamitas")); - break; - case 33: - NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("Siren")); - break; - case 34: - NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("SlimeGod")); - NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("SlimeGodRun")); - NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("SlimeGodCore")); - break; - case 35: - ChangeTime(true); - NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("Providence")); - break; - case 36: - NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("SupremeCalamitas")); - break; - case 37: - NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("Yharon")); - break; - case 38: - NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("DevourerofGodsHeadS")); - break; - } - } - } - } - } - else - { - bossRushSpawnCountdown = 180; - if (bossRushStage != 0) - { - bossRushStage = 0; - if (Main.netMode == 2) - { - var netMessage = mod.GetPacket(); - netMessage.Write((byte)CalamityModMessageType.BossRushStage); - netMessage.Write(bossRushStage); - netMessage.Send(); - } - } - } - #endregion - #region SpawnDoG - if (DoGSecondStageCountdown > 0) //works - { - DoGSecondStageCountdown--; - if (Main.netMode == 2) - { - var netMessage = mod.GetPacket(); - netMessage.Write((byte)CalamityModMessageType.DoGCountdownSync); - netMessage.Write(DoGSecondStageCountdown); - netMessage.Send(); - } - if (Main.netMode != 1) - { - if (DoGSecondStageCountdown == 21540) - { - NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("CeaselessVoid")); - } - if (DoGSecondStageCountdown == 14340) - { - NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("StormWeaverHead")); - } - if (DoGSecondStageCountdown == 7140) - { - NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("CosmicWraith")); - } - if (DoGSecondStageCountdown <= 60) - { - if (!NPC.AnyNPCs(mod.NPCType("DevourerofGodsHeadS"))) - { - NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("DevourerofGodsHeadS")); - string key = "Mods.CalamityMod.EdgyBossText10"; - Color messageColor = Color.Cyan; - if (Main.netMode == 0) - { - Main.NewText(Language.GetTextValue(key), messageColor); - } - else if (Main.netMode == 2) - { - NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); - } - } - } - } - } - #endregion - if (Main.player[closestPlayer].ZoneDungeon && !NPC.downedBoss3) - { - if (!NPC.AnyNPCs(NPCID.DungeonGuardian) && Main.netMode != 1) - NPC.SpawnOnPlayer(closestPlayer, NPCID.DungeonGuardian); //your hell is as vast as my bonergrin, pray your life ends quickly - } - if (Main.player[closestPlayer].ZoneRockLayerHeight && - !Main.player[closestPlayer].ZoneUnderworldHeight && - !Main.player[closestPlayer].ZoneDungeon && - !CalamityPlayer.areThereAnyDamnBosses) //works - { - if (NPC.downedPlantBoss && - !Main.player[closestPlayer].GetModPlayer(mod).ZoneAbyss && - Main.player[closestPlayer].townNPCs < 3f) - { - if ((Main.player[closestPlayer].GetModPlayer(mod).zerg && Main.rand.Next(2000) == 0) || - (Main.rand.Next(50000) == 0 && !Main.player[closestPlayer].GetModPlayer(mod).zen)) - { - if (!NPC.AnyNPCs(mod.NPCType("ArmoredDiggerHead")) && Main.netMode != 1) - NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("ArmoredDiggerHead")); - } - } - } - if (Main.dayTime && Main.hardMode) //works - { - if (Main.player[closestPlayer].townNPCs >= 2f) - { - if (Main.rand.Next(2000) == 0) - { - int steamGril = NPC.FindFirstNPC(NPCID.Steampunker); - if (steamGril == -1 && Main.netMode != 1) - NPC.SpawnOnPlayer(closestPlayer, NPCID.Steampunker); - } - } - } - if (Main.player[closestPlayer].GetModPlayer(mod).ZoneAbyss) - { - if (Main.player[closestPlayer].chaosState) - { - if (!NPC.AnyNPCs(mod.NPCType("EidolonWyrmHeadHuge")) && Main.netMode != 1) - NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("EidolonWyrmHeadHuge")); - } - } - #region DeathModeBossSpawns - if (death && !CalamityPlayer.areThereAnyDamnBosses) - { - if (bossSpawnCountdown <= 0) //check for countdown being 0 - { - if (Main.rand.Next(50000) == 0) - { - if (!NPC.downedBoss1 && bossType == 0) //only set countdown and boss type if conditions are met - if (!Main.dayTime && (Main.player[closestPlayer].ZoneOverworldHeight || Main.player[closestPlayer].ZoneSkyHeight)) - { - BossText(); - bossType = NPCID.EyeofCthulhu; - bossSpawnCountdown = 3600; //1 minute - } + //Pre-calculate all variables necessary for elliptical area checking + Point origin = (Point)obj; + Vector2 center = origin.ToVector2() * 16f + new Vector2(8f); - if (!NPC.downedBoss2 && bossType == 0) - if (Main.player[closestPlayer].ZoneCorrupt) - { - BossText(); - bossType = NPCID.EaterofWorldsHead; - bossSpawnCountdown = 3600; - } + float angle = MathHelper.Pi * 0.15f; + float otherAngle = MathHelper.PiOver2 - angle; - if (!NPC.downedBoss2 && bossType == 0) - if (Main.player[closestPlayer].ZoneCrimson) - { - BossText(); - bossType = NPCID.BrainofCthulhu; - bossSpawnCountdown = 3600; - } + int distanceInTiles = 150 + ((Main.maxTilesX - 4200) / 4200) * 200; + float distance = distanceInTiles * 16f; + float constant = (distance * 2f) / (float)Math.Sin(angle); - if (!NPC.downedQueenBee && bossType == 0) - if (Main.player[closestPlayer].ZoneJungle && (Main.player[closestPlayer].ZoneOverworldHeight || Main.player[closestPlayer].ZoneSkyHeight)) - { - BossText(); - bossType = NPCID.QueenBee; - bossSpawnCountdown = 3600; - } + float fociSpacing = ((distance * (float)Math.Sin(otherAngle)) / (float)Math.Sin(angle)); + int verticalRadius = (int)(constant / 16f); - if (!downedDesertScourge && bossType == 0) - if (Main.player[closestPlayer].ZoneDesert) - { - BossText(); - bossType = mod.NPCType("DesertScourgeHead"); - bossSpawnCountdown = 3600; - } + Vector2 fociOffset = Vector2.UnitY * fociSpacing; + Vector2 topFoci = center - fociOffset; + Vector2 bottomFoci = center + fociOffset; - if (!downedPerforator && bossType == 0) - if (Main.player[closestPlayer].ZoneCrimson) - { - BossText(); - bossType = mod.NPCType("PerforatorHive"); - bossSpawnCountdown = 3600; - } + for (int x = origin.X - distanceInTiles - 2; x <= origin.X + distanceInTiles + 2; x++) + { + for (int y = (int)(origin.Y - verticalRadius * 0.4f) - 3; y <= origin.Y + verticalRadius + 3; y++) + { + float dist; + if (CheckInEllipse(new Point(x, y), topFoci, bottomFoci, constant, center, out dist, y < origin.Y)) + { + //If we're in the outer blurPercent% of the ellipse + float percent = dist / constant; + float blurPercent = 0.98f; + if (percent > blurPercent) + { + float outerEdgePercent = (percent - blurPercent) / (1f - blurPercent); + if (Main.rand.NextFloat(1f) > outerEdgePercent) + { + ConvertToAstral(x, y); + } + } + else + { + ConvertToAstral(x, y); + } + } + } + } + } - if (!downedHiveMind && bossType == 0) - if (Main.player[closestPlayer].ZoneCorrupt) - { - BossText(); - bossType = mod.NPCType("HiveMind"); - bossSpawnCountdown = 3600; - } + public static void ConvertToAstral(int startX, int endX, int startY, int endY) + { + for (int x = startX; x <= endX; x++) + { + for (int y = startY; y <= endY; y++) + { + ConvertToAstral(x, y); + } + } + } - if (!downedCrabulon && bossType == 0) - if (Main.player[closestPlayer].ZoneGlowshroom) - { - BossText(); - bossType = mod.NPCType("CrabulonIdle"); - bossSpawnCountdown = 3600; - } + public static void ConvertToAstral(int x, int y, bool tileframe = true) + { + Mod mod = ModLoader.GetMod("CalamityMod"); + if (WorldGen.InWorld(x, y, 1)) + { + int type = Main.tile[x, y].type; + int wallType = Main.tile[x, y].wall; - if (Main.hardMode) - { - if (!NPC.downedMechBoss1 && bossType == 0) - if (!Main.dayTime && (Main.player[closestPlayer].ZoneOverworldHeight || Main.player[closestPlayer].ZoneSkyHeight)) - { - BossText(); - bossType = NPCID.TheDestroyer; - bossSpawnCountdown = 3600; - } + if (Main.tile[x, y] != null) + { + if (WallID.Sets.Conversion.Grass[wallType]) + { + Main.tile[x, y].wall = (ushort)mod.WallType("AstralGrassWallUnsafe"); + } + else if (WallID.Sets.Conversion.HardenedSand[wallType]) + { + Main.tile[x, y].wall = (ushort)mod.WallType("HardenedAstralSandWallUnsafe"); + } + else if (WallID.Sets.Conversion.Sandstone[wallType]) + { + Main.tile[x, y].wall = (ushort)mod.WallType("AstralSandstoneWallUnsafe"); + } + else if (WallID.Sets.Conversion.Stone[wallType]) + { + Main.tile[x, y].wall = (ushort)mod.WallType("AstralStoneWallUnsafe"); + } + else + { + switch (wallType) + { + case WallID.DirtUnsafe: + case WallID.DirtUnsafe1: + case WallID.DirtUnsafe2: + case WallID.DirtUnsafe3: + case WallID.DirtUnsafe4: + case WallID.Cave6Unsafe: + case WallID.Dirt: + Main.tile[x, y].wall = (ushort)mod.WallType("AstralDirtWallUnsafe"); + break; + case WallID.IceUnsafe: + Main.tile[x, y].wall = (ushort)mod.WallType("AstralIceWallUnsafe"); + break; + } + } + if (TileID.Sets.Conversion.Grass[type] && !TileID.Sets.GrassSpecial[type]) + { + Main.tile[x, y].type = (ushort)mod.TileType("AstralGrass"); + } + else if (TileID.Sets.Conversion.Stone[type] || Main.tileMoss[type]) + { + Main.tile[x, y].type = (ushort)mod.TileType("AstralStone"); + } + else if (TileID.Sets.Conversion.Sand[type]) + { + Main.tile[x, y].type = (ushort)mod.TileType("AstralSand"); + } + else if (TileID.Sets.Conversion.HardenedSand[type]) + { + Main.tile[x, y].type = (ushort)mod.TileType("HardenedAstralSand"); + } + else if (TileID.Sets.Conversion.Sandstone[type]) + { + Main.tile[x, y].type = (ushort)mod.TileType("AstralSandstone"); + } + else if (TileID.Sets.Conversion.Ice[type]) + { + Main.tile[x, y].type = (ushort)mod.TileType("AstralIce"); + } + else + { + Tile tile = Main.tile[x, y]; + switch (type) + { + case TileID.Dirt: + Main.tile[x, y].type = (ushort)mod.TileType("AstralDirt"); + break; + case TileID.Vines: + Main.tile[x, y].type = (ushort)mod.TileType("AstralVines"); + break; + case TileID.LargePiles: + if (tile.frameX <= 1170) + { + RecursiveReplaceToAstral(TileID.LargePiles, (ushort)mod.TileType("AstralNormalLargePiles"), x, y, 324, 0, 1170, 0, 18); + } + if (tile.frameX >= 1728) + { + RecursiveReplaceToAstral(TileID.LargePiles, (ushort)mod.TileType("AstralNormalLargePiles"), x, y, 324, 1728, 1872, 0, 18); + } + if (tile.frameX >= 1404 && tile.frameX <= 1710) + { + RecursiveReplaceToAstral(TileID.LargePiles, (ushort)mod.TileType("AstralIceLargePiles"), x, y, 324, 1404, 1710, 0, 18); + } + break; + case TileID.LargePiles2: + if (tile.frameX >= 1566 && tile.frameY < 36) + { + RecursiveReplaceToAstral(TileID.LargePiles2, (ushort)mod.TileType("AstralDesertLargePiles"), x, y, 324, 1566, 1872, 0, 18); + } + if (tile.frameX >= 756 && tile.frameX <= 900) + { + RecursiveReplaceToAstral(TileID.LargePiles2, (ushort)mod.TileType("AstralNormalLargePiles"), x, y, 324, 756, 900, 0, 18); + } + break; + case TileID.SmallPiles: + if (tile.frameY == 18) + { + ushort newType = 9999; + if (tile.frameX >= 1476 && tile.frameX <= 1674) + { + newType = (ushort)mod.TileType("AstralDesertMediumPiles"); + } + else if (tile.frameX <= 558 || (tile.frameX >= 1368 && tile.frameX <= 1458)) + { + newType = (ushort)mod.TileType("AstralNormalMediumPiles"); + } + else if (tile.frameX >= 900 && tile.frameX <= 1098) + { + newType = (ushort)mod.TileType("AstralIceMediumPiles"); + } + else + { + break; + } + int leftMost = x; + if (tile.frameX % 36 != 0) //this means it's the right tile of the two + { + leftMost--; + } + if (Main.tile[leftMost, y] != null) + Main.tile[leftMost, y].type = newType; + if (Main.tile[leftMost + 1, y] != null) + Main.tile[leftMost + 1, y].type = newType; + while (Main.tile[leftMost, y].frameX >= 216) + { + if (Main.tile[leftMost, y] != null) + Main.tile[leftMost, y].frameX -= 216; + if (Main.tile[leftMost + 1, y] != null) + Main.tile[leftMost + 1, y].frameX -= 216; + } + } + else if (tile.frameY == 0) + { + ushort newType3 = 9999; + if (tile.frameX >= 972 && tile.frameX <= 1062) + { + newType3 = (ushort)mod.TileType("AstralDesertSmallPiles"); + } + else if (tile.frameX <= 486) + { + newType3 = (ushort)mod.TileType("AstralNormalSmallPiles"); + } + else if (tile.frameX >= 648 && tile.frameX <= 846) + { + newType3 = (ushort)mod.TileType("AstralIceSmallPiles"); + } + else + { + break; + } + Main.tile[x, y].type = newType3; + while (Main.tile[x, y].frameX >= 108) //REFRAME IT + { + Main.tile[x, y].frameX -= 108; + } + } + break; + case TileID.Stalactite: + int topMost = tile.frameY <= 54 ? (tile.frameY % 36 == 0 ? y : y - 1) : y; + bool twoTall = tile.frameY <= 54; + bool hanging = tile.frameY <= 18 || tile.frameY == 72; + ushort newType2 = 9999; + if (tile.frameX >= 378 && tile.frameX <= 414) //DESERT + { + newType2 = (ushort)mod.TileType("AstralDesertStalactite"); + } + else if ((tile.frameX >= 54 && tile.frameX <= 90) || (tile.frameX >= 216 && tile.frameX <= 360)) + { + newType2 = (ushort)mod.TileType("AstralNormalStalactite"); + } + else if (tile.frameX <= 36) + { + newType2 = (ushort)mod.TileType("AstralIceStalactite"); + } + else + { + break; + } - if (!NPC.downedMechBoss2 && bossType == 0) - if (!Main.dayTime && (Main.player[closestPlayer].ZoneOverworldHeight || Main.player[closestPlayer].ZoneSkyHeight)) - { - BossText(); - bossType = NPCID.Spazmatism; - bossSpawnCountdown = 3600; - } + //Set types + if (Main.tile[x, topMost] != null) + Main.tile[x, topMost].type = newType2; + if (twoTall) + { + if (Main.tile[x, topMost + 1] != null) + Main.tile[x, topMost + 1].type = newType2; + } - if (!NPC.downedMechBoss3 && bossType == 0) - if (!Main.dayTime && (Main.player[closestPlayer].ZoneOverworldHeight || Main.player[closestPlayer].ZoneSkyHeight)) - { - BossText(); - bossType = NPCID.SkeletronPrime; - bossSpawnCountdown = 3600; - } + //Fix frames + while (Main.tile[x, topMost].frameX >= 54) + { + if (Main.tile[x, topMost] != null) + Main.tile[x, topMost].frameX -= 54; + if (twoTall) + { + if (Main.tile[x, topMost + 1] != null) + Main.tile[x, topMost + 1].frameX -= 54; + } + } - if (!NPC.downedPlantBoss && bossType == 0) - if (Main.player[closestPlayer].ZoneJungle && !Main.player[closestPlayer].ZoneOverworldHeight && !Main.player[closestPlayer].ZoneSkyHeight) - { - BossText(); - bossType = NPCID.Plantera; - bossSpawnCountdown = 3600; - } + if (hanging) + { + ConvertToAstral(x, topMost - 1); + break; + } + else + { + if (twoTall) + { + ConvertToAstral(x, topMost + 2); + break; + } + ConvertToAstral(x, topMost + 1); + break; + } + } + } + if (tileframe) + { + if (Main.netMode == 0) + { + WorldGen.SquareTileFrame(x, y, true); + } + else if (Main.netMode == 2) + { + NetMessage.SendTileSquare(-1, x, y, 1); + } + } + } + } + } - if (!NPC.downedFishron && bossType == 0) - if (Main.player[closestPlayer].ZoneBeach) - { - BossText(); - bossType = NPCID.DukeFishron; - bossSpawnCountdown = 3600; - } + public static void ConvertFromAstral(int x, int y, ConvertType convert) + { + Tile tile = Main.tile[x, y]; + int type = tile.type; + int wallType = tile.wall; + Mod mod = CalamityMod.Instance; - if (!downedCryogen && bossType == 0) - if (Main.player[closestPlayer].ZoneSnow && Main.player[closestPlayer].ZoneOverworldHeight) - { - BossText(); - bossType = mod.NPCType("Cryogen"); - bossSpawnCountdown = 3600; - } + if (WorldGen.InWorld(x, y, 1)) + { + #region WALL + if (Main.tile[x, y] != null) + { + if (wallType == mod.WallType("AstralDirtWall")) + { + Main.tile[x, y].wall = WallID.DirtUnsafe; + } + else if (wallType == mod.WallType("AstralGrassWall")) + { + switch (convert) + { + case ConvertType.Corrupt: + Main.tile[x, y].wall = WallID.CorruptGrassUnsafe; + break; + case ConvertType.Crimson: + Main.tile[x, y].wall = WallID.CrimsonGrassUnsafe; + break; + case ConvertType.Hallow: + Main.tile[x, y].wall = WallID.HallowedGrassUnsafe; + break; + case ConvertType.Pure: + Main.tile[x, y].wall = WallID.GrassUnsafe; + break; + } + } + else if (wallType == mod.WallType("AstralIceWall")) + { + Main.tile[x, y].wall = WallID.IceUnsafe; + } + else if (wallType == mod.WallType("AstralStoneWall")) + { + switch (convert) + { + case ConvertType.Corrupt: + Main.tile[x, y].wall = WallID.EbonstoneUnsafe; + break; + case ConvertType.Crimson: + Main.tile[x, y].wall = WallID.CrimstoneUnsafe; + break; + case ConvertType.Hallow: + Main.tile[x, y].wall = WallID.PearlstoneBrickUnsafe; + break; + case ConvertType.Pure: + Main.tile[x, y].wall = WallID.Stone; + break; + } + } + } + #endregion - if (!downedCalamitas && bossType == 0) - if (!Main.dayTime && Main.player[closestPlayer].ZoneOverworldHeight) - { - BossText(); - bossType = mod.NPCType("Calamitas"); - bossSpawnCountdown = 3600; - } + #region TILE + if (Main.tile[x, y] != null) + { + if (type == mod.TileType("AstralDirt")) + { + tile.type = TileID.Dirt; + } + else if (type == mod.TileType("AstralGrass")) + { + SetTileFromConvert(x, y, convert, TileID.CorruptGrass, TileID.FleshGrass, TileID.HallowedGrass, TileID.Grass); + } + else if (type == mod.TileType("AstralStone")) + { + SetTileFromConvert(x, y, convert, TileID.Ebonstone, TileID.Crimstone, TileID.Pearlstone, TileID.Stone); + } + else if (type == mod.TileType("AstralSand")) + { + SetTileFromConvert(x, y, convert, TileID.Ebonsand, TileID.Crimsand, TileID.Pearlsand, TileID.Sand); + } + else if (type == mod.TileType("AstralSandstone")) + { + SetTileFromConvert(x, y, convert, TileID.CorruptSandstone, TileID.CrimsonSandstone, TileID.HallowSandstone, TileID.Sandstone); + } + else if (type == mod.TileType("HardenedAstralSand")) + { + SetTileFromConvert(x, y, convert, TileID.CorruptHardenedSand, TileID.CrimsonHardenedSand, TileID.HallowHardenedSand, TileID.HardenedSand); + } + else if (type == mod.TileType("AstralIce")) + { + SetTileFromConvert(x, y, convert, TileID.CorruptIce, TileID.FleshIce, TileID.HallowedIce, TileID.IceBlock); + } + else if (type == mod.TileType("AstralVines")) + { + SetTileFromConvert(x, y, convert, ushort.MaxValue, TileID.CrimsonVines, TileID.HallowedVines, TileID.Vines); + } + else if (type == mod.TileType("AstralShortPlants")) + { + SetTileFromConvert(x, y, convert, TileID.CorruptPlants, ushort.MaxValue, TileID.HallowedPlants, TileID.Plants); + } + else if (type == mod.TileType("AstralTallPlants")) + { + SetTileFromConvert(x, y, convert, ushort.MaxValue, ushort.MaxValue, TileID.HallowedPlants2, TileID.Plants2); + } + else if (type == mod.TileType("AstralNormalLargePiles")) + { + RecursiveReplaceFromAstral((ushort)type, TileID.LargePiles, x, y, 378, 0); + } + else if (type == mod.TileType("AstralNormalMediumPiles")) + { + RecursiveReplaceFromAstral((ushort)type, TileID.SmallPiles, x, y, 0, 18); + } + else if (type == mod.TileType("AstralNormalSmallPiles")) + { + RecursiveReplaceFromAstral((ushort)type, TileID.SmallPiles, x, y, 0, 0); + } + else if (type == mod.TileType("AstralDesertLargePiles")) + { + RecursiveReplaceFromAstral((ushort)type, TileID.LargePiles2, x, y, 1566, 0); + } + else if (type == mod.TileType("AstralDesertMediumPiles")) + { + RecursiveReplaceFromAstral((ushort)type, TileID.SmallPiles, x, y, 1476, 18); + } + else if (type == mod.TileType("AstralDesertSmallPiles")) + { + RecursiveReplaceFromAstral((ushort)type, TileID.SmallPiles, x, y, 972, 0); + } + else if (type == mod.TileType("AstralIceLargePiles")) + { + RecursiveReplaceFromAstral((ushort)type, TileID.LargePiles, x, y, 1404, 0); + } + else if (type == mod.TileType("AstralIceMediumPiles")) + { + RecursiveReplaceFromAstral((ushort)type, TileID.SmallPiles, x, y, 900, 18); + } + else if (type == mod.TileType("AstralIceSmallPiles")) + { + RecursiveReplaceFromAstral((ushort)type, TileID.SmallPiles, x, y, 648, 0); + } + else if (type == mod.TileType("AstralNormalStalactite")) + { + ushort originType = TileID.Stone; + int frameXAdd = 54; + switch (convert) + { + case ConvertType.Corrupt: + originType = TileID.Ebonstone; + frameXAdd = 324; + break; + case ConvertType.Crimson: + originType = TileID.Crimstone; + frameXAdd = 270; + break; + case ConvertType.Hallow: + originType = TileID.Pearlstone; + frameXAdd = 216; + break; + } + ReplaceAstralStalactite((ushort)type, TileID.Stalactite, originType, x, y, frameXAdd, 0); + } + else if (type == mod.TileType("AstralDesertStalactite")) + { + ushort originType = TileID.Sandstone; + int frameXAdd = 378; + switch (convert) + { + case ConvertType.Corrupt: + originType = TileID.CorruptSandstone; + frameXAdd = 324; + break; + case ConvertType.Crimson: + originType = TileID.CrimsonSandstone; + frameXAdd = 270; + break; + case ConvertType.Hallow: + originType = TileID.HallowSandstone; + frameXAdd = 216; + break; + } + ReplaceAstralStalactite((ushort)type, TileID.Stalactite, originType, x, y, frameXAdd, 0); + } + else if (type == mod.TileType("AstralIceStalactite")) + { + ReplaceAstralStalactite((ushort)type, TileID.Stalactite, TileID.IceBlock, x, y, 0, 0); + } + if (TileID.Sets.Conversion.Grass[type] || type == TileID.Dirt) + { + WorldGen.SquareTileFrame(x, y); + } + } + #endregion + } + } - if (!downedAstrageldon && bossType == 0) - if (Main.player[closestPlayer].GetModPlayer(mod).ZoneAstral && - !Main.dayTime && Main.player[closestPlayer].ZoneOverworldHeight) - { - BossText(); - bossType = mod.NPCType("Astrageldon"); - bossSpawnCountdown = 3600; - } + private static void SetTileFromConvert(int x, int y, ConvertType convert, ushort corrupt, ushort crimson, ushort hallow, ushort pure) + { + switch (convert) + { + case ConvertType.Corrupt: + if (corrupt != ushort.MaxValue) + { + Main.tile[x, y].type = corrupt; + WorldGen.SquareTileFrame(x, y); + } + break; + case ConvertType.Crimson: + if (crimson != ushort.MaxValue) + { + Main.tile[x, y].type = crimson; + WorldGen.SquareTileFrame(x, y); + } + break; + case ConvertType.Hallow: + if (hallow != ushort.MaxValue) + { + Main.tile[x, y].type = hallow; + WorldGen.SquareTileFrame(x, y); + } + break; + case ConvertType.Pure: + if (pure != ushort.MaxValue) + { + Main.tile[x, y].type = pure; + WorldGen.SquareTileFrame(x, y); + } + break; + } + } - if (!downedPlaguebringer && bossType == 0) - if (Main.player[closestPlayer].ZoneJungle && NPC.downedGolemBoss && Main.player[closestPlayer].ZoneOverworldHeight) - { - BossText(); - bossType = mod.NPCType("PlaguebringerGoliath"); - bossSpawnCountdown = 3600; - } + private static void RecursiveReplaceToAstral(ushort checkType, ushort replaceType, int x, int y, int replaceTextureWidth, int minFrameX = 0, int maxFrameX = int.MaxValue, int minFrameY = 0, int maxFrameY = int.MaxValue) + { + Tile tile = Main.tile[x, y]; + if (tile == null || !tile.active() || tile.type != checkType || tile.frameX < minFrameX || tile.frameX > maxFrameX || tile.frameY < minFrameY || tile.frameY > maxFrameY) + return; - if (NPC.downedMoonlord) - { - if (!downedGuardians && bossType == 0) - if (Main.player[closestPlayer].ZoneUnderworldHeight || - (Main.player[closestPlayer].ZoneHoly && Main.player[closestPlayer].ZoneOverworldHeight)) - { - BossText(); - bossType = mod.NPCType("ProfanedGuardianBoss"); - bossSpawnCountdown = 3600; - } + Main.tile[x, y].type = replaceType; + while (Main.tile[x, y].frameX >= replaceTextureWidth) + { + Main.tile[x, y].frameX -= (short)replaceTextureWidth; + } - if (!downedBumble && bossType == 0) - if (Main.player[closestPlayer].ZoneJungle && Main.player[closestPlayer].ZoneOverworldHeight) - { - BossText(); - bossType = mod.NPCType("Bumblefuck"); - bossSpawnCountdown = 3600; - } - } - } - if (Main.netMode == 2) - { - var netMessage = mod.GetPacket(); - netMessage.Write((byte)CalamityModMessageType.BossSpawnCountdownSync); - netMessage.Write(bossSpawnCountdown); - netMessage.Send(); - var netMessage2 = mod.GetPacket(); - netMessage2.Write((byte)CalamityModMessageType.BossTypeSync); - netMessage2.Write(bossType); - netMessage2.Send(); - } - } - } - else - { - bossSpawnCountdown--; - if (Main.netMode == 2) - { - var netMessage = mod.GetPacket(); - netMessage.Write((byte)CalamityModMessageType.BossSpawnCountdownSync); - netMessage.Write(bossSpawnCountdown); - netMessage.Send(); - } - if (bossSpawnCountdown <= 0) - { - bool canSpawn = true; - switch (bossType) - { - case NPCID.EyeofCthulhu: - if (Main.dayTime || (!Main.player[closestPlayer].ZoneOverworldHeight && !Main.player[closestPlayer].ZoneSkyHeight)) - canSpawn = false; - break; - case NPCID.EaterofWorldsHead: - if (!Main.player[closestPlayer].ZoneCorrupt) - canSpawn = false; - break; - case NPCID.BrainofCthulhu: - if (!Main.player[closestPlayer].ZoneCrimson) - canSpawn = false; - break; - case NPCID.QueenBee: - if (!Main.player[closestPlayer].ZoneJungle || (!Main.player[closestPlayer].ZoneOverworldHeight && !Main.player[closestPlayer].ZoneSkyHeight)) - canSpawn = false; - break; - case NPCID.TheDestroyer: - if (Main.dayTime || (!Main.player[closestPlayer].ZoneOverworldHeight && !Main.player[closestPlayer].ZoneSkyHeight)) - canSpawn = false; - break; - case NPCID.Spazmatism: - if (Main.dayTime || (!Main.player[closestPlayer].ZoneOverworldHeight && !Main.player[closestPlayer].ZoneSkyHeight)) - canSpawn = false; - break; - case NPCID.SkeletronPrime: - if (Main.dayTime || (!Main.player[closestPlayer].ZoneOverworldHeight && !Main.player[closestPlayer].ZoneSkyHeight)) - canSpawn = false; - break; - case NPCID.Plantera: - if (!Main.player[closestPlayer].ZoneJungle || Main.player[closestPlayer].ZoneOverworldHeight || Main.player[closestPlayer].ZoneSkyHeight) - canSpawn = false; - break; - case NPCID.DukeFishron: - if (!Main.player[closestPlayer].ZoneBeach) - canSpawn = false; - break; - } + if (Main.tile[x - 1, y] != null) + RecursiveReplaceToAstral(checkType, replaceType, x - 1, y, replaceTextureWidth, minFrameX, maxFrameX, minFrameY, maxFrameY); + if (Main.tile[x + 1, y] != null) + RecursiveReplaceToAstral(checkType, replaceType, x + 1, y, replaceTextureWidth, minFrameX, maxFrameX, minFrameY, maxFrameY); + if (Main.tile[x, y - 1] != null) + RecursiveReplaceToAstral(checkType, replaceType, x, y - 1, replaceTextureWidth, minFrameX, maxFrameX, minFrameY, maxFrameY); + if (Main.tile[x, y + 1] != null) + RecursiveReplaceToAstral(checkType, replaceType, x, y + 1, replaceTextureWidth, minFrameX, maxFrameX, minFrameY, maxFrameY); + } - if (bossType == mod.NPCType("DesertScourgeHead")) - { - if (!Main.player[closestPlayer].ZoneDesert) - canSpawn = false; - } - else if (bossType == mod.NPCType("PerforatorHive")) - { - if (!Main.player[closestPlayer].ZoneCrimson) - canSpawn = false; - } - else if (bossType == mod.NPCType("HiveMind")) - { - if (!Main.player[closestPlayer].ZoneCorrupt) - canSpawn = false; - } - else if (bossType == mod.NPCType("CrabulonIdle")) - { - if (!Main.player[closestPlayer].ZoneGlowshroom) - canSpawn = false; - } - else if (bossType == mod.NPCType("Cryogen")) - { - if (!Main.player[closestPlayer].ZoneSnow || !Main.player[closestPlayer].ZoneOverworldHeight) - canSpawn = false; - } - else if (bossType == mod.NPCType("Calamitas")) - { - if (Main.dayTime || !Main.player[closestPlayer].ZoneOverworldHeight) - canSpawn = false; - } - else if (bossType == mod.NPCType("Astrageldon")) - { - if (!Main.player[closestPlayer].GetModPlayer(mod).ZoneAstral || - Main.dayTime || !Main.player[closestPlayer].ZoneOverworldHeight) - canSpawn = false; - } - else if (bossType == mod.NPCType("PlaguebringerGoliath")) - { - if (!Main.player[closestPlayer].ZoneJungle || !Main.player[closestPlayer].ZoneOverworldHeight) - canSpawn = false; - } - else if (bossType == mod.NPCType("ProfanedGuardianBoss")) - { - if (!Main.player[closestPlayer].ZoneUnderworldHeight && - (!Main.player[closestPlayer].ZoneHoly || !Main.player[closestPlayer].ZoneOverworldHeight)) - canSpawn = false; - } - else if (bossType == mod.NPCType("Bumblefuck")) - { - if (!Main.player[closestPlayer].ZoneJungle || !Main.player[closestPlayer].ZoneOverworldHeight) - canSpawn = false; - } + private static void RecursiveReplaceFromAstral(ushort checkType, ushort replaceType, int x, int y, int addFrameX, int addFrameY) + { + Tile tile = Main.tile[x, y]; + if (tile == null || !tile.active() || tile.type != checkType) + return; - if (canSpawn && Main.netMode != 1) - { - if (bossType == NPCID.Spazmatism) - NPC.SpawnOnPlayer(closestPlayer, NPCID.Retinazer); - else if (bossType == mod.NPCType("ProfanedGuardianBoss")) - { - NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("ProfanedGuardianBoss2")); - NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("ProfanedGuardianBoss3")); - } - else if (bossType == mod.NPCType("DesertScourgeHead")) - { - NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("DesertScourgeHeadSmall")); - NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("DesertScourgeHeadSmall")); - } - NPC.SpawnOnPlayer(closestPlayer, bossType); - } - bossType = 0; - if (Main.netMode == 2) - { - var netMessage = mod.GetPacket(); - netMessage.Write((byte)CalamityModMessageType.BossTypeSync); - netMessage.Write(bossType); - netMessage.Send(); - } - } - } - } - #endregion - if (!NPC.downedBoss3 && revenge) - { - if (Main.netMode != 1) - { - if (Sandstorm.Happening) - { - Sandstorm.Happening = false; - Sandstorm.TimeLeft = 0; - } - } - } - if (CalamityGlobalNPC.holyBoss >= 0 && !Main.npc[CalamityGlobalNPC.holyBoss].active) - { - CalamityGlobalNPC.holyBoss = -1; - if (Main.netMode == 2) - { - var netMessage = mod.GetPacket(); - netMessage.Write((byte)CalamityModMessageType.Providence); - netMessage.Write(CalamityGlobalNPC.holyBoss); - netMessage.Send(); - } - } - if (CalamityGlobalNPC.doughnutBoss >= 0 && !Main.npc[CalamityGlobalNPC.doughnutBoss].active) - { - CalamityGlobalNPC.doughnutBoss = -1; - } - if (CalamityGlobalNPC.voidBoss >= 0 && !Main.npc[CalamityGlobalNPC.voidBoss].active) - { - CalamityGlobalNPC.voidBoss = -1; - } - if (CalamityGlobalNPC.energyFlame >= 0 && !Main.npc[CalamityGlobalNPC.energyFlame].active) - { - CalamityGlobalNPC.energyFlame = -1; - } - if (CalamityGlobalNPC.hiveMind >= 0 && !Main.npc[CalamityGlobalNPC.hiveMind].active) - { - CalamityGlobalNPC.hiveMind = -1; - } - if (CalamityGlobalNPC.hiveMind2 >= 0 && !Main.npc[CalamityGlobalNPC.hiveMind2].active) - { - CalamityGlobalNPC.hiveMind2 = -1; - } - if (CalamityGlobalNPC.scavenger >= 0 && !Main.npc[CalamityGlobalNPC.scavenger].active) - { - CalamityGlobalNPC.scavenger = -1; - if (Main.netMode == 2) - { - var netMessage = mod.GetPacket(); - netMessage.Write((byte)CalamityModMessageType.Ravager); - netMessage.Write(CalamityGlobalNPC.scavenger); - netMessage.Send(); - } - } - if (CalamityGlobalNPC.DoGHead >= 0 && !Main.npc[CalamityGlobalNPC.DoGHead].active) - { - CalamityGlobalNPC.DoGHead = -1; - if (Main.netMode == 2) - { - var netMessage = mod.GetPacket(); - netMessage.Write((byte)CalamityModMessageType.DoG); - netMessage.Write(CalamityGlobalNPC.DoGHead); - netMessage.Send(); - } - } - if (CalamityGlobalNPC.SCal >= 0 && !Main.npc[CalamityGlobalNPC.SCal].active) - { - CalamityGlobalNPC.SCal = -1; - if (Main.netMode == 2) - { - var netMessage = mod.GetPacket(); - netMessage.Write((byte)CalamityModMessageType.SupremeCal); - netMessage.Write(CalamityGlobalNPC.SCal); - netMessage.Send(); - } - } - if (CalamityGlobalNPC.ghostBoss >= 0 && !Main.npc[CalamityGlobalNPC.ghostBoss].active) - { - CalamityGlobalNPC.ghostBoss = -1; - if (Main.netMode == 2) - { - var netMessage = mod.GetPacket(); - netMessage.Write((byte)CalamityModMessageType.Polterghast); - netMessage.Write(CalamityGlobalNPC.ghostBoss); - netMessage.Send(); - } - } - if (CalamityGlobalNPC.laserEye >= 0 && !Main.npc[CalamityGlobalNPC.laserEye].active) - { - CalamityGlobalNPC.laserEye = -1; - } - if (CalamityGlobalNPC.fireEye >= 0 && !Main.npc[CalamityGlobalNPC.fireEye].active) - { - CalamityGlobalNPC.fireEye = -1; - } - if (CalamityGlobalNPC.lordeBoss >= 0 && !Main.npc[CalamityGlobalNPC.lordeBoss].active) - { - CalamityGlobalNPC.lordeBoss = -1; - if (Main.netMode == 2) - { - var netMessage = mod.GetPacket(); - netMessage.Write((byte)CalamityModMessageType.LORDE); - netMessage.Write(CalamityGlobalNPC.lordeBoss); - netMessage.Send(); - } - } - if (Main.netMode != 1) - { - if (revenge) - { - CultistRitual.delay -= Main.dayRate * 10; - if (CultistRitual.delay < 0) - { - CultistRitual.delay = 0; - } - CultistRitual.recheck -= Main.dayRate * 10; - if (CultistRitual.recheck < 0) - { - CultistRitual.recheck = 0; - } - } - } - } - #endregion + Main.tile[x, y].type = replaceType; + Main.tile[x, y].frameX += (short)addFrameX; + Main.tile[x, y].frameY += (short)addFrameY; - #region ChangeTime - public static void ChangeTime(bool day) - { - if (day) - { - Main.time = 0.0; - Main.dayTime = true; - } - else - { - Main.time = 0.0; - Main.dayTime = false; - } - if (Main.netMode == 2) - { - NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); - } - } - #endregion + if (Main.tile[x - 1, y] != null) + RecursiveReplaceFromAstral(checkType, replaceType, x - 1, y, addFrameX, addFrameY); + if (Main.tile[x + 1, y] != null) + RecursiveReplaceFromAstral(checkType, replaceType, x + 1, y, addFrameX, addFrameY); + if (Main.tile[x, y - 1] != null) + RecursiveReplaceFromAstral(checkType, replaceType, x, y - 1, addFrameX, addFrameY); + if (Main.tile[x, y + 1] != null) + RecursiveReplaceFromAstral(checkType, replaceType, x, y + 1, addFrameX, addFrameY); + } - #region BossText - public void BossText() - { - string key = "Mods.CalamityMod.BossSpawnText"; - Color messageColor = Color.Crimson; - if (Main.netMode == 0) - { - Main.NewText(Language.GetTextValue(key), messageColor); - } - else if (Main.netMode == 2) - { - NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); - } - } - #endregion - } + private static void ReplaceAstralStalactite(ushort checkType, ushort replaceType, ushort replaceOriginTile, int x, int y, int addFrameX, int addFrameY) + { + Tile tile = Main.tile[x, y]; + + int topMost = tile.frameY <= 54 ? (tile.frameY % 36 == 0 ? y : y - 1) : y; + bool twoTall = tile.frameY <= 54; + bool hanging = tile.frameY <= 18 || tile.frameY == 72; + + int yOriginTile = (hanging ? topMost - 1 : (twoTall ? topMost + 2 : y + 1)); + + if (Main.tile[x, topMost++] != null) + Main.tile[x, topMost++].type = replaceType; + if (twoTall) + { + if (Main.tile[x, topMost] != null) + Main.tile[x, topMost].type = replaceType; + } + if (Main.tile[x, yOriginTile] != null) + Main.tile[x, yOriginTile].type = replaceOriginTile; + } + + private static bool CheckInEllipse(Point tile, Vector2 focus1, Vector2 focus2, float distanceConstant, Vector2 center, out float distance, bool collapse = false) + { + Vector2 point = tile.ToVector2() * 16f + new Vector2(8f); + if (collapse) //Collapse ensures the ellipse is shrunk down a lot in terms of distance. + { + float distY = center.Y - point.Y; + point.Y -= distY * 8f; + } + float distance1 = Vector2.Distance(point, focus1); + float distance2 = Vector2.Distance(point, focus2); + distance = distance1 + distance2; + return distance <= distanceConstant; + } + #endregion + + #region EvilIsland + public static void EvilIsland(int i, int j) + { + double num = (double)WorldGen.genRand.Next(100, 150); //100 150 + float num2 = (float)WorldGen.genRand.Next(20, 30); //20 30 + int num3 = i; + int num4 = i; + int num5 = i; + int num6 = j; + Vector2 vector; + vector.X = (float)i; + vector.Y = (float)j; + Vector2 vector2; + vector2.X = (float)WorldGen.genRand.Next(-20, 21) * 0.2f; + while (vector2.X > -2f && vector2.X < 2f) + { + vector2.X = (float)WorldGen.genRand.Next(-20, 21) * 0.2f; + } + vector2.Y = (float)WorldGen.genRand.Next(-20, -10) * 0.02f; + while (num > 0.0 && num2 > 0f) + { + num -= (double)WorldGen.genRand.Next(4); + num2 -= 1f; + int num7 = (int)((double)vector.X - num * 0.5); + int num8 = (int)((double)vector.X + num * 0.5); + int num9 = (int)((double)vector.Y - num * 0.5); + int num10 = (int)((double)vector.Y + num * 0.5); + if (num7 < 0) + { + num7 = 0; + } + if (num8 > Main.maxTilesX) + { + num8 = Main.maxTilesX; + } + if (num9 < 0) + { + num9 = 0; + } + if (num10 > Main.maxTilesY) + { + num10 = Main.maxTilesY; + } + double num11 = num * (double)WorldGen.genRand.Next(80, 120) * 0.01; //80 120 + float num12 = vector.Y + 1f; + for (int k = num7; k < num8; k++) + { + if (WorldGen.genRand.Next(2) == 0) + { + num12 += (float)WorldGen.genRand.Next(-1, 2); + } + if (num12 < vector.Y) + { + num12 = vector.Y; + } + if (num12 > vector.Y + 2f) + { + num12 = vector.Y + 2f; + } + for (int l = num9; l < num10; l++) + { + if ((float)l > num12) + { + float arg_218_0 = Math.Abs((float)k - vector.X); + float num13 = Math.Abs((float)l - vector.Y) * 3f; + if (Math.Sqrt((double)(arg_218_0 * arg_218_0 + num13 * num13)) < num11 * 0.4) + { + if (k < num3) + { + num3 = k; + } + if (k > num4) + { + num4 = k; + } + if (l < num5) + { + num5 = l; + } + if (l > num6) + { + num6 = l; + } + Main.tile[k, l].active(true); + Main.tile[k, l].type = (ushort)(WorldGen.crimson ? 400 : 401); //ebonstone or crimstone + WorldGen.SquareTileFrame(k, l, true); + } + } + } + } + vector += vector2; + vector2.X += (float)WorldGen.genRand.Next(-20, 21) * 0.05f; + if (vector2.X > 1f) + { + vector2.X = 1f; + } + if (vector2.X < -1f) + { + vector2.X = -1f; + } + if ((double)vector2.Y > 0.2) + { + vector2.Y = -0.2f; + } + if ((double)vector2.Y < -0.2) + { + vector2.Y = -0.2f; + } + } + int m = num3; + int num15; + for (m += WorldGen.genRand.Next(5); m < num4; m += WorldGen.genRand.Next(num15, (int)((double)num15 * 1.5))) + { + int num14 = num6; + while (!Main.tile[m, num14].active()) + { + num14--; + } + num14 += WorldGen.genRand.Next(-3, 4); + num15 = WorldGen.genRand.Next(4, 8); + int num16 = (WorldGen.crimson ? 400 : 401); + if (WorldGen.genRand.Next(4) == 0) + { + num16 = (WorldGen.crimson ? 398 : 399); + } + for (int n = m - num15; n <= m + num15; n++) + { + for (int num17 = num14 - num15; num17 <= num14 + num15; num17++) + { + if (num17 > num5) + { + float arg_409_0 = (float)Math.Abs(n - m); + float num18 = (float)(Math.Abs(num17 - num14) * 2); + if (Math.Sqrt((double)(arg_409_0 * arg_409_0 + num18 * num18)) < (double)(num15 + WorldGen.genRand.Next(2))) + { + Main.tile[n, num17].active(true); + Main.tile[n, num17].type = (ushort)num16; + WorldGen.SquareTileFrame(n, num17, true); + } + } + } + } + } + num = (double)WorldGen.genRand.Next(80, 95); + num2 = (float)WorldGen.genRand.Next(10, 15); + vector.X = (float)i; + vector.Y = (float)num5; + vector2.X = (float)WorldGen.genRand.Next(-20, 21) * 0.2f; + while (vector2.X > -2f && vector2.X < 2f) + { + vector2.X = (float)WorldGen.genRand.Next(-20, 21) * 0.2f; + } + vector2.Y = (float)WorldGen.genRand.Next(-20, -10) * 0.02f; + while (num > 0.0 && num2 > 0f) + { + num -= (double)WorldGen.genRand.Next(4); + num2 -= 1f; + int num7 = (int)((double)vector.X - num * 0.5); + int num8 = (int)((double)vector.X + num * 0.5); + int num9 = num5 - 1; + int num10 = (int)((double)vector.Y + num * 0.5); + if (num7 < 0) + { + num7 = 0; + } + if (num8 > Main.maxTilesX) + { + num8 = Main.maxTilesX; + } + if (num9 < 0) + { + num9 = 0; + } + if (num10 > Main.maxTilesY) + { + num10 = Main.maxTilesY; + } + double num11 = num * (double)WorldGen.genRand.Next(80, 120) * 0.01; + float num19 = vector.Y + 1f; + for (int num20 = num7; num20 < num8; num20++) + { + if (WorldGen.genRand.Next(2) == 0) + { + num19 += (float)WorldGen.genRand.Next(-1, 2); + } + if (num19 < vector.Y) + { + num19 = vector.Y; + } + if (num19 > vector.Y + 2f) + { + num19 = vector.Y + 2f; + } + for (int num21 = num9; num21 < num10; num21++) + { + if ((float)num21 > num19) + { + float arg_69E_0 = Math.Abs((float)num20 - vector.X); + float num22 = Math.Abs((float)num21 - vector.Y) * 3f; + if (Math.Sqrt((double)(arg_69E_0 * arg_69E_0 + num22 * num22)) < num11 * 0.4 && + Main.tile[num20, num21].type == (WorldGen.crimson ? 400 : 401)) + { + Main.tile[num20, num21].type = (ushort)(WorldGen.crimson ? 22 : 204); //ore + WorldGen.SquareTileFrame(num20, num21, true); + } + } + } + } + vector += vector2; + vector2.X += (float)WorldGen.genRand.Next(-20, 21) * 0.05f; + if (vector2.X > 1f) + { + vector2.X = 1f; + } + if (vector2.X < -1f) + { + vector2.X = -1f; + } + if ((double)vector2.Y > 0.2) + { + vector2.Y = -0.2f; + } + if ((double)vector2.Y < -0.2) + { + vector2.Y = -0.2f; + } + } + int num23 = num3; + num23 += WorldGen.genRand.Next(5); + while (num23 < num4) + { + int num24 = num6; + while ((!Main.tile[num23, num24].active() || Main.tile[num23, num24].type != 0) && num23 < num4) + { + num24--; + if (num24 < num5) + { + num24 = num6; + num23 += WorldGen.genRand.Next(1, 4); + } + } + if (num23 < num4) + { + num24 += WorldGen.genRand.Next(0, 4); + int num25 = WorldGen.genRand.Next(2, 5); + int num26 = (WorldGen.crimson ? 400 : 401); + for (int num27 = num23 - num25; num27 <= num23 + num25; num27++) + { + for (int num28 = num24 - num25; num28 <= num24 + num25; num28++) + { + if (num28 > num5) + { + float arg_890_0 = (float)Math.Abs(num27 - num23); + float num29 = (float)(Math.Abs(num28 - num24) * 2); + if (Math.Sqrt((double)(arg_890_0 * arg_890_0 + num29 * num29)) < (double)num25) + { + Main.tile[num27, num28].type = (ushort)num26; + WorldGen.SquareTileFrame(num27, num28, true); + } + } + } + } + num23 += WorldGen.genRand.Next(num25, (int)((double)num25 * 1.5)); + } + } + for (int num30 = num3 - 20; num30 <= num4 + 20; num30++) + { + for (int num31 = num5 - 20; num31 <= num6 + 20; num31++) + { + bool flag = true; + for (int num32 = num30 - 1; num32 <= num30 + 1; num32++) + { + for (int num33 = num31 - 1; num33 <= num31 + 1; num33++) + { + if (!Main.tile[num32, num33].active()) + { + flag = false; + } + } + } + if (flag) + { + Main.tile[num30, num31].wall = (ushort)(WorldGen.crimson ? 220 : 221); + WorldGen.SquareWallFrame(num30, num31, true); + } + } + } + for (int num34 = num3; num34 <= num4; num34++) + { + int num35 = num5 - 10; + while (!Main.tile[num34, num35 + 1].active()) + { + num35++; + } + if (num35 < num6 && Main.tile[num34, num35 + 1].type == (WorldGen.crimson ? 400 : 401)) + { + if (WorldGen.genRand.Next(10) == 0) + { + int num36 = WorldGen.genRand.Next(1, 3); + for (int num37 = num34 - num36; num37 <= num34 + num36; num37++) + { + if (Main.tile[num37, num35].type == (WorldGen.crimson ? 400 : 401)) + { + Main.tile[num37, num35].active(false); + Main.tile[num37, num35].liquid = 255; + Main.tile[num37, num35].lava(false); + WorldGen.SquareTileFrame(num34, num35, true); + } + if (Main.tile[num37, num35 + 1].type == (WorldGen.crimson ? 400 : 401)) + { + Main.tile[num37, num35 + 1].active(false); + Main.tile[num37, num35 + 1].liquid = 255; + Main.tile[num37, num35 + 1].lava(false); + WorldGen.SquareTileFrame(num34, num35 + 1, true); + } + if (num37 > num34 - num36 && num37 < num34 + 2 && Main.tile[num37, num35 + 2].type == (WorldGen.crimson ? 400 : 401)) + { + Main.tile[num37, num35 + 2].active(false); + Main.tile[num37, num35 + 2].liquid = 255; + Main.tile[num37, num35 + 2].lava(false); + WorldGen.SquareTileFrame(num34, num35 + 2, true); + } + } + } + if (WorldGen.genRand.Next(5) == 0) + { + Main.tile[num34, num35].liquid = 255; + } + Main.tile[num34, num35].lava(false); + WorldGen.SquareTileFrame(num34, num35, true); + } + } + int num38 = WorldGen.genRand.Next(4); + for (int num39 = 0; num39 <= num38; num39++) + { + int num40 = WorldGen.genRand.Next(num3 - 5, num4 + 5); + int num41 = num5 - WorldGen.genRand.Next(20, 40); + int num42 = WorldGen.genRand.Next(4, 8); + int num43 = (WorldGen.crimson ? 400 : 401); + if (WorldGen.genRand.Next(2) == 0) + { + num43 = (WorldGen.crimson ? 398 : 399); + } + for (int num44 = num40 - num42; num44 <= num40 + num42; num44++) + { + for (int num45 = num41 - num42; num45 <= num41 + num42; num45++) + { + float arg_C74_0 = (float)Math.Abs(num44 - num40); + float num46 = (float)(Math.Abs(num45 - num41) * 2); + if (Math.Sqrt((double)(arg_C74_0 * arg_C74_0 + num46 * num46)) < (double)(num42 + WorldGen.genRand.Next(-1, 2))) + { + Main.tile[num44, num45].active(true); + Main.tile[num44, num45].type = (ushort)num43; + WorldGen.SquareTileFrame(num44, num45, true); + } + } + } + for (int num47 = num40 - num42 + 2; num47 <= num40 + num42 - 2; num47++) + { + int num48 = num41 - num42; + while (!Main.tile[num47, num48].active()) + { + num48++; + } + Main.tile[num47, num48].active(false); + Main.tile[num47, num48].liquid = 255; + WorldGen.SquareTileFrame(num47, num48, true); + } + } + } + #endregion + + #region EvilIslandHouse + public static void EvilIslandHouse(int i, int j) + { + ushort type = (ushort)(WorldGen.crimson ? 152 : 347); //tile + byte wall = (byte)(WorldGen.crimson ? 35 : 174); //wall + Vector2 vector = new Vector2((float)i, (float)j); + int num = 1; + if (WorldGen.genRand.Next(2) == 0) + { + num = -1; + } + int num2 = WorldGen.genRand.Next(7, 12); + int num3 = WorldGen.genRand.Next(5, 7); + vector.X = (float)(i + (num2 + 2) * num); + for (int k = j - 15; k < j + 30; k++) + { + if (Main.tile[(int)vector.X, k].active()) + { + vector.Y = (float)(k - 1); + break; + } + } + vector.X = (float)i; + int num4 = (int)(vector.X - (float)num2 - 1f); + int num5 = (int)(vector.X + (float)num2 + 1f); + int num6 = (int)(vector.Y - (float)num3 - 1f); + int num7 = (int)(vector.Y + 2f); + if (num4 < 0) + { + num4 = 0; + } + if (num5 > Main.maxTilesX) + { + num5 = Main.maxTilesX; + } + if (num6 < 0) + { + num6 = 0; + } + if (num7 > Main.maxTilesY) + { + num7 = Main.maxTilesY; + } + for (int l = num4; l <= num5; l++) + { + for (int m = num6 - 1; m < num7 + 1; m++) + { + if (m != num6 - 1 || (l != num4 && l != num5)) + { + Main.tile[l, m].active(true); + Main.tile[l, m].liquid = 0; + Main.tile[l, m].type = type; + Main.tile[l, m].wall = 0; + Main.tile[l, m].halfBrick(false); + Main.tile[l, m].slope(0); + } + } + } + num4 = (int)(vector.X - (float)num2); + num5 = (int)(vector.X + (float)num2); + num6 = (int)(vector.Y - (float)num3); + num7 = (int)(vector.Y + 1f); + if (num4 < 0) + { + num4 = 0; + } + if (num5 > Main.maxTilesX) + { + num5 = Main.maxTilesX; + } + if (num6 < 0) + { + num6 = 0; + } + if (num7 > Main.maxTilesY) + { + num7 = Main.maxTilesY; + } + for (int n = num4; n <= num5; n++) + { + for (int num8 = num6; num8 < num7; num8++) + { + if ((num8 != num6 || (n != num4 && n != num5)) && Main.tile[n, num8].wall == 0) + { + Main.tile[n, num8].active(false); + Main.tile[n, num8].wall = wall; + } + } + } + int num9 = i + (num2 + 1) * num; + int num10 = (int)vector.Y; + for (int num11 = num9 - 2; num11 <= num9 + 2; num11++) + { + Main.tile[num11, num10].active(false); + Main.tile[num11, num10 - 1].active(false); + Main.tile[num11, num10 - 2].active(false); + } + WorldGen.PlaceTile(num9, num10, 10, true, false, -1, (WorldGen.crimson ? 1 : 10)); //door + num9 = i + (num2 + 1) * -num - num; + for (int num12 = num6; num12 <= num7 + 1; num12++) + { + Main.tile[num9, num12].active(true); + Main.tile[num9, num12].liquid = 0; + Main.tile[num9, num12].type = type; + Main.tile[num9, num12].wall = 0; + Main.tile[num9, num12].halfBrick(false); + Main.tile[num9, num12].slope(0); + } + int contain = 0; + if (WorldGen.crimson) + { + contain = 1571; //scourge + } + else + { + contain = 1569; //vampire + } + WorldGen.AddBuriedChest(i, num10 - 3, contain, false, (WorldGen.crimson ? 19 : 20)); //chest + int num14 = i - num2 / 2 + 1; + int num15 = i + num2 / 2 - 1; + int num16 = 1; + if (num2 > 10) + { + num16 = 2; + } + int num17 = (num6 + num7) / 2 - 1; + for (int num18 = num14 - num16; num18 <= num14 + num16; num18++) + { + for (int num19 = num17 - 1; num19 <= num17 + 1; num19++) + { + Main.tile[num18, num19].wall = 21; //glass + } + } + for (int num20 = num15 - num16; num20 <= num15 + num16; num20++) + { + for (int num21 = num17 - 1; num21 <= num17 + 1; num21++) + { + Main.tile[num20, num21].wall = 21; //glass + } + } + int num22 = i + (num2 / 2 + 1) * -num; + WorldGen.PlaceTile(num22, num7 - 1, 14, true, false, -1, (WorldGen.crimson ? 1 : 8)); //table + WorldGen.PlaceTile(num22 - 2, num7 - 1, 15, true, false, 0, (WorldGen.crimson ? 2 : 11)); //chair + Tile expr_510 = Main.tile[num22 - 2, num7 - 1]; + expr_510.frameX += 18; + Tile expr_531 = Main.tile[num22 - 2, num7 - 2]; + expr_531.frameX += 18; + WorldGen.PlaceTile(num22 + 2, num7 - 1, 15, true, false, 0, (WorldGen.crimson ? 2 : 11)); //chair + } + #endregion + + #region UnderworldIsland + public static void UnderworldIsland(int i, int j, int sizeMin, int sizeMax, int sizeMin2, int sizeMax2) + { + Mod mod = ModLoader.GetMod("CalamityMod"); + double num = (double)WorldGen.genRand.Next(sizeMin, sizeMax); //100 150 + float num2 = (float)WorldGen.genRand.Next(sizeMin / 5, sizeMax / 5); //20 30 + int num3 = i; + int num4 = i; + int num5 = i; + int num6 = j; + Vector2 vector; + vector.X = (float)i; + vector.Y = (float)j; + Vector2 vector2; + vector2.X = (float)WorldGen.genRand.Next(-20, 21) * 0.2f; + while (vector2.X > -2f && vector2.X < 2f) + { + vector2.X = (float)WorldGen.genRand.Next(-20, 21) * 0.2f; + } + vector2.Y = (float)WorldGen.genRand.Next(-20, -10) * 0.02f; + while (num > 0.0 && num2 > 0f) + { + num -= (double)WorldGen.genRand.Next(4); + num2 -= 1f; + int num7 = (int)((double)vector.X - num * 0.5); + int num8 = (int)((double)vector.X + num * 0.5); + int num9 = (int)((double)vector.Y - num * 0.5); + int num10 = (int)((double)vector.Y + num * 0.5); + if (num7 < 0) + { + num7 = 0; + } + if (num8 > Main.maxTilesX) + { + num8 = Main.maxTilesX; + } + if (num9 < 0) + { + num9 = 0; + } + if (num10 > Main.maxTilesY) + { + num10 = Main.maxTilesY; + } + double num11 = num * (double)WorldGen.genRand.Next(sizeMin, sizeMax) * 0.01; //80 120 + float num12 = vector.Y + 1f; + for (int k = num7; k < num8; k++) + { + if (WorldGen.genRand.Next(2) == 0) + { + num12 += (float)WorldGen.genRand.Next(-1, 2); + } + if (num12 < vector.Y) + { + num12 = vector.Y; + } + if (num12 > vector.Y + 2f) + { + num12 = vector.Y + 2f; + } + for (int l = num9; l < num10; l++) + { + if ((float)l > num12) + { + float arg_218_0 = Math.Abs((float)k - vector.X); + float num13 = Math.Abs((float)l - vector.Y) * 3f; + if (Math.Sqrt((double)(arg_218_0 * arg_218_0 + num13 * num13)) < num11 * 0.4) + { + if (k < num3) + { + num3 = k; + } + if (k > num4) + { + num4 = k; + } + if (l < num5) + { + num5 = l; + } + if (l > num6) + { + num6 = l; + } + Main.tile[k, l].active(true); + Main.tile[k, l].type = (ushort)mod.TileType("BrimstoneSlag"); + WorldGen.SquareTileFrame(k, l, true); + } + } + } + } + vector += vector2; + vector2.X += (float)WorldGen.genRand.Next(-20, 21) * 0.05f; + if (vector2.X > 1f) + { + vector2.X = 1f; + } + if (vector2.X < -1f) + { + vector2.X = -1f; + } + if ((double)vector2.Y > 0.2) + { + vector2.Y = -0.2f; + } + if ((double)vector2.Y < -0.2) + { + vector2.Y = -0.2f; + } + } + int m = num3; + int num15; + for (m += WorldGen.genRand.Next(5); m < num4; m += WorldGen.genRand.Next(num15, (int)((double)num15 * 1.5))) + { + int num14 = num6; + while (!Main.tile[m, num14].active()) + { + num14--; + } + num14 += WorldGen.genRand.Next(-3, 4); + num15 = WorldGen.genRand.Next(4, 8); + int num16 = mod.TileType("BrimstoneSlag"); + if (WorldGen.genRand.Next(4) == 0) + { + num16 = mod.TileType("CharredOre"); + } + for (int n = m - num15; n <= m + num15; n++) + { + for (int num17 = num14 - num15; num17 <= num14 + num15; num17++) + { + if (num17 > num5) + { + float arg_409_0 = (float)Math.Abs(n - m); + float num18 = (float)(Math.Abs(num17 - num14) * 2); + if (Math.Sqrt((double)(arg_409_0 * arg_409_0 + num18 * num18)) < (double)(num15 + WorldGen.genRand.Next(2))) + { + Main.tile[n, num17].active(true); + Main.tile[n, num17].type = (ushort)num16; + WorldGen.SquareTileFrame(n, num17, true); + } + } + } + } + } + num = (double)WorldGen.genRand.Next(sizeMin2, sizeMax2); + num2 = (float)WorldGen.genRand.Next(sizeMin2 / 8, sizeMax2 / 8); + vector.X = (float)i; + vector.Y = (float)num5; + vector2.X = (float)WorldGen.genRand.Next(-20, 21) * 0.2f; + while (vector2.X > -2f && vector2.X < 2f) + { + vector2.X = (float)WorldGen.genRand.Next(-20, 21) * 0.2f; + } + vector2.Y = (float)WorldGen.genRand.Next(-20, -10) * 0.02f; + while (num > 0.0 && num2 > 0f) + { + num -= (double)WorldGen.genRand.Next(4); + num2 -= 1f; + vector += vector2; + vector2.X += (float)WorldGen.genRand.Next(-20, 21) * 0.05f; + if (vector2.X > 1f) + { + vector2.X = 1f; + } + if (vector2.X < -1f) + { + vector2.X = -1f; + } + if ((double)vector2.Y > 0.2) + { + vector2.Y = -0.2f; + } + if ((double)vector2.Y < -0.2) + { + vector2.Y = -0.2f; + } + } + int num23 = num3; + num23 += WorldGen.genRand.Next(5); + while (num23 < num4) + { + int num24 = num6; + while ((!Main.tile[num23, num24].active() || Main.tile[num23, num24].type != 0) && num23 < num4) + { + num24--; + if (num24 < num5) + { + num24 = num6; + num23 += WorldGen.genRand.Next(1, 4); + } + } + if (num23 < num4) + { + num24 += WorldGen.genRand.Next(0, 4); + int num25 = WorldGen.genRand.Next(2, 5); + int num26 = mod.TileType("BrimstoneSlag"); + for (int num27 = num23 - num25; num27 <= num23 + num25; num27++) + { + for (int num28 = num24 - num25; num28 <= num24 + num25; num28++) + { + if (num28 > num5) + { + float arg_890_0 = (float)Math.Abs(num27 - num23); + float num29 = (float)(Math.Abs(num28 - num24) * 2); + if (Math.Sqrt((double)(arg_890_0 * arg_890_0 + num29 * num29)) < (double)num25) + { + Main.tile[num27, num28].type = (ushort)num26; + WorldGen.SquareTileFrame(num27, num28, true); + } + } + } + } + num23 += WorldGen.genRand.Next(num25, (int)((double)num25 * 1.5)); + } + } + for (int num34 = num3; num34 <= num4; num34++) + { + int num35 = num5 - 10; + while (!Main.tile[num34, num35 + 1].active()) + { + num35++; + } + if (num35 < num6 && Main.tile[num34, num35 + 1].type == (ushort)mod.TileType("BrimstoneSlag")) + { + if (WorldGen.genRand.Next(10) == 0) + { + int num36 = WorldGen.genRand.Next(1, 3); + for (int num37 = num34 - num36; num37 <= num34 + num36; num37++) + { + if (Main.tile[num37, num35].type == (ushort)mod.TileType("BrimstoneSlag")) + { + Main.tile[num37, num35].active(false); + Main.tile[num37, num35].liquid = 255; + Main.tile[num37, num35].lava(false); + WorldGen.SquareTileFrame(num34, num35, true); + } + if (Main.tile[num37, num35 + 1].type == (ushort)mod.TileType("BrimstoneSlag")) + { + Main.tile[num37, num35 + 1].active(false); + Main.tile[num37, num35 + 1].liquid = 255; + Main.tile[num37, num35 + 1].lava(false); + WorldGen.SquareTileFrame(num34, num35 + 1, true); + } + if (num37 > num34 - num36 && num37 < num34 + 2 && Main.tile[num37, num35 + 2].type == (ushort)mod.TileType("BrimstoneSlag")) + { + Main.tile[num37, num35 + 2].active(false); + Main.tile[num37, num35 + 2].liquid = 255; + Main.tile[num37, num35 + 2].lava(false); + WorldGen.SquareTileFrame(num34, num35 + 2, true); + } + } + } + if (WorldGen.genRand.Next(5) == 0) + { + Main.tile[num34, num35].liquid = 255; + } + Main.tile[num34, num35].lava(false); + WorldGen.SquareTileFrame(num34, num35, true); + } + } + } + #endregion + + #region UnderworldIslandHouse + public static void UnderworldIslandHouse(int i, int j, int item) + { + Mod mod = ModLoader.GetMod("CalamityMod"); + ushort type = (ushort)mod.TileType("BrimstoneSlag"); //tile + byte wall = (byte)14; //wall + Vector2 vector = new Vector2((float)i, (float)j); + int num = 1; + if (WorldGen.genRand.Next(2) == 0) + { + num = -1; + } + int num2 = WorldGen.genRand.Next(7, 12); + int num3 = WorldGen.genRand.Next(5, 7); + vector.X = (float)(i + (num2 + 2) * num); + for (int k = j - 15; k < j + 30; k++) + { + if (Main.tile[(int)vector.X, k].active()) + { + vector.Y = (float)(k - 1); + break; + } + } + vector.X = (float)i; + int num4 = (int)(vector.X - (float)num2 - 1f); + int num5 = (int)(vector.X + (float)num2 + 1f); + int num6 = (int)(vector.Y - (float)num3 - 1f); + int num7 = (int)(vector.Y + 2f); + if (num4 < 0) + { + num4 = 0; + } + if (num5 > Main.maxTilesX) + { + num5 = Main.maxTilesX; + } + if (num6 < 0) + { + num6 = 0; + } + if (num7 > Main.maxTilesY) + { + num7 = Main.maxTilesY; + } + for (int l = num4; l <= num5; l++) + { + for (int m = num6 - 1; m < num7 + 1; m++) + { + if (m != num6 - 1 || (l != num4 && l != num5)) + { + Main.tile[l, m].active(true); + Main.tile[l, m].liquid = 0; + Main.tile[l, m].type = type; + Main.tile[l, m].wall = 0; + Main.tile[l, m].halfBrick(false); + Main.tile[l, m].slope(0); + } + } + } + num4 = (int)(vector.X - (float)num2); + num5 = (int)(vector.X + (float)num2); + num6 = (int)(vector.Y - (float)num3); + num7 = (int)(vector.Y + 1f); + if (num4 < 0) + { + num4 = 0; + } + if (num5 > Main.maxTilesX) + { + num5 = Main.maxTilesX; + } + if (num6 < 0) + { + num6 = 0; + } + if (num7 > Main.maxTilesY) + { + num7 = Main.maxTilesY; + } + for (int n = num4; n <= num5; n++) + { + for (int num8 = num6; num8 < num7; num8++) + { + if ((num8 != num6 || (n != num4 && n != num5)) && Main.tile[n, num8].wall == 0) + { + Main.tile[n, num8].active(false); + Main.tile[n, num8].wall = wall; + } + } + } + int num9 = i + (num2 + 1) * num; + int num10 = (int)vector.Y; + for (int num11 = num9 - 2; num11 <= num9 + 2; num11++) + { + Main.tile[num11, num10].active(false); + Main.tile[num11, num10 - 1].active(false); + Main.tile[num11, num10 - 2].active(false); + } + WorldGen.PlaceTile(num9, num10, 10, true, false, -1, 19); //door + num9 = i + (num2 + 1) * -num - num; + for (int num12 = num6; num12 <= num7 + 1; num12++) + { + Main.tile[num9, num12].active(true); + Main.tile[num9, num12].liquid = 0; + Main.tile[num9, num12].type = type; + Main.tile[num9, num12].wall = 0; + Main.tile[num9, num12].halfBrick(false); + Main.tile[num9, num12].slope(0); + } + WorldGen.AddBuriedChest(i, num10 - 3, item, false, 4); //chest + int num22 = i + (num2 / 2 + 1) * -num; + WorldGen.PlaceTile(num22, num7 - 1, 14, true, false, -1, 13); //table + WorldGen.PlaceTile(num22 - 2, num7 - 1, 15, true, false, 0, 16); //chair + Tile expr_510 = Main.tile[num22 - 2, num7 - 1]; + expr_510.frameX += 18; + Tile expr_531 = Main.tile[num22 - 2, num7 - 2]; + expr_531.frameX += 18; + WorldGen.PlaceTile(num22 + 2, num7 - 1, 15, true, false, 0, 16); //chair + } + #endregion + + #region AbyssIsland + public static void AbyssIsland(int i, int j, int sizeMin, int sizeMax, int sizeMin2, int sizeMax2, bool hasChest, bool hasTenebris, bool isVoid) + { + Mod mod = ModLoader.GetMod("CalamityMod"); + int sizeMinSmall = sizeMin / 5; + int sizeMaxSmall = sizeMax / 5; + double num = (double)WorldGen.genRand.Next(sizeMin, sizeMax); //100 150 + float num2 = (float)WorldGen.genRand.Next(sizeMinSmall, sizeMaxSmall); //20 30 + int num3 = i; + int num4 = i; + int num5 = i; + int num6 = j; + Vector2 vector; + vector.X = (float)i; + vector.Y = (float)j; + Vector2 vector2; + vector2.X = (float)WorldGen.genRand.Next(-20, 21) * 0.2f; + while (vector2.X > -2f && vector2.X < 2f) + { + vector2.X = (float)WorldGen.genRand.Next(-20, 21) * 0.2f; + } + vector2.Y = (float)WorldGen.genRand.Next(-20, -10) * 0.02f; + while (num > 0.0 && num2 > 0f) + { + num -= (double)WorldGen.genRand.Next(4); + num2 -= 1f; + int num7 = (int)((double)vector.X - num * 0.5); + int num8 = (int)((double)vector.X + num * 0.5); + int num9 = (int)((double)vector.Y - num * 0.5); + int num10 = (int)((double)vector.Y + num * 0.5); + if (num7 < 0) + { + num7 = 0; + } + if (num8 > Main.maxTilesX) + { + num8 = Main.maxTilesX; + } + if (num9 < 0) + { + num9 = 0; + } + if (num10 > Main.maxTilesY) + { + num10 = Main.maxTilesY; + } + double num11 = num * (double)WorldGen.genRand.Next(sizeMin, sizeMax) * 0.01; //80 120 + float num12 = vector.Y + 1f; + for (int k = num7; k < num8; k++) + { + if (WorldGen.genRand.Next(2) == 0) + { + num12 += (float)WorldGen.genRand.Next(-1, 2); + } + if (num12 < vector.Y) + { + num12 = vector.Y; + } + if (num12 > vector.Y + 2f) + { + num12 = vector.Y + 2f; + } + for (int l = num9; l < num10; l++) + { + if ((float)l > num12) + { + float arg_218_0 = Math.Abs((float)k - vector.X); + float num13 = Math.Abs((float)l - vector.Y) * 3f; + if (Math.Sqrt((double)(arg_218_0 * arg_218_0 + num13 * num13)) < num11 * 0.4) + { + if (k < num3) + { + num3 = k; + } + if (k > num4) + { + num4 = k; + } + if (l < num5) + { + num5 = l; + } + if (l > num6) + { + num6 = l; + } + Main.tile[k, l].active(true); + Main.tile[k, l].type = (ushort)(isVoid ? mod.TileType("Voidstone") : mod.TileType("AbyssGravel")); + SafeSquareTileFrame(k, l, true); + } + } + } + } + vector += vector2; + vector2.X += (float)WorldGen.genRand.Next(-20, 21) * 0.05f; + if (vector2.X > 1f) + { + vector2.X = 1f; + } + if (vector2.X < -1f) + { + vector2.X = -1f; + } + if ((double)vector2.Y > 0.2) + { + vector2.Y = -0.2f; + } + if ((double)vector2.Y < -0.2) + { + vector2.Y = -0.2f; + } + } + int m = num3; + int num15; + for (m += WorldGen.genRand.Next(5); m < num4; m += WorldGen.genRand.Next(num15, (int)((double)num15 * 1.5))) + { + int num14 = num6; + while (!Main.tile[m, num14].active()) + { + num14--; + } + num14 += WorldGen.genRand.Next(-3, 4); + num15 = WorldGen.genRand.Next(4, 8); + int num16 = (isVoid ? mod.TileType("Voidstone") : mod.TileType("AbyssGravel")); + if (WorldGen.genRand.Next(4) == 0) + { + num16 = (hasChest ? mod.TileType("ChaoticOre") : mod.TileType("PlantyMush")); + } + for (int n = m - num15; n <= m + num15; n++) + { + for (int num17 = num14 - num15; num17 <= num14 + num15; num17++) + { + if (num17 > num5) + { + float arg_409_0 = (float)Math.Abs(n - m); + float num18 = (float)(Math.Abs(num17 - num14) * 2); + if (Math.Sqrt((double)(arg_409_0 * arg_409_0 + num18 * num18)) < (double)(num15 + WorldGen.genRand.Next(2))) + { + Main.tile[n, num17].active(true); + Main.tile[n, num17].type = (ushort)num16; + SafeSquareTileFrame(n, num17, true); + } + } + } + } + } + if (hasTenebris) + { + int p = num3; + int num150; + for (p += WorldGen.genRand.Next(5); p < num4; p += WorldGen.genRand.Next(num150, (int)((double)num150 * 1.5))) + { + int num14 = num6; + while (!Main.tile[p, num14].active()) + { + num14--; + } + num14 += WorldGen.genRand.Next(-3, 4); //-3 4 + num150 = 1; //4 8 + int num16 = mod.TileType("Tenebris"); + for (int n = p - num150; n <= p + num150; n++) + { + for (int num17 = num14 - num150; num17 <= num14 + num150; num17++) + { + if (num17 > num5) + { + float arg_409_0 = (float)Math.Abs(n - p); + float num18 = (float)(Math.Abs(num17 - num14) * 2); + if (Math.Sqrt((double)(arg_409_0 * arg_409_0 + num18 * num18)) < (double)(num150 + WorldGen.genRand.Next(2))) + { + Main.tile[n, num17].active(true); + Main.tile[n, num17].type = (ushort)num16; + SafeSquareTileFrame(n, num17, true); + } + } + } + } + } + } + int sizeMinSmall2 = sizeMin2 / 8; + int sizeMaxSmall2 = sizeMax2 / 8; + num = (double)WorldGen.genRand.Next(sizeMin2, sizeMax2); + num2 = (float)WorldGen.genRand.Next(sizeMinSmall2, sizeMaxSmall2); + vector.X = (float)i; + vector.Y = (float)num5; + vector2.X = (float)WorldGen.genRand.Next(-20, 21) * 0.2f; + while (vector2.X > -2f && vector2.X < 2f) + { + vector2.X = (float)WorldGen.genRand.Next(-20, 21) * 0.2f; + } + vector2.Y = (float)WorldGen.genRand.Next(-20, -10) * 0.02f; + while (num > 0.0 && num2 > 0f) + { + num -= (double)WorldGen.genRand.Next(4); + num2 -= 1f; + vector += vector2; + vector2.X += (float)WorldGen.genRand.Next(-20, 21) * 0.05f; + if (vector2.X > 1f) + { + vector2.X = 1f; + } + if (vector2.X < -1f) + { + vector2.X = -1f; + } + if ((double)vector2.Y > 0.2) + { + vector2.Y = -0.2f; + } + if ((double)vector2.Y < -0.2) + { + vector2.Y = -0.2f; + } + } + int num23 = num3; + num23 += WorldGen.genRand.Next(5); + while (num23 < num4) + { + int num24 = num6; + while ((!Main.tile[num23, num24].active() || Main.tile[num23, num24].type != 0) && num23 < num4) + { + num24--; + if (num24 < num5) + { + num24 = num6; + num23 += WorldGen.genRand.Next(1, 4); + } + } + if (num23 < num4) + { + num24 += WorldGen.genRand.Next(0, 4); + int num25 = WorldGen.genRand.Next(2, 5); + int num26 = (isVoid ? mod.TileType("Voidstone") : mod.TileType("AbyssGravel")); + for (int num27 = num23 - num25; num27 <= num23 + num25; num27++) + { + for (int num28 = num24 - num25; num28 <= num24 + num25; num28++) + { + if (num28 > num5) + { + float arg_890_0 = (float)Math.Abs(num27 - num23); + float num29 = (float)(Math.Abs(num28 - num24) * 2); + if (Math.Sqrt((double)(arg_890_0 * arg_890_0 + num29 * num29)) < (double)num25) + { + Main.tile[num27, num28].type = (ushort)num26; + SafeSquareTileFrame(num27, num28, true); + } + } + } + } + num23 += WorldGen.genRand.Next(num25, (int)((double)num25 * 1.5)); + } + } + for (int num30 = num3 - 20; num30 <= num4 + 20; num30++) + { + for (int num31 = num5 - 20; num31 <= num6 + 20; num31++) + { + bool flag = true; + for (int num32 = num30 - 1; num32 <= num30 + 1; num32++) + { + for (int num33 = num31 - 1; num33 <= num31 + 1; num33++) + { + if (!Main.tile[num32, num33].active()) + { + flag = false; + } + } + } + if (flag) + { + Main.tile[num30, num31].wall = (ushort)(isVoid ? mod.WallType("VoidstoneWallUnsafe") : mod.WallType("AbyssGravelWall")); + WorldGen.SquareWallFrame(num30, num31, true); + } + } + } + for (int num34 = num3; num34 <= num4; num34++) + { + int num35 = num5 - 10; + while (!Main.tile[num34, num35 + 1].active()) + { + num35++; + } + if (num35 < num6 && Main.tile[num34, num35 + 1].type == (ushort)(isVoid ? mod.TileType("Voidstone") : mod.TileType("AbyssGravel"))) + { + if (WorldGen.genRand.Next(10) == 0) + { + int num36 = WorldGen.genRand.Next(1, 3); + for (int num37 = num34 - num36; num37 <= num34 + num36; num37++) + { + if (Main.tile[num37, num35].type == (ushort)(isVoid ? mod.TileType("Voidstone") : mod.TileType("AbyssGravel"))) + { + Main.tile[num37, num35].active(false); + Main.tile[num37, num35].liquid = 255; + Main.tile[num37, num35].lava(false); + SafeSquareTileFrame(num34, num35, true); + } + if (Main.tile[num37, num35 + 1].type == (ushort)(isVoid ? mod.TileType("Voidstone") : mod.TileType("AbyssGravel"))) + { + Main.tile[num37, num35 + 1].active(false); + Main.tile[num37, num35 + 1].liquid = 255; + Main.tile[num37, num35 + 1].lava(false); + SafeSquareTileFrame(num34, num35 + 1, true); + } + if (num37 > num34 - num36 && num37 < num34 + 2 && Main.tile[num37, num35 + 2].type == (ushort)(isVoid ? mod.TileType("Voidstone") : mod.TileType("AbyssGravel"))) + { + Main.tile[num37, num35 + 2].active(false); + Main.tile[num37, num35 + 2].liquid = 255; + Main.tile[num37, num35 + 2].lava(false); + SafeSquareTileFrame(num34, num35 + 2, true); + } + } + } + if (WorldGen.genRand.Next(5) == 0) + { + Main.tile[num34, num35].liquid = 255; + } + Main.tile[num34, num35].lava(false); + SafeSquareTileFrame(num34, num35, true); + } + } + } + #endregion + + #region AbyssIslandHouse + public static void AbyssIslandHouse(int i, int j, int itemChoice, bool isVoid) + { + Mod mod = ModLoader.GetMod("CalamityMod"); + ushort type = (ushort)(isVoid ? mod.TileType("Voidstone") : mod.TileType("AbyssGravel")); //tile + ushort wall = (ushort)(isVoid ? mod.WallType("VoidstoneWallUnsafe") : mod.WallType("AbyssGravelWall")); //wall + Vector2 vector = new Vector2((float)i, (float)j); + int num = 1; + if (WorldGen.genRand.Next(2) == 0) + { + num = -1; + } + int num2 = WorldGen.genRand.Next(5, 9); + int num3 = 3; + vector.X = (float)(i + (num2 + 2) * num); + for (int k = j - 15; k < j + 30; k++) + { + if (Main.tile[(int)vector.X, k].active()) + { + vector.Y = (float)(k - 1); + break; + } + } + vector.X = (float)i; + int num4 = (int)(vector.X - (float)num2 - 1f); + int num5 = (int)(vector.X + (float)num2 + 1f); + int num6 = (int)(vector.Y - (float)num3 - 1f); + int num7 = (int)(vector.Y + 2f); + if (num4 < 0) + { + num4 = 0; + } + if (num5 > Main.maxTilesX) + { + num5 = Main.maxTilesX; + } + if (num6 < 0) + { + num6 = 0; + } + if (num7 > Main.maxTilesY) + { + num7 = Main.maxTilesY; + } + for (int l = num4; l <= num5; l++) + { + for (int m = num6 - 1; m < num7 + 1; m++) + { + if (m != num6 - 1 || (l != num4 && l != num5)) + { + Main.tile[l, m].active(true); + Main.tile[l, m].type = type; + Main.tile[l, m].wall = wall; + Main.tile[l, m].halfBrick(false); + Main.tile[l, m].slope(0); + } + } + } + num4 = (int)(vector.X - (float)num2); + num5 = (int)(vector.X + (float)num2); + num6 = (int)(vector.Y - (float)num3); + num7 = (int)(vector.Y + 1f); + if (num4 < 0) + { + num4 = 0; + } + if (num5 > Main.maxTilesX) + { + num5 = Main.maxTilesX; + } + if (num6 < 0) + { + num6 = 0; + } + if (num7 > Main.maxTilesY) + { + num7 = Main.maxTilesY; + } + for (int n = num4; n <= num5; n++) + { + for (int num8 = num6; num8 < num7; num8++) + { + if ((num8 != num6 || (n != num4 && n != num5)) && Main.tile[n, num8].wall == wall) + { + Main.tile[n, num8].active(false); + } + } + } + int num9 = i + (num2 + 1) * num; + int num10 = (int)vector.Y; + for (int num11 = num9 - 2; num11 <= num9 + 2; num11++) + { + Main.tile[num11, num10].active(false); + Main.tile[num11, num10 - 1].active(false); + Main.tile[num11, num10 - 2].active(false); + } + switch (itemChoice) + { + case 0: itemChoice = mod.ItemType("TorrentialTear"); break; //rain item + case 1: itemChoice = mod.ItemType("IronBoots"); break; //movement acc + case 2: itemChoice = mod.ItemType("DepthCharm"); break; //regen acc + case 3: itemChoice = mod.ItemType("Archerfish"); break; //ranged + case 4: itemChoice = mod.ItemType("AnechoicPlating"); break; //defense acc + case 5: itemChoice = mod.ItemType("BallOFugu"); break; //melee + case 6: itemChoice = mod.ItemType("StrangeOrb"); break; //light pet + case 7: itemChoice = mod.ItemType("HerringStaff"); break; //summon + case 8: itemChoice = mod.ItemType("BlackAnurian"); break; //magic + case 9: itemChoice = mod.ItemType("Lionfish"); break; //throwing + default: itemChoice = 497; break; + } + WorldGen.AddBuriedChest(i, num10 - 3, itemChoice, false, 4); //chest + } + #endregion + + #region IcePyramid + public static bool IcePyramid(int i, int j) + { + ushort num = 161; + int arg_36_0 = j - WorldGen.genRand.Next(0, 7); + int num2 = WorldGen.genRand.Next(9, 13); + int num3 = 1; + int num4 = j + WorldGen.genRand.Next(75, 125); //75 125 + for (int k = arg_36_0; k < num4; k++) + { + for (int l = i - num3; l < i + num3 - 1; l++) + { + Main.tile[l, k].type = num; + Main.tile[l, k].active(true); + Main.tile[l, k].halfBrick(false); + Main.tile[l, k].slope(0); + } + num3++; + } + for (int m = i - num3 - 5; m <= i + num3 + 5; m++) + { + for (int n = j - 1; n <= num4 + 1; n++) + { + bool flag = true; + for (int num5 = m - 1; num5 <= m + 1; num5++) + { + for (int num6 = n - 1; num6 <= n + 1; num6++) + { + if (Main.tile[num5, num6].type != num) + { + flag = false; + } + } + } + if (flag) + { + Main.tile[m, n].wall = 71; + WorldGen.SquareWallFrame(m, n, true); + } + } + } + int num7 = 1; + if (WorldGen.genRand.Next(2) == 0) + { + num7 = -1; + } + int num8 = i - num2 * num7; + int num9 = j + num2; + int num10 = WorldGen.genRand.Next(5, 8); + bool flag2 = true; + int num11 = WorldGen.genRand.Next(20, 30); + while (flag2) + { + flag2 = false; + bool flag3 = false; + for (int num12 = num9; num12 <= num9 + num10; num12++) + { + int num13 = num8; + if (Main.tile[num13, num12 - 1].type == 161) + { + flag3 = true; + } + if (Main.tile[num13, num12].type == num) + { + Main.tile[num13, num12 + 1].wall = 71; + Main.tile[num13 + num7, num12].wall = 71; + Main.tile[num13, num12].active(false); + flag2 = true; + } + if (flag3) + { + Main.tile[num13, num12].type = 161; + Main.tile[num13, num12].active(true); + Main.tile[num13, num12].halfBrick(false); + Main.tile[num13, num12].slope(0); + } + } + num8 -= num7; + } + num8 = i - num2 * num7; + bool flag4 = true; + bool flag5 = false; + flag2 = true; + while (flag2) + { + for (int num14 = num9; num14 <= num9 + num10; num14++) + { + int num15 = num8; + Main.tile[num15, num14].active(false); + } + num8 += num7; + num9++; + num11--; + if (num9 >= num4 - num10 * 2) + { + num11 = 10; + } + if (num11 <= 0) + { + bool flag6 = false; + if (!flag4 && !flag5) + { + flag5 = true; + flag6 = true; + int num16 = WorldGen.genRand.Next(7, 13); + int num17 = WorldGen.genRand.Next(23, 28); + int num18 = num17; + int num19 = num8; + while (num17 > 0) + { + for (int num20 = num9 - num16 + num10; num20 <= num9 + num10; num20++) + { + if (num17 == num18 || num17 == 1) + { + if (num20 >= num9 - num16 + num10 + 2) + { + Main.tile[num8, num20].active(false); + } + } + else if (num17 == num18 - 1 || num17 == 2 || num17 == num18 - 2 || num17 == 3) + { + if (num20 >= num9 - num16 + num10 + 1) + { + Main.tile[num8, num20].active(false); + } + } + else + { + Main.tile[num8, num20].active(false); + } + } + num17--; + num8 += num7; + } + int num21 = num8 - num7; + int num22 = num21; + int num23 = num19; + if (num21 > num19) + { + num22 = num19; + num23 = num21; + } + int num24 = WorldGen.genRand.Next(3); + if (num24 == 0) + { + num24 = 1861; //diving gear + } + else if (num24 == 1) + { + num24 = 1163; //balloon + } + else if (num24 == 2) + { + num24 = 1253; //shell + } + WorldGen.AddBuriedChest((num22 + num23) / 2, num9, num24, false, 22); + int num25 = WorldGen.genRand.Next(1, 10); + for (int num26 = 0; num26 < num25; num26++) + { + int arg_49B_0 = WorldGen.genRand.Next(num22, num23); + int j2 = num9 + num10; + WorldGen.PlaceSmallPile(arg_49B_0, j2, WorldGen.genRand.Next(16, 19), 1, 185); + } + for (int num27 = num22; num27 <= num23; num27++) + { + WorldGen.PlacePot(num27, num9 + num10, 28, WorldGen.genRand.Next(4, 7)); + } + } + if (flag4) + { + flag4 = false; + num7 *= -1; + num11 = WorldGen.genRand.Next(15, 20); + } + else if (flag6) + { + num11 = WorldGen.genRand.Next(10, 15); + } + else + { + num7 *= -1; + num11 = WorldGen.genRand.Next(20, 40); + } + } + if (num9 >= num4 - num10) + { + flag2 = false; + } + } + int num28 = WorldGen.genRand.Next(20, 40); //100 200 + int num29 = WorldGen.genRand.Next(100, 160); //500 800 + flag2 = true; + int num30 = num10; + num11 = WorldGen.genRand.Next(10, 50); + if (num7 == 1) + { + num8 -= num30; + } + int num31 = WorldGen.genRand.Next(5, 10); + while (flag2) + { + num28--; + num29--; + num11--; + for (int num32 = num8 - num31 - WorldGen.genRand.Next(0, 2); num32 <= num8 + num30 + num31 + WorldGen.genRand.Next(0, 2); num32++) + { + int num33 = num9; + if (num32 >= num8 && num32 <= num8 + num30) + { + Main.tile[num32, num33].active(false); + } + else + { + Main.tile[num32, num33].type = num; + Main.tile[num32, num33].active(true); + Main.tile[num32, num33].halfBrick(false); + Main.tile[num32, num33].slope(0); + } + if (num32 >= num8 - 1 && num32 <= num8 + 1 + num30) + { + Main.tile[num32, num33].wall = 71; + } + } + num9++; + num8 += num7; + if (num28 <= 0) + { + flag2 = false; + for (int num34 = num8 + 1; num34 <= num8 + num30 - 1; num34++) + { + if (Main.tile[num34, num9].active()) + { + flag2 = true; + } + } + } + if (num11 < 0) + { + num11 = WorldGen.genRand.Next(10, 50); + num7 *= -1; + } + if (num29 <= 0) + { + flag2 = false; + } + } + return true; + } + #endregion + + #region SpecialHut + public static void SpecialHut(ushort tile, ushort tile2, ushort wall, int hutType, int chestX, int chestY) + { + int m = WorldGen.genRand.Next(2, 4); + int num6 = WorldGen.genRand.Next(2, 4); + for (int n = chestX - m - 1; n <= chestX + m + 1; n++) + { + for (int num8 = chestY - num6 - 1; num8 <= chestY + num6 + 1; num8++) + { + Main.tile[n, num8].active(true); + Main.tile[n, num8].type = tile; + Main.tile[n, num8].liquid = 0; + Main.tile[n, num8].lava(false); + } + } + for (int num9 = chestX - m; num9 <= chestX + m; num9++) + { + for (int num10 = chestY - num6; num10 <= chestY + num6; num10++) + { + Main.tile[num9, num10].active(false); + Main.tile[num9, num10].wall = wall; + } + } + for (int num14 = chestX - m - 1; num14 <= chestX + m + 1; num14++) + { + for (int num15 = chestY + num6 - 2; num15 <= chestY + num6; num15++) + { + Main.tile[num14, num15].active(false); + } + } + for (int num16 = chestX - m - 1; num16 <= chestX + m + 1; num16++) + { + for (int num17 = chestY + num6 - 2; num17 <= chestY + num6 - 1; num17++) + { + Main.tile[num16, num17].active(false); + } + } + for (int num18 = chestX - m - 1; num18 <= chestX + m + 1; num18++) + { + int num19 = 4; + int num20 = chestY + num6 + 2; + while (!Main.tile[num18, num20].active() && num20 < Main.maxTilesY && num19 > 0) + { + Main.tile[num18, num20].active(true); + Main.tile[num18, num20].type = tile2; + num20++; + num19--; + } + } + m -= WorldGen.genRand.Next(1, 3); + int num21 = chestY - num6 - 2; + while (m > -1) + { + for (int num22 = chestX - m - 1; num22 <= chestX + m + 1; num22++) + { + Main.tile[num22, num21].active(true); + Main.tile[num22, num21].type = tile; + } + m -= WorldGen.genRand.Next(1, 3); + num21--; + } + CalamityWorld.SChestX[hutType] = chestX; + CalamityWorld.SChestY[hutType] = chestY; + SpecialChest(hutType); + } + #endregion + + #region SpecialChest + public static void SpecialChest(int itemChoice) + { + Mod mod = ModLoader.GetMod("CalamityMod"); + int item = 0; + int chestType = 0; + switch (itemChoice) //0 to 9 + { + case 0: item = ItemID.TigerClimbingGear; break; + case 1: item = (WorldGen.crimson ? ItemID.FleshKnuckles : ItemID.PutridScent); chestType = (WorldGen.crimson ? 43 : 3); break; + case 2: item = ItemID.LavaWaders; chestType = 44; break; + case 3: item = ItemID.MagicCuffs; chestType = 47; break; + case 4: item = ItemID.SunStone; chestType = 30; break; + case 5: item = ItemID.PapyrusScarab; chestType = 32; break; + case 6: item = ItemID.StarCloak; chestType = 50; break; + case 7: item = ItemID.CrossNecklace; chestType = 51; break; + case 8: item = mod.ItemType("Murasama"); chestType = 44; break; + case 9: item = mod.ItemType("BossRush"); chestType = 4; break; + } + for (int j = CalamityWorld.SChestX[itemChoice] - 1; j <= CalamityWorld.SChestX[itemChoice] + 1; j++) + { + for (int k = CalamityWorld.SChestY[itemChoice]; k <= CalamityWorld.SChestY[itemChoice] + 2; k++) + { + WorldGen.KillTile(j, k, false, false, false); + } + } + for (int l = CalamityWorld.SChestX[itemChoice] - 1; l <= CalamityWorld.SChestX[itemChoice] + 1; l++) + { + for (int m = CalamityWorld.SChestY[itemChoice]; m <= CalamityWorld.SChestY[itemChoice] + 3; m++) + { + if (m < Main.maxTilesY) + { + Main.tile[l, m].slope(0); + Main.tile[l, m].halfBrick(false); + } + } + } + WorldGen.AddBuriedChest(CalamityWorld.SChestX[itemChoice], CalamityWorld.SChestY[itemChoice], item, false, chestType); + } + #endregion + + #region ChasmGenerator + public static void ChasmGenerator(int i, int j, int steps, bool ocean = false) + { + Mod mod = ModLoader.GetMod("CalamityMod"); + float num = (float)steps; //850 small 1450 medium 2050 large + if (ocean) + { + int tileYLookup = j; + if (abyssSide) + { + while (!Main.tile[i + 125, tileYLookup].active()) + { + tileYLookup++; + } + } + else + { + while (!Main.tile[i - 125, tileYLookup].active()) + { + tileYLookup++; + } + } + j = tileYLookup; + } + Vector2 vector; + vector.X = (float)i; + vector.Y = (float)j; + Vector2 vector2; + vector2.X = (float)WorldGen.genRand.Next(-1, 2) * 0.1f; + vector2.Y = (float)WorldGen.genRand.Next(3, 8) * 0.2f + 0.5f; + int num2 = 5; + double num3 = (double)(WorldGen.genRand.Next(5, 7) + 40); //start width + while (num3 > 0.0) + { + if (num > 0f) + { + num3 += (double)WorldGen.genRand.Next(2); + num3 -= (double)WorldGen.genRand.Next(2); + float smallHoleLimit = 790f; //small + if (Main.maxTilesY > 1500) { smallHoleLimit = 1360f; if (Main.maxTilesY > 2100) { smallHoleLimit = 1950f; } } + if (ocean && num > smallHoleLimit) + { + if (num3 < 4.0) //min width + { + num3 = 4.0; //min width + } + if (num3 > 6.0) //max width + { + num3 = 6.0; //max width + } + } + else //dig large hole + { + if (num3 < (ocean ? 42.0 : 14.0)) //min width + { + num3 = (ocean ? 42.0 : 14.0); //min width + } + if (num3 > (ocean ? 60.0 : 40.0)) //max width + { + num3 = (ocean ? 60.0 : 40.0); //max width + } + if (num == 1f && num3 < (ocean ? 50.0 : 20.0)) + { + num3 = (ocean ? 50.0 : 20.0); + } + } + } + else + { + if ((double)vector.Y > abyssChasmBottom) + { + num3 -= (double)(WorldGen.genRand.Next(5) + 8); + } + } + if (Main.maxTilesY > 2100) + { + if (((double)vector.Y > abyssChasmBottom && num > 0f && ocean) || + ((double)vector.Y >= (double)Main.maxTilesY && num > 0f && !ocean)) + { + num = 0f; + } + } + else if (Main.maxTilesY > 1500) + { + if (((double)vector.Y > abyssChasmBottom && num > 0f && ocean) || + ((double)vector.Y > (double)Main.maxTilesY && num > 0f && !ocean)) + { + num = 0f; + } + } + else + { + if (((double)vector.Y > abyssChasmBottom && num > 0f && ocean) || + ((double)vector.Y > (double)Main.maxTilesY && num > 0f && !ocean)) + { + num = 0f; + } + } + num -= 1f; + int num4; + int num5; + int num6; + int num7; + if (num > (float)num2) + { + num4 = (int)((double)vector.X - num3 * 0.5); + num5 = (int)((double)vector.X + num3 * 0.5); + num6 = (int)((double)vector.Y - num3 * 0.5); + num7 = (int)((double)vector.Y + num3 * 0.5); + if (num4 < 0) + { + num4 = 0; + } + if (num5 > Main.maxTilesX - 1) + { + num5 = Main.maxTilesX - 1; + } + if (num6 < 0) + { + num6 = 0; + } + if (num7 > Main.maxTilesY) + { + num7 = Main.maxTilesY; + } + for (int k = num4; k < num5; k++) + { + for (int l = num6; l < num7; l++) + { + if ((double)(Math.Abs((float)k - vector.X) + Math.Abs((float)l - vector.Y)) < num3 * 0.5 * (1.0 + (double)WorldGen.genRand.Next(-5, 6) * 0.015)) + { + if (ocean) + { + Main.tile[k, l].active(false); + Main.tile[k, l].liquid = 255; + Main.tile[k, l].lava(false); + } + else + { + Main.tile[k, l].active(false); + Main.tile[k, l].liquid = 255; + Main.tile[k, l].lava(true); + } + } + } + } + } + if (num <= 2f && (double)vector.Y < (Main.rockLayer + (double)Main.maxTilesY * 0.3)) + { + num = 2f; + } + vector += vector2; + vector2.X += (float)WorldGen.genRand.Next(-1, 2) * 0.01f; + if ((double)vector2.X > 0.02) + { + vector2.X = 0.02f; + } + if ((double)vector2.X < -0.02) + { + vector2.X = -0.02f; + } + num4 = (int)((double)vector.X - num3 * 1.1); + num5 = (int)((double)vector.X + num3 * 1.1); + num6 = (int)((double)vector.Y - num3 * 1.1); + num7 = (int)((double)vector.Y + num3 * 1.1); + if (num4 < 1) + { + num4 = 1; + } + if (num5 > Main.maxTilesX - 1) + { + num5 = Main.maxTilesX - 1; + } + if (num6 < 0) + { + num6 = 0; + } + if (num7 > Main.maxTilesY) + { + num7 = Main.maxTilesY; + } + for (int m = num4; m < num5; m++) + { + for (int n = num6; n < num7; n++) + { + if ((double)(Math.Abs((float)m - vector.X) + Math.Abs((float)n - vector.Y)) < num3 * 1.1 * (1.0 + (double)WorldGen.genRand.Next(-5, 6) * 0.015)) + { + if (n > j + WorldGen.genRand.Next(7, 16)) + { + Main.tile[m, n].active(false); + } + if (steps <= num2) + { + Main.tile[m, n].active(false); + } + if (ocean) + { + Main.tile[m, n].liquid = 255; + Main.tile[m, n].lava(false); + } + else + { + Main.tile[m, n].liquid = 255; + Main.tile[m, n].lava(true); + } + } + } + } + for (int num11 = num4; num11 < num5; num11++) + { + for (int num12 = num6; num12 < num7; num12++) + { + if ((double)(Math.Abs((float)num11 - vector.X) + Math.Abs((float)num12 - vector.Y)) < num3 * 1.1 * (1.0 + (double)WorldGen.genRand.Next(-5, 6) * 0.015)) + { + if (ocean) + { + Main.tile[num11, num12].liquid = 255; + Main.tile[num11, num12].lava(false); + } + else + { + Main.tile[num11, num12].liquid = 255; + Main.tile[num11, num12].lava(true); + } + if (steps <= num2) + { + Main.tile[num11, num12].active(false); + } + } + } + } + } + } + #endregion + + #region PlaceTits + public static void PlaceTit(int x, int y, ushort type = 165) + { + Mod mod = ModLoader.GetMod("CalamityMod"); + if (Main.tile[x, y - 1] == null) + { + Main.tile[x, y - 1] = new Tile(); + } + if (Main.tile[x, y] == null) + { + Main.tile[x, y] = new Tile(); + } + if (Main.tile[x, y + 1] == null) + { + Main.tile[x, y + 1] = new Tile(); + } + if (WorldGen.SolidTile(x, y - 1) && !Main.tile[x, y].active() && !Main.tile[x, y + 1].active()) + { + if (Main.tile[x, y - 1].type == (ushort)mod.TileType("Navystone")) + { + if (WorldGen.genRand.Next(2) == 0 || Main.tile[x, y + 2].active()) + { + int num2 = WorldGen.genRand.Next(3) * 18; + Main.tile[x, y].type = type; + Main.tile[x, y].active(true); + Main.tile[x, y].frameX = (short)num2; + Main.tile[x, y].frameY = 72; + } + else + { + int num3 = WorldGen.genRand.Next(3) * 18; + Main.tile[x, y].type = type; + Main.tile[x, y].active(true); + Main.tile[x, y].frameX = (short)num3; + Main.tile[x, y].frameY = 0; + Main.tile[x, y + 1].type = type; + Main.tile[x, y + 1].active(true); + Main.tile[x, y + 1].frameX = (short)num3; + Main.tile[x, y + 1].frameY = 18; + } + } + } + else + { + if (WorldGen.SolidTile(x, y + 1) && !Main.tile[x, y].active() && !Main.tile[x, y - 1].active()) + { + if (Main.tile[x, y + 1].type == (ushort)mod.TileType("Navystone")) + { + if (WorldGen.genRand.Next(2) == 0 || Main.tile[x, y - 2].active()) + { + int num13 = WorldGen.genRand.Next(3) * 18; + Main.tile[x, y].type = type; + Main.tile[x, y].active(true); + Main.tile[x, y].frameX = (short)num13; + Main.tile[x, y].frameY = 90; + } + else + { + int num14 = WorldGen.genRand.Next(3) * 18; + Main.tile[x, y - 1].type = type; + Main.tile[x, y - 1].active(true); + Main.tile[x, y - 1].frameX = (short)num14; + Main.tile[x, y - 1].frameY = 36; + Main.tile[x, y].type = type; + Main.tile[x, y].active(true); + Main.tile[x, y].frameX = (short)num14; + Main.tile[x, y].frameY = 54; + } + } + } + } + } + #endregion + + #region Planetoids + private static void Planetoids(GenerationProgress progress) + { + progress.Message = "Generating Planetoids..."; + + int GrassPlanetoidCount = Main.maxTilesX / 1100; + int LCPlanetoidCount = Main.maxTilesX / 800; + int MudPlanetoidCount = Main.maxTilesX / 1100; + + while (true) + { + if (Biomes.Place(new Point(WorldGen.genRand.Next(Main.maxTilesX / 2 - 300, Main.maxTilesX / 2 + 300), WorldGen.genRand.Next(128, 134)), WorldGen.structures)) + { + break; + } + } + while (LCPlanetoidCount > 0) + { + int x = WorldGen.genRand.Next((int)(Main.maxTilesX * 0.2), (int)(Main.maxTilesX * 0.8)); + int y = WorldGen.genRand.Next(70, 101); + + bool placed = Biomes.Place(x, y, WorldGen.structures); + + if (placed) + LCPlanetoidCount--; + } + while (GrassPlanetoidCount > 0) + { + int x = WorldGen.genRand.Next((int)(Main.maxTilesX * 0.333), (int)(Main.maxTilesX * 0.666)); + int y = WorldGen.genRand.Next(100, 131); + + + bool placed = Biomes.Place(x, y, WorldGen.structures); + + if (placed) + GrassPlanetoidCount--; + } + while (MudPlanetoidCount > 0) + { + int x = WorldGen.genRand.Next((int)(Main.maxTilesX * 0.3f), (int)(Main.maxTilesX * 0.7f)); + int y = WorldGen.genRand.Next(100, 131); + + bool placed = Biomes.Place(x, y, WorldGen.structures); + + if (placed) + MudPlanetoidCount--; + } + } + #endregion + + #region PostUpdate + public override void PostUpdate() + { + SunkenSeaLocation = new Rectangle(WorldGen.UndergroundDesertLocation.Left, WorldGen.UndergroundDesertLocation.Bottom, + WorldGen.UndergroundDesertLocation.Width, WorldGen.UndergroundDesertLocation.Height / 2); + int closestPlayer = (int)Player.FindClosest(new Vector2((float)(Main.maxTilesX / 2), (float)Main.worldSurface / 2f) * 16f, 0, 0); + #region BossRush + if (!deactivateStupidFuckingBullshit) + { + deactivateStupidFuckingBullshit = true; + bossRushActive = false; + if (Main.netMode == 2) + { + NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + } + } + if (bossRushActive) + { + if (NPC.MoonLordCountdown > 0) + { + NPC.MoonLordCountdown = 0; + } + if (!CalamityPlayer.areThereAnyDamnBosses) + { + if (bossRushSpawnCountdown > 0) + { + bossRushSpawnCountdown--; + if (bossRushSpawnCountdown == 180 && bossRushStage == 26) + { + string key = "Mods.CalamityMod.BossRushTierThreeEndText2"; + Color messageColor = Color.LightCoral; + if (Main.netMode == 0) + { + Main.NewText(Language.GetTextValue(key), messageColor); + } + else if (Main.netMode == 2) + { + NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); + } + } + if (bossRushSpawnCountdown == 210 && bossRushStage == 33) + { + string key = "Mods.CalamityMod.BossRushTierFourEndText2"; + Color messageColor = Color.LightCoral; + if (Main.netMode == 0) + { + Main.NewText(Language.GetTextValue(key), messageColor); + } + else if (Main.netMode == 2) + { + NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); + } + } + } + if (bossRushSpawnCountdown <= 0) + { + bossRushSpawnCountdown = 60; + if (bossRushStage > 25) + { + bossRushSpawnCountdown += 120; //3 seconds + } + if (bossRushStage > 32) + { + bossRushSpawnCountdown += 180; //6 seconds + } + switch (bossRushStage) + { + case 9: + bossRushSpawnCountdown = 240; + break; + case 18: + bossRushSpawnCountdown = 300; + break; + case 25: + bossRushSpawnCountdown = 360; + break; + case 32: + bossRushSpawnCountdown = 420; + break; + default: + break; + } + if (bossRushStage == 13) + { + for (int playerIndex = 0; playerIndex < 255; playerIndex++) + { + if (Main.player[playerIndex].active) + { + Player player = Main.player[playerIndex]; + player.Spawn(); + } + } + } + else if (bossRushStage == 36) + { + for (int playerIndex = 0; playerIndex < 255; playerIndex++) + { + if (Main.player[playerIndex].active) + { + Player player = Main.player[playerIndex]; + if (player.FindBuffIndex(mod.BuffType("ExtremeGravity")) > -1) + { + player.ClearBuff(mod.BuffType("ExtremeGravity")); + } + } + } + } + if (Main.netMode != 1) + { + Main.PlaySound(SoundID.Roar, Main.player[closestPlayer].position, 0); + switch (bossRushStage) + { + case 0: + NPC.SpawnOnPlayer(closestPlayer, NPCID.QueenBee); + break; + case 1: + NPC.SpawnOnPlayer(closestPlayer, NPCID.BrainofCthulhu); + break; + case 2: + NPC.SpawnOnPlayer(closestPlayer, NPCID.KingSlime); + break; + case 3: + ChangeTime(false); + NPC.SpawnOnPlayer(closestPlayer, NPCID.EyeofCthulhu); + break; + case 4: + ChangeTime(false); + NPC.SpawnOnPlayer(closestPlayer, NPCID.SkeletronPrime); + break; + case 5: + NPC.NewNPC((int)(Main.player[closestPlayer].position.X + (float)(Main.rand.Next(-100, 101))), + (int)(Main.player[closestPlayer].position.Y - 400f), + NPCID.Golem, 0, 0f, 0f, 0f, 0f, 255); + break; + case 6: + ChangeTime(true); + NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("ProfanedGuardianBoss")); + NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("ProfanedGuardianBoss2")); + NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("ProfanedGuardianBoss3")); + break; + case 7: + NPC.SpawnOnPlayer(closestPlayer, NPCID.EaterofWorldsHead); + break; + case 8: + ChangeTime(false); + NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("Astrageldon")); + break; + case 9: + ChangeTime(false); + NPC.SpawnOnPlayer(closestPlayer, NPCID.TheDestroyer); + break; + case 10: + ChangeTime(false); + NPC.SpawnOnPlayer(closestPlayer, NPCID.Spazmatism); + NPC.SpawnOnPlayer(closestPlayer, NPCID.Retinazer); + break; + case 11: + NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("Bumblefuck")); + break; + case 12: + NPC.SpawnWOF(Main.player[closestPlayer].position); + break; + case 13: + NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("HiveMind")); + break; + case 14: + ChangeTime(false); + NPC.SpawnOnPlayer(closestPlayer, NPCID.SkeletronHead); + break; + case 15: + NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("StormWeaverHead")); + break; + case 16: + NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("AquaticScourgeHead")); + break; + case 17: + NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("DesertScourgeHead")); + NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("DesertScourgeHeadSmall")); + NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("DesertScourgeHeadSmall")); + break; + case 18: + int num1302 = NPC.NewNPC((int)Main.player[closestPlayer].Center.X, (int)Main.player[closestPlayer].Center.Y - 400, NPCID.CultistBoss, 0, 0f, 0f, 0f, 0f, 255); + Main.npc[num1302].direction = (Main.npc[num1302].spriteDirection = Math.Sign(Main.player[closestPlayer].Center.X - (float)Main.player[closestPlayer].Center.X - 90f)); + break; + case 19: + for (int doom = 0; doom < 200; doom++) + { + if (Main.npc[doom].active && (Main.npc[doom].type == 493 || Main.npc[doom].type == 422 || Main.npc[doom].type == 507 || + Main.npc[doom].type == 517)) + { + Main.npc[doom].active = false; + Main.npc[doom].netUpdate = true; + } + } + NPC.NewNPC((int)(Main.player[closestPlayer].position.X + (float)(Main.rand.Next(-100, 101))), (int)(Main.player[closestPlayer].position.Y - 400f), mod.NPCType("CrabulonIdle"), 0, 0f, 0f, 0f, 0f, 255); + break; + case 20: + NPC.SpawnOnPlayer(closestPlayer, NPCID.Plantera); + break; + case 21: + NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("CeaselessVoid")); + break; + case 22: + NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("PerforatorHive")); + break; + case 23: + NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("Cryogen")); + break; + case 24: + NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("BrimstoneElemental")); + break; + case 25: + NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("CosmicWraith")); + break; + case 26: + NPC.NewNPC((int)(Main.player[closestPlayer].position.X + (float)(Main.rand.Next(-100, 101))), (int)(Main.player[closestPlayer].position.Y - 400f), mod.NPCType("ScavengerBody"), 0, 0f, 0f, 0f, 0f, 255); + break; + case 27: + NPC.NewNPC((int)(Main.player[closestPlayer].position.X + (float)(Main.rand.Next(-100, 101))), (int)(Main.player[closestPlayer].position.Y - 400f), NPCID.DukeFishron, 0, 0f, 0f, 0f, 0f, 255); + break; + case 28: + NPC.SpawnOnPlayer(closestPlayer, NPCID.MoonLordCore); + break; + case 29: + ChangeTime(false); + for (int x = 0; x < 10; x++) + { + NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("AstrumDeusHead")); + } + NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("AstrumDeusHeadSpectral")); + break; + case 30: + NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("Polterghast")); + break; + case 31: + NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("PlaguebringerGoliath")); + break; + case 32: + ChangeTime(false); + NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("Calamitas")); + break; + case 33: + NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("Siren")); + break; + case 34: + NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("SlimeGod")); + NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("SlimeGodRun")); + NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("SlimeGodCore")); + break; + case 35: + ChangeTime(true); + NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("Providence")); + break; + case 36: + NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("SupremeCalamitas")); + break; + case 37: + NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("Yharon")); + break; + case 38: + NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("DevourerofGodsHeadS")); + break; + } + } + } + } + } + else + { + bossRushSpawnCountdown = 180; + if (bossRushStage != 0) + { + bossRushStage = 0; + if (Main.netMode == 2) + { + var netMessage = mod.GetPacket(); + netMessage.Write((byte)CalamityModMessageType.BossRushStage); + netMessage.Write(bossRushStage); + netMessage.Send(); + } + } + } + #endregion + #region SpawnDoG + if (DoGSecondStageCountdown > 0) //works + { + DoGSecondStageCountdown--; + if (Main.netMode == 2) + { + var netMessage = mod.GetPacket(); + netMessage.Write((byte)CalamityModMessageType.DoGCountdownSync); + netMessage.Write(DoGSecondStageCountdown); + netMessage.Send(); + } + if (Main.netMode != 1) + { + if (DoGSecondStageCountdown == 21540) + { + NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("CeaselessVoid")); + } + if (DoGSecondStageCountdown == 14340) + { + NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("StormWeaverHead")); + } + if (DoGSecondStageCountdown == 7140) + { + NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("CosmicWraith")); + } + if (DoGSecondStageCountdown <= 60) + { + if (!NPC.AnyNPCs(mod.NPCType("DevourerofGodsHeadS"))) + { + NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("DevourerofGodsHeadS")); + string key = "Mods.CalamityMod.EdgyBossText10"; + Color messageColor = Color.Cyan; + if (Main.netMode == 0) + { + Main.NewText(Language.GetTextValue(key), messageColor); + } + else if (Main.netMode == 2) + { + NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); + } + } + } + } + } + #endregion + if (Main.player[closestPlayer].ZoneDungeon && !NPC.downedBoss3) + { + if (!NPC.AnyNPCs(NPCID.DungeonGuardian) && Main.netMode != 1) + NPC.SpawnOnPlayer(closestPlayer, NPCID.DungeonGuardian); //your hell is as vast as my bonergrin, pray your life ends quickly + } + if (Main.player[closestPlayer].ZoneRockLayerHeight && + !Main.player[closestPlayer].ZoneUnderworldHeight && + !Main.player[closestPlayer].ZoneDungeon && + !Main.player[closestPlayer].ZoneJungle && + !Main.player[closestPlayer].GetModPlayer(mod).ZoneSunkenSea && + !CalamityPlayer.areThereAnyDamnBosses) + { + if (NPC.downedPlantBoss && + !Main.player[closestPlayer].GetModPlayer(mod).ZoneAbyss && + Main.player[closestPlayer].townNPCs < 3f) + { + if ((Main.player[closestPlayer].GetModPlayer(mod).zerg && Main.rand.Next(2000) == 0) || + (Main.rand.Next(100000) == 0 && !Main.player[closestPlayer].GetModPlayer(mod).zen)) + { + if (!NPC.AnyNPCs(mod.NPCType("ArmoredDiggerHead")) && Main.netMode != 1) + NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("ArmoredDiggerHead")); + } + } + } + if (Main.dayTime && Main.hardMode) + { + if (Main.player[closestPlayer].townNPCs >= 2f) + { + if (Main.rand.Next(2000) == 0) + { + int steamGril = NPC.FindFirstNPC(NPCID.Steampunker); + if (steamGril == -1 && Main.netMode != 1) + NPC.SpawnOnPlayer(closestPlayer, NPCID.Steampunker); + } + } + } + if (Main.player[closestPlayer].GetModPlayer(mod).ZoneAbyss) + { + if (Main.player[closestPlayer].chaosState) + { + if (!NPC.AnyNPCs(mod.NPCType("EidolonWyrmHeadHuge")) && Main.netMode != 1) + NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("EidolonWyrmHeadHuge")); + } + } + #region DeathModeBossSpawns + if (death && !CalamityPlayer.areThereAnyDamnBosses && Main.player[closestPlayer].statLifeMax2 >= 300) + { + if (bossSpawnCountdown <= 0) //check for countdown being 0 + { + if (Main.rand.Next(50000) == 0) + { + if (!NPC.downedBoss1 && bossType == 0) //only set countdown and boss type if conditions are met + if (!Main.dayTime && (Main.player[closestPlayer].ZoneOverworldHeight || Main.player[closestPlayer].ZoneSkyHeight)) + { + BossText(); + bossType = NPCID.EyeofCthulhu; + bossSpawnCountdown = 3600; //1 minute + } + + if (!NPC.downedBoss2 && bossType == 0) + if (Main.player[closestPlayer].ZoneCorrupt) + { + BossText(); + bossType = NPCID.EaterofWorldsHead; + bossSpawnCountdown = 3600; + } + + if (!NPC.downedBoss2 && bossType == 0) + if (Main.player[closestPlayer].ZoneCrimson) + { + BossText(); + bossType = NPCID.BrainofCthulhu; + bossSpawnCountdown = 3600; + } + + if (!NPC.downedQueenBee && bossType == 0) + if (Main.player[closestPlayer].ZoneJungle && (Main.player[closestPlayer].ZoneOverworldHeight || Main.player[closestPlayer].ZoneSkyHeight)) + { + BossText(); + bossType = NPCID.QueenBee; + bossSpawnCountdown = 3600; + } + + if (!downedDesertScourge && bossType == 0) + if (Main.player[closestPlayer].ZoneDesert) + { + BossText(); + bossType = mod.NPCType("DesertScourgeHead"); + bossSpawnCountdown = 3600; + } + + if (!downedPerforator && bossType == 0) + if (Main.player[closestPlayer].ZoneCrimson) + { + BossText(); + bossType = mod.NPCType("PerforatorHive"); + bossSpawnCountdown = 3600; + } + + if (!downedHiveMind && bossType == 0) + if (Main.player[closestPlayer].ZoneCorrupt) + { + BossText(); + bossType = mod.NPCType("HiveMind"); + bossSpawnCountdown = 3600; + } + + if (!downedCrabulon && bossType == 0) + if (Main.player[closestPlayer].ZoneGlowshroom) + { + BossText(); + bossType = mod.NPCType("CrabulonIdle"); + bossSpawnCountdown = 3600; + } + + if (Main.hardMode) + { + if (!NPC.downedMechBoss1 && bossType == 0) + if (!Main.dayTime && (Main.player[closestPlayer].ZoneOverworldHeight || Main.player[closestPlayer].ZoneSkyHeight)) + { + BossText(); + bossType = NPCID.TheDestroyer; + bossSpawnCountdown = 3600; + } + + if (!NPC.downedMechBoss2 && bossType == 0) + if (!Main.dayTime && (Main.player[closestPlayer].ZoneOverworldHeight || Main.player[closestPlayer].ZoneSkyHeight)) + { + BossText(); + bossType = NPCID.Spazmatism; + bossSpawnCountdown = 3600; + } + + if (!NPC.downedMechBoss3 && bossType == 0) + if (!Main.dayTime && (Main.player[closestPlayer].ZoneOverworldHeight || Main.player[closestPlayer].ZoneSkyHeight)) + { + BossText(); + bossType = NPCID.SkeletronPrime; + bossSpawnCountdown = 3600; + } + + if (!NPC.downedPlantBoss && bossType == 0) + if (Main.player[closestPlayer].ZoneJungle && !Main.player[closestPlayer].ZoneOverworldHeight && !Main.player[closestPlayer].ZoneSkyHeight) + { + BossText(); + bossType = NPCID.Plantera; + bossSpawnCountdown = 3600; + } + + if (!NPC.downedFishron && bossType == 0) + if (Main.player[closestPlayer].ZoneBeach) + { + BossText(); + bossType = NPCID.DukeFishron; + bossSpawnCountdown = 3600; + } + + if (!downedCryogen && bossType == 0) + if (Main.player[closestPlayer].ZoneSnow && Main.player[closestPlayer].ZoneOverworldHeight) + { + BossText(); + bossType = mod.NPCType("Cryogen"); + bossSpawnCountdown = 3600; + } + + if (!downedCalamitas && bossType == 0) + if (!Main.dayTime && Main.player[closestPlayer].ZoneOverworldHeight) + { + BossText(); + bossType = mod.NPCType("Calamitas"); + bossSpawnCountdown = 3600; + } + + if (!downedAstrageldon && bossType == 0) + if (Main.player[closestPlayer].GetModPlayer(mod).ZoneAstral && + !Main.dayTime && Main.player[closestPlayer].ZoneOverworldHeight) + { + BossText(); + bossType = mod.NPCType("Astrageldon"); + bossSpawnCountdown = 3600; + } + + if (!downedPlaguebringer && bossType == 0) + if (Main.player[closestPlayer].ZoneJungle && NPC.downedGolemBoss && Main.player[closestPlayer].ZoneOverworldHeight) + { + BossText(); + bossType = mod.NPCType("PlaguebringerGoliath"); + bossSpawnCountdown = 3600; + } + + if (NPC.downedMoonlord) + { + if (!downedGuardians && bossType == 0) + if (Main.player[closestPlayer].ZoneUnderworldHeight || + (Main.player[closestPlayer].ZoneHoly && Main.player[closestPlayer].ZoneOverworldHeight)) + { + BossText(); + bossType = mod.NPCType("ProfanedGuardianBoss"); + bossSpawnCountdown = 3600; + } + + if (!downedBumble && bossType == 0) + if (Main.player[closestPlayer].ZoneJungle && Main.player[closestPlayer].ZoneOverworldHeight) + { + BossText(); + bossType = mod.NPCType("Bumblefuck"); + bossSpawnCountdown = 3600; + } + } + } + if (Main.netMode == 2) + { + var netMessage = mod.GetPacket(); + netMessage.Write((byte)CalamityModMessageType.BossSpawnCountdownSync); + netMessage.Write(bossSpawnCountdown); + netMessage.Send(); + var netMessage2 = mod.GetPacket(); + netMessage2.Write((byte)CalamityModMessageType.BossTypeSync); + netMessage2.Write(bossType); + netMessage2.Send(); + } + } + } + else + { + bossSpawnCountdown--; + if (Main.netMode == 2) + { + var netMessage = mod.GetPacket(); + netMessage.Write((byte)CalamityModMessageType.BossSpawnCountdownSync); + netMessage.Write(bossSpawnCountdown); + netMessage.Send(); + } + if (bossSpawnCountdown <= 0) + { + bool canSpawn = true; + switch (bossType) + { + case NPCID.EyeofCthulhu: + if (Main.dayTime || (!Main.player[closestPlayer].ZoneOverworldHeight && !Main.player[closestPlayer].ZoneSkyHeight)) + canSpawn = false; + break; + case NPCID.EaterofWorldsHead: + if (!Main.player[closestPlayer].ZoneCorrupt) + canSpawn = false; + break; + case NPCID.BrainofCthulhu: + if (!Main.player[closestPlayer].ZoneCrimson) + canSpawn = false; + break; + case NPCID.QueenBee: + if (!Main.player[closestPlayer].ZoneJungle || (!Main.player[closestPlayer].ZoneOverworldHeight && !Main.player[closestPlayer].ZoneSkyHeight)) + canSpawn = false; + break; + case NPCID.TheDestroyer: + if (Main.dayTime || (!Main.player[closestPlayer].ZoneOverworldHeight && !Main.player[closestPlayer].ZoneSkyHeight)) + canSpawn = false; + break; + case NPCID.Spazmatism: + if (Main.dayTime || (!Main.player[closestPlayer].ZoneOverworldHeight && !Main.player[closestPlayer].ZoneSkyHeight)) + canSpawn = false; + break; + case NPCID.SkeletronPrime: + if (Main.dayTime || (!Main.player[closestPlayer].ZoneOverworldHeight && !Main.player[closestPlayer].ZoneSkyHeight)) + canSpawn = false; + break; + case NPCID.Plantera: + if (!Main.player[closestPlayer].ZoneJungle || Main.player[closestPlayer].ZoneOverworldHeight || Main.player[closestPlayer].ZoneSkyHeight) + canSpawn = false; + break; + case NPCID.DukeFishron: + if (!Main.player[closestPlayer].ZoneBeach) + canSpawn = false; + break; + } + + if (bossType == mod.NPCType("DesertScourgeHead")) + { + if (!Main.player[closestPlayer].ZoneDesert) + canSpawn = false; + } + else if (bossType == mod.NPCType("PerforatorHive")) + { + if (!Main.player[closestPlayer].ZoneCrimson) + canSpawn = false; + } + else if (bossType == mod.NPCType("HiveMind")) + { + if (!Main.player[closestPlayer].ZoneCorrupt) + canSpawn = false; + } + else if (bossType == mod.NPCType("CrabulonIdle")) + { + if (!Main.player[closestPlayer].ZoneGlowshroom) + canSpawn = false; + } + else if (bossType == mod.NPCType("Cryogen")) + { + if (!Main.player[closestPlayer].ZoneSnow || !Main.player[closestPlayer].ZoneOverworldHeight) + canSpawn = false; + } + else if (bossType == mod.NPCType("Calamitas")) + { + if (Main.dayTime || !Main.player[closestPlayer].ZoneOverworldHeight) + canSpawn = false; + } + else if (bossType == mod.NPCType("Astrageldon")) + { + if (!Main.player[closestPlayer].GetModPlayer(mod).ZoneAstral || + Main.dayTime || !Main.player[closestPlayer].ZoneOverworldHeight) + canSpawn = false; + } + else if (bossType == mod.NPCType("PlaguebringerGoliath")) + { + if (!Main.player[closestPlayer].ZoneJungle || !Main.player[closestPlayer].ZoneOverworldHeight) + canSpawn = false; + } + else if (bossType == mod.NPCType("ProfanedGuardianBoss")) + { + if (!Main.player[closestPlayer].ZoneUnderworldHeight && + (!Main.player[closestPlayer].ZoneHoly || !Main.player[closestPlayer].ZoneOverworldHeight)) + canSpawn = false; + } + else if (bossType == mod.NPCType("Bumblefuck")) + { + if (!Main.player[closestPlayer].ZoneJungle || !Main.player[closestPlayer].ZoneOverworldHeight) + canSpawn = false; + } + + if (canSpawn && Main.netMode != 1) + { + if (bossType == NPCID.Spazmatism) + NPC.SpawnOnPlayer(closestPlayer, NPCID.Retinazer); + else if (bossType == mod.NPCType("ProfanedGuardianBoss")) + { + NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("ProfanedGuardianBoss2")); + NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("ProfanedGuardianBoss3")); + } + else if (bossType == mod.NPCType("DesertScourgeHead")) + { + NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("DesertScourgeHeadSmall")); + NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("DesertScourgeHeadSmall")); + } + NPC.SpawnOnPlayer(closestPlayer, bossType); + } + bossType = 0; + if (Main.netMode == 2) + { + var netMessage = mod.GetPacket(); + netMessage.Write((byte)CalamityModMessageType.BossTypeSync); + netMessage.Write(bossType); + netMessage.Send(); + } + } + } + } + #endregion + if (!NPC.downedBoss3 && revenge) + { + if (Main.netMode != 1) + { + if (Sandstorm.Happening) + { + Sandstorm.Happening = false; + Sandstorm.TimeLeft = 0; + } + } + } + if (CalamityGlobalNPC.holyBoss >= 0 && !Main.npc[CalamityGlobalNPC.holyBoss].active) + { + CalamityGlobalNPC.holyBoss = -1; + if (Main.netMode == 2) + { + var netMessage = mod.GetPacket(); + netMessage.Write((byte)CalamityModMessageType.Providence); + netMessage.Write(CalamityGlobalNPC.holyBoss); + netMessage.Send(); + } + } + if (CalamityGlobalNPC.doughnutBoss >= 0 && !Main.npc[CalamityGlobalNPC.doughnutBoss].active) + { + CalamityGlobalNPC.doughnutBoss = -1; + } + if (CalamityGlobalNPC.voidBoss >= 0 && !Main.npc[CalamityGlobalNPC.voidBoss].active) + { + CalamityGlobalNPC.voidBoss = -1; + } + if (CalamityGlobalNPC.energyFlame >= 0 && !Main.npc[CalamityGlobalNPC.energyFlame].active) + { + CalamityGlobalNPC.energyFlame = -1; + } + if (CalamityGlobalNPC.hiveMind >= 0 && !Main.npc[CalamityGlobalNPC.hiveMind].active) + { + CalamityGlobalNPC.hiveMind = -1; + } + if (CalamityGlobalNPC.hiveMind2 >= 0 && !Main.npc[CalamityGlobalNPC.hiveMind2].active) + { + CalamityGlobalNPC.hiveMind2 = -1; + } + if (CalamityGlobalNPC.scavenger >= 0 && !Main.npc[CalamityGlobalNPC.scavenger].active) + { + CalamityGlobalNPC.scavenger = -1; + if (Main.netMode == 2) + { + var netMessage = mod.GetPacket(); + netMessage.Write((byte)CalamityModMessageType.Ravager); + netMessage.Write(CalamityGlobalNPC.scavenger); + netMessage.Send(); + } + } + if (CalamityGlobalNPC.DoGHead >= 0 && !Main.npc[CalamityGlobalNPC.DoGHead].active) + { + CalamityGlobalNPC.DoGHead = -1; + if (Main.netMode == 2) + { + var netMessage = mod.GetPacket(); + netMessage.Write((byte)CalamityModMessageType.DoG); + netMessage.Write(CalamityGlobalNPC.DoGHead); + netMessage.Send(); + } + } + if (CalamityGlobalNPC.SCal >= 0 && !Main.npc[CalamityGlobalNPC.SCal].active) + { + CalamityGlobalNPC.SCal = -1; + if (Main.netMode == 2) + { + var netMessage = mod.GetPacket(); + netMessage.Write((byte)CalamityModMessageType.SupremeCal); + netMessage.Write(CalamityGlobalNPC.SCal); + netMessage.Send(); + } + } + if (CalamityGlobalNPC.ghostBoss >= 0 && !Main.npc[CalamityGlobalNPC.ghostBoss].active) + { + CalamityGlobalNPC.ghostBoss = -1; + if (Main.netMode == 2) + { + var netMessage = mod.GetPacket(); + netMessage.Write((byte)CalamityModMessageType.Polterghast); + netMessage.Write(CalamityGlobalNPC.ghostBoss); + netMessage.Send(); + } + } + if (CalamityGlobalNPC.laserEye >= 0 && !Main.npc[CalamityGlobalNPC.laserEye].active) + { + CalamityGlobalNPC.laserEye = -1; + } + if (CalamityGlobalNPC.fireEye >= 0 && !Main.npc[CalamityGlobalNPC.fireEye].active) + { + CalamityGlobalNPC.fireEye = -1; + } + if (CalamityGlobalNPC.lordeBoss >= 0 && !Main.npc[CalamityGlobalNPC.lordeBoss].active) + { + CalamityGlobalNPC.lordeBoss = -1; + if (Main.netMode == 2) + { + var netMessage = mod.GetPacket(); + netMessage.Write((byte)CalamityModMessageType.LORDE); + netMessage.Write(CalamityGlobalNPC.lordeBoss); + netMessage.Send(); + } + } + if (Main.netMode != 1) + { + if (revenge) + { + CultistRitual.delay -= Main.dayRate * 10; + if (CultistRitual.delay < 0) + { + CultistRitual.delay = 0; + } + CultistRitual.recheck -= Main.dayRate * 10; + if (CultistRitual.recheck < 0) + { + CultistRitual.recheck = 0; + } + } + } + } + #endregion + + #region ChangeTime + public static void ChangeTime(bool day) + { + Main.time = 0.0; + if (day) + { + Main.dayTime = true; + } + else + { + Main.dayTime = false; + } + if (Main.netMode == 2) + { + NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + } + } + #endregion + + #region BossText + public void BossText() + { + string key = "Mods.CalamityMod.BossSpawnText"; + Color messageColor = Color.Crimson; + if (Main.netMode == 0) + { + Main.NewText(Language.GetTextValue(key), messageColor); + } + else if (Main.netMode == 2) + { + NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); + } + } + #endregion + } } diff --git a/CustomTileFraming.cs b/CustomTileFraming.cs index b80211a29f..de1afc0f90 100644 --- a/CustomTileFraming.cs +++ b/CustomTileFraming.cs @@ -12,950 +12,950 @@ using Terraria.ModLoader; using CalamityMod.Tiles; namespace CalamityMod -{ - public static class CustomTileFraming - { - private static int[][] PlantCheckAgainst; - private static Dictionary VineToGrass; - public static bool[] tileMergeAstralDirt; - - static CustomTileFraming() - { - Setup(); - } +{ + public static class CustomTileFraming + { + private static int[][] PlantCheckAgainst; + private static Dictionary VineToGrass; + public static bool[] tileMergeAstralDirt; - private static void Setup() - { - Mod mod = CalamityMod.Instance; - - int size = CalamityGlobalTile.PlantTypes.Length; - PlantCheckAgainst = new int[TileLoader.TileCount][]; - - PlantCheckAgainst[TileID.Plants] = new int[3] { TileID.Grass, TileID.PlanterBox, TileID.ClayPot }; - PlantCheckAgainst[TileID.CorruptPlants] = new int[1] { TileID.CorruptGrass }; - PlantCheckAgainst[TileID.JunglePlants] = new int[1] { TileID.JungleGrass }; - PlantCheckAgainst[TileID.MushroomPlants] = new int[1] { TileID.MushroomGrass }; - PlantCheckAgainst[TileID.Plants2] = new int[3] { TileID.Grass, TileID.PlanterBox, TileID.ClayPot }; - PlantCheckAgainst[TileID.JunglePlants2] = new int[1]{ TileID.JungleGrass }; - PlantCheckAgainst[TileID.HallowedPlants] = new int[1] { TileID.HallowedGrass }; - PlantCheckAgainst[TileID.HallowedPlants2] = new int[1] { TileID.HallowedGrass }; - PlantCheckAgainst[TileID.FleshWeeds] = new int[1] { TileID.FleshWeeds }; - PlantCheckAgainst[CalamityMod.Instance.TileType("AstralShortPlants")] = new int[1] { mod.TileType("AstralGrass") }; - PlantCheckAgainst[CalamityMod.Instance.TileType("AstralTallPlants")] = new int[1] { mod.TileType("AstralGrass") }; - - VineToGrass = new Dictionary(); - VineToGrass[TileID.Vines] = TileID.Grass; - VineToGrass[TileID.CrimsonVines] = TileID.FleshGrass; - VineToGrass[TileID.HallowedVines] = TileID.HallowedGrass; - VineToGrass[(ushort)mod.TileType("AstralVines")] = (ushort)mod.TileType("AstralGrass"); - - tileMergeAstralDirt = new bool[TileLoader.TileCount]; - //TODO: REST OF THESE - tileMergeAstralDirt[mod.TileType("AstralOre")] = true; - tileMergeAstralDirt[mod.TileType("AstralStone")] = true; - tileMergeAstralDirt[mod.TileType("AstralSand")] = true; - } - - private static bool PlantNeedsUpdate(int plantType, int checkType) - { - if (PlantCheckAgainst[plantType] == null) return false; - int size = PlantCheckAgainst[plantType].Length; - for (int i = 0; i < size; i++) - { - if (PlantCheckAgainst[plantType][i] == checkType) - { - return false; - } - } - return true; - } - - public static void CheckPlants(int x, int y) - { - int checkType = -1; - int plantType = Main.tile[x, y].type; - - if (y + 1 >= Main.maxTilesY) - checkType = plantType; - - Tile tile = Main.tile[x, y]; - Tile below = Main.tile[x, y + 1]; - if (y + 1 < Main.maxTilesY && below != null && below.nactive() && !below.halfBrick() && below.slope() == 0) - checkType = below.type; - - if (checkType == -1 || checkType == null) return; - - //Check if this plant needs an update - if (PlantNeedsUpdate(plantType, checkType)) - { - if ((plantType == TileID.Plants || plantType == TileID.Plants2) && checkType != TileID.Grass && tile.frameX >= 162) - { - Main.tile[x, y].frameX = 126; - } - if (plantType == TileID.JunglePlants2 && checkType != TileID.JungleGrass && tile.frameX >= 162) - { - Main.tile[x, y].frameX = 126; - } - - if (checkType == TileID.CorruptGrass) - { - plantType = TileID.CorruptPlants; - if (tile.frameX >= 162) - { - Main.tile[x, y].frameX = 126; - } - } - else if (checkType == TileID.Grass) - { - if (plantType == TileID.HallowedPlants2) - { - plantType = TileID.Plants2; - } - else - { - plantType = TileID.Plants; - } - } - else if (checkType == TileID.HallowedGrass) - { - if (plantType == TileID.Plants2) - { - plantType = TileID.HallowedPlants2; - } - else - { - plantType = TileID.HallowedPlants; - } - } - else if (checkType == TileID.FleshGrass) - { - plantType = TileID.FleshWeeds; - } - else if (checkType == TileID.MushroomGrass) - { - plantType = TileID.MushroomPlants; - while (Main.tile[x, y].frameX > 72) - { - Main.tile[x, y].frameX -= 72; - } - } - else if (checkType == CalamityMod.Instance.TileType("AstralGrass")) //ASTRAL - { - if (plantType == TileID.Plants || plantType == TileID.CorruptPlants || - plantType == TileID.FleshWeeds || plantType == TileID.HallowedPlants || - plantType == TileID.MushroomPlants || plantType == TileID.JunglePlants) - { - plantType = CalamityMod.Instance.TileType("AstralShortPlants"); - } - else - { - plantType = CalamityMod.Instance.TileType("AstralTallPlants"); - } - } - if (plantType != Main.tile[x, y].type) - { - Main.tile[x, y].type = (ushort)plantType; - return; - } - WorldGen.KillTile(x, y, false, false, false); - } - } - - public static void VineFrame(int x, int y) - { - Tile tile = Main.tile[x, y]; - int myType = tile.type; - Tile tile2 = Main.tile[x, y - 1]; - Tile tile3 = Main.tile[x, y + 1]; - Tile tile4 = Main.tile[x - 1, y]; - Tile tile5 = Main.tile[x + 1, y]; - Tile tile6 = Main.tile[x - 1, y + 1]; - Tile tile7 = Main.tile[x + 1, y + 1]; - Tile tile8 = Main.tile[x - 1, y - 1]; - Tile tile9 = Main.tile[x + 1, y - 1]; - int num52 = -1; - int num53 = -1; - int num54 = -1; - int num55 = -1; - int num56 = -1; - int num57 = -1; - int num58 = -1; - int num59 = -1; - if (tile4 != null && tile4.active()) - { - if (Main.tileStone[(int)tile4.type]) - { - num55 = 1; - } - else - { - num55 = (int)tile4.type; - } - if (tile4.slope() == 1 || tile4.slope() == 3) - { - num55 = -1; - } - } - if (tile5 != null && tile5.active()) - { - if (Main.tileStone[(int)tile5.type]) - { - num56 = 1; - } - else - { - num56 = (int)tile5.type; - } - if (tile5.slope() == 2 || tile5.slope() == 4) - { - num56 = -1; - } - } - if (tile2 != null && tile2.active()) - { - if (Main.tileStone[(int)tile2.type]) - { - num53 = 1; - } - else - { - num53 = (int)tile2.type; - } - if (tile2.slope() == 3 || tile2.slope() == 4) - { - num53 = -1; - } - } - if (tile3 != null && tile3.active()) - { - if (Main.tileStone[(int)tile3.type]) - { - num58 = 1; - } - else - { - num58 = (int)tile3.type; - } - if (tile3.slope() == 1 || tile3.slope() == 2) - { - num58 = -1; - } - } - if (tile8 != null && tile8.active()) - { - if (Main.tileStone[(int)tile8.type]) - { - num52 = 1; - } - else - { - num52 = (int)tile8.type; - } - } - if (tile9 != null && tile9.active()) - { - if (Main.tileStone[(int)tile9.type]) - { - num54 = 1; - } - else - { - num54 = (int)tile9.type; - } - } - if (tile6 != null && tile6.active()) - { - if (Main.tileStone[(int)tile6.type]) - { - num57 = 1; - } - else - { - num57 = (int)tile6.type; - } - } - if (tile7 != null && tile7.active()) - { - if (Main.tileStone[(int)tile7.type]) - { - num59 = 1; - } - else - { - num59 = (int)tile7.type; - } - } - if (tile.slope() == 2) - { - num53 = -1; - num55 = -1; - } - if (tile.slope() == 1) - { - num53 = -1; - num56 = -1; - } - if (tile.slope() == 4) - { - num58 = -1; - num55 = -1; - } - if (tile.slope() == 3) - { - num58 = -1; - num56 = -1; - } - - if (tile2 != null) - { - if (!tile2.active()) - { - num53 = -1; - } - else if (tile2.bottomSlope()) - { - num53 = -1; - } - else - { - num53 = (int)tile2.type; - } - } - else - { - num53 = myType; - } - - ushort[] vines = VineToGrass.Keys.ToArray(); - - for (int i = 0; i < vines.Length; i++) - { - ushort myGrassType = VineToGrass[(ushort)vines[i]]; - if (myType != vines[i] && (num53 == myGrassType || num53 == vines[i])) - { - Main.tile[x, y].type = vines[i]; - WorldGen.SquareTileFrame(x, y, true); - return; - } - } - - if (num53 != myType) - { - bool flag17 = false; - if (num53 == -1) - { - flag17 = true; - } - else - { - for (int i = 0; i < vines.Length; i++) - { - if (myType != TileID.Vines) - { - if (myType == vines[i] && num53 != VineToGrass[vines[i]]) - { - flag17 = true; - } - } - else if (num53 != TileID.Grass && num53 != TileID.LeafBlock) - { - flag17 = true; - } - } - } - if (flag17) - { - WorldGen.KillTile(x, y, false, false, false); - } - } - return; - } - - enum Similarity - { - Same, - MergeLink, - None - } - - public static void FrameTileForCustomMerge(int x, int y, int myType, int mergeType, bool forceSameDown = false, bool forceSameUp = false, bool forceSameLeft = false, bool forceSameRight = false, bool resetFrame = true) - { - bool tmp; - FrameTileForCustomMerge(x, y, myType, mergeType, out tmp, out tmp, out tmp, out tmp, forceSameDown, forceSameUp, forceSameLeft, forceSameRight, resetFrame); - } - - public static void FrameTileForCustomMerge(int x, int y, int myType, int mergeType, out bool mergedUp, out bool mergedLeft, out bool mergedRight, out bool mergedDown, bool forceSameDown = false, bool forceSameUp = false, bool forceSameLeft = false, bool forceSameRight = false, bool resetFrame = true) - { - Tile tileLeft = Main.tile[x - 1, y]; - Tile tileRight = Main.tile[x + 1, y]; - Tile tileUp = Main.tile[x, y - 1]; - Tile tileDown = Main.tile[x, y + 1]; - Tile tileTopLeft = Main.tile[x - 1, y - 1]; - Tile tileTopRight = Main.tile[x + 1, y - 1]; - Tile tileBottomLeft = Main.tile[x - 1, y + 1]; - Tile tileBottomRight = Main.tile[x + 1, y + 1]; - - //CARDINAL - Similarity leftSim = GetSimilarity(tileLeft, myType, mergeType); - if (forceSameLeft) leftSim = Similarity.Same; - Similarity rightSim = GetSimilarity(tileRight, myType, mergeType); - if (forceSameRight) rightSim = Similarity.Same; - Similarity upSim = GetSimilarity(tileUp, myType, mergeType); - if (forceSameUp) upSim = Similarity.Same; - Similarity downSim = GetSimilarity(tileDown, myType, mergeType); - if (forceSameDown) downSim = Similarity.Same; - - //DIAGONAL - Similarity topLeftSim = GetSimilarity(tileTopLeft, myType, mergeType); - Similarity topRightSim = GetSimilarity(tileTopRight, myType, mergeType); - Similarity bottomLeftSim = GetSimilarity(tileBottomLeft, myType, mergeType); - Similarity bottomRightSim = GetSimilarity(tileBottomRight, myType, mergeType); - - int randomFrame; - if (resetFrame) - { - randomFrame = WorldGen.genRand.Next(3); - Main.tile[x, y].frameNumber((byte)randomFrame); - } - else - { - randomFrame = Main.tile[x, y].frameNumber(); - } - - /* DEBUGGING + static CustomTileFraming() + { + Setup(); + } + + private static void Setup() + { + Mod mod = CalamityMod.Instance; + + int size = CalamityGlobalTile.PlantTypes.Length; + PlantCheckAgainst = new int[TileLoader.TileCount][]; + + PlantCheckAgainst[TileID.Plants] = new int[3] { TileID.Grass, TileID.PlanterBox, TileID.ClayPot }; + PlantCheckAgainst[TileID.CorruptPlants] = new int[1] { TileID.CorruptGrass }; + PlantCheckAgainst[TileID.JunglePlants] = new int[1] { TileID.JungleGrass }; + PlantCheckAgainst[TileID.MushroomPlants] = new int[1] { TileID.MushroomGrass }; + PlantCheckAgainst[TileID.Plants2] = new int[3] { TileID.Grass, TileID.PlanterBox, TileID.ClayPot }; + PlantCheckAgainst[TileID.JunglePlants2] = new int[1] { TileID.JungleGrass }; + PlantCheckAgainst[TileID.HallowedPlants] = new int[1] { TileID.HallowedGrass }; + PlantCheckAgainst[TileID.HallowedPlants2] = new int[1] { TileID.HallowedGrass }; + PlantCheckAgainst[TileID.FleshWeeds] = new int[1] { TileID.FleshWeeds }; + PlantCheckAgainst[CalamityMod.Instance.TileType("AstralShortPlants")] = new int[1] { mod.TileType("AstralGrass") }; + PlantCheckAgainst[CalamityMod.Instance.TileType("AstralTallPlants")] = new int[1] { mod.TileType("AstralGrass") }; + + VineToGrass = new Dictionary(); + VineToGrass[TileID.Vines] = TileID.Grass; + VineToGrass[TileID.CrimsonVines] = TileID.FleshGrass; + VineToGrass[TileID.HallowedVines] = TileID.HallowedGrass; + VineToGrass[(ushort)mod.TileType("AstralVines")] = (ushort)mod.TileType("AstralGrass"); + + tileMergeAstralDirt = new bool[TileLoader.TileCount]; + //TODO: REST OF THESE + tileMergeAstralDirt[mod.TileType("AstralOre")] = true; + tileMergeAstralDirt[mod.TileType("AstralStone")] = true; + tileMergeAstralDirt[mod.TileType("AstralSand")] = true; + } + + private static bool PlantNeedsUpdate(int plantType, int checkType) + { + if (PlantCheckAgainst[plantType] == null) return false; + int size = PlantCheckAgainst[plantType].Length; + for (int i = 0; i < size; i++) + { + if (PlantCheckAgainst[plantType][i] == checkType) + { + return false; + } + } + return true; + } + + public static void CheckPlants(int x, int y) + { + int checkType = -1; + int plantType = Main.tile[x, y].type; + + if (y + 1 >= Main.maxTilesY) + checkType = plantType; + + Tile tile = Main.tile[x, y]; + Tile below = Main.tile[x, y + 1]; + if (y + 1 < Main.maxTilesY && below != null && below.nactive() && !below.halfBrick() && below.slope() == 0) + checkType = below.type; + + if (checkType == -1) return; + + //Check if this plant needs an update + if (PlantNeedsUpdate(plantType, checkType)) + { + if ((plantType == TileID.Plants || plantType == TileID.Plants2) && checkType != TileID.Grass && tile.frameX >= 162) + { + Main.tile[x, y].frameX = 126; + } + if (plantType == TileID.JunglePlants2 && checkType != TileID.JungleGrass && tile.frameX >= 162) + { + Main.tile[x, y].frameX = 126; + } + + if (checkType == TileID.CorruptGrass) + { + plantType = TileID.CorruptPlants; + if (tile.frameX >= 162) + { + Main.tile[x, y].frameX = 126; + } + } + else if (checkType == TileID.Grass) + { + if (plantType == TileID.HallowedPlants2) + { + plantType = TileID.Plants2; + } + else + { + plantType = TileID.Plants; + } + } + else if (checkType == TileID.HallowedGrass) + { + if (plantType == TileID.Plants2) + { + plantType = TileID.HallowedPlants2; + } + else + { + plantType = TileID.HallowedPlants; + } + } + else if (checkType == TileID.FleshGrass) + { + plantType = TileID.FleshWeeds; + } + else if (checkType == TileID.MushroomGrass) + { + plantType = TileID.MushroomPlants; + while (Main.tile[x, y].frameX > 72) + { + Main.tile[x, y].frameX -= 72; + } + } + else if (checkType == CalamityMod.Instance.TileType("AstralGrass")) //ASTRAL + { + if (plantType == TileID.Plants || plantType == TileID.CorruptPlants || + plantType == TileID.FleshWeeds || plantType == TileID.HallowedPlants || + plantType == TileID.MushroomPlants || plantType == TileID.JunglePlants) + { + plantType = CalamityMod.Instance.TileType("AstralShortPlants"); + } + else + { + plantType = CalamityMod.Instance.TileType("AstralTallPlants"); + } + } + if (plantType != Main.tile[x, y].type) + { + Main.tile[x, y].type = (ushort)plantType; + return; + } + WorldGen.KillTile(x, y, false, false, false); + } + } + + public static void VineFrame(int x, int y) + { + Tile tile = Main.tile[x, y]; + int myType = tile.type; + Tile tile2 = Main.tile[x, y - 1]; + Tile tile3 = Main.tile[x, y + 1]; + Tile tile4 = Main.tile[x - 1, y]; + Tile tile5 = Main.tile[x + 1, y]; + Tile tile6 = Main.tile[x - 1, y + 1]; + Tile tile7 = Main.tile[x + 1, y + 1]; + Tile tile8 = Main.tile[x - 1, y - 1]; + Tile tile9 = Main.tile[x + 1, y - 1]; + int num52 = -1; + int num53 = -1; + int num54 = -1; + int num55 = -1; + int num56 = -1; + int num57 = -1; + int num58 = -1; + int num59 = -1; + if (tile4 != null && tile4.active()) + { + if (Main.tileStone[(int)tile4.type]) + { + num55 = 1; + } + else + { + num55 = (int)tile4.type; + } + if (tile4.slope() == 1 || tile4.slope() == 3) + { + num55 = -1; + } + } + if (tile5 != null && tile5.active()) + { + if (Main.tileStone[(int)tile5.type]) + { + num56 = 1; + } + else + { + num56 = (int)tile5.type; + } + if (tile5.slope() == 2 || tile5.slope() == 4) + { + num56 = -1; + } + } + if (tile2 != null && tile2.active()) + { + if (Main.tileStone[(int)tile2.type]) + { + num53 = 1; + } + else + { + num53 = (int)tile2.type; + } + if (tile2.slope() == 3 || tile2.slope() == 4) + { + num53 = -1; + } + } + if (tile3 != null && tile3.active()) + { + if (Main.tileStone[(int)tile3.type]) + { + num58 = 1; + } + else + { + num58 = (int)tile3.type; + } + if (tile3.slope() == 1 || tile3.slope() == 2) + { + num58 = -1; + } + } + if (tile8 != null && tile8.active()) + { + if (Main.tileStone[(int)tile8.type]) + { + num52 = 1; + } + else + { + num52 = (int)tile8.type; + } + } + if (tile9 != null && tile9.active()) + { + if (Main.tileStone[(int)tile9.type]) + { + num54 = 1; + } + else + { + num54 = (int)tile9.type; + } + } + if (tile6 != null && tile6.active()) + { + if (Main.tileStone[(int)tile6.type]) + { + num57 = 1; + } + else + { + num57 = (int)tile6.type; + } + } + if (tile7 != null && tile7.active()) + { + if (Main.tileStone[(int)tile7.type]) + { + num59 = 1; + } + else + { + num59 = (int)tile7.type; + } + } + if (tile.slope() == 2) + { + num53 = -1; + num55 = -1; + } + if (tile.slope() == 1) + { + num53 = -1; + num56 = -1; + } + if (tile.slope() == 4) + { + num58 = -1; + num55 = -1; + } + if (tile.slope() == 3) + { + num58 = -1; + num56 = -1; + } + + if (tile2 != null) + { + if (!tile2.active()) + { + num53 = -1; + } + else if (tile2.bottomSlope()) + { + num53 = -1; + } + else + { + num53 = (int)tile2.type; + } + } + else + { + num53 = myType; + } + + ushort[] vines = VineToGrass.Keys.ToArray(); + + for (int i = 0; i < vines.Length; i++) + { + ushort myGrassType = VineToGrass[(ushort)vines[i]]; + if (myType != vines[i] && (num53 == myGrassType || num53 == vines[i])) + { + Main.tile[x, y].type = vines[i]; + WorldGen.SquareTileFrame(x, y, true); + return; + } + } + + if (num53 != myType) + { + bool flag17 = false; + if (num53 == -1) + { + flag17 = true; + } + else + { + for (int i = 0; i < vines.Length; i++) + { + if (myType != TileID.Vines) + { + if (myType == vines[i] && num53 != VineToGrass[vines[i]]) + { + flag17 = true; + } + } + else if (num53 != TileID.Grass && num53 != TileID.LeafBlock) + { + flag17 = true; + } + } + } + if (flag17) + { + WorldGen.KillTile(x, y, false, false, false); + } + } + return; + } + + enum Similarity + { + Same, + MergeLink, + None + } + + public static void FrameTileForCustomMerge(int x, int y, int myType, int mergeType, bool forceSameDown = false, bool forceSameUp = false, bool forceSameLeft = false, bool forceSameRight = false, bool resetFrame = true) + { + bool tmp; + FrameTileForCustomMerge(x, y, myType, mergeType, out tmp, out tmp, out tmp, out tmp, forceSameDown, forceSameUp, forceSameLeft, forceSameRight, resetFrame); + } + + public static void FrameTileForCustomMerge(int x, int y, int myType, int mergeType, out bool mergedUp, out bool mergedLeft, out bool mergedRight, out bool mergedDown, bool forceSameDown = false, bool forceSameUp = false, bool forceSameLeft = false, bool forceSameRight = false, bool resetFrame = true) + { + Tile tileLeft = Main.tile[x - 1, y]; + Tile tileRight = Main.tile[x + 1, y]; + Tile tileUp = Main.tile[x, y - 1]; + Tile tileDown = Main.tile[x, y + 1]; + Tile tileTopLeft = Main.tile[x - 1, y - 1]; + Tile tileTopRight = Main.tile[x + 1, y - 1]; + Tile tileBottomLeft = Main.tile[x - 1, y + 1]; + Tile tileBottomRight = Main.tile[x + 1, y + 1]; + + //CARDINAL + Similarity leftSim = GetSimilarity(tileLeft, myType, mergeType); + if (forceSameLeft) leftSim = Similarity.Same; + Similarity rightSim = GetSimilarity(tileRight, myType, mergeType); + if (forceSameRight) rightSim = Similarity.Same; + Similarity upSim = GetSimilarity(tileUp, myType, mergeType); + if (forceSameUp) upSim = Similarity.Same; + Similarity downSim = GetSimilarity(tileDown, myType, mergeType); + if (forceSameDown) downSim = Similarity.Same; + + //DIAGONAL + Similarity topLeftSim = GetSimilarity(tileTopLeft, myType, mergeType); + Similarity topRightSim = GetSimilarity(tileTopRight, myType, mergeType); + Similarity bottomLeftSim = GetSimilarity(tileBottomLeft, myType, mergeType); + Similarity bottomRightSim = GetSimilarity(tileBottomRight, myType, mergeType); + + int randomFrame; + if (resetFrame) + { + randomFrame = WorldGen.genRand.Next(3); + Main.tile[x, y].frameNumber((byte)randomFrame); + } + else + { + randomFrame = Main.tile[x, y].frameNumber(); + } + + /* DEBUGGING if (Player.tileTargetX == x && Player.tileTargetY == y) { Main.NewText(StringWriter(leftSim, rightSim, upSim, downSim, topLeftSim, topRightSim, bottomLeftSim, bottomRightSim, forceSameDown, forceSameUp, forceSameLeft, forceSameRight)); - }*/ - - mergedDown = mergedLeft = mergedRight = mergedUp = false; - - if (leftSim == Similarity.None) - { - if (upSim == Similarity.Same) - { - if (downSim == Similarity.Same) - { - if (rightSim == Similarity.Same) - { - SetFrameAt(x, y, 0, 18 * randomFrame); - return; - } - else if (rightSim == Similarity.MergeLink) - { - mergedRight = true; - SetFrameAt(x, y, 234 + 18 * randomFrame, 36); - return; - } - SetFrameAt(x, y, 90, 18 * randomFrame); - return; - } - else if (downSim == Similarity.MergeLink) - { - if (rightSim == Similarity.Same) - { - mergedDown = true; - SetFrameAt(x, y, 72, 90 + 18 * randomFrame); - return; - } - else if (rightSim == Similarity.MergeLink) - { - SetFrameAt(x, y, 108 + 18 * randomFrame, 54); - return; - } - mergedDown = true; - SetFrameAt(x, y, 126, 90 + 18 * randomFrame); - return; - } - if (rightSim == Similarity.Same) - { - SetFrameAt(x, y, 36 * randomFrame, 72); - return; - } - SetFrameAt(x, y, 108 + 18 * randomFrame, 54); - return; - } - else if (upSim == Similarity.MergeLink) - { - if (downSim == Similarity.Same) - { - if (rightSim == Similarity.Same) - { - mergedUp = true; - SetFrameAt(x, y, 72, 144 + 18 * randomFrame); - return; - } - else if (rightSim == Similarity.MergeLink) - { - SetFrameAt(x, y, 108 + 18 * randomFrame, 0); - return; - } - mergedUp = true; - SetFrameAt(x, y, 126, 144 + 18 * randomFrame); - return; - } - else if (downSim == Similarity.MergeLink) - { - if (rightSim == Similarity.Same) - { - SetFrameAt(x, y, 162, 18 * randomFrame); - return; - } - else if (rightSim == Similarity.MergeLink) - { - SetFrameAt(x, y, 162 + 18 * randomFrame, 54); - return; - } - mergedUp = true; - mergedDown = true; - SetFrameAt(x, y, 108, 216 + 18 * randomFrame); - return; - } - if (rightSim == Similarity.Same) - { - SetFrameAt(x, y, 162, 18 * randomFrame); - return; - } - else if (rightSim == Similarity.MergeLink) - { - SetFrameAt(x, y, 162 + 18 * randomFrame, 54); - return; - } - mergedUp = true; - SetFrameAt(x, y, 108, 144 + 18 * randomFrame); - return; - } - if (downSim == Similarity.Same) - { - if (rightSim == Similarity.Same) - { - SetFrameAt(x, y, 36 * randomFrame, 54); - return; - } - else if (rightSim == Similarity.MergeLink) - { - SetFrameAt(x, y, 108 + 18 * randomFrame, 0); - return; - } - SetFrameAt(x, y, 108 + 18 * randomFrame, 0); - return; - } - else if (downSim == Similarity.MergeLink) - { - if (rightSim == Similarity.Same) - { - SetFrameAt(x, y, 162, 18 * randomFrame); - return; - } - else if (rightSim == Similarity.MergeLink) - { - SetFrameAt(x, y, 162 + 18 * randomFrame, 54); - return; - } - mergedDown = true; - SetFrameAt(x, y, 108, 90 + 18 * randomFrame); - return; - } - if (rightSim == Similarity.Same) - { - SetFrameAt(x, y, 162, 18 * randomFrame); - return; - } - else if (rightSim == Similarity.MergeLink) - { - mergedRight = true; - SetFrameAt(x, y, 54 + 18 * randomFrame, 234); - return; - } - SetFrameAt(x, y, 162 + 18 * randomFrame, 54); - return; - } - else if (leftSim == Similarity.MergeLink) - { - if (upSim == Similarity.Same) - { - if (downSim == Similarity.Same) - { - if (rightSim == Similarity.Same) - { - mergedLeft = true; - SetFrameAt(x, y, 162, 126 + 18 * randomFrame); - return; - } - else if (rightSim == Similarity.MergeLink) - { - mergedLeft = true; - mergedRight = true; - SetFrameAt(x, y, 180, 126 + 18 * randomFrame); - return; - } - mergedLeft = true; - SetFrameAt(x, y, 234 + 18 * randomFrame, 54); - return; - } - else if (downSim == Similarity.MergeLink) - { - if (rightSim == Similarity.Same) - { - mergedLeft = mergedDown = true; - SetFrameAt(x, y, 36, 108 + 36 * randomFrame); - return; - } - else if (rightSim == Similarity.MergeLink) - { - mergedLeft = mergedRight = mergedDown = true; - SetFrameAt(x, y, 198, 144 + 18 * randomFrame); - return; - } - SetFrameAt(x, y, 108 + 18 * randomFrame, 54); - return; - } - if (rightSim == Similarity.Same) - { - mergedLeft = true; - SetFrameAt(x, y, 18 * randomFrame, 216); - return; - } - SetFrameAt(x, y, 108 + 18 * randomFrame, 54); - return; - } - else if (upSim == Similarity.MergeLink) - { - if (downSim == Similarity.Same) - { - if (rightSim == Similarity.Same) - { - mergedUp = mergedLeft = true; - SetFrameAt(x, y, 36, 90 + 36 * randomFrame); - return; - } - else if (rightSim == Similarity.MergeLink) - { - mergedLeft = mergedRight = mergedUp = true; - SetFrameAt(x, y, 198, 90 + 18 * randomFrame); - return; - } - SetFrameAt(x, y, 108 + 18 * randomFrame, 0); - return; - } - else if (downSim == Similarity.MergeLink) - { - if (rightSim == Similarity.Same) - { - mergedUp = mergedLeft = mergedDown = true; - SetFrameAt(x, y, 216, 90 + 18 * randomFrame); - return; - } - else if (rightSim == Similarity.MergeLink) - { - mergedDown = mergedLeft = mergedRight = mergedUp = true; - SetFrameAt(x, y, 108 + 18 * randomFrame, 198); - return; - } - SetFrameAt(x, y, 162 + 18 * randomFrame, 54); - return; - } - if (rightSim == Similarity.Same) - { - SetFrameAt(x, y, 162, 18 * randomFrame); - return; - } - SetFrameAt(x, y, 162 + 18 * randomFrame, 54); - return; - } - if (downSim == Similarity.Same) - { - if (rightSim == Similarity.Same) - { - mergedLeft = true; - SetFrameAt(x, y, 18 * randomFrame, 198); - return; - } - else if (rightSim == Similarity.MergeLink) - { - SetFrameAt(x, y, 108 + 18 * randomFrame, 0); - return; - } - SetFrameAt(x, y, 108 + 18 * randomFrame, 0); - return; - } - else if (downSim == Similarity.MergeLink) - { - if (rightSim == Similarity.Same) - { - SetFrameAt(x, y, 162, 18 * randomFrame); - return; - } - else if (rightSim == Similarity.MergeLink) - { - SetFrameAt(x, y, 162 + 18 * randomFrame, 54); - return; - } - SetFrameAt(x, y, 162 + 18 * randomFrame, 54); - return; - } - if (rightSim == Similarity.Same) - { - mergedLeft = true; - SetFrameAt(x, y, 18 * randomFrame, 252); - return; - } - else if (rightSim == Similarity.MergeLink) - { - mergedRight = mergedLeft = true; - SetFrameAt(x, y, 162 + 18 * randomFrame, 198); - return; - } - mergedLeft = true; - SetFrameAt(x, y, 18 * randomFrame, 234); - return; - } - if (upSim == Similarity.Same) - { - if (downSim == Similarity.Same) - { - if (rightSim == Similarity.Same) - { - #region FULL TILE STUFF - if (topLeftSim == Similarity.MergeLink || topRightSim == Similarity.MergeLink || bottomLeftSim == Similarity.MergeLink || bottomRightSim == Similarity.MergeLink) - { - if (bottomRightSim == Similarity.MergeLink) - { - SetFrameAt(x, y, 0, 90 + 36 * randomFrame); - return; - } - else if (bottomLeftSim == Similarity.MergeLink) - { - SetFrameAt(x, y, 18, 90 + 36 * randomFrame); - return; - } - else if (topRightSim == Similarity.MergeLink) - { - SetFrameAt(x, y, 0, 108 + 36 * randomFrame); - return; - } - SetFrameAt(x, y, 18, 108 + 36 * randomFrame); - return; - } - if (topLeftSim == Similarity.Same) - { - if (topRightSim == Similarity.Same) - { - if (bottomLeftSim == Similarity.Same) - { - SetFrameAt(x, y, 18 + 18 * randomFrame, 18); - return; - } - if (bottomRightSim == Similarity.Same) - { - SetFrameAt(x, y, 18 + 18 * randomFrame, 18); - return; - } - SetFrameAt(x, y, 108 + 18 * randomFrame, 36); - return; - } - if (bottomLeftSim == Similarity.Same) - { - if (bottomRightSim == Similarity.Same) - { - if (topRightSim == Similarity.MergeLink) - { - SetFrameAt(x, y, 0, 108 + 36 * randomFrame); - return; - } - SetFrameAt(x, y, 18 + 18 * randomFrame, 18); - return; - } - SetFrameAt(x, y, 198, 18 * randomFrame); - return; - } - } - else if (topLeftSim == Similarity.None) - { - if (topRightSim == Similarity.Same) - { - if (bottomRightSim == Similarity.Same) - { - if (bottomLeftSim == Similarity.Same) - { - SetFrameAt(x, y, 18 + 18 * randomFrame, 18); - return; - } - SetFrameAt(x, y, 18 + 18 * randomFrame, 18); - return; - } - if (bottomLeftSim == Similarity.Same) - { - SetFrameAt(x, y, 18 + 18 * randomFrame, 18); - return; - } - } - SetFrameAt(x, y, 18 + 18 * randomFrame, 18); - return; - } - SetFrameAt(x, y, 18 + 18 * randomFrame, 18); - return; - #endregion - } - else if (rightSim == Similarity.MergeLink) - { - mergedRight = true; - SetFrameAt(x, y, 144, 126 + 18 * randomFrame); - return; - } - SetFrameAt(x, y, 72, 18 * randomFrame); - return; - } - else if (downSim == Similarity.MergeLink) - { - if (rightSim == Similarity.Same) - { - mergedDown = true; - SetFrameAt(x, y, 144 + 18 * randomFrame, 90); - return; - } - else if (rightSim == Similarity.MergeLink) - { - mergedDown = mergedRight = true; - SetFrameAt(x, y, 54, 108 + 36 * randomFrame); - return; - } - mergedDown = true; - SetFrameAt(x, y, 90, 90 + 18 * randomFrame); - return; - } - if (rightSim == Similarity.Same) - { - SetFrameAt(x, y, 18 + 18 * randomFrame, 36); - return; - } - else if (rightSim == Similarity.MergeLink) - { - mergedRight = true; - SetFrameAt(x, y, 54 + 18 * randomFrame, 216); - return; - } - SetFrameAt(x, y, 18 + 36 * randomFrame, 72); - return; - } - else if (upSim == Similarity.MergeLink) - { - if (downSim == Similarity.Same) - { - if (rightSim == Similarity.Same) - { - mergedUp = true; - SetFrameAt(x, y, 144 + 18 * randomFrame, 108); - return; - } - else if (rightSim == Similarity.MergeLink) - { - mergedRight = mergedUp = true; - SetFrameAt(x, y, 54, 90 + 36 * randomFrame); - return; - } - mergedUp = true; - SetFrameAt(x, y, 90, 144 + 18 * randomFrame); - return; - } - else if (downSim == Similarity.MergeLink) - { - if (rightSim == Similarity.Same) - { - mergedUp = mergedDown = true; - SetFrameAt(x, y, 144 + 18 * randomFrame, 180); - return; - } - else if (rightSim == Similarity.MergeLink) - { - mergedUp = mergedRight = mergedDown = true; - SetFrameAt(x, y, 216, 144 + 18 * randomFrame); - return; - } - SetFrameAt(x, y, 216, 18 * randomFrame); - return; - } - if (rightSim == Similarity.Same) - { - mergedUp = true; - SetFrameAt(x, y, 234 + 18 * randomFrame, 18); - return; - } - SetFrameAt(x, y, 216, 18 * randomFrame); - return; - } - if (downSim == Similarity.Same) - { - if (rightSim == Similarity.Same) - { - SetFrameAt(x, y, 18 + 18 * randomFrame, 0); - return; - } - else if (rightSim == Similarity.MergeLink) - { - mergedRight = true; - SetFrameAt(x, y, 54 + 18 * randomFrame, 198); - return; - } - SetFrameAt(x, y, 18 + 36 * randomFrame, 54); - return; - } - else if (downSim == Similarity.MergeLink) - { - if (rightSim == Similarity.Same) - { - mergedDown = true; - SetFrameAt(x, y, 234 + 18 * randomFrame, 0); - return; - } - SetFrameAt(x, y, 216, 18 * randomFrame); - return; - } - if (rightSim == Similarity.Same) - { - SetFrameAt(x, y, 108 + 18 * randomFrame, 72); - return; - } - else if (rightSim == Similarity.MergeLink) - { - mergedRight = true; - SetFrameAt(x, y, 54 + 18 * randomFrame, 252); - return; - } - SetFrameAt(x, y, 216, 18 * randomFrame); - return; - } - - private static void SetFrameAt(int x, int y, int frameX, int frameY) - { - Main.tile[x, y].frameX = (short)frameX; - Main.tile[x, y].frameY = (short)frameY; - } - - private static Similarity GetSimilarity(Tile check, int myType, int mergeType) - { - if (!check.active()) return Similarity.None; - - if (check.type == myType || Main.tileMerge[myType][check.type]) - return Similarity.Same; - else if (check.type == mergeType) - return Similarity.MergeLink; - - return Similarity.None; - } - - private static string StringWriter(params object[] strings) - { - string s = ""; - for (int i = 0; i < strings.Length; i++) - { - s += strings[i].ToString(); - if (i != strings.Length - 1) - { - s += ", "; - } - } - return s; - } - } + }*/ + + mergedDown = mergedLeft = mergedRight = mergedUp = false; + + if (leftSim == Similarity.None) + { + if (upSim == Similarity.Same) + { + if (downSim == Similarity.Same) + { + if (rightSim == Similarity.Same) + { + SetFrameAt(x, y, 0, 18 * randomFrame); + return; + } + else if (rightSim == Similarity.MergeLink) + { + mergedRight = true; + SetFrameAt(x, y, 234 + 18 * randomFrame, 36); + return; + } + SetFrameAt(x, y, 90, 18 * randomFrame); + return; + } + else if (downSim == Similarity.MergeLink) + { + if (rightSim == Similarity.Same) + { + mergedDown = true; + SetFrameAt(x, y, 72, 90 + 18 * randomFrame); + return; + } + else if (rightSim == Similarity.MergeLink) + { + SetFrameAt(x, y, 108 + 18 * randomFrame, 54); + return; + } + mergedDown = true; + SetFrameAt(x, y, 126, 90 + 18 * randomFrame); + return; + } + if (rightSim == Similarity.Same) + { + SetFrameAt(x, y, 36 * randomFrame, 72); + return; + } + SetFrameAt(x, y, 108 + 18 * randomFrame, 54); + return; + } + else if (upSim == Similarity.MergeLink) + { + if (downSim == Similarity.Same) + { + if (rightSim == Similarity.Same) + { + mergedUp = true; + SetFrameAt(x, y, 72, 144 + 18 * randomFrame); + return; + } + else if (rightSim == Similarity.MergeLink) + { + SetFrameAt(x, y, 108 + 18 * randomFrame, 0); + return; + } + mergedUp = true; + SetFrameAt(x, y, 126, 144 + 18 * randomFrame); + return; + } + else if (downSim == Similarity.MergeLink) + { + if (rightSim == Similarity.Same) + { + SetFrameAt(x, y, 162, 18 * randomFrame); + return; + } + else if (rightSim == Similarity.MergeLink) + { + SetFrameAt(x, y, 162 + 18 * randomFrame, 54); + return; + } + mergedUp = true; + mergedDown = true; + SetFrameAt(x, y, 108, 216 + 18 * randomFrame); + return; + } + if (rightSim == Similarity.Same) + { + SetFrameAt(x, y, 162, 18 * randomFrame); + return; + } + else if (rightSim == Similarity.MergeLink) + { + SetFrameAt(x, y, 162 + 18 * randomFrame, 54); + return; + } + mergedUp = true; + SetFrameAt(x, y, 108, 144 + 18 * randomFrame); + return; + } + if (downSim == Similarity.Same) + { + if (rightSim == Similarity.Same) + { + SetFrameAt(x, y, 36 * randomFrame, 54); + return; + } + else if (rightSim == Similarity.MergeLink) + { + SetFrameAt(x, y, 108 + 18 * randomFrame, 0); + return; + } + SetFrameAt(x, y, 108 + 18 * randomFrame, 0); + return; + } + else if (downSim == Similarity.MergeLink) + { + if (rightSim == Similarity.Same) + { + SetFrameAt(x, y, 162, 18 * randomFrame); + return; + } + else if (rightSim == Similarity.MergeLink) + { + SetFrameAt(x, y, 162 + 18 * randomFrame, 54); + return; + } + mergedDown = true; + SetFrameAt(x, y, 108, 90 + 18 * randomFrame); + return; + } + if (rightSim == Similarity.Same) + { + SetFrameAt(x, y, 162, 18 * randomFrame); + return; + } + else if (rightSim == Similarity.MergeLink) + { + mergedRight = true; + SetFrameAt(x, y, 54 + 18 * randomFrame, 234); + return; + } + SetFrameAt(x, y, 162 + 18 * randomFrame, 54); + return; + } + else if (leftSim == Similarity.MergeLink) + { + if (upSim == Similarity.Same) + { + if (downSim == Similarity.Same) + { + if (rightSim == Similarity.Same) + { + mergedLeft = true; + SetFrameAt(x, y, 162, 126 + 18 * randomFrame); + return; + } + else if (rightSim == Similarity.MergeLink) + { + mergedLeft = true; + mergedRight = true; + SetFrameAt(x, y, 180, 126 + 18 * randomFrame); + return; + } + mergedLeft = true; + SetFrameAt(x, y, 234 + 18 * randomFrame, 54); + return; + } + else if (downSim == Similarity.MergeLink) + { + if (rightSim == Similarity.Same) + { + mergedLeft = mergedDown = true; + SetFrameAt(x, y, 36, 108 + 36 * randomFrame); + return; + } + else if (rightSim == Similarity.MergeLink) + { + mergedLeft = mergedRight = mergedDown = true; + SetFrameAt(x, y, 198, 144 + 18 * randomFrame); + return; + } + SetFrameAt(x, y, 108 + 18 * randomFrame, 54); + return; + } + if (rightSim == Similarity.Same) + { + mergedLeft = true; + SetFrameAt(x, y, 18 * randomFrame, 216); + return; + } + SetFrameAt(x, y, 108 + 18 * randomFrame, 54); + return; + } + else if (upSim == Similarity.MergeLink) + { + if (downSim == Similarity.Same) + { + if (rightSim == Similarity.Same) + { + mergedUp = mergedLeft = true; + SetFrameAt(x, y, 36, 90 + 36 * randomFrame); + return; + } + else if (rightSim == Similarity.MergeLink) + { + mergedLeft = mergedRight = mergedUp = true; + SetFrameAt(x, y, 198, 90 + 18 * randomFrame); + return; + } + SetFrameAt(x, y, 108 + 18 * randomFrame, 0); + return; + } + else if (downSim == Similarity.MergeLink) + { + if (rightSim == Similarity.Same) + { + mergedUp = mergedLeft = mergedDown = true; + SetFrameAt(x, y, 216, 90 + 18 * randomFrame); + return; + } + else if (rightSim == Similarity.MergeLink) + { + mergedDown = mergedLeft = mergedRight = mergedUp = true; + SetFrameAt(x, y, 108 + 18 * randomFrame, 198); + return; + } + SetFrameAt(x, y, 162 + 18 * randomFrame, 54); + return; + } + if (rightSim == Similarity.Same) + { + SetFrameAt(x, y, 162, 18 * randomFrame); + return; + } + SetFrameAt(x, y, 162 + 18 * randomFrame, 54); + return; + } + if (downSim == Similarity.Same) + { + if (rightSim == Similarity.Same) + { + mergedLeft = true; + SetFrameAt(x, y, 18 * randomFrame, 198); + return; + } + else if (rightSim == Similarity.MergeLink) + { + SetFrameAt(x, y, 108 + 18 * randomFrame, 0); + return; + } + SetFrameAt(x, y, 108 + 18 * randomFrame, 0); + return; + } + else if (downSim == Similarity.MergeLink) + { + if (rightSim == Similarity.Same) + { + SetFrameAt(x, y, 162, 18 * randomFrame); + return; + } + else if (rightSim == Similarity.MergeLink) + { + SetFrameAt(x, y, 162 + 18 * randomFrame, 54); + return; + } + SetFrameAt(x, y, 162 + 18 * randomFrame, 54); + return; + } + if (rightSim == Similarity.Same) + { + mergedLeft = true; + SetFrameAt(x, y, 18 * randomFrame, 252); + return; + } + else if (rightSim == Similarity.MergeLink) + { + mergedRight = mergedLeft = true; + SetFrameAt(x, y, 162 + 18 * randomFrame, 198); + return; + } + mergedLeft = true; + SetFrameAt(x, y, 18 * randomFrame, 234); + return; + } + if (upSim == Similarity.Same) + { + if (downSim == Similarity.Same) + { + if (rightSim == Similarity.Same) + { + #region FULL TILE STUFF + if (topLeftSim == Similarity.MergeLink || topRightSim == Similarity.MergeLink || bottomLeftSim == Similarity.MergeLink || bottomRightSim == Similarity.MergeLink) + { + if (bottomRightSim == Similarity.MergeLink) + { + SetFrameAt(x, y, 0, 90 + 36 * randomFrame); + return; + } + else if (bottomLeftSim == Similarity.MergeLink) + { + SetFrameAt(x, y, 18, 90 + 36 * randomFrame); + return; + } + else if (topRightSim == Similarity.MergeLink) + { + SetFrameAt(x, y, 0, 108 + 36 * randomFrame); + return; + } + SetFrameAt(x, y, 18, 108 + 36 * randomFrame); + return; + } + if (topLeftSim == Similarity.Same) + { + if (topRightSim == Similarity.Same) + { + if (bottomLeftSim == Similarity.Same) + { + SetFrameAt(x, y, 18 + 18 * randomFrame, 18); + return; + } + if (bottomRightSim == Similarity.Same) + { + SetFrameAt(x, y, 18 + 18 * randomFrame, 18); + return; + } + SetFrameAt(x, y, 108 + 18 * randomFrame, 36); + return; + } + if (bottomLeftSim == Similarity.Same) + { + if (bottomRightSim == Similarity.Same) + { + if (topRightSim == Similarity.MergeLink) + { + SetFrameAt(x, y, 0, 108 + 36 * randomFrame); + return; + } + SetFrameAt(x, y, 18 + 18 * randomFrame, 18); + return; + } + SetFrameAt(x, y, 198, 18 * randomFrame); + return; + } + } + else if (topLeftSim == Similarity.None) + { + if (topRightSim == Similarity.Same) + { + if (bottomRightSim == Similarity.Same) + { + if (bottomLeftSim == Similarity.Same) + { + SetFrameAt(x, y, 18 + 18 * randomFrame, 18); + return; + } + SetFrameAt(x, y, 18 + 18 * randomFrame, 18); + return; + } + if (bottomLeftSim == Similarity.Same) + { + SetFrameAt(x, y, 18 + 18 * randomFrame, 18); + return; + } + } + SetFrameAt(x, y, 18 + 18 * randomFrame, 18); + return; + } + SetFrameAt(x, y, 18 + 18 * randomFrame, 18); + return; + #endregion + } + else if (rightSim == Similarity.MergeLink) + { + mergedRight = true; + SetFrameAt(x, y, 144, 126 + 18 * randomFrame); + return; + } + SetFrameAt(x, y, 72, 18 * randomFrame); + return; + } + else if (downSim == Similarity.MergeLink) + { + if (rightSim == Similarity.Same) + { + mergedDown = true; + SetFrameAt(x, y, 144 + 18 * randomFrame, 90); + return; + } + else if (rightSim == Similarity.MergeLink) + { + mergedDown = mergedRight = true; + SetFrameAt(x, y, 54, 108 + 36 * randomFrame); + return; + } + mergedDown = true; + SetFrameAt(x, y, 90, 90 + 18 * randomFrame); + return; + } + if (rightSim == Similarity.Same) + { + SetFrameAt(x, y, 18 + 18 * randomFrame, 36); + return; + } + else if (rightSim == Similarity.MergeLink) + { + mergedRight = true; + SetFrameAt(x, y, 54 + 18 * randomFrame, 216); + return; + } + SetFrameAt(x, y, 18 + 36 * randomFrame, 72); + return; + } + else if (upSim == Similarity.MergeLink) + { + if (downSim == Similarity.Same) + { + if (rightSim == Similarity.Same) + { + mergedUp = true; + SetFrameAt(x, y, 144 + 18 * randomFrame, 108); + return; + } + else if (rightSim == Similarity.MergeLink) + { + mergedRight = mergedUp = true; + SetFrameAt(x, y, 54, 90 + 36 * randomFrame); + return; + } + mergedUp = true; + SetFrameAt(x, y, 90, 144 + 18 * randomFrame); + return; + } + else if (downSim == Similarity.MergeLink) + { + if (rightSim == Similarity.Same) + { + mergedUp = mergedDown = true; + SetFrameAt(x, y, 144 + 18 * randomFrame, 180); + return; + } + else if (rightSim == Similarity.MergeLink) + { + mergedUp = mergedRight = mergedDown = true; + SetFrameAt(x, y, 216, 144 + 18 * randomFrame); + return; + } + SetFrameAt(x, y, 216, 18 * randomFrame); + return; + } + if (rightSim == Similarity.Same) + { + mergedUp = true; + SetFrameAt(x, y, 234 + 18 * randomFrame, 18); + return; + } + SetFrameAt(x, y, 216, 18 * randomFrame); + return; + } + if (downSim == Similarity.Same) + { + if (rightSim == Similarity.Same) + { + SetFrameAt(x, y, 18 + 18 * randomFrame, 0); + return; + } + else if (rightSim == Similarity.MergeLink) + { + mergedRight = true; + SetFrameAt(x, y, 54 + 18 * randomFrame, 198); + return; + } + SetFrameAt(x, y, 18 + 36 * randomFrame, 54); + return; + } + else if (downSim == Similarity.MergeLink) + { + if (rightSim == Similarity.Same) + { + mergedDown = true; + SetFrameAt(x, y, 234 + 18 * randomFrame, 0); + return; + } + SetFrameAt(x, y, 216, 18 * randomFrame); + return; + } + if (rightSim == Similarity.Same) + { + SetFrameAt(x, y, 108 + 18 * randomFrame, 72); + return; + } + else if (rightSim == Similarity.MergeLink) + { + mergedRight = true; + SetFrameAt(x, y, 54 + 18 * randomFrame, 252); + return; + } + SetFrameAt(x, y, 216, 18 * randomFrame); + return; + } + + private static void SetFrameAt(int x, int y, int frameX, int frameY) + { + Main.tile[x, y].frameX = (short)frameX; + Main.tile[x, y].frameY = (short)frameY; + } + + private static Similarity GetSimilarity(Tile check, int myType, int mergeType) + { + if (!check.active()) return Similarity.None; + + if (check.type == myType || Main.tileMerge[myType][check.type]) + return Similarity.Same; + else if (check.type == mergeType) + return Similarity.MergeLink; + + return Similarity.None; + } + + private static string StringWriter(params object[] strings) + { + string s = ""; + for (int i = 0; i < strings.Length; i++) + { + s += strings[i].ToString(); + if (i != strings.Length - 1) + { + s += ", "; + } + } + return s; + } + } } diff --git a/ExtraTextures/AmidiasBubble.png b/ExtraTextures/AmidiasBubble.png new file mode 100644 index 0000000000..fbadc406dc Binary files /dev/null and b/ExtraTextures/AmidiasBubble.png differ diff --git a/ExtraTextures/Chains/ClamCrusherChain.png b/ExtraTextures/Chains/ClamCrusherChain.png new file mode 100644 index 0000000000..a875319b40 Binary files /dev/null and b/ExtraTextures/Chains/ClamCrusherChain.png differ diff --git a/ExtraTextures/Chains/UrchinFlailChain.png b/ExtraTextures/Chains/UrchinFlailChain.png new file mode 100644 index 0000000000..34510cfce7 Binary files /dev/null and b/ExtraTextures/Chains/UrchinFlailChain.png differ diff --git a/Gores/Amidias/Amidias.png b/Gores/Amidias/Amidias.png new file mode 100644 index 0000000000..2831024732 Binary files /dev/null and b/Gores/Amidias/Amidias.png differ diff --git a/Gores/Amidias/Amidias2.png b/Gores/Amidias/Amidias2.png new file mode 100644 index 0000000000..bb1ef79ddd Binary files /dev/null and b/Gores/Amidias/Amidias2.png differ diff --git a/Gores/Amidias/Amidias3.png b/Gores/Amidias/Amidias3.png new file mode 100644 index 0000000000..6ae80af11e Binary files /dev/null and b/Gores/Amidias/Amidias3.png differ diff --git a/Gores/Amidias/Amidias4.png b/Gores/Amidias/Amidias4.png new file mode 100644 index 0000000000..d0c7cf81e3 Binary files /dev/null and b/Gores/Amidias/Amidias4.png differ diff --git a/Gores/AquaticScourgeGores/ASBody.png b/Gores/AquaticScourgeGores/ASBody.png new file mode 100644 index 0000000000..fe7f109e87 Binary files /dev/null and b/Gores/AquaticScourgeGores/ASBody.png differ diff --git a/Gores/AquaticScourgeGores/ASBody2.png b/Gores/AquaticScourgeGores/ASBody2.png new file mode 100644 index 0000000000..7dc2cbe155 Binary files /dev/null and b/Gores/AquaticScourgeGores/ASBody2.png differ diff --git a/Gores/AquaticScourgeGores/ASBody3.png b/Gores/AquaticScourgeGores/ASBody3.png new file mode 100644 index 0000000000..0fd916f87f Binary files /dev/null and b/Gores/AquaticScourgeGores/ASBody3.png differ diff --git a/Gores/AquaticScourgeGores/ASBody4.png b/Gores/AquaticScourgeGores/ASBody4.png new file mode 100644 index 0000000000..0efe8462b5 Binary files /dev/null and b/Gores/AquaticScourgeGores/ASBody4.png differ diff --git a/Gores/AquaticScourgeGores/ASBodyAlt.png b/Gores/AquaticScourgeGores/ASBodyAlt.png new file mode 100644 index 0000000000..4b15f8e302 Binary files /dev/null and b/Gores/AquaticScourgeGores/ASBodyAlt.png differ diff --git a/Gores/AquaticScourgeGores/ASBodyAlt2.png b/Gores/AquaticScourgeGores/ASBodyAlt2.png new file mode 100644 index 0000000000..974733a7b2 Binary files /dev/null and b/Gores/AquaticScourgeGores/ASBodyAlt2.png differ diff --git a/Gores/AquaticScourgeGores/ASBodyAlt3.png b/Gores/AquaticScourgeGores/ASBodyAlt3.png new file mode 100644 index 0000000000..83588fe446 Binary files /dev/null and b/Gores/AquaticScourgeGores/ASBodyAlt3.png differ diff --git a/Gores/AquaticScourgeGores/ASHead.png b/Gores/AquaticScourgeGores/ASHead.png new file mode 100644 index 0000000000..5e71d8d1cc Binary files /dev/null and b/Gores/AquaticScourgeGores/ASHead.png differ diff --git a/Gores/AquaticScourgeGores/ASTail.png b/Gores/AquaticScourgeGores/ASTail.png new file mode 100644 index 0000000000..9dd55e5611 Binary files /dev/null and b/Gores/AquaticScourgeGores/ASTail.png differ diff --git a/Gores/AquaticScourgeGores/ASTail2.png b/Gores/AquaticScourgeGores/ASTail2.png new file mode 100644 index 0000000000..1c34bea878 Binary files /dev/null and b/Gores/AquaticScourgeGores/ASTail2.png differ diff --git a/Gores/AquaticScourgeGores/AquaticParasite1.png b/Gores/AquaticScourgeGores/AquaticParasite1.png new file mode 100644 index 0000000000..f652388f71 Binary files /dev/null and b/Gores/AquaticScourgeGores/AquaticParasite1.png differ diff --git a/Gores/AquaticScourgeGores/AquaticParasite2.png b/Gores/AquaticScourgeGores/AquaticParasite2.png new file mode 100644 index 0000000000..82a0aa1720 Binary files /dev/null and b/Gores/AquaticScourgeGores/AquaticParasite2.png differ diff --git a/Gores/AquaticScourgeGores/AquaticSeekerBody.png b/Gores/AquaticScourgeGores/AquaticSeekerBody.png new file mode 100644 index 0000000000..fb1978fced Binary files /dev/null and b/Gores/AquaticScourgeGores/AquaticSeekerBody.png differ diff --git a/Gores/AquaticScourgeGores/AquaticSeekerHead.png b/Gores/AquaticScourgeGores/AquaticSeekerHead.png new file mode 100644 index 0000000000..ab7b02b78b Binary files /dev/null and b/Gores/AquaticScourgeGores/AquaticSeekerHead.png differ diff --git a/Gores/AquaticScourgeGores/AquaticSeekerTail.png b/Gores/AquaticScourgeGores/AquaticSeekerTail.png new file mode 100644 index 0000000000..f4da7fb3a7 Binary files /dev/null and b/Gores/AquaticScourgeGores/AquaticSeekerTail.png differ diff --git a/Gores/AquaticScourgeGores/AquaticUrchin.png b/Gores/AquaticScourgeGores/AquaticUrchin.png new file mode 100644 index 0000000000..356efb49f0 Binary files /dev/null and b/Gores/AquaticScourgeGores/AquaticUrchin.png differ diff --git a/Gores/AquaticScourgeGores/AquaticUrchin2.png b/Gores/AquaticScourgeGores/AquaticUrchin2.png new file mode 100644 index 0000000000..44a021dbe4 Binary files /dev/null and b/Gores/AquaticScourgeGores/AquaticUrchin2.png differ diff --git a/Gores/AquaticScourgeGores/AquaticUrchin3.png b/Gores/AquaticScourgeGores/AquaticUrchin3.png new file mode 100644 index 0000000000..8d8532f288 Binary files /dev/null and b/Gores/AquaticScourgeGores/AquaticUrchin3.png differ diff --git a/Gores/BlindedAngler/BlindAnglerGore1.png b/Gores/BlindedAngler/BlindAnglerGore1.png new file mode 100644 index 0000000000..8becc53bd0 Binary files /dev/null and b/Gores/BlindedAngler/BlindAnglerGore1.png differ diff --git a/Gores/BlindedAngler/BlindAnglerGore2.png b/Gores/BlindedAngler/BlindAnglerGore2.png new file mode 100644 index 0000000000..833c94b601 Binary files /dev/null and b/Gores/BlindedAngler/BlindAnglerGore2.png differ diff --git a/Gores/BlindedAngler/BlindAnglerGore3.png b/Gores/BlindedAngler/BlindAnglerGore3.png new file mode 100644 index 0000000000..a4c5766fdb Binary files /dev/null and b/Gores/BlindedAngler/BlindAnglerGore3.png differ diff --git a/Gores/BlindedAngler/BlindAnglerGore4.png b/Gores/BlindedAngler/BlindAnglerGore4.png new file mode 100644 index 0000000000..2002e2a9ee Binary files /dev/null and b/Gores/BlindedAngler/BlindAnglerGore4.png differ diff --git a/Gores/CalamitasGores/Calamitas.png b/Gores/CalamitasGores/Calamitas.png new file mode 100644 index 0000000000..de7a52955a Binary files /dev/null and b/Gores/CalamitasGores/Calamitas.png differ diff --git a/Gores/CalamitasGores/Calamitas2.png b/Gores/CalamitasGores/Calamitas2.png new file mode 100644 index 0000000000..4fc180848d Binary files /dev/null and b/Gores/CalamitasGores/Calamitas2.png differ diff --git a/Gores/CalamitasGores/Calamitas3.png b/Gores/CalamitasGores/Calamitas3.png new file mode 100644 index 0000000000..6c145d969e Binary files /dev/null and b/Gores/CalamitasGores/Calamitas3.png differ diff --git a/Gores/CalamitasGores/Calamitas4.png b/Gores/CalamitasGores/Calamitas4.png new file mode 100644 index 0000000000..bec0c8d05a Binary files /dev/null and b/Gores/CalamitasGores/Calamitas4.png differ diff --git a/Gores/CalamitasGores/Calamitas5.png b/Gores/CalamitasGores/Calamitas5.png new file mode 100644 index 0000000000..add2bf9081 Binary files /dev/null and b/Gores/CalamitasGores/Calamitas5.png differ diff --git a/Gores/CalamitasGores/Calamitas6.png b/Gores/CalamitasGores/Calamitas6.png new file mode 100644 index 0000000000..55bf6b7d43 Binary files /dev/null and b/Gores/CalamitasGores/Calamitas6.png differ diff --git a/Gores/CalamitasGores/Cataclysm.png b/Gores/CalamitasGores/Cataclysm.png new file mode 100644 index 0000000000..99035c01e2 Binary files /dev/null and b/Gores/CalamitasGores/Cataclysm.png differ diff --git a/Gores/CalamitasGores/Cataclysm2.png b/Gores/CalamitasGores/Cataclysm2.png new file mode 100644 index 0000000000..3d481b899c Binary files /dev/null and b/Gores/CalamitasGores/Cataclysm2.png differ diff --git a/Gores/CalamitasGores/Cataclysm3.png b/Gores/CalamitasGores/Cataclysm3.png new file mode 100644 index 0000000000..7bc87fb841 Binary files /dev/null and b/Gores/CalamitasGores/Cataclysm3.png differ diff --git a/Gores/CalamitasGores/Cataclysm4.png b/Gores/CalamitasGores/Cataclysm4.png new file mode 100644 index 0000000000..92d0c64320 Binary files /dev/null and b/Gores/CalamitasGores/Cataclysm4.png differ diff --git a/Gores/CalamitasGores/Cataclysm5.png b/Gores/CalamitasGores/Cataclysm5.png new file mode 100644 index 0000000000..dbe25a5eb5 Binary files /dev/null and b/Gores/CalamitasGores/Cataclysm5.png differ diff --git a/Gores/CalamitasGores/Catastrophe.png b/Gores/CalamitasGores/Catastrophe.png new file mode 100644 index 0000000000..6348aa4404 Binary files /dev/null and b/Gores/CalamitasGores/Catastrophe.png differ diff --git a/Gores/CalamitasGores/Catastrophe2.png b/Gores/CalamitasGores/Catastrophe2.png new file mode 100644 index 0000000000..2c02f2fa98 Binary files /dev/null and b/Gores/CalamitasGores/Catastrophe2.png differ diff --git a/Gores/CalamitasGores/Catastrophe3.png b/Gores/CalamitasGores/Catastrophe3.png new file mode 100644 index 0000000000..bd008ee9a1 Binary files /dev/null and b/Gores/CalamitasGores/Catastrophe3.png differ diff --git a/Gores/CalamitasGores/Catastrophe4.png b/Gores/CalamitasGores/Catastrophe4.png new file mode 100644 index 0000000000..7687a4557a Binary files /dev/null and b/Gores/CalamitasGores/Catastrophe4.png differ diff --git a/Gores/CalamitasGores/Catastrophe5.png b/Gores/CalamitasGores/Catastrophe5.png new file mode 100644 index 0000000000..804b999751 Binary files /dev/null and b/Gores/CalamitasGores/Catastrophe5.png differ diff --git a/Gores/CalamitasGores/LifeSeeker.png b/Gores/CalamitasGores/LifeSeeker.png new file mode 100644 index 0000000000..398861be36 Binary files /dev/null and b/Gores/CalamitasGores/LifeSeeker.png differ diff --git a/Gores/CalamitasGores/LifeSeeker2.png b/Gores/CalamitasGores/LifeSeeker2.png new file mode 100644 index 0000000000..d51c94f12d Binary files /dev/null and b/Gores/CalamitasGores/LifeSeeker2.png differ diff --git a/Gores/CalamitasGores/LifeSeeker3.png b/Gores/CalamitasGores/LifeSeeker3.png new file mode 100644 index 0000000000..dd3f95427d Binary files /dev/null and b/Gores/CalamitasGores/LifeSeeker3.png differ diff --git a/Gores/CalamitasGores/SoulSlurper.png b/Gores/CalamitasGores/SoulSlurper.png new file mode 100644 index 0000000000..63911dc0f4 Binary files /dev/null and b/Gores/CalamitasGores/SoulSlurper.png differ diff --git a/Gores/CalamitasGores/SoulSlurper2.png b/Gores/CalamitasGores/SoulSlurper2.png new file mode 100644 index 0000000000..9f7519fd46 Binary files /dev/null and b/Gores/CalamitasGores/SoulSlurper2.png differ diff --git a/Gores/CalamitasGores/SoulSlurper3.png b/Gores/CalamitasGores/SoulSlurper3.png new file mode 100644 index 0000000000..d752cbe4e8 Binary files /dev/null and b/Gores/CalamitasGores/SoulSlurper3.png differ diff --git a/Gores/CalamitasGores/SoulSlurper4.png b/Gores/CalamitasGores/SoulSlurper4.png new file mode 100644 index 0000000000..2d6924f39f Binary files /dev/null and b/Gores/CalamitasGores/SoulSlurper4.png differ diff --git a/Gores/Clam/Clam1.png b/Gores/Clam/Clam1.png new file mode 100644 index 0000000000..ba0409ad2a Binary files /dev/null and b/Gores/Clam/Clam1.png differ diff --git a/Gores/Clam/Clam2.png b/Gores/Clam/Clam2.png new file mode 100644 index 0000000000..691e235b12 Binary files /dev/null and b/Gores/Clam/Clam2.png differ diff --git a/Gores/Clam/Clam3.png b/Gores/Clam/Clam3.png new file mode 100644 index 0000000000..400b4afe58 Binary files /dev/null and b/Gores/Clam/Clam3.png differ diff --git a/Gores/EutrophicRay/RayGore1.png b/Gores/EutrophicRay/RayGore1.png new file mode 100644 index 0000000000..3ace444fd4 Binary files /dev/null and b/Gores/EutrophicRay/RayGore1.png differ diff --git a/Gores/EutrophicRay/RayGore2.png b/Gores/EutrophicRay/RayGore2.png new file mode 100644 index 0000000000..3ff64c48fd Binary files /dev/null and b/Gores/EutrophicRay/RayGore2.png differ diff --git a/Gores/EutrophicRay/RayGore3.png b/Gores/EutrophicRay/RayGore3.png new file mode 100644 index 0000000000..777469c5cd Binary files /dev/null and b/Gores/EutrophicRay/RayGore3.png differ diff --git a/Gores/EutrophicRay/RayGore4.png b/Gores/EutrophicRay/RayGore4.png new file mode 100644 index 0000000000..8764f51981 Binary files /dev/null and b/Gores/EutrophicRay/RayGore4.png differ diff --git a/Gores/GiantClam/GiantClam1.png b/Gores/GiantClam/GiantClam1.png new file mode 100644 index 0000000000..68f1fa95e2 Binary files /dev/null and b/Gores/GiantClam/GiantClam1.png differ diff --git a/Gores/GiantClam/GiantClam2.png b/Gores/GiantClam/GiantClam2.png new file mode 100644 index 0000000000..711ecf8c4a Binary files /dev/null and b/Gores/GiantClam/GiantClam2.png differ diff --git a/Gores/GiantClam/GiantClam3.png b/Gores/GiantClam/GiantClam3.png new file mode 100644 index 0000000000..d30d6ef144 Binary files /dev/null and b/Gores/GiantClam/GiantClam3.png differ diff --git a/Gores/GiantClam/GiantClam4.png b/Gores/GiantClam/GiantClam4.png new file mode 100644 index 0000000000..5e635276bc Binary files /dev/null and b/Gores/GiantClam/GiantClam4.png differ diff --git a/Gores/GiantClam/GiantClam5.png b/Gores/GiantClam/GiantClam5.png new file mode 100644 index 0000000000..71705c31f0 Binary files /dev/null and b/Gores/GiantClam/GiantClam5.png differ diff --git a/Gores/HiveMindGores/DankCreeperGore.png b/Gores/HiveMindGores/DankCreeperGore.png new file mode 100644 index 0000000000..459b5ba81f Binary files /dev/null and b/Gores/HiveMindGores/DankCreeperGore.png differ diff --git a/Gores/HiveMindGores/DankCreeperGore2.png b/Gores/HiveMindGores/DankCreeperGore2.png new file mode 100644 index 0000000000..b1191eeed5 Binary files /dev/null and b/Gores/HiveMindGores/DankCreeperGore2.png differ diff --git a/Gores/HiveMindGores/DankCreeperGore3.png b/Gores/HiveMindGores/DankCreeperGore3.png new file mode 100644 index 0000000000..562b12d0bc Binary files /dev/null and b/Gores/HiveMindGores/DankCreeperGore3.png differ diff --git a/Gores/HiveMindGores/HiveMindGore.png b/Gores/HiveMindGores/HiveMindGore.png new file mode 100644 index 0000000000..e3f549d02b Binary files /dev/null and b/Gores/HiveMindGores/HiveMindGore.png differ diff --git a/Gores/HiveMindGores/HiveMindGore2.png b/Gores/HiveMindGores/HiveMindGore2.png new file mode 100644 index 0000000000..c5d32e5861 Binary files /dev/null and b/Gores/HiveMindGores/HiveMindGore2.png differ diff --git a/Gores/HiveMindGores/HiveMindGore3.png b/Gores/HiveMindGores/HiveMindGore3.png new file mode 100644 index 0000000000..abd2e50ff2 Binary files /dev/null and b/Gores/HiveMindGores/HiveMindGore3.png differ diff --git a/Gores/HiveMindGores/HiveMindGore4.png b/Gores/HiveMindGores/HiveMindGore4.png new file mode 100644 index 0000000000..34bdd22b3b Binary files /dev/null and b/Gores/HiveMindGores/HiveMindGore4.png differ diff --git a/Gores/HiveMindGores/HiveMindP2Gore.png b/Gores/HiveMindGores/HiveMindP2Gore.png new file mode 100644 index 0000000000..eb2c3706bb Binary files /dev/null and b/Gores/HiveMindGores/HiveMindP2Gore.png differ diff --git a/Gores/HiveMindGores/HiveMindP2Gore2.png b/Gores/HiveMindGores/HiveMindP2Gore2.png new file mode 100644 index 0000000000..6890121fb5 Binary files /dev/null and b/Gores/HiveMindGores/HiveMindP2Gore2.png differ diff --git a/Gores/HiveMindGores/HiveMindP2Gore3.png b/Gores/HiveMindGores/HiveMindP2Gore3.png new file mode 100644 index 0000000000..55129b743b Binary files /dev/null and b/Gores/HiveMindGores/HiveMindP2Gore3.png differ diff --git a/Gores/HiveMindGores/HiveMindP2Gore4.png b/Gores/HiveMindGores/HiveMindP2Gore4.png new file mode 100644 index 0000000000..6382073458 Binary files /dev/null and b/Gores/HiveMindGores/HiveMindP2Gore4.png differ diff --git a/Gores/HiveMindGores/HiveMindP2Gore5.png b/Gores/HiveMindGores/HiveMindP2Gore5.png new file mode 100644 index 0000000000..8ef7210733 Binary files /dev/null and b/Gores/HiveMindGores/HiveMindP2Gore5.png differ diff --git a/Gores/HiveMindGores/HiveMindP2Gore6.png b/Gores/HiveMindGores/HiveMindP2Gore6.png new file mode 100644 index 0000000000..b7e821b1a7 Binary files /dev/null and b/Gores/HiveMindGores/HiveMindP2Gore6.png differ diff --git a/Gores/Polt Gore 1.png b/Gores/Polt.png similarity index 100% rename from Gores/Polt Gore 1.png rename to Gores/Polt.png diff --git a/Gores/Polt gore 2.png b/Gores/Polt2.png similarity index 100% rename from Gores/Polt gore 2.png rename to Gores/Polt2.png diff --git a/Gores/Polt gore 3.png b/Gores/Polt3.png similarity index 100% rename from Gores/Polt gore 3.png rename to Gores/Polt3.png diff --git a/Gores/Polt gore 4.png b/Gores/Polt4.png similarity index 100% rename from Gores/Polt gore 4.png rename to Gores/Polt4.png diff --git a/Gores/Polt gore 5.png b/Gores/Polt5.png similarity index 100% rename from Gores/Polt gore 5.png rename to Gores/Polt5.png diff --git a/Gores/PrismTurtle/PrismTurtleGore1.png b/Gores/PrismTurtle/PrismTurtleGore1.png new file mode 100644 index 0000000000..1446f7794a Binary files /dev/null and b/Gores/PrismTurtle/PrismTurtleGore1.png differ diff --git a/Gores/PrismTurtle/PrismTurtleGore2.png b/Gores/PrismTurtle/PrismTurtleGore2.png new file mode 100644 index 0000000000..b2fd0ca380 Binary files /dev/null and b/Gores/PrismTurtle/PrismTurtleGore2.png differ diff --git a/Gores/PrismTurtle/PrismTurtleGore3.png b/Gores/PrismTurtle/PrismTurtleGore3.png new file mode 100644 index 0000000000..45487321c7 Binary files /dev/null and b/Gores/PrismTurtle/PrismTurtleGore3.png differ diff --git a/Gores/PrismTurtle/PrismTurtleGore4.png b/Gores/PrismTurtle/PrismTurtleGore4.png new file mode 100644 index 0000000000..be6c485878 Binary files /dev/null and b/Gores/PrismTurtle/PrismTurtleGore4.png differ diff --git a/Gores/PrismTurtle/PrismTurtleGore5.png b/Gores/PrismTurtle/PrismTurtleGore5.png new file mode 100644 index 0000000000..55d6e76bee Binary files /dev/null and b/Gores/PrismTurtle/PrismTurtleGore5.png differ diff --git a/Gores/ProfanedGuardianBossGores/ProfanedGuardianBossA.png b/Gores/ProfanedGuardianBossGores/ProfanedGuardianBossA.png new file mode 100644 index 0000000000..378884b497 Binary files /dev/null and b/Gores/ProfanedGuardianBossGores/ProfanedGuardianBossA.png differ diff --git a/Gores/ProfanedGuardianBossGores/ProfanedGuardianBossA2.png b/Gores/ProfanedGuardianBossGores/ProfanedGuardianBossA2.png new file mode 100644 index 0000000000..cf6fea2514 Binary files /dev/null and b/Gores/ProfanedGuardianBossGores/ProfanedGuardianBossA2.png differ diff --git a/Gores/ProfanedGuardianBossGores/ProfanedGuardianBossA3.png b/Gores/ProfanedGuardianBossGores/ProfanedGuardianBossA3.png new file mode 100644 index 0000000000..127eb77b75 Binary files /dev/null and b/Gores/ProfanedGuardianBossGores/ProfanedGuardianBossA3.png differ diff --git a/Gores/ProfanedGuardianBossGores/ProfanedGuardianBossA4.png b/Gores/ProfanedGuardianBossGores/ProfanedGuardianBossA4.png new file mode 100644 index 0000000000..baea77123d Binary files /dev/null and b/Gores/ProfanedGuardianBossGores/ProfanedGuardianBossA4.png differ diff --git a/Gores/ProfanedGuardianBossGores/ProfanedGuardianBossH.png b/Gores/ProfanedGuardianBossGores/ProfanedGuardianBossH.png new file mode 100644 index 0000000000..181189a78e Binary files /dev/null and b/Gores/ProfanedGuardianBossGores/ProfanedGuardianBossH.png differ diff --git a/Gores/ProfanedGuardianBossGores/ProfanedGuardianBossH2.png b/Gores/ProfanedGuardianBossGores/ProfanedGuardianBossH2.png new file mode 100644 index 0000000000..e6df4d36ae Binary files /dev/null and b/Gores/ProfanedGuardianBossGores/ProfanedGuardianBossH2.png differ diff --git a/Gores/ProfanedGuardianBossGores/ProfanedGuardianBossH3.png b/Gores/ProfanedGuardianBossGores/ProfanedGuardianBossH3.png new file mode 100644 index 0000000000..1f436492ca Binary files /dev/null and b/Gores/ProfanedGuardianBossGores/ProfanedGuardianBossH3.png differ diff --git a/Gores/ProfanedGuardianBossGores/ProfanedGuardianBossH4.png b/Gores/ProfanedGuardianBossGores/ProfanedGuardianBossH4.png new file mode 100644 index 0000000000..f454bed3d3 Binary files /dev/null and b/Gores/ProfanedGuardianBossGores/ProfanedGuardianBossH4.png differ diff --git a/Gores/ProfanedGuardianBossGores/ProfanedGuardianBossH5.png b/Gores/ProfanedGuardianBossGores/ProfanedGuardianBossH5.png new file mode 100644 index 0000000000..6cc0ba0e18 Binary files /dev/null and b/Gores/ProfanedGuardianBossGores/ProfanedGuardianBossH5.png differ diff --git a/Gores/ProfanedGuardianBossGores/ProfanedGuardianBossT.png b/Gores/ProfanedGuardianBossGores/ProfanedGuardianBossT.png new file mode 100644 index 0000000000..94647c29d3 Binary files /dev/null and b/Gores/ProfanedGuardianBossGores/ProfanedGuardianBossT.png differ diff --git a/Gores/ProfanedGuardianBossGores/ProfanedGuardianBossT2.png b/Gores/ProfanedGuardianBossGores/ProfanedGuardianBossT2.png new file mode 100644 index 0000000000..d23ea13f76 Binary files /dev/null and b/Gores/ProfanedGuardianBossGores/ProfanedGuardianBossT2.png differ diff --git a/Gores/ProfanedGuardianBossGores/ProfanedGuardianBossT3.png b/Gores/ProfanedGuardianBossGores/ProfanedGuardianBossT3.png new file mode 100644 index 0000000000..dae6ae4789 Binary files /dev/null and b/Gores/ProfanedGuardianBossGores/ProfanedGuardianBossT3.png differ diff --git a/Gores/ScavengerGores/ScavengerBody.png b/Gores/ScavengerGores/ScavengerBody.png new file mode 100644 index 0000000000..6b04b7d16e Binary files /dev/null and b/Gores/ScavengerGores/ScavengerBody.png differ diff --git a/Gores/ScavengerGores/ScavengerBody2.png b/Gores/ScavengerGores/ScavengerBody2.png new file mode 100644 index 0000000000..3e6ca610ec Binary files /dev/null and b/Gores/ScavengerGores/ScavengerBody2.png differ diff --git a/Gores/ScavengerGores/ScavengerBody3.png b/Gores/ScavengerGores/ScavengerBody3.png new file mode 100644 index 0000000000..82cd094abf Binary files /dev/null and b/Gores/ScavengerGores/ScavengerBody3.png differ diff --git a/Gores/ScavengerGores/ScavengerBody4.png b/Gores/ScavengerGores/ScavengerBody4.png new file mode 100644 index 0000000000..c7acc1c942 Binary files /dev/null and b/Gores/ScavengerGores/ScavengerBody4.png differ diff --git a/Gores/ScavengerGores/ScavengerBody5.png b/Gores/ScavengerGores/ScavengerBody5.png new file mode 100644 index 0000000000..db67b9c1d1 Binary files /dev/null and b/Gores/ScavengerGores/ScavengerBody5.png differ diff --git a/Gores/ScavengerGores/ScavengerClawLeft.png b/Gores/ScavengerGores/ScavengerClawLeft.png new file mode 100644 index 0000000000..4ccbef32e8 Binary files /dev/null and b/Gores/ScavengerGores/ScavengerClawLeft.png differ diff --git a/Gores/ScavengerGores/ScavengerClawLeft2.png b/Gores/ScavengerGores/ScavengerClawLeft2.png new file mode 100644 index 0000000000..97a2053270 Binary files /dev/null and b/Gores/ScavengerGores/ScavengerClawLeft2.png differ diff --git a/Gores/ScavengerGores/ScavengerClawLeft3.png b/Gores/ScavengerGores/ScavengerClawLeft3.png new file mode 100644 index 0000000000..ad1f87dfa3 Binary files /dev/null and b/Gores/ScavengerGores/ScavengerClawLeft3.png differ diff --git a/Gores/ScavengerGores/ScavengerClawRight.png b/Gores/ScavengerGores/ScavengerClawRight.png new file mode 100644 index 0000000000..23c0e71139 Binary files /dev/null and b/Gores/ScavengerGores/ScavengerClawRight.png differ diff --git a/Gores/ScavengerGores/ScavengerClawRight2.png b/Gores/ScavengerGores/ScavengerClawRight2.png new file mode 100644 index 0000000000..e0e44eb98e Binary files /dev/null and b/Gores/ScavengerGores/ScavengerClawRight2.png differ diff --git a/Gores/ScavengerGores/ScavengerHead.png b/Gores/ScavengerGores/ScavengerHead.png new file mode 100644 index 0000000000..1f42183c63 Binary files /dev/null and b/Gores/ScavengerGores/ScavengerHead.png differ diff --git a/Gores/ScavengerGores/ScavengerHead2.png b/Gores/ScavengerGores/ScavengerHead2.png new file mode 100644 index 0000000000..acbd513841 Binary files /dev/null and b/Gores/ScavengerGores/ScavengerHead2.png differ diff --git a/Gores/ScavengerGores/ScavengerHead3.png b/Gores/ScavengerGores/ScavengerHead3.png new file mode 100644 index 0000000000..a70d3412fd Binary files /dev/null and b/Gores/ScavengerGores/ScavengerHead3.png differ diff --git a/Gores/ScavengerGores/ScavengerLegLeft.png b/Gores/ScavengerGores/ScavengerLegLeft.png new file mode 100644 index 0000000000..dce7d3bb41 Binary files /dev/null and b/Gores/ScavengerGores/ScavengerLegLeft.png differ diff --git a/Gores/ScavengerGores/ScavengerLegLeft2.png b/Gores/ScavengerGores/ScavengerLegLeft2.png new file mode 100644 index 0000000000..45f682c182 Binary files /dev/null and b/Gores/ScavengerGores/ScavengerLegLeft2.png differ diff --git a/Gores/ScavengerGores/ScavengerLegRight.png b/Gores/ScavengerGores/ScavengerLegRight.png new file mode 100644 index 0000000000..9451b88995 Binary files /dev/null and b/Gores/ScavengerGores/ScavengerLegRight.png differ diff --git a/Gores/ScavengerGores/ScavengerLegRight2.png b/Gores/ScavengerGores/ScavengerLegRight2.png new file mode 100644 index 0000000000..2edc148566 Binary files /dev/null and b/Gores/ScavengerGores/ScavengerLegRight2.png differ diff --git a/Gores/SeaFloaty/SeaFloatyGore1.png b/Gores/SeaFloaty/SeaFloatyGore1.png new file mode 100644 index 0000000000..f168424afd Binary files /dev/null and b/Gores/SeaFloaty/SeaFloatyGore1.png differ diff --git a/Gores/SeaFloaty/SeaFloatyGore2.png b/Gores/SeaFloaty/SeaFloatyGore2.png new file mode 100644 index 0000000000..2d117496cd Binary files /dev/null and b/Gores/SeaFloaty/SeaFloatyGore2.png differ diff --git a/Gores/SeaFloaty/SeaFloatyGore3.png b/Gores/SeaFloaty/SeaFloatyGore3.png new file mode 100644 index 0000000000..e6d79b947c Binary files /dev/null and b/Gores/SeaFloaty/SeaFloatyGore3.png differ diff --git a/Gores/SeaSerpent/SeaSerpentGore1.png b/Gores/SeaSerpent/SeaSerpentGore1.png new file mode 100644 index 0000000000..828fc5cab8 Binary files /dev/null and b/Gores/SeaSerpent/SeaSerpentGore1.png differ diff --git a/Gores/SeaSerpent/SeaSerpentGore2.png b/Gores/SeaSerpent/SeaSerpentGore2.png new file mode 100644 index 0000000000..e34333cc3a Binary files /dev/null and b/Gores/SeaSerpent/SeaSerpentGore2.png differ diff --git a/Gores/SeaSerpent/SeaSerpentGore3.png b/Gores/SeaSerpent/SeaSerpentGore3.png new file mode 100644 index 0000000000..0835dffcf4 Binary files /dev/null and b/Gores/SeaSerpent/SeaSerpentGore3.png differ diff --git a/Gores/SeaSerpent/SeaSerpentGore4.png b/Gores/SeaSerpent/SeaSerpentGore4.png new file mode 100644 index 0000000000..fc0b44b6b2 Binary files /dev/null and b/Gores/SeaSerpent/SeaSerpentGore4.png differ diff --git a/Gores/SeaSerpent/SeaSerpentGore5.png b/Gores/SeaSerpent/SeaSerpentGore5.png new file mode 100644 index 0000000000..c39cf01434 Binary files /dev/null and b/Gores/SeaSerpent/SeaSerpentGore5.png differ diff --git a/Gores/SirenGores/Siren.png b/Gores/SirenGores/Siren.png new file mode 100644 index 0000000000..5fd3fd11c7 Binary files /dev/null and b/Gores/SirenGores/Siren.png differ diff --git a/Gores/SirenGores/Siren2.png b/Gores/SirenGores/Siren2.png new file mode 100644 index 0000000000..773164636b Binary files /dev/null and b/Gores/SirenGores/Siren2.png differ diff --git a/Gores/SirenGores/Siren3.png b/Gores/SirenGores/Siren3.png new file mode 100644 index 0000000000..5fc6575960 Binary files /dev/null and b/Gores/SirenGores/Siren3.png differ diff --git a/Gores/SirenGores/Siren4.png b/Gores/SirenGores/Siren4.png new file mode 100644 index 0000000000..d819fb0058 Binary files /dev/null and b/Gores/SirenGores/Siren4.png differ diff --git a/Gores/SirenGores/Siren5.png b/Gores/SirenGores/Siren5.png new file mode 100644 index 0000000000..21f1e550d5 Binary files /dev/null and b/Gores/SirenGores/Siren5.png differ diff --git a/Gores/Viruling.png b/Gores/Viruling.png new file mode 100644 index 0000000000..612318698d Binary files /dev/null and b/Gores/Viruling.png differ diff --git a/Gores/Viruling2.png b/Gores/Viruling2.png new file mode 100644 index 0000000000..b43c026fbb Binary files /dev/null and b/Gores/Viruling2.png differ diff --git a/Gores/Viruling3.png b/Gores/Viruling3.png new file mode 100644 index 0000000000..f3fd3a073f Binary files /dev/null and b/Gores/Viruling3.png differ diff --git a/Items/AbyssItems/CloakingGland.cs b/Items/AbyssItems/CloakingGland.cs index f33b552236..0e973e99db 100644 --- a/Items/AbyssItems/CloakingGland.cs +++ b/Items/AbyssItems/CloakingGland.cs @@ -21,8 +21,8 @@ namespace CalamityMod.Items.AbyssItems item.width = 26; item.height = 26; item.maxStack = 999; - item.value = 3000; - item.rare = 3; + item.value = Item.buyPrice(0, 2, 0, 0); + item.rare = 3; } } } \ No newline at end of file diff --git a/Items/AbyssItems/DepthCells.cs b/Items/AbyssItems/DepthCells.cs index 6081e51df4..21f87db438 100644 --- a/Items/AbyssItems/DepthCells.cs +++ b/Items/AbyssItems/DepthCells.cs @@ -22,8 +22,8 @@ namespace CalamityMod.Items.AbyssItems item.width = 26; item.height = 26; item.maxStack = 999; - item.value = 10000; - item.rare = 3; + item.value = Item.buyPrice(0, 2, 0, 0); + item.rare = 3; } } } \ No newline at end of file diff --git a/Items/AbyssItems/Lumenite.cs b/Items/AbyssItems/Lumenite.cs index 1be1a07380..dfbc77b1d6 100644 --- a/Items/AbyssItems/Lumenite.cs +++ b/Items/AbyssItems/Lumenite.cs @@ -29,8 +29,8 @@ namespace CalamityMod.Items.AbyssItems item.width = 26; item.height = 26; item.maxStack = 999; - item.value = 10000; - item.rare = 3; + item.value = Item.buyPrice(0, 2, 0, 0); + item.rare = 3; } } } \ No newline at end of file diff --git a/Items/AbyssItems/LumenousAmulet.cs b/Items/AbyssItems/LumenousAmulet.cs index 18a053234d..b71fbfef95 100644 --- a/Items/AbyssItems/LumenousAmulet.cs +++ b/Items/AbyssItems/LumenousAmulet.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.AbyssItems { DisplayName.SetDefault("Lumenous Amulet"); Tooltip.SetDefault("Attacks inflict the Crush Depth debuff\n" + - "While in the abyss you gain 15% increased max life\n" + + "While in the abyss you gain 25% increased max life\n" + "Provides a moderate amount of light in the abyss"); } diff --git a/Items/AbyssItems/ReaperTooth.cs b/Items/AbyssItems/ReaperTooth.cs index b9888ba420..a703dd1086 100644 --- a/Items/AbyssItems/ReaperTooth.cs +++ b/Items/AbyssItems/ReaperTooth.cs @@ -22,8 +22,8 @@ namespace CalamityMod.Items.AbyssItems item.width = 26; item.height = 26; item.maxStack = 999; - item.value = 100000; - item.rare = 8; + item.value = Item.buyPrice(0, 6, 0, 0); + item.rare = 10; } } } \ No newline at end of file diff --git a/Items/AbyssItems/StrangeOrb.png b/Items/AbyssItems/StrangeOrb.png index 7e552ad1b1..2debd5f599 100644 Binary files a/Items/AbyssItems/StrangeOrb.png and b/Items/AbyssItems/StrangeOrb.png differ diff --git a/Items/AbyssItems/SunkenStew.cs b/Items/AbyssItems/SunkenStew.cs index 6a103291ee..a22fc85053 100644 --- a/Items/AbyssItems/SunkenStew.cs +++ b/Items/AbyssItems/SunkenStew.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Items.AbyssItems item.consumable = true; item.buffType = BuffID.WellFed; item.buffTime = 216000; - item.value = 10000; + item.value = Item.buyPrice(0, 2, 0, 0); } public override bool CanUseItem(Player player) diff --git a/Items/Accessories/AncientFossil.cs b/Items/Accessories/AncientFossil.cs index ae8a9287f4..b77190e189 100644 --- a/Items/Accessories/AncientFossil.cs +++ b/Items/Accessories/AncientFossil.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Accessories item.width = 26; item.height = 26; item.value = Item.buyPrice(0, 3, 0, 0); - item.rare = 2; + item.rare = 1; item.accessory = true; } diff --git a/Items/Accessories/AngelTreads.cs b/Items/Accessories/AngelTreads.cs index 1d7def2f8e..f6d962eb5d 100644 --- a/Items/Accessories/AngelTreads.cs +++ b/Items/Accessories/AngelTreads.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Items.Accessories player.iceSkate = true; player.waterWalk = true; player.fireWalk = true; - player.lavaMax += 420; + player.lavaMax += 240; } public override void AddRecipes() diff --git a/Items/Accessories/ArcanumoftheVoid.cs b/Items/Accessories/ArcanumoftheVoid.cs index c8b0b4bf55..6a0a94d36c 100644 --- a/Items/Accessories/ArcanumoftheVoid.cs +++ b/Items/Accessories/ArcanumoftheVoid.cs @@ -24,18 +24,8 @@ namespace CalamityMod.Items.Accessories item.height = 26; item.value = Item.buyPrice(0, 60, 0, 0); item.accessory = true; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 0); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 13; + } public override void UpdateAccessory(Player player, bool hideVisual) { diff --git a/Items/Accessories/AsgardianAegis.cs b/Items/Accessories/AsgardianAegis.cs index 0c99816098..9c0738fcd1 100644 --- a/Items/Accessories/AsgardianAegis.cs +++ b/Items/Accessories/AsgardianAegis.cs @@ -23,7 +23,6 @@ namespace CalamityMod.Items.Accessories "Press N to activate buffs to all damage, crit chance, and defense\n" + "Activating this buff will reduce your movement speed and increase enemy aggro\n" + "10% damage reduction while submerged in liquid\n" + - "Increased defense by 10 when below 25% life\n" + "Toggle visibility of this accessory to enable/disable the dash"); } @@ -34,18 +33,8 @@ namespace CalamityMod.Items.Accessories item.value = Item.buyPrice(0, 90, 0, 0); //30 gold reforge item.defense = 10; item.accessory = true; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(43, 96, 222); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 14; + } public override void UpdateAccessory(Player player, bool hideVisual) { @@ -69,7 +58,6 @@ namespace CalamityMod.Items.Accessories player.buffImmune[mod.BuffType("BrimstoneFlames")] = true; player.buffImmune[mod.BuffType("HolyLight")] = true; player.buffImmune[mod.BuffType("GlacialState")] = true; - if (player.statLife <= (int)((double)player.statLifeMax2 * 0.25)) { player.statDefense += 10; } if (Collision.DrownCollision(player.position, player.width, player.height, player.gravDir)) { player.endurance += 0.1f; } } diff --git a/Items/Accessories/AsgardianAegis.png b/Items/Accessories/AsgardianAegis.png index 652538ff9d..ecb50c3ce1 100644 Binary files a/Items/Accessories/AsgardianAegis.png and b/Items/Accessories/AsgardianAegis.png differ diff --git a/Items/Accessories/AsgardianAegis_Shield.png b/Items/Accessories/AsgardianAegis_Shield.png index 463df65127..cc76866851 100644 Binary files a/Items/Accessories/AsgardianAegis_Shield.png and b/Items/Accessories/AsgardianAegis_Shield.png differ diff --git a/Items/Accessories/AsgardsValor.cs b/Items/Accessories/AsgardsValor.cs index 0f85b59157..efb38d8ff9 100644 --- a/Items/Accessories/AsgardsValor.cs +++ b/Items/Accessories/AsgardsValor.cs @@ -18,7 +18,6 @@ namespace CalamityMod.Items.Accessories Tooltip.SetDefault("Grants immunity to fire blocks and knockback\n" + "Immune to most debuffs including Brimstone Flames, Holy Flames, and Glacial State\n" + "10% damage reduction while submerged in liquid\n" + - "Increased defense by 10 when below 25% life\n" + "+20 max life\n" + "Grants an improved holy dash\n" + "Can be used to ram enemies\n" + @@ -31,7 +30,7 @@ namespace CalamityMod.Items.Accessories item.height = 44; item.value = Item.buyPrice(0, 45, 0, 0); item.rare = 9; - item.defense = 5; + item.defense = 8; item.accessory = true; } @@ -56,7 +55,6 @@ namespace CalamityMod.Items.Accessories player.buffImmune[mod.BuffType("HolyLight")] = true; player.buffImmune[mod.BuffType("GlacialState")] = true; player.statLifeMax2 += 20; - if (player.statLife <= (int)((double)player.statLifeMax2 * 0.25)) { player.statDefense += 10; } if (Collision.DrownCollision(player.position, player.width, player.height, player.gravDir)) { player.endurance += 0.1f; } } diff --git a/Items/Accessories/AureateWings.cs b/Items/Accessories/AureateWings.cs index 66cd907e5c..4726fa14fe 100644 --- a/Items/Accessories/AureateWings.cs +++ b/Items/Accessories/AureateWings.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Accessories "Horizontal speed: 8\n" + "Acceleration multiplier: 1.5\n" + "Good vertical speed\n" + - "Flight time: 100"); + "Flight time: 80"); } public override void SetDefaults() @@ -88,7 +88,7 @@ namespace CalamityMod.Items.Accessories } } } - player.wingTimeMax = 100; + player.wingTimeMax = 80; } public override void VerticalWingSpeeds(Player player, ref float ascentWhenFalling, ref float ascentWhenRising, ref float maxCanAscendMultiplier, ref float maxAscentMultiplier, ref float constantAscend) diff --git a/Items/Accessories/BadgeofBravery.cs b/Items/Accessories/BadgeofBravery.cs index b3776ed972..79d10a7157 100644 --- a/Items/Accessories/BadgeofBravery.cs +++ b/Items/Accessories/BadgeofBravery.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Accessories public override void SetStaticDefaults() { DisplayName.SetDefault("Badge of Bravery"); - Tooltip.SetDefault("The lower the health the greater the melee speed"); + Tooltip.SetDefault("15% increased melee speed"); } public override void SetDefaults() @@ -23,18 +23,8 @@ namespace CalamityMod.Items.Accessories item.height = 30; item.value = Item.buyPrice(0, 21, 0, 0); item.accessory = true; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 200); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 12; + } public override void UpdateAccessory(Player player, bool hideVisual) { diff --git a/Items/Accessories/BurdenBreaker.cs b/Items/Accessories/BurdenBreaker.cs index 0cfdb925b4..2a68a2154b 100644 --- a/Items/Accessories/BurdenBreaker.cs +++ b/Items/Accessories/BurdenBreaker.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { player.lavaImmune = false; - if (Collision.LavaCollision(player.position, player.width, player.height)) + if (Collision.LavaCollision(player.position, player.width, (player.waterWalk ? (player.height - 6) : player.height))) { player.GetModPlayer(mod).KillPlayer(); } diff --git a/Items/Accessories/CelestialTracers.cs b/Items/Accessories/CelestialTracers.cs index 8902d0ffb2..02806a5166 100644 --- a/Items/Accessories/CelestialTracers.cs +++ b/Items/Accessories/CelestialTracers.cs @@ -35,18 +35,8 @@ namespace CalamityMod.Items.Accessories item.height = 32; item.value = Item.buyPrice(1, 20, 0, 0); item.accessory = true; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(108, 45, 199); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 15; + } public override void UpdateAccessory(Player player, bool hideVisual) { @@ -73,7 +63,7 @@ namespace CalamityMod.Items.Accessories player.iceSkate = true; player.waterWalk = true; player.fireWalk = true; - player.lavaMax += 920; + player.lavaMax += 240; player.wingTimeMax = 280; modPlayer.IBoots = !hideVisual; modPlayer.elysianFire = !hideVisual; diff --git a/Items/Accessories/ChaosAmulet.png b/Items/Accessories/ChaosAmulet.png index 23ed2a3e96..7a2a18356c 100644 Binary files a/Items/Accessories/ChaosAmulet.png and b/Items/Accessories/ChaosAmulet.png differ diff --git a/Items/Accessories/CoreOfTheBloodGod.cs b/Items/Accessories/CoreOfTheBloodGod.cs index 4be918eadd..5b914c92ed 100644 --- a/Items/Accessories/CoreOfTheBloodGod.cs +++ b/Items/Accessories/CoreOfTheBloodGod.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Accessories "7% increased damage\n" + "When below 100 defense you gain 15% increased damage\n" + "Halves enemy contact damage\n" + - "When you take contact damage this effect has a 15 second cooldown\n" + + "When you take contact damage this effect has a 20 second cooldown\n" + "Boosts your max HP by 10%"); } diff --git a/Items/Accessories/DarkSunRing.cs b/Items/Accessories/DarkSunRing.cs index 5e9d880f69..3ee3c1564a 100644 --- a/Items/Accessories/DarkSunRing.cs +++ b/Items/Accessories/DarkSunRing.cs @@ -14,9 +14,9 @@ namespace CalamityMod.Items.Accessories public override void SetStaticDefaults() { DisplayName.SetDefault("Dark Sun Ring"); - Tooltip.SetDefault("Increase to damage, melee speed, life regeneration,\n" + - "defense, pick speed, max minions, and minion knockback\n" + - "During the day the player has +1 life regen\n" + + Tooltip.SetDefault("10% increase to damage, minion knockback, and melee speed\n" + + "+1 life regen, 30% increased pick speed, and +2 max minions\n" + + "During the day the player has +2 life regen\n" + "During the night the player has +20 defense\n" + "Contains the power of the dark sun"); Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 6)); @@ -27,19 +27,11 @@ namespace CalamityMod.Items.Accessories item.width = 26; item.height = 26; item.value = Item.buyPrice(0, 90, 0, 0); + item.defense = 10; + item.lifeRegen = 1; item.accessory = true; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(108, 45, 199); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 15; + } public override void UpdateAccessory(Player player, bool hideVisual) { diff --git a/Items/Accessories/DiscordianWings.png b/Items/Accessories/DiscordianWings.png index 724f184a91..810d842519 100644 Binary files a/Items/Accessories/DiscordianWings.png and b/Items/Accessories/DiscordianWings.png differ diff --git a/Items/Accessories/DiscordianWings_Wings.png b/Items/Accessories/DiscordianWings_Wings.png index 32e387a8c1..5bb88eb502 100644 Binary files a/Items/Accessories/DiscordianWings_Wings.png and b/Items/Accessories/DiscordianWings_Wings.png differ diff --git a/Items/Accessories/DraedonsHeart.cs b/Items/Accessories/DraedonsHeart.cs index 6e155d08b8..3130d6d409 100644 --- a/Items/Accessories/DraedonsHeart.cs +++ b/Items/Accessories/DraedonsHeart.cs @@ -15,10 +15,12 @@ namespace CalamityMod.Items.Accessories { DisplayName.SetDefault("Draedon's Heart"); Tooltip.SetDefault("Gives 10% increased damage while you have the heart attack debuff\n" + + "Increases your chance of getting the heart attack debuff\n" + + "Boosts your damage by 10% and max movement speed and acceleration by 5%\n" + + "Rage mode does more damage\n" + "You gain rage over time\n" + "Gives immunity to the horror debuff\n" + - "Standing still regenerates your life quickly and boosts your defense by 50\n" + - "Nanomachines, son"); + "Standing still regenerates your life quickly and boosts your defense by 25"); Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(5, 7)); } @@ -28,18 +30,8 @@ namespace CalamityMod.Items.Accessories item.height = 26; item.value = Item.buyPrice(0, 60, 0, 0); item.accessory = true; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(108, 45, 199); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 15; + } public override void UpdateAccessory(Player player, bool hideVisual) { @@ -55,8 +47,9 @@ namespace CalamityMod.Items.Accessories recipe.AddIngredient(null, "HeartofDarkness"); recipe.AddIngredient(null, "StressPills"); recipe.AddIngredient(null, "Laudanum"); - recipe.AddIngredient(ItemID.LunarBar, 30); - recipe.AddTile(TileID.LunarCraftingStation); + recipe.AddIngredient(null, "CosmiliteBar", 5); + recipe.AddIngredient(null, "Phantoplasm", 5); + recipe.AddTile(TileID.LunarCraftingStation); recipe.SetResult(this); recipe.AddRecipe(); } diff --git a/Items/Accessories/ElementalGauntlet.cs b/Items/Accessories/ElementalGauntlet.cs index 141ff473fa..5881823117 100644 --- a/Items/Accessories/ElementalGauntlet.cs +++ b/Items/Accessories/ElementalGauntlet.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Accessories Tooltip.SetDefault("Melee attacks and projectiles inflict most debuffs\n" + "15% increased melee speed, damage, and 5% increased melee critical strike chance\n" + "Increased invincibility after taking damage\n" + - "You are immune to lava\n" + + "Temporary immunity to lava\n" + "Increased melee knockback\n" + "Melee attacks have a chance to instantly kill normal enemies"); } @@ -28,18 +28,8 @@ namespace CalamityMod.Items.Accessories item.height = 38; item.value = Item.buyPrice(0, 90, 0, 0); item.accessory = true; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 20; + } public override void UpdateAccessory(Player player, bool hideVisual) { diff --git a/Items/Accessories/ElementalQuiver.cs b/Items/Accessories/ElementalQuiver.cs index c7fce59f1e..da6600030f 100644 --- a/Items/Accessories/ElementalQuiver.cs +++ b/Items/Accessories/ElementalQuiver.cs @@ -26,18 +26,8 @@ namespace CalamityMod.Items.Accessories item.height = 32; item.value = Item.buyPrice(0, 90, 0, 0); item.accessory = true; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 20; + } public override void UpdateAccessory(Player player, bool hideVisual) { diff --git a/Items/Accessories/ElysianTracers.cs b/Items/Accessories/ElysianTracers.cs index ef616921eb..a2399045fe 100644 --- a/Items/Accessories/ElysianTracers.cs +++ b/Items/Accessories/ElysianTracers.cs @@ -34,18 +34,8 @@ namespace CalamityMod.Items.Accessories item.height = 32; item.value = Item.buyPrice(0, 90, 0, 0); item.accessory = true; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(43, 96, 222); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 14; + } public override void UpdateAccessory(Player player, bool hideVisual) { @@ -72,7 +62,7 @@ namespace CalamityMod.Items.Accessories player.iceSkate = true; player.waterWalk = true; player.fireWalk = true; - player.lavaMax += 920; + player.lavaMax += 240; player.wingTimeMax = 160; modPlayer.IBoots = !hideVisual; modPlayer.elysianFire = !hideVisual; diff --git a/Items/Accessories/EtherealTalisman.cs b/Items/Accessories/EtherealTalisman.cs index a55d76a01e..d598b01636 100644 --- a/Items/Accessories/EtherealTalisman.cs +++ b/Items/Accessories/EtherealTalisman.cs @@ -28,18 +28,8 @@ namespace CalamityMod.Items.Accessories item.height = 32; item.value = Item.buyPrice(0, 90, 0, 0); item.accessory = true; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 20; + } public override void UpdateAccessory(Player player, bool hideVisual) { diff --git a/Items/Accessories/EyeoftheStorm.cs b/Items/Accessories/EyeoftheStorm.cs index b6fa077cb9..40594d7f24 100644 --- a/Items/Accessories/EyeoftheStorm.cs +++ b/Items/Accessories/EyeoftheStorm.cs @@ -54,7 +54,7 @@ namespace CalamityMod.Items.Accessories } if (player.ownedProjectileCounts[mod.ProjectileType("CloudyWaifu")] < 1) { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, mod.ProjectileType("CloudyWaifu"), 45, 2f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, mod.ProjectileType("CloudyWaifu"), (int)(45f * player.minionDamage), 2f, Main.myPlayer, 0f, 0f); } } } diff --git a/Items/Accessories/FrigidBulwark.cs b/Items/Accessories/FrigidBulwark.cs index 46ccedc37b..e45239cf28 100644 --- a/Items/Accessories/FrigidBulwark.cs +++ b/Items/Accessories/FrigidBulwark.cs @@ -33,32 +33,8 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { - player.noKnockback = true; - if ((float)player.statLife > (float)player.statLifeMax2 * 0.25f) - { - player.hasPaladinShield = true; - if (player.whoAmI != Main.myPlayer && player.miscCounter % 10 == 0) - { - int myPlayer = Main.myPlayer; - if (Main.player[myPlayer].team == player.team && player.team != 0) - { - float arg = player.position.X - Main.player[myPlayer].position.X; - float num3 = player.position.Y - Main.player[myPlayer].position.Y; - if ((float)Math.Sqrt((double)(arg * arg + num3 * num3)) < 800f) - { - Main.player[myPlayer].AddBuff(43, 20, true); - } - } - } - } - if ((double)player.statLife <= (double)player.statLifeMax2 * 0.5) - { - player.AddBuff(62, 5, true); - } - if ((double)player.statLife <= (double)player.statLifeMax2 * 0.15) - { - player.endurance += 0.05f; - } + CalamityPlayer modPlayer = player.GetModPlayer(mod); + modPlayer.fBulwark = true; } public override void AddRecipes() diff --git a/Items/Accessories/FrostFlare.cs b/Items/Accessories/FrostFlare.cs index 2dd4bfa057..71979dfb6e 100644 --- a/Items/Accessories/FrostFlare.cs +++ b/Items/Accessories/FrostFlare.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Accessories "Immunity to frostburn, chilled, and frozen\n" + "Resistant to cold attacks and +1 life regen\n" + "Being above 75% life grants the player 10% increased damage\n" + - "Being below 25% life grants the player 20 defense and 15% increased max movement speed and acceleration\n" + + "Being below 25% life grants the player 10 defense and 15% increased max movement speed and acceleration\n" + "Revengeance drop"); Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(5, 10)); } @@ -38,22 +38,6 @@ namespace CalamityMod.Items.Accessories { CalamityPlayer modPlayer = player.GetModPlayer(mod); modPlayer.frostFlare = true; - player.resistCold = true; - player.buffImmune[44] = true; - player.buffImmune[46] = true; - player.buffImmune[47] = true; - if (player.statLife > (player.statLifeMax2 * 0.75f)) - { - player.meleeDamage += 0.1f; - player.magicDamage += 0.1f; - player.rangedDamage += 0.1f; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.1f; - player.minionDamage += 0.1f; - } - if (player.statLife < (player.statLifeMax2 * 0.25f)) - { - player.statDefense += 20; - } } } } \ No newline at end of file diff --git a/Items/Accessories/FungalCarapace.cs b/Items/Accessories/FungalCarapace.cs index c9d2f578a1..264df94a9a 100644 --- a/Items/Accessories/FungalCarapace.cs +++ b/Items/Accessories/FungalCarapace.cs @@ -22,8 +22,8 @@ namespace CalamityMod.Items.Accessories item.defense = 2; item.width = 20; item.height = 24; - item.value = Item.buyPrice(0, 9, 0, 0); - item.rare = 1; + item.value = Item.buyPrice(0, 15, 0, 0); + item.rare = 5; item.accessory = true; } diff --git a/Items/Accessories/HadarianWings.cs b/Items/Accessories/HadarianWings.cs new file mode 100644 index 0000000000..311a9095f7 --- /dev/null +++ b/Items/Accessories/HadarianWings.cs @@ -0,0 +1,82 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.Graphics.Shaders; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.Accessories +{ + [AutoloadEquip(EquipType.Wings)] + public class HadarianWings : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Hadarian Wings"); + Tooltip.SetDefault("Powered by the Astral Infection itself\n" + + "Horizontal speed: 9\n" + + "Acceleration multiplier: 1.75\n" + + "Good vertical speed\n" + + "Flight time: 60"); + } + + public override void SetDefaults() + { + item.width = 24; + item.height = 36; + item.value = Item.buyPrice(0, 39, 99, 99); + item.rare = 7; + item.accessory = true; + } + + public override void UpdateAccessory(Player player, bool hideVisual) + { + if (player.controlJump && player.wingTime > 0f && !player.jumpAgainCloud && player.jump == 0 && player.velocity.Y != 0f && !hideVisual) + { + int num59 = 4; + if (player.direction == 1) + { + num59 = -40; + } + int num60 = Dust.NewDust(new Vector2(player.position.X + (float)(player.width / 2) + (float)num59, player.position.Y + (float)(player.height / 2) - 15f), 30, 30, mod.DustType("AstralOrange"), 0f, 0f, 100, default(Color), 1.75f); + Main.dust[num60].noGravity = true; + Main.dust[num60].velocity *= 0.3f; + if (Main.rand.Next(10) == 0) + { + Main.dust[num60].fadeIn = 2f; + } + Main.dust[num60].shader = GameShaders.Armor.GetSecondaryShader(player.cWings, player); + } + player.wingTimeMax = 60; + } + + public override void VerticalWingSpeeds(Player player, ref float ascentWhenFalling, ref float ascentWhenRising, ref float maxCanAscendMultiplier, ref float maxAscentMultiplier, ref float constantAscend) + { + ascentWhenFalling = 0.8f; + ascentWhenRising = 0.155f; + maxCanAscendMultiplier = 1.05f; + maxAscentMultiplier = 2.55f; + constantAscend = 0.13f; + } + + public override void HorizontalWingSpeeds(Player player, ref float speed, ref float acceleration) + { + speed = 9f; + acceleration *= 1.75f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "AstralBar", 8); + recipe.AddIngredient(null, "HadarianMembrane", 10); + recipe.AddIngredient(ItemID.SoulofFlight, 20); + recipe.AddTile(TileID.MythrilAnvil); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} \ No newline at end of file diff --git a/Items/Accessories/HadarianWings.png b/Items/Accessories/HadarianWings.png new file mode 100644 index 0000000000..cbaa2fc603 Binary files /dev/null and b/Items/Accessories/HadarianWings.png differ diff --git a/Items/Accessories/HadarianWings_Wings.png b/Items/Accessories/HadarianWings_Wings.png new file mode 100644 index 0000000000..b7d1c33161 Binary files /dev/null and b/Items/Accessories/HadarianWings_Wings.png differ diff --git a/Items/Accessories/HeartofDarkness.cs b/Items/Accessories/HeartofDarkness.cs index 1ce2a526ff..6c6ae6084a 100644 --- a/Items/Accessories/HeartofDarkness.cs +++ b/Items/Accessories/HeartofDarkness.cs @@ -15,6 +15,8 @@ namespace CalamityMod.Items.Accessories { DisplayName.SetDefault("Heart of Darkness"); Tooltip.SetDefault("Gives 10% increased damage while you have the heart attack debuff\n" + + "Increases your chance of getting the heart attack debuff\n" + + "Rage mode does more damage\n" + "You gain rage over time\n" + "Revengeance drop"); Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 4)); diff --git a/Items/Accessories/HeartoftheElements.cs b/Items/Accessories/HeartoftheElements.cs index bcca46495d..d125c8f599 100644 --- a/Items/Accessories/HeartoftheElements.cs +++ b/Items/Accessories/HeartoftheElements.cs @@ -21,9 +21,9 @@ namespace CalamityMod.Items.Accessories "Increases damage reduction by 5%\n" + "Increases max mana by 50 and reduces mana usage by 5%\n" + "You grow flowers on the grass beneath you, chance to grow very random dye plants on grassless dirt\n" + - "Summons all waifus to protect you\n" + - "Toggling the visibility of this accessory also toggles the waifus on and off\n" + - "Stat increases are slightly higher if the waifus are turned off"); + "Summons all elementals to protect you\n" + + "Toggling the visibility of this accessory also toggles the elementals on and off\n" + + "Stat increases are slightly higher if the elementals are turned off"); Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(5, 8)); } @@ -34,18 +34,8 @@ namespace CalamityMod.Items.Accessories item.value = Item.buyPrice(0, 60, 0, 0); item.defense = 9; item.accessory = true; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 20; + } public override bool CanEquipAccessory(Player player, int slot) { @@ -91,23 +81,23 @@ namespace CalamityMod.Items.Accessories } if (player.ownedProjectileCounts[mod.ProjectileType("BigBustyRose")] < 1) { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, mod.ProjectileType("BigBustyRose"), (int)((float)damage * damageMult), 2f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, mod.ProjectileType("BigBustyRose"), (int)((float)damage * damageMult * player.minionDamage), 2f, Main.myPlayer, 0f, 0f); } if (player.ownedProjectileCounts[mod.ProjectileType("SirenLure")] < 1) { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, mod.ProjectileType("SirenLure"), 0, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, mod.ProjectileType("SirenLure"), (int)((float)damage * damageMult * player.minionDamage), 2f, Main.myPlayer, 0f, 0f); } if (player.ownedProjectileCounts[mod.ProjectileType("DrewsSandyWaifu")] < 1) { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, mod.ProjectileType("DrewsSandyWaifu"), (int)((float)damage * damageMult), 2f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, mod.ProjectileType("DrewsSandyWaifu"), (int)((float)damage * damageMult * player.minionDamage), 2f, Main.myPlayer, 0f, 0f); } if (player.ownedProjectileCounts[mod.ProjectileType("SandyWaifu")] < 1) { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, mod.ProjectileType("SandyWaifu"), (int)((float)damage * damageMult), 2f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, mod.ProjectileType("SandyWaifu"), (int)((float)damage * damageMult * player.minionDamage), 2f, Main.myPlayer, 0f, 0f); } if (player.ownedProjectileCounts[mod.ProjectileType("CloudyWaifu")] < 1) { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, mod.ProjectileType("CloudyWaifu"), (int)((float)damage * damageMult), 2f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, mod.ProjectileType("CloudyWaifu"), (int)((float)damage * damageMult * player.minionDamage), 2f, Main.myPlayer, 0f, 0f); } } else diff --git a/Items/Accessories/InfinityBoots.cs b/Items/Accessories/InfinityBoots.cs index d465a3ce83..3845467497 100644 --- a/Items/Accessories/InfinityBoots.cs +++ b/Items/Accessories/InfinityBoots.cs @@ -34,18 +34,8 @@ namespace CalamityMod.Items.Accessories item.height = 32; item.value = Item.buyPrice(0, 60, 0, 0); item.accessory = true; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 200); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 12; + } public override void UpdateAccessory(Player player, bool hideVisual) { @@ -72,7 +62,7 @@ namespace CalamityMod.Items.Accessories player.iceSkate = true; player.waterWalk = true; player.fireWalk = true; - player.lavaMax += 920; + player.lavaMax += 240; player.wingTimeMax = 120; modPlayer.IBoots = !hideVisual; modPlayer.sTracers = true; diff --git a/Items/Accessories/Laudanum.cs b/Items/Accessories/Laudanum.cs index ea4bb047f2..c34d04db4f 100644 --- a/Items/Accessories/Laudanum.cs +++ b/Items/Accessories/Laudanum.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Accessories { DisplayName.SetDefault("Laudanum"); Tooltip.SetDefault("Boosts your damage by 6%,\n" + - "defense by 8, and max movement speed and acceleration by 5%\n" + + "defense by 6, and max movement speed and acceleration by 5%\n" + "Makes you immune to The Horror debuff\n" + "Revengeance drop"); } diff --git a/Items/Accessories/MOAB.cs b/Items/Accessories/MOAB.cs index 12e6ef8799..de793afda7 100644 --- a/Items/Accessories/MOAB.cs +++ b/Items/Accessories/MOAB.cs @@ -95,7 +95,7 @@ namespace CalamityMod.Items.Accessories player.jumpBoost = true; player.autoJump = true; player.noFallDmg = true; - player.jumpSpeedBoost += 1.4f; + player.jumpSpeedBoost += 0.8f; player.wingTimeMax = 60; } diff --git a/Items/Accessories/MagicLevelMeter.cs b/Items/Accessories/MagicLevelMeter.cs index f837846595..8e83020e4b 100644 --- a/Items/Accessories/MagicLevelMeter.cs +++ b/Items/Accessories/MagicLevelMeter.cs @@ -1,133 +1,133 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items; - -namespace CalamityMod.Items.Accessories -{ - public class MagicLevelMeter : ModItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Magic Level Meter"); - Tooltip.SetDefault("Tells you how high your magic proficiency is"); - } - - public override void SetDefaults() - { - item.width = 26; - item.height = 26; - item.value = Item.buyPrice(0, 6, 0, 0); - item.rare = 1; - item.accessory = true; - } - - public override void ModifyTooltips(List list) - { - int level = Main.player[Main.myPlayer].GetModPlayer(mod).magicLevel; - int exactLevel = Main.player[Main.myPlayer].GetModPlayer(mod).exactMagicLevel; - int damageGain = 0; - int manaUsage = 0; - int critGain = 0; - switch (exactLevel) - { - case 0: - break; - case 1: - damageGain = 1; - break; - case 2: - damageGain = 2; - break; - case 3: - damageGain = 2; - manaUsage = 1; - break; - case 4: - damageGain = 3; - manaUsage = 1; - critGain = 1; - break; - case 5: - damageGain = 3; - manaUsage = 2; - critGain = 1; - break; - case 6: - damageGain = 4; - manaUsage = 3; - critGain = 1; - break; - case 7: - damageGain = 4; - manaUsage = 4; - critGain = 2; - break; - case 8: - damageGain = 5; - manaUsage = 5; - critGain = 2; - break; - case 9: - damageGain = 5; - manaUsage = 5; - critGain = 3; - break; - case 10: - damageGain = 6; - manaUsage = 6; - critGain = 3; - break; - case 11: - damageGain = 7; - manaUsage = 7; - critGain = 4; - break; - case 12: - damageGain = 8; - manaUsage = 8; - critGain = 4; - break; - case 13: - damageGain = 9; - manaUsage = 9; - critGain = 5; - break; - case 14: - damageGain = 10; - manaUsage = 10; - critGain = 5; - break; - case 15: - damageGain = 12; - manaUsage = 12; - critGain = 6; - break; - } - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip0") - { - line2.text = "Tells you how high your magic proficiency is\n" + - "While equipped you will gain magic proficiency faster\n" + - "The higher your magic level the higher your magic damage, critical strike chance, and the lower your mana cost\n" + - "Magic proficiency (max of 12500): " + (level - (level > 12500 ? 1 : 0)) + "\n" + - "Magic level (max of 15): " + exactLevel + "\n" + - "Magic damage increase: " + damageGain + "%\n" + - "Mana usage decrease: " + manaUsage + "%\n" + - "Magic crit increase: " + critGain + "%"; - } - } - } - - public override void UpdateAccessory(Player player, bool hideVisual) - { - CalamityPlayer modPlayer = player.GetModPlayer(mod); - modPlayer.fasterMagicLevel = true; - } - } +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.Accessories +{ + public class MagicLevelMeter : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Magic Level Meter"); + Tooltip.SetDefault("Tells you how high your magic proficiency is"); + } + + public override void SetDefaults() + { + item.width = 26; + item.height = 26; + item.value = Item.buyPrice(0, 6, 0, 0); + item.rare = 1; + item.accessory = true; + } + + public override void ModifyTooltips(List list) + { + int level = Main.player[Main.myPlayer].GetModPlayer(mod).magicLevel; + int exactLevel = Main.player[Main.myPlayer].GetModPlayer(mod).exactMagicLevel; + int damageGain = 0; + int manaUsage = 0; + int critGain = 0; + switch (exactLevel) + { + case 0: + break; + case 1: + damageGain = 1; + break; + case 2: + damageGain = 2; + break; + case 3: + damageGain = 2; + manaUsage = 1; + break; + case 4: + damageGain = 3; + manaUsage = 1; + critGain = 1; + break; + case 5: + damageGain = 3; + manaUsage = 2; + critGain = 1; + break; + case 6: + damageGain = 4; + manaUsage = 3; + critGain = 1; + break; + case 7: + damageGain = 4; + manaUsage = 4; + critGain = 2; + break; + case 8: + damageGain = 5; + manaUsage = 5; + critGain = 2; + break; + case 9: + damageGain = 5; + manaUsage = 5; + critGain = 3; + break; + case 10: + damageGain = 6; + manaUsage = 6; + critGain = 3; + break; + case 11: + damageGain = 7; + manaUsage = 7; + critGain = 4; + break; + case 12: + damageGain = 8; + manaUsage = 8; + critGain = 4; + break; + case 13: + damageGain = 9; + manaUsage = 9; + critGain = 5; + break; + case 14: + damageGain = 10; + manaUsage = 10; + critGain = 5; + break; + case 15: + damageGain = 12; + manaUsage = 12; + critGain = 6; + break; + } + foreach (TooltipLine line2 in list) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip0") + { + line2.text = "Tells you how high your magic proficiency is\n" + + "While equipped you will gain magic proficiency faster\n" + + "The higher your magic level the higher your magic damage, critical strike chance, and the lower your mana cost\n" + + "Magic proficiency (max of 12500): " + (level - (level > 12500 ? 1 : 0)) + "\n" + + "Magic level (max of 15): " + exactLevel + "\n" + + "Magic damage increase: " + damageGain + "%\n" + + "Mana usage decrease: " + manaUsage + "%\n" + + "Magic crit increase: " + critGain + "%"; + } + } + } + + public override void UpdateAccessory(Player player, bool hideVisual) + { + CalamityPlayer modPlayer = player.GetModPlayer(mod); + modPlayer.fasterMagicLevel = true; + } + } } \ No newline at end of file diff --git a/Items/Accessories/MeleeLevelMeter.cs b/Items/Accessories/MeleeLevelMeter.cs index acdb4abe49..b05f36a5a8 100644 --- a/Items/Accessories/MeleeLevelMeter.cs +++ b/Items/Accessories/MeleeLevelMeter.cs @@ -1,133 +1,133 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items; - -namespace CalamityMod.Items.Accessories -{ - public class MeleeLevelMeter : ModItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Melee Level Meter"); - Tooltip.SetDefault("Tells you how high your melee proficiency is"); - } - - public override void SetDefaults() - { - item.width = 26; - item.height = 26; - item.value = Item.buyPrice(0, 6, 0, 0); - item.rare = 1; - item.accessory = true; - } - - public override void ModifyTooltips(List list) - { - int level = Main.player[Main.myPlayer].GetModPlayer(mod).meleeLevel; - int exactLevel = Main.player[Main.myPlayer].GetModPlayer(mod).exactMeleeLevel; - int damageGain = 0; - int meleeSpeed = 0; - int critGain = 0; - switch (exactLevel) - { - case 0: - break; - case 1: - damageGain = 1; - break; - case 2: - damageGain = 2; - break; - case 3: - damageGain = 2; - meleeSpeed = 1; - break; - case 4: - damageGain = 3; - meleeSpeed = 1; - critGain = 1; - break; - case 5: - damageGain = 3; - meleeSpeed = 2; - critGain = 1; - break; - case 6: - damageGain = 4; - meleeSpeed = 3; - critGain = 1; - break; - case 7: - damageGain = 4; - meleeSpeed = 4; - critGain = 2; - break; - case 8: - damageGain = 5; - meleeSpeed = 5; - critGain = 2; - break; - case 9: - damageGain = 5; - meleeSpeed = 5; - critGain = 3; - break; - case 10: - damageGain = 6; - meleeSpeed = 6; - critGain = 3; - break; - case 11: - damageGain = 7; - meleeSpeed = 7; - critGain = 4; - break; - case 12: - damageGain = 8; - meleeSpeed = 8; - critGain = 4; - break; - case 13: - damageGain = 9; - meleeSpeed = 9; - critGain = 5; - break; - case 14: - damageGain = 10; - meleeSpeed = 10; - critGain = 5; - break; - case 15: - damageGain = 12; - meleeSpeed = 12; - critGain = 6; - break; - } - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip0") - { - line2.text = "Tells you how high your melee proficiency is\n" + - "While equipped you will gain melee proficiency faster\n" + - "The higher your melee level the higher your melee damage, speed, and critical strike chance\n" + - "Melee proficiency (max of 12500): " + (level - (level > 12500 ? 1 : 0)) + "\n" + - "Melee level (max of 15): " + exactLevel + "\n" + - "Melee damage increase: " + damageGain + "%\n" + - "Melee speed increase: " + meleeSpeed + "%\n" + - "Melee crit increase: " + critGain + "%"; - } - } - } - - public override void UpdateAccessory(Player player, bool hideVisual) - { - CalamityPlayer modPlayer = player.GetModPlayer(mod); - modPlayer.fasterMeleeLevel = true; - } - } +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.Accessories +{ + public class MeleeLevelMeter : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Melee Level Meter"); + Tooltip.SetDefault("Tells you how high your melee proficiency is"); + } + + public override void SetDefaults() + { + item.width = 26; + item.height = 26; + item.value = Item.buyPrice(0, 6, 0, 0); + item.rare = 1; + item.accessory = true; + } + + public override void ModifyTooltips(List list) + { + int level = Main.player[Main.myPlayer].GetModPlayer(mod).meleeLevel; + int exactLevel = Main.player[Main.myPlayer].GetModPlayer(mod).exactMeleeLevel; + int damageGain = 0; + int meleeSpeed = 0; + int critGain = 0; + switch (exactLevel) + { + case 0: + break; + case 1: + damageGain = 1; + break; + case 2: + damageGain = 2; + break; + case 3: + damageGain = 2; + meleeSpeed = 1; + break; + case 4: + damageGain = 3; + meleeSpeed = 1; + critGain = 1; + break; + case 5: + damageGain = 3; + meleeSpeed = 2; + critGain = 1; + break; + case 6: + damageGain = 4; + meleeSpeed = 3; + critGain = 1; + break; + case 7: + damageGain = 4; + meleeSpeed = 4; + critGain = 2; + break; + case 8: + damageGain = 5; + meleeSpeed = 5; + critGain = 2; + break; + case 9: + damageGain = 5; + meleeSpeed = 5; + critGain = 3; + break; + case 10: + damageGain = 6; + meleeSpeed = 6; + critGain = 3; + break; + case 11: + damageGain = 7; + meleeSpeed = 7; + critGain = 4; + break; + case 12: + damageGain = 8; + meleeSpeed = 8; + critGain = 4; + break; + case 13: + damageGain = 9; + meleeSpeed = 9; + critGain = 5; + break; + case 14: + damageGain = 10; + meleeSpeed = 10; + critGain = 5; + break; + case 15: + damageGain = 12; + meleeSpeed = 12; + critGain = 6; + break; + } + foreach (TooltipLine line2 in list) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip0") + { + line2.text = "Tells you how high your melee proficiency is\n" + + "While equipped you will gain melee proficiency faster\n" + + "The higher your melee level the higher your melee damage, speed, and critical strike chance\n" + + "Melee proficiency (max of 12500): " + (level - (level > 12500 ? 1 : 0)) + "\n" + + "Melee level (max of 15): " + exactLevel + "\n" + + "Melee damage increase: " + damageGain + "%\n" + + "Melee speed increase: " + meleeSpeed + "%\n" + + "Melee crit increase: " + critGain + "%"; + } + } + } + + public override void UpdateAccessory(Player player, bool hideVisual) + { + CalamityPlayer modPlayer = player.GetModPlayer(mod); + modPlayer.fasterMeleeLevel = true; + } + } } \ No newline at end of file diff --git a/Items/Accessories/Nanotech.cs b/Items/Accessories/Nanotech.cs index c6c8717502..b630fab2dd 100644 --- a/Items/Accessories/Nanotech.cs +++ b/Items/Accessories/Nanotech.cs @@ -16,9 +16,8 @@ namespace CalamityMod.Items.Accessories { DisplayName.SetDefault("Nanotech"); Tooltip.SetDefault("Rogue projectiles leave behind nanoblades as they travel\n" + - "While holding a rogue weapon your defense is boosted by 15 and your damage reduction is boosted by 10%\n" + "Rogue weapons have a chance to instantly kill normal enemies\n" + - "15% increased rogue damage, 5% increased rogue crit chance, and 15% increased rogue velocity"); + "15% increased rogue damage, 10% increased rogue crit chance, and 15% increased rogue velocity"); } public override void SetDefaults() @@ -27,25 +26,15 @@ namespace CalamityMod.Items.Accessories item.height = 32; item.value = Item.buyPrice(0, 90, 0, 0); item.accessory = true; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 20; + } public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.GetModPlayer(mod); modPlayer.nanotech = true; CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.15f; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 5; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 10; CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingVelocity += 0.15f; } diff --git a/Items/Accessories/NecklaceofVexation.cs b/Items/Accessories/NecklaceofVexation.cs index a0a711db82..666b924e94 100644 --- a/Items/Accessories/NecklaceofVexation.cs +++ b/Items/Accessories/NecklaceofVexation.cs @@ -30,15 +30,9 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { - if (player.statLife < (player.statLifeMax2 * 0.5f)) - { - player.meleeDamage += 0.15f; - player.magicDamage += 0.15f; - player.rangedDamage += 0.15f; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.15f; - player.minionDamage += 0.15f; - } - } + CalamityPlayer modPlayer = player.GetModPlayer(mod); + modPlayer.vexation = true; + } public override void AddRecipes() { diff --git a/Items/Accessories/OrnateShield.cs b/Items/Accessories/OrnateShield.cs index d672b10d66..c217e51aba 100644 --- a/Items/Accessories/OrnateShield.cs +++ b/Items/Accessories/OrnateShield.cs @@ -14,7 +14,6 @@ namespace CalamityMod.Items.Accessories public override void SetStaticDefaults() { DisplayName.SetDefault("Ornate Shield"); - Tooltip.SetDefault("Increased defense by 8 when below 25% life"); } public override void SetDefaults() @@ -23,18 +22,10 @@ namespace CalamityMod.Items.Accessories item.height = 32; item.value = Item.buyPrice(0, 12, 0, 0); item.rare = 5; - item.defense = 4; + item.defense = 6; item.accessory = true; } - public override void UpdateAccessory(Player player, bool hideVisual) - { - if (player.statLife <= (player.statLifeMax2 * 0.25f)) - { - player.statDefense += 8; - } - } - public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); diff --git a/Items/Accessories/PlagueHive.cs b/Items/Accessories/PlagueHive.cs index 3478299366..58481075de 100644 --- a/Items/Accessories/PlagueHive.cs +++ b/Items/Accessories/PlagueHive.cs @@ -14,8 +14,7 @@ namespace CalamityMod.Items.Accessories public override void SetStaticDefaults() { DisplayName.SetDefault("Plague Hive"); - Tooltip.SetDefault("Blinds and weakens the player if above 90% life\n" + - "Summons a damaging plague aura around the player to destroy nearby enemies\n" + + Tooltip.SetDefault("Summons a damaging plague aura around the player to destroy nearby enemies\n" + "Releases bees when damaged\n" + "Friendly bees inflict the plague\n" + "All of your attacks inflict the plague\n" + @@ -53,12 +52,6 @@ namespace CalamityMod.Items.Accessories modPlayer.uberBees = true; player.strongBees = true; modPlayer.alchFlask = true; - if (player.statLife >= (player.statLifeMax * 0.9f)) - { - player.blind = true; - player.statDefense -= 5; - player.moveSpeed -= 0.05f; - } int plagueCounter = 0; Lighting.AddLight((int)(player.Center.X / 16f), (int)(player.Center.Y / 16f), 0.1f, 2f, 0.2f); int num = mod.BuffType("Plague"); diff --git a/Items/Accessories/RampartofDeities.cs b/Items/Accessories/RampartofDeities.cs index b3071013f1..3ae09b9366 100644 --- a/Items/Accessories/RampartofDeities.cs +++ b/Items/Accessories/RampartofDeities.cs @@ -32,57 +32,14 @@ namespace CalamityMod.Items.Accessories item.value = Item.buyPrice(0, 90, 0, 0); item.defense = 12; item.accessory = true; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(43, 96, 222); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 14; + } public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.GetModPlayer(mod); modPlayer.dAmulet = true; - player.panic = true; - player.armorPenetration += 50; - player.manaMagnet = true; - player.magicCuffs = true; - if (Collision.DrownCollision(player.position, player.width, player.height, player.gravDir)) - { - Lighting.AddLight((int)player.Center.X / 16, (int)player.Center.Y / 16, 1.35f, 0.3f, 0.9f); - } - player.noKnockback = true; - if ((float)player.statLife > (float)player.statLifeMax2 * 0.25f) - { - player.hasPaladinShield = true; - if (player.whoAmI != Main.myPlayer && player.miscCounter % 10 == 0) - { - int myPlayer = Main.myPlayer; - if (Main.player[myPlayer].team == player.team && player.team != 0) - { - float arg = player.position.X - Main.player[myPlayer].position.X; - float num3 = player.position.Y - Main.player[myPlayer].position.Y; - if ((float)Math.Sqrt((double)(arg * arg + num3 * num3)) < 800f) - { - Main.player[myPlayer].AddBuff(43, 20, true); - } - } - } - } - if ((double)player.statLife <= (double)player.statLifeMax2 * 0.5) - { - player.AddBuff(62, 5, true); - } - if ((double)player.statLife <= (double)player.statLifeMax2 * 0.15) - { - player.endurance += 0.05f; - } + modPlayer.rampartOfDeities = true; } public override void AddRecipes() diff --git a/Items/Accessories/RangedLevelMeter.cs b/Items/Accessories/RangedLevelMeter.cs index 5477b5a3fc..682658a5a1 100644 --- a/Items/Accessories/RangedLevelMeter.cs +++ b/Items/Accessories/RangedLevelMeter.cs @@ -1,133 +1,133 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items; - -namespace CalamityMod.Items.Accessories -{ - public class RangedLevelMeter : ModItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ranged Level Meter"); - Tooltip.SetDefault("Tells you how high your ranged proficiency is"); - } - - public override void SetDefaults() - { - item.width = 26; - item.height = 26; - item.value = Item.buyPrice(0, 6, 0, 0); - item.rare = 1; - item.accessory = true; - } - - public override void ModifyTooltips(List list) - { - int level = Main.player[Main.myPlayer].GetModPlayer(mod).rangedLevel; - int exactLevel = Main.player[Main.myPlayer].GetModPlayer(mod).exactRangedLevel; - int damageGain = 0; - int moveSpeed = 0; - int critGain = 0; - switch (exactLevel) - { - case 0: - break; - case 1: - damageGain = 1; - break; - case 2: - damageGain = 2; - break; - case 3: - damageGain = 2; - critGain = 1; - break; - case 4: - damageGain = 3; - critGain = 1; - moveSpeed = 1; - break; - case 5: - damageGain = 3; - moveSpeed = 2; - critGain = 1; - break; - case 6: - damageGain = 4; - moveSpeed = 3; - critGain = 1; - break; - case 7: - damageGain = 4; - moveSpeed = 4; - critGain = 2; - break; - case 8: - damageGain = 5; - moveSpeed = 5; - critGain = 2; - break; - case 9: - damageGain = 5; - moveSpeed = 5; - critGain = 3; - break; - case 10: - damageGain = 6; - moveSpeed = 6; - critGain = 3; - break; - case 11: - damageGain = 7; - moveSpeed = 7; - critGain = 4; - break; - case 12: - damageGain = 8; - moveSpeed = 8; - critGain = 4; - break; - case 13: - damageGain = 9; - moveSpeed = 9; - critGain = 5; - break; - case 14: - damageGain = 10; - moveSpeed = 10; - critGain = 5; - break; - case 15: - damageGain = 12; - moveSpeed = 12; - critGain = 6; - break; - } - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip0") - { - line2.text = "Tells you how high your ranged proficiency is\n" + - "While equipped you will gain ranged proficiency faster\n" + - "The higher your ranged level the higher your ranged damage, critical strike chance, and movement speed\n" + - "Ranged proficiency (max of 12500): " + (level - (level > 12500 ? 1 : 0)) + "\n" + - "Ranged level (max of 15): " + exactLevel + "\n" + - "Ranged damage increase: " + damageGain + "%\n" + - "Movement speed increase: " + moveSpeed + "%\n" + - "Ranged crit increase: " + critGain + "%"; - } - } - } - - public override void UpdateAccessory(Player player, bool hideVisual) - { - CalamityPlayer modPlayer = player.GetModPlayer(mod); - modPlayer.fasterRangedLevel = true; - } - } +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.Accessories +{ + public class RangedLevelMeter : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ranged Level Meter"); + Tooltip.SetDefault("Tells you how high your ranged proficiency is"); + } + + public override void SetDefaults() + { + item.width = 26; + item.height = 26; + item.value = Item.buyPrice(0, 6, 0, 0); + item.rare = 1; + item.accessory = true; + } + + public override void ModifyTooltips(List list) + { + int level = Main.player[Main.myPlayer].GetModPlayer(mod).rangedLevel; + int exactLevel = Main.player[Main.myPlayer].GetModPlayer(mod).exactRangedLevel; + int damageGain = 0; + int moveSpeed = 0; + int critGain = 0; + switch (exactLevel) + { + case 0: + break; + case 1: + damageGain = 1; + break; + case 2: + damageGain = 2; + break; + case 3: + damageGain = 2; + critGain = 1; + break; + case 4: + damageGain = 3; + critGain = 1; + moveSpeed = 1; + break; + case 5: + damageGain = 3; + moveSpeed = 2; + critGain = 1; + break; + case 6: + damageGain = 4; + moveSpeed = 3; + critGain = 1; + break; + case 7: + damageGain = 4; + moveSpeed = 4; + critGain = 2; + break; + case 8: + damageGain = 5; + moveSpeed = 5; + critGain = 2; + break; + case 9: + damageGain = 5; + moveSpeed = 5; + critGain = 3; + break; + case 10: + damageGain = 6; + moveSpeed = 6; + critGain = 3; + break; + case 11: + damageGain = 7; + moveSpeed = 7; + critGain = 4; + break; + case 12: + damageGain = 8; + moveSpeed = 8; + critGain = 4; + break; + case 13: + damageGain = 9; + moveSpeed = 9; + critGain = 5; + break; + case 14: + damageGain = 10; + moveSpeed = 10; + critGain = 5; + break; + case 15: + damageGain = 12; + moveSpeed = 12; + critGain = 6; + break; + } + foreach (TooltipLine line2 in list) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip0") + { + line2.text = "Tells you how high your ranged proficiency is\n" + + "While equipped you will gain ranged proficiency faster\n" + + "The higher your ranged level the higher your ranged damage, critical strike chance, and movement speed\n" + + "Ranged proficiency (max of 12500): " + (level - (level > 12500 ? 1 : 0)) + "\n" + + "Ranged level (max of 15): " + exactLevel + "\n" + + "Ranged damage increase: " + damageGain + "%\n" + + "Movement speed increase: " + moveSpeed + "%\n" + + "Ranged crit increase: " + critGain + "%"; + } + } + } + + public override void UpdateAccessory(Player player, bool hideVisual) + { + CalamityPlayer modPlayer = player.GetModPlayer(mod); + modPlayer.fasterRangedLevel = true; + } + } } \ No newline at end of file diff --git a/Items/Accessories/RogueEmblem.cs b/Items/Accessories/RogueEmblem.cs index 0f620f85fe..8636360c8e 100644 --- a/Items/Accessories/RogueEmblem.cs +++ b/Items/Accessories/RogueEmblem.cs @@ -1,35 +1,35 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items.CalamityCustomThrowingDamage; - -namespace CalamityMod.Items.Accessories -{ - public class RogueEmblem : ModItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Rogue Emblem"); - Tooltip.SetDefault("15% increased rogue damage"); - } - - public override void SetDefaults() - { - item.width = 24; - item.height = 24; - item.value = 100000; - item.rare = 4; - item.accessory = true; - } - - public override void UpdateAccessory(Player player, bool hideVisual) - { - CalamityCustomThrowingDamagePlayer modPlayer2 = CalamityCustomThrowingDamagePlayer.ModPlayer(player); - modPlayer2.throwingDamage += 0.15f; - } - } +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items.CalamityCustomThrowingDamage; + +namespace CalamityMod.Items.Accessories +{ + public class RogueEmblem : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Rogue Emblem"); + Tooltip.SetDefault("15% increased rogue damage"); + } + + public override void SetDefaults() + { + item.width = 24; + item.height = 24; + item.value = 100000; + item.rare = 4; + item.accessory = true; + } + + public override void UpdateAccessory(Player player, bool hideVisual) + { + CalamityCustomThrowingDamagePlayer modPlayer2 = CalamityCustomThrowingDamagePlayer.ModPlayer(player); + modPlayer2.throwingDamage += 0.15f; + } + } } \ No newline at end of file diff --git a/Items/Accessories/RogueLevelMeter.cs b/Items/Accessories/RogueLevelMeter.cs index 636045ddf7..1c0b78dabc 100644 --- a/Items/Accessories/RogueLevelMeter.cs +++ b/Items/Accessories/RogueLevelMeter.cs @@ -1,133 +1,133 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items; - -namespace CalamityMod.Items.Accessories -{ - public class RogueLevelMeter : ModItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Rogue Level Meter"); - Tooltip.SetDefault("Tells you how high your rogue proficiency is"); - } - - public override void SetDefaults() - { - item.width = 26; - item.height = 26; - item.value = Item.buyPrice(0, 6, 0, 0); - item.rare = 1; - item.accessory = true; - } - - public override void ModifyTooltips(List list) - { - int level = Main.player[Main.myPlayer].GetModPlayer(mod).rogueLevel; - int exactLevel = Main.player[Main.myPlayer].GetModPlayer(mod).exactRogueLevel; - int damageGain = 0; - int velocityGain = 0; - int critGain = 0; - switch (exactLevel) - { - case 0: - break; - case 1: - damageGain = 1; - break; - case 2: - damageGain = 2; - break; - case 3: - damageGain = 2; - velocityGain = 1; - break; - case 4: - damageGain = 3; - critGain = 1; - velocityGain = 1; - break; - case 5: - damageGain = 3; - velocityGain = 2; - critGain = 1; - break; - case 6: - damageGain = 4; - velocityGain = 3; - critGain = 1; - break; - case 7: - damageGain = 4; - velocityGain = 4; - critGain = 2; - break; - case 8: - damageGain = 5; - velocityGain = 5; - critGain = 2; - break; - case 9: - damageGain = 5; - velocityGain = 5; - critGain = 3; - break; - case 10: - damageGain = 6; - velocityGain = 6; - critGain = 3; - break; - case 11: - damageGain = 7; - velocityGain = 7; - critGain = 4; - break; - case 12: - damageGain = 8; - velocityGain = 8; - critGain = 4; - break; - case 13: - damageGain = 9; - velocityGain = 9; - critGain = 5; - break; - case 14: - damageGain = 10; - velocityGain = 10; - critGain = 5; - break; - case 15: - damageGain = 12; - velocityGain = 12; - critGain = 6; - break; - } - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip0") - { - line2.text = "Tells you how high your rogue proficiency is\n" + - "While equipped you will gain rogue proficiency faster\n" + - "The higher your rogue level the higher your rogue damage, critical strike chance, and velocity\n" + - "Rogue proficiency (max of 12500): " + (level - (level > 12500 ? 1 : 0)) + "\n" + - "Rogue level (max of 15): " + exactLevel + "\n" + - "Rogue damage increase: " + damageGain + "%\n" + - "Rogue velocity increase: " + velocityGain + "%\n" + - "Rogue crit increase: " + critGain + "%"; - } - } - } - - public override void UpdateAccessory(Player player, bool hideVisual) - { - CalamityPlayer modPlayer = player.GetModPlayer(mod); - modPlayer.fasterRogueLevel = true; - } - } +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.Accessories +{ + public class RogueLevelMeter : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Rogue Level Meter"); + Tooltip.SetDefault("Tells you how high your rogue proficiency is"); + } + + public override void SetDefaults() + { + item.width = 26; + item.height = 26; + item.value = Item.buyPrice(0, 6, 0, 0); + item.rare = 1; + item.accessory = true; + } + + public override void ModifyTooltips(List list) + { + int level = Main.player[Main.myPlayer].GetModPlayer(mod).rogueLevel; + int exactLevel = Main.player[Main.myPlayer].GetModPlayer(mod).exactRogueLevel; + int damageGain = 0; + int velocityGain = 0; + int critGain = 0; + switch (exactLevel) + { + case 0: + break; + case 1: + damageGain = 1; + break; + case 2: + damageGain = 2; + break; + case 3: + damageGain = 2; + velocityGain = 1; + break; + case 4: + damageGain = 3; + critGain = 1; + velocityGain = 1; + break; + case 5: + damageGain = 3; + velocityGain = 2; + critGain = 1; + break; + case 6: + damageGain = 4; + velocityGain = 3; + critGain = 1; + break; + case 7: + damageGain = 4; + velocityGain = 4; + critGain = 2; + break; + case 8: + damageGain = 5; + velocityGain = 5; + critGain = 2; + break; + case 9: + damageGain = 5; + velocityGain = 5; + critGain = 3; + break; + case 10: + damageGain = 6; + velocityGain = 6; + critGain = 3; + break; + case 11: + damageGain = 7; + velocityGain = 7; + critGain = 4; + break; + case 12: + damageGain = 8; + velocityGain = 8; + critGain = 4; + break; + case 13: + damageGain = 9; + velocityGain = 9; + critGain = 5; + break; + case 14: + damageGain = 10; + velocityGain = 10; + critGain = 5; + break; + case 15: + damageGain = 12; + velocityGain = 12; + critGain = 6; + break; + } + foreach (TooltipLine line2 in list) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip0") + { + line2.text = "Tells you how high your rogue proficiency is\n" + + "While equipped you will gain rogue proficiency faster\n" + + "The higher your rogue level the higher your rogue damage, critical strike chance, and velocity\n" + + "Rogue proficiency (max of 12500): " + (level - (level > 12500 ? 1 : 0)) + "\n" + + "Rogue level (max of 15): " + exactLevel + "\n" + + "Rogue damage increase: " + damageGain + "%\n" + + "Rogue velocity increase: " + velocityGain + "%\n" + + "Rogue crit increase: " + critGain + "%"; + } + } + } + + public override void UpdateAccessory(Player player, bool hideVisual) + { + CalamityPlayer modPlayer = player.GetModPlayer(mod); + modPlayer.fasterRogueLevel = true; + } + } } \ No newline at end of file diff --git a/Items/Accessories/SeaShell.cs b/Items/Accessories/SeaShell.cs index abe5e85085..ba075a1c29 100644 --- a/Items/Accessories/SeaShell.cs +++ b/Items/Accessories/SeaShell.cs @@ -35,6 +35,7 @@ namespace CalamityMod.Items.Accessories player.statDefense += 3; player.endurance += 0.05f; player.moveSpeed += 0.15f; + player.ignoreWater = true; } } } diff --git a/Items/Accessories/Sponge.cs b/Items/Accessories/Sponge.cs index 1f40a550fa..03cdd1b4ad 100644 --- a/Items/Accessories/Sponge.cs +++ b/Items/Accessories/Sponge.cs @@ -36,18 +36,8 @@ namespace CalamityMod.Items.Accessories item.height = 20; item.value = Item.buyPrice(0, 90, 0, 0); item.accessory = true; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(43, 96, 222); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 14; + } public override void UpdateAccessory(Player player, bool hideVisual) { diff --git a/Items/Accessories/StatisBeltOfCurses.cs b/Items/Accessories/StatisBeltOfCurses.cs index 3f86d7e359..ad5ab56d31 100644 --- a/Items/Accessories/StatisBeltOfCurses.cs +++ b/Items/Accessories/StatisBeltOfCurses.cs @@ -32,18 +32,8 @@ namespace CalamityMod.Items.Accessories item.height = 32; item.value = Item.buyPrice(0, 90, 0, 0); item.accessory = true; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(43, 96, 222); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 14; + } public override void UpdateAccessory(Player player, bool hideVisual) { diff --git a/Items/Accessories/StressPills.cs b/Items/Accessories/StressPills.cs index ae77a535c0..c93b4242de 100644 --- a/Items/Accessories/StressPills.cs +++ b/Items/Accessories/StressPills.cs @@ -14,8 +14,8 @@ namespace CalamityMod.Items.Accessories public override void SetStaticDefaults() { DisplayName.SetDefault("Stress Pills"); - Tooltip.SetDefault("Boosts your damage by 6%, \n" + - "defense by 5, and max movement speed and acceleration by 5%\n" + + Tooltip.SetDefault("Boosts your damage by 8%,\n" + + "defense by 8, and max movement speed and acceleration by 5%\n" + "Revengeance drop"); } diff --git a/Items/Accessories/SummonLevelMeter.cs b/Items/Accessories/SummonLevelMeter.cs index d5049ae095..da6be47ba2 100644 --- a/Items/Accessories/SummonLevelMeter.cs +++ b/Items/Accessories/SummonLevelMeter.cs @@ -1,131 +1,131 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items; - -namespace CalamityMod.Items.Accessories -{ - public class SummonLevelMeter : ModItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Summon Level Meter"); - Tooltip.SetDefault("Tells you how high your summon proficiency is"); - } - - public override void SetDefaults() - { - item.width = 26; - item.height = 26; - item.value = Item.buyPrice(0, 6, 0, 0); - item.rare = 1; - item.accessory = true; - } - - public override void ModifyTooltips(List list) - { - int level = Main.player[Main.myPlayer].GetModPlayer(mod).summonLevel; - int exactLevel = Main.player[Main.myPlayer].GetModPlayer(mod).exactSummonLevel; - int damageGain = 0; - int minionKB = 0; - int minionSlots = 0; - switch (exactLevel) - { - case 0: - break; - case 1: - damageGain = 1; - break; - case 2: - damageGain = 2; - break; - case 3: - damageGain = 2; - minionKB = 30; - break; - case 4: - damageGain = 3; - minionKB = 30; - break; - case 5: - damageGain = 3; - minionKB = 60; - break; - case 6: - damageGain = 4; - minionKB = 90; - minionSlots = 1; - break; - case 7: - damageGain = 4; - minionKB = 120; - minionSlots = 1; - break; - case 8: - damageGain = 5; - minionKB = 150; - minionSlots = 1; - break; - case 9: - damageGain = 6; - minionKB = 180; - minionSlots = 1; - break; - case 10: - damageGain = 6; - minionKB = 180; - minionSlots = 2; - break; - case 11: - damageGain = 7; - minionKB = 210; - minionSlots = 2; - break; - case 12: - damageGain = 8; - minionKB = 240; - minionSlots = 2; - break; - case 13: - damageGain = 9; - minionKB = 270; - minionSlots = 2; - break; - case 14: - damageGain = 10; - minionKB = 300; - minionSlots = 2; - break; - case 15: - damageGain = 12; - minionKB = 300; - minionSlots = 3; - break; - } - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip0") - { - line2.text = "Tells you how high your summon proficiency is\n" + - "While equipped you will gain summon proficiency faster\n" + - "The higher your summon level the higher your minion damage, knockback, and slots\n" + - "Summon proficiency (max of 12500): " + (level - (level > 12500 ? 1 : 0)) + "\n" + - "Summon level (max of 15): " + exactLevel + "\n" + - "Minion damage increase: " + damageGain + "%\n" + - "Minion knockback increase: " + minionKB + "%\n" + - "Minion slot increase: " + minionSlots; - } - } - } - - public override void UpdateAccessory(Player player, bool hideVisual) - { - CalamityPlayer modPlayer = player.GetModPlayer(mod); - modPlayer.fasterSummonLevel = true; - } - } +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.Accessories +{ + public class SummonLevelMeter : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Summon Level Meter"); + Tooltip.SetDefault("Tells you how high your summon proficiency is"); + } + + public override void SetDefaults() + { + item.width = 26; + item.height = 26; + item.value = Item.buyPrice(0, 6, 0, 0); + item.rare = 1; + item.accessory = true; + } + + public override void ModifyTooltips(List list) + { + int level = Main.player[Main.myPlayer].GetModPlayer(mod).summonLevel; + int exactLevel = Main.player[Main.myPlayer].GetModPlayer(mod).exactSummonLevel; + int damageGain = 0; + int minionKB = 0; + int minionSlots = 0; + switch (exactLevel) + { + case 0: + break; + case 1: + damageGain = 1; + break; + case 2: + damageGain = 2; + break; + case 3: + damageGain = 2; + minionKB = 30; + break; + case 4: + damageGain = 3; + minionKB = 30; + break; + case 5: + damageGain = 3; + minionKB = 60; + break; + case 6: + damageGain = 4; + minionKB = 90; + minionSlots = 1; + break; + case 7: + damageGain = 4; + minionKB = 120; + minionSlots = 1; + break; + case 8: + damageGain = 5; + minionKB = 150; + minionSlots = 1; + break; + case 9: + damageGain = 6; + minionKB = 180; + minionSlots = 1; + break; + case 10: + damageGain = 6; + minionKB = 180; + minionSlots = 2; + break; + case 11: + damageGain = 7; + minionKB = 210; + minionSlots = 2; + break; + case 12: + damageGain = 8; + minionKB = 240; + minionSlots = 2; + break; + case 13: + damageGain = 9; + minionKB = 270; + minionSlots = 2; + break; + case 14: + damageGain = 10; + minionKB = 300; + minionSlots = 2; + break; + case 15: + damageGain = 12; + minionKB = 300; + minionSlots = 3; + break; + } + foreach (TooltipLine line2 in list) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip0") + { + line2.text = "Tells you how high your summon proficiency is\n" + + "While equipped you will gain summon proficiency faster\n" + + "The higher your summon level the higher your minion damage, knockback, and slots\n" + + "Summon proficiency (max of 12500): " + (level - (level > 12500 ? 1 : 0)) + "\n" + + "Summon level (max of 15): " + exactLevel + "\n" + + "Minion damage increase: " + damageGain + "%\n" + + "Minion knockback increase: " + minionKB + "%\n" + + "Minion slot increase: " + minionSlots; + } + } + } + + public override void UpdateAccessory(Player player, bool hideVisual) + { + CalamityPlayer modPlayer = player.GetModPlayer(mod); + modPlayer.fasterSummonLevel = true; + } + } } \ No newline at end of file diff --git a/Items/Accessories/TheAmalgam.cs b/Items/Accessories/TheAmalgam.cs index b4af0d93a5..8aba437f68 100644 --- a/Items/Accessories/TheAmalgam.cs +++ b/Items/Accessories/TheAmalgam.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Accessories "You will confuse nearby enemies when you are struck\n" + "Drops brimstone fireballs from the sky occasionally\n" + "Brimstone fire rains down while invincibility is active\n" + - "Immunity to lava and 15% increased damage while in lava\n" + + "Temporary immunity to lava, greatly reduces lava burn damage, and 15% increased damage while in lava\n" + "Summons a fungal clump to fight for you\n" + "You leave behind poisonous seawater as you move\n" + "75% increased movement speed, 10% increase to all damage, and plus 40 defense while submerged in liquid\n" + @@ -64,7 +64,7 @@ namespace CalamityMod.Items.Accessories } if (player.ownedProjectileCounts[mod.ProjectileType("FungalClump")] < 1) { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, mod.ProjectileType("FungalClump"), 250, 1f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, mod.ProjectileType("FungalClump"), (int)(250f * player.minionDamage), 1f, Main.myPlayer, 0f, 0f); } } player.meleeDamage += 0.15f; @@ -73,8 +73,9 @@ namespace CalamityMod.Items.Accessories player.magicDamage += 0.15f; player.minionDamage += 0.15f; player.ignoreWater = true; - player.lavaImmune = true; - if (player.lavaWet) + player.lavaRose = true; + player.lavaMax += 240; + if (player.lavaWet) { player.meleeDamage += 0.15f; CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.15f; diff --git a/Items/Accessories/TheCommunity.cs b/Items/Accessories/TheCommunity.cs index d526409ddc..c3aeb430a8 100644 --- a/Items/Accessories/TheCommunity.cs +++ b/Items/Accessories/TheCommunity.cs @@ -31,18 +31,8 @@ namespace CalamityMod.Items.Accessories item.height = 20; item.value = Item.buyPrice(0, 60, 0, 0); item.accessory = true; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 20; + } public override void UpdateAccessory(Player player, bool hideVisual) { diff --git a/Items/Accessories/VoidofExtinction.cs b/Items/Accessories/VoidofExtinction.cs index 1d1f6cdcd7..2848a294cd 100644 --- a/Items/Accessories/VoidofExtinction.cs +++ b/Items/Accessories/VoidofExtinction.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Accessories "Drops brimstone fireballs from the sky occasionally\n" + "15% increase to all damage\n" + "Brimstone fire rains down while invincibility is active\n" + - "Immunity to lava and 25% increased damage while in lava"); + "Temporary immunity to lava, greatly reduces lava burn damage, and 25% increased damage while in lava"); } public override void SetDefaults() @@ -60,8 +60,9 @@ namespace CalamityMod.Items.Accessories { CalamityPlayer modPlayer = player.GetModPlayer(mod); modPlayer.calamityRing = true; - player.lavaImmune = true; - player.meleeDamage += 0.15f; + player.lavaRose = true; + player.lavaMax += 240; + player.meleeDamage += 0.15f; CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.15f; player.rangedDamage += 0.15f; player.magicDamage += 0.15f; diff --git a/Items/Accessories/WifeinaBottle.cs b/Items/Accessories/WifeinaBottle.cs index e9025461ce..d7ac62eca5 100644 --- a/Items/Accessories/WifeinaBottle.cs +++ b/Items/Accessories/WifeinaBottle.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Accessories { public override void SetStaticDefaults() { - DisplayName.SetDefault("Waifu in a Bottle"); + DisplayName.SetDefault("Lady in a Bottle"); Tooltip.SetDefault("Summons a sand elemental to fight for you"); } @@ -54,7 +54,7 @@ namespace CalamityMod.Items.Accessories } if (player.ownedProjectileCounts[mod.ProjectileType("SandyWaifu")] < 1) { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, mod.ProjectileType("SandyWaifu"), 45, 2f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, mod.ProjectileType("SandyWaifu"), (int)(45f * player.minionDamage), 2f, Main.myPlayer, 0f, 0f); } } } diff --git a/Items/Accessories/WifeinaBottlewithBoobs.cs b/Items/Accessories/WifeinaBottlewithBoobs.cs index a39f3a2974..8c34c49c3b 100644 --- a/Items/Accessories/WifeinaBottlewithBoobs.cs +++ b/Items/Accessories/WifeinaBottlewithBoobs.cs @@ -19,8 +19,9 @@ namespace CalamityMod.Items.Accessories { public override void SetStaticDefaults() { - DisplayName.SetDefault("Rare Waifu in a Bottle"); - Tooltip.SetDefault("Summons a sand elemental to fight for you\n;D"); + DisplayName.SetDefault("Madame in a Bottle"); + Tooltip.SetDefault("Summons a sand elemental to heal you\n" + + ";D"); } public override void SetDefaults() @@ -54,7 +55,7 @@ namespace CalamityMod.Items.Accessories } if (player.ownedProjectileCounts[mod.ProjectileType("DrewsSandyWaifu")] < 1) { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, mod.ProjectileType("DrewsSandyWaifu"), 45, 2f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, mod.ProjectileType("DrewsSandyWaifu"), (int)(45f * player.minionDamage), 2f, Main.myPlayer, 0f, 0f); } } } diff --git a/Items/Accessories/YharimsInsignia.cs b/Items/Accessories/YharimsInsignia.cs index ff2bd1ba49..b9eb39813b 100644 --- a/Items/Accessories/YharimsInsignia.cs +++ b/Items/Accessories/YharimsInsignia.cs @@ -15,11 +15,11 @@ namespace CalamityMod.Items.Accessories { DisplayName.SetDefault("Yharim's Insignia"); Tooltip.SetDefault("10% increased damage when under 50% life\n" + - "Increased melee speed as health lowers\n" + - "5% increased melee speed and damage\n" + + "10% increased melee speed\n" + + "5% increased melee damage\n" + "Melee attacks and melee projectiles inflict holy fire\n" + "Increased invincibility after taking damage\n" + - "You are immune to lava\n" + + "Temporary immunity to lava\n" + "Increased melee knockback"); } @@ -29,18 +29,8 @@ namespace CalamityMod.Items.Accessories item.height = 38; item.value = Item.buyPrice(0, 30, 0, 0); item.accessory = true; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 200); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 12; + } public override void UpdateAccessory(Player player, bool hideVisual) { diff --git a/Items/AerialiteBar.cs b/Items/AerialiteBar.cs index 6bfa7a823f..16cb486966 100644 --- a/Items/AerialiteBar.cs +++ b/Items/AerialiteBar.cs @@ -7,29 +7,31 @@ using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Items; -namespace CalamityMod.Items { -public class AerialiteBar : ModItem +namespace CalamityMod.Items { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Aerialite Bar"); - } - - public override void SetDefaults() + public class AerialiteBar : ModItem { - item.width = 15; - item.height = 12; - item.maxStack = 999; - item.value = 18750; - item.rare = 2; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Aerialite Bar"); + } + + public override void SetDefaults() + { + item.width = 30; + item.height = 24; + item.maxStack = 999; + item.value = Item.buyPrice(0, 2, 0, 0); + item.rare = 3; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "AerialiteOre", 4); + recipe.AddTile(TileID.Furnaces); + recipe.SetResult(this); + recipe.AddRecipe(); + } } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "AerialiteOre", 4); - recipe.AddTile(TileID.Furnaces); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} \ No newline at end of file +} \ No newline at end of file diff --git a/Items/Amidias/AmidiasTrident.cs b/Items/Amidias/AmidiasTrident.cs new file mode 100644 index 0000000000..2f9fd5fe4a --- /dev/null +++ b/Items/Amidias/AmidiasTrident.cs @@ -0,0 +1,53 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.Amidias +{ + public class AmidiasTrident : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Amidias' Trident"); + Tooltip.SetDefault("Gains the power to shoot whirlpools after Skeletron has been defeated"); + } + + public override void SetDefaults() + { + item.width = 44; + item.damage = 20; + item.melee = true; + item.noMelee = true; + item.useTurn = true; + item.noUseGraphic = true; + item.useAnimation = 17; + item.useStyle = 5; + item.useTime = 17; + item.knockBack = 4.5f; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.height = 44; + item.value = Item.buyPrice(0, 2, 0, 0); + item.rare = 2; + item.shoot = mod.ProjectileType("AmidiasTridentProj"); + item.shootSpeed = 6f; + } + + public override bool CanUseItem(Player player) + { + for (int i = 0; i < 1000; ++i) + { + if (Main.projectile[i].active && Main.projectile[i].owner == Main.myPlayer && Main.projectile[i].type == item.shoot) + { + return false; + } + } + return true; + } + } +} diff --git a/Items/Amidias/AmidiasTrident.png b/Items/Amidias/AmidiasTrident.png new file mode 100644 index 0000000000..757e56c1e2 Binary files /dev/null and b/Items/Amidias/AmidiasTrident.png differ diff --git a/Items/Amidias/CoralCannon.cs b/Items/Amidias/CoralCannon.cs new file mode 100644 index 0000000000..dd9d2ccfb7 --- /dev/null +++ b/Items/Amidias/CoralCannon.cs @@ -0,0 +1,58 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.Amidias +{ + public class CoralCannon : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Coral Cannon"); + Tooltip.SetDefault("Has a chance to shoot a big coral that stuns enemies"); + } + + public override void SetDefaults() + { + item.damage = 20; + item.ranged = true; + item.width = 52; + item.height = 40; + item.crit += 10; + item.useTime = 30; + item.useAnimation = 30; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 7.5f; + item.value = Item.buyPrice(0, 2, 0, 0); + item.rare = 2; + item.UseSound = SoundID.Item61; + item.autoReuse = true; + item.shoot = mod.ProjectileType("SmallCoral"); + item.shootSpeed = 10f; + } + + public override Vector2? HoldoutOffset() + { + return new Vector2(-10, 0); + } + + public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + if (Main.rand.Next(5) == 0) + { + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, mod.ProjectileType("BigCoral"), (int)((double)damage * 2.0), knockBack * 2f, player.whoAmI, 0.0f, 0.0f); + } + else + { + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0.0f, 0.0f); + } + return false; + } + } +} \ No newline at end of file diff --git a/Items/Amidias/CoralCannon.png b/Items/Amidias/CoralCannon.png new file mode 100644 index 0000000000..2a15ddc7b9 Binary files /dev/null and b/Items/Amidias/CoralCannon.png differ diff --git a/Items/Amidias/MagicalConch.cs b/Items/Amidias/MagicalConch.cs new file mode 100644 index 0000000000..847f4d3709 --- /dev/null +++ b/Items/Amidias/MagicalConch.cs @@ -0,0 +1,81 @@ +using System; +using System.Collections.Generic; +using System.IO; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.GameContent; +using Terraria.IO; +using Terraria.ObjectData; +using Terraria.Utilities; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.Amidias +{ + public class MagicalConch : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Magical Conch"); + Tooltip.SetDefault("Summons a hermit crab to fight for you"); + } + + public override void SetDefaults() + { + item.damage = 20; + item.mana = 10; + item.width = 34; + item.height = 24; + item.useTime = 36; + item.useAnimation = 36; + item.useStyle = 1; + item.noMelee = true; + item.knockBack = 2f; + item.value = Item.buyPrice(0, 2, 0, 0); + item.rare = 2; + item.UseSound = SoundID.Item44; + item.autoReuse = true; + item.shoot = mod.ProjectileType("HermitCrab"); + item.shootSpeed = 10f; + item.summon = true; + } + + public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + int i = Main.myPlayer; + float num72 = item.shootSpeed; + int num73 = damage; + float num74 = knockBack; + num74 = player.GetWeaponKnockback(item, num74); + player.itemTime = item.useTime; + Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); + float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; + float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; + if (player.gravDir == -1f) + { + num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; + } + float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); + float num81 = num80; + if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) + { + num78 = (float)player.direction; + num79 = 0f; + num80 = num72; + } + else + { + num80 = num72 / num80; + } + num78 = 0f; + num79 = 0f; + vector2.X = (float)Main.mouseX + Main.screenPosition.X; + vector2.Y = (float)Main.mouseY + Main.screenPosition.Y; + Projectile.NewProjectile(vector2.X, vector2.Y, num78, num79, mod.ProjectileType("HermitCrab"), num73, num74, i, 0f, 0f); + return false; + } + } +} \ No newline at end of file diff --git a/Items/Amidias/MagicalConch.png b/Items/Amidias/MagicalConch.png new file mode 100644 index 0000000000..dae5fd2da2 Binary files /dev/null and b/Items/Amidias/MagicalConch.png differ diff --git a/Items/Amidias/Shellshooter.cs b/Items/Amidias/Shellshooter.cs new file mode 100644 index 0000000000..40829892f8 --- /dev/null +++ b/Items/Amidias/Shellshooter.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.Amidias +{ + public class Shellshooter : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Shellshooter"); + Tooltip.SetDefault("Shoots slow, powerful shells"); + } + + public override void SetDefaults() + { + item.damage = 30; + item.ranged = true; + item.width = 30; + item.height = 38; + item.crit += 15; + item.useTime = 70; + item.useAnimation = 70; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 6f; + item.value = Item.buyPrice(0, 2, 0, 0); + item.rare = 2; + item.UseSound = SoundID.Item5; + item.autoReuse = true; + item.shoot = mod.ProjectileType("Shell"); + item.shootSpeed = 1.5f; + item.useAmmo = 40; + } + + public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, mod.ProjectileType("Shell"), damage, knockBack, player.whoAmI, 0.0f, 0.0f); + return false; + } + } +} \ No newline at end of file diff --git a/Items/Amidias/Shellshooter.png b/Items/Amidias/Shellshooter.png new file mode 100644 index 0000000000..20dafc6867 Binary files /dev/null and b/Items/Amidias/Shellshooter.png differ diff --git a/Items/Amidias/UrchinFlail.cs b/Items/Amidias/UrchinFlail.cs new file mode 100644 index 0000000000..e07a093f6c --- /dev/null +++ b/Items/Amidias/UrchinFlail.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.Amidias +{ + public class UrchinFlail : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Urchin Flail"); + Tooltip.SetDefault("Launch an urchin ball, which shoots a spike on contact with an enemy"); + } + + public override void SetDefaults() + { + item.damage = 20; + item.melee = true; + item.width = 44; + item.height = 36; + item.useTime = 25; + item.useAnimation = 25; + item.useStyle = 5; + item.noMelee = true; + item.noUseGraphic = true; + item.knockBack = 6f; + item.value = Item.buyPrice(0, 2, 0, 0); + item.rare = 2; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.channel = true; + item.shoot = mod.ProjectileType("UrchinBall"); + item.shootSpeed = 12f; + } + } +} \ No newline at end of file diff --git a/Items/Amidias/UrchinFlail.png b/Items/Amidias/UrchinFlail.png new file mode 100644 index 0000000000..3079ad4adb Binary files /dev/null and b/Items/Amidias/UrchinFlail.png differ diff --git a/Items/Amidias/Waywasher.cs b/Items/Amidias/Waywasher.cs new file mode 100644 index 0000000000..c0f22cbe08 --- /dev/null +++ b/Items/Amidias/Waywasher.cs @@ -0,0 +1,49 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.Amidias +{ + public class Waywasher : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Waywasher"); + Tooltip.SetDefault("Casts inaccurate water bolts"); + } + + public override void SetDefaults() + { + item.damage = 10; + item.magic = true; + item.mana = 4; + item.width = 30; + item.height = 30; + item.useTime = 12; + item.useAnimation = 12; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 2.5f; + item.value = Item.buyPrice(0, 2, 0, 0); + item.rare = 2; + item.UseSound = SoundID.Item8; + item.autoReuse = true; + item.shoot = mod.ProjectileType("WaywasherProj"); + item.shootSpeed = 8f; + } + + public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + float SpeedX = speedX + (float)Main.rand.Next(-25, 26) * 0.05f; + float SpeedY = speedY + (float)Main.rand.Next(-25, 26) * 0.05f; + Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, mod.ProjectileType("WaywasherProj"), damage, knockBack, player.whoAmI, 0.0f, 0.0f); + return false; + } + + } +} \ No newline at end of file diff --git a/Items/Amidias/Waywasher.png b/Items/Amidias/Waywasher.png new file mode 100644 index 0000000000..ce1ff4da7d Binary files /dev/null and b/Items/Amidias/Waywasher.png differ diff --git a/Items/AncientBoneDust.cs b/Items/AncientBoneDust.cs index 99c6607017..28f013dd47 100644 --- a/Items/AncientBoneDust.cs +++ b/Items/AncientBoneDust.cs @@ -21,8 +21,8 @@ namespace CalamityMod.Items item.width = 20; item.height = 20; item.maxStack = 999; - item.value = 5000; - item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.rare = 1; } } } \ No newline at end of file diff --git a/Items/AnechoicCoating.cs b/Items/AnechoicCoating.cs index 1d1f04c77c..dbb62c27f5 100644 --- a/Items/AnechoicCoating.cs +++ b/Items/AnechoicCoating.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items item.consumable = true; item.buffType = mod.BuffType("AnechoicCoating"); item.buffTime = 7200; - item.value = 5000; + item.value = Item.buyPrice(0, 2, 0, 0); } public override void AddRecipes() diff --git a/Items/AquaticScourge/AquaticEmblem.cs b/Items/AquaticScourge/AquaticEmblem.cs index d00d8850ba..0bbfaa8eb3 100644 --- a/Items/AquaticScourge/AquaticEmblem.cs +++ b/Items/AquaticScourge/AquaticEmblem.cs @@ -17,7 +17,9 @@ namespace CalamityMod.Items.AquaticScourge Tooltip.SetDefault("Most ocean enemies become friendly and provides waterbreathing\n" + "Being underwater slowly boosts your defense over time but also slows movement speed\n" + "The defense boost and movement speed reduction slowly vanish while outside of water\n" + - "Maximum defense boost is 40, maximum movement speed reduction is 15%"); + "Maximum defense boost is 30, maximum movement speed reduction is 5%\n" + + "Provides a small amount of light in the abyss\n" + + "Moderately reduces breath loss in the abyss"); } public override void SetDefaults() diff --git a/Items/AquaticScourge/AquaticScourgeBag.cs b/Items/AquaticScourge/AquaticScourgeBag.cs index d8c5b96139..ec299aa587 100644 --- a/Items/AquaticScourge/AquaticScourgeBag.cs +++ b/Items/AquaticScourge/AquaticScourgeBag.cs @@ -30,6 +30,25 @@ namespace CalamityMod.Items.AquaticScourge public override void OpenBossBag(Player player) { + if (CalamityWorld.revenge) + { + if (Main.rand.Next(20) == 0) + { + switch (Main.rand.Next(3)) + { + case 0: + player.QuickSpawnItem(mod.ItemType("StressPills")); + break; + case 1: + player.QuickSpawnItem(mod.ItemType("Laudanum")); + break; + case 2: + player.QuickSpawnItem(mod.ItemType("HeartofDarkness")); + break; + } + } + } + player.TryGettingDevArmor(); if (Main.rand.Next(3) == 0) { player.QuickSpawnItem(mod.ItemType("DeepseaStaff")); diff --git a/Items/Armageddon.cs b/Items/Armageddon.cs index e882fbd383..2edfe05642 100644 --- a/Items/Armageddon.cs +++ b/Items/Armageddon.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items Tooltip.SetDefault("Makes any hit while a boss is alive instantly kill you\n" + "Effect can be toggled on and off\n" + "Using this while a boss is alive will instantly kill you and despawn the boss\n" + - "If a boss is defeated with this effect active it will drop 11 treasure bags, 10 in normal mode\n" + + "If a boss is defeated with this effect active it will drop 6 treasure bags, 5 in normal mode\n" + "If any player dies while a boss is alive the boss will instantly despawn"); } diff --git a/Items/Armor/AbyssalDivingSuit.cs b/Items/Armor/AbyssalDivingSuit.cs index f40151dbe5..1a385f382b 100644 --- a/Items/Armor/AbyssalDivingSuit.cs +++ b/Items/Armor/AbyssalDivingSuit.cs @@ -53,7 +53,8 @@ namespace CalamityMod.Items.Armor recipe.AddIngredient(null, "Lumenite", 40); recipe.AddIngredient(null, "DepthCells", 40); recipe.AddIngredient(null, "Tenebris", 15); - recipe.AddTile(TileID.MythrilAnvil); + recipe.AddIngredient(ItemID.LunarBar, 5); + recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this); recipe.AddRecipe(); } diff --git a/Items/Armor/AerospecBreastplate.cs b/Items/Armor/AerospecBreastplate.cs index 4242818411..436545343c 100644 --- a/Items/Armor/AerospecBreastplate.cs +++ b/Items/Armor/AerospecBreastplate.cs @@ -23,8 +23,8 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 65000; - item.rare = 3; + item.value = Item.buyPrice(0, 4, 0, 0); + item.rare = 3; item.defense = 7; } diff --git a/Items/Armor/AerospecHat.cs b/Items/Armor/AerospecHat.cs index d26fe29f73..4a32e2c374 100644 --- a/Items/Armor/AerospecHat.cs +++ b/Items/Armor/AerospecHat.cs @@ -22,8 +22,8 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 50000; - item.rare = 3; + item.value = Item.buyPrice(0, 5, 0, 0); + item.rare = 3; item.defense = 3; //15 } diff --git a/Items/Armor/AerospecHeadgear.cs b/Items/Armor/AerospecHeadgear.cs index 0ec17be458..ff0bfa92dd 100644 --- a/Items/Armor/AerospecHeadgear.cs +++ b/Items/Armor/AerospecHeadgear.cs @@ -23,8 +23,8 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 50000; - item.rare = 3; + item.value = Item.buyPrice(0, 5, 0, 0); + item.rare = 3; item.defense = 4; //17 } @@ -48,17 +48,21 @@ namespace CalamityMod.Items.Armor { player.setBonus = "5% increased movement speed and rogue critical strike chance\n" + "Taking over 25 damage in one hit will cause a spread of homing feathers to fall\n" + - "Allows you to fall more quickly and disables fall damage"; + "Allows you to fall more quickly and disables fall damage\n" + + "Rogue stealth builds while not attacking and not moving, up to a max of 100\n" + + "Rogue stealth only reduces when you attack, it does not reduce while moving\n" + + "The higher your rogue stealth the higher your rogue damage, crit, and movement speed"; CalamityPlayer modPlayer = player.GetModPlayer(mod); modPlayer.aeroSet = true; - player.noFallDmg = true; + modPlayer.rogueStealthMax = 1f; + player.noFallDmg = true; player.moveSpeed += 0.05f; CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 5; } public override void UpdateEquip(Player player) { - player.thrownDamage += 0.08f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.08f; } public override void AddRecipes() diff --git a/Items/Armor/AerospecHelm.cs b/Items/Armor/AerospecHelm.cs index 5abe814f04..f531b427b1 100644 --- a/Items/Armor/AerospecHelm.cs +++ b/Items/Armor/AerospecHelm.cs @@ -22,8 +22,8 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 50000; - item.rare = 3; + item.value = Item.buyPrice(0, 5, 0, 0); + item.rare = 3; item.defense = 7; //20 } diff --git a/Items/Armor/AerospecHelmet.cs b/Items/Armor/AerospecHelmet.cs index 1d494ee5a3..d2a6787d21 100644 --- a/Items/Armor/AerospecHelmet.cs +++ b/Items/Armor/AerospecHelmet.cs @@ -22,8 +22,8 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 50000; - item.rare = 3; + item.value = Item.buyPrice(0, 5, 0, 0); + item.rare = 3; item.defense = 2; //13 } @@ -55,7 +55,7 @@ namespace CalamityMod.Items.Armor } if (player.ownedProjectileCounts[mod.ProjectileType("Valkyrie")] < 1) { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, mod.ProjectileType("Valkyrie"), 25, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, mod.ProjectileType("Valkyrie"), (int)(25f * player.minionDamage), 0f, Main.myPlayer, 0f, 0f); } } player.minionDamage += 0.16f; diff --git a/Items/Armor/AerospecHood.cs b/Items/Armor/AerospecHood.cs index c68379c918..be31ecfdb5 100644 --- a/Items/Armor/AerospecHood.cs +++ b/Items/Armor/AerospecHood.cs @@ -22,8 +22,8 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 50000; - item.rare = 3; + item.value = Item.buyPrice(0, 5, 0, 0); + item.rare = 3; item.defense = 5; //18 } diff --git a/Items/Armor/AerospecLeggings.cs b/Items/Armor/AerospecLeggings.cs index 5f12ec5228..552ab8bfdf 100644 --- a/Items/Armor/AerospecLeggings.cs +++ b/Items/Armor/AerospecLeggings.cs @@ -22,8 +22,8 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 57500; - item.rare = 3; + item.value = Item.buyPrice(0, 3, 0, 0); + item.rare = 3; item.defense = 6; } diff --git a/Items/Armor/AstralBreastplate.cs b/Items/Armor/AstralBreastplate.cs index 8f0933a58e..eee2fb8565 100644 --- a/Items/Armor/AstralBreastplate.cs +++ b/Items/Armor/AstralBreastplate.cs @@ -24,8 +24,8 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 470000; - item.rare = 7; + item.value = Item.buyPrice(0, 24, 0, 0); + item.rare = 7; item.defense = 23; } diff --git a/Items/Armor/AstralHelm.cs b/Items/Armor/AstralHelm.cs index 49b965c807..a0030af0c2 100644 --- a/Items/Armor/AstralHelm.cs +++ b/Items/Armor/AstralHelm.cs @@ -23,8 +23,8 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 500000; - item.rare = 7; + item.value = Item.buyPrice(0, 30, 0, 0); + item.rare = 7; item.defense = 13; //53 } diff --git a/Items/Armor/AstralLeggings.cs b/Items/Armor/AstralLeggings.cs index f38f4cba34..04a0cac581 100644 --- a/Items/Armor/AstralLeggings.cs +++ b/Items/Armor/AstralLeggings.cs @@ -23,8 +23,8 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 450000; - item.rare = 7; + item.value = Item.buyPrice(0, 18, 0, 0); + item.rare = 7; item.defense = 17; } diff --git a/Items/Armor/AtaxiaArmor.cs b/Items/Armor/AtaxiaArmor.cs index c147f15b2f..5724556f75 100644 --- a/Items/Armor/AtaxiaArmor.cs +++ b/Items/Armor/AtaxiaArmor.cs @@ -24,8 +24,8 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 400000; - item.rare = 8; + item.value = Item.buyPrice(0, 24, 0, 0); + item.rare = 8; item.defense = 20; } diff --git a/Items/Armor/AtaxiaArmor.png b/Items/Armor/AtaxiaArmor.png index aa3ba89f66..525fb6b485 100644 Binary files a/Items/Armor/AtaxiaArmor.png and b/Items/Armor/AtaxiaArmor.png differ diff --git a/Items/Armor/AtaxiaArmor_Arms.png b/Items/Armor/AtaxiaArmor_Arms.png index bf88d84419..fa8fec2f8d 100644 Binary files a/Items/Armor/AtaxiaArmor_Arms.png and b/Items/Armor/AtaxiaArmor_Arms.png differ diff --git a/Items/Armor/AtaxiaArmor_Body.png b/Items/Armor/AtaxiaArmor_Body.png index 3e1a44d881..f890e0b414 100644 Binary files a/Items/Armor/AtaxiaArmor_Body.png and b/Items/Armor/AtaxiaArmor_Body.png differ diff --git a/Items/Armor/AtaxiaArmor_FemaleBody.png b/Items/Armor/AtaxiaArmor_FemaleBody.png index 95de403c1b..aabc67e196 100644 Binary files a/Items/Armor/AtaxiaArmor_FemaleBody.png and b/Items/Armor/AtaxiaArmor_FemaleBody.png differ diff --git a/Items/Armor/AtaxiaHeadgear.cs b/Items/Armor/AtaxiaHeadgear.cs index 9f5a4857cd..72056da0d4 100644 --- a/Items/Armor/AtaxiaHeadgear.cs +++ b/Items/Armor/AtaxiaHeadgear.cs @@ -17,15 +17,15 @@ namespace CalamityMod.Items.Armor DisplayName.SetDefault("Ataxia Headgear"); Tooltip.SetDefault("12% increased ranged damage and 10% increased ranged critical strike chance\n" + "Reduces ammo cost by 25%\n" + - "Immune to lava and fire damage"); + "Temporary immunity to lava and immunity to fire damage"); } public override void SetDefaults() { item.width = 18; item.height = 18; - item.value = 450000; - item.rare = 8; + item.value = Item.buyPrice(0, 30, 0, 0); + item.rare = 8; item.defense = 15; //53 } @@ -54,10 +54,6 @@ namespace CalamityMod.Items.Armor CalamityPlayer modPlayer = player.GetModPlayer(mod); modPlayer.ataxiaBlaze = true; modPlayer.ataxiaBolt = true; - if (player.statLife <= (player.statLifeMax2 * 0.5f)) - { - player.AddBuff(BuffID.Inferno, 2); - } player.rangedDamage += 0.05f; } @@ -66,8 +62,8 @@ namespace CalamityMod.Items.Armor player.ammoCost75 = true; player.rangedDamage += 0.12f; player.rangedCrit += 10; - player.lavaImmune = true; - player.buffImmune[BuffID.OnFire] = true; + player.lavaMax += 240; + player.buffImmune[BuffID.OnFire] = true; } public override void AddRecipes() diff --git a/Items/Armor/AtaxiaHeadgear.png b/Items/Armor/AtaxiaHeadgear.png index 8ef0bc79b0..01ce905cb8 100644 Binary files a/Items/Armor/AtaxiaHeadgear.png and b/Items/Armor/AtaxiaHeadgear.png differ diff --git a/Items/Armor/AtaxiaHeadgear_Head.png b/Items/Armor/AtaxiaHeadgear_Head.png index 571817dfba..641731d4b3 100644 Binary files a/Items/Armor/AtaxiaHeadgear_Head.png and b/Items/Armor/AtaxiaHeadgear_Head.png differ diff --git a/Items/Armor/AtaxiaHelm.cs b/Items/Armor/AtaxiaHelm.cs index cc5814eff8..50fc506c69 100644 --- a/Items/Armor/AtaxiaHelm.cs +++ b/Items/Armor/AtaxiaHelm.cs @@ -17,15 +17,15 @@ namespace CalamityMod.Items.Armor DisplayName.SetDefault("Ataxia Helm"); Tooltip.SetDefault("12% increased melee damage and 10% increased melee critical strike chance\n" + "Melee attacks and melee projectiles inflict on fire\n" + - "Immune to lava and fire damage"); + "Temporary immunity to lava and immunity to fire damage"); } public override void SetDefaults() { item.width = 18; item.height = 18; - item.value = 450000; - item.rare = 8; + item.value = Item.buyPrice(0, 30, 0, 0); + item.rare = 8; item.defense = 25; //67 } @@ -48,10 +48,6 @@ namespace CalamityMod.Items.Armor CalamityPlayer modPlayer = player.GetModPlayer(mod); modPlayer.ataxiaBlaze = true; modPlayer.ataxiaGeyser = true; - if (player.statLife <= (int)((double)player.statLifeMax2 * 0.5)) - { - player.AddBuff(BuffID.Inferno, 2); - } player.meleeDamage += 0.05f; } @@ -61,8 +57,8 @@ namespace CalamityMod.Items.Armor modPlayer.ataxiaFire = true; player.meleeDamage += 0.12f; player.meleeCrit += 10; - player.lavaImmune = true; - player.buffImmune[BuffID.OnFire] = true; + player.lavaMax += 240; + player.buffImmune[BuffID.OnFire] = true; } public override void AddRecipes() diff --git a/Items/Armor/AtaxiaHelm.png b/Items/Armor/AtaxiaHelm.png index 186a7141d4..24ad176f65 100644 Binary files a/Items/Armor/AtaxiaHelm.png and b/Items/Armor/AtaxiaHelm.png differ diff --git a/Items/Armor/AtaxiaHelm_Head.png b/Items/Armor/AtaxiaHelm_Head.png index 5bbdca533b..74d340e905 100644 Binary files a/Items/Armor/AtaxiaHelm_Head.png and b/Items/Armor/AtaxiaHelm_Head.png differ diff --git a/Items/Armor/AtaxiaHelmet.cs b/Items/Armor/AtaxiaHelmet.cs index a1c5161757..2139b51470 100644 --- a/Items/Armor/AtaxiaHelmet.cs +++ b/Items/Armor/AtaxiaHelmet.cs @@ -17,15 +17,15 @@ namespace CalamityMod.Items.Armor DisplayName.SetDefault("Ataxia Helmet"); Tooltip.SetDefault("5% increased minion damage and increased minion knockback\n" + "+2 max minions\n" + - "Immune to lava and fire damage"); + "Temporary immunity to lava and immunity to fire damage"); } public override void SetDefaults() { item.width = 18; item.height = 18; - item.value = 450000; - item.rare = 8; + item.value = Item.buyPrice(0, 30, 0, 0); + item.rare = 8; item.defense = 6; //40 } @@ -56,13 +56,9 @@ namespace CalamityMod.Items.Armor } if (player.ownedProjectileCounts[mod.ProjectileType("ChaosSpirit")] < 1) { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, mod.ProjectileType("ChaosSpirit"), 0, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, mod.ProjectileType("ChaosSpirit"), (int)(190f * player.minionDamage), 0f, Main.myPlayer, 0f, 0f); } } - if (player.statLife <= (player.statLifeMax2 * 0.5f)) - { - player.AddBuff(BuffID.Inferno, 2); - } player.minionDamage += 0.4f; } @@ -71,8 +67,8 @@ namespace CalamityMod.Items.Armor player.minionDamage += 0.05f; player.minionKB += 1.5f; player.maxMinions += 2; - player.lavaImmune = true; - player.buffImmune[BuffID.OnFire] = true; + player.lavaMax += 240; + player.buffImmune[BuffID.OnFire] = true; } public override void AddRecipes() diff --git a/Items/Armor/AtaxiaHelmet.png b/Items/Armor/AtaxiaHelmet.png index 8a4ee96897..93c34cfe64 100644 Binary files a/Items/Armor/AtaxiaHelmet.png and b/Items/Armor/AtaxiaHelmet.png differ diff --git a/Items/Armor/AtaxiaHelmet_Head.png b/Items/Armor/AtaxiaHelmet_Head.png index 2a4f5ac16a..e474b10c26 100644 Binary files a/Items/Armor/AtaxiaHelmet_Head.png and b/Items/Armor/AtaxiaHelmet_Head.png differ diff --git a/Items/Armor/AtaxiaHood.cs b/Items/Armor/AtaxiaHood.cs index 3d5e46e092..d98195488c 100644 --- a/Items/Armor/AtaxiaHood.cs +++ b/Items/Armor/AtaxiaHood.cs @@ -18,15 +18,15 @@ namespace CalamityMod.Items.Armor DisplayName.SetDefault("Ataxia Hood"); Tooltip.SetDefault("12% increased rogue damage and 10% increased rogue critical strike chance\n" + "50% chance to not consume rogue items\n" + - "Immune to lava and fire damage"); + "Temporary immunity to lava and immunity to fire damage"); } public override void SetDefaults() { item.width = 18; item.height = 18; - item.value = 450000; - item.rare = 8; + item.value = Item.buyPrice(0, 30, 0, 0); + item.rare = 8; item.defense = 12; //49 } @@ -45,14 +45,14 @@ namespace CalamityMod.Items.Armor player.setBonus = "5% increased rogue damage\n" + "Inferno effect when below 50% life\n" + "Rogue weapons have a 10% chance to unleash a volley of chaos flames around the player that chase enemies when used\n" + - "You have a 20% chance to emit a blazing explosion when you are hit"; + "You have a 20% chance to emit a blazing explosion when you are hit\n" + + "Rogue stealth builds while not attacking and not moving, up to a max of 120\n" + + "Rogue stealth only reduces when you attack, it does not reduce while moving\n" + + "The higher your rogue stealth the higher your rogue damage, crit, and movement speed"; CalamityPlayer modPlayer = player.GetModPlayer(mod); modPlayer.ataxiaBlaze = true; modPlayer.ataxiaVolley = true; - if (player.statLife <= (player.statLifeMax2 * 0.5f)) - { - player.AddBuff(BuffID.Inferno, 2); - } + modPlayer.rogueStealthMax = 1.2f; CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.05f; } @@ -61,8 +61,8 @@ namespace CalamityMod.Items.Armor CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingAmmoCost50 = true; CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.12f; CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 10; - player.lavaImmune = true; - player.buffImmune[BuffID.OnFire] = true; + player.lavaMax += 240; + player.buffImmune[BuffID.OnFire] = true; } public override void AddRecipes() diff --git a/Items/Armor/AtaxiaHood.png b/Items/Armor/AtaxiaHood.png index f458d6a408..7f066ab82a 100644 Binary files a/Items/Armor/AtaxiaHood.png and b/Items/Armor/AtaxiaHood.png differ diff --git a/Items/Armor/AtaxiaHood_Head.png b/Items/Armor/AtaxiaHood_Head.png index 025d50fe93..d4838159f0 100644 Binary files a/Items/Armor/AtaxiaHood_Head.png and b/Items/Armor/AtaxiaHood_Head.png differ diff --git a/Items/Armor/AtaxiaMask.cs b/Items/Armor/AtaxiaMask.cs index b880d67325..69337495bf 100644 --- a/Items/Armor/AtaxiaMask.cs +++ b/Items/Armor/AtaxiaMask.cs @@ -17,15 +17,15 @@ namespace CalamityMod.Items.Armor DisplayName.SetDefault("Ataxia Mask"); Tooltip.SetDefault("12% increased magic damage, reduces mana usage by 10%, and 10% increased magic critical strike chance\n" + "+100 Max Mana\n" + - "Immune to lava and fire damage"); + "Temporary immunity to lava and immunity to fire damage"); } public override void SetDefaults() { item.width = 18; item.height = 18; - item.value = 450000; - item.rare = 8; + item.value = Item.buyPrice(0, 30, 0, 0); + item.rare = 8; item.defense = 9; //45 } @@ -48,10 +48,6 @@ namespace CalamityMod.Items.Armor CalamityPlayer modPlayer = player.GetModPlayer(mod); modPlayer.ataxiaBlaze = true; modPlayer.ataxiaMage = true; - if (player.statLife <= (player.statLifeMax2 * 0.5f)) - { - player.AddBuff(BuffID.Inferno, 2); - } player.magicDamage += 0.05f; } @@ -61,8 +57,8 @@ namespace CalamityMod.Items.Armor player.statManaMax2 += 100; player.magicDamage += 0.12f; player.magicCrit += 10; - player.lavaImmune = true; - player.buffImmune[BuffID.OnFire] = true; + player.lavaMax += 240; + player.buffImmune[BuffID.OnFire] = true; } public override void AddRecipes() diff --git a/Items/Armor/AtaxiaMask.png b/Items/Armor/AtaxiaMask.png index e19479f6ce..6f1e5446b2 100644 Binary files a/Items/Armor/AtaxiaMask.png and b/Items/Armor/AtaxiaMask.png differ diff --git a/Items/Armor/AtaxiaMask_Head.png b/Items/Armor/AtaxiaMask_Head.png index af7fc7a2ab..7efd79c740 100644 Binary files a/Items/Armor/AtaxiaMask_Head.png and b/Items/Armor/AtaxiaMask_Head.png differ diff --git a/Items/Armor/AtaxiaSubligar.cs b/Items/Armor/AtaxiaSubligar.cs index b0edc5d6a1..0bfe5baa96 100644 --- a/Items/Armor/AtaxiaSubligar.cs +++ b/Items/Armor/AtaxiaSubligar.cs @@ -24,8 +24,8 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 412500; - item.rare = 8; + item.value = Item.buyPrice(0, 18, 0, 0); + item.rare = 8; item.defense = 14; } diff --git a/Items/Armor/AtaxiaSubligar.png b/Items/Armor/AtaxiaSubligar.png index f9127a0acd..677ffd9a46 100644 Binary files a/Items/Armor/AtaxiaSubligar.png and b/Items/Armor/AtaxiaSubligar.png differ diff --git a/Items/Armor/AtaxiaSubligar_Legs.png b/Items/Armor/AtaxiaSubligar_Legs.png index 09e2907d2b..2de4516947 100644 Binary files a/Items/Armor/AtaxiaSubligar_Legs.png and b/Items/Armor/AtaxiaSubligar_Legs.png differ diff --git a/Items/Armor/AureusMask.cs b/Items/Armor/AureusMask.cs new file mode 100644 index 0000000000..af1be8f51f --- /dev/null +++ b/Items/Armor/AureusMask.cs @@ -0,0 +1,27 @@ +using System.Collections.Generic; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Armor +{ + [AutoloadEquip(EquipType.Head)] + public class AureusMask : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Astrum Aureus Mask"); + } + + public override void SetDefaults() + { + item.width = 30; + item.height = 28; + item.rare = 1; + item.vanity = true; + } + + public override bool DrawHead() + { + return false; + } + } +} \ No newline at end of file diff --git a/Items/Armor/AureusMask.png b/Items/Armor/AureusMask.png new file mode 100644 index 0000000000..92e55341fe Binary files /dev/null and b/Items/Armor/AureusMask.png differ diff --git a/Items/Armor/AureusMask_Head.png b/Items/Armor/AureusMask_Head.png new file mode 100644 index 0000000000..8c0bedb191 Binary files /dev/null and b/Items/Armor/AureusMask_Head.png differ diff --git a/Items/Armor/AuricTeslaBodyArmor.cs b/Items/Armor/AuricTeslaBodyArmor.cs index 122159ed4d..e427a3d0dd 100644 --- a/Items/Armor/AuricTeslaBodyArmor.cs +++ b/Items/Armor/AuricTeslaBodyArmor.cs @@ -27,20 +27,10 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 9250000; - item.defense = 48; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB); - } - } - } + item.value = Item.buyPrice(1, 44, 0, 0); + item.defense = 48; + item.GetGlobalItem(mod).postMoonLordRarity = 20; + } public override void UpdateEquip(Player player) { diff --git a/Items/Armor/AuricTeslaCuisses.cs b/Items/Armor/AuricTeslaCuisses.cs index 748b15c4c9..7c8407ff60 100644 --- a/Items/Armor/AuricTeslaCuisses.cs +++ b/Items/Armor/AuricTeslaCuisses.cs @@ -25,20 +25,10 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 8750000; - item.defense = 44; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB); - } - } - } + item.value = Item.buyPrice(1, 8, 0, 0); + item.defense = 44; + item.GetGlobalItem(mod).postMoonLordRarity = 20; + } public override void UpdateEquip(Player player) { diff --git a/Items/Armor/AuricTeslaHelm.cs b/Items/Armor/AuricTeslaHelm.cs index 256533acb3..9154471758 100644 --- a/Items/Armor/AuricTeslaHelm.cs +++ b/Items/Armor/AuricTeslaHelm.cs @@ -23,20 +23,10 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 10000000; - item.defense = 54; //132 - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB); - } - } - } + item.value = Item.buyPrice(1, 80, 0, 0); + item.defense = 54; //132 + item.GetGlobalItem(mod).postMoonLordRarity = 20; + } public override bool IsArmorSet(Item head, Item body, Item legs) { @@ -66,8 +56,8 @@ namespace CalamityMod.Items.Armor modPlayer.silvaMelee = true; modPlayer.auricSet = true; player.thorns += 3f; - player.lavaImmune = true; - player.ignoreWater = true; + player.lavaMax += 240; + player.ignoreWater = true; player.crimsonRegen = true; player.aggro += 1200; if (player.lavaWet) diff --git a/Items/Armor/AuricTeslaHoodedFacemask.cs b/Items/Armor/AuricTeslaHoodedFacemask.cs index 4d851600fd..ff7dc9010c 100644 --- a/Items/Armor/AuricTeslaHoodedFacemask.cs +++ b/Items/Armor/AuricTeslaHoodedFacemask.cs @@ -23,20 +23,10 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 10000000; - item.defense = 40; //132 - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB); - } - } - } + item.value = Item.buyPrice(1, 80, 0, 0); + item.defense = 40; //132 + item.GetGlobalItem(mod).postMoonLordRarity = 20; + } public override bool IsArmorSet(Item head, Item body, Item legs) { @@ -65,8 +55,8 @@ namespace CalamityMod.Items.Armor modPlayer.silvaRanged = true; modPlayer.auricSet = true; player.thorns += 3f; - player.lavaImmune = true; - player.ignoreWater = true; + player.lavaMax += 240; + player.ignoreWater = true; player.crimsonRegen = true; if (player.lavaWet) { diff --git a/Items/Armor/AuricTeslaPlumedHelm.cs b/Items/Armor/AuricTeslaPlumedHelm.cs index 00fe6bb849..38604aed1c 100644 --- a/Items/Armor/AuricTeslaPlumedHelm.cs +++ b/Items/Armor/AuricTeslaPlumedHelm.cs @@ -24,20 +24,10 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 10000000; - item.defense = 34; //132 - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB); - } - } - } + item.value = Item.buyPrice(1, 80, 0, 0); + item.defense = 34; //132 + item.GetGlobalItem(mod).postMoonLordRarity = 20; + } public override bool IsArmorSet(Item head, Item body, Item legs) { @@ -55,7 +45,10 @@ namespace CalamityMod.Items.Armor "Reduces all damage taken by 5%, this is calculated separately from damage reduction\n" + "All projectiles spawn healing auric orbs on enemy hits\n" + "Max run speed and acceleration boosted by 10%\n" + - "Rogue weapon critical strikes will do 3 times damage while you are above 90% HP"; + "Rogue weapon critical strikes will do 1.25 times damage while you are above 50% HP\n" + + "Rogue stealth builds while not attacking and not moving, up to a max of 160\n" + + "Rogue stealth only reduces when you attack, it does not reduce while moving\n" + + "The higher your rogue stealth the higher your rogue damage, crit, and movement speed"; CalamityPlayer modPlayer = player.GetModPlayer(mod); modPlayer.tarraSet = true; modPlayer.tarraThrowing = true; @@ -66,9 +59,10 @@ namespace CalamityMod.Items.Armor modPlayer.silvaSet = true; modPlayer.silvaThrowing = true; modPlayer.auricSet = true; - player.thorns += 3f; - player.lavaImmune = true; - player.ignoreWater = true; + modPlayer.rogueStealthMax = 1.6f; + player.thorns += 3f; + player.lavaMax += 240; + player.ignoreWater = true; player.crimsonRegen = true; if (player.lavaWet) { diff --git a/Items/Armor/AuricTeslaSpaceHelmet.cs b/Items/Armor/AuricTeslaSpaceHelmet.cs index 45b05383d5..707f0d4e6a 100644 --- a/Items/Armor/AuricTeslaSpaceHelmet.cs +++ b/Items/Armor/AuricTeslaSpaceHelmet.cs @@ -23,20 +23,10 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 10000000; - item.defense = 12; //132 - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB); - } - } - } + item.value = Item.buyPrice(1, 80, 0, 0); + item.defense = 12; //132 + item.GetGlobalItem(mod).postMoonLordRarity = 20; + } public override bool IsArmorSet(Item head, Item body, Item legs) { @@ -66,8 +56,8 @@ namespace CalamityMod.Items.Armor modPlayer.silvaSummon = true; modPlayer.auricSet = true; player.thorns += 3f; - player.lavaImmune = true; - player.ignoreWater = true; + player.lavaMax += 240; + player.ignoreWater = true; player.crimsonRegen = true; player.minionDamage += 1.2f; if (player.lavaWet) @@ -83,7 +73,7 @@ namespace CalamityMod.Items.Armor } if (player.ownedProjectileCounts[mod.ProjectileType("SilvaCrystal")] < 1) { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, mod.ProjectileType("SilvaCrystal"), (int)((double)3000 * player.minionDamage), 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, mod.ProjectileType("SilvaCrystal"), (int)(3000f * player.minionDamage), 0f, Main.myPlayer, 0f, 0f); } if (player.FindBuffIndex(mod.BuffType("Mechworm")) == -1) { diff --git a/Items/Armor/AuricTeslaWireHemmedVisage.cs b/Items/Armor/AuricTeslaWireHemmedVisage.cs index 0d41ca69a8..641ebd3986 100644 --- a/Items/Armor/AuricTeslaWireHemmedVisage.cs +++ b/Items/Armor/AuricTeslaWireHemmedVisage.cs @@ -23,20 +23,10 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 10000000; - item.defense = 24; //132 - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB); - } - } - } + item.value = Item.buyPrice(1, 80, 0, 0); + item.defense = 24; //132 + item.GetGlobalItem(mod).postMoonLordRarity = 20; + } public override bool IsArmorSet(Item head, Item body, Item legs) { @@ -65,8 +55,8 @@ namespace CalamityMod.Items.Armor modPlayer.silvaMage = true; modPlayer.auricSet = true; player.thorns += 3f; - player.lavaImmune = true; - player.ignoreWater = true; + player.lavaMax += 240; + player.ignoreWater = true; player.crimsonRegen = true; if (player.lavaWet) { diff --git a/Items/Armor/BloodflareBodyArmor.cs b/Items/Armor/BloodflareBodyArmor.cs index 92a8a63e3c..11dad65f7c 100644 --- a/Items/Armor/BloodflareBodyArmor.cs +++ b/Items/Armor/BloodflareBodyArmor.cs @@ -25,20 +25,10 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 1900000; - item.defense = 35; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 0); - } - } - } + item.value = Item.buyPrice(0, 48, 0, 0); + item.defense = 35; + item.GetGlobalItem(mod).postMoonLordRarity = 13; + } public override void UpdateEquip(Player player) { diff --git a/Items/Armor/BloodflareCuisses.cs b/Items/Armor/BloodflareCuisses.cs index eeb57cec64..cde79c94e3 100644 --- a/Items/Armor/BloodflareCuisses.cs +++ b/Items/Armor/BloodflareCuisses.cs @@ -23,20 +23,10 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 1762500; - item.defense = 29; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 0); - } - } - } + item.value = Item.buyPrice(0, 36, 0, 0); + item.defense = 29; + item.GetGlobalItem(mod).postMoonLordRarity = 13; + } public override void UpdateEquip(Player player) { diff --git a/Items/Armor/BloodflareHelm.cs b/Items/Armor/BloodflareHelm.cs index ed7285c84c..2fa9adf0ea 100644 --- a/Items/Armor/BloodflareHelm.cs +++ b/Items/Armor/BloodflareHelm.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Armor public override void SetStaticDefaults() { DisplayName.SetDefault("Bloodflare Helm"); - Tooltip.SetDefault("You can move freely through liquids and you are immune to lava\n" + + Tooltip.SetDefault("You can move freely through liquids and have temporary immunity to lava\n" + "10% increased rogue damage and critical strike chance"); } @@ -24,20 +24,10 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 1750000; - item.defense = 28; //85 - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 0); - } - } - } + item.value = Item.buyPrice(0, 60, 0, 0); + item.defense = 28; //85 + item.GetGlobalItem(mod).postMoonLordRarity = 13; + } public override bool IsArmorSet(Item head, Item body, Item legs) { @@ -54,20 +44,24 @@ namespace CalamityMod.Items.Armor CalamityPlayer modPlayer = player.GetModPlayer(mod); modPlayer.bloodflareSet = true; modPlayer.bloodflareThrowing = true; - player.setBonus = "Greatly increases life regen\n" + + modPlayer.rogueStealthMax = 1.35f; + player.setBonus = "Greatly increases life regen\n" + "Enemies below 50% life have a chance to drop hearts when struck\n" + "Enemies above 50% life have a chance to drop mana stars when struck\n" + "Enemies killed during a Blood Moon have a much higher chance to drop Blood Orbs\n" + "Being over 80% life boosts your defense by 30 and rogue crit by 5%\n" + "Being below 80% life boosts your rogue damage by 10%\n" + - "Rogue critical strikes have a 50% chance to heal you"; + "Rogue critical strikes have a 50% chance to heal you\n" + + "Rogue stealth builds while not attacking and not moving, up to a max of 135\n" + + "Rogue stealth only reduces when you attack, it does not reduce while moving\n" + + "The higher your rogue stealth the higher your rogue damage, crit, and movement speed"; player.crimsonRegen = true; } public override void UpdateEquip(Player player) { - player.lavaImmune = true; - player.ignoreWater = true; + player.lavaMax += 240; + player.ignoreWater = true; CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.1f; CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 10; } diff --git a/Items/Armor/BloodflareHelmet.cs b/Items/Armor/BloodflareHelmet.cs index ee4288556e..828cc0ef9d 100644 --- a/Items/Armor/BloodflareHelmet.cs +++ b/Items/Armor/BloodflareHelmet.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Armor public override void SetStaticDefaults() { DisplayName.SetDefault("Bloodflare Helmet"); - Tooltip.SetDefault("You can move freely through liquids and you are immune to lava\n" + + Tooltip.SetDefault("You can move freely through liquids and have temporary immunity to lava\n" + "+3 max minions"); } @@ -23,20 +23,10 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 1750000; - item.defense = 16; //85 - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 0); - } - } - } + item.value = Item.buyPrice(0, 60, 0, 0); + item.defense = 16; //85 + item.GetGlobalItem(mod).postMoonLordRarity = 13; + } public override bool IsArmorSet(Item head, Item body, Item legs) { @@ -67,8 +57,8 @@ namespace CalamityMod.Items.Armor public override void UpdateEquip(Player player) { - player.lavaImmune = true; - player.ignoreWater = true; + player.lavaMax += 240; + player.ignoreWater = true; player.maxMinions += 3; } diff --git a/Items/Armor/BloodflareHornedHelm.cs b/Items/Armor/BloodflareHornedHelm.cs index 53baa11cd7..c8ec9eeabb 100644 --- a/Items/Armor/BloodflareHornedHelm.cs +++ b/Items/Armor/BloodflareHornedHelm.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Armor public override void SetStaticDefaults() { DisplayName.SetDefault("Bloodflare Horned Helm"); - Tooltip.SetDefault("You can move freely through liquids and you are immune to lava\n" + + Tooltip.SetDefault("You can move freely through liquids and have temporary immunity to lava\n" + "10% increased ranged damage and critical strike chance"); } @@ -23,20 +23,10 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 1750000; - item.defense = 34; //85 - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 0); - } - } - } + item.value = Item.buyPrice(0, 60, 0, 0); + item.defense = 34; //85 + item.GetGlobalItem(mod).postMoonLordRarity = 13; + } public override bool IsArmorSet(Item head, Item body, Item legs) { @@ -65,8 +55,8 @@ namespace CalamityMod.Items.Armor public override void UpdateEquip(Player player) { - player.lavaImmune = true; - player.ignoreWater = true; + player.lavaMax += 240; + player.ignoreWater = true; player.rangedDamage += 0.1f; player.rangedCrit += 10; } diff --git a/Items/Armor/BloodflareHornedMask.cs b/Items/Armor/BloodflareHornedMask.cs index 656a91f7c0..a0ea126773 100644 --- a/Items/Armor/BloodflareHornedMask.cs +++ b/Items/Armor/BloodflareHornedMask.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Armor public override void SetStaticDefaults() { DisplayName.SetDefault("Bloodflare Horned Mask"); - Tooltip.SetDefault("You can move freely through liquids and you are immune to lava\n" + + Tooltip.SetDefault("You can move freely through liquids and have temporary immunity to lava\n" + "10% increased magic damage and critical strike chance"); } @@ -23,20 +23,10 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 1750000; - item.defense = 22; //85 - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 0); - } - } - } + item.value = Item.buyPrice(0, 60, 0, 0); + item.defense = 22; //85 + item.GetGlobalItem(mod).postMoonLordRarity = 13; + } public override bool IsArmorSet(Item head, Item body, Item legs) { @@ -64,8 +54,8 @@ namespace CalamityMod.Items.Armor public override void UpdateEquip(Player player) { - player.lavaImmune = true; - player.ignoreWater = true; + player.lavaMax += 240; + player.ignoreWater = true; player.magicDamage += 0.1f; player.magicCrit += 10; } diff --git a/Items/Armor/BloodflareMask.cs b/Items/Armor/BloodflareMask.cs index bd625c8315..0ca2e20a69 100644 --- a/Items/Armor/BloodflareMask.cs +++ b/Items/Armor/BloodflareMask.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Armor public override void SetStaticDefaults() { DisplayName.SetDefault("Bloodflare Mask"); - Tooltip.SetDefault("You can move freely through liquids and you are immune to lava\n" + + Tooltip.SetDefault("You can move freely through liquids and have temporary immunity to lava\n" + "10% increased melee damage and critical strike chance"); } @@ -23,20 +23,10 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 1750000; - item.defense = 49; //85 - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 0); - } - } - } + item.value = Item.buyPrice(0, 60, 0, 0); + item.defense = 49; //85 + item.GetGlobalItem(mod).postMoonLordRarity = 13; + } public override bool IsArmorSet(Item head, Item body, Item legs) { @@ -68,8 +58,8 @@ namespace CalamityMod.Items.Armor public override void UpdateEquip(Player player) { - player.lavaImmune = true; - player.ignoreWater = true; + player.lavaMax += 240; + player.ignoreWater = true; player.meleeDamage += 0.1f; player.meleeCrit += 10; } diff --git a/Items/Armor/DaedalusBreastplate.cs b/Items/Armor/DaedalusBreastplate.cs index d4134736a4..1746b2ad96 100644 --- a/Items/Armor/DaedalusBreastplate.cs +++ b/Items/Armor/DaedalusBreastplate.cs @@ -23,8 +23,8 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 250000; - item.rare = 5; + item.value = Item.buyPrice(0, 20, 0, 0); + item.rare = 5; item.defense = 17; //41 } diff --git a/Items/Armor/DaedalusHat.cs b/Items/Armor/DaedalusHat.cs index dab231d441..e00b5ad473 100644 --- a/Items/Armor/DaedalusHat.cs +++ b/Items/Armor/DaedalusHat.cs @@ -23,8 +23,8 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 300000; - item.rare = 5; + item.value = Item.buyPrice(0, 25, 0, 0); + item.rare = 5; item.defense = 5; //35 } diff --git a/Items/Armor/DaedalusHeadgear.cs b/Items/Armor/DaedalusHeadgear.cs index 1a77a65d33..4f78a41bbe 100644 --- a/Items/Armor/DaedalusHeadgear.cs +++ b/Items/Armor/DaedalusHeadgear.cs @@ -23,8 +23,8 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 300000; - item.rare = 5; + item.value = Item.buyPrice(0, 25, 0, 0); + item.rare = 5; item.defense = 3; //33 } @@ -53,7 +53,7 @@ namespace CalamityMod.Items.Armor } if (player.ownedProjectileCounts[mod.ProjectileType("DaedalusCrystal")] < 1) { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, mod.ProjectileType("DaedalusCrystal"), 0, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, mod.ProjectileType("DaedalusCrystal"), (int)(95f * player.minionDamage), 0f, Main.myPlayer, 0f, 0f); } } player.minionDamage += 0.2f; diff --git a/Items/Armor/DaedalusHelm.cs b/Items/Armor/DaedalusHelm.cs index 4a06f121ff..db679bc5a4 100644 --- a/Items/Armor/DaedalusHelm.cs +++ b/Items/Armor/DaedalusHelm.cs @@ -23,8 +23,8 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 300000; - item.rare = 5; + item.value = Item.buyPrice(0, 25, 0, 0); + item.rare = 5; item.defense = 21; //51 } diff --git a/Items/Armor/DaedalusHelmet.cs b/Items/Armor/DaedalusHelmet.cs index 30ed1d5059..ea555861d0 100644 --- a/Items/Armor/DaedalusHelmet.cs +++ b/Items/Armor/DaedalusHelmet.cs @@ -23,8 +23,8 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 300000; - item.rare = 5; + item.value = Item.buyPrice(0, 25, 0, 0); + item.rare = 5; item.defense = 9; //39 } diff --git a/Items/Armor/DaedalusLeggings.cs b/Items/Armor/DaedalusLeggings.cs index 3e2b640afc..5548860ee6 100644 --- a/Items/Armor/DaedalusLeggings.cs +++ b/Items/Armor/DaedalusLeggings.cs @@ -24,8 +24,8 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 262500; - item.rare = 5; + item.value = Item.buyPrice(0, 15, 0, 0); + item.rare = 5; item.defense = 13; //41 } diff --git a/Items/Armor/DaedalusVisor.cs b/Items/Armor/DaedalusVisor.cs index a666dcc5fe..5882d2dba8 100644 --- a/Items/Armor/DaedalusVisor.cs +++ b/Items/Armor/DaedalusVisor.cs @@ -24,8 +24,8 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 300000; - item.rare = 5; + item.value = Item.buyPrice(0, 25, 0, 0); + item.rare = 5; item.defense = 7; //37 } @@ -49,10 +49,14 @@ namespace CalamityMod.Items.Armor public override void UpdateArmorSet(Player player) { player.setBonus = "5% increased rogue damage\n" + - "Rogue projectiles throw out crystal shards as they travel"; + "Rogue projectiles throw out crystal shards as they travel\n" + + "Rogue stealth builds while not attacking and not moving, up to a max of 110\n" + + "Rogue stealth only reduces when you attack, it does not reduce while moving\n" + + "The higher your rogue stealth the higher your rogue damage, crit, and movement speed"; CalamityPlayer modPlayer = player.GetModPlayer(mod); modPlayer.daedalusSplit = true; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.05f; + modPlayer.rogueStealthMax = 1.1f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.05f; } public override void UpdateEquip(Player player) diff --git a/Items/Armor/DemonshadeBreastplate.cs b/Items/Armor/DemonshadeBreastplate.cs index 076f78d22c..b727393f9a 100644 --- a/Items/Armor/DemonshadeBreastplate.cs +++ b/Items/Armor/DemonshadeBreastplate.cs @@ -26,20 +26,10 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 10000000; - item.defense = 50; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(255, 0, 255); - } - } - } + item.value = Item.buyPrice(4, 0, 0, 0); + item.defense = 50; + item.GetGlobalItem(mod).postMoonLordRarity = 16; + } public override void UpdateEquip(Player player) { diff --git a/Items/Armor/DemonshadeGreaves.cs b/Items/Armor/DemonshadeGreaves.cs index e6d1bf7c62..33d6a0cd93 100644 --- a/Items/Armor/DemonshadeGreaves.cs +++ b/Items/Armor/DemonshadeGreaves.cs @@ -22,20 +22,10 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 10000000; - item.defense = 50; //15 - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(255, 0, 255); - } - } - } + item.value = Item.buyPrice(3, 0, 0, 0); + item.defense = 50; //15 + item.GetGlobalItem(mod).postMoonLordRarity = 16; + } public override void UpdateEquip(Player player) { diff --git a/Items/Armor/DemonshadeHelm.cs b/Items/Armor/DemonshadeHelm.cs index d23cac0641..9f7dd85a81 100644 --- a/Items/Armor/DemonshadeHelm.cs +++ b/Items/Armor/DemonshadeHelm.cs @@ -8,93 +8,83 @@ using Terraria.ModLoader; using CalamityMod.Items.Armor; using CalamityMod.Items.CalamityCustomThrowingDamage; -namespace CalamityMod.Items.Armor +namespace CalamityMod.Items.Armor { [AutoloadEquip(EquipType.Head)] public class DemonshadeHelm : ModItem { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Demonshade Helm"); - Tooltip.SetDefault("30% increased damage and 15% increased critical strike chance, +10 max minions"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Demonshade Helm"); + Tooltip.SetDefault("30% increased damage and 15% increased critical strike chance, +10 max minions"); + } - public override void SetDefaults() - { - item.width = 18; - item.height = 18; - item.value = 10000000; - item.defense = 50; //15 - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(255, 0, 255); - } - } - } - - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == mod.ItemType("DemonshadeBreastplate") && legs.type == mod.ItemType("DemonshadeGreaves"); - } - - public override void ArmorSetShadows(Player player) - { - player.armorEffectDrawShadow = true; - player.armorEffectDrawOutlines = true; - } - - public override void UpdateArmorSet(Player player) - { - player.setBonus = "100% increased minion damage\n" + - "All attacks inflict the demon flame debuff\n" + - "Shadowbeams and demon scythes will fire down when you are hit\n" + - "A friendly red devil follows you around\n" + - "Press Y to enrage nearby enemies with a dark magic spell for 10 seconds\n" + - "This makes them do 1.5 times more damage but they also take five times as much damage"; - CalamityPlayer modPlayer = player.GetModPlayer(mod); - modPlayer.dsSetBonus = true; - modPlayer.redDevil = true; - if (player.whoAmI == Main.myPlayer) + public override void SetDefaults() + { + item.width = 18; + item.height = 18; + item.value = Item.buyPrice(5, 0, 0, 0); + item.defense = 50; //15 + item.GetGlobalItem(mod).postMoonLordRarity = 16; + } + + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("DemonshadeBreastplate") && legs.type == mod.ItemType("DemonshadeGreaves"); + } + + public override void ArmorSetShadows(Player player) + { + player.armorEffectDrawShadow = true; + player.armorEffectDrawOutlines = true; + } + + public override void UpdateArmorSet(Player player) + { + player.setBonus = "100% increased minion damage\n" + + "All attacks inflict the demon flame debuff\n" + + "Shadowbeams and demon scythes will fire down when you are hit\n" + + "A friendly red devil follows you around\n" + + "Press Y to enrage nearby enemies with a dark magic spell for 10 seconds\n" + + "This makes them do 25% more damage but they also take 125% more damage"; + CalamityPlayer modPlayer = player.GetModPlayer(mod); + modPlayer.dsSetBonus = true; + if (player.whoAmI == Main.myPlayer && !modPlayer.chibii) { + modPlayer.redDevil = true; if (player.FindBuffIndex(mod.BuffType("RedDevil")) == -1) { player.AddBuff(mod.BuffType("RedDevil"), 3600, true); } if (player.ownedProjectileCounts[mod.ProjectileType("RedDevil")] < 1) { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, mod.ProjectileType("RedDevil"), 0, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, mod.ProjectileType("RedDevil"), 10000, 0f, Main.myPlayer, 0f, 0f); } } - player.minionDamage += 1f; - } - - public override void UpdateEquip(Player player) - { - player.maxMinions += 10; + player.minionDamage += 1f; + } + + public override void UpdateEquip(Player player) + { + player.maxMinions += 10; player.meleeDamage += 0.3f; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.3f; - player.rangedDamage += 0.3f; - player.magicDamage += 0.3f; - player.minionDamage += 0.3f; - player.meleeCrit += 15; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.3f; + player.rangedDamage += 0.3f; + player.magicDamage += 0.3f; + player.minionDamage += 0.3f; + player.meleeCrit += 15; player.magicCrit += 15; player.rangedCrit += 15; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 15; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "ShadowspecBar", 8); - recipe.AddTile(null, "DraedonsForge"); - recipe.SetResult(this); - recipe.AddRecipe(); - } + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 15; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "ShadowspecBar", 8); + recipe.AddTile(null, "DraedonsForge"); + recipe.SetResult(this); + recipe.AddRecipe(); + } } } \ No newline at end of file diff --git a/Items/Armor/GodSlayerChestplate.cs b/Items/Armor/GodSlayerChestplate.cs index de7e2858e0..3fc92c3092 100644 --- a/Items/Armor/GodSlayerChestplate.cs +++ b/Items/Armor/GodSlayerChestplate.cs @@ -27,20 +27,10 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 4250000; - item.defense = 41; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(43, 96, 222); - } - } - } + item.value = Item.buyPrice(0, 60, 0, 0); + item.defense = 41; + item.GetGlobalItem(mod).postMoonLordRarity = 14; + } public override void UpdateEquip(Player player) { diff --git a/Items/Armor/GodSlayerHelm.cs b/Items/Armor/GodSlayerHelm.cs index d78fc93f51..f75d882057 100644 --- a/Items/Armor/GodSlayerHelm.cs +++ b/Items/Armor/GodSlayerHelm.cs @@ -22,20 +22,10 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 5000000; - item.defense = 48; //96 - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(43, 96, 222); - } - } - } + item.value = Item.buyPrice(0, 75, 0, 0); + item.defense = 48; //96 + item.GetGlobalItem(mod).postMoonLordRarity = 14; + } public override bool IsArmorSet(Item head, Item body, Item legs) { diff --git a/Items/Armor/GodSlayerHelmet.cs b/Items/Armor/GodSlayerHelmet.cs index 9a505a7620..35e63b7e6b 100644 --- a/Items/Armor/GodSlayerHelmet.cs +++ b/Items/Armor/GodSlayerHelmet.cs @@ -22,20 +22,10 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 5000000; - item.defense = 35; //96 - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(43, 96, 222); - } - } - } + item.value = Item.buyPrice(0, 75, 0, 0); + item.defense = 35; //96 + item.GetGlobalItem(mod).postMoonLordRarity = 14; + } public override bool IsArmorSet(Item head, Item body, Item legs) { diff --git a/Items/Armor/GodSlayerHornedHelm.cs b/Items/Armor/GodSlayerHornedHelm.cs index be786e7763..602a3d60c4 100644 --- a/Items/Armor/GodSlayerHornedHelm.cs +++ b/Items/Armor/GodSlayerHornedHelm.cs @@ -22,20 +22,10 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 5000000; - item.defense = 12; //96 - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(43, 96, 222); - } - } - } + item.value = Item.buyPrice(0, 75, 0, 0); + item.defense = 12; //96 + item.GetGlobalItem(mod).postMoonLordRarity = 14; + } public override bool IsArmorSet(Item head, Item body, Item legs) { diff --git a/Items/Armor/GodSlayerLeggings.cs b/Items/Armor/GodSlayerLeggings.cs index f0ab1941c7..431580380f 100644 --- a/Items/Armor/GodSlayerLeggings.cs +++ b/Items/Armor/GodSlayerLeggings.cs @@ -24,20 +24,10 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 3750000; - item.defense = 35; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(43, 96, 222); - } - } - } + item.value = Item.buyPrice(0, 45, 0, 0); + item.defense = 35; + item.GetGlobalItem(mod).postMoonLordRarity = 14; + } public override void UpdateEquip(Player player) { diff --git a/Items/Armor/GodSlayerMask.cs b/Items/Armor/GodSlayerMask.cs index 6d0c26d74c..660cb460f9 100644 --- a/Items/Armor/GodSlayerMask.cs +++ b/Items/Armor/GodSlayerMask.cs @@ -23,20 +23,10 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 5000000; - item.defense = 29; //96 - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(43, 96, 222); - } - } - } + item.value = Item.buyPrice(0, 75, 0, 0); + item.defense = 29; //96 + item.GetGlobalItem(mod).postMoonLordRarity = 14; + } public override bool IsArmorSet(Item head, Item body, Item legs) { @@ -53,11 +43,15 @@ namespace CalamityMod.Items.Armor CalamityPlayer modPlayer = player.GetModPlayer(mod); modPlayer.godSlayer = true; modPlayer.godSlayerThrowing = true; - player.setBonus = "You will survive fatal damage and will be healed 150 HP if an attack would have killed you\n" + + modPlayer.rogueStealthMax = 1.4f; + player.setBonus = "You will survive fatal damage and will be healed 150 HP if an attack would have killed you\n" + "This effect can only occur once every 45 seconds\n" + "While the cooldown for this effect is active you gain a 10% increase to all damage\n" + "While at full HP all of your rogue stats are boosted by 10%\n" + - "If you take over 80 damage in one hit you will be given extra immunity frames"; + "If you take over 80 damage in one hit you will be given extra immunity frames\n" + + "Rogue stealth builds while not attacking and not moving, up to a max of 140\n" + + "Rogue stealth only reduces when you attack, it does not reduce while moving\n" + + "The higher your rogue stealth the higher your rogue damage, crit, and movement speed"; } public override void UpdateEquip(Player player) diff --git a/Items/Armor/GodSlayerVisage.cs b/Items/Armor/GodSlayerVisage.cs index 75c00188b5..e894cd6257 100644 --- a/Items/Armor/GodSlayerVisage.cs +++ b/Items/Armor/GodSlayerVisage.cs @@ -22,20 +22,10 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 5000000; - item.defense = 21; //96 - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(43, 96, 222); - } - } - } + item.value = Item.buyPrice(0, 75, 0, 0); + item.defense = 21; //96 + item.GetGlobalItem(mod).postMoonLordRarity = 14; + } public override bool IsArmorSet(Item head, Item body, Item legs) { diff --git a/Items/Armor/MolluskShelleggings.cs b/Items/Armor/MolluskShelleggings.cs new file mode 100644 index 0000000000..2c941ef087 --- /dev/null +++ b/Items/Armor/MolluskShelleggings.cs @@ -0,0 +1,56 @@ +using Microsoft.Xna.Framework; +using System.Collections.Generic; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items.CalamityCustomThrowingDamage; + +namespace CalamityMod.Items.Armor +{ + [AutoloadEquip(EquipType.Legs)] + public class MolluskShelleggings : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Mollusk Shelleggings"); + Tooltip.SetDefault("5% increased damage and 4% increased critical strike chance\n" + + "5% decreased movement speed"); + } + + public override void SetDefaults() + { + item.width = 22; + item.height = 18; + item.value = Item.buyPrice(0, 15, 0, 0); + item.rare = 5; + item.defense = 15; + } + + public override void UpdateEquip(Player player) + { + const float damageUp = 0.12f; + const int critUp = 4; + player.meleeDamage += damageUp; + player.rangedDamage += damageUp; + player.magicDamage += damageUp; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += damageUp; + player.minionDamage += damageUp; + player.meleeCrit += critUp; + player.rangedCrit += critUp; + player.magicCrit += critUp; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += critUp; + player.moveSpeed -= 0.07f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(mod.ItemType("SeaPrism"), 20); + recipe.AddIngredient(mod.ItemType("MolluskHusk"), 10); + recipe.AddTile(TileID.MythrilAnvil); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Armor/MolluskShelleggings.png b/Items/Armor/MolluskShelleggings.png new file mode 100644 index 0000000000..86e05a51bd Binary files /dev/null and b/Items/Armor/MolluskShelleggings.png differ diff --git a/Items/Armor/MolluskShelleggings_Legs.png b/Items/Armor/MolluskShelleggings_Legs.png new file mode 100644 index 0000000000..877fcb84d2 Binary files /dev/null and b/Items/Armor/MolluskShelleggings_Legs.png differ diff --git a/Items/Armor/MolluskShellmet.cs b/Items/Armor/MolluskShellmet.cs new file mode 100644 index 0000000000..f7be7e691e --- /dev/null +++ b/Items/Armor/MolluskShellmet.cs @@ -0,0 +1,88 @@ +using Microsoft.Xna.Framework; +using System.Collections.Generic; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items.CalamityCustomThrowingDamage; + +namespace CalamityMod.Items.Armor +{ + [AutoloadEquip(EquipType.Head)] + public class MolluskShellmet : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Mollusk Shellmet"); + Tooltip.SetDefault("5% increased damage and 4% increased critical strike chance\n" + + "7% decreased movement speed\n" + + "You can move freely through liquids"); + } + + public override void SetDefaults() + { + item.width = 22; + item.height = 22; + item.value = Item.buyPrice(0, 25, 0, 0); + item.rare = 5; + item.defense = 18; + } + + public override void UpdateEquip(Player player) + { + player.ignoreWater = true; + const float damageUp = 0.05f; + const int critUp = 4; + player.meleeDamage += damageUp; + player.rangedDamage += damageUp; + player.magicDamage += damageUp; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += damageUp; + player.minionDamage += damageUp; + player.meleeCrit += critUp; + player.rangedCrit += critUp; + player.magicCrit += critUp; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += critUp; + player.moveSpeed -= 0.07f; + } + + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("MolluskShellplate") && legs.type == mod.ItemType("MolluskShelleggings"); + } + + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Two shellfishes aid you in combat\n" + + "10% increased damage"; + const float damageUp = 0.10f; + player.meleeDamage += damageUp; + player.rangedDamage += damageUp; + player.magicDamage += damageUp; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += damageUp; + player.minionDamage += damageUp; + player.GetModPlayer().molluskSet = true; + player.maxMinions += 4; + if (player.whoAmI == Main.myPlayer) + { + if (player.FindBuffIndex(mod.BuffType("Shellfish")) == -1) + { + player.AddBuff(mod.BuffType("Shellfish"), 3600, true); + } + if (player.ownedProjectileCounts[mod.ProjectileType("Shellfish")] < 2) + { + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, mod.ProjectileType("Shellfish"), (int)((double)1500 * player.minionDamage), 0f, Main.myPlayer, 0f, 0f); + } + } + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(mod.ItemType("SeaPrism"), 15); + recipe.AddIngredient(mod.ItemType("MolluskHusk"), 6); + recipe.AddTile(TileID.MythrilAnvil); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Armor/MolluskShellmet.png b/Items/Armor/MolluskShellmet.png new file mode 100644 index 0000000000..5b026e70e5 Binary files /dev/null and b/Items/Armor/MolluskShellmet.png differ diff --git a/Items/Armor/MolluskShellmet_Head.png b/Items/Armor/MolluskShellmet_Head.png new file mode 100644 index 0000000000..4d2209fdb8 Binary files /dev/null and b/Items/Armor/MolluskShellmet_Head.png differ diff --git a/Items/Armor/MolluskShellplate.cs b/Items/Armor/MolluskShellplate.cs new file mode 100644 index 0000000000..4460f5b742 --- /dev/null +++ b/Items/Armor/MolluskShellplate.cs @@ -0,0 +1,56 @@ +using Microsoft.Xna.Framework; +using System.Collections.Generic; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items.CalamityCustomThrowingDamage; + +namespace CalamityMod.Items.Armor +{ + [AutoloadEquip(EquipType.Body)] + public class MolluskShellplate : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Mollusk Shellplate"); + Tooltip.SetDefault("10% increased damage and 6% increased critical strike chance\n" + + "15% decreased movement speed"); + } + + public override void SetDefaults() + { + item.width = 30; + item.height = 22; + item.value = Item.buyPrice(0, 20, 0, 0); + item.rare = 5; + item.defense = 22; + } + + public override void UpdateEquip(Player player) + { + const float damageUp = 0.1f; + const int critUp = 6; + player.meleeDamage += damageUp; + player.rangedDamage += damageUp; + player.magicDamage += damageUp; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += damageUp; + player.minionDamage += damageUp; + player.meleeCrit += critUp; + player.rangedCrit += critUp; + player.magicCrit += critUp; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += critUp; + player.moveSpeed -= 0.15f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(mod.ItemType("SeaPrism"), 25); + recipe.AddIngredient(mod.ItemType("MolluskHusk"), 15); + recipe.AddTile(TileID.MythrilAnvil); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Armor/MolluskShellplate.png b/Items/Armor/MolluskShellplate.png new file mode 100644 index 0000000000..06c81e4c82 Binary files /dev/null and b/Items/Armor/MolluskShellplate.png differ diff --git a/Items/Armor/MolluskShellplate_Arms.png b/Items/Armor/MolluskShellplate_Arms.png new file mode 100644 index 0000000000..a2a1cfe2f8 Binary files /dev/null and b/Items/Armor/MolluskShellplate_Arms.png differ diff --git a/Items/Armor/MolluskShellplate_Body.png b/Items/Armor/MolluskShellplate_Body.png new file mode 100644 index 0000000000..e01233469b Binary files /dev/null and b/Items/Armor/MolluskShellplate_Body.png differ diff --git a/Items/Armor/MolluskShellplate_FemaleBody.png b/Items/Armor/MolluskShellplate_FemaleBody.png new file mode 100644 index 0000000000..c8dc6d7adf Binary files /dev/null and b/Items/Armor/MolluskShellplate_FemaleBody.png differ diff --git a/Items/Armor/OmegaBlueChestplate.cs b/Items/Armor/OmegaBlueChestplate.cs index cb00826630..7dd92b7300 100644 --- a/Items/Armor/OmegaBlueChestplate.cs +++ b/Items/Armor/OmegaBlueChestplate.cs @@ -1,61 +1,62 @@ -using Microsoft.Xna.Framework; -using System.Collections.Generic; -using Terraria; -using Terraria.Audio; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items.CalamityCustomThrowingDamage; - -namespace CalamityMod.Items.Armor -{ - [AutoloadEquip(EquipType.Body)] - public class OmegaBlueChestplate : ModItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Omega Blue Chestplate"); - Tooltip.SetDefault(@"12% increased damage and 8% increased critical strike chance -Your attacks inflict Crush Depth -No positive life regen"); - } - - public override void SetDefaults() - { - item.width = 18; - item.height = 18; - item.value = Item.sellPrice(0, 38, 0, 0); - item.rare = 13; - item.defense = 28; - } - - public override void UpdateEquip(Player player) - { - const float damageUp = 0.12f; - const int critUp = 8; - player.meleeDamage += damageUp; - player.rangedDamage += damageUp; - player.magicDamage += damageUp; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += damageUp; - player.minionDamage += damageUp; - player.meleeCrit += critUp; - player.rangedCrit += critUp; - player.magicCrit += critUp; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += critUp; - - //insert enable crush depth, disable positive life regen - player.GetModPlayer().omegaBlueChestplate = true; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(mod.ItemType("ReaperTooth"), 16); - recipe.AddIngredient(mod.ItemType("Lumenite"), 8); - recipe.AddIngredient(mod.ItemType("Tenebris"), 8); - recipe.AddIngredient(mod.ItemType("RuinousSoul"), 4); - recipe.AddTile(TileID.LunarCraftingStation); - recipe.SetResult(this); - recipe.AddRecipe(); - } - } -} +using Microsoft.Xna.Framework; +using System.Collections.Generic; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items.CalamityCustomThrowingDamage; + +namespace CalamityMod.Items.Armor +{ + [AutoloadEquip(EquipType.Body)] + public class OmegaBlueChestplate : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Omega Blue Chestplate"); + Tooltip.SetDefault(@"12% increased damage and 8% increased critical strike chance +Your attacks inflict Crush Depth +No positive life regen"); + } + + public override void SetDefaults() + { + item.width = 18; + item.height = 18; + item.value = Item.sellPrice(0, 38, 0, 0); + item.rare = 10; + item.defense = 28; + item.GetGlobalItem(mod).postMoonLordRarity = 13; + } + + public override void UpdateEquip(Player player) + { + const float damageUp = 0.12f; + const int critUp = 8; + player.meleeDamage += damageUp; + player.rangedDamage += damageUp; + player.magicDamage += damageUp; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += damageUp; + player.minionDamage += damageUp; + player.meleeCrit += critUp; + player.rangedCrit += critUp; + player.magicCrit += critUp; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += critUp; + + //insert enable crush depth, disable positive life regen + player.GetModPlayer().omegaBlueChestplate = true; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(mod.ItemType("ReaperTooth"), 16); + recipe.AddIngredient(mod.ItemType("Lumenite"), 8); + recipe.AddIngredient(mod.ItemType("Tenebris"), 8); + recipe.AddIngredient(mod.ItemType("RuinousSoul"), 4); + recipe.AddTile(TileID.LunarCraftingStation); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Armor/OmegaBlueHelmet.cs b/Items/Armor/OmegaBlueHelmet.cs index cf11fc15d1..f69ccbc51e 100644 --- a/Items/Armor/OmegaBlueHelmet.cs +++ b/Items/Armor/OmegaBlueHelmet.cs @@ -1,114 +1,115 @@ -using Microsoft.Xna.Framework; -using System.Collections.Generic; -using Terraria; -using Terraria.Audio; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items.CalamityCustomThrowingDamage; - -namespace CalamityMod.Items.Armor -{ - [AutoloadEquip(EquipType.Head)] - public class OmegaBlueHelmet : ModItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Omega Blue Helmet"); - Tooltip.SetDefault(@"You can move freely through liquids -12% increased damage and 8% increased critical strike chance -+2 max minions"); - } - - public override void SetDefaults() - { - item.width = 18; - item.height = 18; - item.value = Item.sellPrice(0, 35, 0, 0); - item.rare = 13; - item.defense = 19; - } - - public override void UpdateEquip(Player player) - { - player.ignoreWater = true; - - const float damageUp = 0.12f; - const int critUp = 8; - player.meleeDamage += damageUp; - player.rangedDamage += damageUp; - player.magicDamage += damageUp; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += damageUp; - player.minionDamage += damageUp; - player.meleeCrit += critUp; - player.rangedCrit += critUp; - player.magicCrit += critUp; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += critUp; - - player.maxMinions += 2; - } - - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == mod.ItemType("OmegaBlueChestplate") && legs.type == mod.ItemType("OmegaBlueLeggings"); - } - - public override void ArmorSetShadows(Player player) - { - player.armorEffectDrawOutlines = true; - } - - public override void UpdateArmorSet(Player player) - { - player.setBonus = @"Increases armor penetration by 50 -10% increased damage and critical strike chance -Short-ranged tentacles heal you by sucking enemy life -Press Y to activate abyssal madness for 5 seconds -Abyssal madness increases damage, critical strike chance, and tentacle aggression/range -This effect has a 30 second cooldown"; - - player.armorPenetration += 50; - - //raise rev caps - player.GetModPlayer().omegaBlueSet = true; - - if (player.GetModPlayer().omegaBlueCooldown > 0) - { - if (player.GetModPlayer().omegaBlueCooldown == 1) //dust when ready to use again - { - for (int i = 0; i < 66; i++) - { - int d = Dust.NewDust(player.position, player.width, player.height, 20, 0, 0, 100, Color.Transparent, 2.6f); - Main.dust[d].noGravity = true; - Main.dust[d].noLight = true; - Main.dust[d].fadeIn = 1f; - Main.dust[d].velocity *= 6.6f; - } - } - player.GetModPlayer().omegaBlueCooldown--; - } - - if (player.GetModPlayer().omegaBlueCooldown > 1500) - { - player.GetModPlayer().omegaBlueHentai = true; - - int d = Dust.NewDust(player.position, player.width, player.height, 20, 0, 0, 100, Color.Transparent, 1.6f); - Main.dust[d].noGravity = true; - Main.dust[d].noLight = true; - Main.dust[d].fadeIn = 1f; - Main.dust[d].velocity *= 3f; - } - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(mod.ItemType("ReaperTooth"), 11); - recipe.AddIngredient(mod.ItemType("Lumenite"), 5); - recipe.AddIngredient(mod.ItemType("Tenebris"), 5); - recipe.AddIngredient(mod.ItemType("RuinousSoul"), 2); - recipe.AddTile(TileID.LunarCraftingStation); - recipe.SetResult(this); - recipe.AddRecipe(); - } - } -} +using Microsoft.Xna.Framework; +using System.Collections.Generic; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items.CalamityCustomThrowingDamage; + +namespace CalamityMod.Items.Armor +{ + [AutoloadEquip(EquipType.Head)] + public class OmegaBlueHelmet : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Omega Blue Helmet"); + Tooltip.SetDefault(@"You can move freely through liquids +12% increased damage and 8% increased critical strike chance ++2 max minions"); + } + + public override void SetDefaults() + { + item.width = 18; + item.height = 18; + item.value = Item.sellPrice(0, 35, 0, 0); + item.rare = 10; + item.defense = 19; + item.GetGlobalItem(mod).postMoonLordRarity = 13; + } + + public override void UpdateEquip(Player player) + { + player.ignoreWater = true; + + const float damageUp = 0.12f; + const int critUp = 8; + player.meleeDamage += damageUp; + player.rangedDamage += damageUp; + player.magicDamage += damageUp; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += damageUp; + player.minionDamage += damageUp; + player.meleeCrit += critUp; + player.rangedCrit += critUp; + player.magicCrit += critUp; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += critUp; + + player.maxMinions += 2; + } + + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("OmegaBlueChestplate") && legs.type == mod.ItemType("OmegaBlueLeggings"); + } + + public override void ArmorSetShadows(Player player) + { + player.armorEffectDrawOutlines = true; + } + + public override void UpdateArmorSet(Player player) + { + player.setBonus = @"Increases armor penetration by 50 +10% increased damage and critical strike chance +Short-ranged tentacles heal you by sucking enemy life +Press Y to activate abyssal madness for 5 seconds +Abyssal madness increases damage, critical strike chance, and tentacle aggression/range +This effect has a 30 second cooldown"; + + player.armorPenetration += 50; + + //raise rev caps + player.GetModPlayer().omegaBlueSet = true; + + if (player.GetModPlayer().omegaBlueCooldown > 0) + { + if (player.GetModPlayer().omegaBlueCooldown == 1) //dust when ready to use again + { + for (int i = 0; i < 66; i++) + { + int d = Dust.NewDust(player.position, player.width, player.height, 20, 0, 0, 100, Color.Transparent, 2.6f); + Main.dust[d].noGravity = true; + Main.dust[d].noLight = true; + Main.dust[d].fadeIn = 1f; + Main.dust[d].velocity *= 6.6f; + } + } + player.GetModPlayer().omegaBlueCooldown--; + } + + if (player.GetModPlayer().omegaBlueCooldown > 1500) + { + player.GetModPlayer().omegaBlueHentai = true; + + int d = Dust.NewDust(player.position, player.width, player.height, 20, 0, 0, 100, Color.Transparent, 1.6f); + Main.dust[d].noGravity = true; + Main.dust[d].noLight = true; + Main.dust[d].fadeIn = 1f; + Main.dust[d].velocity *= 3f; + } + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(mod.ItemType("ReaperTooth"), 11); + recipe.AddIngredient(mod.ItemType("Lumenite"), 5); + recipe.AddIngredient(mod.ItemType("Tenebris"), 5); + recipe.AddIngredient(mod.ItemType("RuinousSoul"), 2); + recipe.AddTile(TileID.LunarCraftingStation); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Armor/OmegaBlueLeggings.cs b/Items/Armor/OmegaBlueLeggings.cs index 689491e8f4..458b6a7502 100644 --- a/Items/Armor/OmegaBlueLeggings.cs +++ b/Items/Armor/OmegaBlueLeggings.cs @@ -1,59 +1,60 @@ -using Microsoft.Xna.Framework; -using System.Collections.Generic; -using Terraria; -using Terraria.Audio; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items.CalamityCustomThrowingDamage; - -namespace CalamityMod.Items.Armor -{ - [AutoloadEquip(EquipType.Legs)] - public class OmegaBlueLeggings : ModItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Omega Blue Leggings"); - Tooltip.SetDefault(@"30% increased movement speed -12% increased damage and 8% increased critical strike chance"); - } - - public override void SetDefaults() - { - item.width = 18; - item.height = 18; - item.value = Item.sellPrice(0, 35, 25, 0); - item.rare = 13; - item.defense = 22; - } - - public override void UpdateEquip(Player player) - { - const float damageUp = 0.12f; - const int critUp = 8; - player.meleeDamage += damageUp; - player.rangedDamage += damageUp; - player.magicDamage += damageUp; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += damageUp; - player.minionDamage += damageUp; - player.meleeCrit += critUp; - player.rangedCrit += critUp; - player.magicCrit += critUp; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += critUp; - - player.moveSpeed += 0.3f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(mod.ItemType("ReaperTooth"), 13); - recipe.AddIngredient(mod.ItemType("Lumenite"), 6); - recipe.AddIngredient(mod.ItemType("Tenebris"), 6); - recipe.AddIngredient(mod.ItemType("RuinousSoul"), 3); - recipe.AddTile(TileID.LunarCraftingStation); - recipe.SetResult(this); - recipe.AddRecipe(); - } - } -} +using Microsoft.Xna.Framework; +using System.Collections.Generic; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items.CalamityCustomThrowingDamage; + +namespace CalamityMod.Items.Armor +{ + [AutoloadEquip(EquipType.Legs)] + public class OmegaBlueLeggings : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Omega Blue Leggings"); + Tooltip.SetDefault(@"30% increased movement speed +12% increased damage and 8% increased critical strike chance"); + } + + public override void SetDefaults() + { + item.width = 18; + item.height = 18; + item.value = Item.sellPrice(0, 35, 25, 0); + item.rare = 10; + item.defense = 22; + item.GetGlobalItem(mod).postMoonLordRarity = 13; + } + + public override void UpdateEquip(Player player) + { + const float damageUp = 0.12f; + const int critUp = 8; + player.meleeDamage += damageUp; + player.rangedDamage += damageUp; + player.magicDamage += damageUp; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += damageUp; + player.minionDamage += damageUp; + player.meleeCrit += critUp; + player.rangedCrit += critUp; + player.magicCrit += critUp; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += critUp; + + player.moveSpeed += 0.3f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(mod.ItemType("ReaperTooth"), 13); + recipe.AddIngredient(mod.ItemType("Lumenite"), 6); + recipe.AddIngredient(mod.ItemType("Tenebris"), 6); + recipe.AddIngredient(mod.ItemType("RuinousSoul"), 3); + recipe.AddTile(TileID.LunarCraftingStation); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Armor/ReaverCap.cs b/Items/Armor/ReaverCap.cs index 4faf0ec107..fd8d1e576b 100644 --- a/Items/Armor/ReaverCap.cs +++ b/Items/Armor/ReaverCap.cs @@ -24,8 +24,8 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 350000; - item.rare = 7; + item.value = Item.buyPrice(0, 30, 0, 0); + item.rare = 7; item.defense = 10; //43 } @@ -44,7 +44,8 @@ namespace CalamityMod.Items.Armor { CalamityPlayer modPlayer = player.GetModPlayer(mod); modPlayer.reaverSpore = true; - player.setBonus = "5% increased rogue damage\n" + + modPlayer.rogueStealthMax = 1.15f; + player.setBonus = "5% increased rogue damage\n" + "You emit a cloud of spores when you are hit\n" + "Rage activates when you are damaged"; CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.05f; diff --git a/Items/Armor/ReaverCuisses.cs b/Items/Armor/ReaverCuisses.cs index fb2659a129..5034b378d4 100644 --- a/Items/Armor/ReaverCuisses.cs +++ b/Items/Armor/ReaverCuisses.cs @@ -24,8 +24,8 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 312500; - item.rare = 7; + item.value = Item.buyPrice(0, 18, 0, 0); + item.rare = 7; item.defense = 14; } diff --git a/Items/Armor/ReaverHelm.cs b/Items/Armor/ReaverHelm.cs index 3e64dd1c28..1e424c196c 100644 --- a/Items/Armor/ReaverHelm.cs +++ b/Items/Armor/ReaverHelm.cs @@ -23,8 +23,8 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 350000; - item.rare = 7; + item.value = Item.buyPrice(0, 30, 0, 0); + item.rare = 7; item.defense = 25; //58 } diff --git a/Items/Armor/ReaverHelmet.cs b/Items/Armor/ReaverHelmet.cs index 1f3b94dc3c..45e85a5339 100644 --- a/Items/Armor/ReaverHelmet.cs +++ b/Items/Armor/ReaverHelmet.cs @@ -23,8 +23,8 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 350000; - item.rare = 7; + item.value = Item.buyPrice(0, 30, 0, 0); + item.rare = 7; item.defense = 3; //36 } @@ -54,7 +54,7 @@ namespace CalamityMod.Items.Armor } if (player.ownedProjectileCounts[mod.ProjectileType("ReaverOrb")] < 1) { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, mod.ProjectileType("ReaverOrb"), 0, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, mod.ProjectileType("ReaverOrb"), (int)(80f * player.minionDamage), 0f, Main.myPlayer, 0f, 0f); } } player.minionDamage += 0.16f; diff --git a/Items/Armor/ReaverMask.cs b/Items/Armor/ReaverMask.cs index 8441b058c5..858273295f 100644 --- a/Items/Armor/ReaverMask.cs +++ b/Items/Armor/ReaverMask.cs @@ -23,8 +23,8 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 350000; - item.rare = 7; + item.value = Item.buyPrice(0, 30, 0, 0); + item.rare = 7; item.defense = 7; //40 } diff --git a/Items/Armor/ReaverScaleMail.cs b/Items/Armor/ReaverScaleMail.cs index b8ddd45dbe..521de6601b 100644 --- a/Items/Armor/ReaverScaleMail.cs +++ b/Items/Armor/ReaverScaleMail.cs @@ -24,8 +24,8 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 300000; - item.rare = 7; + item.value = Item.buyPrice(0, 24, 0, 0); + item.rare = 7; item.defense = 19; } diff --git a/Items/Armor/ReaverVisage.cs b/Items/Armor/ReaverVisage.cs index e66eb8dc0e..4d3fa04ee3 100644 --- a/Items/Armor/ReaverVisage.cs +++ b/Items/Armor/ReaverVisage.cs @@ -23,8 +23,8 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 350000; - item.rare = 7; + item.value = Item.buyPrice(0, 30, 0, 0); + item.rare = 7; item.defense = 13; //46 } diff --git a/Items/Armor/ShroomiteVisage.cs b/Items/Armor/ShroomiteVisage.cs index bca07a4b53..cfe768f120 100644 --- a/Items/Armor/ShroomiteVisage.cs +++ b/Items/Armor/ShroomiteVisage.cs @@ -7,49 +7,51 @@ using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Items; -namespace CalamityMod.Items.Armor { -[AutoloadEquip(EquipType.Head)] -public class ShroomiteVisage : ModItem +namespace CalamityMod.Items.Armor { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Shroomite Visage"); - Tooltip.SetDefault("25% increased ranged damage for flamethrowers"); - } + [AutoloadEquip(EquipType.Head)] + public class ShroomiteVisage : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Shroomite Visage"); + Tooltip.SetDefault("25% increased ranged damage for flamethrowers"); + } - public override void SetDefaults() - { - item.width = 18; - item.height = 18; - item.value = 375000; - item.rare = 8; - item.defense = 11; //62 - } + public override void SetDefaults() + { + item.width = 18; + item.height = 18; + item.value = Item.buyPrice(0, 30, 0, 0); + item.rare = 8; + item.defense = 11; //62 + } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ItemID.ShroomiteBreastplate && legs.type == ItemID.ShroomiteLeggings; - } + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == ItemID.ShroomiteBreastplate && legs.type == ItemID.ShroomiteLeggings; + } - public override void UpdateArmorSet(Player player) - { - CalamityPlayer modPlayer = player.GetModPlayer(mod); - player.shroomiteStealth = true; - player.setBonus = "Ranged stealth while standing still"; - } - - public override void UpdateEquip(Player player) - { - CalamityPlayer modPlayer = player.GetModPlayer(mod); - modPlayer.flamethrowerBoost = true; - } + public override void UpdateArmorSet(Player player) + { + CalamityPlayer modPlayer = player.GetModPlayer(mod); + player.shroomiteStealth = true; + player.setBonus = "Ranged stealth while standing still"; + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.ShroomiteBar, 12); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} \ No newline at end of file + public override void UpdateEquip(Player player) + { + CalamityPlayer modPlayer = player.GetModPlayer(mod); + modPlayer.flamethrowerBoost = true; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.ShroomiteBar, 12); + recipe.AddTile(TileID.MythrilAnvil); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} \ No newline at end of file diff --git a/Items/Armor/SilvaArmor.cs b/Items/Armor/SilvaArmor.cs index e4864381cd..2a5008f24a 100644 --- a/Items/Armor/SilvaArmor.cs +++ b/Items/Armor/SilvaArmor.cs @@ -25,20 +25,10 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 8250000; - item.defense = 44; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(108, 45, 199); - } - } - } + item.value = Item.buyPrice(0, 72, 0, 0); + item.defense = 44; + item.GetGlobalItem(mod).postMoonLordRarity = 15; + } public override void UpdateEquip(Player player) { diff --git a/Items/Armor/SilvaHelm.cs b/Items/Armor/SilvaHelm.cs index 757d8b281a..58ca2b21c3 100644 --- a/Items/Armor/SilvaHelm.cs +++ b/Items/Armor/SilvaHelm.cs @@ -22,20 +22,10 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 9000000; - item.defense = 52; //110 - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(108, 45, 199); - } - } - } + item.value = Item.buyPrice(0, 90, 0, 0); + item.defense = 52; //110 + item.GetGlobalItem(mod).postMoonLordRarity = 15; + } public override bool IsArmorSet(Item head, Item body, Item legs) { @@ -61,7 +51,7 @@ namespace CalamityMod.Items.Armor "This effect only triggers once per life\n" + "Your max life will return to normal if you die\n" + "True melee strikes have a 25% chance to do five times damage\n" + - "After the silva invincibility is over you will take halved contact damage\n" + + "After the silva invincibility is over you will take 20% less contact damage\n" + "Melee projectiles have a 25% chance to stun enemies for a very brief moment"; } diff --git a/Items/Armor/SilvaHelmet.cs b/Items/Armor/SilvaHelmet.cs index b00d3c073f..9b7e697322 100644 --- a/Items/Armor/SilvaHelmet.cs +++ b/Items/Armor/SilvaHelmet.cs @@ -22,20 +22,10 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 9000000; - item.defense = 13; //110 - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(108, 45, 199); - } - } - } + item.value = Item.buyPrice(0, 90, 0, 0); + item.defense = 13; //110 + item.GetGlobalItem(mod).postMoonLordRarity = 15; + } public override bool IsArmorSet(Item head, Item body, Item legs) { @@ -71,7 +61,7 @@ namespace CalamityMod.Items.Armor } if (player.ownedProjectileCounts[mod.ProjectileType("SilvaCrystal")] < 1) { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, mod.ProjectileType("SilvaCrystal"), (int)((double)1500 * player.minionDamage), 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, mod.ProjectileType("SilvaCrystal"), (int)(1500f * player.minionDamage), 0f, Main.myPlayer, 0f, 0f); } } player.minionDamage += 0.75f; diff --git a/Items/Armor/SilvaHornedHelm.cs b/Items/Armor/SilvaHornedHelm.cs index dbfd9d2f55..3dc5874c23 100644 --- a/Items/Armor/SilvaHornedHelm.cs +++ b/Items/Armor/SilvaHornedHelm.cs @@ -22,20 +22,10 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 9000000; - item.defense = 36; //110 - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(108, 45, 199); - } - } - } + item.value = Item.buyPrice(0, 90, 0, 0); + item.defense = 36; //110 + item.GetGlobalItem(mod).postMoonLordRarity = 15; + } public override bool IsArmorSet(Item head, Item body, Item legs) { diff --git a/Items/Armor/SilvaLeggings.cs b/Items/Armor/SilvaLeggings.cs index ad73fc399f..1683c9da79 100644 --- a/Items/Armor/SilvaLeggings.cs +++ b/Items/Armor/SilvaLeggings.cs @@ -24,20 +24,10 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 7750000; - item.defense = 39; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(108, 45, 199); - } - } - } + item.value = Item.buyPrice(0, 54, 0, 0); + item.defense = 39; + item.GetGlobalItem(mod).postMoonLordRarity = 15; + } public override void UpdateEquip(Player player) { diff --git a/Items/Armor/SilvaMask.cs b/Items/Armor/SilvaMask.cs index ff6ab7fdee..398d42b34e 100644 --- a/Items/Armor/SilvaMask.cs +++ b/Items/Armor/SilvaMask.cs @@ -23,20 +23,10 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 9000000; - item.defense = 30; //110 - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(108, 45, 199); - } - } - } + item.value = Item.buyPrice(0, 90, 0, 0); + item.defense = 30; //110 + item.GetGlobalItem(mod).postMoonLordRarity = 15; + } public override bool IsArmorSet(Item head, Item body, Item legs) { @@ -53,7 +43,8 @@ namespace CalamityMod.Items.Armor CalamityPlayer modPlayer = player.GetModPlayer(mod); modPlayer.silvaSet = true; modPlayer.silvaThrowing = true; - player.setBonus = "You are immune to almost all debuffs\n" + + modPlayer.rogueStealthMax = 1.5f; + player.setBonus = "You are immune to almost all debuffs\n" + "Reduces all damage taken by 5%, this is calculated separately from damage reduction\n" + "All projectiles spawn healing leaf orbs on enemy hits\n" + "Max run speed and acceleration boosted by 5%\n" + @@ -61,8 +52,11 @@ namespace CalamityMod.Items.Armor "If you get reduced to 0 HP again while this effect is active you will lose 100 max life\n" + "This effect only triggers once per life\n" + "Your max life will return to normal if you die\n" + - "Rogue weapons have a faster throwing rate while you are above 90% life\n" + - "After the silva invulnerability time your rogue weapons will do 10% more damage"; + "Rogue weapons have a faster throwing rate while you are above 50% life\n" + + "After the silva invulnerability time your rogue weapons will do 10% more damage\n" + + "Rogue stealth builds while not attacking and not moving, up to a max of 150\n" + + "Rogue stealth only reduces when you attack, it does not reduce while moving\n" + + "The higher your rogue stealth the higher your rogue damage, crit, and movement speed"; } public override void UpdateEquip(Player player) diff --git a/Items/Armor/SilvaMaskedCap.cs b/Items/Armor/SilvaMaskedCap.cs index b548edaaf1..9df90156c8 100644 --- a/Items/Armor/SilvaMaskedCap.cs +++ b/Items/Armor/SilvaMaskedCap.cs @@ -22,20 +22,10 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 9000000; - item.defense = 21; //110 - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(108, 45, 199); - } - } - } + item.value = Item.buyPrice(0, 90, 0, 0); + item.defense = 21; //110 + item.GetGlobalItem(mod).postMoonLordRarity = 15; + } public override bool IsArmorSet(Item head, Item body, Item legs) { diff --git a/Items/Armor/SirenTransAlt_Arms.png b/Items/Armor/SirenTransAlt_Arms.png index 06431b524d..30e0af12cd 100644 Binary files a/Items/Armor/SirenTransAlt_Arms.png and b/Items/Armor/SirenTransAlt_Arms.png differ diff --git a/Items/Armor/SirenTransAlt_Body.png b/Items/Armor/SirenTransAlt_Body.png index c984cf2a81..5d11f8d6c6 100644 Binary files a/Items/Armor/SirenTransAlt_Body.png and b/Items/Armor/SirenTransAlt_Body.png differ diff --git a/Items/Armor/SirenTransAlt_Head.png b/Items/Armor/SirenTransAlt_Head.png index 3278a8408a..43736c4466 100644 Binary files a/Items/Armor/SirenTransAlt_Head.png and b/Items/Armor/SirenTransAlt_Head.png differ diff --git a/Items/Armor/SirenTransAlt_Legs.png b/Items/Armor/SirenTransAlt_Legs.png index f3c1b0e62a..2da8caf407 100644 Binary files a/Items/Armor/SirenTransAlt_Legs.png and b/Items/Armor/SirenTransAlt_Legs.png differ diff --git a/Items/Armor/SirenTrans_Arms.png b/Items/Armor/SirenTrans_Arms.png index 845a4b811d..e83eaf9f00 100644 Binary files a/Items/Armor/SirenTrans_Arms.png and b/Items/Armor/SirenTrans_Arms.png differ diff --git a/Items/Armor/SirenTrans_Body.png b/Items/Armor/SirenTrans_Body.png index aea053cf33..6f2235b065 100644 Binary files a/Items/Armor/SirenTrans_Body.png and b/Items/Armor/SirenTrans_Body.png differ diff --git a/Items/Armor/SirenTrans_Head.png b/Items/Armor/SirenTrans_Head.png index a7dab5908b..e85af53dc3 100644 Binary files a/Items/Armor/SirenTrans_Head.png and b/Items/Armor/SirenTrans_Head.png differ diff --git a/Items/Armor/SirenTrans_Legs.png b/Items/Armor/SirenTrans_Legs.png index a20136af42..9978833f30 100644 Binary files a/Items/Armor/SirenTrans_Legs.png and b/Items/Armor/SirenTrans_Legs.png differ diff --git a/Items/Armor/SirensHeart.png b/Items/Armor/SirensHeart.png index 6ff2787a67..eb1eb7b206 100644 Binary files a/Items/Armor/SirensHeart.png and b/Items/Armor/SirensHeart.png differ diff --git a/Items/Armor/SirensHeartAlt.png b/Items/Armor/SirensHeartAlt.png index 6ff2787a67..eb1eb7b206 100644 Binary files a/Items/Armor/SirensHeartAlt.png and b/Items/Armor/SirensHeartAlt.png differ diff --git a/Items/Armor/StatigelArmor.cs b/Items/Armor/StatigelArmor.cs index 4d79e7cdc7..8a8df45a2d 100644 --- a/Items/Armor/StatigelArmor.cs +++ b/Items/Armor/StatigelArmor.cs @@ -23,8 +23,8 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 150000; - item.rare = 4; + item.value = Item.buyPrice(0, 4, 0, 0); + item.rare = 4; item.defense = 10; } diff --git a/Items/Armor/StatigelCap.cs b/Items/Armor/StatigelCap.cs index 63f2837f6c..4483f42f64 100644 --- a/Items/Armor/StatigelCap.cs +++ b/Items/Armor/StatigelCap.cs @@ -23,8 +23,8 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 200000; - item.rare = 4; + item.value = Item.buyPrice(0, 5, 0, 0); + item.rare = 4; item.defense = 5; //22 } diff --git a/Items/Armor/StatigelGreaves.cs b/Items/Armor/StatigelGreaves.cs index 213fe1b2d5..1450e86ff5 100644 --- a/Items/Armor/StatigelGreaves.cs +++ b/Items/Armor/StatigelGreaves.cs @@ -23,8 +23,8 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 122500; - item.rare = 4; + item.value = Item.buyPrice(0, 3, 0, 0); + item.rare = 4; item.defense = 8; } diff --git a/Items/Armor/StatigelHeadgear.cs b/Items/Armor/StatigelHeadgear.cs index a2629e7bcb..8b9f43dafc 100644 --- a/Items/Armor/StatigelHeadgear.cs +++ b/Items/Armor/StatigelHeadgear.cs @@ -23,8 +23,8 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 200000; - item.rare = 4; + item.value = Item.buyPrice(0, 5, 0, 0); + item.rare = 4; item.defense = 7; //25 } diff --git a/Items/Armor/StatigelHelm.cs b/Items/Armor/StatigelHelm.cs index 32db4bb822..5b750fd7c0 100644 --- a/Items/Armor/StatigelHelm.cs +++ b/Items/Armor/StatigelHelm.cs @@ -23,8 +23,8 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 200000; - item.rare = 4; + item.value = Item.buyPrice(0, 5, 0, 0); + item.rare = 4; item.defense = 9; //27 } diff --git a/Items/Armor/StatigelHood.cs b/Items/Armor/StatigelHood.cs index 956db7f934..82fdfec0a2 100644 --- a/Items/Armor/StatigelHood.cs +++ b/Items/Armor/StatigelHood.cs @@ -22,8 +22,8 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 200000; - item.rare = 4; + item.value = Item.buyPrice(0, 5, 0, 0); + item.rare = 4; item.defense = 4; //20 } @@ -52,11 +52,11 @@ namespace CalamityMod.Items.Armor } if (WorldGen.crimson && player.ownedProjectileCounts[mod.ProjectileType("SlimeGodAlt")] < 1) { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, mod.ProjectileType("SlimeGodAlt"), 33, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, mod.ProjectileType("SlimeGodAlt"), (int)(33f * player.minionDamage), 0f, Main.myPlayer, 0f, 0f); } else if (!WorldGen.crimson && player.ownedProjectileCounts[mod.ProjectileType("SlimeGod")] < 1) { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, mod.ProjectileType("SlimeGod"), 33, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, mod.ProjectileType("SlimeGod"), (int)(33f * player.minionDamage), 0f, Main.myPlayer, 0f, 0f); } } } diff --git a/Items/Armor/StatigelMask.cs b/Items/Armor/StatigelMask.cs index b3ccf41874..8562d7fdf3 100644 --- a/Items/Armor/StatigelMask.cs +++ b/Items/Armor/StatigelMask.cs @@ -24,8 +24,8 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 200000; - item.rare = 4; + item.value = Item.buyPrice(0, 5, 0, 0); + item.rare = 4; item.defense = 6; //23 } @@ -37,10 +37,14 @@ namespace CalamityMod.Items.Armor public override void UpdateArmorSet(Player player) { player.setBonus = "When you take over 100 damage in one hit you become immune to damage for an extended period of time\n" + - "Grants an extra jump and increased jump height"; + "Grants an extra jump and increased jump height\n" + + "Rogue stealth builds while not attacking and not moving, up to a max of 105\n" + + "Rogue stealth only reduces when you attack, it does not reduce while moving\n" + + "The higher your rogue stealth the higher your rogue damage, crit, and movement speed"; CalamityPlayer modPlayer = player.GetModPlayer(mod); modPlayer.statigelSet = true; - player.doubleJumpSail = true; + modPlayer.rogueStealthMax = 1.05f; + player.doubleJumpSail = true; player.jumpBoost = true; } diff --git a/Items/Armor/TarragonBreastplate.cs b/Items/Armor/TarragonBreastplate.cs index d480e06a9f..8a6ce8ded0 100644 --- a/Items/Armor/TarragonBreastplate.cs +++ b/Items/Armor/TarragonBreastplate.cs @@ -27,20 +27,10 @@ namespace CalamityMod.Items.Armor item.width = 18; item.height = 18; item.lifeRegen = 2; - item.value = 1500000; - item.defense = 37; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 200); - } - } - } + item.value = Item.buyPrice(0, 40, 0, 0); + item.defense = 37; + item.GetGlobalItem(mod).postMoonLordRarity = 12; + } public override void UpdateEquip(Player player) { diff --git a/Items/Armor/TarragonHelm.cs b/Items/Armor/TarragonHelm.cs index 3818d8db25..ecc4e74763 100644 --- a/Items/Armor/TarragonHelm.cs +++ b/Items/Armor/TarragonHelm.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Armor public override void SetStaticDefaults() { DisplayName.SetDefault("Tarragon Helm"); - Tooltip.SetDefault("Immune to lava, cursed inferno, fire, cursed, and chilled debuffs\n" + + Tooltip.SetDefault("Temporary immunity to lava and immunity to cursed inferno, fire, cursed, and chilled debuffs\n" + "Can move freely through liquids\n" + "5% increased damage reduction\n" + "10% increased melee damage and critical strike chance\n" + @@ -26,20 +26,10 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 1550000; - item.defense = 33; //98 - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 200); - } - } - } + item.value = Item.buyPrice(0, 50, 0, 0); + item.defense = 33; //98 + item.GetGlobalItem(mod).postMoonLordRarity = 12; + } public override bool IsArmorSet(Item head, Item body, Item legs) { @@ -69,8 +59,8 @@ namespace CalamityMod.Items.Armor player.meleeDamage += 0.1f; player.meleeCrit += 10; player.endurance += 0.05f; - player.lavaImmune = true; - player.ignoreWater = true; + player.lavaMax += 240; + player.ignoreWater = true; player.buffImmune[BuffID.CursedInferno] = true; player.buffImmune[BuffID.OnFire] = true; player.buffImmune[BuffID.Cursed] = true; diff --git a/Items/Armor/TarragonHelmet.cs b/Items/Armor/TarragonHelmet.cs index 5d6767cf1c..574fe52c47 100644 --- a/Items/Armor/TarragonHelmet.cs +++ b/Items/Armor/TarragonHelmet.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Armor public override void SetStaticDefaults() { DisplayName.SetDefault("Tarragon Helmet"); - Tooltip.SetDefault("Immune to lava, cursed inferno, fire, cursed, and chilled debuffs\n" + + Tooltip.SetDefault("Temporary immunity to lava and immunity to cursed inferno, fire, cursed, and chilled debuffs\n" + "Can move freely through liquids\n" + "10% increased rogue damage and critical strike chance\n" + "5% increased damage reduction"); @@ -26,20 +26,10 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 1550000; - item.defense = 15; //98 - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 200); - } - } - } + item.value = Item.buyPrice(0, 50, 0, 0); + item.defense = 15; //98 + item.GetGlobalItem(mod).postMoonLordRarity = 12; + } public override bool IsArmorSet(Item head, Item body, Item legs) { @@ -57,12 +47,16 @@ namespace CalamityMod.Items.Armor CalamityPlayer modPlayer = player.GetModPlayer(mod); modPlayer.tarraSet = true; modPlayer.tarraThrowing = true; - player.setBonus = "Reduces enemy spawn rates\n" + + modPlayer.rogueStealthMax = 1.3f; + player.setBonus = "Reduces enemy spawn rates\n" + "Increased heart pickup range\n" + "Enemies have a chance to drop extra hearts on death\n" + "After every 25 rogue critical hits you will gain 5 seconds of damage immunity\n" + "This effect can only occur once every 30 seconds\n" + - "While under the effects of a debuff you gain 10% increased rogue damage"; + "While under the effects of a debuff you gain 10% increased rogue damage\n" + + "Rogue stealth builds while not attacking and not moving, up to a max of 130\n" + + "Rogue stealth only reduces when you attack, it does not reduce while moving\n" + + "The higher your rogue stealth the higher your rogue damage, crit, and movement speed"; } public override void UpdateEquip(Player player) @@ -70,8 +64,8 @@ namespace CalamityMod.Items.Armor CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.1f; CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 10; player.endurance += 0.05f; - player.lavaImmune = true; - player.ignoreWater = true; + player.lavaMax += 240; + player.ignoreWater = true; player.buffImmune[BuffID.CursedInferno] = true; player.buffImmune[BuffID.OnFire] = true; player.buffImmune[BuffID.Cursed] = true; diff --git a/Items/Armor/TarragonHornedHelm.cs b/Items/Armor/TarragonHornedHelm.cs index 8dec5cc86b..aa2f4ae415 100644 --- a/Items/Armor/TarragonHornedHelm.cs +++ b/Items/Armor/TarragonHornedHelm.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Armor public override void SetStaticDefaults() { DisplayName.SetDefault("Tarragon Horned Helm"); - Tooltip.SetDefault("Immune to lava, cursed inferno, fire, cursed, and chilled debuffs\n" + + Tooltip.SetDefault("Temporary immunity to lava and immunity to cursed inferno, fire, cursed, and chilled debuffs\n" + "Can move freely through liquids\n" + "5% increased damage reduction and +3 max minions"); } @@ -24,20 +24,10 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 1550000; - item.defense = 3; //98 - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 200); - } - } - } + item.value = Item.buyPrice(0, 50, 0, 0); + item.defense = 3; //98 + item.GetGlobalItem(mod).postMoonLordRarity = 12; + } public override bool IsArmorSet(Item head, Item body, Item legs) { @@ -68,8 +58,8 @@ namespace CalamityMod.Items.Armor { player.maxMinions += 3; player.endurance += 0.05f; - player.lavaImmune = true; - player.ignoreWater = true; + player.lavaMax += 240; + player.ignoreWater = true; player.buffImmune[BuffID.CursedInferno] = true; player.buffImmune[BuffID.OnFire] = true; player.buffImmune[BuffID.Cursed] = true; diff --git a/Items/Armor/TarragonLeggings.cs b/Items/Armor/TarragonLeggings.cs index f6e549dab7..21f20033e5 100644 --- a/Items/Armor/TarragonLeggings.cs +++ b/Items/Armor/TarragonLeggings.cs @@ -25,20 +25,10 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 1462500; - item.defense = 32; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 200); - } - } - } + item.value = Item.buyPrice(0, 30, 0, 0); + item.defense = 32; + item.GetGlobalItem(mod).postMoonLordRarity = 12; + } public override void UpdateEquip(Player player) { diff --git a/Items/Armor/TarragonMask.cs b/Items/Armor/TarragonMask.cs index 742f9afbc8..62b9350168 100644 --- a/Items/Armor/TarragonMask.cs +++ b/Items/Armor/TarragonMask.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Armor public override void SetStaticDefaults() { DisplayName.SetDefault("Tarragon Mask"); - Tooltip.SetDefault("Immune to lava, cursed inferno, fire, cursed, and chilled debuffs\n" + + Tooltip.SetDefault("Temporary immunity to lava and immunity to cursed inferno, fire, cursed, and chilled debuffs\n" + "Can move freely through liquids\n" + "10% increased magic damage and critical strike chance\n" + "5% increased damage reduction"); @@ -25,20 +25,10 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 1550000; - item.defense = 10; //98 - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 200); - } - } - } + item.value = Item.buyPrice(0, 50, 0, 0); + item.defense = 10; //98 + item.GetGlobalItem(mod).postMoonLordRarity = 12; + } public override bool IsArmorSet(Item head, Item body, Item legs) { @@ -69,8 +59,8 @@ namespace CalamityMod.Items.Armor player.magicDamage += 0.1f; player.magicCrit += 10; player.endurance += 0.05f; - player.lavaImmune = true; - player.ignoreWater = true; + player.lavaMax += 240; + player.ignoreWater = true; player.buffImmune[BuffID.CursedInferno] = true; player.buffImmune[BuffID.OnFire] = true; player.buffImmune[BuffID.Cursed] = true; diff --git a/Items/Armor/TarragonVisage.cs b/Items/Armor/TarragonVisage.cs index cae96559c5..7b7a51e428 100644 --- a/Items/Armor/TarragonVisage.cs +++ b/Items/Armor/TarragonVisage.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Armor public override void SetStaticDefaults() { DisplayName.SetDefault("Tarragon Visage"); - Tooltip.SetDefault("Immune to lava, cursed inferno, fire, cursed, and chilled debuffs\n" + + Tooltip.SetDefault("Temporary immunity to lava and immunity to cursed inferno, fire, cursed, and chilled debuffs\n" + "Can move freely through liquids\n" + "10% increased ranged damage and critical strike chance\n" + "5% increased damage reduction"); @@ -25,20 +25,10 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 1550000; - item.defense = 21; //98 - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 200); - } - } - } + item.value = Item.buyPrice(0, 50, 0, 0); + item.defense = 21; //98 + item.GetGlobalItem(mod).postMoonLordRarity = 12; + } public override bool IsArmorSet(Item head, Item body, Item legs) { @@ -68,8 +58,8 @@ namespace CalamityMod.Items.Armor player.rangedDamage += 0.1f; player.rangedCrit += 10; player.endurance += 0.05f; - player.lavaImmune = true; - player.ignoreWater = true; + player.lavaMax += 240; + player.ignoreWater = true; player.buffImmune[BuffID.CursedInferno] = true; player.buffImmune[BuffID.OnFire] = true; player.buffImmune[BuffID.Cursed] = true; diff --git a/Items/Armor/VictideBreastplate.cs b/Items/Armor/VictideBreastplate.cs index 1b8576e36f..979dc3c149 100644 --- a/Items/Armor/VictideBreastplate.cs +++ b/Items/Armor/VictideBreastplate.cs @@ -24,8 +24,8 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 38000; - item.rare = 2; + item.value = Item.buyPrice(0, 1, 0, 0); + item.rare = 2; item.defense = 5; //9 } diff --git a/Items/Armor/VictideHeadgear.cs b/Items/Armor/VictideHeadgear.cs index 8d55c50e60..c0890303d2 100644 --- a/Items/Armor/VictideHeadgear.cs +++ b/Items/Armor/VictideHeadgear.cs @@ -23,8 +23,8 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 40000; - item.rare = 2; + item.value = Item.buyPrice(0, 1, 50, 0); + item.rare = 2; item.defense = 3; //10 } @@ -38,10 +38,14 @@ namespace CalamityMod.Items.Armor player.setBonus = "Increased life regen and rogue damage while submerged in liquid\n" + "When using any weapon you have a 10% chance to throw a returning seashell projectile\n" + "This seashell does true damage and does not benefit from any damage class\n" + - "Slightly reduces breath loss in the abyss"; + "Slightly reduces breath loss in the abyss\n" + + "Rogue stealth builds while not attacking and not moving, up to a max of 100\n" + + "Rogue stealth only reduces when you attack, it does not reduce while moving\n" + + "The higher your rogue stealth the higher your rogue damage, crit, and movement speed"; CalamityPlayer modPlayer = player.GetModPlayer(mod); modPlayer.victideSet = true; - player.ignoreWater = true; + modPlayer.rogueStealthMax = 1f; + player.ignoreWater = true; if (Collision.DrownCollision(player.position, player.width, player.height, player.gravDir)) { CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.1f; diff --git a/Items/Armor/VictideHelm.cs b/Items/Armor/VictideHelm.cs index 93297c8c12..467101fbf4 100644 --- a/Items/Armor/VictideHelm.cs +++ b/Items/Armor/VictideHelm.cs @@ -22,8 +22,8 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 40000; - item.rare = 2; + item.value = Item.buyPrice(0, 1, 50, 0); + item.rare = 2; item.defense = 4; //11 } diff --git a/Items/Armor/VictideHelmet.cs b/Items/Armor/VictideHelmet.cs index 2c670f0df4..51ded7feae 100644 --- a/Items/Armor/VictideHelmet.cs +++ b/Items/Armor/VictideHelmet.cs @@ -23,8 +23,8 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 40000; - item.rare = 2; + item.value = Item.buyPrice(0, 1, 50, 0); + item.rare = 2; item.defense = 1; //8 } @@ -51,7 +51,7 @@ namespace CalamityMod.Items.Armor } if (player.ownedProjectileCounts[mod.ProjectileType("Urchin")] < 1) { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, mod.ProjectileType("Urchin"), 0, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, mod.ProjectileType("Urchin"), (int)(7f * player.minionDamage), 0f, Main.myPlayer, 0f, 0f); } } player.ignoreWater = true; diff --git a/Items/Armor/VictideLeggings.cs b/Items/Armor/VictideLeggings.cs index d04c28a621..ba5e4bab36 100644 --- a/Items/Armor/VictideLeggings.cs +++ b/Items/Armor/VictideLeggings.cs @@ -23,8 +23,8 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 37500; - item.rare = 2; + item.value = Item.buyPrice(0, 0, 50, 0); + item.rare = 2; item.defense = 4; //9 } diff --git a/Items/Armor/VictideMask.cs b/Items/Armor/VictideMask.cs index a9888a6a91..36966cdbf9 100644 --- a/Items/Armor/VictideMask.cs +++ b/Items/Armor/VictideMask.cs @@ -22,8 +22,8 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 40000; - item.rare = 2; + item.value = Item.buyPrice(0, 1, 50, 0); + item.rare = 2; item.defense = 2; //9 } diff --git a/Items/Armor/VictideVisage.cs b/Items/Armor/VictideVisage.cs index 5c23b2d649..06ec86ae2e 100644 --- a/Items/Armor/VictideVisage.cs +++ b/Items/Armor/VictideVisage.cs @@ -22,8 +22,8 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 40000; - item.rare = 2; + item.value = Item.buyPrice(0, 1, 50, 0); + item.rare = 2; item.defense = 3; //10 } diff --git a/Items/Armor/WulfrumArmor.cs b/Items/Armor/WulfrumArmor.cs index 3b262999bf..dfdab1577a 100644 --- a/Items/Armor/WulfrumArmor.cs +++ b/Items/Armor/WulfrumArmor.cs @@ -23,8 +23,8 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 18000; - item.rare = 1; + item.value = Item.buyPrice(0, 0, 50, 0); + item.rare = 1; item.defense = 2; } diff --git a/Items/Armor/WulfrumHeadgear.cs b/Items/Armor/WulfrumHeadgear.cs index aeac07b7ec..1ef0d43fed 100644 --- a/Items/Armor/WulfrumHeadgear.cs +++ b/Items/Armor/WulfrumHeadgear.cs @@ -22,8 +22,8 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 20000; - item.rare = 1; + item.value = Item.buyPrice(0, 0, 75, 0); + item.rare = 1; item.defense = 2; //7 } diff --git a/Items/Armor/WulfrumHelm.cs b/Items/Armor/WulfrumHelm.cs index 0282d634cd..52e3f55404 100644 --- a/Items/Armor/WulfrumHelm.cs +++ b/Items/Armor/WulfrumHelm.cs @@ -22,8 +22,8 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 20000; - item.rare = 1; + item.value = Item.buyPrice(0, 0, 75, 0); + item.rare = 1; item.defense = 3; //8 } diff --git a/Items/Armor/WulfrumHelmet.cs b/Items/Armor/WulfrumHelmet.cs index a00f1e303d..cb3bacdf4d 100644 --- a/Items/Armor/WulfrumHelmet.cs +++ b/Items/Armor/WulfrumHelmet.cs @@ -23,8 +23,8 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 20000; - item.rare = 1; + item.value = Item.buyPrice(0, 0, 75, 0); + item.rare = 1; } public override bool IsArmorSet(Item head, Item body, Item legs) diff --git a/Items/Armor/WulfrumHood.cs b/Items/Armor/WulfrumHood.cs index bf820311f6..d099b50575 100644 --- a/Items/Armor/WulfrumHood.cs +++ b/Items/Armor/WulfrumHood.cs @@ -22,8 +22,8 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 20000; - item.rare = 1; + item.value = Item.buyPrice(0, 0, 75, 0); + item.rare = 1; item.defense = 1; //6 } diff --git a/Items/Armor/WulfrumLeggings.cs b/Items/Armor/WulfrumLeggings.cs index afbf36189b..23b4abf057 100644 --- a/Items/Armor/WulfrumLeggings.cs +++ b/Items/Armor/WulfrumLeggings.cs @@ -22,8 +22,8 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 17500; - item.rare = 1; + item.value = Item.buyPrice(0, 0, 25, 0); + item.rare = 1; item.defense = 1; } diff --git a/Items/Armor/WulfrumMask.cs b/Items/Armor/WulfrumMask.cs index cd09751a52..6c78277da8 100644 --- a/Items/Armor/WulfrumMask.cs +++ b/Items/Armor/WulfrumMask.cs @@ -23,8 +23,8 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 20000; - item.rare = 1; + item.value = Item.buyPrice(0, 0, 75, 0); + item.rare = 1; item.defense = 1; //6 } diff --git a/Items/Armor/XerocCuisses.cs b/Items/Armor/XerocCuisses.cs index 3cd579498d..d5cbd84b01 100644 --- a/Items/Armor/XerocCuisses.cs +++ b/Items/Armor/XerocCuisses.cs @@ -25,8 +25,8 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 375000; - item.rare = 9; + item.value = Item.buyPrice(0, 24, 0, 0); + item.rare = 9; item.defense = 24; } diff --git a/Items/Armor/XerocMask.cs b/Items/Armor/XerocMask.cs index 588cf60985..091c7dc7b6 100644 --- a/Items/Armor/XerocMask.cs +++ b/Items/Armor/XerocMask.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Armor { DisplayName.SetDefault("Xeroc Mask"); Tooltip.SetDefault("11% increased rogue damage and critical strike chance\n" + - "Immune to lava, cursed, fire, cursed inferno, and chilled\n" + + "Temporary immunity to lava and immunity to cursed, fire, cursed inferno, and chilled\n" + "Wrath of the cosmos"); } @@ -25,8 +25,8 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 500000; - item.rare = 9; + item.value = Item.buyPrice(0, 40, 0, 0); + item.rare = 9; item.defense = 20; //71 } @@ -45,9 +45,13 @@ namespace CalamityMod.Items.Armor { CalamityPlayer modPlayer = player.GetModPlayer(mod); modPlayer.xerocSet = true; - player.setBonus = "9% increased rogue damage and velocity\n" + + modPlayer.rogueStealthMax = 1.25f; + player.setBonus = "9% increased rogue damage and velocity\n" + "All projectile types have special effects on enemy hits\n" + - "Imbued with cosmic wrath and rage when you are damaged"; + "Imbued with cosmic wrath and rage when you are damaged\n" + + "Rogue stealth builds while not attacking and not moving, up to a max of 125\n" + + "Rogue stealth only reduces when you attack, it does not reduce while moving\n" + + "The higher your rogue stealth the higher your rogue damage, crit, and movement speed"; if (player.statLife <= (int)((double)player.statLifeMax2 * 0.5)) { player.AddBuff(BuffID.Wrath, 2); @@ -61,8 +65,8 @@ namespace CalamityMod.Items.Armor { CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.11f; CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 11; - player.lavaImmune = true; - player.buffImmune[BuffID.OnFire] = true; + player.lavaMax += 240; + player.buffImmune[BuffID.OnFire] = true; player.buffImmune[BuffID.CursedInferno] = true; player.buffImmune[BuffID.Cursed] = true; player.buffImmune[BuffID.Chilled] = true; diff --git a/Items/Armor/XerocPlateMail.cs b/Items/Armor/XerocPlateMail.cs index 97a61cfa52..a0636f480b 100644 --- a/Items/Armor/XerocPlateMail.cs +++ b/Items/Armor/XerocPlateMail.cs @@ -26,8 +26,8 @@ namespace CalamityMod.Items.Armor { item.width = 18; item.height = 18; - item.value = 425000; - item.rare = 9; + item.value = Item.buyPrice(0, 32, 0, 0); + item.rare = 9; item.defense = 27; } diff --git a/Items/AshenKey.cs b/Items/AshenKey.cs index 81878aa556..9e0e0c8b0a 100644 --- a/Items/AshenKey.cs +++ b/Items/AshenKey.cs @@ -1,3 +1,4 @@ +using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -15,7 +16,7 @@ namespace CalamityMod.Items item.width = 20; item.height = 20; item.maxStack = 99; - item.value = 100; + item.value = Item.buyPrice(0, 0, 10, 0); item.rare = 1; } diff --git a/Items/Astrageldon/AstrageldonBag.cs b/Items/Astrageldon/AstrageldonBag.cs index ba8e9edcaa..715c56c745 100644 --- a/Items/Astrageldon/AstrageldonBag.cs +++ b/Items/Astrageldon/AstrageldonBag.cs @@ -30,17 +30,36 @@ namespace CalamityMod.Items.Astrageldon public override void OpenBossBag(Player player) { - player.TryGettingDevArmor(); + if (CalamityWorld.revenge) + { + if (NPC.downedMoonlord) + { + player.QuickSpawnItem(mod.ItemType("SquishyBeanMount")); + } + if (Main.rand.Next(20) == 0) + { + switch (Main.rand.Next(3)) + { + case 0: + player.QuickSpawnItem(mod.ItemType("StressPills")); + break; + case 1: + player.QuickSpawnItem(mod.ItemType("Laudanum")); + break; + case 2: + player.QuickSpawnItem(mod.ItemType("HeartofDarkness")); + break; + } + } + } + player.TryGettingDevArmor(); player.QuickSpawnItem(mod.ItemType("AstralJelly"), Main.rand.Next(12, 17)); player.QuickSpawnItem(mod.ItemType("Stardust"), Main.rand.Next(30, 41)); player.QuickSpawnItem(ItemID.FallenStar, Main.rand.Next(30, 51)); - if (NPC.downedMoonlord) - { - if (CalamityWorld.revenge) - { - player.QuickSpawnItem(mod.ItemType("SquishyBeanMount")); - } - } + if (Main.rand.Next(7) == 0) + { + player.QuickSpawnItem(mod.ItemType("AureusMask")); + } } } } \ No newline at end of file diff --git a/Items/Astrageldon/AstralJelly.cs b/Items/Astrageldon/AstralJelly.cs index 4e2ec08473..4292dc0bfb 100644 --- a/Items/Astrageldon/AstralJelly.cs +++ b/Items/Astrageldon/AstralJelly.cs @@ -29,8 +29,8 @@ namespace CalamityMod.Items.Astrageldon item.useStyle = 2; item.UseSound = SoundID.Item3; item.consumable = true; - item.value = 50000; - item.buffType = BuffID.WellFed; + item.value = Item.buyPrice(0, 4, 50, 0); + item.buffType = BuffID.WellFed; item.buffTime = 108000; } diff --git a/Items/AstrumDeus/AstrumDeusBag.cs b/Items/AstrumDeus/AstrumDeusBag.cs index 195f22d488..68e7d954f4 100644 --- a/Items/AstrumDeus/AstrumDeusBag.cs +++ b/Items/AstrumDeus/AstrumDeusBag.cs @@ -7,11 +7,11 @@ namespace CalamityMod.Items.AstrumDeus public class AstrumDeusBag : ModItem { public override void SetStaticDefaults() - { - DisplayName.SetDefault("Treasure Bag"); - Tooltip.SetDefault("{$CommonItemTooltip.RightClickToOpen}"); - } - + { + DisplayName.SetDefault("Treasure Bag"); + Tooltip.SetDefault("{$CommonItemTooltip.RightClickToOpen}"); + } + public override void SetDefaults() { item.maxStack = 999; @@ -30,25 +30,44 @@ namespace CalamityMod.Items.AstrumDeus public override void OpenBossBag(Player player) { + if (CalamityWorld.revenge) + { + player.QuickSpawnItem(mod.ItemType("StarlightFuelCell")); + if (Main.rand.Next(20) == 0) + { + switch (Main.rand.Next(3)) + { + case 0: + player.QuickSpawnItem(mod.ItemType("StressPills")); + break; + case 1: + player.QuickSpawnItem(mod.ItemType("Laudanum")); + break; + case 2: + player.QuickSpawnItem(mod.ItemType("HeartofDarkness")); + break; + } + } + } player.TryGettingDevArmor(); - player.QuickSpawnItem(mod.ItemType("Stardust"), Main.rand.Next(60, 91)); - if (Main.rand.Next(4) == 0) - { - player.QuickSpawnItem(mod.ItemType("Starfall")); - } - if (Main.rand.Next(4) == 0) - { - player.QuickSpawnItem(mod.ItemType("Nebulash")); - } - player.QuickSpawnItem(mod.ItemType("AstralBulwark")); - if (CalamityWorld.revenge) - { - player.QuickSpawnItem(mod.ItemType("StarlightFuelCell")); - } - if (Main.rand.Next(7) == 0) - { - player.QuickSpawnItem(mod.ItemType("AstrumDeusMask")); - } - } + player.QuickSpawnItem(mod.ItemType("Stardust"), Main.rand.Next(60, 91)); + if (Main.rand.Next(4) == 0) + { + player.QuickSpawnItem(mod.ItemType("Starfall")); + } + if (Main.rand.Next(4) == 0) + { + player.QuickSpawnItem(mod.ItemType("Nebulash")); + } + if (Main.rand.Next(5) == 0) + { + player.QuickSpawnItem(ItemID.HallowedKey); + } + player.QuickSpawnItem(mod.ItemType("AstralBulwark")); + if (Main.rand.Next(7) == 0) + { + player.QuickSpawnItem(mod.ItemType("AstrumDeusMask")); + } + } } } \ No newline at end of file diff --git a/Items/BarofLife.cs b/Items/BarofLife.cs index c7204df670..8a0eb877c3 100644 --- a/Items/BarofLife.cs +++ b/Items/BarofLife.cs @@ -7,31 +7,33 @@ using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Items; -namespace CalamityMod.Items { -public class BarofLife : ModItem +namespace CalamityMod.Items { - public override void SetStaticDefaults() + public class BarofLife : ModItem { - DisplayName.SetDefault("Bar of Life"); + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bar of Life"); + } + + public override void SetDefaults() + { + item.width = 30; + item.height = 24; + item.maxStack = 999; + item.value = Item.buyPrice(0, 5, 0, 0); + item.rare = 8; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "VerstaltiteBar"); + recipe.AddIngredient(null, "DraedonBar"); + recipe.AddIngredient(null, "CruptixBar"); + recipe.AddTile(TileID.MythrilAnvil); + recipe.SetResult(this); + recipe.AddRecipe(); + } } - - public override void SetDefaults() - { - item.width = 15; - item.height = 12; - item.maxStack = 999; - item.value = 900000; - item.rare = 10; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "VerstaltiteBar"); - recipe.AddIngredient(null, "DraedonBar"); - recipe.AddIngredient(null, "CruptixBar"); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} \ No newline at end of file +} \ No newline at end of file diff --git a/Items/BearEye.cs b/Items/BearEye.cs index 13a8fb7d43..8a4a2924cc 100644 --- a/Items/BearEye.cs +++ b/Items/BearEye.cs @@ -1,40 +1,40 @@ -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.Audio; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items -{ - public class BearEye : ModItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Bear's Eye"); - Tooltip.SetDefault("Summons a pet guardian angel"); - } - public override void SetDefaults() - { - item.damage = 0; - item.useStyle = 1; - item.useAnimation = 20; - item.useTime = 20; - item.noMelee = true; - item.width = 30; - item.height = 30; - item.value = Item.sellPrice(1, 0, 0, 0); - item.shoot = mod.ProjectileType("Bear"); - item.buffType = mod.BuffType("BearBuff"); - item.rare = 5; - item.UseSound = new Terraria.Audio.LegacySoundStyle(SoundID.Meowmere, 5); - } - - public override void UseStyle(Player player) - { - if (player.whoAmI == Main.myPlayer && player.itemTime == 0) - { - player.AddBuff(item.buffType, 15, true); - } - } - } -} +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items +{ + public class BearEye : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bear's Eye"); + Tooltip.SetDefault("Summons a pet guardian angel"); + } + public override void SetDefaults() + { + item.damage = 0; + item.useStyle = 1; + item.useAnimation = 20; + item.useTime = 20; + item.noMelee = true; + item.width = 30; + item.height = 30; + item.value = Item.sellPrice(1, 0, 0, 0); + item.shoot = mod.ProjectileType("Bear"); + item.buffType = mod.BuffType("BearBuff"); + item.rare = 5; + item.UseSound = new Terraria.Audio.LegacySoundStyle(SoundID.Meowmere, 5); + } + + public override void UseStyle(Player player) + { + if (player.whoAmI == Main.myPlayer && player.itemTime == 0) + { + player.AddBuff(item.buffType, 15, true); + } + } + } +} diff --git a/Items/BeetleJuice.cs b/Items/BeetleJuice.cs index 340cbbf426..f8fbbf2085 100644 --- a/Items/BeetleJuice.cs +++ b/Items/BeetleJuice.cs @@ -7,20 +7,22 @@ using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Items; -namespace CalamityMod.Items { -public class BeetleJuice : ModItem +namespace CalamityMod.Items { - public override void SetStaticDefaults() + public class BeetleJuice : ModItem { - DisplayName.SetDefault("Beetle Juice"); + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Beetle Juice"); + } + + public override void SetDefaults() + { + item.width = 20; + item.height = 20; + item.maxStack = 999; + item.value = Item.buyPrice(0, 3, 0, 0); + item.rare = 5; + } } - - public override void SetDefaults() - { - item.width = 20; - item.height = 20; - item.maxStack = 999; - item.value = 10000; - item.rare = 5; - } -}} \ No newline at end of file +} \ No newline at end of file diff --git a/Items/BlightedLens.cs b/Items/BlightedLens.cs index eb8bbdf629..1e20680285 100644 --- a/Items/BlightedLens.cs +++ b/Items/BlightedLens.cs @@ -7,20 +7,22 @@ using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Items; -namespace CalamityMod.Items { -public class BlightedLens : ModItem +namespace CalamityMod.Items { - public override void SetStaticDefaults() + public class BlightedLens : ModItem { - DisplayName.SetDefault("Blighted Lens"); + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Blighted Lens"); + } + + public override void SetDefaults() + { + item.width = 16; + item.height = 22; + item.maxStack = 999; + item.value = Item.buyPrice(0, 3, 0, 0); + item.rare = 5; + } } - - public override void SetDefaults() - { - item.width = 16; - item.height = 22; - item.maxStack = 999; - item.value = 5000; - item.rare = 2; - } -}} \ No newline at end of file +} \ No newline at end of file diff --git a/Items/BloodOrb.cs b/Items/BloodOrb.cs index de60afb9c9..7c6407e85b 100644 --- a/Items/BloodOrb.cs +++ b/Items/BloodOrb.cs @@ -21,8 +21,8 @@ namespace CalamityMod.Items item.width = 10; item.height = 10; item.maxStack = 999; - item.value = 37500; - item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.rare = 1; } public override void Update(ref float gravity, ref float maxFallSpeed) diff --git a/Items/BloodlettingEssence.cs b/Items/BloodlettingEssence.cs index 296f5759e3..4fd720bc2f 100644 --- a/Items/BloodlettingEssence.cs +++ b/Items/BloodlettingEssence.cs @@ -22,8 +22,8 @@ namespace CalamityMod.Items item.width = 20; item.height = 20; item.maxStack = 999; - item.value = 5000; - item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.rare = 1; } } } \ No newline at end of file diff --git a/Items/Bloodstone.cs b/Items/Bloodstone.cs index 0d759d7990..b3f102a48d 100644 --- a/Items/Bloodstone.cs +++ b/Items/Bloodstone.cs @@ -21,19 +21,9 @@ namespace CalamityMod.Items item.width = 13; item.height = 10; item.maxStack = 999; - item.value = 37500; - item.rare = 10; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 0); - } - } - } + item.value = Item.buyPrice(0, 0, 10, 0); + item.rare = 10; + item.GetGlobalItem(mod).postMoonLordRarity = 13; + } } } \ No newline at end of file diff --git a/Items/BloodstoneCore.cs b/Items/BloodstoneCore.cs index 47b3601702..912406ad75 100644 --- a/Items/BloodstoneCore.cs +++ b/Items/BloodstoneCore.cs @@ -21,19 +21,9 @@ namespace CalamityMod.Items item.width = 15; item.height = 12; item.maxStack = 999; - item.value = 187500; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 0); - } - } - } + item.value = Item.buyPrice(0, 7, 0, 0); + item.GetGlobalItem(mod).postMoonLordRarity = 13; + } public override void AddRecipes() { diff --git a/Items/BlossomPickaxe.cs b/Items/BlossomPickaxe.cs index d41a869fc2..fe72156820 100644 --- a/Items/BlossomPickaxe.cs +++ b/Items/BlossomPickaxe.cs @@ -34,18 +34,8 @@ namespace CalamityMod.Items item.UseSound = SoundID.Item1; item.autoReuse = true; item.tileBoost += 6; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 200); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 12; + } public override void AddRecipes() { diff --git a/Items/Brimrose.cs b/Items/Brimrose.cs index ea243e906c..15d064d0b3 100644 --- a/Items/Brimrose.cs +++ b/Items/Brimrose.cs @@ -21,8 +21,8 @@ namespace CalamityMod.Items item.useTime = 20; item.useAnimation = 20; item.useStyle = 1; - item.value = 1000000; - item.expert = true; + item.value = Item.buyPrice(1, 50, 0, 0); + item.expert = true; item.UseSound = SoundID.Item3; item.noMelee = true; item.mountType = mod.MountType("PhuppersChair"); diff --git a/Items/BrimstoneKey.cs b/Items/BrimstoneKey.cs index 67ca5a5881..57c15dc4e2 100644 --- a/Items/BrimstoneKey.cs +++ b/Items/BrimstoneKey.cs @@ -1,3 +1,4 @@ +using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -14,8 +15,7 @@ namespace CalamityMod.Items { item.width = 20; item.height = 20; - item.maxStack = 1; - item.value = 100; + item.value = Item.buyPrice(0, 0, 10, 0); item.rare = 1; } diff --git a/Items/BrimstoneWaifu/BrimstoneWaifuBag.cs b/Items/BrimstoneWaifu/BrimstoneWaifuBag.cs index 81b5f96691..6ee75e48cf 100644 --- a/Items/BrimstoneWaifu/BrimstoneWaifuBag.cs +++ b/Items/BrimstoneWaifu/BrimstoneWaifuBag.cs @@ -7,11 +7,11 @@ namespace CalamityMod.Items.BrimstoneWaifu public class BrimstoneWaifuBag : ModItem { public override void SetStaticDefaults() - { - DisplayName.SetDefault("Treasure Bag"); - Tooltip.SetDefault("{$CommonItemTooltip.RightClickToOpen}"); - } - + { + DisplayName.SetDefault("Treasure Bag"); + Tooltip.SetDefault("{$CommonItemTooltip.RightClickToOpen}"); + } + public override void SetDefaults() { item.maxStack = 999; @@ -30,31 +30,55 @@ namespace CalamityMod.Items.BrimstoneWaifu public override void OpenBossBag(Player player) { + if (CalamityWorld.revenge) + { + player.QuickSpawnItem(mod.ItemType("CharredRelic")); + if (CalamityWorld.downedProvidence) + { + player.QuickSpawnItem(mod.ItemType("Brimrose")); + } + if (Main.rand.Next(20) == 0) + { + switch (Main.rand.Next(3)) + { + case 0: + player.QuickSpawnItem(mod.ItemType("StressPills")); + break; + case 1: + player.QuickSpawnItem(mod.ItemType("Laudanum")); + break; + case 2: + player.QuickSpawnItem(mod.ItemType("HeartofDarkness")); + break; + } + } + } player.TryGettingDevArmor(); - int choice = Main.rand.Next(3); - if (choice == 0) + switch (Main.rand.Next(3)) { - player.QuickSpawnItem(mod.ItemType("Abaddon")); + case 0: + player.QuickSpawnItem(mod.ItemType("Abaddon")); + break; + case 1: + player.QuickSpawnItem(mod.ItemType("Abaddon")); + player.QuickSpawnItem(mod.ItemType("Brimlance")); + break; + case 2: + player.QuickSpawnItem(mod.ItemType("Abaddon")); + player.QuickSpawnItem(mod.ItemType("SeethingDischarge")); + break; } - else if (choice == 1) + if (CalamityWorld.downedProvidence) { - player.QuickSpawnItem(mod.ItemType("Brimlance")); + player.QuickSpawnItem(mod.ItemType("Bloodstone"), Main.rand.Next(25, 36)); } - else + if (Main.rand.Next(10) == 0) { - player.QuickSpawnItem(mod.ItemType("SeethingDischarge")); + player.QuickSpawnItem(mod.ItemType("RoseStone")); } - player.QuickSpawnItem(ItemID.SoulofFright, Main.rand.Next(25, 41)); - player.QuickSpawnItem(mod.ItemType("EssenceofChaos"), Main.rand.Next(3, 5)); + player.QuickSpawnItem(ItemID.SoulofFright, Main.rand.Next(25, 41)); + player.QuickSpawnItem(mod.ItemType("EssenceofChaos"), Main.rand.Next(5, 10)); player.QuickSpawnItem(mod.ItemType("Gehenna")); - if (CalamityWorld.revenge) - { - player.QuickSpawnItem(mod.ItemType("CharredRelic")); - if (CalamityWorld.downedProvidence) - { - player.QuickSpawnItem(mod.ItemType("Brimrose")); - } - } } } } \ No newline at end of file diff --git a/Items/BrimstoneWaifu/RoseStone.cs b/Items/BrimstoneWaifu/RoseStone.cs index fed4ba183e..e46997f3c0 100644 --- a/Items/BrimstoneWaifu/RoseStone.cs +++ b/Items/BrimstoneWaifu/RoseStone.cs @@ -59,7 +59,7 @@ namespace CalamityMod.Items.BrimstoneWaifu } if (player.ownedProjectileCounts[mod.ProjectileType("BigBustyRose")] < 1) { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, mod.ProjectileType("BigBustyRose"), 45, 2f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, mod.ProjectileType("BigBustyRose"), (int)(45f * player.minionDamage), 2f, Main.myPlayer, 0f, 0f); } } } diff --git a/Items/BulbofDoom.cs b/Items/BulbofDoom.cs index b6ce9ea7c9..a050bd73e7 100644 --- a/Items/BulbofDoom.cs +++ b/Items/BulbofDoom.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items { public override void SetStaticDefaults() { - DisplayName.SetDefault("Portable Bulb"); + DisplayName.SetDefault("Portabulb"); Tooltip.SetDefault("Summons Plantera"); } @@ -44,8 +44,12 @@ namespace CalamityMod.Items public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "BarofLife", 3); - recipe.AddIngredient(null, "LivingShard"); + recipe.AddIngredient(ItemID.JungleSpores, 15); + recipe.AddIngredient(ItemID.SoulofNight, 10); + recipe.AddIngredient(ItemID.SoulofLight, 10); + recipe.AddIngredient(null, "MurkyPaste", 3); + recipe.AddIngredient(null, "ManeaterBulb"); + recipe.AddIngredient(null, "TrapperBulb"); recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Bumblefuck/BumblebirbBag.cs b/Items/Bumblefuck/BumblebirbBag.cs index a99c212f34..828f8c32c6 100644 --- a/Items/Bumblefuck/BumblebirbBag.cs +++ b/Items/Bumblefuck/BumblebirbBag.cs @@ -7,11 +7,11 @@ namespace CalamityMod.Items.Bumblefuck public class BumblebirbBag : ModItem { public override void SetStaticDefaults() - { - DisplayName.SetDefault("Treasure Bag"); - Tooltip.SetDefault("{$CommonItemTooltip.RightClickToOpen}"); - } - + { + DisplayName.SetDefault("Treasure Bag"); + Tooltip.SetDefault("{$CommonItemTooltip.RightClickToOpen}"); + } + public override void SetDefaults() { item.maxStack = 999; @@ -30,21 +30,39 @@ namespace CalamityMod.Items.Bumblefuck public override void OpenBossBag(Player player) { + if (CalamityWorld.revenge) + { + player.QuickSpawnItem(mod.ItemType("RedLightningContainer")); + if (Main.rand.Next(20) == 0) + { + switch (Main.rand.Next(3)) + { + case 0: + player.QuickSpawnItem(mod.ItemType("StressPills")); + break; + case 1: + player.QuickSpawnItem(mod.ItemType("Laudanum")); + break; + case 2: + player.QuickSpawnItem(mod.ItemType("HeartofDarkness")); + break; + } + } + } player.TryGettingDevArmor(); - player.QuickSpawnItem(mod.ItemType("EffulgentFeather"), Main.rand.Next(9, 15)); - int choice = Main.rand.Next(3); - if (choice == 0) - { - player.QuickSpawnItem(mod.ItemType("RougeSlash")); - } - else if (choice == 1) - { - player.QuickSpawnItem(mod.ItemType("GildedProboscis")); - } - else - { - player.QuickSpawnItem(mod.ItemType("GoldenEagle")); - } + switch (Main.rand.Next(3)) + { + case 0: + player.QuickSpawnItem(mod.ItemType("RougeSlash")); + break; + case 1: + player.QuickSpawnItem(mod.ItemType("GildedProboscis")); + break; + case 2: + player.QuickSpawnItem(mod.ItemType("GoldenEagle")); + break; + } + player.QuickSpawnItem(mod.ItemType("EffulgentFeather"), Main.rand.Next(9, 15)); } } } \ No newline at end of file diff --git a/Items/Bumblefuck/EffulgentFeather.cs b/Items/Bumblefuck/EffulgentFeather.cs index 01321d8373..010efe4bdf 100644 --- a/Items/Bumblefuck/EffulgentFeather.cs +++ b/Items/Bumblefuck/EffulgentFeather.cs @@ -7,32 +7,24 @@ using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Items; -namespace CalamityMod.Items.Bumblefuck { -public class EffulgentFeather : ModItem +namespace CalamityMod.Items.Bumblefuck { - public override void SetStaticDefaults() + public class EffulgentFeather : ModItem { - DisplayName.SetDefault("Effulgent Feather"); - Tooltip.SetDefault("It vibrates with fluffy golden energy"); - Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(3, 12)); + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Effulgent Feather"); + Tooltip.SetDefault("It vibrates with fluffy golden energy"); + Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(3, 12)); + } + + public override void SetDefaults() + { + item.width = 24; + item.height = 24; + item.maxStack = 999; + item.value = Item.buyPrice(0, 7, 50, 0); + item.GetGlobalItem(mod).postMoonLordRarity = 14; + } } - - public override void SetDefaults() - { - item.width = 24; - item.height = 24; - item.maxStack = 999; - item.value = 150000; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(43, 96, 222); - } - } - } -}} \ No newline at end of file +} \ No newline at end of file diff --git a/Items/CadencePotion.cs b/Items/CadencePotion.cs index d0ca29648c..133cb46b35 100644 --- a/Items/CadencePotion.cs +++ b/Items/CadencePotion.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items item.consumable = true; item.buffType = mod.BuffType("Cadence"); item.buffTime = 18000; - item.value = 10000; + item.value = Item.buyPrice(0, 2, 0, 0); } public override void AddRecipes() diff --git a/Items/Calamitas/CalamitasBag.cs b/Items/Calamitas/CalamitasBag.cs index 46f1c3e70d..69fb025e45 100644 --- a/Items/Calamitas/CalamitasBag.cs +++ b/Items/Calamitas/CalamitasBag.cs @@ -30,6 +30,25 @@ namespace CalamityMod.Items.Calamitas public override void OpenBossBag(Player player) { + if (CalamityWorld.revenge) + { + player.QuickSpawnItem(mod.ItemType("Animosity")); + if (Main.rand.Next(20) == 0) + { + switch (Main.rand.Next(3)) + { + case 0: + player.QuickSpawnItem(mod.ItemType("StressPills")); + break; + case 1: + player.QuickSpawnItem(mod.ItemType("Laudanum")); + break; + case 2: + player.QuickSpawnItem(mod.ItemType("HeartofDarkness")); + break; + } + } + } player.TryGettingDevArmor(); if (Main.rand.Next(3) == 0) { @@ -49,18 +68,14 @@ namespace CalamityMod.Items.Calamitas } if (CalamityWorld.downedProvidence) { - player.QuickSpawnItem(mod.ItemType("Bloodstone"), Main.rand.Next(30, 41)); + player.QuickSpawnItem(mod.ItemType("Bloodstone"), Main.rand.Next(35, 46)); } if (Main.rand.Next(10) == 0) { player.QuickSpawnItem(mod.ItemType("ChaosStone")); } - if (CalamityWorld.revenge) - { - player.QuickSpawnItem(mod.ItemType("Animosity")); - } player.QuickSpawnItem(mod.ItemType("CalamityDust"), Main.rand.Next(14, 19)); - player.QuickSpawnItem(mod.ItemType("EssenceofChaos"), Main.rand.Next(4, 6)); + player.QuickSpawnItem(mod.ItemType("EssenceofChaos"), Main.rand.Next(5, 10)); player.QuickSpawnItem(mod.ItemType("BlightedLens"), Main.rand.Next(1, 4)); player.QuickSpawnItem(mod.ItemType("CalamityRing")); } diff --git a/Items/Calamitas/CalamityDust.cs b/Items/Calamitas/CalamityDust.cs index a81a088731..e0cf8058ef 100644 --- a/Items/Calamitas/CalamityDust.cs +++ b/Items/Calamitas/CalamityDust.cs @@ -21,8 +21,8 @@ namespace CalamityMod.Items.Calamitas item.width = 26; item.height = 20; item.maxStack = 999; - item.value = 20000; - item.rare = 7; + item.value = Item.buyPrice(0, 4, 50, 0); + item.rare = 7; } public override void Update(ref float gravity, ref float maxFallSpeed) diff --git a/Items/CalamitasBrew.cs b/Items/CalamitasBrew.cs index 44fd3c74ce..8830cb1cc4 100644 --- a/Items/CalamitasBrew.cs +++ b/Items/CalamitasBrew.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Items item.consumable = true; item.buffType = mod.BuffType("AbyssalWeapon"); item.buffTime = 36000; - item.value = 2000; + item.value = Item.buyPrice(0, 2, 0, 0); } public override void AddRecipes() diff --git a/Items/CalamitousEssence.cs b/Items/CalamitousEssence.cs index 4d78528899..e63a01b1cd 100644 --- a/Items/CalamitousEssence.cs +++ b/Items/CalamitousEssence.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items public override void Update(ref float gravity, ref float maxFallSpeed) { - maxFallSpeed *= 0f; + maxFallSpeed = 0f; float num = (float)Main.rand.Next(90, 111) * 0.01f; num *= Main.essScale; Lighting.AddLight((int)((item.position.X + (float)(item.width / 2)) / 16f), (int)((item.position.Y + (float)(item.height / 2)) / 16f), 0.1f * num, 0.1f * num, 0.1f * num); @@ -30,18 +30,8 @@ namespace CalamityMod.Items item.width = 10; item.height = 14; item.maxStack = 999; - item.value = 125000; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB); - } - } - } + item.value = Item.buyPrice(0, 10, 0, 0); + item.GetGlobalItem(mod).postMoonLordRarity = 20; + } } } \ No newline at end of file diff --git a/Items/CalamityCustomThrowingDamage/AccretionDisk.cs b/Items/CalamityCustomThrowingDamage/AccretionDisk.cs index 031521150f..fa0e3424fe 100644 --- a/Items/CalamityCustomThrowingDamage/AccretionDisk.cs +++ b/Items/CalamityCustomThrowingDamage/AccretionDisk.cs @@ -1,53 +1,55 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items; - -namespace CalamityMod.Items.CalamityCustomThrowingDamage -{ - public class AccretionDisk : CalamityDamageItem - { +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.CalamityCustomThrowingDamage +{ + public class AccretionDisk : CalamityDamageItem + { public override void SetStaticDefaults() { DisplayName.SetDefault("Elemental Disk"); Tooltip.SetDefault("Shred the fabric of reality!"); } - public override void SafeSetDefaults() - { - item.width = 38; - item.damage = 157; - item.noMelee = true; - item.noUseGraphic = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useStyle = 1; - item.useTime = 15; - item.knockBack = 9f; - item.UseSound = SoundID.Item1; - item.height = 38; - item.value = Item.buyPrice(1, 20, 0, 0); - item.rare = 10; - item.shoot = mod.ProjectileType("AccretionDisk"); - item.shootSpeed = 13f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "MangroveChakram"); - recipe.AddIngredient(null, "FlameScythe"); - recipe.AddIngredient(null, "SeashellBoomerang"); - recipe.AddIngredient(null, "GalacticaSingularity", 5); - recipe.AddIngredient(null, "BarofLife", 5); - recipe.AddIngredient(ItemID.LunarBar, 5); - recipe.AddTile(TileID.LunarCraftingStation); - recipe.SetResult(this); - recipe.AddRecipe(); - } - } -} + public override void SafeSetDefaults() + { + item.width = 38; + item.damage = 157; + item.noMelee = true; + item.noUseGraphic = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useStyle = 1; + item.useTime = 15; + item.knockBack = 9f; + item.UseSound = SoundID.Item1; + item.height = 38; + item.value = Item.buyPrice(1, 20, 0, 0); + item.rare = 10; + item.shoot = mod.ProjectileType("AccretionDisk"); + item.shootSpeed = 13f; + item.GetGlobalItem(mod).rogue = true; + item.GetGlobalItem(mod).postMoonLordRarity = 12; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "MangroveChakram"); + recipe.AddIngredient(null, "FlameScythe"); + recipe.AddIngredient(null, "SeashellBoomerang"); + recipe.AddIngredient(null, "GalacticaSingularity", 5); + recipe.AddIngredient(null, "BarofLife", 5); + recipe.AddIngredient(ItemID.LunarBar, 5); + recipe.AddTile(TileID.LunarCraftingStation); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/CalamityCustomThrowingDamage/AdamantiteThrowingAxe.cs b/Items/CalamityCustomThrowingDamage/AdamantiteThrowingAxe.cs index 1d437df246..c5844a93ee 100644 --- a/Items/CalamityCustomThrowingDamage/AdamantiteThrowingAxe.cs +++ b/Items/CalamityCustomThrowingDamage/AdamantiteThrowingAxe.cs @@ -1,49 +1,49 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items; - -namespace CalamityMod.Items.CalamityCustomThrowingDamage -{ - public class AdamantiteThrowingAxe : CalamityDamageItem - { +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.CalamityCustomThrowingDamage +{ + public class AdamantiteThrowingAxe : CalamityDamageItem + { public override void SetStaticDefaults() { DisplayName.SetDefault("Adamantite Throwing Axe"); } - public override void SafeSetDefaults() - { - item.width = 26; - item.damage = 37; - item.noMelee = true; - item.consumable = true; - item.noUseGraphic = true; - item.useAnimation = 12; - item.useStyle = 1; - item.useTime = 12; - item.knockBack = 3.25f; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - item.height = 30; - item.maxStack = 999; - item.value = 1600; - item.rare = 4; - item.shoot = mod.ProjectileType("AdamantiteThrowingAxeProjectile"); - item.shootSpeed = 12f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.AdamantiteBar); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(this, 25); - recipe.AddRecipe(); - } - } -} + public override void SafeSetDefaults() + { + item.width = 26; + item.damage = 37; + item.noMelee = true; + item.consumable = true; + item.noUseGraphic = true; + item.useAnimation = 12; + item.useStyle = 1; + item.useTime = 12; + item.knockBack = 3.25f; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.height = 30; + item.maxStack = 999; + item.value = 1600; + item.rare = 4; + item.shoot = mod.ProjectileType("AdamantiteThrowingAxeProjectile"); + item.shootSpeed = 12f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.AdamantiteBar); + recipe.AddTile(TileID.MythrilAnvil); + recipe.SetResult(this, 25); + recipe.AddRecipe(); + } + } +} diff --git a/Items/CalamityCustomThrowingDamage/BallisticPoisonBomb.cs b/Items/CalamityCustomThrowingDamage/BallisticPoisonBomb.cs index 5c7a3358d0..b1b2c10adb 100644 --- a/Items/CalamityCustomThrowingDamage/BallisticPoisonBomb.cs +++ b/Items/CalamityCustomThrowingDamage/BallisticPoisonBomb.cs @@ -1,49 +1,49 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items; - -namespace CalamityMod.Items.CalamityCustomThrowingDamage -{ - public class BallisticPoisonBomb : CalamityDamageItem - { +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.CalamityCustomThrowingDamage +{ + public class BallisticPoisonBomb : CalamityDamageItem + { public override void SetStaticDefaults() { DisplayName.SetDefault("Ballistic Poison Bomb"); } - public override void SafeSetDefaults() - { - item.width = 30; - item.damage = 55; - item.noMelee = true; - item.noUseGraphic = true; - item.useAnimation = 22; - item.useStyle = 1; - item.useTime = 22; - item.knockBack = 6.5f; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - item.height = 38; - item.value = Item.buyPrice(0, 60, 0, 0); - item.rare = 7; - item.shoot = mod.ProjectileType("BallisticPoisonBomb"); - item.shootSpeed = 12f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "DepthCells", 10); - recipe.AddIngredient(null, "SulphurousSand", 20); - recipe.AddIngredient(null, "Tenebris", 10); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(this); - recipe.AddRecipe(); - } - } -} + public override void SafeSetDefaults() + { + item.width = 30; + item.damage = 55; + item.noMelee = true; + item.noUseGraphic = true; + item.useAnimation = 22; + item.useStyle = 1; + item.useTime = 22; + item.knockBack = 6.5f; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.height = 38; + item.value = Item.buyPrice(0, 60, 0, 0); + item.rare = 7; + item.shoot = mod.ProjectileType("BallisticPoisonBomb"); + item.shootSpeed = 12f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "DepthCells", 10); + recipe.AddIngredient(null, "SulphurousSand", 20); + recipe.AddIngredient(null, "Tenebris", 10); + recipe.AddTile(TileID.MythrilAnvil); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/CalamityCustomThrowingDamage/BrackishFlask.cs b/Items/CalamityCustomThrowingDamage/BrackishFlask.cs index b4b6351b17..ff1de3b762 100644 --- a/Items/CalamityCustomThrowingDamage/BrackishFlask.cs +++ b/Items/CalamityCustomThrowingDamage/BrackishFlask.cs @@ -1,49 +1,49 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items; - -namespace CalamityMod.Items.CalamityCustomThrowingDamage -{ - public class BrackishFlask : CalamityDamageItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Brackish Flask"); - Tooltip.SetDefault("Full of poisonous saltwater"); - } - - public override void SafeSetDefaults() - { - item.width = 28; - item.damage = 40; - item.noMelee = true; - item.noUseGraphic = true; - item.useAnimation = 35; - item.useStyle = 1; - item.useTime = 35; - item.knockBack = 6.5f; - item.UseSound = SoundID.Item106; - item.autoReuse = true; - item.height = 30; - item.value = Item.buyPrice(0, 60, 0, 0); - item.rare = 7; - item.shoot = mod.ProjectileType("BrackishFlask"); - item.shootSpeed = 12f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "IOU"); - recipe.AddIngredient(null, "LivingShard"); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(this); - recipe.AddRecipe(); - } - } -} +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.CalamityCustomThrowingDamage +{ + public class BrackishFlask : CalamityDamageItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Brackish Flask"); + Tooltip.SetDefault("Full of poisonous saltwater"); + } + + public override void SafeSetDefaults() + { + item.width = 28; + item.damage = 40; + item.noMelee = true; + item.noUseGraphic = true; + item.useAnimation = 35; + item.useStyle = 1; + item.useTime = 35; + item.knockBack = 6.5f; + item.UseSound = SoundID.Item106; + item.autoReuse = true; + item.height = 30; + item.value = Item.buyPrice(0, 60, 0, 0); + item.rare = 7; + item.shoot = mod.ProjectileType("BrackishFlask"); + item.shootSpeed = 12f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "IOU"); + recipe.AddIngredient(null, "LivingShard"); + recipe.AddTile(TileID.MythrilAnvil); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/CalamityCustomThrowingDamage/Brimblade.cs b/Items/CalamityCustomThrowingDamage/Brimblade.cs index f81e0760eb..5d27872a5d 100644 --- a/Items/CalamityCustomThrowingDamage/Brimblade.cs +++ b/Items/CalamityCustomThrowingDamage/Brimblade.cs @@ -1,47 +1,47 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items; - -namespace CalamityMod.Items.CalamityCustomThrowingDamage -{ - public class Brimblade : CalamityDamageItem - { +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.CalamityCustomThrowingDamage +{ + public class Brimblade : CalamityDamageItem + { public override void SetStaticDefaults() { DisplayName.SetDefault("Brimblade"); } - public override void SafeSetDefaults() - { - item.width = 26; - item.damage = 37; - item.noMelee = true; - item.noUseGraphic = true; - item.autoReuse = true; - item.useAnimation = 18; - item.useStyle = 1; - item.useTime = 18; - item.knockBack = 6.5f; - item.UseSound = SoundID.Item1; - item.height = 26; - item.value = Item.buyPrice(0, 48, 0, 0); - item.rare = 6; - item.shoot = mod.ProjectileType("Brimblade"); - item.shootSpeed = 12f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "UnholyCore", 4); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(this); - recipe.AddRecipe(); - } - } -} + public override void SafeSetDefaults() + { + item.width = 26; + item.damage = 32; + item.noMelee = true; + item.noUseGraphic = true; + item.autoReuse = true; + item.useAnimation = 18; + item.useStyle = 1; + item.useTime = 18; + item.knockBack = 6.5f; + item.UseSound = SoundID.Item1; + item.height = 26; + item.value = Item.buyPrice(0, 48, 0, 0); + item.rare = 6; + item.shoot = mod.ProjectileType("Brimblade"); + item.shootSpeed = 12f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "UnholyCore", 4); + recipe.AddTile(TileID.MythrilAnvil); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/CalamityCustomThrowingDamage/CalamityCustomThrowingDamagePlayer.cs b/Items/CalamityCustomThrowingDamage/CalamityCustomThrowingDamagePlayer.cs index 14ff6633fb..d683967c10 100644 --- a/Items/CalamityCustomThrowingDamage/CalamityCustomThrowingDamagePlayer.cs +++ b/Items/CalamityCustomThrowingDamage/CalamityCustomThrowingDamagePlayer.cs @@ -1,42 +1,42 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Items.CalamityCustomThrowingDamage -{ - public class CalamityCustomThrowingDamagePlayer : ModPlayer - { - public static CalamityCustomThrowingDamagePlayer ModPlayer(Player player) - { - return player.GetModPlayer(); - } - - public float throwingDamage = 1f; - public float throwingVelocity = 1f; - public int throwingCrit = 4; - public bool throwingAmmoCost66 = false; - public bool throwingAmmoCost50 = false; - - public override void ResetEffects() - { - ResetVariables(); - } - - public override void UpdateDead() - { - ResetVariables(); - } - - private void ResetVariables() - { - throwingDamage = 1f; - throwingVelocity = 1f; - throwingCrit = 4; - throwingAmmoCost66 = false; - throwingAmmoCost50 = false; - } - } +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.CalamityCustomThrowingDamage +{ + public class CalamityCustomThrowingDamagePlayer : ModPlayer + { + public static CalamityCustomThrowingDamagePlayer ModPlayer(Player player) + { + return player.GetModPlayer(); + } + + public float throwingDamage = 1f; + public float throwingVelocity = 1f; + public int throwingCrit = 4; + public bool throwingAmmoCost66 = false; + public bool throwingAmmoCost50 = false; + + public override void ResetEffects() + { + ResetVariables(); + } + + public override void UpdateDead() + { + ResetVariables(); + } + + private void ResetVariables() + { + throwingDamage = 1f; + throwingVelocity = 1f; + throwingCrit = 4; + throwingAmmoCost66 = false; + throwingAmmoCost50 = false; + } + } } \ No newline at end of file diff --git a/Items/CalamityCustomThrowingDamage/CalamityDamageItem.cs b/Items/CalamityCustomThrowingDamage/CalamityDamageItem.cs index cfc91c6637..b2ec42eba9 100644 --- a/Items/CalamityCustomThrowingDamage/CalamityDamageItem.cs +++ b/Items/CalamityCustomThrowingDamage/CalamityDamageItem.cs @@ -1,94 +1,80 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ModLoader; -using CalamityMod.Items.CalamityCustomThrowingDamage; - -namespace CalamityMod.Items.CalamityCustomThrowingDamage -{ - public abstract class CalamityDamageItem : ModItem - { - public virtual void SafeSetDefaults() - { - } - - public sealed override void SetDefaults() - { - SafeSetDefaults(); - item.melee = false; - item.ranged = true; - item.magic = false; - item.thrown = false; - item.summon = false; - } - - public override void GetWeaponDamage(Player player, ref int damage) - { - //damage = (int)((float)damage / (player.rangedDamage + 5E-06f)); //change base damage back to normal after all ranged boosts - damage = (int)((double)item.damage * (double)(CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage + 5E-06f)); //plus one otherwise weird shit happens - } - - public override void GetWeaponCrit(Player player, ref int crit) - { - crit = (item.crit + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit); //change crit back to normal - } - - public override void GetWeaponKnockback(Player player, ref float knockback) - { - if (player.shroomiteStealth) - { - knockback /= 1f + (1f - player.stealth) * 0.5f; - } - if (player.setVortex) - { - knockback /= 1f + (1f - player.stealth) * 0.5f; - } - } - - public override void ModifyTooltips(List tooltips) - { - TooltipLine tt = tooltips.FirstOrDefault(x => x.Name == "Damage" && x.mod == "Terraria"); - if (tt != null) - { - string[] splitText = tt.text.Split(' '); - string damageValue = splitText.First(); - string damageWord = splitText.Last(); - tt.text = damageValue + " rogue " + damageWord; - } - TooltipLine tt2 = tooltips.FirstOrDefault(x => x.Name == "ItemName" && x.mod == "Terraria"); - if (tt2 != null) - { - if (CalamityMod.lightGreenThrowingRarityList.Contains(item.type)) - tt2.overrideColor = new Color(0, 255, 200); - else if (CalamityMod.greenThrowingRarityList.Contains(item.type)) - tt2.overrideColor = new Color(0, 255, 0); - else if (CalamityMod.blueThrowingRarityList.Contains(item.type)) - tt2.overrideColor = new Color(43, 96, 222); - else if (item.type == mod.ItemType("Celestus")) - tt2.overrideColor = new Color(108, 45, 199); - else if (CalamityMod.purpleThrowingRarityList.Contains(item.type)) - tt2.overrideColor = new Color(255, 0, 255); - else if (item.type == mod.ItemType("Malachite")) - tt2.overrideColor = new Color(Main.DiscoR, 203, 103); - } - } - - public override bool ConsumeItem(Player player) - { - if (CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingAmmoCost50) - { - if (Main.rand.Next(1, 101) > 50) - return false; - } - if (CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingAmmoCost66) - { - if (Main.rand.Next(1, 101) > 66) - return false; - } - return true; - } - } +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.IO; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ModLoader; +using Terraria.ModLoader.IO; +using CalamityMod.Items.CalamityCustomThrowingDamage; + +namespace CalamityMod.Items.CalamityCustomThrowingDamage +{ + public abstract class CalamityDamageItem : ModItem + { + public virtual void SafeSetDefaults() + { + } + + public sealed override void SetDefaults() + { + SafeSetDefaults(); + item.melee = false; + item.ranged = true; + item.magic = false; + item.thrown = false; + item.summon = false; + } + + public override void GetWeaponDamage(Player player, ref int damage) + { + //damage = (int)((float)damage / (player.rangedDamage + 5E-06f)); //change base damage back to normal after all ranged boosts + damage = (int)((double)item.damage * (double)(CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage + 5E-06f)); //plus one otherwise weird shit happens + } + + public override void GetWeaponCrit(Player player, ref int crit) + { + crit = (item.crit + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit); //change crit back to normal + } + + public override void GetWeaponKnockback(Player player, ref float knockback) + { + if (player.shroomiteStealth) + { + knockback /= 1f + (1f - player.stealth) * 0.5f; + } + if (player.setVortex) + { + knockback /= 1f + (1f - player.stealth) * 0.5f; + } + } + + public override void ModifyTooltips(List tooltips) + { + TooltipLine tt = tooltips.FirstOrDefault(x => x.Name == "Damage" && x.mod == "Terraria"); + if (tt != null) + { + string[] splitText = tt.text.Split(' '); + string damageValue = splitText.First(); + string damageWord = splitText.Last(); + tt.text = damageValue + " rogue " + damageWord; + } + } + + public override bool ConsumeItem(Player player) + { + if (CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingAmmoCost50) + { + if (Main.rand.Next(1, 101) > 50) + return false; + } + if (CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingAmmoCost66) + { + if (Main.rand.Next(1, 101) > 66) + return false; + } + return true; + } + } } \ No newline at end of file diff --git a/Items/CalamityCustomThrowingDamage/Celestus.cs b/Items/CalamityCustomThrowingDamage/Celestus.cs index cbc06ca2ed..b0c74d086e 100644 --- a/Items/CalamityCustomThrowingDamage/Celestus.cs +++ b/Items/CalamityCustomThrowingDamage/Celestus.cs @@ -1,58 +1,60 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items; - -namespace CalamityMod.Items.CalamityCustomThrowingDamage -{ - public class Celestus : CalamityDamageItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Celestus"); - } - - public override void SafeSetDefaults() - { - item.width = 20; - item.damage = 150; - item.noMelee = true; - item.noUseGraphic = true; - item.autoReuse = true; - item.useAnimation = 10; - item.useStyle = 1; - item.useTime = 10; - item.knockBack = 6f; - item.UseSound = SoundID.Item1; - item.height = 20; - item.value = Item.buyPrice(2, 50, 0, 0); - item.rare = 10; - item.shoot = mod.ProjectileType("Celestus"); - item.shootSpeed = 25f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "AccretionDisk"); - recipe.AddIngredient(null, "Crystalline"); - recipe.AddIngredient(null, "ExecutionersBlade"); - recipe.AddIngredient(null, "Pwnagehammer"); - recipe.AddIngredient(null, "SpearofPaleolith"); - recipe.AddIngredient(null, "NightmareFuel", 5); - recipe.AddIngredient(null, "EndothermicEnergy", 5); - recipe.AddIngredient(null, "CosmiliteBar", 5); - recipe.AddIngredient(null, "DarksunFragment", 5); - recipe.AddIngredient(null, "HellcasterFragment", 3); - recipe.AddIngredient(null, "Phantoplasm", 5); - recipe.AddIngredient(null, "AuricOre", 25); - recipe.AddTile(null, "DraedonsForge"); - recipe.SetResult(this); - recipe.AddRecipe(); - } - } -} +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.CalamityCustomThrowingDamage +{ + public class Celestus : CalamityDamageItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Celestus"); + } + + public override void SafeSetDefaults() + { + item.width = 20; + item.damage = 480; + item.noMelee = true; + item.noUseGraphic = true; + item.autoReuse = true; + item.useAnimation = 10; + item.useStyle = 1; + item.useTime = 10; + item.knockBack = 6f; + item.UseSound = SoundID.Item1; + item.height = 20; + item.value = Item.buyPrice(2, 50, 0, 0); + item.rare = 10; + item.shoot = mod.ProjectileType("Celestus"); + item.shootSpeed = 25f; + item.GetGlobalItem(mod).rogue = true; + item.GetGlobalItem(mod).postMoonLordRarity = 15; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "AccretionDisk"); + recipe.AddIngredient(null, "ShatteredSun"); + recipe.AddIngredient(null, "ExecutionersBlade"); + recipe.AddIngredient(null, "Pwnagehammer"); + recipe.AddIngredient(null, "SpearofPaleolith"); + recipe.AddIngredient(null, "NightmareFuel", 5); + recipe.AddIngredient(null, "EndothermicEnergy", 5); + recipe.AddIngredient(null, "CosmiliteBar", 5); + recipe.AddIngredient(null, "DarksunFragment", 5); + recipe.AddIngredient(null, "HellcasterFragment", 3); + recipe.AddIngredient(null, "Phantoplasm", 5); + recipe.AddIngredient(null, "AuricOre", 25); + recipe.AddTile(null, "DraedonsForge"); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/CalamityCustomThrowingDamage/Celestus.png b/Items/CalamityCustomThrowingDamage/Celestus.png index 418c089317..cc5385f89f 100644 Binary files a/Items/CalamityCustomThrowingDamage/Celestus.png and b/Items/CalamityCustomThrowingDamage/Celestus.png differ diff --git a/Items/CalamityCustomThrowingDamage/CobaltKunai.cs b/Items/CalamityCustomThrowingDamage/CobaltKunai.cs index 5c25095e4f..bd0f6da7b0 100644 --- a/Items/CalamityCustomThrowingDamage/CobaltKunai.cs +++ b/Items/CalamityCustomThrowingDamage/CobaltKunai.cs @@ -1,50 +1,50 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items; - -namespace CalamityMod.Items.CalamityCustomThrowingDamage -{ - public class CobaltKunai : CalamityDamageItem - { +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.CalamityCustomThrowingDamage +{ + public class CobaltKunai : CalamityDamageItem + { public override void SetStaticDefaults() { DisplayName.SetDefault("Cobalt Kunai"); } - public override void SafeSetDefaults() - { - item.width = 18; - item.damage = 28; - item.noMelee = true; - item.consumable = true; - item.noUseGraphic = true; - item.useAnimation = 12; - item.scale = 0.75f; - item.useStyle = 1; - item.useTime = 12; - item.knockBack = 2.5f; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - item.height = 40; - item.maxStack = 999; - item.value = 900; - item.rare = 4; - item.shoot = mod.ProjectileType("CobaltKunaiProjectile"); - item.shootSpeed = 12f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.CobaltBar); - recipe.AddTile(TileID.Anvils); - recipe.SetResult(this, 30); - recipe.AddRecipe(); - } - } -} + public override void SafeSetDefaults() + { + item.width = 18; + item.damage = 28; + item.noMelee = true; + item.consumable = true; + item.noUseGraphic = true; + item.useAnimation = 12; + item.scale = 0.75f; + item.useStyle = 1; + item.useTime = 12; + item.knockBack = 2.5f; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.height = 40; + item.maxStack = 999; + item.value = 900; + item.rare = 4; + item.shoot = mod.ProjectileType("CobaltKunaiProjectile"); + item.shootSpeed = 12f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.CobaltBar); + recipe.AddTile(TileID.Anvils); + recipe.SetResult(this, 30); + recipe.AddRecipe(); + } + } +} diff --git a/Items/CalamityCustomThrowingDamage/CosmicKunai.cs b/Items/CalamityCustomThrowingDamage/CosmicKunai.cs index 3071da95ef..f90ef7f377 100644 --- a/Items/CalamityCustomThrowingDamage/CosmicKunai.cs +++ b/Items/CalamityCustomThrowingDamage/CosmicKunai.cs @@ -1,40 +1,42 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items; - -namespace CalamityMod.Items.CalamityCustomThrowingDamage -{ - public class CosmicKunai : CalamityDamageItem - { +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.CalamityCustomThrowingDamage +{ + public class CosmicKunai : CalamityDamageItem + { public override void SetStaticDefaults() { DisplayName.SetDefault("Cosmic Kunai"); Tooltip.SetDefault("Fires a stream of short-range kunai"); } - public override void SafeSetDefaults() - { - item.width = 26; - item.damage = 200; - item.noMelee = true; - item.noUseGraphic = true; - item.useTime = 1; - item.useAnimation = 5; - item.useStyle = 1; - item.knockBack = 5f; - item.UseSound = SoundID.Item109; - item.autoReuse = true; - item.height = 48; - item.value = Item.buyPrice(1, 40, 0, 0); - item.rare = 10; - item.shoot = mod.ProjectileType("CosmicKunai"); - item.shootSpeed = 28f; - item.rare = 9; - } - } -} + public override void SafeSetDefaults() + { + item.width = 26; + item.damage = 75; + item.noMelee = true; + item.noUseGraphic = true; + item.useTime = 1; + item.useAnimation = 5; + item.useStyle = 1; + item.knockBack = 5f; + item.UseSound = SoundID.Item109; + item.autoReuse = true; + item.height = 48; + item.value = Item.buyPrice(1, 40, 0, 0); + item.rare = 10; + item.shoot = mod.ProjectileType("CosmicKunai"); + item.shootSpeed = 28f; + item.rare = 9; + item.GetGlobalItem(mod).rogue = true; + item.GetGlobalItem(mod).postMoonLordRarity = 13; + } + } +} diff --git a/Items/CalamityCustomThrowingDamage/CrushsawCrasher.cs b/Items/CalamityCustomThrowingDamage/CrushsawCrasher.cs index d33cde04b5..9c6f5af94c 100644 --- a/Items/CalamityCustomThrowingDamage/CrushsawCrasher.cs +++ b/Items/CalamityCustomThrowingDamage/CrushsawCrasher.cs @@ -1,41 +1,41 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items; - -namespace CalamityMod.Items.CalamityCustomThrowingDamage -{ - public class CrushsawCrasher : CalamityDamageItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Crushsaw Crasher"); - } - - public override void SafeSetDefaults() - { - item.width = 38; - item.damage = 65; - item.useAnimation = 18; - item.useStyle = 1; - item.useTime = 18; - item.knockBack = 7f; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - item.height = 22; - item.value = Item.buyPrice(0, 60, 0, 0); - item.rare = 7; - item.shoot = mod.ProjectileType("Crushax"); - item.shootSpeed = 11f; - } - - public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(mod.BuffType("BrimstoneFlames"), 300); - } - } -} +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.CalamityCustomThrowingDamage +{ + public class CrushsawCrasher : CalamityDamageItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Crushsaw Crasher"); + } + + public override void SafeSetDefaults() + { + item.width = 38; + item.damage = 65; + item.useAnimation = 18; + item.useStyle = 1; + item.useTime = 18; + item.knockBack = 7f; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.height = 22; + item.value = Item.buyPrice(0, 60, 0, 0); + item.rare = 7; + item.shoot = mod.ProjectileType("Crushax"); + item.shootSpeed = 11f; + } + + public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(mod.BuffType("BrimstoneFlames"), 300); + } + } +} diff --git a/Items/CalamityCustomThrowingDamage/CrystalPiercer.cs b/Items/CalamityCustomThrowingDamage/CrystalPiercer.cs index 2a7799f1e1..234475bbeb 100644 --- a/Items/CalamityCustomThrowingDamage/CrystalPiercer.cs +++ b/Items/CalamityCustomThrowingDamage/CrystalPiercer.cs @@ -1,49 +1,49 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items; - -namespace CalamityMod.Items.CalamityCustomThrowingDamage -{ - public class CrystalPiercer : CalamityDamageItem - { +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.CalamityCustomThrowingDamage +{ + public class CrystalPiercer : CalamityDamageItem + { public override void SetStaticDefaults() { DisplayName.SetDefault("Crystal Piercer"); } - public override void SafeSetDefaults() - { - item.width = 62; - item.damage = 43; - item.noMelee = true; - item.consumable = true; - item.noUseGraphic = true; - item.useAnimation = 20; - item.useStyle = 1; - item.useTime = 20; - item.knockBack = 6f; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - item.height = 62; - item.maxStack = 999; - item.value = 2500; - item.rare = 5; - item.shoot = mod.ProjectileType("CrystalPiercerProjectile"); - item.shootSpeed = 20f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "VerstaltiteBar"); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(this, 20); - recipe.AddRecipe(); - } - } -} + public override void SafeSetDefaults() + { + item.width = 62; + item.damage = 43; + item.noMelee = true; + item.consumable = true; + item.noUseGraphic = true; + item.useAnimation = 20; + item.useStyle = 1; + item.useTime = 20; + item.knockBack = 6f; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.height = 62; + item.maxStack = 999; + item.value = 2500; + item.rare = 5; + item.shoot = mod.ProjectileType("CrystalPiercerProjectile"); + item.shootSpeed = 20f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "VerstaltiteBar"); + recipe.AddTile(TileID.MythrilAnvil); + recipe.SetResult(this, 20); + recipe.AddRecipe(); + } + } +} diff --git a/Items/CalamityCustomThrowingDamage/Crystalline.cs b/Items/CalamityCustomThrowingDamage/Crystalline.cs index 9558f797f8..5c9aaea81f 100644 --- a/Items/CalamityCustomThrowingDamage/Crystalline.cs +++ b/Items/CalamityCustomThrowingDamage/Crystalline.cs @@ -1,50 +1,50 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items; - -namespace CalamityMod.Items.CalamityCustomThrowingDamage -{ - public class Crystalline : CalamityDamageItem - { +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.CalamityCustomThrowingDamage +{ + public class Crystalline : CalamityDamageItem + { public override void SetStaticDefaults() { DisplayName.SetDefault("Crystalline"); } - public override void SafeSetDefaults() - { - item.width = 44; - item.damage = 18; - item.crit += 4; - item.noMelee = true; - item.noUseGraphic = true; - item.useAnimation = 18; - item.useStyle = 1; - item.useTime = 18; - item.knockBack = 3f; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - item.height = 44; - item.value = Item.buyPrice(0, 2, 0, 0); - item.rare = 2; - item.shoot = mod.ProjectileType("Crystalline"); - item.shootSpeed = 10f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.ThrowingKnife, 50); - recipe.AddIngredient(ItemID.Diamond, 3); - recipe.AddIngredient(ItemID.FallenStar, 3); - recipe.AddTile(TileID.Anvils); - recipe.SetResult(this); - recipe.AddRecipe(); - } - } -} + public override void SafeSetDefaults() + { + item.width = 44; + item.damage = 18; + item.crit += 4; + item.noMelee = true; + item.noUseGraphic = true; + item.useAnimation = 18; + item.useStyle = 1; + item.useTime = 18; + item.knockBack = 3f; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.height = 44; + item.value = Item.buyPrice(0, 2, 0, 0); + item.rare = 2; + item.shoot = mod.ProjectileType("Crystalline"); + item.shootSpeed = 10f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.ThrowingKnife, 50); + recipe.AddIngredient(ItemID.Diamond, 3); + recipe.AddIngredient(ItemID.FallenStar, 3); + recipe.AddTile(TileID.Anvils); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/CalamityCustomThrowingDamage/Crystalline.png b/Items/CalamityCustomThrowingDamage/Crystalline.png index f96d923ad7..36c2b34b8f 100644 Binary files a/Items/CalamityCustomThrowingDamage/Crystalline.png and b/Items/CalamityCustomThrowingDamage/Crystalline.png differ diff --git a/Items/CalamityCustomThrowingDamage/CursedDagger.cs b/Items/CalamityCustomThrowingDamage/CursedDagger.cs index 04418a9b0d..e1c65afdc7 100644 --- a/Items/CalamityCustomThrowingDamage/CursedDagger.cs +++ b/Items/CalamityCustomThrowingDamage/CursedDagger.cs @@ -1,38 +1,38 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items; - -namespace CalamityMod.Items.CalamityCustomThrowingDamage -{ - public class CursedDagger : CalamityDamageItem - { +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.CalamityCustomThrowingDamage +{ + public class CursedDagger : CalamityDamageItem + { public override void SetStaticDefaults() { DisplayName.SetDefault("Cursed Dagger"); } - public override void SafeSetDefaults() - { - item.width = 34; - item.damage = 34; - item.noMelee = true; - item.noUseGraphic = true; - item.useAnimation = 16; - item.useStyle = 1; - item.useTime = 16; - item.knockBack = 4.5f; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - item.height = 34; - item.value = Item.buyPrice(0, 36, 0, 0); - item.rare = 5; - item.shoot = mod.ProjectileType("CursedDagger"); - item.shootSpeed = 12f; - } - } -} + public override void SafeSetDefaults() + { + item.width = 34; + item.damage = 34; + item.noMelee = true; + item.noUseGraphic = true; + item.useAnimation = 16; + item.useStyle = 1; + item.useTime = 16; + item.knockBack = 4.5f; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.height = 34; + item.value = Item.buyPrice(0, 36, 0, 0); + item.rare = 5; + item.shoot = mod.ProjectileType("CursedDagger"); + item.shootSpeed = 12f; + } + } +} diff --git a/Items/CalamityCustomThrowingDamage/DuststormInABottle.cs b/Items/CalamityCustomThrowingDamage/DuststormInABottle.cs index c708f32bc6..374beb7c53 100644 --- a/Items/CalamityCustomThrowingDamage/DuststormInABottle.cs +++ b/Items/CalamityCustomThrowingDamage/DuststormInABottle.cs @@ -1,50 +1,50 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items; - -namespace CalamityMod.Items.CalamityCustomThrowingDamage -{ - public class DuststormInABottle : CalamityDamageItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Duststorm in a Bottle"); - Tooltip.SetDefault("Explodes into a dust cloud"); - } - - public override void SafeSetDefaults() - { - item.width = 20; - item.damage = 47; - item.noMelee = true; - item.noUseGraphic = true; - item.useAnimation = 25; - item.useStyle = 1; - item.useTime = 25; - item.knockBack = 5f; - item.UseSound = SoundID.Item106; - item.autoReuse = true; - item.height = 24; - item.value = Item.buyPrice(0, 60, 0, 0); - item.rare = 7; - item.shoot = mod.ProjectileType("DuststormInABottle"); - item.shootSpeed = 12f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.HolyWater, 20); - recipe.AddIngredient(null, "GrandScale"); - recipe.AddIngredient(ItemID.SandstorminaBottle); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(this); - recipe.AddRecipe(); - } - } -} +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.CalamityCustomThrowingDamage +{ + public class DuststormInABottle : CalamityDamageItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Duststorm in a Bottle"); + Tooltip.SetDefault("Explodes into a dust cloud"); + } + + public override void SafeSetDefaults() + { + item.width = 20; + item.damage = 47; + item.noMelee = true; + item.noUseGraphic = true; + item.useAnimation = 25; + item.useStyle = 1; + item.useTime = 25; + item.knockBack = 5f; + item.UseSound = SoundID.Item106; + item.autoReuse = true; + item.height = 24; + item.value = Item.buyPrice(0, 60, 0, 0); + item.rare = 7; + item.shoot = mod.ProjectileType("DuststormInABottle"); + item.shootSpeed = 12f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.HolyWater, 20); + recipe.AddIngredient(null, "GrandScale"); + recipe.AddIngredient(ItemID.SandstorminaBottle); + recipe.AddTile(TileID.MythrilAnvil); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/CalamityCustomThrowingDamage/EmpyreanKnivesThrown.cs b/Items/CalamityCustomThrowingDamage/EmpyreanKnivesThrown.cs index 1ee31ede32..c3966d17ba 100644 --- a/Items/CalamityCustomThrowingDamage/EmpyreanKnivesThrown.cs +++ b/Items/CalamityCustomThrowingDamage/EmpyreanKnivesThrown.cs @@ -1,111 +1,113 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items; - -namespace CalamityMod.Items.CalamityCustomThrowingDamage -{ - public class EmpyreanKnivesThrown : CalamityDamageItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Empyrean Knives"); - } - - public override void SafeSetDefaults() - { - item.width = 18; - item.damage = 650; - item.noMelee = true; - item.noUseGraphic = true; - item.useAnimation = 15; - item.useStyle = 1; - item.useTime = 15; - item.knockBack = 3f; - item.UseSound = SoundID.Item39; - item.autoReuse = true; - item.height = 20; - item.value = Item.buyPrice(1, 80, 0, 0); - item.rare = 10; - item.shoot = mod.ProjectileType("EmpyreanKnives"); - item.shootSpeed = 15f; - } - - public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - float num72 = item.shootSpeed; - Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); - Vector2 value = Vector2.UnitX.RotatedBy((double)player.fullRotation, default(Vector2)); - Vector2 vector3 = Main.MouseWorld - vector2; - float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; - float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; - if (player.gravDir == -1f) - { - num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; - } - float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); - float num81 = num80; - if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) - { - num78 = (float)player.direction; - num79 = 0f; - num80 = num72; - } - else - { - num80 = num72 / num80; - } - num78 *= num80; - num79 *= num80; - int num146 = 4; - if (Main.rand.Next(2) == 0) - { - num146++; - } - if (Main.rand.Next(4) == 0) - { - num146++; - } - if (Main.rand.Next(8) == 0) - { - num146++; - } - if (Main.rand.Next(16) == 0) - { - num146++; - } - for (int num147 = 0; num147 < num146; num147++) - { - float num148 = num78; - float num149 = num79; - float num150 = 0.05f * (float)num147; - num148 += (float)Main.rand.Next(-25, 26) * num150; - num149 += (float)Main.rand.Next(-25, 26) * num150; - num80 = (float)Math.Sqrt((double)(num148 * num148 + num149 * num149)); - num80 = num72 / num80; - num148 *= num80; - num149 *= num80; - float x4 = vector2.X; - float y4 = vector2.Y; - Projectile.NewProjectile(x4, y4, num148, num149, type, damage, knockBack, player.whoAmI, 0f, 1f); - } - return false; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.VampireKnives); - recipe.AddIngredient(null, "CosmiliteBar", 10); - recipe.AddIngredient(null, "DarksunFragment", 10); - recipe.AddIngredient(null, "TheEmpyrean"); - recipe.AddTile(null, "DraedonsForge"); - recipe.SetResult(this); - recipe.AddRecipe(); - } - } -} +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.CalamityCustomThrowingDamage +{ + public class EmpyreanKnivesThrown : CalamityDamageItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Empyrean Knives"); + } + + public override void SafeSetDefaults() + { + item.width = 18; + item.damage = 650; + item.noMelee = true; + item.noUseGraphic = true; + item.useAnimation = 15; + item.useStyle = 1; + item.useTime = 15; + item.knockBack = 3f; + item.UseSound = SoundID.Item39; + item.autoReuse = true; + item.height = 20; + item.value = Item.buyPrice(1, 80, 0, 0); + item.rare = 10; + item.shoot = mod.ProjectileType("EmpyreanKnives"); + item.shootSpeed = 15f; + item.GetGlobalItem(mod).rogue = true; + item.GetGlobalItem(mod).postMoonLordRarity = 14; + } + + public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + float num72 = item.shootSpeed; + Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); + Vector2 value = Vector2.UnitX.RotatedBy((double)player.fullRotation, default(Vector2)); + Vector2 vector3 = Main.MouseWorld - vector2; + float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; + float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; + if (player.gravDir == -1f) + { + num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; + } + float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); + float num81 = num80; + if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) + { + num78 = (float)player.direction; + num79 = 0f; + num80 = num72; + } + else + { + num80 = num72 / num80; + } + num78 *= num80; + num79 *= num80; + int num146 = 4; + if (Main.rand.Next(2) == 0) + { + num146++; + } + if (Main.rand.Next(4) == 0) + { + num146++; + } + if (Main.rand.Next(8) == 0) + { + num146++; + } + if (Main.rand.Next(16) == 0) + { + num146++; + } + for (int num147 = 0; num147 < num146; num147++) + { + float num148 = num78; + float num149 = num79; + float num150 = 0.05f * (float)num147; + num148 += (float)Main.rand.Next(-25, 26) * num150; + num149 += (float)Main.rand.Next(-25, 26) * num150; + num80 = (float)Math.Sqrt((double)(num148 * num148 + num149 * num149)); + num80 = num72 / num80; + num148 *= num80; + num149 *= num80; + float x4 = vector2.X; + float y4 = vector2.Y; + Projectile.NewProjectile(x4, y4, num148, num149, type, damage, knockBack, player.whoAmI, 0f, 1f); + } + return false; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.VampireKnives); + recipe.AddIngredient(null, "CosmiliteBar", 10); + recipe.AddIngredient(null, "DarksunFragment", 10); + recipe.AddIngredient(null, "TheEmpyrean"); + recipe.AddTile(null, "DraedonsForge"); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/CalamityCustomThrowingDamage/Eradicator.cs b/Items/CalamityCustomThrowingDamage/Eradicator.cs index 7e3d384195..7976934519 100644 --- a/Items/CalamityCustomThrowingDamage/Eradicator.cs +++ b/Items/CalamityCustomThrowingDamage/Eradicator.cs @@ -1,38 +1,47 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items; - -namespace CalamityMod.Items.CalamityCustomThrowingDamage -{ - public class Eradicator : CalamityDamageItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Eradicator"); - } - - public override void SafeSetDefaults() - { - item.width = 38; - item.damage = 300; - item.noMelee = true; - item.noUseGraphic = true; - item.autoReuse = true; - item.useAnimation = 19; - item.useStyle = 1; - item.useTime = 19; - item.knockBack = 7f; - item.UseSound = SoundID.Item1; - item.height = 54; - item.value = Item.buyPrice(1, 40, 0, 0); - item.rare = 10; - item.shoot = mod.ProjectileType("EradicatorProjectile"); - item.shootSpeed = 12f; - } - } -} +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.CalamityCustomThrowingDamage +{ + public class Eradicator : CalamityDamageItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Eradicator"); + } + + public override void SafeSetDefaults() + { + item.width = 38; + item.damage = 300; + item.noMelee = true; + item.noUseGraphic = true; + item.autoReuse = true; + item.useAnimation = 19; + item.useStyle = 1; + item.useTime = 19; + item.knockBack = 7f; + item.UseSound = SoundID.Item1; + item.height = 54; + item.value = Item.buyPrice(1, 40, 0, 0); + item.rare = 10; + item.shoot = mod.ProjectileType("EradicatorProjectile"); + item.shootSpeed = 12f; + item.GetGlobalItem(mod).rogue = true; + item.GetGlobalItem(mod).postMoonLordRarity = 13; + } + + public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) + { + Vector2 origin = new Vector2(31f, 29f); + spriteBatch.Draw(mod.GetTexture("Items/CalamityCustomThrowingDamage/EradicatorGlow"), item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f); + } + } +} diff --git a/Items/CalamityCustomThrowingDamage/Eradicator.png b/Items/CalamityCustomThrowingDamage/Eradicator.png index e12958fc93..e028ca0e83 100644 Binary files a/Items/CalamityCustomThrowingDamage/Eradicator.png and b/Items/CalamityCustomThrowingDamage/Eradicator.png differ diff --git a/Items/CalamityCustomThrowingDamage/EradicatorGlow.png b/Items/CalamityCustomThrowingDamage/EradicatorGlow.png new file mode 100644 index 0000000000..152b9ce5ae Binary files /dev/null and b/Items/CalamityCustomThrowingDamage/EradicatorGlow.png differ diff --git a/Items/CalamityCustomThrowingDamage/ExecutionersBlade.cs b/Items/CalamityCustomThrowingDamage/ExecutionersBlade.cs index af91be531d..5f6ba11863 100644 --- a/Items/CalamityCustomThrowingDamage/ExecutionersBlade.cs +++ b/Items/CalamityCustomThrowingDamage/ExecutionersBlade.cs @@ -1,47 +1,49 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items; - -namespace CalamityMod.Items.CalamityCustomThrowingDamage -{ - public class ExecutionersBlade : CalamityDamageItem - { +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.CalamityCustomThrowingDamage +{ + public class ExecutionersBlade : CalamityDamageItem + { public override void SetStaticDefaults() { DisplayName.SetDefault("Executioner's Blade"); } - public override void SafeSetDefaults() - { - item.width = 50; - item.damage = 615; - item.noMelee = true; - item.noUseGraphic = true; - item.useTime = 3; - item.useAnimation = 9; - item.useStyle = 1; - item.knockBack = 6.75f; - item.UseSound = SoundID.Item73; - item.autoReuse = true; - item.height = 50; - item.value = Item.buyPrice(1, 80, 0, 0); - item.rare = 10; - item.shoot = mod.ProjectileType("ExecutionersBlade"); - item.shootSpeed = 26f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "CosmiliteBar", 11); - recipe.AddTile(null, "DraedonsForge"); - recipe.SetResult(this); - recipe.AddRecipe(); - } - } -} + public override void SafeSetDefaults() + { + item.width = 50; + item.damage = 615; + item.noMelee = true; + item.noUseGraphic = true; + item.useTime = 3; + item.useAnimation = 9; + item.useStyle = 1; + item.knockBack = 6.75f; + item.UseSound = SoundID.Item73; + item.autoReuse = true; + item.height = 50; + item.value = Item.buyPrice(1, 80, 0, 0); + item.rare = 10; + item.shoot = mod.ProjectileType("ExecutionersBlade"); + item.shootSpeed = 26f; + item.GetGlobalItem(mod).rogue = true; + item.GetGlobalItem(mod).postMoonLordRarity = 14; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "CosmiliteBar", 11); + recipe.AddTile(null, "DraedonsForge"); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/CalamityCustomThrowingDamage/FeatherKnife.cs b/Items/CalamityCustomThrowingDamage/FeatherKnife.cs index c39aee5b80..1320185c68 100644 --- a/Items/CalamityCustomThrowingDamage/FeatherKnife.cs +++ b/Items/CalamityCustomThrowingDamage/FeatherKnife.cs @@ -1,49 +1,49 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items; - -namespace CalamityMod.Items.CalamityCustomThrowingDamage -{ - public class FeatherKnife : CalamityDamageItem - { +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.CalamityCustomThrowingDamage +{ + public class FeatherKnife : CalamityDamageItem + { public override void SetStaticDefaults() { DisplayName.SetDefault("Feather Knife"); } - public override void SafeSetDefaults() - { - item.width = 18; - item.damage = 20; - item.noMelee = true; - item.consumable = true; - item.noUseGraphic = true; - item.useAnimation = 13; - item.useStyle = 1; - item.useTime = 13; - item.knockBack = 2f; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - item.height = 32; - item.maxStack = 999; - item.value = 300; - item.rare = 3; - item.shoot = mod.ProjectileType("FeatherKnifeProjectile"); - item.shootSpeed = 12f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "AerialiteBar"); - recipe.AddTile(TileID.SkyMill); - recipe.SetResult(this, 30); - recipe.AddRecipe(); - } - } -} + public override void SafeSetDefaults() + { + item.width = 18; + item.damage = 20; + item.noMelee = true; + item.consumable = true; + item.noUseGraphic = true; + item.useAnimation = 13; + item.useStyle = 1; + item.useTime = 13; + item.knockBack = 2f; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.height = 32; + item.maxStack = 999; + item.value = 300; + item.rare = 3; + item.shoot = mod.ProjectileType("FeatherKnifeProjectile"); + item.shootSpeed = 12f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "AerialiteBar"); + recipe.AddTile(TileID.SkyMill); + recipe.SetResult(this, 30); + recipe.AddRecipe(); + } + } +} diff --git a/Items/CalamityCustomThrowingDamage/FlameScythe.cs b/Items/CalamityCustomThrowingDamage/FlameScythe.cs index 1f37ee8552..c9aa3be5e5 100644 --- a/Items/CalamityCustomThrowingDamage/FlameScythe.cs +++ b/Items/CalamityCustomThrowingDamage/FlameScythe.cs @@ -1,47 +1,47 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items; - -namespace CalamityMod.Items.CalamityCustomThrowingDamage -{ - public class FlameScythe : CalamityDamageItem - { +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.CalamityCustomThrowingDamage +{ + public class FlameScythe : CalamityDamageItem + { public override void SetStaticDefaults() { DisplayName.SetDefault("Flame Scythe"); } - public override void SafeSetDefaults() - { - item.width = 50; - item.damage = 145; - item.noMelee = true; - item.noUseGraphic = true; - item.autoReuse = true; - item.useAnimation = 19; - item.useStyle = 1; - item.useTime = 19; - item.knockBack = 8.5f; - item.UseSound = SoundID.Item1; - item.height = 48; - item.value = Item.buyPrice(0, 80, 0, 0); - item.rare = 8; - item.shoot = mod.ProjectileType("FlameScytheProjectile"); - item.shootSpeed = 16f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "CruptixBar", 9); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(this); - recipe.AddRecipe(); - } - } -} + public override void SafeSetDefaults() + { + item.width = 50; + item.damage = 145; + item.noMelee = true; + item.noUseGraphic = true; + item.autoReuse = true; + item.useAnimation = 19; + item.useStyle = 1; + item.useTime = 19; + item.knockBack = 8.5f; + item.UseSound = SoundID.Item1; + item.height = 48; + item.value = Item.buyPrice(0, 80, 0, 0); + item.rare = 8; + item.shoot = mod.ProjectileType("FlameScytheProjectile"); + item.shootSpeed = 16f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "CruptixBar", 9); + recipe.AddTile(TileID.MythrilAnvil); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/CalamityCustomThrowingDamage/FlameScythe.png b/Items/CalamityCustomThrowingDamage/FlameScythe.png index 6df15cd567..d6577c12b4 100644 Binary files a/Items/CalamityCustomThrowingDamage/FlameScythe.png and b/Items/CalamityCustomThrowingDamage/FlameScythe.png differ diff --git a/Items/CalamityCustomThrowingDamage/FrostyFlare.cs b/Items/CalamityCustomThrowingDamage/FrostyFlare.cs index d6e6ea30ac..4ea1db00ad 100644 --- a/Items/CalamityCustomThrowingDamage/FrostyFlare.cs +++ b/Items/CalamityCustomThrowingDamage/FrostyFlare.cs @@ -1,39 +1,39 @@ -using System; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items.CalamityCustomThrowingDamage; - -namespace CalamityMod.Items.CalamityCustomThrowingDamage -{ - public class FrostyFlare : CalamityDamageItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Frosty Flare"); - Tooltip.SetDefault("Sticks to enemies\nGenerates a localized hailstorm\n'Do not insert in flare gun'"); - } - public override void SafeSetDefaults() - { - item.damage = 32; - item.noUseGraphic = true; - item.noMelee = true; - item.width = 10; - item.height = 22; - item.useTime = 16; - item.useAnimation = 16; - item.useStyle = 1; - item.useTurn = false; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - item.knockBack = 2f; - item.value = Item.buyPrice(0, 0, 5, 0); - item.rare = 5; - item.shoot = mod.ProjectileType("FrostyFlare"); - item.shootSpeed = 22f; - item.maxStack = 999; - item.consumable = true; - } - } -} +using System; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items.CalamityCustomThrowingDamage; + +namespace CalamityMod.Items.CalamityCustomThrowingDamage +{ + public class FrostyFlare : CalamityDamageItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Frosty Flare"); + Tooltip.SetDefault("Sticks to enemies\nGenerates a localized hailstorm\n'Do not insert in flare gun'"); + } + public override void SafeSetDefaults() + { + item.damage = 32; + item.noUseGraphic = true; + item.noMelee = true; + item.width = 10; + item.height = 22; + item.useTime = 16; + item.useAnimation = 16; + item.useStyle = 1; + item.useTurn = false; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.knockBack = 2f; + item.value = Item.buyPrice(0, 0, 5, 0); + item.rare = 5; + item.shoot = mod.ProjectileType("FrostyFlare"); + item.shootSpeed = 22f; + item.maxStack = 999; + item.consumable = true; + } + } +} diff --git a/Items/CalamityCustomThrowingDamage/GelDart.cs b/Items/CalamityCustomThrowingDamage/GelDart.cs index 733cebdf93..97e5b15c2b 100644 --- a/Items/CalamityCustomThrowingDamage/GelDart.cs +++ b/Items/CalamityCustomThrowingDamage/GelDart.cs @@ -1,49 +1,49 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items; - -namespace CalamityMod.Items.CalamityCustomThrowingDamage -{ - public class GelDart : CalamityDamageItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Gel Dart"); - } - - public override void SafeSetDefaults() - { - item.width = 14; - item.damage = 25; - item.noMelee = true; - item.consumable = true; - item.noUseGraphic = true; - item.useAnimation = 11; - item.useStyle = 1; - item.useTime = 11; - item.knockBack = 2.5f; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - item.height = 28; - item.maxStack = 999; - item.value = 1000; - item.rare = 4; - item.shoot = mod.ProjectileType("GelDartProjectile"); - item.shootSpeed = 12f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "PurifiedGel", 5); - recipe.AddTile(TileID.Anvils); - recipe.SetResult(this, 150); - recipe.AddRecipe(); - } - } -} +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.CalamityCustomThrowingDamage +{ + public class GelDart : CalamityDamageItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Gel Dart"); + } + + public override void SafeSetDefaults() + { + item.width = 14; + item.damage = 25; + item.noMelee = true; + item.consumable = true; + item.noUseGraphic = true; + item.useAnimation = 11; + item.useStyle = 1; + item.useTime = 11; + item.knockBack = 2.5f; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.height = 28; + item.maxStack = 999; + item.value = 1000; + item.rare = 4; + item.shoot = mod.ProjectileType("GelDartProjectile"); + item.shootSpeed = 12f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "PurifiedGel", 5); + recipe.AddTile(TileID.Anvils); + recipe.SetResult(this, 150); + recipe.AddRecipe(); + } + } +} diff --git a/Items/CalamityCustomThrowingDamage/GhoulishGouger.cs b/Items/CalamityCustomThrowingDamage/GhoulishGouger.cs index 9ea2c2c7a3..4b766eb1fc 100644 --- a/Items/CalamityCustomThrowingDamage/GhoulishGouger.cs +++ b/Items/CalamityCustomThrowingDamage/GhoulishGouger.cs @@ -1,38 +1,40 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.CalamityCustomThrowingDamage -{ - public class GhoulishGouger : CalamityDamageItem - { +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.CalamityCustomThrowingDamage +{ + public class GhoulishGouger : CalamityDamageItem + { public override void SetStaticDefaults() { DisplayName.SetDefault("Ghoulish Gouger"); Tooltip.SetDefault("Throws a ghoulish scythe"); } - public override void SafeSetDefaults() - { - item.width = 68; - item.damage = 160; - item.noMelee = true; - item.noUseGraphic = true; - item.useAnimation = 12; - item.useTime = 12; - item.useStyle = 1; - item.knockBack = 7.5f; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - item.height = 60; - item.value = Item.buyPrice(1, 40, 0, 0); - item.rare = 10; - item.shoot = mod.ProjectileType("GhoulishGouger"); - item.shootSpeed = 20f; - } - } -} + public override void SafeSetDefaults() + { + item.width = 68; + item.damage = 160; + item.noMelee = true; + item.noUseGraphic = true; + item.useAnimation = 12; + item.useTime = 12; + item.useStyle = 1; + item.knockBack = 7.5f; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.height = 60; + item.value = Item.buyPrice(1, 40, 0, 0); + item.rare = 10; + item.shoot = mod.ProjectileType("GhoulishGouger"); + item.shootSpeed = 20f; + item.GetGlobalItem(mod).rogue = true; + item.GetGlobalItem(mod).postMoonLordRarity = 13; + } + } +} diff --git a/Items/CalamityCustomThrowingDamage/HeavenfallenStardisk.cs b/Items/CalamityCustomThrowingDamage/HeavenfallenStardisk.cs new file mode 100644 index 0000000000..ceba1b6522 --- /dev/null +++ b/Items/CalamityCustomThrowingDamage/HeavenfallenStardisk.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.CalamityCustomThrowingDamage +{ + public class HeavenfallenStardisk : CalamityDamageItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Heavenfallen Stardisk"); + Tooltip.SetDefault("Throws a stardisk upwards which then launches itself towards your mouse cursor,\n" + + "explodes into several astral energy bolts if the thrower is moving vertically when throwing it and during its impact"); + } + + public override void SafeSetDefaults() + { + item.width = 38; + item.height = 34; + item.damage = 150; + item.crit += 20; + item.noMelee = true; + item.noUseGraphic = true; + item.useAnimation = 23; + item.useStyle = 1; + item.useTime = 23; + item.knockBack = 8f; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.value = Item.buyPrice(0, 60, 0, 0); + item.rare = 7; + item.shoot = mod.ProjectileType("HeavenfallenStardisk"); + item.shootSpeed = 10f; + item.GetGlobalItem(mod).rogue = true; + } + + public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + Projectile.NewProjectile(position.X, position.Y, 0f, -10f, type, damage, knockBack, player.whoAmI, 0.0f, 0.0f); + return false; + } + } +} diff --git a/Items/CalamityCustomThrowingDamage/HeavenfallenStardisk.png b/Items/CalamityCustomThrowingDamage/HeavenfallenStardisk.png new file mode 100644 index 0000000000..beedd16af7 Binary files /dev/null and b/Items/CalamityCustomThrowingDamage/HeavenfallenStardisk.png differ diff --git a/Items/CalamityCustomThrowingDamage/IceStar.cs b/Items/CalamityCustomThrowingDamage/IceStar.cs index 813e95264b..653852fe09 100644 --- a/Items/CalamityCustomThrowingDamage/IceStar.cs +++ b/Items/CalamityCustomThrowingDamage/IceStar.cs @@ -1,51 +1,51 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items; - -namespace CalamityMod.Items.CalamityCustomThrowingDamage -{ - public class IceStar : CalamityDamageItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ice Star"); - Tooltip.SetDefault("Ice Stars are too brittle to be recovered after being thrown"); - } - - public override void SafeSetDefaults() - { - item.width = 62; - item.damage = 35; - item.noMelee = true; - item.consumable = true; - item.noUseGraphic = true; - item.useAnimation = 12; - item.crit = 7; - item.useStyle = 1; - item.useTime = 12; - item.knockBack = 2.5f; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - item.height = 62; - item.maxStack = 999; - item.value = 3000; - item.rare = 5; - item.shoot = mod.ProjectileType("IceStarProjectile"); - item.shootSpeed = 14f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "CryoBar"); - recipe.AddTile(TileID.IceMachine); - recipe.SetResult(this, 50); - recipe.AddRecipe(); - } - } -} +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.CalamityCustomThrowingDamage +{ + public class IceStar : CalamityDamageItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ice Star"); + Tooltip.SetDefault("Ice Stars are too brittle to be recovered after being thrown"); + } + + public override void SafeSetDefaults() + { + item.width = 62; + item.damage = 35; + item.noMelee = true; + item.consumable = true; + item.noUseGraphic = true; + item.useAnimation = 12; + item.crit = 7; + item.useStyle = 1; + item.useTime = 12; + item.knockBack = 2.5f; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.height = 62; + item.maxStack = 999; + item.value = 3000; + item.rare = 5; + item.shoot = mod.ProjectileType("IceStarProjectile"); + item.shootSpeed = 14f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "CryoBar"); + recipe.AddTile(TileID.IceMachine); + recipe.SetResult(this, 50); + recipe.AddRecipe(); + } + } +} diff --git a/Items/CalamityCustomThrowingDamage/IchorSpear.cs b/Items/CalamityCustomThrowingDamage/IchorSpear.cs index 41d305c1f5..f41baafb8d 100644 --- a/Items/CalamityCustomThrowingDamage/IchorSpear.cs +++ b/Items/CalamityCustomThrowingDamage/IchorSpear.cs @@ -1,38 +1,38 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items; - -namespace CalamityMod.Items.CalamityCustomThrowingDamage -{ - public class IchorSpear : CalamityDamageItem - { +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.CalamityCustomThrowingDamage +{ + public class IchorSpear : CalamityDamageItem + { public override void SetStaticDefaults() { DisplayName.SetDefault("Ichor Spear"); } - public override void SafeSetDefaults() - { - item.width = 52; - item.damage = 40; - item.noMelee = true; - item.noUseGraphic = true; - item.useAnimation = 20; - item.useStyle = 1; - item.useTime = 20; - item.knockBack = 6f; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - item.height = 52; - item.value = Item.buyPrice(0, 36, 0, 0); - item.rare = 5; - item.shoot = mod.ProjectileType("IchorSpear"); - item.shootSpeed = 20f; - } - } -} + public override void SafeSetDefaults() + { + item.width = 52; + item.damage = 40; + item.noMelee = true; + item.noUseGraphic = true; + item.useAnimation = 20; + item.useStyle = 1; + item.useTime = 20; + item.knockBack = 6f; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.height = 52; + item.value = Item.buyPrice(0, 36, 0, 0); + item.rare = 5; + item.shoot = mod.ProjectileType("IchorSpear"); + item.shootSpeed = 20f; + } + } +} diff --git a/Items/CalamityCustomThrowingDamage/Lionfish.cs b/Items/CalamityCustomThrowingDamage/Lionfish.cs index 09f122e59f..32984dc3d7 100644 --- a/Items/CalamityCustomThrowingDamage/Lionfish.cs +++ b/Items/CalamityCustomThrowingDamage/Lionfish.cs @@ -1,38 +1,38 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items; - -namespace CalamityMod.Items.CalamityCustomThrowingDamage -{ - public class Lionfish : CalamityDamageItem - { +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.CalamityCustomThrowingDamage +{ + public class Lionfish : CalamityDamageItem + { public override void SetStaticDefaults() { DisplayName.SetDefault("Lionfish"); } - public override void SafeSetDefaults() - { - item.width = 40; - item.damage = 54; - item.noMelee = true; - item.noUseGraphic = true; - item.useAnimation = 22; - item.useStyle = 1; - item.useTime = 22; - item.knockBack = 2.5f; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - item.height = 40; - item.value = Item.buyPrice(0, 4, 0, 0); - item.rare = 3; - item.shoot = mod.ProjectileType("Lionfish"); - item.shootSpeed = 12f; - } - } -} + public override void SafeSetDefaults() + { + item.width = 40; + item.damage = 54; + item.noMelee = true; + item.noUseGraphic = true; + item.useAnimation = 22; + item.useStyle = 1; + item.useTime = 22; + item.knockBack = 2.5f; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.height = 40; + item.value = Item.buyPrice(0, 4, 0, 0); + item.rare = 3; + item.shoot = mod.ProjectileType("Lionfish"); + item.shootSpeed = 12f; + } + } +} diff --git a/Items/CalamityCustomThrowingDamage/Malachite.cs b/Items/CalamityCustomThrowingDamage/Malachite.cs index a74f73e505..2e99a3fc54 100644 --- a/Items/CalamityCustomThrowingDamage/Malachite.cs +++ b/Items/CalamityCustomThrowingDamage/Malachite.cs @@ -1,78 +1,80 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items; - -namespace CalamityMod.Items.CalamityCustomThrowingDamage -{ - public class Malachite : CalamityDamageItem - { +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.CalamityCustomThrowingDamage +{ + public class Malachite : CalamityDamageItem + { public override void SetStaticDefaults() { DisplayName.SetDefault("Malachite"); - Tooltip.SetDefault("Legendary Drop\n" + + Tooltip.SetDefault("Legendary Drop\n" + "Throws a stream of kunai that stick to enemies and explode\n" + - "Right click to throw a single kunai that pierces, after piercing an enemy it emits a massive explosion on the next enemy hit\n" + + "Right click to throw a single kunai that pierces, after piercing an enemy it emits a massive explosion on the next enemy hit\n" + "Revengeance drop"); } - public override void SafeSetDefaults() - { - item.width = 26; - item.damage = 58; - item.noMelee = true; - item.noUseGraphic = true; - item.useTime = 10; - item.useAnimation = 10; - item.useStyle = 1; - item.knockBack = 1.25f; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - item.height = 58; - item.value = Item.buyPrice(0, 80, 0, 0); - item.rare = 8; - item.shoot = mod.ProjectileType("Malachite"); - item.shootSpeed = 10f; - } - - public override bool AltFunctionUse(Player player) - { - return true; - } - - public override bool CanUseItem(Player player) - { - if (player.altFunctionUse == 2) - { - item.useTime = 10; - item.useAnimation = 10; - item.UseSound = SoundID.Item109; - } - else - { - item.useTime = 5; - item.useAnimation = 5; - item.UseSound = SoundID.Item1; - } - return base.CanUseItem(player); - } - - public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - if (player.altFunctionUse == 2) - { - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, mod.ProjectileType("MalachiteBolt"), (int)((double)damage * 2.0), knockBack, player.whoAmI, 0.0f, 0.0f); - return false; - } - else - { - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, mod.ProjectileType("Malachite"), damage, knockBack, player.whoAmI, 0.0f, 0.0f); - return false; - } - } - } -} + public override void SafeSetDefaults() + { + item.width = 26; + item.damage = 58; + item.noMelee = true; + item.noUseGraphic = true; + item.useTime = 10; + item.useAnimation = 10; + item.useStyle = 1; + item.knockBack = 1.25f; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.height = 58; + item.value = Item.buyPrice(0, 80, 0, 0); + item.rare = 8; + item.shoot = mod.ProjectileType("Malachite"); + item.shootSpeed = 10f; + item.GetGlobalItem(mod).rogue = true; + item.GetGlobalItem(mod).postMoonLordRarity = 17; + } + + public override bool AltFunctionUse(Player player) + { + return true; + } + + public override bool CanUseItem(Player player) + { + if (player.altFunctionUse == 2) + { + item.useTime = 10; + item.useAnimation = 10; + item.UseSound = SoundID.Item109; + } + else + { + item.useTime = 5; + item.useAnimation = 5; + item.UseSound = SoundID.Item1; + } + return base.CanUseItem(player); + } + + public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + if (player.altFunctionUse == 2) + { + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, mod.ProjectileType("MalachiteBolt"), (int)((double)damage * 2.0), knockBack, player.whoAmI, 0.0f, 0.0f); + return false; + } + else + { + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, mod.ProjectileType("Malachite"), damage, knockBack, player.whoAmI, 0.0f, 0.0f); + return false; + } + } + } +} diff --git a/Items/CalamityCustomThrowingDamage/MangroveChakram.cs b/Items/CalamityCustomThrowingDamage/MangroveChakram.cs index fe3fbc6541..92357e4599 100644 --- a/Items/CalamityCustomThrowingDamage/MangroveChakram.cs +++ b/Items/CalamityCustomThrowingDamage/MangroveChakram.cs @@ -1,46 +1,46 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items; - -namespace CalamityMod.Items.CalamityCustomThrowingDamage -{ - public class MangroveChakram : CalamityDamageItem - { +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.CalamityCustomThrowingDamage +{ + public class MangroveChakram : CalamityDamageItem + { public override void SetStaticDefaults() { DisplayName.SetDefault("Mangrove Chakram"); } - public override void SafeSetDefaults() - { - item.width = 38; - item.damage = 84; - item.noMelee = true; - item.noUseGraphic = true; - item.useAnimation = 14; - item.useStyle = 1; - item.useTime = 14; - item.knockBack = 7.5f; - item.UseSound = SoundID.Item1; - item.height = 38; - item.value = Item.buyPrice(0, 60, 0, 0); - item.rare = 7; - item.shoot = mod.ProjectileType("MangroveChakramProjectile"); - item.shootSpeed = 15.5f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "DraedonBar", 7); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(this); - recipe.AddRecipe(); - } - } -} + public override void SafeSetDefaults() + { + item.width = 38; + item.damage = 84; + item.noMelee = true; + item.noUseGraphic = true; + item.useAnimation = 14; + item.useStyle = 1; + item.useTime = 14; + item.knockBack = 7.5f; + item.UseSound = SoundID.Item1; + item.height = 38; + item.value = Item.buyPrice(0, 60, 0, 0); + item.rare = 7; + item.shoot = mod.ProjectileType("MangroveChakramProjectile"); + item.shootSpeed = 15.5f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "DraedonBar", 7); + recipe.AddTile(TileID.MythrilAnvil); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/CalamityCustomThrowingDamage/MoltenAmputator.cs b/Items/CalamityCustomThrowingDamage/MoltenAmputator.cs index 1850fc1834..286ad95083 100644 --- a/Items/CalamityCustomThrowingDamage/MoltenAmputator.cs +++ b/Items/CalamityCustomThrowingDamage/MoltenAmputator.cs @@ -1,38 +1,40 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items; - -namespace CalamityMod.Items.CalamityCustomThrowingDamage -{ - public class MoltenAmputator : CalamityDamageItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Molten Amputator"); - } - - public override void SafeSetDefaults() - { - item.width = 60; - item.damage = 250; - item.noMelee = true; - item.noUseGraphic = true; - item.autoReuse = true; - item.useAnimation = 18; - item.useStyle = 1; - item.useTime = 18; - item.knockBack = 9f; - item.UseSound = SoundID.Item1; - item.height = 60; - item.value = Item.buyPrice(1, 20, 0, 0); - item.rare = 10; - item.shoot = mod.ProjectileType("MoltenAmputator"); - item.shootSpeed = 12f; - } - } -} +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.CalamityCustomThrowingDamage +{ + public class MoltenAmputator : CalamityDamageItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Molten Amputator"); + } + + public override void SafeSetDefaults() + { + item.width = 60; + item.damage = 250; + item.noMelee = true; + item.noUseGraphic = true; + item.autoReuse = true; + item.useAnimation = 18; + item.useStyle = 1; + item.useTime = 18; + item.knockBack = 9f; + item.UseSound = SoundID.Item1; + item.height = 60; + item.value = Item.buyPrice(1, 20, 0, 0); + item.rare = 10; + item.shoot = mod.ProjectileType("MoltenAmputator"); + item.shootSpeed = 12f; + item.GetGlobalItem(mod).rogue = true; + item.GetGlobalItem(mod).postMoonLordRarity = 12; + } + } +} diff --git a/Items/CalamityCustomThrowingDamage/Mycoroot.cs b/Items/CalamityCustomThrowingDamage/Mycoroot.cs index edcfec3b68..3d573a25f5 100644 --- a/Items/CalamityCustomThrowingDamage/Mycoroot.cs +++ b/Items/CalamityCustomThrowingDamage/Mycoroot.cs @@ -1,47 +1,47 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items; - -namespace CalamityMod.Items.CalamityCustomThrowingDamage -{ - public class Mycoroot : CalamityDamageItem - { +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.CalamityCustomThrowingDamage +{ + public class Mycoroot : CalamityDamageItem + { public override void SetStaticDefaults() { DisplayName.SetDefault("Mycoroot"); Tooltip.SetDefault("Fires a stream of short-range fungal roots"); } - - public override void SafeSetDefaults() - { - item.width = 32; - item.damage = 10; - item.noMelee = true; - item.noUseGraphic = true; - item.useTime = 5; - item.useAnimation = 5; - item.useStyle = 1; - item.knockBack = 1.5f; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - item.height = 32; - item.rare = 2; - item.value = Item.buyPrice(0, 2, 0, 0); - item.shoot = mod.ProjectileType("Mycoroot"); - item.shootSpeed = 20f; - } - - public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - float SpeedX = speedX + (float) Main.rand.Next(-30, 31) * 0.05f; - float SpeedY = speedY + (float) Main.rand.Next(-30, 31) * 0.05f; - Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI, 0.0f, 0.0f); - return false; - } - } -} + + public override void SafeSetDefaults() + { + item.width = 32; + item.damage = 10; + item.noMelee = true; + item.noUseGraphic = true; + item.useTime = 5; + item.useAnimation = 5; + item.useStyle = 1; + item.knockBack = 1.5f; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.height = 32; + item.rare = 2; + item.value = Item.buyPrice(0, 2, 0, 0); + item.shoot = mod.ProjectileType("Mycoroot"); + item.shootSpeed = 20f; + } + + public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + float SpeedX = speedX + (float) Main.rand.Next(-30, 31) * 0.05f; + float SpeedY = speedY + (float) Main.rand.Next(-30, 31) * 0.05f; + Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI, 0.0f, 0.0f); + return false; + } + } +} diff --git a/Items/CalamityCustomThrowingDamage/MythrilKnife.cs b/Items/CalamityCustomThrowingDamage/MythrilKnife.cs index 869c9998de..e7844dd355 100644 --- a/Items/CalamityCustomThrowingDamage/MythrilKnife.cs +++ b/Items/CalamityCustomThrowingDamage/MythrilKnife.cs @@ -1,49 +1,49 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items; - -namespace CalamityMod.Items.CalamityCustomThrowingDamage -{ - public class MythrilKnife : CalamityDamageItem - { +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.CalamityCustomThrowingDamage +{ + public class MythrilKnife : CalamityDamageItem + { public override void SetStaticDefaults() { DisplayName.SetDefault("Mythril Knife"); } - public override void SafeSetDefaults() - { - item.width = 12; - item.damage = 32; - item.noMelee = true; - item.consumable = true; - item.noUseGraphic = true; - item.useAnimation = 10; - item.useStyle = 1; - item.useTime = 10; - item.knockBack = 1.75f; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - item.height = 30; - item.maxStack = 999; - item.value = 1100; - item.rare = 4; - item.shoot = mod.ProjectileType("MythrilKnifeProjectile"); - item.shootSpeed = 12f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.MythrilBar); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(this, 40); - recipe.AddRecipe(); - } - } -} + public override void SafeSetDefaults() + { + item.width = 12; + item.damage = 32; + item.noMelee = true; + item.consumable = true; + item.noUseGraphic = true; + item.useAnimation = 10; + item.useStyle = 1; + item.useTime = 10; + item.knockBack = 1.75f; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.height = 30; + item.maxStack = 999; + item.value = 1100; + item.rare = 4; + item.shoot = mod.ProjectileType("MythrilKnifeProjectile"); + item.shootSpeed = 12f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.MythrilBar); + recipe.AddTile(TileID.MythrilAnvil); + recipe.SetResult(this, 40); + recipe.AddRecipe(); + } + } +} diff --git a/Items/CalamityCustomThrowingDamage/OrichalcumSpikedGemstone.cs b/Items/CalamityCustomThrowingDamage/OrichalcumSpikedGemstone.cs index 84d1a0c9c9..140a953df0 100644 --- a/Items/CalamityCustomThrowingDamage/OrichalcumSpikedGemstone.cs +++ b/Items/CalamityCustomThrowingDamage/OrichalcumSpikedGemstone.cs @@ -1,50 +1,50 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items; - -namespace CalamityMod.Items.CalamityCustomThrowingDamage -{ - public class OrichalcumSpikedGemstone : CalamityDamageItem - { +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.CalamityCustomThrowingDamage +{ + public class OrichalcumSpikedGemstone : CalamityDamageItem + { public override void SetStaticDefaults() { DisplayName.SetDefault("Orichalcum Spiked Gemstone"); } - public override void SafeSetDefaults() - { - item.width = 14; - item.damage = 25; - item.noMelee = true; - item.consumable = true; - item.noUseGraphic = true; - item.useAnimation = 13; - item.useStyle = 1; - item.useTime = 13; - item.knockBack = 2f; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - item.height = 24; - item.shoot = 330; - item.maxStack = 999; - item.value = 1200; - item.rare = 4; - item.shoot = mod.ProjectileType("OrichalcumSpikedGemstoneProjectile"); - item.shootSpeed = 12f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.OrichalcumBar); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(this, 50); - recipe.AddRecipe(); - } - } -} + public override void SafeSetDefaults() + { + item.width = 14; + item.damage = 25; + item.noMelee = true; + item.consumable = true; + item.noUseGraphic = true; + item.useAnimation = 13; + item.useStyle = 1; + item.useTime = 13; + item.knockBack = 2f; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.height = 24; + item.shoot = 330; + item.maxStack = 999; + item.value = 1200; + item.rare = 4; + item.shoot = mod.ProjectileType("OrichalcumSpikedGemstoneProjectile"); + item.shootSpeed = 12f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.OrichalcumBar); + recipe.AddTile(TileID.MythrilAnvil); + recipe.SetResult(this, 50); + recipe.AddRecipe(); + } + } +} diff --git a/Items/CalamityCustomThrowingDamage/PalladiumJavelin.cs b/Items/CalamityCustomThrowingDamage/PalladiumJavelin.cs index 72167ee984..9ddc9882a6 100644 --- a/Items/CalamityCustomThrowingDamage/PalladiumJavelin.cs +++ b/Items/CalamityCustomThrowingDamage/PalladiumJavelin.cs @@ -1,50 +1,50 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items; - -namespace CalamityMod.Items.CalamityCustomThrowingDamage -{ - public class PalladiumJavelin : CalamityDamageItem - { +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.CalamityCustomThrowingDamage +{ + public class PalladiumJavelin : CalamityDamageItem + { public override void SetStaticDefaults() { DisplayName.SetDefault("Palladium Javelin"); } - public override void SafeSetDefaults() - { - item.width = 44; - item.damage = 41; - item.noMelee = true; - item.consumable = true; - item.noUseGraphic = true; - item.useAnimation = 19; - item.useStyle = 1; - item.useTime = 19; - item.knockBack = 5.5f; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - item.height = 44; - item.shoot = 330; - item.maxStack = 999; - item.value = 1200; - item.rare = 4; - item.shoot = mod.ProjectileType("PalladiumJavelinProjectile"); - item.shootSpeed = 16f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.PalladiumBar); - recipe.AddTile(TileID.Anvils); - recipe.SetResult(this, 20); - recipe.AddRecipe(); - } - } -} + public override void SafeSetDefaults() + { + item.width = 44; + item.damage = 41; + item.noMelee = true; + item.consumable = true; + item.noUseGraphic = true; + item.useAnimation = 19; + item.useStyle = 1; + item.useTime = 19; + item.knockBack = 5.5f; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.height = 44; + item.shoot = 330; + item.maxStack = 999; + item.value = 1200; + item.rare = 4; + item.shoot = mod.ProjectileType("PalladiumJavelinProjectile"); + item.shootSpeed = 16f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.PalladiumBar); + recipe.AddTile(TileID.Anvils); + recipe.SetResult(this, 20); + recipe.AddRecipe(); + } + } +} diff --git a/Items/CalamityCustomThrowingDamage/Prismalline.cs b/Items/CalamityCustomThrowingDamage/Prismalline.cs new file mode 100644 index 0000000000..09bc67d704 --- /dev/null +++ b/Items/CalamityCustomThrowingDamage/Prismalline.cs @@ -0,0 +1,52 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.CalamityCustomThrowingDamage +{ + public class Prismalline : CalamityDamageItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Prismalline"); + Tooltip.SetDefault("Throws daggers that split after a while"); + } + + public override void SafeSetDefaults() + { + item.width = 46; + item.damage = 22; + item.crit += 4; + item.noMelee = true; + item.noUseGraphic = true; + item.useAnimation = 14; + item.useStyle = 1; + item.useTime = 14; + item.knockBack = 5f; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.height = 46; + item.value = Item.buyPrice(0, 36, 0, 0); + item.rare = 5; + item.shoot = mod.ProjectileType("Prismalline"); + item.shootSpeed = 16f; + item.GetGlobalItem(mod).rogue = true; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "Crystalline"); + recipe.AddIngredient(null, "EssenceofEleum", 5); + recipe.AddIngredient(null, "SeaPrism", 5); + recipe.AddTile(TileID.Anvils); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/CalamityCustomThrowingDamage/Prismalline.png b/Items/CalamityCustomThrowingDamage/Prismalline.png new file mode 100644 index 0000000000..ebc98156a4 Binary files /dev/null and b/Items/CalamityCustomThrowingDamage/Prismalline.png differ diff --git a/Items/CalamityCustomThrowingDamage/ProfanedTrident.cs b/Items/CalamityCustomThrowingDamage/ProfanedTrident.cs index f2fb4deaa6..03ae4b9772 100644 --- a/Items/CalamityCustomThrowingDamage/ProfanedTrident.cs +++ b/Items/CalamityCustomThrowingDamage/ProfanedTrident.cs @@ -1,38 +1,40 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items; - -namespace CalamityMod.Items.CalamityCustomThrowingDamage -{ - public class ProfanedTrident : CalamityDamageItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Infernal Spear"); - } - - public override void SafeSetDefaults() - { - item.width = 72; - item.damage = 1700; - item.noMelee = true; - item.noUseGraphic = true; - item.useAnimation = 13; - item.useStyle = 1; - item.useTime = 13; - item.knockBack = 8f; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - item.height = 72; - item.value = Item.buyPrice(1, 80, 0, 0); - item.rare = 10; - item.shoot = mod.ProjectileType("ProfanedTrident"); - item.shootSpeed = 28f; - } - } -} +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.CalamityCustomThrowingDamage +{ + public class ProfanedTrident : CalamityDamageItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Infernal Spear"); + } + + public override void SafeSetDefaults() + { + item.width = 72; + item.damage = 1700; + item.noMelee = true; + item.noUseGraphic = true; + item.useAnimation = 13; + item.useStyle = 1; + item.useTime = 13; + item.knockBack = 8f; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.height = 72; + item.value = Item.buyPrice(1, 80, 0, 0); + item.rare = 10; + item.shoot = mod.ProjectileType("ProfanedTrident"); + item.shootSpeed = 28f; + item.GetGlobalItem(mod).rogue = true; + item.GetGlobalItem(mod).postMoonLordRarity = 14; + } + } +} diff --git a/Items/CalamityCustomThrowingDamage/Pwnagehammer.cs b/Items/CalamityCustomThrowingDamage/Pwnagehammer.cs index 5e520a8aff..0273eae73f 100644 --- a/Items/CalamityCustomThrowingDamage/Pwnagehammer.cs +++ b/Items/CalamityCustomThrowingDamage/Pwnagehammer.cs @@ -1,51 +1,51 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items; - -namespace CalamityMod.Items.CalamityCustomThrowingDamage -{ - public class Pwnagehammer : CalamityDamageItem - { +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.CalamityCustomThrowingDamage +{ + public class Pwnagehammer : CalamityDamageItem + { public override void SetStaticDefaults() { DisplayName.SetDefault("Pwnagehammer"); } - public override void SafeSetDefaults() - { - item.width = 68; - item.damage = 90; - item.noMelee = true; - item.noUseGraphic = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useStyle = 1; - item.useTime = 15; - item.knockBack = 10f; - item.UseSound = SoundID.Item1; - item.height = 68; - item.value = Item.buyPrice(0, 48, 0, 0); - item.rare = 6; - item.shoot = mod.ProjectileType("Pwnagehammer"); - item.shootSpeed = 12f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Pwnhammer); - recipe.AddIngredient(ItemID.HallowedBar, 7); - recipe.AddIngredient(ItemID.SoulofMight, 3); - recipe.AddIngredient(ItemID.SoulofSight, 3); - recipe.AddIngredient(ItemID.SoulofFright, 3); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(this); - recipe.AddRecipe(); - } - } -} + public override void SafeSetDefaults() + { + item.width = 68; + item.damage = 90; + item.noMelee = true; + item.noUseGraphic = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useStyle = 1; + item.useTime = 15; + item.knockBack = 10f; + item.UseSound = SoundID.Item1; + item.height = 68; + item.value = Item.buyPrice(0, 48, 0, 0); + item.rare = 6; + item.shoot = mod.ProjectileType("Pwnagehammer"); + item.shootSpeed = 12f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Pwnhammer); + recipe.AddIngredient(ItemID.HallowedBar, 7); + recipe.AddIngredient(ItemID.SoulofMight, 3); + recipe.AddIngredient(ItemID.SoulofSight, 3); + recipe.AddIngredient(ItemID.SoulofFright, 3); + recipe.AddTile(TileID.MythrilAnvil); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/CalamityCustomThrowingDamage/RadiantStar.cs b/Items/CalamityCustomThrowingDamage/RadiantStar.cs new file mode 100644 index 0000000000..818905c630 --- /dev/null +++ b/Items/CalamityCustomThrowingDamage/RadiantStar.cs @@ -0,0 +1,53 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.CalamityCustomThrowingDamage +{ + public class RadiantStar : CalamityDamageItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Radiant Star"); + Tooltip.SetDefault("Throws daggers that explode and split after a while"); + } + + public override void SafeSetDefaults() + { + item.width = 52; + item.damage = 33; + item.crit += 8; + item.noMelee = true; + item.noUseGraphic = true; + item.useAnimation = 12; + item.useStyle = 1; + item.useTime = 12; + item.knockBack = 5f; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.height = 48; + item.value = Item.buyPrice(0, 60, 0, 0); + item.rare = 7; + item.shoot = mod.ProjectileType("RadiantStar"); + item.shootSpeed = 20f; + item.GetGlobalItem(mod).rogue = true; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "Prismalline"); + recipe.AddIngredient(null, "AstralBar", 10); + recipe.AddIngredient(null, "Stardust", 15); + recipe.AddIngredient(ItemID.FallenStar, 10); + recipe.AddTile(TileID.MythrilAnvil); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/CalamityCustomThrowingDamage/RadiantStar.png b/Items/CalamityCustomThrowingDamage/RadiantStar.png new file mode 100644 index 0000000000..e29e6807b2 Binary files /dev/null and b/Items/CalamityCustomThrowingDamage/RadiantStar.png differ diff --git a/Items/CalamityCustomThrowingDamage/RotBall.cs b/Items/CalamityCustomThrowingDamage/RotBall.cs index aaaa086a92..783fd1e2d1 100644 --- a/Items/CalamityCustomThrowingDamage/RotBall.cs +++ b/Items/CalamityCustomThrowingDamage/RotBall.cs @@ -1,52 +1,52 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items; - -namespace CalamityMod.Items.CalamityCustomThrowingDamage -{ - public class RotBall : CalamityDamageItem - { +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.CalamityCustomThrowingDamage +{ + public class RotBall : CalamityDamageItem + { public override void SetStaticDefaults() { DisplayName.SetDefault("Rot Ball"); - } - - public override void SafeSetDefaults() - { - item.width = 26; - item.damage = 20; - item.noMelee = true; - item.consumable = true; - item.noUseGraphic = true; - item.useAnimation = 13; - item.crit = 8; - item.useStyle = 1; - item.useTime = 13; - item.knockBack = 2.5f; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - item.height = 26; - item.maxStack = 999; - item.value = 1000; - item.rare = 3; - item.shoot = mod.ProjectileType("RotBallProjectile"); - item.shootSpeed = 16f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "TrueShadowScale"); - recipe.AddIngredient(ItemID.RottenChunk); - recipe.AddIngredient(ItemID.DemoniteBar); - recipe.AddTile(TileID.DemonAltar); - recipe.SetResult(this, 100); - recipe.AddRecipe(); - } - } -} + } + + public override void SafeSetDefaults() + { + item.width = 26; + item.damage = 20; + item.noMelee = true; + item.consumable = true; + item.noUseGraphic = true; + item.useAnimation = 13; + item.crit = 8; + item.useStyle = 1; + item.useTime = 13; + item.knockBack = 2.5f; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.height = 26; + item.maxStack = 999; + item.value = 1000; + item.rare = 3; + item.shoot = mod.ProjectileType("RotBallProjectile"); + item.shootSpeed = 16f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "TrueShadowScale"); + recipe.AddIngredient(ItemID.RottenChunk); + recipe.AddIngredient(ItemID.DemoniteBar); + recipe.AddTile(TileID.DemonAltar); + recipe.SetResult(this, 100); + recipe.AddRecipe(); + } + } +} diff --git a/Items/CalamityCustomThrowingDamage/RoyalKnives.cs b/Items/CalamityCustomThrowingDamage/RoyalKnives.cs index 8138975cd3..1b1bba20c7 100644 --- a/Items/CalamityCustomThrowingDamage/RoyalKnives.cs +++ b/Items/CalamityCustomThrowingDamage/RoyalKnives.cs @@ -1,110 +1,112 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items; - -namespace CalamityMod.Items.CalamityCustomThrowingDamage -{ - public class RoyalKnives : CalamityDamageItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Illustrious Knives"); - } - - public override void SafeSetDefaults() - { - item.width = 18; - item.damage = 1320; - item.noMelee = true; - item.noUseGraphic = true; - item.useAnimation = 12; - item.useStyle = 1; - item.useTime = 12; - item.knockBack = 3f; - item.UseSound = SoundID.Item39; - item.autoReuse = true; - item.height = 20; - item.value = Item.buyPrice(5, 0, 0, 0); - item.rare = 10; - item.shoot = mod.ProjectileType("RoyalKnife"); - item.shootSpeed = 9f; - } - - public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - float num72 = item.shootSpeed; - Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); - Vector2 value = Vector2.UnitX.RotatedBy((double)player.fullRotation, default(Vector2)); - Vector2 vector3 = Main.MouseWorld - vector2; - float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; - float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; - if (player.gravDir == -1f) - { - num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; - } - float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); - float num81 = num80; - if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) - { - num78 = (float)player.direction; - num79 = 0f; - num80 = num72; - } - else - { - num80 = num72 / num80; - } - num78 *= num80; - num79 *= num80; - int num146 = 4; - if (Main.rand.Next(2) == 0) - { - num146++; - } - if (Main.rand.Next(4) == 0) - { - num146++; - } - if (Main.rand.Next(8) == 0) - { - num146++; - } - if (Main.rand.Next(16) == 0) - { - num146++; - } - for (int num147 = 0; num147 < num146; num147++) - { - float num148 = num78; - float num149 = num79; - float num150 = 0.05f * (float)num147; - num148 += (float)Main.rand.Next(-35, 36) * num150; - num149 += (float)Main.rand.Next(-35, 36) * num150; - num80 = (float)Math.Sqrt((double)(num148 * num148 + num149 * num149)); - num80 = num72 / num80; - num148 *= num80; - num149 *= num80; - float x4 = vector2.X; - float y4 = vector2.Y; - Projectile.NewProjectile(x4, y4, num148, num149, mod.ProjectileType("RoyalKnife"), damage, knockBack, player.whoAmI, 0f, 0f); - } - return false; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "ShadowspecBar", 5); - recipe.AddIngredient(null, "CoreofCalamity", 3); - recipe.AddIngredient(null, "EmpyreanKnivesThrown"); - recipe.AddTile(null, "DraedonsForge"); - recipe.SetResult(this); - recipe.AddRecipe(); - } - } -} +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.CalamityCustomThrowingDamage +{ + public class RoyalKnives : CalamityDamageItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Illustrious Knives"); + } + + public override void SafeSetDefaults() + { + item.width = 18; + item.damage = 1600; + item.noMelee = true; + item.noUseGraphic = true; + item.useAnimation = 12; + item.useStyle = 1; + item.useTime = 12; + item.knockBack = 3f; + item.UseSound = SoundID.Item39; + item.autoReuse = true; + item.height = 20; + item.value = Item.buyPrice(5, 0, 0, 0); + item.rare = 10; + item.shoot = mod.ProjectileType("RoyalKnife"); + item.shootSpeed = 9f; + item.GetGlobalItem(mod).rogue = true; + item.GetGlobalItem(mod).postMoonLordRarity = 16; + } + + public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + float num72 = item.shootSpeed; + Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); + Vector2 value = Vector2.UnitX.RotatedBy((double)player.fullRotation, default(Vector2)); + Vector2 vector3 = Main.MouseWorld - vector2; + float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; + float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; + if (player.gravDir == -1f) + { + num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; + } + float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); + float num81 = num80; + if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) + { + num78 = (float)player.direction; + num79 = 0f; + num80 = num72; + } + else + { + num80 = num72 / num80; + } + num78 *= num80; + num79 *= num80; + int num146 = 4; + if (Main.rand.Next(2) == 0) + { + num146++; + } + if (Main.rand.Next(4) == 0) + { + num146++; + } + if (Main.rand.Next(8) == 0) + { + num146++; + } + if (Main.rand.Next(16) == 0) + { + num146++; + } + for (int num147 = 0; num147 < num146; num147++) + { + float num148 = num78; + float num149 = num79; + float num150 = 0.05f * (float)num147; + num148 += (float)Main.rand.Next(-35, 36) * num150; + num149 += (float)Main.rand.Next(-35, 36) * num150; + num80 = (float)Math.Sqrt((double)(num148 * num148 + num149 * num149)); + num80 = num72 / num80; + num148 *= num80; + num149 *= num80; + float x4 = vector2.X; + float y4 = vector2.Y; + Projectile.NewProjectile(x4, y4, num148, num149, mod.ProjectileType("RoyalKnife"), damage, knockBack, player.whoAmI, 0f, 0f); + } + return false; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "ShadowspecBar", 5); + recipe.AddIngredient(null, "CoreofCalamity", 3); + recipe.AddIngredient(null, "EmpyreanKnivesThrown"); + recipe.AddTile(null, "DraedonsForge"); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/CalamityCustomThrowingDamage/SandDollar.cs b/Items/CalamityCustomThrowingDamage/SandDollar.cs new file mode 100644 index 0000000000..eba731e2f2 --- /dev/null +++ b/Items/CalamityCustomThrowingDamage/SandDollar.cs @@ -0,0 +1,53 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.CalamityCustomThrowingDamage +{ + public class SandDollar : CalamityDamageItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sand Dollar"); + Tooltip.SetDefault("Stacks up to 2"); + } + + public override void SafeSetDefaults() + { + item.width = 30; + item.height = 28; + item.damage = 30; + item.thrown = true; + item.noMelee = true; + item.noUseGraphic = true; + item.useTime = 15; + item.useAnimation = 15; + item.useStyle = 1; + item.maxStack = 2; + item.knockBack = 3.5f; + item.autoReuse = true; + item.UseSound = SoundID.Item1; + item.value = Item.buyPrice(0, 1, 0, 0); + item.rare = 2; + item.shoot = mod.ProjectileType("SandDollarProj"); + item.shootSpeed = 14f; + } + + public override bool CanUseItem(Player player) + { + int MAX = item.stack; + int launched = 0; + foreach (Projectile projectile in Main.projectile) + if (projectile.type == item.shoot && projectile.owner == item.owner && projectile.active) + { + launched++; + } + return (launched >= MAX) ? false : true; + } + } +} diff --git a/Items/CalamityCustomThrowingDamage/SandDollar.png b/Items/CalamityCustomThrowingDamage/SandDollar.png new file mode 100644 index 0000000000..69e288ef07 Binary files /dev/null and b/Items/CalamityCustomThrowingDamage/SandDollar.png differ diff --git a/Items/CalamityCustomThrowingDamage/ScourgeoftheCosmosThrown.cs b/Items/CalamityCustomThrowingDamage/ScourgeoftheCosmosThrown.cs index 41c2ff7bcd..546fd7f39e 100644 --- a/Items/CalamityCustomThrowingDamage/ScourgeoftheCosmosThrown.cs +++ b/Items/CalamityCustomThrowingDamage/ScourgeoftheCosmosThrown.cs @@ -1,56 +1,58 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items; - -namespace CalamityMod.Items.CalamityCustomThrowingDamage -{ - public class ScourgeoftheCosmosThrown : CalamityDamageItem - { +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.CalamityCustomThrowingDamage +{ + public class ScourgeoftheCosmosThrown : CalamityDamageItem + { public override void SetStaticDefaults() { DisplayName.SetDefault("Scourge of the Cosmos"); } - public override void SafeSetDefaults() - { - item.width = 18; - item.damage = 1500; - item.noMelee = true; - item.noUseGraphic = true; - item.useAnimation = 20; - item.useStyle = 5; - item.useTime = 20; - item.knockBack = 5f; - item.UseSound = SoundID.Item109; - item.autoReuse = true; - item.height = 20; - item.value = Item.buyPrice(1, 80, 0, 0); - item.rare = 10; - item.shoot = mod.ProjectileType("ScourgeoftheCosmos"); - item.shootSpeed = 15f; - } - - public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 1f); - return false; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.ScourgeoftheCorruptor); - recipe.AddIngredient(null, "CosmiliteBar", 10); - recipe.AddIngredient(null, "DarksunFragment", 10); - recipe.AddIngredient(null, "XerocPitchfork", 200); - recipe.AddTile(null, "DraedonsForge"); - recipe.SetResult(this); - recipe.AddRecipe(); - } - } -} + public override void SafeSetDefaults() + { + item.width = 18; + item.damage = 1500; + item.noMelee = true; + item.noUseGraphic = true; + item.useAnimation = 20; + item.useStyle = 5; + item.useTime = 20; + item.knockBack = 5f; + item.UseSound = SoundID.Item109; + item.autoReuse = true; + item.height = 20; + item.value = Item.buyPrice(1, 80, 0, 0); + item.rare = 10; + item.shoot = mod.ProjectileType("ScourgeoftheCosmos"); + item.shootSpeed = 15f; + item.GetGlobalItem(mod).rogue = true; + item.GetGlobalItem(mod).postMoonLordRarity = 14; + } + + public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 1f); + return false; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.ScourgeoftheCorruptor); + recipe.AddIngredient(null, "CosmiliteBar", 10); + recipe.AddIngredient(null, "DarksunFragment", 10); + recipe.AddIngredient(null, "XerocPitchfork", 200); + recipe.AddTile(null, "DraedonsForge"); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/CalamityCustomThrowingDamage/ScourgeoftheCosmosThrown.png b/Items/CalamityCustomThrowingDamage/ScourgeoftheCosmosThrown.png index bc1fc66277..f5b527abdf 100644 Binary files a/Items/CalamityCustomThrowingDamage/ScourgeoftheCosmosThrown.png and b/Items/CalamityCustomThrowingDamage/ScourgeoftheCosmosThrown.png differ diff --git a/Items/CalamityCustomThrowingDamage/ScourgeoftheDesert.cs b/Items/CalamityCustomThrowingDamage/ScourgeoftheDesert.cs index f5af03c99a..537e57b9e4 100644 --- a/Items/CalamityCustomThrowingDamage/ScourgeoftheDesert.cs +++ b/Items/CalamityCustomThrowingDamage/ScourgeoftheDesert.cs @@ -1,39 +1,39 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items; - -namespace CalamityMod.Items.CalamityCustomThrowingDamage -{ - public class ScourgeoftheDesert : CalamityDamageItem - { +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.CalamityCustomThrowingDamage +{ + public class ScourgeoftheDesert : CalamityDamageItem + { public override void SetStaticDefaults() { DisplayName.SetDefault("Scourge of the Desert"); - Tooltip.SetDefault("Revengeance drop"); + Tooltip.SetDefault("Revengeance drop"); } - public override void SafeSetDefaults() - { - item.width = 44; - item.damage = 16; - item.noMelee = true; - item.noUseGraphic = true; - item.useAnimation = 20; - item.useStyle = 1; - item.useTime = 20; - item.knockBack = 3.5f; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - item.height = 44; - item.value = Item.buyPrice(0, 2, 0, 0); - item.rare = 2; - item.shoot = mod.ProjectileType("ScourgeoftheDesert"); - item.shootSpeed = 12f; - } - } -} + public override void SafeSetDefaults() + { + item.width = 44; + item.damage = 16; + item.noMelee = true; + item.noUseGraphic = true; + item.useAnimation = 20; + item.useStyle = 1; + item.useTime = 20; + item.knockBack = 3.5f; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.height = 44; + item.value = Item.buyPrice(0, 2, 0, 0); + item.rare = 2; + item.shoot = mod.ProjectileType("ScourgeoftheDesert"); + item.shootSpeed = 12f; + } + } +} diff --git a/Items/CalamityCustomThrowingDamage/SeafoamBomb.cs b/Items/CalamityCustomThrowingDamage/SeafoamBomb.cs new file mode 100644 index 0000000000..255bad9736 --- /dev/null +++ b/Items/CalamityCustomThrowingDamage/SeafoamBomb.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.CalamityCustomThrowingDamage +{ + public class SeafoamBomb : CalamityDamageItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Seafoam Bomb"); + Tooltip.SetDefault("Throws a bomb that explodes into a bubble which deals extra damage to enemies"); + } + + public override void SafeSetDefaults() + { + item.width = 26; + item.height = 44; + item.damage = 18; + item.noMelee = true; + item.noUseGraphic = true; + item.useAnimation = 18; + item.useStyle = 1; + item.useTime = 18; + item.knockBack = 8f; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.value = Item.buyPrice(0, 2, 0, 0); + item.rare = 2; + item.shoot = mod.ProjectileType("SeafoamBomb"); + item.shootSpeed = 8f; + item.GetGlobalItem(mod).rogue = true; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Bomb, 25); + recipe.AddIngredient(null, "SeaPrism", 10); + recipe.AddTile(TileID.Anvils); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/CalamityCustomThrowingDamage/SeafoamBomb.png b/Items/CalamityCustomThrowingDamage/SeafoamBomb.png new file mode 100644 index 0000000000..33dfca0d19 Binary files /dev/null and b/Items/CalamityCustomThrowingDamage/SeafoamBomb.png differ diff --git a/Items/CalamityCustomThrowingDamage/SeashellBoomerang.cs b/Items/CalamityCustomThrowingDamage/SeashellBoomerang.cs index 93d7048397..b06f578ee5 100644 --- a/Items/CalamityCustomThrowingDamage/SeashellBoomerang.cs +++ b/Items/CalamityCustomThrowingDamage/SeashellBoomerang.cs @@ -1,46 +1,46 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items; - -namespace CalamityMod.Items.CalamityCustomThrowingDamage -{ - public class SeashellBoomerang : CalamityDamageItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Seashell Boomerang"); - } - - public override void SafeSetDefaults() - { - item.width = 18; - item.damage = 15; - item.noMelee = true; - item.noUseGraphic = true; - item.useAnimation = 15; - item.useStyle = 1; - item.useTime = 15; - item.knockBack = 5.5f; - item.UseSound = SoundID.Item1; - item.height = 34; - item.value = Item.buyPrice(0, 2, 0, 0); - item.rare = 2; - item.shoot = mod.ProjectileType("SeashellBoomerangProjectile"); - item.shootSpeed = 11.5f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "VictideBar", 2); - recipe.AddTile(TileID.Anvils); - recipe.SetResult(this); - recipe.AddRecipe(); - } - } -} +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.CalamityCustomThrowingDamage +{ + public class SeashellBoomerang : CalamityDamageItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Seashell Boomerang"); + } + + public override void SafeSetDefaults() + { + item.width = 18; + item.damage = 15; + item.noMelee = true; + item.noUseGraphic = true; + item.useAnimation = 15; + item.useStyle = 1; + item.useTime = 15; + item.knockBack = 5.5f; + item.UseSound = SoundID.Item1; + item.height = 34; + item.value = Item.buyPrice(0, 2, 0, 0); + item.rare = 2; + item.shoot = mod.ProjectileType("SeashellBoomerangProjectile"); + item.shootSpeed = 11.5f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "VictideBar", 2); + recipe.AddTile(TileID.Anvils); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/CalamityCustomThrowingDamage/ShatteredSun.cs b/Items/CalamityCustomThrowingDamage/ShatteredSun.cs new file mode 100644 index 0000000000..ad89e107c1 --- /dev/null +++ b/Items/CalamityCustomThrowingDamage/ShatteredSun.cs @@ -0,0 +1,52 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.CalamityCustomThrowingDamage +{ + public class ShatteredSun : CalamityDamageItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Shattered Sun"); + Tooltip.SetDefault("Throws daggers that split twice and explode upon contact"); + } + + public override void SafeSetDefaults() + { + item.width = 56; + item.height = 56; + item.damage = 40; + item.crit += 10; + item.noMelee = true; + item.noUseGraphic = true; + item.useAnimation = 11; + item.useStyle = 1; + item.useTime = 11; + item.knockBack = 6f; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.value = Item.buyPrice(1, 20, 0, 0); + item.rare = 10; + item.shoot = mod.ProjectileType("ShatteredSun"); + item.shootSpeed = 25f; + item.GetGlobalItem(mod).rogue = true; + item.GetGlobalItem(mod).postMoonLordRarity = 12; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "RadiantStar"); + recipe.AddIngredient(null, "DivineGeode", 6); + recipe.AddTile(TileID.LunarCraftingStation); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/CalamityCustomThrowingDamage/ShatteredSun.png b/Items/CalamityCustomThrowingDamage/ShatteredSun.png new file mode 100644 index 0000000000..3b8a52b8c4 Binary files /dev/null and b/Items/CalamityCustomThrowingDamage/ShatteredSun.png differ diff --git a/Items/CalamityCustomThrowingDamage/SnapClam.cs b/Items/CalamityCustomThrowingDamage/SnapClam.cs new file mode 100644 index 0000000000..f205dda4a1 --- /dev/null +++ b/Items/CalamityCustomThrowingDamage/SnapClam.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.CalamityCustomThrowingDamage +{ + public class SnapClam : CalamityDamageItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Snap Clam"); + Tooltip.SetDefault("Can latch on enemies and deal damage over time"); + } + + public override void SafeSetDefaults() + { + item.width = 26; + item.height = 16; + item.damage = 15; + item.thrown = true; + item.noMelee = true; + item.noUseGraphic = true; + item.useTime = 25; + item.useAnimation = 25; + item.useStyle = 1; + item.knockBack = 3f; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.value = Item.buyPrice(0, 2, 0, 0); + item.rare = 2; + item.shoot = mod.ProjectileType("SnapClamProj"); + item.shootSpeed = 12f; + } + } +} diff --git a/Items/CalamityCustomThrowingDamage/SnapClam.png b/Items/CalamityCustomThrowingDamage/SnapClam.png new file mode 100644 index 0000000000..ce1dee8e7d Binary files /dev/null and b/Items/CalamityCustomThrowingDamage/SnapClam.png differ diff --git a/Items/CalamityCustomThrowingDamage/SpearofPaleolith.cs b/Items/CalamityCustomThrowingDamage/SpearofPaleolith.cs index ff0f770858..3861283e44 100644 --- a/Items/CalamityCustomThrowingDamage/SpearofPaleolith.cs +++ b/Items/CalamityCustomThrowingDamage/SpearofPaleolith.cs @@ -1,55 +1,55 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items; - -namespace CalamityMod.Items.CalamityCustomThrowingDamage -{ - public class SpearofPaleolith : CalamityDamageItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Spear of Paleolith"); - Tooltip.SetDefault("Throws an ancient spear that shatters enemy armor at high velocity\nSpears rain fossil shards as they travel"); - } - - public override void SafeSetDefaults() - { - item.width = 54; - item.damage = 50; - item.noMelee = true; - item.noUseGraphic = true; - item.useAnimation = 27; - item.useStyle = 1; - item.useTime = 27; - item.knockBack = 6f; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - item.height = 54; - item.value = Item.buyPrice(0, 36, 0, 0); - item.rare = 5; - item.shoot = mod.ProjectileType("SpearofPaleolith"); - item.shootSpeed = 35f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.AncientBattleArmorMaterial, 2); - recipe.AddIngredient(ItemID.AdamantiteBar, 4); - recipe.AddTile(TileID.Anvils); - recipe.SetResult(this); - recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.AncientBattleArmorMaterial, 2); - recipe.AddIngredient(ItemID.TitaniumBar, 4); - recipe.AddTile(TileID.Anvils); - recipe.SetResult(this); - recipe.AddRecipe(); - } - } -} +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.CalamityCustomThrowingDamage +{ + public class SpearofPaleolith : CalamityDamageItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Spear of Paleolith"); + Tooltip.SetDefault("Throws an ancient spear that shatters enemy armor at high velocity\nSpears rain fossil shards as they travel"); + } + + public override void SafeSetDefaults() + { + item.width = 54; + item.damage = 65; + item.noMelee = true; + item.noUseGraphic = true; + item.useAnimation = 27; + item.useStyle = 1; + item.useTime = 27; + item.knockBack = 6f; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.height = 54; + item.value = Item.buyPrice(0, 36, 0, 0); + item.rare = 5; + item.shoot = mod.ProjectileType("SpearofPaleolith"); + item.shootSpeed = 35f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.AncientBattleArmorMaterial, 2); + recipe.AddIngredient(ItemID.AdamantiteBar, 4); + recipe.AddTile(TileID.Anvils); + recipe.SetResult(this); + recipe.AddRecipe(); + recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.AncientBattleArmorMaterial, 2); + recipe.AddIngredient(ItemID.TitaniumBar, 4); + recipe.AddTile(TileID.Anvils); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/CalamityCustomThrowingDamage/StellarKnife.cs b/Items/CalamityCustomThrowingDamage/StellarKnife.cs new file mode 100644 index 0000000000..8b5e644799 --- /dev/null +++ b/Items/CalamityCustomThrowingDamage/StellarKnife.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.CalamityCustomThrowingDamage +{ + public class StellarKnife : CalamityDamageItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Stellar Knife"); + Tooltip.SetDefault("Throws knives that stop middair and then home into enemies\n" + + "Za Warudo"); + } + + public override void SafeSetDefaults() + { + item.width = 32; + item.height = 34; + item.damage = 60; + item.crit += 4; + item.noMelee = true; + item.noUseGraphic = true; + item.useAnimation = 8; + item.useStyle = 1; + item.useTime = 8; + item.knockBack = 4f; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.value = Item.buyPrice(0, 60, 0, 0); + item.rare = 7; + item.shoot = mod.ProjectileType("StellarKnife"); + item.shootSpeed = 10f; + item.GetGlobalItem(mod).rogue = true; + } + } +} diff --git a/Items/CalamityCustomThrowingDamage/StellarKnife.png b/Items/CalamityCustomThrowingDamage/StellarKnife.png new file mode 100644 index 0000000000..85c64dfe8c Binary files /dev/null and b/Items/CalamityCustomThrowingDamage/StellarKnife.png differ diff --git a/Items/CalamityCustomThrowingDamage/TarragonThrowingDart.cs b/Items/CalamityCustomThrowingDamage/TarragonThrowingDart.cs index 01603bf8d2..9010098d24 100644 --- a/Items/CalamityCustomThrowingDamage/TarragonThrowingDart.cs +++ b/Items/CalamityCustomThrowingDamage/TarragonThrowingDart.cs @@ -1,48 +1,50 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items; - -namespace CalamityMod.Items.CalamityCustomThrowingDamage -{ - public class TarragonThrowingDart : CalamityDamageItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Tarragon Throwing Dart"); - } - - public override void SafeSetDefaults() - { - item.width = 34; - item.damage = 230; - item.noMelee = true; - item.consumable = true; - item.noUseGraphic = true; - item.useAnimation = 11; - item.useStyle = 1; - item.useTime = 11; - item.knockBack = 4.5f; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - item.height = 34; - item.maxStack = 999; - item.value = 25000; - item.shoot = mod.ProjectileType("TarragonThrowingDartProjectile"); - item.shootSpeed = 24f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "UeliaceBar"); - recipe.AddTile(TileID.LunarCraftingStation); - recipe.SetResult(this, 100); - recipe.AddRecipe(); - } - } -} +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.CalamityCustomThrowingDamage +{ + public class TarragonThrowingDart : CalamityDamageItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Tarragon Throwing Dart"); + } + + public override void SafeSetDefaults() + { + item.width = 34; + item.damage = 380; + item.noMelee = true; + item.consumable = true; + item.noUseGraphic = true; + item.useAnimation = 11; + item.useStyle = 1; + item.useTime = 11; + item.knockBack = 4.5f; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.height = 34; + item.maxStack = 999; + item.value = 25000; + item.shoot = mod.ProjectileType("TarragonThrowingDartProjectile"); + item.shootSpeed = 24f; + item.GetGlobalItem(mod).rogue = true; + item.GetGlobalItem(mod).postMoonLordRarity = 12; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "UeliaceBar"); + recipe.AddTile(TileID.LunarCraftingStation); + recipe.SetResult(this, 100); + recipe.AddRecipe(); + } + } +} diff --git a/Items/CalamityCustomThrowingDamage/TitaniumShuriken.cs b/Items/CalamityCustomThrowingDamage/TitaniumShuriken.cs index 3d77ce19e2..1d5ef541eb 100644 --- a/Items/CalamityCustomThrowingDamage/TitaniumShuriken.cs +++ b/Items/CalamityCustomThrowingDamage/TitaniumShuriken.cs @@ -1,50 +1,50 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items; - -namespace CalamityMod.Items.CalamityCustomThrowingDamage -{ - public class TitaniumShuriken : CalamityDamageItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Titanium Shuriken"); - } - - public override void SafeSetDefaults() - { - item.width = 38; - item.damage = 31; - item.noMelee = true; - item.consumable = true; - item.noUseGraphic = true; - item.useAnimation = 9; - item.crit = 10; - item.useStyle = 1; - item.useTime = 9; - item.knockBack = 3f; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - item.height = 38; - item.maxStack = 999; - item.value = 2000; - item.rare = 4; - item.shoot = mod.ProjectileType("TitaniumShurikenProjectile"); - item.shootSpeed = 16f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.TitaniumBar); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(this, 30); - recipe.AddRecipe(); - } - } -} +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.CalamityCustomThrowingDamage +{ + public class TitaniumShuriken : CalamityDamageItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Titanium Shuriken"); + } + + public override void SafeSetDefaults() + { + item.width = 38; + item.damage = 31; + item.noMelee = true; + item.consumable = true; + item.noUseGraphic = true; + item.useAnimation = 9; + item.crit = 10; + item.useStyle = 1; + item.useTime = 9; + item.knockBack = 3f; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.height = 38; + item.maxStack = 999; + item.value = 2000; + item.rare = 4; + item.shoot = mod.ProjectileType("TitaniumShurikenProjectile"); + item.shootSpeed = 16f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.TitaniumBar); + recipe.AddTile(TileID.MythrilAnvil); + recipe.SetResult(this, 30); + recipe.AddRecipe(); + } + } +} diff --git a/Items/CalamityCustomThrowingDamage/ToothBall.cs b/Items/CalamityCustomThrowingDamage/ToothBall.cs index 53e35152d7..9c2a2a594b 100644 --- a/Items/CalamityCustomThrowingDamage/ToothBall.cs +++ b/Items/CalamityCustomThrowingDamage/ToothBall.cs @@ -1,52 +1,52 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items; - -namespace CalamityMod.Items.CalamityCustomThrowingDamage -{ - public class ToothBall : CalamityDamageItem - { +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.CalamityCustomThrowingDamage +{ + public class ToothBall : CalamityDamageItem + { public override void SetStaticDefaults() { DisplayName.SetDefault("Tooth Ball"); } - - public override void SafeSetDefaults() - { - item.width = 30; - item.damage = 20; - item.noMelee = true; - item.consumable = true; - item.noUseGraphic = true; - item.useAnimation = 13; - item.crit = 8; - item.useStyle = 1; - item.useTime = 13; - item.knockBack = 2.5f; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - item.height = 30; - item.maxStack = 999; - item.value = 1000; - item.rare = 3; - item.shoot = mod.ProjectileType("ToothBallProjectile"); - item.shootSpeed = 16f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "BloodSample"); - recipe.AddIngredient(ItemID.Vertebrae); - recipe.AddIngredient(ItemID.CrimtaneBar); - recipe.AddTile(TileID.DemonAltar); - recipe.SetResult(this, 100); - recipe.AddRecipe(); - } - } -} + + public override void SafeSetDefaults() + { + item.width = 30; + item.damage = 20; + item.noMelee = true; + item.consumable = true; + item.noUseGraphic = true; + item.useAnimation = 13; + item.crit = 8; + item.useStyle = 1; + item.useTime = 13; + item.knockBack = 2.5f; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.height = 30; + item.maxStack = 999; + item.value = 1000; + item.rare = 3; + item.shoot = mod.ProjectileType("ToothBallProjectile"); + item.shootSpeed = 16f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "BloodSample"); + recipe.AddIngredient(ItemID.Vertebrae); + recipe.AddIngredient(ItemID.CrimtaneBar); + recipe.AddTile(TileID.DemonAltar); + recipe.SetResult(this, 100); + recipe.AddRecipe(); + } + } +} diff --git a/Items/CalamityCustomThrowingDamage/TriactisTruePaladinianMageHammerofMight.cs b/Items/CalamityCustomThrowingDamage/TriactisTruePaladinianMageHammerofMight.cs index 11b35a2a56..51ee418b6a 100644 --- a/Items/CalamityCustomThrowingDamage/TriactisTruePaladinianMageHammerofMight.cs +++ b/Items/CalamityCustomThrowingDamage/TriactisTruePaladinianMageHammerofMight.cs @@ -1,49 +1,51 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items; - -namespace CalamityMod.Items.CalamityCustomThrowingDamage -{ - public class TriactisTruePaladinianMageHammerofMight : CalamityDamageItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Triactis' True Paladinian Mage-Hammer of Might"); - } - - public override void SafeSetDefaults() - { - item.width = 160; - item.damage = 5000; - item.noMelee = true; - item.noUseGraphic = true; - item.autoReuse = true; - item.useAnimation = 10; - item.useStyle = 1; - item.useTime = 10; - item.knockBack = 50f; - item.UseSound = SoundID.Item1; - item.height = 160; - item.value = Item.buyPrice(5, 0, 0, 0); - item.rare = 10; - item.shoot = mod.ProjectileType("TriactisOPHammer"); - item.shootSpeed = 25f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "TruePaladinsHammer"); - recipe.AddIngredient(ItemID.SoulofMight, 30); - recipe.AddIngredient(null, "ShadowspecBar", 5); - recipe.AddTile(null, "DraedonsForge"); - recipe.SetResult(this); - recipe.AddRecipe(); - } - } -} +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.CalamityCustomThrowingDamage +{ + public class TriactisTruePaladinianMageHammerofMight : CalamityDamageItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Triactis' True Paladinian Mage-Hammer of Might"); + } + + public override void SafeSetDefaults() + { + item.width = 160; + item.damage = 10000; + item.noMelee = true; + item.noUseGraphic = true; + item.autoReuse = true; + item.useAnimation = 10; + item.useStyle = 1; + item.useTime = 10; + item.knockBack = 50f; + item.UseSound = SoundID.Item1; + item.height = 160; + item.value = Item.buyPrice(5, 0, 0, 0); + item.rare = 10; + item.shoot = mod.ProjectileType("TriactisOPHammer"); + item.shootSpeed = 25f; + item.GetGlobalItem(mod).rogue = true; + item.GetGlobalItem(mod).postMoonLordRarity = 16; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "TruePaladinsHammer"); + recipe.AddIngredient(ItemID.SoulofMight, 30); + recipe.AddIngredient(null, "ShadowspecBar", 5); + recipe.AddTile(null, "DraedonsForge"); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/CalamityCustomThrowingDamage/TruePaladinsHammer.cs b/Items/CalamityCustomThrowingDamage/TruePaladinsHammer.cs index 6557f78c28..47b849ea31 100644 --- a/Items/CalamityCustomThrowingDamage/TruePaladinsHammer.cs +++ b/Items/CalamityCustomThrowingDamage/TruePaladinsHammer.cs @@ -1,50 +1,50 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items; - -namespace CalamityMod.Items.CalamityCustomThrowingDamage -{ - public class TruePaladinsHammer : CalamityDamageItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("True Paladin's Hammer"); - } - - public override void SafeSetDefaults() - { - item.width = 14; - item.damage = 180; - item.noMelee = true; - item.noUseGraphic = true; - item.autoReuse = true; - item.useAnimation = 13; - item.useStyle = 1; - item.useTime = 13; - item.knockBack = 20f; - item.UseSound = SoundID.Item1; - item.height = 28; - item.value = Item.buyPrice(0, 80, 0, 0); - item.rare = 8; - item.shoot = mod.ProjectileType("OPHammer"); - item.shootSpeed = 14f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.PaladinsHammer); - recipe.AddIngredient(null, "CalamityDust", 5); - recipe.AddIngredient(null, "CoreofChaos", 5); - recipe.AddIngredient(null, "CruptixBar", 5); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(this); - recipe.AddRecipe(); - } - } -} +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.CalamityCustomThrowingDamage +{ + public class TruePaladinsHammer : CalamityDamageItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("True Paladin's Hammer"); + } + + public override void SafeSetDefaults() + { + item.width = 14; + item.damage = 180; + item.noMelee = true; + item.noUseGraphic = true; + item.autoReuse = true; + item.useAnimation = 13; + item.useStyle = 1; + item.useTime = 13; + item.knockBack = 20f; + item.UseSound = SoundID.Item1; + item.height = 28; + item.value = Item.buyPrice(0, 80, 0, 0); + item.rare = 8; + item.shoot = mod.ProjectileType("OPHammer"); + item.shootSpeed = 14f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.PaladinsHammer); + recipe.AddIngredient(null, "CalamityDust", 5); + recipe.AddIngredient(null, "CoreofChaos", 5); + recipe.AddIngredient(null, "CruptixBar", 5); + recipe.AddTile(TileID.MythrilAnvil); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/CalamityCustomThrowingDamage/UrchinStinger.cs b/Items/CalamityCustomThrowingDamage/UrchinStinger.cs index 300fec2edf..94cdf62a89 100644 --- a/Items/CalamityCustomThrowingDamage/UrchinStinger.cs +++ b/Items/CalamityCustomThrowingDamage/UrchinStinger.cs @@ -1,40 +1,40 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items; - -namespace CalamityMod.Items.CalamityCustomThrowingDamage -{ - public class UrchinStinger : CalamityDamageItem - { +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.CalamityCustomThrowingDamage +{ + public class UrchinStinger : CalamityDamageItem + { public override void SetStaticDefaults() { DisplayName.SetDefault("Urchin Stinger"); } - public override void SafeSetDefaults() - { - item.width = 10; - item.damage = 15; - item.noMelee = true; - item.consumable = true; - item.noUseGraphic = true; - item.useAnimation = 14; - item.useStyle = 1; - item.useTime = 14; - item.knockBack = 1.5f; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - item.height = 26; - item.maxStack = 999; - item.value = 200; - item.rare = 1; - item.shoot = mod.ProjectileType("UrchinStinger"); - item.shootSpeed = 12f; - } - } -} + public override void SafeSetDefaults() + { + item.width = 10; + item.damage = 15; + item.noMelee = true; + item.consumable = true; + item.noUseGraphic = true; + item.useAnimation = 14; + item.useStyle = 1; + item.useTime = 14; + item.knockBack = 1.5f; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.height = 26; + item.maxStack = 999; + item.value = 200; + item.rare = 1; + item.shoot = mod.ProjectileType("UrchinStinger"); + item.shootSpeed = 12f; + } + } +} diff --git a/Items/CalamityCustomThrowingDamage/Valediction.cs b/Items/CalamityCustomThrowingDamage/Valediction.cs index 045ddf0e6f..6b5cbd1131 100644 --- a/Items/CalamityCustomThrowingDamage/Valediction.cs +++ b/Items/CalamityCustomThrowingDamage/Valediction.cs @@ -1,38 +1,40 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.CalamityCustomThrowingDamage -{ - public class Valediction : CalamityDamageItem - { +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.CalamityCustomThrowingDamage +{ + public class Valediction : CalamityDamageItem + { public override void SetStaticDefaults() { DisplayName.SetDefault("Valediction"); Tooltip.SetDefault("Throws a homing reaper scythe"); } - public override void SafeSetDefaults() - { - item.width = 80; - item.damage = 405; - item.noMelee = true; - item.noUseGraphic = true; - item.useAnimation = 15; - item.useTime = 15; - item.useStyle = 1; - item.knockBack = 7f; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - item.height = 64; - item.value = Item.buyPrice(1, 40, 0, 0); - item.rare = 10; - item.shoot = mod.ProjectileType("Valediction"); - item.shootSpeed = 20f; - } - } -} + public override void SafeSetDefaults() + { + item.width = 80; + item.damage = 405; + item.noMelee = true; + item.noUseGraphic = true; + item.useAnimation = 15; + item.useTime = 15; + item.useStyle = 1; + item.knockBack = 7f; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.height = 64; + item.value = Item.buyPrice(1, 40, 0, 0); + item.rare = 10; + item.shoot = mod.ProjectileType("Valediction"); + item.shootSpeed = 20f; + item.GetGlobalItem(mod).rogue = true; + item.GetGlobalItem(mod).postMoonLordRarity = 13; + } + } +} diff --git a/Items/CalamityCustomThrowingDamage/WulfrumKnife.cs b/Items/CalamityCustomThrowingDamage/WulfrumKnife.cs index 86cc8dae2d..3c81fc04fe 100644 --- a/Items/CalamityCustomThrowingDamage/WulfrumKnife.cs +++ b/Items/CalamityCustomThrowingDamage/WulfrumKnife.cs @@ -1,49 +1,49 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items; - -namespace CalamityMod.Items.CalamityCustomThrowingDamage -{ - public class WulfrumKnife : CalamityDamageItem - { +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.CalamityCustomThrowingDamage +{ + public class WulfrumKnife : CalamityDamageItem + { public override void SetStaticDefaults() { DisplayName.SetDefault("Wulfrum Knife"); } - public override void SafeSetDefaults() - { - item.width = 22; - item.damage = 8; - item.noMelee = true; - item.consumable = true; - item.noUseGraphic = true; - item.useAnimation = 15; - item.useStyle = 1; - item.useTime = 15; - item.knockBack = 1f; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - item.height = 38; - item.maxStack = 999; - item.value = 100; - item.rare = 1; - item.shoot = mod.ProjectileType("WulfrumKnife"); - item.shootSpeed = 12f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "WulfrumShard"); - recipe.AddTile(TileID.Anvils); - recipe.SetResult(this, 50); - recipe.AddRecipe(); - } - } -} + public override void SafeSetDefaults() + { + item.width = 22; + item.damage = 8; + item.noMelee = true; + item.consumable = true; + item.noUseGraphic = true; + item.useAnimation = 15; + item.useStyle = 1; + item.useTime = 15; + item.knockBack = 1f; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.height = 38; + item.maxStack = 999; + item.value = 100; + item.rare = 1; + item.shoot = mod.ProjectileType("WulfrumKnife"); + item.shootSpeed = 12f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "WulfrumShard"); + recipe.AddTile(TileID.Anvils); + recipe.SetResult(this, 50); + recipe.AddRecipe(); + } + } +} diff --git a/Items/CalamityCustomThrowingDamage/XerocPitchfork.cs b/Items/CalamityCustomThrowingDamage/XerocPitchfork.cs index 34775f5fd2..af4593cd9e 100644 --- a/Items/CalamityCustomThrowingDamage/XerocPitchfork.cs +++ b/Items/CalamityCustomThrowingDamage/XerocPitchfork.cs @@ -1,49 +1,49 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items; - -namespace CalamityMod.Items.CalamityCustomThrowingDamage -{ - public class XerocPitchfork : CalamityDamageItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Xeroc Pitchfork"); - } - - public override void SafeSetDefaults() - { - item.width = 48; - item.damage = 180; - item.noMelee = true; - item.consumable = true; - item.noUseGraphic = true; - item.useAnimation = 19; - item.useStyle = 1; - item.useTime = 19; - item.knockBack = 8f; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - item.height = 48; - item.maxStack = 999; - item.value = 10000; - item.rare = 9; - item.shoot = mod.ProjectileType("XerocPitchforkProjectile"); - item.shootSpeed = 16f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "MeldiateBar"); - recipe.AddTile(TileID.LunarCraftingStation); - recipe.SetResult(this, 20); - recipe.AddRecipe(); - } - } -} +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.CalamityCustomThrowingDamage +{ + public class XerocPitchfork : CalamityDamageItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Xeroc Pitchfork"); + } + + public override void SafeSetDefaults() + { + item.width = 48; + item.damage = 180; + item.noMelee = true; + item.consumable = true; + item.noUseGraphic = true; + item.useAnimation = 19; + item.useStyle = 1; + item.useTime = 19; + item.knockBack = 8f; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.height = 48; + item.maxStack = 999; + item.value = 10000; + item.rare = 9; + item.shoot = mod.ProjectileType("XerocPitchforkProjectile"); + item.shootSpeed = 16f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "MeldiateBar"); + recipe.AddTile(TileID.LunarCraftingStation); + recipe.SetResult(this, 20); + recipe.AddRecipe(); + } + } +} diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index 77edda95fd..0ef21e89a9 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.IO; +using System.Linq; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -17,1082 +18,1734 @@ namespace CalamityMod.Items { public class CalamityGlobalItem : GlobalItem { - public override void SetDefaults(Item item) - { - if (item.maxStack == 99 || item.type == ItemID.Dynamite || item.type == ItemID.StickyDynamite || - item.type == ItemID.BouncyDynamite || item.type == ItemID.StickyBomb || item.type == ItemID.BouncyBomb) - item.maxStack = 999; + #region Instances + public override bool InstancePerEntity + { + get + { + return true; + } + } - if (item.type >= ItemID.GreenSolution && item.type <= ItemID.RedSolution) - item.value = Item.buyPrice(0, 0, 5, 0); + public override bool CloneNewInstances + { + get + { + return true; + } + } + #endregion - if (CalamityMod.weaponAutoreuseList.Contains(item.type)) - item.autoReuse = true; + public bool rogue = false; - if (item.type == ItemID.PsychoKnife) - item.damage *= 4; - else if (CalamityMod.doubleDamageBuffList.Contains(item.type)) - item.damage *= 2; - else if (CalamityMod.sixtySixDamageBuffList.Contains(item.type)) - item.damage = (int)((double)item.damage * 1.66); - else if (CalamityMod.fiftyDamageBuffList.Contains(item.type)) - item.damage = (int)((double)item.damage * 1.5); - else if (CalamityMod.thirtyThreeDamageBuffList.Contains(item.type)) - item.damage = (int)((double)item.damage * 1.33); - else if (CalamityMod.twentyFiveDamageBuffList.Contains(item.type)) - item.damage = (int)((double)item.damage * 1.25); - else if (CalamityMod.twentyDamageBuffList.Contains(item.type)) - item.damage = (int)((double)item.damage * 1.2); - else if (item.type == ItemID.Frostbrand || item.type == ItemID.MagnetSphere) - item.damage = (int)((double)item.damage * 1.1); - else if (item.type == ItemID.Razorpine) - item.damage = (int)((double)item.damage * 0.95); - else if (CalamityMod.quarterDamageNerfList.Contains(item.type)) - item.damage = (int)((double)item.damage * 0.75); + public int postMoonLordRarity = 0; - if (item.type == ItemID.BookStaff) - item.mana = 10; - else if (item.type == ItemID.UnholyTrident) - item.mana = 14; - else if (item.type == ItemID.FrostStaff) - item.mana = 9; - else if (item.type == ItemID.BookofSkulls) - item.mana = 12; - else if (item.type == ItemID.BlizzardStaff) - item.mana = 7; - else if (item.type == ItemID.SolarFlareHelmet) //total defense pre-buff = 78 post-buff = 94 - item.defense = 29; //5 more defense - else if (item.type == ItemID.SolarFlareBreastplate) - item.defense = 41; //7 more defense - else if (item.type == ItemID.SolarFlareLeggings) - item.defense = 24; //4 more defense - else if (item.type == ItemID.GladiatorHelmet) //total defense pre-buff = 7 post-buff = 21 - item.defense = 4; //2 more defense - else if (item.type == ItemID.GladiatorBreastplate) - item.defense = 7; //4 more defense - else if (item.type == ItemID.GladiatorLeggings) - item.defense = 5; //3 more defense - else if (item.type == ItemID.HallowedPlateMail) //total defense pre-buff = 31, 50, 35 post-buff = 36, 55, 40 - item.defense = 18; //3 more defense - else if (item.type == ItemID.HallowedGreaves) - item.defense = 13; //2 more defense - } + #region SetDefaults + public override void SetDefaults(Item item) + { + if (postMoonLordRarity != 0 && item.rare != 10) + item.rare = 10; - public override bool OnPickup(Item item, Player player) - { - if (item.type == ItemID.Heart || item.type == ItemID.CandyApple || item.type == ItemID.CandyCane) - { - if (NPC.AnyNPCs(mod.NPCType("SupremeCalamitas"))) - { - player.statLife -= 10; - if (Main.myPlayer == player.whoAmI) - { - player.HealEffect(-10, true); - } - } - } - return true; - } + if (item.maxStack == 99 || item.type == ItemID.Dynamite || item.type == ItemID.StickyDynamite || + item.type == ItemID.BouncyDynamite || item.type == ItemID.StickyBomb || item.type == ItemID.BouncyBomb) + item.maxStack = 999; - public override bool CanUseItem(Item item, Player player) - { - CalamityPlayer modPlayer = player.GetModPlayer(mod); - if (item.type == ItemID.MonkStaffT1) - { - for (int i = 0; i < 1000; ++i) - { - if (Main.projectile[i].active && Main.projectile[i].owner == Main.myPlayer && Main.projectile[i].type == item.shoot) - { - return false; - } - } - return true; - } - if (item.type == ItemID.SpaceGun && player.spaceGun) - { - if (player.statMana >= (int)((float)3 * player.manaCost)) - { - player.manaRegenDelay = (int)player.maxRegenDelay; - player.statMana -= (int)((float)3 * player.manaCost); - } - else if (player.manaFlower) - { - player.QuickMana(); - if (player.statMana >= (int)((float)3 * player.manaCost)) - { - player.manaRegenDelay = (int)player.maxRegenDelay; - player.statMana -= (int)((float)3 * player.manaCost); - } - else - { - return false; - } - } - else - { - return false; - } - return true; - } - if ((item.type == ItemID.SuperAbsorbantSponge || item.type == ItemID.EmptyBucket) && modPlayer.ZoneAbyss) - { - return false; - } - if (item.type == ItemID.MagicMirror || item.type == ItemID.IceMirror || item.type == ItemID.CellPhone || item.type == ItemID.RecallPotion) - { - return !NPC.AnyNPCs(mod.NPCType("SupremeCalamitas")); - } - if (item.type == ItemID.RodofDiscord && modPlayer.scarfCooldown) - { - player.AddBuff(BuffID.ChaosState, 720); - } - return true; - } + if (item.type >= ItemID.GreenSolution && item.type <= ItemID.RedSolution) + item.value = Item.buyPrice(0, 0, 5, 0); - public override void ModifyTooltips(Item item, List tooltips) - { - if (item.type == ItemID.SuperAbsorbantSponge) - { - foreach (TooltipLine line2 in tooltips) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip0") - { - line2.text = "Capable of soaking up an endless amount of water\n" + - "Cannot be used in the Abyss"; - } - } - } - if (item.type == ItemID.EmptyBucket) - { - foreach (TooltipLine line2 in tooltips) - { - if (line2.mod == "Terraria" && line2.Name == "Defense") - { - line2.text = "1 defense\n" + - "Cannot be used in the Abyss"; - } - } - } - if (item.type == ItemID.CrimsonHeart) - { - foreach (TooltipLine line2 in tooltips) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip0") - { - line2.text = "Summons a heart to provide light\n" + - "Provides a small amount of light in the abyss"; - } - } - } - if (item.type == ItemID.ShadowOrb) - { - foreach (TooltipLine line2 in tooltips) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip0") - { - line2.text = "Creates a magical shadow orb\n" + - "Provides a small amount of light in the abyss"; - } - } - } - if (item.type == ItemID.MagicLantern) - { - foreach (TooltipLine line2 in tooltips) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip0") - { - line2.text = "Summons a magic lantern that exposes nearby treasure\n" + - "Provides a small amount of light in the abyss"; - } - } - } - if (item.type == ItemID.ArcticDivingGear) - { - foreach (TooltipLine line2 in tooltips) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip1") - { - line2.text = "Provides light under water and extra mobility on ice\n" + - "Provides a small amount of light in the abyss\n" + - "Moderately reduces breath loss in the abyss"; - } - } - } - if (item.type == ItemID.JellyfishNecklace) - { - foreach (TooltipLine line2 in tooltips) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip0") - { - line2.text = "Provides light under water\n" + - "Provides a small amount of light in the abyss"; - } - } - } - if (item.type == ItemID.JellyfishDivingGear) - { - foreach (TooltipLine line2 in tooltips) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip1") - { - line2.text = "Provides light under water\n" + - "Provides a small amount of light in the abyss"; - } - } - } - if (item.type == ItemID.FairyBell) - { - foreach (TooltipLine line2 in tooltips) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip0") - { - line2.text = "Summons a magical fairy\n" + - "Provides a moderate amount of light in the abyss"; - } - } - } - if (item.type == ItemID.DD2PetGhost) - { - foreach (TooltipLine line2 in tooltips) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip0") - { - line2.text = "Summons a pet flickerwick to provide light\n" + - "Provides a moderate amount of light in the abyss"; - } - } - } - if (item.type == ItemID.ShinePotion) - { - foreach (TooltipLine line2 in tooltips) - { - if (line2.mod == "Terraria" && line2.Name == "BuffTime") - { - line2.text = "5 minute duration\n" + - "Provides a moderate amount of light in the abyss"; - } - } - } - if (item.type == ItemID.WispinaBottle) - { - foreach (TooltipLine line2 in tooltips) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip0") - { - line2.text = "Summons a Wisp to provide light\n" + - "Provides a large amount of light in the abyss"; - } - } - } - if (item.type == ItemID.SuspiciousLookingTentacle) - { - foreach (TooltipLine line2 in tooltips) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip1") - { - line2.text = "'I know what you're thinking...'\n" + - "Provides a large amount of light in the abyss"; - } - } - } - if (item.type == ItemID.GillsPotion) - { - foreach (TooltipLine line2 in tooltips) - { - if (line2.mod == "Terraria" && line2.Name == "BuffTime") - { - line2.text = "2 minute duration\n" + - "Greatly reduces breath loss in the abyss"; - } - } - } - if (item.type == ItemID.DivingHelmet) - { - foreach (TooltipLine line2 in tooltips) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip0") - { - line2.text = "Greatly extends underwater breathing\n" + - "Moderately reduces breath loss in the abyss"; - } - } - } - if (item.type == ItemID.NeptunesShell) - { - foreach (TooltipLine line2 in tooltips) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip0") - { - line2.text = "Transforms the holder into merfolk when entering water\n" + - "Greatly reduces breath loss in the abyss"; - } - } - } - if (item.type == ItemID.MoonShell) - { - foreach (TooltipLine line2 in tooltips) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip0") - { - line2.text = "Turns the holder into a werewolf at night and a merfolk when entering water\n" + - "Greatly reduces breath loss in the abyss"; - } - } - } - if (item.type == ItemID.CelestialShell) - { - foreach (TooltipLine line2 in tooltips) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip1") - { - line2.text = "Minor increases to all stats\n" + - "Greatly reduces breath loss in the abyss"; - } - } - } - if (item.type == ItemID.WormScarf) - { - foreach (TooltipLine line2 in tooltips) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip0") - { - line2.text = "Reduces damage taken by 10%"; - } - } - } - if (item.type == ItemID.SpectreHood) - { - foreach (TooltipLine line2 in tooltips) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip0") - { - line2.text = "20% decreased magic damage"; - } - } - } - if (item.type == ItemID.MeteorHelmet || item.type == ItemID.MeteorSuit || item.type == ItemID.MeteorLeggings) - { - foreach (TooltipLine line2 in tooltips) - { - if (line2.mod == "Terraria" && line2.Name == "SetBonus") - { - line2.text = "Set Bonus: Reduces the mana cost of the Space Gun by 50%"; - } - } - } - if (item.type == ItemID.CopperHelmet || item.type == ItemID.CopperChainmail || item.type == ItemID.CopperGreaves) - { - foreach (TooltipLine line2 in tooltips) - { - if (line2.mod == "Terraria" && line2.Name == "SetBonus") - { - line2.text = "Set Bonus: +2 defense and 15% increased mining speed"; - } - } - } - if (item.type == ItemID.TinHelmet || item.type == ItemID.TinChainmail || item.type == ItemID.TinGreaves) - { - foreach (TooltipLine line2 in tooltips) - { - if (line2.mod == "Terraria" && line2.Name == "SetBonus") - { - line2.text = "Set Bonus: +2 defense and 10% increased mining speed"; - } - } - } - if (item.type == ItemID.IronHelmet || item.type == ItemID.IronChainmail || item.type == ItemID.IronGreaves) - { - foreach (TooltipLine line2 in tooltips) - { - if (line2.mod == "Terraria" && line2.Name == "SetBonus") - { - line2.text = "Set Bonus: +2 defense and 25% increased mining speed"; - } - } - } - if (item.type == ItemID.LeadHelmet || item.type == ItemID.LeadChainmail || item.type == ItemID.LeadGreaves) - { - foreach (TooltipLine line2 in tooltips) - { - if (line2.mod == "Terraria" && line2.Name == "SetBonus") - { - line2.text = "Set Bonus: +3 defense and 20% increased mining speed"; - } - } - } - if (item.type == ItemID.SilverHelmet || item.type == ItemID.SilverChainmail || item.type == ItemID.SilverGreaves) - { - foreach (TooltipLine line2 in tooltips) - { - if (line2.mod == "Terraria" && line2.Name == "SetBonus") - { - line2.text = "Set Bonus: +3 defense and 35% increased mining speed"; - } - } - } - if (item.type == ItemID.TungstenHelmet || item.type == ItemID.TungstenChainmail || item.type == ItemID.TungstenGreaves) - { - foreach (TooltipLine line2 in tooltips) - { - if (line2.mod == "Terraria" && line2.Name == "SetBonus") - { - line2.text = "Set Bonus: +3 defense and 30% increased mining speed"; - } - } - } - if (item.type == ItemID.GoldHelmet || item.type == ItemID.GoldChainmail || item.type == ItemID.GoldGreaves) - { - foreach (TooltipLine line2 in tooltips) - { - if (line2.mod == "Terraria" && line2.Name == "SetBonus") - { - line2.text = "Set Bonus: +3 defense and 45% increased mining speed"; - } - } - } - if (item.type == ItemID.PlatinumHelmet || item.type == ItemID.PlatinumChainmail || item.type == ItemID.PlatinumGreaves) - { - foreach (TooltipLine line2 in tooltips) - { - if (line2.mod == "Terraria" && line2.Name == "SetBonus") - { - line2.text = "Set Bonus: +4 defense and 40% increased mining speed"; - } - } - } - if (item.type == ItemID.GladiatorHelmet) - { - foreach (TooltipLine line2 in tooltips) - { - if (line2.mod == "Terraria" && line2.Name == "Defense") - { - line2.text = "4 defense\n" + - "5% increased rogue damage"; - } - } - } - if (item.type == ItemID.GladiatorBreastplate) - { - foreach (TooltipLine line2 in tooltips) - { - if (line2.mod == "Terraria" && line2.Name == "Defense") - { - line2.text = "7 defense\n" + - "5% increased rogue critical strike chance"; - } - } - } - if (item.type == ItemID.GladiatorLeggings) - { - foreach (TooltipLine line2 in tooltips) - { - if (line2.mod == "Terraria" && line2.Name == "Defense") - { - line2.text = "5 defense\n" + - "5% increased rogue velocity"; - } - } - } - if (item.type == ItemID.ObsidianHelm) - { - foreach (TooltipLine line2 in tooltips) - { - if (line2.mod == "Terraria" && line2.Name == "Defense") - { - line2.text = "4 defense\n" + - "5% increased rogue damage"; - } - } - } - if (item.type == ItemID.ObsidianShirt) - { - foreach (TooltipLine line2 in tooltips) - { - if (line2.mod == "Terraria" && line2.Name == "Defense") - { - line2.text = "5 defense\n" + - "5% increased rogue critical strike chance"; - } - } - } - if (item.type == ItemID.ObsidianPants) - { - foreach (TooltipLine line2 in tooltips) - { - if (line2.mod == "Terraria" && line2.Name == "Defense") - { - line2.text = "4 defense\n" + - "5% increased rogue velocity"; - } - } - } - if (item.type == ItemID.MagicQuiver) - { - foreach (TooltipLine line2 in tooltips) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip0") - { - line2.text = "Increases arrow damage by 10% and greatly increases arrow speed"; - } - } - } - if (item.type == ItemID.AngelWings || item.type == ItemID.DemonWings) - { - foreach (TooltipLine line2 in tooltips) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip0") - { - line2.text = "Allows flight and slow fall\n" + - "Horizontal speed: 6.25\n" + - "Acceleration multiplier: 1\n" + - "Average vertical speed\n" + - "Flight time: 100"; - } - } - } - if (item.type == ItemID.Jetpack) - { - foreach (TooltipLine line2 in tooltips) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip0") - { - line2.text = "Allows flight and slow fall\n" + - "Horizontal speed: 6.5\n" + - "Acceleration multiplier: 1\n" + - "Average vertical speed\n" + - "Flight time: 115"; - } - } - } - if (item.type == ItemID.ButterflyWings || item.type == ItemID.FairyWings || item.type == ItemID.BeeWings) - { - foreach (TooltipLine line2 in tooltips) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip0") - { - line2.text = "Allows flight and slow fall\n" + - "Horizontal speed: 6.75\n" + - "Acceleration multiplier: 1\n" + - "Average vertical speed\n" + - "Flight time: 130"; - } - } - } - if (item.type == ItemID.HarpyWings || item.type == ItemID.BoneWings) - { - foreach (TooltipLine line2 in tooltips) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip0") - { - line2.text = "Allows flight and slow fall\n" + - "Horizontal speed: 7\n" + - "Acceleration multiplier: 1\n" + - "Average vertical speed\n" + - "Flight time: 140"; - } - } - } - if (item.type == ItemID.FlameWings || item.type == ItemID.FrozenWings || item.type == ItemID.GhostWings || - item.type == ItemID.BeetleWings) - { - foreach (TooltipLine line2 in tooltips) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip0") - { - line2.text = "Allows flight and slow fall\n" + - "Horizontal speed: 7.5\n" + - "Acceleration multiplier: 1\n" + - "Average vertical speed\n" + - "Flight time: 160"; - } - } - } - if (item.type == ItemID.FinWings) - { - foreach (TooltipLine line2 in tooltips) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip0") - { - line2.text = "Allows flight and slow fall\n" + - "Horizontal speed: 0\n" + - "Acceleration multiplier: 0\n" + - "Average vertical speed\n" + - "Flight time: 100"; - } - } - } - if (item.type == ItemID.FishronWings) - { - foreach (TooltipLine line2 in tooltips) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip0") - { - line2.text = "Allows flight and slow fall\n" + - "Horizontal speed: 8\n" + - "Acceleration multiplier: 2\n" + - "Good vertical speed\n" + - "Flight time: 180"; - } - } - } - if (item.type == ItemID.SteampunkWings) - { - foreach (TooltipLine line2 in tooltips) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip0") - { - line2.text = "Allows flight and slow fall\n" + - "Horizontal speed: 7.75\n" + - "Acceleration multiplier: 1\n" + - "Average vertical speed\n" + - "Flight time: 180"; - } - } - } - if (item.type == ItemID.LeafWings) - { - foreach (TooltipLine line2 in tooltips) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip0") - { - line2.text = "Allows flight and slow fall\n" + - "Horizontal speed: 6.75\n" + - "Acceleration multiplier: 1\n" + - "Average vertical speed\n" + - "Flight time: 160"; - } - } - } - if (item.type == ItemID.BatWings) - { - foreach (TooltipLine line2 in tooltips) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip0") - { - line2.text = "Allows flight and slow fall\n" + - "Horizontal speed: 0\n" + - "Acceleration multiplier: 0\n" + - "Average vertical speed\n" + - "Flight time: 140"; - } - } - } - if (item.type == ItemID.Yoraiz0rWings || item.type == ItemID.JimsWings || item.type == ItemID.SkiphsWings || - item.type == ItemID.LokisWings || item.type == ItemID.ArkhalisWings || item.type == ItemID.LeinforsWings || - item.type == ItemID.BejeweledValkyrieWing || item.type == ItemID.RedsWings || item.type == ItemID.DTownsWings || - item.type == ItemID.WillsWings || item.type == ItemID.CrownosWings || item.type == ItemID.CenxsWings) - { - foreach (TooltipLine line2 in tooltips) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip0") - { - line2.text = "'Great for impersonating devs!'\n" + - "Horizontal speed: 7\n" + - "Acceleration multiplier: 1\n" + - "Average vertical speed\n" + - "Flight time: 150"; - } - } - } - if (item.type == ItemID.TatteredFairyWings || item.type == ItemID.SpookyWings) - { - foreach (TooltipLine line2 in tooltips) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip0") - { - line2.text = "Allows flight and slow fall\n" + - "Horizontal speed: 7.5\n" + - "Acceleration multiplier: 1\n" + - "Average vertical speed\n" + - "Flight time: 180"; - } - } - } - if (item.type == ItemID.Hoverboard) - { - foreach (TooltipLine line2 in tooltips) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip0") - { - line2.text = "Allows flight and slow fall\n" + - "Horizontal speed: 6.25\n" + - "Acceleration multiplier: 1\n" + - "Average vertical speed\n" + - "Flight time: 170"; - } - } - } - if (item.type == ItemID.FestiveWings) - { - foreach (TooltipLine line2 in tooltips) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip0") - { - line2.text = "Allows flight and slow fall\n" + - "Horizontal speed: 7.5\n" + - "Acceleration multiplier: 1\n" + - "Average vertical speed\n" + - "Flight time: 170"; - } - } - } - if (item.type == ItemID.MothronWings) - { - foreach (TooltipLine line2 in tooltips) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip0") - { - line2.text = "Allows flight and slow fall\n" + - "Horizontal speed: 0\n" + - "Acceleration multiplier: 0\n" + - "Average vertical speed\n" + - "Flight time: 160"; - } - } - } - if (item.type == ItemID.WingsSolar || item.type == ItemID.WingsStardust) - { - foreach (TooltipLine line2 in tooltips) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip0") - { - line2.text = "Allows flight and slow fall\n" + - "Horizontal speed: 9\n" + - "Acceleration multiplier: 2.5\n" + - "Great vertical speed\n" + - "Flight time: 180"; - } - } - } - if (item.type == ItemID.WingsVortex || item.type == ItemID.WingsNebula) - { - foreach (TooltipLine line2 in tooltips) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip0") - { - line2.text = "Allows flight and slow fall\n" + - "Horizontal speed: 6.5\n" + - "Acceleration multiplier: 1.5\n" + - "Good vertical speed\n" + - "Flight time: 160"; - } - } - } - if (item.type == ItemID.BetsyWings) - { - foreach (TooltipLine line2 in tooltips) - { - if (line2.mod == "Terraria" && line2.Name == "Equipable") - { - line2.text = "Equipable\n" + - "Allows flight and slow fall\n" + - "Horizontal speed: 6\n" + - "Acceleration multiplier: 2.5\n" + - "Good vertical speed\n" + - "Flight time: 150"; - } - } - } - if (item.accessory) - { - if (item.prefix == 67) - { - foreach (TooltipLine line2 in tooltips) - { - if (line2.mod == "Terraria" && line2.Name == "PrefixAccCritChance") - { - line2.text = "+1% critical strike chance"; - } - } - } - if (item.prefix == 68) - { - foreach (TooltipLine line2 in tooltips) - { - if (line2.mod == "Terraria" && line2.Name == "PrefixAccCritChance") - { - line2.text = "+2% critical strike chance"; - } - } - } - if (item.prefix == 62) - { - foreach (TooltipLine line2 in tooltips) - { - if (line2.mod == "Terraria" && line2.Name == "PrefixAccDefense") - { - line2.text = "+1 defense\n" + - "+0.25% damage reduction"; - } - } - } - if (item.prefix == 63) - { - foreach (TooltipLine line2 in tooltips) - { - if (line2.mod == "Terraria" && line2.Name == "PrefixAccDefense") - { - line2.text = "+2 defense\n" + - "+0.5% damage reduction"; - } - } - } - if (item.prefix == 64) - { - foreach (TooltipLine line2 in tooltips) - { - if (line2.mod == "Terraria" && line2.Name == "PrefixAccDefense") - { - line2.text = "+3 defense\n" + - "+0.75% damage reduction"; - } - } - } - if (item.prefix == 65) - { - foreach (TooltipLine line2 in tooltips) - { - if (line2.mod == "Terraria" && line2.Name == "PrefixAccDefense") - { - line2.text = "+4 defense\n" + - "+1% damage reduction"; - } - } - } - } - } + if (CalamityMod.weaponAutoreuseList.Contains(item.type)) + item.autoReuse = true; - public override string IsArmorSet(Item head, Item body, Item legs) - { - if (head.type == ItemID.CopperHelmet && body.type == ItemID.CopperChainmail && legs.type == ItemID.CopperGreaves) - return "Copper"; - if (head.type == ItemID.TinHelmet && body.type == ItemID.TinChainmail && legs.type == ItemID.TinGreaves) - return "Tin"; - if (head.type == ItemID.IronHelmet && body.type == ItemID.IronChainmail && legs.type == ItemID.IronGreaves) - return "Iron"; - if (head.type == ItemID.LeadHelmet && body.type == ItemID.LeadChainmail && legs.type == ItemID.LeadGreaves) - return "Lead"; - if (head.type == ItemID.SilverHelmet && body.type == ItemID.SilverChainmail && legs.type == ItemID.SilverGreaves) - return "Silver"; - if (head.type == ItemID.TungstenHelmet && body.type == ItemID.TungstenChainmail && legs.type == ItemID.TungstenGreaves) - return "Tungsten"; - if (head.type == ItemID.GoldHelmet && body.type == ItemID.GoldChainmail && legs.type == ItemID.GoldGreaves) - return "Gold"; - if (head.type == ItemID.PlatinumHelmet && body.type == ItemID.PlatinumChainmail && legs.type == ItemID.PlatinumGreaves) - return "Platinum"; - if (head.type == ItemID.GladiatorHelmet && body.type == ItemID.GladiatorBreastplate && legs.type == ItemID.GladiatorLeggings) - return "Gladiator"; - if (head.type == ItemID.ObsidianHelm && body.type == ItemID.ObsidianShirt && legs.type == ItemID.ObsidianPants) - return "Obsidian"; - if (head.type == ItemID.PumpkinHelmet && body.type == ItemID.PumpkinBreastplate && legs.type == ItemID.PumpkinLeggings) - return "PumpMyAssFull"; - return ""; - } + if (item.type == ItemID.PsychoKnife) + item.damage *= 4; + else if (CalamityMod.doubleDamageBuffList.Contains(item.type)) + item.damage *= 2; + else if (CalamityMod.sixtySixDamageBuffList.Contains(item.type)) + item.damage = (int)((double)item.damage * 1.66); + else if (CalamityMod.fiftyDamageBuffList.Contains(item.type)) + item.damage = (int)((double)item.damage * 1.5); + else if (CalamityMod.thirtyThreeDamageBuffList.Contains(item.type)) + item.damage = (int)((double)item.damage * 1.33); + else if (CalamityMod.twentyFiveDamageBuffList.Contains(item.type)) + item.damage = (int)((double)item.damage * 1.25); + else if (CalamityMod.twentyDamageBuffList.Contains(item.type)) + item.damage = (int)((double)item.damage * 1.2); + else if (item.type == ItemID.Frostbrand || item.type == ItemID.MagnetSphere) + item.damage = (int)((double)item.damage * 1.1); + else if (item.type == ItemID.Razorpine) + item.damage = (int)((double)item.damage * 0.95); + else if (item.type == ItemID.LastPrism) + item.damage = (int)((double)item.damage * 0.85); + else if (CalamityMod.quarterDamageNerfList.Contains(item.type)) + item.damage = (int)((double)item.damage * 0.75); - public override void UpdateArmorSet(Player player, string set) - { - if (set == "Copper") - player.pickSpeed -= 0.15f; - else if (set == "Tin") - player.pickSpeed -= 0.1f; - else if (set == "Iron") - player.pickSpeed -= 0.25f; - else if (set == "Lead") - player.pickSpeed -= 0.2f; - else if (set == "Silver") - player.pickSpeed -= 0.35f; - else if (set == "Tungsten") - player.pickSpeed -= 0.3f; - else if (set == "Gold") - player.pickSpeed -= 0.45f; - else if (set == "Platinum") - player.pickSpeed -= 0.4f; - else if (set == "Gladiator") - { - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.1f; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingVelocity += 0.1f; - player.statDefense += 5; - player.setBonus = "+5 defense\n" + - "10% increased rogue damage and velocity"; - } - else if (set == "Obsidian") - { - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.1f; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 10; - player.statDefense += 3; - player.fireWalk = true; - player.lavaMax += 300; - player.setBonus = "+3 defense\n" + - "10% increased rogue damage and critical strike chance\n" + - "Grants immunity to fire blocks and temporary immunity to lava"; - } - else if (set == "PumpMyAssFull") - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.1f; - } + if (item.type == ItemID.BookStaff) + item.mana = 10; + else if (item.type == ItemID.UnholyTrident) + item.mana = 14; + else if (item.type == ItemID.FrostStaff) + item.mana = 9; + else if (item.type == ItemID.BookofSkulls) + item.mana = 12; + else if (item.type == ItemID.BlizzardStaff) + item.mana = 7; + else if (item.type == ItemID.SolarFlareHelmet) //total defense pre-buff = 78 post-buff = 94 + item.defense = 29; //5 more defense + else if (item.type == ItemID.SolarFlareBreastplate) + item.defense = 41; //7 more defense + else if (item.type == ItemID.SolarFlareLeggings) + item.defense = 24; //4 more defense + else if (item.type == ItemID.GladiatorHelmet) //total defense pre-buff = 7 post-buff = 21 + item.defense = 4; //2 more defense + else if (item.type == ItemID.GladiatorBreastplate) + item.defense = 7; //4 more defense + else if (item.type == ItemID.GladiatorLeggings) + item.defense = 5; //3 more defense + else if (item.type == ItemID.HallowedPlateMail) //total defense pre-buff = 31, 50, 35 post-buff = 36, 55, 40 + item.defense = 18; //3 more defense + else if (item.type == ItemID.HallowedGreaves) + item.defense = 13; //2 more defense + } + #endregion - public override void UpdateEquip(Item item, Player player) - { - if (item.type == ItemID.SpectreHood) - player.magicDamage += 0.2f; - else if (item.type == ItemID.GladiatorHelmet || item.type == ItemID.ObsidianHelm) - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.05f; - else if (item.type == ItemID.CrimsonHelmet) - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.02f; + #region SavingAndLoading + public override bool NeedsSaving(Item item) + { + return true; + } - if (item.type == ItemID.GladiatorBreastplate || item.type == ItemID.ObsidianShirt) - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 5; - else if (item.type == ItemID.CrimsonScalemail) - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.02f; - else if (item.type == ItemID.PalladiumBreastplate) - { - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.03f; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 2; - } - else if (item.type == ItemID.CobaltBreastplate) - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 3; - else if (item.type == ItemID.MythrilChainmail) - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.05f; - else if (item.type == ItemID.OrichalcumBreastplate) - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 6; - else if (item.type == ItemID.AdamantiteBreastplate) - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.06f; - else if (item.type == ItemID.TitaniumBreastplate) - { - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.04f; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 3; - } - else if (item.type == ItemID.HallowedPlateMail) - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 7; - else if (item.type == ItemID.ChlorophytePlateMail) - { - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.05f; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 7; - } - else if (item.type == ItemID.Gi) - { - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.05f; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 5; - } + public override TagCompound Save(Item item) + { + return new TagCompound + { + { + "rogue", rogue + }, + { + "rarity", postMoonLordRarity + } + }; + } - if (item.type == ItemID.GladiatorLeggings || item.type == ItemID.ObsidianPants) - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingVelocity += 0.05f; - else if (item.type == ItemID.CrimsonGreaves) - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.02f; - else if (item.type == ItemID.PalladiumLeggings) - { - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.02f; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 1; - } - else if (item.type == ItemID.MythrilGreaves) - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 3; - else if (item.type == ItemID.AdamantiteLeggings) - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 4; - else if (item.type == ItemID.TitaniumLeggings) - { - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.03f; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 3; - } - else if (item.type == ItemID.HallowedGreaves) - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.07f; - else if (item.type == ItemID.ChlorophyteGreaves) - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 8; - } + public override void Load(Item item, TagCompound tag) + { + rogue = tag.GetBool("rogue"); + postMoonLordRarity = tag.GetInt("rarity"); + } - public override void UpdateAccessory(Item item, Player player, bool hideVisual) - { - CalamityPlayer modPlayer = player.GetModPlayer(mod); + public override void LoadLegacy(Item item, BinaryReader reader) + { + int loadVersion = reader.ReadInt32(); + postMoonLordRarity = reader.ReadInt32(); - if (item.type == ItemID.JellyfishNecklace || item.type == ItemID.JellyfishDivingGear || item.type == ItemID.ArcticDivingGear) - modPlayer.jellyfishNecklace = true; + if (loadVersion == 0) + { + BitsByte flags = reader.ReadByte(); + rogue = flags[0]; + } + else + { + ErrorLogger.Log("CalamityMod: Unknown loadVersion: " + loadVersion); + } + } - if (item.type == ItemID.WormScarf) - player.endurance -= 0.07f; + public override void NetSend(Item item, BinaryWriter writer) + { + BitsByte flags = new BitsByte(); + flags[0] = rogue; - if (item.type == ItemID.AvengerEmblem) - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.12f; - if (item.type == ItemID.CelestialStone || item.type == ItemID.CelestialShell || (item.type == ItemID.MoonStone && !Main.dayTime) || - (item.type == ItemID.SunStone && Main.dayTime)) - { - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.1f; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 2; - } - if (item.type == ItemID.DestroyerEmblem) - { - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.1f; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 8; - } - if (item.type == ItemID.EyeoftheGolem) - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 10; - if (item.type == ItemID.PutridScent) - { - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.05f; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 5; - } + writer.Write(flags); + writer.Write(postMoonLordRarity); + } - if (item.prefix == 62) - player.endurance += 0.0025f; - if (item.prefix == 63) - player.endurance += 0.005f; - if (item.prefix == 64) - player.endurance += 0.0075f; - if (item.prefix == 65) - player.endurance += 0.01f; - if (item.prefix == 67) - { - player.meleeCrit -= 1; - player.rangedCrit -= 1; - player.magicCrit -= 1; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 1; - } - if (item.prefix == 68) - { - player.meleeCrit -= 2; - player.rangedCrit -= 2; - player.magicCrit -= 2; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 2; - } - if (item.prefix == 69) - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.01f; - if (item.prefix == 70) - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.02f; - if (item.prefix == 71) - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.03f; - if (item.prefix == 72) - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.04f; - } + public override void NetReceive(Item item, BinaryReader reader) + { + BitsByte flags = reader.ReadByte(); + rogue = flags[0]; - /// - /// Dust helper to spawn dust for an item. Allows you to specify where on the item to spawn the dust, essentially. (ONLY WORKS FOR SWINGING WEAPONS?) - /// - /// The player using the item. - /// The type of dust to use. - /// The chance per frame to spawn the dust (0f-1f) - /// The minimum distance between the player and the dust - /// The maximum distance between the player and the dust - /// The minimum random rotation offset for the dust - /// The maximum random rotation offset for the dust - /// The minimum speed that the dust should travel - /// The maximum speed that the dust should travel - public static Dust MeleeDustHelper(Player player, int dustType, float chancePerFrame, float minDistance, float maxDistance, float minRandRot = -0.2f, float maxRandRot = 0.2f, float minSpeed = 0.9f, float maxSpeed = 1.1f) - { - if (Main.rand.NextFloat(1f) < chancePerFrame) - { - //Calculate values - //distance from player, - //the vector offset from the player center - //the vector between the pos and the player - float distance = Main.rand.NextFloat(minDistance, maxDistance); - Vector2 offset = (player.itemRotation - (MathHelper.PiOver4 * player.direction) + Main.rand.NextFloat(minRandRot, maxRandRot)).ToRotationVector2() * distance * player.direction; - Vector2 pos = player.Center + offset; - Vector2 vec = pos - player.Center; - //spawn the dust - Dust d = Dust.NewDustPerfect(pos, dustType); - //normalise vector and multiply by velocity magnitude - vec.Normalize(); - d.velocity = vec * Main.rand.NextFloat(minSpeed, maxSpeed); - return d; - } - return null; - } - } + postMoonLordRarity = reader.ReadInt32(); + } + #endregion + + #region Pickup Item Changes + public override bool OnPickup(Item item, Player player) + { + if (item.type == ItemID.Heart || item.type == ItemID.CandyApple || item.type == ItemID.CandyCane) + { + if (NPC.AnyNPCs(mod.NPCType("SupremeCalamitas"))) + { + player.statLife -= 10; + if (Main.myPlayer == player.whoAmI) + { + player.HealEffect(-10, true); + } + } + } + return true; + } + #endregion + + #region Use Item Changes + public override bool CanUseItem(Item item, Player player) + { + CalamityPlayer modPlayer = player.GetModPlayer(mod); + if (item.type == ItemID.MonkStaffT1) + { + for (int i = 0; i < 1000; ++i) + { + if (Main.projectile[i].active && Main.projectile[i].owner == Main.myPlayer && Main.projectile[i].type == item.shoot) + { + return false; + } + } + return true; + } + if (item.type == ItemID.SpaceGun && player.spaceGun) + { + if (player.statMana >= (int)((float)3 * player.manaCost)) + { + player.manaRegenDelay = (int)player.maxRegenDelay; + player.statMana -= (int)((float)3 * player.manaCost); + } + else if (player.manaFlower) + { + player.QuickMana(); + if (player.statMana >= (int)((float)3 * player.manaCost)) + { + player.manaRegenDelay = (int)player.maxRegenDelay; + player.statMana -= (int)((float)3 * player.manaCost); + } + else + { + return false; + } + } + else + { + return false; + } + return true; + } + if ((item.type == ItemID.SuperAbsorbantSponge || item.type == ItemID.EmptyBucket) && modPlayer.ZoneAbyss) + { + return false; + } + if (item.type == ItemID.MagicMirror || item.type == ItemID.IceMirror || item.type == ItemID.CellPhone || item.type == ItemID.RecallPotion) + { + return !NPC.AnyNPCs(mod.NPCType("SupremeCalamitas")); + } + if (item.type == ItemID.RodofDiscord && modPlayer.scarfCooldown) + { + player.AddBuff(BuffID.ChaosState, 720); + } + return true; + } + #endregion + + #region Modify Tooltips + public override void ModifyTooltips(Item item, List tooltips) + { + TooltipLine tt2 = tooltips.FirstOrDefault(x => x.Name == "ItemName" && x.mod == "Terraria"); + if (tt2 != null) + { + switch (postMoonLordRarity) + { + case 12: + tt2.overrideColor = new Color(0, 255, 200); + break; + case 13: + tt2.overrideColor = new Color(0, 255, 0); + break; + case 14: + tt2.overrideColor = new Color(43, 96, 222); + break; + case 15: + tt2.overrideColor = new Color(108, 45, 199); + break; + case 16: + tt2.overrideColor = new Color(255, 0, 255); + break; + case 17: //Legendary Weapons + if (item.type == mod.ItemType("Malachite")) + tt2.overrideColor = new Color(Main.DiscoR, 203, 103); + if (item.type == mod.ItemType("AegisBlade") || item.type == mod.ItemType("YharimsCrystal")) + tt2.overrideColor = new Color(255, Main.DiscoG, 53); + if (item.type == mod.ItemType("BrinyBaron")) + tt2.overrideColor = new Color(53, Main.DiscoG, 255); + if (item.type == mod.ItemType("CosmicDischarge")) + tt2.overrideColor = new Color(150, Main.DiscoG, 255); + if (item.type == mod.ItemType("BlossomFlux")) + tt2.overrideColor = new Color(Main.DiscoR, 203, 103); + if (item.type == mod.ItemType("SHPC")) + tt2.overrideColor = new Color(255, Main.DiscoG, 155); + if (item.type == mod.ItemType("Vesuvius")) + tt2.overrideColor = new Color(255, Main.DiscoG, 0); + break; + case 18: //Fabstaff + tt2.overrideColor = new Color(Main.DiscoR, 100, 255); + break; + case 19: //Blushie Staff + tt2.overrideColor = new Color(0, 0, 255); + break; + case 20: //Non-Expert Rainbow + tt2.overrideColor = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB); + break; + case 21: //Patreon + tt2.overrideColor = new Color(139, 0, 0); + break; + default: + break; + } + } + if (item.type == ItemID.SuperAbsorbantSponge) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip0") + { + line2.text = "Capable of soaking up an endless amount of water\n" + + "Cannot be used in the Abyss"; + } + } + } + if (item.type == ItemID.EmptyBucket) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Defense") + { + line2.text = "1 defense\n" + + "Cannot be used in the Abyss"; + } + } + } + if (item.type == ItemID.CrimsonHeart) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip0") + { + line2.text = "Summons a heart to provide light\n" + + "Provides a small amount of light in the abyss"; + } + } + } + if (item.type == ItemID.ShadowOrb) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip0") + { + line2.text = "Creates a magical shadow orb\n" + + "Provides a small amount of light in the abyss"; + } + } + } + if (item.type == ItemID.MagicLantern) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip0") + { + line2.text = "Summons a magic lantern that exposes nearby treasure\n" + + "Provides a small amount of light in the abyss"; + } + } + } + if (item.type == ItemID.ArcticDivingGear) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip1") + { + line2.text = "Provides light under water and extra mobility on ice\n" + + "Provides a small amount of light in the abyss\n" + + "Moderately reduces breath loss in the abyss"; + } + } + } + if (item.type == ItemID.JellyfishNecklace) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip0") + { + line2.text = "Provides light under water\n" + + "Provides a small amount of light in the abyss"; + } + } + } + if (item.type == ItemID.JellyfishDivingGear) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip1") + { + line2.text = "Provides light under water\n" + + "Provides a small amount of light in the abyss"; + } + } + } + if (item.type == ItemID.FairyBell) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip0") + { + line2.text = "Summons a magical fairy\n" + + "Provides a moderate amount of light in the abyss"; + } + } + } + if (item.type == ItemID.DD2PetGhost) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip0") + { + line2.text = "Summons a pet flickerwick to provide light\n" + + "Provides a moderate amount of light in the abyss"; + } + } + } + if (item.type == ItemID.ShinePotion) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "BuffTime") + { + line2.text = "5 minute duration\n" + + "Provides a moderate amount of light in the abyss"; + } + } + } + if (item.type == ItemID.WispinaBottle) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip0") + { + line2.text = "Summons a Wisp to provide light\n" + + "Provides a large amount of light in the abyss"; + } + } + } + if (item.type == ItemID.SuspiciousLookingTentacle) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip1") + { + line2.text = "'I know what you're thinking...'\n" + + "Provides a large amount of light in the abyss"; + } + } + } + if (item.type == ItemID.GillsPotion) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "BuffTime") + { + line2.text = "2 minute duration\n" + + "Greatly reduces breath loss in the abyss"; + } + } + } + if (item.type == ItemID.DivingHelmet) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip0") + { + line2.text = "Greatly extends underwater breathing\n" + + "Moderately reduces breath loss in the abyss"; + } + } + } + if (item.type == ItemID.NeptunesShell) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip0") + { + line2.text = "Transforms the holder into merfolk when entering water\n" + + "Greatly reduces breath loss in the abyss"; + } + } + } + if (item.type == ItemID.MoonShell) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip0") + { + line2.text = "Turns the holder into a werewolf at night and a merfolk when entering water\n" + + "Greatly reduces breath loss in the abyss"; + } + } + } + if (item.type == ItemID.CelestialShell) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip1") + { + line2.text = "Minor increases to all stats\n" + + "Greatly reduces breath loss in the abyss"; + } + } + } + if (item.type == ItemID.WormScarf) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip0") + { + line2.text = "Reduces damage taken by 10%"; + } + } + } + if (item.type == ItemID.SpectreHood) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip0") + { + line2.text = "20% decreased magic damage"; + } + } + } + if (item.type == ItemID.ApprenticeHat) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip0") + { + line2.text = "Increases your max number of sentries and reduces mana costs by 10%\n" + + "30% increased minion damage"; + } + } + } + if (item.type == ItemID.ApprenticeRobe) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip0") + { + line2.text = "10% increased magic damage"; + } + } + } + if (item.type == ItemID.ApprenticeTrousers) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip0") + { + line2.text = "20% increased movement speed"; + } + } + } + if (item.type == ItemID.SquireGreatHelm) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip0") + { + line2.text = "Increases your max number of sentries and increases your life regeneration\n" + + "30% increased minion damage and 20% increased melee critical strike chance"; + } + } + } + if (item.type == ItemID.SquirePlating) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip0") + { + line2.text = "15% increased melee damage"; + } + } + } + if (item.type == ItemID.SquireGreaves) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip0") + { + line2.text = "20% increased movement speed"; + } + } + } + if (item.type == ItemID.HuntressWig) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip0") + { + line2.text = "Increases your max number of sentries and increases ranged critical strike chance by 10%\n" + + "30% increased minion damage"; + } + } + } + if (item.type == ItemID.HuntressJerkin) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip0") + { + line2.text = "20% increased ranged damage"; + } + } + } + if (item.type == ItemID.HuntressPants) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip0") + { + line2.text = "20% increased movement speed"; + } + } + } + if (item.type == ItemID.MonkBrows) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip0") + { + line2.text = "Increases your max number of sentries and increases melee attack speed by 20%\n" + + "30% increased minion damage and 10% increased melee critical strike chance"; + } + } + } + if (item.type == ItemID.MonkShirt) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip0") + { + line2.text = "20% increased melee damage"; + } + } + } + if (item.type == ItemID.MonkPants) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip0") + { + line2.text = "20% increased movement speed"; + } + if (line2.mod == "Terraria" && line2.Name == "Tooltip1") + { + line2.text = ""; + } + } + } + if (item.type == ItemID.ApprenticeAltHead) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip1") + { + line2.text = "60% increased minion damage and 25% increased magic damage and critical strike chance"; + } + } + } + if (item.type == ItemID.ApprenticeAltShirt) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip0") + { + line2.text = ""; + } + } + } + if (item.type == ItemID.ApprenticeAltPants) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip0") + { + line2.text = ""; + } + } + } + if (item.type == ItemID.MonkAltHead) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip0") + { + line2.text = "Increases your max number of sentries\n" + + "Increases melee damage, speed, and critical strike chance by 20% and minion damage by 60%"; + } + } + } + if (item.type == ItemID.MonkAltShirt) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip0") + { + line2.text = ""; + } + } + } + if (item.type == ItemID.MonkAltPants) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip0") + { + line2.text = "20% increased movement speed"; + } + } + } + if (item.type == ItemID.HuntressAltHead) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip1") + { + line2.text = "60% increased minion damage and 10% increased ranged critical strike chance\n" + + "25% increased ranged damage"; + } + } + } + if (item.type == ItemID.HuntressAltShirt) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip0") + { + line2.text = ""; + } + } + } + if (item.type == ItemID.HuntressAltPants) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip0") + { + line2.text = "20% increased movement speed"; + } + } + } + if (item.type == ItemID.SquireAltHead) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip0") + { + line2.text = "Increases your max number of sentries and grants you 60% minion damage\n" + + "20% increased melee critical strike chance"; + } + } + } + if (item.type == ItemID.SquireAltShirt) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip0") + { + line2.text = "Massively increased life regeneration"; + } + } + } + if (item.type == ItemID.SquireAltPants) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip0") + { + line2.text = "30% increased movement speed"; + } + } + } + if (item.type == ItemID.ObsidianSkinPotion) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip0") + { + line2.text = "Provides immunity to direct damage from touching lava\n" + + "Provides temporary immunity to lava burn damage\n" + + "Reduces lava burn damage"; + } + } + } + if (item.type == ItemID.ObsidianRose) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip0") + { + line2.text = "Reduced direct damage from touching lava\n" + + "Greatly reduces lava burn damage"; + } + } + } + if (item.type == ItemID.MeteorHelmet || item.type == ItemID.MeteorSuit || item.type == ItemID.MeteorLeggings) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "SetBonus") + { + line2.text = "Set Bonus: Reduces the mana cost of the Space Gun by 50%"; + } + } + } + if (item.type == ItemID.CopperHelmet || item.type == ItemID.CopperChainmail || item.type == ItemID.CopperGreaves) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "SetBonus") + { + line2.text = "Set Bonus: +2 defense and 15% increased mining speed"; + } + } + } + if (item.type == ItemID.TinHelmet || item.type == ItemID.TinChainmail || item.type == ItemID.TinGreaves) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "SetBonus") + { + line2.text = "Set Bonus: +2 defense and 10% increased mining speed"; + } + } + } + if (item.type == ItemID.IronHelmet || item.type == ItemID.IronChainmail || item.type == ItemID.IronGreaves) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "SetBonus") + { + line2.text = "Set Bonus: +2 defense and 25% increased mining speed"; + } + } + } + if (item.type == ItemID.LeadHelmet || item.type == ItemID.LeadChainmail || item.type == ItemID.LeadGreaves) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "SetBonus") + { + line2.text = "Set Bonus: +3 defense and 20% increased mining speed"; + } + } + } + if (item.type == ItemID.SilverHelmet || item.type == ItemID.SilverChainmail || item.type == ItemID.SilverGreaves) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "SetBonus") + { + line2.text = "Set Bonus: +3 defense and 35% increased mining speed"; + } + } + } + if (item.type == ItemID.TungstenHelmet || item.type == ItemID.TungstenChainmail || item.type == ItemID.TungstenGreaves) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "SetBonus") + { + line2.text = "Set Bonus: +3 defense and 30% increased mining speed"; + } + } + } + if (item.type == ItemID.GoldHelmet || item.type == ItemID.GoldChainmail || item.type == ItemID.GoldGreaves) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "SetBonus") + { + line2.text = "Set Bonus: +3 defense and 45% increased mining speed"; + } + } + } + if (item.type == ItemID.PlatinumHelmet || item.type == ItemID.PlatinumChainmail || item.type == ItemID.PlatinumGreaves) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "SetBonus") + { + line2.text = "Set Bonus: +4 defense and 40% increased mining speed"; + } + } + } + if (item.type == ItemID.GladiatorHelmet) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Defense") + { + line2.text = "4 defense\n" + + "5% increased rogue damage"; + } + } + } + if (item.type == ItemID.GladiatorBreastplate) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Defense") + { + line2.text = "7 defense\n" + + "5% increased rogue critical strike chance"; + } + } + } + if (item.type == ItemID.GladiatorLeggings) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Defense") + { + line2.text = "5 defense\n" + + "5% increased rogue velocity"; + } + } + } + if (item.type == ItemID.ObsidianHelm) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Defense") + { + line2.text = "4 defense\n" + + "5% increased rogue damage"; + } + } + } + if (item.type == ItemID.ObsidianShirt) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Defense") + { + line2.text = "5 defense\n" + + "5% increased rogue critical strike chance"; + } + } + } + if (item.type == ItemID.ObsidianPants) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Defense") + { + line2.text = "4 defense\n" + + "5% increased rogue velocity"; + } + } + } + if (item.type == ItemID.MagicQuiver) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip0") + { + line2.text = "Increases arrow damage by 10% and greatly increases arrow speed"; + } + } + } + if (item.type == ItemID.AngelWings || item.type == ItemID.DemonWings) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip0") + { + line2.text = "Allows flight and slow fall\n" + + "Horizontal speed: 6.25\n" + + "Acceleration multiplier: 1\n" + + "Average vertical speed\n" + + "Flight time: 100"; + } + } + } + if (item.type == ItemID.Jetpack) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip0") + { + line2.text = "Allows flight and slow fall\n" + + "Horizontal speed: 6.5\n" + + "Acceleration multiplier: 1\n" + + "Average vertical speed\n" + + "Flight time: 115"; + } + } + } + if (item.type == ItemID.ButterflyWings || item.type == ItemID.FairyWings || item.type == ItemID.BeeWings) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip0") + { + line2.text = "Allows flight and slow fall\n" + + "Horizontal speed: 6.75\n" + + "Acceleration multiplier: 1\n" + + "Average vertical speed\n" + + "Flight time: 130"; + } + } + } + if (item.type == ItemID.HarpyWings || item.type == ItemID.BoneWings) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip0") + { + line2.text = "Allows flight and slow fall\n" + + "Horizontal speed: 7\n" + + "Acceleration multiplier: 1\n" + + "Average vertical speed\n" + + "Flight time: 140"; + } + } + } + if (item.type == ItemID.FlameWings || item.type == ItemID.FrozenWings || item.type == ItemID.GhostWings || + item.type == ItemID.BeetleWings) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip0") + { + line2.text = "Allows flight and slow fall\n" + + "Horizontal speed: 7.5\n" + + "Acceleration multiplier: 1\n" + + "Average vertical speed\n" + + "Flight time: 160"; + } + } + } + if (item.type == ItemID.FinWings) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip0") + { + line2.text = "Allows flight and slow fall\n" + + "Horizontal speed: 0\n" + + "Acceleration multiplier: 0\n" + + "Average vertical speed\n" + + "Flight time: 100"; + } + } + } + if (item.type == ItemID.FishronWings) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip0") + { + line2.text = "Allows flight and slow fall\n" + + "Horizontal speed: 8\n" + + "Acceleration multiplier: 2\n" + + "Good vertical speed\n" + + "Flight time: 180"; + } + } + } + if (item.type == ItemID.SteampunkWings) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip0") + { + line2.text = "Allows flight and slow fall\n" + + "Horizontal speed: 7.75\n" + + "Acceleration multiplier: 1\n" + + "Average vertical speed\n" + + "Flight time: 180"; + } + } + } + if (item.type == ItemID.LeafWings) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip0") + { + line2.text = "Allows flight and slow fall\n" + + "Horizontal speed: 6.75\n" + + "Acceleration multiplier: 1\n" + + "Average vertical speed\n" + + "Flight time: 160"; + } + } + } + if (item.type == ItemID.BatWings) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip0") + { + line2.text = "Allows flight and slow fall\n" + + "Horizontal speed: 0\n" + + "Acceleration multiplier: 0\n" + + "Average vertical speed\n" + + "Flight time: 140"; + } + } + } + if (item.type == ItemID.Yoraiz0rWings || item.type == ItemID.JimsWings || item.type == ItemID.SkiphsWings || + item.type == ItemID.LokisWings || item.type == ItemID.ArkhalisWings || item.type == ItemID.LeinforsWings || + item.type == ItemID.BejeweledValkyrieWing || item.type == ItemID.RedsWings || item.type == ItemID.DTownsWings || + item.type == ItemID.WillsWings || item.type == ItemID.CrownosWings || item.type == ItemID.CenxsWings) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip0") + { + line2.text = "'Great for impersonating devs!'\n" + + "Horizontal speed: 7\n" + + "Acceleration multiplier: 1\n" + + "Average vertical speed\n" + + "Flight time: 150"; + } + } + } + if (item.type == ItemID.TatteredFairyWings || item.type == ItemID.SpookyWings) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip0") + { + line2.text = "Allows flight and slow fall\n" + + "Horizontal speed: 7.5\n" + + "Acceleration multiplier: 1\n" + + "Average vertical speed\n" + + "Flight time: 180"; + } + } + } + if (item.type == ItemID.Hoverboard) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip0") + { + line2.text = "Allows flight and slow fall\n" + + "Horizontal speed: 6.25\n" + + "Acceleration multiplier: 1\n" + + "Average vertical speed\n" + + "Flight time: 170"; + } + } + } + if (item.type == ItemID.FestiveWings) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip0") + { + line2.text = "Allows flight and slow fall\n" + + "Horizontal speed: 7.5\n" + + "Acceleration multiplier: 1\n" + + "Average vertical speed\n" + + "Flight time: 170"; + } + } + } + if (item.type == ItemID.MothronWings) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip0") + { + line2.text = "Allows flight and slow fall\n" + + "Horizontal speed: 0\n" + + "Acceleration multiplier: 0\n" + + "Average vertical speed\n" + + "Flight time: 160"; + } + } + } + if (item.type == ItemID.WingsSolar || item.type == ItemID.WingsStardust) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip0") + { + line2.text = "Allows flight and slow fall\n" + + "Horizontal speed: 9\n" + + "Acceleration multiplier: 2.5\n" + + "Great vertical speed\n" + + "Flight time: 180"; + } + } + } + if (item.type == ItemID.WingsVortex || item.type == ItemID.WingsNebula) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip0") + { + line2.text = "Allows flight and slow fall\n" + + "Horizontal speed: 6.5\n" + + "Acceleration multiplier: 1.5\n" + + "Good vertical speed\n" + + "Flight time: 160"; + } + } + } + if (item.type == ItemID.BetsyWings) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Equipable") + { + line2.text = "Equipable\n" + + "Allows flight and slow fall\n" + + "Horizontal speed: 6\n" + + "Acceleration multiplier: 2.5\n" + + "Good vertical speed\n" + + "Flight time: 150"; + } + } + } + if (item.accessory) + { + if (item.prefix == 67) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "PrefixAccCritChance") + { + line2.text = "+1% critical strike chance"; + } + } + } + if (item.prefix == 68) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "PrefixAccCritChance") + { + line2.text = "+2% critical strike chance"; + } + } + } + if (item.prefix == 62) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "PrefixAccDefense") + { + line2.text = "+1 defense\n" + + "+0.25% damage reduction"; + } + } + } + if (item.prefix == 63) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "PrefixAccDefense") + { + line2.text = "+2 defense\n" + + "+0.5% damage reduction"; + } + } + } + if (item.prefix == 64) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "PrefixAccDefense") + { + line2.text = "+3 defense\n" + + "+0.75% damage reduction"; + } + } + } + if (item.prefix == 65) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "PrefixAccDefense") + { + line2.text = "+4 defense\n" + + "+1% damage reduction"; + } + } + } + } + } + #endregion + + #region BossBagChanges + public override void OpenVanillaBag(string context, Player player, int arg) + { + bool revenge = CalamityWorld.revenge; + bool defiled = CalamityWorld.defiled; + if (context == "bossBag") + { + switch (arg) + { + case ItemID.KingSlimeBossBag: + if (revenge) + player.QuickSpawnItem(mod.ItemType("CrownJewel")); + break; + case ItemID.EyeOfCthulhuBossBag: + player.QuickSpawnItem(mod.ItemType("VictoryShard"), Main.rand.Next(3, 6)); + if (Main.rand.Next(3) == 0) + player.QuickSpawnItem(mod.ItemType("TeardropCleaver")); + if (revenge) + player.QuickSpawnItem(mod.ItemType("CounterScarf")); + break; + case ItemID.WallOfFleshBossBag: + player.QuickSpawnItem(mod.ItemType("MLGRune")); + if (Main.rand.Next(3) == 0) + player.QuickSpawnItem(mod.ItemType("Meowthrower")); + if (Main.rand.Next(8) == 0) + player.QuickSpawnItem(mod.ItemType("RogueEmblem")); + if (Main.rand.Next(5) == 0) + { + switch (Main.rand.Next(2)) + { + case 0: + player.QuickSpawnItem(ItemID.CrimsonKey); + break; + case 1: + player.QuickSpawnItem(ItemID.CorruptionKey); + break; + } + } + break; + case ItemID.DestroyerBossBag: + if (Main.rand.Next(100) == 0) + player.QuickSpawnItem(mod.ItemType("SHPC")); + else if (defiled) + { + if (Main.rand.Next(20) == 0) + player.QuickSpawnItem(mod.ItemType("SHPC")); + } + break; + case ItemID.PlanteraBossBag: + player.QuickSpawnItem(mod.ItemType("LivingShard"), Main.rand.Next(8, 12)); + if (Main.rand.Next(5) == 0) + player.QuickSpawnItem(ItemID.JungleKey); + if (Main.rand.Next(100) == 0) + player.QuickSpawnItem(mod.ItemType("BlossomFlux")); + else if (defiled) + { + if (Main.rand.Next(20) == 0) + player.QuickSpawnItem(mod.ItemType("BlossomFlux")); + } + break; + case ItemID.GolemBossBag: + if (Main.rand.Next(100) == 0) + player.QuickSpawnItem(mod.ItemType("AegisBlade")); + else if (defiled) + { + if (Main.rand.Next(20) == 0) + player.QuickSpawnItem(mod.ItemType("AegisBlade")); + } + break; + case ItemID.FishronBossBag: + if (Main.rand.Next(100) == 0) + player.QuickSpawnItem(mod.ItemType("BrinyBaron")); + else if (defiled) + { + if (Main.rand.Next(20) == 0) + player.QuickSpawnItem(mod.ItemType("BrinyBaron")); + } + break; + case ItemID.BossBagBetsy: + if (Main.rand.Next(100) == 0) + player.QuickSpawnItem(mod.ItemType("Vesuvius")); + else if (defiled) + { + if (Main.rand.Next(20) == 0) + player.QuickSpawnItem(mod.ItemType("Vesuvius")); + } + break; + case ItemID.CultistBossBag: + player.QuickSpawnItem(mod.ItemType("MeldBlob"), Main.rand.Next(25, 31)); + if (Main.rand.Next(3) == 0) + player.QuickSpawnItem(mod.ItemType("StardustStaff")); + break; + case ItemID.MoonLordBossBag: + player.QuickSpawnItem(mod.ItemType("MLGRune2")); + break; + } + if (revenge) + { + if (Main.rand.Next(20) == 0) + { + switch (Main.rand.Next(3)) + { + case 0: + player.QuickSpawnItem(mod.ItemType("StressPills")); + break; + case 1: + player.QuickSpawnItem(mod.ItemType("Laudanum")); + break; + case 2: + player.QuickSpawnItem(mod.ItemType("HeartofDarkness")); + break; + } + } + } + } + } + #endregion + + #region Armor Set Changes + public override string IsArmorSet(Item head, Item body, Item legs) + { + if (head.type == ItemID.CopperHelmet && body.type == ItemID.CopperChainmail && legs.type == ItemID.CopperGreaves) + return "Copper"; + if (head.type == ItemID.TinHelmet && body.type == ItemID.TinChainmail && legs.type == ItemID.TinGreaves) + return "Tin"; + if (head.type == ItemID.IronHelmet && body.type == ItemID.IronChainmail && legs.type == ItemID.IronGreaves) + return "Iron"; + if (head.type == ItemID.LeadHelmet && body.type == ItemID.LeadChainmail && legs.type == ItemID.LeadGreaves) + return "Lead"; + if (head.type == ItemID.SilverHelmet && body.type == ItemID.SilverChainmail && legs.type == ItemID.SilverGreaves) + return "Silver"; + if (head.type == ItemID.TungstenHelmet && body.type == ItemID.TungstenChainmail && legs.type == ItemID.TungstenGreaves) + return "Tungsten"; + if (head.type == ItemID.GoldHelmet && body.type == ItemID.GoldChainmail && legs.type == ItemID.GoldGreaves) + return "Gold"; + if (head.type == ItemID.PlatinumHelmet && body.type == ItemID.PlatinumChainmail && legs.type == ItemID.PlatinumGreaves) + return "Platinum"; + if (head.type == ItemID.GladiatorHelmet && body.type == ItemID.GladiatorBreastplate && legs.type == ItemID.GladiatorLeggings) + return "Gladiator"; + if (head.type == ItemID.ObsidianHelm && body.type == ItemID.ObsidianShirt && legs.type == ItemID.ObsidianPants) + return "Obsidian"; + if (head.type == ItemID.PumpkinHelmet && body.type == ItemID.PumpkinBreastplate && legs.type == ItemID.PumpkinLeggings) + return "PumpMyAssFull"; + return ""; + } + + public override void UpdateArmorSet(Player player, string set) + { + if (set == "Copper") + player.pickSpeed -= 0.15f; + else if (set == "Tin") + player.pickSpeed -= 0.1f; + else if (set == "Iron") + player.pickSpeed -= 0.25f; + else if (set == "Lead") + player.pickSpeed -= 0.2f; + else if (set == "Silver") + player.pickSpeed -= 0.35f; + else if (set == "Tungsten") + player.pickSpeed -= 0.3f; + else if (set == "Gold") + player.pickSpeed -= 0.45f; + else if (set == "Platinum") + player.pickSpeed -= 0.4f; + else if (set == "Gladiator") + { + CalamityPlayer modPlayer = player.GetModPlayer(mod); + modPlayer.rogueStealthMax = 1f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.1f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingVelocity += 0.1f; + player.statDefense += 5; + player.setBonus = "+5 defense\n" + + "10% increased rogue damage and velocity\n" + + "Rogue stealth builds while not attacking and not moving, up to a max of 100\n" + + "Rogue stealth only reduces when you attack, it does not reduce while moving\n" + + "The higher your rogue stealth the higher your rogue damage, crit, and movement speed"; + } + else if (set == "Obsidian") + { + CalamityPlayer modPlayer = player.GetModPlayer(mod); + modPlayer.rogueStealthMax = 1f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.1f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 10; + player.statDefense += 3; + player.fireWalk = true; + player.lavaMax += 300; + player.setBonus = "+3 defense\n" + + "10% increased rogue damage and critical strike chance\n" + + "Grants immunity to fire blocks and temporary immunity to lava"; + } + else if (set == "PumpMyAssFull") + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.1f; + } + #endregion + + #region Equip Changes + public override void UpdateEquip(Item item, Player player) + { + #region Head + if (item.type == ItemID.SpectreHood) + player.magicDamage += 0.2f; + else if (item.type == ItemID.GladiatorHelmet || item.type == ItemID.ObsidianHelm) + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.05f; + else if (item.type == ItemID.CrimsonHelmet) + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.02f; + else if (item.type == ItemID.ApprenticeHat) + player.minionDamage += 0.3f; + else if (item.type == ItemID.SquireGreatHelm) + { + player.minionDamage += 0.3f; + player.meleeCrit += 20; + } + else if (item.type == ItemID.HuntressWig) + player.minionDamage += 0.3f; + else if (item.type == ItemID.MonkBrows) + { + player.minionDamage += 0.3f; + player.meleeCrit += 10; + } + else if (item.type == ItemID.ApprenticeAltHead) + { + player.minionDamage += 0.5f; + player.magicDamage += 0.15f; + player.magicCrit += 25; + } + else if (item.type == ItemID.MonkAltHead) + { + player.minionDamage += 0.4f; + player.meleeSpeed += 0.2f; + player.meleeCrit += 20; + } + else if (item.type == ItemID.HuntressAltHead) + { + player.minionDamage += 0.5f; + player.rangedDamage += 0.25f; + } + else if (item.type == ItemID.SquireAltHead) + { + player.minionDamage += 0.5f; + player.meleeCrit += 20; + } + #endregion + + #region Body + if (item.type == ItemID.GladiatorBreastplate || item.type == ItemID.ObsidianShirt) + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 5; + else if (item.type == ItemID.CrimsonScalemail) + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.02f; + else if (item.type == ItemID.PalladiumBreastplate) + { + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.03f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 2; + } + else if (item.type == ItemID.CobaltBreastplate) + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 3; + else if (item.type == ItemID.MythrilChainmail) + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.05f; + else if (item.type == ItemID.OrichalcumBreastplate) + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 6; + else if (item.type == ItemID.AdamantiteBreastplate) + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.06f; + else if (item.type == ItemID.TitaniumBreastplate) + { + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.04f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 3; + } + else if (item.type == ItemID.HallowedPlateMail) + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 7; + else if (item.type == ItemID.ChlorophytePlateMail) + { + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.05f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 7; + } + else if (item.type == ItemID.Gi) + { + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.05f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 5; + } + else if (item.type == ItemID.ApprenticeRobe) + player.minionDamage -= 0.2f; + else if (item.type == ItemID.SquirePlating) + player.minionDamage -= 0.15f; + else if (item.type == ItemID.HuntressJerkin) + player.minionDamage -= 0.2f; + else if (item.type == ItemID.MonkShirt) + player.minionDamage -= 0.2f; + else if (item.type == ItemID.ApprenticeAltShirt) + { + player.minionDamage -= 0.3f; + player.magicDamage -= 0.15f; + } + else if (item.type == ItemID.MonkAltShirt) + { + player.minionDamage -= 0.2f; + player.meleeSpeed -= 0.2f; + } + else if (item.type == ItemID.HuntressAltShirt) + { + player.minionDamage -= 0.25f; + player.meleeSpeed -= 0.2f; + } + else if (item.type == ItemID.SquireAltShirt) + player.minionDamage -= 0.3f; + #endregion + + #region Legs + if (item.type == ItemID.GladiatorLeggings || item.type == ItemID.ObsidianPants) + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingVelocity += 0.05f; + else if (item.type == ItemID.CrimsonGreaves) + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.02f; + else if (item.type == ItemID.PalladiumLeggings) + { + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.02f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 1; + } + else if (item.type == ItemID.MythrilGreaves) + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 3; + else if (item.type == ItemID.AdamantiteLeggings) + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 4; + else if (item.type == ItemID.TitaniumLeggings) + { + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.03f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 3; + } + else if (item.type == ItemID.HallowedGreaves) + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.07f; + else if (item.type == ItemID.ChlorophyteGreaves) + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 8; + else if (item.type == ItemID.ApprenticeTrousers) + { + player.magicCrit -= 20; + player.moveSpeed += 0.2f; + } + else if (item.type == ItemID.SquireGreaves) + { + player.minionDamage -= 0.15f; + player.meleeCrit -= 20; + } + else if (item.type == ItemID.HuntressPants) + player.minionDamage -= 0.1f; + else if (item.type == ItemID.MonkPants) + { + player.minionDamage -= 0.1f; + player.meleeCrit -= 10; + } + else if (item.type == ItemID.ApprenticeAltPants) + { + player.minionDamage -= 0.2f; + player.magicCrit -= 25; + } + else if (item.type == ItemID.MonkAltPants) + { + player.minionDamage -= 0.2f; + player.meleeCrit -= 20; + } + else if (item.type == ItemID.HuntressAltPants) + player.minionDamage -= 0.25f; + if (item.type == ItemID.SquireAltPants) + { + player.minionDamage -= 0.2f; + player.meleeCrit -= 20; + } + #endregion + } + #endregion + + #region Accessory Changes + public override void UpdateAccessory(Item item, Player player, bool hideVisual) + { + CalamityPlayer modPlayer = player.GetModPlayer(mod); + + if (item.type == ItemID.JellyfishNecklace || item.type == ItemID.JellyfishDivingGear || item.type == ItemID.ArcticDivingGear) + modPlayer.jellyfishNecklace = true; + + if (item.type == ItemID.WormScarf) + player.endurance -= 0.07f; + + if (item.type == ItemID.AvengerEmblem) + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.12f; + if (item.type == ItemID.CelestialStone || item.type == ItemID.CelestialShell || (item.type == ItemID.MoonStone && !Main.dayTime) || + (item.type == ItemID.SunStone && Main.dayTime)) + { + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.1f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 2; + } + if (item.type == ItemID.DestroyerEmblem) + { + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.1f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 8; + } + if (item.type == ItemID.EyeoftheGolem) + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 10; + if (item.type == ItemID.PutridScent) + { + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.05f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 5; + } + + if (item.prefix == 62) + player.endurance += 0.0025f; + if (item.prefix == 63) + player.endurance += 0.005f; + if (item.prefix == 64) + player.endurance += 0.0075f; + if (item.prefix == 65) + player.endurance += 0.01f; + if (item.prefix == 67) + { + player.meleeCrit -= 1; + player.rangedCrit -= 1; + player.magicCrit -= 1; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 1; + } + if (item.prefix == 68) + { + player.meleeCrit -= 2; + player.rangedCrit -= 2; + player.magicCrit -= 2; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingCrit += 2; + } + if (item.prefix == 69) + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.01f; + if (item.prefix == 70) + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.02f; + if (item.prefix == 71) + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.03f; + if (item.prefix == 72) + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.04f; + } + #endregion + + /// + /// Dust helper to spawn dust for an item. Allows you to specify where on the item to spawn the dust, essentially. (ONLY WORKS FOR SWINGING WEAPONS?) + /// + /// The player using the item. + /// The type of dust to use. + /// The chance per frame to spawn the dust (0f-1f) + /// The minimum distance between the player and the dust + /// The maximum distance between the player and the dust + /// The minimum random rotation offset for the dust + /// The maximum random rotation offset for the dust + /// The minimum speed that the dust should travel + /// The maximum speed that the dust should travel + public static Dust MeleeDustHelper(Player player, int dustType, float chancePerFrame, float minDistance, float maxDistance, float minRandRot = -0.2f, float maxRandRot = 0.2f, float minSpeed = 0.9f, float maxSpeed = 1.1f) + { + if (Main.rand.NextFloat(1f) < chancePerFrame) + { + //Calculate values + //distance from player, + //the vector offset from the player center + //the vector between the pos and the player + float distance = Main.rand.NextFloat(minDistance, maxDistance); + Vector2 offset = (player.itemRotation - (MathHelper.PiOver4 * player.direction) + Main.rand.NextFloat(minRandRot, maxRandRot)).ToRotationVector2() * distance * player.direction; + Vector2 pos = player.Center + offset; + Vector2 vec = pos - player.Center; + //spawn the dust + Dust d = Dust.NewDustPerfect(pos, dustType); + //normalise vector and multiply by velocity magnitude + vec.Normalize(); + d.velocity = vec * Main.rand.NextFloat(minSpeed, maxSpeed); + return d; + } + return null; + } + } } diff --git a/Items/ChaoswarpedSlashaxe.cs b/Items/ChaoswarpedSlashaxe.cs index e469575548..bc322a1807 100644 --- a/Items/ChaoswarpedSlashaxe.cs +++ b/Items/ChaoswarpedSlashaxe.cs @@ -20,8 +20,8 @@ namespace CalamityMod.Items { item.damage = 68; item.melee = true; - item.width = 42; - item.height = 42; + item.width = 50; + item.height = 50; item.useTime = 31; item.useAnimation = 31; item.useTurn = true; diff --git a/Items/ChaoswarpedSlashaxe.png b/Items/ChaoswarpedSlashaxe.png index d1a24fcf59..c9b99190cf 100644 Binary files a/Items/ChaoswarpedSlashaxe.png and b/Items/ChaoswarpedSlashaxe.png differ diff --git a/Items/CoreofCalamity.cs b/Items/CoreofCalamity.cs index 8c773da19c..1118aa06ed 100644 --- a/Items/CoreofCalamity.cs +++ b/Items/CoreofCalamity.cs @@ -7,36 +7,38 @@ using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Items; -namespace CalamityMod.Items { -public class CoreofCalamity : ModItem +namespace CalamityMod.Items { - public override void SetStaticDefaults() + public class CoreofCalamity : ModItem { - DisplayName.SetDefault("Core of Calamity"); + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Core of Calamity"); + } + + public override void SetDefaults() + { + item.width = 40; + item.height = 40; + item.maxStack = 99; + item.value = Item.buyPrice(0, 5, 0, 0); + item.rare = 8; + } + + public override void Update(ref float gravity, ref float maxFallSpeed) + { + maxFallSpeed = 0f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "CoreofCinder", 5); + recipe.AddIngredient(null, "CoreofEleum", 5); + recipe.AddIngredient(null, "CoreofChaos", 5); + recipe.AddTile(TileID.MythrilAnvil); + recipe.SetResult(this); + recipe.AddRecipe(); + } } - - public override void SetDefaults() - { - item.width = 40; - item.height = 40; - item.maxStack = 69; - item.value = 500000; - item.rare = 10; - } - - public override void Update(ref float gravity, ref float maxFallSpeed) - { - maxFallSpeed *= 0f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "CoreofCinder", 5); - recipe.AddIngredient(null, "CoreofEleum", 5); - recipe.AddIngredient(null, "CoreofChaos", 5); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} \ No newline at end of file +} \ No newline at end of file diff --git a/Items/CoreofChaos.cs b/Items/CoreofChaos.cs index dabcf5b3d1..0c00683ad9 100644 --- a/Items/CoreofChaos.cs +++ b/Items/CoreofChaos.cs @@ -7,38 +7,40 @@ using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Items; -namespace CalamityMod.Items { -public class CoreofChaos : ModItem +namespace CalamityMod.Items { - public override void SetStaticDefaults() + public class CoreofChaos : ModItem { - DisplayName.SetDefault("Core of Chaos"); + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Core of Chaos"); + } + + public override void Update(ref float gravity, ref float maxFallSpeed) + { + maxFallSpeed = 0f; + float num = (float)Main.rand.Next(90, 111) * 0.01f; + num *= Main.essScale; + Lighting.AddLight((int)((item.position.X + (float)(item.width / 2)) / 16f), (int)((item.position.Y + (float)(item.height / 2)) / 16f), 0.5f * num, 0.3f * num, 0.05f * num); + } + + public override void SetDefaults() + { + item.width = 16; + item.height = 16; + item.maxStack = 999; + item.value = Item.buyPrice(0, 5, 0, 0); + item.rare = 8; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "EssenceofChaos"); + recipe.AddIngredient(ItemID.Ectoplasm); + recipe.AddTile(TileID.MythrilAnvil); + recipe.SetResult(this, 3); + recipe.AddRecipe(); + } } - - public override void Update(ref float gravity, ref float maxFallSpeed) - { - maxFallSpeed *= 0f; - float num = (float)Main.rand.Next(90, 111) * 0.01f; - num *= Main.essScale; - Lighting.AddLight((int)((item.position.X + (float)(item.width / 2)) / 16f), (int)((item.position.Y + (float)(item.height / 2)) / 16f), 0.5f * num, 0.3f * num, 0.05f * num); - } - - public override void SetDefaults() - { - item.width = 16; - item.height = 16; - item.maxStack = 999; - item.value = 50000; - item.rare = 8; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "EssenceofChaos"); - recipe.AddIngredient(ItemID.Ectoplasm); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(this, 3); - recipe.AddRecipe(); - } -}} \ No newline at end of file +} \ No newline at end of file diff --git a/Items/CoreofCinder.cs b/Items/CoreofCinder.cs index b69b6a6f91..083f12d93c 100644 --- a/Items/CoreofCinder.cs +++ b/Items/CoreofCinder.cs @@ -7,38 +7,40 @@ using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Items; -namespace CalamityMod.Items { -public class CoreofCinder : ModItem +namespace CalamityMod.Items { - public override void SetStaticDefaults() + public class CoreofCinder : ModItem { - DisplayName.SetDefault("Core of Cinder"); + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Core of Sunlight"); + } + + public override void SetDefaults() + { + item.width = 16; + item.height = 16; + item.maxStack = 999; + item.value = Item.buyPrice(0, 5, 0, 0); + item.rare = 8; + } + + public override void Update(ref float gravity, ref float maxFallSpeed) + { + maxFallSpeed = 0f; + float num = (float)Main.rand.Next(90, 111) * 0.01f; + num *= Main.essScale; + Lighting.AddLight((int)((item.position.X + (float)(item.width / 2)) / 16f), (int)((item.position.Y + (float)(item.height / 2)) / 16f), 0.3f * num, 0.3f * num, 0.05f * num); + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "EssenceofCinder"); + recipe.AddIngredient(ItemID.Ectoplasm); + recipe.AddTile(TileID.MythrilAnvil); + recipe.SetResult(this, 3); + recipe.AddRecipe(); + } } - - public override void SetDefaults() - { - item.width = 16; - item.height = 16; - item.maxStack = 999; - item.value = 50000; - item.rare = 8; - } - - public override void Update(ref float gravity, ref float maxFallSpeed) - { - maxFallSpeed *= 0f; - float num = (float)Main.rand.Next(90, 111) * 0.01f; - num *= Main.essScale; - Lighting.AddLight((int)((item.position.X + (float)(item.width / 2)) / 16f), (int)((item.position.Y + (float)(item.height / 2)) / 16f), 0.3f * num, 0.3f * num, 0.05f * num); - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "EssenceofCinder"); - recipe.AddIngredient(ItemID.Ectoplasm); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(this, 3); - recipe.AddRecipe(); - } -}} \ No newline at end of file +} \ No newline at end of file diff --git a/Items/CoreofEleum.cs b/Items/CoreofEleum.cs index 5d3dad1aa8..53120799ec 100644 --- a/Items/CoreofEleum.cs +++ b/Items/CoreofEleum.cs @@ -7,38 +7,40 @@ using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Items; -namespace CalamityMod.Items { -public class CoreofEleum : ModItem +namespace CalamityMod.Items { - public override void SetStaticDefaults() + public class CoreofEleum : ModItem { - DisplayName.SetDefault("Core of Eleum"); + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Core of Eleum"); + } + + public override void SetDefaults() + { + item.width = 16; + item.height = 16; + item.maxStack = 999; + item.value = Item.buyPrice(0, 5, 0, 0); + item.rare = 8; + } + + public override void Update(ref float gravity, ref float maxFallSpeed) + { + maxFallSpeed = 0f; + float num = (float)Main.rand.Next(90, 111) * 0.01f; + num *= Main.essScale; + Lighting.AddLight((int)((item.position.X + (float)(item.width / 2)) / 16f), (int)((item.position.Y + (float)(item.height / 2)) / 16f), 0.15f * num, 0.05f * num, 0.5f * num); + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "EssenceofEleum"); + recipe.AddIngredient(ItemID.Ectoplasm); + recipe.AddTile(TileID.MythrilAnvil); + recipe.SetResult(this, 3); + recipe.AddRecipe(); + } } - - public override void SetDefaults() - { - item.width = 16; - item.height = 16; - item.maxStack = 999; - item.value = 50000; - item.rare = 8; - } - - public override void Update(ref float gravity, ref float maxFallSpeed) - { - maxFallSpeed *= 0f; - float num = (float)Main.rand.Next(90, 111) * 0.01f; - num *= Main.essScale; - Lighting.AddLight((int)((item.position.X + (float)(item.width / 2)) / 16f), (int)((item.position.Y + (float)(item.height / 2)) / 16f), 0.15f * num, 0.05f * num, 0.5f * num); - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "EssenceofEleum"); - recipe.AddIngredient(ItemID.Ectoplasm); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(this, 3); - recipe.AddRecipe(); - } -}} \ No newline at end of file +} \ No newline at end of file diff --git a/Items/CosmicPlushie.cs b/Items/CosmicPlushie.cs index 03115b8cad..00636ee773 100644 --- a/Items/CosmicPlushie.cs +++ b/Items/CosmicPlushie.cs @@ -25,8 +25,8 @@ namespace CalamityMod.Items item.value = Item.sellPrice(0, 7, 0, 0); item.shoot = mod.ProjectileType("ChibiiDoggo"); item.buffType = mod.BuffType("ChibiiBuff"); - item.rare = 14; item.UseSound = new Terraria.Audio.LegacySoundStyle(SoundID.Meowmere, 5); + item.GetGlobalItem(mod).postMoonLordRarity = 14; } public override void UseStyle(Player player) diff --git a/Items/Cosmolight.cs b/Items/Cosmolight.cs index b8bbe774bf..9c0fb938ea 100644 --- a/Items/Cosmolight.cs +++ b/Items/Cosmolight.cs @@ -37,22 +37,16 @@ namespace CalamityMod.Items public override bool UseItem(Player player) { - if (!Main.dayTime) + Main.time = 0.0; + Main.dayTime = !Main.dayTime; + if (Main.dayTime) { - Main.time = 0.0; - Main.dayTime = true; - } - else - { - Main.time = 0.0; - Main.dayTime = false; - Main.moonPhase++; - if (Main.moonPhase >= 8) + if (++Main.moonPhase >= 8) { Main.moonPhase = 0; } - } - if (Main.netMode == 2) + } + if (Main.netMode == 2) { NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); } diff --git a/Items/Crabulon/CrabulonBag.cs b/Items/Crabulon/CrabulonBag.cs index cccd33534b..a3189f2430 100644 --- a/Items/Crabulon/CrabulonBag.cs +++ b/Items/Crabulon/CrabulonBag.cs @@ -7,11 +7,11 @@ namespace CalamityMod.Items.Crabulon public class CrabulonBag : ModItem { public override void SetStaticDefaults() - { - DisplayName.SetDefault("Treasure Bag"); - Tooltip.SetDefault("{$CommonItemTooltip.RightClickToOpen}"); - } - + { + DisplayName.SetDefault("Treasure Bag"); + Tooltip.SetDefault("{$CommonItemTooltip.RightClickToOpen}"); + } + public override void SetDefaults() { item.maxStack = 999; @@ -30,11 +30,30 @@ namespace CalamityMod.Items.Crabulon public override void OpenBossBag(Player player) { - if (Main.rand.Next(7) == 0) - { - player.QuickSpawnItem(mod.ItemType("CrabulonMask")); - } - if (Main.rand.Next(3) == 0) + if (CalamityWorld.revenge) + { + player.QuickSpawnItem(mod.ItemType("MushroomPlasmaRoot")); + if (Main.rand.Next(20) == 0) + { + switch (Main.rand.Next(3)) + { + case 0: + player.QuickSpawnItem(mod.ItemType("StressPills")); + break; + case 1: + player.QuickSpawnItem(mod.ItemType("Laudanum")); + break; + case 2: + player.QuickSpawnItem(mod.ItemType("HeartofDarkness")); + break; + } + } + } + if (Main.rand.Next(7) == 0) + { + player.QuickSpawnItem(mod.ItemType("CrabulonMask")); + } + if (Main.rand.Next(3) == 0) { player.QuickSpawnItem(mod.ItemType("HyphaeRod")); } @@ -53,10 +72,6 @@ namespace CalamityMod.Items.Crabulon player.QuickSpawnItem(ItemID.GlowingMushroom, Main.rand.Next(25, 36)); player.QuickSpawnItem(ItemID.MushroomGrassSeeds, Main.rand.Next(5, 11)); player.QuickSpawnItem(mod.ItemType("FungalClump")); - if (CalamityWorld.revenge) - { - player.QuickSpawnItem(mod.ItemType("MushroomPlasmaRoot")); - } } } } \ No newline at end of file diff --git a/Items/Crabulon/FungalClump.cs b/Items/Crabulon/FungalClump.cs index 89d1d0779d..fa7ab25f3b 100644 --- a/Items/Crabulon/FungalClump.cs +++ b/Items/Crabulon/FungalClump.cs @@ -55,7 +55,7 @@ namespace CalamityMod.Items.Crabulon } if (player.ownedProjectileCounts[mod.ProjectileType("FungalClump")] < 1) { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, mod.ProjectileType("FungalClump"), 10, 1f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, mod.ProjectileType("FungalClump"), (int)(10f * player.minionDamage), 1f, Main.myPlayer, 0f, 0f); } } } diff --git a/Items/CruptixBar.cs b/Items/CruptixBar.cs index f4ec9c027b..a888c8f527 100644 --- a/Items/CruptixBar.cs +++ b/Items/CruptixBar.cs @@ -18,11 +18,11 @@ namespace CalamityMod.Items public override void SetDefaults() { - item.width = 15; - item.height = 12; + item.width = 30; + item.height = 24; item.maxStack = 999; - item.value = 150000; - item.rare = 8; + item.value = Item.buyPrice(0, 5, 0, 0); + item.rare = 8; } public override void AddRecipes() diff --git a/Items/CruptixBar.png b/Items/CruptixBar.png index 28ecb825d7..54b3da421c 100644 Binary files a/Items/CruptixBar.png and b/Items/CruptixBar.png differ diff --git a/Items/Cryogen/CryoBar.cs b/Items/Cryogen/CryoBar.cs index 2f6e3b319f..3fb48cf8ea 100644 --- a/Items/Cryogen/CryoBar.cs +++ b/Items/Cryogen/CryoBar.cs @@ -19,11 +19,11 @@ namespace CalamityMod.Items.Cryogen public override void SetDefaults() { - item.width = 15; - item.height = 12; + item.width = 30; + item.height = 24; item.maxStack = 999; - item.value = 28750; - item.rare = 5; + item.value = Item.buyPrice(0, 3, 0, 0); + item.rare = 5; } } } \ No newline at end of file diff --git a/Items/Cryogen/CryogenBag.cs b/Items/Cryogen/CryogenBag.cs index 44940542e6..1fe387e736 100644 --- a/Items/Cryogen/CryogenBag.cs +++ b/Items/Cryogen/CryogenBag.cs @@ -7,11 +7,11 @@ namespace CalamityMod.Items.Cryogen public class CryogenBag : ModItem { public override void SetStaticDefaults() - { - DisplayName.SetDefault("Treasure Bag"); - Tooltip.SetDefault("{$CommonItemTooltip.RightClickToOpen}"); - } - + { + DisplayName.SetDefault("Treasure Bag"); + Tooltip.SetDefault("{$CommonItemTooltip.RightClickToOpen}"); + } + public override void SetDefaults() { item.maxStack = 999; @@ -30,6 +30,25 @@ namespace CalamityMod.Items.Cryogen public override void OpenBossBag(Player player) { + if (CalamityWorld.revenge) + { + player.QuickSpawnItem(mod.ItemType("FrostFlare")); + if (Main.rand.Next(20) == 0) + { + switch (Main.rand.Next(3)) + { + case 0: + player.QuickSpawnItem(mod.ItemType("StressPills")); + break; + case 1: + player.QuickSpawnItem(mod.ItemType("Laudanum")); + break; + case 2: + player.QuickSpawnItem(mod.ItemType("HeartofDarkness")); + break; + } + } + } player.TryGettingDevArmor(); if (Main.rand.Next(7) == 0) { @@ -63,21 +82,17 @@ namespace CalamityMod.Items.Cryogen { player.QuickSpawnItem(mod.ItemType("SnowstormStaff")); } - if (Main.rand.Next(5) == 0) - { - player.QuickSpawnItem(ItemID.FrozenKey); - } - if (Main.rand.Next(10) == 0) - { - player.QuickSpawnItem(mod.ItemType("CryoStone")); - } - if (CalamityWorld.revenge) - { - player.QuickSpawnItem(mod.ItemType("FrostFlare")); - } - player.QuickSpawnItem(ItemID.SoulofMight, Main.rand.Next(25, 41)); - player.QuickSpawnItem(mod.ItemType("CryoBar"), Main.rand.Next(20, 41)); - player.QuickSpawnItem(mod.ItemType("EssenceofEleum"), Main.rand.Next(4, 6)); + if (Main.rand.Next(5) == 0) + { + player.QuickSpawnItem(ItemID.FrozenKey); + } + if (Main.rand.Next(10) == 0) + { + player.QuickSpawnItem(mod.ItemType("CryoStone")); + } + player.QuickSpawnItem(ItemID.SoulofMight, Main.rand.Next(25, 41)); + player.QuickSpawnItem(mod.ItemType("CryoBar"), Main.rand.Next(20, 41)); + player.QuickSpawnItem(mod.ItemType("EssenceofEleum"), Main.rand.Next(5, 10)); player.QuickSpawnItem(mod.ItemType("SoulofCryogen")); player.QuickSpawnItem(ItemID.FrostCore); } diff --git a/Items/Cryogen/SoulofCryogen.cs b/Items/Cryogen/SoulofCryogen.cs index 6e92722f5e..41b8e1bb61 100644 --- a/Items/Cryogen/SoulofCryogen.cs +++ b/Items/Cryogen/SoulofCryogen.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Cryogen "Average vertical speed\n" + "Flight time: 100\n" + "5% increase to all damage and pick speed\n" + - "Frost damage added to melee projectiles and melee attacks"); + "All melee attacks and projectiles inflict frostburn"); Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(8, 4)); } diff --git a/Items/CrystylCrusher.cs b/Items/CrystylCrusher.cs index a6993783f6..3276103879 100644 --- a/Items/CrystylCrusher.cs +++ b/Items/CrystylCrusher.cs @@ -34,18 +34,8 @@ namespace CalamityMod.Items item.UseSound = SoundID.Item1; item.autoReuse = true; item.tileBoost += 50; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(255, 0, 255); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 16; + } public override void AddRecipes() { diff --git a/Items/DarksunFragment.cs b/Items/DarksunFragment.cs index 7a44d07fbe..729623620b 100644 --- a/Items/DarksunFragment.cs +++ b/Items/DarksunFragment.cs @@ -8,39 +8,31 @@ using Terraria.ModLoader; using CalamityMod.NPCs; using CalamityMod.Items; -namespace CalamityMod.Items { -public class DarksunFragment : ModItem +namespace CalamityMod.Items { - public override void SetStaticDefaults() + public class DarksunFragment : ModItem { - DisplayName.SetDefault("Darksun Fragment"); - Tooltip.SetDefault("A shard of lunar and solar energy"); + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Darksun Fragment"); + Tooltip.SetDefault("A shard of lunar and solar energy"); + } + + public override void Update(ref float gravity, ref float maxFallSpeed) + { + maxFallSpeed = 0f; + float num = (float)Main.rand.Next(90, 111) * 0.01f; + num *= Main.essScale; + Lighting.AddLight((int)((item.position.X + (float)(item.width / 2)) / 16f), (int)((item.position.Y + (float)(item.height / 2)) / 16f), 0.5f * num, 0.5f * num, 0.5f * num); + } + + public override void SetDefaults() + { + item.width = 20; + item.height = 20; + item.maxStack = 999; + item.value = Item.buyPrice(0, 8, 0, 0); + item.GetGlobalItem(mod).postMoonLordRarity = 15; + } } - - public override void Update(ref float gravity, ref float maxFallSpeed) - { - maxFallSpeed *= 0f; - float num = (float)Main.rand.Next(90, 111) * 0.01f; - num *= Main.essScale; - Lighting.AddLight((int)((item.position.X + (float)(item.width / 2)) / 16f), (int)((item.position.Y + (float)(item.height / 2)) / 16f), 0.5f * num, 0.5f * num, 0.5f * num); - } - - public override void SetDefaults() - { - item.width = 20; - item.height = 20; - item.maxStack = 999; - item.value = 80000; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(108, 45, 199); - } - } - } -}} \ No newline at end of file +} \ No newline at end of file diff --git a/Items/DefiledRune.cs b/Items/DefiledRune.cs index ae641e4742..49aaafe04d 100644 --- a/Items/DefiledRune.cs +++ b/Items/DefiledRune.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items public override void SetStaticDefaults() { DisplayName.SetDefault("Defiled Rune"); - Tooltip.SetDefault("Wings do nothing\n" + + Tooltip.SetDefault("Wings do nothing and enemies can critically hit you\n" + "Increases most rare item drop chances and enemies drop 50% more cash\n" + "Using this while a boss is alive will instantly kill you and despawn the boss\n" + "Can only be used in revengeance and death mode\n" + diff --git a/Items/DemonicBoneAsh.cs b/Items/DemonicBoneAsh.cs index c058e85e5e..af3c0d7464 100644 --- a/Items/DemonicBoneAsh.cs +++ b/Items/DemonicBoneAsh.cs @@ -7,20 +7,22 @@ using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Items; -namespace CalamityMod.Items { -public class DemonicBoneAsh : ModItem +namespace CalamityMod.Items { - public override void SetStaticDefaults() + public class DemonicBoneAsh : ModItem { - DisplayName.SetDefault("Demonic Bone Ash"); + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Demonic Bone Ash"); + } + + public override void SetDefaults() + { + item.width = 20; + item.height = 20; + item.maxStack = 999; + item.value = Item.buyPrice(0, 2, 0, 0); + item.rare = 3; + } } - - public override void SetDefaults() - { - item.width = 20; - item.height = 20; - item.maxStack = 999; - item.value = 20000; - item.rare = 3; - } -}} \ No newline at end of file +} \ No newline at end of file diff --git a/Items/DesertFeather.cs b/Items/DesertFeather.cs index 83e433d560..b5a294b974 100644 --- a/Items/DesertFeather.cs +++ b/Items/DesertFeather.cs @@ -7,20 +7,22 @@ using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Items; -namespace CalamityMod.Items { -public class DesertFeather : ModItem +namespace CalamityMod.Items { - public override void SetStaticDefaults() + public class DesertFeather : ModItem { - DisplayName.SetDefault("Desert Feather"); + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Desert Feather"); + } + + public override void SetDefaults() + { + item.width = 24; + item.height = 24; + item.maxStack = 999; + item.value = Item.buyPrice(0, 0, 10, 0); + item.rare = 1; + } } - - public override void SetDefaults() - { - item.width = 24; - item.height = 24; - item.maxStack = 999; - item.value = 5000; - item.rare = 2; - } -}} \ No newline at end of file +} \ No newline at end of file diff --git a/Items/DesertScourge/AeroStone.cs b/Items/DesertScourge/AeroStone.cs index 87de3e5497..51e2f669ce 100644 --- a/Items/DesertScourge/AeroStone.cs +++ b/Items/DesertScourge/AeroStone.cs @@ -4,6 +4,7 @@ using Terraria.ID; using Terraria.DataStructures; using Terraria.ModLoader; using CalamityMod; +using CalamityMod.Items.CalamityCustomThrowingDamage; namespace CalamityMod.Items.DesertScourge { @@ -13,7 +14,7 @@ namespace CalamityMod.Items.DesertScourge { DisplayName.SetDefault("Aero Stone"); Tooltip.SetDefault("One of the ancient relics\n" + - "Increases movement speed by 10%, jump speed by 200%, and all damage and crit chance by 2%"); + "Increases movement speed by 10%, jump speed by 200%, and all damage by 3%"); Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(4, 8)); } @@ -28,18 +29,15 @@ namespace CalamityMod.Items.DesertScourge public override void UpdateAccessory(Player player, bool hideVisual) { - Lighting.AddLight((int)player.Center.X / 16, (int)player.Center.Y / 16, 0f, 0.425f, 0.425f); + CalamityCustomThrowingDamagePlayer modPlayer = CalamityCustomThrowingDamagePlayer.ModPlayer(player); + Lighting.AddLight((int)player.Center.X / 16, (int)player.Center.Y / 16, 0f, 0.425f, 0.425f); player.moveSpeed += 0.1f; player.jumpSpeedBoost += 2.0f; - player.meleeCrit += 2; - player.meleeDamage += 0.02f; - player.magicCrit += 2; - player.magicDamage += 0.02f; - player.rangedCrit += 2; - player.rangedDamage += 0.02f; - player.thrownCrit += 2; - player.thrownDamage += 0.02f; - player.minionDamage += 0.02f; + player.meleeDamage += 0.03f; + player.magicDamage += 0.03f; + player.rangedDamage += 0.03f; + modPlayer.throwingDamage += 0.03f; + player.minionDamage += 0.03f; } } } diff --git a/Items/DesertScourge/DesertScourgeBag.cs b/Items/DesertScourge/DesertScourgeBag.cs index b9484be2a6..cae8924c92 100644 --- a/Items/DesertScourge/DesertScourgeBag.cs +++ b/Items/DesertScourge/DesertScourgeBag.cs @@ -7,11 +7,11 @@ namespace CalamityMod.Items.DesertScourge public class DesertScourgeBag : ModItem { public override void SetStaticDefaults() - { - DisplayName.SetDefault("Treasure Bag"); - Tooltip.SetDefault("{$CommonItemTooltip.RightClickToOpen}"); - } - + { + DisplayName.SetDefault("Treasure Bag"); + Tooltip.SetDefault("{$CommonItemTooltip.RightClickToOpen}"); + } + public override void SetDefaults() { item.maxStack = 999; @@ -30,6 +30,25 @@ namespace CalamityMod.Items.DesertScourge public override void OpenBossBag(Player player) { + if (CalamityWorld.revenge) + { + player.QuickSpawnItem(mod.ItemType("ScourgeoftheDesert")); + if (Main.rand.Next(20) == 0) + { + switch (Main.rand.Next(3)) + { + case 0: + player.QuickSpawnItem(mod.ItemType("StressPills")); + break; + case 1: + player.QuickSpawnItem(mod.ItemType("Laudanum")); + break; + case 2: + player.QuickSpawnItem(mod.ItemType("HeartofDarkness")); + break; + } + } + } if (Main.rand.Next(7) == 0) { player.QuickSpawnItem(mod.ItemType("DesertScourgeMask")); @@ -50,74 +69,70 @@ namespace CalamityMod.Items.DesertScourge { player.QuickSpawnItem(mod.ItemType("AquaticDischarge")); } - if (Main.rand.Next(15) == 0) - { - player.QuickSpawnItem(ItemID.HighTestFishingLine); - } - if (Main.rand.Next(30) == 0) - { - player.QuickSpawnItem(ItemID.AnglerTackleBag); - } - if (Main.rand.Next(15) == 0) - { - player.QuickSpawnItem(ItemID.TackleBox); - } - if (Main.rand.Next(10) == 0) - { - player.QuickSpawnItem(ItemID.AnglerEarring); - } - if (Main.rand.Next(10) == 0) - { - player.QuickSpawnItem(ItemID.FishermansGuide); - } - if (Main.rand.Next(10) == 0) - { - player.QuickSpawnItem(ItemID.WeatherRadio); - } - if (Main.rand.Next(10) == 0) - { - player.QuickSpawnItem(ItemID.Sextant); - } - if (Main.rand.Next(5) == 0) - { - player.QuickSpawnItem(ItemID.AnglerHat); - } - if (Main.rand.Next(5) == 0) - { - player.QuickSpawnItem(ItemID.AnglerVest); - } - if (Main.rand.Next(5) == 0) - { - player.QuickSpawnItem(ItemID.AnglerPants); - } - if (Main.rand.Next(5) == 0) - { - player.QuickSpawnItem(ItemID.CratePotion, Main.rand.Next(2, 4)); - } - if (Main.rand.Next(5) == 0) - { - player.QuickSpawnItem(ItemID.FishingPotion, Main.rand.Next(2, 4)); - } - if (Main.rand.Next(5) == 0) - { - player.QuickSpawnItem(ItemID.SonarPotion, Main.rand.Next(2, 4)); - } - if (Main.rand.Next(10) == 0) - { - player.QuickSpawnItem(mod.ItemType("AeroStone")); - } - if (NPC.downedBoss3) - { - if (Main.rand.Next(20) == 0) - { - player.QuickSpawnItem(ItemID.GoldenBugNet); - } - } - if (CalamityWorld.revenge) - { - player.QuickSpawnItem(mod.ItemType("ScourgeoftheDesert")); - } - player.QuickSpawnItem(mod.ItemType("OceanCrest")); + if (Main.rand.Next(15) == 0) + { + player.QuickSpawnItem(ItemID.HighTestFishingLine); + } + if (Main.rand.Next(30) == 0) + { + player.QuickSpawnItem(ItemID.AnglerTackleBag); + } + if (Main.rand.Next(15) == 0) + { + player.QuickSpawnItem(ItemID.TackleBox); + } + if (Main.rand.Next(10) == 0) + { + player.QuickSpawnItem(ItemID.AnglerEarring); + } + if (Main.rand.Next(10) == 0) + { + player.QuickSpawnItem(ItemID.FishermansGuide); + } + if (Main.rand.Next(10) == 0) + { + player.QuickSpawnItem(ItemID.WeatherRadio); + } + if (Main.rand.Next(10) == 0) + { + player.QuickSpawnItem(ItemID.Sextant); + } + if (Main.rand.Next(5) == 0) + { + player.QuickSpawnItem(ItemID.AnglerHat); + } + if (Main.rand.Next(5) == 0) + { + player.QuickSpawnItem(ItemID.AnglerVest); + } + if (Main.rand.Next(5) == 0) + { + player.QuickSpawnItem(ItemID.AnglerPants); + } + if (Main.rand.Next(5) == 0) + { + player.QuickSpawnItem(ItemID.CratePotion, Main.rand.Next(2, 4)); + } + if (Main.rand.Next(5) == 0) + { + player.QuickSpawnItem(ItemID.FishingPotion, Main.rand.Next(2, 4)); + } + if (Main.rand.Next(5) == 0) + { + player.QuickSpawnItem(ItemID.SonarPotion, Main.rand.Next(2, 4)); + } + if (Main.rand.Next(10) == 0) + { + player.QuickSpawnItem(mod.ItemType("AeroStone")); + } + if (NPC.downedBoss3) + { + if (Main.rand.Next(20) == 0) + { + player.QuickSpawnItem(ItemID.GoldenBugNet); + } + } + player.QuickSpawnItem(mod.ItemType("OceanCrest")); player.QuickSpawnItem(mod.ItemType("VictoryShard"), Main.rand.Next(10, 17)); player.QuickSpawnItem(ItemID.Coral, Main.rand.Next(7, 12)); player.QuickSpawnItem(ItemID.Seashell, Main.rand.Next(7, 12)); diff --git a/Items/DesertScourge/VictoryShard.cs b/Items/DesertScourge/VictoryShard.cs index 682cdc5f6c..b8bc40ef5a 100644 --- a/Items/DesertScourge/VictoryShard.cs +++ b/Items/DesertScourge/VictoryShard.cs @@ -7,20 +7,22 @@ using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Items; -namespace CalamityMod.Items.DesertScourge { -public class VictoryShard : ModItem +namespace CalamityMod.Items.DesertScourge { - public override void SetStaticDefaults() + public class VictoryShard : ModItem { - DisplayName.SetDefault("Victory Shard"); + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Victory Shard"); + } + + public override void SetDefaults() + { + item.width = 14; + item.height = 14; + item.maxStack = 999; + item.value = Item.buyPrice(0, 0, 10, 0); + item.rare = 1; + } } - - public override void SetDefaults() - { - item.width = 14; - item.height = 14; - item.maxStack = 999; - item.value = 5000; - item.rare = 2; - } -}} \ No newline at end of file +} \ No newline at end of file diff --git a/Items/DevourerMunsters/ArmoredShell.cs b/Items/DevourerMunsters/ArmoredShell.cs index ddce8b586b..7ece9551bd 100644 --- a/Items/DevourerMunsters/ArmoredShell.cs +++ b/Items/DevourerMunsters/ArmoredShell.cs @@ -7,30 +7,22 @@ using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Items; -namespace CalamityMod.Items.DevourerMunsters { -public class ArmoredShell : ModItem +namespace CalamityMod.Items.DevourerMunsters { - public override void SetStaticDefaults() + public class ArmoredShell : ModItem { - DisplayName.SetDefault("Armored Shell"); + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Armored Shell"); + } + + public override void SetDefaults() + { + item.width = 24; + item.height = 30; + item.maxStack = 999; + item.value = Item.buyPrice(0, 7, 0, 0); + item.GetGlobalItem(mod).postMoonLordRarity = 13; + } } - - public override void SetDefaults() - { - item.width = 24; - item.height = 30; - item.maxStack = 999; - item.value = 15000; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 0); - } - } - } -}} \ No newline at end of file +} \ No newline at end of file diff --git a/Items/DevourerMunsters/DarkPlasma.cs b/Items/DevourerMunsters/DarkPlasma.cs index 465807a1ba..787677adfb 100644 --- a/Items/DevourerMunsters/DarkPlasma.cs +++ b/Items/DevourerMunsters/DarkPlasma.cs @@ -22,19 +22,9 @@ namespace CalamityMod.Items.DevourerMunsters item.width = 15; item.height = 12; item.maxStack = 999; - item.value = 508750; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 0); - } - } - } + item.value = Item.buyPrice(0, 7, 0, 0); + item.GetGlobalItem(mod).postMoonLordRarity = 13; + } public override void Update(ref float gravity, ref float maxFallSpeed) { diff --git a/Items/DevourerMunsters/RuneofCos.cs b/Items/DevourerMunsters/RuneofCos.cs index c6bae0d777..f0830ee3f0 100644 --- a/Items/DevourerMunsters/RuneofCos.cs +++ b/Items/DevourerMunsters/RuneofCos.cs @@ -29,19 +29,9 @@ namespace CalamityMod.Items.DevourerMunsters item.UseSound = SoundID.Item44; item.consumable = false; item.shoot = mod.ProjectileType("VoidSpawn"); + item.GetGlobalItem(mod).postMoonLordRarity = 13; } - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 0); - } - } - } - public override bool CanUseItem(Player player) { return (player.ZoneSkyHeight || player.ZoneUnderworldHeight || player.ZoneDungeon) && diff --git a/Items/DevourerMunsters/TwistingNether.cs b/Items/DevourerMunsters/TwistingNether.cs index fb1481c85e..d1deeec6ff 100644 --- a/Items/DevourerMunsters/TwistingNether.cs +++ b/Items/DevourerMunsters/TwistingNether.cs @@ -7,39 +7,31 @@ using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Items; -namespace CalamityMod.Items.DevourerMunsters { -public class TwistingNether : ModItem +namespace CalamityMod.Items.DevourerMunsters { - public override void SetStaticDefaults() + public class TwistingNether : ModItem { - DisplayName.SetDefault("Twisting Nether"); + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Twisting Nether"); + } + + public override void SetDefaults() + { + item.width = 15; + item.height = 12; + item.maxStack = 999; + item.rare = 10; + item.value = Item.buyPrice(0, 7, 0, 0); + item.GetGlobalItem(mod).postMoonLordRarity = 13; + } + + public override void Update(ref float gravity, ref float maxFallSpeed) + { + maxFallSpeed = 0f; + float num = (float)Main.rand.Next(90, 111) * 0.01f; + num *= Main.essScale; + Lighting.AddLight((int)((item.position.X + (float)(item.width / 2)) / 16f), (int)((item.position.Y + (float)(item.height / 2)) / 16f), 0.5f * num, 0.1f * num, 0.7f * num); + } } - - public override void SetDefaults() - { - item.width = 15; - item.height = 12; - item.maxStack = 999; - item.rare = 9; - item.value = 508750; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 0); - } - } - } - - public override void Update(ref float gravity, ref float maxFallSpeed) - { - maxFallSpeed = 0f; - float num = (float)Main.rand.Next(90, 111) * 0.01f; - num *= Main.essScale; - Lighting.AddLight((int)((item.position.X + (float)(item.width / 2)) / 16f), (int)((item.position.Y + (float)(item.height / 2)) / 16f), 0.5f * num, 0.1f * num, 0.7f * num); - } -}} \ No newline at end of file +} \ No newline at end of file diff --git a/Items/DimensionalSoulArtifact.cs b/Items/DimensionalSoulArtifact.cs index 60f8fadaf3..763b3bcf28 100644 --- a/Items/DimensionalSoulArtifact.cs +++ b/Items/DimensionalSoulArtifact.cs @@ -22,20 +22,10 @@ namespace CalamityMod.Items { item.width = 28; item.height = 28; - item.value = 5000000; - item.accessory = true; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(255, 0, 255); - } - } - } + item.value = Item.buyPrice(1, 50, 0, 0); + item.accessory = true; + item.GetGlobalItem(mod).postMoonLordRarity = 16; + } public override void UpdateAccessory(Player player, bool hideVisual) { diff --git a/Items/DraedonBar.cs b/Items/DraedonBar.cs index 9118e3d053..0f3e8d69cf 100644 --- a/Items/DraedonBar.cs +++ b/Items/DraedonBar.cs @@ -18,11 +18,11 @@ namespace CalamityMod.Items public override void SetDefaults() { - item.width = 15; - item.height = 12; + item.width = 30; + item.height = 24; item.maxStack = 999; - item.value = 120000; - item.rare = 7; + item.value = Item.buyPrice(0, 4, 50, 0); + item.rare = 7; } public override void AddRecipes() diff --git a/Items/Dragonfruit.cs b/Items/Dragonfruit.cs index 60425e83e9..715fbad68a 100644 --- a/Items/Dragonfruit.cs +++ b/Items/Dragonfruit.cs @@ -28,19 +28,9 @@ namespace CalamityMod.Items item.useStyle = 4; item.UseSound = SoundID.Item4; item.consumable = true; + item.GetGlobalItem(mod).postMoonLordRarity = 14; } - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(43, 96, 222); - } - } - } - public override bool CanUseItem(Player player) { CalamityPlayer modPlayer = player.GetModPlayer(mod); @@ -72,7 +62,7 @@ namespace CalamityMod.Items recipe.AddIngredient(ItemID.LifeFruit, 5); recipe.AddIngredient(null, "Phantoplasm", 5); recipe.AddIngredient(null, "CosmiliteBar", 5); - recipe.AddIngredient(null, "EffulgentFeather", 10); + recipe.AddIngredient(null, "DarksunFragment", 10); recipe.AddIngredient(ItemID.FragmentSolar, 15); recipe.AddIngredient(null, "NightmareFuel", 5); recipe.AddIngredient(null, "EndothermicEnergy", 5); diff --git a/Items/EbonianGel.cs b/Items/EbonianGel.cs index 1661b02884..c493819692 100644 --- a/Items/EbonianGel.cs +++ b/Items/EbonianGel.cs @@ -7,20 +7,22 @@ using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Items; -namespace CalamityMod.Items { -public class EbonianGel : ModItem +namespace CalamityMod.Items { - public override void SetStaticDefaults() + public class EbonianGel : ModItem { - DisplayName.SetDefault("Blighted Gel"); + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Blighted Gel"); + } + + public override void SetDefaults() + { + item.width = 16; + item.height = 14; + item.maxStack = 999; + item.value = Item.buyPrice(0, 0, 10, 0); + item.rare = 1; + } } - - public override void SetDefaults() - { - item.width = 16; - item.height = 14; - item.maxStack = 999; - item.value = 1000; - item.rare = 2; - } -}} \ No newline at end of file +} \ No newline at end of file diff --git a/Items/Ectoblood.cs b/Items/Ectoblood.cs index 2b29c11d62..6345f86b3e 100644 --- a/Items/Ectoblood.cs +++ b/Items/Ectoblood.cs @@ -7,20 +7,22 @@ using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Items; -namespace CalamityMod.Items { -public class Ectoblood : ModItem +namespace CalamityMod.Items { - public override void SetStaticDefaults() + public class Ectoblood : ModItem { - DisplayName.SetDefault("Ectoblood"); + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ectoblood"); + } + + public override void SetDefaults() + { + item.width = 24; + item.height = 32; + item.maxStack = 999; + item.value = Item.buyPrice(0, 5, 0, 0); + item.rare = 8; + } } - - public override void SetDefaults() - { - item.width = 24; - item.height = 32; - item.maxStack = 999; - item.value = 3500; - item.rare = 8; - } -}} \ No newline at end of file +} \ No newline at end of file diff --git a/Items/Ectoblood.png b/Items/Ectoblood.png index cabab923fb..566ee2f22d 100644 Binary files a/Items/Ectoblood.png and b/Items/Ectoblood.png differ diff --git a/Items/Ectoheart.cs b/Items/Ectoheart.cs index eb0da68a1a..dd3ba30093 100644 --- a/Items/Ectoheart.cs +++ b/Items/Ectoheart.cs @@ -29,19 +29,9 @@ namespace CalamityMod.Items item.useStyle = 4; item.UseSound = SoundID.Item122; item.consumable = true; + item.GetGlobalItem(mod).postMoonLordRarity = 13; } - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 0); - } - } - } - public override bool CanUseItem(Player player) { CalamityPlayer modPlayer = player.GetModPlayer(mod); diff --git a/Items/EidolonTablet.cs b/Items/EidolonTablet.cs index 2a646c52d6..01a04f8409 100644 --- a/Items/EidolonTablet.cs +++ b/Items/EidolonTablet.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Items { if (Main.netMode != 1) { - int num1302 = NPC.NewNPC((int)player.Center.X + 30, (int)player.Center.Y - 2, NPCID.CultistBoss, 0, 0f, 0f, 0f, 0f, 255); + int num1302 = NPC.NewNPC((int)player.Center.X + 30, (int)player.Center.Y - 90, NPCID.CultistBoss, 0, 0f, 0f, 0f, 0f, 255); Main.npc[num1302].direction = (Main.npc[num1302].spriteDirection = Math.Sign(player.Center.X - (float)player.Center.X - 30f)); } return true; diff --git a/Items/EldritchSoulArtifact.cs b/Items/EldritchSoulArtifact.cs index f864126f1f..f2ba4d7bce 100644 --- a/Items/EldritchSoulArtifact.cs +++ b/Items/EldritchSoulArtifact.cs @@ -21,20 +21,10 @@ namespace CalamityMod.Items { item.width = 28; item.height = 28; - item.value = 5000000; - item.accessory = true; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(255, 0, 255); - } - } - } + item.value = Item.buyPrice(1, 50, 0, 0); + item.accessory = true; + item.GetGlobalItem(mod).postMoonLordRarity = 16; + } public override void UpdateAccessory(Player player, bool hideVisual) { diff --git a/Items/EndothermicEnergy.cs b/Items/EndothermicEnergy.cs index 8cee90732f..6fb6396154 100644 --- a/Items/EndothermicEnergy.cs +++ b/Items/EndothermicEnergy.cs @@ -8,39 +8,31 @@ using Terraria.ModLoader; using CalamityMod.NPCs; using CalamityMod.Items; -namespace CalamityMod.Items { -public class EndothermicEnergy : ModItem +namespace CalamityMod.Items { - public override void SetStaticDefaults() + public class EndothermicEnergy : ModItem { - DisplayName.SetDefault("Endothermic Energy"); - Tooltip.SetDefault("Great for preventing heat stroke"); + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Endothermic Energy"); + Tooltip.SetDefault("Great for preventing heat stroke"); + } + + public override void Update(ref float gravity, ref float maxFallSpeed) + { + maxFallSpeed = 0f; + float num = (float)Main.rand.Next(90, 111) * 0.01f; + num *= Main.essScale; + Lighting.AddLight((int)((item.position.X + (float)(item.width / 2)) / 16f), (int)((item.position.Y + (float)(item.height / 2)) / 16f), 0f * num, 0f * num, 1.2f * num); + } + + public override void SetDefaults() + { + item.width = 20; + item.height = 20; + item.maxStack = 999; + item.value = Item.buyPrice(0, 7, 50, 0); + item.GetGlobalItem(mod).postMoonLordRarity = 14; + } } - - public override void Update(ref float gravity, ref float maxFallSpeed) - { - maxFallSpeed *= 0f; - float num = (float)Main.rand.Next(90, 111) * 0.01f; - num *= Main.essScale; - Lighting.AddLight((int)((item.position.X + (float)(item.width / 2)) / 16f), (int)((item.position.Y + (float)(item.height / 2)) / 16f), 0f * num, 0f * num, 1.2f * num); - } - - public override void SetDefaults() - { - item.width = 20; - item.height = 20; - item.maxStack = 999; - item.value = 50000; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(43, 96, 222); - } - } - } -}} \ No newline at end of file +} \ No newline at end of file diff --git a/Items/EssenceofChaos.cs b/Items/EssenceofChaos.cs index 9429947e94..ace10277a3 100644 --- a/Items/EssenceofChaos.cs +++ b/Items/EssenceofChaos.cs @@ -8,30 +8,31 @@ using Terraria.ModLoader; using CalamityMod.Items; using CalamityMod.NPCs; -namespace CalamityMod.Items { -public class EssenceofChaos : ModItem +namespace CalamityMod.Items { - public override void SetStaticDefaults() + public class EssenceofChaos : ModItem { - DisplayName.SetDefault("Essence of Chaos"); - Tooltip.SetDefault("The essence of underworld creatures"); + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Essence of Chaos"); + Tooltip.SetDefault("The essence of chaotic creatures"); + } + + public override void Update(ref float gravity, ref float maxFallSpeed) + { + maxFallSpeed = 0f; + float num = (float)Main.rand.Next(90, 111) * 0.01f; + num *= Main.essScale; + Lighting.AddLight((int)((item.position.X + (float)(item.width / 2)) / 16f), (int)((item.position.Y + (float)(item.height / 2)) / 16f), 0.5f * num, 0.3f * num, 0.05f * num); + } + + public override void SetDefaults() + { + item.width = 8; + item.height = 10; + item.maxStack = 999; + item.value = Item.buyPrice(0, 3, 0, 0); + item.rare = 5; + } } - - public override void Update(ref float gravity, ref float maxFallSpeed) - { - maxFallSpeed *= 0f; - float num = (float)Main.rand.Next(90, 111) * 0.01f; - num *= Main.essScale; - Lighting.AddLight((int)((item.position.X + (float)(item.width / 2)) / 16f), (int)((item.position.Y + (float)(item.height / 2)) / 16f), 0.5f * num, 0.3f * num, 0.05f * num); - } - - public override void SetDefaults() - { - item.width = 8; - item.height = 10; - item.scale = 1.25f; - item.maxStack = 999; - item.value = 25000; - item.rare = 5; - } -}} \ No newline at end of file +} \ No newline at end of file diff --git a/Items/EssenceofCinder.cs b/Items/EssenceofCinder.cs index 03620d9fd0..6524d24bff 100644 --- a/Items/EssenceofCinder.cs +++ b/Items/EssenceofCinder.cs @@ -8,29 +8,31 @@ using Terraria.ModLoader; using CalamityMod.Items; using CalamityMod.NPCs; -namespace CalamityMod.Items { -public class EssenceofCinder : ModItem +namespace CalamityMod.Items { - public override void SetStaticDefaults() + public class EssenceofCinder : ModItem { - DisplayName.SetDefault("Essence of Cinder"); - Tooltip.SetDefault("The essence of sky and storm creatures"); + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Essence of Sunlight"); + Tooltip.SetDefault("The essence of sky, light, and storm creatures"); + } + + public override void Update(ref float gravity, ref float maxFallSpeed) + { + maxFallSpeed = 0f; + float num = (float)Main.rand.Next(90, 111) * 0.01f; + num *= Main.essScale; + Lighting.AddLight((int)((item.position.X + (float)(item.width / 2)) / 16f), (int)((item.position.Y + (float)(item.height / 2)) / 16f), 0.3f * num, 0.3f * num, 0.05f * num); + } + + public override void SetDefaults() + { + item.width = 8; + item.height = 22; + item.maxStack = 999; + item.value = Item.buyPrice(0, 3, 0, 0); + item.rare = 5; + } } - - public override void Update(ref float gravity, ref float maxFallSpeed) - { - maxFallSpeed *= 0f; - float num = (float)Main.rand.Next(90, 111) * 0.01f; - num *= Main.essScale; - Lighting.AddLight((int)((item.position.X + (float)(item.width / 2)) / 16f), (int)((item.position.Y + (float)(item.height / 2)) / 16f), 0.3f * num, 0.3f * num, 0.05f * num); - } - - public override void SetDefaults() - { - item.width = 8; - item.height = 22; - item.maxStack = 999; - item.value = 25000; - item.rare = 5; - } -}} \ No newline at end of file +} \ No newline at end of file diff --git a/Items/EssenceofEleum.cs b/Items/EssenceofEleum.cs index 7ba7f1f9d3..02c3bdc969 100644 --- a/Items/EssenceofEleum.cs +++ b/Items/EssenceofEleum.cs @@ -8,29 +8,31 @@ using Terraria.ModLoader; using CalamityMod.NPCs; using CalamityMod.Items; -namespace CalamityMod.Items { -public class EssenceofEleum : ModItem +namespace CalamityMod.Items { - public override void SetStaticDefaults() + public class EssenceofEleum : ModItem { - DisplayName.SetDefault("Essence of Eleum"); - Tooltip.SetDefault("The essence of cold creatures"); + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Essence of Eleum"); + Tooltip.SetDefault("The essence of cold creatures"); + } + + public override void Update(ref float gravity, ref float maxFallSpeed) + { + maxFallSpeed = 0f; + float num = (float)Main.rand.Next(90, 111) * 0.01f; + num *= Main.essScale; + Lighting.AddLight((int)((item.position.X + (float)(item.width / 2)) / 16f), (int)((item.position.Y + (float)(item.height / 2)) / 16f), 0.15f * num, 0.05f * num, 0.5f * num); + } + + public override void SetDefaults() + { + item.width = 8; + item.height = 20; + item.maxStack = 999; + item.value = Item.buyPrice(0, 3, 0, 0); + item.rare = 5; + } } - - public override void Update(ref float gravity, ref float maxFallSpeed) - { - maxFallSpeed *= 0f; - float num = (float)Main.rand.Next(90, 111) * 0.01f; - num *= Main.essScale; - Lighting.AddLight((int)((item.position.X + (float)(item.width / 2)) / 16f), (int)((item.position.Y + (float)(item.height / 2)) / 16f), 0.15f * num, 0.05f * num, 0.5f * num); - } - - public override void SetDefaults() - { - item.width = 8; - item.height = 20; - item.maxStack = 999; - item.value = 25000; - item.rare = 5; - } -}} \ No newline at end of file +} \ No newline at end of file diff --git a/Items/Fabsol.cs b/Items/Fabsol.cs index 45399e9438..59c596458f 100644 --- a/Items/Fabsol.cs +++ b/Items/Fabsol.cs @@ -20,8 +20,8 @@ namespace CalamityMod.Items item.useTime = 20; item.useAnimation = 20; item.useStyle = 1; - item.value = 100000000; - item.expert = true; + item.value = Item.buyPrice(3, 0, 0, 0); + item.expert = true; item.UseSound = SoundID.Item3; item.noMelee = true; item.mountType = mod.MountType("Fab"); diff --git a/Items/FabsolStuff/BloodyMary.cs b/Items/FabsolStuff/BloodyMary.cs index 23a46d9eda..de6e649b3d 100644 --- a/Items/FabsolStuff/BloodyMary.cs +++ b/Items/FabsolStuff/BloodyMary.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.FabsolStuff { DisplayName.SetDefault("Bloody Mary"); Tooltip.SetDefault(@"Boosts damage, movement speed, and melee speed by 15% and crit chance by 7% during a Blood Moon -Reduces life regen by 3 and defense by 6 +Reduces life regen by 2 and defense by 6 Extra spicy and bloody!"); } diff --git a/Items/FabsolStuff/BlueCandle.cs b/Items/FabsolStuff/BlueCandle.cs new file mode 100644 index 0000000000..9e91c6a42f --- /dev/null +++ b/Items/FabsolStuff/BlueCandle.cs @@ -0,0 +1,32 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.FabsolStuff +{ + public class BlueCandle: ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Weightless Candle"); + Tooltip.SetDefault("When placed down nearby players have their movement speed increased by 15%, wing time by 10%, and acceleration by 5%"); + } + + public override void SetDefaults() + { + item.width = 28; + item.height = 40; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.value = Item.buyPrice(0, 50, 0, 0); + item.rare = 6; + item.createTile = mod.TileType("BlueCandle"); + } + } +} \ No newline at end of file diff --git a/Items/FabsolStuff/BlueCandle.png b/Items/FabsolStuff/BlueCandle.png index 4acebe2e89..c0168bcada 100644 Binary files a/Items/FabsolStuff/BlueCandle.png and b/Items/FabsolStuff/BlueCandle.png differ diff --git a/Items/FabsolStuff/Everclear.cs b/Items/FabsolStuff/Everclear.cs index 9773845c64..b097d1cb4c 100644 --- a/Items/FabsolStuff/Everclear.cs +++ b/Items/FabsolStuff/Everclear.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.FabsolStuff { DisplayName.SetDefault("Everclear"); Tooltip.SetDefault(@"Boosts damage by 25% -Reduces life regen by 20 and defense by 40 +Reduces life regen by 10 and defense by 40 This is the most potent booze I have, be careful with it"); } diff --git a/Items/FabsolStuff/EvergreenGin.cs b/Items/FabsolStuff/EvergreenGin.cs index c06f3359ea..0d7f25ded8 100644 --- a/Items/FabsolStuff/EvergreenGin.cs +++ b/Items/FabsolStuff/EvergreenGin.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.FabsolStuff { DisplayName.SetDefault("Evergreen Gin"); Tooltip.SetDefault(@"Boosts nature-based weapon damage by 15% and damage reduction by 5% -Reduces life regen by 3 +Reduces life regen by 1 It tastes like a Christmas tree if you can imagine that"); } diff --git a/Items/FabsolStuff/FabsolsVodka.cs b/Items/FabsolStuff/FabsolsVodka.cs index 8913069435..fb7eb0de46 100644 --- a/Items/FabsolStuff/FabsolsVodka.cs +++ b/Items/FabsolStuff/FabsolsVodka.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Items.FabsolStuff public override void SetStaticDefaults() { DisplayName.SetDefault("Fabsol's Vodka"); - Tooltip.SetDefault("Boosts all damage stats by 10% but lowers defense by 20\n" + + Tooltip.SetDefault("Boosts all damage stats by 8% but lowers defense by 20\n" + "Increases immune time after being struck"); } diff --git a/Items/FabsolStuff/Fireball.cs b/Items/FabsolStuff/Fireball.cs index a226063359..80d695bc12 100644 --- a/Items/FabsolStuff/Fireball.cs +++ b/Items/FabsolStuff/Fireball.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.FabsolStuff Tooltip.SetDefault(@"Boosts all fire-based weapon damage by 10% Cursed flame, shadowflame, god slayer inferno, brimstone flame, and frostburn weapons will not receive this benefit The weapon must be more fire-related than anything else -Reduces life regen by 3 +Reduces life regen by 1 A great-tasting cinnamon whiskey"); } diff --git a/Items/FabsolStuff/GrapeBeer.cs b/Items/FabsolStuff/GrapeBeer.cs index cce27c3272..ae065bdd7c 100644 --- a/Items/FabsolStuff/GrapeBeer.cs +++ b/Items/FabsolStuff/GrapeBeer.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.FabsolStuff public override void SetStaticDefaults() { DisplayName.SetDefault("Grape Beer"); - Tooltip.SetDefault(@"Reduces life regen by 1, defense by 2, and movement speed by 5% + Tooltip.SetDefault(@"Reduces defense by 2 and movement speed by 5% This crap is abhorrent but you might like it Restores 100 life and mana"); } diff --git a/Items/FabsolStuff/Margarita.cs b/Items/FabsolStuff/Margarita.cs index 082d061357..ad44a15723 100644 --- a/Items/FabsolStuff/Margarita.cs +++ b/Items/FabsolStuff/Margarita.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.FabsolStuff { DisplayName.SetDefault("Margarita"); Tooltip.SetDefault(@"Makes you immune to most debuffs -Reduces defense by 6 and life regen by 3 +Reduces defense by 6 and life regen by 1 One of the best drinks ever created, enjoy it while it lasts Restores 200 life and mana"); } diff --git a/Items/FabsolStuff/Moonshine.cs b/Items/FabsolStuff/Moonshine.cs index 76a9b2ae07..4bde3d9e4b 100644 --- a/Items/FabsolStuff/Moonshine.cs +++ b/Items/FabsolStuff/Moonshine.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.FabsolStuff { DisplayName.SetDefault("Moonshine"); Tooltip.SetDefault(@"Increases defense by 10 and damage reduction by 5% -Reduces life regen by 2 +Reduces life regen by 1 This stuff is pretty strong but I'm sure you can handle it"); } diff --git a/Items/FabsolStuff/MoscowMule.cs b/Items/FabsolStuff/MoscowMule.cs index 32593e3459..ff7fc82aa7 100644 --- a/Items/FabsolStuff/MoscowMule.cs +++ b/Items/FabsolStuff/MoscowMule.cs @@ -11,8 +11,8 @@ namespace CalamityMod.Items.FabsolStuff public override void SetStaticDefaults() { DisplayName.SetDefault("Moscow Mule"); - Tooltip.SetDefault(@"Boosts damage and knockback by 12% and critical strike chance by 3% -Reduces life regen by 3 + Tooltip.SetDefault(@"Boosts damage and knockback by 9% and critical strike chance by 3% +Reduces life regen by 2 I once heard the copper mug can be toxic and I told 'em 'listen dummy, I'm already poisoning myself'"); } diff --git a/Items/FabsolStuff/OddMushroom.cs b/Items/FabsolStuff/OddMushroom.cs new file mode 100644 index 0000000000..7a511c584b --- /dev/null +++ b/Items/FabsolStuff/OddMushroom.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.DataStructures; + +namespace CalamityMod.Items.FabsolStuff +{ + public class OddMushroom : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Odd Mushroom"); + Tooltip.SetDefault("Trippy"); + } + + public override void SetDefaults() + { + item.width = 42; + item.height = 48; + item.useTurn = true; + item.maxStack = 30; + item.useAnimation = 17; + item.useTime = 17; + item.rare = 3; + item.useStyle = 2; + item.UseSound = SoundID.Item2; + item.consumable = true; + item.buffType = mod.BuffType("Trippy"); + item.buffTime = 216000; + item.value = Item.buyPrice(1, 0, 0, 0); + } + } +} \ No newline at end of file diff --git a/Items/FabsolStuff/PinkCandle.cs b/Items/FabsolStuff/PinkCandle.cs new file mode 100644 index 0000000000..7e9553cb23 --- /dev/null +++ b/Items/FabsolStuff/PinkCandle.cs @@ -0,0 +1,33 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.FabsolStuff +{ + public class PinkCandle: ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Vigorous Candle"); + Tooltip.SetDefault("When placed down nearby players regenerate 0.4% of their maximum health per second\n" + + "This is separate from normal life regeneration, bypassing caps and not being affected by damage taken or current movement"); + } + + public override void SetDefaults() + { + item.width = 28; + item.height = 40; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.value = Item.buyPrice(0, 50, 0, 0); + item.rare = 6; + item.createTile = mod.TileType("PinkCandle"); + } + } +} \ No newline at end of file diff --git a/Items/FabsolStuff/PurpleCandle.cs b/Items/FabsolStuff/PurpleCandle.cs new file mode 100644 index 0000000000..1689920ec4 --- /dev/null +++ b/Items/FabsolStuff/PurpleCandle.cs @@ -0,0 +1,32 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.FabsolStuff +{ + public class PurpleCandle: ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Resilient Candle"); + Tooltip.SetDefault("When placed down nearby players have the effectiveness of their defense increased by 5%"); + } + + public override void SetDefaults() + { + item.width = 28; + item.height = 40; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.value = Item.buyPrice(0, 50, 0, 0); + item.rare = 6; + item.createTile = mod.TileType("PurpleCandle"); + } + } +} \ No newline at end of file diff --git a/Items/FabsolStuff/PurpleCandle.png b/Items/FabsolStuff/PurpleCandle.png index 6cf43cd129..d05ce51406 100644 Binary files a/Items/FabsolStuff/PurpleCandle.png and b/Items/FabsolStuff/PurpleCandle.png differ diff --git a/Items/FabsolStuff/RedWine.cs b/Items/FabsolStuff/RedWine.cs index 0efd07b1b6..b01e87013c 100644 --- a/Items/FabsolStuff/RedWine.cs +++ b/Items/FabsolStuff/RedWine.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.FabsolStuff public override void SetStaticDefaults() { DisplayName.SetDefault("Red Wine"); - Tooltip.SetDefault(@"Reduces life regen by 2 + Tooltip.SetDefault(@"Reduces life regen by 1 Too dry for my taste 15 second duration Restores 200 life"); diff --git a/Items/FabsolStuff/Screwdriver.cs b/Items/FabsolStuff/Screwdriver.cs index 579cb35c4c..d68f4bc548 100644 --- a/Items/FabsolStuff/Screwdriver.cs +++ b/Items/FabsolStuff/Screwdriver.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.FabsolStuff { DisplayName.SetDefault("Screwdriver"); Tooltip.SetDefault(@"Boosts piercing projectile damage by 10% -Reduces life regen by 3 +Reduces life regen by 1 Do you have a screw loose?"); } diff --git a/Items/FabsolStuff/StarBeamRye.cs b/Items/FabsolStuff/StarBeamRye.cs index be847f605f..7c0be1206c 100644 --- a/Items/FabsolStuff/StarBeamRye.cs +++ b/Items/FabsolStuff/StarBeamRye.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.FabsolStuff DisplayName.SetDefault("Star Beam Rye"); Tooltip.SetDefault(@"Boosts max mana by 50, magic damage by 8%, and reduces mana usage by 10% -Reduces defense by 6 and life regen by 3 +Reduces defense by 6 and life regen by 1 Made from some stuff I found near the Astral Meteor crash site, don't worry it's safe, trust me"); } diff --git a/Items/FabsolStuff/Tequila.cs b/Items/FabsolStuff/Tequila.cs index c94ab55a14..6dfad6258e 100644 --- a/Items/FabsolStuff/Tequila.cs +++ b/Items/FabsolStuff/Tequila.cs @@ -11,8 +11,8 @@ namespace CalamityMod.Items.FabsolStuff public override void SetStaticDefaults() { DisplayName.SetDefault("Tequila"); - Tooltip.SetDefault(@"Boosts damage, damage reduction, and knockback by 4%, crit chance by 2%, and defense by 5 during daytime -Reduces life regen by 2 + Tooltip.SetDefault(@"Boosts damage, damage reduction, and knockback by 3%, crit chance by 2%, and defense by 5 during daytime +Reduces life regen by 1 Great for mixing up daytime drinks"); } diff --git a/Items/FabsolStuff/TequilaSunrise.cs b/Items/FabsolStuff/TequilaSunrise.cs index d3a626eb47..3bf377be31 100644 --- a/Items/FabsolStuff/TequilaSunrise.cs +++ b/Items/FabsolStuff/TequilaSunrise.cs @@ -11,8 +11,8 @@ namespace CalamityMod.Items.FabsolStuff public override void SetStaticDefaults() { DisplayName.SetDefault("Tequila Sunrise"); - Tooltip.SetDefault(@"Boosts damage, damage reduction, and knockback by 9%, crit chance by 3%, and defense by 15 during daytime -Reduces life regen by 3 + Tooltip.SetDefault(@"Boosts damage, damage reduction, and knockback by 7%, crit chance by 3%, and defense by 15 during daytime +Reduces life regen by 1 The greatest daytime drink I've ever had"); } diff --git a/Items/FabsolStuff/Vodka.cs b/Items/FabsolStuff/Vodka.cs index 2a60580dd6..a8cef3c37b 100644 --- a/Items/FabsolStuff/Vodka.cs +++ b/Items/FabsolStuff/Vodka.cs @@ -11,8 +11,8 @@ namespace CalamityMod.Items.FabsolStuff public override void SetStaticDefaults() { DisplayName.SetDefault("Vodka"); - Tooltip.SetDefault(@"Boosts damage by 8% and critical strike chance by 2% -Reduces life regen by 2 and defense by 4 + Tooltip.SetDefault(@"Boosts damage by 6% and critical strike chance by 2% +Reduces life regen by 1 and defense by 4 The number one alcohol for creating great mixed drinks"); } diff --git a/Items/FabsolStuff/WhiteWine.cs b/Items/FabsolStuff/WhiteWine.cs index a5d8cbd9a4..18c0a054ae 100644 --- a/Items/FabsolStuff/WhiteWine.cs +++ b/Items/FabsolStuff/WhiteWine.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.FabsolStuff { DisplayName.SetDefault("White Wine"); Tooltip.SetDefault(@"Boosts magic damage by 10% -Reduces defense by 6 and life regen by 3 +Reduces defense by 6 and life regen by 1 I drank a full barrel of this stuff once in one night, I couldn't remember who I was the next day"); } diff --git a/Items/FabsolStuff/YellowCandle.cs b/Items/FabsolStuff/YellowCandle.cs new file mode 100644 index 0000000000..3e73d07b30 --- /dev/null +++ b/Items/FabsolStuff/YellowCandle.cs @@ -0,0 +1,32 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.FabsolStuff +{ + public class YellowCandle: ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Spiteful Candle"); + Tooltip.SetDefault("When placed down nearby enemies take 5% more damage, this bypasses enemy DR"); + } + + public override void SetDefaults() + { + item.width = 28; + item.height = 40; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.value = Item.buyPrice(0, 50, 0, 0); + item.rare = 6; + item.createTile = mod.TileType("YellowCandle"); + } + } +} \ No newline at end of file diff --git a/Items/FetidEssence.cs b/Items/FetidEssence.cs index 9a9f4e1335..58494f98ee 100644 --- a/Items/FetidEssence.cs +++ b/Items/FetidEssence.cs @@ -7,21 +7,23 @@ using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Items; -namespace CalamityMod.Items { -public class FetidEssence : ModItem +namespace CalamityMod.Items { - public override void SetStaticDefaults() + public class FetidEssence : ModItem { - DisplayName.SetDefault("Fetid Essence"); - Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 6)); + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Fetid Essence"); + Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 6)); + } + + public override void SetDefaults() + { + item.width = 20; + item.height = 20; + item.maxStack = 999; + item.value = Item.buyPrice(0, 0, 10, 0); + item.rare = 1; + } } - - public override void SetDefaults() - { - item.width = 20; - item.height = 20; - item.maxStack = 999; - item.value = 5000; - item.rare = 1; - } -}} \ No newline at end of file +} \ No newline at end of file diff --git a/Items/FlamebeakHampick.cs b/Items/FlamebeakHampick.cs index 6ebe747a4a..f70fa58d31 100644 --- a/Items/FlamebeakHampick.cs +++ b/Items/FlamebeakHampick.cs @@ -21,8 +21,8 @@ namespace CalamityMod.Items { item.damage = 58; item.melee = true; - item.width = 36; - item.height = 36; + item.width = 52; + item.height = 50; item.useTime = 6; item.useAnimation = 15; item.useTurn = true; diff --git a/Items/FlamebeakHampick.png b/Items/FlamebeakHampick.png index eca12bd743..2a132ea30e 100644 Binary files a/Items/FlamebeakHampick.png and b/Items/FlamebeakHampick.png differ diff --git a/Items/GalacticaSingularity.cs b/Items/GalacticaSingularity.cs index 82b5683b23..8156974477 100644 --- a/Items/GalacticaSingularity.cs +++ b/Items/GalacticaSingularity.cs @@ -23,8 +23,8 @@ namespace CalamityMod.Items item.width = 28; item.height = 28; item.maxStack = 999; - item.value = 500000; - item.rare = 10; + item.value = Item.buyPrice(0, 6, 0, 0); + item.rare = 10; } public override void AddRecipes() @@ -41,7 +41,7 @@ namespace CalamityMod.Items public override void Update(ref float gravity, ref float maxFallSpeed) { - maxFallSpeed *= 0.0001f; + maxFallSpeed = 0f; float num = (float)Main.rand.Next(90, 111) * 0.01f; num *= Main.essScale; Lighting.AddLight((int)((item.position.X + (float)(item.width / 2)) / 16f), (int)((item.position.Y + (float)(item.height / 2)) / 16f), 1f * num, 0.3f * num, 0.3f * num); diff --git a/Items/GallantPickaxe.cs b/Items/GallantPickaxe.cs index 61a66fd714..eff76a9669 100644 --- a/Items/GallantPickaxe.cs +++ b/Items/GallantPickaxe.cs @@ -34,18 +34,8 @@ namespace CalamityMod.Items item.UseSound = SoundID.Item1; item.autoReuse = true; item.tileBoost += 5; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 200); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 12; + } public override void AddRecipes() { diff --git a/Items/GodlySoulArtifact.cs b/Items/GodlySoulArtifact.cs index 494b211ae7..a62b793423 100644 --- a/Items/GodlySoulArtifact.cs +++ b/Items/GodlySoulArtifact.cs @@ -21,20 +21,10 @@ namespace CalamityMod.Items { item.width = 28; item.height = 28; - item.value = 5000000; - item.accessory = true; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(255, 0, 255); - } - } - } + item.value = Item.buyPrice(1, 50, 0, 0); + item.accessory = true; + item.GetGlobalItem(mod).postMoonLordRarity = 16; + } public override void UpdateAccessory(Player player, bool hideVisual) { diff --git a/Items/GreatSandShark/GrandScale.cs b/Items/GreatSandShark/GrandScale.cs index 262030e3de..72246aa677 100644 --- a/Items/GreatSandShark/GrandScale.cs +++ b/Items/GreatSandShark/GrandScale.cs @@ -22,8 +22,8 @@ namespace CalamityMod.Items.GreatSandShark item.width = 15; item.height = 12; item.maxStack = 999; - item.value = 50000; - item.rare = 7; + item.value = Item.buyPrice(0, 4, 50, 0); + item.rare = 7; } } } \ No newline at end of file diff --git a/Items/GreatSandShark/SandstormsCore.cs b/Items/GreatSandShark/SandstormsCore.cs index 3aa86aaeee..928d0d271d 100644 --- a/Items/GreatSandShark/SandstormsCore.cs +++ b/Items/GreatSandShark/SandstormsCore.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.GreatSandShark item.width = 20; item.height = 20; item.maxStack = 20; - item.rare = 8; + item.rare = 7; item.useAnimation = 45; item.useTime = 45; item.useStyle = 4; diff --git a/Items/GreatbayPickaxe.cs b/Items/GreatbayPickaxe.cs index e6e11862e0..3480a3812a 100644 --- a/Items/GreatbayPickaxe.cs +++ b/Items/GreatbayPickaxe.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items item.useTurn = true; item.pick = 60; item.useStyle = 1; - item.knockBack = 2; + item.knockBack = 2f; item.value = Item.buyPrice(0, 2, 0, 0); item.rare = 2; item.UseSound = SoundID.Item1; diff --git a/Items/GypsyPowder.cs b/Items/GypsyPowder.cs index bbd9d9470c..c38b0535d4 100644 --- a/Items/GypsyPowder.cs +++ b/Items/GypsyPowder.cs @@ -7,20 +7,22 @@ using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Items; -namespace CalamityMod.Items { -public class GypsyPowder : ModItem +namespace CalamityMod.Items { - public override void SetStaticDefaults() + public class GypsyPowder : ModItem { - DisplayName.SetDefault("Gypsy Powder"); + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Gypsy Powder"); + } + + public override void SetDefaults() + { + item.width = 20; + item.height = 20; + item.maxStack = 999; + item.value = Item.buyPrice(0, 3, 0, 0); + item.rare = 5; + } } - - public override void SetDefaults() - { - item.width = 20; - item.height = 20; - item.maxStack = 999; - item.value = 50000; - item.rare = 5; - } -}} \ No newline at end of file +} \ No newline at end of file diff --git a/Items/GypsyPowder.png b/Items/GypsyPowder.png index 227736b310..cead4fc26f 100644 Binary files a/Items/GypsyPowder.png and b/Items/GypsyPowder.png differ diff --git a/Items/HadarianMembrane.cs b/Items/HadarianMembrane.cs new file mode 100644 index 0000000000..589dcd3d56 --- /dev/null +++ b/Items/HadarianMembrane.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items +{ + public class HadarianMembrane : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Hadarian Membrane"); + Tooltip.SetDefault("The membrane of an astral creature's wings"); + } + + public override void SetDefaults() + { + item.width = 22; + item.height = 22; + item.maxStack = 999; + item.value = Item.buyPrice(0, 4, 50, 0); + item.rare = 7; + } + } +} \ No newline at end of file diff --git a/Items/HadarianMembrane.png b/Items/HadarianMembrane.png new file mode 100644 index 0000000000..dc3213df17 Binary files /dev/null and b/Items/HadarianMembrane.png differ diff --git a/Items/HiveMind/HiveMindBag.cs b/Items/HiveMind/HiveMindBag.cs index a0e2d84970..362d14daae 100644 --- a/Items/HiveMind/HiveMindBag.cs +++ b/Items/HiveMind/HiveMindBag.cs @@ -7,11 +7,11 @@ namespace CalamityMod.Items.HiveMind public class HiveMindBag : ModItem { public override void SetStaticDefaults() - { - DisplayName.SetDefault("Treasure Bag"); - Tooltip.SetDefault("{$CommonItemTooltip.RightClickToOpen}"); - } - + { + DisplayName.SetDefault("Treasure Bag"); + Tooltip.SetDefault("{$CommonItemTooltip.RightClickToOpen}"); + } + public override void SetDefaults() { item.maxStack = 999; @@ -30,6 +30,24 @@ namespace CalamityMod.Items.HiveMind public override void OpenBossBag(Player player) { + if (CalamityWorld.revenge) + { + if (Main.rand.Next(20) == 0) + { + switch (Main.rand.Next(3)) + { + case 0: + player.QuickSpawnItem(mod.ItemType("StressPills")); + break; + case 1: + player.QuickSpawnItem(mod.ItemType("Laudanum")); + break; + case 2: + player.QuickSpawnItem(mod.ItemType("HeartofDarkness")); + break; + } + } + } if (Main.rand.Next(3) == 0) { player.QuickSpawnItem(mod.ItemType("ShaderainStaff")); @@ -46,7 +64,7 @@ namespace CalamityMod.Items.HiveMind { player.QuickSpawnItem(mod.ItemType("HiveMindMask")); } - if(Main.rand.Next(3) == 0) + if (Main.rand.Next(3) == 0) { player.QuickSpawnItem(mod.ItemType("PerfectDark")); } @@ -66,10 +84,10 @@ namespace CalamityMod.Items.HiveMind player.QuickSpawnItem(ItemID.RottenChunk, Main.rand.Next(10, 21)); player.QuickSpawnItem(ItemID.DemoniteBar, Main.rand.Next(9, 15)); player.QuickSpawnItem(mod.ItemType("TrueShadowScale"), Main.rand.Next(30, 41)); - if (Main.hardMode) - { - player.QuickSpawnItem(ItemID.CursedFlame, Main.rand.Next(15, 31)); - } - } + if (Main.hardMode) + { + player.QuickSpawnItem(ItemID.CursedFlame, Main.rand.Next(15, 31)); + } + } } } \ No newline at end of file diff --git a/Items/HiveMind/RottenBrain.cs b/Items/HiveMind/RottenBrain.cs index 53c7a3783f..c6cb1ef54b 100644 --- a/Items/HiveMind/RottenBrain.cs +++ b/Items/HiveMind/RottenBrain.cs @@ -55,18 +55,8 @@ namespace CalamityMod.Items.HiveMind } } } - if (player.statLife <= (player.statLifeMax2 * 0.75f)) - { - player.meleeDamage += 0.1f; - player.magicDamage += 0.1f; - player.rangedDamage += 0.1f; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.1f; - player.minionDamage += 0.1f; - } - if (player.statLife <= (player.statLifeMax2 * 0.5f)) - { - player.moveSpeed -= 0.05f; - } + CalamityPlayer modPlayer = player.GetModPlayer(mod); + modPlayer.rBrain = true; } } } \ No newline at end of file diff --git a/Items/HiveMind/TrueShadowScale.cs b/Items/HiveMind/TrueShadowScale.cs index 8c80a7a68e..59cd811cdc 100644 --- a/Items/HiveMind/TrueShadowScale.cs +++ b/Items/HiveMind/TrueShadowScale.cs @@ -7,20 +7,22 @@ using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Items; -namespace CalamityMod.Items.HiveMind { -public class TrueShadowScale : ModItem +namespace CalamityMod.Items.HiveMind { - public override void SetStaticDefaults() + public class TrueShadowScale : ModItem { - DisplayName.SetDefault("True Shadow Scale"); + public override void SetStaticDefaults() + { + DisplayName.SetDefault("True Shadow Scale"); + } + + public override void SetDefaults() + { + item.width = 16; + item.height = 22; + item.maxStack = 999; + item.value = Item.buyPrice(0, 0, 50, 0); + item.rare = 2; + } } - - public override void SetDefaults() - { - item.width = 16; - item.height = 22; - item.maxStack = 999; - item.value = 2500; - item.rare = 2; - } -}} \ No newline at end of file +} \ No newline at end of file diff --git a/Items/Leviathan/EnchantedPearl.png b/Items/Leviathan/EnchantedPearl.png index b633ed63cb..a036b0d126 100644 Binary files a/Items/Leviathan/EnchantedPearl.png and b/Items/Leviathan/EnchantedPearl.png differ diff --git a/Items/Leviathan/IOU.cs b/Items/Leviathan/IOU.cs index 766b5c2122..c8f784edfc 100644 --- a/Items/Leviathan/IOU.cs +++ b/Items/Leviathan/IOU.cs @@ -7,20 +7,22 @@ using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Items; -namespace CalamityMod.Items.Leviathan { -public class IOU : ModItem +namespace CalamityMod.Items.Leviathan { - public override void SetStaticDefaults() + public class IOU : ModItem { - DisplayName.SetDefault("IOU an item"); - Tooltip.SetDefault("Use to craft any Leviathan weapon you want\nCombine with Living Shards from Plantera to get your item!"); + public override void SetStaticDefaults() + { + DisplayName.SetDefault("IOU an item"); + Tooltip.SetDefault("Use to craft any Leviathan weapon you want\nCombine with Living Shards from Plantera to get your item!"); + } + + public override void SetDefaults() + { + item.width = 26; + item.height = 26; + item.value = Item.buyPrice(0, 0, 10, 0); + item.rare = 1; + } } - - public override void SetDefaults() - { - item.width = 26; - item.height = 26; - item.value = 100; - item.rare = 1; - } -}} \ No newline at end of file +} \ No newline at end of file diff --git a/Items/Leviathan/LeviathanAmbergris.cs b/Items/Leviathan/LeviathanAmbergris.cs index cb21970376..2ac69dc57f 100644 --- a/Items/Leviathan/LeviathanAmbergris.cs +++ b/Items/Leviathan/LeviathanAmbergris.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Leviathan Tooltip.SetDefault("You leave behind poisonous seawater as you move\n" + "75% increased movement speed, 10% increase to all damage, and plus 20 defense while submerged in liquid\n" + "If you are damaged while submerged in liquid you will gain a damaging aura for a short time\n" + - "Being outside of liquid decreases all damage done by 5% but increases damage reduction by 5%"); + "Being outside of liquid increases all damage by 5% and increases damage reduction by 5%"); } public override void SetDefaults() @@ -33,25 +33,28 @@ namespace CalamityMod.Items.Leviathan public override void UpdateAccessory(Player player, bool hideVisual) { player.ignoreWater = true; - if (!Collision.DrownCollision(player.position, player.width, player.height, player.gravDir)) - { - player.endurance += 0.05f; - player.meleeDamage -= 0.05f; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage -= 0.05f; - player.rangedDamage -= 0.05f; - player.magicDamage -= 0.05f; - player.minionDamage -= 0.05f; - } - else - { - player.meleeDamage += 0.1f; - CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.1f; - player.rangedDamage += 0.1f; - player.magicDamage += 0.1f; - player.minionDamage += 0.1f; - player.statDefense += 20; - player.moveSpeed += 0.75f; - } + if (!player.lavaWet && !player.honeyWet) + { + if (!Collision.DrownCollision(player.position, player.width, player.height, player.gravDir)) + { + player.endurance += 0.05f; + player.meleeDamage += 0.05f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.05f; + player.rangedDamage += 0.05f; + player.magicDamage += 0.05f; + player.minionDamage += 0.05f; + } + else + { + player.meleeDamage += 0.1f; + CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.1f; + player.rangedDamage += 0.1f; + player.magicDamage += 0.1f; + player.minionDamage += 0.1f; + player.statDefense += 20; + player.moveSpeed += 0.75f; + } + } if (((double)player.velocity.X > 0 || (double)player.velocity.Y > 0 || (double)player.velocity.X < -0.1 || (double)player.velocity.Y < -0.1)) { if (player.whoAmI == Main.myPlayer) diff --git a/Items/Leviathan/LeviathanBag.cs b/Items/Leviathan/LeviathanBag.cs index f9b154a20d..6619919162 100644 --- a/Items/Leviathan/LeviathanBag.cs +++ b/Items/Leviathan/LeviathanBag.cs @@ -7,11 +7,11 @@ namespace CalamityMod.Items.Leviathan public class LeviathanBag : ModItem { public override void SetStaticDefaults() - { - DisplayName.SetDefault("Treasure Bag"); - Tooltip.SetDefault("{$CommonItemTooltip.RightClickToOpen}"); - } - + { + DisplayName.SetDefault("Treasure Bag"); + Tooltip.SetDefault("{$CommonItemTooltip.RightClickToOpen}"); + } + public override void SetDefaults() { item.maxStack = 999; @@ -30,36 +30,98 @@ namespace CalamityMod.Items.Leviathan public override void OpenBossBag(Player player) { - player.TryGettingDevArmor(); - if (Main.rand.Next(3) == 0) + bool hardMode = Main.hardMode; + if (CalamityWorld.revenge) { - player.QuickSpawnItem(mod.ItemType("Atlantis")); //done + if (Main.rand.Next(100) == 0) + { + player.QuickSpawnItem(mod.ItemType("TheCommunity")); + } + else if (CalamityWorld.defiled) + { + if (Main.rand.Next(20) == 0) + { + player.QuickSpawnItem(mod.ItemType("TheCommunity")); + } + } + if (Main.rand.Next(20) == 0) + { + switch (Main.rand.Next(3)) + { + case 0: + player.QuickSpawnItem(mod.ItemType("StressPills")); + break; + case 1: + player.QuickSpawnItem(mod.ItemType("Laudanum")); + break; + case 2: + player.QuickSpawnItem(mod.ItemType("HeartofDarkness")); + break; + } + } } - if (Main.rand.Next(3) == 0) + player.QuickSpawnItem(mod.ItemType("EnchantedPearl")); + if (Main.rand.Next(10) == 0) { - player.QuickSpawnItem(mod.ItemType("BrackishFlask")); //done + player.QuickSpawnItem(ItemID.HotlineFishingHook); } - if (Main.rand.Next(3) == 0) + if (Main.rand.Next(10) == 0) { - player.QuickSpawnItem(mod.ItemType("Leviatitan")); //done + player.QuickSpawnItem(ItemID.BottomlessBucket); } - if (Main.rand.Next(3) == 0) + if (Main.rand.Next(10) == 0) { - player.QuickSpawnItem(mod.ItemType("LureofEnthrallment")); + player.QuickSpawnItem(ItemID.SuperAbsorbantSponge); } - if (Main.rand.Next(3) == 0) + if (Main.rand.Next(5) == 0) { - player.QuickSpawnItem(mod.ItemType("SirensSong")); //done + player.QuickSpawnItem(ItemID.CratePotion, Main.rand.Next(5, 9)); } - if (Main.rand.Next(3) == 0) + if (Main.rand.Next(5) == 0) { - player.QuickSpawnItem(mod.ItemType("Greentide")); //done + player.QuickSpawnItem(ItemID.FishingPotion, Main.rand.Next(5, 9)); + } + if (Main.rand.Next(5) == 0) + { + player.QuickSpawnItem(ItemID.SonarPotion, Main.rand.Next(5, 9)); + } + if (!hardMode) + { + player.QuickSpawnItem(mod.ItemType("IOU")); } if (Main.rand.Next(7) == 0) { player.QuickSpawnItem(mod.ItemType("LeviathanMask")); } - player.QuickSpawnItem(mod.ItemType("LeviathanAmbergris")); //done + if (hardMode) + { + player.TryGettingDevArmor(); + if (Main.rand.Next(3) == 0) + { + player.QuickSpawnItem(mod.ItemType("Atlantis")); //done + } + if (Main.rand.Next(3) == 0) + { + player.QuickSpawnItem(mod.ItemType("BrackishFlask")); //done + } + if (Main.rand.Next(3) == 0) + { + player.QuickSpawnItem(mod.ItemType("Leviatitan")); //done + } + if (Main.rand.Next(3) == 0) + { + player.QuickSpawnItem(mod.ItemType("LureofEnthrallment")); + } + if (Main.rand.Next(3) == 0) + { + player.QuickSpawnItem(mod.ItemType("SirensSong")); //done + } + if (Main.rand.Next(3) == 0) + { + player.QuickSpawnItem(mod.ItemType("Greentide")); //done + } + player.QuickSpawnItem(mod.ItemType("LeviathanAmbergris")); //done + } } } } \ No newline at end of file diff --git a/Items/LivingShard.cs b/Items/LivingShard.cs index 2bd277f7fb..142ff02c00 100644 --- a/Items/LivingShard.cs +++ b/Items/LivingShard.cs @@ -8,20 +8,22 @@ using Terraria.ModLoader; using CalamityMod.Items; using CalamityMod.NPCs; -namespace CalamityMod.Items { -public class LivingShard : ModItem +namespace CalamityMod.Items { - public override void SetStaticDefaults() + public class LivingShard : ModItem { - DisplayName.SetDefault("Living Shard"); + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Living Shard"); + } + + public override void SetDefaults() + { + item.width = 14; + item.height = 14; + item.maxStack = 999; + item.value = Item.buyPrice(0, 4, 50, 0); + item.rare = 7; + } } - - public override void SetDefaults() - { - item.width = 14; - item.height = 14; - item.maxStack = 999; - item.value = 15000; - item.rare = 7; - } -}} \ No newline at end of file +} \ No newline at end of file diff --git a/Items/ManeaterBulb.cs b/Items/ManeaterBulb.cs index 95e0ee3afb..fd59f0c5f5 100644 --- a/Items/ManeaterBulb.cs +++ b/Items/ManeaterBulb.cs @@ -7,20 +7,22 @@ using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Items; -namespace CalamityMod.Items { -public class ManeaterBulb : ModItem +namespace CalamityMod.Items { - public override void SetStaticDefaults() + public class ManeaterBulb : ModItem { - DisplayName.SetDefault("Maneater Bulb"); + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Maneater Bulb"); + } + + public override void SetDefaults() + { + item.width = 20; + item.height = 20; + item.maxStack = 999; + item.value = Item.buyPrice(0, 0, 10, 0); + item.rare = 1; + } } - - public override void SetDefaults() - { - item.width = 20; - item.height = 20; - item.maxStack = 999; - item.value = 10000; - item.rare = 2; - } -}} \ No newline at end of file +} \ No newline at end of file diff --git a/Items/MeldBlob.cs b/Items/MeldBlob.cs index 797c50c1f4..f4184e7482 100644 --- a/Items/MeldBlob.cs +++ b/Items/MeldBlob.cs @@ -7,20 +7,22 @@ using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Items; -namespace CalamityMod.Items { -public class MeldBlob : ModItem +namespace CalamityMod.Items { - public override void SetStaticDefaults() + public class MeldBlob : ModItem { - DisplayName.SetDefault("Meld Blob"); + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Meld Blob"); + } + + public override void SetDefaults() + { + item.width = 16; + item.height = 14; + item.maxStack = 999; + item.value = Item.buyPrice(0, 0, 10, 0); + item.rare = 9; + } } - - public override void SetDefaults() - { - item.width = 16; - item.height = 14; - item.maxStack = 999; - item.value = 23750; - item.rare = 8; - } -}} \ No newline at end of file +} \ No newline at end of file diff --git a/Items/MeldiateBar.cs b/Items/MeldiateBar.cs index 40f75d3900..465676ed84 100644 --- a/Items/MeldiateBar.cs +++ b/Items/MeldiateBar.cs @@ -21,8 +21,8 @@ namespace CalamityMod.Items item.width = 15; item.height = 12; item.maxStack = 999; - item.value = 75000; - item.rare = 9; + item.value = Item.buyPrice(0, 5, 50, 0); + item.rare = 9; } public override void AddRecipes() diff --git a/Items/MurkyPaste.cs b/Items/MurkyPaste.cs index 66e0b39343..71a6c849f6 100644 --- a/Items/MurkyPaste.cs +++ b/Items/MurkyPaste.cs @@ -7,20 +7,22 @@ using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Items; -namespace CalamityMod.Items { -public class MurkyPaste : ModItem +namespace CalamityMod.Items { - public override void SetStaticDefaults() + public class MurkyPaste : ModItem { - DisplayName.SetDefault("Murky Paste"); + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Murky Paste"); + } + + public override void SetDefaults() + { + item.width = 20; + item.height = 20; + item.maxStack = 999; + item.value = Item.buyPrice(0, 0, 10, 0); + item.rare = 1; + } } - - public override void SetDefaults() - { - item.width = 20; - item.height = 20; - item.maxStack = 999; - item.value = 5000; - item.rare = 1; - } -}} \ No newline at end of file +} \ No newline at end of file diff --git a/Items/MurkySludge.cs b/Items/MurkySludge.cs index 95e3201c0d..2fb35bdb49 100644 --- a/Items/MurkySludge.cs +++ b/Items/MurkySludge.cs @@ -7,20 +7,22 @@ using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Items; -namespace CalamityMod.Items { -public class MurkySludge : ModItem +namespace CalamityMod.Items { - public override void SetStaticDefaults() + public class MurkySludge : ModItem { - DisplayName.SetDefault("Murky Sludge"); + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Murky Sludge"); + } + + public override void SetDefaults() + { + item.width = 20; + item.height = 20; + item.maxStack = 999; + item.value = Item.buyPrice(0, 0, 10, 0); + item.rare = 1; + } } - - public override void SetDefaults() - { - item.width = 20; - item.height = 20; - item.maxStack = 999; - item.value = 20000; - item.rare = 1; - } -}} \ No newline at end of file +} \ No newline at end of file diff --git a/Items/NightmareFuel.cs b/Items/NightmareFuel.cs index bd7602cf0f..b07fe76265 100644 --- a/Items/NightmareFuel.cs +++ b/Items/NightmareFuel.cs @@ -8,39 +8,31 @@ using Terraria.ModLoader; using CalamityMod.Items; using CalamityMod.NPCs; -namespace CalamityMod.Items { -public class NightmareFuel : ModItem +namespace CalamityMod.Items { - public override void SetStaticDefaults() + public class NightmareFuel : ModItem { - DisplayName.SetDefault("Nightmare Fuel"); - Tooltip.SetDefault("May drain your sanity"); + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Nightmare Fuel"); + Tooltip.SetDefault("May drain your sanity"); + } + + public override void Update(ref float gravity, ref float maxFallSpeed) + { + maxFallSpeed = 0f; + float num = (float)Main.rand.Next(90, 111) * 0.01f; + num *= Main.essScale; + Lighting.AddLight((int)((item.position.X + (float)(item.width / 2)) / 16f), (int)((item.position.Y + (float)(item.height / 2)) / 16f), 0.7f * num, 0.7f * num, 0f * num); + } + + public override void SetDefaults() + { + item.width = 20; + item.height = 20; + item.maxStack = 999; + item.value = Item.buyPrice(0, 7, 50, 0); + item.GetGlobalItem(mod).postMoonLordRarity = 14; + } } - - public override void Update(ref float gravity, ref float maxFallSpeed) - { - maxFallSpeed *= 0f; - float num = (float)Main.rand.Next(90, 111) * 0.01f; - num *= Main.essScale; - Lighting.AddLight((int)((item.position.X + (float)(item.width / 2)) / 16f), (int)((item.position.Y + (float)(item.height / 2)) / 16f), 0.7f * num, 0.7f * num, 0f * num); - } - - public override void SetDefaults() - { - item.width = 20; - item.height = 20; - item.maxStack = 999; - item.value = 50000; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(43, 96, 222); - } - } - } -}} \ No newline at end of file +} \ No newline at end of file diff --git a/Items/OmegaHealingPotion.cs b/Items/OmegaHealingPotion.cs index a7faf7ad34..5a93a94ff2 100644 --- a/Items/OmegaHealingPotion.cs +++ b/Items/OmegaHealingPotion.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items item.width = 28; item.height = 18; item.useTurn = true; - item.maxStack = 30; + item.maxStack = 999; item.healLife = 300; item.useAnimation = 17; item.useTime = 17; @@ -28,19 +28,9 @@ namespace CalamityMod.Items item.UseSound = SoundID.Item3; item.consumable = true; item.potion = true; - item.value = 100000; + item.value = Item.buyPrice(0, 7, 0, 0); + item.GetGlobalItem(mod).postMoonLordRarity = 13; } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 0); - } - } - } public override void AddRecipes() { diff --git a/Items/Patreon/ApronOfAffection.cs b/Items/Patreon/ApronOfAffection.cs new file mode 100644 index 0000000000..0e453e4acf --- /dev/null +++ b/Items/Patreon/ApronOfAffection.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items.Patreon; + +namespace CalamityMod.Items.Patreon +{ + [AutoloadEquip(EquipType.Body)] + public class ApronOfAffection : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ace's Apron of Affection"); + Tooltip.SetDefault("Great for hugging people"); + } + + public override void SetDefaults() + { + item.width = 18; + item.height = 18; + item.rare = 5; + item.GetGlobalItem(mod).postMoonLordRarity = 21; + item.value = Item.buyPrice(0, 15, 0, 0); + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Robe); + recipe.AddIngredient(ItemID.LovePotion, 10); + recipe.AddIngredient(ItemID.LifeCrystal); + recipe.AddTile(TileID.Loom); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} \ No newline at end of file diff --git a/Items/Patreon/ApronOfAffection.png b/Items/Patreon/ApronOfAffection.png new file mode 100644 index 0000000000..14f3648cfc Binary files /dev/null and b/Items/Patreon/ApronOfAffection.png differ diff --git a/Items/Patreon/ApronOfAffection_Arms.png b/Items/Patreon/ApronOfAffection_Arms.png new file mode 100644 index 0000000000..99ebab7431 Binary files /dev/null and b/Items/Patreon/ApronOfAffection_Arms.png differ diff --git a/Items/Patreon/ApronOfAffection_Body.png b/Items/Patreon/ApronOfAffection_Body.png new file mode 100644 index 0000000000..fa5df8aea5 Binary files /dev/null and b/Items/Patreon/ApronOfAffection_Body.png differ diff --git a/Items/Patreon/Ataraxia.cs b/Items/Patreon/Ataraxia.cs new file mode 100644 index 0000000000..3f015e091c --- /dev/null +++ b/Items/Patreon/Ataraxia.cs @@ -0,0 +1,146 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.Patreon +{ + public class Ataraxia : ModItem + { + public static int BaseDamage = 3120; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ataraxia"); + Tooltip.SetDefault("Equanimity"); + } + + public override void SetDefaults() + { + item.width = 94; + item.height = 92; + item.melee = true; + item.damage = BaseDamage; + item.knockBack = 2.5f; + item.useAnimation = 18; + item.useTime = 18; + item.autoReuse = true; + item.useTurn = true; + + item.useStyle = 1; + item.UseSound = SoundID.Item1; + + item.rare = 10; + item.GetGlobalItem(mod).postMoonLordRarity = 21; + item.value = Item.buyPrice(2, 50, 0, 0); + + item.shoot = mod.ProjectileType("AtaraxiaMain"); + item.shootSpeed = 9f; + } + + public override void GetWeaponDamage(Player player, ref int damage) + { + float damageBoost = (float)BaseDamage * player.GetModPlayer(mod).ataraxiaDamageBoost; + float damageAdd = damageBoost + (float)BaseDamage; + damage = (int)(damageAdd * player.meleeDamage); + } + + // Fires one large and two small projectiles which stay together in formation. + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + // Play the Terra Blade sound upon firing + Main.PlaySound(SoundID.Item60, position); + + // Center projectile + int centerID = mod.ProjectileType("AtaraxiaMain"); + int centerDamage = damage; + Vector2 centerVec = new Vector2(speedX, speedY); + int center = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, centerID, centerDamage, knockBack, player.whoAmI, 0.0f, 0.0f); + + // Side projectiles (these deal 75% damage) + int sideID = mod.ProjectileType("AtaraxiaSide"); + int sideDamage = (int)(0.75f * centerDamage); + Vector2 speed = new Vector2(speedX, speedY); + speed.Normalize(); + speed *= 22f; + Vector2 rrp = player.RotatedRelativePoint(player.MountedCenter, true); + Vector2 leftOffset = speed.RotatedBy((double)(MathHelper.PiOver4), default(Vector2)); + Vector2 rightOffset = speed.RotatedBy((double)(-MathHelper.PiOver4), default(Vector2)); + leftOffset -= 1.4f * speed; + rightOffset -= 1.4f * speed; + Projectile.NewProjectile(rrp.X + leftOffset.X, rrp.Y + leftOffset.Y, speedX, speedY, sideID, sideDamage, knockBack, player.whoAmI, 0.0f, 0.0f); + Projectile.NewProjectile(rrp.X + rightOffset.X, rrp.Y + rightOffset.Y, speedX, speedY, sideID, sideDamage, knockBack, player.whoAmI, 0.0f, 0.0f); + return false; + } + + // On-hit, tosses out five homing projectiles. This is not like Holy Collider. + public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(BuffID.ShadowFlame, 480); + target.AddBuff(BuffID.Ichor, 480); + + // Does not summon extra projectiles versus dummies. + if (target.type == NPCID.TargetDummy) + return; + + // Individual true melee homing missiles deal 10% of the weapon's base damage. + int numSplits = 5; + int trueMeleeID = mod.ProjectileType("AtaraxiaHoming"); + int trueMeleeDamage = (int)(0.1f * damage); + float angleVariance = MathHelper.TwoPi / (float)numSplits; + float spinOffsetAngle = MathHelper.Pi / (2f * numSplits); + Vector2 posVec = new Vector2(8f, 0f).RotatedByRandom(MathHelper.TwoPi); + + for (int i = 0; i < numSplits; ++i) + { + posVec = posVec.RotatedBy(angleVariance); + Vector2 velocity = new Vector2(posVec.X, posVec.Y).RotatedBy(spinOffsetAngle); + velocity.Normalize(); + velocity *= 8f; + Projectile.NewProjectile(target.Center + posVec, velocity, trueMeleeID, trueMeleeDamage, knockback, player.whoAmI, 0.0f, 0.0f); + } + } + + // Spawn some fancy dust while swinging + public override void MeleeEffects(Player player, Rectangle hitbox) + { + int dustCount = Main.rand.Next(3, 6); + Vector2 corner = new Vector2(hitbox.X + hitbox.Width / 4, hitbox.Y + hitbox.Height / 4); + for (int i = 0; i < dustCount; ++i) + { + // Pick a random dust to spawn + int dustID = -1; + switch (Main.rand.Next(5)) + { + case 0: + case 1: dustID = 70; break; + case 2: dustID = 71; break; + default: dustID = 86; break; + } + int idx = Dust.NewDust(corner, hitbox.Width / 2, hitbox.Height / 2, dustID); + Main.dust[idx].noGravity = true; + } + } + + public override void AddRecipes() + { + ModRecipe r = new ModRecipe(mod); + r.AddIngredient(ItemID.BrokenHeroSword); + r.AddIngredient(null, "CosmiliteBar", 25); + r.AddIngredient(null, "Phantoplasm", 35); + r.AddIngredient(null, "NightmareFuel", 90); + r.AddIngredient(null, "EndothermicEnergy", 90); + r.AddIngredient(null, "DarksunFragment", 65); + r.AddIngredient(null, "BarofLife", 15); + r.AddIngredient(null, "CoreofCalamity", 5); + r.AddIngredient(null, "HellcasterFragment", 10); + r.AddTile(null, "DraedonsForge"); + r.SetResult(this); + r.AddRecipe(); + } + } +} diff --git a/Items/Patreon/Ataraxia.png b/Items/Patreon/Ataraxia.png new file mode 100644 index 0000000000..662e12fe8e Binary files /dev/null and b/Items/Patreon/Ataraxia.png differ diff --git a/Items/Patreon/DarkSpark.cs b/Items/Patreon/DarkSpark.cs index 769edee43e..c889c356df 100644 --- a/Items/Patreon/DarkSpark.cs +++ b/Items/Patreon/DarkSpark.cs @@ -1,73 +1,63 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items; - -namespace CalamityMod.Items.Patreon -{ - public class DarkSpark : ModItem - { +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.Patreon +{ + public class DarkSpark : ModItem + { public override void SetStaticDefaults() { DisplayName.SetDefault("Dark Spark"); - Tooltip.SetDefault("And everything under the sun is in tune,\n" + + Tooltip.SetDefault("And everything under the sun is in tune,\n" + "But the sun is eclipsed by the moon."); - Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 4)); + Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 4)); } - public override void SetDefaults() - { - item.damage = 100; - item.magic = true; - item.mana = 10; - item.width = 16; - item.height = 16; - item.useTime = 10; - item.useAnimation = 10; - item.reuseDelay = 5; - item.useStyle = 4; - item.UseSound = SoundID.Item13; - item.noMelee = true; - item.noUseGraphic = true; - item.channel = true; - item.knockBack = 0f; - item.value = Item.buyPrice(1, 40, 0, 0); - item.rare = 10; - item.shoot = mod.ProjectileType("DarkSpark"); - item.shootSpeed = 30f; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(139, 0, 0); - } - } - } - - public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, mod.ProjectileType("DarkSpark"), damage, knockBack, player.whoAmI, 0.0f, 0.0f); - return false; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.LastPrism); - recipe.AddIngredient(null, "DarkPlasma", 10); - recipe.AddIngredient(null, "RuinousSoul", 20); - recipe.AddIngredient(null, "DivineGeode", 30); - recipe.AddTile(TileID.LunarCraftingStation); - recipe.SetResult(this); - recipe.AddRecipe(); - } - } + public override void SetDefaults() + { + item.damage = 100; + item.magic = true; + item.mana = 10; + item.width = 16; + item.height = 16; + item.useTime = 10; + item.useAnimation = 10; + item.reuseDelay = 5; + item.useStyle = 4; + item.UseSound = SoundID.Item13; + item.noMelee = true; + item.noUseGraphic = true; + item.channel = true; + item.knockBack = 0f; + item.value = Item.buyPrice(1, 40, 0, 0); + item.rare = 10; + item.shoot = mod.ProjectileType("DarkSpark"); + item.shootSpeed = 30f; + item.GetGlobalItem(mod).postMoonLordRarity = 21; + } + + public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, mod.ProjectileType("DarkSpark"), damage, knockBack, player.whoAmI, 0.0f, 0.0f); + return false; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.LastPrism); + recipe.AddIngredient(null, "DarkPlasma", 10); + recipe.AddIngredient(null, "RuinousSoul", 20); + recipe.AddIngredient(null, "DivineGeode", 30); + recipe.AddTile(TileID.LunarCraftingStation); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } } \ No newline at end of file diff --git a/Items/Patreon/DivineRetribution.cs b/Items/Patreon/DivineRetribution.cs index bc114465e0..4c72794f51 100644 --- a/Items/Patreon/DivineRetribution.cs +++ b/Items/Patreon/DivineRetribution.cs @@ -1,112 +1,102 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Patreon -{ - public class DivineRetribution : ModItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Divine Retribution"); - Tooltip.SetDefault("Mage is superior to rogue; look, we got a donor weapon to prove it!"); - Item.staff[item.type] = true; - } - - public override void SetDefaults() - { - item.damage = 60; - item.magic = true; - item.mana = 15; - item.width = 66; - item.height = 88; - item.useTime = 12; - item.useAnimation = 12; - item.useStyle = 5; - item.noMelee = true; - item.knockBack = 3.5f; - item.value = Item.buyPrice(1, 40, 0, 0); - item.rare = 10; - item.UseSound = SoundID.Item73; - item.autoReuse = true; - item.shootSpeed = 19f; - item.shoot = mod.ProjectileType("DivineRetribution"); - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(139, 0, 0); - } - } - } - - public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - float num72 = item.shootSpeed; - Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); - float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; - float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; - if (player.gravDir == -1f) - { - num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; - } - float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); - if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) - { - num78 = (float)player.direction; - num79 = 0f; - num80 = num72; - } - else - { - num80 = num72 / num80; - } - int num107 = Main.rand.Next(5, 7); - for (int num108 = 0; num108 < num107; num108++) - { - vector2 = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(51) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - /* - */ player.position.X), player.MountedCenter.Y + 600f); //- - vector2.X = (vector2.X + player.Center.X) / 2f + (float)Main.rand.Next(-50, 51); //200 - vector2.Y += (float)(100 * num108); //-= - num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; //+ - - num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; //+ - - if (num79 < 0f) - { - num79 *= -1f; - } - if (num79 < 20f) - { - num79 = 20f; - } - num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); - num80 = num72 / num80; - num78 *= num80; - num79 *= num80; - float speedX6 = num78 + (float)Main.rand.Next(-60, 61) * 0.02f; - float speedY7 = num79 + (float)Main.rand.Next(-60, 61) * 0.02f; - float ai1 = (Main.rand.NextFloat() + 0.5f); - int bullet2 = Projectile.NewProjectile(vector2.X, vector2.Y, speedX6, -speedY7, type, damage, knockBack, player.whoAmI, 0.0f, ai1); - } - return false; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "DivineGeode", 8); - recipe.AddIngredient(null, "UndinesRetribution"); - recipe.AddIngredient(null, "UeliaceBar", 6); - recipe.AddIngredient(null, "UnholyEssence", 10); - recipe.AddTile(TileID.LunarCraftingStation); - recipe.SetResult(this); - recipe.AddRecipe(); - } - } +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Patreon +{ + public class DivineRetribution : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Divine Retribution"); + Tooltip.SetDefault("Mage is superior to rogue; look, we got a donor weapon to prove it!"); + Item.staff[item.type] = true; + } + + public override void SetDefaults() + { + item.damage = 60; + item.magic = true; + item.mana = 15; + item.width = 66; + item.height = 88; + item.useTime = 12; + item.useAnimation = 12; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 3.5f; + item.value = Item.buyPrice(1, 40, 0, 0); + item.rare = 10; + item.UseSound = SoundID.Item73; + item.autoReuse = true; + item.shootSpeed = 19f; + item.shoot = mod.ProjectileType("DivineRetribution"); + item.GetGlobalItem(mod).postMoonLordRarity = 21; + } + + public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + float num72 = item.shootSpeed; + Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); + float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; + float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; + if (player.gravDir == -1f) + { + num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; + } + float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); + if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) + { + num78 = (float)player.direction; + num79 = 0f; + num80 = num72; + } + else + { + num80 = num72 / num80; + } + int num107 = Main.rand.Next(5, 7); + for (int num108 = 0; num108 < num107; num108++) + { + vector2 = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(51) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - /* - */ player.position.X), player.MountedCenter.Y + 600f); //- + vector2.X = (vector2.X + player.Center.X) / 2f + (float)Main.rand.Next(-50, 51); //200 + vector2.Y += (float)(100 * num108); //-= + num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; //+ - + num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; //+ - + if (num79 < 0f) + { + num79 *= -1f; + } + if (num79 < 20f) + { + num79 = 20f; + } + num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); + num80 = num72 / num80; + num78 *= num80; + num79 *= num80; + float speedX6 = num78 + (float)Main.rand.Next(-60, 61) * 0.02f; + float speedY7 = num79 + (float)Main.rand.Next(-60, 61) * 0.02f; + float ai1 = (Main.rand.NextFloat() + 0.5f); + int bullet2 = Projectile.NewProjectile(vector2.X, vector2.Y, speedX6, -speedY7, type, damage, knockBack, player.whoAmI, 0.0f, ai1); + } + return false; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "DivineGeode", 8); + recipe.AddIngredient(null, "UndinesRetribution"); + recipe.AddIngredient(null, "UeliaceBar", 6); + recipe.AddIngredient(null, "UnholyEssence", 10); + recipe.AddTile(TileID.LunarCraftingStation); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } } \ No newline at end of file diff --git a/Items/Patreon/FaceMelter.cs b/Items/Patreon/FaceMelter.cs new file mode 100644 index 0000000000..6e49f9b371 --- /dev/null +++ b/Items/Patreon/FaceMelter.cs @@ -0,0 +1,102 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.Patreon +{ + public class FaceMelter : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Face Melter"); + Tooltip.SetDefault("Fires music notes\n" + + "Right click summons an amplifier that shoots towards your mouse\n" + + "WOOO!! FAAAAAAANTASYY WORLDDDDD!"); + } + + public override void SetDefaults() + { + item.damage = 250; + item.magic = true; + item.mana = 5; + item.width = 56; + item.height = 50; + item.useTime = 5; + item.useAnimation = 5; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 5f; + item.rare = 10; + item.GetGlobalItem(mod).postMoonLordRarity = 21; + item.value = Item.buyPrice(1, 80, 0, 0); + item.shoot = mod.ProjectileType("MelterNote1"); + item.UseSound = SoundID.Item47; + item.autoReuse = true; + item.shootSpeed = 20f; + } + + public override Vector2? HoldoutOffset() + { + return new Vector2(-15, 0); + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.TheAxe); + recipe.AddIngredient(ItemID.MagicalHarp); + recipe.AddIngredient(null, "SirensSong"); + recipe.AddIngredient(null, "CosmiliteBar", 10); + recipe.AddIngredient(null, "NightmareFuel", 10); + recipe.AddIngredient(null, "EndothermicEnergy", 10); + recipe.AddTile(null, "DraedonsForge"); + recipe.SetResult(this); + recipe.AddRecipe(); + } + + public override bool AltFunctionUse(Player player) + { + return true; + } + + public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + if (player.altFunctionUse == 2) + { + position = Main.MouseWorld; + speedX = 0; + speedY = 0; + item.useTime = 20; + item.useAnimation = 20; + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, mod.ProjectileType("MelterAmp"), damage, knockBack, player.whoAmI); + return false; + } + else + { + item.useTime = 5; + item.useAnimation = 5; + float SpeedX = speedX; + float SpeedY = speedY; + int note = Main.rand.Next(0, 2); + if (note == 0) + { + damage = (int)(damage * 1.5f); + type = mod.ProjectileType("MelterNote1"); + } + else + { + SpeedX *= 1.5f; + SpeedY *= 1.5f; + type = mod.ProjectileType("MelterNote2"); + } + Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI, 0.0f, 0.0f); + return false; + } + } + } +} \ No newline at end of file diff --git a/Items/Patreon/FaceMelter.png b/Items/Patreon/FaceMelter.png new file mode 100644 index 0000000000..ed88f45965 Binary files /dev/null and b/Items/Patreon/FaceMelter.png differ diff --git a/Items/Patreon/HandheldTank.cs b/Items/Patreon/HandheldTank.cs new file mode 100644 index 0000000000..328407b761 --- /dev/null +++ b/Items/Patreon/HandheldTank.cs @@ -0,0 +1,67 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Patreon +{ + public class HandheldTank : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Handheld Tank"); + } + + public override void SetDefaults() + { + item.width = 110; + item.height = 46; + item.ranged = true; + item.damage = 1850; + item.crit += 15; + item.knockBack = 16f; + item.useTime = 71; + item.useAnimation = 71; + item.autoReuse = true; + + item.useStyle = 5; + item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/TankCannon"); + item.noMelee = true; + + item.value = Item.buyPrice(1, 40, 0, 0); + item.rare = 10; + item.GetGlobalItem(mod).postMoonLordRarity = 21; + + item.shoot = mod.ProjectileType("HandheldTankShell"); + item.shootSpeed = 6f; + item.useAmmo = AmmoID.Rocket; + } + + public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, mod.ProjectileType("HandheldTankShell"), damage, knockBack, player.whoAmI, 0.0f, 0.0f); + return false; + } + + public override Vector2? HoldoutOffset() + { + return new Vector2(-33, 0); + } + + public override void AddRecipes() + { + ModRecipe r = new ModRecipe(mod); + r.AddIngredient(null, "Shroomer"); + r.AddIngredient(ItemID.IronBar, 50); + r.anyIronBar = true; + r.AddIngredient(null, "DivineGeode", 5); + r.AddIngredient(ItemID.TigerSkin); + r.AddTile(TileID.LunarCraftingStation); + r.SetResult(this); + r.AddRecipe(); + } + } +} diff --git a/Items/Patreon/HandheldTank.png b/Items/Patreon/HandheldTank.png new file mode 100644 index 0000000000..9ef1480375 Binary files /dev/null and b/Items/Patreon/HandheldTank.png differ diff --git a/Items/Patreon/Keelhaul.cs b/Items/Patreon/Keelhaul.cs new file mode 100644 index 0000000000..a34b7eb941 --- /dev/null +++ b/Items/Patreon/Keelhaul.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Patreon +{ + public class Keelhaul : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Keelhaul"); + Tooltip.SetDefault("Summons a geyser upon hitting an enemy\n"+ + "Crumple 'em like paper"); + } + + public override void SetDefaults() + { + item.width = 42; + item.height = 42; + item.damage = 55; + item.mana = 50; + item.magic = true; + item.noMelee = true; + item.useTime = 30; + item.useAnimation = 30; + item.useTurn = true; + item.useStyle = 1; + item.knockBack = 2f; + item.UseSound = SoundID.Item102; + item.autoReuse = true; + item.rare = 8; + item.GetGlobalItem(mod).postMoonLordRarity = 21; + item.value = Item.buyPrice(0, 80, 0, 0); + item.shoot = mod.ProjectileType("KeelhaulBubble"); + item.shootSpeed = 15f; + } + } +} diff --git a/Items/Patreon/Keelhaul.png b/Items/Patreon/Keelhaul.png new file mode 100644 index 0000000000..02b6e2f6b8 Binary files /dev/null and b/Items/Patreon/Keelhaul.png differ diff --git a/Items/Patreon/LightGodsBrilliance.cs b/Items/Patreon/LightGodsBrilliance.cs index 1a95c92c05..1b414ee78e 100644 --- a/Items/Patreon/LightGodsBrilliance.cs +++ b/Items/Patreon/LightGodsBrilliance.cs @@ -1,86 +1,76 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items; - -namespace CalamityMod.Items.Patreon -{ - public class LightGodsBrilliance : ModItem - { - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Light God's Brilliance"); - Tooltip.SetDefault("Casts small, homing light beads along with explosive light balls"); - } - - public override void SetDefaults() - { - item.damage = 100; - item.magic = true; - item.mana = 4; - item.width = 34; - item.height = 36; - item.useTime = 3; - item.useAnimation = 3; - item.useStyle = 5; - item.noMelee = true; - item.knockBack = 3f; - item.value = Item.buyPrice(1, 80, 0, 0); - item.rare = 10; - item.UseSound = SoundID.Item9; - item.autoReuse = true; - item.shoot = mod.ProjectileType("LightBead"); - item.shootSpeed = 25f; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(139, 0, 0); - } - } - } - - public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - int num6 = Main.rand.Next(2, 5); - for (int index = 0; index < num6; ++index) - { - float num7 = speedX; - float num8 = speedY; - float SpeedX = speedX + (float) Main.rand.Next(-50, 51) * 0.05f; - float SpeedY = speedY + (float) Main.rand.Next(-50, 51) * 0.05f; - Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, (int)((double)damage), knockBack, player.whoAmI, 0.0f, 0.0f); - } - if (Main.rand.Next(3) == 0) - { - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, mod.ProjectileType("LightBall"), (int)((double)damage * 2.0), knockBack, player.whoAmI, 0.0f, 0.0f); - } - - return false; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "ShadecrystalTome"); - recipe.AddIngredient(null, "AbyssalTome"); - recipe.AddIngredient(ItemID.HolyWater, 10); - recipe.AddIngredient(null, "EndothermicEnergy", 5); - recipe.AddIngredient(null, "NightmareFuel", 5); - recipe.AddIngredient(ItemID.SoulofLight, 30); - recipe.AddIngredient(null, "EffulgentFeather", 5); - recipe.AddTile(TileID.Bookcases); - recipe.SetResult(this); - recipe.AddRecipe(); - } - } +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.Patreon +{ + public class LightGodsBrilliance : ModItem + { + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Light God's Brilliance"); + Tooltip.SetDefault("Casts small, homing light beads along with explosive light balls"); + } + + public override void SetDefaults() + { + item.damage = 100; + item.magic = true; + item.mana = 4; + item.width = 34; + item.height = 36; + item.useTime = 3; + item.useAnimation = 3; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 3f; + item.value = Item.buyPrice(1, 80, 0, 0); + item.rare = 10; + item.UseSound = SoundID.Item9; + item.autoReuse = true; + item.shoot = mod.ProjectileType("LightBead"); + item.shootSpeed = 25f; + item.GetGlobalItem(mod).postMoonLordRarity = 21; + } + + public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + int num6 = Main.rand.Next(2, 5); + for (int index = 0; index < num6; ++index) + { + float num7 = speedX; + float num8 = speedY; + float SpeedX = speedX + (float) Main.rand.Next(-50, 51) * 0.05f; + float SpeedY = speedY + (float) Main.rand.Next(-50, 51) * 0.05f; + Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, (int)((double)damage), knockBack, player.whoAmI, 0.0f, 0.0f); + } + if (Main.rand.Next(3) == 0) + { + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, mod.ProjectileType("LightBall"), (int)((double)damage * 2.0), knockBack, player.whoAmI, 0.0f, 0.0f); + } + + return false; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "ShadecrystalTome"); + recipe.AddIngredient(null, "AbyssalTome"); + recipe.AddIngredient(ItemID.HolyWater, 10); + recipe.AddIngredient(null, "EndothermicEnergy", 5); + recipe.AddIngredient(null, "NightmareFuel", 5); + recipe.AddIngredient(ItemID.SoulofLight, 30); + recipe.AddIngredient(null, "EffulgentFeather", 5); + recipe.AddTile(TileID.Bookcases); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } } \ No newline at end of file diff --git a/Items/Patreon/NormalityRelocator.cs b/Items/Patreon/NormalityRelocator.cs new file mode 100644 index 0000000000..50b5a299ed --- /dev/null +++ b/Items/Patreon/NormalityRelocator.cs @@ -0,0 +1,51 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.NPCs; + +namespace CalamityMod.Items.Patreon +{ + public class NormalityRelocator : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Normality Relocator"); + Tooltip.SetDefault("I'll be there in the blink of an eye\n" + + "Press Z to teleport to the position of the mouse\n" + + "Boosts movement and fall speed by 10%\n" + + "Works while in the inventory"); + Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 7)); + } + + public override void SetDefaults() + { + item.width = 38; + item.height = 38; + item.value = Item.buyPrice(1, 20, 0, 0); + item.rare = 10; + item.GetGlobalItem(mod).postMoonLordRarity = 21; + } + + public override void UpdateInventory(Player player) + { + CalamityPlayer modPlayer = player.GetModPlayer(mod); + modPlayer.normalityRelocator = true; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.RodofDiscord); + recipe.AddIngredient(ItemID.FragmentStardust, 30); + recipe.AddIngredient(null, "ExodiumClusterOre", 10); + recipe.AddIngredient(null, "Cinderplate", 5); + recipe.AddTile(TileID.LunarCraftingStation); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} \ No newline at end of file diff --git a/Items/Patreon/NormalityRelocator.png b/Items/Patreon/NormalityRelocator.png new file mode 100644 index 0000000000..d856aea220 Binary files /dev/null and b/Items/Patreon/NormalityRelocator.png differ diff --git a/Items/Patreon/ProfanedSoulArtifact.cs b/Items/Patreon/ProfanedSoulArtifact.cs index 7d0e1c73c8..ccad5441ae 100644 --- a/Items/Patreon/ProfanedSoulArtifact.cs +++ b/Items/Patreon/ProfanedSoulArtifact.cs @@ -1,63 +1,53 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.NPCs; - -namespace CalamityMod.Items.Patreon -{ - public class ProfanedSoulArtifact : ModItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Profaned Soul Artifact"); - Tooltip.SetDefault("Profanation\n" + //idk what tooltip haha - "Summons a healer guardian which heals for a certain amount of health every few seconds\n" + - "Summons a defensive guardian if you have at least 8 minion slots, which boosts your movement speed and your damage resistance\n" + - "Summons an offensive guardian if you are wearing the tarragon summon set (or stronger), which boosts your summon damage and your minion slots\n" + - "If you get hit their effects will disappear for 5 seconds"); - Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 6)); - } - - public override void SetDefaults() - { - item.width = 32; - item.height = 40; - item.value = Item.buyPrice(1, 40, 0, 0); - item.rare = 10; - item.accessory = true; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(139, 0, 0); - } - } - } - - public override void UpdateAccessory(Player player, bool hideVisual) - { - CalamityPlayer modPlayer = player.GetModPlayer(mod); - modPlayer.pArtifact = true; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "Cinderplate", 5); - recipe.AddIngredient(null, "CoreofCinder"); - recipe.AddIngredient(null, "DivineGeode", 5); - recipe.AddIngredient(null, "ExodiumClusterOre", 15); - recipe.AddTile(TileID.DemonAltar); - recipe.SetResult(this); - recipe.AddRecipe(); - } - } +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.NPCs; + +namespace CalamityMod.Items.Patreon +{ + public class ProfanedSoulArtifact : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Profaned Soul Artifact"); + Tooltip.SetDefault("Profanation\n" + //idk what tooltip haha + "Summons a healer guardian which heals for a certain amount of health every few seconds\n" + + "Summons a defensive guardian if you have at least 8 minion slots, which boosts your movement speed and your damage resistance\n" + + "Summons an offensive guardian if you are wearing the tarragon summon set (or stronger), which boosts your summon damage and your minion slots\n" + + "If you get hit their effects will disappear for 5 seconds"); + Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 6)); + } + + public override void SetDefaults() + { + item.width = 32; + item.height = 40; + item.value = Item.buyPrice(1, 40, 0, 0); + item.rare = 10; + item.accessory = true; + item.GetGlobalItem(mod).postMoonLordRarity = 21; + } + + public override void UpdateAccessory(Player player, bool hideVisual) + { + CalamityPlayer modPlayer = player.GetModPlayer(mod); + modPlayer.pArtifact = true; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "Cinderplate", 5); + recipe.AddIngredient(null, "CoreofCinder"); + recipe.AddIngredient(null, "DivineGeode", 5); + recipe.AddIngredient(null, "ExodiumClusterOre", 15); + recipe.AddTile(TileID.DemonAltar); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } } \ No newline at end of file diff --git a/Items/Patreon/ThePack.cs b/Items/Patreon/ThePack.cs new file mode 100644 index 0000000000..c51ddf1192 --- /dev/null +++ b/Items/Patreon/ThePack.cs @@ -0,0 +1,65 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.Patreon +{ + public class ThePack : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("The Pack"); + Tooltip.SetDefault("Fires large homing rockets that explode into more homing mini rockets when in proximity to an enemy"); + } + + public override void SetDefaults() + { + item.damage = 3000; + item.crit += 10; + item.ranged = true; + item.width = 142; + item.height = 62; + item.useTime = 50; + item.useAnimation = 50; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 7.5f; + item.value = Item.buyPrice(1, 80, 0, 0); + item.rare = 10; + item.GetGlobalItem(mod).postMoonLordRarity = 21; + item.UseSound = SoundID.Item11; + item.autoReuse = true; + item.shootSpeed = 24f; + item.shoot = mod.ProjectileType("ThePackMissile"); + item.useAmmo = 771; + } + + public override Vector2? HoldoutOffset() + { + return new Vector2(-70, 0); + } + + public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, mod.ProjectileType("ThePackMissile"), damage, knockBack, player.whoAmI, 0.0f, 0.0f); + return false; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "Scorpion"); + recipe.AddIngredient(ItemID.MarbleBlock, 50); + recipe.AddIngredient(null, "CosmiliteBar", 10); + recipe.AddIngredient(null, "ArmoredShell", 4); + recipe.AddTile(null, "DraedonsForge"); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} \ No newline at end of file diff --git a/Items/Patreon/ThePack.png b/Items/Patreon/ThePack.png new file mode 100644 index 0000000000..00a6cffcc3 Binary files /dev/null and b/Items/Patreon/ThePack.png differ diff --git a/Items/Perforator/BloodSample.cs b/Items/Perforator/BloodSample.cs index 4078ca4772..47a9cba72f 100644 --- a/Items/Perforator/BloodSample.cs +++ b/Items/Perforator/BloodSample.cs @@ -7,21 +7,22 @@ using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Items; -namespace CalamityMod.Items.Perforator { -public class BloodSample : ModItem +namespace CalamityMod.Items.Perforator { - public override void SetStaticDefaults() + public class BloodSample : ModItem { - DisplayName.SetDefault("Blood Sample"); + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Blood Sample"); + } + + public override void SetDefaults() + { + item.width = 16; + item.height = 22; + item.maxStack = 999; + item.value = Item.buyPrice(0, 0, 50, 0); + item.rare = 2; + } } - - public override void SetDefaults() - { - item.width = 16; - item.height = 22; - item.scale = 0.5f; - item.maxStack = 999; - item.value = 2500; - item.rare = 2; - } -}} \ No newline at end of file +} \ No newline at end of file diff --git a/Items/Perforator/BloodyWormTooth.cs b/Items/Perforator/BloodyWormTooth.cs index 7b04957cd5..7be0cf257d 100644 --- a/Items/Perforator/BloodyWormTooth.cs +++ b/Items/Perforator/BloodyWormTooth.cs @@ -29,18 +29,8 @@ namespace CalamityMod.Items.Perforator public override void UpdateAccessory(Player player, bool hideVisual) { - if (player.statLife < (int)((double)player.statLifeMax2 * 0.5)) - { - player.meleeDamage += 0.1f; - player.meleeSpeed += 0.1f; - player.endurance += 0.1f; - } - else - { - player.meleeDamage += 0.05f; - player.meleeSpeed += 0.05f; - player.endurance += 0.05f; - } + CalamityPlayer modPlayer = player.GetModPlayer(mod); + modPlayer.bloodyWormTooth = true; } } } \ No newline at end of file diff --git a/Items/Perforator/PerforatorBag.cs b/Items/Perforator/PerforatorBag.cs index 72f869a800..97ceac0fab 100644 --- a/Items/Perforator/PerforatorBag.cs +++ b/Items/Perforator/PerforatorBag.cs @@ -7,11 +7,11 @@ namespace CalamityMod.Items.Perforator public class PerforatorBag : ModItem { public override void SetStaticDefaults() - { - DisplayName.SetDefault("Treasure Bag"); - Tooltip.SetDefault("{$CommonItemTooltip.RightClickToOpen}"); - } - + { + DisplayName.SetDefault("Treasure Bag"); + Tooltip.SetDefault("{$CommonItemTooltip.RightClickToOpen}"); + } + public override void SetDefaults() { item.maxStack = 999; @@ -30,6 +30,24 @@ namespace CalamityMod.Items.Perforator public override void OpenBossBag(Player player) { + if (CalamityWorld.revenge) + { + if (Main.rand.Next(20) == 0) + { + switch (Main.rand.Next(3)) + { + case 0: + player.QuickSpawnItem(mod.ItemType("StressPills")); + break; + case 1: + player.QuickSpawnItem(mod.ItemType("Laudanum")); + break; + case 2: + player.QuickSpawnItem(mod.ItemType("HeartofDarkness")); + break; + } + } + } if (Main.rand.Next(7) == 0) { player.QuickSpawnItem(mod.ItemType("PerforatorMask")); @@ -70,10 +88,10 @@ namespace CalamityMod.Items.Perforator player.QuickSpawnItem(ItemID.Vertebrae, Main.rand.Next(10, 21)); player.QuickSpawnItem(ItemID.CrimtaneBar, Main.rand.Next(9, 15)); player.QuickSpawnItem(mod.ItemType("BloodSample"), Main.rand.Next(30, 41)); - if (Main.hardMode) - { - player.QuickSpawnItem(ItemID.Ichor, Main.rand.Next(15, 31)); - } + if (Main.hardMode) + { + player.QuickSpawnItem(ItemID.Ichor, Main.rand.Next(15, 31)); + } } } } \ No newline at end of file diff --git a/Items/Permafrost/ArcticBearPaw.cs b/Items/Permafrost/ArcticBearPaw.cs index f8e04bf3a6..98d907b334 100644 --- a/Items/Permafrost/ArcticBearPaw.cs +++ b/Items/Permafrost/ArcticBearPaw.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Permafrost } public override void SetDefaults() { - item.damage = 77; + item.damage = 70; item.magic = true; item.mana = 18; item.width = 34; diff --git a/Items/Permafrost/Popo.cs b/Items/Permafrost/Popo.cs index 600164b6e5..bf38d0b79b 100644 --- a/Items/Permafrost/Popo.cs +++ b/Items/Permafrost/Popo.cs @@ -1,66 +1,66 @@ -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Permafrost -{ - public class Popo : ModItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Magic Scarf and Hat"); - Tooltip.SetDefault("Transforms the holder into a snowman\n" + - "Don't let the demons steal your nose"); - } - - public override void SetDefaults() - { - item.width = 26; - item.height = 30; - item.accessory = true; - item.value = 1000000; - item.rare = 5; - } - - public override void UpdateAccessory(Player player, bool hideVisual) - { - CalamityPlayer modPlayer = player.GetModPlayer(); - modPlayer.snowman = true; - if (hideVisual) - { - modPlayer.snowmanHide = true; - } - } - } - - public class PopoHead : EquipTexture - { - public override bool DrawHead() - { - return false; - } - } - - public class PopoNoselessHead : EquipTexture - { - public override bool DrawHead() - { - return false; - } - } - - public class PopoBody : EquipTexture - { - public override bool DrawBody() - { - return false; - } - } - - public class PopoLegs : EquipTexture - { - public override bool DrawLegs() - { - return false; - } - } +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Permafrost +{ + public class Popo : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Magic Scarf and Hat"); + Tooltip.SetDefault("Transforms the holder into a snowman\n" + + "Don't let the demons steal your nose"); + } + + public override void SetDefaults() + { + item.width = 26; + item.height = 30; + item.accessory = true; + item.value = 1000000; + item.rare = 5; + } + + public override void UpdateAccessory(Player player, bool hideVisual) + { + CalamityPlayer modPlayer = player.GetModPlayer(); + modPlayer.snowman = true; + if (hideVisual) + { + modPlayer.snowmanHide = true; + } + } + } + + public class PopoHead : EquipTexture + { + public override bool DrawHead() + { + return false; + } + } + + public class PopoNoselessHead : EquipTexture + { + public override bool DrawHead() + { + return false; + } + } + + public class PopoBody : EquipTexture + { + public override bool DrawBody() + { + return false; + } + } + + public class PopoLegs : EquipTexture + { + public override bool DrawLegs() + { + return false; + } + } } \ No newline at end of file diff --git a/Items/PhantomHeart.cs b/Items/PhantomHeart.cs index 91004871fe..692702bb74 100644 --- a/Items/PhantomHeart.cs +++ b/Items/PhantomHeart.cs @@ -27,19 +27,9 @@ namespace CalamityMod.Items item.useStyle = 4; item.UseSound = SoundID.Item29; item.consumable = true; + item.GetGlobalItem(mod).postMoonLordRarity = 13; } - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 0); - } - } - } - public override bool CanUseItem(Player player) { CalamityPlayer modPlayer = player.GetModPlayer(mod); diff --git a/Items/PhantomHeart.png b/Items/PhantomHeart.png index fe6f71ebfd..62dccdd13f 100644 Binary files a/Items/PhantomHeart.png and b/Items/PhantomHeart.png differ diff --git a/Items/Phantoplasm.cs b/Items/Phantoplasm.cs index ccc16d54c4..ab3e592887 100644 --- a/Items/Phantoplasm.cs +++ b/Items/Phantoplasm.cs @@ -7,36 +7,28 @@ using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Items; -namespace CalamityMod.Items { -public class Phantoplasm : ModItem +namespace CalamityMod.Items { - public override void SetStaticDefaults() + public class Phantoplasm : ModItem { - DisplayName.SetDefault("Phantoplasm"); - Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(5, 5)); - } - - public override void SetDefaults() - { - item.width = 12; - item.height = 12; - item.maxStack = 999; - item.value = 97500; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Phantoplasm"); + Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(5, 5)); + } + + public override void SetDefaults() + { + item.width = 12; + item.height = 12; + item.maxStack = 999; + item.value = Item.buyPrice(0, 7, 0, 0); + item.GetGlobalItem(mod).postMoonLordRarity = 13; + } + + public override Color? GetAlpha(Color lightColor) + { + return new Color(200, 200, 200, 0); + } } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 0); - } - } - } - - public override Color? GetAlpha(Color lightColor) - { - return new Color(200, 200, 200, 0); - } -}} \ No newline at end of file +} \ No newline at end of file diff --git a/Items/Placeables/AbyssBath.cs b/Items/Placeables/AbyssBath.cs index f338ef95b1..958b429c9e 100644 --- a/Items/Placeables/AbyssBath.cs +++ b/Items/Placeables/AbyssBath.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Placeables { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(null, "SmoothAbyssGravel", 14); - recipe.SetResult(this, 1); + recipe.SetResult(this); recipe.AddTile(null, "VoidCondenser"); recipe.AddRecipe(); } diff --git a/Items/Placeables/AbyssGravel.cs b/Items/Placeables/AbyssGravel.cs index ac52f5e258..8323c6400a 100644 --- a/Items/Placeables/AbyssGravel.cs +++ b/Items/Placeables/AbyssGravel.cs @@ -28,8 +28,6 @@ namespace CalamityMod.Items.Placeables item.width = 13; item.height = 10; item.maxStack = 999; - item.value = 1000; - item.rare = 0; } } } \ No newline at end of file diff --git a/Items/Placeables/AerialiteOre.cs b/Items/Placeables/AerialiteOre.cs index d93f43ac46..36c232fbc3 100644 --- a/Items/Placeables/AerialiteOre.cs +++ b/Items/Placeables/AerialiteOre.cs @@ -28,8 +28,8 @@ namespace CalamityMod.Items.Placeables item.width = 13; item.height = 10; item.maxStack = 999; - item.value = 3750; - item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.rare = 3; } } } \ No newline at end of file diff --git a/Items/Placeables/AstralBar.cs b/Items/Placeables/AstralBar.cs index 531cc98a8e..c6a5908c2c 100644 --- a/Items/Placeables/AstralBar.cs +++ b/Items/Placeables/AstralBar.cs @@ -29,7 +29,8 @@ namespace CalamityMod.Items.Placeables item.height = 16; item.maxStack = 99; item.rare = 7; - } + item.value = Item.buyPrice(0, 4, 50, 0); + } public override void AddRecipes() { diff --git a/Items/Placeables/AstralChest.cs b/Items/Placeables/AstralChest.cs new file mode 100644 index 0000000000..c67b8789e8 --- /dev/null +++ b/Items/Placeables/AstralChest.cs @@ -0,0 +1,27 @@ +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables +{ + public class AstralChest : ModItem + { + public override void SetStaticDefaults() + { + } + + public override void SetDefaults() + { + item.width = 26; + item.height = 22; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.value = 500; + item.createTile = mod.TileType("AstralChestLocked"); + } + } +} \ No newline at end of file diff --git a/Items/Placeables/AstralChest.png b/Items/Placeables/AstralChest.png new file mode 100644 index 0000000000..5d4ffcc928 Binary files /dev/null and b/Items/Placeables/AstralChest.png differ diff --git a/Items/Placeables/AstralOre.cs b/Items/Placeables/AstralOre.cs index 3897f6aa3d..277fb7aa47 100644 --- a/Items/Placeables/AstralOre.cs +++ b/Items/Placeables/AstralOre.cs @@ -26,9 +26,9 @@ namespace CalamityMod.Items.Placeables item.consumable = true; item.width = 20; item.height = 20; - item.maxStack = 999; - item.value = 3750; - item.rare = 7; + item.maxStack = 999; + item.value = Item.buyPrice(0, 0, 10, 0); + item.rare = 7; } } } \ No newline at end of file diff --git a/Items/Placeables/AuricOre.cs b/Items/Placeables/AuricOre.cs index 927d847f73..3b0c39ee06 100644 --- a/Items/Placeables/AuricOre.cs +++ b/Items/Placeables/AuricOre.cs @@ -28,18 +28,8 @@ namespace CalamityMod.Items.Placeables item.width = 10; item.height = 10; item.maxStack = 999; - item.value = 50000; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(43, 96, 222); - } - } - } + item.value = Item.buyPrice(0, 0, 10, 0); + item.GetGlobalItem(mod).postMoonLordRarity = 14; + } } } \ No newline at end of file diff --git a/Items/Placeables/Banners/AeroSlimeBanner.cs b/Items/Placeables/Banners/AeroSlimeBanner.cs new file mode 100644 index 0000000000..d7335f6d3f --- /dev/null +++ b/Items/Placeables/Banners/AeroSlimeBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class AeroSlimeBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 90; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/AeroSlimeBanner.png b/Items/Placeables/Banners/AeroSlimeBanner.png new file mode 100644 index 0000000000..319d6776a4 Binary files /dev/null and b/Items/Placeables/Banners/AeroSlimeBanner.png differ diff --git a/Items/Placeables/Banners/AmberCrawlerBanner.cs b/Items/Placeables/Banners/AmberCrawlerBanner.cs new file mode 100644 index 0000000000..5f165e9209 --- /dev/null +++ b/Items/Placeables/Banners/AmberCrawlerBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class AmberCrawlerBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 72; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/AmberCrawlerBanner.png b/Items/Placeables/Banners/AmberCrawlerBanner.png new file mode 100644 index 0000000000..a382b8f340 Binary files /dev/null and b/Items/Placeables/Banners/AmberCrawlerBanner.png differ diff --git a/Items/Placeables/Banners/AmethystCrawlerBanner.cs b/Items/Placeables/Banners/AmethystCrawlerBanner.cs new file mode 100644 index 0000000000..00adb22d79 --- /dev/null +++ b/Items/Placeables/Banners/AmethystCrawlerBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class AmethystCrawlerBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 66; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/AmethystCrawlerBanner.png b/Items/Placeables/Banners/AmethystCrawlerBanner.png new file mode 100644 index 0000000000..12513547aa Binary files /dev/null and b/Items/Placeables/Banners/AmethystCrawlerBanner.png differ diff --git a/Items/Placeables/Banners/AngryDogBanner.cs b/Items/Placeables/Banners/AngryDogBanner.cs new file mode 100644 index 0000000000..6dbd070e22 --- /dev/null +++ b/Items/Placeables/Banners/AngryDogBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class AngryDogBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 59; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/AngryDogBanner.png b/Items/Placeables/Banners/AngryDogBanner.png new file mode 100644 index 0000000000..b8cfc63af3 Binary files /dev/null and b/Items/Placeables/Banners/AngryDogBanner.png differ diff --git a/Items/Placeables/Banners/AquaticAberrationBanner.cs b/Items/Placeables/Banners/AquaticAberrationBanner.cs new file mode 100644 index 0000000000..cfa1782798 --- /dev/null +++ b/Items/Placeables/Banners/AquaticAberrationBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class AquaticAberrationBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 10; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/AquaticAberrationBanner.png b/Items/Placeables/Banners/AquaticAberrationBanner.png new file mode 100644 index 0000000000..8f23e9938a Binary files /dev/null and b/Items/Placeables/Banners/AquaticAberrationBanner.png differ diff --git a/Items/Placeables/Banners/AquaticParasiteBanner.cs b/Items/Placeables/Banners/AquaticParasiteBanner.cs new file mode 100644 index 0000000000..6df33a6440 --- /dev/null +++ b/Items/Placeables/Banners/AquaticParasiteBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class AquaticParasiteBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 0; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/AquaticParasiteBanner.png b/Items/Placeables/Banners/AquaticParasiteBanner.png new file mode 100644 index 0000000000..6867326e6e Binary files /dev/null and b/Items/Placeables/Banners/AquaticParasiteBanner.png differ diff --git a/Items/Placeables/Banners/AquaticSeekerBanner.cs b/Items/Placeables/Banners/AquaticSeekerBanner.cs new file mode 100644 index 0000000000..ea3aee661b --- /dev/null +++ b/Items/Placeables/Banners/AquaticSeekerBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class AquaticSeekerBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 6; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/AquaticSeekerBanner.png b/Items/Placeables/Banners/AquaticSeekerBanner.png new file mode 100644 index 0000000000..fcf4dfd284 Binary files /dev/null and b/Items/Placeables/Banners/AquaticSeekerBanner.png differ diff --git a/Items/Placeables/Banners/AquaticUrchinBanner.cs b/Items/Placeables/Banners/AquaticUrchinBanner.cs new file mode 100644 index 0000000000..aefc4ff886 --- /dev/null +++ b/Items/Placeables/Banners/AquaticUrchinBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class AquaticUrchinBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 7; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/AquaticUrchinBanner.png b/Items/Placeables/Banners/AquaticUrchinBanner.png new file mode 100644 index 0000000000..0ea5d15c32 Binary files /dev/null and b/Items/Placeables/Banners/AquaticUrchinBanner.png differ diff --git a/Items/Placeables/Banners/AriesBanner.cs b/Items/Placeables/Banners/AriesBanner.cs new file mode 100644 index 0000000000..67067b2133 --- /dev/null +++ b/Items/Placeables/Banners/AriesBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class AriesBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 34; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/AriesBanner.png b/Items/Placeables/Banners/AriesBanner.png new file mode 100644 index 0000000000..5cb19e4caf Binary files /dev/null and b/Items/Placeables/Banners/AriesBanner.png differ diff --git a/Items/Placeables/Banners/ArmoredDiggerBanner.cs b/Items/Placeables/Banners/ArmoredDiggerBanner.cs new file mode 100644 index 0000000000..490602d508 --- /dev/null +++ b/Items/Placeables/Banners/ArmoredDiggerBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class ArmoredDiggerBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 77; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/ArmoredDiggerBanner.png b/Items/Placeables/Banners/ArmoredDiggerBanner.png new file mode 100644 index 0000000000..4fd60a922f Binary files /dev/null and b/Items/Placeables/Banners/ArmoredDiggerBanner.png differ diff --git a/Items/Placeables/Banners/AstralProbeBanner.cs b/Items/Placeables/Banners/AstralProbeBanner.cs new file mode 100644 index 0000000000..490e544f11 --- /dev/null +++ b/Items/Placeables/Banners/AstralProbeBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class AstralProbeBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 31; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/AstralProbeBanner.png b/Items/Placeables/Banners/AstralProbeBanner.png new file mode 100644 index 0000000000..004b422169 Binary files /dev/null and b/Items/Placeables/Banners/AstralProbeBanner.png differ diff --git a/Items/Placeables/Banners/AstralSlimeBanner.cs b/Items/Placeables/Banners/AstralSlimeBanner.cs new file mode 100644 index 0000000000..a813161c90 --- /dev/null +++ b/Items/Placeables/Banners/AstralSlimeBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class AstralSlimeBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 35; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/AstralSlimeBanner.png b/Items/Placeables/Banners/AstralSlimeBanner.png new file mode 100644 index 0000000000..f0b29d9d7e Binary files /dev/null and b/Items/Placeables/Banners/AstralSlimeBanner.png differ diff --git a/Items/Placeables/Banners/AstralachneaBanner.cs b/Items/Placeables/Banners/AstralachneaBanner.cs new file mode 100644 index 0000000000..1a4e46b847 --- /dev/null +++ b/Items/Placeables/Banners/AstralachneaBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class AstralachneaBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 39; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/AstralachneaBanner.png b/Items/Placeables/Banners/AstralachneaBanner.png new file mode 100644 index 0000000000..bd9aa27f27 Binary files /dev/null and b/Items/Placeables/Banners/AstralachneaBanner.png differ diff --git a/Items/Placeables/Banners/AtlasBanner.cs b/Items/Placeables/Banners/AtlasBanner.cs new file mode 100644 index 0000000000..146b962648 --- /dev/null +++ b/Items/Placeables/Banners/AtlasBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class AtlasBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 36; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/AtlasBanner.png b/Items/Placeables/Banners/AtlasBanner.png new file mode 100644 index 0000000000..e0e2e75d97 Binary files /dev/null and b/Items/Placeables/Banners/AtlasBanner.png differ diff --git a/Items/Placeables/Banners/BOHLDOHRBanner.cs b/Items/Placeables/Banners/BOHLDOHRBanner.cs new file mode 100644 index 0000000000..13bc4de6f6 --- /dev/null +++ b/Items/Placeables/Banners/BOHLDOHRBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class BOHLDOHRBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 87; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/BOHLDOHRBanner.png b/Items/Placeables/Banners/BOHLDOHRBanner.png new file mode 100644 index 0000000000..9cb09808a7 Binary files /dev/null and b/Items/Placeables/Banners/BOHLDOHRBanner.png differ diff --git a/Items/Placeables/Banners/BigSightseerBanner.cs b/Items/Placeables/Banners/BigSightseerBanner.cs new file mode 100644 index 0000000000..49596f0ecf --- /dev/null +++ b/Items/Placeables/Banners/BigSightseerBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class BigSightseerBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 33; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/BigSightseerBanner.png b/Items/Placeables/Banners/BigSightseerBanner.png new file mode 100644 index 0000000000..1c38ad07f0 Binary files /dev/null and b/Items/Placeables/Banners/BigSightseerBanner.png differ diff --git a/Items/Placeables/Banners/BlightedEyeBanner.cs b/Items/Placeables/Banners/BlightedEyeBanner.cs new file mode 100644 index 0000000000..8382c21374 --- /dev/null +++ b/Items/Placeables/Banners/BlightedEyeBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class BlightedEyeBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 54; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/BlightedEyeBanner.png b/Items/Placeables/Banners/BlightedEyeBanner.png new file mode 100644 index 0000000000..8fbd55869a Binary files /dev/null and b/Items/Placeables/Banners/BlightedEyeBanner.png differ diff --git a/Items/Placeables/Banners/BlindedAnglerBanner.cs b/Items/Placeables/Banners/BlindedAnglerBanner.cs new file mode 100644 index 0000000000..7cff63cb0f --- /dev/null +++ b/Items/Placeables/Banners/BlindedAnglerBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class BlindedAnglerBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 104; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/BlindedAnglerBanner.png b/Items/Placeables/Banners/BlindedAnglerBanner.png new file mode 100644 index 0000000000..6f56ac9128 Binary files /dev/null and b/Items/Placeables/Banners/BlindedAnglerBanner.png differ diff --git a/Items/Placeables/Banners/BloatfishBanner.cs b/Items/Placeables/Banners/BloatfishBanner.cs new file mode 100644 index 0000000000..d0370d60ee --- /dev/null +++ b/Items/Placeables/Banners/BloatfishBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class BloatfishBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 28; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/BloatfishBanner.png b/Items/Placeables/Banners/BloatfishBanner.png new file mode 100644 index 0000000000..4365c707e4 Binary files /dev/null and b/Items/Placeables/Banners/BloatfishBanner.png differ diff --git a/Items/Placeables/Banners/BloomSlimeBanner.cs b/Items/Placeables/Banners/BloomSlimeBanner.cs new file mode 100644 index 0000000000..5afd14ef7c --- /dev/null +++ b/Items/Placeables/Banners/BloomSlimeBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class BloomSlimeBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 94; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/BloomSlimeBanner.png b/Items/Placeables/Banners/BloomSlimeBanner.png new file mode 100644 index 0000000000..de0f083e77 Binary files /dev/null and b/Items/Placeables/Banners/BloomSlimeBanner.png differ diff --git a/Items/Placeables/Banners/BobbitWormBanner.cs b/Items/Placeables/Banners/BobbitWormBanner.cs new file mode 100644 index 0000000000..04d0b5da4f --- /dev/null +++ b/Items/Placeables/Banners/BobbitWormBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class BobbitWormBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 29; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/BobbitWormBanner.png b/Items/Placeables/Banners/BobbitWormBanner.png new file mode 100644 index 0000000000..8bffb68f49 Binary files /dev/null and b/Items/Placeables/Banners/BobbitWormBanner.png differ diff --git a/Items/Placeables/Banners/BoxJellyfishBanner.cs b/Items/Placeables/Banners/BoxJellyfishBanner.cs new file mode 100644 index 0000000000..52d4ee9ce4 --- /dev/null +++ b/Items/Placeables/Banners/BoxJellyfishBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class BoxJellyfishBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 13; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/BoxJellyfishBanner.png b/Items/Placeables/Banners/BoxJellyfishBanner.png new file mode 100644 index 0000000000..1c9e780ef7 Binary files /dev/null and b/Items/Placeables/Banners/BoxJellyfishBanner.png differ diff --git a/Items/Placeables/Banners/CalamityEyeBanner.cs b/Items/Placeables/Banners/CalamityEyeBanner.cs new file mode 100644 index 0000000000..ba053dcb22 --- /dev/null +++ b/Items/Placeables/Banners/CalamityEyeBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class CalamityEyeBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 55; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/CalamityEyeBanner.png b/Items/Placeables/Banners/CalamityEyeBanner.png new file mode 100644 index 0000000000..e2dfb40f2c Binary files /dev/null and b/Items/Placeables/Banners/CalamityEyeBanner.png differ diff --git a/Items/Placeables/Banners/CatfishBanner.cs b/Items/Placeables/Banners/CatfishBanner.cs new file mode 100644 index 0000000000..bc3f3ed818 --- /dev/null +++ b/Items/Placeables/Banners/CatfishBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class CatfishBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 4; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/CatfishBanner.png b/Items/Placeables/Banners/CatfishBanner.png new file mode 100644 index 0000000000..2062064f49 Binary files /dev/null and b/Items/Placeables/Banners/CatfishBanner.png differ diff --git a/Items/Placeables/Banners/ChaoticPufferBanner.cs b/Items/Placeables/Banners/ChaoticPufferBanner.cs new file mode 100644 index 0000000000..3163e8cc26 --- /dev/null +++ b/Items/Placeables/Banners/ChaoticPufferBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class ChaoticPufferBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 30; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/ChaoticPufferBanner.png b/Items/Placeables/Banners/ChaoticPufferBanner.png new file mode 100644 index 0000000000..88cc1605dd Binary files /dev/null and b/Items/Placeables/Banners/ChaoticPufferBanner.png differ diff --git a/Items/Placeables/Banners/CharredSlimeBanner.cs b/Items/Placeables/Banners/CharredSlimeBanner.cs new file mode 100644 index 0000000000..6f9846c771 --- /dev/null +++ b/Items/Placeables/Banners/CharredSlimeBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class CharredSlimeBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 93; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/CharredSlimeBanner.png b/Items/Placeables/Banners/CharredSlimeBanner.png new file mode 100644 index 0000000000..cd27ab325c Binary files /dev/null and b/Items/Placeables/Banners/CharredSlimeBanner.png differ diff --git a/Items/Placeables/Banners/ClamBanner.cs b/Items/Placeables/Banners/ClamBanner.cs new file mode 100644 index 0000000000..03d60bc316 --- /dev/null +++ b/Items/Placeables/Banners/ClamBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class ClamBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 99; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/ClamBanner.png b/Items/Placeables/Banners/ClamBanner.png new file mode 100644 index 0000000000..74b65932d9 Binary files /dev/null and b/Items/Placeables/Banners/ClamBanner.png differ diff --git a/Items/Placeables/Banners/CloudElementalBanner.cs b/Items/Placeables/Banners/CloudElementalBanner.cs new file mode 100644 index 0000000000..bd2d25bbae --- /dev/null +++ b/Items/Placeables/Banners/CloudElementalBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class CloudElementalBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 58; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/CloudElementalBanner.png b/Items/Placeables/Banners/CloudElementalBanner.png new file mode 100644 index 0000000000..390ffda5a9 Binary files /dev/null and b/Items/Placeables/Banners/CloudElementalBanner.png differ diff --git a/Items/Placeables/Banners/CnidrionBanner.cs b/Items/Placeables/Banners/CnidrionBanner.cs new file mode 100644 index 0000000000..be20a8befd --- /dev/null +++ b/Items/Placeables/Banners/CnidrionBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class CnidrionBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 63; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/CnidrionBanner.png b/Items/Placeables/Banners/CnidrionBanner.png new file mode 100644 index 0000000000..5fa86d0e70 Binary files /dev/null and b/Items/Placeables/Banners/CnidrionBanner.png differ diff --git a/Items/Placeables/Banners/ColossalSquidBanner.cs b/Items/Placeables/Banners/ColossalSquidBanner.cs new file mode 100644 index 0000000000..baa6c82961 --- /dev/null +++ b/Items/Placeables/Banners/ColossalSquidBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class ColossalSquidBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 23; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/ColossalSquidBanner.png b/Items/Placeables/Banners/ColossalSquidBanner.png new file mode 100644 index 0000000000..dbf53677f6 Binary files /dev/null and b/Items/Placeables/Banners/ColossalSquidBanner.png differ diff --git a/Items/Placeables/Banners/CosmicElementalBanner.cs b/Items/Placeables/Banners/CosmicElementalBanner.cs new file mode 100644 index 0000000000..4bab83e559 --- /dev/null +++ b/Items/Placeables/Banners/CosmicElementalBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class CosmicElementalBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 75; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/CosmicElementalBanner.png b/Items/Placeables/Banners/CosmicElementalBanner.png new file mode 100644 index 0000000000..90ef0d5ef1 Binary files /dev/null and b/Items/Placeables/Banners/CosmicElementalBanner.png differ diff --git a/Items/Placeables/Banners/CrimulanBlightSlimeBanner.cs b/Items/Placeables/Banners/CrimulanBlightSlimeBanner.cs new file mode 100644 index 0000000000..93ad4e15fd --- /dev/null +++ b/Items/Placeables/Banners/CrimulanBlightSlimeBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class CrimulanBlightSlimeBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 89; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/CrimulanBlightSlimeBanner.png b/Items/Placeables/Banners/CrimulanBlightSlimeBanner.png new file mode 100644 index 0000000000..27628c35db Binary files /dev/null and b/Items/Placeables/Banners/CrimulanBlightSlimeBanner.png differ diff --git a/Items/Placeables/Banners/CryoSlimeBanner.cs b/Items/Placeables/Banners/CryoSlimeBanner.cs new file mode 100644 index 0000000000..761025f8dc --- /dev/null +++ b/Items/Placeables/Banners/CryoSlimeBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class CryoSlimeBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 91; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/CryoSlimeBanner.png b/Items/Placeables/Banners/CryoSlimeBanner.png new file mode 100644 index 0000000000..8806d133f1 Binary files /dev/null and b/Items/Placeables/Banners/CryoSlimeBanner.png differ diff --git a/Items/Placeables/Banners/CryonBanner.cs b/Items/Placeables/Banners/CryonBanner.cs new file mode 100644 index 0000000000..51a1132de6 --- /dev/null +++ b/Items/Placeables/Banners/CryonBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class CryonBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 60; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/CryonBanner.png b/Items/Placeables/Banners/CryonBanner.png new file mode 100644 index 0000000000..fe68874fc5 Binary files /dev/null and b/Items/Placeables/Banners/CryonBanner.png differ diff --git a/Items/Placeables/Banners/CrystalCrawlerBanner.cs b/Items/Placeables/Banners/CrystalCrawlerBanner.cs new file mode 100644 index 0000000000..05dbd4c249 --- /dev/null +++ b/Items/Placeables/Banners/CrystalCrawlerBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class CrystalCrawlerBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 73; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/CrystalCrawlerBanner.png b/Items/Placeables/Banners/CrystalCrawlerBanner.png new file mode 100644 index 0000000000..a5b7b0b99c Binary files /dev/null and b/Items/Placeables/Banners/CrystalCrawlerBanner.png differ diff --git a/Items/Placeables/Banners/CultistAssassinBanner.cs b/Items/Placeables/Banners/CultistAssassinBanner.cs new file mode 100644 index 0000000000..c7d9b4aa9d --- /dev/null +++ b/Items/Placeables/Banners/CultistAssassinBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class CultistAssassinBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 95; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/CultistAssassinBanner.png b/Items/Placeables/Banners/CultistAssassinBanner.png new file mode 100644 index 0000000000..c020feaa27 Binary files /dev/null and b/Items/Placeables/Banners/CultistAssassinBanner.png differ diff --git a/Items/Placeables/Banners/CuttlefishBanner.cs b/Items/Placeables/Banners/CuttlefishBanner.cs new file mode 100644 index 0000000000..2f475f2553 --- /dev/null +++ b/Items/Placeables/Banners/CuttlefishBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class CuttlefishBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 16; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/CuttlefishBanner.png b/Items/Placeables/Banners/CuttlefishBanner.png new file mode 100644 index 0000000000..4dbfb38999 Binary files /dev/null and b/Items/Placeables/Banners/CuttlefishBanner.png differ diff --git a/Items/Placeables/Banners/DespairStoneBanner.cs b/Items/Placeables/Banners/DespairStoneBanner.cs new file mode 100644 index 0000000000..b597dc4022 --- /dev/null +++ b/Items/Placeables/Banners/DespairStoneBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class DespairStoneBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 46; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/DespairStoneBanner.png b/Items/Placeables/Banners/DespairStoneBanner.png new file mode 100644 index 0000000000..ea39642e8a Binary files /dev/null and b/Items/Placeables/Banners/DespairStoneBanner.png differ diff --git a/Items/Placeables/Banners/DevilFishBanner.cs b/Items/Placeables/Banners/DevilFishBanner.cs new file mode 100644 index 0000000000..8ddd0df23c --- /dev/null +++ b/Items/Placeables/Banners/DevilFishBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class DevilFishBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 15; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/DevilFishBanner.png b/Items/Placeables/Banners/DevilFishBanner.png new file mode 100644 index 0000000000..b4323b6d4c Binary files /dev/null and b/Items/Placeables/Banners/DevilFishBanner.png differ diff --git a/Items/Placeables/Banners/DiamondCrawlerBanner.cs b/Items/Placeables/Banners/DiamondCrawlerBanner.cs new file mode 100644 index 0000000000..b3e4b5488b --- /dev/null +++ b/Items/Placeables/Banners/DiamondCrawlerBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class DiamondCrawlerBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 71; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/DiamondCrawlerBanner.png b/Items/Placeables/Banners/DiamondCrawlerBanner.png new file mode 100644 index 0000000000..c3e063cdb5 Binary files /dev/null and b/Items/Placeables/Banners/DiamondCrawlerBanner.png differ diff --git a/Items/Placeables/Banners/EarthElementalBanner.cs b/Items/Placeables/Banners/EarthElementalBanner.cs new file mode 100644 index 0000000000..0599229fee --- /dev/null +++ b/Items/Placeables/Banners/EarthElementalBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class EarthElementalBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 76; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/EarthElementalBanner.png b/Items/Placeables/Banners/EarthElementalBanner.png new file mode 100644 index 0000000000..75373670a4 Binary files /dev/null and b/Items/Placeables/Banners/EarthElementalBanner.png differ diff --git a/Items/Placeables/Banners/EbonianBlightSlimeBanner.cs b/Items/Placeables/Banners/EbonianBlightSlimeBanner.cs new file mode 100644 index 0000000000..83a7206c46 --- /dev/null +++ b/Items/Placeables/Banners/EbonianBlightSlimeBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class EbonianBlightSlimeBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 88; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/EbonianBlightSlimeBanner.png b/Items/Placeables/Banners/EbonianBlightSlimeBanner.png new file mode 100644 index 0000000000..4c69e8c99b Binary files /dev/null and b/Items/Placeables/Banners/EbonianBlightSlimeBanner.png differ diff --git a/Items/Placeables/Banners/EidolistBanner.cs b/Items/Placeables/Banners/EidolistBanner.cs new file mode 100644 index 0000000000..adf7ce2006 --- /dev/null +++ b/Items/Placeables/Banners/EidolistBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class EidolistBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 25; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/EidolistBanner.png b/Items/Placeables/Banners/EidolistBanner.png new file mode 100644 index 0000000000..8d57c83e9f Binary files /dev/null and b/Items/Placeables/Banners/EidolistBanner.png differ diff --git a/Items/Placeables/Banners/EidolonWyrmJuvenileBanner.cs b/Items/Placeables/Banners/EidolonWyrmJuvenileBanner.cs new file mode 100644 index 0000000000..6b8d4dae36 --- /dev/null +++ b/Items/Placeables/Banners/EidolonWyrmJuvenileBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class EidolonWyrmJuvenileBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 27; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/EidolonWyrmJuvenileBanner.png b/Items/Placeables/Banners/EidolonWyrmJuvenileBanner.png new file mode 100644 index 0000000000..2cdad57ffb Binary files /dev/null and b/Items/Placeables/Banners/EidolonWyrmJuvenileBanner.png differ diff --git a/Items/Placeables/Banners/EmeraldCrawlerBanner.cs b/Items/Placeables/Banners/EmeraldCrawlerBanner.cs new file mode 100644 index 0000000000..6242f55d49 --- /dev/null +++ b/Items/Placeables/Banners/EmeraldCrawlerBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class EmeraldCrawlerBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 69; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/EmeraldCrawlerBanner.png b/Items/Placeables/Banners/EmeraldCrawlerBanner.png new file mode 100644 index 0000000000..7c5965f18f Binary files /dev/null and b/Items/Placeables/Banners/EmeraldCrawlerBanner.png differ diff --git a/Items/Placeables/Banners/EutrophicRayBanner.cs b/Items/Placeables/Banners/EutrophicRayBanner.cs new file mode 100644 index 0000000000..b57ea2e16d --- /dev/null +++ b/Items/Placeables/Banners/EutrophicRayBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class EutrophicRayBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 100; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/EutrophicRayBanner.png b/Items/Placeables/Banners/EutrophicRayBanner.png new file mode 100644 index 0000000000..29f9d317d9 Binary files /dev/null and b/Items/Placeables/Banners/EutrophicRayBanner.png differ diff --git a/Items/Placeables/Banners/FlounderBanner.cs b/Items/Placeables/Banners/FlounderBanner.cs new file mode 100644 index 0000000000..1e03b53038 --- /dev/null +++ b/Items/Placeables/Banners/FlounderBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class FlounderBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 1; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/FlounderBanner.png b/Items/Placeables/Banners/FlounderBanner.png new file mode 100644 index 0000000000..52bb853e0a Binary files /dev/null and b/Items/Placeables/Banners/FlounderBanner.png differ diff --git a/Items/Placeables/Banners/FrogfishBanner.cs b/Items/Placeables/Banners/FrogfishBanner.cs new file mode 100644 index 0000000000..926b979915 --- /dev/null +++ b/Items/Placeables/Banners/FrogfishBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class FrogfishBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 8; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/FrogfishBanner.png b/Items/Placeables/Banners/FrogfishBanner.png new file mode 100644 index 0000000000..a0491c282b Binary files /dev/null and b/Items/Placeables/Banners/FrogfishBanner.png differ diff --git a/Items/Placeables/Banners/FusionFeederBanner.cs b/Items/Placeables/Banners/FusionFeederBanner.cs new file mode 100644 index 0000000000..d18049ccb9 --- /dev/null +++ b/Items/Placeables/Banners/FusionFeederBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class FusionFeederBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 42; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/FusionFeederBanner.png b/Items/Placeables/Banners/FusionFeederBanner.png new file mode 100644 index 0000000000..b3ab90f5ff Binary files /dev/null and b/Items/Placeables/Banners/FusionFeederBanner.png differ diff --git a/Items/Placeables/Banners/GhostBellBanner.cs b/Items/Placeables/Banners/GhostBellBanner.cs new file mode 100644 index 0000000000..0660f85952 --- /dev/null +++ b/Items/Placeables/Banners/GhostBellBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class GhostBellBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 101; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/GhostBellBanner.png b/Items/Placeables/Banners/GhostBellBanner.png new file mode 100644 index 0000000000..74dcd77ed3 Binary files /dev/null and b/Items/Placeables/Banners/GhostBellBanner.png differ diff --git a/Items/Placeables/Banners/GhostBellSmallBanner.cs b/Items/Placeables/Banners/GhostBellSmallBanner.cs new file mode 100644 index 0000000000..f2b4dc6cd8 --- /dev/null +++ b/Items/Placeables/Banners/GhostBellSmallBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class GhostBellSmallBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 102; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/GhostBellSmallBanner.png b/Items/Placeables/Banners/GhostBellSmallBanner.png new file mode 100644 index 0000000000..6c1997b3b2 Binary files /dev/null and b/Items/Placeables/Banners/GhostBellSmallBanner.png differ diff --git a/Items/Placeables/Banners/GiantClamBanner.cs b/Items/Placeables/Banners/GiantClamBanner.cs new file mode 100644 index 0000000000..81e47e013c --- /dev/null +++ b/Items/Placeables/Banners/GiantClamBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class GiantClamBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 107; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/GiantClamBanner.png b/Items/Placeables/Banners/GiantClamBanner.png new file mode 100644 index 0000000000..74b65932d9 Binary files /dev/null and b/Items/Placeables/Banners/GiantClamBanner.png differ diff --git a/Items/Placeables/Banners/GiantSquidBanner.cs b/Items/Placeables/Banners/GiantSquidBanner.cs new file mode 100644 index 0000000000..a6664bc4e7 --- /dev/null +++ b/Items/Placeables/Banners/GiantSquidBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class GiantSquidBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 20; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/GiantSquidBanner.png b/Items/Placeables/Banners/GiantSquidBanner.png new file mode 100644 index 0000000000..e1cf0cf416 Binary files /dev/null and b/Items/Placeables/Banners/GiantSquidBanner.png differ diff --git a/Items/Placeables/Banners/GnasherBanner.cs b/Items/Placeables/Banners/GnasherBanner.cs new file mode 100644 index 0000000000..2be5f1b6b5 --- /dev/null +++ b/Items/Placeables/Banners/GnasherBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class GnasherBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 2; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/GnasherBanner.png b/Items/Placeables/Banners/GnasherBanner.png new file mode 100644 index 0000000000..cb0bf666d5 Binary files /dev/null and b/Items/Placeables/Banners/GnasherBanner.png differ diff --git a/Items/Placeables/Banners/GreatSandSharkBanner.cs b/Items/Placeables/Banners/GreatSandSharkBanner.cs new file mode 100644 index 0000000000..6354482493 --- /dev/null +++ b/Items/Placeables/Banners/GreatSandSharkBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class GreatSandSharkBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 65; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/GreatSandSharkBanner.png b/Items/Placeables/Banners/GreatSandSharkBanner.png new file mode 100644 index 0000000000..e5cf0ba0a0 Binary files /dev/null and b/Items/Placeables/Banners/GreatSandSharkBanner.png differ diff --git a/Items/Placeables/Banners/GulperEelBanner.cs b/Items/Placeables/Banners/GulperEelBanner.cs new file mode 100644 index 0000000000..50b165d501 --- /dev/null +++ b/Items/Placeables/Banners/GulperEelBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class GulperEelBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 26; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/GulperEelBanner.png b/Items/Placeables/Banners/GulperEelBanner.png new file mode 100644 index 0000000000..763910b3b1 Binary files /dev/null and b/Items/Placeables/Banners/GulperEelBanner.png differ diff --git a/Items/Placeables/Banners/HadarianBanner.cs b/Items/Placeables/Banners/HadarianBanner.cs new file mode 100644 index 0000000000..a0d5d901ea --- /dev/null +++ b/Items/Placeables/Banners/HadarianBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class HadarianBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 43; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/HadarianBanner.png b/Items/Placeables/Banners/HadarianBanner.png new file mode 100644 index 0000000000..6c8cb74148 Binary files /dev/null and b/Items/Placeables/Banners/HadarianBanner.png differ diff --git a/Items/Placeables/Banners/HeatSpiritBanner.cs b/Items/Placeables/Banners/HeatSpiritBanner.cs new file mode 100644 index 0000000000..f3a6e8cbff --- /dev/null +++ b/Items/Placeables/Banners/HeatSpiritBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class HeatSpiritBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 44; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/HeatSpiritBanner.png b/Items/Placeables/Banners/HeatSpiritBanner.png new file mode 100644 index 0000000000..5c92c8e3ab Binary files /dev/null and b/Items/Placeables/Banners/HeatSpiritBanner.png differ diff --git a/Items/Placeables/Banners/HiveBanner.cs b/Items/Placeables/Banners/HiveBanner.cs new file mode 100644 index 0000000000..3992ea1595 --- /dev/null +++ b/Items/Placeables/Banners/HiveBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class HiveBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 40; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/HiveBanner.png b/Items/Placeables/Banners/HiveBanner.png new file mode 100644 index 0000000000..96af2637df Binary files /dev/null and b/Items/Placeables/Banners/HiveBanner.png differ diff --git a/Items/Placeables/Banners/IceClasperBanner.cs b/Items/Placeables/Banners/IceClasperBanner.cs new file mode 100644 index 0000000000..0df885ee80 --- /dev/null +++ b/Items/Placeables/Banners/IceClasperBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class IceClasperBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 61; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/IceClasperBanner.png b/Items/Placeables/Banners/IceClasperBanner.png new file mode 100644 index 0000000000..f15f42d01b Binary files /dev/null and b/Items/Placeables/Banners/IceClasperBanner.png differ diff --git a/Items/Placeables/Banners/ImpiousImmolatorBanner.cs b/Items/Placeables/Banners/ImpiousImmolatorBanner.cs new file mode 100644 index 0000000000..5195a4af12 --- /dev/null +++ b/Items/Placeables/Banners/ImpiousImmolatorBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class ImpiousImmolatorBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 48; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/ImpiousImmolatorBanner.png b/Items/Placeables/Banners/ImpiousImmolatorBanner.png new file mode 100644 index 0000000000..c965cd5f5e Binary files /dev/null and b/Items/Placeables/Banners/ImpiousImmolatorBanner.png differ diff --git a/Items/Placeables/Banners/IrradiatedSlimeBanner.cs b/Items/Placeables/Banners/IrradiatedSlimeBanner.cs new file mode 100644 index 0000000000..bd088fa9dd --- /dev/null +++ b/Items/Placeables/Banners/IrradiatedSlimeBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class IrradiatedSlimeBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 97; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/IrradiatedSlimeBanner.png b/Items/Placeables/Banners/IrradiatedSlimeBanner.png new file mode 100644 index 0000000000..a7176895d4 Binary files /dev/null and b/Items/Placeables/Banners/IrradiatedSlimeBanner.png differ diff --git a/Items/Placeables/Banners/LaserfishBanner.cs b/Items/Placeables/Banners/LaserfishBanner.cs new file mode 100644 index 0000000000..7c2afaa0e1 --- /dev/null +++ b/Items/Placeables/Banners/LaserfishBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class LaserfishBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 21; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/LaserfishBanner.png b/Items/Placeables/Banners/LaserfishBanner.png new file mode 100644 index 0000000000..e9891a4483 Binary files /dev/null and b/Items/Placeables/Banners/LaserfishBanner.png differ diff --git a/Items/Placeables/Banners/LuminousCorvinaBanner.cs b/Items/Placeables/Banners/LuminousCorvinaBanner.cs new file mode 100644 index 0000000000..01b9b98b2a --- /dev/null +++ b/Items/Placeables/Banners/LuminousCorvinaBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class LuminousCorvinaBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 19; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/LuminousCorvinaBanner.png b/Items/Placeables/Banners/LuminousCorvinaBanner.png new file mode 100644 index 0000000000..342691b4af Binary files /dev/null and b/Items/Placeables/Banners/LuminousCorvinaBanner.png differ diff --git a/Items/Placeables/Banners/MantisBanner.cs b/Items/Placeables/Banners/MantisBanner.cs new file mode 100644 index 0000000000..dbe2d77187 --- /dev/null +++ b/Items/Placeables/Banners/MantisBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class MantisBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 37; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/MantisBanner.png b/Items/Placeables/Banners/MantisBanner.png new file mode 100644 index 0000000000..f124499656 Binary files /dev/null and b/Items/Placeables/Banners/MantisBanner.png differ diff --git a/Items/Placeables/Banners/MantisShrimpBanner.cs b/Items/Placeables/Banners/MantisShrimpBanner.cs new file mode 100644 index 0000000000..6f257652f7 --- /dev/null +++ b/Items/Placeables/Banners/MantisShrimpBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class MantisShrimpBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 9; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/MantisShrimpBanner.png b/Items/Placeables/Banners/MantisShrimpBanner.png new file mode 100644 index 0000000000..c516b223d7 Binary files /dev/null and b/Items/Placeables/Banners/MantisShrimpBanner.png differ diff --git a/Items/Placeables/Banners/MaulerBanner.cs b/Items/Placeables/Banners/MaulerBanner.cs new file mode 100644 index 0000000000..91c8b781a3 --- /dev/null +++ b/Items/Placeables/Banners/MaulerBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class MaulerBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 5; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/MaulerBanner.png b/Items/Placeables/Banners/MaulerBanner.png new file mode 100644 index 0000000000..09871a1440 Binary files /dev/null and b/Items/Placeables/Banners/MaulerBanner.png differ diff --git a/Items/Placeables/Banners/MelterBanner.cs b/Items/Placeables/Banners/MelterBanner.cs new file mode 100644 index 0000000000..dd65c0dd20 --- /dev/null +++ b/Items/Placeables/Banners/MelterBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class MelterBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 78; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/MelterBanner.png b/Items/Placeables/Banners/MelterBanner.png new file mode 100644 index 0000000000..f8e887a54e Binary files /dev/null and b/Items/Placeables/Banners/MelterBanner.png differ diff --git a/Items/Placeables/Banners/MirageJellyBanner.cs b/Items/Placeables/Banners/MirageJellyBanner.cs new file mode 100644 index 0000000000..f31a81c548 --- /dev/null +++ b/Items/Placeables/Banners/MirageJellyBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class MirageJellyBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 24; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/MirageJellyBanner.png b/Items/Placeables/Banners/MirageJellyBanner.png new file mode 100644 index 0000000000..af5e3cf388 Binary files /dev/null and b/Items/Placeables/Banners/MirageJellyBanner.png differ diff --git a/Items/Placeables/Banners/MorayEelBanner.cs b/Items/Placeables/Banners/MorayEelBanner.cs new file mode 100644 index 0000000000..e1daaec10a --- /dev/null +++ b/Items/Placeables/Banners/MorayEelBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class MorayEelBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 14; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/MorayEelBanner.png b/Items/Placeables/Banners/MorayEelBanner.png new file mode 100644 index 0000000000..4035553cc5 Binary files /dev/null and b/Items/Placeables/Banners/MorayEelBanner.png differ diff --git a/Items/Placeables/Banners/NovaBanner.cs b/Items/Placeables/Banners/NovaBanner.cs new file mode 100644 index 0000000000..fe587d3663 --- /dev/null +++ b/Items/Placeables/Banners/NovaBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class NovaBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 38; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/NovaBanner.png b/Items/Placeables/Banners/NovaBanner.png new file mode 100644 index 0000000000..2aedcb347a Binary files /dev/null and b/Items/Placeables/Banners/NovaBanner.png differ diff --git a/Items/Placeables/Banners/OarfishBanner.cs b/Items/Placeables/Banners/OarfishBanner.cs new file mode 100644 index 0000000000..9b45828b44 --- /dev/null +++ b/Items/Placeables/Banners/OarfishBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class OarfishBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 22; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/OarfishBanner.png b/Items/Placeables/Banners/OarfishBanner.png new file mode 100644 index 0000000000..7dc7e0e4b3 Binary files /dev/null and b/Items/Placeables/Banners/OarfishBanner.png differ diff --git a/Items/Placeables/Banners/OverloadedSoldierBanner.cs b/Items/Placeables/Banners/OverloadedSoldierBanner.cs new file mode 100644 index 0000000000..34570f44a0 --- /dev/null +++ b/Items/Placeables/Banners/OverloadedSoldierBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class OverloadedSoldierBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 85; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/OverloadedSoldierBanner.png b/Items/Placeables/Banners/OverloadedSoldierBanner.png new file mode 100644 index 0000000000..7975b395ae Binary files /dev/null and b/Items/Placeables/Banners/OverloadedSoldierBanner.png differ diff --git a/Items/Placeables/Banners/ParaseaBanner.cs b/Items/Placeables/Banners/ParaseaBanner.cs new file mode 100644 index 0000000000..221a2fd96d --- /dev/null +++ b/Items/Placeables/Banners/ParaseaBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class ParaseaBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 11; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/ParaseaBanner.png b/Items/Placeables/Banners/ParaseaBanner.png new file mode 100644 index 0000000000..aa91173ee8 Binary files /dev/null and b/Items/Placeables/Banners/ParaseaBanner.png differ diff --git a/Items/Placeables/Banners/PerennialSlimeBanner.cs b/Items/Placeables/Banners/PerennialSlimeBanner.cs new file mode 100644 index 0000000000..54a6ca2f24 --- /dev/null +++ b/Items/Placeables/Banners/PerennialSlimeBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class PerennialSlimeBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 92; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/PerennialSlimeBanner.png b/Items/Placeables/Banners/PerennialSlimeBanner.png new file mode 100644 index 0000000000..68a8e7ba6a Binary files /dev/null and b/Items/Placeables/Banners/PerennialSlimeBanner.png differ diff --git a/Items/Placeables/Banners/PestilentSlimeBanner.cs b/Items/Placeables/Banners/PestilentSlimeBanner.cs new file mode 100644 index 0000000000..6ea94ab658 --- /dev/null +++ b/Items/Placeables/Banners/PestilentSlimeBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class PestilentSlimeBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 79; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/PestilentSlimeBanner.png b/Items/Placeables/Banners/PestilentSlimeBanner.png new file mode 100644 index 0000000000..f8e887a54e Binary files /dev/null and b/Items/Placeables/Banners/PestilentSlimeBanner.png differ diff --git a/Items/Placeables/Banners/PhantomDebrisBanner.cs b/Items/Placeables/Banners/PhantomDebrisBanner.cs new file mode 100644 index 0000000000..acfac18416 --- /dev/null +++ b/Items/Placeables/Banners/PhantomDebrisBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class PhantomDebrisBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 86; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/PhantomDebrisBanner.png b/Items/Placeables/Banners/PhantomDebrisBanner.png new file mode 100644 index 0000000000..7599742933 Binary files /dev/null and b/Items/Placeables/Banners/PhantomDebrisBanner.png differ diff --git a/Items/Placeables/Banners/PhantomSpiritBanner.cs b/Items/Placeables/Banners/PhantomSpiritBanner.cs new file mode 100644 index 0000000000..6e585cd466 --- /dev/null +++ b/Items/Placeables/Banners/PhantomSpiritBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class PhantomSpiritBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 84; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/PhantomSpiritBanner.png b/Items/Placeables/Banners/PhantomSpiritBanner.png new file mode 100644 index 0000000000..97041f4898 Binary files /dev/null and b/Items/Placeables/Banners/PhantomSpiritBanner.png differ diff --git a/Items/Placeables/Banners/PitbullBanner.cs b/Items/Placeables/Banners/PitbullBanner.cs new file mode 100644 index 0000000000..7fca34ce0c --- /dev/null +++ b/Items/Placeables/Banners/PitbullBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class PitbullBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 53; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/PitbullBanner.png b/Items/Placeables/Banners/PitbullBanner.png new file mode 100644 index 0000000000..9e55ae8946 Binary files /dev/null and b/Items/Placeables/Banners/PitbullBanner.png differ diff --git a/Items/Placeables/Banners/PlagueChargerBanner.cs b/Items/Placeables/Banners/PlagueChargerBanner.cs new file mode 100644 index 0000000000..0f84268cee --- /dev/null +++ b/Items/Placeables/Banners/PlagueChargerBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class PlagueChargerBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 81; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/PlagueChargerBanner.png b/Items/Placeables/Banners/PlagueChargerBanner.png new file mode 100644 index 0000000000..f8e887a54e Binary files /dev/null and b/Items/Placeables/Banners/PlagueChargerBanner.png differ diff --git a/Items/Placeables/Banners/PlaguebringerBanner.cs b/Items/Placeables/Banners/PlaguebringerBanner.cs new file mode 100644 index 0000000000..9a4f613066 --- /dev/null +++ b/Items/Placeables/Banners/PlaguebringerBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class PlaguebringerBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 83; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/PlaguebringerBanner.png b/Items/Placeables/Banners/PlaguebringerBanner.png new file mode 100644 index 0000000000..f8e887a54e Binary files /dev/null and b/Items/Placeables/Banners/PlaguebringerBanner.png differ diff --git a/Items/Placeables/Banners/PlagueshellBanner.cs b/Items/Placeables/Banners/PlagueshellBanner.cs new file mode 100644 index 0000000000..c905cc130e --- /dev/null +++ b/Items/Placeables/Banners/PlagueshellBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class PlagueshellBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 80; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/PlagueshellBanner.png b/Items/Placeables/Banners/PlagueshellBanner.png new file mode 100644 index 0000000000..f8e887a54e Binary files /dev/null and b/Items/Placeables/Banners/PlagueshellBanner.png differ diff --git a/Items/Placeables/Banners/PrismTurtleBanner.cs b/Items/Placeables/Banners/PrismTurtleBanner.cs new file mode 100644 index 0000000000..af96a13038 --- /dev/null +++ b/Items/Placeables/Banners/PrismTurtleBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class PrismTurtleBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 98; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/PrismTurtleBanner.png b/Items/Placeables/Banners/PrismTurtleBanner.png new file mode 100644 index 0000000000..1f467b4d74 Binary files /dev/null and b/Items/Placeables/Banners/PrismTurtleBanner.png differ diff --git a/Items/Placeables/Banners/ProfanedEnergyBanner.cs b/Items/Placeables/Banners/ProfanedEnergyBanner.cs new file mode 100644 index 0000000000..e0dc29549d --- /dev/null +++ b/Items/Placeables/Banners/ProfanedEnergyBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class ProfanedEnergyBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 50; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/ProfanedEnergyBanner.png b/Items/Placeables/Banners/ProfanedEnergyBanner.png new file mode 100644 index 0000000000..09a757e069 Binary files /dev/null and b/Items/Placeables/Banners/ProfanedEnergyBanner.png differ diff --git a/Items/Placeables/Banners/ReaperSharkBanner.cs b/Items/Placeables/Banners/ReaperSharkBanner.cs new file mode 100644 index 0000000000..4ed2ff6b28 --- /dev/null +++ b/Items/Placeables/Banners/ReaperSharkBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class ReaperSharkBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 96; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/ReaperSharkBanner.png b/Items/Placeables/Banners/ReaperSharkBanner.png new file mode 100644 index 0000000000..f4025cc100 Binary files /dev/null and b/Items/Placeables/Banners/ReaperSharkBanner.png differ diff --git a/Items/Placeables/Banners/RubyCrawlerBanner.cs b/Items/Placeables/Banners/RubyCrawlerBanner.cs new file mode 100644 index 0000000000..3e23d64dc0 --- /dev/null +++ b/Items/Placeables/Banners/RubyCrawlerBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class RubyCrawlerBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 70; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/RubyCrawlerBanner.png b/Items/Placeables/Banners/RubyCrawlerBanner.png new file mode 100644 index 0000000000..e9b079cc2a Binary files /dev/null and b/Items/Placeables/Banners/RubyCrawlerBanner.png differ diff --git a/Items/Placeables/Banners/SandTortoiseBanner.cs b/Items/Placeables/Banners/SandTortoiseBanner.cs new file mode 100644 index 0000000000..f3e171e0e1 --- /dev/null +++ b/Items/Placeables/Banners/SandTortoiseBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class SandTortoiseBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 64; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/SandTortoiseBanner.png b/Items/Placeables/Banners/SandTortoiseBanner.png new file mode 100644 index 0000000000..cc8188e39c Binary files /dev/null and b/Items/Placeables/Banners/SandTortoiseBanner.png differ diff --git a/Items/Placeables/Banners/SapphireCrawlerBanner.cs b/Items/Placeables/Banners/SapphireCrawlerBanner.cs new file mode 100644 index 0000000000..8ea18ab606 --- /dev/null +++ b/Items/Placeables/Banners/SapphireCrawlerBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class SapphireCrawlerBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 68; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/SapphireCrawlerBanner.png b/Items/Placeables/Banners/SapphireCrawlerBanner.png new file mode 100644 index 0000000000..83093601b5 Binary files /dev/null and b/Items/Placeables/Banners/SapphireCrawlerBanner.png differ diff --git a/Items/Placeables/Banners/ScornEaterBanner.cs b/Items/Placeables/Banners/ScornEaterBanner.cs new file mode 100644 index 0000000000..3ef0fee62a --- /dev/null +++ b/Items/Placeables/Banners/ScornEaterBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class ScornEaterBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 49; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/ScornEaterBanner.png b/Items/Placeables/Banners/ScornEaterBanner.png new file mode 100644 index 0000000000..566d9fbc7c Binary files /dev/null and b/Items/Placeables/Banners/ScornEaterBanner.png differ diff --git a/Items/Placeables/Banners/ScryllarBanner.cs b/Items/Placeables/Banners/ScryllarBanner.cs new file mode 100644 index 0000000000..49f59595d2 --- /dev/null +++ b/Items/Placeables/Banners/ScryllarBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class ScryllarBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 45; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/ScryllarBanner.png b/Items/Placeables/Banners/ScryllarBanner.png new file mode 100644 index 0000000000..88cd3c516c Binary files /dev/null and b/Items/Placeables/Banners/ScryllarBanner.png differ diff --git a/Items/Placeables/Banners/SeaFloatyBanner.cs b/Items/Placeables/Banners/SeaFloatyBanner.cs new file mode 100644 index 0000000000..73d3b83eed --- /dev/null +++ b/Items/Placeables/Banners/SeaFloatyBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class SeaFloatyBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 103; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/SeaFloatyBanner.png b/Items/Placeables/Banners/SeaFloatyBanner.png new file mode 100644 index 0000000000..1578c3e4dc Binary files /dev/null and b/Items/Placeables/Banners/SeaFloatyBanner.png differ diff --git a/Items/Placeables/Banners/SeaMinnowBanner.cs b/Items/Placeables/Banners/SeaMinnowBanner.cs new file mode 100644 index 0000000000..640e7e7dc3 --- /dev/null +++ b/Items/Placeables/Banners/SeaMinnowBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class SeaMinnowBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 105; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/SeaMinnowBanner.png b/Items/Placeables/Banners/SeaMinnowBanner.png new file mode 100644 index 0000000000..aa6eebf84f Binary files /dev/null and b/Items/Placeables/Banners/SeaMinnowBanner.png differ diff --git a/Items/Placeables/Banners/SeaSerpentBanner.cs b/Items/Placeables/Banners/SeaSerpentBanner.cs new file mode 100644 index 0000000000..6b72bfe987 --- /dev/null +++ b/Items/Placeables/Banners/SeaSerpentBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class SeaSerpentBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 106; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/SeaSerpentBanner.png b/Items/Placeables/Banners/SeaSerpentBanner.png new file mode 100644 index 0000000000..e384093d74 Binary files /dev/null and b/Items/Placeables/Banners/SeaSerpentBanner.png differ diff --git a/Items/Placeables/Banners/SeaUrchinBanner.cs b/Items/Placeables/Banners/SeaUrchinBanner.cs new file mode 100644 index 0000000000..639c694efb --- /dev/null +++ b/Items/Placeables/Banners/SeaUrchinBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class SeaUrchinBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 12; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/SeaUrchinBanner.png b/Items/Placeables/Banners/SeaUrchinBanner.png new file mode 100644 index 0000000000..d5c2a2f749 Binary files /dev/null and b/Items/Placeables/Banners/SeaUrchinBanner.png differ diff --git a/Items/Placeables/Banners/ShockstormShuttleBanner.cs b/Items/Placeables/Banners/ShockstormShuttleBanner.cs new file mode 100644 index 0000000000..44ab143d44 --- /dev/null +++ b/Items/Placeables/Banners/ShockstormShuttleBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class ShockstormShuttleBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 57; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/ShockstormShuttleBanner.png b/Items/Placeables/Banners/ShockstormShuttleBanner.png new file mode 100644 index 0000000000..bd6afae6ee Binary files /dev/null and b/Items/Placeables/Banners/ShockstormShuttleBanner.png differ diff --git a/Items/Placeables/Banners/SmallSightseerBanner.cs b/Items/Placeables/Banners/SmallSightseerBanner.cs new file mode 100644 index 0000000000..1f62408018 --- /dev/null +++ b/Items/Placeables/Banners/SmallSightseerBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class SmallSightseerBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 32; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/SmallSightseerBanner.png b/Items/Placeables/Banners/SmallSightseerBanner.png new file mode 100644 index 0000000000..7904588742 Binary files /dev/null and b/Items/Placeables/Banners/SmallSightseerBanner.png differ diff --git a/Items/Placeables/Banners/SoulSluperBanner.cs b/Items/Placeables/Banners/SoulSluperBanner.cs new file mode 100644 index 0000000000..6a23e735ab --- /dev/null +++ b/Items/Placeables/Banners/SoulSluperBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class SoulSlurperBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 47; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/SoulSlurperBanner.png b/Items/Placeables/Banners/SoulSlurperBanner.png new file mode 100644 index 0000000000..00c5bee7cf Binary files /dev/null and b/Items/Placeables/Banners/SoulSlurperBanner.png differ diff --git a/Items/Placeables/Banners/StellarCulexBanner.cs b/Items/Placeables/Banners/StellarCulexBanner.cs new file mode 100644 index 0000000000..16c0e35a23 --- /dev/null +++ b/Items/Placeables/Banners/StellarCulexBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class StellarCulexBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 41; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/StellarCulexBanner.png b/Items/Placeables/Banners/StellarCulexBanner.png new file mode 100644 index 0000000000..ddfc9652b5 Binary files /dev/null and b/Items/Placeables/Banners/StellarCulexBanner.png differ diff --git a/Items/Placeables/Banners/StormlionBanner.cs b/Items/Placeables/Banners/StormlionBanner.cs new file mode 100644 index 0000000000..de8c980d45 --- /dev/null +++ b/Items/Placeables/Banners/StormlionBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class StormlionBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 62; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/StormlionBanner.png b/Items/Placeables/Banners/StormlionBanner.png new file mode 100644 index 0000000000..3e02a053f5 Binary files /dev/null and b/Items/Placeables/Banners/StormlionBanner.png differ diff --git a/Items/Placeables/Banners/SunBatBanner.cs b/Items/Placeables/Banners/SunBatBanner.cs new file mode 100644 index 0000000000..4290a51ea8 --- /dev/null +++ b/Items/Placeables/Banners/SunBatBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class SunBatBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 74; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/SunBatBanner.png b/Items/Placeables/Banners/SunBatBanner.png new file mode 100644 index 0000000000..0a01b56e46 Binary files /dev/null and b/Items/Placeables/Banners/SunBatBanner.png differ diff --git a/Items/Placeables/Banners/SunskaterBanner.cs b/Items/Placeables/Banners/SunskaterBanner.cs new file mode 100644 index 0000000000..40de8e81d1 --- /dev/null +++ b/Items/Placeables/Banners/SunskaterBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class SunskaterBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 56; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/SunskaterBanner.png b/Items/Placeables/Banners/SunskaterBanner.png new file mode 100644 index 0000000000..cc4981f8e3 Binary files /dev/null and b/Items/Placeables/Banners/SunskaterBanner.png differ diff --git a/Items/Placeables/Banners/TopazCrawlerBanner.cs b/Items/Placeables/Banners/TopazCrawlerBanner.cs new file mode 100644 index 0000000000..2c1a31eb85 --- /dev/null +++ b/Items/Placeables/Banners/TopazCrawlerBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class TopazCrawlerBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 67; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/TopazCrawlerBanner.png b/Items/Placeables/Banners/TopazCrawlerBanner.png new file mode 100644 index 0000000000..18527dbddd Binary files /dev/null and b/Items/Placeables/Banners/TopazCrawlerBanner.png differ diff --git a/Items/Placeables/Banners/ToxicMinnowBanner.cs b/Items/Placeables/Banners/ToxicMinnowBanner.cs new file mode 100644 index 0000000000..1880e21218 --- /dev/null +++ b/Items/Placeables/Banners/ToxicMinnowBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class ToxicMinnowBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 17; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/ToxicMinnowBanner.png b/Items/Placeables/Banners/ToxicMinnowBanner.png new file mode 100644 index 0000000000..17fb38255a Binary files /dev/null and b/Items/Placeables/Banners/ToxicMinnowBanner.png differ diff --git a/Items/Placeables/Banners/TrasherBanner.cs b/Items/Placeables/Banners/TrasherBanner.cs new file mode 100644 index 0000000000..da31316c1b --- /dev/null +++ b/Items/Placeables/Banners/TrasherBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class TrasherBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 3; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/TrasherBanner.png b/Items/Placeables/Banners/TrasherBanner.png new file mode 100644 index 0000000000..1d2b3363e4 Binary files /dev/null and b/Items/Placeables/Banners/TrasherBanner.png differ diff --git a/Items/Placeables/Banners/ViperfishBanner.cs b/Items/Placeables/Banners/ViperfishBanner.cs new file mode 100644 index 0000000000..4c10b181b3 --- /dev/null +++ b/Items/Placeables/Banners/ViperfishBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class ViperfishBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 18; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/ViperfishBanner.png b/Items/Placeables/Banners/ViperfishBanner.png new file mode 100644 index 0000000000..67337bf26b Binary files /dev/null and b/Items/Placeables/Banners/ViperfishBanner.png differ diff --git a/Items/Placeables/Banners/VirulingBanner.cs b/Items/Placeables/Banners/VirulingBanner.cs new file mode 100644 index 0000000000..1ea600bcab --- /dev/null +++ b/Items/Placeables/Banners/VirulingBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class VirulingBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 82; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/VirulingBanner.png b/Items/Placeables/Banners/VirulingBanner.png new file mode 100644 index 0000000000..f8e887a54e Binary files /dev/null and b/Items/Placeables/Banners/VirulingBanner.png differ diff --git a/Items/Placeables/Banners/WulfrumDroneBanner.cs b/Items/Placeables/Banners/WulfrumDroneBanner.cs new file mode 100644 index 0000000000..d97a7185b6 --- /dev/null +++ b/Items/Placeables/Banners/WulfrumDroneBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class WulfrumDroneBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 52; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/WulfrumDroneBanner.png b/Items/Placeables/Banners/WulfrumDroneBanner.png new file mode 100644 index 0000000000..42706a4b58 Binary files /dev/null and b/Items/Placeables/Banners/WulfrumDroneBanner.png differ diff --git a/Items/Placeables/Banners/WulfrumSlimeBanner.cs b/Items/Placeables/Banners/WulfrumSlimeBanner.cs new file mode 100644 index 0000000000..792b46bf67 --- /dev/null +++ b/Items/Placeables/Banners/WulfrumSlimeBanner.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Banners +{ + public class WulfrumSlimeBanner : ModItem + { + public override void SetDefaults() + { + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 51; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Banners/WulfrumSlimeBanner.png b/Items/Placeables/Banners/WulfrumSlimeBanner.png new file mode 100644 index 0000000000..5ee1d8364b Binary files /dev/null and b/Items/Placeables/Banners/WulfrumSlimeBanner.png differ diff --git a/Items/Placeables/ChaosCandle.cs b/Items/Placeables/ChaosCandle.cs new file mode 100644 index 0000000000..8c4bdd7665 --- /dev/null +++ b/Items/Placeables/ChaosCandle.cs @@ -0,0 +1,48 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables +{ + public class ChaosCandle: ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Chaos Candle"); + Tooltip.SetDefault("The mere presence of this candle enrages surrounding enemies drastically"); + } + + public override void SetDefaults() + { + item.width = 16; + item.height = 20; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.value = 500; + item.createTile = mod.TileType("ChaosCandle"); + } + + public override void HoldItem(Player player) + { + player.GetModPlayer().chaosCandle = true; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.WaterCandle, 3); + recipe.AddIngredient(ItemID.SoulofNight, 3); + recipe.AddIngredient(null, "CoreofChaos", 6); + recipe.AddIngredient(null, "ZergPotion"); + recipe.SetResult(this, 1); + recipe.AddTile(18); + recipe.AddRecipe(); + } + } +} \ No newline at end of file diff --git a/Items/Placeables/ChaosCandle.png b/Items/Placeables/ChaosCandle.png new file mode 100644 index 0000000000..8ac874e206 Binary files /dev/null and b/Items/Placeables/ChaosCandle.png differ diff --git a/Items/Placeables/ChaoticBrick.png b/Items/Placeables/ChaoticBrick.png index af48f6482d..9067fa1f57 100644 Binary files a/Items/Placeables/ChaoticBrick.png and b/Items/Placeables/ChaoticBrick.png differ diff --git a/Items/Placeables/ChaoticBrickWall.png b/Items/Placeables/ChaoticBrickWall.png index 0b2e28f760..229c02d89c 100644 Binary files a/Items/Placeables/ChaoticBrickWall.png and b/Items/Placeables/ChaoticBrickWall.png differ diff --git a/Items/Placeables/ChaoticOre.cs b/Items/Placeables/ChaoticOre.cs index 6ed59038ae..c7e4c7a6bc 100644 --- a/Items/Placeables/ChaoticOre.cs +++ b/Items/Placeables/ChaoticOre.cs @@ -28,8 +28,8 @@ namespace CalamityMod.Items.Placeables item.width = 10; item.height = 10; item.maxStack = 999; - item.value = 8750; - item.rare = 8; + item.value = Item.buyPrice(0, 0, 10, 0); + item.rare = 8; } } } \ No newline at end of file diff --git a/Items/Placeables/ChaoticOre.png b/Items/Placeables/ChaoticOre.png index 1e820f53f1..97e5bd9674 100644 Binary files a/Items/Placeables/ChaoticOre.png and b/Items/Placeables/ChaoticOre.png differ diff --git a/Items/Placeables/CharredOre.cs b/Items/Placeables/CharredOre.cs index 3635ffb449..29c7246b6d 100644 --- a/Items/Placeables/CharredOre.cs +++ b/Items/Placeables/CharredOre.cs @@ -28,8 +28,8 @@ namespace CalamityMod.Items.Placeables item.width = 16; item.height = 16; item.maxStack = 999; - item.value = 9750; - item.rare = 6; + item.value = Item.buyPrice(0, 0, 10, 0); + item.rare = 6; } } } \ No newline at end of file diff --git a/Items/Placeables/Cinderplate.cs b/Items/Placeables/Cinderplate.cs index f5e558bab7..6b6ad82d17 100644 --- a/Items/Placeables/Cinderplate.cs +++ b/Items/Placeables/Cinderplate.cs @@ -29,8 +29,18 @@ namespace CalamityMod.Items.Placeables item.width = 13; item.height = 10; item.maxStack = 999; - item.value = 5000; - item.rare = 3; + item.value = Item.buyPrice(0, 0, 10, 0); + item.rare = 3; } - } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Hellstone, 6); + recipe.AddIngredient(ItemID.Obsidian, 3); + recipe.SetResult(this); + recipe.AddTile(TileID.Anvils); + recipe.AddRecipe(); + } + } } \ No newline at end of file diff --git a/Items/Placeables/CosmiliteBasin.cs b/Items/Placeables/CosmiliteBasin.cs index 6b72338a42..d2a05ef0ec 100644 --- a/Items/Placeables/CosmiliteBasin.cs +++ b/Items/Placeables/CosmiliteBasin.cs @@ -1,38 +1,38 @@ -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Placeables -{ - public class CosmiliteBasin : ModItem - { - public override void SetStaticDefaults() - { - } - - public override void SetDefaults() - { - item.width = 8; - item.height = 10; - item.maxStack = 999; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.createTile = mod.TileType("CosmiliteBasin"); - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "CosmiliteBrick", 10); - recipe.AddIngredient(ItemID.IronBar, 5); - recipe.anyIronBar = true; - recipe.SetResult(this, 1); - recipe.AddTile(null, "DraedonsForge"); - recipe.AddRecipe(); - } - } +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables +{ + public class CosmiliteBasin : ModItem + { + public override void SetStaticDefaults() + { + } + + public override void SetDefaults() + { + item.width = 8; + item.height = 10; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.createTile = mod.TileType("CosmiliteBasin"); + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "CosmiliteBrick", 10); + recipe.AddIngredient(ItemID.IronBar, 5); + recipe.anyIronBar = true; + recipe.SetResult(this, 1); + recipe.AddTile(null, "DraedonsForge"); + recipe.AddRecipe(); + } + } } \ No newline at end of file diff --git a/Items/Placeables/CosmiliteSconce.cs b/Items/Placeables/CosmiliteSconce.cs index d5e90e48e6..8afe90a167 100644 --- a/Items/Placeables/CosmiliteSconce.cs +++ b/Items/Placeables/CosmiliteSconce.cs @@ -1,37 +1,37 @@ -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Placeables -{ - public class CosmiliteSconce : ModItem - { - public override void SetStaticDefaults() - { - } - - public override void SetDefaults() - { - item.width = 8; - item.height = 10; - item.maxStack = 999; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.createTile = mod.TileType("CosmiliteSconce"); - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "CosmiliteBrick", 3); - recipe.AddIngredient(ItemID.Torch, 2); - recipe.SetResult(this, 1); - recipe.AddTile(null, "DraedonsForge"); - recipe.AddRecipe(); - } - } +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables +{ + public class CosmiliteSconce : ModItem + { + public override void SetStaticDefaults() + { + } + + public override void SetDefaults() + { + item.width = 8; + item.height = 10; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.createTile = mod.TileType("CosmiliteSconce"); + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "CosmiliteBrick", 3); + recipe.AddIngredient(ItemID.Torch, 2); + recipe.SetResult(this, 1); + recipe.AddTile(null, "DraedonsForge"); + recipe.AddRecipe(); + } + } } \ No newline at end of file diff --git a/Items/Placeables/CryonicOre.cs b/Items/Placeables/CryonicOre.cs index 3395454e7e..e5b42ff96c 100644 --- a/Items/Placeables/CryonicOre.cs +++ b/Items/Placeables/CryonicOre.cs @@ -28,8 +28,8 @@ namespace CalamityMod.Items.Placeables item.width = 13; item.height = 10; item.maxStack = 999; - item.value = 5750; - item.rare = 5; + item.value = Item.buyPrice(0, 0, 10, 0); + item.rare = 5; } } } \ No newline at end of file diff --git a/Items/Placeables/DraedonsForge.cs b/Items/Placeables/DraedonsForge.cs index adf736c322..c4df8dc8ca 100644 --- a/Items/Placeables/DraedonsForge.cs +++ b/Items/Placeables/DraedonsForge.cs @@ -29,19 +29,9 @@ namespace CalamityMod.Items.Placeables item.value = 5000000; item.rare = 10; item.createTile = mod.TileType("DraedonsForge"); + item.GetGlobalItem(mod).postMoonLordRarity = 20; } - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB); - } - } - } - public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); diff --git a/Items/Placeables/EutrophicSand.cs b/Items/Placeables/EutrophicSand.cs new file mode 100644 index 0000000000..1a3af8c3e7 --- /dev/null +++ b/Items/Placeables/EutrophicSand.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.Placeables +{ + public class EutrophicSand : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Eutrophic Sand"); + } + + public override void SetDefaults() + { + item.createTile = mod.TileType("EutrophicSand"); + item.useStyle = 1; + item.useTurn = true; + item.useAnimation = 15; + item.useTime = 10; + item.autoReuse = true; + item.consumable = true; + item.width = 13; + item.height = 10; + item.maxStack = 999; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/EutrophicSand.png b/Items/Placeables/EutrophicSand.png new file mode 100644 index 0000000000..2a2a517f1e Binary files /dev/null and b/Items/Placeables/EutrophicSand.png differ diff --git a/Items/Placeables/EutrophicSandWall.cs b/Items/Placeables/EutrophicSandWall.cs new file mode 100644 index 0000000000..da84cb372f --- /dev/null +++ b/Items/Placeables/EutrophicSandWall.cs @@ -0,0 +1,33 @@ +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables +{ + public class EutrophicSandWall : ModItem + { + public override void SetDefaults() + { + item.width = 12; + item.height = 12; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 7; + item.useStyle = 1; + item.consumable = true; + item.createWall = mod.WallType("EutrophicSandWall"); + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "EutrophicSand"); + recipe.AddTile(18); + recipe.SetResult(this, 4); + recipe.AddRecipe(); + } + } +} \ No newline at end of file diff --git a/Items/Placeables/EutrophicSandWall.png b/Items/Placeables/EutrophicSandWall.png new file mode 100644 index 0000000000..bf2954a265 Binary files /dev/null and b/Items/Placeables/EutrophicSandWall.png differ diff --git a/Items/Placeables/ExodiumClusterOre.cs b/Items/Placeables/ExodiumClusterOre.cs index 354601f42b..ee832dd46e 100644 --- a/Items/Placeables/ExodiumClusterOre.cs +++ b/Items/Placeables/ExodiumClusterOre.cs @@ -29,8 +29,21 @@ namespace CalamityMod.Items.Placeables item.width = 13; item.height = 10; item.maxStack = 999; - item.value = 5000; - item.rare = 3; + item.value = Item.buyPrice(0, 0, 10, 0); + item.rare = 10; } - } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.LunarOre, 3); + recipe.AddIngredient(ItemID.FragmentStardust); + recipe.AddIngredient(ItemID.FragmentSolar); + recipe.AddIngredient(ItemID.FragmentVortex); + recipe.AddIngredient(ItemID.FragmentNebula); + recipe.SetResult(this); + recipe.AddTile(TileID.LunarCraftingStation); + recipe.AddRecipe(); + } + } } \ No newline at end of file diff --git a/Items/Placeables/Navystone.cs b/Items/Placeables/Navystone.cs new file mode 100644 index 0000000000..676c10d3dd --- /dev/null +++ b/Items/Placeables/Navystone.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.Placeables +{ + public class Navystone : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Navystone"); + } + + public override void SetDefaults() + { + item.createTile = mod.TileType("Navystone"); + item.useStyle = 1; + item.useTurn = true; + item.useAnimation = 15; + item.useTime = 10; + item.autoReuse = true; + item.consumable = true; + item.width = 13; + item.height = 10; + item.maxStack = 999; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/Navystone.png b/Items/Placeables/Navystone.png new file mode 100644 index 0000000000..12fccc4cfa Binary files /dev/null and b/Items/Placeables/Navystone.png differ diff --git a/Items/Placeables/NavystoneWall.cs b/Items/Placeables/NavystoneWall.cs new file mode 100644 index 0000000000..5e7cf1aaed --- /dev/null +++ b/Items/Placeables/NavystoneWall.cs @@ -0,0 +1,33 @@ +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables +{ + public class NavystoneWall : ModItem + { + public override void SetDefaults() + { + item.width = 12; + item.height = 12; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 7; + item.useStyle = 1; + item.consumable = true; + item.createWall = mod.WallType("NavystoneWall"); + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "Navystone"); + recipe.AddTile(18); + recipe.SetResult(this, 4); + recipe.AddRecipe(); + } + } +} \ No newline at end of file diff --git a/Items/Placeables/NavystoneWall.png b/Items/Placeables/NavystoneWall.png new file mode 100644 index 0000000000..8aa8a01f48 Binary files /dev/null and b/Items/Placeables/NavystoneWall.png differ diff --git a/Items/Placeables/PerennialOre.cs b/Items/Placeables/PerennialOre.cs index c5045fa61d..8872d389e6 100644 --- a/Items/Placeables/PerennialOre.cs +++ b/Items/Placeables/PerennialOre.cs @@ -28,8 +28,8 @@ namespace CalamityMod.Items.Placeables item.width = 13; item.height = 10; item.maxStack = 999; - item.value = 6750; - item.rare = 6; + item.value = Item.buyPrice(0, 0, 10, 0); + item.rare = 7; } } } \ No newline at end of file diff --git a/Items/Placeables/PrismShard.cs b/Items/Placeables/PrismShard.cs new file mode 100644 index 0000000000..22c18a6631 --- /dev/null +++ b/Items/Placeables/PrismShard.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.Placeables +{ + public class PrismShard : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Prism Shard"); + } + + public override void SetDefaults() + { + item.createTile = mod.TileType("SeaPrismCrystals"); + item.useStyle = 1; + item.useTurn = true; + item.useAnimation = 15; + item.useTime = 10; + item.autoReuse = true; + item.consumable = true; + item.width = 26; + item.height = 26; + item.maxStack = 999; + item.value = Item.buyPrice(0, 0, 50, 0); + item.rare = 2; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/PrismShard.png b/Items/Placeables/PrismShard.png new file mode 100644 index 0000000000..4c93ed9a69 Binary files /dev/null and b/Items/Placeables/PrismShard.png differ diff --git a/Items/Placeables/SeaPrism.cs b/Items/Placeables/SeaPrism.cs new file mode 100644 index 0000000000..72378701b3 --- /dev/null +++ b/Items/Placeables/SeaPrism.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.Placeables +{ + public class SeaPrism : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sea Prism"); + } + + public override void SetDefaults() + { + item.createTile = mod.TileType("SeaPrism"); + item.useStyle = 1; + item.useTurn = true; + item.useAnimation = 15; + item.useTime = 10; + item.autoReuse = true; + item.consumable = true; + item.width = 13; + item.height = 10; + item.maxStack = 999; + item.value = Item.buyPrice(0, 0, 10, 0); + item.rare = 2; + } + } +} \ No newline at end of file diff --git a/Items/Placeables/SeaPrism.png b/Items/Placeables/SeaPrism.png index 71fb29ca28..f9ca3762ce 100644 Binary files a/Items/Placeables/SeaPrism.png and b/Items/Placeables/SeaPrism.png differ diff --git a/Items/Placeables/Tenebris.cs b/Items/Placeables/Tenebris.cs index de9c40c62f..3f01076672 100644 --- a/Items/Placeables/Tenebris.cs +++ b/Items/Placeables/Tenebris.cs @@ -28,8 +28,8 @@ namespace CalamityMod.Items.Placeables item.width = 13; item.height = 10; item.maxStack = 999; - item.value = 2750; - item.rare = 6; + item.value = Item.buyPrice(0, 0, 10, 0); + item.rare = 7; } } } \ No newline at end of file diff --git a/Items/Placeables/TranquilityCandle.cs b/Items/Placeables/TranquilityCandle.cs new file mode 100644 index 0000000000..181af803e5 --- /dev/null +++ b/Items/Placeables/TranquilityCandle.cs @@ -0,0 +1,48 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables +{ + public class TranquilityCandle: ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Tranquility Candle"); + Tooltip.SetDefault("The mere presence of this candle calms surrounding enemies drastically"); + } + + public override void SetDefaults() + { + item.width = 16; + item.height = 20; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.value = 500; + item.createTile = mod.TileType("TranquilityCandle"); + } + + public override void HoldItem(Player player) + { + player.GetModPlayer().tranquilityCandle = true; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.PeaceCandle, 3); + recipe.AddIngredient(ItemID.SoulofLight, 3); + recipe.AddIngredient(ItemID.PixieDust, 4); + recipe.AddIngredient(null, "ZenPotion"); + recipe.SetResult(this, 1); + recipe.AddTile(18); + recipe.AddRecipe(); + } + } +} \ No newline at end of file diff --git a/Items/Placeables/TranquilityCandle.png b/Items/Placeables/TranquilityCandle.png new file mode 100644 index 0000000000..998233ea25 Binary files /dev/null and b/Items/Placeables/TranquilityCandle.png differ diff --git a/Items/Placeables/UelibloomOre.cs b/Items/Placeables/UelibloomOre.cs index 347a235535..e790e41bc7 100644 --- a/Items/Placeables/UelibloomOre.cs +++ b/Items/Placeables/UelibloomOre.cs @@ -28,8 +28,8 @@ namespace CalamityMod.Items.Placeables item.width = 10; item.height = 10; item.maxStack = 999; - item.value = 8750; - } + item.value = Item.buyPrice(0, 0, 10, 0); + } public override void ModifyTooltips(List list) { diff --git a/Items/PlaguebringerGoliath/PlagueCellCluster.cs b/Items/PlaguebringerGoliath/PlagueCellCluster.cs index f2cb96cb86..45279cda89 100644 --- a/Items/PlaguebringerGoliath/PlagueCellCluster.cs +++ b/Items/PlaguebringerGoliath/PlagueCellCluster.cs @@ -7,20 +7,22 @@ using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Items; -namespace CalamityMod.Items.PlaguebringerGoliath { -public class PlagueCellCluster : ModItem +namespace CalamityMod.Items.PlaguebringerGoliath { - public override void SetStaticDefaults() + public class PlagueCellCluster : ModItem { - DisplayName.SetDefault("Plague Cell Canister"); + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Plague Cell Canister"); + } + + public override void SetDefaults() + { + item.width = 20; + item.height = 20; + item.maxStack = 999; + item.value = Item.buyPrice(0, 5, 0, 0); + item.rare = 8; + } } - - public override void SetDefaults() - { - item.width = 20; - item.height = 20; - item.maxStack = 999; - item.value = 3000; - item.rare = 8; - } -}} \ No newline at end of file +} \ No newline at end of file diff --git a/Items/PlaguebringerGoliath/PlaguebringerGoliathBag.cs b/Items/PlaguebringerGoliath/PlaguebringerGoliathBag.cs index 101c7e6038..a27e942bfd 100644 --- a/Items/PlaguebringerGoliath/PlaguebringerGoliathBag.cs +++ b/Items/PlaguebringerGoliath/PlaguebringerGoliathBag.cs @@ -7,11 +7,11 @@ namespace CalamityMod.Items.PlaguebringerGoliath public class PlaguebringerGoliathBag : ModItem { public override void SetStaticDefaults() - { - DisplayName.SetDefault("Treasure Bag"); - Tooltip.SetDefault("{$CommonItemTooltip.RightClickToOpen}"); - } - + { + DisplayName.SetDefault("Treasure Bag"); + Tooltip.SetDefault("{$CommonItemTooltip.RightClickToOpen}"); + } + public override void SetDefaults() { item.maxStack = 999; @@ -30,36 +30,65 @@ namespace CalamityMod.Items.PlaguebringerGoliath public override void OpenBossBag(Player player) { + if (CalamityWorld.revenge) + { + if (Main.rand.Next(100) == 0) + { + player.QuickSpawnItem(mod.ItemType("Malachite")); + } + else if (CalamityWorld.defiled) + { + if (Main.rand.Next(20) == 0) + { + player.QuickSpawnItem(mod.ItemType("Malachite")); + } + } + if (Main.rand.Next(20) == 0) + { + switch (Main.rand.Next(3)) + { + case 0: + player.QuickSpawnItem(mod.ItemType("StressPills")); + break; + case 1: + player.QuickSpawnItem(mod.ItemType("Laudanum")); + break; + case 2: + player.QuickSpawnItem(mod.ItemType("HeartofDarkness")); + break; + } + } + } player.TryGettingDevArmor(); - if(Main.rand.Next(3) == 0) + if (Main.rand.Next(3) == 0) { player.QuickSpawnItem(mod.ItemType("PestilentDefiler")); } - if(Main.rand.Next(3) == 0) + if (Main.rand.Next(3) == 0) { player.QuickSpawnItem(mod.ItemType("ThePlaguebringer")); } - if(Main.rand.Next(7) == 0) + if (Main.rand.Next(7) == 0) { player.QuickSpawnItem(mod.ItemType("PlaguebringerGoliathMask")); } - if(Main.rand.Next(3) == 0) + if (Main.rand.Next(3) == 0) { player.QuickSpawnItem(mod.ItemType("TheHive")); } - if(Main.rand.Next(3) == 0) + if (Main.rand.Next(3) == 0) { player.QuickSpawnItem(mod.ItemType("Malevolence")); } - if(Main.rand.Next(3) == 0) + if (Main.rand.Next(3) == 0) { player.QuickSpawnItem(mod.ItemType("DiseasedPike")); } - if(Main.rand.Next(3) == 0) + if (Main.rand.Next(3) == 0) { player.QuickSpawnItem(mod.ItemType("VirulentKatana")); } - if(Main.rand.Next(3) == 0) + if (Main.rand.Next(3) == 0) { player.QuickSpawnItem(mod.ItemType("MepheticSprayer")); } @@ -67,6 +96,10 @@ namespace CalamityMod.Items.PlaguebringerGoliath { player.QuickSpawnItem(mod.ItemType("PlagueStaff")); } + if (Main.rand.Next(10) == 0) + { + player.QuickSpawnItem(mod.ItemType("BloomStone")); + } player.QuickSpawnItem(mod.ItemType("ToxicHeart")); player.QuickSpawnItem(mod.ItemType("PlagueCellCluster"), Main.rand.Next(13, 18)); } diff --git a/Items/PlaguebringerGoliath/ToxicHeart.cs b/Items/PlaguebringerGoliath/ToxicHeart.cs index ba7f5c2111..f02cc6d085 100644 --- a/Items/PlaguebringerGoliath/ToxicHeart.cs +++ b/Items/PlaguebringerGoliath/ToxicHeart.cs @@ -14,8 +14,7 @@ namespace CalamityMod.Items.PlaguebringerGoliath public override void SetStaticDefaults() { DisplayName.SetDefault("Toxic Heart"); - Tooltip.SetDefault("Blinds and weakens the player if above 85% life\n" + - "Summons a damaging plague aura around the player to destroy nearby enemies"); + Tooltip.SetDefault("Summons a damaging plague aura around the player to destroy nearby enemies"); } public override void SetDefaults() @@ -29,12 +28,6 @@ namespace CalamityMod.Items.PlaguebringerGoliath public override void UpdateAccessory(Player player, bool hideVisual) { - if (player.statLife >= (player.statLifeMax * 0.85f)) - { - player.blind = true; - player.statDefense -= 5; - player.moveSpeed -= 0.05f; - } int plagueCounter = 0; Lighting.AddLight((int)(player.Center.X / 16f), (int)(player.Center.Y / 16f), 0.05f, 1f, 0.1f); int num = mod.BuffType("Plague"); diff --git a/Items/Polterghast/NecroplasmicBeacon.cs b/Items/Polterghast/NecroplasmicBeacon.cs index 5602e87ff1..0be83b2936 100644 --- a/Items/Polterghast/NecroplasmicBeacon.cs +++ b/Items/Polterghast/NecroplasmicBeacon.cs @@ -25,19 +25,9 @@ namespace CalamityMod.Items.Polterghast item.useTime = 45; item.useStyle = 4; item.consumable = false; + item.GetGlobalItem(mod).postMoonLordRarity = 13; } - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 0); - } - } - } - public override bool CanUseItem(Player player) { return player.ZoneDungeon && !NPC.AnyNPCs(mod.NPCType("Polterghast")); diff --git a/Items/Polterghast/PolterghastBag.cs b/Items/Polterghast/PolterghastBag.cs index eeab4b1c32..8f5acbfb92 100644 --- a/Items/Polterghast/PolterghastBag.cs +++ b/Items/Polterghast/PolterghastBag.cs @@ -7,11 +7,11 @@ namespace CalamityMod.Items.Polterghast public class PolterghastBag : ModItem { public override void SetStaticDefaults() - { - DisplayName.SetDefault("Treasure Bag"); - Tooltip.SetDefault("{$CommonItemTooltip.RightClickToOpen}"); - } - + { + DisplayName.SetDefault("Treasure Bag"); + Tooltip.SetDefault("{$CommonItemTooltip.RightClickToOpen}"); + } + public override void SetDefaults() { item.maxStack = 999; @@ -30,7 +30,26 @@ namespace CalamityMod.Items.Polterghast public override void OpenBossBag(Player player) { - player.TryGettingDevArmor(); + if (CalamityWorld.revenge) + { + player.QuickSpawnItem(mod.ItemType("Ectoheart")); + if (Main.rand.Next(20) == 0) + { + switch (Main.rand.Next(3)) + { + case 0: + player.QuickSpawnItem(mod.ItemType("StressPills")); + break; + case 1: + player.QuickSpawnItem(mod.ItemType("Laudanum")); + break; + case 2: + player.QuickSpawnItem(mod.ItemType("HeartofDarkness")); + break; + } + } + } + player.TryGettingDevArmor(); if (Main.rand.Next(3) == 0) { player.QuickSpawnItem(mod.ItemType("BansheeHook")); @@ -61,10 +80,6 @@ namespace CalamityMod.Items.Polterghast } player.QuickSpawnItem(mod.ItemType("RuinousSoul"), Main.rand.Next(6, 11)); player.QuickSpawnItem(mod.ItemType("Affliction")); - if (CalamityWorld.revenge) - { - player.QuickSpawnItem(mod.ItemType("Ectoheart")); - } } } } \ No newline at end of file diff --git a/Items/Polterghast/RuinousSoul.cs b/Items/Polterghast/RuinousSoul.cs index 0fc92dd6d1..00566d8051 100644 --- a/Items/Polterghast/RuinousSoul.cs +++ b/Items/Polterghast/RuinousSoul.cs @@ -22,18 +22,8 @@ namespace CalamityMod.Items.Polterghast item.width = 20; item.height = 20; item.maxStack = 999; - item.value = 100000; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 0); - } - } - } + item.value = Item.buyPrice(0, 7, 0, 0); + item.GetGlobalItem(mod).postMoonLordRarity = 13; + } } } \ No newline at end of file diff --git a/Items/PotionofOmniscience.cs b/Items/PotionofOmniscience.cs index f0a532767a..499193fdbc 100644 --- a/Items/PotionofOmniscience.cs +++ b/Items/PotionofOmniscience.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items item.consumable = true; item.buffType = mod.BuffType("Omniscience"); item.buffTime = 18000; - item.value = 10000; + item.value = Item.buyPrice(0, 2, 0, 0); } public override void AddRecipes() diff --git a/Items/ProfanedGuardian/ProfanedShard.cs b/Items/ProfanedGuardian/ProfanedShard.cs index 13f1b02cdd..62ab5d2f81 100644 --- a/Items/ProfanedGuardian/ProfanedShard.cs +++ b/Items/ProfanedGuardian/ProfanedShard.cs @@ -27,19 +27,9 @@ namespace CalamityMod.Items.ProfanedGuardian item.useTime = 45; item.useStyle = 4; item.consumable = true; + item.GetGlobalItem(mod).postMoonLordRarity = 12; } - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 200); - } - } - } - public override bool CanUseItem(Player player) { return !NPC.AnyNPCs(mod.NPCType("ProfanedGuardianBoss")) && Main.dayTime && (player.ZoneHoly || player.ZoneUnderworldHeight); diff --git a/Items/Providence/DivineGeode.cs b/Items/Providence/DivineGeode.cs index c0ac06d5fe..8bcce99127 100644 --- a/Items/Providence/DivineGeode.cs +++ b/Items/Providence/DivineGeode.cs @@ -22,20 +22,10 @@ namespace CalamityMod.Items.Providence item.width = 15; item.height = 12; item.maxStack = 999; - item.rare = 11; - item.value = 120000; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 200); - } - } - } + item.rare = 10; + item.value = Item.buyPrice(0, 6, 50, 0); + item.GetGlobalItem(mod).postMoonLordRarity = 12; + } public override void Update(ref float gravity, ref float maxFallSpeed) { diff --git a/Items/Providence/ElysianWings.cs b/Items/Providence/ElysianWings.cs index bb05147403..b3f2ff1e8a 100644 --- a/Items/Providence/ElysianWings.cs +++ b/Items/Providence/ElysianWings.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Items.Providence { CalamityPlayer modPlayer = player.GetModPlayer(mod); player.moveSpeed += 0.4f; - player.lavaMax += 920; + player.lavaMax += 240; player.wingTimeMax = 180; modPlayer.elysianFire = true; if (hideVisual) diff --git a/Items/Providence/ProfanedCore.cs b/Items/Providence/ProfanedCore.cs index 7c5609fb05..177d4023a0 100644 --- a/Items/Providence/ProfanedCore.cs +++ b/Items/Providence/ProfanedCore.cs @@ -28,6 +28,7 @@ namespace CalamityMod.Items.Providence item.useStyle = 4; item.consumable = true; item.rare = 9; + item.GetGlobalItem(mod).postMoonLordRarity = 12; } public override bool CanUseItem(Player player) @@ -41,16 +42,5 @@ namespace CalamityMod.Items.Providence Main.PlaySound(SoundID.Roar, player.position, 0); return true; } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 200); - } - } - } } } \ No newline at end of file diff --git a/Items/Providence/ProfanedCoreUnlimited.cs b/Items/Providence/ProfanedCoreUnlimited.cs index ddca60bb9b..e8cbcb708e 100644 --- a/Items/Providence/ProfanedCoreUnlimited.cs +++ b/Items/Providence/ProfanedCoreUnlimited.cs @@ -28,6 +28,7 @@ namespace CalamityMod.Items.Providence item.useStyle = 4; item.consumable = false; item.rare = 9; + item.GetGlobalItem(mod).postMoonLordRarity = 12; } public override bool CanUseItem(Player player) @@ -41,23 +42,12 @@ namespace CalamityMod.Items.Providence Main.PlaySound(SoundID.Roar, player.position, 0); return true; } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 200); - } - } - } public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(null, "ProfanedCore"); - recipe.AddIngredient(null, "DivineGeode", 5); + recipe.AddIngredient(null, "UnholyEssence", 50); recipe.AddTile(TileID.LunarCraftingStation); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Providence/ProvidenceBag.cs b/Items/Providence/ProvidenceBag.cs index afe0c299f0..414510d459 100644 --- a/Items/Providence/ProvidenceBag.cs +++ b/Items/Providence/ProvidenceBag.cs @@ -7,11 +7,11 @@ namespace CalamityMod.Items.Providence public class ProvidenceBag : ModItem { public override void SetStaticDefaults() - { - DisplayName.SetDefault("Treasure Bag"); - Tooltip.SetDefault("{$CommonItemTooltip.RightClickToOpen}"); - } - + { + DisplayName.SetDefault("Treasure Bag"); + Tooltip.SetDefault("{$CommonItemTooltip.RightClickToOpen}"); + } + public override void SetDefaults() { item.maxStack = 999; @@ -30,6 +30,24 @@ namespace CalamityMod.Items.Providence public override void OpenBossBag(Player player) { + if (CalamityWorld.revenge) + { + if (Main.rand.Next(20) == 0) + { + switch (Main.rand.Next(3)) + { + case 0: + player.QuickSpawnItem(mod.ItemType("StressPills")); + break; + case 1: + player.QuickSpawnItem(mod.ItemType("Laudanum")); + break; + case 2: + player.QuickSpawnItem(mod.ItemType("HeartofDarkness")); + break; + } + } + } player.TryGettingDevArmor(); if (Main.rand.Next(3) == 0) { @@ -60,8 +78,8 @@ namespace CalamityMod.Items.Providence player.QuickSpawnItem(mod.ItemType("ProvidenceMask")); } player.QuickSpawnItem(mod.ItemType("UnholyEssence"), Main.rand.Next(25, 36)); - player.QuickSpawnItem(mod.ItemType("DivineGeode"), Main.rand.Next(15, 26)); - player.QuickSpawnItem(mod.ItemType("RuneofCos")); + player.QuickSpawnItem(mod.ItemType("DivineGeode"), Main.rand.Next(15, 26)); + player.QuickSpawnItem(mod.ItemType("RuneofCos")); } } } \ No newline at end of file diff --git a/Items/Providence/UnholyEssence.cs b/Items/Providence/UnholyEssence.cs index 385c10aea5..2a1ea80bd8 100644 --- a/Items/Providence/UnholyEssence.cs +++ b/Items/Providence/UnholyEssence.cs @@ -23,20 +23,10 @@ namespace CalamityMod.Items.Providence item.width = 15; item.height = 12; item.maxStack = 999; - item.rare = 9; - item.value = 58750; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 200); - } - } - } + item.rare = 10; + item.value = Item.buyPrice(0, 6, 50, 0); + item.GetGlobalItem(mod).postMoonLordRarity = 12; + } public override void Update(ref float gravity, ref float maxFallSpeed) { diff --git a/Items/PurifiedJam.cs b/Items/PurifiedJam.cs index 75e2e10f6b..91d41b6fab 100644 --- a/Items/PurifiedJam.cs +++ b/Items/PurifiedJam.cs @@ -21,13 +21,13 @@ namespace CalamityMod.Items item.height = 18; item.useTurn = true; item.maxStack = 30; - item.rare = 5; + item.rare = 3; item.useAnimation = 17; item.useTime = 17; item.useStyle = 2; item.UseSound = SoundID.Item3; item.consumable = true; - item.value = 2000; + item.value = Item.buyPrice(0, 2, 0, 0); } public override bool CanUseItem(Player player) diff --git a/Items/RedLightningContainer.cs b/Items/RedLightningContainer.cs index 653d40bb6b..cbcb09501a 100644 --- a/Items/RedLightningContainer.cs +++ b/Items/RedLightningContainer.cs @@ -29,19 +29,9 @@ namespace CalamityMod.Items item.useStyle = 4; item.UseSound = SoundID.Item122; item.consumable = true; + item.GetGlobalItem(mod).postMoonLordRarity = 14; } - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(43, 96, 222); - } - } - } - public override bool CanUseItem(Player player) { CalamityPlayer modPlayer = player.GetModPlayer(mod); diff --git a/Items/RevivifyPotion.cs b/Items/RevivifyPotion.cs index 6867c98322..e69d9afef3 100644 --- a/Items/RevivifyPotion.cs +++ b/Items/RevivifyPotion.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items item.useStyle = 2; item.UseSound = SoundID.Item3; item.consumable = true; - item.value = 20000; + item.value = Item.buyPrice(0, 2, 0, 0); } public override bool UseItem(Player player) diff --git a/Items/Rock.cs b/Items/Rock.cs index 21b5d51ed6..04126246a3 100644 --- a/Items/Rock.cs +++ b/Items/Rock.cs @@ -1,27 +1,27 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items; - -namespace CalamityMod.Items -{ - public class Rock : ModItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Rock"); - Tooltip.SetDefault("The first object Xeroc ever created"); - } - - public override void SetDefaults() - { - item.width = 20; - item.height = 20; - item.value = 1; - } - } +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items +{ + public class Rock : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Rock"); + Tooltip.SetDefault("The first object Xeroc ever created"); + } + + public override void SetDefaults() + { + item.width = 20; + item.height = 20; + item.value = Item.buyPrice(0, 0, 0, 1); + } + } } \ No newline at end of file diff --git a/Items/Scavenger/FleshTotem.cs b/Items/Scavenger/FleshTotem.cs index ad1d6b3c6e..3c7dc77c0b 100644 --- a/Items/Scavenger/FleshTotem.cs +++ b/Items/Scavenger/FleshTotem.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Scavenger { DisplayName.SetDefault("Flesh Totem"); Tooltip.SetDefault("Halves enemy contact damage\n" + - "When you take contact damage this effect has a 15 second cooldown"); + "When you take contact damage this effect has a 20 second cooldown"); } public override void SetDefaults() diff --git a/Items/Scavenger/RavagerBag.cs b/Items/Scavenger/RavagerBag.cs index f9da9c3329..419283d816 100644 --- a/Items/Scavenger/RavagerBag.cs +++ b/Items/Scavenger/RavagerBag.cs @@ -7,11 +7,11 @@ namespace CalamityMod.Items.Scavenger public class RavagerBag : ModItem { public override void SetStaticDefaults() - { - DisplayName.SetDefault("Treasure Bag"); - Tooltip.SetDefault("{$CommonItemTooltip.RightClickToOpen}"); - } - + { + DisplayName.SetDefault("Treasure Bag"); + Tooltip.SetDefault("{$CommonItemTooltip.RightClickToOpen}"); + } + public override void SetDefaults() { item.maxStack = 999; @@ -30,44 +30,63 @@ namespace CalamityMod.Items.Scavenger public override void OpenBossBag(Player player) { + if (CalamityWorld.revenge) + { + player.QuickSpawnItem(mod.ItemType("InfernalBlood")); + if (Main.rand.Next(20) == 0) + { + switch (Main.rand.Next(3)) + { + case 0: + player.QuickSpawnItem(mod.ItemType("StressPills")); + break; + case 1: + player.QuickSpawnItem(mod.ItemType("Laudanum")); + break; + case 2: + player.QuickSpawnItem(mod.ItemType("HeartofDarkness")); + break; + } + } + } player.TryGettingDevArmor(); - if (CalamityWorld.downedProvidence) - { - player.QuickSpawnItem(mod.ItemType("Bloodstone"), Main.rand.Next(60, 71)); - player.QuickSpawnItem(mod.ItemType("VerstaltiteBar"), Main.rand.Next(7, 13)); - player.QuickSpawnItem(mod.ItemType("DraedonBar"), Main.rand.Next(7, 13)); - player.QuickSpawnItem(mod.ItemType("CruptixBar"), Main.rand.Next(7, 13)); - player.QuickSpawnItem(mod.ItemType("CoreofCinder"), Main.rand.Next(2, 5)); - player.QuickSpawnItem(mod.ItemType("CoreofEleum"), Main.rand.Next(2, 5)); - player.QuickSpawnItem(mod.ItemType("CoreofChaos"), Main.rand.Next(2, 5)); - player.QuickSpawnItem(mod.ItemType("BarofLife")); - if (Main.rand.Next(2) == 0) - { - player.QuickSpawnItem(mod.ItemType("CoreofCalamity")); - } - player.QuickSpawnItem(mod.ItemType("BloodflareCore")); - } - else - { - player.QuickSpawnItem(mod.ItemType("VerstaltiteBar"), Main.rand.Next(2, 4)); - player.QuickSpawnItem(mod.ItemType("DraedonBar"), Main.rand.Next(2, 4)); - player.QuickSpawnItem(mod.ItemType("CruptixBar"), Main.rand.Next(2, 4)); - player.QuickSpawnItem(mod.ItemType("CoreofCinder"), Main.rand.Next(1, 4)); - player.QuickSpawnItem(mod.ItemType("CoreofEleum"), Main.rand.Next(1, 4)); - player.QuickSpawnItem(mod.ItemType("CoreofChaos"), Main.rand.Next(1, 4)); - } - if (Main.rand.Next(2) == 0) - { - player.QuickSpawnItem(mod.ItemType("BloodPact")); - } - if (Main.rand.Next(2) == 0) - { - player.QuickSpawnItem(mod.ItemType("FleshTotem")); - } - if (Main.rand.Next(2) == 0) - { - player.QuickSpawnItem(mod.ItemType("Hematemesis")); - } - } + if (CalamityWorld.downedProvidence) + { + player.QuickSpawnItem(mod.ItemType("Bloodstone"), Main.rand.Next(60, 71)); + player.QuickSpawnItem(mod.ItemType("VerstaltiteBar"), Main.rand.Next(7, 13)); + player.QuickSpawnItem(mod.ItemType("DraedonBar"), Main.rand.Next(7, 13)); + player.QuickSpawnItem(mod.ItemType("CruptixBar"), Main.rand.Next(7, 13)); + player.QuickSpawnItem(mod.ItemType("CoreofCinder"), Main.rand.Next(2, 5)); + player.QuickSpawnItem(mod.ItemType("CoreofEleum"), Main.rand.Next(2, 5)); + player.QuickSpawnItem(mod.ItemType("CoreofChaos"), Main.rand.Next(2, 5)); + player.QuickSpawnItem(mod.ItemType("BarofLife")); + if (Main.rand.Next(2) == 0) + { + player.QuickSpawnItem(mod.ItemType("CoreofCalamity")); + } + player.QuickSpawnItem(mod.ItemType("BloodflareCore")); + } + else + { + player.QuickSpawnItem(mod.ItemType("VerstaltiteBar"), Main.rand.Next(2, 4)); + player.QuickSpawnItem(mod.ItemType("DraedonBar"), Main.rand.Next(2, 4)); + player.QuickSpawnItem(mod.ItemType("CruptixBar"), Main.rand.Next(2, 4)); + player.QuickSpawnItem(mod.ItemType("CoreofCinder"), Main.rand.Next(1, 4)); + player.QuickSpawnItem(mod.ItemType("CoreofEleum"), Main.rand.Next(1, 4)); + player.QuickSpawnItem(mod.ItemType("CoreofChaos"), Main.rand.Next(1, 4)); + } + if (Main.rand.Next(2) == 0) + { + player.QuickSpawnItem(mod.ItemType("BloodPact")); + } + if (Main.rand.Next(2) == 0) + { + player.QuickSpawnItem(mod.ItemType("FleshTotem")); + } + if (Main.rand.Next(2) == 0) + { + player.QuickSpawnItem(mod.ItemType("Hematemesis")); + } + } } } \ No newline at end of file diff --git a/Items/ShadowspecBar.cs b/Items/ShadowspecBar.cs index 9304dde398..ef14e93eb1 100644 --- a/Items/ShadowspecBar.cs +++ b/Items/ShadowspecBar.cs @@ -22,19 +22,9 @@ namespace CalamityMod.Items item.width = 15; item.height = 12; item.maxStack = 999; - item.value = 1000000; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(108, 45, 199); - } - } - } + item.value = Item.buyPrice(0, 10, 0, 0); + item.GetGlobalItem(mod).postMoonLordRarity = 15; + } public override void AddRecipes() { diff --git a/Items/SlimeGod/PurifiedGel.cs b/Items/SlimeGod/PurifiedGel.cs index d48d294594..ee71ab43bb 100644 --- a/Items/SlimeGod/PurifiedGel.cs +++ b/Items/SlimeGod/PurifiedGel.cs @@ -21,8 +21,8 @@ namespace CalamityMod.Items.SlimeGod item.width = 16; item.height = 14; item.maxStack = 999; - item.value = 3750; - item.rare = 4; + item.value = Item.buyPrice(0, 2, 50, 0); + item.rare = 4; } } } \ No newline at end of file diff --git a/Items/SlimeGod/SlimeGodBag.cs b/Items/SlimeGod/SlimeGodBag.cs index 702c7259c1..391a6b01b3 100644 --- a/Items/SlimeGod/SlimeGodBag.cs +++ b/Items/SlimeGod/SlimeGodBag.cs @@ -7,11 +7,11 @@ namespace CalamityMod.Items.SlimeGod public class SlimeGodBag : ModItem { public override void SetStaticDefaults() - { - DisplayName.SetDefault("Treasure Bag"); - Tooltip.SetDefault("{$CommonItemTooltip.RightClickToOpen}"); - } - + { + DisplayName.SetDefault("Treasure Bag"); + Tooltip.SetDefault("{$CommonItemTooltip.RightClickToOpen}"); + } + public override void SetDefaults() { item.maxStack = 999; @@ -30,6 +30,25 @@ namespace CalamityMod.Items.SlimeGod public override void OpenBossBag(Player player) { + if (CalamityWorld.revenge) + { + player.QuickSpawnItem(mod.ItemType("ElectrolyteGelPack")); + if (Main.rand.Next(20) == 0) + { + switch (Main.rand.Next(3)) + { + case 0: + player.QuickSpawnItem(mod.ItemType("StressPills")); + break; + case 1: + player.QuickSpawnItem(mod.ItemType("Laudanum")); + break; + case 2: + player.QuickSpawnItem(mod.ItemType("HeartofDarkness")); + break; + } + } + } int maskChoice = Main.rand.Next(2); if (Main.rand.Next(3) == 0) { @@ -66,14 +85,10 @@ namespace CalamityMod.Items.SlimeGod { player.QuickSpawnItem(mod.ItemType("GelDart"), Main.rand.Next(100, 126)); } - player.QuickSpawnItem(mod.ItemType("StaticRefiner")); - player.QuickSpawnItem(mod.ItemType("ManaOverloader")); + player.QuickSpawnItem(mod.ItemType("StaticRefiner")); + player.QuickSpawnItem(mod.ItemType("ManaOverloader")); player.QuickSpawnItem(ItemID.Gel, Main.rand.Next(150, 201)); player.QuickSpawnItem(mod.ItemType("PurifiedGel"), Main.rand.Next(30, 51)); - if (CalamityWorld.revenge) - { - player.QuickSpawnItem(mod.ItemType("ElectrolyteGelPack")); - } } } } \ No newline at end of file diff --git a/Items/SquishyBeanMount.cs b/Items/SquishyBeanMount.cs index b0b7c1ce00..730efde911 100644 --- a/Items/SquishyBeanMount.cs +++ b/Items/SquishyBeanMount.cs @@ -19,8 +19,8 @@ namespace CalamityMod.Items item.useTime = 20; item.useAnimation = 20; item.useStyle = 1; - item.value = 100000000; - item.expert = true; + item.value = Item.buyPrice(1, 0, 0, 0); + item.expert = true; item.UseSound = SoundID.Item3; item.noMelee = true; item.mountType = mod.MountType("SquishyBean"); diff --git a/Items/Stardust.cs b/Items/Stardust.cs index c1e703ba07..679c9fed43 100644 --- a/Items/Stardust.cs +++ b/Items/Stardust.cs @@ -7,20 +7,22 @@ using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Items; -namespace CalamityMod.Items { -public class Stardust : ModItem +namespace CalamityMod.Items { - public override void SetStaticDefaults() + public class Stardust : ModItem { - DisplayName.SetDefault("Stardust"); + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Stardust"); + } + + public override void SetDefaults() + { + item.width = 26; + item.height = 18; + item.maxStack = 999; + item.value = Item.buyPrice(0, 3, 0, 0); + item.rare = 5; + } } - - public override void SetDefaults() - { - item.width = 26; - item.height = 18; - item.maxStack = 999; - item.value = 5000; - item.rare = 5; - } -}} \ No newline at end of file +} \ No newline at end of file diff --git a/Items/StormlionMandible.cs b/Items/StormlionMandible.cs index 65c0fd89e1..6fbc8c97a0 100644 --- a/Items/StormlionMandible.cs +++ b/Items/StormlionMandible.cs @@ -7,20 +7,22 @@ using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Items; -namespace CalamityMod.Items { -public class StormlionMandible : ModItem +namespace CalamityMod.Items { - public override void SetStaticDefaults() + public class StormlionMandible : ModItem { - DisplayName.SetDefault("Stormlion Mandible"); + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Stormlion Mandible"); + } + + public override void SetDefaults() + { + item.width = 12; + item.height = 24; + item.maxStack = 999; + item.value = Item.buyPrice(0, 0, 10, 0); + item.rare = 1; + } } - - public override void SetDefaults() - { - item.width = 12; - item.height = 24; - item.maxStack = 999; - item.value = 3000; - item.rare = 2; - } -}} \ No newline at end of file +} \ No newline at end of file diff --git a/Items/SunkenSea/AmidiasPendant.cs b/Items/SunkenSea/AmidiasPendant.cs new file mode 100644 index 0000000000..921ae2a276 --- /dev/null +++ b/Items/SunkenSea/AmidiasPendant.cs @@ -0,0 +1,81 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.SunkenSea +{ + public class AmidiasPendant : ModItem + { + public const int ShardProjectiles = 2; + public const float ShardAngleSpread = 120; + public int ShardCountdown = 0; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Amidias' Pendant"); + Tooltip.SetDefault("Periodically rains down prism shards"); + } + + public override void SetDefaults() + { + item.width = 26; + item.height = 46; + item.value = Item.buyPrice(0, 3, 0, 0); + item.rare = 2; + item.accessory = true; + } + + public override void UpdateAccessory(Player player, bool hideVisual) + { + CalamityPlayer modPlayer = player.GetModPlayer(mod); + if (ShardCountdown == 0) + { + ShardCountdown = 120; + } + if (ShardCountdown > 0) + { + ShardCountdown--; + if (ShardCountdown == 0) + { + if (player.whoAmI == Main.myPlayer) + { + int speed2 = 25; + float spawnX = Main.rand.Next(1000) - 500 + player.Center.X; + float spawnY = -1000 + player.Center.Y; + Vector2 baseSpawn = new Vector2(spawnX, spawnY); + Vector2 baseVelocity = player.Center - baseSpawn; + baseVelocity.Normalize(); + baseVelocity = baseVelocity * speed2; + for (int i = 0; i < ShardProjectiles; i++) + { + Vector2 spawn = baseSpawn; + spawn.X = spawn.X + i * 30 - (ShardProjectiles * 15); + Vector2 velocity = baseVelocity; + velocity = baseVelocity.RotatedBy(MathHelper.ToRadians(-ShardAngleSpread / 2 + (ShardAngleSpread * i / (float)ShardProjectiles))); + velocity.X = velocity.X + 3 * Main.rand.NextFloat() - 1.5f; + int type = 0; + int damage = 0; + switch (Main.rand.Next(3)) + { + case 0: type = mod.ProjectileType("PendantProjectile1"); + damage = 15; break; + case 1: type = mod.ProjectileType("PendantProjectile2"); + damage = 15; break; + case 2: type = mod.ProjectileType("PendantProjectile3"); + damage = 30; break; + } + int projectile = Projectile.NewProjectile(spawn.X, spawn.Y, velocity.X / 3, velocity.Y / 2, type, damage, 5f, Main.myPlayer, 0f, 0f); + Main.projectile[projectile].tileCollide = false; + Main.projectile[projectile].timeLeft = 220; + } + } + } + } + } + } +} \ No newline at end of file diff --git a/Items/SunkenSea/AmidiasPendant.png b/Items/SunkenSea/AmidiasPendant.png new file mode 100644 index 0000000000..d594f73781 Binary files /dev/null and b/Items/SunkenSea/AmidiasPendant.png differ diff --git a/Items/SunkenSea/GiantPearl.cs b/Items/SunkenSea/GiantPearl.cs new file mode 100644 index 0000000000..1cb57730fe --- /dev/null +++ b/Items/SunkenSea/GiantPearl.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.SunkenSea +{ + public class GiantPearl : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Giant Pearl"); + Tooltip.SetDefault("You have a light aura around you\n" + + "Enemies within the aura are slowed down"); + } + + public override void SetDefaults() + { + item.width = 42; + item.height = 32; + item.value = Item.buyPrice(0, 3, 0, 0); + item.rare = 2; + item.accessory = true; + } + + public override void UpdateAccessory(Player player, bool hideVisual) + { + CalamityPlayer modPlayer = player.GetModPlayer(mod); + modPlayer.giantPearl = true; + Lighting.AddLight((int)(player.position.X + (float)(player.width / 2)) / 16, (int)(player.position.Y + (float)(player.height / 2)) / 16, 0.45f, 0.8f, 0.8f); + } + } +} \ No newline at end of file diff --git a/Items/SunkenSea/GiantPearl.png b/Items/SunkenSea/GiantPearl.png new file mode 100644 index 0000000000..80ef815d20 Binary files /dev/null and b/Items/SunkenSea/GiantPearl.png differ diff --git a/Items/SunkenSea/MolluskHusk.cs b/Items/SunkenSea/MolluskHusk.cs new file mode 100644 index 0000000000..574c17fe23 --- /dev/null +++ b/Items/SunkenSea/MolluskHusk.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.SunkenSea +{ + public class MolluskHusk : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Mollusk Husk"); + Tooltip.SetDefault("The remains of a mollusk"); + } + + public override void SetDefaults() + { + item.width = 30; + item.height = 28; + item.maxStack = 999; + item.value = Item.buyPrice(0, 3, 0, 0); + item.rare = 5; + } + } +} \ No newline at end of file diff --git a/Items/SunkenSea/MolluskHusk.png b/Items/SunkenSea/MolluskHusk.png new file mode 100644 index 0000000000..a5f0c8f7b2 Binary files /dev/null and b/Items/SunkenSea/MolluskHusk.png differ diff --git a/Items/SuperDummy.cs b/Items/SuperDummy.cs index 9376c8b1ac..7b191a0794 100644 --- a/Items/SuperDummy.cs +++ b/Items/SuperDummy.cs @@ -62,7 +62,7 @@ namespace CalamityMod.Items { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.TargetDummy); - recipe.AddTile(null, "DraedonsForge"); + recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this); recipe.AddRecipe(); } diff --git a/Items/SupremeCalamitas/EyeofExtinction.cs b/Items/SupremeCalamitas/EyeofExtinction.cs index e5a4aa466f..eae4647343 100644 --- a/Items/SupremeCalamitas/EyeofExtinction.cs +++ b/Items/SupremeCalamitas/EyeofExtinction.cs @@ -27,19 +27,9 @@ namespace CalamityMod.Items.SupremeCalamitas item.useTime = 45; item.useStyle = 4; item.consumable = false; + item.GetGlobalItem(mod).postMoonLordRarity = 15; } - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(108, 45, 199); - } - } - } - public override bool CanUseItem(Player player) { return !NPC.AnyNPCs(mod.NPCType("SupremeCalamitas")); diff --git a/Items/SupremeHealingPotion.cs b/Items/SupremeHealingPotion.cs index e4125ec92c..5c1dfa0698 100644 --- a/Items/SupremeHealingPotion.cs +++ b/Items/SupremeHealingPotion.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items item.width = 28; item.height = 18; item.useTurn = true; - item.maxStack = 30; + item.maxStack = 999; item.healLife = 250; item.useAnimation = 17; item.useTime = 17; @@ -28,19 +28,9 @@ namespace CalamityMod.Items item.UseSound = SoundID.Item3; item.consumable = true; item.potion = true; - item.value = 10000; + item.value = Item.buyPrice(0, 6, 50, 0); + item.GetGlobalItem(mod).postMoonLordRarity = 12; } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 200); - } - } - } public override void AddRecipes() { diff --git a/Items/SupremeManaPotion.cs b/Items/SupremeManaPotion.cs index 89437a0da0..04fe361560 100644 --- a/Items/SupremeManaPotion.cs +++ b/Items/SupremeManaPotion.cs @@ -1,54 +1,44 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; -using Terraria.DataStructures; - -namespace CalamityMod.Items -{ - public class SupremeManaPotion : ModItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Supreme Mana Potion"); - } - - public override void SetDefaults() - { - item.width = 28; - item.height = 18; - item.useTurn = true; - item.maxStack = 30; - item.healMana = 400; - item.useAnimation = 17; - item.useTime = 17; - item.useStyle = 2; - item.UseSound = SoundID.Item3; - item.consumable = true; - item.value = 10000; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 200); - } - } - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.SuperManaPotion); - recipe.AddIngredient(null, "Phantoplasm"); - recipe.AddTile(TileID.LunarCraftingStation); - recipe.SetResult(this); - recipe.AddRecipe(); - } - } +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.DataStructures; + +namespace CalamityMod.Items +{ + public class SupremeManaPotion : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Supreme Mana Potion"); + } + + public override void SetDefaults() + { + item.width = 28; + item.height = 18; + item.useTurn = true; + item.maxStack = 999; + item.healMana = 400; + item.useAnimation = 17; + item.useTime = 17; + item.useStyle = 2; + item.UseSound = SoundID.Item3; + item.consumable = true; + item.value = Item.buyPrice(0, 6, 50, 0); + item.GetGlobalItem(mod).postMoonLordRarity = 12; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.SuperManaPotion); + recipe.AddIngredient(null, "Phantoplasm"); + recipe.AddTile(TileID.LunarCraftingStation); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } } \ No newline at end of file diff --git a/Items/TheDevourerofGods/CosmicWorm.cs b/Items/TheDevourerofGods/CosmicWorm.cs index 47eacf520b..3e5af1fd0d 100644 --- a/Items/TheDevourerofGods/CosmicWorm.cs +++ b/Items/TheDevourerofGods/CosmicWorm.cs @@ -28,19 +28,9 @@ namespace CalamityMod.Items.TheDevourerofGods item.useTime = 45; item.useStyle = 4; item.consumable = false; + item.GetGlobalItem(mod).postMoonLordRarity = 13; } - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 0); - } - } - } - public override bool CanUseItem(Player player) { return !NPC.AnyNPCs(mod.NPCType("DevourerofGodsHead")) && !NPC.AnyNPCs(mod.NPCType("DevourerofGodsHeadS")) && CalamityWorld.DoGSecondStageCountdown <= 0; diff --git a/Items/TheDevourerofGods/CosmiliteBar.cs b/Items/TheDevourerofGods/CosmiliteBar.cs index 818e22073b..393b8a7631 100644 --- a/Items/TheDevourerofGods/CosmiliteBar.cs +++ b/Items/TheDevourerofGods/CosmiliteBar.cs @@ -7,39 +7,31 @@ using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Items; -namespace CalamityMod.Items.TheDevourerofGods { -public class CosmiliteBar : ModItem +namespace CalamityMod.Items.TheDevourerofGods { - public override void SetStaticDefaults() + public class CosmiliteBar : ModItem { - DisplayName.SetDefault("Cosmilite Bar"); - Tooltip.SetDefault("A chunk of highly-resistant cosmic steel"); - Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 6)); + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Cosmilite Bar"); + Tooltip.SetDefault("A chunk of highly-resistant cosmic steel"); + Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 6)); + } + + public override void SetDefaults() + { + item.width = 30; + item.height = 24; + item.maxStack = 999; + item.value = Item.buyPrice(0, 7, 0, 0); + item.GetGlobalItem(mod).postMoonLordRarity = 13; + } + + public override void Update(ref float gravity, ref float maxFallSpeed) + { + float num = (float)Main.rand.Next(90, 111) * 0.01f; + num *= Main.essScale; + Lighting.AddLight((int)((item.position.X + (float)(item.width / 2)) / 16f), (int)((item.position.Y + (float)(item.height / 2)) / 16f), 0.5f * num, 0f * num, 0.5f * num); + } } - - public override void SetDefaults() - { - item.width = 15; - item.height = 12; - item.maxStack = 999; - item.value = 698750; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 0); - } - } - } - - public override void Update(ref float gravity, ref float maxFallSpeed) - { - float num = (float)Main.rand.Next(90, 111) * 0.01f; - num *= Main.essScale; - Lighting.AddLight((int)((item.position.X + (float)(item.width / 2)) / 16f), (int)((item.position.Y + (float)(item.height / 2)) / 16f), 0.5f * num, 0f * num, 0.5f * num); - } -}} \ No newline at end of file +} \ No newline at end of file diff --git a/Items/TheDevourerofGods/DevourerofGodsBag.cs b/Items/TheDevourerofGods/DevourerofGodsBag.cs index 62af74581f..dfaf9bbbc3 100644 --- a/Items/TheDevourerofGods/DevourerofGodsBag.cs +++ b/Items/TheDevourerofGods/DevourerofGodsBag.cs @@ -1,17 +1,19 @@ using Terraria; using Terraria.ModLoader; using Terraria.ID; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; namespace CalamityMod.Items.TheDevourerofGods { public class DevourerofGodsBag : ModItem { public override void SetStaticDefaults() - { - DisplayName.SetDefault("Treasure Bag"); - Tooltip.SetDefault("{$CommonItemTooltip.RightClickToOpen}"); - } - + { + DisplayName.SetDefault("Treasure Bag"); + Tooltip.SetDefault("{$CommonItemTooltip.RightClickToOpen}"); + } + public override void SetDefaults() { item.maxStack = 999; @@ -23,6 +25,12 @@ namespace CalamityMod.Items.TheDevourerofGods bossBagNPC = mod.NPCType("DevourerofGodsHeadS"); } + public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) + { + Vector2 origin = new Vector2(18f, 17f); + spriteBatch.Draw(mod.GetTexture("Items/TheDevourerofGods/DevourerofGodsBagGlow"), item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f); + } + public override bool CanRightClick() { return true; @@ -30,6 +38,43 @@ namespace CalamityMod.Items.TheDevourerofGods public override void OpenBossBag(Player player) { + if (CalamityWorld.revenge) + { + if (player.GetModPlayer(mod).fabsolVodka) + { + player.QuickSpawnItem(mod.ItemType("Fabsol")); + } + if (CalamityWorld.death && player.difficulty == 2) + { + player.QuickSpawnItem(mod.ItemType("CosmicPlushie")); + } + if (Main.rand.Next(100) == 0) + { + player.QuickSpawnItem(mod.ItemType("CosmicDischarge")); + } + else if (CalamityWorld.defiled) + { + if (Main.rand.Next(20) == 0) + { + player.QuickSpawnItem(mod.ItemType("CosmicDischarge")); + } + } + if (Main.rand.Next(20) == 0) + { + switch (Main.rand.Next(3)) + { + case 0: + player.QuickSpawnItem(mod.ItemType("StressPills")); + break; + case 1: + player.QuickSpawnItem(mod.ItemType("Laudanum")); + break; + case 2: + player.QuickSpawnItem(mod.ItemType("HeartofDarkness")); + break; + } + } + } player.TryGettingDevArmor(); if (Main.rand.Next(3) == 0) { @@ -63,18 +108,7 @@ namespace CalamityMod.Items.TheDevourerofGods { player.QuickSpawnItem(mod.ItemType("StaffoftheMechworm")); } - if (CalamityWorld.revenge) - { - if (player.GetModPlayer(mod).fabsolVodka) - { - player.QuickSpawnItem(mod.ItemType("Fabsol")); - } - if (CalamityWorld.death && player.difficulty == 2) - { - player.QuickSpawnItem(mod.ItemType("CosmicPlushie")); - } - } - player.QuickSpawnItem(mod.ItemType("CosmiliteBar"), Main.rand.Next(30, 40)); + player.QuickSpawnItem(mod.ItemType("CosmiliteBar"), Main.rand.Next(30, 40)); player.QuickSpawnItem(mod.ItemType("NebulousCore")); } } diff --git a/Items/TheDevourerofGods/DevourerofGodsBag.png b/Items/TheDevourerofGods/DevourerofGodsBag.png index 58fd0adf49..fa51fe7f44 100644 Binary files a/Items/TheDevourerofGods/DevourerofGodsBag.png and b/Items/TheDevourerofGods/DevourerofGodsBag.png differ diff --git a/Items/TheDevourerofGods/DevourerofGodsBagGlow.png b/Items/TheDevourerofGods/DevourerofGodsBagGlow.png new file mode 100644 index 0000000000..eaef349d7d Binary files /dev/null and b/Items/TheDevourerofGods/DevourerofGodsBagGlow.png differ diff --git a/Items/TheDevourerofGods/NebulousCore.cs b/Items/TheDevourerofGods/NebulousCore.cs index d6a9311d93..19cd164e67 100644 --- a/Items/TheDevourerofGods/NebulousCore.cs +++ b/Items/TheDevourerofGods/NebulousCore.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Items.TheDevourerofGods CalamityCustomThrowingDamagePlayer.ModPlayer(player).throwingDamage += 0.12f; player.rangedDamage += 0.12f; player.minionDamage += 0.12f; - int damage = 300; + int damage = 1500; float knockBack = 3f; if (Main.rand.Next(15) == 0) { diff --git a/Items/TheDevourerofGods/NebulousCore.png b/Items/TheDevourerofGods/NebulousCore.png index 9a89d296f1..17ac03804f 100644 Binary files a/Items/TheDevourerofGods/NebulousCore.png and b/Items/TheDevourerofGods/NebulousCore.png differ diff --git a/Items/TitanScalePotion.cs b/Items/TitanScalePotion.cs index 731f99678a..de0f635f5e 100644 --- a/Items/TitanScalePotion.cs +++ b/Items/TitanScalePotion.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items item.consumable = true; item.buffType = mod.BuffType("TitanScale"); item.buffTime = 18000; - item.value = 10000; + item.value = Item.buyPrice(0, 2, 0, 0); } public override void AddRecipes() diff --git a/Items/TrapperBulb.cs b/Items/TrapperBulb.cs index c02cb3f571..126b5e9331 100644 --- a/Items/TrapperBulb.cs +++ b/Items/TrapperBulb.cs @@ -7,20 +7,22 @@ using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Items; -namespace CalamityMod.Items { -public class TrapperBulb : ModItem +namespace CalamityMod.Items { - public override void SetStaticDefaults() + public class TrapperBulb : ModItem { - DisplayName.SetDefault("Trapper Bulb"); + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Trapper Bulb"); + } + + public override void SetDefaults() + { + item.width = 20; + item.height = 20; + item.maxStack = 999; + item.value = Item.buyPrice(0, 3, 0, 0); + item.rare = 5; + } } - - public override void SetDefaults() - { - item.width = 20; - item.height = 20; - item.maxStack = 999; - item.value = 100000; - item.rare = 5; - } -}} \ No newline at end of file +} \ No newline at end of file diff --git a/Items/TrashmanTrashcan.cs b/Items/TrashmanTrashcan.cs new file mode 100644 index 0000000000..091257ad6d --- /dev/null +++ b/Items/TrashmanTrashcan.cs @@ -0,0 +1,40 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items +{ + public class TrashmanTrashcan : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Trash Can"); + Tooltip.SetDefault("Summons the trash man"); + } + public override void SetDefaults() + { + item.damage = 0; + item.useStyle = 1; + item.useAnimation = 20; + item.useTime = 20; + item.noMelee = true; + item.width = 30; + item.height = 30; + item.value = Item.sellPrice(1, 0, 0, 0); + item.shoot = mod.ProjectileType("DannyDevito"); + item.buffType = mod.BuffType("DannyDevito"); + item.rare = 5; + item.UseSound = SoundID.NPCDeath13; + } + + public override void UseStyle(Player player) + { + if (player.whoAmI == Main.myPlayer && player.itemTime == 0) + { + player.AddBuff(item.buffType, 15, true); + } + } + } +} diff --git a/Items/UeliaceBar.cs b/Items/UeliaceBar.cs index ccfd182c01..1a6772f80b 100644 --- a/Items/UeliaceBar.cs +++ b/Items/UeliaceBar.cs @@ -21,19 +21,9 @@ namespace CalamityMod.Items item.width = 15; item.height = 12; item.maxStack = 999; - item.value = 218750; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 200); - } - } - } + item.value = Item.buyPrice(0, 6, 50, 0); + item.GetGlobalItem(mod).postMoonLordRarity = 12; + } public override void AddRecipes() { diff --git a/Items/UnholyCore.cs b/Items/UnholyCore.cs index 274ca88382..80f94fcb64 100644 --- a/Items/UnholyCore.cs +++ b/Items/UnholyCore.cs @@ -21,8 +21,8 @@ namespace CalamityMod.Items item.width = 15; item.height = 12; item.maxStack = 999; - item.value = 58750; - item.rare = 5; + item.value = Item.buyPrice(0, 4, 0, 0); + item.rare = 6; } public override void AddRecipes() diff --git a/Items/VerstaltiteBar.cs b/Items/VerstaltiteBar.cs index a224bc4539..d7a4395f40 100644 --- a/Items/VerstaltiteBar.cs +++ b/Items/VerstaltiteBar.cs @@ -18,11 +18,11 @@ namespace CalamityMod.Items public override void SetDefaults() { - item.width = 15; - item.height = 12; + item.width = 30; + item.height = 24; item.maxStack = 999; - item.value = 100000; - item.rare = 5; + item.value = Item.buyPrice(0, 3, 0, 0); + item.rare = 5; } public override void AddRecipes() diff --git a/Items/VictideBar.cs b/Items/VictideBar.cs index b99189ebdf..8604bd219a 100644 --- a/Items/VictideBar.cs +++ b/Items/VictideBar.cs @@ -7,32 +7,34 @@ using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Items; -namespace CalamityMod.Items { -public class VictideBar : ModItem +namespace CalamityMod.Items { - public override void SetStaticDefaults() + public class VictideBar : ModItem { - DisplayName.SetDefault("Victide Bar"); + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Victide Bar"); + } + + public override void SetDefaults() + { + item.width = 30; + item.height = 24; + item.maxStack = 999; + item.value = Item.buyPrice(0, 0, 50, 0); + item.rare = 2; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "VictoryShard"); + recipe.AddIngredient(ItemID.Coral); + recipe.AddIngredient(ItemID.Starfish); + recipe.AddIngredient(ItemID.Seashell); + recipe.AddTile(TileID.Furnaces); + recipe.SetResult(this); + recipe.AddRecipe(); + } } - - public override void SetDefaults() - { - item.width = 15; - item.height = 12; - item.maxStack = 999; - item.value = 15750; - item.rare = 2; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "VictoryShard"); - recipe.AddIngredient(ItemID.Coral); - recipe.AddIngredient(ItemID.Starfish); - recipe.AddIngredient(ItemID.Seashell); - recipe.AddTile(TileID.Furnaces); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} \ No newline at end of file +} \ No newline at end of file diff --git a/Items/Weapons/AMR.cs b/Items/Weapons/AMR.cs index b0bcbd1c0a..e7492632d2 100644 --- a/Items/Weapons/AMR.cs +++ b/Items/Weapons/AMR.cs @@ -37,24 +37,14 @@ namespace CalamityMod.Items.Weapons item.shoot = 10; item.shootSpeed = 12f; item.useAmmo = 97; - } + item.GetGlobalItem(mod).postMoonLordRarity = 14; + } public override Vector2? HoldoutOffset() { return new Vector2(-10, 0); } - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(43, 96, 222); - } - } - } - public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); diff --git a/Items/Weapons/AbyssWeapons/CalamarisLament.cs b/Items/Weapons/AbyssWeapons/CalamarisLament.cs index b7bd42ba86..1fe44dd387 100644 --- a/Items/Weapons/AbyssWeapons/CalamarisLament.cs +++ b/Items/Weapons/AbyssWeapons/CalamarisLament.cs @@ -41,18 +41,8 @@ namespace CalamityMod.Items.Weapons.AbyssWeapons item.shoot = mod.ProjectileType("Calamari"); item.shootSpeed = 10f; item.summon = true; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 0); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 13; + } public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { diff --git a/Items/Weapons/AbyssWeapons/EidolicWail.cs b/Items/Weapons/AbyssWeapons/EidolicWail.cs index 8337e7333e..120b0b41d4 100644 --- a/Items/Weapons/AbyssWeapons/EidolicWail.cs +++ b/Items/Weapons/AbyssWeapons/EidolicWail.cs @@ -35,22 +35,12 @@ namespace CalamityMod.Items.Weapons.AbyssWeapons item.autoReuse = true; item.shootSpeed = 5f; item.shoot = mod.ProjectileType("EidolicWail"); - } + item.GetGlobalItem(mod).postMoonLordRarity = 13; + } public override Vector2? HoldoutOffset() { return new Vector2(-5, 0); } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 0); - } - } - } } } \ No newline at end of file diff --git a/Items/Weapons/AbyssWeapons/HalibutCannon.cs b/Items/Weapons/AbyssWeapons/HalibutCannon.cs index 692f4091cd..cabc236590 100644 --- a/Items/Weapons/AbyssWeapons/HalibutCannon.cs +++ b/Items/Weapons/AbyssWeapons/HalibutCannon.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.AbyssWeapons public override void SetDefaults() { - item.damage = 3; + item.damage = 6; item.ranged = true; item.width = 108; item.height = 54; @@ -44,8 +44,8 @@ namespace CalamityMod.Items.Weapons.AbyssWeapons public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - if (Main.hardMode) { item.damage = 6; } - if (NPC.downedMoonlord) { item.damage = 12; } + if (Main.hardMode) { item.damage = 12; } + if (NPC.downedMoonlord) { item.damage = 24; } int num6 = Main.rand.Next(25, 36); for (int index = 0; index < num6; ++index) { diff --git a/Items/Weapons/AbyssWeapons/SoulEdge.cs b/Items/Weapons/AbyssWeapons/SoulEdge.cs index 527945b4ae..1a55332fa3 100644 --- a/Items/Weapons/AbyssWeapons/SoulEdge.cs +++ b/Items/Weapons/AbyssWeapons/SoulEdge.cs @@ -34,18 +34,8 @@ namespace CalamityMod.Items.Weapons.AbyssWeapons item.rare = 10; item.shoot = mod.ProjectileType("GhastlySoulLarge"); item.shootSpeed = 12f; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 0); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 13; + } public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { diff --git a/Items/Weapons/AbyssWeapons/SulphuricAcidCannon.cs b/Items/Weapons/AbyssWeapons/SulphuricAcidCannon.cs index 7661d9d7e9..960148a9f8 100644 --- a/Items/Weapons/AbyssWeapons/SulphuricAcidCannon.cs +++ b/Items/Weapons/AbyssWeapons/SulphuricAcidCannon.cs @@ -33,18 +33,8 @@ namespace CalamityMod.Items.Weapons.AbyssWeapons item.UseSound = SoundID.Item95; item.shoot = mod.ProjectileType("SulphuricAcidCannon2"); item.shootSpeed = 7f; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 0); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 13; + } public override Vector2? HoldoutOffset() { diff --git a/Items/Weapons/AbyssWeapons/UndinesRetribution.cs b/Items/Weapons/AbyssWeapons/UndinesRetribution.cs index 6345866b72..77c10d14cc 100644 --- a/Items/Weapons/AbyssWeapons/UndinesRetribution.cs +++ b/Items/Weapons/AbyssWeapons/UndinesRetribution.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.AbyssWeapons public override void SetDefaults() { - item.damage = 36; + item.damage = 30; item.magic = true; item.mana = 15; item.width = 64; diff --git a/Items/Weapons/AccretionDiskMelee.cs b/Items/Weapons/AccretionDiskMelee.cs index f2412828da..3115685e2c 100644 --- a/Items/Weapons/AccretionDiskMelee.cs +++ b/Items/Weapons/AccretionDiskMelee.cs @@ -35,19 +35,9 @@ namespace CalamityMod.Items.Weapons item.rare = 10; item.shoot = mod.ProjectileType("AccretionDiskMelee"); item.shootSpeed = 13f; + item.GetGlobalItem(mod).postMoonLordRarity = 12; } - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 200); - } - } - } - public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); diff --git a/Items/Weapons/AcidBullet.cs b/Items/Weapons/AcidBullet.cs index 89bf6cc90b..6205b18031 100644 --- a/Items/Weapons/AcidBullet.cs +++ b/Items/Weapons/AcidBullet.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons public override void SetDefaults() { - item.damage = 36; + item.damage = 28; item.ranged = true; item.width = 8; item.height = 8; diff --git a/Items/Weapons/AegisBlade.cs b/Items/Weapons/AegisBlade.cs index 41ae006489..0649249212 100644 --- a/Items/Weapons/AegisBlade.cs +++ b/Items/Weapons/AegisBlade.cs @@ -36,19 +36,9 @@ namespace CalamityMod.Items.Weapons item.value = Item.buyPrice(0, 60, 0, 0); item.shootSpeed = 9f; item.shoot = mod.ProjectileType("NobodyKnows"); + item.GetGlobalItem(mod).postMoonLordRarity = 17; } - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(255, Main.DiscoG, 53); - } - } - } - public override bool AltFunctionUse(Player player) { return true; diff --git a/Items/Weapons/AethersWhisper.cs b/Items/Weapons/AethersWhisper.cs index e4d8154069..fee9d99b21 100644 --- a/Items/Weapons/AethersWhisper.cs +++ b/Items/Weapons/AethersWhisper.cs @@ -37,24 +37,14 @@ namespace CalamityMod.Items.Weapons item.autoReuse = true; item.shootSpeed = 12f; item.shoot = mod.ProjectileType("AetherBeam"); - } + item.GetGlobalItem(mod).postMoonLordRarity = 13; + } public override Vector2? HoldoutOffset() { return new Vector2(-10, 0); } - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 0); - } - } - } - public override bool AltFunctionUse(Player player) { return true; diff --git a/Items/Weapons/Alluvion.cs b/Items/Weapons/Alluvion.cs index 6c8e637549..6453e5b906 100644 --- a/Items/Weapons/Alluvion.cs +++ b/Items/Weapons/Alluvion.cs @@ -6,7 +6,6 @@ using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Items; -//using TerrariaOverhaul; namespace CalamityMod.Items.Weapons { @@ -39,23 +38,8 @@ namespace CalamityMod.Items.Weapons item.shoot = 1; item.shootSpeed = 17f; item.useAmmo = 40; - } - - /*public void OverhaulInit() - { - this.SetTag("bow"); - }*/ - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(43, 96, 222); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 14; + } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { diff --git a/Items/Weapons/AlphaRay.cs b/Items/Weapons/AlphaRay.cs index 3cba38f7c9..fbc7b6997d 100644 --- a/Items/Weapons/AlphaRay.cs +++ b/Items/Weapons/AlphaRay.cs @@ -36,23 +36,13 @@ namespace CalamityMod.Items.Weapons item.autoReuse = true; item.shootSpeed = 6f; item.shoot = mod.ProjectileType("ParticleBeamofDoom"); - } + item.GetGlobalItem(mod).postMoonLordRarity = 14; + } public override Vector2? HoldoutOffset() { return new Vector2(-5, 0); } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(43, 96, 222); - } - } - } public override bool AltFunctionUse(Player player) { diff --git a/Items/Weapons/AncientShiv.png b/Items/Weapons/AncientShiv.png index 132c07448c..baa82de97c 100644 Binary files a/Items/Weapons/AncientShiv.png and b/Items/Weapons/AncientShiv.png differ diff --git a/Items/Weapons/Animosity.cs b/Items/Weapons/Animosity.cs index 117e9352d6..8fa41bf3a8 100644 --- a/Items/Weapons/Animosity.cs +++ b/Items/Weapons/Animosity.cs @@ -90,7 +90,7 @@ namespace CalamityMod.Items.Weapons public override bool ConsumeAmmo(Player player) { - if (Main.rand.Next(0, 100) <= 50) + if (Main.rand.Next(0, 100) < 50) return false; return true; } diff --git a/Items/Weapons/Animus.cs b/Items/Weapons/Animus.cs index 071a4f1c41..d15e071422 100644 --- a/Items/Weapons/Animus.cs +++ b/Items/Weapons/Animus.cs @@ -31,18 +31,8 @@ namespace CalamityMod.Items.Weapons item.height = 90; item.value = Item.buyPrice(5, 0, 0, 0); item.rare = 10; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(255, 0, 255); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 16; + } public override void AddRecipes() { diff --git a/Items/Weapons/ApoctosisArray.cs b/Items/Weapons/ApoctosisArray.cs index 85f4fed1d7..cd2af6c3fd 100644 --- a/Items/Weapons/ApoctosisArray.cs +++ b/Items/Weapons/ApoctosisArray.cs @@ -34,19 +34,9 @@ namespace CalamityMod.Items.Weapons item.rare = 10; item.shoot = mod.ProjectileType("IonBlast"); item.shootSpeed = 8f; + item.GetGlobalItem(mod).postMoonLordRarity = 12; } - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 200); - } - } - } - public override Vector2? HoldoutOffset() { return new Vector2(-25, 0); diff --git a/Items/Weapons/Apotheosis.cs b/Items/Weapons/Apotheosis.cs index 2b227e643d..80f5d24bcb 100644 --- a/Items/Weapons/Apotheosis.cs +++ b/Items/Weapons/Apotheosis.cs @@ -34,19 +34,9 @@ namespace CalamityMod.Items.Weapons item.autoReuse = true; item.shoot = mod.ProjectileType("ApothMark"); item.shootSpeed = 15; + item.GetGlobalItem(mod).postMoonLordRarity = 16; } - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(255, 0, 255); - } - } - } - public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); diff --git a/Items/Weapons/AquaticDissolution.cs b/Items/Weapons/AquaticDissolution.cs index a803639d36..43ec0d29b9 100644 --- a/Items/Weapons/AquaticDissolution.cs +++ b/Items/Weapons/AquaticDissolution.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons public override void SetDefaults() { item.width = 50; - item.damage = 154; + item.damage = 165; item.melee = true; item.useAnimation = 16; item.useTime = 16; @@ -33,19 +33,9 @@ namespace CalamityMod.Items.Weapons item.rare = 10; item.shoot = mod.ProjectileType("OceanBeam"); item.shootSpeed = 12f; + item.GetGlobalItem(mod).postMoonLordRarity = 12; } - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 200); - } - } - } - public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { for (int x = 0; x < 3; x++) diff --git a/Items/Weapons/AquaticScourge/Downpour.cs b/Items/Weapons/AquaticScourge/Downpour.cs index 79400ec77c..6962ee8937 100644 --- a/Items/Weapons/AquaticScourge/Downpour.cs +++ b/Items/Weapons/AquaticScourge/Downpour.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.AquaticScourge public override void SetDefaults() { - item.damage = 48; + item.damage = 43; item.magic = true; item.mana = 10; item.width = 42; diff --git a/Items/Weapons/ArkoftheCosmos.cs b/Items/Weapons/ArkoftheCosmos.cs index 7cc188ab92..d94bc8bf19 100644 --- a/Items/Weapons/ArkoftheCosmos.cs +++ b/Items/Weapons/ArkoftheCosmos.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons public override void SetDefaults() { item.width = 100; - item.damage = 350; + item.damage = 680; item.melee = true; item.useAnimation = 15; item.useTime = 15; @@ -36,19 +36,9 @@ namespace CalamityMod.Items.Weapons item.rare = 10; item.shoot = mod.ProjectileType("EonBeam"); item.shootSpeed = 28f; + item.GetGlobalItem(mod).postMoonLordRarity = 15; } - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(108, 45, 199); - } - } - } - public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { switch (Main.rand.Next(4)) diff --git a/Items/Weapons/ArkoftheElements.cs b/Items/Weapons/ArkoftheElements.cs index 9bbef70f64..aad2d7abac 100644 --- a/Items/Weapons/ArkoftheElements.cs +++ b/Items/Weapons/ArkoftheElements.cs @@ -34,19 +34,9 @@ namespace CalamityMod.Items.Weapons item.rare = 10; item.shoot = mod.ProjectileType("EonBeam"); item.shootSpeed = 16f; + item.GetGlobalItem(mod).postMoonLordRarity = 12; } - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 200); - } - } - } - public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { switch (Main.rand.Next(4)) diff --git a/Items/Weapons/ArterialAssault.cs b/Items/Weapons/ArterialAssault.cs index a43abae6b9..d3e2eb681d 100644 --- a/Items/Weapons/ArterialAssault.cs +++ b/Items/Weapons/ArterialAssault.cs @@ -6,7 +6,6 @@ using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Items; -//using TerrariaOverhaul; namespace CalamityMod.Items.Weapons { @@ -37,23 +36,8 @@ namespace CalamityMod.Items.Weapons item.shoot = mod.ProjectileType("BloodfireArrow"); item.shootSpeed = 30f; item.useAmmo = 40; - } - - /*public void OverhaulInit() - { - this.SetTag("bow"); - }*/ - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 0); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 13; + } public override void AddRecipes() { diff --git a/Items/Weapons/AsteroidStaff.cs b/Items/Weapons/AsteroidStaff.cs index 7bf7b1c81f..84d23c91a2 100644 --- a/Items/Weapons/AsteroidStaff.cs +++ b/Items/Weapons/AsteroidStaff.cs @@ -35,18 +35,8 @@ namespace CalamityMod.Items.Weapons item.autoReuse = true; item.shoot = mod.ProjectileType("Asteroid"); item.shootSpeed = 20f; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 200); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 12; + } public override void AddRecipes() { diff --git a/Items/Weapons/Astral/AstralBlaster.cs b/Items/Weapons/Astral/AstralBlaster.cs index cf7ff60ff4..f4117969f6 100644 --- a/Items/Weapons/Astral/AstralBlaster.cs +++ b/Items/Weapons/Astral/AstralBlaster.cs @@ -1,55 +1,55 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items; - -namespace CalamityMod.Items.Weapons.Astral -{ - public class AstralBlaster : ModItem - { +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.Weapons.Astral +{ + public class AstralBlaster : ModItem + { public override void SetStaticDefaults() { DisplayName.SetDefault("Astral Blaster"); } - public override void SetDefaults() - { - item.damage = 100; - item.crit += 25; - item.ranged = true; - item.width = 40; - item.height = 24; - item.useTime = 11; - item.useAnimation = 11; - item.useStyle = 5; - item.noMelee = true; - item.knockBack = 2.75f; - item.value = Item.buyPrice(0, 60, 0, 0); - item.rare = 7; - item.UseSound = SoundID.Item41; - item.autoReuse = true; - item.shootSpeed = 14f; - item.shoot = mod.ProjectileType("AstralRound"); - item.useAmmo = 97; - } - - public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, mod.ProjectileType("AstralRound"), damage, knockBack, player.whoAmI, 0.0f, 0.0f); - return false; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "AstralBar", 6); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(this); - recipe.AddRecipe(); - } - } + public override void SetDefaults() + { + item.damage = 100; + item.crit += 25; + item.ranged = true; + item.width = 40; + item.height = 24; + item.useTime = 11; + item.useAnimation = 11; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 2.75f; + item.value = Item.buyPrice(0, 60, 0, 0); + item.rare = 7; + item.UseSound = SoundID.Item41; + item.autoReuse = true; + item.shootSpeed = 14f; + item.shoot = mod.ProjectileType("AstralRound"); + item.useAmmo = 97; + } + + public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, mod.ProjectileType("AstralRound"), damage, knockBack, player.whoAmI, 0.0f, 0.0f); + return false; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "AstralBar", 6); + recipe.AddTile(TileID.MythrilAnvil); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } } \ No newline at end of file diff --git a/Items/Weapons/Astral/AstralPike.cs b/Items/Weapons/Astral/AstralPike.cs index e15a9beeac..c886c71bc6 100644 --- a/Items/Weapons/Astral/AstralPike.cs +++ b/Items/Weapons/Astral/AstralPike.cs @@ -1,62 +1,62 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items; - -namespace CalamityMod.Items.Weapons.Astral -{ - public class AstralPike : ModItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Astral Pike"); - } - - public override void SetDefaults() - { - item.width = 44; - item.damage = 85; - item.crit += 25; - item.melee = true; - item.noMelee = true; - item.useTurn = true; - item.noUseGraphic = true; - item.useAnimation = 13; - item.useStyle = 5; - item.useTime = 13; - item.knockBack = 8.5f; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - item.height = 50; - item.value = Item.buyPrice(0, 60, 0, 0); - item.rare = 7; - item.shoot = mod.ProjectileType("AstralPike"); - item.shootSpeed = 9f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "AstralBar", 8); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(this); - recipe.AddRecipe(); - } - - public override bool CanUseItem(Player player) - { - for (int i = 0; i < 1000; ++i) - { - if (Main.projectile[i].active && Main.projectile[i].owner == Main.myPlayer && Main.projectile[i].type == item.shoot) - { - return false; - } - } - return true; - } - } -} +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.Weapons.Astral +{ + public class AstralPike : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Astral Pike"); + } + + public override void SetDefaults() + { + item.width = 44; + item.damage = 85; + item.crit += 25; + item.melee = true; + item.noMelee = true; + item.useTurn = true; + item.noUseGraphic = true; + item.useAnimation = 13; + item.useStyle = 5; + item.useTime = 13; + item.knockBack = 8.5f; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.height = 50; + item.value = Item.buyPrice(0, 60, 0, 0); + item.rare = 7; + item.shoot = mod.ProjectileType("AstralPike"); + item.shootSpeed = 9f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "AstralBar", 8); + recipe.AddTile(TileID.MythrilAnvil); + recipe.SetResult(this); + recipe.AddRecipe(); + } + + public override bool CanUseItem(Player player) + { + for (int i = 0; i < 1000; ++i) + { + if (Main.projectile[i].active && Main.projectile[i].owner == Main.myPlayer && Main.projectile[i].type == item.shoot) + { + return false; + } + } + return true; + } + } +} diff --git a/Items/Weapons/Astral/AstralRepeater.cs b/Items/Weapons/Astral/AstralRepeater.cs index e86bdd7453..eb286da3cc 100644 --- a/Items/Weapons/Astral/AstralRepeater.cs +++ b/Items/Weapons/Astral/AstralRepeater.cs @@ -1,56 +1,56 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items; -//using TerrariaOverhaul; - -namespace CalamityMod.Items.Weapons.Astral -{ - public class AstralRepeater : ModItem - { +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; +//using TerrariaOverhaul; + +namespace CalamityMod.Items.Weapons.Astral +{ + public class AstralRepeater : ModItem + { public override void SetStaticDefaults() { DisplayName.SetDefault("Astral Bow"); } - public override void SetDefaults() - { - item.damage = 65; - item.crit += 25; - item.ranged = true; - item.width = 38; - item.height = 78; - item.useTime = 4; - item.reuseDelay = 15; - item.useAnimation = 12; - item.useStyle = 5; - item.noMelee = true; - item.knockBack = 2.5f; - item.value = Item.buyPrice(0, 60, 0, 0); - item.rare = 7; - item.UseSound = SoundID.Item5; - item.autoReuse = true; - item.shoot = 10; - item.shootSpeed = 16f; - item.useAmmo = 40; - } - - /*public void OverhaulInit() - { - this.SetTag("crossbow"); - }*/ - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "AstralBar", 7); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(this); - recipe.AddRecipe(); - } - } + public override void SetDefaults() + { + item.damage = 65; + item.crit += 25; + item.ranged = true; + item.width = 38; + item.height = 78; + item.useTime = 4; + item.reuseDelay = 15; + item.useAnimation = 12; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 2.5f; + item.value = Item.buyPrice(0, 60, 0, 0); + item.rare = 7; + item.UseSound = SoundID.Item5; + item.autoReuse = true; + item.shoot = 10; + item.shootSpeed = 16f; + item.useAmmo = 40; + } + + /*public void OverhaulInit() + { + this.SetTag("crossbow"); + }*/ + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "AstralBar", 7); + recipe.AddTile(TileID.MythrilAnvil); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } } \ No newline at end of file diff --git a/Items/Weapons/Astral/AstralScythe.cs b/Items/Weapons/Astral/AstralScythe.cs index ef7ef4d7b6..d17b810ccf 100644 --- a/Items/Weapons/Astral/AstralScythe.cs +++ b/Items/Weapons/Astral/AstralScythe.cs @@ -1,39 +1,39 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items; - -namespace CalamityMod.Items.Weapons.Astral -{ - public class AstralScythe : ModItem - { +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.Weapons.Astral +{ + public class AstralScythe : ModItem + { public override void SetStaticDefaults() { - DisplayName.SetDefault("Astral Scythe"); + DisplayName.SetDefault("Astral Scythe"); Tooltip.SetDefault("Shoots a scythe ring that accelerates over time"); } - public override void SetDefaults() - { - item.width = 62; - item.height = 54; - item.damage = 95; - item.melee = true; - item.useTurn = true; - item.useAnimation = 20; - item.useStyle = 1; - item.useTime = 20; - item.knockBack = 6f; - item.UseSound = SoundID.Item71; - item.autoReuse = true; + public override void SetDefaults() + { + item.width = 56; + item.height = 60; + item.damage = 95; + item.melee = true; + item.useTurn = true; + item.useAnimation = 20; + item.useStyle = 1; + item.useTime = 20; + item.knockBack = 6f; + item.UseSound = SoundID.Item71; + item.autoReuse = true; item.value = Item.buyPrice(0, 60, 0, 0); - item.rare = 7; - item.shoot = mod.ProjectileType("AstralScytheProjectile"); - item.shootSpeed = 5f; - } - } -} + item.rare = 7; + item.shoot = mod.ProjectileType("AstralScytheProjectile"); + item.shootSpeed = 5f; + } + } +} diff --git a/Items/Weapons/Astral/AstralScythe.png b/Items/Weapons/Astral/AstralScythe.png index 3191313a9c..9a950eaffa 100644 Binary files a/Items/Weapons/Astral/AstralScythe.png and b/Items/Weapons/Astral/AstralScythe.png differ diff --git a/Items/Weapons/Astral/AstralStaff.cs b/Items/Weapons/Astral/AstralStaff.cs index 4f4c0c7172..e95f4fe9ee 100644 --- a/Items/Weapons/Astral/AstralStaff.cs +++ b/Items/Weapons/Astral/AstralStaff.cs @@ -29,8 +29,8 @@ namespace CalamityMod.Items.Weapons.Astral item.useAnimation = 35; item.useStyle = 5; item.noMelee = true; - item.knockBack = 5f; - item.value = Item.buyPrice(0, 60, 0, 0); + item.knockBack = 5f; + item.value = Item.buyPrice(0, 60, 0, 0); item.rare = 7; item.UseSound = SoundID.Item105; item.autoReuse = true; diff --git a/Items/Weapons/Astral/AstralachneaStaff.cs b/Items/Weapons/Astral/AstralachneaStaff.cs index 41c81917de..30da655aa0 100644 --- a/Items/Weapons/Astral/AstralachneaStaff.cs +++ b/Items/Weapons/Astral/AstralachneaStaff.cs @@ -1,82 +1,82 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items; - -namespace CalamityMod.Items.Weapons.Astral -{ - public class AstralachneaStaff : ModItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Astralachnea Staff"); - Tooltip.SetDefault("Fires a spread of homing astral spider fangs"); - Item.staff[item.type] = true; - } - - public override void SetDefaults() - { - item.damage = 60; - item.magic = true; - item.mana = 19; - item.width = 52; - item.height = 52; - item.useTime = 21; - item.useAnimation = 21; - item.useStyle = 5; - item.noMelee = true; - item.knockBack = 6f; +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.Weapons.Astral +{ + public class AstralachneaStaff : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Astralachnea Staff"); + Tooltip.SetDefault("Fires a spread of homing astral spider fangs"); + Item.staff[item.type] = true; + } + + public override void SetDefaults() + { + item.damage = 60; + item.magic = true; + item.mana = 19; + item.width = 52; + item.height = 52; + item.useTime = 21; + item.useAnimation = 21; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 6f; item.value = Item.buyPrice(0, 60, 0, 0); - item.rare = 7; - item.UseSound = SoundID.Item46; - item.autoReuse = true; - item.shoot = mod.ProjectileType("AstralachneaFang"); - item.shootSpeed = 13f; - } - - public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); - int i = Main.myPlayer; - float num72 = item.shootSpeed; - int num73 = damage; - float num74 = knockBack; - float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; - float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; - float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); - int spikeAmount = 4; - if (Main.rand.Next(3) == 0) - { - spikeAmount++; - } - if (Main.rand.Next(4) == 0) - { - spikeAmount++; - } - if (Main.rand.Next(5) == 0) - { - spikeAmount += 2; - } - for (int num131 = 0; num131 < spikeAmount; num131++) - { - float num132 = num78; - float num133 = num79; - float num134 = 0.05f * (float)num131; - num132 += (float)Main.rand.Next(-400, 400) * num134; - num133 += (float)Main.rand.Next(-400, 400) * num134; - num80 = (float)Math.Sqrt((double)(num132 * num132 + num133 * num133)); - num80 = num72 / num80; - num132 *= num80; - num133 *= num80; - float x2 = vector2.X; - float y2 = vector2.Y; - Projectile.NewProjectile(x2, y2, num132, num133, mod.ProjectileType("AstralachneaFang"), num73, num74, i, 0f, 0f); - } - return false; - } - } + item.rare = 7; + item.UseSound = SoundID.Item46; + item.autoReuse = true; + item.shoot = mod.ProjectileType("AstralachneaFang"); + item.shootSpeed = 13f; + } + + public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); + int i = Main.myPlayer; + float num72 = item.shootSpeed; + int num73 = damage; + float num74 = knockBack; + float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; + float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; + float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); + int spikeAmount = 4; + if (Main.rand.Next(3) == 0) + { + spikeAmount++; + } + if (Main.rand.Next(4) == 0) + { + spikeAmount++; + } + if (Main.rand.Next(5) == 0) + { + spikeAmount += 2; + } + for (int num131 = 0; num131 < spikeAmount; num131++) + { + float num132 = num78; + float num133 = num79; + float num134 = 0.05f * (float)num131; + num132 += (float)Main.rand.Next(-400, 400) * num134; + num133 += (float)Main.rand.Next(-400, 400) * num134; + num80 = (float)Math.Sqrt((double)(num132 * num132 + num133 * num133)); + num80 = num72 / num80; + num132 *= num80; + num133 *= num80; + float x2 = vector2.X; + float y2 = vector2.Y; + Projectile.NewProjectile(x2, y2, num132, num133, mod.ProjectileType("AstralachneaFang"), num73, num74, i, 0f, 0f); + } + return false; + } + } } \ No newline at end of file diff --git a/Items/Weapons/Astral/HivePod.cs b/Items/Weapons/Astral/HivePod.cs index 9f0dea68bc..216e9478af 100644 --- a/Items/Weapons/Astral/HivePod.cs +++ b/Items/Weapons/Astral/HivePod.cs @@ -1,63 +1,63 @@ -using System; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Weapons.Astral -{ - public class HivePod : ModItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Hive Pod"); - Tooltip.SetDefault("Summons an astral hive to protect you"); - } - - public override void SetDefaults() - { - item.damage = 90; - item.mana = 10; - item.summon = true; - item.sentry = true; - item.width = 46; - item.height = 50; - item.useTime = 30; - item.useAnimation = 30; - item.useStyle = 1; - item.noMelee = true; - item.knockBack = 4f; +using System; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Astral +{ + public class HivePod : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Hive Pod"); + Tooltip.SetDefault("Summons an astral hive to protect you"); + } + + public override void SetDefaults() + { + item.damage = 90; + item.mana = 10; + item.summon = true; + item.sentry = true; + item.width = 46; + item.height = 50; + item.useTime = 30; + item.useAnimation = 30; + item.useStyle = 1; + item.noMelee = true; + item.knockBack = 4f; item.value = Item.buyPrice(0, 60, 0, 0); - item.rare = 7; - item.UseSound = SoundID.Item78; - item.shoot = mod.ProjectileType("Hive"); - } - - public override bool AltFunctionUse(Player player) - { - return true; - } - - public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - if (player.altFunctionUse != 2) - { - position = Main.MouseWorld; - speedX = 0; - speedY = 0; - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI); - player.UpdateMaxTurrets(); - } - return false; - } - - public override bool UseItem(Player player) - { - if (player.altFunctionUse == 2) - { - player.MinionNPCTargetAim(); - } - return base.UseItem(player); - } - } -} + item.rare = 7; + item.UseSound = SoundID.Item78; + item.shoot = mod.ProjectileType("Hive"); + } + + public override bool AltFunctionUse(Player player) + { + return true; + } + + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + if (player.altFunctionUse != 2) + { + position = Main.MouseWorld; + speedX = 0; + speedY = 0; + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI); + player.UpdateMaxTurrets(); + } + return false; + } + + public override bool UseItem(Player player) + { + if (player.altFunctionUse == 2) + { + player.MinionNPCTargetAim(); + } + return base.UseItem(player); + } + } +} diff --git a/Items/Weapons/Astral/StellarCannon.cs b/Items/Weapons/Astral/StellarCannon.cs index d916a97942..e5f03a623b 100644 --- a/Items/Weapons/Astral/StellarCannon.cs +++ b/Items/Weapons/Astral/StellarCannon.cs @@ -1,44 +1,44 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items; - -namespace CalamityMod.Items.Weapons.Astral -{ - public class StellarCannon : ModItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Stellar Cannon"); - Tooltip.SetDefault("Launches an explosive astral crystal"); - } - - public override void SetDefaults() - { - item.damage = 250; - item.ranged = true; - item.width = 50; - item.height = 30; - item.useTime = 30; - item.useAnimation = 30; - item.useStyle = 5; - item.noMelee = true; - item.knockBack = 7f; +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.Weapons.Astral +{ + public class StellarCannon : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Stellar Cannon"); + Tooltip.SetDefault("Launches an explosive astral crystal"); + } + + public override void SetDefaults() + { + item.damage = 250; + item.ranged = true; + item.width = 50; + item.height = 30; + item.useTime = 30; + item.useAnimation = 30; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 7f; item.value = Item.buyPrice(0, 60, 0, 0); - item.rare = 7; - item.UseSound = SoundID.Item92; - item.autoReuse = true; - item.shoot = mod.ProjectileType("AstralCannonProjectile"); - item.shootSpeed = 2f; - } - - public override Vector2? HoldoutOffset() - { - return new Vector2(-5, 0); - } - } + item.rare = 7; + item.UseSound = SoundID.Item92; + item.autoReuse = true; + item.shoot = mod.ProjectileType("AstralCannonProjectile"); + item.shootSpeed = 2f; + } + + public override Vector2? HoldoutOffset() + { + return new Vector2(-5, 0); + } + } } \ No newline at end of file diff --git a/Items/Weapons/Astral/TitanArm.cs b/Items/Weapons/Astral/TitanArm.cs index 3447329eac..a525c1466e 100644 --- a/Items/Weapons/Astral/TitanArm.cs +++ b/Items/Weapons/Astral/TitanArm.cs @@ -1,38 +1,38 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items; - -namespace CalamityMod.Items.Weapons.Astral -{ - public class TitanArm : ModItem - { +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.Weapons.Astral +{ + public class TitanArm : ModItem + { public override void SetStaticDefaults() { - DisplayName.SetDefault("Titan Arm"); + DisplayName.SetDefault("Titan Arm"); Tooltip.SetDefault("Slap Hand but better"); } - public override void SetDefaults() - { - item.width = 46; - item.height = 58; - item.damage = 60; - item.crit += 96; //more knockback huehue - item.melee = true; - item.useTurn = true; - item.useAnimation = 12; - item.useStyle = 1; - item.useTime = 12; - item.knockBack = 9001f; - item.UseSound = SoundID.Item1; - item.autoReuse = true; + public override void SetDefaults() + { + item.width = 46; + item.height = 58; + item.damage = 60; + item.crit += 96; //more knockback huehue + item.melee = true; + item.useTurn = true; + item.useAnimation = 12; + item.useStyle = 1; + item.useTime = 12; + item.knockBack = 9001f; + item.UseSound = SoundID.Item1; + item.autoReuse = true; item.value = Item.buyPrice(0, 60, 0, 0); - item.rare = 7; - } - } -} + item.rare = 7; + } + } +} diff --git a/Items/Weapons/AstrealDefeat.cs b/Items/Weapons/AstrealDefeat.cs index 2286b4daa6..f73129f2ad 100644 --- a/Items/Weapons/AstrealDefeat.cs +++ b/Items/Weapons/AstrealDefeat.cs @@ -6,7 +6,6 @@ using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Items; -//using TerrariaOverhaul; namespace CalamityMod.Items.Weapons { @@ -41,11 +40,6 @@ namespace CalamityMod.Items.Weapons item.useAmmo = 40; } - /*public void OverhaulInit() - { - this.SetTag("bow"); - }*/ - public override void ModifyTooltips(List list) { foreach (TooltipLine line2 in list) diff --git a/Items/Weapons/AstrumDeus/Nebulash.png b/Items/Weapons/AstrumDeus/Nebulash.png index be06352ad1..5d4ea22c2c 100644 Binary files a/Items/Weapons/AstrumDeus/Nebulash.png and b/Items/Weapons/AstrumDeus/Nebulash.png differ diff --git a/Items/Weapons/AuguroftheElements.cs b/Items/Weapons/AuguroftheElements.cs index f5826826e3..cf814460a7 100644 --- a/Items/Weapons/AuguroftheElements.cs +++ b/Items/Weapons/AuguroftheElements.cs @@ -37,18 +37,8 @@ namespace CalamityMod.Items.Weapons item.autoReuse = true; item.shoot = mod.ProjectileType("ElementTentacle"); item.shootSpeed = 30f; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 200); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 12; + } public override void AddRecipes() { diff --git a/Items/Weapons/Azathoth.cs b/Items/Weapons/Azathoth.cs index 1a9aa0237a..5afb6a5d12 100644 --- a/Items/Weapons/Azathoth.cs +++ b/Items/Weapons/Azathoth.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons public override void SetDefaults() { item.CloneDefaults(ItemID.Kraken); - item.damage = 240; + item.damage = 200; item.useTime = 20; item.useAnimation = 20; item.useStyle = 5; @@ -31,18 +31,8 @@ namespace CalamityMod.Items.Weapons item.rare = 10; item.autoReuse = true; item.shoot = mod.ProjectileType("AzathothProjectile"); - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(255, 0, 255); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 16; + } public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { diff --git a/Items/Weapons/BloodfireArrow.cs b/Items/Weapons/BloodfireArrow.cs index fd7f3972f1..b9b24637e4 100644 --- a/Items/Weapons/BloodfireArrow.cs +++ b/Items/Weapons/BloodfireArrow.cs @@ -29,18 +29,8 @@ namespace CalamityMod.Items.Weapons item.shoot = mod.ProjectileType("BloodfireArrow"); item.shootSpeed = 10f; item.ammo = 40; + item.GetGlobalItem(mod).postMoonLordRarity = 13; } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 0); - } - } - } public override void AddRecipes() { diff --git a/Items/Weapons/BloodyEdge.cs b/Items/Weapons/BloodyEdge.cs index 62bf7d674a..2947996b36 100644 --- a/Items/Weapons/BloodyEdge.cs +++ b/Items/Weapons/BloodyEdge.cs @@ -63,7 +63,7 @@ namespace CalamityMod.Items.Weapons public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { - if (target.type == NPCID.TargetDummy) + if (target.type == NPCID.TargetDummy || !target.canGhostHeal) { return; } diff --git a/Items/Weapons/BlossomFlux.cs b/Items/Weapons/BlossomFlux.cs index 97b1f6f03a..28f9b6f65e 100644 --- a/Items/Weapons/BlossomFlux.cs +++ b/Items/Weapons/BlossomFlux.cs @@ -6,7 +6,6 @@ using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Items; -//using TerrariaOverhaul; namespace CalamityMod.Items.Weapons { @@ -39,23 +38,8 @@ namespace CalamityMod.Items.Weapons item.shoot = mod.ProjectileType("LeafArrow"); item.shootSpeed = 10f; item.useAmmo = 40; - } - - /*public void OverhaulInit() - { - this.SetTag("bow"); - }*/ - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(Main.DiscoR, 203, 103); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 17; + } public override bool AltFunctionUse(Player player) { diff --git a/Items/Weapons/BlushieStaff.cs b/Items/Weapons/BlushieStaff.cs index 7ddbfceaf6..56fe5467aa 100644 --- a/Items/Weapons/BlushieStaff.cs +++ b/Items/Weapons/BlushieStaff.cs @@ -35,18 +35,8 @@ namespace CalamityMod.Items.Weapons item.shoot = mod.ProjectileType("BlushieStaffProj"); item.mana = 200; item.shootSpeed = 0f; + item.GetGlobalItem(mod).postMoonLordRarity = 19; } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 0, 255); - } - } - } public override void AddRecipes() { diff --git a/Items/Weapons/BrimroseStaff.cs b/Items/Weapons/BrimroseStaff.cs index 5f51b4b026..d71b3a0dab 100644 --- a/Items/Weapons/BrimroseStaff.cs +++ b/Items/Weapons/BrimroseStaff.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons public override void SetDefaults() { - item.damage = 27; + item.damage = 20; item.magic = true; item.mana = 14; item.width = 36; diff --git a/Items/Weapons/BrimstoneWaifu/SeethingDischarge.cs b/Items/Weapons/BrimstoneWaifu/SeethingDischarge.cs index 78a4a00902..7ad85b7b6d 100644 --- a/Items/Weapons/BrimstoneWaifu/SeethingDischarge.cs +++ b/Items/Weapons/BrimstoneWaifu/SeethingDischarge.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.BrimstoneWaifu public override void SetDefaults() { - item.damage = 62; + item.damage = 58; item.magic = true; item.mana = 15; item.width = 28; diff --git a/Items/Weapons/BrinyBaron.cs b/Items/Weapons/BrinyBaron.cs index c5ef1a2e09..626250d2ee 100644 --- a/Items/Weapons/BrinyBaron.cs +++ b/Items/Weapons/BrinyBaron.cs @@ -36,19 +36,9 @@ namespace CalamityMod.Items.Weapons item.rare = 8; item.shootSpeed = 4f; item.shoot = mod.ProjectileType("NobodyKnows"); + item.GetGlobalItem(mod).postMoonLordRarity = 17; } - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(53, Main.DiscoG, 255); - } - } - } - public override bool AltFunctionUse(Player player) { return true; diff --git a/Items/Weapons/Bumblebirb/GildedProboscis.cs b/Items/Weapons/Bumblebirb/GildedProboscis.cs index c3ef1f903f..ec4350b186 100644 --- a/Items/Weapons/Bumblebirb/GildedProboscis.cs +++ b/Items/Weapons/Bumblebirb/GildedProboscis.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Bumblebirb public override void SetDefaults() { item.width = 66; - item.damage = 320; + item.damage = 160; item.melee = true; item.noMelee = true; item.useTurn = true; @@ -32,22 +32,12 @@ namespace CalamityMod.Items.Weapons.Bumblebirb item.UseSound = SoundID.Item1; item.autoReuse = true; item.height = 66; - item.value = Item.buyPrice(1, 80, 0, 0); + item.value = Item.buyPrice(1, 20, 0, 0); item.rare = 10; item.shoot = mod.ProjectileType("GildedProboscis"); item.shootSpeed = 13f; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(43, 96, 222); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 12; + } public override bool CanUseItem(Player player) { diff --git a/Items/Weapons/Bumblebirb/GoldenEagle.cs b/Items/Weapons/Bumblebirb/GoldenEagle.cs index e581aae713..427a641af8 100644 --- a/Items/Weapons/Bumblebirb/GoldenEagle.cs +++ b/Items/Weapons/Bumblebirb/GoldenEagle.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Bumblebirb public override void SetDefaults() { - item.damage = 160; + item.damage = 40; item.ranged = true; item.noMelee = true; item.width = 46; @@ -28,25 +28,15 @@ namespace CalamityMod.Items.Weapons.Bumblebirb item.useAnimation = 7; item.useStyle = 5; item.knockBack = 3f; - item.value = Item.buyPrice(1, 80, 0, 0); + item.value = Item.buyPrice(1, 20, 0, 0); item.rare = 10; item.UseSound = SoundID.Item41; item.autoReuse = true; item.shoot = 10; item.shootSpeed = 20f; item.useAmmo = 97; + item.GetGlobalItem(mod).postMoonLordRarity = 12; } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(43, 96, 222); - } - } - } public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { diff --git a/Items/Weapons/Bumblebirb/RougeSlash.cs b/Items/Weapons/Bumblebirb/RougeSlash.cs index 3a9d42f538..11a0489813 100644 --- a/Items/Weapons/Bumblebirb/RougeSlash.cs +++ b/Items/Weapons/Bumblebirb/RougeSlash.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Bumblebirb public override void SetDefaults() { - item.damage = 370; + item.damage = 90; item.magic = true; item.mana = 30; item.width = 28; @@ -30,24 +30,14 @@ namespace CalamityMod.Items.Weapons.Bumblebirb item.noMelee = true; item.knockBack = 7.5f; item.UseSound = SoundID.Item91; - item.value = Item.buyPrice(1, 80, 0, 0); + item.value = Item.buyPrice(1, 20, 0, 0); item.rare = 10; item.autoReuse = true; item.shoot = mod.ProjectileType("RougeSlashLarge"); item.shootSpeed = 24f; + item.GetGlobalItem(mod).postMoonLordRarity = 12; } - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(43, 96, 222); - } - } - } - public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { Projectile.NewProjectile(position.X, position.Y, speedX, speedY, mod.ProjectileType("RougeSlashLarge"), damage, knockBack, player.whoAmI, 0.0f, 0.0f); diff --git a/Items/Weapons/BurntSienna.cs b/Items/Weapons/BurntSienna.cs index de73e53836..70d65f39af 100644 --- a/Items/Weapons/BurntSienna.cs +++ b/Items/Weapons/BurntSienna.cs @@ -49,8 +49,8 @@ namespace CalamityMod.Items.Weapons public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { float spread = 180f * 0.0174f; - double startAngle = Math.Atan2(item.shootSpeed, item.shootSpeed)- spread/2; - double deltaAngle = spread/8f; + double startAngle = Math.Atan2(item.shootSpeed, item.shootSpeed) - spread / 2; + double deltaAngle = spread / 8f; double offsetAngle; int i; if (target.life <= 0) diff --git a/Items/Weapons/Chaotrix.png b/Items/Weapons/Chaotrix.png index 5c28f0f4f5..d0616350be 100644 Binary files a/Items/Weapons/Chaotrix.png and b/Items/Weapons/Chaotrix.png differ diff --git a/Items/Weapons/ClaretCannon.cs b/Items/Weapons/ClaretCannon.cs index 5d7a002dd2..f1e91b6859 100644 --- a/Items/Weapons/ClaretCannon.cs +++ b/Items/Weapons/ClaretCannon.cs @@ -36,18 +36,8 @@ namespace CalamityMod.Items.Weapons item.shootSpeed = 24f; item.shoot = mod.ProjectileType("BloodfireBullet"); item.useAmmo = 97; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 0); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 13; + } public override Vector2? HoldoutOffset() { diff --git a/Items/Weapons/CleansingBlaze.cs b/Items/Weapons/CleansingBlaze.cs index 509872f10d..d45c601486 100644 --- a/Items/Weapons/CleansingBlaze.cs +++ b/Items/Weapons/CleansingBlaze.cs @@ -35,19 +35,9 @@ namespace CalamityMod.Items.Weapons item.shoot = mod.ProjectileType("EssenceFire"); item.shootSpeed = 14f; item.useAmmo = 23; + item.GetGlobalItem(mod).postMoonLordRarity = 14; } - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(43, 96, 222); - } - } - } - public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { int num6 = Main.rand.Next(2, 4); @@ -67,7 +57,7 @@ namespace CalamityMod.Items.Weapons public override bool ConsumeAmmo(Player player) { - if (Main.rand.Next(0, 100) <= 90) + if (Main.rand.Next(0, 100) < 90) return false; return true; } diff --git a/Items/Weapons/Climax.cs b/Items/Weapons/Climax.cs index f0b778524e..849ca8b4dd 100644 --- a/Items/Weapons/Climax.cs +++ b/Items/Weapons/Climax.cs @@ -36,18 +36,8 @@ namespace CalamityMod.Items.Weapons item.autoReuse = true; item.shoot = mod.ProjectileType("Climax"); item.shootSpeed = 12f; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(43, 96, 222); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 14; + } public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { diff --git a/Items/Weapons/ClockGatlignum.cs b/Items/Weapons/ClockGatlignum.cs index 70d38b9607..48dc8713bd 100644 --- a/Items/Weapons/ClockGatlignum.cs +++ b/Items/Weapons/ClockGatlignum.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Items.Weapons public override bool ConsumeAmmo(Player player) { - if (Main.rand.Next(0, 100) <= 33) + if (Main.rand.Next(0, 100) < 33) return false; return true; } diff --git a/Items/Weapons/ClockGatlignum.png b/Items/Weapons/ClockGatlignum.png index 98ad7faa68..b3ec232734 100644 Binary files a/Items/Weapons/ClockGatlignum.png and b/Items/Weapons/ClockGatlignum.png differ diff --git a/Items/Weapons/ClockworkBow.cs b/Items/Weapons/ClockworkBow.cs index a571243629..8a1f5c2856 100644 --- a/Items/Weapons/ClockworkBow.cs +++ b/Items/Weapons/ClockworkBow.cs @@ -6,7 +6,6 @@ using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Items; -//using TerrariaOverhaul; namespace CalamityMod.Items.Weapons { @@ -36,23 +35,8 @@ namespace CalamityMod.Items.Weapons item.shoot = 10; item.shootSpeed = 30f; item.useAmmo = 40; - } - - /*public void OverhaulInit() - { - this.SetTag("bow"); - }*/ - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 200); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 12; + } public override void AddRecipes() { diff --git a/Items/Weapons/ConferenceCall.cs b/Items/Weapons/ConferenceCall.cs index b63b373cca..bc1033bce6 100644 --- a/Items/Weapons/ConferenceCall.cs +++ b/Items/Weapons/ConferenceCall.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Items.Weapons public override bool ConsumeAmmo(Player player) { - if (Main.rand.Next(0, 100) <= 50) + if (Main.rand.Next(0, 100) < 50) return false; return true; } diff --git a/Items/Weapons/Contagion.cs b/Items/Weapons/Contagion.cs index 1474da8191..1c36173bb6 100644 --- a/Items/Weapons/Contagion.cs +++ b/Items/Weapons/Contagion.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons public override void SetDefaults() { - item.damage = 600; + item.damage = 4000; item.ranged = true; item.width = 22; item.height = 50; @@ -35,18 +35,8 @@ namespace CalamityMod.Items.Weapons item.shoot = mod.ProjectileType("Contagion"); item.shootSpeed = 20f; item.useAmmo = 40; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(255, 0, 255); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 16; + } public override void AddRecipes() { diff --git a/Items/Weapons/CosmicDischarge.cs b/Items/Weapons/CosmicDischarge.cs index 7bc6cb8b30..50ecaff71b 100644 --- a/Items/Weapons/CosmicDischarge.cs +++ b/Items/Weapons/CosmicDischarge.cs @@ -38,19 +38,9 @@ namespace CalamityMod.Items.Weapons item.rare = 10; item.shootSpeed = 24f; item.shoot = mod.ProjectileType("CosmicDischarge"); + item.GetGlobalItem(mod).postMoonLordRarity = 17; } - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(150, Main.DiscoG, 255); - } - } - } - public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { float ai3 = (Main.rand.NextFloat() - 0.75f) * 0.7853982f; //0.5 diff --git a/Items/Weapons/CosmicImmaterializer.cs b/Items/Weapons/CosmicImmaterializer.cs index 10afc879d7..13db14c623 100644 --- a/Items/Weapons/CosmicImmaterializer.cs +++ b/Items/Weapons/CosmicImmaterializer.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Weapons public override void SetDefaults() { item.mana = 100; - item.damage = 0; + item.damage = 3000; item.useStyle = 1; item.width = 74; item.height = 72; @@ -46,18 +46,8 @@ namespace CalamityMod.Items.Weapons item.shoot = mod.ProjectileType("CosmicEnergy"); item.shootSpeed = 10f; item.summon = true; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(108, 45, 199); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 15; + } public override bool CanUseItem(Player player) { @@ -74,7 +64,9 @@ namespace CalamityMod.Items.Weapons public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - player.itemTime = item.useTime; + CalamityPlayer modPlayer = player.GetModPlayer(mod); + bool hasSummonerSet = modPlayer.tarraSummon || modPlayer.bloodflareSummon || modPlayer.godSlayerSummon || modPlayer.silvaSummon; + player.itemTime = item.useTime; Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; @@ -98,7 +90,7 @@ namespace CalamityMod.Items.Weapons num79 = 0f; vector2.X = (float)Main.mouseX + Main.screenPosition.X; vector2.Y = (float)Main.mouseY + Main.screenPosition.Y; - Projectile.NewProjectile(vector2.X, vector2.Y, num78, num79, type, damage, knockBack, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(vector2.X, vector2.Y, num78, num79, type, (int)((double)damage * (hasSummonerSet ? 1.0 : 0.66)), knockBack, player.whoAmI, 0f, 0f); return false; } diff --git a/Items/Weapons/Cosmilamp.cs b/Items/Weapons/Cosmilamp.cs index 6725b22572..54dbe81f0c 100644 --- a/Items/Weapons/Cosmilamp.cs +++ b/Items/Weapons/Cosmilamp.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons public override void SetDefaults() { - item.damage = 200; //80 + item.damage = 180; item.mana = 10; item.width = 42; item.height = 60; @@ -42,18 +42,8 @@ namespace CalamityMod.Items.Weapons item.shoot = mod.ProjectileType("Cosmilamp"); item.shootSpeed = 10f; item.summon = true; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 0); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 13; + } public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { diff --git a/Items/Weapons/Crimsaber.cs b/Items/Weapons/Crimsaber.cs index 1bcdfd92ad..a1a83e53cc 100644 --- a/Items/Weapons/Crimsaber.cs +++ b/Items/Weapons/Crimsaber.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons public override void SetDefaults() { - item.damage = 45; + item.damage = 54; item.melee = true; item.width = 56; item.height = 70; @@ -75,7 +75,7 @@ namespace CalamityMod.Items.Weapons } num78 *= num80; num79 *= num80; - int num107 = 8; + int num107 = 4; for (int num108 = 0; num108 < num107; num108++) { vector2 = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(201) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f); diff --git a/Items/Weapons/Cryogen/Avalanche.cs b/Items/Weapons/Cryogen/Avalanche.cs index fd86bc6406..af0d60cb9d 100644 --- a/Items/Weapons/Cryogen/Avalanche.cs +++ b/Items/Weapons/Cryogen/Avalanche.cs @@ -1,105 +1,105 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Weapons.Cryogen -{ - public class Avalanche : ModItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Avalanche"); - Tooltip.SetDefault("Spawns ice bombs that explode after 2 seconds into ice shards on enemy hits"); - } - - public override void SetDefaults() - { - item.width = 64; - item.damage = 60; - item.melee = true; - item.useAnimation = 30; - item.useTime = 30; - item.useTurn = true; - item.useStyle = 1; - item.knockBack = 7.25f; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - item.height = 64; - item.value = Item.buyPrice(0, 36, 0, 0); - item.rare = 5; - } - - public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) - { - int i = Main.myPlayer; - float num72 = 6f; - float num74 = 5f; - player.itemTime = item.useTime; - Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); - float num78 = (float)Main.mouseX + Main.screenPosition.X + vector2.X; - float num79 = (float)Main.mouseY + Main.screenPosition.Y + vector2.Y; - if (player.gravDir == -1f) - { - num79 = Main.screenPosition.Y + (float)Main.screenHeight + (float)Main.mouseY + vector2.Y; - } - float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); - float num81 = num80; - if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) - { - num78 = (float)player.direction; - num79 = 0f; - num80 = num72; - } - else - { - num80 = num72 / num80; - } - num78 *= num80; - num79 *= num80; - int num107 = 2; - for (int num108 = 0; num108 < num107; num108++) - { - vector2 = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(201) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y); - vector2.X = (vector2.X + player.Center.X) / 2f + (float)Main.rand.Next(-200, 201); - vector2.Y -= (float)(100 * num108); - num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; - num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; - if (num79 < 0f) - { - num79 *= -1f; - } - if (num79 < 20f) - { - num79 = 20f; - } - num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); - num80 = num72 / num80; - num78 *= num80; - num79 *= num80; - Projectile.NewProjectile(vector2.X, vector2.Y, 0f, 0f, mod.ProjectileType("IceBombFriendly"), (int)((float)item.damage * player.meleeDamage), num74, i, 0f, (float)Main.rand.Next(3)); - } - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "CryoBar", 12); - recipe.AddTile(TileID.IceMachine); - recipe.SetResult(this); - recipe.AddRecipe(); - } - - public override void MeleeEffects(Player player, Rectangle hitbox) - { - if (Main.rand.Next(3) == 0) - { - int num250 = Dust.NewDust(new Vector2((float)hitbox.X, (float)hitbox.Y), hitbox.Width, hitbox.Height, 67, (float)(player.direction * 2), 0f, 150, default(Color), 1.5f); - Main.dust[num250].velocity *= 0.2f; - } - } - } -} +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Cryogen +{ + public class Avalanche : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Avalanche"); + Tooltip.SetDefault("Spawns ice bombs that explode after 2 seconds into ice shards on enemy hits"); + } + + public override void SetDefaults() + { + item.width = 64; + item.damage = 60; + item.melee = true; + item.useAnimation = 30; + item.useTime = 30; + item.useTurn = true; + item.useStyle = 1; + item.knockBack = 7.25f; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.height = 64; + item.value = Item.buyPrice(0, 36, 0, 0); + item.rare = 5; + } + + public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) + { + int i = Main.myPlayer; + float num72 = 6f; + float num74 = 5f; + player.itemTime = item.useTime; + Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); + float num78 = (float)Main.mouseX + Main.screenPosition.X + vector2.X; + float num79 = (float)Main.mouseY + Main.screenPosition.Y + vector2.Y; + if (player.gravDir == -1f) + { + num79 = Main.screenPosition.Y + (float)Main.screenHeight + (float)Main.mouseY + vector2.Y; + } + float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); + float num81 = num80; + if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) + { + num78 = (float)player.direction; + num79 = 0f; + num80 = num72; + } + else + { + num80 = num72 / num80; + } + num78 *= num80; + num79 *= num80; + int num107 = 2; + for (int num108 = 0; num108 < num107; num108++) + { + vector2 = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(201) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y); + vector2.X = (vector2.X + player.Center.X) / 2f + (float)Main.rand.Next(-200, 201); + vector2.Y -= (float)(100 * num108); + num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; + num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; + if (num79 < 0f) + { + num79 *= -1f; + } + if (num79 < 20f) + { + num79 = 20f; + } + num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); + num80 = num72 / num80; + num78 *= num80; + num79 *= num80; + Projectile.NewProjectile(vector2.X, vector2.Y, 0f, 0f, mod.ProjectileType("IceBombFriendly"), (int)((float)item.damage * player.meleeDamage), num74, i, 0f, (float)Main.rand.Next(3)); + } + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "CryoBar", 12); + recipe.AddTile(TileID.IceMachine); + recipe.SetResult(this); + recipe.AddRecipe(); + } + + public override void MeleeEffects(Player player, Rectangle hitbox) + { + if (Main.rand.Next(3) == 0) + { + int num250 = Dust.NewDust(new Vector2((float)hitbox.X, (float)hitbox.Y), hitbox.Width, hitbox.Height, 67, (float)(player.direction * 2), 0f, 150, default(Color), 1.5f); + Main.dust[num250].velocity *= 0.2f; + } + } + } +} diff --git a/Items/Weapons/CursedCapper.png b/Items/Weapons/CursedCapper.png index e957e82c70..7b0eef9535 100644 Binary files a/Items/Weapons/CursedCapper.png and b/Items/Weapons/CursedCapper.png differ diff --git a/Items/Weapons/Devastation.cs b/Items/Weapons/Devastation.cs index 6ec117ea25..1c6ac9b180 100644 --- a/Items/Weapons/Devastation.cs +++ b/Items/Weapons/Devastation.cs @@ -33,19 +33,9 @@ namespace CalamityMod.Items.Weapons item.rare = 10; item.shoot = mod.ProjectileType("GalaxyBlast"); item.shootSpeed = 16f; + item.GetGlobalItem(mod).postMoonLordRarity = 12; } - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 200); - } - } - } - public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { switch (Main.rand.Next(6)) diff --git a/Items/Weapons/DevilsDevastation.cs b/Items/Weapons/DevilsDevastation.cs index 71398d152a..6eda6cca5e 100644 --- a/Items/Weapons/DevilsDevastation.cs +++ b/Items/Weapons/DevilsDevastation.cs @@ -33,19 +33,9 @@ namespace CalamityMod.Items.Weapons item.rare = 10; item.shoot = mod.ProjectileType("Oathblade"); item.shootSpeed = 28f; + item.GetGlobalItem(mod).postMoonLordRarity = 14; } - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(43, 96, 222); - } - } - } - public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { int numProj = 2; diff --git a/Items/Weapons/DevourerofGods/DeathhailStaff.cs b/Items/Weapons/DevourerofGods/DeathhailStaff.cs index 3235969d8a..8791ddbbed 100644 --- a/Items/Weapons/DevourerofGods/DeathhailStaff.cs +++ b/Items/Weapons/DevourerofGods/DeathhailStaff.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.DataStructures; using Terraria.ID; @@ -23,8 +24,8 @@ namespace CalamityMod.Items.Weapons.DevourerofGods item.damage = 180; item.magic = true; item.mana = 12; - item.width = 62; - item.height = 62; + item.width = 80; + item.height = 84; item.useTime = 6; item.useAnimation = 12; item.useStyle = 5; @@ -36,20 +37,16 @@ namespace CalamityMod.Items.Weapons.DevourerofGods item.autoReuse = true; item.shoot = mod.ProjectileType("MagicNebulaShot"); item.shootSpeed = 18f; - } + item.GetGlobalItem(mod).postMoonLordRarity = 13; + } - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 0); - } - } - } + public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) + { + Vector2 origin = new Vector2(40f, 42f); + spriteBatch.Draw(mod.GetTexture("Items/Weapons/DevourerofGods/DeathhailStaffGlow"), item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f); + } - public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { int i = Main.myPlayer; float num72 = item.shootSpeed; @@ -103,7 +100,6 @@ namespace CalamityMod.Items.Weapons.DevourerofGods float speedX4 = num78 + (float)Main.rand.Next(-50, 51) * 0.02f; float speedY5 = num79 + (float)Main.rand.Next(-50, 51) * 0.02f; Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5, type, num73, num74, i, 0f, (float)Main.rand.Next(10)); - Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5, mod.ProjectileType("MagicIceBeam"), num73, num74, i, 0f, (float)Main.rand.Next(5)); } return false; } diff --git a/Items/Weapons/DevourerofGods/DeathhailStaff.png b/Items/Weapons/DevourerofGods/DeathhailStaff.png index 38a03e9ed2..9fab0e65f2 100644 Binary files a/Items/Weapons/DevourerofGods/DeathhailStaff.png and b/Items/Weapons/DevourerofGods/DeathhailStaff.png differ diff --git a/Items/Weapons/DevourerofGods/DeathhailStaffGlow.png b/Items/Weapons/DevourerofGods/DeathhailStaffGlow.png new file mode 100644 index 0000000000..a754dd2383 Binary files /dev/null and b/Items/Weapons/DevourerofGods/DeathhailStaffGlow.png differ diff --git a/Items/Weapons/DevourerofGods/Deathwind.cs b/Items/Weapons/DevourerofGods/Deathwind.cs index 60d3c11bb9..b289114ab0 100644 --- a/Items/Weapons/DevourerofGods/Deathwind.cs +++ b/Items/Weapons/DevourerofGods/Deathwind.cs @@ -1,12 +1,12 @@ using System; using System.Collections.Generic; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Items; -//using TerrariaOverhaul; namespace CalamityMod.Items.Weapons.DevourerofGods { @@ -21,8 +21,8 @@ namespace CalamityMod.Items.Weapons.DevourerofGods { item.damage = 265; item.ranged = true; - item.width = 38; - item.height = 66; + item.width = 40; + item.height = 82; item.useTime = 14; item.useAnimation = 14; item.useStyle = 5; @@ -35,25 +35,16 @@ namespace CalamityMod.Items.Weapons.DevourerofGods item.shoot = mod.ProjectileType("NebulaShot"); item.shootSpeed = 20f; item.useAmmo = 40; - } + item.GetGlobalItem(mod).postMoonLordRarity = 13; + } - /*public void OverhaulInit() - { - this.SetTag("bow"); - }*/ + public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) + { + Vector2 origin = new Vector2(20f, 41f); + spriteBatch.Draw(mod.GetTexture("Items/Weapons/DevourerofGods/DeathwindGlow"), item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f); + } - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 0); - } - } - } - - public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { float SpeedA = speedX; float SpeedB = speedY; @@ -66,18 +57,11 @@ namespace CalamityMod.Items.Weapons.DevourerofGods float SpeedY = speedY + (float)Main.rand.Next(-20, 21) * 0.05f; if (type == ProjectileID.WoodenArrowFriendly) { - if (Main.rand.Next(3) == 0) - { - Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, mod.ProjectileType("IceBeam"), damage, knockBack, player.whoAmI, 0.0f, 0.0f); - } - else - { - Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, mod.ProjectileType("NebulaShot"), damage, knockBack, player.whoAmI, 0.0f, 0.0f); - } + Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, mod.ProjectileType("NebulaShot"), damage, knockBack, player.whoAmI, 0f, 0f); } else { - int num121 = Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI, 0.0f, 0.0f); + int num121 = Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI, 0f, 0f); Main.projectile[num121].noDropItem = true; } } diff --git a/Items/Weapons/DevourerofGods/Deathwind.png b/Items/Weapons/DevourerofGods/Deathwind.png index 9f440ea148..875f2d2b71 100644 Binary files a/Items/Weapons/DevourerofGods/Deathwind.png and b/Items/Weapons/DevourerofGods/Deathwind.png differ diff --git a/Items/Weapons/DevourerofGods/DeathwindGlow.png b/Items/Weapons/DevourerofGods/DeathwindGlow.png new file mode 100644 index 0000000000..5942e05838 Binary files /dev/null and b/Items/Weapons/DevourerofGods/DeathwindGlow.png differ diff --git a/Items/Weapons/DevourerofGods/EradicatorMelee.cs b/Items/Weapons/DevourerofGods/EradicatorMelee.cs index 9ca9b436d3..cb549f0796 100644 --- a/Items/Weapons/DevourerofGods/EradicatorMelee.cs +++ b/Items/Weapons/DevourerofGods/EradicatorMelee.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.DataStructures; using Terraria.ID; @@ -34,17 +35,13 @@ namespace CalamityMod.Items.Weapons.DevourerofGods item.rare = 10; item.shoot = mod.ProjectileType("EradicatorMeleeProjectile"); item.shootSpeed = 12f; - } + item.GetGlobalItem(mod).postMoonLordRarity = 13; + } - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 0); - } - } - } - } + public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) + { + Vector2 origin = new Vector2(31f, 29f); + spriteBatch.Draw(mod.GetTexture("Items/Weapons/DevourerofGods/EradicatorMeleeGlow"), item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f); + } + } } diff --git a/Items/Weapons/DevourerofGods/EradicatorMelee.png b/Items/Weapons/DevourerofGods/EradicatorMelee.png index e12958fc93..e028ca0e83 100644 Binary files a/Items/Weapons/DevourerofGods/EradicatorMelee.png and b/Items/Weapons/DevourerofGods/EradicatorMelee.png differ diff --git a/Items/Weapons/DevourerofGods/EradicatorMeleeGlow.png b/Items/Weapons/DevourerofGods/EradicatorMeleeGlow.png new file mode 100644 index 0000000000..152b9ce5ae Binary files /dev/null and b/Items/Weapons/DevourerofGods/EradicatorMeleeGlow.png differ diff --git a/Items/Weapons/DevourerofGods/Excelsus.cs b/Items/Weapons/DevourerofGods/Excelsus.cs index 3ddf89c625..12639229af 100644 --- a/Items/Weapons/DevourerofGods/Excelsus.cs +++ b/Items/Weapons/DevourerofGods/Excelsus.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.DataStructures; using Terraria.ID; @@ -14,12 +15,12 @@ namespace CalamityMod.Items.Weapons.DevourerofGods public override void SetStaticDefaults() { DisplayName.SetDefault("Excelsus"); - Tooltip.SetDefault("Fires influx beams and summons laser fountains on enemy hits"); + Tooltip.SetDefault("Summons laser fountains on enemy hits"); } public override void SetDefaults() { - item.width = 70; + item.width = 78; item.damage = 235; item.melee = true; item.useAnimation = 15; @@ -29,37 +30,44 @@ namespace CalamityMod.Items.Weapons.DevourerofGods item.knockBack = 8f; item.UseSound = SoundID.Item1; item.autoReuse = true; - item.height = 82; + item.height = 94; item.value = Item.buyPrice(1, 40, 0, 0); item.rare = 10; - item.shoot = 451; - item.shootSpeed = 18f; - } + item.shoot = mod.ProjectileType("Excelsus"); + item.shootSpeed = 12f; + item.GetGlobalItem(mod).postMoonLordRarity = 13; + } - public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) + { + Vector2 origin = new Vector2(39f, 47f); + spriteBatch.Draw(mod.GetTexture("Items/Weapons/DevourerofGods/ExcelsusGlow"), item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f); + } + + public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - int num6 = Main.rand.Next(5, 9); - for (int index = 0; index < num6; ++index) + for (int index = 0; index < 3; ++index) { float SpeedX = speedX + (float)Main.rand.Next(-30, 31) * 0.05f; float SpeedY = speedY + (float)Main.rand.Next(-30, 31) * 0.05f; + switch (index) + { + case 0: + type = mod.ProjectileType("Excelsus"); + break; + case 1: + type = mod.ProjectileType("ExcelsusBlue"); + break; + case 2: + type = mod.ProjectileType("ExcelsusPink"); + break; + } Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI, 0.0f, 0.0f); } return false; } - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 0); - } - } - } - - public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) + public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { Projectile.NewProjectile(target.Center.X, target.Center.Y, 0f, 0f, mod.ProjectileType("LaserFountain"), 0, 0, Main.myPlayer); } diff --git a/Items/Weapons/DevourerofGods/Excelsus.png b/Items/Weapons/DevourerofGods/Excelsus.png index 5f43b4abc6..077d762192 100644 Binary files a/Items/Weapons/DevourerofGods/Excelsus.png and b/Items/Weapons/DevourerofGods/Excelsus.png differ diff --git a/Items/Weapons/DevourerofGods/ExcelsusGlow.png b/Items/Weapons/DevourerofGods/ExcelsusGlow.png new file mode 100644 index 0000000000..6525db49f3 Binary files /dev/null and b/Items/Weapons/DevourerofGods/ExcelsusGlow.png differ diff --git a/Items/Weapons/DevourerofGods/StaffoftheMechworm.cs b/Items/Weapons/DevourerofGods/StaffoftheMechworm.cs index 8407244346..7dcb86e300 100644 --- a/Items/Weapons/DevourerofGods/StaffoftheMechworm.cs +++ b/Items/Weapons/DevourerofGods/StaffoftheMechworm.cs @@ -43,18 +43,8 @@ namespace CalamityMod.Items.Weapons.DevourerofGods item.shoot = mod.ProjectileType("MechwormHead"); item.shootSpeed = 10f; item.summon = true; + item.GetGlobalItem(mod).postMoonLordRarity = 13; } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 0); - } - } - } public override bool CanUseItem(Player player) { diff --git a/Items/Weapons/DevourerofGods/StaffoftheMechworm.png b/Items/Weapons/DevourerofGods/StaffoftheMechworm.png index 553ccdf76a..ffcc7066c0 100644 Binary files a/Items/Weapons/DevourerofGods/StaffoftheMechworm.png and b/Items/Weapons/DevourerofGods/StaffoftheMechworm.png differ diff --git a/Items/Weapons/DevourerofGods/TheObliterator.cs b/Items/Weapons/DevourerofGods/TheObliterator.cs index 5a71235c9a..3787e9a78f 100644 --- a/Items/Weapons/DevourerofGods/TheObliterator.cs +++ b/Items/Weapons/DevourerofGods/TheObliterator.cs @@ -31,18 +31,8 @@ namespace CalamityMod.Items.Weapons.DevourerofGods item.rare = 10; item.autoReuse = true; item.shoot = mod.ProjectileType("TheObliterator"); - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 0); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 13; + } public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { diff --git a/Items/Weapons/DevourerofGods/TheObliterator.png b/Items/Weapons/DevourerofGods/TheObliterator.png index 25f0d6d3a4..655753210f 100644 Binary files a/Items/Weapons/DevourerofGods/TheObliterator.png and b/Items/Weapons/DevourerofGods/TheObliterator.png differ diff --git a/Items/Weapons/DraconicDestruction.cs b/Items/Weapons/DraconicDestruction.cs index 64e9292999..0c97a1ea8f 100644 --- a/Items/Weapons/DraconicDestruction.cs +++ b/Items/Weapons/DraconicDestruction.cs @@ -33,19 +33,9 @@ namespace CalamityMod.Items.Weapons item.rare = 10; item.shoot = mod.ProjectileType("DracoBeam"); item.shootSpeed = 14f; + item.GetGlobalItem(mod).postMoonLordRarity = 16; } - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(255, 0, 255); - } - } - } - public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); diff --git a/Items/Weapons/DraedonsExoblade.cs b/Items/Weapons/DraedonsExoblade.cs index 20dc31c942..f240cbda34 100644 --- a/Items/Weapons/DraedonsExoblade.cs +++ b/Items/Weapons/DraedonsExoblade.cs @@ -24,13 +24,13 @@ namespace CalamityMod.Items.Weapons public override void SetDefaults() { item.width = 80; - item.damage = 3500; + item.damage = 6700; item.useAnimation = 14; item.useStyle = 1; item.useTime = 14; item.useTurn = true; item.melee = true; - item.knockBack = 6f; + item.knockBack = 9f; item.UseSound = SoundID.Item1; item.autoReuse = true; item.height = 114; @@ -38,18 +38,8 @@ namespace CalamityMod.Items.Weapons item.rare = 10; item.shoot = mod.ProjectileType("Exobeam"); item.shootSpeed = 19f; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(108, 45, 199); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 15; + } public override void GetWeaponDamage(Player player, ref int damage) { @@ -118,7 +108,7 @@ namespace CalamityMod.Items.Weapons Projectile.NewProjectile(vector2.X, vector2.Y, speedX, speedY, mod.ProjectileType("Exocomet"), (int)((float)item.damage * player.meleeDamage), knockback, player.whoAmI, 0.0f, ai1); } } - if (target.type == NPCID.TargetDummy) + if (target.type == NPCID.TargetDummy || !target.canGhostHeal) { return; } diff --git a/Items/Weapons/Drataliornus.cs b/Items/Weapons/Drataliornus.cs index c6b5ed2c9c..460cb377bd 100644 --- a/Items/Weapons/Drataliornus.cs +++ b/Items/Weapons/Drataliornus.cs @@ -41,19 +41,9 @@ Right click to fire two devastating barrages of five empowered fireballs. item.useTurn = false; item.useAmmo = AmmoID.Arrow; item.autoReuse = true; + item.GetGlobalItem(mod).postMoonLordRarity = 16; } - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(255, 0, 255); - } - } - } - public override bool AltFunctionUse(Player player) { return true; diff --git a/Items/Weapons/Earth.cs b/Items/Weapons/Earth.cs index 26f8282438..905156011b 100644 --- a/Items/Weapons/Earth.cs +++ b/Items/Weapons/Earth.cs @@ -37,35 +37,14 @@ namespace CalamityMod.Items.Weapons item.height = 104; item.value = Item.buyPrice(5, 0, 0, 0); item.rare = 10; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(255, 0, 255); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 16; + } public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { - if (target.type == NPCID.TargetDummy) - { - return; - } - if (Main.rand.Next(3) == 0) - { - target.defense -= 50; - } - int heal = Main.rand.Next(1, 69); - player.statLife += heal; - player.HealEffect(heal); float num72 = 25f; - Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); - float num78 = (float)Main.mouseX - Main.screenPosition.X - vector2.X; + Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); + float num78 = (float)Main.mouseX - Main.screenPosition.X - vector2.X; float num79 = (float)Main.mouseY - Main.screenPosition.Y - vector2.Y; if (player.gravDir == -1f) { @@ -83,7 +62,7 @@ namespace CalamityMod.Items.Weapons { num80 = num72 / num80; } - num78 *= num80; + num78 *= num80; num79 *= num80; int num107 = 3; for (int num108 = 0; num108 < num107; num108++) @@ -109,6 +88,17 @@ namespace CalamityMod.Items.Weapons float speedY5 = num79 + (float)Main.rand.Next(-180, 181) * 0.02f; Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5, mod.ProjectileType("Earth"), (int)((float)item.damage * player.meleeDamage), knockback, player.whoAmI, 0f, (float)Main.rand.Next(10)); } + if (target.type == NPCID.TargetDummy || !target.canGhostHeal) + { + return; + } + if (Main.rand.Next(2) == 0) + { + target.defense -= 50; + } + int heal = Main.rand.Next(1, 69); + player.statLife += heal; + player.HealEffect(heal); } public override void AddRecipes() diff --git a/Items/Weapons/Effervescence.cs b/Items/Weapons/Effervescence.cs index cb4feacab2..677ba2d911 100644 --- a/Items/Weapons/Effervescence.cs +++ b/Items/Weapons/Effervescence.cs @@ -14,38 +14,28 @@ namespace CalamityMod.Items.Weapons public override void SetStaticDefaults() { DisplayName.SetDefault("Effervescence"); - } - - public override void SetDefaults() - { - item.damage = 24; - item.magic = true; - item.mana = 17; - item.width = 56; - item.height = 26; - item.useTime = 12; - item.useAnimation = 12; - item.useStyle = 5; - item.noMelee = true; - item.knockBack = 3.75f; - item.value = Item.buyPrice(1, 20, 0, 0); - item.rare = 10; - item.UseSound = SoundID.Item95; - item.autoReuse = true; - item.shootSpeed = 13f; - item.shoot = mod.ProjectileType("UberBubble"); - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 200); - } - } - } + } + + public override void SetDefaults() + { + item.damage = 24; + item.magic = true; + item.mana = 17; + item.width = 56; + item.height = 26; + item.useTime = 12; + item.useAnimation = 12; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 3.75f; + item.value = Item.buyPrice(1, 20, 0, 0); + item.rare = 10; + item.UseSound = SoundID.Item95; + item.autoReuse = true; + item.shootSpeed = 13f; + item.shoot = mod.ProjectileType("UberBubble"); + item.GetGlobalItem(mod).postMoonLordRarity = 12; + } public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { diff --git a/Items/Weapons/ElementalAxe.cs b/Items/Weapons/ElementalAxe.cs index 3227679ca6..bcfb5266f2 100644 --- a/Items/Weapons/ElementalAxe.cs +++ b/Items/Weapons/ElementalAxe.cs @@ -43,18 +43,8 @@ namespace CalamityMod.Items.Weapons item.autoReuse = true; item.shoot = mod.ProjectileType("ElementalAxe"); item.shootSpeed = 10f; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 200); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 12; + } public override void AddRecipes() { diff --git a/Items/Weapons/ElementalBlaster.cs b/Items/Weapons/ElementalBlaster.cs index ad9b3968b0..3cc0b56467 100644 --- a/Items/Weapons/ElementalBlaster.cs +++ b/Items/Weapons/ElementalBlaster.cs @@ -34,23 +34,13 @@ namespace CalamityMod.Items.Weapons item.autoReuse = true; item.shoot = mod.ProjectileType("RainbowBlast"); item.shootSpeed = 18f; + item.GetGlobalItem(mod).postMoonLordRarity = 12; } public override Vector2? HoldoutOffset() { return new Vector2(-15, 0); } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 200); - } - } - } public override void AddRecipes() { diff --git a/Items/Weapons/ElementalEruption.cs b/Items/Weapons/ElementalEruption.cs index 8f218896a8..df9af9190a 100644 --- a/Items/Weapons/ElementalEruption.cs +++ b/Items/Weapons/ElementalEruption.cs @@ -35,19 +35,9 @@ namespace CalamityMod.Items.Weapons item.shoot = mod.ProjectileType("TerraFireGreen2"); item.shootSpeed = 10f; item.useAmmo = 23; + item.GetGlobalItem(mod).postMoonLordRarity = 12; } - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 200); - } - } - } - public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { int num6 = Main.rand.Next(3, 6); @@ -69,7 +59,7 @@ namespace CalamityMod.Items.Weapons public override bool ConsumeAmmo(Player player) { - if (Main.rand.Next(0, 100) <= 90) + if (Main.rand.Next(0, 100) < 90) return false; return true; } diff --git a/Items/Weapons/ElementalRay.cs b/Items/Weapons/ElementalRay.cs index a2d4f4c9a2..54f464947b 100644 --- a/Items/Weapons/ElementalRay.cs +++ b/Items/Weapons/ElementalRay.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons public override void SetDefaults() { - item.damage = 178; + item.damage = 150; item.magic = true; item.mana = 18; item.width = 62; @@ -35,18 +35,8 @@ namespace CalamityMod.Items.Weapons item.autoReuse = true; item.shoot = mod.ProjectileType("ElementRay"); item.shootSpeed = 6f; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 200); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 12; + } public override void AddRecipes() { diff --git a/Items/Weapons/ElementalShortsword.cs b/Items/Weapons/ElementalShortsword.cs index 843835dbdc..f1c14e5ead 100644 --- a/Items/Weapons/ElementalShortsword.cs +++ b/Items/Weapons/ElementalShortsword.cs @@ -34,18 +34,8 @@ namespace CalamityMod.Items.Weapons item.shootSpeed = 14f; item.value = Item.buyPrice(1, 20, 0, 0); item.rare = 10; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 200); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 12; + } public override void AddRecipes() { diff --git a/Items/Weapons/ElysianArrow.cs b/Items/Weapons/ElysianArrow.cs index eddf644f8f..2bcaa662b8 100644 --- a/Items/Weapons/ElysianArrow.cs +++ b/Items/Weapons/ElysianArrow.cs @@ -29,18 +29,8 @@ namespace CalamityMod.Items.Weapons item.shoot = mod.ProjectileType("ElysianArrow"); item.shootSpeed = 10f; item.ammo = 40; + item.GetGlobalItem(mod).postMoonLordRarity = 12; } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 200); - } - } - } public override void AddRecipes() { diff --git a/Items/Weapons/EmpyreanKnives.cs b/Items/Weapons/EmpyreanKnives.cs index 608a708e79..9beefb6ccb 100644 --- a/Items/Weapons/EmpyreanKnives.cs +++ b/Items/Weapons/EmpyreanKnives.cs @@ -34,18 +34,8 @@ namespace CalamityMod.Items.Weapons item.rare = 10; item.shoot = mod.ProjectileType("EmpyreanKnives"); item.shootSpeed = 15f; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(43, 96, 222); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 14; + } public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { diff --git a/Items/Weapons/EnergyStaff.cs b/Items/Weapons/EnergyStaff.cs index 99d2c0525f..c7e750f29e 100644 --- a/Items/Weapons/EnergyStaff.cs +++ b/Items/Weapons/EnergyStaff.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons public override void SetDefaults() { - item.damage = 231; + item.damage = 170; item.summon = true; item.sentry = true; item.mana = 25; @@ -34,18 +34,8 @@ namespace CalamityMod.Items.Weapons item.rare = 10; item.autoReuse = true; item.shoot = mod.ProjectileType("ProfanedEnergy"); - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 200); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 12; + } public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { diff --git a/Items/Weapons/EssenceFlayer.cs b/Items/Weapons/EssenceFlayer.cs index 0a69bc88a7..40da27d236 100644 --- a/Items/Weapons/EssenceFlayer.cs +++ b/Items/Weapons/EssenceFlayer.cs @@ -34,18 +34,8 @@ namespace CalamityMod.Items.Weapons item.rare = 10; item.shoot = mod.ProjectileType("EssenceScythe"); item.shootSpeed = 21f; + item.GetGlobalItem(mod).postMoonLordRarity = 14; } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(43, 96, 222); - } - } - } public override void AddRecipes() { diff --git a/Items/Weapons/ExcaliburShortsword.png b/Items/Weapons/ExcaliburShortsword.png index f7050a8f03..810e46bd8d 100644 Binary files a/Items/Weapons/ExcaliburShortsword.png and b/Items/Weapons/ExcaliburShortsword.png differ diff --git a/Items/Weapons/ExsanguinationLance.png b/Items/Weapons/ExsanguinationLance.png index 22a3c525d9..83a5bebc14 100644 Binary files a/Items/Weapons/ExsanguinationLance.png and b/Items/Weapons/ExsanguinationLance.png differ diff --git a/Items/Weapons/Fabstaff.cs b/Items/Weapons/Fabstaff.cs index e0d2935836..c0036a1787 100644 --- a/Items/Weapons/Fabstaff.cs +++ b/Items/Weapons/Fabstaff.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons public override void SetDefaults() { - item.damage = 700; + item.damage = 800; item.magic = true; item.mana = 50; item.width = 84; @@ -35,18 +35,8 @@ namespace CalamityMod.Items.Weapons item.autoReuse = true; item.shoot = mod.ProjectileType("FabRay"); item.shootSpeed = 6f; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(Main.DiscoR, 100, 255); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 18; + } public override void AddRecipes() { diff --git a/Items/Weapons/FiniteUse/Bazooka.cs b/Items/Weapons/FiniteUse/Bazooka.cs index 427cd486d2..dc482a143b 100644 --- a/Items/Weapons/FiniteUse/Bazooka.cs +++ b/Items/Weapons/FiniteUse/Bazooka.cs @@ -1,65 +1,65 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items; - -namespace CalamityMod.Items.Weapons.FiniteUse -{ - public class Bazooka : ModItem - { +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.Weapons.FiniteUse +{ + public class Bazooka : ModItem + { public override void SetStaticDefaults() { DisplayName.SetDefault("Bazooka"); - Tooltip.SetDefault("Uses Grenade Shells\n" + + Tooltip.SetDefault("Uses Grenade Shells\n" + "Does more damage to inorganic enemies"); } - public override void SetDefaults() - { - item.damage = 500; - item.width = 66; - item.height = 26; - item.useTime = 30; - item.useAnimation = 30; - item.useStyle = 5; - item.noMelee = true; - item.knockBack = 10f; - item.value = Item.buyPrice(0, 36, 0, 0); - item.rare = 5; - item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/BazookaFull"); - item.autoReuse = true; - item.shootSpeed = 12f; - item.shoot = mod.ProjectileType("GrenadeRound"); - item.useAmmo = mod.ItemType("GrenadeRounds"); - } - - public override Vector2? HoldoutOffset() - { - return new Vector2(-10, 0); - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.IronBar, 20); - recipe.anyIronBar = true; - recipe.AddIngredient(ItemID.IllegalGunParts); - recipe.AddIngredient(ItemID.AdamantiteBar, 15); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(this); - recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.IronBar, 20); - recipe.anyIronBar = true; - recipe.AddIngredient(ItemID.IllegalGunParts); - recipe.AddIngredient(ItemID.TitaniumBar, 15); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(this); - recipe.AddRecipe(); - } - } + public override void SetDefaults() + { + item.damage = 500; + item.width = 66; + item.height = 26; + item.useTime = 30; + item.useAnimation = 30; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 10f; + item.value = Item.buyPrice(0, 36, 0, 0); + item.rare = 5; + item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/BazookaFull"); + item.autoReuse = true; + item.shootSpeed = 12f; + item.shoot = mod.ProjectileType("GrenadeRound"); + item.useAmmo = mod.ItemType("GrenadeRounds"); + } + + public override Vector2? HoldoutOffset() + { + return new Vector2(-10, 0); + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.IronBar, 20); + recipe.anyIronBar = true; + recipe.AddIngredient(ItemID.IllegalGunParts); + recipe.AddIngredient(ItemID.AdamantiteBar, 15); + recipe.AddTile(TileID.MythrilAnvil); + recipe.SetResult(this); + recipe.AddRecipe(); + recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.IronBar, 20); + recipe.anyIronBar = true; + recipe.AddIngredient(ItemID.IllegalGunParts); + recipe.AddIngredient(ItemID.TitaniumBar, 15); + recipe.AddTile(TileID.MythrilAnvil); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } } \ No newline at end of file diff --git a/Items/Weapons/FiniteUse/ElephantKiller.cs b/Items/Weapons/FiniteUse/ElephantKiller.cs index 1d625ae080..fb12e59566 100644 --- a/Items/Weapons/FiniteUse/ElephantKiller.cs +++ b/Items/Weapons/FiniteUse/ElephantKiller.cs @@ -1,68 +1,58 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items; - -namespace CalamityMod.Items.Weapons.FiniteUse -{ - public class ElephantKiller : ModItem - { +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.Weapons.FiniteUse +{ + public class ElephantKiller : ModItem + { public override void SetStaticDefaults() { DisplayName.SetDefault("Elephant Killer"); - Tooltip.SetDefault("Uses Magnum Rounds\n" + + Tooltip.SetDefault("Uses Magnum Rounds\n" + "Does more damage to organic enemies"); } - public override void SetDefaults() - { - item.damage = 2000; - item.crit += 66; - item.width = 46; - item.height = 26; - item.useTime = 19; - item.useAnimation = 19; - item.useStyle = 5; - item.noMelee = true; - item.knockBack = 8f; - item.value = Item.buyPrice(1, 20, 0, 0); - item.rare = 10; - item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/Magnum"); - item.autoReuse = true; - item.shootSpeed = 12f; - item.shoot = mod.ProjectileType("MagnumRound"); - item.useAmmo = mod.ItemType("MagnumRounds"); - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 200); - } - } - } - - public override Vector2? HoldoutOffset() - { - return new Vector2(-5, 0); - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "LightningHawk"); - recipe.AddIngredient(ItemID.LunarBar, 30); - recipe.AddIngredient(ItemID.IllegalGunParts); - recipe.AddTile(TileID.LunarCraftingStation); - recipe.SetResult(this); - recipe.AddRecipe(); - } - } + public override void SetDefaults() + { + item.damage = 2000; + item.crit += 66; + item.width = 46; + item.height = 26; + item.useTime = 19; + item.useAnimation = 19; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 8f; + item.value = Item.buyPrice(1, 20, 0, 0); + item.rare = 10; + item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/Magnum"); + item.autoReuse = true; + item.shootSpeed = 12f; + item.shoot = mod.ProjectileType("MagnumRound"); + item.useAmmo = mod.ItemType("MagnumRounds"); + item.GetGlobalItem(mod).postMoonLordRarity = 12; + } + + public override Vector2? HoldoutOffset() + { + return new Vector2(-5, 0); + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "LightningHawk"); + recipe.AddIngredient(ItemID.LunarBar, 30); + recipe.AddIngredient(ItemID.IllegalGunParts); + recipe.AddTile(TileID.LunarCraftingStation); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } } \ No newline at end of file diff --git a/Items/Weapons/FiniteUse/ElephantKiller.png b/Items/Weapons/FiniteUse/ElephantKiller.png index 559922674b..3b05169cb0 100644 Binary files a/Items/Weapons/FiniteUse/ElephantKiller.png and b/Items/Weapons/FiniteUse/ElephantKiller.png differ diff --git a/Items/Weapons/FiniteUse/ExplosiveShells.cs b/Items/Weapons/FiniteUse/ExplosiveShells.cs new file mode 100644 index 0000000000..3ebe0c076d --- /dev/null +++ b/Items/Weapons/FiniteUse/ExplosiveShells.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.Weapons.FiniteUse +{ + public class ExplosiveShells : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Explosive Shotgun Shell"); + } + + public override void SetDefaults() + { + item.damage = 30; + item.width = 18; + item.height = 18; + item.maxStack = 6; + item.consumable = true; + item.knockBack = 10f; + item.value = 15000; + item.rare = 8; + item.shoot = mod.ProjectileType("ExplosiveShellBullet"); + item.shootSpeed = 12f; + item.ammo = mod.ItemType("ExplosiveShells"); + } + } +} \ No newline at end of file diff --git a/Items/Weapons/FiniteUse/ExplosiveShells.png b/Items/Weapons/FiniteUse/ExplosiveShells.png new file mode 100644 index 0000000000..51da0ee1c8 Binary files /dev/null and b/Items/Weapons/FiniteUse/ExplosiveShells.png differ diff --git a/Items/Weapons/FiniteUse/GrenadeRounds.cs b/Items/Weapons/FiniteUse/GrenadeRounds.cs index b4e2d8e609..7d09eba57d 100644 --- a/Items/Weapons/FiniteUse/GrenadeRounds.cs +++ b/Items/Weapons/FiniteUse/GrenadeRounds.cs @@ -1,33 +1,33 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items; - -namespace CalamityMod.Items.Weapons.FiniteUse -{ - public class GrenadeRounds : ModItem - { +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.Weapons.FiniteUse +{ + public class GrenadeRounds : ModItem + { public override void SetStaticDefaults() { DisplayName.SetDefault("Grenade Shells"); } - public override void SetDefaults() - { - item.damage = 200; - item.width = 18; - item.height = 18; - item.maxStack = 3; - item.consumable = true; - item.knockBack = 10f; - item.value = 15000; - item.rare = 8; - item.shoot = mod.ProjectileType("GrenadeRound"); - item.shootSpeed = 12f; - item.ammo = mod.ItemType("GrenadeRounds"); - } - } + public override void SetDefaults() + { + item.damage = 200; + item.width = 18; + item.height = 18; + item.maxStack = 9; + item.consumable = true; + item.knockBack = 10f; + item.value = 15000; + item.rare = 8; + item.shoot = mod.ProjectileType("GrenadeRound"); + item.shootSpeed = 12f; + item.ammo = mod.ItemType("GrenadeRounds"); + } + } } \ No newline at end of file diff --git a/Items/Weapons/FiniteUse/Hydra.cs b/Items/Weapons/FiniteUse/Hydra.cs new file mode 100644 index 0000000000..a90f1371a4 --- /dev/null +++ b/Items/Weapons/FiniteUse/Hydra.cs @@ -0,0 +1,69 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.Weapons.FiniteUse +{ + public class Hydra : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Hydra"); + Tooltip.SetDefault("Uses Explosive Shotgun Shells\n" + + "Does more damage to everything"); + } + + public override void SetDefaults() + { + item.damage = 120; + item.width = 66; + item.height = 30; + item.useTime = 33; + item.useAnimation = 33; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 10f; + item.value = Item.buyPrice(0, 80, 0, 0); + item.rare = 8; + item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/Hydra"); + item.autoReuse = true; + item.shootSpeed = 12f; + item.shoot = mod.ProjectileType("ExplosiveShellBullet"); + item.useAmmo = mod.ItemType("ExplosiveShells"); + } + + public override Vector2? HoldoutOffset() + { + return new Vector2(-5, 0); + } + + public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + for (int index = 0; index < 15; ++index) + { + float SpeedX = speedX + (float)Main.rand.Next(-15, 16) * 0.05f; + float SpeedY = speedY + (float)Main.rand.Next(-15, 16) * 0.05f; + Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI, 0.0f, 0.0f); + } + return false; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Shotgun); + recipe.AddIngredient(ItemID.IronBar, 20); + recipe.anyIronBar = true; + recipe.AddIngredient(ItemID.IllegalGunParts); + recipe.AddIngredient(ItemID.Ectoplasm, 20); + recipe.AddTile(TileID.MythrilAnvil); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} \ No newline at end of file diff --git a/Items/Weapons/FiniteUse/Hydra.png b/Items/Weapons/FiniteUse/Hydra.png new file mode 100644 index 0000000000..8dff41dfc2 Binary files /dev/null and b/Items/Weapons/FiniteUse/Hydra.png differ diff --git a/Items/Weapons/FiniteUse/LightningHawk.cs b/Items/Weapons/FiniteUse/LightningHawk.cs index 67ed9e5948..829d3bde4b 100644 --- a/Items/Weapons/FiniteUse/LightningHawk.cs +++ b/Items/Weapons/FiniteUse/LightningHawk.cs @@ -1,60 +1,60 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items; - -namespace CalamityMod.Items.Weapons.FiniteUse -{ - public class LightningHawk : ModItem - { +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.Weapons.FiniteUse +{ + public class LightningHawk : ModItem + { public override void SetStaticDefaults() { DisplayName.SetDefault("Lightning Hawk"); - Tooltip.SetDefault("Uses Magnum Rounds\n" + + Tooltip.SetDefault("Uses Magnum Rounds\n" + "Does more damage to organic enemies"); } - public override void SetDefaults() - { - item.damage = 400; - item.crit += 56; - item.width = 50; - item.height = 28; - item.useTime = 21; - item.useAnimation = 21; - item.useStyle = 5; - item.noMelee = true; - item.knockBack = 8f; - item.value = Item.buyPrice(0, 48, 0, 0); - item.rare = 6; - item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/Magnum"); - item.autoReuse = true; - item.shootSpeed = 12f; - item.shoot = mod.ProjectileType("MagnumRound"); - item.useAmmo = mod.ItemType("MagnumRounds"); - } - - public override Vector2? HoldoutOffset() - { - return new Vector2(-5, 0); - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "Magnum"); - recipe.AddIngredient(ItemID.SoulofMight, 20); - recipe.AddIngredient(ItemID.SoulofSight, 20); - recipe.AddIngredient(ItemID.SoulofFright, 20); - recipe.AddIngredient(ItemID.IllegalGunParts); - recipe.AddIngredient(ItemID.HallowedBar, 10); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(this); - recipe.AddRecipe(); - } - } + public override void SetDefaults() + { + item.damage = 400; + item.crit += 56; + item.width = 50; + item.height = 28; + item.useTime = 21; + item.useAnimation = 21; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 8f; + item.value = Item.buyPrice(0, 48, 0, 0); + item.rare = 6; + item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/Magnum"); + item.autoReuse = true; + item.shootSpeed = 12f; + item.shoot = mod.ProjectileType("MagnumRound"); + item.useAmmo = mod.ItemType("MagnumRounds"); + } + + public override Vector2? HoldoutOffset() + { + return new Vector2(-5, 0); + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "Magnum"); + recipe.AddIngredient(ItemID.SoulofMight, 20); + recipe.AddIngredient(ItemID.SoulofSight, 20); + recipe.AddIngredient(ItemID.SoulofFright, 20); + recipe.AddIngredient(ItemID.IllegalGunParts); + recipe.AddIngredient(ItemID.HallowedBar, 10); + recipe.AddTile(TileID.MythrilAnvil); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } } \ No newline at end of file diff --git a/Items/Weapons/FiniteUse/LightningHawk.png b/Items/Weapons/FiniteUse/LightningHawk.png index 66216b46b1..38c191db97 100644 Binary files a/Items/Weapons/FiniteUse/LightningHawk.png and b/Items/Weapons/FiniteUse/LightningHawk.png differ diff --git a/Items/Weapons/FiniteUse/Magnum.cs b/Items/Weapons/FiniteUse/Magnum.cs index 4b6af8d27f..cd7ce71f09 100644 --- a/Items/Weapons/FiniteUse/Magnum.cs +++ b/Items/Weapons/FiniteUse/Magnum.cs @@ -1,58 +1,58 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items; - -namespace CalamityMod.Items.Weapons.FiniteUse -{ - public class Magnum : ModItem - { +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.Weapons.FiniteUse +{ + public class Magnum : ModItem + { public override void SetStaticDefaults() { DisplayName.SetDefault("Magnum"); - Tooltip.SetDefault("Uses Magnum Rounds\n" + + Tooltip.SetDefault("Uses Magnum Rounds\n" + "Does more damage to organic enemies"); } - public override void SetDefaults() - { - item.damage = 80; - item.crit += 46; - item.width = 46; - item.height = 24; - item.useTime = 25; - item.useAnimation = 25; - item.useStyle = 5; - item.noMelee = true; - item.knockBack = 8f; - item.value = Item.buyPrice(0, 2, 0, 0); - item.rare = 2; - item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/Magnum"); - item.autoReuse = true; - item.shootSpeed = 12f; - item.shoot = mod.ProjectileType("MagnumRound"); - item.useAmmo = mod.ItemType("MagnumRounds"); - } - - public override Vector2? HoldoutOffset() - { - return new Vector2(-5, 0); - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.FlintlockPistol); - recipe.AddIngredient(ItemID.IronBar, 10); - recipe.anyIronBar = true; - recipe.AddIngredient(ItemID.Diamond, 5); - recipe.AddTile(TileID.Anvils); - recipe.SetResult(this); - recipe.AddRecipe(); - } - } + public override void SetDefaults() + { + item.damage = 80; + item.crit += 46; + item.width = 46; + item.height = 24; + item.useTime = 25; + item.useAnimation = 25; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 8f; + item.value = Item.buyPrice(0, 2, 0, 0); + item.rare = 2; + item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/Magnum"); + item.autoReuse = true; + item.shootSpeed = 12f; + item.shoot = mod.ProjectileType("MagnumRound"); + item.useAmmo = mod.ItemType("MagnumRounds"); + } + + public override Vector2? HoldoutOffset() + { + return new Vector2(-5, 0); + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.FlintlockPistol); + recipe.AddIngredient(ItemID.IronBar, 10); + recipe.anyIronBar = true; + recipe.AddIngredient(ItemID.Diamond, 5); + recipe.AddTile(TileID.Anvils); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } } \ No newline at end of file diff --git a/Items/Weapons/FiniteUse/Magnum.png b/Items/Weapons/FiniteUse/Magnum.png index 9d052dce03..10f48dd4eb 100644 Binary files a/Items/Weapons/FiniteUse/Magnum.png and b/Items/Weapons/FiniteUse/Magnum.png differ diff --git a/Items/Weapons/FiniteUse/MagnumRounds.cs b/Items/Weapons/FiniteUse/MagnumRounds.cs index 99078fcf3c..56dca32674 100644 --- a/Items/Weapons/FiniteUse/MagnumRounds.cs +++ b/Items/Weapons/FiniteUse/MagnumRounds.cs @@ -1,34 +1,34 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items; - -namespace CalamityMod.Items.Weapons.FiniteUse -{ - public class MagnumRounds : ModItem - { +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.Weapons.FiniteUse +{ + public class MagnumRounds : ModItem + { public override void SetStaticDefaults() { DisplayName.SetDefault("Magnum Rounds"); } - public override void SetDefaults() - { - item.damage = 80; - item.crit += 4; - item.width = 18; - item.height = 18; - item.maxStack = 6; - item.consumable = true; - item.knockBack = 8f; - item.value = 10000; - item.rare = 8; - item.shoot = mod.ProjectileType("MagnumRound"); - item.shootSpeed = 12f; - item.ammo = mod.ItemType("MagnumRounds"); - } - } + public override void SetDefaults() + { + item.damage = 80; + item.crit += 4; + item.width = 18; + item.height = 18; + item.maxStack = 12; + item.consumable = true; + item.knockBack = 8f; + item.value = 10000; + item.rare = 8; + item.shoot = mod.ProjectileType("MagnumRound"); + item.shootSpeed = 12f; + item.ammo = mod.ItemType("MagnumRounds"); + } + } } \ No newline at end of file diff --git a/Items/Weapons/FiniteUse/MagnumRounds.png b/Items/Weapons/FiniteUse/MagnumRounds.png index 782fd0dec0..08a3366f9b 100644 Binary files a/Items/Weapons/FiniteUse/MagnumRounds.png and b/Items/Weapons/FiniteUse/MagnumRounds.png differ diff --git a/Items/Weapons/FirestormCannon.cs b/Items/Weapons/FirestormCannon.cs index 3ae36bfb2c..7912490cb9 100644 --- a/Items/Weapons/FirestormCannon.cs +++ b/Items/Weapons/FirestormCannon.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Items.Weapons public override bool ConsumeAmmo(Player player) { - if (Main.rand.Next(0, 100) <= 70) + if (Main.rand.Next(0, 100) < 70) return false; return true; } diff --git a/Items/Weapons/FlameScytheMelee.png b/Items/Weapons/FlameScytheMelee.png index 6df15cd567..d6577c12b4 100644 Binary files a/Items/Weapons/FlameScytheMelee.png and b/Items/Weapons/FlameScytheMelee.png differ diff --git a/Items/Weapons/FlarewingBow.png b/Items/Weapons/FlarewingBow.png index 7d6aba53c7..f1bb233ff2 100644 Binary files a/Items/Weapons/FlarewingBow.png and b/Items/Weapons/FlarewingBow.png differ diff --git a/Items/Weapons/ForbiddenSun.png b/Items/Weapons/ForbiddenSun.png index 2174bb45df..7e13e36d43 100644 Binary files a/Items/Weapons/ForbiddenSun.png and b/Items/Weapons/ForbiddenSun.png differ diff --git a/Items/Weapons/FourSeasonsGalaxia.cs b/Items/Weapons/FourSeasonsGalaxia.cs index af1fc468bd..ee52fd8035 100644 --- a/Items/Weapons/FourSeasonsGalaxia.cs +++ b/Items/Weapons/FourSeasonsGalaxia.cs @@ -33,19 +33,9 @@ namespace CalamityMod.Items.Weapons item.rare = 10; item.shoot = mod.ProjectileType("Galaxia"); item.shootSpeed = 24f; + item.GetGlobalItem(mod).postMoonLordRarity = 14; } - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(43, 96, 222); - } - } - } - public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); diff --git a/Items/Weapons/GalacticaBlade.cs b/Items/Weapons/GalacticaBlade.cs index b29eae8f84..a3cec0604f 100644 --- a/Items/Weapons/GalacticaBlade.cs +++ b/Items/Weapons/GalacticaBlade.cs @@ -34,18 +34,8 @@ namespace CalamityMod.Items.Weapons item.rare = 10; item.shoot = mod.ProjectileType("GalacticaComet"); item.shootSpeed = 23f; + item.GetGlobalItem(mod).postMoonLordRarity = 12; } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 200); - } - } - } public override void AddRecipes() { diff --git a/Items/Weapons/GammaFusillade.cs b/Items/Weapons/GammaFusillade.cs index ed5227a255..921fcdda07 100644 --- a/Items/Weapons/GammaFusillade.cs +++ b/Items/Weapons/GammaFusillade.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons public override void SetDefaults() { - item.damage = 67; + item.damage = 110; item.magic = true; item.mana = 4; item.width = 28; @@ -35,18 +35,8 @@ namespace CalamityMod.Items.Weapons item.autoReuse = true; item.shoot = mod.ProjectileType("GammaLaser"); item.shootSpeed = 20f; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 200); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 12; + } public override void AddRecipes() { diff --git a/Items/Weapons/Genisis.cs b/Items/Weapons/Genisis.cs index dc629c627c..51f0efcf48 100644 --- a/Items/Weapons/Genisis.cs +++ b/Items/Weapons/Genisis.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons public override void SetDefaults() { - item.damage = 52; + item.damage = 48; item.magic = true; item.mana = 4; item.width = 74; @@ -34,23 +34,13 @@ namespace CalamityMod.Items.Weapons item.autoReuse = true; item.shootSpeed = 6f; item.shoot = mod.ProjectileType("BigBeamofDeath"); - } + item.GetGlobalItem(mod).postMoonLordRarity = 12; + } public override Vector2? HoldoutOffset() { return new Vector2(-5, 0); } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 200); - } - } - } public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { diff --git a/Items/Weapons/GrandGuardian.cs b/Items/Weapons/GrandGuardian.cs index 0b917d1c0c..f3b150742b 100644 --- a/Items/Weapons/GrandGuardian.cs +++ b/Items/Weapons/GrandGuardian.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons public override void SetStaticDefaults() { DisplayName.SetDefault("Grand Guardian"); - Tooltip.SetDefault("Has a chance to lower enemy defense by 30 when striking them\n" + + Tooltip.SetDefault("Has a chance to lower enemy defense by 15 when striking them\n" + "If enemy defense is 0 or below your attacks will heal you\n" + "Striking enemies causes a large explosion\n" + "Striking enemies that have under half life will make you release rainbow bolts\n" + @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons public override void SetDefaults() { item.width = 124; - item.damage = 200; + item.damage = 160; item.melee = true; item.useAnimation = 22; item.useStyle = 1; @@ -40,21 +40,17 @@ namespace CalamityMod.Items.Weapons } public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) - { - if (target.type == mod.NPCType("DevourerofGodsBodyS") || target.type == mod.NPCType("DevourerofGodsBody")) + { + if (Main.rand.Next(5) == 0) { - return; + target.defense -= 15; } - if (Main.rand.Next(2) == 0) + if (target.defense <= 0 && target.canGhostHeal) { - target.defense -= 30; + player.statLife += 4; + player.HealEffect(4); } - if (target.defense <= 0) - { - player.statLife += 6; - player.HealEffect(6); - } - Projectile.NewProjectile(target.Center.X, target.Center.Y, 0f, 0f, mod.ProjectileType("RainbowBoom"), (int)((double)((float)item.damage * player.meleeDamage) * 0.5), knockback, Main.myPlayer); + Projectile.NewProjectile(target.Center.X, target.Center.Y, 0f, 0f, mod.ProjectileType("RainbowBoom"), (int)((double)((float)item.damage * player.meleeDamage) * 0.5), 0f, Main.myPlayer); float spread = 180f * 0.0174f; double startAngle = Math.Atan2(item.shootSpeed, item.shootSpeed) - spread / 2; double deltaAngle = spread / 8f; diff --git a/Items/Weapons/Grax.cs b/Items/Weapons/Grax.cs index 2806e58c5a..805167c940 100644 --- a/Items/Weapons/Grax.cs +++ b/Items/Weapons/Grax.cs @@ -34,25 +34,15 @@ namespace CalamityMod.Items.Weapons item.height = 60; item.value = Item.buyPrice(1, 20, 0, 0); item.rare = 10; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 200); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 12; + } public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(null, "FellerofEvergreens"); recipe.AddIngredient(null, "DraedonBar", 5); - recipe.AddRecipeGroup("LunarAxe"); + recipe.AddRecipeGroup("LunarHamaxe"); recipe.AddTile(TileID.LunarCraftingStation); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/GreatbowofTurmoil.png b/Items/Weapons/GreatbowofTurmoil.png index 038bbf3f05..c2701d189e 100644 Binary files a/Items/Weapons/GreatbowofTurmoil.png and b/Items/Weapons/GreatbowofTurmoil.png differ diff --git a/Items/Weapons/GreatswordofBlah.cs b/Items/Weapons/GreatswordofBlah.cs index 9897e9f837..eba791e588 100644 --- a/Items/Weapons/GreatswordofBlah.cs +++ b/Items/Weapons/GreatswordofBlah.cs @@ -37,18 +37,8 @@ namespace CalamityMod.Items.Weapons item.rare = 10; item.shoot = mod.ProjectileType("JudgementBlah"); item.shootSpeed = 12f; + item.GetGlobalItem(mod).postMoonLordRarity = 14; } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(43, 96, 222); - } - } - } public override void AddRecipes() { diff --git a/Items/Weapons/GreatswordofJudgement.cs b/Items/Weapons/GreatswordofJudgement.cs index b599d24a66..181c890301 100644 --- a/Items/Weapons/GreatswordofJudgement.cs +++ b/Items/Weapons/GreatswordofJudgement.cs @@ -37,18 +37,8 @@ namespace CalamityMod.Items.Weapons item.rare = 10; item.shoot = mod.ProjectileType("Judgement"); item.shootSpeed = 10f; + item.GetGlobalItem(mod).postMoonLordRarity = 12; } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 200); - } - } - } public override void AddRecipes() { diff --git a/Items/Weapons/HeavenlyGale.cs b/Items/Weapons/HeavenlyGale.cs index e418c27dde..6a31fcd5e7 100644 --- a/Items/Weapons/HeavenlyGale.cs +++ b/Items/Weapons/HeavenlyGale.cs @@ -6,7 +6,6 @@ using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Items; -//using TerrariaOverhaul; namespace CalamityMod.Items.Weapons { @@ -24,7 +23,7 @@ namespace CalamityMod.Items.Weapons public override void SetDefaults() { - item.damage = 600; + item.damage = 700; item.ranged = true; item.width = 44; item.height = 58; @@ -40,23 +39,8 @@ namespace CalamityMod.Items.Weapons item.shoot = 1; item.shootSpeed = 17f; item.useAmmo = 40; - } - - /*public void OverhaulInit() - { - this.SetTag("bow"); - }*/ - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(108, 45, 199); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 15; + } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { diff --git a/Items/Weapons/HellfireFlamberge.cs b/Items/Weapons/HellfireFlamberge.cs index 20f77ae324..18d13ccd59 100644 --- a/Items/Weapons/HellfireFlamberge.cs +++ b/Items/Weapons/HellfireFlamberge.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons public override void SetDefaults() { - item.width = 50; + item.width = 60; item.damage = 102; item.melee = true; item.useAnimation = 20; @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Weapons item.knockBack = 7.75f; item.UseSound = SoundID.Item1; item.autoReuse = true; - item.height = 50; + item.height = 60; item.value = Item.buyPrice(0, 80, 0, 0); item.rare = 8; item.shoot = mod.ProjectileType("ChaosFlameSmall"); diff --git a/Items/Weapons/HellfireFlamberge.png b/Items/Weapons/HellfireFlamberge.png index fe4144d514..0c433f0b1e 100644 Binary files a/Items/Weapons/HellfireFlamberge.png and b/Items/Weapons/HellfireFlamberge.png differ diff --git a/Items/Weapons/Hellkite.png b/Items/Weapons/Hellkite.png index b034512fcf..b3f7ac8e83 100644 Binary files a/Items/Weapons/Hellkite.png and b/Items/Weapons/Hellkite.png differ diff --git a/Items/Weapons/Helstorm.png b/Items/Weapons/Helstorm.png index 4ef6056eba..b9fcdd173b 100644 Binary files a/Items/Weapons/Helstorm.png and b/Items/Weapons/Helstorm.png differ diff --git a/Items/Weapons/HiveMind/Shadethrower.cs b/Items/Weapons/HiveMind/Shadethrower.cs index 7ab95e5160..b3a478cb59 100644 --- a/Items/Weapons/HiveMind/Shadethrower.cs +++ b/Items/Weapons/HiveMind/Shadethrower.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Items.Weapons.HiveMind public override bool ConsumeAmmo(Player player) { - if (Main.rand.Next(0, 100) <= 33) + if (Main.rand.Next(0, 100) < 33) return false; return true; } diff --git a/Items/Weapons/InfernalRift.cs b/Items/Weapons/InfernalRift.cs index 5d5453b7ef..42eddee7d4 100644 --- a/Items/Weapons/InfernalRift.cs +++ b/Items/Weapons/InfernalRift.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons public override void SetDefaults() { - item.damage = 42; + item.damage = 40; item.magic = true; item.mana = 15; item.width = 16; diff --git a/Items/Weapons/Interfacer.cs b/Items/Weapons/Interfacer.cs index 6cb5b0233c..6b3e155657 100644 --- a/Items/Weapons/Interfacer.cs +++ b/Items/Weapons/Interfacer.cs @@ -35,18 +35,8 @@ namespace CalamityMod.Items.Weapons item.shootSpeed = 13f; item.shoot = 10; item.useAmmo = 97; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 200); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 12; + } public override Vector2? HoldoutOffset() { @@ -55,7 +45,7 @@ namespace CalamityMod.Items.Weapons public override bool ConsumeAmmo(Player player) { - if (Main.rand.Next(0, 101) <= 50) + if (Main.rand.Next(0, 100) < 50) return false; return true; } diff --git a/Items/Weapons/IonBlaster.cs b/Items/Weapons/IonBlaster.cs index 536c23bdd3..e0df6999a1 100644 --- a/Items/Weapons/IonBlaster.cs +++ b/Items/Weapons/IonBlaster.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons public override void SetDefaults() { item.width = 44; - item.damage = 25; + item.damage = 20; item.magic = true; item.mana = 8; item.useAnimation = 10; diff --git a/Items/Weapons/Judgement.cs b/Items/Weapons/Judgement.cs index 1573f6adab..2520febd8a 100644 --- a/Items/Weapons/Judgement.cs +++ b/Items/Weapons/Judgement.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons public override void SetDefaults() { - item.damage = 515; + item.damage = 500; item.magic = true; item.mana = 9; item.width = 28; @@ -35,18 +35,8 @@ namespace CalamityMod.Items.Weapons item.autoReuse = true; item.shoot = mod.ProjectileType("WhiteFlame"); item.shootSpeed = 30f; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(255, 0, 255); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 16; + } public override void AddRecipes() { diff --git a/Items/Weapons/Lacerator.cs b/Items/Weapons/Lacerator.cs index cb7b7540f5..d507a7715f 100644 --- a/Items/Weapons/Lacerator.cs +++ b/Items/Weapons/Lacerator.cs @@ -14,14 +14,14 @@ namespace CalamityMod.Items.Weapons public override void SetStaticDefaults() { DisplayName.SetDefault("Lacerator"); - Tooltip.SetDefault("Enemies that are close to the yoyo will have their life drained\n" + + Tooltip.SetDefault("Enemies that are hit by the yoyo will have their life drained\n" + "Someone thought this was a viable weapon against DoG at one point lol"); } public override void SetDefaults() { item.CloneDefaults(ItemID.TheEyeOfCthulhu); - item.damage = 900; + item.damage = 150; item.useTime = 20; item.useAnimation = 20; item.useStyle = 5; @@ -32,18 +32,8 @@ namespace CalamityMod.Items.Weapons item.rare = 10; item.autoReuse = true; item.shoot = mod.ProjectileType("LaceratorProjectile"); - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 0); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 13; + } public override void AddRecipes() { diff --git a/Items/Weapons/Leviathan/Atlantis.png b/Items/Weapons/Leviathan/Atlantis.png index 1ef12fd080..bb16c85109 100644 Binary files a/Items/Weapons/Leviathan/Atlantis.png and b/Items/Weapons/Leviathan/Atlantis.png differ diff --git a/Items/Weapons/Leviathan/LureofEnthrallment.cs b/Items/Weapons/Leviathan/LureofEnthrallment.cs index e1cd9daf3d..ec60e971d4 100644 --- a/Items/Weapons/Leviathan/LureofEnthrallment.cs +++ b/Items/Weapons/Leviathan/LureofEnthrallment.cs @@ -54,7 +54,7 @@ namespace CalamityMod.Items.Weapons.Leviathan } if (player.ownedProjectileCounts[mod.ProjectileType("SirenLure")] < 1) { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, mod.ProjectileType("SirenLure"), 0, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, mod.ProjectileType("SirenLure"), (int)(65f * player.minionDamage), 2f, Main.myPlayer, 0f, 0f); } } } diff --git a/Items/Weapons/Leviathan/SirensSong.cs b/Items/Weapons/Leviathan/SirensSong.cs index 5be9214697..d40fc81790 100644 --- a/Items/Weapons/Leviathan/SirensSong.cs +++ b/Items/Weapons/Leviathan/SirensSong.cs @@ -31,7 +31,6 @@ namespace CalamityMod.Items.Weapons.Leviathan item.knockBack = 6.5f; item.value = Item.buyPrice(0, 60, 0, 0); item.rare = 7; - item.UseSound = SoundID.Item26; item.autoReuse = true; item.shoot = mod.ProjectileType("SirensSong"); item.shootSpeed = 13f; @@ -56,7 +55,8 @@ namespace CalamityMod.Items.Weapons.Leviathan { float SpeedX = speedX + (float)Main.rand.Next(-15, 16) * 0.05f; float SpeedY = speedY + (float)Main.rand.Next(-15, 16) * 0.05f; - Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI, 0.0f, 0.0f); + float soundPitch = (Main.rand.NextFloat() - 0.5f) * 0.5f; + Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI, soundPitch, 0f); return false; } } diff --git a/Items/Weapons/LifefruitScythe.cs b/Items/Weapons/LifefruitScythe.cs index 79220c7f23..79db765280 100644 --- a/Items/Weapons/LifefruitScythe.cs +++ b/Items/Weapons/LifefruitScythe.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons public override void SetDefaults() { item.width = 60; - item.damage = 115; + item.damage = 250; item.melee = true; item.useAnimation = 18; item.useStyle = 1; @@ -34,18 +34,8 @@ namespace CalamityMod.Items.Weapons item.rare = 10; item.shoot = mod.ProjectileType("LifeScythe"); item.shootSpeed = 9f; + item.GetGlobalItem(mod).postMoonLordRarity = 12; } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 200); - } - } - } public override void AddRecipes() { @@ -66,7 +56,7 @@ namespace CalamityMod.Items.Weapons public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { - if (target.type == NPCID.TargetDummy) + if (target.type == NPCID.TargetDummy || !target.canGhostHeal) { return; } diff --git a/Items/Weapons/LunicEye.png b/Items/Weapons/LunicEye.png index f80d56e5f0..e54e7dc789 100644 Binary files a/Items/Weapons/LunicEye.png and b/Items/Weapons/LunicEye.png differ diff --git a/Items/Weapons/MagneticMeltdown.cs b/Items/Weapons/MagneticMeltdown.cs index 162ea7feb7..97cdef9d20 100644 --- a/Items/Weapons/MagneticMeltdown.cs +++ b/Items/Weapons/MagneticMeltdown.cs @@ -36,18 +36,8 @@ namespace CalamityMod.Items.Weapons item.autoReuse = true; item.shoot = mod.ProjectileType("MagneticOrb"); item.shootSpeed = 12f; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(43, 96, 222); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 14; + } public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { diff --git a/Items/Weapons/MajesticGuard.cs b/Items/Weapons/MajesticGuard.cs index d9b8d4eede..81e18a5ce8 100644 --- a/Items/Weapons/MajesticGuard.cs +++ b/Items/Weapons/MajesticGuard.cs @@ -40,10 +40,10 @@ namespace CalamityMod.Items.Weapons { target.defense -= 10; } - if (target.defense <= 0) + if (target.defense <= 0 && target.canGhostHeal) { - player.statLife += 4; - player.HealEffect(4); + player.statLife += 3; + player.HealEffect(3); } } diff --git a/Items/Weapons/MantisClaws.cs b/Items/Weapons/MantisClaws.cs index 47ad7aebaf..1d07645ed2 100644 --- a/Items/Weapons/MantisClaws.cs +++ b/Items/Weapons/MantisClaws.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons public override void SetDefaults() { item.width = 26; - item.damage = 90; + item.damage = 120; item.melee = true; item.useAnimation = 6; item.useStyle = 1; @@ -43,7 +43,7 @@ namespace CalamityMod.Items.Weapons public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { - Projectile.NewProjectile(target.Center.X, target.Center.Y, 0f, 0f, 612, (int)((float)item.damage * player.meleeDamage), knockback, Main.myPlayer); + Projectile.NewProjectile(target.Center.X, target.Center.Y, 0f, 0f, 612, 0, knockback, Main.myPlayer); } } } diff --git a/Items/Weapons/Megafleet.cs b/Items/Weapons/Megafleet.cs index 3b1ba4ecc6..9ed0114596 100644 --- a/Items/Weapons/Megafleet.cs +++ b/Items/Weapons/Megafleet.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons public override void SetDefaults() { - item.damage = 480; + item.damage = 1000; item.ranged = true; item.width = 96; item.height = 38; @@ -34,27 +34,17 @@ namespace CalamityMod.Items.Weapons item.shoot = 10; item.shootSpeed = 18f; item.useAmmo = 97; + item.GetGlobalItem(mod).postMoonLordRarity = 16; } public override Vector2? HoldoutOffset() { return new Vector2(-5, 0); } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(255, 0, 255); - } - } - } public override bool ConsumeAmmo(Player player) { - if (Main.rand.Next(0, 100) <= 95) + if (Main.rand.Next(0, 100) < 95) return false; return true; } diff --git a/Items/Weapons/Megalodon.cs b/Items/Weapons/Megalodon.cs index 0d682d47d8..7895e38b23 100644 --- a/Items/Weapons/Megalodon.cs +++ b/Items/Weapons/Megalodon.cs @@ -52,7 +52,7 @@ namespace CalamityMod.Items.Weapons public override bool ConsumeAmmo(Player player) { - if (Main.rand.Next(0, 100) <= 50) + if (Main.rand.Next(0, 100) < 50) return false; return true; } diff --git a/Items/Weapons/Meowthrower.cs b/Items/Weapons/Meowthrower.cs index 5e1fb8e659..5227169600 100644 --- a/Items/Weapons/Meowthrower.cs +++ b/Items/Weapons/Meowthrower.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Items.Weapons public override bool ConsumeAmmo(Player player) { - if (Main.rand.Next(0, 100) <= 50) + if (Main.rand.Next(0, 100) < 50) return false; return true; } diff --git a/Items/Weapons/Meowthrower.png b/Items/Weapons/Meowthrower.png index d76908c34e..d56d0de42c 100644 Binary files a/Items/Weapons/Meowthrower.png and b/Items/Weapons/Meowthrower.png differ diff --git a/Items/Weapons/Minigun.cs b/Items/Weapons/Minigun.cs index 2bdf5d006c..0734cc8359 100644 --- a/Items/Weapons/Minigun.cs +++ b/Items/Weapons/Minigun.cs @@ -35,24 +35,14 @@ namespace CalamityMod.Items.Weapons item.shoot = 10; item.shootSpeed = 22f; item.useAmmo = 97; - } + item.GetGlobalItem(mod).postMoonLordRarity = 14; + } public override Vector2? HoldoutOffset() { return new Vector2(-10, 0); } - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(43, 96, 222); - } - } - } - public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { float SpeedX = speedX + (float) Main.rand.Next(-15, 16) * 0.05f; @@ -63,7 +53,7 @@ namespace CalamityMod.Items.Weapons public override bool ConsumeAmmo(Player player) { - if (Main.rand.Next(0, 100) <= 80) + if (Main.rand.Next(0, 100) < 80) return false; return true; } diff --git a/Items/Weapons/MirrorBlade.cs b/Items/Weapons/MirrorBlade.cs index b180c5a2df..f08e08c244 100644 --- a/Items/Weapons/MirrorBlade.cs +++ b/Items/Weapons/MirrorBlade.cs @@ -36,19 +36,9 @@ namespace CalamityMod.Items.Weapons item.rare = 10; item.shootSpeed = 16f; item.shoot = mod.ProjectileType("MirrorBlast"); + item.GetGlobalItem(mod).postMoonLordRarity = 13; } - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 0); - } - } - } - public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0.0f, 0.0f); diff --git a/Items/Weapons/Mistlestorm.cs b/Items/Weapons/Mistlestorm.cs index 71b7d2890d..39d05f9cc5 100644 --- a/Items/Weapons/Mistlestorm.cs +++ b/Items/Weapons/Mistlestorm.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons public override void SetDefaults() { - item.damage = 99; + item.damage = 60; item.magic = true; item.mana = 5; item.width = 48; @@ -36,18 +36,8 @@ namespace CalamityMod.Items.Weapons item.autoReuse = true; item.shoot = 336; item.shootSpeed = 24f; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 0); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 13; + } public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { diff --git a/Items/Weapons/MolecularManipulator.cs b/Items/Weapons/MolecularManipulator.cs index acb9172250..ba5073756b 100644 --- a/Items/Weapons/MolecularManipulator.cs +++ b/Items/Weapons/MolecularManipulator.cs @@ -34,28 +34,22 @@ namespace CalamityMod.Items.Weapons item.autoReuse = true; item.shootSpeed = 25f; item.shoot = mod.ProjectileType("NullShot2"); - } + item.GetGlobalItem(mod).postMoonLordRarity = 13; + } public override Vector2? HoldoutOffset() { return new Vector2(-5, 0); } - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 0); - } - } - } - public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { player.statLife -= 5; - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, mod.ProjectileType("NullShot2"), damage, knockBack, player.whoAmI, 0.0f, 0.0f); + if (player.statLife <= 0) + { + player.KillMe(PlayerDeathReason.ByOther(10), 1000.0, 0, false); + } + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, mod.ProjectileType("NullShot2"), damage, knockBack, player.whoAmI, 0.0f, 0.0f); return false; } diff --git a/Items/Weapons/Mourningstar.cs b/Items/Weapons/Mourningstar.cs index 138f5b1e5d..d9e6805b7f 100644 --- a/Items/Weapons/Mourningstar.cs +++ b/Items/Weapons/Mourningstar.cs @@ -34,19 +34,9 @@ namespace CalamityMod.Items.Weapons item.rare = 10; item.shootSpeed = 24f; item.shoot = 611; + item.GetGlobalItem(mod).postMoonLordRarity = 14; } - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(43, 96, 222); - } - } - } - public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); diff --git a/Items/Weapons/Murasama.cs b/Items/Weapons/Murasama.cs index db20710245..c04d681ca3 100644 --- a/Items/Weapons/Murasama.cs +++ b/Items/Weapons/Murasama.cs @@ -37,18 +37,8 @@ namespace CalamityMod.Items.Weapons item.rare = 10; item.shoot = mod.ProjectileType("Murasama"); item.shootSpeed = 15f; + item.GetGlobalItem(mod).postMoonLordRarity = 15; } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(108, 45, 199); - } - } - } public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { diff --git a/Items/Weapons/NeptunesBounty.cs b/Items/Weapons/NeptunesBounty.cs index d8f6c09ca3..5ee3dd5707 100644 --- a/Items/Weapons/NeptunesBounty.cs +++ b/Items/Weapons/NeptunesBounty.cs @@ -33,19 +33,9 @@ namespace CalamityMod.Items.Weapons item.rare = 10; item.shoot = mod.ProjectileType("NeptuneOrb"); item.shootSpeed = 25f; + item.GetGlobalItem(mod).postMoonLordRarity = 14; } - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(43, 96, 222); - } - } - } - public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); diff --git a/Items/Weapons/NettlelineGreatbow.cs b/Items/Weapons/NettlelineGreatbow.cs index 34d6041212..9bbcb85cbe 100644 --- a/Items/Weapons/NettlelineGreatbow.cs +++ b/Items/Weapons/NettlelineGreatbow.cs @@ -6,7 +6,6 @@ using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Items; -//using TerrariaOverhaul; namespace CalamityMod.Items.Weapons { @@ -35,23 +34,8 @@ namespace CalamityMod.Items.Weapons item.shoot = 10; item.shootSpeed = 16f; item.useAmmo = 40; - } - - /*public void OverhaulInit() - { - this.SetTag("bow"); - }*/ - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 200); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 12; + } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { diff --git a/Items/Weapons/NuclearFury.cs b/Items/Weapons/NuclearFury.cs index 38b897b30e..e9f506f701 100644 --- a/Items/Weapons/NuclearFury.cs +++ b/Items/Weapons/NuclearFury.cs @@ -35,18 +35,8 @@ namespace CalamityMod.Items.Weapons item.autoReuse = true; item.shoot = mod.ProjectileType("NuclearFuryProjectile"); item.shootSpeed = 16f; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 200); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 12; + } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { diff --git a/Items/Weapons/NullificationRifle.cs b/Items/Weapons/NullificationRifle.cs index 84ecee601b..7129137166 100644 --- a/Items/Weapons/NullificationRifle.cs +++ b/Items/Weapons/NullificationRifle.cs @@ -44,6 +44,10 @@ namespace CalamityMod.Items.Weapons public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { player.statLife -= 5; + if (player.statLife <= 0) + { + player.KillMe(PlayerDeathReason.ByOther(10), 1000.0, 0, false); + } Projectile.NewProjectile(position.X, position.Y, speedX, speedY, mod.ProjectileType("NullShot"), damage, knockBack, player.whoAmI, 0.0f, 0.0f); return false; } diff --git a/Items/Weapons/OmegaBiomeBlade.cs b/Items/Weapons/OmegaBiomeBlade.cs index fb43cadabf..e0e1a4bd14 100644 --- a/Items/Weapons/OmegaBiomeBlade.cs +++ b/Items/Weapons/OmegaBiomeBlade.cs @@ -33,19 +33,9 @@ namespace CalamityMod.Items.Weapons item.rare = 10; item.shoot = mod.ProjectileType("OmegaBiomeOrb"); item.shootSpeed = 15f; + item.GetGlobalItem(mod).postMoonLordRarity = 12; } - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 200); - } - } - } - public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { for (int projectiles = 0; projectiles <= 2; projectiles++) diff --git a/Items/Weapons/Omniblade.cs b/Items/Weapons/Omniblade.cs index 56fbac2795..b7cbfbc49e 100644 --- a/Items/Weapons/Omniblade.cs +++ b/Items/Weapons/Omniblade.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons public override void SetDefaults() { item.width = 100; - item.damage = 84; + item.damage = 63; item.crit += 45; item.melee = true; item.useAnimation = 10; diff --git a/Items/Weapons/OnyxChainBlaster.cs b/Items/Weapons/OnyxChainBlaster.cs index efa05531cb..9f43b0452b 100644 --- a/Items/Weapons/OnyxChainBlaster.cs +++ b/Items/Weapons/OnyxChainBlaster.cs @@ -35,18 +35,8 @@ namespace CalamityMod.Items.Weapons item.shoot = 10; item.shootSpeed = 24f; item.useAmmo = 97; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 200); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 12; + } public override Vector2? HoldoutOffset() { @@ -69,7 +59,7 @@ namespace CalamityMod.Items.Weapons public override bool ConsumeAmmo(Player player) { - if (Main.rand.Next(0, 100) <= 50) + if (Main.rand.Next(0, 100) < 50) return false; return true; } diff --git a/Items/Weapons/Onyxia.cs b/Items/Weapons/Onyxia.cs new file mode 100644 index 0000000000..fccba6623e --- /dev/null +++ b/Items/Weapons/Onyxia.cs @@ -0,0 +1,89 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons +{ + class Onyxia : ModItem + { + const int NotConsumeAmmo = 50; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Onyxia"); + Tooltip.SetDefault(NotConsumeAmmo.ToString() + "% chance to not consume ammo"); + } + + public override void SetDefaults() + { + item.damage = 235; + item.ranged = true; + item.width = 84; + item.height = 34; + item.useTime = 8; + item.useAnimation = 8; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 4.5f; + item.value = Item.buyPrice(1, 80, 0, 0); + item.rare = 10; + item.UseSound = SoundID.Item36; + item.autoReuse = true; + item.shoot = 10; + item.shootSpeed = 28f; + item.useAmmo = 97; + item.GetGlobalItem(mod).postMoonLordRarity = 14; + } + + public override Vector2? HoldoutOffset() + { + return new Vector2(-11, 3); + } + + public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + // Fire the Onyx Shard that is characteristic of the Onyx Blaster + // The shard deals triple damage and double knockback + int shardDamage = 3 * damage; + float shardKB = 2f * knockBack; + float shardVelocityX = (speedX + (float)Main.rand.Next(-25, 26) * 0.05f) * 0.9f; + float shardVelocityY = (speedY + (float)Main.rand.Next(-25, 26) * 0.05f) * 0.9f; + Projectile.NewProjectile(position.X, position.Y, shardVelocityX, shardVelocityY, 661, shardDamage, shardKB, player.whoAmI, 0.0f, 0.0f); + + // Fire three symmetric pairs of bullets alongside it + Vector2 baseVelocity = new Vector2(speedX, speedY); + for (int i = 0; i < 3; i++) + { + float randAngle = Main.rand.NextFloat(0.035f); + float randVelMultiplier = Main.rand.NextFloat(0.92f, 1.08f); + Vector2 left = baseVelocity.RotatedBy(-randAngle) * randVelMultiplier; + Vector2 right = baseVelocity.RotatedBy(randAngle) * randVelMultiplier; + Projectile.NewProjectile(position.X, position.Y, left.X, left.Y, type, damage, knockBack, player.whoAmI, 0.0f, 0.0f); + Projectile.NewProjectile(position.X, position.Y, right.X, right.Y, type, damage, knockBack, player.whoAmI, 0.0f, 0.0f); + } + return false; + } + + public override bool ConsumeAmmo(Player player) + { + if (Main.rand.Next(0, 100) < NotConsumeAmmo) + return false; + return true; + } + + public override void AddRecipes() + { + ModRecipe r = new ModRecipe(mod); + r.AddIngredient(null, "OnyxChainBlaster"); + r.AddIngredient(null, "CosmiliteBar", 10); + r.AddIngredient(null, "DarksunFragment", 10); + r.AddTile(null, "DraedonsForge"); + r.SetResult(this); + r.AddRecipe(); + } + } +} diff --git a/Items/Weapons/Onyxia.png b/Items/Weapons/Onyxia.png new file mode 100644 index 0000000000..4834c9f936 Binary files /dev/null and b/Items/Weapons/Onyxia.png differ diff --git a/Items/Weapons/P90.cs b/Items/Weapons/P90.cs index d30fc6cc92..d163bc0691 100644 --- a/Items/Weapons/P90.cs +++ b/Items/Weapons/P90.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Items.Weapons public override bool ConsumeAmmo(Player player) { - if (Main.rand.Next(0, 100) <= 33) + if (Main.rand.Next(0, 100) < 33) return false; return true; } diff --git a/Items/Weapons/Phangasm.cs b/Items/Weapons/Phangasm.cs index a9c9d1f036..6bfadc8361 100644 --- a/Items/Weapons/Phangasm.cs +++ b/Items/Weapons/Phangasm.cs @@ -36,18 +36,8 @@ namespace CalamityMod.Items.Weapons item.shoot = mod.ProjectileType("Phangasm"); item.shootSpeed = 20f; item.useAmmo = 40; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(43, 96, 222); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 14; + } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { diff --git a/Items/Weapons/PhantasmalFury.cs b/Items/Weapons/PhantasmalFury.cs index de7804ac95..f837d8ad1f 100644 --- a/Items/Weapons/PhantasmalFury.cs +++ b/Items/Weapons/PhantasmalFury.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons public override void SetDefaults() { - item.damage = 363; + item.damage = 320; item.magic = true; item.mana = 20; item.width = 62; @@ -36,24 +36,14 @@ namespace CalamityMod.Items.Weapons item.autoReuse = true; item.shoot = mod.ProjectileType("PhantasmalFury"); item.shootSpeed = 12f; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 0); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 13; + } public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.SpectreStaff); - recipe.AddIngredient(null, "Phantoplasm", 5); + recipe.AddIngredient(null, "RuinousSoul", 2); recipe.AddIngredient(null, "DarkPlasma"); recipe.AddTile(TileID.LunarCraftingStation); recipe.SetResult(this); diff --git a/Items/Weapons/PhoenixBlade.cs b/Items/Weapons/PhoenixBlade.cs index 440043704b..37f7b09d3a 100644 --- a/Items/Weapons/PhoenixBlade.cs +++ b/Items/Weapons/PhoenixBlade.cs @@ -14,36 +14,37 @@ namespace CalamityMod.Items.Weapons public override void SetStaticDefaults() { DisplayName.SetDefault("Phoenix Blade"); + Tooltip.SetDefault("Enemies explode and emit healing flames on death"); } public override void SetDefaults() { item.width = 106; - item.damage = 35; + item.damage = 95; item.melee = true; - item.useAnimation = 30; + item.useAnimation = 29; item.useStyle = 1; - item.useTime = 30; + item.useTime = 29; item.useTurn = true; - item.knockBack = 7f; + item.knockBack = 8f; item.UseSound = SoundID.Item1; item.autoReuse = true; item.height = 106; - item.value = Item.buyPrice(0, 36, 0, 0); - item.rare = 5; + item.value = Item.buyPrice(0, 48, 0, 0); + item.rare = 6; item.shootSpeed = 12f; } public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { - Projectile.NewProjectile(target.Center.X, target.Center.Y, 0f, 0f, 612, damage, knockback, Main.myPlayer); - float spread = 180f * 0.0174f; - double startAngle = Math.Atan2(item.shootSpeed, item.shootSpeed)- spread/2; - double deltaAngle = spread/8f; - double offsetAngle; - int i; - if (Main.rand.Next(4) == 0) + if (target.life <= 0) { + Projectile.NewProjectile(target.Center.X, target.Center.Y, 0f, 0f, 612, damage, knockback, Main.myPlayer); + float spread = 180f * 0.0174f; + double startAngle = Math.Atan2(item.shootSpeed, item.shootSpeed) - spread / 2; + double deltaAngle = spread / 8f; + double offsetAngle; + int i; for (i = 0; i < 1; i++ ) { float randomSpeedX = (float)Main.rand.Next(5); @@ -72,8 +73,11 @@ namespace CalamityMod.Items.Weapons ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.BreakerBlade); recipe.AddIngredient(ItemID.HellstoneBar, 10); - recipe.AddIngredient(null, "EssenceofCinder", 2); - recipe.AddTile(TileID.Anvils); + recipe.AddIngredient(null, "EssenceofCinder"); + recipe.AddIngredient(ItemID.SoulofMight, 3); + recipe.AddIngredient(ItemID.SoulofSight, 3); + recipe.AddIngredient(ItemID.SoulofFright, 3); + recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this); recipe.AddRecipe(); } diff --git a/Items/Weapons/Photoviscerator.cs b/Items/Weapons/Photoviscerator.cs index b622ced261..7c338978ff 100644 --- a/Items/Weapons/Photoviscerator.cs +++ b/Items/Weapons/Photoviscerator.cs @@ -36,6 +36,7 @@ namespace CalamityMod.Items.Weapons item.shoot = mod.ProjectileType("ExoFire"); item.shootSpeed = 6f; item.useAmmo = 23; + item.GetGlobalItem(mod).postMoonLordRarity = 15; } public override Vector2? HoldoutOffset() @@ -43,17 +44,6 @@ namespace CalamityMod.Items.Weapons return new Vector2(-15, 0); } - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(108, 45, 199); - } - } - } - public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { float SpeedX = speedX + (float)Main.rand.Next(-5, 6) * 0.05f; @@ -64,7 +54,7 @@ namespace CalamityMod.Items.Weapons public override bool ConsumeAmmo(Player player) { - if (Main.rand.Next(0, 100) <= 90) + if (Main.rand.Next(0, 100) < 90) return false; return true; } diff --git a/Items/Weapons/PlagueKeeper.cs b/Items/Weapons/PlagueKeeper.cs index d186de1663..5e9bf7cd51 100644 --- a/Items/Weapons/PlagueKeeper.cs +++ b/Items/Weapons/PlagueKeeper.cs @@ -1,72 +1,62 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Items; - -namespace CalamityMod.Items.Weapons -{ - public class PlagueKeeper : ModItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Plague Keeper"); - } - - public override void SetDefaults() - { - item.width = 74; - item.damage = 110; - item.melee = true; - item.useAnimation = 18; - item.useStyle = 1; - item.useTime = 18; - item.useTurn = true; - item.knockBack = 6f; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - item.height = 92; - item.value = Item.buyPrice(1, 20, 0, 0); - item.rare = 10; - item.shoot = mod.ProjectileType("PlagueBeeDust"); - item.shootSpeed = 9f; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 200); - } - } - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "VirulentKatana"); - recipe.AddIngredient(ItemID.BeeKeeper); - recipe.AddIngredient(ItemID.FragmentSolar, 10); - recipe.AddIngredient(ItemID.LunarBar, 5); - recipe.AddTile(TileID.LunarCraftingStation); - recipe.SetResult(this); - recipe.AddRecipe(); - } - - public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(mod.BuffType("Plague"), 300); - for (int i = 0; i < 3; i++) - { - int bee = Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, 0f, player.beeType(), - player.beeDamage(item.damage / 3), player.beeKB(0f), player.whoAmI, 0f, 0f); - Main.projectile[bee].penetrate = 1; - } - } - } -} +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.Weapons +{ + public class PlagueKeeper : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Plague Keeper"); + } + + public override void SetDefaults() + { + item.width = 74; + item.damage = 110; + item.melee = true; + item.useAnimation = 18; + item.useStyle = 1; + item.useTime = 18; + item.useTurn = true; + item.knockBack = 6f; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.height = 92; + item.value = Item.buyPrice(1, 20, 0, 0); + item.rare = 10; + item.shoot = mod.ProjectileType("PlagueBeeDust"); + item.shootSpeed = 9f; + item.GetGlobalItem(mod).postMoonLordRarity = 12; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "VirulentKatana"); + recipe.AddIngredient(ItemID.BeeKeeper); + recipe.AddIngredient(ItemID.FragmentSolar, 10); + recipe.AddIngredient(ItemID.LunarBar, 5); + recipe.AddTile(TileID.LunarCraftingStation); + recipe.SetResult(this); + recipe.AddRecipe(); + } + + public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(mod.BuffType("Plague"), 300); + for (int i = 0; i < 3; i++) + { + int bee = Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, 0f, player.beeType(), + player.beeDamage(item.damage / 3), player.beeKB(0f), player.whoAmI, 0f, 0f); + Main.projectile[bee].penetrate = 1; + } + } + } +} diff --git a/Items/Weapons/PlanetaryAnnihilation.cs b/Items/Weapons/PlanetaryAnnihilation.cs index f22b17b925..93c506fe80 100644 --- a/Items/Weapons/PlanetaryAnnihilation.cs +++ b/Items/Weapons/PlanetaryAnnihilation.cs @@ -35,24 +35,14 @@ namespace CalamityMod.Items.Weapons item.shoot = mod.ProjectileType("TerraBall"); item.shootSpeed = 16f; item.useAmmo = 40; - } + item.GetGlobalItem(mod).postMoonLordRarity = 12; + } public override Vector2? HoldoutOffset() { return new Vector2(-5, 0); } - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 200); - } - } - } - public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { float num72 = Main.rand.Next(19, 35); diff --git a/Items/Weapons/PlasmaRifle.cs b/Items/Weapons/PlasmaRifle.cs index a424a1cb71..eed039a8a4 100644 --- a/Items/Weapons/PlasmaRifle.cs +++ b/Items/Weapons/PlasmaRifle.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons public override void SetDefaults() { - item.damage = 422; + item.damage = 460; item.mana = 40; item.magic = true; item.width = 48; @@ -35,18 +35,8 @@ namespace CalamityMod.Items.Weapons item.autoReuse = true; item.shootSpeed = 20f; item.shoot = mod.ProjectileType("PlasmaShot"); - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 200); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 12; + } public override bool AltFunctionUse(Player player) { @@ -81,7 +71,7 @@ namespace CalamityMod.Items.Weapons } else { - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, mod.ProjectileType("PlasmaBolt"), (int)((double)damage * 0.75f), knockBack, player.whoAmI, 0.0f, 0.0f); + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, mod.ProjectileType("PlasmaBolt"), (int)((double)damage * 0.75), knockBack, player.whoAmI, 0.0f, 0.0f); return false; } } diff --git a/Items/Weapons/PlasmaRod.png b/Items/Weapons/PlasmaRod.png index bd48a173f6..89b1a5781b 100644 Binary files a/Items/Weapons/PlasmaRod.png and b/Items/Weapons/PlasmaRod.png differ diff --git a/Items/Weapons/Polterghast/BansheeHook.cs b/Items/Weapons/Polterghast/BansheeHook.cs index 5e1575d900..42d1b6c3f4 100644 --- a/Items/Weapons/Polterghast/BansheeHook.cs +++ b/Items/Weapons/Polterghast/BansheeHook.cs @@ -36,18 +36,8 @@ namespace CalamityMod.Items.Weapons.Polterghast item.rare = 10; item.shoot = mod.ProjectileType("BansheeHook"); item.shootSpeed = 42f; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 0); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 13; + } public override bool CanUseItem(Player player) { diff --git a/Items/Weapons/Polterghast/DaemonsFlame.cs b/Items/Weapons/Polterghast/DaemonsFlame.cs index 2b6f86ba7b..3ed55ff6da 100644 --- a/Items/Weapons/Polterghast/DaemonsFlame.cs +++ b/Items/Weapons/Polterghast/DaemonsFlame.cs @@ -37,18 +37,8 @@ namespace CalamityMod.Items.Weapons.Polterghast item.shoot = mod.ProjectileType("DaemonsFlame"); item.shootSpeed = 20f; item.useAmmo = 40; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 0); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 13; + } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { diff --git a/Items/Weapons/Polterghast/EtherealSubjugator.cs b/Items/Weapons/Polterghast/EtherealSubjugator.cs index 11183aeaee..fdf7fdbad3 100644 --- a/Items/Weapons/Polterghast/EtherealSubjugator.cs +++ b/Items/Weapons/Polterghast/EtherealSubjugator.cs @@ -41,18 +41,8 @@ namespace CalamityMod.Items.Weapons.Polterghast item.shoot = mod.ProjectileType("PhantomGuy"); item.shootSpeed = 10f; item.summon = true; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 0); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 13; + } public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { diff --git a/Items/Weapons/Polterghast/FatesReveal.cs b/Items/Weapons/Polterghast/FatesReveal.cs index 10a7e92b0e..24ad635bf4 100644 --- a/Items/Weapons/Polterghast/FatesReveal.cs +++ b/Items/Weapons/Polterghast/FatesReveal.cs @@ -36,18 +36,8 @@ namespace CalamityMod.Items.Weapons.Polterghast item.autoReuse = true; item.shoot = mod.ProjectileType("FatesReveal"); item.shootSpeed = 1f; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 0); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 13; + } public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { diff --git a/Items/Weapons/Polterghast/GhastlyVisage.cs b/Items/Weapons/Polterghast/GhastlyVisage.cs index d310d908dc..6e35c08123 100644 --- a/Items/Weapons/Polterghast/GhastlyVisage.cs +++ b/Items/Weapons/Polterghast/GhastlyVisage.cs @@ -36,18 +36,8 @@ namespace CalamityMod.Items.Weapons.Polterghast item.rare = 10; item.shootSpeed = 9f; item.shoot = mod.ProjectileType("GhastlyVisage"); - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 0); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 13; + } public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { diff --git a/Items/Weapons/Polterghast/TerrorBlade.cs b/Items/Weapons/Polterghast/TerrorBlade.cs index 24ff0cdf8b..433053511e 100644 --- a/Items/Weapons/Polterghast/TerrorBlade.cs +++ b/Items/Weapons/Polterghast/TerrorBlade.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Polterghast public override void SetDefaults() { item.width = 88; - item.damage = 262; + item.damage = 250; item.melee = true; item.useAnimation = 18; item.useTime = 18; @@ -33,18 +33,8 @@ namespace CalamityMod.Items.Weapons.Polterghast item.rare = 10; item.shoot = mod.ProjectileType("TerrorBeam"); item.shootSpeed = 20f; + item.GetGlobalItem(mod).postMoonLordRarity = 13; } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 0); - } - } - } public override void MeleeEffects(Player player, Rectangle hitbox) { diff --git a/Items/Weapons/PrimordialAncient.cs b/Items/Weapons/PrimordialAncient.cs index 6cdd9b3f8f..4a00479911 100644 --- a/Items/Weapons/PrimordialAncient.cs +++ b/Items/Weapons/PrimordialAncient.cs @@ -35,18 +35,8 @@ namespace CalamityMod.Items.Weapons item.autoReuse = true; item.shoot = mod.ProjectileType("Ancient"); item.shootSpeed = 8f; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(43, 96, 222); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 14; + } public override void AddRecipes() { diff --git a/Items/Weapons/Providence/BlissfulBombardier.cs b/Items/Weapons/Providence/BlissfulBombardier.cs index 3e8887447f..b76043617d 100644 --- a/Items/Weapons/Providence/BlissfulBombardier.cs +++ b/Items/Weapons/Providence/BlissfulBombardier.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Providence public override void SetDefaults() { - item.damage = 85; + item.damage = 62; item.ranged = true; item.width = 76; item.height = 30; @@ -35,24 +35,14 @@ namespace CalamityMod.Items.Weapons.Providence item.shootSpeed = 24f; item.shoot = mod.ProjectileType("Nuke"); item.useAmmo = 771; - } + item.GetGlobalItem(mod).postMoonLordRarity = 12; + } public override Vector2? HoldoutOffset() { return new Vector2(-10, 0); } - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 200); - } - } - } - public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { Projectile.NewProjectile(position.X, position.Y, speedX, speedY, mod.ProjectileType("Nuke"), damage, knockBack, player.whoAmI, 0.0f, 0.0f); diff --git a/Items/Weapons/Providence/HolyCollider.cs b/Items/Weapons/Providence/HolyCollider.cs index 33dfe3ac33..556a26cd7f 100644 --- a/Items/Weapons/Providence/HolyCollider.cs +++ b/Items/Weapons/Providence/HolyCollider.cs @@ -33,18 +33,8 @@ namespace CalamityMod.Items.Weapons.Providence item.value = Item.buyPrice(1, 20, 0, 0); item.rare = 10; item.shootSpeed = 10f; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 200); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 12; + } public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { @@ -56,8 +46,8 @@ namespace CalamityMod.Items.Weapons.Providence for (i = 0; i < 4; i++) { offsetAngle = (startAngle + deltaAngle * (i + i * i) / 2f) + 32f * i; - Projectile.NewProjectile(target.Center.X, target.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), mod.ProjectileType("HolyColliderHolyFire"), (int)((double)((float)item.damage * player.meleeDamage) * 0.4), knockback, Main.myPlayer); - Projectile.NewProjectile(target.Center.X, target.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), mod.ProjectileType("HolyColliderHolyFire"), (int)((double)((float)item.damage * player.meleeDamage) * 0.4), knockback, Main.myPlayer); + Projectile.NewProjectile(target.Center.X, target.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), mod.ProjectileType("HolyColliderHolyFire"), (int)((double)((float)item.damage * player.meleeDamage) * 0.3), knockback, Main.myPlayer); + Projectile.NewProjectile(target.Center.X, target.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), mod.ProjectileType("HolyColliderHolyFire"), (int)((double)((float)item.damage * player.meleeDamage) * 0.3), knockback, Main.myPlayer); } } } diff --git a/Items/Weapons/Providence/PurgeGuzzler.cs b/Items/Weapons/Providence/PurgeGuzzler.cs index 263d8f322b..bd9dd1601d 100644 --- a/Items/Weapons/Providence/PurgeGuzzler.cs +++ b/Items/Weapons/Providence/PurgeGuzzler.cs @@ -35,18 +35,8 @@ namespace CalamityMod.Items.Weapons.Providence item.autoReuse = true; item.shoot = mod.ProjectileType("HolyLaser"); item.shootSpeed = 6f; + item.GetGlobalItem(mod).postMoonLordRarity = 12; } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 200); - } - } - } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { diff --git a/Items/Weapons/Providence/SolarFlare.cs b/Items/Weapons/Providence/SolarFlare.cs index 21321b37f0..0feafa0cc9 100644 --- a/Items/Weapons/Providence/SolarFlare.cs +++ b/Items/Weapons/Providence/SolarFlare.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Providence public override void SetDefaults() { item.CloneDefaults(ItemID.TheEyeOfCthulhu); - item.damage = 50; + item.damage = 60; item.useTime = 20; item.useAnimation = 20; item.useStyle = 5; @@ -31,18 +31,8 @@ namespace CalamityMod.Items.Weapons.Providence item.rare = 10; item.autoReuse = true; item.shoot = mod.ProjectileType("SolarFlareYoyo"); - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 200); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 12; + } public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { diff --git a/Items/Weapons/Providence/TelluricGlare.cs b/Items/Weapons/Providence/TelluricGlare.cs index ebe385106e..c2522e6c96 100644 --- a/Items/Weapons/Providence/TelluricGlare.cs +++ b/Items/Weapons/Providence/TelluricGlare.cs @@ -6,7 +6,6 @@ using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Items; -//using TerrariaOverhaul; namespace CalamityMod.Items.Weapons.Providence { @@ -35,23 +34,8 @@ namespace CalamityMod.Items.Weapons.Providence item.shoot = mod.ProjectileType("TelluricGlare"); item.shootSpeed = 12f; item.useAmmo = 40; - } - - /*public void OverhaulInit() - { - this.SetTag("bow"); - }*/ - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 200); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 12; + } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { diff --git a/Items/Weapons/Pumpler.cs b/Items/Weapons/Pumpler.cs index 9eb7ff8194..7159feb74b 100644 --- a/Items/Weapons/Pumpler.cs +++ b/Items/Weapons/Pumpler.cs @@ -52,7 +52,7 @@ namespace CalamityMod.Items.Weapons public override bool ConsumeAmmo(Player player) { - if (Main.rand.Next(0, 100) <= 33) + if (Main.rand.Next(0, 100) < 33) return false; return true; } diff --git a/Items/Weapons/RedSun.cs b/Items/Weapons/RedSun.cs index d7dd54f197..5402460f1b 100644 --- a/Items/Weapons/RedSun.cs +++ b/Items/Weapons/RedSun.cs @@ -35,18 +35,8 @@ namespace CalamityMod.Items.Weapons item.rare = 10; item.shoot = mod.ProjectileType("SolarFlare"); item.shootSpeed = 15f; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(255, 0, 255); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 16; + } public override void AddRecipes() { diff --git a/Items/Weapons/RoyalKnivesMelee.cs b/Items/Weapons/RoyalKnivesMelee.cs index 20e3866fd3..d6ee04a32f 100644 --- a/Items/Weapons/RoyalKnivesMelee.cs +++ b/Items/Weapons/RoyalKnivesMelee.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons public override void SetDefaults() { item.width = 18; - item.damage = 1320; + item.damage = 1600; item.melee = true; item.noMelee = true; item.noUseGraphic = true; @@ -34,18 +34,8 @@ namespace CalamityMod.Items.Weapons item.rare = 10; item.shoot = mod.ProjectileType("RoyalKnifeMelee"); item.shootSpeed = 9f; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(255, 0, 255); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 16; + } public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { diff --git a/Items/Weapons/SDFMG.cs b/Items/Weapons/SDFMG.cs index 9ff4dcdc8c..a780636ed6 100644 --- a/Items/Weapons/SDFMG.cs +++ b/Items/Weapons/SDFMG.cs @@ -36,18 +36,8 @@ namespace CalamityMod.Items.Weapons item.shoot = 10; item.shootSpeed = 16f; item.useAmmo = 97; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(43, 96, 222); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 14; + } public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { @@ -63,7 +53,7 @@ namespace CalamityMod.Items.Weapons public override bool ConsumeAmmo(Player player) { - if (Main.rand.Next(0, 100) <= 50) + if (Main.rand.Next(0, 100) < 50) return false; return true; } diff --git a/Items/Weapons/SHPC.cs b/Items/Weapons/SHPC.cs index 773af671d3..504921fdcf 100644 --- a/Items/Weapons/SHPC.cs +++ b/Items/Weapons/SHPC.cs @@ -38,18 +38,8 @@ namespace CalamityMod.Items.Weapons item.autoReuse = true; item.shoot = mod.ProjectileType("SHPB"); item.shootSpeed = 20f; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(255, Main.DiscoG, 155); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 17; + } public override Vector2? HoldoutOffset() { diff --git a/Items/Weapons/SanguineFlare.cs b/Items/Weapons/SanguineFlare.cs index 1e76602cdf..04f45a4d0a 100644 --- a/Items/Weapons/SanguineFlare.cs +++ b/Items/Weapons/SanguineFlare.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons public override void SetDefaults() { - item.damage = 500; + item.damage = 220; item.magic = true; item.mana = 22; item.width = 56; @@ -36,18 +36,8 @@ namespace CalamityMod.Items.Weapons item.autoReuse = true; item.shoot = mod.ProjectileType("SanguineFlare"); item.shootSpeed = 14f; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 0); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 13; + } public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { diff --git a/Items/Weapons/Scorpion.cs b/Items/Weapons/Scorpion.cs index 5c234de04b..2e78e61659 100644 --- a/Items/Weapons/Scorpion.cs +++ b/Items/Weapons/Scorpion.cs @@ -61,7 +61,7 @@ namespace CalamityMod.Items.Weapons { if (player.altFunctionUse == 2) { - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, mod.ProjectileType("BigNuke"), (int)((double)damage * 3f), knockBack, player.whoAmI, 0.0f, 0.0f); + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, mod.ProjectileType("BigNuke"), (int)((double)damage * 3.0), knockBack, player.whoAmI, 0.0f, 0.0f); return false; } else diff --git a/Items/Weapons/ScourgeoftheCosmos.cs b/Items/Weapons/ScourgeoftheCosmos.cs index 89ad45d36e..56380123a0 100644 --- a/Items/Weapons/ScourgeoftheCosmos.cs +++ b/Items/Weapons/ScourgeoftheCosmos.cs @@ -34,19 +34,9 @@ namespace CalamityMod.Items.Weapons item.rare = 10; item.shoot = mod.ProjectileType("ScourgeoftheCosmos"); item.shootSpeed = 15f; + item.GetGlobalItem(mod).postMoonLordRarity = 14; } - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(43, 96, 222); - } - } - } - public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); diff --git a/Items/Weapons/ScourgeoftheCosmos.png b/Items/Weapons/ScourgeoftheCosmos.png index bc1fc66277..f5b527abdf 100644 Binary files a/Items/Weapons/ScourgeoftheCosmos.png and b/Items/Weapons/ScourgeoftheCosmos.png differ diff --git a/Items/Weapons/Seadragon.cs b/Items/Weapons/Seadragon.cs index 00c016c13a..0614217147 100644 --- a/Items/Weapons/Seadragon.cs +++ b/Items/Weapons/Seadragon.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons public override void SetDefaults() { - item.damage = 158; + item.damage = 110; item.ranged = true; item.width = 78; item.height = 26; @@ -35,18 +35,8 @@ namespace CalamityMod.Items.Weapons item.shoot = 10; item.shootSpeed = 16f; item.useAmmo = 97; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 0); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 13; + } public override Vector2? HoldoutOffset() { @@ -67,7 +57,7 @@ namespace CalamityMod.Items.Weapons public override bool ConsumeAmmo(Player player) { - if (Main.rand.Next(0, 100) <= 50) + if (Main.rand.Next(0, 100) < 50) return false; return true; } diff --git a/Items/Weapons/ShadowboltStaff.cs b/Items/Weapons/ShadowboltStaff.cs index de2af9a076..4733e9313f 100644 --- a/Items/Weapons/ShadowboltStaff.cs +++ b/Items/Weapons/ShadowboltStaff.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons public override void SetDefaults() { - item.damage = 126; + item.damage = 170; item.magic = true; item.mana = 20; item.width = 58; @@ -36,24 +36,14 @@ namespace CalamityMod.Items.Weapons item.autoReuse = true; item.shoot = mod.ProjectileType("Shadowbolt"); item.shootSpeed = 6f; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 0); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 13; + } public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(null, "ArmoredShell", 3); - recipe.AddIngredient(null, "Phantoplasm", 5); + recipe.AddIngredient(null, "RuinousSoul", 2); recipe.AddIngredient(ItemID.ShadowbeamStaff); recipe.AddTile(TileID.LunarCraftingStation); recipe.SetResult(this); diff --git a/Items/Weapons/Shredder.cs b/Items/Weapons/Shredder.cs index 6321ad6feb..e30c360664 100644 --- a/Items/Weapons/Shredder.cs +++ b/Items/Weapons/Shredder.cs @@ -38,19 +38,9 @@ namespace CalamityMod.Items.Weapons item.shoot = 10; item.shootSpeed = 12f; item.useAmmo = 97; + item.GetGlobalItem(mod).postMoonLordRarity = 12; } - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 200); - } - } - } - public override Vector2? HoldoutOffset() { return new Vector2(-5, 0); @@ -63,10 +53,10 @@ namespace CalamityMod.Items.Weapons public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { + int bulletAmt = 4; if (player.altFunctionUse == 2) { - int num6 = Main.rand.Next(5, 12); - for (int index = 0; index < num6; ++index) + for (int index = 0; index < bulletAmt; ++index) { float num7 = speedX; float num8 = speedY; @@ -79,14 +69,13 @@ namespace CalamityMod.Items.Weapons } else { - int num6 = Main.rand.Next(5, 12); - for (int index = 0; index < num6; ++index) + for (int index = 0; index < bulletAmt; ++index) { float num7 = speedX; float num8 = speedY; float SpeedX = speedX + (float) Main.rand.Next(-30, 31) * 0.05f; float SpeedY = speedY + (float) Main.rand.Next(-30, 31) * 0.05f; - int shot = Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, mod.ProjectileType("ChargedBlast"), (int)((double)damage * 1.2), knockBack, player.whoAmI, 0.0f, 0.0f); + int shot = Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, mod.ProjectileType("ChargedBlast"), damage, knockBack, player.whoAmI, 0.0f, 0.0f); Main.projectile[shot].timeLeft = 180; } return false; diff --git a/Items/Weapons/SlimeGod/OverloadedBlaster.cs b/Items/Weapons/SlimeGod/OverloadedBlaster.cs index e227a2d531..89b69861b0 100644 --- a/Items/Weapons/SlimeGod/OverloadedBlaster.cs +++ b/Items/Weapons/SlimeGod/OverloadedBlaster.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Items.Weapons.SlimeGod public override bool ConsumeAmmo(Player player) { - if (Main.rand.Next(0, 100) <= 33) + if (Main.rand.Next(0, 100) < 33) return false; return true; } diff --git a/Items/Weapons/SolsticeClaymore.cs b/Items/Weapons/SolsticeClaymore.cs index 936f74b9bf..658c87fa91 100644 --- a/Items/Weapons/SolsticeClaymore.cs +++ b/Items/Weapons/SolsticeClaymore.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons public override void SetDefaults() { item.width = 86; - item.damage = 315; + item.damage = 470; item.melee = true; item.useAnimation = 16; item.useStyle = 1; @@ -34,18 +34,8 @@ namespace CalamityMod.Items.Weapons item.rare = 10; item.shoot = mod.ProjectileType("SolsticeBeam"); item.shootSpeed = 16f; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 200); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 12; + } public override void AddRecipes() { diff --git a/Items/Weapons/SomaPrime.cs b/Items/Weapons/SomaPrime.cs index 4dcf02a515..5754c5bd0d 100644 --- a/Items/Weapons/SomaPrime.cs +++ b/Items/Weapons/SomaPrime.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons public override void SetDefaults() { - item.damage = 400; + item.damage = 600; item.ranged = true; item.width = 94; item.height = 34; @@ -35,18 +35,8 @@ namespace CalamityMod.Items.Weapons item.shoot = mod.ProjectileType("SlashRound"); item.shootSpeed = 30f; item.useAmmo = 97; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(255, 0, 255); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 16; + } public override Vector2? HoldoutOffset() { @@ -74,7 +64,7 @@ namespace CalamityMod.Items.Weapons public override bool ConsumeAmmo(Player player) { - if (Main.rand.Next(0, 100) <= 50) + if (Main.rand.Next(0, 100) < 50) return false; return true; } diff --git a/Items/Weapons/SoulHarvester.png b/Items/Weapons/SoulHarvester.png index d047f2a0dd..5b55262a00 100644 Binary files a/Items/Weapons/SoulHarvester.png and b/Items/Weapons/SoulHarvester.png differ diff --git a/Items/Weapons/SoulPiercer.cs b/Items/Weapons/SoulPiercer.cs index 171a1e3c81..8b4be85d64 100644 --- a/Items/Weapons/SoulPiercer.cs +++ b/Items/Weapons/SoulPiercer.cs @@ -35,18 +35,8 @@ namespace CalamityMod.Items.Weapons item.autoReuse = true; item.shoot = mod.ProjectileType("SoulPiercer"); item.shootSpeed = 6f; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(43, 96, 222); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 14; + } public override void AddRecipes() { diff --git a/Items/Weapons/SpatialLance.cs b/Items/Weapons/SpatialLance.cs index 7d906620fa..09dbb97ca1 100644 --- a/Items/Weapons/SpatialLance.cs +++ b/Items/Weapons/SpatialLance.cs @@ -36,18 +36,8 @@ namespace CalamityMod.Items.Weapons item.rare = 10; item.shoot = mod.ProjectileType("SpatialLanceProjectile"); item.shootSpeed = 12f; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 200); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 12; + } public override bool CanUseItem(Player player) { diff --git a/Items/Weapons/SpectralstormCannon.cs b/Items/Weapons/SpectralstormCannon.cs index e74cc902dc..814e9ab722 100644 --- a/Items/Weapons/SpectralstormCannon.cs +++ b/Items/Weapons/SpectralstormCannon.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Items.Weapons public override bool ConsumeAmmo(Player player) { - if (Main.rand.Next(0, 100) <= 70) + if (Main.rand.Next(0, 100) < 70) return false; return true; } diff --git a/Items/Weapons/SpectreRifle.cs b/Items/Weapons/SpectreRifle.cs index bca19186e9..65ad15bc60 100644 --- a/Items/Weapons/SpectreRifle.cs +++ b/Items/Weapons/SpectreRifle.cs @@ -20,8 +20,8 @@ namespace CalamityMod.Items.Weapons { item.damage = 150; item.ranged = true; - item.width = 68; - item.height = 24; + item.width = 88; + item.height = 30; item.crit += 22; item.useTime = 25; item.useAnimation = 25; @@ -37,7 +37,12 @@ namespace CalamityMod.Items.Weapons item.useAmmo = 97; } - public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + public override Vector2? HoldoutOffset() + { + return new Vector2(-10, 0); + } + + public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { Projectile.NewProjectile(position.X, position.Y, speedX, speedY, 297, damage, knockBack, player.whoAmI, 1f, 0.0f); return false; diff --git a/Items/Weapons/SpectreRifle.png b/Items/Weapons/SpectreRifle.png index 1bf30289f4..3e8d35c724 100644 Binary files a/Items/Weapons/SpectreRifle.png and b/Items/Weapons/SpectreRifle.png differ diff --git a/Items/Weapons/Spyker.cs b/Items/Weapons/Spyker.cs index e6779b9799..725e84f042 100644 --- a/Items/Weapons/Spyker.cs +++ b/Items/Weapons/Spyker.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons public override void SetDefaults() { - item.damage = 182; + item.damage = 170; item.ranged = true; item.width = 44; item.height = 26; @@ -35,18 +35,8 @@ namespace CalamityMod.Items.Weapons item.shootSpeed = 9f; item.shoot = mod.ProjectileType("Spyker"); item.useAmmo = 97; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 200); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 12; + } public override Vector2? HoldoutOffset() { diff --git a/Items/Weapons/StarCannonEX.png b/Items/Weapons/StarCannonEX.png index 58968eafee..fdb8ecbc56 100644 Binary files a/Items/Weapons/StarCannonEX.png and b/Items/Weapons/StarCannonEX.png differ diff --git a/Items/Weapons/StardustStaff.png b/Items/Weapons/StardustStaff.png index 64823415e9..fd2a63f679 100644 Binary files a/Items/Weapons/StardustStaff.png and b/Items/Weapons/StardustStaff.png differ diff --git a/Items/Weapons/Starfleet.cs b/Items/Weapons/Starfleet.cs index a9e7c5e9c7..b847c02e49 100644 --- a/Items/Weapons/Starfleet.cs +++ b/Items/Weapons/Starfleet.cs @@ -34,6 +34,7 @@ namespace CalamityMod.Items.Weapons item.shoot = mod.ProjectileType("PlasmaBlast"); item.shootSpeed = 12f; item.useAmmo = 75; + item.GetGlobalItem(mod).postMoonLordRarity = 12; } public override Vector2? HoldoutOffset() @@ -41,21 +42,9 @@ namespace CalamityMod.Items.Weapons return new Vector2(-5, 0); } - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 200); - } - } - } - public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - int num6 = Main.rand.Next(5, 6); - for (int index = 0; index < num6; ++index) + for (int index = 0; index < 5; ++index) { float num7 = speedX; float num8 = speedY; diff --git a/Items/Weapons/StarfleetMK2.cs b/Items/Weapons/StarfleetMK2.cs index ee3d585995..2956b7ebb0 100644 --- a/Items/Weapons/StarfleetMK2.cs +++ b/Items/Weapons/StarfleetMK2.cs @@ -38,24 +38,14 @@ namespace CalamityMod.Items.Weapons item.useTurn = false; item.useAmmo = 75; item.autoReuse = true; - } + item.GetGlobalItem(mod).postMoonLordRarity = 14; + } public override Vector2? HoldoutOffset() { return new Vector2(-10, 0); } - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(43, 96, 222); - } - } - } - public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { Projectile.NewProjectile(position.X, position.Y, speedX, speedY, mod.ProjectileType("StarfleetMK2"), 0, 0f, player.whoAmI); diff --git a/Items/Weapons/StellarStriker.cs b/Items/Weapons/StellarStriker.cs index 2e81505f15..19aba350d3 100644 --- a/Items/Weapons/StellarStriker.cs +++ b/Items/Weapons/StellarStriker.cs @@ -33,19 +33,9 @@ namespace CalamityMod.Items.Weapons item.value = Item.buyPrice(1, 20, 0, 0); item.rare = 10; item.shootSpeed = 12f; + item.GetGlobalItem(mod).postMoonLordRarity = 12; } - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 200); - } - } - } - public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { if (target.type == NPCID.TargetDummy) @@ -98,7 +88,7 @@ namespace CalamityMod.Items.Weapons num79 *= num80; float num114 = num78; float num115 = num79 + (float)Main.rand.Next(-80, 81) * 0.02f; - Projectile.NewProjectile(vector2.X, vector2.Y, num114, num115, 645, (int)((float)item.damage * player.meleeDamage), knockback, i, 0f, (float)Main.rand.Next(3)); + Projectile.NewProjectile(vector2.X, vector2.Y, num114, num115, 645, (int)((double)((float)item.damage * player.meleeDamage) * 0.7), knockback, i, 0f, (float)Main.rand.Next(3)); } } diff --git a/Items/Weapons/StormDragoon.cs b/Items/Weapons/StormDragoon.cs index d370b28229..1a558e7867 100644 --- a/Items/Weapons/StormDragoon.cs +++ b/Items/Weapons/StormDragoon.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons public override void SetDefaults() { - item.damage = 135; + item.damage = 90; item.ranged = true; item.width = 74; item.height = 34; @@ -35,18 +35,8 @@ namespace CalamityMod.Items.Weapons item.shoot = 10; item.shootSpeed = 18f; item.useAmmo = 97; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 0); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 13; + } public override Vector2? HoldoutOffset() { @@ -63,7 +53,7 @@ namespace CalamityMod.Items.Weapons public override bool ConsumeAmmo(Player player) { - if (Main.rand.Next(0, 100) <= 90) + if (Main.rand.Next(0, 100) < 90) return false; return true; } diff --git a/Items/Weapons/StreamGouge.cs b/Items/Weapons/StreamGouge.cs index d0ba58d4ca..0bdaceeee5 100644 --- a/Items/Weapons/StreamGouge.cs +++ b/Items/Weapons/StreamGouge.cs @@ -36,18 +36,8 @@ namespace CalamityMod.Items.Weapons item.rare = 10; item.shoot = mod.ProjectileType("StreamGouge"); item.shootSpeed = 15f; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(43, 96, 222); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 14; + } public override bool CanUseItem(Player player) { diff --git a/Items/Weapons/SubsumingVortex.cs b/Items/Weapons/SubsumingVortex.cs index 1e6f8cc1d6..d5d4fdb196 100644 --- a/Items/Weapons/SubsumingVortex.cs +++ b/Items/Weapons/SubsumingVortex.cs @@ -35,18 +35,8 @@ namespace CalamityMod.Items.Weapons item.autoReuse = true; item.shoot = mod.ProjectileType("Vortex"); item.shootSpeed = 9f; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(108, 45, 199); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 15; + } public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { diff --git a/Items/Weapons/SunSpiritStaff.cs b/Items/Weapons/SunSpiritStaff.cs index 1544a08260..90beef401b 100644 --- a/Items/Weapons/SunSpiritStaff.cs +++ b/Items/Weapons/SunSpiritStaff.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons public override void SetDefaults() { - item.damage = 6; + item.damage = 12; item.mana = 10; item.width = 44; item.height = 42; diff --git a/Items/Weapons/SunkenSea/AquamarineStaff.cs b/Items/Weapons/SunkenSea/AquamarineStaff.cs new file mode 100644 index 0000000000..ff5902e3b1 --- /dev/null +++ b/Items/Weapons/SunkenSea/AquamarineStaff.cs @@ -0,0 +1,72 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.Weapons.SunkenSea +{ + public class AquamarineStaff : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Aquamarine Staff"); + Tooltip.SetDefault("Shoots two blue bolts"); + Item.staff[item.type] = true; + } + + public override void SetDefaults() + { + item.damage = 10; + item.magic = true; + item.mana = 3; + item.width = 38; + item.height = 38; + item.useTime = 15; + item.useAnimation = 15; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 2.5f; + item.value = Item.buyPrice(0, 2, 0, 0); + item.rare = 2; + item.UseSound = SoundID.Item43; + item.autoReuse = true; + item.shoot = mod.ProjectileType("AquamarineBolt"); + item.shootSpeed = 9f; + } + + public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + int num6 = Main.rand.Next(2, 3); + for (int index = 0; index < num6; ++index) + { + float SpeedX = speedX + (float) Main.rand.Next(-30, 31) * 0.05f; + float SpeedY = speedY + (float) Main.rand.Next(-30, 31) * 0.05f; + int projectile = Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI, 0.0f, 0.0f); + Main.projectile[projectile].timeLeft = 180; + } + return false; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.RubyStaff); + recipe.AddIngredient(null, "SeaPrism", 5); + recipe.AddIngredient(null, "Navystone", 25); + recipe.AddTile(TileID.Anvils); + recipe.SetResult(this); + recipe.AddRecipe(); + recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.DiamondStaff); + recipe.AddIngredient(null, "SeaPrism", 5); + recipe.AddIngredient(null, "Navystone", 25); + recipe.AddTile(TileID.Anvils); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} \ No newline at end of file diff --git a/Items/Weapons/SunkenSea/AquamarineStaff.png b/Items/Weapons/SunkenSea/AquamarineStaff.png new file mode 100644 index 0000000000..e21c19d43e Binary files /dev/null and b/Items/Weapons/SunkenSea/AquamarineStaff.png differ diff --git a/Items/Weapons/SunkenSea/AquashardShotgun.cs b/Items/Weapons/SunkenSea/AquashardShotgun.cs new file mode 100644 index 0000000000..bf00cc4a5b --- /dev/null +++ b/Items/Weapons/SunkenSea/AquashardShotgun.cs @@ -0,0 +1,70 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.Weapons.SunkenSea +{ + public class AquashardShotgun : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Aquashard Shotgun"); + Tooltip.SetDefault("Shoots aquashards which split upon hitting an enemy"); + } + + public override void SetDefaults() + { + item.damage = 12; + item.ranged = true; + item.width = 62; + item.height = 26; + item.crit += 6; + item.useTime = 25; + item.useAnimation = 25; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 5.5f; + item.value = Item.buyPrice(0, 2, 0, 0); + item.rare = 2; + item.UseSound = SoundID.Item61; + item.autoReuse = true; + item.shoot = mod.ProjectileType("Aquashard"); + item.shootSpeed = 22f; + } + + public override Vector2? HoldoutOffset() + { + return new Vector2(-10, 0); + } + + public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + int num6 = Main.rand.Next(2, 4); + for (int index = 0; index < num6; ++index) + { + float SpeedX = speedX + (float) Main.rand.Next(-40, 41) * 0.05f; + float SpeedY = speedY + (float) Main.rand.Next(-40, 41) * 0.05f; + int projectile = Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI, 0.0f, 0.0f); + Main.projectile[projectile].timeLeft = 200; + } + return false; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Boomstick); + recipe.AddIngredient(null, "SeaPrism", 5); + recipe.AddIngredient(null, "PrismShard", 5); + recipe.AddIngredient(null, "Navystone", 25); + recipe.AddTile(TileID.Anvils); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} \ No newline at end of file diff --git a/Items/Weapons/SunkenSea/AquashardShotgun.png b/Items/Weapons/SunkenSea/AquashardShotgun.png new file mode 100644 index 0000000000..516b1fa7cc Binary files /dev/null and b/Items/Weapons/SunkenSea/AquashardShotgun.png differ diff --git a/Items/Weapons/SunkenSea/ClamCrusher.cs b/Items/Weapons/SunkenSea/ClamCrusher.cs new file mode 100644 index 0000000000..4179fbc59c --- /dev/null +++ b/Items/Weapons/SunkenSea/ClamCrusher.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.Weapons.SunkenSea +{ + public class ClamCrusher : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Clam Crusher"); + Tooltip.SetDefault("Launches a huge clam that stuns enemies for a short amount of time\n" + + "Starts being affected by gravity and does much more damage after being airborne for a while"); + } + + public override void SetDefaults() + { + item.damage = 140; + item.melee = true; + item.width = 40; + item.height = 60; + item.useTime = 50; + item.useAnimation = 50; + item.useStyle = 5; + item.noMelee = true; + item.noUseGraphic = true; + item.knockBack = 10f; + item.value = Item.buyPrice(0, 36, 0, 0); + item.rare = 5; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.channel = true; + item.shoot = mod.ProjectileType("ClamCrusherFlail"); + item.shootSpeed = 18f; + } + } +} \ No newline at end of file diff --git a/Items/Weapons/SunkenSea/ClamCrusher.png b/Items/Weapons/SunkenSea/ClamCrusher.png new file mode 100644 index 0000000000..f860b943b2 Binary files /dev/null and b/Items/Weapons/SunkenSea/ClamCrusher.png differ diff --git a/Items/Weapons/SunkenSea/ClamorRifle.cs b/Items/Weapons/SunkenSea/ClamorRifle.cs new file mode 100644 index 0000000000..3d150ba3ac --- /dev/null +++ b/Items/Weapons/SunkenSea/ClamorRifle.cs @@ -0,0 +1,51 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.Weapons.SunkenSea +{ + public class ClamorRifle : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Clamor Rifle"); + Tooltip.SetDefault("Shoots homing energy bolts"); + } + + public override void SetDefaults() + { + item.damage = 32; + item.ranged = true; + item.width = 64; + item.height = 30; + item.useTime = 13; + item.useAnimation = 13; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 2.5f; + item.value = Item.buyPrice(0, 36, 0, 0); + item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/PlasmaBolt"); + item.autoReuse = true; + item.rare = 5; + item.shoot = mod.ProjectileType("ClamorRifleProj"); + item.shootSpeed = 15f; + item.useAmmo = 97; + } + + public override Vector2? HoldoutOffset() + { + return new Vector2(-5, 0); + } + + public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, mod.ProjectileType("ClamorRifleProj"), damage, knockBack, player.whoAmI, 0.0f, 0.0f); + return false; + } + } +} \ No newline at end of file diff --git a/Items/Weapons/SunkenSea/ClamorRifle.png b/Items/Weapons/SunkenSea/ClamorRifle.png new file mode 100644 index 0000000000..8545e91138 Binary files /dev/null and b/Items/Weapons/SunkenSea/ClamorRifle.png differ diff --git a/Items/Weapons/SunkenSea/EutrophicScimitar.cs b/Items/Weapons/SunkenSea/EutrophicScimitar.cs new file mode 100644 index 0000000000..ea075c80f8 --- /dev/null +++ b/Items/Weapons/SunkenSea/EutrophicScimitar.cs @@ -0,0 +1,47 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.SunkenSea +{ + public class EutrophicScimitar : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Eutrophic Scimitar"); + Tooltip.SetDefault("Fires a beam upon swing that stuns enemies"); + } + + public override void SetDefaults() + { + item.damage = 130; + item.melee = true; + item.width = 46; + item.height = 76; + item.useTime = 38; + item.useAnimation = 38; + item.useStyle = 1; + item.knockBack = 2; + item.shoot = mod.ProjectileType("EutrophicScimitarProj"); + item.shootSpeed = 17; + item.value = Item.buyPrice(0, 36, 0, 0); + item.rare = 5; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.useTurn = true; + } + + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + for (int i = 0; i <= 21; i++) + { + Dust dust; + dust = Main.dust[Terraria.Dust.NewDust(new Vector2(position.X - 58 / 2, position.Y - 58 / 2), 58, 58, 226, 0f, 0f, 0, new Color(255, 255, 255), 0.4605263f)]; + dust.noGravity = true; + dust.fadeIn = 0.9473684f; + } + return true; + } + } +} diff --git a/Items/Weapons/SunkenSea/EutrophicScimitar.png b/Items/Weapons/SunkenSea/EutrophicScimitar.png new file mode 100644 index 0000000000..e1ea0cabc0 Binary files /dev/null and b/Items/Weapons/SunkenSea/EutrophicScimitar.png differ diff --git a/Items/Weapons/SunkenSea/EutrophicShank.cs b/Items/Weapons/SunkenSea/EutrophicShank.cs new file mode 100644 index 0000000000..ece14e02d0 --- /dev/null +++ b/Items/Weapons/SunkenSea/EutrophicShank.cs @@ -0,0 +1,59 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.SunkenSea +{ + public class EutrophicShank : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Eutrophic Shank"); + Tooltip.SetDefault("Shoots electric sparks"); + } + + public override void SetDefaults() + { + item.useStyle = 3; + item.useTurn = false; + item.useAnimation = 14; + item.useTime = 14; + item.width = 42; + item.height = 38; + item.damage = 24; + item.melee = true; + item.knockBack = 4f; + item.UseSound = SoundID.Item1; + item.useTurn = true; + item.autoReuse = true; + item.value = Item.buyPrice(0, 2, 0, 0); + item.rare = 2; + item.shoot = mod.ProjectileType("EutrophicSpark"); + item.shootSpeed = 3f; + } + + public override void MeleeEffects(Player player, Rectangle hitbox) + { + if (Main.rand.Next(3) == 0) + { + int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 206, 0f, 0f, 100, default(Color), 1f); + } + } + + public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + int num6 = Main.rand.Next(1, 2); + for (int index = 0; index < num6; ++index) + { + float SpeedX = speedX + (float) Main.rand.Next(-60, 61) * 0.05f; + float SpeedY = speedY + (float) Main.rand.Next(-60, 61) * 0.05f; + int projectile = Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, (int)((double)damage * 0.4), knockBack, player.whoAmI, 0.0f, 0.0f); + } + return false; + } + } +} diff --git a/Items/Weapons/SunkenSea/EutrophicShank.png b/Items/Weapons/SunkenSea/EutrophicShank.png new file mode 100644 index 0000000000..b3cc388ab2 Binary files /dev/null and b/Items/Weapons/SunkenSea/EutrophicShank.png differ diff --git a/Items/Weapons/SunkenSea/Poseidon.cs b/Items/Weapons/SunkenSea/Poseidon.cs new file mode 100644 index 0000000000..f4d73a9d61 --- /dev/null +++ b/Items/Weapons/SunkenSea/Poseidon.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.Weapons.SunkenSea +{ + public class Poseidon : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Poseidon"); + Tooltip.SetDefault("Casts a poseidon typhoon"); + } + + public override void SetDefaults() + { + item.damage = 58; + item.magic = true; + item.mana = 15; + item.width = 28; + item.height = 32; + item.useTime = 22; + item.useAnimation = 22; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 6f; + item.value = Item.buyPrice(0, 36, 0, 0); + item.UseSound = SoundID.Item84; + item.rare = 5; + item.autoReuse = true; + item.shoot = mod.ProjectileType("PoseidonTyphoon"); + item.shootSpeed = 10f; + } + } +} \ No newline at end of file diff --git a/Items/Weapons/SunkenSea/Poseidon.png b/Items/Weapons/SunkenSea/Poseidon.png new file mode 100644 index 0000000000..fb94e6f499 Binary files /dev/null and b/Items/Weapons/SunkenSea/Poseidon.png differ diff --git a/Items/Weapons/SunkenSea/SeashineSword.cs b/Items/Weapons/SunkenSea/SeashineSword.cs new file mode 100644 index 0000000000..6e10706522 --- /dev/null +++ b/Items/Weapons/SunkenSea/SeashineSword.cs @@ -0,0 +1,46 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.SunkenSea +{ + public class SeashineSword : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Seashine Sword"); + Tooltip.SetDefault("Shoots an aqua sword beam"); + } + + public override void SetDefaults() + { + item.CloneDefaults(ItemID.EnchantedSword); + item.damage = 26; + item.melee = true; + item.value = Item.buyPrice(0, 2, 0, 0); + item.width = 38; + item.height = 38; + item.knockBack = 2; + item.shootSpeed = 11; + item.rare = 2; + item.UseSound = SoundID.Item1; + } + + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + type = mod.ProjectileType("SeashineSwordProj"); + return base.Shoot(player, ref position, ref speedX, ref speedY, ref type, ref damage, ref knockBack); + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "SeaPrism", 7); + recipe.AddIngredient(null, "Navystone", 10); + recipe.AddTile(TileID.Anvils); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Weapons/SunkenSea/SeashineSword.png b/Items/Weapons/SunkenSea/SeashineSword.png new file mode 100644 index 0000000000..fa76f21e2c Binary files /dev/null and b/Items/Weapons/SunkenSea/SeashineSword.png differ diff --git a/Items/Weapons/SunkenSea/Serpentine.cs b/Items/Weapons/SunkenSea/Serpentine.cs new file mode 100644 index 0000000000..5cf3505a64 --- /dev/null +++ b/Items/Weapons/SunkenSea/Serpentine.cs @@ -0,0 +1,98 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.Weapons.SunkenSea +{ + public class Serpentine : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Serpentine"); + Tooltip.SetDefault("Casts a serpent that follows the mouse cursor"); + } + + public override void SetDefaults() + { + item.damage = 10; + item.magic = true; + item.mana = 20; + item.width = 28; + item.height = 32; + item.useTime = 20; + item.useAnimation = 20; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 3f; + item.value = Item.buyPrice(0, 36, 0, 0); + item.UseSound = SoundID.Item20; + item.rare = 5; + item.autoReuse = true; + item.shoot = mod.ProjectileType("SerpentineHead"); + item.shootSpeed = 10f; + } + + public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + int owner = player.whoAmI; + float num72 = item.shootSpeed; + player.itemTime = item.useTime; + Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); + Vector2 value = Vector2.UnitX.RotatedBy((double)player.fullRotation, default(Vector2)); + Vector2 vector3 = Main.MouseWorld - vector2; + float velX = (float)Main.mouseX + Main.screenPosition.X - vector2.X; + float velY = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; + if (player.gravDir == -1f) + { + velY = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; + } + float dist = (float)Math.Sqrt((double)(velX * velX + velY * velY)); + if ((float.IsNaN(velX) && float.IsNaN(velY)) || (velX == 0f && velY == 0f)) + { + velX = (float)player.direction; + velY = 0f; + dist = num72; + } + else + { + dist = num72 / dist; + } + velX *= dist; + velY *= dist; + float num77 = Vector2.Dot(value, vector3); + if (num77 > 0f) + { + player.ChangeDir(1); + } + else + { + player.ChangeDir(-1); + } + //velX = 0f; + //velY = 0f; + //vector2.X = (float)Main.mouseX + Main.screenPosition.X; + //vector2.Y = (float)Main.mouseY + Main.screenPosition.Y; + int curr = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, mod.ProjectileType("SerpentineHead"), damage, knockBack, owner); + + int prev = curr; + curr = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, mod.ProjectileType("SerpentineBody"), damage, knockBack, owner, (float)prev); + + prev = curr; + curr = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, mod.ProjectileType("SerpentineBody"), damage, knockBack, owner, (float)prev); + + prev = curr; + curr = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, mod.ProjectileType("SerpentineBody"), damage, knockBack, owner, (float)prev); + + prev = curr; + curr = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, mod.ProjectileType("SerpentineTail"), damage, knockBack, owner, (float)prev); + Main.projectile[prev].localAI[1] = (float)curr; + Main.projectile[prev].netUpdate = true; + return false; + } + } +} \ No newline at end of file diff --git a/Items/Weapons/SunkenSea/Serpentine.png b/Items/Weapons/SunkenSea/Serpentine.png new file mode 100644 index 0000000000..e99f41c53c Binary files /dev/null and b/Items/Weapons/SunkenSea/Serpentine.png differ diff --git a/Items/Weapons/SunkenSea/ShellfishStaff.cs b/Items/Weapons/SunkenSea/ShellfishStaff.cs new file mode 100644 index 0000000000..a9603b5a89 --- /dev/null +++ b/Items/Weapons/SunkenSea/ShellfishStaff.cs @@ -0,0 +1,82 @@ +using System; +using System.Collections.Generic; +using System.IO; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.GameContent; +using Terraria.IO; +using Terraria.ObjectData; +using Terraria.Utilities; +using Terraria.ModLoader; +using CalamityMod.Items; + +namespace CalamityMod.Items.Weapons.SunkenSea +{ + public class ShellfishStaff : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Shellfish Staff"); + Tooltip.SetDefault("Summons a shellfish to fight for you\n" + + "Takes up 2 minion slots"); + } + + public override void SetDefaults() + { + item.damage = 100; + item.mana = 10; + item.width = 50; + item.height = 50; + item.useTime = 36; + item.useAnimation = 36; + item.useStyle = 1; + item.noMelee = true; + item.knockBack = 2f; + item.value = Item.buyPrice(0, 36, 0, 0); + item.rare = 5; + item.UseSound = SoundID.Item44; + item.autoReuse = true; + item.shoot = mod.ProjectileType("Shellfish"); + item.shootSpeed = 10f; + item.summon = true; + } + + public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + int i = Main.myPlayer; + float num72 = item.shootSpeed; + int num73 = damage; + float num74 = knockBack; + num74 = player.GetWeaponKnockback(item, num74); + player.itemTime = item.useTime; + Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); + float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; + float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; + if (player.gravDir == -1f) + { + num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; + } + float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); + float num81 = num80; + if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) + { + num78 = (float)player.direction; + num79 = 0f; + num80 = num72; + } + else + { + num80 = num72 / num80; + } + num78 = 0f; + num79 = 0f; + vector2.X = (float)Main.mouseX + Main.screenPosition.X; + vector2.Y = (float)Main.mouseY + Main.screenPosition.Y; + Projectile.NewProjectile(vector2.X, vector2.Y, num78, num79, mod.ProjectileType("Shellfish"), num73, num74, i, 0f, 0f); + return false; + } + } +} \ No newline at end of file diff --git a/Items/Weapons/SunkenSea/ShellfishStaff.png b/Items/Weapons/SunkenSea/ShellfishStaff.png new file mode 100644 index 0000000000..e03d0fbb5f Binary files /dev/null and b/Items/Weapons/SunkenSea/ShellfishStaff.png differ diff --git a/Items/Weapons/SunkenSea/Whirlpool.cs b/Items/Weapons/SunkenSea/Whirlpool.cs new file mode 100644 index 0000000000..78878f0d98 --- /dev/null +++ b/Items/Weapons/SunkenSea/Whirlpool.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.IO; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.SunkenSea +{ + public class Whirlpool : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Riptide"); + Tooltip.SetDefault("Sprays a spiral of aqua streams in random directions"); + } + + public override void SetDefaults() + { + item.CloneDefaults(ItemID.TheEyeOfCthulhu); + item.damage = 18; + item.width = 30; + item.height = 44; + item.value = Item.buyPrice(0, 2, 0, 0); + item.rare = 2; + item.knockBack = 1; + item.channel = true; + item.melee = true; + item.useStyle = 8; + item.useAnimation = 8; + item.useTime = 8; + item.shoot = mod.ProjectileType("WhirlpoolProjectile"); + item.shootSpeed = 18f; + item.UseSound = SoundID.Item1; + ItemID.Sets.Yoyo[item.type] = true; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "SeaPrism", 7); + recipe.AddIngredient(null, "Navystone", 10); + recipe.AddTile(TileID.Anvils); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Weapons/SunkenSea/Whirlpool.png b/Items/Weapons/SunkenSea/Whirlpool.png new file mode 100644 index 0000000000..99efcf6899 Binary files /dev/null and b/Items/Weapons/SunkenSea/Whirlpool.png differ diff --git a/Items/Weapons/Svantechnical.cs b/Items/Weapons/Svantechnical.cs index 66f7b0ba17..b19d47b315 100644 --- a/Items/Weapons/Svantechnical.cs +++ b/Items/Weapons/Svantechnical.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons public override void SetDefaults() { - item.damage = 350; + item.damage = 625; item.ranged = true; item.width = 60; item.height = 26; @@ -35,18 +35,8 @@ namespace CalamityMod.Items.Weapons item.shootSpeed = 12f; item.shoot = 10; item.useAmmo = 97; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(255, 0, 255); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 16; + } public override Vector2? HoldoutOffset() { @@ -55,7 +45,7 @@ namespace CalamityMod.Items.Weapons public override bool ConsumeAmmo(Player player) { - if (Main.rand.Next(0, 100) <= 70) + if (Main.rand.Next(0, 100) < 70) return false; return true; } diff --git a/Items/Weapons/Svantechnical.png b/Items/Weapons/Svantechnical.png index e5bd61bab6..b22dce3b0f 100644 Binary files a/Items/Weapons/Svantechnical.png and b/Items/Weapons/Svantechnical.png differ diff --git a/Items/Weapons/T1000.cs b/Items/Weapons/T1000.cs index 63a5a2ed82..9d29a4e169 100644 --- a/Items/Weapons/T1000.cs +++ b/Items/Weapons/T1000.cs @@ -35,18 +35,8 @@ namespace CalamityMod.Items.Weapons item.autoReuse = true; item.shoot = mod.ProjectileType("T1000"); item.shootSpeed = 24f; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(43, 96, 222); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 14; + } public override void AddRecipes() { diff --git a/Items/Weapons/TerraEdge.cs b/Items/Weapons/TerraEdge.cs index d3c4806655..4aad3406dc 100644 --- a/Items/Weapons/TerraEdge.cs +++ b/Items/Weapons/TerraEdge.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons public override void SetDefaults() { item.width = 58; - item.damage = 150; + item.damage = 152; item.melee = true; item.useAnimation = 17; item.useStyle = 1; @@ -63,7 +63,7 @@ namespace CalamityMod.Items.Weapons public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { - if (target.type == NPCID.TargetDummy) + if (target.type == NPCID.TargetDummy || !target.canGhostHeal) { return; } diff --git a/Items/Weapons/TerraFlameburster.cs b/Items/Weapons/TerraFlameburster.cs index 82e4b449b7..73dec9b37b 100644 --- a/Items/Weapons/TerraFlameburster.cs +++ b/Items/Weapons/TerraFlameburster.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Items.Weapons public override bool ConsumeAmmo(Player player) { - if (Main.rand.Next(0, 100) <= 80) + if (Main.rand.Next(0, 100) < 80) return false; return true; } diff --git a/Items/Weapons/Terratomere.cs b/Items/Weapons/Terratomere.cs index c21d78ab17..c118369c4d 100644 --- a/Items/Weapons/Terratomere.cs +++ b/Items/Weapons/Terratomere.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons public override void SetDefaults() { item.width = 64; - item.damage = 100; + item.damage = 135; item.melee = true; item.useAnimation = 20; item.useStyle = 1; @@ -91,7 +91,7 @@ namespace CalamityMod.Items.Weapons target.AddBuff(BuffID.Frostburn, 620); target.AddBuff(BuffID.OnFire, 600); target.AddBuff(BuffID.Ichor, 300); - if (target.type == NPCID.TargetDummy) + if (target.type == NPCID.TargetDummy || !target.canGhostHeal) { return; } diff --git a/Items/Weapons/TheEmpyrean.cs b/Items/Weapons/TheEmpyrean.cs index 0d621bf2be..7cb5732d84 100644 --- a/Items/Weapons/TheEmpyrean.cs +++ b/Items/Weapons/TheEmpyrean.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Items.Weapons public override bool ConsumeAmmo(Player player) { - if (Main.rand.Next(0, 100) <= 70) + if (Main.rand.Next(0, 100) < 70) return false; return true; } diff --git a/Items/Weapons/TheEnforcer.cs b/Items/Weapons/TheEnforcer.cs index 127e1a18df..d72484e585 100644 --- a/Items/Weapons/TheEnforcer.cs +++ b/Items/Weapons/TheEnforcer.cs @@ -33,18 +33,8 @@ namespace CalamityMod.Items.Weapons item.rare = 10; item.shoot = mod.ProjectileType("EssenceBurst"); item.shootSpeed = 24f; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(43, 96, 222); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 14; + } public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { diff --git a/Items/Weapons/TheMutilator.cs b/Items/Weapons/TheMutilator.cs index 78518b3a5f..be8d779944 100644 --- a/Items/Weapons/TheMutilator.cs +++ b/Items/Weapons/TheMutilator.cs @@ -34,22 +34,12 @@ namespace CalamityMod.Items.Weapons item.value = Item.buyPrice(1, 40, 0, 0); item.rare = 10; item.shootSpeed = 10f; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 0); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 13; + } public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { - if (target.life <= (target.lifeMax * 0.2f)) + if (target.life <= (target.lifeMax * 0.2f) && target.canGhostHeal) { int heartDrop = Main.rand.Next(1, 3); for (int i = 0; i < heartDrop; i++) diff --git a/Items/Weapons/TheStorm.cs b/Items/Weapons/TheStorm.cs index 2b3975dcfc..bdca301465 100644 --- a/Items/Weapons/TheStorm.cs +++ b/Items/Weapons/TheStorm.cs @@ -6,7 +6,6 @@ using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Items; -//using TerrariaOverhaul; namespace CalamityMod.Items.Weapons { @@ -35,23 +34,8 @@ namespace CalamityMod.Items.Weapons item.shoot = mod.ProjectileType("Bolt"); item.shootSpeed = 28f; item.useAmmo = 40; - } - - /*public void OverhaulInit() - { - this.SetTag("bow"); - }*/ - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 0); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 13; + } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { diff --git a/Items/Weapons/TheWand.cs b/Items/Weapons/TheWand.cs index 91b0639d92..a1d9b6dd41 100644 --- a/Items/Weapons/TheWand.cs +++ b/Items/Weapons/TheWand.cs @@ -35,19 +35,9 @@ namespace CalamityMod.Items.Weapons item.rare = 10; item.shoot = mod.ProjectileType("SparkInfernal"); item.shootSpeed = 24f; + item.GetGlobalItem(mod).postMoonLordRarity = 15; } - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(108, 45, 199); - } - } - } - public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); diff --git a/Items/Weapons/TriactisTruePaladinianMageHammerofMightMelee.cs b/Items/Weapons/TriactisTruePaladinianMageHammerofMightMelee.cs index 832892d38f..a10d49105f 100644 --- a/Items/Weapons/TriactisTruePaladinianMageHammerofMightMelee.cs +++ b/Items/Weapons/TriactisTruePaladinianMageHammerofMightMelee.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons public override void SetDefaults() { item.width = 160; - item.damage = 5000; + item.damage = 10000; item.noMelee = true; item.noUseGraphic = true; item.autoReuse = true; @@ -34,18 +34,8 @@ namespace CalamityMod.Items.Weapons item.rare = 10; item.shoot = mod.ProjectileType("TriactisOPHammerMelee"); item.shootSpeed = 25f; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(255, 0, 255); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 16; + } public override void AddRecipes() { diff --git a/Items/Weapons/TrueExcaliburShortsword.cs b/Items/Weapons/TrueExcaliburShortsword.cs index 74837b8c10..7cfc47406f 100644 --- a/Items/Weapons/TrueExcaliburShortsword.cs +++ b/Items/Weapons/TrueExcaliburShortsword.cs @@ -22,8 +22,8 @@ namespace CalamityMod.Items.Weapons item.useTurn = false; item.useAnimation = 12; item.useTime = 12; - item.width = 50; - item.height = 50; + item.width = 42; + item.height = 42; item.damage = 70; item.melee = true; item.knockBack = 5.75f; diff --git a/Items/Weapons/TrueExcaliburShortsword.png b/Items/Weapons/TrueExcaliburShortsword.png index d7915266d6..6ced91fcc3 100644 Binary files a/Items/Weapons/TrueExcaliburShortsword.png and b/Items/Weapons/TrueExcaliburShortsword.png differ diff --git a/Items/Weapons/TrueTyrantYharimsUltisword.cs b/Items/Weapons/TrueTyrantYharimsUltisword.cs index c83574b53c..dfa78ed78e 100644 --- a/Items/Weapons/TrueTyrantYharimsUltisword.cs +++ b/Items/Weapons/TrueTyrantYharimsUltisword.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons public override void SetDefaults() { item.width = 86; - item.damage = 165; + item.damage = 185; item.melee = true; item.useAnimation = 18; item.useStyle = 1; @@ -35,18 +35,8 @@ namespace CalamityMod.Items.Weapons item.rare = 10; item.shoot = mod.ProjectileType("BlazingPhantomBlade"); item.shootSpeed = 12f; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 200); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 12; + } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { diff --git a/Items/Weapons/UltraLiquidator.cs b/Items/Weapons/UltraLiquidator.cs index 54262d94db..ad54780cac 100644 --- a/Items/Weapons/UltraLiquidator.cs +++ b/Items/Weapons/UltraLiquidator.cs @@ -39,18 +39,8 @@ namespace CalamityMod.Items.Weapons item.autoReuse = true; item.shoot = mod.ProjectileType("LiquidBlade"); item.shootSpeed = 16f; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 200); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 12; + } public override void AddRecipes() { diff --git a/Items/Weapons/VanquisherArrow.cs b/Items/Weapons/VanquisherArrow.cs index dbab8dccec..94426b3bd0 100644 --- a/Items/Weapons/VanquisherArrow.cs +++ b/Items/Weapons/VanquisherArrow.cs @@ -30,18 +30,8 @@ namespace CalamityMod.Items.Weapons item.shoot = mod.ProjectileType("VanquisherArrow"); item.shootSpeed = 10f; item.ammo = 40; + item.GetGlobalItem(mod).postMoonLordRarity = 14; } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(43, 96, 222); - } - } - } public override void AddRecipes() { diff --git a/Items/Weapons/VenusianTrident.cs b/Items/Weapons/VenusianTrident.cs index ee72d549a3..6e33099e49 100644 --- a/Items/Weapons/VenusianTrident.cs +++ b/Items/Weapons/VenusianTrident.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons public override void SetDefaults() { - item.damage = 136; + item.damage = 225; item.magic = true; item.mana = 20; item.width = 48; @@ -36,24 +36,14 @@ namespace CalamityMod.Items.Weapons item.autoReuse = true; item.shoot = mod.ProjectileType("VenusianBolt"); item.shootSpeed = 19f; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 0); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 13; + } public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.InfernoFork); - recipe.AddIngredient(null, "Phantoplasm", 5); + recipe.AddIngredient(null, "RuinousSoul", 2); recipe.AddIngredient(null, "TwistingNether"); recipe.AddTile(TileID.LunarCraftingStation); recipe.SetResult(this); diff --git a/Items/Weapons/Verdant.cs b/Items/Weapons/Verdant.cs index dae34ae2e7..eb82070929 100644 --- a/Items/Weapons/Verdant.cs +++ b/Items/Weapons/Verdant.cs @@ -31,18 +31,8 @@ namespace CalamityMod.Items.Weapons item.rare = 10; item.autoReuse = true; item.shoot = mod.ProjectileType("VerdantProjectile"); - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 200); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 12; + } public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { diff --git a/Items/Weapons/Vesuvius.cs b/Items/Weapons/Vesuvius.cs index 23f976fcaa..c747b77f9d 100644 --- a/Items/Weapons/Vesuvius.cs +++ b/Items/Weapons/Vesuvius.cs @@ -39,19 +39,9 @@ namespace CalamityMod.Items.Weapons item.rare = 8; item.shootSpeed = 20f; item.shoot = mod.ProjectileType("AsteroidMolten"); + item.GetGlobalItem(mod).postMoonLordRarity = 17; } - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(255, Main.DiscoG, 0); - } - } - } - public override bool AltFunctionUse(Player player) { return true; diff --git a/Items/Weapons/Viscera.cs b/Items/Weapons/Viscera.cs index 6b7791bdb9..4d0497702e 100644 --- a/Items/Weapons/Viscera.cs +++ b/Items/Weapons/Viscera.cs @@ -36,18 +36,8 @@ namespace CalamityMod.Items.Weapons item.autoReuse = true; item.shoot = mod.ProjectileType("Viscera"); item.shootSpeed = 6f; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 0); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 13; + } public override void AddRecipes() { diff --git a/Items/Weapons/VividClarity.cs b/Items/Weapons/VividClarity.cs index b01580d06f..210c36b7ea 100644 --- a/Items/Weapons/VividClarity.cs +++ b/Items/Weapons/VividClarity.cs @@ -38,18 +38,8 @@ namespace CalamityMod.Items.Weapons item.autoReuse = true; item.shoot = mod.ProjectileType("VividClarity"); item.shootSpeed = 6f; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(108, 45, 199); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 15; + } public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { diff --git a/Items/Weapons/YharimsCrystal.cs b/Items/Weapons/YharimsCrystal.cs index 18f7fedc43..53a054ad8f 100644 --- a/Items/Weapons/YharimsCrystal.cs +++ b/Items/Weapons/YharimsCrystal.cs @@ -38,18 +38,8 @@ namespace CalamityMod.Items.Weapons item.rare = 10; item.shoot = mod.ProjectileType("YharimsCrystal"); item.shootSpeed = 30f; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(255, Main.DiscoG, 53); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 17; + } public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { diff --git a/Items/Weapons/YharimsCrystal.png b/Items/Weapons/YharimsCrystal.png index 3267ca4d7f..2063e2c29a 100644 Binary files a/Items/Weapons/YharimsCrystal.png and b/Items/Weapons/YharimsCrystal.png differ diff --git a/Items/Weapons/Yharon/AngryChickenStaff.cs b/Items/Weapons/Yharon/AngryChickenStaff.cs index 8bf16c798c..a748908c6f 100644 --- a/Items/Weapons/Yharon/AngryChickenStaff.cs +++ b/Items/Weapons/Yharon/AngryChickenStaff.cs @@ -43,18 +43,8 @@ namespace CalamityMod.Items.Weapons.Yharon item.shoot = mod.ProjectileType("AngryChicken"); item.shootSpeed = 10f; item.summon = true; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(43, 96, 222); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 14; + } public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { diff --git a/Items/Weapons/Yharon/ChickenCannon.cs b/Items/Weapons/Yharon/ChickenCannon.cs index e090b7052f..419ac7acc9 100644 --- a/Items/Weapons/Yharon/ChickenCannon.cs +++ b/Items/Weapons/Yharon/ChickenCannon.cs @@ -35,18 +35,8 @@ namespace CalamityMod.Items.Weapons.Yharon item.shootSpeed = 24f; item.shoot = mod.ProjectileType("Chicken"); item.useAmmo = 771; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(43, 96, 222); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 14; + } public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { diff --git a/Items/Weapons/Yharon/DragonRage.cs b/Items/Weapons/Yharon/DragonRage.cs index 3a0f528e16..f8f6fb4371 100644 --- a/Items/Weapons/Yharon/DragonRage.cs +++ b/Items/Weapons/Yharon/DragonRage.cs @@ -32,18 +32,8 @@ namespace CalamityMod.Items.Weapons.Yharon item.rare = 10; item.shoot = mod.ProjectileType("DragonRage"); item.shootSpeed = 14f; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(43, 96, 222); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 14; + } public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { diff --git a/Items/Weapons/Yharon/DragonsBreath.cs b/Items/Weapons/Yharon/DragonsBreath.cs index c1e188c035..000054ccd5 100644 --- a/Items/Weapons/Yharon/DragonsBreath.cs +++ b/Items/Weapons/Yharon/DragonsBreath.cs @@ -35,18 +35,8 @@ namespace CalamityMod.Items.Weapons.Yharon item.shoot = 10; item.shootSpeed = 12f; item.useAmmo = 97; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(43, 96, 222); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 14; + } public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { @@ -61,7 +51,7 @@ namespace CalamityMod.Items.Weapons.Yharon public override bool ConsumeAmmo(Player player) { - if (Main.rand.Next(0, 100) <= 80) + if (Main.rand.Next(0, 100) < 80) return false; return true; } diff --git a/Items/Weapons/Yharon/PhoenixFlameBarrage.cs b/Items/Weapons/Yharon/PhoenixFlameBarrage.cs index 02dfab7e4b..cbad0157d2 100644 --- a/Items/Weapons/Yharon/PhoenixFlameBarrage.cs +++ b/Items/Weapons/Yharon/PhoenixFlameBarrage.cs @@ -36,18 +36,8 @@ namespace CalamityMod.Items.Weapons.Yharon item.autoReuse = true; item.shoot = mod.ProjectileType("HolyFlame"); item.shootSpeed = 30f; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(43, 96, 222); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 14; + } public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { diff --git a/Items/Weapons/Yharon/TheBurningSky.cs b/Items/Weapons/Yharon/TheBurningSky.cs index 802eac98ec..cd703dc458 100644 --- a/Items/Weapons/Yharon/TheBurningSky.cs +++ b/Items/Weapons/Yharon/TheBurningSky.cs @@ -33,18 +33,8 @@ namespace CalamityMod.Items.Weapons.Yharon item.rare = 10; item.shoot = mod.ProjectileType("BurningMeteor"); item.shootSpeed = 35f; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(43, 96, 222); - } - } - } + item.GetGlobalItem(mod).postMoonLordRarity = 14; + } public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { diff --git a/Items/WulfrumShard.cs b/Items/WulfrumShard.cs index 74fa213b84..33a1706891 100644 --- a/Items/WulfrumShard.cs +++ b/Items/WulfrumShard.cs @@ -21,8 +21,8 @@ namespace CalamityMod.Items item.width = 13; item.height = 10; item.maxStack = 999; - item.value = 1750; - item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.rare = 1; } } } \ No newline at end of file diff --git a/Items/YharimsStimulants.cs b/Items/YharimsStimulants.cs index 1ca72f7437..76d7c28a5c 100644 --- a/Items/YharimsStimulants.cs +++ b/Items/YharimsStimulants.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items item.consumable = true; item.buffType = mod.BuffType("YharimPower"); item.buffTime = 108000; - item.value = 10000; + item.value = Item.buyPrice(0, 2, 0, 0); } public override void AddRecipes() diff --git a/Items/Yharon/ChickenEgg.cs b/Items/Yharon/ChickenEgg.cs index c8aa618812..b81a16ec8c 100644 --- a/Items/Yharon/ChickenEgg.cs +++ b/Items/Yharon/ChickenEgg.cs @@ -27,19 +27,9 @@ namespace CalamityMod.Items.Yharon item.useTime = 45; item.useStyle = 4; item.consumable = false; + item.GetGlobalItem(mod).postMoonLordRarity = 14; } - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(43, 96, 222); - } - } - } - public override bool CanUseItem(Player player) { return player.ZoneJungle && !NPC.AnyNPCs(mod.NPCType("Yharon")); @@ -57,7 +47,7 @@ namespace CalamityMod.Items.Yharon ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(null, "EffulgentFeather", 15); recipe.AddIngredient(null, "BarofLife", 15); - recipe.AddTile(null, "DraedonsForge"); + recipe.AddTile(TileID.LunarCraftingStation); recipe.SetResult(this); recipe.AddRecipe(); } diff --git a/Items/Yharon/HellcasterFragment.cs b/Items/Yharon/HellcasterFragment.cs index 74b899be4b..82950f4c3e 100644 --- a/Items/Yharon/HellcasterFragment.cs +++ b/Items/Yharon/HellcasterFragment.cs @@ -30,18 +30,8 @@ namespace CalamityMod.Items.Yharon item.width = 10; item.height = 14; item.maxStack = 999; - item.value = 15000; - } - - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB); - } - } - } + item.value = Item.buyPrice(0, 10, 0, 0); + item.GetGlobalItem(mod).postMoonLordRarity = 20; + } } } \ No newline at end of file diff --git a/Items/Yharon/YharonBag.cs b/Items/Yharon/YharonBag.cs index 220d15f8bb..8d4fd8043d 100644 --- a/Items/Yharon/YharonBag.cs +++ b/Items/Yharon/YharonBag.cs @@ -7,11 +7,11 @@ namespace CalamityMod.Items.Yharon public class YharonBag : ModItem { public override void SetStaticDefaults() - { - DisplayName.SetDefault("Treasure Bag"); - Tooltip.SetDefault("{$CommonItemTooltip.RightClickToOpen}"); - } - + { + DisplayName.SetDefault("Treasure Bag"); + Tooltip.SetDefault("{$CommonItemTooltip.RightClickToOpen}"); + } + public override void SetDefaults() { item.maxStack = 999; @@ -30,6 +30,26 @@ namespace CalamityMod.Items.Yharon public override void OpenBossBag(Player player) { + if (CalamityWorld.revenge) + { + player.QuickSpawnItem(mod.ItemType("DrewsWings")); + player.QuickSpawnItem(mod.ItemType("FoxDrive")); + if (Main.rand.Next(20) == 0) + { + switch (Main.rand.Next(3)) + { + case 0: + player.QuickSpawnItem(mod.ItemType("StressPills")); + break; + case 1: + player.QuickSpawnItem(mod.ItemType("Laudanum")); + break; + case 2: + player.QuickSpawnItem(mod.ItemType("HeartofDarkness")); + break; + } + } + } player.TryGettingDevArmor(); if (Main.rand.Next(3) == 0) { @@ -63,11 +83,6 @@ namespace CalamityMod.Items.Yharon { player.QuickSpawnItem(mod.ItemType("YharonMask")); } - if (CalamityWorld.revenge) - { - player.QuickSpawnItem(mod.ItemType("DrewsWings")); - player.QuickSpawnItem(mod.ItemType("FoxDrive")); - } player.QuickSpawnItem(mod.ItemType("YharimsGift")); } } diff --git a/ModSupport.cs b/ModSupport.cs index 3ba8e4265a..8197feef1b 100644 --- a/ModSupport.cs +++ b/ModSupport.cs @@ -15,14 +15,14 @@ using Terraria.ModLoader; namespace CalamityMod { public class ModSupport - { + { public static object Call(params object[] args) { if (args.Length <= 0 || !(args[0] is string)) return new Exception("CalamityMod Error: NO METHOD NAME! First param MUST be a method name!"); - string methodName = (string)args[0]; + string methodName = (string)args[0]; if (methodName.Equals("Downed")) //returns a Func which will return a downed value based on name. { - Func downed = (name) => + Func downed = (name) => { name = name.ToLower(); switch (name) @@ -41,7 +41,7 @@ namespace CalamityMod case "astrumdeus": return CalamityWorld.downedStarGod; case "plaguebringer": return CalamityWorld.downedPlaguebringer; case "ravager": return CalamityWorld.downedScavenger; - case "guardians": return CalamityWorld.downedGuardians; + case "guardians": return CalamityWorld.downedGuardians; case "providence": return CalamityWorld.downedProvidence; case "polterghast": return CalamityWorld.downedPolterghast; case "sentinelany": return (CalamityWorld.downedSentinel1 || CalamityWorld.downedSentinel2 || CalamityWorld.downedSentinel3); @@ -52,7 +52,7 @@ namespace CalamityMod case "devourerofgods": return CalamityWorld.downedDoG; case "bumblebirb": return CalamityWorld.downedBumble; case "yharon": return CalamityWorld.downedYharon; - case "supremecalamitas": return CalamityWorld.downedSCal; + case "supremecalamitas": return CalamityWorld.downedSCal; } }; return downed; @@ -66,16 +66,16 @@ namespace CalamityMod return new Exception("CalamityMod Error: NO METHOD FOUND: " + methodName); } - public static bool InZone(Player p, string zoneName) - { + public static bool InZone(Player p, string zoneName) + { Mod calamity = ModLoader.GetMod("CalamityMod"); zoneName = zoneName.ToLower(); - switch (zoneName) - { - case "calamity": return p.GetModPlayer(calamity).ZoneCalamity; - case "astral": return p.GetModPlayer(calamity).ZoneAstral; - } - return false; - } - } + switch (zoneName) + { + case "calamity": return p.GetModPlayer(calamity).ZoneCalamity; + case "astral": return p.GetModPlayer(calamity).ZoneAstral; + } + return false; + } + } } \ No newline at end of file diff --git a/NPCs/AbyssNPCs/AquaticParasite.cs b/NPCs/AbyssNPCs/AquaticParasite.cs index ec0034cf9d..7a79492fec 100644 --- a/NPCs/AbyssNPCs/AquaticParasite.cs +++ b/NPCs/AbyssNPCs/AquaticParasite.cs @@ -16,212 +16,214 @@ namespace CalamityMod.NPCs.AbyssNPCs { DisplayName.SetDefault("Aquatic Parasite"); } - + public override void SetDefaults() { - npc.noGravity = true; + npc.noGravity = true; npc.damage = 15; npc.width = 28; npc.height = 28; npc.defense = 5; npc.lifeMax = 30; - if (CalamityWorld.bossRushActive) - { - npc.lifeMax = 30000; - } - npc.aiStyle = -1; + if (CalamityWorld.bossRushActive) + { + npc.lifeMax = 30000; + } + npc.aiStyle = -1; aiType = -1; - for (int k = 0; k < npc.buffImmune.Length; k++) - { - npc.buffImmune[k] = true; - } - npc.value = Item.buyPrice(0, 0, 0, 60); + for (int k = 0; k < npc.buffImmune.Length; k++) + { + npc.buffImmune[k] = true; + } + npc.value = Item.buyPrice(0, 0, 0, 60); npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; - } + banner = npc.type; + bannerItem = mod.ItemType("AquaticParasiteBanner"); + } - public override void AI() - { - bool flag15 = false; - if (npc.wet && npc.ai[1] == 1f) - { - flag15 = true; - } - else - { - npc.dontTakeDamage = false; - } - float num262 = 1f; - if (flag15) - { - num262 += 0.5f; - } - if (npc.direction == 0) - { - npc.TargetClosest(true); - } - if (flag15) - { - return; - } - if (!npc.wet) - { - npc.rotation += npc.velocity.X * 0.1f; - if (npc.velocity.Y == 0f) - { - npc.velocity.X = npc.velocity.X * 0.98f; - if ((double)npc.velocity.X > -0.01 && (double)npc.velocity.X < 0.01) - { - npc.velocity.X = 0f; - } - } - npc.velocity.Y = npc.velocity.Y + 0.2f; - if (npc.velocity.Y > 10f) - { - npc.velocity.Y = 10f; - } - npc.ai[0] = 1f; - return; - } - if (npc.collideX) - { - npc.velocity.X = npc.velocity.X * -1f; - npc.direction *= -1; - } - if (npc.collideY) - { - if (npc.velocity.Y > 0f) - { - npc.velocity.Y = Math.Abs(npc.velocity.Y) * -1f; - npc.directionY = -1; - npc.ai[0] = -1f; - } - else if (npc.velocity.Y < 0f) - { - npc.velocity.Y = Math.Abs(npc.velocity.Y); - npc.directionY = 1; - npc.ai[0] = 1f; - } - } - bool flag16 = false; - if (!npc.friendly) - { - npc.TargetClosest(false); - if (!Main.player[npc.target].dead) - { - flag16 = true; - } - } - if (flag16) - { - npc.localAI[2] = 1f; - npc.rotation = (float)Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X) + 1.57f; - npc.velocity *= 0.975f; - float num263 = 3.2f; - if (npc.velocity.X > -num263 && npc.velocity.X < num263 && npc.velocity.Y > -num263 && npc.velocity.Y < num263) - { - npc.TargetClosest(true); - float num264 = 15f; - Vector2 vector31 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num265 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector31.X; - float num266 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector31.Y; - float num267 = (float)Math.Sqrt((double)(num265 * num265 + num266 * num266)); - num267 = num264 / num267; - num265 *= num267; - num266 *= num267; - npc.velocity.X = num265; - npc.velocity.Y = num266; - return; - } - } - else - { - npc.localAI[2] = 0f; - npc.velocity.X = npc.velocity.X + (float)npc.direction * 0.02f; - npc.rotation = npc.velocity.X * 0.4f; - if (npc.velocity.X < -1f || npc.velocity.X > 1f) - { - npc.velocity.X = npc.velocity.X * 0.95f; - } - if (npc.ai[0] == -1f) - { - npc.velocity.Y = npc.velocity.Y - 0.01f; - if (npc.velocity.Y < -1f) - { - npc.ai[0] = 1f; - } - } - else - { - npc.velocity.Y = npc.velocity.Y + 0.01f; - if (npc.velocity.Y > 1f) - { - npc.ai[0] = -1f; - } - } - int num268 = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int num269 = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - if (Main.tile[num268, num269 - 1] == null) - { - Main.tile[num268, num269 - 1] = new Tile(); - } - if (Main.tile[num268, num269 + 1] == null) - { - Main.tile[num268, num269 + 1] = new Tile(); - } - if (Main.tile[num268, num269 + 2] == null) - { - Main.tile[num268, num269 + 2] = new Tile(); - } - if (Main.tile[num268, num269 - 1].liquid > 128) - { - if (Main.tile[num268, num269 + 1].active()) - { - npc.ai[0] = -1f; - } - else if (Main.tile[num268, num269 + 2].active()) - { - npc.ai[0] = -1f; - } - } - else - { - npc.ai[0] = 1f; - } - if ((double)npc.velocity.Y > 1.2 || (double)npc.velocity.Y < -1.2) - { - npc.velocity.Y = npc.velocity.Y * 0.99f; - return; - } - } - } + public override void AI() + { + bool flag15 = false; + if (npc.wet && npc.ai[1] == 1f) + { + flag15 = true; + } + else + { + npc.dontTakeDamage = false; + } + float num262 = 1f; + if (flag15) + { + num262 += 0.5f; + } + if (npc.direction == 0) + { + npc.TargetClosest(true); + } + if (flag15) + { + return; + } + if (!npc.wet) + { + npc.rotation += npc.velocity.X * 0.1f; + if (npc.velocity.Y == 0f) + { + npc.velocity.X = npc.velocity.X * 0.98f; + if ((double)npc.velocity.X > -0.01 && (double)npc.velocity.X < 0.01) + { + npc.velocity.X = 0f; + } + } + npc.velocity.Y = npc.velocity.Y + 0.2f; + if (npc.velocity.Y > 10f) + { + npc.velocity.Y = 10f; + } + npc.ai[0] = 1f; + return; + } + if (npc.collideX) + { + npc.velocity.X = npc.velocity.X * -1f; + npc.direction *= -1; + } + if (npc.collideY) + { + if (npc.velocity.Y > 0f) + { + npc.velocity.Y = Math.Abs(npc.velocity.Y) * -1f; + npc.directionY = -1; + npc.ai[0] = -1f; + } + else if (npc.velocity.Y < 0f) + { + npc.velocity.Y = Math.Abs(npc.velocity.Y); + npc.directionY = 1; + npc.ai[0] = 1f; + } + } + bool flag16 = false; + if (!npc.friendly) + { + npc.TargetClosest(false); + if (!Main.player[npc.target].dead) + { + flag16 = true; + } + } + if (flag16) + { + npc.localAI[2] = 1f; + npc.rotation = (float)Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X) + 1.57f; + npc.velocity *= 0.975f; + float num263 = 3.2f; + if (npc.velocity.X > -num263 && npc.velocity.X < num263 && npc.velocity.Y > -num263 && npc.velocity.Y < num263) + { + npc.TargetClosest(true); + float num264 = 15f; + Vector2 vector31 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float num265 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector31.X; + float num266 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector31.Y; + float num267 = (float)Math.Sqrt((double)(num265 * num265 + num266 * num266)); + num267 = num264 / num267; + num265 *= num267; + num266 *= num267; + npc.velocity.X = num265; + npc.velocity.Y = num266; + return; + } + } + else + { + npc.localAI[2] = 0f; + npc.velocity.X = npc.velocity.X + (float)npc.direction * 0.02f; + npc.rotation = npc.velocity.X * 0.4f; + if (npc.velocity.X < -1f || npc.velocity.X > 1f) + { + npc.velocity.X = npc.velocity.X * 0.95f; + } + if (npc.ai[0] == -1f) + { + npc.velocity.Y = npc.velocity.Y - 0.01f; + if (npc.velocity.Y < -1f) + { + npc.ai[0] = 1f; + } + } + else + { + npc.velocity.Y = npc.velocity.Y + 0.01f; + if (npc.velocity.Y > 1f) + { + npc.ai[0] = -1f; + } + } + int num268 = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int num269 = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + if (Main.tile[num268, num269 - 1] == null) + { + Main.tile[num268, num269 - 1] = new Tile(); + } + if (Main.tile[num268, num269 + 1] == null) + { + Main.tile[num268, num269 + 1] = new Tile(); + } + if (Main.tile[num268, num269 + 2] == null) + { + Main.tile[num268, num269 + 2] = new Tile(); + } + if (Main.tile[num268, num269 - 1].liquid > 128) + { + if (Main.tile[num268, num269 + 1].active()) + { + npc.ai[0] = -1f; + } + else if (Main.tile[num268, num269 + 2].active()) + { + npc.ai[0] = -1f; + } + } + else + { + npc.ai[0] = 1f; + } + if ((double)npc.velocity.Y > 1.2 || (double)npc.velocity.Y < -1.2) + { + npc.velocity.Y = npc.velocity.Y * 0.99f; + return; + } + } + } - public override void FindFrame(int frameHeight) - { - npc.frameCounter += 0.15f; - npc.frameCounter %= Main.npcFrameCount[npc.type]; - int frame = (int)npc.frameCounter; - npc.frame.Y = frame * frameHeight; - } + public override void FindFrame(int frameHeight) + { + npc.frameCounter += 0.15f; + npc.frameCounter %= Main.npcFrameCount[npc.type]; + int frame = (int)npc.frameCounter; + npc.frame.Y = frame * frameHeight; + } + + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + if (spawnInfo.playerSafe) + { + return 0f; + } + if (spawnInfo.player.GetModPlayer(mod).ZoneSulphur && spawnInfo.water) + { + return 0.2f; + } + return 0f; + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - if (spawnInfo.playerSafe) - { - return 0f; - } - if (spawnInfo.player.GetModPlayer(mod).ZoneSulphur && spawnInfo.water) - { - return 0.2f; - } - return 0f; - } - public override void OnHitPlayer(Player player, int damage, bool crit) { player.AddBuff(BuffID.Venom, 120, true); } - + public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 3; k++) @@ -234,6 +236,8 @@ namespace CalamityMod.NPCs.AbyssNPCs { Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AquaticScourgeGores/AquaticParasite1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AquaticScourgeGores/AquaticParasite2"), 1f); } } } diff --git a/NPCs/AbyssNPCs/AquaticScourgeBody.cs b/NPCs/AbyssNPCs/AquaticScourgeBody.cs index 5853453f5d..665520f6e0 100644 --- a/NPCs/AbyssNPCs/AquaticScourgeBody.cs +++ b/NPCs/AbyssNPCs/AquaticScourgeBody.cs @@ -36,11 +36,11 @@ namespace CalamityMod.NPCs.AbyssNPCs { npc.lifeMax = 100000; } - if (CalamityWorld.bossRushActive) - { - npc.lifeMax = CalamityWorld.death ? 8600000 : 7900000; - } - for (int k = 0; k < npc.buffImmune.Length; k++) + if (CalamityWorld.bossRushActive) + { + npc.lifeMax = CalamityWorld.death ? 4300000 : 4000000; + } + for (int k = 0; k < npc.buffImmune.Length; k++) { npc.buffImmune[k] = true; } @@ -52,7 +52,8 @@ namespace CalamityMod.NPCs.AbyssNPCs npc.netAlways = true; npc.dontCountMe = true; npc.chaseable = false; - if (Main.expertMode) + npc.canGhostHeal = false; + if (Main.expertMode) { npc.scale = 1.15f; } @@ -369,7 +370,11 @@ namespace CalamityMod.NPCs.AbyssNPCs { Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); } - } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AquaticScourgeGores/ASBody"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AquaticScourgeGores/ASBody2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AquaticScourgeGores/ASBody3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AquaticScourgeGores/ASBody4"), 1f); + } } public override void OnHitPlayer(Player player, int damage, bool crit) diff --git a/NPCs/AbyssNPCs/AquaticScourgeBodyAlt.cs b/NPCs/AbyssNPCs/AquaticScourgeBodyAlt.cs index 48f191eefe..7f808ce4fc 100644 --- a/NPCs/AbyssNPCs/AquaticScourgeBodyAlt.cs +++ b/NPCs/AbyssNPCs/AquaticScourgeBodyAlt.cs @@ -36,11 +36,11 @@ namespace CalamityMod.NPCs.AbyssNPCs { npc.lifeMax = 100000; } - if (CalamityWorld.bossRushActive) - { - npc.lifeMax = CalamityWorld.death ? 8600000 : 7900000; - } - for (int k = 0; k < npc.buffImmune.Length; k++) + if (CalamityWorld.bossRushActive) + { + npc.lifeMax = CalamityWorld.death ? 4300000 : 4000000; + } + for (int k = 0; k < npc.buffImmune.Length; k++) { npc.buffImmune[k] = true; } @@ -52,7 +52,8 @@ namespace CalamityMod.NPCs.AbyssNPCs npc.netAlways = true; npc.dontCountMe = true; npc.chaseable = false; - if (Main.expertMode) + npc.canGhostHeal = false; + if (Main.expertMode) { npc.scale = 1.15f; } @@ -367,7 +368,10 @@ namespace CalamityMod.NPCs.AbyssNPCs { Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); } - } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AquaticScourgeGores/ASBodyAlt"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AquaticScourgeGores/ASBodyAlt2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AquaticScourgeGores/ASBodyAlt3"), 1f); + } } public override void OnHitPlayer(Player player, int damage, bool crit) diff --git a/NPCs/AbyssNPCs/AquaticScourgeHead.cs b/NPCs/AbyssNPCs/AquaticScourgeHead.cs index f8f8b79c74..f20d85752d 100644 --- a/NPCs/AbyssNPCs/AquaticScourgeHead.cs +++ b/NPCs/AbyssNPCs/AquaticScourgeHead.cs @@ -46,7 +46,7 @@ namespace CalamityMod.NPCs.AbyssNPCs } if (CalamityWorld.bossRushActive) { - npc.lifeMax = CalamityWorld.death ? 8600000 : 7900000; + npc.lifeMax = CalamityWorld.death ? 4300000 : 4000000; } for (int k = 0; k < npc.buffImmune.Length; k++) { @@ -582,6 +582,7 @@ namespace CalamityMod.NPCs.AbyssNPCs { Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AquaticScourgeGores/ASHead"), 1f); } } diff --git a/NPCs/AbyssNPCs/AquaticScourgeTail.cs b/NPCs/AbyssNPCs/AquaticScourgeTail.cs index 74b45790e7..30dfbd4574 100644 --- a/NPCs/AbyssNPCs/AquaticScourgeTail.cs +++ b/NPCs/AbyssNPCs/AquaticScourgeTail.cs @@ -36,11 +36,11 @@ namespace CalamityMod.NPCs.AbyssNPCs { npc.lifeMax = 100000; } - if (CalamityWorld.bossRushActive) - { - npc.lifeMax = CalamityWorld.death ? 8600000 : 7900000; - } - for (int k = 0; k < npc.buffImmune.Length; k++) + if (CalamityWorld.bossRushActive) + { + npc.lifeMax = CalamityWorld.death ? 4300000 : 4000000; + } + for (int k = 0; k < npc.buffImmune.Length; k++) { npc.buffImmune[k] = true; } @@ -52,7 +52,8 @@ namespace CalamityMod.NPCs.AbyssNPCs npc.netAlways = true; npc.dontCountMe = true; npc.chaseable = false; - if (Main.expertMode) + npc.canGhostHeal = false; + if (Main.expertMode) { npc.scale = 1.15f; } @@ -339,7 +340,9 @@ namespace CalamityMod.NPCs.AbyssNPCs { Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); } - } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AquaticScourgeGores/ASTail"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AquaticScourgeGores/ASTail2"), 1f); + } } public override void OnHitPlayer(Player player, int damage, bool crit) diff --git a/NPCs/AbyssNPCs/AquaticSeekerBody.cs b/NPCs/AbyssNPCs/AquaticSeekerBody.cs index 927cb8cffd..32429e9f1a 100644 --- a/NPCs/AbyssNPCs/AquaticSeekerBody.cs +++ b/NPCs/AbyssNPCs/AquaticSeekerBody.cs @@ -46,6 +46,8 @@ namespace CalamityMod.NPCs.AbyssNPCs npc.DeathSound = SoundID.NPCDeath1; npc.netAlways = true; npc.dontCountMe = true; + banner = mod.NPCType("AquaticSeekerHead"); + bannerItem = mod.ItemType("AquaticSeekerBanner"); } public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) @@ -291,7 +293,8 @@ namespace CalamityMod.NPCs.AbyssNPCs { Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); } - } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AquaticScourgeGores/AquaticSeekerBody"), 1f); + } } } } \ No newline at end of file diff --git a/NPCs/AbyssNPCs/AquaticSeekerHead.cs b/NPCs/AbyssNPCs/AquaticSeekerHead.cs index 9354f1d806..0ad40b4a5a 100644 --- a/NPCs/AbyssNPCs/AquaticSeekerHead.cs +++ b/NPCs/AbyssNPCs/AquaticSeekerHead.cs @@ -52,6 +52,8 @@ namespace CalamityMod.NPCs.AbyssNPCs npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; npc.netAlways = true; + banner = npc.type; + bannerItem = mod.ItemType("AquaticSeekerBanner"); } public override void AI() @@ -395,6 +397,7 @@ namespace CalamityMod.NPCs.AbyssNPCs { Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AquaticScourgeGores/AquaticSeekerHead"), 1f); } } diff --git a/NPCs/AbyssNPCs/AquaticSeekerTail.cs b/NPCs/AbyssNPCs/AquaticSeekerTail.cs index eb41500fe8..ac9362aae9 100644 --- a/NPCs/AbyssNPCs/AquaticSeekerTail.cs +++ b/NPCs/AbyssNPCs/AquaticSeekerTail.cs @@ -46,6 +46,8 @@ namespace CalamityMod.NPCs.AbyssNPCs npc.DeathSound = SoundID.NPCDeath1; npc.netAlways = true; npc.dontCountMe = true; + banner = mod.NPCType("AquaticSeekerHead"); + bannerItem = mod.ItemType("AquaticSeekerBanner"); } public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) @@ -291,7 +293,8 @@ namespace CalamityMod.NPCs.AbyssNPCs { Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); } - } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AquaticScourgeGores/AquaticSeekerTail"), 1f); + } } } } \ No newline at end of file diff --git a/NPCs/AbyssNPCs/AquaticUrchin.cs b/NPCs/AbyssNPCs/AquaticUrchin.cs index 875265accc..b711a7012c 100644 --- a/NPCs/AbyssNPCs/AquaticUrchin.cs +++ b/NPCs/AbyssNPCs/AquaticUrchin.cs @@ -40,6 +40,8 @@ namespace CalamityMod.NPCs.AbyssNPCs npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath15; npc.behindTiles = true; + banner = npc.type; + bannerItem = mod.ItemType("AquaticUrchinBanner"); } public override void AI() @@ -357,6 +359,9 @@ namespace CalamityMod.NPCs.AbyssNPCs { Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AquaticScourgeGores/AquaticUrchin"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AquaticScourgeGores/AquaticUrchin2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AquaticScourgeGores/AquaticUrchin3"), 1f); } } } diff --git a/NPCs/AbyssNPCs/Bloatfish.cs b/NPCs/AbyssNPCs/Bloatfish.cs index 816f5abebd..b12e5d3d73 100644 --- a/NPCs/AbyssNPCs/Bloatfish.cs +++ b/NPCs/AbyssNPCs/Bloatfish.cs @@ -33,7 +33,9 @@ namespace CalamityMod.NPCs.AbyssNPCs npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; npc.knockBackResist = 0.9f; - } + banner = npc.type; + bannerItem = mod.ItemType("BloatfishBanner"); + } public override void AI() { @@ -178,8 +180,8 @@ namespace CalamityMod.NPCs.AbyssNPCs { if (spawnInfo.player.GetModPlayer(mod).ZoneAbyssLayer4 && spawnInfo.water && NPC.CountNPCS(mod.NPCType("Bloatfish")) < 3) { - return 0.05f; - } + return SpawnCondition.CaveJellyfish.Chance * 0.3f; + } return 0f; } @@ -216,7 +218,8 @@ namespace CalamityMod.NPCs.AbyssNPCs Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); } } - if (npc.scale < 2f){ + if (npc.scale < 2f) + { npc.scale += 0.05f; } } diff --git a/NPCs/AbyssNPCs/BobbitWormHead.cs b/NPCs/AbyssNPCs/BobbitWormHead.cs index 18356016c9..10587e67bb 100644 --- a/NPCs/AbyssNPCs/BobbitWormHead.cs +++ b/NPCs/AbyssNPCs/BobbitWormHead.cs @@ -33,6 +33,8 @@ namespace CalamityMod.NPCs.AbyssNPCs npc.buffImmune[mod.BuffType("CrushDepth")] = true; npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; + banner = npc.type; + bannerItem = mod.ItemType("BobbitWormBanner"); } public override void AI() diff --git a/NPCs/AbyssNPCs/BobbitWormSegment.cs b/NPCs/AbyssNPCs/BobbitWormSegment.cs index 88a9dc85ca..7560a98c43 100644 --- a/NPCs/AbyssNPCs/BobbitWormSegment.cs +++ b/NPCs/AbyssNPCs/BobbitWormSegment.cs @@ -56,8 +56,8 @@ namespace CalamityMod.NPCs.AbyssNPCs if (spawnInfo.player.GetModPlayer(mod).ZoneAbyssLayer4 && spawnInfo.water) { if (!NPC.AnyNPCs(mod.NPCType("BobbitWormSegment"))) - return 0.01f; - } + return SpawnCondition.CaveJellyfish.Chance * 0.3f; + } return 0f; } diff --git a/NPCs/AbyssNPCs/BoxJellyfish.cs b/NPCs/AbyssNPCs/BoxJellyfish.cs index cfd2f35c72..c09e905732 100644 --- a/NPCs/AbyssNPCs/BoxJellyfish.cs +++ b/NPCs/AbyssNPCs/BoxJellyfish.cs @@ -33,7 +33,9 @@ namespace CalamityMod.NPCs.AbyssNPCs npc.value = Item.buyPrice(0, 0, 0, 80); npc.HitSound = SoundID.NPCHit25; npc.DeathSound = SoundID.NPCDeath28; - } + banner = npc.type; + bannerItem = mod.ItemType("BoxJellyfishBanner"); + } public override void AI() { @@ -186,7 +188,7 @@ namespace CalamityMod.NPCs.AbyssNPCs } if (spawnInfo.player.GetModPlayer(mod).ZoneAbyssLayer1 && spawnInfo.water) { - return 0.2f; + return SpawnCondition.CaveJellyfish.Chance * 1.2f; } return SpawnCondition.OceanMonster.Chance * 0.1f; } diff --git a/NPCs/AbyssNPCs/Catfish.cs b/NPCs/AbyssNPCs/Catfish.cs index a32b1dccef..e5a42c6d87 100644 --- a/NPCs/AbyssNPCs/Catfish.cs +++ b/NPCs/AbyssNPCs/Catfish.cs @@ -38,7 +38,9 @@ namespace CalamityMod.NPCs.AbyssNPCs npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath40; npc.knockBackResist = 0.8f; - } + banner = npc.type; + bannerItem = mod.ItemType("CatfishBanner"); + } public override void AI() { diff --git a/NPCs/AbyssNPCs/ChaoticPuffer.cs b/NPCs/AbyssNPCs/ChaoticPuffer.cs index 6683ce2ad2..1f0a97f211 100644 --- a/NPCs/AbyssNPCs/ChaoticPuffer.cs +++ b/NPCs/AbyssNPCs/ChaoticPuffer.cs @@ -1,242 +1,244 @@ -using System; -using System.Collections.Generic; -using System.IO; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Projectiles; - -namespace CalamityMod.NPCs.AbyssNPCs -{ - public class ChaoticPuffer : ModNPC - { - public bool puffedUp = false; - public bool puffing = false; - public bool unpuffing = false; - public int puffTimer = 0; - public int puffingTimer = 0; - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Chaotic Puffer"); - Main.npcFrameCount[npc.type] = 11; - } - - public override void SetDefaults() - { - npc.noGravity = true; - npc.width = 78; - npc.height = 70; - npc.defense = 25; - npc.lifeMax = 7500; - npc.aiStyle = -1; - aiType = -1; - npc.knockBackResist = 0f; - npc.buffImmune[mod.BuffType("CrushDepth")] = true; - npc.value = Item.buyPrice(0, 0, 30, 0); - npc.HitSound = SoundID.NPCHit23; - npc.DeathSound = SoundID.NPCDeath28; - } - - public override void AI() - { - npc.TargetClosest(true); - npc.velocity.X = npc.velocity.X + (float)npc.direction * 0.03f; - npc.velocity.Y = npc.velocity.Y + (float)npc.directionY * 0.03f; - - npc.damage = puffedUp ? (Main.expertMode ? 230 : 115) : 0; - - - if( !puffing || !unpuffing){ - ++puffTimer; - } - - if(puffTimer >= 300){ - - if( !puffedUp ){ - puffing = true; - } else { - unpuffing = true; - } - - puffTimer = 0; - - }else if( puffing || unpuffing){ - - ++puffingTimer; - - if( puffingTimer > 16 && puffing){ - - puffing = false; - puffedUp = true; - puffingTimer = 0; - - } else if( puffingTimer > 16 && unpuffing){ - - unpuffing = false; - puffedUp = false; - puffingTimer = 0; - - } - - } - - if(npc.velocity.X >= 1 || npc.velocity.X <= -1) { - - npc.velocity.X = npc.velocity.X * 0.97f; - - } - - if(npc.velocity.Y >= 1 || npc.velocity.Y <= -1) { - - npc.velocity.Y = npc.velocity.Y * 0.97f; - - } - - npc.rotation += npc.velocity.X * 0.05f; - - } - - public void Boom() - { - Main.PlaySound(4, (int)npc.position.X, (int)npc.position.Y, 14); - if (Main.netMode != 1 && puffedUp) - { - int damageBoom = 100; - int projectileType = mod.ProjectileType("PufferExplosion"); - int boom = Projectile.NewProjectile(npc.Center.X, npc.Center.Y, 0, 0, projectileType, damageBoom, 0f, Main.myPlayer, 0f, 0f); - } - npc.netUpdate = true; - } - - - public override void PostDraw(SpriteBatch spriteBatch, Color drawColor) - { - SpriteEffects spriteEffects = SpriteEffects.None; - if (npc.spriteDirection == 1) - { - spriteEffects = SpriteEffects.FlipHorizontally; - } - Vector2 center = new Vector2(npc.Center.X, npc.Center.Y); - Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2)); - Vector2 vector = center - Main.screenPosition; - vector -= new Vector2((float)mod.GetTexture("NPCs/AbyssNPCs/ChaoticPufferGlow").Width, (float)(mod.GetTexture("NPCs/AbyssNPCs/ChaoticPufferGlow").Height / Main.npcFrameCount[npc.type])) * 1f / 2f; - vector += vector11 * 1f + new Vector2(0f, 0f + 4f + npc.gfxOffY); - Microsoft.Xna.Framework.Color color = new Microsoft.Xna.Framework.Color(127 - npc.alpha, 127 - npc.alpha, 127 - npc.alpha, 0).MultiplyRGBA(Microsoft.Xna.Framework.Color.Yellow); - Main.spriteBatch.Draw(mod.GetTexture("NPCs/AbyssNPCs/ChaoticPufferGlow"), vector, - new Microsoft.Xna.Framework.Rectangle?(npc.frame), color, npc.rotation, vector11, 1f, spriteEffects, 0f); - } - - public override void FindFrame(int frameHeight) - { - npc.frameCounter += 1.0; - if (npc.frameCounter > 6.0) - { - npc.frameCounter = 0.0; - if(!unpuffing){ - npc.frame.Y = npc.frame.Y + frameHeight; - } else { - npc.frame.Y = npc.frame.Y - frameHeight; - } - } - if( puffing ) - { - if (npc.frame.Y < frameHeight * 3) - { - npc.frame.Y = frameHeight * 3; - } - if (npc.frame.Y > frameHeight * 6) - { - npc.frame.Y = frameHeight * 3; - } - } - else if ( unpuffing ) - { - if (npc.frame.Y > frameHeight * 6) - { - npc.frame.Y = frameHeight * 6; - } - if (npc.frame.Y < frameHeight * 3) - { - npc.frame.Y = frameHeight * 6; - } - } - else if (!puffedUp) - { - if (npc.frame.Y > frameHeight * 3) - { - npc.frame.Y = 0; - } - } - else - { - if (npc.frame.Y < frameHeight * 7) - { - npc.frame.Y = frameHeight * 7; - } - if (npc.frame.Y > frameHeight * 10) - { - npc.frame.Y = frameHeight * 7; - } - } - - } - - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - if (spawnInfo.player.GetModPlayer(mod).ZoneAbyssLayer4 && spawnInfo.water) - { - return 0.1f; - } - return 0f; - } - - public override void NPCLoot() - { - if (Main.rand.Next(1000) == 0 && CalamityWorld.revenge) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("HalibutCannon")); - } - if (NPC.downedGolemBoss) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ChaoticOre"), Main.rand.Next(10, 27)); - } - } - - public override void OnHitPlayer(Player player, int damage, bool crit) - { - player.AddBuff(mod.BuffType("BrimstoneFlames"), 300); - - if (puffedUp) - { - Boom(); - npc.active = false; - } - } - - public override void ModifyHitByProjectile(Projectile projectile, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) - { - npc.velocity.X = projectile.velocity.X; - npc.velocity.Y = projectile.velocity.Y; - } - - public override void HitEffect(int hitDirection, double damage) - { - for (int k = 0; k < 3; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); - } - if (npc.life <= 0) - { - Boom(); - - for (int k = 0; k < 15; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); - } - } - } - } +using System; +using System.Collections.Generic; +using System.IO; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Projectiles; + +namespace CalamityMod.NPCs.AbyssNPCs +{ + public class ChaoticPuffer : ModNPC + { + public bool puffedUp = false; + public bool puffing = false; + public bool unpuffing = false; + public int puffTimer = 0; + public int puffingTimer = 0; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Chaotic Puffer"); + Main.npcFrameCount[npc.type] = 11; + } + + public override void SetDefaults() + { + npc.noGravity = true; + npc.width = 78; + npc.height = 70; + npc.defense = 25; + npc.lifeMax = 7500; + npc.aiStyle = -1; + aiType = -1; + npc.knockBackResist = 0f; + npc.buffImmune[mod.BuffType("CrushDepth")] = true; + npc.value = Item.buyPrice(0, 0, 30, 0); + npc.HitSound = SoundID.NPCHit23; + npc.DeathSound = SoundID.NPCDeath28; + banner = npc.type; + bannerItem = mod.ItemType("ChaoticPufferBanner"); + } + + public override void AI() + { + npc.TargetClosest(true); + npc.velocity.X = npc.velocity.X + (float)npc.direction * 0.03f; + npc.velocity.Y = npc.velocity.Y + (float)npc.directionY * 0.03f; + + npc.damage = puffedUp ? (Main.expertMode ? 230 : 115) : 0; + + + if( !puffing || !unpuffing){ + ++puffTimer; + } + + if(puffTimer >= 300){ + + if( !puffedUp ){ + puffing = true; + } else { + unpuffing = true; + } + + puffTimer = 0; + + }else if( puffing || unpuffing){ + + ++puffingTimer; + + if( puffingTimer > 16 && puffing){ + + puffing = false; + puffedUp = true; + puffingTimer = 0; + + } else if( puffingTimer > 16 && unpuffing){ + + unpuffing = false; + puffedUp = false; + puffingTimer = 0; + + } + + } + + if(npc.velocity.X >= 1 || npc.velocity.X <= -1) { + + npc.velocity.X = npc.velocity.X * 0.97f; + + } + + if(npc.velocity.Y >= 1 || npc.velocity.Y <= -1) { + + npc.velocity.Y = npc.velocity.Y * 0.97f; + + } + + npc.rotation += npc.velocity.X * 0.05f; + + } + + public void Boom() + { + Main.PlaySound(4, (int)npc.position.X, (int)npc.position.Y, 14); + if (Main.netMode != 1 && puffedUp) + { + int damageBoom = 100; + int projectileType = mod.ProjectileType("PufferExplosion"); + int boom = Projectile.NewProjectile(npc.Center.X, npc.Center.Y, 0, 0, projectileType, damageBoom, 0f, Main.myPlayer, 0f, 0f); + } + npc.netUpdate = true; + } + + + public override void PostDraw(SpriteBatch spriteBatch, Color drawColor) + { + SpriteEffects spriteEffects = SpriteEffects.None; + if (npc.spriteDirection == 1) + { + spriteEffects = SpriteEffects.FlipHorizontally; + } + Vector2 center = new Vector2(npc.Center.X, npc.Center.Y); + Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2)); + Vector2 vector = center - Main.screenPosition; + vector -= new Vector2((float)mod.GetTexture("NPCs/AbyssNPCs/ChaoticPufferGlow").Width, (float)(mod.GetTexture("NPCs/AbyssNPCs/ChaoticPufferGlow").Height / Main.npcFrameCount[npc.type])) * 1f / 2f; + vector += vector11 * 1f + new Vector2(0f, 0f + 4f + npc.gfxOffY); + Microsoft.Xna.Framework.Color color = new Microsoft.Xna.Framework.Color(127 - npc.alpha, 127 - npc.alpha, 127 - npc.alpha, 0).MultiplyRGBA(Microsoft.Xna.Framework.Color.Yellow); + Main.spriteBatch.Draw(mod.GetTexture("NPCs/AbyssNPCs/ChaoticPufferGlow"), vector, + new Microsoft.Xna.Framework.Rectangle?(npc.frame), color, npc.rotation, vector11, 1f, spriteEffects, 0f); + } + + public override void FindFrame(int frameHeight) + { + npc.frameCounter += 1.0; + if (npc.frameCounter > 6.0) + { + npc.frameCounter = 0.0; + if(!unpuffing){ + npc.frame.Y = npc.frame.Y + frameHeight; + } else { + npc.frame.Y = npc.frame.Y - frameHeight; + } + } + if( puffing ) + { + if (npc.frame.Y < frameHeight * 3) + { + npc.frame.Y = frameHeight * 3; + } + if (npc.frame.Y > frameHeight * 6) + { + npc.frame.Y = frameHeight * 3; + } + } + else if ( unpuffing ) + { + if (npc.frame.Y > frameHeight * 6) + { + npc.frame.Y = frameHeight * 6; + } + if (npc.frame.Y < frameHeight * 3) + { + npc.frame.Y = frameHeight * 6; + } + } + else if (!puffedUp) + { + if (npc.frame.Y > frameHeight * 3) + { + npc.frame.Y = 0; + } + } + else + { + if (npc.frame.Y < frameHeight * 7) + { + npc.frame.Y = frameHeight * 7; + } + if (npc.frame.Y > frameHeight * 10) + { + npc.frame.Y = frameHeight * 7; + } + } + + } + + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + if (spawnInfo.player.GetModPlayer(mod).ZoneAbyssLayer4 && spawnInfo.water) + { + return SpawnCondition.CaveJellyfish.Chance * 0.6f; + } + return 0f; + } + + public override void NPCLoot() + { + if (Main.rand.Next(1000) == 0 && CalamityWorld.revenge) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("HalibutCannon")); + } + if (NPC.downedGolemBoss) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ChaoticOre"), Main.rand.Next(10, 27)); + } + } + + public override void OnHitPlayer(Player player, int damage, bool crit) + { + player.AddBuff(mod.BuffType("BrimstoneFlames"), 300); + + if (puffedUp) + { + Boom(); + npc.active = false; + } + } + + public override void ModifyHitByProjectile(Projectile projectile, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) + { + npc.velocity.X = projectile.velocity.X; + npc.velocity.Y = projectile.velocity.Y; + } + + public override void HitEffect(int hitDirection, double damage) + { + for (int k = 0; k < 3; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + } + if (npc.life <= 0) + { + Boom(); + + for (int k = 0; k < 15; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + } + } + } + } } \ No newline at end of file diff --git a/NPCs/AbyssNPCs/ColossalSquid.cs b/NPCs/AbyssNPCs/ColossalSquid.cs index 79255ec5ed..8756e041f5 100644 --- a/NPCs/AbyssNPCs/ColossalSquid.cs +++ b/NPCs/AbyssNPCs/ColossalSquid.cs @@ -43,7 +43,9 @@ namespace CalamityMod.NPCs.AbyssNPCs npc.HitSound = SoundID.NPCHit20; npc.DeathSound = SoundID.NPCDeath23; npc.rarity = 2; - } + banner = npc.type; + bannerItem = mod.ItemType("ColossalSquidBanner"); + } public override void AI() { @@ -508,8 +510,8 @@ namespace CalamityMod.NPCs.AbyssNPCs if (spawnInfo.player.GetModPlayer(mod).ZoneAbyssLayer3 && spawnInfo.water && !NPC.AnyNPCs(mod.NPCType("ColossalSquid")) && !NPC.AnyNPCs(mod.NPCType("Reaper")) && !NPC.AnyNPCs(mod.NPCType("EidolonWyrmHead")) && !NPC.AnyNPCs(mod.NPCType("EidolonWyrmHeadHuge"))) { - return 0.2f; - } + return SpawnCondition.CaveJellyfish.Chance * 0.6f; + } return 0f; } diff --git a/NPCs/AbyssNPCs/Cuttlefish.cs b/NPCs/AbyssNPCs/Cuttlefish.cs index 5ef8476e99..56cc16d12e 100644 --- a/NPCs/AbyssNPCs/Cuttlefish.cs +++ b/NPCs/AbyssNPCs/Cuttlefish.cs @@ -34,7 +34,9 @@ namespace CalamityMod.NPCs.AbyssNPCs npc.HitSound = SoundID.NPCHit33; npc.DeathSound = SoundID.NPCDeath28; npc.knockBackResist = 0.3f; - } + banner = npc.type; + bannerItem = mod.ItemType("CuttlefishBanner"); + } public override void AI() { @@ -299,11 +301,11 @@ namespace CalamityMod.NPCs.AbyssNPCs { if (spawnInfo.player.GetModPlayer(mod).ZoneAbyssLayer1 && spawnInfo.water) { - return 0.1f; + return SpawnCondition.CaveJellyfish.Chance * 0.3f; } if (spawnInfo.player.GetModPlayer(mod).ZoneAbyssLayer2 && spawnInfo.water) { - return 0.2f; + return SpawnCondition.CaveJellyfish.Chance * 0.6f; } return 0f; } diff --git a/NPCs/AbyssNPCs/DevilFish.cs b/NPCs/AbyssNPCs/DevilFish.cs index 73bbe3acd7..678b7468f9 100644 --- a/NPCs/AbyssNPCs/DevilFish.cs +++ b/NPCs/AbyssNPCs/DevilFish.cs @@ -1,336 +1,338 @@ -using System; -using System.Collections.Generic; -using System.IO; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Projectiles; - -namespace CalamityMod.NPCs.AbyssNPCs -{ - public class DevilFish : ModNPC - { - public bool hasBeenHit = false; - public bool brokenMask = false; - public int hitCounter = 0; - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Devil Fish"); - Main.npcFrameCount[npc.type] = 8; - } - - public override void SetDefaults() - { - npc.noGravity = true; - npc.damage = 60; - npc.width = 126; - npc.height = 66; - npc.defense = 999999; - npc.lifeMax = 200; - npc.aiStyle = -1; - aiType = -1; - npc.buffImmune[mod.BuffType("CrushDepth")] = true; - npc.value = Item.buyPrice(0, 0, 10, 0); - npc.HitSound = SoundID.NPCHit4; - npc.DeathSound = SoundID.NPCDeath1; - npc.knockBackResist = 0.85f; - } - - public override void AI() - { - Player player = Main.player[npc.target]; - float speedBoost = brokenMask ? 1.5f : 1; - npc.spriteDirection = ((npc.direction > 0) ? 1 : -1); - npc.noGravity = true; - if (npc.direction == 0) - { - npc.TargetClosest(true); - } - npc.chaseable = hasBeenHit; - - if(hitCounter >= 5 && !brokenMask) - { - brokenMask = true; - npc.HitSound = SoundID.NPCHit1; - npc.defense = 15; - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DevilFishMask1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DevilFishMask2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DevilFishMask3"), 1f); - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/DevilMaskBreak"), (int)npc.position.X, (int)npc.position.Y); - } - - if (npc.wet) - { - bool flag14 = brokenMask; - npc.TargetClosest(false); - if (player.statLife <= player.statLifeMax2 / 4) - { - flag14 = true; - } - if ((!player.wet || player.dead) && flag14) - { - flag14 = false; - } - if (!flag14) - { - if (npc.collideX) - { - npc.velocity.X = npc.velocity.X * -1f; - npc.direction *= -1; - npc.netUpdate = true; - } - if (npc.collideY) - { - npc.netUpdate = true; - if (npc.velocity.Y > 0f) - { - npc.velocity.Y = Math.Abs(npc.velocity.Y) * -1f; - npc.directionY = -1; - npc.ai[0] = -1f; - } - else if (npc.velocity.Y < 0f) - { - npc.velocity.Y = Math.Abs(npc.velocity.Y); - npc.directionY = 1; - npc.ai[0] = 1f; - } - } - } - if (flag14) - { - npc.TargetClosest(true); - npc.velocity.X = npc.velocity.X + (float)npc.direction * 0.25f * speedBoost; - npc.velocity.Y = npc.velocity.Y + (float)npc.directionY * 0.15f * speedBoost; - if (npc.velocity.X > 6f * speedBoost) - { - npc.velocity.X = 6f * speedBoost; - } - if (npc.velocity.X < -6f * speedBoost) - { - npc.velocity.X = -6f * speedBoost; - } - if (npc.velocity.Y > 6f * speedBoost) - { - npc.velocity.Y = 6f * speedBoost; - } - if (npc.velocity.Y < -6f * speedBoost) - { - npc.velocity.Y = -6f * speedBoost; - } - } - else - { - npc.velocity.X = npc.velocity.X + (float)npc.direction * 0.1f; - if (npc.velocity.X < -2.5f || npc.velocity.X > 2.5f) - { - npc.velocity.X = npc.velocity.X * 0.95f; - } - if (npc.ai[0] == -1f) - { - npc.velocity.Y = npc.velocity.Y - 0.01f; - if ((double)npc.velocity.Y < -0.3) - { - npc.ai[0] = 1f; - } - } - else - { - npc.velocity.Y = npc.velocity.Y + 0.01f; - if ((double)npc.velocity.Y > 0.3) - { - npc.ai[0] = -1f; - } - } - } - int num258 = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int num259 = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - if (Main.tile[num258, num259 - 1] == null) - { - Main.tile[num258, num259 - 1] = new Tile(); - } - if (Main.tile[num258, num259 + 1] == null) - { - Main.tile[num258, num259 + 1] = new Tile(); - } - if (Main.tile[num258, num259 + 2] == null) - { - Main.tile[num258, num259 + 2] = new Tile(); - } - if (Main.tile[num258, num259 - 1].liquid > 128) - { - if (Main.tile[num258, num259 + 1].active()) - { - npc.ai[0] = -1f; - } - else if (Main.tile[num258, num259 + 2].active()) - { - npc.ai[0] = -1f; - } - } - if ((double)npc.velocity.Y > 0.4 || (double)npc.velocity.Y < -0.4) - { - npc.velocity.Y = npc.velocity.Y * 0.95f; - } - } - else - { - if (npc.velocity.Y == 0f) - { - npc.velocity.X = npc.velocity.X * 0.94f; - if ((double)npc.velocity.X > -0.2 && (double)npc.velocity.X < 0.2) - { - npc.velocity.X = 0f; - } - } - npc.velocity.Y = npc.velocity.Y + 0.3f; - if (npc.velocity.Y > 10f) - { - npc.velocity.Y = 10f; - } - npc.ai[0] = 1f; - } - npc.rotation = npc.velocity.Y * (float)npc.direction * 0.1f; - if ((double)npc.rotation < -0.2) - { - npc.rotation = -0.2f; - } - if ((double)npc.rotation > 0.2) - { - npc.rotation = 0.2f; - return; - } - } - - public override bool? CanBeHitByProjectile(Projectile projectile) - { - if (projectile.minion) - { - return hasBeenHit; - } - return null; - } - - public override void FindFrame(int frameHeight) - { - if (!npc.wet) - { - npc.frameCounter = 0.0; - return; - } - npc.frameCounter += 1.0; - if (npc.frameCounter > 6.0) - { - npc.frameCounter = 0.0; - npc.frame.Y = npc.frame.Y + frameHeight; - } - if (!brokenMask) - { - if (npc.frame.Y > frameHeight * 3) - { - npc.frame.Y = 0; - } - } - else - { - if (npc.frame.Y < frameHeight * 4) - { - npc.frame.Y = frameHeight * 4; - } - if (npc.frame.Y > frameHeight * 7) - { - npc.frame.Y = frameHeight * 4; - } - } - } - - public override void PostDraw(SpriteBatch spriteBatch, Color drawColor) - { - SpriteEffects spriteEffects = SpriteEffects.None; - if (npc.spriteDirection == 1) - { - spriteEffects = SpriteEffects.FlipHorizontally; - } - Vector2 center = new Vector2(npc.Center.X, npc.Center.Y); - Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2)); - Vector2 vector = center - Main.screenPosition; - vector -= new Vector2((float)mod.GetTexture("NPCs/AbyssNPCs/DevilFishGlow").Width, (float)(mod.GetTexture("NPCs/AbyssNPCs/DevilFishGlow").Height / Main.npcFrameCount[npc.type])) * 1f / 2f; - vector += vector11 * 1f + new Vector2(0f, 0f + 4f + npc.gfxOffY); - Microsoft.Xna.Framework.Color color = new Microsoft.Xna.Framework.Color(127 - npc.alpha, 127 - npc.alpha, 127 - npc.alpha, 0).MultiplyRGBA(Microsoft.Xna.Framework.Color.Red); - Main.spriteBatch.Draw(mod.GetTexture("NPCs/AbyssNPCs/DevilFishGlow"), vector, - new Microsoft.Xna.Framework.Rectangle?(npc.frame), color, npc.rotation, vector11, 1f, spriteEffects, 0f); - } - - public override void OnHitPlayer(Player player, int damage, bool crit) - { - player.AddBuff(mod.BuffType("CrushDepth"), 180, true); - if (CalamityWorld.revenge) - { - player.AddBuff(mod.BuffType("MarkedforDeath"), 120); - player.AddBuff(mod.BuffType("Horror"), 120, true); - } - } - - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - if (spawnInfo.player.GetModPlayer(mod).ZoneAbyssLayer1 && spawnInfo.water) - { - return 0.075f; - } - if (spawnInfo.player.GetModPlayer(mod).ZoneAbyssLayer2 && spawnInfo.water) - { - return 0.1f; - } - return 0f; - } - - public override void NPCLoot() - { - if (Main.rand.Next(1000) == 0 && CalamityWorld.revenge) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("HalibutCannon")); - } - if (NPC.downedPlantBoss || CalamityWorld.downedCalamitas) - { - if (Main.rand.Next(2) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Lumenite")); - } - if (Main.rand.Next(2) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DepthCells"), Main.rand.Next(1, 3)); - } - if (Main.expertMode && Main.rand.Next(2) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DepthCells")); - } - } - if (NPC.downedGolemBoss) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ChaoticOre"), Main.rand.Next(3, 10)); - } - } - - public override void HitEffect(int hitDirection, double damage) - { - for (int k = 0; k < 5; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); - } - if (npc.life <= 0) - { - for (int k = 0; k < 25; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); - } - } - - if(hitCounter <= 5) - { - ++hitCounter; - } - } - } +using System; +using System.Collections.Generic; +using System.IO; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Projectiles; + +namespace CalamityMod.NPCs.AbyssNPCs +{ + public class DevilFish : ModNPC + { + public bool hasBeenHit = false; + public bool brokenMask = false; + public int hitCounter = 0; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Devil Fish"); + Main.npcFrameCount[npc.type] = 8; + } + + public override void SetDefaults() + { + npc.noGravity = true; + npc.damage = 60; + npc.width = 126; + npc.height = 66; + npc.defense = 999999; + npc.lifeMax = 200; + npc.aiStyle = -1; + aiType = -1; + npc.buffImmune[mod.BuffType("CrushDepth")] = true; + npc.value = Item.buyPrice(0, 0, 10, 0); + npc.HitSound = SoundID.NPCHit4; + npc.DeathSound = SoundID.NPCDeath1; + npc.knockBackResist = 0.85f; + banner = npc.type; + bannerItem = mod.ItemType("DevilFishBanner"); + } + + public override void AI() + { + Player player = Main.player[npc.target]; + float speedBoost = brokenMask ? 1.5f : 1; + npc.spriteDirection = ((npc.direction > 0) ? 1 : -1); + npc.noGravity = true; + if (npc.direction == 0) + { + npc.TargetClosest(true); + } + npc.chaseable = hasBeenHit; + + if(hitCounter >= 5 && !brokenMask) + { + brokenMask = true; + npc.HitSound = SoundID.NPCHit1; + npc.defense = 15; + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DevilFishMask1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DevilFishMask2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DevilFishMask3"), 1f); + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/DevilMaskBreak"), (int)npc.position.X, (int)npc.position.Y); + } + + if (npc.wet) + { + bool flag14 = brokenMask; + npc.TargetClosest(false); + if (player.statLife <= player.statLifeMax2 / 4) + { + flag14 = true; + } + if ((!player.wet || player.dead) && flag14) + { + flag14 = false; + } + if (!flag14) + { + if (npc.collideX) + { + npc.velocity.X = npc.velocity.X * -1f; + npc.direction *= -1; + npc.netUpdate = true; + } + if (npc.collideY) + { + npc.netUpdate = true; + if (npc.velocity.Y > 0f) + { + npc.velocity.Y = Math.Abs(npc.velocity.Y) * -1f; + npc.directionY = -1; + npc.ai[0] = -1f; + } + else if (npc.velocity.Y < 0f) + { + npc.velocity.Y = Math.Abs(npc.velocity.Y); + npc.directionY = 1; + npc.ai[0] = 1f; + } + } + } + if (flag14) + { + npc.TargetClosest(true); + npc.velocity.X = npc.velocity.X + (float)npc.direction * 0.25f * speedBoost; + npc.velocity.Y = npc.velocity.Y + (float)npc.directionY * 0.15f * speedBoost; + if (npc.velocity.X > 6f * speedBoost) + { + npc.velocity.X = 6f * speedBoost; + } + if (npc.velocity.X < -6f * speedBoost) + { + npc.velocity.X = -6f * speedBoost; + } + if (npc.velocity.Y > 6f * speedBoost) + { + npc.velocity.Y = 6f * speedBoost; + } + if (npc.velocity.Y < -6f * speedBoost) + { + npc.velocity.Y = -6f * speedBoost; + } + } + else + { + npc.velocity.X = npc.velocity.X + (float)npc.direction * 0.1f; + if (npc.velocity.X < -2.5f || npc.velocity.X > 2.5f) + { + npc.velocity.X = npc.velocity.X * 0.95f; + } + if (npc.ai[0] == -1f) + { + npc.velocity.Y = npc.velocity.Y - 0.01f; + if ((double)npc.velocity.Y < -0.3) + { + npc.ai[0] = 1f; + } + } + else + { + npc.velocity.Y = npc.velocity.Y + 0.01f; + if ((double)npc.velocity.Y > 0.3) + { + npc.ai[0] = -1f; + } + } + } + int num258 = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int num259 = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + if (Main.tile[num258, num259 - 1] == null) + { + Main.tile[num258, num259 - 1] = new Tile(); + } + if (Main.tile[num258, num259 + 1] == null) + { + Main.tile[num258, num259 + 1] = new Tile(); + } + if (Main.tile[num258, num259 + 2] == null) + { + Main.tile[num258, num259 + 2] = new Tile(); + } + if (Main.tile[num258, num259 - 1].liquid > 128) + { + if (Main.tile[num258, num259 + 1].active()) + { + npc.ai[0] = -1f; + } + else if (Main.tile[num258, num259 + 2].active()) + { + npc.ai[0] = -1f; + } + } + if ((double)npc.velocity.Y > 0.4 || (double)npc.velocity.Y < -0.4) + { + npc.velocity.Y = npc.velocity.Y * 0.95f; + } + } + else + { + if (npc.velocity.Y == 0f) + { + npc.velocity.X = npc.velocity.X * 0.94f; + if ((double)npc.velocity.X > -0.2 && (double)npc.velocity.X < 0.2) + { + npc.velocity.X = 0f; + } + } + npc.velocity.Y = npc.velocity.Y + 0.3f; + if (npc.velocity.Y > 10f) + { + npc.velocity.Y = 10f; + } + npc.ai[0] = 1f; + } + npc.rotation = npc.velocity.Y * (float)npc.direction * 0.1f; + if ((double)npc.rotation < -0.2) + { + npc.rotation = -0.2f; + } + if ((double)npc.rotation > 0.2) + { + npc.rotation = 0.2f; + return; + } + } + + public override bool? CanBeHitByProjectile(Projectile projectile) + { + if (projectile.minion) + { + return hasBeenHit; + } + return null; + } + + public override void FindFrame(int frameHeight) + { + if (!npc.wet) + { + npc.frameCounter = 0.0; + return; + } + npc.frameCounter += 1.0; + if (npc.frameCounter > 6.0) + { + npc.frameCounter = 0.0; + npc.frame.Y = npc.frame.Y + frameHeight; + } + if (!brokenMask) + { + if (npc.frame.Y > frameHeight * 3) + { + npc.frame.Y = 0; + } + } + else + { + if (npc.frame.Y < frameHeight * 4) + { + npc.frame.Y = frameHeight * 4; + } + if (npc.frame.Y > frameHeight * 7) + { + npc.frame.Y = frameHeight * 4; + } + } + } + + public override void PostDraw(SpriteBatch spriteBatch, Color drawColor) + { + SpriteEffects spriteEffects = SpriteEffects.None; + if (npc.spriteDirection == 1) + { + spriteEffects = SpriteEffects.FlipHorizontally; + } + Vector2 center = new Vector2(npc.Center.X, npc.Center.Y); + Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2)); + Vector2 vector = center - Main.screenPosition; + vector -= new Vector2((float)mod.GetTexture("NPCs/AbyssNPCs/DevilFishGlow").Width, (float)(mod.GetTexture("NPCs/AbyssNPCs/DevilFishGlow").Height / Main.npcFrameCount[npc.type])) * 1f / 2f; + vector += vector11 * 1f + new Vector2(0f, 0f + 4f + npc.gfxOffY); + Microsoft.Xna.Framework.Color color = new Microsoft.Xna.Framework.Color(127 - npc.alpha, 127 - npc.alpha, 127 - npc.alpha, 0).MultiplyRGBA(Microsoft.Xna.Framework.Color.Red); + Main.spriteBatch.Draw(mod.GetTexture("NPCs/AbyssNPCs/DevilFishGlow"), vector, + new Microsoft.Xna.Framework.Rectangle?(npc.frame), color, npc.rotation, vector11, 1f, spriteEffects, 0f); + } + + public override void OnHitPlayer(Player player, int damage, bool crit) + { + player.AddBuff(mod.BuffType("CrushDepth"), 180, true); + if (CalamityWorld.revenge) + { + player.AddBuff(mod.BuffType("MarkedforDeath"), 120); + player.AddBuff(mod.BuffType("Horror"), 120, true); + } + } + + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + if (spawnInfo.player.GetModPlayer(mod).ZoneAbyssLayer1 && spawnInfo.water) + { + return SpawnCondition.CaveJellyfish.Chance * 0.45f; + } + if (spawnInfo.player.GetModPlayer(mod).ZoneAbyssLayer2 && spawnInfo.water) + { + return SpawnCondition.CaveJellyfish.Chance * 0.6f; + } + return 0f; + } + + public override void NPCLoot() + { + if (Main.rand.Next(1000) == 0 && CalamityWorld.revenge) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("HalibutCannon")); + } + if (NPC.downedPlantBoss || CalamityWorld.downedCalamitas) + { + if (Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Lumenite")); + } + if (Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DepthCells"), Main.rand.Next(1, 3)); + } + if (Main.expertMode && Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DepthCells")); + } + } + if (NPC.downedGolemBoss) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ChaoticOre"), Main.rand.Next(3, 10)); + } + } + + public override void HitEffect(int hitDirection, double damage) + { + for (int k = 0; k < 5; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + } + if (npc.life <= 0) + { + for (int k = 0; k < 25; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + } + } + + if(hitCounter <= 5) + { + ++hitCounter; + } + } + } } \ No newline at end of file diff --git a/NPCs/AbyssNPCs/EidolonWyrmHead.cs b/NPCs/AbyssNPCs/EidolonWyrmHead.cs index 6db4e4d557..cac563d868 100644 --- a/NPCs/AbyssNPCs/EidolonWyrmHead.cs +++ b/NPCs/AbyssNPCs/EidolonWyrmHead.cs @@ -51,7 +51,9 @@ namespace CalamityMod.NPCs.AbyssNPCs npc.DeathSound = SoundID.NPCDeath6; npc.netAlways = true; npc.rarity = 2; - } + banner = npc.type; + bannerItem = mod.ItemType("EidolonWyrmJuvenileBanner"); + } public override void AI() { @@ -511,13 +513,13 @@ namespace CalamityMod.NPCs.AbyssNPCs if (spawnInfo.player.GetModPlayer(mod).ZoneAbyssLayer3 && spawnInfo.water && !NPC.AnyNPCs(mod.NPCType("EidolonWyrmHead")) && !NPC.AnyNPCs(mod.NPCType("Reaper")) && !NPC.AnyNPCs(mod.NPCType("ColossalSquid")) && !NPC.AnyNPCs(mod.NPCType("EidolonWyrmHeadHuge"))) { - return 0.05f; - } + return SpawnCondition.CaveJellyfish.Chance * 0.3f; + } if (spawnInfo.player.GetModPlayer(mod).ZoneAbyssLayer4 && spawnInfo.water && !NPC.AnyNPCs(mod.NPCType("EidolonWyrmHead")) && !NPC.AnyNPCs(mod.NPCType("Reaper")) && !NPC.AnyNPCs(mod.NPCType("ColossalSquid")) && !NPC.AnyNPCs(mod.NPCType("EidolonWyrmHeadHuge"))) { - return 0.1f; - } + return SpawnCondition.CaveJellyfish.Chance * 0.6f; + } return 0f; } diff --git a/NPCs/AbyssNPCs/EidolonWyrmHeadHuge.cs b/NPCs/AbyssNPCs/EidolonWyrmHeadHuge.cs index 5471429578..c2298a6aa8 100644 --- a/NPCs/AbyssNPCs/EidolonWyrmHeadHuge.cs +++ b/NPCs/AbyssNPCs/EidolonWyrmHeadHuge.cs @@ -509,14 +509,14 @@ namespace CalamityMod.NPCs.AbyssNPCs !NPC.AnyNPCs(mod.NPCType("Reaper")) && !NPC.AnyNPCs(mod.NPCType("EidolonWyrmHead")) && !NPC.AnyNPCs(mod.NPCType("ColossalSquid")) && CalamityWorld.downedPolterghast) { - return 0.001f; - } + return SpawnCondition.CaveJellyfish.Chance * 0.006f; + } if (spawnInfo.player.GetModPlayer(mod).ZoneAbyssLayer4 && spawnInfo.water && !NPC.AnyNPCs(mod.NPCType("EidolonWyrmHeadHuge")) && !NPC.AnyNPCs(mod.NPCType("Reaper")) && !NPC.AnyNPCs(mod.NPCType("EidolonWyrmHead")) && !NPC.AnyNPCs(mod.NPCType("ColossalSquid")) && CalamityWorld.downedPolterghast) { - return 0.002f; - } + return SpawnCondition.CaveJellyfish.Chance * 0.012f; + } return 0f; } diff --git a/NPCs/AbyssNPCs/Flounder.cs b/NPCs/AbyssNPCs/Flounder.cs index 20cc8f6d1b..480b1f3f59 100644 --- a/NPCs/AbyssNPCs/Flounder.cs +++ b/NPCs/AbyssNPCs/Flounder.cs @@ -36,7 +36,9 @@ namespace CalamityMod.NPCs.AbyssNPCs npc.HitSound = SoundID.NPCHit50; npc.DeathSound = SoundID.NPCDeath53; npc.knockBackResist = 0.35f; - } + banner = npc.type; + bannerItem = mod.ItemType("FlounderBanner"); + } public override void AI() { diff --git a/NPCs/AbyssNPCs/Frogfish.cs b/NPCs/AbyssNPCs/Frogfish.cs index 1034940f43..072fd0f314 100644 --- a/NPCs/AbyssNPCs/Frogfish.cs +++ b/NPCs/AbyssNPCs/Frogfish.cs @@ -33,7 +33,9 @@ namespace CalamityMod.NPCs.AbyssNPCs npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; npc.knockBackResist = 0.5f; - } + banner = npc.type; + bannerItem = mod.ItemType("FrogfishBanner"); + } public override void AI() { diff --git a/NPCs/AbyssNPCs/GiantSquid.cs b/NPCs/AbyssNPCs/GiantSquid.cs index 935f72c513..693607dca4 100644 --- a/NPCs/AbyssNPCs/GiantSquid.cs +++ b/NPCs/AbyssNPCs/GiantSquid.cs @@ -34,7 +34,9 @@ namespace CalamityMod.NPCs.AbyssNPCs npc.value = Item.buyPrice(0, 0, 15, 0); npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; - } + banner = npc.type; + bannerItem = mod.ItemType("GiantSquidBanner"); + } public override void AI() { @@ -211,12 +213,12 @@ namespace CalamityMod.NPCs.AbyssNPCs { if (spawnInfo.player.GetModPlayer(mod).ZoneAbyssLayer2 && spawnInfo.water) { - return 0.1f; - } + return SpawnCondition.CaveJellyfish.Chance * 0.6f; + } if (spawnInfo.player.GetModPlayer(mod).ZoneAbyssLayer3 && spawnInfo.water) { - return 0.2f; - } + return SpawnCondition.CaveJellyfish.Chance * 1.2f; + } return 0f; } diff --git a/NPCs/AbyssNPCs/Gnasher.cs b/NPCs/AbyssNPCs/Gnasher.cs index 0b19b46d59..741ed1f51b 100644 --- a/NPCs/AbyssNPCs/Gnasher.cs +++ b/NPCs/AbyssNPCs/Gnasher.cs @@ -35,7 +35,9 @@ namespace CalamityMod.NPCs.AbyssNPCs { npc.buffImmune[k] = true; } - } + banner = npc.type; + bannerItem = mod.ItemType("GnasherBanner"); + } public override void AI() { diff --git a/NPCs/AbyssNPCs/GulperEelBody.cs b/NPCs/AbyssNPCs/GulperEelBody.cs index 3552cb6c4e..739254fbe6 100644 --- a/NPCs/AbyssNPCs/GulperEelBody.cs +++ b/NPCs/AbyssNPCs/GulperEelBody.cs @@ -43,6 +43,8 @@ namespace CalamityMod.NPCs.AbyssNPCs npc.netAlways = true; npc.dontCountMe = true; npc.chaseable = false; + banner = mod.NPCType("GulperEelHead"); + bannerItem = mod.ItemType("GulperEelBanner"); } public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) diff --git a/NPCs/AbyssNPCs/GulperEelBodyAlt.cs b/NPCs/AbyssNPCs/GulperEelBodyAlt.cs index 3fa8950e61..6da8c9ab11 100644 --- a/NPCs/AbyssNPCs/GulperEelBodyAlt.cs +++ b/NPCs/AbyssNPCs/GulperEelBodyAlt.cs @@ -43,6 +43,8 @@ namespace CalamityMod.NPCs.AbyssNPCs npc.netAlways = true; npc.dontCountMe = true; npc.chaseable = false; + banner = mod.NPCType("GulperEelHead"); + bannerItem = mod.ItemType("GulperEelBanner"); } public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) diff --git a/NPCs/AbyssNPCs/GulperEelHead.cs b/NPCs/AbyssNPCs/GulperEelHead.cs index 310e23d4f4..cf4361609b 100644 --- a/NPCs/AbyssNPCs/GulperEelHead.cs +++ b/NPCs/AbyssNPCs/GulperEelHead.cs @@ -49,6 +49,8 @@ namespace CalamityMod.NPCs.AbyssNPCs npc.HitSound = SoundID.NPCHit9; npc.DeathSound = SoundID.NPCDeath13; npc.netAlways = true; + banner = npc.type; + bannerItem = mod.ItemType("GulperEelBanner"); } public override void AI() @@ -410,12 +412,12 @@ namespace CalamityMod.NPCs.AbyssNPCs { if (spawnInfo.player.GetModPlayer(mod).ZoneAbyssLayer3 && spawnInfo.water && !NPC.AnyNPCs(mod.NPCType("GulperEelHead"))) { - return 0.05f; - } + return SpawnCondition.CaveJellyfish.Chance * 0.3f; + } if (spawnInfo.player.GetModPlayer(mod).ZoneAbyssLayer4 && spawnInfo.water && !NPC.AnyNPCs(mod.NPCType("GulperEelHead"))) { - return 0.1f; - } + return SpawnCondition.CaveJellyfish.Chance * 0.6f; + } return 0f; } diff --git a/NPCs/AbyssNPCs/GulperEelTail.cs b/NPCs/AbyssNPCs/GulperEelTail.cs index fb6f37256e..c42a1ef6ea 100644 --- a/NPCs/AbyssNPCs/GulperEelTail.cs +++ b/NPCs/AbyssNPCs/GulperEelTail.cs @@ -43,6 +43,8 @@ namespace CalamityMod.NPCs.AbyssNPCs npc.netAlways = true; npc.dontCountMe = true; npc.chaseable = false; + banner = mod.NPCType("GulperEelHead"); + bannerItem = mod.ItemType("GulperEelBanner"); } public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) diff --git a/NPCs/AbyssNPCs/Laserfish.cs b/NPCs/AbyssNPCs/Laserfish.cs index fdc5eccbeb..fd1935b1f4 100644 --- a/NPCs/AbyssNPCs/Laserfish.cs +++ b/NPCs/AbyssNPCs/Laserfish.cs @@ -35,7 +35,9 @@ namespace CalamityMod.NPCs.AbyssNPCs npc.HitSound = SoundID.NPCHit51; npc.DeathSound = SoundID.NPCDeath26; npc.knockBackResist = 0.65f; - } + banner = npc.type; + bannerItem = mod.ItemType("LaserfishBanner"); + } public override void AI() { @@ -261,12 +263,12 @@ namespace CalamityMod.NPCs.AbyssNPCs { if (spawnInfo.player.GetModPlayer(mod).ZoneAbyssLayer2 && spawnInfo.water) { - return 0.1f; - } + return SpawnCondition.CaveJellyfish.Chance * 0.6f; + } if (spawnInfo.player.GetModPlayer(mod).ZoneAbyssLayer3 && spawnInfo.water) { - return 0.2f; - } + return SpawnCondition.CaveJellyfish.Chance * 1.2f; + } return 0f; } diff --git a/NPCs/AbyssNPCs/LuminousCorvina.cs b/NPCs/AbyssNPCs/LuminousCorvina.cs index d6c944666b..6c0ed57dda 100644 --- a/NPCs/AbyssNPCs/LuminousCorvina.cs +++ b/NPCs/AbyssNPCs/LuminousCorvina.cs @@ -36,7 +36,9 @@ namespace CalamityMod.NPCs.AbyssNPCs npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; npc.knockBackResist = 0.85f; - } + banner = npc.type; + bannerItem = mod.ItemType("LuminousCorvinaBanner"); + } public override void AI() { @@ -258,8 +260,8 @@ namespace CalamityMod.NPCs.AbyssNPCs { if (spawnInfo.player.GetModPlayer(mod).ZoneAbyssLayer2 && spawnInfo.water) { - return 0.1f; - } + return SpawnCondition.CaveJellyfish.Chance * 0.6f; + } return 0f; } diff --git a/NPCs/AbyssNPCs/MantisShrimp.cs b/NPCs/AbyssNPCs/MantisShrimp.cs index ffcb804964..af77c8e71c 100644 --- a/NPCs/AbyssNPCs/MantisShrimp.cs +++ b/NPCs/AbyssNPCs/MantisShrimp.cs @@ -31,7 +31,9 @@ namespace CalamityMod.NPCs.AbyssNPCs npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; npc.buffImmune[189] = true; - } + banner = npc.type; + bannerItem = mod.ItemType("MantisShrimpBanner"); + } public override void AI() { diff --git a/NPCs/AbyssNPCs/Mauler.cs b/NPCs/AbyssNPCs/Mauler.cs index cd43a8a746..9259eacc0d 100644 --- a/NPCs/AbyssNPCs/Mauler.cs +++ b/NPCs/AbyssNPCs/Mauler.cs @@ -39,7 +39,9 @@ namespace CalamityMod.NPCs.AbyssNPCs npc.DeathSound = SoundID.NPCDeath60; npc.knockBackResist = 0f; npc.rarity = 2; - } + banner = npc.type; + bannerItem = mod.ItemType("MaulerBanner"); + } public override void AI() { diff --git a/NPCs/AbyssNPCs/MirageJelly.cs b/NPCs/AbyssNPCs/MirageJelly.cs index b3f3622c52..7876bc642b 100644 --- a/NPCs/AbyssNPCs/MirageJelly.cs +++ b/NPCs/AbyssNPCs/MirageJelly.cs @@ -38,7 +38,9 @@ namespace CalamityMod.NPCs.AbyssNPCs npc.value = Item.buyPrice(0, 0, 25, 0); npc.HitSound = SoundID.NPCHit25; npc.DeathSound = SoundID.NPCDeath28; - } + banner = npc.type; + bannerItem = mod.ItemType("MirageJellyBanner"); + } public override void AI() { @@ -154,8 +156,8 @@ namespace CalamityMod.NPCs.AbyssNPCs { if (spawnInfo.player.GetModPlayer(mod).ZoneAbyssLayer3 && spawnInfo.water) { - return 0.1f; - } + return SpawnCondition.CaveJellyfish.Chance * 0.6f; + } return 0f; } diff --git a/NPCs/AbyssNPCs/MorayEel.cs b/NPCs/AbyssNPCs/MorayEel.cs index f735235025..4fc44a62b3 100644 --- a/NPCs/AbyssNPCs/MorayEel.cs +++ b/NPCs/AbyssNPCs/MorayEel.cs @@ -35,7 +35,9 @@ namespace CalamityMod.NPCs.AbyssNPCs npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; npc.knockBackResist = 0.75f; - } + banner = npc.type; + bannerItem = mod.ItemType("MorayEelBanner"); + } public override void AI() { @@ -243,7 +245,7 @@ namespace CalamityMod.NPCs.AbyssNPCs } if (spawnInfo.player.GetModPlayer(mod).ZoneAbyssLayer1 && spawnInfo.water) { - return 0.2f; + return SpawnCondition.CaveJellyfish.Chance * 1.2f; } return SpawnCondition.OceanMonster.Chance * 0.1f; } diff --git a/NPCs/AbyssNPCs/OarfishBody.cs b/NPCs/AbyssNPCs/OarfishBody.cs index c2ea9654cd..4ba46daf1e 100644 --- a/NPCs/AbyssNPCs/OarfishBody.cs +++ b/NPCs/AbyssNPCs/OarfishBody.cs @@ -43,6 +43,8 @@ namespace CalamityMod.NPCs.AbyssNPCs npc.netAlways = true; npc.dontCountMe = true; npc.chaseable = false; + banner = mod.NPCType("OarfishHead"); + bannerItem = mod.ItemType("OarfishBanner"); } public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) diff --git a/NPCs/AbyssNPCs/OarfishHead.cs b/NPCs/AbyssNPCs/OarfishHead.cs index 30df9bcc31..08453e17f1 100644 --- a/NPCs/AbyssNPCs/OarfishHead.cs +++ b/NPCs/AbyssNPCs/OarfishHead.cs @@ -48,6 +48,8 @@ namespace CalamityMod.NPCs.AbyssNPCs npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; npc.netAlways = true; + banner = npc.type; + bannerItem = mod.ItemType("OarfishBanner"); } public override void AI() @@ -373,12 +375,12 @@ namespace CalamityMod.NPCs.AbyssNPCs { if (spawnInfo.player.GetModPlayer(mod).ZoneAbyssLayer2 && spawnInfo.water && !NPC.AnyNPCs(mod.NPCType("OarfishHead"))) { - return 0.05f; - } + return SpawnCondition.CaveJellyfish.Chance * 0.3f; + } if (spawnInfo.player.GetModPlayer(mod).ZoneAbyssLayer3 && spawnInfo.water && !NPC.AnyNPCs(mod.NPCType("OarfishHead"))) { - return 0.1f; - } + return SpawnCondition.CaveJellyfish.Chance * 0.6f; + } return 0f; } diff --git a/NPCs/AbyssNPCs/OarfishTail.cs b/NPCs/AbyssNPCs/OarfishTail.cs index a59e8f4363..891fd7e9ab 100644 --- a/NPCs/AbyssNPCs/OarfishTail.cs +++ b/NPCs/AbyssNPCs/OarfishTail.cs @@ -43,6 +43,8 @@ namespace CalamityMod.NPCs.AbyssNPCs npc.netAlways = true; npc.dontCountMe = true; npc.chaseable = false; + banner = mod.NPCType("OarfishHead"); + bannerItem = mod.ItemType("OarfishBanner"); } public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) diff --git a/NPCs/AbyssNPCs/Reaper.cs b/NPCs/AbyssNPCs/Reaper.cs index 62f66e1f97..528d4d61ac 100644 --- a/NPCs/AbyssNPCs/Reaper.cs +++ b/NPCs/AbyssNPCs/Reaper.cs @@ -45,7 +45,9 @@ namespace CalamityMod.NPCs.AbyssNPCs npc.DeathSound = SoundID.NPCDeath60; npc.knockBackResist = 0f; npc.rarity = 2; - } + banner = npc.type; + bannerItem = mod.ItemType("ReaperSharkBanner"); + } public override void AI() { @@ -620,13 +622,13 @@ namespace CalamityMod.NPCs.AbyssNPCs if (spawnInfo.player.GetModPlayer(mod).ZoneAbyssLayer3 && spawnInfo.water && !NPC.AnyNPCs(mod.NPCType("Reaper")) && !NPC.AnyNPCs(mod.NPCType("ColossalSquid")) && !NPC.AnyNPCs(mod.NPCType("EidolonWyrmHead")) && !NPC.AnyNPCs(mod.NPCType("EidolonWyrmHeadHuge"))) { - return 0.1f; - } + return SpawnCondition.CaveJellyfish.Chance * 0.6f; + } if (spawnInfo.player.GetModPlayer(mod).ZoneAbyssLayer4 && spawnInfo.water && !NPC.AnyNPCs(mod.NPCType("Reaper")) && !NPC.AnyNPCs(mod.NPCType("ColossalSquid")) && !NPC.AnyNPCs(mod.NPCType("EidolonWyrmHead")) && !NPC.AnyNPCs(mod.NPCType("EidolonWyrmHeadHuge"))) { - return 0.2f; - } + return SpawnCondition.CaveJellyfish.Chance * 1.2f; + } return 0f; } diff --git a/NPCs/AbyssNPCs/SeaUrchin.cs b/NPCs/AbyssNPCs/SeaUrchin.cs index 0bcc93c121..430beec79f 100644 --- a/NPCs/AbyssNPCs/SeaUrchin.cs +++ b/NPCs/AbyssNPCs/SeaUrchin.cs @@ -32,6 +32,8 @@ namespace CalamityMod.NPCs.AbyssNPCs npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath15; npc.behindTiles = true; + banner = npc.type; + bannerItem = mod.ItemType("SeaUrchinBanner"); } public override void AI() diff --git a/NPCs/AbyssNPCs/ToxicMinnow.cs b/NPCs/AbyssNPCs/ToxicMinnow.cs index 934c787dbc..f3388ed5e4 100644 --- a/NPCs/AbyssNPCs/ToxicMinnow.cs +++ b/NPCs/AbyssNPCs/ToxicMinnow.cs @@ -33,7 +33,9 @@ namespace CalamityMod.NPCs.AbyssNPCs npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; npc.knockBackResist = 0.15f; - } + banner = npc.type; + bannerItem = mod.ItemType("ToxicMinnowBanner"); + } public override void AI() { @@ -216,15 +218,15 @@ namespace CalamityMod.NPCs.AbyssNPCs { if (spawnInfo.player.GetModPlayer(mod).ZoneAbyssLayer1 && spawnInfo.water) { - return 0.1f; + return SpawnCondition.CaveJellyfish.Chance * 0.6f; } if (spawnInfo.player.GetModPlayer(mod).ZoneAbyssLayer2 && spawnInfo.water) { - return 0.15f; + return SpawnCondition.CaveJellyfish.Chance * 0.9f; } if (spawnInfo.player.GetModPlayer(mod).ZoneAbyssLayer3 && spawnInfo.water) { - return 0.1f; + return SpawnCondition.CaveJellyfish.Chance * 0.6f; } return 0f; } diff --git a/NPCs/AbyssNPCs/Trasher.cs b/NPCs/AbyssNPCs/Trasher.cs index f65b5447d7..78fb80e6dd 100644 --- a/NPCs/AbyssNPCs/Trasher.cs +++ b/NPCs/AbyssNPCs/Trasher.cs @@ -38,7 +38,9 @@ namespace CalamityMod.NPCs.AbyssNPCs npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath5; npc.knockBackResist = 0f; - } + banner = npc.type; + bannerItem = mod.ItemType("TrasherBanner"); + } public override void AI() { @@ -342,7 +344,11 @@ namespace CalamityMod.NPCs.AbyssNPCs { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.DivingHelmet); } - if (Main.rand.Next(10) == 0 && Main.hardMode) + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TrashmanTrashcan")); + } + if (Main.rand.Next(10) == 0 && Main.hardMode) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Gatligator); } diff --git a/NPCs/AbyssNPCs/Viperfish.cs b/NPCs/AbyssNPCs/Viperfish.cs index 9e8263211f..8eb2a45b50 100644 --- a/NPCs/AbyssNPCs/Viperfish.cs +++ b/NPCs/AbyssNPCs/Viperfish.cs @@ -12,7 +12,7 @@ namespace CalamityMod.NPCs.AbyssNPCs { public class Viperfish : ModNPC { - public bool hasBeenHit = false; + private bool hasBeenHit = false; public override void SetStaticDefaults() { @@ -35,7 +35,9 @@ namespace CalamityMod.NPCs.AbyssNPCs npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; npc.knockBackResist = 0.85f; - } + banner = npc.type; + bannerItem = mod.ItemType("ViperfishBanner"); + } public override void AI() { @@ -249,11 +251,11 @@ namespace CalamityMod.NPCs.AbyssNPCs { if (spawnInfo.player.GetModPlayer(mod).ZoneAbyssLayer1 && spawnInfo.water) { - return 0.1f; + return SpawnCondition.CaveJellyfish.Chance * 0.6f; } if (spawnInfo.player.GetModPlayer(mod).ZoneAbyssLayer2 && spawnInfo.water) { - return 0.2f; + return SpawnCondition.CaveJellyfish.Chance * 1.2f; } return 0f; } diff --git a/NPCs/Astrageldon/Astrageldon.cs b/NPCs/Astrageldon/Astrageldon.cs index 082d88004f..5a0616523f 100644 --- a/NPCs/Astrageldon/Astrageldon.cs +++ b/NPCs/Astrageldon/Astrageldon.cs @@ -28,17 +28,17 @@ namespace CalamityMod.NPCs.Astrageldon npc.width = 400; npc.height = 280; npc.defense = 120; - npc.lifeMax = CalamityWorld.revenge ? 65075 : 51000; + npc.lifeMax = CalamityWorld.revenge ? 81300 : 63750; if (CalamityWorld.death) { - npc.lifeMax = 100875; + npc.lifeMax = 126100; } npc.aiStyle = -1; aiType = -1; npc.knockBackResist = 0f; npc.value = Item.buyPrice(0, 15, 0, 0); - for (int k = 0; k < npc.buffImmune.Length; k++) - { + for (int k = 0; k < npc.buffImmune.Length; k++) + { npc.buffImmune[k] = true; npc.buffImmune[BuffID.Ichor] = false; npc.buffImmune[mod.BuffType("MarkedforDeath")] = false; @@ -65,11 +65,11 @@ namespace CalamityMod.NPCs.Astrageldon if (NPC.downedMoonlord && CalamityWorld.revenge) { npc.lifeMax = 400000; - npc.value = Item.buyPrice(3, 0, 0, 0); + npc.value = Item.buyPrice(0, 35, 0, 0); } if (CalamityWorld.bossRushActive) { - npc.lifeMax = CalamityWorld.death ? 2800000 : 2400000; + npc.lifeMax = CalamityWorld.death ? 1400000 : 1200000; } } @@ -123,7 +123,7 @@ namespace CalamityMod.NPCs.Astrageldon { laserDamage *= 3; } - if (npc.ai[0] >= 5f || npc.GetGlobalNPC(mod).enraged) //teleporting + if ((npc.ai[0] >= 5f && npc.ai[0] != 7) || npc.GetGlobalNPC(mod).enraged) //teleporting { Vector2 shootFromVector = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); float spread = 45f * 0.0174f; @@ -420,7 +420,7 @@ namespace CalamityMod.NPCs.Astrageldon } if (spawnFlag && Main.netMode != 1) { - NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y - 50, mod.NPCType("AstrageldonSlime"), 0, 0f, 0f, 0f, 0f, 255); + NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y - 25, mod.NPCType("AstrageldonSlime"), 0, 0f, 0f, 0f, 0f, 255); } npc.localAI[1] = 0f; npc.TargetClosest(true); @@ -491,7 +491,7 @@ namespace CalamityMod.NPCs.Astrageldon } if (spawnFlag && Main.netMode != 1) { - NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y - 50, mod.NPCType("AstrageldonSlime"), 0, 0f, 0f, 0f, 0f, 255); + NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y - 25, mod.NPCType("AstrageldonSlime"), 0, 0f, 0f, 0f, 0f, 255); } npc.chaseable = true; npc.dontTakeDamage = false; @@ -635,6 +635,7 @@ namespace CalamityMod.NPCs.Astrageldon { spriteEffects = SpriteEffects.FlipHorizontally; } + if (npc.ai[0] == 0f) { NPCTexture = Main.npcTexture[npc.type]; @@ -680,6 +681,7 @@ namespace CalamityMod.NPCs.Astrageldon GlowMaskTexture = mod.GetTexture("NPCs/Astrageldon/AstrageldonJumpGlow"); } } + Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2)); Color lightColor = (drawColor != null ? (Color)drawColor : CalamityMod.GetNPCColor(((NPC)npc), npc.Center, false)); int frameCount = Main.npcFrameCount[npc.type]; @@ -687,6 +689,7 @@ namespace CalamityMod.NPCs.Astrageldon float scale = npc.scale; float rotation = npc.rotation; float offsetY = npc.gfxOffY; + Main.spriteBatch.Draw(NPCTexture, new Vector2(npc.position.X - Main.screenPosition.X + (float)(npc.width / 2) - (float)Main.npcTexture[npc.type].Width * scale / 2f + vector11.X * scale, npc.position.Y - Main.screenPosition.Y + (float)npc.height - (float)Main.npcTexture[npc.type].Height * scale / (float)Main.npcFrameCount[npc.type] + 4f + vector11.Y * scale + 0f + offsetY), @@ -697,16 +700,18 @@ namespace CalamityMod.NPCs.Astrageldon scale, spriteEffects, 0f); - if (npc.ai[0] != 1) //draw only if not recharging + + if (npc.ai[0] != 1) //draw only if not recharging { Vector2 center = new Vector2(npc.Center.X, npc.Center.Y - 30f); //30 Vector2 vector = center - Main.screenPosition; vector -= new Vector2((float)GlowMaskTexture.Width, (float)(GlowMaskTexture.Height / Main.npcFrameCount[npc.type])) * 1f / 2f; vector += vector11 * 1f + new Vector2(0f, 0f + 4f + offsetY); Microsoft.Xna.Framework.Color color = new Microsoft.Xna.Framework.Color(127 - npc.alpha, 127 - npc.alpha, 127 - npc.alpha, 0).MultiplyRGBA(Microsoft.Xna.Framework.Color.Gold); - Main.spriteBatch.Draw(GlowMaskTexture, vector, + + Main.spriteBatch.Draw(GlowMaskTexture, vector, new Microsoft.Xna.Framework.Rectangle?(frame), color, rotation, vector11, 1f, spriteEffects, 0f); - } + } return false; } @@ -719,7 +724,7 @@ namespace CalamityMod.NPCs.Astrageldon { if (CalamityWorld.armageddon) { - for (int i = 0; i < 10; i++) + for (int i = 0; i < 5; i++) { npc.DropBossBags(); } @@ -737,7 +742,11 @@ namespace CalamityMod.NPCs.Astrageldon Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("AstralJelly"), Main.rand.Next(9, 13)); Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Stardust"), Main.rand.Next(20, 31)); Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.FallenStar, Main.rand.Next(25, 41)); - } + if (Main.rand.Next(7) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("AureusMask")); + } + } if (NPC.downedMoonlord) { int amount = Main.rand.Next(25, 41) / 2; diff --git a/NPCs/Astrageldon/AstrageldonSlime.cs b/NPCs/Astrageldon/AstrageldonSlime.cs index e4b8fa34f7..27a4a158c0 100644 --- a/NPCs/Astrageldon/AstrageldonSlime.cs +++ b/NPCs/Astrageldon/AstrageldonSlime.cs @@ -41,6 +41,7 @@ namespace CalamityMod.NPCs.Astrageldon } npc.noGravity = true; npc.noTileCollide = true; + npc.canGhostHeal = false; npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; } @@ -77,7 +78,7 @@ namespace CalamityMod.NPCs.Astrageldon npc.life = 0; return; } - float num1372 = 22f; + float num1372 = 18f; Vector2 vector167 = new Vector2(npc.Center.X + (float)(npc.direction * 20), npc.Center.Y + 6f); float num1373 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector167.X; float num1374 = Main.player[npc.target].Center.Y - vector167.Y; @@ -231,7 +232,7 @@ namespace CalamityMod.NPCs.Astrageldon Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 14); npc.position.X = npc.position.X + (float)(npc.width / 2); npc.position.Y = npc.position.Y + (float)(npc.height / 2); - npc.damage = CalamityWorld.death ? 150 : 100; + npc.damage = CalamityWorld.death ? 225 : 150; npc.width = (npc.height = 216); npc.position.X = npc.position.X - (float)(npc.width / 2); npc.position.Y = npc.position.Y - (float)(npc.height / 2); diff --git a/NPCs/AstralBiomeNPCs/Aries.cs b/NPCs/AstralBiomeNPCs/Aries.cs index 7b53559318..7d150a512a 100644 --- a/NPCs/AstralBiomeNPCs/Aries.cs +++ b/NPCs/AstralBiomeNPCs/Aries.cs @@ -34,7 +34,9 @@ namespace CalamityMod.NPCs.AstralBiomeNPCs npc.knockBackResist = 0.5f; npc.value = Item.buyPrice(0, 0, 10, 0); npc.DeathSound = mod.GetLegacySoundSlot(SoundType.NPCKilled, "Sounds/NPCKilled/AstralEnemyDeath"); - } + banner = npc.type; + bannerItem = mod.ItemType("AriesBanner"); + } public override void FindFrame(int frameHeight) { @@ -108,6 +110,10 @@ namespace CalamityMod.NPCs.AstralBiomeNPCs { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Stardust")); } - } + if (CalamityWorld.downedStarGod && Main.rand.Next(7) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("StellarKnife")); + } + } } } diff --git a/NPCs/AstralBiomeNPCs/AstralProbe.cs b/NPCs/AstralBiomeNPCs/AstralProbe.cs index 5deccf112c..276aac1675 100644 --- a/NPCs/AstralBiomeNPCs/AstralProbe.cs +++ b/NPCs/AstralBiomeNPCs/AstralProbe.cs @@ -31,6 +31,8 @@ namespace CalamityMod.NPCs.AstralBiomeNPCs npc.noGravity = true; npc.noTileCollide = true; npc.DeathSound = SoundID.NPCDeath14; + banner = npc.type; + bannerItem = mod.ItemType("AstralProbeBanner"); } public override void AI() diff --git a/NPCs/AstralBiomeNPCs/AstralSlime.cs b/NPCs/AstralBiomeNPCs/AstralSlime.cs index c9f1092ded..93a03d065a 100644 --- a/NPCs/AstralBiomeNPCs/AstralSlime.cs +++ b/NPCs/AstralBiomeNPCs/AstralSlime.cs @@ -32,9 +32,10 @@ namespace CalamityMod.NPCs.AstralBiomeNPCs npc.alpha = 60; npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; - animationType = NPCID.BlueSlime; - } + banner = npc.type; + bannerItem = mod.ItemType("AstralSlimeBanner"); + } public override void FindFrame(int frameHeight) { diff --git a/NPCs/AstralBiomeNPCs/AstralachneaGround.cs b/NPCs/AstralBiomeNPCs/AstralachneaGround.cs index c3e6e56ad8..6ff2787553 100644 --- a/NPCs/AstralBiomeNPCs/AstralachneaGround.cs +++ b/NPCs/AstralBiomeNPCs/AstralachneaGround.cs @@ -40,9 +40,10 @@ namespace CalamityMod.NPCs.AstralBiomeNPCs npc.buffImmune[20] = true; npc.buffImmune[31] = false; npc.timeLeft = NPC.activeTime * 2; - animationType = NPCID.WallCreeper; - } + banner = npc.type; + bannerItem = mod.ItemType("AstralachneaBanner"); + } public override void AI() { diff --git a/NPCs/AstralBiomeNPCs/AstralachneaWall.cs b/NPCs/AstralBiomeNPCs/AstralachneaWall.cs index 3dc8e60db0..29096d32a5 100644 --- a/NPCs/AstralBiomeNPCs/AstralachneaWall.cs +++ b/NPCs/AstralBiomeNPCs/AstralachneaWall.cs @@ -41,9 +41,10 @@ namespace CalamityMod.NPCs.AstralBiomeNPCs npc.buffImmune[20] = true; npc.buffImmune[31] = false; npc.timeLeft = NPC.activeTime * 2; - animationType = NPCID.BlackRecluseWall; - } + banner = mod.NPCType("AstralachneaGround"); + bannerItem = mod.ItemType("AstralachneaBanner"); + } public override void AI() { diff --git a/NPCs/AstralBiomeNPCs/Atlas.cs b/NPCs/AstralBiomeNPCs/Atlas.cs index c4517f23a0..4d16715beb 100644 --- a/NPCs/AstralBiomeNPCs/Atlas.cs +++ b/NPCs/AstralBiomeNPCs/Atlas.cs @@ -107,9 +107,10 @@ namespace CalamityMod.NPCs.AstralBiomeNPCs npc.knockBackResist = 0.04f; npc.value = Item.buyPrice(0, 1, 0, 0); npc.aiStyle = -1; - npc.DeathSound = mod.GetLegacySoundSlot(SoundType.NPCKilled, "Sounds/NPCKilled/AtlasDeath"); - } + banner = npc.type; + bannerItem = mod.ItemType("AtlasBanner"); + } public override void SendExtraAI(BinaryWriter writer) { diff --git a/NPCs/AstralBiomeNPCs/BigSightseer.cs b/NPCs/AstralBiomeNPCs/BigSightseer.cs index 3be2afb4db..53e082bd64 100644 --- a/NPCs/AstralBiomeNPCs/BigSightseer.cs +++ b/NPCs/AstralBiomeNPCs/BigSightseer.cs @@ -36,7 +36,9 @@ namespace CalamityMod.NPCs.AstralBiomeNPCs npc.knockBackResist = 0.7f; npc.value = Item.buyPrice(0, 0, 20, 0); npc.aiStyle = -1; - } + banner = npc.type; + bannerItem = mod.ItemType("BigSightseerBanner"); + } public override void FindFrame(int frameHeight) { diff --git a/NPCs/AstralBiomeNPCs/FusionFeeder.cs b/NPCs/AstralBiomeNPCs/FusionFeeder.cs index a5a97d88fd..e751e09f1c 100644 --- a/NPCs/AstralBiomeNPCs/FusionFeeder.cs +++ b/NPCs/AstralBiomeNPCs/FusionFeeder.cs @@ -37,9 +37,10 @@ namespace CalamityMod.NPCs.AstralBiomeNPCs npc.knockBackResist = 0.7f; npc.behindTiles = true; npc.DeathSound = mod.GetLegacySoundSlot(SoundType.NPCKilled, "Sounds/NPCKilled/AstralEnemyDeath"); - animationType = NPCID.SandShark; - } + banner = npc.type; + bannerItem = mod.ItemType("FusionFeederBanner"); + } public override void FindFrame(int frameHeight) { diff --git a/NPCs/AstralBiomeNPCs/Hadarian.cs b/NPCs/AstralBiomeNPCs/Hadarian.cs index 47ab09e637..50987c04b9 100644 --- a/NPCs/AstralBiomeNPCs/Hadarian.cs +++ b/NPCs/AstralBiomeNPCs/Hadarian.cs @@ -35,7 +35,9 @@ namespace CalamityMod.NPCs.AstralBiomeNPCs npc.DeathSound = mod.GetLegacySoundSlot(SoundType.NPCKilled, "Sounds/NPCKilled/AstralEnemyDeath"); npc.knockBackResist = 0.65f; npc.value = Item.buyPrice(0, 0, 15, 0); - } + banner = npc.type; + bannerItem = mod.ItemType("HadarianBanner"); + } public override void AI() { @@ -185,6 +187,10 @@ namespace CalamityMod.NPCs.AstralBiomeNPCs { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Stardust")); } - } + if (CalamityWorld.downedStarGod && Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("HadarianMembrane"), Main.rand.Next(1, 3)); + } + } } } diff --git a/NPCs/AstralBiomeNPCs/Hive.cs b/NPCs/AstralBiomeNPCs/Hive.cs index 4e9541ff6e..18c4a5f0d2 100644 --- a/NPCs/AstralBiomeNPCs/Hive.cs +++ b/NPCs/AstralBiomeNPCs/Hive.cs @@ -35,7 +35,9 @@ namespace CalamityMod.NPCs.AstralBiomeNPCs npc.DeathSound = mod.GetLegacySoundSlot(SoundType.NPCKilled, "Sounds/NPCKilled/AstralEnemyDeath"); npc.knockBackResist = 0f; npc.value = Item.buyPrice(0, 0, 15, 0); - } + banner = npc.type; + bannerItem = mod.ItemType("HiveBanner"); + } public override void AI() { diff --git a/NPCs/AstralBiomeNPCs/Mantis.cs b/NPCs/AstralBiomeNPCs/Mantis.cs index 3bbed21bde..6322ed5496 100644 --- a/NPCs/AstralBiomeNPCs/Mantis.cs +++ b/NPCs/AstralBiomeNPCs/Mantis.cs @@ -34,7 +34,9 @@ namespace CalamityMod.NPCs.AstralBiomeNPCs npc.knockBackResist = 0.1f; npc.value = Item.buyPrice(0, 0, 15, 0); npc.DeathSound = mod.GetLegacySoundSlot(SoundType.NPCKilled, "Sounds/NPCKilled/AstralEnemyDeath"); - } + banner = npc.type; + bannerItem = mod.ItemType("MantisBanner"); + } public override void AI() { diff --git a/NPCs/AstralBiomeNPCs/Nova.cs b/NPCs/AstralBiomeNPCs/Nova.cs index f8e40b583b..053a73c12c 100644 --- a/NPCs/AstralBiomeNPCs/Nova.cs +++ b/NPCs/AstralBiomeNPCs/Nova.cs @@ -44,7 +44,9 @@ namespace CalamityMod.NPCs.AstralBiomeNPCs npc.knockBackResist = 0.4f; npc.value = Item.buyPrice(0, 0, 20, 0); npc.aiStyle = -1; - } + banner = npc.type; + bannerItem = mod.ItemType("NovaBanner"); + } public override void FindFrame(int frameHeight) { diff --git a/NPCs/AstralBiomeNPCs/SmallSightseer.cs b/NPCs/AstralBiomeNPCs/SmallSightseer.cs index d24b7092e3..b1388790af 100644 --- a/NPCs/AstralBiomeNPCs/SmallSightseer.cs +++ b/NPCs/AstralBiomeNPCs/SmallSightseer.cs @@ -37,7 +37,9 @@ namespace CalamityMod.NPCs.AstralBiomeNPCs npc.knockBackResist = 0.48f; npc.value = Item.buyPrice(0, 0, 10, 0); npc.aiStyle = -1; - } + banner = npc.type; + bannerItem = mod.ItemType("SmallSightseerBanner"); + } public override void FindFrame(int frameHeight) { diff --git a/NPCs/AstralBiomeNPCs/StellarCulex.cs b/NPCs/AstralBiomeNPCs/StellarCulex.cs index a766759a96..f505fd0bc3 100644 --- a/NPCs/AstralBiomeNPCs/StellarCulex.cs +++ b/NPCs/AstralBiomeNPCs/StellarCulex.cs @@ -37,9 +37,10 @@ namespace CalamityMod.NPCs.AstralBiomeNPCs npc.value = Item.buyPrice(0, 0, 10, 0); npc.DeathSound = mod.GetLegacySoundSlot(SoundType.NPCKilled, "Sounds/NPCKilled/AstralEnemyDeath"); npc.buffImmune[31] = false; - animationType = NPCID.GiantFlyingFox; - } + banner = npc.type; + bannerItem = mod.ItemType("StellarCulexBanner"); + } public override void FindFrame(int frameHeight) { diff --git a/NPCs/AstrumDeus/AstrumDeusBody.cs b/NPCs/AstrumDeus/AstrumDeusBody.cs index 39b8c5d182..6369e64496 100644 --- a/NPCs/AstrumDeus/AstrumDeusBody.cs +++ b/NPCs/AstrumDeus/AstrumDeusBody.cs @@ -33,7 +33,7 @@ namespace CalamityMod.NPCs.AstrumDeus } if (CalamityWorld.bossRushActive) { - npc.lifeMax = CalamityWorld.death ? 840000 : 720000; + npc.lifeMax = CalamityWorld.death ? 420000 : 360000; } npc.aiStyle = 6; //new aiType = -1; //new @@ -48,6 +48,7 @@ namespace CalamityMod.NPCs.AstrumDeus npc.behindTiles = true; npc.noGravity = true; npc.noTileCollide = true; + npc.canGhostHeal = false; npc.HitSound = SoundID.NPCHit4; npc.DeathSound = SoundID.NPCDeath14; npc.netAlways = true; diff --git a/NPCs/AstrumDeus/AstrumDeusBodySpectral.cs b/NPCs/AstrumDeus/AstrumDeusBodySpectral.cs index ff326c91be..97efdd4e6e 100644 --- a/NPCs/AstrumDeus/AstrumDeusBodySpectral.cs +++ b/NPCs/AstrumDeus/AstrumDeusBodySpectral.cs @@ -33,7 +33,7 @@ namespace CalamityMod.NPCs.AstrumDeus } if (CalamityWorld.bossRushActive) { - npc.lifeMax = CalamityWorld.death ? 3000000 : 2500000; + npc.lifeMax = CalamityWorld.death ? 1500000 : 1300000; } npc.aiStyle = 6; //new aiType = -1; //new @@ -44,10 +44,13 @@ namespace CalamityMod.NPCs.AstrumDeus { npc.scale = 1.35f; } + NPCID.Sets.TrailCacheLength[npc.type] = 8; + NPCID.Sets.TrailingMode[npc.type] = 1; npc.alpha = 255; npc.behindTiles = true; npc.noGravity = true; npc.noTileCollide = true; + npc.canGhostHeal = false; npc.HitSound = SoundID.NPCHit4; npc.DeathSound = SoundID.NPCDeath14; npc.netAlways = true; @@ -147,8 +150,42 @@ namespace CalamityMod.NPCs.AstrumDeus Color lightColor = new Color(250, 150, Main.DiscoB, npc.alpha); Mod mod = ModLoader.GetMod("CalamityMod"); Texture2D texture = mod.GetTexture("NPCs/AstrumDeus/AstrumDeusBodyAltSpectral"); - CalamityMod.DrawTexture(spriteBatch, (npc.localAI[3] == 1f ? texture : Main.npcTexture[npc.type]), 0, npc, - (AstrumDeusHeadSpectral.colorChange ? lightColor : drawColor)); + SpriteEffects spriteEffects = SpriteEffects.None; + Color newColor = (AstrumDeusHeadSpectral.colorChange ? lightColor : drawColor); + Microsoft.Xna.Framework.Color color24 = npc.GetAlpha(newColor); + Microsoft.Xna.Framework.Color color25 = Lighting.GetColor((int)((double)npc.position.X + (double)npc.width * 0.5) / 16, (int)(((double)npc.position.Y + (double)npc.height * 0.5) / 16.0)); + Texture2D texture2D3 = (npc.localAI[3] == 1f ? texture : Main.npcTexture[npc.type]); + int num156 = Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type]; + int y3 = num156 * (int)npc.frameCounter; + Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle(0, y3, texture2D3.Width, num156); + Vector2 origin2 = rectangle.Size() / 2f; + int num157 = 8; + int num158 = 2; + int num159 = 1; + float num160 = 0f; + int num161 = num159; + while (((num158 > 0 && num161 < num157) || (num158 < 0 && num161 > num157)) && Lighting.NotRetro) + { + Microsoft.Xna.Framework.Color color26 = npc.GetAlpha(color25); + { + goto IL_6899; + } + IL_6881: + num161 += num158; + continue; + IL_6899: + float num164 = (float)(num157 - num161); + if (num158 < 0) + { + num164 = (float)(num159 - num161); + } + color26 *= num164 / ((float)NPCID.Sets.TrailCacheLength[npc.type] * 1.5f); + Vector2 value4 = (npc.oldPos[num161]); + float num165 = npc.rotation; + Main.spriteBatch.Draw(texture2D3, value4 + npc.Size / 2f - Main.screenPosition + new Vector2(0, npc.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rectangle), color26, num165 + npc.rotation * num160 * (float)(num161 - 1) * -(float)spriteEffects.HasFlag(SpriteEffects.FlipHorizontally).ToDirectionInt(), origin2, npc.scale, spriteEffects, 0f); + goto IL_6881; + } + CalamityMod.DrawTexture(spriteBatch, texture2D3, 0, npc, newColor); return false; } diff --git a/NPCs/AstrumDeus/AstrumDeusHead.cs b/NPCs/AstrumDeus/AstrumDeusHead.cs index ed4a3ed572..b0d3a766eb 100644 --- a/NPCs/AstrumDeus/AstrumDeusHead.cs +++ b/NPCs/AstrumDeus/AstrumDeusHead.cs @@ -45,11 +45,11 @@ namespace CalamityMod.NPCs.AstrumDeus { npc.lifeMax = 19400; } - if (CalamityWorld.bossRushActive) - { - npc.lifeMax = CalamityWorld.death ? 840000 : 720000; - } - npc.aiStyle = 6; //new + if (CalamityWorld.bossRushActive) + { + npc.lifeMax = CalamityWorld.death ? 420000 : 360000; + } + npc.aiStyle = 6; //new aiType = -1; //new animationType = 10; //new npc.knockBackResist = 0f; @@ -260,7 +260,7 @@ namespace CalamityMod.NPCs.AstrumDeus npc.localAI[1] = 1f; Rectangle rectangle12 = new Rectangle((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height); int rectX = 300; - int rectY = (npc.GetGlobalNPC(mod).enraged ? 50 : 100); + int rectY = (npc.GetGlobalNPC(mod).enraged ? 100 : 200); bool flag95 = true; if (npc.position.Y > Main.player[npc.target].position.Y) { diff --git a/NPCs/AstrumDeus/AstrumDeusHeadSpectral.cs b/NPCs/AstrumDeus/AstrumDeusHeadSpectral.cs index 32bbd85526..e08997b2de 100644 --- a/NPCs/AstrumDeus/AstrumDeusHeadSpectral.cs +++ b/NPCs/AstrumDeus/AstrumDeusHeadSpectral.cs @@ -42,11 +42,11 @@ namespace CalamityMod.NPCs.AstrumDeus { npc.lifeMax = 53750; } - if (CalamityWorld.bossRushActive) - { - npc.lifeMax = CalamityWorld.death ? 3000000 : 2500000; - } - npc.aiStyle = 6; //new + if (CalamityWorld.bossRushActive) + { + npc.lifeMax = CalamityWorld.death ? 1500000 : 1300000; + } + npc.aiStyle = 6; //new aiType = -1; //new animationType = 10; //new npc.knockBackResist = 0f; @@ -55,6 +55,8 @@ namespace CalamityMod.NPCs.AstrumDeus { npc.scale = 1.35f; } + NPCID.Sets.TrailCacheLength[npc.type] = 8; + NPCID.Sets.TrailingMode[npc.type] = 1; npc.boss = true; npc.value = Item.buyPrice(0, 20, 0, 0); npc.alpha = 255; @@ -382,16 +384,50 @@ namespace CalamityMod.NPCs.AstrumDeus return false; } - public override Color? GetAlpha(Color drawColor) - { - if (colorChange) - { - return new Color(250, 150, Main.DiscoB, npc.alpha); - } - return null; - } + public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) + { + Color lightColor = new Color(250, 150, Main.DiscoB, npc.alpha); + Color newColor = (colorChange ? lightColor : drawColor); + SpriteEffects spriteEffects = SpriteEffects.None; + Microsoft.Xna.Framework.Color color24 = npc.GetAlpha(newColor); + Microsoft.Xna.Framework.Color color25 = Lighting.GetColor((int)((double)npc.position.X + (double)npc.width * 0.5) / 16, (int)(((double)npc.position.Y + (double)npc.height * 0.5) / 16.0)); + Texture2D texture2D3 = Main.npcTexture[npc.type]; + int num156 = Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type]; + int y3 = num156 * (int)npc.frameCounter; + Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle(0, y3, texture2D3.Width, num156); + Vector2 origin2 = rectangle.Size() / 2f; + int num157 = 8; + int num158 = 2; + int num159 = 1; + float num160 = 0f; + int num161 = num159; + while (((num158 > 0 && num161 < num157) || (num158 < 0 && num161 > num157)) && Lighting.NotRetro) + { + Microsoft.Xna.Framework.Color color26 = npc.GetAlpha(color25); + { + goto IL_6899; + } + IL_6881: + num161 += num158; + continue; + IL_6899: + float num164 = (float)(num157 - num161); + if (num158 < 0) + { + num164 = (float)(num159 - num161); + } + color26 *= num164 / ((float)NPCID.Sets.TrailCacheLength[npc.type] * 1.5f); + Vector2 value4 = (npc.oldPos[num161]); + float num165 = npc.rotation; + Main.spriteBatch.Draw(texture2D3, value4 + npc.Size / 2f - Main.screenPosition + new Vector2(0, npc.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rectangle), color26, num165 + npc.rotation * num160 * (float)(num161 - 1) * -(float)spriteEffects.HasFlag(SpriteEffects.FlipHorizontally).ToDirectionInt(), origin2, npc.scale, spriteEffects, 0f); + goto IL_6881; + } + var something = npc.direction == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; + spriteBatch.Draw(texture2D3, npc.Center - Main.screenPosition + new Vector2(0, npc.gfxOffY), npc.frame, color24, npc.rotation, npc.frame.Size() / 2, npc.scale, something, 0); + return false; + } - public override bool CanHitPlayer(Player target, ref int cooldownSlot) + public override bool CanHitPlayer(Player target, ref int cooldownSlot) { if (colorChange) { diff --git a/NPCs/AstrumDeus/AstrumDeusProbe3.cs b/NPCs/AstrumDeus/AstrumDeusProbe3.cs index a14b2b8c3f..e8602be762 100644 --- a/NPCs/AstrumDeus/AstrumDeusProbe3.cs +++ b/NPCs/AstrumDeus/AstrumDeusProbe3.cs @@ -35,6 +35,7 @@ namespace CalamityMod.NPCs.AstrumDeus npc.value = Item.buyPrice(0, 0, 0, 0); npc.noGravity = true; npc.noTileCollide = true; + npc.canGhostHeal = false; npc.HitSound = SoundID.NPCHit4; npc.DeathSound = SoundID.NPCDeath14; npc.buffImmune[24] = true; @@ -132,10 +133,10 @@ namespace CalamityMod.NPCs.AstrumDeus 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)) { - int num8 = 40; + int num8 = 37; if (Main.expertMode) { - num8 = 26; + num8 = 29; } int num9 = 84; Projectile.NewProjectile(vector.X, vector.Y, num4, num5, num9, num8, 0f, Main.myPlayer, 0f, 0f); diff --git a/NPCs/AstrumDeus/AstrumDeusTail.cs b/NPCs/AstrumDeus/AstrumDeusTail.cs index 21cba26cd7..b8808b579f 100644 --- a/NPCs/AstrumDeus/AstrumDeusTail.cs +++ b/NPCs/AstrumDeus/AstrumDeusTail.cs @@ -29,11 +29,11 @@ namespace CalamityMod.NPCs.AstrumDeus { npc.lifeMax = 19400; } - if (CalamityWorld.bossRushActive) - { - npc.lifeMax = CalamityWorld.death ? 840000 : 720000; - } - npc.aiStyle = 6; //new + if (CalamityWorld.bossRushActive) + { + npc.lifeMax = CalamityWorld.death ? 420000 : 360000; + } + npc.aiStyle = 6; //new aiType = -1; //new animationType = 10; //new npc.knockBackResist = 0f; @@ -46,6 +46,7 @@ namespace CalamityMod.NPCs.AstrumDeus npc.behindTiles = true; npc.noGravity = true; npc.noTileCollide = true; + npc.canGhostHeal = false; npc.HitSound = SoundID.NPCHit4; npc.DeathSound = SoundID.NPCDeath14; npc.netAlways = true; diff --git a/NPCs/AstrumDeus/AstrumDeusTailSpectral.cs b/NPCs/AstrumDeus/AstrumDeusTailSpectral.cs index bbaa718aba..667379374a 100644 --- a/NPCs/AstrumDeus/AstrumDeusTailSpectral.cs +++ b/NPCs/AstrumDeus/AstrumDeusTailSpectral.cs @@ -29,11 +29,11 @@ namespace CalamityMod.NPCs.AstrumDeus { npc.lifeMax = 53750; } - if (CalamityWorld.bossRushActive) - { - npc.lifeMax = CalamityWorld.death ? 3000000 : 2500000; - } - npc.aiStyle = 6; //new + if (CalamityWorld.bossRushActive) + { + npc.lifeMax = CalamityWorld.death ? 1500000 : 1300000; + } + npc.aiStyle = 6; //new aiType = -1; //new animationType = 10; //new npc.knockBackResist = 0f; @@ -42,10 +42,13 @@ namespace CalamityMod.NPCs.AstrumDeus { npc.scale = 1.35f; } + NPCID.Sets.TrailCacheLength[npc.type] = 8; + NPCID.Sets.TrailingMode[npc.type] = 1; npc.alpha = 255; npc.behindTiles = true; npc.noGravity = true; npc.noTileCollide = true; + npc.canGhostHeal = false; npc.HitSound = SoundID.NPCHit4; npc.DeathSound = SoundID.NPCDeath14; npc.netAlways = true; @@ -97,16 +100,50 @@ namespace CalamityMod.NPCs.AstrumDeus } } - public override Color? GetAlpha(Color drawColor) - { - if (AstrumDeusHeadSpectral.colorChange) - { - return new Color(250, 150, Main.DiscoB, npc.alpha); - } - return null; - } + public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) + { + Color lightColor = new Color(250, 150, Main.DiscoB, npc.alpha); + Color newColor = (AstrumDeusHeadSpectral.colorChange ? lightColor : drawColor); + SpriteEffects spriteEffects = SpriteEffects.None; + Microsoft.Xna.Framework.Color color24 = npc.GetAlpha(newColor); + Microsoft.Xna.Framework.Color color25 = Lighting.GetColor((int)((double)npc.position.X + (double)npc.width * 0.5) / 16, (int)(((double)npc.position.Y + (double)npc.height * 0.5) / 16.0)); + Texture2D texture2D3 = Main.npcTexture[npc.type]; + int num156 = Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type]; + int y3 = num156 * (int)npc.frameCounter; + Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle(0, y3, texture2D3.Width, num156); + Vector2 origin2 = rectangle.Size() / 2f; + int num157 = 8; + int num158 = 2; + int num159 = 1; + float num160 = 0f; + int num161 = num159; + while (((num158 > 0 && num161 < num157) || (num158 < 0 && num161 > num157)) && Lighting.NotRetro) + { + Microsoft.Xna.Framework.Color color26 = npc.GetAlpha(color25); + { + goto IL_6899; + } + IL_6881: + num161 += num158; + continue; + IL_6899: + float num164 = (float)(num157 - num161); + if (num158 < 0) + { + num164 = (float)(num159 - num161); + } + color26 *= num164 / ((float)NPCID.Sets.TrailCacheLength[npc.type] * 1.5f); + Vector2 value4 = (npc.oldPos[num161]); + float num165 = npc.rotation; + Main.spriteBatch.Draw(texture2D3, value4 + npc.Size / 2f - Main.screenPosition + new Vector2(0, npc.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rectangle), color26, num165 + npc.rotation * num160 * (float)(num161 - 1) * -(float)spriteEffects.HasFlag(SpriteEffects.FlipHorizontally).ToDirectionInt(), origin2, npc.scale, spriteEffects, 0f); + goto IL_6881; + } + var something = npc.direction == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; + spriteBatch.Draw(texture2D3, npc.Center - Main.screenPosition + new Vector2(0, npc.gfxOffY), npc.frame, color24, npc.rotation, npc.frame.Size() / 2, npc.scale, something, 0); + return false; + } - public override bool CanHitPlayer(Player target, ref int cooldownSlot) + public override bool CanHitPlayer(Player target, ref int cooldownSlot) { if (AstrumDeusHeadSpectral.colorChange) { diff --git a/NPCs/BrimstoneWaifu/Brimling.cs b/NPCs/BrimstoneWaifu/Brimling.cs index 80d3b0fcb1..26e2b75c82 100644 --- a/NPCs/BrimstoneWaifu/Brimling.cs +++ b/NPCs/BrimstoneWaifu/Brimling.cs @@ -54,6 +54,7 @@ namespace CalamityMod.NPCs.BrimstoneWaifu } npc.noGravity = true; npc.noTileCollide = false; + npc.canGhostHeal = false; npc.HitSound = SoundID.NPCHit23; npc.DeathSound = SoundID.NPCDeath39; if (CalamityWorld.downedProvidence) @@ -62,7 +63,7 @@ namespace CalamityMod.NPCs.BrimstoneWaifu } if (CalamityWorld.bossRushActive) { - npc.lifeMax = 200000; + npc.lifeMax = 100000; } } diff --git a/NPCs/BrimstoneWaifu/BrimstoneElemental.cs b/NPCs/BrimstoneWaifu/BrimstoneElemental.cs index 769b82976c..0f12d75a9e 100644 --- a/NPCs/BrimstoneWaifu/BrimstoneElemental.cs +++ b/NPCs/BrimstoneWaifu/BrimstoneElemental.cs @@ -13,14 +13,12 @@ namespace CalamityMod.NPCs.BrimstoneWaifu [AutoloadBossHead] public class BrimstoneElemental : ModNPC { - private int dustTimer = 90; - public override void SetStaticDefaults() { DisplayName.SetDefault("Brimstone Elemental"); Main.npcFrameCount[npc.type] = 12; } - + public override void SetDefaults() { npc.npcSlots = 64f; @@ -29,44 +27,44 @@ namespace CalamityMod.NPCs.BrimstoneWaifu npc.height = 150; npc.defense = 20; npc.lifeMax = CalamityWorld.revenge ? 35708 : 26000; - if (CalamityWorld.death) - { - npc.lifeMax = 54050; - } - npc.knockBackResist = 0f; + if (CalamityWorld.death) + { + npc.lifeMax = 54050; + } + npc.knockBackResist = 0f; npc.aiStyle = -1; //new - aiType = -1; //new + aiType = -1; //new npc.value = Item.buyPrice(0, 12, 0, 0); for (int k = 0; k < npc.buffImmune.Length; k++) { - npc.buffImmune[k] = true; - npc.buffImmune[BuffID.Ichor] = false; - npc.buffImmune[mod.BuffType("MarkedforDeath")] = false; - npc.buffImmune[BuffID.CursedInferno] = false; - npc.buffImmune[BuffID.Daybreak] = false; - npc.buffImmune[mod.BuffType("AbyssalFlames")] = false; - npc.buffImmune[mod.BuffType("ArmorCrunch")] = false; - npc.buffImmune[mod.BuffType("DemonFlames")] = false; - npc.buffImmune[mod.BuffType("GodSlayerInferno")] = false; - npc.buffImmune[mod.BuffType("HolyLight")] = false; - npc.buffImmune[mod.BuffType("Nightwither")] = false; - npc.buffImmune[mod.BuffType("Plague")] = false; - npc.buffImmune[mod.BuffType("Shred")] = false; - npc.buffImmune[mod.BuffType("WhisperingDeath")] = false; - npc.buffImmune[mod.BuffType("SilvaStun")] = false; - } + npc.buffImmune[k] = true; + npc.buffImmune[BuffID.Ichor] = false; + npc.buffImmune[mod.BuffType("MarkedforDeath")] = false; + npc.buffImmune[BuffID.CursedInferno] = false; + npc.buffImmune[BuffID.Daybreak] = false; + npc.buffImmune[mod.BuffType("AbyssalFlames")] = false; + npc.buffImmune[mod.BuffType("ArmorCrunch")] = false; + npc.buffImmune[mod.BuffType("DemonFlames")] = false; + npc.buffImmune[mod.BuffType("GodSlayerInferno")] = false; + npc.buffImmune[mod.BuffType("HolyLight")] = false; + npc.buffImmune[mod.BuffType("Nightwither")] = false; + npc.buffImmune[mod.BuffType("Plague")] = false; + npc.buffImmune[mod.BuffType("Shred")] = false; + npc.buffImmune[mod.BuffType("WhisperingDeath")] = false; + npc.buffImmune[mod.BuffType("SilvaStun")] = false; + } npc.boss = true; npc.noGravity = true; npc.noTileCollide = true; npc.netAlways = true; npc.HitSound = SoundID.NPCHit23; npc.DeathSound = SoundID.NPCDeath39; - Mod calamityModMusic = ModLoader.GetMod("CalamityModMusic"); - if (calamityModMusic != null) - music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/LeftAlone"); - else - music = MusicID.Boss4; - bossBag = mod.ItemType("BrimstoneWaifuBag"); + Mod calamityModMusic = ModLoader.GetMod("CalamityModMusic"); + if (calamityModMusic != null) + music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/LeftAlone"); + else + music = MusicID.Boss4; + bossBag = mod.ItemType("BrimstoneWaifuBag"); if (CalamityWorld.downedProvidence) { npc.damage = 210; @@ -74,16 +72,16 @@ namespace CalamityMod.NPCs.BrimstoneWaifu npc.lifeMax = 300000; npc.value = Item.buyPrice(0, 35, 0, 0); } - if (CalamityWorld.bossRushActive) - { - npc.lifeMax = CalamityWorld.death ? 4500000 : 4000000; - } - } - + if (CalamityWorld.bossRushActive) + { + npc.lifeMax = CalamityWorld.death ? 2300000 : 2000000; + } + } + public override void AI() { - CalamityGlobalNPC.brimstoneElemental = npc.whoAmI; - Player player = Main.player[npc.target]; + CalamityGlobalNPC.brimstoneElemental = npc.whoAmI; + Player player = Main.player[npc.target]; CalamityPlayer modPlayer = player.GetModPlayer(mod); bool brimTeleport = (double)npc.life <= (double)npc.lifeMax * 0.2; bool provy = (CalamityWorld.downedProvidence && !CalamityWorld.bossRushActive); @@ -99,13 +97,13 @@ namespace CalamityMod.NPCs.BrimstoneWaifu int dustAmt = (npc.ai[0] == 2f) ? 2 : 1; int size = (npc.ai[0] == 2f) ? 50 : 35; float speed = expertMode ? 5f : 4.5f; - if (CalamityWorld.death || CalamityWorld.bossRushActive) - { - speed = 5.5f; - } - for (int num1011 = 0; num1011 < 2; num1011++) + if (CalamityWorld.death || CalamityWorld.bossRushActive) { - if (Main.rand.Next(3) < dustAmt) + speed = 5.5f; + } + for (int num1011 = 0; num1011 < 2; num1011++) + { + if (Main.rand.Next(3) < dustAmt) { int dust = Dust.NewDust(npc.Center - new Vector2((float)size), size * 2, size * 2, 235, npc.velocity.X * 0.5f, npc.velocity.Y * 0.5f, 90, default(Color), 1.5f); Main.dust[dust].noGravity = true; @@ -124,10 +122,10 @@ namespace CalamityMod.NPCs.BrimstoneWaifu { npc.timeLeft = 1800; } - if (npc.GetGlobalNPC(mod).enraged) - { - speed = 11f; - } + if (npc.GetGlobalNPC(mod).enraged) + { + speed = 11f; + } else if (!calamity) { speed = 7f; @@ -152,37 +150,17 @@ namespace CalamityMod.NPCs.BrimstoneWaifu npc.velocity.Y = yDistance * totalDistance; } } - if (Main.netMode != 1) - { - dustTimer--; - if (dustTimer <= 0 && npc.alpha <= 0) - { - int damage = expertMode ? 20 : 29; - Vector2 position = Vector2.Normalize(player.Center - vectorCenter) * (float)(npc.width + 20) / 2f + vectorCenter; - int projectile = Projectile.NewProjectile((int)position.X, (int)position.Y, 0f, 0f, mod.ProjectileType("BrimDust"), damage + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, 0f); //changed - Main.projectile[projectile].timeLeft = 90; - dustTimer = 90; - } - } - if (npc.ai[0] == 0f) + if (npc.ai[0] == 0f) { npc.defense = 20; npc.chaseable = true; if (Main.netMode != 1) { - npc.localAI[1] += 1f; - if (npc.justHit) + npc.localAI[1] += 1f; + if (npc.justHit) { npc.localAI[1] += 1f; } - if (brimTeleport) - { - npc.localAI[1] += 1f; - } - if (!calamity) - { - npc.localAI[1] += 2f; - } if (npc.localAI[1] >= (float)(200 + Main.rand.Next(100))) { npc.localAI[1] = 0f; @@ -214,70 +192,70 @@ namespace CalamityMod.NPCs.BrimstoneWaifu } } } - else if (npc.ai[0] == 1f) + else if (npc.ai[0] == 1f) { - npc.damage = 0; - npc.dontTakeDamage = true; - npc.defense = 20; - npc.chaseable = false; + npc.damage = 0; + npc.dontTakeDamage = true; + npc.defense = 20; + npc.chaseable = false; npc.alpha += (brimTeleport ? 5 : 4); if (npc.alpha >= 255) { - if (Main.netMode != 1 && NPC.CountNPCS(mod.NPCType("Brimling")) < 2 && revenge) - { - NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("Brimling"), 0, 0f, 0f, 0f, 0f, 255); - } - npc.alpha = 255; + if (Main.netMode != 1 && NPC.CountNPCS(mod.NPCType("Brimling")) < 2 && revenge) + { + NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("Brimling"), 0, 0f, 0f, 0f, 0f, 255); + } + npc.alpha = 255; npc.position.X = npc.ai[1] * 16f - (float)(npc.width / 2); npc.position.Y = npc.ai[2] * 16f - (float)(npc.height / 2); npc.ai[0] = 2f; - npc.netUpdate = true; - return; + npc.netUpdate = true; + return; } } - else if (npc.ai[0] == 2f) + else if (npc.ai[0] == 2f) { npc.alpha -= (brimTeleport ? 5 : 4); if (npc.alpha <= 0) { - npc.damage = expertMode ? 96 : 60; - npc.dontTakeDamage = false; - npc.defense = 20; - npc.chaseable = true; - npc.ai[3] += 1f; + npc.damage = expertMode ? 96 : 60; + npc.dontTakeDamage = false; + npc.defense = 20; + npc.chaseable = true; + npc.ai[3] += 1f; npc.alpha = 0; - if (npc.ai[3] >= 2f) + if (npc.ai[3] >= 2f) { npc.ai[0] = 3f; npc.ai[1] = 0f; npc.ai[2] = 0f; npc.ai[3] = 0f; - } + } else { npc.ai[0] = 0f; } - npc.netUpdate = true; - return; + npc.netUpdate = true; + return; } } - else if (npc.ai[0] == 3f) + else if (npc.ai[0] == 3f) { - npc.defense = 20; - npc.dontTakeDamage = false; - npc.chaseable = true; + npc.defense = 20; + npc.dontTakeDamage = false; + npc.chaseable = true; npc.rotation = npc.velocity.X * 0.04f; npc.spriteDirection = ((npc.direction > 0) ? 1 : -1); Vector2 shootFromVectorX = new Vector2(npc.position.X + (float)(npc.width / 2) + (float)(Main.rand.Next(20) * npc.direction), npc.position.Y + (float)npc.height * 0.8f); npc.ai[1] += 1f; bool shootProjectile = false; - if (npc.GetGlobalNPC(mod).enraged) - { - if (npc.ai[1] % 10f == 9f) - { - shootProjectile = true; - } - } + if (npc.GetGlobalNPC(mod).enraged) + { + if (npc.ai[1] % 10f == 9f) + { + shootProjectile = true; + } + } else if (CalamityWorld.bossRushActive) { if (npc.ai[1] % 15f == 14f) @@ -308,10 +286,10 @@ namespace CalamityMod.NPCs.BrimstoneWaifu if (Main.netMode != 1) { float projectileSpeed = 6f; //changed from 10 - if (npc.GetGlobalNPC(mod).enraged) - { - projectileSpeed += 4f; - } + if (npc.GetGlobalNPC(mod).enraged) + { + projectileSpeed += 4f; + } if (revenge) { projectileSpeed += 1f; @@ -340,55 +318,55 @@ namespace CalamityMod.NPCs.BrimstoneWaifu Main.projectile[projectileShot].timeLeft = 240; } } - if (npc.position.Y > player.position.Y - 150f) //200 - { - if (npc.velocity.Y > 0f) - { - npc.velocity.Y = npc.velocity.Y * 0.98f; - } - npc.velocity.Y = npc.velocity.Y - 0.1f; - if (npc.velocity.Y > 2f) - { - npc.velocity.Y = 2f; - } - } - else if (npc.position.Y < player.position.Y - 400f) //500 - { - if (npc.velocity.Y < 0f) - { - npc.velocity.Y = npc.velocity.Y * 0.98f; - } - npc.velocity.Y = npc.velocity.Y + 0.1f; - if (npc.velocity.Y < -2f) - { - npc.velocity.Y = -2f; - } - } - if (npc.position.X + (float)(npc.width / 2) > player.position.X + (float)(player.width / 2) + 100f) - { - if (npc.velocity.X > 0f) - { - npc.velocity.X = npc.velocity.X * 0.98f; - } - npc.velocity.X = npc.velocity.X - 0.1f; - if (npc.velocity.X > 8f) - { - npc.velocity.X = 8f; - } - } - if (npc.position.X + (float)(npc.width / 2) < player.position.X + (float)(player.width / 2) - 100f) - { - if (npc.velocity.X < 0f) - { - npc.velocity.X = npc.velocity.X * 0.98f; - } - npc.velocity.X = npc.velocity.X + 0.1f; - if (npc.velocity.X < -8f) - { - npc.velocity.X = -8f; - } - } - if (npc.ai[1] > 300f) + if (npc.position.Y > player.position.Y - 150f) //200 + { + if (npc.velocity.Y > 0f) + { + npc.velocity.Y = npc.velocity.Y * 0.98f; + } + npc.velocity.Y = npc.velocity.Y - 0.1f; + if (npc.velocity.Y > 2f) + { + npc.velocity.Y = 2f; + } + } + else if (npc.position.Y < player.position.Y - 400f) //500 + { + if (npc.velocity.Y < 0f) + { + npc.velocity.Y = npc.velocity.Y * 0.98f; + } + npc.velocity.Y = npc.velocity.Y + 0.1f; + if (npc.velocity.Y < -2f) + { + npc.velocity.Y = -2f; + } + } + if (npc.position.X + (float)(npc.width / 2) > player.position.X + (float)(player.width / 2) + 150f) //100 + { + if (npc.velocity.X > 0f) + { + npc.velocity.X = npc.velocity.X * 0.985f; + } + npc.velocity.X = npc.velocity.X - 0.1f; + if (npc.velocity.X > 8f) + { + npc.velocity.X = 8f; + } + } + if (npc.position.X + (float)(npc.width / 2) < player.position.X + (float)(player.width / 2) - 150f) //100 + { + if (npc.velocity.X < 0f) + { + npc.velocity.X = npc.velocity.X * 0.985f; + } + npc.velocity.X = npc.velocity.X + 0.1f; + if (npc.velocity.X < -8f) + { + npc.velocity.X = -8f; + } + } + if (npc.ai[1] > 300f) { npc.ai[0] = 4f; npc.ai[1] = 0f; @@ -401,19 +379,19 @@ namespace CalamityMod.NPCs.BrimstoneWaifu else if (npc.ai[0] == 4f) { npc.defense = 99999; - npc.dontTakeDamage = false; - npc.chaseable = false; + npc.dontTakeDamage = false; + npc.chaseable = false; if (Main.netMode != 1) { npc.localAI[0] += (float)Main.rand.Next(4); - if (npc.GetGlobalNPC(mod).enraged) - { - npc.localAI[0] += 3f; - } - if (CalamityWorld.death || !calamity) - { - npc.localAI[0] += 2f; - } + if (npc.GetGlobalNPC(mod).enraged) + { + npc.localAI[0] += 3f; + } + if (CalamityWorld.death || !calamity) + { + npc.localAI[0] += 2f; + } if (npc.localAI[0] >= 140f) { npc.localAI[0] = 0f; @@ -447,19 +425,19 @@ namespace CalamityMod.NPCs.BrimstoneWaifu Main.projectile[projectile].tileCollide = false; } float spread = 45f * 0.0174f; - double startAngle = Math.Atan2(npc.velocity.X, npc.velocity.Y)- spread / 2; - double deltaAngle = spread / 8f; - double offsetAngle; - int damage = expertMode ? 22 : 30; - int i; - for (i = 0; i < 6; i++ ) - { - offsetAngle = (startAngle + deltaAngle * ( i + i * i ) / 2f ) + 32f * i; - int projectile = Projectile.NewProjectile(shootFromVector.X, shootFromVector.Y, (float)( Math.Sin(offsetAngle) * 6f ), (float)( Math.Cos(offsetAngle) * 6f ), mod.ProjectileType("BrimstoneBarrage"), damage + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, 0f); - int projectile2 = Projectile.NewProjectile(shootFromVector.X, shootFromVector.Y, (float)( -Math.Sin(offsetAngle) * 6f ), (float)( -Math.Cos(offsetAngle) * 6f ), mod.ProjectileType("BrimstoneBarrage"), damage + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, 0f); - } + double startAngle = Math.Atan2(npc.velocity.X, npc.velocity.Y) - spread / 2; + double deltaAngle = spread / 8f; + double offsetAngle; + int damage = expertMode ? 22 : 30; + int i; + for (i = 0; i < 6; i++) + { + offsetAngle = (startAngle + deltaAngle * (i + i * i) / 2f) + 32f * i; + int projectile = Projectile.NewProjectile(shootFromVector.X, shootFromVector.Y, (float)(Math.Sin(offsetAngle) * 6f), (float)(Math.Cos(offsetAngle) * 6f), mod.ProjectileType("BrimstoneBarrage"), damage + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, 0f); + int projectile2 = Projectile.NewProjectile(shootFromVector.X, shootFromVector.Y, (float)(-Math.Sin(offsetAngle) * 6f), (float)(-Math.Cos(offsetAngle) * 6f), mod.ProjectileType("BrimstoneBarrage"), damage + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, 0f); + } } - } + } npc.TargetClosest(true); npc.ai[1] += 1f; npc.velocity *= 0.95f; @@ -477,14 +455,14 @@ namespace CalamityMod.NPCs.BrimstoneWaifu } } - public override void OnHitPlayer(Player player, int damage, bool crit) + public override void OnHitPlayer(Player player, int damage, bool crit) { if (CalamityWorld.revenge) { player.AddBuff(mod.BuffType("Horror"), 300, true); } } - + public override void FindFrame(int frameHeight) //9 total frames { npc.frameCounter += 1.0; @@ -533,63 +511,62 @@ namespace CalamityMod.NPCs.BrimstoneWaifu } } } - + public override void BossLoot(ref string name, ref int potionType) { potionType = ItemID.GreaterHealingPotion; } - + public override void NPCLoot() { - if (CalamityWorld.downedProvidence) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Bloodstone"), Main.rand.Next(20, 31)); - } if (Main.rand.Next(10) == 0) { - npc.DropItemInstanced(npc.position, npc.Size, mod.ItemType("RoseStone"), 1, true); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BrimstoneElementalTrophy")); } - if (Main.rand.Next(10) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BrimstoneElementalTrophy")); - } - if (CalamityWorld.armageddon) - { - for (int i = 0; i < 10; i++) - { - npc.DropBossBags(); - } - } - if (Main.expertMode) + if (CalamityWorld.armageddon) + { + for (int i = 0; i < 5; i++) + { + npc.DropBossBags(); + } + } + if (Main.expertMode) { npc.DropBossBags(); } else { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.SoulofFright, Main.rand.Next(20, 41)); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EssenceofChaos"), Main.rand.Next(2, 4)); - int choice = Main.rand.Next(3); - if (choice == 0) + if (CalamityWorld.downedProvidence) { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Abaddon")); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Bloodstone"), Main.rand.Next(20, 31)); } - else if (choice == 1) + if (Main.rand.Next(10) == 0) { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Brimlance")); + npc.DropItemInstanced(npc.position, npc.Size, mod.ItemType("RoseStone"), 1, true); } - else + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.SoulofFright, Main.rand.Next(20, 41)); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EssenceofChaos"), Main.rand.Next(4, 9)); + switch (Main.rand.Next(3)) { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SeethingDischarge")); + case 0: + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Abaddon")); + break; + case 1: + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Brimlance")); + break; + case 2: + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SeethingDischarge")); + break; } } } - + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { npc.lifeMax = (int)(npc.lifeMax * 0.8f * bossLifeScale); npc.damage = (int)(npc.damage * 0.8f); } - + public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 5; k++) diff --git a/NPCs/Bumblefuck/Bumblefuck.cs b/NPCs/Bumblefuck/Bumblefuck.cs index a6885d2792..6200fab8ee 100644 --- a/NPCs/Bumblefuck/Bumblefuck.cs +++ b/NPCs/Bumblefuck/Bumblefuck.cs @@ -18,65 +18,65 @@ namespace CalamityMod.NPCs.Bumblefuck DisplayName.SetDefault("Bumblebirb"); Main.npcFrameCount[npc.type] = 10; } - + public override void SetDefaults() { npc.npcSlots = 32f; npc.aiStyle = -1; aiType = -1; - npc.damage = 200; + npc.damage = 160; npc.width = 80; //324 npc.height = 80; //216 - npc.defense = 60; - npc.lifeMax = CalamityWorld.revenge ? 500000 : 440000; - if (CalamityWorld.death) - { - npc.lifeMax = 625000; - } - if (CalamityWorld.bossRushActive) - { - npc.lifeMax = CalamityWorld.death ? 1900000 : 1700000; - } - npc.knockBackResist = 0f; + npc.defense = 40; + npc.lifeMax = CalamityWorld.revenge ? 252500 : 227500; + if (CalamityWorld.death) + { + npc.lifeMax = 302500; + } + if (CalamityWorld.bossRushActive) + { + npc.lifeMax = CalamityWorld.death ? 1000000 : 900000; + } + npc.knockBackResist = 0f; for (int k = 0; k < npc.buffImmune.Length; k++) { npc.buffImmune[k] = true; npc.buffImmune[BuffID.Ichor] = false; - npc.buffImmune[BuffID.CursedInferno] = false; - npc.buffImmune[mod.BuffType("ExoFreeze")] = false; - npc.buffImmune[mod.BuffType("AbyssalFlames")] = false; - npc.buffImmune[mod.BuffType("ArmorCrunch")] = false; - npc.buffImmune[mod.BuffType("DemonFlames")] = false; - npc.buffImmune[mod.BuffType("GodSlayerInferno")] = false; - npc.buffImmune[mod.BuffType("Nightwither")] = false; - npc.buffImmune[mod.BuffType("Shred")] = false; - npc.buffImmune[mod.BuffType("WhisperingDeath")] = false; - npc.buffImmune[mod.BuffType("SilvaStun")] = false; - } - npc.boss = true; - Mod calamityModMusic = ModLoader.GetMod("CalamityModMusic"); - if (calamityModMusic != null) - music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/Murderswarm"); - else - music = MusicID.Boss4; - npc.lavaImmune = true; + npc.buffImmune[BuffID.CursedInferno] = false; + npc.buffImmune[mod.BuffType("ExoFreeze")] = false; + npc.buffImmune[mod.BuffType("AbyssalFlames")] = false; + npc.buffImmune[mod.BuffType("ArmorCrunch")] = false; + npc.buffImmune[mod.BuffType("DemonFlames")] = false; + npc.buffImmune[mod.BuffType("GodSlayerInferno")] = false; + npc.buffImmune[mod.BuffType("Nightwither")] = false; + npc.buffImmune[mod.BuffType("Shred")] = false; + npc.buffImmune[mod.BuffType("WhisperingDeath")] = false; + npc.buffImmune[mod.BuffType("SilvaStun")] = false; + } + npc.boss = true; + Mod calamityModMusic = ModLoader.GetMod("CalamityModMusic"); + if (calamityModMusic != null) + music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/Murderswarm"); + else + music = MusicID.Boss4; + npc.lavaImmune = true; npc.noGravity = true; npc.value = Item.buyPrice(0, 30, 0, 0); npc.HitSound = SoundID.NPCHit51; npc.DeathSound = SoundID.NPCDeath46; - bossBag = mod.ItemType("BumblebirbBag"); - } - + bossBag = mod.ItemType("BumblebirbBag"); + } + public override void AI() { Player player = Main.player[npc.target]; bool revenge = CalamityWorld.revenge; Vector2 vector = npc.Center; - int num1305 = revenge ? 10 : 5; - if (CalamityWorld.death) - { - num1305 = 20; - } + int num1305 = revenge ? 6 : 4; + if (CalamityWorld.death) + { + num1305 = 8; + } npc.noTileCollide = false; npc.noGravity = true; npc.damage = npc.defDamage; @@ -88,24 +88,24 @@ namespace CalamityMod.NPCs.Bumblefuck } } Vector2 vector205 = player.Center - npc.Center; - if (npc.ai[0] > 1f && vector205.Length() > 5200f) - { - npc.ai[0] = 1f; - } - if (npc.ai[0] == 0f) + if (npc.ai[0] > 1f && vector205.Length() > 5200f) + { + npc.ai[0] = 1f; + } + if (npc.ai[0] == 0f) { npc.TargetClosest(true); - if (npc.Center.X < player.Center.X - 2f) + if (npc.Center.X < player.Center.X - 2f) { npc.direction = 1; } - if (npc.Center.X > player.Center.X + 2f) + if (npc.Center.X > player.Center.X + 2f) { npc.direction = -1; } npc.spriteDirection = npc.direction; npc.rotation = (npc.rotation * 9f + npc.velocity.X * 0.05f) / 10f; - if (npc.collideX) + if (npc.collideX) { npc.velocity.X = npc.velocity.X * (-npc.oldVelocity.X * 0.5f); if (npc.velocity.X > 26f) //4 @@ -117,7 +117,7 @@ namespace CalamityMod.NPCs.Bumblefuck npc.velocity.X = -26f; //4 } } - if (npc.collideY) + if (npc.collideY) { npc.velocity.Y = npc.velocity.Y * (-npc.oldVelocity.Y * 0.5f); if (npc.velocity.Y > 26f) //4 @@ -137,71 +137,71 @@ namespace CalamityMod.NPCs.Bumblefuck npc.ai[1] = 0f; npc.ai[2] = 0f; npc.ai[3] = 0f; - } - else if (value51.Length() > 80f) + } + else if (value51.Length() > 80f) { float scaleFactor15 = 12f; //6 float num1306 = 30f; value51.Normalize(); value51 *= scaleFactor15; npc.velocity = (npc.velocity * (num1306 - 1f) + value51) / num1306; - } + } else if (npc.velocity.Length() > 18f) //8 { npc.velocity *= 0.95f; - } + } else if (npc.velocity.Length() < 9f) //4 { npc.velocity *= 1.05f; } npc.ai[1] += 1f; - if (npc.justHit) + if (npc.justHit) { npc.ai[1] += (float)Main.rand.Next(10, 30); } - if (npc.ai[1] >= 180f && Main.netMode != 1) + if (npc.ai[1] >= 180f && Main.netMode != 1) { npc.ai[1] = 0f; npc.ai[2] = 0f; npc.ai[3] = 0f; npc.netUpdate = true; - while (npc.ai[0] == 0f) - { - int damage = Main.expertMode ? 65 : 80; //260 160 - int num1307 = Main.rand.Next(6); - if (num1307 == 0 && Collision.CanHit(npc.Center, 1, 1, player.Center, 1, 1)) - { - npc.ai[0] = 2f; - } - else if (num1307 == 1) - { - npc.ai[0] = 3f; - } - else if (num1307 >= 2 && NPC.CountNPCS(mod.NPCType("Bumblefuck2")) < num1305) - { - npc.ai[0] = 4f; //summon more birbs - Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 102); - for (int num186 = 0; num186 < 6; num186++) - { - Projectile.NewProjectile(npc.Center.X, npc.Center.Y, (float)Main.rand.Next(-10, 10), (float)Main.rand.Next(-5, -2), mod.ProjectileType("RedLightningFeather"), damage, 0f, Main.myPlayer, 0f, 0f); - } - } - } + while (npc.ai[0] == 0f) + { + int damage = Main.expertMode ? 45 : 60; //180 120 + int num1307 = Main.rand.Next(3); + if (num1307 == 0 && Collision.CanHit(npc.Center, 1, 1, player.Center, 1, 1)) + { + npc.ai[0] = 2f; + } + else if (num1307 == 1) + { + npc.ai[0] = 3f; + } + else if (NPC.CountNPCS(mod.NPCType("Bumblefuck2")) < num1305) + { + npc.ai[0] = 4f; //summon more birbs + Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 102); + for (int num186 = 0; num186 < 6; num186++) + { + Projectile.NewProjectile(npc.Center.X, npc.Center.Y, (float)Main.rand.Next(-10, 10), (float)Main.rand.Next(-5, -2), mod.ProjectileType("RedLightningFeather"), damage, 0f, Main.myPlayer, 0f, 0f); + } + } + } return; } } - else + else { if (npc.ai[0] == 1f) //move closer and spawn birbs { npc.collideX = false; npc.collideY = false; npc.noTileCollide = true; - if (npc.target < 0 || !player.active || player.dead) + if (npc.target < 0 || !player.active || player.dead) { npc.TargetClosest(true); } - if (npc.velocity.X < 0f) + if (npc.velocity.X < 0f) { npc.direction = -1; } @@ -214,7 +214,7 @@ namespace CalamityMod.NPCs.Bumblefuck Vector2 value52 = player.Center - npc.Center; if (value52.Length() < 500f && !Collision.SolidCollision(npc.position, npc.width, npc.height)) //500 { - npc.ai[0] = 0f; + npc.ai[0] = 0f; npc.ai[1] = 0f; npc.ai[2] = 0f; npc.ai[3] = 0f; @@ -226,7 +226,7 @@ namespace CalamityMod.NPCs.Bumblefuck npc.velocity = (npc.velocity * (num1308 - 1f) + value52) / num1308; return; } - if (npc.ai[0] == 2f) + if (npc.ai[0] == 2f) { npc.damage = (int)((double)npc.defDamage * 0.9); if (npc.target < 0 || !player.active || player.dead) @@ -240,14 +240,14 @@ namespace CalamityMod.NPCs.Bumblefuck if (player.Center.X - 10f < npc.Center.X) { npc.direction = -1; - } + } else if (player.Center.X + 10f > npc.Center.X) { npc.direction = 1; } npc.spriteDirection = npc.direction; npc.rotation = (npc.rotation * 4f + npc.velocity.X * 0.05f) / 5f; - if (npc.collideX) + if (npc.collideX) { npc.velocity.X = npc.velocity.X * (-npc.oldVelocity.X * 0.5f); if (npc.velocity.X > 27f) //4 @@ -259,7 +259,7 @@ namespace CalamityMod.NPCs.Bumblefuck npc.velocity.X = -27f; //4 } } - if (npc.collideY) + if (npc.collideY) { npc.velocity.Y = npc.velocity.Y * (-npc.oldVelocity.Y * 0.5f); if (npc.velocity.Y > 27f) //4 @@ -274,7 +274,7 @@ namespace CalamityMod.NPCs.Bumblefuck Vector2 value53 = player.Center - npc.Center; value53.Y -= 20f; npc.ai[2] += 0.0222222228f; - if (Main.expertMode) + if (Main.expertMode) { npc.ai[2] += 0.0166666675f; } @@ -284,24 +284,24 @@ namespace CalamityMod.NPCs.Bumblefuck value53 *= scaleFactor17; npc.velocity = (npc.velocity * (num1309 - 1f) + value53) / num1309; npc.ai[1] += 1f; - if (npc.ai[1] > 180f || !Collision.CanHit(npc.Center, 1, 1, player.Center, 1, 1)) + if (npc.ai[1] > 180f || !Collision.CanHit(npc.Center, 1, 1, player.Center, 1, 1)) { - npc.ai[0] = 0f; + npc.ai[0] = 0f; npc.ai[1] = 0f; npc.ai[2] = 0f; npc.ai[3] = 0f; return; } } - else + else { - if (npc.ai[0] == 3f) + if (npc.ai[0] == 3f) { npc.noTileCollide = true; - if (npc.velocity.X < 0f) + if (npc.velocity.X < 0f) { npc.direction = -1; - } + } else { npc.direction = 1; @@ -310,15 +310,15 @@ namespace CalamityMod.NPCs.Bumblefuck npc.rotation = (npc.rotation * 4f + npc.velocity.X * 0.035f) / 5f; Vector2 value54 = player.Center - npc.Center; value54.Y -= 12f; - if (npc.Center.X > player.Center.X) + if (npc.Center.X > player.Center.X) { value54.X += 400f; - } + } else { value54.X -= 400f; } - if (Math.Abs(npc.Center.X - player.Center.X) > 350f && Math.Abs(npc.Center.Y - player.Center.Y) < 20f) + if (Math.Abs(npc.Center.X - player.Center.X) > 350f && Math.Abs(npc.Center.Y - player.Center.Y) < 20f) { npc.ai[0] = 3.1f; npc.ai[1] = 0f; @@ -331,7 +331,7 @@ namespace CalamityMod.NPCs.Bumblefuck npc.velocity = (npc.velocity * (num1310 - 1f) + value54) / num1310; return; } - if (npc.ai[0] == 3.1f) + if (npc.ai[0] == 3.1f) { npc.noTileCollide = true; npc.rotation = (npc.rotation * 4f + npc.velocity.X * 0.035f) / 5f; @@ -342,23 +342,23 @@ namespace CalamityMod.NPCs.Bumblefuck vector206.Normalize(); vector206 *= scaleFactor19; npc.velocity = (npc.velocity * (num1311 - 1f) + vector206) / num1311; - if (npc.velocity.X < 0f) + if (npc.velocity.X < 0f) { npc.direction = -1; - } + } else { npc.direction = 1; } npc.spriteDirection = npc.direction; npc.ai[1] += 1f; - if (npc.ai[1] > 10f) + if (npc.ai[1] > 10f) { npc.velocity = vector206; - if (npc.velocity.X < 0f) + if (npc.velocity.X < 0f) { npc.direction = -1; - } + } else { npc.direction = 1; @@ -369,25 +369,25 @@ namespace CalamityMod.NPCs.Bumblefuck return; } } - else + else { - if (npc.ai[0] == 3.2f) + if (npc.ai[0] == 3.2f) { - npc.damage = (int)((double)npc.defDamage * 1.75); + npc.damage = (int)((double)npc.defDamage * 1.5); npc.collideX = false; npc.collideY = false; npc.noTileCollide = true; npc.ai[2] += 0.0333333351f; npc.velocity.X = (18f + npc.ai[2]) * npc.ai[1]; //16 - if ((npc.ai[1] > 0f && npc.Center.X > player.Center.X + 400f) || (npc.ai[1] < 0f && npc.Center.X < player.Center.X - 400f)) + if ((npc.ai[1] > 0f && npc.Center.X > player.Center.X + 400f) || (npc.ai[1] < 0f && npc.Center.X < player.Center.X - 400f)) { - if (!Collision.SolidCollision(npc.position, npc.width, npc.height)) + if (!Collision.SolidCollision(npc.position, npc.width, npc.height)) { - npc.ai[0] = 0f; + npc.ai[0] = 0f; npc.ai[1] = 0f; npc.ai[2] = 0f; npc.ai[3] = 0f; - } + } else if (Math.Abs(npc.Center.X - player.Center.X) > 800f) //800 { npc.ai[0] = 1f; @@ -399,137 +399,137 @@ namespace CalamityMod.NPCs.Bumblefuck npc.rotation = (npc.rotation * 4f + npc.velocity.X * 0.035f) / 5f; return; } - if (npc.ai[0] == 4f) - { - npc.ai[0] = 0f; - npc.TargetClosest(true); - if (Main.netMode != 1) - { - npc.ai[1] = -1f; - npc.ai[2] = -1f; - for (int num1312 = 0; num1312 < 1000; num1312++) - { - int num1313 = (int)player.Center.X / 16; - int num1314 = (int)player.Center.Y / 16; - int num1315 = 30 + num1312 / 50; - int num1316 = 20 + num1312 / 75; - num1313 += Main.rand.Next(-num1315, num1315 + 1); - num1314 += Main.rand.Next(-num1316, num1316 + 1); - if (!WorldGen.SolidTile(num1313, num1314)) - { - while (!WorldGen.SolidTile(num1313, num1314) && (double)num1314 < Main.worldSurface) - { - num1314++; - } - if ((new Vector2((float)(num1313 * 16 + 8), (float)(num1314 * 16 + 8)) - player.Center).Length() < 5600f) //600 - { - npc.ai[0] = 4.1f; - npc.ai[1] = (float)num1313; - npc.ai[2] = (float)num1314; - break; - } - } - } - } - npc.netUpdate = true; - return; - } - if (npc.ai[0] == 4.1f) - { - if (npc.velocity.X < -2f) - { - npc.direction = -1; - } - else if (npc.velocity.X > 2f) - { - npc.direction = 1; - } - npc.spriteDirection = npc.direction; - npc.rotation = (npc.rotation * 9f + npc.velocity.X * 0.05f) / 10f; - npc.noTileCollide = true; - int num1317 = (int)npc.ai[1]; - int num1318 = (int)npc.ai[2]; - float x2 = (float)(num1317 * 16 + 8); - float y2 = (float)(num1318 * 16 - 20); - Vector2 vector207 = new Vector2(x2, y2); - vector207 -= npc.Center; - float num1319 = 6f + vector207.Length() / 150f; - if (num1319 > 10f) - { - num1319 = 10f; - } - float num1320 = 10f; //10 - if (vector207.Length() < 100f) //10 - { - npc.ai[0] = 4.2f; - } - vector207.Normalize(); - vector207 *= num1319; - npc.velocity = (npc.velocity * (num1320 - 1f) + vector207) / num1320; - return; - } - if (npc.ai[0] == 4.2f) - { - npc.rotation = (npc.rotation * 9f + npc.velocity.X * 0.05f) / 10f; - npc.noTileCollide = true; - int num1321 = (int)npc.ai[1]; - int num1322 = (int)npc.ai[2]; - float x3 = (float)(num1321 * 16 + 8); - float y3 = (float)(num1322 * 16 - 20); - Vector2 vector208 = new Vector2(x3, y3); - vector208 -= npc.Center; - float num1323 = 40f; //4 - float num1324 = 2f; //2 - if (Main.netMode != 1 && vector208.Length() < 40f) //4 - { - int num1325 = 10; - if (Main.expertMode) - { - num1325 = (int)((double)num1325 * 0.75); - } - npc.ai[3] += 1f; - if (npc.ai[3] == (float)num1325) - { - NPC.NewNPC(num1321 * 16 + 8, num1322 * 16, mod.NPCType("Bumblefuck2"), npc.whoAmI, 0f, 0f, 0f, 0f, 255); - } - else if (npc.ai[3] == (float)(num1325 * 2)) - { - npc.ai[0] = 0f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] = 0f; - if (NPC.CountNPCS(mod.NPCType("Bumblefuck2")) < num1305 && Main.rand.Next(5) != 0) - { - npc.ai[0] = 4f; - } - else if (Collision.SolidCollision(npc.position, npc.width, npc.height)) - { - npc.ai[0] = 1f; - } - } - } - if (vector208.Length() > num1323) - { - vector208.Normalize(); - vector208 *= num1323; - } - npc.velocity = (npc.velocity * (num1324 - 1f) + vector208) / num1324; - return; - } - } + if (npc.ai[0] == 4f) + { + npc.ai[0] = 0f; + npc.TargetClosest(true); + if (Main.netMode != 1) + { + npc.ai[1] = -1f; + npc.ai[2] = -1f; + for (int num1312 = 0; num1312 < 1000; num1312++) + { + int num1313 = (int)player.Center.X / 16; + int num1314 = (int)player.Center.Y / 16; + int num1315 = 30 + num1312 / 50; + int num1316 = 20 + num1312 / 75; + num1313 += Main.rand.Next(-num1315, num1315 + 1); + num1314 += Main.rand.Next(-num1316, num1316 + 1); + if (!WorldGen.SolidTile(num1313, num1314)) + { + while (!WorldGen.SolidTile(num1313, num1314) && (double)num1314 < Main.worldSurface) + { + num1314++; + } + if ((new Vector2((float)(num1313 * 16 + 8), (float)(num1314 * 16 + 8)) - player.Center).Length() < 5600f) //600 + { + npc.ai[0] = 4.1f; + npc.ai[1] = (float)num1313; + npc.ai[2] = (float)num1314; + break; + } + } + } + } + npc.netUpdate = true; + return; + } + if (npc.ai[0] == 4.1f) + { + if (npc.velocity.X < -2f) + { + npc.direction = -1; + } + else if (npc.velocity.X > 2f) + { + npc.direction = 1; + } + npc.spriteDirection = npc.direction; + npc.rotation = (npc.rotation * 9f + npc.velocity.X * 0.05f) / 10f; + npc.noTileCollide = true; + int num1317 = (int)npc.ai[1]; + int num1318 = (int)npc.ai[2]; + float x2 = (float)(num1317 * 16 + 8); + float y2 = (float)(num1318 * 16 - 20); + Vector2 vector207 = new Vector2(x2, y2); + vector207 -= npc.Center; + float num1319 = 6f + vector207.Length() / 150f; + if (num1319 > 10f) + { + num1319 = 10f; + } + float num1320 = 10f; //10 + if (vector207.Length() < 100f) //10 + { + npc.ai[0] = 4.2f; + } + vector207.Normalize(); + vector207 *= num1319; + npc.velocity = (npc.velocity * (num1320 - 1f) + vector207) / num1320; + return; + } + if (npc.ai[0] == 4.2f) + { + npc.rotation = (npc.rotation * 9f + npc.velocity.X * 0.05f) / 10f; + npc.noTileCollide = true; + int num1321 = (int)npc.ai[1]; + int num1322 = (int)npc.ai[2]; + float x3 = (float)(num1321 * 16 + 8); + float y3 = (float)(num1322 * 16 - 20); + Vector2 vector208 = new Vector2(x3, y3); + vector208 -= npc.Center; + float num1323 = 40f; //4 + float num1324 = 2f; //2 + if (Main.netMode != 1 && vector208.Length() < 40f) //4 + { + int num1325 = 10; + if (Main.expertMode) + { + num1325 = (int)((double)num1325 * 0.75); + } + npc.ai[3] += 1f; + if (npc.ai[3] == (float)num1325) + { + NPC.NewNPC(num1321 * 16 + 8, num1322 * 16, mod.NPCType("Bumblefuck2"), npc.whoAmI, 0f, 0f, 0f, 0f, 255); + } + else if (npc.ai[3] == (float)(num1325 * 2)) + { + npc.ai[0] = 0f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.ai[3] = 0f; + if (NPC.CountNPCS(mod.NPCType("Bumblefuck2")) < num1305 && Main.rand.Next(5) != 0) + { + npc.ai[0] = 4f; + } + else if (Collision.SolidCollision(npc.position, npc.width, npc.height)) + { + npc.ai[0] = 1f; + } + } + } + if (vector208.Length() > num1323) + { + vector208.Normalize(); + vector208 *= num1323; + } + npc.velocity = (npc.velocity * (num1324 - 1f) + vector208) / num1324; + return; + } + } } } } - public override bool CanHitPlayer(Player target, ref int cooldownSlot) + public override bool CanHitPlayer(Player target, ref int cooldownSlot) { cooldownSlot = 1; return true; } - + public override void FindFrame(int frameHeight) - { - npc.frameCounter += (double)(npc.velocity.Length() / 4f); + { + npc.frameCounter += (double)(npc.velocity.Length() / 4f); npc.frameCounter += 1.0; if (npc.ai[0] < 4f) { @@ -555,20 +555,20 @@ namespace CalamityMod.NPCs.Bumblefuck npc.frame.Y = frameHeight * 5; } } - } - + } + public override void BossLoot(ref string name, ref int potionType) { name = "A Bumblebirb"; - potionType = mod.ItemType("SupremeHealingPotion"); + potionType = ItemID.SuperHealingPotion; } - + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { npc.lifeMax = (int)(npc.lifeMax * 0.8f * bossLifeScale); npc.damage = (int)(npc.damage * 0.8f); } - + public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 5; k++) @@ -595,41 +595,40 @@ namespace CalamityMod.NPCs.Bumblefuck } } } - + public override void NPCLoot() { - if (Main.rand.Next(10) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BumblebirbTrophy")); - } - if (CalamityWorld.armageddon) - { - for (int i = 0; i < 10; i++) - { - npc.DropBossBags(); - } - } - if (Main.expertMode) - { - npc.DropBossBags(); - } - else - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EffulgentFeather"), Main.rand.Next(6, 12)); - int choice = Main.rand.Next(3); - if (choice == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("RougeSlash")); - } - else if (choice == 1) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GildedProboscis")); - } - else - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GoldenEagle")); - } - } + if (Main.rand.Next(10) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BumblebirbTrophy")); + } + if (CalamityWorld.armageddon) + { + for (int i = 0; i < 5; i++) + { + npc.DropBossBags(); + } + } + if (Main.expertMode) + { + npc.DropBossBags(); + } + else + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EffulgentFeather"), Main.rand.Next(6, 12)); + switch (Main.rand.Next(3)) + { + case 0: + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("RougeSlash")); + break; + case 1: + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GildedProboscis")); + break; + case 2: + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GoldenEagle")); + break; + } + } } } } \ No newline at end of file diff --git a/NPCs/Bumblefuck/Bumblefuck2.cs b/NPCs/Bumblefuck/Bumblefuck2.cs index 63c157e2e0..69ace3642c 100644 --- a/NPCs/Bumblefuck/Bumblefuck2.cs +++ b/NPCs/Bumblefuck/Bumblefuck2.cs @@ -23,15 +23,15 @@ namespace CalamityMod.NPCs.Bumblefuck npc.npcSlots = 1f; npc.aiStyle = -1; aiType = -1; - npc.damage = 140; + npc.damage = 110; npc.width = 80; //324 npc.height = 80; //216 npc.scale = 0.66f; - npc.defense = 40; - npc.lifeMax = 50000; + npc.defense = 25; + npc.lifeMax = 30000; if (CalamityWorld.bossRushActive) { - npc.lifeMax = 30000; + npc.lifeMax = 60000; } npc.knockBackResist = 0f; for (int k = 0; k < npc.buffImmune.Length; k++) @@ -43,6 +43,7 @@ namespace CalamityMod.NPCs.Bumblefuck } npc.lavaImmune = true; npc.noGravity = true; + npc.canGhostHeal = false; npc.HitSound = SoundID.NPCHit51; npc.DeathSound = SoundID.NPCDeath46; } diff --git a/NPCs/Bumblefuck/Bumblefuck3.cs b/NPCs/Bumblefuck/Bumblefuck3.cs index c229feb435..9de7f0b9b0 100644 --- a/NPCs/Bumblefuck/Bumblefuck3.cs +++ b/NPCs/Bumblefuck/Bumblefuck3.cs @@ -23,7 +23,7 @@ namespace CalamityMod.NPCs.Bumblefuck npc.npcSlots = 1f; npc.aiStyle = -1; aiType = -1; - npc.damage = 170; + npc.damage = 190; npc.width = 80; //324 npc.height = 80; //216 npc.scale = 0.85f; @@ -39,6 +39,7 @@ namespace CalamityMod.NPCs.Bumblefuck } npc.lavaImmune = true; npc.noGravity = true; + npc.canGhostHeal = false; npc.HitSound = SoundID.NPCHit51; npc.DeathSound = SoundID.NPCDeath46; } diff --git a/NPCs/Calamitas/Calamitas.cs b/NPCs/Calamitas/Calamitas.cs index 096148156a..0908d89393 100644 --- a/NPCs/Calamitas/Calamitas.cs +++ b/NPCs/Calamitas/Calamitas.cs @@ -19,7 +19,7 @@ namespace CalamityMod.NPCs.Calamitas DisplayName.SetDefault("Calamitas"); Main.npcFrameCount[npc.type] = 6; } - + public override void SetDefaults() { npc.damage = 70; @@ -29,31 +29,33 @@ namespace CalamityMod.NPCs.Calamitas npc.defense = 15; npc.value = 0f; npc.lifeMax = CalamityWorld.revenge ? 15000 : 10000; - if (CalamityWorld.death) - { - npc.lifeMax = 22500; - } - npc.aiStyle = -1; //new - aiType = -1; //new + if (CalamityWorld.death) + { + npc.lifeMax = 22500; + } + npc.aiStyle = -1; //new + aiType = -1; //new npc.knockBackResist = 0f; + NPCID.Sets.TrailCacheLength[npc.type] = 8; + NPCID.Sets.TrailingMode[npc.type] = 1; for (int k = 0; k < npc.buffImmune.Length; k++) { - npc.buffImmune[k] = true; - npc.buffImmune[BuffID.Ichor] = false; - npc.buffImmune[mod.BuffType("MarkedforDeath")] = false; - npc.buffImmune[BuffID.CursedInferno] = false; - npc.buffImmune[BuffID.Daybreak] = false; - npc.buffImmune[mod.BuffType("AbyssalFlames")] = false; - npc.buffImmune[mod.BuffType("ArmorCrunch")] = false; - npc.buffImmune[mod.BuffType("DemonFlames")] = false; - npc.buffImmune[mod.BuffType("GodSlayerInferno")] = false; - npc.buffImmune[mod.BuffType("HolyLight")] = false; - npc.buffImmune[mod.BuffType("Nightwither")] = false; - npc.buffImmune[mod.BuffType("Plague")] = false; - npc.buffImmune[mod.BuffType("Shred")] = false; - npc.buffImmune[mod.BuffType("WhisperingDeath")] = false; - npc.buffImmune[mod.BuffType("SilvaStun")] = false; - } + npc.buffImmune[k] = true; + npc.buffImmune[BuffID.Ichor] = false; + npc.buffImmune[mod.BuffType("MarkedforDeath")] = false; + npc.buffImmune[BuffID.CursedInferno] = false; + npc.buffImmune[BuffID.Daybreak] = false; + npc.buffImmune[mod.BuffType("AbyssalFlames")] = false; + npc.buffImmune[mod.BuffType("ArmorCrunch")] = false; + npc.buffImmune[mod.BuffType("DemonFlames")] = false; + npc.buffImmune[mod.BuffType("GodSlayerInferno")] = false; + npc.buffImmune[mod.BuffType("HolyLight")] = false; + npc.buffImmune[mod.BuffType("Nightwither")] = false; + npc.buffImmune[mod.BuffType("Plague")] = false; + npc.buffImmune[mod.BuffType("Shred")] = false; + npc.buffImmune[mod.BuffType("WhisperingDeath")] = false; + npc.buffImmune[mod.BuffType("SilvaStun")] = false; + } npc.boss = true; npc.noGravity = true; npc.noTileCollide = true; @@ -65,21 +67,21 @@ namespace CalamityMod.NPCs.Calamitas npc.defense = 130; npc.lifeMax = 80000; } - if (CalamityWorld.bossRushActive) - { - npc.lifeMax = CalamityWorld.death ? 2600000 : 2200000; - } - } + if (CalamityWorld.bossRushActive) + { + npc.lifeMax = CalamityWorld.death ? 1300000 : 1100000; + } + } - public override void FindFrame(int frameHeight) - { - npc.frameCounter += 0.15f; - npc.frameCounter %= Main.npcFrameCount[npc.type]; - int frame = (int)npc.frameCounter; - npc.frame.Y = frame * frameHeight; - } + public override void FindFrame(int frameHeight) + { + npc.frameCounter += 0.15f; + npc.frameCounter %= Main.npcFrameCount[npc.type]; + int frame = (int)npc.frameCounter; + npc.frame.Y = frame * frameHeight; + } - public override void AI() + public override void AI() { bool revenge = (CalamityWorld.revenge || CalamityWorld.bossRushActive); bool expertMode = (Main.expertMode || CalamityWorld.bossRushActive); @@ -345,11 +347,52 @@ namespace CalamityMod.NPCs.Calamitas } } - public override bool PreNPCLoot() + public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) + { + SpriteEffects spriteEffects = SpriteEffects.None; + Microsoft.Xna.Framework.Color color24 = npc.GetAlpha(drawColor); + Microsoft.Xna.Framework.Color color25 = Lighting.GetColor((int)((double)npc.position.X + (double)npc.width * 0.5) / 16, (int)(((double)npc.position.Y + (double)npc.height * 0.5) / 16.0)); + Texture2D texture2D3 = Main.npcTexture[npc.type]; + int num156 = Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type]; + int y3 = num156 * (int)npc.frameCounter; + Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle(0, y3, texture2D3.Width, num156); + Vector2 origin2 = rectangle.Size() / 2f; + int num157 = 8; + int num158 = 2; + int num159 = 1; + float num160 = 0f; + int num161 = num159; + while (((num158 > 0 && num161 < num157) || (num158 < 0 && num161 > num157)) && Lighting.NotRetro) + { + Microsoft.Xna.Framework.Color color26 = npc.GetAlpha(color25); + { + goto IL_6899; + } + IL_6881: + num161 += num158; + continue; + IL_6899: + float num164 = (float)(num157 - num161); + if (num158 < 0) + { + num164 = (float)(num159 - num161); + } + color26 *= num164 / ((float)NPCID.Sets.TrailCacheLength[npc.type] * 1.5f); + Vector2 value4 = (npc.oldPos[num161]); + float num165 = npc.rotation; + Main.spriteBatch.Draw(texture2D3, value4 + npc.Size / 2f - Main.screenPosition + new Vector2(0, npc.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rectangle), color26, num165 + npc.rotation * num160 * (float)(num161 - 1) * -(float)spriteEffects.HasFlag(SpriteEffects.FlipHorizontally).ToDirectionInt(), origin2, npc.scale, spriteEffects, 0f); + goto IL_6881; + } + var something = npc.direction == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; + spriteBatch.Draw(texture2D3, npc.Center - Main.screenPosition + new Vector2(0, npc.gfxOffY), npc.frame, color24, npc.rotation, npc.frame.Size() / 2, npc.scale, something, 0); + return false; + } + + public override bool PreNPCLoot() { return false; } - + public override void HitEffect(int hitDirection, double damage) { if (npc.life > 0) @@ -387,7 +430,7 @@ namespace CalamityMod.NPCs.Calamitas } } } - + public override bool CheckDead() { if (Main.netMode != 1) @@ -411,13 +454,13 @@ namespace CalamityMod.NPCs.Calamitas } return true; } - + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { npc.lifeMax = (int)(npc.lifeMax * 0.8f * bossLifeScale); npc.damage = (int)(npc.damage * 0.8f); } - + public override void OnHitPlayer(Player player, int damage, bool crit) { if (CalamityWorld.revenge) diff --git a/NPCs/Calamitas/CalamitasRun.cs b/NPCs/Calamitas/CalamitasRun.cs index fc7a790f13..17b2bb1c6e 100644 --- a/NPCs/Calamitas/CalamitasRun.cs +++ b/NPCs/Calamitas/CalamitasRun.cs @@ -28,7 +28,7 @@ namespace CalamityMod.NPCs.Calamitas npc.width = 120; //324 npc.height = 120; //216 npc.defense = 10; - npc.alpha = 50; + npc.alpha = 25; npc.value = 0f; npc.lifeMax = CalamityWorld.revenge ? 4400 : 3000; if (CalamityWorld.death) @@ -38,6 +38,8 @@ namespace CalamityMod.NPCs.Calamitas npc.aiStyle = -1; //new aiType = -1; //new npc.knockBackResist = 0f; + NPCID.Sets.TrailCacheLength[npc.type] = 8; + NPCID.Sets.TrailingMode[npc.type] = 1; for (int k = 0; k < npc.buffImmune.Length; k++) { npc.buffImmune[k] = true; @@ -73,7 +75,7 @@ namespace CalamityMod.NPCs.Calamitas } if (CalamityWorld.bossRushActive) { - npc.lifeMax = CalamityWorld.death ? 1900000 : 1500000; + npc.lifeMax = CalamityWorld.death ? 1000000 : 800000; } } @@ -374,7 +376,48 @@ namespace CalamityMod.NPCs.Calamitas } } - public override bool CheckActive() + public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) + { + SpriteEffects spriteEffects = SpriteEffects.None; + Microsoft.Xna.Framework.Color color24 = npc.GetAlpha(drawColor); + Microsoft.Xna.Framework.Color color25 = Lighting.GetColor((int)((double)npc.position.X + (double)npc.width * 0.5) / 16, (int)(((double)npc.position.Y + (double)npc.height * 0.5) / 16.0)); + Texture2D texture2D3 = Main.npcTexture[npc.type]; + int num156 = Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type]; + int y3 = num156 * (int)npc.frameCounter; + Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle(0, y3, texture2D3.Width, num156); + Vector2 origin2 = rectangle.Size() / 2f; + int num157 = 8; + int num158 = 2; + int num159 = 1; + float num160 = 0f; + int num161 = num159; + while (npc.ai[1] > 0f && Lighting.NotRetro && ((num158 > 0 && num161 < num157) || (num158 < 0 && num161 > num157))) + { + Microsoft.Xna.Framework.Color color26 = npc.GetAlpha(color25); + { + goto IL_6899; + } + IL_6881: + num161 += num158; + continue; + IL_6899: + float num164 = (float)(num157 - num161); + if (num158 < 0) + { + num164 = (float)(num159 - num161); + } + color26 *= num164 / ((float)NPCID.Sets.TrailCacheLength[npc.type] * 1.5f); + Vector2 value4 = (npc.oldPos[num161]); + float num165 = npc.rotation; + Main.spriteBatch.Draw(texture2D3, value4 + npc.Size / 2f - Main.screenPosition + new Vector2(0, npc.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rectangle), color26, num165 + npc.rotation * num160 * (float)(num161 - 1) * -(float)spriteEffects.HasFlag(SpriteEffects.FlipHorizontally).ToDirectionInt(), origin2, npc.scale, spriteEffects, 0f); + goto IL_6881; + } + var something = npc.direction == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; + spriteBatch.Draw(texture2D3, npc.Center - Main.screenPosition + new Vector2(0, npc.gfxOffY), npc.frame, color24, npc.rotation, npc.frame.Size() / 2, npc.scale, something, 0); + return false; + } + + public override bool CheckActive() { return canDespawn; } @@ -411,6 +454,11 @@ namespace CalamityMod.NPCs.Calamitas } if (npc.life <= 0) { + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CalamitasGores/Cataclysm"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CalamitasGores/Cataclysm2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CalamitasGores/Cataclysm3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CalamitasGores/Cataclysm4"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CalamitasGores/Cataclysm5"), 1f); npc.position.X = npc.position.X + (float)(npc.width / 2); npc.position.Y = npc.position.Y + (float)(npc.height / 2); npc.width = 100; diff --git a/NPCs/Calamitas/CalamitasRun2.cs b/NPCs/Calamitas/CalamitasRun2.cs index 3236ec23ac..0eab3f7f8c 100644 --- a/NPCs/Calamitas/CalamitasRun2.cs +++ b/NPCs/Calamitas/CalamitasRun2.cs @@ -28,7 +28,7 @@ namespace CalamityMod.NPCs.Calamitas npc.width = 120; //324 npc.height = 120; //216 npc.defense = 10; - npc.alpha = 50; + npc.alpha = 25; npc.value = 0f; npc.lifeMax = CalamityWorld.revenge ? 3675 : 2500; if (CalamityWorld.death) @@ -40,6 +40,8 @@ namespace CalamityMod.NPCs.Calamitas npc.knockBackResist = 0f; npc.noGravity = true; npc.noTileCollide = true; + NPCID.Sets.TrailCacheLength[npc.type] = 8; + NPCID.Sets.TrailingMode[npc.type] = 1; for (int k = 0; k < npc.buffImmune.Length; k++) { npc.buffImmune[k] = true; @@ -73,7 +75,7 @@ namespace CalamityMod.NPCs.Calamitas } if (CalamityWorld.bossRushActive) { - npc.lifeMax = CalamityWorld.death ? 1600000 : 1300000; + npc.lifeMax = CalamityWorld.death ? 800000 : 700000; } } @@ -374,7 +376,48 @@ namespace CalamityMod.NPCs.Calamitas } } - public override bool CheckActive() + public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) + { + SpriteEffects spriteEffects = SpriteEffects.None; + Microsoft.Xna.Framework.Color color24 = npc.GetAlpha(drawColor); + Microsoft.Xna.Framework.Color color25 = Lighting.GetColor((int)((double)npc.position.X + (double)npc.width * 0.5) / 16, (int)(((double)npc.position.Y + (double)npc.height * 0.5) / 16.0)); + Texture2D texture2D3 = Main.npcTexture[npc.type]; + int num156 = Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type]; + int y3 = num156 * (int)npc.frameCounter; + Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle(0, y3, texture2D3.Width, num156); + Vector2 origin2 = rectangle.Size() / 2f; + int num157 = 8; + int num158 = 2; + int num159 = 1; + float num160 = 0f; + int num161 = num159; + while (npc.ai[1] > 0f && Lighting.NotRetro && ((num158 > 0 && num161 < num157) || (num158 < 0 && num161 > num157))) + { + Microsoft.Xna.Framework.Color color26 = npc.GetAlpha(color25); + { + goto IL_6899; + } + IL_6881: + num161 += num158; + continue; + IL_6899: + float num164 = (float)(num157 - num161); + if (num158 < 0) + { + num164 = (float)(num159 - num161); + } + color26 *= num164 / ((float)NPCID.Sets.TrailCacheLength[npc.type] * 1.5f); + Vector2 value4 = (npc.oldPos[num161]); + float num165 = npc.rotation; + Main.spriteBatch.Draw(texture2D3, value4 + npc.Size / 2f - Main.screenPosition + new Vector2(0, npc.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rectangle), color26, num165 + npc.rotation * num160 * (float)(num161 - 1) * -(float)spriteEffects.HasFlag(SpriteEffects.FlipHorizontally).ToDirectionInt(), origin2, npc.scale, spriteEffects, 0f); + goto IL_6881; + } + var something = npc.direction == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; + spriteBatch.Draw(texture2D3, npc.Center - Main.screenPosition + new Vector2(0, npc.gfxOffY), npc.frame, color24, npc.rotation, npc.frame.Size() / 2, npc.scale, something, 0); + return false; + } + + public override bool CheckActive() { return canDespawn; } @@ -403,6 +446,11 @@ namespace CalamityMod.NPCs.Calamitas } if (npc.life <= 0) { + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CalamitasGores/Catastrophe"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CalamitasGores/Catastrophe2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CalamitasGores/Catastrophe3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CalamitasGores/Catastrophe4"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CalamitasGores/Catastrophe5"), 1f); npc.position.X = npc.position.X + (float)(npc.width / 2); npc.position.Y = npc.position.Y + (float)(npc.height / 2); npc.width = 100; diff --git a/NPCs/Calamitas/CalamitasRun3.cs b/NPCs/Calamitas/CalamitasRun3.cs index 54fcbb62b9..7b285d91ec 100644 --- a/NPCs/Calamitas/CalamitasRun3.cs +++ b/NPCs/Calamitas/CalamitasRun3.cs @@ -19,16 +19,16 @@ namespace CalamityMod.NPCs.Calamitas [AutoloadBossHead] public class CalamitasRun3 : ModNPC { - private float bossLife; - private bool halfLife = false; - private bool secondStage = false; - + private float bossLife; + private bool halfLife = false; + private bool secondStage = false; + public override void SetStaticDefaults() { DisplayName.SetDefault("Calamitas"); Main.npcFrameCount[npc.type] = 6; } - + public override void SetDefaults() { npc.damage = 80; @@ -37,43 +37,45 @@ namespace CalamityMod.NPCs.Calamitas npc.height = 120; npc.defense = 25; npc.lifeMax = CalamityWorld.revenge ? 36750 : 27500; - if (CalamityWorld.death) - { - npc.lifeMax = 60250; - } - npc.aiStyle = -1; //new - aiType = -1; //new + if (CalamityWorld.death) + { + npc.lifeMax = 60250; + } + npc.aiStyle = -1; //new + aiType = -1; //new npc.knockBackResist = 0f; npc.value = Item.buyPrice(0, 15, 0, 0); + NPCID.Sets.TrailCacheLength[npc.type] = 8; + NPCID.Sets.TrailingMode[npc.type] = 1; for (int k = 0; k < npc.buffImmune.Length; k++) { - npc.buffImmune[k] = true; - npc.buffImmune[BuffID.Ichor] = false; - npc.buffImmune[mod.BuffType("MarkedforDeath")] = false; - npc.buffImmune[BuffID.CursedInferno] = false; - npc.buffImmune[BuffID.Daybreak] = false; - npc.buffImmune[mod.BuffType("AbyssalFlames")] = false; - npc.buffImmune[mod.BuffType("ArmorCrunch")] = false; - npc.buffImmune[mod.BuffType("DemonFlames")] = false; - npc.buffImmune[mod.BuffType("GodSlayerInferno")] = false; - npc.buffImmune[mod.BuffType("HolyLight")] = false; - npc.buffImmune[mod.BuffType("Nightwither")] = false; - npc.buffImmune[mod.BuffType("Plague")] = false; - npc.buffImmune[mod.BuffType("Shred")] = false; - npc.buffImmune[mod.BuffType("WhisperingDeath")] = false; - npc.buffImmune[mod.BuffType("SilvaStun")] = false; - } + npc.buffImmune[k] = true; + npc.buffImmune[BuffID.Ichor] = false; + npc.buffImmune[mod.BuffType("MarkedforDeath")] = false; + npc.buffImmune[BuffID.CursedInferno] = false; + npc.buffImmune[BuffID.Daybreak] = false; + npc.buffImmune[mod.BuffType("AbyssalFlames")] = false; + npc.buffImmune[mod.BuffType("ArmorCrunch")] = false; + npc.buffImmune[mod.BuffType("DemonFlames")] = false; + npc.buffImmune[mod.BuffType("GodSlayerInferno")] = false; + npc.buffImmune[mod.BuffType("HolyLight")] = false; + npc.buffImmune[mod.BuffType("Nightwither")] = false; + npc.buffImmune[mod.BuffType("Plague")] = false; + npc.buffImmune[mod.BuffType("Shred")] = false; + npc.buffImmune[mod.BuffType("WhisperingDeath")] = false; + npc.buffImmune[mod.BuffType("SilvaStun")] = false; + } npc.boss = true; npc.noGravity = true; npc.noTileCollide = true; npc.HitSound = SoundID.NPCHit4; npc.DeathSound = SoundID.NPCDeath14; - Mod calamityModMusic = ModLoader.GetMod("CalamityModMusic"); - if (calamityModMusic != null) - music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/Calamitas"); - else - music = MusicID.Boss2; - bossBag = mod.ItemType("CalamitasBag"); + Mod calamityModMusic = ModLoader.GetMod("CalamityModMusic"); + if (calamityModMusic != null) + music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/Calamitas"); + else + music = MusicID.Boss2; + bossBag = mod.ItemType("CalamitasBag"); if (CalamityWorld.downedProvidence) { npc.damage = 160; @@ -81,21 +83,21 @@ namespace CalamityMod.NPCs.Calamitas npc.lifeMax = 120000; npc.value = Item.buyPrice(0, 35, 0, 0); } - if (CalamityWorld.bossRushActive) - { - npc.lifeMax = CalamityWorld.death ? 6500000 : 5900000; - } - } + if (CalamityWorld.bossRushActive) + { + npc.lifeMax = CalamityWorld.death ? 3300000 : 3000000; + } + } - public override void FindFrame(int frameHeight) - { - npc.frameCounter += 0.15f; - npc.frameCounter %= Main.npcFrameCount[npc.type]; - int frame = (int)npc.frameCounter; - npc.frame.Y = frame * frameHeight; - } + public override void FindFrame(int frameHeight) + { + npc.frameCounter += 0.15f; + npc.frameCounter %= Main.npcFrameCount[npc.type]; + int frame = (int)npc.frameCounter; + npc.frame.Y = frame * frameHeight; + } - public override void AI() + public override void AI() { bool revenge = (CalamityWorld.revenge || CalamityWorld.bossRushActive); bool expertMode = (Main.expertMode || CalamityWorld.bossRushActive); @@ -104,10 +106,10 @@ namespace CalamityMod.NPCs.Calamitas Player player = Main.player[npc.target]; if (!halfLife && npc.life <= npc.lifeMax / 2) { - if (!secondStage && Main.netMode != 1) + if (!secondStage && Main.netMode != 1) { Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 74); - for (int I = 0; I < 5; I++) + for (int I = 0; I < 5; I++) { int FireEye = NPC.NewNPC((int)(npc.Center.X + (Math.Sin(I * 72) * 150)), (int)(npc.Center.Y + (Math.Cos(I * 72) * 150)), mod.NPCType("SoulSeeker"), npc.whoAmI, 0, 0, 0, -1); NPC Eye = Main.npc[FireEye]; @@ -132,7 +134,7 @@ namespace CalamityMod.NPCs.Calamitas { bossLife = (float)npc.lifeMax; } - if (npc.life > 0) + if (npc.life > 0) { if (Main.netMode != 1) { @@ -156,27 +158,27 @@ namespace CalamityMod.NPCs.Calamitas } else { - if (revenge) - { - int num661 = Main.rand.Next(5, 9); - for (int num662 = 0; num662 < num661; num662++) - { - int x = (int)(npc.position.X + (float)Main.rand.Next(npc.width - 32)); - int y = (int)(npc.position.Y + (float)Main.rand.Next(npc.height - 32)); - int num663 = mod.NPCType("LifeSeeker"); - int num664 = NPC.NewNPC(x, y, num663, 0, 0f, 0f, 0f, 0f, 255); - Main.npc[num664].SetDefaults(num663, -1f); - Main.npc[num664].velocity.X = (float)Main.rand.Next(-15, 16) * 0.1f; - Main.npc[num664].velocity.Y = (float)Main.rand.Next(-30, 1) * 0.1f; - } - } + if (revenge) + { + int num661 = Main.rand.Next(5, 9); + for (int num662 = 0; num662 < num661; num662++) + { + int x = (int)(npc.position.X + (float)Main.rand.Next(npc.width - 32)); + int y = (int)(npc.position.Y + (float)Main.rand.Next(npc.height - 32)); + int num663 = mod.NPCType("LifeSeeker"); + int num664 = NPC.NewNPC(x, y, num663, 0, 0f, 0f, 0f, 0f, 255); + Main.npc[num664].SetDefaults(num663, -1f); + Main.npc[num664].velocity.X = (float)Main.rand.Next(-15, 16) * 0.1f; + Main.npc[num664].velocity.Y = (float)Main.rand.Next(-30, 1) * 0.1f; + } + } Projectile.NewProjectile(npc.Center.X, npc.Center.Y, 0f, 0f, mod.ProjectileType("RedSpawn"), 0, 0f, Main.myPlayer, 0f, 0f); Projectile.NewProjectile(npc.Center.X, npc.Center.Y, 0f, 0f, mod.ProjectileType("GraySpawn"), 0, 0f, Main.myPlayer, 0f, 0f); - if (CalamityWorld.death) - { - Projectile.NewProjectile(npc.Center.X, npc.Center.Y, 0f, 0f, mod.ProjectileType("RedSpawn"), 0, 0f, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(npc.Center.X, npc.Center.Y, 0f, 0f, mod.ProjectileType("GraySpawn"), 0, 0f, Main.myPlayer, 0f, 0f); - } + if (CalamityWorld.death) + { + Projectile.NewProjectile(npc.Center.X, npc.Center.Y, 0f, 0f, mod.ProjectileType("RedSpawn"), 0, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.Center.X, npc.Center.Y, 0f, 0f, mod.ProjectileType("GraySpawn"), 0, 0f, Main.myPlayer, 0f, 0f); + } string key = "Mods.CalamityMod.CalamitasBossText4"; Color messageColor = Color.Orange; if (Main.netMode == 0) @@ -191,23 +193,23 @@ namespace CalamityMod.NPCs.Calamitas return; } } - } + } bool flag100 = false; int num568 = 0; if (expertMode) { - if (NPC.AnyNPCs(mod.NPCType("CalamitasRun")) || NPC.AnyNPCs(mod.NPCType("CalamitasRun2"))) - { - flag100 = true; - num568 += 255; - } + if (NPC.AnyNPCs(mod.NPCType("CalamitasRun")) || NPC.AnyNPCs(mod.NPCType("CalamitasRun2"))) + { + flag100 = true; + num568 += 255; + } npc.defense += num568 * 50; - if (!flag100) - { - npc.defense = 30; - } - } - npc.chaseable = !flag100; + if (!flag100) + { + npc.defense = 30; + } + } + npc.chaseable = !flag100; if (npc.target < 0 || npc.target == 255 || player.dead || !player.active) { npc.TargetClosest(true); @@ -343,10 +345,10 @@ namespace CalamityMod.NPCs.Calamitas { npc.localAI[1] += 0.5f; } - if (CalamityWorld.death || CalamityWorld.bossRushActive) - { - npc.localAI[1] += 1f; - } + if (CalamityWorld.death || CalamityWorld.bossRushActive) + { + npc.localAI[1] += 1f; + } if ((double)npc.life < (double)npc.lifeMax * 0.5 || CalamityWorld.bossRushActive) { npc.localAI[1] += 1f; @@ -359,10 +361,10 @@ namespace CalamityMod.NPCs.Calamitas { npc.localAI[1] = 0f; float num828 = expertMode ? 14f : 12.5f; - if (npc.GetGlobalNPC(mod).enraged) - { - num828 += 5f; - } + if (npc.GetGlobalNPC(mod).enraged) + { + num828 += 5f; + } int num829 = expertMode ? 34 : 42; int num830 = mod.ProjectileType("BrimstoneHellfireball"); num827 = (float)Math.Sqrt((double)(num825 * num825 + num826 * num826)); @@ -435,14 +437,14 @@ namespace CalamityMod.NPCs.Calamitas { npc.localAI[1] += 0.5f; } - if (CalamityWorld.death || CalamityWorld.bossRushActive) - { - npc.localAI[1] += 0.5f; - } - if (npc.GetGlobalNPC(mod).enraged) - { - npc.localAI[1] += 1f; - } + if (CalamityWorld.death || CalamityWorld.bossRushActive) + { + npc.localAI[1] += 0.5f; + } + if (npc.GetGlobalNPC(mod).enraged) + { + npc.localAI[1] += 1f; + } if ((double)npc.life < (double)npc.lifeMax * 0.5 || CalamityWorld.bossRushActive) { npc.localAI[1] += 0.5f; @@ -483,37 +485,78 @@ namespace CalamityMod.NPCs.Calamitas } } - public override void NPCLoot() + public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) + { + SpriteEffects spriteEffects = SpriteEffects.None; + Microsoft.Xna.Framework.Color color24 = npc.GetAlpha(drawColor); + Microsoft.Xna.Framework.Color color25 = Lighting.GetColor((int)((double)npc.position.X + (double)npc.width * 0.5) / 16, (int)(((double)npc.position.Y + (double)npc.height * 0.5) / 16.0)); + Texture2D texture2D3 = Main.npcTexture[npc.type]; + int num156 = Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type]; + int y3 = num156 * (int)npc.frameCounter; + Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle(0, y3, texture2D3.Width, num156); + Vector2 origin2 = rectangle.Size() / 2f; + int num157 = 8; + int num158 = 2; + int num159 = 1; + float num160 = 0f; + int num161 = num159; + while (((num158 > 0 && num161 < num157) || (num158 < 0 && num161 > num157)) && Lighting.NotRetro) + { + Microsoft.Xna.Framework.Color color26 = npc.GetAlpha(color25); + { + goto IL_6899; + } + IL_6881: + num161 += num158; + continue; + IL_6899: + float num164 = (float)(num157 - num161); + if (num158 < 0) + { + num164 = (float)(num159 - num161); + } + color26 *= num164 / ((float)NPCID.Sets.TrailCacheLength[npc.type] * 1.5f); + Vector2 value4 = (npc.oldPos[num161]); + float num165 = npc.rotation; + Main.spriteBatch.Draw(texture2D3, value4 + npc.Size / 2f - Main.screenPosition + new Vector2(0, npc.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rectangle), color26, num165 + npc.rotation * num160 * (float)(num161 - 1) * -(float)spriteEffects.HasFlag(SpriteEffects.FlipHorizontally).ToDirectionInt(), origin2, npc.scale, spriteEffects, 0f); + goto IL_6881; + } + var something = npc.direction == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; + spriteBatch.Draw(texture2D3, npc.Center - Main.screenPosition + new Vector2(0, npc.gfxOffY), npc.frame, color24, npc.rotation, npc.frame.Size() / 2, npc.scale, something, 0); + return false; + } + + public override void NPCLoot() { if (Main.rand.Next(10) == 0) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CalamitasTrophy")); } - if (CalamityWorld.armageddon) - { - for (int i = 0; i < 10; i++) - { - npc.DropBossBags(); - } - } - if (Main.expertMode) + if (CalamityWorld.armageddon) + { + for (int i = 0; i < 5; i++) + { + npc.DropBossBags(); + } + } + if (Main.expertMode) { npc.DropBossBags(); } else { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EssenceofChaos"), Main.rand.Next(3, 6)); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EssenceofChaos"), Main.rand.Next(4, 9)); Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CalamityDust"), Main.rand.Next(9, 15)); Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BlightedLens"), Main.rand.Next(1, 3)); - if (CalamityWorld.downedProvidence) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Bloodstone"), Main.rand.Next(30, 41)); - } - if (Main.rand.Next(10) == 0) - { - npc.DropItemInstanced(npc.position, npc.Size, mod.ItemType("ChaosStone"), 1, true); - } - if (Main.rand.Next(4) == 0) + if (CalamityWorld.downedProvidence) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Bloodstone"), Main.rand.Next(30, 41)); + } + if (Main.rand.Next(10) == 0) + { + npc.DropItemInstanced(npc.position, npc.Size, mod.ItemType("ChaosStone"), 1, true); + } + if (Main.rand.Next(4) == 0) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CalamitasInferno")); } @@ -531,13 +574,13 @@ namespace CalamityMod.NPCs.Calamitas } } } - + public override void BossLoot(ref string name, ref int potionType) { name = "A Calamitas Doppelganger"; potionType = ItemID.GreaterHealingPotion; } - + public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 5; k++) @@ -546,6 +589,12 @@ namespace CalamityMod.NPCs.Calamitas } if (npc.life <= 0) { + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CalamitasGores/Calamitas"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CalamitasGores/Calamitas2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CalamitasGores/Calamitas3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CalamitasGores/Calamitas4"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CalamitasGores/Calamitas5"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CalamitasGores/Calamitas6"), 1f); npc.position.X = npc.position.X + (float)(npc.width / 2); npc.position.Y = npc.position.Y + (float)(npc.height / 2); npc.width = 100; @@ -572,13 +621,13 @@ namespace CalamityMod.NPCs.Calamitas } } } - + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { npc.damage = (int)(npc.damage * 0.8f); npc.lifeMax = (int)(npc.lifeMax * 0.8f * bossLifeScale); } - + public override void OnHitPlayer(Player player, int damage, bool crit) { if (CalamityWorld.revenge) diff --git a/NPCs/Calamitas/LifeSeeker.cs b/NPCs/Calamitas/LifeSeeker.cs index 4047893dde..5789161362 100644 --- a/NPCs/Calamitas/LifeSeeker.cs +++ b/NPCs/Calamitas/LifeSeeker.cs @@ -36,6 +36,7 @@ namespace CalamityMod.NPCs.Calamitas animationType = 2; npc.noGravity = true; npc.noTileCollide = true; + npc.canGhostHeal = false; npc.HitSound = SoundID.NPCHit4; npc.DeathSound = SoundID.NPCDeath14; npc.buffImmune[24] = true; @@ -63,6 +64,9 @@ namespace CalamityMod.NPCs.Calamitas { Dust.NewDust(npc.position, npc.width, npc.height, 235, hitDirection, -1f, 0, default(Color), 1f); } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CalamitasGores/LifeSeeker"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CalamitasGores/LifeSeeker2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CalamitasGores/LifeSeeker3"), 1f); } } } diff --git a/NPCs/Calamitas/SoulSeeker.cs b/NPCs/Calamitas/SoulSeeker.cs index b7e30e083a..cd9d02d495 100644 --- a/NPCs/Calamitas/SoulSeeker.cs +++ b/NPCs/Calamitas/SoulSeeker.cs @@ -25,6 +25,7 @@ namespace CalamityMod.NPCs.Calamitas npc.height = 40; npc.noGravity = true; npc.noTileCollide = true; + npc.canGhostHeal = false; npc.damage = 60; npc.defense = 20; npc.lifeMax = 3750; @@ -97,6 +98,10 @@ namespace CalamityMod.NPCs.Calamitas } if (npc.life <= 0) { + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CalamitasGores/SoulSlurper"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CalamitasGores/SoulSlurper2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CalamitasGores/SoulSlurper3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CalamitasGores/SoulSlurper4"), 1f); npc.position.X = npc.position.X + (float)(npc.width / 2); npc.position.Y = npc.position.Y + (float)(npc.height / 2); npc.width = 50; diff --git a/NPCs/CalamityBiomeNPCs/CultistAssassin.cs b/NPCs/CalamityBiomeNPCs/CultistAssassin.cs index 7dd91b00ab..5a01725f25 100644 --- a/NPCs/CalamityBiomeNPCs/CultistAssassin.cs +++ b/NPCs/CalamityBiomeNPCs/CultistAssassin.cs @@ -39,6 +39,8 @@ namespace CalamityMod.NPCs.CalamityBiomeNPCs npc.lifeMax = 5000; npc.value = Item.buyPrice(0, 0, 50, 0); } + banner = npc.type; + bannerItem = mod.ItemType("CultistAssassinBanner"); } public override float SpawnChance(NPCSpawnInfo spawnInfo) @@ -75,9 +77,9 @@ namespace CalamityMod.NPCs.CalamityBiomeNPCs { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Bloodstone")); } - if (Main.rand.Next(2) == 0) + if (Main.rand.Next(3) == 0) { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EssenceofChaos"), Main.rand.Next(1, 3)); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EssenceofChaos")); } } } diff --git a/NPCs/CalamityBiomeNPCs/DespairStone.cs b/NPCs/CalamityBiomeNPCs/DespairStone.cs index 02cecce850..ea85b8eb1b 100644 --- a/NPCs/CalamityBiomeNPCs/DespairStone.cs +++ b/NPCs/CalamityBiomeNPCs/DespairStone.cs @@ -40,6 +40,8 @@ namespace CalamityMod.NPCs.CalamityBiomeNPCs npc.lifeMax = 5000; npc.value = Item.buyPrice(0, 0, 50, 0); } + banner = npc.type; + bannerItem = mod.ItemType("DespairStoneBanner"); } public override void AI() @@ -348,9 +350,9 @@ namespace CalamityMod.NPCs.CalamityBiomeNPCs { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Bloodstone")); } - if (Main.hardMode && Main.rand.Next(2) == 0) + if (Main.hardMode && Main.rand.Next(3) == 0) { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EssenceofChaos"), Main.rand.Next(1, 3)); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EssenceofChaos")); } } diff --git a/NPCs/CalamityBiomeNPCs/Scryllar.cs b/NPCs/CalamityBiomeNPCs/Scryllar.cs index 6beae07860..5c13a46d65 100644 --- a/NPCs/CalamityBiomeNPCs/Scryllar.cs +++ b/NPCs/CalamityBiomeNPCs/Scryllar.cs @@ -42,6 +42,8 @@ namespace CalamityMod.NPCs.CalamityBiomeNPCs npc.lifeMax = 4000; npc.value = Item.buyPrice(0, 0, 50, 0); } + banner = npc.type; + bannerItem = mod.ItemType("ScryllarBanner"); } public override void AI() @@ -266,9 +268,9 @@ namespace CalamityMod.NPCs.CalamityBiomeNPCs { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Bloodstone")); } - if (Main.hardMode && Main.rand.Next(2) == 0) + if (Main.hardMode && Main.rand.Next(3) == 0) { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EssenceofChaos"), Main.rand.Next(1, 3)); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EssenceofChaos")); } } diff --git a/NPCs/CalamityBiomeNPCs/ScryllarRage.cs b/NPCs/CalamityBiomeNPCs/ScryllarRage.cs index e91a90499e..1d668fe362 100644 --- a/NPCs/CalamityBiomeNPCs/ScryllarRage.cs +++ b/NPCs/CalamityBiomeNPCs/ScryllarRage.cs @@ -42,6 +42,8 @@ namespace CalamityMod.NPCs.CalamityBiomeNPCs npc.lifeMax = 2300; npc.value = Item.buyPrice(0, 0, 50, 0); } + banner = mod.NPCType("Scryllar"); + bannerItem = mod.ItemType("ScryllarBanner"); } public override void AI() @@ -266,9 +268,9 @@ namespace CalamityMod.NPCs.CalamityBiomeNPCs { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Bloodstone")); } - if (Main.hardMode && Main.rand.Next(2) == 0) + if (Main.hardMode && Main.rand.Next(3) == 0) { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EssenceofChaos"), Main.rand.Next(1, 3)); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EssenceofChaos")); } } diff --git a/NPCs/CalamityBiomeNPCs/SoulSlurper.cs b/NPCs/CalamityBiomeNPCs/SoulSlurper.cs index 4fc980c3bf..c8c9497388 100644 --- a/NPCs/CalamityBiomeNPCs/SoulSlurper.cs +++ b/NPCs/CalamityBiomeNPCs/SoulSlurper.cs @@ -41,6 +41,8 @@ namespace CalamityMod.NPCs.CalamityBiomeNPCs npc.lifeMax = 3000; npc.value = Item.buyPrice(0, 0, 50, 0); } + banner = npc.type; + bannerItem = mod.ItemType("SoulSlurperBanner"); } public override float SpawnChance(NPCSpawnInfo spawnInfo) @@ -227,9 +229,9 @@ namespace CalamityMod.NPCs.CalamityBiomeNPCs { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Bloodstone")); } - if (Main.hardMode && Main.rand.Next(2) == 0) + if (Main.hardMode && Main.rand.Next(3) == 0) { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EssenceofChaos"), Main.rand.Next(1, 3)); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EssenceofChaos")); } } @@ -241,6 +243,10 @@ namespace CalamityMod.NPCs.CalamityBiomeNPCs } if (npc.life <= 0) { + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CalamitasGores/SoulSlurper"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CalamitasGores/SoulSlurper2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CalamitasGores/SoulSlurper3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CalamitasGores/SoulSlurper4"), 1f); npc.position.X = npc.position.X + (float)(npc.width / 2); npc.position.Y = npc.position.Y + (float)(npc.height / 2); npc.width = 50; diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index b349b9480a..5fefcb4be1 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -15,238 +15,274 @@ using Terraria.ID; using Terraria.World.Generation; using Terraria.GameContent.Generation; using CalamityMod.Tiles; +using CalamityMod.Projectiles; using CalamityMod; namespace CalamityMod.NPCs { public class CalamityGlobalNPC : GlobalNPC { - #region InstancePerEntity - public override bool InstancePerEntity + #region InstancePerEntity + public override bool InstancePerEntity { get { return true; } } - #endregion + #endregion - #region InstanceVars - public static bool DraedonMayhem = false; + #region InstanceVars + private float protection = 0f; - public float protection = 0f; - - public float defProtection = 0f; + private float defProtection = 0f; - public bool setNewName = true; + private bool setNewName = true; - public bool weaknessCold = false; + private const int maxAIMod = 4; - public bool weaknessFire = false; + private float[] newAI = new float[maxAIMod]; - public bool weaknessPoison = false; + private int CultProjectiles = 2; - public bool weaknessStab = false; + private const float CultAngleSpread = 170; - public bool weaknessSlash = false; + private int CultCountdown = 0; - public bool weaknessMagic = false; + public bool dFlames = false; - public bool weaknessDark = false; - - public bool weaknessWater = false; - - public bool weaknessHoly = false; - - public bool weaknessUnholy = false; - - public bool dFlames = false; - public bool marked = false; - + public bool irradiated = false; public bool bFlames = false; - + public bool hFlames = false; - + public bool pFlames = false; - + public bool gState = false; - + public bool aCrunch = false; - + public bool tSad = false; - + public bool pShred = false; - + public bool cDepth = false; - + public bool gsInferno = false; - + public bool aFlames = false; - + public bool eFreeze = false; - + public bool wDeath = false; - + public bool nightwither = false; - public bool silvaStun = false; + public bool silvaStun = false; - public bool enraged = false; + public bool enraged = false; + + public bool yellowCandle = false; + + public bool pearlAura = false; + + public bool shellfishVore = false; + + public bool clamDebuff = false; - public static int maxAIMod = 4; - - public float[] newAI = new float[maxAIMod]; - - public int CultProjectiles = 2; - - public const float CultAngleSpread = 170; - - public int CultCountdown = 0; - public static int holyBoss = -1; - + public static int doughnutBoss = -1; - + public static int voidBoss = -1; - + public static int energyFlame = -1; - + public static int hiveMind = -1; - + public static int hiveMind2 = -1; - + public static int scavenger = -1; - public static int bobbitWormBottom = -1; + public static int bobbitWormBottom = -1; - public static int DoGHead = -1; + public static int DoGHead = -1; + + public static int SCal = -1; - public static int SCal = -1; - public static int ghostBoss = -1; - public static int ghostBoss2 = -1; + public static int ghostBoss2 = -1; - public static int laserEye = -1; + public static int laserEye = -1; - public static int fireEye = -1; + public static int fireEye = -1; - public static int lordeBoss = -1; + public static int lordeBoss = -1; - public static int brimstoneElemental = -1; + public static int brimstoneElemental = -1; - public int bloodMoonKillCount = 0; - #endregion + public static bool DraedonMayhem = false; + #endregion - #region ResetEffects - public override void ResetEffects(NPC npc) + #region ResetEffects + public override void ResetEffects(NPC npc) { - dFlames = false; + dFlames = false; marked = false; irradiated = false; - bFlames = false; - hFlames = false; - pFlames = false; - gState = false; - aCrunch = false; - tSad = false; - pShred = false; - cDepth = false; - gsInferno = false; - aFlames = false; - eFreeze = false; - wDeath = false; - nightwither = false; - silvaStun = false; - enraged = false; - } - #endregion + bFlames = false; + hFlames = false; + pFlames = false; + gState = false; + aCrunch = false; + tSad = false; + pShred = false; + cDepth = false; + gsInferno = false; + aFlames = false; + eFreeze = false; + wDeath = false; + nightwither = false; + silvaStun = false; + enraged = false; + yellowCandle = false; + pearlAura = false; + shellfishVore = false; + clamDebuff = false; + } + #endregion - #region LifeRegen - public override void UpdateLifeRegen(NPC npc, ref int damage) + #region LifeRegen + public override void UpdateLifeRegen(NPC npc, ref int damage) { bool hardMode = Main.hardMode; int npcDefense = npc.defense; - int x = Main.maxTilesX; - int y = Main.maxTilesY; - int genLimit = x / 2; - int abyssChasmSteps = y / 4; - int abyssChasmY = (y - abyssChasmSteps) + 100; - int abyssChasmX = (CalamityWorld.abyssSide ? genLimit - (genLimit - 135) : genLimit + (genLimit - 135)); - bool abyssPosX = false; - bool abyssPosY = ((double)(npc.position.Y / 16f) <= abyssChasmY); - if (CalamityWorld.abyssSide) - { - if ((double)(npc.position.X / 16f) < abyssChasmX + 80) - { - abyssPosX = true; - } - } - else - { - if ((double)(npc.position.X / 16f) > abyssChasmX - 80) - { - abyssPosX = true; - } - } - bool hurtByAbyss = (npc.wet && npc.damage > 0 && !npc.boss && !npc.friendly && !npc.dontTakeDamage && - ((((double)(npc.position.Y / 16f) > (Main.rockLayer - (double)Main.maxTilesY * 0.05)) && - abyssPosY && abyssPosX) || CalamityWorld.abyssTiles > 200) && - !npc.buffImmune[mod.BuffType("CrushDepth")]); - if (hurtByAbyss) - { - npc.AddBuff(mod.BuffType("CrushDepth"), 2); - if (npc.DeathSound != null) - { - npc.DeathSound = null; - } - if (npc.HitSound != null) - { - npc.HitSound = null; - } - } - bool hurtByPiss = (npc.wet && npc.damage > 0 && !npc.boss && !npc.friendly && !npc.dontTakeDamage && CalamityWorld.sulphurTiles > 30 && - !npc.buffImmune[BuffID.Poisoned] && !npc.buffImmune[mod.BuffType("CrushDepth")]); - if (hurtByPiss) - { - npc.AddBuff(BuffID.Poisoned, 2); - } - if (Main.raining && npc.damage > 0 && !npc.boss && - !npc.friendly && !npc.dontTakeDamage && CalamityWorld.sulphurTiles > 30 && - !npc.buffImmune[BuffID.Poisoned] && !npc.buffImmune[mod.BuffType("CrushDepth")]) - { - npc.AddBuff(mod.BuffType("Irradiated"), 2); - } - if (npc.venom) - { - if (npc.lifeRegen > 0) - { - npc.lifeRegen = 0; - } - int num7 = 0; - int num8 = 5; - for (int j = 0; j < 1000; j++) - { - if (Main.projectile[j].active && - (Main.projectile[j].type == mod.ProjectileType("Lionfish") || Main.projectile[j].type == mod.ProjectileType("SulphuricAcidCannon2")) && - Main.projectile[j].ai[0] == 1f && Main.projectile[j].ai[1] == (float)npc.whoAmI) - { - num7++; - } - } - if (num7 > 0) - { - npc.lifeRegen -= num7 * 50; - if (damage < num7 * 50 / num8) - { - damage = num7 * 50 / num8; - } - } - } - if (irradiated) + int x = Main.maxTilesX; + int y = Main.maxTilesY; + int genLimit = x / 2; + int abyssChasmY = y - 250; + int abyssChasmX = (CalamityWorld.abyssSide ? genLimit - (genLimit - 135) : genLimit + (genLimit - 135)); + bool abyssPosX = false; + bool abyssPosY = ((double)(npc.position.Y / 16f) <= abyssChasmY); + if (CalamityWorld.abyssSide) + { + if ((double)(npc.position.X / 16f) < abyssChasmX + 80) + { + abyssPosX = true; + } + } + else + { + if ((double)(npc.position.X / 16f) > abyssChasmX - 80) + { + abyssPosX = true; + } + } + bool hurtByAbyss = (npc.wet && npc.damage > 0 && !npc.boss && !npc.friendly && !npc.dontTakeDamage && + ((((double)(npc.position.Y / 16f) > (Main.rockLayer - (double)Main.maxTilesY * 0.05)) && + abyssPosY && abyssPosX) || CalamityWorld.abyssTiles > 200) && + !npc.buffImmune[mod.BuffType("CrushDepth")]); + if (hurtByAbyss) + { + npc.AddBuff(mod.BuffType("CrushDepth"), 2); + if (npc.DeathSound != null) + { + npc.DeathSound = null; + } + if (npc.HitSound != null) + { + npc.HitSound = null; + } + } + bool hurtByPiss = (npc.wet && npc.damage > 0 && !npc.boss && !npc.friendly && !npc.dontTakeDamage && CalamityWorld.sulphurTiles > 30 && + !npc.buffImmune[BuffID.Poisoned] && !npc.buffImmune[mod.BuffType("CrushDepth")]); + if (hurtByPiss) + { + npc.AddBuff(BuffID.Poisoned, 2); + } + if (Main.raining && npc.damage > 0 && !npc.boss && + !npc.friendly && !npc.dontTakeDamage && CalamityWorld.sulphurTiles > 30 && + !npc.buffImmune[BuffID.Poisoned] && !npc.buffImmune[mod.BuffType("CrushDepth")]) + { + npc.AddBuff(mod.BuffType("Irradiated"), 2); + } + if (npc.venom) + { + if (npc.lifeRegen > 0) + { + npc.lifeRegen = 0; + } + int num7 = 0; + int num8 = 5; + for (int j = 0; j < 1000; j++) + { + if (Main.projectile[j].active && + (Main.projectile[j].type == mod.ProjectileType("Lionfish") || Main.projectile[j].type == mod.ProjectileType("SulphuricAcidCannon2")) && + Main.projectile[j].ai[0] == 1f && Main.projectile[j].ai[1] == (float)npc.whoAmI) + { + num7++; + } + } + if (num7 > 0) + { + npc.lifeRegen -= num7 * 50; + if (damage < num7 * 50 / num8) + { + damage = num7 * 50 / num8; + } + } + } + if (shellfishVore) + { + if (npc.lifeRegen > 0) + { + npc.lifeRegen = 0; + } + int amount = 0; + for (int j = 0; j < 1000; j++) + { + if (Main.projectile[j].active && + (Main.projectile[j].type == mod.ProjectileType("Shellfish")) && + Main.projectile[j].ai[0] == 1f && Main.projectile[j].ai[1] == (float)npc.whoAmI && + amount < 5) + { + amount++; + } + } + npc.lifeRegen -= amount * 500; + if (damage < amount * 50) + { + damage = amount * 50; + } + } + if (clamDebuff) + { + if (npc.lifeRegen > 0) + { + npc.lifeRegen = 0; + } + int amount = 0; + for (int j = 0; j < 1000; j++) + { + if (Main.projectile[j].active && + (Main.projectile[j].type == mod.ProjectileType("SnapClamProj")) && + Main.projectile[j].ai[0] == 1f && Main.projectile[j].ai[1] == (float)npc.whoAmI && + amount < 2) + { + amount++; + } + } + npc.lifeRegen -= amount * 25; + if (damage < amount * 5) + { + damage = amount * 5; + } + } + if (irradiated) { if (npc.lifeRegen > 0) { @@ -265,10 +301,10 @@ namespace CalamityMod.NPCs npcDefense = 0; } int depthDamage = hardMode ? 80 : 12; - if (hurtByAbyss) - { - depthDamage = 300; - } + if (hurtByAbyss) + { + depthDamage = 300; + } int calcDepthDamage = depthDamage - npcDefense; if (calcDepthDamage < 0) { @@ -360,21 +396,21 @@ namespace CalamityMod.NPCs if (gState) { npc.velocity.X = 0f; - npc.velocity.Y = npc.velocity.Y + 0.05f; - if (npc.velocity.Y > 15f) - { - npc.velocity.Y = 15f; - } + npc.velocity.Y = npc.velocity.Y + 0.05f; + if (npc.velocity.Y > 15f) + { + npc.velocity.Y = 15f; + } } if (eFreeze && !CalamityWorld.bossRushActive) { - npc.velocity.X = 0f; - npc.velocity.Y = npc.velocity.Y + 0.1f; - if (npc.velocity.Y > 15f) - { - npc.velocity.Y = 15f; - } - } + npc.velocity.X = 0f; + npc.velocity.Y = npc.velocity.Y + 0.1f; + if (npc.velocity.Y > 15f) + { + npc.velocity.Y = 15f; + } + } if (tSad) { npc.velocity.Y /= 2; @@ -392,873 +428,935 @@ namespace CalamityMod.NPCs damage = 40; } } - if (dFlames) - { - if (npc.lifeRegen > 0) - { - npc.lifeRegen = 0; - } - npc.lifeRegen -= 2500; - if (damage < 500) - { - damage = 500; - } - } - } - #endregion + if (dFlames) + { + if (npc.lifeRegen > 0) + { + npc.lifeRegen = 0; + } + npc.lifeRegen -= 2500; + if (damage < 500) + { + damage = 500; + } + } + } + #endregion - #region SetDefaults - public override void SetDefaults(NPC npc) - { - for (int m = 0; m < maxAIMod; m++) - { - this.newAI[m] = 0f; - } - if (npc.boss && CalamityWorld.revenge) - { - if (npc.type != mod.NPCType("HiveMindP2") && npc.type != mod.NPCType("Leviathan") && npc.type != mod.NPCType("StormWeaverHeadNaked") && - npc.type != mod.NPCType("StormWeaverBodyNaked") && npc.type != mod.NPCType("StormWeaverTailNaked") && - npc.type != mod.NPCType("DevourerofGodsHeadS") && npc.type != mod.NPCType("DevourerofGodsBodyS") && - npc.type != mod.NPCType("DevourerofGodsTailS")) - { - if (Main.netMode != 2) - { - if (!Main.player[Main.myPlayer].dead && Main.player[Main.myPlayer].active) - { - Main.player[Main.myPlayer].GetModPlayer(mod).adrenaline = 0; - } - } - } - } - if (CalamityMod.enemyImmunityList.Contains(npc.type) || CalamityWorld.bossRushActive) - { - npc.buffImmune[mod.BuffType("GlacialState")] = true; - npc.buffImmune[mod.BuffType("TemporalSadness")] = true; - } - if (npc.type == NPCID.TheDestroyer || - npc.type == NPCID.TheDestroyerBody || - npc.type == NPCID.TheDestroyerTail) - { - for (int k = 0; k < npc.buffImmune.Length; k++) - { - npc.buffImmune[k] = true; - } - } - if (Main.hardMode && !CalamityWorld.spawnedHardBoss && !npc.boss && !npc.friendly && !npc.dontTakeDamage && !npc.buffImmune[mod.BuffType("CrushDepth")]) - { - if (!CalamityMod.hardModeNerfExceptionList.Contains(npc.type) && npc.lifeMax > 5 && npc.damage > 5) - { - npc.lifeMax = (int)((double)npc.lifeMax * 0.75); - npc.damage = (int)((double)npc.damage * 0.75); - } - } - if (CalamityWorld.defiled) - { - npc.value = (float)((int)((double)npc.value * 1.5)); - } - if (CalamityWorld.bossRushActive) - { - switch (npc.type) - { - case NPCID.QueenBee: //Tier 1 - npc.lifeMax = 840000; - break; - case NPCID.BrainofCthulhu: - npc.lifeMax = 400000; - break; - case NPCID.Creeper: - npc.lifeMax = 40000; - break; - case NPCID.KingSlime: - npc.lifeMax = 1000000; - break; - case NPCID.BlueSlime: - npc.lifeMax = 24000; - break; - case NPCID.SlimeSpiked: - npc.lifeMax = 48000; - break; - case NPCID.EyeofCthulhu: - npc.lifeMax = 1200000; - break; - case NPCID.ServantofCthulhu: - npc.lifeMax = 120000; - break; - case NPCID.SkeletronPrime: - npc.lifeMax = 1560000; - break; - case NPCID.PrimeCannon: - npc.lifeMax = 700000; - break; - case NPCID.PrimeVice: - npc.lifeMax = 880000; - break; - case NPCID.PrimeSaw: - npc.lifeMax = 900000; - break; - case NPCID.PrimeLaser: - npc.lifeMax = 560000; - break; - case NPCID.Golem: - npc.lifeMax = 900000; - break; - case NPCID.GolemHead: - npc.lifeMax = 600000; - break; - case NPCID.GolemFistLeft: - npc.lifeMax = 500000; - break; - case NPCID.GolemFistRight: - npc.lifeMax = 500000; - break; - case NPCID.EaterofWorldsHead: - npc.lifeMax = 40000; - break; - case NPCID.EaterofWorldsBody: - npc.lifeMax = 60000; - break; - case NPCID.EaterofWorldsTail: - npc.lifeMax = 80000; - break; - case NPCID.TheDestroyer: //Tier 2 - npc.lifeMax = 5000000; - break; - case NPCID.TheDestroyerBody: - npc.lifeMax = 5000000; - break; - case NPCID.TheDestroyerTail: - npc.lifeMax = 5000000; - break; - case NPCID.Probe: - npc.lifeMax = 100000; - break; - case NPCID.Spazmatism: - npc.lifeMax = 1900000; - break; - case NPCID.Retinazer: - npc.lifeMax = 1400000; - break; - case NPCID.WallofFlesh: - npc.lifeMax = 4700000; - break; - case NPCID.WallofFleshEye: - npc.lifeMax = 4700000; - break; - case NPCID.SkeletronHead: - npc.lifeMax = 2500000; - break; - case NPCID.SkeletronHand: - npc.lifeMax = 1000000; - break; - case NPCID.CultistBoss: //Tier 3 - npc.lifeMax = 2200000; - break; - case NPCID.CultistDragonHead: - npc.lifeMax = 800000; - break; - case NPCID.CultistDragonBody1: - npc.lifeMax = 800000; - break; - case NPCID.CultistDragonBody2: - npc.lifeMax = 800000; - break; - case NPCID.CultistDragonBody3: - npc.lifeMax = 800000; - break; - case NPCID.CultistDragonBody4: - npc.lifeMax = 800000; - break; - case NPCID.CultistDragonTail: - npc.lifeMax = 800000; - break; - case NPCID.AncientCultistSquidhead: - npc.lifeMax = 600000; - break; - case NPCID.Plantera: - npc.lifeMax = 5200000; - break; - case NPCID.PlanterasTentacle: - npc.lifeMax = 180000; - break; - case NPCID.DukeFishron: //Tier 4 - npc.lifeMax = 5000000; - break; - case NPCID.MoonLordCore: - npc.lifeMax = 2800000; - break; - case NPCID.MoonLordHand: - npc.lifeMax = 900000; - break; - case NPCID.MoonLordHead: - npc.lifeMax = 1200000; - break; - case NPCID.MoonLordFreeEye: - npc.lifeMax = 1500; - break; - } - } - if (npc.type == NPCID.CultistBoss) - { - if (CalamityWorld.death) - { - npc.lifeMax = (int)((double)npc.lifeMax * 2.25); - } - else - { - npc.lifeMax = (int)((double)npc.lifeMax * (CalamityWorld.revenge ? 1.55 : 1.15)); - } - npc.npcSlots = 20f; - } - if (DraedonMayhem) - { - if (npc.type == NPCID.TheDestroyer || npc.type == NPCID.TheDestroyerBody || npc.type == NPCID.TheDestroyerTail) - { - if (CalamityWorld.death) - { - npc.lifeMax = (int)((double)npc.lifeMax * 2.7); - npc.scale *= 1.25f; - } - else - { - npc.lifeMax = (int)((double)npc.lifeMax * 1.8); - npc.scale *= 1.2f; - } - npc.npcSlots = 10f; - } - if (npc.type == NPCID.Probe) - { - if (CalamityWorld.death) - { - npc.lifeMax = (int)((double)npc.lifeMax * 2.7); - npc.scale *= 1.25f; - } - else - { - npc.lifeMax = (int)((double)npc.lifeMax * 1.8); - npc.scale *= 1.2f; - } - } - if (npc.type == NPCID.SkeletronPrime || npc.type == NPCID.PrimeVice || npc.type == NPCID.PrimeCannon || npc.type == NPCID.PrimeSaw || npc.type == NPCID.PrimeLaser) - { - if (npc.type == NPCID.SkeletronPrime) - { - npc.npcSlots = 12f; - } - if (CalamityWorld.death) - { - if (npc.type == NPCID.PrimeLaser) - { - npc.lifeMax = (int)((double)npc.lifeMax * 1.5); - } - else - { - npc.lifeMax = (int)((double)npc.lifeMax * 2.9); - } - } - else - { - npc.lifeMax = (int)((double)npc.lifeMax * 1.6); - } - } - if (npc.type == NPCID.Retinazer) - { - if (CalamityWorld.death) - { - npc.lifeMax = (int)((double)npc.lifeMax * 3.0); - } - else - { - npc.lifeMax = (int)((double)npc.lifeMax * 1.8); - } - npc.npcSlots = 10f; - } - if (npc.type == NPCID.Spazmatism) - { - if (CalamityWorld.death) - { - npc.lifeMax = (int)((double)npc.lifeMax * 3.0); - } - else - { - npc.lifeMax = (int)((double)npc.lifeMax * 1.8); - } - npc.npcSlots = 10f; - } - } - if (CalamityWorld.revenge) - { - npc.value = (float)((int)((double)npc.value * 1.5)); - if (npc.type == NPCID.MoonLordFreeEye) - { - npc.lifeMax = (int)((double)npc.lifeMax * 150.0); - } - if (npc.type == NPCID.Mothron && CalamityWorld.buffedEclipse) - { - npc.scale = 1.25f; - } - if (npc.type == NPCID.MoonLordCore) //final boss in hardmode, gets a big boost in stats - { - if (CalamityWorld.death) - { - npc.lifeMax = (int)((double)npc.lifeMax * 2.4); //140% boost - } - else - { - npc.lifeMax = (int)((double)npc.lifeMax * 1.9); //90% boost - } - npc.npcSlots = 12f; - } - if (npc.type == NPCID.MoonLordHand || npc.type == NPCID.MoonLordHead) - { - if (CalamityWorld.death) - { - npc.lifeMax = (int)((double)npc.lifeMax * 1.4); //40% boost - } - else - { - npc.lifeMax = (int)((double)npc.lifeMax * 1.2); //20% boost - } - npc.npcSlots = 12f; - } - if (npc.type >= 454 && npc.type <= 459) - { - if (CalamityWorld.death) - { - npc.lifeMax = (int)((double)npc.lifeMax * 10.0); - } - else - { - npc.lifeMax = (int)((double)npc.lifeMax * 5.0); - } - } - if (npc.type == NPCID.DukeFishron) - { - if (CalamityWorld.death) - { - npc.lifeMax = (int)((double)npc.lifeMax * 3.525); //252.5% boost - } - else - { - npc.lifeMax = (int)((double)npc.lifeMax * 1.85); //85% boost - } - npc.npcSlots = 20f; - } - if (npc.type == NPCID.Sharkron || npc.type == NPCID.Sharkron2) - { - npc.lifeMax = (int)((double)npc.lifeMax * 30.0); - } - if (npc.type == NPCID.Golem) - { - if (CalamityWorld.death) - { - npc.lifeMax = (int)((double)npc.lifeMax * 8.5); - } - else - { - npc.lifeMax = (int)((double)npc.lifeMax * 3.5); - } - npc.npcSlots = 64f; - } - if (npc.type == NPCID.Plantera) - { - if (CalamityWorld.death) - { - npc.lifeMax = (int)((double)npc.lifeMax * 2.681); //168.1% boost - } - else - { - npc.lifeMax = (int)((double)npc.lifeMax * 1.65); //65% boost - } - npc.npcSlots = 32f; - } - if (npc.type == NPCID.PlanterasTentacle) - { - npc.lifeMax = (int)((double)npc.lifeMax * 1.25); - } - if (!DraedonMayhem) - { - if (npc.type == NPCID.TheDestroyer || npc.type == NPCID.TheDestroyerBody || npc.type == NPCID.TheDestroyerTail) - { - if (CalamityWorld.death) - { - npc.lifeMax = (int)((double)npc.lifeMax * 1.6); - npc.scale *= 1.2f; - } - else - { - npc.lifeMax = (int)((double)npc.lifeMax * 1.25); - } - npc.npcSlots = 10f; - } - if (npc.type == NPCID.Probe) - { - if (CalamityWorld.death) - { - npc.lifeMax = (int)((double)npc.lifeMax * 1.9); - npc.scale *= 1.2f; - } - } - if (npc.type == NPCID.SkeletronPrime || npc.type == NPCID.PrimeVice || npc.type == NPCID.PrimeCannon || npc.type == NPCID.PrimeSaw || npc.type == NPCID.PrimeLaser) - { - if (npc.type == NPCID.SkeletronPrime) - { - npc.npcSlots = 12f; - } - if (CalamityWorld.death) - { - if (npc.type == NPCID.PrimeLaser) - { - npc.lifeMax = (int)((double)npc.lifeMax * 0.15); - } - else - { - npc.lifeMax = (int)((double)npc.lifeMax * 2.15); - } - } - else - { - npc.lifeMax = (int)((double)npc.lifeMax * 1.5); - } - } - if (npc.type == NPCID.Retinazer) - { - if (CalamityWorld.death) - { - npc.lifeMax = (int)((double)npc.lifeMax * 1.7); - } - else - { - npc.lifeMax = (int)((double)npc.lifeMax * 1.45); - } - npc.npcSlots = 10f; - } - if (npc.type == NPCID.Spazmatism) - { - if (CalamityWorld.death) - { - npc.lifeMax = (int)((double)npc.lifeMax * 1.8); - } - else - { - npc.lifeMax = (int)((double)npc.lifeMax * 1.55); - } - npc.npcSlots = 10f; - } - } - if (npc.type == NPCID.WallofFlesh || npc.type == NPCID.WallofFleshEye) //final boss prehm, gets a big boost in stats - { - if (npc.type == NPCID.WallofFlesh) - { - npc.npcSlots = 20f; - } - if (CalamityWorld.death) - { - npc.lifeMax = (int)((double)npc.lifeMax * 2.3); - } - else - { - npc.lifeMax = (int)((double)npc.lifeMax * 1.75); - } - } - if (npc.type == NPCID.TheHungryII) - { - if (CalamityWorld.death) - { - npc.noTileCollide = true; - npc.lifeMax = (int)((double)npc.lifeMax * 4.5); - } - else - { - npc.lifeMax = (int)((double)npc.lifeMax * 2.5); - } - } - if (npc.type == NPCID.LeechHead || npc.type == NPCID.LeechBody || npc.type == NPCID.LeechTail) - { - if (CalamityWorld.death) - { - npc.lifeMax = (int)((double)npc.lifeMax * 4.5); - } - else - { - npc.lifeMax = (int)((double)npc.lifeMax * 3.1); - } - } - if (npc.type == NPCID.SkeletronHead) - { - if (CalamityWorld.death) - { - npc.lifeMax = (int)((double)npc.lifeMax * 1.4); - } - else - { - npc.lifeMax = (int)((double)npc.lifeMax * 1.25); - } - npc.npcSlots = 12f; - } - if (npc.type == NPCID.SkeletronHand) - { - if (CalamityWorld.death) - { - npc.lifeMax = (int)((double)npc.lifeMax * 1.4); - } - else - { - npc.lifeMax = (int)((double)npc.lifeMax * 1.3); - } - } - if (npc.type == NPCID.QueenBee) - { - if (CalamityWorld.death) - { - npc.lifeMax = (int)((double)npc.lifeMax * 1.65); - } - else - { - npc.lifeMax = (int)((double)npc.lifeMax * 1.15); - } - npc.npcSlots = 14f; - } - if (npc.type == NPCID.BrainofCthulhu) - { - if (CalamityWorld.death) - { - npc.lifeMax = (int)((double)npc.lifeMax * 1.9); - } - else - { - npc.lifeMax = (int)((double)npc.lifeMax * 1.4); - } - npc.npcSlots = 12f; - } - if (npc.type == NPCID.EaterofWorldsHead || npc.type == NPCID.EaterofWorldsBody || npc.type == NPCID.EaterofWorldsTail) - { - if (npc.type == NPCID.EaterofWorldsHead) - { - npc.npcSlots = 10f; - if (CalamityWorld.death) - { - npc.reflectingProjectiles = true; - } - } - if (CalamityWorld.death) - { - npc.lifeMax = (int)((double)npc.lifeMax * 1.4); //40% boost - } - else - { - npc.lifeMax = (int)((double)npc.lifeMax * 1.3); //30% boost - } - } - if (npc.type == NPCID.EyeofCthulhu) - { - if (CalamityWorld.death) - { - npc.lifeMax = (int)((double)npc.lifeMax * 2.3); //130% boost - } - else - { - npc.lifeMax = (int)((double)npc.lifeMax * 1.25); //25% boost - } - npc.npcSlots = 10f; - } - if (npc.type == NPCID.KingSlime) - { - if (CalamityWorld.death) - { - npc.lifeMax = (int)((double)npc.lifeMax * 1.85); //85% boost - } - } - if (npc.type == mod.NPCType("Cnidrion") || npc.type == mod.NPCType("DesertScourgeBody") || npc.type == mod.NPCType("ColossalSquid") || - npc.type == mod.NPCType("Siren") || npc.type == mod.NPCType("ThiccWaifu") || npc.type == mod.NPCType("ProfanedGuardianBoss3") || - npc.type == mod.NPCType("ScornEater") || npc.type == mod.NPCType("AquaticScourgeBody") || npc.type == mod.NPCType("AquaticScourgeBodyAlt") || - npc.type == mod.NPCType("Mauler")) - { - this.protection = 0.05f; - } - else if (npc.type == mod.NPCType("AstrumDeusBody") || npc.type == mod.NPCType("SoulSeeker") || npc.type == mod.NPCType("DesertScourgeTail") || - npc.type == mod.NPCType("Horse") || npc.type == mod.NPCType("ProfanedEnergyBody") || npc.type == mod.NPCType("ScavengerClawLeft") || - npc.type == mod.NPCType("ScavengerClawRight") || npc.type == mod.NPCType("ScavengerHead") || npc.type == mod.NPCType("MantisShrimp") || - npc.type == mod.NPCType("PhantomDebris") || npc.type == mod.NPCType("Astrageldon") || npc.type == mod.NPCType("AstrumDeusHead") || - npc.type == mod.NPCType("AquaticScourgeHead") || npc.type == mod.NPCType("Cryon") || npc.type == mod.NPCType("Cryogen")) - { - this.protection = 0.1f; - } - else if (npc.type == mod.NPCType("ArmoredDiggerHead") || npc.type == mod.NPCType("AstralProbe") || npc.type == mod.NPCType("Calamitas") || - npc.type == mod.NPCType("CalamitasRun") || npc.type == mod.NPCType("CalamitasRun2") || npc.type == mod.NPCType("CalamitasRun3") || - npc.type == mod.NPCType("SoulSlurper") || npc.type == mod.NPCType("ProvSpawnHealer") || npc.type == mod.NPCType("Gnasher") || - npc.type == mod.NPCType("ScavengerLegLeft") || npc.type == mod.NPCType("ScavengerLegRight") || npc.type == mod.NPCType("ShockstormShuttle") || - npc.type == mod.NPCType("Reaper") || npc.type == mod.NPCType("OverloadedSoldier") || npc.type == mod.NPCType("AquaticScourgeTail") || - npc.type == mod.NPCType("EidolonWyrmHead")) - { - this.protection = 0.15f; - } - else if (npc.type == mod.NPCType("AstrumDeusProbe3") || npc.type == mod.NPCType("PlaguebringerShade")) - { - this.protection = 0.2f; - } - else if (npc.type == mod.NPCType("PlaguebringerGoliath") || npc.type == mod.NPCType("ProfanedGuardianBoss2") || - npc.type == mod.NPCType("SandTortoise") || npc.type == mod.NPCType("StasisProbe") || - npc.type == mod.NPCType("BobbitWormHead") || npc.type == mod.NPCType("GreatSandShark")) - { - this.protection = 0.25f; - } - else if (npc.type == mod.NPCType("ProvSpawnOffense")) - { - this.protection = 0.3f; - } - else if (npc.type == mod.NPCType("ArmoredDiggerBody") || npc.type == mod.NPCType("AstrumDeusTail") || npc.type == mod.NPCType("DespairStone") || - npc.type == mod.NPCType("SoulSeekerSupreme") || npc.type == mod.NPCType("Leviathan")) - { - this.protection = 0.35f; - } - else if (npc.type == mod.NPCType("CryogenIce") || npc.type == mod.NPCType("ProfanedGuardianBoss") || npc.type == mod.NPCType("ProvSpawnDefense") || - npc.type == mod.NPCType("ScavengerBody")) - { - this.protection = 0.4f; - } - else if (npc.type == mod.NPCType("ArmoredDiggerTail")) - { - this.protection = 0.45f; - } - else if (npc.type == mod.NPCType("SirenIce")) - { - this.protection = 0.5f; - } - else - { - switch (npc.type) - { - case NPCID.SkeletronHand: - case NPCID.SkeletronHead: - case NPCID.QueenBee: - case NPCID.HeadlessHorseman: - case NPCID.FlyingAntlion: - case NPCID.PirateCaptain: - case NPCID.MoonLordHead: - case NPCID.MoonLordHand: - case NPCID.MoonLordCore: - case NPCID.MoonLordFreeEye: - case NPCID.CultistBoss: - case NPCID.Mothron: - case NPCID.Crab: - case NPCID.SeaSnail: - this.protection = 0.05f; break; - case NPCID.Antlion: - case NPCID.TheHungry: - case NPCID.TheDestroyer: - case NPCID.UndeadViking: - case NPCID.MourningWood: - case NPCID.Everscream: - case NPCID.GreekSkeleton: - case NPCID.GraniteFlyer: - case NPCID.WalkingAntlion: - case NPCID.Pumpking: - case NPCID.IceQueen: - case NPCID.IceGolem: - case NPCID.AnomuraFungus: - case NPCID.SkeletonArcher: - case NPCID.SandElemental: - case NPCID.Arapaima: - case NPCID.ArmoredViking: - case NPCID.DD2Betsy: - case NPCID.DD2OgreT2: - this.protection = 0.1f; break; - case NPCID.ElfCopter: - case NPCID.GraniteGolem: - case NPCID.ArmoredSkeleton: - case NPCID.PirateShipCannon: - case NPCID.DD2OgreT3: - case NPCID.Golem: - this.protection = 0.15f; break; - case NPCID.Retinazer: - case NPCID.Spazmatism: - case NPCID.PrimeCannon: - case NPCID.PrimeLaser: - case NPCID.TheDestroyerBody: - case 269: - case 270: - case 271: - case 272: - case 273: - case 274: - case 275: - case 276: - case 277: - case 278: - case 279: - case 280: - case 281: - case 282: - case 283: - case 284: - case 285: - case 286: - case 287: - case 288: - case 289: - case 291: - case 292: - case 293: - case 294: - case 295: - case 296: - case NPCID.MartianSaucerTurret: - case NPCID.MartianSaucerCannon: - case NPCID.MartianTurret: - case NPCID.MartianDrone: - case NPCID.MartianSaucer: - case NPCID.MartianSaucerCore: - case 494: - case 495: - case 496: - case 497: - this.protection = 0.2f; break; - case NPCID.PrimeSaw: - case NPCID.PrimeVice: - case NPCID.SkeletronPrime: - case NPCID.Probe: - case NPCID.PossessedArmor: - this.protection = 0.25f; break; - case NPCID.Mimic: - case NPCID.PresentMimic: - case 473: - case 474: - case 475: - case 476: - this.protection = 0.3f; break; - case NPCID.GiantTortoise: - case NPCID.IceTortoise: - case NPCID.SantaNK1: - case NPCID.MartianWalker: - case NPCID.TheDestroyerTail: - this.protection = 0.35f; break; - case NPCID.DeadlySphere: - this.protection = 0.4f; break; - case NPCID.Paladin: - this.protection = 0.45f; break; - case NPCID.WallofFlesh: - case NPCID.MothronEgg: - this.protection = 0.5f; break; - case NPCID.DungeonGuardian: - this.protection = 0.9999f; break; - } - } - } - if (npc.type == mod.NPCType("SCalWormBody") || npc.type == mod.NPCType("SCalWormHead") || - npc.type == mod.NPCType("SCalWormTail") || npc.type == mod.NPCType("EidolonWyrmHeadHuge")) - { - this.protection = 0.999999f; - } - if (this.protection > 0f) - { - this.defProtection = this.protection; - } - if (Main.raining && CalamityWorld.sulphurTiles > 30 && !npc.boss && !npc.friendly && !npc.dontTakeDamage && npc.lifeMax <= 2000) - { - npc.lifeMax = (int)((double)npc.lifeMax * 1.15); - npc.damage = (int)((double)npc.damage * 1.25); - npc.life = npc.lifeMax; - npc.defDamage = npc.damage; - } - if (Main.bloodMoon && NPC.downedMoonlord && !npc.boss && !npc.friendly && !npc.dontTakeDamage && npc.lifeMax <= 2000) - { - npc.lifeMax = (int)((double)npc.lifeMax * 3.5); - npc.damage = (int)((double)npc.damage * 2.0); - npc.life = npc.lifeMax; - npc.defDamage = npc.damage; - } - if (CalamityWorld.downedDoG) - { - if (CalamityMod.pumpkinMoonBuffList.Contains(npc.type)) - { - npc.lifeMax = (int)((double)npc.lifeMax * 7.5); - npc.damage = (int)((double)npc.damage * 2.5); - npc.life = npc.lifeMax; - npc.defDamage = npc.damage; - } - else if (CalamityMod.frostMoonBuffList.Contains(npc.type)) - { - npc.lifeMax = (int)((double)npc.lifeMax * 6.0); - npc.damage = (int)((double)npc.damage * 2.5); - npc.life = npc.lifeMax; - npc.defDamage = npc.damage; - } - } - if (CalamityMod.eclipseBuffList.Contains(npc.type) && CalamityWorld.buffedEclipse) - { - npc.lifeMax = (int)((double)npc.lifeMax * 32.5); - npc.damage = (int)((double)npc.damage * 3.0); - npc.life = npc.lifeMax; - npc.defDamage = npc.damage; - } - if (NPC.downedMoonlord) - { - if (CalamityMod.dungeonEnemyBuffList.Contains(npc.type)) - { - npc.lifeMax = (int)((double)npc.lifeMax * 2.5); - npc.damage = (int)((double)npc.damage * 2.5); - npc.life = npc.lifeMax; - npc.defDamage = npc.damage; - } - } - } - #endregion + #region SetDefaults + public override void SetDefaults(NPC npc) + { + for (int m = 0; m < maxAIMod; m++) + { + newAI[m] = 0f; + } + if (npc.boss && CalamityWorld.revenge) + { + if (npc.type != mod.NPCType("HiveMindP2") && npc.type != mod.NPCType("Leviathan") && npc.type != mod.NPCType("StormWeaverHeadNaked") && + npc.type != mod.NPCType("StormWeaverBodyNaked") && npc.type != mod.NPCType("StormWeaverTailNaked") && + npc.type != mod.NPCType("DevourerofGodsHeadS") && npc.type != mod.NPCType("DevourerofGodsBodyS") && + npc.type != mod.NPCType("DevourerofGodsTailS")) + { + if (Main.netMode != 2) + { + if (!Main.player[Main.myPlayer].dead && Main.player[Main.myPlayer].active) + { + Main.player[Main.myPlayer].GetModPlayer(mod).adrenaline = 0; + } + } + } + } + if (CalamityWorld.bossRushActive) + { + if (!npc.friendly) + { + for (int k = 0; k < npc.buffImmune.Length; k++) + { + npc.buffImmune[k] = true; + npc.buffImmune[BuffID.Ichor] = false; + npc.buffImmune[BuffID.CursedInferno] = false; + npc.buffImmune[mod.BuffType("Enraged")] = false; + } + } + } + else + { + if (CalamityMod.enemyImmunityList.Contains(npc.type)) + { + npc.buffImmune[mod.BuffType("GlacialState")] = true; + npc.buffImmune[mod.BuffType("TemporalSadness")] = true; + } + if (npc.type == NPCID.TheDestroyer || + npc.type == NPCID.TheDestroyerBody || + npc.type == NPCID.TheDestroyerTail || + npc.type == NPCID.DD2EterniaCrystal || + npc.townNPC) + { + for (int k = 0; k < npc.buffImmune.Length; k++) + { + npc.buffImmune[k] = true; + } + if (npc.townNPC) + { + npc.buffImmune[BuffID.Wet] = false; + npc.buffImmune[BuffID.Slimed] = false; + } + } + if (npc.buffImmune[mod.BuffType("Enraged")]) + { + npc.buffImmune[mod.BuffType("Enraged")] = false; + } + } + if (npc.type == NPCID.QueenBee) + { + npc.value = Item.buyPrice(0, 5, 0, 0); + } + else if (npc.type == NPCID.SkeletronHead) + { + npc.value = Item.buyPrice(0, 7, 0, 0); + } + else if (npc.type == NPCID.DukeFishron) + { + npc.value = Item.buyPrice(0, 25, 0, 0); + } + else if (npc.type == NPCID.CultistBoss) + { + npc.value = Item.buyPrice(0, 25, 0, 0); + } + else if (npc.type == NPCID.MoonLordCore) + { + npc.value = Item.buyPrice(0, 30, 0, 0); + } + if (CalamityWorld.defiled) + { + npc.value = (float)((int)((double)npc.value * 1.5)); + } + if (CalamityWorld.bossRushActive) + { + switch (npc.type) + { + case NPCID.QueenBee: //Tier 1 + npc.lifeMax = 420000; + break; + case NPCID.BrainofCthulhu: + npc.lifeMax = 200000; + break; + case NPCID.Creeper: + npc.lifeMax = 20000; + break; + case NPCID.KingSlime: + npc.lifeMax = 500000; + break; + case NPCID.BlueSlime: + npc.lifeMax = 12000; + break; + case NPCID.SlimeSpiked: + npc.lifeMax = 24000; + break; + case NPCID.EyeofCthulhu: + npc.lifeMax = 600000; + break; + case NPCID.ServantofCthulhu: + npc.lifeMax = 60000; + break; + case NPCID.SkeletronPrime: + npc.lifeMax = 780000; + break; + case NPCID.PrimeCannon: + npc.lifeMax = 350000; + break; + case NPCID.PrimeVice: + npc.lifeMax = 440000; + break; + case NPCID.PrimeSaw: + npc.lifeMax = 450000; + break; + case NPCID.PrimeLaser: + npc.lifeMax = 280000; + break; + case NPCID.Golem: + npc.lifeMax = 450000; + break; + case NPCID.GolemHead: + npc.lifeMax = 300000; + break; + case NPCID.GolemFistLeft: + npc.lifeMax = 250000; + break; + case NPCID.GolemFistRight: + npc.lifeMax = 250000; + break; + case NPCID.EaterofWorldsHead: + npc.lifeMax = 20000; + break; + case NPCID.EaterofWorldsBody: + npc.lifeMax = 30000; + break; + case NPCID.EaterofWorldsTail: + npc.lifeMax = 40000; + break; + case NPCID.TheDestroyer: //Tier 2 + npc.lifeMax = 2500000; + break; + case NPCID.TheDestroyerBody: + npc.lifeMax = 2500000; + break; + case NPCID.TheDestroyerTail: + npc.lifeMax = 2500000; + break; + case NPCID.Probe: + npc.lifeMax = 50000; + break; + case NPCID.Spazmatism: + npc.lifeMax = 1000000; + break; + case NPCID.Retinazer: + npc.lifeMax = 700000; + break; + case NPCID.WallofFlesh: + npc.lifeMax = 2400000; + break; + case NPCID.WallofFleshEye: + npc.lifeMax = 2400000; + break; + case NPCID.SkeletronHead: + npc.lifeMax = 1300000; + break; + case NPCID.SkeletronHand: + npc.lifeMax = 500000; + break; + case NPCID.CultistBoss: //Tier 3 + npc.lifeMax = 1100000; + break; + case NPCID.CultistDragonHead: + npc.lifeMax = 400000; + break; + case NPCID.CultistDragonBody1: + npc.lifeMax = 400000; + break; + case NPCID.CultistDragonBody2: + npc.lifeMax = 400000; + break; + case NPCID.CultistDragonBody3: + npc.lifeMax = 400000; + break; + case NPCID.CultistDragonBody4: + npc.lifeMax = 400000; + break; + case NPCID.CultistDragonTail: + npc.lifeMax = 400000; + break; + case NPCID.AncientCultistSquidhead: + npc.lifeMax = 300000; + break; + case NPCID.Plantera: + npc.lifeMax = 2100000; + break; + case NPCID.PlanterasTentacle: + npc.lifeMax = 90000; + break; + case NPCID.DukeFishron: //Tier 4 + npc.lifeMax = 2500000; + break; + case NPCID.MoonLordCore: + npc.lifeMax = 1400000; + break; + case NPCID.MoonLordHand: + npc.lifeMax = 450000; + break; + case NPCID.MoonLordHead: + npc.lifeMax = 600000; + break; + case NPCID.MoonLordFreeEye: + npc.lifeMax = 1000; + break; + } + } + if (npc.type == NPCID.CultistBoss) + { + if (CalamityWorld.death) + { + npc.lifeMax = (int)((double)npc.lifeMax * 2.25); + } + else + { + npc.lifeMax = (int)((double)npc.lifeMax * (CalamityWorld.revenge ? 1.55 : 1.15)); + } + npc.npcSlots = 20f; + } + if (DraedonMayhem) + { + if (npc.type == NPCID.TheDestroyer || npc.type == NPCID.TheDestroyerBody || npc.type == NPCID.TheDestroyerTail) + { + if (CalamityWorld.death) + { + npc.lifeMax = (int)((double)npc.lifeMax * 2.7); + npc.scale *= 1.25f; + } + else + { + npc.lifeMax = (int)((double)npc.lifeMax * 1.8); + npc.scale *= 1.2f; + } + npc.npcSlots = 10f; + } + else if (npc.type == NPCID.Probe) + { + if (CalamityWorld.death) + { + npc.lifeMax = (int)((double)npc.lifeMax * 2.7); + npc.scale *= 1.25f; + } + else + { + npc.lifeMax = (int)((double)npc.lifeMax * 1.8); + npc.scale *= 1.2f; + } + } + else if (npc.type == NPCID.SkeletronPrime || npc.type == NPCID.PrimeVice || npc.type == NPCID.PrimeCannon || npc.type == NPCID.PrimeSaw || npc.type == NPCID.PrimeLaser) + { + if (npc.type == NPCID.SkeletronPrime) + { + npc.npcSlots = 12f; + } + if (CalamityWorld.death) + { + if (npc.type == NPCID.PrimeLaser) + { + npc.lifeMax = (int)((double)npc.lifeMax * 1.5); + } + else + { + npc.lifeMax = (int)((double)npc.lifeMax * 2.9); + } + } + else + { + npc.lifeMax = (int)((double)npc.lifeMax * 1.6); + } + } + else if (npc.type == NPCID.Retinazer) + { + if (CalamityWorld.death) + { + npc.lifeMax = (int)((double)npc.lifeMax * 3.0); + } + else + { + npc.lifeMax = (int)((double)npc.lifeMax * 1.8); + } + npc.npcSlots = 10f; + } + else if (npc.type == NPCID.Spazmatism) + { + if (CalamityWorld.death) + { + npc.lifeMax = (int)((double)npc.lifeMax * 3.0); + } + else + { + npc.lifeMax = (int)((double)npc.lifeMax * 1.8); + } + npc.npcSlots = 10f; + } + } + if (CalamityWorld.revenge) + { + npc.value = (float)((int)((double)npc.value * 1.5)); + if (npc.type == NPCID.MoonLordFreeEye) + { + npc.lifeMax = (int)((double)npc.lifeMax * 150.0); + } + else if (npc.type == NPCID.Mothron) + { + npc.scale = 1.25f; + } + else if (npc.type == NPCID.MoonLordCore) //final boss in hardmode, gets a big boost in stats + { + if (CalamityWorld.death) + { + npc.lifeMax = (int)((double)npc.lifeMax * 2.4); //140% boost + } + else + { + npc.lifeMax = (int)((double)npc.lifeMax * 1.9); //90% boost + } + npc.npcSlots = 12f; + } + else if (npc.type == NPCID.MoonLordHand || npc.type == NPCID.MoonLordHead) + { + if (CalamityWorld.death) + { + npc.lifeMax = (int)((double)npc.lifeMax * 1.4); //40% boost + } + else + { + npc.lifeMax = (int)((double)npc.lifeMax * 1.2); //20% boost + } + npc.npcSlots = 12f; + } + else if (npc.type >= 454 && npc.type <= 459) + { + if (CalamityWorld.death) + { + npc.lifeMax = (int)((double)npc.lifeMax * 10.0); + } + else + { + npc.lifeMax = (int)((double)npc.lifeMax * 5.0); + } + } + else if (npc.type == NPCID.DukeFishron) + { + if (CalamityWorld.death) + { + npc.lifeMax = (int)((double)npc.lifeMax * 3.525); //252.5% boost + } + else + { + npc.lifeMax = (int)((double)npc.lifeMax * 1.85); //85% boost + } + npc.npcSlots = 20f; + } + else if (npc.type == NPCID.Sharkron || npc.type == NPCID.Sharkron2) + { + npc.lifeMax = (int)((double)npc.lifeMax * 30.0); + } + else if (npc.type == NPCID.Golem) + { + if (CalamityWorld.death) + { + npc.lifeMax = (int)((double)npc.lifeMax * 8.5); + } + else + { + npc.lifeMax = (int)((double)npc.lifeMax * 3.5); + } + npc.npcSlots = 64f; + } + else if (npc.type == NPCID.Plantera) + { + if (CalamityWorld.death) + { + npc.lifeMax = (int)((double)npc.lifeMax * 2.9); + } + else + { + npc.lifeMax = (int)((double)npc.lifeMax * 1.9); + } + npc.npcSlots = 32f; + } + else if (npc.type == NPCID.PlanterasTentacle) + { + npc.lifeMax = (int)((double)npc.lifeMax * 1.25); + } + else if (npc.type == NPCID.WallofFlesh || npc.type == NPCID.WallofFleshEye) //final boss prehm, gets a big boost in stats + { + if (npc.type == NPCID.WallofFlesh) + { + npc.npcSlots = 20f; + } + if (CalamityWorld.death) + { + npc.lifeMax = (int)((double)npc.lifeMax * 2.6); + } + else + { + npc.lifeMax = (int)((double)npc.lifeMax * 1.9); + } + } + else if (npc.type == NPCID.TheHungryII) + { + if (CalamityWorld.death) + { + npc.noTileCollide = true; + npc.lifeMax = (int)((double)npc.lifeMax * 1.5); + } + else + { + npc.lifeMax = (int)((double)npc.lifeMax * 1.25); + } + } + else if (npc.type == NPCID.LeechHead || npc.type == NPCID.LeechBody || npc.type == NPCID.LeechTail) + { + if (CalamityWorld.death) + { + npc.lifeMax = (int)((double)npc.lifeMax * 1.5); + } + else + { + npc.lifeMax = (int)((double)npc.lifeMax * 1.25); + } + } + else if (npc.type == NPCID.SkeletronHead) + { + if (CalamityWorld.death) + { + npc.lifeMax = (int)((double)npc.lifeMax * 1.4); + } + else + { + npc.lifeMax = (int)((double)npc.lifeMax * 1.25); + } + npc.npcSlots = 12f; + } + else if (npc.type == NPCID.SkeletronHand) + { + if (CalamityWorld.death) + { + npc.lifeMax = (int)((double)npc.lifeMax * 1.4); + } + else + { + npc.lifeMax = (int)((double)npc.lifeMax * 1.3); + } + } + else if (npc.type == NPCID.QueenBee) + { + if (CalamityWorld.death) + { + npc.lifeMax = (int)((double)npc.lifeMax * 1.65); + } + else + { + npc.lifeMax = (int)((double)npc.lifeMax * 1.15); + } + npc.npcSlots = 14f; + } + else if (npc.type == NPCID.BrainofCthulhu) + { + if (CalamityWorld.death) + { + npc.lifeMax = (int)((double)npc.lifeMax * 1.9); + } + else + { + npc.lifeMax = (int)((double)npc.lifeMax * 1.4); + } + npc.npcSlots = 12f; + } + else if (npc.type == NPCID.EaterofWorldsHead || npc.type == NPCID.EaterofWorldsBody || npc.type == NPCID.EaterofWorldsTail) + { + if (npc.type == NPCID.EaterofWorldsHead) + { + npc.npcSlots = 10f; + if (CalamityWorld.death) + { + npc.reflectingProjectiles = true; + } + } + if (CalamityWorld.death) + { + npc.lifeMax = (int)((double)npc.lifeMax * 1.4); //40% boost + } + else + { + npc.lifeMax = (int)((double)npc.lifeMax * 1.3); //30% boost + } + } + else if (npc.type == NPCID.EyeofCthulhu) + { + if (CalamityWorld.death) + { + npc.lifeMax = (int)((double)npc.lifeMax * 2.3); //130% boost + } + else + { + npc.lifeMax = (int)((double)npc.lifeMax * 1.25); //25% boost + } + npc.npcSlots = 10f; + } + else if (npc.type == NPCID.KingSlime) + { + if (CalamityWorld.death) + { + npc.lifeMax = (int)((double)npc.lifeMax * 1.85); //85% boost + } + } + if (!DraedonMayhem) + { + if (npc.type == NPCID.TheDestroyer || npc.type == NPCID.TheDestroyerBody || npc.type == NPCID.TheDestroyerTail) + { + if (CalamityWorld.death) + { + npc.lifeMax = (int)((double)npc.lifeMax * 1.6); + npc.scale *= 1.2f; + } + else + { + npc.lifeMax = (int)((double)npc.lifeMax * 1.25); + } + npc.npcSlots = 10f; + } + else if (npc.type == NPCID.Probe) + { + if (CalamityWorld.death) + { + npc.lifeMax = (int)((double)npc.lifeMax * 1.9); + npc.scale *= 1.2f; + } + } + else if (npc.type == NPCID.SkeletronPrime || npc.type == NPCID.PrimeVice || npc.type == NPCID.PrimeCannon || npc.type == NPCID.PrimeSaw || npc.type == NPCID.PrimeLaser) + { + if (npc.type == NPCID.SkeletronPrime) + { + npc.npcSlots = 12f; + } + if (CalamityWorld.death) + { + if (npc.type == NPCID.PrimeLaser) + { + npc.lifeMax = (int)((double)npc.lifeMax * 0.15); + } + else + { + npc.lifeMax = (int)((double)npc.lifeMax * 1.9); + } + } + else + { + npc.lifeMax = (int)((double)npc.lifeMax * 1.25); + } + } + else if (npc.type == NPCID.Retinazer) + { + if (CalamityWorld.death) + { + npc.lifeMax = (int)((double)npc.lifeMax * 1.7); + } + else + { + npc.lifeMax = (int)((double)npc.lifeMax * 1.45); + } + npc.npcSlots = 10f; + } + else if (npc.type == NPCID.Spazmatism) + { + if (CalamityWorld.death) + { + npc.lifeMax = (int)((double)npc.lifeMax * 1.8); + } + else + { + npc.lifeMax = (int)((double)npc.lifeMax * 1.55); + } + npc.npcSlots = 10f; + } + } + if (npc.type == NPCID.Probe || npc.type == NPCID.MoonLordFreeEye || (npc.type >= 454 && npc.type <= 459) || + npc.type == NPCID.Sharkron || npc.type == NPCID.Sharkron2 || npc.type == NPCID.PlanterasTentacle || + npc.type == NPCID.Spore || npc.type == NPCID.TheHungryII || npc.type == NPCID.LeechHead || + npc.type == NPCID.LeechBody || npc.type == NPCID.LeechTail || npc.type == NPCID.TheDestroyerBody || + npc.type == NPCID.TheDestroyerTail || npc.type == NPCID.EaterofWorldsBody || npc.type == NPCID.EaterofWorldsTail || + npc.type == NPCID.GolemHead || npc.type == NPCID.GolemFistRight || npc.type == NPCID.GolemFistLeft || + npc.type == NPCID.MoonLordCore) + { + npc.canGhostHeal = false; + } + if (npc.type == mod.NPCType("Cnidrion") || npc.type == mod.NPCType("DesertScourgeBody") || npc.type == mod.NPCType("ColossalSquid") || + npc.type == mod.NPCType("Siren") || npc.type == mod.NPCType("ThiccWaifu") || npc.type == mod.NPCType("ProfanedGuardianBoss3") || + npc.type == mod.NPCType("ScornEater") || npc.type == mod.NPCType("AquaticScourgeBody") || npc.type == mod.NPCType("AquaticScourgeBodyAlt") || + npc.type == mod.NPCType("Mauler")) + { + protection = 0.05f; + } + else if (npc.type == mod.NPCType("AstrumDeusBody") || npc.type == mod.NPCType("SoulSeeker") || npc.type == mod.NPCType("DesertScourgeTail") || + npc.type == mod.NPCType("Horse") || npc.type == mod.NPCType("ProfanedEnergyBody") || npc.type == mod.NPCType("ScavengerClawLeft") || + npc.type == mod.NPCType("ScavengerClawRight") || npc.type == mod.NPCType("ScavengerHead") || npc.type == mod.NPCType("MantisShrimp") || + npc.type == mod.NPCType("PhantomDebris") || npc.type == mod.NPCType("Astrageldon") || npc.type == mod.NPCType("AstrumDeusHead") || + npc.type == mod.NPCType("AquaticScourgeHead") || npc.type == mod.NPCType("Cryon") || npc.type == mod.NPCType("Cryogen")) + { + protection = 0.1f; + } + else if (npc.type == mod.NPCType("ArmoredDiggerHead") || npc.type == mod.NPCType("AstralProbe") || npc.type == mod.NPCType("Calamitas") || + npc.type == mod.NPCType("CalamitasRun") || npc.type == mod.NPCType("CalamitasRun2") || npc.type == mod.NPCType("CalamitasRun3") || + npc.type == mod.NPCType("SoulSlurper") || npc.type == mod.NPCType("ProvSpawnHealer") || npc.type == mod.NPCType("Gnasher") || + npc.type == mod.NPCType("ScavengerLegLeft") || npc.type == mod.NPCType("ScavengerLegRight") || npc.type == mod.NPCType("ShockstormShuttle") || + npc.type == mod.NPCType("Reaper") || npc.type == mod.NPCType("OverloadedSoldier") || npc.type == mod.NPCType("AquaticScourgeTail") || + npc.type == mod.NPCType("EidolonWyrmHead")) + { + protection = 0.15f; + } + else if (npc.type == mod.NPCType("AstrumDeusProbe3") || npc.type == mod.NPCType("PlaguebringerShade")) + { + protection = 0.2f; + } + else if (npc.type == mod.NPCType("PlaguebringerGoliath") || npc.type == mod.NPCType("ProfanedGuardianBoss2") || + npc.type == mod.NPCType("SandTortoise") || npc.type == mod.NPCType("StasisProbe") || + npc.type == mod.NPCType("BobbitWormHead") || npc.type == mod.NPCType("GreatSandShark")) + { + protection = 0.25f; + } + else if (npc.type == mod.NPCType("ProvSpawnOffense")) + { + protection = 0.3f; + } + else if (npc.type == mod.NPCType("ArmoredDiggerBody") || npc.type == mod.NPCType("AstrumDeusTail") || npc.type == mod.NPCType("DespairStone") || + npc.type == mod.NPCType("SoulSeekerSupreme") || npc.type == mod.NPCType("Leviathan")) + { + protection = 0.35f; + } + else if (npc.type == mod.NPCType("CryogenIce") || npc.type == mod.NPCType("ProfanedGuardianBoss") || npc.type == mod.NPCType("ProvSpawnDefense") || + npc.type == mod.NPCType("ScavengerBody")) + { + protection = 0.4f; + } + else if (npc.type == mod.NPCType("ArmoredDiggerTail")) + { + protection = 0.45f; + } + else if (npc.type == mod.NPCType("SirenIce")) + { + protection = 0.5f; + } + else + { + switch (npc.type) + { + case NPCID.SkeletronHand: + case NPCID.SkeletronHead: + case NPCID.QueenBee: + case NPCID.HeadlessHorseman: + case NPCID.FlyingAntlion: + case NPCID.PirateCaptain: + case NPCID.MoonLordHead: + case NPCID.MoonLordHand: + case NPCID.MoonLordCore: + case NPCID.MoonLordFreeEye: + case NPCID.CultistBoss: + case NPCID.Mothron: + case NPCID.Crab: + case NPCID.SeaSnail: + protection = 0.05f; break; + case NPCID.Antlion: + case NPCID.TheHungry: + case NPCID.TheDestroyer: + case NPCID.UndeadViking: + case NPCID.MourningWood: + case NPCID.Everscream: + case NPCID.GreekSkeleton: + case NPCID.GraniteFlyer: + case NPCID.WalkingAntlion: + case NPCID.Pumpking: + case NPCID.IceQueen: + case NPCID.IceGolem: + case NPCID.AnomuraFungus: + case NPCID.SkeletonArcher: + case NPCID.SandElemental: + case NPCID.Arapaima: + case NPCID.ArmoredViking: + case NPCID.DD2Betsy: + case NPCID.DD2OgreT2: + protection = 0.1f; break; + case NPCID.ElfCopter: + case NPCID.GraniteGolem: + case NPCID.ArmoredSkeleton: + case NPCID.PirateShipCannon: + case NPCID.DD2OgreT3: + case NPCID.Golem: + protection = 0.15f; break; + case NPCID.Retinazer: + case NPCID.Spazmatism: + case NPCID.PrimeCannon: + case NPCID.PrimeLaser: + case NPCID.TheDestroyerBody: + case 269: + case 270: + case 271: + case 272: + case 273: + case 274: + case 275: + case 276: + case 277: + case 278: + case 279: + case 280: + case 281: + case 282: + case 283: + case 284: + case 285: + case 286: + case 287: + case 288: + case 289: + case 291: + case 292: + case 293: + case 294: + case 295: + case 296: + case NPCID.MartianSaucerTurret: + case NPCID.MartianSaucerCannon: + case NPCID.MartianTurret: + case NPCID.MartianDrone: + case NPCID.MartianSaucer: + case NPCID.MartianSaucerCore: + case 494: + case 495: + case 496: + case 497: + protection = 0.2f; break; + case NPCID.PrimeSaw: + case NPCID.PrimeVice: + case NPCID.SkeletronPrime: + case NPCID.Probe: + case NPCID.PossessedArmor: + protection = 0.25f; break; + case NPCID.Mimic: + case NPCID.PresentMimic: + case 473: + case 474: + case 475: + case 476: + protection = 0.3f; break; + case NPCID.GiantTortoise: + case NPCID.IceTortoise: + case NPCID.SantaNK1: + case NPCID.MartianWalker: + case NPCID.TheDestroyerTail: + protection = 0.35f; break; + case NPCID.DeadlySphere: + protection = 0.4f; break; + case NPCID.Paladin: + protection = 0.45f; break; + case NPCID.WallofFlesh: + case NPCID.MothronEgg: + protection = 0.5f; break; + case NPCID.DungeonGuardian: + protection = 0.9999f; break; + } + } + } + if (npc.type == mod.NPCType("SCalWormBody") || npc.type == mod.NPCType("SCalWormHead") || npc.type == mod.NPCType("SCalWormBodyWeak") || + npc.type == mod.NPCType("SCalWormTail") || npc.type == mod.NPCType("EidolonWyrmHeadHuge")) + { + protection = 0.999999f; + } + if (protection > 0f) + { + defProtection = protection; + } + if (Main.raining && CalamityWorld.sulphurTiles > 30 && !npc.boss && !npc.friendly && !npc.dontTakeDamage && npc.lifeMax <= 2000) + { + npc.lifeMax = (int)((double)npc.lifeMax * 1.15); + npc.damage = (int)((double)npc.damage * 1.25); + npc.life = npc.lifeMax; + npc.defDamage = npc.damage; + } + if (Main.bloodMoon && NPC.downedMoonlord && !npc.boss && !npc.friendly && !npc.dontTakeDamage && npc.lifeMax <= 2000) + { + npc.lifeMax = (int)((double)npc.lifeMax * 3.5); + npc.damage = (int)((double)npc.damage * 2.0); + npc.life = npc.lifeMax; + npc.defDamage = npc.damage; + } + if (CalamityWorld.downedDoG) + { + if (CalamityMod.pumpkinMoonBuffList.Contains(npc.type)) + { + npc.lifeMax = (int)((double)npc.lifeMax * 7.5); + npc.damage = (int)((double)npc.damage * 2.5); + npc.life = npc.lifeMax; + npc.defDamage = npc.damage; + } + else if (CalamityMod.frostMoonBuffList.Contains(npc.type)) + { + npc.lifeMax = (int)((double)npc.lifeMax * 6.0); + npc.damage = (int)((double)npc.damage * 2.5); + npc.life = npc.lifeMax; + npc.defDamage = npc.damage; + } + } + if (CalamityMod.eclipseBuffList.Contains(npc.type) && CalamityWorld.buffedEclipse) + { + npc.lifeMax = (int)((double)npc.lifeMax * 32.5); + npc.damage = (int)((double)npc.damage * 3.0); + npc.life = npc.lifeMax; + npc.defDamage = npc.damage; + } + if (NPC.downedMoonlord) + { + if (CalamityMod.dungeonEnemyBuffList.Contains(npc.type)) + { + npc.lifeMax = (int)((double)npc.lifeMax * 2.5); + npc.damage = (int)((double)npc.damage * 2.5); + npc.life = npc.lifeMax; + npc.defDamage = npc.damage; + } + } + } + #endregion - #region ScaleExpertMultiplayerStats - public override void ScaleExpertStats(NPC npc, int numPlayers, float bossLifeScale) - { - if (Main.netMode != 0) - { - if (numPlayers > 1) - { - if (((npc.boss || CalamityMod.bossScaleList.Contains(npc.type)) && npc.type < NPCID.Count) || - (npc.modNPC != null && npc.modNPC.mod.Name.Equals("CalamityMod"))) - { - bossLifeScale = 1f; //set expert scale to 1 instead of 2 - float playerCount = (float)numPlayers; - if (playerCount > 20f) //max player count - { - playerCount = 20f; - } - if (CalamityWorld.bossRushActive && playerCount > 2f) - { - playerCount = 2f; - } - float scalar = 0.4f + ((2f * playerCount) / 20f); //lower scaling because fuck u - int setToLifeMax = npc.lifeMax; - npc.lifeMax = (int)(npc.lifeMax * scalar * bossLifeScale); - if (npc.lifeMax < setToLifeMax) - { - npc.lifeMax = setToLifeMax; - } - } - } - } - } - #endregion + #region ScaleExpertMultiplayerStats + public override void ScaleExpertStats(NPC npc, int numPlayers, float bossLifeScale) + { + if (Main.netMode != 0) + { + if (numPlayers > 1) + { + /*About 1.35 multiplier for 2 players, 1.92 for 3 players, 2.63 for 4 players, 3.44 for 5 players, 4.31 for 6 players + Destroyer has 120K HP + 2 players = 146K HP + 3 players = 173K HP + 4 players = 197K HP + 5 players = 223K HP + 6 players = 248K HP*/ + if (((npc.boss || CalamityMod.bossScaleList.Contains(npc.type)) && npc.type < NPCID.Count) || + (npc.modNPC != null && npc.modNPC.mod.Name.Equals("CalamityMod"))) + { + double scalar = 1.0; + switch (numPlayers) //Decrease HP in multiplayer before vanilla scaling + { + case 2: + scalar = 0.9; + break; + case 3: + scalar = 0.75; + break; + case 4: + scalar = 0.625; + break; + case 5: + scalar = 0.54; + break; + case 6: + scalar = 0.48; + break; + default: + scalar = 0.45; + break; + } + npc.lifeMax = (int)((double)npc.lifeMax * scalar); + } + } + } + } + #endregion - #region CanBeHitBy - public override bool? CanBeHitByItem(NPC npc, Player player, Item item) - { - if (npc.type == NPCID.TargetDummy || npc.type == mod.NPCType("SuperDummy")) - { - return !CalamityPlayer.areThereAnyDamnBosses; - } - return null; - } + #region CanBeHitBy + public override bool? CanBeHitByItem(NPC npc, Player player, Item item) + { + if (npc.type == NPCID.TargetDummy || npc.type == mod.NPCType("SuperDummy")) + { + return !CalamityPlayer.areThereAnyDamnBosses; + } + return null; + } - public override bool? CanBeHitByProjectile(NPC npc, Projectile projectile) - { - if (npc.type == NPCID.TargetDummy || npc.type == mod.NPCType("SuperDummy")) - { - return !CalamityPlayer.areThereAnyDamnBosses; - } - return null; - } - #endregion + public override bool? CanBeHitByProjectile(NPC npc, Projectile projectile) + { + if (npc.type == NPCID.TargetDummy || npc.type == mod.NPCType("SuperDummy")) + { + return !CalamityPlayer.areThereAnyDamnBosses; + } + return null; + } + #endregion - #region CanHitPlayer - public override bool CanHitPlayer(NPC npc, Player target, ref int cooldownSlot) + #region CanHitPlayer + public override bool CanHitPlayer(NPC npc, Player target, ref int cooldownSlot) { if (Main.pumpkinMoon && CalamityWorld.downedDoG && !npc.boss && !npc.friendly && !npc.dontTakeDamage) cooldownSlot = 1; @@ -1266,4767 +1364,4804 @@ namespace CalamityMod.NPCs cooldownSlot = 1; else if (Main.eclipse && CalamityWorld.buffedEclipse && !npc.boss && !npc.friendly && !npc.dontTakeDamage) cooldownSlot = 1; - if (npc.type == NPCID.BrainofCthulhu && npc.alpha > 0) - return false; + if (npc.type == NPCID.BrainofCthulhu && npc.alpha > 0) + return false; return true; } - #endregion + #endregion - #region ModifyHitPlayer - public override void ModifyHitPlayer(NPC npc, Player target, ref int damage, ref bool crit) + #region ModifyHitPlayer + public override void ModifyHitPlayer(NPC npc, Player target, ref int damage, ref bool crit) { - if (tSad) - { - damage /= 2; - } - if (target.GetModPlayer(mod).beeResist) + if (tSad) { - if (CalamityMod.beeEnemyList.Contains(npc.type)) + damage /= 2; + } + if (target.GetModPlayer(mod).beeResist) + { + if (CalamityMod.beeEnemyList.Contains(npc.type)) { damage = (int)((double)damage * 0.75); } } } - #endregion + #endregion - #region StrikeNPC - public override bool StrikeNPC(NPC npc, ref double damage, int defense, ref float knockback, int hitDirection, ref bool crit) + #region StrikeNPC + public override bool StrikeNPC(NPC npc, ref double damage, int defense, ref float knockback, int hitDirection, ref bool crit) { - if (npc.type == NPCID.TheDestroyer || npc.type == NPCID.TheDestroyerBody || npc.type == NPCID.TheDestroyerTail) - { - if (this.newAI[1] < 480f) - damage *= 0.1; - } - if (enraged) - { - damage *= 5.0; - } - if (this.protection > 0f) + if (npc.type == NPCID.TheDestroyer || npc.type == NPCID.TheDestroyerBody || npc.type == NPCID.TheDestroyerTail || + npc.type == NPCID.EaterofWorldsHead || npc.type == NPCID.EaterofWorldsBody || npc.type == NPCID.EaterofWorldsTail) { - int trueDefense = defense; - if (pFlames) - { - trueDefense -= 4; - } - if (wDeath) - { - trueDefense -= 50; - } - if (gsInferno) - { - trueDefense -= 20; - } - if (aFlames) - { - trueDefense -= 10; - } - if (gState) - { - trueDefense /= 2; - } - if (aCrunch) - { - trueDefense /= 3; - } - if (trueDefense < 0) - { - trueDefense = 0; - } - double newDamage = (damage + ((double)trueDefense * 0.25)); //defense damage boost 150 * .25 = 45 + 150 = 195 damage 180 defense - if (marked) - { - this.protection *= 0.5f; - } + if (newAI[1] < 480f || newAI[2] > 0f) + damage *= 0.01; + } + if (enraged) + { + damage *= 2.25; + } + double yellowCandleDamageBoost = damage * 0.05; //get value before DR + if (protection > 0f) + { + int trueDefense = defense; + if (pFlames) + { + trueDefense -= 4; + } + if (wDeath) + { + trueDefense -= 50; + } + if (gsInferno) + { + trueDefense -= 20; + } + if (aFlames) + { + trueDefense -= 10; + } + if (gState) + { + trueDefense /= 2; + } + if (aCrunch) + { + trueDefense /= 3; + } + if (trueDefense < 0) + { + trueDefense = 0; + } + double newDamage = damage + ((double)trueDefense * 0.25); //defense damage boost 150 * .25 = 45 + 150 = 195 damage 180 defense + if (marked) + { + protection *= 0.5f; + } if (npc.ichor) { - this.protection *= 0.75f; + protection *= 0.75f; + } + else if (npc.onFire2) + { + protection *= 0.8f; } - else if (npc.onFire2) - { - this.protection *= 0.8f; - } if (npc.betsysCurse) { - this.protection *= 0.66f; + protection *= 0.66f; } - if (this.protection < 0f) + if (protection < 0f) { - this.protection = 0f; + protection = 0f; } if (newDamage >= 1.0) { - newDamage = ((double)(1f - this.protection) * newDamage); //DR calc 195 * 0.4 = 78 damage 0.6 DR + newDamage = (double)(1f - protection) * newDamage; //DR calc 195 * 0.4 = 78 damage 0.6 DR if (newDamage < 1.0) { newDamage = 1.0; } } damage = newDamage; - this.protection = this.defProtection; + protection = defProtection; + } + if (yellowCandle) + { + damage += yellowCandleDamageBoost; } return true; //vanilla defense calc 78 - (180 / 2 = 90) = 0, boosted to 1 by calc } - #endregion + #endregion - #region PreAI - public override bool PreAI(NPC npc) - { - if (setNewName) - { - setNewName = false; - if (npc.type == NPCID.Guide) - { - switch (Main.rand.Next(35)) //34 guide names - { - case 0: - npc.GivenName = "Lapp"; - break; - default: - break; - } - } - else if (npc.type == NPCID.Wizard) - { - switch (Main.rand.Next(24)) //23 wizard names - { - case 0: - npc.GivenName = "Mage One-Trick"; - break; - default: - break; - } - } - else if (npc.type == NPCID.Steampunker) - { - switch (Main.rand.Next(22)) //21 steampunker names - { - case 0: - npc.GivenName = "Vorbis"; - break; - default: - break; - } - } - } - if (npc.type == NPCID.TargetDummy || npc.type == mod.NPCType("SuperDummy")) - { - npc.chaseable = !CalamityPlayer.areThereAnyDamnBosses; - } - if (npc.type == NPCID.TheDestroyer || npc.type == NPCID.TheDestroyerBody || npc.type == NPCID.TheDestroyerTail) - { - if (this.newAI[1] < 480f) - { - this.newAI[1] += 1f; - } - } - #region BossRush - if (CalamityWorld.bossRushActive && !npc.friendly && !npc.townNPC) - { - switch (CalamityWorld.bossRushStage) - { - case 0: - if (npc.type != NPCID.QueenBee && npc.type != NPCID.Bee && npc.type != NPCID.BeeSmall) - { - npc.active = false; - npc.netUpdate = true; - } - break; - case 1: - if (npc.type != NPCID.BrainofCthulhu && npc.type != NPCID.Creeper) - { - npc.active = false; - npc.netUpdate = true; - } - break; - case 2: - if (npc.type != NPCID.KingSlime && npc.type != NPCID.BlueSlime && npc.type != NPCID.SlimeSpiked) - { - npc.active = false; - npc.netUpdate = true; - } - break; - case 3: - if (npc.type != NPCID.EyeofCthulhu && npc.type != NPCID.ServantofCthulhu) - { - npc.active = false; - npc.netUpdate = true; - } - break; - case 4: - if (npc.type != NPCID.SkeletronPrime && npc.type != NPCID.PrimeSaw && npc.type != NPCID.PrimeVice && - npc.type != NPCID.PrimeCannon && npc.type != NPCID.PrimeLaser) - { - npc.active = false; - npc.netUpdate = true; - } - break; - case 5: - if (npc.type != NPCID.Golem && npc.type != NPCID.GolemFistLeft && npc.type != NPCID.GolemFistRight && - npc.type != NPCID.GolemHead && npc.type != NPCID.GolemHeadFree) - { - npc.active = false; - npc.netUpdate = true; - } - break; - case 6: - if (npc.type != mod.NPCType("ProfanedGuardianBoss") && npc.type != mod.NPCType("ProfanedGuardianBoss2") && - npc.type != mod.NPCType("ProfanedGuardianBoss3")) - { - npc.active = false; - npc.netUpdate = true; - } - break; - case 7: - if (npc.type != NPCID.EaterofWorldsHead && npc.type != NPCID.EaterofWorldsBody && npc.type != NPCID.EaterofWorldsTail && - npc.type != NPCID.VileSpit) - { - npc.active = false; - npc.netUpdate = true; - } - break; - case 8: - if (npc.type != mod.NPCType("Astrageldon") && npc.type != mod.NPCType("AstralSlime")) - { - npc.active = false; - npc.netUpdate = true; - } - break; - case 9: - if (npc.type != NPCID.TheDestroyer && npc.type != NPCID.TheDestroyerBody && npc.type != NPCID.TheDestroyerTail && - npc.type != NPCID.Probe) - { - npc.active = false; - npc.netUpdate = true; - } - break; - case 10: - if (npc.type != NPCID.Spazmatism && npc.type != NPCID.Retinazer) - { - npc.active = false; - npc.netUpdate = true; - } - break; - case 11: - if (npc.type != mod.NPCType("Bumblefuck") && npc.type != mod.NPCType("Bumblefuck2") && - npc.type != NPCID.Spazmatism && npc.type != NPCID.Retinazer) - { - npc.active = false; - npc.netUpdate = true; - } - break; - case 12: - if (npc.type != NPCID.WallofFlesh && npc.type != NPCID.WallofFleshEye && npc.type != NPCID.TheHungry && - npc.type != NPCID.TheHungryII && npc.type != NPCID.LeechHead && npc.type != NPCID.LeechBody && - npc.type != NPCID.LeechTail) - { - npc.active = false; - npc.netUpdate = true; - } - break; - case 13: - if (npc.type != mod.NPCType("HiveMind") && npc.type != mod.NPCType("HiveMindP2") && - npc.type != mod.NPCType("DarkHeart") && npc.type != mod.NPCType("HiveBlob") && - npc.type != mod.NPCType("DankCreeper") && npc.type != mod.NPCType("HiveBlob2")) - { - npc.active = false; - npc.netUpdate = true; - } - break; - case 14: - if (npc.type != NPCID.SkeletronHead && npc.type != NPCID.SkeletronHand) - { - npc.active = false; - npc.netUpdate = true; - } - break; - case 15: - if (npc.type != mod.NPCType("StormWeaverHead") && npc.type != mod.NPCType("StormWeaverBody") && - npc.type != mod.NPCType("StormWeaverTail") && npc.type != mod.NPCType("StormWeaverHeadNaked") && - npc.type != mod.NPCType("StormWeaverBodyNaked") && npc.type != mod.NPCType("StormWeaverTailNaked") && - npc.type != mod.NPCType("StasisProbe") && npc.type != mod.NPCType("StasisProbeNaked")) - { - npc.active = false; - npc.netUpdate = true; - } - break; - case 16: - if (npc.type != mod.NPCType("AquaticScourgeHead") && npc.type != mod.NPCType("AquaticScourgeBody") && - npc.type != mod.NPCType("AquaticScourgeBodyAlt") && npc.type != mod.NPCType("AquaticScourgeTail") && - npc.type != mod.NPCType("AquaticParasite") && npc.type != mod.NPCType("AquaticUrchin") && - npc.type != mod.NPCType("AquaticSeekerHead") && npc.type != mod.NPCType("AquaticSeekerBody") && - npc.type != mod.NPCType("AquaticSeekerTail")) - { - npc.active = false; - npc.netUpdate = true; - } - break; - case 17: - if (npc.type != mod.NPCType("DesertScourgeHead") && npc.type != mod.NPCType("DesertScourgeBody") && - npc.type != mod.NPCType("DesertScourgeTail") && npc.type != mod.NPCType("DesertScourgeHeadSmall") && - npc.type != mod.NPCType("DesertScourgeBodySmall") && npc.type != mod.NPCType("DesertScourgeTailSmall") && - npc.type != mod.NPCType("DriedSeekerHead") && npc.type != mod.NPCType("DriedSeekerBody") && - npc.type != mod.NPCType("DriedSeekerTail")) - { - npc.active = false; - npc.netUpdate = true; - } - break; - case 18: - if (npc.type != NPCID.CultistBoss && npc.type != NPCID.CultistBossClone && npc.type != NPCID.CultistDragonHead && - npc.type != NPCID.CultistDragonBody1 && npc.type != NPCID.CultistDragonBody2 && npc.type != NPCID.CultistDragonBody3 && - npc.type != NPCID.CultistDragonBody4 && npc.type != NPCID.CultistDragonTail && npc.type != NPCID.AncientCultistSquidhead && - npc.type != NPCID.AncientLight && npc.type != NPCID.AncientDoom && npc.type != mod.NPCType("Eidolist")) - { - npc.active = false; - npc.netUpdate = true; - } - break; - case 19: - if (npc.type != mod.NPCType("CrabulonIdle") && npc.type != mod.NPCType("CrabShroom")) - { - npc.active = false; - npc.netUpdate = true; - } - break; - case 20: - if (npc.type != NPCID.Plantera && npc.type != NPCID.PlanterasTentacle && npc.type != NPCID.PlanterasHook && - npc.type != NPCID.Spore) - { - npc.active = false; - npc.netUpdate = true; - } - break; - case 21: - if (npc.type != mod.NPCType("CeaselessVoid") && npc.type != mod.NPCType("DarkEnergy") && - npc.type != mod.NPCType("DarkEnergy2") && npc.type != mod.NPCType("DarkEnergy3")) - { - npc.active = false; - npc.netUpdate = true; - } - break; - case 22: - if (npc.type != mod.NPCType("PerforatorHive") && npc.type != mod.NPCType("PerforatorHeadLarge") && - npc.type != mod.NPCType("PerforatorBodyLarge") && npc.type != mod.NPCType("PerforatorTailLarge") && - npc.type != mod.NPCType("PerforatorHeadMedium") && npc.type != mod.NPCType("PerforatorBodyMedium") && - npc.type != mod.NPCType("PerforatorTailMedium") && npc.type != mod.NPCType("PerforatorHeadSmall") && - npc.type != mod.NPCType("PerforatorBodySmall") && npc.type != mod.NPCType("PerforatorTailSmall")) - { - npc.active = false; - npc.netUpdate = true; - } - break; - case 23: - if (npc.type != mod.NPCType("Cryogen") && npc.type != mod.NPCType("CryogenIce") && - npc.type != mod.NPCType("IceMass") && npc.type != mod.NPCType("Cryocore") && - npc.type != mod.NPCType("Cryocore2")) - { - npc.active = false; - npc.netUpdate = true; - } - break; - case 24: - if (npc.type != mod.NPCType("BrimstoneElemental") && npc.type != mod.NPCType("Brimling")) - { - npc.active = false; - npc.netUpdate = true; - } - break; - case 25: - if (npc.type != mod.NPCType("CosmicWraith") && npc.type != mod.NPCType("SignusBomb") && - npc.type != mod.NPCType("CosmicLantern")) - { - npc.active = false; - npc.netUpdate = true; - } - break; - case 26: - if (npc.type != mod.NPCType("ScavengerBody") && npc.type != mod.NPCType("ScavengerHead") && - npc.type != mod.NPCType("ScavengerClawLeft") && npc.type != mod.NPCType("ScavengerClawRight") && - npc.type != mod.NPCType("ScavengerLegLeft") && npc.type != mod.NPCType("ScavengerLegRight") && - npc.type != mod.NPCType("ScavengerHead2") && npc.type != mod.NPCType("RockPillar") && - npc.type != mod.NPCType("FlamePillar")) - { - npc.active = false; - npc.netUpdate = true; - } - break; - case 27: - if (npc.type != NPCID.DukeFishron && npc.type != NPCID.DetonatingBubble && npc.type != NPCID.Sharkron && - npc.type != NPCID.Sharkron2) - { - npc.active = false; - npc.netUpdate = true; - } - break; - case 28: - if (npc.type != NPCID.MoonLordCore && npc.type != NPCID.MoonLordHead && npc.type != NPCID.MoonLordHand && - npc.type != NPCID.MoonLordFreeEye && npc.type != mod.NPCType("Eidolist")) - { - npc.active = false; - npc.netUpdate = true; - } - break; - case 29: - if (npc.type != mod.NPCType("AstrumDeusHead") && npc.type != mod.NPCType("AstrumDeusBody") && - npc.type != mod.NPCType("AstrumDeusTail") && npc.type != mod.NPCType("AstrumDeusHeadSpectral") && - npc.type != mod.NPCType("AstrumDeusBodySpectral") && npc.type != mod.NPCType("AstrumDeusTailSpectral") && - npc.type != mod.NPCType("AstrumDeusProbe") && npc.type != mod.NPCType("AstrumDeusProbe2") && - npc.type != mod.NPCType("AstrumDeusProbe3")) - { - npc.active = false; - npc.netUpdate = true; - } - break; - case 30: - if (npc.type != mod.NPCType("Polterghast") && npc.type != mod.NPCType("PhantomFuckYou") && - npc.type != mod.NPCType("PolterghastHook") && npc.type != mod.NPCType("PolterPhantom")) - { - npc.active = false; - npc.netUpdate = true; - } - break; - case 31: - if (npc.type != mod.NPCType("PlaguebringerGoliath") && npc.type != mod.NPCType("PlagueBeeG") && - npc.type != mod.NPCType("PlagueBeeLargeG") && npc.type != mod.NPCType("PlagueHomingMissile") && - npc.type != mod.NPCType("PlagueMine") && npc.type != mod.NPCType("PlaguebringerShade")) - { - npc.active = false; - npc.netUpdate = true; - } - break; - case 32: - if (npc.type != mod.NPCType("Calamitas") && npc.type != mod.NPCType("CalamitasRun") && - npc.type != mod.NPCType("CalamitasRun2") && npc.type != mod.NPCType("CalamitasRun3") && - npc.type != mod.NPCType("LifeSeeker") && npc.type != mod.NPCType("SoulSeeker")) - { - npc.active = false; - npc.netUpdate = true; - } - break; - case 33: - if (npc.type != mod.NPCType("Siren") && npc.type != mod.NPCType("Leviathan") && - npc.type != mod.NPCType("AquaticAberration") && npc.type != mod.NPCType("Parasea") && - npc.type != mod.NPCType("SirenClone") && npc.type != mod.NPCType("SirenIce")) - { - npc.active = false; - npc.netUpdate = true; - } - break; - case 34: - if (npc.type != mod.NPCType("SlimeGod") && npc.type != mod.NPCType("SlimeGodRun") && - npc.type != mod.NPCType("SlimeGodCore") && npc.type != mod.NPCType("SlimeGodSplit") && - npc.type != mod.NPCType("SlimeGodRunSplit") && npc.type != mod.NPCType("SlimeSpawnCorrupt") && - npc.type != mod.NPCType("SlimeSpawnCorrupt2") && npc.type != mod.NPCType("SlimeSpawnCrimson") && - npc.type != mod.NPCType("SlimeSpawnCrimson2")) - { - npc.active = false; - npc.netUpdate = true; - } - break; - case 35: - if (npc.type != mod.NPCType("Providence") && npc.type != mod.NPCType("ProvSpawnDefense") && - npc.type != mod.NPCType("ProvSpawnOffense") && npc.type != mod.NPCType("ProvSpawnHealer")) - { - npc.active = false; - npc.netUpdate = true; - } - break; - case 36: - if (npc.type != mod.NPCType("SupremeCalamitas") && npc.type != mod.NPCType("SCalWormBody") && - npc.type != mod.NPCType("SCalWormBodyWeak") && npc.type != mod.NPCType("SCalWormHead") && - npc.type != mod.NPCType("SCalWormTail") && npc.type != mod.NPCType("SoulSeekerSupreme") && - npc.type != mod.NPCType("SCalWormHeart") && npc.type != mod.NPCType("SupremeCataclysm") && - npc.type != mod.NPCType("SupremeCatastrophe")) - { - npc.active = false; - npc.netUpdate = true; - } - break; - case 37: - if (npc.type != mod.NPCType("Yharon") && npc.type != mod.NPCType("DetonatingFlare") && - npc.type != mod.NPCType("DetonatingFlare2") && npc.type != mod.NPCType("DetonatingFlare3") && - npc.type != mod.NPCType("Bumblefuck3") && npc.type != mod.NPCType("Bumblefuck4")) - { - npc.active = false; - npc.netUpdate = true; - } - break; - case 38: - if (npc.type != mod.NPCType("DevourerofGodsHeadS") && npc.type != mod.NPCType("DevourerofGodsBodyS") && - npc.type != mod.NPCType("DevourerofGodsTailS")) - { - npc.active = false; - npc.netUpdate = true; - } - break; - } - #region KSRush - if (npc.type == NPCID.KingSlime) - { - float num234 = 1f; - bool flag8 = false; - bool flag9 = false; - npc.aiAction = 0; - if (npc.ai[3] == 0f && npc.life > 0) - { - npc.ai[3] = (float)npc.lifeMax; - } - if (npc.localAI[3] == 0f && Main.netMode != 1) - { - npc.ai[0] = -100f; - npc.localAI[3] = 1f; - npc.TargetClosest(true); - npc.netUpdate = true; - } - if (Main.player[npc.target].dead) - { - npc.TargetClosest(true); - if (Main.player[npc.target].dead) - { - npc.timeLeft = 0; - if (Main.player[npc.target].Center.X < npc.Center.X) - { - npc.direction = 1; - } - else - { - npc.direction = -1; - } - } - } - if (!Main.player[npc.target].dead && npc.ai[2] >= 300f && npc.ai[1] < 5f && npc.velocity.Y == 0f) - { - npc.ai[2] = 0f; - npc.ai[0] = 0f; - npc.ai[1] = 5f; - if (Main.netMode != 1) - { - npc.TargetClosest(false); - Point point3 = npc.Center.ToTileCoordinates(); - Point point4 = Main.player[npc.target].Center.ToTileCoordinates(); - Vector2 vector30 = Main.player[npc.target].Center - npc.Center; - int num235 = 10; - int num236 = 0; - int num237 = 7; - int num238 = 0; - bool flag10 = false; - if (vector30.Length() > (enraged ? 1000f : 2000f)) - { - flag10 = true; - num238 = 100; - } - while (!flag10 && num238 < 100) - { - num238++; - int num239 = Main.rand.Next(point4.X - num235, point4.X + num235 + 1); - int num240 = Main.rand.Next(point4.Y - num235, point4.Y + 1); - if ((num240 < point4.Y - num237 || num240 > point4.Y + num237 || num239 < point4.X - num237 || num239 > point4.X + num237) && (num240 < point3.Y - num236 || num240 > point3.Y + num236 || num239 < point3.X - num236 || num239 > point3.X + num236) && !Main.tile[num239, num240].nactive()) - { - int num241 = num240; - int num242 = 0; - bool flag11 = Main.tile[num239, num241].nactive() && Main.tileSolid[(int)Main.tile[num239, num241].type] && !Main.tileSolidTop[(int)Main.tile[num239, num241].type]; - if (flag11) - { - num242 = 1; - } - else - { - while (num242 < 150 && num241 + num242 < Main.maxTilesY) - { - int num243 = num241 + num242; - bool flag12 = Main.tile[num239, num243].nactive() && Main.tileSolid[(int)Main.tile[num239, num243].type] && !Main.tileSolidTop[(int)Main.tile[num239, num243].type]; - if (flag12) - { - num242--; - break; - } - int num = num242; - num242 = num + 1; - } - } - num240 += num242; - bool flag13 = true; - if (flag13 && Main.tile[num239, num240].lava()) - { - flag13 = false; - } - if (flag13 && !Collision.CanHitLine(npc.Center, 0, 0, Main.player[npc.target].Center, 0, 0)) - { - flag13 = false; - } - if (flag13) - { - npc.localAI[1] = (float)(num239 * 16 + 8); - npc.localAI[2] = (float)(num240 * 16 + 16); - break; - } - } - } - if (num238 >= 100) - { - Vector2 bottom = Main.player[(int)Player.FindClosest(npc.position, npc.width, npc.height)].Bottom; - npc.localAI[1] = bottom.X; - npc.localAI[2] = bottom.Y; - } - } - } - if (!Collision.CanHitLine(npc.Center, 0, 0, Main.player[npc.target].Center, 0, 0)) - { - float[] var_9_AE8B_cp_0 = npc.ai; - int var_9_AE8B_cp_1 = 2; - float num244 = var_9_AE8B_cp_0[var_9_AE8B_cp_1]; - var_9_AE8B_cp_0[var_9_AE8B_cp_1] = num244 + 1f; - } - if (Math.Abs(npc.Top.Y - Main.player[npc.target].Bottom.Y) > 320f) - { - float[] var_9_AEDF_cp_0 = npc.ai; - int var_9_AEDF_cp_1 = 2; - float num244 = var_9_AEDF_cp_0[var_9_AEDF_cp_1]; - var_9_AEDF_cp_0[var_9_AEDF_cp_1] = num244 + 1f; - } - Dust dust; - if (npc.ai[1] == 5f) - { - flag8 = true; - npc.aiAction = 1; - float[] var_9_AF25_cp_0 = npc.ai; - int var_9_AF25_cp_1 = 0; - float num244 = var_9_AF25_cp_0[var_9_AF25_cp_1]; - var_9_AF25_cp_0[var_9_AF25_cp_1] = num244 + (enraged ? 2f : 1f); - num234 = MathHelper.Clamp((60f - npc.ai[0]) / 60f, 0f, 1f); - num234 = 0.5f + num234 * 0.5f; - if (npc.ai[0] >= 60f) - { - flag9 = true; - } - if (npc.ai[0] == 60f) - { - Gore.NewGore(npc.Center + new Vector2(-40f, (float)(-(float)npc.height / 2)), npc.velocity, 734, 1f); - } - if (npc.ai[0] >= 60f && Main.netMode != 1) - { - npc.Bottom = new Vector2(npc.localAI[1], npc.localAI[2]); - npc.ai[1] = 6f; - npc.ai[0] = 0f; - npc.netUpdate = true; - } - if (Main.netMode == 1 && npc.ai[0] >= 120f) - { - npc.ai[1] = 6f; - npc.ai[0] = 0f; - } - if (!flag9) - { - int num; - for (int num245 = 0; num245 < 10; num245 = num + 1) - { - int num246 = Dust.NewDust(npc.position + Vector2.UnitX * -20f, npc.width + 40, npc.height, 4, npc.velocity.X, npc.velocity.Y, 150, new Color(78, 136, 255, 80), 2f); - Main.dust[num246].noGravity = true; - dust = Main.dust[num246]; - dust.velocity *= 0.5f; - num = num245; - } - } - } - else if (npc.ai[1] == 6f) - { - flag8 = true; - npc.aiAction = 0; - float[] var_9_B163_cp_0 = npc.ai; - int var_9_B163_cp_1 = 0; - float num244 = var_9_B163_cp_0[var_9_B163_cp_1]; - var_9_B163_cp_0[var_9_B163_cp_1] = num244 + (enraged ? 2f : 1f); - num234 = MathHelper.Clamp(npc.ai[0] / 30f, 0f, 1f); - num234 = 0.5f + num234 * 0.5f; - if (npc.ai[0] >= 30f && Main.netMode != 1) - { - npc.ai[1] = 0f; - npc.ai[0] = 0f; - npc.netUpdate = true; - npc.TargetClosest(true); - } - if (Main.netMode == 1 && npc.ai[0] >= 60f) - { - npc.ai[1] = 0f; - npc.ai[0] = 0f; - npc.TargetClosest(true); - } - int num; - for (int num247 = 0; num247 < 10; num247 = num + 1) - { - int num248 = Dust.NewDust(npc.position + Vector2.UnitX * -20f, npc.width + 40, npc.height, 4, npc.velocity.X, npc.velocity.Y, 150, new Color(78, 136, 255, 80), 2f); - Main.dust[num248].noGravity = true; - dust = Main.dust[num248]; - dust.velocity *= 2f; - num = num247; - } - } - npc.dontTakeDamage = (npc.hide = flag9); - if (npc.velocity.Y == 0f) - { - npc.velocity.X = npc.velocity.X * 0.8f; - if ((double)npc.velocity.X > -0.1 && (double)npc.velocity.X < 0.1) - { - npc.velocity.X = 0f; - } - if (!flag8) - { - npc.ai[0] += enraged ? 4f : 2f; - if ((double)npc.life < (double)npc.lifeMax * 0.8) - { - npc.ai[0] += 1f; - } - if ((double)npc.life < (double)npc.lifeMax * 0.6) - { - npc.ai[0] += 1f; - } - if ((double)npc.life < (double)npc.lifeMax * 0.4) - { - npc.ai[0] += 2f; - } - if ((double)npc.life < (double)npc.lifeMax * 0.2) - { - npc.ai[0] += 3f; - } - if ((double)npc.life < (double)npc.lifeMax * 0.1) - { - npc.ai[0] += 4f; - } - if (npc.ai[0] >= 0f) - { - npc.netUpdate = true; - npc.TargetClosest(true); - if (npc.ai[1] == 3f) - { - npc.velocity.Y = -26f; - npc.velocity.X = npc.velocity.X + 7f * (float)npc.direction; - npc.ai[0] = -200f; - npc.ai[1] = 0f; - } - else if (npc.ai[1] == 2f) - { - npc.velocity.Y = -12f; - npc.velocity.X = npc.velocity.X + 9f * (float)npc.direction; - npc.ai[0] = -120f; - npc.ai[1] += 1f; - } - else - { - npc.velocity.Y = -16f; - npc.velocity.X = npc.velocity.X + 8f * (float)npc.direction; - npc.ai[0] = -120f; - npc.ai[1] += 1f; - } - } - else if (npc.ai[0] >= -30f) - { - npc.aiAction = 1; - } - } - } - else if (npc.target < 255 && ((npc.direction == 1 && npc.velocity.X < 3f) || (npc.direction == -1 && npc.velocity.X > -3f))) - { - if ((npc.direction == -1 && (double)npc.velocity.X < 0.1) || (npc.direction == 1 && (double)npc.velocity.X > -0.1)) - { - npc.velocity.X = npc.velocity.X + 0.2f * (float)npc.direction; - } - else - { - npc.velocity.X = npc.velocity.X * 0.93f; - } - } - int num249 = Dust.NewDust(npc.position, npc.width, npc.height, 4, npc.velocity.X, npc.velocity.Y, 255, new Color(0, 80, 255, 80), npc.scale * 1.2f); - Main.dust[num249].noGravity = true; - dust = Main.dust[num249]; - dust.velocity *= 0.5f; - if (npc.life > 0) - { - float num250 = (float)npc.life / (float)npc.lifeMax; - num250 = num250 * 0.5f + 0.75f; - num250 *= num234; - if (num250 != npc.scale) - { - npc.position.X = npc.position.X + (float)(npc.width / 2); - npc.position.Y = npc.position.Y + (float)npc.height; - npc.scale = num250; - npc.width = (int)(98f * npc.scale); - npc.height = (int)(92f * npc.scale); - npc.position.X = npc.position.X - (float)(npc.width / 2); - npc.position.Y = npc.position.Y - (float)npc.height; - } - if (Main.netMode != 1) - { - int num251 = (int)((double)npc.lifeMax * 0.05); - if ((float)(npc.life + num251) < npc.ai[3]) - { - npc.ai[3] = (float)npc.life; - int num252 = Main.rand.Next(1, 4); - int num; - for (int num253 = 0; num253 < num252; num253 = num + 1) - { - int x = (int)(npc.position.X + (float)Main.rand.Next(npc.width - 32)); - int y = (int)(npc.position.Y + (float)Main.rand.Next(npc.height - 32)); - int num254 = 1; - if (Main.rand.Next(4) == 0) - { - num254 = 535; - } - int num255 = NPC.NewNPC(x, y, num254, 0, 0f, 0f, 0f, 0f, 255); - Main.npc[num255].SetDefaults(num254, -1f); - Main.npc[num255].velocity.X = (float)Main.rand.Next(-15, 16) * 0.1f; - Main.npc[num255].velocity.Y = (float)Main.rand.Next(-30, 1) * 0.1f; - Main.npc[num255].ai[0] = (float)(-1000 * Main.rand.Next(3)); - Main.npc[num255].ai[1] = 0f; - if (Main.netMode == 2 && num255 < 200) - { - NetMessage.SendData(23, -1, -1, null, num255, 0f, 0f, 0f, 0, 0, 0); - } - num = num253; - } - return false; - } - } - } - return false; - } - #endregion - #region BoCRush - else if (npc.type == NPCID.BrainofCthulhu) - { - NPC.crimsonBoss = npc.whoAmI; - npc.dontTakeDamage = false; - if (Main.netMode != 1 && npc.localAI[0] == 0f) - { - npc.localAI[0] = 1f; - int num; - for (int num789 = 0; num789 < 20; num789 = num + 1) - { - float num790 = npc.Center.X; - float num791 = npc.Center.Y; - num790 += (float)Main.rand.Next(-npc.width, npc.width); - num791 += (float)Main.rand.Next(-npc.height, npc.height); - int num792 = NPC.NewNPC((int)num790, (int)num791, 267, 0, 0f, 0f, 0f, 0f, 255); - Main.npc[num792].velocity = new Vector2((float)Main.rand.Next(-30, 31) * 0.1f, (float)Main.rand.Next(-30, 31) * 0.1f); - Main.npc[num792].netUpdate = true; - num = num789; - } - } - if (npc.ai[0] < 0f) - { - if (npc.localAI[2] == 0f) - { - Main.PlaySound(3, (int)npc.position.X, (int)npc.position.Y, 1, 1f, 0f); - npc.localAI[2] = 1f; - Gore.NewGore(npc.position, new Vector2((float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f), 392, 1f); - Gore.NewGore(npc.position, new Vector2((float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f), 393, 1f); - Gore.NewGore(npc.position, new Vector2((float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f), 394, 1f); - Gore.NewGore(npc.position, new Vector2((float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f), 395, 1f); - int num; - for (int num794 = 0; num794 < 20; num794 = num + 1) - { - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f, 0, default(Color), 1f); - num = num794; - } - Main.PlaySound(15, (int)npc.position.X, (int)npc.position.Y, 0, 1f, 0f); - } - this.newAI[0] += 1f; - if (this.newAI[0] >= 60f) - { - this.newAI[0] = 0f; - if (Main.netMode != 1 && NPC.CountNPCS(NPCID.Creeper) < 15) - { - int creeper = NPC.NewNPC((int)(npc.position.X + (float)(npc.width / 2) + npc.velocity.X), (int)(npc.position.Y + (float)(npc.height / 2) + npc.velocity.Y), 267, 0, 0f, 0f, 0f, 0f, 255); - Main.npc[creeper].netUpdate = true; - } - npc.netUpdate = true; - } - npc.knockBackResist = 0f; - npc.TargetClosest(true); - Vector2 vector98 = new Vector2(npc.Center.X, npc.Center.Y); - float num795 = Main.player[npc.target].Center.X - vector98.X; - float num796 = Main.player[npc.target].Center.Y - vector98.Y; - float num797 = (float)Math.Sqrt((double)(num795 * num795 + num796 * num796)); - float num798 = (enraged ? 21f : 14f); - num797 = num798 / num797; - num795 *= num797; - num796 *= num797; - npc.velocity.X = (npc.velocity.X * 50f + num795) / 51f; - npc.velocity.Y = (npc.velocity.Y * 50f + num796) / 51f; - if (npc.ai[0] == -1f) - { - if (Main.netMode != 1) - { - npc.localAI[1] += 1f; - if (npc.justHit) - { - npc.localAI[1] -= (float)Main.rand.Next(5); - } - int num799 = 60 + Main.rand.Next(120); - if (Main.netMode != 0) - { - num799 += Main.rand.Next(30, 90); - } - if (npc.localAI[1] >= (float)num799) - { - npc.localAI[1] = 0f; - npc.TargetClosest(true); - int num800 = 0; - int num801; - int num802; - while (true) - { - num800++; - num801 = (int)Main.player[npc.target].Center.X / 16; - num802 = (int)Main.player[npc.target].Center.Y / 16; - if (Main.rand.Next(2) == 0) - { - num801 += Main.rand.Next(7, 13); - } - else - { - num801 -= Main.rand.Next(7, 13); - } - if (Main.rand.Next(2) == 0) - { - num802 += Main.rand.Next(7, 13); - } - else - { - num802 -= Main.rand.Next(7, 13); - } - if (!WorldGen.SolidTile(num801, num802)) - { - break; - } - if (num800 > 100) - { - goto Block_2784; - } - } - npc.ai[3] = 0f; - npc.ai[0] = -2f; - npc.ai[1] = (float)num801; - npc.ai[2] = (float)num802; - npc.netUpdate = true; - npc.netSpam = 0; - Block_2784:; - } - } - } - else if (npc.ai[0] == -2f) - { - npc.velocity *= 0.9f; - if (Main.netMode != 0) - { - npc.ai[3] += 15f; - } - else - { - npc.ai[3] += 25f; - } - if (npc.ai[3] >= 255f) - { - npc.ai[3] = 255f; - npc.position.X = npc.ai[1] * 16f - (float)(npc.width / 2); - npc.position.Y = npc.ai[2] * 16f - (float)(npc.height / 2); - Main.PlaySound(SoundID.Item8, npc.Center); - npc.ai[0] = -3f; - npc.netUpdate = true; - npc.netSpam = 0; - } - npc.alpha = (int)npc.ai[3]; - } - else if (npc.ai[0] == -3f) - { - if (Main.netMode != 0) - { - npc.ai[3] -= 15f; - } - else - { - npc.ai[3] -= 25f; - } - if (npc.ai[3] <= 0f) - { - npc.ai[3] = 0f; - npc.ai[0] = -1f; - npc.netUpdate = true; - npc.netSpam = 0; - } - npc.alpha = (int)npc.ai[3]; - } - } - else - { - npc.TargetClosest(true); - Vector2 vector99 = new Vector2(npc.Center.X, npc.Center.Y); - float num803 = Main.player[npc.target].Center.X - vector99.X; - float num804 = Main.player[npc.target].Center.Y - vector99.Y; - float num805 = (float)Math.Sqrt((double)(num803 * num803 + num804 * num804)); - float num806 = (enraged ? 3f : 2f); - if (num805 < num806) - { - npc.velocity.X = num803; - npc.velocity.Y = num804; - } - else - { - num805 = num806 / num805; - npc.velocity.X = num803 * num805; - npc.velocity.Y = num804 * num805; - } - if (npc.ai[0] == 0f) - { - if (Main.netMode != 1) - { - int num807 = 0; - int num; - for (int num808 = 0; num808 < 200; num808 = num + 1) - { - if (Main.npc[num808].active && Main.npc[num808].type == 267) - { - num807++; - } - num = num808; - } - if (num807 == 0) - { - npc.ai[0] = -1f; - npc.localAI[1] = 0f; - npc.alpha = 0; - npc.netUpdate = true; - } - npc.localAI[1] += 1f; - if (npc.localAI[1] >= (float)(120 + Main.rand.Next(120))) - { - npc.localAI[1] = 0f; - npc.TargetClosest(true); - int num809 = 0; - int num810; - int num811; - while (true) - { - num809++; - num810 = (int)Main.player[npc.target].Center.X / 16; - num811 = (int)Main.player[npc.target].Center.Y / 16; - num810 += Main.rand.Next(-50, 51); - num811 += Main.rand.Next(-50, 51); - if (!WorldGen.SolidTile(num810, num811) && Collision.CanHit(new Vector2((float)(num810 * 16), (float)(num811 * 16)), 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) - { - break; - } - if (num809 > 100) - { - goto Block_2801; - } - } - npc.ai[0] = 1f; - npc.ai[1] = (float)num810; - npc.ai[2] = (float)num811; - npc.netUpdate = true; - Block_2801:; - } - } - } - else if (npc.ai[0] == 1f) - { - npc.alpha += 5; - if (npc.alpha >= 255) - { - Main.PlaySound(SoundID.Item8, npc.Center); - npc.alpha = 255; - npc.position.X = npc.ai[1] * 16f - (float)(npc.width / 2); - npc.position.Y = npc.ai[2] * 16f - (float)(npc.height / 2); - npc.ai[0] = 2f; - } - } - else if (npc.ai[0] == 2f) - { - npc.alpha -= 5; - if (npc.alpha <= 0) - { - npc.alpha = 0; - npc.ai[0] = 0f; - } - } - } - if (Main.player[npc.target].dead) - { - if (npc.localAI[3] < 120f) - { - float[] var_9_29972_cp_0 = npc.localAI; - int var_9_29972_cp_1 = 3; - float num244 = var_9_29972_cp_0[var_9_29972_cp_1]; - var_9_29972_cp_0[var_9_29972_cp_1] = num244 + 1f; - } - if (npc.localAI[3] > 60f) - { - npc.velocity.Y = npc.velocity.Y + (npc.localAI[3] - 60f) * 0.25f; - } - npc.ai[0] = 2f; - npc.alpha = 10; - return false; - } - if (npc.localAI[3] > 0f) - { - float[] var_9_299F7_cp_0 = npc.localAI; - int var_9_299F7_cp_1 = 3; - float num244 = var_9_299F7_cp_0[var_9_299F7_cp_1]; - var_9_299F7_cp_0[var_9_299F7_cp_1] = num244 - 1f; - return false; - } - return false; - } - #endregion - #region EoWRush - else if (npc.type == NPCID.EaterofWorldsHead) - { - Main.player[npc.target].ZoneCorrupt = true; - npc.reflectingProjectiles = true; - if (!Main.player[npc.target].dead) - { - this.newAI[0] += (enraged ? 6f : 3f); - } - if (this.newAI[0] >= 180f) - { - this.newAI[0] = 0f; - if (Collision.CanHit(npc.Center, 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) - { - Vector2 vector34 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num349 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector34.X; - float num350 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector34.Y; - float num351 = (float)Math.Sqrt((double)(num349 * num349 + num350 * num350)); - num349 *= num351; - num350 *= num351; - if (Main.netMode != 1) - { - float num418 = (enraged ? 18f : 12f); - int num419 = 12; - int num420 = 96; - num351 = (float)Math.Sqrt((double)(num349 * num349 + num350 * num350)); - num351 = num418 / num351; - num349 *= num351; - num350 *= num351; - num349 += (float)Main.rand.Next(-40, 41) * 0.05f; - num350 += (float)Main.rand.Next(-40, 41) * 0.05f; - vector34.X += num349 * 4f; - vector34.Y += num350 * 4f; - Projectile.NewProjectile(vector34.X, vector34.Y, num349, num350, num420, num419, 0f, Main.myPlayer, 0f, 0f); - } - } - } - } - #endregion - #region QBRush - else if (npc.type == NPCID.QueenBee) - { - int num592 = 0; - int variable; - for (int num593 = 0; num593 < 255; num593 = variable + 1) - { - if (Main.player[num593].active && !Main.player[num593].dead && (npc.Center - Main.player[num593].Center).Length() < 1000f) - { - num592++; - } - variable = num593; - } - int num594 = (int)(20f * (1f - (float)npc.life / (float)npc.lifeMax)); - npc.defense = npc.defDefense + num594; - if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead || !Main.player[npc.target].active) - { - npc.TargetClosest(true); - } - bool dead4 = Main.player[npc.target].dead; - if (dead4) - { - if ((double)npc.position.Y < Main.worldSurface * 16.0 + 2000.0) - { - npc.velocity.Y = npc.velocity.Y + 0.04f; - } - if (npc.position.X < (float)(Main.maxTilesX * 8)) - { - npc.velocity.X = npc.velocity.X - 0.04f; - } - else - { - npc.velocity.X = npc.velocity.X + 0.04f; - } - if (npc.timeLeft > 10) - { - npc.timeLeft = 10; - return false; - } - } - else if (npc.ai[0] == -1f) - { - if (Main.netMode != 1) - { - float num595 = npc.ai[1]; - int num596; - do - { - num596 = Main.rand.Next(3); - if (num596 == 1) - { - num596 = 2; - } - else if (num596 == 2) - { - num596 = 3; - } - } - while ((float)num596 == num595); - npc.ai[0] = (float)num596; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - return false; - } - } - else if (npc.ai[0] == 0f) - { - int num597 = 5; - if (npc.ai[1] > (float)(2 * num597) && npc.ai[1] % 2f == 0f) - { - npc.ai[0] = -1f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.netUpdate = true; - return false; - } - if (npc.ai[1] % 2f == 0f) - { - npc.TargetClosest(true); - if (Math.Abs(npc.position.Y + (float)(npc.height / 2) - (Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2))) < 20f) - { - npc.localAI[0] = 1f; - npc.ai[1] += 1f; - npc.ai[2] = 0f; - float num598 = 24f; - Vector2 vector74 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num599 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector74.X; - float num600 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector74.Y; - float num601 = (float)Math.Sqrt((double)(num599 * num599 + num600 * num600)); - num601 = num598 / num601; - npc.velocity.X = num599 * num601; - npc.velocity.Y = num600 * num601; - npc.spriteDirection = npc.direction; - Main.PlaySound(15, (int)npc.position.X, (int)npc.position.Y, 0, 1f, 0f); - return false; - } - npc.localAI[0] = 0f; - float num602 = 18f; - float num603 = 0.4f; - if (npc.position.Y + (float)(npc.height / 2) < Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2)) - { - npc.velocity.Y = npc.velocity.Y + num603; - } - else - { - npc.velocity.Y = npc.velocity.Y - num603; - } - if (npc.velocity.Y < -12f) - { - npc.velocity.Y = -num602; - } - if (npc.velocity.Y > 12f) - { - npc.velocity.Y = num602; - } - if (Math.Abs(npc.position.X + (float)(npc.width / 2) - (Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2))) > 600f) - { - npc.velocity.X = npc.velocity.X + 0.15f * (float)npc.direction; - } - else if (Math.Abs(npc.position.X + (float)(npc.width / 2) - (Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2))) < 300f) - { - npc.velocity.X = npc.velocity.X - 0.15f * (float)npc.direction; - } - else - { - npc.velocity.X = npc.velocity.X * 0.8f; - } - if (npc.velocity.X < -16f) - { - npc.velocity.X = -16f; - } - if (npc.velocity.X > 16f) - { - npc.velocity.X = 16f; - } - npc.spriteDirection = npc.direction; - return false; - } - else - { - if (npc.velocity.X < 0f) - { - npc.direction = -1; - } - else - { - npc.direction = 1; - } - npc.spriteDirection = npc.direction; - int num604 = (enraged ? 150 : 250); - int num605 = 1; - if (npc.position.X + (float)(npc.width / 2) < Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2)) - { - num605 = -1; - } - if (npc.direction == num605 && Math.Abs(npc.position.X + (float)(npc.width / 2) - (Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2))) > (float)num604) - { - npc.ai[2] = 1f; - } - if (npc.ai[2] != 1f) - { - npc.localAI[0] = 1f; - return false; - } - npc.TargetClosest(true); - npc.spriteDirection = npc.direction; - npc.localAI[0] = 0f; - npc.velocity *= 0.9f; - float num606 = 0.25f; - if (npc.life < npc.lifeMax / 2) - { - npc.velocity *= 0.9f; - } - if (npc.life < npc.lifeMax / 3) - { - npc.velocity *= 0.9f; - } - if (npc.life < npc.lifeMax / 5) - { - npc.velocity *= 0.9f; - } - if (Math.Abs(npc.velocity.X) + Math.Abs(npc.velocity.Y) < num606) - { - npc.ai[2] = 0f; - npc.ai[1] += 1f; - return false; - } - } - } - else if (npc.ai[0] == 2f) - { - npc.TargetClosest(true); - npc.spriteDirection = npc.direction; - float num607 = 12f; - float num608 = 0.1f; - Vector2 vector75 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num609 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector75.X; - float num610 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - 200f - vector75.Y; - float num611 = (float)Math.Sqrt((double)(num609 * num609 + num610 * num610)); - if (num611 < 200f) - { - npc.ai[0] = 1f; - npc.ai[1] = 0f; - npc.netUpdate = true; - return false; - } - num611 = num607 / num611; - if (npc.velocity.X < num609) - { - npc.velocity.X = npc.velocity.X + num608; - if (npc.velocity.X < 0f && num609 > 0f) - { - npc.velocity.X = npc.velocity.X + num608; - } - } - else if (npc.velocity.X > num609) - { - npc.velocity.X = npc.velocity.X - num608; - if (npc.velocity.X > 0f && num609 < 0f) - { - npc.velocity.X = npc.velocity.X - num608; - } - } - if (npc.velocity.Y < num610) - { - npc.velocity.Y = npc.velocity.Y + num608; - if (npc.velocity.Y < 0f && num610 > 0f) - { - npc.velocity.Y = npc.velocity.Y + num608; - return false; - } - } - else if (npc.velocity.Y > num610) - { - npc.velocity.Y = npc.velocity.Y - num608; - if (npc.velocity.Y > 0f && num610 < 0f) - { - npc.velocity.Y = npc.velocity.Y - num608; - return false; - } - } - } - else if (npc.ai[0] == 1f) - { - npc.localAI[0] = 0f; - npc.TargetClosest(true); - Vector2 vector76 = new Vector2(npc.position.X + (float)(npc.width / 2) + (float)(Main.rand.Next(20) * npc.direction), npc.position.Y + (float)npc.height * 0.8f); - Vector2 vector77 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num612 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector77.X; - float num613 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector77.Y; - float num614 = (float)Math.Sqrt((double)(num612 * num612 + num613 * num613)); - npc.ai[1] += 1f; - npc.ai[1] += (float)(num592 / 2); - bool flag38 = false; - if (npc.ai[1] > 10f) - { - npc.ai[1] = 0f; - float[] var_9_2174E_cp_0 = npc.ai; - int var_9_2174E_cp_1 = 2; - float num244 = var_9_2174E_cp_0[var_9_2174E_cp_1]; - var_9_2174E_cp_0[var_9_2174E_cp_1] = num244 + 1f; - flag38 = true; - } - if (Collision.CanHit(vector76, 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height) && flag38) - { - Main.PlaySound(3, (int)npc.position.X, (int)npc.position.Y, 1, 1f, 0f); - if (Main.netMode != 1) - { - int num615 = Main.rand.Next(210, 212); - int num616 = NPC.NewNPC((int)vector76.X, (int)vector76.Y, num615, 0, 0f, 0f, 0f, 0f, 255); - Main.npc[num616].velocity.X = (float)Main.rand.Next(-200, 201) * 0.002f; - Main.npc[num616].velocity.Y = (float)Main.rand.Next(-200, 201) * 0.002f; - Main.npc[num616].localAI[0] = 60f; - Main.npc[num616].netUpdate = true; - } - } - if (num614 > 400f || !Collision.CanHit(new Vector2(vector76.X, vector76.Y - 30f), 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) - { - float num617 = 14f; - float num618 = 0.1f; - vector77 = vector76; - num612 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector77.X; - num613 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector77.Y; - num614 = (float)Math.Sqrt((double)(num612 * num612 + num613 * num613)); - num614 = num617 / num614; - if (npc.velocity.X < num612) - { - npc.velocity.X = npc.velocity.X + num618; - if (npc.velocity.X < 0f && num612 > 0f) - { - npc.velocity.X = npc.velocity.X + num618; - } - } - else if (npc.velocity.X > num612) - { - npc.velocity.X = npc.velocity.X - num618; - if (npc.velocity.X > 0f && num612 < 0f) - { - npc.velocity.X = npc.velocity.X - num618; - } - } - if (npc.velocity.Y < num613) - { - npc.velocity.Y = npc.velocity.Y + num618; - if (npc.velocity.Y < 0f && num613 > 0f) - { - npc.velocity.Y = npc.velocity.Y + num618; - } - } - else if (npc.velocity.Y > num613) - { - npc.velocity.Y = npc.velocity.Y - num618; - if (npc.velocity.Y > 0f && num613 < 0f) - { - npc.velocity.Y = npc.velocity.Y - num618; - } - } - } - else - { - npc.velocity *= 0.9f; - } - npc.spriteDirection = npc.direction; - if (npc.ai[2] > 5f) - { - npc.ai[0] = -1f; - npc.ai[1] = 1f; - npc.netUpdate = true; - return false; - } - } - else if (npc.ai[0] == 3f) - { - float num619 = 6f; - float num620 = 0.075f; - Vector2 vector78 = new Vector2(npc.position.X + (float)(npc.width / 2) + (float)(Main.rand.Next(20) * npc.direction), npc.position.Y + (float)npc.height * 0.8f); - Vector2 vector79 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num621 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector79.X; - float num622 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - 300f - vector79.Y; - float num623 = (float)Math.Sqrt((double)(num621 * num621 + num622 * num622)); - npc.ai[1] += 1f; - bool flag39 = false; - if (npc.ai[1] % 15f == 14f) - { - flag39 = true; - } - if (flag39 && npc.position.Y + (float)npc.height < Main.player[npc.target].position.Y && Collision.CanHit(vector78, 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) - { - Main.PlaySound(SoundID.Item17, npc.position); - if (Main.netMode != 1) - { - float num624 = (enraged ? 24f : 16f); - float num625 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector78.X + (float)Main.rand.Next(-80, 81); - float num626 = Main.player[npc.target].position.Y + (float)Main.player[npc.target].height * 0.5f - vector78.Y + (float)Main.rand.Next(-40, 41); - float num627 = (float)Math.Sqrt((double)(num625 * num625 + num626 * num626)); - num627 = num624 / num627; - num625 *= num627; - num626 *= num627; - int num628 = 11; - int num629 = 55; - int num630 = Projectile.NewProjectile(vector78.X, vector78.Y, num625, num626, num629, num628, 0f, Main.myPlayer, 0f, 0f); - Main.projectile[num630].timeLeft = 300; - } - } - if (!Collision.CanHit(new Vector2(vector78.X, vector78.Y - 30f), 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) - { - num619 = 14f; - num620 = 0.1f; - vector79 = vector78; - num621 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector79.X; - num622 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector79.Y; - num623 = (float)Math.Sqrt((double)(num621 * num621 + num622 * num622)); - num623 = num619 / num623; - if (npc.velocity.X < num621) - { - npc.velocity.X = npc.velocity.X + num620; - if (npc.velocity.X < 0f && num621 > 0f) - { - npc.velocity.X = npc.velocity.X + num620; - } - } - else if (npc.velocity.X > num621) - { - npc.velocity.X = npc.velocity.X - num620; - if (npc.velocity.X > 0f && num621 < 0f) - { - npc.velocity.X = npc.velocity.X - num620; - } - } - if (npc.velocity.Y < num622) - { - npc.velocity.Y = npc.velocity.Y + num620; - if (npc.velocity.Y < 0f && num622 > 0f) - { - npc.velocity.Y = npc.velocity.Y + num620; - } - } - else if (npc.velocity.Y > num622) - { - npc.velocity.Y = npc.velocity.Y - num620; - if (npc.velocity.Y > 0f && num622 < 0f) - { - npc.velocity.Y = npc.velocity.Y - num620; - } - } - } - else if (num623 > 100f) - { - npc.TargetClosest(true); - npc.spriteDirection = npc.direction; - num623 = num619 / num623; - if (npc.velocity.X < num621) - { - npc.velocity.X = npc.velocity.X + num620; - if (npc.velocity.X < 0f && num621 > 0f) - { - npc.velocity.X = npc.velocity.X + num620 * 2f; - } - } - else if (npc.velocity.X > num621) - { - npc.velocity.X = npc.velocity.X - num620; - if (npc.velocity.X > 0f && num621 < 0f) - { - npc.velocity.X = npc.velocity.X - num620 * 2f; - } - } - if (npc.velocity.Y < num622) - { - npc.velocity.Y = npc.velocity.Y + num620; - if (npc.velocity.Y < 0f && num622 > 0f) - { - npc.velocity.Y = npc.velocity.Y + num620 * 2f; - } - } - else if (npc.velocity.Y > num622) - { - npc.velocity.Y = npc.velocity.Y - num620; - if (npc.velocity.Y > 0f && num622 < 0f) - { - npc.velocity.Y = npc.velocity.Y - num620 * 2f; - } - } - } - if (npc.ai[1] > 400f) - { - npc.ai[0] = -1f; - npc.ai[1] = 3f; - npc.netUpdate = true; - return false; - } - } - return false; - } - #endregion - #region DFRush - else if (npc.type == NPCID.DukeFishron) - { - if (npc.ai[0] == -1f || npc.ai[0] == 4f || npc.ai[0] == 9f) - { - npc.dontTakeDamage = true; - } - else if (npc.ai[0] <= 8f) - { - npc.dontTakeDamage = false; - } - float newDamage = (0.6f * Main.damageMultiplier); - bool flag = (double)npc.life <= (double)npc.lifeMax * 0.99; - bool flag2 = (double)npc.life <= (double)npc.lifeMax * 0.15; - bool flag3 = npc.ai[0] > 4f; - bool flag4 = npc.ai[0] > 9f; - bool flag5 = npc.ai[3] < 10f; - Vector2 vector = npc.Center; - if (flag4) - { - this.newAI[0] += 1f; - if (this.newAI[0] >= 480f) - { - this.newAI[0] = 0f; - if (Main.netMode != 1) - { - Projectile.NewProjectile(vector.X, vector.Y, 0f, 0f, 385, 0, 0f, Main.myPlayer, 1f, (float)(npc.target + 1)); - } - npc.netUpdate = true; - } - npc.damage = (int)((float)npc.defDamage * 1.5f * newDamage); - npc.defense = 38; - } - else if (flag3) - { - npc.damage = (int)((float)npc.defDamage * 2.2f * newDamage); - npc.defense = (int)((float)npc.defDefense * 0.8f); - } - else - { - npc.damage = npc.defDamage; - npc.defense = npc.defDefense; - } - int num2 = 35; - float num3 = 0.65f; - float scaleFactor = 9.5f; - if (flag4) - { - num3 = (enraged ? 0.9f : 0.8f); - scaleFactor = (enraged ? 15f : 13f); - num2 = (enraged ? 22 : 25); - } - else if (flag3 & flag5) - { - num3 = (enraged ? 0.8f : 0.7f); - scaleFactor = (enraged ? 13f : 11f); - num2 = (enraged ? 30 : 35); - } - else if (flag5 && !flag3 && !flag4) - { - num2 = 25; - } - int num4 = 24; - float num5 = 18f; - if (flag4) - { - num4 = (enraged ? 18 : 20); - num5 = (enraged ? 30f : 28f); - } - else if (flag5 & flag3) - { - num4 = (enraged ? 21 : 23); - num5 = (enraged ? 25f : 22f); - } - int num6 = 80; - int num7 = 4; - float num8 = 0.3f; - float scaleFactor2 = 5f; - int num9 = 90; - int num10 = 180; - int num11 = 180; - int num12 = 30; - int num13 = 120; - int num14 = 4; - float scaleFactor3 = 6f; - float scaleFactor4 = 20f; - float num15 = 6.28318548f / (float)(num13 / 2); - int num16 = 75; - Player player = Main.player[npc.target]; - if (npc.target < 0 || npc.target == 255 || player.dead || !player.active) - { - npc.TargetClosest(true); - player = Main.player[npc.target]; - npc.netUpdate = true; - } - if (player.dead || Vector2.Distance(player.Center, vector) > 5600f) - { - npc.velocity.Y = npc.velocity.Y - 0.4f; - if (npc.timeLeft > 10) - { - npc.timeLeft = 10; - } - if (npc.ai[0] > 4f) - { - npc.ai[0] = 5f; - } - else - { - npc.ai[0] = 0f; - } - npc.ai[2] = 0f; - } - if (player.position.Y < 800f || (double)player.position.Y > Main.worldSurface * 16.0 || (player.position.X > 6400f && player.position.X < (float)(Main.maxTilesX * 16 - 6400))) - { - num2 = 20; - num5 += 6f; - } - if (npc.localAI[0] == 0f) - { - npc.localAI[0] = 1f; - npc.alpha = 255; - npc.rotation = 0f; - if (Main.netMode != 1) - { - npc.ai[0] = -1f; - npc.netUpdate = true; - } - } - float num17 = (float)Math.Atan2((double)(player.Center.Y - vector.Y), (double)(player.Center.X - vector.X)); - if (npc.spriteDirection == 1) - { - num17 += 3.14159274f; - } - if (num17 < 0f) - { - num17 += 6.28318548f; - } - if (num17 > 6.28318548f) - { - num17 -= 6.28318548f; - } - if (npc.ai[0] == -1f) - { - num17 = 0f; - } - if (npc.ai[0] == 3f) - { - num17 = 0f; - } - if (npc.ai[0] == 4f) - { - num17 = 0f; - } - if (npc.ai[0] == 8f) - { - num17 = 0f; - } - float num18 = 0.04f; - if (npc.ai[0] == 1f || npc.ai[0] == 6f) - { - num18 = 0f; - } - if (npc.ai[0] == 7f) - { - num18 = 0f; - } - if (npc.ai[0] == 3f) - { - num18 = 0.01f; - } - if (npc.ai[0] == 4f) - { - num18 = 0.01f; - } - if (npc.ai[0] == 8f) - { - num18 = 0.01f; - } - if (npc.rotation < num17) - { - if ((double)(num17 - npc.rotation) > 3.1415926535897931) - { - npc.rotation -= num18; - } - else - { - npc.rotation += num18; - } - } - if (npc.rotation > num17) - { - if ((double)(npc.rotation - num17) > 3.1415926535897931) - { - npc.rotation += num18; - } - else - { - npc.rotation -= num18; - } - } - if (npc.rotation > num17 - num18 && npc.rotation < num17 + num18) - { - npc.rotation = num17; - } - if (npc.rotation < 0f) - { - npc.rotation += 6.28318548f; - } - if (npc.rotation > 6.28318548f) - { - npc.rotation -= 6.28318548f; - } - if (npc.rotation > num17 - num18 && npc.rotation < num17 + num18) - { - npc.rotation = num17; - } - if (npc.ai[0] != -1f && npc.ai[0] < 9f) - { - if (Collision.SolidCollision(npc.position, npc.width, npc.height)) - { - npc.alpha += 15; - } - else - { - npc.alpha -= 15; - } - if (npc.alpha < 0) - { - npc.alpha = 0; - } - if (npc.alpha > 150) - { - npc.alpha = 150; - } - } - if (npc.ai[0] == -1f) - { - npc.velocity *= 0.98f; - int num19 = Math.Sign(player.Center.X - vector.X); - if (num19 != 0) - { - npc.direction = num19; - npc.spriteDirection = -npc.direction; - } - if (npc.ai[2] > 20f) - { - npc.velocity.Y = -2f; - npc.alpha -= 5; - if (Collision.SolidCollision(npc.position, npc.width, npc.height)) - { - npc.alpha += 15; - } - if (npc.alpha < 0) - { - npc.alpha = 0; - } - if (npc.alpha > 150) - { - npc.alpha = 150; - } - } - if (npc.ai[2] == (float)(num9 - 30)) - { - int num20 = 36; - for (int i = 0; i < num20; i++) - { - Vector2 expr_80F = (Vector2.Normalize(npc.velocity) * new Vector2((float)npc.width / 2f, (float)npc.height) * 0.75f * 0.5f).RotatedBy((double)((float)(i - (num20 / 2 - 1)) * 6.28318548f / (float)num20), default(Vector2)) + npc.Center; - Vector2 vector2 = expr_80F - npc.Center; - int num21 = Dust.NewDust(expr_80F + vector2, 0, 0, 172, vector2.X * 2f, vector2.Y * 2f, 100, default(Color), 1.4f); - Main.dust[num21].noGravity = true; - Main.dust[num21].noLight = true; - Main.dust[num21].velocity = Vector2.Normalize(vector2) * 3f; - } - Main.PlaySound(29, (int)vector.X, (int)vector.Y, 20, 1f, 0f); - } - npc.ai[2] += 1f; - if (npc.ai[2] >= (float)num16) - { - npc.ai[0] = 0f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.netUpdate = true; - return false; - } - } - else if (npc.ai[0] == 0f && !player.dead) - { - if (npc.ai[1] == 0f) - { - npc.ai[1] = (float)(300 * Math.Sign((vector - player.Center).X)); - } - Vector2 vector3 = Vector2.Normalize(player.Center + new Vector2(npc.ai[1], -200f) - vector - npc.velocity) * scaleFactor; - if (npc.velocity.X < vector3.X) - { - npc.velocity.X = npc.velocity.X + num3; - if (npc.velocity.X < 0f && vector3.X > 0f) - { - npc.velocity.X = npc.velocity.X + num3; - } - } - else if (npc.velocity.X > vector3.X) - { - npc.velocity.X = npc.velocity.X - num3; - if (npc.velocity.X > 0f && vector3.X < 0f) - { - npc.velocity.X = npc.velocity.X - num3; - } - } - if (npc.velocity.Y < vector3.Y) - { - npc.velocity.Y = npc.velocity.Y + num3; - if (npc.velocity.Y < 0f && vector3.Y > 0f) - { - npc.velocity.Y = npc.velocity.Y + num3; - } - } - else if (npc.velocity.Y > vector3.Y) - { - npc.velocity.Y = npc.velocity.Y - num3; - if (npc.velocity.Y > 0f && vector3.Y < 0f) - { - npc.velocity.Y = npc.velocity.Y - num3; - } - } - int num22 = Math.Sign(player.Center.X - vector.X); - if (num22 != 0) - { - if (npc.ai[2] == 0f && num22 != npc.direction) - { - npc.rotation += 3.14159274f; - } - npc.direction = num22; - if (npc.spriteDirection != -npc.direction) - { - npc.rotation += 3.14159274f; - } - npc.spriteDirection = -npc.direction; - } - npc.ai[2] += 1f; - if (npc.ai[2] >= (float)num2) - { - int num23 = 0; - switch ((int)npc.ai[3]) - { - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - num23 = 1; - break; - case 10: - npc.ai[3] = 1f; - num23 = 2; - break; - case 11: - npc.ai[3] = 0f; - num23 = 3; - break; - } - if (flag) - { - num23 = 4; - } - if (num23 == 1) - { - npc.ai[0] = 1f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.velocity = Vector2.Normalize(player.Center - vector) * num5; - npc.rotation = (float)Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X); - if (num22 != 0) - { - npc.direction = num22; - if (npc.spriteDirection == 1) - { - npc.rotation += 3.14159274f; - } - npc.spriteDirection = -npc.direction; - } - } - else if (num23 == 2) - { - npc.ai[0] = 2f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - } - else if (num23 == 3) - { - npc.ai[0] = 3f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - } - else if (num23 == 4) - { - npc.ai[0] = 4f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - } - npc.netUpdate = true; - return false; - } - } - else if (npc.ai[0] == 1f) - { - int num24 = 7; - for (int j = 0; j < num24; j++) - { - Vector2 arg_E1C_0 = (Vector2.Normalize(npc.velocity) * new Vector2((float)(npc.width + 50) / 2f, (float)npc.height) * 0.75f).RotatedBy((double)(j - (num24 / 2 - 1)) * 3.1415926535897931 / (double)((float)num24), default(Vector2)) + vector; - Vector2 vector4 = ((float)(Main.rand.NextDouble() * 3.1415927410125732) - 1.57079637f).ToRotationVector2() * (float)Main.rand.Next(3, 8); - int num25 = Dust.NewDust(arg_E1C_0 + vector4, 0, 0, 172, vector4.X * 2f, vector4.Y * 2f, 100, default(Color), 1.4f); - Main.dust[num25].noGravity = true; - Main.dust[num25].noLight = true; - Main.dust[num25].velocity /= 4f; - Main.dust[num25].velocity -= npc.velocity; - } - npc.ai[2] += 1f; - if (npc.ai[2] >= (float)num4) - { - npc.ai[0] = 0f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] += 2f; - npc.netUpdate = true; - return false; - } - } - else if (npc.ai[0] == 2f) - { - if (npc.ai[1] == 0f) - { - npc.ai[1] = (float)(300 * Math.Sign((vector - player.Center).X)); - } - Vector2 vector5 = Vector2.Normalize(player.Center + new Vector2(npc.ai[1], -200f) - vector - npc.velocity) * scaleFactor2; - if (npc.velocity.X < vector5.X) - { - npc.velocity.X = npc.velocity.X + num8; - if (npc.velocity.X < 0f && vector5.X > 0f) - { - npc.velocity.X = npc.velocity.X + num8; - } - } - else if (npc.velocity.X > vector5.X) - { - npc.velocity.X = npc.velocity.X - num8; - if (npc.velocity.X > 0f && vector5.X < 0f) - { - npc.velocity.X = npc.velocity.X - num8; - } - } - if (npc.velocity.Y < vector5.Y) - { - npc.velocity.Y = npc.velocity.Y + num8; - if (npc.velocity.Y < 0f && vector5.Y > 0f) - { - npc.velocity.Y = npc.velocity.Y + num8; - } - } - else if (npc.velocity.Y > vector5.Y) - { - npc.velocity.Y = npc.velocity.Y - num8; - if (npc.velocity.Y > 0f && vector5.Y < 0f) - { - npc.velocity.Y = npc.velocity.Y - num8; - } - } - if (npc.ai[2] == 0f) - { - Main.PlaySound(29, (int)vector.X, (int)vector.Y, 20, 1f, 0f); - } - if (npc.ai[2] % (float)num7 == 0f) - { - Main.PlaySound(4, (int)npc.Center.X, (int)npc.Center.Y, 19, 1f, 0f); - if (Main.netMode != 1) - { - Vector2 vector6 = Vector2.Normalize(player.Center - vector) * (float)(npc.width + 20) / 2f + vector; - NPC.NewNPC((int)vector6.X, (int)vector6.Y + 45, 371, 0, 0f, 0f, 0f, 0f, 255); - } - } - int num26 = Math.Sign(player.Center.X - vector.X); - if (num26 != 0) - { - npc.direction = num26; - if (npc.spriteDirection != -npc.direction) - { - npc.rotation += 3.14159274f; - } - npc.spriteDirection = -npc.direction; - } - npc.ai[2] += 1f; - if (npc.ai[2] >= (float)num6) - { - npc.ai[0] = 0f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.netUpdate = true; - return false; - } - } - else if (npc.ai[0] == 3f) - { - npc.velocity *= 0.98f; - npc.velocity.Y = MathHelper.Lerp(npc.velocity.Y, 0f, 0.02f); - if (npc.ai[2] == (float)(num9 - 30)) - { - Main.PlaySound(29, (int)vector.X, (int)vector.Y, 9, 1f, 0f); - } - if (Main.netMode != 1 && npc.ai[2] == (float)(num9 - 30)) - { - Vector2 vector7 = npc.rotation.ToRotationVector2() * (Vector2.UnitX * (float)npc.direction) * (float)(npc.width + 20) / 2f + vector; - Projectile.NewProjectile(vector7.X, vector7.Y, (float)(npc.direction * 2), 8f, 385, 0, 0f, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(vector7.X, vector7.Y, (float)(-(float)npc.direction * 2), 8f, 385, 0, 0f, Main.myPlayer, 0f, 0f); - } - npc.ai[2] += 1f; - if (npc.ai[2] >= (float)num9) - { - npc.ai[0] = 0f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.netUpdate = true; - return false; - } - } - else if (npc.ai[0] == 4f) - { - npc.velocity *= 0.98f; - npc.velocity.Y = MathHelper.Lerp(npc.velocity.Y, 0f, 0.02f); - if (npc.ai[2] == (float)(num10 - 60)) - { - Main.PlaySound(29, (int)vector.X, (int)vector.Y, 20, 1f, 0f); - } - npc.ai[2] += 1f; - if (npc.ai[2] >= (float)num10) - { - npc.ai[0] = 5f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] = 0f; - npc.netUpdate = true; - return false; - } - } - else if (npc.ai[0] == 5f && !player.dead) - { - if (npc.ai[1] == 0f) - { - npc.ai[1] = (float)(300 * Math.Sign((vector - player.Center).X)); - } - Vector2 vector8 = Vector2.Normalize(player.Center + new Vector2(npc.ai[1], -200f) - vector - npc.velocity) * scaleFactor; - if (npc.velocity.X < vector8.X) - { - npc.velocity.X = npc.velocity.X + num3; - if (npc.velocity.X < 0f && vector8.X > 0f) - { - npc.velocity.X = npc.velocity.X + num3; - } - } - else if (npc.velocity.X > vector8.X) - { - npc.velocity.X = npc.velocity.X - num3; - if (npc.velocity.X > 0f && vector8.X < 0f) - { - npc.velocity.X = npc.velocity.X - num3; - } - } - if (npc.velocity.Y < vector8.Y) - { - npc.velocity.Y = npc.velocity.Y + num3; - if (npc.velocity.Y < 0f && vector8.Y > 0f) - { - npc.velocity.Y = npc.velocity.Y + num3; - } - } - else if (npc.velocity.Y > vector8.Y) - { - npc.velocity.Y = npc.velocity.Y - num3; - if (npc.velocity.Y > 0f && vector8.Y < 0f) - { - npc.velocity.Y = npc.velocity.Y - num3; - } - } - int num27 = Math.Sign(player.Center.X - vector.X); - if (num27 != 0) - { - if (npc.ai[2] == 0f && num27 != npc.direction) - { - npc.rotation += 3.14159274f; - } - npc.direction = num27; - if (npc.spriteDirection != -npc.direction) - { - npc.rotation += 3.14159274f; - } - npc.spriteDirection = -npc.direction; - } - npc.ai[2] += 1f; - if (npc.ai[2] >= (float)num2) - { - int num28 = 0; - switch ((int)npc.ai[3]) - { - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - num28 = 1; - break; - case 6: - npc.ai[3] = 1f; - num28 = 2; - break; - case 7: - npc.ai[3] = 0f; - num28 = 3; - break; - } - if (flag2) - { - num28 = 4; - } - if (num28 == 1) - { - npc.ai[0] = 6f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.velocity = Vector2.Normalize(player.Center - vector) * num5; - npc.rotation = (float)Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X); - if (num27 != 0) - { - npc.direction = num27; - if (npc.spriteDirection == 1) - { - npc.rotation += 3.14159274f; - } - npc.spriteDirection = -npc.direction; - } - } - else if (num28 == 2) - { - npc.velocity = Vector2.Normalize(player.Center - vector) * scaleFactor4; - npc.rotation = (float)Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X); - if (num27 != 0) - { - npc.direction = num27; - if (npc.spriteDirection == 1) - { - npc.rotation += 3.14159274f; - } - npc.spriteDirection = -npc.direction; - } - npc.ai[0] = 7f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - } - else if (num28 == 3) - { - npc.ai[0] = 8f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - } - else if (num28 == 4) - { - npc.ai[0] = 9f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - } - npc.netUpdate = true; - return false; - } - } - else if (npc.ai[0] == 6f) - { - int num29 = 7; - for (int k = 0; k < num29; k++) - { - Vector2 arg_1A97_0 = (Vector2.Normalize(npc.velocity) * new Vector2((float)(npc.width + 50) / 2f, (float)npc.height) * 0.75f).RotatedBy((double)(k - (num29 / 2 - 1)) * 3.1415926535897931 / (double)((float)num29), default(Vector2)) + vector; - Vector2 vector9 = ((float)(Main.rand.NextDouble() * 3.1415927410125732) - 1.57079637f).ToRotationVector2() * (float)Main.rand.Next(3, 8); - int num30 = Dust.NewDust(arg_1A97_0 + vector9, 0, 0, 172, vector9.X * 2f, vector9.Y * 2f, 100, default(Color), 1.4f); - Main.dust[num30].noGravity = true; - Main.dust[num30].noLight = true; - Main.dust[num30].velocity /= 4f; - Main.dust[num30].velocity -= npc.velocity; - } - npc.ai[2] += 1f; - if (npc.ai[2] >= (float)num4) - { - npc.ai[0] = 5f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] += 2f; - npc.netUpdate = true; - return false; - } - } - else if (npc.ai[0] == 7f) - { - if (npc.ai[2] == 0f) - { - Main.PlaySound(29, (int)vector.X, (int)vector.Y, 20, 1f, 0f); - } - if (npc.ai[2] % (float)num14 == 0f) - { - Main.PlaySound(4, (int)npc.Center.X, (int)npc.Center.Y, 19, 1f, 0f); - if (Main.netMode != 1) - { - Vector2 vector10 = Vector2.Normalize(npc.velocity) * (float)(npc.width + 20) / 2f + vector; - int num31 = NPC.NewNPC((int)vector10.X, (int)vector10.Y + 45, 371, 0, 0f, 0f, 0f, 0f, 255); - Main.npc[num31].target = npc.target; - Main.npc[num31].velocity = Vector2.Normalize(npc.velocity).RotatedBy((double)(1.57079637f * (float)npc.direction), default(Vector2)) * scaleFactor3; - Main.npc[num31].netUpdate = true; - Main.npc[num31].ai[3] = (float)Main.rand.Next(80, 121) / 100f; - } - } - npc.velocity = npc.velocity.RotatedBy((double)(-(double)num15 * (float)npc.direction), default(Vector2)); - npc.rotation -= num15 * (float)npc.direction; - npc.ai[2] += 1f; - if (npc.ai[2] >= (float)num13) - { - npc.ai[0] = 5f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.netUpdate = true; - return false; - } - } - else if (npc.ai[0] == 8f) - { - npc.velocity *= 0.98f; - npc.velocity.Y = MathHelper.Lerp(npc.velocity.Y, 0f, 0.02f); - if (npc.ai[2] == (float)(num9 - 30)) - { - Main.PlaySound(29, (int)vector.X, (int)vector.Y, 20, 1f, 0f); - } - if (Main.netMode != 1 && npc.ai[2] == (float)(num9 - 30)) - { - Projectile.NewProjectile(vector.X, vector.Y, 0f, 0f, 385, 0, 0f, Main.myPlayer, 1f, (float)(npc.target + 1)); - } - npc.ai[2] += 1f; - if (npc.ai[2] >= (float)num9) - { - npc.ai[0] = 5f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.netUpdate = true; - return false; - } - } - else if (npc.ai[0] == 9f) - { - if (npc.ai[2] < (float)(num11 - 90)) - { - if (Collision.SolidCollision(npc.position, npc.width, npc.height)) - { - npc.alpha += 15; - } - else - { - npc.alpha -= 15; - } - if (npc.alpha < 0) - { - npc.alpha = 0; - } - if (npc.alpha > 150) - { - npc.alpha = 150; - } - } - else if (npc.alpha < 255) - { - npc.alpha += 4; - if (npc.alpha > 255) - { - npc.alpha = 255; - } - } - npc.velocity *= 0.98f; - npc.velocity.Y = MathHelper.Lerp(npc.velocity.Y, 0f, 0.02f); - if (npc.ai[2] == (float)(num11 - 60)) - { - Main.PlaySound(29, (int)vector.X, (int)vector.Y, 20, 1f, 0f); - } - npc.ai[2] += 1f; - if (npc.ai[2] >= (float)num11) - { - npc.ai[0] = 10f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] = 0f; - npc.netUpdate = true; - return false; - } - } - else if (npc.ai[0] == 10f && !player.dead) - { - npc.dontTakeDamage = false; - npc.chaseable = false; - if (npc.alpha < 255) - { - npc.alpha += 25; - if (npc.alpha > 255) - { - npc.alpha = 255; - } - } - if (npc.ai[1] == 0f) - { - npc.ai[1] = (float)(360 * Math.Sign((vector - player.Center).X)); - } - Vector2 desiredVelocity = Vector2.Normalize(player.Center + new Vector2(npc.ai[1], -200f) - vector - npc.velocity) * scaleFactor; - npc.SimpleFlyMovement(desiredVelocity, num3); - int num32 = Math.Sign(player.Center.X - vector.X); - if (num32 != 0) - { - if (npc.ai[2] == 0f && num32 != npc.direction) - { - npc.rotation += 3.14159274f; - for (int l = 0; l < npc.oldPos.Length; l++) - { - npc.oldPos[l] = Vector2.Zero; - } - } - npc.direction = num32; - if (npc.spriteDirection != -npc.direction) - { - npc.rotation += 3.14159274f; - } - npc.spriteDirection = -npc.direction; - } - npc.ai[2] += 1f; - if (npc.ai[2] >= (float)num2) - { - int num33 = 0; - switch ((int)npc.ai[3]) - { - case 0: - case 2: - case 3: - case 5: - case 6: - case 7: - num33 = 1; - break; - case 1: - case 4: - case 8: - num33 = 2; - break; - } - if (num33 == 1) - { - npc.ai[0] = 11f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.velocity = Vector2.Normalize(player.Center - vector) * num5; - npc.rotation = (float)Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X); - if (num32 != 0) - { - npc.direction = num32; - if (npc.spriteDirection == 1) - { - npc.rotation += 3.14159274f; - } - npc.spriteDirection = -npc.direction; - } - } - else if (num33 == 2) - { - npc.ai[0] = 12f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - } - else if (num33 == 3) - { - npc.ai[0] = 13f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - } - npc.netUpdate = true; - return false; - } - } - else if (npc.ai[0] == 11f) - { - npc.dontTakeDamage = false; - npc.chaseable = true; - npc.alpha -= 25; - if (npc.alpha < 0) - { - npc.alpha = 0; - } - int num34 = 7; - for (int m = 0; m < num34; m++) - { - Vector2 arg_2444_0 = (Vector2.Normalize(npc.velocity) * new Vector2((float)(npc.width + 50) / 2f, (float)npc.height) * 0.75f).RotatedBy((double)(m - (num34 / 2 - 1)) * 3.1415926535897931 / (double)((float)num34), default(Vector2)) + vector; - Vector2 vector11 = ((float)(Main.rand.NextDouble() * 3.1415927410125732) - 1.57079637f).ToRotationVector2() * (float)Main.rand.Next(3, 8); - int num35 = Dust.NewDust(arg_2444_0 + vector11, 0, 0, 172, vector11.X * 2f, vector11.Y * 2f, 100, default(Color), 1.4f); - Main.dust[num35].noGravity = true; - Main.dust[num35].noLight = true; - Main.dust[num35].velocity /= 4f; - Main.dust[num35].velocity -= npc.velocity; - } - npc.ai[2] += 1f; - if (npc.ai[2] >= (float)num4) - { - npc.ai[0] = 10f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] += 1f; - npc.netUpdate = true; - return false; - } - } - else if (npc.ai[0] == 12f) - { - npc.dontTakeDamage = true; - npc.chaseable = false; - if (npc.alpha < 255) - { - npc.alpha += 17; - if (npc.alpha > 255) - { - npc.alpha = 255; - } - } - npc.velocity *= 0.98f; - npc.velocity.Y = MathHelper.Lerp(npc.velocity.Y, 0f, 0.02f); - if (npc.ai[2] == (float)(num12 / 2)) - { - Main.PlaySound(29, (int)vector.X, (int)vector.Y, 20, 1f, 0f); - } - if (Main.netMode != 1 && npc.ai[2] == (float)(num12 / 2)) - { - if (npc.ai[1] == 0f) - { - npc.ai[1] = (float)(300 * Math.Sign((vector - player.Center).X)); - } - Vector2 center = player.Center + new Vector2(-npc.ai[1], -200f); - vector = (npc.Center = center); - int num36 = Math.Sign(player.Center.X - vector.X); - if (num36 != 0) - { - if (npc.ai[2] == 0f && num36 != npc.direction) - { - npc.rotation += 3.14159274f; - for (int n = 0; n < npc.oldPos.Length; n++) - { - npc.oldPos[n] = Vector2.Zero; - } - } - npc.direction = num36; - if (npc.spriteDirection != -npc.direction) - { - npc.rotation += 3.14159274f; - } - npc.spriteDirection = -npc.direction; - } - } - npc.ai[2] += 1f; - if (npc.ai[2] >= (float)num12) - { - npc.ai[0] = 10f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] += 1f; - if (npc.ai[3] >= 9f) - { - npc.ai[3] = 0f; - } - npc.netUpdate = true; - return false; - } - } - else if (npc.ai[0] == 13f) - { - if (npc.ai[2] == 0f) - { - Main.PlaySound(29, (int)vector.X, (int)vector.Y, 20, 1f, 0f); - } - npc.velocity = npc.velocity.RotatedBy((double)(-(double)num15 * (float)npc.direction), default(Vector2)); - npc.rotation -= num15 * (float)npc.direction; - npc.ai[2] += 1f; - if (npc.ai[2] >= (float)num13) - { - npc.ai[0] = 10f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] += 1f; - npc.netUpdate = true; - } - } - return false; - } - #endregion - } - #endregion - if (CalamityWorld.revenge || CalamityWorld.bossRushActive) - { - #region Mothron - if (npc.type == NPCID.Mothron && CalamityWorld.buffedEclipse) - { - int num1353 = 3; - npc.noTileCollide = false; - npc.noGravity = true; - npc.knockBackResist = 0.2f * Main.expertKnockBack; - npc.damage = npc.defDamage; - if (!Main.eclipse) - { - npc.ai[0] = -1f; - } - else if (npc.target < 0 || Main.player[npc.target].dead || !Main.player[npc.target].active) - { - npc.TargetClosest(true); - Vector2 vector235 = Main.player[npc.target].Center - npc.Center; - if (Main.player[npc.target].dead || vector235.Length() > 3000f) - { - npc.ai[0] = -1f; - } - } - else - { - Vector2 vector236 = Main.player[npc.target].Center - npc.Center; - if (npc.ai[0] > 1f && vector236.Length() > 1000f) - { - npc.ai[0] = 1f; - } - } - if (npc.ai[0] == -1f) - { - Vector2 value37 = new Vector2(0f, -8f); - npc.velocity = (npc.velocity * 22f + value37) / 10f; - npc.noTileCollide = true; - npc.dontTakeDamage = true; - return false; - } - if (npc.ai[0] == 0f) - { - npc.TargetClosest(true); - if (npc.Center.X < Main.player[npc.target].Center.X - 2f) - { - npc.direction = 1; - } - if (npc.Center.X > Main.player[npc.target].Center.X + 2f) - { - npc.direction = -1; - } - npc.spriteDirection = npc.direction; - npc.rotation = (npc.rotation * 9f + npc.velocity.X * 0.025f) / 10f; - if (npc.collideX) - { - npc.velocity.X = npc.velocity.X * (-npc.oldVelocity.X * 0.5f); - if (npc.velocity.X > 30f) - { - npc.velocity.X = 30f; - } - if (npc.velocity.X < -30f) - { - npc.velocity.X = -30f; - } - } - if (npc.collideY) - { - npc.velocity.Y = npc.velocity.Y * (-npc.oldVelocity.Y * 0.5f); - if (npc.velocity.Y > 30f) - { - npc.velocity.Y = 30f; - } - if (npc.velocity.Y < -30f) - { - npc.velocity.Y = -30f; - } - } - Vector2 value38 = Main.player[npc.target].Center - npc.Center; - value38.Y -= 200f; - if (value38.Length() > 2000f) - { - npc.ai[0] = 1f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] = 0f; - } - else if (value38.Length() > 80f) - { - float scaleFactor15 = 13f; - float num1354 = 30f; - value38.Normalize(); - value38 *= scaleFactor15; - npc.velocity = (npc.velocity * (num1354 - 1f) + value38) / num1354; - } - else if (npc.velocity.Length() > 2f) - { - npc.velocity *= 0.95f; - } - else if (npc.velocity.Length() < 1f) - { - npc.velocity *= 1.05f; - } - npc.ai[1] += 1f; - if (npc.justHit) - { - npc.ai[1] += (float)Main.rand.Next(10, 30); - } - if (npc.ai[1] >= 180f && Main.netMode != 1) - { - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] = 0f; - npc.netUpdate = true; - while (npc.ai[0] == 0f) - { - int num1355 = Main.rand.Next(3); - if (num1355 == 0 && Collision.CanHit(npc.Center, 1, 1, Main.player[npc.target].Center, 1, 1)) - { - npc.ai[0] = 2f; - } - else if (num1355 == 1) - { - npc.ai[0] = 3f; - } - else if (num1355 == 2 && NPC.CountNPCS(478) + NPC.CountNPCS(479) < num1353) - { - npc.ai[0] = 4f; - } - } - return false; - } - } - else - { - if (npc.ai[0] == 1f) - { - npc.collideX = false; - npc.collideY = false; - npc.noTileCollide = true; - npc.knockBackResist = 0f; - if (npc.target < 0 || !Main.player[npc.target].active || Main.player[npc.target].dead) - { - npc.TargetClosest(true); - } - if (npc.velocity.X < 0f) - { - npc.direction = -1; - } - else if (npc.velocity.X > 0f) - { - npc.direction = 1; - } - npc.spriteDirection = npc.direction; - npc.rotation = (npc.rotation * 9f + npc.velocity.X * 0.02f) / 10f; - Vector2 value39 = Main.player[npc.target].Center - npc.Center; - if (value39.Length() < 300f && !Collision.SolidCollision(npc.position, npc.width, npc.height)) - { - npc.ai[0] = 0f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] = 0f; - } - float scaleFactor16 = 14f + value39.Length() / 100f; - float num1356 = 25f; - value39.Normalize(); - value39 *= scaleFactor16; - npc.velocity = (npc.velocity * (num1356 - 1f) + value39) / num1356; - return false; - } - if (npc.ai[0] == 2f) - { - npc.damage = (int)((double)npc.defDamage * 0.75); - npc.knockBackResist = 0f; - if (npc.target < 0 || !Main.player[npc.target].active || Main.player[npc.target].dead) - { - npc.TargetClosest(true); - npc.ai[0] = 0f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] = 0f; - } - if (Main.player[npc.target].Center.X - 10f < npc.Center.X) - { - npc.direction = -1; - } - else if (Main.player[npc.target].Center.X + 10f > npc.Center.X) - { - npc.direction = 1; - } - npc.spriteDirection = npc.direction; - npc.rotation = (npc.rotation * 4f + npc.velocity.X * 0.025f) / 5f; - if (npc.collideX) - { - npc.velocity.X = npc.velocity.X * (-npc.oldVelocity.X * 0.5f); - if (npc.velocity.X > 30f) - { - npc.velocity.X = 30f; - } - if (npc.velocity.X < -30f) - { - npc.velocity.X = -30f; - } - } - if (npc.collideY) - { - npc.velocity.Y = npc.velocity.Y * (-npc.oldVelocity.Y * 0.5f); - if (npc.velocity.Y > 30f) - { - npc.velocity.Y = 30f; - } - if (npc.velocity.Y < -30f) - { - npc.velocity.Y = -30f; - } - } - Vector2 value40 = Main.player[npc.target].Center - npc.Center; - value40.Y -= 20f; - npc.ai[2] += 0.0222222228f; - if (Main.expertMode) - { - npc.ai[2] += 0.0166666675f; - } - float scaleFactor17 = 13f + npc.ai[2] + value40.Length() / 120f; - float num1357 = 20f; - value40.Normalize(); - value40 *= scaleFactor17; - npc.velocity = (npc.velocity * (num1357 - 1f) + value40) / num1357; - npc.ai[1] += 1f; - if (npc.ai[1] > 240f || !Collision.CanHit(npc.Center, 1, 1, Main.player[npc.target].Center, 1, 1)) - { - npc.ai[0] = 0f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] = 0f; - return false; - } - } - else - { - if (npc.ai[0] == 3f) - { - npc.knockBackResist = 0f; - npc.noTileCollide = true; - if (npc.velocity.X < 0f) - { - npc.direction = -1; - } - else - { - npc.direction = 1; - } - npc.spriteDirection = npc.direction; - npc.rotation = (npc.rotation * 4f + npc.velocity.X * 0.0175f) / 5f; - Vector2 value41 = Main.player[npc.target].Center - npc.Center; - value41.Y -= 12f; - if (npc.Center.X > Main.player[npc.target].Center.X) - { - value41.X += 400f; - } - else - { - value41.X -= 400f; - } - if (Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) > 350f && Math.Abs(npc.Center.Y - Main.player[npc.target].Center.Y) < 20f) - { - npc.ai[0] = 3.1f; - npc.ai[1] = 0f; - } - npc.ai[1] += 0.0333333351f; - float scaleFactor18 = 20f + npc.ai[1]; - float num1358 = 4f; - value41.Normalize(); - value41 *= scaleFactor18; - npc.velocity = (npc.velocity * (num1358 - 1f) + value41) / num1358; - return false; - } - if (npc.ai[0] == 3.1f) - { - npc.knockBackResist = 0f; - npc.noTileCollide = true; - npc.rotation = (npc.rotation * 4f + npc.velocity.X * 0.0175f) / 5f; - Vector2 vector237 = Main.player[npc.target].Center - npc.Center; - vector237.Y -= 12f; - float scaleFactor19 = 30f; - float num1359 = 8f; - vector237.Normalize(); - vector237 *= scaleFactor19; - npc.velocity = (npc.velocity * (num1359 - 1f) + vector237) / num1359; - if (npc.velocity.X < 0f) - { - npc.direction = -1; - } - else - { - npc.direction = 1; - } - npc.spriteDirection = npc.direction; - npc.ai[1] += 1f; - if (npc.ai[1] > 10f) - { - npc.velocity = vector237; - if (npc.velocity.X < 0f) - { - npc.direction = -1; - } - else - { - npc.direction = 1; - } - npc.ai[0] = 3.2f; - npc.ai[1] = 0f; - npc.ai[1] = (float)npc.direction; - return false; - } - } - else - { - if (npc.ai[0] == 3.2f) - { - npc.damage = (int)((double)npc.defDamage * 1.5); - npc.collideX = false; - npc.collideY = false; - npc.knockBackResist = 0f; - npc.noTileCollide = true; - npc.ai[2] += 0.0333333351f; - npc.velocity.X = (20f + npc.ai[2]) * npc.ai[1]; - if ((npc.ai[1] > 0f && npc.Center.X > Main.player[npc.target].Center.X + 260f) || (npc.ai[1] < 0f && npc.Center.X < Main.player[npc.target].Center.X - 260f)) - { - if (!Collision.SolidCollision(npc.position, npc.width, npc.height)) - { - npc.ai[0] = 0f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] = 0f; - } - else if (Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) > 1600f) - { - npc.ai[0] = 1f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] = 0f; - } - } - npc.rotation = (npc.rotation * 4f + npc.velocity.X * 0.0175f) / 5f; - return false; - } - if (npc.ai[0] == 4f) - { - npc.ai[0] = 0f; - npc.TargetClosest(true); - if (Main.netMode != 1) - { - npc.ai[1] = -1f; - npc.ai[2] = -1f; - int num; - for (int num1360 = 0; num1360 < 1000; num1360 = num + 1) - { - int num1361 = (int)Main.player[npc.target].Center.X / 16; - int num1362 = (int)Main.player[npc.target].Center.Y / 16; - int num1363 = 30 + num1360 / 50; - int num1364 = 20 + num1360 / 75; - num1361 += Main.rand.Next(-num1363, num1363 + 1); - num1362 += Main.rand.Next(-num1364, num1364 + 1); - if (!WorldGen.SolidTile(num1361, num1362)) - { - while (!WorldGen.SolidTile(num1361, num1362) && (double)num1362 < Main.worldSurface) - { - num1362++; - } - if ((new Vector2((float)(num1361 * 16 + 8), (float)(num1362 * 16 + 8)) - Main.player[npc.target].Center).Length() < 2100f) - { - npc.ai[0] = 4.1f; - npc.ai[1] = (float)num1361; - npc.ai[2] = (float)num1362; - break; - } - } - num = num1360; - } - } - npc.netUpdate = true; - return false; - } - if (npc.ai[0] == 4.1f) - { - if (npc.velocity.X < -2f) - { - npc.direction = -1; - } - else if (npc.velocity.X > 2f) - { - npc.direction = 1; - } - npc.spriteDirection = npc.direction; - npc.rotation = (npc.rotation * 9f + npc.velocity.X * 0.025f) / 10f; - npc.noTileCollide = true; - int num1365 = (int)npc.ai[1]; - int num1366 = (int)npc.ai[2]; - float x2 = (float)(num1365 * 16 + 8); - float y2 = (float)(num1366 * 16 - 20); - Vector2 vector238 = new Vector2(x2, y2); - vector238 -= npc.Center; - float num1367 = 6f + vector238.Length() / 150f; - if (num1367 > 10f) - { - num1367 = 10f; - } - float num1368 = 10f; - if (vector238.Length() < 10f) - { - npc.ai[0] = 4.2f; - } - vector238.Normalize(); - vector238 *= num1367; - npc.velocity = (npc.velocity * (num1368 - 1f) + vector238) / num1368; - return false; - } - if (npc.ai[0] == 4.2f) - { - npc.rotation = (npc.rotation * 9f + npc.velocity.X * 0.025f) / 10f; - npc.knockBackResist = 0f; - npc.noTileCollide = true; - int num1369 = (int)npc.ai[1]; - int num1370 = (int)npc.ai[2]; - float x3 = (float)(num1369 * 16 + 8); - float y3 = (float)(num1370 * 16 - 20); - Vector2 vector239 = new Vector2(x3, y3); - vector239 -= npc.Center; - float num1371 = 4f; - float num1372 = 2f; - if (Main.netMode != 1 && vector239.Length() < 4f) - { - int num1373 = 70; - if (Main.expertMode) - { - num1373 = (int)((double)num1373 * 0.75); - } - npc.ai[3] += 1f; - if (npc.ai[3] == (float)num1373) - { - NPC.NewNPC(num1369 * 16 + 8, num1370 * 16, 478, npc.whoAmI, 0f, 0f, 0f, 0f, 255); - } - else if (npc.ai[3] == (float)(num1373 * 2)) - { - npc.ai[0] = 0f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] = 0f; - if (NPC.CountNPCS(478) + NPC.CountNPCS(479) < num1353 && Main.rand.Next(3) != 0) - { - npc.ai[0] = 4f; - } - else if (Collision.SolidCollision(npc.position, npc.width, npc.height)) - { - npc.ai[0] = 1f; - } - } - } - if (vector239.Length() > num1371) - { - vector239.Normalize(); - vector239 *= num1371; - } - npc.velocity = (npc.velocity * (num1372 - 1f) + vector239) / num1372; - return false; - } - } - } - } - return false; - } - #endregion - #region Pumpking - else if (npc.type == NPCID.Pumpking && CalamityWorld.downedDoG) - { - npc.localAI[0] += 1f; - if (npc.localAI[0] > 6f) - { - npc.localAI[0] = 0f; - npc.localAI[1] += 1f; - if (npc.localAI[1] > 4f) - { - npc.localAI[1] = 0f; - } - } - if (Main.netMode != 1) - { - npc.localAI[2] += 1f; - if (npc.localAI[2] > 300f) - { - npc.ai[3] = (float)Main.rand.Next(3); - npc.localAI[2] = 0f; - } - else if (npc.ai[3] == 0f && npc.localAI[2] % 30f == 0f && npc.localAI[2] > 30f) - { - float num856 = 10f; - Vector2 vector109 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f + 30f); - if (!WorldGen.SolidTile((int)vector109.X / 16, (int)vector109.Y / 16)) - { - float num857 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector109.X; - float num858 = Main.player[npc.target].position.Y - vector109.Y; - num857 += (float)Main.rand.Next(-50, 51); - num858 += (float)Main.rand.Next(50, 201); - num858 *= 0.2f; - float num859 = (float)Math.Sqrt((double)(num857 * num857 + num858 * num858)); - num859 = num856 / num859; - num857 *= num859; - num858 *= num859; - num857 *= 1f + (float)Main.rand.Next(-30, 31) * 0.01f; - num858 *= 1f + (float)Main.rand.Next(-30, 31) * 0.01f; - Projectile.NewProjectile(vector109.X, vector109.Y, num857, num858, Main.rand.Next(326, 329), 60, 0f, Main.myPlayer, 0f, 0f); - } - } - } - if (npc.ai[0] == 0f && Main.netMode != 1) - { - npc.TargetClosest(true); - npc.ai[0] = 1f; - int num861 = NPC.NewNPC((int)(npc.position.X + (float)(npc.width / 2)), (int)npc.position.Y + npc.height / 2, 328, npc.whoAmI, 0f, 0f, 0f, 0f, 255); - Main.npc[num861].ai[0] = -1f; - Main.npc[num861].ai[1] = (float)npc.whoAmI; - Main.npc[num861].target = npc.target; - Main.npc[num861].netUpdate = true; - num861 = NPC.NewNPC((int)(npc.position.X + (float)(npc.width / 2)), (int)npc.position.Y + npc.height / 2, 328, npc.whoAmI, 0f, 0f, 0f, 0f, 255); - Main.npc[num861].ai[0] = 1f; - Main.npc[num861].ai[1] = (float)npc.whoAmI; - Main.npc[num861].ai[3] = 150f; - Main.npc[num861].target = npc.target; - Main.npc[num861].netUpdate = true; - } - if (Main.player[npc.target].dead || Math.Abs(npc.position.X - Main.player[npc.target].position.X) > 2000f || Math.Abs(npc.position.Y - Main.player[npc.target].position.Y) > 2000f) - { - npc.TargetClosest(true); - if (Main.player[npc.target].dead || Math.Abs(npc.position.X - Main.player[npc.target].position.X) > 2000f || Math.Abs(npc.position.Y - Main.player[npc.target].position.Y) > 2000f) - { - npc.ai[1] = 2f; - } - } - if (Main.dayTime) - { - npc.velocity.Y = npc.velocity.Y + 0.3f; - npc.velocity.X = npc.velocity.X * 0.9f; - } - else if (npc.ai[1] == 0f) - { - npc.ai[2] += 1f; - if (npc.ai[2] >= 300f) - { - if (npc.ai[3] != 1f) - { - npc.ai[1] = 0f; - npc.ai[2] = 0f; - } - else - { - npc.ai[2] = 0f; - npc.ai[1] = 1f; - npc.TargetClosest(true); - npc.netUpdate = true; - } - } - Vector2 vector110 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num862 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector110.X; - float num863 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - 200f - vector110.Y; - float num864 = (float)Math.Sqrt((double)(num862 * num862 + num863 * num863)); - float num865 = 8f; - if (npc.ai[3] == 1f) - { - if (num864 > 900f) - { - num865 = 14f; - } - else if (num864 > 600f) - { - num865 = 12f; - } - else if (num864 > 300f) - { - num865 = 10f; - } - } - if (num864 > 50f) - { - num864 = num865 / num864; - npc.velocity.X = (npc.velocity.X * 14f + num862 * num864) / 15f; - npc.velocity.Y = (npc.velocity.Y * 14f + num863 * num864) / 15f; - } - } - else if (npc.ai[1] == 1f) - { - npc.ai[2] += 1f; - if (npc.ai[2] >= 600f || npc.ai[3] != 1f) - { - npc.ai[2] = 0f; - npc.ai[1] = 0f; - } - Vector2 vector111 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num866 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector111.X; - float num867 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector111.Y; - float num868 = (float)Math.Sqrt((double)(num866 * num866 + num867 * num867)); - num868 = 20f / num868; - npc.velocity.X = (npc.velocity.X * 49f + num866 * num868) / 50f; - npc.velocity.Y = (npc.velocity.Y * 49f + num867 * num868) / 50f; - } - else if (npc.ai[1] == 2f) - { - npc.ai[1] = 3f; - npc.velocity.Y = npc.velocity.Y + 0.1f; - if (npc.velocity.Y < 0f) - { - npc.velocity.Y = npc.velocity.Y * 0.95f; - } - npc.velocity.X = npc.velocity.X * 0.95f; - if (npc.timeLeft > 500) - { - npc.timeLeft = 500; - } - } - npc.rotation = npc.velocity.X * -0.02f; - return false; - } - else if (npc.type == NPCID.PumpkingBlade && CalamityWorld.downedDoG) - { - npc.spriteDirection = -(int)npc.ai[0]; - if (!Main.npc[(int)npc.ai[1]].active || Main.npc[(int)npc.ai[1]].aiStyle != 58) - { - npc.ai[2] += 10f; - if (npc.ai[2] > 50f || Main.netMode != 2) - { - npc.life = -1; - npc.HitEffect(0, 10.0); - npc.active = false; - } - } - if (Main.netMode != 1 && Main.npc[(int)npc.ai[1]].ai[3] == 2f) - { - npc.localAI[1] += 1f; - if (npc.localAI[1] > 30f) - { - npc.localAI[1] = 0f; - float num869 = 0.01f; - Vector2 vector112 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f + 30f); - float num870 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector112.X; - float num871 = Main.player[npc.target].position.Y - vector112.Y; - float num872 = (float)Math.Sqrt((double)(num870 * num870 + num871 * num871)); - num872 = num869 / num872; - num870 *= num872; - num871 *= num872; - Projectile.NewProjectile(npc.Center.X, npc.Center.Y, num870, num871, 329, 70, 0f, Main.myPlayer, npc.rotation, (float)npc.spriteDirection); - } - } - if (Main.dayTime) - { - npc.velocity.Y = npc.velocity.Y + 0.3f; - npc.velocity.X = npc.velocity.X * 0.9f; - return false; - } - if (npc.ai[2] == 0f || npc.ai[2] == 3f) - { - if (Main.npc[(int)npc.ai[1]].ai[1] == 3f && npc.timeLeft > 10) - { - npc.timeLeft = 10; - } - npc.ai[3] += 1f; - if (npc.ai[3] >= 180f) - { - npc.ai[2] += 1f; - npc.ai[3] = 0f; - npc.netUpdate = true; - } - Vector2 vector113 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num874 = (Main.player[npc.target].Center.X + Main.npc[(int)npc.ai[1]].Center.X) / 2f; - float num875 = (Main.player[npc.target].Center.Y + Main.npc[(int)npc.ai[1]].Center.Y) / 2f; - num874 += -170f * npc.ai[0] - vector113.X; - num875 += 90f - vector113.Y; - float num876 = Math.Abs(Main.player[npc.target].Center.X - Main.npc[(int)npc.ai[1]].Center.X) + Math.Abs(Main.player[npc.target].Center.Y - Main.npc[(int)npc.ai[1]].Center.Y); - if (num876 > 700f) - { - num874 = Main.npc[(int)npc.ai[1]].Center.X - 170f * npc.ai[0] - vector113.X; - num875 = Main.npc[(int)npc.ai[1]].Center.Y + 90f - vector113.Y; - } - float num877 = (float)Math.Sqrt((double)(num874 * num874 + num875 * num875)); - float num878 = 8f; - if (num877 > 1000f) - { - num878 = 23f; - } - else if (num877 > 800f) - { - num878 = 20f; - } - else if (num877 > 600f) - { - num878 = 17f; - } - else if (num877 > 400f) - { - num878 = 14f; - } - else if (num877 > 200f) - { - num878 = 11f; - } - if (npc.ai[0] < 0f && npc.Center.X > Main.npc[(int)npc.ai[1]].Center.X) - { - num874 -= 4f; - } - if (npc.ai[0] > 0f && npc.Center.X < Main.npc[(int)npc.ai[1]].Center.X) - { - num874 += 4f; - } - num877 = num878 / num877; - npc.velocity.X = (npc.velocity.X * 14f + num874 * num877) / 15f; - npc.velocity.Y = (npc.velocity.Y * 14f + num875 * num877) / 15f; - num877 = (float)Math.Sqrt((double)(num874 * num874 + num875 * num875)); - if (num877 > 20f) - { - npc.rotation = (float)Math.Atan2((double)num875, (double)num874) + 1.57f; - return false; - } - } - else if (npc.ai[2] == 1f) - { - Vector2 vector114 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num879 = Main.npc[(int)npc.ai[1]].position.X + (float)(Main.npc[(int)npc.ai[1]].width / 2) - 200f * npc.ai[0] - vector114.X; - float num880 = Main.npc[(int)npc.ai[1]].position.Y + 230f - vector114.Y; - float num881 = (float)Math.Sqrt((double)(num879 * num879 + num880 * num880)); - npc.rotation = (float)Math.Atan2((double)num880, (double)num879) + 1.57f; - npc.velocity.X = npc.velocity.X * 0.95f; - npc.velocity.Y = npc.velocity.Y - 0.3f; - if (npc.velocity.Y < -18f) - { - npc.velocity.Y = -18f; - } - if (npc.position.Y < Main.npc[(int)npc.ai[1]].position.Y - 200f) - { - npc.TargetClosest(true); - npc.ai[2] = 2f; - vector114 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - num879 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector114.X; - num880 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector114.Y; - num881 = (float)Math.Sqrt((double)(num879 * num879 + num880 * num880)); - num881 = 24f / num881; - npc.velocity.X = num879 * num881; - npc.velocity.Y = num880 * num881; - npc.netUpdate = true; - return false; - } - } - else if (npc.ai[2] == 2f) - { - float num882 = Math.Abs(npc.Center.X - Main.npc[(int)npc.ai[1]].Center.X) + Math.Abs(npc.Center.Y - Main.npc[(int)npc.ai[1]].Center.Y); - if (npc.position.Y > Main.player[npc.target].position.Y || npc.velocity.Y < 0f || num882 > 800f) - { - npc.ai[2] = 3f; - return false; - } - } - else if (npc.ai[2] == 4f) - { - Vector2 vector115 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num883 = Main.npc[(int)npc.ai[1]].position.X + (float)(Main.npc[(int)npc.ai[1]].width / 2) - 200f * npc.ai[0] - vector115.X; - float num884 = Main.npc[(int)npc.ai[1]].position.Y + 230f - vector115.Y; - float num885 = (float)Math.Sqrt((double)(num883 * num883 + num884 * num884)); - npc.rotation = (float)Math.Atan2((double)num884, (double)num883) + 1.57f; - npc.velocity.Y = npc.velocity.Y * 0.95f; - npc.velocity.X = npc.velocity.X + 0.3f * -npc.ai[0]; - if (npc.velocity.X < -18f) - { - npc.velocity.X = -18f; - } - if (npc.velocity.X > 18f) - { - npc.velocity.X = 18f; - } - if (npc.position.X + (float)(npc.width / 2) < Main.npc[(int)npc.ai[1]].position.X + (float)(Main.npc[(int)npc.ai[1]].width / 2) - 500f || npc.position.X + (float)(npc.width / 2) > Main.npc[(int)npc.ai[1]].position.X + (float)(Main.npc[(int)npc.ai[1]].width / 2) + 500f) - { - npc.TargetClosest(true); - npc.ai[2] = 5f; - vector115 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - num883 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector115.X; - num884 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector115.Y; - num885 = (float)Math.Sqrt((double)(num883 * num883 + num884 * num884)); - num885 = 17f / num885; - npc.velocity.X = num883 * num885; - npc.velocity.Y = num884 * num885; - npc.netUpdate = true; - return false; - } - } - else if (npc.ai[2] == 5f) - { - float num886 = Math.Abs(npc.Center.X - Main.npc[(int)npc.ai[1]].Center.X) + Math.Abs(npc.Center.Y - Main.npc[(int)npc.ai[1]].Center.Y); - if ((npc.velocity.X > 0f && npc.position.X + (float)(npc.width / 2) > Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2)) || (npc.velocity.X < 0f && npc.position.X + (float)(npc.width / 2) < Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2)) || num886 > 800f) - { - npc.ai[2] = 0f; - return false; - } - } - return false; - } - #endregion - #region IceQueen - else if (npc.type == NPCID.IceQueen && CalamityWorld.downedDoG) - { - if (Main.dayTime) - { - if (npc.velocity.X > 0f) - { - npc.velocity.X = npc.velocity.X + 0.25f; - } - else - { - npc.velocity.X = npc.velocity.X - 0.25f; - } - npc.velocity.Y = npc.velocity.Y - 0.1f; - npc.rotation = npc.velocity.X * 0.05f; - } - else if (npc.ai[0] == 0f) - { - if (npc.ai[2] == 0f) - { - npc.TargetClosest(true); - if (npc.Center.X < Main.player[npc.target].Center.X) - { - npc.ai[2] = 1f; - } - else - { - npc.ai[2] = -1f; - } - } - npc.TargetClosest(true); - int num887 = 800; - float num888 = Math.Abs(npc.Center.X - Main.player[npc.target].Center.X); - if (npc.Center.X < Main.player[npc.target].Center.X && npc.ai[2] < 0f && num888 > (float)num887) - { - npc.ai[2] = 0f; - } - if (npc.Center.X > Main.player[npc.target].Center.X && npc.ai[2] > 0f && num888 > (float)num887) - { - npc.ai[2] = 0f; - } - float num889 = 0.6f; - float num890 = 10f; - if ((double)npc.life < (double)npc.lifeMax * 0.75) - { - num889 = 0.7f; - num890 = 12f; - } - if ((double)npc.life < (double)npc.lifeMax * 0.5) - { - num889 = 0.8f; - num890 = 14f; - } - if ((double)npc.life < (double)npc.lifeMax * 0.25) - { - num889 = 0.95f; - num890 = 16f; - } - npc.velocity.X = npc.velocity.X + npc.ai[2] * num889; - if (npc.velocity.X > num890) - { - npc.velocity.X = num890; - } - if (npc.velocity.X < -num890) - { - npc.velocity.X = -num890; - } - float num891 = Main.player[npc.target].position.Y - (npc.position.Y + (float)npc.height); - if (num891 < 150f) - { - npc.velocity.Y = npc.velocity.Y - 0.2f; - } - if (num891 > 200f) - { - npc.velocity.Y = npc.velocity.Y + 0.2f; - } - if (npc.velocity.Y > 9f) - { - npc.velocity.Y = 9f; - } - if (npc.velocity.Y < -9f) - { - npc.velocity.Y = -9f; - } - npc.rotation = npc.velocity.X * 0.05f; - if ((num888 < 500f || npc.ai[3] < 0f) && npc.position.Y < Main.player[npc.target].position.Y) - { - npc.ai[3] += 1f; - int num892 = 8; - if ((double)npc.life < (double)npc.lifeMax * 0.75) - { - num892 = 7; - } - if ((double)npc.life < (double)npc.lifeMax * 0.5) - { - num892 = 6; - } - if ((double)npc.life < (double)npc.lifeMax * 0.25) - { - num892 = 5; - } - num892++; - if (npc.ai[3] > (float)num892) - { - npc.ai[3] = (float)(-(float)num892); - } - if (npc.ai[3] == 0f && Main.netMode != 1) - { - Vector2 vector116 = new Vector2(npc.Center.X, npc.Center.Y); - vector116.X += npc.velocity.X * 7f; - float num893 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector116.X; - float num894 = Main.player[npc.target].Center.Y - vector116.Y; - float num895 = (float)Math.Sqrt((double)(num893 * num893 + num894 * num894)); - float num896 = 8f; - if ((double)npc.life < (double)npc.lifeMax * 0.75) - { - num896 = 9f; - } - if ((double)npc.life < (double)npc.lifeMax * 0.5) - { - num896 = 10f; - } - if ((double)npc.life < (double)npc.lifeMax * 0.25) - { - num896 = 11f; - } - num895 = num896 / num895; - num893 *= num895; - num894 *= num895; - Projectile.NewProjectile(vector116.X, vector116.Y, num893, num894, 348, 50, 0f, Main.myPlayer, 0f, 0f); - } - } - else if (npc.ai[3] < 0f) - { - npc.ai[3] += 1f; - } - if (Main.netMode != 1) - { - npc.ai[1] += (float)Main.rand.Next(1, 4); - if (npc.ai[1] > 600f && num888 < 600f) - { - npc.ai[0] = -1f; - } - } - } - else if (npc.ai[0] == 1f) - { - npc.TargetClosest(true); - float num898 = 0.2f; - float num899 = 10f; - if ((double)npc.life < (double)npc.lifeMax * 0.75) - { - num898 = 0.24f; - num899 = 12f; - } - if ((double)npc.life < (double)npc.lifeMax * 0.5) - { - num898 = 0.28f; - num899 = 14f; - } - if ((double)npc.life < (double)npc.lifeMax * 0.25) - { - num898 = 0.32f; - num899 = 16f; - } - num898 -= 0.05f; - num899 -= 1f; - if (npc.Center.X < Main.player[npc.target].Center.X) - { - npc.velocity.X = npc.velocity.X + num898; - if (npc.velocity.X < 0f) - { - npc.velocity.X = npc.velocity.X * 0.98f; - } - } - if (npc.Center.X > Main.player[npc.target].Center.X) - { - npc.velocity.X = npc.velocity.X - num898; - if (npc.velocity.X > 0f) - { - npc.velocity.X = npc.velocity.X * 0.98f; - } - } - if (npc.velocity.X > num899 || npc.velocity.X < -num899) - { - npc.velocity.X = npc.velocity.X * 0.95f; - } - float num900 = Main.player[npc.target].position.Y - (npc.position.Y + (float)npc.height); - if (num900 < 180f) - { - npc.velocity.Y = npc.velocity.Y - 0.1f; - } - if (num900 > 200f) - { - npc.velocity.Y = npc.velocity.Y + 0.1f; - } - if (npc.velocity.Y > 7f) - { - npc.velocity.Y = 7f; - } - if (npc.velocity.Y < -7f) - { - npc.velocity.Y = -7f; - } - npc.rotation = npc.velocity.X * 0.01f; - if (Main.netMode != 1) - { - npc.ai[3] += 1f; - int num901 = 10; - if ((double)npc.life < (double)npc.lifeMax * 0.75) - { - num901 = 8; - } - if ((double)npc.life < (double)npc.lifeMax * 0.5) - { - num901 = 6; - } - if ((double)npc.life < (double)npc.lifeMax * 0.25) - { - num901 = 4; - } - if ((double)npc.life < (double)npc.lifeMax * 0.1) - { - num901 = 2; - } - num901 += 3; - if (npc.ai[3] >= (float)num901) - { - npc.ai[3] = 0f; - Vector2 vector117 = new Vector2(npc.Center.X, npc.position.Y + (float)npc.height - 14f); - int i2 = (int)(vector117.X / 16f); - int j2 = (int)(vector117.Y / 16f); - if (!WorldGen.SolidTile(i2, j2)) - { - float num902 = npc.velocity.Y; - if (num902 < 0f) - { - num902 = 0f; - } - num902 += 3f; - float speedX2 = npc.velocity.X * 0.25f; - int num903 = Projectile.NewProjectile(vector117.X, vector117.Y, speedX2, num902, 349, 44, 0f, Main.myPlayer, (float)Main.rand.Next(5), 0f); - } - } - } - if (Main.netMode != 1) - { - npc.ai[1] += (float)Main.rand.Next(1, 4); - if (npc.ai[1] > 450f) - { - npc.ai[0] = -1f; - } - } - } - else if (npc.ai[0] == 2f) - { - npc.TargetClosest(true); - Vector2 vector118 = new Vector2(npc.Center.X, npc.Center.Y - 20f); - float num904 = (float)Main.rand.Next(-1000, 1001); - float num905 = (float)Main.rand.Next(-1000, 1001); - float num906 = (float)Math.Sqrt((double)(num904 * num904 + num905 * num905)); - float num907 = 20f; - npc.velocity *= 0.95f; - num906 = num907 / num906; - num904 *= num906; - num905 *= num906; - npc.rotation += 0.2f; - vector118.X += num904 * 4f; - vector118.Y += num905 * 4f; - npc.ai[3] += 1f; - int num908 = 7; - if ((double)npc.life < (double)npc.lifeMax * 0.75) - { - num908--; - } - if ((double)npc.life < (double)npc.lifeMax * 0.5) - { - num908 -= 2; - } - if ((double)npc.life < (double)npc.lifeMax * 0.25) - { - num908 -= 3; - } - if ((double)npc.life < (double)npc.lifeMax * 0.1) - { - num908 -= 4; - } - if (npc.ai[3] > (float)num908) - { - npc.ai[3] = 0f; - int num909 = Projectile.NewProjectile(vector118.X, vector118.Y, num904, num905, 349, 40, 0f, Main.myPlayer, 0f, 0f); - } - if (Main.netMode != 1) - { - npc.ai[1] += (float)Main.rand.Next(1, 4); - if (npc.ai[1] > 300f) - { - npc.ai[0] = -1f; - } - } - } - if (npc.ai[0] == -1f) - { - int num910 = Main.rand.Next(3); - npc.TargetClosest(true); - if (Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) > 1000f) - { - num910 = 0; - } - npc.ai[0] = (float)num910; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] = 0f; - return false; - } - return false; - } - #endregion - #region EyeofCthulhu - else if (npc.type == NPCID.EyeofCthulhu && (CalamityWorld.revenge || CalamityWorld.bossRushActive)) - { - double getMad = 0.5; //0.5 - bool flag2 = false; - if ((double)npc.life < (double)npc.lifeMax * getMad) - { - flag2 = true; - } - float num5 = 20f; - if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead || !Main.player[npc.target].active) - { - npc.TargetClosest(true); - } - bool dead = Main.player[npc.target].dead; - float num6 = npc.position.X + (float)(npc.width / 2) - Main.player[npc.target].position.X - (float)(Main.player[npc.target].width / 2); - float num7 = npc.position.Y + (float)npc.height - 59f - Main.player[npc.target].position.Y - (float)(Main.player[npc.target].height / 2); - float num8 = (float)Math.Atan2((double)num7, (double)num6) + 1.57f; - if (num8 < 0f) - { - num8 += 6.283f; - } - else if ((double)num8 > 6.283) - { - num8 -= 6.283f; - } - float num9 = 0f; - if (npc.ai[0] == 0f && npc.ai[1] == 0f) - { - num9 = 0.02f; - } - if (npc.ai[0] == 0f && npc.ai[1] == 2f && npc.ai[2] > 40f) - { - num9 = 0.05f; - } - if (npc.ai[0] == 3f && npc.ai[1] == 0f) - { - num9 = 0.05f; - } - if (npc.ai[0] == 3f && npc.ai[1] == 2f && npc.ai[2] > 40f) - { - num9 = 0.08f; - } - if (npc.ai[0] == 3f && npc.ai[1] == 4f && npc.ai[2] > num5) - { - num9 = 0.15f; - } - if (npc.ai[0] == 3f && npc.ai[1] == 5f) - { - num9 = 0.05f; - } - num9 *= 1.5f; - if (npc.rotation < num8) - { - if ((double)(num8 - npc.rotation) > 3.1415) - { - npc.rotation -= num9; - } - else - { - npc.rotation += num9; - } - } - else if (npc.rotation > num8) - { - if ((double)(npc.rotation - num8) > 3.1415) - { - npc.rotation += num9; - } - else - { - npc.rotation -= num9; - } - } - if (npc.rotation > num8 - num9 && npc.rotation < num8 + num9) - { - npc.rotation = num8; - } - if (npc.rotation < 0f) - { - npc.rotation += 6.283f; - } - else if ((double)npc.rotation > 6.283) - { - npc.rotation -= 6.283f; - } - if (npc.rotation > num8 - num9 && npc.rotation < num8 + num9) - { - npc.rotation = num8; - } - if (Main.rand.Next(5) == 0) - { - int num10 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y + (float)npc.height * 0.25f), npc.width, (int)((float)npc.height * 0.5f), 5, npc.velocity.X, 2f, 0, default(Color), 1f); - Dust var_9_825_cp_0_cp_0 = Main.dust[num10]; - var_9_825_cp_0_cp_0.velocity.X = var_9_825_cp_0_cp_0.velocity.X * 0.5f; - Dust var_9_845_cp_0_cp_0 = Main.dust[num10]; - var_9_845_cp_0_cp_0.velocity.Y = var_9_845_cp_0_cp_0.velocity.Y * 0.1f; - } - if (Main.dayTime | dead) - { - npc.velocity.Y = npc.velocity.Y - 0.04f; - if (npc.timeLeft > 10) - { - npc.timeLeft = 10; - return false; - } - } - else if (npc.ai[0] == 0f) - { - if (npc.ai[1] == 0f) - { - float num11 = (enraged ? 10f : 7f); - float num12 = (enraged ? 0.2f : 0.15f); - Vector2 vector = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num13 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector.X; - float num14 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - 200f - vector.Y; - float num15 = (float)Math.Sqrt((double)(num13 * num13 + num14 * num14)); - float num16 = num15; - num15 = num11 / num15; - num13 *= num15; - num14 *= num15; - if (npc.velocity.X < num13) - { - npc.velocity.X = npc.velocity.X + num12; - if (npc.velocity.X < 0f && num13 > 0f) - { - npc.velocity.X = npc.velocity.X + num12; - } - } - else if (npc.velocity.X > num13) - { - npc.velocity.X = npc.velocity.X - num12; - if (npc.velocity.X > 0f && num13 < 0f) - { - npc.velocity.X = npc.velocity.X - num12; - } - } - if (npc.velocity.Y < num14) - { - npc.velocity.Y = npc.velocity.Y + num12; - if (npc.velocity.Y < 0f && num14 > 0f) - { - npc.velocity.Y = npc.velocity.Y + num12; - } - } - else if (npc.velocity.Y > num14) - { - npc.velocity.Y = npc.velocity.Y - num12; - if (npc.velocity.Y > 0f && num14 < 0f) - { - npc.velocity.Y = npc.velocity.Y - num12; - } - } - npc.ai[2] += 1f; - float num17 = 180f; - if (npc.ai[2] >= num17) - { - npc.ai[1] = 1f; - npc.ai[2] = 0f; - npc.ai[3] = 0f; - npc.target = 255; - npc.netUpdate = true; - } - else if (num16 < 500f) - { - if (!Main.player[npc.target].dead) - { - npc.ai[3] += 1f; - } - float num18 = 44f; - if (npc.ai[3] >= num18) - { - npc.ai[3] = 0f; - npc.rotation = num8; - float num19 = 5f; - float num20 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector.X; - float num21 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector.Y; - float num22 = (float)Math.Sqrt((double)(num20 * num20 + num21 * num21)); - num22 = num19 / num22; - Vector2 vector2 = vector; - Vector2 vector3; - vector3.X = num20 * num22; - vector3.Y = num21 * num22; - vector2.X += vector3.X * 10f; - vector2.Y += vector3.Y * 10f; - if (Main.netMode != 1) - { - int num23 = NPC.NewNPC((int)vector2.X, (int)vector2.Y, 5, 0, 0f, 0f, 0f, 0f, 255); - Main.npc[num23].velocity.X = vector3.X; - Main.npc[num23].velocity.Y = vector3.Y; - if (Main.netMode == 2 && num23 < 200) - { - NetMessage.SendData(23, -1, -1, null, num23, 0f, 0f, 0f, 0, 0, 0); - } - } - Main.PlaySound(3, (int)vector2.X, (int)vector2.Y, 1, 1f, 0f); - int num; - for (int m = 0; m < 10; m = num + 1) - { - Dust.NewDust(vector2, 20, 20, 5, vector3.X * 0.4f, vector3.Y * 0.4f, 0, default(Color), 1f); - num = m; - } - } - } - } - else if (npc.ai[1] == 1f) - { - npc.rotation = num8; - float num24 = (enraged ? 11f : 7.25f); - Vector2 vector4 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num25 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector4.X; - float num26 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector4.Y; - float num27 = (float)Math.Sqrt((double)(num25 * num25 + num26 * num26)); - num27 = num24 / num27; - npc.velocity.X = num25 * num27; - npc.velocity.Y = num26 * num27; - npc.ai[1] = 2f; - npc.netUpdate = true; - if (npc.netSpam > 10) - { - npc.netSpam = 10; - } - } - else if (npc.ai[1] == 2f) - { - npc.ai[2] += 1f; - if (npc.ai[2] >= 40f) - { - npc.velocity *= 0.975f; - if ((double)npc.velocity.X > -0.1 && (double)npc.velocity.X < 0.1) - { - npc.velocity.X = 0f; - } - if ((double)npc.velocity.Y > -0.1 && (double)npc.velocity.Y < 0.1) - { - npc.velocity.Y = 0f; - } - } - else - { - npc.rotation = (float)Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X) - 1.57f; - } - int num28 = 90; - if (npc.ai[2] >= (float)num28) - { - npc.ai[3] += 1f; - npc.ai[2] = 0f; - npc.target = 255; - npc.rotation = num8; - if (npc.ai[3] >= 3f) - { - npc.ai[1] = 0f; - npc.ai[3] = 0f; - } - else - { - npc.ai[1] = 1f; - } - } - } - float num29 = 0.9f; - if (((float)npc.life < (float)npc.lifeMax * num29) || CalamityWorld.death) - { - npc.ai[0] = 1f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] = 0f; - npc.netUpdate = true; - if (npc.netSpam > 10) - { - npc.netSpam = 10; - return false; - } - } - } - else if (npc.ai[0] == 1f || npc.ai[0] == 2f) - { - if (npc.ai[0] == 1f) - { - npc.ai[2] += 0.005f; - if ((double)npc.ai[2] > 0.5) - { - npc.ai[2] = 0.5f; - } - } - else - { - npc.ai[2] -= 0.005f; - if (npc.ai[2] < 0f) - { - npc.ai[2] = 0f; - } - } - npc.rotation += npc.ai[2]; - npc.ai[1] += 1f; - if (npc.ai[1] % 20f == 0f) - { - float num30 = 5f; - Vector2 vector5 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num31 = (float)Main.rand.Next(-200, 200); - float num32 = (float)Main.rand.Next(-200, 200); - float num33 = (float)Math.Sqrt((double)(num31 * num31 + num32 * num32)); - num33 = num30 / num33; - Vector2 vector6 = vector5; - Vector2 vector7; - vector7.X = num31 * num33; - vector7.Y = num32 * num33; - vector6.X += vector7.X * 10f; - vector6.Y += vector7.Y * 10f; - if (Main.netMode != 1) - { - int num34 = NPC.NewNPC((int)vector6.X, (int)vector6.Y, 5, 0, 0f, 0f, 0f, 0f, 255); - Main.npc[num34].velocity.X = vector7.X; - Main.npc[num34].velocity.Y = vector7.Y; - if (Main.netMode == 2 && num34 < 200) - { - NetMessage.SendData(23, -1, -1, null, num34, 0f, 0f, 0f, 0, 0, 0); - } - } - int num; - for (int n = 0; n < 10; n = num + 1) - { - Dust.NewDust(vector6, 20, 20, 5, vector7.X * 0.4f, vector7.Y * 0.4f, 0, default(Color), 1f); - num = n; - } - } - if (npc.ai[1] == 100f) - { - npc.ai[0] += 1f; - npc.ai[1] = 0f; - if (npc.ai[0] == 3f) - { - npc.ai[2] = 0f; - } - else - { - Main.PlaySound(3, (int)npc.position.X, (int)npc.position.Y, 1, 1f, 0f); - int num; - for (int num35 = 0; num35 < 2; num35 = num + 1) - { - Gore.NewGore(npc.position, new Vector2((float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f), 8, 1f); - Gore.NewGore(npc.position, new Vector2((float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f), 7, 1f); - Gore.NewGore(npc.position, new Vector2((float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f), 6, 1f); - num = num35; - } - for (int num36 = 0; num36 < 20; num36 = num + 1) - { - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f, 0, default(Color), 1f); - num = num36; - } - Main.PlaySound(15, (int)npc.position.X, (int)npc.position.Y, 0, 1f, 0f); - } - } - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f, 0, default(Color), 1f); - npc.velocity.X = npc.velocity.X * 0.98f; - npc.velocity.Y = npc.velocity.Y * 0.98f; - if ((double)npc.velocity.X > -0.1 && (double)npc.velocity.X < 0.1) - { - npc.velocity.X = 0f; - } - if ((double)npc.velocity.Y > -0.1 && (double)npc.velocity.Y < 0.1) - { - npc.velocity.Y = 0f; - return false; - } - } - else - { - if (flag2) - { - npc.defense = -5; - } - else - { - npc.damage = (int)(20f * Main.expertDamage); - } - if (npc.ai[1] == 0f & flag2) - { - npc.ai[1] = 5f; - } - if (npc.ai[1] == 0f) - { - float num37 = (enraged ? 8f : 5.5f); - float num38 = (enraged ? 0.09f : 0.06f); - Vector2 vector8 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num39 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector8.X; - float num40 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - 120f - vector8.Y; - float num41 = (float)Math.Sqrt((double)(num39 * num39 + num40 * num40)); - if (num41 > 400f) - { - num37 += 1.25f; - num38 += 0.075f; - if (num41 > 600f) - { - num37 += 1.25f; - num38 += 0.075f; - if (num41 > 800f) - { - num37 += 1.25f; - num38 += 0.075f; - } - } - } - num41 = num37 / num41; - num39 *= num41; - num40 *= num41; - if (npc.velocity.X < num39) - { - npc.velocity.X = npc.velocity.X + num38; - if (npc.velocity.X < 0f && num39 > 0f) - { - npc.velocity.X = npc.velocity.X + num38; - } - } - else if (npc.velocity.X > num39) - { - npc.velocity.X = npc.velocity.X - num38; - if (npc.velocity.X > 0f && num39 < 0f) - { - npc.velocity.X = npc.velocity.X - num38; - } - } - if (npc.velocity.Y < num40) - { - npc.velocity.Y = npc.velocity.Y + num38; - if (npc.velocity.Y < 0f && num40 > 0f) - { - npc.velocity.Y = npc.velocity.Y + num38; - } - } - else if (npc.velocity.Y > num40) - { - npc.velocity.Y = npc.velocity.Y - num38; - if (npc.velocity.Y > 0f && num40 < 0f) - { - npc.velocity.Y = npc.velocity.Y - num38; - } - } - npc.ai[2] += 1f; - if (npc.ai[2] >= 200f) - { - npc.ai[1] = 1f; - npc.ai[2] = 0f; - npc.ai[3] = 0f; - if ((double)npc.life < (double)npc.lifeMax * 0.4) - { - npc.ai[1] = 3f; - } - npc.target = 255; - npc.netUpdate = true; - } - } - else if (npc.ai[1] == 1f) - { - Main.PlaySound(36, (int)npc.position.X, (int)npc.position.Y, 0, 1f, 0f); - npc.rotation = num8; - float num42 = (enraged ? 9.5f : 6.2f); - if (npc.ai[3] == 1f) - { - num42 *= 1.15f; - } - if (npc.ai[3] == 2f) - { - num42 *= 1.3f; - } - Vector2 vector9 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num43 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector9.X; - float num44 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector9.Y; - float num45 = (float)Math.Sqrt((double)(num43 * num43 + num44 * num44)); - num45 = num42 / num45; - npc.velocity.X = num43 * num45; - npc.velocity.Y = num44 * num45; - npc.ai[1] = 2f; - npc.netUpdate = true; - if (npc.netSpam > 10) - { - npc.netSpam = 10; - } - } - else if (npc.ai[1] == 2f) - { - float num46 = CalamityWorld.death ? 70f : 60f; - npc.ai[2] += 1f; - if (npc.ai[2] >= num46) - { - npc.velocity *= 0.96f; - if ((double)npc.velocity.X > -0.1 && (double)npc.velocity.X < 0.1) - { - npc.velocity.X = 0f; - } - if ((double)npc.velocity.Y > -0.1 && (double)npc.velocity.Y < 0.1) - { - npc.velocity.Y = 0f; - } - } - else - { - npc.rotation = (float)Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X) - 1.57f; - } - int num47 = CalamityWorld.death ? 70 : 80; - if (npc.ai[2] >= (float)num47) - { - npc.ai[3] += 1f; - npc.ai[2] = 0f; - npc.target = 255; - npc.rotation = num8; - if (npc.ai[3] >= 3f) - { - npc.ai[1] = 0f; - npc.ai[3] = 0f; - if (Main.netMode != 1 && (double)npc.life < (double)npc.lifeMax * 0.6) - { - npc.ai[1] = 3f; - npc.ai[3] += (float)Main.rand.Next(1, 4); - } - npc.netUpdate = true; - if (npc.netSpam > 10) - { - npc.netSpam = 10; - } - } - else - { - npc.ai[1] = 1f; - } - } - } - else if (npc.ai[1] == 3f) - { - if ((npc.ai[3] == 4f & flag2) && npc.Center.Y > Main.player[npc.target].Center.Y) - { - npc.TargetClosest(true); - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] = 0f; - npc.netUpdate = true; - if (npc.netSpam > 10) - { - npc.netSpam = 10; - } - } - else if (Main.netMode != 1) - { - npc.TargetClosest(true); - float num48 = (enraged ? 26f : 18f); - Vector2 vector10 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num49 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector10.X; - float num50 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector10.Y; - float num51 = Math.Abs(Main.player[npc.target].velocity.X) + Math.Abs(Main.player[npc.target].velocity.Y) / 4f; - num51 += 10f - num51; - if (num51 < 5f) - { - num51 = 5f; - } - if (num51 > 15f) - { - num51 = 15f; - } - if (npc.ai[2] == -1f) - { - num51 *= 4f; - num48 *= 1.3f; - } - num49 -= Main.player[npc.target].velocity.X * num51; - num50 -= Main.player[npc.target].velocity.Y * num51 / 4f; - num49 *= 1f + (float)Main.rand.Next(-10, 11) * 0.01f; - num50 *= 1f + (float)Main.rand.Next(-10, 11) * 0.01f; - float num52 = (float)Math.Sqrt((double)(num49 * num49 + num50 * num50)); - float num53 = num52; - num52 = num48 / num52; - npc.velocity.X = num49 * num52; - npc.velocity.Y = num50 * num52; - npc.velocity.X = npc.velocity.X + (float)Main.rand.Next(-20, 21) * 0.1f; - npc.velocity.Y = npc.velocity.Y + (float)Main.rand.Next(-20, 21) * 0.1f; - if (num53 < 100f) - { - if (Math.Abs(npc.velocity.X) > Math.Abs(npc.velocity.Y)) - { - float num56 = Math.Abs(npc.velocity.X); - float num57 = Math.Abs(npc.velocity.Y); - if (npc.Center.X > Main.player[npc.target].Center.X) - { - num57 *= -1f; - } - if (npc.Center.Y > Main.player[npc.target].Center.Y) - { - num56 *= -1f; - } - npc.velocity.X = num57; - npc.velocity.Y = num56; - } - } - else if (Math.Abs(npc.velocity.X) > Math.Abs(npc.velocity.Y)) - { - float num58 = (Math.Abs(npc.velocity.X) + Math.Abs(npc.velocity.Y)) / 2f; - float num59 = num58; - if (npc.Center.X > Main.player[npc.target].Center.X) - { - num59 *= -1f; - } - if (npc.Center.Y > Main.player[npc.target].Center.Y) - { - num58 *= -1f; - } - npc.velocity.X = num59; - npc.velocity.Y = num58; - } - npc.ai[1] = 4f; - npc.netUpdate = true; - if (npc.netSpam > 10) - { - npc.netSpam = 10; - } - } - } - else if (npc.ai[1] == 4f) - { - if (npc.ai[2] == 0f) - { - Main.PlaySound(36, (int)npc.position.X, (int)npc.position.Y, -1, 1f, 0f); - } - float num60 = num5; - npc.ai[2] += 1f; - if (npc.ai[2] == num60 && Vector2.Distance(npc.position, Main.player[npc.target].position) < 200f) - { - npc.ai[2] -= 1f; - } - if (npc.ai[2] >= num60) - { - npc.velocity *= 0.95f; - if ((double)npc.velocity.X > -0.1 && (double)npc.velocity.X < 0.1) - { - npc.velocity.X = 0f; - } - if ((double)npc.velocity.Y > -0.1 && (double)npc.velocity.Y < 0.1) - { - npc.velocity.Y = 0f; - } - } - else - { - npc.rotation = (float)Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X) - 1.57f; - } - float num61 = num60 + 13f; - if (npc.ai[2] >= num61) - { - npc.netUpdate = true; - if (npc.netSpam > 10) - { - npc.netSpam = 10; - } - npc.ai[3] += 1f; - npc.ai[2] = 0f; - if (npc.ai[3] >= 5f) - { - npc.ai[1] = 0f; - npc.ai[3] = 0f; - } - else - { - npc.ai[1] = 3f; - } - } - } - else if (npc.ai[1] == 5f) - { - float num62 = 600f; - float num63 = (enraged ? 12f : 8f); - float num64 = (enraged ? 0.4f : 0.25f); - Vector2 vector11 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num65 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector11.X; - float num66 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) + num62 - vector11.Y; - float num67 = (float)Math.Sqrt((double)(num65 * num65 + num66 * num66)); - num67 = num63 / num67; - num65 *= num67; - num66 *= num67; - if (npc.velocity.X < num65) - { - npc.velocity.X = npc.velocity.X + num64; - if (npc.velocity.X < 0f && num65 > 0f) - { - npc.velocity.X = npc.velocity.X + num64; - } - } - else if (npc.velocity.X > num65) - { - npc.velocity.X = npc.velocity.X - num64; - if (npc.velocity.X > 0f && num65 < 0f) - { - npc.velocity.X = npc.velocity.X - num64; - } - } - if (npc.velocity.Y < num66) - { - npc.velocity.Y = npc.velocity.Y + num64; - if (npc.velocity.Y < 0f && num66 > 0f) - { - npc.velocity.Y = npc.velocity.Y + num64; - } - } - else if (npc.velocity.Y > num66) - { - npc.velocity.Y = npc.velocity.Y - num64; - if (npc.velocity.Y > 0f && num66 < 0f) - { - npc.velocity.Y = npc.velocity.Y - num64; - } - } - npc.ai[2] += 1f; - if (npc.ai[2] >= 70f) - { - npc.TargetClosest(true); - npc.ai[1] = 3f; - npc.ai[2] = -1f; - npc.ai[3] = (float)Main.rand.Next(-3, 1); - npc.netUpdate = true; - } - } - } - return false; - } - #endregion - } - return true; - } - #endregion - - #region AI - public override void AI(NPC npc) + #region PreAI + public override bool PreAI(NPC npc) { - if (npc.buffImmune[mod.BuffType("Enraged")]) - { - npc.buffImmune[mod.BuffType("Enraged")] = false; - } - if (SCal > -1) - { - if (!npc.friendly && npc.damage > 0 && !npc.dontTakeDamage && npc.type != mod.NPCType("SupremeCalamitas")) - { - npc.active = false; - npc.netUpdate = true; - } - } - if (!CalamityWorld.spawnedHardBoss) - { - if (npc.type == NPCID.TheDestroyer || npc.type == NPCID.Spazmatism || npc.type == NPCID.Retinazer || npc.type == NPCID.SkeletronPrime || - npc.type == NPCID.Plantera || npc.type == mod.NPCType("Cryogen") || npc.type == mod.NPCType("AquaticScourgeHead") || - npc.type == mod.NPCType("BrimstoneElemental") || npc.type == mod.NPCType("Astrageldon") || npc.type == mod.NPCType("AstrumDeusHeadSpectral") || - npc.type == mod.NPCType("Calamitas") || npc.type == mod.NPCType("Siren") || npc.type == mod.NPCType("PlaguebringerGoliath") || - npc.type == mod.NPCType("ScavengerBody") || npc.type == NPCID.DukeFishron || npc.type == NPCID.CultistBoss || npc.type == NPCID.Golem) - { - CalamityWorld.spawnedHardBoss = true; - } - } - #region RevengeanceAIChanges - if (CalamityWorld.revenge || CalamityWorld.bossRushActive) + if (setNewName) { - #region MoonLord - if (npc.type == NPCID.MoonLordFreeEye) - { - if (NPC.CountNPCS(NPCID.MoonLordFreeEye) > 3) - { - npc.dontTakeDamage = false; - } - else - { - npc.dontTakeDamage = true; - } - } - if (npc.type == NPCID.MoonLordCore) + setNewName = false; + switch (npc.type) + { + case NPCID.Guide: + switch (Main.rand.Next(35)) //34 guide names + { + case 0: + npc.GivenName = "Lapp"; + break; + default: + break; + } + break; + case NPCID.Wizard: + switch (Main.rand.Next(24)) //23 wizard names + { + case 0: + npc.GivenName = "Mage One-Trick"; + break; + default: + break; + } + break; + case NPCID.Steampunker: + switch (Main.rand.Next(22)) //21 steampunker names + { + case 0: + npc.GivenName = "Vorbis"; + break; + default: + break; + } + break; + case NPCID.Stylist: + switch (Main.rand.Next(21)) //20 stylist names + { + case 0: + npc.GivenName = "Amber"; + break; + default: + break; + } + break; + case NPCID.WitchDoctor: + switch (Main.rand.Next(11)) //10 witch doctor names + { + case 0: + npc.GivenName = "Sok'ar"; + break; + default: + break; + } + break; + default: + break; + } + } + if (npc.type == NPCID.TargetDummy || npc.type == mod.NPCType("SuperDummy")) + { + npc.chaseable = !CalamityPlayer.areThereAnyDamnBosses; + } + if (npc.type == NPCID.TheDestroyer || npc.type == NPCID.TheDestroyerBody || npc.type == NPCID.TheDestroyerTail || + npc.type == NPCID.EaterofWorldsHead || npc.type == NPCID.EaterofWorldsBody || npc.type == NPCID.EaterofWorldsTail) + { + if (npc.buffImmune[mod.BuffType("Enraged")]) + { + npc.buffImmune[mod.BuffType("Enraged")] = false; + } + if (newAI[1] < 480f) + { + newAI[1] += 1f; + } + } + #region BossRush + if (CalamityWorld.bossRushActive && !npc.friendly && !npc.townNPC) + { + switch (CalamityWorld.bossRushStage) + { + case 0: + if (npc.type != NPCID.QueenBee && npc.type != NPCID.Bee && npc.type != NPCID.BeeSmall) + { + npc.active = false; + npc.netUpdate = true; + } + break; + case 1: + if (npc.type != NPCID.BrainofCthulhu && npc.type != NPCID.Creeper) + { + npc.active = false; + npc.netUpdate = true; + } + break; + case 2: + if (npc.type != NPCID.KingSlime && npc.type != NPCID.BlueSlime && npc.type != NPCID.SlimeSpiked) + { + npc.active = false; + npc.netUpdate = true; + } + break; + case 3: + if (npc.type != NPCID.EyeofCthulhu && npc.type != NPCID.ServantofCthulhu) + { + npc.active = false; + npc.netUpdate = true; + } + break; + case 4: + if (npc.type != NPCID.SkeletronPrime && npc.type != NPCID.PrimeSaw && npc.type != NPCID.PrimeVice && + npc.type != NPCID.PrimeCannon && npc.type != NPCID.PrimeLaser) + { + npc.active = false; + npc.netUpdate = true; + } + break; + case 5: + if (npc.type != NPCID.Golem && npc.type != NPCID.GolemFistLeft && npc.type != NPCID.GolemFistRight && + npc.type != NPCID.GolemHead && npc.type != NPCID.GolemHeadFree) + { + npc.active = false; + npc.netUpdate = true; + } + break; + case 6: + if (npc.type != mod.NPCType("ProfanedGuardianBoss") && npc.type != mod.NPCType("ProfanedGuardianBoss2") && + npc.type != mod.NPCType("ProfanedGuardianBoss3")) + { + npc.active = false; + npc.netUpdate = true; + } + break; + case 7: + if (npc.type != NPCID.EaterofWorldsHead && npc.type != NPCID.EaterofWorldsBody && npc.type != NPCID.EaterofWorldsTail && + npc.type != NPCID.VileSpit) + { + npc.active = false; + npc.netUpdate = true; + } + break; + case 8: + if (npc.type != mod.NPCType("Astrageldon") && npc.type != mod.NPCType("AstralSlime")) + { + npc.active = false; + npc.netUpdate = true; + } + break; + case 9: + if (npc.type != NPCID.TheDestroyer && npc.type != NPCID.TheDestroyerBody && npc.type != NPCID.TheDestroyerTail && + npc.type != NPCID.Probe) + { + npc.active = false; + npc.netUpdate = true; + } + break; + case 10: + if (npc.type != NPCID.Spazmatism && npc.type != NPCID.Retinazer) + { + npc.active = false; + npc.netUpdate = true; + } + break; + case 11: + if (npc.type != mod.NPCType("Bumblefuck") && npc.type != mod.NPCType("Bumblefuck2") && + npc.type != NPCID.Spazmatism && npc.type != NPCID.Retinazer) + { + npc.active = false; + npc.netUpdate = true; + } + break; + case 12: + if (npc.type != NPCID.WallofFlesh && npc.type != NPCID.WallofFleshEye && npc.type != NPCID.TheHungry && + npc.type != NPCID.TheHungryII && npc.type != NPCID.LeechHead && npc.type != NPCID.LeechBody && + npc.type != NPCID.LeechTail) + { + npc.active = false; + npc.netUpdate = true; + } + break; + case 13: + if (npc.type != mod.NPCType("HiveMind") && npc.type != mod.NPCType("HiveMindP2") && + npc.type != mod.NPCType("DarkHeart") && npc.type != mod.NPCType("HiveBlob") && + npc.type != mod.NPCType("DankCreeper") && npc.type != mod.NPCType("HiveBlob2")) + { + npc.active = false; + npc.netUpdate = true; + } + break; + case 14: + if (npc.type != NPCID.SkeletronHead && npc.type != NPCID.SkeletronHand) + { + npc.active = false; + npc.netUpdate = true; + } + break; + case 15: + if (npc.type != mod.NPCType("StormWeaverHead") && npc.type != mod.NPCType("StormWeaverBody") && + npc.type != mod.NPCType("StormWeaverTail") && npc.type != mod.NPCType("StormWeaverHeadNaked") && + npc.type != mod.NPCType("StormWeaverBodyNaked") && npc.type != mod.NPCType("StormWeaverTailNaked") && + npc.type != mod.NPCType("StasisProbe") && npc.type != mod.NPCType("StasisProbeNaked")) + { + npc.active = false; + npc.netUpdate = true; + } + break; + case 16: + if (npc.type != mod.NPCType("AquaticScourgeHead") && npc.type != mod.NPCType("AquaticScourgeBody") && + npc.type != mod.NPCType("AquaticScourgeBodyAlt") && npc.type != mod.NPCType("AquaticScourgeTail") && + npc.type != mod.NPCType("AquaticParasite") && npc.type != mod.NPCType("AquaticUrchin") && + npc.type != mod.NPCType("AquaticSeekerHead") && npc.type != mod.NPCType("AquaticSeekerBody") && + npc.type != mod.NPCType("AquaticSeekerTail")) + { + npc.active = false; + npc.netUpdate = true; + } + break; + case 17: + if (npc.type != mod.NPCType("DesertScourgeHead") && npc.type != mod.NPCType("DesertScourgeBody") && + npc.type != mod.NPCType("DesertScourgeTail") && npc.type != mod.NPCType("DesertScourgeHeadSmall") && + npc.type != mod.NPCType("DesertScourgeBodySmall") && npc.type != mod.NPCType("DesertScourgeTailSmall") && + npc.type != mod.NPCType("DriedSeekerHead") && npc.type != mod.NPCType("DriedSeekerBody") && + npc.type != mod.NPCType("DriedSeekerTail")) + { + npc.active = false; + npc.netUpdate = true; + } + break; + case 18: + if (npc.type != NPCID.CultistBoss && npc.type != NPCID.CultistBossClone && npc.type != NPCID.CultistDragonHead && + npc.type != NPCID.CultistDragonBody1 && npc.type != NPCID.CultistDragonBody2 && npc.type != NPCID.CultistDragonBody3 && + npc.type != NPCID.CultistDragonBody4 && npc.type != NPCID.CultistDragonTail && npc.type != NPCID.AncientCultistSquidhead && + npc.type != NPCID.AncientLight && npc.type != NPCID.AncientDoom && npc.type != mod.NPCType("Eidolist")) + { + npc.active = false; + npc.netUpdate = true; + } + break; + case 19: + if (npc.type != mod.NPCType("CrabulonIdle") && npc.type != mod.NPCType("CrabShroom")) + { + npc.active = false; + npc.netUpdate = true; + } + break; + case 20: + if (npc.type != NPCID.Plantera && npc.type != NPCID.PlanterasTentacle && npc.type != NPCID.PlanterasHook && + npc.type != NPCID.Spore) + { + npc.active = false; + npc.netUpdate = true; + } + break; + case 21: + if (npc.type != mod.NPCType("CeaselessVoid") && npc.type != mod.NPCType("DarkEnergy") && + npc.type != mod.NPCType("DarkEnergy2") && npc.type != mod.NPCType("DarkEnergy3")) + { + npc.active = false; + npc.netUpdate = true; + } + break; + case 22: + if (npc.type != mod.NPCType("PerforatorHive") && npc.type != mod.NPCType("PerforatorHeadLarge") && + npc.type != mod.NPCType("PerforatorBodyLarge") && npc.type != mod.NPCType("PerforatorTailLarge") && + npc.type != mod.NPCType("PerforatorHeadMedium") && npc.type != mod.NPCType("PerforatorBodyMedium") && + npc.type != mod.NPCType("PerforatorTailMedium") && npc.type != mod.NPCType("PerforatorHeadSmall") && + npc.type != mod.NPCType("PerforatorBodySmall") && npc.type != mod.NPCType("PerforatorTailSmall")) + { + npc.active = false; + npc.netUpdate = true; + } + break; + case 23: + if (npc.type != mod.NPCType("Cryogen") && npc.type != mod.NPCType("CryogenIce") && + npc.type != mod.NPCType("IceMass") && npc.type != mod.NPCType("Cryocore") && + npc.type != mod.NPCType("Cryocore2")) + { + npc.active = false; + npc.netUpdate = true; + } + break; + case 24: + if (npc.type != mod.NPCType("BrimstoneElemental") && npc.type != mod.NPCType("Brimling")) + { + npc.active = false; + npc.netUpdate = true; + } + break; + case 25: + if (npc.type != mod.NPCType("CosmicWraith") && npc.type != mod.NPCType("SignusBomb") && + npc.type != mod.NPCType("CosmicLantern")) + { + npc.active = false; + npc.netUpdate = true; + } + break; + case 26: + if (npc.type != mod.NPCType("ScavengerBody") && npc.type != mod.NPCType("ScavengerHead") && + npc.type != mod.NPCType("ScavengerClawLeft") && npc.type != mod.NPCType("ScavengerClawRight") && + npc.type != mod.NPCType("ScavengerLegLeft") && npc.type != mod.NPCType("ScavengerLegRight") && + npc.type != mod.NPCType("ScavengerHead2") && npc.type != mod.NPCType("RockPillar") && + npc.type != mod.NPCType("FlamePillar")) + { + npc.active = false; + npc.netUpdate = true; + } + break; + case 27: + if (npc.type != NPCID.DukeFishron && npc.type != NPCID.DetonatingBubble && npc.type != NPCID.Sharkron && + npc.type != NPCID.Sharkron2) + { + npc.active = false; + npc.netUpdate = true; + } + break; + case 28: + if (npc.type != NPCID.MoonLordCore && npc.type != NPCID.MoonLordHead && npc.type != NPCID.MoonLordHand && + npc.type != NPCID.MoonLordFreeEye && npc.type != mod.NPCType("Eidolist")) + { + npc.active = false; + npc.netUpdate = true; + } + break; + case 29: + if (npc.type != mod.NPCType("AstrumDeusHead") && npc.type != mod.NPCType("AstrumDeusBody") && + npc.type != mod.NPCType("AstrumDeusTail") && npc.type != mod.NPCType("AstrumDeusHeadSpectral") && + npc.type != mod.NPCType("AstrumDeusBodySpectral") && npc.type != mod.NPCType("AstrumDeusTailSpectral") && + npc.type != mod.NPCType("AstrumDeusProbe") && npc.type != mod.NPCType("AstrumDeusProbe2") && + npc.type != mod.NPCType("AstrumDeusProbe3")) + { + npc.active = false; + npc.netUpdate = true; + } + break; + case 30: + if (npc.type != mod.NPCType("Polterghast") && npc.type != mod.NPCType("PhantomFuckYou") && + npc.type != mod.NPCType("PolterghastHook") && npc.type != mod.NPCType("PolterPhantom")) + { + npc.active = false; + npc.netUpdate = true; + } + break; + case 31: + if (npc.type != mod.NPCType("PlaguebringerGoliath") && npc.type != mod.NPCType("PlagueBeeG") && + npc.type != mod.NPCType("PlagueBeeLargeG") && npc.type != mod.NPCType("PlagueHomingMissile") && + npc.type != mod.NPCType("PlagueMine") && npc.type != mod.NPCType("PlaguebringerShade")) + { + npc.active = false; + npc.netUpdate = true; + } + break; + case 32: + if (npc.type != mod.NPCType("Calamitas") && npc.type != mod.NPCType("CalamitasRun") && + npc.type != mod.NPCType("CalamitasRun2") && npc.type != mod.NPCType("CalamitasRun3") && + npc.type != mod.NPCType("LifeSeeker") && npc.type != mod.NPCType("SoulSeeker")) + { + npc.active = false; + npc.netUpdate = true; + } + break; + case 33: + if (npc.type != mod.NPCType("Siren") && npc.type != mod.NPCType("Leviathan") && + npc.type != mod.NPCType("AquaticAberration") && npc.type != mod.NPCType("Parasea") && + npc.type != mod.NPCType("SirenClone") && npc.type != mod.NPCType("SirenIce")) + { + npc.active = false; + npc.netUpdate = true; + } + break; + case 34: + if (npc.type != mod.NPCType("SlimeGod") && npc.type != mod.NPCType("SlimeGodRun") && + npc.type != mod.NPCType("SlimeGodCore") && npc.type != mod.NPCType("SlimeGodSplit") && + npc.type != mod.NPCType("SlimeGodRunSplit") && npc.type != mod.NPCType("SlimeSpawnCorrupt") && + npc.type != mod.NPCType("SlimeSpawnCorrupt2") && npc.type != mod.NPCType("SlimeSpawnCrimson") && + npc.type != mod.NPCType("SlimeSpawnCrimson2")) + { + npc.active = false; + npc.netUpdate = true; + } + break; + case 35: + if (npc.type != mod.NPCType("Providence") && npc.type != mod.NPCType("ProvSpawnDefense") && + npc.type != mod.NPCType("ProvSpawnOffense") && npc.type != mod.NPCType("ProvSpawnHealer")) + { + npc.active = false; + npc.netUpdate = true; + } + break; + case 36: + if (npc.type != mod.NPCType("SupremeCalamitas") && npc.type != mod.NPCType("SCalWormBody") && + npc.type != mod.NPCType("SCalWormBodyWeak") && npc.type != mod.NPCType("SCalWormHead") && + npc.type != mod.NPCType("SCalWormTail") && npc.type != mod.NPCType("SoulSeekerSupreme") && + npc.type != mod.NPCType("SCalWormHeart") && npc.type != mod.NPCType("SupremeCataclysm") && + npc.type != mod.NPCType("SupremeCatastrophe")) + { + npc.active = false; + npc.netUpdate = true; + } + break; + case 37: + if (npc.type != mod.NPCType("Yharon") && npc.type != mod.NPCType("DetonatingFlare") && + npc.type != mod.NPCType("DetonatingFlare2") && npc.type != mod.NPCType("DetonatingFlare3") && + npc.type != mod.NPCType("Bumblefuck3") && npc.type != mod.NPCType("Bumblefuck4")) + { + npc.active = false; + npc.netUpdate = true; + } + break; + case 38: + if (npc.type != mod.NPCType("DevourerofGodsHeadS") && npc.type != mod.NPCType("DevourerofGodsBodyS") && + npc.type != mod.NPCType("DevourerofGodsTailS")) + { + npc.active = false; + npc.netUpdate = true; + } + break; + } + #region KSRush + if (npc.type == NPCID.KingSlime) + { + float num234 = 1f; + bool flag8 = false; + bool flag9 = false; + npc.aiAction = 0; + if (npc.ai[3] == 0f && npc.life > 0) + { + npc.ai[3] = (float)npc.lifeMax; + } + if (npc.localAI[3] == 0f && Main.netMode != 1) + { + npc.ai[0] = -100f; + npc.localAI[3] = 1f; + npc.TargetClosest(true); + npc.netUpdate = true; + } + if (Main.player[npc.target].dead) + { + npc.TargetClosest(true); + if (Main.player[npc.target].dead) + { + npc.timeLeft = 0; + if (Main.player[npc.target].Center.X < npc.Center.X) + { + npc.direction = 1; + } + else + { + npc.direction = -1; + } + } + } + if (!Main.player[npc.target].dead && npc.ai[2] >= 300f && npc.ai[1] < 5f && npc.velocity.Y == 0f) + { + npc.ai[2] = 0f; + npc.ai[0] = 0f; + npc.ai[1] = 5f; + if (Main.netMode != 1) + { + npc.TargetClosest(false); + Point point3 = npc.Center.ToTileCoordinates(); + Point point4 = Main.player[npc.target].Center.ToTileCoordinates(); + Vector2 vector30 = Main.player[npc.target].Center - npc.Center; + int num235 = 10; + int num236 = 0; + int num237 = 7; + int num238 = 0; + bool flag10 = false; + if (vector30.Length() > (enraged ? 1000f : 2000f)) + { + flag10 = true; + num238 = 100; + } + while (!flag10 && num238 < 100) + { + num238++; + int num239 = Main.rand.Next(point4.X - num235, point4.X + num235 + 1); + int num240 = Main.rand.Next(point4.Y - num235, point4.Y + 1); + if ((num240 < point4.Y - num237 || num240 > point4.Y + num237 || num239 < point4.X - num237 || num239 > point4.X + num237) && (num240 < point3.Y - num236 || num240 > point3.Y + num236 || num239 < point3.X - num236 || num239 > point3.X + num236) && !Main.tile[num239, num240].nactive()) + { + int num241 = num240; + int num242 = 0; + bool flag11 = Main.tile[num239, num241].nactive() && Main.tileSolid[(int)Main.tile[num239, num241].type] && !Main.tileSolidTop[(int)Main.tile[num239, num241].type]; + if (flag11) + { + num242 = 1; + } + else + { + while (num242 < 150 && num241 + num242 < Main.maxTilesY) + { + int num243 = num241 + num242; + bool flag12 = Main.tile[num239, num243].nactive() && Main.tileSolid[(int)Main.tile[num239, num243].type] && !Main.tileSolidTop[(int)Main.tile[num239, num243].type]; + if (flag12) + { + num242--; + break; + } + int num = num242; + num242 = num + 1; + } + } + num240 += num242; + bool flag13 = true; + if (flag13 && Main.tile[num239, num240].lava()) + { + flag13 = false; + } + if (flag13 && !Collision.CanHitLine(npc.Center, 0, 0, Main.player[npc.target].Center, 0, 0)) + { + flag13 = false; + } + if (flag13) + { + npc.localAI[1] = (float)(num239 * 16 + 8); + npc.localAI[2] = (float)(num240 * 16 + 16); + break; + } + } + } + if (num238 >= 100) + { + Vector2 bottom = Main.player[(int)Player.FindClosest(npc.position, npc.width, npc.height)].Bottom; + npc.localAI[1] = bottom.X; + npc.localAI[2] = bottom.Y; + } + } + } + if (!Collision.CanHitLine(npc.Center, 0, 0, Main.player[npc.target].Center, 0, 0)) + { + float[] var_9_AE8B_cp_0 = npc.ai; + int var_9_AE8B_cp_1 = 2; + float num244 = var_9_AE8B_cp_0[var_9_AE8B_cp_1]; + var_9_AE8B_cp_0[var_9_AE8B_cp_1] = num244 + 1f; + } + if (Math.Abs(npc.Top.Y - Main.player[npc.target].Bottom.Y) > 320f) + { + float[] var_9_AEDF_cp_0 = npc.ai; + int var_9_AEDF_cp_1 = 2; + float num244 = var_9_AEDF_cp_0[var_9_AEDF_cp_1]; + var_9_AEDF_cp_0[var_9_AEDF_cp_1] = num244 + 1f; + } + Dust dust; + if (npc.ai[1] == 5f) + { + flag8 = true; + npc.aiAction = 1; + float[] var_9_AF25_cp_0 = npc.ai; + int var_9_AF25_cp_1 = 0; + float num244 = var_9_AF25_cp_0[var_9_AF25_cp_1]; + var_9_AF25_cp_0[var_9_AF25_cp_1] = num244 + (enraged ? 2f : 1f); + num234 = MathHelper.Clamp((60f - npc.ai[0]) / 60f, 0f, 1f); + num234 = 0.5f + num234 * 0.5f; + if (npc.ai[0] >= 60f) + { + flag9 = true; + } + if (npc.ai[0] == 60f) + { + Gore.NewGore(npc.Center + new Vector2(-40f, (float)(-(float)npc.height / 2)), npc.velocity, 734, 1f); + } + if (npc.ai[0] >= 60f && Main.netMode != 1) + { + npc.Bottom = new Vector2(npc.localAI[1], npc.localAI[2]); + npc.ai[1] = 6f; + npc.ai[0] = 0f; + npc.netUpdate = true; + } + if (Main.netMode == 1 && npc.ai[0] >= 120f) + { + npc.ai[1] = 6f; + npc.ai[0] = 0f; + } + if (!flag9) + { + int num; + for (int num245 = 0; num245 < 10; num245 = num + 1) + { + int num246 = Dust.NewDust(npc.position + Vector2.UnitX * -20f, npc.width + 40, npc.height, 4, npc.velocity.X, npc.velocity.Y, 150, new Color(78, 136, 255, 80), 2f); + Main.dust[num246].noGravity = true; + dust = Main.dust[num246]; + dust.velocity *= 0.5f; + num = num245; + } + } + } + else if (npc.ai[1] == 6f) + { + flag8 = true; + npc.aiAction = 0; + float[] var_9_B163_cp_0 = npc.ai; + int var_9_B163_cp_1 = 0; + float num244 = var_9_B163_cp_0[var_9_B163_cp_1]; + var_9_B163_cp_0[var_9_B163_cp_1] = num244 + (enraged ? 2f : 1f); + num234 = MathHelper.Clamp(npc.ai[0] / 30f, 0f, 1f); + num234 = 0.5f + num234 * 0.5f; + if (npc.ai[0] >= 30f && Main.netMode != 1) + { + npc.ai[1] = 0f; + npc.ai[0] = 0f; + npc.netUpdate = true; + npc.TargetClosest(true); + } + if (Main.netMode == 1 && npc.ai[0] >= 60f) + { + npc.ai[1] = 0f; + npc.ai[0] = 0f; + npc.TargetClosest(true); + } + int num; + for (int num247 = 0; num247 < 10; num247 = num + 1) + { + int num248 = Dust.NewDust(npc.position + Vector2.UnitX * -20f, npc.width + 40, npc.height, 4, npc.velocity.X, npc.velocity.Y, 150, new Color(78, 136, 255, 80), 2f); + Main.dust[num248].noGravity = true; + dust = Main.dust[num248]; + dust.velocity *= 2f; + num = num247; + } + } + npc.dontTakeDamage = (npc.hide = flag9); + if (npc.velocity.Y == 0f) + { + npc.velocity.X = npc.velocity.X * 0.8f; + if ((double)npc.velocity.X > -0.1 && (double)npc.velocity.X < 0.1) + { + npc.velocity.X = 0f; + } + if (!flag8) + { + npc.ai[0] += enraged ? 4f : 2f; + if ((double)npc.life < (double)npc.lifeMax * 0.8) + { + npc.ai[0] += 1f; + } + if ((double)npc.life < (double)npc.lifeMax * 0.6) + { + npc.ai[0] += 1f; + } + if ((double)npc.life < (double)npc.lifeMax * 0.4) + { + npc.ai[0] += 2f; + } + if ((double)npc.life < (double)npc.lifeMax * 0.2) + { + npc.ai[0] += 3f; + } + if ((double)npc.life < (double)npc.lifeMax * 0.1) + { + npc.ai[0] += 4f; + } + if (npc.ai[0] >= 0f) + { + npc.netUpdate = true; + npc.TargetClosest(true); + if (npc.ai[1] == 3f) + { + npc.velocity.Y = -26f; + npc.velocity.X = npc.velocity.X + 7f * (float)npc.direction; + npc.ai[0] = -200f; + npc.ai[1] = 0f; + } + else if (npc.ai[1] == 2f) + { + npc.velocity.Y = -12f; + npc.velocity.X = npc.velocity.X + 9f * (float)npc.direction; + npc.ai[0] = -120f; + npc.ai[1] += 1f; + } + else + { + npc.velocity.Y = -16f; + npc.velocity.X = npc.velocity.X + 8f * (float)npc.direction; + npc.ai[0] = -120f; + npc.ai[1] += 1f; + } + } + else if (npc.ai[0] >= -30f) + { + npc.aiAction = 1; + } + } + } + else if (npc.target < 255 && ((npc.direction == 1 && npc.velocity.X < 3f) || (npc.direction == -1 && npc.velocity.X > -3f))) + { + if ((npc.direction == -1 && (double)npc.velocity.X < 0.1) || (npc.direction == 1 && (double)npc.velocity.X > -0.1)) + { + npc.velocity.X = npc.velocity.X + 0.2f * (float)npc.direction; + } + else + { + npc.velocity.X = npc.velocity.X * 0.93f; + } + } + int num249 = Dust.NewDust(npc.position, npc.width, npc.height, 4, npc.velocity.X, npc.velocity.Y, 255, new Color(0, 80, 255, 80), npc.scale * 1.2f); + Main.dust[num249].noGravity = true; + dust = Main.dust[num249]; + dust.velocity *= 0.5f; + if (npc.life > 0) + { + float num250 = (float)npc.life / (float)npc.lifeMax; + num250 = num250 * 0.5f + 0.75f; + num250 *= num234; + if (num250 != npc.scale) + { + npc.position.X = npc.position.X + (float)(npc.width / 2); + npc.position.Y = npc.position.Y + (float)npc.height; + npc.scale = num250; + npc.width = (int)(98f * npc.scale); + npc.height = (int)(92f * npc.scale); + npc.position.X = npc.position.X - (float)(npc.width / 2); + npc.position.Y = npc.position.Y - (float)npc.height; + } + if (Main.netMode != 1) + { + int num251 = (int)((double)npc.lifeMax * 0.05); + if ((float)(npc.life + num251) < npc.ai[3]) + { + npc.ai[3] = (float)npc.life; + int num252 = Main.rand.Next(1, 4); + int num; + for (int num253 = 0; num253 < num252; num253 = num + 1) + { + int x = (int)(npc.position.X + (float)Main.rand.Next(npc.width - 32)); + int y = (int)(npc.position.Y + (float)Main.rand.Next(npc.height - 32)); + int num254 = 1; + if (Main.rand.Next(4) == 0) + { + num254 = 535; + } + int num255 = NPC.NewNPC(x, y, num254, 0, 0f, 0f, 0f, 0f, 255); + Main.npc[num255].SetDefaults(num254, -1f); + Main.npc[num255].velocity.X = (float)Main.rand.Next(-15, 16) * 0.1f; + Main.npc[num255].velocity.Y = (float)Main.rand.Next(-30, 1) * 0.1f; + Main.npc[num255].ai[0] = (float)(-1000 * Main.rand.Next(3)); + Main.npc[num255].ai[1] = 0f; + if (Main.netMode == 2 && num255 < 200) + { + NetMessage.SendData(23, -1, -1, null, num255, 0f, 0f, 0f, 0, 0, 0); + } + num = num253; + } + return false; + } + } + } + return false; + } + #endregion + #region BoCRush + else if (npc.type == NPCID.BrainofCthulhu) + { + NPC.crimsonBoss = npc.whoAmI; + npc.dontTakeDamage = false; + if (Main.netMode != 1 && npc.localAI[0] == 0f) + { + npc.localAI[0] = 1f; + int num; + for (int num789 = 0; num789 < 20; num789 = num + 1) + { + float num790 = npc.Center.X; + float num791 = npc.Center.Y; + num790 += (float)Main.rand.Next(-npc.width, npc.width); + num791 += (float)Main.rand.Next(-npc.height, npc.height); + int num792 = NPC.NewNPC((int)num790, (int)num791, 267, 0, 0f, 0f, 0f, 0f, 255); + Main.npc[num792].velocity = new Vector2((float)Main.rand.Next(-30, 31) * 0.1f, (float)Main.rand.Next(-30, 31) * 0.1f); + Main.npc[num792].netUpdate = true; + num = num789; + } + } + if (npc.ai[0] < 0f) + { + if (npc.localAI[2] == 0f) + { + Main.PlaySound(3, (int)npc.position.X, (int)npc.position.Y, 1, 1f, 0f); + npc.localAI[2] = 1f; + Gore.NewGore(npc.position, new Vector2((float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f), 392, 1f); + Gore.NewGore(npc.position, new Vector2((float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f), 393, 1f); + Gore.NewGore(npc.position, new Vector2((float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f), 394, 1f); + Gore.NewGore(npc.position, new Vector2((float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f), 395, 1f); + int num; + for (int num794 = 0; num794 < 20; num794 = num + 1) + { + Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f, 0, default(Color), 1f); + num = num794; + } + Main.PlaySound(15, (int)npc.position.X, (int)npc.position.Y, 0, 1f, 0f); + } + newAI[0] += 1f; + if (newAI[0] >= 60f) + { + newAI[0] = 0f; + if (Main.netMode != 1 && NPC.CountNPCS(NPCID.Creeper) < 15) + { + int creeper = NPC.NewNPC((int)(npc.position.X + (float)(npc.width / 2) + npc.velocity.X), (int)(npc.position.Y + (float)(npc.height / 2) + npc.velocity.Y), 267, 0, 0f, 0f, 0f, 0f, 255); + Main.npc[creeper].netUpdate = true; + } + npc.netUpdate = true; + } + npc.knockBackResist = 0f; + npc.TargetClosest(true); + Vector2 vector98 = new Vector2(npc.Center.X, npc.Center.Y); + float num795 = Main.player[npc.target].Center.X - vector98.X; + float num796 = Main.player[npc.target].Center.Y - vector98.Y; + float num797 = (float)Math.Sqrt((double)(num795 * num795 + num796 * num796)); + float num798 = (enraged ? 21f : 14f); + num797 = num798 / num797; + num795 *= num797; + num796 *= num797; + npc.velocity.X = (npc.velocity.X * 50f + num795) / 51f; + npc.velocity.Y = (npc.velocity.Y * 50f + num796) / 51f; + if (npc.ai[0] == -1f) + { + if (Main.netMode != 1) + { + npc.localAI[1] += 1f; + if (npc.justHit) + { + npc.localAI[1] -= (float)Main.rand.Next(5); + } + int num799 = 60 + Main.rand.Next(120); + if (Main.netMode != 0) + { + num799 += Main.rand.Next(30, 90); + } + if (npc.localAI[1] >= (float)num799) + { + npc.localAI[1] = 0f; + npc.TargetClosest(true); + int num800 = 0; + int num801; + int num802; + while (true) + { + num800++; + num801 = (int)Main.player[npc.target].Center.X / 16; + num802 = (int)Main.player[npc.target].Center.Y / 16; + if (Main.rand.Next(2) == 0) + { + num801 += Main.rand.Next(7, 13); + } + else + { + num801 -= Main.rand.Next(7, 13); + } + if (Main.rand.Next(2) == 0) + { + num802 += Main.rand.Next(7, 13); + } + else + { + num802 -= Main.rand.Next(7, 13); + } + if (!WorldGen.SolidTile(num801, num802)) + { + break; + } + if (num800 > 100) + { + goto Block_2784; + } + } + npc.ai[3] = 0f; + npc.ai[0] = -2f; + npc.ai[1] = (float)num801; + npc.ai[2] = (float)num802; + npc.netUpdate = true; + npc.netSpam = 0; + Block_2784:; + } + } + } + else if (npc.ai[0] == -2f) + { + npc.velocity *= 0.9f; + if (Main.netMode != 0) + { + npc.ai[3] += 15f; + } + else + { + npc.ai[3] += 25f; + } + if (npc.ai[3] >= 255f) + { + npc.ai[3] = 255f; + npc.position.X = npc.ai[1] * 16f - (float)(npc.width / 2); + npc.position.Y = npc.ai[2] * 16f - (float)(npc.height / 2); + Main.PlaySound(SoundID.Item8, npc.Center); + npc.ai[0] = -3f; + npc.netUpdate = true; + npc.netSpam = 0; + } + npc.alpha = (int)npc.ai[3]; + } + else if (npc.ai[0] == -3f) + { + if (Main.netMode != 0) + { + npc.ai[3] -= 15f; + } + else + { + npc.ai[3] -= 25f; + } + if (npc.ai[3] <= 0f) + { + npc.ai[3] = 0f; + npc.ai[0] = -1f; + npc.netUpdate = true; + npc.netSpam = 0; + } + npc.alpha = (int)npc.ai[3]; + } + } + else + { + npc.TargetClosest(true); + Vector2 vector99 = new Vector2(npc.Center.X, npc.Center.Y); + float num803 = Main.player[npc.target].Center.X - vector99.X; + float num804 = Main.player[npc.target].Center.Y - vector99.Y; + float num805 = (float)Math.Sqrt((double)(num803 * num803 + num804 * num804)); + float num806 = (enraged ? 3f : 2f); + if (num805 < num806) + { + npc.velocity.X = num803; + npc.velocity.Y = num804; + } + else + { + num805 = num806 / num805; + npc.velocity.X = num803 * num805; + npc.velocity.Y = num804 * num805; + } + if (npc.ai[0] == 0f) + { + if (Main.netMode != 1) + { + int num807 = 0; + int num; + for (int num808 = 0; num808 < 200; num808 = num + 1) + { + if (Main.npc[num808].active && Main.npc[num808].type == 267) + { + num807++; + } + num = num808; + } + if (num807 == 0) + { + npc.ai[0] = -1f; + npc.localAI[1] = 0f; + npc.alpha = 0; + npc.netUpdate = true; + } + npc.localAI[1] += 1f; + if (npc.localAI[1] >= (float)(120 + Main.rand.Next(120))) + { + npc.localAI[1] = 0f; + npc.TargetClosest(true); + int num809 = 0; + int num810; + int num811; + while (true) + { + num809++; + num810 = (int)Main.player[npc.target].Center.X / 16; + num811 = (int)Main.player[npc.target].Center.Y / 16; + num810 += Main.rand.Next(-50, 51); + num811 += Main.rand.Next(-50, 51); + if (!WorldGen.SolidTile(num810, num811) && Collision.CanHit(new Vector2((float)(num810 * 16), (float)(num811 * 16)), 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) + { + break; + } + if (num809 > 100) + { + goto Block_2801; + } + } + npc.ai[0] = 1f; + npc.ai[1] = (float)num810; + npc.ai[2] = (float)num811; + npc.netUpdate = true; + Block_2801:; + } + } + } + else if (npc.ai[0] == 1f) + { + npc.alpha += 5; + if (npc.alpha >= 255) + { + Main.PlaySound(SoundID.Item8, npc.Center); + npc.alpha = 255; + npc.position.X = npc.ai[1] * 16f - (float)(npc.width / 2); + npc.position.Y = npc.ai[2] * 16f - (float)(npc.height / 2); + npc.ai[0] = 2f; + } + } + else if (npc.ai[0] == 2f) + { + npc.alpha -= 5; + if (npc.alpha <= 0) + { + npc.alpha = 0; + npc.ai[0] = 0f; + } + } + } + if (Main.player[npc.target].dead) + { + if (npc.localAI[3] < 120f) + { + float[] var_9_29972_cp_0 = npc.localAI; + int var_9_29972_cp_1 = 3; + float num244 = var_9_29972_cp_0[var_9_29972_cp_1]; + var_9_29972_cp_0[var_9_29972_cp_1] = num244 + 1f; + } + if (npc.localAI[3] > 60f) + { + npc.velocity.Y = npc.velocity.Y + (npc.localAI[3] - 60f) * 0.25f; + } + npc.ai[0] = 2f; + npc.alpha = 10; + return false; + } + if (npc.localAI[3] > 0f) + { + float[] var_9_299F7_cp_0 = npc.localAI; + int var_9_299F7_cp_1 = 3; + float num244 = var_9_299F7_cp_0[var_9_299F7_cp_1]; + var_9_299F7_cp_0[var_9_299F7_cp_1] = num244 - 1f; + return false; + } + return false; + } + #endregion + #region EoWRush + else if (npc.type == NPCID.EaterofWorldsHead) + { + Main.player[npc.target].ZoneCorrupt = true; + npc.reflectingProjectiles = true; + if (!Main.player[npc.target].dead) + { + newAI[0] += (enraged ? 6f : 3f); + } + if (newAI[0] >= 180f) + { + newAI[0] = 0f; + if (Collision.CanHit(npc.Center, 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) + { + Vector2 vector34 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float num349 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector34.X; + float num350 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector34.Y; + float num351 = (float)Math.Sqrt((double)(num349 * num349 + num350 * num350)); + num349 *= num351; + num350 *= num351; + if (Main.netMode != 1) + { + float num418 = (enraged ? 18f : 12f); + int num419 = 12; + int num420 = 96; + num351 = (float)Math.Sqrt((double)(num349 * num349 + num350 * num350)); + num351 = num418 / num351; + num349 *= num351; + num350 *= num351; + num349 += (float)Main.rand.Next(-40, 41) * 0.05f; + num350 += (float)Main.rand.Next(-40, 41) * 0.05f; + vector34.X += num349 * 4f; + vector34.Y += num350 * 4f; + Projectile.NewProjectile(vector34.X, vector34.Y, num349, num350, num420, num419, 0f, Main.myPlayer, 0f, 0f); + } + } + } + } + #endregion + #region QBRush + else if (npc.type == NPCID.QueenBee) + { + int num592 = 0; + int variable; + for (int num593 = 0; num593 < 255; num593 = variable + 1) + { + if (Main.player[num593].active && !Main.player[num593].dead && (npc.Center - Main.player[num593].Center).Length() < 1000f) + { + num592++; + } + variable = num593; + } + int num594 = (int)(20f * (1f - (float)npc.life / (float)npc.lifeMax)); + npc.defense = npc.defDefense + num594; + if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead || !Main.player[npc.target].active) + { + npc.TargetClosest(true); + } + bool dead4 = Main.player[npc.target].dead; + if (dead4) + { + if ((double)npc.position.Y < Main.worldSurface * 16.0 + 2000.0) + { + npc.velocity.Y = npc.velocity.Y + 0.04f; + } + if (npc.position.X < (float)(Main.maxTilesX * 8)) + { + npc.velocity.X = npc.velocity.X - 0.04f; + } + else + { + npc.velocity.X = npc.velocity.X + 0.04f; + } + if (npc.timeLeft > 10) + { + npc.timeLeft = 10; + return false; + } + } + else if (npc.ai[0] == -1f) + { + if (Main.netMode != 1) + { + float num595 = npc.ai[1]; + int num596; + do + { + num596 = Main.rand.Next(3); + if (num596 == 1) + { + num596 = 2; + } + else if (num596 == 2) + { + num596 = 3; + } + } + while ((float)num596 == num595); + npc.ai[0] = (float)num596; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + return false; + } + } + else if (npc.ai[0] == 0f) + { + int num597 = 5; + if (npc.ai[1] > (float)(2 * num597) && npc.ai[1] % 2f == 0f) + { + npc.ai[0] = -1f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.netUpdate = true; + return false; + } + if (npc.ai[1] % 2f == 0f) + { + npc.TargetClosest(true); + if (Math.Abs(npc.position.Y + (float)(npc.height / 2) - (Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2))) < 20f) + { + npc.localAI[0] = 1f; + npc.ai[1] += 1f; + npc.ai[2] = 0f; + float num598 = 24f; + Vector2 vector74 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float num599 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector74.X; + float num600 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector74.Y; + float num601 = (float)Math.Sqrt((double)(num599 * num599 + num600 * num600)); + num601 = num598 / num601; + npc.velocity.X = num599 * num601; + npc.velocity.Y = num600 * num601; + npc.spriteDirection = npc.direction; + Main.PlaySound(15, (int)npc.position.X, (int)npc.position.Y, 0, 1f, 0f); + return false; + } + npc.localAI[0] = 0f; + float num602 = 18f; + float num603 = 0.4f; + if (npc.position.Y + (float)(npc.height / 2) < Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2)) + { + npc.velocity.Y = npc.velocity.Y + num603; + } + else + { + npc.velocity.Y = npc.velocity.Y - num603; + } + if (npc.velocity.Y < -12f) + { + npc.velocity.Y = -num602; + } + if (npc.velocity.Y > 12f) + { + npc.velocity.Y = num602; + } + if (Math.Abs(npc.position.X + (float)(npc.width / 2) - (Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2))) > 600f) + { + npc.velocity.X = npc.velocity.X + 0.15f * (float)npc.direction; + } + else if (Math.Abs(npc.position.X + (float)(npc.width / 2) - (Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2))) < 300f) + { + npc.velocity.X = npc.velocity.X - 0.15f * (float)npc.direction; + } + else + { + npc.velocity.X = npc.velocity.X * 0.8f; + } + if (npc.velocity.X < -16f) + { + npc.velocity.X = -16f; + } + if (npc.velocity.X > 16f) + { + npc.velocity.X = 16f; + } + npc.spriteDirection = npc.direction; + return false; + } + else + { + if (npc.velocity.X < 0f) + { + npc.direction = -1; + } + else + { + npc.direction = 1; + } + npc.spriteDirection = npc.direction; + int num604 = (enraged ? 150 : 250); + int num605 = 1; + if (npc.position.X + (float)(npc.width / 2) < Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2)) + { + num605 = -1; + } + if (npc.direction == num605 && Math.Abs(npc.position.X + (float)(npc.width / 2) - (Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2))) > (float)num604) + { + npc.ai[2] = 1f; + } + if (npc.ai[2] != 1f) + { + npc.localAI[0] = 1f; + return false; + } + npc.TargetClosest(true); + npc.spriteDirection = npc.direction; + npc.localAI[0] = 0f; + npc.velocity *= 0.9f; + float num606 = 0.25f; + if (npc.life < npc.lifeMax / 2) + { + npc.velocity *= 0.9f; + } + if (npc.life < npc.lifeMax / 3) + { + npc.velocity *= 0.9f; + } + if (npc.life < npc.lifeMax / 5) + { + npc.velocity *= 0.9f; + } + if (Math.Abs(npc.velocity.X) + Math.Abs(npc.velocity.Y) < num606) + { + npc.ai[2] = 0f; + npc.ai[1] += 1f; + return false; + } + } + } + else if (npc.ai[0] == 2f) + { + npc.TargetClosest(true); + npc.spriteDirection = npc.direction; + float num607 = 12f; + float num608 = 0.1f; + Vector2 vector75 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float num609 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector75.X; + float num610 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - 200f - vector75.Y; + float num611 = (float)Math.Sqrt((double)(num609 * num609 + num610 * num610)); + if (num611 < 200f) + { + npc.ai[0] = 1f; + npc.ai[1] = 0f; + npc.netUpdate = true; + return false; + } + num611 = num607 / num611; + if (npc.velocity.X < num609) + { + npc.velocity.X = npc.velocity.X + num608; + if (npc.velocity.X < 0f && num609 > 0f) + { + npc.velocity.X = npc.velocity.X + num608; + } + } + else if (npc.velocity.X > num609) + { + npc.velocity.X = npc.velocity.X - num608; + if (npc.velocity.X > 0f && num609 < 0f) + { + npc.velocity.X = npc.velocity.X - num608; + } + } + if (npc.velocity.Y < num610) + { + npc.velocity.Y = npc.velocity.Y + num608; + if (npc.velocity.Y < 0f && num610 > 0f) + { + npc.velocity.Y = npc.velocity.Y + num608; + return false; + } + } + else if (npc.velocity.Y > num610) + { + npc.velocity.Y = npc.velocity.Y - num608; + if (npc.velocity.Y > 0f && num610 < 0f) + { + npc.velocity.Y = npc.velocity.Y - num608; + return false; + } + } + } + else if (npc.ai[0] == 1f) + { + npc.localAI[0] = 0f; + npc.TargetClosest(true); + Vector2 vector76 = new Vector2(npc.position.X + (float)(npc.width / 2) + (float)(Main.rand.Next(20) * npc.direction), npc.position.Y + (float)npc.height * 0.8f); + Vector2 vector77 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float num612 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector77.X; + float num613 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector77.Y; + float num614 = (float)Math.Sqrt((double)(num612 * num612 + num613 * num613)); + npc.ai[1] += 1f; + npc.ai[1] += (float)(num592 / 2); + bool flag38 = false; + if (npc.ai[1] > 10f) + { + npc.ai[1] = 0f; + float[] var_9_2174E_cp_0 = npc.ai; + int var_9_2174E_cp_1 = 2; + float num244 = var_9_2174E_cp_0[var_9_2174E_cp_1]; + var_9_2174E_cp_0[var_9_2174E_cp_1] = num244 + 1f; + flag38 = true; + } + if (Collision.CanHit(vector76, 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height) && flag38) + { + Main.PlaySound(3, (int)npc.position.X, (int)npc.position.Y, 1, 1f, 0f); + if (Main.netMode != 1) + { + int num615 = Main.rand.Next(210, 212); + int num616 = NPC.NewNPC((int)vector76.X, (int)vector76.Y, num615, 0, 0f, 0f, 0f, 0f, 255); + Main.npc[num616].velocity.X = (float)Main.rand.Next(-200, 201) * 0.002f; + Main.npc[num616].velocity.Y = (float)Main.rand.Next(-200, 201) * 0.002f; + Main.npc[num616].localAI[0] = 60f; + Main.npc[num616].netUpdate = true; + } + } + if (num614 > 400f || !Collision.CanHit(new Vector2(vector76.X, vector76.Y - 30f), 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) + { + float num617 = 14f; + float num618 = 0.1f; + vector77 = vector76; + num612 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector77.X; + num613 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector77.Y; + num614 = (float)Math.Sqrt((double)(num612 * num612 + num613 * num613)); + num614 = num617 / num614; + if (npc.velocity.X < num612) + { + npc.velocity.X = npc.velocity.X + num618; + if (npc.velocity.X < 0f && num612 > 0f) + { + npc.velocity.X = npc.velocity.X + num618; + } + } + else if (npc.velocity.X > num612) + { + npc.velocity.X = npc.velocity.X - num618; + if (npc.velocity.X > 0f && num612 < 0f) + { + npc.velocity.X = npc.velocity.X - num618; + } + } + if (npc.velocity.Y < num613) + { + npc.velocity.Y = npc.velocity.Y + num618; + if (npc.velocity.Y < 0f && num613 > 0f) + { + npc.velocity.Y = npc.velocity.Y + num618; + } + } + else if (npc.velocity.Y > num613) + { + npc.velocity.Y = npc.velocity.Y - num618; + if (npc.velocity.Y > 0f && num613 < 0f) + { + npc.velocity.Y = npc.velocity.Y - num618; + } + } + } + else + { + npc.velocity *= 0.9f; + } + npc.spriteDirection = npc.direction; + if (npc.ai[2] > 5f) + { + npc.ai[0] = -1f; + npc.ai[1] = 1f; + npc.netUpdate = true; + return false; + } + } + else if (npc.ai[0] == 3f) + { + float num619 = 6f; + float num620 = 0.075f; + Vector2 vector78 = new Vector2(npc.position.X + (float)(npc.width / 2) + (float)(Main.rand.Next(20) * npc.direction), npc.position.Y + (float)npc.height * 0.8f); + Vector2 vector79 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float num621 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector79.X; + float num622 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - 300f - vector79.Y; + float num623 = (float)Math.Sqrt((double)(num621 * num621 + num622 * num622)); + npc.ai[1] += 1f; + bool flag39 = false; + if (npc.ai[1] % 15f == 14f) + { + flag39 = true; + } + if (flag39 && npc.position.Y + (float)npc.height < Main.player[npc.target].position.Y && Collision.CanHit(vector78, 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) + { + Main.PlaySound(SoundID.Item17, npc.position); + if (Main.netMode != 1) + { + float num624 = (enraged ? 24f : 16f); + float num625 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector78.X + (float)Main.rand.Next(-80, 81); + float num626 = Main.player[npc.target].position.Y + (float)Main.player[npc.target].height * 0.5f - vector78.Y + (float)Main.rand.Next(-40, 41); + float num627 = (float)Math.Sqrt((double)(num625 * num625 + num626 * num626)); + num627 = num624 / num627; + num625 *= num627; + num626 *= num627; + int num628 = 11; + int num629 = 55; + int num630 = Projectile.NewProjectile(vector78.X, vector78.Y, num625, num626, num629, num628, 0f, Main.myPlayer, 0f, 0f); + Main.projectile[num630].timeLeft = 300; + } + } + if (!Collision.CanHit(new Vector2(vector78.X, vector78.Y - 30f), 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) + { + num619 = 14f; + num620 = 0.1f; + vector79 = vector78; + num621 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector79.X; + num622 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector79.Y; + num623 = (float)Math.Sqrt((double)(num621 * num621 + num622 * num622)); + num623 = num619 / num623; + if (npc.velocity.X < num621) + { + npc.velocity.X = npc.velocity.X + num620; + if (npc.velocity.X < 0f && num621 > 0f) + { + npc.velocity.X = npc.velocity.X + num620; + } + } + else if (npc.velocity.X > num621) + { + npc.velocity.X = npc.velocity.X - num620; + if (npc.velocity.X > 0f && num621 < 0f) + { + npc.velocity.X = npc.velocity.X - num620; + } + } + if (npc.velocity.Y < num622) + { + npc.velocity.Y = npc.velocity.Y + num620; + if (npc.velocity.Y < 0f && num622 > 0f) + { + npc.velocity.Y = npc.velocity.Y + num620; + } + } + else if (npc.velocity.Y > num622) + { + npc.velocity.Y = npc.velocity.Y - num620; + if (npc.velocity.Y > 0f && num622 < 0f) + { + npc.velocity.Y = npc.velocity.Y - num620; + } + } + } + else if (num623 > 100f) + { + npc.TargetClosest(true); + npc.spriteDirection = npc.direction; + num623 = num619 / num623; + if (npc.velocity.X < num621) + { + npc.velocity.X = npc.velocity.X + num620; + if (npc.velocity.X < 0f && num621 > 0f) + { + npc.velocity.X = npc.velocity.X + num620 * 2f; + } + } + else if (npc.velocity.X > num621) + { + npc.velocity.X = npc.velocity.X - num620; + if (npc.velocity.X > 0f && num621 < 0f) + { + npc.velocity.X = npc.velocity.X - num620 * 2f; + } + } + if (npc.velocity.Y < num622) + { + npc.velocity.Y = npc.velocity.Y + num620; + if (npc.velocity.Y < 0f && num622 > 0f) + { + npc.velocity.Y = npc.velocity.Y + num620 * 2f; + } + } + else if (npc.velocity.Y > num622) + { + npc.velocity.Y = npc.velocity.Y - num620; + if (npc.velocity.Y > 0f && num622 < 0f) + { + npc.velocity.Y = npc.velocity.Y - num620 * 2f; + } + } + } + if (npc.ai[1] > 400f) + { + npc.ai[0] = -1f; + npc.ai[1] = 3f; + npc.netUpdate = true; + return false; + } + } + return false; + } + #endregion + #region DFRush + else if (npc.type == NPCID.DukeFishron) + { + if (npc.ai[0] == -1f || npc.ai[0] == 4f || npc.ai[0] == 9f) + { + npc.dontTakeDamage = true; + } + else if (npc.ai[0] <= 8f) + { + npc.dontTakeDamage = false; + } + float newDamage = (0.6f * Main.damageMultiplier); + bool flag = (double)npc.life <= (double)npc.lifeMax * 0.99; + bool flag2 = (double)npc.life <= (double)npc.lifeMax * 0.15; + bool flag3 = npc.ai[0] > 4f; + bool flag4 = npc.ai[0] > 9f; + bool flag5 = npc.ai[3] < 10f; + Vector2 vector = npc.Center; + if (flag4) + { + newAI[0] += 1f; + if (newAI[0] >= 480f) + { + newAI[0] = 0f; + if (Main.netMode != 1) + { + Projectile.NewProjectile(vector.X, vector.Y, 0f, 0f, 385, 0, 0f, Main.myPlayer, 1f, (float)(npc.target + 1)); + } + npc.netUpdate = true; + } + npc.damage = (int)((float)npc.defDamage * 1.5f * newDamage); + npc.defense = 38; + } + else if (flag3) + { + npc.damage = (int)((float)npc.defDamage * 2.2f * newDamage); + npc.defense = (int)((float)npc.defDefense * 0.8f); + } + else + { + npc.damage = npc.defDamage; + npc.defense = npc.defDefense; + } + int num2 = 35; + float num3 = 0.65f; + float scaleFactor = 9.5f; + if (flag4) + { + num3 = (enraged ? 0.9f : 0.8f); + scaleFactor = (enraged ? 15f : 13f); + num2 = (enraged ? 22 : 25); + } + else if (flag3 & flag5) + { + num3 = (enraged ? 0.8f : 0.7f); + scaleFactor = (enraged ? 13f : 11f); + num2 = (enraged ? 30 : 35); + } + else if (flag5 && !flag3 && !flag4) + { + num2 = 25; + } + int num4 = 24; + float num5 = 18f; + if (flag4) + { + num4 = (enraged ? 18 : 20); + num5 = (enraged ? 30f : 28f); + } + else if (flag5 & flag3) + { + num4 = (enraged ? 21 : 23); + num5 = (enraged ? 25f : 22f); + } + int num6 = 80; + int num7 = 4; + float num8 = 0.3f; + float scaleFactor2 = 5f; + int num9 = 90; + int num10 = 180; + int num11 = 180; + int num12 = 30; + int num13 = 120; + int num14 = 4; + float scaleFactor3 = 6f; + float scaleFactor4 = 20f; + float num15 = 6.28318548f / (float)(num13 / 2); + int num16 = 75; + Player player = Main.player[npc.target]; + if (npc.target < 0 || npc.target == 255 || player.dead || !player.active) + { + npc.TargetClosest(true); + player = Main.player[npc.target]; + npc.netUpdate = true; + } + if (player.dead || Vector2.Distance(player.Center, vector) > 5600f) + { + npc.velocity.Y = npc.velocity.Y - 0.4f; + if (npc.timeLeft > 10) + { + npc.timeLeft = 10; + } + if (npc.ai[0] > 4f) + { + npc.ai[0] = 5f; + } + else + { + npc.ai[0] = 0f; + } + npc.ai[2] = 0f; + } + if (player.position.Y < 800f || (double)player.position.Y > Main.worldSurface * 16.0 || (player.position.X > 6400f && player.position.X < (float)(Main.maxTilesX * 16 - 6400))) + { + num2 = 20; + num5 += 6f; + } + if (npc.localAI[0] == 0f) + { + npc.localAI[0] = 1f; + npc.alpha = 255; + npc.rotation = 0f; + if (Main.netMode != 1) + { + npc.ai[0] = -1f; + npc.netUpdate = true; + } + } + float num17 = (float)Math.Atan2((double)(player.Center.Y - vector.Y), (double)(player.Center.X - vector.X)); + if (npc.spriteDirection == 1) + { + num17 += 3.14159274f; + } + if (num17 < 0f) + { + num17 += 6.28318548f; + } + if (num17 > 6.28318548f) + { + num17 -= 6.28318548f; + } + if (npc.ai[0] == -1f) + { + num17 = 0f; + } + if (npc.ai[0] == 3f) + { + num17 = 0f; + } + if (npc.ai[0] == 4f) + { + num17 = 0f; + } + if (npc.ai[0] == 8f) + { + num17 = 0f; + } + float num18 = 0.04f; + if (npc.ai[0] == 1f || npc.ai[0] == 6f) + { + num18 = 0f; + } + if (npc.ai[0] == 7f) + { + num18 = 0f; + } + if (npc.ai[0] == 3f) + { + num18 = 0.01f; + } + if (npc.ai[0] == 4f) + { + num18 = 0.01f; + } + if (npc.ai[0] == 8f) + { + num18 = 0.01f; + } + if (npc.rotation < num17) + { + if ((double)(num17 - npc.rotation) > 3.1415926535897931) + { + npc.rotation -= num18; + } + else + { + npc.rotation += num18; + } + } + if (npc.rotation > num17) + { + if ((double)(npc.rotation - num17) > 3.1415926535897931) + { + npc.rotation += num18; + } + else + { + npc.rotation -= num18; + } + } + if (npc.rotation > num17 - num18 && npc.rotation < num17 + num18) + { + npc.rotation = num17; + } + if (npc.rotation < 0f) + { + npc.rotation += 6.28318548f; + } + if (npc.rotation > 6.28318548f) + { + npc.rotation -= 6.28318548f; + } + if (npc.rotation > num17 - num18 && npc.rotation < num17 + num18) + { + npc.rotation = num17; + } + if (npc.ai[0] != -1f && npc.ai[0] < 9f) + { + if (Collision.SolidCollision(npc.position, npc.width, npc.height)) + { + npc.alpha += 15; + } + else + { + npc.alpha -= 15; + } + if (npc.alpha < 0) + { + npc.alpha = 0; + } + if (npc.alpha > 150) + { + npc.alpha = 150; + } + } + if (npc.ai[0] == -1f) + { + npc.velocity *= 0.98f; + int num19 = Math.Sign(player.Center.X - vector.X); + if (num19 != 0) + { + npc.direction = num19; + npc.spriteDirection = -npc.direction; + } + if (npc.ai[2] > 20f) + { + npc.velocity.Y = -2f; + npc.alpha -= 5; + if (Collision.SolidCollision(npc.position, npc.width, npc.height)) + { + npc.alpha += 15; + } + if (npc.alpha < 0) + { + npc.alpha = 0; + } + if (npc.alpha > 150) + { + npc.alpha = 150; + } + } + if (npc.ai[2] == (float)(num9 - 30)) + { + int num20 = 36; + for (int i = 0; i < num20; i++) + { + Vector2 expr_80F = (Vector2.Normalize(npc.velocity) * new Vector2((float)npc.width / 2f, (float)npc.height) * 0.75f * 0.5f).RotatedBy((double)((float)(i - (num20 / 2 - 1)) * 6.28318548f / (float)num20), default(Vector2)) + npc.Center; + Vector2 vector2 = expr_80F - npc.Center; + int num21 = Dust.NewDust(expr_80F + vector2, 0, 0, 172, vector2.X * 2f, vector2.Y * 2f, 100, default(Color), 1.4f); + Main.dust[num21].noGravity = true; + Main.dust[num21].noLight = true; + Main.dust[num21].velocity = Vector2.Normalize(vector2) * 3f; + } + Main.PlaySound(29, (int)vector.X, (int)vector.Y, 20, 1f, 0f); + } + npc.ai[2] += 1f; + if (npc.ai[2] >= (float)num16) + { + npc.ai[0] = 0f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.netUpdate = true; + return false; + } + } + else if (npc.ai[0] == 0f && !player.dead) + { + if (npc.ai[1] == 0f) + { + npc.ai[1] = (float)(300 * Math.Sign((vector - player.Center).X)); + } + Vector2 vector3 = Vector2.Normalize(player.Center + new Vector2(npc.ai[1], -200f) - vector - npc.velocity) * scaleFactor; + if (npc.velocity.X < vector3.X) + { + npc.velocity.X = npc.velocity.X + num3; + if (npc.velocity.X < 0f && vector3.X > 0f) + { + npc.velocity.X = npc.velocity.X + num3; + } + } + else if (npc.velocity.X > vector3.X) + { + npc.velocity.X = npc.velocity.X - num3; + if (npc.velocity.X > 0f && vector3.X < 0f) + { + npc.velocity.X = npc.velocity.X - num3; + } + } + if (npc.velocity.Y < vector3.Y) + { + npc.velocity.Y = npc.velocity.Y + num3; + if (npc.velocity.Y < 0f && vector3.Y > 0f) + { + npc.velocity.Y = npc.velocity.Y + num3; + } + } + else if (npc.velocity.Y > vector3.Y) + { + npc.velocity.Y = npc.velocity.Y - num3; + if (npc.velocity.Y > 0f && vector3.Y < 0f) + { + npc.velocity.Y = npc.velocity.Y - num3; + } + } + int num22 = Math.Sign(player.Center.X - vector.X); + if (num22 != 0) + { + if (npc.ai[2] == 0f && num22 != npc.direction) + { + npc.rotation += 3.14159274f; + } + npc.direction = num22; + if (npc.spriteDirection != -npc.direction) + { + npc.rotation += 3.14159274f; + } + npc.spriteDirection = -npc.direction; + } + npc.ai[2] += 1f; + if (npc.ai[2] >= (float)num2) + { + int num23 = 0; + switch ((int)npc.ai[3]) + { + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + num23 = 1; + break; + case 10: + npc.ai[3] = 1f; + num23 = 2; + break; + case 11: + npc.ai[3] = 0f; + num23 = 3; + break; + } + if (flag) + { + num23 = 4; + } + if (num23 == 1) + { + npc.ai[0] = 1f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.velocity = Vector2.Normalize(player.Center - vector) * num5; + npc.rotation = (float)Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X); + if (num22 != 0) + { + npc.direction = num22; + if (npc.spriteDirection == 1) + { + npc.rotation += 3.14159274f; + } + npc.spriteDirection = -npc.direction; + } + } + else if (num23 == 2) + { + npc.ai[0] = 2f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + } + else if (num23 == 3) + { + npc.ai[0] = 3f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + } + else if (num23 == 4) + { + npc.ai[0] = 4f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + } + npc.netUpdate = true; + return false; + } + } + else if (npc.ai[0] == 1f) + { + int num24 = 7; + for (int j = 0; j < num24; j++) + { + Vector2 arg_E1C_0 = (Vector2.Normalize(npc.velocity) * new Vector2((float)(npc.width + 50) / 2f, (float)npc.height) * 0.75f).RotatedBy((double)(j - (num24 / 2 - 1)) * 3.1415926535897931 / (double)((float)num24), default(Vector2)) + vector; + Vector2 vector4 = ((float)(Main.rand.NextDouble() * 3.1415927410125732) - 1.57079637f).ToRotationVector2() * (float)Main.rand.Next(3, 8); + int num25 = Dust.NewDust(arg_E1C_0 + vector4, 0, 0, 172, vector4.X * 2f, vector4.Y * 2f, 100, default(Color), 1.4f); + Main.dust[num25].noGravity = true; + Main.dust[num25].noLight = true; + Main.dust[num25].velocity /= 4f; + Main.dust[num25].velocity -= npc.velocity; + } + npc.ai[2] += 1f; + if (npc.ai[2] >= (float)num4) + { + npc.ai[0] = 0f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.ai[3] += 2f; + npc.netUpdate = true; + return false; + } + } + else if (npc.ai[0] == 2f) + { + if (npc.ai[1] == 0f) + { + npc.ai[1] = (float)(300 * Math.Sign((vector - player.Center).X)); + } + Vector2 vector5 = Vector2.Normalize(player.Center + new Vector2(npc.ai[1], -200f) - vector - npc.velocity) * scaleFactor2; + if (npc.velocity.X < vector5.X) + { + npc.velocity.X = npc.velocity.X + num8; + if (npc.velocity.X < 0f && vector5.X > 0f) + { + npc.velocity.X = npc.velocity.X + num8; + } + } + else if (npc.velocity.X > vector5.X) + { + npc.velocity.X = npc.velocity.X - num8; + if (npc.velocity.X > 0f && vector5.X < 0f) + { + npc.velocity.X = npc.velocity.X - num8; + } + } + if (npc.velocity.Y < vector5.Y) + { + npc.velocity.Y = npc.velocity.Y + num8; + if (npc.velocity.Y < 0f && vector5.Y > 0f) + { + npc.velocity.Y = npc.velocity.Y + num8; + } + } + else if (npc.velocity.Y > vector5.Y) + { + npc.velocity.Y = npc.velocity.Y - num8; + if (npc.velocity.Y > 0f && vector5.Y < 0f) + { + npc.velocity.Y = npc.velocity.Y - num8; + } + } + if (npc.ai[2] == 0f) + { + Main.PlaySound(29, (int)vector.X, (int)vector.Y, 20, 1f, 0f); + } + if (npc.ai[2] % (float)num7 == 0f) + { + Main.PlaySound(4, (int)npc.Center.X, (int)npc.Center.Y, 19, 1f, 0f); + if (Main.netMode != 1) + { + Vector2 vector6 = Vector2.Normalize(player.Center - vector) * (float)(npc.width + 20) / 2f + vector; + NPC.NewNPC((int)vector6.X, (int)vector6.Y + 45, 371, 0, 0f, 0f, 0f, 0f, 255); + } + } + int num26 = Math.Sign(player.Center.X - vector.X); + if (num26 != 0) + { + npc.direction = num26; + if (npc.spriteDirection != -npc.direction) + { + npc.rotation += 3.14159274f; + } + npc.spriteDirection = -npc.direction; + } + npc.ai[2] += 1f; + if (npc.ai[2] >= (float)num6) + { + npc.ai[0] = 0f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.netUpdate = true; + return false; + } + } + else if (npc.ai[0] == 3f) + { + npc.velocity *= 0.98f; + npc.velocity.Y = MathHelper.Lerp(npc.velocity.Y, 0f, 0.02f); + if (npc.ai[2] == (float)(num9 - 30)) + { + Main.PlaySound(29, (int)vector.X, (int)vector.Y, 9, 1f, 0f); + } + if (Main.netMode != 1 && npc.ai[2] == (float)(num9 - 30)) + { + Vector2 vector7 = npc.rotation.ToRotationVector2() * (Vector2.UnitX * (float)npc.direction) * (float)(npc.width + 20) / 2f + vector; + Projectile.NewProjectile(vector7.X, vector7.Y, (float)(npc.direction * 2), 8f, 385, 0, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(vector7.X, vector7.Y, (float)(-(float)npc.direction * 2), 8f, 385, 0, 0f, Main.myPlayer, 0f, 0f); + } + npc.ai[2] += 1f; + if (npc.ai[2] >= (float)num9) + { + npc.ai[0] = 0f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.netUpdate = true; + return false; + } + } + else if (npc.ai[0] == 4f) + { + npc.velocity *= 0.98f; + npc.velocity.Y = MathHelper.Lerp(npc.velocity.Y, 0f, 0.02f); + if (npc.ai[2] == (float)(num10 - 60)) + { + Main.PlaySound(29, (int)vector.X, (int)vector.Y, 20, 1f, 0f); + } + npc.ai[2] += 1f; + if (npc.ai[2] >= (float)num10) + { + npc.ai[0] = 5f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.ai[3] = 0f; + npc.netUpdate = true; + return false; + } + } + else if (npc.ai[0] == 5f && !player.dead) + { + if (npc.ai[1] == 0f) + { + npc.ai[1] = (float)(300 * Math.Sign((vector - player.Center).X)); + } + Vector2 vector8 = Vector2.Normalize(player.Center + new Vector2(npc.ai[1], -200f) - vector - npc.velocity) * scaleFactor; + if (npc.velocity.X < vector8.X) + { + npc.velocity.X = npc.velocity.X + num3; + if (npc.velocity.X < 0f && vector8.X > 0f) + { + npc.velocity.X = npc.velocity.X + num3; + } + } + else if (npc.velocity.X > vector8.X) + { + npc.velocity.X = npc.velocity.X - num3; + if (npc.velocity.X > 0f && vector8.X < 0f) + { + npc.velocity.X = npc.velocity.X - num3; + } + } + if (npc.velocity.Y < vector8.Y) + { + npc.velocity.Y = npc.velocity.Y + num3; + if (npc.velocity.Y < 0f && vector8.Y > 0f) + { + npc.velocity.Y = npc.velocity.Y + num3; + } + } + else if (npc.velocity.Y > vector8.Y) + { + npc.velocity.Y = npc.velocity.Y - num3; + if (npc.velocity.Y > 0f && vector8.Y < 0f) + { + npc.velocity.Y = npc.velocity.Y - num3; + } + } + int num27 = Math.Sign(player.Center.X - vector.X); + if (num27 != 0) + { + if (npc.ai[2] == 0f && num27 != npc.direction) + { + npc.rotation += 3.14159274f; + } + npc.direction = num27; + if (npc.spriteDirection != -npc.direction) + { + npc.rotation += 3.14159274f; + } + npc.spriteDirection = -npc.direction; + } + npc.ai[2] += 1f; + if (npc.ai[2] >= (float)num2) + { + int num28 = 0; + switch ((int)npc.ai[3]) + { + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + num28 = 1; + break; + case 6: + npc.ai[3] = 1f; + num28 = 2; + break; + case 7: + npc.ai[3] = 0f; + num28 = 3; + break; + } + if (flag2) + { + num28 = 4; + } + if (num28 == 1) + { + npc.ai[0] = 6f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.velocity = Vector2.Normalize(player.Center - vector) * num5; + npc.rotation = (float)Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X); + if (num27 != 0) + { + npc.direction = num27; + if (npc.spriteDirection == 1) + { + npc.rotation += 3.14159274f; + } + npc.spriteDirection = -npc.direction; + } + } + else if (num28 == 2) + { + npc.velocity = Vector2.Normalize(player.Center - vector) * scaleFactor4; + npc.rotation = (float)Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X); + if (num27 != 0) + { + npc.direction = num27; + if (npc.spriteDirection == 1) + { + npc.rotation += 3.14159274f; + } + npc.spriteDirection = -npc.direction; + } + npc.ai[0] = 7f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + } + else if (num28 == 3) + { + npc.ai[0] = 8f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + } + else if (num28 == 4) + { + npc.ai[0] = 9f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + } + npc.netUpdate = true; + return false; + } + } + else if (npc.ai[0] == 6f) + { + int num29 = 7; + for (int k = 0; k < num29; k++) + { + Vector2 arg_1A97_0 = (Vector2.Normalize(npc.velocity) * new Vector2((float)(npc.width + 50) / 2f, (float)npc.height) * 0.75f).RotatedBy((double)(k - (num29 / 2 - 1)) * 3.1415926535897931 / (double)((float)num29), default(Vector2)) + vector; + Vector2 vector9 = ((float)(Main.rand.NextDouble() * 3.1415927410125732) - 1.57079637f).ToRotationVector2() * (float)Main.rand.Next(3, 8); + int num30 = Dust.NewDust(arg_1A97_0 + vector9, 0, 0, 172, vector9.X * 2f, vector9.Y * 2f, 100, default(Color), 1.4f); + Main.dust[num30].noGravity = true; + Main.dust[num30].noLight = true; + Main.dust[num30].velocity /= 4f; + Main.dust[num30].velocity -= npc.velocity; + } + npc.ai[2] += 1f; + if (npc.ai[2] >= (float)num4) + { + npc.ai[0] = 5f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.ai[3] += 2f; + npc.netUpdate = true; + return false; + } + } + else if (npc.ai[0] == 7f) + { + if (npc.ai[2] == 0f) + { + Main.PlaySound(29, (int)vector.X, (int)vector.Y, 20, 1f, 0f); + } + if (npc.ai[2] % (float)num14 == 0f) + { + Main.PlaySound(4, (int)npc.Center.X, (int)npc.Center.Y, 19, 1f, 0f); + if (Main.netMode != 1) + { + Vector2 vector10 = Vector2.Normalize(npc.velocity) * (float)(npc.width + 20) / 2f + vector; + int num31 = NPC.NewNPC((int)vector10.X, (int)vector10.Y + 45, 371, 0, 0f, 0f, 0f, 0f, 255); + Main.npc[num31].target = npc.target; + Main.npc[num31].velocity = Vector2.Normalize(npc.velocity).RotatedBy((double)(1.57079637f * (float)npc.direction), default(Vector2)) * scaleFactor3; + Main.npc[num31].netUpdate = true; + Main.npc[num31].ai[3] = (float)Main.rand.Next(80, 121) / 100f; + } + } + npc.velocity = npc.velocity.RotatedBy((double)(-(double)num15 * (float)npc.direction), default(Vector2)); + npc.rotation -= num15 * (float)npc.direction; + npc.ai[2] += 1f; + if (npc.ai[2] >= (float)num13) + { + npc.ai[0] = 5f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.netUpdate = true; + return false; + } + } + else if (npc.ai[0] == 8f) + { + npc.velocity *= 0.98f; + npc.velocity.Y = MathHelper.Lerp(npc.velocity.Y, 0f, 0.02f); + if (npc.ai[2] == (float)(num9 - 30)) + { + Main.PlaySound(29, (int)vector.X, (int)vector.Y, 20, 1f, 0f); + } + if (Main.netMode != 1 && npc.ai[2] == (float)(num9 - 30)) + { + Projectile.NewProjectile(vector.X, vector.Y, 0f, 0f, 385, 0, 0f, Main.myPlayer, 1f, (float)(npc.target + 1)); + } + npc.ai[2] += 1f; + if (npc.ai[2] >= (float)num9) + { + npc.ai[0] = 5f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.netUpdate = true; + return false; + } + } + else if (npc.ai[0] == 9f) + { + if (npc.ai[2] < (float)(num11 - 90)) + { + if (Collision.SolidCollision(npc.position, npc.width, npc.height)) + { + npc.alpha += 15; + } + else + { + npc.alpha -= 15; + } + if (npc.alpha < 0) + { + npc.alpha = 0; + } + if (npc.alpha > 150) + { + npc.alpha = 150; + } + } + else if (npc.alpha < 255) + { + npc.alpha += 4; + if (npc.alpha > 255) + { + npc.alpha = 255; + } + } + npc.velocity *= 0.98f; + npc.velocity.Y = MathHelper.Lerp(npc.velocity.Y, 0f, 0.02f); + if (npc.ai[2] == (float)(num11 - 60)) + { + Main.PlaySound(29, (int)vector.X, (int)vector.Y, 20, 1f, 0f); + } + npc.ai[2] += 1f; + if (npc.ai[2] >= (float)num11) + { + npc.ai[0] = 10f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.ai[3] = 0f; + npc.netUpdate = true; + return false; + } + } + else if (npc.ai[0] == 10f && !player.dead) + { + npc.dontTakeDamage = false; + npc.chaseable = false; + if (npc.alpha < 255) + { + npc.alpha += 25; + if (npc.alpha > 255) + { + npc.alpha = 255; + } + } + if (npc.ai[1] == 0f) + { + npc.ai[1] = (float)(360 * Math.Sign((vector - player.Center).X)); + } + Vector2 desiredVelocity = Vector2.Normalize(player.Center + new Vector2(npc.ai[1], -200f) - vector - npc.velocity) * scaleFactor; + npc.SimpleFlyMovement(desiredVelocity, num3); + int num32 = Math.Sign(player.Center.X - vector.X); + if (num32 != 0) + { + if (npc.ai[2] == 0f && num32 != npc.direction) + { + npc.rotation += 3.14159274f; + for (int l = 0; l < npc.oldPos.Length; l++) + { + npc.oldPos[l] = Vector2.Zero; + } + } + npc.direction = num32; + if (npc.spriteDirection != -npc.direction) + { + npc.rotation += 3.14159274f; + } + npc.spriteDirection = -npc.direction; + } + npc.ai[2] += 1f; + if (npc.ai[2] >= (float)num2) + { + int num33 = 0; + switch ((int)npc.ai[3]) + { + case 0: + case 2: + case 3: + case 5: + case 6: + case 7: + num33 = 1; + break; + case 1: + case 4: + case 8: + num33 = 2; + break; + } + if (num33 == 1) + { + npc.ai[0] = 11f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.velocity = Vector2.Normalize(player.Center - vector) * num5; + npc.rotation = (float)Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X); + if (num32 != 0) + { + npc.direction = num32; + if (npc.spriteDirection == 1) + { + npc.rotation += 3.14159274f; + } + npc.spriteDirection = -npc.direction; + } + } + else if (num33 == 2) + { + npc.ai[0] = 12f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + } + else if (num33 == 3) + { + npc.ai[0] = 13f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + } + npc.netUpdate = true; + return false; + } + } + else if (npc.ai[0] == 11f) + { + npc.dontTakeDamage = false; + npc.chaseable = true; + npc.alpha -= 25; + if (npc.alpha < 0) + { + npc.alpha = 0; + } + int num34 = 7; + for (int m = 0; m < num34; m++) + { + Vector2 arg_2444_0 = (Vector2.Normalize(npc.velocity) * new Vector2((float)(npc.width + 50) / 2f, (float)npc.height) * 0.75f).RotatedBy((double)(m - (num34 / 2 - 1)) * 3.1415926535897931 / (double)((float)num34), default(Vector2)) + vector; + Vector2 vector11 = ((float)(Main.rand.NextDouble() * 3.1415927410125732) - 1.57079637f).ToRotationVector2() * (float)Main.rand.Next(3, 8); + int num35 = Dust.NewDust(arg_2444_0 + vector11, 0, 0, 172, vector11.X * 2f, vector11.Y * 2f, 100, default(Color), 1.4f); + Main.dust[num35].noGravity = true; + Main.dust[num35].noLight = true; + Main.dust[num35].velocity /= 4f; + Main.dust[num35].velocity -= npc.velocity; + } + npc.ai[2] += 1f; + if (npc.ai[2] >= (float)num4) + { + npc.ai[0] = 10f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.ai[3] += 1f; + npc.netUpdate = true; + return false; + } + } + else if (npc.ai[0] == 12f) + { + npc.dontTakeDamage = true; + npc.chaseable = false; + if (npc.alpha < 255) + { + npc.alpha += 17; + if (npc.alpha > 255) + { + npc.alpha = 255; + } + } + npc.velocity *= 0.98f; + npc.velocity.Y = MathHelper.Lerp(npc.velocity.Y, 0f, 0.02f); + if (npc.ai[2] == (float)(num12 / 2)) + { + Main.PlaySound(29, (int)vector.X, (int)vector.Y, 20, 1f, 0f); + } + if (Main.netMode != 1 && npc.ai[2] == (float)(num12 / 2)) + { + if (npc.ai[1] == 0f) + { + npc.ai[1] = (float)(300 * Math.Sign((vector - player.Center).X)); + } + Vector2 center = player.Center + new Vector2(-npc.ai[1], -200f); + vector = (npc.Center = center); + int num36 = Math.Sign(player.Center.X - vector.X); + if (num36 != 0) + { + if (npc.ai[2] == 0f && num36 != npc.direction) + { + npc.rotation += 3.14159274f; + for (int n = 0; n < npc.oldPos.Length; n++) + { + npc.oldPos[n] = Vector2.Zero; + } + } + npc.direction = num36; + if (npc.spriteDirection != -npc.direction) + { + npc.rotation += 3.14159274f; + } + npc.spriteDirection = -npc.direction; + } + } + npc.ai[2] += 1f; + if (npc.ai[2] >= (float)num12) + { + npc.ai[0] = 10f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.ai[3] += 1f; + if (npc.ai[3] >= 9f) + { + npc.ai[3] = 0f; + } + npc.netUpdate = true; + return false; + } + } + else if (npc.ai[0] == 13f) + { + if (npc.ai[2] == 0f) + { + Main.PlaySound(29, (int)vector.X, (int)vector.Y, 20, 1f, 0f); + } + npc.velocity = npc.velocity.RotatedBy((double)(-(double)num15 * (float)npc.direction), default(Vector2)); + npc.rotation -= num15 * (float)npc.direction; + npc.ai[2] += 1f; + if (npc.ai[2] >= (float)num13) + { + npc.ai[0] = 10f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.ai[3] += 1f; + npc.netUpdate = true; + } + } + return false; + } + #endregion + } + #endregion + if (CalamityWorld.revenge || CalamityWorld.bossRushActive) + { + #region Mothron + if (npc.type == NPCID.Mothron && CalamityWorld.buffedEclipse) + { + int num1353 = 3; + npc.noTileCollide = false; + npc.noGravity = true; + npc.knockBackResist = 0.2f * Main.expertKnockBack; + npc.damage = npc.defDamage; + if (!Main.eclipse) + { + npc.ai[0] = -1f; + } + else if (npc.target < 0 || Main.player[npc.target].dead || !Main.player[npc.target].active) + { + npc.TargetClosest(true); + Vector2 vector235 = Main.player[npc.target].Center - npc.Center; + if (Main.player[npc.target].dead || vector235.Length() > 3000f) + { + npc.ai[0] = -1f; + } + } + else + { + Vector2 vector236 = Main.player[npc.target].Center - npc.Center; + if (npc.ai[0] > 1f && vector236.Length() > 1000f) + { + npc.ai[0] = 1f; + } + } + if (npc.ai[0] == -1f) + { + Vector2 value37 = new Vector2(0f, -8f); + npc.velocity = (npc.velocity * 22f + value37) / 10f; + npc.noTileCollide = true; + npc.dontTakeDamage = true; + return false; + } + if (npc.ai[0] == 0f) + { + npc.TargetClosest(true); + if (npc.Center.X < Main.player[npc.target].Center.X - 2f) + { + npc.direction = 1; + } + if (npc.Center.X > Main.player[npc.target].Center.X + 2f) + { + npc.direction = -1; + } + npc.spriteDirection = npc.direction; + npc.rotation = (npc.rotation * 9f + npc.velocity.X * 0.025f) / 10f; + if (npc.collideX) + { + npc.velocity.X = npc.velocity.X * (-npc.oldVelocity.X * 0.5f); + if (npc.velocity.X > 30f) + { + npc.velocity.X = 30f; + } + if (npc.velocity.X < -30f) + { + npc.velocity.X = -30f; + } + } + if (npc.collideY) + { + npc.velocity.Y = npc.velocity.Y * (-npc.oldVelocity.Y * 0.5f); + if (npc.velocity.Y > 30f) + { + npc.velocity.Y = 30f; + } + if (npc.velocity.Y < -30f) + { + npc.velocity.Y = -30f; + } + } + Vector2 value38 = Main.player[npc.target].Center - npc.Center; + value38.Y -= 200f; + if (value38.Length() > 2000f) + { + npc.ai[0] = 1f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.ai[3] = 0f; + } + else if (value38.Length() > 80f) + { + float scaleFactor15 = 13f; + float num1354 = 30f; + value38.Normalize(); + value38 *= scaleFactor15; + npc.velocity = (npc.velocity * (num1354 - 1f) + value38) / num1354; + } + else if (npc.velocity.Length() > 2f) + { + npc.velocity *= 0.95f; + } + else if (npc.velocity.Length() < 1f) + { + npc.velocity *= 1.05f; + } + npc.ai[1] += 1f; + if (npc.justHit) + { + npc.ai[1] += (float)Main.rand.Next(10, 30); + } + if (npc.ai[1] >= 180f && Main.netMode != 1) + { + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.ai[3] = 0f; + npc.netUpdate = true; + while (npc.ai[0] == 0f) + { + int num1355 = Main.rand.Next(3); + if (num1355 == 0 && Collision.CanHit(npc.Center, 1, 1, Main.player[npc.target].Center, 1, 1)) + { + npc.ai[0] = 2f; + } + else if (num1355 == 1) + { + npc.ai[0] = 3f; + } + else if (num1355 == 2 && NPC.CountNPCS(478) + NPC.CountNPCS(479) < num1353) + { + npc.ai[0] = 4f; + } + } + return false; + } + } + else + { + if (npc.ai[0] == 1f) + { + npc.collideX = false; + npc.collideY = false; + npc.noTileCollide = true; + npc.knockBackResist = 0f; + if (npc.target < 0 || !Main.player[npc.target].active || Main.player[npc.target].dead) + { + npc.TargetClosest(true); + } + if (npc.velocity.X < 0f) + { + npc.direction = -1; + } + else if (npc.velocity.X > 0f) + { + npc.direction = 1; + } + npc.spriteDirection = npc.direction; + npc.rotation = (npc.rotation * 9f + npc.velocity.X * 0.02f) / 10f; + Vector2 value39 = Main.player[npc.target].Center - npc.Center; + if (value39.Length() < 300f && !Collision.SolidCollision(npc.position, npc.width, npc.height)) + { + npc.ai[0] = 0f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.ai[3] = 0f; + } + float scaleFactor16 = 14f + value39.Length() / 100f; + float num1356 = 25f; + value39.Normalize(); + value39 *= scaleFactor16; + npc.velocity = (npc.velocity * (num1356 - 1f) + value39) / num1356; + return false; + } + if (npc.ai[0] == 2f) + { + npc.damage = (int)((double)npc.defDamage * 0.75); + npc.knockBackResist = 0f; + if (npc.target < 0 || !Main.player[npc.target].active || Main.player[npc.target].dead) + { + npc.TargetClosest(true); + npc.ai[0] = 0f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.ai[3] = 0f; + } + if (Main.player[npc.target].Center.X - 10f < npc.Center.X) + { + npc.direction = -1; + } + else if (Main.player[npc.target].Center.X + 10f > npc.Center.X) + { + npc.direction = 1; + } + npc.spriteDirection = npc.direction; + npc.rotation = (npc.rotation * 4f + npc.velocity.X * 0.025f) / 5f; + if (npc.collideX) + { + npc.velocity.X = npc.velocity.X * (-npc.oldVelocity.X * 0.5f); + if (npc.velocity.X > 30f) + { + npc.velocity.X = 30f; + } + if (npc.velocity.X < -30f) + { + npc.velocity.X = -30f; + } + } + if (npc.collideY) + { + npc.velocity.Y = npc.velocity.Y * (-npc.oldVelocity.Y * 0.5f); + if (npc.velocity.Y > 30f) + { + npc.velocity.Y = 30f; + } + if (npc.velocity.Y < -30f) + { + npc.velocity.Y = -30f; + } + } + Vector2 value40 = Main.player[npc.target].Center - npc.Center; + value40.Y -= 20f; + npc.ai[2] += 0.0222222228f; + if (Main.expertMode) + { + npc.ai[2] += 0.0166666675f; + } + float scaleFactor17 = 13f + npc.ai[2] + value40.Length() / 120f; + float num1357 = 20f; + value40.Normalize(); + value40 *= scaleFactor17; + npc.velocity = (npc.velocity * (num1357 - 1f) + value40) / num1357; + npc.ai[1] += 1f; + if (npc.ai[1] > 240f || !Collision.CanHit(npc.Center, 1, 1, Main.player[npc.target].Center, 1, 1)) + { + npc.ai[0] = 0f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.ai[3] = 0f; + return false; + } + } + else + { + if (npc.ai[0] == 3f) + { + npc.knockBackResist = 0f; + npc.noTileCollide = true; + if (npc.velocity.X < 0f) + { + npc.direction = -1; + } + else + { + npc.direction = 1; + } + npc.spriteDirection = npc.direction; + npc.rotation = (npc.rotation * 4f + npc.velocity.X * 0.0175f) / 5f; + Vector2 value41 = Main.player[npc.target].Center - npc.Center; + value41.Y -= 12f; + if (npc.Center.X > Main.player[npc.target].Center.X) + { + value41.X += 400f; + } + else + { + value41.X -= 400f; + } + if (Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) > 350f && Math.Abs(npc.Center.Y - Main.player[npc.target].Center.Y) < 20f) + { + npc.ai[0] = 3.1f; + npc.ai[1] = 0f; + } + npc.ai[1] += 0.0333333351f; + float scaleFactor18 = 20f + npc.ai[1]; + float num1358 = 4f; + value41.Normalize(); + value41 *= scaleFactor18; + npc.velocity = (npc.velocity * (num1358 - 1f) + value41) / num1358; + return false; + } + if (npc.ai[0] == 3.1f) + { + npc.knockBackResist = 0f; + npc.noTileCollide = true; + npc.rotation = (npc.rotation * 4f + npc.velocity.X * 0.0175f) / 5f; + Vector2 vector237 = Main.player[npc.target].Center - npc.Center; + vector237.Y -= 12f; + float scaleFactor19 = 30f; + float num1359 = 8f; + vector237.Normalize(); + vector237 *= scaleFactor19; + npc.velocity = (npc.velocity * (num1359 - 1f) + vector237) / num1359; + if (npc.velocity.X < 0f) + { + npc.direction = -1; + } + else + { + npc.direction = 1; + } + npc.spriteDirection = npc.direction; + npc.ai[1] += 1f; + if (npc.ai[1] > 10f) + { + npc.velocity = vector237; + if (npc.velocity.X < 0f) + { + npc.direction = -1; + } + else + { + npc.direction = 1; + } + npc.ai[0] = 3.2f; + npc.ai[1] = 0f; + npc.ai[1] = (float)npc.direction; + return false; + } + } + else + { + if (npc.ai[0] == 3.2f) + { + npc.damage = (int)((double)npc.defDamage * 1.5); + npc.collideX = false; + npc.collideY = false; + npc.knockBackResist = 0f; + npc.noTileCollide = true; + npc.ai[2] += 0.0333333351f; + npc.velocity.X = (20f + npc.ai[2]) * npc.ai[1]; + if ((npc.ai[1] > 0f && npc.Center.X > Main.player[npc.target].Center.X + 260f) || (npc.ai[1] < 0f && npc.Center.X < Main.player[npc.target].Center.X - 260f)) + { + if (!Collision.SolidCollision(npc.position, npc.width, npc.height)) + { + npc.ai[0] = 0f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.ai[3] = 0f; + } + else if (Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) > 1600f) + { + npc.ai[0] = 1f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.ai[3] = 0f; + } + } + npc.rotation = (npc.rotation * 4f + npc.velocity.X * 0.0175f) / 5f; + return false; + } + if (npc.ai[0] == 4f) + { + npc.ai[0] = 0f; + npc.TargetClosest(true); + if (Main.netMode != 1) + { + npc.ai[1] = -1f; + npc.ai[2] = -1f; + int num; + for (int num1360 = 0; num1360 < 1000; num1360 = num + 1) + { + int num1361 = (int)Main.player[npc.target].Center.X / 16; + int num1362 = (int)Main.player[npc.target].Center.Y / 16; + int num1363 = 30 + num1360 / 50; + int num1364 = 20 + num1360 / 75; + num1361 += Main.rand.Next(-num1363, num1363 + 1); + num1362 += Main.rand.Next(-num1364, num1364 + 1); + if (!WorldGen.SolidTile(num1361, num1362)) + { + while (!WorldGen.SolidTile(num1361, num1362) && (double)num1362 < Main.worldSurface) + { + num1362++; + } + if ((new Vector2((float)(num1361 * 16 + 8), (float)(num1362 * 16 + 8)) - Main.player[npc.target].Center).Length() < 2100f) + { + npc.ai[0] = 4.1f; + npc.ai[1] = (float)num1361; + npc.ai[2] = (float)num1362; + break; + } + } + num = num1360; + } + } + npc.netUpdate = true; + return false; + } + if (npc.ai[0] == 4.1f) + { + if (npc.velocity.X < -2f) + { + npc.direction = -1; + } + else if (npc.velocity.X > 2f) + { + npc.direction = 1; + } + npc.spriteDirection = npc.direction; + npc.rotation = (npc.rotation * 9f + npc.velocity.X * 0.025f) / 10f; + npc.noTileCollide = true; + int num1365 = (int)npc.ai[1]; + int num1366 = (int)npc.ai[2]; + float x2 = (float)(num1365 * 16 + 8); + float y2 = (float)(num1366 * 16 - 20); + Vector2 vector238 = new Vector2(x2, y2); + vector238 -= npc.Center; + float num1367 = 6f + vector238.Length() / 150f; + if (num1367 > 10f) + { + num1367 = 10f; + } + float num1368 = 10f; + if (vector238.Length() < 10f) + { + npc.ai[0] = 4.2f; + } + vector238.Normalize(); + vector238 *= num1367; + npc.velocity = (npc.velocity * (num1368 - 1f) + vector238) / num1368; + return false; + } + if (npc.ai[0] == 4.2f) + { + npc.rotation = (npc.rotation * 9f + npc.velocity.X * 0.025f) / 10f; + npc.knockBackResist = 0f; + npc.noTileCollide = true; + int num1369 = (int)npc.ai[1]; + int num1370 = (int)npc.ai[2]; + float x3 = (float)(num1369 * 16 + 8); + float y3 = (float)(num1370 * 16 - 20); + Vector2 vector239 = new Vector2(x3, y3); + vector239 -= npc.Center; + float num1371 = 4f; + float num1372 = 2f; + if (Main.netMode != 1 && vector239.Length() < 4f) + { + int num1373 = 70; + if (Main.expertMode) + { + num1373 = (int)((double)num1373 * 0.75); + } + npc.ai[3] += 1f; + if (npc.ai[3] == (float)num1373) + { + NPC.NewNPC(num1369 * 16 + 8, num1370 * 16, 478, npc.whoAmI, 0f, 0f, 0f, 0f, 255); + } + else if (npc.ai[3] == (float)(num1373 * 2)) + { + npc.ai[0] = 0f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.ai[3] = 0f; + if (NPC.CountNPCS(478) + NPC.CountNPCS(479) < num1353 && Main.rand.Next(3) != 0) + { + npc.ai[0] = 4f; + } + else if (Collision.SolidCollision(npc.position, npc.width, npc.height)) + { + npc.ai[0] = 1f; + } + } + } + if (vector239.Length() > num1371) + { + vector239.Normalize(); + vector239 *= num1371; + } + npc.velocity = (npc.velocity * (num1372 - 1f) + vector239) / num1372; + return false; + } + } + } + } + return false; + } + #endregion + #region Pumpking + else if (npc.type == NPCID.Pumpking && CalamityWorld.downedDoG) + { + npc.localAI[0] += 1f; + if (npc.localAI[0] > 6f) + { + npc.localAI[0] = 0f; + npc.localAI[1] += 1f; + if (npc.localAI[1] > 4f) + { + npc.localAI[1] = 0f; + } + } + if (Main.netMode != 1) + { + npc.localAI[2] += 1f; + if (npc.localAI[2] > 300f) + { + npc.ai[3] = (float)Main.rand.Next(3); + npc.localAI[2] = 0f; + } + else if (npc.ai[3] == 0f && npc.localAI[2] % 30f == 0f && npc.localAI[2] > 30f) + { + float num856 = 10f; + Vector2 vector109 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f + 30f); + if (!WorldGen.SolidTile((int)vector109.X / 16, (int)vector109.Y / 16)) + { + float num857 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector109.X; + float num858 = Main.player[npc.target].position.Y - vector109.Y; + num857 += (float)Main.rand.Next(-50, 51); + num858 += (float)Main.rand.Next(50, 201); + num858 *= 0.2f; + float num859 = (float)Math.Sqrt((double)(num857 * num857 + num858 * num858)); + num859 = num856 / num859; + num857 *= num859; + num858 *= num859; + num857 *= 1f + (float)Main.rand.Next(-30, 31) * 0.01f; + num858 *= 1f + (float)Main.rand.Next(-30, 31) * 0.01f; + Projectile.NewProjectile(vector109.X, vector109.Y, num857, num858, Main.rand.Next(326, 329), 60, 0f, Main.myPlayer, 0f, 0f); + } + } + } + if (npc.ai[0] == 0f && Main.netMode != 1) + { + npc.TargetClosest(true); + npc.ai[0] = 1f; + int num861 = NPC.NewNPC((int)(npc.position.X + (float)(npc.width / 2)), (int)npc.position.Y + npc.height / 2, 328, npc.whoAmI, 0f, 0f, 0f, 0f, 255); + Main.npc[num861].ai[0] = -1f; + Main.npc[num861].ai[1] = (float)npc.whoAmI; + Main.npc[num861].target = npc.target; + Main.npc[num861].netUpdate = true; + num861 = NPC.NewNPC((int)(npc.position.X + (float)(npc.width / 2)), (int)npc.position.Y + npc.height / 2, 328, npc.whoAmI, 0f, 0f, 0f, 0f, 255); + Main.npc[num861].ai[0] = 1f; + Main.npc[num861].ai[1] = (float)npc.whoAmI; + Main.npc[num861].ai[3] = 150f; + Main.npc[num861].target = npc.target; + Main.npc[num861].netUpdate = true; + } + if (Main.player[npc.target].dead || Math.Abs(npc.position.X - Main.player[npc.target].position.X) > 2000f || Math.Abs(npc.position.Y - Main.player[npc.target].position.Y) > 2000f) + { + npc.TargetClosest(true); + if (Main.player[npc.target].dead || Math.Abs(npc.position.X - Main.player[npc.target].position.X) > 2000f || Math.Abs(npc.position.Y - Main.player[npc.target].position.Y) > 2000f) + { + npc.ai[1] = 2f; + } + } + if (Main.dayTime) + { + npc.velocity.Y = npc.velocity.Y + 0.3f; + npc.velocity.X = npc.velocity.X * 0.9f; + } + else if (npc.ai[1] == 0f) + { + npc.ai[2] += 1f; + if (npc.ai[2] >= 300f) + { + if (npc.ai[3] != 1f) + { + npc.ai[1] = 0f; + npc.ai[2] = 0f; + } + else + { + npc.ai[2] = 0f; + npc.ai[1] = 1f; + npc.TargetClosest(true); + npc.netUpdate = true; + } + } + Vector2 vector110 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float num862 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector110.X; + float num863 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - 200f - vector110.Y; + float num864 = (float)Math.Sqrt((double)(num862 * num862 + num863 * num863)); + float num865 = 8f; + if (npc.ai[3] == 1f) + { + if (num864 > 900f) + { + num865 = 14f; + } + else if (num864 > 600f) + { + num865 = 12f; + } + else if (num864 > 300f) + { + num865 = 10f; + } + } + if (num864 > 50f) + { + num864 = num865 / num864; + npc.velocity.X = (npc.velocity.X * 14f + num862 * num864) / 15f; + npc.velocity.Y = (npc.velocity.Y * 14f + num863 * num864) / 15f; + } + } + else if (npc.ai[1] == 1f) + { + npc.ai[2] += 1f; + if (npc.ai[2] >= 600f || npc.ai[3] != 1f) + { + npc.ai[2] = 0f; + npc.ai[1] = 0f; + } + Vector2 vector111 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float num866 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector111.X; + float num867 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector111.Y; + float num868 = (float)Math.Sqrt((double)(num866 * num866 + num867 * num867)); + num868 = 20f / num868; + npc.velocity.X = (npc.velocity.X * 49f + num866 * num868) / 50f; + npc.velocity.Y = (npc.velocity.Y * 49f + num867 * num868) / 50f; + } + else if (npc.ai[1] == 2f) + { + npc.ai[1] = 3f; + npc.velocity.Y = npc.velocity.Y + 0.1f; + if (npc.velocity.Y < 0f) + { + npc.velocity.Y = npc.velocity.Y * 0.95f; + } + npc.velocity.X = npc.velocity.X * 0.95f; + if (npc.timeLeft > 500) + { + npc.timeLeft = 500; + } + } + npc.rotation = npc.velocity.X * -0.02f; + return false; + } + else if (npc.type == NPCID.PumpkingBlade && CalamityWorld.downedDoG) + { + npc.spriteDirection = -(int)npc.ai[0]; + if (!Main.npc[(int)npc.ai[1]].active || Main.npc[(int)npc.ai[1]].aiStyle != 58) + { + npc.ai[2] += 10f; + if (npc.ai[2] > 50f || Main.netMode != 2) + { + npc.life = -1; + npc.HitEffect(0, 10.0); + npc.active = false; + } + } + if (Main.netMode != 1 && Main.npc[(int)npc.ai[1]].ai[3] == 2f) + { + npc.localAI[1] += 1f; + if (npc.localAI[1] > 30f) + { + npc.localAI[1] = 0f; + float num869 = 0.01f; + Vector2 vector112 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f + 30f); + float num870 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector112.X; + float num871 = Main.player[npc.target].position.Y - vector112.Y; + float num872 = (float)Math.Sqrt((double)(num870 * num870 + num871 * num871)); + num872 = num869 / num872; + num870 *= num872; + num871 *= num872; + Projectile.NewProjectile(npc.Center.X, npc.Center.Y, num870, num871, 329, 70, 0f, Main.myPlayer, npc.rotation, (float)npc.spriteDirection); + } + } + if (Main.dayTime) + { + npc.velocity.Y = npc.velocity.Y + 0.3f; + npc.velocity.X = npc.velocity.X * 0.9f; + return false; + } + if (npc.ai[2] == 0f || npc.ai[2] == 3f) + { + if (Main.npc[(int)npc.ai[1]].ai[1] == 3f && npc.timeLeft > 10) + { + npc.timeLeft = 10; + } + npc.ai[3] += 1f; + if (npc.ai[3] >= 180f) + { + npc.ai[2] += 1f; + npc.ai[3] = 0f; + npc.netUpdate = true; + } + Vector2 vector113 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float num874 = (Main.player[npc.target].Center.X + Main.npc[(int)npc.ai[1]].Center.X) / 2f; + float num875 = (Main.player[npc.target].Center.Y + Main.npc[(int)npc.ai[1]].Center.Y) / 2f; + num874 += -170f * npc.ai[0] - vector113.X; + num875 += 90f - vector113.Y; + float num876 = Math.Abs(Main.player[npc.target].Center.X - Main.npc[(int)npc.ai[1]].Center.X) + Math.Abs(Main.player[npc.target].Center.Y - Main.npc[(int)npc.ai[1]].Center.Y); + if (num876 > 700f) + { + num874 = Main.npc[(int)npc.ai[1]].Center.X - 170f * npc.ai[0] - vector113.X; + num875 = Main.npc[(int)npc.ai[1]].Center.Y + 90f - vector113.Y; + } + float num877 = (float)Math.Sqrt((double)(num874 * num874 + num875 * num875)); + float num878 = 8f; + if (num877 > 1000f) + { + num878 = 23f; + } + else if (num877 > 800f) + { + num878 = 20f; + } + else if (num877 > 600f) + { + num878 = 17f; + } + else if (num877 > 400f) + { + num878 = 14f; + } + else if (num877 > 200f) + { + num878 = 11f; + } + if (npc.ai[0] < 0f && npc.Center.X > Main.npc[(int)npc.ai[1]].Center.X) + { + num874 -= 4f; + } + if (npc.ai[0] > 0f && npc.Center.X < Main.npc[(int)npc.ai[1]].Center.X) + { + num874 += 4f; + } + num877 = num878 / num877; + npc.velocity.X = (npc.velocity.X * 14f + num874 * num877) / 15f; + npc.velocity.Y = (npc.velocity.Y * 14f + num875 * num877) / 15f; + num877 = (float)Math.Sqrt((double)(num874 * num874 + num875 * num875)); + if (num877 > 20f) + { + npc.rotation = (float)Math.Atan2((double)num875, (double)num874) + 1.57f; + return false; + } + } + else if (npc.ai[2] == 1f) + { + Vector2 vector114 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float num879 = Main.npc[(int)npc.ai[1]].position.X + (float)(Main.npc[(int)npc.ai[1]].width / 2) - 200f * npc.ai[0] - vector114.X; + float num880 = Main.npc[(int)npc.ai[1]].position.Y + 230f - vector114.Y; + float num881 = (float)Math.Sqrt((double)(num879 * num879 + num880 * num880)); + npc.rotation = (float)Math.Atan2((double)num880, (double)num879) + 1.57f; + npc.velocity.X = npc.velocity.X * 0.95f; + npc.velocity.Y = npc.velocity.Y - 0.3f; + if (npc.velocity.Y < -18f) + { + npc.velocity.Y = -18f; + } + if (npc.position.Y < Main.npc[(int)npc.ai[1]].position.Y - 200f) + { + npc.TargetClosest(true); + npc.ai[2] = 2f; + vector114 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + num879 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector114.X; + num880 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector114.Y; + num881 = (float)Math.Sqrt((double)(num879 * num879 + num880 * num880)); + num881 = 24f / num881; + npc.velocity.X = num879 * num881; + npc.velocity.Y = num880 * num881; + npc.netUpdate = true; + return false; + } + } + else if (npc.ai[2] == 2f) + { + float num882 = Math.Abs(npc.Center.X - Main.npc[(int)npc.ai[1]].Center.X) + Math.Abs(npc.Center.Y - Main.npc[(int)npc.ai[1]].Center.Y); + if (npc.position.Y > Main.player[npc.target].position.Y || npc.velocity.Y < 0f || num882 > 800f) + { + npc.ai[2] = 3f; + return false; + } + } + else if (npc.ai[2] == 4f) + { + Vector2 vector115 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float num883 = Main.npc[(int)npc.ai[1]].position.X + (float)(Main.npc[(int)npc.ai[1]].width / 2) - 200f * npc.ai[0] - vector115.X; + float num884 = Main.npc[(int)npc.ai[1]].position.Y + 230f - vector115.Y; + float num885 = (float)Math.Sqrt((double)(num883 * num883 + num884 * num884)); + npc.rotation = (float)Math.Atan2((double)num884, (double)num883) + 1.57f; + npc.velocity.Y = npc.velocity.Y * 0.95f; + npc.velocity.X = npc.velocity.X + 0.3f * -npc.ai[0]; + if (npc.velocity.X < -18f) + { + npc.velocity.X = -18f; + } + if (npc.velocity.X > 18f) + { + npc.velocity.X = 18f; + } + if (npc.position.X + (float)(npc.width / 2) < Main.npc[(int)npc.ai[1]].position.X + (float)(Main.npc[(int)npc.ai[1]].width / 2) - 500f || npc.position.X + (float)(npc.width / 2) > Main.npc[(int)npc.ai[1]].position.X + (float)(Main.npc[(int)npc.ai[1]].width / 2) + 500f) + { + npc.TargetClosest(true); + npc.ai[2] = 5f; + vector115 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + num883 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector115.X; + num884 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector115.Y; + num885 = (float)Math.Sqrt((double)(num883 * num883 + num884 * num884)); + num885 = 17f / num885; + npc.velocity.X = num883 * num885; + npc.velocity.Y = num884 * num885; + npc.netUpdate = true; + return false; + } + } + else if (npc.ai[2] == 5f) + { + float num886 = Math.Abs(npc.Center.X - Main.npc[(int)npc.ai[1]].Center.X) + Math.Abs(npc.Center.Y - Main.npc[(int)npc.ai[1]].Center.Y); + if ((npc.velocity.X > 0f && npc.position.X + (float)(npc.width / 2) > Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2)) || (npc.velocity.X < 0f && npc.position.X + (float)(npc.width / 2) < Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2)) || num886 > 800f) + { + npc.ai[2] = 0f; + return false; + } + } + return false; + } + #endregion + #region IceQueen + else if (npc.type == NPCID.IceQueen && CalamityWorld.downedDoG) + { + if (Main.dayTime) + { + if (npc.velocity.X > 0f) + { + npc.velocity.X = npc.velocity.X + 0.25f; + } + else + { + npc.velocity.X = npc.velocity.X - 0.25f; + } + npc.velocity.Y = npc.velocity.Y - 0.1f; + npc.rotation = npc.velocity.X * 0.05f; + } + else if (npc.ai[0] == 0f) + { + if (npc.ai[2] == 0f) + { + npc.TargetClosest(true); + if (npc.Center.X < Main.player[npc.target].Center.X) + { + npc.ai[2] = 1f; + } + else + { + npc.ai[2] = -1f; + } + } + npc.TargetClosest(true); + int num887 = 800; + float num888 = Math.Abs(npc.Center.X - Main.player[npc.target].Center.X); + if (npc.Center.X < Main.player[npc.target].Center.X && npc.ai[2] < 0f && num888 > (float)num887) + { + npc.ai[2] = 0f; + } + if (npc.Center.X > Main.player[npc.target].Center.X && npc.ai[2] > 0f && num888 > (float)num887) + { + npc.ai[2] = 0f; + } + float num889 = 0.6f; + float num890 = 10f; + if ((double)npc.life < (double)npc.lifeMax * 0.75) + { + num889 = 0.7f; + num890 = 12f; + } + if ((double)npc.life < (double)npc.lifeMax * 0.5) + { + num889 = 0.8f; + num890 = 14f; + } + if ((double)npc.life < (double)npc.lifeMax * 0.25) + { + num889 = 0.95f; + num890 = 16f; + } + npc.velocity.X = npc.velocity.X + npc.ai[2] * num889; + if (npc.velocity.X > num890) + { + npc.velocity.X = num890; + } + if (npc.velocity.X < -num890) + { + npc.velocity.X = -num890; + } + float num891 = Main.player[npc.target].position.Y - (npc.position.Y + (float)npc.height); + if (num891 < 150f) + { + npc.velocity.Y = npc.velocity.Y - 0.2f; + } + if (num891 > 200f) + { + npc.velocity.Y = npc.velocity.Y + 0.2f; + } + if (npc.velocity.Y > 9f) + { + npc.velocity.Y = 9f; + } + if (npc.velocity.Y < -9f) + { + npc.velocity.Y = -9f; + } + npc.rotation = npc.velocity.X * 0.05f; + if ((num888 < 500f || npc.ai[3] < 0f) && npc.position.Y < Main.player[npc.target].position.Y) + { + npc.ai[3] += 1f; + int num892 = 8; + if ((double)npc.life < (double)npc.lifeMax * 0.75) + { + num892 = 7; + } + if ((double)npc.life < (double)npc.lifeMax * 0.5) + { + num892 = 6; + } + if ((double)npc.life < (double)npc.lifeMax * 0.25) + { + num892 = 5; + } + num892++; + if (npc.ai[3] > (float)num892) + { + npc.ai[3] = (float)(-(float)num892); + } + if (npc.ai[3] == 0f && Main.netMode != 1) + { + Vector2 vector116 = new Vector2(npc.Center.X, npc.Center.Y); + vector116.X += npc.velocity.X * 7f; + float num893 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector116.X; + float num894 = Main.player[npc.target].Center.Y - vector116.Y; + float num895 = (float)Math.Sqrt((double)(num893 * num893 + num894 * num894)); + float num896 = 8f; + if ((double)npc.life < (double)npc.lifeMax * 0.75) + { + num896 = 9f; + } + if ((double)npc.life < (double)npc.lifeMax * 0.5) + { + num896 = 10f; + } + if ((double)npc.life < (double)npc.lifeMax * 0.25) + { + num896 = 11f; + } + num895 = num896 / num895; + num893 *= num895; + num894 *= num895; + Projectile.NewProjectile(vector116.X, vector116.Y, num893, num894, 348, 50, 0f, Main.myPlayer, 0f, 0f); + } + } + else if (npc.ai[3] < 0f) + { + npc.ai[3] += 1f; + } + if (Main.netMode != 1) + { + npc.ai[1] += (float)Main.rand.Next(1, 4); + if (npc.ai[1] > 600f && num888 < 600f) + { + npc.ai[0] = -1f; + } + } + } + else if (npc.ai[0] == 1f) + { + npc.TargetClosest(true); + float num898 = 0.2f; + float num899 = 10f; + if ((double)npc.life < (double)npc.lifeMax * 0.75) + { + num898 = 0.24f; + num899 = 12f; + } + if ((double)npc.life < (double)npc.lifeMax * 0.5) + { + num898 = 0.28f; + num899 = 14f; + } + if ((double)npc.life < (double)npc.lifeMax * 0.25) + { + num898 = 0.32f; + num899 = 16f; + } + num898 -= 0.05f; + num899 -= 1f; + if (npc.Center.X < Main.player[npc.target].Center.X) + { + npc.velocity.X = npc.velocity.X + num898; + if (npc.velocity.X < 0f) + { + npc.velocity.X = npc.velocity.X * 0.98f; + } + } + if (npc.Center.X > Main.player[npc.target].Center.X) + { + npc.velocity.X = npc.velocity.X - num898; + if (npc.velocity.X > 0f) + { + npc.velocity.X = npc.velocity.X * 0.98f; + } + } + if (npc.velocity.X > num899 || npc.velocity.X < -num899) + { + npc.velocity.X = npc.velocity.X * 0.95f; + } + float num900 = Main.player[npc.target].position.Y - (npc.position.Y + (float)npc.height); + if (num900 < 180f) + { + npc.velocity.Y = npc.velocity.Y - 0.1f; + } + if (num900 > 200f) + { + npc.velocity.Y = npc.velocity.Y + 0.1f; + } + if (npc.velocity.Y > 7f) + { + npc.velocity.Y = 7f; + } + if (npc.velocity.Y < -7f) + { + npc.velocity.Y = -7f; + } + npc.rotation = npc.velocity.X * 0.01f; + if (Main.netMode != 1) + { + npc.ai[3] += 1f; + int num901 = 10; + if ((double)npc.life < (double)npc.lifeMax * 0.75) + { + num901 = 8; + } + if ((double)npc.life < (double)npc.lifeMax * 0.5) + { + num901 = 6; + } + if ((double)npc.life < (double)npc.lifeMax * 0.25) + { + num901 = 4; + } + if ((double)npc.life < (double)npc.lifeMax * 0.1) + { + num901 = 2; + } + num901 += 3; + if (npc.ai[3] >= (float)num901) + { + npc.ai[3] = 0f; + Vector2 vector117 = new Vector2(npc.Center.X, npc.position.Y + (float)npc.height - 14f); + int i2 = (int)(vector117.X / 16f); + int j2 = (int)(vector117.Y / 16f); + if (!WorldGen.SolidTile(i2, j2)) + { + float num902 = npc.velocity.Y; + if (num902 < 0f) + { + num902 = 0f; + } + num902 += 3f; + float speedX2 = npc.velocity.X * 0.25f; + int num903 = Projectile.NewProjectile(vector117.X, vector117.Y, speedX2, num902, 349, 44, 0f, Main.myPlayer, (float)Main.rand.Next(5), 0f); + } + } + } + if (Main.netMode != 1) + { + npc.ai[1] += (float)Main.rand.Next(1, 4); + if (npc.ai[1] > 450f) + { + npc.ai[0] = -1f; + } + } + } + else if (npc.ai[0] == 2f) + { + npc.TargetClosest(true); + Vector2 vector118 = new Vector2(npc.Center.X, npc.Center.Y - 20f); + float num904 = (float)Main.rand.Next(-1000, 1001); + float num905 = (float)Main.rand.Next(-1000, 1001); + float num906 = (float)Math.Sqrt((double)(num904 * num904 + num905 * num905)); + float num907 = 20f; + npc.velocity *= 0.95f; + num906 = num907 / num906; + num904 *= num906; + num905 *= num906; + npc.rotation += 0.2f; + vector118.X += num904 * 4f; + vector118.Y += num905 * 4f; + npc.ai[3] += 1f; + int num908 = 7; + if ((double)npc.life < (double)npc.lifeMax * 0.75) + { + num908--; + } + if ((double)npc.life < (double)npc.lifeMax * 0.5) + { + num908 -= 2; + } + if ((double)npc.life < (double)npc.lifeMax * 0.25) + { + num908 -= 3; + } + if ((double)npc.life < (double)npc.lifeMax * 0.1) + { + num908 -= 4; + } + if (npc.ai[3] > (float)num908) + { + npc.ai[3] = 0f; + int num909 = Projectile.NewProjectile(vector118.X, vector118.Y, num904, num905, 349, 40, 0f, Main.myPlayer, 0f, 0f); + } + if (Main.netMode != 1) + { + npc.ai[1] += (float)Main.rand.Next(1, 4); + if (npc.ai[1] > 300f) + { + npc.ai[0] = -1f; + } + } + } + if (npc.ai[0] == -1f) + { + int num910 = Main.rand.Next(3); + npc.TargetClosest(true); + if (Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) > 1000f) + { + num910 = 0; + } + npc.ai[0] = (float)num910; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.ai[3] = 0f; + return false; + } + return false; + } + #endregion + #region EyeofCthulhu + else if (npc.type == NPCID.EyeofCthulhu && (CalamityWorld.revenge || CalamityWorld.bossRushActive)) + { + double getMad = 0.5; //0.5 + bool flag2 = false; + if ((double)npc.life < (double)npc.lifeMax * getMad) + { + flag2 = true; + } + float num5 = 20f; + if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead || !Main.player[npc.target].active) + { + npc.TargetClosest(true); + } + bool dead = Main.player[npc.target].dead; + float num6 = npc.position.X + (float)(npc.width / 2) - Main.player[npc.target].position.X - (float)(Main.player[npc.target].width / 2); + float num7 = npc.position.Y + (float)npc.height - 59f - Main.player[npc.target].position.Y - (float)(Main.player[npc.target].height / 2); + float num8 = (float)Math.Atan2((double)num7, (double)num6) + 1.57f; + if (num8 < 0f) + { + num8 += 6.283f; + } + else if ((double)num8 > 6.283) + { + num8 -= 6.283f; + } + float num9 = 0f; + if (npc.ai[0] == 0f && npc.ai[1] == 0f) + { + num9 = 0.02f; + } + if (npc.ai[0] == 0f && npc.ai[1] == 2f && npc.ai[2] > 40f) + { + num9 = 0.05f; + } + if (npc.ai[0] == 3f && npc.ai[1] == 0f) + { + num9 = 0.05f; + } + if (npc.ai[0] == 3f && npc.ai[1] == 2f && npc.ai[2] > 40f) + { + num9 = 0.08f; + } + if (npc.ai[0] == 3f && npc.ai[1] == 4f && npc.ai[2] > num5) + { + num9 = 0.15f; + } + if (npc.ai[0] == 3f && npc.ai[1] == 5f) + { + num9 = 0.05f; + } + num9 *= 1.5f; + if (npc.rotation < num8) + { + if ((double)(num8 - npc.rotation) > 3.1415) + { + npc.rotation -= num9; + } + else + { + npc.rotation += num9; + } + } + else if (npc.rotation > num8) + { + if ((double)(npc.rotation - num8) > 3.1415) + { + npc.rotation += num9; + } + else + { + npc.rotation -= num9; + } + } + if (npc.rotation > num8 - num9 && npc.rotation < num8 + num9) + { + npc.rotation = num8; + } + if (npc.rotation < 0f) + { + npc.rotation += 6.283f; + } + else if ((double)npc.rotation > 6.283) + { + npc.rotation -= 6.283f; + } + if (npc.rotation > num8 - num9 && npc.rotation < num8 + num9) + { + npc.rotation = num8; + } + if (Main.rand.Next(5) == 0) + { + int num10 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y + (float)npc.height * 0.25f), npc.width, (int)((float)npc.height * 0.5f), 5, npc.velocity.X, 2f, 0, default(Color), 1f); + Dust var_9_825_cp_0_cp_0 = Main.dust[num10]; + var_9_825_cp_0_cp_0.velocity.X = var_9_825_cp_0_cp_0.velocity.X * 0.5f; + Dust var_9_845_cp_0_cp_0 = Main.dust[num10]; + var_9_845_cp_0_cp_0.velocity.Y = var_9_845_cp_0_cp_0.velocity.Y * 0.1f; + } + if (Main.dayTime | dead) + { + npc.velocity.Y = npc.velocity.Y - 0.04f; + if (npc.timeLeft > 10) + { + npc.timeLeft = 10; + return false; + } + } + else if (npc.ai[0] == 0f) + { + if (npc.ai[1] == 0f) + { + float num11 = (enraged ? 10f : 7f); + float num12 = (enraged ? 0.2f : 0.15f); + Vector2 vector = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float num13 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector.X; + float num14 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - 200f - vector.Y; + float num15 = (float)Math.Sqrt((double)(num13 * num13 + num14 * num14)); + float num16 = num15; + num15 = num11 / num15; + num13 *= num15; + num14 *= num15; + if (npc.velocity.X < num13) + { + npc.velocity.X = npc.velocity.X + num12; + if (npc.velocity.X < 0f && num13 > 0f) + { + npc.velocity.X = npc.velocity.X + num12; + } + } + else if (npc.velocity.X > num13) + { + npc.velocity.X = npc.velocity.X - num12; + if (npc.velocity.X > 0f && num13 < 0f) + { + npc.velocity.X = npc.velocity.X - num12; + } + } + if (npc.velocity.Y < num14) + { + npc.velocity.Y = npc.velocity.Y + num12; + if (npc.velocity.Y < 0f && num14 > 0f) + { + npc.velocity.Y = npc.velocity.Y + num12; + } + } + else if (npc.velocity.Y > num14) + { + npc.velocity.Y = npc.velocity.Y - num12; + if (npc.velocity.Y > 0f && num14 < 0f) + { + npc.velocity.Y = npc.velocity.Y - num12; + } + } + npc.ai[2] += 1f; + float num17 = 180f; + if (npc.ai[2] >= num17) + { + npc.ai[1] = 1f; + npc.ai[2] = 0f; + npc.ai[3] = 0f; + npc.target = 255; + npc.netUpdate = true; + } + else if (num16 < 500f) + { + if (!Main.player[npc.target].dead) + { + npc.ai[3] += 1f; + } + float num18 = 44f; + if (npc.ai[3] >= num18) + { + npc.ai[3] = 0f; + npc.rotation = num8; + float num19 = 5f; + float num20 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector.X; + float num21 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector.Y; + float num22 = (float)Math.Sqrt((double)(num20 * num20 + num21 * num21)); + num22 = num19 / num22; + Vector2 vector2 = vector; + Vector2 vector3; + vector3.X = num20 * num22; + vector3.Y = num21 * num22; + vector2.X += vector3.X * 10f; + vector2.Y += vector3.Y * 10f; + if (Main.netMode != 1) + { + int num23 = NPC.NewNPC((int)vector2.X, (int)vector2.Y, 5, 0, 0f, 0f, 0f, 0f, 255); + Main.npc[num23].velocity.X = vector3.X; + Main.npc[num23].velocity.Y = vector3.Y; + if (Main.netMode == 2 && num23 < 200) + { + NetMessage.SendData(23, -1, -1, null, num23, 0f, 0f, 0f, 0, 0, 0); + } + } + Main.PlaySound(3, (int)vector2.X, (int)vector2.Y, 1, 1f, 0f); + int num; + for (int m = 0; m < 10; m = num + 1) + { + Dust.NewDust(vector2, 20, 20, 5, vector3.X * 0.4f, vector3.Y * 0.4f, 0, default(Color), 1f); + num = m; + } + } + } + } + else if (npc.ai[1] == 1f) + { + npc.rotation = num8; + float num24 = (enraged ? 11f : 7.25f); + Vector2 vector4 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float num25 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector4.X; + float num26 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector4.Y; + float num27 = (float)Math.Sqrt((double)(num25 * num25 + num26 * num26)); + num27 = num24 / num27; + npc.velocity.X = num25 * num27; + npc.velocity.Y = num26 * num27; + npc.ai[1] = 2f; + npc.netUpdate = true; + if (npc.netSpam > 10) + { + npc.netSpam = 10; + } + } + else if (npc.ai[1] == 2f) + { + npc.ai[2] += 1f; + if (npc.ai[2] >= 40f) + { + npc.velocity *= 0.975f; + if ((double)npc.velocity.X > -0.1 && (double)npc.velocity.X < 0.1) + { + npc.velocity.X = 0f; + } + if ((double)npc.velocity.Y > -0.1 && (double)npc.velocity.Y < 0.1) + { + npc.velocity.Y = 0f; + } + } + else + { + npc.rotation = (float)Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X) - 1.57f; + } + int num28 = 90; + if (npc.ai[2] >= (float)num28) + { + npc.ai[3] += 1f; + npc.ai[2] = 0f; + npc.target = 255; + npc.rotation = num8; + if (npc.ai[3] >= 3f) + { + npc.ai[1] = 0f; + npc.ai[3] = 0f; + } + else + { + npc.ai[1] = 1f; + } + } + } + float num29 = 0.9f; + if (((float)npc.life < (float)npc.lifeMax * num29) || CalamityWorld.death) + { + npc.ai[0] = 1f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.ai[3] = 0f; + npc.netUpdate = true; + if (npc.netSpam > 10) + { + npc.netSpam = 10; + return false; + } + } + } + else if (npc.ai[0] == 1f || npc.ai[0] == 2f) + { + if (npc.ai[0] == 1f) + { + npc.ai[2] += 0.005f; + if ((double)npc.ai[2] > 0.5) + { + npc.ai[2] = 0.5f; + } + } + else + { + npc.ai[2] -= 0.005f; + if (npc.ai[2] < 0f) + { + npc.ai[2] = 0f; + } + } + npc.rotation += npc.ai[2]; + npc.ai[1] += 1f; + if (npc.ai[1] % 20f == 0f) + { + float num30 = 5f; + Vector2 vector5 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float num31 = (float)Main.rand.Next(-200, 200); + float num32 = (float)Main.rand.Next(-200, 200); + float num33 = (float)Math.Sqrt((double)(num31 * num31 + num32 * num32)); + num33 = num30 / num33; + Vector2 vector6 = vector5; + Vector2 vector7; + vector7.X = num31 * num33; + vector7.Y = num32 * num33; + vector6.X += vector7.X * 10f; + vector6.Y += vector7.Y * 10f; + if (Main.netMode != 1) + { + int num34 = NPC.NewNPC((int)vector6.X, (int)vector6.Y, 5, 0, 0f, 0f, 0f, 0f, 255); + Main.npc[num34].velocity.X = vector7.X; + Main.npc[num34].velocity.Y = vector7.Y; + if (Main.netMode == 2 && num34 < 200) + { + NetMessage.SendData(23, -1, -1, null, num34, 0f, 0f, 0f, 0, 0, 0); + } + } + int num; + for (int n = 0; n < 10; n = num + 1) + { + Dust.NewDust(vector6, 20, 20, 5, vector7.X * 0.4f, vector7.Y * 0.4f, 0, default(Color), 1f); + num = n; + } + } + if (npc.ai[1] == 100f) + { + npc.ai[0] += 1f; + npc.ai[1] = 0f; + if (npc.ai[0] == 3f) + { + npc.ai[2] = 0f; + } + else + { + Main.PlaySound(3, (int)npc.position.X, (int)npc.position.Y, 1, 1f, 0f); + int num; + for (int num35 = 0; num35 < 2; num35 = num + 1) + { + Gore.NewGore(npc.position, new Vector2((float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f), 8, 1f); + Gore.NewGore(npc.position, new Vector2((float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f), 7, 1f); + Gore.NewGore(npc.position, new Vector2((float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f), 6, 1f); + num = num35; + } + for (int num36 = 0; num36 < 20; num36 = num + 1) + { + Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f, 0, default(Color), 1f); + num = num36; + } + Main.PlaySound(15, (int)npc.position.X, (int)npc.position.Y, 0, 1f, 0f); + } + } + Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f, 0, default(Color), 1f); + npc.velocity.X = npc.velocity.X * 0.98f; + npc.velocity.Y = npc.velocity.Y * 0.98f; + if ((double)npc.velocity.X > -0.1 && (double)npc.velocity.X < 0.1) + { + npc.velocity.X = 0f; + } + if ((double)npc.velocity.Y > -0.1 && (double)npc.velocity.Y < 0.1) + { + npc.velocity.Y = 0f; + return false; + } + } + else + { + if (flag2) + { + npc.defense = -5; + } + else + { + npc.damage = (int)(20f * Main.expertDamage); + } + if (npc.ai[1] == 0f & flag2) + { + npc.ai[1] = 5f; + } + if (npc.ai[1] == 0f) + { + float num37 = (enraged ? 8f : 5.5f); + float num38 = (enraged ? 0.09f : 0.06f); + Vector2 vector8 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float num39 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector8.X; + float num40 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - 120f - vector8.Y; + float num41 = (float)Math.Sqrt((double)(num39 * num39 + num40 * num40)); + if (num41 > 400f) + { + num37 += 1.25f; + num38 += 0.075f; + if (num41 > 600f) + { + num37 += 1.25f; + num38 += 0.075f; + if (num41 > 800f) + { + num37 += 1.25f; + num38 += 0.075f; + } + } + } + num41 = num37 / num41; + num39 *= num41; + num40 *= num41; + if (npc.velocity.X < num39) + { + npc.velocity.X = npc.velocity.X + num38; + if (npc.velocity.X < 0f && num39 > 0f) + { + npc.velocity.X = npc.velocity.X + num38; + } + } + else if (npc.velocity.X > num39) + { + npc.velocity.X = npc.velocity.X - num38; + if (npc.velocity.X > 0f && num39 < 0f) + { + npc.velocity.X = npc.velocity.X - num38; + } + } + if (npc.velocity.Y < num40) + { + npc.velocity.Y = npc.velocity.Y + num38; + if (npc.velocity.Y < 0f && num40 > 0f) + { + npc.velocity.Y = npc.velocity.Y + num38; + } + } + else if (npc.velocity.Y > num40) + { + npc.velocity.Y = npc.velocity.Y - num38; + if (npc.velocity.Y > 0f && num40 < 0f) + { + npc.velocity.Y = npc.velocity.Y - num38; + } + } + npc.ai[2] += 1f; + if (npc.ai[2] >= 200f) + { + npc.ai[1] = 1f; + npc.ai[2] = 0f; + npc.ai[3] = 0f; + if ((double)npc.life < (double)npc.lifeMax * 0.4) + { + npc.ai[1] = 3f; + } + npc.target = 255; + npc.netUpdate = true; + } + } + else if (npc.ai[1] == 1f) + { + Main.PlaySound(36, (int)npc.position.X, (int)npc.position.Y, 0, 1f, 0f); + npc.rotation = num8; + float num42 = (enraged ? 9.5f : 6.2f); + if (npc.ai[3] == 1f) + { + num42 *= 1.15f; + } + if (npc.ai[3] == 2f) + { + num42 *= 1.3f; + } + Vector2 vector9 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float num43 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector9.X; + float num44 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector9.Y; + float num45 = (float)Math.Sqrt((double)(num43 * num43 + num44 * num44)); + num45 = num42 / num45; + npc.velocity.X = num43 * num45; + npc.velocity.Y = num44 * num45; + npc.ai[1] = 2f; + npc.netUpdate = true; + if (npc.netSpam > 10) + { + npc.netSpam = 10; + } + } + else if (npc.ai[1] == 2f) + { + float num46 = CalamityWorld.death ? 70f : 60f; + npc.ai[2] += 1f; + if (npc.ai[2] >= num46) + { + npc.velocity *= 0.96f; + if ((double)npc.velocity.X > -0.1 && (double)npc.velocity.X < 0.1) + { + npc.velocity.X = 0f; + } + if ((double)npc.velocity.Y > -0.1 && (double)npc.velocity.Y < 0.1) + { + npc.velocity.Y = 0f; + } + } + else + { + npc.rotation = (float)Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X) - 1.57f; + } + int num47 = CalamityWorld.death ? 70 : 80; + if (npc.ai[2] >= (float)num47) + { + npc.ai[3] += 1f; + npc.ai[2] = 0f; + npc.target = 255; + npc.rotation = num8; + if (npc.ai[3] >= 3f) + { + npc.ai[1] = 0f; + npc.ai[3] = 0f; + if (Main.netMode != 1 && (double)npc.life < (double)npc.lifeMax * 0.6) + { + npc.ai[1] = 3f; + npc.ai[3] += (float)Main.rand.Next(1, 4); + } + npc.netUpdate = true; + if (npc.netSpam > 10) + { + npc.netSpam = 10; + } + } + else + { + npc.ai[1] = 1f; + } + } + } + else if (npc.ai[1] == 3f) + { + if ((npc.ai[3] == 4f & flag2) && npc.Center.Y > Main.player[npc.target].Center.Y) + { + npc.TargetClosest(true); + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.ai[3] = 0f; + npc.netUpdate = true; + if (npc.netSpam > 10) + { + npc.netSpam = 10; + } + } + else if (Main.netMode != 1) + { + npc.TargetClosest(true); + float num48 = (enraged ? 26f : 18f); + Vector2 vector10 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float num49 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector10.X; + float num50 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector10.Y; + float num51 = Math.Abs(Main.player[npc.target].velocity.X) + Math.Abs(Main.player[npc.target].velocity.Y) / 4f; + num51 += 10f - num51; + if (num51 < 5f) + { + num51 = 5f; + } + if (num51 > 15f) + { + num51 = 15f; + } + if (npc.ai[2] == -1f) + { + num51 *= 4f; + num48 *= 1.3f; + } + num49 -= Main.player[npc.target].velocity.X * num51; + num50 -= Main.player[npc.target].velocity.Y * num51 / 4f; + num49 *= 1f + (float)Main.rand.Next(-10, 11) * 0.01f; + num50 *= 1f + (float)Main.rand.Next(-10, 11) * 0.01f; + float num52 = (float)Math.Sqrt((double)(num49 * num49 + num50 * num50)); + float num53 = num52; + num52 = num48 / num52; + npc.velocity.X = num49 * num52; + npc.velocity.Y = num50 * num52; + npc.velocity.X = npc.velocity.X + (float)Main.rand.Next(-20, 21) * 0.1f; + npc.velocity.Y = npc.velocity.Y + (float)Main.rand.Next(-20, 21) * 0.1f; + if (num53 < 100f) + { + if (Math.Abs(npc.velocity.X) > Math.Abs(npc.velocity.Y)) + { + float num56 = Math.Abs(npc.velocity.X); + float num57 = Math.Abs(npc.velocity.Y); + if (npc.Center.X > Main.player[npc.target].Center.X) + { + num57 *= -1f; + } + if (npc.Center.Y > Main.player[npc.target].Center.Y) + { + num56 *= -1f; + } + npc.velocity.X = num57; + npc.velocity.Y = num56; + } + } + else if (Math.Abs(npc.velocity.X) > Math.Abs(npc.velocity.Y)) + { + float num58 = (Math.Abs(npc.velocity.X) + Math.Abs(npc.velocity.Y)) / 2f; + float num59 = num58; + if (npc.Center.X > Main.player[npc.target].Center.X) + { + num59 *= -1f; + } + if (npc.Center.Y > Main.player[npc.target].Center.Y) + { + num58 *= -1f; + } + npc.velocity.X = num59; + npc.velocity.Y = num58; + } + npc.ai[1] = 4f; + npc.netUpdate = true; + if (npc.netSpam > 10) + { + npc.netSpam = 10; + } + } + } + else if (npc.ai[1] == 4f) + { + if (npc.ai[2] == 0f) + { + Main.PlaySound(36, (int)npc.position.X, (int)npc.position.Y, -1, 1f, 0f); + } + float num60 = num5; + npc.ai[2] += 1f; + if (npc.ai[2] == num60 && Vector2.Distance(npc.position, Main.player[npc.target].position) < 200f) + { + npc.ai[2] -= 1f; + } + if (npc.ai[2] >= num60) + { + npc.velocity *= 0.95f; + if ((double)npc.velocity.X > -0.1 && (double)npc.velocity.X < 0.1) + { + npc.velocity.X = 0f; + } + if ((double)npc.velocity.Y > -0.1 && (double)npc.velocity.Y < 0.1) + { + npc.velocity.Y = 0f; + } + } + else + { + npc.rotation = (float)Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X) - 1.57f; + } + float num61 = num60 + 13f; + if (npc.ai[2] >= num61) + { + npc.netUpdate = true; + if (npc.netSpam > 10) + { + npc.netSpam = 10; + } + npc.ai[3] += 1f; + npc.ai[2] = 0f; + if (npc.ai[3] >= 5f) + { + npc.ai[1] = 0f; + npc.ai[3] = 0f; + } + else + { + npc.ai[1] = 3f; + } + } + } + else if (npc.ai[1] == 5f) + { + float num62 = 600f; + float num63 = (enraged ? 12f : 8f); + float num64 = (enraged ? 0.4f : 0.25f); + Vector2 vector11 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float num65 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector11.X; + float num66 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) + num62 - vector11.Y; + float num67 = (float)Math.Sqrt((double)(num65 * num65 + num66 * num66)); + num67 = num63 / num67; + num65 *= num67; + num66 *= num67; + if (npc.velocity.X < num65) + { + npc.velocity.X = npc.velocity.X + num64; + if (npc.velocity.X < 0f && num65 > 0f) + { + npc.velocity.X = npc.velocity.X + num64; + } + } + else if (npc.velocity.X > num65) + { + npc.velocity.X = npc.velocity.X - num64; + if (npc.velocity.X > 0f && num65 < 0f) + { + npc.velocity.X = npc.velocity.X - num64; + } + } + if (npc.velocity.Y < num66) + { + npc.velocity.Y = npc.velocity.Y + num64; + if (npc.velocity.Y < 0f && num66 > 0f) + { + npc.velocity.Y = npc.velocity.Y + num64; + } + } + else if (npc.velocity.Y > num66) + { + npc.velocity.Y = npc.velocity.Y - num64; + if (npc.velocity.Y > 0f && num66 < 0f) + { + npc.velocity.Y = npc.velocity.Y - num64; + } + } + npc.ai[2] += 1f; + if (npc.ai[2] >= 70f) + { + npc.TargetClosest(true); + npc.ai[1] = 3f; + npc.ai[2] = -1f; + npc.ai[3] = (float)Main.rand.Next(-3, 1); + npc.netUpdate = true; + } + } + } + return false; + } + #endregion + } + return true; + } + #endregion + + #region AI + public override void AI(NPC npc) + { + if (SCal > -1) + { + if (!npc.friendly && npc.damage > 0 && !npc.dontTakeDamage && npc.type != mod.NPCType("SupremeCalamitas")) + { + npc.active = false; + npc.netUpdate = true; + } + } + if (!CalamityWorld.spawnedHardBoss) + { + if (npc.type == NPCID.TheDestroyer || npc.type == NPCID.Spazmatism || npc.type == NPCID.Retinazer || npc.type == NPCID.SkeletronPrime || + npc.type == NPCID.Plantera || npc.type == mod.NPCType("Cryogen") || npc.type == mod.NPCType("AquaticScourgeHead") || + npc.type == mod.NPCType("BrimstoneElemental") || npc.type == mod.NPCType("Astrageldon") || npc.type == mod.NPCType("AstrumDeusHeadSpectral") || + npc.type == mod.NPCType("Calamitas") || npc.type == mod.NPCType("Siren") || npc.type == mod.NPCType("PlaguebringerGoliath") || + npc.type == mod.NPCType("ScavengerBody") || npc.type == NPCID.DukeFishron || npc.type == NPCID.CultistBoss || npc.type == NPCID.Golem) + { + CalamityWorld.spawnedHardBoss = true; + if (Main.netMode == 2) + { + NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + } + } + } + #region RevengeanceAIChanges + if (CalamityWorld.revenge || CalamityWorld.bossRushActive) + { + #region MoonLord + if (npc.type == NPCID.MoonLordFreeEye) + { + if (NPC.CountNPCS(NPCID.MoonLordFreeEye) > 3) + { + npc.dontTakeDamage = false; + } + else + { + npc.dontTakeDamage = true; + } + } + if (npc.type == NPCID.MoonLordCore) { if (NPC.CountNPCS(NPCID.MoonLordFreeEye) > 3) { npc.dontTakeDamage = true; } - } - else if (npc.type == NPCID.MoonLordHand || npc.type == NPCID.MoonLordHead) + } + else if (npc.type == NPCID.MoonLordHand || npc.type == NPCID.MoonLordHead) { - bool flag90 = npc.ai[2] == 0f; + bool flag90 = npc.ai[2] == 0f; float num1133 = (float)(-(float)flag90.ToDirectionInt()); if (npc.ai[0] == -2f) { - if (npc.type == NPCID.MoonLordHead) - { - if (NPC.CountNPCS(mod.NPCType("Eidolist")) < 1) - { - if (NPC.CountNPCS(NPCID.MoonLordFreeEye) <= 3 || enraged) - { - if (this.newAI[1] < 600f) - { - this.newAI[1] += 1f; - } - if (this.newAI[1] >= 600f) - { - this.newAI[1] = 0f; - npc.netUpdate = true; - if (Main.netMode != 1) - { - NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("Eidolist"), 0, 0f, 0f, 0f, 0f, 255); - } - } - } - } - } - if ((double)Main.npc[(int)npc.ai[3]].life <= (double)Main.npc[(int)npc.ai[3]].lifeMax * 0.75) - { - if (this.newAI[2] < 90f) - { - this.newAI[2] += 1f; - } - if ((int)this.newAI[2] % 60 == 0) - { - npc.netUpdate = true; - if (Main.netMode != 1) - { - int num = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, 400, 0, 0f, 0f, 0f, 0f, 255); - Main.npc[num].ai[3] = npc.ai[3]; - Main.npc[num].netUpdate = true; - } - } - } - if ((CalamityWorld.death || CalamityWorld.bossRushActive) && npc.type == NPCID.MoonLordHead) - { - if ((double)Main.npc[(int)npc.ai[3]].life <= (double)Main.npc[(int)npc.ai[3]].lifeMax * 0.5) - { - if (this.newAI[2] < 150f) - { - this.newAI[2] += 1f; - } - if ((int)this.newAI[2] % 60 == 0) - { - npc.netUpdate = true; - if (Main.netMode != 1) - { - int num = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, 400, 0, 0f, 0f, 0f, 0f, 255); - Main.npc[num].ai[3] = npc.ai[3]; - Main.npc[num].netUpdate = true; - } - } - } - } - if (npc.type == NPCID.MoonLordHead) - { - if (Main.netMode != 1) - { - this.newAI[0] += 1f; - if (this.newAI[0] >= (enraged ? 300f : 480f)) - { - this.newAI[0] = 0f; - npc.TargetClosest(true); - Main.PlaySound(29, (int)npc.position.X, (int)npc.position.Y, 103, 1f, 0f); - for (int num194 = 0; num194 < 40; num194++) - { - int num195 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 229, 0f, 0f, 0, default(Color), 2.5f); - Main.dust[num195].noGravity = true; - Main.dust[num195].velocity *= 3f; - num195 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 229, 0f, 0f, 100, default(Color), 1.5f); - Main.dust[num195].velocity *= 2f; - Main.dust[num195].noGravity = true; - } - if (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) - { - Vector2 shootFromVector = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float spread = 45f * 0.0174f; - double startAngle = Math.Atan2(npc.velocity.X, npc.velocity.Y) - spread / 2; - double deltaAngle = spread / 8f; - double offsetAngle; - int i; - int laserDamage = 30; - for (i = 0; i < 4; i++) - { - offsetAngle = (startAngle + deltaAngle * (i + i * i) / 2f) + 32f * i; - float ai = (6.28318548f * (float)Main.rand.NextDouble() - 3.14159274f) / 30f + 0.0174532924f * num1133; - Projectile.NewProjectile(shootFromVector.X, shootFromVector.Y, (float)(Math.Sin(offsetAngle) * 9f), (float)(Math.Cos(offsetAngle) * 9f), 452, laserDamage, 0f, Main.myPlayer, 0f, ai); - Projectile.NewProjectile(shootFromVector.X, shootFromVector.Y, (float)(-Math.Sin(offsetAngle) * 9f), (float)(-Math.Cos(offsetAngle) * 9f), 462, laserDamage, 0f, Main.myPlayer, 0f, 0f); - } - } - } - } - } - else - { - if (Main.netMode != 1) - { - this.newAI[0] += 1f; - if (this.newAI[0] >= (enraged ? 300f : 480f)) - { - this.newAI[0] = 0f; - npc.TargetClosest(true); - Main.PlaySound(29, (int)npc.position.X, (int)npc.position.Y, 103, 1f, 0f); - for (int num194 = 0; num194 < 40; num194++) - { - int num195 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 229, 0f, 0f, 0, default(Color), 2.5f); - Main.dust[num195].noGravity = true; - Main.dust[num195].velocity *= 3f; - num195 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 229, 0f, 0f, 100, default(Color), 1.5f); - Main.dust[num195].velocity *= 2f; - Main.dust[num195].noGravity = true; - } - if (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) - { - Vector2 shootFromVector = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float spread = 45f * 0.0174f; - double startAngle = Math.Atan2(npc.velocity.X, npc.velocity.Y) - spread / 2; - double deltaAngle = spread / 8f; - double offsetAngle; - int i; - int laserDamage = 30; - for (i = 0; i < 4; i++) - { - offsetAngle = (startAngle + deltaAngle * (i + i * i) / 2f) + 32f * i; - float ai = (6.28318548f * (float)Main.rand.NextDouble() - 3.14159274f) / 30f + 0.0174532924f * num1133; - Projectile.NewProjectile(shootFromVector.X, shootFromVector.Y, (float)(Math.Sin(offsetAngle) * 9f), (float)(Math.Cos(offsetAngle) * 9f), 452, laserDamage, 0f, Main.myPlayer, 0f, ai); - Projectile.NewProjectile(shootFromVector.X, shootFromVector.Y, (float)(-Math.Sin(offsetAngle) * 9f), (float)(-Math.Cos(offsetAngle) * 9f), 462, laserDamage, 0f, Main.myPlayer, 0f, 0f); - } - } - } - } - } + if (npc.type == NPCID.MoonLordHead) + { + if (NPC.CountNPCS(mod.NPCType("Eidolist")) < 1) + { + if (NPC.CountNPCS(NPCID.MoonLordFreeEye) <= 3 || enraged) + { + if (newAI[1] < 600f) + { + newAI[1] += 1f; + } + if (newAI[1] >= 600f) + { + newAI[1] = 0f; + npc.netUpdate = true; + if (Main.netMode != 1) + { + NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("Eidolist"), 0, 0f, 0f, 0f, 0f, 255); + } + } + } + } + } + if ((double)Main.npc[(int)npc.ai[3]].life <= (double)Main.npc[(int)npc.ai[3]].lifeMax * 0.75) + { + if (newAI[2] < 90f) + { + newAI[2] += 1f; + } + if ((int)newAI[2] % 60 == 0) + { + npc.netUpdate = true; + if (Main.netMode != 1) + { + int num = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, 400, 0, 0f, 0f, 0f, 0f, 255); + Main.npc[num].ai[3] = npc.ai[3]; + Main.npc[num].netUpdate = true; + } + } + } + if ((CalamityWorld.death || CalamityWorld.bossRushActive) && npc.type == NPCID.MoonLordHead) + { + if ((double)Main.npc[(int)npc.ai[3]].life <= (double)Main.npc[(int)npc.ai[3]].lifeMax * 0.5) + { + if (newAI[2] < 150f) + { + newAI[2] += 1f; + } + if ((int)newAI[2] % 60 == 0) + { + npc.netUpdate = true; + if (Main.netMode != 1) + { + int num = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, 400, 0, 0f, 0f, 0f, 0f, 255); + Main.npc[num].ai[3] = npc.ai[3]; + Main.npc[num].netUpdate = true; + } + } + } + } + if (npc.type == NPCID.MoonLordHead) + { + if (Main.netMode != 1) + { + newAI[0] += 1f; + if (newAI[0] >= (enraged ? 300f : 480f)) + { + newAI[0] = 0f; + npc.TargetClosest(true); + Main.PlaySound(29, (int)npc.position.X, (int)npc.position.Y, 103, 1f, 0f); + for (int num194 = 0; num194 < 40; num194++) + { + int num195 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 229, 0f, 0f, 0, default(Color), 2.5f); + Main.dust[num195].noGravity = true; + Main.dust[num195].velocity *= 3f; + num195 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 229, 0f, 0f, 100, default(Color), 1.5f); + Main.dust[num195].velocity *= 2f; + Main.dust[num195].noGravity = true; + } + if (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) + { + Vector2 shootFromVector = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float spread = 45f * 0.0174f; + double startAngle = Math.Atan2(npc.velocity.X, npc.velocity.Y) - spread / 2; + double deltaAngle = spread / 8f; + double offsetAngle; + int i; + int laserDamage = 30; + for (i = 0; i < 4; i++) + { + offsetAngle = (startAngle + deltaAngle * (i + i * i) / 2f) + 32f * i; + float ai = (6.28318548f * (float)Main.rand.NextDouble() - 3.14159274f) / 30f + 0.0174532924f * num1133; + Projectile.NewProjectile(shootFromVector.X, shootFromVector.Y, (float)(Math.Sin(offsetAngle) * 9f), (float)(Math.Cos(offsetAngle) * 9f), 452, laserDamage, 0f, Main.myPlayer, 0f, ai); + Projectile.NewProjectile(shootFromVector.X, shootFromVector.Y, (float)(-Math.Sin(offsetAngle) * 9f), (float)(-Math.Cos(offsetAngle) * 9f), 462, laserDamage, 0f, Main.myPlayer, 0f, 0f); + } + } + } + } + } + else + { + if (Main.netMode != 1) + { + newAI[0] += 1f; + if (newAI[0] >= (enraged ? 300f : 480f)) + { + newAI[0] = 0f; + npc.TargetClosest(true); + Main.PlaySound(29, (int)npc.position.X, (int)npc.position.Y, 103, 1f, 0f); + for (int num194 = 0; num194 < 40; num194++) + { + int num195 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 229, 0f, 0f, 0, default(Color), 2.5f); + Main.dust[num195].noGravity = true; + Main.dust[num195].velocity *= 3f; + num195 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 229, 0f, 0f, 100, default(Color), 1.5f); + Main.dust[num195].velocity *= 2f; + Main.dust[num195].noGravity = true; + } + if (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) + { + Vector2 shootFromVector = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float spread = 45f * 0.0174f; + double startAngle = Math.Atan2(npc.velocity.X, npc.velocity.Y) - spread / 2; + double deltaAngle = spread / 8f; + double offsetAngle; + int i; + int laserDamage = 30; + for (i = 0; i < 4; i++) + { + offsetAngle = (startAngle + deltaAngle * (i + i * i) / 2f) + 32f * i; + float ai = (6.28318548f * (float)Main.rand.NextDouble() - 3.14159274f) / 30f + 0.0174532924f * num1133; + Projectile.NewProjectile(shootFromVector.X, shootFromVector.Y, (float)(Math.Sin(offsetAngle) * 9f), (float)(Math.Cos(offsetAngle) * 9f), 452, laserDamage, 0f, Main.myPlayer, 0f, ai); + Projectile.NewProjectile(shootFromVector.X, shootFromVector.Y, (float)(-Math.Sin(offsetAngle) * 9f), (float)(-Math.Cos(offsetAngle) * 9f), 462, laserDamage, 0f, Main.myPlayer, 0f, 0f); + } + } + } + } + } } } - #endregion - #region LunaticCultist - else if (npc.type == NPCID.CultistBoss) + #endregion + #region LunaticCultist + else if (npc.type == NPCID.CultistBoss) { + if (npc.buffImmune[mod.BuffType("Enraged")]) + { + npc.buffImmune[mod.BuffType("Enraged")] = false; + } bool goNuts = (double)npc.life <= (double)npc.lifeMax * 0.5 || enraged; - if (goNuts) - { - if (NPC.CountNPCS(mod.NPCType("Eidolist")) < 2) - { - if (this.newAI[0] < 120f) - { - this.newAI[0] += 1f; - } - if (this.newAI[0] >= 120f) - { - this.newAI[0] = 0f; - npc.netUpdate = true; - if (Main.netMode != 1) - { - NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("Eidolist"), 0, 0f, 0f, 0f, 0f, 255); - } - if (NPC.CountNPCS(mod.NPCType("Eidolist")) > 1) - { - this.newAI[0] = -780f; - } - } - } - } - if (!goNuts) - { - if (CultCountdown == 0) - { - if (CalamityWorld.death || CalamityWorld.bossRushActive) - { - CultCountdown = 75; - } - else if ((double)npc.life <= (double)npc.lifeMax * 0.5) - { - CultCountdown = 150; - } - else - { - CultCountdown = 200; - } - } - if (CultCountdown > 0) - { - CultCountdown--; - if (CultCountdown == 0) - { - if (Main.netMode != 1) - { - Player player2 = Main.player[npc.target]; - int speed2 = 8; - float spawnX = Main.rand.Next(1000) - 500 + player2.Center.X; - float spawnY = -1000 + player2.Center.Y; - Vector2 baseSpawn = new Vector2(spawnX, spawnY); - Vector2 baseVelocity = player2.Center - baseSpawn; - baseVelocity.Normalize(); - baseVelocity = baseVelocity * speed2; - int damage = 25; //100 - for (int i = 0; i < CultProjectiles; i++) - { - Vector2 spawn2 = baseSpawn; - spawn2.X = spawn2.X + i * 30 - (CultProjectiles * 15); - Vector2 velocity = baseVelocity; - velocity = baseVelocity.RotatedBy(MathHelper.ToRadians(-CultAngleSpread / 2 + (CultAngleSpread * i / (float)CultProjectiles))); - velocity.X = velocity.X + 3 * Main.rand.NextFloat() - 1.5f; - int projectileType = Main.rand.Next(3); - if (projectileType == 0) - { - projectileType = 467; - } - else if (projectileType == 1) - { - projectileType = 348; - } - else - { - projectileType = 593; - } - int projectileI = Projectile.NewProjectile(spawn2.X, spawn2.Y, velocity.X, velocity.Y, projectileType, damage, 0f, Main.myPlayer, 0f, 0f); - Main.projectile[projectileI].tileCollide = false; - } - } - } - } - } + if (goNuts) + { + if (NPC.CountNPCS(mod.NPCType("Eidolist")) < 2) + { + if (newAI[0] < 120f) + { + newAI[0] += 1f; + } + if (newAI[0] >= 120f) + { + newAI[0] = 0f; + npc.netUpdate = true; + if (Main.netMode != 1) + { + NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("Eidolist"), 0, 0f, 0f, 0f, 0f, 255); + } + if (NPC.CountNPCS(mod.NPCType("Eidolist")) > 1) + { + newAI[0] = -780f; + } + } + } + } + if (!goNuts) + { + if (CultCountdown == 0) + { + if (CalamityWorld.death || CalamityWorld.bossRushActive) + { + CultCountdown = 75; + } + else if ((double)npc.life <= (double)npc.lifeMax * 0.5) + { + CultCountdown = 150; + } + else + { + CultCountdown = 200; + } + } + if (CultCountdown > 0) + { + CultCountdown--; + if (CultCountdown == 0) + { + if (Main.netMode != 1) + { + Player player2 = Main.player[npc.target]; + int speed2 = 8; + float spawnX = Main.rand.Next(1000) - 500 + player2.Center.X; + float spawnY = -1000 + player2.Center.Y; + Vector2 baseSpawn = new Vector2(spawnX, spawnY); + Vector2 baseVelocity = player2.Center - baseSpawn; + baseVelocity.Normalize(); + baseVelocity = baseVelocity * speed2; + int damage = 25; //100 + for (int i = 0; i < CultProjectiles; i++) + { + Vector2 spawn2 = baseSpawn; + spawn2.X = spawn2.X + i * 30 - (CultProjectiles * 15); + Vector2 velocity = baseVelocity; + velocity = baseVelocity.RotatedBy(MathHelper.ToRadians(-CultAngleSpread / 2 + (CultAngleSpread * i / (float)CultProjectiles))); + velocity.X = velocity.X + 3 * Main.rand.NextFloat() - 1.5f; + int projectileType = Main.rand.Next(3); + if (projectileType == 0) + { + projectileType = 467; + } + else if (projectileType == 1) + { + projectileType = 348; + } + else + { + projectileType = 593; + } + int projectileI = Projectile.NewProjectile(spawn2.X, spawn2.Y, velocity.X, velocity.Y, projectileType, damage, 0f, Main.myPlayer, 0f, 0f); + Main.projectile[projectileI].tileCollide = false; + } + } + } + } + } } - #endregion - #region DukeFishron - else if (npc.type == NPCID.DukeFishron) + #endregion + #region DukeFishron + else if (npc.type == NPCID.DukeFishron) { Vector2 vector = npc.Center; bool murderMode = (double)npc.life <= (double)npc.lifeMax * 0.75; - bool murderMode2 = (double)npc.life <= (double)npc.lifeMax * ((CalamityWorld.death || CalamityWorld.bossRushActive) ? 0.5 : 0.33); - float num = 0.6f * Main.damageMultiplier; //1.2 + bool murderMode2 = (double)npc.life <= (double)npc.lifeMax * ((CalamityWorld.death || CalamityWorld.bossRushActive) ? 0.3 : 0.2); + float num = 0.6f * Main.damageMultiplier; //1.2 bool flag3 = npc.ai[0] > 4f; bool flag4 = npc.ai[0] > 9f; if (flag4) { npc.damage = (int)((float)npc.defDamage * 1.1f * num); npc.defense = 38; - this.newAI[0] += 1f; - if (this.newAI[0] >= 480f) - { - this.newAI[0] = 0f; - if (Main.netMode != 1) - { - Projectile.NewProjectile(vector.X, vector.Y, 0f, 0f, 385, 0, 0f, Main.myPlayer, 1f, (float)(npc.target + 1)); - } - npc.netUpdate = true; - } + newAI[0] += 1f; + if (newAI[0] >= 600f) + { + newAI[0] = 0f; + if (Main.netMode != 1) + { + Projectile.NewProjectile(vector.X, vector.Y, 0f, 0f, 385, 0, 0f, Main.myPlayer, 1f, (float)(npc.target + 1)); + } + npc.netUpdate = true; + } } else if (flag3) { @@ -6050,15 +6185,15 @@ namespace CalamityMod.NPCs { npc.velocity *= 1.01f; //20, 24, 30 } - if (npc.ai[0] == 0f && !Main.player[npc.target].dead) + if (npc.ai[0] == 0f && !Main.player[npc.target].dead) { if (murderMode) { npc.ai[0] = 4f; npc.ai[1] = 0f; npc.ai[2] = 0f; - npc.netUpdate = true; - } + npc.netUpdate = true; + } } else if (npc.ai[0] == 5f && !Main.player[npc.target].dead) { @@ -6067,96 +6202,96 @@ namespace CalamityMod.NPCs npc.ai[0] = 9f; npc.ai[1] = 0f; npc.ai[2] = 0f; - npc.netUpdate = true; - } + npc.netUpdate = true; + } } } - #endregion - #region Golem - else if (npc.type == NPCID.GolemHeadFree && !CalamityWorld.bossRushActive) + #endregion + #region Golem + else if (npc.type == NPCID.GolemHeadFree && !CalamityWorld.bossRushActive) { - bool enrage = true; - if ((double)Main.player[npc.target].Center.Y > Main.worldSurface * 16.0) - { - int num = (int)Main.player[npc.target].Center.X / 16; - int num2 = (int)Main.player[npc.target].Center.Y / 16; - Tile tile = Framing.GetTileSafely(num, num2); - if (tile.wall == 87) - { - enrage = false; - } - } - if (NPC.CountNPCS(NPCID.Golem) > 0) - { - if (enrage) - { - npc.ai[1] += 3f; - } - npc.ai[1] -= 0.25f; //0.75 - if ((double)Main.npc[NPC.golemBoss].life < (double)Main.npc[NPC.golemBoss].lifeMax * 0.8) - { - npc.ai[1] -= 0.75f; //1 - } - if ((double)Main.npc[NPC.golemBoss].life < (double)Main.npc[NPC.golemBoss].lifeMax * 0.6) - { - npc.ai[1] -= 0.75f; //1.25 - } - if ((double)Main.npc[NPC.golemBoss].life < (double)Main.npc[NPC.golemBoss].lifeMax * 0.2) - { - npc.ai[1] -= 0.75f; //1.5 - } - if ((double)Main.npc[NPC.golemBoss].life < (double)Main.npc[NPC.golemBoss].lifeMax * 0.1) - { - npc.ai[1] -= 0.75f; //1.75 - } - if (enrage) - { - npc.ai[2] += 3f; - } - npc.ai[2] -= 0.25f; //0.75 - if (Main.npc[NPC.golemBoss].life < Main.npc[NPC.golemBoss].lifeMax / 2) - { - npc.ai[2] -= 0.75f; //1 - } - if (Main.npc[NPC.golemBoss].life < Main.npc[NPC.golemBoss].lifeMax / 3) - { - npc.ai[2] -= 0.75f; //1.25 - } - if (Main.npc[NPC.golemBoss].life < Main.npc[NPC.golemBoss].lifeMax / 4) - { - npc.ai[2] -= 0.5f; //1.75 - } - if (Main.npc[NPC.golemBoss].life < Main.npc[NPC.golemBoss].lifeMax / 5) - { - npc.ai[2] -= 0.5f; //1.25 - } - if (Main.npc[NPC.golemBoss].life < Main.npc[NPC.golemBoss].lifeMax / 6) - { - npc.ai[2] -= 0.25f; //2 - } - } - } + bool enrage = true; + if ((double)Main.player[npc.target].Center.Y > Main.worldSurface * 16.0) + { + int num = (int)Main.player[npc.target].Center.X / 16; + int num2 = (int)Main.player[npc.target].Center.Y / 16; + Tile tile = Framing.GetTileSafely(num, num2); + if (tile.wall == 87) + { + enrage = false; + } + } + if (NPC.CountNPCS(NPCID.Golem) > 0) + { + if (enrage) + { + npc.ai[1] += 3f; + } + npc.ai[1] -= 0.25f; //0.75 + if ((double)Main.npc[NPC.golemBoss].life < (double)Main.npc[NPC.golemBoss].lifeMax * 0.8) + { + npc.ai[1] -= 0.75f; //1 + } + if ((double)Main.npc[NPC.golemBoss].life < (double)Main.npc[NPC.golemBoss].lifeMax * 0.6) + { + npc.ai[1] -= 0.75f; //1.25 + } + if ((double)Main.npc[NPC.golemBoss].life < (double)Main.npc[NPC.golemBoss].lifeMax * 0.2) + { + npc.ai[1] -= 0.75f; //1.5 + } + if ((double)Main.npc[NPC.golemBoss].life < (double)Main.npc[NPC.golemBoss].lifeMax * 0.1) + { + npc.ai[1] -= 0.75f; //1.75 + } + if (enrage) + { + npc.ai[2] += 3f; + } + npc.ai[2] -= 0.25f; //0.75 + if (Main.npc[NPC.golemBoss].life < Main.npc[NPC.golemBoss].lifeMax / 2) + { + npc.ai[2] -= 0.75f; //1 + } + if (Main.npc[NPC.golemBoss].life < Main.npc[NPC.golemBoss].lifeMax / 3) + { + npc.ai[2] -= 0.75f; //1.25 + } + if (Main.npc[NPC.golemBoss].life < Main.npc[NPC.golemBoss].lifeMax / 4) + { + npc.ai[2] -= 0.5f; //1.75 + } + if (Main.npc[NPC.golemBoss].life < Main.npc[NPC.golemBoss].lifeMax / 5) + { + npc.ai[2] -= 0.5f; //1.25 + } + if (Main.npc[NPC.golemBoss].life < Main.npc[NPC.golemBoss].lifeMax / 6) + { + npc.ai[2] -= 0.25f; //2 + } + } + } else if (npc.type == NPCID.GolemHead && !CalamityWorld.bossRushActive) { - bool enrage = true; - if ((double)Main.player[npc.target].Center.Y > Main.worldSurface * 16.0) - { - int num = (int)Main.player[npc.target].Center.X / 16; - int num2 = (int)Main.player[npc.target].Center.Y / 16; - Tile tile = Framing.GetTileSafely(num, num2); - if (tile.wall == 87) - { - enrage = false; - } - } - if (npc.ai[0] == 1f) + bool enrage = true; + if ((double)Main.player[npc.target].Center.Y > Main.worldSurface * 16.0) { - if (enrage) - { - npc.ai[1] += 3f; - } - npc.ai[1] -= 0.25f; //0.75 - if ((double)npc.life < (double)npc.lifeMax * 0.4) + int num = (int)Main.player[npc.target].Center.X / 16; + int num2 = (int)Main.player[npc.target].Center.Y / 16; + Tile tile = Framing.GetTileSafely(num, num2); + if (tile.wall == 87) + { + enrage = false; + } + } + if (npc.ai[0] == 1f) + { + if (enrage) + { + npc.ai[1] += 3f; + } + npc.ai[1] -= 0.25f; //0.75 + if ((double)npc.life < (double)npc.lifeMax * 0.4) { npc.ai[1] -= 0.75f; //1 } @@ -6164,54 +6299,49 @@ namespace CalamityMod.NPCs { npc.ai[1] -= 0.75f; //1.25 } - if (enrage) - { - npc.ai[2] += 3f; - } - npc.ai[2] -= 0.25f; //0.75 - if (npc.life < npc.lifeMax / 3) + if (enrage) { - npc.ai[2] -= 0.75f; //1 - } + npc.ai[2] += 3f; + } + npc.ai[2] -= 0.25f; //0.75 + if (npc.life < npc.lifeMax / 3) + { + npc.ai[2] -= 0.75f; //1 + } if (npc.life < npc.lifeMax / 4) { - npc.ai[2] -= 0.75f; //1.25 - } + npc.ai[2] -= 0.75f; //1.25 + } if (npc.life < npc.lifeMax / 5) { - npc.ai[2] -= 0.75f; //1.5 - } - } + npc.ai[2] -= 0.75f; //1.5 + } + } } - else if (npc.type == NPCID.GolemFistLeft || npc.type == NPCID.GolemFistRight) - { - npc.life = 4000; - npc.dontTakeDamage = true; - } - #endregion - #region Plantera - else if (npc.type == NPCID.Plantera) + #endregion + #region Plantera + else if (npc.type == NPCID.Plantera) { bool jungle = Main.player[npc.target].ZoneJungle; - if (npc.life < npc.lifeMax / 8 || CalamityWorld.bossRushActive) - { - npc.velocity.X *= 1.003f; - npc.velocity.Y *= 1.003f; - } - else if (npc.life < npc.lifeMax / 4) - { - npc.velocity.X *= 1.001f; - npc.velocity.Y *= 1.001f; - } - else if (npc.life < npc.lifeMax / 2) - { - npc.velocity.X *= 1.0005f; - npc.velocity.Y *= 1.0005f; - } - if (npc.life > npc.lifeMax / 2) + if (npc.life < npc.lifeMax / 8 || CalamityWorld.bossRushActive) + { + npc.velocity.X *= 1.003f; + npc.velocity.Y *= 1.003f; + } + else if (npc.life < npc.lifeMax / 4) + { + npc.velocity.X *= 1.001f; + npc.velocity.Y *= 1.001f; + } + else if (npc.life < npc.lifeMax / 2) + { + npc.velocity.X *= 1.0005f; + npc.velocity.Y *= 1.0005f; + } + if (npc.life > npc.lifeMax / 2) { npc.defense = 42; - if (!jungle && !CalamityWorld.bossRushActive) + if (!jungle && !CalamityWorld.bossRushActive) { npc.defense = 200; npc.damage = (int)(120f * Main.damageMultiplier); @@ -6219,167 +6349,167 @@ namespace CalamityMod.NPCs if (Main.netMode != 1) { npc.localAI[1] += (enraged ? 3f : 1.5f); - } + } } else { npc.defense = 22; - if (!jungle && !CalamityWorld.bossRushActive) + if (!jungle && !CalamityWorld.bossRushActive) { npc.defense = 400; npc.damage = (int)(200f * Main.damageMultiplier); } - this.newAI[0] += 1f; - if (CalamityWorld.death || CalamityWorld.bossRushActive) - { - this.newAI[0] += 0.5f; - } - if (this.newAI[0] >= (enraged ? 150f : 270f)) + newAI[0] += 1f; + if (CalamityWorld.death || CalamityWorld.bossRushActive) { - this.newAI[0] = 0f; + newAI[0] += 0.5f; + } + if (newAI[0] >= (enraged ? 150f : 270f)) + { + newAI[0] = 0f; if (Main.netMode != 1 && NPC.CountNPCS(NPCID.PlanterasTentacle) < 20) { NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, NPCID.PlanterasTentacle, npc.whoAmI, 0f, 0f, 0f, 0f, 255); } } - if (CalamityWorld.death || (double)npc.life < (double)npc.lifeMax * 0.25 || CalamityWorld.bossRushActive) - { - this.newAI[1] += 1f; - if (CalamityWorld.death || CalamityWorld.bossRushActive) - { - this.newAI[1] += 0.5f; - } - if (!jungle) - { - this.newAI[1] += 2f; - } - if (this.newAI[1] >= (enraged ? 180f : 240f)) - { - this.newAI[1] = 0f; - if (Collision.CanHit(npc.Center, 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) - { - Vector2 vector34 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num349 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector34.X; - float num350 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector34.Y; - float num351 = (float)Math.Sqrt((double)(num349 * num349 + num350 * num350)); - num349 *= num351; - num350 *= num351; - if (Main.netMode != 1) - { - float num418 = (!jungle ? 24f : 12f); - int num419 = 32; - int num420 = 277; - num351 = (float)Math.Sqrt((double)(num349 * num349 + num350 * num350)); - num351 = num418 / num351; - num349 *= num351; - num350 *= num351; - num349 += (float)Main.rand.Next(-10, 11) * 0.05f; - num350 += (float)Main.rand.Next(-10, 11) * 0.05f; - vector34.X += num349 * 4f; - vector34.Y += num350 * 4f; - Projectile.NewProjectile(vector34.X, vector34.Y, num349, num350, num420, num419, 0f, Main.myPlayer, 0f, 0f); - } - } - } - } - npc.localAI[1] += 1f; - } + if (CalamityWorld.death || (double)npc.life < (double)npc.lifeMax * 0.25 || CalamityWorld.bossRushActive) + { + newAI[1] += 1f; + if (CalamityWorld.death || CalamityWorld.bossRushActive) + { + newAI[1] += 0.5f; + } + if (!jungle) + { + newAI[1] += 2f; + } + if (newAI[1] >= (enraged ? 180f : 240f)) + { + newAI[1] = 0f; + if (Collision.CanHit(npc.Center, 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) + { + Vector2 vector34 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float num349 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector34.X; + float num350 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector34.Y; + float num351 = (float)Math.Sqrt((double)(num349 * num349 + num350 * num350)); + num349 *= num351; + num350 *= num351; + if (Main.netMode != 1) + { + float num418 = (!jungle ? 24f : 12f); + int num419 = 32; + int num420 = 277; + num351 = (float)Math.Sqrt((double)(num349 * num349 + num350 * num350)); + num351 = num418 / num351; + num349 *= num351; + num350 *= num351; + num349 += (float)Main.rand.Next(-10, 11) * 0.05f; + num350 += (float)Main.rand.Next(-10, 11) * 0.05f; + vector34.X += num349 * 4f; + vector34.Y += num350 * 4f; + Projectile.NewProjectile(vector34.X, vector34.Y, num349, num350, num420, num419, 0f, Main.myPlayer, 0f, 0f); + } + } + } + } + npc.localAI[1] += 1f; + } } - if (npc.type == NPCID.PlanterasTentacle) - { - bool jungle = Main.player[npc.target].ZoneJungle; - this.newAI[0] += 1f; - if (CalamityWorld.death || !jungle) - { - this.newAI[0] += 1f; - } - if (this.newAI[0] >= 480f) - { - this.newAI[0] = 0f; - if (Main.netMode != 1 && NPC.CountNPCS(NPCID.Spore) < 20) - { - NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, NPCID.Spore, npc.whoAmI, 0f, 0f, 0f, 0f, 255); - } - } - } - #endregion - #region SkeletronPrime - else if (npc.type == NPCID.SkeletronPrime) + if (npc.type == NPCID.PlanterasTentacle) { - if (Main.netMode != 1) - { - if (npc.ai[1] != 1f || (!CalamityWorld.death && (double)npc.life > (double)npc.lifeMax * 0.25) || CalamityWorld.bossRushActive) - { - npc.localAI[0] += 1f; - if ((double)npc.life <= (double)npc.lifeMax * 0.5 || CalamityWorld.bossRushActive) - { - npc.localAI[0] += 1f; - } - if ((double)npc.life <= (double)npc.lifeMax * 0.1 || CalamityWorld.bossRushActive) - { - npc.localAI[0] += 1f; - } - if (npc.localAI[0] >= (enraged ? 90f : 120f)) - { - npc.localAI[0] = 0f; - Vector2 vector16 = npc.Center; - float num157 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector16.X; - float num158 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector16.Y; - Math.Sqrt((double)(num157 * num157 + num158 * num158)); - if (Collision.CanHit(vector16, 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) - { - float num159 = 7f; - float num160 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector16.X + (float)Main.rand.Next(-20, 21); - float num161 = Main.player[npc.target].position.Y + (float)Main.player[npc.target].height * 0.5f - vector16.Y + (float)Main.rand.Next(-20, 21); - float num162 = (float)Math.Sqrt((double)(num160 * num160 + num161 * num161)); - num162 = num159 / num162; - num160 *= num162; - num161 *= num162; - Vector2 value = new Vector2(num160 * 1f + (float)Main.rand.Next(-50, 51) * 0.01f, num161 * 1f + (float)Main.rand.Next(-50, 51) * 0.01f); - value.Normalize(); - value *= num159; - value += npc.velocity; - num160 = value.X; - num161 = value.Y; - int num163 = 27; - int num164 = 270; - vector16 += value * 5f; - int num165 = Projectile.NewProjectile(vector16.X, vector16.Y, num160, num161, num164, num163, 0f, Main.myPlayer, -1f, 0f); - Main.projectile[num165].timeLeft = 300; - } - } - } - if (CalamityWorld.death || (double)npc.life <= (double)npc.lifeMax * 0.25 || CalamityWorld.bossRushActive) - { - this.newAI[0] += 1f; - if (npc.ai[1] == 1f || CalamityWorld.bossRushActive) - { - this.newAI[0] += 3f; - } - if (this.newAI[0] >= (enraged ? 180f : 240f)) //4 seconds or 1 second - { - this.newAI[0] = 0f; - Vector2 shootFromVector = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float spread = 45f * 0.0174f; - double startAngle = Math.Atan2(npc.velocity.X, npc.velocity.Y) - spread / 2; - double deltaAngle = spread / 8f; - double offsetAngle; - int damage = 30; - int i; - for (i = 0; i < 6; i++) - { - offsetAngle = (startAngle + deltaAngle * (i + i * i) / 2f) + 32f * i; - int projectile = Projectile.NewProjectile(shootFromVector.X, shootFromVector.Y, (float)(Math.Sin(offsetAngle) * 6f), (float)(Math.Cos(offsetAngle) * 6f), 100, damage, 0f, Main.myPlayer, 0f, 0f); - int projectile2 = Projectile.NewProjectile(shootFromVector.X, shootFromVector.Y, (float)(-Math.Sin(offsetAngle) * 6f), (float)(-Math.Cos(offsetAngle) * 6f), 100, damage, 0f, Main.myPlayer, 0f, 0f); - Main.projectile[projectile].timeLeft = 300; - Main.projectile[projectile2].timeLeft = 300; - Main.projectile[projectile].tileCollide = false; - Main.projectile[projectile2].tileCollide = false; - } - } - } - } - if (npc.ai[1] == 1f) + bool jungle = Main.player[npc.target].ZoneJungle; + newAI[0] += 1f; + if (CalamityWorld.death || !jungle) + { + newAI[0] += 1f; + } + if (newAI[0] >= 480f) + { + newAI[0] = 0f; + if (Main.netMode != 1 && NPC.CountNPCS(NPCID.Spore) < 20) + { + NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, NPCID.Spore, npc.whoAmI, 0f, 0f, 0f, 0f, 255); + } + } + } + #endregion + #region SkeletronPrime + else if (npc.type == NPCID.SkeletronPrime) + { + if (Main.netMode != 1) + { + if (npc.ai[1] != 1f || (!CalamityWorld.death && (double)npc.life > (double)npc.lifeMax * 0.25) || CalamityWorld.bossRushActive) + { + npc.localAI[0] += 1f; + if ((double)npc.life <= (double)npc.lifeMax * 0.5 || CalamityWorld.bossRushActive) + { + npc.localAI[0] += 1f; + } + if ((double)npc.life <= (double)npc.lifeMax * 0.1 || CalamityWorld.bossRushActive) + { + npc.localAI[0] += 1f; + } + if (npc.localAI[0] >= (enraged ? 90f : 120f)) + { + npc.localAI[0] = 0f; + Vector2 vector16 = npc.Center; + float num157 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector16.X; + float num158 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector16.Y; + Math.Sqrt((double)(num157 * num157 + num158 * num158)); + if (Collision.CanHit(vector16, 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) + { + float num159 = 7f; + float num160 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector16.X + (float)Main.rand.Next(-20, 21); + float num161 = Main.player[npc.target].position.Y + (float)Main.player[npc.target].height * 0.5f - vector16.Y + (float)Main.rand.Next(-20, 21); + float num162 = (float)Math.Sqrt((double)(num160 * num160 + num161 * num161)); + num162 = num159 / num162; + num160 *= num162; + num161 *= num162; + Vector2 value = new Vector2(num160 * 1f + (float)Main.rand.Next(-50, 51) * 0.01f, num161 * 1f + (float)Main.rand.Next(-50, 51) * 0.01f); + value.Normalize(); + value *= num159; + value += npc.velocity; + num160 = value.X; + num161 = value.Y; + int num163 = 27; + int num164 = 270; + vector16 += value * 5f; + int num165 = Projectile.NewProjectile(vector16.X, vector16.Y, num160, num161, num164, num163, 0f, Main.myPlayer, -1f, 0f); + Main.projectile[num165].timeLeft = 300; + } + } + } + if (CalamityWorld.death || (double)npc.life <= (double)npc.lifeMax * 0.25 || CalamityWorld.bossRushActive) + { + newAI[0] += 1f; + if (npc.ai[1] == 1f || CalamityWorld.bossRushActive) + { + newAI[0] += 3f; + } + if (newAI[0] >= (enraged ? 180f : 240f)) //4 seconds or 1 second + { + newAI[0] = 0f; + Vector2 shootFromVector = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float spread = 45f * 0.0174f; + double startAngle = Math.Atan2(npc.velocity.X, npc.velocity.Y) - spread / 2; + double deltaAngle = spread / 8f; + double offsetAngle; + int damage = 30; + int i; + for (i = 0; i < 6; i++) + { + offsetAngle = (startAngle + deltaAngle * (i + i * i) / 2f) + 32f * i; + int projectile = Projectile.NewProjectile(shootFromVector.X, shootFromVector.Y, (float)(Math.Sin(offsetAngle) * 6f), (float)(Math.Cos(offsetAngle) * 6f), 100, damage, 0f, Main.myPlayer, 0f, 0f); + int projectile2 = Projectile.NewProjectile(shootFromVector.X, shootFromVector.Y, (float)(-Math.Sin(offsetAngle) * 6f), (float)(-Math.Cos(offsetAngle) * 6f), 100, damage, 0f, Main.myPlayer, 0f, 0f); + Main.projectile[projectile].timeLeft = 300; + Main.projectile[projectile2].timeLeft = 300; + Main.projectile[projectile].tileCollide = false; + Main.projectile[projectile2].tileCollide = false; + } + } + } + } + if (npc.ai[1] == 1f) { int speed = CalamityWorld.bossRushActive ? 7 : 4; if ((double)npc.life <= (double)npc.lifeMax * 0.7) @@ -6390,11 +6520,11 @@ namespace CalamityMod.NPCs { speed++; } - if (enraged) - { - speed += 3; - } - float speed2 = (float)speed; + if (enraged) + { + speed += 3; + } + float speed2 = (float)speed; float speedBuff = 3f + (3f * (1f - (float)npc.life / (float)npc.lifeMax)); float speedBuff2 = 11f + (11f * (1f - (float)npc.life / (float)npc.lifeMax)); Vector2 vector45 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); @@ -6415,486 +6545,498 @@ namespace CalamityMod.NPCs npc.velocity.Y = num445 * num446; } } - else if (npc.type == NPCID.PrimeLaser) - { - if (Main.netMode != 1) - { - npc.localAI[0] += 2f; - if (CalamityWorld.death || CalamityWorld.bossRushActive) - { - npc.localAI[0] += 2f; - } - } - } - else if (npc.type == NPCID.PrimeCannon) - { - npc.TargetClosest(true); - Vector2 vector61 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num499 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector61.X; - float num500 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector61.Y; - npc.rotation = (float)Math.Atan2((double)num500, (double)num499) - 1.57f; - if (Main.netMode != 1) - { - npc.localAI[0] = 0f; - npc.localAI[1] += 1f; - if (CalamityWorld.death || CalamityWorld.bossRushActive) - { - npc.localAI[1] += 1f; - } - if (npc.ai[2] == 1f) - { - npc.localAI[1] += 2f; - if (CalamityWorld.death || CalamityWorld.bossRushActive) - { - npc.localAI[1] += 2f; - } - } - if (npc.localAI[1] > (enraged ? 90f : 120f)) - { - npc.localAI[1] = 0f; - npc.TargetClosest(true); - if (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) - { - float num941 = 9f; //speed - Vector2 vector104 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)(npc.height / 2)); - float num942 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector104.X + (float)Main.rand.Next(-20, 21); - float num943 = Main.player[npc.target].position.Y + (float)Main.player[npc.target].height * 0.5f - vector104.Y + (float)Main.rand.Next(-20, 21); - float num944 = (float)Math.Sqrt((double)(num942 * num942 + num943 * num943)); - num944 = num941 / num944; - num942 *= num944; - num943 *= num944; - num942 += (float)Main.rand.Next(-5, 6) * 0.05f; - num943 += (float)Main.rand.Next(-5, 6) * 0.05f; - int num945 = 27; - int num946 = 303; - vector104.X += num942 * 5f; - vector104.Y += num943 * 5f; - int num947 = Projectile.NewProjectile(vector104.X, vector104.Y, num942, num943, num946, num945, 0f, Main.myPlayer, 0f, 0f); - Main.projectile[num947].timeLeft = 180; - npc.netUpdate = true; - } - } - } - } - #endregion - #region TheTwins - else if (npc.type == NPCID.Retinazer) + else if (npc.type == NPCID.PrimeLaser) { - laserEye = npc.whoAmI; + if (Main.netMode != 1) + { + npc.localAI[0] += 2f; + if (CalamityWorld.death || CalamityWorld.bossRushActive) + { + npc.localAI[0] += 2f; + } + } + } + else if (npc.type == NPCID.PrimeCannon) + { + npc.TargetClosest(true); + Vector2 vector61 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float num499 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector61.X; + float num500 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector61.Y; + npc.rotation = (float)Math.Atan2((double)num500, (double)num499) - 1.57f; + if (Main.netMode != 1) + { + npc.localAI[0] = 0f; + npc.localAI[1] += 1f; + if (CalamityWorld.death || CalamityWorld.bossRushActive) + { + npc.localAI[1] += 1f; + } + if (npc.ai[2] == 1f) + { + npc.localAI[1] += 2f; + if (CalamityWorld.death || CalamityWorld.bossRushActive) + { + npc.localAI[1] += 2f; + } + } + if (npc.localAI[1] > (enraged ? 90f : 120f)) + { + npc.localAI[1] = 0f; + npc.TargetClosest(true); + if (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) + { + float num941 = 9f; //speed + Vector2 vector104 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)(npc.height / 2)); + float num942 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector104.X + (float)Main.rand.Next(-20, 21); + float num943 = Main.player[npc.target].position.Y + (float)Main.player[npc.target].height * 0.5f - vector104.Y + (float)Main.rand.Next(-20, 21); + float num944 = (float)Math.Sqrt((double)(num942 * num942 + num943 * num943)); + num944 = num941 / num944; + num942 *= num944; + num943 *= num944; + num942 += (float)Main.rand.Next(-5, 6) * 0.05f; + num943 += (float)Main.rand.Next(-5, 6) * 0.05f; + int num945 = 27; + int num946 = 303; + vector104.X += num942 * 5f; + vector104.Y += num943 * 5f; + int num947 = Projectile.NewProjectile(vector104.X, vector104.Y, num942, num943, num946, num945, 0f, Main.myPlayer, 0f, 0f); + Main.projectile[num947].timeLeft = 180; + npc.netUpdate = true; + } + } + } + } + #endregion + #region TheTwins + else if (npc.type == NPCID.Retinazer) + { + laserEye = npc.whoAmI; bool spazAlive = false; if (NPC.CountNPCS(NPCID.Spazmatism) > 0) { spazAlive = true; } - if (npc.ai[0] == 0f) - { - double healthMult = ((CalamityWorld.death || CalamityWorld.bossRushActive) ? 0.8 : 0.6); - if ((double)npc.life < (double)npc.lifeMax * healthMult) - { - npc.ai[0] = 1f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] = 0f; - npc.netUpdate = true; - return; - } - } - else if (npc.ai[0] != 1f && npc.ai[0] != 2f && npc.ai[0] != 0f) + if (npc.ai[0] == 0f) { - if (spazAlive) - { - if (Main.npc[fireEye].ai[0] == 1f || Main.npc[fireEye].ai[0] == 2f || Main.npc[fireEye].ai[0] == 0f) - { - npc.dontTakeDamage = true; - } - else - { - npc.dontTakeDamage = false; - } - } - else - { - npc.dontTakeDamage = false; - } + double healthMult = ((CalamityWorld.death || CalamityWorld.bossRushActive) ? 0.8 : 0.6); + if ((double)npc.life < (double)npc.lifeMax * healthMult) + { + npc.ai[0] = 1f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.ai[3] = 0f; + npc.netUpdate = true; + return; + } + } + else if (npc.ai[0] != 1f && npc.ai[0] != 2f && npc.ai[0] != 0f) + { + if (spazAlive) + { + if (Main.npc[fireEye].ai[0] == 1f || Main.npc[fireEye].ai[0] == 2f || Main.npc[fireEye].ai[0] == 0f) + { + npc.dontTakeDamage = true; + } + else + { + npc.dontTakeDamage = false; + } + } + else + { + npc.dontTakeDamage = false; + } npc.defense = npc.defDefense + 20; - if (npc.ai[1] == 0f) - { - npc.ai[2] += (spazAlive ? 0.25f : 0.5f); - npc.localAI[1] += (spazAlive ? 0.5f : 1f); - } - else - { - npc.ai[2] += (spazAlive ? 0.25f : 0.5f); - npc.localAI[1] += (spazAlive ? 0.5f : 1f); - } - this.newAI[0] += (spazAlive ? 1f : 2f); - if (CalamityWorld.death || CalamityWorld.bossRushActive) - { - this.newAI[0] += 1f; - } - if (this.newAI[0] >= (enraged ? 180f : 240f)) - { - this.newAI[0] = 0f; - Vector2 vector34 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num349 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector34.X; - float num350 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector34.Y; - float num351 = (float)Math.Sqrt((double)(num349 * num349 + num350 * num350)); - num349 *= num351; - num350 *= num351; - if (Main.netMode != 1) - { - float num353 = 8f; - int num354 = 29; - int num355 = mod.ProjectileType("ScavengerLaser"); - vector34 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - num349 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector34.X; - num350 = Main.player[npc.target].position.Y + (float)Main.player[npc.target].height * 0.5f - vector34.Y; - num351 = (float)Math.Sqrt((double)(num349 * num349 + num350 * num350)); - num351 = num353 / num351; - num349 *= num351; - num350 *= num351; - vector34.X += num349; - vector34.Y += num350; - Projectile.NewProjectile(vector34.X, vector34.Y, num349, num350, num355, num354, 0f, Main.myPlayer, 0f, 0f); - } - } + if (npc.ai[1] == 0f) + { + npc.ai[2] += (spazAlive ? 0.25f : 0.5f); + npc.localAI[1] += (spazAlive ? 0.5f : 1f); + } + else + { + npc.ai[2] += (spazAlive ? 0.25f : 0.5f); + npc.localAI[1] += (spazAlive ? 0.5f : 1f); + } + newAI[0] += (spazAlive ? 1f : 2f); + if (CalamityWorld.death || CalamityWorld.bossRushActive) + { + newAI[0] += 1f; + } + if (newAI[0] >= (enraged ? 180f : 240f)) + { + newAI[0] = 0f; + Vector2 vector34 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float num349 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector34.X; + float num350 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector34.Y; + float num351 = (float)Math.Sqrt((double)(num349 * num349 + num350 * num350)); + num349 *= num351; + num350 *= num351; + if (Main.netMode != 1) + { + float num353 = 8f; + int num354 = 29; + int num355 = mod.ProjectileType("ScavengerLaser"); + vector34 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + num349 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector34.X; + num350 = Main.player[npc.target].position.Y + (float)Main.player[npc.target].height * 0.5f - vector34.Y; + num351 = (float)Math.Sqrt((double)(num349 * num349 + num350 * num350)); + num351 = num353 / num351; + num349 *= num351; + num350 *= num351; + vector34.X += num349; + vector34.Y += num350; + Projectile.NewProjectile(vector34.X, vector34.Y, num349, num350, num355, num354, 0f, Main.myPlayer, 0f, 0f); + } + } } } else if (npc.type == NPCID.Spazmatism) { - fireEye = npc.whoAmI; + fireEye = npc.whoAmI; bool retAlive = false; if (NPC.CountNPCS(NPCID.Retinazer) > 0) { retAlive = true; } - if (npc.ai[0] == 0f) - { - double healthMult = ((CalamityWorld.death || CalamityWorld.bossRushActive) ? 0.8 : 0.6); - if ((double)npc.life < (double)npc.lifeMax * healthMult) - { - npc.ai[0] = 1f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] = 0f; - npc.netUpdate = true; - return; - } - } + if (npc.ai[0] == 0f) + { + double healthMult = ((CalamityWorld.death || CalamityWorld.bossRushActive) ? 0.8 : 0.6); + if ((double)npc.life < (double)npc.lifeMax * healthMult) + { + npc.ai[0] = 1f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.ai[3] = 0f; + npc.netUpdate = true; + return; + } + } else if (npc.ai[0] != 1f && npc.ai[0] != 2f && npc.ai[0] != 0f) { - if (retAlive) - { - if (Main.npc[laserEye].ai[0] == 1f || Main.npc[laserEye].ai[0] == 2f || Main.npc[laserEye].ai[0] == 0f) - { - npc.dontTakeDamage = true; - } - else - { - npc.dontTakeDamage = false; - } - } - else - { - npc.dontTakeDamage = false; - } - npc.defense = npc.defDefense + 30; - if (npc.ai[1] == 0f) + if (retAlive) { - if (!Main.player[npc.target].dead) - { - this.newAI[0] += 1f; - } - if (this.newAI[0] >= (enraged ? 20f : 30f)) - { - this.newAI[0] = 0f; - if (Collision.CanHit(npc.Center, 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) - { - Vector2 vector34 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num349 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector34.X; - float num350 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector34.Y; - float num351 = (float)Math.Sqrt((double)(num349 * num349 + num350 * num350)); - num349 *= num351; - num350 *= num351; - if (Main.netMode != 1) - { - float num418 = (enraged ? 25f : 18f); - int num419 = 30; - int num420 = 96; - num351 = (float)Math.Sqrt((double)(num349 * num349 + num350 * num350)); - num351 = num418 / num351; - num349 *= num351; - num350 *= num351; - num349 += (float)Main.rand.Next(-30, 31) * 0.05f; - num350 += (float)Main.rand.Next(-30, 31) * 0.05f; - vector34.X += num349 * 4f; - vector34.Y += num350 * 4f; - Projectile.NewProjectile(vector34.X, vector34.Y, num349, num350, num420, num419, 0f, Main.myPlayer, 0f, 0f); - } - } - } - npc.ai[2] += (retAlive ? 1.5f : 2f); + if (Main.npc[laserEye].ai[0] == 1f || Main.npc[laserEye].ai[0] == 2f || Main.npc[laserEye].ai[0] == 0f) + { + npc.dontTakeDamage = true; + } + else + { + npc.dontTakeDamage = false; + } + } + else + { + npc.dontTakeDamage = false; + } + npc.defense = npc.defDefense + 30; + if (npc.ai[1] == 0f) + { + if (!Main.player[npc.target].dead) + { + newAI[0] += 1f; + } + if (newAI[0] >= (enraged ? 20f : 30f)) + { + newAI[0] = 0f; + if (Collision.CanHit(npc.Center, 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) + { + Vector2 vector34 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float num349 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector34.X; + float num350 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector34.Y; + float num351 = (float)Math.Sqrt((double)(num349 * num349 + num350 * num350)); + num349 *= num351; + num350 *= num351; + if (Main.netMode != 1) + { + float num418 = (enraged ? 25f : 18f); + int num419 = 30; + int num420 = 96; + num351 = (float)Math.Sqrt((double)(num349 * num349 + num350 * num350)); + num351 = num418 / num351; + num349 *= num351; + num350 *= num351; + num349 += (float)Main.rand.Next(-30, 31) * 0.05f; + num350 += (float)Main.rand.Next(-30, 31) * 0.05f; + vector34.X += num349 * 4f; + vector34.Y += num350 * 4f; + Projectile.NewProjectile(vector34.X, vector34.Y, num349, num350, num420, num419, 0f, Main.myPlayer, 0f, 0f); + } + } + } + npc.ai[2] += (retAlive ? 1.5f : 2f); npc.velocity.X *= 1.005f; npc.velocity.Y *= 1.005f; - if (enraged) - { - npc.velocity.X *= 1.01f; - npc.velocity.Y *= 1.01f; - } + if (enraged) + { + npc.velocity.X *= 1.01f; + npc.velocity.Y *= 1.01f; + } } else { npc.ai[2] += (retAlive ? 0.1f : 0.5f); npc.velocity.X *= (retAlive ? 1.001f : 1.002f); npc.velocity.Y *= (retAlive ? 1.001f : 1.002f); - if (CalamityWorld.death || CalamityWorld.bossRushActive) - { - npc.velocity.X *= (retAlive ? 1.0005f : 1.001f); - npc.velocity.Y *= (retAlive ? 1.0005f : 1.001f); - } - if (enraged) - { - npc.velocity.X *= 1.003f; - npc.velocity.Y *= 1.003f; - } - } + if (CalamityWorld.death || CalamityWorld.bossRushActive) + { + npc.velocity.X *= (retAlive ? 1.0005f : 1.001f); + npc.velocity.Y *= (retAlive ? 1.0005f : 1.001f); + } + if (enraged) + { + npc.velocity.X *= 1.003f; + npc.velocity.Y *= 1.003f; + } + } } } - #endregion - #region TheDestroyer + #endregion + #region TheDestroyer else if (npc.type == NPCID.TheDestroyerBody) { + bool targetFloatingUp = Main.player[npc.target].gravDir == -1f; int defenseUp = (int)(20f * (1f - (float)npc.life / (float)npc.lifeMax)); + if (targetFloatingUp) + { + if (newAI[2] < 480f) //8 seconds + newAI[2] += 1f; + } + else + { + if (newAI[2] > 0f) + newAI[2] -= 1f; + } npc.defense = npc.defDefense + defenseUp; npc.localAI[0] = 0f; - int shootTime = (enraged ? 4 : 2); - if ((double)Main.player[npc.target].statLife > (double)Main.player[npc.target].statLifeMax2 * 0.5 || CalamityWorld.bossRushActive) + int shootTime = (enraged ? 8 : 4); + if (CalamityWorld.bossRushActive) { - shootTime += 2; + shootTime += 1; + } + if (CalamityWorld.death || CalamityWorld.bossRushActive) + { + shootTime += 1; + } + if (Main.netMode != 1) + { + newAI[0] += (float)Main.rand.Next(shootTime); + if (newAI[0] >= (float)Main.rand.Next(1400, 26000)) + { + newAI[0] = 0f; + npc.TargetClosest(true); + bool shootNoTileCollideLaser = false; + if (Main.rand.Next(3) == 0 || CalamityWorld.bossRushActive || newAI[2] > 0f) + { + shootNoTileCollideLaser = true; + } + if (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height) || + shootNoTileCollideLaser) + { + float laserSpeedBoost = System.Math.Abs(Main.player[npc.target].velocity.X); + if (System.Math.Abs(Main.player[npc.target].velocity.X) < System.Math.Abs(Main.player[npc.target].velocity.Y)) + { + laserSpeedBoost = System.Math.Abs(Main.player[npc.target].velocity.Y); + } + float speed = 2f + laserSpeedBoost; + if (speed < 7f) + { + speed = 7f; + } + if (speed > 10f) + { + speed = 10f; + } + if ((double)npc.life <= (double)npc.lifeMax * 0.7) + { + speed += 0.25f; + } + if ((double)npc.life <= (double)npc.lifeMax * 0.4 || CalamityWorld.bossRushActive) + { + speed += CalamityWorld.death ? 0.33f : 0.25f; + } + if ((double)npc.life <= (double)npc.lifeMax * 0.1 || CalamityWorld.bossRushActive) + { + speed += CalamityWorld.death ? 0.33f : 0.25f; + } + int num9 = 28; + int num10 = 100; + int value = (CalamityWorld.bossRushActive ? 3 : 4); + if (Main.rand.Next(value) == 0 || enraged) + { + int secondValue = (newAI[2] > 0f ? 3 : 5); + num10 = (Main.rand.Next(secondValue) == 0 ? mod.ProjectileType("DestroyerHomingLaser") : 257); + num9 = 31; + } + Vector2 vector = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)(npc.height / 2)); + float num6 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector.X; + float num7 = Main.player[npc.target].position.Y + (float)Main.player[npc.target].height * 0.5f - vector.Y; + float num8 = (float)Math.Sqrt((double)(num6 * num6 + num7 * num7)); + num8 = speed / num8; + num6 *= num8; + num7 *= num8; + vector.X += num6 * 5f; + vector.Y += num7 * 5f; + int num11 = Projectile.NewProjectile(vector.X, vector.Y, num6, num7, num10, num9, 0f, Main.myPlayer, 0f, 0f); + if (num10 != mod.ProjectileType("DestroyerHomingLaser")) + { + Main.projectile[num11].timeLeft = 300; + } + if (shootNoTileCollideLaser) + { + Main.projectile[num11].tileCollide = false; + } + npc.netUpdate = true; + } + } } - if (CalamityWorld.death || CalamityWorld.bossRushActive) - { - shootTime += 1; - } - if (Main.netMode != 1) - { - this.newAI[0] += (float)Main.rand.Next(shootTime); - if (this.newAI[0] >= (float)Main.rand.Next(1400, 26000)) - { - this.newAI[0] = 0f; - npc.TargetClosest(true); - bool shootNoTileCollideLaser = false; - if (Main.rand.Next(3) == 0 || CalamityWorld.bossRushActive) - { - shootNoTileCollideLaser = true; - } - if (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height) || - shootNoTileCollideLaser) - { - float laserSpeedBoost = System.Math.Abs(Main.player[npc.target].velocity.X); - if (System.Math.Abs(Main.player[npc.target].velocity.X) < System.Math.Abs(Main.player[npc.target].velocity.Y)) - { - laserSpeedBoost = System.Math.Abs(Main.player[npc.target].velocity.Y); - } - float speed = 2f + laserSpeedBoost; - if (speed < 7f) - { - speed = 7f; - } - if (speed > 10f) - { - speed = 10f; - } - if ((double)npc.life <= (double)npc.lifeMax * 0.7) - { - speed += 0.25f; - } - if ((double)npc.life <= (double)npc.lifeMax * 0.4 || CalamityWorld.bossRushActive) - { - speed += CalamityWorld.death ? 0.5f : 0.33f; - } - if ((double)npc.life <= (double)npc.lifeMax * 0.1 || CalamityWorld.bossRushActive) - { - speed += CalamityWorld.death ? 0.5f : 0.33f; - } - int num9 = 26; - int num10 = 100; - int value = (CalamityWorld.death || CalamityWorld.bossRushActive) ? 3 : 4; - if (Main.rand.Next(value) == 0 || enraged) - { - num10 = (Main.rand.Next(4) == 0 ? mod.ProjectileType("DestroyerHomingLaser") : 257); - num9 = 29; - } - Vector2 vector = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)(npc.height / 2)); - float num6 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector.X + (float)Main.rand.Next(-20, 21); - float num7 = Main.player[npc.target].position.Y + (float)Main.player[npc.target].height * 0.5f - vector.Y + (float)Main.rand.Next(-20, 21); - float num8 = (float)Math.Sqrt((double)(num6 * num6 + num7 * num7)); - num8 = speed / num8; - num6 *= num8; - num7 *= num8; - vector.X += num6 * 5f; - vector.Y += num7 * 5f; - int num11 = Projectile.NewProjectile(vector.X, vector.Y, num6, num7, num10, num9, 0f, Main.myPlayer, 0f, 0f); - if (num10 != mod.ProjectileType("DestroyerHomingLaser")) - { - Main.projectile[num11].timeLeft = 300; - } - if (shootNoTileCollideLaser) - { - Main.projectile[num11].tileCollide = false; - } - npc.netUpdate = true; - } - } - } } - #endregion - #region WallofFlesh - else if (npc.type == NPCID.WallofFlesh) + #endregion + #region WallofFlesh + else if (npc.type == NPCID.WallofFlesh) { - if (enraged) - { - npc.velocity.X *= 1.7f; - } - else if (CalamityWorld.bossRushActive) - { - npc.velocity.X *= 1.3f; - } - else if (CalamityWorld.death) - { - npc.velocity.X *= 1.18f; - } - else - { - npc.velocity.X *= 1.12f; - } - } + if (enraged) + { + npc.velocity.X *= 1.7f; + } + else if (CalamityWorld.bossRushActive) + { + npc.velocity.X *= 1.3f; + } + else if (CalamityWorld.death) + { + npc.velocity.X *= 1.18f; + } + else + { + npc.velocity.X *= 1.12f; + } + } else if (npc.type == NPCID.WallofFleshEye) { - if (NPC.CountNPCS(NPCID.WallofFlesh) > 0) - { - Vector2 vector34 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num349 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector34.X; - float num350 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector34.Y; - float num351 = (float)Math.Sqrt((double)(num349 * num349 + num350 * num350)); - num349 *= num351; - num350 *= num351; - bool flag30 = true; - if (npc.direction > 0) - { - if (Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) < npc.position.X + (float)(npc.width / 2)) - { - flag30 = false; - } - } - else if (Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) > npc.position.X + (float)(npc.width / 2)) - { - flag30 = false; - } - if (Main.netMode != 1) - { - int num352 = (enraged ? 7 : 4); - npc.localAI[1] = 0f; - npc.localAI[3] += (enraged ? 4f : 2f); - if ((double)Main.npc[Main.wof].life < (double)Main.npc[Main.wof].lifeMax * 0.75) - { - npc.localAI[3] += 1f; - num352++; - } - if ((double)Main.npc[Main.wof].life < (double)Main.npc[Main.wof].lifeMax * 0.5) - { - npc.localAI[3] += 1f; - num352++; - } - if ((double)Main.npc[Main.wof].life < (double)Main.npc[Main.wof].lifeMax * 0.25) - { - npc.localAI[3] += 1f; - num352 += 2; - } - if ((double)Main.npc[Main.wof].life < (double)Main.npc[Main.wof].lifeMax * 0.1 || CalamityWorld.bossRushActive) - { - npc.localAI[3] += 2f; - num352 += 3; - } - if (this.newAI[0] == 0f) - { - if (npc.localAI[3] > 600f) - { - this.newAI[0] = 1f; - npc.localAI[3] = 0f; - return; - } - } - else if (npc.localAI[3] > 45f && Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) - { - npc.localAI[3] = 0f; - this.newAI[0] += 1f; - if (this.newAI[0] >= (float)num352) - { - this.newAI[0] = 0f; - } - if (flag30) - { - float num353 = (enraged ? 14f : 10f); - int num354 = 18; - int num355 = 83; - if ((double)Main.npc[Main.wof].life < (double)Main.npc[Main.wof].lifeMax * 0.5) - { - num354++; - num353 += 1f; - } - if ((double)Main.npc[Main.wof].life < (double)Main.npc[Main.wof].lifeMax * 0.25) - { - num354++; - num353 += 1f; - } - if ((double)Main.npc[Main.wof].life < (double)Main.npc[Main.wof].lifeMax * 0.1 || CalamityWorld.bossRushActive) - { - num354 += 2; - num353 += 2f; - } - if (CalamityWorld.death || CalamityWorld.bossRushActive) - { - num353 += 1f; - } - vector34 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - num349 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector34.X; - num350 = Main.player[npc.target].position.Y + (float)Main.player[npc.target].height * 0.5f - vector34.Y; - num351 = (float)Math.Sqrt((double)(num349 * num349 + num350 * num350)); - num351 = num353 / num351; - num349 *= num351; - num350 *= num351; - vector34.X += num349; - vector34.Y += num350; - Projectile.NewProjectile(vector34.X, vector34.Y, num349, num350, num355, num354, 0f, Main.myPlayer, 0f, 0f); - return; - } - } - } - } + if (NPC.CountNPCS(NPCID.WallofFlesh) > 0) + { + Vector2 vector34 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float num349 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector34.X; + float num350 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector34.Y; + float num351 = (float)Math.Sqrt((double)(num349 * num349 + num350 * num350)); + num349 *= num351; + num350 *= num351; + bool flag30 = true; + if (npc.direction > 0) + { + if (Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) < npc.position.X + (float)(npc.width / 2)) + { + flag30 = false; + } + } + else if (Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) > npc.position.X + (float)(npc.width / 2)) + { + flag30 = false; + } + if (Main.netMode != 1) + { + int num352 = (enraged ? 7 : 4); + npc.localAI[1] = 0f; + npc.localAI[3] += (enraged ? 4f : 2f); + if ((double)Main.npc[Main.wof].life < (double)Main.npc[Main.wof].lifeMax * 0.75) + { + npc.localAI[3] += 1f; + num352++; + } + if ((double)Main.npc[Main.wof].life < (double)Main.npc[Main.wof].lifeMax * 0.5) + { + npc.localAI[3] += 1f; + num352++; + } + if ((double)Main.npc[Main.wof].life < (double)Main.npc[Main.wof].lifeMax * 0.25) + { + npc.localAI[3] += 1f; + num352 += 2; + } + if ((double)Main.npc[Main.wof].life < (double)Main.npc[Main.wof].lifeMax * 0.1 || CalamityWorld.bossRushActive) + { + npc.localAI[3] += 2f; + num352 += 3; + } + if (newAI[0] == 0f) + { + if (npc.localAI[3] > 600f) + { + newAI[0] = 1f; + npc.localAI[3] = 0f; + return; + } + } + else if (npc.localAI[3] > 45f && Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) + { + npc.localAI[3] = 0f; + newAI[0] += 1f; + if (newAI[0] >= (float)num352) + { + newAI[0] = 0f; + } + if (flag30) + { + float num353 = (enraged ? 14f : 10f); + int num354 = 18; + int num355 = 83; + if ((double)Main.npc[Main.wof].life < (double)Main.npc[Main.wof].lifeMax * 0.5) + { + num354++; + num353 += 1f; + } + if ((double)Main.npc[Main.wof].life < (double)Main.npc[Main.wof].lifeMax * 0.25) + { + num354++; + num353 += 1f; + } + if ((double)Main.npc[Main.wof].life < (double)Main.npc[Main.wof].lifeMax * 0.1 || CalamityWorld.bossRushActive) + { + num354 += 2; + num353 += 2f; + } + if (CalamityWorld.death || CalamityWorld.bossRushActive) + { + num353 += 1f; + } + vector34 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + num349 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector34.X; + num350 = Main.player[npc.target].position.Y + (float)Main.player[npc.target].height * 0.5f - vector34.Y; + num351 = (float)Math.Sqrt((double)(num349 * num349 + num350 * num350)); + num351 = num353 / num351; + num349 *= num351; + num350 *= num351; + vector34.X += num349; + vector34.Y += num350; + Projectile.NewProjectile(vector34.X, vector34.Y, num349, num350, num355, num354, 0f, Main.myPlayer, 0f, 0f); + return; + } + } + } + } } - #endregion - #region Skeletron - else if (npc.type == NPCID.SkeletronHand) + #endregion + #region Skeletron + else if (npc.type == NPCID.SkeletronHand) { if (npc.ai[2] == 0f || npc.ai[2] == 3f) { if (Main.npc[(int)npc.ai[1]].ai[1] == 0f) { npc.ai[3] += (enraged ? 1.5f : 0.5f); - if (CalamityWorld.death || CalamityWorld.bossRushActive) - { - npc.ai[3] += 1f; - } - } + if (CalamityWorld.death || CalamityWorld.bossRushActive) + { + npc.ai[3] += 1f; + } + } } } - else if (npc.type == NPCID.SkeletronHead) + else if (npc.type == NPCID.SkeletronHead) { if (npc.ai[1] == 1f) { if (Main.netMode != 1) - { + { npc.localAI[1] += (enraged ? 6f : 3f); if ((double)npc.life <= (double)npc.lifeMax * 0.5 || CalamityWorld.bossRushActive) { @@ -6904,11 +7046,11 @@ namespace CalamityMod.NPCs { npc.localAI[1] += 3f; } - if (CalamityWorld.death || CalamityWorld.bossRushActive) - { - npc.localAI[1] += 3f; - } - if (npc.localAI[1] >= 500f) + if (CalamityWorld.death || CalamityWorld.bossRushActive) + { + npc.localAI[1] += 3f; + } + if (npc.localAI[1] >= 500f) { npc.localAI[1] = 0f; Vector2 vector16 = npc.Center; @@ -6940,7 +7082,7 @@ namespace CalamityMod.NPCs float num174 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector20.Y; float num175 = (float)Math.Sqrt((double)(num173 * num173 + num174 * num174)); float num176 = CalamityWorld.bossRushActive ? 10f : 5f; - if (enraged) { num176 += 3f; } + if (enraged) { num176 += 3f; } if (num175 > 150f) { num176 *= 1.05f; @@ -6986,66 +7128,66 @@ namespace CalamityMod.NPCs npc.velocity.Y = num174 * num175; } } - #endregion - #region QueenBee - else if (npc.type == NPCID.QueenBee) + #endregion + #region QueenBee + else if (npc.type == NPCID.QueenBee) { Vector2 vector74 = new Vector2(npc.position.X + (float)(npc.width / 2) + (float)(Main.rand.Next(20) * npc.direction), npc.position.Y + (float)npc.height * 0.8f); if (npc.ai[0] == 1f) { npc.ai[1] += 1f; - } + } else if (npc.ai[0] == 3f) { - this.newAI[0] += 1f; + newAI[0] += 1f; bool flag39 = false; - if (CalamityWorld.death) - { - if (this.newAI[0] % 10f == 9f) - { - flag39 = true; - } - } - else if ((double)npc.life < (double)npc.lifeMax * 0.1) + if (CalamityWorld.death) { - if (this.newAI[0] % 20f == 19f) + if (newAI[0] % 10f == 9f) { flag39 = true; } - } - else if (npc.life < npc.lifeMax / 3) + } + else if ((double)npc.life < (double)npc.lifeMax * 0.1) { - if (this.newAI[0] % 35f == 34f) + if (newAI[0] % 20f == 19f) { flag39 = true; } - } - else if (npc.life < npc.lifeMax / 2) + } + else if (npc.life < npc.lifeMax / 3) { - if (this.newAI[0] % 50f == 49f) + if (newAI[0] % 35f == 34f) { flag39 = true; } - } - else if (this.newAI[0] % 55f == 54f) + } + else if (npc.life < npc.lifeMax / 2) + { + if (newAI[0] % 50f == 49f) + { + flag39 = true; + } + } + else if (newAI[0] % 55f == 54f) { flag39 = true; } - if (flag39 && npc.position.Y + (float)npc.height < Main.player[npc.target].position.Y && Collision.CanHit(vector74, 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) + if (flag39 && npc.position.Y + (float)npc.height < Main.player[npc.target].position.Y && Collision.CanHit(vector74, 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) { Main.PlaySound(SoundID.Item17, npc.position); - if (Main.netMode != 1) + if (Main.netMode != 1) { float num602 = 13f; - if ((double)npc.life < (double)npc.lifeMax * 0.1) + if ((double)npc.life < (double)npc.lifeMax * 0.1) { num602 += 3f; } - if (CalamityWorld.death) - { - num602 += 2f; - } - float num603 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector74.X + (float)Main.rand.Next(-80, 81); + if (CalamityWorld.death) + { + num602 += 2f; + } + float num603 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector74.X + (float)Main.rand.Next(-80, 81); float num604 = Main.player[npc.target].position.Y + (float)Main.player[npc.target].height * 0.5f - vector74.Y + (float)Main.rand.Next(-40, 41); float num605 = (float)Math.Sqrt((double)(num603 * num603 + num604 * num604)); num605 = num602 / num605; @@ -7059,78 +7201,78 @@ namespace CalamityMod.NPCs } } } - #endregion - #region BrainofCthulhu - else if (npc.type == NPCID.BrainofCthulhu) + #endregion + #region BrainofCthulhu + else if (npc.type == NPCID.BrainofCthulhu) { - if (CalamityWorld.death) - { - if (npc.ai[0] < 0f) - { - this.newAI[0] += 1f; - if (this.newAI[0] >= 480f) - { - this.newAI[0] = 0f; - if (Main.netMode != 1 && NPC.CountNPCS(NPCID.Creeper) < 15) - { - int creeper = NPC.NewNPC((int)(npc.position.X + (float)(npc.width / 2) + npc.velocity.X), (int)(npc.position.Y + (float)(npc.height / 2) + npc.velocity.Y), 267, 0, 0f, 0f, 0f, 0f, 255); - Main.npc[creeper].netUpdate = true; - } - npc.netUpdate = true; - } - } - } - else - { - this.newAI[0] += 1f; - if (this.newAI[0] >= 600f) - { - this.newAI[0] = 0f; - if (Main.netMode != 1 && NPC.CountNPCS(NPCID.Creeper) < 10) - { - int creeper = NPC.NewNPC((int)(npc.position.X + (float)(npc.width / 2) + npc.velocity.X), (int)(npc.position.Y + (float)(npc.height / 2) + npc.velocity.Y), 267, 0, 0f, 0f, 0f, 0f, 255); - Main.npc[creeper].netUpdate = true; - } - npc.netUpdate = true; - } - } - if (npc.ai[0] < 0f) + if (CalamityWorld.death) + { + if (npc.ai[0] < 0f) + { + newAI[0] += 1f; + if (newAI[0] >= 480f) + { + newAI[0] = 0f; + if (Main.netMode != 1 && NPC.CountNPCS(NPCID.Creeper) < 15) + { + int creeper = NPC.NewNPC((int)(npc.position.X + (float)(npc.width / 2) + npc.velocity.X), (int)(npc.position.Y + (float)(npc.height / 2) + npc.velocity.Y), 267, 0, 0f, 0f, 0f, 0f, 255); + Main.npc[creeper].netUpdate = true; + } + npc.netUpdate = true; + } + } + } + else + { + newAI[0] += 1f; + if (newAI[0] >= 600f) + { + newAI[0] = 0f; + if (Main.netMode != 1 && NPC.CountNPCS(NPCID.Creeper) < 10) + { + int creeper = NPC.NewNPC((int)(npc.position.X + (float)(npc.width / 2) + npc.velocity.X), (int)(npc.position.Y + (float)(npc.height / 2) + npc.velocity.Y), 267, 0, 0f, 0f, 0f, 0f, 255); + Main.npc[creeper].netUpdate = true; + } + npc.netUpdate = true; + } + } + if (npc.ai[0] < 0f) { npc.knockBackResist = (CalamityWorld.death ? 0.05f : 0.1f) * Main.expertKnockBack; npc.velocity.X *= 1.006f; npc.velocity.Y *= 1.006f; - if (CalamityWorld.death) - { - npc.velocity.X *= 1.003f; - npc.velocity.Y *= 1.003f; - } - } + if (CalamityWorld.death) + { + npc.velocity.X *= 1.003f; + npc.velocity.Y *= 1.003f; + } + } } - else if (npc.type == NPCID.Creeper) - { - if (npc.ai[0] != 0f) - { - Vector2 value = Main.player[npc.target].Center - npc.Center; - value.Normalize(); - value *= 9f; - npc.velocity = (npc.velocity * 99f + value) / 98f; //100 - } - } - #endregion - #region EaterofWorlds - else if (npc.type == NPCID.EaterofWorldsHead && !CalamityWorld.bossRushActive) + else if (npc.type == NPCID.Creeper) { - if (!Main.player[npc.target].dead) + if (npc.ai[0] != 0f) { - this.newAI[0] += 1f; - if (CalamityWorld.death) - { - this.newAI[0] += 2f; - } - } - if (this.newAI[0] >= 180f) + Vector2 value = Main.player[npc.target].Center - npc.Center; + value.Normalize(); + value *= 9f; + npc.velocity = (npc.velocity * 99f + value) / 98f; //100 + } + } + #endregion + #region EaterofWorlds + else if (npc.type == NPCID.EaterofWorldsHead && !CalamityWorld.bossRushActive) + { + if (!Main.player[npc.target].dead) { - this.newAI[0] = 0f; + newAI[0] += 1f; + if (CalamityWorld.death) + { + newAI[0] += 2f; + } + } + if (newAI[0] >= 180f) + { + newAI[0] = 0f; if (Collision.CanHit(npc.Center, 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) { Vector2 vector34 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); @@ -7157,89 +7299,94 @@ namespace CalamityMod.NPCs } } } - #endregion - #region KingSlime - else if (npc.type == NPCID.KingSlime) + #endregion + #region KingSlime + else if (npc.type == NPCID.KingSlime) { bool move = false; if (npc.ai[1] == 5f) { move = true; npc.ai[0] += 3f; - if (CalamityWorld.death) - { - npc.ai[0] += 2f; - } + if (CalamityWorld.death) + { + npc.ai[0] += 2f; + } } else if (npc.ai[1] == 6f) { move = true; npc.ai[0] += 3f; - if (CalamityWorld.death) - { - npc.ai[0] += 2f; - } - } + if (CalamityWorld.death) + { + npc.ai[0] += 2f; + } + } if (npc.velocity.Y == 0f) { if (!move) { npc.ai[0] += 4f; - if (CalamityWorld.death) - { - npc.ai[0] += 4f; - } - } + if (CalamityWorld.death) + { + npc.ai[0] += 4f; + } + } } } - #endregion - } - #endregion - } - #endregion + #endregion + } + #endregion + } + #endregion - #region PostAI - public override void PostAI(NPC npc) - { - if (silvaStun && !CalamityWorld.bossRushActive) - { - npc.velocity.X = 0f; - npc.velocity.Y = 0f; - } - } - #endregion - - #region OnHitPlayer - public override void OnHitPlayer(NPC npc, Player target, int damage, bool crit) + #region PostAI + public override void PostAI(NPC npc) { - if (target.GetModPlayer(mod).snowman) - { - if (npc.type == NPCID.Demon || npc.type == NPCID.VoodooDemon || npc.type == NPCID.RedDevil) - { - target.AddBuff(mod.BuffType("PopoNoseless"), 36000); - } - } - if (npc.type == NPCID.GolemHead) - { - target.AddBuff(mod.BuffType("ArmorCrunch"), 300); - } - else if (npc.type == NPCID.GolemHeadFree) - { - target.AddBuff(mod.BuffType("ArmorCrunch"), 300); - } - else if (npc.type == NPCID.Golem) - { - target.AddBuff(mod.BuffType("ArmorCrunch"), 300); - } - else if (npc.type == NPCID.GolemFistRight) - { - target.AddBuff(mod.BuffType("ArmorCrunch"), 300); - } - else if (npc.type == NPCID.GolemFistLeft) - { - target.AddBuff(mod.BuffType("ArmorCrunch"), 300); - } - if (CalamityWorld.revenge) + if (pearlAura && !CalamityPlayer.areThereAnyDamnBosses) + { + npc.velocity.X *= 0.75f; + npc.velocity.Y *= 0.75f; + } + if (silvaStun && !CalamityWorld.bossRushActive) + { + npc.velocity.X = 0f; + npc.velocity.Y = 0f; + } + } + #endregion + + #region OnHitPlayer + public override void OnHitPlayer(NPC npc, Player target, int damage, bool crit) + { + if (target.GetModPlayer(mod).snowman) + { + if (npc.type == NPCID.Demon || npc.type == NPCID.VoodooDemon || npc.type == NPCID.RedDevil) + { + target.AddBuff(mod.BuffType("PopoNoseless"), 36000); + } + } + if (npc.type == NPCID.GolemHead) + { + target.AddBuff(mod.BuffType("ArmorCrunch"), 300); + } + else if (npc.type == NPCID.GolemHeadFree) + { + target.AddBuff(mod.BuffType("ArmorCrunch"), 300); + } + else if (npc.type == NPCID.Golem) + { + target.AddBuff(mod.BuffType("ArmorCrunch"), 300); + } + else if (npc.type == NPCID.GolemFistRight) + { + target.AddBuff(mod.BuffType("ArmorCrunch"), 300); + } + else if (npc.type == NPCID.GolemFistLeft) + { + target.AddBuff(mod.BuffType("ArmorCrunch"), 300); + } + if (CalamityWorld.revenge) { if (npc.type == NPCID.DemonEye) { @@ -7718,141 +7865,143 @@ namespace CalamityMod.NPCs } } } - #endregion + #endregion - #region ModifyHitByProjectile - public override void ModifyHitByProjectile(NPC npc, Projectile projectile, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) - { - if (npc.type == NPCID.TheDestroyerBody || npc.type == mod.NPCType("AquaticScourgeBody") || npc.type == mod.NPCType("AquaticScourgeBodyAlt")) - { - if (projectile.type == 239 || projectile.type == 245 || projectile.type == mod.ProjectileType("Shaderain") || projectile.aiStyle == 4 || - projectile.type == 522) - damage = (int)((double)damage * 0.65); - } - if (Main.player[projectile.owner].GetModPlayer(mod).eGauntlet) - { - if (projectile.melee && npc.damage > 0 && !npc.boss && !npc.friendly && !npc.dontTakeDamage && Main.rand.Next(15) == 0 && npc.type != 477 && - npc.type != 327 && npc.type != 135 && npc.type != 136 && npc.type != 325 && npc.type != 344 && npc.type != 346 && npc.type != 345 && - npc.type != mod.NPCType("Reaper") && npc.type != mod.NPCType("Mauler") && npc.type != mod.NPCType("EidolonWyrmHead") && - npc.type != mod.NPCType("EidolonWyrmHeadHuge") && npc.type != mod.NPCType("ColossalSquid")) - { - if (!CalamityPlayer.areThereAnyDamnBosses) - damage = npc.lifeMax * 5; - } - } - if (Main.player[projectile.owner].GetModPlayer(mod).eTalisman) - { - if (projectile.magic && npc.damage > 0 && !npc.boss && !npc.friendly && !npc.dontTakeDamage && Main.rand.Next(15) == 0 && npc.type != 477 && - npc.type != 327 && npc.type != 135 && npc.type != 136 && npc.type != 325 && npc.type != 344 && npc.type != 346 && npc.type != 345 && - npc.type != mod.NPCType("Reaper") && npc.type != mod.NPCType("Mauler") && npc.type != mod.NPCType("EidolonWyrmHead") && - npc.type != mod.NPCType("EidolonWyrmHeadHuge") && npc.type != mod.NPCType("ColossalSquid")) - { - if (!CalamityPlayer.areThereAnyDamnBosses) - damage = npc.lifeMax * 5; - } - } - if (Main.player[projectile.owner].GetModPlayer(mod).nanotech) - { - if (CalamityMod.throwingProjectileList.Contains(projectile.type) && !projectile.melee && - npc.damage > 0 && !npc.boss && !npc.friendly && !npc.dontTakeDamage && Main.rand.Next(15) == 0 && npc.type != 477 && - npc.type != 327 && npc.type != 135 && npc.type != 136 && npc.type != 325 && npc.type != 344 && npc.type != 346 && npc.type != 345 && - npc.type != mod.NPCType("Reaper") && npc.type != mod.NPCType("Mauler") && npc.type != mod.NPCType("EidolonWyrmHead") && - npc.type != mod.NPCType("EidolonWyrmHeadHuge") && npc.type != mod.NPCType("ColossalSquid")) - { - if (!CalamityPlayer.areThereAnyDamnBosses) - damage = npc.lifeMax * 5; - } - } - if (Main.player[projectile.owner].GetModPlayer(mod).eQuiver) - { - if (projectile.ranged && npc.damage > 0 && !npc.boss && !npc.friendly && !npc.dontTakeDamage && Main.rand.Next(15) == 0 && npc.type != 477 && - npc.type != 327 && npc.type != 135 && npc.type != 136 && npc.type != 325 && npc.type != 344 && npc.type != 346 && npc.type != 345 && - npc.type != mod.NPCType("Reaper") && npc.type != mod.NPCType("Mauler") && npc.type != mod.NPCType("EidolonWyrmHead") && - npc.type != mod.NPCType("EidolonWyrmHeadHuge") && npc.type != mod.NPCType("ColossalSquid")) - { - if (!CalamityPlayer.areThereAnyDamnBosses) - damage = npc.lifeMax * 5; - } - } - if (Main.player[projectile.owner].GetModPlayer(mod).statisBeltOfCurses) - { - if ((projectile.minion || CalamityMod.projectileMinionList.Contains(projectile.type)) && npc.damage > 0 && !npc.boss && !npc.friendly && !npc.dontTakeDamage && - Main.rand.Next(15) == 0 && npc.type != 477 && npc.type != 327 && npc.type != 135 && npc.type != 136 && npc.type != 325 && - npc.type != 344 && npc.type != 346 && npc.type != 345 && npc.type != mod.NPCType("Reaper") && npc.type != mod.NPCType("Mauler") && - npc.type != mod.NPCType("EidolonWyrmHead") && npc.type != mod.NPCType("EidolonWyrmHeadHuge") && npc.type != mod.NPCType("ColossalSquid")) - { - if (!CalamityPlayer.areThereAnyDamnBosses) - damage = npc.lifeMax * 5; - } - } - } - #endregion + #region ModifyHitByProjectile + public override void ModifyHitByProjectile(NPC npc, Projectile projectile, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) + { + if (npc.type == NPCID.TheDestroyerBody || npc.type == mod.NPCType("AquaticScourgeBody") || npc.type == mod.NPCType("AquaticScourgeBodyAlt")) + { + if (projectile.type == ProjectileID.RainFriendly || projectile.type == ProjectileID.BloodRain || + projectile.type == mod.ProjectileType("Shaderain") || projectile.aiStyle == 4 || + projectile.type == ProjectileID.CrystalPulse2 || projectile.type == ProjectileID.HallowStar || + projectile.type == mod.ProjectileType("FossilShardThrown")) + damage = (int)((double)damage * 0.65); + } + if (Main.player[projectile.owner].GetModPlayer(mod).eGauntlet) + { + if (projectile.melee && npc.damage > 0 && !npc.boss && !npc.friendly && !npc.dontTakeDamage && Main.rand.Next(15) == 0 && npc.type != 477 && + npc.type != 327 && npc.type != 135 && npc.type != 136 && npc.type != 325 && npc.type != 344 && npc.type != 346 && npc.type != 345 && + npc.type != mod.NPCType("Reaper") && npc.type != mod.NPCType("Mauler") && npc.type != mod.NPCType("EidolonWyrmHead") && + npc.type != mod.NPCType("EidolonWyrmHeadHuge") && npc.type != mod.NPCType("ColossalSquid") && npc.type != NPCID.DD2Betsy) + { + if (!CalamityPlayer.areThereAnyDamnBosses) + damage = npc.lifeMax * 5; + } + } + if (Main.player[projectile.owner].GetModPlayer(mod).eTalisman) + { + if (projectile.magic && npc.damage > 0 && !npc.boss && !npc.friendly && !npc.dontTakeDamage && Main.rand.Next(15) == 0 && npc.type != 477 && + npc.type != 327 && npc.type != 135 && npc.type != 136 && npc.type != 325 && npc.type != 344 && npc.type != 346 && npc.type != 345 && + npc.type != mod.NPCType("Reaper") && npc.type != mod.NPCType("Mauler") && npc.type != mod.NPCType("EidolonWyrmHead") && + npc.type != mod.NPCType("EidolonWyrmHeadHuge") && npc.type != mod.NPCType("ColossalSquid") && npc.type != NPCID.DD2Betsy) + { + if (!CalamityPlayer.areThereAnyDamnBosses) + damage = npc.lifeMax * 5; + } + } + if (Main.player[projectile.owner].GetModPlayer(mod).nanotech) + { + if (projectile.GetGlobalProjectile(mod).rogue && + npc.damage > 0 && !npc.boss && !npc.friendly && !npc.dontTakeDamage && Main.rand.Next(15) == 0 && npc.type != 477 && + npc.type != 327 && npc.type != 135 && npc.type != 136 && npc.type != 325 && npc.type != 344 && npc.type != 346 && npc.type != 345 && + npc.type != mod.NPCType("Reaper") && npc.type != mod.NPCType("Mauler") && npc.type != mod.NPCType("EidolonWyrmHead") && + npc.type != mod.NPCType("EidolonWyrmHeadHuge") && npc.type != mod.NPCType("ColossalSquid") && npc.type != NPCID.DD2Betsy) + { + if (!CalamityPlayer.areThereAnyDamnBosses) + damage = npc.lifeMax * 5; + } + } + if (Main.player[projectile.owner].GetModPlayer(mod).eQuiver) + { + if (projectile.ranged && npc.damage > 0 && !npc.boss && !npc.friendly && !npc.dontTakeDamage && Main.rand.Next(15) == 0 && npc.type != 477 && + npc.type != 327 && npc.type != 135 && npc.type != 136 && npc.type != 325 && npc.type != 344 && npc.type != 346 && npc.type != 345 && + npc.type != mod.NPCType("Reaper") && npc.type != mod.NPCType("Mauler") && npc.type != mod.NPCType("EidolonWyrmHead") && + npc.type != mod.NPCType("EidolonWyrmHeadHuge") && npc.type != mod.NPCType("ColossalSquid") && npc.type != NPCID.DD2Betsy) + { + if (!CalamityPlayer.areThereAnyDamnBosses) + damage = npc.lifeMax * 5; + } + } + if (Main.player[projectile.owner].GetModPlayer(mod).statisBeltOfCurses) + { + if ((projectile.minion || CalamityMod.projectileMinionList.Contains(projectile.type)) && npc.damage > 0 && !npc.boss && !npc.friendly && !npc.dontTakeDamage && + Main.rand.Next(15) == 0 && npc.type != 477 && npc.type != 327 && npc.type != 135 && npc.type != 136 && npc.type != 325 && + npc.type != 344 && npc.type != 346 && npc.type != 345 && npc.type != mod.NPCType("Reaper") && npc.type != mod.NPCType("Mauler") && + npc.type != mod.NPCType("EidolonWyrmHead") && npc.type != mod.NPCType("EidolonWyrmHeadHuge") && npc.type != mod.NPCType("ColossalSquid") && npc.type != NPCID.DD2Betsy) + { + if (!CalamityPlayer.areThereAnyDamnBosses) + damage = npc.lifeMax * 5; + } + } + } + #endregion - #region OnHitByItem - public override void OnHitByItem(NPC npc, Player player, Item item, int damage, float knockback, bool crit) + #region OnHitByItem + public override void OnHitByItem(NPC npc, Player player, Item item, int damage, float knockback, bool crit) { if (player.GetModPlayer(mod).bloodflareSet) - { - if (!npc.SpawnedFromStatue && npc.damage > 0 && ((double)npc.life < (double)npc.lifeMax * 0.5) && - player.GetModPlayer(mod).bloodflareHeartTimer <= 0) - { - player.GetModPlayer(mod).bloodflareHeartTimer = 180; - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 58, 1, false, 0, false, false); - } - else if (!npc.SpawnedFromStatue && npc.damage > 0 && ((double)npc.life > (double)npc.lifeMax * 0.5) && - player.GetModPlayer(mod).bloodflareManaTimer <= 0) - { - player.GetModPlayer(mod).bloodflareManaTimer = 180; - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 184, 1, false, 0, false, false); - } - } - } - #endregion - - #region OnHitByProjectile - public override void OnHitByProjectile(NPC npc, Projectile projectile, int damage, float knockback, bool crit) - { - if (Main.player[projectile.owner].GetModPlayer(mod).sGenerator) - { - if (projectile.minion && npc.damage > 0) - { - switch (Main.rand.Next(3)) - { - case 0: Main.player[projectile.owner].AddBuff(mod.BuffType("SpiritGeneratorAtkBuff"), 120); break; - case 1: Main.player[projectile.owner].AddBuff(mod.BuffType("SpiritGeneratorRegenBuff"), 120); break; - case 2: Main.player[projectile.owner].AddBuff(mod.BuffType("SpiritGeneratorDefBuff"), 120); break; - } - } - } - if (Main.player[projectile.owner].GetModPlayer(mod).bloodflareSet) { if (!npc.SpawnedFromStatue && npc.damage > 0 && ((double)npc.life < (double)npc.lifeMax * 0.5) && - Main.player[projectile.owner].GetModPlayer(mod).bloodflareHeartTimer <= 0) + player.GetModPlayer(mod).bloodflareHeartTimer <= 0) { - Main.player[projectile.owner].GetModPlayer(mod).bloodflareHeartTimer = 180; - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 58, 1, false, 0, false, false); + player.GetModPlayer(mod).bloodflareHeartTimer = 180; + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 58, 1, false, 0, false, false); } else if (!npc.SpawnedFromStatue && npc.damage > 0 && ((double)npc.life > (double)npc.lifeMax * 0.5) && - Main.player[projectile.owner].GetModPlayer(mod).bloodflareManaTimer <= 0) + player.GetModPlayer(mod).bloodflareManaTimer <= 0) { - Main.player[projectile.owner].GetModPlayer(mod).bloodflareManaTimer = 180; - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 184, 1, false, 0, false, false); + player.GetModPlayer(mod).bloodflareManaTimer = 180; + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 184, 1, false, 0, false, false); } } } - #endregion + #endregion - #region CheckDead - public override bool CheckDead(NPC npc) + #region OnHitByProjectile + public override void OnHitByProjectile(NPC npc, Projectile projectile, int damage, float knockback, bool crit) { - if (npc.lifeMax > 1000 && npc.type != 288 && - npc.type != mod.NPCType("PhantomSpirit") && - npc.type != mod.NPCType("PhantomSpiritS") && - npc.type != mod.NPCType("PhantomSpiritM") && - npc.type != mod.NPCType("PhantomSpiritL") && - npc.value > 0f && npc.HasPlayerTarget && - NPC.downedMoonlord && - Main.player[npc.target].ZoneDungeon) + if (Main.player[projectile.owner].GetModPlayer(mod).sGenerator) + { + if (projectile.minion && npc.damage > 0) + { + switch (Main.rand.Next(3)) + { + case 0: Main.player[projectile.owner].AddBuff(mod.BuffType("SpiritGeneratorAtkBuff"), 120); break; + case 1: Main.player[projectile.owner].AddBuff(mod.BuffType("SpiritGeneratorRegenBuff"), 120); break; + case 2: Main.player[projectile.owner].AddBuff(mod.BuffType("SpiritGeneratorDefBuff"), 120); break; + } + } + } + if (Main.player[projectile.owner].GetModPlayer(mod).bloodflareSet) + { + if (!npc.SpawnedFromStatue && npc.damage > 0 && ((double)npc.life < (double)npc.lifeMax * 0.5) && + Main.player[projectile.owner].GetModPlayer(mod).bloodflareHeartTimer <= 0) + { + Main.player[projectile.owner].GetModPlayer(mod).bloodflareHeartTimer = 180; + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 58, 1, false, 0, false, false); + } + else if (!npc.SpawnedFromStatue && npc.damage > 0 && ((double)npc.life > (double)npc.lifeMax * 0.5) && + Main.player[projectile.owner].GetModPlayer(mod).bloodflareManaTimer <= 0) + { + Main.player[projectile.owner].GetModPlayer(mod).bloodflareManaTimer = 180; + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 184, 1, false, 0, false, false); + } + } + } + #endregion + + #region CheckDead + public override bool CheckDead(NPC npc) + { + if (npc.lifeMax > 1000 && npc.type != 288 && + npc.type != mod.NPCType("PhantomSpirit") && + npc.type != mod.NPCType("PhantomSpiritS") && + npc.type != mod.NPCType("PhantomSpiritM") && + npc.type != mod.NPCType("PhantomSpiritL") && + npc.value > 0f && npc.HasPlayerTarget && + NPC.downedMoonlord && + Main.player[npc.target].ZoneDungeon) { int maxValue = 6; if (Main.expertMode) @@ -7861,1595 +8010,1612 @@ namespace CalamityMod.NPCs } if (Main.rand.Next(maxValue) == 0 && Main.wallDungeon[(int)Main.tile[(int)npc.Center.X / 16, (int)npc.Center.Y / 16].wall]) { - int randomType = Main.rand.Next(4); - if (randomType == 0) - { - randomType = mod.NPCType("PhantomSpirit"); - } - else if (randomType == 1) - { - randomType = mod.NPCType("PhantomSpiritS"); - } - else if (randomType == 2) - { - randomType = mod.NPCType("PhantomSpiritM"); - } - else - { - randomType = mod.NPCType("PhantomSpiritL"); - } + int randomType = Main.rand.Next(4); + if (randomType == 0) + { + randomType = mod.NPCType("PhantomSpirit"); + } + else if (randomType == 1) + { + randomType = mod.NPCType("PhantomSpiritS"); + } + else if (randomType == 2) + { + randomType = mod.NPCType("PhantomSpiritM"); + } + else + { + randomType = mod.NPCType("PhantomSpiritL"); + } NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, randomType, 0, 0f, 0f, 0f, 0f, 255); } } return true; } - #endregion + #endregion - #region PreNPCLoot - public override bool PreNPCLoot(NPC npc) - { - #region BossRush - if (CalamityWorld.bossRushActive) - { - if (npc.type == mod.NPCType("ProfanedGuardianBoss")) - { - CalamityWorld.bossRushStage = 7; - DespawnProj(); - } - else if (npc.type == NPCID.EaterofWorldsHead || npc.type == NPCID.EaterofWorldsBody || npc.type == NPCID.EaterofWorldsTail) - { - if (npc.boss) - { - CalamityWorld.bossRushStage = 8; - DespawnProj(); - } - } - else if (npc.type == mod.NPCType("Astrageldon")) - { - CalamityWorld.bossRushStage = 9; - DespawnProj(); - } - else if (npc.type == mod.NPCType("Bumblefuck")) - { - CalamityWorld.bossRushStage = 12; - DespawnProj(); - } - else if (npc.type == mod.NPCType("HiveMindP2")) - { - CalamityWorld.bossRushStage = 14; - DespawnProj(); - } - else if (npc.type == mod.NPCType("StormWeaverHeadNaked")) - { - CalamityWorld.bossRushStage = 16; - DespawnProj(); - } - else if (npc.type == mod.NPCType("AquaticScourgeHead")) - { - CalamityWorld.bossRushStage = 17; - DespawnProj(); - } - else if (npc.type == mod.NPCType("DesertScourgeHead")) - { - CalamityWorld.bossRushStage = 18; - DespawnProj(); - } - else if (npc.type == mod.NPCType("CrabulonIdle")) - { - CalamityWorld.bossRushStage = 20; - DespawnProj(); - } - else if (npc.type == mod.NPCType("CeaselessVoid")) - { - CalamityWorld.bossRushStage = 22; - DespawnProj(); - } - else if (npc.type == mod.NPCType("PerforatorHive")) - { - CalamityWorld.bossRushStage = 23; - DespawnProj(); - } - else if (npc.type == mod.NPCType("Cryogen")) - { - CalamityWorld.bossRushStage = 24; - DespawnProj(); - } - else if (npc.type == mod.NPCType("BrimstoneElemental")) - { - CalamityWorld.bossRushStage = 25; - DespawnProj(); - } - else if (npc.type == mod.NPCType("CosmicWraith")) - { - CalamityWorld.bossRushStage = 26; - DespawnProj(); - string key = "Mods.CalamityMod.BossRushTierThreeEndText"; - Color messageColor = Color.LightCoral; - if (Main.netMode == 0) - { - Main.NewText(Language.GetTextValue(key), messageColor); - } - else if (Main.netMode == 2) - { - NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); - } - } - else if (npc.type == mod.NPCType("ScavengerBody")) - { - CalamityWorld.bossRushStage = 27; - DespawnProj(); - } - else if (npc.type == mod.NPCType("AstrumDeusHeadSpectral")) - { - CalamityWorld.bossRushStage = 30; - DespawnProj(); - } - else if (npc.type == mod.NPCType("Polterghast")) - { - CalamityWorld.bossRushStage = 31; - DespawnProj(); - } - else if (npc.type == mod.NPCType("PlaguebringerGoliath")) - { - CalamityWorld.bossRushStage = 32; - DespawnProj(); - } - else if (npc.type == mod.NPCType("CalamitasRun3")) - { - CalamityWorld.bossRushStage = 33; - DespawnProj(); - string key = "Mods.CalamityMod.BossRushTierFourEndText"; - Color messageColor = Color.LightCoral; - if (Main.netMode == 0) - { - Main.NewText(Language.GetTextValue(key), messageColor); - } - else if (Main.netMode == 2) - { - NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); - } - } - else if (npc.type == mod.NPCType("Siren") || npc.type == mod.NPCType("Leviathan")) - { - int bossType = (npc.type == mod.NPCType("Siren")) ? mod.NPCType("Leviathan") : mod.NPCType("Siren"); - if (!NPC.AnyNPCs(bossType)) - { - CalamityWorld.bossRushStage = 34; - DespawnProj(); - } - } - else if (npc.type == mod.NPCType("SlimeGodCore") || npc.type == mod.NPCType("SlimeGodSplit") || npc.type == mod.NPCType("SlimeGodRunSplit")) - { - if (npc.type == mod.NPCType("SlimeGodCore") && !NPC.AnyNPCs(mod.NPCType("SlimeGodSplit")) && !NPC.AnyNPCs(mod.NPCType("SlimeGodRunSplit")) - && !NPC.AnyNPCs(mod.NPCType("SlimeGod")) && !NPC.AnyNPCs(mod.NPCType("SlimeGodRun"))) - { - CalamityWorld.bossRushStage = 35; - DespawnProj(); - } - else if (npc.type == mod.NPCType("SlimeGodSplit") && !NPC.AnyNPCs(mod.NPCType("SlimeGodCore")) && !NPC.AnyNPCs(mod.NPCType("SlimeGodRunSplit")) && - NPC.CountNPCS(mod.NPCType("SlimeGodSplit")) < 2 && !NPC.AnyNPCs(mod.NPCType("SlimeGodRun"))) - { - CalamityWorld.bossRushStage = 35; - DespawnProj(); - } - else if (npc.type == mod.NPCType("SlimeGodRunSplit") && !NPC.AnyNPCs(mod.NPCType("SlimeGodCore")) && !NPC.AnyNPCs(mod.NPCType("SlimeGodSplit")) && - NPC.CountNPCS(mod.NPCType("SlimeGodRunSplit")) < 2 && !NPC.AnyNPCs(mod.NPCType("SlimeGod"))) - { - CalamityWorld.bossRushStage = 35; - DespawnProj(); - } - } - else if (npc.type == mod.NPCType("Providence")) - { - CalamityWorld.bossRushStage = 36; - DespawnProj(); - } - else if (npc.type == mod.NPCType("SupremeCalamitas")) - { - CalamityWorld.bossRushStage = 37; - DespawnProj(); - } - else if (npc.type == mod.NPCType("Yharon")) - { - CalamityWorld.bossRushStage = 38; - DespawnProj(); - } - else if (npc.type == mod.NPCType("DevourerofGodsHeadS")) - { - npc.DropItemInstanced(npc.position, npc.Size, mod.ItemType("Rock"), 1, true); - CalamityWorld.bossRushStage = 0; - DespawnProj(); - CalamityWorld.bossRushActive = false; - if (Main.netMode == 2) - { - NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); - var netMessage = mod.GetPacket(); - netMessage.Write((byte)CalamityModMessageType.BossRushStage); - netMessage.Write(CalamityWorld.bossRushStage); - netMessage.Send(); - } - string key = "Mods.CalamityMod.BossRushTierFiveEndText"; - Color messageColor = Color.LightCoral; - if (Main.netMode == 0) - { - Main.NewText(Language.GetTextValue(key), messageColor); - } - else if (Main.netMode == 2) - { - NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); - } - return false; - } - switch (npc.type) - { - case NPCID.QueenBee: - CalamityWorld.bossRushStage = 1; - DespawnProj(); - break; - case NPCID.BrainofCthulhu: - CalamityWorld.bossRushStage = 2; - DespawnProj(); - break; - case NPCID.KingSlime: - CalamityWorld.bossRushStage = 3; - DespawnProj(); - break; - case NPCID.EyeofCthulhu: - CalamityWorld.bossRushStage = 4; - DespawnProj(); - break; - case NPCID.SkeletronPrime: - CalamityWorld.bossRushStage = 5; - DespawnProj(); - break; - case NPCID.Golem: - CalamityWorld.bossRushStage = 6; - DespawnProj(); - break; - case NPCID.TheDestroyer: - CalamityWorld.bossRushStage = 10; - DespawnProj(); - string key = "Mods.CalamityMod.BossRushTierOneEndText"; - Color messageColor = Color.LightCoral; - if (Main.netMode == 0) - { - Main.NewText(Language.GetTextValue(key), messageColor); - } - else if (Main.netMode == 2) - { - NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); - } - break; - case NPCID.Spazmatism: - CalamityWorld.bossRushStage = 11; - DespawnProj(); - break; - case NPCID.Retinazer: - CalamityWorld.bossRushStage = 11; - DespawnProj(); - break; - case NPCID.WallofFlesh: - CalamityWorld.bossRushStage = 13; - DespawnProj(); - break; - case NPCID.SkeletronHead: - CalamityWorld.bossRushStage = 15; - DespawnProj(); - break; - case NPCID.CultistBoss: - CalamityWorld.bossRushStage = 19; - DespawnProj(); - string key2 = "Mods.CalamityMod.BossRushTierTwoEndText"; - Color messageColor2 = Color.LightCoral; - if (Main.netMode == 0) - { - Main.NewText(Language.GetTextValue(key2), messageColor2); - } - else if (Main.netMode == 2) - { - NetMessage.BroadcastChatMessage(NetworkText.FromKey(key2), messageColor2); - } - break; - case NPCID.Plantera: - CalamityWorld.bossRushStage = 21; - DespawnProj(); - break; - case NPCID.DukeFishron: - CalamityWorld.bossRushStage = 28; - DespawnProj(); - break; - case NPCID.MoonLordCore: - CalamityWorld.bossRushStage = 29; - DespawnProj(); - break; - default: - break; - } - if (Main.netMode == 2) - { - var netMessage = mod.GetPacket(); - netMessage.Write((byte)CalamityModMessageType.BossRushStage); - netMessage.Write(CalamityWorld.bossRushStage); - netMessage.Send(); - } - return false; - } - #endregion - int x = Main.maxTilesX; - int y = Main.maxTilesY; - int genLimit = x / 2; - int abyssChasmSteps = y / 4; - int abyssChasmY = (y - abyssChasmSteps) + 100; - int abyssChasmX = (CalamityWorld.abyssSide ? genLimit - (genLimit - 135) : genLimit + (genLimit - 135)); - bool abyssPosX = false; - bool abyssPosY = ((double)(npc.position.Y / 16f) <= abyssChasmY); - if (CalamityWorld.abyssSide) - { - if ((double)(npc.position.X / 16f) < abyssChasmX + 80) - { - abyssPosX = true; - } - } - else - { - if ((double)(npc.position.X / 16f) > abyssChasmX - 80) - { - abyssPosX = true; - } - } - bool hurtByAbyss = (npc.wet && npc.damage > 0 && !npc.boss && !npc.friendly && !npc.dontTakeDamage && - ((((double)(npc.position.Y / 16f) > (Main.rockLayer - (double)Main.maxTilesY * 0.05)) && - abyssPosY && abyssPosX) || CalamityWorld.abyssTiles > 200) && - !npc.buffImmune[mod.BuffType("CrushDepth")]); - if (hurtByAbyss) - { - return false; - } - if (CalamityWorld.revenge) - { - if (npc.type == NPCID.Probe) - { - return false; - } - } - if (!NPC.downedMechBossAny && (npc.type == NPCID.Spazmatism || npc.type == NPCID.TheDestroyer || npc.type == NPCID.SkeletronPrime)) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge20")); - } - if (!NPC.downedSlimeKing && npc.type == NPCID.KingSlime) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 2); - } - else if (!NPC.downedBoss1 && npc.type == NPCID.EyeofCthulhu) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 2); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge3")); - } - else if (!NPC.downedQueenBee && npc.type == NPCID.QueenBee) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 2); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge16")); - } - else if (!NPC.downedMechBoss1 && npc.type == NPCID.TheDestroyer) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 4); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrenadeRounds"), 2); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge21")); - } - else if (!NPC.downedMechBoss2 && npc.type == NPCID.Spazmatism) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 4); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrenadeRounds"), 2); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge22")); - } - else if (!NPC.downedMechBoss3 && npc.type == NPCID.SkeletronPrime) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 4); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrenadeRounds"), 2); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge23")); - } - else if (!NPC.downedPlantBoss && npc.type == NPCID.Plantera) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 4); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrenadeRounds"), 2); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge25")); - } - else if (!NPC.downedFishron && npc.type == NPCID.DukeFishron) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 4); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrenadeRounds"), 2); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge2")); - } - else if (npc.type == NPCID.CultistBoss) - { - if (!NPC.downedAncientCultist) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 4); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrenadeRounds"), 2); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge4")); - } - if (Main.bloodMoon) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge34")); - } - } - return true; - } - #endregion - - #region NPCLoot - public override void NPCLoot(NPC npc) + #region PreNPCLoot + public override bool PreNPCLoot(NPC npc) { - if (DraedonMayhem) - { - if (!CalamityPlayer.areThereAnyDamnBosses) - { - DraedonMayhem = false; - if (Main.netMode == 2) - { - NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); - } - } - } - #region DefiledLoot - if (CalamityWorld.defiled) - { - if (npc.type == NPCID.AnglerFish || npc.type == NPCID.Werewolf) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.AdhesiveBandage); - } - if (npc.type == NPCID.Werewolf) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.MoonCharm); - } - } - } - else if (npc.type == NPCID.DesertBeast) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.AncientHorn); - } - } - else if (npc.type == NPCID.ArmoredSkeleton) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.BeamSword); - } - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.ArmorPolish); - } - } - else if (npc.type == NPCID.Clown) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Bananarang); - } - } - else if (npc.type == NPCID.Hornet || npc.type == NPCID.MossHornet || npc.type == NPCID.ToxicSludge) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Bezoar); - } - if (npc.type == NPCID.MossHornet) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.TatteredBeeWing); - } - } - } - else if (npc.type == NPCID.EyeofCthulhu) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Binoculars); - } - } - else if (npc.type == NPCID.DemonEye || npc.type == NPCID.WanderingEye) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.BlackLens); - } - } - else if (npc.type == NPCID.CorruptSlime || npc.type == NPCID.DarkMummy) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Blindfold); - } - } - else if (npc.type >= 269 && npc.type <= 280) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Keybrand); - } - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.BoneFeather); - } - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.MagnetSphere); - } - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.WispinaBottle); - } - } - else if (npc.type == NPCID.UndeadMiner) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.BonePickaxe); - } - } - else if (npc.type == NPCID.Skeleton) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.BoneSword); - } - } - else if (npc.type == NPCID.ScutlixRider) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.BrainScrambler); - } - } - else if (npc.type == NPCID.Vampire) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.BrokenBatWing); - } - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.MoonStone); - } - } - else if (npc.type == NPCID.CaveBat) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.ChainKnife); - } - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.DepthMeter); - } - } - else if (npc.type == NPCID.DarkCaster || npc.type == NPCID.AngryBones) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.ClothierVoodooDoll); - } - } - else if (npc.type == NPCID.PirateCaptain) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.CoinGun); - } - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.DiscountCard); - } - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Cutlass); - } - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.LuckyCoin); - } - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.PirateStaff); - } - } - else if (npc.type == NPCID.Reaper) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.DeathSickle); - } - } - else if (npc.type == NPCID.Demon) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.DemonScythe); - } - } - else if (npc.type == NPCID.DesertDjinn) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.DjinnLamp); - } - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.DjinnsCurse); - } - } - else if (npc.type == NPCID.Shark) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.DivingHelmet); - } - } - else if (npc.type == NPCID.Pixie || npc.type == NPCID.Wraith || npc.type == NPCID.Mummy) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.FastClock); - } - } - else if (npc.type == NPCID.RedDevil) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.FireFeather); - } - } - else if (npc.type == NPCID.IceElemental || npc.type == NPCID.IcyMerman || npc.type == NPCID.ArmoredViking || npc.type == NPCID.IceTortoise) - { - if (npc.type == NPCID.IceElemental || npc.type == NPCID.IcyMerman) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.FrostStaff); - } - } - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.IceSickle); - } - if (npc.type == NPCID.IceTortoise) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.FrozenTurtleShell); - } - } - } - else if (npc.type == NPCID.Harpy && Main.hardMode) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.GiantHarpyFeather); - } - } - else if (npc.type == mod.NPCType("SunBat")) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.HelFire); - } - } - else if (npc.type == mod.NPCType("Cryon")) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Amarok); - } - } - else if (npc.type == NPCID.QueenBee) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.HoneyedGoggles); - } - } - else if (npc.type == NPCID.Piranha) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Hook); - } - } - else if (npc.type == NPCID.DiabolistRed || npc.type == NPCID.DiabolistWhite) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.InfernoFork); - } - } - else if (npc.type == NPCID.PinkJellyfish) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.JellyfishNecklace); - } - } - else if (npc.type == NPCID.Paladin) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Kraken); - } - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.PaladinsHammer); - } - } - else if (npc.type == NPCID.SkeletonArcher) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.MagicQuiver); - } - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Marrow); - } - } - else if (npc.type == NPCID.Lavabat) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.MagmaStone); - } - } - else if (npc.type == NPCID.WalkingAntlion) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.AntlionClaw); - } - } - else if (npc.type == NPCID.DarkMummy || npc.type == NPCID.GreenJellyfish) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Megaphone); - } - } - else if (npc.type == NPCID.CursedSkull) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Nazar); - } - } - else if (npc.type == NPCID.FireImp) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.ObsidianRose); - } - } - else if (npc.type == NPCID.BlackRecluse || npc.type == NPCID.BlackRecluseWall) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.PoisonStaff); - } - } - else if (npc.type == NPCID.SkeletonSniper) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.RifleScope); - } - } - else if (npc.type == NPCID.ChaosElemental) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.RodofDiscord); - } - } - else if (npc.type == NPCID.Necromancer || npc.type == NPCID.NecromancerArmored) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.ShadowbeamStaff); - } - } - else if (npc.type == NPCID.SnowFlinx) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.SnowballLauncher); - } - } - else if (npc.type == NPCID.RaggedCaster) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.SpectreStaff); - } - } - else if (npc.type == NPCID.Plantera) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.TheAxe); - } - } - else if (npc.type == NPCID.GiantBat) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.TrifoldMap); - } - } - else if (npc.type == NPCID.AngryTrapper) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Uzi); - } - } - else if (npc.type == NPCID.FloatyGross || npc.type == NPCID.Corruptor) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Vitamins); - } - } - else if (NPC.downedMechBossAny && npc.type == NPCID.GiantTortoise) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Yelets); - } - } - } - #endregion - #region ArmageddonLoot - if (CalamityWorld.armageddon) - { - if (npc.type == NPCID.Golem) - { - for (int i = 0; i < 10; i++) - { - npc.DropBossBags(); - } - } - else if (npc.type == NPCID.DukeFishron) - { - for (int i = 0; i < 10; i++) - { - npc.DropBossBags(); - } - } - else if (npc.type == NPCID.DD2Betsy) - { - for (int i = 0; i < 10; i++) - { - npc.DropBossBags(); - } - } - else if (npc.type == NPCID.EyeofCthulhu) - { - for (int i = 0; i < 10; i++) - { - npc.DropBossBags(); - } - } - else if (npc.type == NPCID.BrainofCthulhu) - { - for (int i = 0; i < 10; i++) - { - npc.DropBossBags(); - } - } - else if (npc.type == NPCID.EaterofWorldsHead || npc.type == NPCID.EaterofWorldsBody || npc.type == NPCID.EaterofWorldsTail) - { - if (npc.boss) - { - for (int i = 0; i < 10; i++) - { - npc.DropBossBags(); - } - } - } - else if (npc.type == NPCID.QueenBee) - { - for (int i = 0; i < 10; i++) - { - npc.DropBossBags(); - } - } - else if (npc.type == NPCID.SkeletronHead) - { - for (int i = 0; i < 10; i++) - { - npc.DropBossBags(); - } - } - else if (npc.type == NPCID.WallofFlesh) - { - for (int i = 0; i < 10; i++) - { - npc.DropBossBags(); - } - } - else if (npc.type == NPCID.MoonLordCore) - { - for (int i = 0; i < 10; i++) - { - npc.DropBossBags(); - } - } - else if (npc.type == NPCID.KingSlime) - { - for (int i = 0; i < 10; i++) - { - npc.DropBossBags(); - } - } - else if (npc.type == NPCID.Retinazer || npc.type == NPCID.Spazmatism) - { - int num64 = NPCID.Retinazer; - if (npc.type == NPCID.Retinazer) - { - num64 = NPCID.Spazmatism; - } - if (!NPC.AnyNPCs(num64)) - { - for (int i = 0; i < 10; i++) - { - npc.DropBossBags(); - } - } - } - else if (npc.type == NPCID.SkeletronPrime) - { - for (int i = 0; i < 10; i++) - { - npc.DropBossBags(); - } - } - else if (npc.type == NPCID.TheDestroyer) - { - for (int i = 0; i < 10; i++) - { - npc.DropBossBags(); - } - } - else if (npc.type == NPCID.Plantera) - { - for (int i = 0; i < 10; i++) - { - npc.DropBossBags(); - } - } - } - #endregion - #region AdrenalineReset - if (npc.boss && CalamityWorld.revenge) - { - if (npc.type != mod.NPCType("HiveMind") && npc.type != mod.NPCType("Leviathan") && npc.type != mod.NPCType("Siren") && - npc.type != mod.NPCType("StormWeaverHead") && npc.type != mod.NPCType("StormWeaverBody") && - npc.type != mod.NPCType("StormWeaverTail") && npc.type != mod.NPCType("DevourerofGodsHead") && - npc.type != mod.NPCType("DevourerofGodsBody") && npc.type != mod.NPCType("DevourerofGodsTail")) - { - if (Main.netMode != 2) - { - if (!Main.player[Main.myPlayer].dead && Main.player[Main.myPlayer].active) - { - Main.player[Main.myPlayer].GetModPlayer(mod).adrenaline = 0; - } - } - } - } - #endregion - #region StressDrops - bool revenge = CalamityWorld.revenge; - bool defiled = CalamityWorld.defiled; - if (revenge && npc.boss) + #region BossRush + if (CalamityWorld.bossRushActive) { - if (Main.rand.Next(20) == 0) + if (npc.type == mod.NPCType("ProfanedGuardianBoss")) { - switch (Main.rand.Next(3)) - { - case 0: npc.DropItemInstanced(npc.position, npc.Size, mod.ItemType("StressPills"), 1, true); break; - case 1: npc.DropItemInstanced(npc.position, npc.Size, mod.ItemType("Laudanum"), 1, true); break; - case 2: npc.DropItemInstanced(npc.position, npc.Size, mod.ItemType("HeartofDarkness"), 1, true); break; - } + CalamityWorld.bossRushStage = 7; + DespawnProj(); } - } - #endregion - #region SpawnPolterghast - if ((npc.type == mod.NPCType("PhantomSpirit") || npc.type == mod.NPCType("PhantomSpiritS") || npc.type == mod.NPCType("PhantomSpiritM") || - npc.type == mod.NPCType("PhantomSpiritL")) && !NPC.AnyNPCs(mod.NPCType("Polterghast")) && !CalamityWorld.downedPolterghast) + else if (npc.type == NPCID.EaterofWorldsHead || npc.type == NPCID.EaterofWorldsBody || npc.type == NPCID.EaterofWorldsTail) + { + if (npc.boss) + { + CalamityWorld.bossRushStage = 8; + DespawnProj(); + } + } + else if (npc.type == mod.NPCType("Astrageldon")) + { + CalamityWorld.bossRushStage = 9; + DespawnProj(); + } + else if (npc.type == mod.NPCType("Bumblefuck")) + { + CalamityWorld.bossRushStage = 12; + DespawnProj(); + } + else if (npc.type == mod.NPCType("HiveMindP2")) + { + CalamityWorld.bossRushStage = 14; + DespawnProj(); + } + else if (npc.type == mod.NPCType("StormWeaverHeadNaked")) + { + CalamityWorld.bossRushStage = 16; + DespawnProj(); + } + else if (npc.type == mod.NPCType("AquaticScourgeHead")) + { + CalamityWorld.bossRushStage = 17; + DespawnProj(); + } + else if (npc.type == mod.NPCType("DesertScourgeHead")) + { + CalamityWorld.bossRushStage = 18; + DespawnProj(); + } + else if (npc.type == mod.NPCType("CrabulonIdle")) + { + CalamityWorld.bossRushStage = 20; + DespawnProj(); + } + else if (npc.type == mod.NPCType("CeaselessVoid")) + { + CalamityWorld.bossRushStage = 22; + DespawnProj(); + } + else if (npc.type == mod.NPCType("PerforatorHive")) + { + CalamityWorld.bossRushStage = 23; + DespawnProj(); + } + else if (npc.type == mod.NPCType("Cryogen")) + { + CalamityWorld.bossRushStage = 24; + DespawnProj(); + } + else if (npc.type == mod.NPCType("BrimstoneElemental")) + { + CalamityWorld.bossRushStage = 25; + DespawnProj(); + } + else if (npc.type == mod.NPCType("CosmicWraith")) + { + CalamityWorld.bossRushStage = 26; + DespawnProj(); + string key = "Mods.CalamityMod.BossRushTierThreeEndText"; + Color messageColor = Color.LightCoral; + if (Main.netMode == 0) + { + Main.NewText(Language.GetTextValue(key), messageColor); + } + else if (Main.netMode == 2) + { + NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); + } + } + else if (npc.type == mod.NPCType("ScavengerBody")) + { + CalamityWorld.bossRushStage = 27; + DespawnProj(); + } + else if (npc.type == mod.NPCType("AstrumDeusHeadSpectral")) + { + CalamityWorld.bossRushStage = 30; + DespawnProj(); + } + else if (npc.type == mod.NPCType("Polterghast")) + { + CalamityWorld.bossRushStage = 31; + DespawnProj(); + } + else if (npc.type == mod.NPCType("PlaguebringerGoliath")) + { + CalamityWorld.bossRushStage = 32; + DespawnProj(); + } + else if (npc.type == mod.NPCType("CalamitasRun3")) + { + CalamityWorld.bossRushStage = 33; + DespawnProj(); + string key = "Mods.CalamityMod.BossRushTierFourEndText"; + Color messageColor = Color.LightCoral; + if (Main.netMode == 0) + { + Main.NewText(Language.GetTextValue(key), messageColor); + } + else if (Main.netMode == 2) + { + NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); + } + } + else if (npc.type == mod.NPCType("Siren") || npc.type == mod.NPCType("Leviathan")) + { + int bossType = (npc.type == mod.NPCType("Siren")) ? mod.NPCType("Leviathan") : mod.NPCType("Siren"); + if (!NPC.AnyNPCs(bossType)) + { + CalamityWorld.bossRushStage = 34; + DespawnProj(); + } + } + else if (npc.type == mod.NPCType("SlimeGodCore") || npc.type == mod.NPCType("SlimeGodSplit") || npc.type == mod.NPCType("SlimeGodRunSplit")) + { + if (npc.type == mod.NPCType("SlimeGodCore") && !NPC.AnyNPCs(mod.NPCType("SlimeGodSplit")) && !NPC.AnyNPCs(mod.NPCType("SlimeGodRunSplit")) + && !NPC.AnyNPCs(mod.NPCType("SlimeGod")) && !NPC.AnyNPCs(mod.NPCType("SlimeGodRun"))) + { + CalamityWorld.bossRushStage = 35; + DespawnProj(); + } + else if (npc.type == mod.NPCType("SlimeGodSplit") && !NPC.AnyNPCs(mod.NPCType("SlimeGodCore")) && !NPC.AnyNPCs(mod.NPCType("SlimeGodRunSplit")) && + NPC.CountNPCS(mod.NPCType("SlimeGodSplit")) < 2 && !NPC.AnyNPCs(mod.NPCType("SlimeGodRun"))) + { + CalamityWorld.bossRushStage = 35; + DespawnProj(); + } + else if (npc.type == mod.NPCType("SlimeGodRunSplit") && !NPC.AnyNPCs(mod.NPCType("SlimeGodCore")) && !NPC.AnyNPCs(mod.NPCType("SlimeGodSplit")) && + NPC.CountNPCS(mod.NPCType("SlimeGodRunSplit")) < 2 && !NPC.AnyNPCs(mod.NPCType("SlimeGod"))) + { + CalamityWorld.bossRushStage = 35; + DespawnProj(); + } + } + else if (npc.type == mod.NPCType("Providence")) + { + CalamityWorld.bossRushStage = 36; + DespawnProj(); + } + else if (npc.type == mod.NPCType("SupremeCalamitas")) + { + CalamityWorld.bossRushStage = 37; + DespawnProj(); + } + else if (npc.type == mod.NPCType("Yharon")) + { + CalamityWorld.bossRushStage = 38; + DespawnProj(); + } + else if (npc.type == mod.NPCType("DevourerofGodsHeadS")) + { + npc.DropItemInstanced(npc.position, npc.Size, mod.ItemType("Rock"), 1, true); + CalamityWorld.bossRushStage = 0; + DespawnProj(); + CalamityWorld.bossRushActive = false; + if (Main.netMode == 2) + { + NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + var netMessage = mod.GetPacket(); + netMessage.Write((byte)CalamityModMessageType.BossRushStage); + netMessage.Write(CalamityWorld.bossRushStage); + netMessage.Send(); + } + string key = "Mods.CalamityMod.BossRushTierFiveEndText"; + Color messageColor = Color.LightCoral; + if (Main.netMode == 0) + { + Main.NewText(Language.GetTextValue(key), messageColor); + } + else if (Main.netMode == 2) + { + NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); + } + return false; + } + switch (npc.type) + { + case NPCID.QueenBee: + CalamityWorld.bossRushStage = 1; + DespawnProj(); + break; + case NPCID.BrainofCthulhu: + CalamityWorld.bossRushStage = 2; + DespawnProj(); + break; + case NPCID.KingSlime: + CalamityWorld.bossRushStage = 3; + DespawnProj(); + break; + case NPCID.EyeofCthulhu: + CalamityWorld.bossRushStage = 4; + DespawnProj(); + break; + case NPCID.SkeletronPrime: + CalamityWorld.bossRushStage = 5; + DespawnProj(); + break; + case NPCID.Golem: + CalamityWorld.bossRushStage = 6; + DespawnProj(); + break; + case NPCID.TheDestroyer: + CalamityWorld.bossRushStage = 10; + DespawnProj(); + string key = "Mods.CalamityMod.BossRushTierOneEndText"; + Color messageColor = Color.LightCoral; + if (Main.netMode == 0) + { + Main.NewText(Language.GetTextValue(key), messageColor); + } + else if (Main.netMode == 2) + { + NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); + } + break; + case NPCID.Spazmatism: + CalamityWorld.bossRushStage = 11; + DespawnProj(); + break; + case NPCID.Retinazer: + CalamityWorld.bossRushStage = 11; + DespawnProj(); + break; + case NPCID.WallofFlesh: + CalamityWorld.bossRushStage = 13; + DespawnProj(); + break; + case NPCID.SkeletronHead: + CalamityWorld.bossRushStage = 15; + DespawnProj(); + break; + case NPCID.CultistBoss: + CalamityWorld.bossRushStage = 19; + DespawnProj(); + string key2 = "Mods.CalamityMod.BossRushTierTwoEndText"; + Color messageColor2 = Color.LightCoral; + if (Main.netMode == 0) + { + Main.NewText(Language.GetTextValue(key2), messageColor2); + } + else if (Main.netMode == 2) + { + NetMessage.BroadcastChatMessage(NetworkText.FromKey(key2), messageColor2); + } + break; + case NPCID.Plantera: + CalamityWorld.bossRushStage = 21; + DespawnProj(); + break; + case NPCID.DukeFishron: + CalamityWorld.bossRushStage = 28; + DespawnProj(); + break; + case NPCID.MoonLordCore: + CalamityWorld.bossRushStage = 29; + DespawnProj(); + break; + default: + break; + } + if (Main.netMode == 2) + { + var netMessage = mod.GetPacket(); + netMessage.Write((byte)CalamityModMessageType.BossRushStage); + netMessage.Write(CalamityWorld.bossRushStage); + netMessage.Send(); + } + return false; + } + #endregion + #region AbyssDropCancel + int x = Main.maxTilesX; + int y = Main.maxTilesY; + int genLimit = x / 2; + int abyssChasmY = y - 250; + int abyssChasmX = (CalamityWorld.abyssSide ? genLimit - (genLimit - 135) : genLimit + (genLimit - 135)); + bool abyssPosX = false; + bool abyssPosY = ((double)(npc.position.Y / 16f) <= abyssChasmY); + if (CalamityWorld.abyssSide) + { + if ((double)(npc.position.X / 16f) < abyssChasmX + 80) + { + abyssPosX = true; + } + } + else + { + if ((double)(npc.position.X / 16f) > abyssChasmX - 80) + { + abyssPosX = true; + } + } + bool hurtByAbyss = (npc.wet && npc.damage > 0 && !npc.boss && !npc.friendly && !npc.dontTakeDamage && + ((((double)(npc.position.Y / 16f) > (Main.rockLayer - (double)Main.maxTilesY * 0.05)) && + abyssPosY && abyssPosX) || CalamityWorld.abyssTiles > 200) && + !npc.buffImmune[mod.BuffType("CrushDepth")]); + if (hurtByAbyss) + { + return false; + } + #endregion + if (CalamityWorld.revenge) + { + if (npc.type == NPCID.Probe) + { + return false; + } + } + if (!NPC.downedMechBossAny && (npc.type == NPCID.Spazmatism || npc.type == NPCID.TheDestroyer || npc.type == NPCID.SkeletronPrime)) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge20")); + } + if (!NPC.downedSlimeKing && npc.type == NPCID.KingSlime) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 2); + } + else if (!NPC.downedBoss1 && npc.type == NPCID.EyeofCthulhu) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 2); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge3")); + } + else if (!NPC.downedQueenBee && npc.type == NPCID.QueenBee) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 2); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge16")); + } + else if (!NPC.downedMechBoss1 && npc.type == NPCID.TheDestroyer) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 4); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrenadeRounds"), 2); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ExplosiveShells")); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge21")); + } + else if (!NPC.downedMechBoss2 && npc.type == NPCID.Spazmatism) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 4); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrenadeRounds"), 2); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ExplosiveShells")); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge22")); + } + else if (!NPC.downedMechBoss3 && npc.type == NPCID.SkeletronPrime) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 4); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrenadeRounds"), 2); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ExplosiveShells")); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge23")); + } + else if (!NPC.downedPlantBoss && npc.type == NPCID.Plantera) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 4); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrenadeRounds"), 2); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ExplosiveShells")); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge25")); + } + else if (!NPC.downedFishron && npc.type == NPCID.DukeFishron) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 4); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrenadeRounds"), 2); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ExplosiveShells")); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge2")); + } + else if (npc.type == NPCID.CultistBoss) + { + if (!NPC.downedAncientCultist) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 4); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrenadeRounds"), 2); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ExplosiveShells")); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge4")); + } + if (Main.bloodMoon) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge34")); + } + } + return true; + } + #endregion + + #region NPCLoot + public override void NPCLoot(NPC npc) + { + bool revenge = CalamityWorld.revenge; + if (DraedonMayhem) + { + if (!CalamityPlayer.areThereAnyDamnBosses) + { + DraedonMayhem = false; + if (Main.netMode == 2) + { + NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + } + } + } + #region DefiledLoot + if (CalamityWorld.defiled) + { + if (npc.type == NPCID.AnglerFish || npc.type == NPCID.Werewolf) + { + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.AdhesiveBandage); + } + if (npc.type == NPCID.Werewolf) + { + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.MoonCharm); + } + } + } + else if (npc.type == NPCID.DesertBeast) + { + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.AncientHorn); + } + } + else if (npc.type == NPCID.ArmoredSkeleton) + { + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.BeamSword); + } + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.ArmorPolish); + } + } + else if (npc.type == NPCID.Clown) + { + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Bananarang); + } + } + else if (npc.type == NPCID.Hornet || npc.type == NPCID.MossHornet || npc.type == NPCID.ToxicSludge) + { + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Bezoar); + } + if (npc.type == NPCID.MossHornet) + { + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.TatteredBeeWing); + } + } + } + else if (npc.type == NPCID.EyeofCthulhu) + { + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Binoculars); + } + } + else if (npc.type == NPCID.DemonEye || npc.type == NPCID.WanderingEye) + { + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.BlackLens); + } + } + else if (npc.type == NPCID.CorruptSlime || npc.type == NPCID.DarkMummy) + { + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Blindfold); + } + } + else if (npc.type >= 269 && npc.type <= 280) + { + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Keybrand); + } + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.BoneFeather); + } + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.MagnetSphere); + } + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.WispinaBottle); + } + } + else if (npc.type == NPCID.UndeadMiner) + { + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.BonePickaxe); + } + } + else if (npc.type == NPCID.Skeleton) + { + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.BoneSword); + } + } + else if (npc.type == NPCID.ScutlixRider) + { + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.BrainScrambler); + } + } + else if (npc.type == NPCID.Vampire) + { + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.BrokenBatWing); + } + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.MoonStone); + } + } + else if (npc.type == NPCID.CaveBat) + { + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.ChainKnife); + } + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.DepthMeter); + } + } + else if (npc.type == NPCID.DarkCaster || npc.type == NPCID.AngryBones) + { + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.ClothierVoodooDoll); + } + } + else if (npc.type == NPCID.PirateCaptain) + { + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.CoinGun); + } + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.DiscountCard); + } + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Cutlass); + } + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.LuckyCoin); + } + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.PirateStaff); + } + } + else if (npc.type == NPCID.Reaper) + { + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.DeathSickle); + } + } + else if (npc.type == NPCID.Demon) + { + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.DemonScythe); + } + } + else if (npc.type == NPCID.DesertDjinn) + { + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.DjinnLamp); + } + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.DjinnsCurse); + } + } + else if (npc.type == NPCID.Shark) + { + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.DivingHelmet); + } + } + else if (npc.type == NPCID.Pixie || npc.type == NPCID.Wraith || npc.type == NPCID.Mummy) + { + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.FastClock); + } + } + else if (npc.type == NPCID.RedDevil) + { + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.FireFeather); + } + } + else if (npc.type == NPCID.IceElemental || npc.type == NPCID.IcyMerman || npc.type == NPCID.ArmoredViking || npc.type == NPCID.IceTortoise) + { + if (npc.type == NPCID.IceElemental || npc.type == NPCID.IcyMerman) + { + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.FrostStaff); + } + } + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.IceSickle); + } + if (npc.type == NPCID.IceTortoise) + { + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.FrozenTurtleShell); + } + } + } + else if (npc.type == NPCID.Harpy && Main.hardMode) + { + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.GiantHarpyFeather); + } + } + else if (npc.type == mod.NPCType("SunBat")) + { + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.HelFire); + } + } + else if (npc.type == mod.NPCType("Cryon")) + { + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Amarok); + } + } + else if (npc.type == NPCID.QueenBee) + { + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.HoneyedGoggles); + } + } + else if (npc.type == NPCID.Piranha) + { + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Hook); + } + } + else if (npc.type == NPCID.DiabolistRed || npc.type == NPCID.DiabolistWhite) + { + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.InfernoFork); + } + } + else if (npc.type == NPCID.PinkJellyfish) + { + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.JellyfishNecklace); + } + } + else if (npc.type == NPCID.Paladin) + { + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Kraken); + } + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.PaladinsHammer); + } + } + else if (npc.type == NPCID.SkeletonArcher) + { + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.MagicQuiver); + } + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Marrow); + } + } + else if (npc.type == NPCID.Lavabat) + { + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.MagmaStone); + } + } + else if (npc.type == NPCID.WalkingAntlion) + { + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.AntlionClaw); + } + } + else if (npc.type == NPCID.DarkMummy || npc.type == NPCID.GreenJellyfish) + { + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Megaphone); + } + } + else if (npc.type == NPCID.CursedSkull) + { + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Nazar); + } + } + else if (npc.type == NPCID.FireImp) + { + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.ObsidianRose); + } + } + else if (npc.type == NPCID.BlackRecluse || npc.type == NPCID.BlackRecluseWall) + { + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.PoisonStaff); + } + } + else if (npc.type == NPCID.SkeletonSniper) + { + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.RifleScope); + } + } + else if (npc.type == NPCID.ChaosElemental) + { + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.RodofDiscord); + } + } + else if (npc.type == NPCID.Necromancer || npc.type == NPCID.NecromancerArmored) + { + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.ShadowbeamStaff); + } + } + else if (npc.type == NPCID.SnowFlinx) + { + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.SnowballLauncher); + } + } + else if (npc.type == NPCID.RaggedCaster) + { + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.SpectreStaff); + } + } + else if (npc.type == NPCID.Plantera) + { + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.TheAxe); + } + } + else if (npc.type == NPCID.GiantBat) + { + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.TrifoldMap); + } + } + else if (npc.type == NPCID.AngryTrapper) + { + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Uzi); + } + } + else if (npc.type == NPCID.FloatyGross || npc.type == NPCID.Corruptor) + { + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Vitamins); + } + } + else if (NPC.downedMechBossAny && npc.type == NPCID.GiantTortoise) + { + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Yelets); + } + } + } + #endregion + #region ArmageddonLoot + if (CalamityWorld.armageddon) + { + int dropAmt = 5; + if (npc.type == NPCID.Golem) + { + for (int i = 0; i < dropAmt; i++) + { + npc.DropBossBags(); + } + } + else if (npc.type == NPCID.DukeFishron) + { + for (int i = 0; i < dropAmt; i++) + { + npc.DropBossBags(); + } + } + else if (npc.type == NPCID.DD2Betsy) + { + for (int i = 0; i < dropAmt; i++) + { + npc.DropBossBags(); + } + } + else if (npc.type == NPCID.EyeofCthulhu) + { + for (int i = 0; i < dropAmt; i++) + { + npc.DropBossBags(); + } + } + else if (npc.type == NPCID.BrainofCthulhu) + { + for (int i = 0; i < dropAmt; i++) + { + npc.DropBossBags(); + } + } + else if (npc.type == NPCID.EaterofWorldsHead || npc.type == NPCID.EaterofWorldsBody || npc.type == NPCID.EaterofWorldsTail) + { + if (npc.boss) + { + for (int i = 0; i < dropAmt; i++) + { + npc.DropBossBags(); + } + } + } + else if (npc.type == NPCID.QueenBee) + { + for (int i = 0; i < dropAmt; i++) + { + npc.DropBossBags(); + } + } + else if (npc.type == NPCID.SkeletronHead) + { + for (int i = 0; i < dropAmt; i++) + { + npc.DropBossBags(); + } + } + else if (npc.type == NPCID.WallofFlesh) + { + for (int i = 0; i < dropAmt; i++) + { + npc.DropBossBags(); + } + } + else if (npc.type == NPCID.MoonLordCore) + { + for (int i = 0; i < dropAmt; i++) + { + npc.DropBossBags(); + } + } + else if (npc.type == NPCID.KingSlime) + { + for (int i = 0; i < dropAmt; i++) + { + npc.DropBossBags(); + } + } + else if (npc.type == NPCID.Retinazer || npc.type == NPCID.Spazmatism) + { + int num64 = NPCID.Retinazer; + if (npc.type == NPCID.Retinazer) + { + num64 = NPCID.Spazmatism; + } + if (!NPC.AnyNPCs(num64)) + { + for (int i = 0; i < dropAmt; i++) + { + npc.DropBossBags(); + } + } + } + else if (npc.type == NPCID.SkeletronPrime) + { + for (int i = 0; i < dropAmt; i++) + { + npc.DropBossBags(); + } + } + else if (npc.type == NPCID.TheDestroyer) + { + for (int i = 0; i < dropAmt; i++) + { + npc.DropBossBags(); + } + } + else if (npc.type == NPCID.Plantera) + { + for (int i = 0; i < dropAmt; i++) + { + npc.DropBossBags(); + } + } + } + #endregion + #region AdrenalineReset + if (npc.boss && CalamityWorld.revenge) + { + if (npc.type != mod.NPCType("HiveMind") && npc.type != mod.NPCType("Leviathan") && npc.type != mod.NPCType("Siren") && + npc.type != mod.NPCType("StormWeaverHead") && npc.type != mod.NPCType("StormWeaverBody") && + npc.type != mod.NPCType("StormWeaverTail") && npc.type != mod.NPCType("DevourerofGodsHead") && + npc.type != mod.NPCType("DevourerofGodsBody") && npc.type != mod.NPCType("DevourerofGodsTail")) + { + if (Main.netMode != 2) + { + if (!Main.player[Main.myPlayer].dead && Main.player[Main.myPlayer].active) + { + Main.player[Main.myPlayer].GetModPlayer(mod).adrenaline = 0; + } + } + } + } + #endregion + #region SpawnPolterghast + if ((npc.type == mod.NPCType("PhantomSpirit") || npc.type == mod.NPCType("PhantomSpiritS") || npc.type == mod.NPCType("PhantomSpiritM") || + npc.type == mod.NPCType("PhantomSpiritL")) && !NPC.AnyNPCs(mod.NPCType("Polterghast")) && !CalamityWorld.downedPolterghast) { CalamityMod.ghostKillCount++; if (CalamityMod.ghostKillCount >= 30 && Main.netMode != 1) { - int lastPlayer = npc.lastInteraction; - if (!Main.player[lastPlayer].active || Main.player[lastPlayer].dead) - { - lastPlayer = npc.FindClosestPlayer(); - } - if (lastPlayer >= 0) - { - NPC.SpawnOnPlayer(lastPlayer, mod.NPCType("Polterghast")); - CalamityMod.ghostKillCount = 0; - } - } + int lastPlayer = npc.lastInteraction; + if (!Main.player[lastPlayer].active || Main.player[lastPlayer].dead) + { + lastPlayer = npc.FindClosestPlayer(); + } + if (lastPlayer >= 0) + { + NPC.SpawnOnPlayer(lastPlayer, mod.NPCType("Polterghast")); + CalamityMod.ghostKillCount = 0; + } + } } - #endregion - #region SpawnGSS - if ((NPC.downedPlantBoss || CalamityWorld.downedCalamitas) && npc.type == NPCID.SandShark && !NPC.AnyNPCs(mod.NPCType("GreatSandShark"))) - { - CalamityMod.sharkKillCount++; - if (CalamityMod.sharkKillCount >= 10 && Main.netMode != 1) - { - if (!Main.player[Main.myPlayer].dead && Main.player[Main.myPlayer].active) - { - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/MaulerRoar"), - (int)Main.player[Main.myPlayer].position.X, (int)Main.player[Main.myPlayer].position.Y); - } - int lastPlayer = npc.lastInteraction; - if (!Main.player[lastPlayer].active || Main.player[lastPlayer].dead) - { - lastPlayer = npc.FindClosestPlayer(); - } - if (lastPlayer >= 0) - { - NPC.SpawnOnPlayer(lastPlayer, mod.NPCType("GreatSandShark")); - CalamityMod.sharkKillCount = -10; - } - } - } - #endregion - #region WormLootFromNearestSegment - if (npc.type == mod.NPCType("DesertScourgeHead")) - { - Vector2 center = Main.player[npc.target].Center; - float num2 = 1E+08f; - Vector2 position2 = npc.position; - for (int k = 0; k < 200; k++) - { - if (Main.npc[k].active && (Main.npc[k].type == mod.NPCType("DesertScourgeHead") || Main.npc[k].type == mod.NPCType("DesertScourgeBody") || Main.npc[k].type == mod.NPCType("DesertScourgeTail"))) - { - float num3 = Math.Abs(Main.npc[k].Center.X - center.X) + Math.Abs(Main.npc[k].Center.Y - center.Y); - if (num3 < num2) - { - num2 = num3; - position2 = Main.npc[k].position; - } - } - } - npc.position = position2; - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.LesserHealingPotion, Main.rand.Next(8, 15)); - if (Main.rand.Next(10) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DesertScourgeTrophy")); - } - if (CalamityWorld.armageddon) - { - for (int i = 0; i < 10; i++) - { - npc.DropBossBags(); - } - } - if (Main.expertMode) - { - npc.DropBossBags(); - } - else - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("VictoryShard"), Main.rand.Next(7, 15)); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Coral, Main.rand.Next(5, 10)); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Seashell, Main.rand.Next(5, 10)); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Starfish, Main.rand.Next(5, 10)); - if (Main.rand.Next(4) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SeaboundStaff")); - } - if (Main.rand.Next(4) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Barinade")); - } - if (Main.rand.Next(4) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("StormSpray")); - } - if (Main.rand.Next(4) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("AquaticDischarge")); - } - if (Main.rand.Next(7) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DesertScourgeMask")); - } - if (Main.rand.Next(15) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.HighTestFishingLine); - } - if (Main.rand.Next(15) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.AnglerTackleBag); - } - if (Main.rand.Next(15) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.TackleBox); - } - if (Main.rand.Next(10) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.AnglerEarring); - } - if (Main.rand.Next(10) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.FishermansGuide); - } - if (Main.rand.Next(10) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.WeatherRadio); - } - if (Main.rand.Next(10) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Sextant); - } - if (Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.AnglerHat); - } - if (Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.AnglerVest); - } - if (Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.AnglerPants); - } - if (Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.CratePotion, Main.rand.Next(2, 4)); - } - if (Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.FishingPotion, Main.rand.Next(2, 4)); - } - if (Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.SonarPotion, Main.rand.Next(2, 4)); - } - if (Main.rand.Next(10) == 0) - { - npc.DropItemInstanced(npc.position, npc.Size, mod.ItemType("AeroStone"), 1, true); - } - if (NPC.downedBoss3) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.GoldenBugNet); - } - } - } - if (!CalamityWorld.downedDesertScourge) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 2); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge")); - } - CalamityWorld.downedDesertScourge = true; - } - else if (npc.type == mod.NPCType("AquaticScourgeHead")) - { - Vector2 center = Main.player[npc.target].Center; - float num2 = 1E+08f; - Vector2 position2 = npc.position; - for (int k = 0; k < 200; k++) - { - if (Main.npc[k].active && - (Main.npc[k].type == mod.NPCType("AquaticScourgeHead") || - Main.npc[k].type == mod.NPCType("AquaticScourgeBody") || - Main.npc[k].type == mod.NPCType("AquaticScourgeBodyAlt") || - Main.npc[k].type == mod.NPCType("AquaticScourgeTail"))) - { - float num3 = Math.Abs(Main.npc[k].Center.X - center.X) + Math.Abs(Main.npc[k].Center.Y - center.Y); - if (num3 < num2) - { - num2 = num3; - position2 = Main.npc[k].position; - } - } - } - npc.position = position2; - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.GreaterHealingPotion, Main.rand.Next(8, 15)); - if (Main.hardMode) - { - if (CalamityWorld.armageddon) - { - for (int i = 0; i < 10; i++) - { - npc.DropBossBags(); - } - } - if (Main.expertMode) - { - npc.DropBossBags(); - } - else - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("VictoryShard"), Main.rand.Next(11, 21)); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Coral, Main.rand.Next(5, 10)); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Seashell, Main.rand.Next(5, 10)); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Starfish, Main.rand.Next(5, 10)); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.SoulofSight, Main.rand.Next(20, 41)); - if (Main.rand.Next(4) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DeepseaStaff")); - } - if (Main.rand.Next(4) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Barinautical")); - } - if (Main.rand.Next(4) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Downpour")); - } - if (Main.rand.Next(4) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SubmarineShocker")); - } - if (Main.rand.Next(8) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.HighTestFishingLine); - } - if (Main.rand.Next(8) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.AnglerTackleBag); - } - if (Main.rand.Next(8) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.TackleBox); - } - if (Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.AnglerEarring); - } - if (Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.FishermansGuide); - } - if (Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.WeatherRadio); - } - if (Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Sextant); - } - if (Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.AnglerHat); - } - if (Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.AnglerVest); - } - if (Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.AnglerPants); - } - if (Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.CratePotion, Main.rand.Next(2, 4)); - } - if (Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.FishingPotion, Main.rand.Next(2, 4)); - } - if (Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.SonarPotion, Main.rand.Next(2, 4)); - } - if (Main.rand.Next(5) == 0) - { - npc.DropItemInstanced(npc.position, npc.Size, mod.ItemType("AeroStone"), 1, true); - } - if (Main.rand.Next(10) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.GoldenBugNet); - } - } - } - else - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("VictoryShard"), Main.rand.Next(11, 21)); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Coral, Main.rand.Next(5, 10)); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Seashell, Main.rand.Next(5, 10)); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Starfish, Main.rand.Next(5, 10)); - if (Main.rand.Next(15) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.HighTestFishingLine); - } - if (Main.rand.Next(15) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.AnglerTackleBag); - } - if (Main.rand.Next(15) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.TackleBox); - } - if (Main.rand.Next(10) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.AnglerEarring); - } - if (Main.rand.Next(10) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.FishermansGuide); - } - if (Main.rand.Next(10) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.WeatherRadio); - } - if (Main.rand.Next(10) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Sextant); - } - if (Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.AnglerHat); - } - if (Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.AnglerVest); - } - if (Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.AnglerPants); - } - if (Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.CratePotion, Main.rand.Next(2, 4)); - } - if (Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.FishingPotion, Main.rand.Next(2, 4)); - } - if (Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.SonarPotion, Main.rand.Next(2, 4)); - } - if (Main.rand.Next(10) == 0) - { - npc.DropItemInstanced(npc.position, npc.Size, mod.ItemType("AeroStone"), 1, true); - } - if (NPC.downedBoss3) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.GoldenBugNet); - } - } - } - if (!CalamityWorld.downedAquaticScourge) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 4); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrenadeRounds"), 2); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge27")); - } - CalamityWorld.downedAquaticScourge = true; - } - else if (npc.type == mod.NPCType("AstrumDeusHeadSpectral")) - { - string key = "Mods.CalamityMod.AstralBossText"; - Color messageColor = Color.Gold; - if (!CalamityWorld.downedStarGod) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 4); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrenadeRounds"), 2); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge29")); - if (Main.netMode == 0) - { - Main.NewText(Language.GetTextValue(key), messageColor); - } - else if (Main.netMode == 2) - { - NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); - } - } - CalamityWorld.downedStarGod = true; - if (Main.netMode == 2) - { - NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); - } - Vector2 center = Main.player[npc.target].Center; - float num2 = 1E+08f; - Vector2 position2 = npc.position; - for (int k = 0; k < 200; k++) - { - if (Main.npc[k].active && (Main.npc[k].type == mod.NPCType("AstrumDeusHeadSpectral") || Main.npc[k].type == mod.NPCType("AstrumDeusBodySpectral") || Main.npc[k].type == mod.NPCType("AstrumDeusTailSpectral"))) - { - float num3 = Math.Abs(Main.npc[k].Center.X - center.X) + Math.Abs(Main.npc[k].Center.Y - center.Y); - if (num3 < num2) - { - num2 = num3; - position2 = Main.npc[k].position; - } - } - } - npc.position = position2; - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.GreaterHealingPotion, Main.rand.Next(8, 15)); - if (Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.HallowedKey); - } - if (Main.rand.Next(10) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("AstrumDeusTrophy")); - } - if (CalamityWorld.armageddon) - { - for (int i = 0; i < 10; i++) - { - npc.DropBossBags(); - } - } - if (Main.expertMode) - { - npc.DropBossBags(); - } - else - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Stardust"), Main.rand.Next(50, 81)); - if (Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Starfall")); - } - if (Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Nebulash")); - } - if (Main.rand.Next(7) == 0) - { - npc.DropItemInstanced(npc.position, npc.Size, mod.ItemType("AstrumDeusMask"), 1, true); - } - } - } - else if (npc.type == mod.NPCType("DevourerofGodsHead")) - { - CalamityWorld.DoGSecondStageCountdown = 21600; //6 minutes - if (Main.netMode == 2) - { - var netMessage = mod.GetPacket(); - netMessage.Write((byte)CalamityModMessageType.DoGCountdownSync); - netMessage.Write(CalamityWorld.DoGSecondStageCountdown); - netMessage.Send(); - } - for (int playerIndex = 0; playerIndex < 255; playerIndex++) - { - if (Main.player[playerIndex].active) - { - Player player = Main.player[playerIndex]; - for (int l = 0; l < 22; l++) - { - int hasBuff = player.buffType[l]; - if (hasBuff == mod.BuffType("AdrenalineMode")) - { - player.DelBuff(l); - l = -1; - } - if (hasBuff == mod.BuffType("RageMode")) - { - player.DelBuff(l); - l = -1; - } - } - } - } - } - else if (npc.type == mod.NPCType("DevourerofGodsHeadS")) - { - string key = "Mods.CalamityMod.DoGBossText"; - Color messageColor = Color.Cyan; - string key2 = "Mods.CalamityMod.DoGBossText2"; - Color messageColor2 = Color.Orange; - if (!CalamityWorld.downedDoG) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 6); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrenadeRounds"), 3); - if (Main.netMode == 0) - { - Main.NewText(Language.GetTextValue(key), messageColor); - Main.NewText(Language.GetTextValue(key2), messageColor2); - } - else if (Main.netMode == 2) - { - NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); - NetMessage.BroadcastChatMessage(NetworkText.FromKey(key2), messageColor2); - } - } - CalamityWorld.downedDoG = true; - if (Main.netMode == 2) - { - NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); - } - Vector2 center = Main.player[npc.target].Center; - float num2 = 1E+08f; - Vector2 position2 = npc.position; - for (int k = 0; k < 200; k++) - { - if (Main.npc[k].active && (Main.npc[k].type == mod.NPCType("DevourerofGodsHeadS") || Main.npc[k].type == mod.NPCType("DevourerofGodsBodyS") || Main.npc[k].type == mod.NPCType("DevourerofGodsTailS"))) - { - float num3 = Math.Abs(Main.npc[k].Center.X - center.X) + Math.Abs(Main.npc[k].Center.Y - center.Y); - if (num3 < num2) - { - num2 = num3; - position2 = Main.npc[k].position; - } - } - } - npc.position = position2; - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SupremeHealingPotion"), Main.rand.Next(8, 15)); - if (Main.rand.Next(10) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DevourerofGodsTrophy")); - } - if (CalamityWorld.armageddon) - { - for (int i = 0; i < 10; i++) - { - npc.DropBossBags(); - } - } - if (Main.expertMode) - { - npc.DropBossBags(); - } - else - { - if (Main.rand.Next(7) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DevourerofGodsMask")); - } - if (Main.rand.Next(4) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DeathhailStaff")); - } - if (Main.rand.Next(4) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Excelsus")); - } - if (Main.rand.Next(4) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TheObliterator")); - } - if (Main.rand.Next(4) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Eradicator")); - } - if (Main.rand.Next(4) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EradicatorMelee")); - } - if (Main.rand.Next(4) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Deathwind")); - } - if (Main.rand.Next(4) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("StaffoftheMechworm")); - } - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CosmiliteBar"), Main.rand.Next(25, 35)); - } - } - #endregion - #region ArmorSetLoot - if (Main.player[(int)Player.FindClosest(npc.position, npc.width, npc.height)].GetModPlayer(mod).tarraSet) + #endregion + #region SpawnGSS + if ((NPC.downedPlantBoss || CalamityWorld.downedCalamitas) && npc.type == NPCID.SandShark && !NPC.AnyNPCs(mod.NPCType("GreatSandShark"))) { - if (!npc.SpawnedFromStatue && (npc.damage > 5 || npc.boss) && Main.rand.Next(5) == 0) + CalamityMod.sharkKillCount++; + if (CalamityMod.sharkKillCount >= 10 && Main.netMode != 1) + { + if (!Main.player[Main.myPlayer].dead && Main.player[Main.myPlayer].active) + { + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/MaulerRoar"), + (int)Main.player[Main.myPlayer].position.X, (int)Main.player[Main.myPlayer].position.Y); + } + int lastPlayer = npc.lastInteraction; + if (!Main.player[lastPlayer].active || Main.player[lastPlayer].dead) + { + lastPlayer = npc.FindClosestPlayer(); + } + if (lastPlayer >= 0) + { + NPC.SpawnOnPlayer(lastPlayer, mod.NPCType("GreatSandShark")); + CalamityMod.sharkKillCount = -10; + } + } + } + #endregion + #region WormLootFromNearestSegment + if (npc.type == mod.NPCType("DesertScourgeHead")) + { + Vector2 center = Main.player[npc.target].Center; + float num2 = 1E+08f; + Vector2 position2 = npc.position; + for (int k = 0; k < 200; k++) + { + if (Main.npc[k].active && (Main.npc[k].type == mod.NPCType("DesertScourgeHead") || Main.npc[k].type == mod.NPCType("DesertScourgeBody") || Main.npc[k].type == mod.NPCType("DesertScourgeTail"))) + { + float num3 = Math.Abs(Main.npc[k].Center.X - center.X) + Math.Abs(Main.npc[k].Center.Y - center.Y); + if (num3 < num2) + { + num2 = num3; + position2 = Main.npc[k].position; + } + } + } + npc.position = position2; + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.LesserHealingPotion, Main.rand.Next(8, 15)); + if (Main.rand.Next(10) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DesertScourgeTrophy")); + } + if (CalamityWorld.armageddon) + { + for (int i = 0; i < 5; i++) + { + npc.DropBossBags(); + } + } + if (Main.expertMode) + { + npc.DropBossBags(); + } + else + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("VictoryShard"), Main.rand.Next(7, 15)); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Coral, Main.rand.Next(5, 10)); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Seashell, Main.rand.Next(5, 10)); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Starfish, Main.rand.Next(5, 10)); + if (Main.rand.Next(4) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SeaboundStaff")); + } + if (Main.rand.Next(4) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Barinade")); + } + if (Main.rand.Next(4) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("StormSpray")); + } + if (Main.rand.Next(4) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("AquaticDischarge")); + } + if (Main.rand.Next(7) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DesertScourgeMask")); + } + if (Main.rand.Next(15) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.HighTestFishingLine); + } + if (Main.rand.Next(15) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.AnglerTackleBag); + } + if (Main.rand.Next(15) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.TackleBox); + } + if (Main.rand.Next(10) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.AnglerEarring); + } + if (Main.rand.Next(10) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.FishermansGuide); + } + if (Main.rand.Next(10) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.WeatherRadio); + } + if (Main.rand.Next(10) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Sextant); + } + if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.AnglerHat); + } + if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.AnglerVest); + } + if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.AnglerPants); + } + if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.CratePotion, Main.rand.Next(2, 4)); + } + if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.FishingPotion, Main.rand.Next(2, 4)); + } + if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.SonarPotion, Main.rand.Next(2, 4)); + } + if (Main.rand.Next(10) == 0) + { + npc.DropItemInstanced(npc.position, npc.Size, mod.ItemType("AeroStone"), 1, true); + } + if (NPC.downedBoss3) + { + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.GoldenBugNet); + } + } + } + if (!CalamityWorld.downedDesertScourge) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 2); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge")); + } + string key = "Mods.CalamityMod.OpenSunkenSea"; + Color messageColor = Color.Aquamarine; + if (!CalamityWorld.downedDesertScourge) + { + if (Main.netMode == 0) + { + Main.NewText(Language.GetTextValue(key), messageColor); + } + else if (Main.netMode == 2) + { + NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); + } + } + CalamityWorld.downedDesertScourge = true; + if (Main.netMode == 2) + { + NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + } + } + else if (npc.type == mod.NPCType("AquaticScourgeHead")) + { + Vector2 center = Main.player[npc.target].Center; + float num2 = 1E+08f; + Vector2 position2 = npc.position; + for (int k = 0; k < 200; k++) + { + if (Main.npc[k].active && + (Main.npc[k].type == mod.NPCType("AquaticScourgeHead") || + Main.npc[k].type == mod.NPCType("AquaticScourgeBody") || + Main.npc[k].type == mod.NPCType("AquaticScourgeBodyAlt") || + Main.npc[k].type == mod.NPCType("AquaticScourgeTail"))) + { + float num3 = Math.Abs(Main.npc[k].Center.X - center.X) + Math.Abs(Main.npc[k].Center.Y - center.Y); + if (num3 < num2) + { + num2 = num3; + position2 = Main.npc[k].position; + } + } + } + npc.position = position2; + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.GreaterHealingPotion, Main.rand.Next(8, 15)); + if (Main.hardMode) + { + if (CalamityWorld.armageddon) + { + for (int i = 0; i < 5; i++) + { + npc.DropBossBags(); + } + } + if (Main.expertMode) + { + npc.DropBossBags(); + } + else + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("VictoryShard"), Main.rand.Next(11, 21)); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Coral, Main.rand.Next(5, 10)); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Seashell, Main.rand.Next(5, 10)); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Starfish, Main.rand.Next(5, 10)); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.SoulofSight, Main.rand.Next(20, 41)); + if (Main.rand.Next(4) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DeepseaStaff")); + } + if (Main.rand.Next(4) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Barinautical")); + } + if (Main.rand.Next(4) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Downpour")); + } + if (Main.rand.Next(4) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SubmarineShocker")); + } + if (Main.rand.Next(8) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.HighTestFishingLine); + } + if (Main.rand.Next(8) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.AnglerTackleBag); + } + if (Main.rand.Next(8) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.TackleBox); + } + if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.AnglerEarring); + } + if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.FishermansGuide); + } + if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.WeatherRadio); + } + if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Sextant); + } + if (Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.AnglerHat); + } + if (Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.AnglerVest); + } + if (Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.AnglerPants); + } + if (Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.CratePotion, Main.rand.Next(2, 4)); + } + if (Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.FishingPotion, Main.rand.Next(2, 4)); + } + if (Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.SonarPotion, Main.rand.Next(2, 4)); + } + if (Main.rand.Next(5) == 0) + { + npc.DropItemInstanced(npc.position, npc.Size, mod.ItemType("AeroStone"), 1, true); + } + if (Main.rand.Next(10) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.GoldenBugNet); + } + } + } + else + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("VictoryShard"), Main.rand.Next(11, 21)); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Coral, Main.rand.Next(5, 10)); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Seashell, Main.rand.Next(5, 10)); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Starfish, Main.rand.Next(5, 10)); + if (Main.rand.Next(15) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.HighTestFishingLine); + } + if (Main.rand.Next(15) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.AnglerTackleBag); + } + if (Main.rand.Next(15) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.TackleBox); + } + if (Main.rand.Next(10) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.AnglerEarring); + } + if (Main.rand.Next(10) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.FishermansGuide); + } + if (Main.rand.Next(10) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.WeatherRadio); + } + if (Main.rand.Next(10) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Sextant); + } + if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.AnglerHat); + } + if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.AnglerVest); + } + if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.AnglerPants); + } + if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.CratePotion, Main.rand.Next(2, 4)); + } + if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.FishingPotion, Main.rand.Next(2, 4)); + } + if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.SonarPotion, Main.rand.Next(2, 4)); + } + if (Main.rand.Next(10) == 0) + { + npc.DropItemInstanced(npc.position, npc.Size, mod.ItemType("AeroStone"), 1, true); + } + if (NPC.downedBoss3) + { + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.GoldenBugNet); + } + } + } + if (!CalamityWorld.downedAquaticScourge) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 4); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrenadeRounds"), 2); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ExplosiveShells")); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge27")); + } + CalamityWorld.downedAquaticScourge = true; + if (Main.netMode == 2) + { + NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + } + } + else if (npc.type == mod.NPCType("AstrumDeusHeadSpectral")) + { + Vector2 center = Main.player[npc.target].Center; + float num2 = 1E+08f; + Vector2 position2 = npc.position; + for (int k = 0; k < 200; k++) + { + if (Main.npc[k].active && (Main.npc[k].type == mod.NPCType("AstrumDeusHeadSpectral") || Main.npc[k].type == mod.NPCType("AstrumDeusBodySpectral") || Main.npc[k].type == mod.NPCType("AstrumDeusTailSpectral"))) + { + float num3 = Math.Abs(Main.npc[k].Center.X - center.X) + Math.Abs(Main.npc[k].Center.Y - center.Y); + if (num3 < num2) + { + num2 = num3; + position2 = Main.npc[k].position; + } + } + } + npc.position = position2; + string key = "Mods.CalamityMod.AstralBossText"; + Color messageColor = Color.Gold; + if (!CalamityWorld.downedStarGod) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 4); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrenadeRounds"), 2); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ExplosiveShells")); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge29")); + if (Main.netMode == 0) + { + Main.NewText(Language.GetTextValue(key), messageColor); + } + else if (Main.netMode == 2) + { + NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); + } + } + CalamityWorld.downedStarGod = true; + if (Main.netMode == 2) + { + NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + } + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.GreaterHealingPotion, Main.rand.Next(8, 15)); + if (Main.rand.Next(10) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("AstrumDeusTrophy")); + } + if (CalamityWorld.armageddon) + { + for (int i = 0; i < 5; i++) + { + npc.DropBossBags(); + } + } + if (Main.expertMode) + { + npc.DropBossBags(); + } + else + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Stardust"), Main.rand.Next(50, 81)); + if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.HallowedKey); + } + if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Starfall")); + } + if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Nebulash")); + } + if (Main.rand.Next(7) == 0) + { + npc.DropItemInstanced(npc.position, npc.Size, mod.ItemType("AstrumDeusMask"), 1, true); + } + } + } + else if (npc.type == mod.NPCType("DevourerofGodsHead")) + { + CalamityWorld.DoGSecondStageCountdown = 21600; //6 minutes + if (Main.netMode == 2) + { + var netMessage = mod.GetPacket(); + netMessage.Write((byte)CalamityModMessageType.DoGCountdownSync); + netMessage.Write(CalamityWorld.DoGSecondStageCountdown); + netMessage.Send(); + } + for (int playerIndex = 0; playerIndex < 255; playerIndex++) + { + if (Main.player[playerIndex].active) + { + Player player = Main.player[playerIndex]; + for (int l = 0; l < 22; l++) + { + int hasBuff = player.buffType[l]; + if (hasBuff == mod.BuffType("AdrenalineMode")) + { + player.DelBuff(l); + l = -1; + } + if (hasBuff == mod.BuffType("RageMode")) + { + player.DelBuff(l); + l = -1; + } + } + } + } + } + else if (npc.type == mod.NPCType("DevourerofGodsHeadS")) + { + Vector2 center = Main.player[npc.target].Center; + float num2 = 1E+08f; + Vector2 position2 = npc.position; + for (int k = 0; k < 200; k++) + { + if (Main.npc[k].active && (Main.npc[k].type == mod.NPCType("DevourerofGodsHeadS") || Main.npc[k].type == mod.NPCType("DevourerofGodsBodyS") || Main.npc[k].type == mod.NPCType("DevourerofGodsTailS"))) + { + float num3 = Math.Abs(Main.npc[k].Center.X - center.X) + Math.Abs(Main.npc[k].Center.Y - center.Y); + if (num3 < num2) + { + num2 = num3; + position2 = Main.npc[k].position; + } + } + } + npc.position = position2; + string key = "Mods.CalamityMod.DoGBossText"; + Color messageColor = Color.Cyan; + string key2 = "Mods.CalamityMod.DoGBossText2"; + Color messageColor2 = Color.Orange; + if (!CalamityWorld.downedDoG) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 6); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrenadeRounds"), 3); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ExplosiveShells"), 2); + if (Main.netMode == 0) + { + Main.NewText(Language.GetTextValue(key), messageColor); + Main.NewText(Language.GetTextValue(key2), messageColor2); + } + else if (Main.netMode == 2) + { + NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); + NetMessage.BroadcastChatMessage(NetworkText.FromKey(key2), messageColor2); + } + } + CalamityWorld.downedDoG = true; + if (Main.netMode == 2) + { + NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + } + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SupremeHealingPotion"), Main.rand.Next(8, 15)); + if (Main.rand.Next(10) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DevourerofGodsTrophy")); + } + if (CalamityWorld.armageddon) + { + for (int i = 0; i < 5; i++) + { + npc.DropBossBags(); + } + } + if (Main.expertMode) + { + npc.DropBossBags(); + } + else + { + if (Main.rand.Next(7) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DevourerofGodsMask")); + } + if (Main.rand.Next(4) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DeathhailStaff")); + } + if (Main.rand.Next(4) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Excelsus")); + } + if (Main.rand.Next(4) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TheObliterator")); + } + if (Main.rand.Next(4) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Eradicator")); + } + if (Main.rand.Next(4) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EradicatorMelee")); + } + if (Main.rand.Next(4) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Deathwind")); + } + if (Main.rand.Next(4) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("StaffoftheMechworm")); + } + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CosmiliteBar"), Main.rand.Next(25, 35)); + } + } + #endregion + #region ArmorSetLoot + if (Main.player[(int)Player.FindClosest(npc.position, npc.width, npc.height)].GetModPlayer(mod).tarraSet) + { + if (!npc.SpawnedFromStatue && (npc.damage > 5 || npc.boss) && npc.lifeMax > 100 && Main.rand.Next(5) == 0) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 58, 1, false, 0, false, false); } @@ -9461,927 +9627,810 @@ namespace CalamityMod.NPCs Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BloodOrb")); } } - if (!npc.SpawnedFromStatue && (npc.damage > 5 || npc.boss) && Main.rand.Next(12) == 0 && Main.bloodMoon && npc.HasPlayerTarget && (double)(npc.position.Y / 16f) < Main.worldSurface) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BloodOrb")); - } - #endregion - #region Thingyouwillneverget + if (!npc.SpawnedFromStatue && (npc.damage > 5 || npc.boss) && Main.rand.Next(12) == 0 && Main.bloodMoon && npc.HasPlayerTarget && (double)(npc.position.Y / 16f) < Main.worldSurface) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BloodOrb")); + } + #endregion + #region Thingyouwillneverget if (npc.type == mod.NPCType("Yharon") && Main.rand.Next(100) == 0 && npc.localAI[2] == 1f) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("YharimsCrystal")); } - #endregion - #region Legendaries - if (revenge) - { - if (npc.type == NPCID.Golem) - { - if (Main.rand.Next(100) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("AegisBlade")); - } - if (CalamityWorld.defiled) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("AegisBlade")); - } - } - } - else if (npc.type == NPCID.Plantera) - { - if (Main.rand.Next(100) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BlossomFlux")); - } - if (CalamityWorld.defiled) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BlossomFlux")); - } - } - } - else if (npc.type == NPCID.DukeFishron) - { - if (Main.rand.Next(100) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BrinyBaron")); - } - if (CalamityWorld.defiled) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BrinyBaron")); - } - } - } - else if (npc.type == mod.NPCType("PlaguebringerGoliath")) - { - if (Main.rand.Next(100) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Malachite")); - } - if (CalamityWorld.defiled) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Malachite")); - } - } - } - else if (npc.type == NPCID.DD2Betsy) - { - if (Main.rand.Next(100) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Vesuvius")); - } - if (CalamityWorld.defiled) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Vesuvius")); - } - } - } - else if (npc.type == NPCID.TheDestroyer) - { - if (Main.rand.Next(100) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SHPC")); - } - if (CalamityWorld.defiled) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SHPC")); - } - } - } - else if (npc.type == mod.NPCType("DevourerofGodsHeadS")) - { - if (Main.rand.Next(100) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CosmicDischarge")); - } - if (CalamityWorld.defiled) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CosmicDischarge")); - } - } - } - else if (npc.type == mod.NPCType("Siren")) - { - if (Main.rand.Next(100) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TheCommunity")); - } - if (CalamityWorld.defiled) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TheCommunity")); - } - } - } - } - #endregion - #region Rares - if (npc.type == NPCID.PossessedArmor) - { - if (Main.expertMode) - { - if (Main.rand.Next(150) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("PsychoticAmulet")); - } - } - else if (Main.rand.Next(200) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("PsychoticAmulet")); - } - if (CalamityWorld.defiled) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("PsychoticAmulet")); - } - } - } - else if (npc.type == NPCID.SeaSnail) - { - if (Main.expertMode) - { - if (Main.rand.Next(2) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SeaShell")); - } - } - else if (Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SeaShell")); - } - } - else if (npc.type == NPCID.GiantTortoise) - { - if (Main.expertMode) - { - if (Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GiantTortoiseShell")); - } - } - else if (Main.rand.Next(7) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GiantTortoiseShell")); - } - } - else if (npc.type == NPCID.GiantShelly || npc.type == NPCID.GiantShelly2) - { - if (Main.expertMode) - { - if (Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GiantShell")); - } - } - else if (Main.rand.Next(7) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GiantShell")); - } - } - else if (npc.type == NPCID.AnomuraFungus) - { - if (Main.expertMode) - { - if (Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("FungalCarapace")); - } - } - else if (Main.rand.Next(7) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("FungalCarapace")); - } - } - else if (npc.type == NPCID.Crawdad || npc.type == NPCID.Crawdad2) - { - if (Main.expertMode) - { - if (Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CrawCarapace")); - } - } - else if (Main.rand.Next(7) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CrawCarapace")); - } - } - else if (npc.type == NPCID.GreenJellyfish) - { - if (Main.expertMode) - { - if (Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("VitalJelly")); - } - } - else if (Main.rand.Next(7) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("VitalJelly")); - } - } - else if (npc.type == NPCID.PinkJellyfish) - { - if (Main.expertMode) - { - if (Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("LifeJelly")); - } - } - else if (Main.rand.Next(7) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("LifeJelly")); - } - } - else if (npc.type == NPCID.BlueJellyfish) - { - if (Main.expertMode) - { - if (Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ManaJelly")); - } - } - else if (Main.rand.Next(7) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ManaJelly")); - } - } - else if (npc.type == NPCID.MossHornet) - { - if (Main.expertMode) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Needler")); - } - } - else if (Main.rand.Next(25) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Needler")); - } - } - else if (npc.type == NPCID.DarkCaster) - { - if (Main.expertMode) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("AncientShiv")); - } - } - else if (Main.rand.Next(25) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("AncientShiv")); - } - } - else if (npc.type == NPCID.BigMimicCorruption || npc.type == NPCID.BigMimicCrimson || npc.type == NPCID.BigMimicHallow || npc.type == NPCID.BigMimicJungle) - { - if (Main.expertMode) - { - if (Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CelestialClaymore")); - } - } - else if (Main.rand.Next(7) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CelestialClaymore")); - } - } - else if (npc.type == NPCID.Clinger) - { - if (Main.expertMode) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CursedDagger")); - } - } - else if (Main.rand.Next(25) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CursedDagger")); - } - } - else if (npc.type == NPCID.Shark) - { - if (Main.expertMode) - { - if (Main.rand.Next(10) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DepthBlade")); - } - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.SharkToothNecklace); - } - } - else - { - if (Main.rand.Next(15) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DepthBlade")); - } - if (Main.rand.Next(30) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.SharkToothNecklace); - } - if (CalamityWorld.defiled) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.SharkToothNecklace); - } - } - } - } - else if (npc.type == NPCID.PresentMimic) - { - if (Main.expertMode) - { - if (Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("HolidayHalberd")); - } - } - else if (Main.rand.Next(7) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("HolidayHalberd")); - } - } - else if (npc.type == NPCID.IchorSticker) - { - if (Main.expertMode) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("IchorSpear")); - } - } - else if (Main.rand.Next(25) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("IchorSpear")); - } - } - else if (npc.type == NPCID.Harpy && NPC.downedBoss1) - { - if (Main.expertMode) - { - if (Main.rand.Next(30) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SkyGlaze")); - } - } - else if (Main.rand.Next(40) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SkyGlaze")); - } - if (CalamityWorld.defiled) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SkyGlaze")); - } - } - } - else if (npc.type == NPCID.Antlion || npc.type == NPCID.WalkingAntlion || npc.type == NPCID.FlyingAntlion) - { - if (Main.expertMode) - { - if (Main.rand.Next(30) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MandibleBow")); - } - if (Main.rand.Next(30) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MandibleClaws")); - } - } - else - { - if (Main.rand.Next(40) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MandibleBow")); - } - if (Main.rand.Next(40) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MandibleClaws")); - } - } - } - else if (npc.type == NPCID.MartianSaucerCore) - { - if (Main.expertMode) - { - if (Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("NullificationRifle")); - } - } - else if (Main.rand.Next(7) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("NullificationRifle")); - } - } - else if (npc.type == NPCID.Demon) - { - if (Main.expertMode) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BladecrestOathsword")); - } - } - else if (Main.rand.Next(25) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BladecrestOathsword")); - } - if (Main.expertMode) - { - if (Main.rand.Next(2) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DemonicBoneAsh")); - } - } - else if (Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DemonicBoneAsh")); - } - } - else if (npc.type == NPCID.BoneSerpentHead) - { - if (Main.expertMode) - { - if (Main.rand.Next(10) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("OldLordOathsword")); - } - } - else if (Main.rand.Next(15) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("OldLordOathsword")); - } - if (Main.expertMode) - { - if (Main.rand.Next(2) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DemonicBoneAsh")); - } - } - else if (Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DemonicBoneAsh")); - } - } - else if (npc.type == NPCID.Tim) - { - if (Main.expertMode) - { - if (Main.rand.Next(2) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("PlasmaRod")); - } - } - else if (Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("PlasmaRod")); - } - } - else if (npc.type == NPCID.GoblinSorcerer) - { - if (Main.expertMode) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("PlasmaRod")); - } - } - else if (Main.rand.Next(25) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("PlasmaRod")); - } - } - else if (npc.type == NPCID.PirateDeadeye) - { - if (Main.expertMode) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ProporsePistol")); - } - } - else if (Main.rand.Next(25) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ProporsePistol")); - } - } - else if (npc.type == NPCID.PirateCrossbower) - { - if (Main.expertMode) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("RaidersGlory")); - } - } - else if (Main.rand.Next(25) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("RaidersGlory")); - } - } - else if (npc.type == NPCID.GoblinSummoner) - { - if (Main.expertMode) - { - if (Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TheFirstShadowflame")); - } - } - else if (Main.rand.Next(7) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TheFirstShadowflame")); - } - } - else if (npc.type == NPCID.SandElemental) - { - if (Main.expertMode) - { - if (Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("WifeinaBottle")); - } - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("WifeinaBottlewithBoobs")); - } - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EssenceofCinder"), Main.rand.Next(2, 4)); - } - else - { - if (Main.rand.Next(7) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("WifeinaBottle")); - } - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EssenceofCinder"), Main.rand.Next(1, 3)); - } - } - else if (npc.type == NPCID.Skeleton || npc.type == NPCID.ArmoredSkeleton) - { - if (Main.expertMode) - { - if (Main.rand.Next(15) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Waraxe")); - } - } - else if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Waraxe")); - } - if (Main.expertMode) - { - if (Main.rand.Next(4) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("AncientBoneDust")); - } - } - else if (Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("AncientBoneDust")); - } - } - else if (npc.type == NPCID.GoblinWarrior) - { - if (Main.expertMode) - { - if (Main.rand.Next(15) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Warblade")); - } - } - else if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Warblade")); - } - } - else if (npc.type == NPCID.MartianWalker) - { - if (Main.expertMode) - { - if (Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Wingman")); - } - } - else if (Main.rand.Next(7) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Wingman")); - } - } - else if (npc.type == NPCID.GiantCursedSkull || npc.type == NPCID.NecromancerArmored || npc.type == NPCID.Necromancer) - { - if (Main.expertMode) - { - if (Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("WrathoftheAncients")); - } - } - else if (Main.rand.Next(25) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("WrathoftheAncients")); - } - } + #endregion + #region Rares + if (npc.type == NPCID.PossessedArmor) + { + if (Main.expertMode) + { + if (Main.rand.Next(150) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("PsychoticAmulet")); + } + } + else if (Main.rand.Next(200) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("PsychoticAmulet")); + } + if (CalamityWorld.defiled) + { + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("PsychoticAmulet")); + } + } + } + else if (npc.type == NPCID.SeaSnail) + { + if (Main.expertMode) + { + if (Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SeaShell")); + } + } + else if (Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SeaShell")); + } + } + else if (npc.type == NPCID.GiantTortoise) + { + if (Main.expertMode) + { + if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GiantTortoiseShell")); + } + } + else if (Main.rand.Next(7) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GiantTortoiseShell")); + } + } + else if (npc.type == NPCID.GiantShelly || npc.type == NPCID.GiantShelly2) + { + if (Main.expertMode) + { + if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GiantShell")); + } + } + else if (Main.rand.Next(7) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GiantShell")); + } + } + else if (npc.type == NPCID.AnomuraFungus) + { + if (Main.expertMode) + { + if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("FungalCarapace")); + } + } + else if (Main.rand.Next(7) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("FungalCarapace")); + } + } + else if (npc.type == NPCID.Crawdad || npc.type == NPCID.Crawdad2) + { + if (Main.expertMode) + { + if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CrawCarapace")); + } + } + else if (Main.rand.Next(7) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CrawCarapace")); + } + } + else if (npc.type == NPCID.GreenJellyfish) + { + if (Main.expertMode) + { + if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("VitalJelly")); + } + } + else if (Main.rand.Next(7) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("VitalJelly")); + } + } + else if (npc.type == NPCID.PinkJellyfish) + { + if (Main.expertMode) + { + if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("LifeJelly")); + } + } + else if (Main.rand.Next(7) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("LifeJelly")); + } + } + else if (npc.type == NPCID.BlueJellyfish) + { + if (Main.expertMode) + { + if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ManaJelly")); + } + } + else if (Main.rand.Next(7) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ManaJelly")); + } + } + else if (npc.type == NPCID.MossHornet) + { + if (Main.expertMode) + { + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Needler")); + } + } + else if (Main.rand.Next(25) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Needler")); + } + } + else if (npc.type == NPCID.DarkCaster) + { + if (Main.expertMode) + { + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("AncientShiv")); + } + } + else if (Main.rand.Next(25) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("AncientShiv")); + } + } + else if (npc.type == NPCID.BigMimicCorruption || npc.type == NPCID.BigMimicCrimson || npc.type == NPCID.BigMimicHallow || npc.type == NPCID.BigMimicJungle) + { + if (Main.expertMode) + { + if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CelestialClaymore")); + } + } + else if (Main.rand.Next(7) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CelestialClaymore")); + } + } + else if (npc.type == NPCID.Clinger) + { + if (Main.expertMode) + { + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CursedDagger")); + } + } + else if (Main.rand.Next(25) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CursedDagger")); + } + } + else if (npc.type == NPCID.Shark) + { + if (Main.expertMode) + { + if (Main.rand.Next(10) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DepthBlade")); + } + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.SharkToothNecklace); + } + } + else + { + if (Main.rand.Next(15) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DepthBlade")); + } + if (Main.rand.Next(30) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.SharkToothNecklace); + } + if (CalamityWorld.defiled) + { + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.SharkToothNecklace); + } + } + } + } + else if (npc.type == NPCID.PresentMimic) + { + if (Main.expertMode) + { + if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("HolidayHalberd")); + } + } + else if (Main.rand.Next(7) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("HolidayHalberd")); + } + } + else if (npc.type == NPCID.IchorSticker) + { + if (Main.expertMode) + { + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("IchorSpear")); + } + } + else if (Main.rand.Next(25) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("IchorSpear")); + } + } + else if (npc.type == NPCID.Harpy && NPC.downedBoss1) + { + if (Main.expertMode) + { + if (Main.rand.Next(30) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SkyGlaze")); + } + } + else if (Main.rand.Next(40) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SkyGlaze")); + } + if (CalamityWorld.defiled) + { + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SkyGlaze")); + } + } + } + else if (npc.type == NPCID.Antlion || npc.type == NPCID.WalkingAntlion || npc.type == NPCID.FlyingAntlion) + { + if (Main.expertMode) + { + if (Main.rand.Next(30) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MandibleBow")); + } + if (Main.rand.Next(30) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MandibleClaws")); + } + } + else + { + if (Main.rand.Next(40) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MandibleBow")); + } + if (Main.rand.Next(40) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MandibleClaws")); + } + } + } + else if (npc.type == NPCID.MartianSaucerCore) + { + if (Main.expertMode) + { + if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("NullificationRifle")); + } + } + else if (Main.rand.Next(7) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("NullificationRifle")); + } + } + else if (npc.type == NPCID.Demon) + { + if (Main.expertMode) + { + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BladecrestOathsword")); + } + } + else if (Main.rand.Next(25) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BladecrestOathsword")); + } + if (Main.expertMode) + { + if (Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DemonicBoneAsh")); + } + } + else if (Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DemonicBoneAsh")); + } + } + else if (npc.type == NPCID.BoneSerpentHead) + { + if (Main.expertMode) + { + if (Main.rand.Next(10) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("OldLordOathsword")); + } + } + else if (Main.rand.Next(15) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("OldLordOathsword")); + } + if (Main.expertMode) + { + if (Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DemonicBoneAsh")); + } + } + else if (Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DemonicBoneAsh")); + } + } + else if (npc.type == NPCID.Tim) + { + if (Main.expertMode) + { + if (Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("PlasmaRod")); + } + } + else if (Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("PlasmaRod")); + } + } + else if (npc.type == NPCID.GoblinSorcerer) + { + if (Main.expertMode) + { + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("PlasmaRod")); + } + } + else if (Main.rand.Next(25) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("PlasmaRod")); + } + } + else if (npc.type == NPCID.PirateDeadeye) + { + if (Main.expertMode) + { + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ProporsePistol")); + } + } + else if (Main.rand.Next(25) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ProporsePistol")); + } + } + else if (npc.type == NPCID.PirateCrossbower) + { + if (Main.expertMode) + { + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("RaidersGlory")); + } + } + else if (Main.rand.Next(25) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("RaidersGlory")); + } + } + else if (npc.type == NPCID.GoblinSummoner) + { + if (Main.expertMode) + { + if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TheFirstShadowflame")); + } + } + else if (Main.rand.Next(7) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TheFirstShadowflame")); + } + } + else if (npc.type == NPCID.SandElemental) + { + if (Main.expertMode) + { + if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("WifeinaBottle")); + } + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("WifeinaBottlewithBoobs")); + } + } + else + { + if (Main.rand.Next(7) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("WifeinaBottle")); + } + } + } + else if (npc.type == NPCID.Skeleton || npc.type == NPCID.ArmoredSkeleton) + { + if (Main.expertMode) + { + if (Main.rand.Next(15) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Waraxe")); + } + } + else if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Waraxe")); + } + if (Main.expertMode) + { + if (Main.rand.Next(4) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("AncientBoneDust")); + } + } + else if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("AncientBoneDust")); + } + } + else if (npc.type == NPCID.GoblinWarrior) + { + if (Main.expertMode) + { + if (Main.rand.Next(15) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Warblade")); + } + } + else if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Warblade")); + } + } + else if (npc.type == NPCID.MartianWalker) + { + if (Main.expertMode) + { + if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Wingman")); + } + } + else if (Main.rand.Next(7) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Wingman")); + } + } + else if (npc.type == NPCID.GiantCursedSkull || npc.type == NPCID.NecromancerArmored || npc.type == NPCID.Necromancer) + { + if (npc.type == NPCID.GiantCursedSkull) + { + if (CalamityWorld.downedLeviathan && Main.rand.Next(10) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Keelhaul")); + } + } + if (Main.expertMode) + { + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("WrathoftheAncients")); + } + } + else if (Main.rand.Next(25) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("WrathoftheAncients")); + } + } #endregion #region Commons if (npc.type == NPCID.Vulture) - { - if (Main.expertMode) - { - if (Main.rand.Next(2) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DesertFeather"), Main.rand.Next(1, 3)); - } - } - else if (Main.rand.Next(2) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DesertFeather")); - } - } + { + if (Main.expertMode) + { + if (Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DesertFeather"), Main.rand.Next(1, 3)); + } + } + else if (Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DesertFeather")); + } + } else if (CalamityMod.dungeonEnemyBuffList.Contains(npc.type)) - { - if (Main.expertMode) - { - if (Main.rand.Next(2) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Ectoblood"), Main.rand.Next(1, 3)); - } - } - else if (Main.rand.Next(2) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Ectoblood")); - } - } - else if (npc.type == NPCID.RedDevil || npc.type == NPCID.SeekerHead || npc.type == NPCID.IchorSticker) - { - if (Main.expertMode) - { - if (Main.rand.Next(2) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EssenceofChaos"), Main.rand.Next(1, 4)); - } - } - else if (Main.rand.Next(2) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EssenceofChaos"), Main.rand.Next(1, 3)); - } - } - else if (npc.type == NPCID.WyvernHead || npc.type == NPCID.AngryNimbus) - { - if (Main.expertMode) - { - if (Main.rand.Next(2) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EssenceofCinder"), Main.rand.Next(1, 4)); - } - } - else if (Main.rand.Next(2) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EssenceofCinder"), Main.rand.Next(1, 3)); - } - } + { + if (Main.expertMode) + { + if (Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Ectoblood"), Main.rand.Next(1, 3)); + } + } + else if (Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Ectoblood")); + } + } + else if (npc.type == NPCID.RedDevil) + { + if (Main.expertMode) + { + if (Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EssenceofChaos")); + } + } + else if (Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EssenceofChaos")); + } + } + else if (npc.type == NPCID.WyvernHead) + { + if (Main.expertMode) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EssenceofCinder"), Main.rand.Next(1, 3)); + } + else + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EssenceofCinder")); + } + } + else if (npc.type == NPCID.AngryNimbus) + { + if (Main.expertMode) + { + if (Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EssenceofCinder")); + } + } + else if (Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EssenceofCinder")); + } + } else if (npc.type == NPCID.IceTortoise || npc.type == NPCID.IcyMerman) - { - if (Main.expertMode) - { - if (Main.rand.Next(2) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EssenceofEleum"), Main.rand.Next(1, 4)); - } - } - else if (Main.rand.Next(2) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EssenceofEleum"), Main.rand.Next(1, 3)); - } - } + { + if (Main.expertMode) + { + if (Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EssenceofEleum")); + } + } + else if (Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EssenceofEleum")); + } + } else if (npc.type == NPCID.Plantera) - { - if (Main.expertMode) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("LivingShard"), Main.rand.Next(8, 12)); - } - else - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("LivingShard"), (Main.rand.Next(6, 10))); - } - } + { + if (!Main.expertMode) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("LivingShard"), Main.rand.Next(6, 10)); + } + } else if (npc.type == NPCID.NebulaBrain || npc.type == NPCID.NebulaSoldier || npc.type == NPCID.NebulaHeadcrab || npc.type == NPCID.NebulaBeast) - { - if (Main.expertMode) - { - if (Main.rand.Next(4) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MeldBlob"), Main.rand.Next(2, 4)); - } - } - else if (Main.rand.Next(4) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MeldBlob"), (Main.rand.Next(1, 3))); - } - } - else if (npc.type == NPCID.CultistBoss) - { - if (Main.expertMode) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MeldBlob"), Main.rand.Next(25, 31)); - if (Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("StardustStaff")); - } - } - else - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MeldBlob"), (Main.rand.Next(20, 26))); - if (Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("StardustStaff")); - } - } - } - else if (npc.type == NPCID.EyeofCthulhu) - { - if (Main.expertMode) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("VictoryShard"), Main.rand.Next(3, 6)); - if (Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TeardropCleaver")); - } - } - else - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("VictoryShard"), (Main.rand.Next(2, 5))); - if (Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TeardropCleaver")); - } - } - } - else if (npc.type == NPCID.DevourerHead || npc.type == NPCID.SeekerHead) - { - if (Main.expertMode) - { - if (Main.rand.Next(2) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("FetidEssence")); - } - } - else if (Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("FetidEssence")); - } - } - else if (npc.type == NPCID.FaceMonster || npc.type == NPCID.Herpling) - { - if (Main.expertMode) - { - if (Main.rand.Next(4) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BloodlettingEssence")); - } - } - else if (Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BloodlettingEssence")); - } - } - else if (npc.type == NPCID.ManEater) - { - if (Main.expertMode) - { - if (Main.rand.Next(2) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ManeaterBulb")); - } - } - else if (Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ManeaterBulb")); - } - } - else if (npc.type == NPCID.AngryTrapper) - { - if (Main.expertMode) - { - if (Main.rand.Next(4) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TrapperBulb")); - } - } - else if (Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TrapperBulb")); - } - } - else if (npc.type == NPCID.MotherSlime || npc.type == NPCID.Crimslime || npc.type == NPCID.CorruptSlime) - { - if (Main.expertMode) - { - if (Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MurkySludge")); - } - } - else if (Main.rand.Next(4) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MurkySludge")); - } - } - else if (npc.type == NPCID.Moth) - { - if (Main.expertMode) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GypsyPowder")); - } - else if (Main.rand.Next(2) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GypsyPowder")); - } - } - else if (npc.type == NPCID.Derpling) - { - if (Main.expertMode) - { - if (Main.rand.Next(4) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BeetleJuice")); - } - } - else if (Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BeetleJuice")); - } - } - else if (npc.type == NPCID.SpikedJungleSlime || npc.type == NPCID.Arapaima) - { - if (Main.expertMode) - { - if (Main.rand.Next(4) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MurkyPaste")); - } - } - else if (Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MurkyPaste")); - } - } + { + if (Main.expertMode) + { + if (Main.rand.Next(4) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MeldBlob"), Main.rand.Next(2, 4)); + } + } + else if (Main.rand.Next(4) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MeldBlob"), (Main.rand.Next(1, 3))); + } + } + else if (npc.type == NPCID.CultistBoss) + { + if (!Main.expertMode) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MeldBlob"), Main.rand.Next(20, 26)); + if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("StardustStaff")); + } + } + } + else if (npc.type == NPCID.EyeofCthulhu) + { + if (!Main.expertMode) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("VictoryShard"), Main.rand.Next(2, 5)); + if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TeardropCleaver")); + } + } + } + else if (npc.type == NPCID.DevourerHead || npc.type == NPCID.SeekerHead) + { + if (Main.expertMode) + { + if (Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("FetidEssence")); + } + } + else if (Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("FetidEssence")); + } + } + else if (npc.type == NPCID.FaceMonster || npc.type == NPCID.Herpling) + { + if (Main.expertMode) + { + if (Main.rand.Next(4) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BloodlettingEssence")); + } + } + else if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BloodlettingEssence")); + } + } + else if (npc.type == NPCID.ManEater) + { + if (Main.expertMode) + { + if (Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ManeaterBulb")); + } + } + else if (Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ManeaterBulb")); + } + } + else if (npc.type == NPCID.AngryTrapper) + { + if (Main.expertMode) + { + if (Main.rand.Next(4) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TrapperBulb")); + } + } + else if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TrapperBulb")); + } + } + else if (npc.type == NPCID.MotherSlime || npc.type == NPCID.Crimslime || npc.type == NPCID.CorruptSlime) + { + if (Main.expertMode) + { + if (Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MurkySludge")); + } + } + else if (Main.rand.Next(4) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MurkySludge")); + } + } + else if (npc.type == NPCID.Moth) + { + if (Main.expertMode) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GypsyPowder")); + } + else if (Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GypsyPowder")); + } + } + else if (npc.type == NPCID.Derpling) + { + if (Main.expertMode) + { + if (Main.rand.Next(4) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BeetleJuice")); + } + } + else if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BeetleJuice")); + } + } + else if (npc.type == NPCID.SpikedJungleSlime || npc.type == NPCID.Arapaima) + { + if (Main.expertMode) + { + if (Main.rand.Next(4) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MurkyPaste")); + } + } + else if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MurkyPaste")); + } + } #endregion #region Boss Specials - if (npc.boss) + if (npc.boss && !CalamityWorld.downedBossAny) { CalamityWorld.downedBossAny = true; - if (Main.netMode == 2) - { - NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); - } - } + if (Main.netMode == 2) + { + NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + } + } if (npc.type == NPCID.EaterofWorldsHead || npc.type == NPCID.EaterofWorldsBody || npc.type == NPCID.EaterofWorldsTail || npc.type == NPCID.BrainofCthulhu) { if (npc.boss) { bool downedEvil = CalamityWorld.downedWhar; CalamityWorld.downedWhar = true; - if (!downedEvil) + if (Main.netMode == 2) { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 2); - if (WorldGen.crimson) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge8")); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge11")); - } - else - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge9")); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge12")); - } + NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + } + if (!downedEvil) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 2); + if (WorldGen.crimson) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge8")); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge11")); + } + else + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge9")); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge12")); + } } } } @@ -10389,105 +10438,120 @@ namespace CalamityMod.NPCs { bool downedSkull = CalamityWorld.downedSkullHead; CalamityWorld.downedSkullHead = true; + if (Main.netMode == 2) + { + NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + } if (!downedSkull) { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 3); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrenadeRounds")); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge17")); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 3); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrenadeRounds")); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge17")); } } else if (npc.type == NPCID.WallofFlesh) { - if (CalamityWorld.checkAstralMeteor()) - { - if (!CalamityWorld.spawnAstralMeteor) - { - string key = "Mods.CalamityMod.AstralText"; - Color messageColor = Color.Gold; - if (Main.netMode == 0) - { - Main.NewText(Language.GetTextValue(key), messageColor); - } - else if (Main.netMode == 2) - { - NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); - } - CalamityWorld.spawnAstralMeteor = true; - if (Main.netMode == 2) - { - NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); - } - CalamityWorld.dropAstralMeteor(); - } - else if (Main.rand.Next(2) == 0 && !CalamityWorld.spawnAstralMeteor2) - { - string key = "Mods.CalamityMod.AstralText"; - Color messageColor = Color.Gold; - if (Main.netMode == 0) - { - Main.NewText(Language.GetTextValue(key), messageColor); - } - else if (Main.netMode == 2) - { - NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); - } - CalamityWorld.spawnAstralMeteor2 = true; - if (Main.netMode == 2) - { - NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); - } - CalamityWorld.dropAstralMeteor(); - } - else if (Main.rand.Next(4) == 0 && !CalamityWorld.spawnAstralMeteor3) - { - string key = "Mods.CalamityMod.AstralText"; - Color messageColor = Color.Gold; - if (Main.netMode == 0) - { - Main.NewText(Language.GetTextValue(key), messageColor); - } - else if (Main.netMode == 2) - { - NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); - } - CalamityWorld.spawnAstralMeteor3 = true; - if (Main.netMode == 2) - { - NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); - } - CalamityWorld.dropAstralMeteor(); - } - } - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MLGRune")); - if (Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Meowthrower")); - } - if (Main.rand.Next(8) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("RogueEmblem")); - } - if (Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.CrimsonKey); - } - if (Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.CorruptionKey); - } - bool hardMode = CalamityWorld.downedUgly; + if (CalamityWorld.checkAstralMeteor()) + { + if (!CalamityWorld.spawnAstralMeteor) + { + string key = "Mods.CalamityMod.AstralText"; + Color messageColor = Color.Gold; + if (Main.netMode == 0) + { + Main.NewText(Language.GetTextValue(key), messageColor); + } + else if (Main.netMode == 2) + { + NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); + } + CalamityWorld.spawnAstralMeteor = true; + if (Main.netMode == 2) + { + NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + } + CalamityWorld.dropAstralMeteor(); + } + else if (Main.rand.Next(2) == 0 && !CalamityWorld.spawnAstralMeteor2) + { + string key = "Mods.CalamityMod.AstralText"; + Color messageColor = Color.Gold; + if (Main.netMode == 0) + { + Main.NewText(Language.GetTextValue(key), messageColor); + } + else if (Main.netMode == 2) + { + NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); + } + CalamityWorld.spawnAstralMeteor2 = true; + if (Main.netMode == 2) + { + NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + } + CalamityWorld.dropAstralMeteor(); + } + else if (Main.rand.Next(4) == 0 && !CalamityWorld.spawnAstralMeteor3) + { + string key = "Mods.CalamityMod.AstralText"; + Color messageColor = Color.Gold; + if (Main.netMode == 0) + { + Main.NewText(Language.GetTextValue(key), messageColor); + } + else if (Main.netMode == 2) + { + NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); + } + CalamityWorld.spawnAstralMeteor3 = true; + if (Main.netMode == 2) + { + NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + } + CalamityWorld.dropAstralMeteor(); + } + } + if (!Main.expertMode) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MLGRune")); + if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Meowthrower")); + } + if (Main.rand.Next(8) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("RogueEmblem")); + } + if (Main.rand.Next(5) == 0) + { + switch (Main.rand.Next(2)) + { + case 0: + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.CrimsonKey); + break; + case 1: + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.CorruptionKey); + break; + } + } + } + bool hardMode = CalamityWorld.downedUgly; CalamityWorld.downedUgly = true; + if (Main.netMode == 2) + { + NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + } string key2 = "Mods.CalamityMod.UglyBossText"; Color messageColor2 = Color.Crimson; string key3 = "Mods.CalamityMod.UglyBossText2"; Color messageColor3 = Color.Cyan; if (!hardMode) { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 3); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrenadeRounds")); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge7")); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge18")); - if (Main.netMode == 0) + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 3); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrenadeRounds")); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge7")); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge18")); + if (Main.netMode == 0) { Main.NewText(Language.GetTextValue(key2), messageColor2); Main.NewText(Language.GetTextValue(key3), messageColor3); @@ -10502,10 +10566,14 @@ namespace CalamityMod.NPCs else if (npc.type == NPCID.SkeletronPrime || npc.type == mod.NPCType("BrimstoneElemental")) { bool downedPrime = CalamityWorld.downedSkeletor; - if (npc.type == NPCID.SkeletronPrime) - { - CalamityWorld.downedSkeletor = true; - } + if (npc.type == NPCID.SkeletronPrime) + { + CalamityWorld.downedSkeletor = true; + if (Main.netMode == 2) + { + NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + } + } string key = "Mods.CalamityMod.SteelSkullBossText"; Color messageColor = Color.Crimson; if (!downedPrime && !CalamityWorld.downedBrimstoneElemental) @@ -10519,115 +10587,129 @@ namespace CalamityMod.NPCs NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } } - if (npc.type == mod.NPCType("BrimstoneElemental")) - { - if (!CalamityWorld.downedBrimstoneElemental) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 4); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrenadeRounds"), 2); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge6")); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge26")); - } - CalamityWorld.downedBrimstoneElemental = true; - } - } + if (npc.type == mod.NPCType("BrimstoneElemental")) + { + if (!CalamityWorld.downedBrimstoneElemental) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 4); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrenadeRounds"), 2); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ExplosiveShells")); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge6")); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge26")); + } + CalamityWorld.downedBrimstoneElemental = true; + if (Main.netMode == 2) + { + NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + } + } + } else if (npc.type == NPCID.Plantera || npc.type == mod.NPCType("CalamitasRun3")) { - bool downedPlant = CalamityWorld.downedPlantThing; - if (npc.type == NPCID.Plantera) - { - if (Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.JungleKey); - } - CalamityWorld.downedPlantThing = true; - if (Main.netMode == 2) - { - NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); - } - } - string key = "Mods.CalamityMod.PlantBossText"; + bool downedPlant = CalamityWorld.downedPlantThing; + if (npc.type == NPCID.Plantera) + { + if (!Main.expertMode) + { + if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.JungleKey); + } + } + CalamityWorld.downedPlantThing = true; + if (Main.netMode == 2) + { + NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + } + } + string key = "Mods.CalamityMod.PlantBossText"; Color messageColor = Color.RoyalBlue; - string key2 = "Mods.CalamityMod.PlantOreText"; - Color messageColor2 = Color.GreenYellow; - if (npc.type == mod.NPCType("CalamitasRun3")) - { - if (!CalamityWorld.downedCalamitas && !downedPlant) - { - if (!Main.player[Main.myPlayer].dead && Main.player[Main.myPlayer].active) - { - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/WyrmScream"), - (int)Main.player[Main.myPlayer].position.X, (int)Main.player[Main.myPlayer].position.Y); - } - if (Main.netMode == 0) - { - Main.NewText(Language.GetTextValue(key), messageColor); - } - else if (Main.netMode == 2) - { - NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); - } - } - npc.DropItemInstanced(npc.position, npc.Size, ItemID.BrokenHeroSword, 1, true); - if (!CalamityWorld.downedCalamitas) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 4); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrenadeRounds"), 2); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge24")); - } - CalamityWorld.downedCalamitas = true; - if (Main.netMode == 2) - { - NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); - } - } - if (npc.type == NPCID.Plantera) - { - if (!downedPlant) - { - CalamityWorld.spawnOre(mod.TileType("PerennialOre"), 12E-05, .5f, .7f); - if (Main.netMode == 0) - { - Main.NewText(Language.GetTextValue(key2), messageColor2); - } - else if (Main.netMode == 2) - { - NetMessage.BroadcastChatMessage(NetworkText.FromKey(key2), messageColor2); - } - } - if (!downedPlant && !CalamityWorld.downedCalamitas) - { - if (!Main.player[Main.myPlayer].dead && Main.player[Main.myPlayer].active) - { - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/WyrmScream"), - (int)Main.player[Main.myPlayer].position.X, (int)Main.player[Main.myPlayer].position.Y); - } - if (Main.netMode == 0) - { - Main.NewText(Language.GetTextValue(key), messageColor); - } - else if (Main.netMode == 2) - { - NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); - } - } - } + string key2 = "Mods.CalamityMod.PlantOreText"; + Color messageColor2 = Color.GreenYellow; + if (npc.type == mod.NPCType("CalamitasRun3")) + { + if (!CalamityWorld.downedCalamitas && !downedPlant) + { + if (!Main.player[Main.myPlayer].dead && Main.player[Main.myPlayer].active) + { + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/WyrmScream"), + (int)Main.player[Main.myPlayer].position.X, (int)Main.player[Main.myPlayer].position.Y); + } + if (Main.netMode == 0) + { + Main.NewText(Language.GetTextValue(key), messageColor); + } + else if (Main.netMode == 2) + { + NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); + } + } + npc.DropItemInstanced(npc.position, npc.Size, ItemID.BrokenHeroSword, 1, true); + if (!CalamityWorld.downedCalamitas) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 4); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrenadeRounds"), 2); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ExplosiveShells")); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge24")); + } + CalamityWorld.downedCalamitas = true; + if (Main.netMode == 2) + { + NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + } + } + if (npc.type == NPCID.Plantera) + { + if (!downedPlant) + { + CalamityWorld.spawnOre(mod.TileType("PerennialOre"), 12E-05, .5f, .7f); + if (Main.netMode == 0) + { + Main.NewText(Language.GetTextValue(key2), messageColor2); + } + else if (Main.netMode == 2) + { + NetMessage.BroadcastChatMessage(NetworkText.FromKey(key2), messageColor2); + } + } + if (!downedPlant && !CalamityWorld.downedCalamitas) + { + if (!Main.player[Main.myPlayer].dead && Main.player[Main.myPlayer].active) + { + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/WyrmScream"), + (int)Main.player[Main.myPlayer].position.X, (int)Main.player[Main.myPlayer].position.Y); + } + if (Main.netMode == 0) + { + Main.NewText(Language.GetTextValue(key), messageColor); + } + else if (Main.netMode == 2) + { + NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); + } + } + } } else if (npc.type == NPCID.Golem) { bool downedIdiot = CalamityWorld.downedGolemBaby; CalamityWorld.downedGolemBaby = true; + if (Main.netMode == 2) + { + NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + } string key = "Mods.CalamityMod.BabyBossText"; Color messageColor = Color.Lime; string key2 = "Mods.CalamityMod.BabyBossText2"; Color messageColor2 = Color.Yellow; if (!downedIdiot) { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 4); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrenadeRounds"), 2); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge31")); - npc.DropItemInstanced(npc.position, npc.Size, ItemID.Picksaw, 1, true); - if (Main.netMode == 0) + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 4); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrenadeRounds"), 2); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ExplosiveShells")); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge31")); + npc.DropItemInstanced(npc.position, npc.Size, ItemID.Picksaw, 1, true); + if (Main.netMode == 0) { Main.NewText(Language.GetTextValue(key), messageColor); Main.NewText(Language.GetTextValue(key2), messageColor2); @@ -10643,55 +10725,57 @@ namespace CalamityMod.NPCs { bool downedMoonDude = CalamityWorld.downedMoonDude; CalamityWorld.downedMoonDude = true; - if (Main.netMode == 2) - { - NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); - } - string key = "Mods.CalamityMod.MoonBossText"; + if (Main.netMode == 2) + { + NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + } + string key = "Mods.CalamityMod.MoonBossText"; Color messageColor = Color.Orange; string key2 = "Mods.CalamityMod.MoonBossText2"; Color messageColor2 = Color.Violet; string key3 = "Mods.CalamityMod.MoonBossText3"; Color messageColor3 = Color.Crimson; - string key4 = "Mods.CalamityMod.ProfanedBossText2"; - Color messageColor4 = Color.Cyan; - string key5 = "Mods.CalamityMod.FutureOreText"; - Color messageColor5 = Color.LightGray; - if (!downedMoonDude) + string key4 = "Mods.CalamityMod.ProfanedBossText2"; + Color messageColor4 = Color.Cyan; + string key5 = "Mods.CalamityMod.FutureOreText"; + Color messageColor5 = Color.LightGray; + if (!downedMoonDude) { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 5); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrenadeRounds"), 2); - CalamityWorld.spawnOre(mod.TileType("ExodiumOre"), 12E-05, .01f, .07f); - if (Main.netMode == 0) + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 5); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrenadeRounds"), 2); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ExplosiveShells")); + CalamityWorld.spawnOre(mod.TileType("ExodiumOre"), 12E-05, .01f, .07f); + if (Main.netMode == 0) { Main.NewText(Language.GetTextValue(key), messageColor); Main.NewText(Language.GetTextValue(key2), messageColor2); Main.NewText(Language.GetTextValue(key3), messageColor3); - Main.NewText(Language.GetTextValue(key4), messageColor4); - Main.NewText(Language.GetTextValue(key5), messageColor5); - } + Main.NewText(Language.GetTextValue(key4), messageColor4); + Main.NewText(Language.GetTextValue(key5), messageColor5); + } else if (Main.netMode == 2) { NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); NetMessage.BroadcastChatMessage(NetworkText.FromKey(key2), messageColor2); NetMessage.BroadcastChatMessage(NetworkText.FromKey(key3), messageColor3); - NetMessage.BroadcastChatMessage(NetworkText.FromKey(key4), messageColor4); - NetMessage.BroadcastChatMessage(NetworkText.FromKey(key5), messageColor5); - } + NetMessage.BroadcastChatMessage(NetworkText.FromKey(key4), messageColor4); + NetMessage.BroadcastChatMessage(NetworkText.FromKey(key5), messageColor5); + } } - if (Main.expertMode) - { - npc.DropItemInstanced(npc.position, npc.Size, mod.ItemType("MLGRune2"), 1, true); - } } else if (npc.type == NPCID.DD2Betsy) { - if (!CalamityWorld.downedBetsy) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 4); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrenadeRounds"), 2); - } + if (!CalamityWorld.downedBetsy) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 4); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrenadeRounds"), 2); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ExplosiveShells")); + } CalamityWorld.downedBetsy = true; + if (Main.netMode == 2) + { + NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + } } else if (npc.type == NPCID.Pumpking && CalamityWorld.downedDoG) { @@ -10704,650 +10788,684 @@ namespace CalamityMod.NPCs else if (npc.type == NPCID.Mothron && CalamityWorld.buffedEclipse) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DarksunFragment"), Main.rand.Next(10, 21)); - CalamityWorld.downedBuffedMothron = true; - if (Main.netMode == 2) - { - NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); - } - } + CalamityWorld.downedBuffedMothron = true; + if (Main.netMode == 2) + { + NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + } + } else if (npc.type == mod.NPCType("Astrageldon")) { - if (CalamityWorld.checkAstralMeteor()) - { - string key = "Mods.CalamityMod.AstralText"; - Color messageColor = Color.Gold; - if (Main.netMode == 0) - { - Main.NewText(Language.GetTextValue(key), messageColor); - } - else if (Main.netMode == 2) - { - NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); - } - CalamityWorld.dropAstralMeteor(); - } - if (!CalamityWorld.downedAstrageldon) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 4); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrenadeRounds"), 2); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge30")); - } - CalamityWorld.downedAstrageldon = true; - } - else if (npc.type == NPCID.KingSlime) - { - if (revenge) - { - npc.DropItemInstanced(npc.position, npc.Size, mod.ItemType("CrownJewel"), 1, true); - } - } - else if (npc.type == NPCID.EyeofCthulhu) - { - if (revenge) + if (CalamityWorld.checkAstralMeteor()) { - npc.DropItemInstanced(npc.position, npc.Size, mod.ItemType("CounterScarf"), 1, true); - } + string key = "Mods.CalamityMod.AstralText"; + Color messageColor = Color.Gold; + if (Main.netMode == 0) + { + Main.NewText(Language.GetTextValue(key), messageColor); + } + else if (Main.netMode == 2) + { + NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); + } + CalamityWorld.dropAstralMeteor(); + } + if (!CalamityWorld.downedAstrageldon) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 4); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrenadeRounds"), 2); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ExplosiveShells")); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge30")); + } + CalamityWorld.downedAstrageldon = true; + if (Main.netMode == 2) + { + NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + } } else if (npc.type == mod.NPCType("HiveMindP2")) //boss 2 { - if (!CalamityWorld.downedHiveMind) - { - if (!CalamityWorld.downedPerforator) - { - string key = "Mods.CalamityMod.SkyOreText"; - Color messageColor = Color.Cyan; - CalamityWorld.spawnOre(mod.TileType("AerialiteOre"), 12E-05, .4f, .6f); - if (Main.netMode == 0) - { - Main.NewText(Language.GetTextValue(key), messageColor); - } - else if (Main.netMode == 2) - { - NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); - } - } - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 2); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge14")); - } - CalamityWorld.downedHiveMind = true; - if (Main.netMode == 2) - { - NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); - } - } + if (!CalamityWorld.downedHiveMind) + { + if (!CalamityWorld.downedPerforator) + { + string key = "Mods.CalamityMod.SkyOreText"; + Color messageColor = Color.Cyan; + CalamityWorld.spawnOre(mod.TileType("AerialiteOre"), 12E-05, .4f, .6f); + if (Main.netMode == 0) + { + Main.NewText(Language.GetTextValue(key), messageColor); + } + else if (Main.netMode == 2) + { + NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); + } + } + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 2); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge14")); + } + CalamityWorld.downedHiveMind = true; + if (Main.netMode == 2) + { + NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + } + } else if (npc.type == mod.NPCType("PerforatorHive")) //boss 3 { - if (!CalamityWorld.downedPerforator) - { - if (!CalamityWorld.downedHiveMind) - { - string key = "Mods.CalamityMod.SkyOreText"; - Color messageColor = Color.Cyan; - CalamityWorld.spawnOre(mod.TileType("AerialiteOre"), 12E-05, .4f, .6f); - if (Main.netMode == 0) - { - Main.NewText(Language.GetTextValue(key), messageColor); - } - else if (Main.netMode == 2) - { - NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); - } - } - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 2); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge13")); - } + if (!CalamityWorld.downedPerforator) + { + if (!CalamityWorld.downedHiveMind) + { + string key = "Mods.CalamityMod.SkyOreText"; + Color messageColor = Color.Cyan; + CalamityWorld.spawnOre(mod.TileType("AerialiteOre"), 12E-05, .4f, .6f); + if (Main.netMode == 0) + { + Main.NewText(Language.GetTextValue(key), messageColor); + } + else if (Main.netMode == 2) + { + NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); + } + } + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 2); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge13")); + } CalamityWorld.downedPerforator = true; - if (Main.netMode == 2) - { - NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); - } - } + if (Main.netMode == 2) + { + NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + } + } else if (npc.type == mod.NPCType("SlimeGodCore") || npc.type == mod.NPCType("SlimeGodSplit") || npc.type == mod.NPCType("SlimeGodRunSplit")) //boss 4 { - if (npc.type == mod.NPCType("SlimeGodCore") && !NPC.AnyNPCs(mod.NPCType("SlimeGodSplit")) && !NPC.AnyNPCs(mod.NPCType("SlimeGodRunSplit")) - && !NPC.AnyNPCs(mod.NPCType("SlimeGod")) && !NPC.AnyNPCs(mod.NPCType("SlimeGodRun"))) - { - if (!CalamityWorld.downedSlimeGod) - { - if (revenge && !Main.player[(int)Player.FindClosest(npc.position, npc.width, npc.height)].GetModPlayer(mod).revJamDrop) - { - npc.DropItemInstanced(npc.position, npc.Size, mod.ItemType("PurifiedJam"), Main.rand.Next(6, 9), true); - Main.player[(int)Player.FindClosest(npc.position, npc.width, npc.height)].GetModPlayer(mod).revJamDrop = true; - } - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 3); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrenadeRounds")); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge15")); - } - if (Main.rand.Next(10) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SlimeGodTrophy")); - } - if (CalamityWorld.armageddon) - { - for (int i = 0; i < 10; i++) - { - npc.DropBossBags(); - } - } - if (Main.expertMode) - { - npc.DropBossBags(); - } - else - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("StaticRefiner")); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("PurifiedGel"), Main.rand.Next(25, 41)); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Gel, Main.rand.Next(180, 251)); - int maskChoice = Main.rand.Next(2); - if (Main.rand.Next(4) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("OverloadedBlaster")); - } - if (Main.rand.Next(4) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GelDart"), Main.rand.Next(80, 101)); - } - if (Main.rand.Next(7) == 0) - { - if (maskChoice == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SlimeGodMask")); - } - else - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SlimeGodMask2")); - } - } - if (Main.rand.Next(4) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("AbyssalTome")); - } - if (Main.rand.Next(4) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EldritchTome")); - } - if (Main.rand.Next(4) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CrimslimeStaff")); - } - if (Main.rand.Next(4) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CorroslimeStaff")); - } - } - CalamityWorld.downedSlimeGod = true; - if (Main.netMode == 2) - { - NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); - } - } - else if (npc.type == mod.NPCType("SlimeGodSplit") && !NPC.AnyNPCs(mod.NPCType("SlimeGodCore")) && !NPC.AnyNPCs(mod.NPCType("SlimeGodRunSplit")) && - NPC.CountNPCS(mod.NPCType("SlimeGodSplit")) < 2 && !NPC.AnyNPCs(mod.NPCType("SlimeGodRun"))) - { - if (!CalamityWorld.downedSlimeGod) - { - if (revenge && !Main.player[(int)Player.FindClosest(npc.position, npc.width, npc.height)].GetModPlayer(mod).revJamDrop) - { - npc.DropItemInstanced(npc.position, npc.Size, mod.ItemType("PurifiedJam"), Main.rand.Next(6, 9), true); - Main.player[(int)Player.FindClosest(npc.position, npc.width, npc.height)].GetModPlayer(mod).revJamDrop = true; - } - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 3); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrenadeRounds")); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge15")); - } - if (Main.rand.Next(10) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SlimeGodTrophy")); - } - if (CalamityWorld.armageddon) - { - for (int i = 0; i < 10; i++) - { - npc.DropBossBags(); - } - } - if (Main.expertMode) - { - npc.DropBossBags(); - } - else - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("StaticRefiner")); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("PurifiedGel"), Main.rand.Next(25, 41)); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Gel, Main.rand.Next(180, 251)); - int maskChoice = Main.rand.Next(2); - if (Main.rand.Next(4) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("OverloadedBlaster")); - } - if (Main.rand.Next(4) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GelDart"), Main.rand.Next(80, 101)); - } - if (Main.rand.Next(7) == 0) - { - if (maskChoice == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SlimeGodMask")); - } - else - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SlimeGodMask2")); - } - } - if (Main.rand.Next(4) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("AbyssalTome")); - } - if (Main.rand.Next(4) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EldritchTome")); - } - if (Main.rand.Next(4) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CrimslimeStaff")); - } - if (Main.rand.Next(4) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CorroslimeStaff")); - } - } - CalamityWorld.downedSlimeGod = true; - if (Main.netMode == 2) - { - NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); - } - } - else if (npc.type == mod.NPCType("SlimeGodRunSplit") && !NPC.AnyNPCs(mod.NPCType("SlimeGodCore")) && !NPC.AnyNPCs(mod.NPCType("SlimeGodSplit")) && - NPC.CountNPCS(mod.NPCType("SlimeGodRunSplit")) < 2 && !NPC.AnyNPCs(mod.NPCType("SlimeGod"))) - { - if (!CalamityWorld.downedSlimeGod) - { - if (revenge && !Main.player[(int)Player.FindClosest(npc.position, npc.width, npc.height)].GetModPlayer(mod).revJamDrop) - { - npc.DropItemInstanced(npc.position, npc.Size, mod.ItemType("PurifiedJam"), Main.rand.Next(6, 9), true); - Main.player[(int)Player.FindClosest(npc.position, npc.width, npc.height)].GetModPlayer(mod).revJamDrop = true; - } - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 3); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrenadeRounds")); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge15")); - } - if (Main.rand.Next(10) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SlimeGodTrophy")); - } - if (CalamityWorld.armageddon) - { - for (int i = 0; i < 10; i++) - { - npc.DropBossBags(); - } - } - if (Main.expertMode) - { - npc.DropBossBags(); - } - else - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("StaticRefiner")); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("PurifiedGel"), Main.rand.Next(25, 41)); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Gel, Main.rand.Next(180, 251)); - int maskChoice = Main.rand.Next(2); - if (Main.rand.Next(4) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("OverloadedBlaster")); - } - if (Main.rand.Next(4) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GelDart"), Main.rand.Next(80, 101)); - } - if (Main.rand.Next(7) == 0) - { - if (maskChoice == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SlimeGodMask")); - } - else - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SlimeGodMask2")); - } - } - if (Main.rand.Next(4) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("AbyssalTome")); - } - if (Main.rand.Next(4) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EldritchTome")); - } - if (Main.rand.Next(4) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CrimslimeStaff")); - } - if (Main.rand.Next(4) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CorroslimeStaff")); - } - } - CalamityWorld.downedSlimeGod = true; - if (Main.netMode == 2) - { - NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); - } - } - } + if (npc.type == mod.NPCType("SlimeGodCore") && !NPC.AnyNPCs(mod.NPCType("SlimeGodSplit")) && !NPC.AnyNPCs(mod.NPCType("SlimeGodRunSplit")) + && !NPC.AnyNPCs(mod.NPCType("SlimeGod")) && !NPC.AnyNPCs(mod.NPCType("SlimeGodRun"))) + { + if (!CalamityWorld.downedSlimeGod) + { + if (revenge && !Main.player[(int)Player.FindClosest(npc.position, npc.width, npc.height)].GetModPlayer(mod).revJamDrop) + { + npc.DropItemInstanced(npc.position, npc.Size, mod.ItemType("PurifiedJam"), Main.rand.Next(6, 9), true); + Main.player[(int)Player.FindClosest(npc.position, npc.width, npc.height)].GetModPlayer(mod).revJamDrop = true; + } + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 3); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrenadeRounds")); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge15")); + } + if (Main.rand.Next(10) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SlimeGodTrophy")); + } + if (CalamityWorld.armageddon) + { + for (int i = 0; i < 5; i++) + { + npc.DropBossBags(); + } + } + if (Main.expertMode) + { + npc.DropBossBags(); + } + else + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("StaticRefiner")); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("PurifiedGel"), Main.rand.Next(25, 41)); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Gel, Main.rand.Next(180, 251)); + int maskChoice = Main.rand.Next(2); + if (Main.rand.Next(4) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("OverloadedBlaster")); + } + if (Main.rand.Next(4) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GelDart"), Main.rand.Next(80, 101)); + } + if (Main.rand.Next(7) == 0) + { + if (maskChoice == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SlimeGodMask")); + } + else + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SlimeGodMask2")); + } + } + if (Main.rand.Next(4) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("AbyssalTome")); + } + if (Main.rand.Next(4) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EldritchTome")); + } + if (Main.rand.Next(4) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CrimslimeStaff")); + } + if (Main.rand.Next(4) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CorroslimeStaff")); + } + } + CalamityWorld.downedSlimeGod = true; + if (Main.netMode == 2) + { + NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + } + } + else if (npc.type == mod.NPCType("SlimeGodSplit") && !NPC.AnyNPCs(mod.NPCType("SlimeGodCore")) && !NPC.AnyNPCs(mod.NPCType("SlimeGodRunSplit")) && + NPC.CountNPCS(mod.NPCType("SlimeGodSplit")) < 2 && !NPC.AnyNPCs(mod.NPCType("SlimeGodRun"))) + { + if (!CalamityWorld.downedSlimeGod) + { + if (revenge && !Main.player[(int)Player.FindClosest(npc.position, npc.width, npc.height)].GetModPlayer(mod).revJamDrop) + { + npc.DropItemInstanced(npc.position, npc.Size, mod.ItemType("PurifiedJam"), Main.rand.Next(6, 9), true); + Main.player[(int)Player.FindClosest(npc.position, npc.width, npc.height)].GetModPlayer(mod).revJamDrop = true; + } + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 3); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrenadeRounds")); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge15")); + } + if (Main.rand.Next(10) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SlimeGodTrophy")); + } + if (CalamityWorld.armageddon) + { + for (int i = 0; i < 5; i++) + { + npc.DropBossBags(); + } + } + if (Main.expertMode) + { + npc.DropBossBags(); + } + else + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("StaticRefiner")); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("PurifiedGel"), Main.rand.Next(25, 41)); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Gel, Main.rand.Next(180, 251)); + int maskChoice = Main.rand.Next(2); + if (Main.rand.Next(4) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("OverloadedBlaster")); + } + if (Main.rand.Next(4) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GelDart"), Main.rand.Next(80, 101)); + } + if (Main.rand.Next(7) == 0) + { + if (maskChoice == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SlimeGodMask")); + } + else + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SlimeGodMask2")); + } + } + if (Main.rand.Next(4) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("AbyssalTome")); + } + if (Main.rand.Next(4) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EldritchTome")); + } + if (Main.rand.Next(4) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CrimslimeStaff")); + } + if (Main.rand.Next(4) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CorroslimeStaff")); + } + } + CalamityWorld.downedSlimeGod = true; + if (Main.netMode == 2) + { + NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + } + } + else if (npc.type == mod.NPCType("SlimeGodRunSplit") && !NPC.AnyNPCs(mod.NPCType("SlimeGodCore")) && !NPC.AnyNPCs(mod.NPCType("SlimeGodSplit")) && + NPC.CountNPCS(mod.NPCType("SlimeGodRunSplit")) < 2 && !NPC.AnyNPCs(mod.NPCType("SlimeGod"))) + { + if (!CalamityWorld.downedSlimeGod) + { + if (revenge && !Main.player[(int)Player.FindClosest(npc.position, npc.width, npc.height)].GetModPlayer(mod).revJamDrop) + { + npc.DropItemInstanced(npc.position, npc.Size, mod.ItemType("PurifiedJam"), Main.rand.Next(6, 9), true); + Main.player[(int)Player.FindClosest(npc.position, npc.width, npc.height)].GetModPlayer(mod).revJamDrop = true; + } + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 3); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrenadeRounds")); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge15")); + } + if (Main.rand.Next(10) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SlimeGodTrophy")); + } + if (CalamityWorld.armageddon) + { + for (int i = 0; i < 5; i++) + { + npc.DropBossBags(); + } + } + if (Main.expertMode) + { + npc.DropBossBags(); + } + else + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("StaticRefiner")); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("PurifiedGel"), Main.rand.Next(25, 41)); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Gel, Main.rand.Next(180, 251)); + int maskChoice = Main.rand.Next(2); + if (Main.rand.Next(4) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("OverloadedBlaster")); + } + if (Main.rand.Next(4) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GelDart"), Main.rand.Next(80, 101)); + } + if (Main.rand.Next(7) == 0) + { + if (maskChoice == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SlimeGodMask")); + } + else + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SlimeGodMask2")); + } + } + if (Main.rand.Next(4) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("AbyssalTome")); + } + if (Main.rand.Next(4) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EldritchTome")); + } + if (Main.rand.Next(4) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CrimslimeStaff")); + } + if (Main.rand.Next(4) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CorroslimeStaff")); + } + } + CalamityWorld.downedSlimeGod = true; + if (Main.netMode == 2) + { + NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + } + } + } else if (npc.type == mod.NPCType("Cryogen")) //boss 5 { - if (!CalamityWorld.downedCryogen) - { - string key = "Mods.CalamityMod.IceOreText"; - Color messageColor = Color.LightSkyBlue; - CalamityWorld.spawnOre(mod.TileType("CryonicOre"), 15E-05, .45f, .65f); - if (Main.netMode == 0) - { - Main.NewText(Language.GetTextValue(key), messageColor); - } - else if (Main.netMode == 2) - { - NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); - } - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 4); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrenadeRounds"), 2); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge19")); - } - CalamityWorld.downedCryogen = true; - if (Main.netMode == 2) - { - NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); - } - } + if (!CalamityWorld.downedCryogen) + { + string key = "Mods.CalamityMod.IceOreText"; + Color messageColor = Color.LightSkyBlue; + CalamityWorld.spawnOre(mod.TileType("CryonicOre"), 15E-05, .45f, .65f); + if (Main.netMode == 0) + { + Main.NewText(Language.GetTextValue(key), messageColor); + } + else if (Main.netMode == 2) + { + NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); + } + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 4); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrenadeRounds"), 2); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ExplosiveShells")); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge19")); + } + CalamityWorld.downedCryogen = true; + if (Main.netMode == 2) + { + NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + } + } else if (npc.type == mod.NPCType("Siren") || npc.type == mod.NPCType("Leviathan")) //boss 8 { int bossType = (npc.type == mod.NPCType("Siren")) ? mod.NPCType("Leviathan") : mod.NPCType("Siren"); if (!NPC.AnyNPCs(bossType)) { - if (!CalamityWorld.downedLeviathan) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 4); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrenadeRounds"), 2); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge10")); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge28")); - } - CalamityWorld.downedLeviathan = true; + if (!CalamityWorld.downedLeviathan) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 4); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrenadeRounds"), 2); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ExplosiveShells")); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge10")); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge28")); + } + CalamityWorld.downedLeviathan = true; + if (Main.netMode == 2) + { + NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + } } } else if (npc.type == mod.NPCType("PlaguebringerGoliath")) //boss 9 { - if (!CalamityWorld.downedPlaguebringer) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 4); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrenadeRounds"), 2); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge32")); - } - CalamityWorld.downedPlaguebringer = true; + if (!CalamityWorld.downedPlaguebringer) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 4); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrenadeRounds"), 2); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ExplosiveShells")); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge32")); + } + CalamityWorld.downedPlaguebringer = true; + if (Main.netMode == 2) + { + NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + } } else if (npc.type == mod.NPCType("ProfanedGuardianBoss")) //boss 10 { - if (!CalamityWorld.downedGuardians) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 5); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrenadeRounds"), 2); - } + if (!CalamityWorld.downedGuardians) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 5); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrenadeRounds"), 2); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ExplosiveShells")); + } CalamityWorld.downedGuardians = true; + if (Main.netMode == 2) + { + NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + } } else if (npc.type == mod.NPCType("Providence")) //boss 11 { string key2 = "Mods.CalamityMod.ProfanedBossText3"; Color messageColor2 = Color.Orange; - string key3 = "Mods.CalamityMod.TreeOreText"; - Color messageColor3 = Color.LightGreen; - if (!CalamityWorld.downedProvidence) + string key3 = "Mods.CalamityMod.TreeOreText"; + Color messageColor3 = Color.LightGreen; + if (!CalamityWorld.downedProvidence) { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 5); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrenadeRounds"), 2); - CalamityWorld.spawnOre(mod.TileType("UelibloomOre"), 15E-05, .4f, .8f); - if (Main.netMode == 0) + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 5); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrenadeRounds"), 2); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ExplosiveShells")); + CalamityWorld.spawnOre(mod.TileType("UelibloomOre"), 15E-05, .4f, .8f); + if (Main.netMode == 0) { Main.NewText(Language.GetTextValue(key2), messageColor2); - Main.NewText(Language.GetTextValue(key3), messageColor3); - } + Main.NewText(Language.GetTextValue(key3), messageColor3); + } else if (Main.netMode == 2) { NetMessage.BroadcastChatMessage(NetworkText.FromKey(key2), messageColor2); - NetMessage.BroadcastChatMessage(NetworkText.FromKey(key3), messageColor3); - } + NetMessage.BroadcastChatMessage(NetworkText.FromKey(key3), messageColor3); + } } CalamityWorld.downedProvidence = true; - if (Main.netMode == 2) - { - NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); - } - } + if (Main.netMode == 2) + { + NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + } + } else if (npc.type == mod.NPCType("CeaselessVoid")) //boss 12 { - if (!CalamityWorld.downedSentinel1) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 5); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrenadeRounds"), 2); - } + if (!CalamityWorld.downedSentinel1) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 5); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrenadeRounds"), 2); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ExplosiveShells")); + } CalamityWorld.downedSentinel1 = true; //21600 - if (CalamityWorld.DoGSecondStageCountdown > 14460) - { - CalamityWorld.DoGSecondStageCountdown = 14460; - if (Main.netMode == 2) - { - var netMessage = mod.GetPacket(); - netMessage.Write((byte)CalamityModMessageType.DoGCountdownSync); - netMessage.Write(CalamityWorld.DoGSecondStageCountdown); - netMessage.Send(); - } - } - if (Main.netMode == 2) - { - NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); - } - } + if (CalamityWorld.DoGSecondStageCountdown > 14460) + { + CalamityWorld.DoGSecondStageCountdown = 14460; + if (Main.netMode == 2) + { + var netMessage = mod.GetPacket(); + netMessage.Write((byte)CalamityModMessageType.DoGCountdownSync); + netMessage.Write(CalamityWorld.DoGSecondStageCountdown); + netMessage.Send(); + } + } + if (Main.netMode == 2) + { + NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + } + } else if (npc.type == mod.NPCType("StormWeaverHeadNaked")) //boss 13 { - if (!CalamityWorld.downedSentinel2) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 5); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrenadeRounds"), 2); - } + if (!CalamityWorld.downedSentinel2) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 5); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrenadeRounds"), 2); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ExplosiveShells")); + } CalamityWorld.downedSentinel2 = true; //21600 - if (CalamityWorld.DoGSecondStageCountdown > 7260) - { - CalamityWorld.DoGSecondStageCountdown = 7260; - if (Main.netMode == 2) - { - var netMessage = mod.GetPacket(); - netMessage.Write((byte)CalamityModMessageType.DoGCountdownSync); - netMessage.Write(CalamityWorld.DoGSecondStageCountdown); - netMessage.Send(); - } - } - if (Main.netMode == 2) - { - NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); - } - } + if (CalamityWorld.DoGSecondStageCountdown > 7260) + { + CalamityWorld.DoGSecondStageCountdown = 7260; + if (Main.netMode == 2) + { + var netMessage = mod.GetPacket(); + netMessage.Write((byte)CalamityModMessageType.DoGCountdownSync); + netMessage.Write(CalamityWorld.DoGSecondStageCountdown); + netMessage.Send(); + } + } + if (Main.netMode == 2) + { + NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + } + } else if (npc.type == mod.NPCType("CosmicWraith")) //boss 14 { - if (!CalamityWorld.downedSentinel3) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 5); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrenadeRounds"), 2); - } - CalamityWorld.downedSentinel3 = true; //21600 - if (CalamityWorld.DoGSecondStageCountdown > 600) - { - CalamityWorld.DoGSecondStageCountdown = 600; - if (Main.netMode == 2) - { - var netMessage = mod.GetPacket(); - netMessage.Write((byte)CalamityModMessageType.DoGCountdownSync); - netMessage.Write(CalamityWorld.DoGSecondStageCountdown); - netMessage.Send(); - } - } - if (Main.netMode == 2) - { - NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); - } - } + if (!CalamityWorld.downedSentinel3) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 5); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrenadeRounds"), 2); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ExplosiveShells")); + } + CalamityWorld.downedSentinel3 = true; //21600 + if (CalamityWorld.DoGSecondStageCountdown > 600) + { + CalamityWorld.DoGSecondStageCountdown = 600; + if (Main.netMode == 2) + { + var netMessage = mod.GetPacket(); + netMessage.Write((byte)CalamityModMessageType.DoGCountdownSync); + netMessage.Write(CalamityWorld.DoGSecondStageCountdown); + netMessage.Send(); + } + } + if (Main.netMode == 2) + { + NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + } + } else if (npc.type == mod.NPCType("Bumblefuck")) //boss 16 { - if (!CalamityWorld.downedBumble) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 5); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrenadeRounds"), 2); - } + if (!CalamityWorld.downedBumble) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 5); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrenadeRounds"), 2); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ExplosiveShells")); + } CalamityWorld.downedBumble = true; - if (revenge) - { - npc.DropItemInstanced(npc.position, npc.Size, mod.ItemType("RedLightningContainer"), 1, true); - } - } + if (Main.netMode == 2) + { + NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + } + } else if (npc.type == mod.NPCType("Yharon")) //boss 17 { string key = "Mods.CalamityMod.DargonBossText"; Color messageColor = Color.Orange; - string key2 = "Mods.CalamityMod.AuricOreText"; - Color messageColor2 = Color.Gold; - if (!CalamityWorld.downedYharon && npc.localAI[2] == 1f) + string key2 = "Mods.CalamityMod.AuricOreText"; + Color messageColor2 = Color.Gold; + if (!CalamityWorld.downedYharon && npc.localAI[2] == 1f) { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 6); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrenadeRounds"), 3); - CalamityWorld.spawnOre(mod.TileType("AuricOre"), 2E-05, .6f, .8f); - if (Main.netMode == 0) + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 6); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrenadeRounds"), 3); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ExplosiveShells"), 2); + CalamityWorld.spawnOre(mod.TileType("AuricOre"), 2E-05, .6f, .8f); + if (Main.netMode == 0) { - Main.NewText(Language.GetTextValue(key2), messageColor2); - } + Main.NewText(Language.GetTextValue(key2), messageColor2); + } else if (Main.netMode == 2) { - NetMessage.BroadcastChatMessage(NetworkText.FromKey(key2), messageColor2); - } + NetMessage.BroadcastChatMessage(NetworkText.FromKey(key2), messageColor2); + } + } + if (npc.localAI[2] == 1f) + { + CalamityWorld.downedYharon = true; + if (Main.netMode == 2) + { + NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + } + } + if (!CalamityWorld.buffedEclipse && npc.localAI[2] != 2f) + { + CalamityWorld.buffedEclipse = true; + if (Main.netMode == 2) + { + NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + } + if (Main.netMode == 0) + { + Main.NewText(Language.GetTextValue(key), messageColor); + } + else if (Main.netMode == 2) + { + NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); + } } - if (npc.localAI[2] == 1f) - { - CalamityWorld.downedYharon = true; - if (Main.netMode == 2) - { - NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); - } - } - if (!CalamityWorld.buffedEclipse && npc.localAI[2] != 2f) - { - CalamityWorld.buffedEclipse = true; - if (Main.netMode == 2) - { - NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); - } - if (Main.netMode == 0) - { - Main.NewText(Language.GetTextValue(key), messageColor); - } - else if (Main.netMode == 2) - { - NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); - } - } - } - else if (npc.type == mod.NPCType("SupremeCalamitas")) //boss 18 - { - if (!CalamityWorld.downedSCal) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 6); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrenadeRounds"), 3); - } - CalamityWorld.downedSCal = true; } - else if (npc.type == mod.NPCType("CrabulonIdle")) //boss 19 + else if (npc.type == mod.NPCType("SupremeCalamitas")) //boss 18 { - if (!CalamityWorld.downedCrabulon) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 2); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge5")); - } + if (!CalamityWorld.downedSCal) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 6); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrenadeRounds"), 3); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ExplosiveShells"), 2); + } + CalamityWorld.downedSCal = true; + if (Main.netMode == 2) + { + NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + } + } + else if (npc.type == mod.NPCType("CrabulonIdle")) //boss 19 + { + if (!CalamityWorld.downedCrabulon) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 2); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge5")); + } CalamityWorld.downedCrabulon = true; + if (Main.netMode == 2) + { + NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + } } else if (npc.type == mod.NPCType("ScavengerBody")) //boss 20 { - if (!CalamityWorld.downedScavenger) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 4); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrenadeRounds"), 2); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge33")); - } - CalamityWorld.downedScavenger = true; - if (revenge) - { - npc.DropItemInstanced(npc.position, npc.Size, mod.ItemType("InfernalBlood"), 1, true); - } + if (!CalamityWorld.downedScavenger) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 4); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrenadeRounds"), 2); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ExplosiveShells")); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Knowledge33")); + } + CalamityWorld.downedScavenger = true; + if (Main.netMode == 2) + { + NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + } } else if (npc.type == mod.NPCType("Polterghast")) //boss 21 { - string key = "Mods.CalamityMod.GhostBossText"; - Color messageColor = Color.RoyalBlue; - if (!CalamityWorld.downedPolterghast) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 6); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrenadeRounds"), 3); - if (Main.netMode == 0) - { - Main.NewText(Language.GetTextValue(key), messageColor); - } - else if (Main.netMode == 2) - { - NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); - } - } - CalamityWorld.downedPolterghast = true; - if (Main.netMode == 2) - { - NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); - } - } - else if (npc.type == mod.NPCType("THELORDE")) //boss 22 - { - CalamityWorld.downedLORDE = true; - } - /*else if (npc.type == mod.NPCType("OldDuke")) //boss 23 + string key = "Mods.CalamityMod.GhostBossText"; + Color messageColor = Color.RoyalBlue; + if (!CalamityWorld.downedPolterghast) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagnumRounds"), 6); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrenadeRounds"), 3); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ExplosiveShells"), 2); + if (Main.netMode == 0) + { + Main.NewText(Language.GetTextValue(key), messageColor); + } + else if (Main.netMode == 2) + { + NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); + } + } + CalamityWorld.downedPolterghast = true; + if (Main.netMode == 2) + { + NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + } + } + else if (npc.type == mod.NPCType("THELORDE")) //boss 22 + { + CalamityWorld.downedLORDE = true; + if (Main.netMode == 2) + { + NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + } + } + else if (npc.type == mod.NPCType("GiantClam")) //boss 23 + { + CalamityWorld.downedCLAM = true; + if (Main.netMode == 2) + { + NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + } + } + /*else if (npc.type == mod.NPCType("OldDuke")) //boss 23 { CalamityWorld.downedOldDuke = true; }*/ - #endregion - #region DeathDowns - if (CalamityWorld.death) - { - if (npc.type == mod.NPCType("SupremeCalamitas")) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Levi")); - } - } - #endregion - } - #endregion + if (CalamityWorld.death) + { + if (npc.type == mod.NPCType("SupremeCalamitas")) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Levi")); + } + } + #endregion + } + #endregion - #region EditSpawnRate - public override void EditSpawnRate(Player player, ref int spawnRate, ref int maxSpawns) + #region EditSpawnRate + public override void EditSpawnRate(Player player, ref int spawnRate, ref int maxSpawns) { - if (player.GetModPlayer(mod).ZoneSulphur) - { - spawnRate = (int)((double)spawnRate * 1.1); - maxSpawns = (int)((float)maxSpawns * 0.8f); - if (Main.raining) - { - spawnRate = (int)((double)spawnRate * 0.7); - maxSpawns = (int)((float)maxSpawns * 1.2f); - } - } - else if (player.GetModPlayer(mod).ZoneAbyss) - { - spawnRate = (int)((double)spawnRate * 0.7); - maxSpawns = (int)((float)maxSpawns * 1.1f); - } - else if (player.GetModPlayer(mod).ZoneCalamity) + if (player.GetModPlayer(mod).ZoneSulphur) + { + spawnRate = (int)((double)spawnRate * 1.1); + maxSpawns = (int)((float)maxSpawns * 0.8f); + if (Main.raining) + { + spawnRate = (int)((double)spawnRate * 0.7); + maxSpawns = (int)((float)maxSpawns * 1.2f); + } + } + else if (player.GetModPlayer(mod).ZoneAbyss) + { + spawnRate = (int)((double)spawnRate * 0.7); + maxSpawns = (int)((float)maxSpawns * 1.1f); + } + else if (player.GetModPlayer(mod).ZoneCalamity) { spawnRate = (int)((double)spawnRate * 0.9); maxSpawns = (int)((float)maxSpawns * 1.1f); @@ -11357,56 +11475,88 @@ namespace CalamityMod.NPCs spawnRate = (int)((double)spawnRate * 0.6); maxSpawns = (int)((float)maxSpawns * 1.2f); } + else if (player.GetModPlayer(mod).ZoneSunkenSea) + { + spawnRate = (int)((double)spawnRate * 0.9); + maxSpawns = (int)((float)maxSpawns * 1.1f); + } if (CalamityWorld.revenge) { spawnRate = (int)((double)spawnRate * 0.85); } - if (CalamityWorld.death) - { - spawnRate = (int)((double)spawnRate * 0.75); - } - if (CalamityWorld.demonMode) + if (CalamityWorld.death) { spawnRate = (int)((double)spawnRate * 0.75); } - if (player.GetModPlayer(mod).zerg) + if (CalamityWorld.demonMode) + { + spawnRate = (int)((double)spawnRate * 0.75); + } + if (player.GetModPlayer(mod).clamity) + { + spawnRate = (int)((double)spawnRate * 0.02); + maxSpawns = (int)((float)maxSpawns * 1.5f); + } + if (player.GetModPlayer(mod).zerg && player.GetModPlayer(mod).chaosCandle) + { + spawnRate = (int)((double)spawnRate * 0.005); + maxSpawns = (int)((float)maxSpawns * 7.5f); + } + else if (player.GetModPlayer(mod).zerg) { spawnRate = (int)((double)spawnRate * 0.01); maxSpawns = (int)((float)maxSpawns * 5f); } - if (CalamityPlayer.areThereAnyDamnBosses || player.GetModPlayer(mod).zen) - { - spawnRate = (int)((double)spawnRate * (player.GetModPlayer(mod).ZoneAbyss ? 1.5 : 50)); - maxSpawns = (int)((float)maxSpawns * (player.GetModPlayer(mod).ZoneAbyss ? 0.75f : 0.01f)); - } - } - #endregion + else if (player.GetModPlayer(mod).chaosCandle) + { + spawnRate = (int)((double)spawnRate * 0.02); + maxSpawns = (int)((float)maxSpawns * 2.5f); + } + if (player.GetModPlayer(mod).zen && player.GetModPlayer(mod).tranquilityCandle) + { + spawnRate = (int)((double)spawnRate * (player.GetModPlayer(mod).ZoneAbyss ? 1.75 : 75)); + maxSpawns = (int)((float)maxSpawns * (player.GetModPlayer(mod).ZoneAbyss ? 0.625f : 0.005f)); + } + else if (CalamityPlayer.areThereAnyDamnBosses || player.GetModPlayer(mod).zen) + { + spawnRate = (int)((double)spawnRate * (player.GetModPlayer(mod).ZoneAbyss ? 1.5 : 50)); + maxSpawns = (int)((float)maxSpawns * (player.GetModPlayer(mod).ZoneAbyss ? 0.75f : 0.01f)); + } + else if (player.GetModPlayer(mod).tranquilityCandle) + { + spawnRate = (int)((double)spawnRate * (player.GetModPlayer(mod).ZoneAbyss ? 1.25 : 25)); + maxSpawns = (int)((float)maxSpawns * (player.GetModPlayer(mod).ZoneAbyss ? 0.875f : 0.02f)); + } + } + #endregion - #region EditSpawnRange - public override void EditSpawnRange(Player player, ref int spawnRangeX, ref int spawnRangeY, ref int safeRangeX, ref int safeRangeY) - { - if (player.GetModPlayer(mod).ZoneAbyss) - { - spawnRangeX = (int)((double)(1920 / 16) * 0.5); //0.7 - safeRangeX = (int)((double)(1920 / 16) * 0.32); //0.52 - } - } - #endregion + #region EditSpawnRange + public override void EditSpawnRange(Player player, ref int spawnRangeX, ref int spawnRangeY, ref int safeRangeX, ref int safeRangeY) + { + if (player.GetModPlayer(mod).ZoneAbyss) + { + spawnRangeX = (int)((double)(1920 / 16) * 0.5); //0.7 + safeRangeX = (int)((double)(1920 / 16) * 0.32); //0.52 + } + } + #endregion - #region EditSpawnPool - public override void EditSpawnPool(IDictionary pool, NPCSpawnInfo spawnInfo) - { - if ((spawnInfo.player.GetModPlayer(mod).ZoneAbyss || spawnInfo.player.GetModPlayer(mod).ZoneCalamity || - spawnInfo.player.GetModPlayer(mod).ZoneSulphur || spawnInfo.player.GetModPlayer(mod).ZoneAstral) && - !NPC.LunarApocalypseIsUp) - { - pool[0] = 0f; - } - } - #endregion + #region EditSpawnPool + public override void EditSpawnPool(IDictionary pool, NPCSpawnInfo spawnInfo) + { + if (spawnInfo.player.GetModPlayer(mod).ZoneAbyss || + spawnInfo.player.GetModPlayer(mod).ZoneCalamity || + spawnInfo.player.GetModPlayer(mod).ZoneSulphur || + spawnInfo.player.GetModPlayer(mod).ZoneSunkenSea || + (spawnInfo.player.GetModPlayer(mod).ZoneAstral && !NPC.LunarApocalypseIsUp)) + { + pool[0] = 0f; + } + } + #endregion - #region Drawing - public override void DrawEffects(NPC npc, ref Color drawColor) + #region Drawing + public override void DrawEffects(NPC npc, ref Color drawColor) { if (bFlames || enraged) { @@ -11539,23 +11689,23 @@ namespace CalamityMod.NPCs } } } - if (dFlames) - { - if (Main.rand.Next(5) < 4) - { - int dust = Dust.NewDust(npc.position - new Vector2(2f, 2f), npc.width + 4, npc.height + 4, 173, npc.velocity.X * 0.4f, npc.velocity.Y * 0.4f, 100, default(Color), 1.5f); - Main.dust[dust].noGravity = true; - Main.dust[dust].velocity *= 1.2f; - Main.dust[dust].velocity.Y -= 0.15f; - if (Main.rand.Next(4) == 0) - { - Main.dust[dust].noGravity = false; - Main.dust[dust].scale *= 0.5f; - } - } - Lighting.AddLight(npc.position, 0.1f, 0f, 0.135f); - } - if (gState || eFreeze) + if (dFlames) + { + if (Main.rand.Next(5) < 4) + { + int dust = Dust.NewDust(npc.position - new Vector2(2f, 2f), npc.width + 4, npc.height + 4, 173, npc.velocity.X * 0.4f, npc.velocity.Y * 0.4f, 100, default(Color), 1.5f); + Main.dust[dust].noGravity = true; + Main.dust[dust].velocity *= 1.2f; + Main.dust[dust].velocity.Y -= 0.15f; + if (Main.rand.Next(4) == 0) + { + Main.dust[dust].noGravity = false; + Main.dust[dust].scale *= 0.5f; + } + } + Lighting.AddLight(npc.position, 0.1f, 0f, 0.135f); + } + if (gState || eFreeze) { drawColor = Color.Cyan; } @@ -11563,440 +11713,499 @@ namespace CalamityMod.NPCs { drawColor = Color.Fuchsia; } + if (pearlAura) + { + drawColor = Color.White; + } } - public override Color? GetAlpha(NPC npc, Color drawColor) - { - if (enraged) - return new Color(200, 50, 50, npc.alpha); - return null; - } - #endregion + public override Color? GetAlpha(NPC npc, Color drawColor) + { + if (Main.player[Main.myPlayer].GetModPlayer(mod).trippy) + return new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB, npc.alpha); + if (enraged) + return new Color(200, 50, 50, npc.alpha); + return null; + } - #region GetChat - public override void GetChat(NPC npc, ref string chat) - { - switch (npc.type) - { - case NPCID.Guide: - if (Main.rand.Next(20) == 0 && Main.hardMode) - chat = "Could you be so kind as to, ah...check hell for me...? I left someone I kind of care about down there."; - if (Main.rand.Next(20) == 0 && CalamityWorld.spawnAstralMeteor) - chat = "I have this sudden shiver up my spine, like a meteor just fell and thousands of innocent creatures turned into monsters from the stars."; - if (Main.rand.Next(20) == 0 && NPC.downedMoonlord) - chat = "The dungeon seems even more restless than usual, watch out for the powerful abominations stirring up in there."; - if (Main.rand.Next(20) == 0 && CalamityWorld.downedProvidence) - chat = "Seems like extinguishing that butterfly caused its life to seep into the hallowed areas, try taking a peek there and see what you can find!"; - if (Main.rand.Next(20) == 0 && CalamityWorld.downedProvidence) - chat = "I've heard there is a portal of antimatter absorbing everything it can see in the dungeon, try using the Rune of Kos there!"; - break; - case NPCID.PartyGirl: - int fapsol = NPC.FindFirstNPC(mod.NPCType("FAP")); - if (Main.rand.Next(10) == 0 && fapsol != -1) - chat = "I have a feeling we're going to have absolutely fantastic parties with " + Main.npc[fapsol].GivenName + " around!"; - if (Main.rand.Next(5) == 0 && Main.eclipse) - chat = "I think my light display is turning into an accidental bug zapper. At least the monsters are enjoying it."; - if (Main.rand.Next(5) == 0 && Main.eclipse) - chat = "Ooh! I love parties where everyone wears a scary costume!"; - break; - case NPCID.Wizard: - int permadong = NPC.FindFirstNPC(mod.NPCType("DILF")); - if (Main.rand.Next(10) == 0 && permadong != -1) - chat = "I'd let " + Main.npc[permadong].GivenName + " coldheart MY icicle."; - if (Main.rand.Next(10) == 0 && CalamityWorld.spawnAstralMeteor) - chat = "Space just got way too close for comfort."; - break; - case NPCID.Dryad: - if (Main.rand.Next(5) == 0 && CalamityWorld.buffedEclipse && Main.eclipse) - chat = "There's a dark solar energy emanating from the moths that appear during this time. Ah, the moths as you progress further get more powerful...hmm...what power was Yharon holding back?"; - if (Main.rand.Next(10) == 0 && CalamityWorld.spawnAstralMeteor) - chat = "That starborne illness sits upon this land like a blister. Do even more vile forces of corruption exist in worlds beyond?"; - break; - case NPCID.Stylist: - int fapsol2 = NPC.FindFirstNPC(mod.NPCType("FAP")); - string worldEvil = WorldGen.crimson ? "Crimson" : "Corruption"; - if (Main.rand.Next(15) == 0 && fapsol2 != -1) - chat = "Sometimes I catch " + Main.npc[fapsol2].GivenName + " sneaking up from behind me."; - if (Main.rand.Next(15) == 0 && CalamityWorld.spawnAstralMeteor) - chat = "Please don't catch space lice. Or " + worldEvil + " lice. Or just lice in general."; - break; - case NPCID.GoblinTinkerer: - if (Main.rand.Next(10) == 0 && NPC.downedMoonlord) - chat = "You know...we haven't had an invasion in a while..."; - break; - case NPCID.ArmsDealer: - if (Main.rand.Next(5) == 0 && Main.eclipse) - chat = "That's the biggest moth I've ever seen for sure. You'd need one big gun to take one of those down."; - if (Main.rand.Next(10) == 0 && CalamityWorld.downedDoG) - chat = "Is it me or are your weapons getting bigger and bigger?"; - break; - case NPCID.Merchant: - if (Main.rand.Next(5) == 0 && NPC.downedMoonlord) - chat = "Each night seems only more foreboding than the last. I feel unthinkable terrors are watching your every move."; - if (Main.rand.Next(5) == 0 && Main.eclipse) - chat = "Are you daft?! Turn off those lamps!"; - if (Main.rand.Next(5) == 0 && Main.raining && CalamityWorld.sulphurTiles > 30) - chat = "If this acid rain keeps up, there'll be a shortage of Dirt Blocks soon enough!"; - break; - case NPCID.Mechanic: - int fapsol3 = NPC.FindFirstNPC(mod.NPCType("FAP")); - if (Main.rand.Next(5) == 0 && NPC.downedMoonlord) - chat = "What do you mean your traps aren't making the cut? Don't look at me!"; - if (Main.rand.Next(5) == 0 && Main.eclipse) - chat = "Um...should my nightlight be on?"; - if (Main.rand.Next(5) == 0 && fapsol3 != -1) - chat = "Well, I like " + Main.npc[fapsol3].GivenName + ", but I, ah...I have my eyes on someone else."; - break; - case NPCID.DD2Bartender: - int fapsol4 = NPC.FindFirstNPC(mod.NPCType("FAP")); - if (Main.rand.Next(5) == 0 && !Main.dayTime && Main.moonPhase == 0) - chat = "Care for a little Moonshine?"; - if (Main.rand.Next(10) == 0 && fapsol4 != -1) - chat = "Sheesh, " + Main.npc[fapsol4].GivenName + " is a little cruel, isn't she? I never claimed to be an expert on anything but ale!"; - break; - case NPCID.Pirate: - if (Main.rand.Next(5) == 0 && !CalamityWorld.downedLeviathan) - chat = "Aye, I’ve heard of a mythical creature in the oceans, singing with an alluring voice. Careful when yer fishin out there."; - if (Main.rand.Next(5) == 0 && CalamityWorld.downedAquaticScourge) - chat = "I have to thank ye again for takin' care of that sea serpent. Or was that another one..."; - break; - case NPCID.Cyborg: - if (Main.rand.Next(10) == 0 && Main.raining) - chat = "All these moments will be lost in time. Like tears...in the rain."; - if (Main.rand.Next(10) == 0 && NPC.downedMoonlord) - chat = "Always shoot for the moon! It has clearly worked before."; - if (Main.rand.Next(10) == 0 && NPC.downedMoonlord) - chat = "Draedon? He's...a little 'high octane' if you know what I mean."; - if (Main.rand.Next(10) == 0 && !CalamityWorld.downedPlaguebringer && NPC.downedGolemBoss) - chat = "Those oversized bugs terrorizing the jungle... Surely you of all people could shut them down!"; - break; - case NPCID.Clothier: - if (Main.rand.Next(10) == 0 && NPC.downedMoonlord) - chat = "Who you gonna call?"; - if (Main.rand.Next(10) == 0 && NPC.downedMoonlord) - chat = "Those screams...I’m not sure why, but I feel like a nameless fear has awoken in my heart."; - if (Main.rand.Next(10) == 0 && NPC.downedMoonlord) - chat = "I can faintly hear ghostly shrieks from the dungeon...and not ones I’m familiar with at all. Just what is going on in there?"; - if (Main.rand.Next(10) == 0 && CalamityWorld.downedPolterghast) - chat = "Whatever that thing was, I’m glad it’s gone now."; - if (Main.rand.Next(5) == 0 && NPC.AnyNPCs(NPCID.MoonLordCore)) - chat = "Houston, we've had a problem."; - break; - case NPCID.Steampunker: - bool hasPortalGun = false; - for (int k = 0; k < 255; k++) - { - Player player = Main.player[k]; - if (player.active) - { - for (int j = 0; j < player.inventory.Length; j++) - { - if (player.inventory[j].type == ItemID.PortalGun) - { - hasPortalGun = true; - } - } - } - } - if (Main.rand.Next(5) == 0 && NPC.downedMoonlord) - chat = "Yep! I'm also considering being a space pirate now."; - if (Main.rand.Next(5) == 0 && hasPortalGun) - chat = "Just what is that contraption? It makes my Teleporters look like child's play!"; - break; - case NPCID.DyeTrader: - int permadong2 = NPC.FindFirstNPC(mod.NPCType("DILF")); - if (Main.rand.Next(5) == 0) - chat = "Have you seen those gemstone creatures in the caverns? Their colors are simply breathtaking!"; - if (Main.rand.Next(5) == 0 && permadong2 != -1) - chat = "Do you think " + Main.npc[permadong2].GivenName + " knows how to 'let it go?'"; - break; - case NPCID.TaxCollector: - int platinumCoins = 0; - for (int k = 0; k < 255; k++) - { - Player player = Main.player[k]; - if (player.active) - { - for (int j = 0; j < player.inventory.Length; j++) - { - if (player.inventory[j].type == ItemID.PlatinumCoin) - { - platinumCoins = player.inventory[j].stack; - } - } - } - } - if (Main.rand.Next(5) == 0 && platinumCoins >= 100) - chat = "BAH! Doesn't seem like I'll ever be able to quarrel with the debts of the town again!"; - if (Main.rand.Next(5) == 0 && platinumCoins >= 500) - chat = "Where and how are you getting all of this money?"; - if (Main.rand.Next(5) == 0 && !CalamityWorld.downedBrimstoneElemental) - chat = "Perhaps with all that time you've got you could check those old ruins? Certainly something of value in it for you!"; - if (Main.rand.Next(10) == 0 && CalamityWorld.downedDoG) - chat = "Devourer of what, you said? Devourer of Funds, if its payroll is anything to go by!"; - break; - case NPCID.Demolitionist: - if (Main.rand.Next(5) == 0 && CalamityWorld.downedDoG) - chat = "God Slayer Dynamite? Boy do I like the sound of that!"; - break; - } - } - #endregion + public override bool PreDraw(NPC npc, SpriteBatch spriteBatch, Color drawColor) + { + if (Main.player[Main.myPlayer].GetModPlayer(mod).trippy) + { + SpriteEffects spriteEffects = SpriteEffects.None; + if (npc.spriteDirection == 1) + { + spriteEffects = SpriteEffects.FlipHorizontally; + } + float num66 = 0f; + Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2)); + Microsoft.Xna.Framework.Color color9 = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB, 0); + Microsoft.Xna.Framework.Color alpha15 = npc.GetAlpha(color9); + float num212 = 0.99f; + alpha15.R = (byte)((float)alpha15.R * num212); + alpha15.G = (byte)((float)alpha15.G * num212); + alpha15.B = (byte)((float)alpha15.B * num212); + alpha15.A = (byte)((float)alpha15.A * num212); + for (int num213 = 0; num213 < 4; num213++) + { + Vector2 position9 = npc.position; + float num214 = Math.Abs(npc.Center.X - Main.player[Main.myPlayer].Center.X); + float num215 = Math.Abs(npc.Center.Y - Main.player[Main.myPlayer].Center.Y); + if (num213 == 0 || num213 == 2) + { + position9.X = Main.player[Main.myPlayer].Center.X + num214; + } + else + { + position9.X = Main.player[Main.myPlayer].Center.X - num214; + } + position9.X -= (float)(npc.width / 2); + if (num213 == 0 || num213 == 1) + { + position9.Y = Main.player[Main.myPlayer].Center.Y + num215; + } + else + { + position9.Y = Main.player[Main.myPlayer].Center.Y - num215; + } + position9.Y -= (float)(npc.height / 2); + Main.spriteBatch.Draw(Main.npcTexture[npc.type], new Vector2(position9.X - Main.screenPosition.X + (float)(npc.width / 2) - (float)Main.npcTexture[npc.type].Width * npc.scale / 2f + vector11.X * npc.scale, position9.Y - Main.screenPosition.Y + (float)npc.height - (float)Main.npcTexture[npc.type].Height * npc.scale / (float)Main.npcFrameCount[npc.type] + 4f + vector11.Y * npc.scale + num66 + npc.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(npc.frame), alpha15, npc.rotation, vector11, npc.scale, spriteEffects, 0f); + } + } + return true; + } + #endregion - #region ShopStuff - public override void SetupShop(int type, Chest shop, ref int nextSlot) + #region GetChat + public override void GetChat(NPC npc, ref string chat) + { + switch (npc.type) + { + case NPCID.Guide: + if (Main.rand.Next(20) == 0 && Main.hardMode) + chat = "Could you be so kind as to, ah...check hell for me...? I left someone I kind of care about down there."; + if (Main.rand.Next(20) == 0 && CalamityWorld.spawnAstralMeteor) + chat = "I have this sudden shiver up my spine, like a meteor just fell and thousands of innocent creatures turned into monsters from the stars."; + if (Main.rand.Next(20) == 0 && NPC.downedMoonlord) + chat = "The dungeon seems even more restless than usual, watch out for the powerful abominations stirring up in there."; + if (Main.rand.Next(20) == 0 && CalamityWorld.downedProvidence) + chat = "Seems like extinguishing that butterfly caused its life to seep into the hallowed areas, try taking a peek there and see what you can find!"; + if (Main.rand.Next(20) == 0 && CalamityWorld.downedProvidence) + chat = "I've heard there is a portal of antimatter absorbing everything it can see in the dungeon, try using the Rune of Kos there!"; + break; + case NPCID.PartyGirl: + int fapsol = NPC.FindFirstNPC(mod.NPCType("FAP")); + if (Main.rand.Next(10) == 0 && fapsol != -1) + chat = "I have a feeling we're going to have absolutely fantastic parties with " + Main.npc[fapsol].GivenName + " around!"; + if (Main.rand.Next(5) == 0 && Main.eclipse) + chat = "I think my light display is turning into an accidental bug zapper. At least the monsters are enjoying it."; + if (Main.rand.Next(5) == 0 && Main.eclipse) + chat = "Ooh! I love parties where everyone wears a scary costume!"; + break; + case NPCID.Wizard: + int permadong = NPC.FindFirstNPC(mod.NPCType("DILF")); + if (Main.rand.Next(10) == 0 && permadong != -1) + chat = "I'd let " + Main.npc[permadong].GivenName + " coldheart MY icicle."; + if (Main.rand.Next(10) == 0 && CalamityWorld.spawnAstralMeteor) + chat = "Space just got way too close for comfort."; + break; + case NPCID.Dryad: + if (Main.rand.Next(5) == 0 && CalamityWorld.buffedEclipse && Main.eclipse) + chat = "There's a dark solar energy emanating from the moths that appear during this time. Ah, the moths as you progress further get more powerful...hmm...what power was Yharon holding back?"; + if (Main.rand.Next(10) == 0 && CalamityWorld.spawnAstralMeteor) + chat = "That starborne illness sits upon this land like a blister. Do even more vile forces of corruption exist in worlds beyond?"; + break; + case NPCID.Stylist: + int fapsol2 = NPC.FindFirstNPC(mod.NPCType("FAP")); + string worldEvil = WorldGen.crimson ? "Crimson" : "Corruption"; + if (Main.rand.Next(15) == 0 && fapsol2 != -1) + chat = "Sometimes I catch " + Main.npc[fapsol2].GivenName + " sneaking up from behind me."; + if (Main.rand.Next(15) == 0 && CalamityWorld.spawnAstralMeteor) + chat = "Please don't catch space lice. Or " + worldEvil + " lice. Or just lice in general."; + break; + case NPCID.GoblinTinkerer: + if (Main.rand.Next(10) == 0 && NPC.downedMoonlord) + chat = "You know...we haven't had an invasion in a while..."; + break; + case NPCID.ArmsDealer: + if (Main.rand.Next(5) == 0 && Main.eclipse) + chat = "That's the biggest moth I've ever seen for sure. You'd need one big gun to take one of those down."; + if (Main.rand.Next(10) == 0 && CalamityWorld.downedDoG) + chat = "Is it me or are your weapons getting bigger and bigger?"; + break; + case NPCID.Merchant: + if (Main.rand.Next(5) == 0 && NPC.downedMoonlord) + chat = "Each night seems only more foreboding than the last. I feel unthinkable terrors are watching your every move."; + if (Main.rand.Next(5) == 0 && Main.eclipse) + chat = "Are you daft?! Turn off those lamps!"; + if (Main.rand.Next(5) == 0 && Main.raining && CalamityWorld.sulphurTiles > 30) + chat = "If this acid rain keeps up, there'll be a shortage of Dirt Blocks soon enough!"; + break; + case NPCID.Mechanic: + int fapsol3 = NPC.FindFirstNPC(mod.NPCType("FAP")); + if (Main.rand.Next(5) == 0 && NPC.downedMoonlord) + chat = "What do you mean your traps aren't making the cut? Don't look at me!"; + if (Main.rand.Next(5) == 0 && Main.eclipse) + chat = "Um...should my nightlight be on?"; + if (Main.rand.Next(5) == 0 && fapsol3 != -1) + chat = "Well, I like " + Main.npc[fapsol3].GivenName + ", but I, ah...I have my eyes on someone else."; + break; + case NPCID.DD2Bartender: + int fapsol4 = NPC.FindFirstNPC(mod.NPCType("FAP")); + if (Main.rand.Next(5) == 0 && !Main.dayTime && Main.moonPhase == 0) + chat = "Care for a little Moonshine?"; + if (Main.rand.Next(10) == 0 && fapsol4 != -1) + chat = "Sheesh, " + Main.npc[fapsol4].GivenName + " is a little cruel, isn't she? I never claimed to be an expert on anything but ale!"; + break; + case NPCID.Pirate: + if (Main.rand.Next(5) == 0 && !CalamityWorld.downedLeviathan) + chat = "Aye, I’ve heard of a mythical creature in the oceans, singing with an alluring voice. Careful when yer fishin out there."; + if (Main.rand.Next(5) == 0 && CalamityWorld.downedAquaticScourge) + chat = "I have to thank ye again for takin' care of that sea serpent. Or was that another one..."; + break; + case NPCID.Cyborg: + if (Main.rand.Next(10) == 0 && Main.raining) + chat = "All these moments will be lost in time. Like tears...in the rain."; + if (Main.rand.Next(10) == 0 && NPC.downedMoonlord) + chat = "Always shoot for the moon! It has clearly worked before."; + if (Main.rand.Next(10) == 0 && NPC.downedMoonlord) + chat = "Draedon? He's...a little 'high octane' if you know what I mean."; + if (Main.rand.Next(10) == 0 && !CalamityWorld.downedPlaguebringer && NPC.downedGolemBoss) + chat = "Those oversized bugs terrorizing the jungle... Surely you of all people could shut them down!"; + break; + case NPCID.Clothier: + if (Main.rand.Next(10) == 0 && NPC.downedMoonlord) + chat = "Who you gonna call?"; + if (Main.rand.Next(10) == 0 && NPC.downedMoonlord) + chat = "Those screams...I’m not sure why, but I feel like a nameless fear has awoken in my heart."; + if (Main.rand.Next(10) == 0 && NPC.downedMoonlord) + chat = "I can faintly hear ghostly shrieks from the dungeon...and not ones I’m familiar with at all. Just what is going on in there?"; + if (Main.rand.Next(10) == 0 && CalamityWorld.downedPolterghast) + chat = "Whatever that thing was, I’m glad it’s gone now."; + if (Main.rand.Next(5) == 0 && NPC.AnyNPCs(NPCID.MoonLordCore)) + chat = "Houston, we've had a problem."; + break; + case NPCID.Steampunker: + bool hasPortalGun = false; + for (int k = 0; k < 255; k++) + { + Player player = Main.player[k]; + if (player.active) + { + for (int j = 0; j < player.inventory.Length; j++) + { + if (player.inventory[j].type == ItemID.PortalGun) + { + hasPortalGun = true; + } + } + } + } + if (Main.rand.Next(5) == 0 && NPC.downedMoonlord) + chat = "Yep! I'm also considering being a space pirate now."; + if (Main.rand.Next(5) == 0 && hasPortalGun) + chat = "Just what is that contraption? It makes my Teleporters look like child's play!"; + break; + case NPCID.DyeTrader: + int permadong2 = NPC.FindFirstNPC(mod.NPCType("DILF")); + if (Main.rand.Next(5) == 0) + chat = "Have you seen those gemstone creatures in the caverns? Their colors are simply breathtaking!"; + if (Main.rand.Next(5) == 0 && permadong2 != -1) + chat = "Do you think " + Main.npc[permadong2].GivenName + " knows how to 'let it go?'"; + break; + case NPCID.TaxCollector: + int platinumCoins = 0; + for (int k = 0; k < 255; k++) + { + Player player = Main.player[k]; + if (player.active) + { + for (int j = 0; j < player.inventory.Length; j++) + { + if (player.inventory[j].type == ItemID.PlatinumCoin) + { + platinumCoins = player.inventory[j].stack; + } + } + } + } + if (Main.rand.Next(5) == 0 && platinumCoins >= 100) + chat = "BAH! Doesn't seem like I'll ever be able to quarrel with the debts of the town again!"; + if (Main.rand.Next(5) == 0 && platinumCoins >= 500) + chat = "Where and how are you getting all of this money?"; + if (Main.rand.Next(5) == 0 && !CalamityWorld.downedBrimstoneElemental) + chat = "Perhaps with all that time you've got you could check those old ruins? Certainly something of value in it for you!"; + if (Main.rand.Next(10) == 0 && CalamityWorld.downedDoG) + chat = "Devourer of what, you said? Devourer of Funds, if its payroll is anything to go by!"; + break; + case NPCID.Demolitionist: + if (Main.rand.Next(5) == 0 && CalamityWorld.downedDoG) + chat = "God Slayer Dynamite? Boy do I like the sound of that!"; + break; + } + } + #endregion + + #region ShopStuff + public override void SetupShop(int type, Chest shop, ref int nextSlot) { if (type == NPCID.Merchant && (Main.player[Main.myPlayer].HasItem(mod.ItemType("FirestormCannon")) || Main.player[Main.myPlayer].HasItem(mod.ItemType("SpectralstormCannon")))) { shop.item[nextSlot].SetDefaults(ItemID.Flare); - nextSlot++; + nextSlot++; } if (type == NPCID.Merchant) { if (NPC.downedBoss1) { shop.item[nextSlot].SetDefaults(ItemID.ApprenticeBait); - nextSlot++; + nextSlot++; } if (NPC.downedBoss2) { shop.item[nextSlot].SetDefaults(ItemID.JourneymanBait); - nextSlot++; - if (WorldGen.crimson) - { - shop.item[nextSlot].SetDefaults(ItemID.Vilethorn); - nextSlot++; - } - else - { - shop.item[nextSlot].SetDefaults(ItemID.TheRottedFork); - nextSlot++; - } + nextSlot++; + if (WorldGen.crimson) + { + shop.item[nextSlot].SetDefaults(ItemID.Vilethorn); + nextSlot++; + } + else + { + shop.item[nextSlot].SetDefaults(ItemID.TheRottedFork); + nextSlot++; + } } if (NPC.downedBoss3) { shop.item[nextSlot].SetDefaults(ItemID.MasterBait); - nextSlot++; + nextSlot++; } } if (type == NPCID.ArmsDealer && (Main.player[Main.myPlayer].HasItem(mod.ItemType("Impaler")))) { shop.item[nextSlot].SetDefaults(ItemID.Stake); - nextSlot++; + nextSlot++; } if (type == NPCID.ArmsDealer) { if (NPC.downedBoss2) { - if (WorldGen.crimson) - { - shop.item[nextSlot].SetDefaults(ItemID.Musket); - nextSlot++; - } - else - { - shop.item[nextSlot].SetDefaults(ItemID.TheUndertaker); - nextSlot++; - } + if (WorldGen.crimson) + { + shop.item[nextSlot].SetDefaults(ItemID.Musket); + nextSlot++; + } + else + { + shop.item[nextSlot].SetDefaults(ItemID.TheUndertaker); + nextSlot++; + } } - if (Main.hardMode) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("MagnumRounds")); - shop.item[nextSlot].shopCustomPrice = Item.buyPrice(1, 50, 0, 0); - nextSlot++; - } - if (NPC.downedPlantBoss) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("GrenadeRounds")); - shop.item[nextSlot].shopCustomPrice = Item.buyPrice(2, 0, 0, 0); - nextSlot++; - } - } + if (Main.hardMode) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("MagnumRounds")); + shop.item[nextSlot].shopCustomPrice = Item.buyPrice(6, 0, 0, 0); + nextSlot++; + } + if (NPC.downedPlantBoss) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("GrenadeRounds")); + shop.item[nextSlot].shopCustomPrice = Item.buyPrice(9, 0, 0, 0); + nextSlot++; + } + if (NPC.downedMoonlord) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("ExplosiveShells")); + shop.item[nextSlot].shopCustomPrice = Item.buyPrice(13, 50, 0, 0); + nextSlot++; + } + } if (type == NPCID.Dryad) { - shop.item[nextSlot].SetDefaults(ItemID.JungleRose); - shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 2, 0, 0); - nextSlot++; - shop.item[nextSlot].SetDefaults(ItemID.NaturesGift); - shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 10, 0, 0); - nextSlot++; - shop.item[nextSlot].SetDefaults(ItemID.GoblinBattleStandard); - shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 1, 0, 0); - nextSlot++; - if (NPC.downedSlimeKing) + shop.item[nextSlot].SetDefaults(ItemID.JungleRose); + shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 2, 0, 0); + nextSlot++; + shop.item[nextSlot].SetDefaults(ItemID.NaturesGift); + shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 10, 0, 0); + nextSlot++; + shop.item[nextSlot].SetDefaults(ItemID.GoblinBattleStandard); + shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 1, 0, 0); + nextSlot++; + if (NPC.downedSlimeKing) { shop.item[nextSlot].SetDefaults(ItemID.SlimeCrown); shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 2, 0, 0); - nextSlot++; + nextSlot++; } if (CalamityWorld.downedDesertScourge) { shop.item[nextSlot].SetDefaults(mod.ItemType("DriedSeafood")); shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 2, 0, 0); - nextSlot++; + nextSlot++; } if (NPC.downedBoss1) { shop.item[nextSlot].SetDefaults(ItemID.SuspiciousLookingEye); shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 3, 0, 0); - nextSlot++; + nextSlot++; } if (CalamityWorld.downedCrabulon) { shop.item[nextSlot].SetDefaults(mod.ItemType("DecapoditaSprout")); shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 4, 0, 0); - nextSlot++; + nextSlot++; } if (NPC.downedBoss2) { - shop.item[nextSlot].SetDefaults(ItemID.BloodySpine); - shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 6, 0, 0); - nextSlot++; - shop.item[nextSlot].SetDefaults(ItemID.WormFood); - shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 6, 0, 0); - nextSlot++; - if (WorldGen.crimson) - { - if (Main.expertMode) - { - shop.item[nextSlot].SetDefaults(ItemID.WormScarf); - nextSlot++; - } - shop.item[nextSlot].SetDefaults(ItemID.BandofStarpower); - nextSlot++; - } - else - { - if (Main.expertMode) - { - shop.item[nextSlot].SetDefaults(ItemID.BrainOfConfusion); - nextSlot++; - } - shop.item[nextSlot].SetDefaults(ItemID.PanicNecklace); - nextSlot++; - } + shop.item[nextSlot].SetDefaults(ItemID.BloodySpine); + shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 6, 0, 0); + nextSlot++; + shop.item[nextSlot].SetDefaults(ItemID.WormFood); + shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 6, 0, 0); + nextSlot++; + if (WorldGen.crimson) + { + if (Main.expertMode) + { + shop.item[nextSlot].SetDefaults(ItemID.WormScarf); + nextSlot++; + } + shop.item[nextSlot].SetDefaults(ItemID.BandofStarpower); + nextSlot++; + } + else + { + if (Main.expertMode) + { + shop.item[nextSlot].SetDefaults(ItemID.BrainOfConfusion); + nextSlot++; + } + shop.item[nextSlot].SetDefaults(ItemID.PanicNecklace); + nextSlot++; + } } if (CalamityWorld.downedPerforator) { shop.item[nextSlot].SetDefaults(mod.ItemType("BloodyWormFood")); shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 10, 0, 0); - nextSlot++; - shop.item[nextSlot].SetDefaults(mod.ItemType("RottenBrain")); - nextSlot++; - } + nextSlot++; + if (Main.expertMode) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("RottenBrain")); + nextSlot++; + } + } if (CalamityWorld.downedHiveMind) { shop.item[nextSlot].SetDefaults(mod.ItemType("Teratoma")); shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 10, 0, 0); - nextSlot++; - shop.item[nextSlot].SetDefaults(mod.ItemType("BloodyWormTooth")); - nextSlot++; - } + nextSlot++; + if (Main.expertMode) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("BloodyWormTooth")); + nextSlot++; + } + } if (CalamityWorld.downedSlimeGod) { shop.item[nextSlot].SetDefaults(mod.ItemType("OverloadedSludge")); shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 15, 0, 0); - nextSlot++; + nextSlot++; } - if (CalamityWorld.downedAquaticScourge) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("Seafood")); - shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 20, 0, 0); - nextSlot++; - } - if (NPC.downedHalloweenKing) - { - shop.item[nextSlot].SetDefaults(ItemID.PumpkinMoonMedallion); - shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 25, 0, 0); - nextSlot++; - } - if (NPC.downedChristmasIceQueen) - { - shop.item[nextSlot].SetDefaults(ItemID.NaughtyPresent); - shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 25, 0, 0); - nextSlot++; - } - if (NPC.downedFishron) + if (CalamityWorld.downedAquaticScourge) { - shop.item[nextSlot].SetDefaults(ItemID.TruffleWorm); - shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 40, 0, 0); - nextSlot++; + shop.item[nextSlot].SetDefaults(mod.ItemType("Seafood")); + shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 20, 0, 0); + nextSlot++; + } + if (NPC.downedHalloweenKing) + { + shop.item[nextSlot].SetDefaults(ItemID.PumpkinMoonMedallion); + shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 25, 0, 0); + nextSlot++; + } + if (NPC.downedChristmasIceQueen) + { + shop.item[nextSlot].SetDefaults(ItemID.NaughtyPresent); + shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 25, 0, 0); + nextSlot++; } } - if (type == NPCID.GoblinTinkerer) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("MeleeLevelMeter")); - shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 5, 0, 0); - nextSlot++; - shop.item[nextSlot].SetDefaults(mod.ItemType("RangedLevelMeter")); - shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 5, 0, 0); - nextSlot++; - shop.item[nextSlot].SetDefaults(mod.ItemType("MagicLevelMeter")); - shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 5, 0, 0); - nextSlot++; - shop.item[nextSlot].SetDefaults(mod.ItemType("SummonLevelMeter")); - shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 5, 0, 0); - nextSlot++; - shop.item[nextSlot].SetDefaults(mod.ItemType("RogueLevelMeter")); - shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 5, 0, 0); - nextSlot++; - } - if (type == NPCID.Clothier) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("BlueBrickWallUnsafe")); - shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 0, 0, 10); - nextSlot++; - shop.item[nextSlot].SetDefaults(mod.ItemType("BlueSlabWallUnsafe")); - shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 0, 0, 10); - nextSlot++; - shop.item[nextSlot].SetDefaults(mod.ItemType("BlueTiledWallUnsafe")); - shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 0, 0, 10); - nextSlot++; - shop.item[nextSlot].SetDefaults(mod.ItemType("GreenBrickWallUnsafe")); - shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 0, 0, 10); - nextSlot++; - shop.item[nextSlot].SetDefaults(mod.ItemType("GreenSlabWallUnsafe")); - shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 0, 0, 10); - nextSlot++; - shop.item[nextSlot].SetDefaults(mod.ItemType("GreenTiledWallUnsafe")); - shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 0, 0, 10); - nextSlot++; - shop.item[nextSlot].SetDefaults(mod.ItemType("PinkBrickWallUnsafe")); - shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 0, 0, 10); - nextSlot++; - shop.item[nextSlot].SetDefaults(mod.ItemType("PinkSlabWallUnsafe")); - shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 0, 0, 10); - nextSlot++; - shop.item[nextSlot].SetDefaults(mod.ItemType("PinkTiledWallUnsafe")); - shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 0, 0, 10); - nextSlot++; - } + if (type == NPCID.GoblinTinkerer) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("MeleeLevelMeter")); + shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 5, 0, 0); + nextSlot++; + shop.item[nextSlot].SetDefaults(mod.ItemType("RangedLevelMeter")); + shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 5, 0, 0); + nextSlot++; + shop.item[nextSlot].SetDefaults(mod.ItemType("MagicLevelMeter")); + shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 5, 0, 0); + nextSlot++; + shop.item[nextSlot].SetDefaults(mod.ItemType("SummonLevelMeter")); + shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 5, 0, 0); + nextSlot++; + shop.item[nextSlot].SetDefaults(mod.ItemType("RogueLevelMeter")); + shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 5, 0, 0); + nextSlot++; + } + if (type == NPCID.Clothier) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("BlueBrickWallUnsafe")); + shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 0, 0, 10); + nextSlot++; + shop.item[nextSlot].SetDefaults(mod.ItemType("BlueSlabWallUnsafe")); + shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 0, 0, 10); + nextSlot++; + shop.item[nextSlot].SetDefaults(mod.ItemType("BlueTiledWallUnsafe")); + shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 0, 0, 10); + nextSlot++; + shop.item[nextSlot].SetDefaults(mod.ItemType("GreenBrickWallUnsafe")); + shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 0, 0, 10); + nextSlot++; + shop.item[nextSlot].SetDefaults(mod.ItemType("GreenSlabWallUnsafe")); + shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 0, 0, 10); + nextSlot++; + shop.item[nextSlot].SetDefaults(mod.ItemType("GreenTiledWallUnsafe")); + shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 0, 0, 10); + nextSlot++; + shop.item[nextSlot].SetDefaults(mod.ItemType("PinkBrickWallUnsafe")); + shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 0, 0, 10); + nextSlot++; + shop.item[nextSlot].SetDefaults(mod.ItemType("PinkSlabWallUnsafe")); + shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 0, 0, 10); + nextSlot++; + shop.item[nextSlot].SetDefaults(mod.ItemType("PinkTiledWallUnsafe")); + shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 0, 0, 10); + nextSlot++; + } if (type == NPCID.Steampunker) { if (NPC.downedMechBoss1) { shop.item[nextSlot].SetDefaults(ItemID.MechanicalWorm); shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 20, 0, 0); - nextSlot++; + nextSlot++; } if (NPC.downedMechBoss2) { shop.item[nextSlot].SetDefaults(ItemID.MechanicalEye); shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 20, 0, 0); - nextSlot++; + nextSlot++; } if (NPC.downedMechBoss3) { shop.item[nextSlot].SetDefaults(ItemID.MechanicalSkull); shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 20, 0, 0); - nextSlot++; + nextSlot++; + } + if (Main.player[Main.myPlayer].GetModPlayer(mod).ZoneAstral && CalamityWorld.spawnAstralMeteor) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("AstralSolution")); + shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 0, 5, 0); + nextSlot++; } - if (Main.player[Main.myPlayer].GetModPlayer(mod).ZoneAstral && CalamityWorld.spawnAstralMeteor) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("AstralSolution")); - shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 0, 5, 0); - nextSlot++; - } } if (type == NPCID.Wizard) { @@ -12004,658 +12213,658 @@ namespace CalamityMod.NPCs { shop.item[nextSlot].SetDefaults(mod.ItemType("CryoKey")); shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 15, 0, 0); - nextSlot++; + nextSlot++; } if (CalamityWorld.downedBrimstoneElemental) { shop.item[nextSlot].SetDefaults(mod.ItemType("CharredIdol")); shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 20, 0, 0); - nextSlot++; + nextSlot++; } if (CalamityWorld.downedCalamitas) { shop.item[nextSlot].SetDefaults(mod.ItemType("BlightedEyeball")); shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 20, 0, 0); - nextSlot++; + nextSlot++; } - if (CalamityWorld.downedAstrageldon) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("AstralChunk")); - shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 25, 0, 0); - nextSlot++; - } - if (CalamityWorld.downedStarGod) + if (CalamityWorld.downedAstrageldon) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("AstralChunk")); + shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 25, 0, 0); + nextSlot++; + } + if (CalamityWorld.downedStarGod) { shop.item[nextSlot].SetDefaults(mod.ItemType("Starcore")); shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 30, 0, 0); - nextSlot++; - shop.item[nextSlot].SetDefaults(ItemID.SpectreStaff); - shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 25, 0, 0); - nextSlot++; - shop.item[nextSlot].SetDefaults(ItemID.InfernoFork); - shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 25, 0, 0); - nextSlot++; - shop.item[nextSlot].SetDefaults(ItemID.ShadowbeamStaff); - shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 25, 0, 0); - nextSlot++; - } + nextSlot++; + shop.item[nextSlot].SetDefaults(ItemID.SpectreStaff); + shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 25, 0, 0); + nextSlot++; + shop.item[nextSlot].SetDefaults(ItemID.InfernoFork); + shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 25, 0, 0); + nextSlot++; + shop.item[nextSlot].SetDefaults(ItemID.ShadowbeamStaff); + shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 25, 0, 0); + nextSlot++; + } if (NPC.downedMoonlord) { shop.item[nextSlot].SetDefaults(ItemID.CelestialSigil); shop.item[nextSlot].shopCustomPrice = Item.buyPrice(3, 0, 0, 0); - nextSlot++; + nextSlot++; } if (CalamityWorld.downedGuardians) { shop.item[nextSlot].SetDefaults(mod.ItemType("ProfanedShard")); shop.item[nextSlot].shopCustomPrice = Item.buyPrice(10, 0, 0, 0); - nextSlot++; + nextSlot++; } } if (type == NPCID.WitchDoctor) { shop.item[nextSlot].SetDefaults(ItemID.Abeemination); shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 8, 0, 0); - nextSlot++; - if (NPC.downedPlantBoss) + nextSlot++; + if (NPC.downedPlantBoss) { - shop.item[nextSlot].SetDefaults(mod.ItemType("BulbofDoom")); - shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 20, 0, 0); - nextSlot++; + shop.item[nextSlot].SetDefaults(mod.ItemType("BulbofDoom")); + shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 20, 0, 0); + nextSlot++; } if (NPC.downedGolemBoss) { - shop.item[nextSlot].SetDefaults(ItemID.SolarTablet); - shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 25, 0, 0); - nextSlot++; - shop.item[nextSlot].SetDefaults(ItemID.LihzahrdPowerCell); + shop.item[nextSlot].SetDefaults(ItemID.SolarTablet); + shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 25, 0, 0); + nextSlot++; + shop.item[nextSlot].SetDefaults(ItemID.LihzahrdPowerCell); shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 30, 0, 0); - nextSlot++; - } + nextSlot++; + } if (CalamityWorld.downedScavenger) { shop.item[nextSlot].SetDefaults(mod.ItemType("AncientMedallion")); shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 50, 0, 0); - nextSlot++; + nextSlot++; } if (CalamityWorld.downedPlaguebringer) { shop.item[nextSlot].SetDefaults(mod.ItemType("Abomination")); shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 50, 0, 0); - nextSlot++; + nextSlot++; } if (CalamityWorld.downedBumble) { shop.item[nextSlot].SetDefaults(mod.ItemType("BirbPheromones")); shop.item[nextSlot].shopCustomPrice = Item.buyPrice(20, 0, 0, 0); - nextSlot++; + nextSlot++; } } if (type == NPCID.TravellingMerchant && Main.moonPhase == 0) { shop.item[nextSlot].SetDefaults(mod.ItemType("FrostBarrier")); - nextSlot++; + nextSlot++; } } - #endregion + #endregion - #region AnyBossNPCS - public static bool AnyBossNPCS() - { - Mod mod = ModLoader.GetMod("CalamityMod"); - for (int i = 0; i < 200; i++) - { - if (Main.npc[i].active && (Main.npc[i].boss || Main.npc[i].type == NPCID.EaterofWorldsHead || Main.npc[i].type == mod.NPCType("SlimeGodRun") || - Main.npc[i].type == mod.NPCType("SlimeGodRunSplit") || Main.npc[i].type == mod.NPCType("SlimeGod") || Main.npc[i].type == mod.NPCType("SlimeGodSplit"))) - { - return true; - } - } - return false; - } - #endregion + #region AnyBossNPCS + public static bool AnyBossNPCS() + { + Mod mod = ModLoader.GetMod("CalamityMod"); + for (int i = 0; i < 200; i++) + { + if (Main.npc[i].active && (Main.npc[i].boss || Main.npc[i].type == NPCID.EaterofWorldsHead || Main.npc[i].type == mod.NPCType("SlimeGodRun") || + Main.npc[i].type == mod.NPCType("SlimeGodRunSplit") || Main.npc[i].type == mod.NPCType("SlimeGod") || Main.npc[i].type == mod.NPCType("SlimeGodSplit"))) + { + return true; + } + } + return false; + } + #endregion - #region AnyLivingPlayers - public static bool AnyLivingPlayers() - { - for (int i = 0; i < 255; i++) - { - if (Main.player[i].active && !Main.player[i].dead && !Main.player[i].ghost) - { - return true; - } - } - return false; - } - #endregion + #region AnyLivingPlayers + public static bool AnyLivingPlayers() + { + for (int i = 0; i < 255; i++) + { + if (Main.player[i].active && !Main.player[i].dead && !Main.player[i].ghost) + { + return true; + } + } + return false; + } + #endregion - #region OldDukeSpawn - public static void OldDukeSpawn(int plr, int Type) - { - Mod mod = ModLoader.GetMod("CalamityMod"); - Player player = Main.player[plr]; - if (!player.active || player.dead) - { - return; - } - int m = 0; - while (m < 1000) - { - Projectile projectile = Main.projectile[m]; - if (projectile.active && projectile.bobber && projectile.owner == plr) - { - int num8 = NPC.NewNPC((int)projectile.Center.X, (int)projectile.Center.Y + 100, mod.NPCType("OldDuke"), 0, 0f, 0f, 0f, 0f, 255); - string typeName2 = Main.npc[num8].TypeName; - if (Main.netMode == 0) - { - Main.NewText(Language.GetTextValue("Announcement.HasAwoken", typeName2), 175, 75, 255, false); - return; - } - if (Main.netMode == 2) - { - NetMessage.BroadcastChatMessage(NetworkText.FromKey("Announcement.HasAwoken", new object[] - { - Main.npc[num8].GetTypeNetName() - }), new Color(175, 75, 255), -1); - return; - } - break; - } - else - { - m++; - } - } - } - #endregion + #region OldDukeSpawn + public static void OldDukeSpawn(int plr, int Type) + { + Mod mod = ModLoader.GetMod("CalamityMod"); + Player player = Main.player[plr]; + if (!player.active || player.dead) + { + return; + } + int m = 0; + while (m < 1000) + { + Projectile projectile = Main.projectile[m]; + if (projectile.active && projectile.bobber && projectile.owner == plr) + { + int num8 = NPC.NewNPC((int)projectile.Center.X, (int)projectile.Center.Y + 100, mod.NPCType("OldDuke"), 0, 0f, 0f, 0f, 0f, 255); + string typeName2 = Main.npc[num8].TypeName; + if (Main.netMode == 0) + { + Main.NewText(Language.GetTextValue("Announcement.HasAwoken", typeName2), 175, 75, 255, false); + return; + } + if (Main.netMode == 2) + { + NetMessage.BroadcastChatMessage(NetworkText.FromKey("Announcement.HasAwoken", new object[] + { + Main.npc[num8].GetTypeNetName() + }), new Color(175, 75, 255), -1); + return; + } + break; + } + else + { + m++; + } + } + } + #endregion - #region DespawnHostileProjectiles - public void DespawnProj() - { - int proj; - for (int x = 0; x < 1000; x = proj + 1) - { - Projectile projectile = Main.projectile[x]; - if (projectile.active && projectile.hostile && !projectile.friendly && projectile.damage > 0) - { - projectile.Kill(); - } - proj = x; - } - } - #endregion + #region DespawnHostileProjectiles + public void DespawnProj() + { + int proj; + for (int x = 0; x < 1000; x = proj + 1) + { + Projectile projectile = Main.projectile[x]; + if (projectile.active && projectile.hostile && !projectile.friendly && projectile.damage > 0) + { + projectile.Kill(); + } + proj = x; + } + } + #endregion - #region Astral things - public static void DoHitDust(NPC npc, int hitDirection, int dustType = 5, float xSpeedMult = 1f, int numHitDust = 5, int numDeathDust = 20) - { - for (int k = 0; k < 5; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, dustType, hitDirection * xSpeedMult, -1f, 0, default(Color), 1f); - } - if (npc.life <= 0) - { - for (int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, dustType, hitDirection * xSpeedMult, -1f, 0, default(Color), 1f); - } - } - } + #region Astral things + public static void DoHitDust(NPC npc, int hitDirection, int dustType = 5, float xSpeedMult = 1f, int numHitDust = 5, int numDeathDust = 20) + { + for (int k = 0; k < 5; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, dustType, hitDirection * xSpeedMult, -1f, 0, default(Color), 1f); + } + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, dustType, hitDirection * xSpeedMult, -1f, 0, default(Color), 1f); + } + } + } - public static void DoFlyingAI(NPC npc, float maxSpeed, float acceleration, float circleTime, float minDistanceTarget = 150f, bool shouldAttackTarget = true) - { - //Pick a new target. - if (npc.target < 0 || npc.target >= 255 || Main.player[npc.target].dead) - { - npc.TargetClosest(true); - } - Player myTarget = Main.player[npc.target]; - Vector2 toTarget = (myTarget.Center - npc.Center); - float distanceToTarget = toTarget.Length(); - Vector2 maxVelocity = toTarget; - if (distanceToTarget < 3f) - { - maxVelocity = npc.velocity; - } - else - { - float magnitude = maxSpeed / distanceToTarget; - maxVelocity *= magnitude; - } - //Circular motion - npc.ai[0]++; - //y motion - if (npc.ai[0] > circleTime * 0.5f) - { - npc.velocity.Y += acceleration; - } - else - { - npc.velocity.Y -= acceleration; - } - //x motion - if (npc.ai[0] < circleTime * 0.25f || npc.ai[0] > circleTime * 0.75f) - { - npc.velocity.X += acceleration; - } - else - { - npc.velocity.X -= acceleration; - } - //reset - if (npc.ai[0] > circleTime) - { - npc.ai[0] = 0f; - } - //if close enough - if (shouldAttackTarget && distanceToTarget < minDistanceTarget) - { - npc.velocity += maxVelocity * 0.007f; - } - if (myTarget.dead) - { - maxVelocity.X = npc.direction * maxSpeed / 2f; - maxVelocity.Y = -maxSpeed / 2f; - } - //maximise velocity - if (npc.velocity.X < maxVelocity.X) - { - npc.velocity.X += acceleration; - } - if (npc.velocity.X > maxVelocity.X) - { - npc.velocity.X -= acceleration; - } - if (npc.velocity.Y < maxVelocity.Y) - { - npc.velocity.Y += acceleration; - } - if (npc.velocity.Y > maxVelocity.Y) - { - npc.velocity.Y -= acceleration; - } - //rotate towards player if alive - if (!myTarget.dead) - { - npc.rotation = toTarget.ToRotation(); - } - else //don't, do velocity instead - { - npc.rotation = npc.velocity.ToRotation(); - } - npc.rotation += MathHelper.Pi; - //tile collision - float collisionDamp = 0.7f; - if (npc.collideX) - { - npc.netUpdate = true; - npc.velocity.X = npc.oldVelocity.X * -collisionDamp; - if (npc.direction == -1 && npc.velocity.X > 0f && npc.velocity.X < 2f) - { - npc.velocity.X = 2f; - } - if (npc.direction == 1 && npc.velocity.X < 0f && npc.velocity.X > -2f) - { - npc.velocity.X = -2f; - } - } - if (npc.collideY) - { - npc.netUpdate = true; - npc.velocity.Y = npc.oldVelocity.Y * -collisionDamp; - if (npc.velocity.Y > 0f && npc.velocity.Y < 1.5f) - { - npc.velocity.Y = 1.5f; - } - if (npc.velocity.Y < 0f && npc.velocity.Y > -1.5f) - { - npc.velocity.Y = -1.5f; - } - } - //water collision - if (npc.wet) - { - if (npc.velocity.Y > 0f) - { - npc.velocity.Y *= 0.95f; - } - npc.velocity.Y -= 0.3f; - if (npc.velocity.Y < -2f) npc.velocity.Y = -2f; - } - //Taken from source. Important for net? - if (((npc.velocity.X > 0f && npc.oldVelocity.X < 0f) || (npc.velocity.X < 0f && npc.oldVelocity.X > 0f) || (npc.velocity.Y > 0f && npc.oldVelocity.Y < 0f) || (npc.velocity.Y < 0f && npc.oldVelocity.Y > 0f)) && !npc.justHit) - { - npc.netUpdate = true; - } - } + public static void DoFlyingAI(NPC npc, float maxSpeed, float acceleration, float circleTime, float minDistanceTarget = 150f, bool shouldAttackTarget = true) + { + //Pick a new target. + if (npc.target < 0 || npc.target >= 255 || Main.player[npc.target].dead) + { + npc.TargetClosest(true); + } + Player myTarget = Main.player[npc.target]; + Vector2 toTarget = (myTarget.Center - npc.Center); + float distanceToTarget = toTarget.Length(); + Vector2 maxVelocity = toTarget; + if (distanceToTarget < 3f) + { + maxVelocity = npc.velocity; + } + else + { + float magnitude = maxSpeed / distanceToTarget; + maxVelocity *= magnitude; + } + //Circular motion + npc.ai[0]++; + //y motion + if (npc.ai[0] > circleTime * 0.5f) + { + npc.velocity.Y += acceleration; + } + else + { + npc.velocity.Y -= acceleration; + } + //x motion + if (npc.ai[0] < circleTime * 0.25f || npc.ai[0] > circleTime * 0.75f) + { + npc.velocity.X += acceleration; + } + else + { + npc.velocity.X -= acceleration; + } + //reset + if (npc.ai[0] > circleTime) + { + npc.ai[0] = 0f; + } + //if close enough + if (shouldAttackTarget && distanceToTarget < minDistanceTarget) + { + npc.velocity += maxVelocity * 0.007f; + } + if (myTarget.dead) + { + maxVelocity.X = npc.direction * maxSpeed / 2f; + maxVelocity.Y = -maxSpeed / 2f; + } + //maximise velocity + if (npc.velocity.X < maxVelocity.X) + { + npc.velocity.X += acceleration; + } + if (npc.velocity.X > maxVelocity.X) + { + npc.velocity.X -= acceleration; + } + if (npc.velocity.Y < maxVelocity.Y) + { + npc.velocity.Y += acceleration; + } + if (npc.velocity.Y > maxVelocity.Y) + { + npc.velocity.Y -= acceleration; + } + //rotate towards player if alive + if (!myTarget.dead) + { + npc.rotation = toTarget.ToRotation(); + } + else //don't, do velocity instead + { + npc.rotation = npc.velocity.ToRotation(); + } + npc.rotation += MathHelper.Pi; + //tile collision + float collisionDamp = 0.7f; + if (npc.collideX) + { + npc.netUpdate = true; + npc.velocity.X = npc.oldVelocity.X * -collisionDamp; + if (npc.direction == -1 && npc.velocity.X > 0f && npc.velocity.X < 2f) + { + npc.velocity.X = 2f; + } + if (npc.direction == 1 && npc.velocity.X < 0f && npc.velocity.X > -2f) + { + npc.velocity.X = -2f; + } + } + if (npc.collideY) + { + npc.netUpdate = true; + npc.velocity.Y = npc.oldVelocity.Y * -collisionDamp; + if (npc.velocity.Y > 0f && npc.velocity.Y < 1.5f) + { + npc.velocity.Y = 1.5f; + } + if (npc.velocity.Y < 0f && npc.velocity.Y > -1.5f) + { + npc.velocity.Y = -1.5f; + } + } + //water collision + if (npc.wet) + { + if (npc.velocity.Y > 0f) + { + npc.velocity.Y *= 0.95f; + } + npc.velocity.Y -= 0.3f; + if (npc.velocity.Y < -2f) npc.velocity.Y = -2f; + } + //Taken from source. Important for net? + if (((npc.velocity.X > 0f && npc.oldVelocity.X < 0f) || (npc.velocity.X < 0f && npc.oldVelocity.X > 0f) || (npc.velocity.Y > 0f && npc.oldVelocity.Y < 0f) || (npc.velocity.Y < 0f && npc.oldVelocity.Y > 0f)) && !npc.justHit) + { + npc.netUpdate = true; + } + } - public static void DoSpiderWallAI(NPC npc, int transformType, float chaseMaxSpeed = 2f, float chaseAcceleration = 0.08f) - { - //GET NEW TARGET - if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead) - { - npc.TargetClosest(); - } - Vector2 between = Main.player[npc.target].Center - npc.Center; - float distance = between.Length(); - //modify vector depending on distance and speed. - if (distance == 0f) - { - between.X = npc.velocity.X; - between.Y = npc.velocity.Y; - } - else - { - distance = chaseMaxSpeed / distance; - between.X *= distance; - between.Y *= distance; - } - //update if target dead. - if (Main.player[npc.target].dead) - { - between.X = (float)npc.direction * chaseMaxSpeed / 2f; - between.Y = -chaseMaxSpeed / 2f; - } - npc.spriteDirection = -1; - //If spider can't see target, circle around to attempt to find the target. - if (!Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) - { - //CIRCULAR MOTION, SIMILAR TO FLYING AI (Eater of Souls etc.) - npc.ai[0]++; - if (npc.ai[0] > 0f) - { - npc.velocity.Y += 0.023f; - } - else - { - npc.velocity.Y -= 0.023f; - } - if (npc.ai[0] < -100f || npc.ai[0] > 100f) - { - npc.velocity.X += 0.023f; - } - else - { - npc.velocity.X -= 0.023f; - } - if (npc.ai[0] > 200f) - { - npc.ai[0] = -200f; - } - npc.velocity.X += between.X * 0.007f; - npc.velocity.Y += between.Y * 0.007f; - npc.rotation = npc.velocity.ToRotation(); - if (npc.velocity.X > 1.5f) - { - npc.velocity.X *= 0.9f; - } - if (npc.velocity.X < -1.5f) - { - npc.velocity.X *= 0.9f; - } - if (npc.velocity.Y > 1.5f) - { - npc.velocity.Y *= 0.9f; - } - if (npc.velocity.Y < -1.5f) - { - npc.velocity.Y *= 0.9f; - } - npc.velocity.X = MathHelper.Clamp(npc.velocity.X, -3f, 3f); - npc.velocity.Y = MathHelper.Clamp(npc.velocity.Y, -3f, 3f); - } - else //CHASE TARGET - { - if (npc.velocity.X < between.X) - { - npc.velocity.X = npc.velocity.X + chaseAcceleration; - if (npc.velocity.X < 0f && between.X > 0f) - { - npc.velocity.X = npc.velocity.X + chaseAcceleration; - } - } - else if (npc.velocity.X > between.X) - { - npc.velocity.X = npc.velocity.X - chaseAcceleration; - if (npc.velocity.X > 0f && between.X < 0f) - { - npc.velocity.X = npc.velocity.X - chaseAcceleration; - } - } - if (npc.velocity.Y < between.Y) - { - npc.velocity.Y = npc.velocity.Y + chaseAcceleration; - if (npc.velocity.Y < 0f && between.Y > 0f) - { - npc.velocity.Y = npc.velocity.Y + chaseAcceleration; - } - } - else if (npc.velocity.Y > between.Y) - { - npc.velocity.Y = npc.velocity.Y - chaseAcceleration; - if (npc.velocity.Y > 0f && between.Y < 0f) - { - npc.velocity.Y = npc.velocity.Y - chaseAcceleration; - } - } - npc.rotation = between.ToRotation(); - } - //DAMP COLLISIONS OFF OF WALLS - float collisionDamp = 0.5f; - if (npc.collideX) - { - npc.netUpdate = true; - npc.velocity.X = npc.oldVelocity.X * -collisionDamp; - if (npc.direction == -1 && npc.velocity.X > 0f && npc.velocity.X < 2f) - { - npc.velocity.X = 2f; - } - if (npc.direction == 1 && npc.velocity.X < 0f && npc.velocity.X > -2f) - { - npc.velocity.X = -2f; - } - } - if (npc.collideY) - { - npc.netUpdate = true; - npc.velocity.Y = npc.oldVelocity.Y * -collisionDamp; - if (npc.velocity.Y > 0f && npc.velocity.Y < 1.5f) - { - npc.velocity.Y = 2f; - } - if (npc.velocity.Y < 0f && npc.velocity.Y > -1.5f) - { - npc.velocity.Y = -2f; - } - } - if (((npc.velocity.X > 0f && npc.oldVelocity.X < 0f) || (npc.velocity.X < 0f && npc.oldVelocity.X > 0f) || (npc.velocity.Y > 0f && npc.oldVelocity.Y < 0f) || (npc.velocity.Y < 0f && npc.oldVelocity.Y > 0f)) && !npc.justHit) - { - npc.netUpdate = true; - } - if (Main.netMode != 1) - { - int x = (int)npc.Center.X / 16; - int y = (int)npc.Center.Y / 16; - bool flag = false; - for (int i = x - 1; i <= x + 1; i++) - { - for (int j = y - 1; j <= y + 1; j++) - { - if (Main.tile[i, j] == null) - { - return; - } - if (Main.tile[i, j].wall > 0) - { - flag = true; - } - } - } - if (!flag) - { - npc.Transform(transformType); - return; - } - } - } + public static void DoSpiderWallAI(NPC npc, int transformType, float chaseMaxSpeed = 2f, float chaseAcceleration = 0.08f) + { + //GET NEW TARGET + if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead) + { + npc.TargetClosest(); + } + Vector2 between = Main.player[npc.target].Center - npc.Center; + float distance = between.Length(); + //modify vector depending on distance and speed. + if (distance == 0f) + { + between.X = npc.velocity.X; + between.Y = npc.velocity.Y; + } + else + { + distance = chaseMaxSpeed / distance; + between.X *= distance; + between.Y *= distance; + } + //update if target dead. + if (Main.player[npc.target].dead) + { + between.X = (float)npc.direction * chaseMaxSpeed / 2f; + between.Y = -chaseMaxSpeed / 2f; + } + npc.spriteDirection = -1; + //If spider can't see target, circle around to attempt to find the target. + if (!Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) + { + //CIRCULAR MOTION, SIMILAR TO FLYING AI (Eater of Souls etc.) + npc.ai[0]++; + if (npc.ai[0] > 0f) + { + npc.velocity.Y += 0.023f; + } + else + { + npc.velocity.Y -= 0.023f; + } + if (npc.ai[0] < -100f || npc.ai[0] > 100f) + { + npc.velocity.X += 0.023f; + } + else + { + npc.velocity.X -= 0.023f; + } + if (npc.ai[0] > 200f) + { + npc.ai[0] = -200f; + } + npc.velocity.X += between.X * 0.007f; + npc.velocity.Y += between.Y * 0.007f; + npc.rotation = npc.velocity.ToRotation(); + if (npc.velocity.X > 1.5f) + { + npc.velocity.X *= 0.9f; + } + if (npc.velocity.X < -1.5f) + { + npc.velocity.X *= 0.9f; + } + if (npc.velocity.Y > 1.5f) + { + npc.velocity.Y *= 0.9f; + } + if (npc.velocity.Y < -1.5f) + { + npc.velocity.Y *= 0.9f; + } + npc.velocity.X = MathHelper.Clamp(npc.velocity.X, -3f, 3f); + npc.velocity.Y = MathHelper.Clamp(npc.velocity.Y, -3f, 3f); + } + else //CHASE TARGET + { + if (npc.velocity.X < between.X) + { + npc.velocity.X = npc.velocity.X + chaseAcceleration; + if (npc.velocity.X < 0f && between.X > 0f) + { + npc.velocity.X = npc.velocity.X + chaseAcceleration; + } + } + else if (npc.velocity.X > between.X) + { + npc.velocity.X = npc.velocity.X - chaseAcceleration; + if (npc.velocity.X > 0f && between.X < 0f) + { + npc.velocity.X = npc.velocity.X - chaseAcceleration; + } + } + if (npc.velocity.Y < between.Y) + { + npc.velocity.Y = npc.velocity.Y + chaseAcceleration; + if (npc.velocity.Y < 0f && between.Y > 0f) + { + npc.velocity.Y = npc.velocity.Y + chaseAcceleration; + } + } + else if (npc.velocity.Y > between.Y) + { + npc.velocity.Y = npc.velocity.Y - chaseAcceleration; + if (npc.velocity.Y > 0f && between.Y < 0f) + { + npc.velocity.Y = npc.velocity.Y - chaseAcceleration; + } + } + npc.rotation = between.ToRotation(); + } + //DAMP COLLISIONS OFF OF WALLS + float collisionDamp = 0.5f; + if (npc.collideX) + { + npc.netUpdate = true; + npc.velocity.X = npc.oldVelocity.X * -collisionDamp; + if (npc.direction == -1 && npc.velocity.X > 0f && npc.velocity.X < 2f) + { + npc.velocity.X = 2f; + } + if (npc.direction == 1 && npc.velocity.X < 0f && npc.velocity.X > -2f) + { + npc.velocity.X = -2f; + } + } + if (npc.collideY) + { + npc.netUpdate = true; + npc.velocity.Y = npc.oldVelocity.Y * -collisionDamp; + if (npc.velocity.Y > 0f && npc.velocity.Y < 1.5f) + { + npc.velocity.Y = 2f; + } + if (npc.velocity.Y < 0f && npc.velocity.Y > -1.5f) + { + npc.velocity.Y = -2f; + } + } + if (((npc.velocity.X > 0f && npc.oldVelocity.X < 0f) || (npc.velocity.X < 0f && npc.oldVelocity.X > 0f) || (npc.velocity.Y > 0f && npc.oldVelocity.Y < 0f) || (npc.velocity.Y < 0f && npc.oldVelocity.Y > 0f)) && !npc.justHit) + { + npc.netUpdate = true; + } + if (Main.netMode != 1) + { + int x = (int)npc.Center.X / 16; + int y = (int)npc.Center.Y / 16; + bool flag = false; + for (int i = x - 1; i <= x + 1; i++) + { + for (int j = y - 1; j <= y + 1; j++) + { + if (Main.tile[i, j] == null) + { + return; + } + if (Main.tile[i, j].wall > 0) + { + flag = true; + } + } + } + if (!flag) + { + npc.Transform(transformType); + return; + } + } + } - public static void DoVultureAI(NPC npc, float acceleration = 0.1f, float maxSpeed = 3f, int sitWidth = 30, int flyWidth = 50, int rangeX = 100, int rangeY = 100) - { - npc.localAI[0]++; - npc.noGravity = true; - npc.TargetClosest(true); - if (npc.ai[0] == 0f) - { - npc.width = sitWidth; - npc.noGravity = false; - if (Main.netMode != 1) - { - if (npc.velocity.X != 0f || npc.velocity.Y < 0f || (double)npc.velocity.Y > 0.3) - { - npc.ai[0] = 1f; - npc.netUpdate = true; - } - else - { - Rectangle playerRect = Main.player[npc.target].getRect(); - Rectangle rangeRect = new Rectangle((int)npc.Center.X - rangeX, (int)npc.Center.Y - rangeY, rangeX * 2, rangeY * 2); - if (npc.localAI[0] > 20f && (rangeRect.Intersects(playerRect) || npc.life < npc.lifeMax)) - { - npc.ai[0] = 1f; - npc.velocity.Y -= 6f; - npc.netUpdate = true; - } - } - } - } - else if (!Main.player[npc.target].dead) - { - npc.width = flyWidth; - //Collision damping - if (npc.collideX) - { - npc.velocity.X = npc.oldVelocity.X * -0.5f; - if (npc.direction == -1 && npc.velocity.X > 0f && npc.velocity.X < 2f) - { - npc.velocity.X = 2f; - } - if (npc.direction == 1 && npc.velocity.X < 0f && npc.velocity.X > -2f) - { - npc.velocity.X = -2f; - } - } - if (npc.collideY) - { - npc.velocity.Y = npc.oldVelocity.Y * -0.5f; - if (npc.velocity.Y > 0f && npc.velocity.Y < 1f) - { - npc.velocity.Y = 1f; - } - if (npc.velocity.Y < 0f && npc.velocity.Y > -1f) - { - npc.velocity.Y = -1f; - } - } - if (npc.direction == -1 && npc.velocity.X > -maxSpeed) - { - npc.velocity.X -= acceleration; - if (npc.velocity.X > maxSpeed) - { - npc.velocity.X = npc.velocity.X - acceleration; - } - else if (npc.velocity.X > 0f) - { - npc.velocity.X = npc.velocity.X - acceleration * 0.5f; - } - if (npc.velocity.X < -maxSpeed) - { - npc.velocity.X = -maxSpeed; - } - } - else if (npc.direction == 1 && npc.velocity.X < maxSpeed) - { - npc.velocity.X = npc.velocity.X + acceleration; - if (npc.velocity.X < -maxSpeed) - { - npc.velocity.X = npc.velocity.X + acceleration; - } - else if (npc.velocity.X < 0f) - { - npc.velocity.X = npc.velocity.X + acceleration * 0.5f; - } - if (npc.velocity.X > maxSpeed) - { - npc.velocity.X = maxSpeed; - } - } - float xDistance = Math.Abs(npc.Center.X - Main.player[npc.target].Center.X); - float yLimiter = Main.player[npc.target].position.Y - (npc.height / 2f); - if (xDistance > 50f) - { - yLimiter -= 100f; - } - if (npc.position.Y < yLimiter) - { - npc.velocity.Y = npc.velocity.Y + acceleration * 0.5f; - if (npc.velocity.Y < 0f) - { - npc.velocity.Y = npc.velocity.Y + acceleration * 0.1f; - } - } - else - { - npc.velocity.Y = npc.velocity.Y - acceleration * 0.5f; - if (npc.velocity.Y > 0f) - { - npc.velocity.Y = npc.velocity.Y - acceleration * 0.1f; - } - } - if (npc.velocity.Y < -maxSpeed) - { - npc.velocity.Y = -maxSpeed; - } - if (npc.velocity.Y > maxSpeed) - { - npc.velocity.Y = maxSpeed; - } - } - //Change velocity if wet. - if (npc.wet) - { - if (npc.velocity.Y > 0f) - { - npc.velocity.Y = npc.velocity.Y * 0.95f; - } - npc.velocity.Y = npc.velocity.Y - 0.5f; - if (npc.velocity.Y < -4f) - { - npc.velocity.Y = -4f; - } - } - } - /// - /// Allows you to spawn dust on the NPC in a certain place. Uses the npc.position value as the base point for the rectangle. - /// Takes direction and rotation into account. - /// - /// The width of the sheet for the NPC. - /// The place to put a dust. - /// The chance to spawn a dust (0.3 = 30%) - public static Dust SpawnDustOnNPC(NPC npc, int frameWidth, int frameHeight, int dustType, Rectangle rect, Vector2 velocity = default(Vector2), float chance = 0.5f, bool useSpriteDirection = false) - { - Vector2 half = new Vector2(frameWidth / 2f, frameHeight / 2f); - //"flip" the rectangle's position x-wise. - if ((!useSpriteDirection && npc.direction == 1) || (useSpriteDirection && npc.spriteDirection == 1)) - { - rect.X = frameWidth - rect.Right; - } - if (Main.rand.NextFloat(1f) < chance) - { - Vector2 offset = (npc.Center - half + new Vector2(Main.rand.NextFloat(rect.Left, rect.Right), Main.rand.NextFloat(rect.Top, rect.Bottom))) - npc.Center; - offset = offset.RotatedBy(npc.rotation); - Dust d = Dust.NewDustPerfect(npc.Center + offset, dustType, velocity); - return d; - } - return null; - } - #endregion - } + public static void DoVultureAI(NPC npc, float acceleration = 0.1f, float maxSpeed = 3f, int sitWidth = 30, int flyWidth = 50, int rangeX = 100, int rangeY = 100) + { + npc.localAI[0]++; + npc.noGravity = true; + npc.TargetClosest(true); + if (npc.ai[0] == 0f) + { + npc.width = sitWidth; + npc.noGravity = false; + if (Main.netMode != 1) + { + if (npc.velocity.X != 0f || npc.velocity.Y < 0f || (double)npc.velocity.Y > 0.3) + { + npc.ai[0] = 1f; + npc.netUpdate = true; + } + else + { + Rectangle playerRect = Main.player[npc.target].getRect(); + Rectangle rangeRect = new Rectangle((int)npc.Center.X - rangeX, (int)npc.Center.Y - rangeY, rangeX * 2, rangeY * 2); + if (npc.localAI[0] > 20f && (rangeRect.Intersects(playerRect) || npc.life < npc.lifeMax)) + { + npc.ai[0] = 1f; + npc.velocity.Y -= 6f; + npc.netUpdate = true; + } + } + } + } + else if (!Main.player[npc.target].dead) + { + npc.width = flyWidth; + //Collision damping + if (npc.collideX) + { + npc.velocity.X = npc.oldVelocity.X * -0.5f; + if (npc.direction == -1 && npc.velocity.X > 0f && npc.velocity.X < 2f) + { + npc.velocity.X = 2f; + } + if (npc.direction == 1 && npc.velocity.X < 0f && npc.velocity.X > -2f) + { + npc.velocity.X = -2f; + } + } + if (npc.collideY) + { + npc.velocity.Y = npc.oldVelocity.Y * -0.5f; + if (npc.velocity.Y > 0f && npc.velocity.Y < 1f) + { + npc.velocity.Y = 1f; + } + if (npc.velocity.Y < 0f && npc.velocity.Y > -1f) + { + npc.velocity.Y = -1f; + } + } + if (npc.direction == -1 && npc.velocity.X > -maxSpeed) + { + npc.velocity.X -= acceleration; + if (npc.velocity.X > maxSpeed) + { + npc.velocity.X = npc.velocity.X - acceleration; + } + else if (npc.velocity.X > 0f) + { + npc.velocity.X = npc.velocity.X - acceleration * 0.5f; + } + if (npc.velocity.X < -maxSpeed) + { + npc.velocity.X = -maxSpeed; + } + } + else if (npc.direction == 1 && npc.velocity.X < maxSpeed) + { + npc.velocity.X = npc.velocity.X + acceleration; + if (npc.velocity.X < -maxSpeed) + { + npc.velocity.X = npc.velocity.X + acceleration; + } + else if (npc.velocity.X < 0f) + { + npc.velocity.X = npc.velocity.X + acceleration * 0.5f; + } + if (npc.velocity.X > maxSpeed) + { + npc.velocity.X = maxSpeed; + } + } + float xDistance = Math.Abs(npc.Center.X - Main.player[npc.target].Center.X); + float yLimiter = Main.player[npc.target].position.Y - (npc.height / 2f); + if (xDistance > 50f) + { + yLimiter -= 100f; + } + if (npc.position.Y < yLimiter) + { + npc.velocity.Y = npc.velocity.Y + acceleration * 0.5f; + if (npc.velocity.Y < 0f) + { + npc.velocity.Y = npc.velocity.Y + acceleration * 0.1f; + } + } + else + { + npc.velocity.Y = npc.velocity.Y - acceleration * 0.5f; + if (npc.velocity.Y > 0f) + { + npc.velocity.Y = npc.velocity.Y - acceleration * 0.1f; + } + } + if (npc.velocity.Y < -maxSpeed) + { + npc.velocity.Y = -maxSpeed; + } + if (npc.velocity.Y > maxSpeed) + { + npc.velocity.Y = maxSpeed; + } + } + //Change velocity if wet. + if (npc.wet) + { + if (npc.velocity.Y > 0f) + { + npc.velocity.Y = npc.velocity.Y * 0.95f; + } + npc.velocity.Y = npc.velocity.Y - 0.5f; + if (npc.velocity.Y < -4f) + { + npc.velocity.Y = -4f; + } + } + } + /// + /// Allows you to spawn dust on the NPC in a certain place. Uses the npc.position value as the base point for the rectangle. + /// Takes direction and rotation into account. + /// + /// The width of the sheet for the NPC. + /// The place to put a dust. + /// The chance to spawn a dust (0.3 = 30%) + public static Dust SpawnDustOnNPC(NPC npc, int frameWidth, int frameHeight, int dustType, Rectangle rect, Vector2 velocity = default(Vector2), float chance = 0.5f, bool useSpriteDirection = false) + { + Vector2 half = new Vector2(frameWidth / 2f, frameHeight / 2f); + //"flip" the rectangle's position x-wise. + if ((!useSpriteDirection && npc.direction == 1) || (useSpriteDirection && npc.spriteDirection == 1)) + { + rect.X = frameWidth - rect.Right; + } + if (Main.rand.NextFloat(1f) < chance) + { + Vector2 offset = (npc.Center - half + new Vector2(Main.rand.NextFloat(rect.Left, rect.Right), Main.rand.NextFloat(rect.Top, rect.Bottom))) - npc.Center; + offset = offset.RotatedBy(npc.rotation); + Dust d = Dust.NewDustPerfect(npc.Center + offset, dustType, velocity); + return d; + } + return null; + } + #endregion + } } \ No newline at end of file diff --git a/NPCs/CeaselessVoid/CeaselessVoid.cs b/NPCs/CeaselessVoid/CeaselessVoid.cs index 7f543a275b..6f9a9d2d77 100644 --- a/NPCs/CeaselessVoid/CeaselessVoid.cs +++ b/NPCs/CeaselessVoid/CeaselessVoid.cs @@ -13,17 +13,17 @@ namespace CalamityMod.NPCs.CeaselessVoid [AutoloadBossHead] public class CeaselessVoid : ModNPC { - private float bossLife; - private float beamPortal = 0f; - private float shootBoost = 0; - private float passedVar = 1f; - + private float bossLife; + private float beamPortal = 0f; + private float shootBoost = 0; + private float passedVar = 1f; + public override void SetStaticDefaults() { DisplayName.SetDefault("Ceaseless Void"); Main.npcFrameCount[npc.type] = 4; } - + public override void SetDefaults() { npc.damage = 0; @@ -32,25 +32,25 @@ namespace CalamityMod.NPCs.CeaselessVoid npc.height = 100; //216 npc.defense = 0; npc.lifeMax = 200; - npc.value = Item.buyPrice(0, 35, 0, 0); - if (Main.expertMode) - { - npc.lifeMax = 400; - } - Mod calamityModMusic = ModLoader.GetMod("CalamityModMusic"); - if (calamityModMusic != null) - music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/ScourgeofTheUniverse"); - else - music = MusicID.Boss3; - if (CalamityWorld.DoGSecondStageCountdown <= 0) - { - if (calamityModMusic != null) - music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/Void"); - else - music = MusicID.Boss3; - } - npc.aiStyle = -1; //new - aiType = -1; //new + if (Main.expertMode) + { + npc.lifeMax = 400; + } + Mod calamityModMusic = ModLoader.GetMod("CalamityModMusic"); + if (calamityModMusic != null) + music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/ScourgeofTheUniverse"); + else + music = MusicID.Boss3; + if (CalamityWorld.DoGSecondStageCountdown <= 0) + { + npc.value = Item.buyPrice(0, 35, 0, 0); + if (calamityModMusic != null) + music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/Void"); + else + music = MusicID.Boss3; + } + npc.aiStyle = -1; //new + aiType = -1; //new npc.knockBackResist = 0f; for (int k = 0; k < npc.buffImmune.Length; k++) { @@ -62,210 +62,213 @@ namespace CalamityMod.NPCs.CeaselessVoid npc.HitSound = SoundID.NPCHit4; npc.DeathSound = SoundID.NPCDeath14; } - + public override void FindFrame(int frameHeight) - { - npc.frameCounter += 0.15f; - npc.frameCounter %= Main.npcFrameCount[npc.type]; - int frame = (int)npc.frameCounter; - npc.frame.Y = frame * frameHeight; - } - - public override void AI() - { - Player player = Main.player[npc.target]; - bool expertMode = (Main.expertMode || CalamityWorld.bossRushActive); - bool revenge = (CalamityWorld.revenge || CalamityWorld.bossRushActive); - CalamityGlobalNPC.voidBoss = npc.whoAmI; - Vector2 vector = npc.Center; - npc.TargetClosest(true); - if (NPC.CountNPCS(mod.NPCType("DarkEnergy")) > 0 || - NPC.CountNPCS(mod.NPCType("DarkEnergy2")) > 0 || - NPC.CountNPCS(mod.NPCType("DarkEnergy3")) > 0) - { - npc.dontTakeDamage = true; - } - else - { - npc.dontTakeDamage = false; - } - if (!player.active || player.dead) - { - npc.TargetClosest(false); - player = Main.player[npc.target]; - if (!player.active || player.dead) - { - npc.velocity = new Vector2(0f, -10f); - CalamityWorld.DoGSecondStageCountdown = 0; - if (Main.netMode == 2) - { - var netMessage = mod.GetPacket(); - netMessage.Write((byte)CalamityModMessageType.DoGCountdownSync); - netMessage.Write(CalamityWorld.DoGSecondStageCountdown); - netMessage.Send(); - } - if (npc.timeLeft > 150) - { - npc.timeLeft = 150; - } - return; - } - } - else if (npc.timeLeft < 2400) - { - npc.timeLeft = 2400; - } - if (Main.netMode != 1) - { - beamPortal += expertMode ? 2f : 1f; - beamPortal += shootBoost; - if (CalamityWorld.death || CalamityWorld.bossRushActive) - { - beamPortal += 4f; - } - if (npc.GetGlobalNPC(mod).enraged) - { - beamPortal += 2f; - } - if (beamPortal >= 1200f) - { - beamPortal = 0f; - npc.TargetClosest(true); - if (Collision.CanHit(npc.position, npc.width, npc.height, player.position, player.width, player.height)) - { - float num941 = 3f; //speed - Vector2 vector104 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)(npc.height / 2)); - float num942 = player.position.X + (float)player.width * 0.5f - vector104.X + (float)Main.rand.Next(-20, 21); - float num943 = player.position.Y + (float)player.height * 0.5f - vector104.Y + (float)Main.rand.Next(-20, 21); - float num944 = (float)Math.Sqrt((double)(num942 * num942 + num943 * num943)); - num944 = num941 / num944; - num942 *= num944; - num943 *= num944; - num942 += (float)Main.rand.Next(-10, 11) * 0.05f; - num943 += (float)Main.rand.Next(-10, 11) * 0.05f; - int num945 = expertMode ? 42 : 58; - int num946 = mod.ProjectileType("DoGBeamPortal"); - vector104.X += num942 * 5f; - vector104.Y += num943 * 5f; - int num947 = Projectile.NewProjectile(vector104.X, vector104.Y, num942, num943, num946, num945, 0f, Main.myPlayer, 0f, 0f); - Main.projectile[num947].timeLeft = 300; - npc.netUpdate = true; - } - if (npc.life <= (int)((double)npc.lifeMax * 0.5) && revenge) - { - float spread = 45f * 0.0174f; - double startAngle = Math.Atan2(npc.velocity.X, npc.velocity.Y) - spread / 2; - double deltaAngle = spread / 8f; - double offsetAngle; - int damage = expertMode ? 42 : 58; - int i; - for (i = 0; i < 4; i++) - { - offsetAngle = (startAngle + deltaAngle * (i + i * i) / 2f) + 32f * i; - Projectile.NewProjectile(npc.Center.X, npc.Center.Y, (float)(Math.Sin(offsetAngle) * 3f), (float)(Math.Cos(offsetAngle) * 3f), mod.ProjectileType("DarkEnergyBall"), damage, 0f, Main.myPlayer, passedVar, 0f); - passedVar += 1f; - } - passedVar = 1f; - } - } - } - float num823 = 10f; - float num824 = 0.2f; - Vector2 vector82 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num825 = player.position.X + (float)(player.width / 2) - vector82.X; - float num826 = player.position.Y + (float)(player.height / 2) - 300f - vector82.Y; - float num827 = (float)Math.Sqrt((double)(num825 * num825 + num826 * num826)); - num827 = num823 / num827; - num825 *= num827; - num826 *= num827; - if (npc.velocity.X < num825) - { - npc.velocity.X = npc.velocity.X + num824; - if (npc.velocity.X < 0f && num825 > 0f) - { - npc.velocity.X = npc.velocity.X + num824; - } - } - else if (npc.velocity.X > num825) - { - npc.velocity.X = npc.velocity.X - num824; - if (npc.velocity.X > 0f && num825 < 0f) - { - npc.velocity.X = npc.velocity.X - num824; - } - } - if (npc.velocity.Y < num826) - { - npc.velocity.Y = npc.velocity.Y + num824; - if (npc.velocity.Y < 0f && num826 > 0f) - { - npc.velocity.Y = npc.velocity.Y + num824; - } - } - else if (npc.velocity.Y > num826) - { - npc.velocity.Y = npc.velocity.Y - num824; - if (npc.velocity.Y > 0f && num826 < 0f) - { - npc.velocity.Y = npc.velocity.Y - num824; - } - } - if (bossLife == 0f && npc.life > 0) - { - bossLife = (float)npc.lifeMax; - } - if (npc.life > 0) - { - if (Main.netMode != 1) - { - int num660 = (int)((double)npc.lifeMax * 0.26); - if ((float)(npc.life + num660) < bossLife) - { - bossLife = (float)npc.life; - shootBoost += 1f; - int glob = revenge ? 8 : 4; - if (bossLife <= 0.5f) - { - glob = revenge ? 16 : 8; - } - for (int num662 = 0; num662 < glob; num662++) - { - Projectile.NewProjectile(npc.Center.X, npc.Center.Y, 0f, 0f, mod.ProjectileType("DarkEnergySpawn"), 0, 0f, Main.myPlayer, 0f, 0f); - } - return; - } - } - } - } - - public override bool StrikeNPC(ref double damage, int defense, ref float knockback, int hitDirection, ref bool crit) - { - damage = (crit ? 2 : 1); - return false; - } - - public override void NPCLoot() { - npc.DropItemInstanced(npc.position, npc.Size, mod.ItemType("DarkPlasma"), Main.rand.Next(2, 4), true); - if (Main.rand.Next(10) == 0) + npc.frameCounter += 0.15f; + npc.frameCounter %= Main.npcFrameCount[npc.type]; + int frame = (int)npc.frameCounter; + npc.frame.Y = frame * frameHeight; + } + + public override void AI() + { + Player player = Main.player[npc.target]; + bool expertMode = (Main.expertMode || CalamityWorld.bossRushActive); + bool revenge = (CalamityWorld.revenge || CalamityWorld.bossRushActive); + CalamityGlobalNPC.voidBoss = npc.whoAmI; + Vector2 vector = npc.Center; + npc.TargetClosest(true); + if (NPC.CountNPCS(mod.NPCType("DarkEnergy")) > 0 || + NPC.CountNPCS(mod.NPCType("DarkEnergy2")) > 0 || + NPC.CountNPCS(mod.NPCType("DarkEnergy3")) > 0) { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CeaselessVoidTrophy")); + npc.dontTakeDamage = true; } - if (Main.rand.Next(3) == 0) + else { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MirrorBlade")); + npc.dontTakeDamage = false; } - if (Main.rand.Next(5) == 0) + if (!player.active || player.dead) { - npc.DropItemInstanced(npc.position, npc.Size, mod.ItemType("ArcanumoftheVoid"), 1, true); + npc.TargetClosest(false); + player = Main.player[npc.target]; + if (!player.active || player.dead) + { + npc.velocity = new Vector2(0f, -10f); + CalamityWorld.DoGSecondStageCountdown = 0; + if (Main.netMode == 2) + { + var netMessage = mod.GetPacket(); + netMessage.Write((byte)CalamityModMessageType.DoGCountdownSync); + netMessage.Write(CalamityWorld.DoGSecondStageCountdown); + netMessage.Send(); + } + if (npc.timeLeft > 150) + { + npc.timeLeft = 150; + } + return; + } + } + else if (npc.timeLeft < 2400) + { + npc.timeLeft = 2400; + } + if (Main.netMode != 1) + { + beamPortal += expertMode ? 2f : 1f; + beamPortal += shootBoost; + if (CalamityWorld.death || CalamityWorld.bossRushActive) + { + beamPortal += 4f; + } + if (npc.GetGlobalNPC(mod).enraged) + { + beamPortal += 2f; + } + if (beamPortal >= 1200f) + { + beamPortal = 0f; + npc.TargetClosest(true); + if (Collision.CanHit(npc.position, npc.width, npc.height, player.position, player.width, player.height)) + { + float num941 = 3f; //speed + Vector2 vector104 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)(npc.height / 2)); + float num942 = player.position.X + (float)player.width * 0.5f - vector104.X + (float)Main.rand.Next(-20, 21); + float num943 = player.position.Y + (float)player.height * 0.5f - vector104.Y + (float)Main.rand.Next(-20, 21); + float num944 = (float)Math.Sqrt((double)(num942 * num942 + num943 * num943)); + num944 = num941 / num944; + num942 *= num944; + num943 *= num944; + num942 += (float)Main.rand.Next(-10, 11) * 0.05f; + num943 += (float)Main.rand.Next(-10, 11) * 0.05f; + int num945 = expertMode ? 42 : 58; + int num946 = mod.ProjectileType("DoGBeamPortal"); + vector104.X += num942 * 5f; + vector104.Y += num943 * 5f; + int num947 = Projectile.NewProjectile(vector104.X, vector104.Y, num942, num943, num946, num945, 0f, Main.myPlayer, 0f, 0f); + Main.projectile[num947].timeLeft = 300; + npc.netUpdate = true; + } + if (npc.life <= (int)((double)npc.lifeMax * 0.5) && revenge) + { + float spread = 45f * 0.0174f; + double startAngle = Math.Atan2(npc.velocity.X, npc.velocity.Y) - spread / 2; + double deltaAngle = spread / 8f; + double offsetAngle; + int damage = expertMode ? 42 : 58; + int i; + for (i = 0; i < 4; i++) + { + offsetAngle = (startAngle + deltaAngle * (i + i * i) / 2f) + 32f * i; + Projectile.NewProjectile(npc.Center.X, npc.Center.Y, (float)(Math.Sin(offsetAngle) * 3f), (float)(Math.Cos(offsetAngle) * 3f), mod.ProjectileType("DarkEnergyBall"), damage, 0f, Main.myPlayer, passedVar, 0f); + passedVar += 1f; + } + passedVar = 1f; + } + } + } + float num823 = 10f; + float num824 = 0.2f; + Vector2 vector82 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float num825 = player.position.X + (float)(player.width / 2) - vector82.X; + float num826 = player.position.Y + (float)(player.height / 2) - 300f - vector82.Y; + float num827 = (float)Math.Sqrt((double)(num825 * num825 + num826 * num826)); + num827 = num823 / num827; + num825 *= num827; + num826 *= num827; + if (npc.velocity.X < num825) + { + npc.velocity.X = npc.velocity.X + num824; + if (npc.velocity.X < 0f && num825 > 0f) + { + npc.velocity.X = npc.velocity.X + num824; + } + } + else if (npc.velocity.X > num825) + { + npc.velocity.X = npc.velocity.X - num824; + if (npc.velocity.X > 0f && num825 < 0f) + { + npc.velocity.X = npc.velocity.X - num824; + } + } + if (npc.velocity.Y < num826) + { + npc.velocity.Y = npc.velocity.Y + num824; + if (npc.velocity.Y < 0f && num826 > 0f) + { + npc.velocity.Y = npc.velocity.Y + num824; + } + } + else if (npc.velocity.Y > num826) + { + npc.velocity.Y = npc.velocity.Y - num824; + if (npc.velocity.Y > 0f && num826 < 0f) + { + npc.velocity.Y = npc.velocity.Y - num824; + } + } + if (bossLife == 0f && npc.life > 0) + { + bossLife = (float)npc.lifeMax; + } + if (npc.life > 0) + { + if (Main.netMode != 1) + { + int num660 = (int)((double)npc.lifeMax * 0.26); + if ((float)(npc.life + num660) < bossLife) + { + bossLife = (float)npc.life; + shootBoost += 1f; + int glob = revenge ? 8 : 4; + if (bossLife <= 0.5f) + { + glob = revenge ? 16 : 8; + } + for (int num662 = 0; num662 < glob; num662++) + { + Projectile.NewProjectile(npc.Center.X, npc.Center.Y, 0f, 0f, mod.ProjectileType("DarkEnergySpawn"), 0, 0f, Main.myPlayer, 0f, 0f); + } + return; + } + } } } - + + public override bool StrikeNPC(ref double damage, int defense, ref float knockback, int hitDirection, ref bool crit) + { + damage = (crit ? 2 : 1); + return false; + } + + public override void NPCLoot() + { + if (CalamityWorld.DoGSecondStageCountdown <= 0) + { + npc.DropItemInstanced(npc.position, npc.Size, mod.ItemType("DarkPlasma"), Main.rand.Next(2, 4), true); + if (Main.rand.Next(10) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CeaselessVoidTrophy")); + } + if (Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MirrorBlade")); + } + if (Main.rand.Next(5) == 0) + { + npc.DropItemInstanced(npc.position, npc.Size, mod.ItemType("ArcanumoftheVoid"), 1, true); + } + } + } + public override void BossLoot(ref string name, ref int potionType) { potionType = ItemID.SuperHealingPotion; } - + public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 5; k++) @@ -298,13 +301,13 @@ namespace CalamityMod.NPCs.CeaselessVoid num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 2f); Main.dust[num624].velocity *= 2f; } - float randomSpread = (float)(Main.rand.Next(-200, 200) / 100); - Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/CeaselessVoid"), 1f); - Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/CeaselessVoid2"), 1f); - Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/CeaselessVoid3"), 1f); - Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/CeaselessVoid4"), 1f); - Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/CeaselessVoid5"), 1f); - } + float randomSpread = (float)(Main.rand.Next(-200, 200) / 100); + Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/CeaselessVoid"), 1f); + Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/CeaselessVoid2"), 1f); + Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/CeaselessVoid3"), 1f); + Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/CeaselessVoid4"), 1f); + Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/CeaselessVoid5"), 1f); + } } } } \ No newline at end of file diff --git a/NPCs/CeaselessVoid/DarkEnergy.cs b/NPCs/CeaselessVoid/DarkEnergy.cs index 01ec4ddd37..c628d7864b 100644 --- a/NPCs/CeaselessVoid/DarkEnergy.cs +++ b/NPCs/CeaselessVoid/DarkEnergy.cs @@ -12,7 +12,7 @@ namespace CalamityMod.NPCs.CeaselessVoid { public class DarkEnergy : ModNPC { - public int invinceTime = 180; + public int invinceTime = 120; public override void SetStaticDefaults() { @@ -23,22 +23,24 @@ namespace CalamityMod.NPCs.CeaselessVoid public override void SetDefaults() { npc.aiStyle = -1; - npc.damage = 120; + npc.damage = 0; + npc.dontTakeDamage = true; npc.width = 80; //324 npc.height = 80; //216 npc.defense = 68; - npc.lifeMax = 3000; + npc.lifeMax = 6000; if (CalamityWorld.DoGSecondStageCountdown <= 0) { - npc.lifeMax = 12000; + npc.lifeMax = 24000; } if (CalamityWorld.bossRushActive) { - npc.lifeMax = 37000; + npc.lifeMax = 44000; } npc.knockBackResist = 0.25f; npc.noGravity = true; npc.noTileCollide = true; + npc.canGhostHeal = false; aiType = -1; for (int k = 0; k < npc.buffImmune.Length; k++) { @@ -62,8 +64,6 @@ namespace CalamityMod.NPCs.CeaselessVoid if (invinceTime > 0) { invinceTime--; - npc.damage = 0; - npc.dontTakeDamage = true; } else { diff --git a/NPCs/CeaselessVoid/DarkEnergy2.cs b/NPCs/CeaselessVoid/DarkEnergy2.cs index bd3165191f..9be67c45c7 100644 --- a/NPCs/CeaselessVoid/DarkEnergy2.cs +++ b/NPCs/CeaselessVoid/DarkEnergy2.cs @@ -12,7 +12,7 @@ namespace CalamityMod.NPCs.CeaselessVoid { public class DarkEnergy2 : ModNPC { - public int invinceTime = 180; + public int invinceTime = 120; public override void SetStaticDefaults() { @@ -23,22 +23,24 @@ namespace CalamityMod.NPCs.CeaselessVoid public override void SetDefaults() { npc.aiStyle = -1; - npc.damage = 120; + npc.damage = 0; + npc.dontTakeDamage = true; npc.width = 80; //324 npc.height = 80; //216 npc.defense = 68; - npc.lifeMax = 3000; + npc.lifeMax = 6000; if (CalamityWorld.DoGSecondStageCountdown <= 0) { - npc.lifeMax = 12000; + npc.lifeMax = 24000; } if (CalamityWorld.bossRushActive) { - npc.lifeMax = 37000; + npc.lifeMax = 44000; } npc.knockBackResist = 0.1f; npc.noGravity = true; npc.noTileCollide = true; + npc.canGhostHeal = false; aiType = -1; for (int k = 0; k < npc.buffImmune.Length; k++) { @@ -62,8 +64,6 @@ namespace CalamityMod.NPCs.CeaselessVoid if (invinceTime > 0) { invinceTime--; - npc.damage = 0; - npc.dontTakeDamage = true; } else { diff --git a/NPCs/CeaselessVoid/DarkEnergy3.cs b/NPCs/CeaselessVoid/DarkEnergy3.cs index 62b3481eb4..3ba107bb93 100644 --- a/NPCs/CeaselessVoid/DarkEnergy3.cs +++ b/NPCs/CeaselessVoid/DarkEnergy3.cs @@ -12,7 +12,7 @@ namespace CalamityMod.NPCs.CeaselessVoid { public class DarkEnergy3 : ModNPC { - public int invinceTime = 180; + public int invinceTime = 120; public override void SetStaticDefaults() { @@ -22,24 +22,26 @@ namespace CalamityMod.NPCs.CeaselessVoid public override void SetDefaults() { - npc.damage = 120; + npc.damage = 0; + npc.dontTakeDamage = true; npc.width = 80; //324 npc.height = 80; //216 npc.defense = 68; - npc.lifeMax = 3000; + npc.lifeMax = 6000; if (CalamityWorld.DoGSecondStageCountdown <= 0) { - npc.lifeMax = 12000; + npc.lifeMax = 24000; } if (CalamityWorld.bossRushActive) { - npc.lifeMax = 37000; + npc.lifeMax = 44000; } npc.aiStyle = -1; //new aiType = -1; //new npc.knockBackResist = 0.3f; npc.noGravity = true; npc.noTileCollide = true; + npc.canGhostHeal = false; for (int k = 0; k < npc.buffImmune.Length; k++) { npc.buffImmune[k] = true; @@ -62,8 +64,6 @@ namespace CalamityMod.NPCs.CeaselessVoid if (invinceTime > 0) { invinceTime--; - npc.damage = 0; - npc.dontTakeDamage = true; } else { diff --git a/NPCs/CosmicWraith/CosmicLantern.cs b/NPCs/CosmicWraith/CosmicLantern.cs index 3f07f57328..8a5fcbf884 100644 --- a/NPCs/CosmicWraith/CosmicLantern.cs +++ b/NPCs/CosmicWraith/CosmicLantern.cs @@ -26,16 +26,13 @@ namespace CalamityMod.NPCs.CosmicWraith npc.width = 25; //324 npc.height = 25; //216 npc.defense = 85; - npc.lifeMax = 100; - if (CalamityWorld.bossRushActive) - { - npc.lifeMax = 5000; - } + npc.lifeMax = 25; npc.alpha = 255; npc.knockBackResist = 0.85f; npc.noGravity = true; npc.dontTakeDamage = true; npc.chaseable = false; + npc.canGhostHeal = false; npc.noTileCollide = true; for (int k = 0; k < npc.buffImmune.Length; k++) { diff --git a/NPCs/CosmicWraith/CosmicWraith.cs b/NPCs/CosmicWraith/CosmicWraith.cs index 4c2993a958..1a641cff79 100644 --- a/NPCs/CosmicWraith/CosmicWraith.cs +++ b/NPCs/CosmicWraith/CosmicWraith.cs @@ -14,21 +14,21 @@ namespace CalamityMod.NPCs.CosmicWraith [AutoloadBossHead] public class CosmicWraith : ModNPC { - private const int CosmicProjectiles = 3; - private const float CosmicAngleSpread = 170; - private int CosmicCountdown = 0; - private float phaseSwitch = 0f; - private float chargeSwitch = 0f; - private int dustTimer = 3; - private float spawnX = 750f; - private float spawnY = 120f; - + private const int CosmicProjectiles = 3; + private const float CosmicAngleSpread = 170; + private int CosmicCountdown = 0; + private float phaseSwitch = 0f; + private float chargeSwitch = 0f; + private int dustTimer = 3; + private float spawnX = 750f; + private float spawnY = 120f; + public override void SetStaticDefaults() { DisplayName.SetDefault("Signus, Envoy of the Devourer"); Main.npcFrameCount[npc.type] = 6; } - + public override void SetDefaults() { npc.npcSlots = 32f; @@ -36,59 +36,55 @@ namespace CalamityMod.NPCs.CosmicWraith npc.width = 130; npc.height = 130; npc.defense = 70; - Mod calamityModMusic = ModLoader.GetMod("CalamityModMusic"); - if (calamityModMusic != null) - music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/ScourgeofTheUniverse"); - else - music = MusicID.Boss4; - npc.lifeMax = CalamityWorld.revenge ? 229500 : 140000; - if (CalamityWorld.death) - { - npc.lifeMax = 209250; - } - if (CalamityWorld.DoGSecondStageCountdown <= 0) - { - if (calamityModMusic != null) - music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/Signus"); - else - music = MusicID.Boss4; - npc.lifeMax = CalamityWorld.revenge ? 445500 : 280000; - if (CalamityWorld.death) - { - npc.lifeMax = 722250; - } - } - if (CalamityWorld.bossRushActive) - { - npc.lifeMax = CalamityWorld.death ? 4800000 : 4300000; - } - npc.knockBackResist = 0f; + Mod calamityModMusic = ModLoader.GetMod("CalamityModMusic"); + if (calamityModMusic != null) + music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/ScourgeofTheUniverse"); + else + music = MusicID.Boss4; + npc.lifeMax = CalamityWorld.revenge ? 109500 : 70000; + if (CalamityWorld.DoGSecondStageCountdown <= 0) + { + npc.value = Item.buyPrice(0, 35, 0, 0); + if (calamityModMusic != null) + music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/Signus"); + else + music = MusicID.Boss4; + npc.lifeMax = CalamityWorld.revenge ? 445500 : 280000; + if (CalamityWorld.death) + { + npc.lifeMax = 722250; + } + } + if (CalamityWorld.bossRushActive) + { + npc.lifeMax = CalamityWorld.death ? 2400000 : 2200000; + } + npc.knockBackResist = 0f; npc.aiStyle = -1; //new - aiType = -1; //new - npc.value = Item.buyPrice(0, 35, 0, 0); + aiType = -1; //new npc.boss = true; - for (int k = 0; k < npc.buffImmune.Length; k++) + for (int k = 0; k < npc.buffImmune.Length; k++) { npc.buffImmune[k] = true; npc.buffImmune[BuffID.Ichor] = false; - npc.buffImmune[BuffID.CursedInferno] = false; - npc.buffImmune[mod.BuffType("ExoFreeze")] = false; - npc.buffImmune[mod.BuffType("AbyssalFlames")] = false; - npc.buffImmune[mod.BuffType("ArmorCrunch")] = false; - npc.buffImmune[mod.BuffType("DemonFlames")] = false; - npc.buffImmune[mod.BuffType("GodSlayerInferno")] = false; - npc.buffImmune[mod.BuffType("Nightwither")] = false; - npc.buffImmune[mod.BuffType("Shred")] = false; - npc.buffImmune[mod.BuffType("WhisperingDeath")] = false; - npc.buffImmune[mod.BuffType("SilvaStun")] = false; - } + npc.buffImmune[BuffID.CursedInferno] = false; + npc.buffImmune[mod.BuffType("ExoFreeze")] = false; + npc.buffImmune[mod.BuffType("AbyssalFlames")] = false; + npc.buffImmune[mod.BuffType("ArmorCrunch")] = false; + npc.buffImmune[mod.BuffType("DemonFlames")] = false; + npc.buffImmune[mod.BuffType("GodSlayerInferno")] = false; + npc.buffImmune[mod.BuffType("Nightwither")] = false; + npc.buffImmune[mod.BuffType("Shred")] = false; + npc.buffImmune[mod.BuffType("WhisperingDeath")] = false; + npc.buffImmune[mod.BuffType("SilvaStun")] = false; + } npc.noGravity = true; npc.noTileCollide = true; npc.netAlways = true; npc.HitSound = SoundID.NPCHit49; npc.DeathSound = SoundID.NPCDeath51; } - + public override void AI() { bool cosmicDust = (double)npc.life <= (double)npc.lifeMax * 0.85; @@ -96,10 +92,10 @@ namespace CalamityMod.NPCs.CosmicWraith bool cosmicRain = (double)npc.life <= (double)npc.lifeMax * 0.65; bool cosmicSpeed = (double)npc.life <= (double)npc.lifeMax * 0.5; bool cosmicTeleport = (double)npc.life <= (double)npc.lifeMax * 0.33; - Player player = Main.player[npc.target]; + Player player = Main.player[npc.target]; bool revenge = (CalamityWorld.revenge || CalamityWorld.bossRushActive); bool expertMode = (Main.expertMode || CalamityWorld.bossRushActive); - npc.TargetClosest(true); + npc.TargetClosest(true); Vector2 vector142 = new Vector2(npc.Center.X, npc.Center.Y); Vector2 vectorCenter = npc.Center; float num1243 = player.Center.X - vector142.X; @@ -119,27 +115,27 @@ namespace CalamityMod.NPCs.CosmicWraith float num1006 = 0.333333343f; float num1007 = 10f; //yes num1006 *= num1005; - for (int num1011 = 0; num1011 < 2; num1011++) - { - if (Main.rand.Next(3) < 1) - { - int num1012 = Dust.NewDust(npc.Center - new Vector2(70f), 70 * 2, 70 * 2, 173, npc.velocity.X * 0.5f, npc.velocity.Y * 0.5f, 90, default(Color), 1.5f); - Main.dust[num1012].noGravity = true; - Main.dust[num1012].velocity *= 0.2f; - Main.dust[num1012].fadeIn = 1f; - } - } + for (int num1011 = 0; num1011 < 2; num1011++) + { + if (Main.rand.Next(3) < 1) + { + int num1012 = Dust.NewDust(npc.Center - new Vector2(70f), 70 * 2, 70 * 2, 173, npc.velocity.X * 0.5f, npc.velocity.Y * 0.5f, 90, default(Color), 1.5f); + Main.dust[num1012].noGravity = true; + Main.dust[num1012].velocity *= 0.2f; + Main.dust[num1012].fadeIn = 1f; + } + } if (Vector2.Distance(player.Center, vectorCenter) > 6400f) { - CalamityWorld.DoGSecondStageCountdown = 0; - if (Main.netMode == 2) - { - var netMessage = mod.GetPacket(); - netMessage.Write((byte)CalamityModMessageType.DoGCountdownSync); - netMessage.Write(CalamityWorld.DoGSecondStageCountdown); - netMessage.Send(); - } - if (npc.timeLeft > 10) + CalamityWorld.DoGSecondStageCountdown = 0; + if (Main.netMode == 2) + { + var netMessage = mod.GetPacket(); + netMessage.Write((byte)CalamityModMessageType.DoGCountdownSync); + netMessage.Write(CalamityWorld.DoGSecondStageCountdown); + netMessage.Send(); + } + if (npc.timeLeft > 10) { npc.timeLeft = 10; } @@ -157,65 +153,76 @@ namespace CalamityMod.NPCs.CosmicWraith CosmicCountdown--; if (CosmicCountdown == 0) { - if (Main.netMode != 1) - { - int speed2 = revenge ? 13 : 12; - if (npc.GetGlobalNPC(mod).enraged) - { - speed2 += 3; - } - float spawnX = Main.rand.Next(1000) - 500 + player.Center.X; - float spawnY = -1000 + player.Center.Y; - Vector2 baseSpawn = new Vector2(spawnX, spawnY); - Vector2 baseVelocity = player.Center - baseSpawn; - baseVelocity.Normalize(); - baseVelocity = baseVelocity * speed2; - int damage = expertMode ? 49 : 62; //360 300 - for (int i = 0; i < CosmicProjectiles; i++) - { - Vector2 spawn2 = baseSpawn; - spawn2.X = spawn2.X + i * 30 - (CosmicProjectiles * 15); - Vector2 velocity = baseVelocity; - velocity = baseVelocity.RotatedBy(MathHelper.ToRadians(-CosmicAngleSpread / 2 + (CosmicAngleSpread * i / (float)CosmicProjectiles))); - velocity.X = velocity.X + 3 * Main.rand.NextFloat() - 1.5f; - int projectile = Projectile.NewProjectile(spawn2.X, spawn2.Y, velocity.X, velocity.Y, mod.ProjectileType("CosmicFlameBurst"), damage, 10f, Main.myPlayer, 0f, 0f); - Main.projectile[projectile].tileCollide = false; - } - } + if (Main.netMode != 1) + { + int speed2 = revenge ? 13 : 12; + if (npc.GetGlobalNPC(mod).enraged) + { + speed2 += 3; + } + float spawnX = Main.rand.Next(1000) - 500 + player.Center.X; + float spawnY = -1000 + player.Center.Y; + Vector2 baseSpawn = new Vector2(spawnX, spawnY); + Vector2 baseVelocity = player.Center - baseSpawn; + baseVelocity.Normalize(); + baseVelocity = baseVelocity * speed2; + int damage = expertMode ? 49 : 62; //360 300 + for (int i = 0; i < CosmicProjectiles; i++) + { + Vector2 spawn2 = baseSpawn; + spawn2.X = spawn2.X + i * 30 - (CosmicProjectiles * 15); + Vector2 velocity = baseVelocity; + velocity = baseVelocity.RotatedBy(MathHelper.ToRadians(-CosmicAngleSpread / 2 + (CosmicAngleSpread * i / (float)CosmicProjectiles))); + velocity.X = velocity.X + 3 * Main.rand.NextFloat() - 1.5f; + int projectile = Projectile.NewProjectile(spawn2.X, spawn2.Y, velocity.X, velocity.Y, mod.ProjectileType("CosmicFlameBurst"), damage, 10f, Main.myPlayer, 0f, 0f); + Main.projectile[projectile].tileCollide = false; + } + } } } - float speed = expertMode ? 6f : 5.5f; - if (speedBoost) - { - speed = expertMode ? 7.5f : 7f; - } - if (npc.GetGlobalNPC(mod).enraged) - { - speed += 3f; - } if (npc.ai[0] <= 2f) { - npc.rotation = npc.velocity.X * 0.04f; + npc.rotation = npc.velocity.X * 0.04f; npc.spriteDirection = ((npc.direction > 0) ? 1 : -1); - if (num1245 < speed) + npc.knockBackResist = 0.05f; + if (expertMode) { - npc.velocity.X = num1243; - npc.velocity.Y = num1244; + npc.knockBackResist *= Main.expertKnockBack; } - else + if (cosmicSpeed) { - num1245 = speed / num1245; - npc.velocity.X = num1243 * num1245; - npc.velocity.Y = num1244 * num1245; + npc.knockBackResist = 0f; } + float speed = expertMode ? 14f : 12f; + if (speedBoost) + { + speed = expertMode ? 16f : 14f; + } + if (npc.GetGlobalNPC(mod).enraged) + { + speed += 3f; + } + Vector2 vector98 = new Vector2(npc.Center.X, npc.Center.Y); + float num795 = player.Center.X - vector98.X; + float num796 = player.Center.Y - vector98.Y; + float num797 = (float)Math.Sqrt((double)(num795 * num795 + num796 * num796)); + num797 = speed / num797; + num795 *= num797; + num796 *= num797; + npc.velocity.X = (npc.velocity.X * 50f + num795) / 51f; + npc.velocity.Y = (npc.velocity.Y * 50f + num796) / 51f; } - if (npc.ai[0] == 0f) + else { - npc.chaseable = true; - if (Main.netMode != 1) + npc.knockBackResist = 0f; + } + if (npc.ai[0] == 0f) + { + npc.chaseable = true; + if (Main.netMode != 1) { npc.localAI[1] += 1f; - if (npc.localAI[1] >= 120f) + if (npc.localAI[1] >= 150f) { npc.localAI[1] = 0f; npc.TargetClosest(true); @@ -246,107 +253,100 @@ namespace CalamityMod.NPCs.CosmicWraith } } } - else if (npc.ai[0] == 1f) + else if (npc.ai[0] == 1f) { - npc.damage = 0; - npc.dontTakeDamage = true; - npc.chaseable = false; - npc.alpha += (cosmicTeleport ? 5 : 4); + npc.damage = 0; + npc.dontTakeDamage = true; + npc.chaseable = false; + npc.alpha += (cosmicTeleport ? 5 : 4); if (npc.alpha >= 255) { npc.alpha = 255; npc.position.X = npc.ai[1] * 16f - (float)(npc.width / 2); npc.position.Y = npc.ai[2] * 16f - (float)(npc.height / 2); npc.ai[0] = 2f; - npc.netUpdate = true; - return; + npc.netUpdate = true; + return; } } - else if (npc.ai[0] == 2f) + else if (npc.ai[0] == 2f) { npc.alpha -= (cosmicTeleport ? 5 : 4); if (npc.alpha <= 0) { - Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 122); - if (Main.netMode != 1 && revenge) - { - int num660 = NPC.NewNPC((int)(Main.player[npc.target].position.X + 750f), (int)(Main.player[npc.target].position.Y), mod.NPCType("SignusBomb"), 0, 0f, 0f, 0f, 0f, 255); - if (Main.netMode == 2) - { - NetMessage.SendData(23, -1, -1, null, num660, 0f, 0f, 0f, 0, 0, 0); - } - int num661 = NPC.NewNPC((int)(Main.player[npc.target].position.X - 750f), (int)(Main.player[npc.target].position.Y), mod.NPCType("SignusBomb"), 0, 0f, 0f, 0f, 0f, 255); - if (Main.netMode == 2) - { - NetMessage.SendData(23, -1, -1, null, num661, 0f, 0f, 0f, 0, 0, 0); - } - for (int num621 = 0; num621 < 5; num621++) - { - int num622 = Dust.NewDust(new Vector2(Main.player[npc.target].position.X + 750f, Main.player[npc.target].position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 2f); - Main.dust[num622].velocity *= 3f; - Main.dust[num622].noGravity = true; - if (Main.rand.Next(2) == 0) - { - Main.dust[num622].scale = 0.5f; - Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; - } - int num623 = Dust.NewDust(new Vector2(Main.player[npc.target].position.X - 750f, Main.player[npc.target].position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 2f); - Main.dust[num623].velocity *= 3f; - Main.dust[num623].noGravity = true; - if (Main.rand.Next(2) == 0) - { - Main.dust[num623].scale = 0.5f; - Main.dust[num623].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; - } - } - for (int num623 = 0; num623 < 20; num623++) - { - int num624 = Dust.NewDust(new Vector2(Main.player[npc.target].position.X + 750f, Main.player[npc.target].position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 3f); - Main.dust[num624].noGravity = true; - Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(Main.player[npc.target].position.X + 750f, Main.player[npc.target].position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 2f); - Main.dust[num624].velocity *= 2f; - int num625 = Dust.NewDust(new Vector2(Main.player[npc.target].position.X - 750f, Main.player[npc.target].position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 3f); - Main.dust[num625].noGravity = true; - Main.dust[num625].velocity *= 5f; - num625 = Dust.NewDust(new Vector2(Main.player[npc.target].position.X - 750f, Main.player[npc.target].position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 2f); - Main.dust[num625].velocity *= 2f; - } - } - npc.damage = expertMode ? 240 : 150; - npc.dontTakeDamage = false; - npc.chaseable = true; - npc.ai[3] += 1f; + Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 122); + if (Main.netMode != 1 && revenge) + { + int num660 = NPC.NewNPC((int)(Main.player[npc.target].position.X + 750f), (int)(Main.player[npc.target].position.Y), mod.NPCType("SignusBomb"), 0, 0f, 0f, 0f, 0f, 255); + if (Main.netMode == 2) + { + NetMessage.SendData(23, -1, -1, null, num660, 0f, 0f, 0f, 0, 0, 0); + } + int num661 = NPC.NewNPC((int)(Main.player[npc.target].position.X - 750f), (int)(Main.player[npc.target].position.Y), mod.NPCType("SignusBomb"), 0, 0f, 0f, 0f, 0f, 255); + if (Main.netMode == 2) + { + NetMessage.SendData(23, -1, -1, null, num661, 0f, 0f, 0f, 0, 0, 0); + } + for (int num621 = 0; num621 < 5; num621++) + { + int num622 = Dust.NewDust(new Vector2(Main.player[npc.target].position.X + 750f, Main.player[npc.target].position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 2f); + Main.dust[num622].velocity *= 3f; + Main.dust[num622].noGravity = true; + if (Main.rand.Next(2) == 0) + { + Main.dust[num622].scale = 0.5f; + Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + } + int num623 = Dust.NewDust(new Vector2(Main.player[npc.target].position.X - 750f, Main.player[npc.target].position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 2f); + Main.dust[num623].velocity *= 3f; + Main.dust[num623].noGravity = true; + if (Main.rand.Next(2) == 0) + { + Main.dust[num623].scale = 0.5f; + Main.dust[num623].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + } + } + for (int num623 = 0; num623 < 20; num623++) + { + int num624 = Dust.NewDust(new Vector2(Main.player[npc.target].position.X + 750f, Main.player[npc.target].position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 3f); + Main.dust[num624].noGravity = true; + Main.dust[num624].velocity *= 5f; + num624 = Dust.NewDust(new Vector2(Main.player[npc.target].position.X + 750f, Main.player[npc.target].position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 2f); + Main.dust[num624].velocity *= 2f; + int num625 = Dust.NewDust(new Vector2(Main.player[npc.target].position.X - 750f, Main.player[npc.target].position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 3f); + Main.dust[num625].noGravity = true; + Main.dust[num625].velocity *= 5f; + num625 = Dust.NewDust(new Vector2(Main.player[npc.target].position.X - 750f, Main.player[npc.target].position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 2f); + Main.dust[num625].velocity *= 2f; + } + } + npc.damage = expertMode ? 240 : 150; + npc.dontTakeDamage = false; + npc.chaseable = true; + npc.ai[3] += 1f; npc.alpha = 0; - if (npc.ai[3] >= 2f) + if (npc.ai[3] >= 2f) { npc.ai[0] = 3f; npc.ai[1] = 0f; npc.ai[2] = 0f; npc.ai[3] = 0f; - } + } else { npc.ai[0] = 0f; } - npc.netUpdate = true; - return; + npc.netUpdate = true; + return; } } - else if (npc.ai[0] == 3f) + else if (npc.ai[0] == 3f) { - npc.dontTakeDamage = false; - npc.chaseable = true; - npc.rotation = npc.velocity.X * 0.04f; + npc.dontTakeDamage = false; + npc.chaseable = true; + npc.rotation = npc.velocity.X * 0.04f; npc.spriteDirection = ((npc.direction > 0) ? 1 : -1); - float num1065 = 6f; //changed from 6 to 7.5 modifies speed while firing projectiles - float num1066 = 0.2f; //changed from 0.075 to 0.09375 modifies speed while firing projectiles - float num10662 = 0.075f; Vector2 vector121 = new Vector2(npc.position.X + (float)(npc.width / 2) + (float)(Main.rand.Next(20) * npc.direction), npc.position.Y + (float)npc.height * 0.8f); - Vector2 vector122 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num1067 = player.position.X + (float)(player.width / 2) - vector122.X; - float num1068 = player.position.Y + (float)(player.height / 2) - 300f - vector122.Y; - float num1069 = (float)Math.Sqrt((double)(num1067 * num1067 + num1068 * num1068)); npc.ai[1] += 1f; bool flag104 = false; if (npc.life < npc.lifeMax / 3 || CalamityWorld.death || CalamityWorld.bossRushActive) @@ -372,10 +372,10 @@ namespace CalamityMod.NPCs.CosmicWraith if (Main.netMode != 1) { float num1070 = 15f; //changed from 10 - if (npc.GetGlobalNPC(mod).enraged) - { - num1070 += 3f; - } + if (npc.GetGlobalNPC(mod).enraged) + { + num1070 += 3f; + } if (cosmicRain) { num1070 += 2f; //changed from 3 not a prob @@ -388,11 +388,11 @@ namespace CalamityMod.NPCs.CosmicWraith { num1070 += 1f; } - if (CalamityWorld.death || CalamityWorld.bossRushActive) - { - num1070 += 1f; - } - float num1071 = player.position.X + (float)player.width * 0.5f - vector121.X + (float)Main.rand.Next(-80, 81); + if (CalamityWorld.death || CalamityWorld.bossRushActive) + { + num1070 += 1f; + } + float num1071 = player.position.X + (float)player.width * 0.5f - vector121.X + (float)Main.rand.Next(-80, 81); float num1072 = player.position.Y + (float)player.height * 0.5f - vector121.Y + (float)Main.rand.Next(-40, 41); float num1073 = (float)Math.Sqrt((double)(num1071 * num1071 + num1072 * num1072)); num1073 = num1070 / num1073; @@ -404,85 +404,52 @@ namespace CalamityMod.NPCs.CosmicWraith Main.projectile[num1076].timeLeft = 240; } } - if (!Collision.CanHit(new Vector2(vector121.X, vector121.Y - 30f), 1, 1, player.position, player.width, player.height)) + if (npc.position.Y > player.position.Y - 150f) //200 { - num1065 = 14f; //changed from 14 not a prob - num1066 = 0.25f; //changed from 0.1 not a prob - num10662 = 0.1f; - vector122 = vector121; - num1067 = player.position.X + (float)(player.width / 2) - vector122.X; - num1068 = player.position.Y + (float)(player.height / 2) - vector122.Y; - num1069 = (float)Math.Sqrt((double)(num1067 * num1067 + num1068 * num1068)); - num1069 = num1065 / num1069; - if (npc.velocity.X < num1067) + if (npc.velocity.Y > 0f) { - npc.velocity.X = npc.velocity.X + num1066; - if (npc.velocity.X < 0f && num1067 > 0f) - { - npc.velocity.X = npc.velocity.X + num1066; - } + npc.velocity.Y = npc.velocity.Y * 0.975f; } - else if (npc.velocity.X > num1067) + npc.velocity.Y = npc.velocity.Y - 0.1f; + if (npc.velocity.Y > 3f) { - npc.velocity.X = npc.velocity.X - num1066; - if (npc.velocity.X > 0f && num1067 < 0f) - { - npc.velocity.X = npc.velocity.X - num1066; - } - } - if (npc.velocity.Y < num1068) - { - npc.velocity.Y = npc.velocity.Y + num10662; - if (npc.velocity.Y < 0f && num1068 > 0f) - { - npc.velocity.Y = npc.velocity.Y + num10662; - } - } - else if (npc.velocity.Y > num1068) - { - npc.velocity.Y = npc.velocity.Y - num10662; - if (npc.velocity.Y > 0f && num1068 < 0f) - { - npc.velocity.Y = npc.velocity.Y - num10662; - } + npc.velocity.Y = 3f; } } - else if (num1069 > 100f) + else if (npc.position.Y < player.position.Y - 400f) //500 { - npc.TargetClosest(true); - npc.spriteDirection = npc.direction; - num1069 = num1065 / num1069; - if (npc.velocity.X < num1067) + if (npc.velocity.Y < 0f) { - npc.velocity.X = npc.velocity.X + num1066; - if (npc.velocity.X < 0f && num1067 > 0f) - { - npc.velocity.X = npc.velocity.X + num1066 * 2f; - } + npc.velocity.Y = npc.velocity.Y * 0.975f; } - else if (npc.velocity.X > num1067) + npc.velocity.Y = npc.velocity.Y + 0.1f; + if (npc.velocity.Y < -3f) { - npc.velocity.X = npc.velocity.X - num1066; - if (npc.velocity.X > 0f && num1067 < 0f) - { - npc.velocity.X = npc.velocity.X - num1066 * 2f; - } + npc.velocity.Y = -3f; } - if (npc.velocity.Y < num1068) + } + if (npc.position.X + (float)(npc.width / 2) > player.position.X + (float)(player.width / 2) + 150f) //100 + { + if (npc.velocity.X > 0f) { - npc.velocity.Y = npc.velocity.Y + num10662; - if (npc.velocity.Y < 0f && num1068 > 0f) - { - npc.velocity.Y = npc.velocity.Y + num10662 * 2f; - } + npc.velocity.X = npc.velocity.X * 0.98f; } - else if (npc.velocity.Y > num1068) + npc.velocity.X = npc.velocity.X - 0.1f; + if (npc.velocity.X > 12f) { - npc.velocity.Y = npc.velocity.Y - num10662; - if (npc.velocity.Y > 0f && num1068 < 0f) - { - npc.velocity.Y = npc.velocity.Y - num10662 * 2f; - } + npc.velocity.X = 12f; + } + } + if (npc.position.X + (float)(npc.width / 2) < player.position.X + (float)(player.width / 2) - 150f) //100 + { + if (npc.velocity.X < 0f) + { + npc.velocity.X = npc.velocity.X * 0.98f; + } + npc.velocity.X = npc.velocity.X + 0.1f; + if (npc.velocity.X < -12f) + { + npc.velocity.X = -12f; } } if (npc.ai[1] > 300f) @@ -495,33 +462,34 @@ namespace CalamityMod.NPCs.CosmicWraith return; } } - else if (npc.ai[0] == 4f) + else if (npc.ai[0] == 4f) { - npc.dontTakeDamage = false; - npc.chaseable = true; - if (Main.netMode != 1) - { - if (NPC.CountNPCS(mod.NPCType("CosmicLantern")) < 5) - { - for (int x = 0; x < 5; x++) - { - int num660 = NPC.NewNPC((int)(Main.player[npc.target].position.X + spawnX), (int)(Main.player[npc.target].position.Y + spawnY), mod.NPCType("CosmicLantern"), 0, 0f, 0f, 0f, 0f, 255); - if (Main.netMode == 2) - { - NetMessage.SendData(23, -1, -1, null, num660, 0f, 0f, 0f, 0, 0, 0); - } - int num661 = NPC.NewNPC((int)(Main.player[npc.target].position.X - spawnX), (int)(Main.player[npc.target].position.Y + spawnY), mod.NPCType("CosmicLantern"), 0, 0f, 0f, 0f, 0f, 255); - if (Main.netMode == 2) - { - NetMessage.SendData(23, -1, -1, null, num661, 0f, 0f, 0f, 0, 0, 0); - } - spawnY -= 60f; - } - spawnY = 120f; - npc.netUpdate = true; - } - } - npc.TargetClosest(false); + npc.damage = expertMode ? 240 : 150; + npc.dontTakeDamage = false; + npc.chaseable = true; + if (Main.netMode != 1) + { + if (NPC.CountNPCS(mod.NPCType("CosmicLantern")) < 5) + { + for (int x = 0; x < 5; x++) + { + int num660 = NPC.NewNPC((int)(Main.player[npc.target].position.X + spawnX), (int)(Main.player[npc.target].position.Y + spawnY), mod.NPCType("CosmicLantern"), 0, 0f, 0f, 0f, 0f, 255); + if (Main.netMode == 2) + { + NetMessage.SendData(23, -1, -1, null, num660, 0f, 0f, 0f, 0, 0, 0); + } + int num661 = NPC.NewNPC((int)(Main.player[npc.target].position.X - spawnX), (int)(Main.player[npc.target].position.Y + spawnY), mod.NPCType("CosmicLantern"), 0, 0f, 0f, 0f, 0f, 255); + if (Main.netMode == 2) + { + NetMessage.SendData(23, -1, -1, null, num661, 0f, 0f, 0f, 0, 0, 0); + } + spawnY -= 60f; + } + spawnY = 120f; + npc.netUpdate = true; + } + } + npc.TargetClosest(false); npc.rotation = npc.velocity.ToRotation(); if (Math.Sign(npc.velocity.X) != 0) { @@ -537,7 +505,7 @@ namespace CalamityMod.NPCs.CosmicWraith } npc.spriteDirection = Math.Sign(npc.velocity.X); phaseSwitch += 1f; - if (chargeSwitch == 0f) + if (chargeSwitch == 0f) { float scaleFactor6 = num998; Vector2 center4 = npc.Center; @@ -558,32 +526,32 @@ namespace CalamityMod.NPCs.CosmicWraith { npc.velocity.X = (npc.velocity.X * (num1000 - 1f) + vector127.X) / (cosmicSpeed ? 11.75f : 14.8f); //num1000 12f 15f npc.velocity.Y = (npc.velocity.Y * (num1000 - 1f) + vector127.Y) / (cosmicSpeed ? 11.75f : 14.8f); //num1000 12f 15f - if (!flag64) + if (!flag64) { npc.ai[3] += 1f; - if (npc.ai[3] == 120f) + if (npc.ai[3] == 120f) { npc.netUpdate = true; } - } + } else { npc.ai[3] = 0f; } - } - else + } + else { chargeSwitch = 1f; npc.ai[2] = vector126.X; npc.ai[3] = vector126.Y; npc.netUpdate = true; } - } - else if (chargeSwitch == 1f) + } + else if (chargeSwitch == 1f) { npc.velocity *= scaleFactor4; npc.ai[1] += 1f; - if (npc.ai[1] >= num1001) + if (npc.ai[1] >= num1001) { chargeSwitch = 2f; npc.ai[1] = 0f; @@ -593,8 +561,8 @@ namespace CalamityMod.NPCs.CosmicWraith velocity *= scaleFactor5; npc.velocity = velocity; } - } - else if (chargeSwitch == 2f) + } + else if (chargeSwitch == 2f) { if (Main.netMode != 1) { @@ -607,16 +575,16 @@ namespace CalamityMod.NPCs.CosmicWraith int projectile = Projectile.NewProjectile((int)vector173.X, (int)vector173.Y, (float)(npc.direction * 2), 4f, mod.ProjectileType("EssenceDust"), damage, 0f, Main.myPlayer, 0f, 0f); //changed Main.projectile[projectile].timeLeft = 60; Main.projectile[projectile].velocity.X = 0f; - Main.projectile[projectile].velocity.Y = 0f; - dustTimer = 3; + Main.projectile[projectile].velocity.Y = 0f; + dustTimer = 3; } } + npc.damage = expertMode ? 320 : 200; float num1016 = num1003; npc.ai[1] += 1f; bool flag65 = Vector2.Distance(npc.Center, player.Center) > num1004 && npc.Center.Y > player.Center.Y; if ((npc.ai[1] >= num1016 && flag65) || npc.velocity.Length() < num1007) { - chargeSwitch = 0f; npc.ai[1] = 0f; npc.ai[2] = 0f; npc.ai[3] = 0f; @@ -624,24 +592,24 @@ namespace CalamityMod.NPCs.CosmicWraith npc.netUpdate = true; npc.ai[1] = 45f; chargeSwitch = 4f; - } - else + } + else { Vector2 center6 = npc.Center; Vector2 center7 = player.Center; Vector2 vec2 = center7 - center6; vec2.Normalize(); - if (vec2.HasNaNs()) + if (vec2.HasNaNs()) { vec2 = new Vector2((float)npc.direction, 0f); } npc.velocity = (npc.velocity * (num1005 - 1f) + vec2 * (npc.velocity.Length() + num1006)) / (cosmicSpeed ? 11.65f : 14.75f); //num1005 12f 15f } - } - else if (chargeSwitch == 4f) + } + else if (chargeSwitch == 4f) { npc.ai[1] -= 3f; - if (npc.ai[1] <= 0f) + if (npc.ai[1] <= 0f) { chargeSwitch = 0f; npc.ai[1] = 0f; @@ -651,6 +619,7 @@ namespace CalamityMod.NPCs.CosmicWraith } if (phaseSwitch > 300f) { + npc.damage = expertMode ? 240 : 150; npc.ai[0] = 0f; npc.ai[1] = 0f; npc.ai[2] = 0f; @@ -663,126 +632,129 @@ namespace CalamityMod.NPCs.CosmicWraith } } - public override bool CanHitPlayer(Player target, ref int cooldownSlot) + public override bool CanHitPlayer(Player target, ref int cooldownSlot) { cooldownSlot = 1; return true; } - public override void FindFrame(int frameHeight) - { - npc.frameCounter += 1.0; - if (npc.ai[0] == 4f) - { - if (npc.frameCounter > 72.0) //12 - { - npc.frameCounter = 0.0; - } - } - else - { - int frameY = 196; - if (npc.frameCounter > 72.0) - { - npc.frameCounter = 0.0; - } - npc.frame.Y = frameY * (int)(npc.frameCounter / 12.0); //1 to 6 - if (npc.frame.Y >= frameHeight * 6) - { - npc.frame.Y = 0; - } - } - } + public override void FindFrame(int frameHeight) + { + npc.frameCounter += 1.0; + if (npc.ai[0] == 4f) + { + if (npc.frameCounter > 72.0) //12 + { + npc.frameCounter = 0.0; + } + } + else + { + int frameY = 196; + if (npc.frameCounter > 72.0) + { + npc.frameCounter = 0.0; + } + npc.frame.Y = frameY * (int)(npc.frameCounter / 12.0); //1 to 6 + if (npc.frame.Y >= frameHeight * 6) + { + npc.frame.Y = 0; + } + } + } - public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) - { - Mod mod = ModLoader.GetMod("CalamityMod"); - Texture2D NPCTexture = Main.npcTexture[npc.type]; - SpriteEffects spriteEffects = SpriteEffects.None; - if (npc.spriteDirection == 1) - { - spriteEffects = SpriteEffects.FlipHorizontally; - } - Color lightColor = (drawColor != null ? (Color)drawColor : CalamityMod.GetNPCColor(((NPC)npc), npc.Center, false)); - int frameCount = Main.npcFrameCount[npc.type]; - float scale = npc.scale; - float rotation = npc.rotation; - float offsetY = npc.gfxOffY; - if (npc.ai[0] == 4f) - { - NPCTexture = mod.GetTexture("NPCs/CosmicWraith/CosmicWraithAlt2"); - int height = 564; - int width = 176; - Vector2 vector = new Vector2((float)(width / 2), (float)(height / frameCount / 2)); - Microsoft.Xna.Framework.Rectangle frame = new Rectangle(0, 0, width, height / frameCount); - frame.Y = 94 * (int)(npc.frameCounter / 12.0); //1 to 6 - if (frame.Y >= 94 * 6) - { - frame.Y = 0; - } - Main.spriteBatch.Draw(NPCTexture, - new Vector2(npc.position.X - Main.screenPosition.X + (float)(npc.width / 2) - (float)width * scale / 2f + vector.X * scale, - npc.position.Y - Main.screenPosition.Y + (float)npc.height - (float)height * scale / (float)frameCount + 4f + vector.Y * scale + 0f + offsetY), - new Microsoft.Xna.Framework.Rectangle?(frame), - npc.GetAlpha(lightColor), - rotation, - vector, - scale, - spriteEffects, - 0f); - return false; - } - else if (npc.ai[0] == 3f) - { - NPCTexture = mod.GetTexture("NPCs/CosmicWraith/CosmicWraithAlt"); - } - else - { - NPCTexture = Main.npcTexture[npc.type]; - } - Microsoft.Xna.Framework.Rectangle frame2 = npc.frame; - Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / frameCount / 2)); - Main.spriteBatch.Draw(NPCTexture, - new Vector2(npc.position.X - Main.screenPosition.X + (float)(npc.width / 2) - (float)Main.npcTexture[npc.type].Width * scale / 2f + vector11.X * scale, - npc.position.Y - Main.screenPosition.Y + (float)npc.height - (float)Main.npcTexture[npc.type].Height * scale / (float)frameCount + 4f + vector11.Y * scale + 0f + offsetY), - new Microsoft.Xna.Framework.Rectangle?(frame2), - npc.GetAlpha(lightColor), - rotation, - vector11, - scale, - spriteEffects, - 0f); - return false; - } + public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) + { + Mod mod = ModLoader.GetMod("CalamityMod"); + Texture2D NPCTexture = Main.npcTexture[npc.type]; + SpriteEffects spriteEffects = SpriteEffects.None; + if (npc.spriteDirection == 1) + { + spriteEffects = SpriteEffects.FlipHorizontally; + } + Color lightColor = (drawColor != null ? (Color)drawColor : CalamityMod.GetNPCColor(((NPC)npc), npc.Center, false)); + int frameCount = Main.npcFrameCount[npc.type]; + float scale = npc.scale; + float rotation = npc.rotation; + float offsetY = npc.gfxOffY; + if (npc.ai[0] == 4f) + { + NPCTexture = mod.GetTexture("NPCs/CosmicWraith/CosmicWraithAlt2"); + int height = 564; + int width = 176; + Vector2 vector = new Vector2((float)(width / 2), (float)(height / frameCount / 2)); + Microsoft.Xna.Framework.Rectangle frame = new Rectangle(0, 0, width, height / frameCount); + frame.Y = 94 * (int)(npc.frameCounter / 12.0); //1 to 6 + if (frame.Y >= 94 * 6) + { + frame.Y = 0; + } + Main.spriteBatch.Draw(NPCTexture, + new Vector2(npc.position.X - Main.screenPosition.X + (float)(npc.width / 2) - (float)width * scale / 2f + vector.X * scale, + npc.position.Y - Main.screenPosition.Y + (float)npc.height - (float)height * scale / (float)frameCount + 4f + vector.Y * scale + 0f + offsetY), + new Microsoft.Xna.Framework.Rectangle?(frame), + npc.GetAlpha(lightColor), + rotation, + vector, + scale, + spriteEffects, + 0f); + return false; + } + else if (npc.ai[0] == 3f) + { + NPCTexture = mod.GetTexture("NPCs/CosmicWraith/CosmicWraithAlt"); + } + else + { + NPCTexture = Main.npcTexture[npc.type]; + } + Microsoft.Xna.Framework.Rectangle frame2 = npc.frame; + Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / frameCount / 2)); + Main.spriteBatch.Draw(NPCTexture, + new Vector2(npc.position.X - Main.screenPosition.X + (float)(npc.width / 2) - (float)Main.npcTexture[npc.type].Width * scale / 2f + vector11.X * scale, + npc.position.Y - Main.screenPosition.Y + (float)npc.height - (float)Main.npcTexture[npc.type].Height * scale / (float)frameCount + 4f + vector11.Y * scale + 0f + offsetY), + new Microsoft.Xna.Framework.Rectangle?(frame2), + npc.GetAlpha(lightColor), + rotation, + vector11, + scale, + spriteEffects, + 0f); + return false; + } - public override void BossLoot(ref string name, ref int potionType) + public override void BossLoot(ref string name, ref int potionType) { potionType = ItemID.SuperHealingPotion; } - + public override void NPCLoot() { - npc.DropItemInstanced(npc.position, npc.Size, mod.ItemType("TwistingNether"), Main.rand.Next(2, 4), true); - if (Main.rand.Next(10) == 0) + if (CalamityWorld.DoGSecondStageCountdown <= 0) { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SignusTrophy")); - } - if (Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CosmicKunai")); - } - if (Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Cosmilamp")); + npc.DropItemInstanced(npc.position, npc.Size, mod.ItemType("TwistingNether"), Main.rand.Next(2, 4), true); + if (Main.rand.Next(10) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SignusTrophy")); + } + if (Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CosmicKunai")); + } + if (Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Cosmilamp")); + } } } - + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { npc.lifeMax = (int)(npc.lifeMax * 0.8f * bossLifeScale); npc.damage = (int)(npc.damage * 0.8f); } - + public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 3; k++) @@ -815,15 +787,15 @@ namespace CalamityMod.NPCs.CosmicWraith num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 2f); Main.dust[num624].velocity *= 2f; } - float randomSpread = (float)(Main.rand.Next(-200, 200) / 100); - Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/Signus"), 1f); - Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/Signus2"), 1f); - Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/Signus3"), 1f); - Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/Signus4"), 1f); - Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/Signus5"), 1f); - } + float randomSpread = (float)(Main.rand.Next(-200, 200) / 100); + Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/Signus"), 1f); + Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/Signus2"), 1f); + Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/Signus3"), 1f); + Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/Signus4"), 1f); + Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/Signus5"), 1f); + } } - + public override void OnHitPlayer(Player player, int damage, bool crit) { if (CalamityWorld.revenge) diff --git a/NPCs/Crabulon/CrabShroom.cs b/NPCs/Crabulon/CrabShroom.cs index 6e25c9b103..0d4399ad41 100644 --- a/NPCs/Crabulon/CrabShroom.cs +++ b/NPCs/Crabulon/CrabShroom.cs @@ -32,6 +32,7 @@ namespace CalamityMod.NPCs.Crabulon npc.knockBackResist = 0.75f; npc.noGravity = true; npc.noTileCollide = true; + npc.canGhostHeal = false; npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; } diff --git a/NPCs/Crabulon/CrabulonIdle.cs b/NPCs/Crabulon/CrabulonIdle.cs index 36dbce043d..adfdd23705 100644 --- a/NPCs/Crabulon/CrabulonIdle.cs +++ b/NPCs/Crabulon/CrabulonIdle.cs @@ -13,14 +13,14 @@ namespace CalamityMod.NPCs.Crabulon [AutoloadBossHead] public class CrabulonIdle : ModNPC { - private float shotSpacing = 1000f; + private float shotSpacing = 1000f; public override void SetStaticDefaults() { DisplayName.SetDefault("Crabulon"); Main.npcFrameCount[npc.type] = 6; } - + public override void SetDefaults() { npc.npcSlots = 14f; @@ -29,31 +29,33 @@ namespace CalamityMod.NPCs.Crabulon npc.height = 154; //216 npc.defense = 8; npc.lifeMax = CalamityWorld.revenge ? 2640 : 1800; - if (CalamityWorld.death) - { - npc.lifeMax = 6930; - } - if (CalamityWorld.bossRushActive) - { - npc.lifeMax = CalamityWorld.death ? 4500000 : 3900000; - } - npc.aiStyle = -1; //new - aiType = -1; //new - npc.noGravity = false; + if (CalamityWorld.death) + { + npc.lifeMax = 6930; + } + if (CalamityWorld.bossRushActive) + { + npc.lifeMax = CalamityWorld.death ? 2300000 : 2000000; + } + npc.aiStyle = -1; //new + aiType = -1; //new + npc.buffImmune[mod.BuffType("GlacialState")] = true; + npc.buffImmune[mod.BuffType("TemporalSadness")] = true; + npc.noGravity = false; npc.noTileCollide = false; - Mod calamityModMusic = ModLoader.GetMod("CalamityModMusic"); - if (calamityModMusic != null) - music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/Crabulon"); - else - music = MusicID.Boss4; - npc.boss = true; - npc.knockBackResist = 0f; + Mod calamityModMusic = ModLoader.GetMod("CalamityModMusic"); + if (calamityModMusic != null) + music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/Crabulon"); + else + music = MusicID.Boss4; + npc.boss = true; + npc.knockBackResist = 0f; npc.value = Item.buyPrice(0, 4, 0, 0); npc.HitSound = SoundID.NPCHit45; npc.DeathSound = SoundID.NPCDeath1; bossBag = mod.ItemType("CrabulonBag"); } - + public override void AI() { Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 0f, 0.5f, 1f); @@ -83,87 +85,87 @@ namespace CalamityMod.NPCs.Crabulon npc.timeLeft = 1800; } } - if (npc.ai[0] != 0f && npc.ai[0] < 3f) - { - Vector2 vector34 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num349 = player.position.X + (float)(player.width / 2) - vector34.X; - float num350 = player.position.Y + (float)(player.height / 2) - vector34.Y; - float num351 = (float)Math.Sqrt((double)(num349 * num349 + num350 * num350)); - num349 *= num351; - num350 *= num351; - if (Main.netMode != 1) - { - int num352 = 1; - npc.localAI[3] += 2f; - if (CalamityWorld.bossRushActive) - { - npc.localAI[3] += 2f; - num352 += 3; - } - if ((double)npc.life < (double)npc.lifeMax * 0.5 || CalamityWorld.bossRushActive) - { - npc.localAI[3] += 1f; - num352 += 2; - } - if ((double)npc.life < (double)npc.lifeMax * 0.1 || CalamityWorld.bossRushActive) - { - npc.localAI[3] += 2f; - num352 += 3; - } - if (npc.ai[3] == 0f) - { - if (npc.localAI[3] > 600f) - { - npc.ai[3] = 1f; - npc.localAI[3] = 0f; - } - } - else if (npc.localAI[3] > 45f) - { - npc.localAI[3] = 0f; - npc.ai[3] += 1f; - if (npc.ai[3] >= (float)num352) - { - npc.ai[3] = 0f; - } - float num353 = 10f; - int num354 = expertMode ? 11 : 14; - int num355 = mod.ProjectileType("MushBomb"); - Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 42); - if (CalamityWorld.bossRushActive) - { - num354 += 3; - num353 += 3f; - } - if ((double)npc.life < (double)npc.lifeMax * 0.5 || CalamityWorld.bossRushActive) - { - num354++; - num353 += 1f; - } - if ((double)npc.life < (double)npc.lifeMax * 0.1 || CalamityWorld.bossRushActive) - { - num354++; - num353 += 1f; - } - if (CalamityWorld.death || CalamityWorld.bossRushActive) - { - num354 += 3; - num353 += 1f; - } - vector34 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - num349 = player.position.X + (float)player.width * 0.5f - vector34.X; - num350 = player.position.Y + (float)player.height * 0.5f - vector34.Y; - num351 = (float)Math.Sqrt((double)(num349 * num349 + num350 * num350)); - num351 = num353 / num351; - num349 *= num351; - num350 *= num351; - vector34.X += num349; - vector34.Y += num350; - Projectile.NewProjectile(vector34.X, vector34.Y, num349, num350 - 5f, num355, num354, 0f, Main.myPlayer, 0f, 0f); - } - } - } - if (npc.ai[0] == 0f) + if (npc.ai[0] != 0f && npc.ai[0] < 3f) + { + Vector2 vector34 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float num349 = player.position.X + (float)(player.width / 2) - vector34.X; + float num350 = player.position.Y + (float)(player.height / 2) - vector34.Y; + float num351 = (float)Math.Sqrt((double)(num349 * num349 + num350 * num350)); + num349 *= num351; + num350 *= num351; + if (Main.netMode != 1) + { + int num352 = 1; + npc.localAI[3] += 2f; + if (CalamityWorld.bossRushActive) + { + npc.localAI[3] += 2f; + num352 += 3; + } + if ((double)npc.life < (double)npc.lifeMax * 0.5 || CalamityWorld.bossRushActive) + { + npc.localAI[3] += 1f; + num352 += 2; + } + if ((double)npc.life < (double)npc.lifeMax * 0.1 || CalamityWorld.bossRushActive) + { + npc.localAI[3] += 2f; + num352 += 3; + } + if (npc.ai[3] == 0f) + { + if (npc.localAI[3] > 600f) + { + npc.ai[3] = 1f; + npc.localAI[3] = 0f; + } + } + else if (npc.localAI[3] > 45f) + { + npc.localAI[3] = 0f; + npc.ai[3] += 1f; + if (npc.ai[3] >= (float)num352) + { + npc.ai[3] = 0f; + } + float num353 = 10f; + int num354 = expertMode ? 11 : 14; + int num355 = mod.ProjectileType("MushBomb"); + Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 42); + if (CalamityWorld.bossRushActive) + { + num354 += 3; + num353 += 3f; + } + if ((double)npc.life < (double)npc.lifeMax * 0.5 || CalamityWorld.bossRushActive) + { + num354++; + num353 += 1f; + } + if ((double)npc.life < (double)npc.lifeMax * 0.1 || CalamityWorld.bossRushActive) + { + num354++; + num353 += 1f; + } + if (CalamityWorld.death || CalamityWorld.bossRushActive) + { + num354 += 3; + num353 += 1f; + } + vector34 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + num349 = player.position.X + (float)player.width * 0.5f - vector34.X; + num350 = player.position.Y + (float)player.height * 0.5f - vector34.Y; + num351 = (float)Math.Sqrt((double)(num349 * num349 + num350 * num350)); + num351 = num353 / num351; + num349 *= num351; + num350 *= num351; + vector34.X += num349; + vector34.Y += num350; + Projectile.NewProjectile(vector34.X, vector34.Y, num349, num350 - 5f, num355, num354, 0f, Main.myPlayer, 0f, 0f); + } + } + } + if (npc.ai[0] == 0f) { if (Main.netMode != 2) { @@ -175,14 +177,14 @@ namespace CalamityMod.NPCs.Crabulon int sporeDust = Dust.NewDust(npc.position, npc.width, npc.height, 56, npc.velocity.X, npc.velocity.Y, 255, new Color(0, 80, 255, 80), npc.scale * 1.2f); Main.dust[sporeDust].noGravity = true; Main.dust[sporeDust].velocity *= 0.5f; - npc.damage = 0; - npc.ai[1] += 1f; - if (npc.justHit || npc.ai[1] >= 420f) + npc.damage = 0; + npc.ai[1] += 1f; + if (npc.justHit || npc.ai[1] >= 420f) { npc.ai[0] = 1f; - npc.ai[1] = 0f; - npc.netUpdate = true; - } + npc.ai[1] = 0f; + npc.netUpdate = true; + } } else if (npc.ai[0] == 1f) { @@ -196,46 +198,46 @@ namespace CalamityMod.NPCs.Crabulon npc.noTileCollide = true; npc.ai[0] = 2f; npc.ai[1] = 0f; - npc.netUpdate = true; - } + npc.netUpdate = true; + } } else if (npc.ai[0] == 2f) { - npc.damage = expertMode ? 64 : 40; - float num823 = 1.25f; + npc.damage = expertMode ? 64 : 40; + float num823 = 1.25f; bool flag51 = false; - if ((double)npc.life < (double)npc.lifeMax * 0.5 || CalamityWorld.bossRushActive) + if ((double)npc.life < (double)npc.lifeMax * 0.5 || CalamityWorld.bossRushActive) { num823 = 1.5f; } - if ((double)npc.life < (double)npc.lifeMax * 0.1 || CalamityWorld.bossRushActive) + if ((double)npc.life < (double)npc.lifeMax * 0.1 || CalamityWorld.bossRushActive) { num823 = 2f; } - if (npc.GetGlobalNPC(mod).enraged) - { - num823 = 8f; - } - if (Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) < 50f) + if (npc.GetGlobalNPC(mod).enraged) + { + num823 = 8f; + } + if (Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) < 50f) { flag51 = true; } - if (flag51) + if (flag51) { npc.velocity.X = npc.velocity.X * 0.9f; - if ((double)npc.velocity.X > -0.1 && (double)npc.velocity.X < 0.1) + if ((double)npc.velocity.X > -0.1 && (double)npc.velocity.X < 0.1) { npc.velocity.X = 0f; } - } - else + } + else { - npc.direction = -Main.player[npc.target].direction; - if (npc.direction > 0) + npc.direction = -Main.player[npc.target].direction; + if (npc.direction > 0) { npc.velocity.X = (npc.velocity.X * 20f + num823) / 21f; } - if (npc.direction < 0) + if (npc.direction < 0) { npc.velocity.X = (npc.velocity.X * 20f - num823) / 21f; } @@ -244,44 +246,44 @@ namespace CalamityMod.NPCs.Crabulon int num855 = 20; Vector2 position2 = new Vector2(npc.Center.X - (float)(num854 / 2), npc.position.Y + (float)npc.height - (float)num855); bool flag52 = false; - if (npc.position.X < Main.player[npc.target].position.X && npc.position.X + (float)npc.width > Main.player[npc.target].position.X + (float)Main.player[npc.target].width && npc.position.Y + (float)npc.height < Main.player[npc.target].position.Y + (float)Main.player[npc.target].height - 16f) + if (npc.position.X < Main.player[npc.target].position.X && npc.position.X + (float)npc.width > Main.player[npc.target].position.X + (float)Main.player[npc.target].width && npc.position.Y + (float)npc.height < Main.player[npc.target].position.Y + (float)Main.player[npc.target].height - 16f) { flag52 = true; } - if (flag52) + if (flag52) { npc.velocity.Y = npc.velocity.Y + 0.5f; - } + } else if (Collision.SolidCollision(position2, num854, num855)) { - if (npc.velocity.Y > 0f) + if (npc.velocity.Y > 0f) { npc.velocity.Y = 0f; } - if ((double)npc.velocity.Y > -0.2) + if ((double)npc.velocity.Y > -0.2) { npc.velocity.Y = npc.velocity.Y - 0.025f; - } + } else { npc.velocity.Y = npc.velocity.Y - 0.2f; } - if (npc.velocity.Y < -4f) + if (npc.velocity.Y < -4f) { npc.velocity.Y = -4f; } - } - else + } + else { - if (npc.velocity.Y < 0f) + if (npc.velocity.Y < 0f) { npc.velocity.Y = 0f; } - if ((double)npc.velocity.Y < 0.1) + if ((double)npc.velocity.Y < 0.1) { npc.velocity.Y = npc.velocity.Y + 0.025f; - } - else + } + else { npc.velocity.Y = npc.velocity.Y + 0.5f; } @@ -293,9 +295,9 @@ namespace CalamityMod.NPCs.Crabulon npc.noTileCollide = false; npc.ai[0] = 3f; npc.ai[1] = 0f; - npc.netUpdate = true; - } - if (npc.velocity.Y > 10f) + npc.netUpdate = true; + } + if (npc.velocity.Y > 10f) { npc.velocity.Y = 10f; return; @@ -303,28 +305,28 @@ namespace CalamityMod.NPCs.Crabulon } else if (npc.ai[0] == 3f) { - npc.damage = expertMode ? 64 : 40; - npc.noTileCollide = false; - if (npc.velocity.Y == 0f) + npc.damage = expertMode ? 64 : 40; + npc.noTileCollide = false; + if (npc.velocity.Y == 0f) { npc.velocity.X = npc.velocity.X * 0.8f; npc.ai[1] += 1f; if (npc.ai[1] > 0f) { - if (npc.life < npc.lifeMax / 2 || CalamityWorld.bossRushActive) + if (npc.life < npc.lifeMax / 2 || CalamityWorld.bossRushActive) { npc.ai[1] += 4f; } - if (npc.life < npc.lifeMax / 10 || CalamityWorld.bossRushActive) + if (npc.life < npc.lifeMax / 10 || CalamityWorld.bossRushActive) { npc.ai[1] += 8f; } } - if (npc.ai[1] >= 300f) + if (npc.ai[1] >= 300f) { npc.ai[1] = -20f; npc.frameCounter = 0.0; - } + } else if (npc.ai[1] == -1f) { npc.TargetClosest(true); @@ -337,86 +339,86 @@ namespace CalamityMod.NPCs.Crabulon } else { - if (npc.velocity.Y == 0f) + if (npc.velocity.Y == 0f) { Main.PlaySound(SoundID.Item14, npc.position); - if (Main.netMode != 1) - { - Projectile.NewProjectile((int)npc.Center.X, (int)npc.Center.Y + 20, 0f, 0f, mod.ProjectileType("Mushmash"), 20, 0f, Main.myPlayer, 0f, 0f); - } - npc.ai[2] += 1f; + if (Main.netMode != 1) + { + Projectile.NewProjectile((int)npc.Center.X, (int)npc.Center.Y + 20, 0f, 0f, mod.ProjectileType("Mushmash"), 20, 0f, Main.myPlayer, 0f, 0f); + } + npc.ai[2] += 1f; if (npc.ai[2] >= 3f) { - if (Main.netMode != 1 && revenge) - { - for (int x = 0; x < 20; x++) - { - int num354 = expertMode ? 11 : 14; - Projectile.NewProjectile(npc.Center.X + shotSpacing, npc.Center.Y - 1000f, 0f, 0f, mod.ProjectileType("MushBombFall"), num354, 0f, Main.myPlayer, 0f, 0f); - shotSpacing -= 100f; - } - shotSpacing = 1000f; - } - npc.ai[0] = 1f; + if (Main.netMode != 1 && revenge) + { + for (int x = 0; x < 20; x++) + { + int num354 = expertMode ? 11 : 14; + Projectile.NewProjectile(npc.Center.X + shotSpacing, npc.Center.Y - 1000f, 0f, 0f, mod.ProjectileType("MushBombFall"), num354, 0f, Main.myPlayer, 0f, 0f); + shotSpacing -= 100f; + } + shotSpacing = 1000f; + } + npc.ai[0] = 1f; npc.ai[2] = 0f; } else { npc.ai[0] = 3f; } - for (int num622 = (int)npc.position.X - 20; num622 < (int)npc.position.X + npc.width + 40; num622 += 20) + for (int num622 = (int)npc.position.X - 20; num622 < (int)npc.position.X + npc.width + 40; num622 += 20) { - for (int num623 = 0; num623 < 4; num623++) + for (int num623 = 0; num623 < 4; num623++) { int num624 = Dust.NewDust(new Vector2(npc.position.X - 20f, npc.position.Y + (float)npc.height), npc.width + 20, 4, 56, 0f, 0f, 100, default(Color), 1.5f); Main.dust[num624].velocity *= 0.2f; } } - } - else + } + else { npc.TargetClosest(true); - if (npc.position.X < player.position.X && npc.position.X + (float)npc.width > player.position.X + (float)player.width) + if (npc.position.X < player.position.X && npc.position.X + (float)npc.width > player.position.X + (float)player.width) { npc.velocity.X = npc.velocity.X * 0.9f; npc.velocity.Y = npc.velocity.Y + 0.15f; //0.2 - } - else + } + else { - if (npc.direction < 0) + if (npc.direction < 0) { npc.velocity.X = npc.velocity.X - 0.2f; } - else if (npc.direction > 0) + else if (npc.direction > 0) { npc.velocity.X = npc.velocity.X + 0.2f; } float num626 = 2.5f; //4 - if (revenge) - { - num626 += 1f; - } - if (npc.GetGlobalNPC(mod).enraged) - { - num626 += 3f; - } - if (CalamityWorld.death || CalamityWorld.bossRushActive) - { - num626 += 2f; - } - if (npc.life < npc.lifeMax / 2 || CalamityWorld.bossRushActive) + if (revenge) { num626 += 1f; } - if (npc.life < npc.lifeMax / 10 || CalamityWorld.bossRushActive) + if (npc.GetGlobalNPC(mod).enraged) + { + num626 += 3f; + } + if (CalamityWorld.death || CalamityWorld.bossRushActive) + { + num626 += 2f; + } + if (npc.life < npc.lifeMax / 2 || CalamityWorld.bossRushActive) { num626 += 1f; } - if (npc.velocity.X < -num626) + if (npc.life < npc.lifeMax / 10 || CalamityWorld.bossRushActive) + { + num626 += 1f; + } + if (npc.velocity.X < -num626) { npc.velocity.X = -num626; } - if (npc.velocity.X > num626) + if (npc.velocity.X > num626) { npc.velocity.X = num626; } @@ -427,7 +429,7 @@ namespace CalamityMod.NPCs.Crabulon { npc.localAI[0] = (float)npc.lifeMax; } - if (npc.life > 0) + if (npc.life > 0) { if (Main.netMode != 1) { @@ -454,16 +456,16 @@ namespace CalamityMod.NPCs.Crabulon } } } - } - + } + public override void FindFrame(int frameHeight) - { - npc.frameCounter += 0.15f; - npc.frameCounter %= Main.npcFrameCount[npc.type]; - int frame = (int)npc.frameCounter; - npc.frame.Y = frame * frameHeight; - } - + { + npc.frameCounter += 0.15f; + npc.frameCounter %= Main.npcFrameCount[npc.type]; + int frame = (int)npc.frameCounter; + npc.frame.Y = frame * frameHeight; + } + public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) { Mod mod = ModLoader.GetMod("CalamityMod"); @@ -479,21 +481,21 @@ namespace CalamityMod.NPCs.Crabulon } return false; } - + public override void NPCLoot() { if (Main.rand.Next(10) == 0) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CrabulonTrophy")); } - if (CalamityWorld.armageddon) - { - for (int i = 0; i < 10; i++) - { - npc.DropBossBags(); - } - } - if (Main.expertMode) + if (CalamityWorld.armageddon) + { + for (int i = 0; i < 5; i++) + { + npc.DropBossBags(); + } + } + if (Main.expertMode) { npc.DropBossBags(); } @@ -501,11 +503,11 @@ namespace CalamityMod.NPCs.Crabulon { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.GlowingMushroom, Main.rand.Next(20, 31)); Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.MushroomGrassSeeds, Main.rand.Next(3, 7)); - if (Main.rand.Next(7) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CrabulonMask")); - } - if (Main.rand.Next(4) == 0) + if (Main.rand.Next(7) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CrabulonMask")); + } + if (Main.rand.Next(4) == 0) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("HyphaeRod")); } @@ -523,13 +525,13 @@ namespace CalamityMod.NPCs.Crabulon } } } - + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { npc.lifeMax = (int)(npc.lifeMax * 0.8f * bossLifeScale); npc.damage = (int)(npc.damage * 0.8f); } - + public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 5; k++) @@ -562,15 +564,15 @@ namespace CalamityMod.NPCs.Crabulon num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 56, 0f, 0f, 100, default(Color), 2f); Main.dust[num624].velocity *= 2f; } - float randomSpread = (float)(Main.rand.Next(-200, 200) / 100); - Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/Crabulon"), 1f); - Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/Crabulon2"), 1f); - Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/Crabulon3"), 1f); - Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/Crabulon4"), 1f); - Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/Crabulon5"), 1f); - Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/Crabulon6"), 1f); - Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/Crabulon7"), 1f); - } + float randomSpread = (float)(Main.rand.Next(-200, 200) / 100); + Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/Crabulon"), 1f); + Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/Crabulon2"), 1f); + Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/Crabulon3"), 1f); + Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/Crabulon4"), 1f); + Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/Crabulon5"), 1f); + Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/Crabulon6"), 1f); + Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/Crabulon7"), 1f); + } } } } \ No newline at end of file diff --git a/NPCs/Cryogen/Cryocore.cs b/NPCs/Cryogen/Cryocore.cs index e24bfe0b58..154bb2ad95 100644 --- a/NPCs/Cryogen/Cryocore.cs +++ b/NPCs/Cryogen/Cryocore.cs @@ -35,6 +35,7 @@ namespace CalamityMod.NPCs.Cryogen npc.knockBackResist = 0.75f; npc.noGravity = true; npc.noTileCollide = true; + npc.canGhostHeal = false; npc.HitSound = SoundID.NPCHit5; npc.DeathSound = SoundID.NPCDeath15; } diff --git a/NPCs/Cryogen/Cryocore2.cs b/NPCs/Cryogen/Cryocore2.cs index b9024bb4a0..3a940dc003 100644 --- a/NPCs/Cryogen/Cryocore2.cs +++ b/NPCs/Cryogen/Cryocore2.cs @@ -35,6 +35,7 @@ namespace CalamityMod.NPCs.Cryogen npc.knockBackResist = 0.5f; npc.noGravity = true; npc.noTileCollide = true; + npc.canGhostHeal = false; npc.HitSound = SoundID.NPCHit5; npc.DeathSound = SoundID.NPCDeath15; } diff --git a/NPCs/Cryogen/Cryogen.cs b/NPCs/Cryogen/Cryogen.cs index fa970d105d..d9136d26c7 100644 --- a/NPCs/Cryogen/Cryogen.cs +++ b/NPCs/Cryogen/Cryogen.cs @@ -14,16 +14,16 @@ namespace CalamityMod.NPCs.Cryogen [AutoloadBossHead] public class Cryogen : ModNPC { - private int time = 0; - private bool oneTime = true; - private float iceShard = 0f; - private bool drawAltTexture = false; + private int time = 0; + private bool oneTime = true; + private float iceShard = 0f; + private bool drawAltTexture = false; - public override void SetStaticDefaults() + public override void SetStaticDefaults() { DisplayName.SetDefault("Cryogen"); } - + public override void SetDefaults() { npc.npcSlots = 24f; @@ -32,52 +32,52 @@ namespace CalamityMod.NPCs.Cryogen npc.height = 80; //216 npc.defense = 10; npc.lifeMax = CalamityWorld.revenge ? 26300 : 17900; - if (CalamityWorld.death) - { - npc.lifeMax = 39900; - } - if (CalamityWorld.bossRushActive) - { - npc.lifeMax = CalamityWorld.death ? 6000000 : 5400000; - } - npc.aiStyle = -1; //new - aiType = -1; //new - animationType = 10; //new + if (CalamityWorld.death) + { + npc.lifeMax = 39900; + } + if (CalamityWorld.bossRushActive) + { + npc.lifeMax = CalamityWorld.death ? 3000000 : 2700000; + } + npc.aiStyle = -1; //new + aiType = -1; //new + animationType = 10; //new npc.knockBackResist = 0f; npc.value = Item.buyPrice(0, 12, 0, 0); for (int k = 0; k < npc.buffImmune.Length; k++) { npc.buffImmune[k] = true; npc.buffImmune[BuffID.Ichor] = false; - npc.buffImmune[mod.BuffType("MarkedforDeath")] = false; - npc.buffImmune[BuffID.OnFire] = false; - npc.buffImmune[BuffID.CursedInferno] = false; - npc.buffImmune[BuffID.Daybreak] = false; - npc.buffImmune[mod.BuffType("AbyssalFlames")] = false; - npc.buffImmune[mod.BuffType("ArmorCrunch")] = false; - npc.buffImmune[mod.BuffType("BrimstoneFlames")] = false; - npc.buffImmune[mod.BuffType("DemonFlames")] = false; - npc.buffImmune[mod.BuffType("GodSlayerInferno")] = false; - npc.buffImmune[mod.BuffType("HolyLight")] = false; - npc.buffImmune[mod.BuffType("Nightwither")] = false; - npc.buffImmune[mod.BuffType("Plague")] = false; - npc.buffImmune[mod.BuffType("Shred")] = false; - npc.buffImmune[mod.BuffType("WhisperingDeath")] = false; - npc.buffImmune[mod.BuffType("SilvaStun")] = false; - } + npc.buffImmune[mod.BuffType("MarkedforDeath")] = false; + npc.buffImmune[BuffID.OnFire] = false; + npc.buffImmune[BuffID.CursedInferno] = false; + npc.buffImmune[BuffID.Daybreak] = false; + npc.buffImmune[mod.BuffType("AbyssalFlames")] = false; + npc.buffImmune[mod.BuffType("ArmorCrunch")] = false; + npc.buffImmune[mod.BuffType("BrimstoneFlames")] = false; + npc.buffImmune[mod.BuffType("DemonFlames")] = false; + npc.buffImmune[mod.BuffType("GodSlayerInferno")] = false; + npc.buffImmune[mod.BuffType("HolyLight")] = false; + npc.buffImmune[mod.BuffType("Nightwither")] = false; + npc.buffImmune[mod.BuffType("Plague")] = false; + npc.buffImmune[mod.BuffType("Shred")] = false; + npc.buffImmune[mod.BuffType("WhisperingDeath")] = false; + npc.buffImmune[mod.BuffType("SilvaStun")] = false; + } npc.boss = true; npc.noGravity = true; npc.noTileCollide = true; npc.HitSound = SoundID.NPCHit5; npc.DeathSound = SoundID.NPCDeath15; - Mod calamityModMusic = ModLoader.GetMod("CalamityModMusic"); - if (calamityModMusic != null) - music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/Cryogen"); - else - music = MusicID.FrostMoon; + Mod calamityModMusic = ModLoader.GetMod("CalamityModMusic"); + if (calamityModMusic != null) + music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/Cryogen"); + else + music = MusicID.FrostMoon; bossBag = mod.ItemType("CryogenBag"); } - + public override void AI() { Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 0f, 1f, 1f); @@ -139,664 +139,664 @@ namespace CalamityMod.NPCs.Cryogen if (Main.netMode != 1 && expertMode) { time++; - if (CalamityWorld.death || CalamityWorld.bossRushActive) - { - time++; - } - if (time >= 600) - { - Vector2 value9 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float spread = 45f * 0.0174f; - double startAngle = Math.Atan2(npc.velocity.X, npc.velocity.Y) - spread / 2; - double deltaAngle = spread / 4f; - double offsetAngle; - int i; - int num184 = 22; - for (i = 0; i < 2; i++) - { - offsetAngle = (startAngle + deltaAngle * (i + i * i) / 2f) + 32f * i; - Projectile.NewProjectile(value9.X, value9.Y, (float)(Math.Sin(offsetAngle) * 8f), (float)(Math.Cos(offsetAngle) * 8f), mod.ProjectileType("IceBomb"), num184, 0f, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(value9.X, value9.Y, (float)(-Math.Sin(offsetAngle) * 8f), (float)(-Math.Cos(offsetAngle) * 8f), mod.ProjectileType("IceBomb"), num184, 0f, Main.myPlayer, 0f, 0f); - } - time = 0; - } + if (CalamityWorld.death || CalamityWorld.bossRushActive) + { + time++; + } + if (time >= 600) + { + Vector2 value9 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float spread = 45f * 0.0174f; + double startAngle = Math.Atan2(npc.velocity.X, npc.velocity.Y) - spread / 2; + double deltaAngle = spread / 4f; + double offsetAngle; + int i; + int num184 = 22; + for (i = 0; i < 2; i++) + { + offsetAngle = (startAngle + deltaAngle * (i + i * i) / 2f) + 32f * i; + Projectile.NewProjectile(value9.X, value9.Y, (float)(Math.Sin(offsetAngle) * 8f), (float)(Math.Cos(offsetAngle) * 8f), mod.ProjectileType("IceBomb"), num184, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(value9.X, value9.Y, (float)(-Math.Sin(offsetAngle) * 8f), (float)(-Math.Cos(offsetAngle) * 8f), mod.ProjectileType("IceBomb"), num184, 0f, Main.myPlayer, 0f, 0f); + } + time = 0; + } + } + if (npc.ai[0] == 0f) + { + if (Main.netMode != 1) + { + npc.localAI[0] += 1f; + if (npc.localAI[0] >= 120f) + { + npc.localAI[0] = 0f; + npc.TargetClosest(true); + npc.netUpdate = true; + if (Collision.CanHit(npc.position, npc.width, npc.height, player.position, player.width, player.height)) + { + Vector2 value9 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float spread = 45f * 0.0174f; + double startAngle = Math.Atan2(npc.velocity.X, npc.velocity.Y) - spread / 2; + double deltaAngle = spread / 8f; + double offsetAngle; + int num184 = expertMode ? 20 : 23; + int i; + for (i = 0; i < 8; i++) + { + offsetAngle = (startAngle + deltaAngle * (i + i * i) / 2f) + 32f * i; + Projectile.NewProjectile(value9.X, value9.Y, (float)(Math.Sin(offsetAngle) * 8f), (float)(Math.Cos(offsetAngle) * 8f), mod.ProjectileType("IceBlast"), num184, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(value9.X, value9.Y, (float)(-Math.Sin(offsetAngle) * 8f), (float)(-Math.Cos(offsetAngle) * 8f), mod.ProjectileType("IceBlast"), num184, 0f, Main.myPlayer, 0f, 0f); + } + } + } + } + Vector2 vector142 = new Vector2(npc.Center.X, npc.Center.Y); + float num1243 = player.Center.X - vector142.X; + float num1244 = player.Center.Y - vector142.Y; + float num1245 = (float)Math.Sqrt((double)(num1243 * num1243 + num1244 * num1244)); + float num1246 = isChill ? 3f : 5f; + if (CalamityWorld.death) + { + num1246 = isChill ? 4f : 6f; + } + if (CalamityWorld.bossRushActive) + { + num1246 = 10f; + } + if (num1245 < num1246) + { + npc.velocity.X = num1243; + npc.velocity.Y = num1244; + } + else + { + num1245 = num1246 / num1245; + npc.velocity.X = num1243 * num1245; + npc.velocity.Y = num1244 * num1245; + } + if ((double)npc.life < (double)npc.lifeMax * 0.83) + { + npc.ai[0] = 1f; + npc.localAI[0] = 0f; + npc.netUpdate = true; + return; + } + } + else if (npc.ai[0] == 1f) + { + if (Main.netMode != 1) + { + npc.localAI[0] += 1f; + if (npc.localAI[0] >= 120f) + { + npc.localAI[0] = 0f; + npc.TargetClosest(true); + if (Collision.CanHit(npc.position, npc.width, npc.height, player.position, player.width, player.height)) + { + Vector2 value9 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float spread = 45f * 0.0174f; + double startAngle = Math.Atan2(npc.velocity.X, npc.velocity.Y) - spread / 2; + double deltaAngle = spread / 8f; + double offsetAngle; + int num184 = expertMode ? 20 : 23; + int i; + for (i = 0; i < 6; i++) + { + offsetAngle = (startAngle + deltaAngle * (i + i * i) / 2f) + 32f * i; + int ice = Projectile.NewProjectile(value9.X, value9.Y, (float)(Math.Sin(offsetAngle) * 8f), (float)(Math.Cos(offsetAngle) * 8f), mod.ProjectileType("IceBlast"), num184, 0f, Main.myPlayer, 0f, 0f); + int ice2 = Projectile.NewProjectile(value9.X, value9.Y, (float)(-Math.Sin(offsetAngle) * 8f), (float)(-Math.Cos(offsetAngle) * 8f), mod.ProjectileType("IceBlast"), num184, 0f, Main.myPlayer, 0f, 0f); + Main.projectile[ice].timeLeft = 300; + Main.projectile[ice2].timeLeft = 300; + } + } + } + } + float num1164 = isChill ? 4f : 6f; + float num1165 = isChill ? 1f : 1.2f; + if (CalamityWorld.death) + { + num1164 = isChill ? 5f : 7f; + } + if (CalamityWorld.bossRushActive) + { + num1164 = 12f; + } + Vector2 vector133 = new Vector2(npc.Center.X, npc.Center.Y); + float num1166 = player.Center.X - vector133.X; + float num1167 = player.Center.Y - vector133.Y - 400f; + float num1168 = (float)Math.Sqrt((double)(num1166 * num1166 + num1167 * num1167)); + if (num1168 < 20f) + { + num1166 = npc.velocity.X; + num1167 = npc.velocity.Y; + } + else + { + num1168 = num1164 / num1168; + num1166 *= num1168; + num1167 *= num1168; + } + if (npc.velocity.X < num1166) + { + npc.velocity.X = npc.velocity.X + num1165; + if (npc.velocity.X < 0f && num1166 > 0f) + { + npc.velocity.X = npc.velocity.X + num1165 * 2f; + } + } + else if (npc.velocity.X > num1166) + { + npc.velocity.X = npc.velocity.X - num1165; + if (npc.velocity.X > 0f && num1166 < 0f) + { + npc.velocity.X = npc.velocity.X - num1165 * 2f; + } + } + if (npc.velocity.Y < num1167) + { + npc.velocity.Y = npc.velocity.Y + num1165; + if (npc.velocity.Y < 0f && num1167 > 0f) + { + npc.velocity.Y = npc.velocity.Y + num1165 * 2f; + } + } + else if (npc.velocity.Y > num1167) + { + npc.velocity.Y = npc.velocity.Y - num1165; + if (npc.velocity.Y > 0f && num1167 < 0f) + { + npc.velocity.Y = npc.velocity.Y - num1165 * 2f; + } + } + if (npc.position.X + (float)npc.width > player.position.X && npc.position.X < player.position.X + (float)player.width && npc.position.Y + (float)npc.height < player.position.Y && Collision.CanHit(npc.position, npc.width, npc.height, player.position, player.width, player.height) && Main.netMode != 1) + { + iceShard += 4f; + if (iceShard > 8f) + { + iceShard = 0f; + int num1169 = (int)(npc.position.X + 10f + (float)Main.rand.Next(npc.width - 20)); + int num1170 = (int)(npc.position.Y + (float)npc.height + 4f); + int damage = expertMode ? 23 : 26; + Projectile.NewProjectile((float)num1169, (float)num1170, 0f, 5f, mod.ProjectileType("IceRain"), damage, 0f, Main.myPlayer, 0f, 0f); + return; + } + } + if ((double)npc.life < (double)npc.lifeMax * 0.66) + { + npc.ai[0] = 2f; + npc.localAI[0] = 0f; + iceShard = 0f; + npc.netUpdate = true; + return; + } + } + else if (npc.ai[0] == 2f) + { + if (Main.netMode != 1) + { + npc.localAI[0] += 1f; + if (npc.localAI[0] >= 120f) + { + npc.localAI[0] = 0f; + npc.TargetClosest(true); + npc.netUpdate = true; + if (Collision.CanHit(npc.position, npc.width, npc.height, player.position, player.width, player.height)) + { + if (Main.rand.Next(2) == 0) + { + Vector2 value9 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float spread = 45f * 0.0174f; + double startAngle = Math.Atan2(npc.velocity.X, npc.velocity.Y) - spread / 2; + double deltaAngle = spread / 8f; + double offsetAngle; + int num184 = expertMode ? 20 : 23; + int i; + for (i = 0; i < 6; i++) + { + offsetAngle = (startAngle + deltaAngle * (i + i * i) / 2f) + 32f * i; + int ice = Projectile.NewProjectile(value9.X, value9.Y, (float)(Math.Sin(offsetAngle) * 8f), (float)(Math.Cos(offsetAngle) * 8f), mod.ProjectileType("IceBlast"), num184, 0f, Main.myPlayer, 0f, 0f); + int ice2 = Projectile.NewProjectile(value9.X, value9.Y, (float)(-Math.Sin(offsetAngle) * 8f), (float)(-Math.Cos(offsetAngle) * 8f), mod.ProjectileType("IceBlast"), num184, 0f, Main.myPlayer, 0f, 0f); + Main.projectile[ice].timeLeft = 300; + Main.projectile[ice2].timeLeft = 300; + } + } + else + { + float num179 = revenge ? 9f : 7f; + Vector2 value9 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float num180 = player.position.X + (float)player.width * 0.5f - value9.X; + float num181 = Math.Abs(num180) * 0.1f; + float num182 = player.position.Y + (float)player.height * 0.5f - value9.Y - num181; + float num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182)); + npc.netUpdate = true; + num183 = num179 / num183; + num180 *= num183; + num182 *= num183; + int num184 = expertMode ? 23 : 26; + int num185 = mod.ProjectileType("IceRain"); + value9.X += num180; + value9.Y += num182; + for (int num186 = 0; num186 < 15; num186++) + { + num180 = player.position.X + (float)player.width * 0.5f - value9.X; + num182 = player.position.Y + (float)player.height * 0.5f - value9.Y; + num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182)); + num183 = num179 / num183; + num180 += (float)Main.rand.Next(-100, 101); + num182 += (float)Main.rand.Next(-100, 101); + num180 *= num183; + num182 *= num183; + Projectile.NewProjectile(value9.X, value9.Y, num180, -10f, num185, num184, 0f, Main.myPlayer, 0f, 0f); + } + } + } + } + } + Vector2 vector142 = new Vector2(npc.Center.X, npc.Center.Y); + float num1243 = player.Center.X - vector142.X; + float num1244 = player.Center.Y - vector142.Y; + float num1245 = (float)Math.Sqrt((double)(num1243 * num1243 + num1244 * num1244)); + float num1246 = isChill ? 5f : 7f; + if (CalamityWorld.death) + { + num1246 = isChill ? 6f : 8f; + } + if (CalamityWorld.bossRushActive) + { + num1246 = 14f; + } + if (num1245 < num1246) + { + npc.velocity.X = num1243; + npc.velocity.Y = num1244; + } + else + { + num1245 = num1246 / num1245; + npc.velocity.X = num1243 * num1245; + npc.velocity.Y = num1244 * num1245; + } + if ((double)npc.life < (double)npc.lifeMax * 0.49) + { + npc.ai[0] = 3f; + npc.localAI[0] = 0f; + npc.netUpdate = true; + return; + } + } + else if (npc.ai[0] == 3f) + { + if (Main.netMode != 1) + { + npc.localAI[0] += 1f; + if (npc.localAI[0] >= 120f) + { + npc.localAI[0] = 0f; + npc.TargetClosest(true); + if (Collision.CanHit(npc.position, npc.width, npc.height, player.position, player.width, player.height)) + { + float num179 = revenge ? 9f : 7f; + Vector2 value9 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float num180 = player.position.X + (float)player.width * 0.5f - value9.X; + float num181 = Math.Abs(num180) * 0.1f; + float num182 = player.position.Y + (float)player.height * 0.5f - value9.Y - num181; + float num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182)); + npc.netUpdate = true; + num183 = num179 / num183; + num180 *= num183; + num182 *= num183; + int num184 = expertMode ? 23 : 26; + int num185 = mod.ProjectileType("IceRain"); + value9.X += num180; + value9.Y += num182; + for (int num186 = 0; num186 < 15; num186++) + { + num180 = player.position.X + (float)player.width * 0.5f - value9.X; + num182 = player.position.Y + (float)player.height * 0.5f - value9.Y; + num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182)); + num183 = num179 / num183; + num180 += (float)Main.rand.Next(-100, 101); + num182 += (float)Main.rand.Next(-100, 101); + num180 *= num183; + num182 *= num183; + Projectile.NewProjectile(value9.X, value9.Y, num180, -10f, num185, num184, 0f, Main.myPlayer, 0f, 0f); + } + } + } + } + float num1164 = isChill ? 4.5f : 6.5f; + float num1165 = isChill ? 1.1f : 1.3f; + if (CalamityWorld.death || CalamityWorld.bossRushActive) + { + num1164 = isChill ? 5.5f : 7.5f; + } + Vector2 vector133 = new Vector2(npc.Center.X, npc.Center.Y); + float num1166 = player.Center.X - vector133.X; + float num1167 = player.Center.Y - vector133.Y - 300f; + float num1168 = (float)Math.Sqrt((double)(num1166 * num1166 + num1167 * num1167)); + if (num1168 < 20f) + { + num1166 = npc.velocity.X; + num1167 = npc.velocity.Y; + } + else + { + num1168 = num1164 / num1168; + num1166 *= num1168; + num1167 *= num1168; + } + if (npc.velocity.X < num1166) + { + npc.velocity.X = npc.velocity.X + num1165; + if (npc.velocity.X < 0f && num1166 > 0f) + { + npc.velocity.X = npc.velocity.X + num1165 * 2f; + } + } + else if (npc.velocity.X > num1166) + { + npc.velocity.X = npc.velocity.X - num1165; + if (npc.velocity.X > 0f && num1166 < 0f) + { + npc.velocity.X = npc.velocity.X - num1165 * 2f; + } + } + if (npc.velocity.Y < num1167) + { + npc.velocity.Y = npc.velocity.Y + num1165; + if (npc.velocity.Y < 0f && num1167 > 0f) + { + npc.velocity.Y = npc.velocity.Y + num1165 * 2f; + } + } + else if (npc.velocity.Y > num1167) + { + npc.velocity.Y = npc.velocity.Y - num1165; + if (npc.velocity.Y > 0f && num1167 < 0f) + { + npc.velocity.Y = npc.velocity.Y - num1165 * 2f; + } + } + if (npc.position.X + (float)npc.width > player.position.X && npc.position.X < player.position.X + (float)player.width && npc.position.Y + (float)npc.height < player.position.Y && Collision.CanHit(npc.position, npc.width, npc.height, player.position, player.width, player.height) && Main.netMode != 1) + { + iceShard += 4f; + if (iceShard > 8f) + { + iceShard = 0f; + int num1169 = (int)(npc.position.X + 10f + (float)Main.rand.Next(npc.width - 20)); + int num1170 = (int)(npc.position.Y + (float)npc.height + 4f); + int damage = expertMode ? 23 : 26; + Projectile.NewProjectile((float)num1169, (float)num1170, 0f, 5f, mod.ProjectileType("IceRain"), damage, 0f, Main.myPlayer, 0f, 0f); + return; + } + } + if ((double)npc.life < (double)npc.lifeMax * 0.32) + { + npc.ai[0] = 4f; + npc.localAI[0] = 0f; + iceShard = 0f; + npc.netUpdate = true; + return; + } + } + else if (npc.ai[0] == 4f) + { + if (Main.netMode != 1) + { + npc.localAI[0] += 1f; + if (npc.localAI[0] >= 60f && npc.alpha <= 0) + { + npc.localAI[0] = 0f; + npc.TargetClosest(true); + if (Collision.CanHit(npc.position, npc.width, npc.height, player.position, player.width, player.height)) + { + Vector2 value9 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float spread = 45f * 0.0174f; + double startAngle = Math.Atan2(npc.velocity.X, npc.velocity.Y) - spread / 2; + double deltaAngle = spread / 8f; + double offsetAngle; + int num184 = expertMode ? 20 : 23; + int i; + for (i = 0; i < 6; i++) + { + offsetAngle = (startAngle + deltaAngle * (i + i * i) / 2f) + 32f * i; + int ice = Projectile.NewProjectile(value9.X, value9.Y, (float)(Math.Sin(offsetAngle) * 9f), (float)(Math.Cos(offsetAngle) * 9f), mod.ProjectileType("IceBlast"), num184, 0f, Main.myPlayer, 0f, 0f); + int ice2 = Projectile.NewProjectile(value9.X, value9.Y, (float)(-Math.Sin(offsetAngle) * 9f), (float)(-Math.Cos(offsetAngle) * 9f), mod.ProjectileType("IceBlast"), num184, 0f, Main.myPlayer, 0f, 0f); + Main.projectile[ice].timeLeft = 300; + Main.projectile[ice2].timeLeft = 300; + } + } + } + } + npc.TargetClosest(true); + Vector2 vector142 = new Vector2(npc.Center.X, npc.Center.Y); + float num1243 = player.Center.X - vector142.X; + float num1244 = player.Center.Y - vector142.Y; + float num1245 = (float)Math.Sqrt((double)(num1243 * num1243 + num1244 * num1244)); + float speed = revenge ? 4.5f : 4f; + if (CalamityWorld.bossRushActive) + { + speed = 9f; + } + if (num1245 < speed) + { + npc.velocity.X = num1243; + npc.velocity.Y = num1244; + } + else + { + num1245 = speed / num1245; + npc.velocity.X = num1243 * num1245; + npc.velocity.Y = num1244 * num1245; + } + if (npc.ai[1] == 0f) + { + npc.chaseable = true; + npc.dontTakeDamage = false; + if (Main.netMode != 1) + { + npc.localAI[2] += 1f; + if (npc.localAI[2] >= (float)(120 + Main.rand.Next(200))) + { + npc.localAI[2] = 0f; + npc.TargetClosest(true); + int num1249 = 0; + int num1250; + int num1251; + while (true) + { + num1249++; + num1250 = (int)player.Center.X / 16; + num1251 = (int)player.Center.Y / 16; + num1250 += Main.rand.Next(-50, 51); + num1251 += Main.rand.Next(-50, 51); + if (!WorldGen.SolidTile(num1250, num1251) && Collision.CanHit(new Vector2((float)(num1250 * 16), (float)(num1251 * 16)), 1, 1, player.position, player.width, player.height)) + { + break; + } + if (num1249 > 100) + { + goto Block; + } + } + npc.ai[1] = 1f; + npc.localAI[3] = (float)num1250; + iceShard = (float)num1251; + npc.netUpdate = true; + Block:; + } + } + } + else if (npc.ai[1] == 1f) + { + npc.damage = 0; + npc.dontTakeDamage = true; + npc.chaseable = false; + npc.alpha += 4; + if (npc.alpha >= 255) + { + npc.alpha = 255; + npc.position.X = npc.localAI[3] * 16f - (float)(npc.width / 2); + npc.position.Y = iceShard * 16f - (float)(npc.height / 2); + npc.ai[1] = 2f; + npc.netUpdate = true; + } + } + else if (npc.ai[1] == 2f) + { + npc.alpha -= 4; + if (npc.alpha <= 0) + { + npc.damage = expertMode ? 96 : 60; + npc.dontTakeDamage = false; + npc.chaseable = true; + npc.alpha = 0; + npc.ai[1] = 0f; + npc.netUpdate = true; + } + } + if ((double)npc.life < (double)npc.lifeMax * 0.15) + { + Main.PlaySound(4, (int)npc.position.X, (int)npc.position.Y, 15); + drawAltTexture = true; + for (int num621 = 0; num621 < 40; num621++) + { + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 67, 0f, 0f, 100, default(Color), 2f); + Main.dust[num622].velocity *= 3f; + if (Main.rand.Next(2) == 0) + { + Main.dust[num622].scale = 0.5f; + Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + } + } + for (int num623 = 0; num623 < 70; num623++) + { + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 67, 0f, 0f, 100, default(Color), 3f); + Main.dust[num624].noGravity = true; + Main.dust[num624].velocity *= 5f; + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 67, 0f, 0f, 100, default(Color), 2f); + Main.dust[num624].velocity *= 2f; + } + float randomSpread = (float)(Main.rand.Next(-200, 200) / 100); + Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/CryoGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/CryoGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/CryoGore3"), 1f); + npc.ai[0] = 5f; + npc.ai[1] = 0f; + npc.localAI[0] = 0f; + npc.localAI[2] = 0f; + npc.localAI[3] = 0f; + iceShard = 0f; + npc.netUpdate = true; + string key = "Mods.CalamityMod.CryogenBossText"; + Color messageColor = Color.Cyan; + if (Main.netMode == 0) + { + Main.NewText(Language.GetTextValue(key), messageColor); + } + else if (Main.netMode == 2) + { + NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); + } + return; + } + } + else + { + npc.dontTakeDamage = false; + npc.chaseable = true; + float num1372 = isChill ? 16f : 22f; + if (CalamityWorld.bossRushActive) + { + num1372 = 24f; + } + Vector2 vector167 = new Vector2(npc.Center.X + (float)(npc.direction * 20), npc.Center.Y + 6f); + float num1373 = player.position.X + (float)player.width * 0.5f - vector167.X; + float num1374 = player.Center.Y - vector167.Y; + float num1375 = (float)Math.Sqrt((double)(num1373 * num1373 + num1374 * num1374)); + float num1376 = num1372 / num1375; + num1373 *= num1376; + num1374 *= num1376; + iceShard -= 1f; + if ((double)npc.life < (double)npc.lifeMax * 0.05 || CalamityWorld.death || CalamityWorld.bossRushActive) + { + if (num1375 < 170f || iceShard > 0f) + { + if (num1375 < 170f) + { + iceShard = 17f; + } + if (npc.velocity.X < 0f) + { + npc.direction = -1; + } + else + { + npc.direction = 1; + } + npc.rotation += (float)npc.direction * 0.5f; + return; + } + } + else if ((double)npc.life < (double)npc.lifeMax * 0.1) + { + if (num1375 < 190f || iceShard > 0f) + { + if (num1375 < 190f) + { + iceShard = 19f; + } + if (npc.velocity.X < 0f) + { + npc.direction = -1; + } + else + { + npc.direction = 1; + } + npc.rotation += (float)npc.direction * 0.35f; + return; + } + } + else + { + if (num1375 < 200f || iceShard > 0f) + { + if (num1375 < 200f) + { + iceShard = 20f; + } + if (npc.velocity.X < 0f) + { + npc.direction = -1; + } + else + { + npc.direction = 1; + } + npc.rotation += (float)npc.direction * 0.3f; + return; + } + } + npc.velocity.X = (npc.velocity.X * 50f + num1373) / 51f; + npc.velocity.Y = (npc.velocity.Y * 50f + num1374) / 51f; + if (num1375 < 350f) + { + npc.velocity.X = (npc.velocity.X * 10f + num1373) / 11f; + npc.velocity.Y = (npc.velocity.Y * 10f + num1374) / 11f; + } + if (num1375 < 300f) + { + npc.velocity.X = (npc.velocity.X * 7f + num1373) / 8f; + npc.velocity.Y = (npc.velocity.Y * 7f + num1374) / 8f; + } + npc.rotation = npc.velocity.X * 0.15f; + return; } - if (npc.ai[0] == 0f) - { - if (Main.netMode != 1) - { - npc.localAI[0] += 1f; - if (npc.localAI[0] >= 120f) - { - npc.localAI[0] = 0f; - npc.TargetClosest(true); - npc.netUpdate = true; - if (Collision.CanHit(npc.position, npc.width, npc.height, player.position, player.width, player.height)) - { - Vector2 value9 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float spread = 45f * 0.0174f; - double startAngle = Math.Atan2(npc.velocity.X, npc.velocity.Y) - spread / 2; - double deltaAngle = spread / 8f; - double offsetAngle; - int num184 = expertMode ? 20 : 23; - int i; - for (i = 0; i < 8; i++) - { - offsetAngle = (startAngle + deltaAngle * (i + i * i) / 2f) + 32f * i; - Projectile.NewProjectile(value9.X, value9.Y, (float)(Math.Sin(offsetAngle) * 8f), (float)(Math.Cos(offsetAngle) * 8f), mod.ProjectileType("IceBlast"), num184, 0f, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(value9.X, value9.Y, (float)(-Math.Sin(offsetAngle) * 8f), (float)(-Math.Cos(offsetAngle) * 8f), mod.ProjectileType("IceBlast"), num184, 0f, Main.myPlayer, 0f, 0f); - } - } - } - } - Vector2 vector142 = new Vector2(npc.Center.X, npc.Center.Y); - float num1243 = player.Center.X - vector142.X; - float num1244 = player.Center.Y - vector142.Y; - float num1245 = (float)Math.Sqrt((double)(num1243 * num1243 + num1244 * num1244)); - float num1246 = isChill ? 3f : 5f; - if (CalamityWorld.death) - { - num1246 = isChill ? 4f : 6f; - } - if (CalamityWorld.bossRushActive) - { - num1246 = 10f; - } - if (num1245 < num1246) - { - npc.velocity.X = num1243; - npc.velocity.Y = num1244; - } - else - { - num1245 = num1246 / num1245; - npc.velocity.X = num1243 * num1245; - npc.velocity.Y = num1244 * num1245; - } - if ((double)npc.life < (double)npc.lifeMax * 0.83) - { - npc.ai[0] = 1f; - npc.localAI[0] = 0f; - npc.netUpdate = true; - return; - } - } - else if (npc.ai[0] == 1f) - { - if (Main.netMode != 1) - { - npc.localAI[0] += 1f; - if (npc.localAI[0] >= 120f) - { - npc.localAI[0] = 0f; - npc.TargetClosest(true); - if (Collision.CanHit(npc.position, npc.width, npc.height, player.position, player.width, player.height)) - { - Vector2 value9 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float spread = 45f * 0.0174f; - double startAngle = Math.Atan2(npc.velocity.X, npc.velocity.Y) - spread / 2; - double deltaAngle = spread / 8f; - double offsetAngle; - int num184 = expertMode ? 20 : 23; - int i; - for (i = 0; i < 6; i++) - { - offsetAngle = (startAngle + deltaAngle * (i + i * i) / 2f) + 32f * i; - int ice = Projectile.NewProjectile(value9.X, value9.Y, (float)(Math.Sin(offsetAngle) * 8f), (float)(Math.Cos(offsetAngle) * 8f), mod.ProjectileType("IceBlast"), num184, 0f, Main.myPlayer, 0f, 0f); - int ice2 = Projectile.NewProjectile(value9.X, value9.Y, (float)(-Math.Sin(offsetAngle) * 8f), (float)(-Math.Cos(offsetAngle) * 8f), mod.ProjectileType("IceBlast"), num184, 0f, Main.myPlayer, 0f, 0f); - Main.projectile[ice].timeLeft = 300; - Main.projectile[ice2].timeLeft = 300; - } - } - } - } - float num1164 = isChill ? 4f : 6f; - float num1165 = isChill ? 1f : 1.2f; - if (CalamityWorld.death) - { - num1164 = isChill ? 5f : 7f; - } - if (CalamityWorld.bossRushActive) - { - num1164 = 12f; - } - Vector2 vector133 = new Vector2(npc.Center.X, npc.Center.Y); - float num1166 = player.Center.X - vector133.X; - float num1167 = player.Center.Y - vector133.Y - 400f; - float num1168 = (float)Math.Sqrt((double)(num1166 * num1166 + num1167 * num1167)); - if (num1168 < 20f) - { - num1166 = npc.velocity.X; - num1167 = npc.velocity.Y; - } - else - { - num1168 = num1164 / num1168; - num1166 *= num1168; - num1167 *= num1168; - } - if (npc.velocity.X < num1166) - { - npc.velocity.X = npc.velocity.X + num1165; - if (npc.velocity.X < 0f && num1166 > 0f) - { - npc.velocity.X = npc.velocity.X + num1165 * 2f; - } - } - else if (npc.velocity.X > num1166) - { - npc.velocity.X = npc.velocity.X - num1165; - if (npc.velocity.X > 0f && num1166 < 0f) - { - npc.velocity.X = npc.velocity.X - num1165 * 2f; - } - } - if (npc.velocity.Y < num1167) - { - npc.velocity.Y = npc.velocity.Y + num1165; - if (npc.velocity.Y < 0f && num1167 > 0f) - { - npc.velocity.Y = npc.velocity.Y + num1165 * 2f; - } - } - else if (npc.velocity.Y > num1167) - { - npc.velocity.Y = npc.velocity.Y - num1165; - if (npc.velocity.Y > 0f && num1167 < 0f) - { - npc.velocity.Y = npc.velocity.Y - num1165 * 2f; - } - } - if (npc.position.X + (float)npc.width > player.position.X && npc.position.X < player.position.X + (float)player.width && npc.position.Y + (float)npc.height < player.position.Y && Collision.CanHit(npc.position, npc.width, npc.height, player.position, player.width, player.height) && Main.netMode != 1) - { - iceShard += 4f; - if (iceShard > 8f) - { - iceShard = 0f; - int num1169 = (int)(npc.position.X + 10f + (float)Main.rand.Next(npc.width - 20)); - int num1170 = (int)(npc.position.Y + (float)npc.height + 4f); - int damage = expertMode ? 23 : 26; - Projectile.NewProjectile((float)num1169, (float)num1170, 0f, 5f, mod.ProjectileType("IceRain"), damage, 0f, Main.myPlayer, 0f, 0f); - return; - } - } - if ((double)npc.life < (double)npc.lifeMax * 0.66) - { - npc.ai[0] = 2f; - npc.localAI[0] = 0f; - iceShard = 0f; - npc.netUpdate = true; - return; - } - } - else if (npc.ai[0] == 2f) - { - if (Main.netMode != 1) - { - npc.localAI[0] += 1f; - if (npc.localAI[0] >= 120f) - { - npc.localAI[0] = 0f; - npc.TargetClosest(true); - npc.netUpdate = true; - if (Collision.CanHit(npc.position, npc.width, npc.height, player.position, player.width, player.height)) - { - if (Main.rand.Next(2) == 0) - { - Vector2 value9 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float spread = 45f * 0.0174f; - double startAngle = Math.Atan2(npc.velocity.X, npc.velocity.Y) - spread / 2; - double deltaAngle = spread / 8f; - double offsetAngle; - int num184 = expertMode ? 20 : 23; - int i; - for (i = 0; i < 6; i++) - { - offsetAngle = (startAngle + deltaAngle * (i + i * i) / 2f) + 32f * i; - int ice = Projectile.NewProjectile(value9.X, value9.Y, (float)(Math.Sin(offsetAngle) * 8f), (float)(Math.Cos(offsetAngle) * 8f), mod.ProjectileType("IceBlast"), num184, 0f, Main.myPlayer, 0f, 0f); - int ice2 = Projectile.NewProjectile(value9.X, value9.Y, (float)(-Math.Sin(offsetAngle) * 8f), (float)(-Math.Cos(offsetAngle) * 8f), mod.ProjectileType("IceBlast"), num184, 0f, Main.myPlayer, 0f, 0f); - Main.projectile[ice].timeLeft = 300; - Main.projectile[ice2].timeLeft = 300; - } - } - else - { - float num179 = revenge ? 9f : 7f; - Vector2 value9 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num180 = player.position.X + (float)player.width * 0.5f - value9.X; - float num181 = Math.Abs(num180) * 0.1f; - float num182 = player.position.Y + (float)player.height * 0.5f - value9.Y - num181; - float num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182)); - npc.netUpdate = true; - num183 = num179 / num183; - num180 *= num183; - num182 *= num183; - int num184 = expertMode ? 23 : 26; - int num185 = mod.ProjectileType("IceRain"); - value9.X += num180; - value9.Y += num182; - for (int num186 = 0; num186 < 15; num186++) - { - num180 = player.position.X + (float)player.width * 0.5f - value9.X; - num182 = player.position.Y + (float)player.height * 0.5f - value9.Y; - num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182)); - num183 = num179 / num183; - num180 += (float)Main.rand.Next(-100, 101); - num182 += (float)Main.rand.Next(-100, 101); - num180 *= num183; - num182 *= num183; - Projectile.NewProjectile(value9.X, value9.Y, num180, -10f, num185, num184, 0f, Main.myPlayer, 0f, 0f); - } - } - } - } - } - Vector2 vector142 = new Vector2(npc.Center.X, npc.Center.Y); - float num1243 = player.Center.X - vector142.X; - float num1244 = player.Center.Y - vector142.Y; - float num1245 = (float)Math.Sqrt((double)(num1243 * num1243 + num1244 * num1244)); - float num1246 = isChill ? 5f : 7f; - if (CalamityWorld.death) - { - num1246 = isChill ? 6f : 8f; - } - if (CalamityWorld.bossRushActive) - { - num1246 = 14f; - } - if (num1245 < num1246) - { - npc.velocity.X = num1243; - npc.velocity.Y = num1244; - } - else - { - num1245 = num1246 / num1245; - npc.velocity.X = num1243 * num1245; - npc.velocity.Y = num1244 * num1245; - } - if ((double)npc.life < (double)npc.lifeMax * 0.49) - { - npc.ai[0] = 3f; - npc.localAI[0] = 0f; - npc.netUpdate = true; - return; - } - } - else if (npc.ai[0] == 3f) - { - if (Main.netMode != 1) - { - npc.localAI[0] += 1f; - if (npc.localAI[0] >= 120f) - { - npc.localAI[0] = 0f; - npc.TargetClosest(true); - if (Collision.CanHit(npc.position, npc.width, npc.height, player.position, player.width, player.height)) - { - float num179 = revenge ? 9f : 7f; - Vector2 value9 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num180 = player.position.X + (float)player.width * 0.5f - value9.X; - float num181 = Math.Abs(num180) * 0.1f; - float num182 = player.position.Y + (float)player.height * 0.5f - value9.Y - num181; - float num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182)); - npc.netUpdate = true; - num183 = num179 / num183; - num180 *= num183; - num182 *= num183; - int num184 = expertMode ? 23 : 26; - int num185 = mod.ProjectileType("IceRain"); - value9.X += num180; - value9.Y += num182; - for (int num186 = 0; num186 < 15; num186++) - { - num180 = player.position.X + (float)player.width * 0.5f - value9.X; - num182 = player.position.Y + (float)player.height * 0.5f - value9.Y; - num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182)); - num183 = num179 / num183; - num180 += (float)Main.rand.Next(-100, 101); - num182 += (float)Main.rand.Next(-100, 101); - num180 *= num183; - num182 *= num183; - Projectile.NewProjectile(value9.X, value9.Y, num180, -10f, num185, num184, 0f, Main.myPlayer, 0f, 0f); - } - } - } - } - float num1164 = isChill ? 4.5f : 6.5f; - float num1165 = isChill ? 1.1f : 1.3f; - if (CalamityWorld.death || CalamityWorld.bossRushActive) - { - num1164 = isChill ? 5.5f : 7.5f; - } - Vector2 vector133 = new Vector2(npc.Center.X, npc.Center.Y); - float num1166 = player.Center.X - vector133.X; - float num1167 = player.Center.Y - vector133.Y - 300f; - float num1168 = (float)Math.Sqrt((double)(num1166 * num1166 + num1167 * num1167)); - if (num1168 < 20f) - { - num1166 = npc.velocity.X; - num1167 = npc.velocity.Y; - } - else - { - num1168 = num1164 / num1168; - num1166 *= num1168; - num1167 *= num1168; - } - if (npc.velocity.X < num1166) - { - npc.velocity.X = npc.velocity.X + num1165; - if (npc.velocity.X < 0f && num1166 > 0f) - { - npc.velocity.X = npc.velocity.X + num1165 * 2f; - } - } - else if (npc.velocity.X > num1166) - { - npc.velocity.X = npc.velocity.X - num1165; - if (npc.velocity.X > 0f && num1166 < 0f) - { - npc.velocity.X = npc.velocity.X - num1165 * 2f; - } - } - if (npc.velocity.Y < num1167) - { - npc.velocity.Y = npc.velocity.Y + num1165; - if (npc.velocity.Y < 0f && num1167 > 0f) - { - npc.velocity.Y = npc.velocity.Y + num1165 * 2f; - } - } - else if (npc.velocity.Y > num1167) - { - npc.velocity.Y = npc.velocity.Y - num1165; - if (npc.velocity.Y > 0f && num1167 < 0f) - { - npc.velocity.Y = npc.velocity.Y - num1165 * 2f; - } - } - if (npc.position.X + (float)npc.width > player.position.X && npc.position.X < player.position.X + (float)player.width && npc.position.Y + (float)npc.height < player.position.Y && Collision.CanHit(npc.position, npc.width, npc.height, player.position, player.width, player.height) && Main.netMode != 1) - { - iceShard += 4f; - if (iceShard > 8f) - { - iceShard = 0f; - int num1169 = (int)(npc.position.X + 10f + (float)Main.rand.Next(npc.width - 20)); - int num1170 = (int)(npc.position.Y + (float)npc.height + 4f); - int damage = expertMode ? 23 : 26; - Projectile.NewProjectile((float)num1169, (float)num1170, 0f, 5f, mod.ProjectileType("IceRain"), damage, 0f, Main.myPlayer, 0f, 0f); - return; - } - } - if ((double)npc.life < (double)npc.lifeMax * 0.32) - { - npc.ai[0] = 4f; - npc.localAI[0] = 0f; - iceShard = 0f; - npc.netUpdate = true; - return; - } - } - else if (npc.ai[0] == 4f) - { - if (Main.netMode != 1) - { - npc.localAI[0] += 1f; - if (npc.localAI[0] >= 60f && npc.alpha <= 0) - { - npc.localAI[0] = 0f; - npc.TargetClosest(true); - if (Collision.CanHit(npc.position, npc.width, npc.height, player.position, player.width, player.height)) - { - Vector2 value9 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float spread = 45f * 0.0174f; - double startAngle = Math.Atan2(npc.velocity.X, npc.velocity.Y) - spread / 2; - double deltaAngle = spread / 8f; - double offsetAngle; - int num184 = expertMode ? 20 : 23; - int i; - for (i = 0; i < 6; i++) - { - offsetAngle = (startAngle + deltaAngle * (i + i * i) / 2f) + 32f * i; - int ice = Projectile.NewProjectile(value9.X, value9.Y, (float)(Math.Sin(offsetAngle) * 9f), (float)(Math.Cos(offsetAngle) * 9f), mod.ProjectileType("IceBlast"), num184, 0f, Main.myPlayer, 0f, 0f); - int ice2 = Projectile.NewProjectile(value9.X, value9.Y, (float)(-Math.Sin(offsetAngle) * 9f), (float)(-Math.Cos(offsetAngle) * 9f), mod.ProjectileType("IceBlast"), num184, 0f, Main.myPlayer, 0f, 0f); - Main.projectile[ice].timeLeft = 300; - Main.projectile[ice2].timeLeft = 300; - } - } - } - } - npc.TargetClosest(true); - Vector2 vector142 = new Vector2(npc.Center.X, npc.Center.Y); - float num1243 = player.Center.X - vector142.X; - float num1244 = player.Center.Y - vector142.Y; - float num1245 = (float)Math.Sqrt((double)(num1243 * num1243 + num1244 * num1244)); - float speed = revenge ? 4.5f : 4f; - if (CalamityWorld.bossRushActive) - { - speed = 9f; - } - if (num1245 < speed) - { - npc.velocity.X = num1243; - npc.velocity.Y = num1244; - } - else - { - num1245 = speed / num1245; - npc.velocity.X = num1243 * num1245; - npc.velocity.Y = num1244 * num1245; - } - if (npc.ai[1] == 0f) - { - npc.chaseable = true; - npc.dontTakeDamage = false; - if (Main.netMode != 1) - { - npc.localAI[2] += 1f; - if (npc.localAI[2] >= (float)(120 + Main.rand.Next(200))) - { - npc.localAI[2] = 0f; - npc.TargetClosest(true); - int num1249 = 0; - int num1250; - int num1251; - while (true) - { - num1249++; - num1250 = (int)player.Center.X / 16; - num1251 = (int)player.Center.Y / 16; - num1250 += Main.rand.Next(-50, 51); - num1251 += Main.rand.Next(-50, 51); - if (!WorldGen.SolidTile(num1250, num1251) && Collision.CanHit(new Vector2((float)(num1250 * 16), (float)(num1251 * 16)), 1, 1, player.position, player.width, player.height)) - { - break; - } - if (num1249 > 100) - { - goto Block; - } - } - npc.ai[1] = 1f; - npc.localAI[3] = (float)num1250; - iceShard = (float)num1251; - npc.netUpdate = true; - Block:; - } - } - } - else if (npc.ai[1] == 1f) - { - npc.damage = 0; - npc.dontTakeDamage = true; - npc.chaseable = false; - npc.alpha += 4; - if (npc.alpha >= 255) - { - npc.alpha = 255; - npc.position.X = npc.localAI[3] * 16f - (float)(npc.width / 2); - npc.position.Y = iceShard * 16f - (float)(npc.height / 2); - npc.ai[1] = 2f; - npc.netUpdate = true; - } - } - else if (npc.ai[1] == 2f) - { - npc.alpha -= 4; - if (npc.alpha <= 0) - { - npc.damage = expertMode ? 96 : 60; - npc.dontTakeDamage = false; - npc.chaseable = true; - npc.alpha = 0; - npc.ai[1] = 0f; - npc.netUpdate = true; - } - } - if ((double)npc.life < (double)npc.lifeMax * 0.15) - { - Main.PlaySound(4, (int)npc.position.X, (int)npc.position.Y, 15); - drawAltTexture = true; - for (int num621 = 0; num621 < 40; num621++) - { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 67, 0f, 0f, 100, default(Color), 2f); - Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) - { - Main.dust[num622].scale = 0.5f; - Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; - } - } - for (int num623 = 0; num623 < 70; num623++) - { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 67, 0f, 0f, 100, default(Color), 3f); - Main.dust[num624].noGravity = true; - Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 67, 0f, 0f, 100, default(Color), 2f); - Main.dust[num624].velocity *= 2f; - } - float randomSpread = (float)(Main.rand.Next(-200, 200) / 100); - Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/CryoGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/CryoGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/CryoGore3"), 1f); - npc.ai[0] = 5f; - npc.ai[1] = 0f; - npc.localAI[0] = 0f; - npc.localAI[2] = 0f; - npc.localAI[3] = 0f; - iceShard = 0f; - npc.netUpdate = true; - string key = "Mods.CalamityMod.CryogenBossText"; - Color messageColor = Color.Cyan; - if (Main.netMode == 0) - { - Main.NewText(Language.GetTextValue(key), messageColor); - } - else if (Main.netMode == 2) - { - NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); - } - return; - } - } - else - { - npc.dontTakeDamage = false; - npc.chaseable = true; - float num1372 = isChill ? 16f : 22f; - if (CalamityWorld.bossRushActive) - { - num1372 = 24f; - } - Vector2 vector167 = new Vector2(npc.Center.X + (float)(npc.direction * 20), npc.Center.Y + 6f); - float num1373 = player.position.X + (float)player.width * 0.5f - vector167.X; - float num1374 = player.Center.Y - vector167.Y; - float num1375 = (float)Math.Sqrt((double)(num1373 * num1373 + num1374 * num1374)); - float num1376 = num1372 / num1375; - num1373 *= num1376; - num1374 *= num1376; - iceShard -= 1f; - if ((double)npc.life < (double)npc.lifeMax * 0.05 || CalamityWorld.death || CalamityWorld.bossRushActive) - { - if (num1375 < 170f || iceShard > 0f) - { - if (num1375 < 170f) - { - iceShard = 17f; - } - if (npc.velocity.X < 0f) - { - npc.direction = -1; - } - else - { - npc.direction = 1; - } - npc.rotation += (float)npc.direction * 0.5f; - return; - } - } - else if ((double)npc.life < (double)npc.lifeMax * 0.1) - { - if (num1375 < 190f || iceShard > 0f) - { - if (num1375 < 190f) - { - iceShard = 19f; - } - if (npc.velocity.X < 0f) - { - npc.direction = -1; - } - else - { - npc.direction = 1; - } - npc.rotation += (float)npc.direction * 0.35f; - return; - } - } - else - { - if (num1375 < 200f || iceShard > 0f) - { - if (num1375 < 200f) - { - iceShard = 20f; - } - if (npc.velocity.X < 0f) - { - npc.direction = -1; - } - else - { - npc.direction = 1; - } - npc.rotation += (float)npc.direction * 0.3f; - return; - } - } - npc.velocity.X = (npc.velocity.X * 50f + num1373) / 51f; - npc.velocity.Y = (npc.velocity.Y * 50f + num1374) / 51f; - if (num1375 < 350f) - { - npc.velocity.X = (npc.velocity.X * 10f + num1373) / 11f; - npc.velocity.Y = (npc.velocity.Y * 10f + num1374) / 11f; - } - if (num1375 < 300f) - { - npc.velocity.X = (npc.velocity.X * 7f + num1373) / 8f; - npc.velocity.Y = (npc.velocity.Y * 7f + num1374) / 8f; - } - npc.rotation = npc.velocity.X * 0.15f; - return; - } if (npc.ai[3] == 0f && npc.life > 0) { npc.ai[3] = (float)npc.lifeMax; } - if (npc.life > 0) + if (npc.life > 0) { if (Main.netMode != 1) { @@ -833,24 +833,24 @@ namespace CalamityMod.NPCs.Cryogen } } - public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) //for alt textures - { - if (drawAltTexture) - { - Mod mod = ModLoader.GetMod("CalamityMod"); - Texture2D texture = mod.GetTexture("NPCs/Cryogen/Cryogen2"); - CalamityMod.DrawTexture(spriteBatch, texture, 0, npc, drawColor); - return false; - } - return true; - } + public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) //for alt textures + { + if (drawAltTexture) + { + Mod mod = ModLoader.GetMod("CalamityMod"); + Texture2D texture = mod.GetTexture("NPCs/Cryogen/Cryogen2"); + CalamityMod.DrawTexture(spriteBatch, texture, 0, npc, drawColor); + return false; + } + return true; + } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { npc.lifeMax = (int)(npc.lifeMax * 0.8f * bossLifeScale); npc.damage = (int)(npc.damage * 0.8f); } - + public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 3; k++) @@ -877,13 +877,13 @@ namespace CalamityMod.NPCs.Cryogen num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 67, 0f, 0f, 100, default(Color), 2f); Main.dust[num624].velocity *= 2f; } - float randomSpread = (float)(Main.rand.Next(-200, 200) / 100); - Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/CryoGore8"), 1f); - Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/CryoGore9"), 1f); - Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/CryoGore10"), 1f); - } + float randomSpread = (float)(Main.rand.Next(-200, 200) / 100); + Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/CryoGore8"), 1f); + Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/CryoGore9"), 1f); + Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/CryoGore10"), 1f); + } } - + private void RainStart() { if (!Main.raining) @@ -940,45 +940,45 @@ namespace CalamityMod.NPCs.Cryogen } } } - + public override void BossLoot(ref string name, ref int potionType) { potionType = ItemID.GreaterHealingPotion; } - + public override void NPCLoot() { - int permadongo = NPC.FindFirstNPC(mod.NPCType("DILF")); - if (permadongo == -1 && Main.netMode != 1) - { - NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("DILF"), 0, 0f, 0f, 0f, 0f, 255); - } - if (Main.rand.Next(10) == 0) + int permadongo = NPC.FindFirstNPC(mod.NPCType("DILF")); + if (permadongo == -1 && Main.netMode != 1) + { + NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("DILF"), 0, 0f, 0f, 0f, 0f, 255); + } + if (Main.rand.Next(10) == 0) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CryogenTrophy")); } - if (CalamityWorld.armageddon) - { - for (int i = 0; i < 10; i++) - { - npc.DropBossBags(); - } - } - if (Main.expertMode) + if (CalamityWorld.armageddon) + { + for (int i = 0; i < 5; i++) + { + npc.DropBossBags(); + } + } + if (Main.expertMode) { npc.DropBossBags(); } else { - if (Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.FrozenKey); - } - if (Main.rand.Next(10) == 0) - { - npc.DropItemInstanced(npc.position, npc.Size, mod.ItemType("CryoStone"), 1, true); - } - if (Main.rand.Next(7) == 0) + if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.FrozenKey); + } + if (Main.rand.Next(10) == 0) + { + npc.DropItemInstanced(npc.position, npc.Size, mod.ItemType("CryoStone"), 1, true); + } + if (Main.rand.Next(7) == 0) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CryogenMask")); } @@ -1010,17 +1010,17 @@ namespace CalamityMod.NPCs.Cryogen { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SnowstormStaff")); } - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.SoulofMight, Main.rand.Next(20, 41)); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CryoBar"), Main.rand.Next(15, 26)); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EssenceofEleum"), Main.rand.Next(3, 6)); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.SoulofMight, Main.rand.Next(20, 41)); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CryoBar"), Main.rand.Next(15, 26)); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EssenceofEleum"), Main.rand.Next(4, 9)); Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.FrostCore); } } - + public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(BuffID.Frostburn, 120, true); - player.AddBuff(BuffID.Chilled, 90, true); - } + player.AddBuff(BuffID.Frostburn, 120, true); + player.AddBuff(BuffID.Chilled, 90, true); + } } } \ No newline at end of file diff --git a/NPCs/Cryogen/CryogenIce.cs b/NPCs/Cryogen/CryogenIce.cs index 62555c339e..3fde803628 100644 --- a/NPCs/Cryogen/CryogenIce.cs +++ b/NPCs/Cryogen/CryogenIce.cs @@ -30,7 +30,7 @@ namespace CalamityMod.NPCs.Cryogen npc.lifeMax = 1400; if (CalamityWorld.bossRushActive) { - npc.lifeMax = 200000; + npc.lifeMax = 100000; } npc.alpha = 255; npc.HitSound = SoundID.NPCHit5; diff --git a/NPCs/Cryogen/IceMass.cs b/NPCs/Cryogen/IceMass.cs index 957714b5bd..d854b49837 100644 --- a/NPCs/Cryogen/IceMass.cs +++ b/NPCs/Cryogen/IceMass.cs @@ -33,6 +33,7 @@ namespace CalamityMod.NPCs.Cryogen } npc.knockBackResist = 0f; animationType = 472; + npc.canGhostHeal = false; npc.HitSound = SoundID.NPCHit5; npc.DeathSound = SoundID.NPCDeath15; } diff --git a/NPCs/DesertScourge/DesertScourgeBody.cs b/NPCs/DesertScourge/DesertScourgeBody.cs index 21b4ac7808..442606ba9d 100644 --- a/NPCs/DesertScourge/DesertScourgeBody.cs +++ b/NPCs/DesertScourge/DesertScourgeBody.cs @@ -29,11 +29,11 @@ namespace CalamityMod.NPCs.DesertScourge { npc.lifeMax = 5100; } - if (CalamityWorld.bossRushActive) - { - npc.lifeMax = CalamityWorld.death ? 9000000 : 8100000; - } - npc.aiStyle = 6; //new + if (CalamityWorld.bossRushActive) + { + npc.lifeMax = CalamityWorld.death ? 4500000 : 4100000; + } + npc.aiStyle = 6; //new aiType = -1; //new animationType = 10; //new npc.knockBackResist = 0f; @@ -51,6 +51,7 @@ namespace CalamityMod.NPCs.DesertScourge npc.behindTiles = true; npc.noGravity = true; npc.noTileCollide = true; + npc.canGhostHeal = false; npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; npc.netAlways = true; diff --git a/NPCs/DesertScourge/DesertScourgeBodySmall.cs b/NPCs/DesertScourge/DesertScourgeBodySmall.cs index 0e7505d35f..9b56eda18e 100644 --- a/NPCs/DesertScourge/DesertScourgeBodySmall.cs +++ b/NPCs/DesertScourge/DesertScourgeBodySmall.cs @@ -38,6 +38,7 @@ namespace CalamityMod.NPCs.DesertScourge npc.behindTiles = true; npc.noGravity = true; npc.noTileCollide = true; + npc.canGhostHeal = false; npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; npc.netAlways = true; diff --git a/NPCs/DesertScourge/DesertScourgeHead.cs b/NPCs/DesertScourge/DesertScourgeHead.cs index c25973414e..da29711c33 100644 --- a/NPCs/DesertScourge/DesertScourgeHead.cs +++ b/NPCs/DesertScourge/DesertScourgeHead.cs @@ -44,7 +44,7 @@ namespace CalamityMod.NPCs.DesertScourge } if (CalamityWorld.bossRushActive) { - npc.lifeMax = CalamityWorld.death ? 9000000 : 8100000; + npc.lifeMax = CalamityWorld.death ? 4500000 : 4100000; } npc.aiStyle = 6; //new aiType = -1; //new diff --git a/NPCs/DesertScourge/DesertScourgeTail.cs b/NPCs/DesertScourge/DesertScourgeTail.cs index e92bfcb2e6..ae8edd1cef 100644 --- a/NPCs/DesertScourge/DesertScourgeTail.cs +++ b/NPCs/DesertScourge/DesertScourgeTail.cs @@ -29,11 +29,11 @@ namespace CalamityMod.NPCs.DesertScourge { npc.lifeMax = 5100; } - if (CalamityWorld.bossRushActive) - { - npc.lifeMax = CalamityWorld.death ? 9000000 : 8100000; - } - npc.aiStyle = 6; //new + if (CalamityWorld.bossRushActive) + { + npc.lifeMax = CalamityWorld.death ? 4500000 : 4100000; + } + npc.aiStyle = 6; //new aiType = -1; //new animationType = 10; //new npc.knockBackResist = 0f; @@ -51,6 +51,7 @@ namespace CalamityMod.NPCs.DesertScourge npc.behindTiles = true; npc.noGravity = true; npc.noTileCollide = true; + npc.canGhostHeal = false; npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; npc.netAlways = true; diff --git a/NPCs/DesertScourge/DesertScourgeTailSmall.cs b/NPCs/DesertScourge/DesertScourgeTailSmall.cs index 59b702bc65..f5465721df 100644 --- a/NPCs/DesertScourge/DesertScourgeTailSmall.cs +++ b/NPCs/DesertScourge/DesertScourgeTailSmall.cs @@ -38,6 +38,7 @@ namespace CalamityMod.NPCs.DesertScourge npc.behindTiles = true; npc.noGravity = true; npc.noTileCollide = true; + npc.canGhostHeal = false; npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; npc.netAlways = true; diff --git a/NPCs/DesertScourge/DriedSeekerBody.cs b/NPCs/DesertScourge/DriedSeekerBody.cs index 4ac3e45550..06b2c21f49 100644 --- a/NPCs/DesertScourge/DriedSeekerBody.cs +++ b/NPCs/DesertScourge/DriedSeekerBody.cs @@ -36,6 +36,7 @@ namespace CalamityMod.NPCs.DesertScourge npc.behindTiles = true; npc.noGravity = true; npc.noTileCollide = true; + npc.canGhostHeal = false; npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; npc.netAlways = true; diff --git a/NPCs/DesertScourge/DriedSeekerHead.cs b/NPCs/DesertScourge/DriedSeekerHead.cs index c31a494fdd..b95028d540 100644 --- a/NPCs/DesertScourge/DriedSeekerHead.cs +++ b/NPCs/DesertScourge/DriedSeekerHead.cs @@ -41,6 +41,7 @@ namespace CalamityMod.NPCs.DesertScourge npc.behindTiles = true; npc.noGravity = true; npc.noTileCollide = true; + npc.canGhostHeal = false; npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; npc.netAlways = true; diff --git a/NPCs/DesertScourge/DriedSeekerTail.cs b/NPCs/DesertScourge/DriedSeekerTail.cs index d16e49d17a..de154a42b2 100644 --- a/NPCs/DesertScourge/DriedSeekerTail.cs +++ b/NPCs/DesertScourge/DriedSeekerTail.cs @@ -35,6 +35,7 @@ namespace CalamityMod.NPCs.DesertScourge animationType = 10; npc.behindTiles = true; npc.noGravity = true; + npc.canGhostHeal = false; npc.noTileCollide = true; npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; diff --git a/NPCs/GreatSandShark/GreatSandShark.cs b/NPCs/GreatSandShark/GreatSandShark.cs index 633442eba3..91a6969722 100644 --- a/NPCs/GreatSandShark/GreatSandShark.cs +++ b/NPCs/GreatSandShark/GreatSandShark.cs @@ -39,7 +39,9 @@ namespace CalamityMod.NPCs.GreatSandShark aiType = -1; npc.knockBackResist = 0f; npc.value = Item.buyPrice(0, 10, 0, 0); - for (int k = 0; k < npc.buffImmune.Length; k++) + NPCID.Sets.TrailCacheLength[npc.type] = 8; + NPCID.Sets.TrailingMode[npc.type] = 1; + for (int k = 0; k < npc.buffImmune.Length; k++) { npc.buffImmune[k] = true; npc.buffImmune[BuffID.Ichor] = false; @@ -61,7 +63,9 @@ namespace CalamityMod.NPCs.GreatSandShark npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; npc.timeLeft = NPC.activeTime * 30; - } + banner = npc.type; + bannerItem = mod.ItemType("GreatSandSharkBanner"); + } public override void AI() { @@ -569,7 +573,52 @@ namespace CalamityMod.NPCs.GreatSandShark int frame = (int)npc.frameCounter; npc.frame.Y = frame * frameHeight; } - + + public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) + { + SpriteEffects spriteEffects = SpriteEffects.None; + if (npc.spriteDirection == 1) + { + spriteEffects = SpriteEffects.FlipHorizontally; + } + Microsoft.Xna.Framework.Color color24 = npc.GetAlpha(drawColor); + Microsoft.Xna.Framework.Color color25 = Lighting.GetColor((int)((double)npc.position.X + (double)npc.width * 0.5) / 16, (int)(((double)npc.position.Y + (double)npc.height * 0.5) / 16.0)); + Texture2D texture2D3 = Main.npcTexture[npc.type]; + int num156 = Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type]; + int y3 = num156 * (int)npc.frameCounter; + Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle(0, y3, texture2D3.Width, num156); + Vector2 origin2 = rectangle.Size() / 2f; + int num157 = 8; + int num158 = 2; + int num159 = 1; + float num160 = 0f; + int num161 = num159; + while (((num158 > 0 && num161 < num157) || (num158 < 0 && num161 > num157)) && Lighting.NotRetro) + { + Microsoft.Xna.Framework.Color color26 = npc.GetAlpha(color25); + { + goto IL_6899; + } + IL_6881: + num161 += num158; + continue; + IL_6899: + float num164 = (float)(num157 - num161); + if (num158 < 0) + { + num164 = (float)(num159 - num161); + } + color26 *= num164 / ((float)NPCID.Sets.TrailCacheLength[npc.type] * 1.5f); + Vector2 value4 = (npc.oldPos[num161]); + float num165 = npc.rotation; + Main.spriteBatch.Draw(texture2D3, value4 + npc.Size / 2f - Main.screenPosition + new Vector2(0, npc.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rectangle), color26, num165 + npc.rotation * num160 * (float)(num161 - 1) * -(float)spriteEffects.HasFlag(SpriteEffects.FlipHorizontally).ToDirectionInt(), origin2, npc.scale, spriteEffects, 0f); + goto IL_6881; + } + var something = npc.direction == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; + spriteBatch.Draw(texture2D3, npc.Center - Main.screenPosition + new Vector2(0, npc.gfxOffY), npc.frame, color24, npc.rotation, npc.frame.Size() / 2, npc.scale, something, 0); + return false; + } + public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 5; k++) diff --git a/NPCs/HiveMind/DankCreeper.cs b/NPCs/HiveMind/DankCreeper.cs index b80a8dd1ef..8ff01c2589 100644 --- a/NPCs/HiveMind/DankCreeper.cs +++ b/NPCs/HiveMind/DankCreeper.cs @@ -34,6 +34,7 @@ namespace CalamityMod.NPCs.HiveMind npc.knockBackResist = 0.3f; npc.noGravity = true; npc.noTileCollide = true; + npc.canGhostHeal = false; npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; } @@ -102,6 +103,9 @@ namespace CalamityMod.NPCs.HiveMind { Dust.NewDust(npc.position, npc.width, npc.height, 13, hitDirection, -1f, 0, default(Color), 1f); } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HiveMindGores/DankCreeperGore"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HiveMindGores/DankCreeperGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HiveMindGores/DankCreeperGore3"), 1f); } } diff --git a/NPCs/HiveMind/DarkHeart.cs b/NPCs/HiveMind/DarkHeart.cs index fb162d04cd..9b2d92285c 100644 --- a/NPCs/HiveMind/DarkHeart.cs +++ b/NPCs/HiveMind/DarkHeart.cs @@ -33,6 +33,8 @@ namespace CalamityMod.NPCs.HiveMind aiType = -1; //new npc.knockBackResist = 0.4f; npc.noGravity = true; + npc.canGhostHeal = false; + npc.chaseable = false; npc.HitSound = SoundID.NPCHit13; npc.DeathSound = SoundID.NPCDeath21; } diff --git a/NPCs/HiveMind/HiveBlob.cs b/NPCs/HiveMind/HiveBlob.cs index 18b235746a..57ad82f773 100644 --- a/NPCs/HiveMind/HiveBlob.cs +++ b/NPCs/HiveMind/HiveBlob.cs @@ -17,7 +17,7 @@ namespace CalamityMod.NPCs.HiveMind DisplayName.SetDefault("Hive Blob"); Main.npcFrameCount[npc.type] = 4; } - + public override void SetDefaults() { npc.npcSlots = 0.1f; @@ -26,17 +26,19 @@ namespace CalamityMod.NPCs.HiveMind npc.width = 25; //324 npc.height = 25; //216 npc.lifeMax = 75; - if (CalamityWorld.bossRushActive) - { - npc.lifeMax = 13000; - } - aiType = -1; + if (CalamityWorld.bossRushActive) + { + npc.lifeMax = 13000; + } + aiType = -1; npc.noGravity = true; npc.noTileCollide = true; + npc.canGhostHeal = false; + npc.chaseable = false; npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; } - + public override void AI() { bool expertMode = Main.expertMode; @@ -48,14 +50,14 @@ namespace CalamityMod.NPCs.HiveMind return; } int num750 = CalamityGlobalNPC.hiveMind; - if (npc.ai[3] > 0f) + if (npc.ai[3] > 0f) { num750 = (int)npc.ai[3] - 1; } - if (Main.netMode != 1) + if (Main.netMode != 1) { npc.localAI[0] -= 1f; - if (npc.localAI[0] <= 0f) + if (npc.localAI[0] <= 0f) { npc.localAI[0] = (float)Main.rand.Next(120, 480); npc.ai[0] = (float)Main.rand.Next(-100, 101); @@ -66,15 +68,15 @@ namespace CalamityMod.NPCs.HiveMind npc.TargetClosest(true); float num751 = 0.02f; float num752 = 400f; - if ((double)Main.npc[CalamityGlobalNPC.hiveMind].life < (double)Main.npc[CalamityGlobalNPC.hiveMind].lifeMax * 0.5) + if ((double)Main.npc[CalamityGlobalNPC.hiveMind].life < (double)Main.npc[CalamityGlobalNPC.hiveMind].lifeMax * 0.5) { num752 += 60f; } - if ((double)Main.npc[CalamityGlobalNPC.hiveMind].life < (double)Main.npc[CalamityGlobalNPC.hiveMind].lifeMax * 0.15) + if ((double)Main.npc[CalamityGlobalNPC.hiveMind].life < (double)Main.npc[CalamityGlobalNPC.hiveMind].lifeMax * 0.15) { num752 += 120f; } - if (expertMode) + if (expertMode) { float num753 = 1f - (float)npc.life / (float)npc.lifeMax; num752 += num753 * 100f; @@ -84,7 +86,7 @@ namespace CalamityMod.NPCs.HiveMind { num751 += 0.1f; } - if (!Main.npc[num750].active || CalamityGlobalNPC.hiveMind < 0) + if (!Main.npc[num750].active || CalamityGlobalNPC.hiveMind < 0) { npc.active = false; return; @@ -104,69 +106,99 @@ namespace CalamityMod.NPCs.HiveMind num760 = num752 / num760; num758 *= num760; num759 *= num760; - if (npc.position.X < num754 + num758) + if (npc.position.X < num754 + num758) { npc.velocity.X = npc.velocity.X + num751; - if (npc.velocity.X < 0f && num758 > 0f) + if (npc.velocity.X < 0f && num758 > 0f) { npc.velocity.X = npc.velocity.X * 0.9f; } - } - else if (npc.position.X > num754 + num758) + } + else if (npc.position.X > num754 + num758) { npc.velocity.X = npc.velocity.X - num751; - if (npc.velocity.X > 0f && num758 < 0f) + if (npc.velocity.X > 0f && num758 < 0f) { npc.velocity.X = npc.velocity.X * 0.9f; } } - if (npc.position.Y < num755 + num759) + if (npc.position.Y < num755 + num759) { npc.velocity.Y = npc.velocity.Y + num751; - if (npc.velocity.Y < 0f && num759 > 0f) - { - npc.velocity.Y = npc.velocity.Y * 0.9f; - } - } - else if (npc.position.Y > num755 + num759) - { - npc.velocity.Y = npc.velocity.Y - num751; - if (npc.velocity.Y > 0f && num759 < 0f) + if (npc.velocity.Y < 0f && num759 > 0f) { npc.velocity.Y = npc.velocity.Y * 0.9f; } } - if (npc.velocity.X > 8f) + else if (npc.position.Y > num755 + num759) + { + npc.velocity.Y = npc.velocity.Y - num751; + if (npc.velocity.Y > 0f && num759 < 0f) + { + npc.velocity.Y = npc.velocity.Y * 0.9f; + } + } + if (npc.velocity.X > 8f) { npc.velocity.X = 8f; } - if (npc.velocity.X < -8f) + if (npc.velocity.X < -8f) { npc.velocity.X = -8f; } - if (npc.velocity.Y > 8f) + if (npc.velocity.Y > 8f) { npc.velocity.Y = 8f; } - if (npc.velocity.Y < -8f) + if (npc.velocity.Y < -8f) { npc.velocity.Y = -8f; } + if (Main.netMode != 1) + { + npc.localAI[1] += 1f; + if (npc.localAI[1] >= 600f) + { + npc.localAI[1] = 0f; + npc.TargetClosest(true); + if (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) + { + float num941 = revenge ? 9f : 8f; //speed + if (CalamityWorld.death || CalamityWorld.bossRushActive) + { + num941 = 11f; + } + Vector2 vector104 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)(npc.height / 2)); + float num942 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector104.X; + float num943 = Main.player[npc.target].position.Y + (float)Main.player[npc.target].height * 0.5f - vector104.Y; + float num944 = (float)Math.Sqrt((double)(num942 * num942 + num943 * num943)); + num944 = num941 / num944; + num942 *= num944; + num943 *= num944; + int num945 = expertMode ? 12 : 15; + int num946 = mod.ProjectileType("VileClot"); + vector104.X += num942 * 5f; + vector104.Y += num943 * 5f; + int num947 = Projectile.NewProjectile(vector104.X, vector104.Y, num942, num943, num946, num945, 0f, Main.myPlayer, 0f, 0f); + npc.netUpdate = true; + } + } + } } - + public override bool CheckActive() { return false; } - + public override void FindFrame(int frameHeight) - { - npc.frameCounter += 0.1f; - npc.frameCounter %= Main.npcFrameCount[npc.type]; - int frame = (int)npc.frameCounter; - npc.frame.Y = frame * frameHeight; - } - + { + npc.frameCounter += 0.1f; + npc.frameCounter %= Main.npcFrameCount[npc.type]; + int frame = (int)npc.frameCounter; + npc.frame.Y = frame * frameHeight; + } + public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 5; k++) diff --git a/NPCs/HiveMind/HiveBlob2.cs b/NPCs/HiveMind/HiveBlob2.cs index cc284548a9..fc6df46f18 100644 --- a/NPCs/HiveMind/HiveBlob2.cs +++ b/NPCs/HiveMind/HiveBlob2.cs @@ -33,6 +33,8 @@ namespace CalamityMod.NPCs.HiveMind aiType = -1; npc.noGravity = true; npc.noTileCollide = true; + npc.canGhostHeal = false; + npc.chaseable = false; npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; } @@ -152,6 +154,36 @@ namespace CalamityMod.NPCs.HiveMind { npc.velocity.Y = -8f; } + if (Main.netMode != 1) + { + npc.localAI[1] += 1f; + if (npc.localAI[1] >= 600f) + { + npc.localAI[1] = 0f; + npc.TargetClosest(true); + if (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) + { + float num941 = revenge ? 9f : 8f; //speed + if (CalamityWorld.death || CalamityWorld.bossRushActive) + { + num941 = 11f; + } + Vector2 vector104 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)(npc.height / 2)); + float num942 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector104.X; + float num943 = Main.player[npc.target].position.Y + (float)Main.player[npc.target].height * 0.5f - vector104.Y; + float num944 = (float)Math.Sqrt((double)(num942 * num942 + num943 * num943)); + num944 = num941 / num944; + num942 *= num944; + num943 *= num944; + int num945 = expertMode ? 12 : 15; + int num946 = mod.ProjectileType("VileClot"); + vector104.X += num942 * 5f; + vector104.Y += num943 * 5f; + int num947 = Projectile.NewProjectile(vector104.X, vector104.Y, num942, num943, num946, num945, 0f, Main.myPlayer, 0f, 0f); + npc.netUpdate = true; + } + } + } } public override bool CheckActive() diff --git a/NPCs/HiveMind/HiveMind.cs b/NPCs/HiveMind/HiveMind.cs index 57e8c06509..8193118bbe 100644 --- a/NPCs/HiveMind/HiveMind.cs +++ b/NPCs/HiveMind/HiveMind.cs @@ -35,10 +35,12 @@ namespace CalamityMod.NPCs.HiveMind } if (CalamityWorld.bossRushActive) { - npc.lifeMax = CalamityWorld.death ? 1600000 : 1300000; + npc.lifeMax = CalamityWorld.death ? 800000 : 700000; } npc.aiStyle = -1; //new aiType = -1; //new + npc.buffImmune[mod.BuffType("GlacialState")] = true; + npc.buffImmune[mod.BuffType("TemporalSadness")] = true; npc.knockBackResist = 0f; npc.boss = true; npc.value = 0f; @@ -288,13 +290,20 @@ namespace CalamityMod.NPCs.HiveMind num285++; } } - else if (Main.netMode != 1) + else { - if (NPC.CountNPCS(mod.NPCType("HiveMindP2")) < 1) - { - NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("HiveMindP2"), npc.whoAmI, 0f, 0f, 0f, 0f, npc.target); - Main.PlaySound(15, (int)npc.Center.X, (int)npc.Center.Y, 0); - } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HiveMindGores/HiveMindGore"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HiveMindGores/HiveMindGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HiveMindGores/HiveMindGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HiveMindGores/HiveMindGore4"), 1f); + if (Main.netMode != 1) + { + if (NPC.CountNPCS(mod.NPCType("HiveMindP2")) < 1) + { + NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("HiveMindP2"), npc.whoAmI, 0f, 0f, 0f, 0f, npc.target); + Main.PlaySound(15, (int)npc.Center.X, (int)npc.Center.Y, 0); + } + } } } diff --git a/NPCs/HiveMind/HiveMindP2.cs b/NPCs/HiveMind/HiveMindP2.cs index fca654bf4f..6b8d663aad 100644 --- a/NPCs/HiveMind/HiveMindP2.cs +++ b/NPCs/HiveMind/HiveMindP2.cs @@ -30,32 +30,32 @@ 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 - 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 driftBoost = 1f; //max speed added as health decreases - int lungeDelay = 90; //# of ticks long hive mind spends sliding to a stop before lunging + int reelbackFade = 3; //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 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 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 + 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; int phase2timer = 360; int rotationDirection; double rotation; double rotationIncrement; int state = 0; - int previousState = 0; - int nextState = 0; - int reelCount = 0; - int oldDamage = 40; - Vector2 deceleration; + int previousState = 0; + int nextState = 0; + int reelCount = 0; + int oldDamage = 40; + Vector2 deceleration; - public override void SetStaticDefaults() + public override void SetStaticDefaults() { DisplayName.SetDefault("The Hive Mind"); Main.npcFrameCount[npc.type] = 4; } - + public override void SetDefaults() { npc.npcSlots = 5f; @@ -64,16 +64,18 @@ namespace CalamityMod.NPCs.HiveMind npc.height = 120; //216 npc.defense = 5; npc.lifeMax = CalamityWorld.revenge ? 4320 : 3000; - if (CalamityWorld.death) - { - npc.lifeMax = 7200; - } - if (CalamityWorld.bossRushActive) - { - npc.lifeMax = CalamityWorld.death ? 1600000 : 1300000; - } - npc.aiStyle = -1; //new - aiType = -1; //new + if (CalamityWorld.death) + { + npc.lifeMax = 7200; + } + if (CalamityWorld.bossRushActive) + { + npc.lifeMax = CalamityWorld.death ? 1600000 : 1400000; + } + npc.aiStyle = -1; //new + aiType = -1; //new + npc.buffImmune[mod.BuffType("GlacialState")] = true; + npc.buffImmune[mod.BuffType("TemporalSadness")] = true; npc.knockBackResist = 0f; npc.value = Item.buyPrice(0, 6, 0, 0); npc.boss = true; @@ -81,32 +83,33 @@ namespace CalamityMod.NPCs.HiveMind npc.noTileCollide = true; npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; - Mod calamityModMusic = ModLoader.GetMod("CalamityModMusic"); - if (calamityModMusic != null) - music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/HiveMind"); - else - music = MusicID.Boss2; - bossBag = mod.ItemType("HiveMindBag"); + Mod calamityModMusic = ModLoader.GetMod("CalamityModMusic"); + if (calamityModMusic != null) + music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/HiveMind"); + else + music = MusicID.Boss2; + bossBag = mod.ItemType("HiveMindBag"); NPCID.Sets.TrailCacheLength[npc.type] = 8; NPCID.Sets.TrailingMode[npc.type] = 1; if (Main.expertMode) - { - minimumDriftTime = 240; - } - if (CalamityWorld.revenge) { minimumDriftTime = 120; - reelbackFade = 5; - driftBoost = 3f; + reelbackFade = 5; + } + if (CalamityWorld.revenge) + { + lungeRots = 0.3; + minimumDriftTime = 90; + reelbackFade = 6; + lungeTime = 25; + driftSpeed = 3f; + driftBoost = 2f; } if (CalamityWorld.death || CalamityWorld.bossRushActive) { - lungeRots = 0.4; - minimumDriftTime = 60; + lungeRots = 0.4; + minimumDriftTime = 60; reelbackFade = 7; - //decelerationTime = 20; - //lungeFade = 6; - //lungeDelay = 120; lungeTime = 20; driftSpeed = 4f; driftBoost = 1f; @@ -115,40 +118,40 @@ namespace CalamityMod.NPCs.HiveMind rotationIncrement = 0.0246399424 * lungeRots * lungeFade; } - public override void SendExtraAI(BinaryWriter writer) - { - writer.Write(state); - writer.Write(nextState); - writer.Write(phase2timer); - writer.Write(dashStarted); - writer.Write(rotationDirection); - writer.Write(rotation); - writer.Write(previousState); - writer.Write(reelCount); - } + public override void SendExtraAI(BinaryWriter writer) + { + writer.Write(state); + writer.Write(nextState); + writer.Write(phase2timer); + writer.Write(dashStarted); + writer.Write(rotationDirection); + writer.Write(rotation); + writer.Write(previousState); + writer.Write(reelCount); + } - public override void ReceiveExtraAI(BinaryReader reader) - { - state = reader.ReadInt32(); - nextState = reader.ReadInt32(); - phase2timer = reader.ReadInt32(); - dashStarted = reader.ReadBoolean(); - rotationDirection = reader.ReadInt32(); - rotation = reader.ReadDouble(); - previousState = reader.ReadInt32(); - reelCount = reader.ReadInt32(); - } + public override void ReceiveExtraAI(BinaryReader reader) + { + state = reader.ReadInt32(); + nextState = reader.ReadInt32(); + phase2timer = reader.ReadInt32(); + dashStarted = reader.ReadBoolean(); + rotationDirection = reader.ReadInt32(); + rotation = reader.ReadDouble(); + previousState = reader.ReadInt32(); + reelCount = reader.ReadInt32(); + } - public override void FindFrame(int frameHeight) - { - npc.frameCounter += 0.15f; - npc.frameCounter %= Main.npcFrameCount[npc.type]; - int frame = (int)npc.frameCounter; - npc.frame.Y = frame * frameHeight; - } + public override void FindFrame(int frameHeight) + { + npc.frameCounter += 0.15f; + npc.frameCounter %= Main.npcFrameCount[npc.type]; + int frame = (int)npc.frameCounter; + npc.frame.Y = frame * frameHeight; + } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { + { SpriteEffects spriteEffects = SpriteEffects.None; Microsoft.Xna.Framework.Color color24 = lightColor; color24 = npc.GetAlpha(color24); @@ -158,25 +161,22 @@ namespace CalamityMod.NPCs.HiveMind int y3 = num156 * (int)npc.frameCounter; Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle(0, y3, texture2D3.Width, num156); Vector2 origin2 = rectangle.Size() / 2f; - int arg_5ADA_0 = npc.type; - int arg_5AE7_0 = npc.type; - int arg_5AF4_0 = npc.type; int num157 = 8; int num158 = 2; int num159 = 1; float num160 = 0f; int num161 = num159; - while (state != 0 && ((num158 > 0 && num161 < num157) || (num158 < 0 && num161 > num157))) + while (state != 0 && Lighting.NotRetro && ((num158 > 0 && num161 < num157) || (num158 < 0 && num161 > num157))) { Microsoft.Xna.Framework.Color color26 = color25; - color26 = npc.GetAlpha(color26); + color26 = npc.GetAlpha(color26); { goto IL_6899; } - IL_6881: + IL_6881: num161 += num158; continue; - IL_6899: + IL_6899: float num164 = (float)(num157 - num161); if (num158 < 0) { @@ -194,16 +194,16 @@ namespace CalamityMod.NPCs.HiveMind return false; } - private void SpawnStuff() - { - Player player = Main.player[npc.target]; + private void SpawnStuff() + { + Player player = Main.player[npc.target]; for (int i = 0; i < 5; i++) - { - bool spawnedSomething = false; - int type = NPCID.EaterofSouls; - int maxAmount = 0; - int random = !CalamityWorld.death && Collision.CanHit(npc.Center, 1, 1, player.position, player.width, player.height) ? 5 : 3; - switch (Main.rand.Next(random)) + { + bool spawnedSomething = false; + int type = NPCID.EaterofSouls; + int maxAmount = 0; + int random = !CalamityWorld.death && Collision.CanHit(npc.Center, 1, 1, player.position, player.width, player.height) ? 5 : 3; + switch (Main.rand.Next(random)) { case 0: type = NPCID.DevourerHead; @@ -218,390 +218,390 @@ namespace CalamityMod.NPCs.HiveMind maxAmount = 2; break; case 3: - type = mod.NPCType("HiveBlob2"); - maxAmount = 2; - break; - case 4: + type = mod.NPCType("HiveBlob2"); + maxAmount = 2; + break; + case 4: type = NPCID.EaterofSouls; - maxAmount = 2; - break; - case 5: + maxAmount = 2; + break; + case 5: type = mod.NPCType("DarkHeart"); maxAmount = 2; break; } - int numToSpawn = maxAmount - NPC.CountNPCS(type); - while (numToSpawn > 0) - { - numToSpawn--; - spawnedSomething = true; - int spawn = NPC.NewNPC((int)npc.position.X + Main.rand.Next(npc.width), (int)npc.position.Y + Main.rand.Next(npc.height), type); - Main.npc[spawn].velocity.X = (float)Main.rand.Next(-15, 16) * 0.1f; - Main.npc[spawn].velocity.Y = (float)Main.rand.Next(-30, 1) * 0.1f; - } - if (spawnedSomething) + int numToSpawn = maxAmount - NPC.CountNPCS(type); + while (numToSpawn > 0) + { + numToSpawn--; + spawnedSomething = true; + int spawn = NPC.NewNPC((int)npc.position.X + Main.rand.Next(npc.width), (int)npc.position.Y + Main.rand.Next(npc.height), type); + Main.npc[spawn].velocity.X = (float)Main.rand.Next(-15, 16) * 0.1f; + Main.npc[spawn].velocity.Y = (float)Main.rand.Next(-30, 1) * 0.1f; + } + if (spawnedSomething) return; - } - } + } + } - private void ReelBack() - { - npc.alpha = 0; - phase2timer = 0; - deceleration = npc.velocity / 255f * reelbackFade; - if (CalamityWorld.death) - { - state = 2; - Main.PlaySound(36, (int)npc.Center.X, (int)npc.Center.Y, -1, 1f, 0f); - } - else - { - if (Main.netMode != 1) - SpawnStuff(); - state = nextState; - nextState = 0; - if (state == 2) - { - Main.PlaySound(15, (int)npc.Center.X, (int)npc.Center.Y, 0); - } - else - { - Main.PlaySound(36, (int)npc.Center.X, (int)npc.Center.Y, -1, 1f, 0f); - } - } - } + private void ReelBack() + { + npc.alpha = 0; + phase2timer = 0; + deceleration = npc.velocity / 255f * reelbackFade; + if (CalamityWorld.death) + { + state = 2; + Main.PlaySound(36, (int)npc.Center.X, (int)npc.Center.Y, -1, 1f, 0f); + } + else + { + if (Main.netMode != 1) + SpawnStuff(); + state = nextState; + nextState = 0; + if (state == 2) + { + Main.PlaySound(15, (int)npc.Center.X, (int)npc.Center.Y, 0); + } + else + { + Main.PlaySound(36, (int)npc.Center.X, (int)npc.Center.Y, -1, 1f, 0f); + } + } + } public override void AI() { Player player = Main.player[npc.target]; npc.defense = (player.ZoneCorrupt || CalamityWorld.bossRushActive) ? 5 : 9999; CalamityGlobalNPC.hiveMind2 = npc.whoAmI; - if (npc.alpha != 0) - { - if (npc.damage != 0) - { - oldDamage = npc.damage; - npc.damage = 0; - } - } - else - { - npc.damage = oldDamage; - } - switch (state) - { - case 0: //slowdrift - if (npc.alpha > 0) - npc.alpha -= 3; - if (nextState == 0) - { - npc.TargetClosest(true); - if (CalamityWorld.death || CalamityWorld.bossRushActive) - { - do nextState = Main.rand.Next(3, 6); - while (nextState == previousState); - previousState = nextState; - } - else - { - if (CalamityWorld.revenge && (Main.rand.Next(4) == 0 || reelCount == 3)) - { - reelCount = 0; - nextState = 2; - } - else - { - reelCount++; - nextState = 1; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - } - } - if (nextState == 3) - rotation = MathHelper.ToRadians(Main.rand.Next(360)); - npc.netUpdate = true; - } - if (!player.active || player.dead || Vector2.Distance(npc.Center, player.Center) > 5000f) - { - npc.TargetClosest(true); - if (npc.timeLeft > 60) - npc.timeLeft = 60; - if (npc.localAI[3] < 120f) - { - float[] aiArray = npc.localAI; - int number = 3; - float num244 = aiArray[number]; - aiArray[number] = num244 + 1f; - } - if (npc.localAI[3] > 60f) - { - npc.velocity.Y = npc.velocity.Y + (npc.localAI[3] - 60f) * 0.5f; - } - return; - } - if (npc.localAI[3] > 0f) - { - float[] aiArray = npc.localAI; - int number = 3; - float num244 = aiArray[number]; - aiArray[number] = num244 - 1f; - return; - } - npc.velocity = player.Center - npc.Center; - phase2timer--; - if (phase2timer <= -180) //no stalling drift mode forever - { - npc.velocity *= 2f / 255f * reelbackFade; - ReelBack(); - npc.netUpdate = true; - } - else - { - npc.velocity.Normalize(); - if (Main.expertMode || CalamityWorld.bossRushActive) //variable velocity in expert and up - { - npc.velocity *= driftSpeed + driftBoost * (npc.lifeMax - npc.life) / npc.lifeMax; - } - else - { - npc.velocity *= driftSpeed; - } - } - break; - case 1: //reelback and teleport - npc.alpha += reelbackFade; - npc.velocity -= deceleration; - if (npc.alpha >= 255) - { - npc.alpha = 255; - npc.velocity = Vector2.Zero; - state = 0; - if (Main.netMode != 1 && npc.ai[1] != 0f && npc.ai[2] != 0f) - { - npc.position.X = npc.ai[1] * 16 - npc.width / 2; - npc.position.Y = npc.ai[2] * 16 - npc.height / 2; - } - phase2timer = minimumDriftTime + Main.rand.Next(121); - npc.netUpdate = true; - } - else if (npc.ai[1] == 0f && npc.ai[2] == 0f) - { - for (int i = 0; i < 10; i++) - { - int posX = (int)player.Center.X / 16 + Main.rand.Next(15, 46) * (Main.rand.Next(2) == 0 ? -1 : 1); - int posY = (int)player.Center.Y / 16 + Main.rand.Next(15, 46) * (Main.rand.Next(2) == 0 ? -1 : 1); - if (!WorldGen.SolidTile(posX, posY) && Collision.CanHit(new Vector2(posX * 16, posY * 16), 1, 1, player.position, player.width, player.height)) - { - npc.ai[1] = posX; - npc.ai[2] = posY; - npc.netUpdate = true; - break; - } - } - } - break; - case 2: //reelback for lunge + death legacy - npc.alpha += reelbackFade; - npc.velocity -= deceleration; - if (npc.alpha >= 255) - { - npc.alpha = 255; - npc.velocity = Vector2.Zero; - dashStarted = false; - if (CalamityWorld.death || CalamityWorld.bossRushActive) - { - state = nextState; - nextState = 0; - previousState = state; - } - else - { - state = 3; - } - if (player.velocity.X > 0) - rotationDirection = 1; - else if (player.velocity.X < 0) - rotationDirection = -1; - else - rotationDirection = player.direction; - } - break; - case 3: //rev lunge - npc.netUpdate = true; - if (npc.alpha > 0) - { - npc.alpha -= lungeFade; - if (Main.netMode != 1) - { - npc.Center = player.Center + new Vector2(teleportRadius, 0).RotatedBy(rotation); - } - rotation += rotationIncrement * rotationDirection; - phase2timer = lungeDelay; - } - else - { - phase2timer--; - if (!dashStarted) - { - if (phase2timer <= 0) - { - phase2timer = lungeTime; - npc.velocity = player.Center - npc.Center; - npc.velocity.Normalize(); - npc.velocity *= teleportRadius / lungeTime; - dashStarted = true; - Main.PlaySound(15, (int)npc.Center.X, (int)npc.Center.Y, 0); - } - else - { - if (Main.netMode != 1) - { - npc.Center = player.Center + new Vector2(teleportRadius, 0).RotatedBy(rotation); - } - rotation += rotationIncrement * rotationDirection * phase2timer / lungeDelay; - } - } - else - { - if (phase2timer <= 0) - { - state = 6; - phase2timer = 0; - deceleration = npc.velocity / decelerationTime; - } - } - } - break; - case 4: //enemy spawn arc (death mode) - if (npc.alpha > 0) - { - npc.alpha -= 5; - if (Main.netMode != 1) - { - npc.Center = player.Center; - npc.position.Y += teleportRadius; - } - npc.netUpdate = true; - } - else - { - if (!dashStarted) - { - dashStarted = true; - Main.PlaySound(15, (int)npc.Center.X, (int)npc.Center.Y, 0); - npc.velocity.X = 3.14159265f * teleportRadius / arcTime; - npc.velocity *= rotationDirection; - npc.netUpdate = true; - } - else - { - npc.velocity = npc.velocity.RotatedBy(3.14159265 / arcTime * -rotationDirection); - phase2timer++; - if (phase2timer == (int)arcTime / 6) - { - phase2timer = 0; - npc.ai[0]++; - if (Main.netMode != 1 && Collision.CanHit(npc.Center, 1, 1, player.position, player.width, player.height)) //draw line of sight - { - if (npc.ai[0] == 2 || npc.ai[0] == 4) - { - if ((Main.expertMode || CalamityWorld.bossRushActive) && NPC.CountNPCS(mod.NPCType("DarkHeart")) < 2) - { - NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("DarkHeart")); - } - } - else if (NPC.CountNPCS(NPCID.EaterofSouls) < 2) - { - NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, NPCID.EaterofSouls); - } - } - if (npc.ai[0] == 6) - { - npc.velocity = npc.velocity.RotatedBy(3.14159265 / arcTime * -rotationDirection); - SpawnStuff(); - state = 6; - npc.ai[0] = 0; - deceleration = npc.velocity / decelerationTime; - } - } - } - } - break; - case 5: //raindash (death mode) - if (npc.alpha > 0) - { - npc.alpha -= 5; - if (Main.netMode != 1) - { - npc.Center = player.Center; - npc.position.Y -= teleportRadius; - npc.position.X += teleportRadius * rotationDirection; - } - npc.netUpdate = true; - } - else - { - if (!dashStarted) - { - dashStarted = true; - Main.PlaySound(15, (int)npc.Center.X, (int)npc.Center.Y, 0); - npc.velocity.X = teleportRadius / arcTime * 3; - npc.velocity *= -rotationDirection; - npc.netUpdate = true; - } - else - { - phase2timer++; - if (phase2timer == (int)arcTime / 20) - { - phase2timer = 0; - npc.ai[0]++; - if (Main.netMode != 1) - { - int damage = Main.expertMode ? 14 : 18; - Projectile.NewProjectile(npc.position.X + Main.rand.Next(npc.width), npc.position.Y + Main.rand.Next(npc.height), 0, 0, mod.ProjectileType("ShadeNimbusHostile"), damage, 0, Main.myPlayer, 11, 0); - } - if (npc.ai[0] == 10) - { - state = 6; - npc.ai[0] = 0; - deceleration = npc.velocity / decelerationTime; - } - } - } - } - break; - case 6: //deceleration - npc.velocity -= deceleration; - phase2timer++; - if (phase2timer == decelerationTime) - { - phase2timer = minimumDriftTime + Main.rand.Next(121); - state = 0; - npc.netUpdate = true; - } - break; - } - } + if (npc.alpha != 0) + { + if (npc.damage != 0) + { + oldDamage = npc.damage; + npc.damage = 0; + } + } + else + { + npc.damage = oldDamage; + } + switch (state) + { + case 0: //slowdrift + if (npc.alpha > 0) + npc.alpha -= 3; + if (nextState == 0) + { + npc.TargetClosest(true); + if (CalamityWorld.death || CalamityWorld.bossRushActive) + { + do nextState = Main.rand.Next(3, 6); + while (nextState == previousState); + previousState = nextState; + } + else + { + if (CalamityWorld.revenge && (Main.rand.Next(4) == 0 || reelCount == 3)) + { + reelCount = 0; + nextState = 2; + } + else + { + reelCount++; + nextState = 1; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + } + } + if (nextState == 3) + rotation = MathHelper.ToRadians(Main.rand.Next(360)); + npc.netUpdate = true; + } + if (!player.active || player.dead || Vector2.Distance(npc.Center, player.Center) > 5000f) + { + npc.TargetClosest(true); + if (npc.timeLeft > 60) + npc.timeLeft = 60; + if (npc.localAI[3] < 120f) + { + float[] aiArray = npc.localAI; + int number = 3; + float num244 = aiArray[number]; + aiArray[number] = num244 + 1f; + } + if (npc.localAI[3] > 60f) + { + npc.velocity.Y = npc.velocity.Y + (npc.localAI[3] - 60f) * 0.5f; + } + return; + } + if (npc.localAI[3] > 0f) + { + float[] aiArray = npc.localAI; + int number = 3; + float num244 = aiArray[number]; + aiArray[number] = num244 - 1f; + return; + } + npc.velocity = player.Center - npc.Center; + phase2timer--; + if (phase2timer <= -180) //no stalling drift mode forever + { + npc.velocity *= 2f / 255f * reelbackFade; + ReelBack(); + npc.netUpdate = true; + } + else + { + npc.velocity.Normalize(); + if (Main.expertMode || CalamityWorld.bossRushActive) //variable velocity in expert and up + { + npc.velocity *= driftSpeed + driftBoost * (npc.lifeMax - npc.life) / npc.lifeMax; + } + else + { + npc.velocity *= driftSpeed; + } + } + break; + case 1: //reelback and teleport + npc.alpha += reelbackFade; + npc.velocity -= deceleration; + if (npc.alpha >= 255) + { + npc.alpha = 255; + npc.velocity = Vector2.Zero; + state = 0; + if (Main.netMode != 1 && npc.ai[1] != 0f && npc.ai[2] != 0f) + { + npc.position.X = npc.ai[1] * 16 - npc.width / 2; + npc.position.Y = npc.ai[2] * 16 - npc.height / 2; + } + phase2timer = minimumDriftTime + Main.rand.Next(121); + npc.netUpdate = true; + } + else if (npc.ai[1] == 0f && npc.ai[2] == 0f) + { + for (int i = 0; i < 10; i++) + { + int posX = (int)player.Center.X / 16 + Main.rand.Next(15, 46) * (Main.rand.Next(2) == 0 ? -1 : 1); + int posY = (int)player.Center.Y / 16 + Main.rand.Next(15, 46) * (Main.rand.Next(2) == 0 ? -1 : 1); + if (!WorldGen.SolidTile(posX, posY) && Collision.CanHit(new Vector2(posX * 16, posY * 16), 1, 1, player.position, player.width, player.height)) + { + npc.ai[1] = posX; + npc.ai[2] = posY; + npc.netUpdate = true; + break; + } + } + } + break; + case 2: //reelback for lunge + death legacy + npc.alpha += reelbackFade; + npc.velocity -= deceleration; + if (npc.alpha >= 255) + { + npc.alpha = 255; + npc.velocity = Vector2.Zero; + dashStarted = false; + if (CalamityWorld.death || CalamityWorld.bossRushActive) + { + state = nextState; + nextState = 0; + previousState = state; + } + else + { + state = 3; + } + if (player.velocity.X > 0) + rotationDirection = 1; + else if (player.velocity.X < 0) + rotationDirection = -1; + else + rotationDirection = player.direction; + } + break; + case 3: //rev lunge + npc.netUpdate = true; + if (npc.alpha > 0) + { + npc.alpha -= lungeFade; + if (Main.netMode != 1) + { + npc.Center = player.Center + new Vector2(teleportRadius, 0).RotatedBy(rotation); + } + rotation += rotationIncrement * rotationDirection; + phase2timer = lungeDelay; + } + else + { + phase2timer--; + if (!dashStarted) + { + if (phase2timer <= 0) + { + phase2timer = lungeTime; + npc.velocity = player.Center - npc.Center; + npc.velocity.Normalize(); + npc.velocity *= teleportRadius / lungeTime; + dashStarted = true; + Main.PlaySound(15, (int)npc.Center.X, (int)npc.Center.Y, 0); + } + else + { + if (Main.netMode != 1) + { + npc.Center = player.Center + new Vector2(teleportRadius, 0).RotatedBy(rotation); + } + rotation += rotationIncrement * rotationDirection * phase2timer / lungeDelay; + } + } + else + { + if (phase2timer <= 0) + { + state = 6; + phase2timer = 0; + deceleration = npc.velocity / decelerationTime; + } + } + } + break; + case 4: //enemy spawn arc (death mode) + if (npc.alpha > 0) + { + npc.alpha -= 5; + if (Main.netMode != 1) + { + npc.Center = player.Center; + npc.position.Y += teleportRadius; + } + npc.netUpdate = true; + } + else + { + if (!dashStarted) + { + dashStarted = true; + Main.PlaySound(15, (int)npc.Center.X, (int)npc.Center.Y, 0); + npc.velocity.X = 3.14159265f * teleportRadius / arcTime; + npc.velocity *= rotationDirection; + npc.netUpdate = true; + } + else + { + npc.velocity = npc.velocity.RotatedBy(3.14159265 / arcTime * -rotationDirection); + phase2timer++; + if (phase2timer == (int)arcTime / 6) + { + phase2timer = 0; + npc.ai[0]++; + if (Main.netMode != 1 && Collision.CanHit(npc.Center, 1, 1, player.position, player.width, player.height)) //draw line of sight + { + if (npc.ai[0] == 2 || npc.ai[0] == 4) + { + if ((Main.expertMode || CalamityWorld.bossRushActive) && NPC.CountNPCS(mod.NPCType("DarkHeart")) < 2) + { + NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("DarkHeart")); + } + } + else if (NPC.CountNPCS(NPCID.EaterofSouls) < 2) + { + NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, NPCID.EaterofSouls); + } + } + if (npc.ai[0] == 6) + { + npc.velocity = npc.velocity.RotatedBy(3.14159265 / arcTime * -rotationDirection); + SpawnStuff(); + state = 6; + npc.ai[0] = 0; + deceleration = npc.velocity / decelerationTime; + } + } + } + } + break; + case 5: //raindash (death mode) + if (npc.alpha > 0) + { + npc.alpha -= 5; + if (Main.netMode != 1) + { + npc.Center = player.Center; + npc.position.Y -= teleportRadius; + npc.position.X += teleportRadius * rotationDirection; + } + npc.netUpdate = true; + } + else + { + if (!dashStarted) + { + dashStarted = true; + Main.PlaySound(15, (int)npc.Center.X, (int)npc.Center.Y, 0); + npc.velocity.X = teleportRadius / arcTime * 3; + npc.velocity *= -rotationDirection; + npc.netUpdate = true; + } + else + { + phase2timer++; + if (phase2timer == (int)arcTime / 20) + { + phase2timer = 0; + npc.ai[0]++; + if (Main.netMode != 1) + { + int damage = Main.expertMode ? 14 : 18; + Projectile.NewProjectile(npc.position.X + Main.rand.Next(npc.width), npc.position.Y + Main.rand.Next(npc.height), 0, 0, mod.ProjectileType("ShadeNimbusHostile"), damage, 0, Main.myPlayer, 11, 0); + } + if (npc.ai[0] == 10) + { + state = 6; + npc.ai[0] = 0; + deceleration = npc.velocity / decelerationTime; + } + } + } + } + break; + case 6: //deceleration + npc.velocity -= deceleration; + phase2timer++; + if (phase2timer == decelerationTime) + { + phase2timer = minimumDriftTime + Main.rand.Next(121); + state = 0; + npc.netUpdate = true; + } + break; + } + } - public override bool? CanHitNPC (NPC target) + public override bool? CanHitNPC(NPC target) { if (npc.alpha > 0) return false; return null; } - public override bool CanHitPlayer (Player target, ref int cooldownSlot) + public override bool CanHitPlayer(Player target, ref int cooldownSlot) { return npc.alpha <= 0; //no damage when not fully visible } - public override bool StrikeNPC (ref double damage, int defense, ref float knockback, int hitDirection, ref bool crit) + public override bool StrikeNPC(ref double damage, int defense, ref float knockback, int hitDirection, ref bool crit) { if (phase2timer < 0 && damage > 1) { - npc.velocity *= -4f; - ReelBack(); + npc.velocity *= -4f; + ReelBack(); npc.netUpdate = true; } return true; @@ -619,13 +619,19 @@ namespace CalamityMod.NPCs.HiveMind { Dust.NewDust(npc.position, npc.width, npc.height, 14, hitDirection, -1f, 0, default(Color), 1f); } - if (Main.netMode != 1 && Main.rand.Next(15) == 0 && NPC.CountNPCS(mod.NPCType("HiveBlob2")) < 2) - { - Vector2 spawnAt = npc.Center + new Vector2(0f, (float)npc.height / 2f); - NPC.NewNPC((int)spawnAt.X, (int)spawnAt.Y, mod.NPCType("HiveBlob2")); - } - if (npc.life <= 0) + if (Main.netMode != 1 && Main.rand.Next(15) == 0 && NPC.CountNPCS(mod.NPCType("HiveBlob2")) < 2) { + Vector2 spawnAt = npc.Center + new Vector2(0f, (float)npc.height / 2f); + NPC.NewNPC((int)spawnAt.X, (int)spawnAt.Y, mod.NPCType("HiveBlob2")); + } + if (npc.life <= 0) + { + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HiveMindGores/HiveMindP2Gore"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HiveMindGores/HiveMindP2Gore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HiveMindGores/HiveMindP2Gore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HiveMindGores/HiveMindP2Gore4"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HiveMindGores/HiveMindP2Gore5"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HiveMindGores/HiveMindP2Gore6"), 1f); npc.position.X = npc.position.X + (float)(npc.width / 2); npc.position.Y = npc.position.Y + (float)(npc.height / 2); npc.width = 200; @@ -653,25 +659,25 @@ namespace CalamityMod.NPCs.HiveMind } } - public override void BossLoot(ref string name, ref int potionType) - { - potionType = ItemID.HealingPotion; - } + public override void BossLoot(ref string name, ref int potionType) + { + potionType = ItemID.HealingPotion; + } - public override void NPCLoot() + public override void NPCLoot() { if (Main.rand.Next(10) == 0) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("HiveMindTrophy")); } - if (CalamityWorld.armageddon) - { - for (int i = 0; i < 10; i++) - { - npc.DropBossBags(); - } - } - if (Main.expertMode) + if (CalamityWorld.armageddon) + { + for (int i = 0; i < 5; i++) + { + npc.DropBossBags(); + } + } + if (Main.expertMode) { npc.DropBossBags(); } @@ -712,13 +718,13 @@ namespace CalamityMod.NPCs.HiveMind Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TrueShadowScale"), Main.rand.Next(25, 31)); Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.DemoniteBar, Main.rand.Next(7, 11)); Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.RottenChunk, Main.rand.Next(9, 16)); - if (Main.hardMode) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.CursedFlame, Main.rand.Next(10, 21)); - } - } + if (Main.hardMode) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.CursedFlame, Main.rand.Next(10, 21)); + } + } } - + public override void OnHitPlayer(Player player, int damage, bool crit) { if (CalamityWorld.revenge) diff --git a/NPCs/Leviathan/AquaticAberration.cs b/NPCs/Leviathan/AquaticAberration.cs index da3dc57b4a..ca0703405c 100644 --- a/NPCs/Leviathan/AquaticAberration.cs +++ b/NPCs/Leviathan/AquaticAberration.cs @@ -33,9 +33,12 @@ namespace CalamityMod.NPCs.Leviathan npc.knockBackResist = 0f; npc.noGravity = true; npc.noTileCollide = true; + npc.canGhostHeal = false; aiType = -1; npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; + banner = npc.type; + bannerItem = mod.ItemType("AquaticAberrationBanner"); } public override void FindFrame(int frameHeight) diff --git a/NPCs/Leviathan/Leviathan.cs b/NPCs/Leviathan/Leviathan.cs index 6bb3c59ee1..b732df30e8 100644 --- a/NPCs/Leviathan/Leviathan.cs +++ b/NPCs/Leviathan/Leviathan.cs @@ -12,13 +12,13 @@ namespace CalamityMod.NPCs.Leviathan { [AutoloadBossHead] public class Leviathan : ModNPC - { + { public override void SetStaticDefaults() { DisplayName.SetDefault("The Leviathan"); Main.npcFrameCount[npc.type] = 3; } - + public override void SetDefaults() { npc.npcSlots = 20f; @@ -26,50 +26,50 @@ namespace CalamityMod.NPCs.Leviathan npc.width = 850; npc.height = 450; npc.defense = 40; - npc.lifeMax = CalamityWorld.revenge ? 78900 : 60000; - if (CalamityWorld.death) - { - npc.lifeMax = 165000; - } - if (CalamityWorld.bossRushActive) - { - npc.lifeMax = CalamityWorld.death ? 8200000 : 7300000; - } - npc.knockBackResist = 0f; + npc.lifeMax = CalamityWorld.revenge ? 90700 : 69000; + if (CalamityWorld.death) + { + npc.lifeMax = 189750; + } + if (CalamityWorld.bossRushActive) + { + npc.lifeMax = CalamityWorld.death ? 8000000 : 7000000; + } + npc.knockBackResist = 0f; npc.aiStyle = -1; aiType = -1; - npc.value = Item.buyPrice(0, 15, 0, 0); - for (int k = 0; k < npc.buffImmune.Length; k++) + npc.value = Item.buyPrice(0, 15, 0, 0); + for (int k = 0; k < npc.buffImmune.Length; k++) { - npc.buffImmune[k] = true; - npc.buffImmune[BuffID.Ichor] = false; - npc.buffImmune[BuffID.CursedInferno] = false; - npc.buffImmune[BuffID.Daybreak] = false; - npc.buffImmune[mod.BuffType("AbyssalFlames")] = false; - npc.buffImmune[mod.BuffType("ArmorCrunch")] = false; - npc.buffImmune[mod.BuffType("DemonFlames")] = false; - npc.buffImmune[mod.BuffType("GodSlayerInferno")] = false; - npc.buffImmune[mod.BuffType("HolyLight")] = false; - npc.buffImmune[mod.BuffType("Nightwither")] = false; - npc.buffImmune[mod.BuffType("Plague")] = false; - npc.buffImmune[mod.BuffType("Shred")] = false; - npc.buffImmune[mod.BuffType("WhisperingDeath")] = false; - npc.buffImmune[mod.BuffType("SilvaStun")] = false; - } + npc.buffImmune[k] = true; + npc.buffImmune[BuffID.Ichor] = false; + npc.buffImmune[BuffID.CursedInferno] = false; + npc.buffImmune[BuffID.Daybreak] = false; + npc.buffImmune[mod.BuffType("AbyssalFlames")] = false; + npc.buffImmune[mod.BuffType("ArmorCrunch")] = false; + npc.buffImmune[mod.BuffType("DemonFlames")] = false; + npc.buffImmune[mod.BuffType("GodSlayerInferno")] = false; + npc.buffImmune[mod.BuffType("HolyLight")] = false; + npc.buffImmune[mod.BuffType("Nightwither")] = false; + npc.buffImmune[mod.BuffType("Plague")] = false; + npc.buffImmune[mod.BuffType("Shred")] = false; + npc.buffImmune[mod.BuffType("WhisperingDeath")] = false; + npc.buffImmune[mod.BuffType("SilvaStun")] = false; + } npc.HitSound = SoundID.NPCHit56; npc.DeathSound = SoundID.NPCDeath60; npc.noTileCollide = true; npc.noGravity = true; npc.boss = true; npc.netAlways = true; - Mod calamityModMusic = ModLoader.GetMod("CalamityModMusic"); - if (calamityModMusic != null) - music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/LeviathanAndSiren"); - else - music = MusicID.Boss3; + Mod calamityModMusic = ModLoader.GetMod("CalamityModMusic"); + if (calamityModMusic != null) + music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/LeviathanAndSiren"); + else + music = MusicID.Boss3; bossBag = mod.ItemType("LeviathanBag"); } - + public override void AI() { bool revenge = (CalamityWorld.revenge || CalamityWorld.bossRushActive); @@ -99,18 +99,18 @@ namespace CalamityMod.NPCs.Leviathan } if (Main.rand.Next(600) == 0) { - Main.PlaySound(29, (int)npc.position.X, (int)npc.position.Y, - ((sirenAlive && !CalamityWorld.death && !CalamityWorld.bossRushActive) ? soundChoice : soundChoiceRage)); + Main.PlaySound(29, (int)npc.position.X, (int)npc.position.Y, + ((sirenAlive && !CalamityWorld.death && !CalamityWorld.bossRushActive) ? soundChoice : soundChoiceRage)); } bool flag6 = player.position.Y < 800f || (double)player.position.Y > Main.worldSurface * 16.0 || (player.position.X > 6400f && player.position.X < (float)(Main.maxTilesX * 16 - 6400)); if (flag6 || !sirenAlive || CalamityWorld.death) { npc.defense = npc.defDefense * 2; } - else - { - npc.defense = 40; - } + else + { + npc.defense = 40; + } npc.dontTakeDamage = flag6 && !CalamityWorld.bossRushActive; int num1038 = 0; for (int num1039 = 0; num1039 < 255; num1039++) @@ -124,11 +124,11 @@ namespace CalamityMod.NPCs.Leviathan { npc.TargetClosest(true); } - if (npc.timeLeft < 3000) - { - npc.timeLeft = 3000; - } - if (!player.active || player.dead || Vector2.Distance(player.Center, vector) > 5600f) + if (npc.timeLeft < 3000) + { + npc.timeLeft = 3000; + } + if (!player.active || player.dead || Vector2.Distance(player.Center, vector) > 5600f) { npc.TargetClosest(false); player = Main.player[npc.target]; @@ -137,17 +137,17 @@ namespace CalamityMod.NPCs.Leviathan npc.velocity = new Vector2(0f, 10f); if ((double)npc.position.Y > Main.rockLayer * 16.0) { - for (int x = 0; x < 200; x++) - { - if (Main.npc[x].type == mod.NPCType("Siren")) - { - Main.npc[x].active = false; - Main.npc[x].netUpdate = true; - } - } - npc.active = false; - npc.netUpdate = true; - } + for (int x = 0; x < 200; x++) + { + if (Main.npc[x].type == mod.NPCType("Siren")) + { + Main.npc[x].active = false; + Main.npc[x].netUpdate = true; + } + } + npc.active = false; + npc.netUpdate = true; + } return; } } @@ -158,13 +158,13 @@ namespace CalamityMod.NPCs.Leviathan npc.TargetClosest(true); float num412 = sirenAlive ? 3.5f : 7f; float num413 = sirenAlive ? 0.1f : 0.2f; - if (CalamityWorld.bossRushActive) - { - num412 = 12f; - num413 = 0.4f; - } + if (CalamityWorld.bossRushActive) + { + num412 = 12f; + num413 = 0.4f; + } int num414 = 1; - if (npc.position.X + (float)(npc.width / 2) < player.position.X + (float)player.width) + if (npc.position.X + (float)(npc.width / 2) < player.position.X + (float)player.width) { num414 = -1; } @@ -175,78 +175,78 @@ namespace CalamityMod.NPCs.Leviathan num417 = num412 / num417; num415 *= num417; num416 *= num417; - if (npc.velocity.X < num415) + if (npc.velocity.X < num415) { npc.velocity.X = npc.velocity.X + num413; - if (npc.velocity.X < 0f && num415 > 0f) + if (npc.velocity.X < 0f && num415 > 0f) { npc.velocity.X = npc.velocity.X + num413; } - } - else if (npc.velocity.X > num415) + } + else if (npc.velocity.X > num415) { npc.velocity.X = npc.velocity.X - num413; - if (npc.velocity.X > 0f && num415 < 0f) + if (npc.velocity.X > 0f && num415 < 0f) { npc.velocity.X = npc.velocity.X - num413; } } - if (npc.velocity.Y < num416) + if (npc.velocity.Y < num416) { npc.velocity.Y = npc.velocity.Y + num413; - if (npc.velocity.Y < 0f && num416 > 0f) + if (npc.velocity.Y < 0f && num416 > 0f) { npc.velocity.Y = npc.velocity.Y + num413; } - } - else if (npc.velocity.Y > num416) + } + else if (npc.velocity.Y > num416) { npc.velocity.Y = npc.velocity.Y - num413; - if (npc.velocity.Y > 0f && num416 < 0f) + if (npc.velocity.Y > 0f && num416 < 0f) { npc.velocity.Y = npc.velocity.Y - num413; } } npc.ai[1] += 1f; - if (npc.ai[1] >= ((CalamityWorld.death || CalamityWorld.bossRushActive) ? 120f : 240f)) + if (npc.ai[1] >= ((CalamityWorld.death || CalamityWorld.bossRushActive) ? 120f : 240f)) { npc.ai[0] = 1f; npc.ai[1] = 0f; npc.ai[2] = 0f; npc.target = 255; npc.netUpdate = true; - } - else + } + else { - if (!player.dead) + if (!player.dead) { npc.ai[2] += 1f; - if (!sirenAlive) + if (!sirenAlive) { npc.ai[2] += 2f; } else { - if (sirenAlive) - { - if (Siren.phase2) - { - npc.ai[2] += 0.5f; - } - if (Siren.phase3) - { - npc.ai[2] += 0.5f; - } - } + if (sirenAlive) + { + if (Siren.phase2) + { + npc.ai[2] += 0.5f; + } + if (Siren.phase3) + { + npc.ai[2] += 0.5f; + } + } } } - if (npc.ai[2] >= 90f) + if (npc.ai[2] >= 90f) { npc.ai[2] = 0f; vector40 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); num415 = player.position.X + (float)(player.width / 2) - vector40.X; num416 = player.position.Y + (float)(player.height / 2) - vector40.Y; - if (Main.netMode != 1) + if (Main.netMode != 1) { float num418 = sirenAlive ? 13.5f : 16f; int num419 = 48; @@ -256,10 +256,10 @@ namespace CalamityMod.NPCs.Leviathan num418 = sirenAlive ? 14f : 17f; num419 = 33; } - if (npc.GetGlobalNPC(mod).enraged) - { - num418 = 22f; - } + if (npc.GetGlobalNPC(mod).enraged) + { + num418 = 22f; + } num417 = (float)Math.Sqrt((double)(num415 * num415 + num416 * num416)); num417 = num418 / num417; num415 *= num417; @@ -317,9 +317,9 @@ namespace CalamityMod.NPCs.Leviathan if (Main.netMode != 1 && NPC.CountNPCS(mod.NPCType("Parasea")) < spawnLimit2 && NPC.CountNPCS(mod.NPCType("AquaticAberration")) < spawnLimit) { int num1061; - int value = CalamityWorld.death ? 2 : 3; - if (CalamityWorld.bossRushActive) - value++; + int value = CalamityWorld.death ? 2 : 3; + if (CalamityWorld.bossRushActive) + value++; if (Main.rand.Next(value) == 0) { num1061 = mod.NPCType("AquaticAberration"); @@ -338,12 +338,12 @@ namespace CalamityMod.NPCs.Leviathan { float num1063 = sirenAlive ? 7f : 8f; //changed from 14 not a prob float num1064 = sirenAlive ? 0.05f : 0.065f; //changed from 0.1 not a prob - if (CalamityWorld.bossRushActive) - { - num1063 = 10f; - num1064 = 0.075f; - } - vector120 = vector119; + if (CalamityWorld.bossRushActive) + { + num1063 = 10f; + num1064 = 0.075f; + } + vector120 = vector119; num1058 = player.position.X + (float)(player.width / 2) - vector120.X; num1059 = player.position.Y + (float)(player.height / 2) - vector120.Y; num1060 = (float)Math.Sqrt((double)(num1058 * num1058 + num1059 * num1059)); @@ -395,170 +395,170 @@ namespace CalamityMod.NPCs.Leviathan return; } } - else if (npc.ai[0] == 2f) - { - Vector2 distFromPlayer = Main.player[npc.target].Center - npc.Center; - if (npc.ai[1] > 1f || distFromPlayer.Length() > 2400f) - { - npc.ai[0] = 0f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.netUpdate = true; - return; - } - if (npc.ai[1] % 2f == 0f) - { - int num24 = 7; - for (int j = 0; j < num24; j++) - { - Vector2 arg_E1C_0 = (Vector2.Normalize(npc.velocity) * new Vector2((float)(npc.width + 50) / 2f, (float)npc.height) * 0.75f).RotatedBy((double)(j - (num24 / 2 - 1)) * 3.1415926535897931 / (double)((float)num24), default(Vector2)) + vector; - Vector2 vector4 = ((float)(Main.rand.NextDouble() * 3.1415927410125732) - 1.57079637f).ToRotationVector2() * (float)Main.rand.Next(3, 8); - int num25 = Dust.NewDust(arg_E1C_0 + vector4, 0, 0, 172, vector4.X * 2f, vector4.Y * 2f, 100, default(Color), 1.4f); - Main.dust[num25].noGravity = true; - Main.dust[num25].noLight = true; - Main.dust[num25].velocity /= 4f; - Main.dust[num25].velocity -= npc.velocity; - } - npc.TargetClosest(true); - if (Math.Abs(npc.position.Y + (float)(npc.height / 2) - (Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2))) < 20f) - { - npc.localAI[1] = 1f; - npc.ai[1] += 1f; - npc.ai[2] = 0f; - float num1044 = revenge ? 20f : 18f; //16 - if ((double)npc.life < (double)npc.lifeMax * 0.25) - { - num1044 += 2f; //2 not a prob - } - if ((double)npc.life < (double)npc.lifeMax * 0.1 || CalamityWorld.bossRushActive) - { - num1044 += 2f; //2 not a prob - } - if (npc.GetGlobalNPC(mod).enraged) - { - num1044 += 4f; - } - Vector2 vector117 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num1045 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector117.X; - float num1046 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector117.Y; - float num1047 = (float)Math.Sqrt((double)(num1045 * num1045 + num1046 * num1046)); - num1047 = num1044 / num1047; - npc.velocity.X = num1045 * num1047; - npc.velocity.Y = num1046 * num1047; - npc.spriteDirection = npc.direction; - Main.PlaySound(29, (int)npc.position.X, (int)npc.position.Y, soundChoiceRage); - return; - } - npc.localAI[1] = 0f; - float num1048 = revenge ? 7.5f : 6.5f; //12 not a prob - float num1049 = revenge ? 0.12f : 0.11f; //0.15 not a prob - if ((double)npc.life < (double)npc.lifeMax * 0.25) - { - num1048 += 2f; //2 not a prob - num1049 += 0.05f; //0.05 not a prob - } - if ((double)npc.life < (double)npc.lifeMax * 0.1 || CalamityWorld.bossRushActive) - { - num1048 += 2f; //2 not a prob - num1049 += 0.1f; //0.1 not a prob - } - if (npc.GetGlobalNPC(mod).enraged) - { - num1048 += 3f; - num1049 += 0.2f; - } - if (npc.position.Y + (float)(npc.height / 2) < (Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2))) - { - npc.velocity.Y = npc.velocity.Y + num1049; - } - else - { - npc.velocity.Y = npc.velocity.Y - num1049; - } - if (npc.velocity.Y < -12f) - { - npc.velocity.Y = -num1048; - } - if (npc.velocity.Y > 12f) - { - npc.velocity.Y = num1048; - } - if (Math.Abs(npc.position.X + (float)(npc.width / 2) - (Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2))) > 600f) - { - npc.velocity.X = npc.velocity.X + 0.15f * (float)npc.direction; - } - else if (Math.Abs(npc.position.X + (float)(npc.width / 2) - (Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2))) < 300f) - { - npc.velocity.X = npc.velocity.X - 0.15f * (float)npc.direction; - } - else - { - npc.velocity.X = npc.velocity.X * 0.8f; - } - if (npc.velocity.X < -16f) - { - npc.velocity.X = -16f; - } - if (npc.velocity.X > 16f) - { - npc.velocity.X = 16f; - } - npc.spriteDirection = npc.direction; - return; - } - else - { - if (npc.velocity.X < 0f) - { - npc.direction = -1; - } - else - { - npc.direction = 1; - } - npc.spriteDirection = npc.direction; - int num1050 = sirenAlive ? 1100 : 900; //600 not a prob - int num1051 = 1; - if (npc.position.X + (float)(npc.width / 2) < Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2)) - { - num1051 = -1; - } - if (npc.direction == num1051 && Math.Abs(npc.position.X + (float)(npc.width / 2) - (Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2))) > (float)num1050) - { - npc.ai[2] = 1f; - } - if (npc.ai[2] != 1f) - { - npc.localAI[1] = 1f; - return; - } - npc.TargetClosest(true); - npc.spriteDirection = npc.direction; - npc.localAI[1] = 0f; - npc.velocity *= 0.9f; - float num1052 = revenge ? 0.11f : 0.1f; //0.1 - if (npc.life < npc.lifeMax / 3 || CalamityWorld.bossRushActive) - { - npc.velocity *= 0.9f; - num1052 += 0.05f; //0.05 - } - if (npc.life < npc.lifeMax / 5 || CalamityWorld.bossRushActive) - { - npc.velocity *= 0.9f; - num1052 += 0.05f; //0.05 - } - if (Math.Abs(npc.velocity.X) + Math.Abs(npc.velocity.Y) < num1052) - { - npc.ai[2] = 0f; - npc.ai[1] += 1f; - return; - } - } - } - } + else if (npc.ai[0] == 2f) + { + Vector2 distFromPlayer = Main.player[npc.target].Center - npc.Center; + if (npc.ai[1] > 1f || distFromPlayer.Length() > 2400f) + { + npc.ai[0] = 0f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.netUpdate = true; + return; + } + if (npc.ai[1] % 2f == 0f) + { + int num24 = 7; + for (int j = 0; j < num24; j++) + { + Vector2 arg_E1C_0 = (Vector2.Normalize(npc.velocity) * new Vector2((float)(npc.width + 50) / 2f, (float)npc.height) * 0.75f).RotatedBy((double)(j - (num24 / 2 - 1)) * 3.1415926535897931 / (double)((float)num24), default(Vector2)) + vector; + Vector2 vector4 = ((float)(Main.rand.NextDouble() * 3.1415927410125732) - 1.57079637f).ToRotationVector2() * (float)Main.rand.Next(3, 8); + int num25 = Dust.NewDust(arg_E1C_0 + vector4, 0, 0, 172, vector4.X * 2f, vector4.Y * 2f, 100, default(Color), 1.4f); + Main.dust[num25].noGravity = true; + Main.dust[num25].noLight = true; + Main.dust[num25].velocity /= 4f; + Main.dust[num25].velocity -= npc.velocity; + } + npc.TargetClosest(true); + if (Math.Abs(npc.position.Y + (float)(npc.height / 2) - (Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2))) < 20f) + { + npc.localAI[1] = 1f; + npc.ai[1] += 1f; + npc.ai[2] = 0f; + float num1044 = revenge ? 20f : 18f; //16 + if ((double)npc.life < (double)npc.lifeMax * 0.25) + { + num1044 += 2f; //2 not a prob + } + if ((double)npc.life < (double)npc.lifeMax * 0.1 || CalamityWorld.bossRushActive) + { + num1044 += 2f; //2 not a prob + } + if (npc.GetGlobalNPC(mod).enraged) + { + num1044 += 4f; + } + Vector2 vector117 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float num1045 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector117.X; + float num1046 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector117.Y; + float num1047 = (float)Math.Sqrt((double)(num1045 * num1045 + num1046 * num1046)); + num1047 = num1044 / num1047; + npc.velocity.X = num1045 * num1047; + npc.velocity.Y = num1046 * num1047; + npc.spriteDirection = npc.direction; + Main.PlaySound(29, (int)npc.position.X, (int)npc.position.Y, soundChoiceRage); + return; + } + npc.localAI[1] = 0f; + float num1048 = revenge ? 7.5f : 6.5f; //12 not a prob + float num1049 = revenge ? 0.12f : 0.11f; //0.15 not a prob + if ((double)npc.life < (double)npc.lifeMax * 0.25) + { + num1048 += 2f; //2 not a prob + num1049 += 0.05f; //0.05 not a prob + } + if ((double)npc.life < (double)npc.lifeMax * 0.1 || CalamityWorld.bossRushActive) + { + num1048 += 2f; //2 not a prob + num1049 += 0.1f; //0.1 not a prob + } + if (npc.GetGlobalNPC(mod).enraged) + { + num1048 += 3f; + num1049 += 0.2f; + } + if (npc.position.Y + (float)(npc.height / 2) < (Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2))) + { + npc.velocity.Y = npc.velocity.Y + num1049; + } + else + { + npc.velocity.Y = npc.velocity.Y - num1049; + } + if (npc.velocity.Y < -12f) + { + npc.velocity.Y = -num1048; + } + if (npc.velocity.Y > 12f) + { + npc.velocity.Y = num1048; + } + if (Math.Abs(npc.position.X + (float)(npc.width / 2) - (Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2))) > 600f) + { + npc.velocity.X = npc.velocity.X + 0.15f * (float)npc.direction; + } + else if (Math.Abs(npc.position.X + (float)(npc.width / 2) - (Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2))) < 300f) + { + npc.velocity.X = npc.velocity.X - 0.15f * (float)npc.direction; + } + else + { + npc.velocity.X = npc.velocity.X * 0.8f; + } + if (npc.velocity.X < -16f) + { + npc.velocity.X = -16f; + } + if (npc.velocity.X > 16f) + { + npc.velocity.X = 16f; + } + npc.spriteDirection = npc.direction; + return; + } + else + { + if (npc.velocity.X < 0f) + { + npc.direction = -1; + } + else + { + npc.direction = 1; + } + npc.spriteDirection = npc.direction; + int num1050 = sirenAlive ? 1100 : 900; //600 not a prob + int num1051 = 1; + if (npc.position.X + (float)(npc.width / 2) < Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2)) + { + num1051 = -1; + } + if (npc.direction == num1051 && Math.Abs(npc.position.X + (float)(npc.width / 2) - (Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2))) > (float)num1050) + { + npc.ai[2] = 1f; + } + if (npc.ai[2] != 1f) + { + npc.localAI[1] = 1f; + return; + } + npc.TargetClosest(true); + npc.spriteDirection = npc.direction; + npc.localAI[1] = 0f; + npc.velocity *= 0.9f; + float num1052 = revenge ? 0.11f : 0.1f; //0.1 + if (npc.life < npc.lifeMax / 3 || CalamityWorld.bossRushActive) + { + npc.velocity *= 0.9f; + num1052 += 0.05f; //0.05 + } + if (npc.life < npc.lifeMax / 5 || CalamityWorld.bossRushActive) + { + npc.velocity *= 0.9f; + num1052 += 0.05f; //0.05 + } + if (Math.Abs(npc.velocity.X) + Math.Abs(npc.velocity.Y) < num1052) + { + npc.ai[2] = 0f; + npc.ai[1] += 1f; + return; + } + } + } + } } - public override void HitEffect(int hitDirection, double damage) + public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 5; k++) { @@ -594,64 +594,64 @@ namespace CalamityMod.NPCs.Leviathan Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/Leviathangib3"), 1f); } } - + public override void BossLoot(ref string name, ref int potionType) { potionType = ItemID.GreaterHealingPotion; } - + public override void NPCLoot() { bool hardMode = Main.hardMode; int bossAlive = mod.NPCType("Siren"); if (!NPC.AnyNPCs(bossAlive)) { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EnchantedPearl")); //done - if (Main.rand.Next(10) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.HotlineFishingHook); - } - if (Main.rand.Next(10) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.BottomlessBucket); - } - if (Main.rand.Next(10) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.SuperAbsorbantSponge); - } - if (Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.CratePotion, Main.rand.Next(5, 9)); - } - if (Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.FishingPotion, Main.rand.Next(5, 9)); - } - if (Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.SonarPotion, Main.rand.Next(5, 9)); - } - if (!hardMode) - { - npc.DropItemInstanced(npc.position, npc.Size, mod.ItemType("IOU"), 1, true); - } if (Main.rand.Next(10) == 0) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("LeviathanTrophy")); //done } - if (CalamityWorld.armageddon) - { - for (int i = 0; i < 10; i++) - { - npc.DropBossBags(); - } - } - if (Main.expertMode && hardMode) + if (CalamityWorld.armageddon) + { + for (int i = 0; i < 5; i++) + { + npc.DropBossBags(); + } + } + if (Main.expertMode) { npc.DropBossBags(); } else { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EnchantedPearl")); //done + if (Main.rand.Next(10) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.HotlineFishingHook); + } + if (Main.rand.Next(10) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.BottomlessBucket); + } + if (Main.rand.Next(10) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.SuperAbsorbantSponge); + } + if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.CratePotion, Main.rand.Next(5, 9)); + } + if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.FishingPotion, Main.rand.Next(5, 9)); + } + if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.SonarPotion, Main.rand.Next(5, 9)); + } + if (!hardMode) + { + npc.DropItemInstanced(npc.position, npc.Size, mod.ItemType("IOU"), 1, true); + } if (Main.rand.Next(7) == 0) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("LeviathanMask")); //done @@ -691,49 +691,49 @@ namespace CalamityMod.NPCs.Leviathan npc.boss = false; } } - + public override void OnHitPlayer(Player target, int damage, bool crit) - { - target.AddBuff(BuffID.Wet, 240, true); - } - + { + target.AddBuff(BuffID.Wet, 240, true); + } + public override bool CheckActive() { return false; } - + public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) { Mod mod = ModLoader.GetMod("CalamityMod"); - Texture2D texture = Main.npcTexture[npc.type]; - Texture2D texture2 = mod.GetTexture("NPCs/Leviathan/LeviathanTexTwo"); - Texture2D texture3 = mod.GetTexture("NPCs/Leviathan/LeviathanAltTexOne"); - Texture2D texture4 = mod.GetTexture("NPCs/Leviathan/LeviathanAltTexTwo"); - if (npc.ai[0] == 1f) - { - if (npc.localAI[0] == 0f) - { - CalamityMod.DrawTexture(spriteBatch, texture, 0, npc, drawColor); - } - else - { - CalamityMod.DrawTexture(spriteBatch, texture2, 0, npc, drawColor); - } - } - else - { - if (npc.localAI[0] == 0f) - { - CalamityMod.DrawTexture(spriteBatch, texture3, 0, npc, drawColor); - } - else - { - CalamityMod.DrawTexture(spriteBatch, texture4, 0, npc, drawColor); - } - } + Texture2D texture = Main.npcTexture[npc.type]; + Texture2D texture2 = mod.GetTexture("NPCs/Leviathan/LeviathanTexTwo"); + Texture2D texture3 = mod.GetTexture("NPCs/Leviathan/LeviathanAltTexOne"); + Texture2D texture4 = mod.GetTexture("NPCs/Leviathan/LeviathanAltTexTwo"); + if (npc.ai[0] == 1f) + { + if (npc.localAI[0] == 0f) + { + CalamityMod.DrawTexture(spriteBatch, texture, 0, npc, drawColor); + } + else + { + CalamityMod.DrawTexture(spriteBatch, texture2, 0, npc, drawColor); + } + } + else + { + if (npc.localAI[0] == 0f) + { + CalamityMod.DrawTexture(spriteBatch, texture3, 0, npc, drawColor); + } + else + { + CalamityMod.DrawTexture(spriteBatch, texture4, 0, npc, drawColor); + } + } return false; } - + public override void FindFrame(int frameHeight) { npc.frameCounter += 1.0; @@ -745,15 +745,15 @@ namespace CalamityMod.NPCs.Leviathan if (npc.frame.Y >= frameHeight * 3) { npc.frame.Y = 0; - npc.localAI[0] += 1f; + npc.localAI[0] += 1f; + } + if (npc.localAI[0] > 1f) + { + npc.localAI[0] = 0f; + npc.netUpdate = true; } - if (npc.localAI[0] > 1f) - { - npc.localAI[0] = 0f; - npc.netUpdate = true; - } } - + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { npc.lifeMax = (int)(npc.lifeMax * 0.8f * bossLifeScale); diff --git a/NPCs/Leviathan/LeviathanStart.cs b/NPCs/Leviathan/LeviathanStart.cs index 5f1ac211ac..15c4af0343 100644 --- a/NPCs/Leviathan/LeviathanStart.cs +++ b/NPCs/Leviathan/LeviathanStart.cs @@ -15,7 +15,7 @@ namespace CalamityMod.NPCs.Leviathan public override void SetStaticDefaults() { DisplayName.SetDefault("???"); - Main.npcFrameCount[npc.type] = 4; + Main.npcFrameCount[npc.type] = 6; } public override void SetDefaults() @@ -23,8 +23,8 @@ namespace CalamityMod.NPCs.Leviathan npc.aiStyle = -1; aiType = -1; npc.damage = 0; - npc.width = 120; //324 - npc.height = 120; //216 + npc.width = 70; //324 + npc.height = 70; //216 npc.defense = 0; npc.lifeMax = 3000; npc.knockBackResist = 0f; diff --git a/NPCs/Leviathan/LeviathanStart.png b/NPCs/Leviathan/LeviathanStart.png index 42602cccfe..996cec6e05 100644 Binary files a/NPCs/Leviathan/LeviathanStart.png and b/NPCs/Leviathan/LeviathanStart.png differ diff --git a/NPCs/Leviathan/Parasea.cs b/NPCs/Leviathan/Parasea.cs index 2da413b0b0..161ec0d81f 100644 --- a/NPCs/Leviathan/Parasea.cs +++ b/NPCs/Leviathan/Parasea.cs @@ -24,6 +24,7 @@ namespace CalamityMod.NPCs.Leviathan aiType = -1; npc.noGravity = true; npc.noTileCollide = true; + npc.canGhostHeal = false; npc.damage = 45; npc.width = 90; //324 npc.height = 20; //216 @@ -36,6 +37,8 @@ namespace CalamityMod.NPCs.Leviathan npc.knockBackResist = 0f; npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; + banner = npc.type; + bannerItem = mod.ItemType("ParaseaBanner"); } public override void AI() diff --git a/NPCs/Leviathan/Siren.cs b/NPCs/Leviathan/Siren.cs index 7fed81921a..1737b82ab7 100644 --- a/NPCs/Leviathan/Siren.cs +++ b/NPCs/Leviathan/Siren.cs @@ -19,79 +19,72 @@ namespace CalamityMod.NPCs.Leviathan { public static bool phase2 = false; public static bool phase3 = false; - private bool spawnedLevi = false; - private bool secondClone = false; - private bool drawAltTexture = false; - private float phaseSwitch = 0f; - private float chargeSwitch = 0f; - private float anotherFloat = 0f; - + private bool spawnedLevi = false; + private bool secondClone = false; + private float phaseSwitch = 0f; + private float chargeSwitch = 0f; + private float anotherFloat = 0f; + public override void SetStaticDefaults() { DisplayName.SetDefault("The Siren"); - Main.npcFrameCount[npc.type] = 12; + Main.npcFrameCount[npc.type] = 6; } - + public override void SetDefaults() { npc.damage = 70; //150 npc.npcSlots = 16f; - npc.width = 120; //324 - npc.height = 120; //216 + npc.width = 100; //324 + npc.height = 100; //216 npc.defense = 25; - npc.lifeMax = CalamityWorld.revenge ? 36200 : 23800; - if (CalamityWorld.death) - { - npc.lifeMax = 51000; - } - if (CalamityWorld.bossRushActive) - { - npc.lifeMax = CalamityWorld.death ? 4500000 : 4100000; - } - npc.knockBackResist = 0f; - npc.aiStyle = -1; //new - aiType = -1; //new - npc.boss = true; - npc.value = Item.buyPrice(0, 15, 0, 0); - for (int k = 0; k < npc.buffImmune.Length; k++) + npc.lifeMax = CalamityWorld.revenge ? 41600 : 27400; + if (CalamityWorld.death) { - npc.buffImmune[k] = true; - npc.buffImmune[BuffID.Ichor] = false; - npc.buffImmune[mod.BuffType("MarkedforDeath")] = false; - npc.buffImmune[BuffID.CursedInferno] = false; - npc.buffImmune[BuffID.Daybreak] = false; - npc.buffImmune[mod.BuffType("AbyssalFlames")] = false; - npc.buffImmune[mod.BuffType("ArmorCrunch")] = false; - npc.buffImmune[mod.BuffType("DemonFlames")] = false; - npc.buffImmune[mod.BuffType("GodSlayerInferno")] = false; - npc.buffImmune[mod.BuffType("HolyLight")] = false; - npc.buffImmune[mod.BuffType("Nightwither")] = false; - npc.buffImmune[mod.BuffType("Plague")] = false; - npc.buffImmune[mod.BuffType("Shred")] = false; - npc.buffImmune[mod.BuffType("WhisperingDeath")] = false; - npc.buffImmune[mod.BuffType("SilvaStun")] = false; - } + npc.lifeMax = 58650; + } + if (CalamityWorld.bossRushActive) + { + npc.lifeMax = CalamityWorld.death ? 2800000 : 2600000; + } + npc.knockBackResist = 0f; + npc.aiStyle = -1; //new + aiType = -1; //new + npc.boss = true; + npc.value = Item.buyPrice(0, 15, 0, 0); + for (int k = 0; k < npc.buffImmune.Length; k++) + { + npc.buffImmune[k] = true; + npc.buffImmune[BuffID.Ichor] = false; + npc.buffImmune[mod.BuffType("MarkedforDeath")] = false; + npc.buffImmune[BuffID.CursedInferno] = false; + npc.buffImmune[BuffID.Daybreak] = false; + npc.buffImmune[mod.BuffType("AbyssalFlames")] = false; + npc.buffImmune[mod.BuffType("ArmorCrunch")] = false; + npc.buffImmune[mod.BuffType("DemonFlames")] = false; + npc.buffImmune[mod.BuffType("GodSlayerInferno")] = false; + npc.buffImmune[mod.BuffType("HolyLight")] = false; + npc.buffImmune[mod.BuffType("Nightwither")] = false; + npc.buffImmune[mod.BuffType("Plague")] = false; + npc.buffImmune[mod.BuffType("Shred")] = false; + npc.buffImmune[mod.BuffType("WhisperingDeath")] = false; + npc.buffImmune[mod.BuffType("SilvaStun")] = false; + } npc.noGravity = true; npc.noTileCollide = true; npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; - Mod calamityModMusic = ModLoader.GetMod("CalamityModMusic"); - if (calamityModMusic != null) - music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/Siren"); - else - music = MusicID.Boss3; + Mod calamityModMusic = ModLoader.GetMod("CalamityModMusic"); + if (calamityModMusic != null) + music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/Siren"); + else + music = MusicID.Boss3; bossBag = mod.ItemType("LeviathanBag"); } - + public override void AI() { Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 0f, 0.5f, 0.3f); - if (npc.localAI[2] == 0f) - { - drawAltTexture = (Main.rand.Next(2) == 0); - npc.localAI[2] = 1f; - npc.netUpdate = true; - } Player player = Main.player[npc.target]; bool revenge = (CalamityWorld.revenge || CalamityWorld.bossRushActive); bool expertMode = (Main.expertMode || CalamityWorld.bossRushActive); @@ -111,8 +104,8 @@ namespace CalamityMod.NPCs.Leviathan Vector2 spawnAt = npc.Center + new Vector2(0f, (float)npc.height / 2f); bool isNotOcean = player.position.Y < 800f || (double)player.position.Y > Main.worldSurface * 16.0 || (player.position.X > 6400f && player.position.X < (float)(Main.maxTilesX * 16 - 6400)); int npcType = mod.NPCType("Leviathan"); - bool halfLife = (double)npc.life <= (double)npc.lifeMax * 0.5; - bool leviAlive = NPC.AnyNPCs(npcType); + bool halfLife = (double)npc.life <= (double)npc.lifeMax * 0.5; + bool leviAlive = NPC.AnyNPCs(npcType); float num1000 = leviAlive ? 14f : 18f; float num1005 = leviAlive ? 14f : 18f; num1006 *= num1005; @@ -120,17 +113,17 @@ namespace CalamityMod.NPCs.Leviathan { if (!spawnedLevi) { - if (revenge) - { - NPC.NewNPC((int)spawnAt.X, (int)spawnAt.Y - 200, mod.NPCType("SirenClone")); - } - Mod calamityModMusic = ModLoader.GetMod("CalamityModMusic"); - if (calamityModMusic != null) - music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/LeviathanAndSiren"); - else - music = MusicID.Boss3; - NPC.SpawnOnPlayer(player.whoAmI, npcType); - spawnedLevi = true; + if (revenge) + { + NPC.NewNPC((int)spawnAt.X, (int)spawnAt.Y - 200, mod.NPCType("SirenClone")); + } + Mod calamityModMusic = ModLoader.GetMod("CalamityModMusic"); + if (calamityModMusic != null) + music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/LeviathanAndSiren"); + else + music = MusicID.Boss3; + NPC.SpawnOnPlayer(player.whoAmI, npcType); + spawnedLevi = true; } phase2 = true; } @@ -139,18 +132,18 @@ namespace CalamityMod.NPCs.Leviathan { npc.defense = npc.defDefense * defenseMult; } - else - { - npc.defense = 25; - } - if ((double)npc.life <= (double)npc.lifeMax * 0.25 && Main.netMode != 1) + else + { + npc.defense = 25; + } + if ((double)npc.life <= (double)npc.lifeMax * 0.25 && Main.netMode != 1) { if (!secondClone) { - if (revenge) - { - NPC.NewNPC((int)spawnAt.X, (int)spawnAt.Y - 200, mod.NPCType("SirenClone")); - } + if (revenge) + { + NPC.NewNPC((int)spawnAt.X, (int)spawnAt.Y - 200, mod.NPCType("SirenClone")); + } secondClone = true; } phase3 = true; @@ -210,11 +203,11 @@ namespace CalamityMod.NPCs.Leviathan num1038++; } } - if (npc.timeLeft < 3000) - { - npc.timeLeft = 3000; - } - if (npc.target < 0 || npc.target == 255 || player.dead || !player.active) + if (npc.timeLeft < 3000) + { + npc.timeLeft = 3000; + } + if (npc.target < 0 || npc.target == 255 || player.dead || !player.active) { npc.TargetClosest(true); } @@ -246,8 +239,8 @@ namespace CalamityMod.NPCs.Leviathan npc.spriteDirection = npc.direction; float num1053 = 9f; float num1054 = 0.15f; - float num10542 = 0.05f; - Vector2 vector118 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float num10542 = 0.05f; + Vector2 vector118 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); float num1055 = player.position.X + (float)(player.width / 2) - vector118.X; float num1056 = player.position.Y + (float)(player.height / 2) - 200f - vector118.Y; float num1057 = (float)Math.Sqrt((double)(num1055 * num1055 + num1056 * num1056)); @@ -306,14 +299,14 @@ namespace CalamityMod.NPCs.Leviathan float num1060 = (float)Math.Sqrt((double)(num1058 * num1058 + num1059 * num1059)); npc.ai[1] += 1f; npc.ai[1] += (float)(num1038 / 2); - if ((double)npc.life < (double)npc.lifeMax * 0.5 || CalamityWorld.bossRushActive) - { - npc.ai[1] += 0.25f; - } - if ((double)npc.life < (double)npc.lifeMax * 0.1 || CalamityWorld.bossRushActive) - { - npc.ai[1] += 0.25f; - } + if ((double)npc.life < (double)npc.lifeMax * 0.5 || CalamityWorld.bossRushActive) + { + npc.ai[1] += 0.25f; + } + if ((double)npc.life < (double)npc.lifeMax * 0.1 || CalamityWorld.bossRushActive) + { + npc.ai[1] += 0.25f; + } bool flag103 = false; if (npc.ai[1] > 20f) { @@ -327,7 +320,7 @@ namespace CalamityMod.NPCs.Leviathan if (Main.netMode != 1) { int num1061 = 371; - int num1062 = NPC.NewNPC((int)vector119.X, (int)vector119.Y, num1061, 0, 0f, 0f, 0f, 0f, 255); + int num1062 = NPC.NewNPC((int)vector119.X, (int)vector119.Y - 30, num1061, 0, 0f, 0f, 0f, 0f, 255); Main.npc[num1062].velocity.X = (float)Main.rand.Next(-200, 201) * 0.01f; Main.npc[num1062].velocity.Y = (float)Main.rand.Next(-200, 201) * 0.01f; Main.npc[num1062].localAI[0] = 60f; @@ -339,8 +332,8 @@ namespace CalamityMod.NPCs.Leviathan { float num1063 = 14f; float num1064 = 0.15f; - float num10642 = 0.05f; - vector120 = vector119; + float num10642 = 0.05f; + vector120 = vector119; num1058 = player.position.X + (float)(player.width / 2) - vector120.X; num1059 = player.position.Y + (float)(player.height / 2) - vector120.Y; num1060 = (float)Math.Sqrt((double)(num1058 * num1058 + num1059 * num1059)); @@ -395,16 +388,16 @@ namespace CalamityMod.NPCs.Leviathan else if (npc.ai[0] == 2f) { npc.rotation = npc.velocity.X * 0.02f; - Vector2 vector121 = new Vector2(npc.position.X + (float)(npc.width / 2) + (float)(Main.rand.Next(20) * npc.direction), npc.position.Y + (float)npc.height * 0.8f); + Vector2 vector121 = new Vector2(npc.position.X + (float)(npc.width / 2) + (float)(Main.rand.Next(20) * npc.direction), npc.position.Y + (float)npc.height * 0.4f); npc.ai[1] += 1f; bool flag104 = false; - if (npc.GetGlobalNPC(mod).enraged) - { - if (npc.ai[1] % 10f == 9f) - { - flag104 = true; - } - } + if (npc.GetGlobalNPC(mod).enraged) + { + if (npc.ai[1] % 10f == 9f) + { + flag104 = true; + } + } else if ((!leviAlive && halfLife) || CalamityWorld.death || CalamityWorld.bossRushActive) { if (npc.ai[1] % 15f == 14f) @@ -438,10 +431,10 @@ namespace CalamityMod.NPCs.Leviathan if (Main.netMode != 1) { float num1070 = revenge ? 13f : 11f; - if (npc.GetGlobalNPC(mod).enraged) - { - num1070 = 24f; - } + if (npc.GetGlobalNPC(mod).enraged) + { + num1070 = 24f; + } else if (isNotOcean || (!leviAlive && halfLife) || CalamityWorld.death || CalamityWorld.bossRushActive) { num1070 = revenge ? 19f : 18f; @@ -465,74 +458,74 @@ namespace CalamityMod.NPCs.Leviathan num1072 *= num1073; int num1074 = expertMode ? 26 : 32; int num1075 = mod.ProjectileType("WaterSpear"); - switch (Main.rand.Next(6)) - { - case 0: num1075 = mod.ProjectileType("SirenSong"); break; - case 1: num1075 = mod.ProjectileType("FrostMist"); break; - case 2: - case 3: - case 4: - case 5: num1075 = mod.ProjectileType("WaterSpear"); break; - } - if (isNotOcean) + switch (Main.rand.Next(6)) { - num1074 *= 2; + case 0: num1075 = mod.ProjectileType("SirenSong"); break; + case 1: num1075 = mod.ProjectileType("FrostMist"); break; + case 2: + case 3: + case 4: + case 5: num1075 = mod.ProjectileType("WaterSpear"); break; + } + if (isNotOcean) + { + num1074 *= 2; } Projectile.NewProjectile(vector121.X, vector121.Y, num1071, num1072, num1075, num1074, 0f, Main.myPlayer, 0f, 0f); } } - if (npc.position.Y > player.position.Y - 200f) //200 - { - if (npc.velocity.Y > 0f) - { - npc.velocity.Y = npc.velocity.Y * 0.98f; - } - npc.velocity.Y = npc.velocity.Y - 0.1f; - if (npc.velocity.Y > 2f) - { - npc.velocity.Y = 2f; - } - } - else if (npc.position.Y < player.position.Y - 500f) //500 - { - if (npc.velocity.Y < 0f) - { - npc.velocity.Y = npc.velocity.Y * 0.98f; - } - npc.velocity.Y = npc.velocity.Y + 0.1f; - if (npc.velocity.Y < -2f) - { - npc.velocity.Y = -2f; - } - } - if (npc.position.X + (float)(npc.width / 2) > player.position.X + (float)(player.width / 2) + 100f) - { - if (npc.velocity.X > 0f) - { - npc.velocity.X = npc.velocity.X * 0.98f; - } - npc.velocity.X = npc.velocity.X - 0.1f; - if (npc.velocity.X > 8f) - { - npc.velocity.X = 8f; - } - } - if (npc.position.X + (float)(npc.width / 2) < player.position.X + (float)(player.width / 2) - 100f) - { - if (npc.velocity.X < 0f) - { - npc.velocity.X = npc.velocity.X * 0.98f; - } - npc.velocity.X = npc.velocity.X + 0.1f; - if (npc.velocity.X < -8f) - { - npc.velocity.X = -8f; - } - } - float playerLocation = npc.Center.X - player.Center.X; - npc.direction = (playerLocation < 0 ? 1 : -1); - npc.spriteDirection = npc.direction; - if (npc.ai[1] > 300f) + if (npc.position.Y > player.position.Y - 200f) //200 + { + if (npc.velocity.Y > 0f) + { + npc.velocity.Y = npc.velocity.Y * 0.985f; + } + npc.velocity.Y = npc.velocity.Y - 0.1f; + if (npc.velocity.Y > 2f) + { + npc.velocity.Y = 2f; + } + } + else if (npc.position.Y < player.position.Y - 500f) //500 + { + if (npc.velocity.Y < 0f) + { + npc.velocity.Y = npc.velocity.Y * 0.985f; + } + npc.velocity.Y = npc.velocity.Y + 0.1f; + if (npc.velocity.Y < -2f) + { + npc.velocity.Y = -2f; + } + } + if (npc.position.X + (float)(npc.width / 2) > player.position.X + (float)(player.width / 2) + 100f) + { + if (npc.velocity.X > 0f) + { + npc.velocity.X = npc.velocity.X * 0.98f; + } + npc.velocity.X = npc.velocity.X - 0.1f; + if (npc.velocity.X > 8f) + { + npc.velocity.X = 8f; + } + } + if (npc.position.X + (float)(npc.width / 2) < player.position.X + (float)(player.width / 2) - 100f) + { + if (npc.velocity.X < 0f) + { + npc.velocity.X = npc.velocity.X * 0.98f; + } + npc.velocity.X = npc.velocity.X + 0.1f; + if (npc.velocity.X < -8f) + { + npc.velocity.X = -8f; + } + } + float playerLocation = npc.Center.X - player.Center.X; + npc.direction = (playerLocation < 0 ? 1 : -1); + npc.spriteDirection = npc.direction; + if (npc.ai[1] > 300f) { npc.ai[0] = -1f; npc.ai[1] = 0f; @@ -540,11 +533,11 @@ namespace CalamityMod.NPCs.Leviathan return; } } - else if (npc.ai[0] == 3f) + else if (npc.ai[0] == 3f) { npc.TargetClosest(false); npc.rotation = npc.velocity.ToRotation(); - if (Math.Sign(npc.velocity.X) != 0) + if (Math.Sign(npc.velocity.X) != 0) { npc.spriteDirection = -Math.Sign(npc.velocity.X); } @@ -552,17 +545,17 @@ namespace CalamityMod.NPCs.Leviathan { npc.rotation += 3.14159274f; } - if (npc.rotation > 1.57079637f) + if (npc.rotation > 1.57079637f) { npc.rotation -= 3.14159274f; } npc.spriteDirection = Math.Sign(npc.velocity.X); phaseSwitch += 1f; - if (CalamityWorld.death || CalamityWorld.bossRushActive) - { - phaseSwitch += 1f; - } - if (chargeSwitch == 0f) + if (CalamityWorld.death || CalamityWorld.bossRushActive) + { + phaseSwitch += 1f; + } + if (chargeSwitch == 0f) { float scaleFactor6 = num998; Vector2 center4 = npc.Center; @@ -573,42 +566,42 @@ namespace CalamityMod.NPCs.Leviathan vector126 = Vector2.Normalize(vector126) * scaleFactor6; vector127 = Vector2.Normalize(vector127) * scaleFactor6; bool flag64 = Collision.CanHit(npc.Center, 1, 1, player.Center, 1, 1); - if (anotherFloat >= 120f) + if (anotherFloat >= 120f) { flag64 = true; } float num1014 = 8f; flag64 = (flag64 && vector126.ToRotation() > 3.14159274f / num1014 && vector126.ToRotation() < 3.14159274f - 3.14159274f / num1014); - if (num1013 > num999 || !flag64) + if (num1013 > num999 || !flag64) { npc.velocity.X = (npc.velocity.X * (num1000 - 1f) + vector127.X) / (leviAlive ? 13.9f : 17.8f); //14f 18f npc.velocity.Y = (npc.velocity.Y * (num1000 - 1f) + vector127.Y) / (leviAlive ? 13.9f : 17.8f); //14f 18f - if (!flag64) + if (!flag64) { anotherFloat += 1f; if (anotherFloat == 120f) { npc.netUpdate = true; } - } + } else { anotherFloat = 0f; } - } - else + } + else { chargeSwitch = 1f; npc.ai[2] = vector126.X; anotherFloat = vector126.Y; npc.netUpdate = true; } - } - else if (chargeSwitch == 1f) + } + else if (chargeSwitch == 1f) { npc.velocity *= scaleFactor4; npc.ai[1] += 1f; - if (npc.ai[1] >= num1001) + if (npc.ai[1] >= num1001) { chargeSwitch = 2f; npc.ai[1] = 0f; @@ -618,13 +611,13 @@ namespace CalamityMod.NPCs.Leviathan velocity *= scaleFactor5; npc.velocity = velocity; } - } - else if (chargeSwitch == 2f) + } + else if (chargeSwitch == 2f) { float num1016 = num1003; npc.ai[1] += 1f; bool flag65 = Vector2.Distance(npc.Center, player.Center) > num1004 && npc.Center.Y > player.Center.Y; - if ((npc.ai[1] >= num1016 && flag65) || npc.velocity.Length() < num1007) + if ((npc.ai[1] >= num1016 && flag65) || npc.velocity.Length() < num1007) { chargeSwitch = 0f; npc.ai[1] = 0f; @@ -634,24 +627,24 @@ namespace CalamityMod.NPCs.Leviathan npc.netUpdate = true; npc.ai[1] = 45f; chargeSwitch = 4f; - } - else + } + else { Vector2 center6 = npc.Center; Vector2 center7 = player.Center; Vector2 vec2 = center7 - center6; vec2.Normalize(); - if (vec2.HasNaNs()) + if (vec2.HasNaNs()) { vec2 = new Vector2((float)npc.direction, 0f); } npc.velocity = (npc.velocity * (num1005 - 1f) + vec2 * (npc.velocity.Length() + num1006)) / num1005; } - } - else if (chargeSwitch == 4f) + } + else if (chargeSwitch == 4f) { npc.ai[1] -= 3f; - if (npc.ai[1] <= 0f) + if (npc.ai[1] <= 0f) { chargeSwitch = 0f; npc.ai[1] = 0f; @@ -673,37 +666,36 @@ namespace CalamityMod.NPCs.Leviathan } if (player.dead || Vector2.Distance(player.Center, vector) > 5600f) { - if (npc.localAI[3] < 120f) + if (npc.localAI[3] < 120f) { npc.localAI[3] += 1f; } - if (npc.localAI[3] > 60f) + if (npc.localAI[3] > 60f) { npc.velocity.Y = npc.velocity.Y + (npc.localAI[3] - 60f) * 0.25f; if ((double)npc.position.Y > Main.rockLayer * 16.0) { - for (int x = 0; x < 200; x++) - { - if (Main.npc[x].type == mod.NPCType("Leviathan")) - { - Main.npc[x].active = false; - Main.npc[x].netUpdate = true; - } - } - npc.active = false; - npc.netUpdate = true; + for (int x = 0; x < 200; x++) + { + if (Main.npc[x].type == mod.NPCType("Leviathan")) + { + Main.npc[x].active = false; + Main.npc[x].netUpdate = true; + } + } + npc.active = false; + npc.netUpdate = true; } } return; } - if (npc.localAI[3] > 0f) + if (npc.localAI[3] > 0f) { npc.localAI[3] -= 1f; - return; } } - public override void HitEffect(int hitDirection, double damage) + public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 3; k++) { @@ -711,6 +703,11 @@ namespace CalamityMod.NPCs.Leviathan } if (npc.life <= 0) { + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SirenGores/Siren"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SirenGores/Siren2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SirenGores/Siren3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SirenGores/Siren4"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SirenGores/Siren5"), 1f); for (int k = 0; k < 50; k++) { Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); @@ -718,120 +715,127 @@ namespace CalamityMod.NPCs.Leviathan } } - public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) //for alt textures - { - Mod mod = ModLoader.GetMod("CalamityMod"); - Texture2D texture = (drawAltTexture ? mod.GetTexture("NPCs/Leviathan/SirenAlt") : mod.GetTexture("NPCs/Leviathan/Siren")); - CalamityMod.DrawTexture(spriteBatch, texture, 0, npc, drawColor); - return false; - } - - public override void FindFrame(int frameHeight) //9 total frames + public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) //2 total states (ice shield or no ice shield) { - npc.frameCounter += 1.0; - if (npc.ai[0] == 2f) + Mod mod = ModLoader.GetMod("CalamityMod"); + Texture2D texture = Main.npcTexture[npc.type]; + if (npc.dontTakeDamage) { - if (npc.frameCounter > 12.0) + switch ((int)npc.localAI[2]) { - npc.frame.Y = npc.frame.Y + frameHeight; - npc.frameCounter = 0.0; - } - if (npc.frame.Y >= frameHeight * 4) - { - npc.frame.Y = 0; - } - } - else if (npc.ai[0] <= 1f) - { - if (npc.frameCounter > 12.0) - { - npc.frame.Y = npc.frame.Y + frameHeight; - npc.frameCounter = 0.0; - } - if (npc.frame.Y < frameHeight * 4) - { - npc.frame.Y = frameHeight * 4; - } - if (npc.frame.Y >= frameHeight * 8) - { - npc.frame.Y = frameHeight * 4; + case 0: + texture = mod.GetTexture("NPCs/Leviathan/SirenAlt"); + break; + case 1: + texture = mod.GetTexture("NPCs/Leviathan/SirenAltSinging"); + break; + case 2: + texture = mod.GetTexture("NPCs/Leviathan/SirenAltStabbing"); + break; } } else { - if (npc.frameCounter > 12.0) + switch ((int)npc.localAI[2]) { - npc.frame.Y = npc.frame.Y + frameHeight; - npc.frameCounter = 0.0; - } - if (npc.frame.Y < frameHeight * 8) - { - npc.frame.Y = frameHeight * 8; - } - if (npc.frame.Y >= frameHeight * 12) - { - npc.frame.Y = frameHeight * 8; + case 0: + texture = Main.npcTexture[npc.type]; + break; + case 1: + texture = mod.GetTexture("NPCs/Leviathan/SirenSinging"); + break; + case 2: + texture = mod.GetTexture("NPCs/Leviathan/SirenStabbing"); + break; } } + CalamityMod.DrawTexture(spriteBatch, texture, 0, npc, drawColor); + return false; } - + + public override void FindFrame(int frameHeight) //6 total frames, 3 total texture types + { + if (npc.ai[0] == 2f) + { + npc.localAI[2] = 0f; + } + else if (npc.ai[0] <= 1f) + { + npc.localAI[2] = 1f; + } + else + { + npc.localAI[2] = 2f; + } + npc.frameCounter += 1.0; + if (npc.frameCounter > 12.0) + { + npc.frame.Y = npc.frame.Y + frameHeight; + npc.frameCounter = 0.0; + } + if (npc.frame.Y >= frameHeight * 6) + { + npc.frame.Y = 0; + } + } + public override void BossLoot(ref string name, ref int potionType) { potionType = ItemID.GreaterHealingPotion; } - + public override void NPCLoot() { bool hardMode = Main.hardMode; int bossAlive = mod.NPCType("Leviathan"); if (!NPC.AnyNPCs(bossAlive)) { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EnchantedPearl")); //done - if (Main.rand.Next(10) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.HotlineFishingHook); - } - if (Main.rand.Next(10) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.BottomlessBucket); - } - if (Main.rand.Next(10) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.SuperAbsorbantSponge); - } - if (Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.CratePotion, Main.rand.Next(5, 9)); - } - if (Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.FishingPotion, Main.rand.Next(5, 9)); - } - if (Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.SonarPotion, Main.rand.Next(5, 9)); - } - if (!hardMode) - { - npc.DropItemInstanced(npc.position, npc.Size, mod.ItemType("IOU"), 1, true); - } if (Main.rand.Next(10) == 0) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("LeviathanTrophy")); //done } - if (CalamityWorld.armageddon) - { - for (int i = 0; i < 10; i++) - { - npc.DropBossBags(); - } - } - if (Main.expertMode && hardMode) + if (CalamityWorld.armageddon) + { + for (int i = 0; i < 5; i++) + { + npc.DropBossBags(); + } + } + if (Main.expertMode) { npc.DropBossBags(); } else { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EnchantedPearl")); //done + if (Main.rand.Next(10) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.HotlineFishingHook); + } + if (Main.rand.Next(10) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.BottomlessBucket); + } + if (Main.rand.Next(10) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.SuperAbsorbantSponge); + } + if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.CratePotion, Main.rand.Next(5, 9)); + } + if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.FishingPotion, Main.rand.Next(5, 9)); + } + if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.SonarPotion, Main.rand.Next(5, 9)); + } + if (!hardMode) + { + npc.DropItemInstanced(npc.position, npc.Size, mod.ItemType("IOU"), 1, true); + } if (Main.rand.Next(7) == 0) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("LeviathanMask")); //done @@ -871,17 +875,17 @@ namespace CalamityMod.NPCs.Leviathan npc.boss = false; } } - + public override void OnHitPlayer(Player target, int damage, bool crit) - { - target.AddBuff(BuffID.Wet, 120, true); - } - + { + target.AddBuff(BuffID.Wet, 120, true); + } + public override bool CheckActive() { return false; } - + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { npc.lifeMax = (int)(npc.lifeMax * 0.8f * bossLifeScale); diff --git a/NPCs/Leviathan/Siren.png b/NPCs/Leviathan/Siren.png index e523497ed1..56d3a69d45 100644 Binary files a/NPCs/Leviathan/Siren.png and b/NPCs/Leviathan/Siren.png differ diff --git a/NPCs/Leviathan/SirenAlt.png b/NPCs/Leviathan/SirenAlt.png index 26b616ef20..793607a326 100644 Binary files a/NPCs/Leviathan/SirenAlt.png and b/NPCs/Leviathan/SirenAlt.png differ diff --git a/NPCs/Leviathan/SirenAltSinging.png b/NPCs/Leviathan/SirenAltSinging.png new file mode 100644 index 0000000000..365c439126 Binary files /dev/null and b/NPCs/Leviathan/SirenAltSinging.png differ diff --git a/NPCs/Leviathan/SirenAltStabbing.png b/NPCs/Leviathan/SirenAltStabbing.png new file mode 100644 index 0000000000..4057d163d9 Binary files /dev/null and b/NPCs/Leviathan/SirenAltStabbing.png differ diff --git a/NPCs/Leviathan/SirenClone.cs b/NPCs/Leviathan/SirenClone.cs index 0877df2429..e63105faf5 100644 --- a/NPCs/Leviathan/SirenClone.cs +++ b/NPCs/Leviathan/SirenClone.cs @@ -17,7 +17,7 @@ namespace CalamityMod.NPCs.Leviathan public override void SetStaticDefaults() { DisplayName.SetDefault("Siren Clone"); - Main.npcFrameCount[npc.type] = 4; + Main.npcFrameCount[npc.type] = 6; } public override void SetDefaults() @@ -25,7 +25,7 @@ namespace CalamityMod.NPCs.Leviathan npc.aiStyle = -1; aiType = -1; npc.damage = 0; - npc.width = 120; //324 + npc.width = 70; //324 npc.height = 120; //216 npc.defense = 0; npc.lifeMax = 3000; diff --git a/NPCs/Leviathan/SirenClone.png b/NPCs/Leviathan/SirenClone.png index 7564564883..83c221cda3 100644 Binary files a/NPCs/Leviathan/SirenClone.png and b/NPCs/Leviathan/SirenClone.png differ diff --git a/NPCs/Leviathan/SirenIce.cs b/NPCs/Leviathan/SirenIce.cs index 1b9b109095..c6d498eb48 100644 --- a/NPCs/Leviathan/SirenIce.cs +++ b/NPCs/Leviathan/SirenIce.cs @@ -24,11 +24,11 @@ namespace CalamityMod.NPCs.Leviathan npc.canGhostHeal = false; npc.noTileCollide = true; npc.damage = 45; - npc.width = 160; //324 - npc.height = 160; //216 + npc.width = 100; + npc.height = 100; npc.defense = 10; npc.lifeMax = 650; - if (CalamityWorld.bossRushActive) + if (CalamityWorld.bossRushActive) { npc.lifeMax = 400000; } @@ -51,8 +51,8 @@ namespace CalamityMod.NPCs.Leviathan npc.spriteDirection = Main.npc[num989].direction; npc.velocity = Vector2.Zero; npc.position = Main.npc[num989].Center; - npc.position.X = npc.position.X - (float)(npc.width / 2) + ((npc.spriteDirection == 1) ? -30f : 30f); - npc.position.Y = npc.position.Y - (float)(npc.height / 2); + npc.position.X = npc.position.X - (float)(npc.width / 2) + ((npc.spriteDirection == 1) ? -20f : 20f); + npc.position.Y = npc.position.Y - (float)(npc.height / 2) - 30; npc.gfxOffY = Main.npc[num989].gfxOffY; Lighting.AddLight((int)npc.Center.X / 16, (int)npc.Center.Y / 16, 0f, 0.8f, 1.1f); return; @@ -61,7 +61,7 @@ namespace CalamityMod.NPCs.Leviathan npc.HitEffect(0, 10.0); npc.active = false; } - + public override void ModifyHitByProjectile(Projectile projectile, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) { if (projectile.type != mod.ProjectileType("FlakKraken")) @@ -76,7 +76,12 @@ namespace CalamityMod.NPCs.Leviathan } } } - + + public override Color? GetAlpha(Color drawColor) + { + return new Color(200, 200, 200, npc.alpha); + } + public override void OnHitPlayer(Player player, int damage, bool crit) { player.AddBuff(BuffID.Frostburn, 240, true); diff --git a/NPCs/Leviathan/SirenIce.png b/NPCs/Leviathan/SirenIce.png index 9f2547d65a..36251f6db2 100644 Binary files a/NPCs/Leviathan/SirenIce.png and b/NPCs/Leviathan/SirenIce.png differ diff --git a/NPCs/Leviathan/SirenSinging.png b/NPCs/Leviathan/SirenSinging.png new file mode 100644 index 0000000000..064adc1694 Binary files /dev/null and b/NPCs/Leviathan/SirenSinging.png differ diff --git a/NPCs/Leviathan/SirenStabbing.png b/NPCs/Leviathan/SirenStabbing.png new file mode 100644 index 0000000000..5fbf48baf5 Binary files /dev/null and b/NPCs/Leviathan/SirenStabbing.png differ diff --git a/NPCs/Leviathan/Siren_Head_Boss.png b/NPCs/Leviathan/Siren_Head_Boss.png index 4fff5b294d..6c4a70aad2 100644 Binary files a/NPCs/Leviathan/Siren_Head_Boss.png and b/NPCs/Leviathan/Siren_Head_Boss.png differ diff --git a/NPCs/NormalNPCs/AeroSlime.cs b/NPCs/NormalNPCs/AeroSlime.cs index 4e5f138d41..1b5e69f6d1 100644 --- a/NPCs/NormalNPCs/AeroSlime.cs +++ b/NPCs/NormalNPCs/AeroSlime.cs @@ -35,11 +35,14 @@ namespace CalamityMod.NPCs.NormalNPCs npc.noTileCollide = false; npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; + banner = npc.type; + bannerItem = mod.ItemType("AeroSlimeBanner"); } public override float SpawnChance(NPCSpawnInfo spawnInfo) { - if (spawnInfo.playerSafe || (!CalamityWorld.downedHiveMind && !CalamityWorld.downedPerforator) || spawnInfo.player.GetModPlayer(mod).ZoneAbyss) + if (spawnInfo.playerSafe || (!CalamityWorld.downedHiveMind && !CalamityWorld.downedPerforator) || spawnInfo.player.GetModPlayer(mod).ZoneAbyss || + spawnInfo.player.GetModPlayer(mod).ZoneSunkenSea) { return 0f; } diff --git a/NPCs/NormalNPCs/AngryDog.cs b/NPCs/NormalNPCs/AngryDog.cs index 9d9b595b91..7accef5bfb 100644 --- a/NPCs/NormalNPCs/AngryDog.cs +++ b/NPCs/NormalNPCs/AngryDog.cs @@ -40,6 +40,8 @@ namespace CalamityMod.NPCs.NormalNPCs npc.value = Item.buyPrice(0, 0, 3, 0); npc.HitSound = mod.GetLegacySoundSlot(SoundType.NPCHit, "Sounds/NPCHit/AngryDogHit"); npc.DeathSound = SoundID.NPCDeath5; + banner = npc.type; + bannerItem = mod.ItemType("AngryDogBanner"); } public override void AI() @@ -379,13 +381,6 @@ namespace CalamityMod.NPCs.NormalNPCs { npc.ai[3] = 0f; } - if (npc.type == 155) - { - if (npc.velocity.Y == 0f && num40 < 100f && Math.Abs(npc.velocity.X) > 3f && ((npc.position.X + (float)(npc.width / 2) < Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) && npc.velocity.X > 0f) || (npc.position.X + (float)(npc.width / 2) > Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) && npc.velocity.X < 0f))) - { - npc.velocity.Y = npc.velocity.Y - 4f; - } - } if (npc.ai[3] < (float)num19) { npc.TargetClosest(true); @@ -419,17 +414,6 @@ namespace CalamityMod.NPCs.NormalNPCs float num70 = 0.07f; if (!flag19&& (npc.velocity.Y == 0f || npc.wet || (npc.velocity.X <= 0f && npc.direction < 0) || (npc.velocity.X >= 0f && npc.direction > 0))) { - if (npc.type == 155) - { - if (npc.velocity.X > 0f && npc.direction < 0) - { - npc.velocity.X = npc.velocity.X * 0.95f; - } - if (npc.velocity.X < 0f && npc.direction > 0) - { - npc.velocity.X = npc.velocity.X * 0.95f; - } - } if (npc.velocity.X < -num6 || npc.velocity.X > num6) { if (npc.velocity.Y == 0f) @@ -634,7 +618,8 @@ namespace CalamityMod.NPCs.NormalNPCs !spawnInfo.player.ZoneTowerVortex && !spawnInfo.player.ZoneTowerNebula && !spawnInfo.player.ZoneDungeon && - !spawnInfo.playerInTown && !spawnInfo.player.ZoneOldOneArmy && !Main.snowMoon && !Main.pumpkinMoon ? 0.012f : 0f; + !spawnInfo.player.GetModPlayer(mod).ZoneSunkenSea && + !spawnInfo.playerInTown && !spawnInfo.player.ZoneOldOneArmy && !Main.snowMoon && !Main.pumpkinMoon ? 0.012f : 0f; } public override void OnHitPlayer(Player player, int damage, bool crit) diff --git a/NPCs/NormalNPCs/ArmoredDiggerBody.cs b/NPCs/NormalNPCs/ArmoredDiggerBody.cs index a08c2e2a1b..9493d379a8 100644 --- a/NPCs/NormalNPCs/ArmoredDiggerBody.cs +++ b/NPCs/NormalNPCs/ArmoredDiggerBody.cs @@ -23,7 +23,7 @@ namespace CalamityMod.NPCs.NormalNPCs npc.width = 38; //324 npc.height = 38; //216 npc.defense = 40; - npc.lifeMax = 30000; + npc.lifeMax = 20000; npc.knockBackResist = 0f; npc.aiStyle = -1; aiType = -1; @@ -39,6 +39,8 @@ namespace CalamityMod.NPCs.NormalNPCs } npc.netAlways = true; npc.dontCountMe = true; + banner = mod.NPCType("ArmoredDiggerHead"); + bannerItem = mod.ItemType("ArmoredDiggerBanner"); } public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) diff --git a/NPCs/NormalNPCs/ArmoredDiggerHead.cs b/NPCs/NormalNPCs/ArmoredDiggerHead.cs index c5f070b9a1..3ea0aa6e94 100644 --- a/NPCs/NormalNPCs/ArmoredDiggerHead.cs +++ b/NPCs/NormalNPCs/ArmoredDiggerHead.cs @@ -26,7 +26,7 @@ namespace CalamityMod.NPCs.NormalNPCs npc.width = 54; //324 npc.height = 54; //216 npc.defense = 15; - npc.lifeMax = 30000; + npc.lifeMax = 20000; npc.knockBackResist = 0f; npc.aiStyle = -1; aiType = -1; @@ -42,6 +42,8 @@ namespace CalamityMod.NPCs.NormalNPCs npc.buffImmune[k] = true; } npc.netAlways = true; + banner = npc.type; + bannerItem = mod.ItemType("ArmoredDiggerBanner"); } public override void AI() diff --git a/NPCs/NormalNPCs/ArmoredDiggerTail.cs b/NPCs/NormalNPCs/ArmoredDiggerTail.cs index 65552d9f32..1ba3d4d52c 100644 --- a/NPCs/NormalNPCs/ArmoredDiggerTail.cs +++ b/NPCs/NormalNPCs/ArmoredDiggerTail.cs @@ -23,7 +23,7 @@ namespace CalamityMod.NPCs.NormalNPCs npc.width = 34; //324 npc.height = 34; //216 npc.defense = 55; - npc.lifeMax = 30000; + npc.lifeMax = 20000; npc.knockBackResist = 0f; npc.aiStyle = -1; aiType = -1; @@ -39,6 +39,8 @@ namespace CalamityMod.NPCs.NormalNPCs } npc.netAlways = true; npc.dontCountMe = true; + banner = mod.NPCType("ArmoredDiggerHead"); + bannerItem = mod.ItemType("ArmoredDiggerBanner"); } public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) diff --git a/NPCs/NormalNPCs/BlightedEye.cs b/NPCs/NormalNPCs/BlightedEye.cs index 20cdf43c7a..2900f0434c 100644 --- a/NPCs/NormalNPCs/BlightedEye.cs +++ b/NPCs/NormalNPCs/BlightedEye.cs @@ -31,6 +31,8 @@ namespace CalamityMod.NPCs.NormalNPCs npc.value = Item.buyPrice(0, 0, 2, 0); npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; + banner = npc.type; + bannerItem = mod.ItemType("BlightedEyeBanner"); } public override void HitEffect(int hitDirection, double damage) diff --git a/NPCs/NormalNPCs/BloomSlime.cs b/NPCs/NormalNPCs/BloomSlime.cs index 64feebdf0c..530a457ede 100644 --- a/NPCs/NormalNPCs/BloomSlime.cs +++ b/NPCs/NormalNPCs/BloomSlime.cs @@ -35,11 +35,14 @@ namespace CalamityMod.NPCs.NormalNPCs npc.noTileCollide = false; npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; + banner = npc.type; + bannerItem = mod.ItemType("BloomSlimeBanner"); } public override float SpawnChance(NPCSpawnInfo spawnInfo) { - if (spawnInfo.playerSafe || !CalamityWorld.downedProvidence || spawnInfo.player.GetModPlayer(mod).ZoneAbyss) + if (spawnInfo.playerSafe || !CalamityWorld.downedProvidence || spawnInfo.player.GetModPlayer(mod).ZoneAbyss || + spawnInfo.player.GetModPlayer(mod).ZoneSunkenSea) { return 0f; } diff --git a/NPCs/NormalNPCs/Bohldohr.cs b/NPCs/NormalNPCs/Bohldohr.cs index 105fb862ce..82cfecb29f 100644 --- a/NPCs/NormalNPCs/Bohldohr.cs +++ b/NPCs/NormalNPCs/Bohldohr.cs @@ -31,6 +31,8 @@ namespace CalamityMod.NPCs.NormalNPCs npc.HitSound = SoundID.NPCHit7; npc.DeathSound = SoundID.NPCDeath35; npc.behindTiles = true; + banner = npc.type; + bannerItem = mod.ItemType("BOHLDOHRBanner"); } public override void AI() diff --git a/NPCs/NormalNPCs/Bohldohr.png b/NPCs/NormalNPCs/Bohldohr.png index 7269c0c06f..c4e28552a9 100644 Binary files a/NPCs/NormalNPCs/Bohldohr.png and b/NPCs/NormalNPCs/Bohldohr.png differ diff --git a/NPCs/NormalNPCs/CalamityEye.cs b/NPCs/NormalNPCs/CalamityEye.cs index 0d731e5749..15a35785a3 100644 --- a/NPCs/NormalNPCs/CalamityEye.cs +++ b/NPCs/NormalNPCs/CalamityEye.cs @@ -31,6 +31,8 @@ namespace CalamityMod.NPCs.NormalNPCs npc.value = Item.buyPrice(0, 0, 5, 0); npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; + banner = npc.type; + bannerItem = mod.ItemType("CalamityEyeBanner"); } public override void HitEffect(int hitDirection, double damage) @@ -65,11 +67,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void NPCLoot() { - if (Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CalamityDust")); - } - if (Main.rand.Next(3) == 0) + if (Main.rand.Next(2) == 0) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BlightedLens")); } diff --git a/NPCs/NormalNPCs/CharredSlime.cs b/NPCs/NormalNPCs/CharredSlime.cs index d63af40461..5fcfc0604f 100644 --- a/NPCs/NormalNPCs/CharredSlime.cs +++ b/NPCs/NormalNPCs/CharredSlime.cs @@ -35,6 +35,8 @@ namespace CalamityMod.NPCs.NormalNPCs npc.noTileCollide = false; npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; + banner = npc.type; + bannerItem = mod.ItemType("CharredSlimeBanner"); } public override float SpawnChance(NPCSpawnInfo spawnInfo) diff --git a/NPCs/NormalNPCs/Cnidrion.cs b/NPCs/NormalNPCs/Cnidrion.cs index 33b449d2a7..0d667b903a 100644 --- a/NPCs/NormalNPCs/Cnidrion.cs +++ b/NPCs/NormalNPCs/Cnidrion.cs @@ -33,11 +33,13 @@ namespace CalamityMod.NPCs.NormalNPCs npc.HitSound = SoundID.NPCHit12; npc.DeathSound = SoundID.NPCDeath18; npc.rarity = 2; + banner = npc.type; + bannerItem = mod.ItemType("CnidrionBanner"); } public override float SpawnChance(NPCSpawnInfo spawnInfo) { - if (spawnInfo.playerSafe) + if (spawnInfo.playerSafe || spawnInfo.player.GetModPlayer(mod).ZoneSunkenSea) { return 0f; } diff --git a/NPCs/NormalNPCs/CosmicElemental.cs b/NPCs/NormalNPCs/CosmicElemental.cs index f18cc2173d..c29d173542 100644 --- a/NPCs/NormalNPCs/CosmicElemental.cs +++ b/NPCs/NormalNPCs/CosmicElemental.cs @@ -32,11 +32,13 @@ namespace CalamityMod.NPCs.NormalNPCs npc.value = Item.buyPrice(0, 0, 3, 0); npc.HitSound = SoundID.NPCHit7; npc.DeathSound = SoundID.NPCDeath6; + banner = npc.type; + bannerItem = mod.ItemType("CnidrionBanner"); } public override float SpawnChance(NPCSpawnInfo spawnInfo) { - if (spawnInfo.playerSafe || spawnInfo.player.GetModPlayer(mod).ZoneAbyss) + if (spawnInfo.playerSafe || spawnInfo.player.GetModPlayer(mod).ZoneAbyss || spawnInfo.player.GetModPlayer(mod).ZoneSunkenSea) { return 0f; } diff --git a/NPCs/NormalNPCs/CrawlerAmber.cs b/NPCs/NormalNPCs/CrawlerAmber.cs index 48cd199fa9..fdaa706841 100644 --- a/NPCs/NormalNPCs/CrawlerAmber.cs +++ b/NPCs/NormalNPCs/CrawlerAmber.cs @@ -12,6 +12,8 @@ namespace CalamityMod.NPCs.NormalNPCs { public class CrawlerAmber : ModNPC { + private bool detected = false; + public override void SetStaticDefaults() { DisplayName.SetDefault("Amber Crawler"); @@ -21,23 +23,217 @@ namespace CalamityMod.NPCs.NormalNPCs public override void SetDefaults() { npc.npcSlots = 0.3f; - npc.aiStyle = 3; + npc.aiStyle = -1; + aiType = -1; npc.damage = 25; npc.width = 44; //324 npc.height = 34; //216 npc.defense = 18; - npc.lifeMax = 60; + npc.lifeMax = 90; npc.knockBackResist = 0.3f; - animationType = 257; - aiType = NPCID.AnomuraFungus; npc.value = Item.buyPrice(0, 0, 0, 80); - npc.HitSound = SoundID.NPCHit1; + npc.HitSound = SoundID.NPCHit33; npc.DeathSound = SoundID.NPCDeath36; + banner = npc.type; + bannerItem = mod.ItemType("AmberCrawlerBanner"); + } + + public override void FindFrame(int frameHeight) + { + if (!detected) + { + npc.frame.Y = frameHeight * 4; + npc.frameCounter = 0.0; + return; + } + npc.spriteDirection = -npc.direction; + npc.frameCounter += (double)(npc.velocity.Length() / 8f); + if (npc.frameCounter > 2.0) + { + npc.frame.Y = npc.frame.Y + frameHeight; + npc.frameCounter = 0.0; + } + if (npc.frame.Y >= frameHeight * 3) + { + npc.frame.Y = 0; + } + } + + public override void AI() + { + if (!detected) + npc.TargetClosest(true); + if (((Main.player[npc.target].Center - npc.Center).Length() < 100f && Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, + Main.player[npc.target].width, Main.player[npc.target].height)) || npc.justHit) + detected = true; + if (!detected) + return; + int num19 = 30; + int num20 = 10; + bool flag19 = false; + bool flag20 = false; + bool flag30 = false; + if (npc.velocity.Y == 0f && ((npc.velocity.X > 0f && npc.direction > 0) || (npc.velocity.X < 0f && npc.direction < 0))) + { + flag20 = true; + npc.ai[3] += 1f; + } + if ((npc.position.X == npc.oldPosition.X || npc.ai[3] >= (float)num19) | flag20) + { + npc.ai[3] += 1f; + flag30 = true; + } + else if (npc.ai[3] > 0f) + { + npc.ai[3] -= 1f; + } + if (npc.ai[3] > (float)(num19 * num20)) + { + npc.ai[3] = 0f; + } + if (npc.justHit) + { + npc.ai[3] = 0f; + } + if (npc.ai[3] == (float)num19) + { + npc.netUpdate = true; + } + Vector2 vector19 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float arg_31B_0 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector19.X; + float num30 = Main.player[npc.target].position.Y - vector19.Y; + float num40 = (float)Math.Sqrt((double)(arg_31B_0 * arg_31B_0 + num30 * num30)); + if (num40 < 200f && !flag30) + { + npc.ai[3] = 0f; + } + if (npc.ai[3] < (float)num19) + { + npc.TargetClosest(true); + } + else + { + if (npc.velocity.X == 0f) + { + if (npc.velocity.Y == 0f) + { + npc.ai[0] += 1f; + if (npc.ai[0] >= 2f) + { + npc.direction *= -1; + npc.spriteDirection = -npc.direction; + npc.ai[0] = 0f; + } + } + } + else + { + npc.ai[0] = 0f; + } + npc.directionY = -1; + if (npc.direction == 0) + { + npc.direction = 1; + } + } + float num6 = 5f; //5 + float num70 = 0.05f; //0.05 + if (!flag19 && (npc.velocity.Y == 0f || npc.wet || (npc.velocity.X <= 0f && npc.direction > 0) || (npc.velocity.X >= 0f && npc.direction < 0))) + { + if (npc.velocity.X < -num6 || npc.velocity.X > num6) + { + if (npc.velocity.Y == 0f) + { + npc.velocity *= 0.8f; + } + } + else if (npc.velocity.X < num6 && npc.direction == -1) + { + npc.velocity.X = npc.velocity.X + num70; + if (npc.velocity.X > num6) + { + npc.velocity.X = num6; + } + } + else if (npc.velocity.X > -num6 && npc.direction == 1) + { + npc.velocity.X = npc.velocity.X - num70; + if (npc.velocity.X < -num6) + { + npc.velocity.X = -num6; + } + } + } + if (npc.velocity.Y >= 0f) + { + int num9 = 0; + if (npc.velocity.X < 0f) + { + num9 = -1; + } + if (npc.velocity.X > 0f) + { + num9 = 1; + } + Vector2 position = npc.position; + position.X += npc.velocity.X; + int num10 = (int)((position.X + (float)(npc.width / 2) + (float)((npc.width / 2 + 1) * num9)) / 16f); + int num11 = (int)((position.Y + (float)npc.height - 1f) / 16f); + if (Main.tile[num10, num11] == null) + { + Main.tile[num10, num11] = new Tile(); + } + if (Main.tile[num10, num11 - 1] == null) + { + Main.tile[num10, num11 - 1] = new Tile(); + } + if (Main.tile[num10, num11 - 2] == null) + { + Main.tile[num10, num11 - 2] = new Tile(); + } + if (Main.tile[num10, num11 - 3] == null) + { + Main.tile[num10, num11 - 3] = new Tile(); + } + if (Main.tile[num10, num11 + 1] == null) + { + Main.tile[num10, num11 + 1] = new Tile(); + } + if ((float)(num10 * 16) < position.X + (float)npc.width && (float)(num10 * 16 + 16) > position.X && ((Main.tile[num10, num11].nactive() && !Main.tile[num10, num11].topSlope() && !Main.tile[num10, num11 - 1].topSlope() && Main.tileSolid[(int)Main.tile[num10, num11].type] && !Main.tileSolidTop[(int)Main.tile[num10, num11].type]) || (Main.tile[num10, num11 - 1].halfBrick() && Main.tile[num10, num11 - 1].nactive())) && (!Main.tile[num10, num11 - 1].nactive() || !Main.tileSolid[(int)Main.tile[num10, num11 - 1].type] || Main.tileSolidTop[(int)Main.tile[num10, num11 - 1].type] || (Main.tile[num10, num11 - 1].halfBrick() && (!Main.tile[num10, num11 - 4].nactive() || !Main.tileSolid[(int)Main.tile[num10, num11 - 4].type] || Main.tileSolidTop[(int)Main.tile[num10, num11 - 4].type]))) && (!Main.tile[num10, num11 - 2].nactive() || !Main.tileSolid[(int)Main.tile[num10, num11 - 2].type] || Main.tileSolidTop[(int)Main.tile[num10, num11 - 2].type]) && (!Main.tile[num10, num11 - 3].nactive() || !Main.tileSolid[(int)Main.tile[num10, num11 - 3].type] || Main.tileSolidTop[(int)Main.tile[num10, num11 - 3].type]) && (!Main.tile[num10 - num9, num11 - 3].nactive() || !Main.tileSolid[(int)Main.tile[num10 - num9, num11 - 3].type])) + { + float num12 = (float)(num11 * 16); + if (Main.tile[num10, num11].halfBrick()) + { + num12 += 8f; + } + if (Main.tile[num10, num11 - 1].halfBrick()) + { + num12 -= 8f; + } + if (num12 < position.Y + (float)npc.height) + { + float num13 = position.Y + (float)npc.height - num12; + if ((double)num13 <= 16.1) + { + npc.gfxOffY += npc.position.Y + (float)npc.height - num12; + npc.position.Y = num12 - (float)npc.height; + if (num13 < 9f) + { + npc.stepSpeed = 1f; + } + else + { + npc.stepSpeed = 2f; + } + } + } + } + } } public override float SpawnChance(NPCSpawnInfo spawnInfo) { - if (spawnInfo.playerSafe) + if (spawnInfo.playerSafe || spawnInfo.player.GetModPlayer(mod).ZoneSunkenSea) { return 0f; } diff --git a/NPCs/NormalNPCs/CrawlerAmber.png b/NPCs/NormalNPCs/CrawlerAmber.png index bba6d9d222..c2dfa8167f 100644 Binary files a/NPCs/NormalNPCs/CrawlerAmber.png and b/NPCs/NormalNPCs/CrawlerAmber.png differ diff --git a/NPCs/NormalNPCs/CrawlerAmethyst.cs b/NPCs/NormalNPCs/CrawlerAmethyst.cs index 4d5408903f..cc6aa44574 100644 --- a/NPCs/NormalNPCs/CrawlerAmethyst.cs +++ b/NPCs/NormalNPCs/CrawlerAmethyst.cs @@ -12,6 +12,8 @@ namespace CalamityMod.NPCs.NormalNPCs { public class CrawlerAmethyst : ModNPC { + private bool detected = false; + public override void SetStaticDefaults() { DisplayName.SetDefault("Amethyst Crawler"); @@ -21,23 +23,217 @@ namespace CalamityMod.NPCs.NormalNPCs public override void SetDefaults() { npc.npcSlots = 0.3f; - npc.aiStyle = 3; + npc.aiStyle = -1; npc.damage = 15; npc.width = 44; //324 npc.height = 34; //216 npc.defense = 8; - npc.lifeMax = 40; + npc.lifeMax = 60; npc.knockBackResist = 0.75f; - animationType = 257; - aiType = NPCID.AnomuraFungus; + aiType = -1; npc.value = Item.buyPrice(0, 0, 0, 30); - npc.HitSound = SoundID.NPCHit1; + npc.HitSound = SoundID.NPCHit33; npc.DeathSound = SoundID.NPCDeath36; + banner = npc.type; + bannerItem = mod.ItemType("AmethystCrawlerBanner"); } - + + public override void FindFrame(int frameHeight) + { + if (!detected) + { + npc.frame.Y = frameHeight * 4; + npc.frameCounter = 0.0; + return; + } + npc.spriteDirection = -npc.direction; + npc.frameCounter += (double)(npc.velocity.Length() / 8f); + if (npc.frameCounter > 2.0) + { + npc.frame.Y = npc.frame.Y + frameHeight; + npc.frameCounter = 0.0; + } + if (npc.frame.Y >= frameHeight * 3) + { + npc.frame.Y = 0; + } + } + + public override void AI() + { + if (!detected) + npc.TargetClosest(true); + if (((Main.player[npc.target].Center - npc.Center).Length() < 100f && Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, + Main.player[npc.target].width, Main.player[npc.target].height)) || npc.justHit) + detected = true; + if (!detected) + return; + int num19 = 30; + int num20 = 10; + bool flag19 = false; + bool flag20 = false; + bool flag30 = false; + if (npc.velocity.Y == 0f && ((npc.velocity.X > 0f && npc.direction > 0) || (npc.velocity.X < 0f && npc.direction < 0))) + { + flag20 = true; + npc.ai[3] += 1f; + } + if ((npc.position.X == npc.oldPosition.X || npc.ai[3] >= (float)num19) | flag20) + { + npc.ai[3] += 1f; + flag30 = true; + } + else if (npc.ai[3] > 0f) + { + npc.ai[3] -= 1f; + } + if (npc.ai[3] > (float)(num19 * num20)) + { + npc.ai[3] = 0f; + } + if (npc.justHit) + { + npc.ai[3] = 0f; + } + if (npc.ai[3] == (float)num19) + { + npc.netUpdate = true; + } + Vector2 vector19 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float arg_31B_0 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector19.X; + float num30 = Main.player[npc.target].position.Y - vector19.Y; + float num40 = (float)Math.Sqrt((double)(arg_31B_0 * arg_31B_0 + num30 * num30)); + if (num40 < 200f && !flag30) + { + npc.ai[3] = 0f; + } + if (npc.ai[3] < (float)num19) + { + npc.TargetClosest(true); + } + else + { + if (npc.velocity.X == 0f) + { + if (npc.velocity.Y == 0f) + { + npc.ai[0] += 1f; + if (npc.ai[0] >= 2f) + { + npc.direction *= -1; + npc.spriteDirection = -npc.direction; + npc.ai[0] = 0f; + } + } + } + else + { + npc.ai[0] = 0f; + } + npc.directionY = -1; + if (npc.direction == 0) + { + npc.direction = 1; + } + } + float num6 = 4.5f; //5 + float num70 = 0.045f; //0.05 + if (!flag19 && (npc.velocity.Y == 0f || npc.wet || (npc.velocity.X <= 0f && npc.direction > 0) || (npc.velocity.X >= 0f && npc.direction < 0))) + { + if (npc.velocity.X < -num6 || npc.velocity.X > num6) + { + if (npc.velocity.Y == 0f) + { + npc.velocity *= 0.8f; + } + } + else if (npc.velocity.X < num6 && npc.direction == -1) + { + npc.velocity.X = npc.velocity.X + num70; + if (npc.velocity.X > num6) + { + npc.velocity.X = num6; + } + } + else if (npc.velocity.X > -num6 && npc.direction == 1) + { + npc.velocity.X = npc.velocity.X - num70; + if (npc.velocity.X < -num6) + { + npc.velocity.X = -num6; + } + } + } + if (npc.velocity.Y >= 0f) + { + int num9 = 0; + if (npc.velocity.X < 0f) + { + num9 = -1; + } + if (npc.velocity.X > 0f) + { + num9 = 1; + } + Vector2 position = npc.position; + position.X += npc.velocity.X; + int num10 = (int)((position.X + (float)(npc.width / 2) + (float)((npc.width / 2 + 1) * num9)) / 16f); + int num11 = (int)((position.Y + (float)npc.height - 1f) / 16f); + if (Main.tile[num10, num11] == null) + { + Main.tile[num10, num11] = new Tile(); + } + if (Main.tile[num10, num11 - 1] == null) + { + Main.tile[num10, num11 - 1] = new Tile(); + } + if (Main.tile[num10, num11 - 2] == null) + { + Main.tile[num10, num11 - 2] = new Tile(); + } + if (Main.tile[num10, num11 - 3] == null) + { + Main.tile[num10, num11 - 3] = new Tile(); + } + if (Main.tile[num10, num11 + 1] == null) + { + Main.tile[num10, num11 + 1] = new Tile(); + } + if ((float)(num10 * 16) < position.X + (float)npc.width && (float)(num10 * 16 + 16) > position.X && ((Main.tile[num10, num11].nactive() && !Main.tile[num10, num11].topSlope() && !Main.tile[num10, num11 - 1].topSlope() && Main.tileSolid[(int)Main.tile[num10, num11].type] && !Main.tileSolidTop[(int)Main.tile[num10, num11].type]) || (Main.tile[num10, num11 - 1].halfBrick() && Main.tile[num10, num11 - 1].nactive())) && (!Main.tile[num10, num11 - 1].nactive() || !Main.tileSolid[(int)Main.tile[num10, num11 - 1].type] || Main.tileSolidTop[(int)Main.tile[num10, num11 - 1].type] || (Main.tile[num10, num11 - 1].halfBrick() && (!Main.tile[num10, num11 - 4].nactive() || !Main.tileSolid[(int)Main.tile[num10, num11 - 4].type] || Main.tileSolidTop[(int)Main.tile[num10, num11 - 4].type]))) && (!Main.tile[num10, num11 - 2].nactive() || !Main.tileSolid[(int)Main.tile[num10, num11 - 2].type] || Main.tileSolidTop[(int)Main.tile[num10, num11 - 2].type]) && (!Main.tile[num10, num11 - 3].nactive() || !Main.tileSolid[(int)Main.tile[num10, num11 - 3].type] || Main.tileSolidTop[(int)Main.tile[num10, num11 - 3].type]) && (!Main.tile[num10 - num9, num11 - 3].nactive() || !Main.tileSolid[(int)Main.tile[num10 - num9, num11 - 3].type])) + { + float num12 = (float)(num11 * 16); + if (Main.tile[num10, num11].halfBrick()) + { + num12 += 8f; + } + if (Main.tile[num10, num11 - 1].halfBrick()) + { + num12 -= 8f; + } + if (num12 < position.Y + (float)npc.height) + { + float num13 = position.Y + (float)npc.height - num12; + if ((double)num13 <= 16.1) + { + npc.gfxOffY += npc.position.Y + (float)npc.height - num12; + npc.position.Y = num12 - (float)npc.height; + if (num13 < 9f) + { + npc.stepSpeed = 1f; + } + else + { + npc.stepSpeed = 2f; + } + } + } + } + } + } + public override float SpawnChance(NPCSpawnInfo spawnInfo) { - if (spawnInfo.playerSafe || spawnInfo.player.GetModPlayer(mod).ZoneAbyss) + if (spawnInfo.playerSafe || spawnInfo.player.GetModPlayer(mod).ZoneAbyss || spawnInfo.player.GetModPlayer(mod).ZoneSunkenSea) { return 0f; } diff --git a/NPCs/NormalNPCs/CrawlerAmethyst.png b/NPCs/NormalNPCs/CrawlerAmethyst.png index 7d8ccb316e..d7c1543dda 100644 Binary files a/NPCs/NormalNPCs/CrawlerAmethyst.png and b/NPCs/NormalNPCs/CrawlerAmethyst.png differ diff --git a/NPCs/NormalNPCs/CrawlerCrystal.cs b/NPCs/NormalNPCs/CrawlerCrystal.cs index d78b547600..4d00c3bdcf 100644 --- a/NPCs/NormalNPCs/CrawlerCrystal.cs +++ b/NPCs/NormalNPCs/CrawlerCrystal.cs @@ -12,6 +12,8 @@ namespace CalamityMod.NPCs.NormalNPCs { public class CrawlerCrystal : ModNPC { + private bool detected = false; + public override void SetStaticDefaults() { DisplayName.SetDefault("Crystal Crawler"); @@ -21,23 +23,217 @@ namespace CalamityMod.NPCs.NormalNPCs public override void SetDefaults() { npc.npcSlots = 0.3f; - npc.aiStyle = 3; + npc.aiStyle = -1; npc.damage = 35; npc.width = 44; //324 npc.height = 34; //216 npc.defense = 18; - npc.lifeMax = 200; + npc.lifeMax = 300; npc.knockBackResist = 0.15f; - animationType = 257; - aiType = NPCID.AnomuraFungus; + aiType = -1; npc.value = Item.buyPrice(0, 0, 5, 0); - npc.HitSound = SoundID.NPCHit1; + npc.HitSound = SoundID.NPCHit33; npc.DeathSound = SoundID.NPCDeath36; + banner = npc.type; + bannerItem = mod.ItemType("CrystalCrawlerBanner"); } - + + public override void FindFrame(int frameHeight) + { + if (!detected) + { + npc.frame.Y = frameHeight * 4; + npc.frameCounter = 0.0; + return; + } + npc.spriteDirection = -npc.direction; + npc.frameCounter += (double)(npc.velocity.Length() / 8f); + if (npc.frameCounter > 2.0) + { + npc.frame.Y = npc.frame.Y + frameHeight; + npc.frameCounter = 0.0; + } + if (npc.frame.Y >= frameHeight * 3) + { + npc.frame.Y = 0; + } + } + + public override void AI() + { + if (!detected) + npc.TargetClosest(true); + if (((Main.player[npc.target].Center - npc.Center).Length() < 100f && Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, + Main.player[npc.target].width, Main.player[npc.target].height)) || npc.justHit) + detected = true; + if (!detected) + return; + int num19 = 30; + int num20 = 10; + bool flag19 = false; + bool flag20 = false; + bool flag30 = false; + if (npc.velocity.Y == 0f && ((npc.velocity.X > 0f && npc.direction > 0) || (npc.velocity.X < 0f && npc.direction < 0))) + { + flag20 = true; + npc.ai[3] += 1f; + } + if ((npc.position.X == npc.oldPosition.X || npc.ai[3] >= (float)num19) | flag20) + { + npc.ai[3] += 1f; + flag30 = true; + } + else if (npc.ai[3] > 0f) + { + npc.ai[3] -= 1f; + } + if (npc.ai[3] > (float)(num19 * num20)) + { + npc.ai[3] = 0f; + } + if (npc.justHit) + { + npc.ai[3] = 0f; + } + if (npc.ai[3] == (float)num19) + { + npc.netUpdate = true; + } + Vector2 vector19 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float arg_31B_0 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector19.X; + float num30 = Main.player[npc.target].position.Y - vector19.Y; + float num40 = (float)Math.Sqrt((double)(arg_31B_0 * arg_31B_0 + num30 * num30)); + if (num40 < 200f && !flag30) + { + npc.ai[3] = 0f; + } + if (npc.ai[3] < (float)num19) + { + npc.TargetClosest(true); + } + else + { + if (npc.velocity.X == 0f) + { + if (npc.velocity.Y == 0f) + { + npc.ai[0] += 1f; + if (npc.ai[0] >= 2f) + { + npc.direction *= -1; + npc.spriteDirection = -npc.direction; + npc.ai[0] = 0f; + } + } + } + else + { + npc.ai[0] = 0f; + } + npc.directionY = -1; + if (npc.direction == 0) + { + npc.direction = 1; + } + } + float num6 = 7f; //5 + float num70 = 0.07f; //0.05 + if (!flag19 && (npc.velocity.Y == 0f || npc.wet || (npc.velocity.X <= 0f && npc.direction > 0) || (npc.velocity.X >= 0f && npc.direction < 0))) + { + if (npc.velocity.X < -num6 || npc.velocity.X > num6) + { + if (npc.velocity.Y == 0f) + { + npc.velocity *= 0.8f; + } + } + else if (npc.velocity.X < num6 && npc.direction == -1) + { + npc.velocity.X = npc.velocity.X + num70; + if (npc.velocity.X > num6) + { + npc.velocity.X = num6; + } + } + else if (npc.velocity.X > -num6 && npc.direction == 1) + { + npc.velocity.X = npc.velocity.X - num70; + if (npc.velocity.X < -num6) + { + npc.velocity.X = -num6; + } + } + } + if (npc.velocity.Y >= 0f) + { + int num9 = 0; + if (npc.velocity.X < 0f) + { + num9 = -1; + } + if (npc.velocity.X > 0f) + { + num9 = 1; + } + Vector2 position = npc.position; + position.X += npc.velocity.X; + int num10 = (int)((position.X + (float)(npc.width / 2) + (float)((npc.width / 2 + 1) * num9)) / 16f); + int num11 = (int)((position.Y + (float)npc.height - 1f) / 16f); + if (Main.tile[num10, num11] == null) + { + Main.tile[num10, num11] = new Tile(); + } + if (Main.tile[num10, num11 - 1] == null) + { + Main.tile[num10, num11 - 1] = new Tile(); + } + if (Main.tile[num10, num11 - 2] == null) + { + Main.tile[num10, num11 - 2] = new Tile(); + } + if (Main.tile[num10, num11 - 3] == null) + { + Main.tile[num10, num11 - 3] = new Tile(); + } + if (Main.tile[num10, num11 + 1] == null) + { + Main.tile[num10, num11 + 1] = new Tile(); + } + if ((float)(num10 * 16) < position.X + (float)npc.width && (float)(num10 * 16 + 16) > position.X && ((Main.tile[num10, num11].nactive() && !Main.tile[num10, num11].topSlope() && !Main.tile[num10, num11 - 1].topSlope() && Main.tileSolid[(int)Main.tile[num10, num11].type] && !Main.tileSolidTop[(int)Main.tile[num10, num11].type]) || (Main.tile[num10, num11 - 1].halfBrick() && Main.tile[num10, num11 - 1].nactive())) && (!Main.tile[num10, num11 - 1].nactive() || !Main.tileSolid[(int)Main.tile[num10, num11 - 1].type] || Main.tileSolidTop[(int)Main.tile[num10, num11 - 1].type] || (Main.tile[num10, num11 - 1].halfBrick() && (!Main.tile[num10, num11 - 4].nactive() || !Main.tileSolid[(int)Main.tile[num10, num11 - 4].type] || Main.tileSolidTop[(int)Main.tile[num10, num11 - 4].type]))) && (!Main.tile[num10, num11 - 2].nactive() || !Main.tileSolid[(int)Main.tile[num10, num11 - 2].type] || Main.tileSolidTop[(int)Main.tile[num10, num11 - 2].type]) && (!Main.tile[num10, num11 - 3].nactive() || !Main.tileSolid[(int)Main.tile[num10, num11 - 3].type] || Main.tileSolidTop[(int)Main.tile[num10, num11 - 3].type]) && (!Main.tile[num10 - num9, num11 - 3].nactive() || !Main.tileSolid[(int)Main.tile[num10 - num9, num11 - 3].type])) + { + float num12 = (float)(num11 * 16); + if (Main.tile[num10, num11].halfBrick()) + { + num12 += 8f; + } + if (Main.tile[num10, num11 - 1].halfBrick()) + { + num12 -= 8f; + } + if (num12 < position.Y + (float)npc.height) + { + float num13 = position.Y + (float)npc.height - num12; + if ((double)num13 <= 16.1) + { + npc.gfxOffY += npc.position.Y + (float)npc.height - num12; + npc.position.Y = num12 - (float)npc.height; + if (num13 < 9f) + { + npc.stepSpeed = 1f; + } + else + { + npc.stepSpeed = 2f; + } + } + } + } + } + } + public override float SpawnChance(NPCSpawnInfo spawnInfo) { - if (spawnInfo.playerSafe || spawnInfo.player.GetModPlayer(mod).ZoneAbyss) + if (spawnInfo.playerSafe || spawnInfo.player.GetModPlayer(mod).ZoneAbyss || spawnInfo.player.GetModPlayer(mod).ZoneSunkenSea) { return 0f; } diff --git a/NPCs/NormalNPCs/CrawlerCrystal.png b/NPCs/NormalNPCs/CrawlerCrystal.png index a52cec199e..57abddbd8a 100644 Binary files a/NPCs/NormalNPCs/CrawlerCrystal.png and b/NPCs/NormalNPCs/CrawlerCrystal.png differ diff --git a/NPCs/NormalNPCs/CrawlerDiamond.cs b/NPCs/NormalNPCs/CrawlerDiamond.cs index da84404a08..d9a2f74d77 100644 --- a/NPCs/NormalNPCs/CrawlerDiamond.cs +++ b/NPCs/NormalNPCs/CrawlerDiamond.cs @@ -12,6 +12,8 @@ namespace CalamityMod.NPCs.NormalNPCs { public class CrawlerDiamond : ModNPC { + private bool detected = false; + public override void SetStaticDefaults() { DisplayName.SetDefault("Diamond Crawler"); @@ -21,23 +23,217 @@ namespace CalamityMod.NPCs.NormalNPCs public override void SetDefaults() { npc.npcSlots = 0.3f; - npc.aiStyle = 3; + npc.aiStyle = -1; npc.damage = 24; npc.width = 44; //324 npc.height = 34; //216 npc.defense = 16; - npc.lifeMax = 100; + npc.lifeMax = 150; npc.knockBackResist = 0.35f; - animationType = 257; - aiType = NPCID.AnomuraFungus; + aiType = -1; npc.value = Item.buyPrice(0, 0, 2, 0); - npc.HitSound = SoundID.NPCHit1; + npc.HitSound = SoundID.NPCHit33; npc.DeathSound = SoundID.NPCDeath36; + banner = npc.type; + bannerItem = mod.ItemType("DiamondCrawlerBanner"); } - + + public override void FindFrame(int frameHeight) + { + if (!detected) + { + npc.frame.Y = frameHeight * 4; + npc.frameCounter = 0.0; + return; + } + npc.spriteDirection = -npc.direction; + npc.frameCounter += (double)(npc.velocity.Length() / 8f); + if (npc.frameCounter > 2.0) + { + npc.frame.Y = npc.frame.Y + frameHeight; + npc.frameCounter = 0.0; + } + if (npc.frame.Y >= frameHeight * 3) + { + npc.frame.Y = 0; + } + } + + public override void AI() + { + if (!detected) + npc.TargetClosest(true); + if (((Main.player[npc.target].Center - npc.Center).Length() < 100f && Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, + Main.player[npc.target].width, Main.player[npc.target].height)) || npc.justHit) + detected = true; + if (!detected) + return; + int num19 = 30; + int num20 = 10; + bool flag19 = false; + bool flag20 = false; + bool flag30 = false; + if (npc.velocity.Y == 0f && ((npc.velocity.X > 0f && npc.direction > 0) || (npc.velocity.X < 0f && npc.direction < 0))) + { + flag20 = true; + npc.ai[3] += 1f; + } + if ((npc.position.X == npc.oldPosition.X || npc.ai[3] >= (float)num19) | flag20) + { + npc.ai[3] += 1f; + flag30 = true; + } + else if (npc.ai[3] > 0f) + { + npc.ai[3] -= 1f; + } + if (npc.ai[3] > (float)(num19 * num20)) + { + npc.ai[3] = 0f; + } + if (npc.justHit) + { + npc.ai[3] = 0f; + } + if (npc.ai[3] == (float)num19) + { + npc.netUpdate = true; + } + Vector2 vector19 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float arg_31B_0 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector19.X; + float num30 = Main.player[npc.target].position.Y - vector19.Y; + float num40 = (float)Math.Sqrt((double)(arg_31B_0 * arg_31B_0 + num30 * num30)); + if (num40 < 200f && !flag30) + { + npc.ai[3] = 0f; + } + if (npc.ai[3] < (float)num19) + { + npc.TargetClosest(true); + } + else + { + if (npc.velocity.X == 0f) + { + if (npc.velocity.Y == 0f) + { + npc.ai[0] += 1f; + if (npc.ai[0] >= 2f) + { + npc.direction *= -1; + npc.spriteDirection = -npc.direction; + npc.ai[0] = 0f; + } + } + } + else + { + npc.ai[0] = 0f; + } + npc.directionY = -1; + if (npc.direction == 0) + { + npc.direction = 1; + } + } + float num6 = 6f; //5 + float num70 = 0.06f; //0.05 + if (!flag19 && (npc.velocity.Y == 0f || npc.wet || (npc.velocity.X <= 0f && npc.direction > 0) || (npc.velocity.X >= 0f && npc.direction < 0))) + { + if (npc.velocity.X < -num6 || npc.velocity.X > num6) + { + if (npc.velocity.Y == 0f) + { + npc.velocity *= 0.8f; + } + } + else if (npc.velocity.X < num6 && npc.direction == -1) + { + npc.velocity.X = npc.velocity.X + num70; + if (npc.velocity.X > num6) + { + npc.velocity.X = num6; + } + } + else if (npc.velocity.X > -num6 && npc.direction == 1) + { + npc.velocity.X = npc.velocity.X - num70; + if (npc.velocity.X < -num6) + { + npc.velocity.X = -num6; + } + } + } + if (npc.velocity.Y >= 0f) + { + int num9 = 0; + if (npc.velocity.X < 0f) + { + num9 = -1; + } + if (npc.velocity.X > 0f) + { + num9 = 1; + } + Vector2 position = npc.position; + position.X += npc.velocity.X; + int num10 = (int)((position.X + (float)(npc.width / 2) + (float)((npc.width / 2 + 1) * num9)) / 16f); + int num11 = (int)((position.Y + (float)npc.height - 1f) / 16f); + if (Main.tile[num10, num11] == null) + { + Main.tile[num10, num11] = new Tile(); + } + if (Main.tile[num10, num11 - 1] == null) + { + Main.tile[num10, num11 - 1] = new Tile(); + } + if (Main.tile[num10, num11 - 2] == null) + { + Main.tile[num10, num11 - 2] = new Tile(); + } + if (Main.tile[num10, num11 - 3] == null) + { + Main.tile[num10, num11 - 3] = new Tile(); + } + if (Main.tile[num10, num11 + 1] == null) + { + Main.tile[num10, num11 + 1] = new Tile(); + } + if ((float)(num10 * 16) < position.X + (float)npc.width && (float)(num10 * 16 + 16) > position.X && ((Main.tile[num10, num11].nactive() && !Main.tile[num10, num11].topSlope() && !Main.tile[num10, num11 - 1].topSlope() && Main.tileSolid[(int)Main.tile[num10, num11].type] && !Main.tileSolidTop[(int)Main.tile[num10, num11].type]) || (Main.tile[num10, num11 - 1].halfBrick() && Main.tile[num10, num11 - 1].nactive())) && (!Main.tile[num10, num11 - 1].nactive() || !Main.tileSolid[(int)Main.tile[num10, num11 - 1].type] || Main.tileSolidTop[(int)Main.tile[num10, num11 - 1].type] || (Main.tile[num10, num11 - 1].halfBrick() && (!Main.tile[num10, num11 - 4].nactive() || !Main.tileSolid[(int)Main.tile[num10, num11 - 4].type] || Main.tileSolidTop[(int)Main.tile[num10, num11 - 4].type]))) && (!Main.tile[num10, num11 - 2].nactive() || !Main.tileSolid[(int)Main.tile[num10, num11 - 2].type] || Main.tileSolidTop[(int)Main.tile[num10, num11 - 2].type]) && (!Main.tile[num10, num11 - 3].nactive() || !Main.tileSolid[(int)Main.tile[num10, num11 - 3].type] || Main.tileSolidTop[(int)Main.tile[num10, num11 - 3].type]) && (!Main.tile[num10 - num9, num11 - 3].nactive() || !Main.tileSolid[(int)Main.tile[num10 - num9, num11 - 3].type])) + { + float num12 = (float)(num11 * 16); + if (Main.tile[num10, num11].halfBrick()) + { + num12 += 8f; + } + if (Main.tile[num10, num11 - 1].halfBrick()) + { + num12 -= 8f; + } + if (num12 < position.Y + (float)npc.height) + { + float num13 = position.Y + (float)npc.height - num12; + if ((double)num13 <= 16.1) + { + npc.gfxOffY += npc.position.Y + (float)npc.height - num12; + npc.position.Y = num12 - (float)npc.height; + if (num13 < 9f) + { + npc.stepSpeed = 1f; + } + else + { + npc.stepSpeed = 2f; + } + } + } + } + } + } + public override float SpawnChance(NPCSpawnInfo spawnInfo) { - if (spawnInfo.playerSafe || spawnInfo.player.GetModPlayer(mod).ZoneAbyss) + if (spawnInfo.playerSafe || spawnInfo.player.GetModPlayer(mod).ZoneAbyss || spawnInfo.player.GetModPlayer(mod).ZoneSunkenSea) { return 0f; } diff --git a/NPCs/NormalNPCs/CrawlerDiamond.png b/NPCs/NormalNPCs/CrawlerDiamond.png index 559879b9e2..b15cedb34c 100644 Binary files a/NPCs/NormalNPCs/CrawlerDiamond.png and b/NPCs/NormalNPCs/CrawlerDiamond.png differ diff --git a/NPCs/NormalNPCs/CrawlerEmerald.cs b/NPCs/NormalNPCs/CrawlerEmerald.cs index 0f76fb97c0..061e466842 100644 --- a/NPCs/NormalNPCs/CrawlerEmerald.cs +++ b/NPCs/NormalNPCs/CrawlerEmerald.cs @@ -12,6 +12,8 @@ namespace CalamityMod.NPCs.NormalNPCs { public class CrawlerEmerald : ModNPC { + private bool detected = false; + public override void SetStaticDefaults() { DisplayName.SetDefault("Emerald Crawler"); @@ -21,23 +23,217 @@ namespace CalamityMod.NPCs.NormalNPCs public override void SetDefaults() { npc.npcSlots = 0.3f; - npc.aiStyle = 3; + npc.aiStyle = -1; npc.damage = 20; npc.width = 44; //324 npc.height = 34; //216 npc.defense = 12; - npc.lifeMax = 70; + npc.lifeMax = 105; npc.knockBackResist = 0.55f; - animationType = 257; - aiType = NPCID.AnomuraFungus; + aiType = -1; npc.value = Item.buyPrice(0, 0, 1, 0); - npc.HitSound = SoundID.NPCHit1; + npc.HitSound = SoundID.NPCHit33; npc.DeathSound = SoundID.NPCDeath36; + banner = npc.type; + bannerItem = mod.ItemType("EmeraldCrawlerBanner"); } - + + public override void FindFrame(int frameHeight) + { + if (!detected) + { + npc.frame.Y = frameHeight * 4; + npc.frameCounter = 0.0; + return; + } + npc.spriteDirection = -npc.direction; + npc.frameCounter += (double)(npc.velocity.Length() / 8f); + if (npc.frameCounter > 2.0) + { + npc.frame.Y = npc.frame.Y + frameHeight; + npc.frameCounter = 0.0; + } + if (npc.frame.Y >= frameHeight * 3) + { + npc.frame.Y = 0; + } + } + + public override void AI() + { + if (!detected) + npc.TargetClosest(true); + if (((Main.player[npc.target].Center - npc.Center).Length() < 100f && Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, + Main.player[npc.target].width, Main.player[npc.target].height)) || npc.justHit) + detected = true; + if (!detected) + return; + int num19 = 30; + int num20 = 10; + bool flag19 = false; + bool flag20 = false; + bool flag30 = false; + if (npc.velocity.Y == 0f && ((npc.velocity.X > 0f && npc.direction > 0) || (npc.velocity.X < 0f && npc.direction < 0))) + { + flag20 = true; + npc.ai[3] += 1f; + } + if ((npc.position.X == npc.oldPosition.X || npc.ai[3] >= (float)num19) | flag20) + { + npc.ai[3] += 1f; + flag30 = true; + } + else if (npc.ai[3] > 0f) + { + npc.ai[3] -= 1f; + } + if (npc.ai[3] > (float)(num19 * num20)) + { + npc.ai[3] = 0f; + } + if (npc.justHit) + { + npc.ai[3] = 0f; + } + if (npc.ai[3] == (float)num19) + { + npc.netUpdate = true; + } + Vector2 vector19 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float arg_31B_0 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector19.X; + float num30 = Main.player[npc.target].position.Y - vector19.Y; + float num40 = (float)Math.Sqrt((double)(arg_31B_0 * arg_31B_0 + num30 * num30)); + if (num40 < 200f && !flag30) + { + npc.ai[3] = 0f; + } + if (npc.ai[3] < (float)num19) + { + npc.TargetClosest(true); + } + else + { + if (npc.velocity.X == 0f) + { + if (npc.velocity.Y == 0f) + { + npc.ai[0] += 1f; + if (npc.ai[0] >= 2f) + { + npc.direction *= -1; + npc.spriteDirection = -npc.direction; + npc.ai[0] = 0f; + } + } + } + else + { + npc.ai[0] = 0f; + } + npc.directionY = -1; + if (npc.direction == 0) + { + npc.direction = 1; + } + } + float num6 = 5.5f; //5 + float num70 = 0.055f; //0.05 + if (!flag19 && (npc.velocity.Y == 0f || npc.wet || (npc.velocity.X <= 0f && npc.direction > 0) || (npc.velocity.X >= 0f && npc.direction < 0))) + { + if (npc.velocity.X < -num6 || npc.velocity.X > num6) + { + if (npc.velocity.Y == 0f) + { + npc.velocity *= 0.8f; + } + } + else if (npc.velocity.X < num6 && npc.direction == -1) + { + npc.velocity.X = npc.velocity.X + num70; + if (npc.velocity.X > num6) + { + npc.velocity.X = num6; + } + } + else if (npc.velocity.X > -num6 && npc.direction == 1) + { + npc.velocity.X = npc.velocity.X - num70; + if (npc.velocity.X < -num6) + { + npc.velocity.X = -num6; + } + } + } + if (npc.velocity.Y >= 0f) + { + int num9 = 0; + if (npc.velocity.X < 0f) + { + num9 = -1; + } + if (npc.velocity.X > 0f) + { + num9 = 1; + } + Vector2 position = npc.position; + position.X += npc.velocity.X; + int num10 = (int)((position.X + (float)(npc.width / 2) + (float)((npc.width / 2 + 1) * num9)) / 16f); + int num11 = (int)((position.Y + (float)npc.height - 1f) / 16f); + if (Main.tile[num10, num11] == null) + { + Main.tile[num10, num11] = new Tile(); + } + if (Main.tile[num10, num11 - 1] == null) + { + Main.tile[num10, num11 - 1] = new Tile(); + } + if (Main.tile[num10, num11 - 2] == null) + { + Main.tile[num10, num11 - 2] = new Tile(); + } + if (Main.tile[num10, num11 - 3] == null) + { + Main.tile[num10, num11 - 3] = new Tile(); + } + if (Main.tile[num10, num11 + 1] == null) + { + Main.tile[num10, num11 + 1] = new Tile(); + } + if ((float)(num10 * 16) < position.X + (float)npc.width && (float)(num10 * 16 + 16) > position.X && ((Main.tile[num10, num11].nactive() && !Main.tile[num10, num11].topSlope() && !Main.tile[num10, num11 - 1].topSlope() && Main.tileSolid[(int)Main.tile[num10, num11].type] && !Main.tileSolidTop[(int)Main.tile[num10, num11].type]) || (Main.tile[num10, num11 - 1].halfBrick() && Main.tile[num10, num11 - 1].nactive())) && (!Main.tile[num10, num11 - 1].nactive() || !Main.tileSolid[(int)Main.tile[num10, num11 - 1].type] || Main.tileSolidTop[(int)Main.tile[num10, num11 - 1].type] || (Main.tile[num10, num11 - 1].halfBrick() && (!Main.tile[num10, num11 - 4].nactive() || !Main.tileSolid[(int)Main.tile[num10, num11 - 4].type] || Main.tileSolidTop[(int)Main.tile[num10, num11 - 4].type]))) && (!Main.tile[num10, num11 - 2].nactive() || !Main.tileSolid[(int)Main.tile[num10, num11 - 2].type] || Main.tileSolidTop[(int)Main.tile[num10, num11 - 2].type]) && (!Main.tile[num10, num11 - 3].nactive() || !Main.tileSolid[(int)Main.tile[num10, num11 - 3].type] || Main.tileSolidTop[(int)Main.tile[num10, num11 - 3].type]) && (!Main.tile[num10 - num9, num11 - 3].nactive() || !Main.tileSolid[(int)Main.tile[num10 - num9, num11 - 3].type])) + { + float num12 = (float)(num11 * 16); + if (Main.tile[num10, num11].halfBrick()) + { + num12 += 8f; + } + if (Main.tile[num10, num11 - 1].halfBrick()) + { + num12 -= 8f; + } + if (num12 < position.Y + (float)npc.height) + { + float num13 = position.Y + (float)npc.height - num12; + if ((double)num13 <= 16.1) + { + npc.gfxOffY += npc.position.Y + (float)npc.height - num12; + npc.position.Y = num12 - (float)npc.height; + if (num13 < 9f) + { + npc.stepSpeed = 1f; + } + else + { + npc.stepSpeed = 2f; + } + } + } + } + } + } + public override float SpawnChance(NPCSpawnInfo spawnInfo) { - if (spawnInfo.playerSafe || spawnInfo.player.GetModPlayer(mod).ZoneAbyss) + if (spawnInfo.playerSafe || spawnInfo.player.GetModPlayer(mod).ZoneAbyss || spawnInfo.player.GetModPlayer(mod).ZoneSunkenSea) { return 0f; } diff --git a/NPCs/NormalNPCs/CrawlerEmerald.png b/NPCs/NormalNPCs/CrawlerEmerald.png index 6d4fd6ad59..e54bcd48b8 100644 Binary files a/NPCs/NormalNPCs/CrawlerEmerald.png and b/NPCs/NormalNPCs/CrawlerEmerald.png differ diff --git a/NPCs/NormalNPCs/CrawlerRuby.cs b/NPCs/NormalNPCs/CrawlerRuby.cs index 35a9ad3f63..48f73f4791 100644 --- a/NPCs/NormalNPCs/CrawlerRuby.cs +++ b/NPCs/NormalNPCs/CrawlerRuby.cs @@ -12,6 +12,8 @@ namespace CalamityMod.NPCs.NormalNPCs { public class CrawlerRuby : ModNPC { + private bool detected = false; + public override void SetStaticDefaults() { DisplayName.SetDefault("Ruby Crawler"); @@ -21,23 +23,217 @@ namespace CalamityMod.NPCs.NormalNPCs public override void SetDefaults() { npc.npcSlots = 0.3f; - npc.aiStyle = 3; + npc.aiStyle = -1; npc.damage = 23; npc.width = 44; //324 npc.height = 34; //216 npc.defense = 14; - npc.lifeMax = 90; + npc.lifeMax = 135; npc.knockBackResist = 0.45f; - animationType = 257; - aiType = NPCID.AnomuraFungus; + aiType = -1; npc.value = Item.buyPrice(0, 0, 1, 0); - npc.HitSound = SoundID.NPCHit1; + npc.HitSound = SoundID.NPCHit33; npc.DeathSound = SoundID.NPCDeath36; + banner = npc.type; + bannerItem = mod.ItemType("RubyCrawlerBanner"); } - + + public override void FindFrame(int frameHeight) + { + if (!detected) + { + npc.frame.Y = frameHeight * 4; + npc.frameCounter = 0.0; + return; + } + npc.spriteDirection = -npc.direction; + npc.frameCounter += (double)(npc.velocity.Length() / 8f); + if (npc.frameCounter > 2.0) + { + npc.frame.Y = npc.frame.Y + frameHeight; + npc.frameCounter = 0.0; + } + if (npc.frame.Y >= frameHeight * 3) + { + npc.frame.Y = 0; + } + } + + public override void AI() + { + if (!detected) + npc.TargetClosest(true); + if (((Main.player[npc.target].Center - npc.Center).Length() < 100f && Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, + Main.player[npc.target].width, Main.player[npc.target].height)) || npc.justHit) + detected = true; + if (!detected) + return; + int num19 = 30; + int num20 = 10; + bool flag19 = false; + bool flag20 = false; + bool flag30 = false; + if (npc.velocity.Y == 0f && ((npc.velocity.X > 0f && npc.direction > 0) || (npc.velocity.X < 0f && npc.direction < 0))) + { + flag20 = true; + npc.ai[3] += 1f; + } + if ((npc.position.X == npc.oldPosition.X || npc.ai[3] >= (float)num19) | flag20) + { + npc.ai[3] += 1f; + flag30 = true; + } + else if (npc.ai[3] > 0f) + { + npc.ai[3] -= 1f; + } + if (npc.ai[3] > (float)(num19 * num20)) + { + npc.ai[3] = 0f; + } + if (npc.justHit) + { + npc.ai[3] = 0f; + } + if (npc.ai[3] == (float)num19) + { + npc.netUpdate = true; + } + Vector2 vector19 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float arg_31B_0 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector19.X; + float num30 = Main.player[npc.target].position.Y - vector19.Y; + float num40 = (float)Math.Sqrt((double)(arg_31B_0 * arg_31B_0 + num30 * num30)); + if (num40 < 200f && !flag30) + { + npc.ai[3] = 0f; + } + if (npc.ai[3] < (float)num19) + { + npc.TargetClosest(true); + } + else + { + if (npc.velocity.X == 0f) + { + if (npc.velocity.Y == 0f) + { + npc.ai[0] += 1f; + if (npc.ai[0] >= 2f) + { + npc.direction *= -1; + npc.spriteDirection = -npc.direction; + npc.ai[0] = 0f; + } + } + } + else + { + npc.ai[0] = 0f; + } + npc.directionY = -1; + if (npc.direction == 0) + { + npc.direction = 1; + } + } + float num6 = 6f; //5 + float num70 = 0.06f; //0.05 + if (!flag19 && (npc.velocity.Y == 0f || npc.wet || (npc.velocity.X <= 0f && npc.direction > 0) || (npc.velocity.X >= 0f && npc.direction < 0))) + { + if (npc.velocity.X < -num6 || npc.velocity.X > num6) + { + if (npc.velocity.Y == 0f) + { + npc.velocity *= 0.8f; + } + } + else if (npc.velocity.X < num6 && npc.direction == -1) + { + npc.velocity.X = npc.velocity.X + num70; + if (npc.velocity.X > num6) + { + npc.velocity.X = num6; + } + } + else if (npc.velocity.X > -num6 && npc.direction == 1) + { + npc.velocity.X = npc.velocity.X - num70; + if (npc.velocity.X < -num6) + { + npc.velocity.X = -num6; + } + } + } + if (npc.velocity.Y >= 0f) + { + int num9 = 0; + if (npc.velocity.X < 0f) + { + num9 = -1; + } + if (npc.velocity.X > 0f) + { + num9 = 1; + } + Vector2 position = npc.position; + position.X += npc.velocity.X; + int num10 = (int)((position.X + (float)(npc.width / 2) + (float)((npc.width / 2 + 1) * num9)) / 16f); + int num11 = (int)((position.Y + (float)npc.height - 1f) / 16f); + if (Main.tile[num10, num11] == null) + { + Main.tile[num10, num11] = new Tile(); + } + if (Main.tile[num10, num11 - 1] == null) + { + Main.tile[num10, num11 - 1] = new Tile(); + } + if (Main.tile[num10, num11 - 2] == null) + { + Main.tile[num10, num11 - 2] = new Tile(); + } + if (Main.tile[num10, num11 - 3] == null) + { + Main.tile[num10, num11 - 3] = new Tile(); + } + if (Main.tile[num10, num11 + 1] == null) + { + Main.tile[num10, num11 + 1] = new Tile(); + } + if ((float)(num10 * 16) < position.X + (float)npc.width && (float)(num10 * 16 + 16) > position.X && ((Main.tile[num10, num11].nactive() && !Main.tile[num10, num11].topSlope() && !Main.tile[num10, num11 - 1].topSlope() && Main.tileSolid[(int)Main.tile[num10, num11].type] && !Main.tileSolidTop[(int)Main.tile[num10, num11].type]) || (Main.tile[num10, num11 - 1].halfBrick() && Main.tile[num10, num11 - 1].nactive())) && (!Main.tile[num10, num11 - 1].nactive() || !Main.tileSolid[(int)Main.tile[num10, num11 - 1].type] || Main.tileSolidTop[(int)Main.tile[num10, num11 - 1].type] || (Main.tile[num10, num11 - 1].halfBrick() && (!Main.tile[num10, num11 - 4].nactive() || !Main.tileSolid[(int)Main.tile[num10, num11 - 4].type] || Main.tileSolidTop[(int)Main.tile[num10, num11 - 4].type]))) && (!Main.tile[num10, num11 - 2].nactive() || !Main.tileSolid[(int)Main.tile[num10, num11 - 2].type] || Main.tileSolidTop[(int)Main.tile[num10, num11 - 2].type]) && (!Main.tile[num10, num11 - 3].nactive() || !Main.tileSolid[(int)Main.tile[num10, num11 - 3].type] || Main.tileSolidTop[(int)Main.tile[num10, num11 - 3].type]) && (!Main.tile[num10 - num9, num11 - 3].nactive() || !Main.tileSolid[(int)Main.tile[num10 - num9, num11 - 3].type])) + { + float num12 = (float)(num11 * 16); + if (Main.tile[num10, num11].halfBrick()) + { + num12 += 8f; + } + if (Main.tile[num10, num11 - 1].halfBrick()) + { + num12 -= 8f; + } + if (num12 < position.Y + (float)npc.height) + { + float num13 = position.Y + (float)npc.height - num12; + if ((double)num13 <= 16.1) + { + npc.gfxOffY += npc.position.Y + (float)npc.height - num12; + npc.position.Y = num12 - (float)npc.height; + if (num13 < 9f) + { + npc.stepSpeed = 1f; + } + else + { + npc.stepSpeed = 2f; + } + } + } + } + } + } + public override float SpawnChance(NPCSpawnInfo spawnInfo) { - if (spawnInfo.playerSafe || spawnInfo.player.GetModPlayer(mod).ZoneAbyss) + if (spawnInfo.playerSafe || spawnInfo.player.GetModPlayer(mod).ZoneAbyss || spawnInfo.player.GetModPlayer(mod).ZoneSunkenSea) { return 0f; } diff --git a/NPCs/NormalNPCs/CrawlerRuby.png b/NPCs/NormalNPCs/CrawlerRuby.png index 6fddbc1ec6..c690e19a95 100644 Binary files a/NPCs/NormalNPCs/CrawlerRuby.png and b/NPCs/NormalNPCs/CrawlerRuby.png differ diff --git a/NPCs/NormalNPCs/CrawlerSapphire.cs b/NPCs/NormalNPCs/CrawlerSapphire.cs index b3afa09056..bcb6421661 100644 --- a/NPCs/NormalNPCs/CrawlerSapphire.cs +++ b/NPCs/NormalNPCs/CrawlerSapphire.cs @@ -12,6 +12,8 @@ namespace CalamityMod.NPCs.NormalNPCs { public class CrawlerSapphire : ModNPC { + private bool detected = false; + public override void SetStaticDefaults() { DisplayName.SetDefault("Sapphire Crawler"); @@ -21,23 +23,217 @@ namespace CalamityMod.NPCs.NormalNPCs public override void SetDefaults() { npc.npcSlots = 0.3f; - npc.aiStyle = 3; + npc.aiStyle = -1; npc.damage = 18; npc.width = 44; //324 npc.height = 34; //216 npc.defense = 10; - npc.lifeMax = 60; + npc.lifeMax = 90; npc.knockBackResist = 0.65f; - animationType = 257; - aiType = NPCID.AnomuraFungus; + aiType = -1; npc.value = Item.buyPrice(0, 0, 1, 0); - npc.HitSound = SoundID.NPCHit1; + npc.HitSound = SoundID.NPCHit33; npc.DeathSound = SoundID.NPCDeath36; + banner = npc.type; + bannerItem = mod.ItemType("SapphireCrawlerBanner"); } - + + public override void FindFrame(int frameHeight) + { + if (!detected) + { + npc.frame.Y = frameHeight * 4; + npc.frameCounter = 0.0; + return; + } + npc.spriteDirection = -npc.direction; + npc.frameCounter += (double)(npc.velocity.Length() / 8f); + if (npc.frameCounter > 2.0) + { + npc.frame.Y = npc.frame.Y + frameHeight; + npc.frameCounter = 0.0; + } + if (npc.frame.Y >= frameHeight * 3) + { + npc.frame.Y = 0; + } + } + + public override void AI() + { + if (!detected) + npc.TargetClosest(true); + if (((Main.player[npc.target].Center - npc.Center).Length() < 100f && Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, + Main.player[npc.target].width, Main.player[npc.target].height)) || npc.justHit) + detected = true; + if (!detected) + return; + int num19 = 30; + int num20 = 10; + bool flag19 = false; + bool flag20 = false; + bool flag30 = false; + if (npc.velocity.Y == 0f && ((npc.velocity.X > 0f && npc.direction > 0) || (npc.velocity.X < 0f && npc.direction < 0))) + { + flag20 = true; + npc.ai[3] += 1f; + } + if ((npc.position.X == npc.oldPosition.X || npc.ai[3] >= (float)num19) | flag20) + { + npc.ai[3] += 1f; + flag30 = true; + } + else if (npc.ai[3] > 0f) + { + npc.ai[3] -= 1f; + } + if (npc.ai[3] > (float)(num19 * num20)) + { + npc.ai[3] = 0f; + } + if (npc.justHit) + { + npc.ai[3] = 0f; + } + if (npc.ai[3] == (float)num19) + { + npc.netUpdate = true; + } + Vector2 vector19 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float arg_31B_0 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector19.X; + float num30 = Main.player[npc.target].position.Y - vector19.Y; + float num40 = (float)Math.Sqrt((double)(arg_31B_0 * arg_31B_0 + num30 * num30)); + if (num40 < 200f && !flag30) + { + npc.ai[3] = 0f; + } + if (npc.ai[3] < (float)num19) + { + npc.TargetClosest(true); + } + else + { + if (npc.velocity.X == 0f) + { + if (npc.velocity.Y == 0f) + { + npc.ai[0] += 1f; + if (npc.ai[0] >= 2f) + { + npc.direction *= -1; + npc.spriteDirection = -npc.direction; + npc.ai[0] = 0f; + } + } + } + else + { + npc.ai[0] = 0f; + } + npc.directionY = -1; + if (npc.direction == 0) + { + npc.direction = 1; + } + } + float num6 = 5.5f; //5 + float num70 = 0.055f; //0.05 + if (!flag19 && (npc.velocity.Y == 0f || npc.wet || (npc.velocity.X <= 0f && npc.direction > 0) || (npc.velocity.X >= 0f && npc.direction < 0))) + { + if (npc.velocity.X < -num6 || npc.velocity.X > num6) + { + if (npc.velocity.Y == 0f) + { + npc.velocity *= 0.8f; + } + } + else if (npc.velocity.X < num6 && npc.direction == -1) + { + npc.velocity.X = npc.velocity.X + num70; + if (npc.velocity.X > num6) + { + npc.velocity.X = num6; + } + } + else if (npc.velocity.X > -num6 && npc.direction == 1) + { + npc.velocity.X = npc.velocity.X - num70; + if (npc.velocity.X < -num6) + { + npc.velocity.X = -num6; + } + } + } + if (npc.velocity.Y >= 0f) + { + int num9 = 0; + if (npc.velocity.X < 0f) + { + num9 = -1; + } + if (npc.velocity.X > 0f) + { + num9 = 1; + } + Vector2 position = npc.position; + position.X += npc.velocity.X; + int num10 = (int)((position.X + (float)(npc.width / 2) + (float)((npc.width / 2 + 1) * num9)) / 16f); + int num11 = (int)((position.Y + (float)npc.height - 1f) / 16f); + if (Main.tile[num10, num11] == null) + { + Main.tile[num10, num11] = new Tile(); + } + if (Main.tile[num10, num11 - 1] == null) + { + Main.tile[num10, num11 - 1] = new Tile(); + } + if (Main.tile[num10, num11 - 2] == null) + { + Main.tile[num10, num11 - 2] = new Tile(); + } + if (Main.tile[num10, num11 - 3] == null) + { + Main.tile[num10, num11 - 3] = new Tile(); + } + if (Main.tile[num10, num11 + 1] == null) + { + Main.tile[num10, num11 + 1] = new Tile(); + } + if ((float)(num10 * 16) < position.X + (float)npc.width && (float)(num10 * 16 + 16) > position.X && ((Main.tile[num10, num11].nactive() && !Main.tile[num10, num11].topSlope() && !Main.tile[num10, num11 - 1].topSlope() && Main.tileSolid[(int)Main.tile[num10, num11].type] && !Main.tileSolidTop[(int)Main.tile[num10, num11].type]) || (Main.tile[num10, num11 - 1].halfBrick() && Main.tile[num10, num11 - 1].nactive())) && (!Main.tile[num10, num11 - 1].nactive() || !Main.tileSolid[(int)Main.tile[num10, num11 - 1].type] || Main.tileSolidTop[(int)Main.tile[num10, num11 - 1].type] || (Main.tile[num10, num11 - 1].halfBrick() && (!Main.tile[num10, num11 - 4].nactive() || !Main.tileSolid[(int)Main.tile[num10, num11 - 4].type] || Main.tileSolidTop[(int)Main.tile[num10, num11 - 4].type]))) && (!Main.tile[num10, num11 - 2].nactive() || !Main.tileSolid[(int)Main.tile[num10, num11 - 2].type] || Main.tileSolidTop[(int)Main.tile[num10, num11 - 2].type]) && (!Main.tile[num10, num11 - 3].nactive() || !Main.tileSolid[(int)Main.tile[num10, num11 - 3].type] || Main.tileSolidTop[(int)Main.tile[num10, num11 - 3].type]) && (!Main.tile[num10 - num9, num11 - 3].nactive() || !Main.tileSolid[(int)Main.tile[num10 - num9, num11 - 3].type])) + { + float num12 = (float)(num11 * 16); + if (Main.tile[num10, num11].halfBrick()) + { + num12 += 8f; + } + if (Main.tile[num10, num11 - 1].halfBrick()) + { + num12 -= 8f; + } + if (num12 < position.Y + (float)npc.height) + { + float num13 = position.Y + (float)npc.height - num12; + if ((double)num13 <= 16.1) + { + npc.gfxOffY += npc.position.Y + (float)npc.height - num12; + npc.position.Y = num12 - (float)npc.height; + if (num13 < 9f) + { + npc.stepSpeed = 1f; + } + else + { + npc.stepSpeed = 2f; + } + } + } + } + } + } + public override float SpawnChance(NPCSpawnInfo spawnInfo) { - if (spawnInfo.playerSafe || spawnInfo.player.GetModPlayer(mod).ZoneAbyss) + if (spawnInfo.playerSafe || spawnInfo.player.GetModPlayer(mod).ZoneAbyss || spawnInfo.player.GetModPlayer(mod).ZoneSunkenSea) { return 0f; } diff --git a/NPCs/NormalNPCs/CrawlerSapphire.png b/NPCs/NormalNPCs/CrawlerSapphire.png index 8f166fb689..35a0373404 100644 Binary files a/NPCs/NormalNPCs/CrawlerSapphire.png and b/NPCs/NormalNPCs/CrawlerSapphire.png differ diff --git a/NPCs/NormalNPCs/CrawlerTopaz.cs b/NPCs/NormalNPCs/CrawlerTopaz.cs index 43fbeeda0f..b4a5d8941d 100644 --- a/NPCs/NormalNPCs/CrawlerTopaz.cs +++ b/NPCs/NormalNPCs/CrawlerTopaz.cs @@ -12,6 +12,8 @@ namespace CalamityMod.NPCs.NormalNPCs { public class CrawlerTopaz : ModNPC { + private bool detected = false; + public override void SetStaticDefaults() { DisplayName.SetDefault("Topaz Crawler"); @@ -21,23 +23,217 @@ namespace CalamityMod.NPCs.NormalNPCs public override void SetDefaults() { npc.npcSlots = 0.3f; - npc.aiStyle = 3; + npc.aiStyle = -1; npc.damage = 12; npc.width = 44; //324 npc.height = 34; //216 npc.defense = 6; - npc.lifeMax = 30; + npc.lifeMax = 45; npc.knockBackResist = 0.85f; - animationType = 257; - aiType = NPCID.AnomuraFungus; + aiType = -1; npc.value = Item.buyPrice(0, 0, 0, 30); - npc.HitSound = SoundID.NPCHit1; + npc.HitSound = SoundID.NPCHit33; npc.DeathSound = SoundID.NPCDeath36; + banner = npc.type; + bannerItem = mod.ItemType("TopazCrawlerBanner"); } - + + public override void FindFrame(int frameHeight) + { + if (!detected) + { + npc.frame.Y = frameHeight * 4; + npc.frameCounter = 0.0; + return; + } + npc.spriteDirection = -npc.direction; + npc.frameCounter += (double)(npc.velocity.Length() / 8f); + if (npc.frameCounter > 2.0) + { + npc.frame.Y = npc.frame.Y + frameHeight; + npc.frameCounter = 0.0; + } + if (npc.frame.Y >= frameHeight * 3) + { + npc.frame.Y = 0; + } + } + + public override void AI() + { + if (!detected) + npc.TargetClosest(true); + if (((Main.player[npc.target].Center - npc.Center).Length() < 100f && Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, + Main.player[npc.target].width, Main.player[npc.target].height)) || npc.justHit) + detected = true; + if (!detected) + return; + int num19 = 30; + int num20 = 10; + bool flag19 = false; + bool flag20 = false; + bool flag30 = false; + if (npc.velocity.Y == 0f && ((npc.velocity.X > 0f && npc.direction > 0) || (npc.velocity.X < 0f && npc.direction < 0))) + { + flag20 = true; + npc.ai[3] += 1f; + } + if ((npc.position.X == npc.oldPosition.X || npc.ai[3] >= (float)num19) | flag20) + { + npc.ai[3] += 1f; + flag30 = true; + } + else if (npc.ai[3] > 0f) + { + npc.ai[3] -= 1f; + } + if (npc.ai[3] > (float)(num19 * num20)) + { + npc.ai[3] = 0f; + } + if (npc.justHit) + { + npc.ai[3] = 0f; + } + if (npc.ai[3] == (float)num19) + { + npc.netUpdate = true; + } + Vector2 vector19 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float arg_31B_0 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector19.X; + float num30 = Main.player[npc.target].position.Y - vector19.Y; + float num40 = (float)Math.Sqrt((double)(arg_31B_0 * arg_31B_0 + num30 * num30)); + if (num40 < 200f && !flag30) + { + npc.ai[3] = 0f; + } + if (npc.ai[3] < (float)num19) + { + npc.TargetClosest(true); + } + else + { + if (npc.velocity.X == 0f) + { + if (npc.velocity.Y == 0f) + { + npc.ai[0] += 1f; + if (npc.ai[0] >= 2f) + { + npc.direction *= -1; + npc.spriteDirection = -npc.direction; + npc.ai[0] = 0f; + } + } + } + else + { + npc.ai[0] = 0f; + } + npc.directionY = -1; + if (npc.direction == 0) + { + npc.direction = 1; + } + } + float num6 = 4.5f; //5 + float num70 = 0.045f; //0.05 + if (!flag19 && (npc.velocity.Y == 0f || npc.wet || (npc.velocity.X <= 0f && npc.direction > 0) || (npc.velocity.X >= 0f && npc.direction < 0))) + { + if (npc.velocity.X < -num6 || npc.velocity.X > num6) + { + if (npc.velocity.Y == 0f) + { + npc.velocity *= 0.8f; + } + } + else if (npc.velocity.X < num6 && npc.direction == -1) + { + npc.velocity.X = npc.velocity.X + num70; + if (npc.velocity.X > num6) + { + npc.velocity.X = num6; + } + } + else if (npc.velocity.X > -num6 && npc.direction == 1) + { + npc.velocity.X = npc.velocity.X - num70; + if (npc.velocity.X < -num6) + { + npc.velocity.X = -num6; + } + } + } + if (npc.velocity.Y >= 0f) + { + int num9 = 0; + if (npc.velocity.X < 0f) + { + num9 = -1; + } + if (npc.velocity.X > 0f) + { + num9 = 1; + } + Vector2 position = npc.position; + position.X += npc.velocity.X; + int num10 = (int)((position.X + (float)(npc.width / 2) + (float)((npc.width / 2 + 1) * num9)) / 16f); + int num11 = (int)((position.Y + (float)npc.height - 1f) / 16f); + if (Main.tile[num10, num11] == null) + { + Main.tile[num10, num11] = new Tile(); + } + if (Main.tile[num10, num11 - 1] == null) + { + Main.tile[num10, num11 - 1] = new Tile(); + } + if (Main.tile[num10, num11 - 2] == null) + { + Main.tile[num10, num11 - 2] = new Tile(); + } + if (Main.tile[num10, num11 - 3] == null) + { + Main.tile[num10, num11 - 3] = new Tile(); + } + if (Main.tile[num10, num11 + 1] == null) + { + Main.tile[num10, num11 + 1] = new Tile(); + } + if ((float)(num10 * 16) < position.X + (float)npc.width && (float)(num10 * 16 + 16) > position.X && ((Main.tile[num10, num11].nactive() && !Main.tile[num10, num11].topSlope() && !Main.tile[num10, num11 - 1].topSlope() && Main.tileSolid[(int)Main.tile[num10, num11].type] && !Main.tileSolidTop[(int)Main.tile[num10, num11].type]) || (Main.tile[num10, num11 - 1].halfBrick() && Main.tile[num10, num11 - 1].nactive())) && (!Main.tile[num10, num11 - 1].nactive() || !Main.tileSolid[(int)Main.tile[num10, num11 - 1].type] || Main.tileSolidTop[(int)Main.tile[num10, num11 - 1].type] || (Main.tile[num10, num11 - 1].halfBrick() && (!Main.tile[num10, num11 - 4].nactive() || !Main.tileSolid[(int)Main.tile[num10, num11 - 4].type] || Main.tileSolidTop[(int)Main.tile[num10, num11 - 4].type]))) && (!Main.tile[num10, num11 - 2].nactive() || !Main.tileSolid[(int)Main.tile[num10, num11 - 2].type] || Main.tileSolidTop[(int)Main.tile[num10, num11 - 2].type]) && (!Main.tile[num10, num11 - 3].nactive() || !Main.tileSolid[(int)Main.tile[num10, num11 - 3].type] || Main.tileSolidTop[(int)Main.tile[num10, num11 - 3].type]) && (!Main.tile[num10 - num9, num11 - 3].nactive() || !Main.tileSolid[(int)Main.tile[num10 - num9, num11 - 3].type])) + { + float num12 = (float)(num11 * 16); + if (Main.tile[num10, num11].halfBrick()) + { + num12 += 8f; + } + if (Main.tile[num10, num11 - 1].halfBrick()) + { + num12 -= 8f; + } + if (num12 < position.Y + (float)npc.height) + { + float num13 = position.Y + (float)npc.height - num12; + if ((double)num13 <= 16.1) + { + npc.gfxOffY += npc.position.Y + (float)npc.height - num12; + npc.position.Y = num12 - (float)npc.height; + if (num13 < 9f) + { + npc.stepSpeed = 1f; + } + else + { + npc.stepSpeed = 2f; + } + } + } + } + } + } + public override float SpawnChance(NPCSpawnInfo spawnInfo) { - if (spawnInfo.playerSafe || spawnInfo.player.GetModPlayer(mod).ZoneAbyss) + if (spawnInfo.playerSafe || spawnInfo.player.GetModPlayer(mod).ZoneAbyss || spawnInfo.player.GetModPlayer(mod).ZoneSunkenSea) { return 0f; } diff --git a/NPCs/NormalNPCs/CrawlerTopaz.png b/NPCs/NormalNPCs/CrawlerTopaz.png index 575ef1a638..303e221fa0 100644 Binary files a/NPCs/NormalNPCs/CrawlerTopaz.png and b/NPCs/NormalNPCs/CrawlerTopaz.png differ diff --git a/NPCs/NormalNPCs/CrimulanBlightSlime.cs b/NPCs/NormalNPCs/CrimulanBlightSlime.cs index 14e7643f00..c473dc8cec 100644 --- a/NPCs/NormalNPCs/CrimulanBlightSlime.cs +++ b/NPCs/NormalNPCs/CrimulanBlightSlime.cs @@ -36,6 +36,8 @@ namespace CalamityMod.NPCs.NormalNPCs npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; npc.buffImmune[24] = true; + banner = npc.type; + bannerItem = mod.ItemType("CrimulanBlightSlimeBanner"); } public override float SpawnChance(NPCSpawnInfo spawnInfo) diff --git a/NPCs/NormalNPCs/CryoSlime.cs b/NPCs/NormalNPCs/CryoSlime.cs index d4205bca10..813147d8fe 100644 --- a/NPCs/NormalNPCs/CryoSlime.cs +++ b/NPCs/NormalNPCs/CryoSlime.cs @@ -35,11 +35,14 @@ namespace CalamityMod.NPCs.NormalNPCs npc.noTileCollide = false; npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; + banner = npc.type; + bannerItem = mod.ItemType("CryoSlimeBanner"); } public override float SpawnChance(NPCSpawnInfo spawnInfo) { - if (spawnInfo.playerSafe || !CalamityWorld.downedCryogen || spawnInfo.player.GetModPlayer(mod).ZoneAbyss) + if (spawnInfo.playerSafe || !CalamityWorld.downedCryogen || spawnInfo.player.GetModPlayer(mod).ZoneAbyss || + spawnInfo.player.GetModPlayer(mod).ZoneSunkenSea) { return 0f; } diff --git a/NPCs/NormalNPCs/Cryon.cs b/NPCs/NormalNPCs/Cryon.cs index a314bf2a79..1519c205c3 100644 --- a/NPCs/NormalNPCs/Cryon.cs +++ b/NPCs/NormalNPCs/Cryon.cs @@ -31,6 +31,8 @@ namespace CalamityMod.NPCs.NormalNPCs npc.value = Item.buyPrice(0, 0, 5, 0); npc.HitSound = SoundID.NPCHit5; npc.DeathSound = SoundID.NPCDeath7; + banner = npc.type; + bannerItem = mod.ItemType("CryonBanner"); } public override void AI() @@ -345,7 +347,8 @@ namespace CalamityMod.NPCs.NormalNPCs !spawnInfo.player.ZoneTowerVortex && !spawnInfo.player.ZoneTowerNebula && !spawnInfo.player.ZoneDungeon && - Main.hardMode && !spawnInfo.playerInTown && !spawnInfo.player.ZoneOldOneArmy && !Main.snowMoon && !Main.pumpkinMoon ? 0.015f : 0f; + !spawnInfo.player.GetModPlayer(mod).ZoneSunkenSea && + Main.hardMode && !spawnInfo.playerInTown && !spawnInfo.player.ZoneOldOneArmy && !Main.snowMoon && !Main.pumpkinMoon ? 0.015f : 0f; } public override void OnHitPlayer(Player player, int damage, bool crit) @@ -374,7 +377,10 @@ namespace CalamityMod.NPCs.NormalNPCs public override void NPCLoot() { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EssenceofEleum")); + if (Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EssenceofEleum")); + } } } } \ No newline at end of file diff --git a/NPCs/NormalNPCs/EbonianBlightSlime.cs b/NPCs/NormalNPCs/EbonianBlightSlime.cs index cc6fcb4183..df6e1edf46 100644 --- a/NPCs/NormalNPCs/EbonianBlightSlime.cs +++ b/NPCs/NormalNPCs/EbonianBlightSlime.cs @@ -36,6 +36,8 @@ namespace CalamityMod.NPCs.NormalNPCs npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; npc.buffImmune[24] = true; + banner = npc.type; + bannerItem = mod.ItemType("EbonianBlightSlimeBanner"); } public override void HitEffect(int hitDirection, double damage) diff --git a/NPCs/NormalNPCs/Eidolist.cs b/NPCs/NormalNPCs/Eidolist.cs index 4d4b0b09ad..18a5f3b6d1 100644 --- a/NPCs/NormalNPCs/Eidolist.cs +++ b/NPCs/NormalNPCs/Eidolist.cs @@ -45,7 +45,9 @@ namespace CalamityMod.NPCs.NormalNPCs npc.HitSound = SoundID.NPCHit13; npc.DeathSound = SoundID.NPCDeath59; npc.timeLeft = NPC.activeTime * 2; - } + banner = npc.type; + bannerItem = mod.ItemType("EidolistBanner"); + } public override void AI() { diff --git a/NPCs/NormalNPCs/HeatSpirit.cs b/NPCs/NormalNPCs/HeatSpirit.cs index ba696135c5..b5fcc7148f 100644 --- a/NPCs/NormalNPCs/HeatSpirit.cs +++ b/NPCs/NormalNPCs/HeatSpirit.cs @@ -31,6 +31,8 @@ namespace CalamityMod.NPCs.NormalNPCs npc.value = Item.buyPrice(0, 0, 1, 0); npc.HitSound = SoundID.NPCHit52; npc.DeathSound = SoundID.NPCDeath55; + banner = npc.type; + bannerItem = mod.ItemType("HeatSpiritBanner"); } public override float SpawnChance(NPCSpawnInfo spawnInfo) @@ -95,7 +97,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void NPCLoot() { - if (Main.rand.Next(2) == 0) + if (Main.rand.Next(4) == 0) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EssenceofChaos")); } diff --git a/NPCs/NormalNPCs/Horse.cs b/NPCs/NormalNPCs/Horse.cs index 61fc070f80..fcb25d3d48 100644 --- a/NPCs/NormalNPCs/Horse.cs +++ b/NPCs/NormalNPCs/Horse.cs @@ -41,11 +41,14 @@ namespace CalamityMod.NPCs.NormalNPCs npc.noTileCollide = true; npc.HitSound = SoundID.NPCHit4; npc.rarity = 2; - } + banner = npc.type; + bannerItem = mod.ItemType("EarthElementalBanner"); + } public override float SpawnChance(NPCSpawnInfo spawnInfo) { - if (spawnInfo.playerSafe || !Main.hardMode || spawnInfo.player.GetModPlayer(mod).ZoneAbyss) + if (spawnInfo.playerSafe || !Main.hardMode || spawnInfo.player.GetModPlayer(mod).ZoneAbyss || + spawnInfo.player.GetModPlayer(mod).ZoneSunkenSea) { return 0f; } diff --git a/NPCs/NormalNPCs/IceClasper.cs b/NPCs/NormalNPCs/IceClasper.cs index 40a96b2811..f492ce9d36 100644 --- a/NPCs/NormalNPCs/IceClasper.cs +++ b/NPCs/NormalNPCs/IceClasper.cs @@ -35,7 +35,9 @@ namespace CalamityMod.NPCs.NormalNPCs npc.DeathSound = SoundID.NPCDeath7; npc.coldDamage = true; npc.rarity = 2; - } + banner = npc.type; + bannerItem = mod.ItemType("IceClasperBanner"); + } public override void AI() { @@ -239,7 +241,8 @@ namespace CalamityMod.NPCs.NormalNPCs !spawnInfo.player.ZoneTowerVortex && !spawnInfo.player.ZoneTowerNebula && !spawnInfo.player.ZoneDungeon && - Main.hardMode && !spawnInfo.playerInTown && !spawnInfo.player.ZoneOldOneArmy && !Main.snowMoon && !Main.pumpkinMoon ? 0.007f : 0f; + !spawnInfo.player.GetModPlayer(mod).ZoneSunkenSea && + Main.hardMode && !spawnInfo.playerInTown && !spawnInfo.player.ZoneOldOneArmy && !Main.snowMoon && !Main.pumpkinMoon ? 0.007f : 0f; } public override void OnHitPlayer(Player player, int damage, bool crit) @@ -268,7 +271,10 @@ namespace CalamityMod.NPCs.NormalNPCs public override void NPCLoot() { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EssenceofEleum"), Main.rand.Next(2, 4)); + if (Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EssenceofEleum")); + } if (Main.rand.Next(10) == 0) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("FrostBarrier")); diff --git a/NPCs/NormalNPCs/ImpiousImmolator.cs b/NPCs/NormalNPCs/ImpiousImmolator.cs index 37332a8d80..a9d6a3b584 100644 --- a/NPCs/NormalNPCs/ImpiousImmolator.cs +++ b/NPCs/NormalNPCs/ImpiousImmolator.cs @@ -39,7 +39,9 @@ namespace CalamityMod.NPCs.NormalNPCs npc.HitSound = SoundID.NPCHit5; npc.DeathSound = SoundID.NPCDeath7; npc.knockBackResist = 0.2f; - } + banner = npc.type; + bannerItem = mod.ItemType("ImpiousImmolatorBanner"); + } public override void AI() { diff --git a/NPCs/NormalNPCs/IrradiatedSlime.cs b/NPCs/NormalNPCs/IrradiatedSlime.cs index 090fbeb998..f2b23b57df 100644 --- a/NPCs/NormalNPCs/IrradiatedSlime.cs +++ b/NPCs/NormalNPCs/IrradiatedSlime.cs @@ -35,15 +35,17 @@ namespace CalamityMod.NPCs.NormalNPCs npc.noTileCollide = false; npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; + banner = npc.type; + bannerItem = mod.ItemType("IrradiatedSlimeBanner"); } public override float SpawnChance(NPCSpawnInfo spawnInfo) { - if (spawnInfo.playerSafe || !NPC.downedMoonlord || !Main.raining) + if (spawnInfo.playerSafe || !spawnInfo.player.GetModPlayer(mod).ZoneSulphur || !NPC.downedMoonlord || !Main.raining) { return 0f; } - return SpawnCondition.OverworldDaySlime.Chance * 0.15f; + return 0.05f; } public override void PostDraw(SpriteBatch spriteBatch, Color drawColor) diff --git a/NPCs/NormalNPCs/OverloadedSoldier.cs b/NPCs/NormalNPCs/OverloadedSoldier.cs index f2381afaa4..7a5beb1aab 100644 --- a/NPCs/NormalNPCs/OverloadedSoldier.cs +++ b/NPCs/NormalNPCs/OverloadedSoldier.cs @@ -31,6 +31,8 @@ namespace CalamityMod.NPCs.NormalNPCs npc.value = Item.buyPrice(0, 0, 2, 0); npc.HitSound = SoundID.NPCHit2; npc.DeathSound = SoundID.NPCDeath2; + banner = npc.type; + bannerItem = mod.ItemType("OverloadedSoldierBanner"); } public override void AI() @@ -40,7 +42,8 @@ namespace CalamityMod.NPCs.NormalNPCs public override float SpawnChance(NPCSpawnInfo spawnInfo) { - if (spawnInfo.playerSafe || !Main.hardMode || spawnInfo.player.GetModPlayer(mod).ZoneAbyss) + if (spawnInfo.playerSafe || !Main.hardMode || spawnInfo.player.GetModPlayer(mod).ZoneAbyss || + spawnInfo.player.GetModPlayer(mod).ZoneSunkenSea) { return 0f; } diff --git a/NPCs/NormalNPCs/PerennialSlime.cs b/NPCs/NormalNPCs/PerennialSlime.cs index ff79156698..086c7144c0 100644 --- a/NPCs/NormalNPCs/PerennialSlime.cs +++ b/NPCs/NormalNPCs/PerennialSlime.cs @@ -35,11 +35,14 @@ namespace CalamityMod.NPCs.NormalNPCs npc.noTileCollide = false; npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; + banner = npc.type; + bannerItem = mod.ItemType("PerennialSlimeBanner"); } public override float SpawnChance(NPCSpawnInfo spawnInfo) { - if (spawnInfo.playerSafe || !NPC.downedPlantBoss || spawnInfo.player.GetModPlayer(mod).ZoneAbyss) + if (spawnInfo.playerSafe || !NPC.downedPlantBoss || spawnInfo.player.GetModPlayer(mod).ZoneAbyss || + spawnInfo.player.GetModPlayer(mod).ZoneSunkenSea) { return 0f; } diff --git a/NPCs/NormalNPCs/PhantomDebris.cs b/NPCs/NormalNPCs/PhantomDebris.cs index b3be8ca794..2db766d6fd 100644 --- a/NPCs/NormalNPCs/PhantomDebris.cs +++ b/NPCs/NormalNPCs/PhantomDebris.cs @@ -31,6 +31,8 @@ namespace CalamityMod.NPCs.NormalNPCs npc.value = Item.buyPrice(0, 0, 2, 0); npc.HitSound = SoundID.NPCHit2; npc.DeathSound = SoundID.NPCDeath36; + banner = npc.type; + bannerItem = mod.ItemType("PhantomDebrisBanner"); } public override void FindFrame(int frameHeight) @@ -87,7 +89,8 @@ namespace CalamityMod.NPCs.NormalNPCs public override float SpawnChance(NPCSpawnInfo spawnInfo) { - if (spawnInfo.playerSafe || !Main.hardMode || spawnInfo.player.GetModPlayer(mod).ZoneAbyss) + if (spawnInfo.playerSafe || !Main.hardMode || spawnInfo.player.GetModPlayer(mod).ZoneAbyss || + spawnInfo.player.GetModPlayer(mod).ZoneSunkenSea) { return 0f; } diff --git a/NPCs/NormalNPCs/PhantomSpirit.cs b/NPCs/NormalNPCs/PhantomSpirit.cs index 196cf22d52..a5411078be 100644 --- a/NPCs/NormalNPCs/PhantomSpirit.cs +++ b/NPCs/NormalNPCs/PhantomSpirit.cs @@ -34,6 +34,8 @@ namespace CalamityMod.NPCs.NormalNPCs npc.DeathSound = SoundID.NPCDeath39; npc.noGravity = true; npc.noTileCollide = true; + banner = npc.type; + bannerItem = mod.ItemType("PhantomSpiritBanner"); } public override void AI() diff --git a/NPCs/NormalNPCs/PhantomSpiritL.cs b/NPCs/NormalNPCs/PhantomSpiritL.cs index 102071596e..27e454c2b6 100644 --- a/NPCs/NormalNPCs/PhantomSpiritL.cs +++ b/NPCs/NormalNPCs/PhantomSpiritL.cs @@ -34,6 +34,8 @@ namespace CalamityMod.NPCs.NormalNPCs npc.DeathSound = SoundID.NPCDeath39; npc.noGravity = true; npc.noTileCollide = true; + banner = mod.NPCType("PhantomSpirit"); + bannerItem = mod.ItemType("PhantomSpiritBanner"); } public override void FindFrame(int frameHeight) @@ -101,7 +103,7 @@ namespace CalamityMod.NPCs.NormalNPCs { float num151 = 5f; int num152 = 60; - int num153 = 299; + int num153 = mod.ProjectileType("PhantomGhostShot"); num149 = num151 / num149; num147 *= num149; num148 *= num149; diff --git a/NPCs/NormalNPCs/PhantomSpiritM.cs b/NPCs/NormalNPCs/PhantomSpiritM.cs index 13f7a51904..4f5672c427 100644 --- a/NPCs/NormalNPCs/PhantomSpiritM.cs +++ b/NPCs/NormalNPCs/PhantomSpiritM.cs @@ -34,6 +34,8 @@ namespace CalamityMod.NPCs.NormalNPCs npc.DeathSound = SoundID.NPCDeath39; npc.noGravity = true; npc.noTileCollide = true; + banner = mod.NPCType("PhantomSpirit"); + bannerItem = mod.ItemType("PhantomSpiritBanner"); } public override void FindFrame(int frameHeight) diff --git a/NPCs/NormalNPCs/PhantomSpiritS.cs b/NPCs/NormalNPCs/PhantomSpiritS.cs index 77fb139269..bc18e15712 100644 --- a/NPCs/NormalNPCs/PhantomSpiritS.cs +++ b/NPCs/NormalNPCs/PhantomSpiritS.cs @@ -33,6 +33,8 @@ namespace CalamityMod.NPCs.NormalNPCs npc.DeathSound = SoundID.NPCDeath39; npc.noGravity = true; npc.noTileCollide = true; + banner = mod.NPCType("PhantomSpirit"); + bannerItem = mod.ItemType("PhantomSpiritBanner"); } public override void FindFrame(int frameHeight) diff --git a/NPCs/NormalNPCs/Pitbull.cs b/NPCs/NormalNPCs/Pitbull.cs index 84167890b5..de677497c1 100644 --- a/NPCs/NormalNPCs/Pitbull.cs +++ b/NPCs/NormalNPCs/Pitbull.cs @@ -32,6 +32,8 @@ namespace CalamityMod.NPCs.NormalNPCs npc.value = Item.buyPrice(0, 0, 2, 0); npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath5; + banner = npc.type; + bannerItem = mod.ItemType("PitbullBanner"); } public override float SpawnChance(NPCSpawnInfo spawnInfo) diff --git a/NPCs/NormalNPCs/PlagueBee.cs b/NPCs/NormalNPCs/PlagueBee.cs index eb7ee9d3b1..8d87c6254b 100644 --- a/NPCs/NormalNPCs/PlagueBee.cs +++ b/NPCs/NormalNPCs/PlagueBee.cs @@ -46,6 +46,8 @@ namespace CalamityMod.NPCs.NormalNPCs npc.buffImmune[mod.BuffType("BrimstoneFlames")] = true; npc.buffImmune[mod.BuffType("HolyLight")] = true; npc.buffImmune[mod.BuffType("Plague")] = true; + banner = npc.type; + bannerItem = mod.ItemType("PlagueChargerBanner"); } public override void NPCLoot() @@ -55,7 +57,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override float SpawnChance(NPCSpawnInfo spawnInfo) { - if (spawnInfo.playerSafe || !NPC.downedGolemBoss) + if (spawnInfo.playerSafe || !NPC.downedGolemBoss || spawnInfo.player.GetModPlayer(mod).ZoneSunkenSea) { return 0f; } diff --git a/NPCs/NormalNPCs/PlagueBeeLarge.cs b/NPCs/NormalNPCs/PlagueBeeLarge.cs index 3a1bfd46ce..b4787b829a 100644 --- a/NPCs/NormalNPCs/PlagueBeeLarge.cs +++ b/NPCs/NormalNPCs/PlagueBeeLarge.cs @@ -46,6 +46,8 @@ namespace CalamityMod.NPCs.NormalNPCs npc.buffImmune[mod.BuffType("BrimstoneFlames")] = true; npc.buffImmune[mod.BuffType("HolyLight")] = true; npc.buffImmune[mod.BuffType("Plague")] = true; + banner = mod.NPCType("PlagueBee"); + bannerItem = mod.ItemType("PlagueChargerBanner"); } public override void NPCLoot() @@ -55,7 +57,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override float SpawnChance(NPCSpawnInfo spawnInfo) { - if (spawnInfo.playerSafe || !NPC.downedGolemBoss) + if (spawnInfo.playerSafe || !NPC.downedGolemBoss || spawnInfo.player.GetModPlayer(mod).ZoneSunkenSea) { return 0f; } diff --git a/NPCs/NormalNPCs/PlaguedDerpling.cs b/NPCs/NormalNPCs/PlaguedDerpling.cs index 8cee41d604..a7e872904e 100644 --- a/NPCs/NormalNPCs/PlaguedDerpling.cs +++ b/NPCs/NormalNPCs/PlaguedDerpling.cs @@ -15,6 +15,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void SetStaticDefaults() { DisplayName.SetDefault("Viruling"); + Main.npcFrameCount[npc.type] = 5; } public override void SetDefaults() @@ -42,9 +43,19 @@ namespace CalamityMod.NPCs.NormalNPCs npc.buffImmune[mod.BuffType("BrimstoneFlames")] = true; npc.buffImmune[mod.BuffType("HolyLight")] = true; npc.buffImmune[mod.BuffType("Plague")] = true; - } + banner = npc.type; + bannerItem = mod.ItemType("VirulingBanner"); + } - public override void AI() + public override void FindFrame(int frameHeight) + { + npc.frameCounter += 0.15f; + npc.frameCounter %= Main.npcFrameCount[npc.type]; + int frame = (int)npc.frameCounter; + npc.frame.Y = frame * frameHeight; + } + + public override void AI() { if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead) { @@ -146,7 +157,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override float SpawnChance(NPCSpawnInfo spawnInfo) { - if (spawnInfo.playerSafe || !NPC.downedGolemBoss) + if (spawnInfo.playerSafe || !NPC.downedGolemBoss || spawnInfo.player.GetModPlayer(mod).ZoneSunkenSea) { return 0f; } @@ -170,6 +181,9 @@ namespace CalamityMod.NPCs.NormalNPCs { Dust.NewDust(npc.position, npc.width, npc.height, 46, hitDirection, -1f, 0, default(Color), 1f); } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Viruling"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Viruling2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Viruling3"), 1f); } } diff --git a/NPCs/NormalNPCs/PlaguedDerpling.png b/NPCs/NormalNPCs/PlaguedDerpling.png index b957950f4b..85878b8985 100644 Binary files a/NPCs/NormalNPCs/PlaguedDerpling.png and b/NPCs/NormalNPCs/PlaguedDerpling.png differ diff --git a/NPCs/NormalNPCs/PlaguedFlyingFox.cs b/NPCs/NormalNPCs/PlaguedFlyingFox.cs index 19731dc33f..fd70d20364 100644 --- a/NPCs/NormalNPCs/PlaguedFlyingFox.cs +++ b/NPCs/NormalNPCs/PlaguedFlyingFox.cs @@ -44,16 +44,13 @@ namespace CalamityMod.NPCs.NormalNPCs npc.buffImmune[mod.BuffType("BrimstoneFlames")] = true; npc.buffImmune[mod.BuffType("HolyLight")] = true; npc.buffImmune[mod.BuffType("Plague")] = true; - } - - /*public override void AI() - { - npc.spriteDirection = ((npc.direction > 0) ? 1 : -1); - }*/ + banner = npc.type; + bannerItem = mod.ItemType("MelterBanner"); + } public override float SpawnChance(NPCSpawnInfo spawnInfo) { - if (spawnInfo.playerSafe || !NPC.downedGolemBoss) + if (spawnInfo.playerSafe || !NPC.downedGolemBoss || spawnInfo.player.GetModPlayer(mod).ZoneSunkenSea) { return 0f; } diff --git a/NPCs/NormalNPCs/PlaguedJungleSlime.cs b/NPCs/NormalNPCs/PlaguedJungleSlime.cs index a7b3cd905b..cac0467eca 100644 --- a/NPCs/NormalNPCs/PlaguedJungleSlime.cs +++ b/NPCs/NormalNPCs/PlaguedJungleSlime.cs @@ -48,7 +48,9 @@ namespace CalamityMod.NPCs.NormalNPCs npc.buffImmune[mod.BuffType("BrimstoneFlames")] = true; npc.buffImmune[mod.BuffType("HolyLight")] = true; npc.buffImmune[mod.BuffType("Plague")] = true; - } + banner = npc.type; + bannerItem = mod.ItemType("PestilentSlimeBanner"); + } public override void AI() { @@ -108,7 +110,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override float SpawnChance(NPCSpawnInfo spawnInfo) { - if (spawnInfo.playerSafe || !NPC.downedGolemBoss) + if (spawnInfo.playerSafe || !NPC.downedGolemBoss || spawnInfo.player.GetModPlayer(mod).ZoneSunkenSea) { return 0f; } diff --git a/NPCs/NormalNPCs/PlaguedJungleSlime.png b/NPCs/NormalNPCs/PlaguedJungleSlime.png index d481b5bb39..9f72a76d2f 100644 Binary files a/NPCs/NormalNPCs/PlaguedJungleSlime.png and b/NPCs/NormalNPCs/PlaguedJungleSlime.png differ diff --git a/NPCs/NormalNPCs/PlaguedTortoise.cs b/NPCs/NormalNPCs/PlaguedTortoise.cs index e6205a29b6..90fe3ee827 100644 --- a/NPCs/NormalNPCs/PlaguedTortoise.cs +++ b/NPCs/NormalNPCs/PlaguedTortoise.cs @@ -46,7 +46,9 @@ namespace CalamityMod.NPCs.NormalNPCs npc.buffImmune[mod.BuffType("BrimstoneFlames")] = true; npc.buffImmune[mod.BuffType("HolyLight")] = true; npc.buffImmune[mod.BuffType("Plague")] = true; - } + banner = npc.type; + bannerItem = mod.ItemType("PlagueshellBanner"); + } public override void HitEffect(int hitDirection, double damage) { @@ -65,7 +67,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override float SpawnChance(NPCSpawnInfo spawnInfo) { - if (spawnInfo.playerSafe || !NPC.downedGolemBoss) + if (spawnInfo.playerSafe || !NPC.downedGolemBoss || spawnInfo.player.GetModPlayer(mod).ZoneSunkenSea) { return 0f; } diff --git a/NPCs/NormalNPCs/ProfanedEnergyBody.cs b/NPCs/NormalNPCs/ProfanedEnergyBody.cs index e6fb9c530f..77ae1134d7 100644 --- a/NPCs/NormalNPCs/ProfanedEnergyBody.cs +++ b/NPCs/NormalNPCs/ProfanedEnergyBody.cs @@ -33,6 +33,8 @@ namespace CalamityMod.NPCs.NormalNPCs npc.noGravity = true; npc.HitSound = SoundID.NPCHit52; npc.DeathSound = SoundID.NPCDeath55; + banner = npc.type; + bannerItem = mod.ItemType("ProfanedEnergyBanner"); } public override void AI() diff --git a/NPCs/NormalNPCs/SandTortoise.cs b/NPCs/NormalNPCs/SandTortoise.cs index d489c9f14d..649ba24812 100644 --- a/NPCs/NormalNPCs/SandTortoise.cs +++ b/NPCs/NormalNPCs/SandTortoise.cs @@ -23,19 +23,21 @@ namespace CalamityMod.NPCs.NormalNPCs public override void SetDefaults() { npc.npcSlots = 2f; - npc.damage = 90; + npc.damage = 110; npc.aiStyle = 39; npc.width = 46; npc.height = 32; npc.defense = 34; - npc.scale = 1.25f; - npc.lifeMax = 490; + npc.scale = 1.5f; + npc.lifeMax = 580; npc.knockBackResist = 0.2f; animationType = 153; npc.value = Item.buyPrice(0, 0, 15, 0); npc.HitSound = SoundID.NPCHit24; npc.DeathSound = SoundID.NPCDeath27; npc.noGravity = false; + banner = npc.type; + bannerItem = mod.ItemType("SandTortoiseBanner"); } public override void HitEffect(int hitDirection, double damage) @@ -55,24 +57,15 @@ namespace CalamityMod.NPCs.NormalNPCs public override float SpawnChance(NPCSpawnInfo spawnInfo) { - if (spawnInfo.playerSafe || !Main.hardMode) + if (spawnInfo.playerSafe || !Main.hardMode || spawnInfo.player.GetModPlayer(mod).ZoneSunkenSea) { return 0f; } return SpawnCondition.DesertCave.Chance * 0.05f; } - public override void OnHitPlayer(Player player, int damage, bool crit) - { - player.AddBuff(mod.BuffType("HolyLight"), 180, true); - } - public override void NPCLoot() { - if (Main.rand.Next(2) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EssenceofCinder")); - } if (Main.rand.Next(10) == 0) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.TurtleShell); diff --git a/NPCs/NormalNPCs/SandTortoise.png b/NPCs/NormalNPCs/SandTortoise.png index 9813d65dfd..1ec579c6a4 100644 Binary files a/NPCs/NormalNPCs/SandTortoise.png and b/NPCs/NormalNPCs/SandTortoise.png differ diff --git a/NPCs/NormalNPCs/ScornEater.cs b/NPCs/NormalNPCs/ScornEater.cs index e30392fe69..4248863da6 100644 --- a/NPCs/NormalNPCs/ScornEater.cs +++ b/NPCs/NormalNPCs/ScornEater.cs @@ -38,6 +38,8 @@ namespace CalamityMod.NPCs.NormalNPCs npc.value = Item.buyPrice(0, 0, 50, 0); npc.HitSound = SoundID.NPCHit23; npc.DeathSound = SoundID.NPCDeath26; + banner = npc.type; + bannerItem = mod.ItemType("ScornEaterBanner"); } public override void AI() diff --git a/NPCs/NormalNPCs/ShockstormShuttle.cs b/NPCs/NormalNPCs/ShockstormShuttle.cs index cac254b56e..955c036c54 100644 --- a/NPCs/NormalNPCs/ShockstormShuttle.cs +++ b/NPCs/NormalNPCs/ShockstormShuttle.cs @@ -33,6 +33,8 @@ namespace CalamityMod.NPCs.NormalNPCs npc.DeathSound = SoundID.NPCDeath14; npc.noGravity = true; npc.noTileCollide = true; + banner = npc.type; + bannerItem = mod.ItemType("ShockstormShuttleBanner"); } public override void AI() @@ -571,11 +573,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void NPCLoot() { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.MartianConduitPlating, Main.rand.Next(10, 30)); - if (Main.rand.Next(4) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EssenceofEleum")); - } - if (Main.rand.Next(4) == 0) + if (Main.rand.Next(3) == 0) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EssenceofCinder")); } diff --git a/NPCs/NormalNPCs/StormlionCharger.cs b/NPCs/NormalNPCs/StormlionCharger.cs index bde8417378..916cc11cd7 100644 --- a/NPCs/NormalNPCs/StormlionCharger.cs +++ b/NPCs/NormalNPCs/StormlionCharger.cs @@ -33,6 +33,8 @@ namespace CalamityMod.NPCs.NormalNPCs npc.value = Item.buyPrice(0, 0, 2, 0); npc.HitSound = SoundID.NPCHit31; npc.DeathSound = SoundID.NPCDeath34; + banner = npc.type; + bannerItem = mod.ItemType("StormlionBanner"); } public override void HitEffect(int hitDirection, double damage) @@ -52,7 +54,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override float SpawnChance(NPCSpawnInfo spawnInfo) { - if (spawnInfo.playerSafe) + if (spawnInfo.playerSafe || spawnInfo.player.GetModPlayer(mod).ZoneSunkenSea) { return 0f; } diff --git a/NPCs/NormalNPCs/SunBat.cs b/NPCs/NormalNPCs/SunBat.cs index fe0a80f6ec..676392197c 100644 --- a/NPCs/NormalNPCs/SunBat.cs +++ b/NPCs/NormalNPCs/SunBat.cs @@ -31,6 +31,8 @@ namespace CalamityMod.NPCs.NormalNPCs npc.value = Item.buyPrice(0, 0, 5, 0); npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath4; + banner = npc.type; + bannerItem = mod.ItemType("SunBatBanner"); } public override void FindFrame(int frameHeight) @@ -48,7 +50,8 @@ namespace CalamityMod.NPCs.NormalNPCs public override float SpawnChance(NPCSpawnInfo spawnInfo) { - if (spawnInfo.playerSafe || !Main.hardMode || spawnInfo.player.GetModPlayer(mod).ZoneAbyss) + if (spawnInfo.playerSafe || !Main.hardMode || spawnInfo.player.GetModPlayer(mod).ZoneAbyss || + spawnInfo.player.GetModPlayer(mod).ZoneSunkenSea) { return 0f; } @@ -78,7 +81,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void NPCLoot() { - if (Main.rand.Next(2) == 0) + if (Main.rand.Next(3) == 0) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EssenceofCinder")); } diff --git a/NPCs/NormalNPCs/Sunskater.cs b/NPCs/NormalNPCs/Sunskater.cs index 0b2a7fd92d..bfa4329bbe 100644 --- a/NPCs/NormalNPCs/Sunskater.cs +++ b/NPCs/NormalNPCs/Sunskater.cs @@ -34,7 +34,9 @@ namespace CalamityMod.NPCs.NormalNPCs npc.HitSound = SoundID.NPCHit50; npc.DeathSound = mod.GetLegacySoundSlot(SoundType.NPCKilled, "Sounds/NPCKilled/Sunskater"); npc.knockBackResist = 0.7f; - } + banner = npc.type; + bannerItem = mod.ItemType("SunskaterBanner"); + } public override void AI() { @@ -221,7 +223,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void NPCLoot() { - if (Main.hardMode) + if (Main.hardMode && Main.rand.Next(3) == 0) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EssenceofCinder")); } diff --git a/NPCs/NormalNPCs/ThiccWaifu.cs b/NPCs/NormalNPCs/ThiccWaifu.cs index ab67eef45a..46be7c20d9 100644 --- a/NPCs/NormalNPCs/ThiccWaifu.cs +++ b/NPCs/NormalNPCs/ThiccWaifu.cs @@ -35,6 +35,8 @@ namespace CalamityMod.NPCs.NormalNPCs npc.noGravity = true; npc.noTileCollide = true; npc.rarity = 2; + banner = npc.type; + bannerItem = mod.ItemType("CloudElementalBanner"); } public override void AI() @@ -430,6 +432,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void NPCLoot() { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EssenceofCinder"), Main.rand.Next(2, 4)); if (Main.expertMode) { if (Main.rand.Next(3) == 0) diff --git a/NPCs/NormalNPCs/WulfrumDrone.cs b/NPCs/NormalNPCs/WulfrumDrone.cs index 779bb65659..7ff9a5b513 100644 --- a/NPCs/NormalNPCs/WulfrumDrone.cs +++ b/NPCs/NormalNPCs/WulfrumDrone.cs @@ -33,6 +33,8 @@ namespace CalamityMod.NPCs.NormalNPCs npc.value = Item.buyPrice(0, 0, 0, 50); npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; + banner = npc.type; + bannerItem = mod.ItemType("WulfrumDroneBanner"); } public override void AI() diff --git a/NPCs/NormalNPCs/WulfrumSlime.cs b/NPCs/NormalNPCs/WulfrumSlime.cs index 616e0ac1ed..519728e561 100644 --- a/NPCs/NormalNPCs/WulfrumSlime.cs +++ b/NPCs/NormalNPCs/WulfrumSlime.cs @@ -35,6 +35,8 @@ namespace CalamityMod.NPCs.NormalNPCs npc.noTileCollide = false; npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; + banner = npc.type; + bannerItem = mod.ItemType("WulfrumSlimeBanner"); } public override float SpawnChance(NPCSpawnInfo spawnInfo) diff --git a/NPCs/Perforator/PerforatorBodyLarge.cs b/NPCs/Perforator/PerforatorBodyLarge.cs index 45008eaa14..6a09462b12 100644 --- a/NPCs/Perforator/PerforatorBodyLarge.cs +++ b/NPCs/Perforator/PerforatorBodyLarge.cs @@ -39,6 +39,7 @@ namespace CalamityMod.NPCs.Perforator npc.behindTiles = true; npc.noGravity = true; npc.noTileCollide = true; + npc.canGhostHeal = false; npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; npc.netAlways = true; diff --git a/NPCs/Perforator/PerforatorBodyMedium.cs b/NPCs/Perforator/PerforatorBodyMedium.cs index 1833ed014b..bbbce4c823 100644 --- a/NPCs/Perforator/PerforatorBodyMedium.cs +++ b/NPCs/Perforator/PerforatorBodyMedium.cs @@ -39,6 +39,7 @@ namespace CalamityMod.NPCs.Perforator npc.behindTiles = true; npc.noGravity = true; npc.noTileCollide = true; + npc.canGhostHeal = false; npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; npc.netAlways = true; diff --git a/NPCs/Perforator/PerforatorBodySmall.cs b/NPCs/Perforator/PerforatorBodySmall.cs index 06559d7c6b..48cc57f6fa 100644 --- a/NPCs/Perforator/PerforatorBodySmall.cs +++ b/NPCs/Perforator/PerforatorBodySmall.cs @@ -39,6 +39,7 @@ namespace CalamityMod.NPCs.Perforator npc.behindTiles = true; npc.noGravity = true; npc.noTileCollide = true; + npc.canGhostHeal = false; npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; npc.netAlways = true; diff --git a/NPCs/Perforator/PerforatorHive.cs b/NPCs/Perforator/PerforatorHive.cs index 8e4812ccdd..d2e6414f51 100644 --- a/NPCs/Perforator/PerforatorHive.cs +++ b/NPCs/Perforator/PerforatorHive.cs @@ -14,16 +14,16 @@ namespace CalamityMod.NPCs.Perforator [AutoloadBossHead] public class PerforatorHive : ModNPC { - private bool small = false; - private bool medium = false; - private bool large = false; - + private bool small = false; + private bool medium = false; + private bool large = false; + public override void SetStaticDefaults() { DisplayName.SetDefault("The Perforator Hive"); Main.npcFrameCount[npc.type] = 10; } - + public override void SetDefaults() { npc.npcSlots = 18f; @@ -32,16 +32,18 @@ namespace CalamityMod.NPCs.Perforator npc.height = 100; //216 npc.defense = 0; npc.lifeMax = CalamityWorld.revenge ? 3594 : 2500; - if (CalamityWorld.death) - { - npc.lifeMax = 5031; - } - if (CalamityWorld.bossRushActive) - { - npc.lifeMax = CalamityWorld.death ? 4000000 : 3500000; - } - npc.aiStyle = -1; //new - aiType = -1; //new + if (CalamityWorld.death) + { + npc.lifeMax = 5031; + } + if (CalamityWorld.bossRushActive) + { + npc.lifeMax = CalamityWorld.death ? 2000000 : 1800000; + } + npc.aiStyle = -1; //new + aiType = -1; //new + npc.buffImmune[mod.BuffType("GlacialState")] = true; + npc.buffImmune[mod.BuffType("TemporalSadness")] = true; npc.knockBackResist = 0f; npc.value = Item.buyPrice(0, 6, 0, 0); npc.boss = true; @@ -49,22 +51,22 @@ namespace CalamityMod.NPCs.Perforator npc.noTileCollide = true; npc.HitSound = SoundID.NPCHit13; npc.DeathSound = SoundID.NPCDeath19; - Mod calamityModMusic = ModLoader.GetMod("CalamityModMusic"); - if (calamityModMusic != null) - music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/BloodCoagulant"); - else - music = MusicID.Boss2; - bossBag = mod.ItemType("PerforatorBag"); + Mod calamityModMusic = ModLoader.GetMod("CalamityModMusic"); + if (calamityModMusic != null) + music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/BloodCoagulant"); + else + music = MusicID.Boss2; + bossBag = mod.ItemType("PerforatorBag"); } - + public override void FindFrame(int frameHeight) - { - npc.frameCounter += 0.15f; - npc.frameCounter %= Main.npcFrameCount[npc.type]; - int frame = (int)npc.frameCounter; - npc.frame.Y = frame * frameHeight; - } - + { + npc.frameCounter += 0.15f; + npc.frameCounter %= Main.npcFrameCount[npc.type]; + int frame = (int)npc.frameCounter; + npc.frame.Y = frame * frameHeight; + } + public override void AI() { Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 1.5f, 0f, 0f); @@ -72,14 +74,14 @@ namespace CalamityMod.NPCs.Perforator bool isCrimson = player.ZoneCrimson || CalamityWorld.bossRushActive; bool expertMode = (Main.expertMode || CalamityWorld.bossRushActive); bool revenge = (CalamityWorld.revenge || CalamityWorld.bossRushActive); - if (Vector2.Distance(player.Center, npc.Center) > 5600f) - { - if (npc.timeLeft > 10) - { - npc.timeLeft = 10; - } - } - if (!player.active || player.dead) + if (Vector2.Distance(player.Center, npc.Center) > 5600f) + { + if (npc.timeLeft > 10) + { + npc.timeLeft = 10; + } + } + if (!player.active || player.dead) { npc.TargetClosest(false); player = Main.player[npc.target]; @@ -114,178 +116,178 @@ namespace CalamityMod.NPCs.Perforator if (Main.netMode != 1) { int shoot = revenge ? 6 : 4; - if (CalamityWorld.death || CalamityWorld.bossRushActive) - { - shoot += 3; - } + if (CalamityWorld.death || CalamityWorld.bossRushActive) + { + shoot += 3; + } npc.localAI[0] += (float)Main.rand.Next(shoot); - if (npc.localAI[0] >= (float)Main.rand.Next(300, 900)) - { - npc.localAI[0] = 0f; - Main.PlaySound(3, (int)npc.position.X, (int)npc.position.Y, 20); - for (int num621 = 0; num621 < 8; num621++) - { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 170, 0f, 0f, 100, default(Color), 2f); - Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) - { - Main.dust[num622].scale = 0.5f; - Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; - } - } - for (int num623 = 0; num623 < 16; num623++) - { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 5, 0f, 0f, 100, default(Color), 3f); - Main.dust[num624].noGravity = true; - Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 5, 0f, 0f, 100, default(Color), 2f); - Main.dust[num624].velocity *= 2f; - } - npc.TargetClosest(true); - float num179 = 8f; - Vector2 value9 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num180 = player.position.X + (float)player.width * 0.5f - value9.X; - float num181 = Math.Abs(num180) * 0.1f; - float num182 = player.position.Y + (float)player.height * 0.5f - value9.Y - num181; - float num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182)); - npc.netUpdate = true; - num183 = num179 / num183; - num180 *= num183; - num182 *= num183; - int num184 = expertMode ? 14 : 18; - int num185 = (Main.rand.Next(2) == 0 ? mod.ProjectileType("IchorShot") : mod.ProjectileType("BloodGeyser")); - value9.X += num180; - value9.Y += num182; - for (int num186 = 0; num186 < 20; num186++) - { - num180 = player.position.X + (float)player.width * 0.5f - value9.X; - num182 = player.position.Y + (float)player.height * 0.5f - value9.Y; - num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182)); - num183 = num179 / num183; - num180 += (float)Main.rand.Next(-180, 181); - num180 *= num183; - Projectile.NewProjectile(value9.X, value9.Y, num180, -5f, num185, num184, 0f, Main.myPlayer, 0f, 0f); - } - } - } + if (npc.localAI[0] >= (float)Main.rand.Next(300, 900)) + { + npc.localAI[0] = 0f; + Main.PlaySound(3, (int)npc.position.X, (int)npc.position.Y, 20); + for (int num621 = 0; num621 < 8; num621++) + { + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 170, 0f, 0f, 100, default(Color), 2f); + Main.dust[num622].velocity *= 3f; + if (Main.rand.Next(2) == 0) + { + Main.dust[num622].scale = 0.5f; + Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + } + } + for (int num623 = 0; num623 < 16; num623++) + { + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 5, 0f, 0f, 100, default(Color), 3f); + Main.dust[num624].noGravity = true; + Main.dust[num624].velocity *= 5f; + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 5, 0f, 0f, 100, default(Color), 2f); + Main.dust[num624].velocity *= 2f; + } + npc.TargetClosest(true); + float num179 = 8f; + Vector2 value9 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float num180 = player.position.X + (float)player.width * 0.5f - value9.X; + float num181 = Math.Abs(num180) * 0.1f; + float num182 = player.position.Y + (float)player.height * 0.5f - value9.Y - num181; + float num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182)); + npc.netUpdate = true; + num183 = num179 / num183; + num180 *= num183; + num182 *= num183; + int num184 = expertMode ? 14 : 18; + int num185 = (Main.rand.Next(2) == 0 ? mod.ProjectileType("IchorShot") : mod.ProjectileType("BloodGeyser")); + value9.X += num180; + value9.Y += num182; + for (int num186 = 0; num186 < 20; num186++) + { + num180 = player.position.X + (float)player.width * 0.5f - value9.X; + num182 = player.position.Y + (float)player.height * 0.5f - value9.Y; + num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182)); + num183 = num179 / num183; + num180 += (float)Main.rand.Next(-180, 181); + num180 *= num183; + Projectile.NewProjectile(value9.X, value9.Y, num180, -5f, num185, num184, 0f, Main.myPlayer, 0f, 0f); + } + } + } npc.rotation = npc.velocity.X * 0.04f; npc.spriteDirection = ((npc.direction > 0) ? 1 : -1); - if (npc.position.Y > player.position.Y - 160f) //200 - { - if (npc.velocity.Y > 0f) - { - npc.velocity.Y = npc.velocity.Y * 0.98f; - } - npc.velocity.Y = npc.velocity.Y - 0.1f; - if (npc.velocity.Y > 2f) - { - npc.velocity.Y = 2f; - } - } - else if (npc.position.Y < player.position.Y - 400f) //500 - { - if (npc.velocity.Y < 0f) - { - npc.velocity.Y = npc.velocity.Y * 0.98f; - } - npc.velocity.Y = npc.velocity.Y + 0.1f; - if (npc.velocity.Y < -2f) - { - npc.velocity.Y = -2f; - } - } - if (npc.position.X + (float)(npc.width / 2) > player.position.X + (float)(player.width / 2) + 80f) - { - if (npc.velocity.X > 0f) - { - npc.velocity.X = npc.velocity.X * 0.98f; - } - npc.velocity.X = npc.velocity.X - 0.1f; - if (npc.velocity.X > 8f) - { - npc.velocity.X = 8f; - } - } - if (npc.position.X + (float)(npc.width / 2) < player.position.X + (float)(player.width / 2) - 80f) - { - if (npc.velocity.X < 0f) - { - npc.velocity.X = npc.velocity.X * 0.98f; - } - npc.velocity.X = npc.velocity.X + 0.1f; - if (npc.velocity.X < -8f) - { - npc.velocity.X = -8f; - } - } - if (npc.ai[3] == 0f && npc.life > 0) - { - npc.ai[3] = (float)npc.lifeMax; - } - if (npc.life > 0) - { - if (Main.netMode != 1) - { - int num660 = (int)((double)npc.lifeMax * 0.3); - if ((float)(npc.life + num660) < npc.ai[3]) - { - npc.ai[3] = (float)npc.life; - int wormType = mod.NPCType("PerforatorHeadSmall"); - if (!small) - { - small = true; - } - else if (!medium) - { - medium = true; - wormType = mod.NPCType("PerforatorHeadMedium"); - } - else if (!large) - { - large = true; - wormType = mod.NPCType("PerforatorHeadLarge"); - } - NPC.SpawnOnPlayer(npc.FindClosestPlayer(), wormType); - return; - } - } - } - } + if (npc.position.Y > player.position.Y - 160f) //200 + { + if (npc.velocity.Y > 0f) + { + npc.velocity.Y = npc.velocity.Y * 0.98f; + } + npc.velocity.Y = npc.velocity.Y - 0.1f; + if (npc.velocity.Y > 2f) + { + npc.velocity.Y = 2f; + } + } + else if (npc.position.Y < player.position.Y - 400f) //500 + { + if (npc.velocity.Y < 0f) + { + npc.velocity.Y = npc.velocity.Y * 0.98f; + } + npc.velocity.Y = npc.velocity.Y + 0.1f; + if (npc.velocity.Y < -2f) + { + npc.velocity.Y = -2f; + } + } + if (npc.position.X + (float)(npc.width / 2) > player.position.X + (float)(player.width / 2) + 80f) + { + if (npc.velocity.X > 0f) + { + npc.velocity.X = npc.velocity.X * 0.98f; + } + npc.velocity.X = npc.velocity.X - 0.1f; + if (npc.velocity.X > 8f) + { + npc.velocity.X = 8f; + } + } + if (npc.position.X + (float)(npc.width / 2) < player.position.X + (float)(player.width / 2) - 80f) + { + if (npc.velocity.X < 0f) + { + npc.velocity.X = npc.velocity.X * 0.98f; + } + npc.velocity.X = npc.velocity.X + 0.1f; + if (npc.velocity.X < -8f) + { + npc.velocity.X = -8f; + } + } + if (npc.ai[3] == 0f && npc.life > 0) + { + npc.ai[3] = (float)npc.lifeMax; + } + if (npc.life > 0) + { + if (Main.netMode != 1) + { + int num660 = (int)((double)npc.lifeMax * 0.3); + if ((float)(npc.life + num660) < npc.ai[3]) + { + npc.ai[3] = (float)npc.life; + int wormType = mod.NPCType("PerforatorHeadSmall"); + if (!small) + { + small = true; + } + else if (!medium) + { + medium = true; + wormType = mod.NPCType("PerforatorHeadMedium"); + } + else if (!large) + { + large = true; + wormType = mod.NPCType("PerforatorHeadLarge"); + } + NPC.SpawnOnPlayer(npc.FindClosestPlayer(), wormType); + return; + } + } + } + } - public override bool CheckDead() - { - if (NPC.AnyNPCs(mod.NPCType("PerforatorHeadLarge"))) - { - return false; - } - return true; - } + public override bool CheckDead() + { + if (NPC.AnyNPCs(mod.NPCType("PerforatorHeadLarge"))) + { + return false; + } + return true; + } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { npc.lifeMax = (int)(npc.lifeMax * 0.8f * bossLifeScale); npc.damage = (int)(npc.damage * 0.8f); } - + public override void BossLoot(ref string name, ref int potionType) { potionType = ItemID.HealingPotion; } - + public override void NPCLoot() { if (Main.rand.Next(10) == 0) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("PerforatorTrophy")); } - if (CalamityWorld.armageddon) - { - for (int i = 0; i < 10; i++) - { - npc.DropBossBags(); - } - } - if (Main.expertMode) + if (CalamityWorld.armageddon) + { + for (int i = 0; i < 5; i++) + { + npc.DropBossBags(); + } + } + if (Main.expertMode) { npc.DropBossBags(); } @@ -330,13 +332,13 @@ namespace CalamityMod.NPCs.Perforator Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BloodSample"), Main.rand.Next(7, 15)); Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Vertebrae, Main.rand.Next(3, 10)); Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.CrimtaneBar, Main.rand.Next(2, 6)); - if (Main.hardMode) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Ichor, Main.rand.Next(10, 21)); - } - } + if (Main.hardMode) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Ichor, Main.rand.Next(10, 21)); + } + } } - + public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < damage / npc.lifeMax * 100.0; k++) @@ -345,11 +347,11 @@ namespace CalamityMod.NPCs.Perforator } if (npc.life <= 0) { - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Hive"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Hive2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Hive3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Hive4"), 1f); - npc.position.X = npc.position.X + (float)(npc.width / 2); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Hive"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Hive2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Hive3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Hive4"), 1f); + npc.position.X = npc.position.X + (float)(npc.width / 2); npc.position.Y = npc.position.Y + (float)(npc.height / 2); npc.width = 100; npc.height = 100; diff --git a/NPCs/Perforator/PerforatorTailLarge.cs b/NPCs/Perforator/PerforatorTailLarge.cs index 5aa3d37ed2..5f0fbbf0d6 100644 --- a/NPCs/Perforator/PerforatorTailLarge.cs +++ b/NPCs/Perforator/PerforatorTailLarge.cs @@ -39,6 +39,7 @@ namespace CalamityMod.NPCs.Perforator npc.behindTiles = true; npc.noGravity = true; npc.noTileCollide = true; + npc.canGhostHeal = false; npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; npc.netAlways = true; diff --git a/NPCs/Perforator/PerforatorTailMedium.cs b/NPCs/Perforator/PerforatorTailMedium.cs index 2c546b2bac..9987db2491 100644 --- a/NPCs/Perforator/PerforatorTailMedium.cs +++ b/NPCs/Perforator/PerforatorTailMedium.cs @@ -39,6 +39,7 @@ namespace CalamityMod.NPCs.Perforator npc.behindTiles = true; npc.noGravity = true; npc.noTileCollide = true; + npc.canGhostHeal = false; npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; npc.netAlways = true; diff --git a/NPCs/Perforator/PerforatorTailSmall.cs b/NPCs/Perforator/PerforatorTailSmall.cs index 2c67b1ad88..bf32322d79 100644 --- a/NPCs/Perforator/PerforatorTailSmall.cs +++ b/NPCs/Perforator/PerforatorTailSmall.cs @@ -40,6 +40,7 @@ namespace CalamityMod.NPCs.Perforator npc.behindTiles = true; npc.noGravity = true; npc.noTileCollide = true; + npc.canGhostHeal = false; npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; npc.netAlways = true; diff --git a/NPCs/PlaguebringerGoliath/PlagueBeeG.cs b/NPCs/PlaguebringerGoliath/PlagueBeeG.cs index 6d74233ebb..25111c231e 100644 --- a/NPCs/PlaguebringerGoliath/PlagueBeeG.cs +++ b/NPCs/PlaguebringerGoliath/PlagueBeeG.cs @@ -38,6 +38,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath npc.DeathSound = SoundID.NPCDeath14; npc.noGravity = true; npc.noTileCollide = true; + npc.canGhostHeal = false; npc.buffImmune[189] = true; npc.buffImmune[153] = true; npc.buffImmune[70] = true; diff --git a/NPCs/PlaguebringerGoliath/PlagueBeeLargeG.cs b/NPCs/PlaguebringerGoliath/PlagueBeeLargeG.cs index 6339af9077..6d28e6553a 100644 --- a/NPCs/PlaguebringerGoliath/PlagueBeeLargeG.cs +++ b/NPCs/PlaguebringerGoliath/PlagueBeeLargeG.cs @@ -36,6 +36,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath npc.DeathSound = SoundID.NPCDeath14; npc.noGravity = true; npc.noTileCollide = true; + npc.canGhostHeal = false; npc.buffImmune[189] = true; npc.buffImmune[153] = true; npc.buffImmune[70] = true; diff --git a/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs b/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs index 38df2995a5..642f5a3e35 100644 --- a/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs +++ b/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs @@ -23,13 +23,14 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath npc.width = 22; //324 npc.height = 22; //216 npc.defense = 10; - npc.lifeMax = 1000; + npc.lifeMax = 200; npc.aiStyle = -1; aiType = -1; npc.knockBackResist = 0f; npc.HitSound = SoundID.NPCHit4; npc.DeathSound = SoundID.NPCDeath14; npc.noGravity = true; + npc.canGhostHeal = false; npc.buffImmune[189] = true; npc.buffImmune[153] = true; npc.buffImmune[70] = true; @@ -96,7 +97,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath npc.ai[1] = (float)Player.FindClosest(npc.position, npc.width, npc.height); npc.netUpdate = true; float num754 = npc.velocity.Length(); - npc.velocity = Vector2.Normalize(npc.velocity) * (num754 + 4.2f); //4f + npc.velocity = Vector2.Normalize(npc.velocity) * (num754 + 1f); } else if (npc.ai[0] == 1f) { diff --git a/NPCs/PlaguebringerGoliath/PlagueMine.cs b/NPCs/PlaguebringerGoliath/PlagueMine.cs index 336650eb4c..ae1039f80a 100644 --- a/NPCs/PlaguebringerGoliath/PlagueMine.cs +++ b/NPCs/PlaguebringerGoliath/PlagueMine.cs @@ -30,6 +30,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath npc.knockBackResist = 0f; npc.noGravity = true; npc.noTileCollide = true; + npc.canGhostHeal = false; npc.HitSound = SoundID.NPCHit4; npc.DeathSound = SoundID.NPCDeath14; } @@ -63,7 +64,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath return; } npc.ai[3] += 1f; - npc.dontTakeDamage = (npc.ai[3] >= 600f ? false : true); + npc.dontTakeDamage = (npc.ai[3] >= 180f ? false : true); if (npc.ai[3] >= 480f) { npc.velocity.Y *= 0.985f; diff --git a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs index 9a67736466..4b439374e3 100644 --- a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs +++ b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs @@ -18,20 +18,20 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath [AutoloadBossHead] public class PlaguebringerGoliath : ModNPC { - private const int MissileProjectiles = 5; - private const float MissileAngleSpread = 90; - private int MissileCountdown = 0; - private bool halfLife = false; - private int despawnTimer = 600; - private bool canDespawn = false; - private float chargeDistance = 0; - + private const int MissileProjectiles = 5; + private const float MissileAngleSpread = 90; + private int MissileCountdown = 0; + private bool halfLife = false; + private int despawnTimer = 600; + private bool canDespawn = false; + private float chargeDistance = 0; + public override void SetStaticDefaults() { DisplayName.SetDefault("The Plaguebringer Goliath"); Main.npcFrameCount[npc.type] = 4; } - + public override void SetDefaults() { npc.damage = 100; //150 @@ -40,52 +40,54 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath npc.height = 198; //216 npc.defense = 55; npc.lifeMax = CalamityWorld.revenge ? 77275 : 58500; - if (CalamityWorld.death) - { - npc.lifeMax = 110000; - } - if (CalamityWorld.bossRushActive) - { - npc.lifeMax = CalamityWorld.death ? 8000000 : 7200000; - } - npc.knockBackResist = 0f; + if (CalamityWorld.death) + { + npc.lifeMax = 110000; + } + if (CalamityWorld.bossRushActive) + { + npc.lifeMax = CalamityWorld.death ? 4000000 : 3700000; + } + npc.knockBackResist = 0f; npc.aiStyle = -1; //new - aiType = -1; //new + aiType = -1; //new npc.boss = true; npc.value = Item.buyPrice(0, 25, 0, 0); + NPCID.Sets.TrailCacheLength[npc.type] = 8; + NPCID.Sets.TrailingMode[npc.type] = 1; for (int k = 0; k < npc.buffImmune.Length; k++) { - npc.buffImmune[k] = true; - npc.buffImmune[BuffID.Ichor] = false; - npc.buffImmune[BuffID.CursedInferno] = false; - npc.buffImmune[BuffID.Daybreak] = false; - npc.buffImmune[mod.BuffType("AbyssalFlames")] = false; - npc.buffImmune[mod.BuffType("ArmorCrunch")] = false; - npc.buffImmune[mod.BuffType("DemonFlames")] = false; - npc.buffImmune[mod.BuffType("GodSlayerInferno")] = false; - npc.buffImmune[mod.BuffType("HolyLight")] = false; - npc.buffImmune[mod.BuffType("Nightwither")] = false; - npc.buffImmune[mod.BuffType("Shred")] = false; - npc.buffImmune[mod.BuffType("WhisperingDeath")] = false; - npc.buffImmune[mod.BuffType("SilvaStun")] = false; - } + npc.buffImmune[k] = true; + npc.buffImmune[BuffID.Ichor] = false; + npc.buffImmune[BuffID.CursedInferno] = false; + npc.buffImmune[BuffID.Daybreak] = false; + npc.buffImmune[mod.BuffType("AbyssalFlames")] = false; + npc.buffImmune[mod.BuffType("ArmorCrunch")] = false; + npc.buffImmune[mod.BuffType("DemonFlames")] = false; + npc.buffImmune[mod.BuffType("GodSlayerInferno")] = false; + npc.buffImmune[mod.BuffType("HolyLight")] = false; + npc.buffImmune[mod.BuffType("Nightwither")] = false; + npc.buffImmune[mod.BuffType("Shred")] = false; + npc.buffImmune[mod.BuffType("WhisperingDeath")] = false; + npc.buffImmune[mod.BuffType("SilvaStun")] = false; + } npc.noGravity = true; npc.noTileCollide = true; npc.HitSound = SoundID.NPCHit4; npc.DeathSound = SoundID.NPCDeath14; - Mod calamityModMusic = ModLoader.GetMod("CalamityModMusic"); - if (calamityModMusic != null) - music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/PlaguebringerGoliath"); - else - music = MusicID.Boss3; + Mod calamityModMusic = ModLoader.GetMod("CalamityModMusic"); + if (calamityModMusic != null) + music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/PlaguebringerGoliath"); + else + music = MusicID.Boss3; bossBag = mod.ItemType("PlaguebringerGoliathBag"); } - + public override void AI() { bool revenge = (CalamityWorld.revenge || CalamityWorld.bossRushActive); bool expertMode = (Main.expertMode || CalamityWorld.bossRushActive); - Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 0.15f, 0.35f, 0.05f); + Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 0.15f, 0.35f, 0.05f); if (!halfLife && ((double)npc.life <= (double)npc.lifeMax * 0.5 || CalamityWorld.death || CalamityWorld.bossRushActive)) { string key = "Mods.CalamityMod.PlagueBossText"; @@ -100,15 +102,15 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath } halfLife = true; } - if (halfLife && MissileCountdown == 0) - { - MissileCountdown = 600; - } + if (halfLife && MissileCountdown == 0) + { + MissileCountdown = 600; + } if (MissileCountdown > 1) { MissileCountdown--; } - int num1038 = 0; + int num1038 = 0; for (int num1039 = 0; num1039 < 255; num1039++) { if (Main.player[num1039].active && !Main.player[num1039].dead && (npc.Center - Main.player[num1039].Center).Length() < 1000f) @@ -121,840 +123,866 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath int num1040 = (int)(50f * (1f - (float)npc.life / (float)npc.lifeMax)); npc.defense = npc.defDefense + num1040; } - if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead || !Main.player[npc.target].active) - { - npc.TargetClosest(true); - } - Vector2 distFromPlayer = Main.player[npc.target].Center - npc.Center; - bool jungleEnrage = false; - if (!Main.player[npc.target].ZoneJungle && !CalamityWorld.bossRushActive) - { - jungleEnrage = true; - } - if (jungleEnrage || Vector2.Distance(Main.player[npc.target].Center, npc.Center) > 5600f) - { - if (despawnTimer > 0) - { - despawnTimer--; - } - } - else - { - despawnTimer = 600; - } - canDespawn = (despawnTimer <= 0); - if (canDespawn) - { - if (npc.timeLeft > 10) - { - npc.timeLeft = 10; - } - } - if (npc.ai[0] == -1f) - { - if (Main.netMode != 1) - { - float num595 = npc.ai[1]; - int num596; - do - { - num596 = Main.rand.Next(3); - if (MissileCountdown == 1) - { - num596 = 4; - } - else if (num596 == 1) - { - num596 = 2; - } - else if (num596 == 2) - { - num596 = 3; - } - } - while ((float)num596 == num595); - if (num596 == 0 && ((double)npc.life <= (double)npc.lifeMax * 0.8 || CalamityWorld.death) && distFromPlayer.Length() < 1800f) - { - switch (Main.rand.Next(3)) - { - case 0: chargeDistance = 0f; break; - case 1: chargeDistance = 400f; break; - case 2: chargeDistance = -400f; break; - } - } - npc.ai[0] = (float)num596; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] = 0f; - return; - } - } - else if (npc.ai[0] == 0f) - { - int num1043 = 2; //2 - if ((npc.ai[1] > (float)(2 * num1043) && npc.ai[1] % 2f == 0f) || distFromPlayer.Length() > 1800f) - { - npc.ai[0] = -1f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.netUpdate = true; - return; - } - if (npc.ai[1] % 2f == 0f) - { - npc.TargetClosest(true); - if (Math.Abs(npc.position.Y + (float)(npc.height / 2) - (Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - chargeDistance)) < 20f) - { - switch (Main.rand.Next(3)) - { - case 0: chargeDistance = 0f; break; - case 1: chargeDistance = 400f; break; - case 2: chargeDistance = -400f; break; - } - npc.localAI[0] = 1f; - npc.ai[1] += 1f; - npc.ai[2] = 0f; - float num1044 = revenge ? 28f : 26f; //16 - if ((double)npc.life < (double)npc.lifeMax * 0.75) - { - num1044 += 2f; //2 not a prob - } - if ((double)npc.life < (double)npc.lifeMax * 0.5) - { - num1044 += 2f; //2 not a prob - } - if ((double)npc.life < (double)npc.lifeMax * 0.25) - { - num1044 += 2f; //2 not a prob - } - if ((double)npc.life < (double)npc.lifeMax * 0.1 || CalamityWorld.bossRushActive) - { - num1044 += 2f; //2 not a prob - } - if (npc.GetGlobalNPC(mod).enraged) - { - num1044 += 2f; - } - Vector2 vector117 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num1045 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector117.X; - float num1046 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector117.Y; - float num1047 = (float)Math.Sqrt((double)(num1045 * num1045 + num1046 * num1046)); - num1047 = num1044 / num1047; - npc.velocity.X = num1045 * num1047; - npc.velocity.Y = num1046 * num1047; - npc.spriteDirection = npc.direction; - Main.PlaySound(15, (int)npc.position.X, (int)npc.position.Y, 0); - return; - } - npc.localAI[0] = 0f; - float num1048 = revenge ? 10f : 9f; //12 not a prob - float num1049 = revenge ? 0.15f : 0.13f; //0.15 not a prob - if ((double)npc.life < (double)npc.lifeMax * 0.75) - { - num1048 += 1f; //1 not a prob - num1049 += 0.05f; //0.05 not a prob - } - if ((double)npc.life < (double)npc.lifeMax * 0.5) - { - num1048 += 1f; //1 not a prob - num1049 += 0.05f; //0.05 not a prob - } - if ((double)npc.life < (double)npc.lifeMax * 0.25) - { - num1048 += 2f; //2 not a prob - num1049 += 0.05f; //0.05 not a prob - } - if ((double)npc.life < (double)npc.lifeMax * 0.1 || CalamityWorld.bossRushActive) - { - num1048 += 2f; //2 not a prob - num1049 += 0.1f; //0.1 not a prob - } - if (npc.GetGlobalNPC(mod).enraged) - { - num1048 += 2f; - num1049 += 0.1f; - } - if (npc.position.Y + (float)(npc.height / 2) < (Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - chargeDistance)) - { - npc.velocity.Y = npc.velocity.Y + num1049; - } - else - { - npc.velocity.Y = npc.velocity.Y - num1049; - } - if (npc.velocity.Y < -12f) - { - npc.velocity.Y = -num1048; - } - if (npc.velocity.Y > 12f) - { - npc.velocity.Y = num1048; - } - if (Math.Abs(npc.position.X + (float)(npc.width / 2) - (Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2))) > 600f) - { - npc.velocity.X = npc.velocity.X + 0.15f * (float)npc.direction; - } - else if (Math.Abs(npc.position.X + (float)(npc.width / 2) - (Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2))) < 300f) - { - npc.velocity.X = npc.velocity.X - 0.15f * (float)npc.direction; - } - else - { - npc.velocity.X = npc.velocity.X * 0.8f; - } - if (npc.velocity.X < -16f) - { - npc.velocity.X = -16f; - } - if (npc.velocity.X > 16f) - { - npc.velocity.X = 16f; - } - npc.spriteDirection = npc.direction; - return; - } - else - { - if (npc.velocity.X < 0f) - { - npc.direction = -1; - } - else - { - npc.direction = 1; - } - npc.spriteDirection = npc.direction; - int num1050 = 500; //600 not a prob - if (npc.GetGlobalNPC(mod).enraged) - { - num1050 = 200; - } - else if (CalamityWorld.death || CalamityWorld.bossRushActive) - { - num1050 = 250; - } - else if ((double)npc.life < (double)npc.lifeMax * 0.1) - { - num1050 = revenge ? 300 : 350; //300 not a prob - } - else if ((double)npc.life < (double)npc.lifeMax * 0.25) - { - num1050 = revenge ? 350 : 375; //450 not a prob - } - else if ((double)npc.life < (double)npc.lifeMax * 0.5) - { - num1050 = 400; //500 not a prob - } - else if ((double)npc.life < (double)npc.lifeMax * 0.75) - { - num1050 = 450; //550 not a prob - } - int num1051 = 1; - if (npc.position.X + (float)(npc.width / 2) < Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2)) - { - num1051 = -1; - } - if (npc.direction == num1051 && Math.Abs(npc.position.X + (float)(npc.width / 2) - (Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2))) > (float)num1050) - { - npc.ai[2] = 1f; - } - if (npc.ai[2] != 1f) - { - npc.localAI[0] = 1f; - return; - } - npc.TargetClosest(true); - npc.spriteDirection = npc.direction; - npc.localAI[0] = 0f; - npc.velocity *= 0.9f; - float num1052 = revenge ? 0.13f : 0.115f; //0.1 - if (npc.life < npc.lifeMax / 2) - { - npc.velocity *= 0.9f; - num1052 += 0.05f; //0.05 - } - if (npc.life < npc.lifeMax / 3) - { - npc.velocity *= 0.9f; - num1052 += 0.05f; //0.05 - } - if (npc.life < npc.lifeMax / 5 || CalamityWorld.bossRushActive) - { - npc.velocity *= 0.9f; - num1052 += 0.05f; //0.05 - } - if (Math.Abs(npc.velocity.X) + Math.Abs(npc.velocity.Y) < num1052) - { - npc.ai[2] = 0f; - npc.ai[1] += 1f; - return; - } - } - } - else if (npc.ai[0] == 2f) - { - npc.TargetClosest(true); - npc.spriteDirection = npc.direction; - float num1053 = 12f; //12 found one! dictates speed during bee spawn - float num1054 = 0.2f; //0.1 found one! dictates speed during bee spawn - float num10542 = 0.1f; - Vector2 vector118 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num1055 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector118.X; - float num1056 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - 200f - vector118.Y; - float num1057 = (float)Math.Sqrt((double)(num1055 * num1055 + num1056 * num1056)); - if (num1057 < 800f) - { - npc.ai[0] = (((double)npc.life <= (double)npc.lifeMax * 0.66 || CalamityWorld.death) ? 5f : 1f); - npc.ai[1] = 0f; - npc.netUpdate = true; - return; - } - num1057 = num1053 / num1057; - if (npc.velocity.X < num1055) - { - npc.velocity.X = npc.velocity.X + num1054; - if (npc.velocity.X < 0f && num1055 > 0f) - { - npc.velocity.X = npc.velocity.X + num1054; - } - } - else if (npc.velocity.X > num1055) - { - npc.velocity.X = npc.velocity.X - num1054; - if (npc.velocity.X > 0f && num1055 < 0f) - { - npc.velocity.X = npc.velocity.X - num1054; - } - } - if (npc.velocity.Y < num1056) - { - npc.velocity.Y = npc.velocity.Y + num10542; - if (npc.velocity.Y < 0f && num1056 > 0f) - { - npc.velocity.Y = npc.velocity.Y + num10542; - return; - } - } - else if (npc.velocity.Y > num1056) - { - npc.velocity.Y = npc.velocity.Y - num10542; - if (npc.velocity.Y > 0f && num1056 < 0f) - { - npc.velocity.Y = npc.velocity.Y - num10542; - return; - } - } - } - else if (npc.ai[0] == 1f) - { - npc.localAI[0] = 0f; - npc.TargetClosest(true); - Vector2 vector119 = new Vector2(npc.position.X + (float)(npc.width / 2) + (float)(Main.rand.Next(20) * npc.direction), npc.position.Y + (float)npc.height * 0.8f); - Vector2 vector120 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num1058 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector120.X; - float num1059 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector120.Y; - float num1060 = (float)Math.Sqrt((double)(num1058 * num1058 + num1059 * num1059)); - npc.ai[1] += 1f; - npc.ai[1] += (float)(num1038 / 2); - if ((double)npc.life < (double)npc.lifeMax * 0.75 || CalamityWorld.bossRushActive) - { - npc.ai[1] += 0.25f; //0.25 not a prob - } - if ((double)npc.life < (double)npc.lifeMax * 0.5 || CalamityWorld.bossRushActive) - { - npc.ai[1] += 0.25f; //0.25 not a prob - } - bool flag103 = false; - if (npc.ai[1] > 40f) //changed from 40 not a prob - { - npc.ai[1] = 0f; - npc.ai[2] += 1f; - flag103 = true; - } - if (Collision.CanHit(vector119, 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height) && flag103) - { - Main.PlaySound(3, (int)npc.position.X, (int)npc.position.Y, 8); - if (Main.netMode != 1) - { - int randomAmt = expertMode ? 2 : 4; - int num1061; - if (Main.rand.Next(randomAmt) == 0) - { - num1061 = mod.NPCType("PlagueBeeLargeG"); - } - else - { - num1061 = mod.NPCType("PlagueBeeG"); - } - if (expertMode && NPC.CountNPCS(mod.NPCType("PlagueMine")) < 2) - { - NPC.NewNPC((int)vector119.X, (int)vector119.Y, mod.NPCType("PlagueMine"), 0, 0f, 0f, 0f, 0f, 255); - } - if (revenge && NPC.CountNPCS(mod.NPCType("PlaguebringerShade")) < 1) - { - NPC.NewNPC((int)vector119.X, (int)vector119.Y, mod.NPCType("PlaguebringerShade"), 0, 0f, 0f, 0f, 0f, 255); - } - if (NPC.CountNPCS(mod.NPCType("PlagueBeeLargeG")) < 2) - { - int num1062 = NPC.NewNPC((int)vector119.X, (int)vector119.Y, num1061, 0, 0f, 0f, 0f, 0f, 255); - Main.npc[num1062].velocity.X = (float)Main.rand.Next(-200, 201) * 0.02f; - Main.npc[num1062].velocity.Y = (float)Main.rand.Next(-200, 201) * 0.02f; - Main.npc[num1062].localAI[0] = 60f; - Main.npc[num1062].netUpdate = true; - } - } - } - if (num1060 > 800f || !Collision.CanHit(new Vector2(vector119.X, vector119.Y - 30f), 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) - { - float num1063 = 14f; //changed from 14 not a prob - float num1064 = 0.2f; //changed from 0.1 not a prob - float num10642 = 0.07f; - vector120 = vector119; - num1058 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector120.X; - num1059 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector120.Y; - num1060 = (float)Math.Sqrt((double)(num1058 * num1058 + num1059 * num1059)); - num1060 = num1063 / num1060; - if (npc.velocity.X < num1058) - { - npc.velocity.X = npc.velocity.X + num1064; - if (npc.velocity.X < 0f && num1058 > 0f) - { - npc.velocity.X = npc.velocity.X + num1064; - } - } - else if (npc.velocity.X > num1058) - { - npc.velocity.X = npc.velocity.X - num1064; - if (npc.velocity.X > 0f && num1058 < 0f) - { - npc.velocity.X = npc.velocity.X - num1064; - } - } - if (npc.velocity.Y < num1059) - { - npc.velocity.Y = npc.velocity.Y + num10642; - if (npc.velocity.Y < 0f && num1059 > 0f) - { - npc.velocity.Y = npc.velocity.Y + num10642; - } - } - else if (npc.velocity.Y > num1059) - { - npc.velocity.Y = npc.velocity.Y - num10642; - if (npc.velocity.Y > 0f && num1059 < 0f) - { - npc.velocity.Y = npc.velocity.Y - num10642; - } - } - } - else - { - npc.velocity *= 0.9f; - } - npc.spriteDirection = npc.direction; - if (npc.ai[2] > 3f) - { - npc.ai[0] = -1f; - npc.ai[1] = 1f; - npc.netUpdate = true; - return; - } - } - else if (npc.ai[0] == 5f) - { - npc.localAI[0] = 0f; - npc.TargetClosest(true); - Vector2 vector119 = new Vector2(npc.position.X + (float)(npc.width / 2) + (float)(Main.rand.Next(20) * npc.direction), npc.position.Y + (float)npc.height * 0.8f); - Vector2 vector120 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num1058 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector120.X; - float num1059 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector120.Y; - float num1060 = (float)Math.Sqrt((double)(num1058 * num1058 + num1059 * num1059)); - npc.ai[1] += 1f; - npc.ai[1] += (float)(num1038 / 2); - bool flag103 = false; - if ((double)npc.life < (double)npc.lifeMax * 0.25 || CalamityWorld.bossRushActive) - { - npc.ai[1] += 0.25f; //0.25 not a prob - } - if ((double)npc.life < (double)npc.lifeMax * 0.1 || CalamityWorld.bossRushActive) - { - npc.ai[1] += 0.25f; //0.25 not a prob - } - if (npc.ai[1] > 40f) //changed from 40 not a prob - { - npc.ai[1] = 0f; - npc.ai[2] += 1f; - flag103 = true; - } - if (Collision.CanHit(vector119, 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height) && flag103) - { - Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 88); - if (Main.netMode != 1) - { - if (expertMode && NPC.CountNPCS(mod.NPCType("PlagueMine")) < 4) - { - NPC.NewNPC((int)vector119.X, (int)vector119.Y, mod.NPCType("PlagueMine"), 0, 0f, 0f, 0f, 0f, 255); - } - float projectileSpeed = revenge ? 6f : 5f; - float num1071 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector119.X + (float)Main.rand.Next(-80, 81); - float num1072 = Main.player[npc.target].position.Y + (float)Main.player[npc.target].height * 0.5f - vector119.Y + (float)Main.rand.Next(-40, 41); - float num1073 = (float)Math.Sqrt((double)(num1071 * num1071 + num1072 * num1072)); - num1073 = projectileSpeed / num1073; - num1071 *= num1073; - num1072 *= num1073; - if (NPC.CountNPCS(mod.NPCType("PlagueHomingMissile")) < 5) - { - int num1062 = NPC.NewNPC((int)vector119.X, (int)vector119.Y, mod.NPCType("PlagueHomingMissile"), 0, 0f, 0f, 0f, 0f, 255); - Main.npc[num1062].velocity.X = num1071; - Main.npc[num1062].velocity.Y = num1072; - Main.npc[num1062].netUpdate = true; - } - } - } - if (num1060 > 800f || !Collision.CanHit(new Vector2(vector119.X, vector119.Y - 30f), 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) - { - float num1063 = 14f; //changed from 14 not a prob - float num1064 = 0.2f; //changed from 0.1 not a prob - float num10642 = 0.07f; - vector120 = vector119; - num1058 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector120.X; - num1059 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector120.Y; - num1060 = (float)Math.Sqrt((double)(num1058 * num1058 + num1059 * num1059)); - num1060 = num1063 / num1060; - if (npc.velocity.X < num1058) - { - npc.velocity.X = npc.velocity.X + num1064; - if (npc.velocity.X < 0f && num1058 > 0f) - { - npc.velocity.X = npc.velocity.X + num1064; - } - } - else if (npc.velocity.X > num1058) - { - npc.velocity.X = npc.velocity.X - num1064; - if (npc.velocity.X > 0f && num1058 < 0f) - { - npc.velocity.X = npc.velocity.X - num1064; - } - } - if (npc.velocity.Y < num1059) - { - npc.velocity.Y = npc.velocity.Y + num10642; - if (npc.velocity.Y < 0f && num1059 > 0f) - { - npc.velocity.Y = npc.velocity.Y + num10642; - } - } - else if (npc.velocity.Y > num1059) - { - npc.velocity.Y = npc.velocity.Y - num10642; - if (npc.velocity.Y > 0f && num1059 < 0f) - { - npc.velocity.Y = npc.velocity.Y - num10642; - } - } - } - else - { - npc.velocity *= 0.9f; - } - npc.spriteDirection = npc.direction; - if (npc.ai[2] > 3f) - { - npc.ai[0] = -1f; - npc.ai[1] = 1f; - npc.netUpdate = true; - return; - } - } - else if (npc.ai[0] == 3f) - { - Vector2 vector121 = new Vector2(npc.position.X + (float)(npc.width / 2) + (float)(Main.rand.Next(20) * npc.direction), npc.position.Y + (float)npc.height * 0.8f); - npc.ai[1] += 1f; - bool flag104 = false; - if (npc.GetGlobalNPC(mod).enraged) - { - if (npc.ai[1] % 10f == 9f) - { - flag104 = true; - } - } - else if ((double)npc.life < (double)npc.lifeMax * 0.1 || CalamityWorld.death || CalamityWorld.bossRushActive) - { - if (npc.ai[1] % 20f == 19f) - { - flag104 = true; - } - } - else if ((double)npc.life < (double)npc.lifeMax * 0.5) - { - if (npc.ai[1] % 25f == 24f) - { - flag104 = true; - } - } - else if (npc.ai[1] % 30f == 29f) - { - flag104 = true; - } - if (flag104 && npc.position.Y + (float)npc.height < Main.player[npc.target].position.Y && Collision.CanHit(vector121, 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) - { - Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 42); - if (Main.netMode != 1) - { - float projectileSpeed = revenge ? 7f : 6f; - if (jungleEnrage || npc.GetGlobalNPC(mod).enraged) - { - projectileSpeed += 10f; - } - float num1071 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector121.X + (float)Main.rand.Next(-80, 81); - float num1072 = Main.player[npc.target].position.Y + (float)Main.player[npc.target].height * 0.5f - vector121.Y + (float)Main.rand.Next(-40, 41); - float num1073 = (float)Math.Sqrt((double)(num1071 * num1071 + num1072 * num1072)); - num1073 = projectileSpeed / num1073; - num1071 *= num1073; - num1072 *= num1073; - int num1074 = 40; //projectile damage - int num1075 = (Main.rand.Next(2) == 0 ? mod.ProjectileType("PlagueStingerGoliath") : mod.ProjectileType("PlagueStingerGoliathV2")); - if (expertMode) - { - num1074 = 28; //112 - int damageBoost = (int)(6f * (1f - (float)npc.life / (float)npc.lifeMax)); - num1074 += damageBoost; //112 to 136 - if (Main.rand.Next(6) == 0) - { - num1074 += 8; //144 to 168 - num1075 = mod.ProjectileType("HiveBombGoliath"); - } - } - else - { - if (Main.rand.Next(9) == 0) - { - num1074 = 50; - num1075 = mod.ProjectileType("HiveBombGoliath"); - } - } - Projectile.NewProjectile(vector121.X, vector121.Y, num1071, num1072, num1075, num1074, 0f, Main.myPlayer, -1f, 0f); - } - } - if (npc.position.Y > Main.player[npc.target].position.Y - 200f) //200 - { - if (npc.velocity.Y > 0f) - { - npc.velocity.Y = npc.velocity.Y * 0.98f; - } - npc.velocity.Y = npc.velocity.Y - 0.1f; - if (npc.velocity.Y > 2f) - { - npc.velocity.Y = 2f; - } - } - else if (npc.position.Y < Main.player[npc.target].position.Y - 500f) //500 - { - if (npc.velocity.Y < 0f) - { - npc.velocity.Y = npc.velocity.Y * 0.98f; - } - npc.velocity.Y = npc.velocity.Y + 0.1f; - if (npc.velocity.Y < -2f) - { - npc.velocity.Y = -2f; - } - } - if (npc.position.X + (float)(npc.width / 2) > Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) + 100f) - { - if (npc.velocity.X > 0f) - { - npc.velocity.X = npc.velocity.X * 0.98f; - } - npc.velocity.X = npc.velocity.X - 0.1f; - 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.velocity.X < 0f) - { - npc.velocity.X = npc.velocity.X * 0.98f; - } - npc.velocity.X = npc.velocity.X + 0.1f; - if (npc.velocity.X < -8f) - { - npc.velocity.X = -8f; - } - } - float playerLocation = npc.Center.X - Main.player[npc.target].Center.X; - npc.direction = (playerLocation < 0 ? 1 : -1); - npc.spriteDirection = npc.direction; - if (npc.ai[1] > 300f) - { - npc.ai[0] = -1f; - npc.ai[1] = 3f; - npc.netUpdate = true; - return; - } - } - else if (npc.ai[0] == 4f) - { - int num1043 = 2; //2 - if (npc.ai[1] > (float)(2 * num1043) && npc.ai[1] % 2f == 0f) - { - MissileCountdown = 0; - npc.ai[0] = -1f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.netUpdate = true; - return; - } - if (npc.ai[1] % 2f == 0f) - { - npc.TargetClosest(true); - if (Math.Abs(npc.position.Y + (float)(npc.height / 2) - (Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - 500f)) < 20f) - { - if (MissileCountdown == 1) - { - Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 116); - if (Main.netMode != 1) - { - int speed = revenge ? 6 : 5; - float spawnX = Main.rand.Next(1000) - 500 + npc.Center.X; - float spawnY = npc.Center.Y; - Vector2 baseSpawn = new Vector2(spawnX, spawnY); - Vector2 baseVelocity = Main.player[npc.target].Center - baseSpawn; - baseVelocity.Normalize(); - baseVelocity = baseVelocity * speed; - int damage = expertMode ? 42 : 57; - for (int i = 0; i < MissileProjectiles; i++) - { - Vector2 spawn = baseSpawn; - spawn.X = spawn.X + i * 30 - (MissileProjectiles * 15); - Vector2 velocity = baseVelocity; - velocity = baseVelocity.RotatedBy(MathHelper.ToRadians(-MissileAngleSpread / 2 + (MissileAngleSpread * i / (float)MissileProjectiles))); - velocity.X = velocity.X + 3 * Main.rand.NextFloat() - 1.5f; - Projectile.NewProjectile(spawn.X, spawn.Y, velocity.X, velocity.Y, mod.ProjectileType("HiveBombGoliath"), damage, 10f, Main.myPlayer, 0f, Main.player[npc.target].position.Y); - } - } - } - npc.localAI[0] = 1f; - npc.ai[1] += 1f; - npc.ai[2] = 0f; - float num1044 = revenge ? 28f : 26f; //16 - Vector2 vector117 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num1045 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector117.X; - float num1046 = (Main.player[npc.target].position.Y - 500f) + (float)(Main.player[npc.target].height / 2) - vector117.Y; - float num1047 = (float)Math.Sqrt((double)(num1045 * num1045 + num1046 * num1046)); - num1047 = num1044 / num1047; - npc.velocity.X = num1045 * num1047; - npc.velocity.Y = num1046 * num1047; - npc.spriteDirection = npc.direction; - return; - } - npc.localAI[0] = 0f; - float num1048 = 12f; //12 not a prob - float num1049 = 0.15f; //0.15 not a prob - if (npc.position.Y + (float)(npc.height / 2) < (Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - 500f)) - { - npc.velocity.Y = npc.velocity.Y + num1049; - } - else - { - npc.velocity.Y = npc.velocity.Y - num1049; - } - if (npc.velocity.Y < -12f) - { - npc.velocity.Y = -num1048; - } - if (npc.velocity.Y > 12f) - { - npc.velocity.Y = num1048; - } - if (Math.Abs(npc.position.X + (float)(npc.width / 2) - (Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2))) > 600f) - { - npc.velocity.X = npc.velocity.X + 0.15f * (float)npc.direction; - } - else if (Math.Abs(npc.position.X + (float)(npc.width / 2) - (Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2))) < 300f) - { - npc.velocity.X = npc.velocity.X - 0.15f * (float)npc.direction; - } - else - { - npc.velocity.X = npc.velocity.X * 0.8f; - } - if (npc.velocity.X < -16f) - { - npc.velocity.X = -16f; - } - if (npc.velocity.X > 16f) - { - npc.velocity.X = 16f; - } - npc.spriteDirection = npc.direction; - return; - } - else - { - if (npc.velocity.X < 0f) - { - npc.direction = -1; - } - else - { - npc.direction = 1; - } - npc.spriteDirection = npc.direction; - int num1050 = 600; //600 not a prob - int num1051 = 1; - if (npc.position.X + (float)(npc.width / 2) < Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2)) - { - num1051 = -1; - } - if (npc.direction == num1051 && Math.Abs(npc.position.X + (float)(npc.width / 2) - (Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2))) > (float)num1050) - { - npc.ai[2] = 1f; - } - if (npc.ai[2] != 1f) - { - npc.localAI[0] = 1f; - return; - } - npc.TargetClosest(true); - npc.spriteDirection = npc.direction; - npc.localAI[0] = 0f; - npc.velocity *= 0.9f; - float num1052 = revenge ? 0.13f : 0.115f; //0.1 - if (npc.life < npc.lifeMax / 2) - { - npc.velocity *= 0.9f; - num1052 += 0.05f; //0.05 - } - if (npc.life < npc.lifeMax / 3) - { - npc.velocity *= 0.9f; - num1052 += 0.05f; //0.05 - } - if (npc.life < npc.lifeMax / 5 || CalamityWorld.bossRushActive) - { - npc.velocity *= 0.9f; - num1052 += 0.05f; //0.05 - } - if (Math.Abs(npc.velocity.X) + Math.Abs(npc.velocity.Y) < num1052) - { - npc.ai[2] = 0f; - npc.ai[1] += 1f; - return; - } - } - } - } + if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead || !Main.player[npc.target].active) + { + npc.TargetClosest(true); + } + Vector2 distFromPlayer = Main.player[npc.target].Center - npc.Center; + bool aboveGroundEnrage = ((double)Main.player[npc.target].position.Y < Main.worldSurface * 16.0 || + Main.player[npc.target].position.Y > (float)((Main.maxTilesY - 200) * 16)) && !CalamityWorld.bossRushActive; + bool jungleEnrage = false; + if (!Main.player[npc.target].ZoneJungle && !CalamityWorld.bossRushActive) + { + jungleEnrage = true; + } + if (jungleEnrage || Vector2.Distance(Main.player[npc.target].Center, npc.Center) > 5600f) + { + if (despawnTimer > 0) + { + despawnTimer--; + } + } + else + { + despawnTimer = 600; + } + canDespawn = (despawnTimer <= 0); + if (canDespawn) + { + if (npc.timeLeft > 10) + { + npc.timeLeft = 10; + } + } + if (npc.ai[0] == -1f) + { + if (Main.netMode != 1) + { + float num595 = npc.ai[1]; + int num596; + do + { + num596 = Main.rand.Next(3); + if (MissileCountdown == 1) + { + num596 = 4; + } + else if (num596 == 1) + { + num596 = 2; + } + else if (num596 == 2) + { + num596 = 3; + } + } + while ((float)num596 == num595); + if (num596 == 0 && ((double)npc.life <= (double)npc.lifeMax * 0.8 || CalamityWorld.death) && distFromPlayer.Length() < 1800f) + { + switch (Main.rand.Next(3)) + { + case 0: chargeDistance = 0f; break; + case 1: chargeDistance = 400f; break; + case 2: chargeDistance = -400f; break; + } + } + npc.ai[0] = (float)num596; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.ai[3] = 0f; + return; + } + } + else if (npc.ai[0] == 0f) + { + int num1043 = 2; //2 + if ((npc.ai[1] > (float)(2 * num1043) && npc.ai[1] % 2f == 0f) || distFromPlayer.Length() > 1800f) + { + npc.ai[0] = -1f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.netUpdate = true; + return; + } + if (npc.ai[1] % 2f == 0f) + { + npc.TargetClosest(true); + float playerLocation = npc.Center.X - Main.player[npc.target].Center.X; + if (Math.Abs(npc.position.Y + (float)(npc.height / 2) - (Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - chargeDistance)) < 20f) + { + switch (Main.rand.Next(3)) + { + case 0: chargeDistance = 0f; break; + case 1: chargeDistance = 400f; break; + case 2: chargeDistance = -400f; break; + } + npc.localAI[0] = 1f; + npc.ai[1] += 1f; + npc.ai[2] = 0f; + float num1044 = revenge ? 24f : 22f; //16 + if (aboveGroundEnrage) + { + num1044 += 6f; + } + if ((double)npc.life < (double)npc.lifeMax * 0.75) + { + num1044 += 2f; //2 not a prob + } + if ((double)npc.life < (double)npc.lifeMax * 0.5) + { + num1044 += 2f; //2 not a prob + } + if ((double)npc.life < (double)npc.lifeMax * 0.25) + { + num1044 += 2f; //2 not a prob + } + if ((double)npc.life < (double)npc.lifeMax * 0.1 || CalamityWorld.bossRushActive) + { + num1044 += 2f; //2 not a prob + } + if (npc.GetGlobalNPC(mod).enraged) + { + num1044 += 2f; + } + Vector2 vector117 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float num1045 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector117.X; + float num1046 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector117.Y; + float num1047 = (float)Math.Sqrt((double)(num1045 * num1045 + num1046 * num1046)); + num1047 = num1044 / num1047; + npc.velocity.X = num1045 * num1047; + npc.velocity.Y = num1046 * num1047; + npc.direction = (playerLocation < 0 ? 1 : -1); + npc.spriteDirection = npc.direction; + Main.PlaySound(15, (int)npc.position.X, (int)npc.position.Y, 0); + return; + } + npc.localAI[0] = 0f; + float num1048 = revenge ? 10f : 9f; //12 not a prob + float num1049 = revenge ? 0.15f : 0.13f; //0.15 not a prob + if ((double)npc.life < (double)npc.lifeMax * 0.75) + { + num1048 += 1f; //1 not a prob + num1049 += 0.05f; //0.05 not a prob + } + if ((double)npc.life < (double)npc.lifeMax * 0.5) + { + num1048 += 1f; //1 not a prob + num1049 += 0.05f; //0.05 not a prob + } + if ((double)npc.life < (double)npc.lifeMax * 0.25) + { + num1048 += 2f; //2 not a prob + num1049 += 0.05f; //0.05 not a prob + } + if ((double)npc.life < (double)npc.lifeMax * 0.1 || CalamityWorld.bossRushActive) + { + num1048 += 2f; //2 not a prob + num1049 += 0.1f; //0.1 not a prob + } + if (npc.GetGlobalNPC(mod).enraged) + { + num1048 += 2f; + num1049 += 0.1f; + } + if (npc.position.Y + (float)(npc.height / 2) < (Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - chargeDistance)) + { + npc.velocity.Y = npc.velocity.Y + num1049; + } + else + { + npc.velocity.Y = npc.velocity.Y - num1049; + } + if (npc.velocity.Y < -12f) + { + npc.velocity.Y = -num1048; + } + if (npc.velocity.Y > 12f) + { + npc.velocity.Y = num1048; + } + if (Math.Abs(npc.position.X + (float)(npc.width / 2) - (Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2))) > 600f) + { + npc.velocity.X = npc.velocity.X + 0.15f * (float)npc.direction; + } + else if (Math.Abs(npc.position.X + (float)(npc.width / 2) - (Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2))) < 300f) + { + npc.velocity.X = npc.velocity.X - 0.15f * (float)npc.direction; + } + else + { + npc.velocity.X = npc.velocity.X * 0.8f; + } + if (npc.velocity.X < -16f) + { + npc.velocity.X = -16f; + } + if (npc.velocity.X > 16f) + { + npc.velocity.X = 16f; + } + npc.direction = (playerLocation < 0 ? 1 : -1); + npc.spriteDirection = npc.direction; + return; + } + else + { + if (npc.velocity.X < 0f) + { + npc.direction = -1; + } + else + { + npc.direction = 1; + } + npc.spriteDirection = npc.direction; + int num1050 = 600; //600 not a prob + if (npc.GetGlobalNPC(mod).enraged) + { + num1050 = 250; + } + else if (aboveGroundEnrage) + { + num1050 = 350; + } + else if (CalamityWorld.death || CalamityWorld.bossRushActive) + { + num1050 = 400; + } + else if ((double)npc.life < (double)npc.lifeMax * 0.1) + { + num1050 = revenge ? 425 : 450; //300 not a prob + } + else if ((double)npc.life < (double)npc.lifeMax * 0.25) + { + num1050 = revenge ? 450 : 475; //450 not a prob + } + else if ((double)npc.life < (double)npc.lifeMax * 0.5) + { + num1050 = 500; //500 not a prob + } + else if ((double)npc.life < (double)npc.lifeMax * 0.75) + { + num1050 = 550; //550 not a prob + } + int num1051 = 1; + if (npc.position.X + (float)(npc.width / 2) < Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2)) + { + num1051 = -1; + } + if (npc.direction == num1051 && Math.Abs(npc.position.X + (float)(npc.width / 2) - (Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2))) > (float)num1050) + { + npc.ai[2] = 1f; + } + if (npc.ai[2] != 1f) + { + npc.localAI[0] = 1f; + return; + } + npc.TargetClosest(true); + npc.spriteDirection = npc.direction; + npc.localAI[0] = 0f; + npc.velocity *= 0.9f; + float num1052 = revenge ? 0.13f : 0.115f; //0.1 + if (npc.life < npc.lifeMax / 2) + { + npc.velocity *= 0.9f; + num1052 += 0.05f; //0.05 + } + if (npc.life < npc.lifeMax / 3) + { + npc.velocity *= 0.9f; + num1052 += 0.05f; //0.05 + } + if (npc.life < npc.lifeMax / 5 || CalamityWorld.bossRushActive) + { + npc.velocity *= 0.9f; + num1052 += 0.05f; //0.05 + } + if (Math.Abs(npc.velocity.X) + Math.Abs(npc.velocity.Y) < num1052) + { + npc.ai[2] = 0f; + npc.ai[1] += 1f; + return; + } + } + } + else if (npc.ai[0] == 2f) + { + npc.TargetClosest(true); + float playerLocation = npc.Center.X - Main.player[npc.target].Center.X; + npc.direction = (playerLocation < 0 ? 1 : -1); + npc.spriteDirection = npc.direction; + float num1053 = 12f; + float num1054 = 0.2f; + float num10542 = 0.1f; + Vector2 vector118 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float num1055 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector118.X; + float num1056 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - 200f - vector118.Y; + float num1057 = (float)Math.Sqrt((double)(num1055 * num1055 + num1056 * num1056)); + if (num1057 < 800f) + { + npc.ai[0] = (((double)npc.life <= (double)npc.lifeMax * 0.66 || CalamityWorld.death) ? 5f : 1f); + npc.ai[1] = 0f; + npc.netUpdate = true; + return; + } + num1057 = num1053 / num1057; + if (npc.velocity.X < num1055) + { + npc.velocity.X = npc.velocity.X + num1054; + if (npc.velocity.X < 0f && num1055 > 0f) + { + npc.velocity.X = npc.velocity.X + num1054; + } + } + else if (npc.velocity.X > num1055) + { + npc.velocity.X = npc.velocity.X - num1054; + if (npc.velocity.X > 0f && num1055 < 0f) + { + npc.velocity.X = npc.velocity.X - num1054; + } + } + if (npc.velocity.Y < num1056) + { + npc.velocity.Y = npc.velocity.Y + num10542; + if (npc.velocity.Y < 0f && num1056 > 0f) + { + npc.velocity.Y = npc.velocity.Y + num10542; + return; + } + } + else if (npc.velocity.Y > num1056) + { + npc.velocity.Y = npc.velocity.Y - num10542; + if (npc.velocity.Y > 0f && num1056 < 0f) + { + npc.velocity.Y = npc.velocity.Y - num10542; + return; + } + } + } + else if (npc.ai[0] == 1f) + { + npc.localAI[0] = 0f; + npc.TargetClosest(true); + Vector2 vector119 = new Vector2(npc.position.X + (float)(npc.width / 2) + (float)(Main.rand.Next(20) * npc.direction), npc.position.Y + (float)npc.height * 0.8f); + Vector2 vector120 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float num1058 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector120.X; + float num1059 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector120.Y; + float num1060 = (float)Math.Sqrt((double)(num1058 * num1058 + num1059 * num1059)); + npc.ai[1] += 1f; + npc.ai[1] += (float)(num1038 / 2); + if ((double)npc.life < (double)npc.lifeMax * 0.75 || CalamityWorld.bossRushActive) + { + npc.ai[1] += 0.25f; + } + if ((double)npc.life < (double)npc.lifeMax * 0.5 || CalamityWorld.bossRushActive) + { + npc.ai[1] += 0.25f; + } + bool flag103 = false; + if (npc.ai[1] > 40f) + { + npc.ai[1] = 0f; + npc.ai[2] += 1f; + flag103 = true; + } + if (Collision.CanHit(vector119, 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height) && flag103) + { + Main.PlaySound(3, (int)npc.position.X, (int)npc.position.Y, 8); + if (Main.netMode != 1) + { + int randomAmt = expertMode ? 2 : 4; + int num1061; + if (Main.rand.Next(randomAmt) == 0) + { + num1061 = mod.NPCType("PlagueBeeLargeG"); + } + else + { + num1061 = mod.NPCType("PlagueBeeG"); + } + if (expertMode && NPC.CountNPCS(mod.NPCType("PlagueMine")) < (aboveGroundEnrage ? 4 : 2)) + { + NPC.NewNPC((int)vector119.X, (int)vector119.Y, mod.NPCType("PlagueMine"), 0, 0f, 0f, 0f, 0f, 255); + } + if (revenge && NPC.CountNPCS(mod.NPCType("PlaguebringerShade")) < (aboveGroundEnrage ? 2 : 1)) + { + NPC.NewNPC((int)vector119.X, (int)vector119.Y, mod.NPCType("PlaguebringerShade"), 0, 0f, 0f, 0f, 0f, 255); + } + if (NPC.CountNPCS(mod.NPCType("PlagueBeeLargeG")) < 2) + { + int num1062 = NPC.NewNPC((int)vector119.X, (int)vector119.Y, num1061, 0, 0f, 0f, 0f, 0f, 255); + Main.npc[num1062].velocity.X = (float)Main.rand.Next(-200, 201) * 0.02f; + Main.npc[num1062].velocity.Y = (float)Main.rand.Next(-200, 201) * 0.02f; + Main.npc[num1062].localAI[0] = 60f; + Main.npc[num1062].netUpdate = true; + } + } + } + if (num1060 > 800f || !Collision.CanHit(new Vector2(vector119.X, vector119.Y - 30f), 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) + { + float num1063 = 14f; //changed from 14 not a prob + float num1064 = 0.2f; //changed from 0.1 not a prob + float num10642 = 0.07f; + vector120 = vector119; + num1058 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector120.X; + num1059 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector120.Y; + num1060 = (float)Math.Sqrt((double)(num1058 * num1058 + num1059 * num1059)); + num1060 = num1063 / num1060; + if (npc.velocity.X < num1058) + { + npc.velocity.X = npc.velocity.X + num1064; + if (npc.velocity.X < 0f && num1058 > 0f) + { + npc.velocity.X = npc.velocity.X + num1064; + } + } + else if (npc.velocity.X > num1058) + { + npc.velocity.X = npc.velocity.X - num1064; + if (npc.velocity.X > 0f && num1058 < 0f) + { + npc.velocity.X = npc.velocity.X - num1064; + } + } + if (npc.velocity.Y < num1059) + { + npc.velocity.Y = npc.velocity.Y + num10642; + if (npc.velocity.Y < 0f && num1059 > 0f) + { + npc.velocity.Y = npc.velocity.Y + num10642; + } + } + else if (npc.velocity.Y > num1059) + { + npc.velocity.Y = npc.velocity.Y - num10642; + if (npc.velocity.Y > 0f && num1059 < 0f) + { + npc.velocity.Y = npc.velocity.Y - num10642; + } + } + } + else + { + npc.velocity *= 0.9f; + } + float playerLocation = npc.Center.X - Main.player[npc.target].Center.X; + npc.direction = (playerLocation < 0 ? 1 : -1); + npc.spriteDirection = npc.direction; + if (npc.ai[2] > 3f) + { + npc.ai[0] = -1f; + npc.ai[1] = 1f; + npc.netUpdate = true; + return; + } + } + else if (npc.ai[0] == 5f) + { + npc.localAI[0] = 0f; + npc.TargetClosest(true); + Vector2 vector119 = new Vector2(npc.position.X + (float)(npc.width / 2) + (float)(Main.rand.Next(20) * npc.direction), npc.position.Y + (float)npc.height * 0.8f); + Vector2 vector120 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float num1058 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector120.X; + float num1059 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector120.Y; + float num1060 = (float)Math.Sqrt((double)(num1058 * num1058 + num1059 * num1059)); + npc.ai[1] += 1f; + npc.ai[1] += (float)(num1038 / 2); + bool flag103 = false; + if ((double)npc.life < (double)npc.lifeMax * 0.25 || CalamityWorld.bossRushActive) + { + npc.ai[1] += 0.25f; //0.25 not a prob + } + if ((double)npc.life < (double)npc.lifeMax * 0.1 || CalamityWorld.bossRushActive) + { + npc.ai[1] += 0.25f; //0.25 not a prob + } + if (npc.ai[1] > 40f) //changed from 40 not a prob + { + npc.ai[1] = 0f; + npc.ai[2] += 1f; + flag103 = true; + } + if (Collision.CanHit(vector119, 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height) && flag103) + { + Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 88); + if (Main.netMode != 1) + { + if (expertMode && NPC.CountNPCS(mod.NPCType("PlagueMine")) < (aboveGroundEnrage ? 6 : 4)) + { + NPC.NewNPC((int)vector119.X, (int)vector119.Y, mod.NPCType("PlagueMine"), 0, 0f, 0f, 0f, 0f, 255); + } + if (revenge && NPC.CountNPCS(mod.NPCType("PlaguebringerShade")) < 1 && aboveGroundEnrage) + { + NPC.NewNPC((int)vector119.X, (int)vector119.Y, mod.NPCType("PlaguebringerShade"), 0, 0f, 0f, 0f, 0f, 255); + } + float projectileSpeed = revenge ? 6f : 5f; + float num1071 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector119.X + (float)Main.rand.Next(-80, 81); + float num1072 = Main.player[npc.target].position.Y + (float)Main.player[npc.target].height * 0.5f - vector119.Y + (float)Main.rand.Next(-40, 41); + float num1073 = (float)Math.Sqrt((double)(num1071 * num1071 + num1072 * num1072)); + num1073 = projectileSpeed / num1073; + num1071 *= num1073; + num1072 *= num1073; + if (NPC.CountNPCS(mod.NPCType("PlagueHomingMissile")) < (aboveGroundEnrage ? 8 : 5)) + { + int num1062 = NPC.NewNPC((int)vector119.X, (int)vector119.Y, mod.NPCType("PlagueHomingMissile"), 0, 0f, 0f, 0f, 0f, 255); + Main.npc[num1062].velocity.X = num1071; + Main.npc[num1062].velocity.Y = num1072; + Main.npc[num1062].netUpdate = true; + } + } + } + if (num1060 > 800f || !Collision.CanHit(new Vector2(vector119.X, vector119.Y - 30f), 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) + { + float num1063 = 14f; //changed from 14 not a prob + float num1064 = 0.2f; //changed from 0.1 not a prob + float num10642 = 0.07f; + vector120 = vector119; + num1058 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector120.X; + num1059 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector120.Y; + num1060 = (float)Math.Sqrt((double)(num1058 * num1058 + num1059 * num1059)); + num1060 = num1063 / num1060; + if (npc.velocity.X < num1058) + { + npc.velocity.X = npc.velocity.X + num1064; + if (npc.velocity.X < 0f && num1058 > 0f) + { + npc.velocity.X = npc.velocity.X + num1064; + } + } + else if (npc.velocity.X > num1058) + { + npc.velocity.X = npc.velocity.X - num1064; + if (npc.velocity.X > 0f && num1058 < 0f) + { + npc.velocity.X = npc.velocity.X - num1064; + } + } + if (npc.velocity.Y < num1059) + { + npc.velocity.Y = npc.velocity.Y + num10642; + if (npc.velocity.Y < 0f && num1059 > 0f) + { + npc.velocity.Y = npc.velocity.Y + num10642; + } + } + else if (npc.velocity.Y > num1059) + { + npc.velocity.Y = npc.velocity.Y - num10642; + if (npc.velocity.Y > 0f && num1059 < 0f) + { + npc.velocity.Y = npc.velocity.Y - num10642; + } + } + } + else + { + npc.velocity *= 0.9f; + } + float playerLocation = npc.Center.X - Main.player[npc.target].Center.X; + npc.direction = (playerLocation < 0 ? 1 : -1); + npc.spriteDirection = npc.direction; + if (npc.ai[2] > 3f) + { + npc.ai[0] = -1f; + npc.ai[1] = 1f; + npc.netUpdate = true; + return; + } + } + else if (npc.ai[0] == 3f) + { + Vector2 vector121 = new Vector2(npc.position.X + (float)(npc.width / 2) + (float)(Main.rand.Next(20) * npc.direction), npc.position.Y + (float)npc.height * 0.8f); + npc.ai[1] += 1f; + bool flag104 = false; + if (npc.GetGlobalNPC(mod).enraged) + { + if (npc.ai[1] % 10f == 9f) + { + flag104 = true; + } + } + else if ((double)npc.life < (double)npc.lifeMax * 0.1 || CalamityWorld.death || CalamityWorld.bossRushActive || aboveGroundEnrage) + { + if (npc.ai[1] % 20f == 19f) + { + flag104 = true; + } + } + else if ((double)npc.life < (double)npc.lifeMax * 0.5) + { + if (npc.ai[1] % 25f == 24f) + { + flag104 = true; + } + } + else if (npc.ai[1] % 30f == 29f) + { + flag104 = true; + } + if (flag104 && npc.position.Y + (float)npc.height < Main.player[npc.target].position.Y && Collision.CanHit(vector121, 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) + { + Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 42); + if (Main.netMode != 1) + { + float projectileSpeed = revenge ? 6.5f : 6f; + if (jungleEnrage || npc.GetGlobalNPC(mod).enraged) + { + projectileSpeed += 10f; + } + float num1071 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector121.X + (float)Main.rand.Next(-80, 81); + float num1072 = Main.player[npc.target].position.Y + (float)Main.player[npc.target].height * 0.5f - vector121.Y + (float)Main.rand.Next(-40, 41); + float num1073 = (float)Math.Sqrt((double)(num1071 * num1071 + num1072 * num1072)); + num1073 = projectileSpeed / num1073; + num1071 *= num1073; + num1072 *= num1073; + int num1074 = 40; //projectile damage + int num1075 = (Main.rand.Next(2) == 0 ? mod.ProjectileType("PlagueStingerGoliath") : mod.ProjectileType("PlagueStingerGoliathV2")); + if (expertMode) + { + num1074 = 28; //112 + int damageBoost = (int)(6f * (1f - (float)npc.life / (float)npc.lifeMax)); + num1074 += damageBoost; //112 to 136 + if (Main.rand.Next(6) == 0) + { + num1074 += 8; //144 to 168 + num1075 = mod.ProjectileType("HiveBombGoliath"); + } + } + else + { + if (Main.rand.Next(9) == 0) + { + num1074 = 50; + num1075 = mod.ProjectileType("HiveBombGoliath"); + } + } + Projectile.NewProjectile(vector121.X, vector121.Y, num1071, num1072, num1075, num1074, 0f, Main.myPlayer, -1f, 0f); + } + } + if (npc.position.Y > Main.player[npc.target].position.Y - 200f) //200 + { + if (npc.velocity.Y > 0f) + { + npc.velocity.Y = npc.velocity.Y * 0.98f; + } + npc.velocity.Y = npc.velocity.Y - 0.1f; + if (npc.velocity.Y > 2f) + { + npc.velocity.Y = 2f; + } + } + else if (npc.position.Y < Main.player[npc.target].position.Y - 500f) //500 + { + if (npc.velocity.Y < 0f) + { + npc.velocity.Y = npc.velocity.Y * 0.98f; + } + npc.velocity.Y = npc.velocity.Y + 0.1f; + if (npc.velocity.Y < -2f) + { + npc.velocity.Y = -2f; + } + } + if (npc.position.X + (float)(npc.width / 2) > Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) + 100f) + { + if (npc.velocity.X > 0f) + { + npc.velocity.X = npc.velocity.X * 0.98f; + } + npc.velocity.X = npc.velocity.X - 0.1f; + 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.velocity.X < 0f) + { + npc.velocity.X = npc.velocity.X * 0.98f; + } + npc.velocity.X = npc.velocity.X + 0.1f; + if (npc.velocity.X < -8f) + { + npc.velocity.X = -8f; + } + } + float playerLocation = npc.Center.X - Main.player[npc.target].Center.X; + npc.direction = (playerLocation < 0 ? 1 : -1); + npc.spriteDirection = npc.direction; + if (npc.ai[1] > 300f) + { + npc.ai[0] = -1f; + npc.ai[1] = 3f; + npc.netUpdate = true; + return; + } + } + else if (npc.ai[0] == 4f) + { + int num1043 = 2; //2 + if (npc.ai[1] > (float)(2 * num1043) && npc.ai[1] % 2f == 0f) + { + MissileCountdown = 0; + npc.ai[0] = -1f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.netUpdate = true; + return; + } + if (npc.ai[1] % 2f == 0f) + { + npc.TargetClosest(true); + float playerLocation = npc.Center.X - Main.player[npc.target].Center.X; + if (Math.Abs(npc.position.Y + (float)(npc.height / 2) - (Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - 500f)) < 20f) + { + if (MissileCountdown == 1) + { + Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 116); + if (Main.netMode != 1) + { + int speed = revenge ? 6 : 5; + float spawnX = Main.rand.Next(1000) - 500 + npc.Center.X; + float spawnY = npc.Center.Y; + Vector2 baseSpawn = new Vector2(spawnX, spawnY); + Vector2 baseVelocity = Main.player[npc.target].Center - baseSpawn; + baseVelocity.Normalize(); + baseVelocity = baseVelocity * speed; + int damage = expertMode ? 42 : 57; + for (int i = 0; i < MissileProjectiles; i++) + { + Vector2 spawn = baseSpawn; + spawn.X = spawn.X + i * 30 - (MissileProjectiles * 15); + Vector2 velocity = baseVelocity; + velocity = baseVelocity.RotatedBy(MathHelper.ToRadians(-MissileAngleSpread / 2 + (MissileAngleSpread * i / (float)MissileProjectiles))); + velocity.X = velocity.X + 3 * Main.rand.NextFloat() - 1.5f; + Projectile.NewProjectile(spawn.X, spawn.Y, velocity.X, velocity.Y, mod.ProjectileType("HiveBombGoliath"), damage, 10f, Main.myPlayer, 0f, Main.player[npc.target].position.Y); + } + } + } + npc.localAI[0] = 1f; + npc.ai[1] += 1f; + npc.ai[2] = 0f; + float num1044 = revenge ? 28f : 26f; //16 + Vector2 vector117 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float num1045 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector117.X; + float num1046 = (Main.player[npc.target].position.Y - 500f) + (float)(Main.player[npc.target].height / 2) - vector117.Y; + float num1047 = (float)Math.Sqrt((double)(num1045 * num1045 + num1046 * num1046)); + num1047 = num1044 / num1047; + npc.velocity.X = num1045 * num1047; + npc.velocity.Y = num1046 * num1047; + npc.direction = (playerLocation < 0 ? 1 : -1); + npc.spriteDirection = npc.direction; + return; + } + npc.localAI[0] = 0f; + float num1048 = 12f; //12 not a prob + float num1049 = 0.15f; //0.15 not a prob + if (npc.position.Y + (float)(npc.height / 2) < (Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - 500f)) + { + npc.velocity.Y = npc.velocity.Y + num1049; + } + else + { + npc.velocity.Y = npc.velocity.Y - num1049; + } + if (npc.velocity.Y < -12f) + { + npc.velocity.Y = -num1048; + } + if (npc.velocity.Y > 12f) + { + npc.velocity.Y = num1048; + } + if (Math.Abs(npc.position.X + (float)(npc.width / 2) - (Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2))) > 600f) + { + npc.velocity.X = npc.velocity.X + 0.15f * (float)npc.direction; + } + else if (Math.Abs(npc.position.X + (float)(npc.width / 2) - (Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2))) < 300f) + { + npc.velocity.X = npc.velocity.X - 0.15f * (float)npc.direction; + } + else + { + npc.velocity.X = npc.velocity.X * 0.8f; + } + if (npc.velocity.X < -16f) + { + npc.velocity.X = -16f; + } + if (npc.velocity.X > 16f) + { + npc.velocity.X = 16f; + } + npc.direction = (playerLocation < 0 ? 1 : -1); + npc.spriteDirection = npc.direction; + return; + } + else + { + if (npc.velocity.X < 0f) + { + npc.direction = -1; + } + else + { + npc.direction = 1; + } + npc.spriteDirection = npc.direction; + int num1050 = 600; //600 not a prob + int num1051 = 1; + if (npc.position.X + (float)(npc.width / 2) < Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2)) + { + num1051 = -1; + } + if (npc.direction == num1051 && Math.Abs(npc.position.X + (float)(npc.width / 2) - (Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2))) > (float)num1050) + { + npc.ai[2] = 1f; + } + if (npc.ai[2] != 1f) + { + npc.localAI[0] = 1f; + return; + } + npc.TargetClosest(true); + npc.spriteDirection = npc.direction; + npc.localAI[0] = 0f; + npc.velocity *= 0.9f; + float num1052 = revenge ? 0.13f : 0.115f; //0.1 + if (npc.life < npc.lifeMax / 2) + { + npc.velocity *= 0.9f; + num1052 += 0.05f; //0.05 + } + if (npc.life < npc.lifeMax / 3) + { + npc.velocity *= 0.9f; + num1052 += 0.05f; //0.05 + } + if (npc.life < npc.lifeMax / 5 || CalamityWorld.bossRushActive) + { + npc.velocity *= 0.9f; + num1052 += 0.05f; //0.05 + } + if (Math.Abs(npc.velocity.X) + Math.Abs(npc.velocity.Y) < num1052) + { + npc.ai[2] = 0f; + npc.ai[1] += 1f; + return; + } + } + } + } - public override bool CheckActive() - { - return canDespawn; - } + public override bool CheckActive() + { + return canDespawn; + } - public override void HitEffect(int hitDirection, double damage) + public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 2; k++) { @@ -962,12 +990,12 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath } if (npc.life <= 0) { - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Pbg"), 2f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Pbg2"), 2f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Pbg3"), 2f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Pbg4"), 2f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Pbg5"), 2f); - npc.position.X = npc.position.X + (float)(npc.width / 2); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Pbg"), 2f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Pbg2"), 2f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Pbg3"), 2f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Pbg4"), 2f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Pbg5"), 2f); + npc.position.X = npc.position.X + (float)(npc.width / 2); npc.position.Y = npc.position.Y + (float)(npc.height / 2); npc.width = 100; npc.height = 100; @@ -994,82 +1022,119 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath } } - public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) - { - Mod mod = ModLoader.GetMod("CalamityMod"); - Texture2D texture = Main.npcTexture[npc.type]; - Texture2D texture2 = mod.GetTexture("NPCs/PlaguebringerGoliath/PlaguebringerGoliathAltTex"); - Texture2D texture3 = mod.GetTexture("NPCs/PlaguebringerGoliath/PlaguebringerGoliathChargeTex"); - if (npc.localAI[0] == 1f) - { - CalamityMod.DrawTexture(spriteBatch, texture3, 0, npc, drawColor); - } - else - { - if (npc.localAI[1] == 0f) - { - CalamityMod.DrawTexture(spriteBatch, texture, 0, npc, drawColor); - } - else - { - CalamityMod.DrawTexture(spriteBatch, texture2, 0, npc, drawColor); - } - } - return false; - } + public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) + { + Mod mod = ModLoader.GetMod("CalamityMod"); + Texture2D texture = Main.npcTexture[npc.type]; + if (npc.localAI[0] == 1f) + { + texture = mod.GetTexture("NPCs/PlaguebringerGoliath/PlaguebringerGoliathChargeTex"); + } + else + { + if (npc.localAI[1] == 0f) + { + texture = Main.npcTexture[npc.type]; + } + else + { + texture = mod.GetTexture("NPCs/PlaguebringerGoliath/PlaguebringerGoliathAltTex"); + } + } + SpriteEffects spriteEffects = SpriteEffects.None; + if (npc.spriteDirection == 1) + { + spriteEffects = SpriteEffects.FlipHorizontally; + } + Microsoft.Xna.Framework.Color color24 = npc.GetAlpha(drawColor); + Microsoft.Xna.Framework.Color color25 = Lighting.GetColor((int)((double)npc.position.X + (double)npc.width * 0.5) / 16, (int)(((double)npc.position.Y + (double)npc.height * 0.5) / 16.0)); + int num156 = Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type]; + int y3 = num156 * (int)npc.frameCounter; + Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle(0, y3, texture.Width, num156); + Vector2 origin2 = rectangle.Size() / 2f; + int num157 = 8; + int num158 = 2; + int num159 = 1; + float num160 = 0f; + int num161 = num159; + while (((num158 > 0 && num161 < num157) || (num158 < 0 && num161 > num157)) && Lighting.NotRetro) + { + Microsoft.Xna.Framework.Color color26 = npc.GetAlpha(color25); + { + goto IL_6899; + } + IL_6881: + num161 += num158; + continue; + IL_6899: + float num164 = (float)(num157 - num161); + if (num158 < 0) + { + num164 = (float)(num159 - num161); + } + color26 *= num164 / ((float)NPCID.Sets.TrailCacheLength[npc.type] * 1.5f); + Vector2 value4 = (npc.oldPos[num161]); + float num165 = npc.rotation; + Main.spriteBatch.Draw(texture, value4 + npc.Size / 2f - Main.screenPosition + new Vector2(0, npc.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rectangle), color26, num165 + npc.rotation * num160 * (float)(num161 - 1) * -(float)spriteEffects.HasFlag(SpriteEffects.FlipHorizontally).ToDirectionInt(), origin2, npc.scale, spriteEffects, 0f); + goto IL_6881; + } + var something = npc.direction == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; + spriteBatch.Draw(texture, npc.Center - Main.screenPosition + new Vector2(0, npc.gfxOffY), npc.frame, color24, npc.rotation, npc.frame.Size() / 2, npc.scale, something, 0); + return false; + } - public override void FindFrame(int frameHeight) - { - npc.frameCounter += 1.0; - if (npc.frameCounter > 4.0) - { - npc.frame.Y = npc.frame.Y + frameHeight; - npc.frameCounter = 0.0; - } - if (npc.frame.Y >= frameHeight * 4) - { - npc.frame.Y = 0; - if (npc.localAI[0] != 1f) - { - npc.localAI[1] += 1f; - } - } - if (npc.localAI[1] > 1f) - { - npc.localAI[1] = 0f; - npc.netUpdate = true; - } - } + public override void FindFrame(int frameHeight) + { + npc.frameCounter += 1.0; + if (npc.frameCounter > 4.0) + { + npc.frame.Y = npc.frame.Y + frameHeight; + npc.frameCounter = 0.0; + } + if (npc.frame.Y >= frameHeight * 4) + { + npc.frame.Y = 0; + if (npc.localAI[0] != 1f) + { + npc.localAI[1] += 1f; + } + } + if (npc.localAI[1] > 1f) + { + npc.localAI[1] = 0f; + npc.netUpdate = true; + } + } - public override void BossLoot(ref string name, ref int potionType) + public override void BossLoot(ref string name, ref int potionType) { potionType = ItemID.GreaterHealingPotion; } - + public override void NPCLoot() { - if (Main.rand.Next(10) == 0) - { - npc.DropItemInstanced(npc.position, npc.Size, mod.ItemType("BloomStone"), 1, true); - } if (Main.rand.Next(10) == 0) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("PlaguebringerGoliathTrophy")); } - if (CalamityWorld.armageddon) - { - for (int i = 0; i < 10; i++) - { - npc.DropBossBags(); - } - } - if (Main.expertMode) + if (CalamityWorld.armageddon) + { + for (int i = 0; i < 5; i++) + { + npc.DropBossBags(); + } + } + if (Main.expertMode) { npc.DropBossBags(); } else { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("PlagueCellCluster"), Main.rand.Next(10, 15)); + if (Main.rand.Next(10) == 0) + { + npc.DropItemInstanced(npc.position, npc.Size, mod.ItemType("BloomStone"), 1, true); + } if (Main.rand.Next(4) == 0) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MepheticSprayer")); @@ -1108,13 +1173,13 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath } } } - + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { npc.lifeMax = (int)(npc.lifeMax * 0.8f * bossLifeScale); npc.damage = (int)(npc.damage * 0.8f); } - + public override void OnHitPlayer(Player player, int damage, bool crit) { player.AddBuff(mod.BuffType("Plague"), 300, true); diff --git a/NPCs/PlaguebringerShade/PlaguebringerShade.cs b/NPCs/PlaguebringerShade/PlaguebringerShade.cs index a3c7da967d..a37cb4fc1b 100644 --- a/NPCs/PlaguebringerShade/PlaguebringerShade.cs +++ b/NPCs/PlaguebringerShade/PlaguebringerShade.cs @@ -59,6 +59,8 @@ namespace CalamityMod.NPCs.PlaguebringerShade npc.noTileCollide = true; npc.HitSound = SoundID.NPCHit4; npc.DeathSound = SoundID.NPCDeath14; + banner = npc.type; + bannerItem = mod.ItemType("PlaguebringerBanner"); } public override void AI() diff --git a/NPCs/Polterghast/PolterPhantom.cs b/NPCs/Polterghast/PolterPhantom.cs index e71833ff3a..449b2411ee 100644 --- a/NPCs/Polterghast/PolterPhantom.cs +++ b/NPCs/Polterghast/PolterPhantom.cs @@ -34,7 +34,7 @@ namespace CalamityMod.NPCs.Polterghast } if (CalamityWorld.bossRushActive) { - npc.lifeMax = CalamityWorld.death ? 2100000 : 1700000; + npc.lifeMax = CalamityWorld.death ? 1100000 : 900000; } npc.knockBackResist = 0f; npc.aiStyle = -1; //new @@ -54,6 +54,7 @@ namespace CalamityMod.NPCs.Polterghast npc.noGravity = true; npc.noTileCollide = true; npc.netAlways = true; + npc.canGhostHeal = false; npc.HitSound = SoundID.NPCHit36; npc.DeathSound = SoundID.NPCDeath39; } @@ -198,7 +199,7 @@ namespace CalamityMod.NPCs.Polterghast if (speedBoost1) { npc.defense = 400; - npc.damage *= 4; + npc.damage = 1200; } else { diff --git a/NPCs/Polterghast/Polterghast.cs b/NPCs/Polterghast/Polterghast.cs index 04ded92707..d9ab300c13 100644 --- a/NPCs/Polterghast/Polterghast.cs +++ b/NPCs/Polterghast/Polterghast.cs @@ -14,16 +14,16 @@ namespace CalamityMod.NPCs.Polterghast [AutoloadBossHead] public class Polterghast : ModNPC { - private int despawnTimer = 600; - private bool spawnGhost = false; - private bool boostDR = false; + private int despawnTimer = 600; + private bool spawnGhost = false; + private bool boostDR = false; - public override void SetStaticDefaults() + public override void SetStaticDefaults() { DisplayName.SetDefault("Polterghast"); Main.npcFrameCount[npc.type] = 12; } - + public override void SetDefaults() { npc.npcSlots = 50f; @@ -31,598 +31,608 @@ namespace CalamityMod.NPCs.Polterghast npc.width = 90; npc.height = 120; npc.defense = 150; - npc.lifeMax = CalamityWorld.revenge ? 660000 : 550000; - if (CalamityWorld.death) - { - npc.lifeMax = 880000; - } - if (CalamityWorld.bossRushActive) - { - npc.lifeMax = CalamityWorld.death ? 7600000 : 7000000; - } - npc.knockBackResist = 0f; + npc.lifeMax = CalamityWorld.revenge ? 495000 : 412500; + if (CalamityWorld.death) + { + npc.lifeMax = 660000; + } + if (CalamityWorld.bossRushActive) + { + npc.lifeMax = CalamityWorld.death ? 2800000 : 2500000; + } + npc.knockBackResist = 0f; npc.aiStyle = -1; //new - aiType = -1; //new - npc.value = Item.buyPrice(1, 20, 0, 0); + aiType = -1; //new + npc.value = Item.buyPrice(0, 60, 0, 0); npc.boss = true; for (int k = 0; k < npc.buffImmune.Length; k++) { npc.buffImmune[k] = true; npc.buffImmune[BuffID.Ichor] = false; - npc.buffImmune[BuffID.CursedInferno] = false; - npc.buffImmune[mod.BuffType("AbyssalFlames")] = false; - npc.buffImmune[mod.BuffType("DemonFlames")] = false; - npc.buffImmune[mod.BuffType("GodSlayerInferno")] = false; - npc.buffImmune[mod.BuffType("Nightwither")] = false; - npc.buffImmune[mod.BuffType("Shred")] = false; - } + npc.buffImmune[BuffID.CursedInferno] = false; + npc.buffImmune[mod.BuffType("AbyssalFlames")] = false; + npc.buffImmune[mod.BuffType("DemonFlames")] = false; + npc.buffImmune[mod.BuffType("GodSlayerInferno")] = false; + npc.buffImmune[mod.BuffType("Nightwither")] = false; + npc.buffImmune[mod.BuffType("Shred")] = false; + } npc.noGravity = true; npc.noTileCollide = true; npc.netAlways = true; - Mod calamityModMusic = ModLoader.GetMod("CalamityModMusic"); - if (calamityModMusic != null) - music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/RUIN"); - else - music = MusicID.Plantera; + Mod calamityModMusic = ModLoader.GetMod("CalamityModMusic"); + if (calamityModMusic != null) + music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/RUIN"); + else + music = MusicID.Plantera; npc.HitSound = SoundID.NPCHit7; npc.DeathSound = SoundID.NPCDeath39; bossBag = mod.ItemType("PolterghastBag"); } - public override void AI() - { - if (Main.raining) - { - Main.raining = false; - if (Main.netMode == 2) { NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); } - } - Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 0.5f, 1.25f, 1.25f); - npc.TargetClosest(true); - Vector2 vector = npc.Center; - if (Vector2.Distance(Main.player[npc.target].Center, vector) > 6000f) { npc.active = false; } - bool speedBoost1 = false; - bool despawnBoost = false; - if (npc.timeLeft < 1500) { npc.timeLeft = 1500; } - bool revenge = (CalamityWorld.revenge || CalamityWorld.bossRushActive); - bool expertMode = (Main.expertMode || CalamityWorld.bossRushActive); - bool phase2 = (double)npc.life <= (double)npc.lifeMax * 0.75; //hooks detach and fire beams - bool phase3 = (double)npc.life <= (double)npc.lifeMax * (revenge ? 0.5 : 0.33); //hooks die and begins charging with ghosts spinning around player - bool phase4 = (double)npc.life <= (double)npc.lifeMax * (revenge ? 0.33 : 0.2); //starts spitting ghost dudes - bool phase5 = (double)npc.life <= (double)npc.lifeMax * (revenge ? 0.1 : 0.05); //starts moving incredibly fast - CalamityGlobalNPC.ghostBoss = npc.whoAmI; - if (npc.localAI[0] == 0f && Main.netMode != 1) - { - npc.localAI[0] = 1f; - int num729 = NPC.NewNPC((int)vector.X, (int)vector.Y, mod.NPCType("PolterghastHook"), npc.whoAmI, 0f, 0f, 0f, 0f, 255); - num729 = NPC.NewNPC((int)vector.X, (int)vector.Y, mod.NPCType("PolterghastHook"), npc.whoAmI, 0f, 0f, 0f, 0f, 255); - num729 = NPC.NewNPC((int)vector.X, (int)vector.Y, mod.NPCType("PolterghastHook"), npc.whoAmI, 0f, 0f, 0f, 0f, 255); - num729 = NPC.NewNPC((int)vector.X, (int)vector.Y, mod.NPCType("PolterghastHook"), npc.whoAmI, 0f, 0f, 0f, 0f, 255); - } - int[] array2 = new int[4]; - float num730 = 0f; - float num731 = 0f; - int num732 = 0; - int num; - for (int num733 = 0; num733 < 200; num733 = num + 1) - { - if (Main.npc[num733].active && Main.npc[num733].type == mod.NPCType("PolterghastHook")) - { - num730 += Main.npc[num733].Center.X; - num731 += Main.npc[num733].Center.Y; - array2[num732] = num733; - num732++; - if (num732 > 3) { break; } - } - num = num733; - } - num730 /= (float)num732; - num731 /= (float)num732; - float num734 = 2.5f; - float num735 = 0.025f; - if (!Main.player[npc.target].ZoneDungeon && !CalamityWorld.bossRushActive) - { - despawnTimer--; - if (despawnTimer <= 0) { despawnBoost = true; } - speedBoost1 = true; - num734 += 8f; - num735 = 0.15f; - } - else { despawnTimer = 600; } - if (phase2) - { - num734 = 3.5f; - num735 = 0.035f; - } - if (phase3) - { - if (NPC.CountNPCS(mod.NPCType("PolterPhantom")) > 0) - { - boostDR = true; - if (npc.ai[2] >= 300f) - { - num734 = phase5 ? 18f : 12f; - num735 = phase5 ? 0.12f : 0.08f; - } - else - { - if (phase5) - { - num734 = 5f; - num735 = 0.05f; - } - else if (phase4) - { - num734 = 4.5f; - num735 = 0.045f; - } - else - { - num734 = 4f; - num735 = 0.04f; - } - } - npc.ai[2] += 1f; - if (npc.ai[2] >= 600f) - { - npc.ai[2] = 0f; - npc.netUpdate = true; - } - } - else - { - boostDR = false; - num734 = phase5 ? 22f : 18f; - num735 = phase5 ? 0.15f : 0.12f; - npc.localAI[2] += 1f; - if (npc.localAI[2] >= 600f) - { - npc.localAI[2] = 0f; - NPC.NewNPC((int)vector.X, (int)vector.Y, mod.NPCType("PolterPhantom"), 0, 0f, 0f, 0f, 0f, 255); - Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 122); - for (int num621 = 0; num621 < 10; num621++) - { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 2f); - Main.dust[num622].velocity *= 3f; - Main.dust[num622].noGravity = true; - if (Main.rand.Next(2) == 0) - { - Main.dust[num622].scale = 0.5f; - Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; - } - } - for (int num623 = 0; num623 < 30; num623++) - { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 3f); - Main.dust[num624].noGravity = true; - Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 180, 0f, 0f, 100, default(Color), 2f); - Main.dust[num624].velocity *= 2f; - } - npc.netUpdate = true; - } - } - } - if (expertMode) - { - num734 += revenge ? 1.5f : 1f; - num734 *= revenge ? 1.25f : 1.1f; - num735 += revenge ? 0.015f : 0.01f; - num735 *= revenge ? 1.2f : 1.1f; - } - Vector2 vector91 = new Vector2(num730, num731); - float num736 = Main.player[npc.target].Center.X - vector91.X; - float num737 = Main.player[npc.target].Center.Y - vector91.Y; - if (despawnBoost) - { - num737 *= -1f; - num736 *= -1f; - num734 += 8f; - } - float num738 = (float)Math.Sqrt((double)(num736 * num736 + num737 * num737)); - int num739 = 500; - if (speedBoost1) { num739 += 500; } - if (expertMode) { num739 += 150; } - if (num738 >= (float)num739) - { - num738 = (float)num739 / num738; - num736 *= num738; - num737 *= num738; - } - num730 += num736; - num731 += num737; - vector91 = new Vector2(vector.X, vector.Y); - num736 = num730 - vector91.X; - num737 = num731 - vector91.Y; - num738 = (float)Math.Sqrt((double)(num736 * num736 + num737 * num737)); - if (num738 < num734) - { - num736 = npc.velocity.X; - num737 = npc.velocity.Y; - } - else - { - num738 = num734 / num738; - num736 *= num738; - num737 *= num738; - } - Vector2 vector92 = new Vector2(vector.X, vector.Y); - float num740 = Main.player[npc.target].Center.X - vector92.X; - float num741 = Main.player[npc.target].Center.Y - vector92.Y; - npc.rotation = (float)Math.Atan2((double)num741, (double)num740) + 1.57f; - if (npc.velocity.X < num736) - { - npc.velocity.X = npc.velocity.X + num735; - if (npc.velocity.X < 0f && num736 > 0f) - { - npc.velocity.X = npc.velocity.X + num735 * 2f; - } - } - else if (npc.velocity.X > num736) - { - npc.velocity.X = npc.velocity.X - num735; - if (npc.velocity.X > 0f && num736 < 0f) - { - npc.velocity.X = npc.velocity.X - num735 * 2f; - } - } - if (npc.velocity.Y < num737) - { - npc.velocity.Y = npc.velocity.Y + num735; - if (npc.velocity.Y < 0f && num737 > 0f) - { - npc.velocity.Y = npc.velocity.Y + num735 * 2f; - } - } - else if (npc.velocity.Y > num737) - { - npc.velocity.Y = npc.velocity.Y - num735; - if (npc.velocity.Y > 0f && num737 < 0f) - { - npc.velocity.Y = npc.velocity.Y - num735 * 2f; - } - } - if (!phase2 && !phase3) - { - if (speedBoost1) - { - npc.defense = 300; - npc.damage = (int)(200f * Main.damageMultiplier); - } - else - { - npc.damage = expertMode ? 240 : 150; - npc.defense = 150; - } - if (Main.netMode != 1) - { - npc.localAI[1] += 1f; - if ((double)npc.life < (double)npc.lifeMax * 0.9) - { - npc.localAI[1] += 1f; - } - if ((double)npc.life < (double)npc.lifeMax * 0.8) - { - npc.localAI[1] += 1f; - } - if (speedBoost1 || CalamityWorld.bossRushActive) - { - npc.localAI[1] += 6f; - } - if (expertMode) - { - npc.localAI[1] += 1f; - } - if (npc.localAI[1] > 120f) - { - npc.localAI[1] = 0f; - bool flag47 = Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height); - if (npc.localAI[3] > 0f) - { - flag47 = true; - npc.localAI[3] = 0f; - } - if (flag47) - { - Vector2 vector93 = new Vector2(vector.X, vector.Y); - float num742 = 11f; - if (expertMode) - { - num742 = (CalamityWorld.bossRushActive ? 18f : 12f); - } - if (speedBoost1 || npc.GetGlobalNPC(mod).enraged) - { - num742 *= 2f; - } - float num743 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector93.X; - float num744 = Main.player[npc.target].position.Y + (float)Main.player[npc.target].height * 0.5f - vector93.Y; - float num745 = (float)Math.Sqrt((double)(num743 * num743 + num744 * num744)); - num745 = num742 / num745; - num743 *= num745; - num744 *= num745; - int num746 = expertMode ? 46 : 55; - int num747 = mod.ProjectileType("PhantomShot"); - int maxValue2 = 2; - if (expertMode) - { - maxValue2 = 4; - } - if ((double)npc.life < (double)npc.lifeMax * 0.8 && Main.rand.Next(maxValue2) == 0) - { - num746 = expertMode ? 51 : 60; - npc.localAI[1] = -30f; - num747 = mod.ProjectileType("PhantomBlast"); - } - if (speedBoost1 || npc.GetGlobalNPC(mod).enraged) - { - num746 *= 2; - } - vector93.X += num743 * 3f; - vector93.Y += num744 * 3f; - int num748 = Projectile.NewProjectile(vector93.X, vector93.Y, num743, num744, num747, num746, 0f, Main.myPlayer, 0f, 0f); - Main.projectile[num748].timeLeft = 300; - return; - } - else - { - Vector2 vector93 = new Vector2(vector.X, vector.Y); - float num742 = 11f; - if (expertMode) - { - num742 = (CalamityWorld.bossRushActive ? 18f : 12f); - } - if (speedBoost1 || npc.GetGlobalNPC(mod).enraged) - { - num742 *= 2f; - } - float num743 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector93.X; - float num744 = Main.player[npc.target].position.Y + (float)Main.player[npc.target].height * 0.5f - vector93.Y; - float num745 = (float)Math.Sqrt((double)(num743 * num743 + num744 * num744)); - num745 = num742 / num745; - num743 *= num745; - num744 *= num745; - int num746 = expertMode ? 51 : 60; - int num747 = mod.ProjectileType("PhantomBlast"); - if (speedBoost1 || npc.GetGlobalNPC(mod).enraged) - { - num746 *= 2; - } - vector93.X += num743 * 3f; - vector93.Y += num744 * 3f; - int num748 = Projectile.NewProjectile(vector93.X, vector93.Y, num743, num744, num747, num746, 0f, Main.myPlayer, 0f, 0f); - Main.projectile[num748].timeLeft = 180; - return; - } - } - } - } - else if (!phase3) - { - if (npc.ai[0] == 0f) - { - npc.ai[0] += 1f; - Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 122); - for (int num621 = 0; num621 < 10; num621++) - { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 60, 0f, 0f, 100, default(Color), 2f); - Main.dust[num622].velocity *= 3f; - Main.dust[num622].noGravity = true; - if (Main.rand.Next(2) == 0) - { - Main.dust[num622].scale = 0.5f; - Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; - } - } - for (int num623 = 0; num623 < 30; num623++) - { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 180, 0f, 0f, 100, default(Color), 3f); - Main.dust[num624].noGravity = true; - Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 180, 0f, 0f, 100, default(Color), 2f); - Main.dust[num624].velocity *= 2f; - } - } - npc.GivenName = "Necroghast"; - if (speedBoost1 || npc.GetGlobalNPC(mod).enraged) - { - npc.defense = 200; - npc.damage = (int)(300f * Main.damageMultiplier); - } - else - { - npc.damage = expertMode ? 288 : 180; - npc.defense = 100; - } - if (Main.netMode != 1) - { - npc.localAI[1] += 1f; - if (speedBoost1 || CalamityWorld.bossRushActive) - { - npc.localAI[1] += 8f; - } - if (expertMode) - { - npc.localAI[1] += 1f; - } - if (npc.localAI[1] > 80f) - { - npc.localAI[1] = 0f; - bool flag47 = Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height); - if (npc.localAI[3] > 0f) - { - flag47 = true; - npc.localAI[3] = 0f; - } - if (flag47) - { - Vector2 vector93 = new Vector2(vector.X, vector.Y); - float num742 = 11f; - if (expertMode) - { - num742 = (CalamityWorld.bossRushActive ? 18f : 12f); - } - if (speedBoost1 || npc.GetGlobalNPC(mod).enraged) - { - num742 *= 2f; - } - float num743 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector93.X; - float num744 = Main.player[npc.target].position.Y + (float)Main.player[npc.target].height * 0.5f - vector93.Y; - float num745 = (float)Math.Sqrt((double)(num743 * num743 + num744 * num744)); - num745 = num742 / num745; - num743 *= num745; - num744 *= num745; - int num746 = expertMode ? 49 : 60; - int num747 = mod.ProjectileType("PhantomShot2"); - int maxValue2 = 2; - if (expertMode) - { - maxValue2 = 4; - } - if (Main.rand.Next(maxValue2) == 0) - { - num746 = expertMode ? 54 : 65; - npc.localAI[1] = -30f; - num747 = mod.ProjectileType("PhantomBlast2"); - } - if (speedBoost1 || npc.GetGlobalNPC(mod).enraged) - { - num746 *= 2; - } - vector93.X += num743 * 3f; - vector93.Y += num744 * 3f; - int num748 = Projectile.NewProjectile(vector93.X, vector93.Y, num743, num744, num747, num746, 0f, Main.myPlayer, 0f, 0f); - Main.projectile[num748].timeLeft = 400; - return; - } - else - { - Vector2 vector93 = new Vector2(vector.X, vector.Y); - float num742 = 11f; - if (expertMode) - { - num742 = (CalamityWorld.bossRushActive ? 18f : 12f); - } - if (speedBoost1 || npc.GetGlobalNPC(mod).enraged) - { - num742 *= 2f; - } - float num743 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector93.X; - float num744 = Main.player[npc.target].position.Y + (float)Main.player[npc.target].height * 0.5f - vector93.Y; - float num745 = (float)Math.Sqrt((double)(num743 * num743 + num744 * num744)); - num745 = num742 / num745; - num743 *= num745; - num744 *= num745; - int num746 = expertMode ? 54 : 65; - int num747 = mod.ProjectileType("PhantomBlast2"); - if (speedBoost1 || npc.GetGlobalNPC(mod).enraged) - { - num746 *= 2; - } - vector93.X += num743 * 3f; - vector93.Y += num744 * 3f; - int num748 = Projectile.NewProjectile(vector93.X, vector93.Y, num743, num744, num747, num746, 0f, Main.myPlayer, 0f, 0f); - Main.projectile[num748].timeLeft = 240; - return; - } - } - } - } - else - { - npc.HitSound = SoundID.NPCHit36; - if (!spawnGhost) - { - spawnGhost = true; - if (Main.netMode != 1) - { - NPC.NewNPC((int)vector.X, (int)vector.Y, mod.NPCType("PolterPhantom"), 0, 0f, 0f, 0f, 0f, 255); - for (int I = 0; I < 3; I++) - { - int Phantom = NPC.NewNPC((int)(Main.player[npc.target].Center.X + (Math.Sin(I * 120) * 500)), - (int)(Main.player[npc.target].Center.Y + (Math.Cos(I * 120) * 500)), mod.NPCType("PhantomFuckYou"), 0, 0, 0, 0, -1); - NPC Eye = Main.npc[Phantom]; - Eye.ai[0] = I * 120; - Eye.ai[3] = I * 120; - } - } - Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 122); - for (int num621 = 0; num621 < 10; num621++) - { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 60, 0f, 0f, 100, default(Color), 2f); - Main.dust[num622].velocity *= 3f; - Main.dust[num622].noGravity = true; - if (Main.rand.Next(2) == 0) - { - Main.dust[num622].scale = 0.5f; - Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; - } - } - for (int num623 = 0; num623 < 30; num623++) - { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 180, 0f, 0f, 100, default(Color), 3f); - Main.dust[num624].noGravity = true; - Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 180, 0f, 0f, 100, default(Color), 2f); - Main.dust[num624].velocity *= 2f; - } - } - npc.GivenName = "Necroplasm"; - if (speedBoost1 || npc.GetGlobalNPC(mod).enraged) - { - npc.defense = 200; - npc.damage = (int)(400f * Main.damageMultiplier); - } - else - { - npc.damage = expertMode ? 336 : 210; - npc.defense = 0; - } - if (phase4) - { - npc.localAI[1] += 1f; - if (npc.localAI[1] >= 150f) - { - float num757 = 8f; - Vector2 vector94 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num758 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector94.X + (float)Main.rand.Next(-10, 11); - float num759 = Math.Abs(num758 * 0.2f); - float num760 = Main.player[npc.target].position.Y + (float)Main.player[npc.target].height * 0.5f - vector94.Y + (float)Main.rand.Next(-10, 11); - if (num760 > 0f) - { - num759 = 0f; - } - num760 -= num759; - float num761 = (float)Math.Sqrt((double)(num758 * num758 + num760 * num760)); - num761 = num757 / num761; - num758 *= num761; - num760 *= num761; - if (NPC.CountNPCS(mod.NPCType("PhantomSpiritL")) < (revenge ? 3 : 2) && Main.netMode != 1) - { - int num762 = NPC.NewNPC((int)vector.X, (int)vector.Y, mod.NPCType("PhantomSpiritL"), 0, 0f, 0f, 0f, 0f, 255); - Main.npc[num762].velocity.X = num758; - Main.npc[num762].velocity.Y = num760; - Main.npc[num762].netUpdate = true; - } - npc.localAI[1] = 0f; - return; - } - } - } - } - + public override void AI() + { + if (Main.raining) + { + Main.raining = false; + if (Main.netMode == 2) { NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); } + } + Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 0.5f, 1.25f, 1.25f); + npc.TargetClosest(true); + Vector2 vector = npc.Center; + if (Vector2.Distance(Main.player[npc.target].Center, vector) > 6000f) { npc.active = false; } + bool speedBoost1 = false; + bool despawnBoost = false; + if (npc.timeLeft < 1500) { npc.timeLeft = 1500; } + bool revenge = (CalamityWorld.revenge || CalamityWorld.bossRushActive); + bool expertMode = (Main.expertMode || CalamityWorld.bossRushActive); + bool phase2 = (double)npc.life <= (double)npc.lifeMax * 0.75; //hooks detach and fire beams + bool phase3 = (double)npc.life <= (double)npc.lifeMax * (revenge ? 0.5 : 0.33); //hooks die and begins charging with ghosts spinning around player + bool phase4 = (double)npc.life <= (double)npc.lifeMax * (revenge ? 0.33 : 0.2); //starts spitting ghost dudes + bool phase5 = (double)npc.life <= (double)npc.lifeMax * (revenge ? 0.1 : 0.05); //starts moving incredibly fast + CalamityGlobalNPC.ghostBoss = npc.whoAmI; + if (npc.localAI[0] == 0f && Main.netMode != 1) + { + npc.localAI[0] = 1f; + int num729 = NPC.NewNPC((int)vector.X, (int)vector.Y, mod.NPCType("PolterghastHook"), npc.whoAmI, 0f, 0f, 0f, 0f, 255); + num729 = NPC.NewNPC((int)vector.X, (int)vector.Y, mod.NPCType("PolterghastHook"), npc.whoAmI, 0f, 0f, 0f, 0f, 255); + num729 = NPC.NewNPC((int)vector.X, (int)vector.Y, mod.NPCType("PolterghastHook"), npc.whoAmI, 0f, 0f, 0f, 0f, 255); + num729 = NPC.NewNPC((int)vector.X, (int)vector.Y, mod.NPCType("PolterghastHook"), npc.whoAmI, 0f, 0f, 0f, 0f, 255); + } + int[] array2 = new int[4]; + float num730 = 0f; + float num731 = 0f; + int num732 = 0; + int num; + for (int num733 = 0; num733 < 200; num733 = num + 1) + { + if (Main.npc[num733].active && Main.npc[num733].type == mod.NPCType("PolterghastHook")) + { + num730 += Main.npc[num733].Center.X; + num731 += Main.npc[num733].Center.Y; + array2[num732] = num733; + num732++; + if (num732 > 3) { break; } + } + num = num733; + } + num730 /= (float)num732; + num731 /= (float)num732; + float num734 = 2.5f; + float num735 = 0.025f; + if (!Main.player[npc.target].ZoneDungeon && !CalamityWorld.bossRushActive) + { + despawnTimer--; + if (despawnTimer <= 0) { despawnBoost = true; } + speedBoost1 = true; + num734 += 8f; + num735 = 0.15f; + } + else { despawnTimer = 600; } + if (phase2) + { + num734 = 3.5f; + num735 = 0.035f; + } + if (phase3) + { + if (NPC.CountNPCS(mod.NPCType("PolterPhantom")) > 0) + { + boostDR = true; + if (npc.ai[2] >= 300f) + { + num734 = phase5 ? 18f : 12f; + num735 = phase5 ? 0.12f : 0.08f; + } + else + { + if (phase5) + { + num734 = 5f; + num735 = 0.05f; + } + else if (phase4) + { + num734 = 4.5f; + num735 = 0.045f; + } + else + { + num734 = 4f; + num735 = 0.04f; + } + } + npc.ai[2] += 1f; + if (npc.ai[2] >= 600f) + { + npc.ai[2] = 0f; + npc.netUpdate = true; + } + } + else + { + boostDR = false; + num734 = phase5 ? 22f : 18f; + num735 = phase5 ? 0.15f : 0.12f; + npc.localAI[2] += 1f; + if (npc.localAI[2] >= 600f) + { + npc.localAI[2] = 0f; + NPC.NewNPC((int)vector.X, (int)vector.Y, mod.NPCType("PolterPhantom"), 0, 0f, 0f, 0f, 0f, 255); + Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 122); + for (int num621 = 0; num621 < 10; num621++) + { + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 2f); + Main.dust[num622].velocity *= 3f; + Main.dust[num622].noGravity = true; + if (Main.rand.Next(2) == 0) + { + Main.dust[num622].scale = 0.5f; + Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + } + } + for (int num623 = 0; num623 < 30; num623++) + { + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 3f); + Main.dust[num624].noGravity = true; + Main.dust[num624].velocity *= 5f; + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 180, 0f, 0f, 100, default(Color), 2f); + Main.dust[num624].velocity *= 2f; + } + npc.netUpdate = true; + } + } + } + if (expertMode) + { + num734 += revenge ? 1.5f : 1f; + num734 *= revenge ? 1.25f : 1.1f; + num735 += revenge ? 0.015f : 0.01f; + num735 *= revenge ? 1.2f : 1.1f; + } + Vector2 vector91 = new Vector2(num730, num731); + float num736 = Main.player[npc.target].Center.X - vector91.X; + float num737 = Main.player[npc.target].Center.Y - vector91.Y; + if (despawnBoost) + { + num737 *= -1f; + num736 *= -1f; + num734 += 8f; + } + float num738 = (float)Math.Sqrt((double)(num736 * num736 + num737 * num737)); + int num739 = 500; + if (speedBoost1) { num739 += 500; } + if (expertMode) { num739 += 150; } + if (num738 >= (float)num739) + { + num738 = (float)num739 / num738; + num736 *= num738; + num737 *= num738; + } + num730 += num736; + num731 += num737; + vector91 = new Vector2(vector.X, vector.Y); + num736 = num730 - vector91.X; + num737 = num731 - vector91.Y; + num738 = (float)Math.Sqrt((double)(num736 * num736 + num737 * num737)); + if (num738 < num734) + { + num736 = npc.velocity.X; + num737 = npc.velocity.Y; + } + else + { + num738 = num734 / num738; + num736 *= num738; + num737 *= num738; + } + Vector2 vector92 = new Vector2(vector.X, vector.Y); + float num740 = Main.player[npc.target].Center.X - vector92.X; + float num741 = Main.player[npc.target].Center.Y - vector92.Y; + npc.rotation = (float)Math.Atan2((double)num741, (double)num740) + 1.57f; + if (npc.velocity.X < num736) + { + npc.velocity.X = npc.velocity.X + num735; + if (npc.velocity.X < 0f && num736 > 0f) + { + npc.velocity.X = npc.velocity.X + num735 * 2f; + } + } + else if (npc.velocity.X > num736) + { + npc.velocity.X = npc.velocity.X - num735; + if (npc.velocity.X > 0f && num736 < 0f) + { + npc.velocity.X = npc.velocity.X - num735 * 2f; + } + } + if (npc.velocity.Y < num737) + { + npc.velocity.Y = npc.velocity.Y + num735; + if (npc.velocity.Y < 0f && num737 > 0f) + { + npc.velocity.Y = npc.velocity.Y + num735 * 2f; + } + } + else if (npc.velocity.Y > num737) + { + npc.velocity.Y = npc.velocity.Y - num735; + if (npc.velocity.Y > 0f && num737 < 0f) + { + npc.velocity.Y = npc.velocity.Y - num735 * 2f; + } + } + if (!phase2 && !phase3) + { + if (speedBoost1) + { + npc.defense = 300; + npc.damage = (int)(200f * Main.damageMultiplier); + } + else + { + npc.damage = expertMode ? 240 : 150; + npc.defense = 150; + } + if (Main.netMode != 1) + { + npc.localAI[1] += 1f; + if ((double)npc.life < (double)npc.lifeMax * 0.9) + { + npc.localAI[1] += 1f; + } + if ((double)npc.life < (double)npc.lifeMax * 0.8) + { + npc.localAI[1] += 1f; + } + if (speedBoost1 || CalamityWorld.bossRushActive) + { + npc.localAI[1] += 6f; + } + if (expertMode) + { + npc.localAI[1] += 1f; + } + if (npc.localAI[1] > 120f) + { + npc.localAI[1] = 0f; + bool flag47 = Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height); + if (npc.localAI[3] > 0f) + { + flag47 = true; + npc.localAI[3] = 0f; + } + if (flag47) + { + Vector2 vector93 = new Vector2(vector.X, vector.Y); + float num742 = 11f; + if (expertMode) + { + num742 = (CalamityWorld.bossRushActive ? 18f : 12f); + } + if (speedBoost1 || npc.GetGlobalNPC(mod).enraged) + { + num742 *= 2f; + } + float num743 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector93.X; + float num744 = Main.player[npc.target].position.Y + (float)Main.player[npc.target].height * 0.5f - vector93.Y; + float num745 = (float)Math.Sqrt((double)(num743 * num743 + num744 * num744)); + num745 = num742 / num745; + num743 *= num745; + num744 *= num745; + int num746 = expertMode ? 46 : 55; + int num747 = mod.ProjectileType("PhantomShot"); + int maxValue2 = 2; + if (expertMode) + { + maxValue2 = 4; + } + if ((double)npc.life < (double)npc.lifeMax * 0.8 && Main.rand.Next(maxValue2) == 0) + { + num746 = expertMode ? 51 : 60; + npc.localAI[1] = -30f; + num747 = mod.ProjectileType("PhantomBlast"); + } + if (speedBoost1 || npc.GetGlobalNPC(mod).enraged) + { + num746 *= 2; + } + vector93.X += num743 * 3f; + vector93.Y += num744 * 3f; + int num748 = Projectile.NewProjectile(vector93.X, vector93.Y, num743, num744, num747, num746, 0f, Main.myPlayer, 0f, 0f); + Main.projectile[num748].timeLeft = 300; + return; + } + else + { + Vector2 vector93 = new Vector2(vector.X, vector.Y); + float num742 = 11f; + if (expertMode) + { + num742 = (CalamityWorld.bossRushActive ? 18f : 12f); + } + if (speedBoost1 || npc.GetGlobalNPC(mod).enraged) + { + num742 *= 2f; + } + float num743 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector93.X; + float num744 = Main.player[npc.target].position.Y + (float)Main.player[npc.target].height * 0.5f - vector93.Y; + float num745 = (float)Math.Sqrt((double)(num743 * num743 + num744 * num744)); + num745 = num742 / num745; + num743 *= num745; + num744 *= num745; + int num746 = expertMode ? 51 : 60; + int num747 = mod.ProjectileType("PhantomBlast"); + if (speedBoost1 || npc.GetGlobalNPC(mod).enraged) + { + num746 *= 2; + } + vector93.X += num743 * 3f; + vector93.Y += num744 * 3f; + int num748 = Projectile.NewProjectile(vector93.X, vector93.Y, num743, num744, num747, num746, 0f, Main.myPlayer, 0f, 0f); + Main.projectile[num748].timeLeft = 180; + return; + } + } + } + } + else if (!phase3) + { + if (npc.ai[0] == 0f) + { + npc.ai[0] += 1f; + Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 122); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Polt"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Polt2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Polt3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Polt4"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Polt5"), 1f); + for (int num621 = 0; num621 < 10; num621++) + { + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 60, 0f, 0f, 100, default(Color), 2f); + Main.dust[num622].velocity *= 3f; + Main.dust[num622].noGravity = true; + if (Main.rand.Next(2) == 0) + { + Main.dust[num622].scale = 0.5f; + Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + } + } + for (int num623 = 0; num623 < 30; num623++) + { + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 180, 0f, 0f, 100, default(Color), 3f); + Main.dust[num624].noGravity = true; + Main.dust[num624].velocity *= 5f; + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 180, 0f, 0f, 100, default(Color), 2f); + Main.dust[num624].velocity *= 2f; + } + } + npc.GivenName = "Necroghast"; + if (speedBoost1 || npc.GetGlobalNPC(mod).enraged) + { + npc.defense = 200; + npc.damage = (int)(300f * Main.damageMultiplier); + } + else + { + npc.damage = expertMode ? 288 : 180; + npc.defense = 100; + } + if (Main.netMode != 1) + { + npc.localAI[1] += 1f; + if (speedBoost1 || CalamityWorld.bossRushActive) + { + npc.localAI[1] += 8f; + } + if (expertMode) + { + npc.localAI[1] += 1f; + } + if (npc.localAI[1] > 80f) + { + npc.localAI[1] = 0f; + bool flag47 = Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height); + if (npc.localAI[3] > 0f) + { + flag47 = true; + npc.localAI[3] = 0f; + } + if (flag47) + { + Vector2 vector93 = new Vector2(vector.X, vector.Y); + float num742 = 11f; + if (expertMode) + { + num742 = (CalamityWorld.bossRushActive ? 18f : 12f); + } + if (speedBoost1 || npc.GetGlobalNPC(mod).enraged) + { + num742 *= 2f; + } + float num743 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector93.X; + float num744 = Main.player[npc.target].position.Y + (float)Main.player[npc.target].height * 0.5f - vector93.Y; + float num745 = (float)Math.Sqrt((double)(num743 * num743 + num744 * num744)); + num745 = num742 / num745; + num743 *= num745; + num744 *= num745; + int num746 = expertMode ? 49 : 60; + int num747 = mod.ProjectileType("PhantomShot2"); + int maxValue2 = 2; + if (expertMode) + { + maxValue2 = 4; + } + if (Main.rand.Next(maxValue2) == 0) + { + num746 = expertMode ? 54 : 65; + npc.localAI[1] = -30f; + num747 = mod.ProjectileType("PhantomBlast2"); + } + if (speedBoost1 || npc.GetGlobalNPC(mod).enraged) + { + num746 *= 2; + } + vector93.X += num743 * 3f; + vector93.Y += num744 * 3f; + int num748 = Projectile.NewProjectile(vector93.X, vector93.Y, num743, num744, num747, num746, 0f, Main.myPlayer, 0f, 0f); + Main.projectile[num748].timeLeft = 400; + return; + } + else + { + Vector2 vector93 = new Vector2(vector.X, vector.Y); + float num742 = 11f; + if (expertMode) + { + num742 = (CalamityWorld.bossRushActive ? 18f : 12f); + } + if (speedBoost1 || npc.GetGlobalNPC(mod).enraged) + { + num742 *= 2f; + } + float num743 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector93.X; + float num744 = Main.player[npc.target].position.Y + (float)Main.player[npc.target].height * 0.5f - vector93.Y; + float num745 = (float)Math.Sqrt((double)(num743 * num743 + num744 * num744)); + num745 = num742 / num745; + num743 *= num745; + num744 *= num745; + int num746 = expertMode ? 54 : 65; + int num747 = mod.ProjectileType("PhantomBlast2"); + if (speedBoost1 || npc.GetGlobalNPC(mod).enraged) + { + num746 *= 2; + } + vector93.X += num743 * 3f; + vector93.Y += num744 * 3f; + int num748 = Projectile.NewProjectile(vector93.X, vector93.Y, num743, num744, num747, num746, 0f, Main.myPlayer, 0f, 0f); + Main.projectile[num748].timeLeft = 240; + return; + } + } + } + } + else + { + npc.HitSound = SoundID.NPCHit36; + if (!spawnGhost) + { + spawnGhost = true; + if (Main.netMode != 1) + { + NPC.NewNPC((int)vector.X, (int)vector.Y, mod.NPCType("PolterPhantom"), 0, 0f, 0f, 0f, 0f, 255); + for (int I = 0; I < 3; I++) + { + int Phantom = NPC.NewNPC((int)(Main.player[npc.target].Center.X + (Math.Sin(I * 120) * 500)), + (int)(Main.player[npc.target].Center.Y + (Math.Cos(I * 120) * 500)), mod.NPCType("PhantomFuckYou"), 0, 0, 0, 0, -1); + NPC Eye = Main.npc[Phantom]; + Eye.ai[0] = I * 120; + Eye.ai[3] = I * 120; + } + } + Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 122); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Polt"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Polt2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Polt3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Polt4"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Polt5"), 1f); + for (int num621 = 0; num621 < 10; num621++) + { + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 60, 0f, 0f, 100, default(Color), 2f); + Main.dust[num622].velocity *= 3f; + Main.dust[num622].noGravity = true; + if (Main.rand.Next(2) == 0) + { + Main.dust[num622].scale = 0.5f; + Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + } + } + for (int num623 = 0; num623 < 30; num623++) + { + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 180, 0f, 0f, 100, default(Color), 3f); + Main.dust[num624].noGravity = true; + Main.dust[num624].velocity *= 5f; + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 180, 0f, 0f, 100, default(Color), 2f); + Main.dust[num624].velocity *= 2f; + } + } + npc.GivenName = "Necroplasm"; + if (speedBoost1 || npc.GetGlobalNPC(mod).enraged) + { + npc.defense = 200; + npc.damage = (int)(400f * Main.damageMultiplier); + } + else + { + npc.damage = expertMode ? 336 : 210; + npc.defense = 0; + } + if (phase4) + { + npc.localAI[1] += 1f; + if (npc.localAI[1] >= 150f) + { + float num757 = 8f; + Vector2 vector94 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float num758 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector94.X + (float)Main.rand.Next(-10, 11); + float num759 = Math.Abs(num758 * 0.2f); + float num760 = Main.player[npc.target].position.Y + (float)Main.player[npc.target].height * 0.5f - vector94.Y + (float)Main.rand.Next(-10, 11); + if (num760 > 0f) + { + num759 = 0f; + } + num760 -= num759; + float num761 = (float)Math.Sqrt((double)(num758 * num758 + num760 * num760)); + num761 = num757 / num761; + num758 *= num761; + num760 *= num761; + if (NPC.CountNPCS(mod.NPCType("PhantomSpiritL")) < (revenge ? 3 : 2) && Main.netMode != 1) + { + int num762 = NPC.NewNPC((int)vector.X, (int)vector.Y, mod.NPCType("PhantomSpiritL"), 0, 0f, 0f, 0f, 0f, 255); + Main.npc[num762].velocity.X = num758; + Main.npc[num762].velocity.Y = num760; + Main.npc[num762].netUpdate = true; + } + npc.localAI[1] = 0f; + return; + } + } + } + } + public override void NPCLoot() { - if (CalamityWorld.armageddon) - { - for (int i = 0; i < 10; i++) - { - npc.DropBossBags(); - } - } - if (Main.rand.Next(10) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("PolterghastTrophy")); - } - if (Main.expertMode) + if (CalamityWorld.armageddon) + { + for (int i = 0; i < 5; i++) + { + npc.DropBossBags(); + } + } + if (Main.rand.Next(10) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("PolterghastTrophy")); + } + if (Main.expertMode) { npc.DropBossBags(); } @@ -659,34 +669,34 @@ namespace CalamityMod.NPCs.Polterghast } } } - + public override void BossLoot(ref string name, ref int potionType) { potionType = ItemID.SuperHealingPotion; } - + public override bool StrikeNPC(ref double damage, int defense, ref float knockback, int hitDirection, ref bool crit) { - double newDamage = (damage + (int)((double)defense * 0.25)); - float protection = 0.1f + //.1 - ((double)npc.life <= (double)npc.lifeMax * 0.75 ? 0.05f : 0f) + //.15 - ((double)npc.life <= (double)npc.lifeMax * (CalamityWorld.revenge ? 0.5 : 0.33) ? 0.05f : 0f) + //.2 - (boostDR ? 0.6f : 0f); //.8 - if (npc.ichor) - { - protection *= 0.88f; - } - else if (npc.onFire2) - { - protection *= 0.9f; - } - if (newDamage < 1.0) + double newDamage = (damage + (int)((double)defense * 0.25)); + float protection = 0.1f + //.1 + ((double)npc.life <= (double)npc.lifeMax * 0.75 ? 0.05f : 0f) + //.15 + ((double)npc.life <= (double)npc.lifeMax * (CalamityWorld.revenge ? 0.5 : 0.33) ? 0.05f : 0f) + //.2 + (boostDR ? 0.6f : 0f); //.8 + if (npc.ichor) + { + protection *= 0.88f; + } + else if (npc.onFire2) + { + protection *= 0.9f; + } + if (newDamage < 1.0) { newDamage = 1.0; } if (newDamage >= 1.0) { - newDamage = (double)((int)((double)(1f - (protection * (npc.ichor ? 0.88f : 1f))) * newDamage)); + newDamage = (double)((int)((double)(1f - protection) * newDamage)); if (newDamage < 1.0) { newDamage = 1.0; @@ -695,7 +705,7 @@ namespace CalamityMod.NPCs.Polterghast damage = newDamage; return true; } - + public override void FindFrame(int frameHeight) { bool phase2 = (double)npc.life > (double)npc.lifeMax * (CalamityWorld.revenge ? 0.5 : 0.33); @@ -735,25 +745,25 @@ namespace CalamityMod.NPCs.Polterghast } } } - + public override void OnHitPlayer(Player player, int damage, bool crit) { - if (CalamityWorld.revenge) - player.AddBuff(mod.BuffType("Horror"), 300, true); + if (CalamityWorld.revenge) + player.AddBuff(mod.BuffType("Horror"), 300, true); } - + public override bool CanHitPlayer(Player target, ref int cooldownSlot) { cooldownSlot = 1; return true; } - + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { npc.lifeMax = (int)(npc.lifeMax * 0.8f * bossLifeScale); npc.damage = (int)(npc.damage * 0.8f); } - + public override void HitEffect(int hitDirection, double damage) { Dust.NewDust(npc.position, npc.width, npc.height, 180, hitDirection, -1f, 0, default(Color), 1f); diff --git a/NPCs/Polterghast/PolterghastHook.cs b/NPCs/Polterghast/PolterghastHook.cs index e027dc9ed3..8b515df74c 100644 --- a/NPCs/Polterghast/PolterghastHook.cs +++ b/NPCs/Polterghast/PolterghastHook.cs @@ -226,7 +226,7 @@ namespace CalamityMod.NPCs.Polterghast { float num151 = 5f; int num152 = 60; - int num153 = 299; + int num153 = mod.ProjectileType("PhantomHookShot"); num149 = num151 / num149; num147 *= num149; num148 *= num149; diff --git a/NPCs/ProfanedGuardianBoss/ProfanedGuardianBoss.cs b/NPCs/ProfanedGuardianBoss/ProfanedGuardianBoss.cs index 80f899d3cd..76cda5793b 100644 --- a/NPCs/ProfanedGuardianBoss/ProfanedGuardianBoss.cs +++ b/NPCs/ProfanedGuardianBoss/ProfanedGuardianBoss.cs @@ -13,9 +13,9 @@ namespace CalamityMod.NPCs.ProfanedGuardianBoss [AutoloadBossHead] public class ProfanedGuardianBoss : ModNPC { - public int flareTimer = 0; //projectile stuff - public int flareProjectiles = 1; - public int dustTimer = 3; + private int flareTimer = 0; + private int flareProjectiles = 1; + private int dustTimer = 3; public override void SetStaticDefaults() { @@ -34,7 +34,7 @@ namespace CalamityMod.NPCs.ProfanedGuardianBoss npc.lifeMax = 102500; if (CalamityWorld.bossRushActive) { - npc.lifeMax = CalamityWorld.death ? 1200000 : 1000000; + npc.lifeMax = CalamityWorld.death ? 600000 : 500000; } npc.knockBackResist = 0f; npc.noGravity = true; @@ -46,7 +46,9 @@ namespace CalamityMod.NPCs.ProfanedGuardianBoss music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/Guardians"); else music = MusicID.Boss1; - for (int k = 0; k < npc.buffImmune.Length; k++) + NPCID.Sets.TrailCacheLength[npc.type] = 8; + NPCID.Sets.TrailingMode[npc.type] = 1; + for (int k = 0; k < npc.buffImmune.Length; k++) { npc.buffImmune[k] = true; npc.buffImmune[BuffID.Ichor] = false; @@ -226,6 +228,7 @@ namespace CalamityMod.NPCs.ProfanedGuardianBoss } } } + npc.damage = expertMode ? 200 : 100; if (npc.ai[0] == 0f) { npc.knockBackResist = 0f; @@ -302,6 +305,7 @@ namespace CalamityMod.NPCs.ProfanedGuardianBoss dustTimer = 3; } } + npc.damage = expertMode ? 240 : 120; npc.knockBackResist = 0f; float num1016 = num1003; npc.ai[1] += 1f; @@ -342,7 +346,51 @@ namespace CalamityMod.NPCs.ProfanedGuardianBoss npc.velocity *= 0.95f; } } - + + public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) + { + SpriteEffects spriteEffects = SpriteEffects.None; + if (npc.spriteDirection == 1) + { + spriteEffects = SpriteEffects.FlipHorizontally; + } + Microsoft.Xna.Framework.Color color24 = npc.GetAlpha(drawColor); + Microsoft.Xna.Framework.Color color25 = Lighting.GetColor((int)((double)npc.position.X + (double)npc.width * 0.5) / 16, (int)(((double)npc.position.Y + (double)npc.height * 0.5) / 16.0)); + Texture2D texture2D3 = Main.npcTexture[npc.type]; + int num156 = Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type]; + int y3 = num156 * (int)npc.frameCounter; + Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle(0, y3, texture2D3.Width, num156); + Vector2 origin2 = rectangle.Size() / 2f; + int num157 = 8; + int num158 = 2; + int num159 = 1; + float num160 = 0f; + int num161 = num159; + spriteBatch.Draw(texture2D3, npc.Center - Main.screenPosition + new Vector2(0, npc.gfxOffY), npc.frame, color24, npc.rotation, npc.frame.Size() / 2, npc.scale, spriteEffects, 0); + while (npc.ai[0] == 2f && Lighting.NotRetro && ((num158 > 0 && num161 < num157) || (num158 < 0 && num161 > num157))) + { + Microsoft.Xna.Framework.Color color26 = npc.GetAlpha(color25); + { + goto IL_6899; + } + IL_6881: + num161 += num158; + continue; + IL_6899: + float num164 = (float)(num157 - num161); + if (num158 < 0) + { + num164 = (float)(num159 - num161); + } + color26 *= num164 / ((float)NPCID.Sets.TrailCacheLength[npc.type] * 1.5f); + Vector2 value4 = (npc.oldPos[num161]); + float num165 = npc.rotation; + Main.spriteBatch.Draw(texture2D3, value4 + npc.Size / 2f - Main.screenPosition + new Vector2(0, npc.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rectangle), color26, num165 + npc.rotation * num160 * (float)(num161 - 1) * -(float)spriteEffects.HasFlag(SpriteEffects.FlipHorizontally).ToDirectionInt(), origin2, npc.scale, spriteEffects, 0f); + goto IL_6881; + } + return false; + } + public override bool CanHitPlayer(Player target, ref int cooldownSlot) { cooldownSlot = 1; @@ -379,6 +427,10 @@ namespace CalamityMod.NPCs.ProfanedGuardianBoss } if (npc.life <= 0) { + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ProfanedGuardianBossGores/ProfanedGuardianBossA"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ProfanedGuardianBossGores/ProfanedGuardianBossA2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ProfanedGuardianBossGores/ProfanedGuardianBossA3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ProfanedGuardianBossGores/ProfanedGuardianBossA4"), 1f); for (int k = 0; k < 50; k++) { Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default(Color), 1f); diff --git a/NPCs/ProfanedGuardianBoss/ProfanedGuardianBoss2.cs b/NPCs/ProfanedGuardianBoss/ProfanedGuardianBoss2.cs index 17faab45b8..cb1725234b 100644 --- a/NPCs/ProfanedGuardianBoss/ProfanedGuardianBoss2.cs +++ b/NPCs/ProfanedGuardianBoss/ProfanedGuardianBoss2.cs @@ -23,7 +23,7 @@ namespace CalamityMod.NPCs.ProfanedGuardianBoss { npc.npcSlots = 3f; npc.aiStyle = -1; - npc.damage = 100; + npc.damage = 80; npc.width = 100; //324 npc.height = 80; //216 npc.defense = 40; @@ -31,11 +31,12 @@ namespace CalamityMod.NPCs.ProfanedGuardianBoss npc.value = 0f; if (CalamityWorld.bossRushActive) { - npc.lifeMax = CalamityWorld.death ? 800000 : 600000; + npc.lifeMax = CalamityWorld.death ? 400000 : 300000; } npc.knockBackResist = 0f; npc.noGravity = true; npc.noTileCollide = true; + npc.canGhostHeal = false; aiType = -1; npc.boss = true; Mod calamityModMusic = ModLoader.GetMod("CalamityModMusic"); @@ -239,6 +240,9 @@ namespace CalamityMod.NPCs.ProfanedGuardianBoss } if (npc.life <= 0) { + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ProfanedGuardianBossGores/ProfanedGuardianBossT"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ProfanedGuardianBossGores/ProfanedGuardianBossT2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ProfanedGuardianBossGores/ProfanedGuardianBossT3"), 1f); for (int k = 0; k < 50; k++) { Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default(Color), 1f); diff --git a/NPCs/ProfanedGuardianBoss/ProfanedGuardianBoss3.cs b/NPCs/ProfanedGuardianBoss/ProfanedGuardianBoss3.cs index 6df9dfd035..b744feabcb 100644 --- a/NPCs/ProfanedGuardianBoss/ProfanedGuardianBoss3.cs +++ b/NPCs/ProfanedGuardianBoss/ProfanedGuardianBoss3.cs @@ -23,7 +23,7 @@ namespace CalamityMod.NPCs.ProfanedGuardianBoss { npc.npcSlots = 3f; npc.aiStyle = -1; - npc.damage = 100; + npc.damage = 80; npc.width = 100; //324 npc.height = 80; //216 npc.defense = 25; @@ -31,11 +31,12 @@ namespace CalamityMod.NPCs.ProfanedGuardianBoss npc.value = 0f; if (CalamityWorld.bossRushActive) { - npc.lifeMax = CalamityWorld.death ? 480000 : 400000; + npc.lifeMax = CalamityWorld.death ? 240000 : 200000; } npc.knockBackResist = 0f; npc.noGravity = true; npc.noTileCollide = true; + npc.canGhostHeal = false; aiType = -1; npc.boss = true; Mod calamityModMusic = ModLoader.GetMod("CalamityModMusic"); @@ -239,6 +240,11 @@ namespace CalamityMod.NPCs.ProfanedGuardianBoss } if (npc.life <= 0) { + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ProfanedGuardianBossGores/ProfanedGuardianBossH"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ProfanedGuardianBossGores/ProfanedGuardianBossH2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ProfanedGuardianBossGores/ProfanedGuardianBossH3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ProfanedGuardianBossGores/ProfanedGuardianBossH4"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ProfanedGuardianBossGores/ProfanedGuardianBossH5"), 1f); for (int k = 0; k < 50; k++) { Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default(Color), 1f); diff --git a/NPCs/Providence/ProvSpawnDefense.cs b/NPCs/Providence/ProvSpawnDefense.cs index e47aa27806..cb4e1fe2ae 100644 --- a/NPCs/Providence/ProvSpawnDefense.cs +++ b/NPCs/Providence/ProvSpawnDefense.cs @@ -26,7 +26,7 @@ namespace CalamityMod.NPCs.Providence npc.width = 100; //324 npc.height = 80; //216 npc.defense = 40; - npc.lifeMax = 21875; + npc.lifeMax = 25000; if (CalamityWorld.bossRushActive) { npc.lifeMax = CalamityWorld.death ? 360000 : 300000; @@ -117,7 +117,7 @@ namespace CalamityMod.NPCs.Providence double startAngle = Math.Atan2(npc.velocity.X, npc.velocity.Y) - spread / 2; double deltaAngle = spread / 8f; double offsetAngle; - int damage = expertMode ? 33 : 48; + int damage = expertMode ? 40 : 59; int projectileShot = mod.ProjectileType("ProfanedSpear"); int i; for (i = 0; i < 3; i++) @@ -181,6 +181,9 @@ namespace CalamityMod.NPCs.Providence } if (npc.life <= 0) { + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ProfanedGuardianBossGores/ProfanedGuardianBossT"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ProfanedGuardianBossGores/ProfanedGuardianBossT2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ProfanedGuardianBossGores/ProfanedGuardianBossT3"), 1f); for (int k = 0; k < 30; k++) { Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default(Color), 1f); diff --git a/NPCs/Providence/ProvSpawnHealer.cs b/NPCs/Providence/ProvSpawnHealer.cs index 01eac8f55b..f34afdcc20 100644 --- a/NPCs/Providence/ProvSpawnHealer.cs +++ b/NPCs/Providence/ProvSpawnHealer.cs @@ -26,7 +26,7 @@ namespace CalamityMod.NPCs.Providence npc.width = 100; //324 npc.height = 80; //216 npc.defense = 30; - npc.lifeMax = 37500; + npc.lifeMax = 40000; if (CalamityWorld.bossRushActive) { npc.lifeMax = CalamityWorld.death ? 500000 : 400000; @@ -182,6 +182,11 @@ namespace CalamityMod.NPCs.Providence } if (npc.life <= 0) { + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ProfanedGuardianBossGores/ProfanedGuardianBossH"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ProfanedGuardianBossGores/ProfanedGuardianBossH2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ProfanedGuardianBossGores/ProfanedGuardianBossH3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ProfanedGuardianBossGores/ProfanedGuardianBossH4"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ProfanedGuardianBossGores/ProfanedGuardianBossH5"), 1f); for (int k = 0; k < 50; k++) { Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default(Color), 1f); diff --git a/NPCs/Providence/ProvSpawnOffense.cs b/NPCs/Providence/ProvSpawnOffense.cs index e275ee2f2a..5833bff0da 100644 --- a/NPCs/Providence/ProvSpawnOffense.cs +++ b/NPCs/Providence/ProvSpawnOffense.cs @@ -24,11 +24,11 @@ namespace CalamityMod.NPCs.Providence { npc.npcSlots = 1f; npc.aiStyle = -1; - npc.damage = 80; + npc.damage = 100; npc.width = 100; //324 npc.height = 80; //216 npc.defense = 30; - npc.lifeMax = 37500; + npc.lifeMax = 42500; if (CalamityWorld.bossRushActive) { npc.lifeMax = CalamityWorld.death ? 500000 : 400000; @@ -37,6 +37,8 @@ namespace CalamityMod.NPCs.Providence npc.noGravity = true; npc.noTileCollide = true; aiType = -1; + NPCID.Sets.TrailCacheLength[npc.type] = 8; + NPCID.Sets.TrailingMode[npc.type] = 1; for (int k = 0; k < npc.buffImmune.Length; k++) { npc.buffImmune[k] = true; @@ -125,7 +127,7 @@ namespace CalamityMod.NPCs.Providence double startAngle = Math.Atan2(npc.velocity.X, npc.velocity.Y) - spread / 2; double deltaAngle = spread / 8f; double offsetAngle; - int damage = expertMode ? 33 : 48; + int damage = expertMode ? 40 : 59; int projectileShot = mod.ProjectileType("ProfanedSpear"); int i; for (i = 0; i < 8; i++) @@ -137,6 +139,7 @@ namespace CalamityMod.NPCs.Providence } } } + npc.damage = expertMode ? 200 : 100; if (npc.ai[0] == 0f) { npc.knockBackResist = 0f; @@ -204,7 +207,7 @@ namespace CalamityMod.NPCs.Providence if (fireDust && dustTimer <= 0) { Main.PlaySound(SoundID.Item20, npc.position); - int damage = expertMode ? 38 : 56; + int damage = expertMode ? 40 : 59; Vector2 vector173 = Vector2.Normalize(player.Center - vectorCenter) * (float)(npc.width + 20) / 2f + vectorCenter; int projectile = Projectile.NewProjectile((int)vector173.X, (int)vector173.Y, (float)(npc.direction * 2), 4f, mod.ProjectileType("FlareDust"), damage, 0f, Main.myPlayer, 0f, 0f); //changed Main.projectile[projectile].timeLeft = 120; @@ -213,6 +216,7 @@ namespace CalamityMod.NPCs.Providence dustTimer = 3; } } + npc.damage = expertMode ? 240 : 120; npc.knockBackResist = 0f; float num1016 = num1003; npc.ai[1] += 1f; @@ -254,7 +258,51 @@ namespace CalamityMod.NPCs.Providence } } - public override bool CheckActive() + public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) + { + SpriteEffects spriteEffects = SpriteEffects.None; + if (npc.spriteDirection == 1) + { + spriteEffects = SpriteEffects.FlipHorizontally; + } + Microsoft.Xna.Framework.Color color24 = npc.GetAlpha(drawColor); + Microsoft.Xna.Framework.Color color25 = Lighting.GetColor((int)((double)npc.position.X + (double)npc.width * 0.5) / 16, (int)(((double)npc.position.Y + (double)npc.height * 0.5) / 16.0)); + Texture2D texture2D3 = Main.npcTexture[npc.type]; + int num156 = Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type]; + int y3 = num156 * (int)npc.frameCounter; + Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle(0, y3, texture2D3.Width, num156); + Vector2 origin2 = rectangle.Size() / 2f; + int num157 = 8; + int num158 = 2; + int num159 = 1; + float num160 = 0f; + int num161 = num159; + spriteBatch.Draw(texture2D3, npc.Center - Main.screenPosition + new Vector2(0, npc.gfxOffY), npc.frame, color24, npc.rotation, npc.frame.Size() / 2, npc.scale, spriteEffects, 0); + while (npc.ai[0] == 2f && Lighting.NotRetro && ((num158 > 0 && num161 < num157) || (num158 < 0 && num161 > num157))) + { + Microsoft.Xna.Framework.Color color26 = npc.GetAlpha(color25); + { + goto IL_6899; + } + IL_6881: + num161 += num158; + continue; + IL_6899: + float num164 = (float)(num157 - num161); + if (num158 < 0) + { + num164 = (float)(num159 - num161); + } + color26 *= num164 / ((float)NPCID.Sets.TrailCacheLength[npc.type] * 1.5f); + Vector2 value4 = (npc.oldPos[num161]); + float num165 = npc.rotation; + Main.spriteBatch.Draw(texture2D3, value4 + npc.Size / 2f - Main.screenPosition + new Vector2(0, npc.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rectangle), color26, num165 + npc.rotation * num160 * (float)(num161 - 1) * -(float)spriteEffects.HasFlag(SpriteEffects.FlipHorizontally).ToDirectionInt(), origin2, npc.scale, spriteEffects, 0f); + goto IL_6881; + } + return false; + } + + public override bool CheckActive() { return false; } @@ -282,6 +330,10 @@ namespace CalamityMod.NPCs.Providence } if (npc.life <= 0) { + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ProfanedGuardianBossGores/ProfanedGuardianBossA"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ProfanedGuardianBossGores/ProfanedGuardianBossA2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ProfanedGuardianBossGores/ProfanedGuardianBossA3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ProfanedGuardianBossGores/ProfanedGuardianBossA4"), 1f); for (int k = 0; k < 30; k++) { Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default(Color), 1f); diff --git a/NPCs/Providence/Providence.cs b/NPCs/Providence/Providence.cs index cb4eba58bb..b004202368 100644 --- a/NPCs/Providence/Providence.cs +++ b/NPCs/Providence/Providence.cs @@ -14,20 +14,20 @@ namespace CalamityMod.NPCs.Providence [AutoloadBossHead] public class Providence : ModNPC { - private bool text = false; - private float bossLife; - private float flightPath = 0f; - private int phaseChange = 0; - private int immuneTimer = 300; - private int frameUsed = 0; - private int healTimer = 0; + private bool text = false; + private float bossLife; + private float flightPath = 0f; + private int phaseChange = 0; + private int immuneTimer = 300; + private int frameUsed = 0; + private int healTimer = 0; - public override void SetStaticDefaults() + public override void SetStaticDefaults() { DisplayName.SetDefault("Providence, the Profaned Goddess"); Main.npcFrameCount[npc.type] = 3; } - + public override void SetDefaults() { npc.npcSlots = 36f; @@ -35,85 +35,88 @@ namespace CalamityMod.NPCs.Providence npc.width = 600; npc.height = 450; npc.defense = 50; - npc.lifeMax = CalamityWorld.revenge ? 299000 : 264500; - if (CalamityWorld.death) - { - npc.lifeMax = 402500; - } - if (CalamityWorld.bossRushActive) - { - npc.lifeMax = CalamityWorld.death ? 11000000 : 10000000; - } - npc.knockBackResist = 0f; + npc.lifeMax = CalamityWorld.revenge ? 500000 : 440000; + if (CalamityWorld.death) + { + npc.lifeMax = 715000; + } + if (CalamityWorld.bossRushActive) + { + npc.lifeMax = CalamityWorld.death ? 12000000 : 10000000; + } + npc.knockBackResist = 0f; npc.aiStyle = -1; //new - aiType = -1; //new - npc.value = Item.buyPrice(1, 0, 0, 0); + aiType = -1; //new + npc.value = Item.buyPrice(0, 50, 0, 0); npc.boss = true; for (int k = 0; k < npc.buffImmune.Length; k++) { npc.buffImmune[k] = true; npc.buffImmune[BuffID.Ichor] = false; - npc.buffImmune[BuffID.CursedInferno] = false; - npc.buffImmune[mod.BuffType("AbyssalFlames")] = false; - npc.buffImmune[mod.BuffType("ArmorCrunch")] = false; - npc.buffImmune[mod.BuffType("DemonFlames")] = false; - npc.buffImmune[mod.BuffType("GodSlayerInferno")] = false; - npc.buffImmune[mod.BuffType("Nightwither")] = false; - npc.buffImmune[mod.BuffType("Shred")] = false; - npc.buffImmune[mod.BuffType("WhisperingDeath")] = false; - npc.buffImmune[mod.BuffType("SilvaStun")] = false; - } + npc.buffImmune[BuffID.CursedInferno] = false; + npc.buffImmune[mod.BuffType("AbyssalFlames")] = false; + npc.buffImmune[mod.BuffType("ArmorCrunch")] = false; + npc.buffImmune[mod.BuffType("DemonFlames")] = false; + npc.buffImmune[mod.BuffType("GodSlayerInferno")] = false; + npc.buffImmune[mod.BuffType("Nightwither")] = false; + npc.buffImmune[mod.BuffType("Shred")] = false; + npc.buffImmune[mod.BuffType("WhisperingDeath")] = false; + npc.buffImmune[mod.BuffType("SilvaStun")] = false; + } npc.noGravity = true; npc.noTileCollide = true; npc.netAlways = true; npc.chaseable = true; - Mod calamityModMusic = ModLoader.GetMod("CalamityModMusic"); - if (calamityModMusic != null) - music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/ProvidenceTheme"); - else - music = MusicID.LunarBoss; + npc.canGhostHeal = false; + Mod calamityModMusic = ModLoader.GetMod("CalamityModMusic"); + if (calamityModMusic != null) + music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/ProvidenceTheme"); + else + music = MusicID.LunarBoss; npc.HitSound = SoundID.NPCHit44; npc.DeathSound = SoundID.NPCDeath46; bossBag = mod.ItemType("ProvidenceBag"); } - + public override void AI() { - npc.damage = 0; + npc.damage = 0; CalamityGlobalNPC.holyBoss = npc.whoAmI; bool revenge = (CalamityWorld.revenge || CalamityWorld.bossRushActive); bool expertMode = (Main.expertMode || CalamityWorld.bossRushActive); Player player = Main.player[npc.target]; - Vector2 vector = npc.Center; + Vector2 vector = npc.Center; bool isHoly = player.ZoneHoly; bool isHell = player.ZoneUnderworldHeight; - bool canAttack = true; - bool attackMore = (double)npc.life <= (double)npc.lifeMax * 0.25; - if (!isHoly && !isHell && !CalamityWorld.bossRushActive) - { - if (immuneTimer > 0) - immuneTimer--; - } - else - { - immuneTimer = 300; - } - npc.dontTakeDamage = (immuneTimer <= 0); - npc.rotation = npc.velocity.X * 0.004f; - if (Main.raining) - { - Main.raining = false; - if (Main.netMode == 2) - NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); - } + bool canAttack = true; + bool attackMore = (double)npc.life <= (double)npc.lifeMax * 0.15; + bool phase2 = (double)npc.life <= (double)npc.lifeMax * 0.75; + bool phase3 = (double)npc.life <= (double)npc.lifeMax * 0.5; + if (!isHoly && !isHell && !CalamityWorld.bossRushActive) + { + if (immuneTimer > 0) + immuneTimer--; + } + else + { + immuneTimer = 300; + } + npc.dontTakeDamage = (immuneTimer <= 0); + npc.rotation = npc.velocity.X * 0.004f; + if (Main.raining) + { + Main.raining = false; + if (Main.netMode == 2) + NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + } if (NPC.CountNPCS(mod.NPCType("ProvSpawnHealer")) > 0) { float heal = revenge ? 90f : 120f; - if (CalamityWorld.death || CalamityWorld.bossRushActive) - { - heal = 30f; - } - healTimer++; + if (CalamityWorld.death || CalamityWorld.bossRushActive) + { + heal = 30f; + } + healTimer++; if (healTimer >= heal) { healTimer = 0; @@ -133,384 +136,173 @@ namespace CalamityMod.NPCs.Providence } } } - bool tooFarAway = Vector2.Distance(Main.player[npc.target].Center, vector) > 2800f; + bool tooFarAway = Vector2.Distance(Main.player[npc.target].Center, vector) > 2800f; if ((!Main.dayTime && npc.ai[0] != 2f && npc.ai[0] != 5f && npc.ai[0] != 7f) || player.dead) { if (npc.timeLeft > 10) { npc.timeLeft = 10; } - if (npc.velocity.X > 0f) + if (npc.velocity.X > 0f) { npc.velocity.X = npc.velocity.X + 0.25f; - } - else + } + else { npc.velocity.X = npc.velocity.X - 0.25f; } npc.velocity.Y = npc.velocity.Y - 0.25f; } - else if (npc.timeLeft < 3600) - { - npc.timeLeft = 3600; - } - if (tooFarAway) - { - if (!Main.player[npc.target].dead && Main.player[npc.target].active) - Main.player[npc.target].AddBuff(mod.BuffType("HolyInferno"), 2); - } + else if (npc.timeLeft < 3600) + { + npc.timeLeft = 3600; + } + if (tooFarAway) + { + if (!Main.player[npc.target].dead && Main.player[npc.target].active) + Main.player[npc.target].AddBuff(mod.BuffType("HolyInferno"), 2); + } if (bossLife == 0f && npc.life > 0) { bossLife = (float)npc.lifeMax; } - if (npc.life > 0) + if (npc.life > 0) { if (Main.netMode != 1) { - int num660 = (int)((double)npc.lifeMax * 0.3); - if ((float)(npc.life + num660) < bossLife) - { - bossLife = (float)npc.life; - int x = (int)(npc.position.X + (float)Main.rand.Next(npc.width - 32)); - int y = (int)(npc.position.Y + (float)Main.rand.Next(npc.height - 32)); - int spawn1 = mod.NPCType("ProvSpawnDefense"); - int spawn2 = mod.NPCType("ProvSpawnHealer"); - int spawn3 = mod.NPCType("ProvSpawnOffense"); - int spawnNPC1 = NPC.NewNPC(x - 100, y - 100, spawn1, 0, 0f, 0f, 0f, 0f, 255); - int spawnNPC2 = NPC.NewNPC(x + 100, y - 100, spawn2, 0, 0f, 0f, 0f, 0f, 255); - int spawnNPC3 = NPC.NewNPC(x, y + 100, spawn3, 0, 0f, 0f, 0f, 0f, 255); - if (Main.netMode == 2) - { - NetMessage.SendData(23, -1, -1, null, spawnNPC1, 0f, 0f, 0f, 0, 0, 0); - NetMessage.SendData(23, -1, -1, null, spawnNPC2, 0f, 0f, 0f, 0, 0, 0); - NetMessage.SendData(23, -1, -1, null, spawnNPC3, 0f, 0f, 0f, 0, 0, 0); - } - return; - } + int num660 = (int)((double)npc.lifeMax * 0.66); + if ((float)(npc.life + num660) < bossLife) + { + bossLife = (float)npc.life; + int x = (int)(npc.position.X + (float)Main.rand.Next(npc.width - 32)); + int y = (int)(npc.position.Y + (float)Main.rand.Next(npc.height - 32)); + int spawn1 = mod.NPCType("ProvSpawnDefense"); + int spawn2 = mod.NPCType("ProvSpawnHealer"); + int spawn3 = mod.NPCType("ProvSpawnOffense"); + int spawnNPC1 = NPC.NewNPC(x - 100, y - 100, spawn1, 0, 0f, 0f, 0f, 0f, 255); + int spawnNPC2 = NPC.NewNPC(x + 100, y - 100, spawn2, 0, 0f, 0f, 0f, 0f, 255); + int spawnNPC3 = NPC.NewNPC(x, y + 100, spawn3, 0, 0f, 0f, 0f, 0f, 255); + if (Main.netMode == 2) + { + NetMessage.SendData(23, -1, -1, null, spawnNPC1, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(23, -1, -1, null, spawnNPC2, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(23, -1, -1, null, spawnNPC3, 0f, 0f, 0f, 0, 0, 0); + } + return; + } } - } - if (NPC.CountNPCS(mod.NPCType("ProvSpawnOffense")) > 0 || - NPC.CountNPCS(mod.NPCType("ProvSpawnDefense")) > 0 || - NPC.CountNPCS(mod.NPCType("ProvSpawnHealer")) > 0) - { - npc.dontTakeDamage = true; - canAttack = false; - } - if (npc.ai[0] != 2f && npc.ai[0] != 5f) - { - bool firingLaser = npc.ai[0] == 7f; - if (flightPath == 0f) - { - npc.TargetClosest(true); - if (npc.Center.X < player.Center.X) - flightPath = 1f; - else - flightPath = -1f; - } - npc.TargetClosest(true); - int num851 = 800; - float num852 = Math.Abs(npc.Center.X - player.Center.X); - if (npc.Center.X < player.Center.X && flightPath < 0f && num852 > (float)num851) - { - flightPath = 0f; - } - if (npc.Center.X > player.Center.X && flightPath > 0f && num852 > (float)num851) - { - flightPath = 0f; - } - float num853 = expertMode ? 1.1f : 1.05f; - float num854 = expertMode ? 16f : 15f; - if ((double)npc.life < (double)npc.lifeMax * 0.75) - { - num853 = expertMode ? 1.15f : 1.1f; - num854 = expertMode ? 17f : 16f; - } - if ((double)npc.life < (double)npc.lifeMax * 0.5) - { - num853 = expertMode ? 1.2f : 1.15f; - num854 = expertMode ? 18f : 17f; - } - if ((double)npc.life < (double)npc.lifeMax * 0.25) - { - num853 = expertMode ? 1.25f : 1.2f; - num854 = expertMode ? 19f : 18f; - } - if ((double)npc.life < (double)npc.lifeMax * 0.1 || CalamityWorld.bossRushActive) - { - num853 = expertMode ? 1.3f : 1.25f; - num854 = expertMode ? 20f : 19f; - } - if (firingLaser) - { - num854 *= (canAttack ? 0.5f : 0.25f); - num853 *= (canAttack ? 0.5f : 0.25f); - } - npc.velocity.X = npc.velocity.X + flightPath * num853; - if (npc.velocity.X > num854) - { - npc.velocity.X = num854; - } - if (npc.velocity.X < -num854) - { - npc.velocity.X = -num854; - } - float num855 = player.position.Y - (npc.position.Y + (float)npc.height); - if (num855 < 200f) //150 - { - npc.velocity.Y = npc.velocity.Y - 0.2f; - } - if (num855 > 250f) //200 - { - npc.velocity.Y = npc.velocity.Y + 0.2f; - } - float speedVariance = (canAttack ? 3f : 1.5f); - if (npc.velocity.Y > (firingLaser ? speedVariance : 6f)) //8 - { - npc.velocity.Y = (firingLaser ? speedVariance : 6f); - } - if (npc.velocity.Y < (firingLaser ? -speedVariance : -6f)) //8 - { - npc.velocity.Y = (firingLaser ? -speedVariance : -6f); - } - } - if (npc.ai[0] == 0f) - { - npc.noGravity = true; - npc.noTileCollide = true; - npc.chaseable = true; - float num852 = Math.Abs(npc.Center.X - player.Center.X); - if ((num852 < 500f || npc.ai[3] < 0f) && npc.position.Y < player.position.Y) - { - npc.ai[3] += 1f; - int num856 = expertMode ? 25 : 26; - if ((double)npc.life < (double)npc.lifeMax * 0.5) - { - num856 = expertMode ? 23 : 24; - } - if ((double)npc.life < (double)npc.lifeMax * 0.1 || npc.GetGlobalNPC(mod).enraged) - { - num856 = expertMode ? 21 : 22; - } - if (!canAttack) - { - if (attackMore) - num856 = expertMode ? 35 : 40; - else - num856 = expertMode ? 40 : 46; - } - num856++; - if (npc.ai[3] > (float)num856) - { - npc.ai[3] = (float)(-(float)num856); - } - if (npc.ai[3] == 0f && Main.netMode != 1) - { - Vector2 vector112 = new Vector2(npc.Center.X, npc.Center.Y); - vector112.X += npc.velocity.X * 7f; - float num857 = player.position.X + (float)player.width * 0.5f - vector112.X; - float num858 = player.Center.Y - vector112.Y; - float num859 = (float)Math.Sqrt((double)(num857 * num857 + num858 * num858)); - float num860 = expertMode ? 10.25f : 9f; - if ((double)npc.life < (double)npc.lifeMax * 0.5) - { - num860 = expertMode ? 11.5f : 10f; - } - if ((double)npc.life < (double)npc.lifeMax * 0.1 || npc.GetGlobalNPC(mod).enraged) - { - num860 = expertMode ? 12.75f : 11f; - } - if (revenge) - { - num860 *= 1.15f; - } - num859 = num860 / num859; - num857 *= num859; - num858 *= num859; - int holyDamage = expertMode ? 46 : 63; - Projectile.NewProjectile(vector112.X, vector112.Y, num857, num858, mod.ProjectileType("HolyBlast"), holyDamage, 0f, Main.myPlayer, 0f, 0f); - } - } - else if (npc.ai[3] < 0f) - { - npc.ai[3] += 1f; - } - if (Main.netMode != 1) - { - npc.ai[1] += 1f; - if (npc.ai[1] > 300f) - npc.ai[0] = -1f; - } - } - else if (npc.ai[0] == 1f) - { - npc.noGravity = true; - npc.noTileCollide = true; - npc.chaseable = true; - if (Main.netMode != 1) - { - npc.ai[3] += 1f; - int num864 = expertMode ? 33 : 36; - if ((double)npc.life < (double)npc.lifeMax * 0.5) - { - num864 = expertMode ? 30 : 33; - } - if ((double)npc.life < (double)npc.lifeMax * 0.1 || CalamityWorld.bossRushActive) - { - num864 = expertMode ? 26 : 29; - } - if (!canAttack) - { - if (attackMore) - num864 = expertMode ? 40 : 45; - else - num864 = expertMode ? 45 : 52; - } - num864 += 3; - if (npc.ai[3] >= (float)num864) - { - npc.ai[3] = 0f; - Vector2 vector113 = new Vector2(npc.Center.X, npc.position.Y + (float)npc.height - 14f); - float num865 = npc.velocity.Y; - if (num865 < 0f) - { - num865 = 0f; - } - num865 += expertMode ? 4f : 3f; - float speedX2 = npc.velocity.X * 0.25f; - int fireDamage = expertMode ? 40 : 59; //260 200 - Projectile.NewProjectile(vector113.X, vector113.Y, speedX2, num865, mod.ProjectileType("HolyFire"), fireDamage, 0f, Main.myPlayer, 0f, 0f); - } - } - if (Main.netMode != 1) - { - npc.ai[1] += 1f; - if (npc.ai[1] > 300f) - npc.ai[0] = -1f; - } - } - else if (npc.ai[0] == 2f) - { - npc.noGravity = true; - npc.noTileCollide = true; - npc.chaseable = false; - npc.TargetClosest(true); - Vector2 vector114 = new Vector2(npc.Center.X, npc.Center.Y - 20f); - float num866 = (float)Main.rand.Next(-1000, 1001); - float num867 = (float)Main.rand.Next(-1000, 1001); - float num868 = (float)Math.Sqrt((double)(num866 * num866 + num867 * num867)); - float num869 = 3f; - npc.velocity *= 0.95f; - num868 = num869 / num868; - num866 *= num868; - num867 *= num868; - vector114.X += num866 * 4f; - vector114.Y += num867 * 4f; - npc.ai[3] += 1f; - int num870 = expertMode ? 3 : 4; - if (!canAttack) - { - if (attackMore) - num870 = expertMode ? 8 : 11; - else - num870 = expertMode ? 12 : 16; - } - if ((double)npc.life < (double)npc.lifeMax * 0.5 || CalamityWorld.bossRushActive) - { - num870 -= 2; - } - if ((double)npc.life < (double)npc.lifeMax * 0.1 || CalamityWorld.bossRushActive) - { - num870 -= 2; - } - if (npc.ai[3] > (float)num870) - { - npc.ai[3] = 0f; - if (Main.netMode != 1) - { - if (Main.rand.Next(4) == 0 && !CalamityWorld.death && !CalamityWorld.bossRushActive) - Projectile.NewProjectile(vector114.X, vector114.Y, num866, num867, mod.ProjectileType("HolyLight"), 0, 0f, Main.myPlayer, 0f, 0f); - else - Projectile.NewProjectile(vector114.X, vector114.Y, num866, num867, mod.ProjectileType("HolyBurnOrb"), 0, 0f, Main.myPlayer, 0f, 0f); - } - } - npc.ai[1] += 1f; - if (npc.ai[1] > 450f && !text) - { - text = true; - string key = "Mods.CalamityMod.ProfanedBossText"; - Color messageColor = Color.Orange; - if (Main.netMode == 0) - Main.NewText(Language.GetTextValue(key), messageColor); - else if (Main.netMode == 2) - NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); - } - if (npc.ai[1] > 600f) - { - if (Main.netMode != 2) - { - Player player2 = Main.player[Main.myPlayer]; - if (!player2.dead && player2.active && Vector2.Distance(player2.Center, vector) < 2800f) - { - Main.PlaySound(SoundID.Item20, player2.position); - player2.AddBuff(mod.BuffType("ExtremeGravity"), 3000, true); - for (int num621 = 0; num621 < 40; num621++) - { - int num622 = Dust.NewDust(new Vector2(player2.position.X, player2.position.Y), - player2.width, player2.height, 244, 0f, 0f, 100, default(Color), 2f); - Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) - { - Main.dust[num622].scale = 0.5f; - Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; - } - } - for (int num623 = 0; num623 < 60; num623++) - { - int num624 = Dust.NewDust(new Vector2(player2.position.X, player2.position.Y), - player2.width, player2.height, 244, 0f, 0f, 100, default(Color), 3f); - Main.dust[num624].noGravity = true; - Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(player2.position.X, player2.position.Y), - player2.width, player2.height, 244, 0f, 0f, 100, default(Color), 2f); - Main.dust[num624].velocity *= 2f; - } - } - } - text = false; - npc.ai[0] = -1f; - } - } - if (npc.ai[0] == 3f) + } + if (NPC.CountNPCS(mod.NPCType("ProvSpawnOffense")) > 0 || + NPC.CountNPCS(mod.NPCType("ProvSpawnDefense")) > 0 || + NPC.CountNPCS(mod.NPCType("ProvSpawnHealer")) > 0) + { + canAttack = attackMore; + } + npc.chaseable = canAttack && npc.ai[0] != 2f && npc.ai[0] != 5f; + if (npc.ai[0] != 2f && npc.ai[0] != 5f) + { + bool firingLaser = npc.ai[0] == 7f; + if (flightPath == 0f) + { + npc.TargetClosest(true); + if (npc.Center.X < player.Center.X) + flightPath = 1f; + else + flightPath = -1f; + } + npc.TargetClosest(true); + int num851 = 800; + float num852 = Math.Abs(npc.Center.X - player.Center.X); + if (npc.Center.X < player.Center.X && flightPath < 0f && num852 > (float)num851) + { + flightPath = 0f; + } + if (npc.Center.X > player.Center.X && flightPath > 0f && num852 > (float)num851) + { + flightPath = 0f; + } + float num853 = expertMode ? 1.1f : 1.05f; + float num854 = expertMode ? 16f : 15f; + if ((double)npc.life < (double)npc.lifeMax * 0.75) + { + num853 = expertMode ? 1.15f : 1.1f; + num854 = expertMode ? 17f : 16f; + } + if ((double)npc.life < (double)npc.lifeMax * 0.5) + { + num853 = expertMode ? 1.2f : 1.15f; + num854 = expertMode ? 18f : 17f; + } + if ((double)npc.life < (double)npc.lifeMax * 0.25) + { + num853 = expertMode ? 1.25f : 1.2f; + num854 = expertMode ? 19f : 18f; + } + if ((double)npc.life < (double)npc.lifeMax * 0.1 || CalamityWorld.bossRushActive) + { + num853 = expertMode ? 1.3f : 1.25f; + num854 = expertMode ? 20f : 19f; + } + if (firingLaser) + { + num854 *= (canAttack ? 0.5f : 0.25f); + num853 *= (canAttack ? 0.5f : 0.25f); + } + npc.velocity.X = npc.velocity.X + flightPath * num853; + if (npc.velocity.X > num854) + { + npc.velocity.X = num854; + } + if (npc.velocity.X < -num854) + { + npc.velocity.X = -num854; + } + float num855 = player.position.Y - (npc.position.Y + (float)npc.height); + if (num855 < (firingLaser ? 150f : 200f)) //150 + { + npc.velocity.Y = npc.velocity.Y - 0.2f; + } + if (num855 > (firingLaser ? 200f : 250f)) //200 + { + npc.velocity.Y = npc.velocity.Y + 0.2f; + } + float speedVariance = (canAttack ? 3f : 1.5f); + if (npc.velocity.Y > (firingLaser ? speedVariance : 6f)) //8 + { + npc.velocity.Y = (firingLaser ? speedVariance : 6f); + } + if (npc.velocity.Y < (firingLaser ? -speedVariance : -6f)) //8 + { + npc.velocity.Y = (firingLaser ? -speedVariance : -6f); + } + } + if (npc.ai[0] == 0f) { npc.noGravity = true; npc.noTileCollide = true; - npc.chaseable = true; float num852 = Math.Abs(npc.Center.X - player.Center.X); if ((num852 < 500f || npc.ai[3] < 0f) && npc.position.Y < player.position.Y) { npc.ai[3] += 1f; - int num856 = expertMode ? 10 : 11; + int num856 = expertMode ? 25 : 26; if ((double)npc.life < (double)npc.lifeMax * 0.5) { - num856 = expertMode ? 9 : 10; + num856 = expertMode ? 23 : 24; } - if ((double)npc.life < (double)npc.lifeMax * 0.1 || CalamityWorld.bossRushActive) + if ((double)npc.life <= (double)npc.lifeMax * 0.1 || npc.GetGlobalNPC(mod).enraged) { - num856 = expertMode ? 8 : 9; + num856 = expertMode ? 21 : 22; } - if (!canAttack) - { - if (attackMore) - num856 = expertMode ? 20 : 23; - else - num856 = expertMode ? 30 : 35; - } - num856++; + if (!canAttack) + { + num856 = expertMode ? 40 : 46; + } + num856++; if (npc.ai[3] > (float)num856) { npc.ai[3] = (float)(-(float)num856); } - if (npc.ai[3] == 0f && Main.netMode != 1) + if (npc.ai[3] == 0f && Main.netMode != 1) { Vector2 vector112 = new Vector2(npc.Center.X, npc.Center.Y); vector112.X += npc.velocity.X * 7f; @@ -518,11 +310,11 @@ namespace CalamityMod.NPCs.Providence float num858 = player.Center.Y - vector112.Y; float num859 = (float)Math.Sqrt((double)(num857 * num857 + num858 * num858)); float num860 = expertMode ? 10.25f : 9f; - if ((double)npc.life < (double)npc.lifeMax * 0.5) + if ((double)npc.life < (double)npc.lifeMax * 0.5) { num860 = expertMode ? 11.5f : 10f; } - if ((double)npc.life < (double)npc.lifeMax * 0.1 || CalamityWorld.bossRushActive) + if ((double)npc.life <= (double)npc.lifeMax * 0.1 || npc.GetGlobalNPC(mod).enraged) { num860 = expertMode ? 12.75f : 11f; } @@ -533,10 +325,10 @@ namespace CalamityMod.NPCs.Providence num859 = num860 / num859; num857 *= num859; num858 *= num859; - int holyDamage = expertMode ? 39 : 55; //280 210 - Projectile.NewProjectile(vector112.X, vector112.Y, num857 * 0.1f, num858, mod.ProjectileType("MoltenBlast"), holyDamage, 0f, Main.myPlayer, 0f, 0f); + int holyDamage = expertMode ? 46 : 63; + Projectile.NewProjectile(vector112.X, vector112.Y, num857, num858, mod.ProjectileType("HolyBlast"), holyDamage, 0f, Main.myPlayer, 0f, 0f); } - } + } else if (npc.ai[3] < 0f) { npc.ai[3] += 1f; @@ -548,356 +340,539 @@ namespace CalamityMod.NPCs.Providence npc.ai[0] = -1f; } } - else if (npc.ai[0] == 4f) + else if (npc.ai[0] == 1f) { npc.noGravity = true; npc.noTileCollide = true; - npc.chaseable = true; - if (Main.netMode != 1) + if (Main.netMode != 1) { npc.ai[3] += 1f; - int num864 = expertMode ? 70 : 74; - if ((double)npc.life < (double)npc.lifeMax * 0.5) + int num864 = expertMode ? 33 : 36; + if ((double)npc.life < (double)npc.lifeMax * 0.5) { - num864 = expertMode ? 64 : 70; + num864 = expertMode ? 30 : 33; } - if ((double)npc.life < (double)npc.lifeMax * 0.1 || npc.GetGlobalNPC(mod).enraged) + if ((double)npc.life <= (double)npc.lifeMax * 0.1 || CalamityWorld.bossRushActive) { - num864 = expertMode ? 56 : 64; + num864 = expertMode ? 26 : 29; } - if (!canAttack) - { - if (attackMore) - num864 = expertMode ? 115 : 135; - else - num864 = expertMode ? 148 : 156; - } - num864 += 3; - if (npc.ai[3] >= (float)num864) + if (!canAttack) + { + num864 = expertMode ? 45 : 52; + } + num864 += 3; + if (npc.ai[3] >= (float)num864) { npc.ai[3] = 0f; Vector2 vector113 = new Vector2(npc.Center.X, npc.position.Y + (float)npc.height - 14f); - int i2 = (int)(vector113.X / 16f); - int j2 = (int)(vector113.Y / 16f); - if (!WorldGen.SolidTile(i2, j2)) + float num865 = npc.velocity.Y; + if (num865 < 0f) { - float num865 = npc.velocity.Y; - if (num865 < 0f) - { - num865 = 0f; - } - num865 += expertMode ? 4f : 3f; - float speedX2 = npc.velocity.X * 0.25f; - int fireDamage = expertMode ? 44 : 60; //260 100 - Projectile.NewProjectile(vector113.X, vector113.Y, speedX2, num865, mod.ProjectileType("HolyBomb"), fireDamage, 0f, Main.myPlayer, (float)Main.rand.Next(5), 0f); + num865 = 0f; } + num865 += expertMode ? 4f : 3f; + float speedX2 = npc.velocity.X * 0.25f; + int fireDamage = expertMode ? 40 : 59; //260 200 + Projectile.NewProjectile(vector113.X, vector113.Y, speedX2, num865, mod.ProjectileType("HolyFire"), fireDamage, 0f, Main.myPlayer, 0f, 0f); } } - if (Main.netMode != 1) + if (Main.netMode != 1) { npc.ai[1] += 1f; if (npc.ai[1] > 300f) npc.ai[0] = -1f; } } - else if (npc.ai[0] == 5f) - { - npc.noGravity = true; - npc.noTileCollide = true; - npc.chaseable = false; - npc.TargetClosest(true); - npc.velocity *= 0.95f; - if (Main.netMode != 1) - { - npc.ai[2] += (npc.GetGlobalNPC(mod).enraged ? 2f : 1f); - if ((double)npc.life < (double)npc.lifeMax * 0.5 || CalamityWorld.bossRushActive) - { - npc.ai[2] += 1f; - } - if ((double)npc.life < (double)npc.lifeMax * 0.1 || CalamityWorld.bossRushActive) - { - npc.ai[2] += 1f; - } - if (!canAttack && attackMore) - { - npc.ai[2] += 1f; //4 - } - if (npc.ai[2] > (canAttack ? 24f : 60f)) - { - npc.ai[2] = 0f; - Vector2 vector93 = new Vector2(vector.X, vector.Y); - float num742 = 10f; - if (expertMode) - { - num742 = 12f; - } - float num743 = player.position.X + (float)player.width * 0.5f - vector93.X; - float num744 = player.position.Y + (float)player.height * 0.5f - vector93.Y; - float num745 = (float)Math.Sqrt((double)(num743 * num743 + num744 * num744)); - num745 = num742 / num745; - num743 *= num745; - num744 *= num745; - int num746 = expertMode ? 48 : 65; //288 220 - int num747 = mod.ProjectileType("HolyShot"); - vector93.X += num743 * 3f; - vector93.Y += num744 * 3f; - Projectile.NewProjectile(vector93.X, vector93.Y, num743, num744, num747, num746, 0f, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(player.position.X + (float)Main.rand.Next(-1000, 1000), player.position.Y + (float)Main.rand.Next(-100, 100), 0f, 0f, mod.ProjectileType("HolySpear"), num746, 0f, Main.myPlayer, (float)Main.rand.Next(2), 0f); - return; - } - } - if (Main.netMode != 1) - { - npc.ai[1] += 1f; - if (npc.ai[1] > 300f) - npc.ai[0] = -1f; - } - } - else if (npc.ai[0] == 6f) - { - npc.noGravity = true; - npc.noTileCollide = true; - npc.chaseable = false; - npc.TargetClosest(true); - npc.velocity *= 0.95f; - if (Main.netMode != 1) - { - npc.ai[1] += 1f; - if (npc.ai[1] > 60f) - { - int damage = expertMode ? 52 : 70; //288 220 - Projectile.NewProjectile(player.Center.X, player.Center.Y - 360f, 0f, 0f, mod.ProjectileType("ProvidenceCrystal"), damage, 0f, Main.myPlayer, 0f, 0f); - npc.ai[0] = -1f; - } - } - } - else if (npc.ai[0] == 7f) - { - npc.noGravity = true; - npc.noTileCollide = true; - npc.chaseable = false; - Vector2 value19 = new Vector2(27f, 59f); - npc.ai[2] += 1f; - if (npc.ai[2] < 180f) - { - npc.localAI[1] -= 0.05f; - if (npc.localAI[1] < 0f) - { - npc.localAI[1] = 0f; - } - if (npc.ai[2] >= 60f) - { - Vector2 center20 = npc.Center; - int num1220 = 0; - if (npc.ai[2] >= 120f) - { - num1220 = 1; - } - int num; - for (int num1221 = 0; num1221 < 1 + num1220; num1221 = num + 1) - { - int num1222 = 244; - float num1223 = 1.2f; - if (num1221 % 2 == 1) - { - num1223 = 2.8f; - } - Vector2 vector199 = center20 + ((float)Main.rand.NextDouble() * 6.28318548f).ToRotationVector2() * value19 / 2f; - int num1224 = Dust.NewDust(vector199 - Vector2.One * 8f, 16, 16, num1222, npc.velocity.X / 2f, npc.velocity.Y / 2f, 0, default(Color), 1f); - Main.dust[num1224].velocity = Vector2.Normalize(center20 - vector199) * 3.5f * (10f - (float)num1220 * 2f) / 10f; - Main.dust[num1224].noGravity = true; - Main.dust[num1224].scale = num1223; - num = num1221; - } - } - } - else if (npc.ai[2] < 360f) - { - if (npc.ai[2] == 180f) - { - if (Main.player[Main.myPlayer].active && !Main.player[Main.myPlayer].dead && Vector2.Distance(Main.player[Main.myPlayer].Center, vector) < 2800f) - { - Main.PlaySound(29, (int)Main.player[Main.myPlayer].position.X, (int)Main.player[Main.myPlayer].position.Y, 104, 1f, 0f); - } - if (Main.netMode != 1) - { - npc.TargetClosest(false); - Vector2 vector200 = player.Center - npc.Center; - vector200.Normalize(); - float num1225 = -1f; - if (vector200.X < 0f) - { - num1225 = 1f; - } - vector200 = vector200.RotatedBy((double)(-(double)num1225 * 6.28318548f / 6f), default(Vector2)); - Projectile.NewProjectile(npc.Center.X, npc.Center.Y - 16f, vector200.X, vector200.Y, mod.ProjectileType("ProvidenceHolyRay"), 100, 0f, Main.myPlayer, num1225 * 6.28318548f / 450f, (float)npc.whoAmI); - npc.ai[3] = (vector200.ToRotation() + 9.424778f) * num1225; //3.14159265f - npc.netUpdate = true; - } - } - npc.localAI[1] += 0.05f; - if (npc.localAI[1] > 1f) - { - npc.localAI[1] = 1f; - } - float num1226 = (float)(npc.ai[3] >= 0f).ToDirectionInt(); - float num1227 = npc.ai[3]; - if (num1227 < 0f) - { - num1227 *= -1f; - } - num1227 += -9.424778f; - num1227 += num1226 * 6.28318548f / 540f; - npc.localAI[0] = num1227; - } - else - { - npc.localAI[1] -= 0.07f; //15 - if (npc.localAI[1] < 0f) - npc.localAI[1] = 0f; - } - if (Main.netMode != 1) - { - npc.ai[1] += 1f; - if (npc.ai[1] > 375f) - npc.ai[0] = -1f; - } - } - if (npc.ai[0] == -1f) + else if (npc.ai[0] == 2f) { npc.noGravity = true; npc.noTileCollide = true; - npc.chaseable = true; - phaseChange++; - if (phaseChange > 14) - { - phaseChange = 0; - } - int phase = 0; //0 = blasts 1 = holy fire 2 = shell heal 3 = molten blobs 4 = holy bombs 5 = shell spears 6 = crystal 7 = laser - if (CalamityWorld.death || CalamityWorld.bossRushActive) - { - switch (phaseChange) - { - case 0: phase = 4; break; - case 1: phase = 5; break; - case 2: phase = 0; break; - case 3: phase = attackMore ? 6 : 1; break; - case 4: phase = 2; break; - case 5: phase = 4; break; - case 6: phase = 1; break; - case 7: phase = 5; break; - case 8: - phase = attackMore ? 7 : 3; - if (attackMore) - { - npc.TargetClosest(false); - Vector2 v3 = player.Center - npc.Center - new Vector2(0f, -22f); - float num1219 = v3.Length() / 500f; - if (num1219 > 1f) - { - num1219 = 1f; - } - num1219 = 1f - num1219; - num1219 *= 2f; - if (num1219 > 1f) - { - num1219 = 1f; - } - npc.localAI[0] = v3.ToRotation(); - npc.localAI[1] = num1219; - } - break; - case 9: phase = 3; break; - case 10: phase = 2; break; - case 11: phase = 4; break; - case 12: - phase = attackMore ? 7 : 4; - if (attackMore) - { - npc.TargetClosest(false); - Vector2 v3 = player.Center - npc.Center - new Vector2(0f, -22f); - float num1219 = v3.Length() / 500f; - if (num1219 > 1f) - { - num1219 = 1f; - } - num1219 = 1f - num1219; - num1219 *= 2f; - if (num1219 > 1f) - { - num1219 = 1f; - } - npc.localAI[0] = v3.ToRotation(); - npc.localAI[1] = num1219; - } - break; - case 13: phase = 5; break; - case 14: phase = 0; break; - } - } - else - { - switch (phaseChange) - { - case 0: phase = 0; break; - case 1: - phase = attackMore ? 7 : 1; - if (attackMore) - { - npc.TargetClosest(false); - Vector2 v3 = player.Center - npc.Center - new Vector2(0f, -22f); - float num1219 = v3.Length() / 500f; - if (num1219 > 1f) - { - num1219 = 1f; - } - num1219 = 1f - num1219; - num1219 *= 2f; - if (num1219 > 1f) - { - num1219 = 1f; - } - npc.localAI[0] = v3.ToRotation(); - npc.localAI[1] = num1219; - } - break; - case 2: phase = 3; break; - case 3: phase = 4; break; - case 4: phase = 5; break; - case 5: phase = attackMore ? 6 : 4; break; - case 6: phase = 3; break; - case 7: phase = 1; break; - case 8: phase = 0; break; - case 9: phase = 2; break; - case 10: phase = 4; break; - case 11: - phase = attackMore ? 7 : 0; - if (attackMore) - { - npc.TargetClosest(false); - Vector2 v3 = player.Center - npc.Center - new Vector2(0f, -22f); - float num1219 = v3.Length() / 500f; - if (num1219 > 1f) - { - num1219 = 1f; - } - num1219 = 1f - num1219; - num1219 *= 2f; - if (num1219 > 1f) - { - num1219 = 1f; - } - npc.localAI[0] = v3.ToRotation(); - npc.localAI[1] = num1219; - } - break; - case 12: phase = 3; break; - case 13: phase = 1; break; - case 14: phase = 5; break; - } - } npc.TargetClosest(true); - if (Math.Abs(npc.Center.X - player.Center.X) > 3000f) + Vector2 vector114 = new Vector2(npc.Center.X, npc.Center.Y - 20f); + float num866 = (float)Main.rand.Next(-1000, 1001); + float num867 = (float)Main.rand.Next(-1000, 1001); + float num868 = (float)Math.Sqrt((double)(num866 * num866 + num867 * num867)); + float num869 = 3f; + npc.velocity *= 0.95f; + num868 = num869 / num868; + num866 *= num868; + num867 *= num868; + vector114.X += num866 * 4f; + vector114.Y += num867 * 4f; + npc.ai[3] += 1f; + int num870 = expertMode ? 3 : 4; + if (!canAttack) + { + num870 = expertMode ? 12 : 16; + } + if ((double)npc.life < (double)npc.lifeMax * 0.5 || CalamityWorld.bossRushActive) + { + num870 -= 2; + } + if ((double)npc.life <= (double)npc.lifeMax * 0.1 || CalamityWorld.bossRushActive) + { + num870 -= 2; + } + if (npc.ai[3] > (float)num870) + { + npc.ai[3] = 0f; + if (Main.netMode != 1) + { + if (Main.rand.Next(4) == 0 && !CalamityWorld.death && !CalamityWorld.bossRushActive) + Projectile.NewProjectile(vector114.X, vector114.Y, num866, num867, mod.ProjectileType("HolyLight"), 0, 0f, Main.myPlayer, 0f, 0f); + else + Projectile.NewProjectile(vector114.X, vector114.Y, num866, num867, mod.ProjectileType("HolyBurnOrb"), 0, 0f, Main.myPlayer, 0f, 0f); + } + } + npc.ai[1] += 1f; + if (npc.ai[1] > 450f && !text) + { + text = true; + string key = "Mods.CalamityMod.ProfanedBossText"; + Color messageColor = Color.Orange; + if (Main.netMode == 0) + Main.NewText(Language.GetTextValue(key), messageColor); + else if (Main.netMode == 2) + NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); + } + if (npc.ai[1] > 600f) + { + if (Main.netMode != 2) + { + Player player2 = Main.player[Main.myPlayer]; + if (!player2.dead && player2.active && Vector2.Distance(player2.Center, vector) < 2800f) + { + Main.PlaySound(SoundID.Item20, player2.position); + player2.AddBuff(mod.BuffType("ExtremeGravity"), 3000, true); + for (int num621 = 0; num621 < 40; num621++) + { + int num622 = Dust.NewDust(new Vector2(player2.position.X, player2.position.Y), + player2.width, player2.height, 244, 0f, 0f, 100, default(Color), 2f); + Main.dust[num622].velocity *= 3f; + if (Main.rand.Next(2) == 0) + { + Main.dust[num622].scale = 0.5f; + Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + } + } + for (int num623 = 0; num623 < 60; num623++) + { + int num624 = Dust.NewDust(new Vector2(player2.position.X, player2.position.Y), + player2.width, player2.height, 244, 0f, 0f, 100, default(Color), 3f); + Main.dust[num624].noGravity = true; + Main.dust[num624].velocity *= 5f; + num624 = Dust.NewDust(new Vector2(player2.position.X, player2.position.Y), + player2.width, player2.height, 244, 0f, 0f, 100, default(Color), 2f); + Main.dust[num624].velocity *= 2f; + } + } + } + text = false; + npc.ai[0] = -1f; + } + } + if (npc.ai[0] == 3f) + { + npc.noGravity = true; + npc.noTileCollide = true; + float num852 = Math.Abs(npc.Center.X - player.Center.X); + if ((num852 < 500f || npc.ai[3] < 0f) && npc.position.Y < player.position.Y) + { + npc.ai[3] += 1f; + int num856 = expertMode ? 10 : 11; + if ((double)npc.life < (double)npc.lifeMax * 0.5) + { + num856 = expertMode ? 9 : 10; + } + if ((double)npc.life <= (double)npc.lifeMax * 0.1 || CalamityWorld.bossRushActive) + { + num856 = expertMode ? 8 : 9; + } + if (!canAttack) + { + num856 = expertMode ? 30 : 35; + } + num856++; + if (npc.ai[3] > (float)num856) + { + npc.ai[3] = (float)(-(float)num856); + } + if (npc.ai[3] == 0f && Main.netMode != 1) + { + Vector2 vector112 = new Vector2(npc.Center.X, npc.Center.Y); + vector112.X += npc.velocity.X * 7f; + float num857 = player.position.X + (float)player.width * 0.5f - vector112.X; + float num858 = player.Center.Y - vector112.Y; + float num859 = (float)Math.Sqrt((double)(num857 * num857 + num858 * num858)); + float num860 = expertMode ? 10.25f : 9f; + if ((double)npc.life < (double)npc.lifeMax * 0.5) + { + num860 = expertMode ? 11.5f : 10f; + } + if ((double)npc.life <= (double)npc.lifeMax * 0.1 || CalamityWorld.bossRushActive) + { + num860 = expertMode ? 12.75f : 11f; + } + if (revenge) + { + num860 *= 1.15f; + } + num859 = num860 / num859; + num857 *= num859; + num858 *= num859; + int holyDamage = expertMode ? 39 : 55; //280 210 + Projectile.NewProjectile(vector112.X, vector112.Y, num857 * 0.1f, num858, mod.ProjectileType("MoltenBlast"), holyDamage, 0f, Main.myPlayer, 0f, 0f); + } + } + else if (npc.ai[3] < 0f) + { + npc.ai[3] += 1f; + } + if (Main.netMode != 1) + { + npc.ai[1] += 1f; + if (npc.ai[1] > 300f) + npc.ai[0] = -1f; + } + } + else if (npc.ai[0] == 4f) + { + npc.noGravity = true; + npc.noTileCollide = true; + if (Main.netMode != 1) + { + npc.ai[3] += 1f; + int num864 = expertMode ? 70 : 74; + if ((double)npc.life < (double)npc.lifeMax * 0.5) + { + num864 = expertMode ? 64 : 70; + } + if ((double)npc.life <= (double)npc.lifeMax * 0.1 || npc.GetGlobalNPC(mod).enraged) + { + num864 = expertMode ? 56 : 64; + } + if (!canAttack) + { + num864 = expertMode ? 148 : 156; + } + num864 += 3; + if (npc.ai[3] >= (float)num864) + { + npc.ai[3] = 0f; + Vector2 vector113 = new Vector2(npc.Center.X, npc.position.Y + (float)npc.height - 14f); + int i2 = (int)(vector113.X / 16f); + int j2 = (int)(vector113.Y / 16f); + if (!WorldGen.SolidTile(i2, j2)) + { + float num865 = npc.velocity.Y; + if (num865 < 0f) + { + num865 = 0f; + } + num865 += expertMode ? 4f : 3f; + float speedX2 = npc.velocity.X * 0.25f; + int fireDamage = expertMode ? 44 : 60; //260 100 + Projectile.NewProjectile(vector113.X, vector113.Y, speedX2, num865, mod.ProjectileType("HolyBomb"), fireDamage, 0f, Main.myPlayer, (float)Main.rand.Next(5), 0f); + } + } + } + if (Main.netMode != 1) + { + npc.ai[1] += 1f; + if (npc.ai[1] > 300f) + npc.ai[0] = -1f; + } + } + else if (npc.ai[0] == 5f) + { + npc.noGravity = true; + npc.noTileCollide = true; + npc.TargetClosest(true); + npc.velocity *= 0.95f; + if (Main.netMode != 1) + { + npc.ai[2] += (npc.GetGlobalNPC(mod).enraged ? 2f : 1f); + if ((double)npc.life < (double)npc.lifeMax * 0.5 || CalamityWorld.bossRushActive) + { + npc.ai[2] += 1f; + } + if ((double)npc.life <= (double)npc.lifeMax * 0.1 || CalamityWorld.bossRushActive) + { + npc.ai[2] += 1f; + } + if (npc.ai[2] > (canAttack ? 24f : 60f)) + { + npc.ai[2] = 0f; + Vector2 vector93 = new Vector2(vector.X, vector.Y); + float num742 = 10f; + if (expertMode) + { + num742 = 12f; + } + float num743 = player.position.X + (float)player.width * 0.5f - vector93.X; + float num744 = player.position.Y + (float)player.height * 0.5f - vector93.Y; + float num745 = (float)Math.Sqrt((double)(num743 * num743 + num744 * num744)); + num745 = num742 / num745; + num743 *= num745; + num744 *= num745; + int num746 = expertMode ? 48 : 65; //288 220 + int num747 = mod.ProjectileType("HolyShot"); + vector93.X += num743 * 3f; + vector93.Y += num744 * 3f; + Projectile.NewProjectile(vector93.X, vector93.Y, num743, num744, num747, num746, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X + (float)Main.rand.Next(-1000, 1000), player.position.Y + (float)Main.rand.Next(-100, 100), 0f, 0f, mod.ProjectileType("HolySpear"), num746, 0f, Main.myPlayer, (float)Main.rand.Next(2), 0f); + return; + } + } + if (Main.netMode != 1) + { + npc.ai[1] += 1f; + if (npc.ai[1] > 300f) + npc.ai[0] = -1f; + } + } + else if (npc.ai[0] == 6f) + { + npc.noGravity = true; + npc.noTileCollide = true; + npc.TargetClosest(true); + npc.velocity *= 0.95f; + if (Main.netMode != 1) + { + npc.ai[1] += 1f; + if (npc.ai[1] > 60f) + { + int damage = expertMode ? 52 : 70; //288 220 + Projectile.NewProjectile(player.Center.X, player.Center.Y - 360f, 0f, 0f, mod.ProjectileType("ProvidenceCrystal"), damage, 0f, Main.myPlayer, 0f, 0f); + npc.ai[0] = -1f; + } + } + } + else if (npc.ai[0] == 7f) + { + npc.noGravity = true; + npc.noTileCollide = true; + Vector2 value19 = new Vector2(27f, 59f); + npc.ai[2] += 1f; + if (npc.ai[2] < 180f) + { + npc.localAI[1] -= 0.05f; + if (npc.localAI[1] < 0f) + { + npc.localAI[1] = 0f; + } + if (npc.ai[2] >= 60f) + { + Vector2 center20 = npc.Center; + int num1220 = 0; + if (npc.ai[2] >= 120f) + { + num1220 = 1; + } + int num; + for (int num1221 = 0; num1221 < 1 + num1220; num1221 = num + 1) + { + int num1222 = 244; + float num1223 = 1.2f; + if (num1221 % 2 == 1) + { + num1223 = 2.8f; + } + Vector2 vector199 = center20 + ((float)Main.rand.NextDouble() * 6.28318548f).ToRotationVector2() * value19 / 2f; + int num1224 = Dust.NewDust(vector199 - Vector2.One * 8f, 16, 16, num1222, npc.velocity.X / 2f, npc.velocity.Y / 2f, 0, default(Color), 1f); + Main.dust[num1224].velocity = Vector2.Normalize(center20 - vector199) * 3.5f * (10f - (float)num1220 * 2f) / 10f; + Main.dust[num1224].noGravity = true; + Main.dust[num1224].scale = num1223; + num = num1221; + } + } + } + else if (npc.ai[2] < 360f) + { + if (npc.ai[2] == 180f) + { + if (Main.player[Main.myPlayer].active && !Main.player[Main.myPlayer].dead && Vector2.Distance(Main.player[Main.myPlayer].Center, vector) < 2800f) + { + Main.PlaySound(29, (int)Main.player[Main.myPlayer].position.X, (int)Main.player[Main.myPlayer].position.Y, 104, 1f, 0f); + } + if (Main.netMode != 1) + { + npc.TargetClosest(false); + Vector2 vector200 = player.Center - npc.Center; + vector200.Normalize(); + float num1225 = -1f; + if (vector200.X < 0f) + { + num1225 = 1f; + } + vector200 = vector200.RotatedBy((double)(-(double)num1225 * 6.28318548f / 6f), default(Vector2)); + Projectile.NewProjectile(npc.Center.X, npc.Center.Y - 16f, vector200.X, vector200.Y, mod.ProjectileType("ProvidenceHolyRay"), 100, 0f, Main.myPlayer, num1225 * 6.28318548f / 450f, (float)npc.whoAmI); + npc.ai[3] = (vector200.ToRotation() + 9.424778f) * num1225; //3.14159265f + npc.netUpdate = true; + } + } + npc.localAI[1] += 0.05f; + if (npc.localAI[1] > 1f) + { + npc.localAI[1] = 1f; + } + float num1226 = (float)(npc.ai[3] >= 0f).ToDirectionInt(); + float num1227 = npc.ai[3]; + if (num1227 < 0f) + { + num1227 *= -1f; + } + num1227 += -9.424778f; + num1227 += num1226 * 6.28318548f / 540f; + npc.localAI[0] = num1227; + } + else + { + npc.localAI[1] -= 0.07f; //15 + if (npc.localAI[1] < 0f) + npc.localAI[1] = 0f; + } + if (Main.netMode != 1) + { + npc.ai[1] += 1f; + if (npc.ai[1] > 375f) + npc.ai[0] = -1f; + } + } + if (npc.ai[0] == -1f) + { + npc.noGravity = true; + npc.noTileCollide = true; + phaseChange++; + if (phaseChange > 14) + { + phaseChange = 0; + } + int phase = 0; //0 = blasts 1 = holy fire 2 = shell heal 3 = molten blobs 4 = holy bombs 5 = shell spears 6 = crystal 7 = laser + if (CalamityWorld.death || CalamityWorld.bossRushActive) + { + switch (phaseChange) + { + case 0: phase = 4; break; //1575 or 1500 + case 1: phase = 5; break; //1875 or 1800 + case 2: phase = 0; break; //2175 or 2100 + case 3: phase = phase2 ? 6 : 1; break; + case 4: phase = 2; break; //600 + case 5: phase = 4; break; //900 + case 6: phase = 1; break; //1200 + case 7: phase = 5; break; //1500 + case 8: + phase = phase3 ? 7 : 3; //1875 or 1800 + if (phase3) + { + npc.TargetClosest(false); + Vector2 v3 = player.Center - npc.Center - new Vector2(0f, -22f); + float num1219 = v3.Length() / 500f; + if (num1219 > 1f) + { + num1219 = 1f; + } + num1219 = 1f - num1219; + num1219 *= 2f; + if (num1219 > 1f) + { + num1219 = 1f; + } + npc.localAI[0] = v3.ToRotation(); + npc.localAI[1] = num1219; + } + break; + case 9: phase = 3; break; //2175 or 2100 + case 10: phase = phase2 ? 6 : 2; break; + case 11: phase = 4; break; //300 + case 12: + phase = phase3 ? 7 : 4; //675 or 600 + if (phase3) + { + npc.TargetClosest(false); + Vector2 v3 = player.Center - npc.Center - new Vector2(0f, -22f); + float num1219 = v3.Length() / 500f; + if (num1219 > 1f) + { + num1219 = 1f; + } + num1219 = 1f - num1219; + num1219 *= 2f; + if (num1219 > 1f) + { + num1219 = 1f; + } + npc.localAI[0] = v3.ToRotation(); + npc.localAI[1] = num1219; + } + break; + case 13: phase = 5; break; //975 or 900 + case 14: phase = 0; break; //1275 or 1200 + } + } + else + { + switch (phaseChange) + { + case 0: phase = 0; break; //3375 or 3300 + case 1: + phase = phase3 ? 7 : 1; //3750 or 3600 + if (phase3) + { + npc.TargetClosest(false); + Vector2 v3 = player.Center - npc.Center - new Vector2(0f, -22f); + float num1219 = v3.Length() / 500f; + if (num1219 > 1f) + { + num1219 = 1f; + } + num1219 = 1f - num1219; + num1219 *= 2f; + if (num1219 > 1f) + { + num1219 = 1f; + } + npc.localAI[0] = v3.ToRotation(); + npc.localAI[1] = num1219; + } + break; + case 2: phase = 3; break; //4050 or 3900 + case 3: phase = 4; break; //4350 or 4200 + case 4: phase = 5; break; //4650 or 4500 + case 5: phase = phase2 ? 6 : 4; break; + case 6: phase = 3; break; //300 + case 7: phase = 1; break; //600 + case 8: phase = 0; break; //900 + case 9: phase = 2; break; //1500 + case 10: phase = 4; break; //1800 + case 11: + phase = phase3 ? 7 : 0; //2175 or 2100 + if (phase3) + { + npc.TargetClosest(false); + Vector2 v3 = player.Center - npc.Center - new Vector2(0f, -22f); + float num1219 = v3.Length() / 500f; + if (num1219 > 1f) + { + num1219 = 1f; + } + num1219 = 1f - num1219; + num1219 *= 2f; + if (num1219 > 1f) + { + num1219 = 1f; + } + npc.localAI[0] = v3.ToRotation(); + npc.localAI[1] = num1219; + } + break; + case 12: phase = 3; break; //2475 or 2400 + case 13: phase = 1; break; //2775 or 2700 + case 14: phase = 5; break; //3075 or 3000 + } + } + npc.TargetClosest(true); + if (Math.Abs(npc.Center.X - player.Center.X) > 5600f) { phase = 0; } @@ -908,39 +883,37 @@ namespace CalamityMod.NPCs.Providence return; } } - + public override void NPCLoot() { - bool isHoly = Main.player[npc.target].ZoneHoly; - bool isHell = Main.player[npc.target].ZoneUnderworldHeight; if (Main.rand.Next(10) == 0) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ProvidenceTrophy")); } - if (CalamityWorld.armageddon) - { - for (int i = 0; i < 10; i++) - { - npc.DropBossBags(); - } - } - if (Main.expertMode) + if (CalamityWorld.armageddon) { - if (isHoly) + for (int i = 0; i < 5; i++) { - npc.DropItemInstanced(npc.position, npc.Size, mod.ItemType("ElysianWings"), 1, true); + npc.DropBossBags(); } - if (isHell) + } + if (Main.expertMode) + { + if (Main.player[npc.target].ZoneUnderworldHeight) { npc.DropItemInstanced(npc.position, npc.Size, mod.ItemType("ElysianAegis"), 1, true); } + else if (Main.player[npc.target].ZoneHoly) + { + npc.DropItemInstanced(npc.position, npc.Size, mod.ItemType("ElysianWings"), 1, true); + } npc.DropBossBags(); } else { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("UnholyEssence"), Main.rand.Next(20, 30)); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DivineGeode"), Main.rand.Next(10, 16)); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("RuneofCos")); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DivineGeode"), Main.rand.Next(10, 16)); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("RuneofCos")); if (Main.rand.Next(7) == 0) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ProvidenceMask")); @@ -998,24 +971,24 @@ namespace CalamityMod.NPCs.Providence } } } - + public override void BossLoot(ref string name, ref int potionType) { potionType = ItemID.SuperHealingPotion; } - + public override bool StrikeNPC(ref double damage, int defense, ref float knockback, int hitDirection, ref bool crit) { - double newDamage = (damage + (int)((double)defense * 0.25)); - float protection = (((npc.ichor || npc.onFire2) ? 0.2f : 0.25f) + - ((npc.ai[0] == 2f || npc.ai[0] == 5f || npc.ai[0] == 7f) ? 0.65f : 0f)); //0.85 or 0.9 - if (newDamage < 1.0) + double newDamage = (damage + (int)((double)defense * 0.25)); + float protection = (((npc.ichor || npc.onFire2) ? 0.2f : 0.25f) + + ((npc.ai[0] == 2f || npc.ai[0] == 5f || npc.ai[0] == 7f) ? 0.65f : 0f)); //0.85 or 0.9 + if (newDamage < 1.0) { newDamage = 1.0; } if (newDamage >= 1.0) { - newDamage = (double)((int)((double)(1f - protection) * newDamage)); + newDamage = (double)((int)((double)(1f - protection) * newDamage)); if (newDamage < 1.0) { newDamage = 1.0; @@ -1024,120 +997,116 @@ namespace CalamityMod.NPCs.Providence damage = newDamage; return true; } - + public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) { - Mod mod = ModLoader.GetMod("CalamityMod"); - Texture2D texture = Main.npcTexture[npc.type]; - Texture2D texture2 = mod.GetTexture("NPCs/Providence/ProvidenceAlt"); - Texture2D texture3 = mod.GetTexture("NPCs/Providence/ProvidenceAttack"); - Texture2D texture4 = mod.GetTexture("NPCs/Providence/ProvidenceAttackAlt"); - Texture2D texture5 = mod.GetTexture("NPCs/Providence/ProvidenceDefense"); - Texture2D texture6 = mod.GetTexture("NPCs/Providence/ProvidenceDefenseAlt"); - if (npc.ai[0] == 2f || npc.ai[0] == 5f) - { - if (npc.localAI[2] == 0f) - { - CalamityMod.DrawTexture(spriteBatch, texture5, 0, npc, drawColor); - } - else - { - CalamityMod.DrawTexture(spriteBatch, texture6, 0, npc, drawColor); - } - } - else - { - if (frameUsed == 0) - { - CalamityMod.DrawTexture(spriteBatch, texture, 0, npc, drawColor); - } - else if (frameUsed == 1) - { - CalamityMod.DrawTexture(spriteBatch, texture2, 0, npc, drawColor); - } - else if (frameUsed == 2) - { - CalamityMod.DrawTexture(spriteBatch, texture3, 0, npc, drawColor); - } - else - { - CalamityMod.DrawTexture(spriteBatch, texture4, 0, npc, drawColor); - } - } - return false; + Mod mod = ModLoader.GetMod("CalamityMod"); + Texture2D texture = Main.npcTexture[npc.type]; + if (npc.ai[0] == 2f || npc.ai[0] == 5f) + { + if (npc.localAI[2] == 0f) + { + texture = mod.GetTexture("NPCs/Providence/ProvidenceDefense"); + } + else + { + texture = mod.GetTexture("NPCs/Providence/ProvidenceDefenseAlt"); + } + } + else + { + if (frameUsed == 0) + { + texture = Main.npcTexture[npc.type]; + } + else if (frameUsed == 1) + { + texture = mod.GetTexture("NPCs/Providence/ProvidenceAlt"); + } + else if (frameUsed == 2) + { + texture = mod.GetTexture("NPCs/Providence/ProvidenceAttack"); + } + else + { + texture = mod.GetTexture("NPCs/Providence/ProvidenceAttackAlt"); + } + } + CalamityMod.DrawTexture(spriteBatch, texture, 0, npc, drawColor); + return false; } - + public override void FindFrame(int frameHeight) //9 total frames { - if (npc.ai[0] == 2f || npc.ai[0] == 5f) - { - if (npc.localAI[2] == 0f) - { - npc.frameCounter += 1.0; - if (npc.frameCounter > 5.0) - { - npc.frame.Y = npc.frame.Y + frameHeight; - npc.frameCounter = 0.0; - } - if (npc.frame.Y >= frameHeight * 3) - { - npc.frame.Y = 0; - npc.localAI[2] = 1f; - npc.netUpdate = true; - } - } - else - { - npc.frameCounter += 1.0; - if (npc.frameCounter > 5.0) - { - npc.frame.Y = npc.frame.Y + frameHeight; - npc.frameCounter = 0.0; - } - if (npc.frame.Y >= frameHeight * 2) - { - npc.frame.Y = frameHeight * 2; - } - } - } - else - { - if (npc.localAI[2] > 0f) - { - npc.localAI[2] = 0f; - npc.netUpdate = true; - } - npc.frameCounter += 1.0; - if (npc.frameCounter > 5.0) - { - npc.frameCounter = 0.0; - npc.frame.Y = npc.frame.Y + frameHeight; - } - if (npc.frame.Y >= frameHeight * 3) //6 - { - npc.frame.Y = 0; - frameUsed++; - } - if (frameUsed > 3) - { - frameUsed = 0; - npc.netUpdate = true; - } - } + if (npc.ai[0] == 2f || npc.ai[0] == 5f) + { + if (npc.localAI[2] == 0f) + { + npc.frameCounter += 1.0; + if (npc.frameCounter > 5.0) + { + npc.frame.Y = npc.frame.Y + frameHeight; + npc.frameCounter = 0.0; + } + if (npc.frame.Y >= frameHeight * 3) + { + npc.frame.Y = 0; + npc.localAI[2] = 1f; + npc.netUpdate = true; + } + } + else + { + npc.frameCounter += 1.0; + if (npc.frameCounter > 5.0) + { + npc.frame.Y = npc.frame.Y + frameHeight; + npc.frameCounter = 0.0; + } + if (npc.frame.Y >= frameHeight * 2) + { + npc.frame.Y = frameHeight * 2; + } + } + } + else + { + if (npc.localAI[2] > 0f) + { + npc.localAI[2] = 0f; + npc.netUpdate = true; + } + npc.frameCounter += 1.0; + if (npc.frameCounter > 5.0) + { + npc.frameCounter = 0.0; + npc.frame.Y = npc.frame.Y + frameHeight; + } + if (npc.frame.Y >= frameHeight * 3) //6 + { + npc.frame.Y = 0; + frameUsed++; + } + if (frameUsed > 3) + { + frameUsed = 0; + npc.netUpdate = true; + } + } } - + public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) { scale = 2f; return null; } - + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { npc.lifeMax = (int)(npc.lifeMax * 0.8f * bossLifeScale); - npc.damage = (int)(npc.damage * 0.8f); - } - + npc.damage = (int)(npc.damage * 0.8f); + } + public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 15; k++) diff --git a/NPCs/Scavenger/FlamePillar.cs b/NPCs/Scavenger/FlamePillar.cs index 1ae564faac..a7d9d49ead 100644 --- a/NPCs/Scavenger/FlamePillar.cs +++ b/NPCs/Scavenger/FlamePillar.cs @@ -65,7 +65,7 @@ namespace CalamityMod.NPCs.Scavenger } if (npc.alpha > 0) { - npc.alpha -= 10; + npc.alpha -= 3; if (npc.alpha < 0) { if (CalamityWorld.downedProvidence && !CalamityWorld.bossRushActive) diff --git a/NPCs/Scavenger/ScavengerBody.cs b/NPCs/Scavenger/ScavengerBody.cs index 87867fcce7..f0a87a5ebe 100644 --- a/NPCs/Scavenger/ScavengerBody.cs +++ b/NPCs/Scavenger/ScavengerBody.cs @@ -69,7 +69,7 @@ namespace CalamityMod.NPCs.Scavenger } if (CalamityWorld.bossRushActive) { - npc.lifeMax = CalamityWorld.death ? 4600000 : 4100000; + npc.lifeMax = CalamityWorld.death ? 2300000 : 2100000; } } @@ -95,7 +95,7 @@ namespace CalamityMod.NPCs.Scavenger NPC.NewNPC((int)npc.Center.X + 70, (int)npc.Center.Y + 88, mod.NPCType("ScavengerLegRight"), 0, 0f, 0f, 0f, 0f, 255); NPC.NewNPC((int)npc.Center.X - 120, (int)npc.Center.Y + 50, mod.NPCType("ScavengerClawLeft"), 0, 0f, 0f, 0f, 0f, 255); NPC.NewNPC((int)npc.Center.X + 120, (int)npc.Center.Y + 50, mod.NPCType("ScavengerClawRight"), 0, 0f, 0f, 0f, 0f, 255); - NPC.NewNPC((int)npc.Center.X + 21, (int)npc.Center.Y - 25, mod.NPCType("ScavengerHead"), 0, 0f, 0f, 0f, 0f, 255); + NPC.NewNPC((int)npc.Center.X + 1, (int)npc.Center.Y - 20, mod.NPCType("ScavengerHead"), 0, 0f, 0f, 0f, 0f, 255); } if (npc.target >= 0 && Main.player[npc.target].dead) { @@ -518,6 +518,11 @@ namespace CalamityMod.NPCs.Scavenger } if (npc.life <= 0) { + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ScavengerGores/ScavengerBody"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ScavengerGores/ScavengerBody2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ScavengerGores/ScavengerBody3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ScavengerGores/ScavengerBody4"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ScavengerGores/ScavengerBody5"), 1f); for (int k = 0; k < 50; k++) { Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 2f); @@ -531,7 +536,13 @@ namespace CalamityMod.NPCs.Scavenger name = "Ravager"; potionType = ItemID.GreaterHealingPotion; } - + + public override bool CanHitPlayer(Player target, ref int cooldownSlot) + { + cooldownSlot = 1; + return true; + } + public override void OnHitPlayer(Player player, int damage, bool crit) { if (CalamityWorld.revenge) @@ -544,7 +555,7 @@ namespace CalamityMod.NPCs.Scavenger { if (CalamityWorld.armageddon) { - for (int i = 0; i < 10; i++) + for (int i = 0; i < 5; i++) { npc.DropBossBags(); } diff --git a/NPCs/Scavenger/ScavengerClawLeft.cs b/NPCs/Scavenger/ScavengerClawLeft.cs index 399bbe76b7..6c75eb814f 100644 --- a/NPCs/Scavenger/ScavengerClawLeft.cs +++ b/NPCs/Scavenger/ScavengerClawLeft.cs @@ -44,6 +44,7 @@ namespace CalamityMod.NPCs.Scavenger npc.buffImmune[mod.BuffType("SilvaStun")] = false; } npc.noGravity = true; + npc.canGhostHeal = false; npc.alpha = 255; npc.value = Item.buyPrice(0, 0, 0, 0); npc.HitSound = SoundID.NPCHit41; @@ -56,7 +57,7 @@ namespace CalamityMod.NPCs.Scavenger } if (CalamityWorld.bossRushActive) { - npc.lifeMax = CalamityWorld.death ? 550000 : 440000; + npc.lifeMax = CalamityWorld.death ? 300000 : 260000; } } @@ -202,7 +203,7 @@ namespace CalamityMod.NPCs.Scavenger num668 += 40f; num667 -= 110f; float num669 = (float)Math.Sqrt((double)(num667 * num667 + num668 * num668)); - if (num669 > 700f || npc.collideX || npc.collideY) + if ((num669 > 700f || npc.collideX || npc.collideY) | npc.justHit) { npc.noTileCollide = true; npc.ai[0] = 0f; @@ -317,6 +318,12 @@ namespace CalamityMod.NPCs.Scavenger num285++; } } + else + { + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ScavengerGores/ScavengerClawLeft"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ScavengerGores/ScavengerClawLeft2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ScavengerGores/ScavengerClawLeft3"), 1f); + } } } } \ No newline at end of file diff --git a/NPCs/Scavenger/ScavengerClawRight.cs b/NPCs/Scavenger/ScavengerClawRight.cs index 3e46eeea1a..24456c7e15 100644 --- a/NPCs/Scavenger/ScavengerClawRight.cs +++ b/NPCs/Scavenger/ScavengerClawRight.cs @@ -44,6 +44,7 @@ namespace CalamityMod.NPCs.Scavenger npc.buffImmune[mod.BuffType("SilvaStun")] = false; } npc.noGravity = true; + npc.canGhostHeal = false; npc.alpha = 255; npc.value = Item.buyPrice(0, 0, 0, 0); npc.HitSound = SoundID.NPCHit41; @@ -56,7 +57,7 @@ namespace CalamityMod.NPCs.Scavenger } if (CalamityWorld.bossRushActive) { - npc.lifeMax = CalamityWorld.death ? 550000 : 440000; + npc.lifeMax = CalamityWorld.death ? 300000 : 260000; } } @@ -202,7 +203,7 @@ namespace CalamityMod.NPCs.Scavenger num668 += 40f; num667 += 110f; float num669 = (float)Math.Sqrt((double)(num667 * num667 + num668 * num668)); - if (num669 > 700f || npc.collideX || npc.collideY) + if ((num669 > 700f || npc.collideX || npc.collideY) | npc.justHit) { npc.noTileCollide = true; npc.ai[0] = 0f; @@ -317,6 +318,11 @@ namespace CalamityMod.NPCs.Scavenger num285++; } } - } + else + { + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ScavengerGores/ScavengerClawRight"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ScavengerGores/ScavengerClawRight2"), 1f); + } + } } } \ No newline at end of file diff --git a/NPCs/Scavenger/ScavengerHead.cs b/NPCs/Scavenger/ScavengerHead.cs index 25feb1c910..fe47c7e886 100644 --- a/NPCs/Scavenger/ScavengerHead.cs +++ b/NPCs/Scavenger/ScavengerHead.cs @@ -44,6 +44,7 @@ namespace CalamityMod.NPCs.Scavenger npc.buffImmune[mod.BuffType("SilvaStun")] = false; } npc.noGravity = true; + npc.canGhostHeal = false; npc.alpha = 255; npc.value = Item.buyPrice(0, 0, 0, 0); npc.HitSound = SoundID.NPCHit41; @@ -55,7 +56,7 @@ namespace CalamityMod.NPCs.Scavenger } if (CalamityWorld.bossRushActive) { - npc.lifeMax = CalamityWorld.death ? 960000 : 820000; + npc.lifeMax = CalamityWorld.death ? 500000 : 450000; } } @@ -79,8 +80,8 @@ namespace CalamityMod.NPCs.Scavenger Vector2 center = new Vector2(npc.Center.X, npc.Center.Y); float centerX = Main.npc[CalamityGlobalNPC.scavenger].Center.X - center.X; float centerY = Main.npc[CalamityGlobalNPC.scavenger].Center.Y - center.Y; - centerY -= 25f; - centerX += 21f; + centerY -= 20f; + centerX += 1f; float totalSpeed = (float)Math.Sqrt((double)(centerX * centerX + centerY * centerY)); if (totalSpeed < 20f) { diff --git a/NPCs/Scavenger/ScavengerHead2.cs b/NPCs/Scavenger/ScavengerHead2.cs index ea4d865c1a..c4f036fa7c 100644 --- a/NPCs/Scavenger/ScavengerHead2.cs +++ b/NPCs/Scavenger/ScavengerHead2.cs @@ -276,6 +276,9 @@ namespace CalamityMod.NPCs.Scavenger } if (npc.life <= 0) { + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ScavengerGores/ScavengerHead"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ScavengerGores/ScavengerHead2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ScavengerGores/ScavengerHead3"), 1f); for (int k = 0; k < 20; k++) { Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); diff --git a/NPCs/Scavenger/ScavengerLegLeft.cs b/NPCs/Scavenger/ScavengerLegLeft.cs index 7a1b1ea1b5..97141a9f11 100644 --- a/NPCs/Scavenger/ScavengerLegLeft.cs +++ b/NPCs/Scavenger/ScavengerLegLeft.cs @@ -43,6 +43,7 @@ namespace CalamityMod.NPCs.Scavenger npc.buffImmune[mod.BuffType("WhisperingDeath")] = false; } npc.noGravity = true; + npc.canGhostHeal = false; npc.alpha = 255; npc.value = Item.buyPrice(0, 0, 0, 0); npc.HitSound = SoundID.NPCHit41; @@ -54,7 +55,7 @@ namespace CalamityMod.NPCs.Scavenger } if (CalamityWorld.bossRushActive) { - npc.lifeMax = CalamityWorld.death ? 870000 : 650000; + npc.lifeMax = CalamityWorld.death ? 450000 : 400000; } } @@ -142,6 +143,8 @@ namespace CalamityMod.NPCs.Scavenger } if (npc.life <= 0) { + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ScavengerGores/ScavengerLegLeft"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ScavengerGores/ScavengerLegLeft2"), 1f); for (int k = 0; k < 20; k++) { Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); diff --git a/NPCs/Scavenger/ScavengerLegRight.cs b/NPCs/Scavenger/ScavengerLegRight.cs index d79f3537bc..ab982ac25c 100644 --- a/NPCs/Scavenger/ScavengerLegRight.cs +++ b/NPCs/Scavenger/ScavengerLegRight.cs @@ -43,6 +43,7 @@ namespace CalamityMod.NPCs.Scavenger npc.buffImmune[mod.BuffType("WhisperingDeath")] = false; } npc.noGravity = true; + npc.canGhostHeal = false; npc.alpha = 255; npc.value = Item.buyPrice(0, 0, 0, 0); npc.HitSound = SoundID.NPCHit41; @@ -54,7 +55,7 @@ namespace CalamityMod.NPCs.Scavenger } if (CalamityWorld.bossRushActive) { - npc.lifeMax = CalamityWorld.death ? 870000 : 650000; + npc.lifeMax = CalamityWorld.death ? 450000 : 400000; } } @@ -142,6 +143,8 @@ namespace CalamityMod.NPCs.Scavenger } if (npc.life <= 0) { + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ScavengerGores/ScavengerLegRight"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ScavengerGores/ScavengerLegRight2"), 1f); for (int k = 0; k < 20; k++) { Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); diff --git a/NPCs/SlimeGod/SlimeGod.cs b/NPCs/SlimeGod/SlimeGod.cs index f65896b42b..407f7e3a74 100644 --- a/NPCs/SlimeGod/SlimeGod.cs +++ b/NPCs/SlimeGod/SlimeGod.cs @@ -35,10 +35,12 @@ namespace CalamityMod.NPCs.SlimeGod } if (CalamityWorld.bossRushActive) { - npc.lifeMax = CalamityWorld.death ? 5000000 : 4400000; + npc.lifeMax = CalamityWorld.death ? 2500000 : 2200000; } npc.aiStyle = -1; aiType = -1; + npc.buffImmune[mod.BuffType("GlacialState")] = true; + npc.buffImmune[mod.BuffType("TemporalSadness")] = true; npc.knockBackResist = 0f; animationType = 50; npc.value = 0f; diff --git a/NPCs/SlimeGod/SlimeGodCore.cs b/NPCs/SlimeGod/SlimeGodCore.cs index 654576305d..8a0c1909cc 100644 --- a/NPCs/SlimeGod/SlimeGodCore.cs +++ b/NPCs/SlimeGod/SlimeGodCore.cs @@ -32,10 +32,14 @@ namespace CalamityMod.NPCs.SlimeGod } if (CalamityWorld.bossRushActive) { - npc.lifeMax = CalamityWorld.death ? 3400000 : 3000000; + npc.lifeMax = CalamityWorld.death ? 2700000 : 2500000; } - npc.aiStyle = -1; //new + NPCID.Sets.TrailCacheLength[npc.type] = 8; + NPCID.Sets.TrailingMode[npc.type] = 1; + npc.aiStyle = -1; //new aiType = -1; //new + npc.buffImmune[mod.BuffType("GlacialState")] = true; + npc.buffImmune[mod.BuffType("TemporalSadness")] = true; npc.knockBackResist = 0f; npc.value = Item.buyPrice(0, 8, 0, 0); npc.alpha = 80; @@ -211,7 +215,7 @@ namespace CalamityMod.NPCs.SlimeGod } if (CalamityWorld.bossRushActive) { - num1372 = 21f; + num1372 = 22f; } if (npc.GetGlobalNPC(mod).enraged) { @@ -253,9 +257,52 @@ namespace CalamityMod.NPCs.SlimeGod npc.velocity.X = (npc.velocity.X * 7f + num1373) / 8f; npc.velocity.Y = (npc.velocity.Y * 7f + num1374) / 8f; } - return; } - + + public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) + { + SpriteEffects spriteEffects = SpriteEffects.None; + if (npc.spriteDirection == 1) + { + spriteEffects = SpriteEffects.FlipHorizontally; + } + Microsoft.Xna.Framework.Color color24 = npc.GetAlpha(drawColor); + Microsoft.Xna.Framework.Color color25 = Lighting.GetColor((int)((double)npc.position.X + (double)npc.width * 0.5) / 16, (int)(((double)npc.position.Y + (double)npc.height * 0.5) / 16.0)); + Texture2D texture2D3 = Main.npcTexture[npc.type]; + int num156 = Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type]; + int y3 = num156 * (int)npc.frameCounter; + Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle(0, y3, texture2D3.Width, num156); + Vector2 origin2 = rectangle.Size() / 2f; + int num157 = 8; + int num158 = 2; + int num159 = 1; + float num160 = 0f; + int num161 = num159; + spriteBatch.Draw(texture2D3, npc.Center - Main.screenPosition + new Vector2(0, npc.gfxOffY), npc.frame, color24, npc.rotation, npc.frame.Size() / 2, npc.scale, spriteEffects, 0); + while (((num158 > 0 && num161 < num157) || (num158 < 0 && num161 > num157)) && Lighting.NotRetro) + { + Microsoft.Xna.Framework.Color color26 = npc.GetAlpha(color25); + { + goto IL_6899; + } + IL_6881: + num161 += num158; + continue; + IL_6899: + float num164 = (float)(num157 - num161); + if (num158 < 0) + { + num164 = (float)(num159 - num161); + } + color26 *= num164 / ((float)NPCID.Sets.TrailCacheLength[npc.type] * 1.5f); + Vector2 value4 = (npc.oldPos[num161]); + float num165 = npc.rotation; + Main.spriteBatch.Draw(texture2D3, value4 + npc.Size / 2f - Main.screenPosition + new Vector2(0, npc.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rectangle), color26, num165 + npc.rotation * num160 * (float)(num161 - 1) * -(float)spriteEffects.HasFlag(SpriteEffects.FlipHorizontally).ToDirectionInt(), origin2, npc.scale, spriteEffects, 0f); + goto IL_6881; + } + return false; + } + public override void BossLoot(ref string name, ref int potionType) { potionType = ItemID.HealingPotion; diff --git a/NPCs/SlimeGod/SlimeGodRun.cs b/NPCs/SlimeGod/SlimeGodRun.cs index 515aa0761f..e3003b8418 100644 --- a/NPCs/SlimeGod/SlimeGodRun.cs +++ b/NPCs/SlimeGod/SlimeGodRun.cs @@ -38,10 +38,12 @@ namespace CalamityMod.NPCs.SlimeGod } if (CalamityWorld.bossRushActive) { - npc.lifeMax = CalamityWorld.death ? 4000000 : 3400000; + npc.lifeMax = CalamityWorld.death ? 2000000 : 1600000; } npc.knockBackResist = 0f; animationType = 50; + npc.buffImmune[mod.BuffType("GlacialState")] = true; + npc.buffImmune[mod.BuffType("TemporalSadness")] = true; npc.value = 0f; npc.alpha = 60; npc.lavaImmune = false; diff --git a/NPCs/SlimeGod/SlimeGodRunSplit.cs b/NPCs/SlimeGod/SlimeGodRunSplit.cs index cfa5dca97d..52adf618b7 100644 --- a/NPCs/SlimeGod/SlimeGodRunSplit.cs +++ b/NPCs/SlimeGod/SlimeGodRunSplit.cs @@ -33,7 +33,7 @@ namespace CalamityMod.NPCs.SlimeGod } if (CalamityWorld.bossRushActive) { - npc.lifeMax = CalamityWorld.death ? 2000000 : 1700000; + npc.lifeMax = CalamityWorld.death ? 1000000 : 800000; } npc.damage = 40; npc.width = 150; @@ -41,6 +41,8 @@ namespace CalamityMod.NPCs.SlimeGod npc.scale = 0.8f; npc.defense = 20; npc.knockBackResist = 0f; + npc.buffImmune[mod.BuffType("GlacialState")] = true; + npc.buffImmune[mod.BuffType("TemporalSadness")] = true; animationType = 50; npc.value = Item.buyPrice(0, 1, 0, 0); npc.alpha = 60; diff --git a/NPCs/SlimeGod/SlimeGodSplit.cs b/NPCs/SlimeGod/SlimeGodSplit.cs index faada7b1d6..2d8a0d9619 100644 --- a/NPCs/SlimeGod/SlimeGodSplit.cs +++ b/NPCs/SlimeGod/SlimeGodSplit.cs @@ -30,7 +30,7 @@ namespace CalamityMod.NPCs.SlimeGod } if (CalamityWorld.bossRushActive) { - npc.lifeMax = CalamityWorld.death ? 2500000 : 2200000; + npc.lifeMax = CalamityWorld.death ? 1250000 : 1100000; } npc.damage = 40; npc.width = 150; @@ -40,6 +40,8 @@ namespace CalamityMod.NPCs.SlimeGod npc.aiStyle = -1; aiType = -1; npc.knockBackResist = 0f; + npc.buffImmune[mod.BuffType("GlacialState")] = true; + npc.buffImmune[mod.BuffType("TemporalSadness")] = true; animationType = 50; npc.value = Item.buyPrice(0, 1, 0, 0); npc.alpha = 60; diff --git a/NPCs/SlimeGod/SlimeSpawnCorrupt.cs b/NPCs/SlimeGod/SlimeSpawnCorrupt.cs index d86fbee662..30e6fb0e1c 100644 --- a/NPCs/SlimeGod/SlimeSpawnCorrupt.cs +++ b/NPCs/SlimeGod/SlimeSpawnCorrupt.cs @@ -36,6 +36,7 @@ namespace CalamityMod.NPCs.SlimeGod npc.lavaImmune = false; npc.noGravity = false; npc.noTileCollide = false; + npc.canGhostHeal = false; npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; npc.buffImmune[24] = true; diff --git a/NPCs/SlimeGod/SlimeSpawnCorrupt2.cs b/NPCs/SlimeGod/SlimeSpawnCorrupt2.cs index d93e46b58e..b32c0f2239 100644 --- a/NPCs/SlimeGod/SlimeSpawnCorrupt2.cs +++ b/NPCs/SlimeGod/SlimeSpawnCorrupt2.cs @@ -36,6 +36,7 @@ namespace CalamityMod.NPCs.SlimeGod npc.lavaImmune = false; npc.noGravity = false; npc.noTileCollide = false; + npc.canGhostHeal = false; npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; npc.buffImmune[24] = true; diff --git a/NPCs/SlimeGod/SlimeSpawnCrimson.cs b/NPCs/SlimeGod/SlimeSpawnCrimson.cs index 27d5e46028..9d3340d693 100644 --- a/NPCs/SlimeGod/SlimeSpawnCrimson.cs +++ b/NPCs/SlimeGod/SlimeSpawnCrimson.cs @@ -36,6 +36,7 @@ namespace CalamityMod.NPCs.SlimeGod npc.lavaImmune = false; npc.noGravity = false; npc.noTileCollide = false; + npc.canGhostHeal = false; npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; npc.buffImmune[24] = true; diff --git a/NPCs/SlimeGod/SlimeSpawnCrimson2.cs b/NPCs/SlimeGod/SlimeSpawnCrimson2.cs index afa1872e1e..b2a67b6cec 100644 --- a/NPCs/SlimeGod/SlimeSpawnCrimson2.cs +++ b/NPCs/SlimeGod/SlimeSpawnCrimson2.cs @@ -38,6 +38,7 @@ namespace CalamityMod.NPCs.SlimeGod npc.lavaImmune = false; npc.noGravity = false; npc.noTileCollide = false; + npc.canGhostHeal = false; npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; npc.buffImmune[24] = true; diff --git a/NPCs/StormWeaver/StasisProbe.cs b/NPCs/StormWeaver/StasisProbe.cs index c3e9548ae1..8db02405f0 100644 --- a/NPCs/StormWeaver/StasisProbe.cs +++ b/NPCs/StormWeaver/StasisProbe.cs @@ -34,6 +34,7 @@ namespace CalamityMod.NPCs.StormWeaver npc.knockBackResist = 0.9f; npc.noGravity = true; npc.noTileCollide = true; + npc.canGhostHeal = false; npc.HitSound = SoundID.NPCHit4; npc.DeathSound = SoundID.NPCDeath14; npc.buffImmune[24] = true; diff --git a/NPCs/StormWeaver/StasisProbeNaked.cs b/NPCs/StormWeaver/StasisProbeNaked.cs index e20962214b..fa2e1731d0 100644 --- a/NPCs/StormWeaver/StasisProbeNaked.cs +++ b/NPCs/StormWeaver/StasisProbeNaked.cs @@ -34,6 +34,7 @@ namespace CalamityMod.NPCs.StormWeaver npc.knockBackResist = 0.925f; npc.noGravity = true; npc.noTileCollide = true; + npc.canGhostHeal = false; npc.HitSound = SoundID.NPCHit13; npc.DeathSound = SoundID.NPCDeath19; npc.buffImmune[24] = true; diff --git a/NPCs/StormWeaver/StormWeaverBody.cs b/NPCs/StormWeaver/StormWeaverBody.cs index 748f7e6395..9a54bbed8c 100644 --- a/NPCs/StormWeaver/StormWeaverBody.cs +++ b/NPCs/StormWeaver/StormWeaverBody.cs @@ -53,6 +53,7 @@ namespace CalamityMod.NPCs.StormWeaver npc.behindTiles = true; npc.noGravity = true; npc.noTileCollide = true; + npc.canGhostHeal = false; npc.HitSound = SoundID.NPCHit4; npc.DeathSound = SoundID.NPCDeath14; npc.netAlways = true; diff --git a/NPCs/StormWeaver/StormWeaverBodyNaked.cs b/NPCs/StormWeaver/StormWeaverBodyNaked.cs index e63319124a..889ca8b6b8 100644 --- a/NPCs/StormWeaver/StormWeaverBodyNaked.cs +++ b/NPCs/StormWeaver/StormWeaverBodyNaked.cs @@ -27,16 +27,12 @@ namespace CalamityMod.NPCs.StormWeaver npc.width = 40; //324 npc.height = 40; //216 npc.defense = 0; - npc.lifeMax = 100000; + npc.lifeMax = 50000; Mod calamityModMusic = ModLoader.GetMod("CalamityModMusic"); if (calamityModMusic != null) music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/ScourgeofTheUniverse"); else music = MusicID.Boss3; - if (CalamityWorld.death) - { - npc.lifeMax = 75000; - } if (CalamityWorld.DoGSecondStageCountdown <= 0) { if (calamityModMusic != null) @@ -47,7 +43,7 @@ namespace CalamityMod.NPCs.StormWeaver } if (CalamityWorld.bossRushActive) { - npc.lifeMax = 4500000; + npc.lifeMax = 2300000; } npc.aiStyle = 6; //new aiType = -1; //new @@ -58,9 +54,12 @@ namespace CalamityMod.NPCs.StormWeaver npc.noGravity = true; npc.boss = true; npc.noTileCollide = true; + npc.canGhostHeal = false; npc.HitSound = SoundID.NPCHit13; npc.DeathSound = SoundID.NPCDeath13; npc.netAlways = true; + NPCID.Sets.TrailCacheLength[npc.type] = 8; + NPCID.Sets.TrailingMode[npc.type] = 1; for (int k = 0; k < npc.buffImmune.Length; k++) { npc.buffImmune[k] = true; @@ -113,7 +112,48 @@ namespace CalamityMod.NPCs.StormWeaver } } } - + + public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) + { + SpriteEffects spriteEffects = SpriteEffects.None; + Microsoft.Xna.Framework.Color color24 = npc.GetAlpha(drawColor); + Microsoft.Xna.Framework.Color color25 = Lighting.GetColor((int)((double)npc.position.X + (double)npc.width * 0.5) / 16, (int)(((double)npc.position.Y + (double)npc.height * 0.5) / 16.0)); + Texture2D texture2D3 = Main.npcTexture[npc.type]; + int num156 = Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type]; + int y3 = num156 * (int)npc.frameCounter; + Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle(0, y3, texture2D3.Width, num156); + Vector2 origin2 = rectangle.Size() / 2f; + int num157 = 8; + int num158 = 2; + int num159 = 1; + float num160 = 0f; + int num161 = num159; + while (((num158 > 0 && num161 < num157) || (num158 < 0 && num161 > num157)) && Lighting.NotRetro) + { + Microsoft.Xna.Framework.Color color26 = npc.GetAlpha(color25); + { + goto IL_6899; + } + IL_6881: + num161 += num158; + continue; + IL_6899: + float num164 = (float)(num157 - num161); + if (num158 < 0) + { + num164 = (float)(num159 - num161); + } + color26 *= num164 / ((float)NPCID.Sets.TrailCacheLength[npc.type] * 1.5f); + Vector2 value4 = (npc.oldPos[num161]); + float num165 = npc.rotation; + Main.spriteBatch.Draw(texture2D3, value4 + npc.Size / 2f - Main.screenPosition + new Vector2(0, npc.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rectangle), color26, num165 + npc.rotation * num160 * (float)(num161 - 1) * -(float)spriteEffects.HasFlag(SpriteEffects.FlipHorizontally).ToDirectionInt(), origin2, npc.scale, spriteEffects, 0f); + goto IL_6881; + } + var something = npc.direction == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; + spriteBatch.Draw(texture2D3, npc.Center - Main.screenPosition + new Vector2(0, npc.gfxOffY), npc.frame, color24, npc.rotation, npc.frame.Size() / 2, npc.scale, something, 0); + return false; + } + public override bool CanHitPlayer(Player target, ref int cooldownSlot) { cooldownSlot = 1; diff --git a/NPCs/StormWeaver/StormWeaverHeadNaked.cs b/NPCs/StormWeaver/StormWeaverHeadNaked.cs index 318cb41c5f..d0366a84d1 100644 --- a/NPCs/StormWeaver/StormWeaverHeadNaked.cs +++ b/NPCs/StormWeaver/StormWeaverHeadNaked.cs @@ -37,19 +37,16 @@ namespace CalamityMod.NPCs.StormWeaver npc.width = 74; //324 npc.height = 74; //216 npc.defense = 0; - npc.lifeMax = 100000; + npc.lifeMax = 50000; Mod calamityModMusic = ModLoader.GetMod("CalamityModMusic"); if (calamityModMusic != null) music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/ScourgeofTheUniverse"); else music = MusicID.Boss3; - if (CalamityWorld.death) - { - npc.lifeMax = 75000; - } if (CalamityWorld.DoGSecondStageCountdown <= 0) { - if (calamityModMusic != null) + npc.value = Item.buyPrice(0, 35, 0, 0); + if (calamityModMusic != null) music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/Weaver"); else music = MusicID.Boss3; @@ -57,14 +54,13 @@ namespace CalamityMod.NPCs.StormWeaver } if (CalamityWorld.bossRushActive) { - npc.lifeMax = 4500000; + npc.lifeMax = 2300000; } npc.aiStyle = 6; //new aiType = -1; //new animationType = 10; //new npc.knockBackResist = 0f; npc.boss = true; - npc.value = Item.buyPrice(0, 35, 0, 0); npc.alpha = 255; npc.behindTiles = true; npc.noGravity = true; @@ -72,6 +68,8 @@ namespace CalamityMod.NPCs.StormWeaver npc.HitSound = SoundID.NPCHit13; npc.DeathSound = SoundID.NPCDeath13; npc.netAlways = true; + NPCID.Sets.TrailCacheLength[npc.type] = 8; + NPCID.Sets.TrailingMode[npc.type] = 1; for (int k = 0; k < npc.buffImmune.Length; k++) { npc.buffImmune[k] = true; @@ -459,7 +457,48 @@ namespace CalamityMod.NPCs.StormWeaver npc.rotation = (float)System.Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X) + 1.57f; } - public override bool CanHitPlayer(Player target, ref int cooldownSlot) + public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) + { + SpriteEffects spriteEffects = SpriteEffects.None; + Microsoft.Xna.Framework.Color color24 = npc.GetAlpha(drawColor); + Microsoft.Xna.Framework.Color color25 = Lighting.GetColor((int)((double)npc.position.X + (double)npc.width * 0.5) / 16, (int)(((double)npc.position.Y + (double)npc.height * 0.5) / 16.0)); + Texture2D texture2D3 = Main.npcTexture[npc.type]; + int num156 = Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type]; + int y3 = num156 * (int)npc.frameCounter; + Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle(0, y3, texture2D3.Width, num156); + Vector2 origin2 = rectangle.Size() / 2f; + int num157 = 8; + int num158 = 2; + int num159 = 1; + float num160 = 0f; + int num161 = num159; + while (((num158 > 0 && num161 < num157) || (num158 < 0 && num161 > num157)) && Lighting.NotRetro) + { + Microsoft.Xna.Framework.Color color26 = npc.GetAlpha(color25); + { + goto IL_6899; + } + IL_6881: + num161 += num158; + continue; + IL_6899: + float num164 = (float)(num157 - num161); + if (num158 < 0) + { + num164 = (float)(num159 - num161); + } + color26 *= num164 / ((float)NPCID.Sets.TrailCacheLength[npc.type] * 1.5f); + Vector2 value4 = (npc.oldPos[num161]); + float num165 = npc.rotation; + Main.spriteBatch.Draw(texture2D3, value4 + npc.Size / 2f - Main.screenPosition + new Vector2(0, npc.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rectangle), color26, num165 + npc.rotation * num160 * (float)(num161 - 1) * -(float)spriteEffects.HasFlag(SpriteEffects.FlipHorizontally).ToDirectionInt(), origin2, npc.scale, spriteEffects, 0f); + goto IL_6881; + } + var something = npc.direction == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; + spriteBatch.Draw(texture2D3, npc.Center - Main.screenPosition + new Vector2(0, npc.gfxOffY), npc.frame, color24, npc.rotation, npc.frame.Size() / 2, npc.scale, something, 0); + return false; + } + + public override bool CanHitPlayer(Player target, ref int cooldownSlot) { cooldownSlot = 1; return true; @@ -521,18 +560,21 @@ namespace CalamityMod.NPCs.StormWeaver public override void NPCLoot() { - npc.DropItemInstanced(npc.position, npc.Size, mod.ItemType("ArmoredShell"), Main.rand.Next(5, 9), true); - if (Main.rand.Next(10) == 0) + if (CalamityWorld.DoGSecondStageCountdown <= 0) { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("WeaverTrophy")); - } - if (Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TheStorm")); - } - if (Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("StormDragoon")); + npc.DropItemInstanced(npc.position, npc.Size, mod.ItemType("ArmoredShell"), Main.rand.Next(5, 9), true); + if (Main.rand.Next(10) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("WeaverTrophy")); + } + if (Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TheStorm")); + } + if (Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("StormDragoon")); + } } } diff --git a/NPCs/StormWeaver/StormWeaverTail.cs b/NPCs/StormWeaver/StormWeaverTail.cs index e198819908..341d8660aa 100644 --- a/NPCs/StormWeaver/StormWeaverTail.cs +++ b/NPCs/StormWeaver/StormWeaverTail.cs @@ -51,6 +51,7 @@ namespace CalamityMod.NPCs.StormWeaver npc.behindTiles = true; npc.noGravity = true; npc.noTileCollide = true; + npc.canGhostHeal = false; npc.HitSound = SoundID.NPCHit4; npc.DeathSound = SoundID.NPCDeath14; npc.netAlways = true; diff --git a/NPCs/StormWeaver/StormWeaverTailNaked.cs b/NPCs/StormWeaver/StormWeaverTailNaked.cs index 5c852399b9..e53b0df4d8 100644 --- a/NPCs/StormWeaver/StormWeaverTailNaked.cs +++ b/NPCs/StormWeaver/StormWeaverTailNaked.cs @@ -26,16 +26,12 @@ namespace CalamityMod.NPCs.StormWeaver npc.width = 48; //324 npc.height = 80; //216 npc.defense = 0; - npc.lifeMax = 100000; + npc.lifeMax = 50000; Mod calamityModMusic = ModLoader.GetMod("CalamityModMusic"); if (calamityModMusic != null) music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/ScourgeofTheUniverse"); else music = MusicID.Boss3; - if (CalamityWorld.death) - { - npc.lifeMax = 75000; - } if (CalamityWorld.DoGSecondStageCountdown <= 0) { if (calamityModMusic != null) @@ -46,7 +42,7 @@ namespace CalamityMod.NPCs.StormWeaver } if (CalamityWorld.bossRushActive) { - npc.lifeMax = 4500000; + npc.lifeMax = 2300000; } npc.aiStyle = 6; //new aiType = -1; //new @@ -57,9 +53,12 @@ namespace CalamityMod.NPCs.StormWeaver npc.noGravity = true; npc.boss = true; npc.noTileCollide = true; + npc.canGhostHeal = false; npc.HitSound = SoundID.NPCHit13; npc.DeathSound = SoundID.NPCDeath13; npc.netAlways = true; + NPCID.Sets.TrailCacheLength[npc.type] = 8; + NPCID.Sets.TrailingMode[npc.type] = 1; for (int k = 0; k < npc.buffImmune.Length; k++) { npc.buffImmune[k] = true; @@ -112,7 +111,48 @@ namespace CalamityMod.NPCs.StormWeaver } } - public override bool CanHitPlayer(Player target, ref int cooldownSlot) + public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) + { + SpriteEffects spriteEffects = SpriteEffects.None; + Microsoft.Xna.Framework.Color color24 = npc.GetAlpha(drawColor); + Microsoft.Xna.Framework.Color color25 = Lighting.GetColor((int)((double)npc.position.X + (double)npc.width * 0.5) / 16, (int)(((double)npc.position.Y + (double)npc.height * 0.5) / 16.0)); + Texture2D texture2D3 = Main.npcTexture[npc.type]; + int num156 = Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type]; + int y3 = num156 * (int)npc.frameCounter; + Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle(0, y3, texture2D3.Width, num156); + Vector2 origin2 = rectangle.Size() / 2f; + int num157 = 8; + int num158 = 2; + int num159 = 1; + float num160 = 0f; + int num161 = num159; + while (((num158 > 0 && num161 < num157) || (num158 < 0 && num161 > num157)) && Lighting.NotRetro) + { + Microsoft.Xna.Framework.Color color26 = npc.GetAlpha(color25); + { + goto IL_6899; + } + IL_6881: + num161 += num158; + continue; + IL_6899: + float num164 = (float)(num157 - num161); + if (num158 < 0) + { + num164 = (float)(num159 - num161); + } + color26 *= num164 / ((float)NPCID.Sets.TrailCacheLength[npc.type] * 1.5f); + Vector2 value4 = (npc.oldPos[num161]); + float num165 = npc.rotation; + Main.spriteBatch.Draw(texture2D3, value4 + npc.Size / 2f - Main.screenPosition + new Vector2(0, npc.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rectangle), color26, num165 + npc.rotation * num160 * (float)(num161 - 1) * -(float)spriteEffects.HasFlag(SpriteEffects.FlipHorizontally).ToDirectionInt(), origin2, npc.scale, spriteEffects, 0f); + goto IL_6881; + } + var something = npc.direction == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; + spriteBatch.Draw(texture2D3, npc.Center - Main.screenPosition + new Vector2(0, npc.gfxOffY), npc.frame, color24, npc.rotation, npc.frame.Size() / 2, npc.scale, something, 0); + return false; + } + + public override bool CanHitPlayer(Player target, ref int cooldownSlot) { cooldownSlot = 1; return true; diff --git a/NPCs/SunkenSeaNPCs/BlindedAngler.cs b/NPCs/SunkenSeaNPCs/BlindedAngler.cs new file mode 100644 index 0000000000..b9a7313dac --- /dev/null +++ b/NPCs/SunkenSeaNPCs/BlindedAngler.cs @@ -0,0 +1,272 @@ +using System; +using System.Collections.Generic; +using System.IO; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.NPCs.SunkenSeaNPCs +{ + public class BlindedAngler : ModNPC + { + public bool hasBeenHit = false; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Blinded Angler"); + Main.npcFrameCount[npc.type] = 6; + } + + public override void SetDefaults() + { + npc.noGravity = true; + npc.damage = 150; + npc.width = 56; + npc.height = 44; + npc.defense = 30; + npc.lifeMax = 750; + npc.aiStyle = -1; + aiType = -1; + npc.value = Item.buyPrice(0, 0, 40, 0); + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath1; + npc.knockBackResist = 0.1f; + banner = npc.type; + bannerItem = mod.ItemType("BlindedAnglerBanner"); + } + + public override void AI() + { + Lighting.AddLight(npc.Center, ((255 - npc.alpha) * 0f) / 255f, ((255 - npc.alpha) * 0.75f) / 255f, ((255 - npc.alpha) * 0.75f) / 255f); + npc.spriteDirection = ((npc.direction > 0) ? 1 : -1); + npc.noGravity = true; + if (npc.direction == 0) + { + npc.TargetClosest(true); + } + if (npc.justHit) + { + hasBeenHit = true; + } + npc.chaseable = hasBeenHit; + if (npc.wet) + { + bool flag14; + npc.TargetClosest(false); + if (Main.player[npc.target].wet && !Main.player[npc.target].dead && + (Main.player[npc.target].Center - npc.Center).Length() < 100f) + { + flag14 = true; + } + else + { + flag14 = false; + } + if ((!Main.player[npc.target].wet || Main.player[npc.target].dead) && flag14) + { + flag14 = false; + } + if (!flag14) + { + if (npc.collideX) + { + npc.velocity.X = npc.velocity.X * -1f; + npc.direction *= -1; + npc.netUpdate = true; + } + if (npc.collideY) + { + npc.netUpdate = true; + if (npc.velocity.Y > 0f) + { + npc.velocity.Y = Math.Abs(npc.velocity.Y) * -1f; + npc.directionY = -1; + npc.ai[0] = -1f; + } + else if (npc.velocity.Y < 0f) + { + npc.velocity.Y = Math.Abs(npc.velocity.Y); + npc.directionY = 1; + npc.ai[0] = 1f; + } + } + } + if (flag14) + { + npc.TargetClosest(true); + npc.velocity.X = npc.velocity.X + (float)npc.direction * 0.1f; + npc.velocity.Y = npc.velocity.Y + (float)npc.directionY * 0.1f; + if (npc.velocity.X > 3f) + { + npc.velocity.X = 3f; + } + if (npc.velocity.X < -3f) + { + npc.velocity.X = -3f; + } + if (npc.velocity.Y > 3f) + { + npc.velocity.Y = 3f; + } + if (npc.velocity.Y < -3f) + { + npc.velocity.Y = -3f; + } + } + else + { + npc.velocity.X = npc.velocity.X + (float)npc.direction * 0.1f; + if (npc.velocity.X < -1.5f || npc.velocity.X > 1.5f) + { + npc.velocity.X = npc.velocity.X * 0.95f; + } + if (npc.ai[0] == -1f) + { + npc.velocity.Y = npc.velocity.Y - 0.01f; + if ((double)npc.velocity.Y < -0.2) + { + npc.ai[0] = 1f; + } + } + else + { + npc.velocity.Y = npc.velocity.Y + 0.01f; + if ((double)npc.velocity.Y > 0.2) + { + npc.ai[0] = -1f; + } + } + } + int num258 = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int num259 = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + if (Main.tile[num258, num259 - 1] == null) + { + Main.tile[num258, num259 - 1] = new Tile(); + } + if (Main.tile[num258, num259 + 1] == null) + { + Main.tile[num258, num259 + 1] = new Tile(); + } + if (Main.tile[num258, num259 + 2] == null) + { + Main.tile[num258, num259 + 2] = new Tile(); + } + if (Main.tile[num258, num259 - 1].liquid > 128) + { + if (Main.tile[num258, num259 + 1].active()) + { + npc.ai[0] = -1f; + } + else if (Main.tile[num258, num259 + 2].active()) + { + npc.ai[0] = -1f; + } + } + if ((double)npc.velocity.Y > 0.4 || (double)npc.velocity.Y < -0.4) + { + npc.velocity.Y = npc.velocity.Y * 0.95f; + } + } + else + { + if (npc.velocity.Y == 0f) + { + npc.velocity.X = npc.velocity.X * 0.94f; + if ((double)npc.velocity.X > -0.2 && (double)npc.velocity.X < 0.2) + { + npc.velocity.X = 0f; + } + } + npc.velocity.Y = npc.velocity.Y + 0.3f; + if (npc.velocity.Y > 10f) + { + npc.velocity.Y = 10f; + } + npc.ai[0] = 1f; + } + npc.rotation = npc.velocity.Y * (float)npc.direction * 0.1f; + if ((double)npc.rotation < -0.2) + { + npc.rotation = -0.2f; + } + if ((double)npc.rotation > 0.2) + { + npc.rotation = 0.2f; + return; + } + } + + public override void FindFrame(int frameHeight) + { + npc.frameCounter += (npc.wet ? 0.15f : 0f); + npc.frameCounter %= Main.npcFrameCount[npc.type]; + int frame = (int)npc.frameCounter; + npc.frame.Y = frame * frameHeight; + } + + public override void PostDraw(SpriteBatch spriteBatch, Color drawColor) + { + SpriteEffects spriteEffects = SpriteEffects.None; + if (npc.spriteDirection == 1) + { + spriteEffects = SpriteEffects.FlipHorizontally; + } + Vector2 center = new Vector2(npc.Center.X, npc.Center.Y); + Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2)); + Vector2 vector = center - Main.screenPosition; + vector -= new Vector2((float)mod.GetTexture("NPCs/SunkenSeaNPCs/BlindedAnglerGlow").Width, (float)(mod.GetTexture("NPCs/SunkenSeaNPCs/BlindedAnglerGlow").Height / Main.npcFrameCount[npc.type])) * 1f / 2f; + vector += vector11 * 1f + new Vector2(0f, 0f + 4f + npc.gfxOffY); + Microsoft.Xna.Framework.Color color = new Microsoft.Xna.Framework.Color(127 - npc.alpha, 127 - npc.alpha, 127 - npc.alpha, 0).MultiplyRGBA(Microsoft.Xna.Framework.Color.LightBlue); + Main.spriteBatch.Draw(mod.GetTexture("NPCs/SunkenSeaNPCs/BlindedAnglerGlow"), vector, + new Microsoft.Xna.Framework.Rectangle?(npc.frame), color, npc.rotation, vector11, 1f, spriteEffects, 0f); + } + + public override bool? CanBeHitByProjectile(Projectile projectile) + { + if (projectile.minion) + { + return hasBeenHit; + } + return null; + } + + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + if (Main.hardMode && spawnInfo.player.GetModPlayer(mod).ZoneSunkenSea && spawnInfo.water && !spawnInfo.player.GetModPlayer(mod).clamity) + { + return SpawnCondition.CaveJellyfish.Chance * 0.45f; + } + return 0f; + } + + public override void NPCLoot() + { + if (Main.rand.Next(4) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EutrophicScimitar")); + } + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("PrismShard"), Main.rand.Next(5, 10)); + } + + public override void HitEffect(int hitDirection, double damage) + { + for (int k = 0; k < 5; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 68, hitDirection, -1f, 0, default(Color), 1f); + } + if (npc.life <= 0) + { + for (int k = 0; k < 25; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 68, hitDirection, -1f, 0, default(Color), 1f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BlindedAngler/BlindAnglerGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BlindedAngler/BlindAnglerGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BlindedAngler/BlindAnglerGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BlindedAngler/BlindAnglerGore4"), 1f); + } + } + } +} \ No newline at end of file diff --git a/NPCs/SunkenSeaNPCs/BlindedAngler.png b/NPCs/SunkenSeaNPCs/BlindedAngler.png new file mode 100644 index 0000000000..afdae09734 Binary files /dev/null and b/NPCs/SunkenSeaNPCs/BlindedAngler.png differ diff --git a/NPCs/SunkenSeaNPCs/BlindedAnglerGlow.png b/NPCs/SunkenSeaNPCs/BlindedAnglerGlow.png new file mode 100644 index 0000000000..c38e496699 Binary files /dev/null and b/NPCs/SunkenSeaNPCs/BlindedAnglerGlow.png differ diff --git a/NPCs/SunkenSeaNPCs/Clam.cs b/NPCs/SunkenSeaNPCs/Clam.cs new file mode 100644 index 0000000000..d80fdd7903 --- /dev/null +++ b/NPCs/SunkenSeaNPCs/Clam.cs @@ -0,0 +1,214 @@ +using System; +using System.Collections.Generic; +using System.IO; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.NPCs.SunkenSeaNPCs +{ + public class Clam : ModNPC + { + public int hitAmount = 0; + public bool hasBeenHit = false; + public bool statChange = false; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Clam"); + Main.npcFrameCount[npc.type] = 5; + } + + public override void SetDefaults() + { + //npc.damage = Main.hardMode ? 60 : 30; + npc.damage = 30; + npc.width = 56; + npc.height = 38; + //npc.defense = Main.hardMode ? 15 : 6; + npc.defense = 9999; + npc.lifeMax = Main.hardMode ? 300 : 150; + if (Main.expertMode) + { + npc.lifeMax *= 2; + } + npc.aiStyle = -1; + aiType = -1; + npc.value = Main.hardMode ? Item.buyPrice(0, 0, 10, 0) : Item.buyPrice(0, 0, 1, 0); + npc.HitSound = SoundID.NPCHit4; + npc.knockBackResist = 0.05f; + banner = npc.type; + bannerItem = mod.ItemType("ClamBanner"); + } + + public override void AI() + { + npc.TargetClosest(true); + if (Main.player[npc.target].GetModPlayer(mod).clamity) + { + hitAmount = 3; + hasBeenHit = true; + } + if (npc.justHit && hitAmount < 3) + { + ++hitAmount; + hasBeenHit = true; + } + npc.chaseable = hasBeenHit; + if (hitAmount == 3) + { + if (!statChange) + { + npc.defense = 6; + npc.damage = Main.expertMode ? 60 : 30; + if (Main.hardMode) + { + npc.defense = 15; + npc.damage = Main.expertMode ? 120 : 60; + } + statChange = true; + } + if (npc.ai[0] == 0f) + { + if (Main.netMode != 1) + { + if (npc.velocity.X != 0f || npc.velocity.Y < 0f || (double)npc.velocity.Y > 0.9) + { + npc.ai[0] = 1f; + npc.netUpdate = true; + return; + } + npc.ai[0] = 1f; + npc.netUpdate = true; + return; + } + } + else if (npc.velocity.Y == 0f) + { + npc.ai[2] += 1f; + int num321 = 20; + if (npc.ai[1] == 0f) + { + num321 = 12; + } + if (npc.ai[2] < (float)num321) + { + npc.velocity.X = npc.velocity.X * 0.9f; + return; + } + npc.ai[2] = 0f; + npc.TargetClosest(true); + if (npc.direction == 0) + { + npc.direction = -1; + } + npc.spriteDirection = -npc.direction; + npc.ai[1] += 1f; + npc.ai[3] += 1f; + if (npc.ai[3] >= 4f) + { + npc.ai[3] = 0f; + if (npc.ai[1] == 2f) + { + float multiplierX = (float)Main.rand.Next(3, 7); + npc.velocity.X = (float)npc.direction * multiplierX; + npc.velocity.Y = -8f; + npc.ai[1] = 0f; + } + else + { + float multiplierX = (float)Main.rand.Next(5, 9); + npc.velocity.X = (float)npc.direction * multiplierX; + npc.velocity.Y = -4f; + } + } + npc.netUpdate = true; + return; + } + else + { + if (npc.direction == 1 && npc.velocity.X < 1f) + { + npc.velocity.X = npc.velocity.X + 0.1f; + return; + } + if (npc.direction == -1 && npc.velocity.X > -1f) + { + npc.velocity.X = npc.velocity.X - 0.1f; + return; + } + } + } + else + { + npc.damage = 0; + } + } + + public override bool? CanBeHitByProjectile(Projectile projectile) + { + if (projectile.minion) + { + return hasBeenHit; + } + return null; + } + + public override void FindFrame(int frameHeight) + { + npc.frameCounter += 1.0; + if (npc.frameCounter > 4.0) + { + npc.frameCounter = 0.0; + npc.frame.Y = npc.frame.Y + frameHeight; + } + if (hitAmount < 3) + { + npc.frame.Y = frameHeight * 4; + } + else + { + if (npc.frame.Y > frameHeight * 3) + { + npc.frame.Y = 0; + } + } + } + + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + if (spawnInfo.player.GetModPlayer(mod).ZoneSunkenSea && spawnInfo.water && !spawnInfo.player.GetModPlayer(mod).clamity) + { + return SpawnCondition.CaveJellyfish.Chance * 1.2f; + } + return 0f; + } + + public override void HitEffect(int hitDirection, double damage) + { + for (int k = 0; k < 5; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 37, hitDirection, -1f, 0, default(Color), 1f); + } + if (npc.life <= 0) + { + for (int k = 0; k < 50; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 37, hitDirection, -1f, 0, default(Color), 1f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Clam/Clam1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Clam/Clam2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Clam/Clam3"), 1f); + } + } + public override void NPCLoot() + { + if (Main.rand.Next(2) == 0 && Main.hardMode) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MolluskHusk")); + } + } + } +} \ No newline at end of file diff --git a/NPCs/SunkenSeaNPCs/Clam.png b/NPCs/SunkenSeaNPCs/Clam.png new file mode 100644 index 0000000000..f7eb5f074a Binary files /dev/null and b/NPCs/SunkenSeaNPCs/Clam.png differ diff --git a/NPCs/SunkenSeaNPCs/EutrophicRay.cs b/NPCs/SunkenSeaNPCs/EutrophicRay.cs new file mode 100644 index 0000000000..afff640ada --- /dev/null +++ b/NPCs/SunkenSeaNPCs/EutrophicRay.cs @@ -0,0 +1,210 @@ +using System; +using System.Collections.Generic; +using System.IO; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.NPCs.SunkenSeaNPCs +{ + public class EutrophicRay : ModNPC + { + public bool hasBeenHit = false; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Eutrophic Ray"); + Main.npcFrameCount[npc.type] = 5; + } + + public override void SetDefaults() + { + npc.damage = 40; + npc.width = 116; + npc.height = 36; + npc.defense = Main.hardMode ? 15 : 5; + npc.lifeMax = Main.hardMode ? 500 : 150; + npc.aiStyle = -1; + aiType = -1; + npc.value = Main.hardMode ? Item.buyPrice(0, 0, 50, 0) : Item.buyPrice(0, 0, 5, 0); + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath55; + npc.knockBackResist = 0f; + banner = npc.type; + bannerItem = mod.ItemType("EutrophicRayBanner"); + } + + public override void AI() + { + npc.TargetClosest(true); + if (npc.velocity.X > 0.25f) + { + npc.spriteDirection = 1; + } + else if (npc.velocity.X < 0.25f) + { + npc.spriteDirection = -1; + } + if (npc.justHit && !hasBeenHit) + { + hasBeenHit = true; + npc.damage = Main.expertMode ? 80 : 40; + if (Main.hardMode) + { + npc.damage = Main.expertMode ? 200 : 100; + } + npc.noTileCollide = true; + npc.noGravity = true; + if ((npc.Center.X) < Main.player[npc.target].Center.X) + { + npc.ai[0] = 1f; + } + else + { + npc.ai[0] = 2f; + } + } + npc.chaseable = hasBeenHit; + if (hasBeenHit) + { + float AccelerationY = Main.hardMode ? 0.4f : 0.2f; + float MaxSpeedY = Main.hardMode ? 4f : 2.5f; + float Rotation = 0; + if ((npc.Center.Y + 0.4f) > Main.player[npc.target].Center.Y) + { + npc.velocity.Y -= AccelerationY; + if (npc.velocity.Y < -MaxSpeedY) + { + npc.velocity.Y = -MaxSpeedY; + } + } + else if ((npc.Center.Y - 0.4f) < Main.player[npc.target].Center.Y) + { + npc.velocity.Y += AccelerationY; + if (npc.velocity.Y > MaxSpeedY) + { + npc.velocity.Y = MaxSpeedY; + } + } + float AccelerationX = Main.hardMode ? 0.4f : 0.25f; + float MaxSpeedX = Main.hardMode ? 6f : 4f; + + if (npc.ai[0] == 1f) + { + Rotation = -0.05f; + npc.velocity.X -= AccelerationX; + if (npc.velocity.X < -MaxSpeedX) + { + npc.velocity.X = -MaxSpeedX; + } + + if ((npc.Center.X + 300f) < Main.player[npc.target].Center.X) + { + npc.ai[0] = 2f; + } + } + else if (npc.ai[0] == 2f) + { + Rotation = 0.05f; + npc.velocity.X += AccelerationX; + if (npc.velocity.X > MaxSpeedX) + { + npc.velocity.X = MaxSpeedX; + } + + if ((npc.Center.X - 300f) > Main.player[npc.target].Center.X) + { + npc.ai[0] = 1f; + } + } + + npc.rotation = npc.velocity.Y * Rotation; + if ((double)npc.rotation < -0.1) + { + npc.rotation = -0.1f; + } + if ((double)npc.rotation > 0.1) + { + npc.rotation = 0.1f; + return; + } + } + else + { + npc.damage = 0; + } + } + + public override void FindFrame(int frameHeight) + { + npc.frameCounter += (hasBeenHit ? 0.15f : 0f); + npc.frameCounter %= Main.npcFrameCount[npc.type]; + int frame = (int)npc.frameCounter; + npc.frame.Y = frame * frameHeight; + } + + public override void PostDraw(SpriteBatch spriteBatch, Color drawColor) + { + SpriteEffects spriteEffects = SpriteEffects.None; + if (npc.spriteDirection == 1) + { + spriteEffects = SpriteEffects.FlipHorizontally; + } + Vector2 center = new Vector2(npc.Center.X, npc.Center.Y); + Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2)); + Vector2 vector = center - Main.screenPosition; + vector -= new Vector2((float)mod.GetTexture("NPCs/SunkenSeaNPCs/EutrophicRayGlow").Width, (float)(mod.GetTexture("NPCs/SunkenSeaNPCs/EutrophicRayGlow").Height / Main.npcFrameCount[npc.type])) * 1f / 2f; + vector += vector11 * 1f + new Vector2(0f, 0f + 4f + npc.gfxOffY); + Microsoft.Xna.Framework.Color color = new Microsoft.Xna.Framework.Color(127 - npc.alpha, 127 - npc.alpha, 127 - npc.alpha, 0).MultiplyRGBA(Microsoft.Xna.Framework.Color.LightBlue); + Main.spriteBatch.Draw(mod.GetTexture("NPCs/SunkenSeaNPCs/EutrophicRayGlow"), vector, + new Microsoft.Xna.Framework.Rectangle?(npc.frame), color, npc.rotation, vector11, 1f, spriteEffects, 0f); + } + + public override bool? CanBeHitByProjectile(Projectile projectile) + { + if (projectile.minion) + { + return hasBeenHit; + } + return null; + } + + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + if (spawnInfo.player.GetModPlayer(mod).ZoneSunkenSea && spawnInfo.water && !spawnInfo.player.GetModPlayer(mod).clamity) + { + return SpawnCondition.CaveJellyfish.Chance * 0.6f; + } + return 0f; + } + + public override void NPCLoot() + { + if (Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EutrophicShank")); + } + } + + public override void HitEffect(int hitDirection, double damage) + { + for (int k = 0; k < 5; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 68, hitDirection, -1f, 0, default(Color), 1f); + } + if (npc.life <= 0) + { + for (int k = 0; k < 25; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 68, hitDirection, -1f, 0, default(Color), 1f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EutrophicRay/RayGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EutrophicRay/RayGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EutrophicRay/RayGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EutrophicRay/RayGore4"), 1f); + } + } + } +} \ No newline at end of file diff --git a/NPCs/SunkenSeaNPCs/EutrophicRay.png b/NPCs/SunkenSeaNPCs/EutrophicRay.png new file mode 100644 index 0000000000..f005213289 Binary files /dev/null and b/NPCs/SunkenSeaNPCs/EutrophicRay.png differ diff --git a/NPCs/SunkenSeaNPCs/EutrophicRayGlow.png b/NPCs/SunkenSeaNPCs/EutrophicRayGlow.png new file mode 100644 index 0000000000..585d222148 Binary files /dev/null and b/NPCs/SunkenSeaNPCs/EutrophicRayGlow.png differ diff --git a/NPCs/SunkenSeaNPCs/GhostBell.cs b/NPCs/SunkenSeaNPCs/GhostBell.cs new file mode 100644 index 0000000000..d533dac152 --- /dev/null +++ b/NPCs/SunkenSeaNPCs/GhostBell.cs @@ -0,0 +1,152 @@ +using System; +using System.Collections.Generic; +using System.IO; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Projectiles; + +namespace CalamityMod.NPCs.SunkenSeaNPCs +{ + public class GhostBell : ModNPC + { + public bool hasBeenHit = false; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ghost Bell"); + Main.npcFrameCount[npc.type] = 6; + } + + public override void SetDefaults() + { + npc.noGravity = true; + npc.aiStyle = -1; + aiType = -1; + npc.damage = Main.hardMode ? 75 : 25; + npc.width = 54; + npc.height = 76; + npc.defense = Main.hardMode ? 10 : 0; + npc.lifeMax = Main.hardMode ? 400 : 120; + npc.knockBackResist = 0f; + npc.alpha = 100; + npc.value = Main.hardMode ? Item.buyPrice(0, 0, 20, 0) : Item.buyPrice(0, 0, 2, 0); + npc.HitSound = SoundID.NPCHit25; + npc.DeathSound = SoundID.NPCDeath28; + banner = npc.type; + bannerItem = mod.ItemType("GhostBellBanner"); + } + + public override void AI() + { + Lighting.AddLight(npc.Center, 0f, ((255 - npc.alpha) * 1.5f) / 255f, ((255 - npc.alpha) * 1.5f) / 255f); + if (npc.justHit) + { + hasBeenHit = true; + } + npc.chaseable = hasBeenHit; + if (npc.localAI[0] == 0f) + { + npc.localAI[0] = 1f; + npc.velocity.Y = -6f; + npc.netUpdate = true; + } + if (npc.wet) + { + npc.noGravity = true; + if (npc.localAI[2] > 0f) + { + npc.localAI[2] -= 1f; + } + if (npc.localAI[2] <= 0f) + { + if (npc.velocity.Y == 0f) + { + npc.localAI[1] += 1f; + } + else + { + npc.localAI[1] = 0f; + } + npc.velocity.Y += 0.1f; + if (npc.velocity.Y > 3f || npc.localAI[1] >= 6f) + { + npc.velocity.Y = -3f; + } + } + } + else + { + npc.noGravity = false; + npc.velocity.Y = 2f; + npc.localAI[2] = 75f; + npc.netUpdate = true; + } + } + + public override bool? CanBeHitByProjectile(Projectile projectile) + { + if (projectile.minion) + { + return hasBeenHit; + } + return null; + } + + public override void FindFrame(int frameHeight) + { + npc.frameCounter += 0.1f; + npc.frameCounter %= Main.npcFrameCount[npc.type]; + int frame = (int)npc.frameCounter; + npc.frame.Y = frame * frameHeight; + } + + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + if (spawnInfo.player.GetModPlayer(mod).ZoneSunkenSea && spawnInfo.water && !spawnInfo.player.GetModPlayer(mod).clamity) + { + return SpawnCondition.CaveJellyfish.Chance * 0.9f; + } + return 0f; + } + + public override void PostDraw(SpriteBatch spriteBatch, Color drawColor) + { + SpriteEffects spriteEffects = SpriteEffects.None; + if (npc.spriteDirection == 1) + { + spriteEffects = SpriteEffects.FlipHorizontally; + } + Vector2 center = new Vector2(npc.Center.X, npc.Center.Y); + Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2)); + Vector2 vector = center - Main.screenPosition; + vector -= new Vector2((float)mod.GetTexture("NPCs/SunkenSeaNPCs/GhostBellGlow").Width, (float)(mod.GetTexture("NPCs/SunkenSeaNPCs/GhostBellGlow").Height / Main.npcFrameCount[npc.type])) * 1f / 2f; + vector += vector11 * 1f + new Vector2(0f, 0f + 4f + npc.gfxOffY); + Microsoft.Xna.Framework.Color color = new Microsoft.Xna.Framework.Color(127 - npc.alpha, 127 - npc.alpha, 127 - npc.alpha, 0).MultiplyRGBA(Microsoft.Xna.Framework.Color.LightBlue); + Main.spriteBatch.Draw(mod.GetTexture("NPCs/SunkenSeaNPCs/GhostBellGlow"), vector, + new Microsoft.Xna.Framework.Rectangle?(npc.frame), color, npc.rotation, vector11, 1f, spriteEffects, 0f); + } + + public override void OnHitPlayer(Player player, int damage, bool crit) + { + player.AddBuff(BuffID.Electrified, 120, true); + } + + public override void HitEffect(int hitDirection, double damage) + { + for (int k = 0; k < 5; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 68, hitDirection, -1f, 0, default(Color), 1f); + } + if (npc.life <= 0) + { + for (int k = 0; k < 25; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 68, hitDirection, -1f, 0, default(Color), 1f); + } + } + } + } +} \ No newline at end of file diff --git a/NPCs/SunkenSeaNPCs/GhostBell.png b/NPCs/SunkenSeaNPCs/GhostBell.png new file mode 100644 index 0000000000..0a9a975802 Binary files /dev/null and b/NPCs/SunkenSeaNPCs/GhostBell.png differ diff --git a/NPCs/SunkenSeaNPCs/GhostBellGlow.png b/NPCs/SunkenSeaNPCs/GhostBellGlow.png new file mode 100644 index 0000000000..0a9a975802 Binary files /dev/null and b/NPCs/SunkenSeaNPCs/GhostBellGlow.png differ diff --git a/NPCs/SunkenSeaNPCs/GhostBellSmall.cs b/NPCs/SunkenSeaNPCs/GhostBellSmall.cs new file mode 100644 index 0000000000..b8c4a8957b --- /dev/null +++ b/NPCs/SunkenSeaNPCs/GhostBellSmall.cs @@ -0,0 +1,127 @@ +using System; +using System.Collections.Generic; +using System.IO; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Projectiles; + +namespace CalamityMod.NPCs.SunkenSeaNPCs +{ + public class GhostBellSmall : ModNPC + { + public bool hasBeenHit = false; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Baby Ghost Bell"); + Main.npcFrameCount[npc.type] = 4; + } + + public override void SetDefaults() + { + npc.npcSlots = 0.1f; + npc.noGravity = true; + npc.aiStyle = -1; + aiType = -1; + npc.damage = 0; + npc.width = 28; + npc.height = 36; + npc.defense = 0; + npc.lifeMax = 5; + npc.knockBackResist = 1f; + npc.alpha = 100; + npc.HitSound = SoundID.NPCHit25; + npc.DeathSound = SoundID.NPCDeath28; + banner = npc.type; + bannerItem = mod.ItemType("GhostBellSmallBanner"); + } + + public override void AI() + { + Lighting.AddLight(npc.Center, 0f, ((255 - npc.alpha) * 1f) / 255f, ((255 - npc.alpha) * 1f) / 255f); + if (npc.localAI[0] == 0f) + { + npc.localAI[0] = 1f; + npc.velocity.Y = -3f; + npc.netUpdate = true; + } + if (npc.wet) + { + npc.noGravity = true; + if (npc.velocity.Y < 0f) + { + npc.velocity.Y += 0.1f; + } + if (npc.velocity.Y > 0f) + { + npc.velocity.Y = 0f; + } + } + else + { + npc.noGravity = false; + } + } + + public override bool? CanBeHitByProjectile(Projectile projectile) + { + if (projectile.minion) + { + return hasBeenHit; + } + return null; + } + + public override void FindFrame(int frameHeight) + { + npc.frameCounter += 0.15f; + npc.frameCounter %= Main.npcFrameCount[npc.type]; + int frame = (int)npc.frameCounter; + npc.frame.Y = frame * frameHeight; + } + + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + if (spawnInfo.player.GetModPlayer(mod).ZoneSunkenSea && spawnInfo.water && !spawnInfo.player.GetModPlayer(mod).clamity) + { + return SpawnCondition.CaveJellyfish.Chance * 1.5f; + } + return 0f; + } + + public override void PostDraw(SpriteBatch spriteBatch, Color drawColor) + { + SpriteEffects spriteEffects = SpriteEffects.None; + if (npc.spriteDirection == 1) + { + spriteEffects = SpriteEffects.FlipHorizontally; + } + Vector2 center = new Vector2(npc.Center.X, npc.Center.Y); + Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2)); + Vector2 vector = center - Main.screenPosition; + vector -= new Vector2((float)mod.GetTexture("NPCs/SunkenSeaNPCs/GhostBellSmallGlow").Width, (float)(mod.GetTexture("NPCs/SunkenSeaNPCs/GhostBellSmallGlow").Height / Main.npcFrameCount[npc.type])) * 1f / 2f; + vector += vector11 * 1f + new Vector2(0f, 0f + 4f + npc.gfxOffY); + Microsoft.Xna.Framework.Color color = new Microsoft.Xna.Framework.Color(127 - npc.alpha, 127 - npc.alpha, 127 - npc.alpha, 0).MultiplyRGBA(Microsoft.Xna.Framework.Color.LightBlue); + Main.spriteBatch.Draw(mod.GetTexture("NPCs/SunkenSeaNPCs/GhostBellSmallGlow"), vector, + new Microsoft.Xna.Framework.Rectangle?(npc.frame), color, npc.rotation, vector11, 1f, spriteEffects, 0f); + } + + public override void HitEffect(int hitDirection, double damage) + { + for (int k = 0; k < 2; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 68, hitDirection, -1f, 0, default(Color), 1f); + } + if (npc.life <= 0) + { + for (int k = 0; k < 10; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 68, hitDirection, -1f, 0, default(Color), 1f); + } + } + } + } +} \ No newline at end of file diff --git a/NPCs/SunkenSeaNPCs/GhostBellSmall.png b/NPCs/SunkenSeaNPCs/GhostBellSmall.png new file mode 100644 index 0000000000..ee927c6bed Binary files /dev/null and b/NPCs/SunkenSeaNPCs/GhostBellSmall.png differ diff --git a/NPCs/SunkenSeaNPCs/GhostBellSmallGlow.png b/NPCs/SunkenSeaNPCs/GhostBellSmallGlow.png new file mode 100644 index 0000000000..ee927c6bed Binary files /dev/null and b/NPCs/SunkenSeaNPCs/GhostBellSmallGlow.png differ diff --git a/NPCs/SunkenSeaNPCs/GiantClam.cs b/NPCs/SunkenSeaNPCs/GiantClam.cs new file mode 100644 index 0000000000..49b2c5da7e --- /dev/null +++ b/NPCs/SunkenSeaNPCs/GiantClam.cs @@ -0,0 +1,394 @@ +using System; +using System.Collections.Generic; +using System.IO; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Localization; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Projectiles; + +namespace CalamityMod.NPCs.SunkenSeaNPCs +{ + public class GiantClam : ModNPC + { + public int hitAmount = 0; + public int attack = -1; //-1 doing nothing, 0 = shell hiding, 1 = telestomp, 2 = pearl burst, 3 = pearl rain + public bool attackAnim = false; + public bool hasBeenHit = false; + public bool statChange = false; + public bool hide = false; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Giant Clam"); + Main.npcFrameCount[npc.type] = 12; + } + + public override void SetDefaults() + { + //npc.damage = Main.hardMode ? 100 : 50; + npc.npcSlots = 5f; + npc.damage = 50; + npc.width = 226; + npc.height = 136; + //npc.defense = Main.hardMode ? 35 : 10; + npc.defense = 9999; + npc.lifeMax = Main.hardMode ? 7500 : 1250; + npc.aiStyle = -1; + aiType = -1; + npc.value = Main.hardMode ? Item.buyPrice(0, 10, 0, 0) : Item.buyPrice(0, 1, 0, 0); + npc.HitSound = SoundID.NPCHit4; + npc.knockBackResist = 0f; + npc.rarity = 2; + banner = npc.type; + bannerItem = mod.ItemType("GiantClamBanner"); + } + + public override void AI() + { + npc.TargetClosest(true); + Player player = Main.player[npc.target]; + if (npc.justHit && hitAmount < 5) + { + ++hitAmount; + hasBeenHit = true; + } + npc.chaseable = hasBeenHit; + if (hitAmount == 5) + { + if (Main.netMode != 2) + { + if (!Main.player[npc.target].dead && Main.player[npc.target].active) + { + player.AddBuff(mod.BuffType("Clamity"), 2); //CLAM INVASION + } + } + + if (!hide) + Lighting.AddLight(npc.Center, 0f, ((255 - npc.alpha) * 2.5f) / 255f, ((255 - npc.alpha) * 2.5f) / 255f); + + if (!statChange) + { + npc.defense = 10; + npc.damage = Main.expertMode ? 100 : 50; + if (Main.hardMode) + { + npc.defense = 35; + npc.damage = Main.expertMode ? 200 : 100; + } + statChange = true; + } + + if (npc.ai[0] < 240f) + { + npc.ai[0] += 1f; + hide = false; + } + else + { + if (attack == -1) + { + attack = Main.rand.Next(2); + if (attack == 0) + { + attack = Main.rand.Next(2); //rarer chance of doing the hiding clam + } + } + else if (attack == 0) + { + hide = true; + npc.defense = 9999; + npc.ai[1] += 1f; + if (npc.ai[1] >= 90f) + { + npc.ai[0] = 0f; + npc.ai[1] = 0f; + hide = false; + attack = -1; + npc.defense = Main.hardMode ? 35 : 10; + NPC.NewNPC((int)(npc.Center.X + 5), (int)npc.Center.Y, mod.NPCType("Clam"), 0, 0f, 0f, 0f, 0f, 255); + NPC.NewNPC((int)(npc.Center.X), (int)npc.Center.Y, mod.NPCType("Clam"), 0, 0f, 0f, 0f, 0f, 255); + NPC.NewNPC((int)(npc.Center.X - 5), (int)npc.Center.Y, mod.NPCType("Clam"), 0, 0f, 0f, 0f, 0f, 255); + } + } + else if (attack == 1) + { + if (npc.ai[2] == 0f) + { + if (Main.netMode != 1) + { + npc.TargetClosest(true); + npc.ai[2] = 1f; + npc.netUpdate = true; + } + } + else if (npc.ai[2] == 1f) + { + npc.damage = 0; + npc.chaseable = false; + npc.dontTakeDamage = true; + npc.noGravity = true; + npc.noTileCollide = true; + npc.alpha += Main.hardMode ? 8 : 5; + if (npc.alpha >= 255) + { + npc.alpha = 255; + npc.position.X = player.Center.X - (float)(npc.width / 2); + npc.position.Y = player.Center.Y - (float)(npc.height / 2) + player.gfxOffY - 200f; + npc.position.X = npc.position.X - 15f; + npc.position.Y = npc.position.Y - 100f; + npc.ai[2] = 2f; + npc.netUpdate = true; + } + } + else if (npc.ai[2] == 2f) + { + if (Main.rand.Next(2) == 0) + { + int num5 = Dust.NewDust(npc.position, npc.width, npc.height, 226, 0f, 0f, 200, default(Color), 1.5f); + Main.dust[num5].noGravity = true; + Main.dust[num5].velocity *= 0.75f; + Main.dust[num5].fadeIn = 1.3f; + Vector2 vector = new Vector2((float)Main.rand.Next(-200, 201), (float)Main.rand.Next(-200, 201)); + vector.Normalize(); + vector *= (float)Main.rand.Next(100, 200) * 0.04f; + Main.dust[num5].velocity = vector; + vector.Normalize(); + vector *= 34f; + Main.dust[num5].position = npc.Center - vector; + } + npc.alpha -= Main.hardMode ? 7 : 4; + if (npc.alpha <= 0) + { + npc.damage = Main.expertMode ? 100 : 50; + if (Main.hardMode) + { + npc.damage = Main.expertMode ? 200 : 100; + } + npc.chaseable = true; + npc.dontTakeDamage = false; + npc.alpha = 0; + npc.ai[2] = 3f; + npc.netUpdate = true; + } + } + else if (npc.ai[2] == 3f) + { + npc.velocity.Y += 0.8f; + attackAnim = true; + if ((npc.Center.Y) > (player.Center.Y - (float)(npc.height / 2) + player.gfxOffY - 15f)) + { + npc.noTileCollide = false; + npc.ai[2] = 4f; + npc.netUpdate = true; + } + } + else if (npc.ai[2] == 4f) + { + if (npc.velocity.Y == 0f) + { + npc.ai[2] = 0f; + npc.ai[0] = 0f; + npc.netUpdate = true; + npc.noGravity = false; + attack = -1; + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/ClamImpact"), (int)npc.position.X, (int)npc.position.Y); + for (int stompDustArea = (int)npc.position.X - 30; stompDustArea < (int)npc.position.X + npc.width + 60; stompDustArea += 30) + { + for (int stompDustAmount = 0; stompDustAmount < 5; stompDustAmount++) + { + int stompDust = Dust.NewDust(new Vector2(npc.position.X - 30f, npc.position.Y + (float)npc.height), npc.width + 30, 4, 33, 0f, 0f, 100, default(Color), 1.5f); + Main.dust[stompDust].velocity *= 0.2f; + } + int stompGore = Gore.NewGore(new Vector2((float)(stompDustArea - 30), npc.position.Y + (float)npc.height - 12f), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[stompGore].velocity *= 0.4f; + } + } + npc.velocity.Y += 0.8f; + } + } + } + + if (npc.ai[3] < 180f && Main.hardMode) + { + npc.ai[3] += 1f; + } + else if (Main.hardMode) + { + if (attack == -1) + { + attack = Main.rand.Next(2, 4); + } + else if (attack == 2) + { + Main.PlaySound(SoundID.Item67, npc.position); + Vector2 value9 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float spread = 45f * 0.0174f; + double startAngle = Math.Atan2(npc.velocity.X, npc.velocity.Y) - spread / 2; + double deltaAngle = spread / 8f; + double offsetAngle; + int projectileShot = mod.ProjectileType("PearlBurst"); + int damage = Main.expertMode ? 50 : 75; + float speed = 5f; + Vector2 vector = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)(npc.height / 2)); + float num6 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector.X + (float)Main.rand.Next(-20, 21); + float num7 = Main.player[npc.target].position.Y + (float)Main.player[npc.target].height * 0.5f - vector.Y + (float)Main.rand.Next(-20, 21); + float num8 = (float)Math.Sqrt((double)(num6 * num6 + num7 * num7)); + num8 = speed / num8; + num6 *= num8; + num7 *= num8; + Projectile.NewProjectile(npc.Center.X, npc.Center.Y, num6, num7, projectileShot, damage, 0f, Main.myPlayer, 0f, 0f); + for (int i = 0; i < 4; i++) + { + offsetAngle = (startAngle + deltaAngle * (i + i * i) / 2f) + 32f * i; + Projectile.NewProjectile(value9.X, value9.Y, (float)(Math.Sin(offsetAngle) * 3f), (float)(Math.Cos(offsetAngle) * 3f), projectileShot, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(value9.X, value9.Y, (float)(-Math.Sin(offsetAngle) * 3f), (float)(-Math.Cos(offsetAngle) * 3f), projectileShot, damage, 0f, Main.myPlayer, 0f, 0f); + } + attack = -1; + npc.ai[3] = 0f; + } + else if (attack == 3) + { + if (Main.netMode != 1) + { + Main.PlaySound(SoundID.Item68, npc.position); + int damage = Main.expertMode ? 30 : 50; + float shotSpacing = 750f; + for (int i = 0; i < 11; i++) + { + Projectile.NewProjectile(player.Center.X + shotSpacing, player.Center.Y - 750f, 0f, 8f, mod.ProjectileType("PearlRain"), damage, 0f, Main.myPlayer, 0f, 0f); + shotSpacing -= 150f; + } + } + attack = -1; + npc.ai[3] = 0f; + } + } + } + } + + public override bool? CanBeHitByProjectile(Projectile projectile) + { + if (projectile.minion) + { + return hasBeenHit; + } + return null; + } + + public override void FindFrame(int frameHeight) + { + npc.frameCounter += 1.0; + if (npc.frameCounter > (attackAnim ? 2.0 : 5.0)) + { + npc.frameCounter = 0.0; + npc.frame.Y = npc.frame.Y + frameHeight; + } + if (hitAmount < 5 || hide) + { + npc.frame.Y = frameHeight * 11; + } + else if (attackAnim) + { + if (npc.frame.Y < frameHeight * 3) + { + npc.frame.Y = frameHeight * 3; + } + if (npc.frame.Y > frameHeight * 10) + { + hide = true; + attackAnim = false; + } + } + else + { + if (npc.frame.Y > frameHeight * 3) + { + npc.frame.Y = 0; + } + } + } + + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + if (spawnInfo.player.GetModPlayer(mod).ZoneSunkenSea && spawnInfo.water && !NPC.AnyNPCs(mod.NPCType("GiantClam"))) + { + return SpawnCondition.CaveJellyfish.Chance * 0.06f; + } + return 0f; + } + + public override void HitEffect(int hitDirection, double damage) + { + for (int k = 0; k < 5; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 37, hitDirection, -1f, 0, default(Color), 1f); + } + if (npc.life <= 0) + { + for (int k = 0; k < 50; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 37, hitDirection, -1f, 0, default(Color), 1f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GiantClam/GiantClam1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GiantClam/GiantClam2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GiantClam/GiantClam3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GiantClam/GiantClam4"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GiantClam/GiantClam5"), 1f); + } + } + + public override void PostDraw(SpriteBatch spriteBatch, Color drawColor) + { + SpriteEffects spriteEffects = SpriteEffects.None; + Vector2 center = new Vector2(npc.Center.X, npc.Center.Y); + Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2)); + Vector2 vector = center - Main.screenPosition; + vector -= new Vector2((float)mod.GetTexture("NPCs/SunkenSeaNPCs/GiantClamGlow").Width, (float)(mod.GetTexture("NPCs/SunkenSeaNPCs/GiantClamGlow").Height / Main.npcFrameCount[npc.type])) * 1f / 2f; + vector += vector11 * 1f + new Vector2(0f, 0f + 4f + npc.gfxOffY); + Microsoft.Xna.Framework.Color color = new Microsoft.Xna.Framework.Color(127 - npc.alpha, 127 - npc.alpha, 127 - npc.alpha, 0).MultiplyRGBA(Microsoft.Xna.Framework.Color.LightBlue); + Main.spriteBatch.Draw(mod.GetTexture("NPCs/SunkenSeaNPCs/GiantClamGlow"), vector, + new Microsoft.Xna.Framework.Rectangle?(npc.frame), color, npc.rotation, vector11, 1f, spriteEffects, 0f); + } + + public override void NPCLoot() + { + int seahoe = NPC.FindFirstNPC(mod.NPCType("SEAHOE")); + if (seahoe == -1 && Main.netMode != 1 && CalamityWorld.downedDesertScourge) + { + NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("SEAHOE"), 0, 0f, 0f, 0f, 0f, 255); + } + if (Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GiantPearl")); + } + if (CalamityWorld.revenge && Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("AmidiasPendant")); + } + if (Main.hardMode) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MolluskHusk"), Main.rand.Next(6, 12)); + + int itemChoice = Main.rand.Next(3); + switch (itemChoice) + { + case 0: + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Poseidon")); + break; + case 1: + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ClamCrusher")); + break; + case 2: + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ClamorRifle")); + break; + case 3: + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ShellfishStaff")); + break; + } + } + } + } +} \ No newline at end of file diff --git a/NPCs/SunkenSeaNPCs/GiantClam.png b/NPCs/SunkenSeaNPCs/GiantClam.png new file mode 100644 index 0000000000..5d3b86702f Binary files /dev/null and b/NPCs/SunkenSeaNPCs/GiantClam.png differ diff --git a/NPCs/SunkenSeaNPCs/GiantClamGlow.png b/NPCs/SunkenSeaNPCs/GiantClamGlow.png new file mode 100644 index 0000000000..f10c17be37 Binary files /dev/null and b/NPCs/SunkenSeaNPCs/GiantClamGlow.png differ diff --git a/NPCs/SunkenSeaNPCs/PrismTurtle.cs b/NPCs/SunkenSeaNPCs/PrismTurtle.cs new file mode 100644 index 0000000000..3d051d362c --- /dev/null +++ b/NPCs/SunkenSeaNPCs/PrismTurtle.cs @@ -0,0 +1,279 @@ +using System; +using System.Collections.Generic; +using System.IO; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.NPCs.SunkenSeaNPCs +{ + public class PrismTurtle : ModNPC + { + public bool hasBeenHit = false; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Prism-Back"); + Main.npcFrameCount[npc.type] = 5; + } + + public override void SetDefaults() + { + npc.noGravity = true; + npc.damage = Main.hardMode ? 40 : 20; //normal damage + npc.width = 72; + npc.height = 58; + npc.defense = Main.hardMode ? 25 : 10; + npc.lifeMax = Main.hardMode ? 1000 : 350; + npc.aiStyle = -1; + aiType = -1; + npc.value = Main.hardMode ? Item.buyPrice(0, 0, 50, 0) : Item.buyPrice(0, 0, 5, 0); + npc.HitSound = SoundID.NPCHit24; + npc.DeathSound = SoundID.NPCDeath27; + npc.knockBackResist = 0.15f; + banner = npc.type; + bannerItem = mod.ItemType("PrismTurtleBanner"); + } + + public override void AI() + { + if ((npc.Center.Y + 10f) > Main.player[npc.target].Center.Y) + { + if (CalamityWorld.death) //gotta do damage scaling directly + { + npc.damage = Main.hardMode ? 240 : 120; + } + else if (CalamityWorld.revenge) + { + npc.damage = Main.hardMode ? 168 : 84; + } + else if (Main.expertMode) + { + npc.damage = Main.hardMode ? 160 : 80; + } + else + { + npc.damage = Main.hardMode ? 80 : 40; + } + } + else + { + if (CalamityWorld.death) //gotta do damage scaling directly + { + npc.damage = Main.hardMode ? 120 : 60; + } + else if (CalamityWorld.revenge) + { + npc.damage = Main.hardMode ? 84 : 42; + } + else if (Main.expertMode) + { + npc.damage = Main.hardMode ? 80 : 40; + } + else + { + npc.damage = Main.hardMode ? 40 : 20; + } + } + Lighting.AddLight(npc.Center, ((255 - npc.alpha) * 0f) / 255f, ((255 - npc.alpha) * 0.75f) / 255f, ((255 - npc.alpha) * 0.75f) / 255f); + npc.spriteDirection = ((npc.direction > 0) ? 1 : -1); + npc.noGravity = true; + if (npc.justHit) + { + hasBeenHit = true; + } + npc.chaseable = hasBeenHit; + if (npc.direction == 0) + { + npc.TargetClosest(true); + } + if (npc.wet) + { + if (npc.collideX || npc.velocity.X == 0f) + { + npc.velocity.X = npc.velocity.X * -1f; + npc.direction *= -1; + npc.netUpdate = true; + } + if (npc.collideY) + { + npc.netUpdate = true; + if (npc.velocity.Y > 0f) + { + npc.velocity.Y = Math.Abs(npc.velocity.Y) * -1f; + npc.directionY = -1; + npc.ai[0] = -1f; + } + else if (npc.velocity.Y < 0f) + { + npc.velocity.Y = Math.Abs(npc.velocity.Y); + npc.directionY = 1; + npc.ai[0] = 1f; + } + } + npc.velocity.X = npc.velocity.X + (float)npc.direction * 0.1f; + if (npc.velocity.X < -2f || npc.velocity.X > 2f) + { + npc.velocity.X = npc.velocity.X * 0.95f; + } + if (npc.ai[0] == -1f) + { + npc.velocity.Y = npc.velocity.Y - 0.1f; + if (npc.velocity.Y < -1f) + { + npc.velocity.Y = -1f; + ++npc.ai[1]; + if (npc.ai[1] >= 120) + { + npc.ai[1] = 0; + npc.ai[0] = 1f; + } + } + } + else + { + npc.velocity.Y = npc.velocity.Y + 0.1f; + if (npc.velocity.Y > 1f) + { + npc.velocity.Y = 1f; + ++npc.ai[1]; + if (npc.ai[1] >= 120) + { + npc.ai[1] = 0; + npc.ai[0] = -1f; + } + } + } + int num258 = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int num259 = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + if (Main.tile[num258, num259 - 1] == null) + { + Main.tile[num258, num259 - 1] = new Tile(); + } + if (Main.tile[num258, num259 + 1] == null) + { + Main.tile[num258, num259 + 1] = new Tile(); + } + if (Main.tile[num258, num259 + 2] == null) + { + Main.tile[num258, num259 + 2] = new Tile(); + } + if (Main.tile[num258, num259 - 1].liquid > 128) + { + if (Main.tile[num258, num259 + 1].active()) + { + npc.ai[0] = -1f; + } + else if (Main.tile[num258, num259 + 2].active()) + { + npc.ai[0] = -1f; + } + } + if ((double)npc.velocity.Y > 0.4 || (double)npc.velocity.Y < -0.4) + { + npc.velocity.Y = npc.velocity.Y * 0.95f; + } + } + else + { + if (npc.velocity.Y == 0f) + { + npc.velocity.X = npc.velocity.X * 0.94f; + if ((double)npc.velocity.X > -0.2 && (double)npc.velocity.X < 0.2) + { + npc.velocity.X = 0f; + } + } + npc.velocity.Y = npc.velocity.Y + 0.4f; + if (npc.velocity.Y > 12f) + { + npc.velocity.Y = 12f; + } + npc.ai[0] = 1f; + npc.rotation = npc.velocity.Y * (float)npc.direction * 0.1f; + if ((double)npc.rotation < -0.2) + { + npc.rotation = -0.2f; + } + if ((double)npc.rotation > 0.2) + { + npc.rotation = 0.2f; + return; + } + } + } + + public override void FindFrame(int frameHeight) + { + npc.frameCounter += (npc.wet ? 0.1f : 0f); + npc.frameCounter %= Main.npcFrameCount[npc.type]; + int frame = (int)npc.frameCounter; + npc.frame.Y = frame * frameHeight; + } + + public override void PostDraw(SpriteBatch spriteBatch, Color drawColor) + { + SpriteEffects spriteEffects = SpriteEffects.None; + if (npc.spriteDirection == 1) + { + spriteEffects = SpriteEffects.FlipHorizontally; + } + Vector2 center = new Vector2(npc.Center.X, npc.Center.Y); + Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2)); + Vector2 vector = center - Main.screenPosition; + vector -= new Vector2((float)mod.GetTexture("NPCs/SunkenSeaNPCs/PrismTurtleGlow").Width, (float)(mod.GetTexture("NPCs/SunkenSeaNPCs/PrismTurtleGlow").Height / Main.npcFrameCount[npc.type])) * 1f / 2f; + vector += vector11 * 1f + new Vector2(0f, 0f + 4f + npc.gfxOffY); + Microsoft.Xna.Framework.Color color = new Microsoft.Xna.Framework.Color(127 - npc.alpha, 127 - npc.alpha, 127 - npc.alpha, 0).MultiplyRGBA(Microsoft.Xna.Framework.Color.Blue); + Main.spriteBatch.Draw(mod.GetTexture("NPCs/SunkenSeaNPCs/PrismTurtleGlow"), vector, + new Microsoft.Xna.Framework.Rectangle?(npc.frame), color, npc.rotation, vector11, 1f, spriteEffects, 0f); + } + + public override bool? CanBeHitByProjectile(Projectile projectile) + { + if (projectile.minion) + { + return hasBeenHit; + } + return null; + } + + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + if (spawnInfo.player.GetModPlayer(mod).ZoneSunkenSea && spawnInfo.water && !spawnInfo.player.GetModPlayer(mod).clamity) + { + return SpawnCondition.CaveJellyfish.Chance * 0.9f; + } + return 0f; + } + + public override void NPCLoot() + { + if (CalamityWorld.downedDesertScourge) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("PrismShard"), Main.rand.Next(1, 4)); + } + } + + public override void HitEffect(int hitDirection, double damage) + { + for (int k = 0; k < 5; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 68, hitDirection, -1f, 0, default(Color), 1f); + } + if (npc.life <= 0) + { + for (int k = 0; k < 25; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 68, hitDirection, -1f, 0, default(Color), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PrismTurtle/PrismTurtleGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PrismTurtle/PrismTurtleGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PrismTurtle/PrismTurtleGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PrismTurtle/PrismTurtleGore4"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PrismTurtle/PrismTurtleGore5"), 1f); + } + } + } + } +} \ No newline at end of file diff --git a/NPCs/SunkenSeaNPCs/PrismTurtle.png b/NPCs/SunkenSeaNPCs/PrismTurtle.png new file mode 100644 index 0000000000..e0b6fe8eb9 Binary files /dev/null and b/NPCs/SunkenSeaNPCs/PrismTurtle.png differ diff --git a/NPCs/SunkenSeaNPCs/PrismTurtleGlow.png b/NPCs/SunkenSeaNPCs/PrismTurtleGlow.png new file mode 100644 index 0000000000..55328bedde Binary files /dev/null and b/NPCs/SunkenSeaNPCs/PrismTurtleGlow.png differ diff --git a/NPCs/SunkenSeaNPCs/SeaFloaty.cs b/NPCs/SunkenSeaNPCs/SeaFloaty.cs new file mode 100644 index 0000000000..9a4bdfe537 --- /dev/null +++ b/NPCs/SunkenSeaNPCs/SeaFloaty.cs @@ -0,0 +1,145 @@ +using System; +using System.Collections.Generic; +using System.IO; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Projectiles; + +namespace CalamityMod.NPCs.SunkenSeaNPCs +{ + public class SeaFloaty : ModNPC + { + public bool hasBeenHit = false; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sea Floaty"); + Main.npcFrameCount[npc.type] = 6; + } + + public override void SetDefaults() + { + npc.npcSlots = 0.5f; + npc.aiStyle = -1; + aiType = -1; + npc.damage = 5; + npc.width = 72; + npc.height = 22; + npc.defense = 0; + npc.lifeMax = 50; + npc.knockBackResist = 0.5f; + npc.value = Item.buyPrice(0, 0, 0, 50); + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath1; + banner = npc.type; + bannerItem = mod.ItemType("SeaFloatyBanner"); + } + + public override void AI() + { + if (npc.velocity.X > 0.25f) + { + npc.spriteDirection = -1; + } + else if (npc.velocity.X < 0.25f) + { + npc.spriteDirection = 1; + } + if (npc.ai[0] == 0f) + { + npc.direction = 1; + npc.ai[0] = 1f; + } + npc.velocity.X = npc.velocity.X + (float)npc.direction * 0.1f; + if (npc.velocity.X < -2.5f || npc.velocity.X > 2.5f) + { + npc.velocity.X = npc.velocity.X * 0.95f; + } + if (npc.collideX) + { + npc.velocity.X = npc.velocity.X * -1f; + npc.direction *= -1; + npc.netUpdate = true; + } + + if (npc.justHit && !hasBeenHit) + { + hasBeenHit = true; + npc.noTileCollide = true; + npc.noGravity = true; + } + npc.chaseable = hasBeenHit; + if (hasBeenHit) + { + npc.TargetClosest(true); + npc.velocity.X = npc.velocity.X - (float)npc.direction * 0.5f; + npc.velocity.Y = npc.velocity.Y - (float)npc.directionY * 0.3f; + if (npc.velocity.X > 10f) + { + npc.velocity.X = 10f; + } + if (npc.velocity.X < -10f) + { + npc.velocity.X = -10f; + } + if (npc.velocity.Y > 10f) + { + npc.velocity.Y = 10f; + } + if (npc.velocity.Y < -10f) + { + npc.velocity.Y = -10f; + } + npc.direction *= -1; + npc.rotation = npc.velocity.X * 0.1f; + if ((double)npc.rotation < -0.3) + { + npc.rotation = -0.3f; + } + if ((double)npc.rotation > 0.3) + { + npc.rotation = 0.3f; + return; + } + } + } + + public override void FindFrame(int frameHeight) + { + npc.frameCounter += (hasBeenHit ? 0.3f : 0.15f); + npc.frameCounter %= Main.npcFrameCount[npc.type]; + int frame = (int)npc.frameCounter; + npc.frame.Y = frame * frameHeight; + } + + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + if (spawnInfo.player.GetModPlayer(mod).ZoneSunkenSea && spawnInfo.water && !spawnInfo.player.GetModPlayer(mod).clamity) + { + return SpawnCondition.CaveJellyfish.Chance * 0.45f; + } + return 0f; + } + + public override void HitEffect(int hitDirection, double damage) + { + for (int k = 0; k < 5; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 68, hitDirection, -1f, 0, default(Color), 1f); + } + if (npc.life <= 0) + { + for (int k = 0; k < 25; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 68, hitDirection, -1f, 0, default(Color), 1f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SeaFloaty/SeaFloatyGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SeaFloaty/SeaFloatyGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SeaFloaty/SeaFloatyGore3"), 1f); + } + } + } +} \ No newline at end of file diff --git a/NPCs/SunkenSeaNPCs/SeaFloaty.png b/NPCs/SunkenSeaNPCs/SeaFloaty.png new file mode 100644 index 0000000000..cb786ed41d Binary files /dev/null and b/NPCs/SunkenSeaNPCs/SeaFloaty.png differ diff --git a/NPCs/SunkenSeaNPCs/SeaMinnow.cs b/NPCs/SunkenSeaNPCs/SeaMinnow.cs new file mode 100644 index 0000000000..1fe26dd9f5 --- /dev/null +++ b/NPCs/SunkenSeaNPCs/SeaMinnow.cs @@ -0,0 +1,222 @@ +using System; +using System.Collections.Generic; +using System.IO; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Projectiles; + +namespace CalamityMod.NPCs.SunkenSeaNPCs +{ + public class SeaMinnow : ModNPC + { + public bool spawnedSchool = false; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sea Minnow"); + Main.npcFrameCount[npc.type] = 4; + } + + public override void SetDefaults() + { + npc.npcSlots = 0.1f; + npc.noGravity = true; + npc.damage = 0; + npc.width = 36; + npc.height = 22; + npc.defense = 0; + npc.lifeMax = 5; + npc.aiStyle = -1; + aiType = -1; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath1; + banner = npc.type; + bannerItem = mod.ItemType("SeaMinnowBanner"); + } + + public override void AI() + { + npc.spriteDirection = ((npc.direction > 0) ? 1 : -1); + npc.noGravity = true; + bool flag14 = false; + if (npc.direction == 0) + { + npc.TargetClosest(true); + } + if (npc.wet) + { + npc.TargetClosest(false); + if (Main.player[npc.target].wet && !Main.player[npc.target].dead && + (Main.player[npc.target].Center - npc.Center).Length() < 150f) + { + flag14 = true; + } + if ((!Main.player[npc.target].wet || Main.player[npc.target].dead) && flag14) + { + flag14 = false; + } + if (!flag14) + { + if (npc.collideX || npc.velocity.X == 0f) + { + npc.velocity.X = npc.velocity.X * -3f; + npc.direction *= -1; + npc.netUpdate = true; + } + if (npc.collideY) + { + npc.netUpdate = true; + if (npc.velocity.Y > 0f) + { + npc.velocity.Y = Math.Abs(npc.velocity.Y) * -3f; + npc.directionY = -1; + npc.ai[0] = -1f; + } + else if (npc.velocity.Y < 0f) + { + npc.velocity.Y = Math.Abs(npc.velocity.Y); + npc.directionY = 1; + npc.ai[0] = 1f; + } + } + } + if (flag14) + { + npc.TargetClosest(true); + npc.velocity.X = npc.velocity.X - (float)npc.direction * 0.25f; + npc.velocity.Y = npc.velocity.Y - (float)npc.directionY * 0.15f; + if (npc.velocity.X > 6f) + { + npc.velocity.X = 6f; + } + if (npc.velocity.X < -6f) + { + npc.velocity.X = -6f; + } + if (npc.velocity.Y > 6f) + { + npc.velocity.Y = 6f; + } + if (npc.velocity.Y < -6f) + { + npc.velocity.Y = -6f; + } + npc.direction *= -1; + } + else + { + npc.velocity.X = npc.velocity.X + (float)npc.direction * 0.1f; + if (npc.velocity.X < -2.5f || npc.velocity.X > 2.5f) + { + npc.velocity.X = npc.velocity.X * 0.95f; + } + if (npc.ai[0] == -1f) + { + npc.velocity.Y = npc.velocity.Y - 0.01f; + if ((double)npc.velocity.Y < -0.3) + { + npc.ai[0] = 1f; + } + } + else + { + npc.velocity.Y = npc.velocity.Y + 0.01f; + if ((double)npc.velocity.Y > 0.3) + { + npc.ai[0] = -1f; + } + } + } + int num258 = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int num259 = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + if (Main.tile[num258, num259 - 1] == null) + { + Main.tile[num258, num259 - 1] = new Tile(); + } + if (Main.tile[num258, num259 + 1] == null) + { + Main.tile[num258, num259 + 1] = new Tile(); + } + if (Main.tile[num258, num259 + 2] == null) + { + Main.tile[num258, num259 + 2] = new Tile(); + } + if (Main.tile[num258, num259 - 1].liquid > 128) + { + if (Main.tile[num258, num259 + 1].active()) + { + npc.ai[0] = -1f; + } + else if (Main.tile[num258, num259 + 2].active()) + { + npc.ai[0] = -1f; + } + } + if ((double)npc.velocity.Y > 0.4 || (double)npc.velocity.Y < -0.4) + { + npc.velocity.Y = npc.velocity.Y * 0.95f; + } + } + else + { + if (npc.velocity.Y == 0f) + { + npc.velocity.X = npc.velocity.X * 0.94f; + if ((double)npc.velocity.X > -0.2 && (double)npc.velocity.X < 0.2) + { + npc.velocity.X = 0f; + } + } + npc.velocity.Y = npc.velocity.Y + 0.3f; + if (npc.velocity.Y > 10f) + { + npc.velocity.Y = 10f; + } + npc.ai[0] = 1f; + } + npc.rotation = npc.velocity.X * 0.05f; + if ((double)npc.rotation < -0.1) + { + npc.rotation = -0.1f; + } + if ((double)npc.rotation > 0.1) + { + npc.rotation = 0.1f; + return; + } + } + + public override void FindFrame(int frameHeight) + { + if (!npc.wet) + { + npc.frameCounter = 0.0; + return; + } + npc.frameCounter += 0.075f; + npc.frameCounter %= Main.npcFrameCount[npc.type]; + int frame = (int)npc.frameCounter; + npc.frame.Y = frame * frameHeight; + } + + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + if (spawnInfo.player.GetModPlayer(mod).ZoneSunkenSea && spawnInfo.water && !spawnInfo.player.GetModPlayer(mod).clamity) + { + return SpawnCondition.CaveJellyfish.Chance * 0.6f; + } + return 0f; + } + + public override void HitEffect(int hitDirection, double damage) + { + for (int k = 0; k < 5; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 68, hitDirection, -1f, 0, default(Color), 1f); + } + } + } +} \ No newline at end of file diff --git a/NPCs/SunkenSeaNPCs/SeaMinnow.png b/NPCs/SunkenSeaNPCs/SeaMinnow.png new file mode 100644 index 0000000000..456d61faab Binary files /dev/null and b/NPCs/SunkenSeaNPCs/SeaMinnow.png differ diff --git a/NPCs/SunkenSeaNPCs/SeaSerpent1.cs b/NPCs/SunkenSeaNPCs/SeaSerpent1.cs new file mode 100644 index 0000000000..e34073e04c --- /dev/null +++ b/NPCs/SunkenSeaNPCs/SeaSerpent1.cs @@ -0,0 +1,432 @@ +using System; +using System.Collections.Generic; +using System.IO; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Projectiles; +using Terraria.World.Generation; +using Terraria.GameContent.Generation; +using CalamityMod.Tiles; + +namespace CalamityMod.NPCs.SunkenSeaNPCs +{ + public class SeaSerpent1 : ModNPC + { + public bool flies = true; + public const int maxLength = 9; + public float speed = 6f; + public float turnSpeed = 0.125f; + bool TailSpawned = false; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sea Serpent"); + } + + public override void SetDefaults() + { + npc.damage = 50; + npc.width = 50; //42 + npc.height = 24; //32 + npc.defense = 10; + npc.lifeMax = 3000; + npc.aiStyle = -1; + aiType = -1; + npc.knockBackResist = 0f; + npc.value = Item.buyPrice(0, 0, 20, 0); + for (int k = 0; k < npc.buffImmune.Length; k++) + { + npc.buffImmune[k] = true; + } + npc.behindTiles = true; + npc.noGravity = true; + npc.noTileCollide = true; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath1; + npc.netAlways = true; + banner = npc.type; + bannerItem = mod.ItemType("SeaSerpentBanner"); + } + + public override void AI() + { + Lighting.AddLight(npc.Center, ((255 - npc.alpha) * 0f) / 255f, ((255 - npc.alpha) * 0.30f) / 255f, ((255 - npc.alpha) * 0.30f) / 255f); + if (npc.ai[3] > 0f) + { + npc.realLife = (int)npc.ai[3]; + } + if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead) + { + npc.TargetClosest(true); + } + npc.velocity.Length(); + if (Main.netMode != 1) + { + if (!TailSpawned && npc.ai[0] == 0f) + { + int Previous = npc.whoAmI; + for (int segment = 0; segment < maxLength; segment++) + { + int lol = 0; + if (segment == 0 || segment == 1 || segment == 4 || segment == 5) + { + lol = NPC.NewNPC((int)npc.position.X + (npc.width / 2), (int)npc.position.Y + (npc.height / 2), mod.NPCType("SeaSerpent2"), npc.whoAmI); + } + else if (segment == 2 || segment == 3 || segment == 6) + { + lol = NPC.NewNPC((int)npc.position.X + (npc.width / 2), (int)npc.position.Y + (npc.height / 2), mod.NPCType("SeaSerpent3"), npc.whoAmI); + } + else if (segment == 7) + { + lol = NPC.NewNPC((int)npc.position.X + (npc.width / 2), (int)npc.position.Y + (npc.height / 2), mod.NPCType("SeaSerpent4"), npc.whoAmI); + } + else if (segment == 8) + { + lol = NPC.NewNPC((int)npc.position.X + (npc.width / 2), (int)npc.position.Y + (npc.height / 2), mod.NPCType("SeaSerpent5"), npc.whoAmI); + } + Main.npc[lol].realLife = npc.whoAmI; + Main.npc[lol].ai[2] = (float)npc.whoAmI; + Main.npc[lol].ai[1] = (float)Previous; + Main.npc[Previous].ai[0] = (float)lol; + NetMessage.SendData(23, -1, -1, null, lol, 0f, 0f, 0f, 0); + Previous = lol; + } + TailSpawned = true; + } + } + int num180 = (int)(npc.position.X / 16f) - 1; + int num181 = (int)((npc.position.X + (float)npc.width) / 16f) + 2; + int num182 = (int)(npc.position.Y / 16f) - 1; + int num183 = (int)((npc.position.Y + (float)npc.height) / 16f) + 2; + if (num180 < 0) + { + num180 = 0; + } + if (num181 > Main.maxTilesX) + { + num181 = Main.maxTilesX; + } + if (num182 < 0) + { + num182 = 0; + } + if (num183 > Main.maxTilesY) + { + num183 = Main.maxTilesY; + } + if (npc.velocity.X < 0f) + { + npc.spriteDirection = -1; + } + else if (npc.velocity.X > 0f) + { + npc.spriteDirection = 1; + } + npc.localAI[1] = 0f; + bool canFly = flies; + if (Main.player[npc.target].dead) + { + npc.TargetClosest(false); + } + npc.alpha -= 42; + if (npc.alpha < 0) + { + npc.alpha = 0; + } + if (Vector2.Distance(Main.player[npc.target].Center, npc.Center) > 5600f || !NPC.AnyNPCs(mod.NPCType("SeaSerpent5"))) + { + npc.active = false; + } + float num188 = speed; + float num189 = turnSpeed; + Vector2 vector18 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float num191 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2); + float num192 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2); + int num42 = -1; + int num43 = (int)(Main.player[npc.target].Center.X / 16f); + int num44 = (int)(Main.player[npc.target].Center.Y / 16f); + for (int num45 = num43 - 2; num45 <= num43 + 2; num45++) + { + for (int num46 = num44; num46 <= num44 + 15; num46++) + { + if (WorldGen.SolidTile2(num45, num46)) + { + num42 = num46; + break; + } + } + if (num42 > 0) + { + break; + } + } + if (num42 > 0) + { + num42 *= 16; + float num47 = (float)(num42 - 200); //800 + if ((Main.player[npc.target].Center - npc.Center).Length() > 250f) + { + num192 = num47; + if (Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) < 250f) + { + if (npc.velocity.X > 0f) + { + num191 = Main.player[npc.target].Center.X + 300f; + } + else + { + num191 = Main.player[npc.target].Center.X - 300f; + } + } + } + } + float num48 = num188 * 1.3f; + float num49 = num188 * 0.7f; + float num50 = npc.velocity.Length(); + if (num50 > 0f) + { + if (num50 > num48) + { + npc.velocity.Normalize(); + npc.velocity *= num48; + } + else if (num50 < num49) + { + npc.velocity.Normalize(); + npc.velocity *= num49; + } + } + if ((Main.player[npc.target].Center - npc.Center).Length() > 250f) + { + for (int num51 = 0; num51 < 200; num51++) + { + if (Main.npc[num51].active && Main.npc[num51].type == npc.type && num51 != npc.whoAmI) + { + Vector2 vector3 = Main.npc[num51].Center - npc.Center; + if (vector3.Length() < 400f) + { + vector3.Normalize(); + vector3 *= 1000f; + num191 -= vector3.X; + num192 -= vector3.Y; + } + } + } + } + else + { + for (int num52 = 0; num52 < 200; num52++) + { + if (Main.npc[num52].active && Main.npc[num52].type == npc.type && num52 != npc.whoAmI) + { + Vector2 vector4 = Main.npc[num52].Center - npc.Center; + if (vector4.Length() < 60f) + { + vector4.Normalize(); + vector4 *= 200f; + num191 -= vector4.X; + num192 -= vector4.Y; + } + } + } + } + num191 = (float)((int)(num191 / 16f) * 16); + num192 = (float)((int)(num192 / 16f) * 16); + vector18.X = (float)((int)(vector18.X / 16f) * 16); + vector18.Y = (float)((int)(vector18.Y / 16f) * 16); + num191 -= vector18.X; + num192 -= vector18.Y; + float num193 = (float)System.Math.Sqrt((double)(num191 * num191 + num192 * num192)); + if (npc.ai[1] > 0f && npc.ai[1] < (float)Main.npc.Length) + { + try + { + vector18 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + num191 = Main.npc[(int)npc.ai[1]].position.X + (float)(Main.npc[(int)npc.ai[1]].width / 2) - vector18.X; + num192 = Main.npc[(int)npc.ai[1]].position.Y + (float)(Main.npc[(int)npc.ai[1]].height / 2) - vector18.Y; + } + catch + { + } + npc.rotation = (float)System.Math.Atan2((double)num192, (double)num191) + 1.57f; + num193 = (float)System.Math.Sqrt((double)(num191 * num191 + num192 * num192)); + int num194 = npc.width; + num193 = (num193 - (float)num194) / num193; + num191 *= num193; + num192 *= num193; + npc.velocity = Vector2.Zero; + npc.position.X = npc.position.X + num191; + npc.position.Y = npc.position.Y + num192; + if (num191 < 0f) + { + npc.spriteDirection = -1; + } + else if (num191 > 0f) + { + npc.spriteDirection = 1; + } + } + else + { + num193 = (float)System.Math.Sqrt((double)(num191 * num191 + num192 * num192)); + float num196 = System.Math.Abs(num191); + float num197 = System.Math.Abs(num192); + float num198 = num188 / num193; + num191 *= num198; + num192 *= num198; + if ((npc.velocity.X > 0f && num191 > 0f) || (npc.velocity.X < 0f && num191 < 0f) || (npc.velocity.Y > 0f && num192 > 0f) || (npc.velocity.Y < 0f && num192 < 0f)) + { + if (npc.velocity.X < num191) + { + npc.velocity.X = npc.velocity.X + num189; + } + else + { + if (npc.velocity.X > num191) + { + npc.velocity.X = npc.velocity.X - num189; + } + } + if (npc.velocity.Y < num192) + { + npc.velocity.Y = npc.velocity.Y + num189; + } + else + { + if (npc.velocity.Y > num192) + { + npc.velocity.Y = npc.velocity.Y - num189; + } + } + if ((double)System.Math.Abs(num192) < (double)num188 * 0.2 && ((npc.velocity.X > 0f && num191 < 0f) || (npc.velocity.X < 0f && num191 > 0f))) + { + if (npc.velocity.Y > 0f) + { + npc.velocity.Y = npc.velocity.Y + num189 * 2f; + } + else + { + npc.velocity.Y = npc.velocity.Y - num189 * 2f; + } + } + if ((double)System.Math.Abs(num191) < (double)num188 * 0.2 && ((npc.velocity.Y > 0f && num192 < 0f) || (npc.velocity.Y < 0f && num192 > 0f))) + { + if (npc.velocity.X > 0f) + { + npc.velocity.X = npc.velocity.X + num189 * 2f; //changed from 2 + } + else + { + npc.velocity.X = npc.velocity.X - num189 * 2f; //changed from 2 + } + } + } + else + { + if (num196 > num197) + { + if (npc.velocity.X < num191) + { + npc.velocity.X = npc.velocity.X + num189 * 1.1f; //changed from 1.1 + } + else if (npc.velocity.X > num191) + { + npc.velocity.X = npc.velocity.X - num189 * 1.1f; //changed from 1.1 + } + if ((double)(System.Math.Abs(npc.velocity.X) + System.Math.Abs(npc.velocity.Y)) < (double)num188 * 0.5) + { + if (npc.velocity.Y > 0f) + { + npc.velocity.Y = npc.velocity.Y + num189; + } + else + { + npc.velocity.Y = npc.velocity.Y - num189; + } + } + } + else + { + if (npc.velocity.Y < num192) + { + npc.velocity.Y = npc.velocity.Y + num189 * 1.1f; + } + else if (npc.velocity.Y > num192) + { + npc.velocity.Y = npc.velocity.Y - num189 * 1.1f; + } + if ((double)(System.Math.Abs(npc.velocity.X) + System.Math.Abs(npc.velocity.Y)) < (double)num188 * 0.5) + { + if (npc.velocity.X > 0f) + { + npc.velocity.X = npc.velocity.X + num189; + } + else + { + npc.velocity.X = npc.velocity.X - num189; + } + } + } + } + } + npc.rotation = (float)System.Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X) + 1.57f; + } + + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + if (Main.hardMode && spawnInfo.player.GetModPlayer(mod).ZoneSunkenSea && spawnInfo.water && !NPC.AnyNPCs(mod.NPCType("SeaSerpent1"))) + { + return SpawnCondition.CaveJellyfish.Chance * 0.3f; + } + return 0f; + } + + public override void NPCLoot() + { + if (Main.rand.Next(4) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Serpentine")); + } + } + + public override void HitEffect(int hitDirection, double damage) + { + for (int k = 0; k < 3; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 37, hitDirection, -1f, 0, default(Color), 1f); + } + if (npc.life <= 0) + { + for (int k = 0; k < 10; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 37, hitDirection, -1f, 0, default(Color), 1f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SeaSerpent/SeaSerpentGore1"), 1f); + } + } + + public override bool CheckActive() + { + if (npc.timeLeft <= 0 && Main.netMode != 1) + { + for (int k = (int)npc.ai[0]; k > 0; k = (int)Main.npc[k].ai[0]) + { + if (Main.npc[k].active) + { + Main.npc[k].active = false; + if (Main.netMode == 2) + { + Main.npc[k].life = 0; + Main.npc[k].netSkip = -1; + NetMessage.SendData(23, -1, -1, null, k, 0f, 0f, 0f, 0, 0, 0); + } + } + } + } + return true; + } + } +} \ No newline at end of file diff --git a/NPCs/SunkenSeaNPCs/SeaSerpent1.png b/NPCs/SunkenSeaNPCs/SeaSerpent1.png new file mode 100644 index 0000000000..0e144e18e2 Binary files /dev/null and b/NPCs/SunkenSeaNPCs/SeaSerpent1.png differ diff --git a/NPCs/SunkenSeaNPCs/SeaSerpent2.cs b/NPCs/SunkenSeaNPCs/SeaSerpent2.cs new file mode 100644 index 0000000000..0cbe7ce823 --- /dev/null +++ b/NPCs/SunkenSeaNPCs/SeaSerpent2.cs @@ -0,0 +1,298 @@ +using System; +using System.Collections.Generic; +using System.IO; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Projectiles; + +namespace CalamityMod.NPCs.SunkenSeaNPCs +{ + public class SeaSerpent2 : ModNPC + { + public float speed = 6f; + public float turnSpeed = 0.125f; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sea Serpent"); + } + + public override void SetDefaults() + { + npc.damage = 40; + npc.width = 24; //42 + npc.height = 16; //24 + npc.defense = 20; + npc.lifeMax = 3000; + npc.aiStyle = -1; //new + aiType = -1; //new + npc.knockBackResist = 0f; + npc.alpha = 255; + for (int k = 0; k < npc.buffImmune.Length; k++) + { + npc.buffImmune[k] = true; + } + npc.behindTiles = true; + npc.noGravity = true; + npc.noTileCollide = true; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath1; + npc.netAlways = true; + npc.dontCountMe = true; + npc.chaseable = false; + banner = mod.NPCType("SeaSerpent1"); + bannerItem = mod.ItemType("SeaSerpentBanner"); + } + + public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) + { + return false; + } + + public override void AI() + { + Lighting.AddLight(npc.Center, ((255 - npc.alpha) * 0f) / 255f, ((255 - npc.alpha) * 0.30f) / 255f, ((255 - npc.alpha) * 0.30f) / 255f); + if (npc.ai[3] > 0f) + { + npc.realLife = (int)npc.ai[3]; + } + if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead) + { + npc.TargetClosest(true); + } + npc.velocity.Length(); + if (npc.velocity.X < 0f) + { + npc.spriteDirection = -1; + } + else if (npc.velocity.X > 0f) + { + npc.spriteDirection = 1; + } + bool flag = false; + if (npc.ai[1] <= 0f) + { + flag = true; + } + else if (Main.npc[(int)npc.ai[1]].life <= 0) + { + flag = true; + } + if (flag) + { + npc.life = 0; + npc.HitEffect(0, 10.0); + npc.checkDead(); + } + if (!NPC.AnyNPCs(mod.NPCType("SeaSerpent1"))) + { + npc.active = false; + } + if (Main.npc[(int)npc.ai[1]].alpha < 128) + { + npc.alpha -= 42; + if (npc.alpha < 0) + { + npc.alpha = 0; + } + } + int num180 = (int)(npc.position.X / 16f) - 1; + int num181 = (int)((npc.position.X + (float)npc.width) / 16f) + 2; + int num182 = (int)(npc.position.Y / 16f) - 1; + int num183 = (int)((npc.position.Y + (float)npc.height) / 16f) + 2; + if (num180 < 0) + { + num180 = 0; + } + if (num181 > Main.maxTilesX) + { + num181 = Main.maxTilesX; + } + if (num182 < 0) + { + num182 = 0; + } + if (num183 > Main.maxTilesY) + { + num183 = Main.maxTilesY; + } + if (Main.player[npc.target].dead) + { + npc.TargetClosest(false); + } + float num188 = speed; + float num189 = turnSpeed; + Vector2 vector18 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float num191 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2); + float num192 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2); + num191 = (float)((int)(num191 / 16f) * 16); + num192 = (float)((int)(num192 / 16f) * 16); + vector18.X = (float)((int)(vector18.X / 16f) * 16); + vector18.Y = (float)((int)(vector18.Y / 16f) * 16); + num191 -= vector18.X; + num192 -= vector18.Y; + float num193 = (float)System.Math.Sqrt((double)(num191 * num191 + num192 * num192)); + if (npc.ai[1] > 0f && npc.ai[1] < (float)Main.npc.Length) + { + try + { + vector18 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + num191 = Main.npc[(int)npc.ai[1]].position.X + (float)(Main.npc[(int)npc.ai[1]].width / 2) - vector18.X; + num192 = Main.npc[(int)npc.ai[1]].position.Y + (float)(Main.npc[(int)npc.ai[1]].height / 2) - vector18.Y; + } + catch + { + } + npc.rotation = (float)System.Math.Atan2((double)num192, (double)num191) + 1.57f; + num193 = (float)System.Math.Sqrt((double)(num191 * num191 + num192 * num192)); + int num194 = npc.width; + num193 = (num193 - (float)num194) / num193; + num191 *= num193; + num192 *= num193; + npc.velocity = Vector2.Zero; + npc.position.X = npc.position.X + num191; + npc.position.Y = npc.position.Y + num192; + if (num191 < 0f) + { + npc.spriteDirection = -1; + } + else if (num191 > 0f) + { + npc.spriteDirection = 1; + } + } + else + { + num193 = (float)System.Math.Sqrt((double)(num191 * num191 + num192 * num192)); + float num196 = System.Math.Abs(num191); + float num197 = System.Math.Abs(num192); + float num198 = num188 / num193; + num191 *= num198; + num192 *= num198; + if ((npc.velocity.X > 0f && num191 > 0f) || (npc.velocity.X < 0f && num191 < 0f) || (npc.velocity.Y > 0f && num192 > 0f) || (npc.velocity.Y < 0f && num192 < 0f)) + { + if (npc.velocity.X < num191) + { + npc.velocity.X = npc.velocity.X + num189; + } + else + { + if (npc.velocity.X > num191) + { + npc.velocity.X = npc.velocity.X - num189; + } + } + if (npc.velocity.Y < num192) + { + npc.velocity.Y = npc.velocity.Y + num189; + } + else + { + if (npc.velocity.Y > num192) + { + npc.velocity.Y = npc.velocity.Y - num189; + } + } + if ((double)System.Math.Abs(num192) < (double)num188 * 0.2 && ((npc.velocity.X > 0f && num191 < 0f) || (npc.velocity.X < 0f && num191 > 0f))) + { + if (npc.velocity.Y > 0f) + { + npc.velocity.Y = npc.velocity.Y + num189 * 2f; + } + else + { + npc.velocity.Y = npc.velocity.Y - num189 * 2f; + } + } + if ((double)System.Math.Abs(num191) < (double)num188 * 0.2 && ((npc.velocity.Y > 0f && num192 < 0f) || (npc.velocity.Y < 0f && num192 > 0f))) + { + if (npc.velocity.X > 0f) + { + npc.velocity.X = npc.velocity.X + num189 * 2f; //changed from 2 + } + else + { + npc.velocity.X = npc.velocity.X - num189 * 2f; //changed from 2 + } + } + } + else + { + if (num196 > num197) + { + if (npc.velocity.X < num191) + { + npc.velocity.X = npc.velocity.X + num189 * 1.1f; //changed from 1.1 + } + else if (npc.velocity.X > num191) + { + npc.velocity.X = npc.velocity.X - num189 * 1.1f; //changed from 1.1 + } + if ((double)(System.Math.Abs(npc.velocity.X) + System.Math.Abs(npc.velocity.Y)) < (double)num188 * 0.5) + { + if (npc.velocity.Y > 0f) + { + npc.velocity.Y = npc.velocity.Y + num189; + } + else + { + npc.velocity.Y = npc.velocity.Y - num189; + } + } + } + else + { + if (npc.velocity.Y < num192) + { + npc.velocity.Y = npc.velocity.Y + num189 * 1.1f; + } + else if (npc.velocity.Y > num192) + { + npc.velocity.Y = npc.velocity.Y - num189 * 1.1f; + } + if ((double)(System.Math.Abs(npc.velocity.X) + System.Math.Abs(npc.velocity.Y)) < (double)num188 * 0.5) + { + if (npc.velocity.X > 0f) + { + npc.velocity.X = npc.velocity.X + num189; + } + else + { + npc.velocity.X = npc.velocity.X - num189; + } + } + } + } + } + } + + public override bool CheckActive() + { + return false; + } + + public override bool PreNPCLoot() + { + return false; + } + + public override void HitEffect(int hitDirection, double damage) + { + for (int k = 0; k < 3; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 37, hitDirection, -1f, 0, default(Color), 1f); + } + if (npc.life <= 0) + { + for (int k = 0; k < 10; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 37, hitDirection, -1f, 0, default(Color), 1f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SeaSerpent/SeaSerpentGore2"), 1f); + } + } + } +} \ No newline at end of file diff --git a/NPCs/SunkenSeaNPCs/SeaSerpent2.png b/NPCs/SunkenSeaNPCs/SeaSerpent2.png new file mode 100644 index 0000000000..bdb5c315db Binary files /dev/null and b/NPCs/SunkenSeaNPCs/SeaSerpent2.png differ diff --git a/NPCs/SunkenSeaNPCs/SeaSerpent3.cs b/NPCs/SunkenSeaNPCs/SeaSerpent3.cs new file mode 100644 index 0000000000..4f3c7760df --- /dev/null +++ b/NPCs/SunkenSeaNPCs/SeaSerpent3.cs @@ -0,0 +1,298 @@ +using System; +using System.Collections.Generic; +using System.IO; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Projectiles; + +namespace CalamityMod.NPCs.SunkenSeaNPCs +{ + public class SeaSerpent3 : ModNPC + { + public float speed = 6f; + public float turnSpeed = 0.125f; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sea Serpent"); + } + + public override void SetDefaults() + { + npc.damage = 40; + npc.width = 24; //42 + npc.height = 16; //24 + npc.defense = 20; + npc.lifeMax = 3000; + npc.aiStyle = -1; //new + aiType = -1; //new + npc.knockBackResist = 0f; + npc.alpha = 255; + for (int k = 0; k < npc.buffImmune.Length; k++) + { + npc.buffImmune[k] = true; + } + npc.behindTiles = true; + npc.noGravity = true; + npc.noTileCollide = true; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath1; + npc.netAlways = true; + npc.dontCountMe = true; + npc.chaseable = false; + banner = mod.NPCType("SeaSerpent1"); + bannerItem = mod.ItemType("SeaSerpentBanner"); + } + + public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) + { + return false; + } + + public override void AI() + { + Lighting.AddLight(npc.Center, ((255 - npc.alpha) * 0f) / 255f, ((255 - npc.alpha) * 0.30f) / 255f, ((255 - npc.alpha) * 0.30f) / 255f); + if (npc.ai[3] > 0f) + { + npc.realLife = (int)npc.ai[3]; + } + if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead) + { + npc.TargetClosest(true); + } + npc.velocity.Length(); + if (npc.velocity.X < 0f) + { + npc.spriteDirection = -1; + } + else if (npc.velocity.X > 0f) + { + npc.spriteDirection = 1; + } + bool flag = false; + if (npc.ai[1] <= 0f) + { + flag = true; + } + else if (Main.npc[(int)npc.ai[1]].life <= 0) + { + flag = true; + } + if (flag) + { + npc.life = 0; + npc.HitEffect(0, 10.0); + npc.checkDead(); + } + if (!NPC.AnyNPCs(mod.NPCType("SeaSerpent1"))) + { + npc.active = false; + } + if (Main.npc[(int)npc.ai[1]].alpha < 128) + { + npc.alpha -= 42; + if (npc.alpha < 0) + { + npc.alpha = 0; + } + } + int num180 = (int)(npc.position.X / 16f) - 1; + int num181 = (int)((npc.position.X + (float)npc.width) / 16f) + 2; + int num182 = (int)(npc.position.Y / 16f) - 1; + int num183 = (int)((npc.position.Y + (float)npc.height) / 16f) + 2; + if (num180 < 0) + { + num180 = 0; + } + if (num181 > Main.maxTilesX) + { + num181 = Main.maxTilesX; + } + if (num182 < 0) + { + num182 = 0; + } + if (num183 > Main.maxTilesY) + { + num183 = Main.maxTilesY; + } + if (Main.player[npc.target].dead) + { + npc.TargetClosest(false); + } + float num188 = speed; + float num189 = turnSpeed; + Vector2 vector18 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float num191 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2); + float num192 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2); + num191 = (float)((int)(num191 / 16f) * 16); + num192 = (float)((int)(num192 / 16f) * 16); + vector18.X = (float)((int)(vector18.X / 16f) * 16); + vector18.Y = (float)((int)(vector18.Y / 16f) * 16); + num191 -= vector18.X; + num192 -= vector18.Y; + float num193 = (float)System.Math.Sqrt((double)(num191 * num191 + num192 * num192)); + if (npc.ai[1] > 0f && npc.ai[1] < (float)Main.npc.Length) + { + try + { + vector18 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + num191 = Main.npc[(int)npc.ai[1]].position.X + (float)(Main.npc[(int)npc.ai[1]].width / 2) - vector18.X; + num192 = Main.npc[(int)npc.ai[1]].position.Y + (float)(Main.npc[(int)npc.ai[1]].height / 2) - vector18.Y; + } + catch + { + } + npc.rotation = (float)System.Math.Atan2((double)num192, (double)num191) + 1.57f; + num193 = (float)System.Math.Sqrt((double)(num191 * num191 + num192 * num192)); + int num194 = npc.width; + num193 = (num193 - (float)num194) / num193; + num191 *= num193; + num192 *= num193; + npc.velocity = Vector2.Zero; + npc.position.X = npc.position.X + num191; + npc.position.Y = npc.position.Y + num192; + if (num191 < 0f) + { + npc.spriteDirection = -1; + } + else if (num191 > 0f) + { + npc.spriteDirection = 1; + } + } + else + { + num193 = (float)System.Math.Sqrt((double)(num191 * num191 + num192 * num192)); + float num196 = System.Math.Abs(num191); + float num197 = System.Math.Abs(num192); + float num198 = num188 / num193; + num191 *= num198; + num192 *= num198; + if ((npc.velocity.X > 0f && num191 > 0f) || (npc.velocity.X < 0f && num191 < 0f) || (npc.velocity.Y > 0f && num192 > 0f) || (npc.velocity.Y < 0f && num192 < 0f)) + { + if (npc.velocity.X < num191) + { + npc.velocity.X = npc.velocity.X + num189; + } + else + { + if (npc.velocity.X > num191) + { + npc.velocity.X = npc.velocity.X - num189; + } + } + if (npc.velocity.Y < num192) + { + npc.velocity.Y = npc.velocity.Y + num189; + } + else + { + if (npc.velocity.Y > num192) + { + npc.velocity.Y = npc.velocity.Y - num189; + } + } + if ((double)System.Math.Abs(num192) < (double)num188 * 0.2 && ((npc.velocity.X > 0f && num191 < 0f) || (npc.velocity.X < 0f && num191 > 0f))) + { + if (npc.velocity.Y > 0f) + { + npc.velocity.Y = npc.velocity.Y + num189 * 2f; + } + else + { + npc.velocity.Y = npc.velocity.Y - num189 * 2f; + } + } + if ((double)System.Math.Abs(num191) < (double)num188 * 0.2 && ((npc.velocity.Y > 0f && num192 < 0f) || (npc.velocity.Y < 0f && num192 > 0f))) + { + if (npc.velocity.X > 0f) + { + npc.velocity.X = npc.velocity.X + num189 * 2f; //changed from 2 + } + else + { + npc.velocity.X = npc.velocity.X - num189 * 2f; //changed from 2 + } + } + } + else + { + if (num196 > num197) + { + if (npc.velocity.X < num191) + { + npc.velocity.X = npc.velocity.X + num189 * 1.1f; //changed from 1.1 + } + else if (npc.velocity.X > num191) + { + npc.velocity.X = npc.velocity.X - num189 * 1.1f; //changed from 1.1 + } + if ((double)(System.Math.Abs(npc.velocity.X) + System.Math.Abs(npc.velocity.Y)) < (double)num188 * 0.5) + { + if (npc.velocity.Y > 0f) + { + npc.velocity.Y = npc.velocity.Y + num189; + } + else + { + npc.velocity.Y = npc.velocity.Y - num189; + } + } + } + else + { + if (npc.velocity.Y < num192) + { + npc.velocity.Y = npc.velocity.Y + num189 * 1.1f; + } + else if (npc.velocity.Y > num192) + { + npc.velocity.Y = npc.velocity.Y - num189 * 1.1f; + } + if ((double)(System.Math.Abs(npc.velocity.X) + System.Math.Abs(npc.velocity.Y)) < (double)num188 * 0.5) + { + if (npc.velocity.X > 0f) + { + npc.velocity.X = npc.velocity.X + num189; + } + else + { + npc.velocity.X = npc.velocity.X - num189; + } + } + } + } + } + } + + public override bool CheckActive() + { + return false; + } + + public override bool PreNPCLoot() + { + return false; + } + + public override void HitEffect(int hitDirection, double damage) + { + for (int k = 0; k < 3; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 37, hitDirection, -1f, 0, default(Color), 1f); + } + if (npc.life <= 0) + { + for (int k = 0; k < 10; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 37, hitDirection, -1f, 0, default(Color), 1f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SeaSerpent/SeaSerpentGore3"), 1f); + } + } + } +} \ No newline at end of file diff --git a/NPCs/SunkenSeaNPCs/SeaSerpent3.png b/NPCs/SunkenSeaNPCs/SeaSerpent3.png new file mode 100644 index 0000000000..3ca49fc95e Binary files /dev/null and b/NPCs/SunkenSeaNPCs/SeaSerpent3.png differ diff --git a/NPCs/SunkenSeaNPCs/SeaSerpent4.cs b/NPCs/SunkenSeaNPCs/SeaSerpent4.cs new file mode 100644 index 0000000000..0d36745a53 --- /dev/null +++ b/NPCs/SunkenSeaNPCs/SeaSerpent4.cs @@ -0,0 +1,298 @@ +using System; +using System.Collections.Generic; +using System.IO; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Projectiles; + +namespace CalamityMod.NPCs.SunkenSeaNPCs +{ + public class SeaSerpent4 : ModNPC + { + public float speed = 6f; + public float turnSpeed = 0.125f; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sea Serpent"); + } + + public override void SetDefaults() + { + npc.damage = 30; + npc.width = 28; //42 + npc.height = 24; //34 + npc.defense = 20; + npc.lifeMax = 3000; + npc.aiStyle = -1; //new + aiType = -1; //new + npc.knockBackResist = 0f; + npc.alpha = 255; + for (int k = 0; k < npc.buffImmune.Length; k++) + { + npc.buffImmune[k] = true; + } + npc.behindTiles = true; + npc.noGravity = true; + npc.noTileCollide = true; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath1; + npc.netAlways = true; + npc.dontCountMe = true; + npc.chaseable = false; + banner = mod.NPCType("SeaSerpent1"); + bannerItem = mod.ItemType("SeaSerpentBanner"); + } + + public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) + { + return false; + } + + public override void AI() + { + Lighting.AddLight(npc.Center, ((255 - npc.alpha) * 0f) / 255f, ((255 - npc.alpha) * 0.30f) / 255f, ((255 - npc.alpha) * 0.30f) / 255f); + if (npc.ai[3] > 0f) + { + npc.realLife = (int)npc.ai[3]; + } + if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead) + { + npc.TargetClosest(true); + } + npc.velocity.Length(); + if (npc.velocity.X < 0f) + { + npc.spriteDirection = -1; + } + else if (npc.velocity.X > 0f) + { + npc.spriteDirection = 1; + } + bool flag = false; + if (npc.ai[1] <= 0f) + { + flag = true; + } + else if (Main.npc[(int)npc.ai[1]].life <= 0) + { + flag = true; + } + if (flag) + { + npc.life = 0; + npc.HitEffect(0, 10.0); + npc.checkDead(); + } + if (!NPC.AnyNPCs(mod.NPCType("SeaSerpent1"))) + { + npc.active = false; + } + if (Main.npc[(int)npc.ai[1]].alpha < 128) + { + npc.alpha -= 42; + if (npc.alpha < 0) + { + npc.alpha = 0; + } + } + int num180 = (int)(npc.position.X / 16f) - 1; + int num181 = (int)((npc.position.X + (float)npc.width) / 16f) + 2; + int num182 = (int)(npc.position.Y / 16f) - 1; + int num183 = (int)((npc.position.Y + (float)npc.height) / 16f) + 2; + if (num180 < 0) + { + num180 = 0; + } + if (num181 > Main.maxTilesX) + { + num181 = Main.maxTilesX; + } + if (num182 < 0) + { + num182 = 0; + } + if (num183 > Main.maxTilesY) + { + num183 = Main.maxTilesY; + } + if (Main.player[npc.target].dead) + { + npc.TargetClosest(false); + } + float num188 = speed; + float num189 = turnSpeed; + Vector2 vector18 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float num191 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2); + float num192 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2); + num191 = (float)((int)(num191 / 16f) * 16); + num192 = (float)((int)(num192 / 16f) * 16); + vector18.X = (float)((int)(vector18.X / 16f) * 16); + vector18.Y = (float)((int)(vector18.Y / 16f) * 16); + num191 -= vector18.X; + num192 -= vector18.Y; + float num193 = (float)System.Math.Sqrt((double)(num191 * num191 + num192 * num192)); + if (npc.ai[1] > 0f && npc.ai[1] < (float)Main.npc.Length) + { + try + { + vector18 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + num191 = Main.npc[(int)npc.ai[1]].position.X + (float)(Main.npc[(int)npc.ai[1]].width / 2) - vector18.X; + num192 = Main.npc[(int)npc.ai[1]].position.Y + (float)(Main.npc[(int)npc.ai[1]].height / 2) - vector18.Y; + } + catch + { + } + npc.rotation = (float)System.Math.Atan2((double)num192, (double)num191) + 1.57f; + num193 = (float)System.Math.Sqrt((double)(num191 * num191 + num192 * num192)); + int num194 = npc.width; + num193 = (num193 - (float)num194) / num193; + num191 *= num193; + num192 *= num193; + npc.velocity = Vector2.Zero; + npc.position.X = npc.position.X + num191; + npc.position.Y = npc.position.Y + num192; + if (num191 < 0f) + { + npc.spriteDirection = -1; + } + else if (num191 > 0f) + { + npc.spriteDirection = 1; + } + } + else + { + num193 = (float)System.Math.Sqrt((double)(num191 * num191 + num192 * num192)); + float num196 = System.Math.Abs(num191); + float num197 = System.Math.Abs(num192); + float num198 = num188 / num193; + num191 *= num198; + num192 *= num198; + if ((npc.velocity.X > 0f && num191 > 0f) || (npc.velocity.X < 0f && num191 < 0f) || (npc.velocity.Y > 0f && num192 > 0f) || (npc.velocity.Y < 0f && num192 < 0f)) + { + if (npc.velocity.X < num191) + { + npc.velocity.X = npc.velocity.X + num189; + } + else + { + if (npc.velocity.X > num191) + { + npc.velocity.X = npc.velocity.X - num189; + } + } + if (npc.velocity.Y < num192) + { + npc.velocity.Y = npc.velocity.Y + num189; + } + else + { + if (npc.velocity.Y > num192) + { + npc.velocity.Y = npc.velocity.Y - num189; + } + } + if ((double)System.Math.Abs(num192) < (double)num188 * 0.2 && ((npc.velocity.X > 0f && num191 < 0f) || (npc.velocity.X < 0f && num191 > 0f))) + { + if (npc.velocity.Y > 0f) + { + npc.velocity.Y = npc.velocity.Y + num189 * 2f; + } + else + { + npc.velocity.Y = npc.velocity.Y - num189 * 2f; + } + } + if ((double)System.Math.Abs(num191) < (double)num188 * 0.2 && ((npc.velocity.Y > 0f && num192 < 0f) || (npc.velocity.Y < 0f && num192 > 0f))) + { + if (npc.velocity.X > 0f) + { + npc.velocity.X = npc.velocity.X + num189 * 2f; //changed from 2 + } + else + { + npc.velocity.X = npc.velocity.X - num189 * 2f; //changed from 2 + } + } + } + else + { + if (num196 > num197) + { + if (npc.velocity.X < num191) + { + npc.velocity.X = npc.velocity.X + num189 * 1.1f; //changed from 1.1 + } + else if (npc.velocity.X > num191) + { + npc.velocity.X = npc.velocity.X - num189 * 1.1f; //changed from 1.1 + } + if ((double)(System.Math.Abs(npc.velocity.X) + System.Math.Abs(npc.velocity.Y)) < (double)num188 * 0.5) + { + if (npc.velocity.Y > 0f) + { + npc.velocity.Y = npc.velocity.Y + num189; + } + else + { + npc.velocity.Y = npc.velocity.Y - num189; + } + } + } + else + { + if (npc.velocity.Y < num192) + { + npc.velocity.Y = npc.velocity.Y + num189 * 1.1f; + } + else if (npc.velocity.Y > num192) + { + npc.velocity.Y = npc.velocity.Y - num189 * 1.1f; + } + if ((double)(System.Math.Abs(npc.velocity.X) + System.Math.Abs(npc.velocity.Y)) < (double)num188 * 0.5) + { + if (npc.velocity.X > 0f) + { + npc.velocity.X = npc.velocity.X + num189; + } + else + { + npc.velocity.X = npc.velocity.X - num189; + } + } + } + } + } + } + + public override bool CheckActive() + { + return false; + } + + public override bool PreNPCLoot() + { + return false; + } + + public override void HitEffect(int hitDirection, double damage) + { + for (int k = 0; k < 3; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 37, hitDirection, -1f, 0, default(Color), 1f); + } + if (npc.life <= 0) + { + for (int k = 0; k < 10; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 37, hitDirection, -1f, 0, default(Color), 1f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SeaSerpent/SeaSerpentGore4"), 1f); + } + } + } +} \ No newline at end of file diff --git a/NPCs/SunkenSeaNPCs/SeaSerpent4.png b/NPCs/SunkenSeaNPCs/SeaSerpent4.png new file mode 100644 index 0000000000..5625d8cf2d Binary files /dev/null and b/NPCs/SunkenSeaNPCs/SeaSerpent4.png differ diff --git a/NPCs/SunkenSeaNPCs/SeaSerpent5.cs b/NPCs/SunkenSeaNPCs/SeaSerpent5.cs new file mode 100644 index 0000000000..736a97d2b2 --- /dev/null +++ b/NPCs/SunkenSeaNPCs/SeaSerpent5.cs @@ -0,0 +1,298 @@ +using System; +using System.Collections.Generic; +using System.IO; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Projectiles; + +namespace CalamityMod.NPCs.SunkenSeaNPCs +{ + public class SeaSerpent5 : ModNPC + { + public float speed = 6f; + public float turnSpeed = 0.125f; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sea Serpent"); + } + + public override void SetDefaults() + { + npc.damage = 20; + npc.width = 36; //42 + npc.height = 30; //40 + npc.defense = 30; + npc.lifeMax = 3000; + npc.aiStyle = -1; //new + aiType = -1; //new + npc.knockBackResist = 0f; + npc.alpha = 255; + for (int k = 0; k < npc.buffImmune.Length; k++) + { + npc.buffImmune[k] = true; + } + npc.behindTiles = true; + npc.noGravity = true; + npc.noTileCollide = true; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath1; + npc.netAlways = true; + npc.dontCountMe = true; + npc.chaseable = false; + banner = mod.NPCType("SeaSerpent1"); + bannerItem = mod.ItemType("SeaSerpentBanner"); + } + + public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) + { + return false; + } + + public override void AI() + { + Lighting.AddLight(npc.Center, ((255 - npc.alpha) * 0f) / 255f, ((255 - npc.alpha) * 0.30f) / 255f, ((255 - npc.alpha) * 0.30f) / 255f); + if (npc.ai[3] > 0f) + { + npc.realLife = (int)npc.ai[3]; + } + if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead) + { + npc.TargetClosest(true); + } + npc.velocity.Length(); + if (npc.velocity.X < 0f) + { + npc.spriteDirection = -1; + } + else if (npc.velocity.X > 0f) + { + npc.spriteDirection = 1; + } + bool flag = false; + if (npc.ai[1] <= 0f) + { + flag = true; + } + else if (Main.npc[(int)npc.ai[1]].life <= 0) + { + flag = true; + } + if (flag) + { + npc.life = 0; + npc.HitEffect(0, 10.0); + npc.checkDead(); + } + if (!NPC.AnyNPCs(mod.NPCType("SeaSerpent1"))) + { + npc.active = false; + } + if (Main.npc[(int)npc.ai[1]].alpha < 128) + { + npc.alpha -= 42; + if (npc.alpha < 0) + { + npc.alpha = 0; + } + } + int num180 = (int)(npc.position.X / 16f) - 1; + int num181 = (int)((npc.position.X + (float)npc.width) / 16f) + 2; + int num182 = (int)(npc.position.Y / 16f) - 1; + int num183 = (int)((npc.position.Y + (float)npc.height) / 16f) + 2; + if (num180 < 0) + { + num180 = 0; + } + if (num181 > Main.maxTilesX) + { + num181 = Main.maxTilesX; + } + if (num182 < 0) + { + num182 = 0; + } + if (num183 > Main.maxTilesY) + { + num183 = Main.maxTilesY; + } + if (Main.player[npc.target].dead) + { + npc.TargetClosest(false); + } + float num188 = speed; + float num189 = turnSpeed; + Vector2 vector18 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float num191 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2); + float num192 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2); + num191 = (float)((int)(num191 / 16f) * 16); + num192 = (float)((int)(num192 / 16f) * 16); + vector18.X = (float)((int)(vector18.X / 16f) * 16); + vector18.Y = (float)((int)(vector18.Y / 16f) * 16); + num191 -= vector18.X; + num192 -= vector18.Y; + float num193 = (float)System.Math.Sqrt((double)(num191 * num191 + num192 * num192)); + if (npc.ai[1] > 0f && npc.ai[1] < (float)Main.npc.Length) + { + try + { + vector18 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + num191 = Main.npc[(int)npc.ai[1]].position.X + (float)(Main.npc[(int)npc.ai[1]].width / 2) - vector18.X; + num192 = Main.npc[(int)npc.ai[1]].position.Y + (float)(Main.npc[(int)npc.ai[1]].height / 2) - vector18.Y; + } + catch + { + } + npc.rotation = (float)System.Math.Atan2((double)num192, (double)num191) + 1.57f; + num193 = (float)System.Math.Sqrt((double)(num191 * num191 + num192 * num192)); + int num194 = npc.width; + num193 = (num193 - (float)num194) / num193; + num191 *= num193; + num192 *= num193; + npc.velocity = Vector2.Zero; + npc.position.X = npc.position.X + num191; + npc.position.Y = npc.position.Y + num192; + if (num191 < 0f) + { + npc.spriteDirection = -1; + } + else if (num191 > 0f) + { + npc.spriteDirection = 1; + } + } + else + { + num193 = (float)System.Math.Sqrt((double)(num191 * num191 + num192 * num192)); + float num196 = System.Math.Abs(num191); + float num197 = System.Math.Abs(num192); + float num198 = num188 / num193; + num191 *= num198; + num192 *= num198; + if ((npc.velocity.X > 0f && num191 > 0f) || (npc.velocity.X < 0f && num191 < 0f) || (npc.velocity.Y > 0f && num192 > 0f) || (npc.velocity.Y < 0f && num192 < 0f)) + { + if (npc.velocity.X < num191) + { + npc.velocity.X = npc.velocity.X + num189; + } + else + { + if (npc.velocity.X > num191) + { + npc.velocity.X = npc.velocity.X - num189; + } + } + if (npc.velocity.Y < num192) + { + npc.velocity.Y = npc.velocity.Y + num189; + } + else + { + if (npc.velocity.Y > num192) + { + npc.velocity.Y = npc.velocity.Y - num189; + } + } + if ((double)System.Math.Abs(num192) < (double)num188 * 0.2 && ((npc.velocity.X > 0f && num191 < 0f) || (npc.velocity.X < 0f && num191 > 0f))) + { + if (npc.velocity.Y > 0f) + { + npc.velocity.Y = npc.velocity.Y + num189 * 2f; + } + else + { + npc.velocity.Y = npc.velocity.Y - num189 * 2f; + } + } + if ((double)System.Math.Abs(num191) < (double)num188 * 0.2 && ((npc.velocity.Y > 0f && num192 < 0f) || (npc.velocity.Y < 0f && num192 > 0f))) + { + if (npc.velocity.X > 0f) + { + npc.velocity.X = npc.velocity.X + num189 * 2f; //changed from 2 + } + else + { + npc.velocity.X = npc.velocity.X - num189 * 2f; //changed from 2 + } + } + } + else + { + if (num196 > num197) + { + if (npc.velocity.X < num191) + { + npc.velocity.X = npc.velocity.X + num189 * 1.1f; //changed from 1.1 + } + else if (npc.velocity.X > num191) + { + npc.velocity.X = npc.velocity.X - num189 * 1.1f; //changed from 1.1 + } + if ((double)(System.Math.Abs(npc.velocity.X) + System.Math.Abs(npc.velocity.Y)) < (double)num188 * 0.5) + { + if (npc.velocity.Y > 0f) + { + npc.velocity.Y = npc.velocity.Y + num189; + } + else + { + npc.velocity.Y = npc.velocity.Y - num189; + } + } + } + else + { + if (npc.velocity.Y < num192) + { + npc.velocity.Y = npc.velocity.Y + num189 * 1.1f; + } + else if (npc.velocity.Y > num192) + { + npc.velocity.Y = npc.velocity.Y - num189 * 1.1f; + } + if ((double)(System.Math.Abs(npc.velocity.X) + System.Math.Abs(npc.velocity.Y)) < (double)num188 * 0.5) + { + if (npc.velocity.X > 0f) + { + npc.velocity.X = npc.velocity.X + num189; + } + else + { + npc.velocity.X = npc.velocity.X - num189; + } + } + } + } + } + } + + public override bool CheckActive() + { + return false; + } + + public override bool PreNPCLoot() + { + return false; + } + + public override void HitEffect(int hitDirection, double damage) + { + for (int k = 0; k < 3; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 37, hitDirection, -1f, 0, default(Color), 1f); + } + if (npc.life <= 0) + { + for (int k = 0; k < 10; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 37, hitDirection, -1f, 0, default(Color), 1f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SeaSerpent/SeaSerpentGore5"), 1f); + } + } + } +} \ No newline at end of file diff --git a/NPCs/SunkenSeaNPCs/SeaSerpent5.png b/NPCs/SunkenSeaNPCs/SeaSerpent5.png new file mode 100644 index 0000000000..2772709ecb Binary files /dev/null and b/NPCs/SunkenSeaNPCs/SeaSerpent5.png differ diff --git a/NPCs/SupremeCalamitas/SCalWormBody.cs b/NPCs/SupremeCalamitas/SCalWormBody.cs index 9fa1c46163..9a6337bd07 100644 --- a/NPCs/SupremeCalamitas/SCalWormBody.cs +++ b/NPCs/SupremeCalamitas/SCalWormBody.cs @@ -43,6 +43,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas npc.behindTiles = true; npc.noGravity = true; npc.noTileCollide = true; + npc.canGhostHeal = false; npc.HitSound = SoundID.NPCHit4; npc.DeathSound = SoundID.NPCDeath14; npc.netAlways = true; diff --git a/NPCs/SupremeCalamitas/SCalWormBodyWeak.cs b/NPCs/SupremeCalamitas/SCalWormBodyWeak.cs index 9d7f9c75b5..91a32034d8 100644 --- a/NPCs/SupremeCalamitas/SCalWormBodyWeak.cs +++ b/NPCs/SupremeCalamitas/SCalWormBodyWeak.cs @@ -46,6 +46,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas npc.behindTiles = true; npc.noGravity = true; npc.noTileCollide = true; + npc.canGhostHeal = false; npc.HitSound = SoundID.NPCHit13; npc.DeathSound = SoundID.NPCDeath13; npc.netAlways = true; @@ -58,22 +59,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas public override void AI() { - if (damageTaken >= (CalamityWorld.death ? 25000.0 : 10000.0)) - { - npc.dontTakeDamage = true; - } - else - { - if (invinceTime > 0) - { - invinceTime--; - npc.dontTakeDamage = true; - } - else - { - npc.dontTakeDamage = false; - } - } if (Main.npc[(int)npc.ai[1]].alpha < 128) { npc.alpha -= 42; @@ -104,21 +89,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas } } - public override bool StrikeNPC(ref double damage, int defense, ref float knockback, int hitDirection, ref bool crit) - { - if (damage > npc.lifeMax / 25) - { - damage = 0; - return false; - } - damageTaken += damage; - if (crit) - { - damageTaken += damage; - } - return true; - } - public override bool CheckActive() { return false; diff --git a/NPCs/SupremeCalamitas/SCalWormHead.cs b/NPCs/SupremeCalamitas/SCalWormHead.cs index 4368a5114f..fb65a91f79 100644 --- a/NPCs/SupremeCalamitas/SCalWormHead.cs +++ b/NPCs/SupremeCalamitas/SCalWormHead.cs @@ -59,6 +59,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas npc.behindTiles = true; npc.noGravity = true; npc.noTileCollide = true; + npc.canGhostHeal = false; npc.HitSound = SoundID.NPCHit4; npc.DeathSound = SoundID.NPCDeath14; npc.netAlways = true; diff --git a/NPCs/SupremeCalamitas/SCalWormHeart.cs b/NPCs/SupremeCalamitas/SCalWormHeart.cs index c4923185e4..f97c69210d 100644 --- a/NPCs/SupremeCalamitas/SCalWormHeart.cs +++ b/NPCs/SupremeCalamitas/SCalWormHeart.cs @@ -38,6 +38,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas npc.alpha = 255; npc.noGravity = true; npc.noTileCollide = true; + npc.canGhostHeal = false; npc.HitSound = SoundID.NPCHit13; npc.DeathSound = SoundID.NPCDeath1; for (int k = 0; k < npc.buffImmune.Length; k++) @@ -65,7 +66,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas { if (projectile.type == mod.ProjectileType("Celestus2")) { - damage /= 8; + damage = (int)((double)damage * 0.66); } } diff --git a/NPCs/SupremeCalamitas/SCalWormTail.cs b/NPCs/SupremeCalamitas/SCalWormTail.cs index e3ec7d7438..6cfc2a5b1f 100644 --- a/NPCs/SupremeCalamitas/SCalWormTail.cs +++ b/NPCs/SupremeCalamitas/SCalWormTail.cs @@ -43,6 +43,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas npc.behindTiles = true; npc.noGravity = true; npc.noTileCollide = true; + npc.canGhostHeal = false; npc.HitSound = SoundID.NPCHit4; npc.DeathSound = SoundID.NPCDeath14; npc.netAlways = true; diff --git a/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs b/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs index d4fdc78d32..be7f3b9785 100644 --- a/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs +++ b/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs @@ -25,6 +25,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas npc.height = 40; npc.noGravity = true; npc.noTileCollide = true; + npc.canGhostHeal = false; npc.damage = 0; npc.defense = 100; npc.lifeMax = Main.expertMode ? 90000 : 50000; diff --git a/NPCs/SupremeCalamitas/SupremeCalamitas.cs b/NPCs/SupremeCalamitas/SupremeCalamitas.cs index f8564ab984..94b49727cd 100644 --- a/NPCs/SupremeCalamitas/SupremeCalamitas.cs +++ b/NPCs/SupremeCalamitas/SupremeCalamitas.cs @@ -15,50 +15,50 @@ namespace CalamityMod.NPCs.SupremeCalamitas [AutoloadBossHead] public class SupremeCalamitas : ModNPC { - private float bossLife; - private float uDieLul = 1f; - private float passedVar = 0f; + private float bossLife; + private float uDieLul = 1f; + private float passedVar = 0f; - private bool protectionBoost = false; - private bool canDespawn = false; - private bool despawnProj = false; - private bool startText = false; - private bool wormAlive = false; - private bool startBattle = false; //100% - private bool startSecondAttack = false; //80% - private bool startThirdAttack = false; //60% - private bool halfLife = false; //40% - private bool startFourthAttack = false; //30% - private bool secondStage = false; //20% - private bool startFifthAttack = false; //10% - private bool gettingTired = false; //8% - private bool gettingTired2 = false; //6% - private bool gettingTired3 = false; //4% - private bool gettingTired4 = false; //2% - private bool gettingTired5 = false; //1% - private bool willCharge = false; - private bool canFireSplitingFireball = true; + private bool protectionBoost = false; + private bool canDespawn = false; + private bool despawnProj = false; + private bool startText = false; + private bool wormAlive = false; + private bool startBattle = false; //100% + private bool startSecondAttack = false; //80% + private bool startThirdAttack = false; //60% + private bool halfLife = false; //40% + private bool startFourthAttack = false; //30% + private bool secondStage = false; //20% + private bool startFifthAttack = false; //10% + private bool gettingTired = false; //8% + private bool gettingTired2 = false; //6% + private bool gettingTired3 = false; //4% + private bool gettingTired4 = false; //2% + private bool gettingTired5 = false; //1% + private bool willCharge = false; + private bool canFireSplitingFireball = true; - private int giveUpCounter = 1200; - private int lootTimer = 0; //900 * 5 = 4500 - private int phaseChange = 0; - private int spawnX = 0; - private int spawnX2 = 0; - private int spawnXReset = 0; - private int spawnXReset2 = 0; - private int spawnXAdd = 200; - private int spawnY = 0; - private int spawnYReset = 0; - private int spawnYAdd = 0; + private int giveUpCounter = 1200; + private int lootTimer = 0; //900 * 5 = 4500 + private int phaseChange = 0; + private int spawnX = 0; + private int spawnX2 = 0; + private int spawnXReset = 0; + private int spawnXReset2 = 0; + private int spawnXAdd = 200; + private int spawnY = 0; + private int spawnYReset = 0; + private int spawnYAdd = 0; - private Rectangle safeBox = default(Rectangle); + private Rectangle safeBox = default(Rectangle); - public override void SetStaticDefaults() + public override void SetStaticDefaults() { DisplayName.SetDefault("Supreme Calamitas"); Main.npcFrameCount[npc.type] = 6; } - + public override void SetDefaults() { npc.damage = 350; @@ -66,842 +66,836 @@ namespace CalamityMod.NPCs.SupremeCalamitas npc.width = 120; //324 npc.height = 120; //216 npc.defense = 0; - npc.value = Item.buyPrice(10, 0, 0, 0); - npc.lifeMax = CalamityWorld.revenge ? 5500000 : 5000000; - if (CalamityWorld.death) - { - npc.lifeMax = 6250000; - } - if (CalamityWorld.bossRushActive) - { - npc.lifeMax = CalamityWorld.death ? 4600000 : 4100000; - } - npc.aiStyle = -1; //new - aiType = -1; //new + npc.value = Item.buyPrice(10, 0, 0, 0); + npc.lifeMax = CalamityWorld.revenge ? 5500000 : 5000000; + if (CalamityWorld.death) + { + npc.lifeMax = 6250000; + } + if (CalamityWorld.bossRushActive) + { + npc.lifeMax = CalamityWorld.death ? 2300000 : 2100000; + } + npc.aiStyle = -1; //new + aiType = -1; //new npc.knockBackResist = 0f; + NPCID.Sets.TrailCacheLength[npc.type] = 8; + NPCID.Sets.TrailingMode[npc.type] = 1; for (int k = 0; k < npc.buffImmune.Length; k++) { npc.buffImmune[k] = true; npc.buffImmune[BuffID.Ichor] = false; - npc.buffImmune[BuffID.CursedInferno] = false; - } + npc.buffImmune[BuffID.CursedInferno] = false; + } npc.dontTakeDamage = false; npc.chaseable = true; npc.boss = true; - npc.canGhostHeal = false; + npc.canGhostHeal = false; npc.noGravity = true; npc.noTileCollide = true; npc.HitSound = SoundID.NPCHit4; - Mod calamityModMusic = ModLoader.GetMod("CalamityModMusic"); - if (calamityModMusic != null) - music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/SCG"); - else - music = MusicID.Boss2; + Mod calamityModMusic = ModLoader.GetMod("CalamityModMusic"); + if (calamityModMusic != null) + music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/SCG"); + else + music = MusicID.Boss2; } - + public override void AI() { - #region StartUp - CalamityGlobalNPC.SCal = npc.whoAmI; - lootTimer++; - if (Main.slimeRain) - { - Main.StopSlimeRain(true); - if (Main.netMode == 2) - { - NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); - } - } - if (Main.raining) - { - Main.raining = false; - if (Main.netMode == 2) - { - NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); - } - } - bool revenge = (CalamityWorld.revenge || CalamityWorld.bossRushActive); + #region StartUp + CalamityGlobalNPC.SCal = npc.whoAmI; + lootTimer++; + if (Main.slimeRain) + { + Main.StopSlimeRain(true); + if (Main.netMode == 2) + { + NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + } + } + if (Main.raining) + { + Main.raining = false; + if (Main.netMode == 2) + { + NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + } + } + bool revenge = (CalamityWorld.revenge || CalamityWorld.bossRushActive); bool expertMode = (Main.expertMode || CalamityWorld.bossRushActive); Player player = Main.player[npc.target]; - if (!startText) - { - if (Main.LocalPlayer.GetModPlayer(mod).sCalKillCount == 4) - { - string key = "Mods.CalamityMod.SupremeBossText12"; //kill SCal 4 times - Color messageColor = Color.Orange; - if (Main.netMode == 0) - { - Main.NewText(Language.GetTextValue(key), messageColor); - } - else if (Main.netMode == 2) - { - NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); - } - } - else if (Main.LocalPlayer.GetModPlayer(mod).sCalKillCount == 1) - { - string key = "Mods.CalamityMod.SupremeBossText11"; //kill SCal once - Color messageColor = Color.Orange; - if (Main.netMode == 0) - { - Main.NewText(Language.GetTextValue(key), messageColor); - } - else if (Main.netMode == 2) - { - NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); - } - } - if (Main.LocalPlayer.GetModPlayer(mod).sCalDeathCount < 51) - { - if (Main.LocalPlayer.GetModPlayer(mod).sCalDeathCount == 50) - { - string key = "Mods.CalamityMod.SupremeBossText15"; //die 50 or more times - Color messageColor = Color.Orange; - if (Main.netMode == 0) - { - Main.NewText(Language.GetTextValue(key), messageColor); - } - else if (Main.netMode == 2) - { - NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); - } - } - else if (Main.LocalPlayer.GetModPlayer(mod).sCalDeathCount > 19) - { - string key = "Mods.CalamityMod.SupremeBossText14"; //die 20 or more times - Color messageColor = Color.Orange; - if (Main.netMode == 0) - { - Main.NewText(Language.GetTextValue(key), messageColor); - } - else if (Main.netMode == 2) - { - NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); - } - } - else if (Main.LocalPlayer.GetModPlayer(mod).sCalDeathCount > 4) - { - string key = "Mods.CalamityMod.SupremeBossText13"; //die 5 or more times - Color messageColor = Color.Orange; - if (Main.netMode == 0) - { - Main.NewText(Language.GetTextValue(key), messageColor); - } - else if (Main.netMode == 2) - { - NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); - } - } - } - startText = true; - } - #endregion - #region ArenaCreation - if (npc.localAI[3] == 0f) - { - npc.localAI[3] = 1f; - Vector2 vectorPlayer = new Vector2(player.position.X, player.position.Y); - if (CalamityWorld.bossRushActive) - { - safeBox.X = spawnX = spawnXReset = (int)(vectorPlayer.X - 1250f); - spawnX2 = spawnXReset2 = (int)(vectorPlayer.X + 1250f); - safeBox.Y = spawnY = spawnYReset = (int)(vectorPlayer.Y - 1250f); - safeBox.Width = 2500; - safeBox.Height = 2500; - spawnYAdd = 125; - } - else if (CalamityWorld.death) - { - safeBox.X = spawnX = spawnXReset = (int)(vectorPlayer.X - 1000f); - spawnX2 = spawnXReset2 = (int)(vectorPlayer.X + 1000f); - safeBox.Y = spawnY = spawnYReset = (int)(vectorPlayer.Y - 1000f); - safeBox.Width = 2000; - safeBox.Height = 2000; - spawnYAdd = 100; - } - else - { - safeBox.X = spawnX = spawnXReset = (int)(vectorPlayer.X - (revenge ? 1500f : 2000f)); - spawnX2 = spawnXReset2 = (int)(vectorPlayer.X + (revenge ? 1500f : 2000f)); - safeBox.Y = spawnY = spawnYReset = (int)(vectorPlayer.Y - (revenge ? 1500f : 2000f)); - safeBox.Width = revenge ? 3000 : 4000; - safeBox.Height = revenge ? 3000 : 4000; - spawnYAdd = revenge ? 150 : 200; - } - if (Main.netMode != 1) - { - int num52 = (int)(safeBox.X + (float)(safeBox.Width / 2)) / 16; - int num53 = (int)(safeBox.Y + (float)(safeBox.Height / 2)) / 16; - int num54 = safeBox.Width / 2 / 16 + 1; - for (int num55 = num52 - num54; num55 <= num52 + num54; num55++) - { - for (int num56 = num53 - num54; num56 <= num53 + num54; num56++) - { - if ((num55 == num52 - num54 || num55 == num52 + num54 || num56 == num53 - num54 || num56 == num53 + num54) && !Main.tile[num55, num56].active()) - { - Main.tile[num55, num56].type = (ushort)mod.TileType("ArenaTile"); - Main.tile[num55, num56].active(true); - } - Main.tile[num55, num56].lava(false); - Main.tile[num55, num56].liquid = 0; - if (Main.netMode == 2) - { - NetMessage.SendTileSquare(-1, num55, num56, 1, TileChangeType.None); - } - else - { - WorldGen.SquareTileFrame(num55, num56, true); - } - } - } - } - } - if (!player.Hitbox.Intersects(safeBox)) - { - if (uDieLul < 3f) - { - uDieLul *= 1.01f; - } - else if (uDieLul > 3f) - { - uDieLul = 3f; - } - protectionBoost = true; - } - else - { - if (uDieLul > 1f) - { - uDieLul *= 0.99f; - } - else if (uDieLul < 1f) - { - uDieLul = 1f; - } - protectionBoost = false; - } - #endregion - #region Despawn - if (!player.active || player.dead) - { - npc.TargetClosest(false); - player = Main.player[npc.target]; - if (!player.active || player.dead) - { - npc.velocity = new Vector2(0f, -50f); - canDespawn = true; - if (npc.timeLeft > 150) - { - npc.timeLeft = 150; - } - return; - } - } - else - { - canDespawn = false; - } - #endregion - #region FirstAttack - if (npc.localAI[2] < 900f) - { - despawnProj = true; - npc.localAI[2] += 1f; - npc.damage = 0; - npc.chaseable = false; - npc.dontTakeDamage = true; - npc.TargetClosest(true); - npc.velocity *= 0.95f; - Vector2 vector92 = new Vector2(npc.Center.X, npc.Center.Y); - float num740 = player.Center.X - vector92.X; - float num741 = player.Center.Y - vector92.Y; - npc.rotation = (float)Math.Atan2((double)num741, (double)num740) - 1.57f; - if (Main.netMode != 1) - { - npc.localAI[0] += 1f; - if (npc.localAI[0] > (npc.GetGlobalNPC(mod).enraged ? 4f : 6f)) - { - npc.localAI[0] = 0f; - int damage = expertMode ? 200 : 250; //800 500 - if (npc.localAI[2] < 300f) //blasts from above - { - Projectile.NewProjectile(player.position.X + (float)Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 4f * uDieLul, mod.ProjectileType("BrimstoneHellblast2"), damage, 0f, Main.myPlayer, 0f, 0f); - } - else if (npc.localAI[2] < 600f) //blasts from left and right - { - Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + (float)Main.rand.Next(-1000, 1000), -3.5f * uDieLul, 0f, mod.ProjectileType("BrimstoneHellblast2"), damage, 0f, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(player.position.X - 1000f, player.position.Y + (float)Main.rand.Next(-1000, 1000), 3.5f * uDieLul, 0f, mod.ProjectileType("BrimstoneHellblast2"), damage, 0f, Main.myPlayer, 0f, 0f); - } - else //blasts from above, left, and right - { - Projectile.NewProjectile(player.position.X + (float)Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 3f * uDieLul, mod.ProjectileType("BrimstoneHellblast2"), damage, 0f, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + (float)Main.rand.Next(-1000, 1000), -3f * uDieLul, 0f, mod.ProjectileType("BrimstoneHellblast2"), damage, 0f, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + (float)Main.rand.Next(-1000, 1000), 3f * uDieLul, 0f, mod.ProjectileType("BrimstoneHellblast2"), damage, 0f, Main.myPlayer, 0f, 0f); - } - return; - } - } - return; - } - else if (!startBattle) - { - string key = "Mods.CalamityMod.SupremeBossText3"; - Color messageColor = Color.Orange; - if (Main.netMode == 0) - { - Main.NewText(Language.GetTextValue(key), messageColor); - } - else if (Main.netMode == 2) - { - NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); - } - if (Main.netMode != 1) - { - spawnY += 400; - if (revenge) - { - spawnY -= 100; - } - if (CalamityWorld.bossRushActive) - { - spawnY -= 50; - } - else if (CalamityWorld.death) - { - spawnY -= 100; - } - for (int x = 0; x < 5; x++) - { - int heart = NPC.NewNPC(spawnX + 50, spawnY, mod.NPCType("SCalWormHeart"), 0, 0f, 0f, 0f, 0f, 255); - spawnX += spawnXAdd; - if (Main.netMode == 2) - { - NetMessage.SendData(23, -1, -1, null, heart, 0f, 0f, 0f, 0, 0, 0); - } - int heart2 = NPC.NewNPC(spawnX2 - 50, spawnY, mod.NPCType("SCalWormHeart"), 0, 0f, 0f, 0f, 0f, 255); - spawnX2 -= spawnXAdd; - if (Main.netMode == 2) - { - NetMessage.SendData(23, -1, -1, null, heart2, 0f, 0f, 0f, 0, 0, 0); - } - spawnY += spawnYAdd; - } - spawnX = spawnXReset; - spawnX2 = spawnXReset2; - spawnY = spawnYReset; - NPC.SpawnOnPlayer(npc.FindClosestPlayer(), mod.NPCType("SCalWormHead")); - } - startBattle = true; - } - #endregion - #region SecondAttack - if (npc.localAI[2] < 1800f && startSecondAttack) - { - despawnProj = true; - npc.localAI[2] += 1f; - npc.damage = 0; - npc.chaseable = false; - npc.dontTakeDamage = true; - npc.TargetClosest(true); - npc.velocity *= 0.95f; - Vector2 vector92 = new Vector2(npc.Center.X, npc.Center.Y); - float num740 = player.Center.X - vector92.X; - float num741 = player.Center.Y - vector92.Y; - npc.rotation = (float)Math.Atan2((double)num741, (double)num740) - 1.57f; - if (Main.netMode != 1) - { - int damage = expertMode ? 150 : 200; //600 400 - if (npc.localAI[2] < 1200f) - { - if (npc.localAI[2] % 180 == 0) //blasts from top - { - Projectile.NewProjectile(player.position.X + (float)Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 5f * uDieLul, mod.ProjectileType("BrimstoneGigaBlast"), damage, 0f, Main.myPlayer, 0f, 0f); - } - } - else if (npc.localAI[2] < 1500f && npc.localAI[2] > 1200f) - { - if (npc.localAI[2] % 180 == 0) //blasts from right - { - Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + (float)Main.rand.Next(-1000, 1000), -5f * uDieLul, 0f, mod.ProjectileType("BrimstoneGigaBlast"), damage, 0f, Main.myPlayer, 0f, 0f); - } - } - else if (npc.localAI[2] > 1500f) - { - if (npc.localAI[2] % 180 == 0) //blasts from top - { - Projectile.NewProjectile(player.position.X + (float)Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 5f * uDieLul, mod.ProjectileType("BrimstoneGigaBlast"), damage, 0f, Main.myPlayer, 0f, 0f); - } - } - npc.localAI[0] += 1f; - if (npc.localAI[0] > (npc.GetGlobalNPC(mod).enraged ? 6f : 9f)) - { - npc.localAI[0] = 0f; - if (npc.localAI[2] < 1200f) //blasts from below - { - Projectile.NewProjectile(player.position.X + (float)Main.rand.Next(-1000, 1000), player.position.Y + 1000f, 0f, -4f * uDieLul, mod.ProjectileType("BrimstoneHellblast2"), damage, 0f, Main.myPlayer, 0f, 0f); - } - else if (npc.localAI[2] < 1500f) //blasts from left - { - Projectile.NewProjectile(player.position.X - 1000f, player.position.Y + (float)Main.rand.Next(-1000, 1000), 3.5f * uDieLul, 0f, mod.ProjectileType("BrimstoneHellblast2"), damage, 0f, Main.myPlayer, 0f, 0f); - } - else //blasts from left and right - { - Projectile.NewProjectile(player.position.X - 1000f, player.position.Y + (float)Main.rand.Next(-1000, 1000), 3f * uDieLul, 0f, mod.ProjectileType("BrimstoneHellblast2"), damage, 0f, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + (float)Main.rand.Next(-1000, 1000), -3f * uDieLul, 0f, mod.ProjectileType("BrimstoneHellblast2"), damage, 0f, Main.myPlayer, 0f, 0f); - } - return; - } - } - return; - } - if (!startSecondAttack && ((double)npc.life <= (double)npc.lifeMax * 0.75)) - { - string key = "Mods.CalamityMod.SupremeBossText4"; - Color messageColor = Color.Orange; - if (Main.netMode == 0) - { - Main.NewText(Language.GetTextValue(key), messageColor); - } - else if (Main.netMode == 2) - { - NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); - } - startSecondAttack = true; - return; - } - #endregion - #region ThirdAttack - if (npc.localAI[2] < 2700f && startThirdAttack) - { - despawnProj = true; - npc.localAI[2] += 1f; - npc.damage = 0; - npc.chaseable = false; - npc.dontTakeDamage = true; - npc.TargetClosest(true); - npc.velocity *= 0.95f; - Vector2 vector92 = new Vector2(npc.Center.X, npc.Center.Y); - float num740 = player.Center.X - vector92.X; - float num741 = player.Center.Y - vector92.Y; - npc.rotation = (float)Math.Atan2((double)num741, (double)num740) - 1.57f; - if (Main.netMode != 1) - { - int damage = expertMode ? 150 : 200; - if (npc.localAI[2] % 180 == 0) //blasts from top - { - Projectile.NewProjectile(player.position.X + (float)Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 5f * uDieLul, mod.ProjectileType("BrimstoneGigaBlast"), damage, 0f, Main.myPlayer, 0f, 0f); - } - if (npc.localAI[2] % 240 == 0) //fireblasts from above - { - Projectile.NewProjectile(player.position.X + (float)Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 10f * uDieLul, mod.ProjectileType("BrimstoneFireblast"), damage, 0f, Main.myPlayer, 0f, 0f); - } - npc.localAI[0] += 1f; - if (npc.localAI[0] > (npc.GetGlobalNPC(mod).enraged ? 9f : 11f)) - { - npc.localAI[0] = 0f; - if (npc.localAI[2] < 2100f) //blasts from above - { - Projectile.NewProjectile(player.position.X + (float)Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 4f * uDieLul, mod.ProjectileType("BrimstoneHellblast2"), damage, 0f, Main.myPlayer, 0f, 0f); - } - else if (npc.localAI[2] < 2400f) //blasts from right - { - Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + (float)Main.rand.Next(-1000, 1000), -3.5f * uDieLul, 0f, mod.ProjectileType("BrimstoneHellblast2"), damage, 0f, Main.myPlayer, 0f, 0f); - } - else //blasts from left and right - { - Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + (float)Main.rand.Next(-1000, 1000), -3.5f * uDieLul, 0f, mod.ProjectileType("BrimstoneHellblast2"), damage, 0f, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(player.position.X - 1000f, player.position.Y + (float)Main.rand.Next(-1000, 1000), 3.5f * uDieLul, 0f, mod.ProjectileType("BrimstoneHellblast2"), damage, 0f, Main.myPlayer, 0f, 0f); - } - return; - } - } - return; - } - if (!startThirdAttack && ((double)npc.life <= (double)npc.lifeMax * 0.5)) - { - Mod calamityModMusic = ModLoader.GetMod("CalamityModMusic"); - if (calamityModMusic != null) - music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/SCL"); - else - music = MusicID.Boss3; - string key = "Mods.CalamityMod.SupremeBossText5"; - Color messageColor = Color.Orange; - if (Main.netMode == 0) - { - Main.NewText(Language.GetTextValue(key), messageColor); - } - else if (Main.netMode == 2) - { - NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); - } - startThirdAttack = true; - return; - } - #endregion - #region FourthAttack - if (npc.localAI[2] < 3600f && startFourthAttack) - { - despawnProj = true; - npc.localAI[2] += 1f; - npc.damage = 0; - npc.chaseable = false; - npc.dontTakeDamage = true; - npc.TargetClosest(true); - npc.velocity *= 0.95f; - Vector2 vector92 = new Vector2(npc.Center.X, npc.Center.Y); - float num740 = player.Center.X - vector92.X; - float num741 = player.Center.Y - vector92.Y; - npc.rotation = (float)Math.Atan2((double)num741, (double)num740) - 1.57f; - if (Main.netMode != 1) //more clustered attack - { - int damage = expertMode ? 150 : 200; - if (npc.localAI[2] % 180 == 0) //blasts from top - { - Projectile.NewProjectile(player.position.X + (float)Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 5f * uDieLul, mod.ProjectileType("BrimstoneGigaBlast"), damage, 0f, Main.myPlayer, 0f, 0f); - } - if (npc.localAI[2] % 240 == 0) //fireblasts from above - { - Projectile.NewProjectile(player.position.X + (float)Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 10f * uDieLul, mod.ProjectileType("BrimstoneFireblast"), damage, 0f, Main.myPlayer, 0f, 0f); - } - if (npc.localAI[2] % 450 == 0) //giant homing fireballs - { - Projectile.NewProjectile(player.position.X + (float)Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 1f * uDieLul, mod.ProjectileType("BrimstoneMonster"), damage, 0f, Main.myPlayer, 0f, passedVar); - passedVar += 1f; - } - npc.localAI[0] += 1f; - if (npc.localAI[0] > (npc.GetGlobalNPC(mod).enraged ? 12f : 15f)) - { - npc.localAI[0] = 0f; - if (npc.localAI[2] < 3000f) //blasts from below - { - Projectile.NewProjectile(player.position.X + (float)Main.rand.Next(-1000, 1000), player.position.Y + 1000f, 0f, -4f * uDieLul, mod.ProjectileType("BrimstoneHellblast2"), damage, 0f, Main.myPlayer, 0f, 0f); - } - else if (npc.localAI[2] < 3300f) //blasts from left - { - Projectile.NewProjectile(player.position.X - 1000f, player.position.Y + (float)Main.rand.Next(-1000, 1000), 3.5f * uDieLul, 0f, mod.ProjectileType("BrimstoneHellblast2"), damage, 0f, Main.myPlayer, 0f, 0f); - } - else //blasts from left and right - { - Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + (float)Main.rand.Next(-1000, 1000), -3.5f * uDieLul, 0f, mod.ProjectileType("BrimstoneHellblast2"), damage, 0f, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(player.position.X - 1000f, player.position.Y + (float)Main.rand.Next(-1000, 1000), 3.5f * uDieLul, 0f, mod.ProjectileType("BrimstoneHellblast2"), damage, 0f, Main.myPlayer, 0f, 0f); - } - return; - } - } - return; - } - if (!startFourthAttack && ((double)npc.life <= (double)npc.lifeMax * 0.3)) - { - Mod calamityModMusic = ModLoader.GetMod("CalamityModMusic"); - if (calamityModMusic != null) - music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/SCE"); - else - music = MusicID.LunarBoss; - string key = "Mods.CalamityMod.SupremeBossText7"; - Color messageColor = Color.Orange; - if (Main.netMode == 0) - { - Main.NewText(Language.GetTextValue(key), messageColor); - } - else if (Main.netMode == 2) - { - NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); - } - startFourthAttack = true; - return; - } - #endregion - #region FifthAttack - if (npc.localAI[2] < 4500f && startFifthAttack) - { - despawnProj = true; - npc.localAI[2] += 1f; - npc.damage = 0; - npc.chaseable = false; - npc.dontTakeDamage = true; - npc.TargetClosest(true); - npc.velocity *= 0.95f; - Vector2 vector92 = new Vector2(npc.Center.X, npc.Center.Y); - float num740 = player.Center.X - vector92.X; - float num741 = player.Center.Y - vector92.Y; - npc.rotation = (float)Math.Atan2((double)num741, (double)num740) - 1.57f; - if (Main.netMode != 1) - { - int damage = expertMode ? 150 : 200; - if (npc.localAI[2] % 240 == 0) //blasts from top - { - Projectile.NewProjectile(player.position.X + (float)Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 5f * uDieLul, mod.ProjectileType("BrimstoneGigaBlast"), damage, 0f, Main.myPlayer, 0f, 0f); - } - if (npc.localAI[2] % 360 == 0) //fireblasts from above - { - Projectile.NewProjectile(player.position.X + (float)Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 10f * uDieLul, mod.ProjectileType("BrimstoneFireblast"), damage, 0f, Main.myPlayer, 0f, 0f); - } - if (npc.localAI[2] % 450 == 0) //giant homing fireballs - { - Projectile.NewProjectile(player.position.X + (float)Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 1f * uDieLul, mod.ProjectileType("BrimstoneMonster"), damage, 0f, Main.myPlayer, 0f, passedVar); - passedVar += 1f; - } - if (npc.localAI[2] % 30 == 0) //projectiles that move in wave pattern - { - Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + (float)Main.rand.Next(-500, 500), -10f * uDieLul, 0f, mod.ProjectileType("BrimstoneWave"), damage, 0f, Main.myPlayer, 0f, 0f); - } - npc.localAI[0] += 1f; - if (npc.localAI[0] > (npc.GetGlobalNPC(mod).enraged ? 15f : 18f)) - { - npc.localAI[0] = 0f; - if (npc.localAI[2] < 3900f) //blasts from above - { - Projectile.NewProjectile(player.position.X + (float)Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 4f * uDieLul, mod.ProjectileType("BrimstoneHellblast2"), damage, 0f, Main.myPlayer, 0f, 0f); - } - else if (npc.localAI[2] < 4200f) //blasts from left and right - { - Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + (float)Main.rand.Next(-1000, 1000), -3.5f * uDieLul, 0f, mod.ProjectileType("BrimstoneHellblast2"), damage, 0f, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(player.position.X - 1000f, player.position.Y + (float)Main.rand.Next(-1000, 1000), 3.5f * uDieLul, 0f, mod.ProjectileType("BrimstoneHellblast2"), damage, 0f, Main.myPlayer, 0f, 0f); - } - else //blasts from above, left, and right - { - Projectile.NewProjectile(player.position.X + (float)Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 3f * uDieLul, mod.ProjectileType("BrimstoneHellblast2"), damage, 0f, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + (float)Main.rand.Next(-1000, 1000), -3f * uDieLul, 0f, mod.ProjectileType("BrimstoneHellblast2"), damage, 0f, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + (float)Main.rand.Next(-1000, 1000), 3f * uDieLul, 0f, mod.ProjectileType("BrimstoneHellblast2"), damage, 0f, Main.myPlayer, 0f, 0f); - } - return; - } - } - return; - } - if (!startFifthAttack && ((double)npc.life <= (double)npc.lifeMax * 0.1)) - { - string key = "Mods.CalamityMod.SupremeBossText9"; - Color messageColor = Color.Orange; - if (Main.netMode == 0) - { - Main.NewText(Language.GetTextValue(key), messageColor); - } - else if (Main.netMode == 2) - { - NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); - } - startFifthAttack = true; - return; - } - #endregion - #region EndSections - if (startFifthAttack) - { - if (gettingTired5) - { - Mod calamityModMusic = ModLoader.GetMod("CalamityModMusic"); - if (calamityModMusic != null) - music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/SCA"); - else - music = MusicID.Eerie; - npc.noGravity = false; - npc.noTileCollide = false; - npc.damage = 0; - npc.velocity.X *= 0.98f; - npc.velocity.Y = 5f; - Vector2 vector2 = new Vector2(npc.Center.X, npc.Center.Y); - float num = player.Center.X - vector2.X; - float num1 = player.Center.Y - vector2.Y; - npc.rotation = (float)Math.Atan2((double)num1, (double)num) - 1.57f; - if (player.GetModPlayer(mod).sCalKillCount > 0) //after first time you kill her - { - if (giveUpCounter == 900) - { - string key = "Mods.CalamityMod.SupremeBossText27"; - Color messageColor = Color.Orange; - if (Main.netMode == 0) - { - Main.NewText(Language.GetTextValue(key), messageColor); - } - else if (Main.netMode == 2) - { - NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); - } - } - giveUpCounter--; - npc.chaseable = (giveUpCounter < 900) ? true : false; - npc.dontTakeDamage = (giveUpCounter < 900) ? false : true; - return; - } - if (giveUpCounter == 600) - { - string key = "Mods.CalamityMod.SupremeBossText25"; - Color messageColor = Color.Orange; - if (Main.netMode == 0) - { - Main.NewText(Language.GetTextValue(key), messageColor); - } - else if (Main.netMode == 2) - { - NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); - } - } - if (giveUpCounter == 300) - { - string key = "Mods.CalamityMod.SupremeBossText26"; - Color messageColor = Color.Orange; - if (Main.netMode == 0) - { - Main.NewText(Language.GetTextValue(key), messageColor); - } - else if (Main.netMode == 2) - { - NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); - } - } - if (giveUpCounter <= 0) - { - npc.chaseable = true; - npc.dontTakeDamage = false; - return; - } - giveUpCounter--; - npc.chaseable = false; - npc.dontTakeDamage = true; - return; - } - if (!gettingTired5 && ((double)npc.life <= (double)npc.lifeMax * 0.01)) - { - string key = "Mods.CalamityMod.SupremeBossText24"; - Color messageColor = Color.Orange; - if (Main.netMode == 0) - { - Main.NewText(Language.GetTextValue(key), messageColor); - } - else if (Main.netMode == 2) - { - NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); - } - gettingTired5 = true; - return; - } - else if (!gettingTired4 && ((double)npc.life <= (double)npc.lifeMax * 0.02)) - { - string key = "Mods.CalamityMod.SupremeBossText23"; - Color messageColor = Color.Orange; - if (Main.netMode == 0) - { - Main.NewText(Language.GetTextValue(key), messageColor); - } - else if (Main.netMode == 2) - { - NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); - } - gettingTired4 = true; - return; - } - else if (!gettingTired3 && ((double)npc.life <= (double)npc.lifeMax * 0.04)) - { - string key = "Mods.CalamityMod.SupremeBossText22"; - Color messageColor = Color.Orange; - if (Main.netMode == 0) - { - Main.NewText(Language.GetTextValue(key), messageColor); - } - else if (Main.netMode == 2) - { - NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); - } - gettingTired3 = true; - return; - } - else if (!gettingTired2 && ((double)npc.life <= (double)npc.lifeMax * 0.06)) - { - string key = "Mods.CalamityMod.SupremeBossText21"; - Color messageColor = Color.Orange; - if (Main.netMode == 0) - { - Main.NewText(Language.GetTextValue(key), messageColor); - } - else if (Main.netMode == 2) - { - NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); - } - gettingTired2 = true; - return; - } - else if (!gettingTired && ((double)npc.life <= (double)npc.lifeMax * 0.08)) - { - string key = "Mods.CalamityMod.SupremeBossText20"; - Color messageColor = Color.Orange; - if (Main.netMode == 0) - { - Main.NewText(Language.GetTextValue(key), messageColor); - } - else if (Main.netMode == 2) - { - NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); - } - if (Main.netMode != 1) - { - spawnY += 400; - if (revenge) - { - spawnY -= 100; - } - if (CalamityWorld.bossRushActive) - { - spawnY -= 50; - } - else if (CalamityWorld.death) - { - spawnY -= 100; - } - for (int x = 0; x < 5; x++) - { - int heart = NPC.NewNPC(spawnX + 50, spawnY, mod.NPCType("SCalWormHeart"), 0, 0f, 0f, 0f, 0f, 255); - spawnX += spawnXAdd; - if (Main.netMode == 2) - { - NetMessage.SendData(23, -1, -1, null, heart, 0f, 0f, 0f, 0, 0, 0); - } - int heart2 = NPC.NewNPC(spawnX2 - 50, spawnY, mod.NPCType("SCalWormHeart"), 0, 0f, 0f, 0f, 0f, 255); - spawnX2 -= spawnXAdd; - if (Main.netMode == 2) - { - NetMessage.SendData(23, -1, -1, null, heart2, 0f, 0f, 0f, 0, 0, 0); - } - spawnY += spawnYAdd; - } - spawnX = spawnXReset; - spawnX2 = spawnXReset2; - spawnY = spawnYReset; - NPC.SpawnOnPlayer(npc.FindClosestPlayer(), mod.NPCType("SCalWormHead")); - } - gettingTired = true; - return; - } - } - #endregion - #region DespawnProjectiles - if (npc.localAI[2] % 900 == 0 && despawnProj) - { - int proj; - for (int x = 0; x < 1000; x = proj + 1) - { - Projectile projectile = Main.projectile[x]; - if (projectile.active) - { - if (projectile.type == mod.ProjectileType("BrimstoneHellblast2") || - projectile.type == mod.ProjectileType("BrimstoneBarrage") || - projectile.type == mod.ProjectileType("BrimstoneWave")) - { - projectile.Kill(); - } - else if (projectile.type == mod.ProjectileType("BrimstoneGigaBlast") || - projectile.type == mod.ProjectileType("BrimstoneFireblast")) - { - projectile.active = false; - } - } - proj = x; - } - despawnProj = false; - } - #endregion - #region TransformSeekerandBrotherTriggers - if (!halfLife && ((double)npc.life <= (double)npc.lifeMax * 0.4)) + if (!startText) + { + if (Main.LocalPlayer.GetModPlayer(mod).sCalKillCount == 4) + { + string key = "Mods.CalamityMod.SupremeBossText12"; //kill SCal 4 times + Color messageColor = Color.Orange; + if (Main.netMode == 0) + { + Main.NewText(Language.GetTextValue(key), messageColor); + } + else if (Main.netMode == 2) + { + NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); + } + } + else if (Main.LocalPlayer.GetModPlayer(mod).sCalKillCount == 1) + { + string key = "Mods.CalamityMod.SupremeBossText11"; //kill SCal once + Color messageColor = Color.Orange; + if (Main.netMode == 0) + { + Main.NewText(Language.GetTextValue(key), messageColor); + } + else if (Main.netMode == 2) + { + NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); + } + } + if (Main.LocalPlayer.GetModPlayer(mod).sCalDeathCount < 51) + { + if (Main.LocalPlayer.GetModPlayer(mod).sCalDeathCount == 50) + { + string key = "Mods.CalamityMod.SupremeBossText15"; //die 50 or more times + Color messageColor = Color.Orange; + if (Main.netMode == 0) + { + Main.NewText(Language.GetTextValue(key), messageColor); + } + else if (Main.netMode == 2) + { + NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); + } + } + else if (Main.LocalPlayer.GetModPlayer(mod).sCalDeathCount > 19) + { + string key = "Mods.CalamityMod.SupremeBossText14"; //die 20 or more times + Color messageColor = Color.Orange; + if (Main.netMode == 0) + { + Main.NewText(Language.GetTextValue(key), messageColor); + } + else if (Main.netMode == 2) + { + NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); + } + } + else if (Main.LocalPlayer.GetModPlayer(mod).sCalDeathCount > 4) + { + string key = "Mods.CalamityMod.SupremeBossText13"; //die 5 or more times + Color messageColor = Color.Orange; + if (Main.netMode == 0) + { + Main.NewText(Language.GetTextValue(key), messageColor); + } + else if (Main.netMode == 2) + { + NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); + } + } + } + startText = true; + } + #endregion + #region ArenaCreation + if (npc.localAI[3] == 0f) + { + npc.localAI[3] = 1f; + Vector2 vectorPlayer = new Vector2(player.position.X, player.position.Y); + if (CalamityWorld.bossRushActive) + { + safeBox.X = spawnX = spawnXReset = (int)(vectorPlayer.X - 1250f); + spawnX2 = spawnXReset2 = (int)(vectorPlayer.X + 1250f); + safeBox.Y = spawnY = spawnYReset = (int)(vectorPlayer.Y - 1250f); + safeBox.Width = 2500; + safeBox.Height = 2500; + spawnYAdd = 125; + } + else if (CalamityWorld.death) + { + safeBox.X = spawnX = spawnXReset = (int)(vectorPlayer.X - 1000f); + spawnX2 = spawnXReset2 = (int)(vectorPlayer.X + 1000f); + safeBox.Y = spawnY = spawnYReset = (int)(vectorPlayer.Y - 1000f); + safeBox.Width = 2000; + safeBox.Height = 2000; + spawnYAdd = 100; + } + else + { + safeBox.X = spawnX = spawnXReset = (int)(vectorPlayer.X - 1500f); + spawnX2 = spawnXReset2 = (int)(vectorPlayer.X + 1500f); + safeBox.Y = spawnY = spawnYReset = (int)(vectorPlayer.Y - 1500f); + safeBox.Width = 3000; + safeBox.Height = 3000; + spawnYAdd = 150; + } + if (Main.netMode != 1) + { + int num52 = (int)(safeBox.X + (float)(safeBox.Width / 2)) / 16; + int num53 = (int)(safeBox.Y + (float)(safeBox.Height / 2)) / 16; + int num54 = safeBox.Width / 2 / 16 + 1; + for (int num55 = num52 - num54; num55 <= num52 + num54; num55++) + { + for (int num56 = num53 - num54; num56 <= num53 + num54; num56++) + { + if ((num55 == num52 - num54 || num55 == num52 + num54 || num56 == num53 - num54 || num56 == num53 + num54) && !Main.tile[num55, num56].active()) + { + Main.tile[num55, num56].type = (ushort)mod.TileType("ArenaTile"); + Main.tile[num55, num56].active(true); + } + Main.tile[num55, num56].lava(false); + Main.tile[num55, num56].liquid = 0; + if (Main.netMode == 2) + { + NetMessage.SendTileSquare(-1, num55, num56, 1, TileChangeType.None); + } + else + { + WorldGen.SquareTileFrame(num55, num56, true); + } + } + } + } + } + if (!player.Hitbox.Intersects(safeBox)) + { + if (uDieLul < 3f) + { + uDieLul *= 1.01f; + } + else if (uDieLul > 3f) + { + uDieLul = 3f; + } + protectionBoost = true; + } + else + { + if (uDieLul > 1f) + { + uDieLul *= 0.99f; + } + else if (uDieLul < 1f) + { + uDieLul = 1f; + } + protectionBoost = false; + } + #endregion + #region Despawn + if (!player.active || player.dead) + { + npc.TargetClosest(false); + player = Main.player[npc.target]; + if (!player.active || player.dead) + { + npc.velocity = new Vector2(0f, -50f); + canDespawn = true; + if (npc.timeLeft > 150) + { + npc.timeLeft = 150; + } + return; + } + } + else + { + canDespawn = false; + } + #endregion + #region FirstAttack + if (npc.localAI[2] < 900f) + { + despawnProj = true; + npc.localAI[2] += 1f; + npc.damage = 0; + npc.chaseable = false; + npc.dontTakeDamage = true; + npc.TargetClosest(true); + npc.velocity *= 0.95f; + Vector2 vector92 = new Vector2(npc.Center.X, npc.Center.Y); + float num740 = player.Center.X - vector92.X; + float num741 = player.Center.Y - vector92.Y; + npc.rotation = (float)Math.Atan2((double)num741, (double)num740) - 1.57f; + if (Main.netMode != 1) + { + npc.localAI[0] += 1f; + if (npc.localAI[0] > (npc.GetGlobalNPC(mod).enraged ? 4f : 6f)) + { + npc.localAI[0] = 0f; + int damage = expertMode ? 200 : 250; //800 500 + if (npc.localAI[2] < 300f) //blasts from above + { + Projectile.NewProjectile(player.position.X + (float)Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 4f * uDieLul, mod.ProjectileType("BrimstoneHellblast2"), damage, 0f, Main.myPlayer, 0f, 0f); + } + else if (npc.localAI[2] < 600f) //blasts from left and right + { + Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + (float)Main.rand.Next(-1000, 1000), -3.5f * uDieLul, 0f, mod.ProjectileType("BrimstoneHellblast2"), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X - 1000f, player.position.Y + (float)Main.rand.Next(-1000, 1000), 3.5f * uDieLul, 0f, mod.ProjectileType("BrimstoneHellblast2"), damage, 0f, Main.myPlayer, 0f, 0f); + } + else //blasts from above, left, and right + { + Projectile.NewProjectile(player.position.X + (float)Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 3f * uDieLul, mod.ProjectileType("BrimstoneHellblast2"), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + (float)Main.rand.Next(-1000, 1000), -3f * uDieLul, 0f, mod.ProjectileType("BrimstoneHellblast2"), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + (float)Main.rand.Next(-1000, 1000), 3f * uDieLul, 0f, mod.ProjectileType("BrimstoneHellblast2"), damage, 0f, Main.myPlayer, 0f, 0f); + } + return; + } + } + return; + } + else if (!startBattle) + { + string key = "Mods.CalamityMod.SupremeBossText3"; + Color messageColor = Color.Orange; + if (Main.netMode == 0) + { + Main.NewText(Language.GetTextValue(key), messageColor); + } + else if (Main.netMode == 2) + { + NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); + } + if (Main.netMode != 1) + { + spawnY += 300; + if (CalamityWorld.bossRushActive) + { + spawnY -= 50; + } + else if (CalamityWorld.death) + { + spawnY -= 100; + } + for (int x = 0; x < 5; x++) + { + int heart = NPC.NewNPC(spawnX + 50, spawnY, mod.NPCType("SCalWormHeart"), 0, 0f, 0f, 0f, 0f, 255); + spawnX += spawnXAdd; + if (Main.netMode == 2) + { + NetMessage.SendData(23, -1, -1, null, heart, 0f, 0f, 0f, 0, 0, 0); + } + int heart2 = NPC.NewNPC(spawnX2 - 50, spawnY, mod.NPCType("SCalWormHeart"), 0, 0f, 0f, 0f, 0f, 255); + spawnX2 -= spawnXAdd; + if (Main.netMode == 2) + { + NetMessage.SendData(23, -1, -1, null, heart2, 0f, 0f, 0f, 0, 0, 0); + } + spawnY += spawnYAdd; + } + spawnX = spawnXReset; + spawnX2 = spawnXReset2; + spawnY = spawnYReset; + NPC.SpawnOnPlayer(npc.FindClosestPlayer(), mod.NPCType("SCalWormHead")); + } + startBattle = true; + } + #endregion + #region SecondAttack + if (npc.localAI[2] < 1800f && startSecondAttack) + { + despawnProj = true; + npc.localAI[2] += 1f; + npc.damage = 0; + npc.chaseable = false; + npc.dontTakeDamage = true; + npc.TargetClosest(true); + npc.velocity *= 0.95f; + Vector2 vector92 = new Vector2(npc.Center.X, npc.Center.Y); + float num740 = player.Center.X - vector92.X; + float num741 = player.Center.Y - vector92.Y; + npc.rotation = (float)Math.Atan2((double)num741, (double)num740) - 1.57f; + if (Main.netMode != 1) + { + int damage = expertMode ? 150 : 200; //600 400 + if (npc.localAI[2] < 1200f) + { + if (npc.localAI[2] % 180 == 0) //blasts from top + { + Projectile.NewProjectile(player.position.X + (float)Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 5f * uDieLul, mod.ProjectileType("BrimstoneGigaBlast"), damage, 0f, Main.myPlayer, 0f, 0f); + } + } + else if (npc.localAI[2] < 1500f && npc.localAI[2] > 1200f) + { + if (npc.localAI[2] % 180 == 0) //blasts from right + { + Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + (float)Main.rand.Next(-1000, 1000), -5f * uDieLul, 0f, mod.ProjectileType("BrimstoneGigaBlast"), damage, 0f, Main.myPlayer, 0f, 0f); + } + } + else if (npc.localAI[2] > 1500f) + { + if (npc.localAI[2] % 180 == 0) //blasts from top + { + Projectile.NewProjectile(player.position.X + (float)Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 5f * uDieLul, mod.ProjectileType("BrimstoneGigaBlast"), damage, 0f, Main.myPlayer, 0f, 0f); + } + } + npc.localAI[0] += 1f; + if (npc.localAI[0] > (npc.GetGlobalNPC(mod).enraged ? 6f : 9f)) + { + npc.localAI[0] = 0f; + if (npc.localAI[2] < 1200f) //blasts from below + { + Projectile.NewProjectile(player.position.X + (float)Main.rand.Next(-1000, 1000), player.position.Y + 1000f, 0f, -4f * uDieLul, mod.ProjectileType("BrimstoneHellblast2"), damage, 0f, Main.myPlayer, 0f, 0f); + } + else if (npc.localAI[2] < 1500f) //blasts from left + { + Projectile.NewProjectile(player.position.X - 1000f, player.position.Y + (float)Main.rand.Next(-1000, 1000), 3.5f * uDieLul, 0f, mod.ProjectileType("BrimstoneHellblast2"), damage, 0f, Main.myPlayer, 0f, 0f); + } + else //blasts from left and right + { + Projectile.NewProjectile(player.position.X - 1000f, player.position.Y + (float)Main.rand.Next(-1000, 1000), 3f * uDieLul, 0f, mod.ProjectileType("BrimstoneHellblast2"), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + (float)Main.rand.Next(-1000, 1000), -3f * uDieLul, 0f, mod.ProjectileType("BrimstoneHellblast2"), damage, 0f, Main.myPlayer, 0f, 0f); + } + return; + } + } + return; + } + if (!startSecondAttack && ((double)npc.life <= (double)npc.lifeMax * 0.75)) + { + string key = "Mods.CalamityMod.SupremeBossText4"; + Color messageColor = Color.Orange; + if (Main.netMode == 0) + { + Main.NewText(Language.GetTextValue(key), messageColor); + } + else if (Main.netMode == 2) + { + NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); + } + startSecondAttack = true; + return; + } + #endregion + #region ThirdAttack + if (npc.localAI[2] < 2700f && startThirdAttack) + { + despawnProj = true; + npc.localAI[2] += 1f; + npc.damage = 0; + npc.chaseable = false; + npc.dontTakeDamage = true; + npc.TargetClosest(true); + npc.velocity *= 0.95f; + Vector2 vector92 = new Vector2(npc.Center.X, npc.Center.Y); + float num740 = player.Center.X - vector92.X; + float num741 = player.Center.Y - vector92.Y; + npc.rotation = (float)Math.Atan2((double)num741, (double)num740) - 1.57f; + if (Main.netMode != 1) + { + int damage = expertMode ? 150 : 200; + if (npc.localAI[2] % 180 == 0) //blasts from top + { + Projectile.NewProjectile(player.position.X + (float)Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 5f * uDieLul, mod.ProjectileType("BrimstoneGigaBlast"), damage, 0f, Main.myPlayer, 0f, 0f); + } + if (npc.localAI[2] % 240 == 0) //fireblasts from above + { + Projectile.NewProjectile(player.position.X + (float)Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 10f * uDieLul, mod.ProjectileType("BrimstoneFireblast"), damage, 0f, Main.myPlayer, 0f, 0f); + } + npc.localAI[0] += 1f; + if (npc.localAI[0] > (npc.GetGlobalNPC(mod).enraged ? 9f : 11f)) + { + npc.localAI[0] = 0f; + if (npc.localAI[2] < 2100f) //blasts from above + { + Projectile.NewProjectile(player.position.X + (float)Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 4f * uDieLul, mod.ProjectileType("BrimstoneHellblast2"), damage, 0f, Main.myPlayer, 0f, 0f); + } + else if (npc.localAI[2] < 2400f) //blasts from right + { + Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + (float)Main.rand.Next(-1000, 1000), -3.5f * uDieLul, 0f, mod.ProjectileType("BrimstoneHellblast2"), damage, 0f, Main.myPlayer, 0f, 0f); + } + else //blasts from left and right + { + Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + (float)Main.rand.Next(-1000, 1000), -3.5f * uDieLul, 0f, mod.ProjectileType("BrimstoneHellblast2"), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X - 1000f, player.position.Y + (float)Main.rand.Next(-1000, 1000), 3.5f * uDieLul, 0f, mod.ProjectileType("BrimstoneHellblast2"), damage, 0f, Main.myPlayer, 0f, 0f); + } + return; + } + } + return; + } + if (!startThirdAttack && ((double)npc.life <= (double)npc.lifeMax * 0.5)) + { + Mod calamityModMusic = ModLoader.GetMod("CalamityModMusic"); + if (calamityModMusic != null) + music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/SCL"); + else + music = MusicID.Boss3; + string key = "Mods.CalamityMod.SupremeBossText5"; + Color messageColor = Color.Orange; + if (Main.netMode == 0) + { + Main.NewText(Language.GetTextValue(key), messageColor); + } + else if (Main.netMode == 2) + { + NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); + } + startThirdAttack = true; + return; + } + #endregion + #region FourthAttack + if (npc.localAI[2] < 3600f && startFourthAttack) + { + despawnProj = true; + npc.localAI[2] += 1f; + npc.damage = 0; + npc.chaseable = false; + npc.dontTakeDamage = true; + npc.TargetClosest(true); + npc.velocity *= 0.95f; + Vector2 vector92 = new Vector2(npc.Center.X, npc.Center.Y); + float num740 = player.Center.X - vector92.X; + float num741 = player.Center.Y - vector92.Y; + npc.rotation = (float)Math.Atan2((double)num741, (double)num740) - 1.57f; + if (Main.netMode != 1) //more clustered attack + { + int damage = expertMode ? 150 : 200; + if (npc.localAI[2] % 180 == 0) //blasts from top + { + Projectile.NewProjectile(player.position.X + (float)Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 5f * uDieLul, mod.ProjectileType("BrimstoneGigaBlast"), damage, 0f, Main.myPlayer, 0f, 0f); + } + if (npc.localAI[2] % 240 == 0) //fireblasts from above + { + Projectile.NewProjectile(player.position.X + (float)Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 10f * uDieLul, mod.ProjectileType("BrimstoneFireblast"), damage, 0f, Main.myPlayer, 0f, 0f); + } + if (npc.localAI[2] % 450 == 0) //giant homing fireballs + { + Projectile.NewProjectile(player.position.X + (float)Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 1f * uDieLul, mod.ProjectileType("BrimstoneMonster"), damage, 0f, Main.myPlayer, 0f, passedVar); + passedVar += 1f; + } + npc.localAI[0] += 1f; + if (npc.localAI[0] > (npc.GetGlobalNPC(mod).enraged ? 12f : 15f)) + { + npc.localAI[0] = 0f; + if (npc.localAI[2] < 3000f) //blasts from below + { + Projectile.NewProjectile(player.position.X + (float)Main.rand.Next(-1000, 1000), player.position.Y + 1000f, 0f, -4f * uDieLul, mod.ProjectileType("BrimstoneHellblast2"), damage, 0f, Main.myPlayer, 0f, 0f); + } + else if (npc.localAI[2] < 3300f) //blasts from left + { + Projectile.NewProjectile(player.position.X - 1000f, player.position.Y + (float)Main.rand.Next(-1000, 1000), 3.5f * uDieLul, 0f, mod.ProjectileType("BrimstoneHellblast2"), damage, 0f, Main.myPlayer, 0f, 0f); + } + else //blasts from left and right + { + Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + (float)Main.rand.Next(-1000, 1000), -3.5f * uDieLul, 0f, mod.ProjectileType("BrimstoneHellblast2"), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X - 1000f, player.position.Y + (float)Main.rand.Next(-1000, 1000), 3.5f * uDieLul, 0f, mod.ProjectileType("BrimstoneHellblast2"), damage, 0f, Main.myPlayer, 0f, 0f); + } + return; + } + } + return; + } + if (!startFourthAttack && ((double)npc.life <= (double)npc.lifeMax * 0.3)) + { + Mod calamityModMusic = ModLoader.GetMod("CalamityModMusic"); + if (calamityModMusic != null) + music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/SCE"); + else + music = MusicID.LunarBoss; + string key = "Mods.CalamityMod.SupremeBossText7"; + Color messageColor = Color.Orange; + if (Main.netMode == 0) + { + Main.NewText(Language.GetTextValue(key), messageColor); + } + else if (Main.netMode == 2) + { + NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); + } + startFourthAttack = true; + return; + } + #endregion + #region FifthAttack + if (npc.localAI[2] < 4500f && startFifthAttack) + { + despawnProj = true; + npc.localAI[2] += 1f; + npc.damage = 0; + npc.chaseable = false; + npc.dontTakeDamage = true; + npc.TargetClosest(true); + npc.velocity *= 0.95f; + Vector2 vector92 = new Vector2(npc.Center.X, npc.Center.Y); + float num740 = player.Center.X - vector92.X; + float num741 = player.Center.Y - vector92.Y; + npc.rotation = (float)Math.Atan2((double)num741, (double)num740) - 1.57f; + if (Main.netMode != 1) + { + int damage = expertMode ? 150 : 200; + if (npc.localAI[2] % 240 == 0) //blasts from top + { + Projectile.NewProjectile(player.position.X + (float)Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 5f * uDieLul, mod.ProjectileType("BrimstoneGigaBlast"), damage, 0f, Main.myPlayer, 0f, 0f); + } + if (npc.localAI[2] % 360 == 0) //fireblasts from above + { + Projectile.NewProjectile(player.position.X + (float)Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 10f * uDieLul, mod.ProjectileType("BrimstoneFireblast"), damage, 0f, Main.myPlayer, 0f, 0f); + } + if (npc.localAI[2] % 450 == 0) //giant homing fireballs + { + Projectile.NewProjectile(player.position.X + (float)Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 1f * uDieLul, mod.ProjectileType("BrimstoneMonster"), damage, 0f, Main.myPlayer, 0f, passedVar); + passedVar += 1f; + } + if (npc.localAI[2] % 30 == 0) //projectiles that move in wave pattern + { + Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + (float)Main.rand.Next(-500, 500), -10f * uDieLul, 0f, mod.ProjectileType("BrimstoneWave"), damage, 0f, Main.myPlayer, 0f, 0f); + } + npc.localAI[0] += 1f; + if (npc.localAI[0] > (npc.GetGlobalNPC(mod).enraged ? 15f : 18f)) + { + npc.localAI[0] = 0f; + if (npc.localAI[2] < 3900f) //blasts from above + { + Projectile.NewProjectile(player.position.X + (float)Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 4f * uDieLul, mod.ProjectileType("BrimstoneHellblast2"), damage, 0f, Main.myPlayer, 0f, 0f); + } + else if (npc.localAI[2] < 4200f) //blasts from left and right + { + Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + (float)Main.rand.Next(-1000, 1000), -3.5f * uDieLul, 0f, mod.ProjectileType("BrimstoneHellblast2"), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X - 1000f, player.position.Y + (float)Main.rand.Next(-1000, 1000), 3.5f * uDieLul, 0f, mod.ProjectileType("BrimstoneHellblast2"), damage, 0f, Main.myPlayer, 0f, 0f); + } + else //blasts from above, left, and right + { + Projectile.NewProjectile(player.position.X + (float)Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 3f * uDieLul, mod.ProjectileType("BrimstoneHellblast2"), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + (float)Main.rand.Next(-1000, 1000), -3f * uDieLul, 0f, mod.ProjectileType("BrimstoneHellblast2"), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + (float)Main.rand.Next(-1000, 1000), 3f * uDieLul, 0f, mod.ProjectileType("BrimstoneHellblast2"), damage, 0f, Main.myPlayer, 0f, 0f); + } + return; + } + } + return; + } + if (!startFifthAttack && ((double)npc.life <= (double)npc.lifeMax * 0.1)) + { + string key = "Mods.CalamityMod.SupremeBossText9"; + Color messageColor = Color.Orange; + if (Main.netMode == 0) + { + Main.NewText(Language.GetTextValue(key), messageColor); + } + else if (Main.netMode == 2) + { + NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); + } + startFifthAttack = true; + return; + } + #endregion + #region EndSections + if (startFifthAttack) + { + if (gettingTired5) + { + Mod calamityModMusic = ModLoader.GetMod("CalamityModMusic"); + if (calamityModMusic != null) + music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/SCA"); + else + music = MusicID.Eerie; + npc.noGravity = false; + npc.noTileCollide = false; + npc.damage = 0; + npc.velocity.X *= 0.98f; + npc.velocity.Y = 5f; + Vector2 vector2 = new Vector2(npc.Center.X, npc.Center.Y); + float num = player.Center.X - vector2.X; + float num1 = player.Center.Y - vector2.Y; + npc.rotation = (float)Math.Atan2((double)num1, (double)num) - 1.57f; + if (player.GetModPlayer(mod).sCalKillCount > 0) //after first time you kill her + { + if (giveUpCounter == 900) + { + string key = "Mods.CalamityMod.SupremeBossText27"; + Color messageColor = Color.Orange; + if (Main.netMode == 0) + { + Main.NewText(Language.GetTextValue(key), messageColor); + } + else if (Main.netMode == 2) + { + NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); + } + } + giveUpCounter--; + npc.chaseable = (giveUpCounter < 900) ? true : false; + npc.dontTakeDamage = (giveUpCounter < 900) ? false : true; + return; + } + if (giveUpCounter == 600) + { + string key = "Mods.CalamityMod.SupremeBossText25"; + Color messageColor = Color.Orange; + if (Main.netMode == 0) + { + Main.NewText(Language.GetTextValue(key), messageColor); + } + else if (Main.netMode == 2) + { + NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); + } + } + if (giveUpCounter == 300) + { + string key = "Mods.CalamityMod.SupremeBossText26"; + Color messageColor = Color.Orange; + if (Main.netMode == 0) + { + Main.NewText(Language.GetTextValue(key), messageColor); + } + else if (Main.netMode == 2) + { + NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); + } + } + if (giveUpCounter <= 0) + { + npc.chaseable = true; + npc.dontTakeDamage = false; + return; + } + giveUpCounter--; + npc.chaseable = false; + npc.dontTakeDamage = true; + return; + } + if (!gettingTired5 && ((double)npc.life <= (double)npc.lifeMax * 0.01)) + { + string key = "Mods.CalamityMod.SupremeBossText24"; + Color messageColor = Color.Orange; + if (Main.netMode == 0) + { + Main.NewText(Language.GetTextValue(key), messageColor); + } + else if (Main.netMode == 2) + { + NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); + } + gettingTired5 = true; + return; + } + else if (!gettingTired4 && ((double)npc.life <= (double)npc.lifeMax * 0.02)) + { + string key = "Mods.CalamityMod.SupremeBossText23"; + Color messageColor = Color.Orange; + if (Main.netMode == 0) + { + Main.NewText(Language.GetTextValue(key), messageColor); + } + else if (Main.netMode == 2) + { + NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); + } + gettingTired4 = true; + return; + } + else if (!gettingTired3 && ((double)npc.life <= (double)npc.lifeMax * 0.04)) + { + string key = "Mods.CalamityMod.SupremeBossText22"; + Color messageColor = Color.Orange; + if (Main.netMode == 0) + { + Main.NewText(Language.GetTextValue(key), messageColor); + } + else if (Main.netMode == 2) + { + NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); + } + gettingTired3 = true; + return; + } + else if (!gettingTired2 && ((double)npc.life <= (double)npc.lifeMax * 0.06)) + { + string key = "Mods.CalamityMod.SupremeBossText21"; + Color messageColor = Color.Orange; + if (Main.netMode == 0) + { + Main.NewText(Language.GetTextValue(key), messageColor); + } + else if (Main.netMode == 2) + { + NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); + } + gettingTired2 = true; + return; + } + else if (!gettingTired && ((double)npc.life <= (double)npc.lifeMax * 0.08)) + { + string key = "Mods.CalamityMod.SupremeBossText20"; + Color messageColor = Color.Orange; + if (Main.netMode == 0) + { + Main.NewText(Language.GetTextValue(key), messageColor); + } + else if (Main.netMode == 2) + { + NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); + } + if (Main.netMode != 1) + { + spawnY += 300; + if (CalamityWorld.bossRushActive) + { + spawnY -= 50; + } + else if (CalamityWorld.death) + { + spawnY -= 100; + } + for (int x = 0; x < 5; x++) + { + int heart = NPC.NewNPC(spawnX + 50, spawnY, mod.NPCType("SCalWormHeart"), 0, 0f, 0f, 0f, 0f, 255); + spawnX += spawnXAdd; + if (Main.netMode == 2) + { + NetMessage.SendData(23, -1, -1, null, heart, 0f, 0f, 0f, 0, 0, 0); + } + int heart2 = NPC.NewNPC(spawnX2 - 50, spawnY, mod.NPCType("SCalWormHeart"), 0, 0f, 0f, 0f, 0f, 255); + spawnX2 -= spawnXAdd; + if (Main.netMode == 2) + { + NetMessage.SendData(23, -1, -1, null, heart2, 0f, 0f, 0f, 0, 0, 0); + } + spawnY += spawnYAdd; + } + spawnX = spawnXReset; + spawnX2 = spawnXReset2; + spawnY = spawnYReset; + NPC.SpawnOnPlayer(npc.FindClosestPlayer(), mod.NPCType("SCalWormHead")); + } + gettingTired = true; + return; + } + } + #endregion + #region DespawnProjectiles + if (npc.localAI[2] % 900 == 0 && despawnProj) + { + int proj; + for (int x = 0; x < 1000; x = proj + 1) + { + Projectile projectile = Main.projectile[x]; + if (projectile.active) + { + if (projectile.type == mod.ProjectileType("BrimstoneHellblast2") || + projectile.type == mod.ProjectileType("BrimstoneBarrage") || + projectile.type == mod.ProjectileType("BrimstoneWave")) + { + projectile.Kill(); + } + else if (projectile.type == mod.ProjectileType("BrimstoneGigaBlast") || + projectile.type == mod.ProjectileType("BrimstoneFireblast")) + { + projectile.active = false; + } + } + proj = x; + } + despawnProj = false; + } + #endregion + #region TransformSeekerandBrotherTriggers + if (!halfLife && ((double)npc.life <= (double)npc.lifeMax * 0.4)) { string key = "Mods.CalamityMod.SupremeBossText"; Color messageColor = Color.Orange; @@ -915,39 +909,39 @@ namespace CalamityMod.NPCs.SupremeCalamitas } halfLife = true; } - if ((double)npc.life <= (double)npc.lifeMax * 0.2) + if ((double)npc.life <= (double)npc.lifeMax * 0.2) { if (secondStage == false) { - string key = "Mods.CalamityMod.SupremeBossText8"; - Color messageColor = Color.Orange; - if (Main.netMode == 0) - { - Main.NewText(Language.GetTextValue(key), messageColor); - } - else if (Main.netMode == 2) - { - NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); - } - if (Main.netMode != 1) - { - Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 74); - for (int I = 0; I < 20; I++) - { - int FireEye = NPC.NewNPC((int)(npc.Center.X + (Math.Sin(I * 18) * 300)), (int)(npc.Center.Y + (Math.Cos(I * 18) * 300)), mod.NPCType("SoulSeekerSupreme"), npc.whoAmI, 0, 0, 0, -1); - NPC Eye = Main.npc[FireEye]; - Eye.ai[0] = I * 18; - Eye.ai[3] = I * 18; - } - } + string key = "Mods.CalamityMod.SupremeBossText8"; + Color messageColor = Color.Orange; + if (Main.netMode == 0) + { + Main.NewText(Language.GetTextValue(key), messageColor); + } + else if (Main.netMode == 2) + { + NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); + } + if (Main.netMode != 1) + { + Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 74); + for (int I = 0; I < 20; I++) + { + int FireEye = NPC.NewNPC((int)(npc.Center.X + (Math.Sin(I * 18) * 300)), (int)(npc.Center.Y + (Math.Cos(I * 18) * 300)), mod.NPCType("SoulSeekerSupreme"), npc.whoAmI, 0, 0, 0, -1); + NPC Eye = Main.npc[FireEye]; + Eye.ai[0] = I * 18; + Eye.ai[3] = I * 18; + } + } secondStage = true; } } - if (bossLife == 0f && npc.life > 0) + if (bossLife == 0f && npc.life > 0) { bossLife = (float)npc.lifeMax; } - if (npc.life > 0) + if (npc.life > 0) { if (Main.netMode != 1) { @@ -955,8 +949,8 @@ namespace CalamityMod.NPCs.SupremeCalamitas if ((float)(npc.life + num660) < bossLife) { bossLife = (float)npc.life; - NPC.SpawnOnPlayer(npc.FindClosestPlayer(), mod.NPCType("SupremeCataclysm")); - NPC.SpawnOnPlayer(npc.FindClosestPlayer(), mod.NPCType("SupremeCatastrophe")); + NPC.SpawnOnPlayer(npc.FindClosestPlayer(), mod.NPCType("SupremeCataclysm")); + NPC.SpawnOnPlayer(npc.FindClosestPlayer(), mod.NPCType("SupremeCatastrophe")); string key = "Mods.CalamityMod.SupremeBossText6"; Color messageColor = Color.Orange; if (Main.netMode == 0) @@ -970,10 +964,10 @@ namespace CalamityMod.NPCs.SupremeCalamitas return; } } - } - #endregion - #region TargetandRotation - if (npc.target < 0 || npc.target == 255 || player.dead || !player.active) + } + #endregion + #region TargetandRotation + if (npc.target < 0 || npc.target == 255 || player.dead || !player.active) { npc.TargetClosest(true); } @@ -1027,32 +1021,32 @@ namespace CalamityMod.NPCs.SupremeCalamitas { npc.rotation = num803; } - #endregion - #region FirstStage - if (npc.ai[0] == 0f) + #endregion + #region FirstStage + if (npc.ai[0] == 0f) { - npc.damage = expertMode ? 720 : 450; - if (NPC.AnyNPCs(mod.NPCType("SCalWormHead"))) - { - wormAlive = true; - npc.dontTakeDamage = true; - npc.chaseable = false; - } - else - { - if (NPC.AnyNPCs(mod.NPCType("SupremeCataclysm")) || NPC.AnyNPCs(mod.NPCType("SupremeCatastrophe"))) - { - npc.dontTakeDamage = true; - npc.chaseable = false; - } - else - { - npc.dontTakeDamage = false; - npc.chaseable = true; - } - wormAlive = false; - } - if (npc.ai[1] == 0f) + npc.damage = expertMode ? 720 : 450; + if (NPC.AnyNPCs(mod.NPCType("SCalWormHead"))) + { + wormAlive = true; + npc.dontTakeDamage = true; + npc.chaseable = false; + } + else + { + if (NPC.AnyNPCs(mod.NPCType("SupremeCataclysm")) || NPC.AnyNPCs(mod.NPCType("SupremeCatastrophe"))) + { + npc.dontTakeDamage = true; + npc.chaseable = false; + } + else + { + npc.dontTakeDamage = false; + npc.chaseable = true; + } + wormAlive = false; + } + if (npc.ai[1] == 0f) { float num823 = 12f; float num824 = 0.12f; @@ -1114,7 +1108,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas npc.localAI[1] = 0f; float num828 = 10f * uDieLul; int num829 = expertMode ? 150 : 200; //600 400 - Vector2 value9 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + Vector2 value9 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); float num180 = player.position.X + (float)player.width * 0.5f - value9.X; float num181 = Math.Abs(num180) * 0.1f; float num182 = player.position.Y + (float)player.height * 0.5f - value9.Y - num181; @@ -1127,7 +1121,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas int randomShot = Main.rand.Next(6); //0 to 5 if (randomShot == 0 && canFireSplitingFireball) { - canFireSplitingFireball = false; + canFireSplitingFireball = false; randomShot = mod.ProjectileType("BrimstoneFireblast"); num827 = (float)Math.Sqrt((double)(num825 * num825 + num826 * num826)); num827 = num828 / num827; @@ -1137,29 +1131,29 @@ namespace CalamityMod.NPCs.SupremeCalamitas vector82.Y += num826 * 15f; Projectile.NewProjectile(vector82.X, vector82.Y, num825, num826, randomShot, num829, 0f, Main.myPlayer, 0f, 0f); } - else if (randomShot == 1 && canFireSplitingFireball) - { - canFireSplitingFireball = false; - randomShot = mod.ProjectileType("BrimstoneGigaBlast"); - num827 = (float)Math.Sqrt((double)(num825 * num825 + num826 * num826)); - num827 = num828 / num827; - num825 *= num827; - num826 *= num827; - vector82.X += num825 * 15f; - vector82.Y += num826 * 15f; - Projectile.NewProjectile(vector82.X, vector82.Y, num825, num826, randomShot, num829, 0f, Main.myPlayer, 0f, 0f); - } + else if (randomShot == 1 && canFireSplitingFireball) + { + canFireSplitingFireball = false; + randomShot = mod.ProjectileType("BrimstoneGigaBlast"); + num827 = (float)Math.Sqrt((double)(num825 * num825 + num826 * num826)); + num827 = num828 / num827; + num825 *= num827; + num826 *= num827; + vector82.X += num825 * 15f; + vector82.Y += num826 * 15f; + Projectile.NewProjectile(vector82.X, vector82.Y, num825, num826, randomShot, num829, 0f, Main.myPlayer, 0f, 0f); + } else { - canFireSplitingFireball = true; + canFireSplitingFireball = true; randomShot = mod.ProjectileType("BrimstoneBarrage"); for (int num186 = 1; num186 <= 8; num186++) { num180 = player.position.X + (float)player.width * 0.5f - value9.X; num182 = player.position.Y + (float)player.height * 0.5f - value9.Y; num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182)); - float speedBoost = (float)(num186 > 4 ? -(num186 - 4) : num186); - num183 = (8f + speedBoost) / num183; + float speedBoost = (float)(num186 > 4 ? -(num186 - 4) : num186); + num183 = (8f + speedBoost) / num183; num180 *= num183; num182 *= num183; Projectile.NewProjectile(value9.X, value9.Y, num180 + speedBoost, num182 + speedBoost, randomShot, num829, 0f, Main.myPlayer, 0f, 0f); @@ -1173,23 +1167,23 @@ namespace CalamityMod.NPCs.SupremeCalamitas { npc.rotation = num803; //change float num383 = wormAlive ? 26f : 30f; - if ((double)npc.life < (double)npc.lifeMax * 0.95) + if ((double)npc.life < (double)npc.lifeMax * 0.95) { num383 += 1f; } - if ((double)npc.life < (double)npc.lifeMax * 0.85) + if ((double)npc.life < (double)npc.lifeMax * 0.85) { num383 += 1f; } - if ((double)npc.life < (double)npc.lifeMax * 0.7) + if ((double)npc.life < (double)npc.lifeMax * 0.7) { num383 += 1f; } - if ((double)npc.life < (double)npc.lifeMax * 0.6) + if ((double)npc.life < (double)npc.lifeMax * 0.6) { num383 += 1f; } - if ((double)npc.life < (double)npc.lifeMax * 0.5) + if ((double)npc.life < (double)npc.lifeMax * 0.5) { num383 += 1f; } @@ -1201,50 +1195,50 @@ namespace CalamityMod.NPCs.SupremeCalamitas npc.velocity.X = num384 * num386; npc.velocity.Y = num385 * num386; npc.ai[1] = 2f; - } - else if (npc.ai[1] == 2f) + } + else if (npc.ai[1] == 2f) { npc.ai[2] += 1f; - if (npc.ai[2] >= 25f) + if (npc.ai[2] >= 25f) { npc.velocity.X = npc.velocity.X * 0.96f; npc.velocity.Y = npc.velocity.Y * 0.96f; - if ((double)npc.velocity.X > -0.1 && (double)npc.velocity.X < 0.1) + if ((double)npc.velocity.X > -0.1 && (double)npc.velocity.X < 0.1) { npc.velocity.X = 0f; } - if ((double)npc.velocity.Y > -0.1 && (double)npc.velocity.Y < 0.1) + if ((double)npc.velocity.Y > -0.1 && (double)npc.velocity.Y < 0.1) { npc.velocity.Y = 0f; } - } - else + } + else { npc.rotation = (float)Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X) - 1.57f; } - if (npc.ai[2] >= 70f) + if (npc.ai[2] >= 70f) { npc.ai[3] += 1f; npc.ai[2] = 0f; npc.target = 255; npc.rotation = num803; - if (npc.ai[3] >= 2f) + if (npc.ai[3] >= 2f) { npc.ai[1] = -1f; - } + } else { npc.ai[1] = 1f; } } } - else if (npc.ai[1] == 3f) + else if (npc.ai[1] == 3f) { npc.TargetClosest(true); float num412 = 32f; float num413 = 1.2f; int num414 = 1; - if (npc.position.X + (float)(npc.width / 2) < player.position.X + (float)player.width) + if (npc.position.X + (float)(npc.width / 2) < player.position.X + (float)player.width) { num414 = -1; } @@ -1255,62 +1249,62 @@ namespace CalamityMod.NPCs.SupremeCalamitas num417 = num412 / num417; num415 *= num417; num416 *= num417; - if (npc.velocity.X < num415) + if (npc.velocity.X < num415) { npc.velocity.X = npc.velocity.X + num413; - if (npc.velocity.X < 0f && num415 > 0f) + if (npc.velocity.X < 0f && num415 > 0f) { npc.velocity.X = npc.velocity.X + num413; } - } - else if (npc.velocity.X > num415) + } + else if (npc.velocity.X > num415) { npc.velocity.X = npc.velocity.X - num413; - if (npc.velocity.X > 0f && num415 < 0f) + if (npc.velocity.X > 0f && num415 < 0f) { npc.velocity.X = npc.velocity.X - num413; } } - if (npc.velocity.Y < num416) + if (npc.velocity.Y < num416) { npc.velocity.Y = npc.velocity.Y + num413; - if (npc.velocity.Y < 0f && num416 > 0f) + if (npc.velocity.Y < 0f && num416 > 0f) { npc.velocity.Y = npc.velocity.Y + num413; } - } - else if (npc.velocity.Y > num416) + } + else if (npc.velocity.Y > num416) { npc.velocity.Y = npc.velocity.Y - num413; - if (npc.velocity.Y > 0f && num416 < 0f) + if (npc.velocity.Y > 0f && num416 < 0f) { npc.velocity.Y = npc.velocity.Y - num413; } } npc.ai[2] += 1f; - if (npc.ai[2] >= 480f) + if (npc.ai[2] >= 480f) { npc.ai[1] = -1f; npc.target = 255; npc.netUpdate = true; - } + } else { - if (!player.dead) + if (!player.dead) { npc.ai[3] += wormAlive ? 0.5f : 1f; } - if (npc.ai[3] >= 20f) + if (npc.ai[3] >= 20f) { npc.ai[3] = 0f; vector40 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); num415 = player.position.X + (float)(player.width / 2) - vector40.X; num416 = player.position.Y + (float)(player.height / 2) - vector40.Y; - if (Main.netMode != 1) + if (Main.netMode != 1) { float num418 = 10f * uDieLul; int num419 = expertMode ? 150 : 200; //600 500 - int num420 = mod.ProjectileType("BrimstoneHellblast"); + int num420 = mod.ProjectileType("BrimstoneHellblast"); num417 = (float)Math.Sqrt((double)(num415 * num415 + num416 * num416)); num417 = num418 / num417; num415 *= num417; @@ -1382,7 +1376,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas npc.localAI[1] = 0f; float num837 = 5f * uDieLul; int num838 = expertMode ? 150 : 200; //600 500 - int num839 = mod.ProjectileType("BrimstoneFireblast"); + int num839 = mod.ProjectileType("BrimstoneFireblast"); num836 = (float)Math.Sqrt((double)(num834 * num834 + num835 * num835)); num836 = num837 / num836; num834 *= num836; @@ -1401,47 +1395,47 @@ namespace CalamityMod.NPCs.SupremeCalamitas return; } } - if (npc.ai[1] == -1f) + if (npc.ai[1] == -1f) { - phaseChange++; - if (phaseChange > 23) - { - phaseChange = 0; - } - int phase = 0; //0 = shots above 1 = charge 2 = nothing 3 = hellblasts 4 = fireblasts - switch (phaseChange) - { - case 0: phase = 0; willCharge = false; break; //0341 - case 1: phase = 3; break; - case 2: phase = 4; willCharge = true; break; - case 3: phase = 1; break; - case 4: phase = 1; break; //1430 - case 5: phase = 4; willCharge = false; break; - case 6: phase = 3; break; - case 7: phase = 0; willCharge = true; break; - case 8: phase = 1; break; //1034 - case 9: phase = 0; willCharge = false; break; - case 10: phase = 3; break; - case 11: phase = 4; break; - case 12: phase = 4; break; //4310 - case 13: phase = 3; willCharge = true; break; - case 14: phase = 1; break; - case 15: phase = 0; willCharge = false; break; - case 16: phase = 4; break; //4411 - case 17: phase = 4; willCharge = true; break; - case 18: phase = 1; break; - case 19: phase = 1; break; - case 20: phase = 0; break; //0101 - case 21: phase = 1; break; - case 22: phase = 0; break; - case 23: phase = 1; break; - } + phaseChange++; + if (phaseChange > 23) + { + phaseChange = 0; + } + int phase = 0; //0 = shots above 1 = charge 2 = nothing 3 = hellblasts 4 = fireblasts + switch (phaseChange) + { + case 0: phase = 0; willCharge = false; break; //0341 + case 1: phase = 3; break; + case 2: phase = 4; willCharge = true; break; + case 3: phase = 1; break; + case 4: phase = 1; break; //1430 + case 5: phase = 4; willCharge = false; break; + case 6: phase = 3; break; + case 7: phase = 0; willCharge = true; break; + case 8: phase = 1; break; //1034 + case 9: phase = 0; willCharge = false; break; + case 10: phase = 3; break; + case 11: phase = 4; break; + case 12: phase = 4; break; //4310 + case 13: phase = 3; willCharge = true; break; + case 14: phase = 1; break; + case 15: phase = 0; willCharge = false; break; + case 16: phase = 4; break; //4411 + case 17: phase = 4; willCharge = true; break; + case 18: phase = 1; break; + case 19: phase = 1; break; + case 20: phase = 0; break; //0101 + case 21: phase = 1; break; + case 22: phase = 0; break; + case 23: phase = 1; break; + } npc.ai[1] = (float)phase; npc.ai[2] = 0f; npc.ai[3] = 0f; return; } - if ((double)npc.life < (double)npc.lifeMax * 0.4) + if ((double)npc.life < (double)npc.lifeMax * 0.4) { npc.ai[0] = 1f; npc.ai[1] = 0f; @@ -1451,41 +1445,41 @@ namespace CalamityMod.NPCs.SupremeCalamitas return; } } - #endregion - #region Transition - else if (npc.ai[0] == 1f || npc.ai[0] == 2f) + #endregion + #region Transition + else if (npc.ai[0] == 1f || npc.ai[0] == 2f) { npc.dontTakeDamage = true; npc.chaseable = false; - if (npc.ai[0] == 1f) + if (npc.ai[0] == 1f) { npc.ai[2] += 0.005f; - if ((double)npc.ai[2] > 0.5) + if ((double)npc.ai[2] > 0.5) { npc.ai[2] = 0.5f; } } - else + else { npc.ai[2] -= 0.005f; - if (npc.ai[2] < 0f) + if (npc.ai[2] < 0f) { npc.ai[2] = 0f; } } npc.rotation += npc.ai[2]; npc.ai[1] += 1f; - if (npc.ai[1] == 100f) + if (npc.ai[1] == 100f) { npc.ai[0] += 1f; npc.ai[1] = 0f; - if (npc.ai[0] == 3f) + if (npc.ai[0] == 3f) { npc.ai[2] = 0f; - } - else + } + else { - for (int num388 = 0; num388 < 50; num388++) + for (int num388 = 0; num388 < 50; num388++) { Dust.NewDust(npc.position, npc.width, npc.height, 235, (float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f, 0, default(Color), 1f); } @@ -1495,42 +1489,42 @@ namespace CalamityMod.NPCs.SupremeCalamitas Dust.NewDust(npc.position, npc.width, npc.height, 235, (float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f, 0, default(Color), 1f); npc.velocity.X = npc.velocity.X * 0.98f; npc.velocity.Y = npc.velocity.Y * 0.98f; - if ((double)npc.velocity.X > -0.1 && (double)npc.velocity.X < 0.1) + if ((double)npc.velocity.X > -0.1 && (double)npc.velocity.X < 0.1) { npc.velocity.X = 0f; } - if ((double)npc.velocity.Y > -0.1 && (double)npc.velocity.Y < 0.1) + if ((double)npc.velocity.Y > -0.1 && (double)npc.velocity.Y < 0.1) { npc.velocity.Y = 0f; return; } } - #endregion - #region LastStage - else + #endregion + #region LastStage + else { - npc.damage = expertMode ? 720 : 450; - if (NPC.AnyNPCs(mod.NPCType("SCalWormHead"))) - { - wormAlive = true; - npc.dontTakeDamage = true; - npc.chaseable = false; - } - else - { - if (NPC.AnyNPCs(mod.NPCType("SoulSeekerSupreme"))) - { - npc.dontTakeDamage = true; - npc.chaseable = false; - } - else - { - npc.dontTakeDamage = false; - npc.chaseable = true; - } - wormAlive = false; - } - if (npc.ai[1] == 0f) + npc.damage = expertMode ? 720 : 450; + if (NPC.AnyNPCs(mod.NPCType("SCalWormHead"))) + { + wormAlive = true; + npc.dontTakeDamage = true; + npc.chaseable = false; + } + else + { + if (NPC.AnyNPCs(mod.NPCType("SoulSeekerSupreme"))) + { + npc.dontTakeDamage = true; + npc.chaseable = false; + } + else + { + npc.dontTakeDamage = false; + npc.chaseable = true; + } + wormAlive = false; + } + if (npc.ai[1] == 0f) { float num823 = 12f; float num824 = 0.12f; @@ -1592,7 +1586,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas npc.localAI[1] = 0f; float num828 = 10f * uDieLul; int num829 = expertMode ? 150 : 200; //600 500 - Vector2 value9 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + Vector2 value9 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); float num180 = player.position.X + (float)player.width * 0.5f - value9.X; float num181 = Math.Abs(num180) * 0.1f; float num182 = player.position.Y + (float)player.height * 0.5f - value9.Y - num181; @@ -1603,47 +1597,47 @@ namespace CalamityMod.NPCs.SupremeCalamitas value9.X += num180; value9.Y += num182; int randomShot = Main.rand.Next(6); - if (randomShot == 0 && canFireSplitingFireball) - { - canFireSplitingFireball = false; - randomShot = mod.ProjectileType("BrimstoneFireblast"); - num827 = (float)Math.Sqrt((double)(num825 * num825 + num826 * num826)); - num827 = num828 / num827; - num825 *= num827; - num826 *= num827; - vector82.X += num825 * 15f; - vector82.Y += num826 * 15f; - Projectile.NewProjectile(vector82.X, vector82.Y, num825, num826, randomShot, num829, 0f, Main.myPlayer, 0f, 0f); - } - else if (randomShot == 1 && canFireSplitingFireball) - { - canFireSplitingFireball = false; - randomShot = mod.ProjectileType("BrimstoneGigaBlast"); - num827 = (float)Math.Sqrt((double)(num825 * num825 + num826 * num826)); - num827 = num828 / num827; - num825 *= num827; - num826 *= num827; - vector82.X += num825 * 15f; - vector82.Y += num826 * 15f; - Projectile.NewProjectile(vector82.X, vector82.Y, num825, num826, randomShot, num829, 0f, Main.myPlayer, 0f, 0f); - } - else - { - canFireSplitingFireball = true; - randomShot = mod.ProjectileType("BrimstoneBarrage"); - for (int num186 = 1; num186 <= 8; num186++) - { - num180 = player.position.X + (float)player.width * 0.5f - value9.X; - num182 = player.position.Y + (float)player.height * 0.5f - value9.Y; - num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182)); - float speedBoost = (float)(num186 > 4 ? -(num186 - 4) : num186); - num183 = (8f + speedBoost) / num183; - num180 *= num183; - num182 *= num183; - Projectile.NewProjectile(value9.X, value9.Y, num180 + speedBoost, num182 + speedBoost, randomShot, num829, 0f, Main.myPlayer, 0f, 0f); - } - } - return; + if (randomShot == 0 && canFireSplitingFireball) + { + canFireSplitingFireball = false; + randomShot = mod.ProjectileType("BrimstoneFireblast"); + num827 = (float)Math.Sqrt((double)(num825 * num825 + num826 * num826)); + num827 = num828 / num827; + num825 *= num827; + num826 *= num827; + vector82.X += num825 * 15f; + vector82.Y += num826 * 15f; + Projectile.NewProjectile(vector82.X, vector82.Y, num825, num826, randomShot, num829, 0f, Main.myPlayer, 0f, 0f); + } + else if (randomShot == 1 && canFireSplitingFireball) + { + canFireSplitingFireball = false; + randomShot = mod.ProjectileType("BrimstoneGigaBlast"); + num827 = (float)Math.Sqrt((double)(num825 * num825 + num826 * num826)); + num827 = num828 / num827; + num825 *= num827; + num826 *= num827; + vector82.X += num825 * 15f; + vector82.Y += num826 * 15f; + Projectile.NewProjectile(vector82.X, vector82.Y, num825, num826, randomShot, num829, 0f, Main.myPlayer, 0f, 0f); + } + else + { + canFireSplitingFireball = true; + randomShot = mod.ProjectileType("BrimstoneBarrage"); + for (int num186 = 1; num186 <= 8; num186++) + { + num180 = player.position.X + (float)player.width * 0.5f - value9.X; + num182 = player.position.Y + (float)player.height * 0.5f - value9.Y; + num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182)); + float speedBoost = (float)(num186 > 4 ? -(num186 - 4) : num186); + num183 = (8f + speedBoost) / num183; + num180 *= num183; + num182 *= num183; + Projectile.NewProjectile(value9.X, value9.Y, num180 + speedBoost, num182 + speedBoost, randomShot, num829, 0f, Main.myPlayer, 0f, 0f); + } + } + return; } } } @@ -1651,15 +1645,15 @@ namespace CalamityMod.NPCs.SupremeCalamitas { npc.rotation = num803; //change float num383 = wormAlive ? 31f : 35f; - if ((double)npc.life < (double)npc.lifeMax * 0.3) + if ((double)npc.life < (double)npc.lifeMax * 0.3) { num383 += 1f; } - if ((double)npc.life < (double)npc.lifeMax * 0.2) + if ((double)npc.life < (double)npc.lifeMax * 0.2) { num383 += 1f; } - if ((double)npc.life < (double)npc.lifeMax * 0.1) + if ((double)npc.life < (double)npc.lifeMax * 0.1) { num383 += 1f; } @@ -1671,50 +1665,50 @@ namespace CalamityMod.NPCs.SupremeCalamitas npc.velocity.X = num384 * num386; npc.velocity.Y = num385 * num386; npc.ai[1] = 2f; - } - else if (npc.ai[1] == 2f) + } + else if (npc.ai[1] == 2f) { npc.ai[2] += 1f; - if (npc.ai[2] >= 25f) + if (npc.ai[2] >= 25f) { npc.velocity.X = npc.velocity.X * 0.96f; npc.velocity.Y = npc.velocity.Y * 0.96f; - if ((double)npc.velocity.X > -0.1 && (double)npc.velocity.X < 0.1) + if ((double)npc.velocity.X > -0.1 && (double)npc.velocity.X < 0.1) { npc.velocity.X = 0f; } - if ((double)npc.velocity.Y > -0.1 && (double)npc.velocity.Y < 0.1) + if ((double)npc.velocity.Y > -0.1 && (double)npc.velocity.Y < 0.1) { npc.velocity.Y = 0f; } - } - else + } + else { npc.rotation = (float)Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X) - 1.57f; } - if (npc.ai[2] >= 70f) + if (npc.ai[2] >= 70f) { npc.ai[3] += 1f; npc.ai[2] = 0f; npc.target = 255; npc.rotation = num803; //change - if (npc.ai[3] >= 1f) + if (npc.ai[3] >= 1f) { npc.ai[1] = -1f; - } + } else { npc.ai[1] = 1f; } } } - else if (npc.ai[1] == 3f) + else if (npc.ai[1] == 3f) { npc.TargetClosest(true); float num412 = 32f; float num413 = 1.2f; int num414 = 1; - if (npc.position.X + (float)(npc.width / 2) < player.position.X + (float)player.width) + if (npc.position.X + (float)(npc.width / 2) < player.position.X + (float)player.width) { num414 = -1; } @@ -1725,31 +1719,31 @@ namespace CalamityMod.NPCs.SupremeCalamitas num417 = num412 / num417; num415 *= num417; num416 *= num417; - if (npc.velocity.X < num415) + if (npc.velocity.X < num415) { npc.velocity.X = npc.velocity.X + num413; - if (npc.velocity.X < 0f && num415 > 0f) + if (npc.velocity.X < 0f && num415 > 0f) { npc.velocity.X = npc.velocity.X + num413; } } - else if (npc.velocity.X > num415) + else if (npc.velocity.X > num415) { npc.velocity.X = npc.velocity.X - num413; - if (npc.velocity.X > 0f && num415 < 0f) + if (npc.velocity.X > 0f && num415 < 0f) { npc.velocity.X = npc.velocity.X - num413; } } - if (npc.velocity.Y < num416) + if (npc.velocity.Y < num416) { npc.velocity.Y = npc.velocity.Y + num413; - if (npc.velocity.Y < 0f && num416 > 0f) + if (npc.velocity.Y < 0f && num416 > 0f) { npc.velocity.Y = npc.velocity.Y + num413; } } - else if (npc.velocity.Y > num416) + else if (npc.velocity.Y > num416) { npc.velocity.Y = npc.velocity.Y - num413; if (npc.velocity.Y > 0f && num416 < 0f) @@ -1758,7 +1752,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } } npc.ai[2] += 1f; - if (npc.ai[2] >= 300f) + if (npc.ai[2] >= 300f) { npc.ai[1] = -1f; npc.target = 255; @@ -1766,21 +1760,21 @@ namespace CalamityMod.NPCs.SupremeCalamitas } else { - if (!player.dead) + if (!player.dead) { npc.ai[3] += wormAlive ? 0.5f : 1f; - } + } if (npc.ai[3] >= 24f) { npc.ai[3] = 0f; vector40 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); num415 = player.position.X + (float)(player.width / 2) - vector40.X; num416 = player.position.Y + (float)(player.height / 2) - vector40.Y; - if (Main.netMode != 1) + if (Main.netMode != 1) { float num418 = 10f * uDieLul; int num419 = expertMode ? 150 : 200; //600 500 - int num420 = mod.ProjectileType("BrimstoneHellblast"); + int num420 = mod.ProjectileType("BrimstoneHellblast"); num417 = (float)Math.Sqrt((double)(num415 * num415 + num416 * num416)); num417 = num418 / num417; num415 *= num417; @@ -1847,12 +1841,12 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (Main.netMode != 1) { npc.localAI[1] += wormAlive ? 0.5f : 1f; - if (npc.localAI[1] > 100f) + if (npc.localAI[1] > 100f) { npc.localAI[1] = 0f; float num837 = 5f * uDieLul; int num838 = expertMode ? 150 : 200; //600 500 - int num839 = mod.ProjectileType("BrimstoneFireblast"); + int num839 = mod.ProjectileType("BrimstoneFireblast"); num836 = (float)Math.Sqrt((double)(num834 * num834 + num835 * num835)); num836 = num837 / num836; num834 *= num836; @@ -1871,161 +1865,161 @@ namespace CalamityMod.NPCs.SupremeCalamitas return; } } - if (npc.ai[1] == -1f) + if (npc.ai[1] == -1f) { - phaseChange++; - if (phaseChange > 23) - { - phaseChange = 0; - } - int phase = 0; //0 = shots above 1 = charge 2 = nothing 3 = hellblasts 4 = fireblasts - switch (phaseChange) - { - case 0: phase = 0; willCharge = false; break; //0341 - case 1: phase = 3; break; - case 2: phase = 4; willCharge = true; break; - case 3: phase = 1; break; - case 4: phase = 1; break; //1430 - case 5: phase = 4; willCharge = false; break; - case 6: phase = 3; break; - case 7: phase = 0; willCharge = true; break; - case 8: phase = 1; break; //1034 - case 9: phase = 0; willCharge = false; break; - case 10: phase = 3; break; - case 11: phase = 4; break; - case 12: phase = 4; break; //4310 - case 13: phase = 3; willCharge = true; break; - case 14: phase = 1; break; - case 15: phase = 0; willCharge = false; break; - case 16: phase = 4; break; //4411 - case 17: phase = 4; willCharge = true; break; - case 18: phase = 1; break; - case 19: phase = 1; break; - case 20: phase = 0; break; //0101 - case 21: phase = 1; break; - case 22: phase = 0; break; - case 23: phase = 1; break; - } - npc.ai[1] = (float)phase; - npc.ai[2] = 0f; - npc.ai[3] = 0f; - return; - } + phaseChange++; + if (phaseChange > 23) + { + phaseChange = 0; + } + int phase = 0; //0 = shots above 1 = charge 2 = nothing 3 = hellblasts 4 = fireblasts + switch (phaseChange) + { + case 0: phase = 0; willCharge = false; break; //0341 + case 1: phase = 3; break; + case 2: phase = 4; willCharge = true; break; + case 3: phase = 1; break; + case 4: phase = 1; break; //1430 + case 5: phase = 4; willCharge = false; break; + case 6: phase = 3; break; + case 7: phase = 0; willCharge = true; break; + case 8: phase = 1; break; //1034 + case 9: phase = 0; willCharge = false; break; + case 10: phase = 3; break; + case 11: phase = 4; break; + case 12: phase = 4; break; //4310 + case 13: phase = 3; willCharge = true; break; + case 14: phase = 1; break; + case 15: phase = 0; willCharge = false; break; + case 16: phase = 4; break; //4411 + case 17: phase = 4; willCharge = true; break; + case 18: phase = 1; break; + case 19: phase = 1; break; + case 20: phase = 0; break; //0101 + case 21: phase = 1; break; + case 22: phase = 0; break; + case 23: phase = 1; break; + } + npc.ai[1] = (float)phase; + npc.ai[2] = 0f; + npc.ai[3] = 0f; + return; + } } - #endregion - } + #endregion + } - #region Loot - public override void NPCLoot() + #region Loot + public override void NPCLoot() { - if (lootTimer < 6000) //75 seconds for bullet hells + 25 seconds for normal phases - { - string key = "Mods.CalamityMod.SupremeBossText2"; - Color messageColor = Color.Orange; - if (Main.netMode == 0) - { - Main.NewText(Language.GetTextValue(key), messageColor); - } - else if (Main.netMode == 2) - { - NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); - } - return; - } - if (Main.player[npc.target].GetModPlayer(mod).sCalKillCount == 0) //first time you kill her - { - if (Main.LocalPlayer.GetModPlayer(mod).sCalDeathCount == 0) - { - string key = "Mods.CalamityMod.SupremeBossText16"; //die no times - Color messageColor = Color.Orange; - if (Main.netMode == 0) - { - Main.NewText(Language.GetTextValue(key), messageColor); - } - else if (Main.netMode == 2) - { - NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); - } - } - else if (Main.LocalPlayer.GetModPlayer(mod).sCalDeathCount == 1) - { - string key = "Mods.CalamityMod.SupremeBossText17"; //die one time - Color messageColor = Color.Orange; - if (Main.netMode == 0) - { - Main.NewText(Language.GetTextValue(key), messageColor); - } - else if (Main.netMode == 2) - { - NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); - } - } - else if (Main.LocalPlayer.GetModPlayer(mod).sCalDeathCount == 2) - { - string key = "Mods.CalamityMod.SupremeBossText18"; //die two times - Color messageColor = Color.Orange; - if (Main.netMode == 0) - { - Main.NewText(Language.GetTextValue(key), messageColor); - } - else if (Main.netMode == 2) - { - NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); - } - } - else if (Main.LocalPlayer.GetModPlayer(mod).sCalDeathCount == 3) - { - string key = "Mods.CalamityMod.SupremeBossText19"; //die three times - Color messageColor = Color.Orange; - if (Main.netMode == 0) - { - Main.NewText(Language.GetTextValue(key), messageColor); - } - else if (Main.netMode == 2) - { - NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); - } - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CheatTestThing")); - } - else //die however many times - { - string key = "Mods.CalamityMod.SupremeBossText10"; - Color messageColor = Color.Orange; - if (Main.netMode == 0) - { - Main.NewText(Language.GetTextValue(key), messageColor); - } - else if (Main.netMode == 2) - { - NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); - } - } - } - else //all times after first kill - { - string key = "Mods.CalamityMod.SupremeBossText10"; - Color messageColor = Color.Orange; - if (Main.netMode == 0) - { - Main.NewText(Language.GetTextValue(key), messageColor); - } - else if (Main.netMode == 2) - { - NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); - } - } - if (Main.player[npc.target].GetModPlayer(mod).sCalKillCount < 5) - { - Main.player[npc.target].GetModPlayer(mod).sCalKillCount++; - } - if (Main.expertMode) + if (lootTimer < 6000) //75 seconds for bullet hells + 25 seconds for normal phases { - npc.DropItemInstanced(npc.position, npc.Size, mod.ItemType("CalamitousEssence"), Main.rand.Next(30, 41), true); - if (CalamityWorld.revenge) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Vehemenc")); - } - int itemChoice = Main.rand.Next(14); + string key = "Mods.CalamityMod.SupremeBossText2"; + Color messageColor = Color.Orange; + if (Main.netMode == 0) + { + Main.NewText(Language.GetTextValue(key), messageColor); + } + else if (Main.netMode == 2) + { + NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); + } + return; + } + if (Main.player[npc.target].GetModPlayer(mod).sCalKillCount == 0) //first time you kill her + { + if (Main.LocalPlayer.GetModPlayer(mod).sCalDeathCount == 0) + { + string key = "Mods.CalamityMod.SupremeBossText16"; //die no times + Color messageColor = Color.Orange; + if (Main.netMode == 0) + { + Main.NewText(Language.GetTextValue(key), messageColor); + } + else if (Main.netMode == 2) + { + NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); + } + } + else if (Main.LocalPlayer.GetModPlayer(mod).sCalDeathCount == 1) + { + string key = "Mods.CalamityMod.SupremeBossText17"; //die one time + Color messageColor = Color.Orange; + if (Main.netMode == 0) + { + Main.NewText(Language.GetTextValue(key), messageColor); + } + else if (Main.netMode == 2) + { + NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); + } + } + else if (Main.LocalPlayer.GetModPlayer(mod).sCalDeathCount == 2) + { + string key = "Mods.CalamityMod.SupremeBossText18"; //die two times + Color messageColor = Color.Orange; + if (Main.netMode == 0) + { + Main.NewText(Language.GetTextValue(key), messageColor); + } + else if (Main.netMode == 2) + { + NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); + } + } + else if (Main.LocalPlayer.GetModPlayer(mod).sCalDeathCount == 3) + { + string key = "Mods.CalamityMod.SupremeBossText19"; //die three times + Color messageColor = Color.Orange; + if (Main.netMode == 0) + { + Main.NewText(Language.GetTextValue(key), messageColor); + } + else if (Main.netMode == 2) + { + NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); + } + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CheatTestThing")); + } + else //die however many times + { + string key = "Mods.CalamityMod.SupremeBossText10"; + Color messageColor = Color.Orange; + if (Main.netMode == 0) + { + Main.NewText(Language.GetTextValue(key), messageColor); + } + else if (Main.netMode == 2) + { + NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); + } + } + } + else //all times after first kill + { + string key = "Mods.CalamityMod.SupremeBossText10"; + Color messageColor = Color.Orange; + if (Main.netMode == 0) + { + Main.NewText(Language.GetTextValue(key), messageColor); + } + else if (Main.netMode == 2) + { + NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); + } + } + if (Main.player[npc.target].GetModPlayer(mod).sCalKillCount < 5) + { + Main.player[npc.target].GetModPlayer(mod).sCalKillCount++; + } + if (Main.expertMode) + { + npc.DropItemInstanced(npc.position, npc.Size, mod.ItemType("CalamitousEssence"), Main.rand.Next(30, 41), true); + if (CalamityWorld.revenge) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Vehemenc")); + } + int itemChoice = Main.rand.Next(14); if (itemChoice == 0) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Animus")); //done @@ -2083,64 +2077,64 @@ namespace CalamityMod.NPCs.SupremeCalamitas Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CrystylCrusher")); //done } } - else - { - npc.DropItemInstanced(npc.position, npc.Size, mod.ItemType("CalamitousEssence"), Main.rand.Next(20, 31), true); - } + else + { + npc.DropItemInstanced(npc.position, npc.Size, mod.ItemType("CalamitousEssence"), Main.rand.Next(20, 31), true); + } } - #endregion + #endregion - public override void BossLoot(ref string name, ref int potionType) + public override void BossLoot(ref string name, ref int potionType) { potionType = mod.ItemType("SupremeHealingPotion"); } - public override void ModifyHitByProjectile(Projectile projectile, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) - { - if (projectile.type == mod.ProjectileType("AngryChicken")) - { - damage /= 2; - } - if (projectile.type == mod.ProjectileType("ApothMark") || projectile.type == mod.ProjectileType("ApothJaws")) - { - damage /= 25; - } - } - - public override bool StrikeNPC(ref double damage, int defense, ref float knockback, int hitDirection, ref bool crit) + public override void ModifyHitByProjectile(Projectile projectile, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) { - if (damage > npc.lifeMax / 10) - { - damage = 0; - return false; - } - double newDamage = (damage + (int)((double)defense * 0.25)); - float protection = (CalamityWorld.death ? 0.75f : 0.7f); //45% - if (CalamityWorld.bossRushActive) - { - protection = 0.6f; - } - if (newDamage < 1.0) - { - newDamage = 1.0; - } - if (npc.ichor) - { - protection *= 0.9f; //41% - } - else if (npc.onFire2) - { - protection *= 0.91f; - } - if (startFifthAttack) - { - protection *= 1.2f; //90% or 84% - } - if (protectionBoost) - { - protection = 0.99f; //99% - } - if (newDamage >= 1.0) + if (projectile.type == mod.ProjectileType("AngryChicken")) + { + damage /= 2; + } + if (projectile.type == mod.ProjectileType("ApothMark") || projectile.type == mod.ProjectileType("ApothJaws")) + { + damage /= 3; + } + } + + public override bool StrikeNPC(ref double damage, int defense, ref float knockback, int hitDirection, ref bool crit) + { + if (damage > npc.lifeMax / 10) + { + damage = 0; + return false; + } + double newDamage = (damage + (int)((double)defense * 0.25)); + float protection = (CalamityWorld.death ? 0.75f : 0.7f); //45% + if (CalamityWorld.bossRushActive) + { + protection = 0.6f; + } + if (newDamage < 1.0) + { + newDamage = 1.0; + } + if (npc.ichor) + { + protection *= 0.9f; //41% + } + else if (npc.onFire2) + { + protection *= 0.91f; + } + if (startFifthAttack) + { + protection *= 1.2f; //90% or 84% + } + if (protectionBoost) + { + protection = 0.99f; //99% + } + if (newDamage >= 1.0) { newDamage = (double)((int)((double)(1f - protection) * newDamage)); if (newDamage < 1.0) @@ -2152,49 +2146,83 @@ namespace CalamityMod.NPCs.SupremeCalamitas return true; } - public override bool CheckActive() - { - return canDespawn; - } - - public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) + public override bool CheckActive() { - scale = 1.5f; + return canDespawn; + } + + public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) + { + scale = 1.5f; return null; } - + public override bool CanHitPlayer(Player target, ref int cooldownSlot) { cooldownSlot = 1; return true; } - public override void FindFrame(int frameHeight) - { - npc.frameCounter += 0.15f; - npc.frameCounter %= Main.npcFrameCount[npc.type]; - int frame = (int)npc.frameCounter; - npc.frame.Y = frame * frameHeight; - } + public override void FindFrame(int frameHeight) + { + npc.frameCounter += 0.15f; + npc.frameCounter %= Main.npcFrameCount[npc.type]; + int frame = (int)npc.frameCounter; + npc.frame.Y = frame * frameHeight; + } - public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) - { - Mod mod = ModLoader.GetMod("CalamityMod"); - Texture2D texture = Main.npcTexture[npc.type]; - Texture2D texture2 = mod.GetTexture("NPCs/SupremeCalamitas/SupremeCalamitas2"); - Color newColor = (willCharge ? new Color(100, 0, 0, 0) : drawColor); - if (npc.ai[0] > 1f) - { - CalamityMod.DrawTexture(spriteBatch, texture2, 0, npc, newColor); - } - else - { - CalamityMod.DrawTexture(spriteBatch, texture, 0, npc, newColor); - } - return false; - } + public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) + { + Mod mod = ModLoader.GetMod("CalamityMod"); + Texture2D texture = Main.npcTexture[npc.type]; + if (npc.ai[0] > 1f) + { + texture = mod.GetTexture("NPCs/SupremeCalamitas/SupremeCalamitas2"); + } + else + { + texture = Main.npcTexture[npc.type]; + } + Color newColor = (willCharge ? new Color(100, 0, 0, 0) : drawColor); + SpriteEffects spriteEffects = SpriteEffects.None; + Microsoft.Xna.Framework.Color color24 = npc.GetAlpha(newColor); + Microsoft.Xna.Framework.Color color25 = Lighting.GetColor((int)((double)npc.position.X + (double)npc.width * 0.5) / 16, (int)(((double)npc.position.Y + (double)npc.height * 0.5) / 16.0)); + int num156 = Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type]; + int y3 = num156 * (int)npc.frameCounter; + Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle(0, y3, texture.Width, num156); + Vector2 origin2 = rectangle.Size() / 2f; + int num157 = 8; + int num158 = 2; + int num159 = 1; + float num160 = 0f; + int num161 = num159; + while (((num158 > 0 && num161 < num157) || (num158 < 0 && num161 > num157)) && Lighting.NotRetro) + { + Microsoft.Xna.Framework.Color color26 = npc.GetAlpha(color25); + { + goto IL_6899; + } + IL_6881: + num161 += num158; + continue; + IL_6899: + float num164 = (float)(num157 - num161); + if (num158 < 0) + { + num164 = (float)(num159 - num161); + } + color26 *= num164 / ((float)NPCID.Sets.TrailCacheLength[npc.type] * 1.5f); + Vector2 value4 = (npc.oldPos[num161]); + float num165 = npc.rotation; + Main.spriteBatch.Draw(texture, value4 + npc.Size / 2f - Main.screenPosition + new Vector2(0, npc.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rectangle), color26, num165 + npc.rotation * num160 * (float)(num161 - 1) * -(float)spriteEffects.HasFlag(SpriteEffects.FlipHorizontally).ToDirectionInt(), origin2, npc.scale, spriteEffects, 0f); + goto IL_6881; + } + var something = npc.direction == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; + spriteBatch.Draw(texture, npc.Center - Main.screenPosition + new Vector2(0, npc.gfxOffY), npc.frame, color24, npc.rotation, npc.frame.Size() / 2, npc.scale, something, 0); + return false; + } - public override void HitEffect(int hitDirection, double damage) + public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 5; k++) { @@ -2228,13 +2256,13 @@ namespace CalamityMod.NPCs.SupremeCalamitas } } } - + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { npc.lifeMax = (int)(npc.lifeMax * 0.8f * bossLifeScale); npc.damage = (int)(npc.damage * 0.8f); } - + public override void OnHitPlayer(Player player, int damage, bool crit) { player.AddBuff(mod.BuffType("VulnerabilityHex"), 600, true); diff --git a/NPCs/SupremeCalamitas/SupremeCataclysm.cs b/NPCs/SupremeCalamitas/SupremeCataclysm.cs index a715bc11f1..d9de369958 100644 --- a/NPCs/SupremeCalamitas/SupremeCataclysm.cs +++ b/NPCs/SupremeCalamitas/SupremeCataclysm.cs @@ -36,6 +36,8 @@ namespace CalamityMod.NPCs.SupremeCalamitas npc.aiStyle = -1; //new aiType = -1; //new npc.knockBackResist = 0f; + NPCID.Sets.TrailCacheLength[npc.type] = 8; + NPCID.Sets.TrailingMode[npc.type] = 1; for (int k = 0; k < npc.buffImmune.Length; k++) { npc.buffImmune[k] = true; @@ -143,11 +145,51 @@ namespace CalamityMod.NPCs.SupremeCalamitas { int num695 = Projectile.NewProjectile(vector85.X, vector85.Y, num692, num693, num691, num690, 0f, Main.myPlayer, 0f, 0f); } - return; } } - public override bool CheckActive() + public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) + { + SpriteEffects spriteEffects = SpriteEffects.None; + Microsoft.Xna.Framework.Color color24 = npc.GetAlpha(drawColor); + Microsoft.Xna.Framework.Color color25 = Lighting.GetColor((int)((double)npc.position.X + (double)npc.width * 0.5) / 16, (int)(((double)npc.position.Y + (double)npc.height * 0.5) / 16.0)); + Texture2D texture2D3 = Main.npcTexture[npc.type]; + int num156 = Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type]; + int y3 = num156 * (int)npc.frameCounter; + Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle(0, y3, texture2D3.Width, num156); + Vector2 origin2 = rectangle.Size() / 2f; + int num157 = 8; + int num158 = 2; + int num159 = 1; + float num160 = 0f; + int num161 = num159; + while (((num158 > 0 && num161 < num157) || (num158 < 0 && num161 > num157)) && Lighting.NotRetro) + { + Microsoft.Xna.Framework.Color color26 = npc.GetAlpha(color25); + { + goto IL_6899; + } + IL_6881: + num161 += num158; + continue; + IL_6899: + float num164 = (float)(num157 - num161); + if (num158 < 0) + { + num164 = (float)(num159 - num161); + } + color26 *= num164 / ((float)NPCID.Sets.TrailCacheLength[npc.type] * 1.5f); + Vector2 value4 = (npc.oldPos[num161]); + float num165 = npc.rotation; + Main.spriteBatch.Draw(texture2D3, value4 + npc.Size / 2f - Main.screenPosition + new Vector2(0, npc.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rectangle), color26, num165 + npc.rotation * num160 * (float)(num161 - 1) * -(float)spriteEffects.HasFlag(SpriteEffects.FlipHorizontally).ToDirectionInt(), origin2, npc.scale, spriteEffects, 0f); + goto IL_6881; + } + var something = npc.direction == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; + spriteBatch.Draw(texture2D3, npc.Center - Main.screenPosition + new Vector2(0, npc.gfxOffY), npc.frame, color24, npc.rotation, npc.frame.Size() / 2, npc.scale, something, 0); + return false; + } + + public override bool CheckActive() { return false; } diff --git a/NPCs/SupremeCalamitas/SupremeCatastrophe.cs b/NPCs/SupremeCalamitas/SupremeCatastrophe.cs index c806db93e7..0ff4246a5b 100644 --- a/NPCs/SupremeCalamitas/SupremeCatastrophe.cs +++ b/NPCs/SupremeCalamitas/SupremeCatastrophe.cs @@ -38,6 +38,8 @@ namespace CalamityMod.NPCs.SupremeCalamitas npc.knockBackResist = 0f; npc.noGravity = true; npc.noTileCollide = true; + NPCID.Sets.TrailCacheLength[npc.type] = 8; + NPCID.Sets.TrailingMode[npc.type] = 1; for (int k = 0; k < npc.buffImmune.Length; k++) { npc.buffImmune[k] = true; @@ -143,11 +145,51 @@ namespace CalamityMod.NPCs.SupremeCalamitas { int num695 = Projectile.NewProjectile(vector85.X, vector85.Y, num692, num693, num691, num690, 0f, Main.myPlayer, 0f, 0f); } - return; } } - public override bool CheckActive() + public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) + { + SpriteEffects spriteEffects = SpriteEffects.None; + Microsoft.Xna.Framework.Color color24 = npc.GetAlpha(drawColor); + Microsoft.Xna.Framework.Color color25 = Lighting.GetColor((int)((double)npc.position.X + (double)npc.width * 0.5) / 16, (int)(((double)npc.position.Y + (double)npc.height * 0.5) / 16.0)); + Texture2D texture2D3 = Main.npcTexture[npc.type]; + int num156 = Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type]; + int y3 = num156 * (int)npc.frameCounter; + Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle(0, y3, texture2D3.Width, num156); + Vector2 origin2 = rectangle.Size() / 2f; + int num157 = 8; + int num158 = 2; + int num159 = 1; + float num160 = 0f; + int num161 = num159; + while (((num158 > 0 && num161 < num157) || (num158 < 0 && num161 > num157)) && Lighting.NotRetro) + { + Microsoft.Xna.Framework.Color color26 = npc.GetAlpha(color25); + { + goto IL_6899; + } + IL_6881: + num161 += num158; + continue; + IL_6899: + float num164 = (float)(num157 - num161); + if (num158 < 0) + { + num164 = (float)(num159 - num161); + } + color26 *= num164 / ((float)NPCID.Sets.TrailCacheLength[npc.type] * 1.5f); + Vector2 value4 = (npc.oldPos[num161]); + float num165 = npc.rotation; + Main.spriteBatch.Draw(texture2D3, value4 + npc.Size / 2f - Main.screenPosition + new Vector2(0, npc.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rectangle), color26, num165 + npc.rotation * num160 * (float)(num161 - 1) * -(float)spriteEffects.HasFlag(SpriteEffects.FlipHorizontally).ToDirectionInt(), origin2, npc.scale, spriteEffects, 0f); + goto IL_6881; + } + var something = npc.direction == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; + spriteBatch.Draw(texture2D3, npc.Center - Main.screenPosition + new Vector2(0, npc.gfxOffY), npc.frame, color24, npc.rotation, npc.frame.Size() / 2, npc.scale, something, 0); + return false; + } + + public override bool CheckActive() { return false; } diff --git a/NPCs/TheDevourerofGods/DevourerofGodsBody.cs b/NPCs/TheDevourerofGods/DevourerofGodsBody.cs index 1e7b9203e9..f52a5ce5f9 100644 --- a/NPCs/TheDevourerofGods/DevourerofGodsBody.cs +++ b/NPCs/TheDevourerofGods/DevourerofGodsBody.cs @@ -41,7 +41,8 @@ namespace CalamityMod.NPCs.TheDevourerofGods npc.noGravity = true; npc.noTileCollide = true; npc.chaseable = false; - npc.HitSound = SoundID.NPCHit4; + npc.canGhostHeal = false; + npc.HitSound = SoundID.NPCHit4; npc.DeathSound = SoundID.NPCDeath14; npc.netAlways = true; npc.boss = true; diff --git a/NPCs/TheDevourerofGods/DevourerofGodsBody2.cs b/NPCs/TheDevourerofGods/DevourerofGodsBody2.cs index f506f99bec..31c3321b6c 100644 --- a/NPCs/TheDevourerofGods/DevourerofGodsBody2.cs +++ b/NPCs/TheDevourerofGods/DevourerofGodsBody2.cs @@ -16,7 +16,7 @@ namespace CalamityMod.NPCs.TheDevourerofGods public override void SetStaticDefaults() { - DisplayName.SetDefault("Devourer of Thots"); + DisplayName.SetDefault("Cosmic Guardian"); } public override void SetDefaults() @@ -35,6 +35,7 @@ namespace CalamityMod.NPCs.TheDevourerofGods npc.behindTiles = true; npc.noGravity = true; npc.noTileCollide = true; + npc.canGhostHeal = false; npc.HitSound = SoundID.NPCHit4; npc.DeathSound = SoundID.NPCDeath14; npc.netAlways = true; diff --git a/NPCs/TheDevourerofGods/DevourerofGodsBodyS.cs b/NPCs/TheDevourerofGods/DevourerofGodsBodyS.cs index 34bc481c7a..5759189837 100644 --- a/NPCs/TheDevourerofGods/DevourerofGodsBodyS.cs +++ b/NPCs/TheDevourerofGods/DevourerofGodsBodyS.cs @@ -28,14 +28,14 @@ namespace CalamityMod.NPCs.TheDevourerofGods npc.width = 54; //34 npc.height = 54; //34 npc.defense = 0; - npc.lifeMax = CalamityWorld.revenge ? 625000 : 550000; //720000 672000 - if (CalamityWorld.death) + npc.lifeMax = CalamityWorld.revenge ? 937500 : 825000; //720000 672000 + if (CalamityWorld.death) + { + npc.lifeMax = 1530000; + } + if (CalamityWorld.bossRushActive) { - npc.lifeMax = 1020000; - } - if (CalamityWorld.bossRushActive) - { - npc.lifeMax = CalamityWorld.death ? 9000000 : 8000000; + npc.lifeMax = CalamityWorld.death ? 5000000 : 4600000; } npc.aiStyle = -1; //new aiType = -1; //new @@ -46,7 +46,8 @@ namespace CalamityMod.NPCs.TheDevourerofGods npc.noGravity = true; npc.noTileCollide = true; npc.chaseable = false; - npc.HitSound = SoundID.NPCHit4; + npc.canGhostHeal = false; + npc.HitSound = SoundID.NPCHit4; npc.DeathSound = SoundID.NPCDeath14; npc.netAlways = true; npc.boss = true; @@ -128,7 +129,6 @@ namespace CalamityMod.NPCs.TheDevourerofGods if (Main.npc[(int)npc.ai[2]].localAI[3] >= 1f) { npc.damage = 0; - npc.dontTakeDamage = true; npc.alpha = Main.npc[(int)npc.ai[2]].alpha; } else if (Main.npc[(int)npc.ai[1]].alpha < 128) @@ -137,7 +137,6 @@ namespace CalamityMod.NPCs.TheDevourerofGods if (npc.alpha <= 0 && invinceTime <= 0) { npc.damage = expertMode ? 352 : 220; - npc.dontTakeDamage = false; npc.alpha = 0; } } diff --git a/NPCs/TheDevourerofGods/DevourerofGodsHead.cs b/NPCs/TheDevourerofGods/DevourerofGodsHead.cs index e19b6a2ea5..139b2da631 100644 --- a/NPCs/TheDevourerofGods/DevourerofGodsHead.cs +++ b/NPCs/TheDevourerofGods/DevourerofGodsHead.cs @@ -51,7 +51,7 @@ namespace CalamityMod.NPCs.TheDevourerofGods npc.knockBackResist = 0f; npc.scale = 1.4f; npc.boss = true; - npc.value = Item.buyPrice(1, 50, 0, 0); + npc.value = Item.buyPrice(0, 75, 0, 0); npc.alpha = 255; npc.behindTiles = true; npc.noGravity = true; diff --git a/NPCs/TheDevourerofGods/DevourerofGodsHead2.cs b/NPCs/TheDevourerofGods/DevourerofGodsHead2.cs index 7ac22b8f39..eb4ba11d17 100644 --- a/NPCs/TheDevourerofGods/DevourerofGodsHead2.cs +++ b/NPCs/TheDevourerofGods/DevourerofGodsHead2.cs @@ -25,7 +25,7 @@ namespace CalamityMod.NPCs.TheDevourerofGods public override void SetStaticDefaults() { - DisplayName.SetDefault("Devourer of Thots"); + DisplayName.SetDefault("Cosmic Guardian"); } public override void SetDefaults() @@ -44,7 +44,8 @@ namespace CalamityMod.NPCs.TheDevourerofGods npc.behindTiles = true; npc.noGravity = true; npc.noTileCollide = true; - npc.HitSound = SoundID.NPCHit4; + npc.canGhostHeal = false; + npc.HitSound = SoundID.NPCHit4; npc.DeathSound = SoundID.NPCDeath14; npc.netAlways = true; for (int k = 0; k < npc.buffImmune.Length; k++) diff --git a/NPCs/TheDevourerofGods/DevourerofGodsHeadS.cs b/NPCs/TheDevourerofGods/DevourerofGodsHeadS.cs index 8a2ea35a65..5fb17b2d35 100644 --- a/NPCs/TheDevourerofGods/DevourerofGodsHeadS.cs +++ b/NPCs/TheDevourerofGods/DevourerofGodsHeadS.cs @@ -44,23 +44,23 @@ namespace CalamityMod.NPCs.TheDevourerofGods npc.width = 100; //130 npc.height = 144; //150 npc.defense = 0; - npc.lifeMax = CalamityWorld.revenge ? 625000 : 550000; //720000 672000 - if (CalamityWorld.death) - { - npc.lifeMax = 1020000; - } - if (CalamityWorld.bossRushActive) - { - npc.lifeMax = CalamityWorld.death ? 9000000 : 8000000; - } - npc.takenDamageMultiplier = CalamityWorld.bossRushActive ? 1.5f : 1.25f; + npc.lifeMax = CalamityWorld.revenge ? 937500 : 825000; //720000 672000 + if (CalamityWorld.death) + { + npc.lifeMax = 1530000; + } + if (CalamityWorld.bossRushActive) + { + npc.lifeMax = CalamityWorld.death ? 5000000 : 4600000; + } + npc.takenDamageMultiplier = CalamityWorld.bossRushActive ? 1.5f : 1.25f; npc.aiStyle = -1; //new aiType = -1; //new animationType = 10; //new npc.knockBackResist = 0f; npc.scale = 1.1f; npc.boss = true; - npc.value = Item.buyPrice(3, 0, 0, 0); + npc.value = Item.buyPrice(1, 0, 0, 0); npc.alpha = 255; npc.behindTiles = true; npc.noGravity = true; @@ -111,16 +111,15 @@ namespace CalamityMod.NPCs.TheDevourerofGods } else if (npc.localAI[3] == 1f) { - npc.damage = 0; - npc.dontTakeDamage = true; - npc.alpha += 5; - if (npc.alpha == 255) + //npc.damage = 0; + npc.alpha += 4; + if (npc.alpha == 204) //255 { laserShoot = 0; } - if (npc.alpha >= 255) + if (npc.alpha >= 204) //255 { - npc.alpha = 255; + npc.alpha = 204; //255 idleCounter--; if (idleCounter <= 0) { @@ -139,8 +138,7 @@ namespace CalamityMod.NPCs.TheDevourerofGods { flameTimer = 270; } - npc.damage = expertMode ? 480 : 300; - npc.dontTakeDamage = false; + //npc.damage = expertMode ? 480 : 300; npc.alpha = 0; npc.localAI[3] = 0f; npc.netUpdate = true; @@ -149,19 +147,26 @@ namespace CalamityMod.NPCs.TheDevourerofGods } else { - npc.alpha -= 12; + npc.alpha -= 6; if (npc.alpha < 0) { npc.alpha = 0; } - if (npc.dontTakeDamage || npc.localAI[3] > 0f) + if (npc.localAI[3] > 0f) { - npc.damage = expertMode ? 480 : 300; - npc.dontTakeDamage = false; + //npc.damage = expertMode ? 480 : 300; npc.localAI[3] = 0f; npc.netUpdate = true; } } + if (npc.alpha <= 0) + { + npc.damage = expertMode ? 480 : 300; + } + else + { + npc.damage = 0; + } if (speedBoost4) { if (!halfLife) diff --git a/NPCs/TheDevourerofGods/DevourerofGodsTail.cs b/NPCs/TheDevourerofGods/DevourerofGodsTail.cs index 416fa39508..411b5d709c 100644 --- a/NPCs/TheDevourerofGods/DevourerofGodsTail.cs +++ b/NPCs/TheDevourerofGods/DevourerofGodsTail.cs @@ -40,7 +40,8 @@ namespace CalamityMod.NPCs.TheDevourerofGods npc.behindTiles = true; npc.noGravity = true; npc.noTileCollide = true; - npc.HitSound = SoundID.NPCHit4; + npc.canGhostHeal = false; + npc.HitSound = SoundID.NPCHit4; npc.DeathSound = SoundID.NPCDeath14; npc.netAlways = true; npc.boss = true; diff --git a/NPCs/TheDevourerofGods/DevourerofGodsTail2.cs b/NPCs/TheDevourerofGods/DevourerofGodsTail2.cs index 912385def1..3fd0d302f3 100644 --- a/NPCs/TheDevourerofGods/DevourerofGodsTail2.cs +++ b/NPCs/TheDevourerofGods/DevourerofGodsTail2.cs @@ -17,7 +17,7 @@ namespace CalamityMod.NPCs.TheDevourerofGods public override void SetStaticDefaults() { - DisplayName.SetDefault("Devourer of Thots"); + DisplayName.SetDefault("Cosmic Guardian"); } public override void SetDefaults() @@ -36,7 +36,8 @@ namespace CalamityMod.NPCs.TheDevourerofGods npc.behindTiles = true; npc.noGravity = true; npc.noTileCollide = true; - npc.HitSound = SoundID.NPCHit4; + npc.canGhostHeal = false; + npc.HitSound = SoundID.NPCHit4; npc.DeathSound = SoundID.NPCDeath14; npc.netAlways = true; for (int k = 0; k < npc.buffImmune.Length; k++) diff --git a/NPCs/TheDevourerofGods/DevourerofGodsTailS.cs b/NPCs/TheDevourerofGods/DevourerofGodsTailS.cs index 3f1e5f137c..4440de0110 100644 --- a/NPCs/TheDevourerofGods/DevourerofGodsTailS.cs +++ b/NPCs/TheDevourerofGods/DevourerofGodsTailS.cs @@ -30,16 +30,16 @@ namespace CalamityMod.NPCs.TheDevourerofGods npc.width = 80; //90 npc.height = 98; //90 npc.defense = 0; - npc.lifeMax = CalamityWorld.revenge ? 625000 : 550000; //720000 672000 + npc.lifeMax = CalamityWorld.revenge ? 937500 : 825000; //720000 672000 if (CalamityWorld.death) { - npc.lifeMax = 1020000; + npc.lifeMax = 1530000; } - if (CalamityWorld.bossRushActive) - { - npc.lifeMax = CalamityWorld.death ? 9000000 : 8000000; - } - npc.takenDamageMultiplier = CalamityWorld.bossRushActive ? 1.5f : 1.25f; + if (CalamityWorld.bossRushActive) + { + npc.lifeMax = CalamityWorld.death ? 5000000 : 4600000; + } + npc.takenDamageMultiplier = CalamityWorld.bossRushActive ? 1.5f : 1.25f; npc.aiStyle = -1; //new aiType = -1; //new animationType = 10; //new @@ -48,7 +48,8 @@ namespace CalamityMod.NPCs.TheDevourerofGods npc.behindTiles = true; npc.noGravity = true; npc.noTileCollide = true; - npc.HitSound = SoundID.NPCHit4; + npc.canGhostHeal = false; + npc.HitSound = SoundID.NPCHit4; npc.DeathSound = SoundID.NPCDeath14; npc.netAlways = true; npc.boss = true; @@ -166,7 +167,6 @@ namespace CalamityMod.NPCs.TheDevourerofGods if (Main.npc[(int)npc.ai[2]].localAI[3] >= 1f) { npc.damage = 0; - npc.dontTakeDamage = true; npc.alpha = Main.npc[(int)npc.ai[2]].alpha; } else if (Main.npc[(int)npc.ai[1]].alpha < 128) @@ -175,7 +175,6 @@ namespace CalamityMod.NPCs.TheDevourerofGods if (npc.alpha <= 0 && invinceTime <= 0) { npc.damage = expertMode ? 288 : 180; - npc.dontTakeDamage = false; npc.alpha = 0; } } @@ -450,7 +449,7 @@ namespace CalamityMod.NPCs.TheDevourerofGods damage = (int)((double)damage * multiplier); if (damageTaken >= 50000.0) { - damage = (int)((double)damage * 0.5); + damage = (int)((double)damage * 0.2); } return true; } diff --git a/NPCs/TownNPCs/FAP.cs b/NPCs/TownNPCs/FAP.cs index a35bc31014..586724a838 100644 --- a/NPCs/TownNPCs/FAP.cs +++ b/NPCs/TownNPCs/FAP.cs @@ -298,10 +298,26 @@ namespace CalamityMod.NPCs.TownNPCs shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 35, 0, 0); nextSlot++; - /*shop.item[nextSlot].SetDefaults(mod.ItemType("OddMushroom")); //trips you out and boosts all stats - shop.item[nextSlot].shopCustomPrice = Item.buyPrice(1, 0, 0, 0); - nextSlot++;*/ - } + shop.item[nextSlot].SetDefaults(mod.ItemType("BlueCandle")); + shop.item[nextSlot].shopCustomPrice = Item.buyPrice(2, 0, 0, 0); + nextSlot++; + + shop.item[nextSlot].SetDefaults(mod.ItemType("PinkCandle")); + shop.item[nextSlot].shopCustomPrice = Item.buyPrice(2, 0, 0, 0); + nextSlot++; + + shop.item[nextSlot].SetDefaults(mod.ItemType("PurpleCandle")); + shop.item[nextSlot].shopCustomPrice = Item.buyPrice(2, 0, 0, 0); + nextSlot++; + + shop.item[nextSlot].SetDefaults(mod.ItemType("YellowCandle")); + shop.item[nextSlot].shopCustomPrice = Item.buyPrice(2, 0, 0, 0); + nextSlot++; + + shop.item[nextSlot].SetDefaults(mod.ItemType("OddMushroom")); + shop.item[nextSlot].shopCustomPrice = Item.buyPrice(3, 0, 0, 0); + nextSlot++; + } public override void TownNPCAttackStrength(ref int damage, ref float knockback) { diff --git a/NPCs/TownNPCs/SEAHOE.cs b/NPCs/TownNPCs/SEAHOE.cs new file mode 100644 index 0000000000..44cc67a110 --- /dev/null +++ b/NPCs/TownNPCs/SEAHOE.cs @@ -0,0 +1,309 @@ +using System.Collections.Generic; +using Terraria; +using Terraria.GameContent.Events; +using Terraria.Localization; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.NPCs.TownNPCs +{ + [AutoloadHead] + public class SEAHOE : ModNPC + { + public bool tips = false; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sea King"); + + Main.npcFrameCount[npc.type] = 25; + NPCID.Sets.ExtraFramesCount[npc.type] = 5; + NPCID.Sets.AttackFrameCount[npc.type] = 4; + NPCID.Sets.DangerDetectRange[npc.type] = 700; + NPCID.Sets.AttackType[npc.type] = 0; + NPCID.Sets.AttackTime[npc.type] = 90; + NPCID.Sets.AttackAverageChance[npc.type] = 30; + } + + public override void SetDefaults() + { + npc.townNPC = true; + npc.friendly = true; + npc.width = 30; + npc.height = 58; + npc.aiStyle = 7; + npc.damage = 10; + npc.defense = 15; + npc.lifeMax = 250; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath1; + npc.knockBackResist = 0.5f; + animationType = NPCID.Guide; + } + + public override bool CanTownNPCSpawn(int numTownNPCs, int money) + { + return CalamityWorld.downedCLAM; + } + + public override string TownNPCName() + { + return "Amidias"; + } + + public override void AI() + { + npc.breath += 2; + } + + public override string GetChat() + { + IList dialogue = new List(); + Player player = Main.player[Main.myPlayer]; + + if (npc.homeless) + { + if (Main.rand.Next(2) == 0) + return "Is this... what the world is like now? It seems so much more lifeless than when I saw it when I disappeared."; + else + return "Thank you for your service, my child, but I am afraid I am without a home now."; + } + if (Main.dayTime) + { + dialogue.Add("My homeland may have been dried up, but the memory of my people still exist. I will not let that be in vain."); + dialogue.Add("There is a lot that you do not know about this world, especially regarding the past. Much of it has been lost to history during the many wars that plagued it."); + dialogue.Add("How can I survive on land? Ah, that is a secret. No, actually... I can breathe air like you!"); + dialogue.Add("Why do you ask if it's the males who carry their young? Don't your males carry their young?"); + } + else + { + dialogue.Add("There be monsters lurking in the darkness. Most...unnatural monsters."); + dialogue.Add("Most creatures look up at the moon and admire it. I look up at it and fear it."); + dialogue.Add("Oh, me? I don't sleep. It's part of my nature."); + } + + int partyGirl = NPC.FindFirstNPC(NPCID.PartyGirl); + if (partyGirl != -1) + { + dialogue.Add(Main.npc[partyGirl].GivenName + " asked if my nose could be used as a vuvuzela. What is a vuvuzela?"); + } + + int lilBitch = NPC.FindFirstNPC(NPCID.Angler); + if (lilBitch != -1) + { + dialogue.Add("Meet me at " + Main.npc[lilBitch].GivenName + "'s house at night. We're going to throw him to the Trashers."); + dialogue.Add("Not sure how " + Main.npc[lilBitch].GivenName + " has not been roasted and digested by now, hanging around the sulphuric seas for so long. Peharps it has gotten to his head."); + } + + if (Main.bloodMoon) + { + dialogue.Add("I'm never keen on these nights. They're so violent."); + } + + /* + int yharim = NPC.FindFirstNPC(NPCID.Yharim); + if (yharim != -1) + { + dialogue.Add("Oh, Yharim... did he ever realize what he was doing? He seems so...calm, as if his rage had been satiated."); + }*/ + + if (Main.player[Main.myPlayer].GetModPlayer().sirenPet) + { + dialogue.Add("Ah, nice duds, my child!"); + } + + if ((Main.player[Main.myPlayer].GetModPlayer().sirenBoobs && !Main.player[Main.myPlayer].GetModPlayer().sirenBoobsHide) || + (Main.player[Main.myPlayer].GetModPlayer().sirenBoobsAlt && !Main.player[Main.myPlayer].GetModPlayer().sirenBoobsAltHide)) + { + dialogue.Add("Shouldn't you be wearing a clam bra?"); + } + + if (Main.hardMode) + { + dialogue.Add("The balance between light and darkness is tipping. Stay strong, my child."); + dialogue.Add("Ah, you are starting to realize just how complicated this world is now. You are learning the story of what became of him."); + } + + if (NPC.downedMoonlord) + { + dialogue.Add("I must admit, I am quite shaken up by now. I thought I would never see the elder god again in my life when he was sealed in the moon for the first time..."); + dialogue.Add("Times like this I wish my home was still in one piece instead of evaporated away. I don't blame the witch for anything, it's just... Oh, never mind."); + } + + if (CalamityWorld.downedDoG) + { + dialogue.Add("Do you ever get the feeling that something out there is watching you very carefully? Whatever it is, it's very small and very sly, I think."); + dialogue.Add("Calamitas was wrong, I guess. Defeating Ceaseless Void and the Devourer of Gods did not wipe out the entire universe... but it didn't do absolutely nothing."); + } + + /*if (CalamityWorld.downedYharon) + { + dialogue.Add("I'm worried for Lord Yharim. He was not in a particular good mood once we found out you defeated his close friend."); + }*/ + + return dialogue[Main.rand.Next(dialogue.Count)]; + } + + public string Lore() + { + IList dialogue = new List(); + string worldEvil = WorldGen.crimson ? "Crimson" : "Corruption"; + + if (CalamityWorld.downedYharon) + { + dialogue.Add("Defeating the Jungle dragon has allowed you a choice. You can face off against Supreme Calamitas, Draedon, or Lord Yharim himself. Choose wisely."); + dialogue.Add("Pockets of ore have appeared once more in the land. These will allow you to create the most powerful weaponry and armor imagined!"); + dialogue.Add("Supreme Calamitas is no mere witch. Myth has it that Calamitas rejected her old name in the face of her tragedy and to say her old name is considered a death sentence."); + dialogue.Add("Lord Yharim is very strong. He may not even fight you at his fullest power, which is fortunate for you. His attacks may just kill you in one hit, so be careful."); + dialogue.Add("Draedon's style of confrontation is very... alien and hands off. You may be more likely to fight any one of his mechs before taking him down."); + } + else if (CalamityWorld.downedDoG) + { + dialogue.Add("The Devourer of Gods cosmic armor is unique in that it is capable of not only protecting his body from tearing itself apart when ripping pockets of space and time, but also controlling his own powers."); + dialogue.Add("With the cosmic bars you have, you can create and combine your weapons into extremely powerful and useful items."); + dialogue.Add("The Devourer of Gods is very, very powerful. However, he is young, foolhardy, and very lazy. Perhaps if he's allowed to grow up some more and train his powers, he would be a force to be reckoned with."); + dialogue.Add("Your adventure focuses to the jungle, it seems. Clearing out the infestation of the Bumblebirbs that have cropped up is an excellent idea."); + dialogue.Add("Ah, the dragon Yharon is fickle. You may find that he may refuse to use his full power unless you are strong enough to unleash the power of the Dark Sun."); + } + else if (CalamityWorld.downedProvidence) + { + dialogue.Add("The Rune of Kos is an ancient Rune used to awaken people from a crystalline prison. When you activate the Rune's gemtech code, you run the risk of attracting the attention of the Sentinels..."); + dialogue.Add("There used to be five Sentinels of the Devourer that patrolled the lands looking for the profaned goddess. You only have to worry about three of them now, in certain locations."); + dialogue.Add("Ironic, is it not, that Statis was defeated by the very Sentinel his people were inspired from. Then again, Braelor's death was just as ironic against the claws of Draedon's machines."); + dialogue.Add("The Dungeon seems to be active now. You may hear the faint whisperings of angry spirits who have not left to the Void.. I would recommend looking there before taking on the Sentinels."); + } + else if (NPC.downedMoonlord) + { + dialogue.Add("The rain by now has turned to acid rain. Your skin will be burning if you stay in it too long."); + dialogue.Add("Profaned creatures now lurk in the Hallow and in Hell. You defeat enough of them, you'll be able to catch the attention of the Profaned Guardians, and more."); + dialogue.Add("The Profaned Guardians will do anything to protect their guardian. Makes sense they die for her, since they can be revived just as quickly."); + dialogue.Add("Touching Providence's offerings is usually a death wish. Shame that Yharim didn't think to just mess with her things to get her out of hiding."); + dialogue.Add("Providence is as much the sun goddess as much as the Moon Lord is the moon god. They are two sides of each coin, choosing to remain neutral amongst our petty squabbles."); + dialogue.Add("The stories have it that when Providence faced and defeated Yharim and his forces, she lost a lot of energy and reverted to a more skeletal form. She's merely a fraction of the power as she was before"); + dialogue.Add("If you pay attention to the Profaned Guardians and Providence, you'll notice they have gems in their bodies. That 'gemtech' is actually their source of power and self awareness."); + } + else if (NPC.downedGolemBoss) + { + dialogue.Add("The men at the front of the dungeon are performing a dangerous ritual to release the Moon Lord from his prison. You must defeat them!"); + dialogue.Add("Here's a little bit of gossip for you; Supposedly that Lunatic Cultist was formerly the apprentice of Yharim's own brother."); + dialogue.Add("The Abyss is become far more active than it has been before. You might be able to mine out some of the abyss by now."); + dialogue.Add("The plague was just one of the many experiments authorized by Yharim to raze towns to the ground. This is probably one of the few he shelved for being too terrible."); + } + else if (CalamityWorld.downedCryogen) + { + dialogue.Add("You will find more ores will be unlocked as the magic sealing them away is broken. Some of them may require more than just the ore itself to create."); + dialogue.Add("I would recommend saving some of your old items. You never know if you can engineer them into stronger weapons in the future."); + dialogue.Add("Draedon's Mechs have been rampaging the landscape for ages before they were sealed. Defeating at least one of them opens up the possibility to fight other creatures that lurk in the night."); + dialogue.Add("If you take an idol down to the Brimstone Crags, you might be able to see just what is lurking in the shadows."); + dialogue.Add("The Brimstone Crags... Yharim never liked that place, and did everything he could to raze it to the ground. It might explain a few things about him."); + dialogue.Add("The witch just might offer you an opportunity for a challenge if you are willing to during the night."); + dialogue.Add("Defeating the mechanical creatures that lurk in the night will unveil a path in the jungle. There you will be able to release more of the ores sealed by magic."); + dialogue.Add("Be careful when defeating Plantera and Golem. You might accidentally unleash a new threat in the jungle that needs to be quelled."); + dialogue.Add("The Golem is the protector of the Lihzhard Temple, ensuring that the Sun God's treasures are protected. It's not the only Golem, either."); + } + else if (Main.hardMode) + { + dialogue.Add("Have you heard of the story of Archmage Permafrost? Rumor has it he's been locked away in his ice castle by Lord Yharim. I wonder if you can free him after castle Cryogen is put on ice...?"); + } + else + { + dialogue.Add("There are rumor of ores that are in latency. When you defeat certain bosses, you are able to release the magic locked up by them to mine and use."); + dialogue.Add("Been to the Brimstone Crags? I wouldn't recommend going there unless you are strong enough to. There's valuable loot if you have a shadow key, though."); + dialogue.Add("Ah yes, the Abyss. It is full of strong enemies that could kill you in a heartbeat. I would explore the dungeon first before you go down there."); + dialogue.Add("The Sulphurous Seas are dangerous, but if you can brave them, you will find the most interesting treasures and secrets down in the Abyss."); + dialogue.Add("The Sulphurous Seas are a result of a combination of natural volcanic soils leeching into the waters, along with severe pollution in the heydays of Draedon's experiments."); + dialogue.Add("Be careful what you attack in the " + worldEvil + ". You might just unveil a greater threat than what was there before."); + dialogue.Add("Scattered across the lands are shrines dedicated to the gods. You can take whatever is in them, but a few items you may not be able to use until much, much later."); + dialogue.Add("Have you heard the story of Statis? Rumor has it that their Gods are still alive, and it might take releasing the dungeon of its shackles to meet them."); + dialogue.Add("The dungeon is a dark place. None of us know what it is for, however the ancient Eidolist Cultists used it for worship before Lord Yharim took it over."); + dialogue.Add("The " + worldEvil + " used to be easily manageable and controlled by nature. However, the recent wars and pollution have tipped the balance out of favor."); + } + + return dialogue[Main.rand.Next(dialogue.Count)]; + + } + + public override void SetChatButtons(ref string button, ref string button2) + { + button = Language.GetTextValue("LegacyInterface.28"); + button2 = "Help"; + } + + public override void OnChatButtonClicked(bool firstButton, ref bool shop) + { + if (firstButton) + { + shop = true; + tips = false; + } + else + { + shop = false; + tips = true; + Main.npcChatText = Lore(); + Player player = Main.player[Main.myPlayer]; + player.AddBuff(mod.BuffType("AmidiasBlessing"), 36000); + } + } + + public override void SetupShop(Chest shop, ref int nextSlot) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("Shellshooter")); + nextSlot++; + shop.item[nextSlot].SetDefaults(mod.ItemType("SnapClam")); + nextSlot++; + shop.item[nextSlot].SetDefaults(mod.ItemType("SandDollar")); + nextSlot++; + shop.item[nextSlot].SetDefaults(mod.ItemType("Waywasher")); + nextSlot++; + shop.item[nextSlot].SetDefaults(mod.ItemType("CoralCannon")); + nextSlot++; + shop.item[nextSlot].SetDefaults(mod.ItemType("UrchinFlail")); + nextSlot++; + shop.item[nextSlot].SetDefaults(mod.ItemType("AmidiasTrident")); + nextSlot++; + shop.item[nextSlot].SetDefaults(mod.ItemType("MagicalConch")); + nextSlot++; + if (NPC.downedFishron) + { + shop.item[nextSlot].SetDefaults(ItemID.TruffleWorm); + shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 40, 0, 0); + nextSlot++; + } + } + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Amidias/Amidias"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Amidias/Amidias2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Amidias/Amidias3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Amidias/Amidias4"), 1f); + } + } + + public override void TownNPCAttackStrength(ref int damage, ref float knockback) + { + damage = 30; + knockback = 2f; + } + + public override void TownNPCAttackCooldown(ref int cooldown, ref int randExtraCooldown) + { + cooldown = 5; + } + + public override void TownNPCAttackProj(ref int projType, ref int attackDelay) + { + projType = mod.ProjectileType("SnapClamProj"); + attackDelay = 1; + } + + public override void TownNPCAttackProjSpeed(ref float multiplier, ref float gravityCorrection, ref float randomOffset) + { + multiplier = 16f; + gravityCorrection = 10f; + } + } +} \ No newline at end of file diff --git a/NPCs/TownNPCs/SEAHOE.png b/NPCs/TownNPCs/SEAHOE.png new file mode 100644 index 0000000000..d296072b39 Binary files /dev/null and b/NPCs/TownNPCs/SEAHOE.png differ diff --git a/NPCs/TownNPCs/SEAHOE_Head.png b/NPCs/TownNPCs/SEAHOE_Head.png new file mode 100644 index 0000000000..3f675c54f3 Binary files /dev/null and b/NPCs/TownNPCs/SEAHOE_Head.png differ diff --git a/NPCs/Yharon/DetonatingFlare.cs b/NPCs/Yharon/DetonatingFlare.cs index 43fe53c7f5..bc5fbd1bfb 100644 --- a/NPCs/Yharon/DetonatingFlare.cs +++ b/NPCs/Yharon/DetonatingFlare.cs @@ -33,6 +33,7 @@ namespace CalamityMod.NPCs.Yharon npc.knockBackResist = 0f; npc.noGravity = true; npc.noTileCollide = true; + npc.canGhostHeal = false; npc.HitSound = SoundID.NPCHit52; npc.DeathSound = SoundID.NPCDeath55; npc.alpha = 255; diff --git a/NPCs/Yharon/DetonatingFlare2.cs b/NPCs/Yharon/DetonatingFlare2.cs index d3d08dd992..444fa1f074 100644 --- a/NPCs/Yharon/DetonatingFlare2.cs +++ b/NPCs/Yharon/DetonatingFlare2.cs @@ -32,6 +32,7 @@ namespace CalamityMod.NPCs.Yharon npc.knockBackResist = 0f; npc.noGravity = true; npc.noTileCollide = true; + npc.canGhostHeal = false; npc.HitSound = SoundID.NPCHit52; npc.DeathSound = SoundID.NPCDeath55; npc.alpha = 255; diff --git a/NPCs/Yharon/Yharon.cs b/NPCs/Yharon/Yharon.cs index 09d8c335b1..45b836a08c 100644 --- a/NPCs/Yharon/Yharon.cs +++ b/NPCs/Yharon/Yharon.cs @@ -17,205 +17,207 @@ namespace CalamityMod.NPCs.Yharon public class Yharon : ModNPC { private Rectangle safeBox = default(Rectangle); - private bool protectionBoost = false; - private bool moveCloser = false; - private bool phaseOneLoot = false; - private bool dropLoot = false; - private int healCounter = 0; + private bool protectionBoost = false; + private bool moveCloser = false; + private bool phaseOneLoot = false; + private bool dropLoot = false; + private int healCounter = 0; - public override void SetStaticDefaults() + public override void SetStaticDefaults() { DisplayName.SetDefault("Jungle Dragon, Yharon"); Main.npcFrameCount[npc.type] = 7; } - + public override void SetDefaults() { npc.npcSlots = 50f; npc.damage = 330; - npc.width = 200; //150 - npc.height = 200; //100 + npc.width = 200; //200 + npc.height = 200; //200 npc.defense = 200; npc.lifeMax = CalamityWorld.revenge ? 2525000 : 2275000; - if (CalamityWorld.death) - { - npc.lifeMax = 3025000; - } - if (CalamityWorld.bossRushActive) - { - npc.lifeMax = CalamityWorld.death ? 8000000 : 7000000; - } - npc.knockBackResist = 0f; + if (CalamityWorld.death) + { + npc.lifeMax = 3025000; + } + if (CalamityWorld.bossRushActive) + { + npc.lifeMax = CalamityWorld.death ? 4000000 : 3700000; + } + npc.knockBackResist = 0f; npc.aiStyle = -1; //new - aiType = -1; //new - npc.value = Item.buyPrice(5, 0, 0, 0); + aiType = -1; //new + npc.value = Item.buyPrice(1, 50, 0, 0); npc.boss = true; + NPCID.Sets.TrailCacheLength[npc.type] = 8; + NPCID.Sets.TrailingMode[npc.type] = 1; for (int k = 0; k < npc.buffImmune.Length; k++) { npc.buffImmune[k] = true; npc.buffImmune[BuffID.Ichor] = false; - npc.buffImmune[BuffID.CursedInferno] = false; - npc.buffImmune[mod.BuffType("DemonFlames")] = false; - npc.buffImmune[mod.BuffType("Shred")] = false; - } + npc.buffImmune[BuffID.CursedInferno] = false; + npc.buffImmune[mod.BuffType("DemonFlames")] = false; + npc.buffImmune[mod.BuffType("Shred")] = false; + } npc.noGravity = true; npc.noTileCollide = true; npc.netAlways = true; - Mod calamityModMusic = ModLoader.GetMod("CalamityModMusic"); - if (calamityModMusic != null) - music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/YHARON"); - else - music = MusicID.Boss1; - if (CalamityWorld.downedProvidence && CalamityWorld.downedDoG && CalamityWorld.downedBuffedMothron || CalamityWorld.bossRushActive) - { - if (calamityModMusic != null) - music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/YHARONREBIRTH"); - else - music = MusicID.Boss3; - } - npc.HitSound = SoundID.NPCHit56; + Mod calamityModMusic = ModLoader.GetMod("CalamityModMusic"); + if (calamityModMusic != null) + music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/YHARON"); + else + music = MusicID.Boss1; + if (CalamityWorld.downedProvidence && CalamityWorld.downedDoG && CalamityWorld.downedBuffedMothron || CalamityWorld.bossRushActive) + { + if (calamityModMusic != null) + music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/YHARONREBIRTH"); + else + music = MusicID.Boss3; + } + npc.HitSound = SoundID.NPCHit56; npc.DeathSound = SoundID.NPCDeath60; bossBag = mod.ItemType("YharonBag"); } - + public override void AI() { - #region StartupOrSwitchToAI2 - dropLoot = (double)npc.life <= (double)npc.lifeMax * 0.1; - if (Main.raining) - { - Main.raining = false; - if (Main.netMode == 2) - { - NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); - } - } - if (npc.localAI[2] == 1f) - { - if ((!CalamityWorld.downedProvidence || !CalamityWorld.downedDoG) && !CalamityWorld.bossRushActive) - { - phaseOneLoot = true; - npc.DeathSound = null; - npc.dontTakeDamage = true; - npc.chaseable = false; - npc.velocity.Y = npc.velocity.Y - 0.4f; - if (npc.alpha < 255) - { - npc.alpha += 5; - if (npc.alpha > 255) - { - npc.alpha = 255; - } - } - if (npc.timeLeft > 55) - { - npc.timeLeft = 55; - } - if (npc.timeLeft < 5) - { - string key = "Mods.CalamityMod.DargonBossText3"; - Color messageColor = Color.Orange; - if (Main.netMode == 0) - { - Main.NewText(Language.GetTextValue(key), messageColor); - } - else if (Main.netMode == 2) - { - NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); - } - npc.localAI[2] = 2f; - npc.boss = false; - npc.life = 0; - if (dropLoot) - { - npc.NPCLoot(); - } - npc.active = false; - npc.netUpdate = true; - } - return; - } - if (!CalamityWorld.downedBuffedMothron && !CalamityWorld.bossRushActive) - { - phaseOneLoot = true; - npc.DeathSound = null; - npc.dontTakeDamage = true; - npc.chaseable = false; - npc.velocity.Y = npc.velocity.Y - 0.4f; - if (npc.alpha < 255) - { - npc.alpha += 5; - if (npc.alpha > 255) - { - npc.alpha = 255; - } - } - if (npc.timeLeft > 55) - { - npc.timeLeft = 55; - } - if (npc.timeLeft < 5) - { - string key = "Mods.CalamityMod.DargonBossText2"; - Color messageColor = Color.Orange; - if (Main.netMode == 0) - { - Main.NewText(Language.GetTextValue(key), messageColor); - } - else if (Main.netMode == 2) - { - NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); - } - npc.localAI[2] = 0f; - npc.boss = false; - npc.life = 0; - if (dropLoot) - { - npc.NPCLoot(); - } - npc.active = false; - npc.netUpdate = true; - } - return; - } - phaseOneLoot = false; - Yharon_AI2(); - return; - } - bool revenge = (CalamityWorld.revenge || CalamityWorld.bossRushActive); + #region StartupOrSwitchToAI2 + dropLoot = (double)npc.life <= (double)npc.lifeMax * 0.1; + if (Main.raining) + { + Main.raining = false; + if (Main.netMode == 2) + { + NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + } + } + if (npc.localAI[2] == 1f) + { + if ((!CalamityWorld.downedProvidence || !CalamityWorld.downedDoG) && !CalamityWorld.bossRushActive) + { + phaseOneLoot = true; + npc.DeathSound = null; + npc.dontTakeDamage = true; + npc.chaseable = false; + npc.velocity.Y = npc.velocity.Y - 0.4f; + if (npc.alpha < 255) + { + npc.alpha += 5; + if (npc.alpha > 255) + { + npc.alpha = 255; + } + } + if (npc.timeLeft > 55) + { + npc.timeLeft = 55; + } + if (npc.timeLeft < 5) + { + string key = "Mods.CalamityMod.DargonBossText3"; + Color messageColor = Color.Orange; + if (Main.netMode == 0) + { + Main.NewText(Language.GetTextValue(key), messageColor); + } + else if (Main.netMode == 2) + { + NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); + } + npc.localAI[2] = 2f; + npc.boss = false; + npc.life = 0; + if (dropLoot) + { + npc.NPCLoot(); + } + npc.active = false; + npc.netUpdate = true; + } + return; + } + if (!CalamityWorld.downedBuffedMothron && !CalamityWorld.bossRushActive) + { + phaseOneLoot = true; + npc.DeathSound = null; + npc.dontTakeDamage = true; + npc.chaseable = false; + npc.velocity.Y = npc.velocity.Y - 0.4f; + if (npc.alpha < 255) + { + npc.alpha += 5; + if (npc.alpha > 255) + { + npc.alpha = 255; + } + } + if (npc.timeLeft > 55) + { + npc.timeLeft = 55; + } + if (npc.timeLeft < 5) + { + string key = "Mods.CalamityMod.DargonBossText2"; + Color messageColor = Color.Orange; + if (Main.netMode == 0) + { + Main.NewText(Language.GetTextValue(key), messageColor); + } + else if (Main.netMode == 2) + { + NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); + } + npc.localAI[2] = 0f; + npc.boss = false; + npc.life = 0; + if (dropLoot) + { + npc.NPCLoot(); + } + npc.active = false; + npc.netUpdate = true; + } + return; + } + phaseOneLoot = false; + Yharon_AI2(); + return; + } + bool revenge = (CalamityWorld.revenge || CalamityWorld.bossRushActive); bool expertMode = Main.expertMode; bool phase2Check = (double)npc.life <= (double)npc.lifeMax * (revenge ? 0.85 : 0.7); //Check for phase 2. In phase 1 for 15% or 30% bool phase3Check = (double)npc.life <= (double)npc.lifeMax * (revenge ? 0.6 : 0.4); //Check for phase 3. In phase 2 for 25% or 30% bool phase4Check = (double)npc.life <= (double)npc.lifeMax * (revenge ? 0.25 : 0.2); //Check for phase 4. In phase 3 for 35% or 20% - if (CalamityWorld.death && !CalamityWorld.bossRushActive) - { - phase2Check = (double)npc.life <= (double)npc.lifeMax * 0.9; //Check for phase 2. In phase 1 for 10% - phase3Check = (double)npc.life <= (double)npc.lifeMax * 0.8; //Check for phase 3. In phase 2 for 10% - phase4Check = (double)npc.life <= (double)npc.lifeMax * 0.3; //Check for phase 4. In phase 3 for 50% - } - bool phase5Check = (double)npc.life <= (double)npc.lifeMax * 0.1; //Check for phase 5. In phase 4 for 15% or 10% or 20% - bool phase2Change = npc.ai[0] > 5f; //Phase 2 stuff - bool phase3Change = npc.ai[0] > 12f; //Phase 3 stuff - bool phase4Change = npc.ai[0] > 20f; //Phase 4 stuff - int flareCount = 3; - bool isCharging = npc.ai[3] < 20f; //10 - if (npc.localAI[1] == 0f) + if (CalamityWorld.death && !CalamityWorld.bossRushActive) + { + phase2Check = (double)npc.life <= (double)npc.lifeMax * 0.9; //Check for phase 2. In phase 1 for 10% + phase3Check = (double)npc.life <= (double)npc.lifeMax * 0.8; //Check for phase 3. In phase 2 for 10% + phase4Check = (double)npc.life <= (double)npc.lifeMax * 0.3; //Check for phase 4. In phase 3 for 50% + } + bool phase5Check = (double)npc.life <= (double)npc.lifeMax * 0.1; //Check for phase 5. In phase 4 for 15% or 10% or 20% + bool phase2Change = npc.ai[0] > 5f; //Phase 2 stuff + bool phase3Change = npc.ai[0] > 12f; //Phase 3 stuff + bool phase4Change = npc.ai[0] > 20f; //Phase 4 stuff + int flareCount = 3; + bool isCharging = npc.ai[3] < 20f; //10 + if (npc.localAI[1] == 0f) { npc.localAI[1] = 1f; - Vector2 vectorPlayer = new Vector2(Main.player[npc.target].position.X, Main.player[npc.target].position.Y); + Vector2 vectorPlayer = new Vector2(Main.player[npc.target].position.X, Main.player[npc.target].position.Y); safeBox.X = (int)(vectorPlayer.X - (revenge ? 3000f : 3500f)); - safeBox.Y = (int)(vectorPlayer.Y - (revenge ? 6000f : 7000f)); + safeBox.Y = (int)(vectorPlayer.Y - (revenge ? 9000f : 10500f)); safeBox.Width = revenge ? 6000 : 7000; - safeBox.Height = revenge ? 12000 : 14000; + safeBox.Height = revenge ? 18000 : 21000; if (Main.netMode != 1) { Projectile.NewProjectile(Main.player[npc.target].position.X + (revenge ? 3000f : 3500f), Main.player[npc.target].position.Y + 100f, 0f, 0f, mod.ProjectileType("SkyFlareRevenge"), 0, 0f, Main.myPlayer, 0f, 0f); Projectile.NewProjectile(Main.player[npc.target].position.X - (revenge ? 3000f : 3500f), Main.player[npc.target].position.Y + 100f, 0f, 0f, mod.ProjectileType("SkyFlareRevenge"), 0, 0f, Main.myPlayer, 0f, 0f); } } - #endregion - #region SpeedOrDamageChecks - float teleportLocation = 0f; + #endregion + #region SpeedOrDamageChecks + float teleportLocation = 0f; int teleChoice = Main.rand.Next(2); if (teleChoice == 0) { @@ -232,12 +234,12 @@ namespace CalamityMod.NPCs.Yharon else if (phase3Change) { npc.defense = 160; - } + } else if (phase2Change) { npc.defense = 180; - } - else + } + else { npc.defense = 200; } @@ -255,46 +257,47 @@ namespace CalamityMod.NPCs.Yharon npcVelocity = 0.9f; scaleFactor = 13f; aiChangeRate = 25; - } + } else if (phase2Change && isCharging) { npcVelocity = (expertMode ? 0.8f : 0.78f); scaleFactor = (expertMode ? 12.2f : 12f); aiChangeRate = (expertMode ? 36 : 38); } - else if (isCharging && !phase2Change && !phase3Change && !phase4Change) + else if (isCharging && !phase2Change && !phase3Change && !phase4Change) { aiChangeRate = 25; } int chargeTime = expertMode ? 38 : 40; - int chargeTime2 = expertMode ? 34 : 36; + int chargeTime2 = expertMode ? 34 : 36; float chargeSpeed = expertMode ? 22f : 20.5f; //17 and 16 - float chargeSpeed2 = expertMode ? 37f : 34f; + float chargeSpeed2 = expertMode ? 37f : 34f; if (phase4Change || npc.GetGlobalNPC(mod).enraged) //phase 4 { chargeTime = 28; chargeSpeed = 31f; //27 - } + } else if (phase3Change) //phase 3 { chargeTime = 32; - chargeTime2 = 27; + chargeTime2 = 27; chargeSpeed = 25f; //27 - chargeSpeed2 = 41f; + chargeSpeed2 = 41f; } else if (isCharging && phase2Change) //phase 2 { chargeTime = expertMode ? 35 : 37; - chargeTime2 = expertMode ? 31 : 33; + chargeTime2 = expertMode ? 31 : 33; if (expertMode) { chargeSpeed = 24f; //21 - chargeSpeed2 = 39f; + chargeSpeed2 = 39f; } } - #endregion - #region VariablesForChargingEtc - int num1454 = 80; + #endregion + #region VariablesForChargingEtc + float xPos = (npc.direction == 1 ? 25f : -25f); + int num1454 = 80; int num1455 = 4; float num1456 = 0.3f; float scaleFactor11 = 5f; @@ -307,11 +310,11 @@ namespace CalamityMod.NPCs.Yharon float scaleFactor13 = 20f; float num1463 = 6.28318548f / (float)(num1461 / 2); int num1464 = 75; - #endregion - #region DespawnOrEnrage - Vector2 vectorCenter = npc.Center; + #endregion + #region DespawnOrEnrage + Vector2 vectorCenter = npc.Center; Player player = Main.player[npc.target]; - if (npc.target < 0 || npc.target == 255 || player.dead || !player.active) + if (npc.target < 0 || npc.target == 255 || player.dead || !player.active) { npc.TargetClosest(true); player = Main.player[npc.target]; @@ -324,11 +327,11 @@ namespace CalamityMod.NPCs.Yharon { npc.timeLeft = 150; } - if (npc.ai[0] > 12f) - { - npc.ai[0] = 13f; - } - else if (npc.ai[0] > 5f) + if (npc.ai[0] > 12f) + { + npc.ai[0] = 13f; + } + else if (npc.ai[0] > 5f) { npc.ai[0] = 6f; } @@ -351,17 +354,17 @@ namespace CalamityMod.NPCs.Yharon } else { - npc.damage = expertMode ? 528 : 330; - protectionBoost = false; + npc.damage = expertMode ? 528 : 330; + protectionBoost = false; } - #endregion - #region Rotation - if (npc.localAI[0] == 0f) + #endregion + #region Rotation + if (npc.localAI[0] == 0f) { npc.localAI[0] = 1f; npc.alpha = 255; npc.rotation = 0f; - if (Main.netMode != 1) + if (Main.netMode != 1) { npc.ai[0] = -1f; npc.netUpdate = true; @@ -372,11 +375,11 @@ namespace CalamityMod.NPCs.Yharon { npcRotation += 3.14159274f; } - if (npcRotation < 0f) + if (npcRotation < 0f) { npcRotation += 6.28318548f; } - if (npcRotation > 6.28318548f) + if (npcRotation > 6.28318548f) { npcRotation -= 6.28318548f; } @@ -404,11 +407,11 @@ namespace CalamityMod.NPCs.Yharon { npcRotation = 0f; } - if (npc.ai[0] == 20f) //tornado - { - npcRotation = 0f; - } - float npcRotationSpeed = 0.04f; + if (npc.ai[0] == 20f) //tornado + { + npcRotation = 0f; + } + float npcRotationSpeed = 0.04f; if (npc.ai[0] == 1f || npc.ai[0] == 5f || npc.ai[0] == 7f || npc.ai[0] == 11f || npc.ai[0] == 14f || npc.ai[0] == 18f) //charge { npcRotationSpeed = 0f; @@ -431,64 +434,64 @@ namespace CalamityMod.NPCs.Yharon } if (npc.rotation < npcRotation) { - if ((double)(npcRotation - npc.rotation) > 3.1415926535897931) + if ((double)(npcRotation - npc.rotation) > 3.1415926535897931) { npc.rotation -= npcRotationSpeed; - } + } else { npc.rotation += npcRotationSpeed; } } - if (npc.rotation > npcRotation) + if (npc.rotation > npcRotation) { - if ((double)(npc.rotation - npcRotation) > 3.1415926535897931) + if ((double)(npc.rotation - npcRotation) > 3.1415926535897931) { npc.rotation += npcRotationSpeed; - } + } else { npc.rotation -= npcRotationSpeed; } } - if (npc.rotation > npcRotation - npcRotationSpeed && npc.rotation < npcRotation + npcRotationSpeed) + if (npc.rotation > npcRotation - npcRotationSpeed && npc.rotation < npcRotation + npcRotationSpeed) { npc.rotation = npcRotation; } - if (npc.rotation < 0f) + if (npc.rotation < 0f) { npc.rotation += 6.28318548f; } - if (npc.rotation > 6.28318548f) + if (npc.rotation > 6.28318548f) { npc.rotation -= 6.28318548f; } - if (npc.rotation > npcRotation - npcRotationSpeed && npc.rotation < npcRotation + npcRotationSpeed) + if (npc.rotation > npcRotation - npcRotationSpeed && npc.rotation < npcRotation + npcRotationSpeed) { npc.rotation = npcRotation; } - #endregion - #region AlphaAndInitialSpawnEffects - if (npc.ai[0] != -1f && npc.ai[0] < 9f) - { - bool colliding = Collision.SolidCollision(npc.position, npc.width, npc.height); - if (colliding) - { - npc.alpha += 15; - } - else - { - npc.alpha -= 15; - } - if (npc.alpha < 0) - { - npc.alpha = 0; - } - if (npc.alpha > 150) - { - npc.alpha = 150; - } - } + #endregion + #region AlphaAndInitialSpawnEffects + if (npc.ai[0] != -1f && npc.ai[0] < 9f) + { + bool colliding = Collision.SolidCollision(npc.position, npc.width, npc.height); + if (colliding) + { + npc.alpha += 15; + } + else + { + npc.alpha -= 15; + } + if (npc.alpha < 0) + { + npc.alpha = 0; + } + if (npc.alpha > 150) + { + npc.alpha = 150; + } + } if (npc.ai[0] == -1f) //initial spawn effects { npc.dontTakeDamage = true; @@ -500,28 +503,28 @@ namespace CalamityMod.NPCs.Yharon npc.direction = num1467; npc.spriteDirection = npc.direction; } - if (npc.ai[2] > 20f) + if (npc.ai[2] > 20f) { npc.velocity.Y = -2f; npc.alpha -= 5; bool colliding = Collision.SolidCollision(npc.position, npc.width, npc.height); - if (colliding) + if (colliding) { npc.alpha += 15; } - if (npc.alpha < 0) + if (npc.alpha < 0) { npc.alpha = 0; } - if (npc.alpha > 150) + if (npc.alpha > 150) { npc.alpha = 150; } } - if (npc.ai[2] == (float)(num1457 - 30)) + if (npc.ai[2] == (float)(num1457 - 30)) { int num1468 = 72; - for (int num1469 = 0; num1469 < num1468; num1469++) + for (int num1469 = 0; num1469 < num1468; num1469++) { Vector2 vector169 = Vector2.Normalize(npc.velocity) * new Vector2((float)npc.width / 2f, (float)npc.height) * 0.75f * 0.5f; vector169 = vector169.RotatedBy((double)((float)(num1469 - (num1468 / 2 - 1)) * 6.28318548f / (float)num1468), default(Vector2)) + npc.Center; @@ -531,10 +534,10 @@ namespace CalamityMod.NPCs.Yharon Main.dust[num1470].noLight = true; Main.dust[num1470].velocity = Vector2.Normalize(value16) * 3f; } - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoar"), (int)npc.position.X, (int)npc.position.Y); - } + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoar"), (int)npc.position.X, (int)npc.position.Y); + } npc.ai[2] += 1f; - if (npc.ai[2] >= (float)num1464) + if (npc.ai[2] >= (float)num1464) { npc.ai[0] = 0f; npc.ai[1] = 0f; @@ -543,46 +546,46 @@ namespace CalamityMod.NPCs.Yharon return; } } - #endregion - #region Phase1 - else if (npc.ai[0] == 0f && !player.dead) + #endregion + #region Phase1 + else if (npc.ai[0] == 0f && !player.dead) { npc.dontTakeDamage = false; npc.chaseable = true; - if (npc.ai[1] == 0f) + if (npc.ai[1] == 0f) { npc.ai[1] = (float)(300 * Math.Sign((vectorCenter - player.Center).X)); } Vector2 value17 = player.Center + new Vector2(npc.ai[1], -200f) - vectorCenter; Vector2 vector170 = Vector2.Normalize(value17 - npc.velocity) * scaleFactor; - if (npc.velocity.X < vector170.X) + if (npc.velocity.X < vector170.X) { npc.velocity.X = npc.velocity.X + npcVelocity; - if (npc.velocity.X < 0f && vector170.X > 0f) + if (npc.velocity.X < 0f && vector170.X > 0f) { npc.velocity.X = npc.velocity.X + npcVelocity; } - } - else if (npc.velocity.X > vector170.X) + } + else if (npc.velocity.X > vector170.X) { npc.velocity.X = npc.velocity.X - npcVelocity; - if (npc.velocity.X > 0f && vector170.X < 0f) + if (npc.velocity.X > 0f && vector170.X < 0f) { npc.velocity.X = npc.velocity.X - npcVelocity; } } - if (npc.velocity.Y < vector170.Y) + if (npc.velocity.Y < vector170.Y) { npc.velocity.Y = npc.velocity.Y + npcVelocity; - if (npc.velocity.Y < 0f && vector170.Y > 0f) + if (npc.velocity.Y < 0f && vector170.Y > 0f) { npc.velocity.Y = npc.velocity.Y + npcVelocity; } - } - else if (npc.velocity.Y > vector170.Y) + } + else if (npc.velocity.Y > vector170.Y) { npc.velocity.Y = npc.velocity.Y - npcVelocity; - if (npc.velocity.Y > 0f && vector170.Y < 0f) + if (npc.velocity.Y > 0f && vector170.Y < 0f) { npc.velocity.Y = npc.velocity.Y - npcVelocity; } @@ -595,7 +598,7 @@ namespace CalamityMod.NPCs.Yharon npc.rotation = 3.14159274f; } npc.direction = num1471; - if (num1471 != 0) + if (num1471 != 0) { npc.direction = num1471; npc.rotation = 0f; @@ -603,7 +606,7 @@ namespace CalamityMod.NPCs.Yharon } } npc.ai[2] += 1f; - if (npc.ai[2] >= (float)aiChangeRate) + if (npc.ai[2] >= (float)aiChangeRate) { int aiState = 0; switch ((int)npc.ai[3]) //0 2 4 6 1 3 5 7 repeat @@ -613,10 +616,10 @@ namespace CalamityMod.NPCs.Yharon case 2: case 3: case 4: - aiState = 1; //normal charges - break; + aiState = 1; //normal charges + break; case 5: - aiState = 5; //fast charge + aiState = 5; //fast charge break; case 6: npc.ai[3] = 1f; @@ -631,7 +634,7 @@ namespace CalamityMod.NPCs.Yharon { aiState = 4; } - if (aiState == 1) + if (aiState == 1) { npc.ai[0] = 1f; npc.ai[1] = 0f; @@ -647,46 +650,46 @@ namespace CalamityMod.NPCs.Yharon } npc.spriteDirection = -npc.direction; } - } - else if (aiState == 2) + } + else if (aiState == 2) { npc.ai[0] = 2f; npc.ai[1] = 0f; npc.ai[2] = 0f; - } - else if (aiState == 3) + } + else if (aiState == 3) { npc.ai[0] = 3f; npc.ai[1] = 0f; npc.ai[2] = 0f; - } - else if (aiState == 4) + } + else if (aiState == 4) { npc.ai[0] = 4f; npc.ai[1] = 0f; npc.ai[2] = 0f; } - else if (aiState == 5) - { - npc.ai[0] = 5f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.velocity = Vector2.Normalize(player.Center - vectorCenter) * chargeSpeed2; - npc.rotation = (float)Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X); - if (num1471 != 0) - { - npc.direction = num1471; - if (npc.spriteDirection == 1) - { - npc.rotation += 3.14159274f; - } - npc.spriteDirection = -npc.direction; - } - } + else if (aiState == 5) + { + npc.ai[0] = 5f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.velocity = Vector2.Normalize(player.Center - vectorCenter) * chargeSpeed2; + npc.rotation = (float)Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X); + if (num1471 != 0) + { + npc.direction = num1471; + if (npc.spriteDirection == 1) + { + npc.rotation += 3.14159274f; + } + npc.spriteDirection = -npc.direction; + } + } npc.netUpdate = true; return; } - } + } else if (npc.ai[0] == 1f) //charge attack { int num1473 = 7; @@ -702,7 +705,7 @@ namespace CalamityMod.NPCs.Yharon Main.dust[num1475].velocity -= npc.velocity; } npc.ai[2] += 1f; - if (npc.ai[2] >= (float)chargeTime) + if (npc.ai[2] >= (float)chargeTime) { npc.ai[0] = 0f; npc.ai[1] = 0f; @@ -711,55 +714,55 @@ namespace CalamityMod.NPCs.Yharon npc.netUpdate = true; return; } - } + } else if (npc.ai[0] == 2f) //fireball attack { - if (npc.ai[1] == 0f) + if (npc.ai[1] == 0f) { npc.ai[1] = (float)(300 * Math.Sign((vectorCenter - player.Center).X)); } Vector2 value19 = player.Center + new Vector2(npc.ai[1], -200f) - vectorCenter; Vector2 vector172 = Vector2.Normalize(value19 - npc.velocity) * scaleFactor11; - if (npc.velocity.X < vector172.X) + if (npc.velocity.X < vector172.X) { npc.velocity.X = npc.velocity.X + num1456; - if (npc.velocity.X < 0f && vector172.X > 0f) + if (npc.velocity.X < 0f && vector172.X > 0f) { npc.velocity.X = npc.velocity.X + num1456; } - } - else if (npc.velocity.X > vector172.X) + } + else if (npc.velocity.X > vector172.X) { npc.velocity.X = npc.velocity.X - num1456; - if (npc.velocity.X > 0f && vector172.X < 0f) + if (npc.velocity.X > 0f && vector172.X < 0f) { npc.velocity.X = npc.velocity.X - num1456; } } - if (npc.velocity.Y < vector172.Y) + if (npc.velocity.Y < vector172.Y) { npc.velocity.Y = npc.velocity.Y + num1456; - if (npc.velocity.Y < 0f && vector172.Y > 0f) + if (npc.velocity.Y < 0f && vector172.Y > 0f) { npc.velocity.Y = npc.velocity.Y + num1456; } - } - else if (npc.velocity.Y > vector172.Y) + } + else if (npc.velocity.Y > vector172.Y) { npc.velocity.Y = npc.velocity.Y - num1456; - if (npc.velocity.Y > 0f && vector172.Y < 0f) + if (npc.velocity.Y > 0f && vector172.Y < 0f) { npc.velocity.Y = npc.velocity.Y - num1456; } } - if (npc.ai[2] == 0f) + if (npc.ai[2] == 0f) { - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoar"), (int)npc.position.X, (int)npc.position.Y); - } + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoar"), (int)npc.position.X, (int)npc.position.Y); + } if (npc.ai[2] % (float)num1455 == 0f) //fire flare bombs from mouth { - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoarShort"), (int)npc.position.X, (int)npc.position.Y); - if (Main.netMode != 1) + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoarShort"), (int)npc.position.X, (int)npc.position.Y); + if (Main.netMode != 1) { if (NPC.CountNPCS(mod.NPCType("DetonatingFlare")) < flareCount) { @@ -768,7 +771,7 @@ namespace CalamityMod.NPCs.Yharon } int damage = expertMode ? 75 : 90; //700 Vector2 vector173 = Vector2.Normalize(player.Center - vectorCenter) * (float)(npc.width + 20) / 2f + vectorCenter; - Projectile.NewProjectile((int)vector173.X, (int)vector173.Y - 70, 0f, 0f, mod.ProjectileType("FlareBomb"), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile((int)vector173.X + xPos, (int)vector173.Y - 15, 0f, 0f, mod.ProjectileType("FlareBomb"), damage, 0f, Main.myPlayer, 0f, 0f); } } int num1476 = Math.Sign(player.Center.X - vectorCenter.X); @@ -776,17 +779,17 @@ namespace CalamityMod.NPCs.Yharon if (num1476 != 0) { npc.direction = num1476; - if (npc.spriteDirection != -npc.direction) + if (npc.spriteDirection != -npc.direction) { npc.rotation += 6.28318548f; if (npc.rotation > 6.28318548f) { npc.rotation = 0f; - if(dir2.X < 0) - { + if (dir2.X < 0) + { npc.direction = -1; } - else + else { npc.direction = 1; } @@ -795,7 +798,7 @@ namespace CalamityMod.NPCs.Yharon npc.spriteDirection = -npc.direction; } npc.ai[2] += 1f; - if (npc.ai[2] >= (float)num1454) + if (npc.ai[2] >= (float)num1454) { npc.ai[0] = 0f; npc.ai[1] = 0f; @@ -803,22 +806,22 @@ namespace CalamityMod.NPCs.Yharon npc.netUpdate = true; return; } - } + } else if (npc.ai[0] == 3f) //Fire small flares { npc.velocity *= 0.98f; npc.velocity.Y = MathHelper.Lerp(npc.velocity.Y, 0f, 0.02f); - if (npc.ai[2] == (float)(num1457 - 30)) + if (npc.ai[2] == (float)(num1457 - 30)) { - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoarShort"), (int)npc.position.X, (int)npc.position.Y); - } - if (Main.netMode != 1 && npc.ai[2] == (float)(num1457 - 30)) + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoarShort"), (int)npc.position.X, (int)npc.position.Y); + } + if (Main.netMode != 1 && npc.ai[2] == (float)(num1457 - 30)) { Projectile.NewProjectile(vectorCenter.X, vectorCenter.Y, 0f, 0f, mod.ProjectileType("Flare"), 0, 0f, Main.myPlayer, 1f, (float)(npc.target + 1)); //changed Projectile.NewProjectile(vectorCenter.X, vectorCenter.Y, (float)(-(float)npc.direction * 2), 8f, mod.ProjectileType("Flare"), 0, 0f, Main.myPlayer, 0f, 0f); //changed } npc.ai[2] += 1f; - if (npc.ai[2] >= (float)num1457) + if (npc.ai[2] >= (float)num1457) { npc.ai[0] = 0f; npc.ai[1] = 0f; @@ -826,19 +829,19 @@ namespace CalamityMod.NPCs.Yharon npc.netUpdate = true; return; } - } + } else if (npc.ai[0] == 4f) //enter phase 2 { npc.dontTakeDamage = true; npc.chaseable = false; npc.velocity *= 0.98f; npc.velocity.Y = MathHelper.Lerp(npc.velocity.Y, 0f, 0.02f); - if (npc.ai[2] == (float)(num1458 - 60)) + if (npc.ai[2] == (float)(num1458 - 60)) { - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoar"), (int)npc.position.X, (int)npc.position.Y); - } + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoar"), (int)npc.position.X, (int)npc.position.Y); + } npc.ai[2] += 1f; - if (npc.ai[2] >= (float)num1458) + if (npc.ai[2] >= (float)num1458) { npc.ai[0] = 6f; npc.ai[1] = 0f; @@ -848,71 +851,71 @@ namespace CalamityMod.NPCs.Yharon return; } } - else if (npc.ai[0] == 5f) - { - int num1473 = 14; - for (int num1474 = 0; num1474 < num1473; num1474++) - { - Vector2 vector171 = Vector2.Normalize(npc.velocity) * new Vector2((float)(npc.width + 50) / 2f, (float)npc.height) * 0.75f; - vector171 = vector171.RotatedBy((double)(num1474 - (num1473 / 2 - 1)) * 3.1415926535897931 / (double)((float)num1473), default(Vector2)) + vectorCenter; - Vector2 value18 = ((float)(Main.rand.NextDouble() * 3.1415927410125732) - 1.57079637f).ToRotationVector2() * (float)Main.rand.Next(3, 8); - int num1475 = Dust.NewDust(vector171 + value18, 0, 0, 244, value18.X * 2f, value18.Y * 2f, 100, default(Color), 1.4f); //changed - Main.dust[num1475].noGravity = true; - Main.dust[num1475].noLight = true; - Main.dust[num1475].velocity /= 4f; - Main.dust[num1475].velocity -= npc.velocity; - } - npc.ai[2] += 1f; - if (npc.ai[2] >= (float)chargeTime2) - { - npc.ai[0] = 0f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] += 2f; - npc.netUpdate = true; - return; - } - } - #endregion - #region Phase2 - else if (npc.ai[0] == 6f && !player.dead) //phase 2 + else if (npc.ai[0] == 5f) { - npc.dontTakeDamage = false; - npc.chaseable = true; - if (npc.ai[1] == 0f) + int num1473 = 14; + for (int num1474 = 0; num1474 < num1473; num1474++) + { + Vector2 vector171 = Vector2.Normalize(npc.velocity) * new Vector2((float)(npc.width + 50) / 2f, (float)npc.height) * 0.75f; + vector171 = vector171.RotatedBy((double)(num1474 - (num1473 / 2 - 1)) * 3.1415926535897931 / (double)((float)num1473), default(Vector2)) + vectorCenter; + Vector2 value18 = ((float)(Main.rand.NextDouble() * 3.1415927410125732) - 1.57079637f).ToRotationVector2() * (float)Main.rand.Next(3, 8); + int num1475 = Dust.NewDust(vector171 + value18, 0, 0, 244, value18.X * 2f, value18.Y * 2f, 100, default(Color), 1.4f); //changed + Main.dust[num1475].noGravity = true; + Main.dust[num1475].noLight = true; + Main.dust[num1475].velocity /= 4f; + Main.dust[num1475].velocity -= npc.velocity; + } + npc.ai[2] += 1f; + if (npc.ai[2] >= (float)chargeTime2) + { + npc.ai[0] = 0f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.ai[3] += 2f; + npc.netUpdate = true; + return; + } + } + #endregion + #region Phase2 + else if (npc.ai[0] == 6f && !player.dead) //phase 2 + { + npc.dontTakeDamage = false; + npc.chaseable = true; + if (npc.ai[1] == 0f) { npc.ai[1] = (float)(300 * Math.Sign((vectorCenter - player.Center).X)); } Vector2 value20 = player.Center + new Vector2(npc.ai[1], -200f) - vectorCenter; Vector2 vector175 = Vector2.Normalize(value20 - npc.velocity) * scaleFactor; - if (npc.velocity.X < vector175.X) + if (npc.velocity.X < vector175.X) { npc.velocity.X = npc.velocity.X + npcVelocity; - if (npc.velocity.X < 0f && vector175.X > 0f) + if (npc.velocity.X < 0f && vector175.X > 0f) { npc.velocity.X = npc.velocity.X + npcVelocity; } - } - else if (npc.velocity.X > vector175.X) + } + else if (npc.velocity.X > vector175.X) { npc.velocity.X = npc.velocity.X - npcVelocity; - if (npc.velocity.X > 0f && vector175.X < 0f) + if (npc.velocity.X > 0f && vector175.X < 0f) { npc.velocity.X = npc.velocity.X - npcVelocity; } } - if (npc.velocity.Y < vector175.Y) + if (npc.velocity.Y < vector175.Y) { npc.velocity.Y = npc.velocity.Y + npcVelocity; - if (npc.velocity.Y < 0f && vector175.Y > 0f) + if (npc.velocity.Y < 0f && vector175.Y > 0f) { npc.velocity.Y = npc.velocity.Y + npcVelocity; } - } - else if (npc.velocity.Y > vector175.Y) + } + else if (npc.velocity.Y > vector175.Y) { npc.velocity.Y = npc.velocity.Y - npcVelocity; - if (npc.velocity.Y > 0f && vector175.Y < 0f) + if (npc.velocity.Y > 0f && vector175.Y < 0f) { npc.velocity.Y = npc.velocity.Y - npcVelocity; } @@ -925,7 +928,7 @@ namespace CalamityMod.NPCs.Yharon npc.rotation = 3.14159274f; } npc.direction = num1477; - if (num1477 != 0) + if (num1477 != 0) { npc.direction = num1477; npc.rotation = 0f; @@ -933,7 +936,7 @@ namespace CalamityMod.NPCs.Yharon } } npc.ai[2] += 1f; - if (npc.ai[2] >= (float)aiChangeRate) + if (npc.ai[2] >= (float)aiChangeRate) { int aiState = 0; switch ((int)npc.ai[3]) //0 2 4 6 8 1 3 5 7 9 repeat @@ -944,12 +947,12 @@ namespace CalamityMod.NPCs.Yharon case 3: case 4: case 5: - aiState = 1; - break; - case 6: - aiState = 5; - break; - case 7: + aiState = 1; + break; + case 6: + aiState = 5; + break; + case 7: aiState = 6; break; case 8: @@ -965,31 +968,31 @@ namespace CalamityMod.NPCs.Yharon { aiState = 4; } - if (aiState == 1) + if (aiState == 1) { npc.ai[0] = 7f; npc.ai[1] = 0f; npc.ai[2] = 0f; npc.velocity = Vector2.Normalize(player.Center - vectorCenter) * chargeSpeed; npc.rotation = (float)Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X); - if (num1477 != 0) + if (num1477 != 0) { npc.direction = num1477; - if (npc.spriteDirection == 1) + if (npc.spriteDirection == 1) { npc.rotation += 3.14159274f; } npc.spriteDirection = -npc.direction; } - } - else if (aiState == 2) + } + else if (aiState == 2) { npc.velocity = Vector2.Normalize(player.Center - vectorCenter) * scaleFactor13; npc.rotation = (float)Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X); - if (num1477 != 0) + if (num1477 != 0) { npc.direction = num1477; - if (npc.spriteDirection == 1) + if (npc.spriteDirection == 1) { npc.rotation += 3.14159274f; } @@ -998,61 +1001,61 @@ namespace CalamityMod.NPCs.Yharon npc.ai[0] = 8f; npc.ai[1] = 0f; npc.ai[2] = 0f; - } - else if (aiState == 3) + } + else if (aiState == 3) { npc.ai[0] = 9f; npc.ai[1] = 0f; npc.ai[2] = 0f; - } - else if (aiState == 4) + } + else if (aiState == 4) { npc.ai[0] = 10f; npc.ai[1] = 0f; npc.ai[2] = 0f; } - else if (aiState == 5) - { - npc.ai[0] = 11f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.velocity = Vector2.Normalize(player.Center - vectorCenter) * chargeSpeed2; - npc.rotation = (float)Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X); - if (num1477 != 0) - { - npc.direction = num1477; - if (npc.spriteDirection == 1) - { - npc.rotation += 3.14159274f; - } - npc.spriteDirection = -npc.direction; - } - } - else if (aiState == 6) - { - npc.velocity = Vector2.Normalize(player.Center - vectorCenter) * scaleFactor13; - npc.rotation = (float)Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X); - if (num1477 != 0) - { - npc.direction = num1477; - if (npc.spriteDirection == 1) - { - npc.rotation += 3.14159274f; - } - npc.spriteDirection = -npc.direction; - } - npc.ai[0] = 12f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - } - npc.netUpdate = true; + else if (aiState == 5) + { + npc.ai[0] = 11f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.velocity = Vector2.Normalize(player.Center - vectorCenter) * chargeSpeed2; + npc.rotation = (float)Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X); + if (num1477 != 0) + { + npc.direction = num1477; + if (npc.spriteDirection == 1) + { + npc.rotation += 3.14159274f; + } + npc.spriteDirection = -npc.direction; + } + } + else if (aiState == 6) + { + npc.velocity = Vector2.Normalize(player.Center - vectorCenter) * scaleFactor13; + npc.rotation = (float)Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X); + if (num1477 != 0) + { + npc.direction = num1477; + if (npc.spriteDirection == 1) + { + npc.rotation += 3.14159274f; + } + npc.spriteDirection = -npc.direction; + } + npc.ai[0] = 12f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + } + npc.netUpdate = true; return; } - } + } else if (npc.ai[0] == 7f) //charge { int num1479 = 7; - for (int num1480 = 0; num1480 < num1479; num1480++) + for (int num1480 = 0; num1480 < num1479; num1480++) { Vector2 vector176 = Vector2.Normalize(npc.velocity) * new Vector2((float)(npc.width + 50) / 2f, (float)npc.height) * 0.75f; vector176 = vector176.RotatedBy((double)(num1480 - (num1479 / 2 - 1)) * 3.1415926535897931 / (double)((float)num1479), default(Vector2)) + vectorCenter; @@ -1064,7 +1067,7 @@ namespace CalamityMod.NPCs.Yharon Main.dust[num1481].velocity -= npc.velocity; } npc.ai[2] += 1f; - if (npc.ai[2] >= (float)chargeTime) + if (npc.ai[2] >= (float)chargeTime) { npc.ai[0] = 6f; npc.ai[1] = 0f; @@ -1073,17 +1076,17 @@ namespace CalamityMod.NPCs.Yharon npc.netUpdate = true; return; } - } + } else if (npc.ai[0] == 8f) { - if (npc.ai[2] == 0f) + if (npc.ai[2] == 0f) { - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoar"), (int)npc.position.X, (int)npc.position.Y); - } - if (npc.ai[2] % (float)num1462 == 0f) + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoar"), (int)npc.position.X, (int)npc.position.Y); + } + if (npc.ai[2] % (float)num1462 == 0f) { - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoarShort"), (int)npc.position.X, (int)npc.position.Y); - if (Main.netMode != 1) + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoarShort"), (int)npc.position.X, (int)npc.position.Y); + if (Main.netMode != 1) { if (NPC.CountNPCS(mod.NPCType("DetonatingFlare2")) < flareCount) { @@ -1091,13 +1094,13 @@ namespace CalamityMod.NPCs.Yharon NPC.NewNPC((int)vector6.X, (int)vector6.Y - 100, mod.NPCType("DetonatingFlare2"), 0, 0f, 0f, 0f, 0f, 255); } Vector2 vector173 = Vector2.Normalize(player.Center - vectorCenter) * (float)(npc.width + 20) / 2f + vectorCenter; - Projectile.NewProjectile((int)vector173.X, (int)vector173.Y - 100, (float)Main.rand.Next(-400, 401) * 0.13f, (float)Main.rand.Next(-30, 31) * 0.13f, mod.ProjectileType("FlareDust"), 0, 0f, Main.myPlayer, 0f, 0f); //changed + Projectile.NewProjectile((int)vector173.X + xPos, (int)vector173.Y - 15, (float)Main.rand.Next(-400, 401) * 0.13f, (float)Main.rand.Next(-30, 31) * 0.13f, mod.ProjectileType("FlareDust"), 0, 0f, Main.myPlayer, 0f, 0f); //changed } } npc.velocity = npc.velocity.RotatedBy((double)(-(double)num1463 * (float)npc.direction), default(Vector2)); npc.rotation -= num1463 * (float)npc.direction; npc.ai[2] += 1f; - if (npc.ai[2] >= (float)num1461) + if (npc.ai[2] >= (float)num1461) { npc.ai[0] = 6f; npc.ai[1] = 0f; @@ -1105,21 +1108,21 @@ namespace CalamityMod.NPCs.Yharon npc.netUpdate = true; return; } - } + } else if (npc.ai[0] == 9f) { npc.velocity *= 0.98f; npc.velocity.Y = MathHelper.Lerp(npc.velocity.Y, 0f, 0.02f); - if (npc.ai[2] == (float)(num1457 - 30)) + if (npc.ai[2] == (float)(num1457 - 30)) { - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoarShort"), (int)npc.position.X, (int)npc.position.Y); - } - if (Main.netMode != 1 && npc.ai[2] == (float)(num1457 - 30)) + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoarShort"), (int)npc.position.X, (int)npc.position.Y); + } + if (Main.netMode != 1 && npc.ai[2] == (float)(num1457 - 30)) { Projectile.NewProjectile(vectorCenter.X, vectorCenter.Y, 0f, 0f, mod.ProjectileType("BigFlare"), 0, 0f, Main.myPlayer, 1f, (float)(npc.target + 1)); - } + } npc.ai[2] += 1f; - if (npc.ai[2] >= (float)num1457) + if (npc.ai[2] >= (float)num1457) { npc.ai[0] = 6f; npc.ai[1] = 0f; @@ -1127,19 +1130,19 @@ namespace CalamityMod.NPCs.Yharon npc.netUpdate = true; return; } - } + } else if (npc.ai[0] == 10f) //start phase 3 { npc.dontTakeDamage = true; npc.chaseable = false; npc.velocity *= 0.98f; npc.velocity.Y = MathHelper.Lerp(npc.velocity.Y, 0f, 0.02f); - if (npc.ai[2] == (float)(num1459 - 60)) + if (npc.ai[2] == (float)(num1459 - 60)) { - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoar"), (int)npc.position.X, (int)npc.position.Y); - } + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoar"), (int)npc.position.X, (int)npc.position.Y); + } npc.ai[2] += 1f; - if (npc.ai[2] >= (float)num1459) + if (npc.ai[2] >= (float)num1459) { npc.ai[0] = 13f; npc.ai[1] = 0f; @@ -1149,121 +1152,121 @@ namespace CalamityMod.NPCs.Yharon return; } } - else if (npc.ai[0] == 11f) - { - int num1479 = 14; - for (int num1480 = 0; num1480 < num1479; num1480++) - { - Vector2 vector176 = Vector2.Normalize(npc.velocity) * new Vector2((float)(npc.width + 50) / 2f, (float)npc.height) * 0.75f; - vector176 = vector176.RotatedBy((double)(num1480 - (num1479 / 2 - 1)) * 3.1415926535897931 / (double)((float)num1479), default(Vector2)) + vectorCenter; - Vector2 value21 = ((float)(Main.rand.NextDouble() * 3.1415927410125732) - 1.57079637f).ToRotationVector2() * (float)Main.rand.Next(3, 8); - int num1481 = Dust.NewDust(vector176 + value21, 0, 0, 244, value21.X * 2f, value21.Y * 2f, 100, default(Color), 1.4f); //changed - Main.dust[num1481].noGravity = true; - Main.dust[num1481].noLight = true; - Main.dust[num1481].velocity /= 4f; - Main.dust[num1481].velocity -= npc.velocity; - } - npc.ai[2] += 1f; - if (npc.ai[2] >= (float)chargeTime2) - { - npc.ai[0] = 6f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] += 2f; - npc.netUpdate = true; - return; - } - } - else if (npc.ai[0] == 12f) - { - if (npc.ai[2] == 0f) - { - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoar"), (int)npc.position.X, (int)npc.position.Y); - } - if (npc.ai[2] % (float)num1462 == 0f) - { - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoarShort"), (int)npc.position.X, (int)npc.position.Y); - if (Main.netMode != 1) - { - int damage = expertMode ? 75 : 90; //700 - Vector2 vector173 = Vector2.Normalize(player.Center - vectorCenter) * (float)(npc.width + 20) / 2f + vectorCenter; - float speed = 0.01f; - Vector2 vectorShoot = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f + 30f); - float playerX = player.position.X + (float)player.width * 0.5f - vectorShoot.X; - float playerY = player.position.Y - vectorShoot.Y; - float playerXY = (float)Math.Sqrt((double)(playerX * playerX + playerY * playerY)); - playerXY = speed / playerXY; - playerX *= playerXY; - playerY *= playerXY; - Projectile.NewProjectile((int)vector173.X, (int)vector173.Y - 100, playerX, playerY, mod.ProjectileType("FlareDust2"), damage, 0f, Main.myPlayer, 0f, 0f); - } - } - npc.velocity = npc.velocity.RotatedBy((double)(-(double)num1463 * (float)npc.direction), default(Vector2)); - npc.rotation -= num1463 * (float)npc.direction; - npc.ai[2] += 1f; - if (npc.ai[2] >= (float)num1461) - { - npc.ai[0] = 6f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] += 2f; - npc.netUpdate = true; - return; - } - } - #endregion - #region Phase3 - else if (npc.ai[0] == 13f && !player.dead) + else if (npc.ai[0] == 11f) + { + int num1479 = 14; + for (int num1480 = 0; num1480 < num1479; num1480++) + { + Vector2 vector176 = Vector2.Normalize(npc.velocity) * new Vector2((float)(npc.width + 50) / 2f, (float)npc.height) * 0.75f; + vector176 = vector176.RotatedBy((double)(num1480 - (num1479 / 2 - 1)) * 3.1415926535897931 / (double)((float)num1479), default(Vector2)) + vectorCenter; + Vector2 value21 = ((float)(Main.rand.NextDouble() * 3.1415927410125732) - 1.57079637f).ToRotationVector2() * (float)Main.rand.Next(3, 8); + int num1481 = Dust.NewDust(vector176 + value21, 0, 0, 244, value21.X * 2f, value21.Y * 2f, 100, default(Color), 1.4f); //changed + Main.dust[num1481].noGravity = true; + Main.dust[num1481].noLight = true; + Main.dust[num1481].velocity /= 4f; + Main.dust[num1481].velocity -= npc.velocity; + } + npc.ai[2] += 1f; + if (npc.ai[2] >= (float)chargeTime2) + { + npc.ai[0] = 6f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.ai[3] += 2f; + npc.netUpdate = true; + return; + } + } + else if (npc.ai[0] == 12f) + { + if (npc.ai[2] == 0f) + { + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoar"), (int)npc.position.X, (int)npc.position.Y); + } + if (npc.ai[2] % (float)num1462 == 0f) + { + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoarShort"), (int)npc.position.X, (int)npc.position.Y); + if (Main.netMode != 1) + { + int damage = expertMode ? 75 : 90; //700 + Vector2 vector173 = Vector2.Normalize(player.Center - vectorCenter) * (float)(npc.width + 20) / 2f + vectorCenter; + float speed = 0.01f; + Vector2 vectorShoot = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f + 30f); + float playerX = player.position.X + (float)player.width * 0.5f - vectorShoot.X; + float playerY = player.position.Y - vectorShoot.Y; + float playerXY = (float)Math.Sqrt((double)(playerX * playerX + playerY * playerY)); + playerXY = speed / playerXY; + playerX *= playerXY; + playerY *= playerXY; + Projectile.NewProjectile((int)vector173.X + xPos, (int)vector173.Y - 15, playerX, playerY, mod.ProjectileType("FlareDust2"), damage, 0f, Main.myPlayer, 0f, 0f); + } + } + npc.velocity = npc.velocity.RotatedBy((double)(-(double)num1463 * (float)npc.direction), default(Vector2)); + npc.rotation -= num1463 * (float)npc.direction; + npc.ai[2] += 1f; + if (npc.ai[2] >= (float)num1461) + { + npc.ai[0] = 6f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.ai[3] += 2f; + npc.netUpdate = true; + return; + } + } + #endregion + #region Phase3 + else if (npc.ai[0] == 13f && !player.dead) { npc.dontTakeDamage = phase5Check; npc.chaseable = true; - if (npc.ai[1] == 0f) + if (npc.ai[1] == 0f) { npc.ai[1] = (float)(300 * Math.Sign((vectorCenter - player.Center).X)); } Vector2 value20 = player.Center + new Vector2(npc.ai[1], -200f) - vectorCenter; Vector2 vector175 = Vector2.Normalize(value20 - npc.velocity) * scaleFactor; - if (npc.velocity.X < vector175.X) + if (npc.velocity.X < vector175.X) { npc.velocity.X = npc.velocity.X + npcVelocity; - if (npc.velocity.X < 0f && vector175.X > 0f) + if (npc.velocity.X < 0f && vector175.X > 0f) { npc.velocity.X = npc.velocity.X + npcVelocity; } - } - else if (npc.velocity.X > vector175.X) + } + else if (npc.velocity.X > vector175.X) { npc.velocity.X = npc.velocity.X - npcVelocity; - if (npc.velocity.X > 0f && vector175.X < 0f) + if (npc.velocity.X > 0f && vector175.X < 0f) { npc.velocity.X = npc.velocity.X - npcVelocity; } } - if (npc.velocity.Y < vector175.Y) + if (npc.velocity.Y < vector175.Y) { npc.velocity.Y = npc.velocity.Y + npcVelocity; - if (npc.velocity.Y < 0f && vector175.Y > 0f) + if (npc.velocity.Y < 0f && vector175.Y > 0f) { npc.velocity.Y = npc.velocity.Y + npcVelocity; } - } - else if (npc.velocity.Y > vector175.Y) + } + else if (npc.velocity.Y > vector175.Y) { npc.velocity.Y = npc.velocity.Y - npcVelocity; - if (npc.velocity.Y > 0f && vector175.Y < 0f) + if (npc.velocity.Y > 0f && vector175.Y < 0f) { npc.velocity.Y = npc.velocity.Y - npcVelocity; } } int num1477 = Math.Sign(player.Center.X - vectorCenter.X); - if (num1477 != 0) + if (num1477 != 0) { if (npc.ai[2] == 0f && num1477 != npc.direction) { npc.rotation = 3.14159274f; } npc.direction = num1477; - if (num1477 != 0) + if (num1477 != 0) { npc.direction = num1477; npc.rotation = 0f; @@ -1280,22 +1283,22 @@ namespace CalamityMod.NPCs.Yharon case 1: case 2: case 3: - aiState = ((CalamityWorld.death && !CalamityWorld.bossRushActive) ? 5 : 1); //normal charges - break; - case 4: - case 5: + aiState = ((CalamityWorld.death && !CalamityWorld.bossRushActive) ? 5 : 1); //normal charges + break; + case 4: + case 5: case 6: - aiState = 5; //fast charges - break; - case 7: - aiState = 3; //big tornado - break; - case 8: - aiState = 6; //slow flare bombs - break; - case 9: - npc.ai[3] = 1f; - aiState = 7; //small tornado + aiState = 5; //fast charges + break; + case 7: + aiState = 3; //big tornado + break; + case 8: + aiState = 6; //slow flare bombs + break; + case 9: + npc.ai[3] = 1f; + aiState = 7; //small tornado break; case 10: npc.ai[3] = 0f; @@ -1306,31 +1309,31 @@ namespace CalamityMod.NPCs.Yharon { aiState = 4; } - if (aiState == 1) + if (aiState == 1) { npc.ai[0] = 14f; npc.ai[1] = 0f; npc.ai[2] = 0f; npc.velocity = Vector2.Normalize(player.Center - vectorCenter) * chargeSpeed; npc.rotation = (float)Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X); - if (num1477 != 0) + if (num1477 != 0) { npc.direction = num1477; - if (npc.spriteDirection == 1) + if (npc.spriteDirection == 1) { npc.rotation += 3.14159274f; } npc.spriteDirection = -npc.direction; } } - else if (aiState == 2) + else if (aiState == 2) { npc.velocity = Vector2.Normalize(player.Center - vectorCenter) * scaleFactor13; npc.rotation = (float)Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X); - if (num1477 != 0) + if (num1477 != 0) { npc.direction = num1477; - if (npc.spriteDirection == 1) + if (npc.spriteDirection == 1) { npc.rotation += 3.14159274f; } @@ -1340,68 +1343,68 @@ namespace CalamityMod.NPCs.Yharon npc.ai[1] = 0f; npc.ai[2] = 0f; } - else if (aiState == 3) + else if (aiState == 3) { npc.ai[0] = 16f; npc.ai[1] = 0f; npc.ai[2] = 0f; } - else if (aiState == 4) + else if (aiState == 4) { npc.ai[0] = 17f; npc.ai[1] = 0f; npc.ai[2] = 0f; } - else if (aiState == 5) - { - npc.ai[0] = 18f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.velocity = Vector2.Normalize(player.Center - vectorCenter) * chargeSpeed2; - npc.rotation = (float)Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X); - if (num1477 != 0) - { - npc.direction = num1477; - if (npc.spriteDirection == 1) - { - npc.rotation += 3.14159274f; - } - npc.spriteDirection = -npc.direction; - } - } - else if (aiState == 6) - { - npc.velocity = Vector2.Normalize(player.Center - vectorCenter) * scaleFactor13; - npc.rotation = (float)Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X); - if (num1477 != 0) - { - npc.direction = num1477; - if (npc.spriteDirection == 1) - { - npc.rotation += 3.14159274f; - } - npc.spriteDirection = -npc.direction; - } - npc.ai[0] = 19f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - } - else if (aiState == 7) - { - npc.ai[0] = 20f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - } - npc.netUpdate = true; + else if (aiState == 5) + { + npc.ai[0] = 18f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.velocity = Vector2.Normalize(player.Center - vectorCenter) * chargeSpeed2; + npc.rotation = (float)Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X); + if (num1477 != 0) + { + npc.direction = num1477; + if (npc.spriteDirection == 1) + { + npc.rotation += 3.14159274f; + } + npc.spriteDirection = -npc.direction; + } + } + else if (aiState == 6) + { + npc.velocity = Vector2.Normalize(player.Center - vectorCenter) * scaleFactor13; + npc.rotation = (float)Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X); + if (num1477 != 0) + { + npc.direction = num1477; + if (npc.spriteDirection == 1) + { + npc.rotation += 3.14159274f; + } + npc.spriteDirection = -npc.direction; + } + npc.ai[0] = 19f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + } + else if (aiState == 7) + { + npc.ai[0] = 20f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + } + npc.netUpdate = true; return; } - } + } else if (npc.ai[0] == 14f) //charge { - npc.dontTakeDamage = phase5Check; - npc.chaseable = true; - int num1479 = 7; - for (int num1480 = 0; num1480 < num1479; num1480++) + npc.dontTakeDamage = phase5Check; + npc.chaseable = true; + int num1479 = 7; + for (int num1480 = 0; num1480 < num1479; num1480++) { Vector2 vector176 = Vector2.Normalize(npc.velocity) * new Vector2((float)(npc.width + 50) / 2f, (float)npc.height) * 0.75f; vector176 = vector176.RotatedBy((double)(num1480 - (num1479 / 2 - 1)) * 3.1415926535897931 / (double)((float)num1479), default(Vector2)) + vectorCenter; @@ -1413,7 +1416,7 @@ namespace CalamityMod.NPCs.Yharon Main.dust[num1481].velocity -= npc.velocity; } npc.ai[2] += 1f; - if (npc.ai[2] >= (float)chargeTime) + if (npc.ai[2] >= (float)chargeTime) { npc.ai[0] = 13f; npc.ai[1] = 0f; @@ -1422,19 +1425,19 @@ namespace CalamityMod.NPCs.Yharon npc.netUpdate = true; return; } - } + } else if (npc.ai[0] == 15f) { - npc.dontTakeDamage = phase5Check; - npc.chaseable = true; - if (npc.ai[2] == 0f) + npc.dontTakeDamage = phase5Check; + npc.chaseable = true; + if (npc.ai[2] == 0f) { - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoar"), (int)npc.position.X, (int)npc.position.Y); - } - if (npc.ai[2] % (float)num1462 == 0f) + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoar"), (int)npc.position.X, (int)npc.position.Y); + } + if (npc.ai[2] % (float)num1462 == 0f) { - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoarShort"), (int)npc.position.X, (int)npc.position.Y); - if (Main.netMode != 1) + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoarShort"), (int)npc.position.X, (int)npc.position.Y); + if (Main.netMode != 1) { if (NPC.CountNPCS(mod.NPCType("DetonatingFlare2")) < flareCount && NPC.CountNPCS(mod.NPCType("DetonatingFlare")) < flareCount) { @@ -1442,14 +1445,14 @@ namespace CalamityMod.NPCs.Yharon NPC.NewNPC((int)vector6.X, (int)vector6.Y - 100, (Main.rand.Next(2) == 0 ? mod.NPCType("DetonatingFlare") : mod.NPCType("DetonatingFlare2")), 0, 0f, 0f, 0f, 0f, 255); } Vector2 vector = Vector2.Normalize(player.Center - vectorCenter) * (float)(npc.width + 20) / 2f + vectorCenter; - Projectile.NewProjectile((int)vector.X, (int)vector.Y - 100, (float)Main.rand.Next(-401, 401) * 0.13f, (float)Main.rand.Next(-31, 31) * 0.13f, mod.ProjectileType("FlareDust"), 0, 0f, Main.myPlayer, 0f, 0f); //changed - Projectile.NewProjectile((int)vector.X, (int)vector.Y - 100, (float)Main.rand.Next(-31, 31) * 0.13f, (float)Main.rand.Next(-151, 151) * 0.13f, mod.ProjectileType("FlareDust"), 0, 0f, Main.myPlayer, 0f, 0f); //changed + Projectile.NewProjectile((int)vector.X + xPos, (int)vector.Y - 15, (float)Main.rand.Next(-401, 401) * 0.13f, (float)Main.rand.Next(-31, 31) * 0.13f, mod.ProjectileType("FlareDust"), 0, 0f, Main.myPlayer, 0f, 0f); //changed + Projectile.NewProjectile((int)vector.X + xPos, (int)vector.Y - 15, (float)Main.rand.Next(-31, 31) * 0.13f, (float)Main.rand.Next(-151, 151) * 0.13f, mod.ProjectileType("FlareDust"), 0, 0f, Main.myPlayer, 0f, 0f); //changed } } npc.velocity = npc.velocity.RotatedBy((double)(-(double)num1463 * (float)npc.direction), default(Vector2)); npc.rotation -= num1463 * (float)npc.direction; npc.ai[2] += 1f; - if (npc.ai[2] >= (float)num1461) + if (npc.ai[2] >= (float)num1461) { npc.ai[0] = 13f; npc.ai[1] = 0f; @@ -1460,25 +1463,25 @@ namespace CalamityMod.NPCs.Yharon } else if (npc.ai[0] == 16f) { - npc.dontTakeDamage = phase5Check; - npc.chaseable = true; - npc.velocity *= 0.98f; + npc.dontTakeDamage = phase5Check; + npc.chaseable = true; + npc.velocity *= 0.98f; npc.velocity.Y = MathHelper.Lerp(npc.velocity.Y, 0f, 0.02f); - if (npc.ai[2] == (float)(num1457 - 30)) + if (npc.ai[2] == (float)(num1457 - 30)) { - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoarShort"), (int)npc.position.X, (int)npc.position.Y); - } - if (Main.netMode != 1 && npc.ai[2] == (float)(num1457 - 30)) + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoarShort"), (int)npc.position.X, (int)npc.position.Y); + } + if (Main.netMode != 1 && npc.ai[2] == (float)(num1457 - 30)) { Projectile.NewProjectile(vectorCenter.X, vectorCenter.Y, 0f, 0f, mod.ProjectileType("BigFlare"), 0, 0f, Main.myPlayer, 1f, (float)(npc.target + 1)); - } + } npc.ai[2] += 1f; - if (npc.ai[2] >= (float)num1457) + if (npc.ai[2] >= (float)num1457) { npc.ai[0] = 13f; npc.ai[1] = 0f; npc.ai[2] = 0f; - npc.ai[3] += 3f; + npc.ai[3] += 3f; npc.netUpdate = true; return; } @@ -1519,8 +1522,8 @@ namespace CalamityMod.NPCs.Yharon npc.velocity.Y = MathHelper.Lerp(npc.velocity.Y, 0f, 0.02f); if (npc.ai[2] == (float)(num1459 - 60)) { - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoar"), (int)npc.position.X, (int)npc.position.Y); - } + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoar"), (int)npc.position.X, (int)npc.position.Y); + } npc.ai[2] += 1f; if (npc.ai[2] >= (float)num1459) { @@ -1532,109 +1535,109 @@ namespace CalamityMod.NPCs.Yharon return; } } - else if (npc.ai[0] == 18f) - { - npc.dontTakeDamage = phase5Check; - npc.chaseable = true; - int num1479 = 14; - for (int num1480 = 0; num1480 < num1479; num1480++) - { - Vector2 vector176 = Vector2.Normalize(npc.velocity) * new Vector2((float)(npc.width + 50) / 2f, (float)npc.height) * 0.75f; - vector176 = vector176.RotatedBy((double)(num1480 - (num1479 / 2 - 1)) * 3.1415926535897931 / (double)((float)num1479), default(Vector2)) + vectorCenter; - Vector2 value21 = ((float)(Main.rand.NextDouble() * 3.1415927410125732) - 1.57079637f).ToRotationVector2() * (float)Main.rand.Next(3, 8); - int num1481 = Dust.NewDust(vector176 + value21, 0, 0, 244, value21.X * 2f, value21.Y * 2f, 100, default(Color), 1.4f); - Main.dust[num1481].noGravity = true; - Main.dust[num1481].noLight = true; - Main.dust[num1481].velocity /= 4f; - Main.dust[num1481].velocity -= npc.velocity; - } - npc.ai[2] += 1f; - if (npc.ai[2] >= (float)chargeTime2) - { - npc.ai[0] = 13f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] += 2f; - npc.netUpdate = true; - return; - } - } - else if (npc.ai[0] == 19f) - { - npc.dontTakeDamage = phase5Check; - npc.chaseable = true; - if (npc.ai[2] == 0f) - { - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoar"), (int)npc.position.X, (int)npc.position.Y); - } - if (npc.ai[2] % (float)num1462 == 0f) - { - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoarShort"), (int)npc.position.X, (int)npc.position.Y); - if (Main.netMode != 1) - { - int damage = expertMode ? 75 : 90; //700 - Vector2 vector173 = Vector2.Normalize(player.Center - vectorCenter) * (float)(npc.width + 20) / 2f + vectorCenter; - float speed = 0.01f; - Vector2 vectorShoot = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f + 30f); - float playerX = player.position.X + (float)player.width * 0.5f - vectorShoot.X; - float playerY = player.position.Y - vectorShoot.Y; - float playerXY = (float)Math.Sqrt((double)(playerX * playerX + playerY * playerY)); - playerXY = speed / playerXY; - playerX *= playerXY; - playerY *= playerXY; - Projectile.NewProjectile((int)vector173.X, (int)vector173.Y - 100, playerX, playerY, mod.ProjectileType("FlareDust2"), damage, 0f, Main.myPlayer, 0f, 0f); - } - } - npc.velocity = npc.velocity.RotatedBy((double)(-(double)num1463 * (float)npc.direction), default(Vector2)); - npc.rotation -= num1463 * (float)npc.direction; - npc.ai[2] += 1f; - if (npc.ai[2] >= (float)num1461) - { - npc.ai[0] = 13f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] += 1f; - npc.netUpdate = true; - return; - } - } - else if (npc.ai[0] == 20f) - { - npc.dontTakeDamage = phase5Check; - npc.chaseable = true; - npc.velocity *= 0.98f; - npc.velocity.Y = MathHelper.Lerp(npc.velocity.Y, 0f, 0.02f); - if (npc.ai[2] == (float)(num1457 - 30)) - { - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoarShort"), (int)npc.position.X, (int)npc.position.Y); - } - if (CalamityWorld.death && !CalamityWorld.bossRushActive) - { - if (Main.netMode != 1 && npc.ai[2] == (float)(num1457 - 30)) - { - Projectile.NewProjectile(vectorCenter.X, vectorCenter.Y, 0f, 0f, mod.ProjectileType("BigFlare"), 0, 0f, Main.myPlayer, 1f, (float)(npc.target + 1)); - } - } - else - { - if (Main.netMode != 1 && npc.ai[2] == (float)(num1457 - 30)) - { - Projectile.NewProjectile(vectorCenter.X, vectorCenter.Y, 0f, 0f, mod.ProjectileType("Flare"), 0, 0f, Main.myPlayer, 1f, (float)(npc.target + 1)); - } - } - npc.ai[2] += 1f; - if (npc.ai[2] >= (float)num1457) - { - npc.ai[0] = 13f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.netUpdate = true; - return; - } - } - #endregion - #region Phase4 - else if (npc.ai[0] == 21f && !player.dead) + else if (npc.ai[0] == 18f) + { + npc.dontTakeDamage = phase5Check; + npc.chaseable = true; + int num1479 = 14; + for (int num1480 = 0; num1480 < num1479; num1480++) + { + Vector2 vector176 = Vector2.Normalize(npc.velocity) * new Vector2((float)(npc.width + 50) / 2f, (float)npc.height) * 0.75f; + vector176 = vector176.RotatedBy((double)(num1480 - (num1479 / 2 - 1)) * 3.1415926535897931 / (double)((float)num1479), default(Vector2)) + vectorCenter; + Vector2 value21 = ((float)(Main.rand.NextDouble() * 3.1415927410125732) - 1.57079637f).ToRotationVector2() * (float)Main.rand.Next(3, 8); + int num1481 = Dust.NewDust(vector176 + value21, 0, 0, 244, value21.X * 2f, value21.Y * 2f, 100, default(Color), 1.4f); + Main.dust[num1481].noGravity = true; + Main.dust[num1481].noLight = true; + Main.dust[num1481].velocity /= 4f; + Main.dust[num1481].velocity -= npc.velocity; + } + npc.ai[2] += 1f; + if (npc.ai[2] >= (float)chargeTime2) + { + npc.ai[0] = 13f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.ai[3] += 2f; + npc.netUpdate = true; + return; + } + } + else if (npc.ai[0] == 19f) + { + npc.dontTakeDamage = phase5Check; + npc.chaseable = true; + if (npc.ai[2] == 0f) + { + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoar"), (int)npc.position.X, (int)npc.position.Y); + } + if (npc.ai[2] % (float)num1462 == 0f) + { + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoarShort"), (int)npc.position.X, (int)npc.position.Y); + if (Main.netMode != 1) + { + int damage = expertMode ? 75 : 90; //700 + Vector2 vector173 = Vector2.Normalize(player.Center - vectorCenter) * (float)(npc.width + 20) / 2f + vectorCenter; + float speed = 0.01f; + Vector2 vectorShoot = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f + 30f); + float playerX = player.position.X + (float)player.width * 0.5f - vectorShoot.X; + float playerY = player.position.Y - vectorShoot.Y; + float playerXY = (float)Math.Sqrt((double)(playerX * playerX + playerY * playerY)); + playerXY = speed / playerXY; + playerX *= playerXY; + playerY *= playerXY; + Projectile.NewProjectile((int)vector173.X + xPos, (int)vector173.Y - 15, playerX, playerY, mod.ProjectileType("FlareDust2"), damage, 0f, Main.myPlayer, 0f, 0f); + } + } + npc.velocity = npc.velocity.RotatedBy((double)(-(double)num1463 * (float)npc.direction), default(Vector2)); + npc.rotation -= num1463 * (float)npc.direction; + npc.ai[2] += 1f; + if (npc.ai[2] >= (float)num1461) + { + npc.ai[0] = 13f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.ai[3] += 1f; + npc.netUpdate = true; + return; + } + } + else if (npc.ai[0] == 20f) + { + npc.dontTakeDamage = phase5Check; + npc.chaseable = true; + npc.velocity *= 0.98f; + npc.velocity.Y = MathHelper.Lerp(npc.velocity.Y, 0f, 0.02f); + if (npc.ai[2] == (float)(num1457 - 30)) + { + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoarShort"), (int)npc.position.X, (int)npc.position.Y); + } + if (CalamityWorld.death && !CalamityWorld.bossRushActive) + { + if (Main.netMode != 1 && npc.ai[2] == (float)(num1457 - 30)) + { + Projectile.NewProjectile(vectorCenter.X, vectorCenter.Y, 0f, 0f, mod.ProjectileType("BigFlare"), 0, 0f, Main.myPlayer, 1f, (float)(npc.target + 1)); + } + } + else + { + if (Main.netMode != 1 && npc.ai[2] == (float)(num1457 - 30)) + { + Projectile.NewProjectile(vectorCenter.X, vectorCenter.Y, 0f, 0f, mod.ProjectileType("Flare"), 0, 0f, Main.myPlayer, 1f, (float)(npc.target + 1)); + } + } + npc.ai[2] += 1f; + if (npc.ai[2] >= (float)num1457) + { + npc.ai[0] = 13f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.netUpdate = true; + return; + } + } + #endregion + #region Phase4 + else if (npc.ai[0] == 21f && !player.dead) { npc.dontTakeDamage = phase5Check; npc.chaseable = false; @@ -1661,7 +1664,7 @@ namespace CalamityMod.NPCs.Yharon npc.rotation = 3.14159274f; } npc.direction = num32; - if (num32 != 0) + if (num32 != 0) { npc.direction = num32; npc.rotation = 0f; @@ -1684,36 +1687,36 @@ namespace CalamityMod.NPCs.Yharon case 10: case 11: case 12: //skip 13 - case 14: - case 15: - case 16: - case 17: - case 18: //skip 19 + case 14: + case 15: + case 16: + case 17: + case 18: //skip 19 aiState = 1; break; case 1: //+3 case 4: //+4 case 8: //+5 case 13: //+6 - case 19: + case 19: aiState = 2; break; } - if (phase5Check) - { - aiState = 4; - } - if (aiState == 1) + if (phase5Check) + { + aiState = 4; + } + if (aiState == 1) { npc.ai[0] = 22f; npc.ai[1] = 0f; npc.ai[2] = 0f; npc.velocity = Vector2.Normalize(player.Center - vectorCenter) * chargeSpeed; npc.rotation = (float)Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X); - if (num32 != 0) + if (num32 != 0) { npc.direction = num32; - if (npc.spriteDirection == 1) + if (npc.spriteDirection == 1) { npc.rotation += 3.14159274f; } @@ -1732,13 +1735,13 @@ namespace CalamityMod.NPCs.Yharon npc.ai[1] = 0f; npc.ai[2] = 0f; } - else if (aiState == 4) - { - npc.ai[0] = 25f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - } - npc.netUpdate = true; + else if (aiState == 4) + { + npc.ai[0] = 25f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + } + npc.netUpdate = true; return; } } @@ -1790,8 +1793,8 @@ namespace CalamityMod.NPCs.Yharon npc.velocity.Y = MathHelper.Lerp(npc.velocity.Y, 0f, 0.02f); if (npc.ai[2] == (float)(num1460 / 2)) { - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoarShort"), (int)npc.position.X, (int)npc.position.Y); - } + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoarShort"), (int)npc.position.X, (int)npc.position.Y); + } if (Main.netMode != 1 && npc.ai[2] == (float)(num1460 / 2)) { if (npc.ai[1] == 0f) @@ -1810,14 +1813,14 @@ namespace CalamityMod.NPCs.Yharon npc.ai[1] = 0f; npc.ai[2] = 0f; npc.ai[3] += 1f; - if (npc.ai[3] == 5f && Main.netMode != 1) - { - Projectile.NewProjectile(vectorCenter.X, vectorCenter.Y, 0f, 0f, mod.ProjectileType("BigFlare"), 0, 0f, Main.myPlayer, 1f, (float)(npc.target + 1)); - } - if (npc.ai[3] >= 20f) //14 + if (npc.ai[3] == 5f && Main.netMode != 1) + { + Projectile.NewProjectile(vectorCenter.X, vectorCenter.Y, 0f, 0f, mod.ProjectileType("BigFlare"), 0, 0f, Main.myPlayer, 1f, (float)(npc.target + 1)); + } + if (npc.ai[3] >= 20f) //14 { npc.ai[3] = 0f; - } + } npc.netUpdate = true; return; } @@ -1828,8 +1831,8 @@ namespace CalamityMod.NPCs.Yharon npc.chaseable = true; if (npc.ai[2] == 0f) { - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoarShort"), (int)npc.position.X, (int)npc.position.Y); - } + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoarShort"), (int)npc.position.X, (int)npc.position.Y); + } npc.velocity = npc.velocity.RotatedBy((double)(-(double)num1463 * (float)npc.direction), default(Vector2)); npc.rotation -= num1463 * (float)npc.direction; npc.ai[2] += 1f; @@ -1842,733 +1845,741 @@ namespace CalamityMod.NPCs.Yharon npc.netUpdate = true; } } - else if (npc.ai[0] == 25f) //start phase 5 - { - npc.alpha = 0; - npc.dontTakeDamage = true; - npc.chaseable = false; - npc.velocity *= 0.98f; - npc.velocity.Y = MathHelper.Lerp(npc.velocity.Y, 0f, 0.02f); - if (npc.ai[2] == (float)(num1459 - 60)) - { - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoar"), (int)npc.position.X, (int)npc.position.Y); - } - npc.ai[2] += 1f; - if (npc.ai[2] >= (float)num1459) - { - npc.localAI[2] = 1f; - npc.ai[0] = 0f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] = 0f; - npc.netUpdate = true; - return; - } - } - #endregion - } - - #region AI2 - public void Yharon_AI2() - { - bool revenge = (CalamityWorld.revenge || CalamityWorld.bossRushActive); - bool expertMode = Main.expertMode; - bool phase2 = (double)npc.life <= (double)npc.lifeMax * 0.66; - bool phase3 = (double)npc.life <= (double)npc.lifeMax * 0.33; - bool tantrum = (double)npc.life <= (double)npc.lifeMax * 0.04; - npc.defense = 100; - npc.alpha -= 25; - if (npc.alpha < 0) - { - npc.alpha = 0; - } - if (!moveCloser) - { - Mod calamityModMusic = ModLoader.GetMod("CalamityModMusic"); - if (calamityModMusic != null) - music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/DragonGod"); - else - music = MusicID.LunarBoss; - moveCloser = true; - if ((CalamityWorld.death || CalamityWorld.bossRushActive) && Main.netMode != 1) - { - NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("DetonatingFlare3"), 0, 0f, 0f, 0f, 0f, 255); - } - string key = "Mods.CalamityMod.FlameText"; - Color messageColor = Color.Orange; - if (Main.netMode == 0) - { - Main.NewText(Language.GetTextValue(key), messageColor); - } - else if (Main.netMode == 2) - { - NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); - } - } - if (npc.localAI[3] < 900f) - { - npc.localAI[3] += 1f; - int heal = 5; //180 heals 50% and 30% - healCounter += 1; - if (healCounter >= heal) - { - healCounter = 0; - if (Main.netMode != 1) - { - int fractionHealed = revenge ? 240 : 300; //100000 / 240 * 180 = 75000 healed = 75% heal - if (CalamityWorld.death || CalamityWorld.bossRushActive) - { - fractionHealed = 200; //100000 / 200 * 180 = 90000 healed = 90% heal - } - int healAmt = npc.lifeMax / fractionHealed; - if (healAmt > npc.lifeMax - npc.life) - { - healAmt = npc.lifeMax - npc.life; - } - if (healAmt > 0) - { - npc.life += healAmt; - npc.HealEffect(healAmt, true); - npc.netUpdate = true; - } - } - } - } - else - { - npc.dontTakeDamage = false; - npc.chaseable = true; - } - NPCUtils.TargetClosestBetsy(npc, false, null); - NPCAimedTarget targetData = npc.GetTargetData(true); - if (!targetData.Hitbox.Intersects(safeBox)) - { - protectionBoost = true; - npc.damage = npc.defDamage * 5; - if (npc.timeLeft > 150) - { - npc.timeLeft = 150; - } - } - else - { - npc.damage = expertMode ? 528 : 330; - protectionBoost = false; - if (npc.timeLeft < 3600) - { - npc.timeLeft = 3600; - } - } - int num = -1; - float num2 = 1f; - int num4 = expertMode ? 106 : 125; //600 - float num5 = 10f; - float num6 = revenge ? 0.6f : 0.55f; //0.45 - float scaleFactor = revenge ? 10f : 9f; //7.5 - float num7 = 30f; - float num8 = 30f; - float scaleFactor2 = revenge ? 26f : 24.5f; //23 - float num9 = 600f; - float num10 = 12f; - float num11 = 40f; - float num12 = (CalamityWorld.death && !CalamityWorld.bossRushActive) ? 40f : 80f; - float num13 = num11 + num12; - float num14 = 1500f; - float num15 = 60f; - float scaleFactor3 = 13f; - float amount = 0.0333333351f; - float scaleFactor4 = revenge ? 16f : 14.5f; //12 - int num16 = 10; - int num17 = 6 * num16; - float num18 = 60f; - float num19 = num15 + (float)num17 + num18; - float num20 = 60f; - float num21 = 1f; - float num22 = 6.28318548f * (num21 / num20); - float num23 = 0.1f; - float scaleFactor5 = revenge ? 38f : 36.5f; //32 - if (npc.GetGlobalNPC(mod).enraged) - { - num6 = 0.65f; - scaleFactor = 11f; - scaleFactor2 = 28f; - scaleFactor4 = 18f; - scaleFactor5 = 40f; - } - float num24 = 90f; - float num25 = 20f; - float arg_F9_0 = npc.ai[0]; - float num26; - if (npc.ai[0] == 0f) - { - float[] expr_115_cp_0 = npc.ai; - int expr_115_cp_1 = 1; - num26 = expr_115_cp_0[expr_115_cp_1] + 1f; - expr_115_cp_0[expr_115_cp_1] = num26; - if (num26 >= num5) - { - npc.ai[1] = 0f; - npc.ai[0] = 1f; - npc.ai[2] = 0f; - npc.netUpdate = true; - } - } - else if (npc.ai[0] == 1f) - { - if (npc.ai[2] == 0f) - { - npc.ai[2] = (float)((npc.Center.X < targetData.Center.X) ? 1 : -1); - } - Vector2 destination = targetData.Center + new Vector2(-npc.ai[2] * 300f, -200f); - Vector2 desiredVelocity = npc.DirectionTo(destination) * scaleFactor; - npc.SimpleFlyMovement(desiredVelocity, num6); - int num27 = (npc.Center.X < targetData.Center.X) ? 1 : -1; - npc.direction = (npc.spriteDirection = num27); - float[] expr_225_cp_0 = npc.ai; - int expr_225_cp_1 = 1; - num26 = expr_225_cp_0[expr_225_cp_1] + 1f; - expr_225_cp_0[expr_225_cp_1] = num26; - if (num26 >= num7) - { - int num28 = 1; - if (phase3) - { - switch ((int)npc.ai[3]) - { - case 0: - num28 = 6; //tornado - break; - case 1: - num28 = 2; //charge - break; - case 2: - num28 = 5; //fire circle - break; - case 3: - num28 = 4; //splitting fireballs - break; - case 4: - num28 = 3; //homing fireballs - break; - case 5: - num28 = 6; //tornado - break; - case 6: - case 7: - num28 = 2; //double charge - break; - case 8: - num28 = 5; //fire circle - break; - case 9: - num28 = 4; //splitting fireballs - break; - } - } - else if (phase2) - { - switch ((int)npc.ai[3]) - { - case 0: - num28 = 6; //tornado - break; - case 1: - case 2: - num28 = 2; //charge - break; - case 3: - num28 = 5; //fire circle - break; - case 4: - num28 = 3; //homing fireballs - break; - case 5: - case 6: - num28 = 4; //double splitting fireballs - break; - case 7: - case 8: - num28 = 2; //double charge - break; - case 9: - num28 = 5; //fire circle - break; - } - } - else - { - switch ((int)npc.ai[3]) - { - case 0: - num28 = 6; //tornado - break; - case 1: - case 2: - num28 = 2; //double charge - break; - case 3: - num28 = 3; //homing fireballs - break; - case 4: - num28 = 4; //splitting fireballs - break; - case 5: - case 6: - num28 = 2; //double charge - break; - case 7: - num28 = 5; //fire circle - break; - } - } - npc.ai[0] = (float)num28; - if (tantrum) - { - npc.ai[0] = 2f; - } - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] += 1f; - npc.netUpdate = true; - float aiLimit = 8f; - if (phase2) - { - aiLimit = 10f; - } - if (npc.ai[3] >= aiLimit) - { - npc.ai[3] = 0f; - } - switch (num28) - { - case 2: //charge - { - Vector2 vector = npc.DirectionTo(targetData.Center); - npc.spriteDirection = ((vector.X > 0f) ? 1 : -1); - npc.rotation = vector.ToRotation(); - if (npc.spriteDirection == -1) - { - npc.rotation += 3.14159274f; - } - npc.velocity = vector * scaleFactor2; - break; - } - case 3: //homing fireballs - { - Vector2 vector2 = new Vector2((float)((targetData.Center.X > npc.Center.X) ? 1 : -1), 0f); - npc.spriteDirection = ((vector2.X > 0f) ? 1 : -1); - npc.velocity = vector2 * -2f; - break; - } - case 5: //spin move - { - Vector2 vector3 = npc.DirectionTo(targetData.Center); - npc.spriteDirection = ((vector3.X > 0f) ? 1 : -1); - npc.rotation = vector3.ToRotation(); - if (npc.spriteDirection == -1) - { - npc.rotation += 3.14159274f; - } - npc.velocity = vector3 * scaleFactor5; - break; - } - } - } - } - else if (npc.ai[0] == 2f) - { - if (npc.ai[1] == 0f) - { - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoarShort"), (int)npc.position.X, (int)npc.position.Y); - } - float[] expr_498_cp_0 = npc.ai; - int expr_498_cp_1 = 1; - num26 = expr_498_cp_0[expr_498_cp_1] + 1f; - expr_498_cp_0[expr_498_cp_1] = num26; - if (num26 >= num8) - { - npc.ai[0] = 1f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - } - } - else if (npc.ai[0] == 3f) //homing fireball spit - { - npc.ai[1] += 1f; - int num29 = (npc.Center.X < targetData.Center.X) ? 1 : -1; - npc.ai[2] = (float)num29; - if (npc.ai[1] < num11) - { - Vector2 vector4 = targetData.Center + new Vector2((float)num29 * -num9, -250f); - Vector2 value = npc.DirectionTo(vector4) * num10; - if (npc.Distance(vector4) < num10) - { - npc.Center = vector4; - } - else - { - npc.position += value; - } - if (Vector2.Distance(vector4, npc.Center) < 16f) - { - npc.ai[1] = num11 - 1f; - } - num2 = 1.5f; - } - if (npc.ai[1] == num11) - { - int num30 = (targetData.Center.X > npc.Center.X) ? 1 : -1; - npc.velocity = new Vector2((float)num30, 0f) * 22f; //10f - npc.direction = (npc.spriteDirection = num30); - } - if (npc.ai[1] >= num11) - { - if (npc.ai[1] % 10 == 0 && Main.netMode != 1) - { - float num33 = 30f; - Vector2 position = npc.Center + new Vector2((110f /* 110f */ + num33) * (float)npc.direction, -20f /* 20f */).RotatedBy((double)npc.rotation, - default(Vector2)); - Projectile.NewProjectile(position, npc.velocity, mod.ProjectileType("YharonFireballHoming"), num4, 0f, Main.myPlayer, 0f, 0f); - } - num2 = 1.5f; - if (Math.Abs(targetData.Center.X - npc.Center.X) > 550f && Math.Abs(npc.velocity.X) < 20f) - { - npc.velocity.X = npc.velocity.X + (float)Math.Sign(npc.velocity.X) * 0.5f; - } - } - if (npc.ai[1] >= num13) - { - npc.ai[0] = 1f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - } - } - else if (npc.ai[0] == 4f) //splitting fireball spit - { - int num31 = (npc.Center.X < targetData.Center.X) ? 1 : -1; - npc.ai[2] = (float)num31; - if (npc.ai[1] < num15) - { - Vector2 vector5 = targetData.Center + new Vector2((float)num31 * -num14, -350f); - Vector2 value2 = npc.DirectionTo(vector5) * scaleFactor3; - npc.velocity = Vector2.Lerp(npc.velocity, value2, amount); - int num32 = (npc.Center.X < targetData.Center.X) ? 1 : -1; - npc.direction = (npc.spriteDirection = num32); - if (Vector2.Distance(vector5, npc.Center) < 16f) - { - npc.ai[1] = num15 - 1f; - } - num2 = 1.5f; - } - else if (npc.ai[1] == num15) - { - Vector2 vector6 = npc.DirectionTo(targetData.Center); - vector6.Y *= 0.25f; - vector6 = vector6.SafeNormalize(Vector2.UnitX * (float)npc.direction); - npc.spriteDirection = ((vector6.X > 0f) ? 1 : -1); - npc.rotation = vector6.ToRotation(); - if (npc.spriteDirection == -1) - { - npc.rotation += 3.14159274f; - } - npc.velocity = vector6 * scaleFactor4; - } - else - { - npc.position.X = npc.position.X + npc.DirectionTo(targetData.Center).X * 7f; - npc.position.Y = npc.position.Y + npc.DirectionTo(targetData.Center + new Vector2(0f, -400f)).Y * 6f; - if (npc.ai[1] <= num19 - num18) - { - num2 = 1.5f; - } - float num33 = 30f; - Vector2 position = npc.Center + new Vector2((110f /* 110f */ + num33) * (float)npc.direction, -20f).RotatedBy((double)npc.rotation, - default(Vector2)); - int num34 = (int)(npc.ai[1] - num15 + 1f); - if (num34 <= num17 && num34 % num16 == 0 && Main.netMode != 1) - { - Projectile.NewProjectile(position, npc.velocity, mod.ProjectileType("YharonFireball"), num4, 0f, Main.myPlayer, 0f, 0f); //change - } - } - if (npc.ai[1] > num19 - num18) - { - npc.velocity.Y = npc.velocity.Y - 0.1f; - } - npc.ai[1] += 1f; - if (npc.ai[1] >= num19) - { - npc.ai[0] = 1f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - } - } - else if (npc.ai[0] == 5f) - { - npc.velocity = npc.velocity.RotatedBy((double)(-(double)num22 * (float)npc.direction), default(Vector2)); - npc.position.Y = npc.position.Y - num23; - npc.position += npc.DirectionTo(targetData.Center) * 10f; - npc.rotation -= num22 * (float)npc.direction; - num2 *= 0.7f; - if (npc.ai[1] == 1f) - { - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoarShort"), (int)npc.position.X, (int)npc.position.Y); - } - float[] expr_B0F_cp_0 = npc.ai; - int expr_B0F_cp_1 = 1; - num26 = expr_B0F_cp_0[expr_B0F_cp_1] + 1f; - expr_B0F_cp_0[expr_B0F_cp_1] = num26; - if (npc.ai[1] % 12 == 0 && Main.netMode != 1) - { - float num33 = 30f; - Vector2 position = npc.Center + new Vector2((110f /* 110f */ + num33) * (float)npc.direction, -20f /* 20f */).RotatedBy((double)npc.rotation, - default(Vector2)); - int projectileType = (((npc.ai[1] / 2) % 12 == 0) ? mod.ProjectileType("YharonFireball") : mod.ProjectileType("YharonFireballHoming")); - Projectile.NewProjectile(position, npc.velocity, projectileType, num4, 0f, Main.myPlayer, 0f, 0f); - } - if (num26 >= num20) - { - npc.ai[0] = 1f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.velocity /= 2f; - } - } - else if (npc.ai[0] == 6f) //birb spawn - { - if (npc.ai[1] == 0f) - { - Vector2 destination2 = targetData.Center + new Vector2(0f, -200f); - Vector2 desiredVelocity2 = npc.DirectionTo(destination2) * scaleFactor * 2f; - npc.SimpleFlyMovement(desiredVelocity2, num6 * 2f); - int num35 = (npc.Center.X < targetData.Center.X) ? 1 : -1; - npc.direction = (npc.spriteDirection = num35); - npc.ai[2] += 1f; - if (npc.Distance(targetData.Center) < 1000f || npc.ai[2] >= 180f) //450f - { - npc.ai[1] = 1f; - npc.netUpdate = true; - } - } - else - { - if (npc.ai[1] == 1f) - { - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoar"), (int)npc.position.X, (int)npc.position.Y); - } - if (npc.ai[1] < num25) - { - npc.velocity *= 0.95f; - } - else - { - npc.velocity *= 0.98f; - } - if (npc.ai[1] == num25) - { - if (npc.velocity.Y > 0f) - { - npc.velocity.Y = npc.velocity.Y / 3f; - } - npc.velocity.Y = npc.velocity.Y - 3f; - } - num2 *= 0.85f; - bool flag3 = npc.ai[1] == 20f || npc.ai[1] == 45f || npc.ai[1] == 70f; - if (NPC.CountNPCS(mod.NPCType("Bumblefuck3")) > 2) - { - flag3 = false; - } - if (flag3 && Main.netMode != 1) - { - Vector2 vector7 = npc.Center + (6.28318548f * Main.rand.NextFloat()).ToRotationVector2() * new Vector2(2f, 1f) * 100f * (0.6f + Main.rand.NextFloat() * 0.4f); - if (Vector2.Distance(vector7, targetData.Center) > 100f) - { - Point point2 = vector7.ToPoint(); - NPC.NewNPC(point2.X, point2.Y, mod.NPCType("Bumblefuck3"), npc.whoAmI, 0f, 0f, 0f, 0f, 255); - } - NPC.NewNPC((int)npc.Center.X + (Main.rand.Next(2) == 0 ? 100 : -100), (int)npc.Center.Y - 100, mod.NPCType("Bumblefuck3"), 0, 0f, 0f, 0f, 0f, 255); - } - npc.ai[1] += 1f; - } - if (npc.ai[1] >= num24) - { - Projectile.NewProjectile(npc.Center.X, npc.Center.Y, 0f, 0f, mod.ProjectileType("BigFlare"), 0, 0f, Main.myPlayer, 1f, (float)(npc.target + 1)); - Boom(600, num4); - npc.ai[0] = 1f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - } - } - npc.localAI[0] += num2; - if (npc.localAI[0] >= 36f) - { - npc.localAI[0] = 0f; - } - if (num != -1) - { - npc.localAI[0] = (float)(num * 4); - } - float[] expr_11FC_cp_0 = npc.localAI; - int expr_11FC_cp_1 = 1; - num26 = expr_11FC_cp_0[expr_11FC_cp_1] + 1f; - expr_11FC_cp_0[expr_11FC_cp_1] = num26; - if (num26 >= 60f) - { - npc.localAI[1] = 0f; - } - float num42 = npc.DirectionTo(targetData.Center).ToRotation(); - float num43 = 0.04f; - switch ((int)npc.ai[0]) - { - case 2: - case 5: - num43 = 0f; - break; - case 3: - num43 = 0.01f; - num42 = 0f; - if (npc.spriteDirection == -1) - { - num42 -= 3.14159274f; - } - if (npc.ai[1] >= num11) - { - num42 += (float)npc.spriteDirection * 3.14159274f / 12f; - num43 = 0.05f; - } - break; - case 4: - num43 = 0.01f; - num42 = 3.14159274f; - if (npc.spriteDirection == 1) - { - num42 += 3.14159274f; - } - break; - case 6: - num43 = 0.02f; - num42 = 0f; - if (npc.spriteDirection == -1) - { - num42 -= 3.14159274f; - } - break; - } - if (npc.spriteDirection == -1) - { - num42 += 3.14159274f; - } - if (num43 != 0f) - { - npc.rotation = npc.rotation.AngleTowards(num42, num43); - } - } - #endregion - - #region Drawing - public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) - { - SpriteEffects spriteEffects = SpriteEffects.None; - if (npc.spriteDirection == 1) - { - spriteEffects = SpriteEffects.FlipHorizontally; - } - float num66 = 0f; - Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2)); - Microsoft.Xna.Framework.Rectangle frame6 = npc.frame; - Microsoft.Xna.Framework.Color color9 = Lighting.GetColor((int)((double)npc.position.X + (double)npc.width * 0.5) / 16, (int)(((double)npc.position.Y + (double)npc.height * 0.5) / 16.0)); - if (npc.localAI[2] == 1f && !phaseOneLoot) - { - SpriteEffects spriteEffects2 = spriteEffects ^ SpriteEffects.FlipHorizontally; - if (npc.localAI[3] < 900f) - { - color9 = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB, 0); - } - Main.spriteBatch.Draw(Main.npcTexture[npc.type], - new Vector2(npc.position.X - Main.screenPosition.X + (float)(npc.width / 2) - (float)Main.npcTexture[npc.type].Width * npc.scale / 2f + vector11.X * npc.scale, - npc.position.Y - Main.screenPosition.Y + (float)npc.height - (float)Main.npcTexture[npc.type].Height * npc.scale / (float)Main.npcFrameCount[npc.type] + 4f + vector11.Y * npc.scale + num66 + npc.gfxOffY), - new Microsoft.Xna.Framework.Rectangle?(frame6), - npc.GetAlpha(color9), - npc.rotation, - vector11, - npc.scale, - spriteEffects2, - 0f); - return false; - } - Microsoft.Xna.Framework.Color alpha15 = npc.GetAlpha(color9); - float num212 = 1f - (float)npc.life / (float)npc.lifeMax; - num212 *= num212; - alpha15.R = (byte)((float)alpha15.R * num212); - alpha15.G = (byte)((float)alpha15.G * num212); - alpha15.B = (byte)((float)alpha15.B * num212); - alpha15.A = (byte)((float)alpha15.A * num212); - for (int num213 = 0; num213 < 4; num213++) + else if (npc.ai[0] == 25f) //start phase 5 { - Vector2 position9 = npc.position; - float num214 = Math.Abs(npc.Center.X - Main.player[Main.myPlayer].Center.X); - float num215 = Math.Abs(npc.Center.Y - Main.player[Main.myPlayer].Center.Y); - if (num213 == 0 || num213 == 2) + npc.alpha = 0; + npc.dontTakeDamage = true; + npc.chaseable = false; + npc.velocity *= 0.98f; + npc.velocity.Y = MathHelper.Lerp(npc.velocity.Y, 0f, 0.02f); + if (npc.ai[2] == (float)(num1459 - 60)) { - position9.X = Main.player[Main.myPlayer].Center.X + num214; - } - else - { - position9.X = Main.player[Main.myPlayer].Center.X - num214; + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoar"), (int)npc.position.X, (int)npc.position.Y); } - position9.X -= (float)(npc.width / 2); - if (num213 == 0 || num213 == 1) + npc.ai[2] += 1f; + if (npc.ai[2] >= (float)num1459) { - position9.Y = Main.player[Main.myPlayer].Center.Y + num215; - } + npc.localAI[2] = 1f; + npc.ai[0] = 0f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.ai[3] = 0f; + npc.netUpdate = true; + return; + } + } + #endregion + } + + #region AI2 + public void Yharon_AI2() + { + bool revenge = (CalamityWorld.revenge || CalamityWorld.bossRushActive); + bool expertMode = Main.expertMode; + bool phase2 = (double)npc.life <= (double)npc.lifeMax * 0.66; + bool phase3 = (double)npc.life <= (double)npc.lifeMax * 0.33; + bool tantrum = (double)npc.life <= (double)npc.lifeMax * 0.04; + npc.defense = 100; + npc.alpha -= 25; + if (npc.alpha < 0) + { + npc.alpha = 0; + } + if (!moveCloser) + { + Mod calamityModMusic = ModLoader.GetMod("CalamityModMusic"); + if (calamityModMusic != null) + music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/DragonGod"); + else + music = MusicID.LunarBoss; + moveCloser = true; + if ((CalamityWorld.death || CalamityWorld.bossRushActive) && Main.netMode != 1) + { + NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("DetonatingFlare3"), 0, 0f, 0f, 0f, 0f, 255); + } + string key = "Mods.CalamityMod.FlameText"; + Color messageColor = Color.Orange; + if (Main.netMode == 0) + { + Main.NewText(Language.GetTextValue(key), messageColor); + } + else if (Main.netMode == 2) + { + NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); + } + } + if (npc.localAI[3] < 900f) + { + npc.localAI[3] += 1f; + int heal = 5; //180 heals 50% and 30% + healCounter += 1; + if (healCounter >= heal) + { + healCounter = 0; + if (Main.netMode != 1) + { + int fractionHealed = revenge ? 240 : 300; //100000 / 240 * 180 = 75000 healed = 75% heal + if (CalamityWorld.death || CalamityWorld.bossRushActive) + { + fractionHealed = 200; //100000 / 200 * 180 = 90000 healed = 90% heal + } + int healAmt = npc.lifeMax / fractionHealed; + if (healAmt > npc.lifeMax - npc.life) + { + healAmt = npc.lifeMax - npc.life; + } + if (healAmt > 0) + { + npc.life += healAmt; + npc.HealEffect(healAmt, true); + npc.netUpdate = true; + } + } + } + } + else + { + npc.dontTakeDamage = false; + npc.chaseable = true; + } + NPCUtils.TargetClosestBetsy(npc, false, null); + NPCAimedTarget targetData = npc.GetTargetData(true); + if (!targetData.Hitbox.Intersects(safeBox)) + { + protectionBoost = true; + npc.damage = npc.defDamage * 5; + if (npc.timeLeft > 150) + { + npc.timeLeft = 150; + } + } + else + { + npc.damage = expertMode ? 528 : 330; + protectionBoost = false; + if (npc.timeLeft < 3600) + { + npc.timeLeft = 3600; + } + } + int num = -1; + float num2 = 1f; + int num4 = expertMode ? 106 : 125; //600 + float num5 = 10f; + float num6 = revenge ? 0.6f : 0.55f; //0.45 + float scaleFactor = revenge ? 10f : 9f; //7.5 + float num7 = 30f; + float num8 = 30f; + float scaleFactor2 = revenge ? 26f : 24.5f; //23 + float num9 = 600f; + float num10 = 12f; + float num11 = 40f; + float num12 = (CalamityWorld.death && !CalamityWorld.bossRushActive) ? 40f : 80f; + float num13 = num11 + num12; + float num14 = 1500f; + float num15 = 60f; + float scaleFactor3 = 13f; + float amount = 0.0333333351f; + float scaleFactor4 = revenge ? 16f : 14.5f; //12 + int num16 = 10; + int num17 = 6 * num16; + float num18 = 60f; + float num19 = num15 + (float)num17 + num18; + float num20 = 60f; + float num21 = 1f; + float num22 = 6.28318548f * (num21 / num20); + float num23 = 0.1f; + float scaleFactor5 = revenge ? 38f : 36.5f; //32 + if (npc.GetGlobalNPC(mod).enraged) + { + num6 = 0.65f; + scaleFactor = 11f; + scaleFactor2 = 28f; + scaleFactor4 = 18f; + scaleFactor5 = 40f; + } + float num24 = 90f; + float num25 = 20f; + float arg_F9_0 = npc.ai[0]; + float num26; + if (npc.ai[0] == 0f) + { + float[] expr_115_cp_0 = npc.ai; + int expr_115_cp_1 = 1; + num26 = expr_115_cp_0[expr_115_cp_1] + 1f; + expr_115_cp_0[expr_115_cp_1] = num26; + if (num26 >= num5) + { + npc.ai[1] = 0f; + npc.ai[0] = 1f; + npc.ai[2] = 0f; + npc.netUpdate = true; + } + } + else if (npc.ai[0] == 1f) + { + if (npc.ai[2] == 0f) + { + npc.ai[2] = (float)((npc.Center.X < targetData.Center.X) ? 1 : -1); + } + Vector2 destination = targetData.Center + new Vector2(-npc.ai[2] * 300f, -200f); + Vector2 desiredVelocity = npc.DirectionTo(destination) * scaleFactor; + npc.SimpleFlyMovement(desiredVelocity, num6); + int num27 = (npc.Center.X < targetData.Center.X) ? 1 : -1; + npc.direction = (npc.spriteDirection = num27); + float[] expr_225_cp_0 = npc.ai; + int expr_225_cp_1 = 1; + num26 = expr_225_cp_0[expr_225_cp_1] + 1f; + expr_225_cp_0[expr_225_cp_1] = num26; + if (num26 >= num7) + { + int num28 = 1; + if (phase3) + { + switch ((int)npc.ai[3]) + { + case 0: + num28 = 6; //tornado + break; + case 1: + num28 = 2; //charge + break; + case 2: + num28 = 5; //fire circle + break; + case 3: + num28 = 4; //splitting fireballs + break; + case 4: + num28 = 3; //homing fireballs + break; + case 5: + num28 = 6; //tornado + break; + case 6: + case 7: + num28 = 2; //double charge + break; + case 8: + num28 = 5; //fire circle + break; + case 9: + num28 = 4; //splitting fireballs + break; + } + } + else if (phase2) + { + switch ((int)npc.ai[3]) + { + case 0: + num28 = 6; //tornado + break; + case 1: + case 2: + num28 = 2; //charge + break; + case 3: + num28 = 5; //fire circle + break; + case 4: + num28 = 3; //homing fireballs + break; + case 5: + case 6: + num28 = 4; //double splitting fireballs + break; + case 7: + case 8: + num28 = 2; //double charge + break; + case 9: + num28 = 5; //fire circle + break; + } + } + else + { + switch ((int)npc.ai[3]) + { + case 0: + num28 = 6; //tornado + break; + case 1: + case 2: + num28 = 2; //double charge + break; + case 3: + num28 = 3; //homing fireballs + break; + case 4: + num28 = 4; //splitting fireballs + break; + case 5: + case 6: + num28 = 2; //double charge + break; + case 7: + num28 = 5; //fire circle + break; + } + } + npc.ai[0] = (float)num28; + if (tantrum) + { + npc.ai[0] = 2f; + } + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.ai[3] += 1f; + npc.netUpdate = true; + float aiLimit = 8f; + if (phase2) + { + aiLimit = 10f; + } + if (npc.ai[3] >= aiLimit) + { + npc.ai[3] = 0f; + } + switch (num28) + { + case 2: //charge + { + Vector2 vector = npc.DirectionTo(targetData.Center); + npc.spriteDirection = ((vector.X > 0f) ? 1 : -1); + npc.rotation = vector.ToRotation(); + if (npc.spriteDirection == -1) + { + npc.rotation += 3.14159274f; + } + npc.velocity = vector * scaleFactor2; + break; + } + case 3: //homing fireballs + { + Vector2 vector2 = new Vector2((float)((targetData.Center.X > npc.Center.X) ? 1 : -1), 0f); + npc.spriteDirection = ((vector2.X > 0f) ? 1 : -1); + npc.velocity = vector2 * -2f; + break; + } + case 5: //spin move + { + Vector2 vector3 = npc.DirectionTo(targetData.Center); + npc.spriteDirection = ((vector3.X > 0f) ? 1 : -1); + npc.rotation = vector3.ToRotation(); + if (npc.spriteDirection == -1) + { + npc.rotation += 3.14159274f; + } + npc.velocity = vector3 * scaleFactor5; + break; + } + } + } + } + else if (npc.ai[0] == 2f) + { + if (npc.ai[1] == 0f) + { + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoarShort"), (int)npc.position.X, (int)npc.position.Y); + } + float[] expr_498_cp_0 = npc.ai; + int expr_498_cp_1 = 1; + num26 = expr_498_cp_0[expr_498_cp_1] + 1f; + expr_498_cp_0[expr_498_cp_1] = num26; + if (num26 >= num8) + { + npc.ai[0] = 1f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + } + } + else if (npc.ai[0] == 3f) //homing fireball spit + { + npc.ai[1] += 1f; + int num29 = (npc.Center.X < targetData.Center.X) ? 1 : -1; + npc.ai[2] = (float)num29; + if (npc.ai[1] < num11) + { + Vector2 vector4 = targetData.Center + new Vector2((float)num29 * -num9, -250f); + Vector2 value = npc.DirectionTo(vector4) * num10; + if (npc.Distance(vector4) < num10) + { + npc.Center = vector4; + } + else + { + npc.position += value; + } + if (Vector2.Distance(vector4, npc.Center) < 16f) + { + npc.ai[1] = num11 - 1f; + } + num2 = 1.5f; + } + if (npc.ai[1] == num11) + { + int num30 = (targetData.Center.X > npc.Center.X) ? 1 : -1; + npc.velocity = new Vector2((float)num30, 0f) * 22f; //10f + npc.direction = (npc.spriteDirection = num30); + } + if (npc.ai[1] >= num11) + { + if (npc.ai[1] % 10 == 0 && Main.netMode != 1) + { + float num33 = 30f; + Vector2 position = npc.Center + new Vector2((110f /* 110f */ + num33) * (float)npc.direction, -20f /* 20f */).RotatedBy((double)npc.rotation, + default(Vector2)); + Projectile.NewProjectile(position, npc.velocity, mod.ProjectileType("YharonFireballHoming"), num4, 0f, Main.myPlayer, 0f, 0f); + } + num2 = 1.5f; + if (Math.Abs(targetData.Center.X - npc.Center.X) > 550f && Math.Abs(npc.velocity.X) < 20f) + { + npc.velocity.X = npc.velocity.X + (float)Math.Sign(npc.velocity.X) * 0.5f; + } + } + if (npc.ai[1] >= num13) + { + npc.ai[0] = 1f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + } + } + else if (npc.ai[0] == 4f) //splitting fireball spit + { + int num31 = (npc.Center.X < targetData.Center.X) ? 1 : -1; + npc.ai[2] = (float)num31; + if (npc.ai[1] < num15) + { + Vector2 vector5 = targetData.Center + new Vector2((float)num31 * -num14, -350f); + Vector2 value2 = npc.DirectionTo(vector5) * scaleFactor3; + npc.velocity = Vector2.Lerp(npc.velocity, value2, amount); + int num32 = (npc.Center.X < targetData.Center.X) ? 1 : -1; + npc.direction = (npc.spriteDirection = num32); + if (Vector2.Distance(vector5, npc.Center) < 16f) + { + npc.ai[1] = num15 - 1f; + } + num2 = 1.5f; + } + else if (npc.ai[1] == num15) + { + Vector2 vector6 = npc.DirectionTo(targetData.Center); + vector6.Y *= 0.25f; + vector6 = vector6.SafeNormalize(Vector2.UnitX * (float)npc.direction); + npc.spriteDirection = ((vector6.X > 0f) ? 1 : -1); + npc.rotation = vector6.ToRotation(); + if (npc.spriteDirection == -1) + { + npc.rotation += 3.14159274f; + } + npc.velocity = vector6 * scaleFactor4; + } else { - position9.Y = Main.player[Main.myPlayer].Center.Y - num215; + npc.position.X = npc.position.X + npc.DirectionTo(targetData.Center).X * 7f; + npc.position.Y = npc.position.Y + npc.DirectionTo(targetData.Center + new Vector2(0f, -400f)).Y * 6f; + if (npc.ai[1] <= num19 - num18) + { + num2 = 1.5f; + } + float num33 = 30f; + Vector2 position = npc.Center + new Vector2((110f /* 110f */ + num33) * (float)npc.direction, -20f).RotatedBy((double)npc.rotation, + default(Vector2)); + int num34 = (int)(npc.ai[1] - num15 + 1f); + if (num34 <= num17 && num34 % num16 == 0 && Main.netMode != 1) + { + Projectile.NewProjectile(position, npc.velocity, mod.ProjectileType("YharonFireball"), num4, 0f, Main.myPlayer, 0f, 0f); //change + } + } + if (npc.ai[1] > num19 - num18) + { + npc.velocity.Y = npc.velocity.Y - 0.1f; + } + npc.ai[1] += 1f; + if (npc.ai[1] >= num19) + { + npc.ai[0] = 1f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; } - position9.Y -= (float)(npc.height / 2); - Main.spriteBatch.Draw(Main.npcTexture[npc.type], new Vector2(position9.X - Main.screenPosition.X + (float)(npc.width / 2) - (float)Main.npcTexture[npc.type].Width * npc.scale / 2f + vector11.X * npc.scale, position9.Y - Main.screenPosition.Y + (float)npc.height - (float)Main.npcTexture[npc.type].Height * npc.scale / (float)Main.npcFrameCount[npc.type] + 4f + vector11.Y * npc.scale + num66 + npc.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(frame6), alpha15, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } - Main.spriteBatch.Draw(Main.npcTexture[npc.type], new Vector2(npc.position.X - Main.screenPosition.X + (float)(npc.width / 2) - (float)Main.npcTexture[npc.type].Width * npc.scale / 2f + vector11.X * npc.scale, npc.position.Y - Main.screenPosition.Y + (float)npc.height - (float)Main.npcTexture[npc.type].Height * npc.scale / (float)Main.npcFrameCount[npc.type] + 4f + vector11.Y * npc.scale + num66 + npc.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(frame6), npc.GetAlpha(color9), npc.rotation, vector11, npc.scale, spriteEffects, 0f); + else if (npc.ai[0] == 5f) + { + npc.velocity = npc.velocity.RotatedBy((double)(-(double)num22 * (float)npc.direction), default(Vector2)); + npc.position.Y = npc.position.Y - num23; + npc.position += npc.DirectionTo(targetData.Center) * 10f; + npc.rotation -= num22 * (float)npc.direction; + num2 *= 0.7f; + if (npc.ai[1] == 1f) + { + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoarShort"), (int)npc.position.X, (int)npc.position.Y); + } + float[] expr_B0F_cp_0 = npc.ai; + int expr_B0F_cp_1 = 1; + num26 = expr_B0F_cp_0[expr_B0F_cp_1] + 1f; + expr_B0F_cp_0[expr_B0F_cp_1] = num26; + if (npc.ai[1] % 12 == 0 && Main.netMode != 1) + { + float num33 = 30f; + Vector2 position = npc.Center + new Vector2((110f /* 110f */ + num33) * (float)npc.direction, -20f /* 20f */).RotatedBy((double)npc.rotation, + default(Vector2)); + int projectileType = (((npc.ai[1] / 2) % 12 == 0) ? mod.ProjectileType("YharonFireball") : mod.ProjectileType("YharonFireballHoming")); + Projectile.NewProjectile(position, npc.velocity, projectileType, num4, 0f, Main.myPlayer, 0f, 0f); + } + if (num26 >= num20) + { + npc.ai[0] = 1f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.velocity /= 2f; + } + } + else if (npc.ai[0] == 6f) //birb spawn + { + if (npc.ai[1] == 0f) + { + Vector2 destination2 = targetData.Center + new Vector2(0f, -200f); + Vector2 desiredVelocity2 = npc.DirectionTo(destination2) * scaleFactor * 2f; + npc.SimpleFlyMovement(desiredVelocity2, num6 * 2f); + int num35 = (npc.Center.X < targetData.Center.X) ? 1 : -1; + npc.direction = (npc.spriteDirection = num35); + npc.ai[2] += 1f; + if (npc.Distance(targetData.Center) < 1000f || npc.ai[2] >= 180f) //450f + { + npc.ai[1] = 1f; + npc.netUpdate = true; + } + } + else + { + if (npc.ai[1] == 1f) + { + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoar"), (int)npc.position.X, (int)npc.position.Y); + } + if (npc.ai[1] < num25) + { + npc.velocity *= 0.95f; + } + else + { + npc.velocity *= 0.98f; + } + if (npc.ai[1] == num25) + { + if (npc.velocity.Y > 0f) + { + npc.velocity.Y = npc.velocity.Y / 3f; + } + npc.velocity.Y = npc.velocity.Y - 3f; + } + num2 *= 0.85f; + bool flag3 = npc.ai[1] == 20f || npc.ai[1] == 45f || npc.ai[1] == 70f; + if (NPC.CountNPCS(mod.NPCType("Bumblefuck3")) > 2) + { + flag3 = false; + } + if (flag3 && Main.netMode != 1) + { + Vector2 vector7 = npc.Center + (6.28318548f * Main.rand.NextFloat()).ToRotationVector2() * new Vector2(2f, 1f) * 100f * (0.6f + Main.rand.NextFloat() * 0.4f); + if (Vector2.Distance(vector7, targetData.Center) > 100f) + { + Point point2 = vector7.ToPoint(); + NPC.NewNPC(point2.X, point2.Y, mod.NPCType("Bumblefuck3"), npc.whoAmI, 0f, 0f, 0f, 0f, 255); + } + NPC.NewNPC((int)npc.Center.X + (Main.rand.Next(2) == 0 ? 100 : -100), (int)npc.Center.Y - 100, mod.NPCType("Bumblefuck3"), 0, 0f, 0f, 0f, 0f, 255); + } + npc.ai[1] += 1f; + } + if (npc.ai[1] >= num24) + { + Projectile.NewProjectile(npc.Center.X, npc.Center.Y, 0f, 0f, mod.ProjectileType("BigFlare"), 0, 0f, Main.myPlayer, 1f, (float)(npc.target + 1)); + Boom(600, num4); + npc.ai[0] = 1f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + } + } + npc.localAI[0] += num2; + if (npc.localAI[0] >= 36f) + { + npc.localAI[0] = 0f; + } + if (num != -1) + { + npc.localAI[0] = (float)(num * 4); + } + float[] expr_11FC_cp_0 = npc.localAI; + int expr_11FC_cp_1 = 1; + num26 = expr_11FC_cp_0[expr_11FC_cp_1] + 1f; + expr_11FC_cp_0[expr_11FC_cp_1] = num26; + if (num26 >= 60f) + { + npc.localAI[1] = 0f; + } + float num42 = npc.DirectionTo(targetData.Center).ToRotation(); + float num43 = 0.04f; + switch ((int)npc.ai[0]) + { + case 2: + case 5: + num43 = 0f; + break; + case 3: + num43 = 0.01f; + num42 = 0f; + if (npc.spriteDirection == -1) + { + num42 -= 3.14159274f; + } + if (npc.ai[1] >= num11) + { + num42 += (float)npc.spriteDirection * 3.14159274f / 12f; + num43 = 0.05f; + } + break; + case 4: + num43 = 0.01f; + num42 = 3.14159274f; + if (npc.spriteDirection == 1) + { + num42 += 3.14159274f; + } + break; + case 6: + num43 = 0.02f; + num42 = 0f; + if (npc.spriteDirection == -1) + { + num42 -= 3.14159274f; + } + break; + } + if (npc.spriteDirection == -1) + { + num42 += 3.14159274f; + } + if (num43 != 0f) + { + npc.rotation = npc.rotation.AngleTowards(num42, num43); + } + } + #endregion + + #region Drawing + public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) + { + SpriteEffects spriteEffects = SpriteEffects.None; + if (npc.spriteDirection == 1) + { + spriteEffects = SpriteEffects.FlipHorizontally; + } + Texture2D texture = Main.npcTexture[npc.type]; + Microsoft.Xna.Framework.Rectangle frame6 = npc.frame; + Microsoft.Xna.Framework.Color color9 = Lighting.GetColor((int)((double)npc.position.X + (double)npc.width * 0.5) / 16, (int)(((double)npc.position.Y + (double)npc.height * 0.5) / 16.0)); + int num156 = texture.Height / Main.npcFrameCount[npc.type]; + int y3 = num156 * (int)npc.frameCounter; + Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle(0, y3, texture.Width, num156); + Vector2 origin2 = rectangle.Size() / 2f; + int num157 = 8; + int num158 = 2; + int num159 = 1; + float num160 = 0f; + int num161 = num159; + if (npc.localAI[2] == 1f && !phaseOneLoot) + { + bool drawAfterImage2 = (npc.ai[0] == 2f || npc.ai[0] == 3f || npc.ai[0] == 4f || npc.ai[0] == 5f) && Lighting.NotRetro; + SpriteEffects spriteEffects2 = spriteEffects ^ SpriteEffects.FlipHorizontally; + if (npc.localAI[3] < 900f) + { + color9 = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB, 0); + } + Microsoft.Xna.Framework.Color alpha16 = npc.GetAlpha(color9); + while (drawAfterImage2 && ((num158 > 0 && num161 < num157) || (num158 < 0 && num161 > num157))) + { + goto IL_6899; + IL_6881: + num161 += num158; + continue; + IL_6899: + float num164 = (float)(num157 - num161); + if (num158 < 0) + { + num164 = (float)(num159 - num161); + } + alpha16 *= num164 / ((float)NPCID.Sets.TrailCacheLength[npc.type] * 1.5f); //1.5 + Vector2 value4 = (npc.oldPos[num161]); + float num165 = npc.rotation; + Main.spriteBatch.Draw(texture, value4 + npc.Size / 2f - Main.screenPosition + new Vector2(0, npc.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(frame6), alpha16, num165 + npc.rotation * num160 * (float)(num161 - 1) * -(float)spriteEffects2.HasFlag(SpriteEffects.FlipHorizontally).ToDirectionInt(), origin2, npc.scale, spriteEffects2, 0f); + goto IL_6881; + } + Main.spriteBatch.Draw(texture, npc.Center - Main.screenPosition + new Vector2(0, npc.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(frame6), npc.GetAlpha(color9), npc.rotation, npc.frame.Size() / 2, npc.scale, spriteEffects2, 0); + return false; + } + Microsoft.Xna.Framework.Color alpha15 = npc.GetAlpha(color9); + bool drawAfterImage = (npc.ai[0] == 1f || npc.ai[0] == 5f || npc.ai[0] == 7f || npc.ai[0] == 8f || npc.ai[0] == 11f || npc.ai[0] == 12f || + npc.ai[0] == 14f || npc.ai[0] == 15f || npc.ai[0] == 18f || npc.ai[0] == 19f || npc.ai[0] == 22f) && Lighting.NotRetro; + while (drawAfterImage && ((num158 > 0 && num161 < num157) || (num158 < 0 && num161 > num157))) + { + goto IL_6899; + IL_6881: + num161 += num158; + continue; + IL_6899: + float num164 = (float)(num157 - num161); + if (num158 < 0) + { + num164 = (float)(num159 - num161); + } + alpha15 *= num164 / ((float)NPCID.Sets.TrailCacheLength[npc.type] * 1.5f); //1.5 + Vector2 value4 = (npc.oldPos[num161]); + float num165 = npc.rotation; + Main.spriteBatch.Draw(texture, value4 + npc.Size / 2f - Main.screenPosition + new Vector2(0, npc.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(frame6), alpha15, num165 + npc.rotation * num160 * (float)(num161 - 1) * -(float)spriteEffects.HasFlag(SpriteEffects.FlipHorizontally).ToDirectionInt(), origin2, npc.scale, spriteEffects, 0f); + goto IL_6881; + } + Main.spriteBatch.Draw(texture, npc.Center - Main.screenPosition + new Vector2(0, npc.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(frame6), npc.GetAlpha(color9), npc.rotation, npc.frame.Size() / 2, npc.scale, spriteEffects, 0); return false; } - #endregion + #endregion - #region Loot - public override void NPCLoot() + #region Loot + public override void NPCLoot() { - if (!dropLoot) - { - return; - } - if (npc.localAI[2] == 1f) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BossRush")); - } - if (Main.rand.Next(10) == 0 && npc.localAI[2] == 1f) + if (!dropLoot) + { + return; + } + if (npc.localAI[2] == 1f) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BossRush")); + } + if (Main.rand.Next(10) == 0 && npc.localAI[2] == 1f) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("YharonTrophy")); } - if (CalamityWorld.armageddon) - { - for (int i = 0; i < 10; i++) - { - npc.DropBossBags(); - } - } - if (Main.expertMode) + if (CalamityWorld.armageddon) { - if (npc.localAI[2] == 1f) - { - npc.DropItemInstanced(npc.position, npc.Size, mod.ItemType("HellcasterFragment"), Main.rand.Next(22, 29), true); - } + for (int i = 0; i < 5; i++) + { + npc.DropBossBags(); + } + } + if (Main.expertMode) + { + if (npc.localAI[2] == 1f) + { + npc.DropItemInstanced(npc.position, npc.Size, mod.ItemType("HellcasterFragment"), Main.rand.Next(22, 29), true); + } npc.DropBossBags(); } else { - if (npc.localAI[2] == 1f) - { - npc.DropItemInstanced(npc.position, npc.Size, mod.ItemType("HellcasterFragment"), Main.rand.Next(15, 23), true); - } - if (Main.rand.Next(7) == 0) + if (npc.localAI[2] == 1f) + { + npc.DropItemInstanced(npc.position, npc.Size, mod.ItemType("HellcasterFragment"), Main.rand.Next(15, 23), true); + } + if (Main.rand.Next(7) == 0) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("YharonMask")); } @@ -2602,40 +2613,40 @@ namespace CalamityMod.NPCs.Yharon } } } - #endregion - public override void BossLoot(ref string name, ref int potionType) + public override void BossLoot(ref string name, ref int potionType) { potionType = mod.ItemType("SupremeHealingPotion"); } + #endregion - #region DamageFormula - public override bool StrikeNPC(ref double damage, int defense, ref float knockback, int hitDirection, ref bool crit) + #region DamageFormula + public override bool StrikeNPC(ref double damage, int defense, ref float knockback, int hitDirection, ref bool crit) { - if (damage > npc.lifeMax / 10) - { - damage = 0; - return false; - } - double newDamage = (damage + (int)((double)defense * 0.25)); - if (newDamage < 1.0) + if (damage > npc.lifeMax / 10) + { + damage = 0; + return false; + } + double newDamage = (damage + (int)((double)defense * 0.25)); + if (newDamage < 1.0) { newDamage = 1.0; } if (newDamage >= 1.0) { - if (npc.localAI[2] == 1f) - { - float protection = (((npc.ichor || npc.onFire2) ? 0.17f : 0.22f) + - (protectionBoost ? 0.68f : 0f)); //0.85 or 0.9 - newDamage = (double)((int)((double)(1f - protection) * newDamage)); - } - else - { - float protection = (((npc.ichor || npc.onFire2) ? 0.12f : 0.17f) + - (protectionBoost ? 0.73f : 0f)); //0.85 or 0.9 - newDamage = (double)((int)((double)(1f - protection) * newDamage)); - } + if (npc.localAI[2] == 1f) + { + float protection = (((npc.ichor || npc.onFire2) ? 0.17f : 0.22f) + + (protectionBoost ? 0.68f : 0f)); //0.85 or 0.9 + newDamage = (double)((int)((double)(1f - protection) * newDamage)); + } + else + { + float protection = (((npc.ichor || npc.onFire2) ? 0.12f : 0.17f) + + (protectionBoost ? 0.73f : 0f)); //0.85 or 0.9 + newDamage = (double)((int)((double)(1f - protection) * newDamage)); + } if (newDamage < 1.0) { newDamage = 1.0; @@ -2644,25 +2655,33 @@ namespace CalamityMod.NPCs.Yharon damage = newDamage; return true; } - #endregion + #endregion - public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) + #region HPBarCooldownSlotandStats + public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) { scale = 2f; return null; } - + public override bool CanHitPlayer(Player target, ref int cooldownSlot) { cooldownSlot = 1; return true; } - #region FindFrame - public override void FindFrame(int frameHeight) + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - if ((npc.localAI[2] != 1f && (npc.ai[0] == 0f || npc.ai[0] == 6f || npc.ai[0] == 13f || npc.ai[0] == 21f)) || - (npc.localAI[2] == 1f && (npc.ai[0] == 5f || npc.ai[0] < 3f))) //idle + npc.lifeMax = (int)(npc.lifeMax * 0.8f * bossLifeScale); + npc.damage = (int)(npc.damage * 0.8f); + } + #endregion + + #region FindFrame + public override void FindFrame(int frameHeight) + { + if ((npc.localAI[2] != 1f && (npc.ai[0] == 0f || npc.ai[0] == 6f || npc.ai[0] == 13f || npc.ai[0] == 21f)) || + (npc.localAI[2] == 1f && (npc.ai[0] == 5f || npc.ai[0] < 3f))) //idle { int num84 = 4; //5 if (npc.localAI[2] != 1f && (npc.ai[0] == 6f || npc.ai[0] == 13f || npc.ai[0] == 21f)) //Phase ai switch @@ -2680,13 +2699,13 @@ namespace CalamityMod.NPCs.Yharon npc.frame.Y = 0; } } - if ((npc.localAI[2] != 1f && (npc.ai[0] == 1f || npc.ai[0] == 5f || npc.ai[0] == 7f || npc.ai[0] == 11f || - npc.ai[0] == 14f || npc.ai[0] == 18f || npc.ai[0] == 22f)) || (npc.localAI[2] == 1f && (npc.ai[0] == 6f))) //Charging or birb spawn + if ((npc.localAI[2] != 1f && (npc.ai[0] == 1f || npc.ai[0] == 5f || npc.ai[0] == 7f || npc.ai[0] == 11f || + npc.ai[0] == 14f || npc.ai[0] == 18f || npc.ai[0] == 22f)) || (npc.localAI[2] == 1f && (npc.ai[0] == 6f))) //Charging or birb spawn { npc.frame.Y = frameHeight * 5; //6 } - if ((npc.localAI[2] != 1f && (npc.ai[0] == 2f || npc.ai[0] == 8f || npc.ai[0] == 12f || npc.ai[0] == 15f || npc.ai[0] == 19f || npc.ai[0] == 23f)) || - (npc.localAI[2] == 1f && (npc.ai[0] == 4f || npc.ai[0] == 3f))) //Fireball spit or circle or flamethrower + if ((npc.localAI[2] != 1f && (npc.ai[0] == 2f || npc.ai[0] == 8f || npc.ai[0] == 12f || npc.ai[0] == 15f || npc.ai[0] == 19f || npc.ai[0] == 23f)) || + (npc.localAI[2] == 1f && (npc.ai[0] == 4f || npc.ai[0] == 3f))) //Fireball spit or circle or flamethrower { npc.frame.Y = frameHeight * 5; //6 } @@ -2741,37 +2760,33 @@ namespace CalamityMod.NPCs.Yharon } } } - #endregion + #endregion - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + #region Boom + public void Boom(int timeLeft, int damage) { - npc.lifeMax = (int)(npc.lifeMax * 0.8f * bossLifeScale); - npc.damage = (int)(npc.damage * 0.8f); + if (Main.netMode != 1) + { + Vector2 valueBoom = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float spreadBoom = 15f * 0.0174f; + double startAngleBoom = Math.Atan2(npc.velocity.X, npc.velocity.Y) - spreadBoom / 2; + double deltaAngleBoom = spreadBoom / 8f; + double offsetAngleBoom; + int iBoom; + for (iBoom = 0; iBoom < 25; iBoom++) + { + offsetAngleBoom = (startAngleBoom + deltaAngleBoom * (iBoom + iBoom * iBoom) / 2f) + 32f * iBoom; + int boom1 = Projectile.NewProjectile(valueBoom.X, valueBoom.Y, (float)(Math.Sin(offsetAngleBoom) * 5f), (float)(Math.Cos(offsetAngleBoom) * 5f), mod.ProjectileType("FlareBomb"), damage, 0f, Main.myPlayer, 0f, 0f); + int boom2 = Projectile.NewProjectile(valueBoom.X, valueBoom.Y, (float)(-Math.Sin(offsetAngleBoom) * 5f), (float)(-Math.Cos(offsetAngleBoom) * 5f), mod.ProjectileType("FlareBomb"), damage, 0f, Main.myPlayer, 0f, 0f); + Main.projectile[boom1].timeLeft = timeLeft; + Main.projectile[boom2].timeLeft = timeLeft; + } + } } + #endregion - public void Boom(int timeLeft, int damage) - { - if (Main.netMode != 1) - { - Vector2 valueBoom = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float spreadBoom = 15f * 0.0174f; - double startAngleBoom = Math.Atan2(npc.velocity.X, npc.velocity.Y) - spreadBoom / 2; - double deltaAngleBoom = spreadBoom / 8f; - double offsetAngleBoom; - int iBoom; - for (iBoom = 0; iBoom < 25; iBoom++) - { - offsetAngleBoom = (startAngleBoom + deltaAngleBoom * (iBoom + iBoom * iBoom) / 2f) + 32f * iBoom; - int boom1 = Projectile.NewProjectile(valueBoom.X, valueBoom.Y, (float)(Math.Sin(offsetAngleBoom) * 5f), (float)(Math.Cos(offsetAngleBoom) * 5f), mod.ProjectileType("FlareBomb"), damage, 0f, Main.myPlayer, 0f, 0f); - int boom2 = Projectile.NewProjectile(valueBoom.X, valueBoom.Y, (float)(-Math.Sin(offsetAngleBoom) * 5f), (float)(-Math.Cos(offsetAngleBoom) * 5f), mod.ProjectileType("FlareBomb"), damage, 0f, Main.myPlayer, 0f, 0f); - Main.projectile[boom1].timeLeft = timeLeft; - Main.projectile[boom2].timeLeft = timeLeft; - } - } - } - - #region HitEffect - public override void HitEffect(int hitDirection, double damage) + #region HitEffect + public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 5; k++) { @@ -2779,7 +2794,7 @@ namespace CalamityMod.NPCs.Yharon } if (npc.life <= 0) { - Boom(150, 1000); + Boom(150, 1000); npc.position.X = npc.position.X + (float)(npc.width / 2); npc.position.Y = npc.position.Y + (float)(npc.height / 2); npc.width = 300; @@ -2806,6 +2821,6 @@ namespace CalamityMod.NPCs.Yharon } } } - #endregion - } + #endregion + } } \ No newline at end of file diff --git a/Projectiles/Amidias/AmidiasTridentProj.cs b/Projectiles/Amidias/AmidiasTridentProj.cs new file mode 100644 index 0000000000..ec62d2fa43 --- /dev/null +++ b/Projectiles/Amidias/AmidiasTridentProj.cs @@ -0,0 +1,72 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Amidias +{ + public class AmidiasTridentProj : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Trident"); + } + + public override void SetDefaults() + { + projectile.width = 70; + projectile.aiStyle = 19; + projectile.melee = true; + projectile.timeLeft = 90; + projectile.height = 70; + projectile.friendly = true; + projectile.hostile = false; + projectile.tileCollide = false; + projectile.ignoreWater = true; + projectile.penetrate = -1; + projectile.ownerHitCheck = true; + projectile.hide = true; + } + + public override void AI() + { + Main.player[projectile.owner].direction = projectile.direction; + Main.player[projectile.owner].heldProj = projectile.whoAmI; + Main.player[projectile.owner].itemTime = Main.player[projectile.owner].itemAnimation; + projectile.position.X = Main.player[projectile.owner].position.X + (float)(Main.player[projectile.owner].width / 2) - (float)(projectile.width / 2); + projectile.position.Y = Main.player[projectile.owner].position.Y + (float)(Main.player[projectile.owner].height / 2) - (float)(projectile.height / 2); + projectile.position += projectile.velocity * projectile.ai[0]; + if (projectile.ai[0] == 0f) + { + projectile.ai[0] = 3f; + projectile.netUpdate = true; + } + if (Main.player[projectile.owner].itemAnimation < Main.player[projectile.owner].itemAnimationMax / 3) + { + projectile.ai[0] -= 1f; + if (projectile.localAI[0] == 0f && Main.myPlayer == projectile.owner && NPC.downedBoss3) + { + projectile.localAI[0] = 1f; + Projectile.NewProjectile(projectile.Center.X + projectile.velocity.X * projectile.ai[0], projectile.Center.Y + projectile.velocity.Y * projectile.ai[0], projectile.velocity.X * 0.8f, projectile.velocity.Y * 0.8f, mod.ProjectileType("AmidiasWhirlpool"), projectile.damage, projectile.knockBack * 0.85f, projectile.owner, 0f, 0f); + } + } + else + { + projectile.ai[0] += 0.75f; + } + + if (Main.player[projectile.owner].itemAnimation == 0) + { + projectile.Kill(); + } + + projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 2.355f; + if (projectile.spriteDirection == -1) + { + projectile.rotation -= 1.57f; + } + } + } +} \ No newline at end of file diff --git a/Projectiles/Amidias/AmidiasTridentProj.png b/Projectiles/Amidias/AmidiasTridentProj.png new file mode 100644 index 0000000000..eed265f536 Binary files /dev/null and b/Projectiles/Amidias/AmidiasTridentProj.png differ diff --git a/Projectiles/Amidias/AmidiasWhirlpool.cs b/Projectiles/Amidias/AmidiasWhirlpool.cs new file mode 100644 index 0000000000..c4fea0f760 --- /dev/null +++ b/Projectiles/Amidias/AmidiasWhirlpool.cs @@ -0,0 +1,166 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Amidias +{ + public class AmidiasWhirlpool : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Whirlpool"); + } + + public override void SetDefaults() + { + projectile.width = 32; + projectile.height = 32; + projectile.friendly = true; + projectile.penetrate = 3; + projectile.extraUpdates = 1; + projectile.alpha = 100; + projectile.tileCollide = false; + projectile.ignoreWater = true; + projectile.melee = true; + } + + public override void AI() + { + for (int num105 = 0; num105 < 2; num105++) + { + float num99 = projectile.velocity.X / 3f * (float)num105; + float num100 = projectile.velocity.Y / 3f * (float)num105; + int num101 = 4; + int num102 = Dust.NewDust(new Vector2(projectile.position.X + (float)num101, projectile.position.Y + (float)num101), projectile.width - num101 * 2, projectile.height - num101 * 2, 33, 0f, 0f, 0, new Color(0, 142, 255), 1.5f); + Main.dust[num102].noGravity = true; + Main.dust[num102].velocity *= 0.1f; + Main.dust[num102].velocity += projectile.velocity * 0.1f; + Dust expr_47FA_cp_0 = Main.dust[num102]; + expr_47FA_cp_0.position.X = expr_47FA_cp_0.position.X - num99; + Dust expr_4815_cp_0 = Main.dust[num102]; + expr_4815_cp_0.position.Y = expr_4815_cp_0.position.Y - num100; + } + float[] var_2_2DDF8_cp_0 = projectile.ai; + int var_2_2DDF8_cp_1 = 0; + float num73 = var_2_2DDF8_cp_0[var_2_2DDF8_cp_1]; + var_2_2DDF8_cp_0[var_2_2DDF8_cp_1] = num73 + 1f; + int num1013 = 0; + if (projectile.velocity.Length() <= 8f) //4 + { + num1013 = 1; + } + if (num1013 == 0) + { + projectile.rotation -= 0.104719758f; + + if (projectile.ai[0] >= 30f) + { + projectile.velocity *= 0.98f; + projectile.rotation -= 0.0174532924f; + } + if (projectile.velocity.Length() < 8.2f) //4.1 + { + projectile.velocity.Normalize(); + projectile.velocity *= 4f; + projectile.ai[0] = 0f; + } + } + else if (num1013 == 1) + { + int num3; + projectile.rotation -= 0.104719758f; + Vector2 vector145 = projectile.Center; + float num1015 = 300f; + bool flag59 = false; + int num1016 = 0; + if (projectile.ai[1] == 0f) + { + for (int num1017 = 0; num1017 < 200; num1017 = num3 + 1) + { + if (Main.npc[num1017].CanBeChasedBy(projectile, false)) + { + Vector2 center13 = Main.npc[num1017].Center; + if (projectile.Distance(center13) < num1015 && Collision.CanHit(new Vector2(projectile.position.X + (float)(projectile.width / 2), projectile.position.Y + (float)(projectile.height / 2)), 1, 1, Main.npc[num1017].position, Main.npc[num1017].width, Main.npc[num1017].height)) + { + num1015 = projectile.Distance(center13); + vector145 = center13; + flag59 = true; + num1016 = num1017; + } + } + num3 = num1017; + } + if (flag59) + { + if (projectile.ai[1] != (float)(num1016 + 1)) + { + projectile.netUpdate = true; + } + projectile.ai[1] = (float)(num1016 + 1); + } + flag59 = false; + } + if (projectile.ai[1] != 0f) + { + int num1018 = (int)(projectile.ai[1] - 1f); + if (Main.npc[num1018].active && Main.npc[num1018].CanBeChasedBy(projectile, true) && projectile.Distance(Main.npc[num1018].Center) < 1000f) + { + flag59 = true; + vector145 = Main.npc[num1018].Center; + } + } + if (!projectile.friendly) + { + flag59 = false; + } + if (flag59) + { + float num1019 = 24f; + int num1020 = 10; + Vector2 vector146 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + float num1021 = vector145.X - vector146.X; + float num1022 = vector145.Y - vector146.Y; + float num1023 = (float)Math.Sqrt((double)(num1021 * num1021 + num1022 * num1022)); + num1023 = num1019 / num1023; + num1021 *= num1023; + num1022 *= num1023; + projectile.velocity.X = (projectile.velocity.X * (float)(num1020 - 1) + num1021) / (float)num1020; + projectile.velocity.Y = (projectile.velocity.Y * (float)(num1020 - 1) + num1022) / (float)num1020; + } + } + Lighting.AddLight(projectile.Center, 0f, 0.1f, 0.9f); + if (projectile.ai[0] >= 120f) + { + projectile.Kill(); + return; + } + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D texture2D13 = Main.projectileTexture[projectile.type]; + int num214 = Main.projectileTexture[projectile.type].Height / Main.projFrames[projectile.type]; + int y6 = num214 * projectile.frame; + Main.spriteBatch.Draw(texture2D13, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y6, texture2D13.Width, num214)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)num214 / 2f), projectile.scale, SpriteEffects.None, 0f); + return false; + } + + public override Color? GetAlpha(Color lightColor) + { + return new Color(30, 255, 253); + } + + public override void Kill(int timeLeft) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 10); + for (int k = 0; k < 20; k++) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 33, projectile.oldVelocity.X, projectile.oldVelocity.Y, 0, new Color(0, 142, 255), 1f); + } + } + } +} \ No newline at end of file diff --git a/Projectiles/Amidias/AmidiasWhirlpool.png b/Projectiles/Amidias/AmidiasWhirlpool.png new file mode 100644 index 0000000000..27623e2df6 Binary files /dev/null and b/Projectiles/Amidias/AmidiasWhirlpool.png differ diff --git a/Projectiles/Amidias/BigCoral.cs b/Projectiles/Amidias/BigCoral.cs new file mode 100644 index 0000000000..6434801961 --- /dev/null +++ b/Projectiles/Amidias/BigCoral.cs @@ -0,0 +1,59 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Amidias +{ + public class BigCoral : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Big Coral"); + } + + public override void SetDefaults() + { + projectile.width = 18; + projectile.height = 34; + projectile.friendly = true; + projectile.ranged = true; + projectile.penetrate = 1; + projectile.aiStyle = 1; + } + + public override void AI() + { + projectile.velocity.X *= 0.999f; + projectile.velocity.Y = projectile.velocity.Y + 0.025f; + } + + public override void Kill(int timeLeft) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 10); + projectile.position.X = projectile.position.X + (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); + projectile.width = 18; + projectile.height = 34; + projectile.position.X = projectile.position.X - (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + for (int num621 = 0; num621 < 10; num621++) + { + int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 51, projectile.oldVelocity.X / 4, projectile.oldVelocity.Y / 4, 0, new Color(234, 183, 100), 1.5f); + Main.dust[num195].noGravity = true; + Main.dust[num195].velocity *= 3f; + } + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + if (target.rarity != 2 && !target.boss) + { + target.AddBuff(mod.BuffType("SilvaStun"), 15); + } + } + } +} \ No newline at end of file diff --git a/Projectiles/Amidias/BigCoral.png b/Projectiles/Amidias/BigCoral.png new file mode 100644 index 0000000000..202f90cb58 Binary files /dev/null and b/Projectiles/Amidias/BigCoral.png differ diff --git a/Projectiles/Amidias/HermitCrab.cs b/Projectiles/Amidias/HermitCrab.cs new file mode 100644 index 0000000000..fd196e87aa --- /dev/null +++ b/Projectiles/Amidias/HermitCrab.cs @@ -0,0 +1,362 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Amidias +{ + public class HermitCrab : ModProjectile + { + private int playerStill = 0; + private bool fly = false; + private bool spawnDust = true; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Hermit Crab"); + Main.projFrames[projectile.type] = 8; + ProjectileID.Sets.MinionSacrificable[projectile.type] = true; + ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true; + } + + public override void SetDefaults() + { + projectile.width = 38; + projectile.height = 36; + projectile.netImportant = true; + projectile.friendly = true; + projectile.minionSlots = 1; + projectile.timeLeft = 18000; + projectile.penetrate = -1; + projectile.timeLeft *= 5; + projectile.minion = true; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 10; + } + + public override bool TileCollideStyle(ref int width, ref int height, ref bool fallThrough) + { + fallThrough = false; + return true; + } + + public override void AI() + { + /*if(projectile.velocity.X > 0.5f) + { + projectile.spriteDirection = 1; + } + else if(projectile.velocity.X < 0.5f) + { + projectile.spriteDirection = -1; + }*/ + if (spawnDust) + { + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue = projectile.damage; + int num501 = 20; + for (int num502 = 0; num502 < num501; num502++) + { + int num503 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 16f), projectile.width, projectile.height - 16, 33, 0f, 0f, 0, default(Color), 1f); + Main.dust[num503].velocity *= 2f; + Main.dust[num503].scale *= 1.15f; + } + spawnDust = false; + } + if (Main.player[projectile.owner].minionDamage != projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) + { + int damage2 = (int)(((float)projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue / + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) * + Main.player[projectile.owner].minionDamage); + projectile.damage = damage2; + } + bool flag64 = projectile.type == mod.ProjectileType("HermitCrab"); + Player player = Main.player[projectile.owner]; + CalamityPlayer modPlayer = player.GetModPlayer(mod); + player.AddBuff(mod.BuffType("HermitCrab"), 3600); + if (flag64) + { + if (player.dead) + { + modPlayer.hCrab = false; + } + if (modPlayer.hCrab) + { + projectile.timeLeft = 2; + } + } + Vector2 vector46 = projectile.position; + if (!fly) + { + Vector2 center2 = projectile.Center; + Vector2 vector48 = player.Center - center2; + float playerDistance = vector48.Length(); + if (projectile.velocity.Y == 0 && (HoleBelow() || (playerDistance > 205f && projectile.position.X == projectile.oldPosition.X))) + { + projectile.velocity.Y = -10f; + } + projectile.velocity.Y += 0.6f; + if (projectile.velocity.X != 0f) + { + projectile.frameCounter++; + } + + if (projectile.frameCounter > 4) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame > 3) + { + projectile.frame = 0; + } + float num633 = 600f; + bool chaseNPC = false; + float npcPositionX = 0f; + for (int num645 = 0; num645 < 200; num645++) + { + NPC npcTarget = Main.npc[num645]; + if (npcTarget.CanBeChasedBy(projectile, false)) + { + float num646 = Vector2.Distance(npcTarget.Center, projectile.Center); + if (((Vector2.Distance(projectile.Center, vector46) > num646 && num646 < num633) || !chaseNPC)) + { + num633 = num646; + vector46 = npcTarget.Center; + npcPositionX = npcTarget.position.X; + chaseNPC = true; + } + } + } + if (chaseNPC) + { + if (npcPositionX - projectile.position.X > 0f) + { + switch (Main.rand.Next(1, 2)) + { + + case 1: + projectile.velocity.X += 0.10f; + break; + + case 2: + projectile.velocity.X += 0.15f; + break; + } + + if (projectile.velocity.X > 6f) + { + projectile.velocity.X = 6f; + } + } + else + { + switch (Main.rand.Next(1, 2)) + { + + case 1: + projectile.velocity.X -= 0.10f; + break; + + case 2: + projectile.velocity.X -= 0.15f; + break; + } + + if (projectile.velocity.X < -6f) + { + projectile.velocity.X = -6f; + } + } + } + else + { + if (playerDistance > 600f) + { + fly = true; + projectile.velocity.X = 0f; + projectile.velocity.Y = 0f; + projectile.tileCollide = false; + } + if (playerDistance > 200f) + { + if (player.position.X - projectile.position.X > 0f) + { + switch (Main.rand.Next(1, 3)) + { + case 1: + projectile.velocity.X += 0.05f; + break; + + case 2: + projectile.velocity.X += 0.10f; + break; + + case 3: + projectile.velocity.X += 0.15f; + break; + } + + if (projectile.velocity.X > 6f) + { + projectile.velocity.X = 6f; + } + } + else + { + switch (Main.rand.Next(1, 3)) + { + case 1: + projectile.velocity.X -= 0.05f; + break; + + case 2: + projectile.velocity.X -= 0.10f; + break; + + case 3: + projectile.velocity.X -= 0.15f; + break; + } + + if (projectile.velocity.X < -6f) + { + projectile.velocity.X = -6f; + } + } + } + if (playerDistance < 200f) + { + if (projectile.velocity.X != 0f) + { + if (projectile.velocity.X > 0.5f) + { + switch (Main.rand.Next(1, 3)) + { + case 1: + projectile.velocity.X -= 0.05f; + break; + + case 2: + projectile.velocity.X -= 0.10f; + break; + + case 3: + projectile.velocity.X -= 0.15f; + break; + } + } + else if (projectile.velocity.X < -0.5f) + { + switch (Main.rand.Next(1, 3)) + { + case 1: + projectile.velocity.X += 0.05f; + break; + + case 2: + projectile.velocity.X += 0.10f; + break; + + case 3: + projectile.velocity.X += 0.15f; + break; + } + } + else if (projectile.velocity.X < 0.5f && projectile.velocity.X > -0.5f) + { + projectile.velocity.X = 0f; + } + } + } + } + } + else if (fly) + { + Vector2 center2 = projectile.Center; + Vector2 vector48 = player.Center - center2 + new Vector2(0f, 0f); + float playerDistance = vector48.Length(); + vector48.Normalize(); + vector48 *= 8f; + projectile.velocity = (projectile.velocity * 40f + vector48) / 41f; + + projectile.rotation = projectile.velocity.X * 0.03f; + projectile.frameCounter++; + if (projectile.frameCounter > 3) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame > 7) + { + projectile.frame = 4; + } + if (playerDistance > 2000f) + { + projectile.position.X = Main.player[projectile.owner].Center.X - (float)(projectile.width / 2); + projectile.position.Y = Main.player[projectile.owner].Center.Y - (float)(projectile.height / 2); + projectile.netUpdate = true; + } + if (playerDistance < 100f) + { + if (player.velocity.Y == 0f) + { + ++playerStill; + } + else + { + playerStill = 0; + } + if (playerStill > 30 && !Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) + { + fly = false; + projectile.tileCollide = true; + projectile.rotation = 0; + } + } + } + if ((double)projectile.velocity.X > 0.25) + { + projectile.spriteDirection = 1; + } + else if ((double)projectile.velocity.X < -0.25) + { + projectile.spriteDirection = -1; + } + } + + private bool HoleBelow() + { + int tileWidth = 4; + int tileX = (int)(projectile.Center.X / 16f) - tileWidth; + if (projectile.velocity.X > 0) + { + tileX += tileWidth; + } + int tileY = (int)((projectile.position.Y + projectile.height) / 16f); + for (int y = tileY; y < tileY + 2; y++) + { + for (int x = tileX; x < tileX + tileWidth; x++) + { + if (Main.tile[x, y].active()) + { + return false; + } + } + } + return true; + } + + public override bool OnTileCollide(Vector2 oldVelocity) + { + if (projectile.penetrate == 0) + { + projectile.Kill(); + } + return false; + } + } +} \ No newline at end of file diff --git a/Projectiles/Amidias/HermitCrab.png b/Projectiles/Amidias/HermitCrab.png new file mode 100644 index 0000000000..cf5677fcc1 Binary files /dev/null and b/Projectiles/Amidias/HermitCrab.png differ diff --git a/Projectiles/Amidias/SandDollarProj.cs b/Projectiles/Amidias/SandDollarProj.cs new file mode 100644 index 0000000000..2b5f0dc6b4 --- /dev/null +++ b/Projectiles/Amidias/SandDollarProj.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Amidias +{ + public class SandDollarProj : ModProjectile + { + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sand Dollar"); + } + + public override void SetDefaults() + { + projectile.width = 30; + projectile.height = 28; + projectile.GetGlobalProjectile(mod).rogue = true; + projectile.friendly = true; + projectile.penetrate = -1; + projectile.aiStyle = 3; + projectile.timeLeft = 300; + aiType = 272; + } + + public override bool OnTileCollide(Vector2 oldVelocity) + { + projectile.ai[0] += 0.1f; + if (projectile.velocity.X != oldVelocity.X) + { + projectile.velocity.X = -oldVelocity.X; + } + if (projectile.velocity.Y != oldVelocity.Y) + { + projectile.velocity.Y = -oldVelocity.Y; + } + return false; + } + } +} \ No newline at end of file diff --git a/Projectiles/Amidias/SandDollarProj.png b/Projectiles/Amidias/SandDollarProj.png new file mode 100644 index 0000000000..69e288ef07 Binary files /dev/null and b/Projectiles/Amidias/SandDollarProj.png differ diff --git a/Projectiles/Amidias/Shell.cs b/Projectiles/Amidias/Shell.cs new file mode 100644 index 0000000000..0f2b663f84 --- /dev/null +++ b/Projectiles/Amidias/Shell.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Amidias +{ + public class Shell : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Shell"); + } + + public override void SetDefaults() + { + projectile.width = 34; + projectile.height = 18; + projectile.friendly = true; + projectile.ranged = true; + projectile.penetrate = 5; + projectile.aiStyle = 1; + } + + public override void AI() + { + projectile.velocity.X *= 0.9995f; + projectile.velocity.Y *= 0.9995f; + } + + public override void Kill(int timeLeft) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 10); + projectile.position.X = projectile.position.X + (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); + projectile.width = 34; + projectile.height = 18; + projectile.position.X = projectile.position.X - (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + for (int num621 = 0; num621 < 10; num621++) + { + int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 14, projectile.oldVelocity.X / 4, projectile.oldVelocity.Y / 4, 0, new Color(0, 255, 255), 1.5f); + Main.dust[num195].noGravity = true; + Main.dust[num195].velocity *= 3f; + } + } + } +} \ No newline at end of file diff --git a/Projectiles/Amidias/Shell.png b/Projectiles/Amidias/Shell.png new file mode 100644 index 0000000000..782116f989 Binary files /dev/null and b/Projectiles/Amidias/Shell.png differ diff --git a/Projectiles/Amidias/SmallCoral.cs b/Projectiles/Amidias/SmallCoral.cs new file mode 100644 index 0000000000..08ef07b262 --- /dev/null +++ b/Projectiles/Amidias/SmallCoral.cs @@ -0,0 +1,51 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Amidias +{ + public class SmallCoral : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Small Coral"); + } + + public override void SetDefaults() + { + projectile.width = 16; + projectile.height = 22; + projectile.friendly = true; + projectile.ranged = true; + projectile.penetrate = 1; + projectile.aiStyle = 1; + } + + public override void AI() + { + projectile.velocity.X *= 0.9995f; + projectile.velocity.Y = projectile.velocity.Y + 0.01f; + } + + public override void Kill(int timeLeft) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 10); + projectile.position.X = projectile.position.X + (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); + projectile.width = 16; + projectile.height = 22; + projectile.position.X = projectile.position.X - (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + for (int num621 = 0; num621 < 5; num621++) + { + int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 51, projectile.oldVelocity.X / 4, projectile.oldVelocity.Y / 4, 0, new Color(234, 183, 100), 1f); + Main.dust[num195].noGravity = true; + Main.dust[num195].velocity *= 2f; + } + } + } +} \ No newline at end of file diff --git a/Projectiles/Amidias/SmallCoral.png b/Projectiles/Amidias/SmallCoral.png new file mode 100644 index 0000000000..bf069d6451 Binary files /dev/null and b/Projectiles/Amidias/SmallCoral.png differ diff --git a/Projectiles/Amidias/SnapClamProj.cs b/Projectiles/Amidias/SnapClamProj.cs new file mode 100644 index 0000000000..4820799c63 --- /dev/null +++ b/Projectiles/Amidias/SnapClamProj.cs @@ -0,0 +1,216 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Amidias +{ + public class SnapClamProj : ModProjectile + { + public int clamCounter = 0; + public bool openClam = true; + public bool onEnemy = false; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Snap Clam"); + Main.projFrames[projectile.type] = 2; + } + + public override void SetDefaults() + { + projectile.width = 20; + projectile.height = 13; + projectile.friendly = true; + projectile.GetGlobalProjectile(mod).rogue = true; + projectile.ignoreWater = true; + projectile.penetrate = -1; + } + + public override void AI() + { + if (openClam && !onEnemy) + { + ++clamCounter; + if (clamCounter >= 30) + { + openClam = false; + projectile.damage = (int)(projectile.damage * 0.8); + } + } + if (projectile.ai[0] == 0f) + { + float[] var0 = projectile.ai; + int var1 = 1; + float num73 = var0[var1]; + var0[var1] = num73 + 1f; + projectile.ai[1] = 45f; + projectile.velocity.X = projectile.velocity.X * 0.99f; + projectile.velocity.Y = projectile.velocity.Y + 0.15f; + projectile.rotation += 0.4f * (float)projectile.direction; + projectile.spriteDirection = projectile.direction; + } + if (projectile.ai[0] == 1f) + { + projectile.tileCollide = false; + int num988 = 6; + bool flag54 = false; + bool flag55 = false; + float[] var0 = projectile.localAI; + int var1 = 0; + float num73 = var0[var1]; + var0[var1] = num73 + 1f; + if (projectile.localAI[0] % 30f == 0f) + { + flag55 = true; + } + int num989 = (int)projectile.ai[1]; + if (projectile.localAI[0] >= (float)(60 * num988)) + { + flag54 = true; + } + else if (num989 < 0 || num989 >= 200) + { + flag54 = true; + } + else if (Main.npc[num989].active && !Main.npc[num989].dontTakeDamage) + { + projectile.Center = Main.npc[num989].Center - projectile.velocity * 2f; + projectile.gfxOffY = Main.npc[num989].gfxOffY; + if (flag55) + { + Main.npc[num989].HitEffect(0, 1.0); + } + } + else + { + flag54 = true; + } + if (flag54) + { + projectile.Kill(); + } + } + if (openClam && !onEnemy) + { + projectile.frame = 1; + } + else + { + projectile.frame = 0; + } + } + + public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) + { + if (openClam) + { + onEnemy = true; + Rectangle myRect = new Rectangle((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height); + if (projectile.owner == Main.myPlayer) + { + for (int i = 0; i < 200; i++) + { + if (((Main.npc[i].active && !Main.npc[i].dontTakeDamage)) && + ((projectile.friendly && (!Main.npc[i].friendly || projectile.type == 318 || (Main.npc[i].type == 22 && projectile.owner < 255 && Main.player[projectile.owner].killGuide) || (Main.npc[i].type == 54 && projectile.owner < 255 && Main.player[projectile.owner].killClothier))) || + (projectile.hostile && Main.npc[i].friendly && !Main.npc[i].dontTakeDamageFromHostiles)) && (projectile.owner < 0 || Main.npc[i].immune[projectile.owner] == 0 || projectile.maxPenetrate == 1)) + { + if (Main.npc[i].noTileCollide || !projectile.ownerHitCheck || projectile.CanHit(Main.npc[i])) + { + bool flag3; + if (Main.npc[i].type == 414) + { + Rectangle rect = Main.npc[i].getRect(); + int num5 = 8; + rect.X -= num5; + rect.Y -= num5; + rect.Width += num5 * 2; + rect.Height += num5 * 2; + flag3 = projectile.Colliding(myRect, rect); + } + else + { + flag3 = projectile.Colliding(myRect, Main.npc[i].getRect()); + } + if (flag3) + { + if (Main.npc[i].reflectingProjectiles && projectile.CanReflect()) + { + Main.npc[i].ReflectProjectile(projectile.whoAmI); + return; + } + projectile.ai[0] = 1f; + projectile.ai[1] = (float)i; + projectile.velocity = (Main.npc[i].Center - projectile.Center) * 0.75f; + projectile.netUpdate = true; + projectile.StatusNPC(i); + projectile.damage = 0; + int num28 = 6; + Point[] array2 = new Point[num28]; + int num29 = 0; + for (int l = 0; l < 1000; l++) + { + if (l != projectile.whoAmI && Main.projectile[l].active && Main.projectile[l].owner == Main.myPlayer && Main.projectile[l].type == projectile.type && Main.projectile[l].ai[0] == 1f && Main.projectile[l].ai[1] == (float)i) + { + array2[num29++] = new Point(l, Main.projectile[l].timeLeft); + if (num29 >= array2.Length) + { + break; + } + } + } + if (num29 >= array2.Length) + { + int num30 = 0; + for (int m = 1; m < array2.Length; m++) + { + if (array2[m].Y < array2[num30].Y) + { + num30 = m; + } + } + Main.projectile[array2[num30].X].Kill(); + } + } + } + } + } + } + } + } + + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) + { + if (targetHitbox.Width > 8 && targetHitbox.Height > 8) + { + targetHitbox.Inflate(-targetHitbox.Width / 8, -targetHitbox.Height / 8); + } + return null; + } + + public override void Kill(int timeLeft) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 10); + projectile.position.X = projectile.position.X + (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); + projectile.width = 13; + projectile.height = 20; + projectile.position.X = projectile.position.X - (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + for (int num194 = 0; num194 < 20; num194++) + { + int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 14, 0f, 0f, 0, new Color(0, 255, 255), 1f); + Main.dust[num195].noGravity = true; + Main.dust[num195].velocity *= 2f; + } + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(mod.BuffType("SnapClamDebuff"), 240); + } + } +} \ No newline at end of file diff --git a/Projectiles/Amidias/SnapClamProj.png b/Projectiles/Amidias/SnapClamProj.png new file mode 100644 index 0000000000..42ffb4169a Binary files /dev/null and b/Projectiles/Amidias/SnapClamProj.png differ diff --git a/Projectiles/Amidias/UrchinBall.cs b/Projectiles/Amidias/UrchinBall.cs new file mode 100644 index 0000000000..4135dc2bd1 --- /dev/null +++ b/Projectiles/Amidias/UrchinBall.cs @@ -0,0 +1,158 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Amidias +{ + public class UrchinBall : ModProjectile + { + public bool spike = false; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("UrchinBall"); + } + + public override void SetDefaults() + { + projectile.width = 34; + projectile.height = 34; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.penetrate = -1; + projectile.melee = true; + projectile.alpha = 255; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 3; + } + + public override void AI() + { + Vector2 vector62 = Main.player[projectile.owner].Center - projectile.Center; + projectile.rotation = vector62.ToRotation() - 1.57f; + if (Main.player[projectile.owner].dead) + { + projectile.Kill(); + return; + } + Main.player[projectile.owner].itemAnimation = 10; + Main.player[projectile.owner].itemTime = 10; + float arg_1DC8F_0 = vector62.X; + if (vector62.X < 0f) + { + Main.player[projectile.owner].ChangeDir(1); + projectile.direction = 1; + } + else + { + Main.player[projectile.owner].ChangeDir(-1); + projectile.direction = -1; + } + Main.player[projectile.owner].itemRotation = (vector62 * -1f * (float)projectile.direction).ToRotation(); + projectile.spriteDirection = ((vector62.X > 0f) ? -1 : 1); + if (projectile.ai[0] == 0f && vector62.Length() > 400f) + { + projectile.ai[0] = 1f; + } + if (projectile.ai[0] == 1f || projectile.ai[0] == 2f) + { + if (spike) + { + spike = false; + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, projectile.velocity.X, projectile.velocity.Y, mod.ProjectileType("UrchinBallSpike"), (int)((double)projectile.damage * 0.5), 0f, Main.myPlayer, 0f, 0f); + } + projectile.usesLocalNPCImmunity = false; + float num693 = vector62.Length(); + if (num693 > 1500f) + { + projectile.Kill(); + return; + } + if (num693 > 600f) + { + projectile.ai[0] = 2f; + } + projectile.tileCollide = false; + float num694 = 20f; + if (projectile.ai[0] == 2f) + { + num694 = 40f; + } + projectile.velocity = Vector2.Normalize(vector62) * num694; + if (vector62.Length() < num694) + { + projectile.Kill(); + return; + } + } + float[] var_2_1DE21_cp_0 = projectile.ai; + int var_2_1DE21_cp_1 = 1; + float num73 = var_2_1DE21_cp_0[var_2_1DE21_cp_1]; + var_2_1DE21_cp_0[var_2_1DE21_cp_1] = num73 + 1f; + if (projectile.ai[1] > 5f) + { + projectile.alpha = 0; + } + } + + public override bool OnTileCollide(Vector2 oldVelocity) + { + Collision.HitTiles(projectile.position, projectile.velocity, projectile.width, projectile.height); + projectile.ai[0] = 1f; + projectile.netUpdate = true; + Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 1, 1f, 0f); + return false; + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Vector2 mountedCenter = Main.player[projectile.owner].MountedCenter; + Microsoft.Xna.Framework.Color transparent = Microsoft.Xna.Framework.Color.Transparent; + Texture2D texture2D2 = mod.GetTexture("ExtraTextures/Chains/UrchinFlailChain"); + Vector2 vector17 = projectile.Center; + Microsoft.Xna.Framework.Rectangle? sourceRectangle = null; + Vector2 origin = new Vector2((float)texture2D2.Width * 0.5f, (float)texture2D2.Height * 0.5f); + float num91 = (float)texture2D2.Height; + Vector2 vector18 = mountedCenter - vector17; + float rotation15 = (float)Math.Atan2((double)vector18.Y, (double)vector18.X) - 1.57f; + bool flag13 = true; + if (float.IsNaN(vector17.X) && float.IsNaN(vector17.Y)) + { + flag13 = false; + } + if (float.IsNaN(vector18.X) && float.IsNaN(vector18.Y)) + { + flag13 = false; + } + while (flag13) + { + if (vector18.Length() < num91 + 1f) + { + flag13 = false; + } + else + { + Vector2 value2 = vector18; + value2.Normalize(); + vector17 += value2 * num91; + vector18 = mountedCenter - vector17; + Microsoft.Xna.Framework.Color color17 = Lighting.GetColor((int)vector17.X / 16, (int)(vector17.Y / 16f)); + Main.spriteBatch.Draw(texture2D2, vector17 - Main.screenPosition, sourceRectangle, color17, rotation15, origin, 1f, SpriteEffects.None, 0f); + } + } + return true; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + spike = true; + projectile.ai[0] = 1f; + projectile.netUpdate = true; + target.AddBuff(BuffID.Venom, 300); + } + } +} \ No newline at end of file diff --git a/Projectiles/Amidias/UrchinBall.png b/Projectiles/Amidias/UrchinBall.png new file mode 100644 index 0000000000..58eb311c75 Binary files /dev/null and b/Projectiles/Amidias/UrchinBall.png differ diff --git a/Projectiles/Amidias/UrchinBallSpike.cs b/Projectiles/Amidias/UrchinBallSpike.cs new file mode 100644 index 0000000000..f82cc3ae94 --- /dev/null +++ b/Projectiles/Amidias/UrchinBallSpike.cs @@ -0,0 +1,190 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Amidias +{ + public class UrchinBallSpike : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Spike"); + } + + public override void SetDefaults() + { + projectile.width = 6; + projectile.height = 18; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.melee = true; + projectile.penetrate = -1; + aiType = 598; + } + + public override void AI() + { + if (projectile.ai[0] == 0f) + { + projectile.velocity.X = projectile.velocity.X * 0.99f; + projectile.velocity.Y = projectile.velocity.Y + 0.15f; + projectile.rotation += 0.4f * (float)projectile.direction; + projectile.spriteDirection = projectile.direction; + } + if (projectile.ai[0] == 1f) + { + projectile.tileCollide = false; + int num988 = 6; + bool flag54 = false; + bool flag55 = false; + float[] var0 = projectile.localAI; + int var1 = 0; + float num73 = var0[var1]; + var0[var1] = num73 + 1f; + if (projectile.localAI[0] % 30f == 0f) + { + flag55 = true; + } + int num989 = (int)projectile.ai[1]; + if (projectile.localAI[0] >= (float)(60 * num988)) + { + flag54 = true; + } + else if (num989 < 0 || num989 >= 200) + { + flag54 = true; + } + else if (Main.npc[num989].active && !Main.npc[num989].dontTakeDamage) + { + projectile.Center = Main.npc[num989].Center - projectile.velocity * 2f; + projectile.gfxOffY = Main.npc[num989].gfxOffY; + if (flag55) + { + Main.npc[num989].HitEffect(0, 1.0); + } + } + else + { + flag54 = true; + } + if (flag54) + { + projectile.Kill(); + } + } + } + + public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) + { + Rectangle myRect = new Rectangle((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height); + if (projectile.owner == Main.myPlayer) + { + for (int i = 0; i < 200; i++) + { + if (((Main.npc[i].active && !Main.npc[i].dontTakeDamage)) && + ((projectile.friendly && (!Main.npc[i].friendly || projectile.type == 318 || (Main.npc[i].type == 22 && projectile.owner < 255 && Main.player[projectile.owner].killGuide) || (Main.npc[i].type == 54 && projectile.owner < 255 && Main.player[projectile.owner].killClothier))) || + (projectile.hostile && Main.npc[i].friendly && !Main.npc[i].dontTakeDamageFromHostiles)) && (projectile.owner < 0 || Main.npc[i].immune[projectile.owner] == 0 || projectile.maxPenetrate == 1)) + { + if (Main.npc[i].noTileCollide || !projectile.ownerHitCheck || projectile.CanHit(Main.npc[i])) + { + bool flag3; + if (Main.npc[i].type == 414) + { + Rectangle rect = Main.npc[i].getRect(); + int num5 = 8; + rect.X -= num5; + rect.Y -= num5; + rect.Width += num5 * 2; + rect.Height += num5 * 2; + flag3 = projectile.Colliding(myRect, rect); + } + else + { + flag3 = projectile.Colliding(myRect, Main.npc[i].getRect()); + } + if (flag3) + { + if (Main.npc[i].reflectingProjectiles && projectile.CanReflect()) + { + Main.npc[i].ReflectProjectile(projectile.whoAmI); + return; + } + projectile.ai[0] = 1f; + projectile.ai[1] = (float)i; + projectile.velocity = (Main.npc[i].Center - projectile.Center) * 0.75f; + projectile.netUpdate = true; + projectile.StatusNPC(i); + projectile.damage = 0; + int num28 = 6; + Point[] array2 = new Point[num28]; + int num29 = 0; + for (int l = 0; l < 1000; l++) + { + if (l != projectile.whoAmI && Main.projectile[l].active && Main.projectile[l].owner == Main.myPlayer && Main.projectile[l].type == projectile.type && Main.projectile[l].ai[0] == 1f && Main.projectile[l].ai[1] == (float)i) + { + array2[num29++] = new Point(l, Main.projectile[l].timeLeft); + if (num29 >= array2.Length) + { + break; + } + } + } + if (num29 >= array2.Length) + { + int num30 = 0; + for (int m = 1; m < array2.Length; m++) + { + if (array2[m].Y < array2[num30].Y) + { + num30 = m; + } + } + Main.projectile[array2[num30].X].Kill(); + } + } + } + } + } + } + } + + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) + { + if (targetHitbox.Width > 8 && targetHitbox.Height > 8) + { + targetHitbox.Inflate(-targetHitbox.Width / 8, -targetHitbox.Height / 8); + } + return null; + } + + public override void Kill(int timeLeft) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 10); + projectile.position.X = projectile.position.X + (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); + projectile.width = 13; + projectile.height = 20; + projectile.position.X = projectile.position.X - (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + for (int num194 = 0; num194 < 20; num194++) + { + int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 14, 0f, 0f, 0, new Color(0, 255, 255), 1f); + Main.dust[num195].noGravity = true; + Main.dust[num195].velocity *= 2f; + } + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + if (target.type == NPCID.KingSlime || target.type == NPCID.WallofFlesh || target.type == NPCID.WallofFleshEye || + target.type == NPCID.SkeletronHead || target.type == NPCID.SkeletronHand) + { + target.buffImmune[BuffID.Venom] = false; + } + target.AddBuff(BuffID.Venom, 300); + } + } +} \ No newline at end of file diff --git a/Projectiles/Amidias/UrchinBallSpike.png b/Projectiles/Amidias/UrchinBallSpike.png new file mode 100644 index 0000000000..9828a05673 Binary files /dev/null and b/Projectiles/Amidias/UrchinBallSpike.png differ diff --git a/Projectiles/Amidias/WaywasherProj.cs b/Projectiles/Amidias/WaywasherProj.cs new file mode 100644 index 0000000000..e9782c69bb --- /dev/null +++ b/Projectiles/Amidias/WaywasherProj.cs @@ -0,0 +1,77 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Amidias +{ + public class WaywasherProj : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Waywasher Blast"); + } + + public override void SetDefaults() + { + projectile.width = 16; + projectile.height = 16; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.alpha = 255; + projectile.penetrate = 2; + projectile.timeLeft = 300; + projectile.magic = true; + } + + public override void AI() + { + Lighting.AddLight(projectile.Center, 0f, 0.1f, 0.7f); + for (int num105 = 0; num105 < 2; num105++) + { + float num99 = projectile.velocity.X / 3f * (float)num105; + float num100 = projectile.velocity.Y / 3f * (float)num105; + int num101 = 4; + int num102 = Dust.NewDust(new Vector2(projectile.position.X + (float)num101, projectile.position.Y + (float)num101), projectile.width - num101 * 2, projectile.height - num101 * 2, 33, 0f, 0f, 0, new Color(0, 142, 255), 1.2f); + Main.dust[num102].noGravity = true; + Main.dust[num102].velocity *= 0.1f; + Main.dust[num102].velocity += projectile.velocity * 0.1f; + Dust expr_47FA_cp_0 = Main.dust[num102]; + expr_47FA_cp_0.position.X = expr_47FA_cp_0.position.X - num99; + Dust expr_4815_cp_0 = Main.dust[num102]; + expr_4815_cp_0.position.Y = expr_4815_cp_0.position.Y - num100; + } + if (Main.rand.Next(5) == 0) + { + int num103 = 4; + int num104 = Dust.NewDust(new Vector2(projectile.position.X + (float)num103, projectile.position.Y + (float)num103), projectile.width - num103 * 2, projectile.height - num103 * 2, 33, 0f, 0f, 0, new Color(0, 142, 255), 0.6f); + Main.dust[num104].velocity *= 0.25f; + Main.dust[num104].velocity += projectile.velocity * 0.5f; + } + if (projectile.ai[1] >= 20f) + { + projectile.velocity.Y = projectile.velocity.Y + 0.2f; + } + else + { + projectile.rotation += 0.3f * (float)projectile.direction; + } + if (projectile.velocity.Y > 16f) + { + projectile.velocity.Y = 16f; + } + } + + public override void Kill(int timeLeft) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 10); + for (int k = 0; k < 10; k++) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 33, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f, 0, new Color(0, 142, 255), 1f); + } + } + } +} \ No newline at end of file diff --git a/Projectiles/FrostBoltProjectile.png b/Projectiles/Amidias/WaywasherProj.png similarity index 100% rename from Projectiles/FrostBoltProjectile.png rename to Projectiles/Amidias/WaywasherProj.png diff --git a/Projectiles/Astral/AstralCannonExplosion.cs b/Projectiles/Astral/AstralCannonExplosion.cs index a25a3adff8..af6c3ccdc4 100644 --- a/Projectiles/Astral/AstralCannonExplosion.cs +++ b/Projectiles/Astral/AstralCannonExplosion.cs @@ -1,34 +1,34 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Astral -{ - public class AstralCannonExplosion : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Explosion"); - } - - public override void SetDefaults() - { - projectile.width = 150; - projectile.height = 150; - projectile.friendly = true; - projectile.ignoreWater = true; - projectile.tileCollide = false; - projectile.ranged = true; - projectile.penetrate = -1; - projectile.timeLeft = 10; - } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(mod.BuffType("GodSlayerInferno"), 120); - } - } +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Astral +{ + public class AstralCannonExplosion : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Explosion"); + } + + public override void SetDefaults() + { + projectile.width = 150; + projectile.height = 150; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.tileCollide = false; + projectile.ranged = true; + projectile.penetrate = -1; + projectile.timeLeft = 10; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(mod.BuffType("GodSlayerInferno"), 120); + } + } } \ No newline at end of file diff --git a/Projectiles/Astral/AstralCannonProjectile.cs b/Projectiles/Astral/AstralCannonProjectile.cs index 9e06bc7b61..377b1966a8 100644 --- a/Projectiles/Astral/AstralCannonProjectile.cs +++ b/Projectiles/Astral/AstralCannonProjectile.cs @@ -1,106 +1,106 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Astral -{ - public class AstralCannonProjectile : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Astral Crystal"); - Main.projFrames[projectile.type] = 4; - } - - public override void SetDefaults() - { - projectile.width = 50; - projectile.height = 40; - projectile.friendly = true; - projectile.ignoreWater = true; - projectile.tileCollide = false; - projectile.ranged = true; - projectile.alpha = 255; - projectile.penetrate = 1; - projectile.timeLeft = 300; - } - - public override void AI() - { - if(projectile.alpha > 0) - { - projectile.alpha -= 5; - } - else - { - projectile.alpha = 0; - projectile.tileCollide = true; - } - projectile.frameCounter++; - if (projectile.frameCounter > 4) - { - projectile.frame++; - projectile.frameCounter = 0; - } - if (projectile.frame > 3) - { - projectile.frame = 0; - } - if ((double)Math.Abs(projectile.velocity.X) > 0.2) - { - projectile.spriteDirection = -projectile.direction; - } - if (projectile.velocity.X < 0f) - { - projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X); - } - else - { - projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X); - } - Lighting.AddLight(projectile.Center, 0.3f, 0.5f, 0.1f); - projectile.velocity *= 1.075f; - } - - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - Texture2D texture2D13 = Main.projectileTexture[projectile.type]; - int num214 = Main.projectileTexture[projectile.type].Height / Main.projFrames[projectile.type]; - int y6 = num214 * projectile.frame; - Main.spriteBatch.Draw(texture2D13, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y6, texture2D13.Width, num214)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)num214 / 2f), projectile.scale, SpriteEffects.None, 0f); - return false; - } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(mod.BuffType("GodSlayerInferno"), 300); - } - - public override void Kill(int timeLeft) - { - Main.PlaySound(29, (int)projectile.position.X, (int)projectile.position.Y, 103, 1f, 0f); - projectile.position = projectile.Center; - projectile.width = (projectile.height = 188); - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, mod.ProjectileType("AstralCannonExplosion"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); - for (int num193 = 0; num193 < 2; num193++) - { - Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, mod.DustType("AstralOrange"), 0f, 0f, 50, default(Color), 1f); - } - for (int num194 = 0; num194 < 20; num194++) - { - int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, mod.DustType("AstralOrange"), 0f, 0f, 0, default(Color), 1.5f); - Main.dust[num195].noGravity = true; - Main.dust[num195].velocity *= 3f; - num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, mod.DustType("AstralBlue"), 0f, 0f, 50, default(Color), 1f); - Main.dust[num195].velocity *= 2f; - Main.dust[num195].noGravity = true; - } - } - } +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Astral +{ + public class AstralCannonProjectile : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Astral Crystal"); + Main.projFrames[projectile.type] = 4; + } + + public override void SetDefaults() + { + projectile.width = 50; + projectile.height = 40; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.tileCollide = false; + projectile.ranged = true; + projectile.alpha = 255; + projectile.penetrate = 1; + projectile.timeLeft = 300; + } + + public override void AI() + { + if(projectile.alpha > 0) + { + projectile.alpha -= 5; + } + else + { + projectile.alpha = 0; + projectile.tileCollide = true; + } + projectile.frameCounter++; + if (projectile.frameCounter > 4) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame > 3) + { + projectile.frame = 0; + } + if ((double)Math.Abs(projectile.velocity.X) > 0.2) + { + projectile.spriteDirection = -projectile.direction; + } + if (projectile.velocity.X < 0f) + { + projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X); + } + else + { + projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X); + } + Lighting.AddLight(projectile.Center, 0.3f, 0.5f, 0.1f); + projectile.velocity *= 1.075f; + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D texture2D13 = Main.projectileTexture[projectile.type]; + int num214 = Main.projectileTexture[projectile.type].Height / Main.projFrames[projectile.type]; + int y6 = num214 * projectile.frame; + Main.spriteBatch.Draw(texture2D13, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y6, texture2D13.Width, num214)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)num214 / 2f), projectile.scale, SpriteEffects.None, 0f); + return false; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(mod.BuffType("GodSlayerInferno"), 300); + } + + public override void Kill(int timeLeft) + { + Main.PlaySound(29, (int)projectile.position.X, (int)projectile.position.Y, 103, 1f, 0f); + projectile.position = projectile.Center; + projectile.width = (projectile.height = 188); + projectile.position.X = projectile.position.X - (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, mod.ProjectileType("AstralCannonExplosion"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); + for (int num193 = 0; num193 < 2; num193++) + { + Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, mod.DustType("AstralOrange"), 0f, 0f, 50, default(Color), 1f); + } + for (int num194 = 0; num194 < 20; num194++) + { + int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, mod.DustType("AstralOrange"), 0f, 0f, 0, default(Color), 1.5f); + Main.dust[num195].noGravity = true; + Main.dust[num195].velocity *= 3f; + num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, mod.DustType("AstralBlue"), 0f, 0f, 50, default(Color), 1f); + Main.dust[num195].velocity *= 2f; + Main.dust[num195].noGravity = true; + } + } + } } \ No newline at end of file diff --git a/Projectiles/Astral/AstralScytheProjectile.cs b/Projectiles/Astral/AstralScytheProjectile.cs index 911e8ba8a1..19ffc242f0 100644 --- a/Projectiles/Astral/AstralScytheProjectile.cs +++ b/Projectiles/Astral/AstralScytheProjectile.cs @@ -1,66 +1,66 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Astral -{ - public class AstralScytheProjectile : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Astral Ring"); - Main.projFrames[projectile.type] = 3; - } - - public override void SetDefaults() - { - projectile.width = 72; - projectile.height = 30; - projectile.friendly = true; - projectile.ignoreWater = true; - projectile.melee = true; - projectile.timeLeft = 300; - projectile.penetrate = 8; - projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 5; - } - - public override void AI() - { - projectile.velocity *= 1.03f; - - projectile.frameCounter++; - if (projectile.frameCounter > 4) - { - projectile.frame++; - projectile.frameCounter = 0; - if (projectile.frame > 2) - { - projectile.frame = 0; - } - } - } - - public override void Kill(int timeLeft) - { - Main.PlaySound(SoundID.Item1, projectile.Center); - - for (int i = 0; i < 60; i++) - { - float angle = MathHelper.TwoPi * Main.rand.NextFloat(0f, 1f); - Vector2 angleVec = angle.ToRotationVector2(); - float distance = Main.rand.NextFloat(14f, 36f); - Vector2 off = angleVec * distance; - off.Y *= ((float)projectile.height / projectile.width); - Vector2 pos = projectile.Center + off; - Dust d = Dust.NewDustPerfect(pos, mod.DustType("AstralBlue"), angleVec * Main.rand.NextFloat(2f, 4f)); - d.customData = true; - } - } - } +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Astral +{ + public class AstralScytheProjectile : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Astral Ring"); + Main.projFrames[projectile.type] = 3; + } + + public override void SetDefaults() + { + projectile.width = 72; + projectile.height = 30; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.melee = true; + projectile.timeLeft = 300; + projectile.penetrate = 8; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 5; + } + + public override void AI() + { + projectile.velocity *= 1.03f; + + projectile.frameCounter++; + if (projectile.frameCounter > 4) + { + projectile.frame++; + projectile.frameCounter = 0; + if (projectile.frame > 2) + { + projectile.frame = 0; + } + } + } + + public override void Kill(int timeLeft) + { + Main.PlaySound(SoundID.Item1, projectile.Center); + + for (int i = 0; i < 60; i++) + { + float angle = MathHelper.TwoPi * Main.rand.NextFloat(0f, 1f); + Vector2 angleVec = angle.ToRotationVector2(); + float distance = Main.rand.NextFloat(14f, 36f); + Vector2 off = angleVec * distance; + off.Y *= ((float)projectile.height / projectile.width); + Vector2 pos = projectile.Center + off; + Dust d = Dust.NewDustPerfect(pos, mod.DustType("AstralBlue"), angleVec * Main.rand.NextFloat(2f, 4f)); + d.customData = true; + } + } + } } \ No newline at end of file diff --git a/Projectiles/Astral/AstralachneaFang.cs b/Projectiles/Astral/AstralachneaFang.cs index 75d7d44818..564ed03b60 100644 --- a/Projectiles/Astral/AstralachneaFang.cs +++ b/Projectiles/Astral/AstralachneaFang.cs @@ -1,95 +1,95 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Astral -{ - public class AstralachneaFang : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Fang"); - } - - public override void SetDefaults() - { - projectile.width = 38; - projectile.height = 14; - projectile.friendly = true; - projectile.penetrate = 1; - projectile.magic = true; - projectile.tileCollide = true; - projectile.timeLeft = 240; - } - - public override void AI() - { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default(Color), 1f); - Main.dust[num469].noGravity = true; - Main.dust[num469].velocity *= 0f; - if (projectile.velocity.X < 0f) - { - projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X); - } - else - { - projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X); - } - float centerX = projectile.Center.X; - float centerY = projectile.Center.Y; - float num474 = 250f; - bool homeIn = false; - for (int num475 = 0; num475 < 200; num475++) - { - if (Main.npc[num475].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1)) - { - float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2); - float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2); - float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477); - if (num478 < num474) - { - num474 = num478; - centerX = num476; - centerY = num477; - homeIn = true; - } - } - } - if (homeIn) - { - float num483 = 13f; - Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); - float num484 = centerX - vector35.X; - float num485 = centerY - vector35.Y; - float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485)); - num486 = num483 / num486; - num484 *= num486; - num485 *= num486; - projectile.velocity.X = (projectile.velocity.X * 25f + num484) / 26f; - projectile.velocity.Y = (projectile.velocity.Y * 25f + num485) / 26f; - return; - } - } - - public override void Kill(int timeLeft) - { - Main.PlaySound(SoundID.Item10, projectile.position); - for (int k = 0; k < 3; k++) - { - Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, mod.DustType("AstralOrange"), 0f, 0f); - } - for (int k = 0; k < 3; k++) - { - Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, mod.DustType("AstralBlue"), 0f, 0f); - } - } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(mod.BuffType("GodSlayerInferno"), 180); - } - } +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Astral +{ + public class AstralachneaFang : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Fang"); + } + + public override void SetDefaults() + { + projectile.width = 38; + projectile.height = 14; + projectile.friendly = true; + projectile.penetrate = 1; + projectile.magic = true; + projectile.tileCollide = true; + projectile.timeLeft = 240; + } + + public override void AI() + { + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default(Color), 1f); + Main.dust[num469].noGravity = true; + Main.dust[num469].velocity *= 0f; + if (projectile.velocity.X < 0f) + { + projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X); + } + else + { + projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X); + } + float centerX = projectile.Center.X; + float centerY = projectile.Center.Y; + float num474 = 250f; + bool homeIn = false; + for (int num475 = 0; num475 < 200; num475++) + { + if (Main.npc[num475].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1)) + { + float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2); + float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2); + float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477); + if (num478 < num474) + { + num474 = num478; + centerX = num476; + centerY = num477; + homeIn = true; + } + } + } + if (homeIn) + { + float num483 = 13f; + Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + float num484 = centerX - vector35.X; + float num485 = centerY - vector35.Y; + float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485)); + num486 = num483 / num486; + num484 *= num486; + num485 *= num486; + projectile.velocity.X = (projectile.velocity.X * 25f + num484) / 26f; + projectile.velocity.Y = (projectile.velocity.Y * 25f + num485) / 26f; + return; + } + } + + public override void Kill(int timeLeft) + { + Main.PlaySound(SoundID.Item10, projectile.position); + for (int k = 0; k < 3; k++) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, mod.DustType("AstralOrange"), 0f, 0f); + } + for (int k = 0; k < 3; k++) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, mod.DustType("AstralBlue"), 0f, 0f); + } + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(mod.BuffType("GodSlayerInferno"), 180); + } + } } \ No newline at end of file diff --git a/Projectiles/Astral/HeavenfallenEnergy.cs b/Projectiles/Astral/HeavenfallenEnergy.cs new file mode 100644 index 0000000000..52a2b7f20c --- /dev/null +++ b/Projectiles/Astral/HeavenfallenEnergy.cs @@ -0,0 +1,51 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Astral +{ + public class HeavenfallenEnergy : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Heavenfallen Energy"); + } + + public override void SetDefaults() + { + projectile.width = 8; + projectile.height = 8; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.penetrate = 1; + projectile.timeLeft = 300; + projectile.GetGlobalProjectile(mod).rogue = true; + } + + public override void AI() + { + int num154 = 14; + int coolDust; + projectile.ai[0] += 1; + if (projectile.ai[0] % 2 == 0) + { + if (projectile.ai[0] % 4 == 0) + { + coolDust = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width - num154 * 2, projectile.height - num154 * 2, mod.DustType("AstralBlue"), 0f, 0f, 100, default(Color), 1.5f); + } + else + { + coolDust = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width - num154 * 2, projectile.height - num154 * 2, mod.DustType("AstralOrange"), 0f, 0f, 100, default(Color), 1.5f); + } + Main.dust[coolDust].noGravity = true; + Main.dust[coolDust].velocity *= 0.1f; + Main.dust[coolDust].velocity += projectile.velocity * 0.5f; + } + + } + } +} \ No newline at end of file diff --git a/Projectiles/AccelerationBullet.png b/Projectiles/Astral/HeavenfallenEnergy.png similarity index 100% rename from Projectiles/AccelerationBullet.png rename to Projectiles/Astral/HeavenfallenEnergy.png diff --git a/Projectiles/Astral/HeavenfallenStardisk.cs b/Projectiles/Astral/HeavenfallenStardisk.cs new file mode 100644 index 0000000000..af48d6cd4c --- /dev/null +++ b/Projectiles/Astral/HeavenfallenStardisk.cs @@ -0,0 +1,174 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Astral +{ + public class HeavenfallenStardisk : ModProjectile + { + + public bool explode = false; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Heavenfallen Stardisk"); + } + + public override void SetDefaults() + { + projectile.width = 38; + projectile.height = 34; + projectile.alpha = 255; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.netImportant = true; + projectile.penetrate = 1; + projectile.timeLeft = 600; + projectile.GetGlobalProjectile(mod).rogue = true; + } + + public override void AI() + { + if (projectile.alpha > 0) + { + projectile.alpha -= 20; + } + if (projectile.alpha < 0) + { + projectile.alpha = 0; + } + + for (int i = 0; i < 2; i++) + { + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, mod.DustType("AstralBlue"), 0f, 0f, 100, default(Color), 1f); + Main.dust[num469].noGravity = true; + Main.dust[num469].velocity *= 0f; + } + for (int i = 0; i < 2; i++) + { + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default(Color), 1f); + Main.dust[num469].noGravity = true; + Main.dust[num469].velocity *= 0f; + } + + projectile.rotation += 0.5f; + + if (Main.player[projectile.owner].position.Y != Main.player[projectile.owner].oldPosition.Y && projectile.ai[0] == 0f) + { + explode = true; + } + + projectile.ai[0] += 1f; + + if (Main.myPlayer == projectile.owner && projectile.ai[0] == 20f) + { + if (Main.player[projectile.owner].channel) + { + float num115 = 20f; + Vector2 vector10 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + float num116 = (float)Main.mouseX + Main.screenPosition.X - vector10.X; + float num117 = (float)Main.mouseY + Main.screenPosition.Y - vector10.Y; + if (Main.player[projectile.owner].gravDir == -1f) + { + num117 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector10.Y; + } + float num118 = (float)Math.Sqrt((double)(num116 * num116 + num117 * num117)); + num118 = (float)Math.Sqrt((double)(num116 * num116 + num117 * num117)); + if (num118 > num115) + { + num118 = num115 / num118; + num116 *= num118; + num117 *= num118; + int num119 = (int)(num116 * 1000f); + int num120 = (int)(projectile.velocity.X * 1000f); + int num121 = (int)(num117 * 1000f); + int num122 = (int)(projectile.velocity.Y * 1000f); + if (num119 != num120 || num121 != num122) + { + projectile.netUpdate = true; + } + projectile.velocity.X = num116; + projectile.velocity.Y = num117; + } + else + { + int num123 = (int)(num116 * 1000f); + int num124 = (int)(projectile.velocity.X * 1000f); + int num125 = (int)(num117 * 1000f); + int num126 = (int)(projectile.velocity.Y * 1000f); + if (num123 != num124 || num125 != num126) + { + projectile.netUpdate = true; + } + projectile.velocity.X = num116; + projectile.velocity.Y = num117; + } + } + else if (projectile.ai[0] == 20f) + { + projectile.netUpdate = true; + float num127 = 20f; + Vector2 vector11 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + float num128 = (float)Main.mouseX + Main.screenPosition.X - vector11.X; + float num129 = (float)Main.mouseY + Main.screenPosition.Y - vector11.Y; + if (Main.player[projectile.owner].gravDir == -1f) + { + num129 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector11.Y; + } + float num130 = (float)Math.Sqrt((double)(num128 * num128 + num129 * num129)); + if (num130 == 0f || projectile.ai[0] < 0f) + { + vector11 = new Vector2(Main.player[projectile.owner].position.X + (float)(Main.player[projectile.owner].width / 2), Main.player[projectile.owner].position.Y + (float)(Main.player[projectile.owner].height / 2)); + num128 = projectile.position.X + (float)projectile.width * 0.5f - vector11.X; + num129 = projectile.position.Y + (float)projectile.height * 0.5f - vector11.Y; + num130 = (float)Math.Sqrt((double)(num128 * num128 + num129 * num129)); + } + num130 = num127 / num130; + num128 *= num130; + num129 *= num130; + projectile.velocity.X = num128; + projectile.velocity.Y = num129; + } + } + } + + public override void Kill(int timeLeft) + { + Main.PlaySound(SoundID.Item10, projectile.position); + for (int i = 0; i < 10; i++) + { + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, mod.DustType("AstralBlue"), 0f, 0f, 100, default(Color), 1.5f); + Main.dust[num469].noGravity = true; + Main.dust[num469].velocity *= 0f; + } + for (int i = 0; i < 10; i++) + { + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default(Color), 1.5f); + Main.dust[num469].noGravity = true; + Main.dust[num469].velocity *= 0f; + } + + if (explode && Main.player[projectile.owner].position.Y != Main.player[projectile.owner].oldPosition.Y) + { + if (projectile.owner == Main.myPlayer) + { + float spread = 45f * 0.0174f; + double startAngle = Math.Atan2(projectile.velocity.X, projectile.velocity.Y) - spread / 2; + double deltaAngle = spread / 8f; + double offsetAngle; + int i; + for (i = 0; i < 4; i++) + { + offsetAngle = (startAngle + deltaAngle * (i + i * i) / 2f) + 32f * i; + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(Math.Sin(offsetAngle) * 2f), (float)(Math.Cos(offsetAngle) * 2f), mod.ProjectileType("HeavenfallenEnergy"), (int)((double)projectile.damage * 0.4), projectile.knockBack, projectile.owner, 0f, 0f); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 2f), (float)(-Math.Cos(offsetAngle) * 2f), mod.ProjectileType("HeavenfallenEnergy"), (int)((double)projectile.damage * 0.4), projectile.knockBack, projectile.owner, 0f, 0f); + } + } + } + } + } +} diff --git a/Projectiles/Astral/HeavenfallenStardisk.png b/Projectiles/Astral/HeavenfallenStardisk.png new file mode 100644 index 0000000000..beedd16af7 Binary files /dev/null and b/Projectiles/Astral/HeavenfallenStardisk.png differ diff --git a/Projectiles/Astral/Hive.cs b/Projectiles/Astral/Hive.cs index 8e52c6ce2e..4ea9e12a0d 100644 --- a/Projectiles/Astral/Hive.cs +++ b/Projectiles/Astral/Hive.cs @@ -6,47 +6,61 @@ using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Astral -{ - public class Hive : ModProjectile - { - - public override void SetStaticDefaults() +{ + public class Hive : ModProjectile + { + + public override void SetStaticDefaults() { - DisplayName.SetDefault("Hive"); - Main.projFrames[projectile.type] = 6; - } - - public override void SetDefaults() - { - projectile.width = 38; - projectile.height = 60; - projectile.ignoreWater = true; - projectile.tileCollide = true; - projectile.sentry = true; - projectile.timeLeft = Projectile.SentryLifeTime; - projectile.penetrate = -1; - } - - public override void AI() - { - projectile.frameCounter++; - if (projectile.frameCounter > 5) - { - projectile.frame++; - projectile.frameCounter = 0; - } - if (projectile.frame > 5) - { - projectile.frame = 0; - } - projectile.velocity.Y += 0.5f; - - if(projectile.velocity.Y > 10f) + DisplayName.SetDefault("Hive"); + Main.projFrames[projectile.type] = 6; + } + + public override void SetDefaults() + { + projectile.width = 38; + projectile.height = 60; + projectile.ignoreWater = true; + projectile.tileCollide = true; + projectile.sentry = true; + projectile.timeLeft = Projectile.SentryLifeTime; + projectile.penetrate = -1; + } + + public override void AI() + { + if (projectile.localAI[0] == 0f) + { + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue = projectile.damage; + projectile.localAI[0] += 1f; + } + if (Main.player[projectile.owner].minionDamage != projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) + { + int damage2 = (int)(((float)projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue / + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) * + Main.player[projectile.owner].minionDamage); + projectile.damage = damage2; + } + + projectile.frameCounter++; + if (projectile.frameCounter > 5) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame > 5) + { + projectile.frame = 0; + } + projectile.velocity.Y += 0.5f; + + if (projectile.velocity.Y > 10f) { projectile.velocity.Y = 10f; - } - - if (projectile.owner == Main.myPlayer) + } + + if (projectile.owner == Main.myPlayer) { if (projectile.ai[0] != 0f) { @@ -54,23 +68,27 @@ namespace CalamityMod.Projectiles.Astral return; } projectile.ai[1] += 1f; - if((projectile.ai[1] % 15f) == 0f) + if ((projectile.ai[1] % 15f) == 0f) { float velocityX = Main.rand.NextFloat(-0.4f, 0.4f); float velocityY = Main.rand.NextFloat(-0.3f, -0.5f); Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, velocityX, velocityY, mod.ProjectileType("Hiveling"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); - return; - } - } - } - - public override bool OnTileCollide(Vector2 oldVelocity) - { - if (projectile.penetrate == 0) - { - projectile.Kill(); - } - return false; - } - } + } + } + } + + public override bool OnTileCollide(Vector2 oldVelocity) + { + if (projectile.penetrate == 0) + { + projectile.Kill(); + } + return false; + } + + public override bool CanDamage() + { + return false; + } + } } diff --git a/Projectiles/Astral/RadiantExplosion.cs b/Projectiles/Astral/RadiantExplosion.cs new file mode 100644 index 0000000000..96c758efd7 --- /dev/null +++ b/Projectiles/Astral/RadiantExplosion.cs @@ -0,0 +1,82 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Astral +{ + public class RadiantExplosion : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Explosion"); + } + + public override void SetDefaults() + { + projectile.width = 150; + projectile.height = 150; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.tileCollide = false; + projectile.penetrate = -1; + projectile.timeLeft = 10; + projectile.GetGlobalProjectile(mod).rogue = true; + } + + public override void AI() + { + projectile.localAI[0] += 1f; + if (projectile.localAI[0] > 4f) + { + for (int i = 0; i < 5; i++) + { + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, mod.DustType("AstralBlue"), 0f, 0f, 100, default(Color), 1.5f); + Main.dust[num469].noGravity = true; + Main.dust[num469].velocity *= 0f; + } + for (int i = 0; i < 5; i++) + { + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default(Color), 1.5f); + Main.dust[num469].noGravity = true; + Main.dust[num469].velocity *= 0f; + } + } + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + for (int n = 0; n < 3; n++) + { + float x = target.position.X + (float)Main.rand.Next(-400, 400); + float y = target.position.Y - (float)Main.rand.Next(500, 800); + Vector2 vector = new Vector2(x, y); + float num13 = target.position.X + (float)(target.width / 2) - vector.X; + float num14 = target.position.Y + (float)(target.height / 2) - vector.Y; + num13 += (float)Main.rand.Next(-100, 101); + int num15 = 25; + int projectileType = Main.rand.Next(3); + if (projectileType == 0) + { + projectileType = mod.ProjectileType("AstralStar"); + } + else if (projectileType == 1) + { + projectileType = ProjectileID.HallowStar; + } + else + { + projectileType = ProjectileID.FallingStar; + } + float num16 = (float)Math.Sqrt((double)(num13 * num13 + num14 * num14)); + num16 = (float)num15 / num16; + num13 *= num16; + num14 *= num16; + int num17 = Projectile.NewProjectile(x, y, num13, num14, projectileType, (int)((double)projectile.damage * 0.75), 5f, projectile.owner, 2f, 0f); + Main.projectile[num17].ranged = false; + } + } + } +} \ No newline at end of file diff --git a/Projectiles/Astral/RadiantExplosion.png b/Projectiles/Astral/RadiantExplosion.png new file mode 100644 index 0000000000..3ccaea528f Binary files /dev/null and b/Projectiles/Astral/RadiantExplosion.png differ diff --git a/Projectiles/Astral/RadiantStar.cs b/Projectiles/Astral/RadiantStar.cs new file mode 100644 index 0000000000..dcf026de8f --- /dev/null +++ b/Projectiles/Astral/RadiantStar.cs @@ -0,0 +1,77 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Astral +{ + public class RadiantStar : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Radiant Star"); + } + + public override void SetDefaults() + { + projectile.width = 24; + projectile.height = 24; + projectile.friendly = true; + projectile.penetrate = 4; + projectile.timeLeft = 300; + projectile.GetGlobalProjectile(mod).rogue = true; + } + + public override void AI() + { + projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 2.355f; + if(projectile.spriteDirection == -1) + { + projectile.rotation -= 1.57f; + } + projectile.ai[1] += 1f; + if (projectile.ai[1] == 25f) + { + int numProj = 2; + float rotation = MathHelper.ToRadians(50); + if (projectile.owner == Main.myPlayer) + { + for (int i = 0; i < numProj + 1; i++) + { + Vector2 speed = new Vector2((float)Main.rand.Next(-50, 51), (float)Main.rand.Next(-50, 51)); + while (speed.X == 0f && speed.Y == 0f) + { + speed = new Vector2((float)Main.rand.Next(-50, 51), (float)Main.rand.Next(-50, 51)); + } + speed.Normalize(); + speed *= ((float)Main.rand.Next(30, 61) * 0.1f) * 2.5f; + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, speed.X, speed.Y, mod.ProjectileType("RadiantStar2"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); + } + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, mod.ProjectileType("RadiantExplosion"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); + projectile.active = false; + return; + } + } + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D tex = Main.projectileTexture[projectile.type]; + spriteBatch.Draw(tex, projectile.Center - Main.screenPosition, null, projectile.GetAlpha(lightColor), projectile.rotation, tex.Size() / 2f, projectile.scale, SpriteEffects.None, 0f); + return false; + } + + public override void Kill(int timeLeft) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 27); + for (int k = 0; k < 5; k++) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, mod.DustType("AstralBlue"), projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); + } + } + } +} \ No newline at end of file diff --git a/Projectiles/Astral/RadiantStar.png b/Projectiles/Astral/RadiantStar.png new file mode 100644 index 0000000000..d5a854d774 Binary files /dev/null and b/Projectiles/Astral/RadiantStar.png differ diff --git a/Projectiles/Astral/RadiantStar2.cs b/Projectiles/Astral/RadiantStar2.cs new file mode 100644 index 0000000000..9976629ddd --- /dev/null +++ b/Projectiles/Astral/RadiantStar2.cs @@ -0,0 +1,86 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Astral +{ + public class RadiantStar2 : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Radiant Star"); + } + + public override void SetDefaults() + { + projectile.width = 24; + projectile.height = 24; + projectile.friendly = true; + projectile.penetrate = 1; + projectile.timeLeft = 300; + projectile.GetGlobalProjectile(mod).rogue = true; + } + + public override void AI() + { + projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 2.355f; + if(projectile.spriteDirection == -1) + { + projectile.rotation -= 1.57f; + } + float centerX = projectile.Center.X; + float centerY = projectile.Center.Y; + float num474 = 600f; + bool homeIn = false; + for (int i = 0; i < 200; i++) + { + if (Main.npc[i].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[i].Center, 1, 1)) + { + float num476 = Main.npc[i].position.X + (float)(Main.npc[i].width / 2); + float num477 = Main.npc[i].position.Y + (float)(Main.npc[i].height / 2); + float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477); + if (num478 < num474) + { + num474 = num478; + centerX = num476; + centerY = num477; + homeIn = true; + } + } + } + if (homeIn) + { + float num483 = 24f; + Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + float num484 = centerX - vector35.X; + float num485 = centerY - vector35.Y; + float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485)); + num486 = num483 / num486; + num484 *= num486; + num485 *= num486; + projectile.velocity.X = (projectile.velocity.X * 20f + num484) / 21f; + projectile.velocity.Y = (projectile.velocity.Y * 20f + num485) / 21f; + return; + } + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D tex = Main.projectileTexture[projectile.type]; + spriteBatch.Draw(tex, projectile.Center - Main.screenPosition, null, projectile.GetAlpha(lightColor), projectile.rotation, tex.Size() / 2f, projectile.scale, SpriteEffects.None, 0f); + return false; + } + + public override void Kill(int timeLeft) + { + for (int k = 0; k < 5; k++) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, mod.DustType("AstralBlue"), projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); + } + } + } +} \ No newline at end of file diff --git a/Projectiles/Astral/RadiantStar2.png b/Projectiles/Astral/RadiantStar2.png new file mode 100644 index 0000000000..d5a854d774 Binary files /dev/null and b/Projectiles/Astral/RadiantStar2.png differ diff --git a/Projectiles/Astral/StellarKnife.cs b/Projectiles/Astral/StellarKnife.cs new file mode 100644 index 0000000000..bf3f047603 --- /dev/null +++ b/Projectiles/Astral/StellarKnife.cs @@ -0,0 +1,101 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Astral +{ + public class StellarKnife : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Stellar Knife"); + } + + public override void SetDefaults() + { + projectile.width = 32; + projectile.height = 34; + projectile.friendly = true; + projectile.penetrate = 1; + projectile.timeLeft = 600; + projectile.GetGlobalProjectile(mod).rogue = true; + } + + public override void AI() + { + projectile.ai[1] += 0.75f; + if (projectile.ai[1] <= 60f) + { + projectile.rotation += 1f; + projectile.velocity.X *= 0.985f; + projectile.velocity.Y *= 0.985f; + } + else + { + projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 2.355f; + if(projectile.spriteDirection == -1) + { + projectile.rotation -= 1.57f; + } + float centerX = projectile.Center.X; + float centerY = projectile.Center.Y; + float num474 = 600f; + bool homeIn = false; + for (int i = 0; i < 200; i++) + { + if (Main.npc[i].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[i].Center, 1, 1)) + { + float num476 = Main.npc[i].position.X + (float)(Main.npc[i].width / 2); + float num477 = Main.npc[i].position.Y + (float)(Main.npc[i].height / 2); + float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477); + if (num478 < num474) + { + num474 = num478; + centerX = num476; + centerY = num477; + homeIn = true; + } + } + } + if (homeIn) + { + float num483 = 30f; + Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + float num484 = centerX - vector35.X; + float num485 = centerY - vector35.Y; + float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485)); + num486 = num483 / num486; + num484 *= num486; + num485 *= num486; + projectile.velocity.X = (projectile.velocity.X * 10f + num484) / 11f; + projectile.velocity.Y = (projectile.velocity.Y * 10f + num485) / 11f; + return; + } + else + { + projectile.velocity.X *= 0.92f; + projectile.velocity.Y *= 0.92f; + } + } + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D tex = Main.projectileTexture[projectile.type]; + spriteBatch.Draw(tex, projectile.Center - Main.screenPosition, null, projectile.GetAlpha(lightColor), projectile.rotation, tex.Size() / 2f, projectile.scale, SpriteEffects.None, 0f); + return false; + } + + public override void Kill(int timeLeft) + { + for (int k = 0; k < 5; k++) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, mod.DustType("AstralBlue"), projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); + } + } + } +} \ No newline at end of file diff --git a/Projectiles/Astral/StellarKnife.png b/Projectiles/Astral/StellarKnife.png new file mode 100644 index 0000000000..0adabcb0fc Binary files /dev/null and b/Projectiles/Astral/StellarKnife.png differ diff --git a/Projectiles/AtlantisSpear.png b/Projectiles/AtlantisSpear.png deleted file mode 100644 index 9ac770b5b5..0000000000 Binary files a/Projectiles/AtlantisSpear.png and /dev/null differ diff --git a/Projectiles/AtlantisSpear2.png b/Projectiles/AtlantisSpear2.png deleted file mode 100644 index 9ac770b5b5..0000000000 Binary files a/Projectiles/AtlantisSpear2.png and /dev/null differ diff --git a/Projectiles/BallisticPoisonBomb.png b/Projectiles/BallisticPoisonBomb.png deleted file mode 100644 index 4a42eba001..0000000000 Binary files a/Projectiles/BallisticPoisonBomb.png and /dev/null differ diff --git a/Projectiles/BallisticPoisonBombSpike.png b/Projectiles/BallisticPoisonBombSpike.png deleted file mode 100644 index 91b655fe47..0000000000 Binary files a/Projectiles/BallisticPoisonBombSpike.png and /dev/null differ diff --git a/Projectiles/Boss/AbyssBallVolley2.cs b/Projectiles/Boss/AbyssBallVolley2.cs index e28ecab059..73f0cb8a8b 100644 --- a/Projectiles/Boss/AbyssBallVolley2.cs +++ b/Projectiles/Boss/AbyssBallVolley2.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Boss { public override void SetStaticDefaults() { - DisplayName.SetDefault("Abyss Ball Volley V2"); + DisplayName.SetDefault("Abyss Ball Volley"); } public override void SetDefaults() diff --git a/Projectiles/Boss/AbyssMine2.cs b/Projectiles/Boss/AbyssMine2.cs index 96db73830a..ad4a63909a 100644 --- a/Projectiles/Boss/AbyssMine2.cs +++ b/Projectiles/Boss/AbyssMine2.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Boss { public override void SetStaticDefaults() { - DisplayName.SetDefault("Abyss Mine V2"); + DisplayName.SetDefault("Abyss Mine"); } public override void SetDefaults() diff --git a/Projectiles/Boss/AstralFlame.cs b/Projectiles/Boss/AstralFlame.cs index 4daa1b9aa2..270125513f 100644 --- a/Projectiles/Boss/AstralFlame.cs +++ b/Projectiles/Boss/AstralFlame.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Boss { public override void SetStaticDefaults() { - DisplayName.SetDefault("Flame"); + DisplayName.SetDefault("Astral Homing Flame"); Main.projFrames[projectile.type] = 4; } diff --git a/Projectiles/Boss/AstralLaser.cs b/Projectiles/Boss/AstralLaser.cs index 1f134722ea..c63c6ebd77 100644 --- a/Projectiles/Boss/AstralLaser.cs +++ b/Projectiles/Boss/AstralLaser.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Boss { public override void SetStaticDefaults() { - DisplayName.SetDefault("Laser"); + DisplayName.SetDefault("Astral Laser Volley"); Main.projFrames[projectile.type] = 3; } diff --git a/Projectiles/Boss/AstralShot2.cs b/Projectiles/Boss/AstralShot2.cs index 08d6d89afc..4ff5c54974 100644 --- a/Projectiles/Boss/AstralShot2.cs +++ b/Projectiles/Boss/AstralShot2.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Boss { public override void SetStaticDefaults() { - DisplayName.SetDefault("Laser"); + DisplayName.SetDefault("Astral Laser"); } public override void SetDefaults() diff --git a/Projectiles/Boss/BigFlare.cs b/Projectiles/Boss/BigFlare.cs index e523b6e451..fae6aeeeca 100644 --- a/Projectiles/Boss/BigFlare.cs +++ b/Projectiles/Boss/BigFlare.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Projectiles.Boss { public override void SetStaticDefaults() { - DisplayName.SetDefault("Flare"); + DisplayName.SetDefault("Big Flare"); Main.projFrames[projectile.type] = 4; } diff --git a/Projectiles/Boss/BrimDust.cs b/Projectiles/Boss/BrimDust.cs deleted file mode 100644 index 11d3d02285..0000000000 --- a/Projectiles/Boss/BrimDust.cs +++ /dev/null @@ -1,80 +0,0 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Boss -{ - public class BrimDust : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Brimdust"); - } - - public override void SetDefaults() - { - projectile.width = 46; - projectile.height = 46; - projectile.hostile = true; - projectile.ignoreWater = true; - projectile.tileCollide = false; - projectile.penetrate = -1; - } - - public override void AI() - { - projectile.velocity.X *= 0.985f; - projectile.velocity.Y *= 0.975f; - Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0.75f) / 255f, ((255 - projectile.alpha) * 0f) / 255f, ((255 - projectile.alpha) * 0f) / 255f); - for (int num468 = 0; num468 < 3; num468++) - { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 235, 0f, 0f, 100, default(Color), 1f); - Main.dust[num469].noGravity = true; - Main.dust[num469].velocity *= 0f; - } - } - - public override void OnHitPlayer(Player target, int damage, bool crit) - { - target.AddBuff(mod.BuffType("BrimstoneFlames"), 180); - } - - public override void Kill(int timeLeft) - { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); - projectile.position.X = projectile.position.X + (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); - projectile.width = 100; - projectile.height = 100; - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); - for (int num621 = 0; num621 < 10; num621++) - { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 235, 0f, 0f, 100, default(Color), 1f); - Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) - { - Main.dust[num622].scale = 0.5f; - Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; - } - } - for (int num623 = 0; num623 < 20; num623++) - { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 235, 0f, 0f, 100, default(Color), 2f); - Main.dust[num624].noGravity = true; - Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 235, 0f, 0f, 100, default(Color), 1f); - Main.dust[num624].velocity *= 2f; - } - projectile.position.X = projectile.position.X + (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); - projectile.width = 100; - projectile.height = 100; - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); - } - } -} \ No newline at end of file diff --git a/Projectiles/Boss/BrimDust.png b/Projectiles/Boss/BrimDust.png deleted file mode 100644 index 59a8c48354..0000000000 Binary files a/Projectiles/Boss/BrimDust.png and /dev/null differ diff --git a/Projectiles/Boss/BrimstoneBall.cs b/Projectiles/Boss/BrimstoneBall.cs index 7cbf055f9e..a0d3f85b3a 100644 --- a/Projectiles/Boss/BrimstoneBall.cs +++ b/Projectiles/Boss/BrimstoneBall.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Boss { public override void SetStaticDefaults() { - DisplayName.SetDefault("Ball"); + DisplayName.SetDefault("Brimstone Fireball"); } public override void SetDefaults() diff --git a/Projectiles/BrimstoneBall2.cs b/Projectiles/Boss/BrimstoneBall2.cs similarity index 92% rename from Projectiles/BrimstoneBall2.cs rename to Projectiles/Boss/BrimstoneBall2.cs index cc1a4e0f61..0fc6791c13 100644 --- a/Projectiles/BrimstoneBall2.cs +++ b/Projectiles/Boss/BrimstoneBall2.cs @@ -5,13 +5,13 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Boss { public class BrimstoneBall2 : ModProjectile { public override void SetStaticDefaults() { - DisplayName.SetDefault("Ball"); + DisplayName.SetDefault("Brimstone Fireball"); } public override void SetDefaults() diff --git a/Projectiles/BrimstoneBall2.png b/Projectiles/Boss/BrimstoneBall2.png similarity index 100% rename from Projectiles/BrimstoneBall2.png rename to Projectiles/Boss/BrimstoneBall2.png diff --git a/Projectiles/Boss/BrimstoneBarrage.cs b/Projectiles/Boss/BrimstoneBarrage.cs index e3d9187b69..9a59b09046 100644 --- a/Projectiles/Boss/BrimstoneBarrage.cs +++ b/Projectiles/Boss/BrimstoneBarrage.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Boss { public override void SetStaticDefaults() { - DisplayName.SetDefault("Brimstone"); + DisplayName.SetDefault("Brimstone Dart"); Main.projFrames[projectile.type] = 4; } diff --git a/Projectiles/Boss/BrimstoneFire.cs b/Projectiles/Boss/BrimstoneFire.cs index cc6a4905f1..ca26e955e2 100644 --- a/Projectiles/Boss/BrimstoneFire.cs +++ b/Projectiles/Boss/BrimstoneFire.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Boss { public override void SetStaticDefaults() { - DisplayName.SetDefault("Fire"); + DisplayName.SetDefault("Brimstone Fire"); } public override void SetDefaults() diff --git a/Projectiles/Boss/BrimstoneFireblast.cs b/Projectiles/Boss/BrimstoneFireblast.cs index 382aff111e..1ef3678c0c 100644 --- a/Projectiles/Boss/BrimstoneFireblast.cs +++ b/Projectiles/Boss/BrimstoneFireblast.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Boss { public override void SetStaticDefaults() { - DisplayName.SetDefault("Fireblast"); + DisplayName.SetDefault("Brimstone Gigablast"); Main.projFrames[projectile.type] = 6; } diff --git a/Projectiles/Boss/BrimstoneGigaBlast.cs b/Projectiles/Boss/BrimstoneGigaBlast.cs index 7bf45e9434..270f4d6de7 100644 --- a/Projectiles/Boss/BrimstoneGigaBlast.cs +++ b/Projectiles/Boss/BrimstoneGigaBlast.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Boss { public override void SetStaticDefaults() { - DisplayName.SetDefault("Giga Blast"); + DisplayName.SetDefault("Brimstone Fireblast"); Main.projFrames[projectile.type] = 6; } diff --git a/Projectiles/Boss/BrimstoneHellblast.cs b/Projectiles/Boss/BrimstoneHellblast.cs index 353c7a307f..638d8f8146 100644 --- a/Projectiles/Boss/BrimstoneHellblast.cs +++ b/Projectiles/Boss/BrimstoneHellblast.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Boss { public override void SetStaticDefaults() { - DisplayName.SetDefault("Hellblast"); + DisplayName.SetDefault("Brimstone Hellblast"); Main.projFrames[projectile.type] = 4; } diff --git a/Projectiles/Boss/BrimstoneHellblast2.cs b/Projectiles/Boss/BrimstoneHellblast2.cs index d9843217fa..fd3774b59b 100644 --- a/Projectiles/Boss/BrimstoneHellblast2.cs +++ b/Projectiles/Boss/BrimstoneHellblast2.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Boss { public override void SetStaticDefaults() { - DisplayName.SetDefault("Hellblast"); + DisplayName.SetDefault("Brimstone Hellblast"); Main.projFrames[projectile.type] = 4; } diff --git a/Projectiles/Boss/BrimstoneHellfireball.cs b/Projectiles/Boss/BrimstoneHellfireball.cs index 2c662646ef..f21e6fc627 100644 --- a/Projectiles/Boss/BrimstoneHellfireball.cs +++ b/Projectiles/Boss/BrimstoneHellfireball.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Boss { public override void SetStaticDefaults() { - DisplayName.SetDefault("Hellfire"); + DisplayName.SetDefault("Brimstone Hellfireball"); } public override void SetDefaults() diff --git a/Projectiles/Boss/BrimstoneLaser.cs b/Projectiles/Boss/BrimstoneLaser.cs index 6b83b8ccc0..80a04058bd 100644 --- a/Projectiles/Boss/BrimstoneLaser.cs +++ b/Projectiles/Boss/BrimstoneLaser.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - DisplayName.SetDefault("Laser"); + DisplayName.SetDefault("Brimstone Laser"); } public override void SetDefaults() diff --git a/Projectiles/Boss/BrimstoneLaserSplit.cs b/Projectiles/Boss/BrimstoneLaserSplit.cs index 5d6771bc8c..3f66d94133 100644 --- a/Projectiles/Boss/BrimstoneLaserSplit.cs +++ b/Projectiles/Boss/BrimstoneLaserSplit.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Boss { public override void SetStaticDefaults() { - DisplayName.SetDefault("Laser"); + DisplayName.SetDefault("Brimstone Homing Laser"); } public override void SetDefaults() diff --git a/Projectiles/Boss/BrimstoneMonster.cs b/Projectiles/Boss/BrimstoneMonster.cs index 815e18045d..eb44a76501 100644 --- a/Projectiles/Boss/BrimstoneMonster.cs +++ b/Projectiles/Boss/BrimstoneMonster.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - DisplayName.SetDefault("Monster"); + DisplayName.SetDefault("Brimstone Monster"); } public override void SetDefaults() diff --git a/Projectiles/BrimstoneShot.cs b/Projectiles/Boss/BrimstoneShot.cs similarity index 93% rename from Projectiles/BrimstoneShot.cs rename to Projectiles/Boss/BrimstoneShot.cs index fe449bccd6..38f2117cef 100644 --- a/Projectiles/BrimstoneShot.cs +++ b/Projectiles/Boss/BrimstoneShot.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Boss { public class BrimstoneShot : ModProjectile { @@ -13,7 +13,7 @@ namespace CalamityMod.Projectiles public override void SetStaticDefaults() { - DisplayName.SetDefault("Laser"); + DisplayName.SetDefault("Brimstone Laser"); } public override void SetDefaults() diff --git a/Projectiles/BrimstoneShot.png b/Projectiles/Boss/BrimstoneShot.png similarity index 100% rename from Projectiles/BrimstoneShot.png rename to Projectiles/Boss/BrimstoneShot.png diff --git a/Projectiles/Boss/BrimstoneWave.cs b/Projectiles/Boss/BrimstoneWave.cs index e96a313ee1..c5060103a3 100644 --- a/Projectiles/Boss/BrimstoneWave.cs +++ b/Projectiles/Boss/BrimstoneWave.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - DisplayName.SetDefault("Flame Skull"); + DisplayName.SetDefault("Brimstone Flame Skull"); Main.projFrames[projectile.type] = 4; } diff --git a/Projectiles/Boss/DarkEnergyBall.cs b/Projectiles/Boss/DarkEnergyBall.cs index 9edbbe9a9f..24f93576e6 100644 --- a/Projectiles/Boss/DarkEnergyBall.cs +++ b/Projectiles/Boss/DarkEnergyBall.cs @@ -26,7 +26,8 @@ namespace CalamityMod.Projectiles.Boss projectile.hostile = true; projectile.tileCollide = false; projectile.timeLeft = 600; - } + cooldownSlot = 1; + } public override void AI() { diff --git a/Projectiles/Boss/DestroyerHomingLaser.cs b/Projectiles/Boss/DestroyerHomingLaser.cs index 8835818935..4c66d57365 100644 --- a/Projectiles/Boss/DestroyerHomingLaser.cs +++ b/Projectiles/Boss/DestroyerHomingLaser.cs @@ -1,77 +1,77 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Boss -{ - public class DestroyerHomingLaser : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Laser"); - } - - public override void SetDefaults() - { - projectile.width = 4; - projectile.height = 4; - projectile.hostile = true; - projectile.ignoreWater = true; - projectile.alpha = 255; - projectile.penetrate = 1; - projectile.timeLeft = 600; - projectile.scale = 1.8f; - } - - public override void AI() - { - projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; - Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0f) / 255f, ((255 - projectile.alpha) * 0.75f) / 255f, ((255 - projectile.alpha) * 0f) / 255f); - if (projectile.alpha > 0) - { - projectile.alpha -= 125; - } - if (projectile.alpha < 0) - { - projectile.alpha = 0; - } - if (projectile.localAI[1] == 0f) - { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 33); - } - projectile.localAI[1] += 1f; - if (projectile.localAI[1] >= 120f) - { - int num103 = (int)Player.FindClosest(projectile.Center, 1, 1); - projectile.ai[0] += 1f; - if (projectile.ai[0] < 360f) - { - float scaleFactor2 = projectile.velocity.Length(); - Vector2 vector11 = Main.player[num103].Center - projectile.Center; - vector11.Normalize(); - vector11 *= scaleFactor2; - projectile.velocity = (projectile.velocity * 24f + vector11) / 25f; - projectile.velocity.Normalize(); - projectile.velocity *= scaleFactor2; - } - } - if (projectile.velocity.Length() < 18f) - { - projectile.velocity *= 1.02f; - } - } - - public override Color? GetAlpha(Color lightColor) - { - if (projectile.alpha < 200) - { - return new Color(255 - projectile.alpha, 255 - projectile.alpha, 255 - projectile.alpha, 0); - } - return Color.Transparent; - } - } +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Boss +{ + public class DestroyerHomingLaser : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Homing Laser"); + } + + public override void SetDefaults() + { + projectile.width = 4; + projectile.height = 4; + projectile.hostile = true; + projectile.ignoreWater = true; + projectile.alpha = 255; + projectile.penetrate = 1; + projectile.timeLeft = 600; + projectile.scale = 1.8f; + } + + public override void AI() + { + projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; + Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0f) / 255f, ((255 - projectile.alpha) * 0.75f) / 255f, ((255 - projectile.alpha) * 0f) / 255f); + if (projectile.alpha > 0) + { + projectile.alpha -= 125; + } + if (projectile.alpha < 0) + { + projectile.alpha = 0; + } + if (projectile.localAI[1] == 0f) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 33); + } + projectile.localAI[1] += 1f; + if (projectile.localAI[1] >= 120f) + { + int num103 = (int)Player.FindClosest(projectile.Center, 1, 1); + projectile.ai[0] += 1f; + if (projectile.ai[0] < 360f) + { + float scaleFactor2 = projectile.velocity.Length(); + Vector2 vector11 = Main.player[num103].Center - projectile.Center; + vector11.Normalize(); + vector11 *= scaleFactor2; + projectile.velocity = (projectile.velocity * 24f + vector11) / 25f; + projectile.velocity.Normalize(); + projectile.velocity *= scaleFactor2; + } + } + if (projectile.velocity.Length() < 18f) + { + projectile.velocity *= 1.02f; + } + } + + public override Color? GetAlpha(Color lightColor) + { + if (projectile.alpha < 200) + { + return new Color(255 - projectile.alpha, 255 - projectile.alpha, 255 - projectile.alpha, 0); + } + return Color.Transparent; + } + } } \ No newline at end of file diff --git a/Projectiles/Boss/DeusMine.cs b/Projectiles/Boss/DeusMine.cs index 8f91d73a03..65009d71c1 100644 --- a/Projectiles/Boss/DeusMine.cs +++ b/Projectiles/Boss/DeusMine.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Boss { public override void SetStaticDefaults() { - DisplayName.SetDefault("Mine"); + DisplayName.SetDefault("Astral Mine"); } public override void SetDefaults() diff --git a/Projectiles/Boss/DoGBeam.cs b/Projectiles/Boss/DoGBeam.cs index b2ca13a6ef..ef7d032234 100644 --- a/Projectiles/Boss/DoGBeam.cs +++ b/Projectiles/Boss/DoGBeam.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Boss { public override void SetStaticDefaults() { - DisplayName.SetDefault("Laser"); + DisplayName.SetDefault("Portal Laser"); Main.projFrames[projectile.type] = 2; } diff --git a/Projectiles/Boss/DoGBeamPortal.cs b/Projectiles/Boss/DoGBeamPortal.cs index 4422c9473f..3ad64ed8a8 100644 --- a/Projectiles/Boss/DoGBeamPortal.cs +++ b/Projectiles/Boss/DoGBeamPortal.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - DisplayName.SetDefault("Portal"); + DisplayName.SetDefault("Beam Portal"); Main.projFrames[projectile.type] = 6; } diff --git a/Projectiles/Boss/DoGDeath.cs b/Projectiles/Boss/DoGDeath.cs index 01361ece12..45db3dcdfa 100644 --- a/Projectiles/Boss/DoGDeath.cs +++ b/Projectiles/Boss/DoGDeath.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Boss { public override void SetStaticDefaults() { - DisplayName.SetDefault("Death"); + DisplayName.SetDefault("Death Beam"); } public override void SetDefaults() diff --git a/Projectiles/Boss/DoGNebulaShot.cs b/Projectiles/Boss/DoGNebulaShot.cs index 79734fcd4d..4183b082c8 100644 --- a/Projectiles/Boss/DoGNebulaShot.cs +++ b/Projectiles/Boss/DoGNebulaShot.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Boss { public override void SetStaticDefaults() { - DisplayName.SetDefault("Laser"); + DisplayName.SetDefault("Death Laser"); } public override void SetDefaults() diff --git a/Projectiles/Boss/EssenceDust.cs b/Projectiles/Boss/EssenceDust.cs index 6a7b30d34c..d9c5f4876a 100644 --- a/Projectiles/Boss/EssenceDust.cs +++ b/Projectiles/Boss/EssenceDust.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Boss { public override void SetStaticDefaults() { - DisplayName.SetDefault("Dust"); + DisplayName.SetDefault("Cosmic Dust"); } public override void SetDefaults() diff --git a/Projectiles/Boss/FlareBomb.cs b/Projectiles/Boss/FlareBomb.cs index 77d8862d98..0562b65347 100644 --- a/Projectiles/Boss/FlareBomb.cs +++ b/Projectiles/Boss/FlareBomb.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Boss { public override void SetStaticDefaults() { - DisplayName.SetDefault("Bomb"); + DisplayName.SetDefault("Flare Bomb"); Main.projFrames[projectile.type] = 4; } diff --git a/Projectiles/Boss/FlareDust.cs b/Projectiles/Boss/FlareDust.cs index 6497f7f84f..f6aa1c260a 100644 --- a/Projectiles/Boss/FlareDust.cs +++ b/Projectiles/Boss/FlareDust.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Boss { public override void SetStaticDefaults() { - DisplayName.SetDefault("Dust"); + DisplayName.SetDefault("Flare Dust"); Main.projFrames[projectile.type] = 4; } diff --git a/Projectiles/Boss/FlareDust2.cs b/Projectiles/Boss/FlareDust2.cs index c6416763fb..dfe22345bc 100644 --- a/Projectiles/Boss/FlareDust2.cs +++ b/Projectiles/Boss/FlareDust2.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Boss { public override void SetStaticDefaults() { - DisplayName.SetDefault("Dust"); + DisplayName.SetDefault("Flare Bomb"); Main.projFrames[projectile.type] = 4; } diff --git a/Projectiles/FlareExplosionHuge.cs b/Projectiles/Boss/FlareExplosionHuge.cs similarity index 89% rename from Projectiles/FlareExplosionHuge.cs rename to Projectiles/Boss/FlareExplosionHuge.cs index cfbb0d263e..048f4803e8 100644 --- a/Projectiles/FlareExplosionHuge.cs +++ b/Projectiles/Boss/FlareExplosionHuge.cs @@ -5,13 +5,13 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Boss { public class FlareExplosionHuge : ModProjectile { public override void SetStaticDefaults() { - DisplayName.SetDefault("Explosion"); + DisplayName.SetDefault("Flare Explosion"); } public override void SetDefaults() @@ -23,7 +23,8 @@ namespace CalamityMod.Projectiles projectile.tileCollide = false; projectile.penetrate = -1; projectile.timeLeft = 60; - } + cooldownSlot = 1; + } public override void AI() { diff --git a/Projectiles/FlareExplosionHuge.png b/Projectiles/Boss/FlareExplosionHuge.png similarity index 100% rename from Projectiles/FlareExplosionHuge.png rename to Projectiles/Boss/FlareExplosionHuge.png diff --git a/Projectiles/Boss/FrostMist.cs b/Projectiles/Boss/FrostMist.cs index 3533e3e87f..4d934e35ce 100644 --- a/Projectiles/Boss/FrostMist.cs +++ b/Projectiles/Boss/FrostMist.cs @@ -8,40 +8,40 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Boss { - public class FrostMist : ModProjectile - { - public override void SetStaticDefaults() + public class FrostMist : ModProjectile + { + public override void SetStaticDefaults() { - DisplayName.SetDefault("Mist"); + DisplayName.SetDefault("Frost Mist"); Main.projFrames[projectile.type] = 6; } - - public override void SetDefaults() - { - projectile.width = 20; - projectile.height = 20; - projectile.hostile = true; - projectile.ignoreWater = true; - projectile.penetrate = 1; - projectile.timeLeft = 300; - projectile.alpha = 255; - } - public override void AI() - { - projectile.frameCounter++; + public override void SetDefaults() + { + projectile.width = 20; + projectile.height = 20; + projectile.hostile = true; + projectile.ignoreWater = true; + projectile.penetrate = 1; + projectile.timeLeft = 300; + projectile.alpha = 255; + } + + public override void AI() + { + projectile.frameCounter++; if (projectile.frameCounter > 4) { - projectile.frame++; - projectile.frameCounter = 0; + projectile.frame++; + projectile.frameCounter = 0; } if (projectile.frame > 3) { - projectile.frame = 0; + projectile.frame = 0; } - if (projectile.ai[1] == 0f) - { - for (int num621 = 0; num621 < 5; num621++) + if (projectile.ai[1] == 0f) + { + for (int num621 = 0; num621 < 5; num621++) { int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 187, 0f, 0f, 100, default(Color), 2f); Main.dust[num622].velocity *= 3f; @@ -51,27 +51,27 @@ namespace CalamityMod.Projectiles.Boss Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; } } - projectile.ai[1] = 1f; - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 30); - } - projectile.localAI[1] += 1f; - if (projectile.localAI[1] == 16f) - { - projectile.localAI[1] = 0f; - for (int l = 0; l < 12; l++) - { - Vector2 vector3 = Vector2.UnitX * (float)(-(float)projectile.width) / 2f; - vector3 += -Vector2.UnitY.RotatedBy((double)((float)l * 3.14159274f / 6f), default(Vector2)) * new Vector2(8f, 16f); - vector3 = vector3.RotatedBy((double)(projectile.rotation - 1.57079637f), default(Vector2)); - int num9 = Dust.NewDust(projectile.Center, 0, 0, 187, 0f, 0f, 160, default(Color), 1f); - Main.dust[num9].scale = 1.1f; - Main.dust[num9].noGravity = true; - Main.dust[num9].position = projectile.Center + vector3; - Main.dust[num9].velocity = projectile.velocity * 0.1f; - Main.dust[num9].velocity = Vector2.Normalize(projectile.Center - projectile.velocity * 3f - Main.dust[num9].position) * 1.25f; - } - } - if (projectile.localAI[0] == 0f) + projectile.ai[1] = 1f; + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 30); + } + projectile.localAI[1] += 1f; + if (projectile.localAI[1] == 16f) + { + projectile.localAI[1] = 0f; + for (int l = 0; l < 12; l++) + { + Vector2 vector3 = Vector2.UnitX * (float)(-(float)projectile.width) / 2f; + vector3 += -Vector2.UnitY.RotatedBy((double)((float)l * 3.14159274f / 6f), default(Vector2)) * new Vector2(8f, 16f); + vector3 = vector3.RotatedBy((double)(projectile.rotation - 1.57079637f), default(Vector2)); + int num9 = Dust.NewDust(projectile.Center, 0, 0, 187, 0f, 0f, 160, default(Color), 1f); + Main.dust[num9].scale = 1.1f; + Main.dust[num9].noGravity = true; + Main.dust[num9].position = projectile.Center + vector3; + Main.dust[num9].velocity = projectile.velocity * 0.1f; + Main.dust[num9].velocity = Vector2.Normalize(projectile.Center - projectile.velocity * 3f - Main.dust[num9].position) * 1.25f; + } + } + if (projectile.localAI[0] == 0f) { projectile.scale -= 0.01f; projectile.alpha += 10; @@ -91,7 +91,7 @@ namespace CalamityMod.Projectiles.Boss projectile.localAI[0] = 0f; } } - int num103 = (int)Player.FindClosest(projectile.Center, 1, 1); + int num103 = (int)Player.FindClosest(projectile.Center, 1, 1); projectile.ai[1] += 1f; if (projectile.ai[1] < 110f && projectile.ai[1] > 30f) { @@ -103,32 +103,33 @@ namespace CalamityMod.Projectiles.Boss projectile.velocity.Normalize(); projectile.velocity *= scaleFactor2; } - if (projectile.velocity.Length() < 12f) - { - projectile.velocity *= 1.02f; - } + if (projectile.velocity.Length() < 12f) + { + projectile.velocity *= 1.02f; + } projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; - Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0f) / 255f, ((255 - projectile.alpha) * 0.35f) / 255f, ((255 - projectile.alpha) * 0.35f) / 255f); - if (Main.rand.Next(3) == 0) - { - Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 187, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); - } - } - - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - Texture2D texture2D13 = Main.projectileTexture[projectile.type]; + Lighting.AddLight(projectile.Center, 0f, ((255 - projectile.alpha) * 0.35f) / 255f, ((255 - projectile.alpha) * 0.35f) / 255f); + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D texture2D13 = Main.projectileTexture[projectile.type]; int num214 = Main.projectileTexture[projectile.type].Height / Main.projFrames[projectile.type]; int y6 = num214 * projectile.frame; Main.spriteBatch.Draw(texture2D13, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y6, texture2D13.Width, num214)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)num214 / 2f), projectile.scale, SpriteEffects.None, 0f); return false; - } + } - public override void OnHitPlayer(Player target, int damage, bool crit) - { - target.AddBuff(BuffID.Frostburn, 240, true); - target.AddBuff(BuffID.Chilled, 120, true); - target.AddBuff(BuffID.Frozen, 30, true); - } - } + public override Color? GetAlpha(Color lightColor) + { + return new Color(200, 200, 200, projectile.alpha); + } + + public override void OnHitPlayer(Player target, int damage, bool crit) + { + target.AddBuff(BuffID.Frostburn, 240, true); + target.AddBuff(BuffID.Chilled, 120, true); + target.AddBuff(BuffID.Frozen, 30, true); + } + } } \ No newline at end of file diff --git a/Projectiles/Boss/GigaFlare.cs b/Projectiles/Boss/GigaFlare.cs index 9168c779b7..dec9f770d5 100644 --- a/Projectiles/Boss/GigaFlare.cs +++ b/Projectiles/Boss/GigaFlare.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Boss { public override void SetStaticDefaults() { - DisplayName.SetDefault("Flare"); + DisplayName.SetDefault("Fireball"); Main.projFrames[projectile.type] = 4; } diff --git a/Projectiles/Boss/GreatSandBlast.cs b/Projectiles/Boss/GreatSandBlast.cs index 72e0e9a752..71c1327802 100644 --- a/Projectiles/Boss/GreatSandBlast.cs +++ b/Projectiles/Boss/GreatSandBlast.cs @@ -1,74 +1,74 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Boss -{ - public class GreatSandBlast : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Great Sand Blast"); - } - - public override void SetDefaults() - { - projectile.width = 10; - projectile.height = 10; - projectile.hostile = true; - projectile.tileCollide = false; - projectile.penetrate = 1; - projectile.timeLeft = 300; - projectile.aiStyle = 1; - projectile.alpha = 255; - } - - public override void AI() - { - projectile.tileCollide = projectile.timeLeft < 240; - projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; - projectile.localAI[0] += 1f; - if (projectile.localAI[0] > 4f) - { - projectile.alpha -= 50; - if (projectile.alpha < 0) - { - projectile.alpha = 0; - } - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 85, 0f, 0f, 100, default(Color), 1f); - Main.dust[num469].noGravity = true; - Main.dust[num469].velocity *= 0f; - } - } - - public override void Kill(int timeLeft) - { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); - projectile.position = projectile.Center; - projectile.width = (projectile.height = 20); - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); - int num226 = 36; - for (int num227 = 0; num227 < num226; num227++) - { - Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; - vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default(Vector2)) + projectile.Center; - Vector2 vector7 = vector6 - projectile.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 85, vector7.X * 1.5f, vector7.Y * 1.5f, 100, default(Color), 1.2f); - Main.dust[num228].noGravity = true; - Main.dust[num228].noLight = true; - Main.dust[num228].velocity = vector7; - } - projectile.Damage(); - } - - public override void OnHitPlayer(Player target, int damage, bool crit) - { - target.velocity.X *= 0.5f; - target.velocity.Y *= 0.5f; - } - } +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Boss +{ + public class GreatSandBlast : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Great Sand Blast"); + } + + public override void SetDefaults() + { + projectile.width = 10; + projectile.height = 10; + projectile.hostile = true; + projectile.tileCollide = false; + projectile.penetrate = 1; + projectile.timeLeft = 300; + projectile.aiStyle = 1; + projectile.alpha = 255; + } + + public override void AI() + { + projectile.tileCollide = projectile.timeLeft < 240; + projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; + projectile.localAI[0] += 1f; + if (projectile.localAI[0] > 4f) + { + projectile.alpha -= 50; + if (projectile.alpha < 0) + { + projectile.alpha = 0; + } + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 85, 0f, 0f, 100, default(Color), 1f); + Main.dust[num469].noGravity = true; + Main.dust[num469].velocity *= 0f; + } + } + + public override void Kill(int timeLeft) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + projectile.position = projectile.Center; + projectile.width = (projectile.height = 20); + projectile.position.X = projectile.position.X - (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + int num226 = 36; + for (int num227 = 0; num227 < num226; num227++) + { + Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; + vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default(Vector2)) + projectile.Center; + Vector2 vector7 = vector6 - projectile.Center; + int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 85, vector7.X * 1.5f, vector7.Y * 1.5f, 100, default(Color), 1.2f); + Main.dust[num228].noGravity = true; + Main.dust[num228].noLight = true; + Main.dust[num228].velocity = vector7; + } + projectile.Damage(); + } + + public override void OnHitPlayer(Player target, int damage, bool crit) + { + target.velocity.X *= 0.5f; + target.velocity.Y *= 0.5f; + } + } } \ No newline at end of file diff --git a/Projectiles/HealOrbProv.cs b/Projectiles/Boss/HealOrbProv.cs similarity index 96% rename from Projectiles/HealOrbProv.cs rename to Projectiles/Boss/HealOrbProv.cs index 0e81d6a48a..b037e8fd34 100644 --- a/Projectiles/HealOrbProv.cs +++ b/Projectiles/Boss/HealOrbProv.cs @@ -6,7 +6,7 @@ using Terraria.ID; using Terraria.ModLoader; using Terraria.DataStructures; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Boss { public class HealOrbProv : ModProjectile { diff --git a/Projectiles/HealOrbProv.png b/Projectiles/Boss/HealOrbProv.png similarity index 100% rename from Projectiles/HealOrbProv.png rename to Projectiles/Boss/HealOrbProv.png diff --git a/Projectiles/HellfireExplosion.cs b/Projectiles/Boss/HellfireExplosion.cs similarity index 93% rename from Projectiles/HellfireExplosion.cs rename to Projectiles/Boss/HellfireExplosion.cs index 8b9864ff1f..ce04ce48a4 100644 --- a/Projectiles/HellfireExplosion.cs +++ b/Projectiles/Boss/HellfireExplosion.cs @@ -5,13 +5,13 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Boss { public class HellfireExplosion : ModProjectile { public override void SetStaticDefaults() { - DisplayName.SetDefault("Explosion"); + DisplayName.SetDefault("Brimstone Hellfire Explosion"); } public override void SetDefaults() diff --git a/Projectiles/HellfireExplosion.png b/Projectiles/Boss/HellfireExplosion.png similarity index 100% rename from Projectiles/HellfireExplosion.png rename to Projectiles/Boss/HellfireExplosion.png diff --git a/Projectiles/HiveBombExplosionHostile.cs b/Projectiles/Boss/HiveBombExplosionHostile.cs similarity index 86% rename from Projectiles/HiveBombExplosionHostile.cs rename to Projectiles/Boss/HiveBombExplosionHostile.cs index eda0ecb7e1..54386f8ca5 100644 --- a/Projectiles/HiveBombExplosionHostile.cs +++ b/Projectiles/Boss/HiveBombExplosionHostile.cs @@ -5,13 +5,13 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Boss { public class HiveBombExplosionHostile : ModProjectile { public override void SetStaticDefaults() { - DisplayName.SetDefault("Explosion"); + DisplayName.SetDefault("Hive Bomb Explosion"); } public override void SetDefaults() diff --git a/Projectiles/HiveBombExplosionHostile.png b/Projectiles/Boss/HiveBombExplosionHostile.png similarity index 100% rename from Projectiles/HiveBombExplosionHostile.png rename to Projectiles/Boss/HiveBombExplosionHostile.png diff --git a/Projectiles/Boss/HiveBombGoliath.cs b/Projectiles/Boss/HiveBombGoliath.cs index ec2d6832ca..76d365a99f 100644 --- a/Projectiles/Boss/HiveBombGoliath.cs +++ b/Projectiles/Boss/HiveBombGoliath.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Boss { public override void SetStaticDefaults() { - DisplayName.SetDefault("Bomb"); + DisplayName.SetDefault("Hive Bomb"); Main.projFrames[projectile.type] = 4; } diff --git a/Projectiles/Boss/HolyBlast.cs b/Projectiles/Boss/HolyBlast.cs index ad57d2e497..d7dbdeb140 100644 --- a/Projectiles/Boss/HolyBlast.cs +++ b/Projectiles/Boss/HolyBlast.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Boss { public override void SetStaticDefaults() { - DisplayName.SetDefault("Blast"); + DisplayName.SetDefault("Holy Blast"); Main.projFrames[projectile.type] = 4; } diff --git a/Projectiles/Boss/HolyBomb.cs b/Projectiles/Boss/HolyBomb.cs index 40b5c47581..cd3ae54cc7 100644 --- a/Projectiles/Boss/HolyBomb.cs +++ b/Projectiles/Boss/HolyBomb.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - DisplayName.SetDefault("Bomb"); + DisplayName.SetDefault("Holy Bomb"); Main.projFrames[projectile.type] = 4; } diff --git a/Projectiles/Boss/HolyBurnOrb.cs b/Projectiles/Boss/HolyBurnOrb.cs index 84ccac7ce6..d5309f7ed2 100644 --- a/Projectiles/Boss/HolyBurnOrb.cs +++ b/Projectiles/Boss/HolyBurnOrb.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Boss { public override void SetStaticDefaults() { - DisplayName.SetDefault("Orb"); + DisplayName.SetDefault("Holy Orb"); Main.projFrames[projectile.type] = 4; } @@ -67,7 +67,7 @@ namespace CalamityMod.Projectiles.Boss { Main.player[num487].statLife = Main.player[num487].statLifeMax2; } - if (Main.player[num487].statLife < 0) + if (Main.player[num487].statLife < 0 || CalamityWorld.armageddon) { Main.player[num487].KillMe(PlayerDeathReason.ByOther(12), 1000.0, 0, false); } diff --git a/Projectiles/Boss/HolyFire.cs b/Projectiles/Boss/HolyFire.cs index 3aca5435d3..c01d60b641 100644 --- a/Projectiles/Boss/HolyFire.cs +++ b/Projectiles/Boss/HolyFire.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Boss { public override void SetStaticDefaults() { - DisplayName.SetDefault("Fire"); + DisplayName.SetDefault("Holy Fire"); Main.projFrames[projectile.type] = 4; } diff --git a/Projectiles/Boss/HolyFire2.cs b/Projectiles/Boss/HolyFire2.cs index ade084a034..e03648ba23 100644 --- a/Projectiles/Boss/HolyFire2.cs +++ b/Projectiles/Boss/HolyFire2.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Boss { public override void SetStaticDefaults() { - DisplayName.SetDefault("Fire"); + DisplayName.SetDefault("Holy Fire"); Main.projFrames[projectile.type] = 4; } diff --git a/Projectiles/Boss/HolyFlare.cs b/Projectiles/Boss/HolyFlare.cs index 99a1216303..d5f9eb4a86 100644 --- a/Projectiles/Boss/HolyFlare.cs +++ b/Projectiles/Boss/HolyFlare.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Boss { public override void SetStaticDefaults() { - DisplayName.SetDefault("Flare"); + DisplayName.SetDefault("Holy Flare"); Main.projFrames[projectile.type] = 4; } diff --git a/Projectiles/Boss/HolyLight.cs b/Projectiles/Boss/HolyLight.cs index 79b25345d7..aa08768c30 100644 --- a/Projectiles/Boss/HolyLight.cs +++ b/Projectiles/Boss/HolyLight.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Boss { public override void SetStaticDefaults() { - DisplayName.SetDefault("Light"); + DisplayName.SetDefault("Holy Light"); Main.projFrames[projectile.type] = 4; } diff --git a/Projectiles/Boss/HolyShot.cs b/Projectiles/Boss/HolyShot.cs index 2e34f00c93..146b28f390 100644 --- a/Projectiles/Boss/HolyShot.cs +++ b/Projectiles/Boss/HolyShot.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Projectiles.Boss { public override void SetStaticDefaults() { - DisplayName.SetDefault("Spear"); + DisplayName.SetDefault("Holy Spear"); } public override void SetDefaults() diff --git a/Projectiles/Boss/HolySpear.cs b/Projectiles/Boss/HolySpear.cs index a5ea7871d0..62aa13950a 100644 --- a/Projectiles/Boss/HolySpear.cs +++ b/Projectiles/Boss/HolySpear.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Projectiles.Boss { public override void SetStaticDefaults() { - DisplayName.SetDefault("Spear"); + DisplayName.SetDefault("Holy Spear"); } public override void SetDefaults() diff --git a/Projectiles/Boss/IceBlast.cs b/Projectiles/Boss/IceBlast.cs index c260c35c47..8536c80bc7 100644 --- a/Projectiles/Boss/IceBlast.cs +++ b/Projectiles/Boss/IceBlast.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Boss { public override void SetStaticDefaults() { - DisplayName.SetDefault("Ice"); + DisplayName.SetDefault("Ice Blast"); } public override void SetDefaults() diff --git a/Projectiles/Boss/IceBomb.cs b/Projectiles/Boss/IceBomb.cs index 9ef110e3b7..489310a754 100644 --- a/Projectiles/Boss/IceBomb.cs +++ b/Projectiles/Boss/IceBomb.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Boss { public override void SetStaticDefaults() { - DisplayName.SetDefault("Bomb"); + DisplayName.SetDefault("Ice Bomb"); } public override void SetDefaults() diff --git a/Projectiles/Boss/IceRain.cs b/Projectiles/Boss/IceRain.cs index 3e336646aa..d44dd256d1 100644 --- a/Projectiles/Boss/IceRain.cs +++ b/Projectiles/Boss/IceRain.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Boss { public override void SetStaticDefaults() { - DisplayName.SetDefault("Ice"); + DisplayName.SetDefault("Ice Rain"); } public override void SetDefaults() diff --git a/Projectiles/Boss/LeviathanBomb.cs b/Projectiles/Boss/LeviathanBomb.cs index 971ba26af0..fe522e864d 100644 --- a/Projectiles/Boss/LeviathanBomb.cs +++ b/Projectiles/Boss/LeviathanBomb.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - DisplayName.SetDefault("Bomb"); + DisplayName.SetDefault("Meteor Vomit"); } public override void SetDefaults() diff --git a/Projectiles/Boss/MoltenBlast.cs b/Projectiles/Boss/MoltenBlast.cs index e71f4aa5dd..bfc73276a8 100644 --- a/Projectiles/Boss/MoltenBlast.cs +++ b/Projectiles/Boss/MoltenBlast.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Boss { public override void SetStaticDefaults() { - DisplayName.SetDefault("Blast"); + DisplayName.SetDefault("Molten Blast"); Main.projFrames[projectile.type] = 4; } diff --git a/Projectiles/Boss/MoltenBlob.cs b/Projectiles/Boss/MoltenBlob.cs index d5d588b421..8bc9459c3a 100644 --- a/Projectiles/Boss/MoltenBlob.cs +++ b/Projectiles/Boss/MoltenBlob.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Boss { public override void SetStaticDefaults() { - DisplayName.SetDefault("Blob"); + DisplayName.SetDefault("Molten Blob"); Main.projFrames[projectile.type] = 2; } @@ -22,8 +22,8 @@ namespace CalamityMod.Projectiles.Boss projectile.hostile = true; projectile.penetrate = -1; projectile.timeLeft = 1200; - cooldownSlot = 1; - } + cooldownSlot = 0; + } public override void AI() { diff --git a/Projectiles/Boss/MushBomb.cs b/Projectiles/Boss/MushBomb.cs index 93a530ba55..8edbce2c54 100644 --- a/Projectiles/Boss/MushBomb.cs +++ b/Projectiles/Boss/MushBomb.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Projectiles.Boss { public override void SetStaticDefaults() { - DisplayName.SetDefault("Bomb"); + DisplayName.SetDefault("Mushroom Shot"); Main.projFrames[projectile.type] = 4; } diff --git a/Projectiles/Boss/MushBombFall.cs b/Projectiles/Boss/MushBombFall.cs index c204872532..e4b2d8631b 100644 --- a/Projectiles/Boss/MushBombFall.cs +++ b/Projectiles/Boss/MushBombFall.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Projectiles.Boss { public override void SetStaticDefaults() { - DisplayName.SetDefault("Bomb"); + DisplayName.SetDefault("Falling Mushroom"); Main.projFrames[projectile.type] = 4; } diff --git a/Projectiles/Boss/Mushmash.cs b/Projectiles/Boss/Mushmash.cs index 1e1fb74f66..aaea1deda6 100644 --- a/Projectiles/Boss/Mushmash.cs +++ b/Projectiles/Boss/Mushmash.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Boss { public override void SetStaticDefaults() { - DisplayName.SetDefault("Mush"); + DisplayName.SetDefault("Mushmash"); } public override void SetDefaults() diff --git a/Projectiles/Boss/PhantomBlast.cs b/Projectiles/Boss/PhantomBlast.cs index fe2af03366..72cf0a9553 100644 --- a/Projectiles/Boss/PhantomBlast.cs +++ b/Projectiles/Boss/PhantomBlast.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Boss { public override void SetStaticDefaults() { - DisplayName.SetDefault("Blast"); + DisplayName.SetDefault("Phantom Blast"); } public override void SetDefaults() diff --git a/Projectiles/Boss/PhantomBlast2.cs b/Projectiles/Boss/PhantomBlast2.cs index a1bcd31473..f759fcd3e0 100644 --- a/Projectiles/Boss/PhantomBlast2.cs +++ b/Projectiles/Boss/PhantomBlast2.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Boss { public override void SetStaticDefaults() { - DisplayName.SetDefault("Blast"); + DisplayName.SetDefault("Potent Phantom Blast"); } public override void SetDefaults() diff --git a/Projectiles/Boss/PhantomGhostShot.cs b/Projectiles/Boss/PhantomGhostShot.cs new file mode 100644 index 0000000000..f103f6a65a --- /dev/null +++ b/Projectiles/Boss/PhantomGhostShot.cs @@ -0,0 +1,67 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Boss +{ + public class PhantomGhostShot : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Potent Phantom Spirit Shot"); + } + + public override void SetDefaults() + { + projectile.width = 14; + projectile.height = 14; + projectile.hostile = true; + projectile.alpha = 255; + projectile.tileCollide = false; + projectile.ignoreWater = true; + projectile.extraUpdates = 2; + projectile.penetrate = -1; + projectile.timeLeft = 600; + cooldownSlot = 1; + } + + public override void AI() + { + if (projectile.ai[1] == 0f) + { + projectile.ai[1] = 1f; + Main.PlaySound(SoundID.Item20, projectile.position); + } + projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; + projectile.localAI[0] += 1f; + if (projectile.localAI[0] == 6f) + { + for (int num151 = 0; num151 < 40; num151++) + { + int num152 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, 0f, 0f, 100, default(Color), 1f); + Main.dust[num152].velocity *= 3f; + Main.dust[num152].velocity += projectile.velocity * 0.75f; + Main.dust[num152].scale *= 1.2f; + Main.dust[num152].noGravity = true; + } + } + if (projectile.localAI[0] > 9f) + { + projectile.alpha -= 5; + if (projectile.alpha < 30) + { + projectile.alpha = 30; + } + } + } + + public override Color? GetAlpha(Color lightColor) + { + return new Color(100, 250, 250, projectile.alpha); + } + } +} \ No newline at end of file diff --git a/Projectiles/Boss/PhantomGhostShot.png b/Projectiles/Boss/PhantomGhostShot.png new file mode 100644 index 0000000000..bb6e4a3e19 Binary files /dev/null and b/Projectiles/Boss/PhantomGhostShot.png differ diff --git a/Projectiles/Boss/PhantomHookShot.cs b/Projectiles/Boss/PhantomHookShot.cs new file mode 100644 index 0000000000..e1ad91311e --- /dev/null +++ b/Projectiles/Boss/PhantomHookShot.cs @@ -0,0 +1,67 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Boss +{ + public class PhantomHookShot : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Phantom Hook Shot"); + } + + public override void SetDefaults() + { + projectile.width = 14; + projectile.height = 14; + projectile.hostile = true; + projectile.alpha = 255; + projectile.tileCollide = false; + projectile.ignoreWater = true; + projectile.extraUpdates = 2; + projectile.penetrate = -1; + projectile.timeLeft = 600; + cooldownSlot = 1; + } + + public override void AI() + { + if (projectile.ai[1] == 0f) + { + projectile.ai[1] = 1f; + Main.PlaySound(SoundID.Item20, projectile.position); + } + projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; + projectile.localAI[0] += 1f; + if (projectile.localAI[0] == 6f) + { + for (int num151 = 0; num151 < 40; num151++) + { + int num152 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 180, 0f, 0f, 100, default(Color), 1f); + Main.dust[num152].velocity *= 3f; + Main.dust[num152].velocity += projectile.velocity * 0.75f; + Main.dust[num152].scale *= 1.2f; + Main.dust[num152].noGravity = true; + } + } + if (projectile.localAI[0] > 9f) + { + projectile.alpha -= 5; + if (projectile.alpha < 30) + { + projectile.alpha = 30; + } + } + } + + public override Color? GetAlpha(Color lightColor) + { + return new Color(100, 250, 250, projectile.alpha); + } + } +} \ No newline at end of file diff --git a/Projectiles/Boss/PhantomHookShot.png b/Projectiles/Boss/PhantomHookShot.png new file mode 100644 index 0000000000..0e94ae8cb8 Binary files /dev/null and b/Projectiles/Boss/PhantomHookShot.png differ diff --git a/Projectiles/Boss/PhantomMine.cs b/Projectiles/Boss/PhantomMine.cs index eb7c2cc939..4afb3a57ea 100644 --- a/Projectiles/Boss/PhantomMine.cs +++ b/Projectiles/Boss/PhantomMine.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Boss { public override void SetStaticDefaults() { - DisplayName.SetDefault("Ghost Mine"); + DisplayName.SetDefault("Phantom Orb"); } public override void SetDefaults() diff --git a/Projectiles/Boss/PhantomShot.cs b/Projectiles/Boss/PhantomShot.cs index 503e6586a4..2c222ee022 100644 --- a/Projectiles/Boss/PhantomShot.cs +++ b/Projectiles/Boss/PhantomShot.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Boss { public override void SetStaticDefaults() { - DisplayName.SetDefault("Shot"); + DisplayName.SetDefault("Phantom Shot"); } public override void SetDefaults() diff --git a/Projectiles/Boss/PhantomShot2.cs b/Projectiles/Boss/PhantomShot2.cs index 55c9e5bda6..099b54ac7f 100644 --- a/Projectiles/Boss/PhantomShot2.cs +++ b/Projectiles/Boss/PhantomShot2.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Boss { public override void SetStaticDefaults() { - DisplayName.SetDefault("Shot"); + DisplayName.SetDefault("Potent Phantom Shot"); } public override void SetDefaults() diff --git a/Projectiles/PhoenixFire.cs b/Projectiles/Boss/PhoenixFire.cs similarity index 91% rename from Projectiles/PhoenixFire.cs rename to Projectiles/Boss/PhoenixFire.cs index bb22f92325..e80b43da3d 100644 --- a/Projectiles/PhoenixFire.cs +++ b/Projectiles/Boss/PhoenixFire.cs @@ -5,13 +5,13 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Boss { public class PhoenixFire : ModProjectile { public override void SetStaticDefaults() { - DisplayName.SetDefault("Fire"); + DisplayName.SetDefault("Phoenix Fire"); } public override void SetDefaults() @@ -37,7 +37,6 @@ namespace CalamityMod.Projectiles Main.dust[num458].velocity *= 0.5f; Main.dust[num458].velocity += projectile.velocity * 0.1f; } - return; } } } \ No newline at end of file diff --git a/Projectiles/PhoenixFire.png b/Projectiles/Boss/PhoenixFire.png similarity index 100% rename from Projectiles/PhoenixFire.png rename to Projectiles/Boss/PhoenixFire.png diff --git a/Projectiles/PlagueExplosion.cs b/Projectiles/Boss/PlagueExplosion.cs similarity index 93% rename from Projectiles/PlagueExplosion.cs rename to Projectiles/Boss/PlagueExplosion.cs index 9c0d228b3a..4e22b02d40 100644 --- a/Projectiles/PlagueExplosion.cs +++ b/Projectiles/Boss/PlagueExplosion.cs @@ -5,13 +5,13 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Boss { public class PlagueExplosion : ModProjectile { public override void SetStaticDefaults() { - DisplayName.SetDefault("Explosion"); + DisplayName.SetDefault("Plague Stinger Explosion"); } public override void SetDefaults() diff --git a/Projectiles/PlagueExplosion.png b/Projectiles/Boss/PlagueExplosion.png similarity index 100% rename from Projectiles/PlagueExplosion.png rename to Projectiles/Boss/PlagueExplosion.png diff --git a/Projectiles/Boss/PlagueStingerGoliath.cs b/Projectiles/Boss/PlagueStingerGoliath.cs index 60526d6800..e5c407e589 100644 --- a/Projectiles/Boss/PlagueStingerGoliath.cs +++ b/Projectiles/Boss/PlagueStingerGoliath.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Boss { public override void SetStaticDefaults() { - DisplayName.SetDefault("Stinger"); + DisplayName.SetDefault("Plague Homing Stinger"); } public override void SetDefaults() diff --git a/Projectiles/Boss/PlagueStingerGoliathV2.cs b/Projectiles/Boss/PlagueStingerGoliathV2.cs index c5e9800463..8e2e946b1c 100644 --- a/Projectiles/Boss/PlagueStingerGoliathV2.cs +++ b/Projectiles/Boss/PlagueStingerGoliathV2.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Boss { public override void SetStaticDefaults() { - DisplayName.SetDefault("Stinger"); + DisplayName.SetDefault("Exploding Plague Stinger"); } public override void SetDefaults() diff --git a/Projectiles/Boss/ProfanedSpear.cs b/Projectiles/Boss/ProfanedSpear.cs index 3571bc2572..53b9703066 100644 --- a/Projectiles/Boss/ProfanedSpear.cs +++ b/Projectiles/Boss/ProfanedSpear.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Boss { public override void SetStaticDefaults() { - DisplayName.SetDefault("Spear"); + DisplayName.SetDefault("Profaned Spear"); } public override void SetDefaults() diff --git a/Projectiles/Boss/ProvidenceCrystal.cs b/Projectiles/Boss/ProvidenceCrystal.cs index ea06849608..0764920ebe 100644 --- a/Projectiles/Boss/ProvidenceCrystal.cs +++ b/Projectiles/Boss/ProvidenceCrystal.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - DisplayName.SetDefault("Providence Crystal"); + DisplayName.SetDefault("Holy Crystal"); } public override void SetDefaults() @@ -23,7 +23,7 @@ namespace CalamityMod.Projectiles.Boss projectile.width = 160; projectile.height = 160; projectile.ignoreWater = true; - projectile.timeLeft = 3900; + projectile.timeLeft = CalamityWorld.death ? 2100 : 3600; projectile.alpha = 255; projectile.tileCollide = false; projectile.penetrate = -1; diff --git a/Projectiles/Boss/ProvidenceCrystalShard.cs b/Projectiles/Boss/ProvidenceCrystalShard.cs index fbb097f649..600df4947e 100644 --- a/Projectiles/Boss/ProvidenceCrystalShard.cs +++ b/Projectiles/Boss/ProvidenceCrystalShard.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Boss { public override void SetStaticDefaults() { - DisplayName.SetDefault("Crystal"); + DisplayName.SetDefault("Holy Crystal Shard"); } public override void SetDefaults() diff --git a/Projectiles/Boss/RavagerFlame.cs b/Projectiles/Boss/RavagerFlame.cs index e072d5cb46..aa7fa22c23 100644 --- a/Projectiles/Boss/RavagerFlame.cs +++ b/Projectiles/Boss/RavagerFlame.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Boss { public override void SetStaticDefaults() { - DisplayName.SetDefault("Flame"); + DisplayName.SetDefault("Blue Flame"); } public override void SetDefaults() diff --git a/Projectiles/Boss/RedLightningFeather.cs b/Projectiles/Boss/RedLightningFeather.cs index 9f9f72d138..416a12d3ba 100644 --- a/Projectiles/Boss/RedLightningFeather.cs +++ b/Projectiles/Boss/RedLightningFeather.cs @@ -25,7 +25,8 @@ namespace CalamityMod.Projectiles.Boss projectile.tileCollide = false; projectile.penetrate = 1; projectile.timeLeft = 1200; - } + cooldownSlot = 1; + } public override void AI() { diff --git a/Projectiles/Boss/SandBlast.cs b/Projectiles/Boss/SandBlast.cs index 2a6a979429..933daa7c3a 100644 --- a/Projectiles/Boss/SandBlast.cs +++ b/Projectiles/Boss/SandBlast.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Boss { public override void SetStaticDefaults() { - DisplayName.SetDefault("Sand"); + DisplayName.SetDefault("Sand Blast"); } public override void SetDefaults() diff --git a/Projectiles/Boss/SandPoisonCloud.cs b/Projectiles/Boss/SandPoisonCloud.cs index 0010d9f902..d32e225057 100644 --- a/Projectiles/Boss/SandPoisonCloud.cs +++ b/Projectiles/Boss/SandPoisonCloud.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Boss { public override void SetStaticDefaults() { - DisplayName.SetDefault("Cloud"); + DisplayName.SetDefault("Toxic Cloud"); Main.projFrames[projectile.type] = 4; } diff --git a/Projectiles/Boss/SandTooth.cs b/Projectiles/Boss/SandTooth.cs index 75e5a40a9a..8798090a98 100644 --- a/Projectiles/Boss/SandTooth.cs +++ b/Projectiles/Boss/SandTooth.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Boss { public override void SetStaticDefaults() { - DisplayName.SetDefault("Tooth"); + DisplayName.SetDefault("Sand Tooth"); } public override void SetDefaults() diff --git a/Projectiles/Boss/ScavengerLaser.cs b/Projectiles/Boss/ScavengerLaser.cs index ef8774d179..b6e18f0c8c 100644 --- a/Projectiles/Boss/ScavengerLaser.cs +++ b/Projectiles/Boss/ScavengerLaser.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Boss { public override void SetStaticDefaults() { - DisplayName.SetDefault("Laser"); + DisplayName.SetDefault("Homing Dart"); Main.projFrames[projectile.type] = 5; } diff --git a/Projectiles/Boss/ScavengerNuke.cs b/Projectiles/Boss/ScavengerNuke.cs index b65842db84..e334471562 100644 --- a/Projectiles/Boss/ScavengerNuke.cs +++ b/Projectiles/Boss/ScavengerNuke.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Boss { public override void SetStaticDefaults() { - DisplayName.SetDefault("Nuke"); + DisplayName.SetDefault("Homing Nuke"); Main.projFrames[projectile.type] = 5; } diff --git a/Projectiles/Boss/ShadeNimbusHostile.cs b/Projectiles/Boss/ShadeNimbusHostile.cs index 5dd5f04458..ac071b7b3e 100644 --- a/Projectiles/Boss/ShadeNimbusHostile.cs +++ b/Projectiles/Boss/ShadeNimbusHostile.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Boss { public override void SetStaticDefaults() { - DisplayName.SetDefault("Nimbus"); + DisplayName.SetDefault("Shade Nimbus"); Main.projFrames[projectile.type] = 6; } diff --git a/Projectiles/Boss/ShaderainHostile.cs b/Projectiles/Boss/ShaderainHostile.cs index b7f5bc3c90..fa866efab1 100644 --- a/Projectiles/Boss/ShaderainHostile.cs +++ b/Projectiles/Boss/ShaderainHostile.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Boss { public override void SetStaticDefaults() { - DisplayName.SetDefault("Rain"); + DisplayName.SetDefault("Cursed Rain"); } public override void SetDefaults() @@ -40,5 +40,15 @@ namespace CalamityMod.Projectiles.Boss Main.dust[num310].velocity += -projectile.oldVelocity * 0.25f; Main.dust[num310].scale = 0.95f; } - } + + public override Color? GetAlpha(Color lightColor) + { + return new Color(102, 255, 102, projectile.alpha); + } + + public override void OnHitPlayer(Player target, int damage, bool crit) + { + target.AddBuff(BuffID.CursedInferno, 90); + } + } } \ No newline at end of file diff --git a/Projectiles/Boss/SirenSong.cs b/Projectiles/Boss/SirenSong.cs index 39b07a5b75..508e95cf8d 100644 --- a/Projectiles/Boss/SirenSong.cs +++ b/Projectiles/Boss/SirenSong.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Boss { public override void SetStaticDefaults() { - DisplayName.SetDefault("Song"); + DisplayName.SetDefault("Musical Note"); } public override void SetDefaults() @@ -46,11 +46,19 @@ namespace CalamityMod.Projectiles.Boss if (projectile.ai[1] == 0f) { projectile.ai[1] = 1f; - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 26); - } - } + float soundPitch = (Main.rand.NextFloat() - 0.5f) * 0.5f; + Main.harpNote = soundPitch; + Main.PlaySound(SoundID.Item26, projectile.position); + } + Lighting.AddLight(projectile.Center, 0.7f, 0.5f, 0f); + } - public override void OnHitPlayer(Player target, int damage, bool crit) + public override Color? GetAlpha(Color lightColor) + { + return new Color(255, 255, 255, 0); + } + + public override void OnHitPlayer(Player target, int damage, bool crit) { target.AddBuff(BuffID.Confused, 120); } diff --git a/Projectiles/Boss/SirenSong.png b/Projectiles/Boss/SirenSong.png index 2d410bffb7..418fb2622c 100644 Binary files a/Projectiles/Boss/SirenSong.png and b/Projectiles/Boss/SirenSong.png differ diff --git a/Projectiles/SkyFlare.cs b/Projectiles/Boss/SkyFlare.cs similarity index 95% rename from Projectiles/SkyFlare.cs rename to Projectiles/Boss/SkyFlare.cs index 472a09a1fb..4ccf9b13ff 100644 --- a/Projectiles/SkyFlare.cs +++ b/Projectiles/Boss/SkyFlare.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Boss { public class SkyFlare : ModProjectile { @@ -14,7 +14,7 @@ namespace CalamityMod.Projectiles public override void SetStaticDefaults() { - DisplayName.SetDefault("Flare"); + DisplayName.SetDefault("Sky Flare"); Main.projFrames[projectile.type] = 5; } diff --git a/Projectiles/SkyFlare.png b/Projectiles/Boss/SkyFlare.png similarity index 100% rename from Projectiles/SkyFlare.png rename to Projectiles/Boss/SkyFlare.png diff --git a/Projectiles/Boss/SkyFlareRevenge.cs b/Projectiles/Boss/SkyFlareRevenge.cs index f7f9cad68b..7214d4c4ab 100644 --- a/Projectiles/Boss/SkyFlareRevenge.cs +++ b/Projectiles/Boss/SkyFlareRevenge.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Boss { public override void SetStaticDefaults() { - DisplayName.SetDefault("Flare"); + DisplayName.SetDefault("Sky Flare"); Main.projFrames[projectile.type] = 5; } diff --git a/Projectiles/Boss/VileClot.cs b/Projectiles/Boss/VileClot.cs index 7f72e8c5f6..1aaffe7138 100644 --- a/Projectiles/Boss/VileClot.cs +++ b/Projectiles/Boss/VileClot.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Boss { public override void SetStaticDefaults() { - DisplayName.SetDefault("Clot"); + DisplayName.SetDefault("Vile Clot"); } public override void SetDefaults() @@ -20,8 +20,7 @@ namespace CalamityMod.Projectiles.Boss projectile.height = 6; projectile.hostile = true; projectile.penetrate = 1; - projectile.aiStyle = 1; - aiType = 1; + projectile.timeLeft = 300; } public override void AI() diff --git a/Projectiles/Boss/WaterSpear.cs b/Projectiles/Boss/WaterSpear.cs index 53dfe0ce7b..1c50368fe7 100644 --- a/Projectiles/Boss/WaterSpear.cs +++ b/Projectiles/Boss/WaterSpear.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Boss { public override void SetStaticDefaults() { - DisplayName.SetDefault("Spear"); + DisplayName.SetDefault("Water Spear"); } public override void SetDefaults() @@ -66,14 +66,15 @@ namespace CalamityMod.Projectiles.Boss } } projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; - Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0f) / 255f, ((255 - projectile.alpha) * 0.05f) / 255f, ((255 - projectile.alpha) * 0.35f) / 255f); - if (Main.rand.Next(3) == 0) - { - Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 33, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); - } + Lighting.AddLight(projectile.Center, 0f, ((255 - projectile.alpha) * 0.05f) / 255f, ((255 - projectile.alpha) * 0.35f) / 255f); } - - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + + public override Color? GetAlpha(Color lightColor) + { + return new Color(200, 200, 200, projectile.alpha); + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { Texture2D tex = Main.projectileTexture[projectile.type]; spriteBatch.Draw(tex, projectile.Center - Main.screenPosition, null, projectile.GetAlpha(lightColor), projectile.rotation, tex.Size() / 2f, projectile.scale, SpriteEffects.None, 0f); diff --git a/Projectiles/Boss/WaterSpear.png b/Projectiles/Boss/WaterSpear.png index c5b595d096..b923a9ea8b 100644 Binary files a/Projectiles/Boss/WaterSpear.png and b/Projectiles/Boss/WaterSpear.png differ diff --git a/Projectiles/Boss/YharonFireball.cs b/Projectiles/Boss/YharonFireball.cs index a9b58001e5..51b99704ac 100644 --- a/Projectiles/Boss/YharonFireball.cs +++ b/Projectiles/Boss/YharonFireball.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - DisplayName.SetDefault("Fire"); + DisplayName.SetDefault("Dragon Fireball"); } public override void SetDefaults() @@ -29,7 +29,8 @@ namespace CalamityMod.Projectiles.Boss projectile.timeLeft = 120; projectile.aiStyle = 1; aiType = 686; - } + cooldownSlot = 1; + } public override bool PreAI() { diff --git a/Projectiles/Boss/YharonFireball2.cs b/Projectiles/Boss/YharonFireball2.cs index 563a52e68d..cde48e815e 100644 --- a/Projectiles/Boss/YharonFireball2.cs +++ b/Projectiles/Boss/YharonFireball2.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Boss { public override void SetStaticDefaults() { - DisplayName.SetDefault("Fire"); + DisplayName.SetDefault("Dragon Fireball"); } public override void SetDefaults() @@ -23,7 +23,8 @@ namespace CalamityMod.Projectiles.Boss projectile.alpha = 255; projectile.penetrate = -1; projectile.timeLeft = 1200; - } + cooldownSlot = 1; + } public override void AI() { diff --git a/Projectiles/Boss/YharonFireballHoming.cs b/Projectiles/Boss/YharonFireballHoming.cs index 93ef95104f..e8fa6c8d89 100644 --- a/Projectiles/Boss/YharonFireballHoming.cs +++ b/Projectiles/Boss/YharonFireballHoming.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Boss { public override void SetStaticDefaults() { - DisplayName.SetDefault("Fire"); + DisplayName.SetDefault("Homing Dragon Fireball"); } public override void SetDefaults() @@ -23,7 +23,8 @@ namespace CalamityMod.Projectiles.Boss projectile.alpha = 255; projectile.penetrate = -1; projectile.timeLeft = 1200; - } + cooldownSlot = 1; + } public override void AI() { diff --git a/Projectiles/Boss/desktop.ini b/Projectiles/Boss/desktop.ini new file mode 100644 index 0000000000..5c9af8eb7b --- /dev/null +++ b/Projectiles/Boss/desktop.ini @@ -0,0 +1,2 @@ +[LocalizedFileNames] +WaterSpear.png=@WaterSpear,0 diff --git a/Projectiles/BrimstoneLaserSummon.cs b/Projectiles/BrimstoneLaserSummon.cs deleted file mode 100644 index f8a56cbbcd..0000000000 --- a/Projectiles/BrimstoneLaserSummon.cs +++ /dev/null @@ -1,58 +0,0 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles -{ - public class BrimstoneLaserSummon : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Laser"); - } - - public override void SetDefaults() - { - projectile.width = 32; - projectile.height = 2; - projectile.aiStyle = 1; - aiType = 100; - projectile.friendly = true; - projectile.ignoreWater = true; - projectile.minion = true; - projectile.minionSlots = 0; - projectile.penetrate = 1; - projectile.alpha = 120; - projectile.timeLeft = 300; - } - - public override void AI() - { - Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0.5f) / 255f, ((255 - projectile.alpha) * 0.05f) / 255f, ((255 - projectile.alpha) * 0.05f) / 255f); - projectile.velocity.X *= 1.05f; - projectile.velocity.Y *= 1.05f; - projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; - projectile.velocity.Y += projectile.ai[0]; - if (Main.rand.Next(2) == 0) - { - Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 235, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); - } - } - - public override void Kill(int timeLeft) - { - for (int k = 0; k < 5; k++) - { - Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 235, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); - } - } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(mod.BuffType("BrimstoneFlames"), 60); - } - } -} \ No newline at end of file diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 28a5c0b62b..fee999ba13 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -14,408 +14,416 @@ using CalamityMod.Items.CalamityCustomThrowingDamage; namespace CalamityMod.Projectiles { - public class CalamityGlobalProjectile : GlobalProjectile - { - #region InstancePerEntity - public override bool InstancePerEntity - { - get - { - return true; - } - } - #endregion - - public float spawnedPlayerMinionDamageValue = 1f; - - public int spawnedPlayerMinionProjectileDamageValue = 0; - - public bool setPlayerMinionDamageValue = true; - - public int counter = 0; - - public int counter2 = 0; - - #region AI - public override void AI(Projectile projectile) - { - if (setPlayerMinionDamageValue) - { - setPlayerMinionDamageValue = false; - spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; - spawnedPlayerMinionProjectileDamageValue = projectile.damage; - } - if (projectile.type == ProjectileID.HallowStar) - { - if (projectile.ai[0] == 1f) - { - projectile.ranged = false; - projectile.melee = true; - } - } - else if (projectile.type == ProjectileID.Meteor1 || projectile.type == ProjectileID.Meteor2 || projectile.type == ProjectileID.Meteor3) - { - if (projectile.ai[0] == 1f) - { - projectile.magic = false; - projectile.melee = true; - projectile.tileCollide = false; - } - } - else if (projectile.type == ProjectileID.GoldenShowerFriendly) - { - if (projectile.ai[0] == 1f) - { - projectile.magic = false; - projectile.melee = true; - } - } - else if (projectile.type == ProjectileID.MiniSharkron) - { - if (projectile.ai[0] == 1f) - projectile.melee = true; - else if (projectile.ai[0] == 2f) - projectile.ranged = true; - } - else if (projectile.type == ProjectileID.LostSoulFriendly) - { - if (projectile.ai[0] == 1f) - { - projectile.magic = false; - projectile.ranged = true; - } - } - else if (projectile.type == ProjectileID.LunarFlare) - { - if (Main.player[projectile.owner].inventory[Main.player[projectile.owner].selectedItem].type == mod.ItemType("StellarStriker")) - { - projectile.magic = false; - projectile.melee = true; - } - } - else if (projectile.type == ProjectileID.RubyBolt || projectile.type == ProjectileID.SapphireBolt || projectile.type == ProjectileID.AmethystBolt) - { - if (projectile.ai[0] == 1f) - { - projectile.magic = false; - projectile.melee = true; - } - } - else if (projectile.type == ProjectileID.SolarWhipSwordExplosion) - { - if (Main.player[projectile.owner].inventory[Main.player[projectile.owner].selectedItem].type == mod.ItemType("TruePaladinsHammer") || - Main.player[projectile.owner].inventory[Main.player[projectile.owner].selectedItem].type == mod.ItemType("FlameScythe")) - { - projectile.melee = false; - } - else if (Main.player[projectile.owner].inventory[Main.player[projectile.owner].selectedItem].ranged) - { - projectile.melee = false; - projectile.ranged = true; - } - else if (Main.player[projectile.owner].inventory[Main.player[projectile.owner].selectedItem].type == mod.ItemType("PurgeGuzzler") || - Main.player[projectile.owner].inventory[Main.player[projectile.owner].selectedItem].type == mod.ItemType("Lazhar")) - { - projectile.melee = false; - projectile.magic = true; - } - } - else if (projectile.type == ProjectileID.GiantBee || projectile.type == ProjectileID.Bee || projectile.type == ProjectileID.Wasp) - { - if (projectile.timeLeft > 570) //all of these have a time left of 600 or 660 - { - if (Main.player[projectile.owner].inventory[Main.player[projectile.owner].selectedItem].type == mod.ItemType("PlagueKeeper")) - { - projectile.magic = false; - projectile.melee = true; - } - else if (Main.player[projectile.owner].inventory[Main.player[projectile.owner].selectedItem].type == mod.ItemType("TheSwarmer")) - { - projectile.magic = true; - } - else if (Main.player[projectile.owner].inventory[Main.player[projectile.owner].selectedItem].type == mod.ItemType("TheHive") || - Main.player[projectile.owner].inventory[Main.player[projectile.owner].selectedItem].type == mod.ItemType("Malevolence") || - Main.player[projectile.owner].inventory[Main.player[projectile.owner].selectedItem].type == ItemID.BeesKnees) - { - projectile.magic = false; - projectile.ranged = true; - } - } - } - if (Main.player[projectile.owner].GetModPlayer(mod).eQuiver && projectile.ranged && - projectile.friendly && CalamityMod.rangedProjectileExceptionList.TrueForAll(x => projectile.type != x)) - { - if (Main.rand.Next(200) > 198) - { - float spread = 180f * 0.0174f; - double startAngle = Math.Atan2(projectile.velocity.X, projectile.velocity.Y) - spread / 2; - double deltaAngle = spread / 8f; - double offsetAngle; - int i; - for (i = 0; i < 1; i++) - { - offsetAngle = (startAngle + deltaAngle * (i + i * i) / 2f) + 32f * i; - if (projectile.owner == Main.myPlayer) - { - int projectile1 = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(Math.Sin(offsetAngle) * 8f), (float)(Math.Cos(offsetAngle) * 8f), projectile.type, (int)((double)projectile.damage * 0.5), projectile.knockBack, projectile.owner, 0f, 0f); - int projectile2 = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 8f), (float)(-Math.Cos(offsetAngle) * 8f), projectile.type, (int)((double)projectile.damage * 0.5), projectile.knockBack, projectile.owner, 0f, 0f); - Main.projectile[projectile1].ranged = false; - Main.projectile[projectile2].ranged = false; - Main.projectile[projectile1].timeLeft = 60; - Main.projectile[projectile2].timeLeft = 60; - Main.projectile[projectile1].noDropItem = true; - Main.projectile[projectile2].noDropItem = true; - } - } - } - } - if (Main.player[projectile.owner].GetModPlayer(mod).nanotech && - CalamityMod.throwingProjectileList.Contains(projectile.type) && !projectile.melee && projectile.friendly) - { - counter++; - if (counter >= 90) - { - counter = 0; - if (projectile.owner == Main.myPlayer && Main.player[projectile.owner].ownedProjectileCounts[mod.ProjectileType("Nanotech")] < 30) - { - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, mod.ProjectileType("Nanotech"), - (int)((double)projectile.damage * 0.33), 0f, projectile.owner, 0f, 0f); - } - } - } - if (Main.player[projectile.owner].GetModPlayer(mod).daedalusSplit && - CalamityMod.throwingProjectileList.Contains(projectile.type) && !projectile.melee && projectile.friendly) - { - counter2++; - if (counter2 >= 30) - { - counter2 = 0; - if (projectile.owner == Main.myPlayer && Main.player[projectile.owner].ownedProjectileCounts[90] < 30) - { - for (int num252 = 0; num252 < 2; num252++) - { - Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - while (value15.X == 0f && value15.Y == 0f) - { - value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - } - value15.Normalize(); - value15 *= (float)Main.rand.Next(70, 101) * 0.1f; - int shard = Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), value15.X, value15.Y, 90, (int)((double)projectile.damage * 0.25), 0f, projectile.owner, 0f, 0f); - Main.projectile[shard].ranged = false; - } - } - } - } - } - #endregion - - #region PostAI - public override void PostAI(Projectile projectile) - { - int x = (int)(projectile.Center.X / 16f); - int y = (int)(projectile.Center.Y / 16f); - for (int i = x - 1; i <= x + 1; i++) - { - for (int j = y - 1; j <= y + 1; j++) - { - if (projectile.type == ProjectileID.PureSpray) - { - CalamityWorld.ConvertFromAstral(i, j, ConvertType.Pure); - } - if (projectile.type == ProjectileID.CorruptSpray) - { - CalamityWorld.ConvertFromAstral(i, j, ConvertType.Corrupt); - } - if (projectile.type == ProjectileID.CrimsonSpray) - { - CalamityWorld.ConvertFromAstral(i, j, ConvertType.Crimson); - } - if (projectile.type == ProjectileID.HallowSpray) - { - CalamityWorld.ConvertFromAstral(i, j, ConvertType.Hallow); - } - } - } - } - #endregion - - #region ModifyHitNPC - public override void ModifyHitNPC(Projectile projectile, NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) + public class CalamityGlobalProjectile : GlobalProjectile + { + #region InstancePerEntity + public override bool InstancePerEntity { - if (projectile.ranged) - { - //BULLETS + get + { + return true; + } + } + #endregion - //musket ball: base 100 + 7 = 107 - //silver: base 100 + 9 = 109 - //meteor shot: base 100 + 9 = 109 pierces once - //acceleration: base 100 + bullet damage 9 = 109 speeds up while travelling - //flash: base 100 + bullet damage 7 = 107 + (flash damage 107 * 0.25 = 26) = 133 AoE confusion - //superball: base 100 + bullet damage 6 = 106 bounces a fucking shitload of times and speeds up - //enhanced nano: base 100 + bullet damage 12 = 112 + (nanobot damage 112 * 0.3 = 33 * 2 nanobots = 66) = 178 - //crystal: base 100 + bullet damage 9 = 109 + (crystal shard damage 109 * 0.6 = 65 * 0.6 = 39 * 3 total shards = 117) = 226 - //frostspark: base 100 + bullet damage 11 = 111 + (explosion damage 111 * 0.5 = 55) = 166 - //icy: base 100 + 10 bullet damage = 110 + (ice shard damage 110 * 0.5 = 55 * 0.6 = 33 * 2 total shards = 66) = 176 - //verium: base 100 + bullet damage 8 = 108 * 0.8 = 86 homing - //chloro: base 100 + bullet damage 10 = 110 * 0.8 = 88 homing - //terra: base 100 + bullet damage 9 = 109 + (terra shard damage 109 * 0.5 = 54 * 2 total shards = 106) = 215 - //acid: base 100 + bullet damage 36 = 136 does more based on enemy defense - //hyperius: base 100 + bullet damage 21 = 121 + (hyperius second bullet damage 121 * 0.8 = 96) = 217 - //holy fire: base 100 + bullet damage 27 = 127 + (explosion damage 127 * 0.85 = 107) = 234 + public bool rogue = false; - //ARROWS + public bool setDamageValues = true; - //holy arrow: base 100 + arrow damage 13 = 113 + (star damage 113 * 0.5 = 56 * 0.7 = 39 * 2 total stars = 78) = 191 - //terra arrow: base 100 + arrow damage 9 = 109 + (terra arrow split damage 109 * 0.5 = 54 * 2 total arrows = 106) = 215 - //elysian arrow: base 100 + arrow damage 20 = 120 + meteor damage 120 = 240 - //napalm arrow: base 100 + arrow damage 13 = 113 + (fire shard damage 113 * 0.3 = 33 * 3 total shards = 99) = 212 - //icicle arrow: base 100 + arrow damage 14 = 114 + (ice shard damage 114 * 0.5 = 57 * 0.6 = 34 * 3 total shards = 102) = 216 - //bloodfire arrow: base 100 + arrow damage 40 = 140 but it heals so it's alright - //arctic arrow: base 100 + arrow damage 16 = 116 but it freezes enemies so it's alright - //vanquisher arrow: base 100 + arrow damage 33 = 133 + split arrow damage 93 = 226 fine for endgame arrow - switch (projectile.type) - { - case ProjectileID.CrystalShard: - damage = (int)((double)damage * 0.6); - break; - case ProjectileID.ChlorophyteBullet: - damage = (int)((double)damage * 0.8); - break; - case ProjectileID.HallowStar: - damage = (int)((double)damage * 0.7); - break; - } - if (projectile.type == mod.ProjectileType("VeriumBullet")) - { - damage = (int)((double)damage * 0.8); - } - else if (projectile.type == mod.ProjectileType("FrostsparkBullet")) - { - if (target.buffImmune[mod.BuffType("GlacialState")]) - { - damage = (int)((double)damage * 1.2); - } - } - else if (projectile.type == mod.ProjectileType("AcidBullet")) - { - int defenseAdd = (int)((double)target.defense * 0.2); //100 defense * 0.2 = 20 - damage = damage + defenseAdd; - } - } - if (projectile.owner == Main.myPlayer) - { - if (CalamityMod.throwingProjectileList.Contains(projectile.type) && !projectile.melee) - { - crit = (Main.rand.Next(1, 101) < CalamityCustomThrowingDamagePlayer.ModPlayer(Main.player[projectile.owner]).throwingCrit); - } - if (projectile.minion || projectile.sentry || CalamityMod.projectileMinionList.Contains(projectile.type)) - { - Player player = Main.player[projectile.owner]; - if (player.minionDamage != spawnedPlayerMinionDamageValue) - { - float damage2 = (((float)spawnedPlayerMinionProjectileDamageValue / spawnedPlayerMinionDamageValue) * player.minionDamage); - damage = Main.DamageVar(damage2); - } - if (CalamityWorld.revenge) - { - if (!player.inventory[player.selectedItem].summon && - (player.inventory[player.selectedItem].melee || - player.inventory[player.selectedItem].ranged || - player.inventory[player.selectedItem].magic || - player.inventory[player.selectedItem].thrown) && - player.inventory[player.selectedItem].hammer == 0 && - player.inventory[player.selectedItem].pick == 0 && - player.inventory[player.selectedItem].axe == 0) - { - if (NPC.downedMoonlord) - { - damage = (int)((double)damage * 0.33); - } - else if (Main.hardMode) - { - damage = (int)((double)damage * 0.66); - } - else - { - damage = (int)((double)damage * 0.9); - } - } - else if (!NPC.downedMoonlord) - { - damage = (int)((double)damage * 1.1); - } - } - } - if (Main.player[projectile.owner].GetModPlayer(mod).screwdriver) - { - if (projectile.penetrate > 1 || projectile.penetrate == -1) - { - damage = (int)((double)damage * 1.1); - } - } - if (Main.player[projectile.owner].GetModPlayer(mod).sPower) - { - if (projectile.minion || CalamityMod.projectileMinionList.Contains(projectile.type)) - { - damage = (int)((double)damage * 1.1); - } - } - if (CalamityWorld.revenge) - { - if (Main.player[projectile.owner].GetModPlayer(mod).rageMode && - Main.player[projectile.owner].GetModPlayer(mod).adrenalineMode) - { - if (projectile.minion || projectile.sentry || CalamityMod.projectileMinionList.Contains(projectile.type) || - projectile.melee || projectile.ranged || projectile.magic || CalamityMod.throwingProjectileList.Contains(projectile.type)) - { - damage = (int)((double)damage * (CalamityWorld.death ? 9.0 : 3.0)); - } - } - else if (Main.player[projectile.owner].GetModPlayer(mod).rageMode) - { - if (projectile.minion || projectile.sentry || CalamityMod.projectileMinionList.Contains(projectile.type) || - projectile.melee || projectile.ranged || projectile.magic || CalamityMod.throwingProjectileList.Contains(projectile.type)) - { - double rageDamageBoost = 0.0 + - (Main.player[projectile.owner].GetModPlayer(mod).rageBoostOne ? (CalamityWorld.death ? 0.6 : 0.15) : 0.0) + //3.6 or 1.65 - (Main.player[projectile.owner].GetModPlayer(mod).rageBoostTwo ? (CalamityWorld.death ? 0.6 : 0.15) : 0.0) + //4.2 or 1.8 - (Main.player[projectile.owner].GetModPlayer(mod).rageBoostThree ? (CalamityWorld.death ? 0.6 : 0.15) : 0.0); //4.8 or 1.95 - double rageDamage = (CalamityWorld.death ? 3.0 : 1.5) + rageDamageBoost; - damage = (int)((double)damage * rageDamage); - } - } - else if (Main.player[projectile.owner].GetModPlayer(mod).adrenalineMode) - { - if (projectile.minion || projectile.sentry || CalamityMod.projectileMinionList.Contains(projectile.type) || - projectile.melee || projectile.ranged || projectile.magic || CalamityMod.throwingProjectileList.Contains(projectile.type)) - { - damage = (int)((double)damage * ((CalamityWorld.death ? 7.0 : 2.5) * Main.player[projectile.owner].GetModPlayer(mod).adrenalineDmgMult)); - } - } - } - if (Main.player[projectile.owner].GetModPlayer(mod).uberBees && - (projectile.type == ProjectileID.GiantBee || projectile.type == ProjectileID.Bee || projectile.type == ProjectileID.Wasp)) - { - if (Main.player[projectile.owner].inventory[Main.player[projectile.owner].selectedItem].type == mod.ItemType("TheSwarmer") || - Main.player[projectile.owner].inventory[Main.player[projectile.owner].selectedItem].type == mod.ItemType("PlagueKeeper")) - { - damage = damage + Main.rand.Next(10, 21); - } - else - { - damage = damage + Main.rand.Next(70, 101); - projectile.penetrate = 1; - } - } - } + public float spawnedPlayerMinionDamageValue = 1f; + + public int spawnedPlayerMinionProjectileDamageValue = 0; + + public int counter = 0; + + public int counter2 = 0; + + #region AI + public override void AI(Projectile projectile) + { + if (projectile.modProjectile != null && projectile.modProjectile.mod.Name.Equals("CalamityMod")) + goto SKIP_CALAMITY; + if ((projectile.minion || projectile.sentry) && !ProjectileID.Sets.StardustDragon[projectile.type]) //For all other mods and vanilla, exclude dragon due to bugs + { + if (setDamageValues) + { + spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + spawnedPlayerMinionProjectileDamageValue = projectile.damage; + setDamageValues = false; + } + if (Main.player[projectile.owner].minionDamage != spawnedPlayerMinionDamageValue) + { + int damage2 = (int)(((float)spawnedPlayerMinionProjectileDamageValue / spawnedPlayerMinionDamageValue) * Main.player[projectile.owner].minionDamage); + projectile.damage = damage2; + } + } + SKIP_CALAMITY: + if (projectile.type == ProjectileID.HallowStar) + { + if (projectile.ai[0] == 1f) + { + projectile.ranged = false; + projectile.melee = true; + } + else if (projectile.ai[0] == 2f) + { + projectile.ranged = false; + rogue = true; + } + } + else if (projectile.type == ProjectileID.FallingStar) + { + if (projectile.ai[0] == 2f) + { + rogue = true; + } + } + else if (projectile.type == ProjectileID.Meteor1 || projectile.type == ProjectileID.Meteor2 || projectile.type == ProjectileID.Meteor3) + { + if (projectile.ai[0] == 1f) + { + projectile.magic = false; + projectile.melee = true; + projectile.tileCollide = false; + } + } + else if (projectile.type == ProjectileID.GoldenShowerFriendly) + { + if (projectile.ai[0] == 1f) + { + projectile.magic = false; + projectile.melee = true; + } + } + else if (projectile.type == ProjectileID.MiniSharkron) + { + if (projectile.ai[0] == 1f) + projectile.melee = true; + else if (projectile.ai[0] == 2f) + projectile.ranged = true; + } + else if (projectile.type == ProjectileID.LostSoulFriendly) + { + if (projectile.ai[0] == 1f) + { + projectile.magic = false; + projectile.ranged = true; + } + } + else if (projectile.type == ProjectileID.LunarFlare) + { + if (Main.player[projectile.owner].inventory[Main.player[projectile.owner].selectedItem].type == mod.ItemType("StellarStriker")) + { + projectile.magic = false; + projectile.melee = true; + } + } + else if (projectile.type == ProjectileID.RubyBolt || projectile.type == ProjectileID.SapphireBolt || projectile.type == ProjectileID.AmethystBolt) + { + if (projectile.ai[0] == 1f) + { + projectile.magic = false; + projectile.melee = true; + } + } + else if (projectile.type == ProjectileID.SolarWhipSwordExplosion) + { + if (Main.player[projectile.owner].inventory[Main.player[projectile.owner].selectedItem].type == mod.ItemType("TruePaladinsHammer") || + Main.player[projectile.owner].inventory[Main.player[projectile.owner].selectedItem].type == mod.ItemType("FlameScythe")) + { + projectile.melee = false; + } + else if (Main.player[projectile.owner].inventory[Main.player[projectile.owner].selectedItem].ranged) + { + projectile.melee = false; + projectile.ranged = true; + } + else if (Main.player[projectile.owner].inventory[Main.player[projectile.owner].selectedItem].type == mod.ItemType("PurgeGuzzler") || + Main.player[projectile.owner].inventory[Main.player[projectile.owner].selectedItem].type == mod.ItemType("Lazhar")) + { + projectile.melee = false; + projectile.magic = true; + } + } + else if (projectile.type == ProjectileID.GiantBee || projectile.type == ProjectileID.Bee || projectile.type == ProjectileID.Wasp) + { + if (projectile.timeLeft > 570) //all of these have a time left of 600 or 660 + { + if (Main.player[projectile.owner].inventory[Main.player[projectile.owner].selectedItem].type == mod.ItemType("PlagueKeeper")) + { + projectile.magic = false; + projectile.melee = true; + } + else if (Main.player[projectile.owner].inventory[Main.player[projectile.owner].selectedItem].type == mod.ItemType("TheSwarmer")) + { + projectile.magic = true; + } + else if (Main.player[projectile.owner].inventory[Main.player[projectile.owner].selectedItem].type == mod.ItemType("TheHive") || + Main.player[projectile.owner].inventory[Main.player[projectile.owner].selectedItem].type == mod.ItemType("Malevolence") || + Main.player[projectile.owner].inventory[Main.player[projectile.owner].selectedItem].type == ItemID.BeesKnees) + { + projectile.magic = false; + projectile.ranged = true; + } + } + } + if (Main.player[projectile.owner].GetModPlayer(mod).eQuiver && projectile.ranged && + projectile.friendly && CalamityMod.rangedProjectileExceptionList.TrueForAll(x => projectile.type != x)) + { + if (Main.rand.Next(200) > 198) + { + float spread = 180f * 0.0174f; + double startAngle = Math.Atan2(projectile.velocity.X, projectile.velocity.Y) - spread / 2; + double deltaAngle = spread / 8f; + double offsetAngle; + int i; + for (i = 0; i < 1; i++) + { + offsetAngle = (startAngle + deltaAngle * (i + i * i) / 2f) + 32f * i; + if (projectile.owner == Main.myPlayer) + { + int projectile1 = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(Math.Sin(offsetAngle) * 8f), (float)(Math.Cos(offsetAngle) * 8f), projectile.type, (int)((double)projectile.damage * 0.5), projectile.knockBack, projectile.owner, 0f, 0f); + int projectile2 = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 8f), (float)(-Math.Cos(offsetAngle) * 8f), projectile.type, (int)((double)projectile.damage * 0.5), projectile.knockBack, projectile.owner, 0f, 0f); + Main.projectile[projectile1].ranged = false; + Main.projectile[projectile2].ranged = false; + Main.projectile[projectile1].timeLeft = 60; + Main.projectile[projectile2].timeLeft = 60; + Main.projectile[projectile1].noDropItem = true; + Main.projectile[projectile2].noDropItem = true; + } + } + } + } + if (Main.player[projectile.owner].GetModPlayer(mod).nanotech && rogue && projectile.friendly) + { + counter++; + if (counter >= 30) + { + counter = 0; + if (projectile.owner == Main.myPlayer && Main.player[projectile.owner].ownedProjectileCounts[mod.ProjectileType("Nanotech")] < 30) + { + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, mod.ProjectileType("Nanotech"), + (int)((double)projectile.damage * 0.15), 0f, projectile.owner, 0f, 0f); + } + } + } + if (Main.player[projectile.owner].GetModPlayer(mod).daedalusSplit && rogue && projectile.friendly) + { + counter2++; + if (counter2 >= 30) + { + counter2 = 0; + if (projectile.owner == Main.myPlayer && Main.player[projectile.owner].ownedProjectileCounts[90] < 30) + { + for (int num252 = 0; num252 < 2; num252++) + { + Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + while (value15.X == 0f && value15.Y == 0f) + { + value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + } + value15.Normalize(); + value15 *= (float)Main.rand.Next(70, 101) * 0.1f; + int shard = Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), value15.X, value15.Y, 90, (int)((double)projectile.damage * 0.25), 0f, projectile.owner, 0f, 0f); + Main.projectile[shard].ranged = false; + } + } + } + } + } + #endregion + + #region PostAI + public override void PostAI(Projectile projectile) + { + int x = (int)(projectile.Center.X / 16f); + int y = (int)(projectile.Center.Y / 16f); + for (int i = x - 1; i <= x + 1; i++) + { + for (int j = y - 1; j <= y + 1; j++) + { + if (projectile.type == ProjectileID.PureSpray) + { + CalamityWorld.ConvertFromAstral(i, j, ConvertType.Pure); + } + if (projectile.type == ProjectileID.CorruptSpray) + { + CalamityWorld.ConvertFromAstral(i, j, ConvertType.Corrupt); + } + if (projectile.type == ProjectileID.CrimsonSpray) + { + CalamityWorld.ConvertFromAstral(i, j, ConvertType.Crimson); + } + if (projectile.type == ProjectileID.HallowSpray) + { + CalamityWorld.ConvertFromAstral(i, j, ConvertType.Hallow); + } + } + } + } + #endregion + + #region ModifyHitNPC + public override void ModifyHitNPC(Projectile projectile, NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) + { + if (projectile.ranged) + { + //BULLETS + + //musket ball: base 100 + 7 = 107 + //silver: base 100 + 9 = 109 + //meteor shot: base 100 + 9 = 109 pierces once + //acceleration: base 100 + bullet damage 9 = 109 speeds up while travelling + //flash: base 100 + bullet damage 7 = 107 + (flash damage 107 * 0.25 = 26) = 133 AoE confusion + //superball: base 100 + bullet damage 6 = 106 bounces a fucking shitload of times and speeds up + //enhanced nano: base 100 + bullet damage 12 = 112 + (nanobot damage 112 * 0.3 = 33 * 2 nanobots = 66) = 178 + //crystal: base 100 + bullet damage 9 = 109 + (crystal shard damage 109 * 0.6 = 65 * 0.6 = 39 * 3 total shards = 117) = 226 + //frostspark: base 100 + bullet damage 11 = 111 + (explosion damage 111 * 0.5 = 55) = 166 + //icy: base 100 + 10 bullet damage = 110 + (ice shard damage 110 * 0.5 = 55 * 0.6 = 33 * 2 total shards = 66) = 176 + //verium: base 100 + bullet damage 8 = 108 * 0.8 = 86 homing + //chloro: base 100 + bullet damage 10 = 110 * 0.8 = 88 homing + //terra: base 100 + bullet damage 9 = 109 + (terra shard damage 109 * 0.5 = 54 * 2 total shards = 106) = 215 + //acid: base 100 + bullet damage 36 = 136 does more based on enemy defense + //hyperius: base 100 + bullet damage 21 = 121 + (hyperius second bullet damage 121 * 0.8 = 96) = 217 + //holy fire: base 100 + bullet damage 27 = 127 + (explosion damage 127 * 0.85 = 107) = 234 + + //ARROWS + + //holy arrow: base 100 + arrow damage 13 = 113 + (star damage 113 * 0.5 = 56 * 0.7 = 39 * 2 total stars = 78) = 191 + //terra arrow: base 100 + arrow damage 9 = 109 + (terra arrow split damage 109 * 0.5 = 54 * 2 total arrows = 106) = 215 + //elysian arrow: base 100 + arrow damage 20 = 120 + meteor damage 120 = 240 + //napalm arrow: base 100 + arrow damage 13 = 113 + (fire shard damage 113 * 0.3 = 33 * 3 total shards = 99) = 212 + //icicle arrow: base 100 + arrow damage 14 = 114 + (ice shard damage 114 * 0.5 = 57 * 0.6 = 34 * 3 total shards = 102) = 216 + //bloodfire arrow: base 100 + arrow damage 40 = 140 but it heals so it's alright + //arctic arrow: base 100 + arrow damage 16 = 116 but it freezes enemies so it's alright + //vanquisher arrow: base 100 + arrow damage 33 = 133 + split arrow damage 93 = 226 fine for endgame arrow + switch (projectile.type) + { + case ProjectileID.CrystalShard: + damage = (int)((double)damage * 0.6); + break; + case ProjectileID.ChlorophyteBullet: + damage = (int)((double)damage * 0.8); + break; + case ProjectileID.HallowStar: + damage = (int)((double)damage * 0.7); + break; + } + if (projectile.type == mod.ProjectileType("VeriumBullet")) + { + damage = (int)((double)damage * 0.8); + } + else if (projectile.type == mod.ProjectileType("FrostsparkBullet")) + { + if (target.buffImmune[mod.BuffType("GlacialState")]) + { + damage = (int)((double)damage * 1.2); + } + } + else if (projectile.type == mod.ProjectileType("AcidBullet")) + { + int defenseAdd = (int)((double)target.defense * 0.1); //100 defense * 0.1 = 10 + damage = damage + defenseAdd; + } + } + if (projectile.owner == Main.myPlayer) + { + if (rogue) + { + crit = (Main.rand.Next(1, 101) < CalamityCustomThrowingDamagePlayer.ModPlayer(Main.player[projectile.owner]).throwingCrit); + } + if (projectile.minion || projectile.sentry || CalamityMod.projectileMinionList.Contains(projectile.type)) + { + Player player = Main.player[projectile.owner]; + if (!player.inventory[player.selectedItem].summon && + (player.inventory[player.selectedItem].melee || + player.inventory[player.selectedItem].ranged || + player.inventory[player.selectedItem].magic || + player.inventory[player.selectedItem].thrown) && + player.inventory[player.selectedItem].hammer == 0 && + player.inventory[player.selectedItem].pick == 0 && + player.inventory[player.selectedItem].axe == 0) + { + damage = (int)((double)damage * 0.6); + } + else + { + damage = (int)((double)damage * 1.1); + } + } + if (Main.player[projectile.owner].GetModPlayer(mod).screwdriver) + { + if (projectile.penetrate > 1 || projectile.penetrate == -1) + { + damage = (int)((double)damage * 1.1); + } + } + if (Main.player[projectile.owner].GetModPlayer(mod).sPower) + { + if (projectile.minion || CalamityMod.projectileMinionList.Contains(projectile.type)) + { + damage = (int)((double)damage * 1.1); + } + } + if (CalamityWorld.revenge) + { + bool DHorHoD = (Main.player[projectile.owner].GetModPlayer(mod).draedonsHeart || + Main.player[projectile.owner].GetModPlayer(mod).heartOfDarkness); + if (Main.player[projectile.owner].GetModPlayer(mod).rageMode && + Main.player[projectile.owner].GetModPlayer(mod).adrenalineMode) + { + if (projectile.minion || projectile.sentry || CalamityMod.projectileMinionList.Contains(projectile.type) || + projectile.melee || projectile.ranged || projectile.magic || rogue) + { + damage = (int)((double)damage * + (CalamityWorld.death ? (DHorHoD ? 9.9 : 9.0) : (DHorHoD ? 3.3 : 3.0))); + } + } + else if (Main.player[projectile.owner].GetModPlayer(mod).rageMode) + { + if (projectile.minion || projectile.sentry || CalamityMod.projectileMinionList.Contains(projectile.type) || + projectile.melee || projectile.ranged || projectile.magic || rogue) + { + double rageDamageBoost = 0.0 + + (Main.player[projectile.owner].GetModPlayer(mod).rageBoostOne ? (CalamityWorld.death ? 0.6 : 0.15) : 0.0) + //3.6 or 1.65 + (Main.player[projectile.owner].GetModPlayer(mod).rageBoostTwo ? (CalamityWorld.death ? 0.6 : 0.15) : 0.0) + //4.2 or 1.8 + (Main.player[projectile.owner].GetModPlayer(mod).rageBoostThree ? (CalamityWorld.death ? 0.6 : 0.15) : 0.0); //4.8 or 1.95 + double rageDamage = + (CalamityWorld.death ? (DHorHoD ? 3.3 : 3.0) : (DHorHoD ? 1.65 : 1.5)) + rageDamageBoost; + damage = (int)((double)damage * rageDamage); + } + } + else if (Main.player[projectile.owner].GetModPlayer(mod).adrenalineMode) + { + if (projectile.minion || projectile.sentry || CalamityMod.projectileMinionList.Contains(projectile.type) || + projectile.melee || projectile.ranged || projectile.magic || rogue) + { + damage = (int)((double)damage * ((CalamityWorld.death ? 7.0 : 2.5) * Main.player[projectile.owner].GetModPlayer(mod).adrenalineDmgMult)); + } + } + } + if (Main.player[projectile.owner].GetModPlayer(mod).uberBees && + (projectile.type == ProjectileID.GiantBee || projectile.type == ProjectileID.Bee || projectile.type == ProjectileID.Wasp)) + { + if (Main.player[projectile.owner].inventory[Main.player[projectile.owner].selectedItem].type == mod.ItemType("TheSwarmer") || + Main.player[projectile.owner].inventory[Main.player[projectile.owner].selectedItem].type == mod.ItemType("PlagueKeeper")) + { + damage = damage + Main.rand.Next(10, 21); + } + else + { + damage = damage + Main.rand.Next(70, 101); + projectile.penetrate = 1; + } + } + } if (Main.player[projectile.owner].GetModPlayer(mod).astralStarRain && crit && - Main.player[projectile.owner].GetModPlayer(mod).astralStarRainCooldown <= 0) + Main.player[projectile.owner].GetModPlayer(mod).astralStarRainCooldown <= 0) { if (projectile.owner == Main.myPlayer) { - Main.player[projectile.owner].GetModPlayer(mod).astralStarRainCooldown = 60; - for (int n = 0; n < 3; n++) + Main.player[projectile.owner].GetModPlayer(mod).astralStarRainCooldown = 60; + for (int n = 0; n < 3; n++) { float x = target.position.X + (float)Main.rand.Next(-400, 400); float y = target.position.Y - (float)Main.rand.Next(500, 800); @@ -447,48 +455,58 @@ namespace CalamityMod.Projectiles } } } - #endregion + #endregion - #region OnHitNPC - public override void OnHitNPC(Projectile projectile, NPC target, int damage, float knockback, bool crit) + #region OnHitNPC + public override void OnHitNPC(Projectile projectile, NPC target, int damage, float knockback, bool crit) { if (projectile.owner == Main.myPlayer) { - if (projectile.magic && Main.player[projectile.owner].ghostHeal) - { - float num = 0.2f; - num -= (float)projectile.numHits * 0.05f; - if (num < 0f) - { - num = 0f; - } - float num2 = (float)damage * num; - Main.player[Main.myPlayer].lifeSteal -= num2; - } - if (projectile.type == ProjectileID.VampireKnife) - { - float num = (float)damage * 0.075f; - if (num < 0f) - { - num = 0f; - } - Main.player[Main.myPlayer].lifeSteal -= num; - } - if (Main.player[projectile.owner].GetModPlayer(mod).uberBees && - (projectile.type == 566 || projectile.type == 181 || projectile.type == 189)) + if (projectile.magic && Main.player[projectile.owner].ghostHeal) + { + float num = 0.1f; + num -= (float)projectile.numHits * 0.05f; + if (num < 0f) + { + num = 0f; + } + float num2 = (float)damage * num; + Main.player[Main.myPlayer].lifeSteal -= num2; + } + if (projectile.type == ProjectileID.VampireKnife) + { + float num = (float)damage * 0.0375f; + if (num < 0f) + { + num = 0f; + } + Main.player[Main.myPlayer].lifeSteal -= num; + } + if (Main.player[projectile.owner].GetModPlayer(mod).uberBees && + (projectile.type == 566 || projectile.type == 181 || projectile.type == 189)) { target.AddBuff(mod.BuffType("Plague"), 360); } - if (Main.player[projectile.owner].GetModPlayer(mod).alchFlask && - (projectile.magic || CalamityMod.throwingProjectileList.Contains(projectile.type) || projectile.melee || projectile.minion || projectile.ranged) && - Main.player[projectile.owner].ownedProjectileCounts[mod.ProjectileType("PlagueSeeker")] < 6) + if (Main.player[projectile.owner].GetModPlayer(mod).alchFlask && + (projectile.magic || rogue || projectile.melee || projectile.minion || projectile.ranged) && + Main.player[projectile.owner].ownedProjectileCounts[mod.ProjectileType("PlagueSeeker")] < 6) { - int plague = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, mod.ProjectileType("PlagueSeeker"), (int)((double)projectile.damage * 0.25), 0f, projectile.owner, 0f, 0f); + int newDamage = (int)((double)projectile.damage * 0.25); + if (newDamage > 30) + { + newDamage = 30; + } + int plague = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, mod.ProjectileType("PlagueSeeker"), newDamage, 0f, projectile.owner, 0f, 0f); Main.projectile[plague].melee = false; } if (Main.player[projectile.owner].GetModPlayer(mod).reaverBlast && projectile.melee) { - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, mod.ProjectileType("ReaverBlast"), (int)((double)projectile.damage * 0.2), 0f, projectile.owner, 0f, 0f); + int newDamage = (int)((double)projectile.damage * 0.2); + if (newDamage > 30) + { + newDamage = 30; + } + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, mod.ProjectileType("ReaverBlast"), newDamage, 0f, projectile.owner, 0f, 0f); } if (Main.player[projectile.owner].GetModPlayer(mod).auricSet && target.canGhostHeal) { @@ -507,7 +525,7 @@ namespace CalamityMod.Projectiles { return; } - Main.player[Main.myPlayer].lifeSteal -= num12 * 2f; + Main.player[Main.myPlayer].lifeSteal -= num12 * 1.5f; float num13 = 0f; int num14 = projectile.owner; for (int i = 0; i < 255; i++) @@ -541,7 +559,7 @@ namespace CalamityMod.Projectiles { return; } - Main.player[Main.myPlayer].lifeSteal -= num12 * 2f; + Main.player[Main.myPlayer].lifeSteal -= num12 * 1.5f; float num13 = 0f; int num14 = projectile.owner; for (int i = 0; i < 255; i++) @@ -560,62 +578,62 @@ namespace CalamityMod.Projectiles } if (projectile.magic) { - if (Main.player[projectile.owner].GetModPlayer(mod).silvaMage && projectile.penetrate <= 1 && - Main.rand.Next(0, 100) >= 97) - { - Main.PlaySound(29, (int)projectile.position.X, (int)projectile.position.Y, 103); - projectile.position = projectile.Center; - projectile.width = (projectile.height = projectile.height * 4); - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); - for (int num193 = 0; num193 < 3; num193++) - { - Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 157, 0f, 0f, 100, new Color(Main.DiscoR, 203, 103), 1.5f); - } - for (int num194 = 0; num194 < 30; num194++) - { - int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 157, 0f, 0f, 0, new Color(Main.DiscoR, 203, 103), 2.5f); - Main.dust[num195].noGravity = true; - Main.dust[num195].velocity *= 3f; - num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 157, 0f, 0f, 100, new Color(Main.DiscoR, 203, 103), 1.5f); - Main.dust[num195].velocity *= 2f; - Main.dust[num195].noGravity = true; - } - projectile.damage *= (Main.player[projectile.owner].GetModPlayer(mod).auricSet ? 7 : 4); - projectile.Damage(); - } - if (Main.player[projectile.owner].GetModPlayer(mod).tarraMage) - { - if (Main.player[projectile.owner].GetModPlayer(mod).tarraMageHealCooldown <= 0) - { - Main.player[projectile.owner].GetModPlayer(mod).tarraMageHealCooldown = 90; - float num11 = 0.03f; - num11 -= (float)projectile.numHits * 0.015f; - if (num11 <= 0f) - { - return; - } - float num12 = (float)projectile.damage * num11; - if ((int)num12 <= 0) - { - return; - } - if (Main.player[Main.myPlayer].lifeSteal <= 0f) - { - return; - } - Main.player[Main.myPlayer].lifeSteal -= num12 * 2f; - int healAmount = (Main.player[projectile.owner].GetModPlayer(mod).auricSet ? projectile.damage / 100 : projectile.damage / 50); - Player player = Main.player[projectile.owner]; - player.statLife += healAmount; - player.HealEffect(healAmount); - if (player.statLife > player.statLifeMax2) - { - player.statLife = player.statLifeMax2; - } - } - } - if (Main.player[projectile.owner].GetModPlayer(mod).reaverBurst) + if (Main.player[projectile.owner].GetModPlayer(mod).silvaMage && projectile.penetrate == 1 && + Main.rand.Next(0, 100) >= 97) + { + Main.PlaySound(29, (int)projectile.position.X, (int)projectile.position.Y, 103); + projectile.position = projectile.Center; + projectile.width = (projectile.height = 96); + projectile.position.X = projectile.position.X - (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + for (int num193 = 0; num193 < 3; num193++) + { + Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 157, 0f, 0f, 100, new Color(Main.DiscoR, 203, 103), 1.5f); + } + for (int num194 = 0; num194 < 30; num194++) + { + int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 157, 0f, 0f, 0, new Color(Main.DiscoR, 203, 103), 2.5f); + Main.dust[num195].noGravity = true; + Main.dust[num195].velocity *= 3f; + num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 157, 0f, 0f, 100, new Color(Main.DiscoR, 203, 103), 1.5f); + Main.dust[num195].velocity *= 2f; + Main.dust[num195].noGravity = true; + } + projectile.damage *= (Main.player[projectile.owner].GetModPlayer(mod).auricSet ? 7 : 4); + projectile.Damage(); + } + if (Main.player[projectile.owner].GetModPlayer(mod).tarraMage && target.canGhostHeal) + { + if (Main.player[projectile.owner].GetModPlayer(mod).tarraMageHealCooldown <= 0) + { + Main.player[projectile.owner].GetModPlayer(mod).tarraMageHealCooldown = 90; + float num11 = 0.03f; + num11 -= (float)projectile.numHits * 0.015f; + if (num11 <= 0f) + { + return; + } + float num12 = (float)projectile.damage * num11; + if ((int)num12 <= 0) + { + return; + } + if (Main.player[Main.myPlayer].lifeSteal <= 0f) + { + return; + } + Main.player[Main.myPlayer].lifeSteal -= num12 * 1.5f; + int healAmount = (Main.player[projectile.owner].GetModPlayer(mod).auricSet ? projectile.damage / 100 : projectile.damage / 50); + Player player = Main.player[projectile.owner]; + player.statLife += healAmount; + player.HealEffect(healAmount); + if (player.statLife > player.statLifeMax2) + { + player.statLife = player.statLifeMax2; + } + } + } + if (Main.player[projectile.owner].GetModPlayer(mod).reaverBurst) { int num251 = Main.rand.Next(2, 5); for (int num252 = 0; num252 < num251; num252++) @@ -627,11 +645,16 @@ namespace CalamityMod.Projectiles } value15.Normalize(); value15 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), value15.X, value15.Y, 569 + Main.rand.Next(3), (int)((double)projectile.damage * 0.2), 0f, projectile.owner, 0f, 0f); + int newDamage = (int)((double)projectile.damage * 0.2); + if (newDamage > 30) + { + newDamage = 30; + } + Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), value15.X, value15.Y, 569 + Main.rand.Next(3), newDamage, 0f, projectile.owner, 0f, 0f); } } else if (Main.player[projectile.owner].GetModPlayer(mod).ataxiaMage && - Main.player[projectile.owner].GetModPlayer(mod).ataxiaDmg <= 0) + Main.player[projectile.owner].GetModPlayer(mod).ataxiaDmg <= 0) { int num = projectile.damage / 2; Main.player[projectile.owner].GetModPlayer(mod).ataxiaDmg += (float)num; @@ -679,40 +702,43 @@ namespace CalamityMod.Projectiles num8 *= num10; num9 *= num10; Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, num8, num9, mod.ProjectileType("AtaxiaOrb"), (int)((double)num * 1.5), 0f, projectile.owner, (float)num6, 0f); - float num11 = 0.1f; //0.2 - num11 -= (float)projectile.numHits * 0.05f; //0.05 - if (num11 <= 0f) + if (target.canGhostHeal) { - return; - } - float num12 = (float)projectile.damage * num11; - if ((int)num12 <= 0) - { - return; - } - if (Main.player[Main.myPlayer].lifeSteal <= 0f) - { - return; - } - Main.player[Main.myPlayer].lifeSteal -= num12 * 2f; - float num13 = 0f; - int num14 = projectile.owner; - for (int i = 0; i < 255; i++) - { - if (Main.player[i].active && !Main.player[i].dead && ((!Main.player[projectile.owner].hostile && !Main.player[i].hostile) || Main.player[projectile.owner].team == Main.player[i].team)) + float num11 = 0.1f; //0.2 + num11 -= (float)projectile.numHits * 0.05f; //0.05 + if (num11 <= 0f) { - float num15 = Math.Abs(Main.player[i].position.X + (float)(Main.player[i].width / 2) - projectile.position.X + (float)(projectile.width / 2)) + Math.Abs(Main.player[i].position.Y + (float)(Main.player[i].height / 2) - projectile.position.Y + (float)(projectile.height / 2)); - if (num15 < 1200f && (float)(Main.player[i].statLifeMax2 - Main.player[i].statLife) > num13) + return; + } + float num12 = (float)projectile.damage * num11; + if ((int)num12 <= 0) + { + return; + } + if (Main.player[Main.myPlayer].lifeSteal <= 0f) + { + return; + } + Main.player[Main.myPlayer].lifeSteal -= num12 * 1.5f; + float num13 = 0f; + int num14 = projectile.owner; + for (int i = 0; i < 255; i++) + { + if (Main.player[i].active && !Main.player[i].dead && ((!Main.player[projectile.owner].hostile && !Main.player[i].hostile) || Main.player[projectile.owner].team == Main.player[i].team)) { - num13 = (float)(Main.player[i].statLifeMax2 - Main.player[i].statLife); - num14 = i; + float num15 = Math.Abs(Main.player[i].position.X + (float)(Main.player[i].width / 2) - projectile.position.X + (float)(projectile.width / 2)) + Math.Abs(Main.player[i].position.Y + (float)(Main.player[i].height / 2) - projectile.position.Y + (float)(projectile.height / 2)); + if (num15 < 1200f && (float)(Main.player[i].statLifeMax2 - Main.player[i].statLife) > num13) + { + num13 = (float)(Main.player[i].statLifeMax2 - Main.player[i].statLife); + num14 = i; + } } } + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, mod.ProjectileType("AtaxiaHealOrb"), 0, 0f, projectile.owner, (float)num14, num12); } - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, mod.ProjectileType("AtaxiaHealOrb"), 0, 0f, projectile.owner, (float)num14, num12); } else if (Main.player[projectile.owner].GetModPlayer(mod).xerocSet && - Main.player[projectile.owner].GetModPlayer(mod).xerocDmg <= 0) + Main.player[projectile.owner].GetModPlayer(mod).xerocDmg <= 0) { int num = projectile.damage / 2; Main.player[projectile.owner].GetModPlayer(mod).xerocDmg += (float)num; @@ -760,146 +786,167 @@ namespace CalamityMod.Projectiles num8 *= num10; num9 *= num10; Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, num8, num9, mod.ProjectileType("XerocOrb"), (int)((double)num * 1.2), 0f, projectile.owner, (float)num6, 0f); - float num11 = 0.1f; - num11 -= (float)projectile.numHits * 0.05f; - if (num11 <= 0f) + if (target.canGhostHeal) { - return; - } - float num12 = (float)projectile.damage * num11; - if ((int)num12 <= 0) - { - return; - } - if (Main.player[Main.myPlayer].lifeSteal <= 0f) - { - return; - } - Main.player[Main.myPlayer].lifeSteal -= num12 * 2f; - float num13 = 0f; - int num14 = projectile.owner; - for (int i = 0; i < 255; i++) - { - if (Main.player[i].active && !Main.player[i].dead && ((!Main.player[projectile.owner].hostile && !Main.player[i].hostile) || Main.player[projectile.owner].team == Main.player[i].team)) + float num11 = 0.1f; + num11 -= (float)projectile.numHits * 0.05f; + if (num11 <= 0f) { - float num15 = Math.Abs(Main.player[i].position.X + (float)(Main.player[i].width / 2) - projectile.position.X + (float)(projectile.width / 2)) + Math.Abs(Main.player[i].position.Y + (float)(Main.player[i].height / 2) - projectile.position.Y + (float)(projectile.height / 2)); - if (num15 < 1200f && (float)(Main.player[i].statLifeMax2 - Main.player[i].statLife) > num13) + return; + } + float num12 = (float)projectile.damage * num11; + if ((int)num12 <= 0) + { + return; + } + if (Main.player[Main.myPlayer].lifeSteal <= 0f) + { + return; + } + Main.player[Main.myPlayer].lifeSteal -= num12 * 1.5f; + float num13 = 0f; + int num14 = projectile.owner; + for (int i = 0; i < 255; i++) + { + if (Main.player[i].active && !Main.player[i].dead && ((!Main.player[projectile.owner].hostile && !Main.player[i].hostile) || Main.player[projectile.owner].team == Main.player[i].team)) { - num13 = (float)(Main.player[i].statLifeMax2 - Main.player[i].statLife); - num14 = i; + float num15 = Math.Abs(Main.player[i].position.X + (float)(Main.player[i].width / 2) - projectile.position.X + (float)(projectile.width / 2)) + Math.Abs(Main.player[i].position.Y + (float)(Main.player[i].height / 2) - projectile.position.Y + (float)(projectile.height / 2)); + if (num15 < 1200f && (float)(Main.player[i].statLifeMax2 - Main.player[i].statLife) > num13) + { + num13 = (float)(Main.player[i].statLifeMax2 - Main.player[i].statLife); + num14 = i; + } + } + } + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, mod.ProjectileType("XerocHealOrb"), 0, 0f, projectile.owner, (float)num14, num12); + } + } + else if (Main.player[projectile.owner].GetModPlayer(mod).godSlayerMage && + Main.player[projectile.owner].GetModPlayer(mod).godSlayerDmg <= 0) + { + int num = projectile.damage / 2; + Main.player[projectile.owner].GetModPlayer(mod).godSlayerDmg += (float)num; + int[] array = new int[200]; + int num3 = 0; + int num4 = 0; + for (int i = 0; i < 200; i++) + { + if (Main.npc[i].CanBeChasedBy(projectile, false)) + { + float num5 = Math.Abs(Main.npc[i].position.X + (float)(Main.npc[i].width / 2) - projectile.position.X + (float)(projectile.width / 2)) + Math.Abs(Main.npc[i].position.Y + (float)(Main.npc[i].height / 2) - projectile.position.Y + (float)(projectile.height / 2)); + if (num5 < 800f) + { + if (Collision.CanHit(projectile.position, 1, 1, Main.npc[i].position, Main.npc[i].width, Main.npc[i].height) && num5 > 50f) + { + array[num4] = i; + num4++; + } + else if (num4 == 0) + { + array[num3] = i; + num3++; + } } } } - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, mod.ProjectileType("XerocHealOrb"), 0, 0f, projectile.owner, (float)num14, num12); + if (num3 == 0 && num4 == 0) + { + return; + } + int num6; + if (num4 > 0) + { + num6 = array[Main.rand.Next(num4)]; + } + else + { + num6 = array[Main.rand.Next(num3)]; + } + float num7 = 20f; + float num8 = (float)Main.rand.Next(-100, 101); + float num9 = (float)Main.rand.Next(-100, 101); + float num10 = (float)Math.Sqrt((double)(num8 * num8 + num9 * num9)); + num10 = num7 / num10; + num8 *= num10; + num9 *= num10; + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, num8, num9, mod.ProjectileType("GodSlayerOrb"), + (int)((double)num * (Main.player[projectile.owner].GetModPlayer(mod).auricSet ? 2.0 : 1.5)), 0f, projectile.owner, (float)num6, 0f); + if (target.canGhostHeal) + { + float num11 = (Main.player[projectile.owner].GetModPlayer(mod).auricSet ? 0.03f : 0.06f); //0.2 + num11 -= (float)projectile.numHits * 0.015f; //0.05 + if (num11 <= 0f) + { + return; + } + float num12 = (float)projectile.damage * num11; + if ((int)num12 <= 0) + { + return; + } + if (Main.player[Main.myPlayer].lifeSteal <= 0f) + { + return; + } + Main.player[Main.myPlayer].lifeSteal -= num12 * 1.5f; + float num13 = 0f; + int num14 = projectile.owner; + for (int i = 0; i < 255; i++) + { + if (Main.player[i].active && !Main.player[i].dead && ((!Main.player[projectile.owner].hostile && !Main.player[i].hostile) || Main.player[projectile.owner].team == Main.player[i].team)) + { + float num15 = Math.Abs(Main.player[i].position.X + (float)(Main.player[i].width / 2) - projectile.position.X + (float)(projectile.width / 2)) + Math.Abs(Main.player[i].position.Y + (float)(Main.player[i].height / 2) - projectile.position.Y + (float)(projectile.height / 2)); + if (num15 < 1200f && (float)(Main.player[i].statLifeMax2 - Main.player[i].statLife) > num13) + { + num13 = (float)(Main.player[i].statLifeMax2 - Main.player[i].statLife); + num14 = i; + } + } + } + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, mod.ProjectileType("GodSlayerHealOrb"), 0, 0f, projectile.owner, (float)num14, num12); + } } - else if (Main.player[projectile.owner].GetModPlayer(mod).godSlayerMage && - Main.player[projectile.owner].GetModPlayer(mod).godSlayerDmg <= 0) - { - int num = projectile.damage / 2; - Main.player[projectile.owner].GetModPlayer(mod).godSlayerDmg += (float)num; - int[] array = new int[200]; - int num3 = 0; - int num4 = 0; - for (int i = 0; i < 200; i++) - { - if (Main.npc[i].CanBeChasedBy(projectile, false)) - { - float num5 = Math.Abs(Main.npc[i].position.X + (float)(Main.npc[i].width / 2) - projectile.position.X + (float)(projectile.width / 2)) + Math.Abs(Main.npc[i].position.Y + (float)(Main.npc[i].height / 2) - projectile.position.Y + (float)(projectile.height / 2)); - if (num5 < 800f) - { - if (Collision.CanHit(projectile.position, 1, 1, Main.npc[i].position, Main.npc[i].width, Main.npc[i].height) && num5 > 50f) - { - array[num4] = i; - num4++; - } - else if (num4 == 0) - { - array[num3] = i; - num3++; - } - } - } - } - if (num3 == 0 && num4 == 0) - { - return; - } - int num6; - if (num4 > 0) - { - num6 = array[Main.rand.Next(num4)]; - } - else - { - num6 = array[Main.rand.Next(num3)]; - } - float num7 = 20f; - float num8 = (float)Main.rand.Next(-100, 101); - float num9 = (float)Main.rand.Next(-100, 101); - float num10 = (float)Math.Sqrt((double)(num8 * num8 + num9 * num9)); - num10 = num7 / num10; - num8 *= num10; - num9 *= num10; - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, num8, num9, mod.ProjectileType("GodSlayerOrb"), - (int)((double)num * (Main.player[projectile.owner].GetModPlayer(mod).auricSet ? 2.0 : 1.5)), 0f, projectile.owner, (float)num6, 0f); - float num11 = (Main.player[projectile.owner].GetModPlayer(mod).auricSet ? 0.03f : 0.06f); //0.2 - num11 -= (float)projectile.numHits * 0.015f; //0.05 - if (num11 <= 0f) - { - return; - } - float num12 = (float)projectile.damage * num11; - if ((int)num12 <= 0) - { - return; - } - if (Main.player[Main.myPlayer].lifeSteal <= 0f) - { - return; - } - Main.player[Main.myPlayer].lifeSteal -= num12 * 2f; - float num13 = 0f; - int num14 = projectile.owner; - for (int i = 0; i < 255; i++) - { - if (Main.player[i].active && !Main.player[i].dead && ((!Main.player[projectile.owner].hostile && !Main.player[i].hostile) || Main.player[projectile.owner].team == Main.player[i].team)) - { - float num15 = Math.Abs(Main.player[i].position.X + (float)(Main.player[i].width / 2) - projectile.position.X + (float)(projectile.width / 2)) + Math.Abs(Main.player[i].position.Y + (float)(Main.player[i].height / 2) - projectile.position.Y + (float)(projectile.height / 2)); - if (num15 < 1200f && (float)(Main.player[i].statLifeMax2 - Main.player[i].statLife) > num13) - { - num13 = (float)(Main.player[i].statLifeMax2 - Main.player[i].statLife); - num14 = i; - } - } - } - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, mod.ProjectileType("GodSlayerHealOrb"), 0, 0f, projectile.owner, (float)num14, num12); - } - } + } else if (projectile.melee) { - if (Main.player[projectile.owner].GetModPlayer(mod).ataxiaGeyser && - Main.player[projectile.owner].ownedProjectileCounts[mod.ProjectileType("ChaosGeyser")] < 3) + if (Main.player[projectile.owner].GetModPlayer(mod).ataxiaGeyser && + Main.player[projectile.owner].ownedProjectileCounts[mod.ProjectileType("ChaosGeyser")] < 3) { - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, mod.ProjectileType("ChaosGeyser"), (int)((double)projectile.damage * 0.15), 0f, projectile.owner, 0f, 0f); + int newDamage = (int)((double)projectile.damage * 0.15); + if (newDamage > 35) + { + newDamage = 35; + } + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, mod.ProjectileType("ChaosGeyser"), newDamage, 0f, projectile.owner, 0f, 0f); } - else if (Main.player[projectile.owner].GetModPlayer(mod).xerocSet && - Main.player[projectile.owner].ownedProjectileCounts[mod.ProjectileType("XerocBlast")] < 3) + else if (Main.player[projectile.owner].GetModPlayer(mod).xerocSet && + Main.player[projectile.owner].ownedProjectileCounts[mod.ProjectileType("XerocBlast")] < 3) { - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, mod.ProjectileType("XerocBlast"), (int)((double)projectile.damage * 0.2), 0f, projectile.owner, 0f, 0f); + int newDamage = (int)((double)projectile.damage * 0.2); + if (newDamage > 40) + { + newDamage = 40; + } + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, mod.ProjectileType("XerocBlast"), newDamage, 0f, projectile.owner, 0f, 0f); } } else if (projectile.ranged) { - if (Main.player[projectile.owner].GetModPlayer(mod).xerocSet && - Main.player[projectile.owner].ownedProjectileCounts[mod.ProjectileType("XerocFire")] < 3) + if (Main.player[projectile.owner].GetModPlayer(mod).xerocSet && + Main.player[projectile.owner].ownedProjectileCounts[mod.ProjectileType("XerocFire")] < 3) { - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, mod.ProjectileType("XerocFire"), (int)((double)projectile.damage * 0.15), 0f, projectile.owner, 0f, 0f); + int newDamage = (int)((double)projectile.damage * 0.15); + if (newDamage > 40) + { + newDamage = 40; + } + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, mod.ProjectileType("XerocFire"), newDamage, 0f, projectile.owner, 0f, 0f); } } - else if (CalamityMod.throwingProjectileList.Contains(projectile.type) && !projectile.melee) + else if (rogue) { if (Main.player[projectile.owner].GetModPlayer(mod).xerocSet && - Main.player[projectile.owner].GetModPlayer(mod).xerocDmg <= 0) + Main.player[projectile.owner].GetModPlayer(mod).xerocDmg <= 0) { int num = projectile.damage / 2; Main.player[projectile.owner].GetModPlayer(mod).xerocDmg += (float)num; @@ -949,13 +996,13 @@ namespace CalamityMod.Projectiles Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, num8, num9, mod.ProjectileType("XerocStar"), (int)((double)num * 1.6), 0f, projectile.owner, (float)num6, 0f); } } - else if (projectile.minion) + else if (projectile.minion || projectile.sentry || CalamityMod.projectileMinionList.Contains(projectile.type)) { - if (Main.player[projectile.owner].GetModPlayer(mod).pArtifact) - { - target.AddBuff(mod.BuffType("HolyLight"), 300); - } - if (Main.player[projectile.owner].GetModPlayer(mod).tearMinions) + if (Main.player[projectile.owner].GetModPlayer(mod).pArtifact) + { + target.AddBuff(mod.BuffType("HolyLight"), 300); + } + if (Main.player[projectile.owner].GetModPlayer(mod).tearMinions) { target.AddBuff(mod.BuffType("TemporalSadness"), 60); } @@ -963,59 +1010,59 @@ namespace CalamityMod.Projectiles { target.AddBuff(BuffID.ShadowFlame, 300); } - if (Main.player[projectile.owner].GetModPlayer(mod).godSlayerSummon && - Main.player[projectile.owner].GetModPlayer(mod).godSlayerDmg <= 0) - { - int num = projectile.damage / 2; - float ai1 = (Main.rand.NextFloat() + 0.5f); - Main.player[projectile.owner].GetModPlayer(mod).godSlayerDmg += (float)num; - int[] array = new int[200]; - int num3 = 0; - int num4 = 0; - for (int i = 0; i < 200; i++) - { - if (Main.npc[i].CanBeChasedBy(projectile, false)) - { - float num5 = Math.Abs(Main.npc[i].position.X + (float)(Main.npc[i].width / 2) - projectile.position.X + (float)(projectile.width / 2)) + Math.Abs(Main.npc[i].position.Y + (float)(Main.npc[i].height / 2) - projectile.position.Y + (float)(projectile.height / 2)); - if (num5 < 800f) - { - if (Collision.CanHit(projectile.position, 1, 1, Main.npc[i].position, Main.npc[i].width, Main.npc[i].height) && num5 > 50f) - { - array[num4] = i; - num4++; - } - else if (num4 == 0) - { - array[num3] = i; - num3++; - } - } - } - } - if (num3 == 0 && num4 == 0) - { - return; - } - int num6; - if (num4 > 0) - { - num6 = array[Main.rand.Next(num4)]; - } - else - { - num6 = array[Main.rand.Next(num3)]; - } - float num7 = 15f; - float num8 = (float)Main.rand.Next(-100, 101); - float num9 = (float)Main.rand.Next(-100, 101); - float num10 = (float)Math.Sqrt((double)(num8 * num8 + num9 * num9)); - num10 = num7 / num10; - num8 *= num10; - num9 *= num10; - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, num8, num9, mod.ProjectileType("GodSlayerPhantom"), (int)((double)num * 1.5), 0f, projectile.owner, 0f, ai1); - } - else if (Main.player[projectile.owner].GetModPlayer(mod).xerocSet && - Main.player[projectile.owner].GetModPlayer(mod).xerocDmg <= 0) + if (Main.player[projectile.owner].GetModPlayer(mod).godSlayerSummon && + Main.player[projectile.owner].GetModPlayer(mod).godSlayerDmg <= 0) + { + int num = projectile.damage / 2; + float ai1 = (Main.rand.NextFloat() + 0.5f); + Main.player[projectile.owner].GetModPlayer(mod).godSlayerDmg += (float)num; + int[] array = new int[200]; + int num3 = 0; + int num4 = 0; + for (int i = 0; i < 200; i++) + { + if (Main.npc[i].CanBeChasedBy(projectile, false)) + { + float num5 = Math.Abs(Main.npc[i].position.X + (float)(Main.npc[i].width / 2) - projectile.position.X + (float)(projectile.width / 2)) + Math.Abs(Main.npc[i].position.Y + (float)(Main.npc[i].height / 2) - projectile.position.Y + (float)(projectile.height / 2)); + if (num5 < 800f) + { + if (Collision.CanHit(projectile.position, 1, 1, Main.npc[i].position, Main.npc[i].width, Main.npc[i].height) && num5 > 50f) + { + array[num4] = i; + num4++; + } + else if (num4 == 0) + { + array[num3] = i; + num3++; + } + } + } + } + if (num3 == 0 && num4 == 0) + { + return; + } + int num6; + if (num4 > 0) + { + num6 = array[Main.rand.Next(num4)]; + } + else + { + num6 = array[Main.rand.Next(num3)]; + } + float num7 = 15f; + float num8 = (float)Main.rand.Next(-100, 101); + float num9 = (float)Main.rand.Next(-100, 101); + float num10 = (float)Math.Sqrt((double)(num8 * num8 + num9 * num9)); + num10 = num7 / num10; + num8 *= num10; + num9 *= num10; + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, num8, num9, mod.ProjectileType("GodSlayerPhantom"), (int)((double)num * 2.0), 0f, projectile.owner, 0f, ai1); + } + else if (Main.player[projectile.owner].GetModPlayer(mod).xerocSet && + Main.player[projectile.owner].GetModPlayer(mod).xerocDmg <= 0) { int num = projectile.damage / 2; Main.player[projectile.owner].GetModPlayer(mod).xerocDmg += (float)num; @@ -1067,41 +1114,107 @@ namespace CalamityMod.Projectiles } } } - #endregion + #endregion - #region Kill - public override void Kill(Projectile projectile, int timeLeft) - { - if (projectile.ranged) - { - if (Main.player[projectile.owner].GetModPlayer(mod).tarraRanged && Main.rand.Next(0, 100) >= 88) - { - int num251 = Main.rand.Next(2, 4); - for (int num252 = 0; num252 < num251; num252++) - { - Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - while (value15.X == 0f && value15.Y == 0f) - { - value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - } - value15.Normalize(); - value15 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), value15.X, value15.Y, mod.ProjectileType("TarraEnergy"), (int)((double)projectile.damage * 0.33), 0f, projectile.owner, 0f, 0f); - } - } - } - } - #endregion + #region Drawing + public override Color? GetAlpha(Projectile projectile, Color lightColor) + { + if (Main.player[Main.myPlayer].GetModPlayer(mod).trippy) + return new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB, projectile.alpha); + return null; + } - #region CanHit - public override bool CanHitPlayer(Projectile projectile, Player target) - { - if (projectile.type == ProjectileID.CultistBossLightningOrb) - { - return false; - } - return true; - } - #endregion - } + public override bool PreDraw(Projectile projectile, SpriteBatch spriteBatch, Color lightColor) + { + if (Main.player[Main.myPlayer].GetModPlayer(mod).trippy) + { + Texture2D texture = Main.projectileTexture[projectile.type]; + SpriteEffects spriteEffects = SpriteEffects.None; + if (projectile.spriteDirection == 1) + { + spriteEffects = SpriteEffects.FlipHorizontally; + } + float num66 = 0f; + Vector2 vector11 = new Vector2((float)(texture.Width / 2), (float)(texture.Height / Main.projFrames[projectile.type] / 2)); + Microsoft.Xna.Framework.Color color9 = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB, 0); + Microsoft.Xna.Framework.Color alpha15 = projectile.GetAlpha(color9); + float num212 = 0.99f; + alpha15.R = (byte)((float)alpha15.R * num212); + alpha15.G = (byte)((float)alpha15.G * num212); + alpha15.B = (byte)((float)alpha15.B * num212); + alpha15.A = (byte)((float)alpha15.A * num212); + for (int num213 = 0; num213 < 4; num213++) + { + Vector2 position9 = projectile.position; + float num214 = Math.Abs(projectile.Center.X - Main.player[Main.myPlayer].Center.X); + float num215 = Math.Abs(projectile.Center.Y - Main.player[Main.myPlayer].Center.Y); + if (num213 == 0 || num213 == 2) + { + position9.X = Main.player[Main.myPlayer].Center.X + num214; + } + else + { + position9.X = Main.player[Main.myPlayer].Center.X - num214; + } + position9.X -= (float)(projectile.width / 2); + if (num213 == 0 || num213 == 1) + { + position9.Y = Main.player[Main.myPlayer].Center.Y + num215; + } + else + { + position9.Y = Main.player[Main.myPlayer].Center.Y - num215; + } + int frames = texture.Height / Main.projFrames[projectile.type]; + int y = frames * projectile.frame; + position9.Y -= (float)(projectile.height / 2); + Main.spriteBatch.Draw(texture, + new Vector2(position9.X - Main.screenPosition.X + (float)(projectile.width / 2) - (float)texture.Width * projectile.scale / 2f + vector11.X * projectile.scale, position9.Y - Main.screenPosition.Y + (float)projectile.height - (float)texture.Height * projectile.scale / (float)Main.projFrames[projectile.type] + 4f + vector11.Y * projectile.scale + num66 + projectile.gfxOffY), + new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y, texture.Width, frames)), alpha15, projectile.rotation, vector11, projectile.scale, spriteEffects, 0f); + } + } + return true; + } + #endregion + + #region Kill + public override void Kill(Projectile projectile, int timeLeft) + { + if (projectile.ranged) + { + if (Main.player[projectile.owner].GetModPlayer(mod).tarraRanged && Main.rand.Next(0, 100) >= 88) + { + int num251 = Main.rand.Next(2, 4); + for (int num252 = 0; num252 < num251; num252++) + { + Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + while (value15.X == 0f && value15.Y == 0f) + { + value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + } + value15.Normalize(); + value15 *= (float)Main.rand.Next(70, 101) * 0.1f; + int newDamage = (int)((double)projectile.damage * 0.33); + if (newDamage > 65) + { + newDamage = 65; + } + Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), value15.X, value15.Y, mod.ProjectileType("TarraEnergy"), newDamage, 0f, projectile.owner, 0f, 0f); + } + } + } + } + #endregion + + #region CanHit + public override bool CanHitPlayer(Projectile projectile, Player target) + { + if (projectile.type == ProjectileID.CultistBossLightningOrb) + { + return false; + } + return true; + } + #endregion + } } diff --git a/Projectiles/Celestus.png b/Projectiles/Celestus.png deleted file mode 100644 index 418c089317..0000000000 Binary files a/Projectiles/Celestus.png and /dev/null differ diff --git a/Projectiles/ChaosSpirit.png b/Projectiles/ChaosSpirit.png deleted file mode 100644 index 6be106a2e6..0000000000 Binary files a/Projectiles/ChaosSpirit.png and /dev/null differ diff --git a/Projectiles/ChaotrixProjectile.png b/Projectiles/ChaotrixProjectile.png deleted file mode 100644 index 8b8dc552c7..0000000000 Binary files a/Projectiles/ChaotrixProjectile.png and /dev/null differ diff --git a/Projectiles/Crystalline.png b/Projectiles/Crystalline.png deleted file mode 100644 index 2da0cd4df8..0000000000 Binary files a/Projectiles/Crystalline.png and /dev/null differ diff --git a/Projectiles/Crystalline2.png b/Projectiles/Crystalline2.png deleted file mode 100644 index 1783364d36..0000000000 Binary files a/Projectiles/Crystalline2.png and /dev/null differ diff --git a/Projectiles/AstralShot.cs b/Projectiles/Enemy/AstralShot.cs similarity index 96% rename from Projectiles/AstralShot.cs rename to Projectiles/Enemy/AstralShot.cs index 6d2294bb41..5eec579fa3 100644 --- a/Projectiles/AstralShot.cs +++ b/Projectiles/Enemy/AstralShot.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Enemy { public class AstralShot : ModProjectile { diff --git a/Projectiles/AstralShot.png b/Projectiles/Enemy/AstralShot.png similarity index 100% rename from Projectiles/AstralShot.png rename to Projectiles/Enemy/AstralShot.png diff --git a/Projectiles/CrimsonSpike.cs b/Projectiles/Enemy/CrimsonSpike.cs similarity index 94% rename from Projectiles/CrimsonSpike.cs rename to Projectiles/Enemy/CrimsonSpike.cs index 9e2ff75ec1..e190e8f74a 100644 --- a/Projectiles/CrimsonSpike.cs +++ b/Projectiles/Enemy/CrimsonSpike.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Enemy { public class CrimsonSpike : ModProjectile { diff --git a/Projectiles/CrimsonSpike.png b/Projectiles/Enemy/CrimsonSpike.png similarity index 100% rename from Projectiles/CrimsonSpike.png rename to Projectiles/Enemy/CrimsonSpike.png diff --git a/Projectiles/EarthRockBig.cs b/Projectiles/Enemy/EarthRockBig.cs similarity index 97% rename from Projectiles/EarthRockBig.cs rename to Projectiles/Enemy/EarthRockBig.cs index 6433aec4e5..0721e1a9e6 100644 --- a/Projectiles/EarthRockBig.cs +++ b/Projectiles/Enemy/EarthRockBig.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Enemy { public class EarthRockBig : ModProjectile { diff --git a/Projectiles/EarthRockBig.png b/Projectiles/Enemy/EarthRockBig.png similarity index 100% rename from Projectiles/EarthRockBig.png rename to Projectiles/Enemy/EarthRockBig.png diff --git a/Projectiles/EarthRockSmall.cs b/Projectiles/Enemy/EarthRockSmall.cs similarity index 97% rename from Projectiles/EarthRockSmall.cs rename to Projectiles/Enemy/EarthRockSmall.cs index 7fecd14146..b0d1da22f4 100644 --- a/Projectiles/EarthRockSmall.cs +++ b/Projectiles/Enemy/EarthRockSmall.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Enemy { public class EarthRockSmall : ModProjectile { diff --git a/Projectiles/EarthRockSmall.png b/Projectiles/Enemy/EarthRockSmall.png similarity index 100% rename from Projectiles/EarthRockSmall.png rename to Projectiles/Enemy/EarthRockSmall.png diff --git a/Projectiles/FlameBurstHostile.cs b/Projectiles/Enemy/FlameBurstHostile.cs similarity index 96% rename from Projectiles/FlameBurstHostile.cs rename to Projectiles/Enemy/FlameBurstHostile.cs index a29652bb75..bc5cb2b0fe 100644 --- a/Projectiles/FlameBurstHostile.cs +++ b/Projectiles/Enemy/FlameBurstHostile.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Enemy { public class FlameBurstHostile : ModProjectile { diff --git a/Projectiles/FlameBurstHostile.png b/Projectiles/Enemy/FlameBurstHostile.png similarity index 100% rename from Projectiles/FlameBurstHostile.png rename to Projectiles/Enemy/FlameBurstHostile.png diff --git a/Projectiles/HorsWaterBlast.cs b/Projectiles/Enemy/HorsWaterBlast.cs similarity index 96% rename from Projectiles/HorsWaterBlast.cs rename to Projectiles/Enemy/HorsWaterBlast.cs index 2ca6329060..b03f5fcd73 100644 --- a/Projectiles/HorsWaterBlast.cs +++ b/Projectiles/Enemy/HorsWaterBlast.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Enemy { public class HorsWaterBlast : ModProjectile { diff --git a/Projectiles/HorsWaterBlast.png b/Projectiles/Enemy/HorsWaterBlast.png similarity index 100% rename from Projectiles/HorsWaterBlast.png rename to Projectiles/Enemy/HorsWaterBlast.png diff --git a/Projectiles/InkBomb.cs b/Projectiles/Enemy/InkBomb.cs similarity index 96% rename from Projectiles/InkBomb.cs rename to Projectiles/Enemy/InkBomb.cs index a84422ba37..431c14a162 100644 --- a/Projectiles/InkBomb.cs +++ b/Projectiles/Enemy/InkBomb.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Enemy { public class InkBomb : ModProjectile { diff --git a/Projectiles/InkBomb.png b/Projectiles/Enemy/InkBomb.png similarity index 100% rename from Projectiles/InkBomb.png rename to Projectiles/Enemy/InkBomb.png diff --git a/Projectiles/InkPoisonCloud.cs b/Projectiles/Enemy/InkPoisonCloud.cs similarity index 93% rename from Projectiles/InkPoisonCloud.cs rename to Projectiles/Enemy/InkPoisonCloud.cs index 7b9c9c04c3..bec00f2e88 100644 --- a/Projectiles/InkPoisonCloud.cs +++ b/Projectiles/Enemy/InkPoisonCloud.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Enemy { public class InkPoisonCloud : ModProjectile { diff --git a/Projectiles/InkPoisonCloud.png b/Projectiles/Enemy/InkPoisonCloud.png similarity index 100% rename from Projectiles/InkPoisonCloud.png rename to Projectiles/Enemy/InkPoisonCloud.png diff --git a/Projectiles/InkPoisonCloud2.cs b/Projectiles/Enemy/InkPoisonCloud2.cs similarity index 93% rename from Projectiles/InkPoisonCloud2.cs rename to Projectiles/Enemy/InkPoisonCloud2.cs index e9e9b15467..a74d1ab001 100644 --- a/Projectiles/InkPoisonCloud2.cs +++ b/Projectiles/Enemy/InkPoisonCloud2.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Enemy { public class InkPoisonCloud2 : ModProjectile { diff --git a/Projectiles/InkPoisonCloud2.png b/Projectiles/Enemy/InkPoisonCloud2.png similarity index 100% rename from Projectiles/InkPoisonCloud2.png rename to Projectiles/Enemy/InkPoisonCloud2.png diff --git a/Projectiles/InkPoisonCloud3.cs b/Projectiles/Enemy/InkPoisonCloud3.cs similarity index 93% rename from Projectiles/InkPoisonCloud3.cs rename to Projectiles/Enemy/InkPoisonCloud3.cs index 09b7c6072f..148ebb222a 100644 --- a/Projectiles/InkPoisonCloud3.cs +++ b/Projectiles/Enemy/InkPoisonCloud3.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Enemy { public class InkPoisonCloud3 : ModProjectile { diff --git a/Projectiles/InkPoisonCloud3.png b/Projectiles/Enemy/InkPoisonCloud3.png similarity index 100% rename from Projectiles/InkPoisonCloud3.png rename to Projectiles/Enemy/InkPoisonCloud3.png diff --git a/Projectiles/LavaChunk.cs b/Projectiles/Enemy/LavaChunk.cs similarity index 96% rename from Projectiles/LavaChunk.cs rename to Projectiles/Enemy/LavaChunk.cs index cc6a8b38c4..2b2b07a052 100644 --- a/Projectiles/LavaChunk.cs +++ b/Projectiles/Enemy/LavaChunk.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Enemy { public class LavaChunk : ModProjectile { diff --git a/Projectiles/LavaChunk.png b/Projectiles/Enemy/LavaChunk.png similarity index 100% rename from Projectiles/LavaChunk.png rename to Projectiles/Enemy/LavaChunk.png diff --git a/Projectiles/MantisRing.cs b/Projectiles/Enemy/MantisRing.cs similarity index 96% rename from Projectiles/MantisRing.cs rename to Projectiles/Enemy/MantisRing.cs index 08cac47d79..1556cadd09 100644 --- a/Projectiles/MantisRing.cs +++ b/Projectiles/Enemy/MantisRing.cs @@ -10,7 +10,7 @@ using Terraria.ModLoader; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Enemy { public class MantisRing : ModProjectile { @@ -24,7 +24,6 @@ namespace CalamityMod.Projectiles projectile.knockBack = 3f; projectile.width = 72; projectile.height = 30; - projectile.friendly = false; projectile.hostile = true; projectile.penetrate = 8; } diff --git a/Projectiles/MantisRing.png b/Projectiles/Enemy/MantisRing.png similarity index 100% rename from Projectiles/MantisRing.png rename to Projectiles/Enemy/MantisRing.png diff --git a/Projectiles/PufferExplosion.cs b/Projectiles/Enemy/PufferExplosion.cs similarity index 95% rename from Projectiles/PufferExplosion.cs rename to Projectiles/Enemy/PufferExplosion.cs index efa86e8e8b..b6a64170f6 100644 --- a/Projectiles/PufferExplosion.cs +++ b/Projectiles/Enemy/PufferExplosion.cs @@ -1,98 +1,98 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles -{ - public class PufferExplosion : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Explosion"); - } - - public override void SetDefaults() - { - projectile.width = 250; - projectile.height = 250; - projectile.friendly = true; - projectile.hostile = true; - projectile.ignoreWater = true; - projectile.tileCollide = false; - projectile.penetrate = -1; - projectile.timeLeft = 210; - projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 1; - } - - public override void AI() - { - Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0.75f) / 255f, ((255 - projectile.alpha) * 0.5f) / 255f, ((255 - projectile.alpha) * 0.01f) / 255f); - if (projectile.localAI[0] == 0f) - { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); - projectile.localAI[0] += 1f; - } - bool flag15 = false; - bool flag16 = false; - if (projectile.velocity.X < 0f && projectile.position.X < projectile.ai[0]) - { - flag15 = true; - } - if (projectile.velocity.X > 0f && projectile.position.X > projectile.ai[0]) - { - flag15 = true; - } - if (projectile.velocity.Y < 0f && projectile.position.Y < projectile.ai[1]) - { - flag16 = true; - } - if (projectile.velocity.Y > 0f && projectile.position.Y > projectile.ai[1]) - { - flag16 = true; - } - if (flag15 && flag16) - { - projectile.Kill(); - } - float num461 = 25f; - if (projectile.ai[0] > 180f) - { - num461 -= (projectile.ai[0] - 180f) / 2f; - } - if (num461 <= 0f) - { - num461 = 0f; - projectile.Kill(); - } - num461 *= 0.7f; - projectile.ai[0] += 4f; - int num462 = 0; - while ((float)num462 < num461) - { - float num463 = (float)Main.rand.Next(-30, 35); - float num464 = (float)Main.rand.Next(-30, 35); - float num465 = (float)Main.rand.Next(13, 18); - float num466 = (float)Math.Sqrt((double)(num463 * num463 + num464 * num464)); - num466 = num465 / num466; - num463 *= num466; - num464 *= num466; - int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 235, 0f, 0f, 100, default(Color), 1.5f); - Main.dust[num467].noGravity = true; - Main.dust[num467].position.X = projectile.Center.X; - Main.dust[num467].position.Y = projectile.Center.Y; - Dust expr_149DF_cp_0 = Main.dust[num467]; - expr_149DF_cp_0.position.X = expr_149DF_cp_0.position.X + (float)Main.rand.Next(-10, 11); - Dust expr_14A09_cp_0 = Main.dust[num467]; - expr_14A09_cp_0.position.Y = expr_14A09_cp_0.position.Y + (float)Main.rand.Next(-10, 11); - Main.dust[num467].velocity.X = num463; - Main.dust[num467].velocity.Y = num464; - num462++; - } - return; - } - } +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Enemy +{ + public class PufferExplosion : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Explosion"); + } + + public override void SetDefaults() + { + projectile.width = 250; + projectile.height = 250; + projectile.friendly = true; + projectile.hostile = true; + projectile.ignoreWater = true; + projectile.tileCollide = false; + projectile.penetrate = -1; + projectile.timeLeft = 210; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 1; + } + + public override void AI() + { + Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0.75f) / 255f, ((255 - projectile.alpha) * 0.5f) / 255f, ((255 - projectile.alpha) * 0.01f) / 255f); + if (projectile.localAI[0] == 0f) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); + projectile.localAI[0] += 1f; + } + bool flag15 = false; + bool flag16 = false; + if (projectile.velocity.X < 0f && projectile.position.X < projectile.ai[0]) + { + flag15 = true; + } + if (projectile.velocity.X > 0f && projectile.position.X > projectile.ai[0]) + { + flag15 = true; + } + if (projectile.velocity.Y < 0f && projectile.position.Y < projectile.ai[1]) + { + flag16 = true; + } + if (projectile.velocity.Y > 0f && projectile.position.Y > projectile.ai[1]) + { + flag16 = true; + } + if (flag15 && flag16) + { + projectile.Kill(); + } + float num461 = 25f; + if (projectile.ai[0] > 180f) + { + num461 -= (projectile.ai[0] - 180f) / 2f; + } + if (num461 <= 0f) + { + num461 = 0f; + projectile.Kill(); + } + num461 *= 0.7f; + projectile.ai[0] += 4f; + int num462 = 0; + while ((float)num462 < num461) + { + float num463 = (float)Main.rand.Next(-30, 35); + float num464 = (float)Main.rand.Next(-30, 35); + float num465 = (float)Main.rand.Next(13, 18); + float num466 = (float)Math.Sqrt((double)(num463 * num463 + num464 * num464)); + num466 = num465 / num466; + num463 *= num466; + num464 *= num466; + int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 235, 0f, 0f, 100, default(Color), 1.5f); + Main.dust[num467].noGravity = true; + Main.dust[num467].position.X = projectile.Center.X; + Main.dust[num467].position.Y = projectile.Center.Y; + Dust expr_149DF_cp_0 = Main.dust[num467]; + expr_149DF_cp_0.position.X = expr_149DF_cp_0.position.X + (float)Main.rand.Next(-10, 11); + Dust expr_14A09_cp_0 = Main.dust[num467]; + expr_14A09_cp_0.position.Y = expr_14A09_cp_0.position.Y + (float)Main.rand.Next(-10, 11); + Main.dust[num467].velocity.X = num463; + Main.dust[num467].velocity.Y = num464; + num462++; + } + return; + } + } } \ No newline at end of file diff --git a/Projectiles/PufferExplosion.png b/Projectiles/Enemy/PufferExplosion.png similarity index 100% rename from Projectiles/PufferExplosion.png rename to Projectiles/Enemy/PufferExplosion.png diff --git a/Projectiles/StormMarkHostile.cs b/Projectiles/Enemy/StormMarkHostile.cs similarity index 96% rename from Projectiles/StormMarkHostile.cs rename to Projectiles/Enemy/StormMarkHostile.cs index 52a6fc64ce..974be5cda2 100644 --- a/Projectiles/StormMarkHostile.cs +++ b/Projectiles/Enemy/StormMarkHostile.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Enemy { public class StormMarkHostile : ModProjectile { diff --git a/Projectiles/StormMarkHostile.png b/Projectiles/Enemy/StormMarkHostile.png similarity index 100% rename from Projectiles/StormMarkHostile.png rename to Projectiles/Enemy/StormMarkHostile.png diff --git a/Projectiles/SulphuricAcidCannon.cs b/Projectiles/Enemy/SulphuricAcidCannon.cs similarity index 96% rename from Projectiles/SulphuricAcidCannon.cs rename to Projectiles/Enemy/SulphuricAcidCannon.cs index 837d200ffd..40a4185519 100644 --- a/Projectiles/SulphuricAcidCannon.cs +++ b/Projectiles/Enemy/SulphuricAcidCannon.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Enemy { public class SulphuricAcidCannon : ModProjectile { diff --git a/Projectiles/SulphuricAcidCannon.png b/Projectiles/Enemy/SulphuricAcidCannon.png similarity index 100% rename from Projectiles/SulphuricAcidCannon.png rename to Projectiles/Enemy/SulphuricAcidCannon.png diff --git a/Projectiles/SulphuricAcidMist.cs b/Projectiles/Enemy/SulphuricAcidMist.cs similarity index 95% rename from Projectiles/SulphuricAcidMist.cs rename to Projectiles/Enemy/SulphuricAcidMist.cs index ae869834dc..bd5ffa7042 100644 --- a/Projectiles/SulphuricAcidMist.cs +++ b/Projectiles/Enemy/SulphuricAcidMist.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Enemy { public class SulphuricAcidMist : ModProjectile { diff --git a/Projectiles/SulphuricAcidMist.png b/Projectiles/Enemy/SulphuricAcidMist.png similarity index 100% rename from Projectiles/SulphuricAcidMist.png rename to Projectiles/Enemy/SulphuricAcidMist.png diff --git a/Projectiles/TornadoHostile.cs b/Projectiles/Enemy/TornadoHostile.cs similarity index 96% rename from Projectiles/TornadoHostile.cs rename to Projectiles/Enemy/TornadoHostile.cs index c202fdc67c..7d2bc02071 100644 --- a/Projectiles/TornadoHostile.cs +++ b/Projectiles/Enemy/TornadoHostile.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Enemy { public class TornadoHostile : ModProjectile { diff --git a/Projectiles/TornadoHostile.png b/Projectiles/Enemy/TornadoHostile.png similarity index 100% rename from Projectiles/TornadoHostile.png rename to Projectiles/Enemy/TornadoHostile.png diff --git a/Projectiles/ToxicMinnowCloud.cs b/Projectiles/Enemy/ToxicMinnowCloud.cs similarity index 94% rename from Projectiles/ToxicMinnowCloud.cs rename to Projectiles/Enemy/ToxicMinnowCloud.cs index 00a5b7a07e..3a1fc29e4a 100644 --- a/Projectiles/ToxicMinnowCloud.cs +++ b/Projectiles/Enemy/ToxicMinnowCloud.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Enemy { public class ToxicMinnowCloud : ModProjectile { diff --git a/Projectiles/ToxicMinnowCloud.png b/Projectiles/Enemy/ToxicMinnowCloud.png similarity index 100% rename from Projectiles/ToxicMinnowCloud.png rename to Projectiles/Enemy/ToxicMinnowCloud.png diff --git a/Projectiles/EradicatorMeleeProjectile.png b/Projectiles/EradicatorMeleeProjectile.png deleted file mode 100644 index e12958fc93..0000000000 Binary files a/Projectiles/EradicatorMeleeProjectile.png and /dev/null differ diff --git a/Projectiles/EradicatorProjectile.png b/Projectiles/EradicatorProjectile.png deleted file mode 100644 index e12958fc93..0000000000 Binary files a/Projectiles/EradicatorProjectile.png and /dev/null differ diff --git a/Projectiles/ExsanguinationLanceProjectile.png b/Projectiles/ExsanguinationLanceProjectile.png deleted file mode 100644 index 115b1dd4bd..0000000000 Binary files a/Projectiles/ExsanguinationLanceProjectile.png and /dev/null differ diff --git a/Projectiles/FlameScytheProjectile.png b/Projectiles/FlameScytheProjectile.png deleted file mode 100644 index 6df15cd567..0000000000 Binary files a/Projectiles/FlameScytheProjectile.png and /dev/null differ diff --git a/Projectiles/FlameScytheProjectileMelee.png b/Projectiles/FlameScytheProjectileMelee.png deleted file mode 100644 index 6df15cd567..0000000000 Binary files a/Projectiles/FlameScytheProjectileMelee.png and /dev/null differ diff --git a/Projectiles/GleamingBolt.cs b/Projectiles/GleamingBolt.cs deleted file mode 100644 index 9762c94c0c..0000000000 --- a/Projectiles/GleamingBolt.cs +++ /dev/null @@ -1,79 +0,0 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles -{ - public class GleamingBolt : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Bolt"); - } - - public override void SetDefaults() - { - projectile.width = 10; - projectile.height = 10; - projectile.friendly = true; - projectile.alpha = 255; - projectile.timeLeft = 250; - projectile.penetrate = 1; - projectile.magic = true; - } - - public override void AI() - { - projectile.velocity.X *= 0.985f; - projectile.velocity.Y *= 0.985f; - for (int dust = 0; dust < 3; dust++) - { - int randomDust = Main.rand.Next(2); - if (randomDust == 0) - { - randomDust = 64; - } - else - { - randomDust = 204; - } - Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, randomDust, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); - } - } - - public override void Kill(int timeLeft) - { - for (int k = 0; k < 5; k++) - { - int randomDust = Main.rand.Next(2); - if (randomDust == 0) - { - randomDust = 64; - } - else - { - randomDust = 204; - } - Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, randomDust, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); - } - float spread = 90f * 0.0174f; - double startAngle = Math.Atan2(projectile.velocity.X, projectile.velocity.Y)- spread/2; - double deltaAngle = spread/8f; - double offsetAngle; - int i; - if (projectile.owner == Main.myPlayer) - { - for (i = 0; i < 3; i++ ) - { - offsetAngle = (startAngle + deltaAngle * ( i + i * i ) / 2f ) + 32f * i; - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)( Math.Sin(offsetAngle) * 5f ), (float)( Math.Cos(offsetAngle) * 5f ), mod.ProjectileType("GleamingBolt2"), (int)((double)projectile.damage * 0.75f), projectile.knockBack, projectile.owner, 0f, 0f); - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)( -Math.Sin(offsetAngle) * 5f ), (float)( -Math.Cos(offsetAngle) * 5f ), mod.ProjectileType("GleamingBolt2"), (int)((double)projectile.damage * 0.75f), projectile.knockBack, projectile.owner, 0f, 0f); - } - } - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 105); - } - } -} \ No newline at end of file diff --git a/Projectiles/GleamingBolt2.cs b/Projectiles/GleamingBolt2.cs deleted file mode 100644 index d815a29cef..0000000000 --- a/Projectiles/GleamingBolt2.cs +++ /dev/null @@ -1,64 +0,0 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles -{ - public class GleamingBolt2 : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Bolt"); - } - - public override void SetDefaults() - { - projectile.width = 10; - projectile.height = 10; - projectile.friendly = true; - projectile.alpha = 255; - projectile.timeLeft = 120; - projectile.penetrate = 1; - projectile.magic = true; - } - - public override void AI() - { - projectile.velocity.X *= 0.985f; - projectile.velocity.Y *= 0.985f; - for (int dust = 0; dust < 2; dust++) - { - int randomDust = Main.rand.Next(2); - if (randomDust == 0) - { - randomDust = 64; - } - else - { - randomDust = 204; - } - Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, randomDust, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); - } - } - - public override void Kill(int timeLeft) - { - for (int k = 0; k < 3; k++) - { - int randomDust = Main.rand.Next(2); - if (randomDust == 0) - { - randomDust = 64; - } - else - { - randomDust = 204; - } - Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, randomDust, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); - } - } - } -} \ No newline at end of file diff --git a/Projectiles/AtaxiaHealOrb.cs b/Projectiles/Healing/AtaxiaHealOrb.cs similarity index 96% rename from Projectiles/AtaxiaHealOrb.cs rename to Projectiles/Healing/AtaxiaHealOrb.cs index 351546dc18..d57b957093 100644 --- a/Projectiles/AtaxiaHealOrb.cs +++ b/Projectiles/Healing/AtaxiaHealOrb.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Healing { public class AtaxiaHealOrb : ModProjectile { diff --git a/Projectiles/AtaxiaHealOrb.png b/Projectiles/Healing/AtaxiaHealOrb.png similarity index 100% rename from Projectiles/AtaxiaHealOrb.png rename to Projectiles/Healing/AtaxiaHealOrb.png diff --git a/Projectiles/AuricOrb.cs b/Projectiles/Healing/AuricOrb.cs similarity index 95% rename from Projectiles/AuricOrb.cs rename to Projectiles/Healing/AuricOrb.cs index a1ac15f45d..632725c534 100644 --- a/Projectiles/AuricOrb.cs +++ b/Projectiles/Healing/AuricOrb.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Healing { public class AuricOrb : ModProjectile { diff --git a/Projectiles/AuricOrb.png b/Projectiles/Healing/AuricOrb.png similarity index 100% rename from Projectiles/AuricOrb.png rename to Projectiles/Healing/AuricOrb.png diff --git a/Projectiles/BurntSienna.cs b/Projectiles/Healing/BurntSienna.cs similarity index 96% rename from Projectiles/BurntSienna.cs rename to Projectiles/Healing/BurntSienna.cs index 22fcec616a..da02d60560 100644 --- a/Projectiles/BurntSienna.cs +++ b/Projectiles/Healing/BurntSienna.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Healing { public class BurntSienna : ModProjectile { diff --git a/Projectiles/BurntSienna.png b/Projectiles/Healing/BurntSienna.png similarity index 100% rename from Projectiles/BurntSienna.png rename to Projectiles/Healing/BurntSienna.png diff --git a/Projectiles/CactusHealOrb.cs b/Projectiles/Healing/CactusHealOrb.cs similarity index 96% rename from Projectiles/CactusHealOrb.cs rename to Projectiles/Healing/CactusHealOrb.cs index e99a624735..91f343567e 100644 --- a/Projectiles/CactusHealOrb.cs +++ b/Projectiles/Healing/CactusHealOrb.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Healing { public class CactusHealOrb : ModProjectile { diff --git a/Projectiles/CactusHealOrb.png b/Projectiles/Healing/CactusHealOrb.png similarity index 100% rename from Projectiles/CactusHealOrb.png rename to Projectiles/Healing/CactusHealOrb.png diff --git a/Projectiles/EarthHealOrb.cs b/Projectiles/Healing/EarthHealOrb.cs similarity index 96% rename from Projectiles/EarthHealOrb.cs rename to Projectiles/Healing/EarthHealOrb.cs index 87771780dc..7d95b6fafb 100644 --- a/Projectiles/EarthHealOrb.cs +++ b/Projectiles/Healing/EarthHealOrb.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Healing { public class EarthHealOrb : ModProjectile { diff --git a/Projectiles/EarthHealOrb.png b/Projectiles/Healing/EarthHealOrb.png similarity index 100% rename from Projectiles/EarthHealOrb.png rename to Projectiles/Healing/EarthHealOrb.png diff --git a/Projectiles/EssenceFlame.cs b/Projectiles/Healing/EssenceFlame.cs similarity index 96% rename from Projectiles/EssenceFlame.cs rename to Projectiles/Healing/EssenceFlame.cs index f8b452ecdb..a7ec0e42ff 100644 --- a/Projectiles/EssenceFlame.cs +++ b/Projectiles/Healing/EssenceFlame.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Healing { public class EssenceFlame : ModProjectile { diff --git a/Projectiles/EssenceFlame.png b/Projectiles/Healing/EssenceFlame.png similarity index 100% rename from Projectiles/EssenceFlame.png rename to Projectiles/Healing/EssenceFlame.png diff --git a/Projectiles/Exoheal.cs b/Projectiles/Healing/Exoheal.cs similarity index 96% rename from Projectiles/Exoheal.cs rename to Projectiles/Healing/Exoheal.cs index bb2e66dbbb..8919dd56a7 100644 --- a/Projectiles/Exoheal.cs +++ b/Projectiles/Healing/Exoheal.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Healing { public class Exoheal : ModProjectile { diff --git a/Projectiles/Exoheal.png b/Projectiles/Healing/Exoheal.png similarity index 100% rename from Projectiles/Exoheal.png rename to Projectiles/Healing/Exoheal.png diff --git a/Projectiles/FungalHeal.cs b/Projectiles/Healing/FungalHeal.cs similarity index 97% rename from Projectiles/FungalHeal.cs rename to Projectiles/Healing/FungalHeal.cs index 55b758bde6..7653712100 100644 --- a/Projectiles/FungalHeal.cs +++ b/Projectiles/Healing/FungalHeal.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Healing { public class FungalHeal : ModProjectile { diff --git a/Projectiles/FungalHeal.png b/Projectiles/Healing/FungalHeal.png similarity index 100% rename from Projectiles/FungalHeal.png rename to Projectiles/Healing/FungalHeal.png diff --git a/Projectiles/GodSlayerHealOrb.cs b/Projectiles/Healing/GodSlayerHealOrb.cs similarity index 96% rename from Projectiles/GodSlayerHealOrb.cs rename to Projectiles/Healing/GodSlayerHealOrb.cs index 8b67a25ca9..8fb02621a8 100644 --- a/Projectiles/GodSlayerHealOrb.cs +++ b/Projectiles/Healing/GodSlayerHealOrb.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Healing { public class GodSlayerHealOrb : ModProjectile { diff --git a/Projectiles/GodSlayerHealOrb.png b/Projectiles/Healing/GodSlayerHealOrb.png similarity index 100% rename from Projectiles/GodSlayerHealOrb.png rename to Projectiles/Healing/GodSlayerHealOrb.png diff --git a/Projectiles/PhoenixHeal.cs b/Projectiles/Healing/PhoenixHeal.cs similarity index 96% rename from Projectiles/PhoenixHeal.cs rename to Projectiles/Healing/PhoenixHeal.cs index 33b66ab853..92dc2ffbc8 100644 --- a/Projectiles/PhoenixHeal.cs +++ b/Projectiles/Healing/PhoenixHeal.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Healing { public class PhoenixHeal : ModProjectile { diff --git a/Projectiles/PhoenixHeal.png b/Projectiles/Healing/PhoenixHeal.png similarity index 100% rename from Projectiles/PhoenixHeal.png rename to Projectiles/Healing/PhoenixHeal.png diff --git a/Projectiles/RainHeal.cs b/Projectiles/Healing/RainHeal.cs similarity index 96% rename from Projectiles/RainHeal.cs rename to Projectiles/Healing/RainHeal.cs index 390835faa3..c2b09e735a 100644 --- a/Projectiles/RainHeal.cs +++ b/Projectiles/Healing/RainHeal.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Healing { public class RainHeal : ModProjectile { diff --git a/Projectiles/RainHeal.png b/Projectiles/Healing/RainHeal.png similarity index 100% rename from Projectiles/RainHeal.png rename to Projectiles/Healing/RainHeal.png diff --git a/Projectiles/RoyalHeal.cs b/Projectiles/Healing/RoyalHeal.cs similarity index 96% rename from Projectiles/RoyalHeal.cs rename to Projectiles/Healing/RoyalHeal.cs index 063e73112e..32a7367002 100644 --- a/Projectiles/RoyalHeal.cs +++ b/Projectiles/Healing/RoyalHeal.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Healing { public class RoyalHeal : ModProjectile { diff --git a/Projectiles/RoyalHeal.png b/Projectiles/Healing/RoyalHeal.png similarity index 100% rename from Projectiles/RoyalHeal.png rename to Projectiles/Healing/RoyalHeal.png diff --git a/Projectiles/SilvaOrb.cs b/Projectiles/Healing/SilvaOrb.cs similarity index 95% rename from Projectiles/SilvaOrb.cs rename to Projectiles/Healing/SilvaOrb.cs index 4d4c073eb7..f5a49f64ed 100644 --- a/Projectiles/SilvaOrb.cs +++ b/Projectiles/Healing/SilvaOrb.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Healing { public class SilvaOrb : ModProjectile { diff --git a/Projectiles/SilvaOrb.png b/Projectiles/Healing/SilvaOrb.png similarity index 100% rename from Projectiles/SilvaOrb.png rename to Projectiles/Healing/SilvaOrb.png diff --git a/Projectiles/Terracotta.cs b/Projectiles/Healing/Terracotta.cs similarity index 96% rename from Projectiles/Terracotta.cs rename to Projectiles/Healing/Terracotta.cs index 9e460aa3c4..1927ac3b92 100644 --- a/Projectiles/Terracotta.cs +++ b/Projectiles/Healing/Terracotta.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Healing { public class Terracotta : ModProjectile { diff --git a/Projectiles/Terracotta.png b/Projectiles/Healing/Terracotta.png similarity index 100% rename from Projectiles/Terracotta.png rename to Projectiles/Healing/Terracotta.png diff --git a/Projectiles/TransfusionTrail.cs b/Projectiles/Healing/TransfusionTrail.cs similarity index 96% rename from Projectiles/TransfusionTrail.cs rename to Projectiles/Healing/TransfusionTrail.cs index 3cb32acbc7..3e14c885e7 100644 --- a/Projectiles/TransfusionTrail.cs +++ b/Projectiles/Healing/TransfusionTrail.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Healing { public class TransfusionTrail : ModProjectile { diff --git a/Projectiles/TransfusionTrail.png b/Projectiles/Healing/TransfusionTrail.png similarity index 100% rename from Projectiles/TransfusionTrail.png rename to Projectiles/Healing/TransfusionTrail.png diff --git a/Projectiles/XerocHealOrb.cs b/Projectiles/Healing/XerocHealOrb.cs similarity index 96% rename from Projectiles/XerocHealOrb.cs rename to Projectiles/Healing/XerocHealOrb.cs index f40589a46e..c8eae27cef 100644 --- a/Projectiles/XerocHealOrb.cs +++ b/Projectiles/Healing/XerocHealOrb.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Healing { public class XerocHealOrb : ModProjectile { diff --git a/Projectiles/XerocHealOrb.png b/Projectiles/Healing/XerocHealOrb.png similarity index 100% rename from Projectiles/XerocHealOrb.png rename to Projectiles/Healing/XerocHealOrb.png diff --git a/Projectiles/IceBeam.cs b/Projectiles/IceBeam.cs deleted file mode 100644 index 5dfcae1d91..0000000000 --- a/Projectiles/IceBeam.cs +++ /dev/null @@ -1,83 +0,0 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles -{ - public class IceBeam : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Beam"); - } - - public override void SetDefaults() - { - projectile.width = 4; - projectile.height = 4; - projectile.friendly = true; - projectile.ignoreWater = true; - projectile.ranged = true; - projectile.alpha = 255; - projectile.penetrate = -1; - projectile.coldDamage = true; - projectile.tileCollide = true; - projectile.extraUpdates = 5; - projectile.timeLeft = 600; - projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 4; - } - - public override void AI() - { - if (projectile.ai[1] == 0f) - { - projectile.ai[1] = 1f; - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 12); - } - if (projectile.alpha > 0) - { - projectile.alpha -= 10; - } - if (projectile.alpha < 0) - { - projectile.alpha = 0; - } - Lighting.AddLight(projectile.Center, 0.1f, 0.1f, 0.6f); - for (int num121 = 0; num121 < 5; num121++) - { - Dust dust4 = Main.dust[Dust.NewDust(projectile.position, projectile.width, projectile.height, 56, projectile.velocity.X, projectile.velocity.Y, 100, default(Color), 1f)]; - dust4.velocity = Vector2.Zero; - dust4.position -= projectile.velocity / 5f * (float)num121; - dust4.noGravity = true; - dust4.scale = 0.8f; - dust4.noLight = true; - } - if (projectile.light > 0f) - { - float num = projectile.light; - float num2 = projectile.light; - float num3 = projectile.light; - num2 *= 0.1f; - num *= 0.5f; - } - } - - public override Color? GetAlpha(Color lightColor) - { - if (projectile.alpha > 200) - { - return Color.Transparent; - } - return new Color(255 - projectile.alpha, 255 - projectile.alpha, 255 - projectile.alpha, 0); - } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(BuffID.Frostburn, 500); - } - } -} \ No newline at end of file diff --git a/Projectiles/IceBeam.png b/Projectiles/IceBeam.png deleted file mode 100644 index 15e8775737..0000000000 Binary files a/Projectiles/IceBeam.png and /dev/null differ diff --git a/Projectiles/LaceratorProjectile.png b/Projectiles/LaceratorProjectile.png deleted file mode 100644 index 29852d4d1b..0000000000 Binary files a/Projectiles/LaceratorProjectile.png and /dev/null differ diff --git a/Projectiles/LaserFountain.cs b/Projectiles/LaserFountain.cs deleted file mode 100644 index 39b601bb2d..0000000000 --- a/Projectiles/LaserFountain.cs +++ /dev/null @@ -1,61 +0,0 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles -{ - public class LaserFountain : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Fountain"); - } - - public override void SetDefaults() - { - projectile.width = 4; - projectile.height = 4; - projectile.friendly = true; - projectile.alpha = 255; - projectile.penetrate = -1; - projectile.tileCollide = false; - projectile.timeLeft = 60; - projectile.melee = true; - } - - public override void AI() - { - projectile.localAI[0] += 1f; - float SpeedX = (float)Main.rand.Next(-15, 15); - float SpeedY = (float)Main.rand.Next(-20, -10); - if (projectile.localAI[0] >= 12f) - { - int choice = Main.rand.Next(2); - if (choice == 0) - { - if (projectile.owner == Main.myPlayer) - { - int projectile1 = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, SpeedX, SpeedY, mod.ProjectileType("NebulaShot"), 350, projectile.knockBack, projectile.owner, 0f, 0f); - Main.projectile[projectile1].ranged = false; - Main.projectile[projectile1].melee = true; - Main.projectile[projectile1].aiStyle = 1; - } - } - else - { - if (projectile.owner == Main.myPlayer) - { - int projectile2 = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, SpeedX, SpeedY, mod.ProjectileType("IceBeam"), 350, projectile.knockBack, projectile.owner, 0f, 0f); - Main.projectile[projectile2].ranged = false; - Main.projectile[projectile2].melee = true; - Main.projectile[projectile2].aiStyle = 1; - } - } - projectile.localAI[0] = 0f; - } - } - } -} \ No newline at end of file diff --git a/Projectiles/AbyssBall.cs b/Projectiles/Magic/AbyssBall.cs similarity index 96% rename from Projectiles/AbyssBall.cs rename to Projectiles/Magic/AbyssBall.cs index 3da3309ef0..61f19a5a4c 100644 --- a/Projectiles/AbyssBall.cs +++ b/Projectiles/Magic/AbyssBall.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class AbyssBall : ModProjectile { diff --git a/Projectiles/AbyssBall.png b/Projectiles/Magic/AbyssBall.png similarity index 100% rename from Projectiles/AbyssBall.png rename to Projectiles/Magic/AbyssBall.png diff --git a/Projectiles/AetherBeam.cs b/Projectiles/Magic/AetherBeam.cs similarity index 96% rename from Projectiles/AetherBeam.cs rename to Projectiles/Magic/AetherBeam.cs index 49ed978f42..6d0cf6d9d5 100644 --- a/Projectiles/AetherBeam.cs +++ b/Projectiles/Magic/AetherBeam.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class AetherBeam : ModProjectile { diff --git a/Projectiles/AetherBeam.png b/Projectiles/Magic/AetherBeam.png similarity index 100% rename from Projectiles/AetherBeam.png rename to Projectiles/Magic/AetherBeam.png diff --git a/Projectiles/Ancient.cs b/Projectiles/Magic/Ancient.cs similarity index 96% rename from Projectiles/Ancient.cs rename to Projectiles/Magic/Ancient.cs index 6981588361..e76586f7ef 100644 --- a/Projectiles/Ancient.cs +++ b/Projectiles/Magic/Ancient.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class Ancient : ModProjectile { diff --git a/Projectiles/Ancient.png b/Projectiles/Magic/Ancient.png similarity index 100% rename from Projectiles/Ancient.png rename to Projectiles/Magic/Ancient.png diff --git a/Projectiles/Ancient2.cs b/Projectiles/Magic/Ancient2.cs similarity index 95% rename from Projectiles/Ancient2.cs rename to Projectiles/Magic/Ancient2.cs index 63117ade70..ab72a701a5 100644 --- a/Projectiles/Ancient2.cs +++ b/Projectiles/Magic/Ancient2.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class Ancient2 : ModProjectile { diff --git a/Projectiles/Ancient2.png b/Projectiles/Magic/Ancient2.png similarity index 100% rename from Projectiles/Ancient2.png rename to Projectiles/Magic/Ancient2.png diff --git a/Projectiles/ApothChloro.cs b/Projectiles/Magic/ApothChloro.cs similarity index 97% rename from Projectiles/ApothChloro.cs rename to Projectiles/Magic/ApothChloro.cs index 1f6b1c8153..d60f1d3a24 100644 --- a/Projectiles/ApothChloro.cs +++ b/Projectiles/Magic/ApothChloro.cs @@ -8,7 +8,7 @@ using Terraria.Enums; using Terraria.GameContent; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class ApothChloro : ModProjectile { diff --git a/Projectiles/ApothChloro.png b/Projectiles/Magic/ApothChloro.png similarity index 100% rename from Projectiles/ApothChloro.png rename to Projectiles/Magic/ApothChloro.png diff --git a/Projectiles/ApothJaws.cs b/Projectiles/Magic/ApothJaws.cs similarity index 95% rename from Projectiles/ApothJaws.cs rename to Projectiles/Magic/ApothJaws.cs index 790520a80d..4fc4d51124 100644 --- a/Projectiles/ApothJaws.cs +++ b/Projectiles/Magic/ApothJaws.cs @@ -8,7 +8,7 @@ using Terraria.Enums; using Terraria.GameContent; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class ApothJaws : ModProjectile { diff --git a/Projectiles/ApothJaws.png b/Projectiles/Magic/ApothJaws.png similarity index 100% rename from Projectiles/ApothJaws.png rename to Projectiles/Magic/ApothJaws.png diff --git a/Projectiles/ApothMark.cs b/Projectiles/Magic/ApothMark.cs similarity index 96% rename from Projectiles/ApothMark.cs rename to Projectiles/Magic/ApothMark.cs index c99858b177..70d0e8b500 100644 --- a/Projectiles/ApothMark.cs +++ b/Projectiles/Magic/ApothMark.cs @@ -8,7 +8,7 @@ using Terraria.Enums; using Terraria.GameContent; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class ApothMark : ModProjectile { diff --git a/Projectiles/ApothMark.png b/Projectiles/Magic/ApothMark.png similarity index 100% rename from Projectiles/ApothMark.png rename to Projectiles/Magic/ApothMark.png diff --git a/Projectiles/Asteroid.cs b/Projectiles/Magic/Asteroid.cs similarity index 96% rename from Projectiles/Asteroid.cs rename to Projectiles/Magic/Asteroid.cs index 042bceb333..70c903ceab 100644 --- a/Projectiles/Asteroid.cs +++ b/Projectiles/Magic/Asteroid.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class Asteroid : ModProjectile { diff --git a/Projectiles/Asteroid.png b/Projectiles/Magic/Asteroid.png similarity index 100% rename from Projectiles/Asteroid.png rename to Projectiles/Magic/Asteroid.png diff --git a/Projectiles/AsteroidMolten.cs b/Projectiles/Magic/AsteroidMolten.cs similarity index 97% rename from Projectiles/AsteroidMolten.cs rename to Projectiles/Magic/AsteroidMolten.cs index c7120c93e8..2b8da58493 100644 --- a/Projectiles/AsteroidMolten.cs +++ b/Projectiles/Magic/AsteroidMolten.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class AsteroidMolten : ModProjectile { diff --git a/Projectiles/AsteroidMolten.png b/Projectiles/Magic/AsteroidMolten.png similarity index 100% rename from Projectiles/AsteroidMolten.png rename to Projectiles/Magic/AsteroidMolten.png diff --git a/Projectiles/AstralCrystal.cs b/Projectiles/Magic/AstralCrystal.cs similarity index 99% rename from Projectiles/AstralCrystal.cs rename to Projectiles/Magic/AstralCrystal.cs index cf136c21a7..edff1e5c1d 100644 --- a/Projectiles/AstralCrystal.cs +++ b/Projectiles/Magic/AstralCrystal.cs @@ -9,7 +9,7 @@ using Terraria.ModLoader; using Microsoft.Xna.Framework; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class AstralCrystal : ModProjectile { diff --git a/Projectiles/AstralCrystal.png b/Projectiles/Magic/AstralCrystal.png similarity index 100% rename from Projectiles/AstralCrystal.png rename to Projectiles/Magic/AstralCrystal.png diff --git a/Projectiles/AstralCrystalInvisibleExplosion.cs b/Projectiles/Magic/AstralCrystalInvisibleExplosion.cs similarity index 95% rename from Projectiles/AstralCrystalInvisibleExplosion.cs rename to Projectiles/Magic/AstralCrystalInvisibleExplosion.cs index a0efe9d88c..1db8cba1aa 100644 --- a/Projectiles/AstralCrystalInvisibleExplosion.cs +++ b/Projectiles/Magic/AstralCrystalInvisibleExplosion.cs @@ -10,7 +10,7 @@ using Terraria.ModLoader; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class AstralCrystalInvisibleExplosion : ModProjectile { diff --git a/Projectiles/AstralCrystalInvisibleExplosion.png b/Projectiles/Magic/AstralCrystalInvisibleExplosion.png similarity index 100% rename from Projectiles/AstralCrystalInvisibleExplosion.png rename to Projectiles/Magic/AstralCrystalInvisibleExplosion.png diff --git a/Projectiles/AstralStarMagic.cs b/Projectiles/Magic/AstralStarMagic.cs similarity index 96% rename from Projectiles/AstralStarMagic.cs rename to Projectiles/Magic/AstralStarMagic.cs index 64405c34e6..cf60dbb72d 100644 --- a/Projectiles/AstralStarMagic.cs +++ b/Projectiles/Magic/AstralStarMagic.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class AstralStarMagic : ModProjectile { diff --git a/Projectiles/AstralStarMagic.png b/Projectiles/Magic/AstralStarMagic.png similarity index 100% rename from Projectiles/AstralStarMagic.png rename to Projectiles/Magic/AstralStarMagic.png diff --git a/Projectiles/AtlantisSpear.cs b/Projectiles/Magic/AtlantisSpear.cs similarity index 91% rename from Projectiles/AtlantisSpear.cs rename to Projectiles/Magic/AtlantisSpear.cs index 68c98dce76..553a2c937d 100644 --- a/Projectiles/AtlantisSpear.cs +++ b/Projectiles/Magic/AtlantisSpear.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class AtlantisSpear : ModProjectile { @@ -80,8 +80,13 @@ namespace CalamityMod.Projectiles Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 206, projectile.velocity.X * 0.005f, projectile.velocity.Y * 0.005f); } } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + + public override Color? GetAlpha(Color lightColor) + { + return new Color(200, 200, 200, projectile.alpha); + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.immune[projectile.owner] = 6; } diff --git a/Projectiles/Magic/AtlantisSpear.png b/Projectiles/Magic/AtlantisSpear.png new file mode 100644 index 0000000000..122a12fd18 Binary files /dev/null and b/Projectiles/Magic/AtlantisSpear.png differ diff --git a/Projectiles/AtlantisSpear2.cs b/Projectiles/Magic/AtlantisSpear2.cs similarity index 88% rename from Projectiles/AtlantisSpear2.cs rename to Projectiles/Magic/AtlantisSpear2.cs index 1d470b24d7..0b9e175732 100644 --- a/Projectiles/AtlantisSpear2.cs +++ b/Projectiles/Magic/AtlantisSpear2.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class AtlantisSpear2 : ModProjectile { @@ -68,7 +68,12 @@ namespace CalamityMod.Projectiles } } - public override void Kill(int timeLeft) + public override Color? GetAlpha(Color lightColor) + { + return new Color(200, 200, 200, projectile.alpha); + } + + public override void Kill(int timeLeft) { for (int k = 0; k < 3; k++) { diff --git a/Projectiles/Magic/AtlantisSpear2.png b/Projectiles/Magic/AtlantisSpear2.png new file mode 100644 index 0000000000..122a12fd18 Binary files /dev/null and b/Projectiles/Magic/AtlantisSpear2.png differ diff --git a/Projectiles/AuraRain.cs b/Projectiles/Magic/AuraRain.cs similarity index 59% rename from Projectiles/AuraRain.cs rename to Projectiles/Magic/AuraRain.cs index 2eb82025bb..fc81eaf9b5 100644 --- a/Projectiles/AuraRain.cs +++ b/Projectiles/Magic/AuraRain.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class AuraRain : ModProjectile { @@ -29,18 +29,15 @@ namespace CalamityMod.Projectiles projectile.extraUpdates = 1; aiType = 239; } - - public override void AI() - { - for (int num121 = 0; num121 < 2; num121++) - { - Dust dust4 = Main.dust[Dust.NewDust(projectile.position, projectile.width, projectile.height, 14, projectile.velocity.X, projectile.velocity.Y, 100, default(Color), 1f)]; - dust4.velocity = Vector2.Zero; - dust4.position -= projectile.velocity / 5f * (float)num121; - dust4.noGravity = true; - dust4.scale = 0.8f; - dust4.noLight = true; - } - } + + public override void AI() + { + Dust dust4 = Main.dust[Dust.NewDust(projectile.position, projectile.width, projectile.height, 14, projectile.velocity.X, projectile.velocity.Y, 100, default(Color), 1f)]; + dust4.velocity = Vector2.Zero; + dust4.position -= projectile.velocity / 5f; + dust4.noGravity = true; + dust4.scale = 0.8f; + dust4.noLight = true; + } } } \ No newline at end of file diff --git a/Projectiles/AuraRain.png b/Projectiles/Magic/AuraRain.png similarity index 100% rename from Projectiles/AuraRain.png rename to Projectiles/Magic/AuraRain.png diff --git a/Projectiles/BeamingBolt.cs b/Projectiles/Magic/BeamingBolt.cs similarity index 95% rename from Projectiles/BeamingBolt.cs rename to Projectiles/Magic/BeamingBolt.cs index f098cf5974..4b4205923f 100644 --- a/Projectiles/BeamingBolt.cs +++ b/Projectiles/Magic/BeamingBolt.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class BeamingBolt : ModProjectile { diff --git a/Projectiles/BeamingBolt.png b/Projectiles/Magic/BeamingBolt.png similarity index 100% rename from Projectiles/BeamingBolt.png rename to Projectiles/Magic/BeamingBolt.png diff --git a/Projectiles/BeamingBolt2.cs b/Projectiles/Magic/BeamingBolt2.cs similarity index 95% rename from Projectiles/BeamingBolt2.cs rename to Projectiles/Magic/BeamingBolt2.cs index 38b9bcffc3..a7c2c6785b 100644 --- a/Projectiles/BeamingBolt2.cs +++ b/Projectiles/Magic/BeamingBolt2.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class BeamingBolt2 : ModProjectile { diff --git a/Projectiles/BeamingBolt2.png b/Projectiles/Magic/BeamingBolt2.png similarity index 100% rename from Projectiles/BeamingBolt2.png rename to Projectiles/Magic/BeamingBolt2.png diff --git a/Projectiles/BigBeamofDeath.cs b/Projectiles/Magic/BigBeamofDeath.cs similarity index 95% rename from Projectiles/BigBeamofDeath.cs rename to Projectiles/Magic/BigBeamofDeath.cs index 7c520b957c..6de4590545 100644 --- a/Projectiles/BigBeamofDeath.cs +++ b/Projectiles/Magic/BigBeamofDeath.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class BigBeamofDeath : ModProjectile { diff --git a/Projectiles/BigBeamofDeath.png b/Projectiles/Magic/BigBeamofDeath.png similarity index 100% rename from Projectiles/BigBeamofDeath.png rename to Projectiles/Magic/BigBeamofDeath.png diff --git a/Projectiles/BigBeamofDeath2.cs b/Projectiles/Magic/BigBeamofDeath2.cs similarity index 93% rename from Projectiles/BigBeamofDeath2.cs rename to Projectiles/Magic/BigBeamofDeath2.cs index 5ae98d8313..42ef73f1ab 100644 --- a/Projectiles/BigBeamofDeath2.cs +++ b/Projectiles/Magic/BigBeamofDeath2.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class BigBeamofDeath2 : ModProjectile { diff --git a/Projectiles/BigBeamofDeath2.png b/Projectiles/Magic/BigBeamofDeath2.png similarity index 100% rename from Projectiles/BigBeamofDeath2.png rename to Projectiles/Magic/BigBeamofDeath2.png diff --git a/Projectiles/BlackAnurian.cs b/Projectiles/Magic/BlackAnurian.cs similarity index 95% rename from Projectiles/BlackAnurian.cs rename to Projectiles/Magic/BlackAnurian.cs index 95798e1229..e430114d2f 100644 --- a/Projectiles/BlackAnurian.cs +++ b/Projectiles/Magic/BlackAnurian.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class BlackAnurian : ModProjectile { diff --git a/Projectiles/BlackAnurian.png b/Projectiles/Magic/BlackAnurian.png similarity index 100% rename from Projectiles/BlackAnurian.png rename to Projectiles/Magic/BlackAnurian.png diff --git a/Projectiles/BlackAnurianPlankton.cs b/Projectiles/Magic/BlackAnurianPlankton.cs similarity index 96% rename from Projectiles/BlackAnurianPlankton.cs rename to Projectiles/Magic/BlackAnurianPlankton.cs index 55acb8691d..fbf6320f7e 100644 --- a/Projectiles/BlackAnurianPlankton.cs +++ b/Projectiles/Magic/BlackAnurianPlankton.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class BlackAnurianPlankton : ModProjectile { diff --git a/Projectiles/BlackAnurianPlankton.png b/Projectiles/Magic/BlackAnurianPlankton.png similarity index 100% rename from Projectiles/BlackAnurianPlankton.png rename to Projectiles/Magic/BlackAnurianPlankton.png diff --git a/Projectiles/BloodBeam.cs b/Projectiles/Magic/BloodBeam.cs similarity index 95% rename from Projectiles/BloodBeam.cs rename to Projectiles/Magic/BloodBeam.cs index 3ccfb7f487..fc15ae6087 100644 --- a/Projectiles/BloodBeam.cs +++ b/Projectiles/Magic/BloodBeam.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class BloodBeam : ModProjectile { diff --git a/Projectiles/BloodBeam.png b/Projectiles/Magic/BloodBeam.png similarity index 100% rename from Projectiles/BloodBeam.png rename to Projectiles/Magic/BloodBeam.png diff --git a/Projectiles/BloodBlast.cs b/Projectiles/Magic/BloodBlast.cs similarity index 95% rename from Projectiles/BloodBlast.cs rename to Projectiles/Magic/BloodBlast.cs index 8ccb831ae1..c12e62e205 100644 --- a/Projectiles/BloodBlast.cs +++ b/Projectiles/Magic/BloodBlast.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class BloodBlast : ModProjectile { diff --git a/Projectiles/BloodBlast.png b/Projectiles/Magic/BloodBlast.png similarity index 100% rename from Projectiles/BloodBlast.png rename to Projectiles/Magic/BloodBlast.png diff --git a/Projectiles/BloodBolt.cs b/Projectiles/Magic/BloodBolt.cs similarity index 93% rename from Projectiles/BloodBolt.cs rename to Projectiles/Magic/BloodBolt.cs index 3213801d7f..d1c14ec987 100644 --- a/Projectiles/BloodBolt.cs +++ b/Projectiles/Magic/BloodBolt.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class BloodBolt : ModProjectile { diff --git a/Projectiles/BloodBolt.png b/Projectiles/Magic/BloodBolt.png similarity index 100% rename from Projectiles/BloodBolt.png rename to Projectiles/Magic/BloodBolt.png diff --git a/Projectiles/BloodOrb.cs b/Projectiles/Magic/BloodOrb.cs similarity index 95% rename from Projectiles/BloodOrb.cs rename to Projectiles/Magic/BloodOrb.cs index 377bdeeb9b..59859da444 100644 --- a/Projectiles/BloodOrb.cs +++ b/Projectiles/Magic/BloodOrb.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class BloodOrb : ModProjectile { diff --git a/Projectiles/BloodOrb.png b/Projectiles/Magic/BloodOrb.png similarity index 100% rename from Projectiles/BloodOrb.png rename to Projectiles/Magic/BloodOrb.png diff --git a/Projectiles/BloodRay.cs b/Projectiles/Magic/BloodRay.cs similarity index 94% rename from Projectiles/BloodRay.cs rename to Projectiles/Magic/BloodRay.cs index 0f3986755d..9e47f35309 100644 --- a/Projectiles/BloodRay.cs +++ b/Projectiles/Magic/BloodRay.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class BloodRay : ModProjectile { diff --git a/Projectiles/BloodRay.png b/Projectiles/Magic/BloodRay.png similarity index 100% rename from Projectiles/BloodRay.png rename to Projectiles/Magic/BloodRay.png diff --git a/Projectiles/BlueBubble.cs b/Projectiles/Magic/BlueBubble.cs similarity index 94% rename from Projectiles/BlueBubble.cs rename to Projectiles/Magic/BlueBubble.cs index 1c1e87d72c..81e4de6b87 100644 --- a/Projectiles/BlueBubble.cs +++ b/Projectiles/Magic/BlueBubble.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class BlueBubble : ModProjectile { @@ -58,7 +58,6 @@ namespace CalamityMod.Projectiles if (Main.myPlayer == projectile.owner && projectile.timeLeft > 120) { projectile.timeLeft = 120; - return; } } diff --git a/Projectiles/BlueBubble.png b/Projectiles/Magic/BlueBubble.png similarity index 100% rename from Projectiles/BlueBubble.png rename to Projectiles/Magic/BlueBubble.png diff --git a/Projectiles/BlushieStaffProj.cs b/Projectiles/Magic/BlushieStaffProj.cs similarity index 95% rename from Projectiles/BlushieStaffProj.cs rename to Projectiles/Magic/BlushieStaffProj.cs index 6238ae4db2..3484c7cc49 100644 --- a/Projectiles/BlushieStaffProj.cs +++ b/Projectiles/Magic/BlushieStaffProj.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class BlushieStaffProj : ModProjectile { @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles Player player = Main.player[projectile.owner]; if (Main.myPlayer == projectile.owner) { - if (!player.channel || player.noItems || player.CCed) + if (!player.channel || player.noItems || player.CCed || projectile.ai[0] > 1800f) { projectile.Kill(); } @@ -44,7 +44,7 @@ namespace CalamityMod.Projectiles player.itemAnimation = 2; projectile.ai[0] += 1f; - projectile.damage = ((int)projectile.ai[0] - 120) / 2; + projectile.damage = ((int)projectile.ai[0] - 120) * 4; if (projectile.damage >= 100 && Main.myPlayer == projectile.owner) { if (player.statMana <= 0 && player.manaFlower) diff --git a/Projectiles/BlushieStaffProj.png b/Projectiles/Magic/BlushieStaffProj.png similarity index 100% rename from Projectiles/BlushieStaffProj.png rename to Projectiles/Magic/BlushieStaffProj.png diff --git a/Projectiles/BrimstoneBeam.cs b/Projectiles/Magic/BrimstoneBeam.cs similarity index 95% rename from Projectiles/BrimstoneBeam.cs rename to Projectiles/Magic/BrimstoneBeam.cs index f9ee5aa772..dd9bea66e9 100644 --- a/Projectiles/BrimstoneBeam.cs +++ b/Projectiles/Magic/BrimstoneBeam.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class BrimstoneBeam : ModProjectile { diff --git a/Projectiles/BrimstoneBeam.png b/Projectiles/Magic/BrimstoneBeam.png similarity index 100% rename from Projectiles/BrimstoneBeam.png rename to Projectiles/Magic/BrimstoneBeam.png diff --git a/Projectiles/BrimstoneBeam2.cs b/Projectiles/Magic/BrimstoneBeam2.cs similarity index 95% rename from Projectiles/BrimstoneBeam2.cs rename to Projectiles/Magic/BrimstoneBeam2.cs index bf3d71bc7f..d9e33961dc 100644 --- a/Projectiles/BrimstoneBeam2.cs +++ b/Projectiles/Magic/BrimstoneBeam2.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class BrimstoneBeam2 : ModProjectile { diff --git a/Projectiles/BrimstoneBeam2.png b/Projectiles/Magic/BrimstoneBeam2.png similarity index 100% rename from Projectiles/BrimstoneBeam2.png rename to Projectiles/Magic/BrimstoneBeam2.png diff --git a/Projectiles/BrimstoneBeam3.cs b/Projectiles/Magic/BrimstoneBeam3.cs similarity index 95% rename from Projectiles/BrimstoneBeam3.cs rename to Projectiles/Magic/BrimstoneBeam3.cs index 729a1a4fcd..2c05f0eccc 100644 --- a/Projectiles/BrimstoneBeam3.cs +++ b/Projectiles/Magic/BrimstoneBeam3.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class BrimstoneBeam3 : ModProjectile { diff --git a/Projectiles/BrimstoneBeam3.png b/Projectiles/Magic/BrimstoneBeam3.png similarity index 100% rename from Projectiles/BrimstoneBeam3.png rename to Projectiles/Magic/BrimstoneBeam3.png diff --git a/Projectiles/BrimstoneBeam4.cs b/Projectiles/Magic/BrimstoneBeam4.cs similarity index 95% rename from Projectiles/BrimstoneBeam4.cs rename to Projectiles/Magic/BrimstoneBeam4.cs index ebe13ae793..99f62d2c39 100644 --- a/Projectiles/BrimstoneBeam4.cs +++ b/Projectiles/Magic/BrimstoneBeam4.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class BrimstoneBeam4 : ModProjectile { diff --git a/Projectiles/BrimstoneBeam4.png b/Projectiles/Magic/BrimstoneBeam4.png similarity index 100% rename from Projectiles/BrimstoneBeam4.png rename to Projectiles/Magic/BrimstoneBeam4.png diff --git a/Projectiles/BrimstoneBeam5.cs b/Projectiles/Magic/BrimstoneBeam5.cs similarity index 94% rename from Projectiles/BrimstoneBeam5.cs rename to Projectiles/Magic/BrimstoneBeam5.cs index 1731a5892e..0c330d8093 100644 --- a/Projectiles/BrimstoneBeam5.cs +++ b/Projectiles/Magic/BrimstoneBeam5.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class BrimstoneBeam5 : ModProjectile { diff --git a/Projectiles/BrimstoneBeam5.png b/Projectiles/Magic/BrimstoneBeam5.png similarity index 100% rename from Projectiles/BrimstoneBeam5.png rename to Projectiles/Magic/BrimstoneBeam5.png diff --git a/Projectiles/BrimstoneFireball.cs b/Projectiles/Magic/BrimstoneFireball.cs similarity index 96% rename from Projectiles/BrimstoneFireball.cs rename to Projectiles/Magic/BrimstoneFireball.cs index 14ca9e7875..9d47ad6d38 100644 --- a/Projectiles/BrimstoneFireball.cs +++ b/Projectiles/Magic/BrimstoneFireball.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class BrimstoneFireball : ModProjectile { diff --git a/Projectiles/BrimstoneFireball.png b/Projectiles/Magic/BrimstoneFireball.png similarity index 100% rename from Projectiles/BrimstoneFireball.png rename to Projectiles/Magic/BrimstoneFireball.png diff --git a/Projectiles/BrimstoneHellfireballFriendly.cs b/Projectiles/Magic/BrimstoneHellfireballFriendly.cs similarity index 95% rename from Projectiles/BrimstoneHellfireballFriendly.cs rename to Projectiles/Magic/BrimstoneHellfireballFriendly.cs index a2cd52523a..a1a5c8916b 100644 --- a/Projectiles/BrimstoneHellfireballFriendly.cs +++ b/Projectiles/Magic/BrimstoneHellfireballFriendly.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class BrimstoneHellfireballFriendly : ModProjectile { diff --git a/Projectiles/BrimstoneHellfireballFriendly.png b/Projectiles/Magic/BrimstoneHellfireballFriendly.png similarity index 100% rename from Projectiles/BrimstoneHellfireballFriendly.png rename to Projectiles/Magic/BrimstoneHellfireballFriendly.png diff --git a/Projectiles/BrimstoneHellfireballFriendly2.cs b/Projectiles/Magic/BrimstoneHellfireballFriendly2.cs similarity index 95% rename from Projectiles/BrimstoneHellfireballFriendly2.cs rename to Projectiles/Magic/BrimstoneHellfireballFriendly2.cs index cf14afcb1d..fc028fe7d7 100644 --- a/Projectiles/BrimstoneHellfireballFriendly2.cs +++ b/Projectiles/Magic/BrimstoneHellfireballFriendly2.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class BrimstoneHellfireballFriendly2 : ModProjectile { diff --git a/Projectiles/BrimstoneHellfireballFriendly2.png b/Projectiles/Magic/BrimstoneHellfireballFriendly2.png similarity index 100% rename from Projectiles/BrimstoneHellfireballFriendly2.png rename to Projectiles/Magic/BrimstoneHellfireballFriendly2.png diff --git a/Projectiles/BrimstoneHomer.cs b/Projectiles/Magic/BrimstoneHomer.cs similarity index 94% rename from Projectiles/BrimstoneHomer.cs rename to Projectiles/Magic/BrimstoneHomer.cs index 6faf745e33..7688993a47 100644 --- a/Projectiles/BrimstoneHomer.cs +++ b/Projectiles/Magic/BrimstoneHomer.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class BrimstoneHomer : ModProjectile { @@ -19,6 +19,7 @@ namespace CalamityMod.Projectiles projectile.width = 4; projectile.height = 4; projectile.friendly = true; + projectile.magic = true; projectile.penetrate = 1; projectile.timeLeft = 240; } diff --git a/Projectiles/BrimstoneHomer.png b/Projectiles/Magic/BrimstoneHomer.png similarity index 100% rename from Projectiles/BrimstoneHomer.png rename to Projectiles/Magic/BrimstoneHomer.png diff --git a/Projectiles/BrimstoneTentacle.cs b/Projectiles/Magic/BrimstoneTentacle.cs similarity index 95% rename from Projectiles/BrimstoneTentacle.cs rename to Projectiles/Magic/BrimstoneTentacle.cs index 9b2c1fc4f5..2f4cd8463c 100644 --- a/Projectiles/BrimstoneTentacle.cs +++ b/Projectiles/Magic/BrimstoneTentacle.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class BrimstoneTentacle : ModProjectile { diff --git a/Projectiles/BrimstoneTentacle.png b/Projectiles/Magic/BrimstoneTentacle.png similarity index 100% rename from Projectiles/BrimstoneTentacle.png rename to Projectiles/Magic/BrimstoneTentacle.png diff --git a/Projectiles/Climax.cs b/Projectiles/Magic/Climax.cs similarity index 96% rename from Projectiles/Climax.cs rename to Projectiles/Magic/Climax.cs index 530fb508c9..0ed490e113 100644 --- a/Projectiles/Climax.cs +++ b/Projectiles/Magic/Climax.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class Climax : ModProjectile { diff --git a/Projectiles/Climax.png b/Projectiles/Magic/Climax.png similarity index 100% rename from Projectiles/Climax.png rename to Projectiles/Magic/Climax.png diff --git a/Projectiles/ClimaxBeam.cs b/Projectiles/Magic/ClimaxBeam.cs similarity index 93% rename from Projectiles/ClimaxBeam.cs rename to Projectiles/Magic/ClimaxBeam.cs index efe368d283..43076407ab 100644 --- a/Projectiles/ClimaxBeam.cs +++ b/Projectiles/Magic/ClimaxBeam.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class ClimaxBeam : ModProjectile { diff --git a/Projectiles/ClimaxBeam.png b/Projectiles/Magic/ClimaxBeam.png similarity index 100% rename from Projectiles/ClimaxBeam.png rename to Projectiles/Magic/ClimaxBeam.png diff --git a/Projectiles/CoralSpike.cs b/Projectiles/Magic/CoralSpike.cs similarity index 92% rename from Projectiles/CoralSpike.cs rename to Projectiles/Magic/CoralSpike.cs index b5f7e4bf3e..15ef971cbb 100644 --- a/Projectiles/CoralSpike.cs +++ b/Projectiles/Magic/CoralSpike.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class CoralSpike : ModProjectile { diff --git a/Projectiles/CoralSpike.png b/Projectiles/Magic/CoralSpike.png similarity index 100% rename from Projectiles/CoralSpike.png rename to Projectiles/Magic/CoralSpike.png diff --git a/Projectiles/CosmicTentacle.cs b/Projectiles/Magic/CosmicTentacle.cs similarity index 95% rename from Projectiles/CosmicTentacle.cs rename to Projectiles/Magic/CosmicTentacle.cs index 88ba357a0b..4a5b03ce69 100644 --- a/Projectiles/CosmicTentacle.cs +++ b/Projectiles/Magic/CosmicTentacle.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class CosmicTentacle : ModProjectile { diff --git a/Projectiles/CosmicTentacle.png b/Projectiles/Magic/CosmicTentacle.png similarity index 100% rename from Projectiles/CosmicTentacle.png rename to Projectiles/Magic/CosmicTentacle.png diff --git a/Projectiles/DemonicPitchfork.cs b/Projectiles/Magic/DemonicPitchfork.cs similarity index 95% rename from Projectiles/DemonicPitchfork.cs rename to Projectiles/Magic/DemonicPitchfork.cs index 1de20734f5..26f48b5f6d 100644 --- a/Projectiles/DemonicPitchfork.cs +++ b/Projectiles/Magic/DemonicPitchfork.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class DemonicPitchfork : ModProjectile { diff --git a/Projectiles/DemonicPitchfork.png b/Projectiles/Magic/DemonicPitchfork.png similarity index 100% rename from Projectiles/DemonicPitchfork.png rename to Projectiles/Magic/DemonicPitchfork.png diff --git a/Projectiles/DustProjectile.cs b/Projectiles/Magic/DustProjectile.cs similarity index 95% rename from Projectiles/DustProjectile.cs rename to Projectiles/Magic/DustProjectile.cs index c5887a3227..510987a426 100644 --- a/Projectiles/DustProjectile.cs +++ b/Projectiles/Magic/DustProjectile.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class DustProjectile : ModProjectile { diff --git a/Projectiles/DustProjectile.png b/Projectiles/Magic/DustProjectile.png similarity index 100% rename from Projectiles/DustProjectile.png rename to Projectiles/Magic/DustProjectile.png diff --git a/Projectiles/EidolicWail.cs b/Projectiles/Magic/EidolicWail.cs similarity index 95% rename from Projectiles/EidolicWail.cs rename to Projectiles/Magic/EidolicWail.cs index cefe70319c..945596c7c2 100644 --- a/Projectiles/EidolicWail.cs +++ b/Projectiles/Magic/EidolicWail.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class EidolicWail : ModProjectile { diff --git a/Projectiles/EidolicWail.png b/Projectiles/Magic/EidolicWail.png similarity index 100% rename from Projectiles/EidolicWail.png rename to Projectiles/Magic/EidolicWail.png diff --git a/Projectiles/EldritchTentacle.cs b/Projectiles/Magic/EldritchTentacle.cs similarity index 95% rename from Projectiles/EldritchTentacle.cs rename to Projectiles/Magic/EldritchTentacle.cs index c083219b38..f6a96bb963 100644 --- a/Projectiles/EldritchTentacle.cs +++ b/Projectiles/Magic/EldritchTentacle.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class EldritchTentacle : ModProjectile { diff --git a/Projectiles/EldritchTentacle.png b/Projectiles/Magic/EldritchTentacle.png similarity index 100% rename from Projectiles/EldritchTentacle.png rename to Projectiles/Magic/EldritchTentacle.png diff --git a/Projectiles/ElementBolt.cs b/Projectiles/Magic/ElementBolt.cs similarity index 94% rename from Projectiles/ElementBolt.cs rename to Projectiles/Magic/ElementBolt.cs index fff381d2d1..59e4b07ab2 100644 --- a/Projectiles/ElementBolt.cs +++ b/Projectiles/Magic/ElementBolt.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class ElementBolt : ModProjectile { diff --git a/Projectiles/ElementBolt.png b/Projectiles/Magic/ElementBolt.png similarity index 100% rename from Projectiles/ElementBolt.png rename to Projectiles/Magic/ElementBolt.png diff --git a/Projectiles/ElementBolt2.cs b/Projectiles/Magic/ElementBolt2.cs similarity index 93% rename from Projectiles/ElementBolt2.cs rename to Projectiles/Magic/ElementBolt2.cs index 7450012f45..a8c5d14655 100644 --- a/Projectiles/ElementBolt2.cs +++ b/Projectiles/Magic/ElementBolt2.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class ElementBolt2 : ModProjectile { diff --git a/Projectiles/ElementBolt2.png b/Projectiles/Magic/ElementBolt2.png similarity index 100% rename from Projectiles/ElementBolt2.png rename to Projectiles/Magic/ElementBolt2.png diff --git a/Projectiles/ElementOrb.cs b/Projectiles/Magic/ElementOrb.cs similarity index 95% rename from Projectiles/ElementOrb.cs rename to Projectiles/Magic/ElementOrb.cs index 719b88bdd4..796f0822e9 100644 --- a/Projectiles/ElementOrb.cs +++ b/Projectiles/Magic/ElementOrb.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class ElementOrb : ModProjectile { diff --git a/Projectiles/ElementOrb.png b/Projectiles/Magic/ElementOrb.png similarity index 100% rename from Projectiles/ElementOrb.png rename to Projectiles/Magic/ElementOrb.png diff --git a/Projectiles/ElementOrb2.cs b/Projectiles/Magic/ElementOrb2.cs similarity index 95% rename from Projectiles/ElementOrb2.cs rename to Projectiles/Magic/ElementOrb2.cs index c39424d1f5..fe342c5a42 100644 --- a/Projectiles/ElementOrb2.cs +++ b/Projectiles/Magic/ElementOrb2.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class ElementOrb2 : ModProjectile { diff --git a/Projectiles/ElementOrb2.png b/Projectiles/Magic/ElementOrb2.png similarity index 100% rename from Projectiles/ElementOrb2.png rename to Projectiles/Magic/ElementOrb2.png diff --git a/Projectiles/ElementRay.cs b/Projectiles/Magic/ElementRay.cs similarity index 94% rename from Projectiles/ElementRay.cs rename to Projectiles/Magic/ElementRay.cs index 367e838a00..8f81fe77a3 100644 --- a/Projectiles/ElementRay.cs +++ b/Projectiles/Magic/ElementRay.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class ElementRay : ModProjectile { diff --git a/Projectiles/ElementRay.png b/Projectiles/Magic/ElementRay.png similarity index 100% rename from Projectiles/ElementRay.png rename to Projectiles/Magic/ElementRay.png diff --git a/Projectiles/ElementTentacle.cs b/Projectiles/Magic/ElementTentacle.cs similarity index 95% rename from Projectiles/ElementTentacle.cs rename to Projectiles/Magic/ElementTentacle.cs index ba2b1abffa..507d7943c5 100644 --- a/Projectiles/ElementTentacle.cs +++ b/Projectiles/Magic/ElementTentacle.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class ElementTentacle : ModProjectile { diff --git a/Projectiles/ElementTentacle.png b/Projectiles/Magic/ElementTentacle.png similarity index 100% rename from Projectiles/ElementTentacle.png rename to Projectiles/Magic/ElementTentacle.png diff --git a/Projectiles/EvergladeSprayProjectile.cs b/Projectiles/Magic/EvergladeSprayProjectile.cs similarity index 95% rename from Projectiles/EvergladeSprayProjectile.cs rename to Projectiles/Magic/EvergladeSprayProjectile.cs index a166cd55cd..0dc9da30e2 100644 --- a/Projectiles/EvergladeSprayProjectile.cs +++ b/Projectiles/Magic/EvergladeSprayProjectile.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class EvergladeSprayProjectile : ModProjectile { diff --git a/Projectiles/EvergladeSprayProjectile.png b/Projectiles/Magic/EvergladeSprayProjectile.png similarity index 100% rename from Projectiles/EvergladeSprayProjectile.png rename to Projectiles/Magic/EvergladeSprayProjectile.png diff --git a/Projectiles/FabBolt.cs b/Projectiles/Magic/FabBolt.cs similarity index 93% rename from Projectiles/FabBolt.cs rename to Projectiles/Magic/FabBolt.cs index b35d97ac9b..c984af2547 100644 --- a/Projectiles/FabBolt.cs +++ b/Projectiles/Magic/FabBolt.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class FabBolt : ModProjectile { diff --git a/Projectiles/FabBolt.png b/Projectiles/Magic/FabBolt.png similarity index 100% rename from Projectiles/FabBolt.png rename to Projectiles/Magic/FabBolt.png diff --git a/Projectiles/FabOrb.cs b/Projectiles/Magic/FabOrb.cs similarity index 95% rename from Projectiles/FabOrb.cs rename to Projectiles/Magic/FabOrb.cs index cc72150d7c..70bc5e6835 100644 --- a/Projectiles/FabOrb.cs +++ b/Projectiles/Magic/FabOrb.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class FabOrb : ModProjectile { diff --git a/Projectiles/FabOrb.png b/Projectiles/Magic/FabOrb.png similarity index 100% rename from Projectiles/FabOrb.png rename to Projectiles/Magic/FabOrb.png diff --git a/Projectiles/FabRay.cs b/Projectiles/Magic/FabRay.cs similarity index 95% rename from Projectiles/FabRay.cs rename to Projectiles/Magic/FabRay.cs index 443ee00570..5f3085b5c4 100644 --- a/Projectiles/FabRay.cs +++ b/Projectiles/Magic/FabRay.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class FabRay : ModProjectile { diff --git a/Projectiles/FabRay.png b/Projectiles/Magic/FabRay.png similarity index 100% rename from Projectiles/FabRay.png rename to Projectiles/Magic/FabRay.png diff --git a/Projectiles/FatesReveal.cs b/Projectiles/Magic/FatesReveal.cs similarity index 74% rename from Projectiles/FatesReveal.cs rename to Projectiles/Magic/FatesReveal.cs index 3f77f1cf52..7bed332928 100644 --- a/Projectiles/FatesReveal.cs +++ b/Projectiles/Magic/FatesReveal.cs @@ -5,63 +5,63 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { - public class FatesReveal : ModProjectile - { - public override void SetStaticDefaults() + public class FatesReveal : ModProjectile + { + public override void SetStaticDefaults() { DisplayName.SetDefault("Fireball"); Main.projFrames[projectile.type] = 4; } - - public override void SetDefaults() - { - projectile.width = 10; - projectile.height = 10; - projectile.friendly = true; - projectile.alpha = 255; - projectile.tileCollide = false; - projectile.ignoreWater = true; - projectile.timeLeft = 180; - projectile.magic = true; - } - public override void AI() - { + public override void SetDefaults() + { + projectile.width = 10; + projectile.height = 10; + projectile.friendly = true; + projectile.alpha = 255; + projectile.tileCollide = false; + projectile.ignoreWater = true; + projectile.timeLeft = 180; + projectile.magic = true; + } + + public override void AI() + { float num949 = 10f; float scaleFactor11 = 15f; float num950 = 160f; - if (projectile.timeLeft > 30 && projectile.alpha > 0) + if (projectile.timeLeft > 30 && projectile.alpha > 0) { projectile.alpha -= 25; } - if (projectile.timeLeft > 30 && projectile.alpha < 128 && Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) + if (projectile.timeLeft > 30 && projectile.alpha < 128 && Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) { projectile.alpha = 128; } - if (projectile.alpha < 0) + if (projectile.alpha < 0) { projectile.alpha = 0; } int num3 = projectile.frameCounter + 1; projectile.frameCounter = num3; - if (num3 > 4) + if (num3 > 4) { projectile.frameCounter = 0; num3 = projectile.frame + 1; projectile.frame = num3; - if (num3 >= 4) + if (num3 >= 4) { projectile.frame = 0; } } float num951 = 0.5f; - if (projectile.timeLeft < 120) + if (projectile.timeLeft < 120) { num951 = 1.1f; } - if (projectile.timeLeft < 60) + if (projectile.timeLeft < 60) { num951 = 1.6f; } @@ -70,9 +70,9 @@ namespace CalamityMod.Projectiles float num73 = var_2_2A211_cp_0[var_2_2A211_cp_1]; var_2_2A211_cp_0[var_2_2A211_cp_1] = num73 + 1f; float num952 = projectile.ai[1] / 180f * 6.28318548f; - for (float num953 = 0f; num953 < 3f; num953 = num73 + 1f) + for (float num953 = 0f; num953 < 3f; num953 = num73 + 1f) { - if (Main.rand.Next(3) != 0) + if (Main.rand.Next(3) != 0) { return; } @@ -85,57 +85,57 @@ namespace CalamityMod.Projectiles dust13.alpha = 200; num73 = num953; } - if (projectile.timeLeft < 4) + if (projectile.timeLeft < 4) { projectile.position = projectile.Center; projectile.width = (projectile.height = 180); projectile.Center = projectile.position; projectile.damage = 800; - for (int num955 = 0; num955 < 10; num955 = num3 + 1) + for (int num955 = 0; num955 < 10; num955 = num3 + 1) { Dust dust13 = Main.dust[Dust.NewDust(projectile.position, projectile.width, projectile.height, 60, 0f, -2f, 0, default(Color), 1f)]; dust13.noGravity = true; - if (dust13.position != projectile.Center) + if (dust13.position != projectile.Center) { dust13.velocity = projectile.DirectionTo(dust13.position) * 3f; } num3 = num955; } } - if (Main.player[projectile.owner].active && !Main.player[projectile.owner].dead) + if (Main.player[projectile.owner].active && !Main.player[projectile.owner].dead) { - if (projectile.Distance(Main.player[projectile.owner].Center) > num950) + if (projectile.Distance(Main.player[projectile.owner].Center) > num950) { Vector2 vector118 = projectile.DirectionTo(Main.player[projectile.owner].Center); - if (vector118.HasNaNs()) + if (vector118.HasNaNs()) { vector118 = Vector2.UnitY; } projectile.velocity = (projectile.velocity * (num949 - 1f) + vector118 * scaleFactor11) / num949; } - } - else + } + else { - if (projectile.timeLeft > 30) + if (projectile.timeLeft > 30) { projectile.timeLeft = 30; } } - } - - public override Color? GetAlpha(Color lightColor) - { + } + + public override Color? GetAlpha(Color lightColor) + { if (projectile.timeLeft < 30) { float num4 = (float)projectile.timeLeft / 30f; projectile.alpha = (int)(255f - 255f * num4); } return new Color(255 - projectile.alpha, 255 - projectile.alpha, 255 - projectile.alpha, 128 - projectile.alpha / 2); - } + } - public override void Kill(int timeLeft) - { - projectile.position = projectile.Center; + public override void Kill(int timeLeft) + { + projectile.position = projectile.Center; projectile.width = (projectile.height = 180); projectile.Center = projectile.position; projectile.damage = projectile.damage * 3; @@ -166,6 +166,6 @@ namespace CalamityMod.Projectiles dust.velocity *= 2f; num3 = num126; } - } - } + } + } } \ No newline at end of file diff --git a/Projectiles/FatesReveal.png b/Projectiles/Magic/FatesReveal.png similarity index 100% rename from Projectiles/FatesReveal.png rename to Projectiles/Magic/FatesReveal.png diff --git a/Projectiles/FlameBeamTip.cs b/Projectiles/Magic/FlameBeamTip.cs similarity index 95% rename from Projectiles/FlameBeamTip.cs rename to Projectiles/Magic/FlameBeamTip.cs index 4416c23436..45b7327b4e 100644 --- a/Projectiles/FlameBeamTip.cs +++ b/Projectiles/Magic/FlameBeamTip.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class FlameBeamTip : ModProjectile { diff --git a/Projectiles/FlameBeamTip.png b/Projectiles/Magic/FlameBeamTip.png similarity index 100% rename from Projectiles/FlameBeamTip.png rename to Projectiles/Magic/FlameBeamTip.png diff --git a/Projectiles/FlameBeamTip2.cs b/Projectiles/Magic/FlameBeamTip2.cs similarity index 95% rename from Projectiles/FlameBeamTip2.cs rename to Projectiles/Magic/FlameBeamTip2.cs index 248beaf88e..4d14d6fd93 100644 --- a/Projectiles/FlameBeamTip2.cs +++ b/Projectiles/Magic/FlameBeamTip2.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class FlameBeamTip2 : ModProjectile { diff --git a/Projectiles/FlameBeamTip2.png b/Projectiles/Magic/FlameBeamTip2.png similarity index 100% rename from Projectiles/FlameBeamTip2.png rename to Projectiles/Magic/FlameBeamTip2.png diff --git a/Projectiles/FlamePillar.cs b/Projectiles/Magic/FlamePillar.cs similarity index 95% rename from Projectiles/FlamePillar.cs rename to Projectiles/Magic/FlamePillar.cs index 96638efcbb..2620b657f9 100644 --- a/Projectiles/FlamePillar.cs +++ b/Projectiles/Magic/FlamePillar.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class FlamePillar : ModProjectile { diff --git a/Projectiles/FlamePillar.png b/Projectiles/Magic/FlamePillar.png similarity index 100% rename from Projectiles/FlamePillar.png rename to Projectiles/Magic/FlamePillar.png diff --git a/Projectiles/FlamingPumpkin.cs b/Projectiles/Magic/FlamingPumpkin.cs similarity index 90% rename from Projectiles/FlamingPumpkin.cs rename to Projectiles/Magic/FlamingPumpkin.cs index 58f2ffe6d3..bda2b4c8ef 100644 --- a/Projectiles/FlamingPumpkin.cs +++ b/Projectiles/Magic/FlamingPumpkin.cs @@ -4,7 +4,7 @@ using Terraria; using Terraria.ModLoader; using Terraria.ID; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class FlamingPumpkin : ModProjectile { diff --git a/Projectiles/FlamingPumpkin.png b/Projectiles/Magic/FlamingPumpkin.png similarity index 100% rename from Projectiles/FlamingPumpkin.png rename to Projectiles/Magic/FlamingPumpkin.png diff --git a/Projectiles/FlareBoltProjectile.cs b/Projectiles/Magic/FlareBoltProjectile.cs similarity index 96% rename from Projectiles/FlareBoltProjectile.cs rename to Projectiles/Magic/FlareBoltProjectile.cs index c3bcf592d7..5910da28b3 100644 --- a/Projectiles/FlareBoltProjectile.cs +++ b/Projectiles/Magic/FlareBoltProjectile.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class FlareBoltProjectile : ModProjectile { diff --git a/Projectiles/FlareBoltProjectile.png b/Projectiles/Magic/FlareBoltProjectile.png similarity index 100% rename from Projectiles/FlareBoltProjectile.png rename to Projectiles/Magic/FlareBoltProjectile.png diff --git a/Projectiles/ForbiddenAxeBlade.cs b/Projectiles/Magic/ForbiddenAxeBlade.cs similarity index 94% rename from Projectiles/ForbiddenAxeBlade.cs rename to Projectiles/Magic/ForbiddenAxeBlade.cs index c87a6311c9..9911982998 100644 --- a/Projectiles/ForbiddenAxeBlade.cs +++ b/Projectiles/Magic/ForbiddenAxeBlade.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class ForbiddenAxeBlade : ModProjectile { diff --git a/Projectiles/ForbiddenAxeBlade.png b/Projectiles/Magic/ForbiddenAxeBlade.png similarity index 100% rename from Projectiles/ForbiddenAxeBlade.png rename to Projectiles/Magic/ForbiddenAxeBlade.png diff --git a/Projectiles/ForbiddenSunProjectile.cs b/Projectiles/Magic/ForbiddenSunProjectile.cs similarity index 95% rename from Projectiles/ForbiddenSunProjectile.cs rename to Projectiles/Magic/ForbiddenSunProjectile.cs index e7979ac6ae..d4232fb6f3 100644 --- a/Projectiles/ForbiddenSunProjectile.cs +++ b/Projectiles/Magic/ForbiddenSunProjectile.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class ForbiddenSunProjectile : ModProjectile { diff --git a/Projectiles/ForbiddenSunProjectile.png b/Projectiles/Magic/ForbiddenSunProjectile.png similarity index 100% rename from Projectiles/ForbiddenSunProjectile.png rename to Projectiles/Magic/ForbiddenSunProjectile.png diff --git a/Projectiles/ForbiddenSunburst.cs b/Projectiles/Magic/ForbiddenSunburst.cs similarity index 95% rename from Projectiles/ForbiddenSunburst.cs rename to Projectiles/Magic/ForbiddenSunburst.cs index bc0ca41a82..22055d6e4d 100644 --- a/Projectiles/ForbiddenSunburst.cs +++ b/Projectiles/Magic/ForbiddenSunburst.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class ForbiddenSunburst : ModProjectile { diff --git a/Projectiles/ForbiddenSunburst.png b/Projectiles/Magic/ForbiddenSunburst.png similarity index 100% rename from Projectiles/ForbiddenSunburst.png rename to Projectiles/Magic/ForbiddenSunburst.png diff --git a/Projectiles/FrigidflashBoltProjectile.cs b/Projectiles/Magic/FrigidflashBoltProjectile.cs similarity index 96% rename from Projectiles/FrigidflashBoltProjectile.cs rename to Projectiles/Magic/FrigidflashBoltProjectile.cs index e70b6acccd..d21e0d986d 100644 --- a/Projectiles/FrigidflashBoltProjectile.cs +++ b/Projectiles/Magic/FrigidflashBoltProjectile.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class FrigidflashBoltProjectile : ModProjectile { diff --git a/Projectiles/FrigidflashBoltProjectile.png b/Projectiles/Magic/FrigidflashBoltProjectile.png similarity index 100% rename from Projectiles/FrigidflashBoltProjectile.png rename to Projectiles/Magic/FrigidflashBoltProjectile.png diff --git a/Projectiles/FrostBoltProjectile.cs b/Projectiles/Magic/FrostBoltProjectile.cs similarity index 96% rename from Projectiles/FrostBoltProjectile.cs rename to Projectiles/Magic/FrostBoltProjectile.cs index 6cb81117c7..a8f6283dbe 100644 --- a/Projectiles/FrostBoltProjectile.cs +++ b/Projectiles/Magic/FrostBoltProjectile.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class FrostBoltProjectile : ModProjectile { diff --git a/Projectiles/Magic/FrostBoltProjectile.png b/Projectiles/Magic/FrostBoltProjectile.png new file mode 100644 index 0000000000..ed4e3450c0 Binary files /dev/null and b/Projectiles/Magic/FrostBoltProjectile.png differ diff --git a/Projectiles/GammaLaser.cs b/Projectiles/Magic/GammaLaser.cs similarity index 94% rename from Projectiles/GammaLaser.cs rename to Projectiles/Magic/GammaLaser.cs index 07898a2fea..8e6e32004c 100644 --- a/Projectiles/GammaLaser.cs +++ b/Projectiles/Magic/GammaLaser.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class GammaLaser : ModProjectile { diff --git a/Projectiles/GammaLaser.png b/Projectiles/Magic/GammaLaser.png similarity index 100% rename from Projectiles/GammaLaser.png rename to Projectiles/Magic/GammaLaser.png diff --git a/Projectiles/GhastlyBlast.cs b/Projectiles/Magic/GhastlyBlast.cs similarity index 97% rename from Projectiles/GhastlyBlast.cs rename to Projectiles/Magic/GhastlyBlast.cs index a95017a8d3..dd9f3edbff 100644 --- a/Projectiles/GhastlyBlast.cs +++ b/Projectiles/Magic/GhastlyBlast.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class GhastlyBlast : ModProjectile { diff --git a/Projectiles/GhastlyBlast.png b/Projectiles/Magic/GhastlyBlast.png similarity index 100% rename from Projectiles/GhastlyBlast.png rename to Projectiles/Magic/GhastlyBlast.png diff --git a/Projectiles/GhastlyExplosion.cs b/Projectiles/Magic/GhastlyExplosion.cs similarity index 96% rename from Projectiles/GhastlyExplosion.cs rename to Projectiles/Magic/GhastlyExplosion.cs index 2ca86d97ce..09a53e1803 100644 --- a/Projectiles/GhastlyExplosion.cs +++ b/Projectiles/Magic/GhastlyExplosion.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class GhastlyExplosion : ModProjectile { diff --git a/Projectiles/GhastlyExplosion.png b/Projectiles/Magic/GhastlyExplosion.png similarity index 100% rename from Projectiles/GhastlyExplosion.png rename to Projectiles/Magic/GhastlyExplosion.png diff --git a/Projectiles/GhastlyExplosionShard.cs b/Projectiles/Magic/GhastlyExplosionShard.cs similarity index 95% rename from Projectiles/GhastlyExplosionShard.cs rename to Projectiles/Magic/GhastlyExplosionShard.cs index 28d48d4ad7..0638c7558f 100644 --- a/Projectiles/GhastlyExplosionShard.cs +++ b/Projectiles/Magic/GhastlyExplosionShard.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class GhastlyExplosionShard : ModProjectile { diff --git a/Projectiles/GhastlyExplosionShard.png b/Projectiles/Magic/GhastlyExplosionShard.png similarity index 100% rename from Projectiles/GhastlyExplosionShard.png rename to Projectiles/Magic/GhastlyExplosionShard.png diff --git a/Projectiles/GhastlySubBlast.cs b/Projectiles/Magic/GhastlySubBlast.cs similarity index 95% rename from Projectiles/GhastlySubBlast.cs rename to Projectiles/Magic/GhastlySubBlast.cs index baa9c0ec75..b4a56eee4a 100644 --- a/Projectiles/GhastlySubBlast.cs +++ b/Projectiles/Magic/GhastlySubBlast.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class GhastlySubBlast : ModProjectile { diff --git a/Projectiles/GhastlySubBlast.png b/Projectiles/Magic/GhastlySubBlast.png similarity index 100% rename from Projectiles/GhastlySubBlast.png rename to Projectiles/Magic/GhastlySubBlast.png diff --git a/Projectiles/GhastlyVisage.cs b/Projectiles/Magic/GhastlyVisage.cs similarity index 96% rename from Projectiles/GhastlyVisage.cs rename to Projectiles/Magic/GhastlyVisage.cs index 858a0cb2c4..c679b55473 100644 --- a/Projectiles/GhastlyVisage.cs +++ b/Projectiles/Magic/GhastlyVisage.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class GhastlyVisage : ModProjectile { diff --git a/Projectiles/GhastlyVisage.png b/Projectiles/Magic/GhastlyVisage.png similarity index 100% rename from Projectiles/GhastlyVisage.png rename to Projectiles/Magic/GhastlyVisage.png diff --git a/Projectiles/Magic/GleamingBolt.cs b/Projectiles/Magic/GleamingBolt.cs new file mode 100644 index 0000000000..7ddb22c24b --- /dev/null +++ b/Projectiles/Magic/GleamingBolt.cs @@ -0,0 +1,79 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Magic +{ + public class GleamingBolt : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bolt"); + } + + public override void SetDefaults() + { + projectile.width = 10; + projectile.height = 10; + projectile.friendly = true; + projectile.alpha = 255; + projectile.timeLeft = 250; + projectile.penetrate = 1; + projectile.magic = true; + } + + public override void AI() + { + projectile.velocity.X *= 0.985f; + projectile.velocity.Y *= 0.985f; + for (int dust = 0; dust < 3; dust++) + { + int randomDust = Main.rand.Next(2); + if (randomDust == 0) + { + randomDust = 64; + } + else + { + randomDust = 204; + } + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, randomDust, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); + } + } + + public override void Kill(int timeLeft) + { + for (int k = 0; k < 5; k++) + { + int randomDust = Main.rand.Next(2); + if (randomDust == 0) + { + randomDust = 64; + } + else + { + randomDust = 204; + } + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, randomDust, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); + } + float spread = 90f * 0.0174f; + double startAngle = Math.Atan2(projectile.velocity.X, projectile.velocity.Y) - spread / 2; + double deltaAngle = spread / 8f; + double offsetAngle; + int i; + if (projectile.owner == Main.myPlayer) + { + for (i = 0; i < 3; i++) + { + offsetAngle = (startAngle + deltaAngle * (i + i * i) / 2f) + 32f * i; + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), mod.ProjectileType("GleamingBolt2"), (int)((double)projectile.damage * 0.75), projectile.knockBack, projectile.owner, 0f, 0f); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), mod.ProjectileType("GleamingBolt2"), (int)((double)projectile.damage * 0.75), projectile.knockBack, projectile.owner, 0f, 0f); + } + } + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 105); + } + } +} \ No newline at end of file diff --git a/Projectiles/GleamingBolt.png b/Projectiles/Magic/GleamingBolt.png similarity index 100% rename from Projectiles/GleamingBolt.png rename to Projectiles/Magic/GleamingBolt.png diff --git a/Projectiles/Magic/GleamingBolt2.cs b/Projectiles/Magic/GleamingBolt2.cs new file mode 100644 index 0000000000..ae62583277 --- /dev/null +++ b/Projectiles/Magic/GleamingBolt2.cs @@ -0,0 +1,64 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Magic +{ + public class GleamingBolt2 : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bolt"); + } + + public override void SetDefaults() + { + projectile.width = 10; + projectile.height = 10; + projectile.friendly = true; + projectile.alpha = 255; + projectile.timeLeft = 120; + projectile.penetrate = 1; + projectile.magic = true; + } + + public override void AI() + { + projectile.velocity.X *= 0.985f; + projectile.velocity.Y *= 0.985f; + for (int dust = 0; dust < 2; dust++) + { + int randomDust = Main.rand.Next(2); + if (randomDust == 0) + { + randomDust = 64; + } + else + { + randomDust = 204; + } + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, randomDust, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); + } + } + + public override void Kill(int timeLeft) + { + for (int k = 0; k < 3; k++) + { + int randomDust = Main.rand.Next(2); + if (randomDust == 0) + { + randomDust = 64; + } + else + { + randomDust = 204; + } + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, randomDust, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); + } + } + } +} \ No newline at end of file diff --git a/Projectiles/GleamingBolt2.png b/Projectiles/Magic/GleamingBolt2.png similarity index 100% rename from Projectiles/GleamingBolt2.png rename to Projectiles/Magic/GleamingBolt2.png diff --git a/Projectiles/GraniteEnergy.cs b/Projectiles/Magic/GraniteEnergy.cs similarity index 95% rename from Projectiles/GraniteEnergy.cs rename to Projectiles/Magic/GraniteEnergy.cs index 4e093ce638..24c775973c 100644 --- a/Projectiles/GraniteEnergy.cs +++ b/Projectiles/Magic/GraniteEnergy.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class GraniteEnergy : ModProjectile { diff --git a/Projectiles/GraniteEnergy.png b/Projectiles/Magic/GraniteEnergy.png similarity index 100% rename from Projectiles/GraniteEnergy.png rename to Projectiles/Magic/GraniteEnergy.png diff --git a/Projectiles/GranitePulse.cs b/Projectiles/Magic/GranitePulse.cs similarity index 96% rename from Projectiles/GranitePulse.cs rename to Projectiles/Magic/GranitePulse.cs index f4455caf38..21b7c7c830 100644 --- a/Projectiles/GranitePulse.cs +++ b/Projectiles/Magic/GranitePulse.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class GranitePulse : ModProjectile { diff --git a/Projectiles/GranitePulse.png b/Projectiles/Magic/GranitePulse.png similarity index 100% rename from Projectiles/GranitePulse.png rename to Projectiles/Magic/GranitePulse.png diff --git a/Projectiles/HellfireExplosionFriendly.cs b/Projectiles/Magic/HellfireExplosionFriendly.cs similarity index 95% rename from Projectiles/HellfireExplosionFriendly.cs rename to Projectiles/Magic/HellfireExplosionFriendly.cs index 34a6324303..6d8f45e81e 100644 --- a/Projectiles/HellfireExplosionFriendly.cs +++ b/Projectiles/Magic/HellfireExplosionFriendly.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class HellfireExplosionFriendly : ModProjectile { diff --git a/Projectiles/HellfireExplosionFriendly.png b/Projectiles/Magic/HellfireExplosionFriendly.png similarity index 100% rename from Projectiles/HellfireExplosionFriendly.png rename to Projectiles/Magic/HellfireExplosionFriendly.png diff --git a/Projectiles/HellfireExplosionFriendly2.cs b/Projectiles/Magic/HellfireExplosionFriendly2.cs similarity index 95% rename from Projectiles/HellfireExplosionFriendly2.cs rename to Projectiles/Magic/HellfireExplosionFriendly2.cs index 159b196128..d16de8c56b 100644 --- a/Projectiles/HellfireExplosionFriendly2.cs +++ b/Projectiles/Magic/HellfireExplosionFriendly2.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class HellfireExplosionFriendly2 : ModProjectile { diff --git a/Projectiles/HellfireExplosionFriendly2.png b/Projectiles/Magic/HellfireExplosionFriendly2.png similarity index 100% rename from Projectiles/HellfireExplosionFriendly2.png rename to Projectiles/Magic/HellfireExplosionFriendly2.png diff --git a/Projectiles/HolyFlame.cs b/Projectiles/Magic/HolyFlame.cs similarity index 95% rename from Projectiles/HolyFlame.cs rename to Projectiles/Magic/HolyFlame.cs index 265dfeaf54..4e266efd47 100644 --- a/Projectiles/HolyFlame.cs +++ b/Projectiles/Magic/HolyFlame.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class HolyFlame : ModProjectile { diff --git a/Projectiles/HolyFlame.png b/Projectiles/Magic/HolyFlame.png similarity index 100% rename from Projectiles/HolyFlame.png rename to Projectiles/Magic/HolyFlame.png diff --git a/Projectiles/HolyLaser.cs b/Projectiles/Magic/HolyLaser.cs similarity index 94% rename from Projectiles/HolyLaser.cs rename to Projectiles/Magic/HolyLaser.cs index ab6472e057..804a532ad5 100644 --- a/Projectiles/HolyLaser.cs +++ b/Projectiles/Magic/HolyLaser.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class HolyLaser : ModProjectile { diff --git a/Projectiles/HolyLaser.png b/Projectiles/Magic/HolyLaser.png similarity index 100% rename from Projectiles/HolyLaser.png rename to Projectiles/Magic/HolyLaser.png diff --git a/Projectiles/IceCluster.cs b/Projectiles/Magic/IceCluster.cs similarity index 95% rename from Projectiles/IceCluster.cs rename to Projectiles/Magic/IceCluster.cs index b11deaaae3..6324b69a99 100644 --- a/Projectiles/IceCluster.cs +++ b/Projectiles/Magic/IceCluster.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class IceCluster : ModProjectile { diff --git a/Projectiles/IceCluster.png b/Projectiles/Magic/IceCluster.png similarity index 100% rename from Projectiles/IceCluster.png rename to Projectiles/Magic/IceCluster.png diff --git a/Projectiles/IceSpike.cs b/Projectiles/Magic/IceSpike.cs similarity index 96% rename from Projectiles/IceSpike.cs rename to Projectiles/Magic/IceSpike.cs index 83dba39b6b..9b473870ba 100644 --- a/Projectiles/IceSpike.cs +++ b/Projectiles/Magic/IceSpike.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class IceSpike : ModProjectile { diff --git a/Projectiles/IceSpike.png b/Projectiles/Magic/IceSpike.png similarity index 100% rename from Projectiles/IceSpike.png rename to Projectiles/Magic/IceSpike.png diff --git a/Projectiles/InfernadoFriendly.cs b/Projectiles/Magic/InfernadoFriendly.cs similarity index 96% rename from Projectiles/InfernadoFriendly.cs rename to Projectiles/Magic/InfernadoFriendly.cs index ae77e98072..ac734d968a 100644 --- a/Projectiles/InfernadoFriendly.cs +++ b/Projectiles/Magic/InfernadoFriendly.cs @@ -5,7 +5,7 @@ using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class InfernadoFriendly : ModProjectile { diff --git a/Projectiles/InfernadoFriendly.png b/Projectiles/Magic/InfernadoFriendly.png similarity index 100% rename from Projectiles/InfernadoFriendly.png rename to Projectiles/Magic/InfernadoFriendly.png diff --git a/Projectiles/InfernadoMarkFriendly.cs b/Projectiles/Magic/InfernadoMarkFriendly.cs similarity index 95% rename from Projectiles/InfernadoMarkFriendly.cs rename to Projectiles/Magic/InfernadoMarkFriendly.cs index cf3799cfc4..05dc16057f 100644 --- a/Projectiles/InfernadoMarkFriendly.cs +++ b/Projectiles/Magic/InfernadoMarkFriendly.cs @@ -4,7 +4,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class InfernadoMarkFriendly : ModProjectile { @@ -18,6 +18,7 @@ namespace CalamityMod.Projectiles projectile.width = 10; projectile.height = 10; projectile.friendly = true; + projectile.magic = true; projectile.alpha = 255; projectile.penetrate = -1; projectile.timeLeft = 5; diff --git a/Projectiles/InfernadoMarkFriendly.png b/Projectiles/Magic/InfernadoMarkFriendly.png similarity index 100% rename from Projectiles/InfernadoMarkFriendly.png rename to Projectiles/Magic/InfernadoMarkFriendly.png diff --git a/Projectiles/InfernalBlade.cs b/Projectiles/Magic/InfernalBlade.cs similarity index 97% rename from Projectiles/InfernalBlade.cs rename to Projectiles/Magic/InfernalBlade.cs index 3c53134390..3ccd9cd3ef 100644 --- a/Projectiles/InfernalBlade.cs +++ b/Projectiles/Magic/InfernalBlade.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class InfernalBlade : ModProjectile { diff --git a/Projectiles/InfernalBlade.png b/Projectiles/Magic/InfernalBlade.png similarity index 100% rename from Projectiles/InfernalBlade.png rename to Projectiles/Magic/InfernalBlade.png diff --git a/Projectiles/InfernalBlade2.cs b/Projectiles/Magic/InfernalBlade2.cs similarity index 97% rename from Projectiles/InfernalBlade2.cs rename to Projectiles/Magic/InfernalBlade2.cs index 74a482353a..6c63212ee7 100644 --- a/Projectiles/InfernalBlade2.cs +++ b/Projectiles/Magic/InfernalBlade2.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class InfernalBlade2 : ModProjectile { diff --git a/Projectiles/InfernalBlade2.png b/Projectiles/Magic/InfernalBlade2.png similarity index 100% rename from Projectiles/InfernalBlade2.png rename to Projectiles/Magic/InfernalBlade2.png diff --git a/Projectiles/IonBlast.cs b/Projectiles/Magic/IonBlast.cs similarity index 95% rename from Projectiles/IonBlast.cs rename to Projectiles/Magic/IonBlast.cs index 5d46e02669..bbeafc3094 100644 --- a/Projectiles/IonBlast.cs +++ b/Projectiles/Magic/IonBlast.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class IonBlast : ModProjectile { diff --git a/Projectiles/IonBlast.png b/Projectiles/Magic/IonBlast.png similarity index 100% rename from Projectiles/IonBlast.png rename to Projectiles/Magic/IonBlast.png diff --git a/Projectiles/IonExplosion.cs b/Projectiles/Magic/IonExplosion.cs similarity index 86% rename from Projectiles/IonExplosion.cs rename to Projectiles/Magic/IonExplosion.cs index 543cf9c392..d203407414 100644 --- a/Projectiles/IonExplosion.cs +++ b/Projectiles/Magic/IonExplosion.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class IonExplosion : ModProjectile { @@ -21,6 +21,7 @@ namespace CalamityMod.Projectiles projectile.friendly = true; projectile.ignoreWater = true; projectile.tileCollide = false; + projectile.magic = true; projectile.penetrate = -1; projectile.timeLeft = 3; } diff --git a/Projectiles/IonExplosion.png b/Projectiles/Magic/IonExplosion.png similarity index 100% rename from Projectiles/IonExplosion.png rename to Projectiles/Magic/IonExplosion.png diff --git a/Projectiles/LiquidBlade.cs b/Projectiles/Magic/LiquidBlade.cs similarity index 97% rename from Projectiles/LiquidBlade.cs rename to Projectiles/Magic/LiquidBlade.cs index 105e8609e4..1af9d4ebc2 100644 --- a/Projectiles/LiquidBlade.cs +++ b/Projectiles/Magic/LiquidBlade.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class LiquidBlade : ModProjectile { diff --git a/Projectiles/LiquidBlade.png b/Projectiles/Magic/LiquidBlade.png similarity index 100% rename from Projectiles/LiquidBlade.png rename to Projectiles/Magic/LiquidBlade.png diff --git a/Projectiles/LiquidBlade2.cs b/Projectiles/Magic/LiquidBlade2.cs similarity index 97% rename from Projectiles/LiquidBlade2.cs rename to Projectiles/Magic/LiquidBlade2.cs index b94f860a87..847d08a2a3 100644 --- a/Projectiles/LiquidBlade2.cs +++ b/Projectiles/Magic/LiquidBlade2.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class LiquidBlade2 : ModProjectile { diff --git a/Projectiles/LiquidBlade2.png b/Projectiles/Magic/LiquidBlade2.png similarity index 100% rename from Projectiles/LiquidBlade2.png rename to Projectiles/Magic/LiquidBlade2.png diff --git a/Projectiles/MagicNebulaShot.cs b/Projectiles/Magic/MagicNebulaShot.cs similarity index 73% rename from Projectiles/MagicNebulaShot.cs rename to Projectiles/Magic/MagicNebulaShot.cs index 668ae36cdf..a775f2f6ff 100644 --- a/Projectiles/MagicNebulaShot.cs +++ b/Projectiles/Magic/MagicNebulaShot.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class MagicNebulaShot : ModProjectile { @@ -23,10 +23,12 @@ namespace CalamityMod.Projectiles projectile.magic = true; projectile.tileCollide = false; projectile.alpha = 255; - projectile.penetrate = 1; + projectile.penetrate = -1; projectile.extraUpdates = 5; projectile.timeLeft = 200; - } + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 2; + } public override void AI() { @@ -46,7 +48,7 @@ namespace CalamityMod.Projectiles Lighting.AddLight(projectile.Center, 0.4f, 0.2f, 0.4f); for (int num121 = 0; num121 < 5; num121++) { - Dust dust4 = Main.dust[Dust.NewDust(projectile.position, projectile.width, projectile.height, 242, projectile.velocity.X, projectile.velocity.Y, 100, default(Color), 1f)]; + Dust dust4 = Main.dust[Dust.NewDust(projectile.position, projectile.width, projectile.height, (Main.rand.Next(3) == 0 ? 56 : 242), projectile.velocity.X, projectile.velocity.Y, 100, default(Color), 1f)]; dust4.velocity = Vector2.Zero; dust4.position -= projectile.velocity / 5f * (float)num121; dust4.noGravity = true; @@ -54,5 +56,10 @@ namespace CalamityMod.Projectiles dust4.noLight = true; } } - } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(BuffID.Frostburn, 600); + } + } } \ No newline at end of file diff --git a/Projectiles/MagicNebulaShot.png b/Projectiles/Magic/MagicNebulaShot.png similarity index 100% rename from Projectiles/MagicNebulaShot.png rename to Projectiles/Magic/MagicNebulaShot.png diff --git a/Projectiles/MagnaBlast.cs b/Projectiles/Magic/MagnaBlast.cs similarity index 94% rename from Projectiles/MagnaBlast.cs rename to Projectiles/Magic/MagnaBlast.cs index 6d7d3929c9..283f91da5d 100644 --- a/Projectiles/MagnaBlast.cs +++ b/Projectiles/Magic/MagnaBlast.cs @@ -6,7 +6,7 @@ using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class MagnaBlast : ModProjectile { diff --git a/Projectiles/MagnaBlast.png b/Projectiles/Magic/MagnaBlast.png similarity index 100% rename from Projectiles/MagnaBlast.png rename to Projectiles/Magic/MagnaBlast.png diff --git a/Projectiles/MagneticBeam.cs b/Projectiles/Magic/MagneticBeam.cs similarity index 93% rename from Projectiles/MagneticBeam.cs rename to Projectiles/Magic/MagneticBeam.cs index 37338d6211..4b9e032a88 100644 --- a/Projectiles/MagneticBeam.cs +++ b/Projectiles/Magic/MagneticBeam.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class MagneticBeam : ModProjectile { diff --git a/Projectiles/MagneticBeam.png b/Projectiles/Magic/MagneticBeam.png similarity index 100% rename from Projectiles/MagneticBeam.png rename to Projectiles/Magic/MagneticBeam.png diff --git a/Projectiles/MagneticOrb.cs b/Projectiles/Magic/MagneticOrb.cs similarity index 96% rename from Projectiles/MagneticOrb.cs rename to Projectiles/Magic/MagneticOrb.cs index c450e3e37a..0ea4fffe33 100644 --- a/Projectiles/MagneticOrb.cs +++ b/Projectiles/Magic/MagneticOrb.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class MagneticOrb : ModProjectile { diff --git a/Projectiles/MagneticOrb.png b/Projectiles/Magic/MagneticOrb.png similarity index 100% rename from Projectiles/MagneticOrb.png rename to Projectiles/Magic/MagneticOrb.png diff --git a/Projectiles/ManaBolt.cs b/Projectiles/Magic/ManaBolt.cs similarity index 96% rename from Projectiles/ManaBolt.cs rename to Projectiles/Magic/ManaBolt.cs index 0a843f440c..bde8006eeb 100644 --- a/Projectiles/ManaBolt.cs +++ b/Projectiles/Magic/ManaBolt.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class ManaBolt : ModProjectile { diff --git a/Projectiles/ManaBolt.png b/Projectiles/Magic/ManaBolt.png similarity index 100% rename from Projectiles/ManaBolt.png rename to Projectiles/Magic/ManaBolt.png diff --git a/Projectiles/ManaBoltSmall.cs b/Projectiles/Magic/ManaBoltSmall.cs similarity index 94% rename from Projectiles/ManaBoltSmall.cs rename to Projectiles/Magic/ManaBoltSmall.cs index 29843d926c..e136e01886 100644 --- a/Projectiles/ManaBoltSmall.cs +++ b/Projectiles/Magic/ManaBoltSmall.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class ManaBoltSmall : ModProjectile { diff --git a/Projectiles/ManaBoltSmall.png b/Projectiles/Magic/ManaBoltSmall.png similarity index 100% rename from Projectiles/ManaBoltSmall.png rename to Projectiles/Magic/ManaBoltSmall.png diff --git a/Projectiles/ManaBoltSmall2.cs b/Projectiles/Magic/ManaBoltSmall2.cs similarity index 94% rename from Projectiles/ManaBoltSmall2.cs rename to Projectiles/Magic/ManaBoltSmall2.cs index 5714a72fd0..e5b88c7101 100644 --- a/Projectiles/ManaBoltSmall2.cs +++ b/Projectiles/Magic/ManaBoltSmall2.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class ManaBoltSmall2 : ModProjectile { diff --git a/Projectiles/ManaBoltSmall2.png b/Projectiles/Magic/ManaBoltSmall2.png similarity index 100% rename from Projectiles/ManaBoltSmall2.png rename to Projectiles/Magic/ManaBoltSmall2.png diff --git a/Projectiles/NightBolt.cs b/Projectiles/Magic/NightBolt.cs similarity index 93% rename from Projectiles/NightBolt.cs rename to Projectiles/Magic/NightBolt.cs index dbdb09b6fc..78b27cec46 100644 --- a/Projectiles/NightBolt.cs +++ b/Projectiles/Magic/NightBolt.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class NightBolt : ModProjectile { diff --git a/Projectiles/NightBolt.png b/Projectiles/Magic/NightBolt.png similarity index 100% rename from Projectiles/NightBolt.png rename to Projectiles/Magic/NightBolt.png diff --git a/Projectiles/NightOrb.cs b/Projectiles/Magic/NightOrb.cs similarity index 95% rename from Projectiles/NightOrb.cs rename to Projectiles/Magic/NightOrb.cs index 22995cc65c..de1e9829b5 100644 --- a/Projectiles/NightOrb.cs +++ b/Projectiles/Magic/NightOrb.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class NightOrb : ModProjectile { diff --git a/Projectiles/NightOrb.png b/Projectiles/Magic/NightOrb.png similarity index 100% rename from Projectiles/NightOrb.png rename to Projectiles/Magic/NightOrb.png diff --git a/Projectiles/NightRay.cs b/Projectiles/Magic/NightRay.cs similarity index 94% rename from Projectiles/NightRay.cs rename to Projectiles/Magic/NightRay.cs index 590b90d514..05a47481fa 100644 --- a/Projectiles/NightRay.cs +++ b/Projectiles/Magic/NightRay.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class NightRay : ModProjectile { diff --git a/Projectiles/NightRay.png b/Projectiles/Magic/NightRay.png similarity index 100% rename from Projectiles/NightRay.png rename to Projectiles/Magic/NightRay.png diff --git a/Projectiles/NuclearFuryProjectile.cs b/Projectiles/Magic/NuclearFuryProjectile.cs similarity index 95% rename from Projectiles/NuclearFuryProjectile.cs rename to Projectiles/Magic/NuclearFuryProjectile.cs index a084764886..79316173a8 100644 --- a/Projectiles/NuclearFuryProjectile.cs +++ b/Projectiles/Magic/NuclearFuryProjectile.cs @@ -7,7 +7,7 @@ using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class NuclearFuryProjectile : ModProjectile { diff --git a/Projectiles/NuclearFuryProjectile.png b/Projectiles/Magic/NuclearFuryProjectile.png similarity index 100% rename from Projectiles/NuclearFuryProjectile.png rename to Projectiles/Magic/NuclearFuryProjectile.png diff --git a/Projectiles/ParticleBeamofDoom.cs b/Projectiles/Magic/ParticleBeamofDoom.cs similarity index 93% rename from Projectiles/ParticleBeamofDoom.cs rename to Projectiles/Magic/ParticleBeamofDoom.cs index 46c8949c9d..4264b50970 100644 --- a/Projectiles/ParticleBeamofDoom.cs +++ b/Projectiles/Magic/ParticleBeamofDoom.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class ParticleBeamofDoom : ModProjectile { diff --git a/Projectiles/ParticleBeamofDoom.png b/Projectiles/Magic/ParticleBeamofDoom.png similarity index 100% rename from Projectiles/ParticleBeamofDoom.png rename to Projectiles/Magic/ParticleBeamofDoom.png diff --git a/Projectiles/PhantasmalFury.cs b/Projectiles/Magic/PhantasmalFury.cs similarity index 96% rename from Projectiles/PhantasmalFury.cs rename to Projectiles/Magic/PhantasmalFury.cs index 168a1265e4..e5c43b0dfa 100644 --- a/Projectiles/PhantasmalFury.cs +++ b/Projectiles/Magic/PhantasmalFury.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class PhantasmalFury : ModProjectile { diff --git a/Projectiles/PhantasmalFury.png b/Projectiles/Magic/PhantasmalFury.png similarity index 100% rename from Projectiles/PhantasmalFury.png rename to Projectiles/Magic/PhantasmalFury.png diff --git a/Projectiles/Phantom.cs b/Projectiles/Magic/Phantom.cs similarity index 95% rename from Projectiles/Phantom.cs rename to Projectiles/Magic/Phantom.cs index 1e06331144..cde33bb09c 100644 --- a/Projectiles/Phantom.cs +++ b/Projectiles/Magic/Phantom.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class Phantom : ModProjectile { diff --git a/Projectiles/Phantom.png b/Projectiles/Magic/Phantom.png similarity index 100% rename from Projectiles/Phantom.png rename to Projectiles/Magic/Phantom.png diff --git a/Projectiles/PlagueFang.cs b/Projectiles/Magic/PlagueFang.cs similarity index 94% rename from Projectiles/PlagueFang.cs rename to Projectiles/Magic/PlagueFang.cs index c95c39fbb3..a3bb3c1699 100644 --- a/Projectiles/PlagueFang.cs +++ b/Projectiles/Magic/PlagueFang.cs @@ -4,7 +4,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class PlagueFang : ModProjectile { diff --git a/Projectiles/PlagueFang.png b/Projectiles/Magic/PlagueFang.png similarity index 100% rename from Projectiles/PlagueFang.png rename to Projectiles/Magic/PlagueFang.png diff --git a/Projectiles/PlasmaBolt.cs b/Projectiles/Magic/PlasmaBolt.cs similarity index 93% rename from Projectiles/PlasmaBolt.cs rename to Projectiles/Magic/PlasmaBolt.cs index d6fc21388a..8f0e47d4b7 100644 --- a/Projectiles/PlasmaBolt.cs +++ b/Projectiles/Magic/PlasmaBolt.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class PlasmaBolt : ModProjectile { diff --git a/Projectiles/PlasmaBolt.png b/Projectiles/Magic/PlasmaBolt.png similarity index 100% rename from Projectiles/PlasmaBolt.png rename to Projectiles/Magic/PlasmaBolt.png diff --git a/Projectiles/PlasmaRay.cs b/Projectiles/Magic/PlasmaRay.cs similarity index 96% rename from Projectiles/PlasmaRay.cs rename to Projectiles/Magic/PlasmaRay.cs index 60bae4851c..75bf46dd4c 100644 --- a/Projectiles/PlasmaRay.cs +++ b/Projectiles/Magic/PlasmaRay.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class PlasmaRay : ModProjectile { diff --git a/Projectiles/PlasmaRay.png b/Projectiles/Magic/PlasmaRay.png similarity index 100% rename from Projectiles/PlasmaRay.png rename to Projectiles/Magic/PlasmaRay.png diff --git a/Projectiles/PlasmaRay2.cs b/Projectiles/Magic/PlasmaRay2.cs similarity index 95% rename from Projectiles/PlasmaRay2.cs rename to Projectiles/Magic/PlasmaRay2.cs index bb2f79454a..6f856ca2d2 100644 --- a/Projectiles/PlasmaRay2.cs +++ b/Projectiles/Magic/PlasmaRay2.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class PlasmaRay2 : ModProjectile { diff --git a/Projectiles/PlasmaRay2.png b/Projectiles/Magic/PlasmaRay2.png similarity index 100% rename from Projectiles/PlasmaRay2.png rename to Projectiles/Magic/PlasmaRay2.png diff --git a/Projectiles/PlasmaShot.cs b/Projectiles/Magic/PlasmaShot.cs similarity index 95% rename from Projectiles/PlasmaShot.cs rename to Projectiles/Magic/PlasmaShot.cs index 319e40f4f3..36b68935e3 100644 --- a/Projectiles/PlasmaShot.cs +++ b/Projectiles/Magic/PlasmaShot.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class PlasmaShot : ModProjectile { diff --git a/Projectiles/PlasmaShot.png b/Projectiles/Magic/PlasmaShot.png similarity index 100% rename from Projectiles/PlasmaShot.png rename to Projectiles/Magic/PlasmaShot.png diff --git a/Projectiles/Purge.cs b/Projectiles/Magic/Purge.cs similarity index 96% rename from Projectiles/Purge.cs rename to Projectiles/Magic/Purge.cs index 3839344b50..a1aec85b83 100644 --- a/Projectiles/Purge.cs +++ b/Projectiles/Magic/Purge.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class Purge : ModProjectile { diff --git a/Projectiles/Purge.png b/Projectiles/Magic/Purge.png similarity index 100% rename from Projectiles/Purge.png rename to Projectiles/Magic/Purge.png diff --git a/Projectiles/PurgeLaser.cs b/Projectiles/Magic/PurgeLaser.cs similarity index 96% rename from Projectiles/PurgeLaser.cs rename to Projectiles/Magic/PurgeLaser.cs index 966f1d82ef..86652a001a 100644 --- a/Projectiles/PurgeLaser.cs +++ b/Projectiles/Magic/PurgeLaser.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class PurgeLaser : ModProjectile { diff --git a/Projectiles/PurgeLaser.png b/Projectiles/Magic/PurgeLaser.png similarity index 100% rename from Projectiles/PurgeLaser.png rename to Projectiles/Magic/PurgeLaser.png diff --git a/Projectiles/RougeSlashLarge.cs b/Projectiles/Magic/RougeSlashLarge.cs similarity index 95% rename from Projectiles/RougeSlashLarge.cs rename to Projectiles/Magic/RougeSlashLarge.cs index 336d206613..b8e19a8e99 100644 --- a/Projectiles/RougeSlashLarge.cs +++ b/Projectiles/Magic/RougeSlashLarge.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class RougeSlashLarge : ModProjectile { diff --git a/Projectiles/RougeSlashLarge.png b/Projectiles/Magic/RougeSlashLarge.png similarity index 100% rename from Projectiles/RougeSlashLarge.png rename to Projectiles/Magic/RougeSlashLarge.png diff --git a/Projectiles/RougeSlashMedium.cs b/Projectiles/Magic/RougeSlashMedium.cs similarity index 95% rename from Projectiles/RougeSlashMedium.cs rename to Projectiles/Magic/RougeSlashMedium.cs index 467f34f961..aff68dc9b5 100644 --- a/Projectiles/RougeSlashMedium.cs +++ b/Projectiles/Magic/RougeSlashMedium.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class RougeSlashMedium : ModProjectile { diff --git a/Projectiles/RougeSlashMedium.png b/Projectiles/Magic/RougeSlashMedium.png similarity index 100% rename from Projectiles/RougeSlashMedium.png rename to Projectiles/Magic/RougeSlashMedium.png diff --git a/Projectiles/RougeSlashSmall.cs b/Projectiles/Magic/RougeSlashSmall.cs similarity index 95% rename from Projectiles/RougeSlashSmall.cs rename to Projectiles/Magic/RougeSlashSmall.cs index 6f446433cb..f2b1384200 100644 --- a/Projectiles/RougeSlashSmall.cs +++ b/Projectiles/Magic/RougeSlashSmall.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class RougeSlashSmall : ModProjectile { diff --git a/Projectiles/RougeSlashSmall.png b/Projectiles/Magic/RougeSlashSmall.png similarity index 100% rename from Projectiles/RougeSlashSmall.png rename to Projectiles/Magic/RougeSlashSmall.png diff --git a/Projectiles/SHPB.cs b/Projectiles/Magic/SHPB.cs similarity index 96% rename from Projectiles/SHPB.cs rename to Projectiles/Magic/SHPB.cs index dd10e1620c..bce38df1f9 100644 --- a/Projectiles/SHPB.cs +++ b/Projectiles/Magic/SHPB.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class SHPB : ModProjectile { diff --git a/Projectiles/SHPB.png b/Projectiles/Magic/SHPB.png similarity index 100% rename from Projectiles/SHPB.png rename to Projectiles/Magic/SHPB.png diff --git a/Projectiles/SHPExplosion.cs b/Projectiles/Magic/SHPExplosion.cs similarity index 95% rename from Projectiles/SHPExplosion.cs rename to Projectiles/Magic/SHPExplosion.cs index 80209bcf34..a89983cd35 100644 --- a/Projectiles/SHPExplosion.cs +++ b/Projectiles/Magic/SHPExplosion.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class SHPExplosion : ModProjectile { diff --git a/Projectiles/SHPExplosion.png b/Projectiles/Magic/SHPExplosion.png similarity index 100% rename from Projectiles/SHPExplosion.png rename to Projectiles/Magic/SHPExplosion.png diff --git a/Projectiles/SHPL.cs b/Projectiles/Magic/SHPL.cs similarity index 96% rename from Projectiles/SHPL.cs rename to Projectiles/Magic/SHPL.cs index 8b9d840cc1..b939b48444 100644 --- a/Projectiles/SHPL.cs +++ b/Projectiles/Magic/SHPL.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class SHPL : ModProjectile { diff --git a/Projectiles/SHPL.png b/Projectiles/Magic/SHPL.png similarity index 100% rename from Projectiles/SHPL.png rename to Projectiles/Magic/SHPL.png diff --git a/Projectiles/SanguineFlare.cs b/Projectiles/Magic/SanguineFlare.cs similarity index 94% rename from Projectiles/SanguineFlare.cs rename to Projectiles/Magic/SanguineFlare.cs index 5e5c70b2be..1968b25989 100644 --- a/Projectiles/SanguineFlare.cs +++ b/Projectiles/Magic/SanguineFlare.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class SanguineFlare : ModProjectile { @@ -85,7 +85,7 @@ namespace CalamityMod.Projectiles public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (target.type == NPCID.TargetDummy) + if (target.type == NPCID.TargetDummy || !target.canGhostHeal) { return; } diff --git a/Projectiles/SanguineFlare.png b/Projectiles/Magic/SanguineFlare.png similarity index 100% rename from Projectiles/SanguineFlare.png rename to Projectiles/Magic/SanguineFlare.png diff --git a/Projectiles/SeethingDischargeBrimstoneBarrage.cs b/Projectiles/Magic/SeethingDischargeBrimstoneBarrage.cs similarity index 95% rename from Projectiles/SeethingDischargeBrimstoneBarrage.cs rename to Projectiles/Magic/SeethingDischargeBrimstoneBarrage.cs index 41c49cc86b..9f4ffa7805 100644 --- a/Projectiles/SeethingDischargeBrimstoneBarrage.cs +++ b/Projectiles/Magic/SeethingDischargeBrimstoneBarrage.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class SeethingDischargeBrimstoneBarrage : ModProjectile { diff --git a/Projectiles/SeethingDischargeBrimstoneBarrage.png b/Projectiles/Magic/SeethingDischargeBrimstoneBarrage.png similarity index 100% rename from Projectiles/SeethingDischargeBrimstoneBarrage.png rename to Projectiles/Magic/SeethingDischargeBrimstoneBarrage.png diff --git a/Projectiles/SeethingDischargeBrimstoneHellblast.cs b/Projectiles/Magic/SeethingDischargeBrimstoneHellblast.cs similarity index 95% rename from Projectiles/SeethingDischargeBrimstoneHellblast.cs rename to Projectiles/Magic/SeethingDischargeBrimstoneHellblast.cs index 0eb92dc71e..37bc6fe581 100644 --- a/Projectiles/SeethingDischargeBrimstoneHellblast.cs +++ b/Projectiles/Magic/SeethingDischargeBrimstoneHellblast.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class SeethingDischargeBrimstoneHellblast : ModProjectile { diff --git a/Projectiles/SeethingDischargeBrimstoneHellblast.png b/Projectiles/Magic/SeethingDischargeBrimstoneHellblast.png similarity index 100% rename from Projectiles/SeethingDischargeBrimstoneHellblast.png rename to Projectiles/Magic/SeethingDischargeBrimstoneHellblast.png diff --git a/Projectiles/ShadeNimbus.cs b/Projectiles/Magic/ShadeNimbus.cs similarity index 94% rename from Projectiles/ShadeNimbus.cs rename to Projectiles/Magic/ShadeNimbus.cs index d27b82d341..730d6a76a1 100644 --- a/Projectiles/ShadeNimbus.cs +++ b/Projectiles/Magic/ShadeNimbus.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class ShadeNimbus : ModProjectile { diff --git a/Projectiles/ShadeNimbus.png b/Projectiles/Magic/ShadeNimbus.png similarity index 100% rename from Projectiles/ShadeNimbus.png rename to Projectiles/Magic/ShadeNimbus.png diff --git a/Projectiles/ShadeNimbusCloud.cs b/Projectiles/Magic/ShadeNimbusCloud.cs similarity index 94% rename from Projectiles/ShadeNimbusCloud.cs rename to Projectiles/Magic/ShadeNimbusCloud.cs index 0fc5d2d855..e1b65c72dd 100644 --- a/Projectiles/ShadeNimbusCloud.cs +++ b/Projectiles/Magic/ShadeNimbusCloud.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class ShadeNimbusCloud : ModProjectile { diff --git a/Projectiles/ShadeNimbusCloud.png b/Projectiles/Magic/ShadeNimbusCloud.png similarity index 100% rename from Projectiles/ShadeNimbusCloud.png rename to Projectiles/Magic/ShadeNimbusCloud.png diff --git a/Projectiles/ShadecrystalProjectile.cs b/Projectiles/Magic/ShadecrystalProjectile.cs similarity index 94% rename from Projectiles/ShadecrystalProjectile.cs rename to Projectiles/Magic/ShadecrystalProjectile.cs index 4879b0fa50..19ee0d212a 100644 --- a/Projectiles/ShadecrystalProjectile.cs +++ b/Projectiles/Magic/ShadecrystalProjectile.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class ShadecrystalProjectile : ModProjectile { diff --git a/Projectiles/ShadecrystalProjectile.png b/Projectiles/Magic/ShadecrystalProjectile.png similarity index 100% rename from Projectiles/ShadecrystalProjectile.png rename to Projectiles/Magic/ShadecrystalProjectile.png diff --git a/Projectiles/Shaderain.cs b/Projectiles/Magic/Shaderain.cs similarity index 93% rename from Projectiles/Shaderain.cs rename to Projectiles/Magic/Shaderain.cs index af248b3d8c..ba3ac317ea 100644 --- a/Projectiles/Shaderain.cs +++ b/Projectiles/Magic/Shaderain.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class Shaderain : ModProjectile { diff --git a/Projectiles/Shaderain.png b/Projectiles/Magic/Shaderain.png similarity index 100% rename from Projectiles/Shaderain.png rename to Projectiles/Magic/Shaderain.png diff --git a/Projectiles/Shadowbolt.cs b/Projectiles/Magic/Shadowbolt.cs similarity index 95% rename from Projectiles/Shadowbolt.cs rename to Projectiles/Magic/Shadowbolt.cs index 6a6fafe133..ed8185fdc5 100644 --- a/Projectiles/Shadowbolt.cs +++ b/Projectiles/Magic/Shadowbolt.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class Shadowbolt : ModProjectile { diff --git a/Projectiles/Shadowbolt.png b/Projectiles/Magic/Shadowbolt.png similarity index 100% rename from Projectiles/Shadowbolt.png rename to Projectiles/Magic/Shadowbolt.png diff --git a/Projectiles/ShiftingSands.cs b/Projectiles/Magic/ShiftingSands.cs similarity index 97% rename from Projectiles/ShiftingSands.cs rename to Projectiles/Magic/ShiftingSands.cs index 260471a8f4..4534f9f1ff 100644 --- a/Projectiles/ShiftingSands.cs +++ b/Projectiles/Magic/ShiftingSands.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class ShiftingSands : ModProjectile { diff --git a/Projectiles/ShiftingSands.png b/Projectiles/Magic/ShiftingSands.png similarity index 100% rename from Projectiles/ShiftingSands.png rename to Projectiles/Magic/ShiftingSands.png diff --git a/Projectiles/SirensSong.cs b/Projectiles/Magic/SirensSong.cs similarity index 70% rename from Projectiles/SirensSong.cs rename to Projectiles/Magic/SirensSong.cs index 5e7d2d0549..ac6bae851d 100644 --- a/Projectiles/SirensSong.cs +++ b/Projectiles/Magic/SirensSong.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class SirensSong : ModProjectile { @@ -45,9 +45,21 @@ namespace CalamityMod.Projectiles projectile.localAI[0] = 0f; } } - } + if (projectile.ai[1] == 0f) + { + projectile.ai[1] = 1f; + Main.harpNote = projectile.ai[0]; + Main.PlaySound(SoundID.Item26, projectile.position); + } + Lighting.AddLight(projectile.Center, 0f, 1.2f, 0f); + } - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + public override Color? GetAlpha(Color lightColor) + { + return new Color(255, 255, 255, 0); + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.immune[projectile.owner] = 7; target.AddBuff(BuffID.Confused, 300); diff --git a/Projectiles/SirensSong.png b/Projectiles/Magic/SirensSong.png similarity index 73% rename from Projectiles/SirensSong.png rename to Projectiles/Magic/SirensSong.png index 2d410bffb7..2ec8ea38c0 100644 Binary files a/Projectiles/SirensSong.png and b/Projectiles/Magic/SirensSong.png differ diff --git a/Projectiles/Snowflake.cs b/Projectiles/Magic/Snowflake.cs similarity index 95% rename from Projectiles/Snowflake.cs rename to Projectiles/Magic/Snowflake.cs index df5a795dd0..5d9814fc44 100644 --- a/Projectiles/Snowflake.cs +++ b/Projectiles/Magic/Snowflake.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class Snowflake : ModProjectile { diff --git a/Projectiles/Snowflake.png b/Projectiles/Magic/Snowflake.png similarity index 100% rename from Projectiles/Snowflake.png rename to Projectiles/Magic/Snowflake.png diff --git a/Projectiles/SolarBeam2.cs b/Projectiles/Magic/SolarBeam2.cs similarity index 94% rename from Projectiles/SolarBeam2.cs rename to Projectiles/Magic/SolarBeam2.cs index 6713dfc5c5..adc62fac4e 100644 --- a/Projectiles/SolarBeam2.cs +++ b/Projectiles/Magic/SolarBeam2.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class SolarBeam2 : ModProjectile { @@ -62,7 +62,6 @@ namespace CalamityMod.Projectiles Main.dust[num448].scale = (float)Main.rand.Next(70, 110) * 0.013f; Main.dust[num448].velocity *= 0.2f; } - return; } } diff --git a/Projectiles/SolarBeam2.png b/Projectiles/Magic/SolarBeam2.png similarity index 100% rename from Projectiles/SolarBeam2.png rename to Projectiles/Magic/SolarBeam2.png diff --git a/Projectiles/SoulPiercer.cs b/Projectiles/Magic/SoulPiercer.cs similarity index 95% rename from Projectiles/SoulPiercer.cs rename to Projectiles/Magic/SoulPiercer.cs index 45594071fc..f1d6db0f07 100644 --- a/Projectiles/SoulPiercer.cs +++ b/Projectiles/Magic/SoulPiercer.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class SoulPiercer : ModProjectile { diff --git a/Projectiles/SoulPiercer.png b/Projectiles/Magic/SoulPiercer.png similarity index 100% rename from Projectiles/SoulPiercer.png rename to Projectiles/Magic/SoulPiercer.png diff --git a/Projectiles/SoulPiercerBolt.cs b/Projectiles/Magic/SoulPiercerBolt.cs similarity index 94% rename from Projectiles/SoulPiercerBolt.cs rename to Projectiles/Magic/SoulPiercerBolt.cs index 7a227c379b..00921fa75e 100644 --- a/Projectiles/SoulPiercerBolt.cs +++ b/Projectiles/Magic/SoulPiercerBolt.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class SoulPiercerBolt : ModProjectile { diff --git a/Projectiles/SoulPiercerBolt.png b/Projectiles/Magic/SoulPiercerBolt.png similarity index 100% rename from Projectiles/SoulPiercerBolt.png rename to Projectiles/Magic/SoulPiercerBolt.png diff --git a/Projectiles/SoulPiercerOrb.cs b/Projectiles/Magic/SoulPiercerOrb.cs similarity index 95% rename from Projectiles/SoulPiercerOrb.cs rename to Projectiles/Magic/SoulPiercerOrb.cs index 342ed03b57..5f9fd6f84c 100644 --- a/Projectiles/SoulPiercerOrb.cs +++ b/Projectiles/Magic/SoulPiercerOrb.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class SoulPiercerOrb : ModProjectile { diff --git a/Projectiles/SoulPiercerOrb.png b/Projectiles/Magic/SoulPiercerOrb.png similarity index 100% rename from Projectiles/SoulPiercerOrb.png rename to Projectiles/Magic/SoulPiercerOrb.png diff --git a/Projectiles/SpiritFlameCurse.cs b/Projectiles/Magic/SpiritFlameCurse.cs similarity index 95% rename from Projectiles/SpiritFlameCurse.cs rename to Projectiles/Magic/SpiritFlameCurse.cs index 82edc40025..91c6bdf7a6 100644 --- a/Projectiles/SpiritFlameCurse.cs +++ b/Projectiles/Magic/SpiritFlameCurse.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class SpiritFlameCurse : ModProjectile { diff --git a/Projectiles/SpiritFlameCurse.png b/Projectiles/Magic/SpiritFlameCurse.png similarity index 100% rename from Projectiles/SpiritFlameCurse.png rename to Projectiles/Magic/SpiritFlameCurse.png diff --git a/Projectiles/Starblast.cs b/Projectiles/Magic/Starblast.cs similarity index 95% rename from Projectiles/Starblast.cs rename to Projectiles/Magic/Starblast.cs index 6c36b3f03c..7f6108cf50 100644 --- a/Projectiles/Starblast.cs +++ b/Projectiles/Magic/Starblast.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class Starblast : ModProjectile { diff --git a/Projectiles/Starblast.png b/Projectiles/Magic/Starblast.png similarity index 100% rename from Projectiles/Starblast.png rename to Projectiles/Magic/Starblast.png diff --git a/Projectiles/StarfleetMK2.cs b/Projectiles/Magic/StarfleetMK2.cs similarity index 97% rename from Projectiles/StarfleetMK2.cs rename to Projectiles/Magic/StarfleetMK2.cs index 5b906a5448..a2ddc706ba 100644 --- a/Projectiles/StarfleetMK2.cs +++ b/Projectiles/Magic/StarfleetMK2.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class StarfleetMK2 : ModProjectile { diff --git a/Projectiles/StarfleetMK2.png b/Projectiles/Magic/StarfleetMK2.png similarity index 100% rename from Projectiles/StarfleetMK2.png rename to Projectiles/Magic/StarfleetMK2.png diff --git a/Projectiles/StickyFeather.cs b/Projectiles/Magic/StickyFeather.cs similarity index 95% rename from Projectiles/StickyFeather.cs rename to Projectiles/Magic/StickyFeather.cs index c8a05915ff..0af41b50df 100644 --- a/Projectiles/StickyFeather.cs +++ b/Projectiles/Magic/StickyFeather.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class StickyFeather : ModProjectile { diff --git a/Projectiles/StickyFeather.png b/Projectiles/Magic/StickyFeather.png similarity index 100% rename from Projectiles/StickyFeather.png rename to Projectiles/Magic/StickyFeather.png diff --git a/Projectiles/SupremeDustFlakProjectile.cs b/Projectiles/Magic/SupremeDustFlakProjectile.cs similarity index 95% rename from Projectiles/SupremeDustFlakProjectile.cs rename to Projectiles/Magic/SupremeDustFlakProjectile.cs index 6c65c201e0..8e6f725fc6 100644 --- a/Projectiles/SupremeDustFlakProjectile.cs +++ b/Projectiles/Magic/SupremeDustFlakProjectile.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class SupremeDustFlakProjectile : ModProjectile { diff --git a/Projectiles/SupremeDustFlakProjectile.png b/Projectiles/Magic/SupremeDustFlakProjectile.png similarity index 100% rename from Projectiles/SupremeDustFlakProjectile.png rename to Projectiles/Magic/SupremeDustFlakProjectile.png diff --git a/Projectiles/SupremeDustProjectile.cs b/Projectiles/Magic/SupremeDustProjectile.cs similarity index 96% rename from Projectiles/SupremeDustProjectile.cs rename to Projectiles/Magic/SupremeDustProjectile.cs index b0a014da10..174a657d1a 100644 --- a/Projectiles/SupremeDustProjectile.cs +++ b/Projectiles/Magic/SupremeDustProjectile.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class SupremeDustProjectile : ModProjectile { diff --git a/Projectiles/SupremeDustProjectile.png b/Projectiles/Magic/SupremeDustProjectile.png similarity index 100% rename from Projectiles/SupremeDustProjectile.png rename to Projectiles/Magic/SupremeDustProjectile.png diff --git a/Projectiles/T1000.cs b/Projectiles/Magic/T1000.cs similarity index 96% rename from Projectiles/T1000.cs rename to Projectiles/Magic/T1000.cs index b01018bee8..9f62ceff5a 100644 --- a/Projectiles/T1000.cs +++ b/Projectiles/Magic/T1000.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class T1000 : ModProjectile { diff --git a/Projectiles/T1000.png b/Projectiles/Magic/T1000.png similarity index 100% rename from Projectiles/T1000.png rename to Projectiles/Magic/T1000.png diff --git a/Projectiles/T1000Laser.cs b/Projectiles/Magic/T1000Laser.cs similarity index 96% rename from Projectiles/T1000Laser.cs rename to Projectiles/Magic/T1000Laser.cs index cfc90a08fe..8fbd4d793d 100644 --- a/Projectiles/T1000Laser.cs +++ b/Projectiles/Magic/T1000Laser.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class T1000Laser : ModProjectile { diff --git a/Projectiles/T1000Laser.png b/Projectiles/Magic/T1000Laser.png similarity index 100% rename from Projectiles/T1000Laser.png rename to Projectiles/Magic/T1000Laser.png diff --git a/Projectiles/TearsofHeavenProjectile.cs b/Projectiles/Magic/TearsofHeavenProjectile.cs similarity index 96% rename from Projectiles/TearsofHeavenProjectile.cs rename to Projectiles/Magic/TearsofHeavenProjectile.cs index 77ff24a4d4..3607dbd159 100644 --- a/Projectiles/TearsofHeavenProjectile.cs +++ b/Projectiles/Magic/TearsofHeavenProjectile.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class TearsofHeavenProjectile : ModProjectile { diff --git a/Projectiles/TearsofHeavenProjectile.png b/Projectiles/Magic/TearsofHeavenProjectile.png similarity index 100% rename from Projectiles/TearsofHeavenProjectile.png rename to Projectiles/Magic/TearsofHeavenProjectile.png diff --git a/Projectiles/TerraBolt.cs b/Projectiles/Magic/TerraBolt.cs similarity index 94% rename from Projectiles/TerraBolt.cs rename to Projectiles/Magic/TerraBolt.cs index 5bb4cea455..8b47a5a803 100644 --- a/Projectiles/TerraBolt.cs +++ b/Projectiles/Magic/TerraBolt.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class TerraBolt : ModProjectile { diff --git a/Projectiles/TerraBolt.png b/Projectiles/Magic/TerraBolt.png similarity index 100% rename from Projectiles/TerraBolt.png rename to Projectiles/Magic/TerraBolt.png diff --git a/Projectiles/TerraBolt2.cs b/Projectiles/Magic/TerraBolt2.cs similarity index 93% rename from Projectiles/TerraBolt2.cs rename to Projectiles/Magic/TerraBolt2.cs index 4a4b6050be..5331751b50 100644 --- a/Projectiles/TerraBolt2.cs +++ b/Projectiles/Magic/TerraBolt2.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class TerraBolt2 : ModProjectile { diff --git a/Projectiles/TerraBolt2.png b/Projectiles/Magic/TerraBolt2.png similarity index 100% rename from Projectiles/TerraBolt2.png rename to Projectiles/Magic/TerraBolt2.png diff --git a/Projectiles/TerraOrb.cs b/Projectiles/Magic/TerraOrb.cs similarity index 95% rename from Projectiles/TerraOrb.cs rename to Projectiles/Magic/TerraOrb.cs index a76bfb2616..ae843a4a86 100644 --- a/Projectiles/TerraOrb.cs +++ b/Projectiles/Magic/TerraOrb.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class TerraOrb : ModProjectile { diff --git a/Projectiles/TerraOrb.png b/Projectiles/Magic/TerraOrb.png similarity index 100% rename from Projectiles/TerraOrb.png rename to Projectiles/Magic/TerraOrb.png diff --git a/Projectiles/TerraOrb2.cs b/Projectiles/Magic/TerraOrb2.cs similarity index 95% rename from Projectiles/TerraOrb2.cs rename to Projectiles/Magic/TerraOrb2.cs index 3289f09e43..f24c7478bd 100644 --- a/Projectiles/TerraOrb2.cs +++ b/Projectiles/Magic/TerraOrb2.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class TerraOrb2 : ModProjectile { diff --git a/Projectiles/TerraOrb2.png b/Projectiles/Magic/TerraOrb2.png similarity index 100% rename from Projectiles/TerraOrb2.png rename to Projectiles/Magic/TerraOrb2.png diff --git a/Projectiles/TerraRay.cs b/Projectiles/Magic/TerraRay.cs similarity index 94% rename from Projectiles/TerraRay.cs rename to Projectiles/Magic/TerraRay.cs index 60b5b60f10..c911f425ef 100644 --- a/Projectiles/TerraRay.cs +++ b/Projectiles/Magic/TerraRay.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class TerraRay : ModProjectile { diff --git a/Projectiles/TerraRay.png b/Projectiles/Magic/TerraRay.png similarity index 100% rename from Projectiles/TerraRay.png rename to Projectiles/Magic/TerraRay.png diff --git a/Projectiles/TradewindsProjectile.cs b/Projectiles/Magic/TradewindsProjectile.cs similarity index 94% rename from Projectiles/TradewindsProjectile.cs rename to Projectiles/Magic/TradewindsProjectile.cs index e66598bd9b..41960e1c0a 100644 --- a/Projectiles/TradewindsProjectile.cs +++ b/Projectiles/Magic/TradewindsProjectile.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class TradewindsProjectile : ModProjectile { diff --git a/Projectiles/TradewindsProjectile.png b/Projectiles/Magic/TradewindsProjectile.png similarity index 100% rename from Projectiles/TradewindsProjectile.png rename to Projectiles/Magic/TradewindsProjectile.png diff --git a/Projectiles/UberBubble.cs b/Projectiles/Magic/UberBubble.cs similarity index 95% rename from Projectiles/UberBubble.cs rename to Projectiles/Magic/UberBubble.cs index b77304f5f5..ecd2c6bf98 100644 --- a/Projectiles/UberBubble.cs +++ b/Projectiles/Magic/UberBubble.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class UberBubble : ModProjectile { diff --git a/Projectiles/UberBubble.png b/Projectiles/Magic/UberBubble.png similarity index 100% rename from Projectiles/UberBubble.png rename to Projectiles/Magic/UberBubble.png diff --git a/Projectiles/UndinesRetribution.cs b/Projectiles/Magic/UndinesRetribution.cs similarity index 97% rename from Projectiles/UndinesRetribution.cs rename to Projectiles/Magic/UndinesRetribution.cs index 300f378ffa..d2fa0c339d 100644 --- a/Projectiles/UndinesRetribution.cs +++ b/Projectiles/Magic/UndinesRetribution.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class UndinesRetribution : ModProjectile { diff --git a/Projectiles/UndinesRetribution.png b/Projectiles/Magic/UndinesRetribution.png similarity index 100% rename from Projectiles/UndinesRetribution.png rename to Projectiles/Magic/UndinesRetribution.png diff --git a/Projectiles/Vehemence.cs b/Projectiles/Magic/Vehemence.cs similarity index 75% rename from Projectiles/Vehemence.cs rename to Projectiles/Magic/Vehemence.cs index 4091f7950e..040966af11 100644 --- a/Projectiles/Vehemence.cs +++ b/Projectiles/Magic/Vehemence.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class Vehemence : ModProjectile { @@ -28,7 +28,8 @@ namespace CalamityMod.Projectiles public override void AI() { - Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0.45f) / 255f, ((255 - projectile.alpha) * 0f) / 255f, ((255 - projectile.alpha) * 0.45f) / 255f); + projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; + Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0.45f) / 255f, ((255 - projectile.alpha) * 0f) / 255f, ((255 - projectile.alpha) * 0.45f) / 255f); for (int num457 = 0; num457 < 2; num457++) { int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 65, 0f, 0f, 100, default(Color), 2f); @@ -36,18 +37,6 @@ namespace CalamityMod.Projectiles Main.dust[num458].velocity *= 0.15f; Main.dust[num458].velocity += projectile.velocity * 0.1f; } - if ((double)Math.Abs(projectile.velocity.X) > 0.2) - { - projectile.spriteDirection = -projectile.direction; - } - if (projectile.velocity.X < 0f) - { - projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X); - } - else - { - projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X); - } } public override void Kill(int timeLeft) diff --git a/Projectiles/Magic/Vehemence.png b/Projectiles/Magic/Vehemence.png new file mode 100644 index 0000000000..940cd6a110 Binary files /dev/null and b/Projectiles/Magic/Vehemence.png differ diff --git a/Projectiles/VenusianBolt.cs b/Projectiles/Magic/VenusianBolt.cs similarity index 95% rename from Projectiles/VenusianBolt.cs rename to Projectiles/Magic/VenusianBolt.cs index f8671ad033..8d7246d5a8 100644 --- a/Projectiles/VenusianBolt.cs +++ b/Projectiles/Magic/VenusianBolt.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class VenusianBolt : ModProjectile { diff --git a/Projectiles/VenusianBolt.png b/Projectiles/Magic/VenusianBolt.png similarity index 100% rename from Projectiles/VenusianBolt.png rename to Projectiles/Magic/VenusianBolt.png diff --git a/Projectiles/VenusianExplosion.cs b/Projectiles/Magic/VenusianExplosion.cs similarity index 95% rename from Projectiles/VenusianExplosion.cs rename to Projectiles/Magic/VenusianExplosion.cs index ce1c501150..13b8f59ef3 100644 --- a/Projectiles/VenusianExplosion.cs +++ b/Projectiles/Magic/VenusianExplosion.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class VenusianExplosion : ModProjectile { diff --git a/Projectiles/VenusianExplosion.png b/Projectiles/Magic/VenusianExplosion.png similarity index 100% rename from Projectiles/VenusianExplosion.png rename to Projectiles/Magic/VenusianExplosion.png diff --git a/Projectiles/VenusianFlame.cs b/Projectiles/Magic/VenusianFlame.cs similarity index 95% rename from Projectiles/VenusianFlame.cs rename to Projectiles/Magic/VenusianFlame.cs index 76ac811aa7..a28b8310ea 100644 --- a/Projectiles/VenusianFlame.cs +++ b/Projectiles/Magic/VenusianFlame.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class VenusianFlame : ModProjectile { diff --git a/Projectiles/VenusianFlame.png b/Projectiles/Magic/VenusianFlame.png similarity index 100% rename from Projectiles/VenusianFlame.png rename to Projectiles/Magic/VenusianFlame.png diff --git a/Projectiles/Viscera.cs b/Projectiles/Magic/Viscera.cs similarity index 86% rename from Projectiles/Viscera.cs rename to Projectiles/Magic/Viscera.cs index 04c5ffb7be..3715a5b36e 100644 --- a/Projectiles/Viscera.cs +++ b/Projectiles/Magic/Viscera.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class Viscera : ModProjectile { @@ -54,14 +54,10 @@ namespace CalamityMod.Projectiles public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (target.type == NPCID.TargetDummy) + if (target.type == NPCID.TargetDummy || !target.canGhostHeal) { return; } - if (target.type == mod.NPCType("DevourerofGodsBody") || target.type == mod.NPCType("DevourerofGodsBodyS")) - { - healAmt *= 0.4f; - } healAmt *= 1.4f; Player player = Main.player[projectile.owner]; player.statLife += (int)healAmt; diff --git a/Projectiles/Viscera.png b/Projectiles/Magic/Viscera.png similarity index 100% rename from Projectiles/Viscera.png rename to Projectiles/Magic/Viscera.png diff --git a/Projectiles/VividBolt.cs b/Projectiles/Magic/VividBolt.cs similarity index 94% rename from Projectiles/VividBolt.cs rename to Projectiles/Magic/VividBolt.cs index c49ec3f18a..9ee9e59142 100644 --- a/Projectiles/VividBolt.cs +++ b/Projectiles/Magic/VividBolt.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class VividBolt : ModProjectile { diff --git a/Projectiles/VividBolt.png b/Projectiles/Magic/VividBolt.png similarity index 100% rename from Projectiles/VividBolt.png rename to Projectiles/Magic/VividBolt.png diff --git a/Projectiles/VividClarity.cs b/Projectiles/Magic/VividClarity.cs similarity index 95% rename from Projectiles/VividClarity.cs rename to Projectiles/Magic/VividClarity.cs index b3b6fef941..deb8fecea1 100644 --- a/Projectiles/VividClarity.cs +++ b/Projectiles/Magic/VividClarity.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class VividClarity : ModProjectile { diff --git a/Projectiles/VividClarity.png b/Projectiles/Magic/VividClarity.png similarity index 100% rename from Projectiles/VividClarity.png rename to Projectiles/Magic/VividClarity.png diff --git a/Projectiles/VividOrb.cs b/Projectiles/Magic/VividOrb.cs similarity index 95% rename from Projectiles/VividOrb.cs rename to Projectiles/Magic/VividOrb.cs index c91def5c3e..ae85f59311 100644 --- a/Projectiles/VividOrb.cs +++ b/Projectiles/Magic/VividOrb.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class VividOrb : ModProjectile { diff --git a/Projectiles/VividOrb.png b/Projectiles/Magic/VividOrb.png similarity index 100% rename from Projectiles/VividOrb.png rename to Projectiles/Magic/VividOrb.png diff --git a/Projectiles/Vortex.cs b/Projectiles/Magic/Vortex.cs similarity index 95% rename from Projectiles/Vortex.cs rename to Projectiles/Magic/Vortex.cs index cd9ae15dbe..2ad98d3bc6 100644 --- a/Projectiles/Vortex.cs +++ b/Projectiles/Magic/Vortex.cs @@ -7,7 +7,7 @@ using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class Vortex : ModProjectile { @@ -21,8 +21,8 @@ namespace CalamityMod.Projectiles public override void SetDefaults() { - projectile.width = 30; - projectile.height = 30; + projectile.width = 60; + projectile.height = 60; projectile.alpha = 255; projectile.friendly = true; projectile.magic = true; diff --git a/Projectiles/Vortex.png b/Projectiles/Magic/Vortex.png similarity index 100% rename from Projectiles/Vortex.png rename to Projectiles/Magic/Vortex.png diff --git a/Projectiles/WaterStream.cs b/Projectiles/Magic/WaterStream.cs similarity index 95% rename from Projectiles/WaterStream.cs rename to Projectiles/Magic/WaterStream.cs index 49b8be8c33..e19a9a983b 100644 --- a/Projectiles/WaterStream.cs +++ b/Projectiles/Magic/WaterStream.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class WaterStream : ModProjectile { diff --git a/Projectiles/WaterStream.png b/Projectiles/Magic/WaterStream.png similarity index 100% rename from Projectiles/WaterStream.png rename to Projectiles/Magic/WaterStream.png diff --git a/Projectiles/WaterStream2.cs b/Projectiles/Magic/WaterStream2.cs similarity index 95% rename from Projectiles/WaterStream2.cs rename to Projectiles/Magic/WaterStream2.cs index 33cf652eaa..f082b0c584 100644 --- a/Projectiles/WaterStream2.cs +++ b/Projectiles/Magic/WaterStream2.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class WaterStream2 : ModProjectile { diff --git a/Projectiles/WaterStream2.png b/Projectiles/Magic/WaterStream2.png similarity index 100% rename from Projectiles/WaterStream2.png rename to Projectiles/Magic/WaterStream2.png diff --git a/Projectiles/WhiteFlame.cs b/Projectiles/Magic/WhiteFlame.cs similarity index 95% rename from Projectiles/WhiteFlame.cs rename to Projectiles/Magic/WhiteFlame.cs index aa20b41957..a3be4dbd33 100644 --- a/Projectiles/WhiteFlame.cs +++ b/Projectiles/Magic/WhiteFlame.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class WhiteFlame : ModProjectile { @@ -35,7 +35,6 @@ namespace CalamityMod.Projectiles Main.dust[num458].velocity *= 0.5f; Main.dust[num458].velocity += projectile.velocity * 0.1f; } - return; } public override void Kill(int timeLeft) diff --git a/Projectiles/WhiteFlame.png b/Projectiles/Magic/WhiteFlame.png similarity index 100% rename from Projectiles/WhiteFlame.png rename to Projectiles/Magic/WhiteFlame.png diff --git a/Projectiles/WhiteFlame2.cs b/Projectiles/Magic/WhiteFlame2.cs similarity index 92% rename from Projectiles/WhiteFlame2.cs rename to Projectiles/Magic/WhiteFlame2.cs index f81b0cb4bc..0e5e7a6bdb 100644 --- a/Projectiles/WhiteFlame2.cs +++ b/Projectiles/Magic/WhiteFlame2.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class WhiteFlame2 : ModProjectile { @@ -24,7 +24,9 @@ namespace CalamityMod.Projectiles projectile.ignoreWater = true; projectile.tileCollide = false; projectile.penetrate = 3; - projectile.timeLeft = 120; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 1; + projectile.timeLeft = 120; projectile.magic = true; } @@ -71,14 +73,11 @@ namespace CalamityMod.Projectiles num485 *= num486; projectile.velocity.X = (projectile.velocity.X * 20f + num484) / 21f; projectile.velocity.Y = (projectile.velocity.Y * 20f + num485) / 21f; - return; } - return; } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - target.immune[projectile.owner] = 1; target.AddBuff(mod.BuffType("HolyLight"), 360); } } diff --git a/Projectiles/WhiteFlame2.png b/Projectiles/Magic/WhiteFlame2.png similarity index 100% rename from Projectiles/WhiteFlame2.png rename to Projectiles/Magic/WhiteFlame2.png diff --git a/Projectiles/WintersFury.cs b/Projectiles/Magic/WintersFury.cs similarity index 94% rename from Projectiles/WintersFury.cs rename to Projectiles/Magic/WintersFury.cs index c13a9b75db..b1b73e0d82 100644 --- a/Projectiles/WintersFury.cs +++ b/Projectiles/Magic/WintersFury.cs @@ -4,7 +4,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class WintersFury : ModProjectile { diff --git a/Projectiles/WintersFury.png b/Projectiles/Magic/WintersFury.png similarity index 100% rename from Projectiles/WintersFury.png rename to Projectiles/Magic/WintersFury.png diff --git a/Projectiles/WulfrumBolt.cs b/Projectiles/Magic/WulfrumBolt.cs similarity index 95% rename from Projectiles/WulfrumBolt.cs rename to Projectiles/Magic/WulfrumBolt.cs index 56362f857c..30d125fa42 100644 --- a/Projectiles/WulfrumBolt.cs +++ b/Projectiles/Magic/WulfrumBolt.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class WulfrumBolt : ModProjectile { diff --git a/Projectiles/WulfrumBolt.png b/Projectiles/Magic/WulfrumBolt.png similarity index 100% rename from Projectiles/WulfrumBolt.png rename to Projectiles/Magic/WulfrumBolt.png diff --git a/Projectiles/YharimsCrystal.cs b/Projectiles/Magic/YharimsCrystal.cs similarity index 95% rename from Projectiles/YharimsCrystal.cs rename to Projectiles/Magic/YharimsCrystal.cs index d21985d701..7be33bcd73 100644 --- a/Projectiles/YharimsCrystal.cs +++ b/Projectiles/Magic/YharimsCrystal.cs @@ -7,14 +7,14 @@ using Terraria.ID; using Terraria.ModLoader; using Terraria.Enums; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class YharimsCrystal : ModProjectile { public override void SetStaticDefaults() { DisplayName.SetDefault("Crystal"); - Main.projFrames[projectile.type] = 4; + Main.projFrames[projectile.type] = 6; } public override void SetDefaults() @@ -88,7 +88,7 @@ namespace CalamityMod.Projectiles if (projectile.frameCounter >= num28) { projectile.frameCounter = 0; - if (++projectile.frame >= 4) + if (++projectile.frame >= 6) { projectile.frame = 0; } diff --git a/Projectiles/Magic/YharimsCrystal.png b/Projectiles/Magic/YharimsCrystal.png new file mode 100644 index 0000000000..61704a1869 Binary files /dev/null and b/Projectiles/Magic/YharimsCrystal.png differ diff --git a/Projectiles/YharimsCrystalBeam.cs b/Projectiles/Magic/YharimsCrystalBeam.cs similarity index 97% rename from Projectiles/YharimsCrystalBeam.cs rename to Projectiles/Magic/YharimsCrystalBeam.cs index b824acd62e..55d6886bda 100644 --- a/Projectiles/YharimsCrystalBeam.cs +++ b/Projectiles/Magic/YharimsCrystalBeam.cs @@ -9,7 +9,7 @@ using Terraria.Enums; using Terraria.GameContent.Shaders; using Terraria.Graphics.Effects; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Magic { public class YharimsCrystalBeam : ModProjectile { diff --git a/Projectiles/YharimsCrystalBeam.png b/Projectiles/Magic/YharimsCrystalBeam.png similarity index 100% rename from Projectiles/YharimsCrystalBeam.png rename to Projectiles/Magic/YharimsCrystalBeam.png diff --git a/Projectiles/MagicIceBeam.cs b/Projectiles/MagicIceBeam.cs deleted file mode 100644 index 9d6f4097ec..0000000000 --- a/Projectiles/MagicIceBeam.cs +++ /dev/null @@ -1,82 +0,0 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles -{ - public class MagicIceBeam : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Beam"); - } - - public override void SetDefaults() - { - projectile.width = 4; - projectile.height = 4; - projectile.friendly = true; - projectile.ignoreWater = true; - projectile.magic = true; - projectile.alpha = 255; - projectile.penetrate = -1; - projectile.tileCollide = false; - projectile.extraUpdates = 5; - projectile.timeLeft = 200; - projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 4; - } - - public override void AI() - { - if (projectile.ai[1] == 0f) - { - projectile.ai[1] = 1f; - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 12); - } - if (projectile.alpha > 0) - { - projectile.alpha -= 10; - } - if (projectile.alpha < 0) - { - projectile.alpha = 0; - } - Lighting.AddLight(projectile.Center, 0.1f, 0.1f, 0.6f); - for (int num121 = 0; num121 < 5; num121++) - { - Dust dust4 = Main.dust[Dust.NewDust(projectile.position, projectile.width, projectile.height, 56, projectile.velocity.X, projectile.velocity.Y, 100, default(Color), 1f)]; - dust4.velocity = Vector2.Zero; - dust4.position -= projectile.velocity / 5f * (float)num121; - dust4.noGravity = true; - dust4.scale = 0.8f; - dust4.noLight = true; - } - if (projectile.light > 0f) - { - float num = projectile.light; - float num2 = projectile.light; - float num3 = projectile.light; - num2 *= 0.1f; - num *= 0.5f; - } - } - - public override Color? GetAlpha(Color lightColor) - { - if (projectile.alpha > 200) - { - return Color.Transparent; - } - return new Color(255 - projectile.alpha, 255 - projectile.alpha, 255 - projectile.alpha, 0); - } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(BuffID.Frostburn, 500); - } - } -} \ No newline at end of file diff --git a/Projectiles/MagicIceBeam.png b/Projectiles/MagicIceBeam.png deleted file mode 100644 index 15e8775737..0000000000 Binary files a/Projectiles/MagicIceBeam.png and /dev/null differ diff --git a/Projectiles/MechwormBody.png b/Projectiles/MechwormBody.png deleted file mode 100644 index eee4c5f9dc..0000000000 Binary files a/Projectiles/MechwormBody.png and /dev/null differ diff --git a/Projectiles/MechwormBody2.png b/Projectiles/MechwormBody2.png deleted file mode 100644 index eee4c5f9dc..0000000000 Binary files a/Projectiles/MechwormBody2.png and /dev/null differ diff --git a/Projectiles/MechwormHead.png b/Projectiles/MechwormHead.png deleted file mode 100644 index 42dd2e2402..0000000000 Binary files a/Projectiles/MechwormHead.png and /dev/null differ diff --git a/Projectiles/MechwormTail.png b/Projectiles/MechwormTail.png deleted file mode 100644 index 678fe7867a..0000000000 Binary files a/Projectiles/MechwormTail.png and /dev/null differ diff --git a/Projectiles/AccretionDisk2Melee.cs b/Projectiles/Melee/AccretionDisk2Melee.cs similarity index 95% rename from Projectiles/AccretionDisk2Melee.cs rename to Projectiles/Melee/AccretionDisk2Melee.cs index 1389d44be0..2cefb55f5a 100644 --- a/Projectiles/AccretionDisk2Melee.cs +++ b/Projectiles/Melee/AccretionDisk2Melee.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class AccretionDisk2Melee : ModProjectile { diff --git a/Projectiles/AccretionDisk2Melee.png b/Projectiles/Melee/AccretionDisk2Melee.png similarity index 100% rename from Projectiles/AccretionDisk2Melee.png rename to Projectiles/Melee/AccretionDisk2Melee.png diff --git a/Projectiles/AccretionDiskMelee.cs b/Projectiles/Melee/AccretionDiskMelee.cs similarity index 96% rename from Projectiles/AccretionDiskMelee.cs rename to Projectiles/Melee/AccretionDiskMelee.cs index cc9c8b293f..f5268fc6a7 100644 --- a/Projectiles/AccretionDiskMelee.cs +++ b/Projectiles/Melee/AccretionDiskMelee.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class AccretionDiskMelee : ModProjectile { diff --git a/Projectiles/AccretionDiskMelee.png b/Projectiles/Melee/AccretionDiskMelee.png similarity index 100% rename from Projectiles/AccretionDiskMelee.png rename to Projectiles/Melee/AccretionDiskMelee.png diff --git a/Projectiles/AegisBeam.cs b/Projectiles/Melee/AegisBeam.cs similarity index 95% rename from Projectiles/AegisBeam.cs rename to Projectiles/Melee/AegisBeam.cs index eb0f23df9b..09ce68f6a8 100644 --- a/Projectiles/AegisBeam.cs +++ b/Projectiles/Melee/AegisBeam.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class AegisBeam : ModProjectile { diff --git a/Projectiles/AegisBeam.png b/Projectiles/Melee/AegisBeam.png similarity index 100% rename from Projectiles/AegisBeam.png rename to Projectiles/Melee/AegisBeam.png diff --git a/Projectiles/AegisBlast.cs b/Projectiles/Melee/AegisBlast.cs similarity index 95% rename from Projectiles/AegisBlast.cs rename to Projectiles/Melee/AegisBlast.cs index 9a14ea9e1e..62caf8db5f 100644 --- a/Projectiles/AegisBlast.cs +++ b/Projectiles/Melee/AegisBlast.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class AegisBlast : ModProjectile { diff --git a/Projectiles/AegisBlast.png b/Projectiles/Melee/AegisBlast.png similarity index 100% rename from Projectiles/AegisBlast.png rename to Projectiles/Melee/AegisBlast.png diff --git a/Projectiles/AegisBlast2.cs b/Projectiles/Melee/AegisBlast2.cs similarity index 95% rename from Projectiles/AegisBlast2.cs rename to Projectiles/Melee/AegisBlast2.cs index 75acd35a6b..e44d6f45ff 100644 --- a/Projectiles/AegisBlast2.cs +++ b/Projectiles/Melee/AegisBlast2.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class AegisBlast2 : ModProjectile { diff --git a/Projectiles/AegisBlast2.png b/Projectiles/Melee/AegisBlast2.png similarity index 100% rename from Projectiles/AegisBlast2.png rename to Projectiles/Melee/AegisBlast2.png diff --git a/Projectiles/AegisFlame.cs b/Projectiles/Melee/AegisFlame.cs similarity index 96% rename from Projectiles/AegisFlame.cs rename to Projectiles/Melee/AegisFlame.cs index 3e3ed6755c..ab1a6cebcf 100644 --- a/Projectiles/AegisFlame.cs +++ b/Projectiles/Melee/AegisFlame.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class AegisFlame : ModProjectile { diff --git a/Projectiles/AegisFlame.png b/Projectiles/Melee/AegisFlame.png similarity index 100% rename from Projectiles/AegisFlame.png rename to Projectiles/Melee/AegisFlame.png diff --git a/Projectiles/Aftershock.cs b/Projectiles/Melee/Aftershock.cs similarity index 90% rename from Projectiles/Aftershock.cs rename to Projectiles/Melee/Aftershock.cs index b70d22a6a7..8b7e57b995 100644 --- a/Projectiles/Aftershock.cs +++ b/Projectiles/Melee/Aftershock.cs @@ -1,29 +1,29 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles -{ - public class Aftershock : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Rock"); - } - - public override void SetDefaults() - { - projectile.width = 32; - projectile.height = 34; - projectile.aiStyle = 14; - projectile.friendly = true; - projectile.penetrate = 6; - projectile.melee = true; - projectile.ignoreWater = true; - aiType = 261; - } - } +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Melee +{ + public class Aftershock : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Rock"); + } + + public override void SetDefaults() + { + projectile.width = 32; + projectile.height = 34; + projectile.aiStyle = 14; + projectile.friendly = true; + projectile.penetrate = 6; + projectile.melee = true; + projectile.ignoreWater = true; + aiType = 261; + } + } } \ No newline at end of file diff --git a/Projectiles/Aftershock.png b/Projectiles/Melee/Aftershock.png similarity index 100% rename from Projectiles/Aftershock.png rename to Projectiles/Melee/Aftershock.png diff --git a/Projectiles/BalefulHarvesterProjectile.cs b/Projectiles/Melee/BalefulHarvesterProjectile.cs similarity index 94% rename from Projectiles/BalefulHarvesterProjectile.cs rename to Projectiles/Melee/BalefulHarvesterProjectile.cs index 3770cbfa07..5b85e6d9b0 100644 --- a/Projectiles/BalefulHarvesterProjectile.cs +++ b/Projectiles/Melee/BalefulHarvesterProjectile.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class BalefulHarvesterProjectile : ModProjectile { diff --git a/Projectiles/BalefulHarvesterProjectile.png b/Projectiles/Melee/BalefulHarvesterProjectile.png similarity index 100% rename from Projectiles/BalefulHarvesterProjectile.png rename to Projectiles/Melee/BalefulHarvesterProjectile.png diff --git a/Projectiles/BallOFugu.cs b/Projectiles/Melee/BallOFugu.cs similarity index 96% rename from Projectiles/BallOFugu.cs rename to Projectiles/Melee/BallOFugu.cs index 7fc8585f44..9736b7c71a 100644 --- a/Projectiles/BallOFugu.cs +++ b/Projectiles/Melee/BallOFugu.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class BallOFugu : ModProjectile { @@ -94,7 +94,6 @@ namespace CalamityMod.Projectiles vector63 *= (float)Main.rand.Next(45, 65) * 0.1f; vector63 = vector63.RotatedBy((Main.rand.NextDouble() - 0.5) * 1.5707963705062866, default(Vector2)); Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, vector63.X, vector63.Y, mod.ProjectileType("UrchinSpikeFugu"), (int)((double)projectile.damage * 0.6), projectile.knockBack * 0.2f, projectile.owner, -10f, 0f); - return; } } diff --git a/Projectiles/BallOFugu.png b/Projectiles/Melee/BallOFugu.png similarity index 100% rename from Projectiles/BallOFugu.png rename to Projectiles/Melee/BallOFugu.png diff --git a/Projectiles/BansheeHookBoom.cs b/Projectiles/Melee/BansheeHookBoom.cs similarity index 96% rename from Projectiles/BansheeHookBoom.cs rename to Projectiles/Melee/BansheeHookBoom.cs index 529f3d5bcc..1e61b1cbab 100644 --- a/Projectiles/BansheeHookBoom.cs +++ b/Projectiles/Melee/BansheeHookBoom.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class BansheeHookBoom : ModProjectile { diff --git a/Projectiles/BansheeHookBoom.png b/Projectiles/Melee/BansheeHookBoom.png similarity index 100% rename from Projectiles/BansheeHookBoom.png rename to Projectiles/Melee/BansheeHookBoom.png diff --git a/Projectiles/BansheeHookScythe.cs b/Projectiles/Melee/BansheeHookScythe.cs similarity index 94% rename from Projectiles/BansheeHookScythe.cs rename to Projectiles/Melee/BansheeHookScythe.cs index dac62486c4..ec25dfb657 100644 --- a/Projectiles/BansheeHookScythe.cs +++ b/Projectiles/Melee/BansheeHookScythe.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class BansheeHookScythe : ModProjectile { diff --git a/Projectiles/BansheeHookScythe.png b/Projectiles/Melee/BansheeHookScythe.png similarity index 100% rename from Projectiles/BansheeHookScythe.png rename to Projectiles/Melee/BansheeHookScythe.png diff --git a/Projectiles/BiomeOrb.cs b/Projectiles/Melee/BiomeOrb.cs similarity index 95% rename from Projectiles/BiomeOrb.cs rename to Projectiles/Melee/BiomeOrb.cs index d51d9faa6a..3d747d6f30 100644 --- a/Projectiles/BiomeOrb.cs +++ b/Projectiles/Melee/BiomeOrb.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class BiomeOrb : ModProjectile { diff --git a/Projectiles/BiomeOrb.png b/Projectiles/Melee/BiomeOrb.png similarity index 100% rename from Projectiles/BiomeOrb.png rename to Projectiles/Melee/BiomeOrb.png diff --git a/Projectiles/BlazingPhantomBlade.cs b/Projectiles/Melee/BlazingPhantomBlade.cs similarity index 96% rename from Projectiles/BlazingPhantomBlade.cs rename to Projectiles/Melee/BlazingPhantomBlade.cs index 90a4133c08..5554975c4f 100644 --- a/Projectiles/BlazingPhantomBlade.cs +++ b/Projectiles/Melee/BlazingPhantomBlade.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class BlazingPhantomBlade : ModProjectile { diff --git a/Projectiles/BlazingPhantomBlade.png b/Projectiles/Melee/BlazingPhantomBlade.png similarity index 100% rename from Projectiles/BlazingPhantomBlade.png rename to Projectiles/Melee/BlazingPhantomBlade.png diff --git a/Projectiles/Blood.cs b/Projectiles/Melee/Blood.cs similarity index 94% rename from Projectiles/Blood.cs rename to Projectiles/Melee/Blood.cs index d85ff8bef1..5bcc4a7f52 100644 --- a/Projectiles/Blood.cs +++ b/Projectiles/Melee/Blood.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class Blood : ModProjectile { @@ -19,6 +19,7 @@ namespace CalamityMod.Projectiles projectile.width = 4; projectile.height = 4; projectile.friendly = true; + projectile.melee = true; projectile.penetrate = 1; projectile.timeLeft = 200; } diff --git a/Projectiles/Blood.png b/Projectiles/Melee/Blood.png similarity index 100% rename from Projectiles/Blood.png rename to Projectiles/Melee/Blood.png diff --git a/Projectiles/BloodBall.cs b/Projectiles/Melee/BloodBall.cs similarity index 96% rename from Projectiles/BloodBall.cs rename to Projectiles/Melee/BloodBall.cs index bb6e1ee811..599f1b614b 100644 --- a/Projectiles/BloodBall.cs +++ b/Projectiles/Melee/BloodBall.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class BloodBall : ModProjectile { diff --git a/Projectiles/BloodBall.png b/Projectiles/Melee/BloodBall.png similarity index 100% rename from Projectiles/BloodBall.png rename to Projectiles/Melee/BloodBall.png diff --git a/Projectiles/BloodScythe.cs b/Projectiles/Melee/BloodScythe.cs similarity index 67% rename from Projectiles/BloodScythe.cs rename to Projectiles/Melee/BloodScythe.cs index ced91becb8..a48a963e04 100644 --- a/Projectiles/BloodScythe.cs +++ b/Projectiles/Melee/BloodScythe.cs @@ -1,11 +1,12 @@ using System; using System.Collections.Generic; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class BloodScythe : ModProjectile { @@ -16,14 +17,14 @@ namespace CalamityMod.Projectiles public override void SetDefaults() { - projectile.width = 48; - projectile.height = 48; + projectile.width = 28; + projectile.height = 28; projectile.alpha = 100; projectile.friendly = true; projectile.melee = true; - projectile.scale = 0.7f; projectile.tileCollide = true; projectile.penetrate = 1; + projectile.timeLeft = 600; } public override void AI() @@ -40,7 +41,14 @@ namespace CalamityMod.Projectiles } } - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D tex = Main.projectileTexture[projectile.type]; + spriteBatch.Draw(tex, projectile.Center - Main.screenPosition, null, projectile.GetAlpha(lightColor), projectile.rotation, tex.Size() / 2f, projectile.scale, SpriteEffects.None, 0f); + return false; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.AddBuff(BuffID.OnFire, 180); } diff --git a/Projectiles/BloodScythe.png b/Projectiles/Melee/BloodScythe.png similarity index 100% rename from Projectiles/BloodScythe.png rename to Projectiles/Melee/BloodScythe.png diff --git a/Projectiles/BloodyBlade.cs b/Projectiles/Melee/BloodyBlade.cs similarity index 95% rename from Projectiles/BloodyBlade.cs rename to Projectiles/Melee/BloodyBlade.cs index 849b524caa..c32f299058 100644 --- a/Projectiles/BloodyBlade.cs +++ b/Projectiles/Melee/BloodyBlade.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class BloodyBlade : ModProjectile { diff --git a/Projectiles/BloodyBlade.png b/Projectiles/Melee/BloodyBlade.png similarity index 100% rename from Projectiles/BloodyBlade.png rename to Projectiles/Melee/BloodyBlade.png diff --git a/Projectiles/BlueAura.cs b/Projectiles/Melee/BlueAura.cs similarity index 93% rename from Projectiles/BlueAura.cs rename to Projectiles/Melee/BlueAura.cs index 3e738ee96c..09ca193897 100644 --- a/Projectiles/BlueAura.cs +++ b/Projectiles/Melee/BlueAura.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class BlueAura : ModProjectile { diff --git a/Projectiles/BlueAura.png b/Projectiles/Melee/BlueAura.png similarity index 100% rename from Projectiles/BlueAura.png rename to Projectiles/Melee/BlueAura.png diff --git a/Projectiles/Brimblast.cs b/Projectiles/Melee/Brimblast.cs similarity index 95% rename from Projectiles/Brimblast.cs rename to Projectiles/Melee/Brimblast.cs index 8dd850466f..b1ca0fed28 100644 --- a/Projectiles/Brimblast.cs +++ b/Projectiles/Melee/Brimblast.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class Brimblast : ModProjectile { @@ -19,6 +19,7 @@ namespace CalamityMod.Projectiles projectile.width = 6; projectile.height = 24; projectile.friendly = true; + projectile.melee = true; projectile.penetrate = -1; projectile.timeLeft = 240; } diff --git a/Projectiles/Brimblast.png b/Projectiles/Melee/Brimblast.png similarity index 100% rename from Projectiles/Brimblast.png rename to Projectiles/Melee/Brimblast.png diff --git a/Projectiles/BrimlanceHellfireExplosion.cs b/Projectiles/Melee/BrimlanceHellfireExplosion.cs similarity index 95% rename from Projectiles/BrimlanceHellfireExplosion.cs rename to Projectiles/Melee/BrimlanceHellfireExplosion.cs index 8932c8591a..f3fb1b2538 100644 --- a/Projectiles/BrimlanceHellfireExplosion.cs +++ b/Projectiles/Melee/BrimlanceHellfireExplosion.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class BrimlanceHellfireExplosion : ModProjectile { diff --git a/Projectiles/BrimlanceHellfireExplosion.png b/Projectiles/Melee/BrimlanceHellfireExplosion.png similarity index 100% rename from Projectiles/BrimlanceHellfireExplosion.png rename to Projectiles/Melee/BrimlanceHellfireExplosion.png diff --git a/Projectiles/BrimlanceStandingFire.cs b/Projectiles/Melee/BrimlanceStandingFire.cs similarity index 96% rename from Projectiles/BrimlanceStandingFire.cs rename to Projectiles/Melee/BrimlanceStandingFire.cs index 545630d501..08ed1038ee 100644 --- a/Projectiles/BrimlanceStandingFire.cs +++ b/Projectiles/Melee/BrimlanceStandingFire.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class BrimlanceStandingFire : ModProjectile { diff --git a/Projectiles/BrimlanceStandingFire.png b/Projectiles/Melee/BrimlanceStandingFire.png similarity index 100% rename from Projectiles/BrimlanceStandingFire.png rename to Projectiles/Melee/BrimlanceStandingFire.png diff --git a/Projectiles/Brimlash.cs b/Projectiles/Melee/Brimlash.cs similarity index 95% rename from Projectiles/Brimlash.cs rename to Projectiles/Melee/Brimlash.cs index 8602cc0e61..ae17f9a439 100644 --- a/Projectiles/Brimlash.cs +++ b/Projectiles/Melee/Brimlash.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class Brimlash : ModProjectile { diff --git a/Projectiles/Brimlash.png b/Projectiles/Melee/Brimlash.png similarity index 100% rename from Projectiles/Brimlash.png rename to Projectiles/Melee/Brimlash.png diff --git a/Projectiles/Brimlash2.cs b/Projectiles/Melee/Brimlash2.cs similarity index 96% rename from Projectiles/Brimlash2.cs rename to Projectiles/Melee/Brimlash2.cs index bbeff8006e..13ed9c4a8a 100644 --- a/Projectiles/Brimlash2.cs +++ b/Projectiles/Melee/Brimlash2.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class Brimlash2 : ModProjectile { diff --git a/Projectiles/Brimlash2.png b/Projectiles/Melee/Brimlash2.png similarity index 100% rename from Projectiles/Brimlash2.png rename to Projectiles/Melee/Brimlash2.png diff --git a/Projectiles/BrimstoneBoom.cs b/Projectiles/Melee/BrimstoneBoom.cs similarity index 95% rename from Projectiles/BrimstoneBoom.cs rename to Projectiles/Melee/BrimstoneBoom.cs index 0c826273b6..97000f6ff2 100644 --- a/Projectiles/BrimstoneBoom.cs +++ b/Projectiles/Melee/BrimstoneBoom.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class BrimstoneBoom : ModProjectile { diff --git a/Projectiles/BrimstoneBoom.png b/Projectiles/Melee/BrimstoneBoom.png similarity index 100% rename from Projectiles/BrimstoneBoom.png rename to Projectiles/Melee/BrimstoneBoom.png diff --git a/Projectiles/BrimstoneLaserFriendly.cs b/Projectiles/Melee/BrimstoneLaserFriendly.cs similarity index 77% rename from Projectiles/BrimstoneLaserFriendly.cs rename to Projectiles/Melee/BrimstoneLaserFriendly.cs index fca671c6db..da2230e8c7 100644 --- a/Projectiles/BrimstoneLaserFriendly.cs +++ b/Projectiles/Melee/BrimstoneLaserFriendly.cs @@ -1,11 +1,12 @@ using System; using System.Collections.Generic; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class BrimstoneLaserFriendly : ModProjectile { @@ -16,7 +17,7 @@ namespace CalamityMod.Projectiles public override void SetDefaults() { - projectile.width = 32; + projectile.width = 2; projectile.height = 2; projectile.aiStyle = 1; aiType = 100; @@ -42,7 +43,14 @@ namespace CalamityMod.Projectiles } } - public override void Kill(int timeLeft) + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D tex = Main.projectileTexture[projectile.type]; + spriteBatch.Draw(tex, projectile.Center - Main.screenPosition, null, projectile.GetAlpha(lightColor), projectile.rotation, tex.Size() / 2f, projectile.scale, SpriteEffects.None, 0f); + return false; + } + + public override void Kill(int timeLeft) { for (int k = 0; k < 5; k++) { diff --git a/Projectiles/BrimstoneLaserFriendly.png b/Projectiles/Melee/BrimstoneLaserFriendly.png similarity index 100% rename from Projectiles/BrimstoneLaserFriendly.png rename to Projectiles/Melee/BrimstoneLaserFriendly.png diff --git a/Projectiles/BrinySpout.cs b/Projectiles/Melee/BrinySpout.cs similarity index 96% rename from Projectiles/BrinySpout.cs rename to Projectiles/Melee/BrinySpout.cs index 17e176ba79..26e7f4e77b 100644 --- a/Projectiles/BrinySpout.cs +++ b/Projectiles/Melee/BrinySpout.cs @@ -5,7 +5,7 @@ using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class BrinySpout : ModProjectile { diff --git a/Projectiles/BrinySpout.png b/Projectiles/Melee/BrinySpout.png similarity index 100% rename from Projectiles/BrinySpout.png rename to Projectiles/Melee/BrinySpout.png diff --git a/Projectiles/BrinyTyphoonBubble.cs b/Projectiles/Melee/BrinyTyphoonBubble.cs similarity index 96% rename from Projectiles/BrinyTyphoonBubble.cs rename to Projectiles/Melee/BrinyTyphoonBubble.cs index 7d52e32f98..cff0afb0a3 100644 --- a/Projectiles/BrinyTyphoonBubble.cs +++ b/Projectiles/Melee/BrinyTyphoonBubble.cs @@ -4,7 +4,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class BrinyTyphoonBubble : ModProjectile { diff --git a/Projectiles/BrinyTyphoonBubble.png b/Projectiles/Melee/BrinyTyphoonBubble.png similarity index 100% rename from Projectiles/BrinyTyphoonBubble.png rename to Projectiles/Melee/BrinyTyphoonBubble.png diff --git a/Projectiles/BurningMeteor.cs b/Projectiles/Melee/BurningMeteor.cs similarity index 96% rename from Projectiles/BurningMeteor.cs rename to Projectiles/Melee/BurningMeteor.cs index 4f9df1fe45..6962d8fe5f 100644 --- a/Projectiles/BurningMeteor.cs +++ b/Projectiles/Melee/BurningMeteor.cs @@ -6,7 +6,7 @@ using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class BurningMeteor : ModProjectile { diff --git a/Projectiles/BurningMeteor.png b/Projectiles/Melee/BurningMeteor.png similarity index 100% rename from Projectiles/BurningMeteor.png rename to Projectiles/Melee/BurningMeteor.png diff --git a/Projectiles/CalamityAura.cs b/Projectiles/Melee/CalamityAura.cs similarity index 92% rename from Projectiles/CalamityAura.cs rename to Projectiles/Melee/CalamityAura.cs index 2bbb01eb5d..457fbf3201 100644 --- a/Projectiles/CalamityAura.cs +++ b/Projectiles/Melee/CalamityAura.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class CalamityAura : ModProjectile { diff --git a/Projectiles/CalamityAura.png b/Projectiles/Melee/CalamityAura.png similarity index 100% rename from Projectiles/CalamityAura.png rename to Projectiles/Melee/CalamityAura.png diff --git a/Projectiles/CalamityAuraType2.cs b/Projectiles/Melee/CalamityAuraType2.cs similarity index 92% rename from Projectiles/CalamityAuraType2.cs rename to Projectiles/Melee/CalamityAuraType2.cs index 7467b5c091..047f5b5a38 100644 --- a/Projectiles/CalamityAuraType2.cs +++ b/Projectiles/Melee/CalamityAuraType2.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class CalamityAuraType2 : ModProjectile { diff --git a/Projectiles/CalamityAuraType2.png b/Projectiles/Melee/CalamityAuraType2.png similarity index 100% rename from Projectiles/CalamityAuraType2.png rename to Projectiles/Melee/CalamityAuraType2.png diff --git a/Projectiles/CalamityAuraType3.cs b/Projectiles/Melee/CalamityAuraType3.cs similarity index 92% rename from Projectiles/CalamityAuraType3.cs rename to Projectiles/Melee/CalamityAuraType3.cs index cf3c7b10c6..a825e20233 100644 --- a/Projectiles/CalamityAuraType3.cs +++ b/Projectiles/Melee/CalamityAuraType3.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class CalamityAuraType3 : ModProjectile { diff --git a/Projectiles/CalamityAuraType3.png b/Projectiles/Melee/CalamityAuraType3.png similarity index 100% rename from Projectiles/CalamityAuraType3.png rename to Projectiles/Melee/CalamityAuraType3.png diff --git a/Projectiles/ChaosFlameLarge.cs b/Projectiles/Melee/ChaosFlameLarge.cs similarity index 94% rename from Projectiles/ChaosFlameLarge.cs rename to Projectiles/Melee/ChaosFlameLarge.cs index 8a45a4eb28..900c549b03 100644 --- a/Projectiles/ChaosFlameLarge.cs +++ b/Projectiles/Melee/ChaosFlameLarge.cs @@ -6,7 +6,7 @@ using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class ChaosFlameLarge : ModProjectile { diff --git a/Projectiles/ChaosFlameLarge.png b/Projectiles/Melee/ChaosFlameLarge.png similarity index 100% rename from Projectiles/ChaosFlameLarge.png rename to Projectiles/Melee/ChaosFlameLarge.png diff --git a/Projectiles/ChaosFlameMedium.cs b/Projectiles/Melee/ChaosFlameMedium.cs similarity index 94% rename from Projectiles/ChaosFlameMedium.cs rename to Projectiles/Melee/ChaosFlameMedium.cs index 83df3b27d5..d2795a34d5 100644 --- a/Projectiles/ChaosFlameMedium.cs +++ b/Projectiles/Melee/ChaosFlameMedium.cs @@ -6,7 +6,7 @@ using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class ChaosFlameMedium : ModProjectile { diff --git a/Projectiles/ChaosFlameMedium.png b/Projectiles/Melee/ChaosFlameMedium.png similarity index 100% rename from Projectiles/ChaosFlameMedium.png rename to Projectiles/Melee/ChaosFlameMedium.png diff --git a/Projectiles/ChaosFlameSmall.cs b/Projectiles/Melee/ChaosFlameSmall.cs similarity index 94% rename from Projectiles/ChaosFlameSmall.cs rename to Projectiles/Melee/ChaosFlameSmall.cs index ca1692c0a8..44e26eadd4 100644 --- a/Projectiles/ChaosFlameSmall.cs +++ b/Projectiles/Melee/ChaosFlameSmall.cs @@ -6,7 +6,7 @@ using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class ChaosFlameSmall : ModProjectile { diff --git a/Projectiles/ChaosFlameSmall.png b/Projectiles/Melee/ChaosFlameSmall.png similarity index 100% rename from Projectiles/ChaosFlameSmall.png rename to Projectiles/Melee/ChaosFlameSmall.png diff --git a/Projectiles/CosmicBolt.cs b/Projectiles/Melee/CosmicBolt.cs similarity index 94% rename from Projectiles/CosmicBolt.cs rename to Projectiles/Melee/CosmicBolt.cs index 9b3c1c9ef9..863e8c6a37 100644 --- a/Projectiles/CosmicBolt.cs +++ b/Projectiles/Melee/CosmicBolt.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class CosmicBolt : ModProjectile { diff --git a/Projectiles/CosmicBolt.png b/Projectiles/Melee/CosmicBolt.png similarity index 100% rename from Projectiles/CosmicBolt.png rename to Projectiles/Melee/CosmicBolt.png diff --git a/Projectiles/CosmicDischarge.cs b/Projectiles/Melee/CosmicDischarge.cs similarity index 97% rename from Projectiles/CosmicDischarge.cs rename to Projectiles/Melee/CosmicDischarge.cs index e9063d3825..4ff3661828 100644 --- a/Projectiles/CosmicDischarge.cs +++ b/Projectiles/Melee/CosmicDischarge.cs @@ -7,7 +7,7 @@ using Terraria.ID; using Terraria.ModLoader; using Terraria.Enums; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class CosmicDischarge : ModProjectile { diff --git a/Projectiles/CosmicDischarge.png b/Projectiles/Melee/CosmicDischarge.png similarity index 100% rename from Projectiles/CosmicDischarge.png rename to Projectiles/Melee/CosmicDischarge.png diff --git a/Projectiles/CosmicIceBurst.cs b/Projectiles/Melee/CosmicIceBurst.cs similarity index 97% rename from Projectiles/CosmicIceBurst.cs rename to Projectiles/Melee/CosmicIceBurst.cs index 1668fcc40f..d644b25471 100644 --- a/Projectiles/CosmicIceBurst.cs +++ b/Projectiles/Melee/CosmicIceBurst.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class CosmicIceBurst : ModProjectile { diff --git a/Projectiles/CosmicIceBurst.png b/Projectiles/Melee/CosmicIceBurst.png similarity index 100% rename from Projectiles/CosmicIceBurst.png rename to Projectiles/Melee/CosmicIceBurst.png diff --git a/Projectiles/CosmicOrb.cs b/Projectiles/Melee/CosmicOrb.cs similarity index 96% rename from Projectiles/CosmicOrb.cs rename to Projectiles/Melee/CosmicOrb.cs index 6dca5a64d6..696e33504f 100644 --- a/Projectiles/CosmicOrb.cs +++ b/Projectiles/Melee/CosmicOrb.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class CosmicOrb : ModProjectile { diff --git a/Projectiles/CosmicOrb.png b/Projectiles/Melee/CosmicOrb.png similarity index 100% rename from Projectiles/CosmicOrb.png rename to Projectiles/Melee/CosmicOrb.png diff --git a/Projectiles/CosmicSpiritBomb1.cs b/Projectiles/Melee/CosmicSpiritBomb1.cs similarity index 95% rename from Projectiles/CosmicSpiritBomb1.cs rename to Projectiles/Melee/CosmicSpiritBomb1.cs index 07be86eb42..08246c9727 100644 --- a/Projectiles/CosmicSpiritBomb1.cs +++ b/Projectiles/Melee/CosmicSpiritBomb1.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class CosmicSpiritBomb1 : ModProjectile { diff --git a/Projectiles/CosmicSpiritBomb1.png b/Projectiles/Melee/CosmicSpiritBomb1.png similarity index 100% rename from Projectiles/CosmicSpiritBomb1.png rename to Projectiles/Melee/CosmicSpiritBomb1.png diff --git a/Projectiles/CosmicSpiritBomb2.cs b/Projectiles/Melee/CosmicSpiritBomb2.cs similarity index 95% rename from Projectiles/CosmicSpiritBomb2.cs rename to Projectiles/Melee/CosmicSpiritBomb2.cs index 13fa23e799..aa3434afbb 100644 --- a/Projectiles/CosmicSpiritBomb2.cs +++ b/Projectiles/Melee/CosmicSpiritBomb2.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class CosmicSpiritBomb2 : ModProjectile { diff --git a/Projectiles/CosmicSpiritBomb2.png b/Projectiles/Melee/CosmicSpiritBomb2.png similarity index 100% rename from Projectiles/CosmicSpiritBomb2.png rename to Projectiles/Melee/CosmicSpiritBomb2.png diff --git a/Projectiles/CosmicSpiritBomb3.cs b/Projectiles/Melee/CosmicSpiritBomb3.cs similarity index 95% rename from Projectiles/CosmicSpiritBomb3.cs rename to Projectiles/Melee/CosmicSpiritBomb3.cs index feb4bef83e..1cc9e35b46 100644 --- a/Projectiles/CosmicSpiritBomb3.cs +++ b/Projectiles/Melee/CosmicSpiritBomb3.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class CosmicSpiritBomb3 : ModProjectile { diff --git a/Projectiles/CosmicSpiritBomb3.png b/Projectiles/Melee/CosmicSpiritBomb3.png similarity index 100% rename from Projectiles/CosmicSpiritBomb3.png rename to Projectiles/Melee/CosmicSpiritBomb3.png diff --git a/Projectiles/CrystalDust.cs b/Projectiles/Melee/CrystalDust.cs similarity index 93% rename from Projectiles/CrystalDust.cs rename to Projectiles/Melee/CrystalDust.cs index 0a465b59a7..2b4868f6eb 100644 --- a/Projectiles/CrystalDust.cs +++ b/Projectiles/Melee/CrystalDust.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class CrystalDust : ModProjectile { diff --git a/Projectiles/CrystalDust.png b/Projectiles/Melee/CrystalDust.png similarity index 100% rename from Projectiles/CrystalDust.png rename to Projectiles/Melee/CrystalDust.png diff --git a/Projectiles/DNA.cs b/Projectiles/Melee/DNA.cs similarity index 95% rename from Projectiles/DNA.cs rename to Projectiles/Melee/DNA.cs index a859c191e1..b3ab556b2d 100644 --- a/Projectiles/DNA.cs +++ b/Projectiles/Melee/DNA.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class DNA : ModProjectile { diff --git a/Projectiles/DNA.png b/Projectiles/Melee/DNA.png similarity index 100% rename from Projectiles/DNA.png rename to Projectiles/Melee/DNA.png diff --git a/Projectiles/DNA2.cs b/Projectiles/Melee/DNA2.cs similarity index 95% rename from Projectiles/DNA2.cs rename to Projectiles/Melee/DNA2.cs index e4101d92de..5f01a8c28d 100644 --- a/Projectiles/DNA2.cs +++ b/Projectiles/Melee/DNA2.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class DNA2 : ModProjectile { diff --git a/Projectiles/DNA2.png b/Projectiles/Melee/DNA2.png similarity index 100% rename from Projectiles/DNA2.png rename to Projectiles/Melee/DNA2.png diff --git a/Projectiles/Dark.cs b/Projectiles/Melee/Dark.cs similarity index 92% rename from Projectiles/Dark.cs rename to Projectiles/Melee/Dark.cs index 9305eea716..d3b6d49108 100644 --- a/Projectiles/Dark.cs +++ b/Projectiles/Melee/Dark.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class Dark : ModProjectile { diff --git a/Projectiles/Dark.png b/Projectiles/Melee/Dark.png similarity index 100% rename from Projectiles/Dark.png rename to Projectiles/Melee/Dark.png diff --git a/Projectiles/DarkBall.cs b/Projectiles/Melee/DarkBall.cs similarity index 96% rename from Projectiles/DarkBall.cs rename to Projectiles/Melee/DarkBall.cs index 6a3e5441b8..f3cfca22ac 100644 --- a/Projectiles/DarkBall.cs +++ b/Projectiles/Melee/DarkBall.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class DarkBall : ModProjectile { diff --git a/Projectiles/DarkBall.png b/Projectiles/Melee/DarkBall.png similarity index 100% rename from Projectiles/DarkBall.png rename to Projectiles/Melee/DarkBall.png diff --git a/Projectiles/DemonBlast.cs b/Projectiles/Melee/DemonBlast.cs similarity index 95% rename from Projectiles/DemonBlast.cs rename to Projectiles/Melee/DemonBlast.cs index a306d716c7..51e28ea4f2 100644 --- a/Projectiles/DemonBlast.cs +++ b/Projectiles/Melee/DemonBlast.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class DemonBlast : ModProjectile { diff --git a/Projectiles/DemonBlast.png b/Projectiles/Melee/DemonBlast.png similarity index 100% rename from Projectiles/DemonBlast.png rename to Projectiles/Melee/DemonBlast.png diff --git a/Projectiles/DemonBlastType2.cs b/Projectiles/Melee/DemonBlastType2.cs similarity index 95% rename from Projectiles/DemonBlastType2.cs rename to Projectiles/Melee/DemonBlastType2.cs index f8944fb48e..46de9032bb 100644 --- a/Projectiles/DemonBlastType2.cs +++ b/Projectiles/Melee/DemonBlastType2.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class DemonBlastType2 : ModProjectile { diff --git a/Projectiles/DemonBlastType2.png b/Projectiles/Melee/DemonBlastType2.png similarity index 100% rename from Projectiles/DemonBlastType2.png rename to Projectiles/Melee/DemonBlastType2.png diff --git a/Projectiles/DemonBlastType3.cs b/Projectiles/Melee/DemonBlastType3.cs similarity index 95% rename from Projectiles/DemonBlastType3.cs rename to Projectiles/Melee/DemonBlastType3.cs index 0c40adacf8..e1a48403c3 100644 --- a/Projectiles/DemonBlastType3.cs +++ b/Projectiles/Melee/DemonBlastType3.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class DemonBlastType3 : ModProjectile { diff --git a/Projectiles/DemonBlastType3.png b/Projectiles/Melee/DemonBlastType3.png similarity index 100% rename from Projectiles/DemonBlastType3.png rename to Projectiles/Melee/DemonBlastType3.png diff --git a/Projectiles/DepthOrb.cs b/Projectiles/Melee/DepthOrb.cs similarity index 95% rename from Projectiles/DepthOrb.cs rename to Projectiles/Melee/DepthOrb.cs index 47e0662ea3..6a16694033 100644 --- a/Projectiles/DepthOrb.cs +++ b/Projectiles/Melee/DepthOrb.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class DepthOrb : ModProjectile { diff --git a/Projectiles/DepthOrb.png b/Projectiles/Melee/DepthOrb.png similarity index 100% rename from Projectiles/DepthOrb.png rename to Projectiles/Melee/DepthOrb.png diff --git a/Projectiles/DepthOrb2.cs b/Projectiles/Melee/DepthOrb2.cs similarity index 96% rename from Projectiles/DepthOrb2.cs rename to Projectiles/Melee/DepthOrb2.cs index addb87e8ee..5d1af0bf77 100644 --- a/Projectiles/DepthOrb2.cs +++ b/Projectiles/Melee/DepthOrb2.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class DepthOrb2 : ModProjectile { diff --git a/Projectiles/DepthOrb2.png b/Projectiles/Melee/DepthOrb2.png similarity index 100% rename from Projectiles/DepthOrb2.png rename to Projectiles/Melee/DepthOrb2.png diff --git a/Projectiles/DracoBeam.cs b/Projectiles/Melee/DracoBeam.cs similarity index 96% rename from Projectiles/DracoBeam.cs rename to Projectiles/Melee/DracoBeam.cs index e65b7d51d4..97ffcea6f7 100644 --- a/Projectiles/DracoBeam.cs +++ b/Projectiles/Melee/DracoBeam.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class DracoBeam : ModProjectile { diff --git a/Projectiles/DracoBeam.png b/Projectiles/Melee/DracoBeam.png similarity index 100% rename from Projectiles/DracoBeam.png rename to Projectiles/Melee/DracoBeam.png diff --git a/Projectiles/DracoBeam2.cs b/Projectiles/Melee/DracoBeam2.cs similarity index 95% rename from Projectiles/DracoBeam2.cs rename to Projectiles/Melee/DracoBeam2.cs index 80d5d83caa..20918308f8 100644 --- a/Projectiles/DracoBeam2.cs +++ b/Projectiles/Melee/DracoBeam2.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class DracoBeam2 : ModProjectile { diff --git a/Projectiles/DracoBeam2.png b/Projectiles/Melee/DracoBeam2.png similarity index 100% rename from Projectiles/DracoBeam2.png rename to Projectiles/Melee/DracoBeam2.png diff --git a/Projectiles/DragonRage.cs b/Projectiles/Melee/DragonRage.cs similarity index 97% rename from Projectiles/DragonRage.cs rename to Projectiles/Melee/DragonRage.cs index 67841f536b..5938e0576c 100644 --- a/Projectiles/DragonRage.cs +++ b/Projectiles/Melee/DragonRage.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class DragonRage : ModProjectile { diff --git a/Projectiles/DragonRage.png b/Projectiles/Melee/DragonRage.png similarity index 100% rename from Projectiles/DragonRage.png rename to Projectiles/Melee/DragonRage.png diff --git a/Projectiles/Earth.cs b/Projectiles/Melee/Earth.cs similarity index 96% rename from Projectiles/Earth.cs rename to Projectiles/Melee/Earth.cs index 36ff19894f..b72b735797 100644 --- a/Projectiles/Earth.cs +++ b/Projectiles/Melee/Earth.cs @@ -6,7 +6,7 @@ using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class Earth : ModProjectile { diff --git a/Projectiles/Earth.png b/Projectiles/Melee/Earth.png similarity index 100% rename from Projectiles/Earth.png rename to Projectiles/Melee/Earth.png diff --git a/Projectiles/Earth2.cs b/Projectiles/Melee/Earth2.cs similarity index 96% rename from Projectiles/Earth2.cs rename to Projectiles/Melee/Earth2.cs index 780e506ad0..7e33aa63ca 100644 --- a/Projectiles/Earth2.cs +++ b/Projectiles/Melee/Earth2.cs @@ -6,7 +6,7 @@ using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class Earth2 : ModProjectile { diff --git a/Projectiles/Earth2.png b/Projectiles/Melee/Earth2.png similarity index 100% rename from Projectiles/Earth2.png rename to Projectiles/Melee/Earth2.png diff --git a/Projectiles/Earth3.cs b/Projectiles/Melee/Earth3.cs similarity index 97% rename from Projectiles/Earth3.cs rename to Projectiles/Melee/Earth3.cs index 1e249442cc..2cf6266062 100644 --- a/Projectiles/Earth3.cs +++ b/Projectiles/Melee/Earth3.cs @@ -6,7 +6,7 @@ using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class Earth3 : ModProjectile { diff --git a/Projectiles/Earth3.png b/Projectiles/Melee/Earth3.png similarity index 100% rename from Projectiles/Earth3.png rename to Projectiles/Melee/Earth3.png diff --git a/Projectiles/Earth4.cs b/Projectiles/Melee/Earth4.cs similarity index 95% rename from Projectiles/Earth4.cs rename to Projectiles/Melee/Earth4.cs index 70173cf095..a1763d85d8 100644 --- a/Projectiles/Earth4.cs +++ b/Projectiles/Melee/Earth4.cs @@ -6,7 +6,7 @@ using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class Earth4 : ModProjectile { @@ -108,7 +108,7 @@ namespace CalamityMod.Projectiles { return; } - Main.player[Main.myPlayer].lifeSteal -= num * 2f; + Main.player[Main.myPlayer].lifeSteal -= num * 1.5f; int num2 = projectile.owner; Projectile.NewProjectile(target.position.X, target.position.Y, 0f, 0f, mod.ProjectileType("EarthHealOrb"), 0, 0f, projectile.owner, (float)num2, num); } diff --git a/Projectiles/Earth4.png b/Projectiles/Melee/Earth4.png similarity index 100% rename from Projectiles/Earth4.png rename to Projectiles/Melee/Earth4.png diff --git a/Projectiles/ElementBall.cs b/Projectiles/Melee/ElementBall.cs similarity index 95% rename from Projectiles/ElementBall.cs rename to Projectiles/Melee/ElementBall.cs index 76cc09a81e..3903e5e7f7 100644 --- a/Projectiles/ElementBall.cs +++ b/Projectiles/Melee/ElementBall.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class ElementBall : ModProjectile { diff --git a/Projectiles/ElementBall.png b/Projectiles/Melee/ElementBall.png similarity index 100% rename from Projectiles/ElementBall.png rename to Projectiles/Melee/ElementBall.png diff --git a/Projectiles/ElementBallShiv.cs b/Projectiles/Melee/ElementBallShiv.cs similarity index 96% rename from Projectiles/ElementBallShiv.cs rename to Projectiles/Melee/ElementBallShiv.cs index faedb3d0e2..667bcf007e 100644 --- a/Projectiles/ElementBallShiv.cs +++ b/Projectiles/Melee/ElementBallShiv.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class ElementBallShiv : ModProjectile { diff --git a/Projectiles/ElementBallShiv.png b/Projectiles/Melee/ElementBallShiv.png similarity index 100% rename from Projectiles/ElementBallShiv.png rename to Projectiles/Melee/ElementBallShiv.png diff --git a/Projectiles/EonBeam.cs b/Projectiles/Melee/EonBeam.cs similarity index 95% rename from Projectiles/EonBeam.cs rename to Projectiles/Melee/EonBeam.cs index d737e7d68b..a52955ea5d 100644 --- a/Projectiles/EonBeam.cs +++ b/Projectiles/Melee/EonBeam.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class EonBeam : ModProjectile { diff --git a/Projectiles/EonBeam.png b/Projectiles/Melee/EonBeam.png similarity index 100% rename from Projectiles/EonBeam.png rename to Projectiles/Melee/EonBeam.png diff --git a/Projectiles/EonBeamV2.cs b/Projectiles/Melee/EonBeamV2.cs similarity index 95% rename from Projectiles/EonBeamV2.cs rename to Projectiles/Melee/EonBeamV2.cs index 9222e09758..4d5f7f555a 100644 --- a/Projectiles/EonBeamV2.cs +++ b/Projectiles/Melee/EonBeamV2.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class EonBeamV2 : ModProjectile { diff --git a/Projectiles/EonBeamV2.png b/Projectiles/Melee/EonBeamV2.png similarity index 100% rename from Projectiles/EonBeamV2.png rename to Projectiles/Melee/EonBeamV2.png diff --git a/Projectiles/EonBeamV3.cs b/Projectiles/Melee/EonBeamV3.cs similarity index 95% rename from Projectiles/EonBeamV3.cs rename to Projectiles/Melee/EonBeamV3.cs index 57a576eacb..9b756f1a6a 100644 --- a/Projectiles/EonBeamV3.cs +++ b/Projectiles/Melee/EonBeamV3.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class EonBeamV3 : ModProjectile { diff --git a/Projectiles/EonBeamV3.png b/Projectiles/Melee/EonBeamV3.png similarity index 100% rename from Projectiles/EonBeamV3.png rename to Projectiles/Melee/EonBeamV3.png diff --git a/Projectiles/EonBeamV4.cs b/Projectiles/Melee/EonBeamV4.cs similarity index 95% rename from Projectiles/EonBeamV4.cs rename to Projectiles/Melee/EonBeamV4.cs index a8b34e5c48..bbb47bb3c9 100644 --- a/Projectiles/EonBeamV4.cs +++ b/Projectiles/Melee/EonBeamV4.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class EonBeamV4 : ModProjectile { diff --git a/Projectiles/EonBeamV4.png b/Projectiles/Melee/EonBeamV4.png similarity index 100% rename from Projectiles/EonBeamV4.png rename to Projectiles/Melee/EonBeamV4.png diff --git a/Projectiles/EradicatorMeleeProjectile.cs b/Projectiles/Melee/EradicatorMeleeProjectile.cs similarity index 83% rename from Projectiles/EradicatorMeleeProjectile.cs rename to Projectiles/Melee/EradicatorMeleeProjectile.cs index f1b40a9ad1..eb23a04586 100644 --- a/Projectiles/EradicatorMeleeProjectile.cs +++ b/Projectiles/Melee/EradicatorMeleeProjectile.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class EradicatorMeleeProjectile : ModProjectile { @@ -78,12 +78,9 @@ namespace CalamityMod.Projectiles { if (projectile.owner == Main.myPlayer) { - int laser = Projectile.NewProjectile(value10.X, value10.Y, num438, num439, mod.ProjectileType("NebulaShot"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); - Main.projectile[laser].ranged = false; - Main.projectile[laser].melee = true; + Projectile.NewProjectile(value10.X, value10.Y, num438, num439, mod.ProjectileType("NebulaShot"), projectile.damage, projectile.knockBack, projectile.owner, 1f, 0f); } } - return; } } } @@ -94,5 +91,11 @@ namespace CalamityMod.Projectiles spriteBatch.Draw(tex, projectile.Center - Main.screenPosition, null, projectile.GetAlpha(lightColor), projectile.rotation, tex.Size() / 2f, projectile.scale, SpriteEffects.None, 0f); return false; } - } + + public override void PostDraw(SpriteBatch spriteBatch, Color lightColor) + { + Vector2 origin = new Vector2(31f, 29f); + spriteBatch.Draw(mod.GetTexture("Projectiles/Melee/EradicatorMeleeProjectileGlow"), projectile.Center - Main.screenPosition, null, Color.White, projectile.rotation, origin, projectile.scale, SpriteEffects.None, 0f); + } + } } \ No newline at end of file diff --git a/Projectiles/Melee/EradicatorMeleeProjectile.png b/Projectiles/Melee/EradicatorMeleeProjectile.png new file mode 100644 index 0000000000..e028ca0e83 Binary files /dev/null and b/Projectiles/Melee/EradicatorMeleeProjectile.png differ diff --git a/Projectiles/Melee/EradicatorMeleeProjectileGlow.png b/Projectiles/Melee/EradicatorMeleeProjectileGlow.png new file mode 100644 index 0000000000..152b9ce5ae Binary files /dev/null and b/Projectiles/Melee/EradicatorMeleeProjectileGlow.png differ diff --git a/Projectiles/EssenceBeam.cs b/Projectiles/Melee/EssenceBeam.cs similarity index 94% rename from Projectiles/EssenceBeam.cs rename to Projectiles/Melee/EssenceBeam.cs index c4a0f55f75..c18334c2bb 100644 --- a/Projectiles/EssenceBeam.cs +++ b/Projectiles/Melee/EssenceBeam.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class EssenceBeam : ModProjectile { diff --git a/Projectiles/EssenceBeam.png b/Projectiles/Melee/EssenceBeam.png similarity index 100% rename from Projectiles/EssenceBeam.png rename to Projectiles/Melee/EssenceBeam.png diff --git a/Projectiles/EssenceBurst.cs b/Projectiles/Melee/EssenceBurst.cs similarity index 94% rename from Projectiles/EssenceBurst.cs rename to Projectiles/Melee/EssenceBurst.cs index f7ede1ec56..725ddcfbef 100644 --- a/Projectiles/EssenceBurst.cs +++ b/Projectiles/Melee/EssenceBurst.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class EssenceBurst : ModProjectile { diff --git a/Projectiles/EssenceBurst.png b/Projectiles/Melee/EssenceBurst.png similarity index 100% rename from Projectiles/EssenceBurst.png rename to Projectiles/Melee/EssenceBurst.png diff --git a/Projectiles/EssenceFlame2.cs b/Projectiles/Melee/EssenceFlame2.cs similarity index 95% rename from Projectiles/EssenceFlame2.cs rename to Projectiles/Melee/EssenceFlame2.cs index 45ca363b7d..f882ce5225 100644 --- a/Projectiles/EssenceFlame2.cs +++ b/Projectiles/Melee/EssenceFlame2.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class EssenceFlame2 : ModProjectile { @@ -22,6 +22,7 @@ namespace CalamityMod.Projectiles projectile.friendly = true; projectile.penetrate = 1; projectile.tileCollide = false; + projectile.melee = true; projectile.timeLeft = 600; projectile.alpha = 255; projectile.extraUpdates = 3; diff --git a/Projectiles/EssenceFlame2.png b/Projectiles/Melee/EssenceFlame2.png similarity index 100% rename from Projectiles/EssenceFlame2.png rename to Projectiles/Melee/EssenceFlame2.png diff --git a/Projectiles/EssenceScythe.cs b/Projectiles/Melee/EssenceScythe.cs similarity index 96% rename from Projectiles/EssenceScythe.cs rename to Projectiles/Melee/EssenceScythe.cs index 90df67a23d..9178028e3e 100644 --- a/Projectiles/EssenceScythe.cs +++ b/Projectiles/Melee/EssenceScythe.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class EssenceScythe : ModProjectile { diff --git a/Projectiles/EssenceScythe.png b/Projectiles/Melee/EssenceScythe.png similarity index 100% rename from Projectiles/EssenceScythe.png rename to Projectiles/Melee/EssenceScythe.png diff --git a/Projectiles/Melee/Excelsus.cs b/Projectiles/Melee/Excelsus.cs new file mode 100644 index 0000000000..7a5c98c60c --- /dev/null +++ b/Projectiles/Melee/Excelsus.cs @@ -0,0 +1,103 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Melee +{ + public class Excelsus : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Excelsus"); + } + + public override void SetDefaults() + { + projectile.width = 34; + projectile.height = 34; + projectile.friendly = true; + projectile.melee = true; + projectile.ignoreWater = true; + projectile.penetrate = 3; + projectile.timeLeft = 300; + projectile.alpha = 100; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 5; + } + + public override void AI() + { + if (Math.Abs(projectile.velocity.X) + Math.Abs(projectile.velocity.Y) < 20f && projectile.timeLeft > 85) + { + projectile.velocity *= 1.05f; + } + if (Math.Abs(projectile.velocity.X) + Math.Abs(projectile.velocity.Y) > 0f && projectile.timeLeft <= 85) + { + projectile.velocity *= 0.98f; + } + projectile.rotation += (Math.Abs(projectile.velocity.X) + Math.Abs(projectile.velocity.Y)) * 0.02f; + if (Main.rand.Next(8) == 0) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, (Main.rand.Next(3) == 0 ? 56 : 242), projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); + } + } + + public override bool OnTileCollide(Vector2 oldVelocity) + { + projectile.tileCollide = false; + if (projectile.timeLeft > 85) + { + projectile.timeLeft = 85; + } + return false; + } + + public override Color? GetAlpha(Color lightColor) + { + if (projectile.timeLeft < 85) + { + byte b2 = (byte)(projectile.timeLeft * 3); + byte a2 = (byte)(100f * ((float)b2 / 255f)); + return new Color((int)b2, (int)b2, (int)b2, (int)a2); + } + return default(Color); + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D tex = Main.projectileTexture[projectile.type]; + spriteBatch.Draw(tex, projectile.Center - Main.screenPosition, null, projectile.GetAlpha(lightColor), projectile.rotation, tex.Size() / 2f, projectile.scale, SpriteEffects.None, 0f); + return false; + } + + public override void PostDraw(SpriteBatch spriteBatch, Color lightColor) + { + Color color = default(Color); + if (projectile.timeLeft < 85) + { + byte b2 = (byte)(projectile.timeLeft * 3); + byte a2 = (byte)(100f * ((float)b2 / 255f)); + color = new Color((int)b2, (int)b2, (int)b2, (int)a2); + } + else + { + color = new Color(255, 255, 255, 100); + } + Vector2 origin = new Vector2(39f, 46f); + spriteBatch.Draw(mod.GetTexture("Projectiles/Melee/ExcelsusGlow"), projectile.Center - Main.screenPosition, null, color, projectile.rotation, origin, projectile.scale, SpriteEffects.None, 0f); + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + if (projectile.timeLeft > 85) + { + projectile.timeLeft = 85; + } + target.AddBuff(BuffID.Frostburn, 600); + } + } +} \ No newline at end of file diff --git a/Projectiles/Melee/Excelsus.png b/Projectiles/Melee/Excelsus.png new file mode 100644 index 0000000000..15e7b947e2 Binary files /dev/null and b/Projectiles/Melee/Excelsus.png differ diff --git a/Projectiles/Melee/ExcelsusBlue.cs b/Projectiles/Melee/ExcelsusBlue.cs new file mode 100644 index 0000000000..02515d1e17 --- /dev/null +++ b/Projectiles/Melee/ExcelsusBlue.cs @@ -0,0 +1,103 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Melee +{ + public class ExcelsusBlue : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Excelsus"); + } + + public override void SetDefaults() + { + projectile.width = 34; + projectile.height = 34; + projectile.friendly = true; + projectile.melee = true; + projectile.ignoreWater = true; + projectile.penetrate = 3; + projectile.timeLeft = 300; + projectile.alpha = 100; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 5; + } + + public override void AI() + { + if (Math.Abs(projectile.velocity.X) + Math.Abs(projectile.velocity.Y) < 16f && projectile.timeLeft > 85) + { + projectile.velocity *= 1.05f; + } + if (Math.Abs(projectile.velocity.X) + Math.Abs(projectile.velocity.Y) > 0f && projectile.timeLeft <= 85) + { + projectile.velocity *= 0.98f; + } + projectile.rotation += (Math.Abs(projectile.velocity.X) + Math.Abs(projectile.velocity.Y)) * 0.02f; + if (Main.rand.Next(8) == 0) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 56, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); + } + } + + public override bool OnTileCollide(Vector2 oldVelocity) + { + projectile.tileCollide = false; + if (projectile.timeLeft > 85) + { + projectile.timeLeft = 85; + } + return false; + } + + public override Color? GetAlpha(Color lightColor) + { + if (projectile.timeLeft < 85) + { + byte b2 = (byte)(projectile.timeLeft * 3); + byte a2 = (byte)(100f * ((float)b2 / 255f)); + return new Color((int)b2, (int)b2, (int)b2, (int)a2); + } + return default(Color); + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D tex = Main.projectileTexture[projectile.type]; + spriteBatch.Draw(tex, projectile.Center - Main.screenPosition, null, projectile.GetAlpha(lightColor), projectile.rotation, tex.Size() / 2f, projectile.scale, SpriteEffects.None, 0f); + return false; + } + + public override void PostDraw(SpriteBatch spriteBatch, Color lightColor) + { + Color color = default(Color); + if (projectile.timeLeft < 85) + { + byte b2 = (byte)(projectile.timeLeft * 3); + byte a2 = (byte)(100f * ((float)b2 / 255f)); + color = new Color((int)b2, (int)b2, (int)b2, (int)a2); + } + else + { + color = new Color(255, 255, 255, 100); + } + Vector2 origin = new Vector2(39f, 46f); + spriteBatch.Draw(mod.GetTexture("Projectiles/Melee/ExcelsusBlueGlow"), projectile.Center - Main.screenPosition, null, color, projectile.rotation, origin, projectile.scale, SpriteEffects.None, 0f); + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + if (projectile.timeLeft > 85) + { + projectile.timeLeft = 85; + } + target.AddBuff(BuffID.Frostburn, 600); + } + } +} \ No newline at end of file diff --git a/Projectiles/Melee/ExcelsusBlue.png b/Projectiles/Melee/ExcelsusBlue.png new file mode 100644 index 0000000000..1bb0363ed5 Binary files /dev/null and b/Projectiles/Melee/ExcelsusBlue.png differ diff --git a/Projectiles/Melee/ExcelsusBlueGlow.png b/Projectiles/Melee/ExcelsusBlueGlow.png new file mode 100644 index 0000000000..e7669091fd Binary files /dev/null and b/Projectiles/Melee/ExcelsusBlueGlow.png differ diff --git a/Projectiles/Melee/ExcelsusGlow.png b/Projectiles/Melee/ExcelsusGlow.png new file mode 100644 index 0000000000..c8b3d4cc56 Binary files /dev/null and b/Projectiles/Melee/ExcelsusGlow.png differ diff --git a/Projectiles/Melee/ExcelsusPink.cs b/Projectiles/Melee/ExcelsusPink.cs new file mode 100644 index 0000000000..44bcafdd89 --- /dev/null +++ b/Projectiles/Melee/ExcelsusPink.cs @@ -0,0 +1,103 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Melee +{ + public class ExcelsusPink : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Excelsus"); + } + + public override void SetDefaults() + { + projectile.width = 34; + projectile.height = 34; + projectile.friendly = true; + projectile.melee = true; + projectile.ignoreWater = true; + projectile.penetrate = 3; + projectile.timeLeft = 300; + projectile.alpha = 100; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 5; + } + + public override void AI() + { + if (Math.Abs(projectile.velocity.X) + Math.Abs(projectile.velocity.Y) < 24f && projectile.timeLeft > 85) + { + projectile.velocity *= 1.05f; + } + if (Math.Abs(projectile.velocity.X) + Math.Abs(projectile.velocity.Y) > 0f && projectile.timeLeft <= 85) + { + projectile.velocity *= 0.98f; + } + projectile.rotation += (Math.Abs(projectile.velocity.X) + Math.Abs(projectile.velocity.Y)) * 0.02f; + if (Main.rand.Next(8) == 0) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 242, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); + } + } + + public override bool OnTileCollide(Vector2 oldVelocity) + { + projectile.tileCollide = false; + if (projectile.timeLeft > 85) + { + projectile.timeLeft = 85; + } + return false; + } + + public override Color? GetAlpha(Color lightColor) + { + if (projectile.timeLeft < 85) + { + byte b2 = (byte)(projectile.timeLeft * 3); + byte a2 = (byte)(100f * ((float)b2 / 255f)); + return new Color((int)b2, (int)b2, (int)b2, (int)a2); + } + return default(Color); + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D tex = Main.projectileTexture[projectile.type]; + spriteBatch.Draw(tex, projectile.Center - Main.screenPosition, null, projectile.GetAlpha(lightColor), projectile.rotation, tex.Size() / 2f, projectile.scale, SpriteEffects.None, 0f); + return false; + } + + public override void PostDraw(SpriteBatch spriteBatch, Color lightColor) + { + Color color = default(Color); + if (projectile.timeLeft < 85) + { + byte b2 = (byte)(projectile.timeLeft * 3); + byte a2 = (byte)(100f * ((float)b2 / 255f)); + color = new Color((int)b2, (int)b2, (int)b2, (int)a2); + } + else + { + color = new Color(255, 255, 255, 100); + } + Vector2 origin = new Vector2(39f, 46f); + spriteBatch.Draw(mod.GetTexture("Projectiles/Melee/ExcelsusPinkGlow"), projectile.Center - Main.screenPosition, null, color, projectile.rotation, origin, projectile.scale, SpriteEffects.None, 0f); + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + if (projectile.timeLeft > 85) + { + projectile.timeLeft = 85; + } + target.AddBuff(BuffID.Frostburn, 600); + } + } +} \ No newline at end of file diff --git a/Projectiles/Melee/ExcelsusPink.png b/Projectiles/Melee/ExcelsusPink.png new file mode 100644 index 0000000000..997a611ea0 Binary files /dev/null and b/Projectiles/Melee/ExcelsusPink.png differ diff --git a/Projectiles/Melee/ExcelsusPinkGlow.png b/Projectiles/Melee/ExcelsusPinkGlow.png new file mode 100644 index 0000000000..07f364ec1a Binary files /dev/null and b/Projectiles/Melee/ExcelsusPinkGlow.png differ diff --git a/Projectiles/Exobeam.cs b/Projectiles/Melee/Exobeam.cs similarity index 96% rename from Projectiles/Exobeam.cs rename to Projectiles/Melee/Exobeam.cs index 0f31f26d0a..4d9566b018 100644 --- a/Projectiles/Exobeam.cs +++ b/Projectiles/Melee/Exobeam.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class Exobeam : ModProjectile { diff --git a/Projectiles/Exobeam.png b/Projectiles/Melee/Exobeam.png similarity index 100% rename from Projectiles/Exobeam.png rename to Projectiles/Melee/Exobeam.png diff --git a/Projectiles/Exoboom.cs b/Projectiles/Melee/Exoboom.cs similarity index 95% rename from Projectiles/Exoboom.cs rename to Projectiles/Melee/Exoboom.cs index 8a2dfc48e5..e939fb1702 100644 --- a/Projectiles/Exoboom.cs +++ b/Projectiles/Melee/Exoboom.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class Exoboom : ModProjectile { diff --git a/Projectiles/Exoboom.png b/Projectiles/Melee/Exoboom.png similarity index 100% rename from Projectiles/Exoboom.png rename to Projectiles/Melee/Exoboom.png diff --git a/Projectiles/Exocomet.cs b/Projectiles/Melee/Exocomet.cs similarity index 96% rename from Projectiles/Exocomet.cs rename to Projectiles/Melee/Exocomet.cs index d3f537fa13..dcb795cf86 100644 --- a/Projectiles/Exocomet.cs +++ b/Projectiles/Melee/Exocomet.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class Exocomet : ModProjectile { diff --git a/Projectiles/Exocomet.png b/Projectiles/Melee/Exocomet.png similarity index 100% rename from Projectiles/Exocomet.png rename to Projectiles/Melee/Exocomet.png diff --git a/Projectiles/FlameScytheProjectileMelee.cs b/Projectiles/Melee/FlameScytheProjectileMelee.cs similarity index 93% rename from Projectiles/FlameScytheProjectileMelee.cs rename to Projectiles/Melee/FlameScytheProjectileMelee.cs index 4d185a4a78..ae16bfd1ea 100644 --- a/Projectiles/FlameScytheProjectileMelee.cs +++ b/Projectiles/Melee/FlameScytheProjectileMelee.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class FlameScytheProjectileMelee : ModProjectile { @@ -17,8 +17,8 @@ namespace CalamityMod.Projectiles public override void SetDefaults() { - projectile.width = 30; - projectile.height = 30; + projectile.width = 50; + projectile.height = 50; projectile.friendly = true; projectile.melee = true; projectile.penetrate = -1; diff --git a/Projectiles/Melee/FlameScytheProjectileMelee.png b/Projectiles/Melee/FlameScytheProjectileMelee.png new file mode 100644 index 0000000000..d6577c12b4 Binary files /dev/null and b/Projectiles/Melee/FlameScytheProjectileMelee.png differ diff --git a/Projectiles/Flarefrost.cs b/Projectiles/Melee/Flarefrost.cs similarity index 97% rename from Projectiles/Flarefrost.cs rename to Projectiles/Melee/Flarefrost.cs index b5440ee682..16be3c7518 100644 --- a/Projectiles/Flarefrost.cs +++ b/Projectiles/Melee/Flarefrost.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class Flarefrost : ModProjectile { diff --git a/Projectiles/Flarefrost.png b/Projectiles/Melee/Flarefrost.png similarity index 100% rename from Projectiles/Flarefrost.png rename to Projectiles/Melee/Flarefrost.png diff --git a/Projectiles/FossilSpike.cs b/Projectiles/Melee/FossilSpike.cs similarity index 93% rename from Projectiles/FossilSpike.cs rename to Projectiles/Melee/FossilSpike.cs index 498ac1fe99..1bb795c361 100644 --- a/Projectiles/FossilSpike.cs +++ b/Projectiles/Melee/FossilSpike.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class FossilSpike : ModProjectile { diff --git a/Projectiles/FossilSpike.png b/Projectiles/Melee/FossilSpike.png similarity index 100% rename from Projectiles/FossilSpike.png rename to Projectiles/Melee/FossilSpike.png diff --git a/Projectiles/GalacticaComet.cs b/Projectiles/Melee/GalacticaComet.cs similarity index 96% rename from Projectiles/GalacticaComet.cs rename to Projectiles/Melee/GalacticaComet.cs index 36d62553c1..9cd1ca3a38 100644 --- a/Projectiles/GalacticaComet.cs +++ b/Projectiles/Melee/GalacticaComet.cs @@ -6,7 +6,7 @@ using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class GalacticaComet : ModProjectile { diff --git a/Projectiles/GalacticaComet.png b/Projectiles/Melee/GalacticaComet.png similarity index 100% rename from Projectiles/GalacticaComet.png rename to Projectiles/Melee/GalacticaComet.png diff --git a/Projectiles/Galaxia.cs b/Projectiles/Melee/Galaxia.cs similarity index 97% rename from Projectiles/Galaxia.cs rename to Projectiles/Melee/Galaxia.cs index 04764e5bbd..68e86c4974 100644 --- a/Projectiles/Galaxia.cs +++ b/Projectiles/Melee/Galaxia.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class Galaxia : ModProjectile { diff --git a/Projectiles/Galaxia.png b/Projectiles/Melee/Galaxia.png similarity index 100% rename from Projectiles/Galaxia.png rename to Projectiles/Melee/Galaxia.png diff --git a/Projectiles/Galaxia2.cs b/Projectiles/Melee/Galaxia2.cs similarity index 97% rename from Projectiles/Galaxia2.cs rename to Projectiles/Melee/Galaxia2.cs index d18b32b7ef..936e9ae897 100644 --- a/Projectiles/Galaxia2.cs +++ b/Projectiles/Melee/Galaxia2.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class Galaxia2 : ModProjectile { diff --git a/Projectiles/Galaxia2.png b/Projectiles/Melee/Galaxia2.png similarity index 100% rename from Projectiles/Galaxia2.png rename to Projectiles/Melee/Galaxia2.png diff --git a/Projectiles/GalaxyBlast.cs b/Projectiles/Melee/GalaxyBlast.cs similarity index 95% rename from Projectiles/GalaxyBlast.cs rename to Projectiles/Melee/GalaxyBlast.cs index 735c7642b8..33464a777e 100644 --- a/Projectiles/GalaxyBlast.cs +++ b/Projectiles/Melee/GalaxyBlast.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class GalaxyBlast : ModProjectile { diff --git a/Projectiles/GalaxyBlast.png b/Projectiles/Melee/GalaxyBlast.png similarity index 100% rename from Projectiles/GalaxyBlast.png rename to Projectiles/Melee/GalaxyBlast.png diff --git a/Projectiles/GalaxyBlastType2.cs b/Projectiles/Melee/GalaxyBlastType2.cs similarity index 95% rename from Projectiles/GalaxyBlastType2.cs rename to Projectiles/Melee/GalaxyBlastType2.cs index 57abb1fad3..02e8381e64 100644 --- a/Projectiles/GalaxyBlastType2.cs +++ b/Projectiles/Melee/GalaxyBlastType2.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class GalaxyBlastType2 : ModProjectile { diff --git a/Projectiles/GalaxyBlastType2.png b/Projectiles/Melee/GalaxyBlastType2.png similarity index 100% rename from Projectiles/GalaxyBlastType2.png rename to Projectiles/Melee/GalaxyBlastType2.png diff --git a/Projectiles/GalaxyBlastType3.cs b/Projectiles/Melee/GalaxyBlastType3.cs similarity index 95% rename from Projectiles/GalaxyBlastType3.cs rename to Projectiles/Melee/GalaxyBlastType3.cs index 81410bf236..846b5c2f4a 100644 --- a/Projectiles/GalaxyBlastType3.cs +++ b/Projectiles/Melee/GalaxyBlastType3.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class GalaxyBlastType3 : ModProjectile { diff --git a/Projectiles/GalaxyBlastType3.png b/Projectiles/Melee/GalaxyBlastType3.png similarity index 100% rename from Projectiles/GalaxyBlastType3.png rename to Projectiles/Melee/GalaxyBlastType3.png diff --git a/Projectiles/GelWave.cs b/Projectiles/Melee/GelWave.cs similarity index 95% rename from Projectiles/GelWave.cs rename to Projectiles/Melee/GelWave.cs index 42f8abff1e..5e8970b1fc 100644 --- a/Projectiles/GelWave.cs +++ b/Projectiles/Melee/GelWave.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class GelWave : ModProjectile { diff --git a/Projectiles/GelWave.png b/Projectiles/Melee/GelWave.png similarity index 100% rename from Projectiles/GelWave.png rename to Projectiles/Melee/GelWave.png diff --git a/Projectiles/GhastlySoulLarge.cs b/Projectiles/Melee/GhastlySoulLarge.cs similarity index 97% rename from Projectiles/GhastlySoulLarge.cs rename to Projectiles/Melee/GhastlySoulLarge.cs index 3210069f22..935038320d 100644 --- a/Projectiles/GhastlySoulLarge.cs +++ b/Projectiles/Melee/GhastlySoulLarge.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class GhastlySoulLarge : ModProjectile { diff --git a/Projectiles/GhastlySoulLarge.png b/Projectiles/Melee/GhastlySoulLarge.png similarity index 100% rename from Projectiles/GhastlySoulLarge.png rename to Projectiles/Melee/GhastlySoulLarge.png diff --git a/Projectiles/GhastlySoulMedium.cs b/Projectiles/Melee/GhastlySoulMedium.cs similarity index 97% rename from Projectiles/GhastlySoulMedium.cs rename to Projectiles/Melee/GhastlySoulMedium.cs index 052831f961..00c44d880d 100644 --- a/Projectiles/GhastlySoulMedium.cs +++ b/Projectiles/Melee/GhastlySoulMedium.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class GhastlySoulMedium : ModProjectile { diff --git a/Projectiles/GhastlySoulMedium.png b/Projectiles/Melee/GhastlySoulMedium.png similarity index 100% rename from Projectiles/GhastlySoulMedium.png rename to Projectiles/Melee/GhastlySoulMedium.png diff --git a/Projectiles/GhastlySoulSmall.cs b/Projectiles/Melee/GhastlySoulSmall.cs similarity index 97% rename from Projectiles/GhastlySoulSmall.cs rename to Projectiles/Melee/GhastlySoulSmall.cs index 4ee0715325..68370324b0 100644 --- a/Projectiles/GhastlySoulSmall.cs +++ b/Projectiles/Melee/GhastlySoulSmall.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class GhastlySoulSmall : ModProjectile { diff --git a/Projectiles/GhastlySoulSmall.png b/Projectiles/Melee/GhastlySoulSmall.png similarity index 100% rename from Projectiles/GhastlySoulSmall.png rename to Projectiles/Melee/GhastlySoulSmall.png diff --git a/Projectiles/GreenBall.cs b/Projectiles/Melee/GreenBall.cs similarity index 95% rename from Projectiles/GreenBall.cs rename to Projectiles/Melee/GreenBall.cs index 265f569b3f..e5b0dab37e 100644 --- a/Projectiles/GreenBall.cs +++ b/Projectiles/Melee/GreenBall.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class GreenBall : ModProjectile { diff --git a/Projectiles/GreenBall.png b/Projectiles/Melee/GreenBall.png similarity index 100% rename from Projectiles/GreenBall.png rename to Projectiles/Melee/GreenBall.png diff --git a/Projectiles/GreenDust.cs b/Projectiles/Melee/GreenDust.cs similarity index 93% rename from Projectiles/GreenDust.cs rename to Projectiles/Melee/GreenDust.cs index 5ceaf6f0c5..739ab901ed 100644 --- a/Projectiles/GreenDust.cs +++ b/Projectiles/Melee/GreenDust.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class GreenDust : ModProjectile { diff --git a/Projectiles/GreenDust.png b/Projectiles/Melee/GreenDust.png similarity index 100% rename from Projectiles/GreenDust.png rename to Projectiles/Melee/GreenDust.png diff --git a/Projectiles/GreenWater.cs b/Projectiles/Melee/GreenWater.cs similarity index 94% rename from Projectiles/GreenWater.cs rename to Projectiles/Melee/GreenWater.cs index dd88119c33..04941cafab 100644 --- a/Projectiles/GreenWater.cs +++ b/Projectiles/Melee/GreenWater.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class GreenWater : ModProjectile { diff --git a/Projectiles/GreenWater.png b/Projectiles/Melee/GreenWater.png similarity index 100% rename from Projectiles/GreenWater.png rename to Projectiles/Melee/GreenWater.png diff --git a/Projectiles/HellionSpike.cs b/Projectiles/Melee/HellionSpike.cs similarity index 94% rename from Projectiles/HellionSpike.cs rename to Projectiles/Melee/HellionSpike.cs index 567d025d86..adf4166d58 100644 --- a/Projectiles/HellionSpike.cs +++ b/Projectiles/Melee/HellionSpike.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class HellionSpike : ModProjectile { diff --git a/Projectiles/HellionSpike.png b/Projectiles/Melee/HellionSpike.png similarity index 100% rename from Projectiles/HellionSpike.png rename to Projectiles/Melee/HellionSpike.png diff --git a/Projectiles/HolyColliderHolyFire.cs b/Projectiles/Melee/HolyColliderHolyFire.cs similarity index 96% rename from Projectiles/HolyColliderHolyFire.cs rename to Projectiles/Melee/HolyColliderHolyFire.cs index a9f6922f77..bcf36445e7 100644 --- a/Projectiles/HolyColliderHolyFire.cs +++ b/Projectiles/Melee/HolyColliderHolyFire.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class HolyColliderHolyFire : ModProjectile { diff --git a/Projectiles/HolyColliderHolyFire.png b/Projectiles/Melee/HolyColliderHolyFire.png similarity index 100% rename from Projectiles/HolyColliderHolyFire.png rename to Projectiles/Melee/HolyColliderHolyFire.png diff --git a/Projectiles/HyperBlade.cs b/Projectiles/Melee/HyperBlade.cs similarity index 95% rename from Projectiles/HyperBlade.cs rename to Projectiles/Melee/HyperBlade.cs index e9a0b74d59..5eaf231a99 100644 --- a/Projectiles/HyperBlade.cs +++ b/Projectiles/Melee/HyperBlade.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class HyperBlade : ModProjectile { diff --git a/Projectiles/HyperBlade.png b/Projectiles/Melee/HyperBlade.png similarity index 100% rename from Projectiles/HyperBlade.png rename to Projectiles/Melee/HyperBlade.png diff --git a/Projectiles/IceBombFriendly.cs b/Projectiles/Melee/IceBombFriendly.cs similarity index 96% rename from Projectiles/IceBombFriendly.cs rename to Projectiles/Melee/IceBombFriendly.cs index 4f0c85abb7..2e0725042e 100644 --- a/Projectiles/IceBombFriendly.cs +++ b/Projectiles/Melee/IceBombFriendly.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class IceBombFriendly : ModProjectile { diff --git a/Projectiles/IceBombFriendly.png b/Projectiles/Melee/IceBombFriendly.png similarity index 100% rename from Projectiles/IceBombFriendly.png rename to Projectiles/Melee/IceBombFriendly.png diff --git a/Projectiles/Iceberg.cs b/Projectiles/Melee/Iceberg.cs similarity index 94% rename from Projectiles/Iceberg.cs rename to Projectiles/Melee/Iceberg.cs index 4344a80713..8798f5f686 100644 --- a/Projectiles/Iceberg.cs +++ b/Projectiles/Melee/Iceberg.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class Iceberg : ModProjectile { diff --git a/Projectiles/Iceberg.png b/Projectiles/Melee/Iceberg.png similarity index 100% rename from Projectiles/Iceberg.png rename to Projectiles/Melee/Iceberg.png diff --git a/Projectiles/Icebreaker.cs b/Projectiles/Melee/Icebreaker.cs similarity index 94% rename from Projectiles/Icebreaker.cs rename to Projectiles/Melee/Icebreaker.cs index 91c6092192..99585a51e1 100644 --- a/Projectiles/Icebreaker.cs +++ b/Projectiles/Melee/Icebreaker.cs @@ -5,7 +5,7 @@ using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class Icebreaker : ModProjectile { diff --git a/Projectiles/Icebreaker.png b/Projectiles/Melee/Icebreaker.png similarity index 100% rename from Projectiles/Icebreaker.png rename to Projectiles/Melee/Icebreaker.png diff --git a/Projectiles/Judgement.cs b/Projectiles/Melee/Judgement.cs similarity index 96% rename from Projectiles/Judgement.cs rename to Projectiles/Melee/Judgement.cs index e5243fe27c..532733c5d8 100644 --- a/Projectiles/Judgement.cs +++ b/Projectiles/Melee/Judgement.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class Judgement : ModProjectile { diff --git a/Projectiles/Judgement.png b/Projectiles/Melee/Judgement.png similarity index 100% rename from Projectiles/Judgement.png rename to Projectiles/Melee/Judgement.png diff --git a/Projectiles/JudgementBlah.cs b/Projectiles/Melee/JudgementBlah.cs similarity index 96% rename from Projectiles/JudgementBlah.cs rename to Projectiles/Melee/JudgementBlah.cs index b820f85629..8c941b03a4 100644 --- a/Projectiles/JudgementBlah.cs +++ b/Projectiles/Melee/JudgementBlah.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class JudgementBlah : ModProjectile { diff --git a/Projectiles/JudgementBlah.png b/Projectiles/Melee/JudgementBlah.png similarity index 100% rename from Projectiles/JudgementBlah.png rename to Projectiles/Melee/JudgementBlah.png diff --git a/Projectiles/Melee/LaserFountain.cs b/Projectiles/Melee/LaserFountain.cs new file mode 100644 index 0000000000..09d87a692e --- /dev/null +++ b/Projectiles/Melee/LaserFountain.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Melee +{ + public class LaserFountain : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Fountain"); + } + + public override void SetDefaults() + { + projectile.width = 4; + projectile.height = 4; + projectile.friendly = true; + projectile.alpha = 255; + projectile.penetrate = -1; + projectile.tileCollide = false; + projectile.timeLeft = 60; + projectile.melee = true; + } + + public override void AI() + { + projectile.localAI[0] += 1f; + float SpeedX = (float)Main.rand.Next(-15, 15); + float SpeedY = (float)Main.rand.Next(-20, -10); + if (projectile.localAI[0] >= 12f) + { + if (projectile.owner == Main.myPlayer) + { + int projectile1 = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, SpeedX, SpeedY, mod.ProjectileType("NebulaShot"), 350, projectile.knockBack, projectile.owner, 1f, 0f); + Main.projectile[projectile1].aiStyle = 1; + } + projectile.localAI[0] = 0f; + } + } + } +} \ No newline at end of file diff --git a/Projectiles/LaserFountain.png b/Projectiles/Melee/LaserFountain.png similarity index 100% rename from Projectiles/LaserFountain.png rename to Projectiles/Melee/LaserFountain.png diff --git a/Projectiles/Leech.cs b/Projectiles/Melee/Leech.cs similarity index 94% rename from Projectiles/Leech.cs rename to Projectiles/Melee/Leech.cs index d110504544..b0b74db782 100644 --- a/Projectiles/Leech.cs +++ b/Projectiles/Melee/Leech.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class Leech : ModProjectile { @@ -21,7 +21,8 @@ namespace CalamityMod.Projectiles projectile.friendly = true; projectile.penetrate = 1; projectile.timeLeft = 200; - } + projectile.melee = true; + } public override void AI() { diff --git a/Projectiles/Leech.png b/Projectiles/Melee/Leech.png similarity index 100% rename from Projectiles/Leech.png rename to Projectiles/Melee/Leech.png diff --git a/Projectiles/LifeScythe.cs b/Projectiles/Melee/LifeScythe.cs similarity index 81% rename from Projectiles/LifeScythe.cs rename to Projectiles/Melee/LifeScythe.cs index 7e1af0c59c..1fdfbafc6c 100644 --- a/Projectiles/LifeScythe.cs +++ b/Projectiles/Melee/LifeScythe.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class LifeScythe : ModProjectile { @@ -57,16 +57,6 @@ namespace CalamityMod.Projectiles public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (target.type == NPCID.TargetDummy) - { - return; - } - Player player = Main.player[projectile.owner]; - if (Main.rand.Next(2) == 0) - { - player.statLife += 1; - player.HealEffect(1); - } target.AddBuff(BuffID.OnFire, 200); target.AddBuff(BuffID.CursedInferno, 200); } diff --git a/Projectiles/LifeScythe.png b/Projectiles/Melee/LifeScythe.png similarity index 100% rename from Projectiles/LifeScythe.png rename to Projectiles/Melee/LifeScythe.png diff --git a/Projectiles/Light.cs b/Projectiles/Melee/Light.cs similarity index 92% rename from Projectiles/Light.cs rename to Projectiles/Melee/Light.cs index 9c30093651..4a6eaef5a8 100644 --- a/Projectiles/Light.cs +++ b/Projectiles/Melee/Light.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class Light : ModProjectile { diff --git a/Projectiles/Light.png b/Projectiles/Melee/Light.png similarity index 100% rename from Projectiles/Light.png rename to Projectiles/Melee/Light.png diff --git a/Projectiles/MangroveChakramProjectileMelee.cs b/Projectiles/Melee/MangroveChakramProjectileMelee.cs similarity index 95% rename from Projectiles/MangroveChakramProjectileMelee.cs rename to Projectiles/Melee/MangroveChakramProjectileMelee.cs index e8432c8c4e..4e9292370b 100644 --- a/Projectiles/MangroveChakramProjectileMelee.cs +++ b/Projectiles/Melee/MangroveChakramProjectileMelee.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class MangroveChakramProjectileMelee : ModProjectile { diff --git a/Projectiles/MangroveChakramProjectileMelee.png b/Projectiles/Melee/MangroveChakramProjectileMelee.png similarity index 100% rename from Projectiles/MangroveChakramProjectileMelee.png rename to Projectiles/Melee/MangroveChakramProjectileMelee.png diff --git a/Projectiles/MarianaProjectile.cs b/Projectiles/Melee/MarianaProjectile.cs similarity index 95% rename from Projectiles/MarianaProjectile.cs rename to Projectiles/Melee/MarianaProjectile.cs index ed1a157aad..d817d83b32 100644 --- a/Projectiles/MarianaProjectile.cs +++ b/Projectiles/Melee/MarianaProjectile.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class MarianaProjectile : ModProjectile { diff --git a/Projectiles/MarianaProjectile.png b/Projectiles/Melee/MarianaProjectile.png similarity index 100% rename from Projectiles/MarianaProjectile.png rename to Projectiles/Melee/MarianaProjectile.png diff --git a/Projectiles/MarniteObliterator.cs b/Projectiles/Melee/MarniteObliterator.cs similarity index 89% rename from Projectiles/MarniteObliterator.cs rename to Projectiles/Melee/MarniteObliterator.cs index 39040456b3..fad8274bd5 100644 --- a/Projectiles/MarniteObliterator.cs +++ b/Projectiles/Melee/MarniteObliterator.cs @@ -3,7 +3,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class MarniteObliterator : ModProjectile { diff --git a/Projectiles/MarniteObliterator.png b/Projectiles/Melee/MarniteObliterator.png similarity index 100% rename from Projectiles/MarniteObliterator.png rename to Projectiles/Melee/MarniteObliterator.png diff --git a/Projectiles/MeteorFist.cs b/Projectiles/Melee/MeteorFist.cs similarity index 97% rename from Projectiles/MeteorFist.cs rename to Projectiles/Melee/MeteorFist.cs index 6ee5e86635..b430543776 100644 --- a/Projectiles/MeteorFist.cs +++ b/Projectiles/Melee/MeteorFist.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class MeteorFist : ModProjectile { diff --git a/Projectiles/MeteorFist.png b/Projectiles/Melee/MeteorFist.png similarity index 100% rename from Projectiles/MeteorFist.png rename to Projectiles/Melee/MeteorFist.png diff --git a/Projectiles/MirrorBlast.cs b/Projectiles/Melee/MirrorBlast.cs similarity index 96% rename from Projectiles/MirrorBlast.cs rename to Projectiles/Melee/MirrorBlast.cs index 2728e2d764..3e9ab54eff 100644 --- a/Projectiles/MirrorBlast.cs +++ b/Projectiles/Melee/MirrorBlast.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class MirrorBlast : ModProjectile { diff --git a/Projectiles/MirrorBlast.png b/Projectiles/Melee/MirrorBlast.png similarity index 100% rename from Projectiles/MirrorBlast.png rename to Projectiles/Melee/MirrorBlast.png diff --git a/Projectiles/Mourningstar.cs b/Projectiles/Melee/Mourningstar.cs similarity index 97% rename from Projectiles/Mourningstar.cs rename to Projectiles/Melee/Mourningstar.cs index 2bc684346e..2c98bed22a 100644 --- a/Projectiles/Mourningstar.cs +++ b/Projectiles/Melee/Mourningstar.cs @@ -7,7 +7,7 @@ using Terraria.ID; using Terraria.ModLoader; using Terraria.Enums; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class Mourningstar : ModProjectile { diff --git a/Projectiles/Mourningstar.png b/Projectiles/Melee/Mourningstar.png similarity index 100% rename from Projectiles/Mourningstar.png rename to Projectiles/Melee/Mourningstar.png diff --git a/Projectiles/Murasama.cs b/Projectiles/Melee/Murasama.cs similarity index 95% rename from Projectiles/Murasama.cs rename to Projectiles/Melee/Murasama.cs index 4baff68a35..99c4cc2c8f 100644 --- a/Projectiles/Murasama.cs +++ b/Projectiles/Melee/Murasama.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class Murasama : ModProjectile { diff --git a/Projectiles/Murasama.png b/Projectiles/Melee/Murasama.png similarity index 100% rename from Projectiles/Murasama.png rename to Projectiles/Melee/Murasama.png diff --git a/Projectiles/Nebudust.cs b/Projectiles/Melee/Nebudust.cs similarity index 95% rename from Projectiles/Nebudust.cs rename to Projectiles/Melee/Nebudust.cs index 535c06c64b..6f92f9cd8e 100644 --- a/Projectiles/Nebudust.cs +++ b/Projectiles/Melee/Nebudust.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class Nebudust : ModProjectile { diff --git a/Projectiles/Nebudust.png b/Projectiles/Melee/Nebudust.png similarity index 100% rename from Projectiles/Nebudust.png rename to Projectiles/Melee/Nebudust.png diff --git a/Projectiles/Nebulash.cs b/Projectiles/Melee/Nebulash.cs similarity index 97% rename from Projectiles/Nebulash.cs rename to Projectiles/Melee/Nebulash.cs index 6bc0d22576..6e56a3c052 100644 --- a/Projectiles/Nebulash.cs +++ b/Projectiles/Melee/Nebulash.cs @@ -7,7 +7,7 @@ using Terraria.ID; using Terraria.ModLoader; using Terraria.Enums; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class Nebulash : ModProjectile { diff --git a/Projectiles/Nebulash.png b/Projectiles/Melee/Nebulash.png similarity index 100% rename from Projectiles/Nebulash.png rename to Projectiles/Melee/Nebulash.png diff --git a/Projectiles/NeptuneOrb.cs b/Projectiles/Melee/NeptuneOrb.cs similarity index 96% rename from Projectiles/NeptuneOrb.cs rename to Projectiles/Melee/NeptuneOrb.cs index 672fca8878..856500670e 100644 --- a/Projectiles/NeptuneOrb.cs +++ b/Projectiles/Melee/NeptuneOrb.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class NeptuneOrb : ModProjectile { diff --git a/Projectiles/NeptuneOrb.png b/Projectiles/Melee/NeptuneOrb.png similarity index 100% rename from Projectiles/NeptuneOrb.png rename to Projectiles/Melee/NeptuneOrb.png diff --git a/Projectiles/NightStabber.cs b/Projectiles/Melee/NightStabber.cs similarity index 94% rename from Projectiles/NightStabber.cs rename to Projectiles/Melee/NightStabber.cs index 5691318bb3..3510473506 100644 --- a/Projectiles/NightStabber.cs +++ b/Projectiles/Melee/NightStabber.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class NightStabber : ModProjectile { @@ -22,7 +22,8 @@ namespace CalamityMod.Projectiles projectile.penetrate = 1; projectile.tileCollide = false; projectile.timeLeft = 300; - } + projectile.melee = true; + } public override void AI() { diff --git a/Projectiles/NightStabber.png b/Projectiles/Melee/NightStabber.png similarity index 100% rename from Projectiles/NightStabber.png rename to Projectiles/Melee/NightStabber.png diff --git a/Projectiles/OPHammerMelee.cs b/Projectiles/Melee/OPHammerMelee.cs similarity index 96% rename from Projectiles/OPHammerMelee.cs rename to Projectiles/Melee/OPHammerMelee.cs index 489ebe03bf..023da31cf8 100644 --- a/Projectiles/OPHammerMelee.cs +++ b/Projectiles/Melee/OPHammerMelee.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class OPHammerMelee : ModProjectile { diff --git a/Projectiles/OPHammerMelee.png b/Projectiles/Melee/OPHammerMelee.png similarity index 100% rename from Projectiles/OPHammerMelee.png rename to Projectiles/Melee/OPHammerMelee.png diff --git a/Projectiles/Oathblade.cs b/Projectiles/Melee/Oathblade.cs similarity index 94% rename from Projectiles/Oathblade.cs rename to Projectiles/Melee/Oathblade.cs index b4d76d10f0..d31823a26d 100644 --- a/Projectiles/Oathblade.cs +++ b/Projectiles/Melee/Oathblade.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class Oathblade : ModProjectile { diff --git a/Projectiles/Oathblade.png b/Projectiles/Melee/Oathblade.png similarity index 100% rename from Projectiles/Oathblade.png rename to Projectiles/Melee/Oathblade.png diff --git a/Projectiles/OceanBeam.cs b/Projectiles/Melee/OceanBeam.cs similarity index 96% rename from Projectiles/OceanBeam.cs rename to Projectiles/Melee/OceanBeam.cs index ba81a09227..3ae07cdc95 100644 --- a/Projectiles/OceanBeam.cs +++ b/Projectiles/Melee/OceanBeam.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class OceanBeam : ModProjectile { diff --git a/Projectiles/OceanBeam.png b/Projectiles/Melee/OceanBeam.png similarity index 100% rename from Projectiles/OceanBeam.png rename to Projectiles/Melee/OceanBeam.png diff --git a/Projectiles/OmegaBiomeOrb.cs b/Projectiles/Melee/OmegaBiomeOrb.cs similarity index 96% rename from Projectiles/OmegaBiomeOrb.cs rename to Projectiles/Melee/OmegaBiomeOrb.cs index 560db6da9f..c8649bc8a8 100644 --- a/Projectiles/OmegaBiomeOrb.cs +++ b/Projectiles/Melee/OmegaBiomeOrb.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class OmegaBiomeOrb : ModProjectile { diff --git a/Projectiles/OmegaBiomeOrb.png b/Projectiles/Melee/OmegaBiomeOrb.png similarity index 100% rename from Projectiles/OmegaBiomeOrb.png rename to Projectiles/Melee/OmegaBiomeOrb.png diff --git a/Projectiles/PlagueBeeDust.cs b/Projectiles/Melee/PlagueBeeDust.cs similarity index 96% rename from Projectiles/PlagueBeeDust.cs rename to Projectiles/Melee/PlagueBeeDust.cs index e37d389c36..6f09e15586 100644 --- a/Projectiles/PlagueBeeDust.cs +++ b/Projectiles/Melee/PlagueBeeDust.cs @@ -1,107 +1,107 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles -{ - public class PlagueBeeDust : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Dust"); - } - - public override void SetDefaults() - { - projectile.width = 70; - projectile.height = 70; - projectile.friendly = true; - projectile.ignoreWater = true; - projectile.tileCollide = false; - projectile.melee = true; - projectile.penetrate = -1; - projectile.extraUpdates = 3; - projectile.timeLeft = 60; - } - - public override void AI() - { - Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0.05f) / 255f, ((255 - projectile.alpha) * 0.4f) / 255f, ((255 - projectile.alpha) * 0.01f) / 255f); - if (projectile.ai[0] > 7f) - { - float num296 = 1f; - if (projectile.ai[0] == 8f) - { - num296 = 0.25f; - } - else if (projectile.ai[0] == 9f) - { - num296 = 0.5f; - } - else if (projectile.ai[0] == 10f) - { - num296 = 0.75f; - } - projectile.ai[0] += 1f; - if (projectile.ai[0] % 2f == 0f) - { - int spawnX = (int)(projectile.width / 2); - int spawnY = (int)(projectile.width / 2); - int bee = Projectile.NewProjectile(projectile.Center.X + (float)Main.rand.Next(-spawnX, spawnX), projectile.Center.Y + (float)Main.rand.Next(-spawnY, spawnY), - projectile.velocity.X, projectile.velocity.Y, Main.player[projectile.owner].beeType(), - Main.player[projectile.owner].beeDamage(projectile.damage / 3), Main.player[projectile.owner].beeKB(0f), projectile.owner, 0f, 0f); - Main.projectile[bee].penetrate = 1; - } - int num297 = 89; - if (Main.rand.Next(1) == 0) - { - for (int num298 = 0; num298 < 2; num298++) - { - int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default(Color), 1f); - if ((num297 == 89 && Main.rand.Next(3) == 0)) - { - Main.dust[num299].noGravity = true; - Main.dust[num299].scale *= 2.5f; - Dust expr_DBEF_cp_0 = Main.dust[num299]; - expr_DBEF_cp_0.velocity.X = expr_DBEF_cp_0.velocity.X * 2f; - Dust expr_DC0F_cp_0 = Main.dust[num299]; - expr_DC0F_cp_0.velocity.Y = expr_DC0F_cp_0.velocity.Y * 2f; - } - else - { - Main.dust[num299].scale *= 2f; - } - Dust expr_DC74_cp_0 = Main.dust[num299]; - expr_DC74_cp_0.velocity.X = expr_DC74_cp_0.velocity.X * 1.2f; - Dust expr_DC94_cp_0 = Main.dust[num299]; - expr_DC94_cp_0.velocity.Y = expr_DC94_cp_0.velocity.Y * 1.2f; - Main.dust[num299].scale *= num296; - if (num297 == 75) - { - Main.dust[num299].velocity += projectile.velocity; - if (!Main.dust[num299].noGravity) - { - Main.dust[num299].velocity *= 0.5f; - } - } - } - } - } - else - { - projectile.ai[0] += 1f; - } - projectile.rotation += 0.3f * (float)projectile.direction; - return; - } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.immune[projectile.owner] = 5; - target.AddBuff(mod.BuffType("Plague"), 180); - } - } +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Melee +{ + public class PlagueBeeDust : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Dust"); + } + + public override void SetDefaults() + { + projectile.width = 70; + projectile.height = 70; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.tileCollide = false; + projectile.melee = true; + projectile.penetrate = -1; + projectile.extraUpdates = 3; + projectile.timeLeft = 60; + } + + public override void AI() + { + Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0.05f) / 255f, ((255 - projectile.alpha) * 0.4f) / 255f, ((255 - projectile.alpha) * 0.01f) / 255f); + if (projectile.ai[0] > 7f) + { + float num296 = 1f; + if (projectile.ai[0] == 8f) + { + num296 = 0.25f; + } + else if (projectile.ai[0] == 9f) + { + num296 = 0.5f; + } + else if (projectile.ai[0] == 10f) + { + num296 = 0.75f; + } + projectile.ai[0] += 1f; + if (projectile.ai[0] % 2f == 0f) + { + int spawnX = (int)(projectile.width / 2); + int spawnY = (int)(projectile.width / 2); + int bee = Projectile.NewProjectile(projectile.Center.X + (float)Main.rand.Next(-spawnX, spawnX), projectile.Center.Y + (float)Main.rand.Next(-spawnY, spawnY), + projectile.velocity.X, projectile.velocity.Y, Main.player[projectile.owner].beeType(), + Main.player[projectile.owner].beeDamage(projectile.damage / 3), Main.player[projectile.owner].beeKB(0f), projectile.owner, 0f, 0f); + Main.projectile[bee].penetrate = 1; + } + int num297 = 89; + if (Main.rand.Next(1) == 0) + { + for (int num298 = 0; num298 < 2; num298++) + { + int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default(Color), 1f); + if ((num297 == 89 && Main.rand.Next(3) == 0)) + { + Main.dust[num299].noGravity = true; + Main.dust[num299].scale *= 2.5f; + Dust expr_DBEF_cp_0 = Main.dust[num299]; + expr_DBEF_cp_0.velocity.X = expr_DBEF_cp_0.velocity.X * 2f; + Dust expr_DC0F_cp_0 = Main.dust[num299]; + expr_DC0F_cp_0.velocity.Y = expr_DC0F_cp_0.velocity.Y * 2f; + } + else + { + Main.dust[num299].scale *= 2f; + } + Dust expr_DC74_cp_0 = Main.dust[num299]; + expr_DC74_cp_0.velocity.X = expr_DC74_cp_0.velocity.X * 1.2f; + Dust expr_DC94_cp_0 = Main.dust[num299]; + expr_DC94_cp_0.velocity.Y = expr_DC94_cp_0.velocity.Y * 1.2f; + Main.dust[num299].scale *= num296; + if (num297 == 75) + { + Main.dust[num299].velocity += projectile.velocity; + if (!Main.dust[num299].noGravity) + { + Main.dust[num299].velocity *= 0.5f; + } + } + } + } + } + else + { + projectile.ai[0] += 1f; + } + projectile.rotation += 0.3f * (float)projectile.direction; + return; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.immune[projectile.owner] = 5; + target.AddBuff(mod.BuffType("Plague"), 180); + } + } } \ No newline at end of file diff --git a/Projectiles/PlagueBeeDust.png b/Projectiles/Melee/PlagueBeeDust.png similarity index 100% rename from Projectiles/PlagueBeeDust.png rename to Projectiles/Melee/PlagueBeeDust.png diff --git a/Projectiles/PlagueDust.cs b/Projectiles/Melee/PlagueDust.cs similarity index 95% rename from Projectiles/PlagueDust.cs rename to Projectiles/Melee/PlagueDust.cs index 315a3b228f..c0d0845632 100644 --- a/Projectiles/PlagueDust.cs +++ b/Projectiles/Melee/PlagueDust.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class PlagueDust : ModProjectile { diff --git a/Projectiles/PlagueDust.png b/Projectiles/Melee/PlagueDust.png similarity index 100% rename from Projectiles/PlagueDust.png rename to Projectiles/Melee/PlagueDust.png diff --git a/Projectiles/PlagueSeeker.cs b/Projectiles/Melee/PlagueSeeker.cs similarity index 95% rename from Projectiles/PlagueSeeker.cs rename to Projectiles/Melee/PlagueSeeker.cs index 605962b709..0773b9ef14 100644 --- a/Projectiles/PlagueSeeker.cs +++ b/Projectiles/Melee/PlagueSeeker.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class PlagueSeeker : ModProjectile { diff --git a/Projectiles/PlagueSeeker.png b/Projectiles/Melee/PlagueSeeker.png similarity index 100% rename from Projectiles/PlagueSeeker.png rename to Projectiles/Melee/PlagueSeeker.png diff --git a/Projectiles/PlasmaBall.cs b/Projectiles/Melee/PlasmaBall.cs similarity index 95% rename from Projectiles/PlasmaBall.cs rename to Projectiles/Melee/PlasmaBall.cs index c504780e4f..cff23ee359 100644 --- a/Projectiles/PlasmaBall.cs +++ b/Projectiles/Melee/PlasmaBall.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class PlasmaBall : ModProjectile { diff --git a/Projectiles/PlasmaBall.png b/Projectiles/Melee/PlasmaBall.png similarity index 100% rename from Projectiles/PlasmaBall.png rename to Projectiles/Melee/PlasmaBall.png diff --git a/Projectiles/PwnagehammerMelee.cs b/Projectiles/Melee/PwnagehammerMelee.cs similarity index 94% rename from Projectiles/PwnagehammerMelee.cs rename to Projectiles/Melee/PwnagehammerMelee.cs index 657a2af7df..776f26bb91 100644 --- a/Projectiles/PwnagehammerMelee.cs +++ b/Projectiles/Melee/PwnagehammerMelee.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class PwnagehammerMelee : ModProjectile { diff --git a/Projectiles/PwnagehammerMelee.png b/Projectiles/Melee/PwnagehammerMelee.png similarity index 100% rename from Projectiles/PwnagehammerMelee.png rename to Projectiles/Melee/PwnagehammerMelee.png diff --git a/Projectiles/RainBolt.cs b/Projectiles/Melee/RainBolt.cs similarity index 96% rename from Projectiles/RainBolt.cs rename to Projectiles/Melee/RainBolt.cs index 907e3b0086..702d9ca162 100644 --- a/Projectiles/RainBolt.cs +++ b/Projectiles/Melee/RainBolt.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class RainBolt : ModProjectile { diff --git a/Projectiles/RainBolt.png b/Projectiles/Melee/RainBolt.png similarity index 100% rename from Projectiles/RainBolt.png rename to Projectiles/Melee/RainBolt.png diff --git a/Projectiles/RainbowBoom.cs b/Projectiles/Melee/RainbowBoom.cs similarity index 95% rename from Projectiles/RainbowBoom.cs rename to Projectiles/Melee/RainbowBoom.cs index ec3922999b..cbf14f0049 100644 --- a/Projectiles/RainbowBoom.cs +++ b/Projectiles/Melee/RainbowBoom.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class RainbowBoom : ModProjectile { diff --git a/Projectiles/RainbowBoom.png b/Projectiles/Melee/RainbowBoom.png similarity index 100% rename from Projectiles/RainbowBoom.png rename to Projectiles/Melee/RainbowBoom.png diff --git a/Projectiles/Razorwind.cs b/Projectiles/Melee/Razorwind.cs similarity index 96% rename from Projectiles/Razorwind.cs rename to Projectiles/Melee/Razorwind.cs index 797dc86810..9b287fbe78 100644 --- a/Projectiles/Razorwind.cs +++ b/Projectiles/Melee/Razorwind.cs @@ -7,7 +7,7 @@ using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class Razorwind : ModProjectile { diff --git a/Projectiles/Razorwind.png b/Projectiles/Melee/Razorwind.png similarity index 100% rename from Projectiles/Razorwind.png rename to Projectiles/Melee/Razorwind.png diff --git a/Projectiles/RedBall.cs b/Projectiles/Melee/RedBall.cs similarity index 95% rename from Projectiles/RedBall.cs rename to Projectiles/Melee/RedBall.cs index 5e535ab4a9..5a084b9fe9 100644 --- a/Projectiles/RedBall.cs +++ b/Projectiles/Melee/RedBall.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class RedBall : ModProjectile { diff --git a/Projectiles/RedBall.png b/Projectiles/Melee/RedBall.png similarity index 100% rename from Projectiles/RedBall.png rename to Projectiles/Melee/RedBall.png diff --git a/Projectiles/RedDust.cs b/Projectiles/Melee/RedDust.cs similarity index 93% rename from Projectiles/RedDust.cs rename to Projectiles/Melee/RedDust.cs index b2b7ffc587..a586a41c23 100644 --- a/Projectiles/RedDust.cs +++ b/Projectiles/Melee/RedDust.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class RedDust : ModProjectile { diff --git a/Projectiles/RedDust.png b/Projectiles/Melee/RedDust.png similarity index 100% rename from Projectiles/RedDust.png rename to Projectiles/Melee/RedDust.png diff --git a/Projectiles/RoyalKnifeMelee.cs b/Projectiles/Melee/RoyalKnifeMelee.cs similarity index 93% rename from Projectiles/RoyalKnifeMelee.cs rename to Projectiles/Melee/RoyalKnifeMelee.cs index b64ef3dcfd..bf99bc1b41 100644 --- a/Projectiles/RoyalKnifeMelee.cs +++ b/Projectiles/Melee/RoyalKnifeMelee.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class RoyalKnifeMelee : ModProjectile { @@ -99,7 +99,7 @@ namespace CalamityMod.Projectiles { return; } - float num = (float)damage * 0.075f; + float num = (float)damage * 0.015f; if ((int)num == 0) { return; @@ -108,7 +108,7 @@ namespace CalamityMod.Projectiles { return; } - Main.player[Main.myPlayer].lifeSteal -= num * 2f; + Main.player[Main.myPlayer].lifeSteal -= num * 1.5f; int num2 = projectile.owner; Projectile.NewProjectile(target.position.X, target.position.Y, 0f, 0f, mod.ProjectileType("RoyalHeal"), 0, 0f, projectile.owner, (float)num2, num); } diff --git a/Projectiles/RoyalKnifeMelee.png b/Projectiles/Melee/RoyalKnifeMelee.png similarity index 100% rename from Projectiles/RoyalKnifeMelee.png rename to Projectiles/Melee/RoyalKnifeMelee.png diff --git a/Projectiles/SHIV.cs b/Projectiles/Melee/SHIV.cs similarity index 95% rename from Projectiles/SHIV.cs rename to Projectiles/Melee/SHIV.cs index 3a820d3275..acc1fd278a 100644 --- a/Projectiles/SHIV.cs +++ b/Projectiles/Melee/SHIV.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class SHIV : ModProjectile { diff --git a/Projectiles/SHIV.png b/Projectiles/Melee/SHIV.png similarity index 100% rename from Projectiles/SHIV.png rename to Projectiles/Melee/SHIV.png diff --git a/Projectiles/SandBlade.cs b/Projectiles/Melee/SandBlade.cs similarity index 94% rename from Projectiles/SandBlade.cs rename to Projectiles/Melee/SandBlade.cs index c233a275c9..663515889b 100644 --- a/Projectiles/SandBlade.cs +++ b/Projectiles/Melee/SandBlade.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class SandBlade : ModProjectile { diff --git a/Projectiles/SandBlade.png b/Projectiles/Melee/SandBlade.png similarity index 100% rename from Projectiles/SandBlade.png rename to Projectiles/Melee/SandBlade.png diff --git a/Projectiles/SandFire.cs b/Projectiles/Melee/SandFire.cs similarity index 95% rename from Projectiles/SandFire.cs rename to Projectiles/Melee/SandFire.cs index 44730ab46d..a34af449b0 100644 --- a/Projectiles/SandFire.cs +++ b/Projectiles/Melee/SandFire.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class SandFire : ModProjectile { diff --git a/Projectiles/SandFire.png b/Projectiles/Melee/SandFire.png similarity index 100% rename from Projectiles/SandFire.png rename to Projectiles/Melee/SandFire.png diff --git a/Projectiles/ScourgeoftheCosmos.cs b/Projectiles/Melee/ScourgeoftheCosmos.cs similarity index 93% rename from Projectiles/ScourgeoftheCosmos.cs rename to Projectiles/Melee/ScourgeoftheCosmos.cs index c92bc39dea..45e1229351 100644 --- a/Projectiles/ScourgeoftheCosmos.cs +++ b/Projectiles/Melee/ScourgeoftheCosmos.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class ScourgeoftheCosmos : ModProjectile { @@ -34,13 +34,14 @@ namespace CalamityMod.Projectiles if (projectile.ai[1] == 1f) { projectile.melee = false; - } + projectile.GetGlobalProjectile(mod).rogue = true; + } if (projectile.alpha <= 200) { int num3; for (int num20 = 0; num20 < 2; num20 = num3 + 1) { - int dustType = (Main.rand.Next(2) == 0 ? 56 : 242); + int dustType = (Main.rand.Next(3) == 0 ? 56 : 242); float num21 = projectile.velocity.X / 4f * (float)num20; float num22 = projectile.velocity.Y / 4f * (float)num20; int num23 = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType, 0f, 0f, 0, default(Color), 1f); @@ -130,7 +131,7 @@ namespace CalamityMod.Projectiles int num3; for (int num622 = 0; num622 < 10; num622 = num3 + 1) { - int dustType = (Main.rand.Next(2) == 0 ? 56 : 242); + int dustType = (Main.rand.Next(3) == 0 ? 56 : 242); int num623 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 0, default(Color), 1f); Dust dust = Main.dust[num623]; dust.scale *= 1.1f; @@ -139,7 +140,7 @@ namespace CalamityMod.Projectiles } for (int num624 = 0; num624 < 15; num624 = num3 + 1) { - int dustType = (Main.rand.Next(2) == 0 ? 56 : 242); + int dustType = (Main.rand.Next(3) == 0 ? 56 : 242); int num625 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 0, default(Color), 1f); Dust dust = Main.dust[num625]; dust.velocity *= 2.5f; diff --git a/Projectiles/Melee/ScourgeoftheCosmos.png b/Projectiles/Melee/ScourgeoftheCosmos.png new file mode 100644 index 0000000000..2bfdfe1cbf Binary files /dev/null and b/Projectiles/Melee/ScourgeoftheCosmos.png differ diff --git a/Projectiles/ScourgeoftheCosmosMini.cs b/Projectiles/Melee/ScourgeoftheCosmosMini.cs similarity index 85% rename from Projectiles/ScourgeoftheCosmosMini.cs rename to Projectiles/Melee/ScourgeoftheCosmosMini.cs index abe9102590..501cac944f 100644 --- a/Projectiles/ScourgeoftheCosmosMini.cs +++ b/Projectiles/Melee/ScourgeoftheCosmosMini.cs @@ -1,15 +1,16 @@ using System; using System.Collections.Generic; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class ScourgeoftheCosmosMini : ModProjectile { - public int bounce = 3; + private int bounce = 3; public override void SetStaticDefaults() { @@ -34,7 +35,8 @@ namespace CalamityMod.Projectiles if (projectile.ai[1] == 1f) { projectile.melee = false; - } + projectile.GetGlobalProjectile(mod).rogue = true; + } if (projectile.alpha > 0) { projectile.alpha -= 50; @@ -53,14 +55,14 @@ namespace CalamityMod.Projectiles projectile.frame++; projectile.frameCounter = 0; } - if (projectile.frame >= 1) + if (projectile.frame > 1) { projectile.frame = 0; } int num3; for (int num369 = 0; num369 < 1; num369 = num3 + 1) { - int dustType = (Main.rand.Next(2) == 0 ? 56 : 242); + int dustType = (Main.rand.Next(3) == 0 ? 56 : 242); float num370 = projectile.velocity.X / 3f * (float)num369; float num371 = projectile.velocity.Y / 3f * (float)num369; int num372 = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType, 0f, 0f, 0, default(Color), 1f); @@ -169,5 +171,14 @@ namespace CalamityMod.Projectiles } return false; } - } + + public override void PostDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D texture2D13 = Main.projectileTexture[projectile.type]; + int num214 = Main.projectileTexture[projectile.type].Height / Main.projFrames[projectile.type]; + int y6 = num214 * projectile.frame; + Vector2 origin = new Vector2(9f, 10f); + spriteBatch.Draw(mod.GetTexture("Projectiles/Melee/ScourgeoftheCosmosMiniGlow"), projectile.Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y6, texture2D13.Width, num214)), Color.White, projectile.rotation, origin, projectile.scale, SpriteEffects.None, 0f); + } + } } \ No newline at end of file diff --git a/Projectiles/Melee/ScourgeoftheCosmosMini.png b/Projectiles/Melee/ScourgeoftheCosmosMini.png new file mode 100644 index 0000000000..ccaa015047 Binary files /dev/null and b/Projectiles/Melee/ScourgeoftheCosmosMini.png differ diff --git a/Projectiles/Melee/ScourgeoftheCosmosMiniGlow.png b/Projectiles/Melee/ScourgeoftheCosmosMiniGlow.png new file mode 100644 index 0000000000..1ee5383bb9 Binary files /dev/null and b/Projectiles/Melee/ScourgeoftheCosmosMiniGlow.png differ diff --git a/Projectiles/SeashellBoomerangProjectileMelee.cs b/Projectiles/Melee/SeashellBoomerangProjectileMelee.cs similarity index 89% rename from Projectiles/SeashellBoomerangProjectileMelee.cs rename to Projectiles/Melee/SeashellBoomerangProjectileMelee.cs index 3c25addca9..8355da91d5 100644 --- a/Projectiles/SeashellBoomerangProjectileMelee.cs +++ b/Projectiles/Melee/SeashellBoomerangProjectileMelee.cs @@ -4,7 +4,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class SeashellBoomerangProjectileMelee : ModProjectile { @@ -21,7 +21,7 @@ namespace CalamityMod.Projectiles projectile.melee = true; projectile.penetrate = -1; projectile.aiStyle = 3; - projectile.timeLeft = 600; + projectile.timeLeft = 240; aiType = 52; } diff --git a/Projectiles/SeashellBoomerangProjectileMelee.png b/Projectiles/Melee/SeashellBoomerangProjectileMelee.png similarity index 100% rename from Projectiles/SeashellBoomerangProjectileMelee.png rename to Projectiles/Melee/SeashellBoomerangProjectileMelee.png diff --git a/Projectiles/ShortBeam.cs b/Projectiles/Melee/ShortBeam.cs similarity index 95% rename from Projectiles/ShortBeam.cs rename to Projectiles/Melee/ShortBeam.cs index ebc08ec44b..949255ed88 100644 --- a/Projectiles/ShortBeam.cs +++ b/Projectiles/Melee/ShortBeam.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class ShortBeam : ModProjectile { diff --git a/Projectiles/ShortBeam.png b/Projectiles/Melee/ShortBeam.png similarity index 100% rename from Projectiles/ShortBeam.png rename to Projectiles/Melee/ShortBeam.png diff --git a/Projectiles/ShortNightBeam.cs b/Projectiles/Melee/ShortNightBeam.cs similarity index 95% rename from Projectiles/ShortNightBeam.cs rename to Projectiles/Melee/ShortNightBeam.cs index 5f0b251c50..a3a63f7094 100644 --- a/Projectiles/ShortNightBeam.cs +++ b/Projectiles/Melee/ShortNightBeam.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class ShortNightBeam : ModProjectile { diff --git a/Projectiles/ShortNightBeam.png b/Projectiles/Melee/ShortNightBeam.png similarity index 100% rename from Projectiles/ShortNightBeam.png rename to Projectiles/Melee/ShortNightBeam.png diff --git a/Projectiles/ShortTerraBeam.cs b/Projectiles/Melee/ShortTerraBeam.cs similarity index 95% rename from Projectiles/ShortTerraBeam.cs rename to Projectiles/Melee/ShortTerraBeam.cs index a52b495270..2aaf6676f5 100644 --- a/Projectiles/ShortTerraBeam.cs +++ b/Projectiles/Melee/ShortTerraBeam.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class ShortTerraBeam : ModProjectile { diff --git a/Projectiles/ShortTerraBeam.png b/Projectiles/Melee/ShortTerraBeam.png similarity index 100% rename from Projectiles/ShortTerraBeam.png rename to Projectiles/Melee/ShortTerraBeam.png diff --git a/Projectiles/SolarFlare.cs b/Projectiles/Melee/SolarFlare.cs similarity index 96% rename from Projectiles/SolarFlare.cs rename to Projectiles/Melee/SolarFlare.cs index c4af20ea56..332da72168 100644 --- a/Projectiles/SolarFlare.cs +++ b/Projectiles/Melee/SolarFlare.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class SolarFlare : ModProjectile { diff --git a/Projectiles/SolarFlare.png b/Projectiles/Melee/SolarFlare.png similarity index 100% rename from Projectiles/SolarFlare.png rename to Projectiles/Melee/SolarFlare.png diff --git a/Projectiles/Melee/SolsticeBeam.cs b/Projectiles/Melee/SolsticeBeam.cs new file mode 100644 index 0000000000..ad1203e925 --- /dev/null +++ b/Projectiles/Melee/SolsticeBeam.cs @@ -0,0 +1,201 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Melee +{ + public class SolsticeBeam : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Beam"); + } + + public override void SetDefaults() + { + projectile.width = 20; + projectile.height = 20; + projectile.friendly = true; + projectile.melee = true; + projectile.penetrate = 1; + projectile.timeLeft = 600; + } + + public override void AI() + { + Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0.5f) / 255f, ((255 - projectile.alpha) * 0.5f) / 255f, ((255 - projectile.alpha) * 0.5f) / 255f); + projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 0.785f; + if (projectile.ai[1] == 0f) + { + projectile.ai[1] = 1f; + Main.PlaySound(SoundID.Item60, projectile.position); + } + if (projectile.localAI[0] == 0f) + { + projectile.scale -= 0.02f; + projectile.alpha += 30; + if (projectile.alpha >= 250) + { + projectile.alpha = 255; + projectile.localAI[0] = 1f; + } + } + else if (projectile.localAI[0] == 1f) + { + projectile.scale += 0.02f; + projectile.alpha -= 30; + if (projectile.alpha <= 0) + { + projectile.alpha = 0; + projectile.localAI[0] = 0f; + } + } + int dustType = 0; + + switch (CalamityMod.season) + { + case Season.Spring: + dustType = Utils.SelectRandom(Main.rand, new int[] + { + 74, + 157, + 107 + }); + break; + case Season.Summer: + dustType = Utils.SelectRandom(Main.rand, new int[] + { + 247, + 228, + 57 + }); + break; + case Season.Fall: + dustType = Utils.SelectRandom(Main.rand, new int[] + { + 6, + 259, + 158 + }); + break; + case Season.Winter: + dustType = Utils.SelectRandom(Main.rand, new int[] + { + 67, + 229, + 185 + }); + break; + } + if (Main.rand.Next(3) == 0) + { + int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType, projectile.velocity.X * 0.05f, projectile.velocity.Y * 0.05f); + Main.dust[dust].noGravity = true; + } + } + + public override Color? GetAlpha(Color lightColor) + { + byte red = 255; + byte green = 255; + byte blue = 255; + switch (CalamityMod.season) + { + case Season.Spring: + red = 0; + green = 250; + blue = 0; + break; + case Season.Summer: + red = 250; + green = 250; + blue = 0; + break; + case Season.Fall: + red = 250; + green = 150; + blue = 50; + break; + case Season.Winter: + red = 100; + green = 150; + blue = 250; + break; + } + return new Color(red, green, blue, projectile.alpha); + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D tex = Main.projectileTexture[projectile.type]; + spriteBatch.Draw(tex, projectile.Center - Main.screenPosition, null, projectile.GetAlpha(lightColor), projectile.rotation, tex.Size() / 2f, projectile.scale, SpriteEffects.None, 0f); + return false; + } + + public override void Kill(int timeLeft) + { + int dustType = 0; + + switch (CalamityMod.season) + { + case Season.Spring: + dustType = Utils.SelectRandom(Main.rand, new int[] + { + 245, + 157, + 107 + }); + break; + case Season.Summer: + dustType = Utils.SelectRandom(Main.rand, new int[] + { + 247, + 228, + 57 + }); + break; + case Season.Fall: + dustType = Utils.SelectRandom(Main.rand, new int[] + { + 6, + 259, + 158 + }); + break; + case Season.Winter: + dustType = Utils.SelectRandom(Main.rand, new int[] + { + 67, + 229, + 185 + }); + break; + } + Main.PlaySound(SoundID.Item10, projectile.position); + int num3; + for (int num795 = 4; num795 < 31; num795 = num3 + 1) + { + float num796 = projectile.oldVelocity.X * (30f / (float)num795); + float num797 = projectile.oldVelocity.Y * (30f / (float)num795); + int num798 = Dust.NewDust(new Vector2(projectile.oldPosition.X - num796, projectile.oldPosition.Y - num797), 8, 8, dustType, projectile.oldVelocity.X, projectile.oldVelocity.Y, 100, default(Color), 1.8f); + Main.dust[num798].noGravity = true; + Dust dust = Main.dust[num798]; + dust.velocity *= 0.5f; + num798 = Dust.NewDust(new Vector2(projectile.oldPosition.X - num796, projectile.oldPosition.Y - num797), 8, 8, dustType, projectile.oldVelocity.X, projectile.oldVelocity.Y, 100, default(Color), 1.4f); + dust = Main.dust[num798]; + dust.velocity *= 0.05f; + num3 = num795; + } + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + int buff = Main.dayTime ? BuffID.Daybreak : mod.BuffType("Nightwither"); + target.AddBuff(buff, 300); + } + } +} \ No newline at end of file diff --git a/Projectiles/SolsticeBeam.png b/Projectiles/Melee/SolsticeBeam.png similarity index 100% rename from Projectiles/SolsticeBeam.png rename to Projectiles/Melee/SolsticeBeam.png diff --git a/Projectiles/SoulScythe.cs b/Projectiles/Melee/SoulScythe.cs similarity index 96% rename from Projectiles/SoulScythe.cs rename to Projectiles/Melee/SoulScythe.cs index 4416e60a78..97bb81a855 100644 --- a/Projectiles/SoulScythe.cs +++ b/Projectiles/Melee/SoulScythe.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class SoulScythe : ModProjectile { diff --git a/Projectiles/SoulScythe.png b/Projectiles/Melee/SoulScythe.png similarity index 100% rename from Projectiles/SoulScythe.png rename to Projectiles/Melee/SoulScythe.png diff --git a/Projectiles/Spark.cs b/Projectiles/Melee/Spark.cs similarity index 93% rename from Projectiles/Spark.cs rename to Projectiles/Melee/Spark.cs index f262158970..b039270628 100644 --- a/Projectiles/Spark.cs +++ b/Projectiles/Melee/Spark.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class Spark : ModProjectile { @@ -20,9 +20,10 @@ namespace CalamityMod.Projectiles projectile.height = 12; projectile.friendly = true; projectile.penetrate = -1; - projectile.timeLeft = 300; + projectile.timeLeft = 120; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 10; + projectile.melee = true; } public override void AI() @@ -83,7 +84,6 @@ namespace CalamityMod.Projectiles if (projectile.velocity.Y > 16f) { projectile.velocity.Y = 16f; - return; } } diff --git a/Projectiles/Spark.png b/Projectiles/Melee/Spark.png similarity index 100% rename from Projectiles/Spark.png rename to Projectiles/Melee/Spark.png diff --git a/Projectiles/SpatialSpear.cs b/Projectiles/Melee/SpatialSpear.cs similarity index 95% rename from Projectiles/SpatialSpear.cs rename to Projectiles/Melee/SpatialSpear.cs index 768465a101..377bce472c 100644 --- a/Projectiles/SpatialSpear.cs +++ b/Projectiles/Melee/SpatialSpear.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class SpatialSpear : ModProjectile { diff --git a/Projectiles/SpatialSpear.png b/Projectiles/Melee/SpatialSpear.png similarity index 100% rename from Projectiles/SpatialSpear.png rename to Projectiles/Melee/SpatialSpear.png diff --git a/Projectiles/SpatialSpear2.cs b/Projectiles/Melee/SpatialSpear2.cs similarity index 95% rename from Projectiles/SpatialSpear2.cs rename to Projectiles/Melee/SpatialSpear2.cs index ee3a06de16..a05f6ef5c9 100644 --- a/Projectiles/SpatialSpear2.cs +++ b/Projectiles/Melee/SpatialSpear2.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class SpatialSpear2 : ModProjectile { diff --git a/Projectiles/SpatialSpear2.png b/Projectiles/Melee/SpatialSpear2.png similarity index 100% rename from Projectiles/SpatialSpear2.png rename to Projectiles/Melee/SpatialSpear2.png diff --git a/Projectiles/SpatialSpear3.cs b/Projectiles/Melee/SpatialSpear3.cs similarity index 95% rename from Projectiles/SpatialSpear3.cs rename to Projectiles/Melee/SpatialSpear3.cs index 510f026d81..847f214f1b 100644 --- a/Projectiles/SpatialSpear3.cs +++ b/Projectiles/Melee/SpatialSpear3.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class SpatialSpear3 : ModProjectile { diff --git a/Projectiles/SpatialSpear3.png b/Projectiles/Melee/SpatialSpear3.png similarity index 100% rename from Projectiles/SpatialSpear3.png rename to Projectiles/Melee/SpatialSpear3.png diff --git a/Projectiles/SpatialSpear4.cs b/Projectiles/Melee/SpatialSpear4.cs similarity index 92% rename from Projectiles/SpatialSpear4.cs rename to Projectiles/Melee/SpatialSpear4.cs index 393d8ef0c8..f4f73f724a 100644 --- a/Projectiles/SpatialSpear4.cs +++ b/Projectiles/Melee/SpatialSpear4.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class SpatialSpear4 : ModProjectile { diff --git a/Projectiles/SpatialSpear4.png b/Projectiles/Melee/SpatialSpear4.png similarity index 100% rename from Projectiles/SpatialSpear4.png rename to Projectiles/Melee/SpatialSpear4.png diff --git a/Projectiles/AstralPike.cs b/Projectiles/Melee/Spears/AstralPike.cs similarity index 95% rename from Projectiles/AstralPike.cs rename to Projectiles/Melee/Spears/AstralPike.cs index 9c3fc2a5e1..582910c3f7 100644 --- a/Projectiles/AstralPike.cs +++ b/Projectiles/Melee/Spears/AstralPike.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee.Spears { public class AstralPike : ModProjectile { diff --git a/Projectiles/AstralPike.png b/Projectiles/Melee/Spears/AstralPike.png similarity index 100% rename from Projectiles/AstralPike.png rename to Projectiles/Melee/Spears/AstralPike.png diff --git a/Projectiles/BansheeHook.cs b/Projectiles/Melee/Spears/BansheeHook.cs similarity index 93% rename from Projectiles/BansheeHook.cs rename to Projectiles/Melee/Spears/BansheeHook.cs index 163afc51f6..35fcef4e76 100644 --- a/Projectiles/BansheeHook.cs +++ b/Projectiles/Melee/Spears/BansheeHook.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee.Spears { public class BansheeHook : ModProjectile { @@ -119,7 +119,7 @@ namespace CalamityMod.Projectiles { Microsoft.Xna.Framework.Color color25 = Lighting.GetColor((int)((double)projectile.position.X + (double)projectile.width * 0.5) / 16, (int)(((double)projectile.position.Y + (double)projectile.height * 0.5) / 16.0)); Vector2 vector53 = projectile.position + new Vector2((float)projectile.width, (float)projectile.height) / 2f + Vector2.UnitY * projectile.gfxOffY - Main.screenPosition; - Texture2D texture2D31 = (projectile.spriteDirection == -1) ? mod.GetTexture("Projectiles/BansheeHookAlt") : Main.projectileTexture[projectile.type]; + Texture2D texture2D31 = (projectile.spriteDirection == -1) ? mod.GetTexture("Projectiles/Melee/Spears/BansheeHookAlt") : Main.projectileTexture[projectile.type]; Microsoft.Xna.Framework.Color alpha4 = projectile.GetAlpha(color25); Vector2 origin8 = new Vector2((float)texture2D31.Width, (float)texture2D31.Height) / 2f; origin8 = new Vector2((projectile.spriteDirection == 1) ? ((float)texture2D31.Width - -8f) : -8f, -8f); //-8 -8 @@ -146,7 +146,7 @@ namespace CalamityMod.Projectiles { if (projectile.owner == Main.myPlayer) { - Projectile.NewProjectile(target.Center.X, target.Center.Y, 0f, 0f, mod.ProjectileType("BansheeHookBoom"), damage, 10f, projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); + Projectile.NewProjectile(target.Center.X, target.Center.Y, 0f, 0f, mod.ProjectileType("BansheeHookBoom"), (int)((double)damage * 0.25), 10f, projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); } } } diff --git a/Projectiles/BansheeHook.png b/Projectiles/Melee/Spears/BansheeHook.png similarity index 100% rename from Projectiles/BansheeHook.png rename to Projectiles/Melee/Spears/BansheeHook.png diff --git a/Projectiles/BansheeHookAlt.png b/Projectiles/Melee/Spears/BansheeHookAlt.png similarity index 100% rename from Projectiles/BansheeHookAlt.png rename to Projectiles/Melee/Spears/BansheeHookAlt.png diff --git a/Projectiles/Brimlance.cs b/Projectiles/Melee/Spears/Brimlance.cs similarity index 96% rename from Projectiles/Brimlance.cs rename to Projectiles/Melee/Spears/Brimlance.cs index 5ed985349f..87f0fffc8c 100644 --- a/Projectiles/Brimlance.cs +++ b/Projectiles/Melee/Spears/Brimlance.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee.Spears { public class Brimlance : ModProjectile { diff --git a/Projectiles/Brimlance.png b/Projectiles/Melee/Spears/Brimlance.png similarity index 100% rename from Projectiles/Brimlance.png rename to Projectiles/Melee/Spears/Brimlance.png diff --git a/Projectiles/DiseasedPike.cs b/Projectiles/Melee/Spears/DiseasedPike.cs similarity index 95% rename from Projectiles/DiseasedPike.cs rename to Projectiles/Melee/Spears/DiseasedPike.cs index 8e80569c71..a54f783ee2 100644 --- a/Projectiles/DiseasedPike.cs +++ b/Projectiles/Melee/Spears/DiseasedPike.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee.Spears { public class DiseasedPike : ModProjectile { diff --git a/Projectiles/DiseasedPike.png b/Projectiles/Melee/Spears/DiseasedPike.png similarity index 100% rename from Projectiles/DiseasedPike.png rename to Projectiles/Melee/Spears/DiseasedPike.png diff --git a/Projectiles/EarthenPike.cs b/Projectiles/Melee/Spears/EarthenPike.cs similarity index 95% rename from Projectiles/EarthenPike.cs rename to Projectiles/Melee/Spears/EarthenPike.cs index 16a65fc0bc..163c2ea60f 100644 --- a/Projectiles/EarthenPike.cs +++ b/Projectiles/Melee/Spears/EarthenPike.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee.Spears { public class EarthenPike : ModProjectile { diff --git a/Projectiles/EarthenPike.png b/Projectiles/Melee/Spears/EarthenPike.png similarity index 100% rename from Projectiles/EarthenPike.png rename to Projectiles/Melee/Spears/EarthenPike.png diff --git a/Projectiles/ExsanguinationLanceProjectile.cs b/Projectiles/Melee/Spears/ExsanguinationLanceProjectile.cs similarity index 95% rename from Projectiles/ExsanguinationLanceProjectile.cs rename to Projectiles/Melee/Spears/ExsanguinationLanceProjectile.cs index c7a58021e8..f79266decc 100644 --- a/Projectiles/ExsanguinationLanceProjectile.cs +++ b/Projectiles/Melee/Spears/ExsanguinationLanceProjectile.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee.Spears { public class ExsanguinationLanceProjectile : ModProjectile { diff --git a/Projectiles/Melee/Spears/ExsanguinationLanceProjectile.png b/Projectiles/Melee/Spears/ExsanguinationLanceProjectile.png new file mode 100644 index 0000000000..4b507aa8c6 Binary files /dev/null and b/Projectiles/Melee/Spears/ExsanguinationLanceProjectile.png differ diff --git a/Projectiles/GildedProboscis.cs b/Projectiles/Melee/Spears/GildedProboscis.cs similarity index 94% rename from Projectiles/GildedProboscis.cs rename to Projectiles/Melee/Spears/GildedProboscis.cs index 27bfd408fe..e7dff2a88f 100644 --- a/Projectiles/GildedProboscis.cs +++ b/Projectiles/Melee/Spears/GildedProboscis.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee.Spears { public class GildedProboscis : ModProjectile { @@ -80,8 +80,8 @@ namespace CalamityMod.Projectiles return; } Player player = Main.player[projectile.owner]; - player.statLife += 2; - player.HealEffect(2); + player.statLife += 1; + player.HealEffect(1); } } } \ No newline at end of file diff --git a/Projectiles/GildedProboscis.png b/Projectiles/Melee/Spears/GildedProboscis.png similarity index 100% rename from Projectiles/GildedProboscis.png rename to Projectiles/Melee/Spears/GildedProboscis.png diff --git a/Projectiles/GoldplumeSpearProjectile.cs b/Projectiles/Melee/Spears/GoldplumeSpearProjectile.cs similarity index 95% rename from Projectiles/GoldplumeSpearProjectile.cs rename to Projectiles/Melee/Spears/GoldplumeSpearProjectile.cs index 6a25fae6b5..e7f61e6fcc 100644 --- a/Projectiles/GoldplumeSpearProjectile.cs +++ b/Projectiles/Melee/Spears/GoldplumeSpearProjectile.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee.Spears { public class GoldplumeSpearProjectile : ModProjectile { diff --git a/Projectiles/GoldplumeSpearProjectile.png b/Projectiles/Melee/Spears/GoldplumeSpearProjectile.png similarity index 100% rename from Projectiles/GoldplumeSpearProjectile.png rename to Projectiles/Melee/Spears/GoldplumeSpearProjectile.png diff --git a/Projectiles/HeartRapierProjectile.cs b/Projectiles/Melee/Spears/HeartRapierProjectile.cs similarity index 84% rename from Projectiles/HeartRapierProjectile.cs rename to Projectiles/Melee/Spears/HeartRapierProjectile.cs index 2aa75acfde..7373e671be 100644 --- a/Projectiles/HeartRapierProjectile.cs +++ b/Projectiles/Melee/Spears/HeartRapierProjectile.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee.Spears { public class HeartRapierProjectile : ModProjectile { @@ -42,12 +42,12 @@ namespace CalamityMod.Projectiles { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 12, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } - if(projectile.ai[0] == 0f) + if (projectile.ai[0] == 0f) { projectile.ai[0] = 3f; projectile.netUpdate = true; } - if(Main.player[projectile.owner].itemAnimation < Main.player[projectile.owner].itemAnimationMax / 3) + if (Main.player[projectile.owner].itemAnimation < Main.player[projectile.owner].itemAnimationMax / 3) { projectile.ai[0] -= 1.1f; } @@ -55,14 +55,12 @@ namespace CalamityMod.Projectiles { projectile.ai[0] += 0.95f; } - - if(Main.player[projectile.owner].itemAnimation == 0) + if (Main.player[projectile.owner].itemAnimation == 0) { projectile.Kill(); } - projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 2.355f; - if(projectile.spriteDirection == -1) + if (projectile.spriteDirection == -1) { projectile.rotation -= 1.57f; } @@ -70,7 +68,7 @@ namespace CalamityMod.Projectiles public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (target.type == NPCID.TargetDummy) + if (target.type == NPCID.TargetDummy || !target.canGhostHeal) { return; } diff --git a/Projectiles/HeartRapierProjectile.png b/Projectiles/Melee/Spears/HeartRapierProjectile.png similarity index 100% rename from Projectiles/HeartRapierProjectile.png rename to Projectiles/Melee/Spears/HeartRapierProjectile.png diff --git a/Projectiles/HellionFlowerSpearProjectile.cs b/Projectiles/Melee/Spears/HellionFlowerSpearProjectile.cs similarity index 96% rename from Projectiles/HellionFlowerSpearProjectile.cs rename to Projectiles/Melee/Spears/HellionFlowerSpearProjectile.cs index 81f6f30ba7..e71bf1e359 100644 --- a/Projectiles/HellionFlowerSpearProjectile.cs +++ b/Projectiles/Melee/Spears/HellionFlowerSpearProjectile.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee.Spears { public class HellionFlowerSpearProjectile : ModProjectile { diff --git a/Projectiles/HellionFlowerSpearProjectile.png b/Projectiles/Melee/Spears/HellionFlowerSpearProjectile.png similarity index 100% rename from Projectiles/HellionFlowerSpearProjectile.png rename to Projectiles/Melee/Spears/HellionFlowerSpearProjectile.png diff --git a/Projectiles/MarniteSpearProjectile.cs b/Projectiles/Melee/Spears/MarniteSpearProjectile.cs similarity index 95% rename from Projectiles/MarniteSpearProjectile.cs rename to Projectiles/Melee/Spears/MarniteSpearProjectile.cs index 71a97b0ea3..c629fa05ca 100644 --- a/Projectiles/MarniteSpearProjectile.cs +++ b/Projectiles/Melee/Spears/MarniteSpearProjectile.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee.Spears { public class MarniteSpearProjectile : ModProjectile { diff --git a/Projectiles/MarniteSpearProjectile.png b/Projectiles/Melee/Spears/MarniteSpearProjectile.png similarity index 100% rename from Projectiles/MarniteSpearProjectile.png rename to Projectiles/Melee/Spears/MarniteSpearProjectile.png diff --git a/Projectiles/SausageMaker.cs b/Projectiles/Melee/Spears/SausageMaker.cs similarity index 95% rename from Projectiles/SausageMaker.cs rename to Projectiles/Melee/Spears/SausageMaker.cs index 7c8cf91e29..4ee298fce7 100644 --- a/Projectiles/SausageMaker.cs +++ b/Projectiles/Melee/Spears/SausageMaker.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee.Spears { public class SausageMaker : ModProjectile { diff --git a/Projectiles/SausageMaker.png b/Projectiles/Melee/Spears/SausageMaker.png similarity index 100% rename from Projectiles/SausageMaker.png rename to Projectiles/Melee/Spears/SausageMaker.png diff --git a/Projectiles/SpatialLanceProjectile.cs b/Projectiles/Melee/Spears/SpatialLanceProjectile.cs similarity index 96% rename from Projectiles/SpatialLanceProjectile.cs rename to Projectiles/Melee/Spears/SpatialLanceProjectile.cs index e66b96e4c3..9b3281b78f 100644 --- a/Projectiles/SpatialLanceProjectile.cs +++ b/Projectiles/Melee/Spears/SpatialLanceProjectile.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee.Spears { public class SpatialLanceProjectile : ModProjectile { diff --git a/Projectiles/SpatialLanceProjectile.png b/Projectiles/Melee/Spears/SpatialLanceProjectile.png similarity index 100% rename from Projectiles/SpatialLanceProjectile.png rename to Projectiles/Melee/Spears/SpatialLanceProjectile.png diff --git a/Projectiles/StarnightLanceProjectile.cs b/Projectiles/Melee/Spears/StarnightLanceProjectile.cs similarity index 96% rename from Projectiles/StarnightLanceProjectile.cs rename to Projectiles/Melee/Spears/StarnightLanceProjectile.cs index e7ad4f37f7..5a3d5d4a55 100644 --- a/Projectiles/StarnightLanceProjectile.cs +++ b/Projectiles/Melee/Spears/StarnightLanceProjectile.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee.Spears { public class StarnightLanceProjectile : ModProjectile { diff --git a/Projectiles/StarnightLanceProjectile.png b/Projectiles/Melee/Spears/StarnightLanceProjectile.png similarity index 100% rename from Projectiles/StarnightLanceProjectile.png rename to Projectiles/Melee/Spears/StarnightLanceProjectile.png diff --git a/Projectiles/StreamGouge.cs b/Projectiles/Melee/Spears/StreamGouge.cs similarity index 96% rename from Projectiles/StreamGouge.cs rename to Projectiles/Melee/Spears/StreamGouge.cs index 5e6ec10e89..2e16bb2fb6 100644 --- a/Projectiles/StreamGouge.cs +++ b/Projectiles/Melee/Spears/StreamGouge.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee.Spears { public class StreamGouge : ModProjectile { diff --git a/Projectiles/StreamGouge.png b/Projectiles/Melee/Spears/StreamGouge.png similarity index 100% rename from Projectiles/StreamGouge.png rename to Projectiles/Melee/Spears/StreamGouge.png diff --git a/Projectiles/TerraLanceProjectile.cs b/Projectiles/Melee/Spears/TerraLanceProjectile.cs similarity index 96% rename from Projectiles/TerraLanceProjectile.cs rename to Projectiles/Melee/Spears/TerraLanceProjectile.cs index a578549b88..c81913d44e 100644 --- a/Projectiles/TerraLanceProjectile.cs +++ b/Projectiles/Melee/Spears/TerraLanceProjectile.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee.Spears { public class TerraLanceProjectile : ModProjectile { diff --git a/Projectiles/TerraLanceProjectile.png b/Projectiles/Melee/Spears/TerraLanceProjectile.png similarity index 100% rename from Projectiles/TerraLanceProjectile.png rename to Projectiles/Melee/Spears/TerraLanceProjectile.png diff --git a/Projectiles/UrchinSpearProjectile.cs b/Projectiles/Melee/Spears/UrchinSpearProjectile.cs similarity index 95% rename from Projectiles/UrchinSpearProjectile.cs rename to Projectiles/Melee/Spears/UrchinSpearProjectile.cs index fa1c6084ca..87103c58b6 100644 --- a/Projectiles/UrchinSpearProjectile.cs +++ b/Projectiles/Melee/Spears/UrchinSpearProjectile.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee.Spears { public class UrchinSpearProjectile : ModProjectile { diff --git a/Projectiles/UrchinSpearProjectile.png b/Projectiles/Melee/Spears/UrchinSpearProjectile.png similarity index 100% rename from Projectiles/UrchinSpearProjectile.png rename to Projectiles/Melee/Spears/UrchinSpearProjectile.png diff --git a/Projectiles/StarCrystal.cs b/Projectiles/Melee/StarCrystal.cs similarity index 94% rename from Projectiles/StarCrystal.cs rename to Projectiles/Melee/StarCrystal.cs index 7c2a0e32bb..03315208c7 100644 --- a/Projectiles/StarCrystal.cs +++ b/Projectiles/Melee/StarCrystal.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class StarCrystal : ModProjectile { diff --git a/Projectiles/StarCrystal.png b/Projectiles/Melee/StarCrystal.png similarity index 100% rename from Projectiles/StarCrystal.png rename to Projectiles/Melee/StarCrystal.png diff --git a/Projectiles/StarnightBeam.cs b/Projectiles/Melee/StarnightBeam.cs similarity index 95% rename from Projectiles/StarnightBeam.cs rename to Projectiles/Melee/StarnightBeam.cs index 3935e1df93..49b1bbd3a6 100644 --- a/Projectiles/StarnightBeam.cs +++ b/Projectiles/Melee/StarnightBeam.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class StarnightBeam : ModProjectile { diff --git a/Projectiles/StarnightBeam.png b/Projectiles/Melee/StarnightBeam.png similarity index 100% rename from Projectiles/StarnightBeam.png rename to Projectiles/Melee/StarnightBeam.png diff --git a/Projectiles/StormBeam.cs b/Projectiles/Melee/StormBeam.cs similarity index 95% rename from Projectiles/StormBeam.cs rename to Projectiles/Melee/StormBeam.cs index a90b7ff53a..8c9f23834c 100644 --- a/Projectiles/StormBeam.cs +++ b/Projectiles/Melee/StormBeam.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class StormBeam : ModProjectile { diff --git a/Projectiles/StormBeam.png b/Projectiles/Melee/StormBeam.png similarity index 100% rename from Projectiles/StormBeam.png rename to Projectiles/Melee/StormBeam.png diff --git a/Projectiles/StormMark.cs b/Projectiles/Melee/StormMark.cs similarity index 96% rename from Projectiles/StormMark.cs rename to Projectiles/Melee/StormMark.cs index 3dc921c4cf..80ee3a4523 100644 --- a/Projectiles/StormMark.cs +++ b/Projectiles/Melee/StormMark.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class StormMark : ModProjectile { diff --git a/Projectiles/StormMark.png b/Projectiles/Melee/StormMark.png similarity index 100% rename from Projectiles/StormMark.png rename to Projectiles/Melee/StormMark.png diff --git a/Projectiles/StormRuler.cs b/Projectiles/Melee/StormRuler.cs similarity index 94% rename from Projectiles/StormRuler.cs rename to Projectiles/Melee/StormRuler.cs index aa19761659..6ce2c192b9 100644 --- a/Projectiles/StormRuler.cs +++ b/Projectiles/Melee/StormRuler.cs @@ -4,7 +4,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class StormRuler : ModProjectile { diff --git a/Projectiles/StormRuler.png b/Projectiles/Melee/StormRuler.png similarity index 100% rename from Projectiles/StormRuler.png rename to Projectiles/Melee/StormRuler.png diff --git a/Projectiles/SunlightBlade.cs b/Projectiles/Melee/SunlightBlade.cs similarity index 94% rename from Projectiles/SunlightBlade.cs rename to Projectiles/Melee/SunlightBlade.cs index 51046494b9..89a1ee7ee9 100644 --- a/Projectiles/SunlightBlade.cs +++ b/Projectiles/Melee/SunlightBlade.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class SunlightBlade : ModProjectile { diff --git a/Projectiles/SunlightBlade.png b/Projectiles/Melee/SunlightBlade.png similarity index 100% rename from Projectiles/SunlightBlade.png rename to Projectiles/Melee/SunlightBlade.png diff --git a/Projectiles/TemporalFloeSwordProjectile.cs b/Projectiles/Melee/TemporalFloeSwordProjectile.cs similarity index 96% rename from Projectiles/TemporalFloeSwordProjectile.cs rename to Projectiles/Melee/TemporalFloeSwordProjectile.cs index 076ef88422..b688a495dd 100644 --- a/Projectiles/TemporalFloeSwordProjectile.cs +++ b/Projectiles/Melee/TemporalFloeSwordProjectile.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class TemporalFloeSwordProjectile : ModProjectile { diff --git a/Projectiles/TemporalFloeSwordProjectile.png b/Projectiles/Melee/TemporalFloeSwordProjectile.png similarity index 100% rename from Projectiles/TemporalFloeSwordProjectile.png rename to Projectiles/Melee/TemporalFloeSwordProjectile.png diff --git a/Projectiles/TerraBall.cs b/Projectiles/Melee/TerraBall.cs similarity index 95% rename from Projectiles/TerraBall.cs rename to Projectiles/Melee/TerraBall.cs index 707e1638ae..611994b6ee 100644 --- a/Projectiles/TerraBall.cs +++ b/Projectiles/Melee/TerraBall.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class TerraBall : ModProjectile { diff --git a/Projectiles/TerraBall.png b/Projectiles/Melee/TerraBall.png similarity index 100% rename from Projectiles/TerraBall.png rename to Projectiles/Melee/TerraBall.png diff --git a/Projectiles/TerraEdgeBeam.cs b/Projectiles/Melee/TerraEdgeBeam.cs similarity index 86% rename from Projectiles/TerraEdgeBeam.cs rename to Projectiles/Melee/TerraEdgeBeam.cs index ec42e50dde..caed24d1a7 100644 --- a/Projectiles/TerraEdgeBeam.cs +++ b/Projectiles/Melee/TerraEdgeBeam.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class TerraEdgeBeam : ModProjectile { @@ -38,15 +38,7 @@ namespace CalamityMod.Projectiles public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (target.type == NPCID.TargetDummy) - { - return; - } - int healAmount = (Main.rand.Next(2) + 1); target.AddBuff(BuffID.Ichor, 60); - Player player = Main.player[projectile.owner]; - player.statLife += healAmount; - player.HealEffect(healAmount); } public override void Kill(int timeLeft) diff --git a/Projectiles/TerraEdgeBeam.png b/Projectiles/Melee/TerraEdgeBeam.png similarity index 100% rename from Projectiles/TerraEdgeBeam.png rename to Projectiles/Melee/TerraEdgeBeam.png diff --git a/Projectiles/TerraSpear.cs b/Projectiles/Melee/TerraSpear.cs similarity index 94% rename from Projectiles/TerraSpear.cs rename to Projectiles/Melee/TerraSpear.cs index 7cc0a2b7be..36ff8ba4a5 100644 --- a/Projectiles/TerraSpear.cs +++ b/Projectiles/Melee/TerraSpear.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class TerraSpear : ModProjectile { diff --git a/Projectiles/TerraSpear.png b/Projectiles/Melee/TerraSpear.png similarity index 100% rename from Projectiles/TerraSpear.png rename to Projectiles/Melee/TerraSpear.png diff --git a/Projectiles/TerracottaExplosion.cs b/Projectiles/Melee/TerracottaExplosion.cs similarity index 95% rename from Projectiles/TerracottaExplosion.cs rename to Projectiles/Melee/TerracottaExplosion.cs index 84b3a58c44..1cb40f95a9 100644 --- a/Projectiles/TerracottaExplosion.cs +++ b/Projectiles/Melee/TerracottaExplosion.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class TerracottaExplosion : ModProjectile { diff --git a/Projectiles/TerracottaExplosion.png b/Projectiles/Melee/TerracottaExplosion.png similarity index 100% rename from Projectiles/TerracottaExplosion.png rename to Projectiles/Melee/TerracottaExplosion.png diff --git a/Projectiles/TerratomereProjectile.cs b/Projectiles/Melee/TerratomereProjectile.cs similarity index 91% rename from Projectiles/TerratomereProjectile.cs rename to Projectiles/Melee/TerratomereProjectile.cs index 730f03ad52..cd5943a7d3 100644 --- a/Projectiles/TerratomereProjectile.cs +++ b/Projectiles/Melee/TerratomereProjectile.cs @@ -8,7 +8,7 @@ using Terraria.ID; using Terraria.Graphics.Shaders; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class TerratomereProjectile : ModProjectile { @@ -84,14 +84,6 @@ namespace CalamityMod.Projectiles target.AddBuff(BuffID.Frostburn, 660); target.AddBuff(BuffID.OnFire, 800); target.AddBuff(BuffID.Ichor, 300); - if (target.type == NPCID.TargetDummy) - { - return; - } - int healAmount = Main.rand.Next(2); - Player player = Main.player[projectile.owner]; - player.statLife += healAmount; - player.HealEffect(healAmount); } public override void Kill(int timeLeft) diff --git a/Projectiles/TerratomereProjectile.png b/Projectiles/Melee/TerratomereProjectile.png similarity index 100% rename from Projectiles/TerratomereProjectile.png rename to Projectiles/Melee/TerratomereProjectile.png diff --git a/Projectiles/TerrorBeam.cs b/Projectiles/Melee/TerrorBeam.cs similarity index 96% rename from Projectiles/TerrorBeam.cs rename to Projectiles/Melee/TerrorBeam.cs index b6fd29b7ce..6b2329ec90 100644 --- a/Projectiles/TerrorBeam.cs +++ b/Projectiles/Melee/TerrorBeam.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class TerrorBeam : ModProjectile { diff --git a/Projectiles/TerrorBeam.png b/Projectiles/Melee/TerrorBeam.png similarity index 100% rename from Projectiles/TerrorBeam.png rename to Projectiles/Melee/TerrorBeam.png diff --git a/Projectiles/TerrorBoom.cs b/Projectiles/Melee/TerrorBoom.cs similarity index 94% rename from Projectiles/TerrorBoom.cs rename to Projectiles/Melee/TerrorBoom.cs index 0c98c9eb54..ac5506dbf5 100644 --- a/Projectiles/TerrorBoom.cs +++ b/Projectiles/Melee/TerrorBoom.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class TerrorBoom : ModProjectile { @@ -25,6 +25,7 @@ namespace CalamityMod.Projectiles projectile.timeLeft = 60; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 3; + projectile.melee = true; } public override void Kill(int timeLeft) diff --git a/Projectiles/TerrorBoom.png b/Projectiles/Melee/TerrorBoom.png similarity index 100% rename from Projectiles/TerrorBoom.png rename to Projectiles/Melee/TerrorBoom.png diff --git a/Projectiles/TinyCrystal.cs b/Projectiles/Melee/TinyCrystal.cs similarity index 93% rename from Projectiles/TinyCrystal.cs rename to Projectiles/Melee/TinyCrystal.cs index 221c8bccbc..3499630a18 100644 --- a/Projectiles/TinyCrystal.cs +++ b/Projectiles/Melee/TinyCrystal.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class TinyCrystal : ModProjectile { diff --git a/Projectiles/TinyCrystal.png b/Projectiles/Melee/TinyCrystal.png similarity index 100% rename from Projectiles/TinyCrystal.png rename to Projectiles/Melee/TinyCrystal.png diff --git a/Projectiles/TinyFlare.cs b/Projectiles/Melee/TinyFlare.cs similarity index 95% rename from Projectiles/TinyFlare.cs rename to Projectiles/Melee/TinyFlare.cs index 4d96e43d4c..e6b9198a15 100644 --- a/Projectiles/TinyFlare.cs +++ b/Projectiles/Melee/TinyFlare.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class TinyFlare : ModProjectile { diff --git a/Projectiles/TinyFlare.png b/Projectiles/Melee/TinyFlare.png similarity index 100% rename from Projectiles/TinyFlare.png rename to Projectiles/Melee/TinyFlare.png diff --git a/Projectiles/Tornado.cs b/Projectiles/Melee/Tornado.cs similarity index 96% rename from Projectiles/Tornado.cs rename to Projectiles/Melee/Tornado.cs index b60660b067..87f913cfd9 100644 --- a/Projectiles/Tornado.cs +++ b/Projectiles/Melee/Tornado.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class Tornado : ModProjectile { diff --git a/Projectiles/Tornado.png b/Projectiles/Melee/Tornado.png similarity index 100% rename from Projectiles/Tornado.png rename to Projectiles/Melee/Tornado.png diff --git a/Projectiles/TriactisOPHammerMelee.cs b/Projectiles/Melee/TriactisOPHammerMelee.cs similarity index 96% rename from Projectiles/TriactisOPHammerMelee.cs rename to Projectiles/Melee/TriactisOPHammerMelee.cs index 94eabccc12..3b47cc2271 100644 --- a/Projectiles/TriactisOPHammerMelee.cs +++ b/Projectiles/Melee/TriactisOPHammerMelee.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class TriactisOPHammerMelee : ModProjectile { diff --git a/Projectiles/TriactisOPHammerMelee.png b/Projectiles/Melee/TriactisOPHammerMelee.png similarity index 100% rename from Projectiles/TriactisOPHammerMelee.png rename to Projectiles/Melee/TriactisOPHammerMelee.png diff --git a/Projectiles/TrueBiomeOrb.cs b/Projectiles/Melee/TrueBiomeOrb.cs similarity index 95% rename from Projectiles/TrueBiomeOrb.cs rename to Projectiles/Melee/TrueBiomeOrb.cs index 432518bcc2..c08e7017ed 100644 --- a/Projectiles/TrueBiomeOrb.cs +++ b/Projectiles/Melee/TrueBiomeOrb.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class TrueBiomeOrb : ModProjectile { diff --git a/Projectiles/TrueBiomeOrb.png b/Projectiles/Melee/TrueBiomeOrb.png similarity index 100% rename from Projectiles/TrueBiomeOrb.png rename to Projectiles/Melee/TrueBiomeOrb.png diff --git a/Projectiles/TrueCausticEdgeProjectile.cs b/Projectiles/Melee/TrueCausticEdgeProjectile.cs similarity index 96% rename from Projectiles/TrueCausticEdgeProjectile.cs rename to Projectiles/Melee/TrueCausticEdgeProjectile.cs index 8705f595d3..086d13ea9b 100644 --- a/Projectiles/TrueCausticEdgeProjectile.cs +++ b/Projectiles/Melee/TrueCausticEdgeProjectile.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class TrueCausticEdgeProjectile : ModProjectile { diff --git a/Projectiles/TrueCausticEdgeProjectile.png b/Projectiles/Melee/TrueCausticEdgeProjectile.png similarity index 100% rename from Projectiles/TrueCausticEdgeProjectile.png rename to Projectiles/Melee/TrueCausticEdgeProjectile.png diff --git a/Projectiles/Tumbleweed.cs b/Projectiles/Melee/Tumbleweed.cs similarity index 97% rename from Projectiles/Tumbleweed.cs rename to Projectiles/Melee/Tumbleweed.cs index 57e19d2a07..e45b73c54b 100644 --- a/Projectiles/Tumbleweed.cs +++ b/Projectiles/Melee/Tumbleweed.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class Tumbleweed : ModProjectile { diff --git a/Projectiles/Tumbleweed.png b/Projectiles/Melee/Tumbleweed.png similarity index 100% rename from Projectiles/Tumbleweed.png rename to Projectiles/Melee/Tumbleweed.png diff --git a/Projectiles/TumbleweedRolling.cs b/Projectiles/Melee/TumbleweedRolling.cs similarity index 96% rename from Projectiles/TumbleweedRolling.cs rename to Projectiles/Melee/TumbleweedRolling.cs index c5b60d5939..7eb094cc05 100644 --- a/Projectiles/TumbleweedRolling.cs +++ b/Projectiles/Melee/TumbleweedRolling.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class TumbleweedRolling : ModProjectile { diff --git a/Projectiles/TumbleweedRolling.png b/Projectiles/Melee/TumbleweedRolling.png similarity index 100% rename from Projectiles/TumbleweedRolling.png rename to Projectiles/Melee/TumbleweedRolling.png diff --git a/Projectiles/TyphonsGreed.cs b/Projectiles/Melee/TyphonsGreed.cs similarity index 87% rename from Projectiles/TyphonsGreed.cs rename to Projectiles/Melee/TyphonsGreed.cs index 91a0fbfe21..d4c4443365 100644 --- a/Projectiles/TyphonsGreed.cs +++ b/Projectiles/Melee/TyphonsGreed.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class TyphonsGreed : ModProjectile { @@ -80,7 +80,6 @@ namespace CalamityMod.Projectiles { projectile.ai[0] = -1f; projectile.netUpdate = true; - return; } } } @@ -90,7 +89,10 @@ namespace CalamityMod.Projectiles Texture2D texture2D13 = Main.projectileTexture[projectile.type]; int num214 = Main.projectileTexture[projectile.type].Height / Main.projFrames[projectile.type]; int y6 = num214 * projectile.frame; - Main.spriteBatch.Draw(texture2D13, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y6, texture2D13.Width, num214)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)num214 / 2f), projectile.scale, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(texture2D13, + projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), + new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y6, texture2D13.Width, num214)), + projectile.GetAlpha(lightColor), projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)num214 / 2f), projectile.scale, SpriteEffects.None, 0f); return false; } diff --git a/Projectiles/TyphonsGreed.png b/Projectiles/Melee/TyphonsGreed.png similarity index 100% rename from Projectiles/TyphonsGreed.png rename to Projectiles/Melee/TyphonsGreed.png diff --git a/Projectiles/TyphonsGreedStaff.cs b/Projectiles/Melee/TyphonsGreedStaff.cs similarity index 97% rename from Projectiles/TyphonsGreedStaff.cs rename to Projectiles/Melee/TyphonsGreedStaff.cs index 480e122175..1421d8a86c 100644 --- a/Projectiles/TyphonsGreedStaff.cs +++ b/Projectiles/Melee/TyphonsGreedStaff.cs @@ -6,7 +6,7 @@ using Terraria.Enums; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class TyphonsGreedStaff : ModProjectile { diff --git a/Projectiles/TyphonsGreedStaff.png b/Projectiles/Melee/TyphonsGreedStaff.png similarity index 100% rename from Projectiles/TyphonsGreedStaff.png rename to Projectiles/Melee/TyphonsGreedStaff.png diff --git a/Projectiles/UHFMurasama.png b/Projectiles/Melee/UHFMurasama.png similarity index 100% rename from Projectiles/UHFMurasama.png rename to Projectiles/Melee/UHFMurasama.png diff --git a/Projectiles/UrchinSpikeFugu.cs b/Projectiles/Melee/UrchinSpikeFugu.cs similarity index 96% rename from Projectiles/UrchinSpikeFugu.cs rename to Projectiles/Melee/UrchinSpikeFugu.cs index f0fdf5efa8..b521767141 100644 --- a/Projectiles/UrchinSpikeFugu.cs +++ b/Projectiles/Melee/UrchinSpikeFugu.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class UrchinSpikeFugu : ModProjectile { diff --git a/Projectiles/UrchinSpikeFugu.png b/Projectiles/Melee/UrchinSpikeFugu.png similarity index 100% rename from Projectiles/UrchinSpikeFugu.png rename to Projectiles/Melee/UrchinSpikeFugu.png diff --git a/Projectiles/WhiteBoltAura.cs b/Projectiles/Melee/WhiteBoltAura.cs similarity index 94% rename from Projectiles/WhiteBoltAura.cs rename to Projectiles/Melee/WhiteBoltAura.cs index ffb05e7007..d186285e95 100644 --- a/Projectiles/WhiteBoltAura.cs +++ b/Projectiles/Melee/WhiteBoltAura.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class WhiteBoltAura : ModProjectile { diff --git a/Projectiles/WhiteBoltAura.png b/Projectiles/Melee/WhiteBoltAura.png similarity index 100% rename from Projectiles/WhiteBoltAura.png rename to Projectiles/Melee/WhiteBoltAura.png diff --git a/Projectiles/WhiteBoltAuraBlah.cs b/Projectiles/Melee/WhiteBoltAuraBlah.cs similarity index 94% rename from Projectiles/WhiteBoltAuraBlah.cs rename to Projectiles/Melee/WhiteBoltAuraBlah.cs index 737ea35c90..8a2af05040 100644 --- a/Projectiles/WhiteBoltAuraBlah.cs +++ b/Projectiles/Melee/WhiteBoltAuraBlah.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class WhiteBoltAuraBlah : ModProjectile { diff --git a/Projectiles/WhiteBoltAuraBlah.png b/Projectiles/Melee/WhiteBoltAuraBlah.png similarity index 100% rename from Projectiles/WhiteBoltAuraBlah.png rename to Projectiles/Melee/WhiteBoltAuraBlah.png diff --git a/Projectiles/WhiteOrb.cs b/Projectiles/Melee/WhiteOrb.cs similarity index 94% rename from Projectiles/WhiteOrb.cs rename to Projectiles/Melee/WhiteOrb.cs index 9ed123a44f..2330c285f7 100644 --- a/Projectiles/WhiteOrb.cs +++ b/Projectiles/Melee/WhiteOrb.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class WhiteOrb : ModProjectile { diff --git a/Projectiles/WhiteOrb.png b/Projectiles/Melee/WhiteOrb.png similarity index 100% rename from Projectiles/WhiteOrb.png rename to Projectiles/Melee/WhiteOrb.png diff --git a/Projectiles/WhiteOrbBlah.cs b/Projectiles/Melee/WhiteOrbBlah.cs similarity index 94% rename from Projectiles/WhiteOrbBlah.cs rename to Projectiles/Melee/WhiteOrbBlah.cs index 1be8575c54..0d1eed4ec3 100644 --- a/Projectiles/WhiteOrbBlah.cs +++ b/Projectiles/Melee/WhiteOrbBlah.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class WhiteOrbBlah : ModProjectile { diff --git a/Projectiles/WhiteOrbBlah.png b/Projectiles/Melee/WhiteOrbBlah.png similarity index 100% rename from Projectiles/WhiteOrbBlah.png rename to Projectiles/Melee/WhiteOrbBlah.png diff --git a/Projectiles/Whiterain.cs b/Projectiles/Melee/Whiterain.cs similarity index 96% rename from Projectiles/Whiterain.cs rename to Projectiles/Melee/Whiterain.cs index 42396c5705..deee85e6a3 100644 --- a/Projectiles/Whiterain.cs +++ b/Projectiles/Melee/Whiterain.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class Whiterain : ModProjectile { diff --git a/Projectiles/Whiterain.png b/Projectiles/Melee/Whiterain.png similarity index 100% rename from Projectiles/Whiterain.png rename to Projectiles/Melee/Whiterain.png diff --git a/Projectiles/WhiterainBlah.cs b/Projectiles/Melee/WhiterainBlah.cs similarity index 96% rename from Projectiles/WhiterainBlah.cs rename to Projectiles/Melee/WhiterainBlah.cs index 6343ce12e4..20cee03b96 100644 --- a/Projectiles/WhiterainBlah.cs +++ b/Projectiles/Melee/WhiterainBlah.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee { public class WhiterainBlah : ModProjectile { diff --git a/Projectiles/WhiterainBlah.png b/Projectiles/Melee/WhiterainBlah.png similarity index 100% rename from Projectiles/WhiterainBlah.png rename to Projectiles/Melee/WhiterainBlah.png diff --git a/Projectiles/AirSpinnerProjectile.cs b/Projectiles/Melee/Yoyos/AirSpinnerProjectile.cs similarity index 91% rename from Projectiles/AirSpinnerProjectile.cs rename to Projectiles/Melee/Yoyos/AirSpinnerProjectile.cs index 6643c824c0..fb2dcb3a54 100644 --- a/Projectiles/AirSpinnerProjectile.cs +++ b/Projectiles/Melee/Yoyos/AirSpinnerProjectile.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee.Yoyos { public class AirSpinnerProjectile : ModProjectile { diff --git a/Projectiles/AirSpinnerProjectile.png b/Projectiles/Melee/Yoyos/AirSpinnerProjectile.png similarity index 100% rename from Projectiles/AirSpinnerProjectile.png rename to Projectiles/Melee/Yoyos/AirSpinnerProjectile.png diff --git a/Projectiles/AortaProjectile.cs b/Projectiles/Melee/Yoyos/AortaProjectile.cs similarity index 91% rename from Projectiles/AortaProjectile.cs rename to Projectiles/Melee/Yoyos/AortaProjectile.cs index ff7d3f7924..82e190e071 100644 --- a/Projectiles/AortaProjectile.cs +++ b/Projectiles/Melee/Yoyos/AortaProjectile.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee.Yoyos { public class AortaProjectile : ModProjectile { diff --git a/Projectiles/AortaProjectile.png b/Projectiles/Melee/Yoyos/AortaProjectile.png similarity index 100% rename from Projectiles/AortaProjectile.png rename to Projectiles/Melee/Yoyos/AortaProjectile.png diff --git a/Projectiles/AzathothProjectile.cs b/Projectiles/Melee/Yoyos/AzathothProjectile.cs similarity index 93% rename from Projectiles/AzathothProjectile.cs rename to Projectiles/Melee/Yoyos/AzathothProjectile.cs index 2a6ec21bd9..595a8c659c 100644 --- a/Projectiles/AzathothProjectile.cs +++ b/Projectiles/Melee/Yoyos/AzathothProjectile.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee.Yoyos { public class AzathothProjectile : ModProjectile { diff --git a/Projectiles/AzathothProjectile.png b/Projectiles/Melee/Yoyos/AzathothProjectile.png similarity index 100% rename from Projectiles/AzathothProjectile.png rename to Projectiles/Melee/Yoyos/AzathothProjectile.png diff --git a/Projectiles/ChaotrixProjectile.cs b/Projectiles/Melee/Yoyos/ChaotrixProjectile.cs similarity index 93% rename from Projectiles/ChaotrixProjectile.cs rename to Projectiles/Melee/Yoyos/ChaotrixProjectile.cs index 1ef335c06f..233adbeffb 100644 --- a/Projectiles/ChaotrixProjectile.cs +++ b/Projectiles/Melee/Yoyos/ChaotrixProjectile.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee.Yoyos { public class ChaotrixProjectile : ModProjectile { diff --git a/Projectiles/Melee/Yoyos/ChaotrixProjectile.png b/Projectiles/Melee/Yoyos/ChaotrixProjectile.png new file mode 100644 index 0000000000..d84bc782e5 Binary files /dev/null and b/Projectiles/Melee/Yoyos/ChaotrixProjectile.png differ diff --git a/Projectiles/CnidarianProjectile.cs b/Projectiles/Melee/Yoyos/CnidarianProjectile.cs similarity index 89% rename from Projectiles/CnidarianProjectile.cs rename to Projectiles/Melee/Yoyos/CnidarianProjectile.cs index c90a52ea65..7c2f3bd21f 100644 --- a/Projectiles/CnidarianProjectile.cs +++ b/Projectiles/Melee/Yoyos/CnidarianProjectile.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee.Yoyos { public class CnidarianProjectile : ModProjectile { diff --git a/Projectiles/CnidarianProjectile.png b/Projectiles/Melee/Yoyos/CnidarianProjectile.png similarity index 100% rename from Projectiles/CnidarianProjectile.png rename to Projectiles/Melee/Yoyos/CnidarianProjectile.png diff --git a/Projectiles/LaceratorProjectile.cs b/Projectiles/Melee/Yoyos/LaceratorProjectile.cs similarity index 65% rename from Projectiles/LaceratorProjectile.cs rename to Projectiles/Melee/Yoyos/LaceratorProjectile.cs index 68fc3c39e0..63fbb6fa24 100644 --- a/Projectiles/LaceratorProjectile.cs +++ b/Projectiles/Melee/Yoyos/LaceratorProjectile.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee.Yoyos { public class LaceratorProjectile : ModProjectile { @@ -27,13 +27,19 @@ namespace CalamityMod.Projectiles projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 5; } - - public override void AI() - { - if (projectile.owner == Main.myPlayer) - { - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, 476, (int)((double)projectile.damage * 0.66f), projectile.knockBack, projectile.owner, 0f, 0f); - } - } - } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + if (target.type == NPCID.TargetDummy || !target.canGhostHeal) + { + return; + } + Player player = Main.player[projectile.owner]; + if (Main.rand.Next(5) == 0) + { + player.statLife += 1; + player.HealEffect(1); + } + } + } } \ No newline at end of file diff --git a/Projectiles/Melee/Yoyos/LaceratorProjectile.png b/Projectiles/Melee/Yoyos/LaceratorProjectile.png new file mode 100644 index 0000000000..723b5cd9c1 Binary files /dev/null and b/Projectiles/Melee/Yoyos/LaceratorProjectile.png differ diff --git a/Projectiles/QuagmireProjectile.cs b/Projectiles/Melee/Yoyos/QuagmireProjectile.cs similarity index 95% rename from Projectiles/QuagmireProjectile.cs rename to Projectiles/Melee/Yoyos/QuagmireProjectile.cs index 48554416d1..db1e980e67 100644 --- a/Projectiles/QuagmireProjectile.cs +++ b/Projectiles/Melee/Yoyos/QuagmireProjectile.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee.Yoyos { public class QuagmireProjectile : ModProjectile { diff --git a/Projectiles/QuagmireProjectile.png b/Projectiles/Melee/Yoyos/QuagmireProjectile.png similarity index 100% rename from Projectiles/QuagmireProjectile.png rename to Projectiles/Melee/Yoyos/QuagmireProjectile.png diff --git a/Projectiles/ShimmersparkProjectile.cs b/Projectiles/Melee/Yoyos/ShimmersparkProjectile.cs similarity index 95% rename from Projectiles/ShimmersparkProjectile.cs rename to Projectiles/Melee/Yoyos/ShimmersparkProjectile.cs index 9fadead5ff..49d7f61e66 100644 --- a/Projectiles/ShimmersparkProjectile.cs +++ b/Projectiles/Melee/Yoyos/ShimmersparkProjectile.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee.Yoyos { public class ShimmersparkProjectile : ModProjectile { diff --git a/Projectiles/ShimmersparkProjectile.png b/Projectiles/Melee/Yoyos/ShimmersparkProjectile.png similarity index 100% rename from Projectiles/ShimmersparkProjectile.png rename to Projectiles/Melee/Yoyos/ShimmersparkProjectile.png diff --git a/Projectiles/SolarFlareYoyo.cs b/Projectiles/Melee/Yoyos/SolarFlareYoyo.cs similarity index 94% rename from Projectiles/SolarFlareYoyo.cs rename to Projectiles/Melee/Yoyos/SolarFlareYoyo.cs index f6f761de65..784cc3cb5e 100644 --- a/Projectiles/SolarFlareYoyo.cs +++ b/Projectiles/Melee/Yoyos/SolarFlareYoyo.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee.Yoyos { public class SolarFlareYoyo : ModProjectile { diff --git a/Projectiles/SolarFlareYoyo.png b/Projectiles/Melee/Yoyos/SolarFlareYoyo.png similarity index 100% rename from Projectiles/SolarFlareYoyo.png rename to Projectiles/Melee/Yoyos/SolarFlareYoyo.png diff --git a/Projectiles/TheEyeofCalamitasProjectile.cs b/Projectiles/Melee/Yoyos/TheEyeofCalamitasProjectile.cs similarity index 95% rename from Projectiles/TheEyeofCalamitasProjectile.cs rename to Projectiles/Melee/Yoyos/TheEyeofCalamitasProjectile.cs index 5c38cee05b..880c6ac327 100644 --- a/Projectiles/TheEyeofCalamitasProjectile.cs +++ b/Projectiles/Melee/Yoyos/TheEyeofCalamitasProjectile.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee.Yoyos { public class TheEyeofCalamitasProjectile : ModProjectile { diff --git a/Projectiles/TheEyeofCalamitasProjectile.png b/Projectiles/Melee/Yoyos/TheEyeofCalamitasProjectile.png similarity index 100% rename from Projectiles/TheEyeofCalamitasProjectile.png rename to Projectiles/Melee/Yoyos/TheEyeofCalamitasProjectile.png diff --git a/Projectiles/TheGodsGambitProjectile.cs b/Projectiles/Melee/Yoyos/TheGodsGambitProjectile.cs similarity index 92% rename from Projectiles/TheGodsGambitProjectile.cs rename to Projectiles/Melee/Yoyos/TheGodsGambitProjectile.cs index 2cc3631c3a..b6dd692e4c 100644 --- a/Projectiles/TheGodsGambitProjectile.cs +++ b/Projectiles/Melee/Yoyos/TheGodsGambitProjectile.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee.Yoyos { public class TheGodsGambitProjectile : ModProjectile { diff --git a/Projectiles/Melee/Yoyos/TheGodsGambitProjectile.png b/Projectiles/Melee/Yoyos/TheGodsGambitProjectile.png new file mode 100644 index 0000000000..a9645fc47f Binary files /dev/null and b/Projectiles/Melee/Yoyos/TheGodsGambitProjectile.png differ diff --git a/Projectiles/TheObliterator.cs b/Projectiles/Melee/Yoyos/TheObliterator.cs similarity index 78% rename from Projectiles/TheObliterator.cs rename to Projectiles/Melee/Yoyos/TheObliterator.cs index f035ff3d67..d10cfdd678 100644 --- a/Projectiles/TheObliterator.cs +++ b/Projectiles/Melee/Yoyos/TheObliterator.cs @@ -1,11 +1,12 @@ using System; using System.Collections.Generic; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee.Yoyos { public class TheObliterator : ModProjectile { @@ -18,7 +19,6 @@ namespace CalamityMod.Projectiles { projectile.CloneDefaults(ProjectileID.TheEyeOfCthulhu); projectile.width = 16; - projectile.scale = 1f; projectile.height = 16; projectile.penetrate = -1; projectile.extraUpdates = 1; @@ -71,24 +71,18 @@ namespace CalamityMod.Projectiles num440 = num437 / num440; num438 *= num440; num439 *= num440; - int projChoice = Main.rand.Next(2); - if (projChoice == 0) - { - projChoice = mod.ProjectileType("NebulaShot"); - } - else - { - projChoice = mod.ProjectileType("IceBeam"); - } if (projectile.owner == Main.myPlayer) { - int shoot = Projectile.NewProjectile(value10.X, value10.Y, num438, num439, projChoice, (int)((double)projectile.damage * 0.75f), projectile.knockBack, projectile.owner, 0f, 0f); - Main.projectile[shoot].ranged = false; - Main.projectile[shoot].melee = true; + Projectile.NewProjectile(value10.X, value10.Y, num438, num439, mod.ProjectileType("NebulaShot"), (int)((double)projectile.damage * 0.75), projectile.knockBack, projectile.owner, 1f, 0f); } - return; } } } - } + + public override void PostDraw(SpriteBatch spriteBatch, Color lightColor) + { + Vector2 origin = new Vector2(10f, 10f); + spriteBatch.Draw(mod.GetTexture("Projectiles/Melee/Yoyos/TheObliteratorGlow"), projectile.Center - Main.screenPosition, null, Color.White, projectile.rotation, origin, 1f, SpriteEffects.None, 0f); + } + } } \ No newline at end of file diff --git a/Projectiles/Melee/Yoyos/TheObliterator.png b/Projectiles/Melee/Yoyos/TheObliterator.png new file mode 100644 index 0000000000..23674fe1b7 Binary files /dev/null and b/Projectiles/Melee/Yoyos/TheObliterator.png differ diff --git a/Projectiles/Melee/Yoyos/TheObliteratorGlow.png b/Projectiles/Melee/Yoyos/TheObliteratorGlow.png new file mode 100644 index 0000000000..759b17e655 Binary files /dev/null and b/Projectiles/Melee/Yoyos/TheObliteratorGlow.png differ diff --git a/Projectiles/ThePlaguebringer.cs b/Projectiles/Melee/Yoyos/ThePlaguebringer.cs similarity index 95% rename from Projectiles/ThePlaguebringer.cs rename to Projectiles/Melee/Yoyos/ThePlaguebringer.cs index 10011268ed..fe9f3a7d84 100644 --- a/Projectiles/ThePlaguebringer.cs +++ b/Projectiles/Melee/Yoyos/ThePlaguebringer.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee.Yoyos { public class ThePlaguebringer : ModProjectile { diff --git a/Projectiles/ThePlaguebringer.png b/Projectiles/Melee/Yoyos/ThePlaguebringer.png similarity index 100% rename from Projectiles/ThePlaguebringer.png rename to Projectiles/Melee/Yoyos/ThePlaguebringer.png diff --git a/Projectiles/VerdantProjectile.cs b/Projectiles/Melee/Yoyos/VerdantProjectile.cs similarity index 95% rename from Projectiles/VerdantProjectile.cs rename to Projectiles/Melee/Yoyos/VerdantProjectile.cs index 589514d09b..2d36ccc25a 100644 --- a/Projectiles/VerdantProjectile.cs +++ b/Projectiles/Melee/Yoyos/VerdantProjectile.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee.Yoyos { public class VerdantProjectile : ModProjectile { diff --git a/Projectiles/VerdantProjectile.png b/Projectiles/Melee/Yoyos/VerdantProjectile.png similarity index 100% rename from Projectiles/VerdantProjectile.png rename to Projectiles/Melee/Yoyos/VerdantProjectile.png diff --git a/Projectiles/YinYo.cs b/Projectiles/Melee/Yoyos/YinYo.cs similarity index 95% rename from Projectiles/YinYo.cs rename to Projectiles/Melee/Yoyos/YinYo.cs index ccdaf01f9f..f53a0a3453 100644 --- a/Projectiles/YinYo.cs +++ b/Projectiles/Melee/Yoyos/YinYo.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Melee.Yoyos { public class YinYo : ModProjectile { diff --git a/Projectiles/YinYo.png b/Projectiles/Melee/Yoyos/YinYo.png similarity index 100% rename from Projectiles/YinYo.png rename to Projectiles/Melee/Yoyos/YinYo.png diff --git a/Projectiles/NebulaStar.png b/Projectiles/NebulaStar.png deleted file mode 100644 index 8bc516ca54..0000000000 Binary files a/Projectiles/NebulaStar.png and /dev/null differ diff --git a/Projectiles/OnyxSharkBomb.cs b/Projectiles/OnyxSharkBomb.cs deleted file mode 100644 index 32326a4813..0000000000 --- a/Projectiles/OnyxSharkBomb.cs +++ /dev/null @@ -1,77 +0,0 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles -{ - public class OnyxSharkBomb : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Shark"); - } - - public override void SetDefaults() - { - projectile.width = 30; - projectile.height = 30; - projectile.friendly = true; - projectile.penetrate = 1; - projectile.timeLeft = 300; - projectile.ranged = true; - } - - public override void AI() - { - projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; - if (Math.Abs(projectile.velocity.X) >= 8f || Math.Abs(projectile.velocity.Y) >= 8f) - { - for (int num246 = 0; num246 < 2; num246++) - { - float num247 = 0f; - float num248 = 0f; - if (num246 == 1) - { - num247 = projectile.velocity.X * 0.5f; - num248 = projectile.velocity.Y * 0.5f; - } - int num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 109, 0f, 0f, 100, default(Color), 0.5f); - Main.dust[num249].scale *= 2f + (float)Main.rand.Next(10) * 0.1f; - Main.dust[num249].velocity *= 0.2f; - Main.dust[num249].noGravity = true; - num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 159, 0f, 0f, 100, default(Color), 0.25f); - Main.dust[num249].fadeIn = 1f + (float)Main.rand.Next(5) * 0.1f; - Main.dust[num249].velocity *= 0.05f; - } - } - } - - public override void Kill(int timeLeft) - { - for (int k = 0; k < 10; k++) - { - Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 109, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); - } - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, projectile.velocity.X, projectile.velocity.Y, mod.ProjectileType("OnyxExplosion"), (int)((double)projectile.damage), projectile.knockBack, projectile.owner, 0f, 0f); - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); - for (int k = 0; k < 5; k++) - { - Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 159, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); - } - float spread = 45f * 0.0174f; - double startAngle = Math.Atan2(projectile.velocity.X, projectile.velocity.Y)- spread/2; - double deltaAngle = spread/8f; - double offsetAngle; - int i; - for (i = 0; i < 2; i++ ) - { - offsetAngle = (startAngle + deltaAngle * ( i + i * i ) / 2f ) + 32f * i; - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)( Math.Sin(offsetAngle) * 5f ), (float)( Math.Cos(offsetAngle) * 5f ), mod.ProjectileType("SandyWaifuShark"), (int)((double)projectile.damage * 0.4f), projectile.knockBack, projectile.owner, 0f, 0f); - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)( -Math.Sin(offsetAngle) * 5f ), (float)( -Math.Cos(offsetAngle) * 5f ), mod.ProjectileType("SandyWaifuShark"), (int)((double)projectile.damage * 0.4f), projectile.knockBack, projectile.owner, 0f, 0f); - } - } - } -} \ No newline at end of file diff --git a/Projectiles/Patreon/AtaraxiaHoming.cs b/Projectiles/Patreon/AtaraxiaHoming.cs new file mode 100644 index 0000000000..9fe6503bff --- /dev/null +++ b/Projectiles/Patreon/AtaraxiaHoming.cs @@ -0,0 +1,166 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Patreon +{ + public class AtaraxiaHoming : ModProjectile + { + private static int NumAnimationFrames = 5; + private static int AnimationFrameTime = 9; + private static float HomingStartRange = 300f; + private static float HomingBreakRange = 1000f; + + private static int Lifespan = 180; + private static int IntangibleFrames = 12; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Definitely Not Exoblade"); + Main.projFrames[projectile.type] = NumAnimationFrames; + } + + public override void SetDefaults() + { + projectile.width = 8; + projectile.height = 8; + projectile.friendly = true; + projectile.melee = true; + projectile.penetrate = 1; + projectile.extraUpdates = 1; + projectile.timeLeft = Lifespan; + projectile.ignoreWater = true; + } + + private bool HomingAI() + { + // Save current speed to AI variables + float speed = projectile.velocity.Length(); + if (projectile.ai[0] == 0f) + projectile.ai[0] = speed; + + // Variables for choosing an NPC to home in on + float posX = projectile.position.X; + float posY = projectile.position.Y; + float homingRange = HomingStartRange; + bool foundTarget = false; + int targetIndex = 0; + + // ai[1] stores the index of the current target plus one. 0 is none. + if (projectile.ai[1] == 0f) + { + // Find the closest target. The range decreases each time you find a closer target. + for (int i = 0; i < 200; ++i) + { + if (Main.npc[i].CanBeChasedBy(projectile, false)) + { + // Chlorophyte Bullets actually home in a diamond instead of a circle because they don't perform a square root here. + float d = Math.Abs(projectile.Center.X - Main.npc[i].Center.X) + Math.Abs(projectile.Center.Y - Main.npc[i].Center.Y); + if (d < homingRange && Collision.CanHit(projectile.Center, 1, 1, Main.npc[i].position, Main.npc[i].width, Main.npc[i].height)) + { + homingRange = d; + posX = Main.npc[i].Center.X; + posY = Main.npc[i].Center.Y; + foundTarget = true; + targetIndex = i; + } + } + } + + // If at least one valid target was found, set ai[1] to store its index plus one. + if (foundTarget) + projectile.ai[1] = (float)(targetIndex + 1); + } + + // This is always the case after that loop for some reason. + foundTarget = false; + + // Ensure the current target is still valid + if (projectile.ai[1] > 0f) + { + targetIndex = (int)(projectile.ai[1] - 1f); + + // Chlorophyte Bullets will continue homing in unless their target is invincible. + if (Main.npc[targetIndex].active && Main.npc[targetIndex].CanBeChasedBy(projectile, false)) + { + float targetX = Main.npc[targetIndex].Center.X; + float targetY = Main.npc[targetIndex].Center.Y; + float d = Math.Abs(projectile.Center.X - targetX) + Math.Abs(projectile.Center.Y - targetY); + if (d < HomingBreakRange) + { + foundTarget = true; + posX = targetX; + posY = targetY; + } + } + else + projectile.ai[1] = 0f; + } + + // Non-friendly Chlorophyte Bullets will never actually home in, despite maintaining a target. + if (foundTarget && projectile.friendly) + { + float dx = posX - projectile.Center.X; + float dy = posY - projectile.Center.Y; + float distance = (float)Math.Sqrt(dx * dx + dy * dy); + float homingFactor = speed / distance; + dx *= homingFactor; + dy *= homingFactor; + + // The projectile loses 1/6th of its current velocity and replaces it with homing power. + float homingStrength = 6f; + projectile.velocity.X = (projectile.velocity.X * (homingStrength - 1f) + dx) / homingStrength; + projectile.velocity.Y = (projectile.velocity.Y * (homingStrength - 1f) + dy) / homingStrength; + + // Re-scale resulting velocity to the projectile's set maximum speed + projectile.velocity.Normalize(); + projectile.velocity *= speed; + return true; + } + return false; + } + + public override void AI() + { + drawOffsetX = -28; + drawOriginOffsetY = -2; + drawOriginOffsetX = 12; + projectile.rotation = projectile.velocity.ToRotation(); + + // Run homing code + bool homing = HomingAI(); + + // Light + Lighting.AddLight(projectile.Center, 0.3f, 0.1f, 0.45f); + + // Spawn dust with a 3/4 chance if currently homing in + if (homing && Main.rand.Next(4) != 3) + { + int idx = Dust.NewDust(projectile.Center, 1, 1, 70); + Main.dust[idx].position = projectile.Center; + Main.dust[idx].noGravity = true; + Main.dust[idx].velocity *= 0.25f; + } + + // Update animation + projectile.frameCounter++; + if (projectile.frameCounter > AnimationFrameTime) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame >= NumAnimationFrames) + projectile.frame = 0; + } + + // Cannot deal damage for the first several frames of existence. + public override bool CanDamage() + { + return (projectile.timeLeft < Lifespan - IntangibleFrames); + } + } +} diff --git a/Projectiles/Patreon/AtaraxiaHoming.png b/Projectiles/Patreon/AtaraxiaHoming.png new file mode 100644 index 0000000000..47e460cede Binary files /dev/null and b/Projectiles/Patreon/AtaraxiaHoming.png differ diff --git a/Projectiles/Patreon/AtaraxiaMain.cs b/Projectiles/Patreon/AtaraxiaMain.cs new file mode 100644 index 0000000000..2c15029ce1 --- /dev/null +++ b/Projectiles/Patreon/AtaraxiaMain.cs @@ -0,0 +1,100 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Patreon +{ + public class AtaraxiaMain : ModProjectile + { + private static int NumAnimationFrames = 5; + private static int AnimationFrameTime = 9; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Not Exoblade"); + Main.projFrames[projectile.type] = NumAnimationFrames; + } + + public override void SetDefaults() + { + projectile.width = 12; + projectile.height = 12; + projectile.friendly = true; + projectile.melee = true; + projectile.penetrate = 1; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 5; + projectile.extraUpdates = 2; + projectile.timeLeft = 180; + } + + public override void AI() + { + drawOffsetX = -40; + drawOriginOffsetY = -3; + drawOriginOffsetX = 18; + projectile.rotation = projectile.velocity.ToRotation(); + + // Light + Lighting.AddLight(projectile.Center, 0.45f, 0.1f, 0.1f); + + // Spawn dust with a 1/2 chance + if (Main.rand.NextBool()) + { + int idx = Dust.NewDust(projectile.Center, 1, 1, 90); + Main.dust[idx].position = projectile.Center; + Main.dust[idx].noGravity = true; + Main.dust[idx].velocity *= 0.6f; + } + + // Update animation + projectile.frameCounter++; + if (projectile.frameCounter > AnimationFrameTime) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame >= NumAnimationFrames) + projectile.frame = 0; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(BuffID.ShadowFlame, 180); + target.AddBuff(BuffID.Ichor, 180); + } + + // Explodes like Exoblade's Exobeams + public override void Kill(int timeLeft) + { + Main.PlaySound(SoundID.NPCDeath55, projectile.Center); + + // Transform the projectile's hitbox into a big explosion + projectile.position = projectile.Center; + projectile.width = (projectile.height = 140); + projectile.position.X = projectile.position.X - (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + + Vector2 corner = new Vector2(projectile.position.X, projectile.position.Y); + for (int i = 0; i < 50; i++) + { + int idx = Dust.NewDust(corner, projectile.width, projectile.height, 86, 0f, 0f, 0, new Color(210, 0, 255), 2.2f); + Main.dust[idx].noGravity = true; + Main.dust[idx].velocity *= 2.5f; + + idx = Dust.NewDust(corner, projectile.width, projectile.height, 118, 0f, 0f, 100, new Color(210, 0, 255), 1.8f); + Main.dust[idx].noGravity = true; + Main.dust[idx].velocity *= 1.8f; + + idx = Dust.NewDust(corner, projectile.width, projectile.height, 71, 0f, 0f, 100, new Color(210, 0, 255), 1.0f); + Main.dust[idx].noGravity = true; + Main.dust[idx].velocity *= 4.0f; + } + projectile.Damage(); + } + } +} diff --git a/Projectiles/Patreon/AtaraxiaMain.png b/Projectiles/Patreon/AtaraxiaMain.png new file mode 100644 index 0000000000..ef90446947 Binary files /dev/null and b/Projectiles/Patreon/AtaraxiaMain.png differ diff --git a/Projectiles/Patreon/AtaraxiaSide.cs b/Projectiles/Patreon/AtaraxiaSide.cs new file mode 100644 index 0000000000..624967cc08 --- /dev/null +++ b/Projectiles/Patreon/AtaraxiaSide.cs @@ -0,0 +1,92 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items.Patreon; + +namespace CalamityMod.Projectiles.Patreon +{ + public class AtaraxiaSide : ModProjectile + { + private static int NumAnimationFrames = 5; + private static int AnimationFrameTime = 9; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Also Not Exoblade"); + Main.projFrames[projectile.type] = NumAnimationFrames; + } + + public override void SetDefaults() + { + projectile.width = 8; + projectile.height = 8; + projectile.friendly = true; + projectile.melee = true; + projectile.penetrate = 1; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 5; + projectile.extraUpdates = 2; + projectile.timeLeft = 180; + } + + public override void AI() + { + drawOffsetX = -28; + drawOriginOffsetY = -2; + drawOriginOffsetX = 12; + projectile.rotation = projectile.velocity.ToRotation(); + + // Light + Lighting.AddLight(projectile.Center, 0.3f, 0.1f, 0.45f); + + // Spawn dust with a 3/4 chance + if (Main.rand.Next(4) != 3) + { + int idx = Dust.NewDust(projectile.Center, 1, 1, 70); + Main.dust[idx].position = projectile.Center; + Main.dust[idx].noGravity = true; + Main.dust[idx].velocity *= 0.25f; + } + + // Update animation + projectile.frameCounter++; + if (projectile.frameCounter > AnimationFrameTime) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame >= NumAnimationFrames) + projectile.frame = 0; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(BuffID.ShadowFlame, 180); + target.AddBuff(BuffID.Ichor, 180); + } + + // Spawns 6 smaller projectiles that slowly glide outward and ignore iframes + public override void Kill(int timeLeft) + { + Main.PlaySound(SoundID.Item89, projectile.Center); + + // Individual split projectiles deal 7.5% of the weapon's base damage per hit. + int numSplits = 6; + int splitID = mod.ProjectileType("AtaraxiaSplit"); + int damage = (int)(0.075f * Ataraxia.BaseDamage); + float angleVariance = MathHelper.TwoPi / (float)(numSplits); + Vector2 projVec = new Vector2(4.5f, 0f).RotatedByRandom(MathHelper.TwoPi); + + for (int i = 0; i < numSplits; ++i) + { + projVec = projVec.RotatedBy(angleVariance); + if(projectile.owner == Main.myPlayer) + Projectile.NewProjectile(projectile.Center, projVec, splitID, damage, 1.5f, Main.myPlayer, 0.0f, 0.0f); + } + } + } +} diff --git a/Projectiles/Patreon/AtaraxiaSide.png b/Projectiles/Patreon/AtaraxiaSide.png new file mode 100644 index 0000000000..47e460cede Binary files /dev/null and b/Projectiles/Patreon/AtaraxiaSide.png differ diff --git a/Projectiles/Patreon/AtaraxiaSplit.cs b/Projectiles/Patreon/AtaraxiaSplit.cs new file mode 100644 index 0000000000..ca163e1054 --- /dev/null +++ b/Projectiles/Patreon/AtaraxiaSplit.cs @@ -0,0 +1,61 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Patreon +{ + public class AtaraxiaSplit : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Still Not Exoblade"); + } + + public override void SetDefaults() + { + projectile.width = 8; + projectile.height = 8; + projectile.friendly = true; + projectile.melee = true; + projectile.penetrate = -1; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 3; + projectile.timeLeft = 50; + projectile.tileCollide = false; + projectile.ignoreWater = true; + projectile.alpha = 0; + } + + public override void AI() + { + drawOffsetX = -5; + drawOriginOffsetY = -1; + drawOriginOffsetX = 0; + projectile.rotation = projectile.velocity.ToRotation(); + + // Slow down exponentially and fade away + projectile.velocity *= 0.93f; + projectile.alpha += 5; + + // Light which scales down as it fades + float lightFactor = (255f - (float)projectile.alpha) / 255f; + Lighting.AddLight(projectile.Center, 0.3f * lightFactor, 0.05f * lightFactor, 0.2f * lightFactor); + + // Spawn dust, with less dust as it fades away + if (Main.rand.Next(256) > projectile.alpha - 60) + { + int idx = Dust.NewDust(projectile.Center, 1, 1, 71); + Main.dust[idx].position = projectile.Center - projectile.velocity * 0.7f; + Main.dust[idx].noGravity = true; + Main.dust[idx].velocity *= 0.3f; + Main.dust[idx].velocity += projectile.velocity * 0.4f; + Main.dust[idx].scale = Main.rand.NextFloat(0.5f, 1.0f); + Main.dust[idx].alpha = Main.rand.Next(80, 200); + } + } + } +} diff --git a/Projectiles/Patreon/AtaraxiaSplit.png b/Projectiles/Patreon/AtaraxiaSplit.png new file mode 100644 index 0000000000..04b9e33a9e Binary files /dev/null and b/Projectiles/Patreon/AtaraxiaSplit.png differ diff --git a/Projectiles/Patreon/DarkSpark.cs b/Projectiles/Patreon/DarkSpark.cs index e2fa4c9ec6..7ffa3e216d 100644 --- a/Projectiles/Patreon/DarkSpark.cs +++ b/Projectiles/Patreon/DarkSpark.cs @@ -1,217 +1,217 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; -using Terraria.Enums; - -namespace CalamityMod.Projectiles.Patreon -{ - public class DarkSpark : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Crystal"); - Main.projFrames[projectile.type] = 4; - } - - public override void SetDefaults() - { - projectile.width = 14; - projectile.height = 22; - projectile.friendly = true; - projectile.penetrate = -1; - projectile.tileCollide = false; - projectile.magic = true; - projectile.ignoreWater = true; - } - - public override void AI() - { - Player player = Main.player[projectile.owner]; - float num = 0f; - if (projectile.spriteDirection == -1) - { - num = 3.14159274f; - } - Vector2 vector = player.RotatedRelativePoint(player.MountedCenter, true); - float num26 = 30f; - if (projectile.ai[0] > 360f) - { - num26 = 15f; - } - if (projectile.ai[0] > 480f) - { - num26 = 5f; - } - projectile.damage = (int)((float)player.inventory[player.selectedItem].damage * player.magicDamage); - projectile.ai[0] += 1f; - projectile.ai[1] += 1f; - if (projectile.localAI[0] == 0f) - { - projectile.localAI[0] = 1f; - projectile.localAI[1] = 255f; - } - if (projectile.localAI[1] > 0f) - { - projectile.localAI[1] -= 1f; - } - bool flag9 = false; - if (projectile.ai[0] % num26 == 0f) - { - flag9 = true; - } - int num27 = 10; - bool flag10 = false; - if (projectile.ai[0] % num26 == 0f) - { - flag10 = true; - } - if (projectile.ai[1] >= 1f) - { - projectile.ai[1] = 0f; - flag10 = true; - if (Main.myPlayer == projectile.owner) - { - float scaleFactor5 = player.inventory[player.selectedItem].shootSpeed * projectile.scale; - Vector2 value12 = vector; - Vector2 value13 = Main.screenPosition + new Vector2((float)Main.mouseX, (float)Main.mouseY) - value12; - if (player.gravDir == -1f) - { - value13.Y = (float)(Main.screenHeight - Main.mouseY) + Main.screenPosition.Y - value12.Y; - } - Vector2 vector11 = Vector2.Normalize(value13); - if (float.IsNaN(vector11.X) || float.IsNaN(vector11.Y)) - { - vector11 = -Vector2.UnitY; - } - vector11 = Vector2.Normalize(Vector2.Lerp(vector11, Vector2.Normalize(projectile.velocity), 0.92f)); - vector11 *= scaleFactor5; - if (vector11.X != projectile.velocity.X || vector11.Y != projectile.velocity.Y) - { - projectile.netUpdate = true; - } - projectile.velocity = vector11; - } - } - projectile.frameCounter++; - int num28 = (projectile.ai[0] < 480f) ? 3 : 1; - if (projectile.frameCounter >= num28) - { - projectile.frameCounter = 0; - if (++projectile.frame >= 4) - { - projectile.frame = 0; - } - } - if (projectile.soundDelay <= 0) - { - projectile.soundDelay = num27; - projectile.soundDelay *= 2; - if (projectile.ai[0] != 1f) - { - Main.PlaySound(SoundID.Item15, projectile.position); - } - } - if (flag10 && Main.myPlayer == projectile.owner) - { - bool flag11 = !flag9 || player.CheckMana(player.inventory[player.selectedItem].mana, true, false); - bool flag12 = player.channel && flag11 && !player.noItems && !player.CCed; - if (flag12) - { - if (projectile.ai[0] == 1f) - { - Vector2 center3 = projectile.Center; - Vector2 vector12 = Vector2.Normalize(projectile.velocity); - if (float.IsNaN(vector12.X) || float.IsNaN(vector12.Y)) - { - vector12 = -Vector2.UnitY; - } - int num29 = projectile.damage; - for (int l = 0; l < 7; l++) - { - Projectile.NewProjectile(center3.X, center3.Y, vector12.X, vector12.Y, mod.ProjectileType("DarkSparkBeam"), num29, projectile.knockBack, projectile.owner, (float)l, (float)projectile.whoAmI); - } - projectile.netUpdate = true; - } - } - else - { - projectile.Kill(); - } - } - projectile.position = player.RotatedRelativePoint(player.MountedCenter, true) - projectile.Size / 2f; - projectile.rotation = projectile.velocity.ToRotation() + num; - projectile.spriteDirection = projectile.direction; - projectile.timeLeft = 2; - player.ChangeDir(projectile.direction); - player.heldProj = projectile.whoAmI; - player.itemTime = 2; - player.itemAnimation = 2; - player.itemRotation = (float)Math.Atan2((double)(projectile.velocity.Y * (float)projectile.direction), (double)(projectile.velocity.X * (float)projectile.direction)); - } - - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - Vector2 mountedCenter = Main.player[projectile.owner].MountedCenter; - Microsoft.Xna.Framework.Color color25 = Lighting.GetColor((int)((double)projectile.position.X + (double)projectile.width * 0.5) / 16, (int)(((double)projectile.position.Y + (double)projectile.height * 0.5) / 16.0)); - if (projectile.hide && !ProjectileID.Sets.DontAttachHideToAlpha[projectile.type]) - { - color25 = Lighting.GetColor((int)mountedCenter.X / 16, (int)(mountedCenter.Y / 16f)); - } - SpriteEffects spriteEffects = SpriteEffects.None; - if (projectile.spriteDirection == -1) - { - spriteEffects = SpriteEffects.FlipHorizontally; - } - Texture2D texture2D14 = Main.projectileTexture[projectile.type]; - int num215 = Main.projectileTexture[projectile.type].Height / Main.projFrames[projectile.type]; - int y7 = num215 * projectile.frame; - Vector2 vector27 = (projectile.position + new Vector2((float)projectile.width, (float)projectile.height) / 2f + Vector2.UnitY * projectile.gfxOffY - Main.screenPosition).Floor(); - float scale5 = 1f; - if (Main.player[projectile.owner].shroomiteStealth && Main.player[projectile.owner].inventory[Main.player[projectile.owner].selectedItem].ranged) - { - float num216 = Main.player[projectile.owner].stealth; - if ((double)num216 < 0.03) - { - num216 = 0.03f; - } - float arg_97B3_0 = (1f + num216 * 10f) / 11f; - color25 *= num216; - scale5 = num216; - } - if (Main.player[projectile.owner].setVortex && Main.player[projectile.owner].inventory[Main.player[projectile.owner].selectedItem].ranged) - { - float num217 = Main.player[projectile.owner].stealth; - if ((double)num217 < 0.03) - { - num217 = 0.03f; - } - float arg_9854_0 = (1f + num217 * 10f) / 11f; - color25 = color25.MultiplyRGBA(new Microsoft.Xna.Framework.Color(Vector4.Lerp(Vector4.One, new Vector4(0.16f, 0.12f, 0f, 0f), 1f - num217))); - scale5 = num217; - } - Main.spriteBatch.Draw(texture2D14, vector27, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y7, texture2D14.Width, num215)), projectile.GetAlpha(color25), projectile.rotation, new Vector2((float)texture2D14.Width / 2f, (float)num215 / 2f), projectile.scale, spriteEffects, 0f); - float scaleFactor2 = (float)Math.Cos((double)(6.28318548f * (projectile.ai[0] / 120f))) * 2f + 2f; - if (projectile.ai[0] > 480f) - { - scaleFactor2 = 4f; - } - for (float num218 = 0f; num218 < 4f; num218 += 1f) - { - Main.spriteBatch.Draw(texture2D14, vector27 + Vector2.UnitY.RotatedBy((double)(num218 * 6.28318548f / 4f), default(Vector2)) * scaleFactor2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y7, texture2D14.Width, num215)), projectile.GetAlpha(color25).MultiplyRGBA(new Microsoft.Xna.Framework.Color(255, 255, 255, 0)) * 0.03f, projectile.rotation, new Vector2((float)texture2D14.Width / 2f, (float)num215 / 2f), projectile.scale, spriteEffects, 0f); - } - return false; - } - - public override Color? GetAlpha(Color lightColor) - { - if (projectile.ai[0] < 255f) - return new Color((int)(projectile.ai[0]), (int)(projectile.ai[0]), (int)(projectile.ai[0]), (int)(projectile.localAI[1])); - else - return new Color(255, 255, 255, 0); - } - } +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.Enums; + +namespace CalamityMod.Projectiles.Patreon +{ + public class DarkSpark : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Crystal"); + Main.projFrames[projectile.type] = 4; + } + + public override void SetDefaults() + { + projectile.width = 14; + projectile.height = 22; + projectile.friendly = true; + projectile.penetrate = -1; + projectile.tileCollide = false; + projectile.magic = true; + projectile.ignoreWater = true; + } + + public override void AI() + { + Player player = Main.player[projectile.owner]; + float num = 0f; + if (projectile.spriteDirection == -1) + { + num = 3.14159274f; + } + Vector2 vector = player.RotatedRelativePoint(player.MountedCenter, true); + float num26 = 30f; + if (projectile.ai[0] > 360f) + { + num26 = 15f; + } + if (projectile.ai[0] > 480f) + { + num26 = 5f; + } + projectile.damage = (int)((float)player.inventory[player.selectedItem].damage * player.magicDamage); + projectile.ai[0] += 1f; + projectile.ai[1] += 1f; + if (projectile.localAI[0] == 0f) + { + projectile.localAI[0] = 1f; + projectile.localAI[1] = 255f; + } + if (projectile.localAI[1] > 0f) + { + projectile.localAI[1] -= 1f; + } + bool flag9 = false; + if (projectile.ai[0] % num26 == 0f) + { + flag9 = true; + } + int num27 = 10; + bool flag10 = false; + if (projectile.ai[0] % num26 == 0f) + { + flag10 = true; + } + if (projectile.ai[1] >= 1f) + { + projectile.ai[1] = 0f; + flag10 = true; + if (Main.myPlayer == projectile.owner) + { + float scaleFactor5 = player.inventory[player.selectedItem].shootSpeed * projectile.scale; + Vector2 value12 = vector; + Vector2 value13 = Main.screenPosition + new Vector2((float)Main.mouseX, (float)Main.mouseY) - value12; + if (player.gravDir == -1f) + { + value13.Y = (float)(Main.screenHeight - Main.mouseY) + Main.screenPosition.Y - value12.Y; + } + Vector2 vector11 = Vector2.Normalize(value13); + if (float.IsNaN(vector11.X) || float.IsNaN(vector11.Y)) + { + vector11 = -Vector2.UnitY; + } + vector11 = Vector2.Normalize(Vector2.Lerp(vector11, Vector2.Normalize(projectile.velocity), 0.92f)); + vector11 *= scaleFactor5; + if (vector11.X != projectile.velocity.X || vector11.Y != projectile.velocity.Y) + { + projectile.netUpdate = true; + } + projectile.velocity = vector11; + } + } + projectile.frameCounter++; + int num28 = (projectile.ai[0] < 480f) ? 3 : 1; + if (projectile.frameCounter >= num28) + { + projectile.frameCounter = 0; + if (++projectile.frame >= 4) + { + projectile.frame = 0; + } + } + if (projectile.soundDelay <= 0) + { + projectile.soundDelay = num27; + projectile.soundDelay *= 2; + if (projectile.ai[0] != 1f) + { + Main.PlaySound(SoundID.Item15, projectile.position); + } + } + if (flag10 && Main.myPlayer == projectile.owner) + { + bool flag11 = !flag9 || player.CheckMana(player.inventory[player.selectedItem].mana, true, false); + bool flag12 = player.channel && flag11 && !player.noItems && !player.CCed; + if (flag12) + { + if (projectile.ai[0] == 1f) + { + Vector2 center3 = projectile.Center; + Vector2 vector12 = Vector2.Normalize(projectile.velocity); + if (float.IsNaN(vector12.X) || float.IsNaN(vector12.Y)) + { + vector12 = -Vector2.UnitY; + } + int num29 = projectile.damage; + for (int l = 0; l < 7; l++) + { + Projectile.NewProjectile(center3.X, center3.Y, vector12.X, vector12.Y, mod.ProjectileType("DarkSparkBeam"), num29, projectile.knockBack, projectile.owner, (float)l, (float)projectile.whoAmI); + } + projectile.netUpdate = true; + } + } + else + { + projectile.Kill(); + } + } + projectile.position = player.RotatedRelativePoint(player.MountedCenter, true) - projectile.Size / 2f; + projectile.rotation = projectile.velocity.ToRotation() + num; + projectile.spriteDirection = projectile.direction; + projectile.timeLeft = 2; + player.ChangeDir(projectile.direction); + player.heldProj = projectile.whoAmI; + player.itemTime = 2; + player.itemAnimation = 2; + player.itemRotation = (float)Math.Atan2((double)(projectile.velocity.Y * (float)projectile.direction), (double)(projectile.velocity.X * (float)projectile.direction)); + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Vector2 mountedCenter = Main.player[projectile.owner].MountedCenter; + Microsoft.Xna.Framework.Color color25 = Lighting.GetColor((int)((double)projectile.position.X + (double)projectile.width * 0.5) / 16, (int)(((double)projectile.position.Y + (double)projectile.height * 0.5) / 16.0)); + if (projectile.hide && !ProjectileID.Sets.DontAttachHideToAlpha[projectile.type]) + { + color25 = Lighting.GetColor((int)mountedCenter.X / 16, (int)(mountedCenter.Y / 16f)); + } + SpriteEffects spriteEffects = SpriteEffects.None; + if (projectile.spriteDirection == -1) + { + spriteEffects = SpriteEffects.FlipHorizontally; + } + Texture2D texture2D14 = Main.projectileTexture[projectile.type]; + int num215 = Main.projectileTexture[projectile.type].Height / Main.projFrames[projectile.type]; + int y7 = num215 * projectile.frame; + Vector2 vector27 = (projectile.position + new Vector2((float)projectile.width, (float)projectile.height) / 2f + Vector2.UnitY * projectile.gfxOffY - Main.screenPosition).Floor(); + float scale5 = 1f; + if (Main.player[projectile.owner].shroomiteStealth && Main.player[projectile.owner].inventory[Main.player[projectile.owner].selectedItem].ranged) + { + float num216 = Main.player[projectile.owner].stealth; + if ((double)num216 < 0.03) + { + num216 = 0.03f; + } + float arg_97B3_0 = (1f + num216 * 10f) / 11f; + color25 *= num216; + scale5 = num216; + } + if (Main.player[projectile.owner].setVortex && Main.player[projectile.owner].inventory[Main.player[projectile.owner].selectedItem].ranged) + { + float num217 = Main.player[projectile.owner].stealth; + if ((double)num217 < 0.03) + { + num217 = 0.03f; + } + float arg_9854_0 = (1f + num217 * 10f) / 11f; + color25 = color25.MultiplyRGBA(new Microsoft.Xna.Framework.Color(Vector4.Lerp(Vector4.One, new Vector4(0.16f, 0.12f, 0f, 0f), 1f - num217))); + scale5 = num217; + } + Main.spriteBatch.Draw(texture2D14, vector27, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y7, texture2D14.Width, num215)), projectile.GetAlpha(color25), projectile.rotation, new Vector2((float)texture2D14.Width / 2f, (float)num215 / 2f), projectile.scale, spriteEffects, 0f); + float scaleFactor2 = (float)Math.Cos((double)(6.28318548f * (projectile.ai[0] / 120f))) * 2f + 2f; + if (projectile.ai[0] > 480f) + { + scaleFactor2 = 4f; + } + for (float num218 = 0f; num218 < 4f; num218 += 1f) + { + Main.spriteBatch.Draw(texture2D14, vector27 + Vector2.UnitY.RotatedBy((double)(num218 * 6.28318548f / 4f), default(Vector2)) * scaleFactor2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y7, texture2D14.Width, num215)), projectile.GetAlpha(color25).MultiplyRGBA(new Microsoft.Xna.Framework.Color(255, 255, 255, 0)) * 0.03f, projectile.rotation, new Vector2((float)texture2D14.Width / 2f, (float)num215 / 2f), projectile.scale, spriteEffects, 0f); + } + return false; + } + + public override Color? GetAlpha(Color lightColor) + { + if (projectile.ai[0] < 255f) + return new Color((int)(projectile.ai[0]), (int)(projectile.ai[0]), (int)(projectile.ai[0]), (int)(projectile.localAI[1])); + else + return new Color(255, 255, 255, 0); + } + } } \ No newline at end of file diff --git a/Projectiles/Patreon/DarkSparkBeam.cs b/Projectiles/Patreon/DarkSparkBeam.cs index 1cb90ab12a..26ca70ccfa 100644 --- a/Projectiles/Patreon/DarkSparkBeam.cs +++ b/Projectiles/Patreon/DarkSparkBeam.cs @@ -1,295 +1,295 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; -using Terraria.Enums; -using Terraria.GameContent.Shaders; -using Terraria.Graphics.Effects; - -namespace CalamityMod.Projectiles.Patreon -{ - public class DarkSparkBeam : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Beam"); - } - - public override void SetDefaults() - { - projectile.width = 18; - projectile.height = 18; - projectile.friendly = true; - projectile.magic = true; - projectile.penetrate = -1; - projectile.alpha = 255; - projectile.tileCollide = false; - projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 10; - } - - public override void AI() - { - Vector2? vector71 = null; - if (projectile.velocity.HasNaNs() || projectile.velocity == Vector2.Zero) - { - projectile.velocity = -Vector2.UnitY; - } - if (projectile.type != mod.ProjectileType("DarkSparkBeam") || !Main.projectile[(int)projectile.ai[1]].active || Main.projectile[(int)projectile.ai[1]].type != mod.ProjectileType("DarkSpark")) - { - projectile.Kill(); - return; - } - float num810 = (float)((int)projectile.ai[0]) - 2.5f; - Vector2 value36 = Vector2.Normalize(Main.projectile[(int)projectile.ai[1]].velocity); - Projectile projectile2 = Main.projectile[(int)projectile.ai[1]]; - float num811 = num810 * 0.5235988f; - Vector2 value37 = Vector2.Zero; - float num812; //0 to 1 - float y; //6 to 20 - float num813; //1.75 to 20 - float scaleFactor6; //-22 to -2 - Color color = new Color(1, 1, 1, 127); - projectile.Opacity = 1f; - if (projectile2.ai[0] < 720f) - { - num812 = 0f + projectile2.ai[0] / 1440f; //0 to 0.5 - y = 6f + projectile2.ai[0] / 720f * 7f; - if (projectile2.ai[0] > 360f) - { - int colorValue = (int)((0.01f + (((projectile2.ai[0] - 360f) / 360f) * 2.55f)) * 100f); - color = new Color(colorValue, colorValue, colorValue, 127); - } - if (projectile2.ai[0] < 480f) - { - num813 = 1.75f/* + 4f * (projectile2.ai[0] / 120f)*/; //20 to 16 - } - else - { - num813 = 3f + 5f * ((projectile2.ai[0] - 480f) / 240f); //7.99 to 3.01 - } - scaleFactor6 = -2f - projectile2.ai[0] / 720f * 5f; - } - else - { - float colorLimit = projectile2.ai[0] - 720f; - if (colorLimit > 255f) - { - colorLimit = 255f; - } - switch ((int)projectile.ai[0]) //R O Y G B I V - { - case 0: - color = new Color(255, 255 - (int)colorLimit, 255 - (int)colorLimit, 127); //red - break; - case 1: - color = new Color(255, 255 - (int)(colorLimit * 0.3529412f), 255 - (int)colorLimit, 127); //orange - break; - case 2: - color = new Color(255, 255, 255 - (int)colorLimit, 127); //yellow - break; - case 3: - color = new Color(255 - (int)colorLimit, 255 - (int)(colorLimit * 0.5f), 255 - (int)colorLimit, 127); //green - break; - case 4: - color = new Color(255 - (int)colorLimit, 255 - (int)colorLimit, 255, 127); //blue - break; - case 5: - color = new Color(255 - (int)(colorLimit * 0.7058824f), 255 - (int)colorLimit, 255 - (int)(colorLimit * 0.4901961), 127); //indigo - break; - case 6: - color = new Color(255 - (int)(colorLimit * 0.0666667f), 255 - (int)(colorLimit * 0.4901961), 255 - (int)(colorLimit * 0.0666667f), 127); //violet - break; - } - num812 = 0.5f; //0f, inverted - num813 = 10.875f; //1.75f, inverted - y = 13f; //6f, inverted - scaleFactor6 = -7f; //-2, inverted - } - float num814 = (projectile2.ai[0] + num810 * num813) / (num813 * 6f) * 6.28318548f; - num811 = Vector2.UnitY.RotatedBy((double)num814, default(Vector2)).Y * 0.5235988f * num812; - value37 = (Vector2.UnitY.RotatedBy((double)num814, default(Vector2)) * new Vector2(4f, y)).RotatedBy((double)projectile2.velocity.ToRotation(), default(Vector2)); - projectile.position = projectile2.Center + value36 * 16f - projectile.Size / 2f + new Vector2(0f, -Main.projectile[(int)projectile.ai[1]].gfxOffY); - projectile.position += projectile2.velocity.ToRotation().ToRotationVector2() * scaleFactor6; - projectile.position += value37; - projectile.velocity = Vector2.Normalize(projectile2.velocity).RotatedBy((double)num811, default(Vector2)); - projectile.scale = 1.5f * (1.5f - num812); - projectile.damage = projectile2.damage; - double damageMult = 1.0 + (double)(projectile2.ai[0] * 0.0025f); //1 to 3.5 - if (damageMult > 3.5) - { - damageMult = 3.5; - } - if (projectile2.ai[0] >= 720f) - { - projectile.damage = (int)((double)projectile.damage * damageMult); - vector71 = new Vector2?(projectile2.Center); - } - if (!Collision.CanHitLine(Main.player[projectile.owner].Center, 0, 0, projectile2.Center, 0, 0)) - { - vector71 = new Vector2?(Main.player[projectile.owner].Center); - } - projectile.friendly = (projectile2.ai[0] > 120f); - if (projectile.velocity.HasNaNs() || projectile.velocity == Vector2.Zero) - { - projectile.velocity = -Vector2.UnitY; - } - float num818 = projectile.velocity.ToRotation(); - projectile.rotation = num818 - 1.57079637f; - projectile.velocity = num818.ToRotationVector2(); - float num819 = 2f; - float num820 = 0f; - Vector2 samplingPoint = projectile.Center; - if (vector71.HasValue) - { - samplingPoint = vector71.Value; - } - float[] array3 = new float[(int)num819]; - Collision.LaserScan(samplingPoint, projectile.velocity, num820 * projectile.scale, 2400f, array3); - float num821 = 0f; - for (int num822 = 0; num822 < array3.Length; num822++) - { - num821 += array3[num822]; - } - num821 /= num819; - float amount = 0.75f; - projectile.localAI[1] = MathHelper.Lerp(projectile.localAI[1], num821, amount); - if (Math.Abs(projectile.localAI[1] - num821) < 100f && projectile.scale > 0.15f) - { - //color.A = 0; - Vector2 vector80 = projectile.Center + projectile.velocity * (projectile.localAI[1] - 14.5f * projectile.scale); - for (int num843 = 0; num843 < 2; num843++) - { - float num844 = projectile.velocity.ToRotation() + ((Main.rand.Next(2) == 1) ? -1f : 1f) * 1.57079637f; - float num845 = (float)Main.rand.NextDouble() * 0.8f + 1f; - Vector2 vector81 = new Vector2((float)Math.Cos((double)num844) * num845, (float)Math.Sin((double)num844) * num845); - int num846 = Dust.NewDust(vector80, 0, 0, 267, vector81.X, vector81.Y, 0, color, 3.3f); //267 - Main.dust[num846].color = color; - Main.dust[num846].scale = 1.2f; - if (projectile.scale > 1f) - { - Main.dust[num846].velocity *= projectile.scale; - Main.dust[num846].scale *= projectile.scale; - } - Main.dust[num846].noGravity = true; - if (projectile.scale != 1.4f) - { - Dust dust9 = Dust.CloneDust(num846); - dust9.color = color; - dust9.scale /= 2f; - dust9.noGravity = true; - } - Main.dust[num846].color = color; - } - if (Main.rand.Next(5) == 0) - { - Vector2 value42 = projectile.velocity.RotatedBy(1.5707963705062866, default(Vector2)) * ((float)Main.rand.NextDouble() - 0.5f) * (float)projectile.width; - int num847 = Dust.NewDust(vector80 + value42 - Vector2.One * 4f, 8, 8, 267, 0f, 0f, 100, color, 5f); - Main.dust[num847].velocity *= 0.5f; - Main.dust[num847].noGravity = true; - Main.dust[num847].velocity.Y = -Math.Abs(Main.dust[num847].velocity.Y); - } - DelegateMethods.v3_1 = color.ToVector3() * 0.3f; - float value43 = 0.1f * (float)Math.Sin((double)(Main.GlobalTime * 20f)); - Vector2 size = new Vector2(projectile.velocity.Length() * projectile.localAI[1], (float)projectile.width * projectile.scale); - float num848 = projectile.velocity.ToRotation(); - if (Main.netMode != 2) - { - ((WaterShaderData)Filters.Scene["WaterDistortion"].GetShader()).QueueRipple(projectile.position + new Vector2(size.X * 0.5f, 0f).RotatedBy((double)num848, default(Vector2)), color, size, RippleShape.Square, num848); - } - Utils.PlotTileLine(projectile.Center, projectile.Center + projectile.velocity * projectile.localAI[1], (float)projectile.width * projectile.scale, new Utils.PerLinePoint(DelegateMethods.CastLight)); - return; - } - } - - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - if (projectile.velocity == Vector2.Zero) - { - return false; - } - Texture2D tex = Main.projectileTexture[projectile.type]; - float num228 = projectile.localAI[1]; - Projectile projectile2 = Main.projectile[(int)projectile.ai[1]]; - Color color = new Color(1, 1, 1, 127); - if (projectile2.ai[0] < 720f) - { - if (projectile2.ai[0] > 360f) - { - int colorValue = (int)((0.01f + (((projectile2.ai[0] - 360f) / 360f) * 2.55f)) * 100f); - color = new Color(colorValue, colorValue, colorValue, 127); - } - } - else - { - float colorLimit = projectile2.ai[0] - 720f; - if (colorLimit > 255f) - { - colorLimit = 255f; - } - switch ((int)projectile.ai[0]) //R O Y G B I V - { - case 0: - color = new Color(255, 255 - (int)colorLimit, 255 - (int)colorLimit, 127); //red - break; - case 1: - color = new Color(255, 255 - (int)(colorLimit * 0.3529412f), 255 - (int)colorLimit, 127); //orange - break; - case 2: - color = new Color(255, 255, 255 - (int)colorLimit, 127); //yellow - break; - case 3: - color = new Color(255 - (int)colorLimit, 255 - (int)(colorLimit * 0.5f), 255 - (int)colorLimit, 127); //green - break; - case 4: - color = new Color(255 - (int)colorLimit, 255 - (int)colorLimit, 255, 127); //blue - break; - case 5: - color = new Color(255 - (int)(colorLimit * 0.7058824f), 255 - (int)colorLimit, 255 - (int)(colorLimit * 0.4901961), 127); //indigo - break; - case 6: - color = new Color(255 - (int)(colorLimit * 0.0666667f), 255 - (int)(colorLimit * 0.4901961), 255 - (int)(colorLimit * 0.0666667f), 127); //violet - break; - } - } - Microsoft.Xna.Framework.Color value25 = color; - //value25.A = 0; - Vector2 value26 = projectile.Center.Floor(); - value26 += projectile.velocity * projectile.scale * 10.5f; - num228 -= projectile.scale * 14.5f * projectile.scale; - Vector2 vector29 = new Vector2(projectile.scale); - DelegateMethods.f_1 = 1f; - DelegateMethods.c_1 = value25 * 0.75f * projectile.Opacity; - Vector2 projPos = projectile.oldPos[0]; - projPos = new Vector2((float)projectile.width, (float)projectile.height) / 2f + Vector2.UnitY * projectile.gfxOffY - Main.screenPosition; - Utils.DrawLaser(Main.spriteBatch, tex, value26 - Main.screenPosition, value26 + projectile.velocity * num228 - Main.screenPosition, vector29, new Utils.LaserLineFraming(DelegateMethods.RainbowLaserDraw)); - DelegateMethods.c_1 = color * 0.75f * projectile.Opacity; - Utils.DrawLaser(Main.spriteBatch, tex, value26 - Main.screenPosition, value26 + projectile.velocity * num228 - Main.screenPosition, vector29 / 2f, new Utils.LaserLineFraming(DelegateMethods.RainbowLaserDraw)); - return false; - } - - public override void CutTiles() - { - DelegateMethods.tilecut_0 = TileCuttingContext.AttackProjectile; - Vector2 unit = projectile.velocity; - Utils.PlotTileLine(projectile.Center, projectile.Center + unit * projectile.localAI[1], (float)projectile.width * projectile.scale, new Utils.PerLinePoint(DelegateMethods.CutTiles)); - } - - public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) - { - if (projHitbox.Intersects(targetHitbox)) - { - return true; - } - float num6 = 0f; - if (Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), projectile.Center, projectile.Center + projectile.velocity * projectile.localAI[1], 22f * projectile.scale, ref num6)) - { - return true; - } - return false; - } - } +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.Enums; +using Terraria.GameContent.Shaders; +using Terraria.Graphics.Effects; + +namespace CalamityMod.Projectiles.Patreon +{ + public class DarkSparkBeam : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Beam"); + } + + public override void SetDefaults() + { + projectile.width = 18; + projectile.height = 18; + projectile.friendly = true; + projectile.magic = true; + projectile.penetrate = -1; + projectile.alpha = 255; + projectile.tileCollide = false; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 10; + } + + public override void AI() + { + Vector2? vector71 = null; + if (projectile.velocity.HasNaNs() || projectile.velocity == Vector2.Zero) + { + projectile.velocity = -Vector2.UnitY; + } + if (projectile.type != mod.ProjectileType("DarkSparkBeam") || !Main.projectile[(int)projectile.ai[1]].active || Main.projectile[(int)projectile.ai[1]].type != mod.ProjectileType("DarkSpark")) + { + projectile.Kill(); + return; + } + float num810 = (float)((int)projectile.ai[0]) - 2.5f; + Vector2 value36 = Vector2.Normalize(Main.projectile[(int)projectile.ai[1]].velocity); + Projectile projectile2 = Main.projectile[(int)projectile.ai[1]]; + float num811 = num810 * 0.5235988f; + Vector2 value37 = Vector2.Zero; + float num812; //0 to 1 + float y; //6 to 20 + float num813; //1.75 to 20 + float scaleFactor6; //-22 to -2 + Color color = new Color(1, 1, 1, 127); + projectile.Opacity = 1f; + if (projectile2.ai[0] < 720f) + { + num812 = 0f + projectile2.ai[0] / 1440f; //0 to 0.5 + y = 6f + projectile2.ai[0] / 720f * 7f; + if (projectile2.ai[0] > 360f) + { + int colorValue = (int)((0.01f + (((projectile2.ai[0] - 360f) / 360f) * 2.55f)) * 100f); + color = new Color(colorValue, colorValue, colorValue, 127); + } + if (projectile2.ai[0] < 480f) + { + num813 = 1.75f/* + 4f * (projectile2.ai[0] / 120f)*/; //20 to 16 + } + else + { + num813 = 3f + 5f * ((projectile2.ai[0] - 480f) / 240f); //7.99 to 3.01 + } + scaleFactor6 = -2f - projectile2.ai[0] / 720f * 5f; + } + else + { + float colorLimit = projectile2.ai[0] - 720f; + if (colorLimit > 255f) + { + colorLimit = 255f; + } + switch ((int)projectile.ai[0]) //R O Y G B I V + { + case 0: + color = new Color(255, 255 - (int)colorLimit, 255 - (int)colorLimit, 127); //red + break; + case 1: + color = new Color(255, 255 - (int)(colorLimit * 0.3529412f), 255 - (int)colorLimit, 127); //orange + break; + case 2: + color = new Color(255, 255, 255 - (int)colorLimit, 127); //yellow + break; + case 3: + color = new Color(255 - (int)colorLimit, 255 - (int)(colorLimit * 0.5f), 255 - (int)colorLimit, 127); //green + break; + case 4: + color = new Color(255 - (int)colorLimit, 255 - (int)colorLimit, 255, 127); //blue + break; + case 5: + color = new Color(255 - (int)(colorLimit * 0.7058824f), 255 - (int)colorLimit, 255 - (int)(colorLimit * 0.4901961), 127); //indigo + break; + case 6: + color = new Color(255 - (int)(colorLimit * 0.0666667f), 255 - (int)(colorLimit * 0.4901961), 255 - (int)(colorLimit * 0.0666667f), 127); //violet + break; + } + num812 = 0.5f; //0f, inverted + num813 = 10.875f; //1.75f, inverted + y = 13f; //6f, inverted + scaleFactor6 = -7f; //-2, inverted + } + float num814 = (projectile2.ai[0] + num810 * num813) / (num813 * 6f) * 6.28318548f; + num811 = Vector2.UnitY.RotatedBy((double)num814, default(Vector2)).Y * 0.5235988f * num812; + value37 = (Vector2.UnitY.RotatedBy((double)num814, default(Vector2)) * new Vector2(4f, y)).RotatedBy((double)projectile2.velocity.ToRotation(), default(Vector2)); + projectile.position = projectile2.Center + value36 * 16f - projectile.Size / 2f + new Vector2(0f, -Main.projectile[(int)projectile.ai[1]].gfxOffY); + projectile.position += projectile2.velocity.ToRotation().ToRotationVector2() * scaleFactor6; + projectile.position += value37; + projectile.velocity = Vector2.Normalize(projectile2.velocity).RotatedBy((double)num811, default(Vector2)); + projectile.scale = 1.5f * (1.5f - num812); + projectile.damage = projectile2.damage; + double damageMult = 1.0 + (double)(projectile2.ai[0] * 0.0015f); //1 to 2.0 (1400 * x) + if (damageMult > 2.0) + { + damageMult = 2.0; + } + if (projectile2.ai[0] >= 720f) + { + projectile.damage = (int)((double)projectile.damage * damageMult); + vector71 = new Vector2?(projectile2.Center); + } + if (!Collision.CanHitLine(Main.player[projectile.owner].Center, 0, 0, projectile2.Center, 0, 0)) + { + vector71 = new Vector2?(Main.player[projectile.owner].Center); + } + projectile.friendly = (projectile2.ai[0] > 120f); + if (projectile.velocity.HasNaNs() || projectile.velocity == Vector2.Zero) + { + projectile.velocity = -Vector2.UnitY; + } + float num818 = projectile.velocity.ToRotation(); + projectile.rotation = num818 - 1.57079637f; + projectile.velocity = num818.ToRotationVector2(); + float num819 = 2f; + float num820 = 0f; + Vector2 samplingPoint = projectile.Center; + if (vector71.HasValue) + { + samplingPoint = vector71.Value; + } + float[] array3 = new float[(int)num819]; + Collision.LaserScan(samplingPoint, projectile.velocity, num820 * projectile.scale, 2400f, array3); + float num821 = 0f; + for (int num822 = 0; num822 < array3.Length; num822++) + { + num821 += array3[num822]; + } + num821 /= num819; + float amount = 0.75f; + projectile.localAI[1] = MathHelper.Lerp(projectile.localAI[1], num821, amount); + if (Math.Abs(projectile.localAI[1] - num821) < 100f && projectile.scale > 0.15f) + { + //color.A = 0; + Vector2 vector80 = projectile.Center + projectile.velocity * (projectile.localAI[1] - 14.5f * projectile.scale); + for (int num843 = 0; num843 < 2; num843++) + { + float num844 = projectile.velocity.ToRotation() + ((Main.rand.Next(2) == 1) ? -1f : 1f) * 1.57079637f; + float num845 = (float)Main.rand.NextDouble() * 0.8f + 1f; + Vector2 vector81 = new Vector2((float)Math.Cos((double)num844) * num845, (float)Math.Sin((double)num844) * num845); + int num846 = Dust.NewDust(vector80, 0, 0, 267, vector81.X, vector81.Y, 0, color, 3.3f); //267 + Main.dust[num846].color = color; + Main.dust[num846].scale = 1.2f; + if (projectile.scale > 1f) + { + Main.dust[num846].velocity *= projectile.scale; + Main.dust[num846].scale *= projectile.scale; + } + Main.dust[num846].noGravity = true; + if (projectile.scale != 1.4f) + { + Dust dust9 = Dust.CloneDust(num846); + dust9.color = color; + dust9.scale /= 2f; + dust9.noGravity = true; + } + Main.dust[num846].color = color; + } + if (Main.rand.Next(5) == 0) + { + Vector2 value42 = projectile.velocity.RotatedBy(1.5707963705062866, default(Vector2)) * ((float)Main.rand.NextDouble() - 0.5f) * (float)projectile.width; + int num847 = Dust.NewDust(vector80 + value42 - Vector2.One * 4f, 8, 8, 267, 0f, 0f, 100, color, 5f); + Main.dust[num847].velocity *= 0.5f; + Main.dust[num847].noGravity = true; + Main.dust[num847].velocity.Y = -Math.Abs(Main.dust[num847].velocity.Y); + } + DelegateMethods.v3_1 = color.ToVector3() * 0.3f; + float value43 = 0.1f * (float)Math.Sin((double)(Main.GlobalTime * 20f)); + Vector2 size = new Vector2(projectile.velocity.Length() * projectile.localAI[1], (float)projectile.width * projectile.scale); + float num848 = projectile.velocity.ToRotation(); + if (Main.netMode != 2) + { + ((WaterShaderData)Filters.Scene["WaterDistortion"].GetShader()).QueueRipple(projectile.position + new Vector2(size.X * 0.5f, 0f).RotatedBy((double)num848, default(Vector2)), color, size, RippleShape.Square, num848); + } + Utils.PlotTileLine(projectile.Center, projectile.Center + projectile.velocity * projectile.localAI[1], (float)projectile.width * projectile.scale, new Utils.PerLinePoint(DelegateMethods.CastLight)); + return; + } + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + if (projectile.velocity == Vector2.Zero) + { + return false; + } + Texture2D tex = Main.projectileTexture[projectile.type]; + float num228 = projectile.localAI[1]; + Projectile projectile2 = Main.projectile[(int)projectile.ai[1]]; + Color color = new Color(1, 1, 1, 127); + if (projectile2.ai[0] < 720f) + { + if (projectile2.ai[0] > 360f) + { + int colorValue = (int)((0.01f + (((projectile2.ai[0] - 360f) / 360f) * 2.55f)) * 100f); + color = new Color(colorValue, colorValue, colorValue, 127); + } + } + else + { + float colorLimit = projectile2.ai[0] - 720f; + if (colorLimit > 255f) + { + colorLimit = 255f; + } + switch ((int)projectile.ai[0]) //R O Y G B I V + { + case 0: + color = new Color(255, 255 - (int)colorLimit, 255 - (int)colorLimit, 127); //red + break; + case 1: + color = new Color(255, 255 - (int)(colorLimit * 0.3529412f), 255 - (int)colorLimit, 127); //orange + break; + case 2: + color = new Color(255, 255, 255 - (int)colorLimit, 127); //yellow + break; + case 3: + color = new Color(255 - (int)colorLimit, 255 - (int)(colorLimit * 0.5f), 255 - (int)colorLimit, 127); //green + break; + case 4: + color = new Color(255 - (int)colorLimit, 255 - (int)colorLimit, 255, 127); //blue + break; + case 5: + color = new Color(255 - (int)(colorLimit * 0.7058824f), 255 - (int)colorLimit, 255 - (int)(colorLimit * 0.4901961), 127); //indigo + break; + case 6: + color = new Color(255 - (int)(colorLimit * 0.0666667f), 255 - (int)(colorLimit * 0.4901961), 255 - (int)(colorLimit * 0.0666667f), 127); //violet + break; + } + } + Microsoft.Xna.Framework.Color value25 = color; + //value25.A = 0; + Vector2 value26 = projectile.Center.Floor(); + value26 += projectile.velocity * projectile.scale * 10.5f; + num228 -= projectile.scale * 14.5f * projectile.scale; + Vector2 vector29 = new Vector2(projectile.scale); + DelegateMethods.f_1 = 1f; + DelegateMethods.c_1 = value25 * 0.75f * projectile.Opacity; + Vector2 projPos = projectile.oldPos[0]; + projPos = new Vector2((float)projectile.width, (float)projectile.height) / 2f + Vector2.UnitY * projectile.gfxOffY - Main.screenPosition; + Utils.DrawLaser(Main.spriteBatch, tex, value26 - Main.screenPosition, value26 + projectile.velocity * num228 - Main.screenPosition, vector29, new Utils.LaserLineFraming(DelegateMethods.RainbowLaserDraw)); + DelegateMethods.c_1 = color * 0.75f * projectile.Opacity; + Utils.DrawLaser(Main.spriteBatch, tex, value26 - Main.screenPosition, value26 + projectile.velocity * num228 - Main.screenPosition, vector29 / 2f, new Utils.LaserLineFraming(DelegateMethods.RainbowLaserDraw)); + return false; + } + + public override void CutTiles() + { + DelegateMethods.tilecut_0 = TileCuttingContext.AttackProjectile; + Vector2 unit = projectile.velocity; + Utils.PlotTileLine(projectile.Center, projectile.Center + unit * projectile.localAI[1], (float)projectile.width * projectile.scale, new Utils.PerLinePoint(DelegateMethods.CutTiles)); + } + + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) + { + if (projHitbox.Intersects(targetHitbox)) + { + return true; + } + float num6 = 0f; + if (Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), projectile.Center, projectile.Center + projectile.velocity * projectile.localAI[1], 22f * projectile.scale, ref num6)) + { + return true; + } + return false; + } + } } \ No newline at end of file diff --git a/Projectiles/Patreon/DivineRetribution.cs b/Projectiles/Patreon/DivineRetribution.cs index cac084805e..9bf7147a5d 100644 --- a/Projectiles/Patreon/DivineRetribution.cs +++ b/Projectiles/Patreon/DivineRetribution.cs @@ -1,149 +1,149 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Patreon -{ - public class DivineRetribution : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Divine Retribution"); - } - - public override void SetDefaults() - { - projectile.width = 30; - projectile.height = 30; - projectile.friendly = true; - projectile.ignoreWater = true; - projectile.tileCollide = false; - projectile.magic = true; - projectile.extraUpdates = 1; - projectile.penetrate = 1; - projectile.scale = 0.9f; - projectile.timeLeft = 420; - ProjectileID.Sets.TrailCacheLength[projectile.type] = 7; - ProjectileID.Sets.TrailingMode[projectile.type] = 0; - } - - public override void AI() - { - float num953 = 25f * projectile.ai[1]; //100 - float scaleFactor12 = 5f * projectile.ai[1]; //5 - float num954 = 500f; - if ((double)Math.Abs(projectile.velocity.X) > 0.2) - { - projectile.spriteDirection = -projectile.direction; - } - if (projectile.velocity.X < 0f) - { - projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X); - } - else - { - projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X); - } - Lighting.AddLight(projectile.Center, 0.7f, 0.3f, 0f); - if (Main.player[projectile.owner].active && !Main.player[projectile.owner].dead) - { - if (projectile.Distance(Main.player[projectile.owner].Center) > num954) - { - Vector2 vector102 = projectile.DirectionTo(Main.player[projectile.owner].Center); - if (vector102.HasNaNs()) - { - vector102 = Vector2.UnitY; - } - projectile.velocity = (projectile.velocity * (num953 - 1f) + vector102 * scaleFactor12) / num953; - return; - } - float num472 = projectile.Center.X; - float num473 = projectile.Center.Y; - float num474 = 600f; - bool flag17 = false; - for (int num475 = 0; num475 < 200; num475++) - { - if (Main.npc[num475].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1)) - { - float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2); - float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2); - float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477); - if (num478 < num474) - { - num474 = num478; - num472 = num476; - num473 = num477; - flag17 = true; - } - } - } - if (flag17) - { - float num483 = 9f; - Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); - float num484 = num472 - vector35.X; - float num485 = num473 - vector35.Y; - float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485)); - num486 = num483 / num486; - num484 *= num486; - num485 *= num486; - projectile.velocity.X = (projectile.velocity.X * 20f + num484) / 21f; - projectile.velocity.Y = (projectile.velocity.Y * 20f + num485) / 21f; - return; - } - } - else - { - if (projectile.timeLeft > 30) - { - projectile.timeLeft = 30; - } - } - } - - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - Vector2 drawOrigin = new Vector2(Main.projectileTexture[projectile.type].Width * 0.5f, projectile.height * 0.5f); - for (int k = 0; k < projectile.oldPos.Length; k++) - { - Vector2 drawPos = projectile.oldPos[k] - Main.screenPosition + drawOrigin + new Vector2(0f, projectile.gfxOffY); - Color color = projectile.GetAlpha(lightColor) * ((float)(projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); - spriteBatch.Draw(Main.projectileTexture[projectile.type], drawPos, null, color, projectile.rotation, drawOrigin, projectile.scale, SpriteEffects.None, 0f); - } - return true; - } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(mod.BuffType("CrushDepth"), 600); - target.AddBuff(mod.BuffType("HolyLight"), 600); - } - - public override void Kill(int timeLeft) - { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 74, 1f, 0f); - projectile.position = projectile.Center; - projectile.width = (projectile.height = 64); - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); - for (int num193 = 0; num193 < 6; num193++) - { - Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0, 0); - } - for (int num194 = 0; num194 < 10; num194++) - { - int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0, 0); - Main.dust[num195].noGravity = true; - Main.dust[num195].velocity *= 3f; - num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0, 0); - Main.dust[num195].velocity *= 2f; - Main.dust[num195].noGravity = true; - } - projectile.Damage(); - } - } +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Patreon +{ + public class DivineRetribution : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Divine Retribution"); + } + + public override void SetDefaults() + { + projectile.width = 30; + projectile.height = 30; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.tileCollide = false; + projectile.magic = true; + projectile.extraUpdates = 1; + projectile.penetrate = 1; + projectile.scale = 0.9f; + projectile.timeLeft = 420; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 7; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + } + + public override void AI() + { + float num953 = 25f * projectile.ai[1]; //100 + float scaleFactor12 = 5f * projectile.ai[1]; //5 + float num954 = 1000f; + if ((double)Math.Abs(projectile.velocity.X) > 0.2) + { + projectile.spriteDirection = -projectile.direction; + } + if (projectile.velocity.X < 0f) + { + projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X); + } + else + { + projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X); + } + Lighting.AddLight(projectile.Center, 0.7f, 0.3f, 0f); + if (Main.player[projectile.owner].active && !Main.player[projectile.owner].dead) + { + if (projectile.Distance(Main.player[projectile.owner].Center) > num954) + { + Vector2 vector102 = projectile.DirectionTo(Main.player[projectile.owner].Center); + if (vector102.HasNaNs()) + { + vector102 = Vector2.UnitY; + } + projectile.velocity = (projectile.velocity * (num953 - 1f) + vector102 * scaleFactor12) / num953; + return; + } + float num472 = projectile.Center.X; + float num473 = projectile.Center.Y; + float num474 = 600f; + bool flag17 = false; + for (int num475 = 0; num475 < 200; num475++) + { + if (Main.npc[num475].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1)) + { + float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2); + float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2); + float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477); + if (num478 < num474) + { + num474 = num478; + num472 = num476; + num473 = num477; + flag17 = true; + } + } + } + if (flag17) + { + float num483 = 9f; + Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + float num484 = num472 - vector35.X; + float num485 = num473 - vector35.Y; + float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485)); + num486 = num483 / num486; + num484 *= num486; + num485 *= num486; + projectile.velocity.X = (projectile.velocity.X * 20f + num484) / 21f; + projectile.velocity.Y = (projectile.velocity.Y * 20f + num485) / 21f; + return; + } + } + else + { + if (projectile.timeLeft > 30) + { + projectile.timeLeft = 30; + } + } + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Vector2 drawOrigin = new Vector2(Main.projectileTexture[projectile.type].Width * 0.5f, projectile.height * 0.5f); + for (int k = 0; k < projectile.oldPos.Length; k++) + { + Vector2 drawPos = projectile.oldPos[k] - Main.screenPosition + drawOrigin + new Vector2(0f, projectile.gfxOffY); + Color color = projectile.GetAlpha(lightColor) * ((float)(projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); + spriteBatch.Draw(Main.projectileTexture[projectile.type], drawPos, null, color, projectile.rotation, drawOrigin, projectile.scale, SpriteEffects.None, 0f); + } + return true; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(mod.BuffType("CrushDepth"), 600); + target.AddBuff(mod.BuffType("HolyLight"), 600); + } + + public override void Kill(int timeLeft) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 74, 1f, 0f); + projectile.position = projectile.Center; + projectile.width = (projectile.height = 64); + projectile.position.X = projectile.position.X - (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + for (int num193 = 0; num193 < 6; num193++) + { + Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0, 0); + } + for (int num194 = 0; num194 < 10; num194++) + { + int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0, 0); + Main.dust[num195].noGravity = true; + Main.dust[num195].velocity *= 3f; + num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0, 0); + Main.dust[num195].velocity *= 2f; + Main.dust[num195].noGravity = true; + } + projectile.Damage(); + } + } } \ No newline at end of file diff --git a/Projectiles/Patreon/HandheldTankShell.cs b/Projectiles/Patreon/HandheldTankShell.cs new file mode 100644 index 0000000000..0d7a98b9bf --- /dev/null +++ b/Projectiles/Patreon/HandheldTankShell.cs @@ -0,0 +1,160 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Patreon +{ + public class HandheldTankShell : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Tank Shell"); + } + + public override void SetDefaults() + { + projectile.width = 10; + projectile.height = 10; + projectile.friendly = true; + projectile.ranged = true; + projectile.penetrate = 1; + projectile.extraUpdates = 11; + projectile.timeLeft = 1800; + } + + public override void AI() + { + drawOffsetX = -8; + drawOriginOffsetY = 0; + drawOriginOffsetX = -2; + projectile.rotation = projectile.velocity.ToRotation(); + Vector2 pos = projectile.Center; + projectile.localAI[0] += 1f; + + if (projectile.localAI[0] > 7f) // projectile has had more than 8 updates, draw fire trail + { + for (int i = 0; i < 5; ++i) + { + pos -= projectile.velocity * ((float)i * 0.25f); + int idx = Dust.NewDust(pos, 1, 1, 158, 0f, 0f, 0, default(Color), 1f); + Main.dust[idx].noGravity = true; + Main.dust[idx].position = pos; + Main.dust[idx].scale = (float)Main.rand.Next(70, 110) * 0.013f; + Main.dust[idx].velocity *= 0.3f; + } + return; + } + else // projectile has had less than 8 updates, draw smoke + { + for (int i = 0; i < 30; ++i) + { + // Pick a random type of smoke (there's a little fire mixed in) + int dustID = -1; + switch (Main.rand.Next(6)) + { + case 0: dustID = 55; break; + case 1: + case 2: dustID = 54; break; + default: dustID = 53; break; + } + + // Choose a random speed and angle to belch out the smoke + float dustSpeed = Main.rand.NextFloat(3.0f, 13.0f); + float angleRandom = 0.06f; + Vector2 dustVel = new Vector2(dustSpeed, 0.0f).RotatedBy(projectile.velocity.ToRotation()); + dustVel = dustVel.RotatedBy(-angleRandom); + dustVel = dustVel.RotatedByRandom(2.0f * angleRandom); + + // Pick a size for the smoke particle + float scale = Main.rand.NextFloat(0.5f, 1.6f); + + // Actually spawn the smoke + int idx = Dust.NewDust(pos, 1, 1, dustID, dustVel.X, dustVel.Y, 0, default(Color), scale); + Main.dust[idx].noGravity = true; + Main.dust[idx].position = pos; + } + } + } + + public override void Kill(int timeLeft) + { + // Grenade Launcher + Lunar Flare sounds for maximum meaty explosion + Main.PlaySound(SoundID.Item62, projectile.Center); + Main.PlaySound(SoundID.Item88, projectile.Center); + + // Transform the projectile's hitbox into a big explosion + projectile.position = projectile.Center; + projectile.width = (projectile.height = 140); + projectile.position.X = projectile.position.X - (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + + // Spawn explosion dust (separate method because it's messy) + SpawnExplosionDust(); + + // Make the explosion cause damage to nearby targets (makes projectile hit twice) + projectile.Damage(); + } + + // Dust copied from Rocket III + void SpawnExplosionDust() + { + // Sparks and such + Vector2 corner = new Vector2(projectile.position.X, projectile.position.Y); + for (int i = 0; i < 40; i++) + { + int idx = Dust.NewDust(corner, projectile.width, projectile.height, 31, 0f, 0f, 100, default(Color), 2f); + Main.dust[idx].velocity *= 3f; + if (Main.rand.Next(2) == 0) + { + Main.dust[idx].scale = 0.5f; + Main.dust[idx].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + } + } + for (int i = 0; i < 70; i++) + { + int idx = Dust.NewDust(corner, projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 3f); + Main.dust[idx].noGravity = true; + Main.dust[idx].velocity *= 5f; + idx = Dust.NewDust(corner, projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 2f); + Main.dust[idx].velocity *= 2f; + } + + // Smoke, which counts as a Gore + Vector2 goreVec = new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f); + for (int i = 0; i < 3; i++) + { + float smokeScale = 0.33f; + if (i == 1) + { + smokeScale = 0.66f; + } + if (i == 2) + { + smokeScale = 1f; + } + int idx = Gore.NewGore(goreVec, default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[idx].velocity *= smokeScale; + Main.gore[idx].velocity.X += 1f; + Main.gore[idx].velocity.Y += 1f; + + idx = Gore.NewGore(goreVec, default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[idx].velocity *= smokeScale; + Main.gore[idx].velocity.X -= 1f; + Main.gore[idx].velocity.Y += 1f; + + idx = Gore.NewGore(goreVec, default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[idx].velocity *= smokeScale; + Main.gore[idx].velocity.X += 1f; + Main.gore[idx].velocity.Y -= 1f; + + idx = Gore.NewGore(goreVec, default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[idx].velocity *= smokeScale; + Main.gore[idx].velocity.X -= 1f; + Main.gore[idx].velocity.Y -= 1f; + } + } + } +} diff --git a/Projectiles/Patreon/HandheldTankShell.png b/Projectiles/Patreon/HandheldTankShell.png new file mode 100644 index 0000000000..e098995495 Binary files /dev/null and b/Projectiles/Patreon/HandheldTankShell.png differ diff --git a/Projectiles/Patreon/KeelhaulBubble.cs b/Projectiles/Patreon/KeelhaulBubble.cs new file mode 100644 index 0000000000..0a6957e311 --- /dev/null +++ b/Projectiles/Patreon/KeelhaulBubble.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Patreon +{ + public class KeelhaulBubble : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bubble"); + } + + public override void SetDefaults() + { + projectile.width = 14; + projectile.height = 14; + projectile.friendly = true; + projectile.penetrate = 1; + projectile.timeLeft = 300; + } + + public override void Kill(int timeLeft) + { + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y - 80f, 0f, 0f, mod.ProjectileType("KeelhaulGeyserBottom"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y - 80f, 0f, 0f, mod.ProjectileType("KeelhaulGeyserTop"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); + } + } +} \ No newline at end of file diff --git a/Projectiles/Patreon/KeelhaulBubble.png b/Projectiles/Patreon/KeelhaulBubble.png new file mode 100644 index 0000000000..b90ce569f4 Binary files /dev/null and b/Projectiles/Patreon/KeelhaulBubble.png differ diff --git a/Projectiles/Patreon/KeelhaulGeyserBottom.cs b/Projectiles/Patreon/KeelhaulGeyserBottom.cs new file mode 100644 index 0000000000..1eb1d174cb --- /dev/null +++ b/Projectiles/Patreon/KeelhaulGeyserBottom.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Patreon +{ + public class KeelhaulGeyserBottom : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Geyser"); + Main.projFrames[projectile.type] = 4; + } + + public override void SetDefaults() + { + projectile.width = 158; + projectile.height = 188; + projectile.friendly = true; + projectile.tileCollide = false; + projectile.ignoreWater = true; + projectile.magic = true; + projectile.penetrate = -1; + projectile.timeLeft = 360; + projectile.alpha = 90; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 10; + } + + public override void AI() + { + projectile.frameCounter++; + if (projectile.frameCounter > 6) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame > 3) + { + projectile.frame = 0; + } + } + } +} \ No newline at end of file diff --git a/Projectiles/Patreon/KeelhaulGeyserBottom.png b/Projectiles/Patreon/KeelhaulGeyserBottom.png new file mode 100644 index 0000000000..aece49f0b5 Binary files /dev/null and b/Projectiles/Patreon/KeelhaulGeyserBottom.png differ diff --git a/Projectiles/Patreon/KeelhaulGeyserTop.cs b/Projectiles/Patreon/KeelhaulGeyserTop.cs new file mode 100644 index 0000000000..e0af95ed19 --- /dev/null +++ b/Projectiles/Patreon/KeelhaulGeyserTop.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Patreon +{ + public class KeelhaulGeyserTop : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Geyser"); + Main.projFrames[projectile.type] = 4; + } + + public override void SetDefaults() + { + projectile.width = 158; + projectile.height = 188; + projectile.friendly = true; + projectile.tileCollide = false; + projectile.ignoreWater = true; + projectile.magic = true; + projectile.penetrate = -1; + projectile.timeLeft = 360; + projectile.alpha = 90; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 20; + } + + public override void AI() + { + projectile.frameCounter++; + if (projectile.frameCounter > 6) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame > 3) + { + projectile.frame = 0; + } + } + } +} \ No newline at end of file diff --git a/Projectiles/Patreon/KeelhaulGeyserTop.png b/Projectiles/Patreon/KeelhaulGeyserTop.png new file mode 100644 index 0000000000..0499587fef Binary files /dev/null and b/Projectiles/Patreon/KeelhaulGeyserTop.png differ diff --git a/Projectiles/Patreon/LightBall.cs b/Projectiles/Patreon/LightBall.cs index 15966f6dce..1b4b3cdd24 100644 --- a/Projectiles/Patreon/LightBall.cs +++ b/Projectiles/Patreon/LightBall.cs @@ -1,66 +1,66 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Patreon -{ - public class LightBall : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Light Ball"); - } - - public override void SetDefaults() - { - projectile.width = 28; - projectile.height = 28; - projectile.friendly = true; - projectile.alpha = 60; - projectile.penetrate = 1; - projectile.timeLeft = 300; - projectile.magic = true; - } - - public override void AI() - { - Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0.5f) / 255f, ((255 - projectile.alpha) * 0.5f) / 255f, ((255 - projectile.alpha) * 0.5f) / 255f); - projectile.velocity.X *= 0.995f; - projectile.velocity.Y *= 0.995f; - Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 212, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); - } - - public override void Kill(int timeLeft) - { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); - projectile.position.X = projectile.position.X + (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); - projectile.width = 300; - projectile.height = 300; - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, mod.ProjectileType("LightBallExplosion"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); - for (int num621 = 0; num621 < 30; num621++) - { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 212, 0f, 0f, 100, default(Color), 1.2f); - Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) - { - Main.dust[num622].scale = 0.5f; - Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; - } - } - for (int num623 = 0; num623 < 60; num623++) - { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 212, 0f, 0f, 100, default(Color), 1.7f); - Main.dust[num624].noGravity = true; - Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 212, 0f, 0f, 100, default(Color), 1f); - Main.dust[num624].velocity *= 2f; - } - } - } +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Patreon +{ + public class LightBall : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Light Ball"); + } + + public override void SetDefaults() + { + projectile.width = 28; + projectile.height = 28; + projectile.friendly = true; + projectile.alpha = 60; + projectile.penetrate = 1; + projectile.timeLeft = 300; + projectile.magic = true; + } + + public override void AI() + { + Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0.5f) / 255f, ((255 - projectile.alpha) * 0.5f) / 255f, ((255 - projectile.alpha) * 0.5f) / 255f); + projectile.velocity.X *= 0.995f; + projectile.velocity.Y *= 0.995f; + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 212, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); + } + + public override void Kill(int timeLeft) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + projectile.position.X = projectile.position.X + (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); + projectile.width = 300; + projectile.height = 300; + projectile.position.X = projectile.position.X - (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, mod.ProjectileType("LightBallExplosion"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); + for (int num621 = 0; num621 < 30; num621++) + { + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 212, 0f, 0f, 100, default(Color), 1.2f); + Main.dust[num622].velocity *= 3f; + if (Main.rand.Next(2) == 0) + { + Main.dust[num622].scale = 0.5f; + Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + } + } + for (int num623 = 0; num623 < 60; num623++) + { + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 212, 0f, 0f, 100, default(Color), 1.7f); + Main.dust[num624].noGravity = true; + Main.dust[num624].velocity *= 5f; + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 212, 0f, 0f, 100, default(Color), 1f); + Main.dust[num624].velocity *= 2f; + } + } + } } \ No newline at end of file diff --git a/Projectiles/Patreon/LightBallExplosion.cs b/Projectiles/Patreon/LightBallExplosion.cs index 9eef246e6d..3872d0eaae 100644 --- a/Projectiles/Patreon/LightBallExplosion.cs +++ b/Projectiles/Patreon/LightBallExplosion.cs @@ -1,30 +1,30 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Patreon -{ - public class LightBallExplosion : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Explosion"); - } - - public override void SetDefaults() - { - projectile.width = 300; - projectile.height = 300; - projectile.friendly = true; - projectile.ignoreWater = true; - projectile.tileCollide = false; - projectile.penetrate = -1; - projectile.timeLeft = 5; - projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 3; - } - } +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Patreon +{ + public class LightBallExplosion : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Explosion"); + } + + public override void SetDefaults() + { + projectile.width = 300; + projectile.height = 300; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.tileCollide = false; + projectile.penetrate = -1; + projectile.timeLeft = 5; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 3; + } + } } \ No newline at end of file diff --git a/Projectiles/Patreon/LightBead.cs b/Projectiles/Patreon/LightBead.cs index 76a42c4eb6..7851c9a16c 100644 --- a/Projectiles/Patreon/LightBead.cs +++ b/Projectiles/Patreon/LightBead.cs @@ -1,110 +1,110 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Patreon -{ - public class LightBead : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Light Bead"); - } - - public override void SetDefaults() - { - projectile.width = 8; - projectile.height = 8; - projectile.friendly = true; - projectile.alpha = 50; - projectile.scale = 1.2f; - projectile.penetrate = 1; - projectile.timeLeft = 600; - projectile.magic = true; - } - - public override void AI() - { - Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0.5f) / 255f, ((255 - projectile.alpha) * 0.5f) / 255f, ((255 - projectile.alpha) * 0.5f) / 255f); - projectile.rotation += projectile.velocity.X * 0.2f; - projectile.ai[1] += 1f; - if (Main.rand.Next(4) == 0) - { - int num300 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 212, 0f, 0f, 0, default(Color), 1f); - Main.dust[num300].noGravity = true; - Main.dust[num300].velocity *= 0.5f; - Main.dust[num300].scale *= 0.9f; - } - if (projectile.ai[1] > 300f) - { - projectile.scale -= 0.05f; - if ((double)projectile.scale <= 0.2) - { - projectile.scale = 0.2f; - projectile.Kill(); - return; - } - } - float centerX = projectile.Center.X; - float centerY = projectile.Center.Y; - float num474 = 500f; - bool homeIn = false; - for (int num475 = 0; num475 < 200; num475++) - { - if (Main.npc[num475].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1)) - { - float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2); - float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2); - float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477); - if (num478 < num474) - { - num474 = num478; - centerX = num476; - centerY = num477; - homeIn = true; - } - } - } - if (homeIn) - { - float num483 = 18f; - Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); - float num484 = centerX - vector35.X; - float num485 = centerY - vector35.Y; - float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485)); - num486 = num483 / num486; - num484 *= num486; - num485 *= num486; - projectile.velocity.X = (projectile.velocity.X * 10f + num484) / 11f; - projectile.velocity.Y = (projectile.velocity.Y * 10f + num485) / 11f; - return; - } - } - - public override void Kill(int timeLeft) - { - for (int k = 0; k < 5; k++) - { - Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 212, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); - } - int num251 = Main.rand.Next(2, 3); - if (projectile.owner == Main.myPlayer) - { - for (int num252 = 0; num252 < num251; num252++) - { - Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - while (value15.X == 0f && value15.Y == 0f) - { - value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - } - value15.Normalize(); - value15 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), value15.X, value15.Y, mod.ProjectileType("LightBeadSplit"), (int)((double)projectile.damage * 0.5), 0f, projectile.owner, 0f, 0f); - } - } - } - } +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Patreon +{ + public class LightBead : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Light Bead"); + } + + public override void SetDefaults() + { + projectile.width = 8; + projectile.height = 8; + projectile.friendly = true; + projectile.alpha = 50; + projectile.scale = 1.2f; + projectile.penetrate = 1; + projectile.timeLeft = 600; + projectile.magic = true; + } + + public override void AI() + { + Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0.5f) / 255f, ((255 - projectile.alpha) * 0.5f) / 255f, ((255 - projectile.alpha) * 0.5f) / 255f); + projectile.rotation += projectile.velocity.X * 0.2f; + projectile.ai[1] += 1f; + if (Main.rand.Next(4) == 0) + { + int num300 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 212, 0f, 0f, 0, default(Color), 1f); + Main.dust[num300].noGravity = true; + Main.dust[num300].velocity *= 0.5f; + Main.dust[num300].scale *= 0.9f; + } + if (projectile.ai[1] > 300f) + { + projectile.scale -= 0.05f; + if ((double)projectile.scale <= 0.2) + { + projectile.scale = 0.2f; + projectile.Kill(); + return; + } + } + float centerX = projectile.Center.X; + float centerY = projectile.Center.Y; + float num474 = 500f; + bool homeIn = false; + for (int num475 = 0; num475 < 200; num475++) + { + if (Main.npc[num475].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1)) + { + float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2); + float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2); + float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477); + if (num478 < num474) + { + num474 = num478; + centerX = num476; + centerY = num477; + homeIn = true; + } + } + } + if (homeIn) + { + float num483 = 18f; + Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + float num484 = centerX - vector35.X; + float num485 = centerY - vector35.Y; + float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485)); + num486 = num483 / num486; + num484 *= num486; + num485 *= num486; + projectile.velocity.X = (projectile.velocity.X * 10f + num484) / 11f; + projectile.velocity.Y = (projectile.velocity.Y * 10f + num485) / 11f; + return; + } + } + + public override void Kill(int timeLeft) + { + for (int k = 0; k < 5; k++) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 212, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); + } + int num251 = Main.rand.Next(2, 3); + if (projectile.owner == Main.myPlayer) + { + for (int num252 = 0; num252 < num251; num252++) + { + Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + while (value15.X == 0f && value15.Y == 0f) + { + value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + } + value15.Normalize(); + value15 *= (float)Main.rand.Next(70, 101) * 0.1f; + Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), value15.X, value15.Y, mod.ProjectileType("LightBeadSplit"), (int)((double)projectile.damage * 0.5), 0f, projectile.owner, 0f, 0f); + } + } + } + } } \ No newline at end of file diff --git a/Projectiles/Patreon/LightBeadSplit.cs b/Projectiles/Patreon/LightBeadSplit.cs index 1ee869f9b2..2f138c31b5 100644 --- a/Projectiles/Patreon/LightBeadSplit.cs +++ b/Projectiles/Patreon/LightBeadSplit.cs @@ -1,45 +1,45 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Patreon -{ - public class LightBeadSplit : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Light Bead"); - } - - public override void SetDefaults() - { - projectile.width = 8; - projectile.height = 8; - projectile.friendly = true; - projectile.alpha = 50; - projectile.scale = 0.6f; - projectile.penetrate = 1; - projectile.timeLeft = 400; - projectile.magic = true; - } - - public override void AI() - { - Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0.5f) / 255f, ((255 - projectile.alpha) * 0.5f) / 255f, ((255 - projectile.alpha) * 0.5f) / 255f); - projectile.rotation += projectile.velocity.X * 0.2f; - projectile.velocity *= 0.985f; - - } - - public override void Kill(int timeLeft) - { - for (int k = 0; k < 5; k++) - { - Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 212, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); - } - } - } +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Patreon +{ + public class LightBeadSplit : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Light Bead"); + } + + public override void SetDefaults() + { + projectile.width = 8; + projectile.height = 8; + projectile.friendly = true; + projectile.alpha = 50; + projectile.scale = 0.6f; + projectile.penetrate = 1; + projectile.timeLeft = 400; + projectile.magic = true; + } + + public override void AI() + { + Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0.5f) / 255f, ((255 - projectile.alpha) * 0.5f) / 255f, ((255 - projectile.alpha) * 0.5f) / 255f); + projectile.rotation += projectile.velocity.X * 0.2f; + projectile.velocity *= 0.985f; + + } + + public override void Kill(int timeLeft) + { + for (int k = 0; k < 5; k++) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 212, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); + } + } + } } \ No newline at end of file diff --git a/Projectiles/Patreon/MelterAmp.cs b/Projectiles/Patreon/MelterAmp.cs new file mode 100644 index 0000000000..13fce042e2 --- /dev/null +++ b/Projectiles/Patreon/MelterAmp.cs @@ -0,0 +1,117 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Patreon +{ + public class MelterAmp : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Melter Amp"); + Main.projFrames[projectile.type] = 3; + } + + public override void SetDefaults() + { + projectile.width = 34; + projectile.height = 38; + projectile.friendly = true; + projectile.magic = true; + projectile.netImportant = true; + projectile.penetrate = -1; + projectile.timeLeft = 6000; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 20; + projectile.tileCollide = false; + projectile.ignoreWater = true; + } + + public override void AI() + { + bool flag64 = projectile.type == mod.ProjectileType("MelterAmp"); + Player player = Main.player[projectile.owner]; + if (flag64) + { + if (player.dead) + { + projectile.active = false; + return; + } + if (player.ownedProjectileCounts[mod.ProjectileType("MelterAmp")] > 1) + { + projectile.active = false; + return; + } + if (!player.inventory[player.selectedItem].magic || player.inventory[player.selectedItem].shoot != mod.ProjectileType("MelterNote1")) + { + projectile.active = false; + return; + } + } + Lighting.AddLight(projectile.Center, 0.75f, 0.75f, 0.75f); + if (projectile.ai[0] > 0f) + { + projectile.ai[0] += 1f; + if (projectile.ai[0] > 6f) + { + projectile.ai[0] = 0f; + } + } + if (Main.myPlayer == projectile.owner && projectile.ai[0] == 0f) + { + projectile.ai[0] = 1f; + int Damage = projectile.damage; + int type; + projectile.netUpdate = true; + float num127 = 20f; + Vector2 vector11 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + float num128 = (float)Main.mouseX + Main.screenPosition.X - vector11.X; + float num129 = (float)Main.mouseY + Main.screenPosition.Y - vector11.Y; + if (player.gravDir == -1f) + { + num129 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector11.Y; + } + float num130 = (float)Math.Sqrt((double)(num128 * num128 + num129 * num129)); + if (num130 == 0f) + { + vector11 = new Vector2(player.position.X + (float)(player.width / 2), player.position.Y + (float)(player.height / 2)); + num128 = projectile.position.X + (float)projectile.width * 0.5f - vector11.X; + num129 = projectile.position.Y + (float)projectile.height * 0.5f - vector11.Y; + num130 = (float)Math.Sqrt((double)(num128 * num128 + num129 * num129)); + } + num130 = num127 / num130; + num128 *= num130; + num129 *= num130; + float VelocityX = num128; + float VelocityY = num129; + int note = Main.rand.Next(0, 2); + if (note == 0) + { + Damage = (int)(projectile.damage * 1.5f); + type = mod.ProjectileType("MelterNote1"); + } + else + { + VelocityX *= 1.5f; + VelocityY *= 1.5f; + type = mod.ProjectileType("MelterNote2"); + } + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, VelocityX, VelocityY, type, Damage, projectile.knockBack, projectile.owner, 0.0f, 0.0f); + } + projectile.frameCounter++; + if (projectile.frameCounter > 5) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame > 2) + { + projectile.frame = 0; + } + } + } +} \ No newline at end of file diff --git a/Projectiles/Patreon/MelterAmp.png b/Projectiles/Patreon/MelterAmp.png new file mode 100644 index 0000000000..785a28e3ab Binary files /dev/null and b/Projectiles/Patreon/MelterAmp.png differ diff --git a/Projectiles/Patreon/MelterNote1.cs b/Projectiles/Patreon/MelterNote1.cs new file mode 100644 index 0000000000..b228dc9622 --- /dev/null +++ b/Projectiles/Patreon/MelterNote1.cs @@ -0,0 +1,58 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Patreon +{ + public class MelterNote1 : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Song"); + } + + public override void SetDefaults() + { + projectile.width = 24; + projectile.height = 24; + projectile.friendly = true; + projectile.magic = true; + projectile.penetrate = 10; + projectile.timeLeft = 600; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 5; + projectile.tileCollide = false; + projectile.ignoreWater = true; + } + + public override void AI() + { + projectile.velocity.X *= 0.985f; + projectile.velocity.Y *= 0.985f; + if (projectile.localAI[0] == 0f) + { + projectile.scale += 0.02f; + if (projectile.scale >= 1.25f) + { + projectile.localAI[0] = 1f; + } + } + else if (projectile.localAI[0] == 1f) + { + projectile.scale -= 0.02f; + if (projectile.scale <= 0.75f) + { + projectile.localAI[0] = 0f; + } + } + } + + public override Color? GetAlpha(Color lightColor) + { + return new Color(255, 255, 255); + } + } +} \ No newline at end of file diff --git a/Projectiles/Patreon/MelterNote1.png b/Projectiles/Patreon/MelterNote1.png new file mode 100644 index 0000000000..fb2a8baf87 Binary files /dev/null and b/Projectiles/Patreon/MelterNote1.png differ diff --git a/Projectiles/Patreon/MelterNote2.cs b/Projectiles/Patreon/MelterNote2.cs new file mode 100644 index 0000000000..0e60ddb766 --- /dev/null +++ b/Projectiles/Patreon/MelterNote2.cs @@ -0,0 +1,58 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Patreon +{ + public class MelterNote2 : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Song"); + } + + public override void SetDefaults() + { + projectile.width = 16; + projectile.height = 24; + projectile.friendly = true; + projectile.magic = true; + projectile.penetrate = 10; + projectile.timeLeft = 600; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 7; + projectile.tileCollide = false; + projectile.ignoreWater = true; + } + + public override void AI() + { + projectile.velocity.X *= 0.99f; + projectile.velocity.Y *= 0.99f; + if (projectile.localAI[0] == 0f) + { + projectile.scale += 0.02f; + if (projectile.scale >= 1.25f) + { + projectile.localAI[0] = 1f; + } + } + else if (projectile.localAI[0] == 1f) + { + projectile.scale -= 0.02f; + if (projectile.scale <= 0.75f) + { + projectile.localAI[0] = 0f; + } + } + } + + public override Color? GetAlpha(Color lightColor) + { + return new Color(255, 255, 255); + } + } +} \ No newline at end of file diff --git a/Projectiles/Patreon/MelterNote2.png b/Projectiles/Patreon/MelterNote2.png new file mode 100644 index 0000000000..c5410f1134 Binary files /dev/null and b/Projectiles/Patreon/MelterNote2.png differ diff --git a/Projectiles/Patreon/MiniGuardianAttack.cs b/Projectiles/Patreon/MiniGuardianAttack.cs index 948a85701d..4210eb87c4 100644 --- a/Projectiles/Patreon/MiniGuardianAttack.cs +++ b/Projectiles/Patreon/MiniGuardianAttack.cs @@ -1,247 +1,247 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.Localization; -using Terraria.ID; -using Terraria.DataStructures; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Patreon -{ - public class MiniGuardianAttack : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Offensive Guardian"); - Main.projFrames[projectile.type] = 4; - ProjectileID.Sets.MinionSacrificable[projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true; - } - - public override void SetDefaults() - { - projectile.netImportant = true; - projectile.tileCollide = false; - projectile.width = 60; - projectile.height = 88; - projectile.minionSlots = 0f; - projectile.minion = true; - projectile.friendly = true; - projectile.penetrate = -1; - projectile.timeLeft = 18000; - projectile.timeLeft *= 5; - projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 6; - } - - public override void AI() - { - Player player = Main.player[projectile.owner]; - CalamityPlayer modPlayer = player.GetModPlayer(mod); - if (player.dead) - { - modPlayer.gOffense = false; - } - if (modPlayer.gOffense) - { - projectile.timeLeft = 2; - } - if (!modPlayer.pArtifact || (!modPlayer.tarraSummon && !modPlayer.bloodflareSummon && - !modPlayer.godSlayerSummon && !modPlayer.silvaSummon && !modPlayer.dsSetBonus && !modPlayer.omegaBlueSet)) - { - projectile.active = false; - return; - } - float num535 = projectile.position.X; - float num536 = projectile.position.Y; - float num537 = 3000f; - bool flag19 = false; - NPC ownerMinionAttackTargetNPC2 = projectile.OwnerMinionAttackTargetNPC; - if (ownerMinionAttackTargetNPC2 != null && ownerMinionAttackTargetNPC2.CanBeChasedBy(projectile, false)) - { - float num539 = ownerMinionAttackTargetNPC2.position.X + (float)(ownerMinionAttackTargetNPC2.width / 2); - float num540 = ownerMinionAttackTargetNPC2.position.Y + (float)(ownerMinionAttackTargetNPC2.height / 2); - float num541 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num539) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num540); - if (num541 < num537) - { - num537 = num541; - num535 = num539; - num536 = num540; - flag19 = true; - } - } - if (!flag19) - { - int num3; - for (int num542 = 0; num542 < 200; num542 = num3 + 1) - { - if (Main.npc[num542].CanBeChasedBy(projectile, false)) - { - float num543 = Main.npc[num542].position.X + (float)(Main.npc[num542].width / 2); - float num544 = Main.npc[num542].position.Y + (float)(Main.npc[num542].height / 2); - float num545 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num543) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num544); - if (num545 < num537) - { - num537 = num545; - num535 = num543; - num536 = num544; - flag19 = true; - } - } - num3 = num542; - } - } - if (!flag19) - { - float num16 = 0.5f; - projectile.tileCollide = false; - int num17 = 100; - Vector2 vector3 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); - float num18 = Main.player[projectile.owner].position.X + (float)(Main.player[projectile.owner].width / 2) - vector3.X; - float num19 = Main.player[projectile.owner].position.Y + (float)(Main.player[projectile.owner].height / 2) - vector3.Y; - num19 += (float)Main.rand.Next(-10, 21); - num18 += (float)Main.rand.Next(-10, 21); - num18 += (float)(60 * -(float)Main.player[projectile.owner].direction); - num19 -= 60f; - float num20 = (float)Math.Sqrt((double)(num18 * num18 + num19 * num19)); - float num21 = 18f; - - if (num20 < (float)num17 && Main.player[projectile.owner].velocity.Y == 0f && - projectile.position.Y + (float)projectile.height <= Main.player[projectile.owner].position.Y + (float)Main.player[projectile.owner].height && - !Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) - { - projectile.ai[0] = 0f; - if (projectile.velocity.Y < -6f) - { - projectile.velocity.Y = -6f; - } - } - if (num20 > 2000f) - { - projectile.position.X = Main.player[projectile.owner].Center.X - (float)(projectile.width / 2); - projectile.position.Y = Main.player[projectile.owner].Center.Y - (float)(projectile.height / 2); - projectile.netUpdate = true; - } - if (num20 < 50f) - { - if (Math.Abs(projectile.velocity.X) > 2f || Math.Abs(projectile.velocity.Y) > 2f) - { - projectile.velocity *= 0.90f; - } - num16 = 0.01f; - } - else - { - if (num20 < 100f) - { - num16 = 0.1f; - } - if (num20 > 300f) - { - num16 = 1f; - } - num20 = num21 / num20; - num18 *= num20; - num19 *= num20; - } - - if (projectile.velocity.X < num18) - { - projectile.velocity.X = projectile.velocity.X + num16; - if (num16 > 0.05f && projectile.velocity.X < 0f) - { - projectile.velocity.X = projectile.velocity.X + num16; - } - } - if (projectile.velocity.X > num18) - { - projectile.velocity.X = projectile.velocity.X - num16; - if (num16 > 0.05f && projectile.velocity.X > 0f) - { - projectile.velocity.X = projectile.velocity.X - num16; - } - } - if (projectile.velocity.Y < num19) - { - projectile.velocity.Y = projectile.velocity.Y + num16; - if (num16 > 0.05f && projectile.velocity.Y < 0f) - { - projectile.velocity.Y = projectile.velocity.Y + num16 * 2f; - } - } - if (projectile.velocity.Y > num19) - { - projectile.velocity.Y = projectile.velocity.Y - num16; - if (num16 > 0.05f && projectile.velocity.Y > 0f) - { - projectile.velocity.Y = projectile.velocity.Y - num16 * 2f; - } - } - } - else - { - if (projectile.ai[1] == -1f) - { - projectile.ai[1] = 17f; - } - if (projectile.ai[1] > 0f) - { - projectile.ai[1] -= 1f; - } - if (projectile.ai[1] == 0f) - { - float num550 = 24f; //12 - Vector2 vector43 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); - float num551 = num535 - vector43.X; - float num552 = num536 - vector43.Y; - float num553 = (float)Math.Sqrt((double)(num551 * num551 + num552 * num552)); - if (num553 < 100f) - { - num550 = 28f; //14 - } - if (modPlayer.gDefense) - { - num550 *= 0.95f; - } - num553 = num550 / num553; - num551 *= num553; - num552 *= num553; - projectile.velocity.X = (projectile.velocity.X * 14f + num551) / 15f; - projectile.velocity.Y = (projectile.velocity.Y * 14f + num552) / 15f; - } - else - { - if (Math.Abs(projectile.velocity.X) + Math.Abs(projectile.velocity.Y) < 10f) - { - projectile.velocity *= 1.05f; - } - } - } - if ((double)projectile.velocity.X > 0.25) - { - projectile.direction = -1; - } - else if ((double)projectile.velocity.X < -0.25) - { - projectile.direction = 1; - } - - if ((double)Math.Abs(projectile.velocity.X) > 0.2) - { - projectile.spriteDirection = -projectile.direction; - } - - projectile.frameCounter++; - if (projectile.frameCounter > 5) - { - projectile.frame++; - projectile.frameCounter = 0; - } - if (projectile.frame > 3) - { - projectile.frame = 0; - } - } - } +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.Localization; +using Terraria.ID; +using Terraria.DataStructures; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Patreon +{ + public class MiniGuardianAttack : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Offensive Guardian"); + Main.projFrames[projectile.type] = 4; + ProjectileID.Sets.MinionSacrificable[projectile.type] = true; + ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true; + } + + public override void SetDefaults() + { + projectile.netImportant = true; + projectile.tileCollide = false; + projectile.width = 60; + projectile.height = 88; + projectile.minionSlots = 0f; + projectile.minion = true; + projectile.friendly = true; + projectile.penetrate = -1; + projectile.timeLeft = 18000; + projectile.timeLeft *= 5; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 6; + } + + public override void AI() + { + Player player = Main.player[projectile.owner]; + CalamityPlayer modPlayer = player.GetModPlayer(mod); + if (player.dead) + { + modPlayer.gOffense = false; + } + if (modPlayer.gOffense) + { + projectile.timeLeft = 2; + } + if (!modPlayer.pArtifact || (!modPlayer.tarraSummon && !modPlayer.bloodflareSummon && + !modPlayer.godSlayerSummon && !modPlayer.silvaSummon && !modPlayer.dsSetBonus && !modPlayer.omegaBlueSet)) + { + projectile.active = false; + return; + } + float num535 = projectile.position.X; + float num536 = projectile.position.Y; + float num537 = 3000f; + bool flag19 = false; + NPC ownerMinionAttackTargetNPC2 = projectile.OwnerMinionAttackTargetNPC; + if (ownerMinionAttackTargetNPC2 != null && ownerMinionAttackTargetNPC2.CanBeChasedBy(projectile, false)) + { + float num539 = ownerMinionAttackTargetNPC2.position.X + (float)(ownerMinionAttackTargetNPC2.width / 2); + float num540 = ownerMinionAttackTargetNPC2.position.Y + (float)(ownerMinionAttackTargetNPC2.height / 2); + float num541 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num539) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num540); + if (num541 < num537) + { + num537 = num541; + num535 = num539; + num536 = num540; + flag19 = true; + } + } + if (!flag19) + { + int num3; + for (int num542 = 0; num542 < 200; num542 = num3 + 1) + { + if (Main.npc[num542].CanBeChasedBy(projectile, false)) + { + float num543 = Main.npc[num542].position.X + (float)(Main.npc[num542].width / 2); + float num544 = Main.npc[num542].position.Y + (float)(Main.npc[num542].height / 2); + float num545 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num543) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num544); + if (num545 < num537) + { + num537 = num545; + num535 = num543; + num536 = num544; + flag19 = true; + } + } + num3 = num542; + } + } + if (!flag19) + { + float num16 = 0.5f; + projectile.tileCollide = false; + int num17 = 100; + Vector2 vector3 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + float num18 = Main.player[projectile.owner].position.X + (float)(Main.player[projectile.owner].width / 2) - vector3.X; + float num19 = Main.player[projectile.owner].position.Y + (float)(Main.player[projectile.owner].height / 2) - vector3.Y; + num19 += (float)Main.rand.Next(-10, 21); + num18 += (float)Main.rand.Next(-10, 21); + num18 += (float)(60 * -(float)Main.player[projectile.owner].direction); + num19 -= 60f; + float num20 = (float)Math.Sqrt((double)(num18 * num18 + num19 * num19)); + float num21 = 18f; + + if (num20 < (float)num17 && Main.player[projectile.owner].velocity.Y == 0f && + projectile.position.Y + (float)projectile.height <= Main.player[projectile.owner].position.Y + (float)Main.player[projectile.owner].height && + !Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) + { + projectile.ai[0] = 0f; + if (projectile.velocity.Y < -6f) + { + projectile.velocity.Y = -6f; + } + } + if (num20 > 2000f) + { + projectile.position.X = Main.player[projectile.owner].Center.X - (float)(projectile.width / 2); + projectile.position.Y = Main.player[projectile.owner].Center.Y - (float)(projectile.height / 2); + projectile.netUpdate = true; + } + if (num20 < 50f) + { + if (Math.Abs(projectile.velocity.X) > 2f || Math.Abs(projectile.velocity.Y) > 2f) + { + projectile.velocity *= 0.90f; + } + num16 = 0.01f; + } + else + { + if (num20 < 100f) + { + num16 = 0.1f; + } + if (num20 > 300f) + { + num16 = 1f; + } + num20 = num21 / num20; + num18 *= num20; + num19 *= num20; + } + + if (projectile.velocity.X < num18) + { + projectile.velocity.X = projectile.velocity.X + num16; + if (num16 > 0.05f && projectile.velocity.X < 0f) + { + projectile.velocity.X = projectile.velocity.X + num16; + } + } + if (projectile.velocity.X > num18) + { + projectile.velocity.X = projectile.velocity.X - num16; + if (num16 > 0.05f && projectile.velocity.X > 0f) + { + projectile.velocity.X = projectile.velocity.X - num16; + } + } + if (projectile.velocity.Y < num19) + { + projectile.velocity.Y = projectile.velocity.Y + num16; + if (num16 > 0.05f && projectile.velocity.Y < 0f) + { + projectile.velocity.Y = projectile.velocity.Y + num16 * 2f; + } + } + if (projectile.velocity.Y > num19) + { + projectile.velocity.Y = projectile.velocity.Y - num16; + if (num16 > 0.05f && projectile.velocity.Y > 0f) + { + projectile.velocity.Y = projectile.velocity.Y - num16 * 2f; + } + } + } + else + { + if (projectile.ai[1] == -1f) + { + projectile.ai[1] = 17f; + } + if (projectile.ai[1] > 0f) + { + projectile.ai[1] -= 1f; + } + if (projectile.ai[1] == 0f) + { + float num550 = 24f; //12 + Vector2 vector43 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + float num551 = num535 - vector43.X; + float num552 = num536 - vector43.Y; + float num553 = (float)Math.Sqrt((double)(num551 * num551 + num552 * num552)); + if (num553 < 100f) + { + num550 = 28f; //14 + } + if (modPlayer.gDefense) + { + num550 *= 0.95f; + } + num553 = num550 / num553; + num551 *= num553; + num552 *= num553; + projectile.velocity.X = (projectile.velocity.X * 14f + num551) / 15f; + projectile.velocity.Y = (projectile.velocity.Y * 14f + num552) / 15f; + } + else + { + if (Math.Abs(projectile.velocity.X) + Math.Abs(projectile.velocity.Y) < 10f) + { + projectile.velocity *= 1.05f; + } + } + } + if ((double)projectile.velocity.X > 0.25) + { + projectile.direction = -1; + } + else if ((double)projectile.velocity.X < -0.25) + { + projectile.direction = 1; + } + + if ((double)Math.Abs(projectile.velocity.X) > 0.2) + { + projectile.spriteDirection = -projectile.direction; + } + + projectile.frameCounter++; + if (projectile.frameCounter > 5) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame > 3) + { + projectile.frame = 0; + } + } + } } \ No newline at end of file diff --git a/Projectiles/Patreon/MiniGuardianDefense.cs b/Projectiles/Patreon/MiniGuardianDefense.cs index 0af945870b..e00df1f2ac 100644 --- a/Projectiles/Patreon/MiniGuardianDefense.cs +++ b/Projectiles/Patreon/MiniGuardianDefense.cs @@ -1,246 +1,246 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.Localization; -using Terraria.ID; -using Terraria.DataStructures; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Patreon -{ - public class MiniGuardianDefense : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Defensive Guardian"); - Main.projFrames[projectile.type] = 4; - ProjectileID.Sets.MinionSacrificable[projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true; - } - - public override void SetDefaults() - { - projectile.netImportant = true; - projectile.tileCollide = false; - projectile.width = 62; - projectile.height = 80; - projectile.minionSlots = 0f; - projectile.minion = true; - projectile.friendly = true; - projectile.penetrate = -1; - projectile.timeLeft = 18000; - projectile.timeLeft *= 5; - projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 6; - } - - public override void AI() - { - Player player = Main.player[projectile.owner]; - CalamityPlayer modPlayer = player.GetModPlayer(mod); - if (player.dead) - { - modPlayer.gDefense = false; - } - if (modPlayer.gDefense) - { - projectile.timeLeft = 2; - } - if (!modPlayer.pArtifact || player.maxMinions < 8) - { - projectile.active = false; - return; - } - float num535 = projectile.position.X; - float num536 = projectile.position.Y; - float num537 = 3000f; - bool flag19 = false; - NPC ownerMinionAttackTargetNPC2 = projectile.OwnerMinionAttackTargetNPC; - if (ownerMinionAttackTargetNPC2 != null && ownerMinionAttackTargetNPC2.CanBeChasedBy(projectile, false)) - { - float num539 = ownerMinionAttackTargetNPC2.position.X + (float)(ownerMinionAttackTargetNPC2.width / 2); - float num540 = ownerMinionAttackTargetNPC2.position.Y + (float)(ownerMinionAttackTargetNPC2.height / 2); - float num541 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num539) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num540); - if (num541 < num537) - { - num537 = num541; - num535 = num539; - num536 = num540; - flag19 = true; - } - } - if (!flag19) - { - int num3; - for (int num542 = 0; num542 < 200; num542 = num3 + 1) - { - if (Main.npc[num542].CanBeChasedBy(projectile, false)) - { - float num543 = Main.npc[num542].position.X + (float)(Main.npc[num542].width / 2); - float num544 = Main.npc[num542].position.Y + (float)(Main.npc[num542].height / 2); - float num545 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num543) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num544); - if (num545 < num537) - { - num537 = num545; - num535 = num543; - num536 = num544; - flag19 = true; - } - } - num3 = num542; - } - } - if (!flag19) - { - float num16 = 0.5f; - projectile.tileCollide = false; - int num17 = 100; - Vector2 vector3 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); - float num18 = Main.player[projectile.owner].position.X + (float)(Main.player[projectile.owner].width / 2) - vector3.X; - float num19 = Main.player[projectile.owner].position.Y + (float)(Main.player[projectile.owner].height / 2) - vector3.Y; - num19 += (float)Main.rand.Next(-10, 21); - num18 += (float)Main.rand.Next(-10, 21); - num18 += (float)(60 * -(float)Main.player[projectile.owner].direction); - num19 -= 60f; - float num20 = (float)Math.Sqrt((double)(num18 * num18 + num19 * num19)); - float num21 = 18f; - - if (num20 < (float)num17 && Main.player[projectile.owner].velocity.Y == 0f && - projectile.position.Y + (float)projectile.height <= Main.player[projectile.owner].position.Y + (float)Main.player[projectile.owner].height && - !Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) - { - projectile.ai[0] = 0f; - if (projectile.velocity.Y < -6f) - { - projectile.velocity.Y = -6f; - } - } - if (num20 > 2000f) - { - projectile.position.X = Main.player[projectile.owner].Center.X - (float)(projectile.width / 2); - projectile.position.Y = Main.player[projectile.owner].Center.Y - (float)(projectile.height / 2); - projectile.netUpdate = true; - } - if (num20 < 50f) - { - if (Math.Abs(projectile.velocity.X) > 2f || Math.Abs(projectile.velocity.Y) > 2f) - { - projectile.velocity *= 0.90f; - } - num16 = 0.01f; - } - else - { - if (num20 < 100f) - { - num16 = 0.1f; - } - if (num20 > 300f) - { - num16 = 1f; - } - num20 = num21 / num20; - num18 *= num20; - num19 *= num20; - } - - if (projectile.velocity.X < num18) - { - projectile.velocity.X = projectile.velocity.X + num16; - if (num16 > 0.05f && projectile.velocity.X < 0f) - { - projectile.velocity.X = projectile.velocity.X + num16; - } - } - if (projectile.velocity.X > num18) - { - projectile.velocity.X = projectile.velocity.X - num16; - if (num16 > 0.05f && projectile.velocity.X > 0f) - { - projectile.velocity.X = projectile.velocity.X - num16; - } - } - if (projectile.velocity.Y < num19) - { - projectile.velocity.Y = projectile.velocity.Y + num16; - if (num16 > 0.05f && projectile.velocity.Y < 0f) - { - projectile.velocity.Y = projectile.velocity.Y + num16 * 2f; - } - } - if (projectile.velocity.Y > num19) - { - projectile.velocity.Y = projectile.velocity.Y - num16; - if (num16 > 0.05f && projectile.velocity.Y > 0f) - { - projectile.velocity.Y = projectile.velocity.Y - num16 * 2f; - } - } - } - else - { - if (projectile.ai[1] == -1f) - { - projectile.ai[1] = 17f; - } - if (projectile.ai[1] > 0f) - { - projectile.ai[1] -= 1f; - } - if (projectile.ai[1] == 0f) - { - float num550 = 24f; //12 - Vector2 vector43 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); - float num551 = num535 - vector43.X; - float num552 = num536 - vector43.Y; - float num553 = (float)Math.Sqrt((double)(num551 * num551 + num552 * num552)); - if (num553 < 100f) - { - num550 = 28f; //14 - } - if (modPlayer.gOffense) - { - num550 *= 0.95f; - } - num553 = num550 / num553; - num551 *= num553; - num552 *= num553; - projectile.velocity.X = (projectile.velocity.X * 14f + num551) / 15f; - projectile.velocity.Y = (projectile.velocity.Y * 14f + num552) / 15f; - } - else - { - if (Math.Abs(projectile.velocity.X) + Math.Abs(projectile.velocity.Y) < 10f) - { - projectile.velocity *= 1.05f; - } - } - } - if ((double)projectile.velocity.X > 0.25) - { - projectile.direction = -1; - } - else if ((double)projectile.velocity.X < -0.25) - { - projectile.direction = 1; - } - - if ((double)Math.Abs(projectile.velocity.X) > 0.2) - { - projectile.spriteDirection = -projectile.direction; - } - - projectile.frameCounter++; - if (projectile.frameCounter > 5) - { - projectile.frame++; - projectile.frameCounter = 0; - } - if (projectile.frame > 3) - { - projectile.frame = 0; - } - } - } +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.Localization; +using Terraria.ID; +using Terraria.DataStructures; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Patreon +{ + public class MiniGuardianDefense : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Defensive Guardian"); + Main.projFrames[projectile.type] = 4; + ProjectileID.Sets.MinionSacrificable[projectile.type] = true; + ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true; + } + + public override void SetDefaults() + { + projectile.netImportant = true; + projectile.tileCollide = false; + projectile.width = 62; + projectile.height = 80; + projectile.minionSlots = 0f; + projectile.minion = true; + projectile.friendly = true; + projectile.penetrate = -1; + projectile.timeLeft = 18000; + projectile.timeLeft *= 5; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 6; + } + + public override void AI() + { + Player player = Main.player[projectile.owner]; + CalamityPlayer modPlayer = player.GetModPlayer(mod); + if (player.dead) + { + modPlayer.gDefense = false; + } + if (modPlayer.gDefense) + { + projectile.timeLeft = 2; + } + if (!modPlayer.pArtifact || player.maxMinions < 8) + { + projectile.active = false; + return; + } + float num535 = projectile.position.X; + float num536 = projectile.position.Y; + float num537 = 3000f; + bool flag19 = false; + NPC ownerMinionAttackTargetNPC2 = projectile.OwnerMinionAttackTargetNPC; + if (ownerMinionAttackTargetNPC2 != null && ownerMinionAttackTargetNPC2.CanBeChasedBy(projectile, false)) + { + float num539 = ownerMinionAttackTargetNPC2.position.X + (float)(ownerMinionAttackTargetNPC2.width / 2); + float num540 = ownerMinionAttackTargetNPC2.position.Y + (float)(ownerMinionAttackTargetNPC2.height / 2); + float num541 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num539) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num540); + if (num541 < num537) + { + num537 = num541; + num535 = num539; + num536 = num540; + flag19 = true; + } + } + if (!flag19) + { + int num3; + for (int num542 = 0; num542 < 200; num542 = num3 + 1) + { + if (Main.npc[num542].CanBeChasedBy(projectile, false)) + { + float num543 = Main.npc[num542].position.X + (float)(Main.npc[num542].width / 2); + float num544 = Main.npc[num542].position.Y + (float)(Main.npc[num542].height / 2); + float num545 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num543) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num544); + if (num545 < num537) + { + num537 = num545; + num535 = num543; + num536 = num544; + flag19 = true; + } + } + num3 = num542; + } + } + if (!flag19) + { + float num16 = 0.5f; + projectile.tileCollide = false; + int num17 = 100; + Vector2 vector3 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + float num18 = Main.player[projectile.owner].position.X + (float)(Main.player[projectile.owner].width / 2) - vector3.X; + float num19 = Main.player[projectile.owner].position.Y + (float)(Main.player[projectile.owner].height / 2) - vector3.Y; + num19 += (float)Main.rand.Next(-10, 21); + num18 += (float)Main.rand.Next(-10, 21); + num18 += (float)(60 * -(float)Main.player[projectile.owner].direction); + num19 -= 60f; + float num20 = (float)Math.Sqrt((double)(num18 * num18 + num19 * num19)); + float num21 = 18f; + + if (num20 < (float)num17 && Main.player[projectile.owner].velocity.Y == 0f && + projectile.position.Y + (float)projectile.height <= Main.player[projectile.owner].position.Y + (float)Main.player[projectile.owner].height && + !Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) + { + projectile.ai[0] = 0f; + if (projectile.velocity.Y < -6f) + { + projectile.velocity.Y = -6f; + } + } + if (num20 > 2000f) + { + projectile.position.X = Main.player[projectile.owner].Center.X - (float)(projectile.width / 2); + projectile.position.Y = Main.player[projectile.owner].Center.Y - (float)(projectile.height / 2); + projectile.netUpdate = true; + } + if (num20 < 50f) + { + if (Math.Abs(projectile.velocity.X) > 2f || Math.Abs(projectile.velocity.Y) > 2f) + { + projectile.velocity *= 0.90f; + } + num16 = 0.01f; + } + else + { + if (num20 < 100f) + { + num16 = 0.1f; + } + if (num20 > 300f) + { + num16 = 1f; + } + num20 = num21 / num20; + num18 *= num20; + num19 *= num20; + } + + if (projectile.velocity.X < num18) + { + projectile.velocity.X = projectile.velocity.X + num16; + if (num16 > 0.05f && projectile.velocity.X < 0f) + { + projectile.velocity.X = projectile.velocity.X + num16; + } + } + if (projectile.velocity.X > num18) + { + projectile.velocity.X = projectile.velocity.X - num16; + if (num16 > 0.05f && projectile.velocity.X > 0f) + { + projectile.velocity.X = projectile.velocity.X - num16; + } + } + if (projectile.velocity.Y < num19) + { + projectile.velocity.Y = projectile.velocity.Y + num16; + if (num16 > 0.05f && projectile.velocity.Y < 0f) + { + projectile.velocity.Y = projectile.velocity.Y + num16 * 2f; + } + } + if (projectile.velocity.Y > num19) + { + projectile.velocity.Y = projectile.velocity.Y - num16; + if (num16 > 0.05f && projectile.velocity.Y > 0f) + { + projectile.velocity.Y = projectile.velocity.Y - num16 * 2f; + } + } + } + else + { + if (projectile.ai[1] == -1f) + { + projectile.ai[1] = 17f; + } + if (projectile.ai[1] > 0f) + { + projectile.ai[1] -= 1f; + } + if (projectile.ai[1] == 0f) + { + float num550 = 24f; //12 + Vector2 vector43 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + float num551 = num535 - vector43.X; + float num552 = num536 - vector43.Y; + float num553 = (float)Math.Sqrt((double)(num551 * num551 + num552 * num552)); + if (num553 < 100f) + { + num550 = 28f; //14 + } + if (modPlayer.gOffense) + { + num550 *= 0.95f; + } + num553 = num550 / num553; + num551 *= num553; + num552 *= num553; + projectile.velocity.X = (projectile.velocity.X * 14f + num551) / 15f; + projectile.velocity.Y = (projectile.velocity.Y * 14f + num552) / 15f; + } + else + { + if (Math.Abs(projectile.velocity.X) + Math.Abs(projectile.velocity.Y) < 10f) + { + projectile.velocity *= 1.05f; + } + } + } + if ((double)projectile.velocity.X > 0.25) + { + projectile.direction = -1; + } + else if ((double)projectile.velocity.X < -0.25) + { + projectile.direction = 1; + } + + if ((double)Math.Abs(projectile.velocity.X) > 0.2) + { + projectile.spriteDirection = -projectile.direction; + } + + projectile.frameCounter++; + if (projectile.frameCounter > 5) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame > 3) + { + projectile.frame = 0; + } + } + } } \ No newline at end of file diff --git a/Projectiles/Patreon/MiniGuardianHealer.cs b/Projectiles/Patreon/MiniGuardianHealer.cs index ef4473757e..ea4e350b0d 100644 --- a/Projectiles/Patreon/MiniGuardianHealer.cs +++ b/Projectiles/Patreon/MiniGuardianHealer.cs @@ -1,164 +1,164 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.Localization; -using Terraria.ID; -using Terraria.DataStructures; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Patreon -{ - public class MiniGuardianHealer : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Healer Guardian"); - Main.projFrames[projectile.type] = 4; - ProjectileID.Sets.MinionSacrificable[projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true; - } - - public override void SetDefaults() - { - projectile.netImportant = true; - projectile.tileCollide = false; - projectile.width = 68; - projectile.height = 82; - projectile.friendly = true; - projectile.minionSlots = 0f; - projectile.minion = true; - projectile.penetrate = -1; - projectile.timeLeft = 18000; - projectile.timeLeft *= 5; - } - - public override void AI() - { - Player player = Main.player[projectile.owner]; - CalamityPlayer modPlayer = player.GetModPlayer(mod); - if (player.dead) - { - modPlayer.gHealer = false; - } - if (modPlayer.gHealer) - { - projectile.timeLeft = 2; - } - if (!modPlayer.pArtifact) - { - projectile.active = false; - return; - } - Player projOwner = Main.player[projectile.owner]; - float num16 = 0.5f; - projectile.tileCollide = false; - int num17 = 100; - Vector2 vector3 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); - float num18 = projOwner.position.X + (float)(projOwner.width / 2) - vector3.X; - float num19 = projOwner.position.Y + (float)(projOwner.height / 2) - vector3.Y; - num19 += (float)Main.rand.Next(-10, 21); - num18 += (float)Main.rand.Next(-10, 21); - num18 += (float)(60 * -(float)projOwner.direction); - num19 -= 60f; - float num20 = (float)Math.Sqrt((double)(num18 * num18 + num19 * num19)); - float num21 = 18f; - - if (num20 < (float)num17 && projOwner.velocity.Y == 0f && - projectile.position.Y + (float)projectile.height <= projOwner.position.Y + (float)projOwner.height && - !Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) - { - projectile.ai[0] = 0f; - if (projectile.velocity.Y < -6f) - { - projectile.velocity.Y = -6f; - } - } - if (num20 > 2000f) - { - projectile.position.X = Main.player[projectile.owner].Center.X - (float)(projectile.width / 2); - projectile.position.Y = Main.player[projectile.owner].Center.Y - (float)(projectile.height / 2); - projectile.netUpdate = true; - } - if (num20 < 50f) - { - if (Math.Abs(projectile.velocity.X) > 2f || Math.Abs(projectile.velocity.Y) > 2f) - { - projectile.velocity *= 0.90f; - } - num16 = 0.01f; - } - else - { - if (num20 < 100f) - { - num16 = 0.1f; - } - if (num20 > 300f) - { - num16 = 1f; - } - num20 = num21 / num20; - num18 *= num20; - num19 *= num20; - } - - if (projectile.velocity.X < num18) - { - projectile.velocity.X = projectile.velocity.X + num16; - if (num16 > 0.05f && projectile.velocity.X < 0f) - { - projectile.velocity.X = projectile.velocity.X + num16; - } - } - if (projectile.velocity.X > num18) - { - projectile.velocity.X = projectile.velocity.X - num16; - if (num16 > 0.05f && projectile.velocity.X > 0f) - { - projectile.velocity.X = projectile.velocity.X - num16; - } - } - if (projectile.velocity.Y < num19) - { - projectile.velocity.Y = projectile.velocity.Y + num16; - if (num16 > 0.05f && projectile.velocity.Y < 0f) - { - projectile.velocity.Y = projectile.velocity.Y + num16 * 2f; - } - } - if (projectile.velocity.Y > num19) - { - projectile.velocity.Y = projectile.velocity.Y - num16; - if (num16 > 0.05f && projectile.velocity.Y > 0f) - { - projectile.velocity.Y = projectile.velocity.Y - num16 * 2f; - } - } - if ((double)projectile.velocity.X > 0.25) - { - projectile.direction = -1; - } - else if ((double)projectile.velocity.X < -0.25) - { - projectile.direction = 1; - } - - if ((double)Math.Abs(projectile.velocity.X) > 0.2) - { - projectile.spriteDirection = -projectile.direction; - } - - projectile.frameCounter++; - if (projectile.frameCounter > 5) - { - projectile.frame++; - projectile.frameCounter = 0; - } - if (projectile.frame > 3) - { - projectile.frame = 0; - } - } - } +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.Localization; +using Terraria.ID; +using Terraria.DataStructures; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Patreon +{ + public class MiniGuardianHealer : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Healer Guardian"); + Main.projFrames[projectile.type] = 4; + ProjectileID.Sets.MinionSacrificable[projectile.type] = true; + ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true; + } + + public override void SetDefaults() + { + projectile.netImportant = true; + projectile.tileCollide = false; + projectile.width = 68; + projectile.height = 82; + projectile.friendly = true; + projectile.minionSlots = 0f; + projectile.minion = true; + projectile.penetrate = -1; + projectile.timeLeft = 18000; + projectile.timeLeft *= 5; + } + + public override void AI() + { + Player player = Main.player[projectile.owner]; + CalamityPlayer modPlayer = player.GetModPlayer(mod); + if (player.dead) + { + modPlayer.gHealer = false; + } + if (modPlayer.gHealer) + { + projectile.timeLeft = 2; + } + if (!modPlayer.pArtifact) + { + projectile.active = false; + return; + } + Player projOwner = Main.player[projectile.owner]; + float num16 = 0.5f; + projectile.tileCollide = false; + int num17 = 100; + Vector2 vector3 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + float num18 = projOwner.position.X + (float)(projOwner.width / 2) - vector3.X; + float num19 = projOwner.position.Y + (float)(projOwner.height / 2) - vector3.Y; + num19 += (float)Main.rand.Next(-10, 21); + num18 += (float)Main.rand.Next(-10, 21); + num18 += (float)(60 * -(float)projOwner.direction); + num19 -= 60f; + float num20 = (float)Math.Sqrt((double)(num18 * num18 + num19 * num19)); + float num21 = 18f; + + if (num20 < (float)num17 && projOwner.velocity.Y == 0f && + projectile.position.Y + (float)projectile.height <= projOwner.position.Y + (float)projOwner.height && + !Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) + { + projectile.ai[0] = 0f; + if (projectile.velocity.Y < -6f) + { + projectile.velocity.Y = -6f; + } + } + if (num20 > 2000f) + { + projectile.position.X = Main.player[projectile.owner].Center.X - (float)(projectile.width / 2); + projectile.position.Y = Main.player[projectile.owner].Center.Y - (float)(projectile.height / 2); + projectile.netUpdate = true; + } + if (num20 < 50f) + { + if (Math.Abs(projectile.velocity.X) > 2f || Math.Abs(projectile.velocity.Y) > 2f) + { + projectile.velocity *= 0.90f; + } + num16 = 0.01f; + } + else + { + if (num20 < 100f) + { + num16 = 0.1f; + } + if (num20 > 300f) + { + num16 = 1f; + } + num20 = num21 / num20; + num18 *= num20; + num19 *= num20; + } + + if (projectile.velocity.X < num18) + { + projectile.velocity.X = projectile.velocity.X + num16; + if (num16 > 0.05f && projectile.velocity.X < 0f) + { + projectile.velocity.X = projectile.velocity.X + num16; + } + } + if (projectile.velocity.X > num18) + { + projectile.velocity.X = projectile.velocity.X - num16; + if (num16 > 0.05f && projectile.velocity.X > 0f) + { + projectile.velocity.X = projectile.velocity.X - num16; + } + } + if (projectile.velocity.Y < num19) + { + projectile.velocity.Y = projectile.velocity.Y + num16; + if (num16 > 0.05f && projectile.velocity.Y < 0f) + { + projectile.velocity.Y = projectile.velocity.Y + num16 * 2f; + } + } + if (projectile.velocity.Y > num19) + { + projectile.velocity.Y = projectile.velocity.Y - num16; + if (num16 > 0.05f && projectile.velocity.Y > 0f) + { + projectile.velocity.Y = projectile.velocity.Y - num16 * 2f; + } + } + if ((double)projectile.velocity.X > 0.25) + { + projectile.direction = -1; + } + else if ((double)projectile.velocity.X < -0.25) + { + projectile.direction = 1; + } + + if ((double)Math.Abs(projectile.velocity.X) > 0.2) + { + projectile.spriteDirection = -projectile.direction; + } + + projectile.frameCounter++; + if (projectile.frameCounter > 5) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame > 3) + { + projectile.frame = 0; + } + } + } } \ No newline at end of file diff --git a/Projectiles/Patreon/ThePackMinissile.cs b/Projectiles/Patreon/ThePackMinissile.cs new file mode 100644 index 0000000000..81af04b7e8 --- /dev/null +++ b/Projectiles/Patreon/ThePackMinissile.cs @@ -0,0 +1,88 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Patreon +{ + public class ThePackMinissile : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Pack Minissile"); + Main.projFrames[projectile.type] = 4; + } + + public override void SetDefaults() + { + projectile.width = 30; + projectile.height = 14; + projectile.friendly = true; + projectile.ranged = true; + projectile.penetrate = 1; + projectile.timeLeft = 300; + } + + public override void AI() + { + projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X); + float centerX = projectile.Center.X; + float centerY = projectile.Center.Y; + float num474 = 1500f; + bool homeIn = false; + for (int num475 = 0; num475 < 200; num475++) + { + if (Main.npc[num475].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1)) + { + float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2); + float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2); + float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477); + if (num478 < num474) + { + num474 = num478; + centerX = num476; + centerY = num477; + homeIn = true; + } + } + } + if (homeIn) + { + float num483 = 25f; + Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + float num484 = centerX - vector35.X; + float num485 = centerY - vector35.Y; + float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485)); + num486 = num483 / num486; + num484 *= num486; + num485 *= num486; + projectile.velocity.X = (projectile.velocity.X * 15f + num484) / 16f; + projectile.velocity.Y = (projectile.velocity.Y * 15f + num485) / 16f; + return; + } + projectile.frameCounter++; + if (projectile.frameCounter > 3) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame > 3) + { + projectile.frame = 0; + } + } + + public override void Kill(int timeLeft) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + for (int i = 0; i < 10; i++) + { + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 255, 0f, 0f, 0, default(Color), 1f); + + } + } + } +} \ No newline at end of file diff --git a/Projectiles/Patreon/ThePackMinissile.png b/Projectiles/Patreon/ThePackMinissile.png new file mode 100644 index 0000000000..343769d211 Binary files /dev/null and b/Projectiles/Patreon/ThePackMinissile.png differ diff --git a/Projectiles/Patreon/ThePackMissile.cs b/Projectiles/Patreon/ThePackMissile.cs new file mode 100644 index 0000000000..e1774c7f32 --- /dev/null +++ b/Projectiles/Patreon/ThePackMissile.cs @@ -0,0 +1,133 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Patreon +{ + public class ThePackMissile : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Pack Missile"); + Main.projFrames[projectile.type] = 4; + } + + public override void SetDefaults() + { + projectile.width = 82; + projectile.height = 18; + projectile.friendly = true; + projectile.ranged = true; + projectile.tileCollide = false; + projectile.penetrate = -1; + projectile.timeLeft = 600; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 5; + } + + public override void AI() + { + projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X); + float centerX = projectile.Center.X; + float centerY = projectile.Center.Y; + float num474 = 2500f; + float explode = 200f; + bool homeIn = false; + for (int num475 = 0; num475 < 200; num475++) + { + if (Main.npc[num475].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1)) + { + float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2); + float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2); + float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477); + if (num478 < explode) + { + int numProj = 4; + float rotation = MathHelper.ToRadians(50); + if (projectile.owner == Main.myPlayer) + { + for (int i = 0; i < numProj + 1; i++) + { + Vector2 speed = new Vector2((float)Main.rand.Next(-50, 51), (float)Main.rand.Next(-50, 51)); + while (speed.X == 0f && speed.Y == 0f) + { + speed = new Vector2((float)Main.rand.Next(-50, 51), (float)Main.rand.Next(-50, 51)); + } + speed.Normalize(); + speed *= ((float)Main.rand.Next(30, 61) * 0.1f) * 2f; + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, speed.X, speed.Y, mod.ProjectileType("ThePackMinissile"), (int)((double)projectile.damage * 0.25), projectile.knockBack, projectile.owner, 0f, 0f); + } + } + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + projectile.Kill(); + return; + } + else if (num478 < num474) + { + num474 = num478; + centerX = num476; + centerY = num477; + homeIn = true; + } + } + } + if (homeIn) + { + float num483 = 30f; + Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + float num484 = centerX - vector35.X; + float num485 = centerY - vector35.Y; + float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485)); + num486 = num483 / num486; + num484 *= num486; + num485 *= num486; + projectile.velocity.X = (projectile.velocity.X * 15f + num484) / 16f; + projectile.velocity.Y = (projectile.velocity.Y * 15f + num485) / 16f; + return; + } + projectile.frameCounter++; + if (projectile.frameCounter > 3) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame > 3) + { + projectile.frame = 0; + } + } + + public override void Kill(int timeLeft) + { + projectile.position.X = projectile.position.X + (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); + projectile.width = 400; + projectile.height = 400; + projectile.position.X = projectile.position.X - (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + for (int num621 = 0; num621 < 40; num621++) + { + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 255, 0f, 0f, 0, default(Color), 1.5f); + Main.dust[num622].velocity *= 3f; + if (Main.rand.Next(2) == 0) + { + Main.dust[num622].scale = 0.5f; + Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + } + } + for (int num623 = 0; num623 < 60; num623++) + { + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 255, 0f, 0f, 0, default(Color), 2f); + Main.dust[num624].noGravity = true; + Main.dust[num624].velocity *= 5f; + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 255, 0f, 0f, 0, default(Color), 1.5f); + Main.dust[num624].velocity *= 2f; + } + projectile.Damage(); + } + } +} \ No newline at end of file diff --git a/Projectiles/Patreon/ThePackMissile.png b/Projectiles/Patreon/ThePackMissile.png new file mode 100644 index 0000000000..76f97a6237 Binary files /dev/null and b/Projectiles/Patreon/ThePackMissile.png differ diff --git a/Projectiles/Permafrost/DarkIceZero.cs b/Projectiles/Permafrost/DarkIceZero.cs index ac3bc53c53..94cd363fd4 100644 --- a/Projectiles/Permafrost/DarkIceZero.cs +++ b/Projectiles/Permafrost/DarkIceZero.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.Permafrost public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.AddBuff(BuffID.Frostburn, 480); - target.AddBuff(mod.BuffType("GlacialState"), 240); + target.AddBuff(mod.BuffType("GlacialState"), 90); } public override Color? GetAlpha (Color lightColor) diff --git a/Projectiles/Permafrost/FrostShardFriendly.cs b/Projectiles/Permafrost/FrostShardFriendly.cs index a52090ced0..556a3bc012 100644 --- a/Projectiles/Permafrost/FrostShardFriendly.cs +++ b/Projectiles/Permafrost/FrostShardFriendly.cs @@ -18,6 +18,7 @@ namespace CalamityMod.Projectiles.Permafrost projectile.friendly = true; projectile.minion = true; projectile.penetrate = 1; + projectile.GetGlobalProjectile(mod).rogue = true; } public override void SetStaticDefaults() diff --git a/Projectiles/Permafrost/FrostyFlare.cs b/Projectiles/Permafrost/FrostyFlare.cs index 04402060d5..b8f4216d3c 100644 --- a/Projectiles/Permafrost/FrostyFlare.cs +++ b/Projectiles/Permafrost/FrostyFlare.cs @@ -17,6 +17,7 @@ namespace CalamityMod.Projectiles.Permafrost projectile.friendly = true; projectile.penetrate = -1; projectile.timeLeft = 300; + projectile.GetGlobalProjectile(mod).rogue = true; } public override void SetStaticDefaults() diff --git a/Projectiles/Permafrost/IceSentry.cs b/Projectiles/Permafrost/IceSentry.cs index 0cb0a30d54..c660e1c58b 100644 --- a/Projectiles/Permafrost/IceSentry.cs +++ b/Projectiles/Permafrost/IceSentry.cs @@ -13,6 +13,8 @@ namespace CalamityMod.Projectiles.Permafrost { public class IceSentry : ModProjectile { + private bool setDamage = true; + public override void SetStaticDefaults() { DisplayName.SetDefault("Ice Sentry"); @@ -32,7 +34,21 @@ namespace CalamityMod.Projectiles.Permafrost public override void AI() { - projectile.velocity = Vector2.Zero; + if (setDamage) + { + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue = projectile.damage; + setDamage = false; + } + if (Main.player[projectile.owner].minionDamage != projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) + { + int damage2 = (int)(((float)projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue / + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) * + Main.player[projectile.owner].minionDamage); + projectile.damage = damage2; + } + + projectile.velocity = Vector2.Zero; projectile.frameCounter++; if (projectile.frameCounter > 6) @@ -102,7 +118,6 @@ namespace CalamityMod.Projectiles.Permafrost Vector2 speed = npc.Center - projectile.Center; speed.Normalize(); speed *= 8f; - int damage = projectile.damage; if (projectile.ai[1] >= 300f) speed = speed.RotatedBy(MathHelper.ToRadians(Main.rand.Next(-5, 6))) * 1.5f + npc.velocity / 2f; int p = Projectile.NewProjectile(projectile.Center, speed + npc.velocity / 2f, mod.ProjectileType("FrostBoltProjectile"), projectile.damage, projectile.knockBack, projectile.owner); @@ -155,5 +170,10 @@ namespace CalamityMod.Projectiles.Permafrost } } } - } + + public override bool CanDamage() + { + return false; + } + } } diff --git a/Projectiles/Bear.cs b/Projectiles/Pets/Bear.cs similarity index 96% rename from Projectiles/Bear.cs rename to Projectiles/Pets/Bear.cs index 654733d8a7..80d5c07258 100644 --- a/Projectiles/Bear.cs +++ b/Projectiles/Pets/Bear.cs @@ -1,368 +1,368 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles -{ - public class Bear : ModProjectile - { - public int chosenIdle = 0; - public int idleTimer = 0; - public int playerStill = 0; - public bool fly = false; - public bool easyfix = true; - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Bear"); - Main.projFrames[projectile.type] = 22; - Main.projPet[projectile.type] = true; - } - - public override void SetDefaults() - { - projectile.netImportant = true; - projectile.width = 44; - projectile.height = 44; - projectile.friendly = true; - projectile.penetrate = -1; - projectile.timeLeft *= 5; - projectile.tileCollide = true; - } - - public override void AI() - { - Player player = Main.player[projectile.owner]; - if (!player.active) - { - projectile.active = false; - return; - } - CalamityPlayer modPlayer = player.GetModPlayer(mod); - if (player.dead) - { - modPlayer.bearPet = false; - } - if (modPlayer.bearPet) - { - projectile.timeLeft = 2; - } - Vector2 vector46 = projectile.position; - if(easyfix) - { - projectile.position.Y += -3f; - easyfix = false; - } - if (!fly) - { - Vector2 center2 = projectile.Center; - Vector2 vector48 = player.Center - center2; - float playerDistance = vector48.Length(); - if (projectile.velocity.Y == 0 && (HoleBelow() || (playerDistance > 110f && projectile.position.X == projectile.oldPosition.X))) - { - projectile.velocity.Y = -5f; - } - projectile.velocity.Y += 0.20f; - - if(projectile.velocity.Y > 7f) - { - projectile.velocity.Y = 7f; - } - - if (playerDistance > 600f) - { - fly = true; - projectile.velocity.X = 0f; - projectile.velocity.Y = 0f; - projectile.tileCollide = false; - } - if (playerDistance > 100f) - { - if (player.position.X - projectile.position.X > 0f) - { - projectile.velocity.X += 0.10f; - - if(projectile.velocity.X > 7f) - { - projectile.velocity.X = 7f; - } - } - else - { - projectile.velocity.X -= 0.10f; - - if (projectile.velocity.X < -7f) - { - projectile.velocity.X = -7f; - } - } - } - if (playerDistance < 100f) - { - if (projectile.velocity.X != 0f) - { - if (projectile.velocity.X > 0.5f) - { - projectile.velocity.X -= 0.15f; - } - else if (projectile.velocity.X < -0.5f) - { - projectile.velocity.X += 0.15f; - } - else if (projectile.velocity.X < 0.5f && projectile.velocity.X > -0.5f) - { - projectile.velocity.X = 0f; - } - } - } - if (projectile.position.X == projectile.oldPosition.X && projectile.position.Y == projectile.oldPosition.Y && projectile.velocity.X == 0) - { - projectile.frameCounter++; - - switch (chosenIdle) - { - case 1: - if (idleTimer == 0) - { - projectile.frame = 0; - } - ++idleTimer; - if (projectile.frameCounter > 5) - { - projectile.frame++; - projectile.frameCounter = 0; - } - if (projectile.frame > 3) - { - chosenIdle = 0; - } - if (projectile.frame < 1) - { - projectile.frame = 1; - } - break; - - case 2: - if (idleTimer == 0) - { - projectile.frame = 0; - } - ++idleTimer; - if (projectile.frameCounter > 5) - { - projectile.frame++; - projectile.frameCounter = 0; - } - if (projectile.frame > 9) - { - chosenIdle = 0; - } - if (projectile.frame < 4) - { - projectile.frame = 4; - } - break; - - case 3: - if (idleTimer == 0) - { - projectile.frame = 0; - } - ++idleTimer; - if (projectile.frameCounter > 5) - { - projectile.frame++; - projectile.frameCounter = 0; - } - if (projectile.frame > 12) - { - chosenIdle = 0; - } - if (projectile.frame < 10) - { - projectile.frame = 10; - } - break; - } - if (chosenIdle == 0) - { - projectile.frame = 0; - projectile.frameCounter = 5; - ++idleTimer; - if (idleTimer > 120) - { - chosenIdle = Main.rand.Next(1, 4); - idleTimer = 0; - } - } - } - else if (projectile.velocity.Y > 0.3f && projectile.position.Y != projectile.oldPosition.Y) - { - projectile.frame = 13; - projectile.frameCounter = 0; - } - else - { - projectile.frameCounter++; - if (projectile.frameCounter > 5) - { - projectile.frame++; - projectile.frameCounter = 0; - } - if (projectile.frame > 17) - { - projectile.frame = 14; - } - if (projectile.frame < 14) - { - projectile.frame = 14; - } - } - } - else if (fly) - { - float num16 = 0.3f; - projectile.tileCollide = false; - Vector2 vector3 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); - float horiPos = Main.player[projectile.owner].position.X + (float)(Main.player[projectile.owner].width / 2) - vector3.X; - float vertiPos = Main.player[projectile.owner].position.Y + (float)(Main.player[projectile.owner].height / 2) - vector3.Y; - vertiPos += (float)Main.rand.Next(-10, 21); - horiPos += (float)Main.rand.Next(-10, 21); - horiPos += (float)(60 * -(float)Main.player[projectile.owner].direction); - vertiPos -= 60f; - float playerDistance = (float)Math.Sqrt((double)(horiPos * horiPos + vertiPos * vertiPos)); - float num21 = 18f; - float num27 = (float)Math.Sqrt((double)(horiPos * horiPos + vertiPos * vertiPos)); - - if (playerDistance > 2000f) - { - projectile.position.X = Main.player[projectile.owner].Center.X - (float)(projectile.width / 2); - projectile.position.Y = Main.player[projectile.owner].Center.Y - (float)(projectile.height / 2); - projectile.netUpdate = true; - } - if (playerDistance < 50f) - { - if (Math.Abs(projectile.velocity.X) > 2f || Math.Abs(projectile.velocity.Y) > 2f) - { - projectile.velocity *= 0.90f; - } - num16 = 0.01f; - } - else - { - if (playerDistance < 100f) - { - num16 = 0.1f; - } - if (playerDistance > 300f) - { - num16 = 1f; - } - playerDistance = num21 / playerDistance; - horiPos *= playerDistance; - vertiPos *= playerDistance; - } - - if (projectile.velocity.X < horiPos) - { - projectile.velocity.X = projectile.velocity.X + num16; - if (num16 > 0.05f && projectile.velocity.X < 0f) - { - projectile.velocity.X = projectile.velocity.X + num16; - } - } - if (projectile.velocity.X > horiPos) - { - projectile.velocity.X = projectile.velocity.X - num16; - if (num16 > 0.05f && projectile.velocity.X > 0f) - { - projectile.velocity.X = projectile.velocity.X - num16; - } - } - if (projectile.velocity.Y < vertiPos) - { - projectile.velocity.Y = projectile.velocity.Y + num16; - if (num16 > 0.05f && projectile.velocity.Y < 0f) - { - projectile.velocity.Y = projectile.velocity.Y + num16 * 2f; - } - } - if (projectile.velocity.Y > vertiPos) - { - projectile.velocity.Y = projectile.velocity.Y - num16; - if (num16 > 0.05f && projectile.velocity.Y > 0f) - { - projectile.velocity.Y = projectile.velocity.Y - num16 * 2f; - } - } - - projectile.rotation = projectile.velocity.X * 0.03f; - projectile.frameCounter++; - if (projectile.frameCounter > 4) - { - projectile.frame++; - projectile.frameCounter = 0; - } - if (projectile.frame > 21) - { - projectile.frame = 18; - } - if (projectile.frame < 18) - { - projectile.frame = 18; - } - if (playerDistance < 100f) - { - num16 = 0.1f; - if(player.velocity.Y == 0f) - { - ++playerStill; - } - else - { - playerStill = 0; - } - if(playerStill > 60 && !Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) - { - fly = false; - projectile.tileCollide = true; - projectile.rotation = 0; - } - } - } - if (projectile.velocity.X > 0.25f) - { - projectile.spriteDirection = -1; - } - else if (projectile.velocity.X < -0.25f) - { - projectile.spriteDirection = 1; - } - } - - private bool HoleBelow() //pretty much the same as the one used in mantis - { - int tileWidth = 4; - int tileX = (int)(projectile.Center.X / 16f) - tileWidth; - if (projectile.velocity.X > 0) - { - tileX += tileWidth; - } - int tileY = (int)((projectile.position.Y + projectile.height) / 16f); - for (int y = tileY; y < tileY + 2; y++) - { - for (int x = tileX; x < tileX + tileWidth; x++) - { - if (Main.tile[x, y].active()) - { - return false; - } - } - } - return true; - } - } +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Pets +{ + public class Bear : ModProjectile + { + public int chosenIdle = 0; + public int idleTimer = 0; + public int playerStill = 0; + public bool fly = false; + public bool easyfix = true; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bear"); + Main.projFrames[projectile.type] = 22; + Main.projPet[projectile.type] = true; + } + + public override void SetDefaults() + { + projectile.netImportant = true; + projectile.width = 44; + projectile.height = 44; + projectile.friendly = true; + projectile.penetrate = -1; + projectile.timeLeft *= 5; + projectile.tileCollide = true; + } + + public override void AI() + { + Player player = Main.player[projectile.owner]; + if (!player.active) + { + projectile.active = false; + return; + } + CalamityPlayer modPlayer = player.GetModPlayer(mod); + if (player.dead) + { + modPlayer.bearPet = false; + } + if (modPlayer.bearPet) + { + projectile.timeLeft = 2; + } + Vector2 vector46 = projectile.position; + if(easyfix) + { + projectile.position.Y += -3f; + easyfix = false; + } + if (!fly) + { + Vector2 center2 = projectile.Center; + Vector2 vector48 = player.Center - center2; + float playerDistance = vector48.Length(); + if (projectile.velocity.Y == 0 && (HoleBelow() || (playerDistance > 110f && projectile.position.X == projectile.oldPosition.X))) + { + projectile.velocity.Y = -5f; + } + projectile.velocity.Y += 0.20f; + + if(projectile.velocity.Y > 7f) + { + projectile.velocity.Y = 7f; + } + + if (playerDistance > 600f) + { + fly = true; + projectile.velocity.X = 0f; + projectile.velocity.Y = 0f; + projectile.tileCollide = false; + } + if (playerDistance > 100f) + { + if (player.position.X - projectile.position.X > 0f) + { + projectile.velocity.X += 0.10f; + + if(projectile.velocity.X > 7f) + { + projectile.velocity.X = 7f; + } + } + else + { + projectile.velocity.X -= 0.10f; + + if (projectile.velocity.X < -7f) + { + projectile.velocity.X = -7f; + } + } + } + if (playerDistance < 100f) + { + if (projectile.velocity.X != 0f) + { + if (projectile.velocity.X > 0.5f) + { + projectile.velocity.X -= 0.15f; + } + else if (projectile.velocity.X < -0.5f) + { + projectile.velocity.X += 0.15f; + } + else if (projectile.velocity.X < 0.5f && projectile.velocity.X > -0.5f) + { + projectile.velocity.X = 0f; + } + } + } + if (projectile.position.X == projectile.oldPosition.X && projectile.position.Y == projectile.oldPosition.Y && projectile.velocity.X == 0) + { + projectile.frameCounter++; + + switch (chosenIdle) + { + case 1: + if (idleTimer == 0) + { + projectile.frame = 0; + } + ++idleTimer; + if (projectile.frameCounter > 5) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame > 3) + { + chosenIdle = 0; + } + if (projectile.frame < 1) + { + projectile.frame = 1; + } + break; + + case 2: + if (idleTimer == 0) + { + projectile.frame = 0; + } + ++idleTimer; + if (projectile.frameCounter > 5) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame > 9) + { + chosenIdle = 0; + } + if (projectile.frame < 4) + { + projectile.frame = 4; + } + break; + + case 3: + if (idleTimer == 0) + { + projectile.frame = 0; + } + ++idleTimer; + if (projectile.frameCounter > 5) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame > 12) + { + chosenIdle = 0; + } + if (projectile.frame < 10) + { + projectile.frame = 10; + } + break; + } + if (chosenIdle == 0) + { + projectile.frame = 0; + projectile.frameCounter = 5; + ++idleTimer; + if (idleTimer > 120) + { + chosenIdle = Main.rand.Next(1, 4); + idleTimer = 0; + } + } + } + else if (projectile.velocity.Y > 0.3f && projectile.position.Y != projectile.oldPosition.Y) + { + projectile.frame = 13; + projectile.frameCounter = 0; + } + else + { + projectile.frameCounter++; + if (projectile.frameCounter > 5) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame > 17) + { + projectile.frame = 14; + } + if (projectile.frame < 14) + { + projectile.frame = 14; + } + } + } + else if (fly) + { + float num16 = 0.3f; + projectile.tileCollide = false; + Vector2 vector3 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + float horiPos = Main.player[projectile.owner].position.X + (float)(Main.player[projectile.owner].width / 2) - vector3.X; + float vertiPos = Main.player[projectile.owner].position.Y + (float)(Main.player[projectile.owner].height / 2) - vector3.Y; + vertiPos += (float)Main.rand.Next(-10, 21); + horiPos += (float)Main.rand.Next(-10, 21); + horiPos += (float)(60 * -(float)Main.player[projectile.owner].direction); + vertiPos -= 60f; + float playerDistance = (float)Math.Sqrt((double)(horiPos * horiPos + vertiPos * vertiPos)); + float num21 = 18f; + float num27 = (float)Math.Sqrt((double)(horiPos * horiPos + vertiPos * vertiPos)); + + if (playerDistance > 2000f) + { + projectile.position.X = Main.player[projectile.owner].Center.X - (float)(projectile.width / 2); + projectile.position.Y = Main.player[projectile.owner].Center.Y - (float)(projectile.height / 2); + projectile.netUpdate = true; + } + if (playerDistance < 50f) + { + if (Math.Abs(projectile.velocity.X) > 2f || Math.Abs(projectile.velocity.Y) > 2f) + { + projectile.velocity *= 0.90f; + } + num16 = 0.01f; + } + else + { + if (playerDistance < 100f) + { + num16 = 0.1f; + } + if (playerDistance > 300f) + { + num16 = 1f; + } + playerDistance = num21 / playerDistance; + horiPos *= playerDistance; + vertiPos *= playerDistance; + } + + if (projectile.velocity.X < horiPos) + { + projectile.velocity.X = projectile.velocity.X + num16; + if (num16 > 0.05f && projectile.velocity.X < 0f) + { + projectile.velocity.X = projectile.velocity.X + num16; + } + } + if (projectile.velocity.X > horiPos) + { + projectile.velocity.X = projectile.velocity.X - num16; + if (num16 > 0.05f && projectile.velocity.X > 0f) + { + projectile.velocity.X = projectile.velocity.X - num16; + } + } + if (projectile.velocity.Y < vertiPos) + { + projectile.velocity.Y = projectile.velocity.Y + num16; + if (num16 > 0.05f && projectile.velocity.Y < 0f) + { + projectile.velocity.Y = projectile.velocity.Y + num16 * 2f; + } + } + if (projectile.velocity.Y > vertiPos) + { + projectile.velocity.Y = projectile.velocity.Y - num16; + if (num16 > 0.05f && projectile.velocity.Y > 0f) + { + projectile.velocity.Y = projectile.velocity.Y - num16 * 2f; + } + } + + projectile.rotation = projectile.velocity.X * 0.03f; + projectile.frameCounter++; + if (projectile.frameCounter > 4) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame > 21) + { + projectile.frame = 18; + } + if (projectile.frame < 18) + { + projectile.frame = 18; + } + if (playerDistance < 100f) + { + num16 = 0.1f; + if(player.velocity.Y == 0f) + { + ++playerStill; + } + else + { + playerStill = 0; + } + if(playerStill > 60 && !Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) + { + fly = false; + projectile.tileCollide = true; + projectile.rotation = 0; + } + } + } + if (projectile.velocity.X > 0.25f) + { + projectile.spriteDirection = -1; + } + else if (projectile.velocity.X < -0.25f) + { + projectile.spriteDirection = 1; + } + } + + private bool HoleBelow() //pretty much the same as the one used in mantis + { + int tileWidth = 4; + int tileX = (int)(projectile.Center.X / 16f) - tileWidth; + if (projectile.velocity.X > 0) + { + tileX += tileWidth; + } + int tileY = (int)((projectile.position.Y + projectile.height) / 16f); + for (int y = tileY; y < tileY + 2; y++) + { + for (int x = tileX; x < tileX + tileWidth; x++) + { + if (Main.tile[x, y].active()) + { + return false; + } + } + } + return true; + } + } } \ No newline at end of file diff --git a/Projectiles/Bear.png b/Projectiles/Pets/Bear.png similarity index 100% rename from Projectiles/Bear.png rename to Projectiles/Pets/Bear.png diff --git a/Projectiles/Brimling.cs b/Projectiles/Pets/Brimling.cs similarity index 96% rename from Projectiles/Brimling.cs rename to Projectiles/Pets/Brimling.cs index 2ad5078619..254a4919f7 100644 --- a/Projectiles/Brimling.cs +++ b/Projectiles/Pets/Brimling.cs @@ -7,7 +7,7 @@ using Terraria.ID; using Terraria.DataStructures; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Pets { public class Brimling : ModProjectile { diff --git a/Projectiles/Brimling.png b/Projectiles/Pets/Brimling.png similarity index 100% rename from Projectiles/Brimling.png rename to Projectiles/Pets/Brimling.png diff --git a/Projectiles/ChibiiDoggo.cs b/Projectiles/Pets/ChibiiDoggo.cs similarity index 96% rename from Projectiles/ChibiiDoggo.cs rename to Projectiles/Pets/ChibiiDoggo.cs index 101e6f6543..02c6a35f15 100644 --- a/Projectiles/ChibiiDoggo.cs +++ b/Projectiles/Pets/ChibiiDoggo.cs @@ -10,7 +10,7 @@ using Terraria.GameContent; using Terraria.ModLoader; using Terraria.Localization; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Pets { public class ChibiiDoggo : ModProjectile { @@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles if (projectile.spriteDirection == -1) spriteEffects = SpriteEffects.FlipHorizontally; Microsoft.Xna.Framework.Color color25 = Lighting.GetColor((int)(projectile.Center.X / 16), (int)(projectile.Center.Y / 16)); - Texture2D texture2D3 = mod.GetTexture("Projectiles/ChibiiDoggoMonochrome"); + Texture2D texture2D3 = mod.GetTexture("Projectiles/Pets/ChibiiDoggoMonochrome"); int num156 = Main.projectileTexture[projectile.type].Height / Main.projFrames[projectile.type]; int y3 = num156 * projectile.frame; Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle(0, y3, texture2D3.Width, num156); diff --git a/Projectiles/ChibiiDoggo.png b/Projectiles/Pets/ChibiiDoggo.png similarity index 100% rename from Projectiles/ChibiiDoggo.png rename to Projectiles/Pets/ChibiiDoggo.png diff --git a/Projectiles/ChibiiDoggoFly.cs b/Projectiles/Pets/ChibiiDoggoFly.cs similarity index 95% rename from Projectiles/ChibiiDoggoFly.cs rename to Projectiles/Pets/ChibiiDoggoFly.cs index c143e89a72..b804ad5fe7 100644 --- a/Projectiles/ChibiiDoggoFly.cs +++ b/Projectiles/Pets/ChibiiDoggoFly.cs @@ -9,7 +9,7 @@ using Terraria.Enums; using Terraria.GameContent; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Pets { public class ChibiiDoggoFly : ModProjectile { @@ -41,7 +41,7 @@ namespace CalamityMod.Projectiles if (projectile.spriteDirection == -1) spriteEffects = SpriteEffects.FlipHorizontally; Microsoft.Xna.Framework.Color color25 = Lighting.GetColor((int)(projectile.Center.X / 16), (int)(projectile.Center.Y / 16)); - Texture2D texture2D3 = mod.GetTexture("Projectiles/ChibiiDoggoFlyMonochrome"); + Texture2D texture2D3 = mod.GetTexture("Projectiles/Pets/ChibiiDoggoFlyMonochrome"); int num156 = Main.projectileTexture[projectile.type].Height / Main.projFrames[projectile.type]; int y3 = num156 * projectile.frame; Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle(0, y3, texture2D3.Width, num156); diff --git a/Projectiles/ChibiiDoggoFly.png b/Projectiles/Pets/ChibiiDoggoFly.png similarity index 100% rename from Projectiles/ChibiiDoggoFly.png rename to Projectiles/Pets/ChibiiDoggoFly.png diff --git a/Projectiles/ChibiiDoggoFlyMonochrome.png b/Projectiles/Pets/ChibiiDoggoFlyMonochrome.png similarity index 100% rename from Projectiles/ChibiiDoggoFlyMonochrome.png rename to Projectiles/Pets/ChibiiDoggoFlyMonochrome.png diff --git a/Projectiles/ChibiiDoggoMonochrome.png b/Projectiles/Pets/ChibiiDoggoMonochrome.png similarity index 100% rename from Projectiles/ChibiiDoggoMonochrome.png rename to Projectiles/Pets/ChibiiDoggoMonochrome.png diff --git a/Projectiles/Pets/DannyDevito.cs b/Projectiles/Pets/DannyDevito.cs new file mode 100644 index 0000000000..6b63ff38ef --- /dev/null +++ b/Projectiles/Pets/DannyDevito.cs @@ -0,0 +1,314 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.GameInput; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Pets +{ + public class DannyDevito : ModProjectile + { + private int chosenIdle = 0; + private int idleTimer = 0; + private int playerStill = 0; + private bool fly = false; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Danny Devito"); + Main.projFrames[projectile.type] = 8; + Main.projPet[projectile.type] = true; + } + + public override void SetDefaults() + { + projectile.netImportant = true; + projectile.width = 42; + projectile.height = 42; + projectile.friendly = true; + projectile.penetrate = -1; + projectile.timeLeft *= 5; + projectile.tileCollide = true; + } + + public override void AI() + { + Player player = Main.player[projectile.owner]; + if (!player.active) + { + projectile.active = false; + return; + } + CalamityPlayer modPlayer = player.GetModPlayer(mod); + if (player.dead) + { + modPlayer.trashMan = false; + } + if (modPlayer.trashMan) + { + projectile.timeLeft = 2; + } + Vector2 vector46 = projectile.position; + if (!fly) + { + Vector2 center2 = projectile.Center; + Vector2 vector48 = player.Center - center2; + float playerDistance = vector48.Length(); + if (projectile.velocity.Y == 0 && (HoleBelow() || (playerDistance > 110f && projectile.position.X == projectile.oldPosition.X))) + { + projectile.velocity.Y = -5f; + } + projectile.velocity.Y += 0.20f; + if (projectile.velocity.Y > 7f) + { + projectile.velocity.Y = 7f; + } + if (playerDistance > 600f) + { + fly = true; + projectile.velocity.X = 0f; + projectile.velocity.Y = 0f; + projectile.tileCollide = false; + } + if (playerDistance > 100f) + { + if (player.position.X - projectile.position.X > 0f) + { + projectile.velocity.X += 0.10f; + if (projectile.velocity.X > 7f) + { + projectile.velocity.X = 7f; + } + } + else + { + projectile.velocity.X -= 0.10f; + if (projectile.velocity.X < -7f) + { + projectile.velocity.X = -7f; + } + } + } + if (playerDistance < 100f) + { + if (projectile.velocity.X != 0f) + { + if (projectile.velocity.X > 0.5f) + { + projectile.velocity.X -= 0.15f; + } + else if (projectile.velocity.X < -0.5f) + { + projectile.velocity.X += 0.15f; + } + else if (projectile.velocity.X < 0.5f && projectile.velocity.X > -0.5f) + { + projectile.velocity.X = 0f; + } + } + } + if (projectile.position.X == projectile.oldPosition.X && projectile.position.Y == projectile.oldPosition.Y && projectile.velocity.X == 0) + { + projectile.frame = 0; + } + else if (projectile.velocity.Y > 0.3f && projectile.position.Y != projectile.oldPosition.Y) + { + projectile.frame = 1; + projectile.frameCounter = 0; + } + else + { + projectile.frameCounter++; + if (projectile.frameCounter > 5) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame > 6) + { + projectile.frame = 2; + } + if (projectile.frame < 2) + { + projectile.frame = 2; + } + } + } + else if (fly) + { + float num16 = 0.3f; + projectile.tileCollide = false; + Vector2 vector3 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + float horiPos = Main.player[projectile.owner].position.X + (float)(Main.player[projectile.owner].width / 2) - vector3.X; + float vertiPos = Main.player[projectile.owner].position.Y + (float)(Main.player[projectile.owner].height / 2) - vector3.Y; + vertiPos += (float)Main.rand.Next(-10, 21); + horiPos += (float)Main.rand.Next(-10, 21); + horiPos += (float)(60 * -(float)Main.player[projectile.owner].direction); + vertiPos -= 60f; + float playerDistance = (float)Math.Sqrt((double)(horiPos * horiPos + vertiPos * vertiPos)); + float num21 = 18f; + float num27 = (float)Math.Sqrt((double)(horiPos * horiPos + vertiPos * vertiPos)); + if (playerDistance > 1200f) + { + projectile.position.X = Main.player[projectile.owner].Center.X - (float)(projectile.width / 2); + projectile.position.Y = Main.player[projectile.owner].Center.Y - (float)(projectile.height / 2); + projectile.netUpdate = true; + } + if (playerDistance < 50f) + { + if (Math.Abs(projectile.velocity.X) > 2f || Math.Abs(projectile.velocity.Y) > 2f) + { + projectile.velocity *= 0.90f; + } + num16 = 0.01f; + } + else + { + if (playerDistance < 100f) + { + num16 = 0.1f; + } + if (playerDistance > 300f) + { + num16 = 1f; + } + playerDistance = num21 / playerDistance; + horiPos *= playerDistance; + vertiPos *= playerDistance; + } + if (projectile.velocity.X < horiPos) + { + projectile.velocity.X = projectile.velocity.X + num16; + if (num16 > 0.05f && projectile.velocity.X < 0f) + { + projectile.velocity.X = projectile.velocity.X + num16; + } + } + if (projectile.velocity.X > horiPos) + { + projectile.velocity.X = projectile.velocity.X - num16; + if (num16 > 0.05f && projectile.velocity.X > 0f) + { + projectile.velocity.X = projectile.velocity.X - num16; + } + } + if (projectile.velocity.Y < vertiPos) + { + projectile.velocity.Y = projectile.velocity.Y + num16; + if (num16 > 0.05f && projectile.velocity.Y < 0f) + { + projectile.velocity.Y = projectile.velocity.Y + num16 * 2f; + } + } + if (projectile.velocity.Y > vertiPos) + { + projectile.velocity.Y = projectile.velocity.Y - num16; + if (num16 > 0.05f && projectile.velocity.Y > 0f) + { + projectile.velocity.Y = projectile.velocity.Y - num16 * 2f; + } + } + projectile.rotation = projectile.velocity.X * 0.03f; + projectile.frame = 7; + if (playerDistance < 100f) + { + num16 = 0.1f; + if (player.velocity.Y == 0f) + { + ++playerStill; + } + else + { + playerStill = 0; + } + if (playerStill > 60 && !Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) + { + fly = false; + projectile.tileCollide = true; + projectile.rotation = 0; + } + } + } + if (projectile.velocity.X > 0.25f) + { + projectile.spriteDirection = -1; + } + else if (projectile.velocity.X < -0.25f) + { + projectile.spriteDirection = 1; + } + } + + /*public override void PostDraw(SpriteBatch spriteBatch, Color lightColor) + { + if (!Main.gamePaused || Main.gameMenu) + { + Vector2 vector69 = projectile.position - Main.screenPosition; + if ((float)Main.mouseX > vector69.X && (float)Main.mouseX < vector69.X + (float)projectile.width && (float)Main.mouseY > vector69.Y && (float)Main.mouseY < vector69.Y + (float)projectile.height) + { + int num345 = (int)(Main.player[projectile.owner].Center.X / 16f); + int num346 = (int)(Main.player[projectile.owner].Center.Y / 16f); + int num347 = (int)projectile.Center.X / 16; + int num348 = (int)projectile.Center.Y / 16; + int lastTileRangeX = Main.player[projectile.owner].lastTileRangeX; + int lastTileRangeY = Main.player[projectile.owner].lastTileRangeY; + if (num345 >= num347 - lastTileRangeX && num345 <= num347 + lastTileRangeX + 1 && num346 >= num348 - lastTileRangeY && num346 <= num348 + lastTileRangeY + 1) + { + Main.player[projectile.owner].noThrow = 2; + Main.player[projectile.owner].showItemIcon = true; + Main.player[projectile.owner].showItemIcon2 = 3213; + if (PlayerInput.UsingGamepad) + { + Main.player[projectile.owner].GamepadEnableGrappleCooldown(); + } + if (Main.mouseRight && Main.mouseRightRelease && Player.StopMoneyTroughFromWorking == 0) + { + Main.mouseRightRelease = false; + if (Main.player[projectile.owner].chest == -2) + { + Main.PlaySound(SoundID.Item11, -1, -1); + Main.player[projectile.owner].chest = -1; + Recipe.FindRecipes(); + return; + } + Main.player[projectile.owner].GetModPlayer(mod).trashManChest = projectile.type; + Main.player[projectile.owner].chest = -2; + Main.player[projectile.owner].chestX = (int)(projectile.Center.X / 16f); + Main.player[projectile.owner].chestY = (int)(projectile.Center.Y / 16f); + Main.player[projectile.owner].talkNPC = -1; + Main.npcShop = 0; + Main.playerInventory = true; + Main.PlaySound(SoundID.Item10, -1, -1); + Recipe.FindRecipes(); + } + } + } + } + }*/ + + private bool HoleBelow() //pretty much the same as the one used in mantis + { + int tileWidth = 4; + int tileX = (int)(projectile.Center.X / 16f) - tileWidth; + if (projectile.velocity.X > 0) + { + tileX += tileWidth; + } + int tileY = (int)((projectile.position.Y + projectile.height) / 16f); + for (int y = tileY; y < tileY + 2; y++) + { + for (int x = tileX; x < tileX + tileWidth; x++) + { + if (Main.tile[x, y].active()) + { + return false; + } + } + } + return true; + } + } +} \ No newline at end of file diff --git a/Projectiles/DannyDevito.png b/Projectiles/Pets/DannyDevito.png similarity index 100% rename from Projectiles/DannyDevito.png rename to Projectiles/Pets/DannyDevito.png diff --git a/Projectiles/Fox.cs b/Projectiles/Pets/Fox.cs similarity index 93% rename from Projectiles/Fox.cs rename to Projectiles/Pets/Fox.cs index b92951069a..deb21b7b53 100644 --- a/Projectiles/Fox.cs +++ b/Projectiles/Pets/Fox.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Pets { public class Fox : ModProjectile { diff --git a/Projectiles/Fox.png b/Projectiles/Pets/Fox.png similarity index 100% rename from Projectiles/Fox.png rename to Projectiles/Pets/Fox.png diff --git a/Projectiles/Levi.cs b/Projectiles/Pets/Levi.cs similarity index 96% rename from Projectiles/Levi.cs rename to Projectiles/Pets/Levi.cs index 2d14ec9624..f6142bee85 100644 --- a/Projectiles/Levi.cs +++ b/Projectiles/Pets/Levi.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Pets { public class Levi : ModProjectile { diff --git a/Projectiles/Levi.png b/Projectiles/Pets/Levi.png similarity index 100% rename from Projectiles/Levi.png rename to Projectiles/Pets/Levi.png diff --git a/Projectiles/SirenYoung.cs b/Projectiles/Pets/SirenYoung.cs similarity index 96% rename from Projectiles/SirenYoung.cs rename to Projectiles/Pets/SirenYoung.cs index 1f24fe2f54..6294944271 100644 --- a/Projectiles/SirenYoung.cs +++ b/Projectiles/Pets/SirenYoung.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Pets { public class SirenYoung : ModProjectile { diff --git a/Buffs/AquaticEgg.png b/Projectiles/Pets/SirenYoung.png similarity index 59% rename from Buffs/AquaticEgg.png rename to Projectiles/Pets/SirenYoung.png index d95081f895..41481d1dba 100644 Binary files a/Buffs/AquaticEgg.png and b/Projectiles/Pets/SirenYoung.png differ diff --git a/Projectiles/AMR.cs b/Projectiles/Ranged/AMR.cs similarity index 95% rename from Projectiles/AMR.cs rename to Projectiles/Ranged/AMR.cs index aaabd2df4b..7ccec996f3 100644 --- a/Projectiles/AMR.cs +++ b/Projectiles/Ranged/AMR.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class AMR : ModProjectile { diff --git a/Projectiles/AMR.png b/Projectiles/Ranged/AMR.png similarity index 100% rename from Projectiles/AMR.png rename to Projectiles/Ranged/AMR.png diff --git a/Projectiles/AMR2.cs b/Projectiles/Ranged/AMR2.cs similarity index 91% rename from Projectiles/AMR2.cs rename to Projectiles/Ranged/AMR2.cs index 106e859c82..a22ed0e6fd 100644 --- a/Projectiles/AMR2.cs +++ b/Projectiles/Ranged/AMR2.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class AMR2 : ModProjectile { diff --git a/Projectiles/AMR2.png b/Projectiles/Ranged/AMR2.png similarity index 100% rename from Projectiles/AMR2.png rename to Projectiles/Ranged/AMR2.png diff --git a/Projectiles/AccelerationBullet.cs b/Projectiles/Ranged/AccelerationBullet.cs similarity index 95% rename from Projectiles/AccelerationBullet.cs rename to Projectiles/Ranged/AccelerationBullet.cs index f11a7131da..b8fadc534d 100644 --- a/Projectiles/AccelerationBullet.cs +++ b/Projectiles/Ranged/AccelerationBullet.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class AccelerationBullet : ModProjectile { diff --git a/Projectiles/AcidBullet.png b/Projectiles/Ranged/AccelerationBullet.png similarity index 100% rename from Projectiles/AcidBullet.png rename to Projectiles/Ranged/AccelerationBullet.png diff --git a/Projectiles/AcidBullet.cs b/Projectiles/Ranged/AcidBullet.cs similarity index 95% rename from Projectiles/AcidBullet.cs rename to Projectiles/Ranged/AcidBullet.cs index 33e8e298cd..15932eb288 100644 --- a/Projectiles/AcidBullet.cs +++ b/Projectiles/Ranged/AcidBullet.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class AcidBullet : ModProjectile { diff --git a/Projectiles/AquaBlast.png b/Projectiles/Ranged/AcidBullet.png similarity index 100% rename from Projectiles/AquaBlast.png rename to Projectiles/Ranged/AcidBullet.png diff --git a/Projectiles/AquaBlast.cs b/Projectiles/Ranged/AquaBlast.cs similarity index 94% rename from Projectiles/AquaBlast.cs rename to Projectiles/Ranged/AquaBlast.cs index fd77bfd2e4..b597ef6ed3 100644 --- a/Projectiles/AquaBlast.cs +++ b/Projectiles/Ranged/AquaBlast.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class AquaBlast : ModProjectile { diff --git a/Projectiles/AquaBlastToxic.png b/Projectiles/Ranged/AquaBlast.png similarity index 100% rename from Projectiles/AquaBlastToxic.png rename to Projectiles/Ranged/AquaBlast.png diff --git a/Projectiles/AquaBlastToxic.cs b/Projectiles/Ranged/AquaBlastToxic.cs similarity index 94% rename from Projectiles/AquaBlastToxic.cs rename to Projectiles/Ranged/AquaBlastToxic.cs index e5c1f8e752..0165f4d111 100644 --- a/Projectiles/AquaBlastToxic.cs +++ b/Projectiles/Ranged/AquaBlastToxic.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class AquaBlastToxic : ModProjectile { diff --git a/Projectiles/Archerfish.png b/Projectiles/Ranged/AquaBlastToxic.png similarity index 100% rename from Projectiles/Archerfish.png rename to Projectiles/Ranged/AquaBlastToxic.png diff --git a/Projectiles/Archerfish.cs b/Projectiles/Ranged/Archerfish.cs similarity index 96% rename from Projectiles/Archerfish.cs rename to Projectiles/Ranged/Archerfish.cs index e80c21566e..b5f385fc23 100644 --- a/Projectiles/Archerfish.cs +++ b/Projectiles/Ranged/Archerfish.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class Archerfish : ModProjectile { diff --git a/Projectiles/AstralRound.png b/Projectiles/Ranged/Archerfish.png similarity index 100% rename from Projectiles/AstralRound.png rename to Projectiles/Ranged/Archerfish.png diff --git a/Projectiles/ArcticArrow.cs b/Projectiles/Ranged/ArcticArrow.cs similarity index 95% rename from Projectiles/ArcticArrow.cs rename to Projectiles/Ranged/ArcticArrow.cs index d83bde7b0e..1eb16be534 100644 --- a/Projectiles/ArcticArrow.cs +++ b/Projectiles/Ranged/ArcticArrow.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class ArcticArrow : ModProjectile { diff --git a/Projectiles/ArcticArrow.png b/Projectiles/Ranged/ArcticArrow.png similarity index 100% rename from Projectiles/ArcticArrow.png rename to Projectiles/Ranged/ArcticArrow.png diff --git a/Projectiles/AstralRound.cs b/Projectiles/Ranged/AstralRound.cs similarity index 96% rename from Projectiles/AstralRound.cs rename to Projectiles/Ranged/AstralRound.cs index 08d1296d4d..7c4a05fa23 100644 --- a/Projectiles/AstralRound.cs +++ b/Projectiles/Ranged/AstralRound.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class AstralRound : ModProjectile { diff --git a/Projectiles/ChaosFlare.png b/Projectiles/Ranged/AstralRound.png similarity index 100% rename from Projectiles/ChaosFlare.png rename to Projectiles/Ranged/AstralRound.png diff --git a/Projectiles/AstrealArrow.cs b/Projectiles/Ranged/AstrealArrow.cs similarity index 96% rename from Projectiles/AstrealArrow.cs rename to Projectiles/Ranged/AstrealArrow.cs index 483fe71786..044f0f5d5f 100644 --- a/Projectiles/AstrealArrow.cs +++ b/Projectiles/Ranged/AstrealArrow.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class AstrealArrow : ModProjectile { diff --git a/Projectiles/AstrealArrow.png b/Projectiles/Ranged/AstrealArrow.png similarity index 100% rename from Projectiles/AstrealArrow.png rename to Projectiles/Ranged/AstrealArrow.png diff --git a/Projectiles/AstrealFlame.cs b/Projectiles/Ranged/AstrealFlame.cs similarity index 96% rename from Projectiles/AstrealFlame.cs rename to Projectiles/Ranged/AstrealFlame.cs index dd400cef39..e36423f2a0 100644 --- a/Projectiles/AstrealFlame.cs +++ b/Projectiles/Ranged/AstrealFlame.cs @@ -1,107 +1,107 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles -{ - public class AstrealFlame : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Flame"); - Main.projFrames[projectile.type] = 4; - } - - public override void SetDefaults() - { - projectile.width = 20; - projectile.height = 20; - projectile.friendly = true; - projectile.ranged = true; - projectile.penetrate = 1; - projectile.timeLeft = 180; - projectile.alpha = 255; - } - - public override void AI() - { - projectile.alpha -= 5; - projectile.frameCounter++; - if (projectile.frameCounter > 4) - { - projectile.frame++; - projectile.frameCounter = 0; - } - if (projectile.frame > 3) - { - projectile.frame = 0; - } - float num472 = projectile.Center.X; - float num473 = projectile.Center.Y; - float num474 = 500f; - bool flag17 = false; - for (int num475 = 0; num475 < 200; num475++) - { - if (Main.npc[num475].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1)) - { - float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2); - float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2); - float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477); - if (num478 < num474) - { - num474 = num478; - num472 = num476; - num473 = num477; - flag17 = true; - } - } - } - if (flag17) - { - float num483 = 16f; - Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); - float num484 = num472 - vector35.X; - float num485 = num473 - vector35.Y; - float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485)); - num486 = num483 / num486; - num484 *= num486; - num485 *= num486; - projectile.velocity.X = (projectile.velocity.X * 20f + num484) / 21f; - projectile.velocity.Y = (projectile.velocity.Y * 20f + num485) / 21f; - return; - } - } - - public override void Kill(int timeLeft) - { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 74); - projectile.position.X = projectile.position.X + (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); - projectile.width = 50; - projectile.height = 50; - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); - for (int num621 = 0; num621 < 10; num621++) - { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default(Color), 2f); - Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) - { - Main.dust[num622].scale = 0.5f; - Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; - } - } - for (int num623 = 0; num623 < 15; num623++) - { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default(Color), 3f); - Main.dust[num624].noGravity = true; - Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default(Color), 2f); - Main.dust[num624].velocity *= 2f; - } - } - } +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Ranged +{ + public class AstrealFlame : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Flame"); + Main.projFrames[projectile.type] = 4; + } + + public override void SetDefaults() + { + projectile.width = 20; + projectile.height = 20; + projectile.friendly = true; + projectile.ranged = true; + projectile.penetrate = 1; + projectile.timeLeft = 180; + projectile.alpha = 255; + } + + public override void AI() + { + projectile.alpha -= 5; + projectile.frameCounter++; + if (projectile.frameCounter > 4) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame > 3) + { + projectile.frame = 0; + } + float num472 = projectile.Center.X; + float num473 = projectile.Center.Y; + float num474 = 500f; + bool flag17 = false; + for (int num475 = 0; num475 < 200; num475++) + { + if (Main.npc[num475].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1)) + { + float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2); + float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2); + float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477); + if (num478 < num474) + { + num474 = num478; + num472 = num476; + num473 = num477; + flag17 = true; + } + } + } + if (flag17) + { + float num483 = 16f; + Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + float num484 = num472 - vector35.X; + float num485 = num473 - vector35.Y; + float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485)); + num486 = num483 / num486; + num484 *= num486; + num485 *= num486; + projectile.velocity.X = (projectile.velocity.X * 20f + num484) / 21f; + projectile.velocity.Y = (projectile.velocity.Y * 20f + num485) / 21f; + return; + } + } + + public override void Kill(int timeLeft) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 74); + projectile.position.X = projectile.position.X + (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); + projectile.width = 50; + projectile.height = 50; + projectile.position.X = projectile.position.X - (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + for (int num621 = 0; num621 < 10; num621++) + { + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default(Color), 2f); + Main.dust[num622].velocity *= 3f; + if (Main.rand.Next(2) == 0) + { + Main.dust[num622].scale = 0.5f; + Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + } + } + for (int num623 = 0; num623 < 15; num623++) + { + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default(Color), 3f); + Main.dust[num624].noGravity = true; + Main.dust[num624].velocity *= 5f; + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default(Color), 2f); + Main.dust[num624].velocity *= 2f; + } + } + } } \ No newline at end of file diff --git a/Projectiles/AstrealFlame.png b/Projectiles/Ranged/AstrealFlame.png similarity index 100% rename from Projectiles/AstrealFlame.png rename to Projectiles/Ranged/AstrealFlame.png diff --git a/Projectiles/BallistaGreatArrow.cs b/Projectiles/Ranged/BallistaGreatArrow.cs similarity index 95% rename from Projectiles/BallistaGreatArrow.cs rename to Projectiles/Ranged/BallistaGreatArrow.cs index 56f7cace40..b13d26bf16 100644 --- a/Projectiles/BallistaGreatArrow.cs +++ b/Projectiles/Ranged/BallistaGreatArrow.cs @@ -4,7 +4,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class BallistaGreatArrow : ModProjectile { diff --git a/Projectiles/BallistaGreatArrow.png b/Projectiles/Ranged/BallistaGreatArrow.png similarity index 100% rename from Projectiles/BallistaGreatArrow.png rename to Projectiles/Ranged/BallistaGreatArrow.png diff --git a/Projectiles/BeeRPG.cs b/Projectiles/Ranged/BeeRPG.cs similarity index 97% rename from Projectiles/BeeRPG.cs rename to Projectiles/Ranged/BeeRPG.cs index dc57a353f4..fad0f58bfe 100644 --- a/Projectiles/BeeRPG.cs +++ b/Projectiles/Ranged/BeeRPG.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class BeeRPG : ModProjectile { diff --git a/Projectiles/BeeRPG.png b/Projectiles/Ranged/BeeRPG.png similarity index 100% rename from Projectiles/BeeRPG.png rename to Projectiles/Ranged/BeeRPG.png diff --git a/Projectiles/BeeRPGExplosion.cs b/Projectiles/Ranged/BeeRPGExplosion.cs similarity index 82% rename from Projectiles/BeeRPGExplosion.cs rename to Projectiles/Ranged/BeeRPGExplosion.cs index 8827a86451..dae7d8548e 100644 --- a/Projectiles/BeeRPGExplosion.cs +++ b/Projectiles/Ranged/BeeRPGExplosion.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class BeeRPGExplosion : ModProjectile { @@ -21,7 +21,8 @@ namespace CalamityMod.Projectiles projectile.friendly = true; projectile.ignoreWater = true; projectile.tileCollide = false; - projectile.penetrate = -1; + projectile.ranged = true; + projectile.penetrate = -1; projectile.timeLeft = 5; } } diff --git a/Projectiles/BeeRPGExplosion.png b/Projectiles/Ranged/BeeRPGExplosion.png similarity index 100% rename from Projectiles/BeeRPGExplosion.png rename to Projectiles/Ranged/BeeRPGExplosion.png diff --git a/Projectiles/BigNuke.cs b/Projectiles/Ranged/BigNuke.cs similarity index 97% rename from Projectiles/BigNuke.cs rename to Projectiles/Ranged/BigNuke.cs index 608dda06e2..5dbf5a81f1 100644 --- a/Projectiles/BigNuke.cs +++ b/Projectiles/Ranged/BigNuke.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class BigNuke : ModProjectile { diff --git a/Projectiles/BigNuke.png b/Projectiles/Ranged/BigNuke.png similarity index 100% rename from Projectiles/BigNuke.png rename to Projectiles/Ranged/BigNuke.png diff --git a/Projectiles/BigNukeExplosion.cs b/Projectiles/Ranged/BigNukeExplosion.cs similarity index 82% rename from Projectiles/BigNukeExplosion.cs rename to Projectiles/Ranged/BigNukeExplosion.cs index ed8e6c5f87..f016936462 100644 --- a/Projectiles/BigNukeExplosion.cs +++ b/Projectiles/Ranged/BigNukeExplosion.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class BigNukeExplosion : ModProjectile { @@ -21,7 +21,8 @@ namespace CalamityMod.Projectiles projectile.friendly = true; projectile.ignoreWater = true; projectile.tileCollide = false; - projectile.penetrate = -1; + projectile.ranged = true; + projectile.penetrate = -1; projectile.timeLeft = 5; } } diff --git a/Projectiles/BigNukeExplosion.png b/Projectiles/Ranged/BigNukeExplosion.png similarity index 100% rename from Projectiles/BigNukeExplosion.png rename to Projectiles/Ranged/BigNukeExplosion.png diff --git a/Projectiles/BloodClotFriendly.cs b/Projectiles/Ranged/BloodClotFriendly.cs similarity index 92% rename from Projectiles/BloodClotFriendly.cs rename to Projectiles/Ranged/BloodClotFriendly.cs index fa01c7a6e8..8a4738ff6a 100644 --- a/Projectiles/BloodClotFriendly.cs +++ b/Projectiles/Ranged/BloodClotFriendly.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class BloodClotFriendly : ModProjectile { diff --git a/Projectiles/BloodClotFriendly.png b/Projectiles/Ranged/BloodClotFriendly.png similarity index 100% rename from Projectiles/BloodClotFriendly.png rename to Projectiles/Ranged/BloodClotFriendly.png diff --git a/Projectiles/BloodfireArrow.cs b/Projectiles/Ranged/BloodfireArrow.cs similarity index 93% rename from Projectiles/BloodfireArrow.cs rename to Projectiles/Ranged/BloodfireArrow.cs index cf0337d59a..f9822331d2 100644 --- a/Projectiles/BloodfireArrow.cs +++ b/Projectiles/Ranged/BloodfireArrow.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class BloodfireArrow : ModProjectile { @@ -69,12 +69,12 @@ namespace CalamityMod.Projectiles public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (target.type == NPCID.TargetDummy) + if (target.type == NPCID.TargetDummy || !target.canGhostHeal) { return; } Player player = Main.player[projectile.owner]; - if (Main.rand.Next(2) == 0) + if (Main.rand.Next(3) == 0) { player.statLife += 1; player.HealEffect(1); diff --git a/Projectiles/BloodfireArrow.png b/Projectiles/Ranged/BloodfireArrow.png similarity index 100% rename from Projectiles/BloodfireArrow.png rename to Projectiles/Ranged/BloodfireArrow.png diff --git a/Projectiles/BloodfireBullet.cs b/Projectiles/Ranged/BloodfireBullet.cs similarity index 90% rename from Projectiles/BloodfireBullet.cs rename to Projectiles/Ranged/BloodfireBullet.cs index 1c8eea4367..2696f15901 100644 --- a/Projectiles/BloodfireBullet.cs +++ b/Projectiles/Ranged/BloodfireBullet.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class BloodfireBullet : ModProjectile { @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (target.type == NPCID.TargetDummy) + if (target.type == NPCID.TargetDummy || !target.canGhostHeal) { return; } diff --git a/Projectiles/BloodfireBullet.png b/Projectiles/Ranged/BloodfireBullet.png similarity index 100% rename from Projectiles/BloodfireBullet.png rename to Projectiles/Ranged/BloodfireBullet.png diff --git a/Projectiles/BloodflareSoul.cs b/Projectiles/Ranged/BloodflareSoul.cs similarity index 97% rename from Projectiles/BloodflareSoul.cs rename to Projectiles/Ranged/BloodflareSoul.cs index 44c39576df..0b58a6bb8b 100644 --- a/Projectiles/BloodflareSoul.cs +++ b/Projectiles/Ranged/BloodflareSoul.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class BloodflareSoul : ModProjectile { diff --git a/Projectiles/BloodflareSoul.png b/Projectiles/Ranged/BloodflareSoul.png similarity index 100% rename from Projectiles/BloodflareSoul.png rename to Projectiles/Ranged/BloodflareSoul.png diff --git a/Projectiles/BlueExoArrow.cs b/Projectiles/Ranged/BlueExoArrow.cs similarity index 96% rename from Projectiles/BlueExoArrow.cs rename to Projectiles/Ranged/BlueExoArrow.cs index 92ae735b1d..f82a4da9b7 100644 --- a/Projectiles/BlueExoArrow.cs +++ b/Projectiles/Ranged/BlueExoArrow.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class BlueExoArrow : ModProjectile { diff --git a/Projectiles/BlueExoArrow.png b/Projectiles/Ranged/BlueExoArrow.png similarity index 100% rename from Projectiles/BlueExoArrow.png rename to Projectiles/Ranged/BlueExoArrow.png diff --git a/Projectiles/BlueExoArrow2.cs b/Projectiles/Ranged/BlueExoArrow2.cs similarity index 96% rename from Projectiles/BlueExoArrow2.cs rename to Projectiles/Ranged/BlueExoArrow2.cs index 9066e50d1e..cd25de6ca2 100644 --- a/Projectiles/BlueExoArrow2.cs +++ b/Projectiles/Ranged/BlueExoArrow2.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class BlueExoArrow2 : ModProjectile { diff --git a/Projectiles/BlueExoArrow2.png b/Projectiles/Ranged/BlueExoArrow2.png similarity index 100% rename from Projectiles/BlueExoArrow2.png rename to Projectiles/Ranged/BlueExoArrow2.png diff --git a/Projectiles/Bolt.cs b/Projectiles/Ranged/Bolt.cs similarity index 96% rename from Projectiles/Bolt.cs rename to Projectiles/Ranged/Bolt.cs index 5d74847a81..cdc8f7409a 100644 --- a/Projectiles/Bolt.cs +++ b/Projectiles/Ranged/Bolt.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class Bolt : ModProjectile { diff --git a/Projectiles/Bolt.png b/Projectiles/Ranged/Bolt.png similarity index 100% rename from Projectiles/Bolt.png rename to Projectiles/Ranged/Bolt.png diff --git a/Projectiles/BoltArrow.cs b/Projectiles/Ranged/BoltArrow.cs similarity index 96% rename from Projectiles/BoltArrow.cs rename to Projectiles/Ranged/BoltArrow.cs index c8c76135fc..08acfa97c9 100644 --- a/Projectiles/BoltArrow.cs +++ b/Projectiles/Ranged/BoltArrow.cs @@ -4,7 +4,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class BoltArrow : ModProjectile { diff --git a/Projectiles/BoltArrow.png b/Projectiles/Ranged/BoltArrow.png similarity index 100% rename from Projectiles/BoltArrow.png rename to Projectiles/Ranged/BoltArrow.png diff --git a/Projectiles/BoltExplosion.cs b/Projectiles/Ranged/BoltExplosion.cs similarity index 82% rename from Projectiles/BoltExplosion.cs rename to Projectiles/Ranged/BoltExplosion.cs index 6d0bce97de..45670bd599 100644 --- a/Projectiles/BoltExplosion.cs +++ b/Projectiles/Ranged/BoltExplosion.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class BoltExplosion : ModProjectile { @@ -21,7 +21,8 @@ namespace CalamityMod.Projectiles projectile.friendly = true; projectile.ignoreWater = true; projectile.tileCollide = false; - projectile.penetrate = -1; + projectile.ranged = true; + projectile.penetrate = -1; projectile.timeLeft = 3; } } diff --git a/Projectiles/BoltExplosion.png b/Projectiles/Ranged/BoltExplosion.png similarity index 100% rename from Projectiles/BoltExplosion.png rename to Projectiles/Ranged/BoltExplosion.png diff --git a/Projectiles/BrimstoneBallFriendly.cs b/Projectiles/Ranged/BrimstoneBallFriendly.cs similarity index 92% rename from Projectiles/BrimstoneBallFriendly.cs rename to Projectiles/Ranged/BrimstoneBallFriendly.cs index 707de011c6..da3db8f208 100644 --- a/Projectiles/BrimstoneBallFriendly.cs +++ b/Projectiles/Ranged/BrimstoneBallFriendly.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class BrimstoneBallFriendly : ModProjectile { @@ -19,7 +19,8 @@ namespace CalamityMod.Projectiles projectile.width = 20; projectile.height = 20; projectile.friendly = true; - projectile.penetrate = 6; + projectile.ranged = true; + projectile.penetrate = 6; projectile.aiStyle = 14; projectile.timeLeft = 300; } diff --git a/Projectiles/BrimstoneBallFriendly.png b/Projectiles/Ranged/BrimstoneBallFriendly.png similarity index 100% rename from Projectiles/BrimstoneBallFriendly.png rename to Projectiles/Ranged/BrimstoneBallFriendly.png diff --git a/Projectiles/BrimstoneBolt.cs b/Projectiles/Ranged/BrimstoneBolt.cs similarity index 94% rename from Projectiles/BrimstoneBolt.cs rename to Projectiles/Ranged/BrimstoneBolt.cs index 853d77d1e1..654911052f 100644 --- a/Projectiles/BrimstoneBolt.cs +++ b/Projectiles/Ranged/BrimstoneBolt.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class BrimstoneBolt : ModProjectile { diff --git a/Projectiles/BrimstoneBolt.png b/Projectiles/Ranged/BrimstoneBolt.png similarity index 100% rename from Projectiles/BrimstoneBolt.png rename to Projectiles/Ranged/BrimstoneBolt.png diff --git a/Projectiles/BrimstoneFireFriendly.cs b/Projectiles/Ranged/BrimstoneFireFriendly.cs similarity index 95% rename from Projectiles/BrimstoneFireFriendly.cs rename to Projectiles/Ranged/BrimstoneFireFriendly.cs index 8267273413..bd4481b1f4 100644 --- a/Projectiles/BrimstoneFireFriendly.cs +++ b/Projectiles/Ranged/BrimstoneFireFriendly.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class BrimstoneFireFriendly : ModProjectile { diff --git a/Projectiles/BrimstoneFireFriendly.png b/Projectiles/Ranged/BrimstoneFireFriendly.png similarity index 100% rename from Projectiles/BrimstoneFireFriendly.png rename to Projectiles/Ranged/BrimstoneFireFriendly.png diff --git a/Projectiles/Butcher.cs b/Projectiles/Ranged/Butcher.cs similarity index 96% rename from Projectiles/Butcher.cs rename to Projectiles/Ranged/Butcher.cs index ad3c2ee99a..70d5775b51 100644 --- a/Projectiles/Butcher.cs +++ b/Projectiles/Ranged/Butcher.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class Butcher : ModProjectile { diff --git a/Projectiles/Butcher.png b/Projectiles/Ranged/Butcher.png similarity index 100% rename from Projectiles/Butcher.png rename to Projectiles/Ranged/Butcher.png diff --git a/Projectiles/ChargedBlast.cs b/Projectiles/Ranged/ChargedBlast.cs similarity index 96% rename from Projectiles/ChargedBlast.cs rename to Projectiles/Ranged/ChargedBlast.cs index 15a2186879..e2ae09fc16 100644 --- a/Projectiles/ChargedBlast.cs +++ b/Projectiles/Ranged/ChargedBlast.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class ChargedBlast : ModProjectile { diff --git a/Projectiles/ChargedBlast.png b/Projectiles/Ranged/ChargedBlast.png similarity index 100% rename from Projectiles/ChargedBlast.png rename to Projectiles/Ranged/ChargedBlast.png diff --git a/Projectiles/ChargedBlast2.cs b/Projectiles/Ranged/ChargedBlast2.cs similarity index 96% rename from Projectiles/ChargedBlast2.cs rename to Projectiles/Ranged/ChargedBlast2.cs index d340abbbd1..7b6de8afa5 100644 --- a/Projectiles/ChargedBlast2.cs +++ b/Projectiles/Ranged/ChargedBlast2.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class ChargedBlast2 : ModProjectile { diff --git a/Projectiles/ChargedBlast2.png b/Projectiles/Ranged/ChargedBlast2.png similarity index 100% rename from Projectiles/ChargedBlast2.png rename to Projectiles/Ranged/ChargedBlast2.png diff --git a/Projectiles/ChargedBlast3.cs b/Projectiles/Ranged/ChargedBlast3.cs similarity index 97% rename from Projectiles/ChargedBlast3.cs rename to Projectiles/Ranged/ChargedBlast3.cs index 2fac31f958..b4ab68176a 100644 --- a/Projectiles/ChargedBlast3.cs +++ b/Projectiles/Ranged/ChargedBlast3.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class ChargedBlast3 : ModProjectile { diff --git a/Projectiles/ChargedBlast3.png b/Projectiles/Ranged/ChargedBlast3.png similarity index 100% rename from Projectiles/ChargedBlast3.png rename to Projectiles/Ranged/ChargedBlast3.png diff --git a/Projectiles/Chicken.cs b/Projectiles/Ranged/Chicken.cs similarity index 96% rename from Projectiles/Chicken.cs rename to Projectiles/Ranged/Chicken.cs index c6bc18bc70..caaef9ce79 100644 --- a/Projectiles/Chicken.cs +++ b/Projectiles/Ranged/Chicken.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class Chicken : ModProjectile { diff --git a/Projectiles/Chicken.png b/Projectiles/Ranged/Chicken.png similarity index 100% rename from Projectiles/Chicken.png rename to Projectiles/Ranged/Chicken.png diff --git a/Projectiles/ChickenExplosion.cs b/Projectiles/Ranged/ChickenExplosion.cs similarity index 95% rename from Projectiles/ChickenExplosion.cs rename to Projectiles/Ranged/ChickenExplosion.cs index 998786c6ed..0f6477a46e 100644 --- a/Projectiles/ChickenExplosion.cs +++ b/Projectiles/Ranged/ChickenExplosion.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class ChickenExplosion : ModProjectile { diff --git a/Projectiles/ChickenExplosion.png b/Projectiles/Ranged/ChickenExplosion.png similarity index 100% rename from Projectiles/ChickenExplosion.png rename to Projectiles/Ranged/ChickenExplosion.png diff --git a/Projectiles/Contagion.cs b/Projectiles/Ranged/Contagion.cs similarity index 96% rename from Projectiles/Contagion.cs rename to Projectiles/Ranged/Contagion.cs index f37b6610b9..9299b4d2f7 100644 --- a/Projectiles/Contagion.cs +++ b/Projectiles/Ranged/Contagion.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class Contagion : ModProjectile { diff --git a/Projectiles/Contagion.png b/Projectiles/Ranged/Contagion.png similarity index 100% rename from Projectiles/Contagion.png rename to Projectiles/Ranged/Contagion.png diff --git a/Projectiles/ContagionArrow.cs b/Projectiles/Ranged/ContagionArrow.cs similarity index 88% rename from Projectiles/ContagionArrow.cs rename to Projectiles/Ranged/ContagionArrow.cs index 48908997fc..ca9bafa67a 100644 --- a/Projectiles/ContagionArrow.cs +++ b/Projectiles/Ranged/ContagionArrow.cs @@ -6,11 +6,11 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class ContagionArrow : ModProjectile { - public int addBallTimer = 5; + public int addBallTimer = 10; public override void SetStaticDefaults() { @@ -34,11 +34,11 @@ namespace CalamityMod.Projectiles addBallTimer--; if (addBallTimer <= 0) { - if (projectile.owner == Main.myPlayer) + if (projectile.owner == Main.myPlayer && Main.player[projectile.owner].ownedProjectileCounts[mod.ProjectileType("ContagionBall")] < 100) { Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, mod.ProjectileType("ContagionBall"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } - addBallTimer = 5; + addBallTimer = 10; } Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0.15f) / 255f, ((255 - projectile.alpha) * 0.25f) / 255f, ((255 - projectile.alpha) * 0f) / 255f); if (projectile.ai[0] <= 60f) diff --git a/Projectiles/ContagionArrow.png b/Projectiles/Ranged/ContagionArrow.png similarity index 100% rename from Projectiles/ContagionArrow.png rename to Projectiles/Ranged/ContagionArrow.png diff --git a/Projectiles/ContagionBall.cs b/Projectiles/Ranged/ContagionBall.cs similarity index 96% rename from Projectiles/ContagionBall.cs rename to Projectiles/Ranged/ContagionBall.cs index 2bc4d2d86f..cea396342e 100644 --- a/Projectiles/ContagionBall.cs +++ b/Projectiles/Ranged/ContagionBall.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class ContagionBall : ModProjectile { diff --git a/Projectiles/ContagionBall.png b/Projectiles/Ranged/ContagionBall.png similarity index 100% rename from Projectiles/ContagionBall.png rename to Projectiles/Ranged/ContagionBall.png diff --git a/Projectiles/CorossiveFlames.cs b/Projectiles/Ranged/CorossiveFlames.cs similarity index 95% rename from Projectiles/CorossiveFlames.cs rename to Projectiles/Ranged/CorossiveFlames.cs index 704ea87867..e0cf46cd43 100644 --- a/Projectiles/CorossiveFlames.cs +++ b/Projectiles/Ranged/CorossiveFlames.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class CorossiveFlames : ModProjectile { diff --git a/Projectiles/CorossiveFlames.png b/Projectiles/Ranged/CorossiveFlames.png similarity index 100% rename from Projectiles/CorossiveFlames.png rename to Projectiles/Ranged/CorossiveFlames.png diff --git a/Projectiles/CosmicFire.cs b/Projectiles/Ranged/CosmicFire.cs similarity index 95% rename from Projectiles/CosmicFire.cs rename to Projectiles/Ranged/CosmicFire.cs index dc264c8431..f593fb3a4e 100644 --- a/Projectiles/CosmicFire.cs +++ b/Projectiles/Ranged/CosmicFire.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class CosmicFire : ModProjectile { diff --git a/Projectiles/CosmicFire.png b/Projectiles/Ranged/CosmicFire.png similarity index 100% rename from Projectiles/CosmicFire.png rename to Projectiles/Ranged/CosmicFire.png diff --git a/Projectiles/CursedRound.cs b/Projectiles/Ranged/CursedRound.cs similarity index 95% rename from Projectiles/CursedRound.cs rename to Projectiles/Ranged/CursedRound.cs index f64456143b..77898e20b5 100644 --- a/Projectiles/CursedRound.cs +++ b/Projectiles/Ranged/CursedRound.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class CursedRound : ModProjectile { diff --git a/Projectiles/CursedRound.png b/Projectiles/Ranged/CursedRound.png similarity index 100% rename from Projectiles/CursedRound.png rename to Projectiles/Ranged/CursedRound.png diff --git a/Projectiles/DaemonsFlame.cs b/Projectiles/Ranged/DaemonsFlame.cs similarity index 96% rename from Projectiles/DaemonsFlame.cs rename to Projectiles/Ranged/DaemonsFlame.cs index 0c02fe8f78..7e4f7abc05 100644 --- a/Projectiles/DaemonsFlame.cs +++ b/Projectiles/Ranged/DaemonsFlame.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class DaemonsFlame : ModProjectile { diff --git a/Projectiles/DaemonsFlame.png b/Projectiles/Ranged/DaemonsFlame.png similarity index 100% rename from Projectiles/DaemonsFlame.png rename to Projectiles/Ranged/DaemonsFlame.png diff --git a/Projectiles/DaemonsFlameArrow.cs b/Projectiles/Ranged/DaemonsFlameArrow.cs similarity index 96% rename from Projectiles/DaemonsFlameArrow.cs rename to Projectiles/Ranged/DaemonsFlameArrow.cs index e028ce23ad..bb3d003855 100644 --- a/Projectiles/DaemonsFlameArrow.cs +++ b/Projectiles/Ranged/DaemonsFlameArrow.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class DaemonsFlameArrow : ModProjectile { diff --git a/Projectiles/DaemonsFlameArrow.png b/Projectiles/Ranged/DaemonsFlameArrow.png similarity index 100% rename from Projectiles/DaemonsFlameArrow.png rename to Projectiles/Ranged/DaemonsFlameArrow.png diff --git a/Projectiles/DragonBurst.cs b/Projectiles/Ranged/DragonBurst.cs similarity index 95% rename from Projectiles/DragonBurst.cs rename to Projectiles/Ranged/DragonBurst.cs index 75b103047e..6e6f0294e7 100644 --- a/Projectiles/DragonBurst.cs +++ b/Projectiles/Ranged/DragonBurst.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class DragonBurst : ModProjectile { diff --git a/Projectiles/DragonBurst.png b/Projectiles/Ranged/DragonBurst.png similarity index 100% rename from Projectiles/DragonBurst.png rename to Projectiles/Ranged/DragonBurst.png diff --git a/Projectiles/Drataliornus.cs b/Projectiles/Ranged/Drataliornus.cs similarity index 96% rename from Projectiles/Drataliornus.cs rename to Projectiles/Ranged/Drataliornus.cs index df7b2080e6..1c97608668 100644 --- a/Projectiles/Drataliornus.cs +++ b/Projectiles/Ranged/Drataliornus.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class Drataliornus : ModProjectile { diff --git a/Projectiles/Drataliornus.png b/Projectiles/Ranged/Drataliornus.png similarity index 100% rename from Projectiles/Drataliornus.png rename to Projectiles/Ranged/Drataliornus.png diff --git a/Projectiles/DrataliornusExoArrow.cs b/Projectiles/Ranged/DrataliornusExoArrow.cs similarity index 96% rename from Projectiles/DrataliornusExoArrow.cs rename to Projectiles/Ranged/DrataliornusExoArrow.cs index 7b3b78d034..e3ffe50596 100644 --- a/Projectiles/DrataliornusExoArrow.cs +++ b/Projectiles/Ranged/DrataliornusExoArrow.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class DrataliornusExoArrow : ModProjectile { diff --git a/Projectiles/DrataliornusExoArrow.png b/Projectiles/Ranged/DrataliornusExoArrow.png similarity index 100% rename from Projectiles/DrataliornusExoArrow.png rename to Projectiles/Ranged/DrataliornusExoArrow.png diff --git a/Projectiles/DrataliornusFlame.cs b/Projectiles/Ranged/DrataliornusFlame.cs similarity index 97% rename from Projectiles/DrataliornusFlame.cs rename to Projectiles/Ranged/DrataliornusFlame.cs index 1fe9b74b9b..6ef4720195 100644 --- a/Projectiles/DrataliornusFlame.cs +++ b/Projectiles/Ranged/DrataliornusFlame.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class DrataliornusFlame : ModProjectile { diff --git a/Projectiles/DrataliornusFlame.png b/Projectiles/Ranged/DrataliornusFlame.png similarity index 100% rename from Projectiles/DrataliornusFlame.png rename to Projectiles/Ranged/DrataliornusFlame.png diff --git a/Projectiles/DrillCannon.png b/Projectiles/Ranged/DrillCannon.png similarity index 100% rename from Projectiles/DrillCannon.png rename to Projectiles/Ranged/DrillCannon.png diff --git a/Projectiles/ElysianArrow.cs b/Projectiles/Ranged/ElysianArrow.cs similarity index 97% rename from Projectiles/ElysianArrow.cs rename to Projectiles/Ranged/ElysianArrow.cs index 698a18dd03..6d476e8849 100644 --- a/Projectiles/ElysianArrow.cs +++ b/Projectiles/Ranged/ElysianArrow.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class ElysianArrow : ModProjectile { diff --git a/Projectiles/ElysianArrow.png b/Projectiles/Ranged/ElysianArrow.png similarity index 100% rename from Projectiles/ElysianArrow.png rename to Projectiles/Ranged/ElysianArrow.png diff --git a/Projectiles/EnhancedNanoRound.cs b/Projectiles/Ranged/EnhancedNanoRound.cs similarity index 96% rename from Projectiles/EnhancedNanoRound.cs rename to Projectiles/Ranged/EnhancedNanoRound.cs index efe080576c..f9b5cb2b9c 100644 --- a/Projectiles/EnhancedNanoRound.cs +++ b/Projectiles/Ranged/EnhancedNanoRound.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class EnhancedNanoRound : ModProjectile { diff --git a/Projectiles/EnhancedNanoRound.png b/Projectiles/Ranged/EnhancedNanoRound.png similarity index 100% rename from Projectiles/EnhancedNanoRound.png rename to Projectiles/Ranged/EnhancedNanoRound.png diff --git a/Projectiles/EssenceFire.cs b/Projectiles/Ranged/EssenceFire.cs similarity index 95% rename from Projectiles/EssenceFire.cs rename to Projectiles/Ranged/EssenceFire.cs index e8057cdb1d..cabb6c7b02 100644 --- a/Projectiles/EssenceFire.cs +++ b/Projectiles/Ranged/EssenceFire.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class EssenceFire : ModProjectile { diff --git a/Projectiles/EssenceFire.png b/Projectiles/Ranged/EssenceFire.png similarity index 100% rename from Projectiles/EssenceFire.png rename to Projectiles/Ranged/EssenceFire.png diff --git a/Projectiles/ExoFire.cs b/Projectiles/Ranged/ExoFire.cs similarity index 96% rename from Projectiles/ExoFire.cs rename to Projectiles/Ranged/ExoFire.cs index 800ef8fa49..feceba44d8 100644 --- a/Projectiles/ExoFire.cs +++ b/Projectiles/Ranged/ExoFire.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class ExoFire : ModProjectile { diff --git a/Projectiles/ExoFire.png b/Projectiles/Ranged/ExoFire.png similarity index 100% rename from Projectiles/ExoFire.png rename to Projectiles/Ranged/ExoFire.png diff --git a/Projectiles/ExoMark.cs b/Projectiles/Ranged/ExoMark.cs similarity index 95% rename from Projectiles/ExoMark.cs rename to Projectiles/Ranged/ExoMark.cs index e070eebd9d..5ada1de663 100644 --- a/Projectiles/ExoMark.cs +++ b/Projectiles/Ranged/ExoMark.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class ExoMark : ModProjectile { @@ -23,7 +23,8 @@ namespace CalamityMod.Projectiles projectile.tileCollide = false; projectile.timeLeft = 900; projectile.ignoreWater = true; - projectile.alpha = 255; + projectile.ranged = true; + projectile.alpha = 255; projectile.penetrate = -1; projectile.localNPCHitCooldown = 5; } diff --git a/Projectiles/ExoMark.png b/Projectiles/Ranged/ExoMark.png similarity index 100% rename from Projectiles/ExoMark.png rename to Projectiles/Ranged/ExoMark.png diff --git a/Projectiles/ExoTornado.cs b/Projectiles/Ranged/ExoTornado.cs similarity index 96% rename from Projectiles/ExoTornado.cs rename to Projectiles/Ranged/ExoTornado.cs index fb230c3562..0324271034 100644 --- a/Projectiles/ExoTornado.cs +++ b/Projectiles/Ranged/ExoTornado.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class ExoTornado : ModProjectile { diff --git a/Projectiles/ExoTornado.png b/Projectiles/Ranged/ExoTornado.png similarity index 100% rename from Projectiles/ExoTornado.png rename to Projectiles/Ranged/ExoTornado.png diff --git a/Projectiles/ExplodingStake.cs b/Projectiles/Ranged/ExplodingStake.cs similarity index 95% rename from Projectiles/ExplodingStake.cs rename to Projectiles/Ranged/ExplodingStake.cs index fd2391055f..5d5fc7855f 100644 --- a/Projectiles/ExplodingStake.cs +++ b/Projectiles/Ranged/ExplodingStake.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class ExplodingStake : ModProjectile { diff --git a/Projectiles/ExplodingStake.png b/Projectiles/Ranged/ExplodingStake.png similarity index 100% rename from Projectiles/ExplodingStake.png rename to Projectiles/Ranged/ExplodingStake.png diff --git a/Projectiles/Ranged/ExplosiveShellBullet.cs b/Projectiles/Ranged/ExplosiveShellBullet.cs new file mode 100644 index 0000000000..2434a57d10 --- /dev/null +++ b/Projectiles/Ranged/ExplosiveShellBullet.cs @@ -0,0 +1,62 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Ranged +{ + public class ExplosiveShellBullet : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Explosive Shell Bullet"); + } + + public override void SetDefaults() + { + projectile.width = 4; + projectile.height = 4; + projectile.light = 0.5f; + projectile.alpha = 255; + projectile.extraUpdates = 10; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.aiStyle = 1; + aiType = 242; + projectile.penetrate = 1; + projectile.timeLeft = 600; + } + + public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) + { + damage += target.lifeMax / 150; //120 + 30 = 150 + (100000 / 150 = 666) = 816 * 15 (pellets) = 12240 * 2 (explosion) = 24480 = 24.48% of boss HP + if (damage > target.lifeMax / 90 && CalamityPlayer.areThereAnyDamnBosses) + damage = target.lifeMax / 90; + } + + public override void Kill(int timeLeft) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + projectile.position = projectile.Center; + projectile.width = (projectile.height = 32); + projectile.position.X = projectile.position.X - (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + for (int num193 = 0; num193 < 2; num193++) + { + Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default(Color), 1.5f); + } + for (int num194 = 0; num194 < 20; num194++) + { + int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 0, default(Color), 2.5f); + Main.dust[num195].noGravity = true; + Main.dust[num195].velocity *= 3f; + num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 1.5f); + Main.dust[num195].velocity *= 2f; + Main.dust[num195].noGravity = true; + } + projectile.Damage(); + } + } +} \ No newline at end of file diff --git a/Projectiles/Ranged/ExplosiveShellBullet.png b/Projectiles/Ranged/ExplosiveShellBullet.png new file mode 100644 index 0000000000..ef327144f8 Binary files /dev/null and b/Projectiles/Ranged/ExplosiveShellBullet.png differ diff --git a/Projectiles/FishronRPG.cs b/Projectiles/Ranged/FishronRPG.cs similarity index 97% rename from Projectiles/FishronRPG.cs rename to Projectiles/Ranged/FishronRPG.cs index d87a44d837..44a8b3d380 100644 --- a/Projectiles/FishronRPG.cs +++ b/Projectiles/Ranged/FishronRPG.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class FishronRPG : ModProjectile { diff --git a/Projectiles/FishronRPG.png b/Projectiles/Ranged/FishronRPG.png similarity index 100% rename from Projectiles/FishronRPG.png rename to Projectiles/Ranged/FishronRPG.png diff --git a/Projectiles/FlakKraken.cs b/Projectiles/Ranged/FlakKraken.cs similarity index 96% rename from Projectiles/FlakKraken.cs rename to Projectiles/Ranged/FlakKraken.cs index 1a6c23b8a9..7ab9898c8b 100644 --- a/Projectiles/FlakKraken.cs +++ b/Projectiles/Ranged/FlakKraken.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class FlakKraken : ModProjectile { diff --git a/Projectiles/FlakKraken.png b/Projectiles/Ranged/FlakKraken.png similarity index 100% rename from Projectiles/FlakKraken.png rename to Projectiles/Ranged/FlakKraken.png diff --git a/Projectiles/FlakKrakenGun.cs b/Projectiles/Ranged/FlakKrakenGun.cs similarity index 96% rename from Projectiles/FlakKrakenGun.cs rename to Projectiles/Ranged/FlakKrakenGun.cs index e59a5e08bc..197ab1cc1b 100644 --- a/Projectiles/FlakKrakenGun.cs +++ b/Projectiles/Ranged/FlakKrakenGun.cs @@ -7,7 +7,7 @@ using Terraria.ID; using Terraria.ModLoader; using Terraria.Enums; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class FlakKrakenGun : ModProjectile { diff --git a/Projectiles/FlakKrakenGun.png b/Projectiles/Ranged/FlakKrakenGun.png similarity index 100% rename from Projectiles/FlakKrakenGun.png rename to Projectiles/Ranged/FlakKrakenGun.png diff --git a/Projectiles/FlamingStake.cs b/Projectiles/Ranged/FlamingStake.cs similarity index 95% rename from Projectiles/FlamingStake.cs rename to Projectiles/Ranged/FlamingStake.cs index a2d37976bb..6189805540 100644 --- a/Projectiles/FlamingStake.cs +++ b/Projectiles/Ranged/FlamingStake.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class FlamingStake : ModProjectile { diff --git a/Projectiles/FlamingStake.png b/Projectiles/Ranged/FlamingStake.png similarity index 100% rename from Projectiles/FlamingStake.png rename to Projectiles/Ranged/FlamingStake.png diff --git a/Projectiles/FlareBat.cs b/Projectiles/Ranged/FlareBat.cs similarity index 96% rename from Projectiles/FlareBat.cs rename to Projectiles/Ranged/FlareBat.cs index c60cef144d..261e5ab185 100644 --- a/Projectiles/FlareBat.cs +++ b/Projectiles/Ranged/FlareBat.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class FlareBat : ModProjectile { diff --git a/Projectiles/FlareBat.png b/Projectiles/Ranged/FlareBat.png similarity index 100% rename from Projectiles/FlareBat.png rename to Projectiles/Ranged/FlareBat.png diff --git a/Projectiles/Flash.cs b/Projectiles/Ranged/Flash.cs similarity index 93% rename from Projectiles/Flash.cs rename to Projectiles/Ranged/Flash.cs index 0a7cb0026e..633e35ef47 100644 --- a/Projectiles/Flash.cs +++ b/Projectiles/Ranged/Flash.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class Flash : ModProjectile { @@ -21,7 +21,8 @@ namespace CalamityMod.Projectiles projectile.friendly = true; projectile.ignoreWater = true; projectile.tileCollide = false; - projectile.penetrate = -1; + projectile.ranged = true; + projectile.penetrate = -1; projectile.timeLeft = 5; } diff --git a/Projectiles/Flash.png b/Projectiles/Ranged/Flash.png similarity index 100% rename from Projectiles/Flash.png rename to Projectiles/Ranged/Flash.png diff --git a/Projectiles/FlashBullet.cs b/Projectiles/Ranged/FlashBullet.cs similarity index 96% rename from Projectiles/FlashBullet.cs rename to Projectiles/Ranged/FlashBullet.cs index c22a418df6..31147f0367 100644 --- a/Projectiles/FlashBullet.cs +++ b/Projectiles/Ranged/FlashBullet.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class FlashBullet : ModProjectile { diff --git a/Projectiles/FlashBullet.png b/Projectiles/Ranged/FlashBullet.png similarity index 100% rename from Projectiles/FlashBullet.png rename to Projectiles/Ranged/FlashBullet.png diff --git a/Projectiles/FossilShard.cs b/Projectiles/Ranged/FossilShard.cs similarity index 93% rename from Projectiles/FossilShard.cs rename to Projectiles/Ranged/FossilShard.cs index 8809644713..09450be5f8 100644 --- a/Projectiles/FossilShard.cs +++ b/Projectiles/Ranged/FossilShard.cs @@ -4,7 +4,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class FossilShard : ModProjectile { diff --git a/Projectiles/FossilShard.png b/Projectiles/Ranged/FossilShard.png similarity index 100% rename from Projectiles/FossilShard.png rename to Projectiles/Ranged/FossilShard.png diff --git a/Projectiles/FrostsparkBullet.cs b/Projectiles/Ranged/FrostsparkBullet.cs similarity index 96% rename from Projectiles/FrostsparkBullet.cs rename to Projectiles/Ranged/FrostsparkBullet.cs index 345fc2aca4..7f9b7d6051 100644 --- a/Projectiles/FrostsparkBullet.cs +++ b/Projectiles/Ranged/FrostsparkBullet.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class FrostsparkBullet : ModProjectile { diff --git a/Projectiles/FrostsparkBullet.png b/Projectiles/Ranged/FrostsparkBullet.png similarity index 100% rename from Projectiles/FrostsparkBullet.png rename to Projectiles/Ranged/FrostsparkBullet.png diff --git a/Projectiles/FungiOrb.cs b/Projectiles/Ranged/FungiOrb.cs similarity index 95% rename from Projectiles/FungiOrb.cs rename to Projectiles/Ranged/FungiOrb.cs index c87422e7fb..3c06db82ea 100644 --- a/Projectiles/FungiOrb.cs +++ b/Projectiles/Ranged/FungiOrb.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class FungiOrb : ModProjectile { diff --git a/Projectiles/FungiOrb.png b/Projectiles/Ranged/FungiOrb.png similarity index 100% rename from Projectiles/FungiOrb.png rename to Projectiles/Ranged/FungiOrb.png diff --git a/Projectiles/FungiOrb2.cs b/Projectiles/Ranged/FungiOrb2.cs similarity index 94% rename from Projectiles/FungiOrb2.cs rename to Projectiles/Ranged/FungiOrb2.cs index ca266bf486..2e1c60d0cd 100644 --- a/Projectiles/FungiOrb2.cs +++ b/Projectiles/Ranged/FungiOrb2.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class FungiOrb2 : ModProjectile { diff --git a/Projectiles/FungiOrb2.png b/Projectiles/Ranged/FungiOrb2.png similarity index 100% rename from Projectiles/FungiOrb2.png rename to Projectiles/Ranged/FungiOrb2.png diff --git a/Projectiles/GoliathExplosion.cs b/Projectiles/Ranged/GoliathExplosion.cs similarity index 82% rename from Projectiles/GoliathExplosion.cs rename to Projectiles/Ranged/GoliathExplosion.cs index 33e6824836..b8d9de7155 100644 --- a/Projectiles/GoliathExplosion.cs +++ b/Projectiles/Ranged/GoliathExplosion.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class GoliathExplosion : ModProjectile { @@ -21,7 +21,8 @@ namespace CalamityMod.Projectiles projectile.friendly = true; projectile.ignoreWater = true; projectile.tileCollide = false; - projectile.penetrate = -1; + projectile.ranged = true; + projectile.penetrate = -1; projectile.timeLeft = 5; } } diff --git a/Projectiles/GoliathExplosion.png b/Projectiles/Ranged/GoliathExplosion.png similarity index 100% rename from Projectiles/GoliathExplosion.png rename to Projectiles/Ranged/GoliathExplosion.png diff --git a/Projectiles/GoliathRocket.cs b/Projectiles/Ranged/GoliathRocket.cs similarity index 97% rename from Projectiles/GoliathRocket.cs rename to Projectiles/Ranged/GoliathRocket.cs index fd8a6a6ce5..7acd09415c 100644 --- a/Projectiles/GoliathRocket.cs +++ b/Projectiles/Ranged/GoliathRocket.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class GoliathRocket : ModProjectile { diff --git a/Projectiles/GoliathRocket.png b/Projectiles/Ranged/GoliathRocket.png similarity index 100% rename from Projectiles/GoliathRocket.png rename to Projectiles/Ranged/GoliathRocket.png diff --git a/Projectiles/GreenExoArrow.cs b/Projectiles/Ranged/GreenExoArrow.cs similarity index 96% rename from Projectiles/GreenExoArrow.cs rename to Projectiles/Ranged/GreenExoArrow.cs index aaf995c909..c667c41bb6 100644 --- a/Projectiles/GreenExoArrow.cs +++ b/Projectiles/Ranged/GreenExoArrow.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class GreenExoArrow : ModProjectile { diff --git a/Projectiles/GreenExoArrow.png b/Projectiles/Ranged/GreenExoArrow.png similarity index 100% rename from Projectiles/GreenExoArrow.png rename to Projectiles/Ranged/GreenExoArrow.png diff --git a/Projectiles/HiveBomb.cs b/Projectiles/Ranged/HiveBomb.cs similarity index 97% rename from Projectiles/HiveBomb.cs rename to Projectiles/Ranged/HiveBomb.cs index a643f2cfe8..1e0a8550ab 100644 --- a/Projectiles/HiveBomb.cs +++ b/Projectiles/Ranged/HiveBomb.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class HiveBomb : ModProjectile { diff --git a/Projectiles/HiveBomb.png b/Projectiles/Ranged/HiveBomb.png similarity index 100% rename from Projectiles/HiveBomb.png rename to Projectiles/Ranged/HiveBomb.png diff --git a/Projectiles/HiveBombExplosion.cs b/Projectiles/Ranged/HiveBombExplosion.cs similarity index 85% rename from Projectiles/HiveBombExplosion.cs rename to Projectiles/Ranged/HiveBombExplosion.cs index 12242299ec..577070bb04 100644 --- a/Projectiles/HiveBombExplosion.cs +++ b/Projectiles/Ranged/HiveBombExplosion.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class HiveBombExplosion : ModProjectile { @@ -21,7 +21,8 @@ namespace CalamityMod.Projectiles projectile.friendly = true; projectile.ignoreWater = true; projectile.tileCollide = false; - projectile.penetrate = -1; + projectile.ranged = true; + projectile.penetrate = -1; projectile.timeLeft = 5; } diff --git a/Projectiles/HiveBombExplosion.png b/Projectiles/Ranged/HiveBombExplosion.png similarity index 100% rename from Projectiles/HiveBombExplosion.png rename to Projectiles/Ranged/HiveBombExplosion.png diff --git a/Projectiles/HiveExplosion.cs b/Projectiles/Ranged/HiveExplosion.cs similarity index 82% rename from Projectiles/HiveExplosion.cs rename to Projectiles/Ranged/HiveExplosion.cs index c84dd23448..18e74dd6db 100644 --- a/Projectiles/HiveExplosion.cs +++ b/Projectiles/Ranged/HiveExplosion.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class HiveExplosion : ModProjectile { @@ -21,7 +21,8 @@ namespace CalamityMod.Projectiles projectile.friendly = true; projectile.ignoreWater = true; projectile.tileCollide = false; - projectile.penetrate = -1; + projectile.ranged = true; + projectile.penetrate = -1; projectile.timeLeft = 5; } } diff --git a/Projectiles/HiveExplosion.png b/Projectiles/Ranged/HiveExplosion.png similarity index 100% rename from Projectiles/HiveExplosion.png rename to Projectiles/Ranged/HiveExplosion.png diff --git a/Projectiles/HiveMissile.cs b/Projectiles/Ranged/HiveMissile.cs similarity index 97% rename from Projectiles/HiveMissile.cs rename to Projectiles/Ranged/HiveMissile.cs index b8e74da9fb..70887d2e59 100644 --- a/Projectiles/HiveMissile.cs +++ b/Projectiles/Ranged/HiveMissile.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class HiveMissile : ModProjectile { diff --git a/Projectiles/HiveMissile.png b/Projectiles/Ranged/HiveMissile.png similarity index 100% rename from Projectiles/HiveMissile.png rename to Projectiles/Ranged/HiveMissile.png diff --git a/Projectiles/HolyFireBullet.cs b/Projectiles/Ranged/HolyFireBullet.cs similarity index 96% rename from Projectiles/HolyFireBullet.cs rename to Projectiles/Ranged/HolyFireBullet.cs index 3127eb93ad..f4114d70a8 100644 --- a/Projectiles/HolyFireBullet.cs +++ b/Projectiles/Ranged/HolyFireBullet.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class HolyFireBullet : ModProjectile { diff --git a/Projectiles/HolyFireBullet.png b/Projectiles/Ranged/HolyFireBullet.png similarity index 100% rename from Projectiles/HolyFireBullet.png rename to Projectiles/Ranged/HolyFireBullet.png diff --git a/Projectiles/HyperiusBullet.cs b/Projectiles/Ranged/HyperiusBullet.cs similarity index 93% rename from Projectiles/HyperiusBullet.cs rename to Projectiles/Ranged/HyperiusBullet.cs index 6d889dad37..1dd389171f 100644 --- a/Projectiles/HyperiusBullet.cs +++ b/Projectiles/Ranged/HyperiusBullet.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class HyperiusBullet : ModProjectile { @@ -35,11 +35,11 @@ namespace CalamityMod.Projectiles projectile.localAI[0] += 1f; if (projectile.localAI[0] >= 6f) { - for (int num136 = 0; num136 < 10; num136++) + for (int num136 = 0; num136 < 3; num136++) { float x2 = projectile.position.X - projectile.velocity.X / 10f * (float)num136; float y2 = projectile.position.Y - projectile.velocity.Y / 10f * (float)num136; - int num137 = Dust.NewDust(new Vector2(x2, y2), 1, 1, 235, 0f, 0f, 0, default(Color), 0.5f); + int num137 = Dust.NewDust(new Vector2(x2, y2), 1, 1, 235, 0f, 0f, 0, default(Color), 0.75f); Main.dust[num137].alpha = projectile.alpha; Main.dust[num137].position.X = x2; Main.dust[num137].position.Y = y2; diff --git a/Projectiles/HyperiusBullet.png b/Projectiles/Ranged/HyperiusBullet.png similarity index 100% rename from Projectiles/HyperiusBullet.png rename to Projectiles/Ranged/HyperiusBullet.png diff --git a/Projectiles/LeafArrow.cs b/Projectiles/Ranged/LeafArrow.cs similarity index 94% rename from Projectiles/LeafArrow.cs rename to Projectiles/Ranged/LeafArrow.cs index 5d44b23724..84859f0722 100644 --- a/Projectiles/LeafArrow.cs +++ b/Projectiles/Ranged/LeafArrow.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class LeafArrow : ModProjectile { diff --git a/Projectiles/LeafArrow.png b/Projectiles/Ranged/LeafArrow.png similarity index 100% rename from Projectiles/LeafArrow.png rename to Projectiles/Ranged/LeafArrow.png diff --git a/Projectiles/LunarBolt.cs b/Projectiles/Ranged/LunarBolt.cs similarity index 94% rename from Projectiles/LunarBolt.cs rename to Projectiles/Ranged/LunarBolt.cs index 0613541c6d..d8d8af450c 100644 --- a/Projectiles/LunarBolt.cs +++ b/Projectiles/Ranged/LunarBolt.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class LunarBolt : ModProjectile { diff --git a/Projectiles/LunarBolt.png b/Projectiles/Ranged/LunarBolt.png similarity index 100% rename from Projectiles/LunarBolt.png rename to Projectiles/Ranged/LunarBolt.png diff --git a/Projectiles/LunarBolt2.cs b/Projectiles/Ranged/LunarBolt2.cs similarity index 94% rename from Projectiles/LunarBolt2.cs rename to Projectiles/Ranged/LunarBolt2.cs index 118650224c..090d7d45af 100644 --- a/Projectiles/LunarBolt2.cs +++ b/Projectiles/Ranged/LunarBolt2.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class LunarBolt2 : ModProjectile { diff --git a/Projectiles/LunarBolt2.png b/Projectiles/Ranged/LunarBolt2.png similarity index 100% rename from Projectiles/LunarBolt2.png rename to Projectiles/Ranged/LunarBolt2.png diff --git a/Projectiles/MagnaStrike.cs b/Projectiles/Ranged/MagnaStrike.cs similarity index 94% rename from Projectiles/MagnaStrike.cs rename to Projectiles/Ranged/MagnaStrike.cs index aa824a9663..f78b8b2b9b 100644 --- a/Projectiles/MagnaStrike.cs +++ b/Projectiles/Ranged/MagnaStrike.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class MagnaStrike : ModProjectile { diff --git a/Projectiles/MagnaStrike.png b/Projectiles/Ranged/MagnaStrike.png similarity index 100% rename from Projectiles/MagnaStrike.png rename to Projectiles/Ranged/MagnaStrike.png diff --git a/Projectiles/MechanicalBarracuda.cs b/Projectiles/Ranged/MechanicalBarracuda.cs similarity index 91% rename from Projectiles/MechanicalBarracuda.cs rename to Projectiles/Ranged/MechanicalBarracuda.cs index a94b5800d6..03cd134b92 100644 --- a/Projectiles/MechanicalBarracuda.cs +++ b/Projectiles/Ranged/MechanicalBarracuda.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class MechanicalBarracuda : ModProjectile { diff --git a/Projectiles/MechanicalBarracuda.png b/Projectiles/Ranged/MechanicalBarracuda.png similarity index 100% rename from Projectiles/MechanicalBarracuda.png rename to Projectiles/Ranged/MechanicalBarracuda.png diff --git a/Projectiles/MeowFire.cs b/Projectiles/Ranged/MeowFire.cs similarity index 96% rename from Projectiles/MeowFire.cs rename to Projectiles/Ranged/MeowFire.cs index 82f25710c6..4af1077656 100644 --- a/Projectiles/MeowFire.cs +++ b/Projectiles/Ranged/MeowFire.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class MeowFire : ModProjectile { diff --git a/Projectiles/MeowFire.png b/Projectiles/Ranged/MeowFire.png similarity index 100% rename from Projectiles/MeowFire.png rename to Projectiles/Ranged/MeowFire.png diff --git a/Projectiles/MeowFire2.cs b/Projectiles/Ranged/MeowFire2.cs similarity index 96% rename from Projectiles/MeowFire2.cs rename to Projectiles/Ranged/MeowFire2.cs index e268864bbd..810c7d54d5 100644 --- a/Projectiles/MeowFire2.cs +++ b/Projectiles/Ranged/MeowFire2.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class MeowFire2 : ModProjectile { diff --git a/Projectiles/MeowFire2.png b/Projectiles/Ranged/MeowFire2.png similarity index 100% rename from Projectiles/MeowFire2.png rename to Projectiles/Ranged/MeowFire2.png diff --git a/Projectiles/MiniRocket.cs b/Projectiles/Ranged/MiniRocket.cs similarity index 97% rename from Projectiles/MiniRocket.cs rename to Projectiles/Ranged/MiniRocket.cs index f56abf9ab1..e96ddb46fb 100644 --- a/Projectiles/MiniRocket.cs +++ b/Projectiles/Ranged/MiniRocket.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class MiniRocket : ModProjectile { diff --git a/Projectiles/MiniRocket.png b/Projectiles/Ranged/MiniRocket.png similarity index 100% rename from Projectiles/MiniRocket.png rename to Projectiles/Ranged/MiniRocket.png diff --git a/Projectiles/MiniRocketExplosion.cs b/Projectiles/Ranged/MiniRocketExplosion.cs similarity index 82% rename from Projectiles/MiniRocketExplosion.cs rename to Projectiles/Ranged/MiniRocketExplosion.cs index d3da7cf0c9..dd33e7b1ef 100644 --- a/Projectiles/MiniRocketExplosion.cs +++ b/Projectiles/Ranged/MiniRocketExplosion.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class MiniRocketExplosion : ModProjectile { @@ -21,7 +21,8 @@ namespace CalamityMod.Projectiles projectile.friendly = true; projectile.ignoreWater = true; projectile.tileCollide = false; - projectile.penetrate = -1; + projectile.ranged = true; + projectile.penetrate = -1; projectile.timeLeft = 5; } } diff --git a/Projectiles/MiniRocketExplosion.png b/Projectiles/Ranged/MiniRocketExplosion.png similarity index 100% rename from Projectiles/MiniRocketExplosion.png rename to Projectiles/Ranged/MiniRocketExplosion.png diff --git a/Projectiles/MistArrow.cs b/Projectiles/Ranged/MistArrow.cs similarity index 94% rename from Projectiles/MistArrow.cs rename to Projectiles/Ranged/MistArrow.cs index c719647261..f61080b00e 100644 --- a/Projectiles/MistArrow.cs +++ b/Projectiles/Ranged/MistArrow.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class MistArrow : ModProjectile { diff --git a/Projectiles/MistArrow.png b/Projectiles/Ranged/MistArrow.png similarity index 100% rename from Projectiles/MistArrow.png rename to Projectiles/Ranged/MistArrow.png diff --git a/Projectiles/MortarRound.cs b/Projectiles/Ranged/MortarRound.cs similarity index 97% rename from Projectiles/MortarRound.cs rename to Projectiles/Ranged/MortarRound.cs index 7317681948..855ba98311 100644 --- a/Projectiles/MortarRound.cs +++ b/Projectiles/Ranged/MortarRound.cs @@ -7,7 +7,7 @@ using Terraria.ID; using Terraria.GameContent.Achievements; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class MortarRound : ModProjectile { diff --git a/Projectiles/MortarRound.png b/Projectiles/Ranged/MortarRound.png similarity index 100% rename from Projectiles/MortarRound.png rename to Projectiles/Ranged/MortarRound.png diff --git a/Projectiles/Nanomachine.cs b/Projectiles/Ranged/Nanomachine.cs similarity index 96% rename from Projectiles/Nanomachine.cs rename to Projectiles/Ranged/Nanomachine.cs index d321038197..5219589faf 100644 --- a/Projectiles/Nanomachine.cs +++ b/Projectiles/Ranged/Nanomachine.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class Nanomachine : ModProjectile { diff --git a/Projectiles/Nanomachine.png b/Projectiles/Ranged/Nanomachine.png similarity index 100% rename from Projectiles/Nanomachine.png rename to Projectiles/Ranged/Nanomachine.png diff --git a/Projectiles/NapalmArrow.cs b/Projectiles/Ranged/NapalmArrow.cs similarity index 97% rename from Projectiles/NapalmArrow.cs rename to Projectiles/Ranged/NapalmArrow.cs index 77b9b16417..973e413a4e 100644 --- a/Projectiles/NapalmArrow.cs +++ b/Projectiles/Ranged/NapalmArrow.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class NapalmArrow : ModProjectile { diff --git a/Projectiles/NapalmArrow.png b/Projectiles/Ranged/NapalmArrow.png similarity index 100% rename from Projectiles/NapalmArrow.png rename to Projectiles/Ranged/NapalmArrow.png diff --git a/Projectiles/NebulaShot.cs b/Projectiles/Ranged/NebulaShot.cs similarity index 63% rename from Projectiles/NebulaShot.cs rename to Projectiles/Ranged/NebulaShot.cs index 05ca1d2fde..ff05d3b319 100644 --- a/Projectiles/NebulaShot.cs +++ b/Projectiles/Ranged/NebulaShot.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class NebulaShot : ModProjectile { @@ -25,7 +25,9 @@ namespace CalamityMod.Projectiles projectile.penetrate = 1; projectile.extraUpdates = 5; projectile.timeLeft = 600; - } + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 2; + } public override void AI() { @@ -34,7 +36,17 @@ namespace CalamityMod.Projectiles projectile.ai[1] = 1f; Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 12); } - if (projectile.alpha > 0) + if (projectile.ai[0] == 1f) + { + projectile.ranged = false; + projectile.melee = true; + } + else if (projectile.ai[0] == 2f) + { + projectile.ranged = false; + projectile.GetGlobalProjectile(mod).rogue = true; + } + if (projectile.alpha > 0) { projectile.alpha -= 15; } @@ -45,7 +57,7 @@ namespace CalamityMod.Projectiles Lighting.AddLight(projectile.Center, 0.4f, 0.2f, 0.4f); for (int num121 = 0; num121 < 5; num121++) { - Dust dust4 = Main.dust[Dust.NewDust(projectile.position, projectile.width, projectile.height, 242, projectile.velocity.X, projectile.velocity.Y, 100, default(Color), 1f)]; + Dust dust4 = Main.dust[Dust.NewDust(projectile.position, projectile.width, projectile.height, (Main.rand.Next(3) == 0 ? 56 : 242), projectile.velocity.X, projectile.velocity.Y, 100, default(Color), 1f)]; dust4.velocity = Vector2.Zero; dust4.position -= projectile.velocity / 5f * (float)num121; dust4.noGravity = true; @@ -53,5 +65,10 @@ namespace CalamityMod.Projectiles dust4.noLight = true; } } - } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(BuffID.Frostburn, 600); + } + } } \ No newline at end of file diff --git a/Projectiles/NebulaShot.png b/Projectiles/Ranged/NebulaShot.png similarity index 100% rename from Projectiles/NebulaShot.png rename to Projectiles/Ranged/NebulaShot.png diff --git a/Projectiles/Needler.cs b/Projectiles/Ranged/Needler.cs similarity index 95% rename from Projectiles/Needler.cs rename to Projectiles/Ranged/Needler.cs index 4a6c2bcca8..1709429faf 100644 --- a/Projectiles/Needler.cs +++ b/Projectiles/Ranged/Needler.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class Needler : ModProjectile { diff --git a/Projectiles/Needler.png b/Projectiles/Ranged/Needler.png similarity index 100% rename from Projectiles/Needler.png rename to Projectiles/Ranged/Needler.png diff --git a/Projectiles/Nuke.cs b/Projectiles/Ranged/Nuke.cs similarity index 97% rename from Projectiles/Nuke.cs rename to Projectiles/Ranged/Nuke.cs index 37b298f10f..101716ae24 100644 --- a/Projectiles/Nuke.cs +++ b/Projectiles/Ranged/Nuke.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class Nuke : ModProjectile { diff --git a/Projectiles/Nuke.png b/Projectiles/Ranged/Nuke.png similarity index 100% rename from Projectiles/Nuke.png rename to Projectiles/Ranged/Nuke.png diff --git a/Projectiles/NukeExplosion.cs b/Projectiles/Ranged/NukeExplosion.cs similarity index 84% rename from Projectiles/NukeExplosion.cs rename to Projectiles/Ranged/NukeExplosion.cs index 08456dd8e9..1db8ee8479 100644 --- a/Projectiles/NukeExplosion.cs +++ b/Projectiles/Ranged/NukeExplosion.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class NukeExplosion : ModProjectile { @@ -21,7 +21,8 @@ namespace CalamityMod.Projectiles projectile.friendly = true; projectile.ignoreWater = true; projectile.tileCollide = false; - projectile.penetrate = -1; + projectile.ranged = true; + projectile.penetrate = -1; projectile.timeLeft = 5; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 2; diff --git a/Projectiles/NukeExplosion.png b/Projectiles/Ranged/NukeExplosion.png similarity index 100% rename from Projectiles/NukeExplosion.png rename to Projectiles/Ranged/NukeExplosion.png diff --git a/Projectiles/NullShot.cs b/Projectiles/Ranged/NullShot.cs similarity index 94% rename from Projectiles/NullShot.cs rename to Projectiles/Ranged/NullShot.cs index ccdb97f5b6..46fc718354 100644 --- a/Projectiles/NullShot.cs +++ b/Projectiles/Ranged/NullShot.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class NullShot : ModProjectile { diff --git a/Projectiles/NullShot.png b/Projectiles/Ranged/NullShot.png similarity index 100% rename from Projectiles/NullShot.png rename to Projectiles/Ranged/NullShot.png diff --git a/Projectiles/NullShot2.cs b/Projectiles/Ranged/NullShot2.cs similarity index 95% rename from Projectiles/NullShot2.cs rename to Projectiles/Ranged/NullShot2.cs index d0ba55d589..e248f02b07 100644 --- a/Projectiles/NullShot2.cs +++ b/Projectiles/Ranged/NullShot2.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class NullShot2 : ModProjectile { diff --git a/Projectiles/NullShot2.png b/Projectiles/Ranged/NullShot2.png similarity index 100% rename from Projectiles/NullShot2.png rename to Projectiles/Ranged/NullShot2.png diff --git a/Projectiles/OMGWTH.cs b/Projectiles/Ranged/OMGWTH.cs similarity index 92% rename from Projectiles/OMGWTH.cs rename to Projectiles/Ranged/OMGWTH.cs index 034c894586..c6d9a0313f 100644 --- a/Projectiles/OMGWTH.cs +++ b/Projectiles/Ranged/OMGWTH.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class OMGWTH : ModProjectile { @@ -33,11 +33,11 @@ namespace CalamityMod.Projectiles public override void AI() { Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0.25f) / 255f, ((255 - projectile.alpha) * 0.01f) / 255f, ((255 - projectile.alpha) * 0.01f) / 255f); - for (int num136 = 0; num136 < 10; num136++) + for (int num136 = 0; num136 < 3; num136++) { float x2 = projectile.position.X - projectile.velocity.X / 10f * (float)num136; float y2 = projectile.position.Y - projectile.velocity.Y / 10f * (float)num136; - int num137 = Dust.NewDust(new Vector2(x2, y2), 1, 1, 235, 0f, 0f, 0, default(Color), 0.5f); + int num137 = Dust.NewDust(new Vector2(x2, y2), 1, 1, 235, 0f, 0f, 0, default(Color), 0.75f); Main.dust[num137].alpha = projectile.alpha; Main.dust[num137].position.X = x2; Main.dust[num137].position.Y = y2; diff --git a/Projectiles/OMGWTH.png b/Projectiles/Ranged/OMGWTH.png similarity index 100% rename from Projectiles/OMGWTH.png rename to Projectiles/Ranged/OMGWTH.png diff --git a/Projectiles/OnyxExplosion.cs b/Projectiles/Ranged/OnyxExplosion.cs similarity index 82% rename from Projectiles/OnyxExplosion.cs rename to Projectiles/Ranged/OnyxExplosion.cs index 562a3bbdd1..3507c042fc 100644 --- a/Projectiles/OnyxExplosion.cs +++ b/Projectiles/Ranged/OnyxExplosion.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class OnyxExplosion : ModProjectile { @@ -21,7 +21,8 @@ namespace CalamityMod.Projectiles projectile.friendly = true; projectile.ignoreWater = true; projectile.tileCollide = false; - projectile.penetrate = -1; + projectile.ranged = true; + projectile.penetrate = -1; projectile.timeLeft = 3; } } diff --git a/Projectiles/OnyxExplosion.png b/Projectiles/Ranged/OnyxExplosion.png similarity index 100% rename from Projectiles/OnyxExplosion.png rename to Projectiles/Ranged/OnyxExplosion.png diff --git a/Projectiles/Ranged/OnyxSharkBomb.cs b/Projectiles/Ranged/OnyxSharkBomb.cs new file mode 100644 index 0000000000..ca1e3509b3 --- /dev/null +++ b/Projectiles/Ranged/OnyxSharkBomb.cs @@ -0,0 +1,77 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Ranged +{ + public class OnyxSharkBomb : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Shark"); + } + + public override void SetDefaults() + { + projectile.width = 30; + projectile.height = 30; + projectile.friendly = true; + projectile.penetrate = 1; + projectile.timeLeft = 300; + projectile.ranged = true; + } + + public override void AI() + { + projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; + if (Math.Abs(projectile.velocity.X) >= 8f || Math.Abs(projectile.velocity.Y) >= 8f) + { + for (int num246 = 0; num246 < 2; num246++) + { + float num247 = 0f; + float num248 = 0f; + if (num246 == 1) + { + num247 = projectile.velocity.X * 0.5f; + num248 = projectile.velocity.Y * 0.5f; + } + int num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 109, 0f, 0f, 100, default(Color), 0.5f); + Main.dust[num249].scale *= 2f + (float)Main.rand.Next(10) * 0.1f; + Main.dust[num249].velocity *= 0.2f; + Main.dust[num249].noGravity = true; + num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 159, 0f, 0f, 100, default(Color), 0.25f); + Main.dust[num249].fadeIn = 1f + (float)Main.rand.Next(5) * 0.1f; + Main.dust[num249].velocity *= 0.05f; + } + } + } + + public override void Kill(int timeLeft) + { + for (int k = 0; k < 10; k++) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 109, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); + } + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, projectile.velocity.X, projectile.velocity.Y, mod.ProjectileType("OnyxExplosion"), (int)((double)projectile.damage), projectile.knockBack, projectile.owner, 0f, 0f); + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + for (int k = 0; k < 5; k++) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 159, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); + } + float spread = 45f * 0.0174f; + double startAngle = Math.Atan2(projectile.velocity.X, projectile.velocity.Y) - spread / 2; + double deltaAngle = spread / 8f; + double offsetAngle; + int i; + for (i = 0; i < 2; i++) + { + offsetAngle = (startAngle + deltaAngle * (i + i * i) / 2f) + 32f * i; + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), mod.ProjectileType("SandyWaifuShark"), (int)((double)projectile.damage * 0.4), projectile.knockBack, projectile.owner, 0f, 0f); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), mod.ProjectileType("SandyWaifuShark"), (int)((double)projectile.damage * 0.4), projectile.knockBack, projectile.owner, 0f, 0f); + } + } + } +} \ No newline at end of file diff --git a/Projectiles/OnyxSharkBomb.png b/Projectiles/Ranged/OnyxSharkBomb.png similarity index 100% rename from Projectiles/OnyxSharkBomb.png rename to Projectiles/Ranged/OnyxSharkBomb.png diff --git a/Projectiles/OpalStrike.cs b/Projectiles/Ranged/OpalStrike.cs similarity index 94% rename from Projectiles/OpalStrike.cs rename to Projectiles/Ranged/OpalStrike.cs index 5073aa37cf..ce4280f9ca 100644 --- a/Projectiles/OpalStrike.cs +++ b/Projectiles/Ranged/OpalStrike.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class OpalStrike : ModProjectile { diff --git a/Projectiles/OpalStrike.png b/Projectiles/Ranged/OpalStrike.png similarity index 100% rename from Projectiles/OpalStrike.png rename to Projectiles/Ranged/OpalStrike.png diff --git a/Projectiles/OrangeExoArrow.cs b/Projectiles/Ranged/OrangeExoArrow.cs similarity index 96% rename from Projectiles/OrangeExoArrow.cs rename to Projectiles/Ranged/OrangeExoArrow.cs index c9c2f256fd..e0890dae50 100644 --- a/Projectiles/OrangeExoArrow.cs +++ b/Projectiles/Ranged/OrangeExoArrow.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class OrangeExoArrow : ModProjectile { diff --git a/Projectiles/OrangeExoArrow.png b/Projectiles/Ranged/OrangeExoArrow.png similarity index 100% rename from Projectiles/OrangeExoArrow.png rename to Projectiles/Ranged/OrangeExoArrow.png diff --git a/Projectiles/Phangasm.cs b/Projectiles/Ranged/Phangasm.cs similarity index 96% rename from Projectiles/Phangasm.cs rename to Projectiles/Ranged/Phangasm.cs index 2bbde373e9..c8ac27009c 100644 --- a/Projectiles/Phangasm.cs +++ b/Projectiles/Ranged/Phangasm.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class Phangasm : ModProjectile { diff --git a/Projectiles/Phangasm.png b/Projectiles/Ranged/Phangasm.png similarity index 100% rename from Projectiles/Phangasm.png rename to Projectiles/Ranged/Phangasm.png diff --git a/Projectiles/PlagueArrow.cs b/Projectiles/Ranged/PlagueArrow.cs similarity index 95% rename from Projectiles/PlagueArrow.cs rename to Projectiles/Ranged/PlagueArrow.cs index 90415769ac..869c3afd76 100644 --- a/Projectiles/PlagueArrow.cs +++ b/Projectiles/Ranged/PlagueArrow.cs @@ -4,7 +4,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class PlagueArrow : ModProjectile { diff --git a/Projectiles/PlagueArrow.png b/Projectiles/Ranged/PlagueArrow.png similarity index 100% rename from Projectiles/PlagueArrow.png rename to Projectiles/Ranged/PlagueArrow.png diff --git a/Projectiles/PlagueExplosionFriendly.cs b/Projectiles/Ranged/PlagueExplosionFriendly.cs similarity index 93% rename from Projectiles/PlagueExplosionFriendly.cs rename to Projectiles/Ranged/PlagueExplosionFriendly.cs index d64b96394d..9aa5b12a6f 100644 --- a/Projectiles/PlagueExplosionFriendly.cs +++ b/Projectiles/Ranged/PlagueExplosionFriendly.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class PlagueExplosionFriendly : ModProjectile { @@ -21,7 +21,8 @@ namespace CalamityMod.Projectiles projectile.friendly = true; projectile.ignoreWater = true; projectile.tileCollide = false; - projectile.penetrate = -1; + projectile.ranged = true; + projectile.penetrate = -1; projectile.timeLeft = 60; } diff --git a/Projectiles/PlagueExplosionFriendly.png b/Projectiles/Ranged/PlagueExplosionFriendly.png similarity index 100% rename from Projectiles/PlagueExplosionFriendly.png rename to Projectiles/Ranged/PlagueExplosionFriendly.png diff --git a/Projectiles/PlasmaBlast.cs b/Projectiles/Ranged/PlasmaBlast.cs similarity index 96% rename from Projectiles/PlasmaBlast.cs rename to Projectiles/Ranged/PlasmaBlast.cs index c055e10170..1a8e09b242 100644 --- a/Projectiles/PlasmaBlast.cs +++ b/Projectiles/Ranged/PlasmaBlast.cs @@ -7,7 +7,7 @@ using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class PlasmaBlast : ModProjectile { diff --git a/Projectiles/PlasmaBlast.png b/Projectiles/Ranged/PlasmaBlast.png similarity index 100% rename from Projectiles/PlasmaBlast.png rename to Projectiles/Ranged/PlasmaBlast.png diff --git a/Projectiles/PlasmaExplosion.cs b/Projectiles/Ranged/PlasmaExplosion.cs similarity index 95% rename from Projectiles/PlasmaExplosion.cs rename to Projectiles/Ranged/PlasmaExplosion.cs index ee3fc27272..9b0b0f5b4e 100644 --- a/Projectiles/PlasmaExplosion.cs +++ b/Projectiles/Ranged/PlasmaExplosion.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class PlasmaExplosion : ModProjectile { diff --git a/Projectiles/PlasmaExplosion.png b/Projectiles/Ranged/PlasmaExplosion.png similarity index 100% rename from Projectiles/PlasmaExplosion.png rename to Projectiles/Ranged/PlasmaExplosion.png diff --git a/Projectiles/ProBolt.cs b/Projectiles/Ranged/ProBolt.cs similarity index 95% rename from Projectiles/ProBolt.cs rename to Projectiles/Ranged/ProBolt.cs index 114c8f6af6..d25c0a3847 100644 --- a/Projectiles/ProBolt.cs +++ b/Projectiles/Ranged/ProBolt.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class ProBolt : ModProjectile { diff --git a/Projectiles/ProBolt.png b/Projectiles/Ranged/ProBolt.png similarity index 100% rename from Projectiles/ProBolt.png rename to Projectiles/Ranged/ProBolt.png diff --git a/Projectiles/RainbowBlast.cs b/Projectiles/Ranged/RainbowBlast.cs similarity index 95% rename from Projectiles/RainbowBlast.cs rename to Projectiles/Ranged/RainbowBlast.cs index f9414c3b70..8b3768c684 100644 --- a/Projectiles/RainbowBlast.cs +++ b/Projectiles/Ranged/RainbowBlast.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class RainbowBlast : ModProjectile { diff --git a/Projectiles/RainbowBlast.png b/Projectiles/Ranged/RainbowBlast.png similarity index 100% rename from Projectiles/RainbowBlast.png rename to Projectiles/Ranged/RainbowBlast.png diff --git a/Projectiles/RubberMortarRound.cs b/Projectiles/Ranged/RubberMortarRound.cs similarity index 97% rename from Projectiles/RubberMortarRound.cs rename to Projectiles/Ranged/RubberMortarRound.cs index 311d8febf3..5431d02fb8 100644 --- a/Projectiles/RubberMortarRound.cs +++ b/Projectiles/Ranged/RubberMortarRound.cs @@ -7,7 +7,7 @@ using Terraria.ID; using Terraria.GameContent.Achievements; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class RubberMortarRound : ModProjectile { diff --git a/Projectiles/RubberMortarRound.png b/Projectiles/Ranged/RubberMortarRound.png similarity index 100% rename from Projectiles/RubberMortarRound.png rename to Projectiles/Ranged/RubberMortarRound.png diff --git a/Projectiles/SandstormBullet.cs b/Projectiles/Ranged/SandstormBullet.cs similarity index 96% rename from Projectiles/SandstormBullet.cs rename to Projectiles/Ranged/SandstormBullet.cs index 5b905dda43..9d73edd02d 100644 --- a/Projectiles/SandstormBullet.cs +++ b/Projectiles/Ranged/SandstormBullet.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class SandstormBullet : ModProjectile { diff --git a/Projectiles/SandstormBullet.png b/Projectiles/Ranged/SandstormBullet.png similarity index 100% rename from Projectiles/SandstormBullet.png rename to Projectiles/Ranged/SandstormBullet.png diff --git a/Projectiles/SandyWaifuShark.cs b/Projectiles/Ranged/SandyWaifuShark.cs similarity index 96% rename from Projectiles/SandyWaifuShark.cs rename to Projectiles/Ranged/SandyWaifuShark.cs index cbc6e60930..54404d5af2 100644 --- a/Projectiles/SandyWaifuShark.cs +++ b/Projectiles/Ranged/SandyWaifuShark.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class SandyWaifuShark : ModProjectile { diff --git a/Projectiles/SandyWaifuShark.png b/Projectiles/Ranged/SandyWaifuShark.png similarity index 100% rename from Projectiles/SandyWaifuShark.png rename to Projectiles/Ranged/SandyWaifuShark.png diff --git a/Projectiles/SeaDragonRocket.cs b/Projectiles/Ranged/SeaDragonRocket.cs similarity index 97% rename from Projectiles/SeaDragonRocket.cs rename to Projectiles/Ranged/SeaDragonRocket.cs index 9b513aeee1..dcfb194cec 100644 --- a/Projectiles/SeaDragonRocket.cs +++ b/Projectiles/Ranged/SeaDragonRocket.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class SeaDragonRocket : ModProjectile { diff --git a/Projectiles/SeaDragonRocket.png b/Projectiles/Ranged/SeaDragonRocket.png similarity index 100% rename from Projectiles/SeaDragonRocket.png rename to Projectiles/Ranged/SeaDragonRocket.png diff --git a/Projectiles/ShadeFire.cs b/Projectiles/Ranged/ShadeFire.cs similarity index 95% rename from Projectiles/ShadeFire.cs rename to Projectiles/Ranged/ShadeFire.cs index 287c314f65..0a5a6a97a4 100644 --- a/Projectiles/ShadeFire.cs +++ b/Projectiles/Ranged/ShadeFire.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class ShadeFire : ModProjectile { diff --git a/Projectiles/ShadeFire.png b/Projectiles/Ranged/ShadeFire.png similarity index 100% rename from Projectiles/ShadeFire.png rename to Projectiles/Ranged/ShadeFire.png diff --git a/Projectiles/Shockblast.cs b/Projectiles/Ranged/Shockblast.cs similarity index 93% rename from Projectiles/Shockblast.cs rename to Projectiles/Ranged/Shockblast.cs index c9bb21d204..66595520e2 100644 --- a/Projectiles/Shockblast.cs +++ b/Projectiles/Ranged/Shockblast.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class Shockblast : ModProjectile { @@ -21,7 +21,8 @@ namespace CalamityMod.Projectiles projectile.friendly = true; projectile.ignoreWater = true; projectile.tileCollide = false; - projectile.penetrate = -1; + projectile.ranged = true; + projectile.penetrate = -1; projectile.timeLeft = 10; } diff --git a/Projectiles/Shockblast.png b/Projectiles/Ranged/Shockblast.png similarity index 100% rename from Projectiles/Shockblast.png rename to Projectiles/Ranged/Shockblast.png diff --git a/Projectiles/ShockblastRound.cs b/Projectiles/Ranged/ShockblastRound.cs similarity index 94% rename from Projectiles/ShockblastRound.cs rename to Projectiles/Ranged/ShockblastRound.cs index 22369ca386..6e078d6de1 100644 --- a/Projectiles/ShockblastRound.cs +++ b/Projectiles/Ranged/ShockblastRound.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class ShockblastRound : ModProjectile { @@ -101,7 +101,7 @@ namespace CalamityMod.Projectiles { return; } - Main.player[Main.myPlayer].lifeSteal -= num * 2f; + Main.player[Main.myPlayer].lifeSteal -= num * 1.5f; int num2 = projectile.owner; Projectile.NewProjectile(target.position.X, target.position.Y, 0f, 0f, mod.ProjectileType("TransfusionTrail"), 0, 0f, projectile.owner, (float)num2, num); } diff --git a/Projectiles/ShockblastRound.png b/Projectiles/Ranged/ShockblastRound.png similarity index 100% rename from Projectiles/ShockblastRound.png rename to Projectiles/Ranged/ShockblastRound.png diff --git a/Projectiles/Shroom.cs b/Projectiles/Ranged/Shroom.cs similarity index 95% rename from Projectiles/Shroom.cs rename to Projectiles/Ranged/Shroom.cs index a809cc713f..31fbff6645 100644 --- a/Projectiles/Shroom.cs +++ b/Projectiles/Ranged/Shroom.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class Shroom : ModProjectile { diff --git a/Projectiles/Shroom.png b/Projectiles/Ranged/Shroom.png similarity index 100% rename from Projectiles/Shroom.png rename to Projectiles/Ranged/Shroom.png diff --git a/Projectiles/Sickness.cs b/Projectiles/Ranged/Sickness.cs similarity index 93% rename from Projectiles/Sickness.cs rename to Projectiles/Ranged/Sickness.cs index 14d64dc03a..710f1757e9 100644 --- a/Projectiles/Sickness.cs +++ b/Projectiles/Ranged/Sickness.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class Sickness : ModProjectile { @@ -21,7 +21,8 @@ namespace CalamityMod.Projectiles projectile.friendly = true; projectile.ignoreWater = true; projectile.tileCollide = false; - projectile.penetrate = -1; + projectile.ranged = true; + projectile.penetrate = -1; projectile.timeLeft = 5; } diff --git a/Projectiles/Sickness.png b/Projectiles/Ranged/Sickness.png similarity index 100% rename from Projectiles/Sickness.png rename to Projectiles/Ranged/Sickness.png diff --git a/Projectiles/SicknessRound.cs b/Projectiles/Ranged/SicknessRound.cs similarity index 96% rename from Projectiles/SicknessRound.cs rename to Projectiles/Ranged/SicknessRound.cs index f032aef467..3ef15c4e3e 100644 --- a/Projectiles/SicknessRound.cs +++ b/Projectiles/Ranged/SicknessRound.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class SicknessRound : ModProjectile { diff --git a/Projectiles/SicknessRound.png b/Projectiles/Ranged/SicknessRound.png similarity index 100% rename from Projectiles/SicknessRound.png rename to Projectiles/Ranged/SicknessRound.png diff --git a/Projectiles/SicknessRound2.cs b/Projectiles/Ranged/SicknessRound2.cs similarity index 95% rename from Projectiles/SicknessRound2.cs rename to Projectiles/Ranged/SicknessRound2.cs index 2b6e80398d..78e4f8f089 100644 --- a/Projectiles/SicknessRound2.cs +++ b/Projectiles/Ranged/SicknessRound2.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class SicknessRound2 : ModProjectile { diff --git a/Projectiles/SicknessRound2.png b/Projectiles/Ranged/SicknessRound2.png similarity index 100% rename from Projectiles/SicknessRound2.png rename to Projectiles/Ranged/SicknessRound2.png diff --git a/Projectiles/SlagRound.cs b/Projectiles/Ranged/SlagRound.cs similarity index 95% rename from Projectiles/SlagRound.cs rename to Projectiles/Ranged/SlagRound.cs index 96e6ef3eb9..8c6a8ff860 100644 --- a/Projectiles/SlagRound.cs +++ b/Projectiles/Ranged/SlagRound.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class SlagRound : ModProjectile { diff --git a/Projectiles/SlagRound.png b/Projectiles/Ranged/SlagRound.png similarity index 100% rename from Projectiles/SlagRound.png rename to Projectiles/Ranged/SlagRound.png diff --git a/Projectiles/SlashRound.cs b/Projectiles/Ranged/SlashRound.cs similarity index 92% rename from Projectiles/SlashRound.cs rename to Projectiles/Ranged/SlashRound.cs index 49686579a5..e927d8576f 100644 --- a/Projectiles/SlashRound.cs +++ b/Projectiles/Ranged/SlashRound.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class SlashRound : ModProjectile { diff --git a/Projectiles/SlashRound.png b/Projectiles/Ranged/SlashRound.png similarity index 100% rename from Projectiles/SlashRound.png rename to Projectiles/Ranged/SlashRound.png diff --git a/Projectiles/SlimeBolt.cs b/Projectiles/Ranged/SlimeBolt.cs similarity index 95% rename from Projectiles/SlimeBolt.cs rename to Projectiles/Ranged/SlimeBolt.cs index d6f3642330..57e907622e 100644 --- a/Projectiles/SlimeBolt.cs +++ b/Projectiles/Ranged/SlimeBolt.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class SlimeBolt : ModProjectile { diff --git a/Projectiles/SlimeBolt.png b/Projectiles/Ranged/SlimeBolt.png similarity index 100% rename from Projectiles/SlimeBolt.png rename to Projectiles/Ranged/SlimeBolt.png diff --git a/Projectiles/SporeBomb.cs b/Projectiles/Ranged/SporeBomb.cs similarity index 95% rename from Projectiles/SporeBomb.cs rename to Projectiles/Ranged/SporeBomb.cs index ca281877c3..ce758e664b 100644 --- a/Projectiles/SporeBomb.cs +++ b/Projectiles/Ranged/SporeBomb.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class SporeBomb : ModProjectile { diff --git a/Projectiles/SporeBomb.png b/Projectiles/Ranged/SporeBomb.png similarity index 100% rename from Projectiles/SporeBomb.png rename to Projectiles/Ranged/SporeBomb.png diff --git a/Projectiles/Spyker.cs b/Projectiles/Ranged/Spyker.cs similarity index 96% rename from Projectiles/Spyker.cs rename to Projectiles/Ranged/Spyker.cs index d3190e1f6d..63ced72a96 100644 --- a/Projectiles/Spyker.cs +++ b/Projectiles/Ranged/Spyker.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class Spyker : ModProjectile { diff --git a/Projectiles/Spyker.png b/Projectiles/Ranged/Spyker.png similarity index 100% rename from Projectiles/Spyker.png rename to Projectiles/Ranged/Spyker.png diff --git a/Projectiles/StormSurge.cs b/Projectiles/Ranged/StormSurge.cs similarity index 95% rename from Projectiles/StormSurge.cs rename to Projectiles/Ranged/StormSurge.cs index 2d7b2f9860..a5b6eb4fe3 100644 --- a/Projectiles/StormSurge.cs +++ b/Projectiles/Ranged/StormSurge.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class StormSurge : ModProjectile { diff --git a/Projectiles/StormSurge.png b/Projectiles/Ranged/StormSurge.png similarity index 100% rename from Projectiles/StormSurge.png rename to Projectiles/Ranged/StormSurge.png diff --git a/Projectiles/SulphuricAcidCannon2.cs b/Projectiles/Ranged/SulphuricAcidCannon2.cs similarity index 97% rename from Projectiles/SulphuricAcidCannon2.cs rename to Projectiles/Ranged/SulphuricAcidCannon2.cs index fffe53f79b..c299f370d0 100644 --- a/Projectiles/SulphuricAcidCannon2.cs +++ b/Projectiles/Ranged/SulphuricAcidCannon2.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class SulphuricAcidCannon2 : ModProjectile { diff --git a/Projectiles/SulphuricAcidCannon2.png b/Projectiles/Ranged/SulphuricAcidCannon2.png similarity index 100% rename from Projectiles/SulphuricAcidCannon2.png rename to Projectiles/Ranged/SulphuricAcidCannon2.png diff --git a/Projectiles/SulphuricAcidMist2.cs b/Projectiles/Ranged/SulphuricAcidMist2.cs similarity index 95% rename from Projectiles/SulphuricAcidMist2.cs rename to Projectiles/Ranged/SulphuricAcidMist2.cs index 6fd529ad4e..2eeffef07c 100644 --- a/Projectiles/SulphuricAcidMist2.cs +++ b/Projectiles/Ranged/SulphuricAcidMist2.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class SulphuricAcidMist2 : ModProjectile { diff --git a/Projectiles/SulphuricAcidMist2.png b/Projectiles/Ranged/SulphuricAcidMist2.png similarity index 100% rename from Projectiles/SulphuricAcidMist2.png rename to Projectiles/Ranged/SulphuricAcidMist2.png diff --git a/Projectiles/SuperballBullet.cs b/Projectiles/Ranged/SuperballBullet.cs similarity index 95% rename from Projectiles/SuperballBullet.cs rename to Projectiles/Ranged/SuperballBullet.cs index 1737523ad9..3ebd9b4f99 100644 --- a/Projectiles/SuperballBullet.cs +++ b/Projectiles/Ranged/SuperballBullet.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class SuperballBullet : ModProjectile { diff --git a/Projectiles/SuperballBullet.png b/Projectiles/Ranged/SuperballBullet.png similarity index 100% rename from Projectiles/SuperballBullet.png rename to Projectiles/Ranged/SuperballBullet.png diff --git a/Projectiles/TealExoArrow.cs b/Projectiles/Ranged/TealExoArrow.cs similarity index 96% rename from Projectiles/TealExoArrow.cs rename to Projectiles/Ranged/TealExoArrow.cs index 8222ff013b..49537743e3 100644 --- a/Projectiles/TealExoArrow.cs +++ b/Projectiles/Ranged/TealExoArrow.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class TealExoArrow : ModProjectile { diff --git a/Projectiles/TealExoArrow.png b/Projectiles/Ranged/TealExoArrow.png similarity index 100% rename from Projectiles/TealExoArrow.png rename to Projectiles/Ranged/TealExoArrow.png diff --git a/Projectiles/TelluricGlare.cs b/Projectiles/Ranged/TelluricGlare.cs similarity index 95% rename from Projectiles/TelluricGlare.cs rename to Projectiles/Ranged/TelluricGlare.cs index 1b0fec02a5..41da0cec18 100644 --- a/Projectiles/TelluricGlare.cs +++ b/Projectiles/Ranged/TelluricGlare.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class TelluricGlare : ModProjectile { diff --git a/Projectiles/TelluricGlare.png b/Projectiles/Ranged/TelluricGlare.png similarity index 100% rename from Projectiles/TelluricGlare.png rename to Projectiles/Ranged/TelluricGlare.png diff --git a/Projectiles/TerraArrow.cs b/Projectiles/Ranged/TerraArrow.cs similarity index 96% rename from Projectiles/TerraArrow.cs rename to Projectiles/Ranged/TerraArrow.cs index 52388387b1..93a138129c 100644 --- a/Projectiles/TerraArrow.cs +++ b/Projectiles/Ranged/TerraArrow.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class TerraArrow : ModProjectile { diff --git a/Projectiles/TerraArrow.png b/Projectiles/Ranged/TerraArrow.png similarity index 100% rename from Projectiles/TerraArrow.png rename to Projectiles/Ranged/TerraArrow.png diff --git a/Projectiles/TerraArrow2.cs b/Projectiles/Ranged/TerraArrow2.cs similarity index 96% rename from Projectiles/TerraArrow2.cs rename to Projectiles/Ranged/TerraArrow2.cs index abf10db535..474f9ce462 100644 --- a/Projectiles/TerraArrow2.cs +++ b/Projectiles/Ranged/TerraArrow2.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class TerraArrow2 : ModProjectile { diff --git a/Projectiles/TerraArrow2.png b/Projectiles/Ranged/TerraArrow2.png similarity index 100% rename from Projectiles/TerraArrow2.png rename to Projectiles/Ranged/TerraArrow2.png diff --git a/Projectiles/TerraBallB.cs b/Projectiles/Ranged/TerraBallB.cs similarity index 95% rename from Projectiles/TerraBallB.cs rename to Projectiles/Ranged/TerraBallB.cs index f33ff96148..93c35ca7bf 100644 --- a/Projectiles/TerraBallB.cs +++ b/Projectiles/Ranged/TerraBallB.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class TerraBallB : ModProjectile { diff --git a/Projectiles/TerraBallB.png b/Projectiles/Ranged/TerraBallB.png similarity index 100% rename from Projectiles/TerraBallB.png rename to Projectiles/Ranged/TerraBallB.png diff --git a/Projectiles/TerraBallG.cs b/Projectiles/Ranged/TerraBallG.cs similarity index 95% rename from Projectiles/TerraBallG.cs rename to Projectiles/Ranged/TerraBallG.cs index 859761fa86..33462a8767 100644 --- a/Projectiles/TerraBallG.cs +++ b/Projectiles/Ranged/TerraBallG.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class TerraBallG : ModProjectile { diff --git a/Projectiles/TerraBallG.png b/Projectiles/Ranged/TerraBallG.png similarity index 100% rename from Projectiles/TerraBallG.png rename to Projectiles/Ranged/TerraBallG.png diff --git a/Projectiles/TerraBallI.cs b/Projectiles/Ranged/TerraBallI.cs similarity index 95% rename from Projectiles/TerraBallI.cs rename to Projectiles/Ranged/TerraBallI.cs index 76e8c9e98a..429daf2697 100644 --- a/Projectiles/TerraBallI.cs +++ b/Projectiles/Ranged/TerraBallI.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class TerraBallI : ModProjectile { diff --git a/Projectiles/TerraBallI.png b/Projectiles/Ranged/TerraBallI.png similarity index 100% rename from Projectiles/TerraBallI.png rename to Projectiles/Ranged/TerraBallI.png diff --git a/Projectiles/TerraBallO.cs b/Projectiles/Ranged/TerraBallO.cs similarity index 95% rename from Projectiles/TerraBallO.cs rename to Projectiles/Ranged/TerraBallO.cs index bcdb8fda4a..c994353531 100644 --- a/Projectiles/TerraBallO.cs +++ b/Projectiles/Ranged/TerraBallO.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class TerraBallO : ModProjectile { diff --git a/Projectiles/TerraBallO.png b/Projectiles/Ranged/TerraBallO.png similarity index 100% rename from Projectiles/TerraBallO.png rename to Projectiles/Ranged/TerraBallO.png diff --git a/Projectiles/TerraBallR.cs b/Projectiles/Ranged/TerraBallR.cs similarity index 95% rename from Projectiles/TerraBallR.cs rename to Projectiles/Ranged/TerraBallR.cs index d294ba5967..2ccbc6a61d 100644 --- a/Projectiles/TerraBallR.cs +++ b/Projectiles/Ranged/TerraBallR.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class TerraBallR : ModProjectile { diff --git a/Projectiles/TerraBallR.png b/Projectiles/Ranged/TerraBallR.png similarity index 100% rename from Projectiles/TerraBallR.png rename to Projectiles/Ranged/TerraBallR.png diff --git a/Projectiles/TerraBallV.cs b/Projectiles/Ranged/TerraBallV.cs similarity index 95% rename from Projectiles/TerraBallV.cs rename to Projectiles/Ranged/TerraBallV.cs index 58f478acfc..dbd1512ee0 100644 --- a/Projectiles/TerraBallV.cs +++ b/Projectiles/Ranged/TerraBallV.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class TerraBallV : ModProjectile { diff --git a/Projectiles/TerraBallV.png b/Projectiles/Ranged/TerraBallV.png similarity index 100% rename from Projectiles/TerraBallV.png rename to Projectiles/Ranged/TerraBallV.png diff --git a/Projectiles/TerraBallY.cs b/Projectiles/Ranged/TerraBallY.cs similarity index 95% rename from Projectiles/TerraBallY.cs rename to Projectiles/Ranged/TerraBallY.cs index 9656d50183..f5b935f73f 100644 --- a/Projectiles/TerraBallY.cs +++ b/Projectiles/Ranged/TerraBallY.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class TerraBallY : ModProjectile { diff --git a/Projectiles/TerraBallY.png b/Projectiles/Ranged/TerraBallY.png similarity index 100% rename from Projectiles/TerraBallY.png rename to Projectiles/Ranged/TerraBallY.png diff --git a/Projectiles/TerraBullet.cs b/Projectiles/Ranged/TerraBullet.cs similarity index 94% rename from Projectiles/TerraBullet.cs rename to Projectiles/Ranged/TerraBullet.cs index 088095199d..1d2c26d4c1 100644 --- a/Projectiles/TerraBullet.cs +++ b/Projectiles/Ranged/TerraBullet.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class TerraBullet : ModProjectile { @@ -80,7 +80,7 @@ namespace CalamityMod.Projectiles } value15.Normalize(); value15 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), value15.X, value15.Y, mod.ProjectileType("TerraBulletSplit"), (int)((double)projectile.damage * 0.5), 0f, projectile.owner, 0f, 0f); + Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), value15.X, value15.Y, mod.ProjectileType("TerraBulletSplit"), (int)((double)projectile.damage * 0.3), 0f, projectile.owner, 0f, 0f); } } Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 118); diff --git a/Projectiles/TerraBullet.png b/Projectiles/Ranged/TerraBullet.png similarity index 100% rename from Projectiles/TerraBullet.png rename to Projectiles/Ranged/TerraBullet.png diff --git a/Projectiles/TerraBulletSplit.cs b/Projectiles/Ranged/TerraBulletSplit.cs similarity index 96% rename from Projectiles/TerraBulletSplit.cs rename to Projectiles/Ranged/TerraBulletSplit.cs index f4cd9802da..c1a2b5b56d 100644 --- a/Projectiles/TerraBulletSplit.cs +++ b/Projectiles/Ranged/TerraBulletSplit.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class TerraBulletSplit : ModProjectile { diff --git a/Projectiles/TerraBulletSplit.png b/Projectiles/Ranged/TerraBulletSplit.png similarity index 100% rename from Projectiles/TerraBulletSplit.png rename to Projectiles/Ranged/TerraBulletSplit.png diff --git a/Projectiles/TerraFireBlue.cs b/Projectiles/Ranged/TerraFireBlue.cs similarity index 95% rename from Projectiles/TerraFireBlue.cs rename to Projectiles/Ranged/TerraFireBlue.cs index 610abe2038..0133a78124 100644 --- a/Projectiles/TerraFireBlue.cs +++ b/Projectiles/Ranged/TerraFireBlue.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class TerraFireBlue : ModProjectile { diff --git a/Projectiles/TerraFireBlue.png b/Projectiles/Ranged/TerraFireBlue.png similarity index 100% rename from Projectiles/TerraFireBlue.png rename to Projectiles/Ranged/TerraFireBlue.png diff --git a/Projectiles/TerraFireGreen.cs b/Projectiles/Ranged/TerraFireGreen.cs similarity index 95% rename from Projectiles/TerraFireGreen.cs rename to Projectiles/Ranged/TerraFireGreen.cs index a63780de14..62e04d8263 100644 --- a/Projectiles/TerraFireGreen.cs +++ b/Projectiles/Ranged/TerraFireGreen.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class TerraFireGreen : ModProjectile { diff --git a/Projectiles/TerraFireGreen.png b/Projectiles/Ranged/TerraFireGreen.png similarity index 100% rename from Projectiles/TerraFireGreen.png rename to Projectiles/Ranged/TerraFireGreen.png diff --git a/Projectiles/TerraFireGreen2.cs b/Projectiles/Ranged/TerraFireGreen2.cs similarity index 95% rename from Projectiles/TerraFireGreen2.cs rename to Projectiles/Ranged/TerraFireGreen2.cs index 0f25f4cbf9..7d557567e4 100644 --- a/Projectiles/TerraFireGreen2.cs +++ b/Projectiles/Ranged/TerraFireGreen2.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class TerraFireGreen2 : ModProjectile { diff --git a/Projectiles/TerraFireGreen2.png b/Projectiles/Ranged/TerraFireGreen2.png similarity index 100% rename from Projectiles/TerraFireGreen2.png rename to Projectiles/Ranged/TerraFireGreen2.png diff --git a/Projectiles/TerraFireRed.cs b/Projectiles/Ranged/TerraFireRed.cs similarity index 95% rename from Projectiles/TerraFireRed.cs rename to Projectiles/Ranged/TerraFireRed.cs index 684958204b..8766fe0d9c 100644 --- a/Projectiles/TerraFireRed.cs +++ b/Projectiles/Ranged/TerraFireRed.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class TerraFireRed : ModProjectile { diff --git a/Projectiles/TerraFireRed.png b/Projectiles/Ranged/TerraFireRed.png similarity index 100% rename from Projectiles/TerraFireRed.png rename to Projectiles/Ranged/TerraFireRed.png diff --git a/Projectiles/TitRail.cs b/Projectiles/Ranged/TitRail.cs similarity index 93% rename from Projectiles/TitRail.cs rename to Projectiles/Ranged/TitRail.cs index b5f25e9d98..cfe6d1e6fe 100644 --- a/Projectiles/TitRail.cs +++ b/Projectiles/Ranged/TitRail.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class TitRail : ModProjectile { diff --git a/Projectiles/TitRail.png b/Projectiles/Ranged/TitRail.png similarity index 100% rename from Projectiles/TitRail.png rename to Projectiles/Ranged/TitRail.png diff --git a/Projectiles/TorrentialArrow.cs b/Projectiles/Ranged/TorrentialArrow.cs similarity index 96% rename from Projectiles/TorrentialArrow.cs rename to Projectiles/Ranged/TorrentialArrow.cs index a3fa331171..60afb5d785 100644 --- a/Projectiles/TorrentialArrow.cs +++ b/Projectiles/Ranged/TorrentialArrow.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class TorrentialArrow : ModProjectile { diff --git a/Projectiles/TorrentialArrow.png b/Projectiles/Ranged/TorrentialArrow.png similarity index 100% rename from Projectiles/TorrentialArrow.png rename to Projectiles/Ranged/TorrentialArrow.png diff --git a/Projectiles/Triploon.cs b/Projectiles/Ranged/Triploon.cs similarity index 95% rename from Projectiles/Triploon.cs rename to Projectiles/Ranged/Triploon.cs index e1d4d3de61..c048ac7a55 100644 --- a/Projectiles/Triploon.cs +++ b/Projectiles/Ranged/Triploon.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class Triploon : ModProjectile { diff --git a/Projectiles/Triploon.png b/Projectiles/Ranged/Triploon.png similarity index 100% rename from Projectiles/Triploon.png rename to Projectiles/Ranged/Triploon.png diff --git a/Projectiles/TyphoonArrow.cs b/Projectiles/Ranged/TyphoonArrow.cs similarity index 92% rename from Projectiles/TyphoonArrow.cs rename to Projectiles/Ranged/TyphoonArrow.cs index 0fd62866ab..52f076cc28 100644 --- a/Projectiles/TyphoonArrow.cs +++ b/Projectiles/Ranged/TyphoonArrow.cs @@ -4,7 +4,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class TyphoonArrow : ModProjectile { diff --git a/Projectiles/TyphoonArrow.png b/Projectiles/Ranged/TyphoonArrow.png similarity index 100% rename from Projectiles/TyphoonArrow.png rename to Projectiles/Ranged/TyphoonArrow.png diff --git a/Projectiles/TyphoonBubble.cs b/Projectiles/Ranged/TyphoonBubble.cs similarity index 96% rename from Projectiles/TyphoonBubble.cs rename to Projectiles/Ranged/TyphoonBubble.cs index d252243901..3564956b27 100644 --- a/Projectiles/TyphoonBubble.cs +++ b/Projectiles/Ranged/TyphoonBubble.cs @@ -4,7 +4,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class TyphoonBubble : ModProjectile { diff --git a/Projectiles/TyphoonBubble.png b/Projectiles/Ranged/TyphoonBubble.png similarity index 100% rename from Projectiles/TyphoonBubble.png rename to Projectiles/Ranged/TyphoonBubble.png diff --git a/Projectiles/VanquisherArrow.cs b/Projectiles/Ranged/VanquisherArrow.cs similarity index 95% rename from Projectiles/VanquisherArrow.cs rename to Projectiles/Ranged/VanquisherArrow.cs index e8f4b68807..d4ca42568f 100644 --- a/Projectiles/VanquisherArrow.cs +++ b/Projectiles/Ranged/VanquisherArrow.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class VanquisherArrow : ModProjectile { diff --git a/Projectiles/VanquisherArrow.png b/Projectiles/Ranged/VanquisherArrow.png similarity index 100% rename from Projectiles/VanquisherArrow.png rename to Projectiles/Ranged/VanquisherArrow.png diff --git a/Projectiles/VeriumBullet.cs b/Projectiles/Ranged/VeriumBullet.cs similarity index 96% rename from Projectiles/VeriumBullet.cs rename to Projectiles/Ranged/VeriumBullet.cs index 9c0dfc27cc..857d7801d7 100644 --- a/Projectiles/VeriumBullet.cs +++ b/Projectiles/Ranged/VeriumBullet.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class VeriumBullet : ModProjectile { diff --git a/Projectiles/VeriumBullet.png b/Projectiles/Ranged/VeriumBullet.png similarity index 100% rename from Projectiles/VeriumBullet.png rename to Projectiles/Ranged/VeriumBullet.png diff --git a/Projectiles/Voidragon.cs b/Projectiles/Ranged/Voidragon.cs similarity index 96% rename from Projectiles/Voidragon.cs rename to Projectiles/Ranged/Voidragon.cs index 5bef2d24a3..0a7d3c917d 100644 --- a/Projectiles/Voidragon.cs +++ b/Projectiles/Ranged/Voidragon.cs @@ -7,7 +7,7 @@ using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class Voidragon : ModProjectile { diff --git a/Projectiles/Voidragon.png b/Projectiles/Ranged/Voidragon.png similarity index 100% rename from Projectiles/Voidragon.png rename to Projectiles/Ranged/Voidragon.png diff --git a/Projectiles/WaterSpout.cs b/Projectiles/Ranged/WaterSpout.cs similarity index 96% rename from Projectiles/WaterSpout.cs rename to Projectiles/Ranged/WaterSpout.cs index 11cabb0aa4..f52968e455 100644 --- a/Projectiles/WaterSpout.cs +++ b/Projectiles/Ranged/WaterSpout.cs @@ -5,7 +5,7 @@ using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Ranged { public class WaterSpout : ModProjectile { diff --git a/Projectiles/WaterSpout.png b/Projectiles/Ranged/WaterSpout.png similarity index 100% rename from Projectiles/WaterSpout.png rename to Projectiles/Ranged/WaterSpout.png diff --git a/Projectiles/AccretionDisk.cs b/Projectiles/Rogue/AccretionDisk.cs similarity index 94% rename from Projectiles/AccretionDisk.cs rename to Projectiles/Rogue/AccretionDisk.cs index 29ad7dc533..c2a792b215 100644 --- a/Projectiles/AccretionDisk.cs +++ b/Projectiles/Rogue/AccretionDisk.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Rogue { public class AccretionDisk : ModProjectile { @@ -26,7 +26,8 @@ namespace CalamityMod.Projectiles projectile.aiStyle = 3; projectile.timeLeft = 400; aiType = 52; - } + projectile.GetGlobalProjectile(mod).rogue = true; + } public override void AI() { diff --git a/Projectiles/AccretionDisk.png b/Projectiles/Rogue/AccretionDisk.png similarity index 100% rename from Projectiles/AccretionDisk.png rename to Projectiles/Rogue/AccretionDisk.png diff --git a/Projectiles/AccretionDisk2.cs b/Projectiles/Rogue/AccretionDisk2.cs similarity index 90% rename from Projectiles/AccretionDisk2.cs rename to Projectiles/Rogue/AccretionDisk2.cs index 0738d20a8c..efe6407241 100644 --- a/Projectiles/AccretionDisk2.cs +++ b/Projectiles/Rogue/AccretionDisk2.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Rogue { public class AccretionDisk2 : ModProjectile { @@ -25,7 +25,8 @@ namespace CalamityMod.Projectiles projectile.aiStyle = 3; projectile.timeLeft = 60; aiType = 52; - } + projectile.GetGlobalProjectile(mod).rogue = true; + } public override void AI() { diff --git a/Projectiles/AccretionDisk2.png b/Projectiles/Rogue/AccretionDisk2.png similarity index 100% rename from Projectiles/AccretionDisk2.png rename to Projectiles/Rogue/AccretionDisk2.png diff --git a/Projectiles/AdamantiteThrowingAxeProjectile.cs b/Projectiles/Rogue/AdamantiteThrowingAxeProjectile.cs similarity index 85% rename from Projectiles/AdamantiteThrowingAxeProjectile.cs rename to Projectiles/Rogue/AdamantiteThrowingAxeProjectile.cs index a401bfb5b2..c62e09a596 100644 --- a/Projectiles/AdamantiteThrowingAxeProjectile.cs +++ b/Projectiles/Rogue/AdamantiteThrowingAxeProjectile.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Rogue { public class AdamantiteThrowingAxeProjectile : ModProjectile { @@ -23,7 +23,8 @@ namespace CalamityMod.Projectiles projectile.aiStyle = 2; projectile.timeLeft = 600; aiType = 3; - } + projectile.GetGlobalProjectile(mod).rogue = true; + } public override void Kill(int timeLeft) { diff --git a/Projectiles/AdamantiteThrowingAxeProjectile.png b/Projectiles/Rogue/AdamantiteThrowingAxeProjectile.png similarity index 100% rename from Projectiles/AdamantiteThrowingAxeProjectile.png rename to Projectiles/Rogue/AdamantiteThrowingAxeProjectile.png diff --git a/Projectiles/BallisticPoisonBomb.cs b/Projectiles/Rogue/BallisticPoisonBomb.cs similarity index 96% rename from Projectiles/BallisticPoisonBomb.cs rename to Projectiles/Rogue/BallisticPoisonBomb.cs index 7fd108bd3b..4beed440ed 100644 --- a/Projectiles/BallisticPoisonBomb.cs +++ b/Projectiles/Rogue/BallisticPoisonBomb.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Rogue { public class BallisticPoisonBomb : ModProjectile { @@ -22,7 +22,8 @@ namespace CalamityMod.Projectiles projectile.penetrate = -1; projectile.timeLeft = 200; projectile.tileCollide = false; - } + projectile.GetGlobalProjectile(mod).rogue = true; + } public override void AI() { diff --git a/Projectiles/Rogue/BallisticPoisonBomb.png b/Projectiles/Rogue/BallisticPoisonBomb.png new file mode 100644 index 0000000000..41cbdb0949 Binary files /dev/null and b/Projectiles/Rogue/BallisticPoisonBomb.png differ diff --git a/Projectiles/BallisticPoisonBombSpike.cs b/Projectiles/Rogue/BallisticPoisonBombSpike.cs similarity index 93% rename from Projectiles/BallisticPoisonBombSpike.cs rename to Projectiles/Rogue/BallisticPoisonBombSpike.cs index 0b4a34e83e..0765a9e46c 100644 --- a/Projectiles/BallisticPoisonBombSpike.cs +++ b/Projectiles/Rogue/BallisticPoisonBombSpike.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Rogue { public class BallisticPoisonBombSpike : ModProjectile { @@ -26,7 +26,8 @@ namespace CalamityMod.Projectiles projectile.extraUpdates = 2; projectile.aiStyle = 93; aiType = 514; - } + projectile.GetGlobalProjectile(mod).rogue = true; + } public override void AI() { diff --git a/Projectiles/Rogue/BallisticPoisonBombSpike.png b/Projectiles/Rogue/BallisticPoisonBombSpike.png new file mode 100644 index 0000000000..586b8e6639 Binary files /dev/null and b/Projectiles/Rogue/BallisticPoisonBombSpike.png differ diff --git a/Projectiles/BrackishFlask.cs b/Projectiles/Rogue/BrackishFlask.cs similarity index 92% rename from Projectiles/BrackishFlask.cs rename to Projectiles/Rogue/BrackishFlask.cs index e1136599cd..e4d1189106 100644 --- a/Projectiles/BrackishFlask.cs +++ b/Projectiles/Rogue/BrackishFlask.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Rogue { public class BrackishFlask : ModProjectile { @@ -23,7 +23,8 @@ namespace CalamityMod.Projectiles projectile.aiStyle = 2; projectile.timeLeft = 180; aiType = 48; - } + projectile.GetGlobalProjectile(mod).rogue = true; + } public override void Kill(int timeLeft) { diff --git a/Projectiles/BrackishFlask.png b/Projectiles/Rogue/BrackishFlask.png similarity index 100% rename from Projectiles/BrackishFlask.png rename to Projectiles/Rogue/BrackishFlask.png diff --git a/Projectiles/BrackishWater.cs b/Projectiles/Rogue/BrackishWater.cs similarity index 91% rename from Projectiles/BrackishWater.cs rename to Projectiles/Rogue/BrackishWater.cs index da20b36c35..1a60c3d66e 100644 --- a/Projectiles/BrackishWater.cs +++ b/Projectiles/Rogue/BrackishWater.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Rogue { public class BrackishWater : ModProjectile { @@ -22,7 +22,8 @@ namespace CalamityMod.Projectiles projectile.ignoreWater = true; projectile.penetrate = 1; projectile.timeLeft = 60; - } + projectile.GetGlobalProjectile(mod).rogue = true; + } public override void AI() { diff --git a/Projectiles/BrackishWater.png b/Projectiles/Rogue/BrackishWater.png similarity index 100% rename from Projectiles/BrackishWater.png rename to Projectiles/Rogue/BrackishWater.png diff --git a/Projectiles/BrackishWaterBlast.cs b/Projectiles/Rogue/BrackishWaterBlast.cs similarity index 93% rename from Projectiles/BrackishWaterBlast.cs rename to Projectiles/Rogue/BrackishWaterBlast.cs index 3ea4831deb..794d6d88bb 100644 --- a/Projectiles/BrackishWaterBlast.cs +++ b/Projectiles/Rogue/BrackishWaterBlast.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Rogue { public class BrackishWaterBlast : ModProjectile { @@ -23,7 +23,8 @@ namespace CalamityMod.Projectiles projectile.tileCollide = false; projectile.penetrate = -1; projectile.timeLeft = 60; - } + projectile.GetGlobalProjectile(mod).rogue = true; + } public override void AI() { diff --git a/Projectiles/BrackishWaterBlast.png b/Projectiles/Rogue/BrackishWaterBlast.png similarity index 100% rename from Projectiles/BrackishWaterBlast.png rename to Projectiles/Rogue/BrackishWaterBlast.png diff --git a/Projectiles/Brimblade.cs b/Projectiles/Rogue/Brimblade.cs similarity index 90% rename from Projectiles/Brimblade.cs rename to Projectiles/Rogue/Brimblade.cs index ff10497229..075e3acc16 100644 --- a/Projectiles/Brimblade.cs +++ b/Projectiles/Rogue/Brimblade.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Rogue { public class Brimblade : ModProjectile { @@ -23,7 +23,8 @@ namespace CalamityMod.Projectiles projectile.aiStyle = 3; projectile.timeLeft = 300; aiType = 52; - } + projectile.GetGlobalProjectile(mod).rogue = true; + } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { diff --git a/Projectiles/Brimblade.png b/Projectiles/Rogue/Brimblade.png similarity index 100% rename from Projectiles/Brimblade.png rename to Projectiles/Rogue/Brimblade.png diff --git a/Projectiles/Brimblade2.cs b/Projectiles/Rogue/Brimblade2.cs similarity index 86% rename from Projectiles/Brimblade2.cs rename to Projectiles/Rogue/Brimblade2.cs index b553f77540..574928974e 100644 --- a/Projectiles/Brimblade2.cs +++ b/Projectiles/Rogue/Brimblade2.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Rogue { public class Brimblade2 : ModProjectile { @@ -23,7 +23,8 @@ namespace CalamityMod.Projectiles projectile.aiStyle = 3; projectile.timeLeft = 300; aiType = 52; - } + projectile.GetGlobalProjectile(mod).rogue = true; + } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { diff --git a/Projectiles/Brimblade2.png b/Projectiles/Rogue/Brimblade2.png similarity index 100% rename from Projectiles/Brimblade2.png rename to Projectiles/Rogue/Brimblade2.png diff --git a/Projectiles/Celestus.cs b/Projectiles/Rogue/Celestus.cs similarity index 95% rename from Projectiles/Celestus.cs rename to Projectiles/Rogue/Celestus.cs index 8c7ee0208a..b8a4c513df 100644 --- a/Projectiles/Celestus.cs +++ b/Projectiles/Rogue/Celestus.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Rogue { public class Celestus : ModProjectile { @@ -24,7 +24,8 @@ namespace CalamityMod.Projectiles projectile.extraUpdates = 3; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 30; - } + projectile.GetGlobalProjectile(mod).rogue = true; + } public override void AI() { diff --git a/Projectiles/Rogue/Celestus.png b/Projectiles/Rogue/Celestus.png new file mode 100644 index 0000000000..cc5385f89f Binary files /dev/null and b/Projectiles/Rogue/Celestus.png differ diff --git a/Projectiles/Celestus2.cs b/Projectiles/Rogue/Celestus2.cs similarity index 92% rename from Projectiles/Celestus2.cs rename to Projectiles/Rogue/Celestus2.cs index 1dc5dd3ec7..89167d6db8 100644 --- a/Projectiles/Celestus2.cs +++ b/Projectiles/Rogue/Celestus2.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Rogue { public class Celestus2 : ModProjectile { @@ -25,7 +25,8 @@ namespace CalamityMod.Projectiles projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 40; projectile.timeLeft = 85; - } + projectile.GetGlobalProjectile(mod).rogue = true; + } public override void AI() { diff --git a/Projectiles/Celestus2.png b/Projectiles/Rogue/Celestus2.png similarity index 100% rename from Projectiles/Celestus2.png rename to Projectiles/Rogue/Celestus2.png diff --git a/Projectiles/CobaltKunaiProjectile.cs b/Projectiles/Rogue/CobaltKunaiProjectile.cs similarity index 89% rename from Projectiles/CobaltKunaiProjectile.cs rename to Projectiles/Rogue/CobaltKunaiProjectile.cs index f48aa4ac3d..d689b81cca 100644 --- a/Projectiles/CobaltKunaiProjectile.cs +++ b/Projectiles/Rogue/CobaltKunaiProjectile.cs @@ -4,7 +4,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Rogue { public class CobaltKunaiProjectile : ModProjectile { @@ -22,7 +22,8 @@ namespace CalamityMod.Projectiles projectile.aiStyle = 2; projectile.timeLeft = 600; aiType = 48; - } + projectile.GetGlobalProjectile(mod).rogue = true; + } public override bool OnTileCollide(Vector2 oldVelocity) { diff --git a/Projectiles/CobaltKunaiProjectile.png b/Projectiles/Rogue/CobaltKunaiProjectile.png similarity index 100% rename from Projectiles/CobaltKunaiProjectile.png rename to Projectiles/Rogue/CobaltKunaiProjectile.png diff --git a/Projectiles/CosmicKunai.cs b/Projectiles/Rogue/CosmicKunai.cs similarity index 92% rename from Projectiles/CosmicKunai.cs rename to Projectiles/Rogue/CosmicKunai.cs index 9313b7cdb9..d1b6ea6fa8 100644 --- a/Projectiles/CosmicKunai.cs +++ b/Projectiles/Rogue/CosmicKunai.cs @@ -4,7 +4,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Rogue { public class CosmicKunai : ModProjectile { @@ -20,7 +20,8 @@ namespace CalamityMod.Projectiles projectile.friendly = true; projectile.tileCollide = false; projectile.penetrate = 1; - } + projectile.GetGlobalProjectile(mod).rogue = true; + } public override void AI() { diff --git a/Projectiles/CosmicKunai.png b/Projectiles/Rogue/CosmicKunai.png similarity index 100% rename from Projectiles/CosmicKunai.png rename to Projectiles/Rogue/CosmicKunai.png diff --git a/Projectiles/Crushax.cs b/Projectiles/Rogue/Crushax.cs similarity index 91% rename from Projectiles/Crushax.cs rename to Projectiles/Rogue/Crushax.cs index 12713dd5e1..91b4550779 100644 --- a/Projectiles/Crushax.cs +++ b/Projectiles/Rogue/Crushax.cs @@ -5,7 +5,7 @@ using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Rogue { public class Crushax : ModProjectile { @@ -23,7 +23,8 @@ namespace CalamityMod.Projectiles projectile.aiStyle = 2; projectile.timeLeft = 300; aiType = 48; - } + projectile.GetGlobalProjectile(mod).rogue = true; + } public override bool OnTileCollide(Vector2 oldVelocity) { diff --git a/Projectiles/Crushax.png b/Projectiles/Rogue/Crushax.png similarity index 100% rename from Projectiles/Crushax.png rename to Projectiles/Rogue/Crushax.png diff --git a/Projectiles/CrystalPiercerProjectile.cs b/Projectiles/Rogue/CrystalPiercerProjectile.cs similarity index 92% rename from Projectiles/CrystalPiercerProjectile.cs rename to Projectiles/Rogue/CrystalPiercerProjectile.cs index c30f4fc56f..3b655996c3 100644 --- a/Projectiles/CrystalPiercerProjectile.cs +++ b/Projectiles/Rogue/CrystalPiercerProjectile.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Rogue { public class CrystalPiercerProjectile : ModProjectile { @@ -24,7 +24,8 @@ namespace CalamityMod.Projectiles projectile.aiStyle = 113; projectile.timeLeft = 600; aiType = 598; - } + projectile.GetGlobalProjectile(mod).rogue = true; + } public override void AI() { diff --git a/Projectiles/CrystalPiercerProjectile.png b/Projectiles/Rogue/CrystalPiercerProjectile.png similarity index 100% rename from Projectiles/CrystalPiercerProjectile.png rename to Projectiles/Rogue/CrystalPiercerProjectile.png diff --git a/Projectiles/Crystalline.cs b/Projectiles/Rogue/Crystalline.cs similarity index 92% rename from Projectiles/Crystalline.cs rename to Projectiles/Rogue/Crystalline.cs index d6d227f7fd..5b2330badb 100644 --- a/Projectiles/Crystalline.cs +++ b/Projectiles/Rogue/Crystalline.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Rogue { public class Crystalline : ModProjectile { @@ -24,7 +24,8 @@ namespace CalamityMod.Projectiles projectile.aiStyle = 113; projectile.timeLeft = 120; aiType = 598; - } + projectile.GetGlobalProjectile(mod).rogue = true; + } public override void AI() { diff --git a/Projectiles/Rogue/Crystalline.png b/Projectiles/Rogue/Crystalline.png new file mode 100644 index 0000000000..70e714e1c8 Binary files /dev/null and b/Projectiles/Rogue/Crystalline.png differ diff --git a/Projectiles/Crystalline2.cs b/Projectiles/Rogue/Crystalline2.cs similarity index 90% rename from Projectiles/Crystalline2.cs rename to Projectiles/Rogue/Crystalline2.cs index 831ed2c509..0edc49924a 100644 --- a/Projectiles/Crystalline2.cs +++ b/Projectiles/Rogue/Crystalline2.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Rogue { public class Crystalline2 : ModProjectile { @@ -24,7 +24,8 @@ namespace CalamityMod.Projectiles projectile.aiStyle = 113; projectile.timeLeft = 30; aiType = 598; - } + projectile.GetGlobalProjectile(mod).rogue = true; + } public override void AI() { diff --git a/Projectiles/Rogue/Crystalline2.png b/Projectiles/Rogue/Crystalline2.png new file mode 100644 index 0000000000..70e714e1c8 Binary files /dev/null and b/Projectiles/Rogue/Crystalline2.png differ diff --git a/Projectiles/CursedDagger.cs b/Projectiles/Rogue/CursedDagger.cs similarity index 88% rename from Projectiles/CursedDagger.cs rename to Projectiles/Rogue/CursedDagger.cs index 510f10669e..cf6e272ab8 100644 --- a/Projectiles/CursedDagger.cs +++ b/Projectiles/Rogue/CursedDagger.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Rogue { public class CursedDagger : ModProjectile { @@ -23,7 +23,8 @@ namespace CalamityMod.Projectiles projectile.aiStyle = 2; projectile.timeLeft = 600; aiType = 48; - } + projectile.GetGlobalProjectile(mod).rogue = true; + } public override bool OnTileCollide(Vector2 oldVelocity) { diff --git a/Projectiles/CursedDagger.png b/Projectiles/Rogue/CursedDagger.png similarity index 100% rename from Projectiles/CursedDagger.png rename to Projectiles/Rogue/CursedDagger.png diff --git a/Projectiles/DuststormCloud.cs b/Projectiles/Rogue/DuststormCloud.cs similarity index 91% rename from Projectiles/DuststormCloud.cs rename to Projectiles/Rogue/DuststormCloud.cs index 5ffe9b587d..31633161cd 100644 --- a/Projectiles/DuststormCloud.cs +++ b/Projectiles/Rogue/DuststormCloud.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Rogue { public class DuststormCloud : ModProjectile { @@ -25,7 +25,8 @@ namespace CalamityMod.Projectiles projectile.tileCollide = false; projectile.ignoreWater = true; projectile.timeLeft = 3600; - } + projectile.GetGlobalProjectile(mod).rogue = true; + } public override void AI() { diff --git a/Projectiles/DuststormCloud.png b/Projectiles/Rogue/DuststormCloud.png similarity index 100% rename from Projectiles/DuststormCloud.png rename to Projectiles/Rogue/DuststormCloud.png diff --git a/Projectiles/DuststormInABottle.cs b/Projectiles/Rogue/DuststormInABottle.cs similarity index 90% rename from Projectiles/DuststormInABottle.cs rename to Projectiles/Rogue/DuststormInABottle.cs index a69dff68fc..a8ec780f1a 100644 --- a/Projectiles/DuststormInABottle.cs +++ b/Projectiles/Rogue/DuststormInABottle.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Rogue { public class DuststormInABottle : ModProjectile { @@ -23,7 +23,8 @@ namespace CalamityMod.Projectiles projectile.aiStyle = 2; projectile.timeLeft = 180; aiType = 48; - } + projectile.GetGlobalProjectile(mod).rogue = true; + } public override void Kill(int timeLeft) { diff --git a/Projectiles/DuststormInABottle.png b/Projectiles/Rogue/DuststormInABottle.png similarity index 100% rename from Projectiles/DuststormInABottle.png rename to Projectiles/Rogue/DuststormInABottle.png diff --git a/Projectiles/EmpyreanKnives.cs b/Projectiles/Rogue/EmpyreanKnives.cs similarity index 93% rename from Projectiles/EmpyreanKnives.cs rename to Projectiles/Rogue/EmpyreanKnives.cs index e24e904e40..c8020b529c 100644 --- a/Projectiles/EmpyreanKnives.cs +++ b/Projectiles/Rogue/EmpyreanKnives.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Rogue { public class EmpyreanKnives : ModProjectile { @@ -32,7 +32,8 @@ namespace CalamityMod.Projectiles if (projectile.ai[1] == 1f) { projectile.melee = false; - } + projectile.GetGlobalProjectile(mod).rogue = true; + } projectile.ai[0] += 1f; if (projectile.ai[0] >= 75f) { @@ -139,7 +140,7 @@ namespace CalamityMod.Projectiles { return; } - Main.player[Main.myPlayer].lifeSteal -= num * 2f; + Main.player[Main.myPlayer].lifeSteal -= num * 1.5f; int num2 = projectile.owner; Projectile.NewProjectile(target.position.X, target.position.Y, 0f, 0f, 305, 0, 0f, projectile.owner, (float)num2, num); } diff --git a/Projectiles/EmpyreanKnives.png b/Projectiles/Rogue/EmpyreanKnives.png similarity index 100% rename from Projectiles/EmpyreanKnives.png rename to Projectiles/Rogue/EmpyreanKnives.png diff --git a/Projectiles/EradicatorProjectile.cs b/Projectiles/Rogue/EradicatorProjectile.cs similarity index 81% rename from Projectiles/EradicatorProjectile.cs rename to Projectiles/Rogue/EradicatorProjectile.cs index b4dfa2a449..496e898f0e 100644 --- a/Projectiles/EradicatorProjectile.cs +++ b/Projectiles/Rogue/EradicatorProjectile.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Rogue { public class EradicatorProjectile : ModProjectile { @@ -27,7 +27,8 @@ namespace CalamityMod.Projectiles aiType = 52; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 3; - } + projectile.GetGlobalProjectile(mod).rogue = true; + } public override void AI() { @@ -77,12 +78,9 @@ namespace CalamityMod.Projectiles { if (projectile.owner == Main.myPlayer) { - int laser = Projectile.NewProjectile(value10.X, value10.Y, num438, num439, mod.ProjectileType("NebulaShot"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); - Main.projectile[laser].ranged = false; - Main.projectile[laser].thrown = true; + Projectile.NewProjectile(value10.X, value10.Y, num438, num439, mod.ProjectileType("NebulaShot"), projectile.damage, projectile.knockBack, projectile.owner, 2f, 0f); } } - return; } } } @@ -93,5 +91,11 @@ namespace CalamityMod.Projectiles spriteBatch.Draw(tex, projectile.Center - Main.screenPosition, null, projectile.GetAlpha(lightColor), projectile.rotation, tex.Size() / 2f, projectile.scale, SpriteEffects.None, 0f); return false; } - } + + public override void PostDraw(SpriteBatch spriteBatch, Color lightColor) + { + Vector2 origin = new Vector2(31f, 29f); + spriteBatch.Draw(mod.GetTexture("Projectiles/Rogue/EradicatorProjectileGlow"), projectile.Center - Main.screenPosition, null, Color.White, projectile.rotation, origin, 1f, SpriteEffects.None, 0f); + } + } } \ No newline at end of file diff --git a/Projectiles/Rogue/EradicatorProjectile.png b/Projectiles/Rogue/EradicatorProjectile.png new file mode 100644 index 0000000000..e028ca0e83 Binary files /dev/null and b/Projectiles/Rogue/EradicatorProjectile.png differ diff --git a/Projectiles/Rogue/EradicatorProjectileGlow.png b/Projectiles/Rogue/EradicatorProjectileGlow.png new file mode 100644 index 0000000000..152b9ce5ae Binary files /dev/null and b/Projectiles/Rogue/EradicatorProjectileGlow.png differ diff --git a/Projectiles/ExecutionersBlade.cs b/Projectiles/Rogue/ExecutionersBlade.cs similarity index 94% rename from Projectiles/ExecutionersBlade.cs rename to Projectiles/Rogue/ExecutionersBlade.cs index 8626d3acce..710d82d064 100644 --- a/Projectiles/ExecutionersBlade.cs +++ b/Projectiles/Rogue/ExecutionersBlade.cs @@ -4,7 +4,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Rogue { public class ExecutionersBlade : ModProjectile { @@ -23,7 +23,8 @@ namespace CalamityMod.Projectiles projectile.aiStyle = 2; projectile.timeLeft = 240; aiType = 48; - } + projectile.GetGlobalProjectile(mod).rogue = true; + } public override void AI() { diff --git a/Projectiles/ExecutionersBlade.png b/Projectiles/Rogue/ExecutionersBlade.png similarity index 100% rename from Projectiles/ExecutionersBlade.png rename to Projectiles/Rogue/ExecutionersBlade.png diff --git a/Projectiles/FeatherKnifeProjectile.cs b/Projectiles/Rogue/FeatherKnifeProjectile.cs similarity index 91% rename from Projectiles/FeatherKnifeProjectile.cs rename to Projectiles/Rogue/FeatherKnifeProjectile.cs index 4ba2548a2f..85463c0700 100644 --- a/Projectiles/FeatherKnifeProjectile.cs +++ b/Projectiles/Rogue/FeatherKnifeProjectile.cs @@ -5,7 +5,7 @@ using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Rogue { public class FeatherKnifeProjectile : ModProjectile { @@ -23,7 +23,8 @@ namespace CalamityMod.Projectiles projectile.aiStyle = 2; projectile.timeLeft = 600; aiType = 48; - } + projectile.GetGlobalProjectile(mod).rogue = true; + } public override bool OnTileCollide(Vector2 oldVelocity) { diff --git a/Projectiles/FeatherKnifeProjectile.png b/Projectiles/Rogue/FeatherKnifeProjectile.png similarity index 100% rename from Projectiles/FeatherKnifeProjectile.png rename to Projectiles/Rogue/FeatherKnifeProjectile.png diff --git a/Projectiles/FlameScytheProjectile.cs b/Projectiles/Rogue/FlameScytheProjectile.cs similarity index 90% rename from Projectiles/FlameScytheProjectile.cs rename to Projectiles/Rogue/FlameScytheProjectile.cs index d4e114666d..f9483df47f 100644 --- a/Projectiles/FlameScytheProjectile.cs +++ b/Projectiles/Rogue/FlameScytheProjectile.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Rogue { public class FlameScytheProjectile : ModProjectile { @@ -17,8 +17,8 @@ namespace CalamityMod.Projectiles public override void SetDefaults() { - projectile.width = 30; - projectile.height = 30; + projectile.width = 50; + projectile.height = 50; projectile.friendly = true; projectile.penetrate = -1; projectile.aiStyle = 3; @@ -26,7 +26,8 @@ namespace CalamityMod.Projectiles projectile.timeLeft = 600; projectile.alpha = 55; aiType = 52; - } + projectile.GetGlobalProjectile(mod).rogue = true; + } public override void AI() { diff --git a/Projectiles/Rogue/FlameScytheProjectile.png b/Projectiles/Rogue/FlameScytheProjectile.png new file mode 100644 index 0000000000..d6577c12b4 Binary files /dev/null and b/Projectiles/Rogue/FlameScytheProjectile.png differ diff --git a/Projectiles/FossilShardThrown.cs b/Projectiles/Rogue/FossilShardThrown.cs similarity index 87% rename from Projectiles/FossilShardThrown.cs rename to Projectiles/Rogue/FossilShardThrown.cs index a42190ad70..fab0b86004 100644 --- a/Projectiles/FossilShardThrown.cs +++ b/Projectiles/Rogue/FossilShardThrown.cs @@ -1,46 +1,47 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles -{ - public class FossilShardThrown : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Shard"); - } - - public override void SetDefaults() - { - projectile.width = 10; - projectile.height = 10; - projectile.friendly = true; - projectile.penetrate = 1; - projectile.aiStyle = 1; - projectile.timeLeft = 120; - aiType = 1; - } - - public override void AI() - { - projectile.rotation += projectile.velocity.Y; - projectile.velocity.Y *= 1.05f; - } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(mod.BuffType("ArmorCrunch"), 60); - } - - public override void Kill(int timeLeft) - { - for (int i = 0; i <= 2; i++) - { - Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 32, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); - } - } - } +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Rogue +{ + public class FossilShardThrown : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Shard"); + } + + public override void SetDefaults() + { + projectile.width = 10; + projectile.height = 10; + projectile.friendly = true; + projectile.penetrate = 1; + projectile.aiStyle = 1; + projectile.timeLeft = 120; + aiType = 1; + projectile.GetGlobalProjectile(mod).rogue = true; + } + + public override void AI() + { + projectile.rotation += projectile.velocity.Y; + projectile.velocity.Y *= 1.05f; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(mod.BuffType("ArmorCrunch"), 60); + } + + public override void Kill(int timeLeft) + { + for (int i = 0; i <= 2; i++) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 32, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); + } + } + } } \ No newline at end of file diff --git a/Projectiles/FossilShardThrown.png b/Projectiles/Rogue/FossilShardThrown.png similarity index 100% rename from Projectiles/FossilShardThrown.png rename to Projectiles/Rogue/FossilShardThrown.png diff --git a/Projectiles/GelDartProjectile.cs b/Projectiles/Rogue/GelDartProjectile.cs similarity index 90% rename from Projectiles/GelDartProjectile.cs rename to Projectiles/Rogue/GelDartProjectile.cs index 72102e3a45..c9b0a2da3e 100644 --- a/Projectiles/GelDartProjectile.cs +++ b/Projectiles/Rogue/GelDartProjectile.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Rogue { public class GelDartProjectile : ModProjectile { @@ -23,7 +23,8 @@ namespace CalamityMod.Projectiles projectile.aiStyle = 2; projectile.timeLeft = 600; aiType = 48; - } + projectile.GetGlobalProjectile(mod).rogue = true; + } public override bool OnTileCollide(Vector2 oldVelocity) { diff --git a/Projectiles/GelDartProjectile.png b/Projectiles/Rogue/GelDartProjectile.png similarity index 100% rename from Projectiles/GelDartProjectile.png rename to Projectiles/Rogue/GelDartProjectile.png diff --git a/Projectiles/GhoulishGouger.cs b/Projectiles/Rogue/GhoulishGouger.cs similarity index 93% rename from Projectiles/GhoulishGouger.cs rename to Projectiles/Rogue/GhoulishGouger.cs index 7443140f34..696c8798cb 100644 --- a/Projectiles/GhoulishGouger.cs +++ b/Projectiles/Rogue/GhoulishGouger.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Rogue { public class GhoulishGouger : ModProjectile { @@ -24,7 +24,8 @@ namespace CalamityMod.Projectiles projectile.extraUpdates = 4; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 2; - } + projectile.GetGlobalProjectile(mod).rogue = true; + } public override void AI() { diff --git a/Projectiles/GhoulishGouger.png b/Projectiles/Rogue/GhoulishGouger.png similarity index 100% rename from Projectiles/GhoulishGouger.png rename to Projectiles/Rogue/GhoulishGouger.png diff --git a/Projectiles/IceStarProjectile.cs b/Projectiles/Rogue/IceStarProjectile.cs similarity index 93% rename from Projectiles/IceStarProjectile.cs rename to Projectiles/Rogue/IceStarProjectile.cs index 044ff93308..8bcbfc3c8a 100644 --- a/Projectiles/IceStarProjectile.cs +++ b/Projectiles/Rogue/IceStarProjectile.cs @@ -5,7 +5,7 @@ using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Rogue { public class IceStarProjectile : ModProjectile { @@ -23,7 +23,8 @@ namespace CalamityMod.Projectiles projectile.aiStyle = 2; projectile.timeLeft = 280; aiType = 48; - } + projectile.GetGlobalProjectile(mod).rogue = true; + } public override void AI() { diff --git a/Projectiles/IceStarProjectile.png b/Projectiles/Rogue/IceStarProjectile.png similarity index 100% rename from Projectiles/IceStarProjectile.png rename to Projectiles/Rogue/IceStarProjectile.png diff --git a/Projectiles/IchorSpear.cs b/Projectiles/Rogue/IchorSpear.cs similarity index 91% rename from Projectiles/IchorSpear.cs rename to Projectiles/Rogue/IchorSpear.cs index 95d7ecf98d..344046e529 100644 --- a/Projectiles/IchorSpear.cs +++ b/Projectiles/Rogue/IchorSpear.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Rogue { public class IchorSpear : ModProjectile { @@ -24,7 +24,8 @@ namespace CalamityMod.Projectiles projectile.aiStyle = 113; projectile.timeLeft = 600; aiType = 598; - } + projectile.GetGlobalProjectile(mod).rogue = true; + } public override void AI() { diff --git a/Projectiles/IchorSpear.png b/Projectiles/Rogue/IchorSpear.png similarity index 100% rename from Projectiles/IchorSpear.png rename to Projectiles/Rogue/IchorSpear.png diff --git a/Projectiles/Lionfish.cs b/Projectiles/Rogue/Lionfish.cs similarity index 96% rename from Projectiles/Lionfish.cs rename to Projectiles/Rogue/Lionfish.cs index 12c5536007..820f1a2e3c 100644 --- a/Projectiles/Lionfish.cs +++ b/Projectiles/Rogue/Lionfish.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Rogue { public class Lionfish : ModProjectile { @@ -23,7 +23,8 @@ namespace CalamityMod.Projectiles projectile.ignoreWater = true; projectile.penetrate = -1; projectile.alpha = 255; - } + projectile.GetGlobalProjectile(mod).rogue = true; + } public override void AI() { diff --git a/Projectiles/Lionfish.png b/Projectiles/Rogue/Lionfish.png similarity index 100% rename from Projectiles/Lionfish.png rename to Projectiles/Rogue/Lionfish.png diff --git a/Projectiles/Malachite.cs b/Projectiles/Rogue/Malachite.cs similarity index 94% rename from Projectiles/Malachite.cs rename to Projectiles/Rogue/Malachite.cs index 4e65c98c3a..5870878362 100644 --- a/Projectiles/Malachite.cs +++ b/Projectiles/Rogue/Malachite.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Rogue { public class Malachite : ModProjectile { @@ -29,7 +29,8 @@ namespace CalamityMod.Projectiles aiType = 514; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 1; - } + projectile.GetGlobalProjectile(mod).rogue = true; + } public override void AI() { diff --git a/Projectiles/Malachite.png b/Projectiles/Rogue/Malachite.png similarity index 100% rename from Projectiles/Malachite.png rename to Projectiles/Rogue/Malachite.png diff --git a/Projectiles/MalachiteBolt.cs b/Projectiles/Rogue/MalachiteBolt.cs similarity index 95% rename from Projectiles/MalachiteBolt.cs rename to Projectiles/Rogue/MalachiteBolt.cs index c00e4f2b3b..42e91d058b 100644 --- a/Projectiles/MalachiteBolt.cs +++ b/Projectiles/Rogue/MalachiteBolt.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Rogue { public class MalachiteBolt : ModProjectile { @@ -27,7 +27,8 @@ namespace CalamityMod.Projectiles projectile.extraUpdates = 10; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 10; - } + projectile.GetGlobalProjectile(mod).rogue = true; + } public override void AI() { diff --git a/Projectiles/MalachiteBolt.png b/Projectiles/Rogue/MalachiteBolt.png similarity index 100% rename from Projectiles/MalachiteBolt.png rename to Projectiles/Rogue/MalachiteBolt.png diff --git a/Projectiles/MangroveChakramProjectile.cs b/Projectiles/Rogue/MangroveChakramProjectile.cs similarity index 91% rename from Projectiles/MangroveChakramProjectile.cs rename to Projectiles/Rogue/MangroveChakramProjectile.cs index 6bbc85d7e6..474c6420e0 100644 --- a/Projectiles/MangroveChakramProjectile.cs +++ b/Projectiles/Rogue/MangroveChakramProjectile.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Rogue { public class MangroveChakramProjectile : ModProjectile { @@ -24,7 +24,8 @@ namespace CalamityMod.Projectiles projectile.aiStyle = 3; projectile.timeLeft = 600; aiType = 52; - } + projectile.GetGlobalProjectile(mod).rogue = true; + } public override void AI() { diff --git a/Projectiles/MangroveChakramProjectile.png b/Projectiles/Rogue/MangroveChakramProjectile.png similarity index 100% rename from Projectiles/MangroveChakramProjectile.png rename to Projectiles/Rogue/MangroveChakramProjectile.png diff --git a/Projectiles/MoltenAmputator.cs b/Projectiles/Rogue/MoltenAmputator.cs similarity index 92% rename from Projectiles/MoltenAmputator.cs rename to Projectiles/Rogue/MoltenAmputator.cs index cb675901a2..8a8230ddb2 100644 --- a/Projectiles/MoltenAmputator.cs +++ b/Projectiles/Rogue/MoltenAmputator.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Rogue { public class MoltenAmputator : ModProjectile { @@ -25,7 +25,8 @@ namespace CalamityMod.Projectiles projectile.aiStyle = 3; projectile.timeLeft = 300; aiType = 52; - } + projectile.GetGlobalProjectile(mod).rogue = true; + } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { diff --git a/Projectiles/MoltenAmputator.png b/Projectiles/Rogue/MoltenAmputator.png similarity index 100% rename from Projectiles/MoltenAmputator.png rename to Projectiles/Rogue/MoltenAmputator.png diff --git a/Projectiles/MoltenBlobThrown.cs b/Projectiles/Rogue/MoltenBlobThrown.cs similarity index 93% rename from Projectiles/MoltenBlobThrown.cs rename to Projectiles/Rogue/MoltenBlobThrown.cs index 2528efa98c..82f6c65127 100644 --- a/Projectiles/MoltenBlobThrown.cs +++ b/Projectiles/Rogue/MoltenBlobThrown.cs @@ -1,96 +1,97 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles -{ - public class MoltenBlobThrown : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Blob"); - Main.projFrames[projectile.type] = 2; - } - - public override void SetDefaults() - { - projectile.width = 12; - projectile.height = 12; - projectile.friendly = true; - projectile.penetrate = 1; - projectile.timeLeft = 300; - } - - public override void AI() - { - projectile.velocity.X *= 0.95f; - if (projectile.wet || projectile.lavaWet) - { - projectile.velocity.Y = 0f; - } - else - { - projectile.velocity.Y = projectile.velocity.Y + 0.1f; - if (projectile.velocity.Y > 5f) - { - projectile.velocity.Y = 5f; - } - } - projectile.frameCounter++; - if (projectile.frameCounter > 6) - { - projectile.frame++; - projectile.frameCounter = 0; - } - if (projectile.frame > 1) - { - projectile.frame = 0; - } - } - - public override bool TileCollideStyle(ref int width, ref int height, ref bool fallThrough) - { - fallThrough = false; - return true; - } - - public override bool OnTileCollide(Vector2 oldVelocity) - { - return false; - } - - public override Color? GetAlpha(Color lightColor) - { - return new Color(250, 150, 0, projectile.alpha); - } - - public override void Kill(int timeLeft) - { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); - projectile.position.X = projectile.position.X + (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); - projectile.width = 10; - projectile.height = 10; - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); - for (int num621 = 0; num621 < 3; num621++) - { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 2f); - if (Main.rand.Next(2) == 0) - { - Main.dust[num622].scale = 0.5f; - Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; - } - } - for (int num623 = 0; num623 < 5; num623++) - { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 3f); - Main.dust[num624].noGravity = true; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 2f); - } - } - } +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Rogue +{ + public class MoltenBlobThrown : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Blob"); + Main.projFrames[projectile.type] = 2; + } + + public override void SetDefaults() + { + projectile.width = 12; + projectile.height = 12; + projectile.friendly = true; + projectile.penetrate = 1; + projectile.timeLeft = 300; + projectile.GetGlobalProjectile(mod).rogue = true; + } + + public override void AI() + { + projectile.velocity.X *= 0.95f; + if (projectile.wet || projectile.lavaWet) + { + projectile.velocity.Y = 0f; + } + else + { + projectile.velocity.Y = projectile.velocity.Y + 0.1f; + if (projectile.velocity.Y > 5f) + { + projectile.velocity.Y = 5f; + } + } + projectile.frameCounter++; + if (projectile.frameCounter > 6) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame > 1) + { + projectile.frame = 0; + } + } + + public override bool TileCollideStyle(ref int width, ref int height, ref bool fallThrough) + { + fallThrough = false; + return true; + } + + public override bool OnTileCollide(Vector2 oldVelocity) + { + return false; + } + + public override Color? GetAlpha(Color lightColor) + { + return new Color(250, 150, 0, projectile.alpha); + } + + public override void Kill(int timeLeft) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); + projectile.position.X = projectile.position.X + (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); + projectile.width = 10; + projectile.height = 10; + projectile.position.X = projectile.position.X - (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + for (int num621 = 0; num621 < 3; num621++) + { + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 2f); + if (Main.rand.Next(2) == 0) + { + Main.dust[num622].scale = 0.5f; + Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + } + } + for (int num623 = 0; num623 < 5; num623++) + { + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 3f); + Main.dust[num624].noGravity = true; + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 2f); + } + } + } } \ No newline at end of file diff --git a/Projectiles/MoltenBlobThrown.png b/Projectiles/Rogue/MoltenBlobThrown.png similarity index 100% rename from Projectiles/MoltenBlobThrown.png rename to Projectiles/Rogue/MoltenBlobThrown.png diff --git a/Projectiles/Mycoroot.cs b/Projectiles/Rogue/Mycoroot.cs similarity index 90% rename from Projectiles/Mycoroot.cs rename to Projectiles/Rogue/Mycoroot.cs index 3bc2fc0e68..d42c918230 100644 --- a/Projectiles/Mycoroot.cs +++ b/Projectiles/Rogue/Mycoroot.cs @@ -5,7 +5,7 @@ using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Rogue { public class Mycoroot : ModProjectile { @@ -20,7 +20,8 @@ namespace CalamityMod.Projectiles projectile.height = 12; projectile.friendly = true; projectile.penetrate = 1; - } + projectile.GetGlobalProjectile(mod).rogue = true; + } public override void AI() { diff --git a/Projectiles/Mycoroot.png b/Projectiles/Rogue/Mycoroot.png similarity index 100% rename from Projectiles/Mycoroot.png rename to Projectiles/Rogue/Mycoroot.png diff --git a/Projectiles/MythrilKnifeProjectile.cs b/Projectiles/Rogue/MythrilKnifeProjectile.cs similarity index 90% rename from Projectiles/MythrilKnifeProjectile.cs rename to Projectiles/Rogue/MythrilKnifeProjectile.cs index a3c09d3f2b..e98ecb7a9c 100644 --- a/Projectiles/MythrilKnifeProjectile.cs +++ b/Projectiles/Rogue/MythrilKnifeProjectile.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Rogue { public class MythrilKnifeProjectile : ModProjectile { @@ -23,7 +23,8 @@ namespace CalamityMod.Projectiles projectile.aiStyle = 2; projectile.timeLeft = 600; aiType = 48; - } + projectile.GetGlobalProjectile(mod).rogue = true; + } public override bool OnTileCollide(Vector2 oldVelocity) { diff --git a/Projectiles/MythrilKnifeProjectile.png b/Projectiles/Rogue/MythrilKnifeProjectile.png similarity index 100% rename from Projectiles/MythrilKnifeProjectile.png rename to Projectiles/Rogue/MythrilKnifeProjectile.png diff --git a/Projectiles/OPHammer.cs b/Projectiles/Rogue/OPHammer.cs similarity index 94% rename from Projectiles/OPHammer.cs rename to Projectiles/Rogue/OPHammer.cs index 2dd46fa1d7..d9e711ffbb 100644 --- a/Projectiles/OPHammer.cs +++ b/Projectiles/Rogue/OPHammer.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Rogue { public class OPHammer : ModProjectile { @@ -22,7 +22,8 @@ namespace CalamityMod.Projectiles projectile.tileCollide = false; projectile.penetrate = -1; projectile.extraUpdates = 2; - } + projectile.GetGlobalProjectile(mod).rogue = true; + } public override void AI() { diff --git a/Projectiles/OPHammer.png b/Projectiles/Rogue/OPHammer.png similarity index 100% rename from Projectiles/OPHammer.png rename to Projectiles/Rogue/OPHammer.png diff --git a/Projectiles/OrichalcumSpikedGemstoneProjectile.cs b/Projectiles/Rogue/OrichalcumSpikedGemstoneProjectile.cs similarity index 91% rename from Projectiles/OrichalcumSpikedGemstoneProjectile.cs rename to Projectiles/Rogue/OrichalcumSpikedGemstoneProjectile.cs index ac8bbeff8c..444b7aebdb 100644 --- a/Projectiles/OrichalcumSpikedGemstoneProjectile.cs +++ b/Projectiles/Rogue/OrichalcumSpikedGemstoneProjectile.cs @@ -5,7 +5,7 @@ using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Rogue { public class OrichalcumSpikedGemstoneProjectile : ModProjectile { @@ -23,7 +23,8 @@ namespace CalamityMod.Projectiles projectile.penetrate = 6; projectile.timeLeft = 600; aiType = 48; - } + projectile.GetGlobalProjectile(mod).rogue = true; + } public override bool OnTileCollide(Vector2 oldVelocity) { diff --git a/Projectiles/OrichalcumSpikedGemstoneProjectile.png b/Projectiles/Rogue/OrichalcumSpikedGemstoneProjectile.png similarity index 100% rename from Projectiles/OrichalcumSpikedGemstoneProjectile.png rename to Projectiles/Rogue/OrichalcumSpikedGemstoneProjectile.png diff --git a/Projectiles/PalladiumJavelinProjectile.cs b/Projectiles/Rogue/PalladiumJavelinProjectile.cs similarity index 90% rename from Projectiles/PalladiumJavelinProjectile.cs rename to Projectiles/Rogue/PalladiumJavelinProjectile.cs index dffa6f99b5..03b3f3df67 100644 --- a/Projectiles/PalladiumJavelinProjectile.cs +++ b/Projectiles/Rogue/PalladiumJavelinProjectile.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Rogue { public class PalladiumJavelinProjectile : ModProjectile { @@ -24,7 +24,8 @@ namespace CalamityMod.Projectiles projectile.aiStyle = 113; projectile.timeLeft = 600; aiType = 598; - } + projectile.GetGlobalProjectile(mod).rogue = true; + } public override void AI() { diff --git a/Projectiles/PalladiumJavelinProjectile.png b/Projectiles/Rogue/PalladiumJavelinProjectile.png similarity index 100% rename from Projectiles/PalladiumJavelinProjectile.png rename to Projectiles/Rogue/PalladiumJavelinProjectile.png diff --git a/Projectiles/ProfanedTrident.cs b/Projectiles/Rogue/ProfanedTrident.cs similarity index 94% rename from Projectiles/ProfanedTrident.cs rename to Projectiles/Rogue/ProfanedTrident.cs index 390ec01aa2..ad69186bbc 100644 --- a/Projectiles/ProfanedTrident.cs +++ b/Projectiles/Rogue/ProfanedTrident.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Rogue { public class ProfanedTrident : ModProjectile { @@ -22,7 +22,8 @@ namespace CalamityMod.Projectiles projectile.penetrate = 1; projectile.tileCollide = false; projectile.timeLeft = 300; - } + projectile.GetGlobalProjectile(mod).rogue = true; + } public override void AI() { diff --git a/Projectiles/ProfanedTrident.png b/Projectiles/Rogue/ProfanedTrident.png similarity index 100% rename from Projectiles/ProfanedTrident.png rename to Projectiles/Rogue/ProfanedTrident.png diff --git a/Projectiles/Pwnagehammer.cs b/Projectiles/Rogue/Pwnagehammer.cs similarity index 90% rename from Projectiles/Pwnagehammer.cs rename to Projectiles/Rogue/Pwnagehammer.cs index 6b5d77061c..63b3071f4e 100644 --- a/Projectiles/Pwnagehammer.cs +++ b/Projectiles/Rogue/Pwnagehammer.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Rogue { public class Pwnagehammer : ModProjectile { @@ -25,7 +25,8 @@ namespace CalamityMod.Projectiles projectile.timeLeft = 120; projectile.extraUpdates = 3; aiType = 301; - } + projectile.GetGlobalProjectile(mod).rogue = true; + } public override void AI() { diff --git a/Projectiles/Pwnagehammer.png b/Projectiles/Rogue/Pwnagehammer.png similarity index 100% rename from Projectiles/Pwnagehammer.png rename to Projectiles/Rogue/Pwnagehammer.png diff --git a/Projectiles/RotBallProjectile.cs b/Projectiles/Rogue/RotBallProjectile.cs similarity index 88% rename from Projectiles/RotBallProjectile.cs rename to Projectiles/Rogue/RotBallProjectile.cs index e4b295f048..57e22e8534 100644 --- a/Projectiles/RotBallProjectile.cs +++ b/Projectiles/Rogue/RotBallProjectile.cs @@ -5,7 +5,7 @@ using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Rogue { public class RotBallProjectile : ModProjectile { @@ -23,7 +23,8 @@ namespace CalamityMod.Projectiles projectile.aiStyle = 2; projectile.timeLeft = 600; aiType = 48; - } + projectile.GetGlobalProjectile(mod).rogue = true; + } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { diff --git a/Projectiles/RotBallProjectile.png b/Projectiles/Rogue/RotBallProjectile.png similarity index 100% rename from Projectiles/RotBallProjectile.png rename to Projectiles/Rogue/RotBallProjectile.png diff --git a/Projectiles/RoyalKnife.cs b/Projectiles/Rogue/RoyalKnife.cs similarity index 91% rename from Projectiles/RoyalKnife.cs rename to Projectiles/Rogue/RoyalKnife.cs index 6cd02c44b5..43fcdf7bcb 100644 --- a/Projectiles/RoyalKnife.cs +++ b/Projectiles/Rogue/RoyalKnife.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Rogue { public class RoyalKnife : ModProjectile { @@ -21,7 +21,8 @@ namespace CalamityMod.Projectiles projectile.friendly = true; projectile.penetrate = 1; projectile.timeLeft = 300; - } + projectile.GetGlobalProjectile(mod).rogue = true; + } public override void AI() { @@ -98,7 +99,7 @@ namespace CalamityMod.Projectiles { return; } - float num = (float)damage * 0.075f; + float num = (float)damage * 0.015f; if ((int)num == 0) { return; @@ -107,7 +108,7 @@ namespace CalamityMod.Projectiles { return; } - Main.player[Main.myPlayer].lifeSteal -= num * 0.2f; + Main.player[Main.myPlayer].lifeSteal -= num * 1.5f; int num2 = projectile.owner; Projectile.NewProjectile(target.position.X, target.position.Y, 0f, 0f, mod.ProjectileType("RoyalHeal"), 0, 0f, projectile.owner, (float)num2, num); } diff --git a/Projectiles/RoyalKnife.png b/Projectiles/Rogue/RoyalKnife.png similarity index 100% rename from Projectiles/RoyalKnife.png rename to Projectiles/Rogue/RoyalKnife.png diff --git a/Projectiles/ScourgeoftheDesert.cs b/Projectiles/Rogue/ScourgeoftheDesert.cs similarity index 88% rename from Projectiles/ScourgeoftheDesert.cs rename to Projectiles/Rogue/ScourgeoftheDesert.cs index 2aaaf1c2c5..2963811798 100644 --- a/Projectiles/ScourgeoftheDesert.cs +++ b/Projectiles/Rogue/ScourgeoftheDesert.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Rogue { public class ScourgeoftheDesert : ModProjectile { @@ -23,7 +23,8 @@ namespace CalamityMod.Projectiles projectile.aiStyle = 113; aiType = 598; projectile.penetrate = 3; - } + projectile.GetGlobalProjectile(mod).rogue = true; + } public override void AI() { diff --git a/Projectiles/ScourgeoftheDesert.png b/Projectiles/Rogue/ScourgeoftheDesert.png similarity index 100% rename from Projectiles/ScourgeoftheDesert.png rename to Projectiles/Rogue/ScourgeoftheDesert.png diff --git a/Projectiles/SeashellBoomerangProjectile.cs b/Projectiles/Rogue/SeashellBoomerangProjectile.cs similarity index 83% rename from Projectiles/SeashellBoomerangProjectile.cs rename to Projectiles/Rogue/SeashellBoomerangProjectile.cs index 32b8e1ac02..4bee5a8fa8 100644 --- a/Projectiles/SeashellBoomerangProjectile.cs +++ b/Projectiles/Rogue/SeashellBoomerangProjectile.cs @@ -4,7 +4,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Rogue { public class SeashellBoomerangProjectile : ModProjectile { @@ -20,9 +20,10 @@ namespace CalamityMod.Projectiles projectile.friendly = true; projectile.penetrate = -1; projectile.aiStyle = 3; - projectile.timeLeft = 600; + projectile.timeLeft = 240; aiType = 52; - } + projectile.GetGlobalProjectile(mod).rogue = true; + } public override bool OnTileCollide(Vector2 oldVelocity) { diff --git a/Projectiles/SeashellBoomerangProjectile.png b/Projectiles/Rogue/SeashellBoomerangProjectile.png similarity index 100% rename from Projectiles/SeashellBoomerangProjectile.png rename to Projectiles/Rogue/SeashellBoomerangProjectile.png diff --git a/Projectiles/Rogue/ShatteredExplosion.cs b/Projectiles/Rogue/ShatteredExplosion.cs new file mode 100644 index 0000000000..3ac1e1474b --- /dev/null +++ b/Projectiles/Rogue/ShatteredExplosion.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Rogue +{ + public class ShatteredExplosion : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Explosion"); + } + + public override void SetDefaults() + { + projectile.width = 150; + projectile.height = 150; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.tileCollide = false; + projectile.penetrate = -1; + projectile.timeLeft = 15; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 5; + projectile.GetGlobalProjectile(mod).rogue = true; + } + + public override void AI() + { + projectile.localAI[0] += 1f; + if (projectile.localAI[0] > 4f) + { + for (int i = 0; i < 5; i++) + { + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default(Color), 1.5f); + Main.dust[num469].noGravity = true; + Main.dust[num469].velocity *= 0f; + } + } + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(mod.BuffType("HolyLight"), 180); + } + } +} \ No newline at end of file diff --git a/Projectiles/Rogue/ShatteredExplosion.png b/Projectiles/Rogue/ShatteredExplosion.png new file mode 100644 index 0000000000..3ccaea528f Binary files /dev/null and b/Projectiles/Rogue/ShatteredExplosion.png differ diff --git a/Projectiles/Rogue/ShatteredSun.cs b/Projectiles/Rogue/ShatteredSun.cs new file mode 100644 index 0000000000..6d08a960ec --- /dev/null +++ b/Projectiles/Rogue/ShatteredSun.cs @@ -0,0 +1,95 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Rogue +{ + public class ShatteredSun : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Shattered Sun"); + } + + public override void SetDefaults() + { + projectile.width = 56; + projectile.height = 56; + projectile.friendly = true; + projectile.penetrate = 3; + projectile.timeLeft = 300; + projectile.alpha = 255; + projectile.tileCollide = false; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 15; + projectile.GetGlobalProjectile(mod).rogue = true; + } + + public override void AI() + { + projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 2.355f; + if (projectile.spriteDirection == -1) + { + projectile.rotation -= 1.57f; + } + projectile.ai[1] += 1f; + if (projectile.ai[1] < 5f) + { + projectile.alpha -= 50; + } + if (projectile.ai[1] == 5f) + { + projectile.alpha = 0; + projectile.tileCollide = false; + } + + if (projectile.ai[1] == 12f) + { + int numProj = 2; + float rotation = MathHelper.ToRadians(10); + if (projectile.owner == Main.myPlayer) + { + for (int i = 0; i < numProj; i++) + { + Vector2 perturbedSpeed = new Vector2(projectile.velocity.X, projectile.velocity.Y).RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (numProj - 1))); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, perturbedSpeed.X, perturbedSpeed.Y, mod.ProjectileType("ShatteredSun2"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); + } + projectile.active = false; + } + } + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D tex = Main.projectileTexture[projectile.type]; + spriteBatch.Draw(tex, projectile.Center - Main.screenPosition, null, projectile.GetAlpha(lightColor), projectile.rotation, tex.Size() / 2f, projectile.scale, SpriteEffects.None, 0f); + return false; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, mod.ProjectileType("ShatteredExplosion"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + } + + public override bool OnTileCollide(Vector2 oldVelocity) + { + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, mod.ProjectileType("ShatteredExplosion"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + return true; + } + + public override void Kill(int timeLeft) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 27); + for (int k = 0; k < 5; k++) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 246, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f, 0, default(Color), 1f); + } + } + } +} \ No newline at end of file diff --git a/Projectiles/Rogue/ShatteredSun.png b/Projectiles/Rogue/ShatteredSun.png new file mode 100644 index 0000000000..95bfbda427 Binary files /dev/null and b/Projectiles/Rogue/ShatteredSun.png differ diff --git a/Projectiles/Rogue/ShatteredSun2.cs b/Projectiles/Rogue/ShatteredSun2.cs new file mode 100644 index 0000000000..73ff6dcb24 --- /dev/null +++ b/Projectiles/Rogue/ShatteredSun2.cs @@ -0,0 +1,83 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Rogue +{ + public class ShatteredSun2 : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Shattered Sun"); + } + + public override void SetDefaults() + { + projectile.width = 56; + projectile.height = 56; + projectile.friendly = true; + projectile.penetrate = 3; + projectile.timeLeft = 300; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 15; + projectile.GetGlobalProjectile(mod).rogue = true; + } + + public override void AI() + { + projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 2.355f; + if (projectile.spriteDirection == -1) + { + projectile.rotation -= 1.57f; + } + projectile.ai[1] += 1f; + if (projectile.ai[1] == 8f) + { + int numProj = 2; + float rotation = MathHelper.ToRadians(10); + if (projectile.owner == Main.myPlayer) + { + for (int i = 0; i < numProj; i++) + { + Vector2 perturbedSpeed = new Vector2(projectile.velocity.X, projectile.velocity.Y).RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (numProj - 1))); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, perturbedSpeed.X, perturbedSpeed.Y, mod.ProjectileType("ShatteredSun3"), (int)((double)projectile.damage * 0.5f), projectile.knockBack, projectile.owner, 0f, 0f); + } + projectile.active = false; + } + } + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D tex = Main.projectileTexture[projectile.type]; + spriteBatch.Draw(tex, projectile.Center - Main.screenPosition, null, projectile.GetAlpha(lightColor), projectile.rotation, tex.Size() / 2f, projectile.scale, SpriteEffects.None, 0f); + return false; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, mod.ProjectileType("ShatteredExplosion"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + } + + public override bool OnTileCollide(Vector2 oldVelocity) + { + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, mod.ProjectileType("ShatteredExplosion"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + return true; + } + + public override void Kill(int timeLeft) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 27); + for (int k = 0; k < 5; k++) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 246, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f, 0, default(Color), 1f); + } + } + } +} \ No newline at end of file diff --git a/Projectiles/Rogue/ShatteredSun2.png b/Projectiles/Rogue/ShatteredSun2.png new file mode 100644 index 0000000000..95bfbda427 Binary files /dev/null and b/Projectiles/Rogue/ShatteredSun2.png differ diff --git a/Projectiles/Rogue/ShatteredSun3.cs b/Projectiles/Rogue/ShatteredSun3.cs new file mode 100644 index 0000000000..ca323fc5de --- /dev/null +++ b/Projectiles/Rogue/ShatteredSun3.cs @@ -0,0 +1,98 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Rogue +{ + public class ShatteredSun3 : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Shattered Sun"); + } + + public override void SetDefaults() + { + projectile.width = 56; + projectile.height = 56; + projectile.friendly = true; + projectile.penetrate = 1; + projectile.timeLeft = 300; + projectile.GetGlobalProjectile(mod).rogue = true; + } + + public override void AI() + { + projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 2.355f; + if (projectile.spriteDirection == -1) + { + projectile.rotation -= 1.57f; + } + float centerX = projectile.Center.X; + float centerY = projectile.Center.Y; + float num474 = 750f; + bool homeIn = false; + for (int i = 0; i < 200; i++) + { + if (Main.npc[i].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[i].Center, 1, 1)) + { + float num476 = Main.npc[i].position.X + (float)(Main.npc[i].width / 2); + float num477 = Main.npc[i].position.Y + (float)(Main.npc[i].height / 2); + float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477); + if (num478 < num474) + { + num474 = num478; + centerX = num476; + centerY = num477; + homeIn = true; + } + } + } + if (homeIn) + { + float num483 = 20f; + Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + float num484 = centerX - vector35.X; + float num485 = centerY - vector35.Y; + float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485)); + num486 = num483 / num486; + num484 *= num486; + num485 *= num486; + projectile.velocity.X = (projectile.velocity.X * 15f + num484) / 16f; + projectile.velocity.Y = (projectile.velocity.Y * 15f + num485) / 16f; + } + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D tex = Main.projectileTexture[projectile.type]; + spriteBatch.Draw(tex, projectile.Center - Main.screenPosition, null, projectile.GetAlpha(lightColor), projectile.rotation, tex.Size() / 2f, projectile.scale, SpriteEffects.None, 0f); + return false; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, mod.ProjectileType("ShatteredExplosion"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + } + + public override bool OnTileCollide(Vector2 oldVelocity) + { + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, mod.ProjectileType("ShatteredExplosion"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + return true; + } + + public override void Kill(int timeLeft) + { + for (int k = 0; k < 5; k++) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 246, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f, 0, default(Color), 1f); + } + } + } +} \ No newline at end of file diff --git a/Projectiles/Rogue/ShatteredSun3.png b/Projectiles/Rogue/ShatteredSun3.png new file mode 100644 index 0000000000..95bfbda427 Binary files /dev/null and b/Projectiles/Rogue/ShatteredSun3.png differ diff --git a/Projectiles/SpearofPaleolith.cs b/Projectiles/Rogue/SpearofPaleolith.cs similarity index 92% rename from Projectiles/SpearofPaleolith.cs rename to Projectiles/Rogue/SpearofPaleolith.cs index 55a51f155a..7ecd2cdc62 100644 --- a/Projectiles/SpearofPaleolith.cs +++ b/Projectiles/Rogue/SpearofPaleolith.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Rogue { public class SpearofPaleolith : ModProjectile { @@ -26,7 +26,8 @@ namespace CalamityMod.Projectiles projectile.aiStyle = 113; projectile.timeLeft = 600; aiType = 598; - } + projectile.GetGlobalProjectile(mod).rogue = true; + } public override void AI() { diff --git a/Projectiles/SpearofPaleolith.png b/Projectiles/Rogue/SpearofPaleolith.png similarity index 100% rename from Projectiles/SpearofPaleolith.png rename to Projectiles/Rogue/SpearofPaleolith.png diff --git a/Projectiles/TarragonThrowingDartProjectile.cs b/Projectiles/Rogue/TarragonThrowingDartProjectile.cs similarity index 91% rename from Projectiles/TarragonThrowingDartProjectile.cs rename to Projectiles/Rogue/TarragonThrowingDartProjectile.cs index a2df9c4db4..768e3433d5 100644 --- a/Projectiles/TarragonThrowingDartProjectile.cs +++ b/Projectiles/Rogue/TarragonThrowingDartProjectile.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Rogue { public class TarragonThrowingDartProjectile : ModProjectile { @@ -24,7 +24,8 @@ namespace CalamityMod.Projectiles projectile.aiStyle = 113; projectile.timeLeft = 600; aiType = 598; - } + projectile.GetGlobalProjectile(mod).rogue = true; + } public override void AI() { diff --git a/Projectiles/TarragonThrowingDartProjectile.png b/Projectiles/Rogue/TarragonThrowingDartProjectile.png similarity index 100% rename from Projectiles/TarragonThrowingDartProjectile.png rename to Projectiles/Rogue/TarragonThrowingDartProjectile.png diff --git a/Projectiles/TitaniumShurikenProjectile.cs b/Projectiles/Rogue/TitaniumShurikenProjectile.cs similarity index 88% rename from Projectiles/TitaniumShurikenProjectile.cs rename to Projectiles/Rogue/TitaniumShurikenProjectile.cs index 79f51b6275..9950b75f53 100644 --- a/Projectiles/TitaniumShurikenProjectile.cs +++ b/Projectiles/Rogue/TitaniumShurikenProjectile.cs @@ -5,7 +5,7 @@ using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Rogue { public class TitaniumShurikenProjectile : ModProjectile { @@ -23,7 +23,8 @@ namespace CalamityMod.Projectiles projectile.aiStyle = 2; projectile.timeLeft = 600; aiType = 48; - } + projectile.GetGlobalProjectile(mod).rogue = true; + } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { diff --git a/Projectiles/TitaniumShurikenProjectile.png b/Projectiles/Rogue/TitaniumShurikenProjectile.png similarity index 100% rename from Projectiles/TitaniumShurikenProjectile.png rename to Projectiles/Rogue/TitaniumShurikenProjectile.png diff --git a/Projectiles/ToothBallProjectile.cs b/Projectiles/Rogue/ToothBallProjectile.cs similarity index 88% rename from Projectiles/ToothBallProjectile.cs rename to Projectiles/Rogue/ToothBallProjectile.cs index 5719dffdba..93a243df30 100644 --- a/Projectiles/ToothBallProjectile.cs +++ b/Projectiles/Rogue/ToothBallProjectile.cs @@ -5,7 +5,7 @@ using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Rogue { public class ToothBallProjectile : ModProjectile { @@ -23,7 +23,8 @@ namespace CalamityMod.Projectiles projectile.aiStyle = 2; projectile.timeLeft = 600; aiType = 48; - } + projectile.GetGlobalProjectile(mod).rogue = true; + } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { diff --git a/Projectiles/ToothBallProjectile.png b/Projectiles/Rogue/ToothBallProjectile.png similarity index 100% rename from Projectiles/ToothBallProjectile.png rename to Projectiles/Rogue/ToothBallProjectile.png diff --git a/Projectiles/TriactisOPHammer.cs b/Projectiles/Rogue/TriactisOPHammer.cs similarity index 95% rename from Projectiles/TriactisOPHammer.cs rename to Projectiles/Rogue/TriactisOPHammer.cs index 99e7404379..c0a3b6261a 100644 --- a/Projectiles/TriactisOPHammer.cs +++ b/Projectiles/Rogue/TriactisOPHammer.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Rogue { public class TriactisOPHammer : ModProjectile { @@ -22,7 +22,8 @@ namespace CalamityMod.Projectiles projectile.tileCollide = false; projectile.penetrate = -1; projectile.extraUpdates = 3; - } + projectile.GetGlobalProjectile(mod).rogue = true; + } public override void AI() { diff --git a/Projectiles/TriactisOPHammer.png b/Projectiles/Rogue/TriactisOPHammer.png similarity index 100% rename from Projectiles/TriactisOPHammer.png rename to Projectiles/Rogue/TriactisOPHammer.png diff --git a/Projectiles/UrchinStinger.cs b/Projectiles/Rogue/UrchinStinger.cs similarity index 86% rename from Projectiles/UrchinStinger.cs rename to Projectiles/Rogue/UrchinStinger.cs index 48a113be78..65571f81c6 100644 --- a/Projectiles/UrchinStinger.cs +++ b/Projectiles/Rogue/UrchinStinger.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Rogue { public class UrchinStinger : ModProjectile { @@ -23,7 +23,8 @@ namespace CalamityMod.Projectiles projectile.aiStyle = 2; projectile.timeLeft = 600; aiType = 48; - } + projectile.GetGlobalProjectile(mod).rogue = true; + } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { diff --git a/Projectiles/UrchinStinger.png b/Projectiles/Rogue/UrchinStinger.png similarity index 100% rename from Projectiles/UrchinStinger.png rename to Projectiles/Rogue/UrchinStinger.png diff --git a/Projectiles/Valediction.cs b/Projectiles/Rogue/Valediction.cs similarity index 96% rename from Projectiles/Valediction.cs rename to Projectiles/Rogue/Valediction.cs index fa576db5cd..cd89e990f8 100644 --- a/Projectiles/Valediction.cs +++ b/Projectiles/Rogue/Valediction.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Rogue { public class Valediction : ModProjectile { @@ -25,7 +25,8 @@ namespace CalamityMod.Projectiles projectile.extraUpdates = 3; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 15; - } + projectile.GetGlobalProjectile(mod).rogue = true; + } public override void AI() { diff --git a/Projectiles/Valediction.png b/Projectiles/Rogue/Valediction.png similarity index 100% rename from Projectiles/Valediction.png rename to Projectiles/Rogue/Valediction.png diff --git a/Projectiles/WulfrumKnife.cs b/Projectiles/Rogue/WulfrumKnife.cs similarity index 88% rename from Projectiles/WulfrumKnife.cs rename to Projectiles/Rogue/WulfrumKnife.cs index 3eaabec33e..8568a6b254 100644 --- a/Projectiles/WulfrumKnife.cs +++ b/Projectiles/Rogue/WulfrumKnife.cs @@ -5,7 +5,7 @@ using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Rogue { public class WulfrumKnife : ModProjectile { @@ -23,7 +23,8 @@ namespace CalamityMod.Projectiles projectile.aiStyle = 2; projectile.timeLeft = 600; aiType = 48; - } + projectile.GetGlobalProjectile(mod).rogue = true; + } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { diff --git a/Projectiles/WulfrumKnife.png b/Projectiles/Rogue/WulfrumKnife.png similarity index 100% rename from Projectiles/WulfrumKnife.png rename to Projectiles/Rogue/WulfrumKnife.png diff --git a/Projectiles/XerocPitchforkProjectile.cs b/Projectiles/Rogue/XerocPitchforkProjectile.cs similarity index 91% rename from Projectiles/XerocPitchforkProjectile.cs rename to Projectiles/Rogue/XerocPitchforkProjectile.cs index b76c20d846..65dcf5ce13 100644 --- a/Projectiles/XerocPitchforkProjectile.cs +++ b/Projectiles/Rogue/XerocPitchforkProjectile.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Rogue { public class XerocPitchforkProjectile : ModProjectile { @@ -25,7 +25,8 @@ namespace CalamityMod.Projectiles projectile.aiStyle = 113; projectile.timeLeft = 600; aiType = 598; - } + projectile.GetGlobalProjectile(mod).rogue = true; + } public override void AI() { diff --git a/Projectiles/XerocPitchforkProjectile.png b/Projectiles/Rogue/XerocPitchforkProjectile.png similarity index 100% rename from Projectiles/XerocPitchforkProjectile.png rename to Projectiles/Rogue/XerocPitchforkProjectile.png diff --git a/Projectiles/ScourgeoftheCosmos.png b/Projectiles/ScourgeoftheCosmos.png deleted file mode 100644 index ef44fee035..0000000000 Binary files a/Projectiles/ScourgeoftheCosmos.png and /dev/null differ diff --git a/Projectiles/ScourgeoftheCosmosMini.png b/Projectiles/ScourgeoftheCosmosMini.png deleted file mode 100644 index 958b953c3f..0000000000 Binary files a/Projectiles/ScourgeoftheCosmosMini.png and /dev/null differ diff --git a/Projectiles/SirenLure.png b/Projectiles/SirenLure.png deleted file mode 100644 index 7564564883..0000000000 Binary files a/Projectiles/SirenLure.png and /dev/null differ diff --git a/Projectiles/SirenYoung.png b/Projectiles/SirenYoung.png deleted file mode 100644 index c75521c71b..0000000000 Binary files a/Projectiles/SirenYoung.png and /dev/null differ diff --git a/Projectiles/SolsticeBeam.cs b/Projectiles/SolsticeBeam.cs deleted file mode 100644 index e311099699..0000000000 --- a/Projectiles/SolsticeBeam.cs +++ /dev/null @@ -1,208 +0,0 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles -{ - public class SolsticeBeam : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Beam"); - } - - public override void SetDefaults() - { - projectile.width = 20; - projectile.height = 20; - projectile.friendly = true; - projectile.melee = true; - projectile.penetrate = 1; - projectile.timeLeft = 600; - } - - public override void AI() - { - Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0.5f) / 255f, ((255 - projectile.alpha) * 0.5f) / 255f, ((255 - projectile.alpha) * 0.5f) / 255f); - projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 0.785f; - if (projectile.ai[1] == 0f) - { - projectile.ai[1] = 1f; - Main.PlaySound(SoundID.Item60, projectile.position); - } - if (projectile.localAI[0] == 0f) - { - projectile.scale -= 0.02f; - projectile.alpha += 30; - if (projectile.alpha >= 250) - { - projectile.alpha = 255; - projectile.localAI[0] = 1f; - } - } - else if (projectile.localAI[0] == 1f) - { - projectile.scale += 0.02f; - projectile.alpha -= 30; - if (projectile.alpha <= 0) - { - projectile.alpha = 0; - projectile.localAI[0] = 0f; - } - } - int dustType = 0; - if (CalamityWorld.spring) - { - dustType = Utils.SelectRandom(Main.rand, new int[] - { - 74, - 157, - 107 - }); - } - else if (CalamityWorld.summer) - { - dustType = Utils.SelectRandom(Main.rand, new int[] - { - 247, - 228, - 57 - }); - } - else if (CalamityWorld.fall) - { - dustType = Utils.SelectRandom(Main.rand, new int[] - { - 6, - 259, - 158 - }); - } - else if (CalamityWorld.winter) - { - dustType = Utils.SelectRandom(Main.rand, new int[] - { - 67, - 229, - 185 - }); - } - if (Main.rand.Next(3) == 0) - { - int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType, projectile.velocity.X * 0.05f, projectile.velocity.Y * 0.05f); - Main.dust[dust].noGravity = true; - } - } - - public override Color? GetAlpha(Color lightColor) - { - byte red = 255; - byte green = 255; - byte blue = 255; - if (CalamityWorld.spring) - { - red = 0; - green = 250; - blue = 0; - } - else if (CalamityWorld.summer) - { - red = 250; - green = 250; - blue = 0; - } - else if (CalamityWorld.fall) - { - red = 250; - green = 150; - blue = 50; - } - else if (CalamityWorld.winter) - { - red = 100; - green = 150; - blue = 250; - } - return new Color(red, green, blue, projectile.alpha); - } - - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - Texture2D tex = Main.projectileTexture[projectile.type]; - spriteBatch.Draw(tex, projectile.Center - Main.screenPosition, null, projectile.GetAlpha(lightColor), projectile.rotation, tex.Size() / 2f, projectile.scale, SpriteEffects.None, 0f); - return false; - } - - public override void Kill(int timeLeft) - { - int dustType = 0; - if (CalamityWorld.spring) - { - dustType = Utils.SelectRandom(Main.rand, new int[] - { - 245, - 157, - 107 - }); - } - else if (CalamityWorld.summer) - { - dustType = Utils.SelectRandom(Main.rand, new int[] - { - 247, - 228, - 57 - }); - } - else if (CalamityWorld.fall) - { - dustType = Utils.SelectRandom(Main.rand, new int[] - { - 6, - 259, - 158 - }); - } - else if (CalamityWorld.winter) - { - dustType = Utils.SelectRandom(Main.rand, new int[] - { - 67, - 229, - 185 - }); - } - Main.PlaySound(SoundID.Item10, projectile.position); - int num3; - for (int num795 = 4; num795 < 31; num795 = num3 + 1) - { - float num796 = projectile.oldVelocity.X * (30f / (float)num795); - float num797 = projectile.oldVelocity.Y * (30f / (float)num795); - int num798 = Dust.NewDust(new Vector2(projectile.oldPosition.X - num796, projectile.oldPosition.Y - num797), 8, 8, dustType, projectile.oldVelocity.X, projectile.oldVelocity.Y, 100, default(Color), 1.8f); - Main.dust[num798].noGravity = true; - Dust dust = Main.dust[num798]; - dust.velocity *= 0.5f; - num798 = Dust.NewDust(new Vector2(projectile.oldPosition.X - num796, projectile.oldPosition.Y - num797), 8, 8, dustType, projectile.oldVelocity.X, projectile.oldVelocity.Y, 100, default(Color), 1.4f); - dust = Main.dust[num798]; - dust.velocity *= 0.05f; - num3 = num795; - } - } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - if (Main.dayTime) - { - target.AddBuff(BuffID.Daybreak, 300); - } - else - { - target.AddBuff(mod.BuffType("Nightwither"), 300); - } - } - } -} \ No newline at end of file diff --git a/Projectiles/AngryChicken.cs b/Projectiles/Summon/AngryChicken.cs similarity index 86% rename from Projectiles/AngryChicken.cs rename to Projectiles/Summon/AngryChicken.cs index bedcd4dc99..811a55eb7c 100644 --- a/Projectiles/AngryChicken.cs +++ b/Projectiles/Summon/AngryChicken.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Summon { public class AngryChicken : ModProjectile { @@ -39,7 +39,9 @@ namespace CalamityMod.Projectiles { if (projectile.localAI[0] == 0f) { - int num501 = 100; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue = projectile.damage; + int num501 = 100; for (int num502 = 0; num502 < num501; num502++) { int num503 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 16f), projectile.width, projectile.height - 16, 244, 0f, 0f, 0, default(Color), 1f); @@ -48,7 +50,14 @@ namespace CalamityMod.Projectiles } projectile.localAI[0] += 1f; } - if ((double)Math.Abs(projectile.velocity.X) > 0.2) + if (Main.player[projectile.owner].minionDamage != projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) + { + int damage2 = (int)(((float)projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue / + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) * + Main.player[projectile.owner].minionDamage); + projectile.damage = damage2; + } + if ((double)Math.Abs(projectile.velocity.X) > 0.2) { projectile.spriteDirection = -projectile.direction; } diff --git a/Projectiles/AngryChicken.png b/Projectiles/Summon/AngryChicken.png similarity index 100% rename from Projectiles/AngryChicken.png rename to Projectiles/Summon/AngryChicken.png diff --git a/Projectiles/AquaticStar.cs b/Projectiles/Summon/AquaticStar.cs similarity index 72% rename from Projectiles/AquaticStar.cs rename to Projectiles/Summon/AquaticStar.cs index b6b2ec8dcc..550d96d679 100644 --- a/Projectiles/AquaticStar.cs +++ b/Projectiles/Summon/AquaticStar.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Summon { public class AquaticStar : ModProjectile { @@ -39,7 +39,9 @@ namespace CalamityMod.Projectiles { if (dust == 0f) { - int num226 = 36; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue = projectile.damage; + int num226 = 36; for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; @@ -52,7 +54,14 @@ namespace CalamityMod.Projectiles } dust += 1f; } - projectile.rotation += projectile.velocity.X * 0.04f; + if (Main.player[projectile.owner].minionDamage != projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) + { + int damage2 = (int)(((float)projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue / + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) * + Main.player[projectile.owner].minionDamage); + projectile.damage = damage2; + } + projectile.rotation += projectile.velocity.X * 0.04f; bool flag64 = projectile.type == mod.ProjectileType("AquaticStar"); Player player = Main.player[projectile.owner]; CalamityPlayer modPlayer = player.GetModPlayer(mod); diff --git a/Projectiles/AquaticStar.png b/Projectiles/Summon/AquaticStar.png similarity index 100% rename from Projectiles/AquaticStar.png rename to Projectiles/Summon/AquaticStar.png diff --git a/Projectiles/BabyPlaguebringer.png b/Projectiles/Summon/BabyPlaguebringer.png similarity index 100% rename from Projectiles/BabyPlaguebringer.png rename to Projectiles/Summon/BabyPlaguebringer.png diff --git a/Projectiles/BigBustyRose.cs b/Projectiles/Summon/BigBustyRose.cs similarity index 89% rename from Projectiles/BigBustyRose.cs rename to Projectiles/Summon/BigBustyRose.cs index e7809bb402..fc991791ee 100644 --- a/Projectiles/BigBustyRose.cs +++ b/Projectiles/Summon/BigBustyRose.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Summon { public class BigBustyRose : ModProjectile { @@ -65,7 +65,9 @@ namespace CalamityMod.Projectiles dust--; if (dust >= 0) { - int num501 = 50; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue = projectile.damage; + int num501 = 50; for (int num502 = 0; num502 < num501; num502++) { int num503 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 16f), projectile.width, projectile.height - 16, 235, 0f, 0f, 0, default(Color), 1f); @@ -73,7 +75,14 @@ namespace CalamityMod.Projectiles Main.dust[num503].scale *= 1.15f; } } - projectile.frameCounter++; + if (Main.player[projectile.owner].minionDamage != projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) + { + int damage2 = (int)(((float)projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue / + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) * + Main.player[projectile.owner].minionDamage); + projectile.damage = damage2; + } + projectile.frameCounter++; if (projectile.frameCounter > 20) { projectile.frame++; diff --git a/Projectiles/BigBustyRose.png b/Projectiles/Summon/BigBustyRose.png similarity index 100% rename from Projectiles/BigBustyRose.png rename to Projectiles/Summon/BigBustyRose.png diff --git a/Projectiles/BloodClotMinion.cs b/Projectiles/Summon/BloodClotMinion.cs similarity index 91% rename from Projectiles/BloodClotMinion.cs rename to Projectiles/Summon/BloodClotMinion.cs index 4ec585df6f..31607e57af 100644 --- a/Projectiles/BloodClotMinion.cs +++ b/Projectiles/Summon/BloodClotMinion.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Summon { public class BloodClotMinion : ModProjectile { @@ -37,7 +37,9 @@ namespace CalamityMod.Projectiles { if (projectile.localAI[0] == 0f) { - int num226 = 36; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue = projectile.damage; + int num226 = 36; for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; @@ -50,7 +52,14 @@ namespace CalamityMod.Projectiles } projectile.localAI[0] += 1f; } - int num1262 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 5, 0f, 0f, 0, default(Color), 1f); + if (Main.player[projectile.owner].minionDamage != projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) + { + int damage2 = (int)(((float)projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue / + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) * + Main.player[projectile.owner].minionDamage); + projectile.damage = damage2; + } + int num1262 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 5, 0f, 0f, 0, default(Color), 1f); Main.dust[num1262].velocity *= 0.1f; Main.dust[num1262].scale = 0.7f; Main.dust[num1262].noGravity = true; diff --git a/Projectiles/BloodClotMinion.png b/Projectiles/Summon/BloodClotMinion.png similarity index 100% rename from Projectiles/BloodClotMinion.png rename to Projectiles/Summon/BloodClotMinion.png diff --git a/Projectiles/BrimstoneFireSummon.cs b/Projectiles/Summon/BrimstoneFireSummon.cs similarity index 95% rename from Projectiles/BrimstoneFireSummon.cs rename to Projectiles/Summon/BrimstoneFireSummon.cs index 051f939911..ccd5d439a9 100644 --- a/Projectiles/BrimstoneFireSummon.cs +++ b/Projectiles/Summon/BrimstoneFireSummon.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Summon { public class BrimstoneFireSummon : ModProjectile { diff --git a/Projectiles/BrimstoneFireSummon.png b/Projectiles/Summon/BrimstoneFireSummon.png similarity index 100% rename from Projectiles/BrimstoneFireSummon.png rename to Projectiles/Summon/BrimstoneFireSummon.png diff --git a/Projectiles/Summon/BrimstoneLaserSummon.cs b/Projectiles/Summon/BrimstoneLaserSummon.cs new file mode 100644 index 0000000000..e1559c8398 --- /dev/null +++ b/Projectiles/Summon/BrimstoneLaserSummon.cs @@ -0,0 +1,51 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Summon +{ + public class BrimstoneLaserSummon : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Laser"); + } + + public override void SetDefaults() + { + projectile.width = 32; + projectile.height = 2; + projectile.aiStyle = 1; + aiType = 100; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.minion = true; + projectile.minionSlots = 0; + projectile.penetrate = 1; + projectile.alpha = 120; + projectile.timeLeft = 300; + } + + public override void AI() + { + Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0.5f) / 255f, ((255 - projectile.alpha) * 0.05f) / 255f, ((255 - projectile.alpha) * 0.05f) / 255f); + projectile.velocity.X *= 1.05f; + projectile.velocity.Y *= 1.05f; + projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; + projectile.velocity.Y += projectile.ai[0]; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(mod.BuffType("BrimstoneFlames"), 60); + } + + public override Color? GetAlpha(Color lightColor) + { + return new Color(250, 50, 50, projectile.alpha); + } + } +} \ No newline at end of file diff --git a/Projectiles/BrimstoneLaserSummon.png b/Projectiles/Summon/BrimstoneLaserSummon.png similarity index 100% rename from Projectiles/BrimstoneLaserSummon.png rename to Projectiles/Summon/BrimstoneLaserSummon.png diff --git a/Projectiles/BrittleStar.cs b/Projectiles/Summon/BrittleStar.cs similarity index 71% rename from Projectiles/BrittleStar.cs rename to Projectiles/Summon/BrittleStar.cs index 463f65f740..6c098ae9a5 100644 --- a/Projectiles/BrittleStar.cs +++ b/Projectiles/Summon/BrittleStar.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Summon { public class BrittleStar : ModProjectile { @@ -39,7 +39,9 @@ namespace CalamityMod.Projectiles { if (dust == 0f) { - int num226 = 36; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue = projectile.damage; + int num226 = 36; for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; @@ -52,7 +54,14 @@ namespace CalamityMod.Projectiles } dust += 1f; } - projectile.rotation += projectile.velocity.X * 0.04f; + if (Main.player[projectile.owner].minionDamage != projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) + { + int damage2 = (int)(((float)projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue / + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) * + Main.player[projectile.owner].minionDamage); + projectile.damage = damage2; + } + projectile.rotation += projectile.velocity.X * 0.04f; bool flag64 = projectile.type == mod.ProjectileType("BrittleStar"); Player player = Main.player[projectile.owner]; CalamityPlayer modPlayer = player.GetModPlayer(mod); diff --git a/Projectiles/BrittleStar.png b/Projectiles/Summon/BrittleStar.png similarity index 100% rename from Projectiles/BrittleStar.png rename to Projectiles/Summon/BrittleStar.png diff --git a/Projectiles/Calamari.cs b/Projectiles/Summon/Calamari.cs similarity index 91% rename from Projectiles/Calamari.cs rename to Projectiles/Summon/Calamari.cs index 25c14c6609..5c7dad9b74 100644 --- a/Projectiles/Calamari.cs +++ b/Projectiles/Summon/Calamari.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Summon { public class Calamari : ModProjectile { @@ -39,7 +39,9 @@ namespace CalamityMod.Projectiles { if (projectile.localAI[1] == 0f) { - int num226 = 36; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; //66% = 1.66 + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue = projectile.damage; //300 * 1.66 = 498 (new value) + int num226 = 36; for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; @@ -52,7 +54,14 @@ namespace CalamityMod.Projectiles } projectile.localAI[1] += 1f; } - projectile.frameCounter++; + if (Main.player[projectile.owner].minionDamage != projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) //15% = 1.15 != 1.66 + { + int damage2 = (int)(((float)projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue / //498 + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) * //1.66 498 / 1.66 = 300 (original value) + Main.player[projectile.owner].minionDamage); //300 * 1.15 = 345 (new value) + projectile.damage = damage2; + } + projectile.frameCounter++; if (projectile.frameCounter > 8) { projectile.frame++; @@ -333,7 +342,6 @@ namespace CalamityMod.Projectiles vector7 *= scaleFactor4; Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y + 20, vector7.X, vector7.Y, num28, projectile.damage, 0f, Main.myPlayer, 0f, 0f); projectile.netUpdate = true; - return; } } } @@ -349,9 +357,9 @@ namespace CalamityMod.Projectiles return false; } - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(mod.BuffType("CrushDepth"), 600); - } - } + public override bool CanDamage() + { + return false; + } + } } \ No newline at end of file diff --git a/Projectiles/Calamari.png b/Projectiles/Summon/Calamari.png similarity index 100% rename from Projectiles/Calamari.png rename to Projectiles/Summon/Calamari.png diff --git a/Projectiles/CalamariInk.cs b/Projectiles/Summon/CalamariInk.cs similarity index 97% rename from Projectiles/CalamariInk.cs rename to Projectiles/Summon/CalamariInk.cs index 7328ad5bd2..620bef669c 100644 --- a/Projectiles/CalamariInk.cs +++ b/Projectiles/Summon/CalamariInk.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Summon { public class CalamariInk : ModProjectile { diff --git a/Projectiles/CalamariInk.png b/Projectiles/Summon/CalamariInk.png similarity index 100% rename from Projectiles/CalamariInk.png rename to Projectiles/Summon/CalamariInk.png diff --git a/Projectiles/Calamitamini.cs b/Projectiles/Summon/Calamitamini.cs similarity index 86% rename from Projectiles/Calamitamini.cs rename to Projectiles/Summon/Calamitamini.cs index e3b525807f..2a9da038cc 100644 --- a/Projectiles/Calamitamini.cs +++ b/Projectiles/Summon/Calamitamini.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Summon { public class Calamitamini : ModProjectile { @@ -37,7 +37,9 @@ namespace CalamityMod.Projectiles { if (projectile.localAI[0] == 0f) { - int num226 = 36; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue = projectile.damage; + int num226 = 36; for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; @@ -49,7 +51,14 @@ namespace CalamityMod.Projectiles } projectile.localAI[0] += 1f; } - float num633 = 700f; + if (Main.player[projectile.owner].minionDamage != projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) + { + int damage2 = (int)(((float)projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue / + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) * + Main.player[projectile.owner].minionDamage); + projectile.damage = damage2; + } + float num633 = 700f; float num634 = 1100f; float num635 = 2400f; float num636 = 150f; @@ -238,5 +247,10 @@ namespace CalamityMod.Projectiles } } } - } + + public override bool CanDamage() + { + return false; + } + } } \ No newline at end of file diff --git a/Projectiles/Calamitamini.png b/Projectiles/Summon/Calamitamini.png similarity index 100% rename from Projectiles/Calamitamini.png rename to Projectiles/Summon/Calamitamini.png diff --git a/Projectiles/Cataclymini.cs b/Projectiles/Summon/Cataclymini.cs similarity index 86% rename from Projectiles/Cataclymini.cs rename to Projectiles/Summon/Cataclymini.cs index ca739a1072..907990f50b 100644 --- a/Projectiles/Cataclymini.cs +++ b/Projectiles/Summon/Cataclymini.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Summon { public class Cataclymini : ModProjectile { @@ -37,7 +37,9 @@ namespace CalamityMod.Projectiles { if (projectile.localAI[0] == 0f) { - int num226 = 36; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue = projectile.damage; + int num226 = 36; for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; @@ -49,7 +51,14 @@ namespace CalamityMod.Projectiles } projectile.localAI[0] += 1f; } - float num633 = 700f; + if (Main.player[projectile.owner].minionDamage != projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) + { + int damage2 = (int)(((float)projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue / + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) * + Main.player[projectile.owner].minionDamage); + projectile.damage = damage2; + } + float num633 = 700f; float num634 = 1100f; float num635 = 2400f; float num636 = 150f; @@ -237,5 +246,10 @@ namespace CalamityMod.Projectiles } } } - } + + public override bool CanDamage() + { + return false; + } + } } \ No newline at end of file diff --git a/Projectiles/Cataclymini.png b/Projectiles/Summon/Cataclymini.png similarity index 100% rename from Projectiles/Cataclymini.png rename to Projectiles/Summon/Cataclymini.png diff --git a/Projectiles/Catastromini.cs b/Projectiles/Summon/Catastromini.cs similarity index 87% rename from Projectiles/Catastromini.cs rename to Projectiles/Summon/Catastromini.cs index d3bee430ad..39740a2788 100644 --- a/Projectiles/Catastromini.cs +++ b/Projectiles/Summon/Catastromini.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Summon { public class Catastromini : ModProjectile { @@ -36,7 +36,9 @@ namespace CalamityMod.Projectiles { if (projectile.localAI[0] == 0f) { - int num226 = 36; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue = projectile.damage; + int num226 = 36; for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; @@ -48,7 +50,14 @@ namespace CalamityMod.Projectiles } projectile.localAI[0] += 1f; } - float num633 = 700f; + if (Main.player[projectile.owner].minionDamage != projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) + { + int damage2 = (int)(((float)projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue / + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) * + Main.player[projectile.owner].minionDamage); + projectile.damage = damage2; + } + float num633 = 700f; float num634 = 1100f; float num635 = 2400f; float num636 = 150f; diff --git a/Projectiles/Catastromini.png b/Projectiles/Summon/Catastromini.png similarity index 100% rename from Projectiles/Catastromini.png rename to Projectiles/Summon/Catastromini.png diff --git a/Projectiles/ChaosFlame.cs b/Projectiles/Summon/ChaosFlame.cs similarity index 94% rename from Projectiles/ChaosFlame.cs rename to Projectiles/Summon/ChaosFlame.cs index 9f9c3526cb..930ca6e015 100644 --- a/Projectiles/ChaosFlame.cs +++ b/Projectiles/Summon/ChaosFlame.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Summon { public class ChaosFlame : ModProjectile { diff --git a/Projectiles/ChaosFlame.png b/Projectiles/Summon/ChaosFlame.png similarity index 100% rename from Projectiles/ChaosFlame.png rename to Projectiles/Summon/ChaosFlame.png diff --git a/Projectiles/ChaosSpirit.cs b/Projectiles/Summon/ChaosSpirit.cs similarity index 78% rename from Projectiles/ChaosSpirit.cs rename to Projectiles/Summon/ChaosSpirit.cs index d88d617bc9..927d5ce8f6 100644 --- a/Projectiles/ChaosSpirit.cs +++ b/Projectiles/Summon/ChaosSpirit.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Summon { public class ChaosSpirit : ModProjectile { @@ -26,12 +26,12 @@ namespace CalamityMod.Projectiles projectile.netImportant = true; projectile.friendly = true; projectile.ignoreWater = true; - projectile.minionSlots = 0f; + projectile.minion = true; + projectile.minionSlots = 0f; projectile.timeLeft = 18000; projectile.penetrate = -1; projectile.tileCollide = false; projectile.timeLeft *= 5; - projectile.sentry = true; } public override void AI() @@ -58,7 +58,9 @@ namespace CalamityMod.Projectiles dust--; if (dust >= 0) { - int num501 = 50; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue = projectile.damage; + int num501 = 50; for (int num502 = 0; num502 < num501; num502++) { int num503 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 16f), projectile.width, projectile.height - 16, 127, 0f, 0f, 0, default(Color), 1f); @@ -66,7 +68,14 @@ namespace CalamityMod.Projectiles Main.dust[num503].scale *= 1.15f; } } - Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 1f) / 255f, ((255 - projectile.alpha) * 0.35f) / 255f, ((255 - projectile.alpha) * 0f) / 255f); + if (Main.player[projectile.owner].minionDamage != projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) + { + int damage2 = (int)(((float)projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue / + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) * + Main.player[projectile.owner].minionDamage); + projectile.damage = damage2; + } + Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 1f) / 255f, ((255 - projectile.alpha) * 0.35f) / 255f, ((255 - projectile.alpha) * 0f) / 255f); projectile.frameCounter++; if (projectile.frameCounter > 9) { @@ -149,11 +158,20 @@ namespace CalamityMod.Projectiles num406 = num403 / num406; num404 *= num406; num405 *= num406; - Projectile.NewProjectile(projectile.Center.X - 4f, projectile.Center.Y, num404, num405, projectileType, (int)((double)190 * player.minionDamage), 5f, projectile.owner, 0f, 0f); + Projectile.NewProjectile(projectile.Center.X - 4f, projectile.Center.Y, num404, num405, projectileType, projectile.damage, 5f, projectile.owner, 0f, 0f); projectile.ai[0] = 38f; - return; } } } - } + + public override Color? GetAlpha(Color lightColor) + { + return new Color(200, 200, 200, 200); + } + + public override bool CanDamage() + { + return false; + } + } } \ No newline at end of file diff --git a/Projectiles/Summon/ChaosSpirit.png b/Projectiles/Summon/ChaosSpirit.png new file mode 100644 index 0000000000..d074fce66d Binary files /dev/null and b/Projectiles/Summon/ChaosSpirit.png differ diff --git a/Projectiles/CloudyWaifu.cs b/Projectiles/Summon/CloudyWaifu.cs similarity index 87% rename from Projectiles/CloudyWaifu.cs rename to Projectiles/Summon/CloudyWaifu.cs index 9bb3850f8e..fc279f3241 100644 --- a/Projectiles/CloudyWaifu.cs +++ b/Projectiles/Summon/CloudyWaifu.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Summon { public class CloudyWaifu : ModProjectile { @@ -65,7 +65,9 @@ namespace CalamityMod.Projectiles dust--; if (dust >= 0) { - int num501 = 50; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue = projectile.damage; + int num501 = 50; for (int num502 = 0; num502 < num501; num502++) { int num503 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 16f), projectile.width, projectile.height - 16, 16, 0f, 0f, 0, default(Color), 1f); @@ -73,7 +75,14 @@ namespace CalamityMod.Projectiles Main.dust[num503].scale *= 1.15f; } } - if ((double)Math.Abs(projectile.velocity.X) > 0.2) + if (Main.player[projectile.owner].minionDamage != projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) + { + int damage2 = (int)(((float)projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue / + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) * + Main.player[projectile.owner].minionDamage); + projectile.damage = damage2; + } + if ((double)Math.Abs(projectile.velocity.X) > 0.2) { projectile.spriteDirection = -projectile.direction; } diff --git a/Projectiles/CloudyWaifu.png b/Projectiles/Summon/CloudyWaifu.png similarity index 100% rename from Projectiles/CloudyWaifu.png rename to Projectiles/Summon/CloudyWaifu.png diff --git a/Projectiles/CloudyWaifuAttack.png b/Projectiles/Summon/CloudyWaifuAttack.png similarity index 100% rename from Projectiles/CloudyWaifuAttack.png rename to Projectiles/Summon/CloudyWaifuAttack.png diff --git a/Projectiles/Corroslime.cs b/Projectiles/Summon/Corroslime.cs similarity index 77% rename from Projectiles/Corroslime.cs rename to Projectiles/Summon/Corroslime.cs index 4b8781ea40..dfbcf53362 100644 --- a/Projectiles/Corroslime.cs +++ b/Projectiles/Summon/Corroslime.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Summon { public class Corroslime : ModProjectile { @@ -49,7 +49,9 @@ namespace CalamityMod.Projectiles { if (dust == 0f) { - int num226 = 16; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue = projectile.damage; + int num226 = 16; for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; @@ -62,7 +64,14 @@ namespace CalamityMod.Projectiles } dust += 1f; } - bool flag64 = projectile.type == mod.ProjectileType("Corroslime"); + if (Main.player[projectile.owner].minionDamage != projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) + { + int damage2 = (int)(((float)projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue / + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) * + Main.player[projectile.owner].minionDamage); + projectile.damage = damage2; + } + bool flag64 = projectile.type == mod.ProjectileType("Corroslime"); Player player = Main.player[projectile.owner]; CalamityPlayer modPlayer = player.GetModPlayer(mod); player.AddBuff(mod.BuffType("Corroslime"), 3600); diff --git a/Projectiles/Corroslime.png b/Projectiles/Summon/Corroslime.png similarity index 100% rename from Projectiles/Corroslime.png rename to Projectiles/Summon/Corroslime.png diff --git a/Projectiles/CosmicBlast.cs b/Projectiles/Summon/CosmicBlast.cs similarity index 97% rename from Projectiles/CosmicBlast.cs rename to Projectiles/Summon/CosmicBlast.cs index 4687d64ea5..a43e5b30d0 100644 --- a/Projectiles/CosmicBlast.cs +++ b/Projectiles/Summon/CosmicBlast.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Summon { public class CosmicBlast : ModProjectile { diff --git a/Projectiles/CosmicBlast.png b/Projectiles/Summon/CosmicBlast.png similarity index 100% rename from Projectiles/CosmicBlast.png rename to Projectiles/Summon/CosmicBlast.png diff --git a/Projectiles/CosmicBlastBig.cs b/Projectiles/Summon/CosmicBlastBig.cs similarity index 97% rename from Projectiles/CosmicBlastBig.cs rename to Projectiles/Summon/CosmicBlastBig.cs index 71f7435553..45bf67fd41 100644 --- a/Projectiles/CosmicBlastBig.cs +++ b/Projectiles/Summon/CosmicBlastBig.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Summon { public class CosmicBlastBig : ModProjectile { diff --git a/Projectiles/CosmicBlastBig.png b/Projectiles/Summon/CosmicBlastBig.png similarity index 100% rename from Projectiles/CosmicBlastBig.png rename to Projectiles/Summon/CosmicBlastBig.png diff --git a/Projectiles/CosmicEnergy.cs b/Projectiles/Summon/CosmicEnergy.cs similarity index 86% rename from Projectiles/CosmicEnergy.cs rename to Projectiles/Summon/CosmicEnergy.cs index 315f9534fb..3df25b9b02 100644 --- a/Projectiles/CosmicEnergy.cs +++ b/Projectiles/Summon/CosmicEnergy.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Summon { public class CosmicEnergy : ModProjectile { @@ -37,7 +37,20 @@ namespace CalamityMod.Projectiles public override void AI() { Lighting.AddLight((int)projectile.Center.X / 16, (int)projectile.Center.Y / 16, ((float)Main.DiscoR / 255f), ((float)Main.DiscoG / 255f), ((float)Main.DiscoB / 255f)); - bool flag64 = projectile.type == mod.ProjectileType("CosmicEnergy"); + if (projectile.localAI[0] == 0f) + { + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue = projectile.damage; + projectile.localAI[0] += 1f; + } + if (Main.player[projectile.owner].minionDamage != projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) + { + int damage2 = (int)(((float)projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue / + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) * + Main.player[projectile.owner].minionDamage); + projectile.damage = damage2; + } + bool flag64 = projectile.type == mod.ProjectileType("CosmicEnergy"); Player player = Main.player[projectile.owner]; CalamityPlayer modPlayer = player.GetModPlayer(mod); player.AddBuff(mod.BuffType("CosmicEnergy"), 3600); @@ -170,9 +183,6 @@ namespace CalamityMod.Projectiles float num395 = (float)Main.mouseTextColor / 200f - 0.35f; num395 *= 0.2f; projectile.scale = num395 + 0.95f; - bool hasSummonerSet = modPlayer.tarraSummon || modPlayer.bloodflareSummon || modPlayer.godSlayerSummon || modPlayer.silvaSummon; - int damageStatSmall = hasSummonerSet ? 1500 : 1000; - int damageStatBig = hasSummonerSet ? 3000 : 2000; if (justSpawned) { justSpawned = false; @@ -218,7 +228,7 @@ namespace CalamityMod.Projectiles } value15.Normalize(); value15 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, mod.ProjectileType("CosmicBlast"), (int)((double)damageStatSmall * player.minionDamage), 2f, projectile.owner, 0f, 0f); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, mod.ProjectileType("CosmicBlast"), (int)((double)projectile.damage * 0.5), 2f, projectile.owner, 0f, 0f); } float num403 = 15f; Vector2 vector29 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); @@ -228,9 +238,8 @@ namespace CalamityMod.Projectiles num406 = num403 / num406; num404 *= num406; num405 *= num406; - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, num404, num405, mod.ProjectileType("CosmicBlastBig"), (int)((double)damageStatBig * player.minionDamage), 3f, projectile.owner, 0f, 0f); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, num404, num405, mod.ProjectileType("CosmicBlastBig"), projectile.damage, 3f, projectile.owner, 0f, 0f); projectile.ai[0] = 100f; - return; } } } @@ -239,5 +248,10 @@ namespace CalamityMod.Projectiles { return new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB, 255); } - } + + public override bool CanDamage() + { + return false; + } + } } \ No newline at end of file diff --git a/Projectiles/CosmicEnergy.png b/Projectiles/Summon/CosmicEnergy.png similarity index 100% rename from Projectiles/CosmicEnergy.png rename to Projectiles/Summon/CosmicEnergy.png diff --git a/Projectiles/Cosmilamp.cs b/Projectiles/Summon/Cosmilamp.cs similarity index 91% rename from Projectiles/Cosmilamp.cs rename to Projectiles/Summon/Cosmilamp.cs index 1e72d5b225..9a081e10e1 100644 --- a/Projectiles/Cosmilamp.cs +++ b/Projectiles/Summon/Cosmilamp.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Summon { public class Cosmilamp : ModProjectile { @@ -37,7 +37,9 @@ namespace CalamityMod.Projectiles { if (projectile.localAI[0] == 0f) { - int num226 = 36; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue = projectile.damage; + int num226 = 36; for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; @@ -50,7 +52,14 @@ namespace CalamityMod.Projectiles } projectile.localAI[0] += 1f; } - Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0.75f) / 255f, ((255 - projectile.alpha) * 0f) / 255f, ((255 - projectile.alpha) * 0f) / 255f); + if (Main.player[projectile.owner].minionDamage != projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) + { + int damage2 = (int)(((float)projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue / + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) * + Main.player[projectile.owner].minionDamage); + projectile.damage = damage2; + } + Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0.75f) / 255f, ((255 - projectile.alpha) * 0f) / 255f, ((255 - projectile.alpha) * 0f) / 255f); float num395 = (float)Main.mouseTextColor / 200f - 0.35f; num395 *= 0.2f; projectile.scale = num395 + 0.95f; diff --git a/Projectiles/Cosmilamp.png b/Projectiles/Summon/Cosmilamp.png similarity index 100% rename from Projectiles/Cosmilamp.png rename to Projectiles/Summon/Cosmilamp.png diff --git a/Projectiles/Crimslime.cs b/Projectiles/Summon/Crimslime.cs similarity index 77% rename from Projectiles/Crimslime.cs rename to Projectiles/Summon/Crimslime.cs index b1657582c8..0e7aac5d7b 100644 --- a/Projectiles/Crimslime.cs +++ b/Projectiles/Summon/Crimslime.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Summon { public class Crimslime : ModProjectile { @@ -49,7 +49,9 @@ namespace CalamityMod.Projectiles { if (dust == 0f) { - int num226 = 16; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue = projectile.damage; + int num226 = 16; for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; @@ -62,7 +64,14 @@ namespace CalamityMod.Projectiles } dust += 1f; } - bool flag64 = projectile.type == mod.ProjectileType("Crimslime"); + if (Main.player[projectile.owner].minionDamage != projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) + { + int damage2 = (int)(((float)projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue / + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) * + Main.player[projectile.owner].minionDamage); + projectile.damage = damage2; + } + bool flag64 = projectile.type == mod.ProjectileType("Crimslime"); Player player = Main.player[projectile.owner]; CalamityPlayer modPlayer = player.GetModPlayer(mod); player.AddBuff(mod.BuffType("Crimslime"), 3600); diff --git a/Projectiles/Crimslime.png b/Projectiles/Summon/Crimslime.png similarity index 100% rename from Projectiles/Crimslime.png rename to Projectiles/Summon/Crimslime.png diff --git a/Projectiles/DaedalusCrystal.cs b/Projectiles/Summon/DaedalusCrystal.cs similarity index 79% rename from Projectiles/DaedalusCrystal.cs rename to Projectiles/Summon/DaedalusCrystal.cs index f22d83b691..72f4206965 100644 --- a/Projectiles/DaedalusCrystal.cs +++ b/Projectiles/Summon/DaedalusCrystal.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Summon { public class DaedalusCrystal : ModProjectile { @@ -25,12 +25,12 @@ namespace CalamityMod.Projectiles projectile.netImportant = true; projectile.friendly = true; projectile.ignoreWater = true; - projectile.minionSlots = 0f; + projectile.minion = true; + projectile.minionSlots = 0f; projectile.timeLeft = 18000; projectile.penetrate = -1; projectile.tileCollide = false; projectile.timeLeft *= 5; - projectile.sentry = true; } public override void AI() @@ -57,7 +57,9 @@ namespace CalamityMod.Projectiles dust--; if (dust >= 0) { - int num501 = 50; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue = projectile.damage; + int num501 = 50; for (int num502 = 0; num502 < num501; num502++) { int num503 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 16f), projectile.width, projectile.height - 16, 173, 0f, 0f, 0, default(Color), 1f); @@ -65,7 +67,14 @@ namespace CalamityMod.Projectiles Main.dust[num503].scale *= 1.15f; } } - Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0.35f) / 255f, ((255 - projectile.alpha) * 0f) / 255f, ((255 - projectile.alpha) * 0.75f) / 255f); + if (Main.player[projectile.owner].minionDamage != projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) + { + int damage2 = (int)(((float)projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue / + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) * + Main.player[projectile.owner].minionDamage); + projectile.damage = damage2; + } + Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0.35f) / 255f, ((255 - projectile.alpha) * 0f) / 255f, ((255 - projectile.alpha) * 0.75f) / 255f); projectile.position.X = Main.player[projectile.owner].Center.X - (float)(projectile.width / 2); projectile.position.Y = Main.player[projectile.owner].Center.Y - (float)(projectile.height / 2) + Main.player[projectile.owner].gfxOffY - 60f; if (Main.player[projectile.owner].gravDir == -1f) @@ -141,9 +150,8 @@ namespace CalamityMod.Projectiles num406 = num403 / num406; num404 *= num406; num405 *= num406; - Projectile.NewProjectile(projectile.Center.X - 4f, projectile.Center.Y, num404, num405, projectileType, (int)((double)95 * player.minionDamage), 5f, projectile.owner, 0f, 0f); + Projectile.NewProjectile(projectile.Center.X - 4f, projectile.Center.Y, num404, num405, projectileType, projectile.damage, 5f, projectile.owner, 0f, 0f); projectile.ai[0] = 50f; - return; } } } @@ -152,5 +160,10 @@ namespace CalamityMod.Projectiles { return new Color(200, 200, 200, 200); } - } + + public override bool CanDamage() + { + return false; + } + } } \ No newline at end of file diff --git a/Projectiles/DaedalusCrystal.png b/Projectiles/Summon/DaedalusCrystal.png similarity index 100% rename from Projectiles/DaedalusCrystal.png rename to Projectiles/Summon/DaedalusCrystal.png diff --git a/Projectiles/DaedalusCrystalShot.cs b/Projectiles/Summon/DaedalusCrystalShot.cs similarity index 95% rename from Projectiles/DaedalusCrystalShot.cs rename to Projectiles/Summon/DaedalusCrystalShot.cs index 0189618f7e..31efdbce27 100644 --- a/Projectiles/DaedalusCrystalShot.cs +++ b/Projectiles/Summon/DaedalusCrystalShot.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Summon { public class DaedalusCrystalShot : ModProjectile { diff --git a/Projectiles/DaedalusCrystalShot.png b/Projectiles/Summon/DaedalusCrystalShot.png similarity index 100% rename from Projectiles/DaedalusCrystalShot.png rename to Projectiles/Summon/DaedalusCrystalShot.png diff --git a/Projectiles/DankCreeper.cs b/Projectiles/Summon/DankCreeper.cs similarity index 91% rename from Projectiles/DankCreeper.cs rename to Projectiles/Summon/DankCreeper.cs index df7d53bd8e..327405ac6f 100644 --- a/Projectiles/DankCreeper.cs +++ b/Projectiles/Summon/DankCreeper.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Summon { public class DankCreeper : ModProjectile { @@ -40,7 +40,9 @@ namespace CalamityMod.Projectiles { if (projectile.localAI[0] == 0f) { - int num226 = 36; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue = projectile.damage; + int num226 = 36; for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; @@ -53,7 +55,14 @@ namespace CalamityMod.Projectiles } projectile.localAI[0] += 1f; } - bool flag64 = projectile.type == mod.ProjectileType("DankCreeper"); + if (Main.player[projectile.owner].minionDamage != projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) + { + int damage2 = (int)(((float)projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue / + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) * + Main.player[projectile.owner].minionDamage); + projectile.damage = damage2; + } + bool flag64 = projectile.type == mod.ProjectileType("DankCreeper"); Player player = Main.player[projectile.owner]; CalamityPlayer modPlayer = player.GetModPlayer(mod); player.AddBuff(mod.BuffType("DankCreeper"), 3600); diff --git a/Projectiles/DankCreeper.png b/Projectiles/Summon/DankCreeper.png similarity index 100% rename from Projectiles/DankCreeper.png rename to Projectiles/Summon/DankCreeper.png diff --git a/Projectiles/Dreadmine.cs b/Projectiles/Summon/Dreadmine.cs similarity index 96% rename from Projectiles/Dreadmine.cs rename to Projectiles/Summon/Dreadmine.cs index 7b3ce6dc76..b47a976c2d 100644 --- a/Projectiles/Dreadmine.cs +++ b/Projectiles/Summon/Dreadmine.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Summon { public class Dreadmine : ModProjectile { diff --git a/Projectiles/Dreadmine.png b/Projectiles/Summon/Dreadmine.png similarity index 100% rename from Projectiles/Dreadmine.png rename to Projectiles/Summon/Dreadmine.png diff --git a/Projectiles/DreadmineTurret.cs b/Projectiles/Summon/DreadmineTurret.cs similarity index 82% rename from Projectiles/DreadmineTurret.cs rename to Projectiles/Summon/DreadmineTurret.cs index bbe67ab959..762b288c3d 100644 --- a/Projectiles/DreadmineTurret.cs +++ b/Projectiles/Summon/DreadmineTurret.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Summon { public class DreadmineTurret : ModProjectile { @@ -30,7 +30,20 @@ namespace CalamityMod.Projectiles public override void AI() { - projectile.frameCounter++; + if (projectile.localAI[0] == 0f) + { + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue = projectile.damage; + projectile.localAI[0] += 1f; + } + if (Main.player[projectile.owner].minionDamage != projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) + { + int damage2 = (int)(((float)projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue / + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) * + Main.player[projectile.owner].minionDamage); + projectile.damage = damage2; + } + projectile.frameCounter++; if (projectile.frameCounter > 6) { projectile.frame++; @@ -107,7 +120,6 @@ namespace CalamityMod.Projectiles if (flag && Main.myPlayer == projectile.owner) { Projectile.NewProjectile(center.X, center.Y, 0f, 0f, mod.ProjectileType("Dreadmine"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); - return; } } } @@ -116,5 +128,10 @@ namespace CalamityMod.Projectiles } } } - } + + public override bool CanDamage() + { + return false; + } + } } \ No newline at end of file diff --git a/Projectiles/DreadmineTurret.png b/Projectiles/Summon/DreadmineTurret.png similarity index 100% rename from Projectiles/DreadmineTurret.png rename to Projectiles/Summon/DreadmineTurret.png diff --git a/Projectiles/DrewsSandyWaifu.cs b/Projectiles/Summon/DrewsSandyWaifu.cs similarity index 88% rename from Projectiles/DrewsSandyWaifu.cs rename to Projectiles/Summon/DrewsSandyWaifu.cs index 63aa1aaa21..b4840b7932 100644 --- a/Projectiles/DrewsSandyWaifu.cs +++ b/Projectiles/Summon/DrewsSandyWaifu.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Summon { public class DrewsSandyWaifu : ModProjectile { @@ -66,7 +66,9 @@ namespace CalamityMod.Projectiles dust--; if (dust >= 0) { - int num501 = 50; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue = projectile.damage; + int num501 = 50; for (int num502 = 0; num502 < num501; num502++) { int num503 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 16f), projectile.width, projectile.height - 16, 32, 0f, 0f, 0, default(Color), 1f); @@ -74,7 +76,14 @@ namespace CalamityMod.Projectiles Main.dust[num503].scale *= 1.15f; } } - projectile.frameCounter++; + if (Main.player[projectile.owner].minionDamage != projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) + { + int damage2 = (int)(((float)projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue / + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) * + Main.player[projectile.owner].minionDamage); + projectile.damage = damage2; + } + projectile.frameCounter++; if (projectile.frameCounter > 16) { projectile.frame++; diff --git a/Projectiles/DrewsSandyWaifu.png b/Projectiles/Summon/DrewsSandyWaifu.png similarity index 100% rename from Projectiles/DrewsSandyWaifu.png rename to Projectiles/Summon/DrewsSandyWaifu.png diff --git a/Projectiles/ElementalAxe.cs b/Projectiles/Summon/ElementalAxe.cs similarity index 85% rename from Projectiles/ElementalAxe.cs rename to Projectiles/Summon/ElementalAxe.cs index 4f27d6d807..e6b366074f 100644 --- a/Projectiles/ElementalAxe.cs +++ b/Projectiles/Summon/ElementalAxe.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Summon { public class ElementalAxe : ModProjectile { @@ -35,7 +35,20 @@ namespace CalamityMod.Projectiles public override void AI() { - bool flag64 = (projectile.type == mod.ProjectileType("ElementalAxe")); + if (projectile.localAI[0] == 0f) + { + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue = projectile.damage; + projectile.localAI[0] += 1f; + } + if (Main.player[projectile.owner].minionDamage != projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) + { + int damage2 = (int)(((float)projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue / + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) * + Main.player[projectile.owner].minionDamage); + projectile.damage = damage2; + } + bool flag64 = (projectile.type == mod.ProjectileType("ElementalAxe")); Player player = Main.player[projectile.owner]; CalamityPlayer modPlayer = player.GetModPlayer(mod); if (flag64) diff --git a/Projectiles/ElementalAxe.png b/Projectiles/Summon/ElementalAxe.png similarity index 100% rename from Projectiles/ElementalAxe.png rename to Projectiles/Summon/ElementalAxe.png diff --git a/Projectiles/FlameBlast.cs b/Projectiles/Summon/FlameBlast.cs similarity index 96% rename from Projectiles/FlameBlast.cs rename to Projectiles/Summon/FlameBlast.cs index c9c4914ca4..524d668599 100644 --- a/Projectiles/FlameBlast.cs +++ b/Projectiles/Summon/FlameBlast.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Summon { public class FlameBlast : ModProjectile { diff --git a/Projectiles/FlameBlast.png b/Projectiles/Summon/FlameBlast.png similarity index 100% rename from Projectiles/FlameBlast.png rename to Projectiles/Summon/FlameBlast.png diff --git a/Projectiles/FlameBurst.cs b/Projectiles/Summon/FlameBurst.cs similarity index 96% rename from Projectiles/FlameBurst.cs rename to Projectiles/Summon/FlameBurst.cs index 581fabb269..7e1414bc68 100644 --- a/Projectiles/FlameBurst.cs +++ b/Projectiles/Summon/FlameBurst.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Summon { public class FlameBurst : ModProjectile { diff --git a/Projectiles/FlameBurst.png b/Projectiles/Summon/FlameBurst.png similarity index 100% rename from Projectiles/FlameBurst.png rename to Projectiles/Summon/FlameBurst.png diff --git a/Projectiles/FrostMistFriendly.cs b/Projectiles/Summon/FrostMistFriendly.cs similarity index 55% rename from Projectiles/FrostMistFriendly.cs rename to Projectiles/Summon/FrostMistFriendly.cs index 1cce5038c0..ee6ad2ea41 100644 --- a/Projectiles/FrostMistFriendly.cs +++ b/Projectiles/Summon/FrostMistFriendly.cs @@ -6,44 +6,44 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Summon { - public class FrostMistFriendly : ModProjectile - { - public override void SetStaticDefaults() + public class FrostMistFriendly : ModProjectile + { + public override void SetStaticDefaults() { DisplayName.SetDefault("Mist"); Main.projFrames[projectile.type] = 6; } - - public override void SetDefaults() - { - projectile.width = 20; - projectile.height = 20; - projectile.friendly = true; - projectile.ignoreWater = true; - projectile.minion = true; - projectile.minionSlots = 0f; - projectile.penetrate = 1; - projectile.timeLeft = 300; - projectile.alpha = 255; - } - public override void AI() - { - projectile.frameCounter++; + public override void SetDefaults() + { + projectile.width = 20; + projectile.height = 20; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.minion = true; + projectile.minionSlots = 0f; + projectile.penetrate = 1; + projectile.timeLeft = 300; + projectile.alpha = 255; + } + + public override void AI() + { + projectile.frameCounter++; if (projectile.frameCounter > 4) { - projectile.frame++; - projectile.frameCounter = 0; + projectile.frame++; + projectile.frameCounter = 0; } if (projectile.frame > 3) { - projectile.frame = 0; + projectile.frame = 0; } - if (projectile.ai[1] == 0f) - { - for (int num621 = 0; num621 < 5; num621++) + if (projectile.ai[1] == 0f) + { + for (int num621 = 0; num621 < 5; num621++) { int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 187, 0f, 0f, 100, default(Color), 2f); Main.dust[num622].velocity *= 3f; @@ -53,10 +53,10 @@ namespace CalamityMod.Projectiles Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; } } - projectile.ai[1] = 1f; - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 30); - } - if (projectile.localAI[0] == 0f) + projectile.ai[1] = 1f; + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 30); + } + if (projectile.localAI[0] == 0f) { projectile.scale -= 0.02f; projectile.alpha += 30; @@ -76,7 +76,7 @@ namespace CalamityMod.Projectiles projectile.localAI[0] = 0f; } } - int num103 = (int)Player.FindClosest(projectile.Center, 1, 1); + int num103 = (int)Player.FindClosest(projectile.Center, 1, 1); projectile.ai[1] += 1f; if (projectile.ai[1] < 110f && projectile.ai[1] > 30f) { @@ -96,24 +96,21 @@ namespace CalamityMod.Projectiles } } projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; - Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0f) / 255f, ((255 - projectile.alpha) * 0.35f) / 255f, ((255 - projectile.alpha) * 0.35f) / 255f); - } - - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - Texture2D texture2D13 = Main.projectileTexture[projectile.type]; + Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0f) / 255f, ((255 - projectile.alpha) * 0.35f) / 255f, ((255 - projectile.alpha) * 0.35f) / 255f); + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D texture2D13 = Main.projectileTexture[projectile.type]; int num214 = Main.projectileTexture[projectile.type].Height / Main.projFrames[projectile.type]; int y6 = num214 * projectile.frame; Main.spriteBatch.Draw(texture2D13, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y6, texture2D13.Width, num214)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)num214 / 2f), projectile.scale, SpriteEffects.None, 0f); return false; - } + } - public override void Kill(int timeLeft) - { - for (int k = 0; k < 3; k++) - { - Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 187, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); - } - } - } + public override Color? GetAlpha(Color lightColor) + { + return new Color(200, 200, 200, projectile.alpha); + } + } } \ No newline at end of file diff --git a/Projectiles/FrostMistFriendly.png b/Projectiles/Summon/FrostMistFriendly.png similarity index 100% rename from Projectiles/FrostMistFriendly.png rename to Projectiles/Summon/FrostMistFriendly.png diff --git a/Projectiles/FungalClump.cs b/Projectiles/Summon/FungalClump.cs similarity index 76% rename from Projectiles/FungalClump.cs rename to Projectiles/Summon/FungalClump.cs index 7c1e389116..3e01f517b0 100644 --- a/Projectiles/FungalClump.cs +++ b/Projectiles/Summon/FungalClump.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Summon { public class FungalClump : ModProjectile { @@ -57,7 +57,9 @@ namespace CalamityMod.Projectiles } if (projectile.localAI[0] == 0f) { - int num226 = 36; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue = projectile.damage; + int num226 = 36; for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; @@ -70,7 +72,14 @@ namespace CalamityMod.Projectiles } projectile.localAI[0] += 1f; } - if (Main.rand.Next(16) == 0) + if (Main.player[projectile.owner].minionDamage != projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) + { + int damage2 = (int)(((float)projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue / + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) * + Main.player[projectile.owner].minionDamage); + projectile.damage = damage2; + } + if (Main.rand.Next(16) == 0) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 56, projectile.velocity.X * 0.05f, projectile.velocity.Y * 0.05f); } diff --git a/Projectiles/FungalClump.png b/Projectiles/Summon/FungalClump.png similarity index 100% rename from Projectiles/FungalClump.png rename to Projectiles/Summon/FungalClump.png diff --git a/Projectiles/GhostFire.cs b/Projectiles/Summon/GhostFire.cs similarity index 93% rename from Projectiles/GhostFire.cs rename to Projectiles/Summon/GhostFire.cs index b293599a19..c7225adb13 100644 --- a/Projectiles/GhostFire.cs +++ b/Projectiles/Summon/GhostFire.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Summon { public class GhostFire : ModProjectile { diff --git a/Projectiles/GhostFire.png b/Projectiles/Summon/GhostFire.png similarity index 100% rename from Projectiles/GhostFire.png rename to Projectiles/Summon/GhostFire.png diff --git a/Projectiles/GhostlyMine.cs b/Projectiles/Summon/GhostlyMine.cs similarity index 83% rename from Projectiles/GhostlyMine.cs rename to Projectiles/Summon/GhostlyMine.cs index cfb7ee4afc..a87ef2b863 100644 --- a/Projectiles/GhostlyMine.cs +++ b/Projectiles/Summon/GhostlyMine.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Summon { public class GhostlyMine : ModProjectile { @@ -34,10 +34,19 @@ namespace CalamityMod.Projectiles { if (start) { - Main.PlaySound(SoundID.Item20, projectile.position); + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue = projectile.damage; + Main.PlaySound(SoundID.Item20, projectile.position); projectile.ai[1] = projectile.ai[0]; start = false; } + if (Main.player[projectile.owner].minionDamage != projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) + { + int damage2 = (int)(((float)projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue / + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) * + Main.player[projectile.owner].minionDamage); + projectile.damage = damage2; + } Vector2 direction = Main.player[projectile.owner].Center - projectile.Center; direction.Normalize(); direction *= 9f; diff --git a/Projectiles/GhostlyMine.png b/Projectiles/Summon/GhostlyMine.png similarity index 100% rename from Projectiles/GhostlyMine.png rename to Projectiles/Summon/GhostlyMine.png diff --git a/Projectiles/GigaFlareFriendly.cs b/Projectiles/Summon/GigaFlareFriendly.cs similarity index 97% rename from Projectiles/GigaFlareFriendly.cs rename to Projectiles/Summon/GigaFlareFriendly.cs index 9ecc3360d8..d3d7ebe287 100644 --- a/Projectiles/GigaFlareFriendly.cs +++ b/Projectiles/Summon/GigaFlareFriendly.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Summon { public class GigaFlareFriendly : ModProjectile { diff --git a/Projectiles/GigaFlareFriendly.png b/Projectiles/Summon/GigaFlareFriendly.png similarity index 100% rename from Projectiles/GigaFlareFriendly.png rename to Projectiles/Summon/GigaFlareFriendly.png diff --git a/Projectiles/Herring.cs b/Projectiles/Summon/Herring.cs similarity index 86% rename from Projectiles/Herring.cs rename to Projectiles/Summon/Herring.cs index 35c05f2004..b2df7584bb 100644 --- a/Projectiles/Herring.cs +++ b/Projectiles/Summon/Herring.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Summon { public class Herring : ModProjectile { @@ -38,7 +38,9 @@ namespace CalamityMod.Projectiles { if (dust > 0) { - int num226 = 36; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue = projectile.damage; + int num226 = 36; for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; @@ -50,7 +52,14 @@ namespace CalamityMod.Projectiles } dust--; } - if ((double)Math.Abs(projectile.velocity.X) > 0.2) + if (Main.player[projectile.owner].minionDamage != projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) + { + int damage2 = (int)(((float)projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue / + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) * + Main.player[projectile.owner].minionDamage); + projectile.damage = damage2; + } + if ((double)Math.Abs(projectile.velocity.X) > 0.2) { projectile.spriteDirection = projectile.direction; } diff --git a/Projectiles/Herring.png b/Projectiles/Summon/Herring.png similarity index 100% rename from Projectiles/Herring.png rename to Projectiles/Summon/Herring.png diff --git a/Projectiles/IceClasper.cs b/Projectiles/Summon/IceClasper.cs similarity index 87% rename from Projectiles/IceClasper.cs rename to Projectiles/Summon/IceClasper.cs index 547ca481e4..192a409419 100644 --- a/Projectiles/IceClasper.cs +++ b/Projectiles/Summon/IceClasper.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Summon { public class IceClasper : ModProjectile { @@ -38,7 +38,9 @@ namespace CalamityMod.Projectiles { if (dust > 0) { - int num226 = 36; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue = projectile.damage; + int num226 = 36; for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; @@ -50,7 +52,14 @@ namespace CalamityMod.Projectiles } dust--; } - projectile.frameCounter++; + if (Main.player[projectile.owner].minionDamage != projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) + { + int damage2 = (int)(((float)projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue / + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) * + Main.player[projectile.owner].minionDamage); + projectile.damage = damage2; + } + projectile.frameCounter++; if (projectile.frameCounter > 6) { projectile.frame++; diff --git a/Projectiles/IceClasper.png b/Projectiles/Summon/IceClasper.png similarity index 100% rename from Projectiles/IceClasper.png rename to Projectiles/Summon/IceClasper.png diff --git a/Projectiles/MechwormBody.cs b/Projectiles/Summon/MechwormBody.cs similarity index 95% rename from Projectiles/MechwormBody.cs rename to Projectiles/Summon/MechwormBody.cs index 32c3944d12..5c14584903 100644 --- a/Projectiles/MechwormBody.cs +++ b/Projectiles/Summon/MechwormBody.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Summon { public class MechwormBody : ModProjectile { diff --git a/Projectiles/Summon/MechwormBody.png b/Projectiles/Summon/MechwormBody.png new file mode 100644 index 0000000000..dc5d42e257 Binary files /dev/null and b/Projectiles/Summon/MechwormBody.png differ diff --git a/Projectiles/MechwormBody2.cs b/Projectiles/Summon/MechwormBody2.cs similarity index 95% rename from Projectiles/MechwormBody2.cs rename to Projectiles/Summon/MechwormBody2.cs index 14949c92e2..29a700aa4b 100644 --- a/Projectiles/MechwormBody2.cs +++ b/Projectiles/Summon/MechwormBody2.cs @@ -10,7 +10,7 @@ using Terraria.ObjectData; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Summon { public class MechwormBody2 : ModProjectile { diff --git a/Projectiles/Summon/MechwormBody2.png b/Projectiles/Summon/MechwormBody2.png new file mode 100644 index 0000000000..dc5d42e257 Binary files /dev/null and b/Projectiles/Summon/MechwormBody2.png differ diff --git a/Projectiles/MechwormHead.cs b/Projectiles/Summon/MechwormHead.cs similarity index 90% rename from Projectiles/MechwormHead.cs rename to Projectiles/Summon/MechwormHead.cs index 4981c84387..6749760d1b 100644 --- a/Projectiles/MechwormHead.cs +++ b/Projectiles/Summon/MechwormHead.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Summon { public class MechwormHead : ModProjectile { @@ -38,9 +38,9 @@ namespace CalamityMod.Projectiles public override void AI() { - if (dust > 0) + if (dust > 0) { - int num501 = 50; + int num501 = 50; for (int num502 = 0; num502 < num501; num502++) { int num503 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 16f), projectile.width, projectile.height - 16, 234, 0f, 0f, 0, default(Color), 1f); @@ -180,7 +180,6 @@ namespace CalamityMod.Projectiles if (projectile.alpha < 0) { projectile.alpha = 0; - return; } } } @@ -191,5 +190,11 @@ namespace CalamityMod.Projectiles spriteBatch.Draw(tex, projectile.Center - Main.screenPosition, null, projectile.GetAlpha(lightColor), projectile.rotation, tex.Size() / 2f, projectile.scale, SpriteEffects.None, 0f); return false; } + + public override void PostDraw(SpriteBatch spriteBatch, Color lightColor) + { + Vector2 origin = new Vector2(21f, 25f); + spriteBatch.Draw(mod.GetTexture("Projectiles/Summon/MechwormHeadGlow"), projectile.Center - Main.screenPosition, null, Color.White, projectile.rotation, origin, 1f, SpriteEffects.None, 0f); + } } } diff --git a/Projectiles/Summon/MechwormHead.png b/Projectiles/Summon/MechwormHead.png new file mode 100644 index 0000000000..ff75841dec Binary files /dev/null and b/Projectiles/Summon/MechwormHead.png differ diff --git a/Projectiles/Summon/MechwormHeadGlow.png b/Projectiles/Summon/MechwormHeadGlow.png new file mode 100644 index 0000000000..5c3251c4ec Binary files /dev/null and b/Projectiles/Summon/MechwormHeadGlow.png differ diff --git a/Projectiles/MechwormTail.cs b/Projectiles/Summon/MechwormTail.cs similarity index 95% rename from Projectiles/MechwormTail.cs rename to Projectiles/Summon/MechwormTail.cs index 728717be89..d4b8a36343 100644 --- a/Projectiles/MechwormTail.cs +++ b/Projectiles/Summon/MechwormTail.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Summon { public class MechwormTail : ModProjectile { diff --git a/Projectiles/Summon/MechwormTail.png b/Projectiles/Summon/MechwormTail.png new file mode 100644 index 0000000000..4831fd658e Binary files /dev/null and b/Projectiles/Summon/MechwormTail.png differ diff --git a/Projectiles/MiniSandShark.cs b/Projectiles/Summon/MiniSandShark.cs similarity index 96% rename from Projectiles/MiniSandShark.cs rename to Projectiles/Summon/MiniSandShark.cs index db3cdbaebd..06af711820 100644 --- a/Projectiles/MiniSandShark.cs +++ b/Projectiles/Summon/MiniSandShark.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Summon { public class MiniSandShark : ModProjectile { diff --git a/Projectiles/MiniSandShark.png b/Projectiles/Summon/MiniSandShark.png similarity index 100% rename from Projectiles/MiniSandShark.png rename to Projectiles/Summon/MiniSandShark.png diff --git a/Projectiles/PhantomGuy.cs b/Projectiles/Summon/PhantomGuy.cs similarity index 85% rename from Projectiles/PhantomGuy.cs rename to Projectiles/Summon/PhantomGuy.cs index 08305050b5..2dddf7510c 100644 --- a/Projectiles/PhantomGuy.cs +++ b/Projectiles/Summon/PhantomGuy.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Summon { public class PhantomGuy : ModProjectile { @@ -36,7 +36,9 @@ namespace CalamityMod.Projectiles { if (projectile.localAI[0] == 0f) { - int num226 = 36; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue = projectile.damage; + int num226 = 36; for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; @@ -48,7 +50,14 @@ namespace CalamityMod.Projectiles } projectile.localAI[0] += 1f; } - float num633 = 700f; + if (Main.player[projectile.owner].minionDamage != projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) + { + int damage2 = (int)(((float)projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue / + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) * + Main.player[projectile.owner].minionDamage); + projectile.damage = damage2; + } + float num633 = 700f; float num634 = 1300f; float num635 = 2600f; float num636 = 600f; @@ -218,5 +227,10 @@ namespace CalamityMod.Projectiles { return new Color(100, 250, 250, projectile.alpha); } - } + + public override bool CanDamage() + { + return false; + } + } } \ No newline at end of file diff --git a/Projectiles/PhantomGuy.png b/Projectiles/Summon/PhantomGuy.png similarity index 100% rename from Projectiles/PhantomGuy.png rename to Projectiles/Summon/PhantomGuy.png diff --git a/Projectiles/PhoenixFireFriendly.cs b/Projectiles/Summon/PhoenixFireFriendly.cs similarity index 95% rename from Projectiles/PhoenixFireFriendly.cs rename to Projectiles/Summon/PhoenixFireFriendly.cs index 0d1bb95cc7..f57c9fffed 100644 --- a/Projectiles/PhoenixFireFriendly.cs +++ b/Projectiles/Summon/PhoenixFireFriendly.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Summon { public class PhoenixFireFriendly : ModProjectile { diff --git a/Projectiles/PhoenixFireFriendly.png b/Projectiles/Summon/PhoenixFireFriendly.png similarity index 100% rename from Projectiles/PhoenixFireFriendly.png rename to Projectiles/Summon/PhoenixFireFriendly.png diff --git a/Projectiles/ProfanedEnergy.cs b/Projectiles/Summon/ProfanedEnergy.cs similarity index 80% rename from Projectiles/ProfanedEnergy.cs rename to Projectiles/Summon/ProfanedEnergy.cs index cda21cbb14..facede2fc8 100644 --- a/Projectiles/ProfanedEnergy.cs +++ b/Projectiles/Summon/ProfanedEnergy.cs @@ -5,11 +5,11 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Summon { public class ProfanedEnergy : ModProjectile { - public float count = 0; + public float count = 0f; public override void SetStaticDefaults() { @@ -42,7 +42,9 @@ namespace CalamityMod.Projectiles } if (count == 0f) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue = projectile.damage; + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); for (int num621 = 0; num621 < 5; num621++) { int num622 = Dust.NewDust(new Vector2(projectile.Center.X, projectile.Center.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 2f); @@ -63,7 +65,14 @@ namespace CalamityMod.Projectiles } count += 1f; } - if (projectile.owner == Main.myPlayer) + if (Main.player[projectile.owner].minionDamage != projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) + { + int damage2 = (int)(((float)projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue / + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) * + Main.player[projectile.owner].minionDamage); + projectile.damage = damage2; + } + if (projectile.owner == Main.myPlayer) { if (projectile.ai[0] != 0f) { @@ -138,11 +147,15 @@ namespace CalamityMod.Projectiles num406 = num403 / num406; num404 *= num406; num405 *= num406; - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, num404, num405, projectileType, 170, projectile.knockBack, projectile.owner, 0f, 0f); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, num404, num405, projectileType, projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); projectile.ai[0] = 8f; - return; } } } - } + + public override bool CanDamage() + { + return false; + } + } } \ No newline at end of file diff --git a/Projectiles/ProfanedEnergy.png b/Projectiles/Summon/ProfanedEnergy.png similarity index 100% rename from Projectiles/ProfanedEnergy.png rename to Projectiles/Summon/ProfanedEnergy.png diff --git a/Projectiles/ReaverOrb.cs b/Projectiles/Summon/ReaverOrb.cs similarity index 79% rename from Projectiles/ReaverOrb.cs rename to Projectiles/Summon/ReaverOrb.cs index 733a686376..584c65d89d 100644 --- a/Projectiles/ReaverOrb.cs +++ b/Projectiles/Summon/ReaverOrb.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Summon { public class ReaverOrb : ModProjectile { @@ -25,13 +25,13 @@ namespace CalamityMod.Projectiles projectile.netImportant = true; projectile.friendly = true; projectile.ignoreWater = true; - projectile.minionSlots = 0f; + projectile.minion = true; + projectile.minionSlots = 0f; projectile.timeLeft = 18000; projectile.alpha = 50; projectile.penetrate = -1; projectile.tileCollide = false; projectile.timeLeft *= 5; - projectile.sentry = true; } public override void AI() @@ -58,7 +58,9 @@ namespace CalamityMod.Projectiles dust--; if (dust >= 0) { - int num501 = 50; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue = projectile.damage; + int num501 = 50; for (int num502 = 0; num502 < num501; num502++) { int num503 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 16f), projectile.width, projectile.height - 16, 157, 0f, 0f, 0, default(Color), 1f); @@ -66,7 +68,14 @@ namespace CalamityMod.Projectiles Main.dust[num503].scale *= 1.15f; } } - Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0f) / 255f, ((255 - projectile.alpha) * 1f) / 255f, ((255 - projectile.alpha) * 0f) / 255f); + if (Main.player[projectile.owner].minionDamage != projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) + { + int damage2 = (int)(((float)projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue / + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) * + Main.player[projectile.owner].minionDamage); + projectile.damage = damage2; + } + Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0f) / 255f, ((255 - projectile.alpha) * 1f) / 255f, ((255 - projectile.alpha) * 0f) / 255f); projectile.position.X = Main.player[projectile.owner].Center.X - (float)(projectile.width / 2); projectile.position.Y = Main.player[projectile.owner].Center.Y - (float)(projectile.height / 2) + Main.player[projectile.owner].gfxOffY - 60f; if (Main.player[projectile.owner].gravDir == -1f) @@ -136,15 +145,19 @@ namespace CalamityMod.Projectiles } value15.Normalize(); value15 *= (float)Main.rand.Next(90, 121) * 0.1f; - int spore = Projectile.NewProjectile(projectile.Center.X - 4f, projectile.Center.Y, value15.X, value15.Y, 569 + Main.rand.Next(3), (int)(80f * player.minionDamage), 1.5f, projectile.owner, 0f, 0f); + int spore = Projectile.NewProjectile(projectile.Center.X - 4f, projectile.Center.Y, value15.X, value15.Y, 569 + Main.rand.Next(3), projectile.damage, 1.5f, projectile.owner, 0f, 0f); Main.projectile[spore].minion = true; Main.projectile[spore].minionSlots = 0f; } Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 77); projectile.ai[0] = 50f; - return; } } } - } + + public override bool CanDamage() + { + return false; + } + } } \ No newline at end of file diff --git a/Projectiles/ReaverOrb.png b/Projectiles/Summon/ReaverOrb.png similarity index 100% rename from Projectiles/ReaverOrb.png rename to Projectiles/Summon/ReaverOrb.png diff --git a/Projectiles/RedDevil.cs b/Projectiles/Summon/RedDevil.cs similarity index 93% rename from Projectiles/RedDevil.cs rename to Projectiles/Summon/RedDevil.cs index a8114accb0..db6609bf3a 100644 --- a/Projectiles/RedDevil.cs +++ b/Projectiles/Summon/RedDevil.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Summon { public class RedDevil : ModProjectile { @@ -18,7 +18,6 @@ namespace CalamityMod.Projectiles Main.projFrames[projectile.type] = 5; Main.projPet[projectile.type] = true; ProjectileID.Sets.MinionSacrificable[projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true; } public override void SetDefaults() @@ -28,12 +27,10 @@ namespace CalamityMod.Projectiles projectile.netImportant = true; projectile.friendly = true; projectile.ignoreWater = true; - projectile.minionSlots = 0f; projectile.timeLeft = 18000; projectile.penetrate = -1; projectile.tileCollide = false; projectile.timeLeft *= 5; - projectile.minion = true; } public override void AI() @@ -252,12 +249,17 @@ namespace CalamityMod.Projectiles Vector2 value19 = vector46 - projectile.Center; value19.Normalize(); value19 *= scaleFactor3; - int num659 = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value19.X, value19.Y, num658, 10000, 0f, Main.myPlayer, 0f, 0f); + int num659 = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value19.X, value19.Y, num658, projectile.damage, 0f, Main.myPlayer, 0f, 0f); Main.projectile[num659].timeLeft = 300; projectile.netUpdate = true; } } } } - } + + public override bool CanDamage() + { + return false; + } + } } \ No newline at end of file diff --git a/Projectiles/RedDevil.png b/Projectiles/Summon/RedDevil.png similarity index 100% rename from Projectiles/RedDevil.png rename to Projectiles/Summon/RedDevil.png diff --git a/Projectiles/SandBolt.cs b/Projectiles/Summon/SandBolt.cs similarity index 93% rename from Projectiles/SandBolt.cs rename to Projectiles/Summon/SandBolt.cs index 1f105b1ced..52cb9180ef 100644 --- a/Projectiles/SandBolt.cs +++ b/Projectiles/Summon/SandBolt.cs @@ -4,7 +4,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Summon { public class SandBolt : ModProjectile { diff --git a/Projectiles/SandBolt.png b/Projectiles/Summon/SandBolt.png similarity index 100% rename from Projectiles/SandBolt.png rename to Projectiles/Summon/SandBolt.png diff --git a/Projectiles/SandMark.cs b/Projectiles/Summon/SandMark.cs similarity index 96% rename from Projectiles/SandMark.cs rename to Projectiles/Summon/SandMark.cs index 54023d0f34..49f9fb04fd 100644 --- a/Projectiles/SandMark.cs +++ b/Projectiles/Summon/SandMark.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Summon { public class SandMark : ModProjectile { diff --git a/Projectiles/SandMark.png b/Projectiles/Summon/SandMark.png similarity index 100% rename from Projectiles/SandMark.png rename to Projectiles/Summon/SandMark.png diff --git a/Projectiles/SandTornado.cs b/Projectiles/Summon/SandTornado.cs similarity index 96% rename from Projectiles/SandTornado.cs rename to Projectiles/Summon/SandTornado.cs index 8c048f17b3..22fc225b09 100644 --- a/Projectiles/SandTornado.cs +++ b/Projectiles/Summon/SandTornado.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Summon { public class SandTornado : ModProjectile { diff --git a/Projectiles/SandTornado.png b/Projectiles/Summon/SandTornado.png similarity index 100% rename from Projectiles/SandTornado.png rename to Projectiles/Summon/SandTornado.png diff --git a/Projectiles/Sandnado.cs b/Projectiles/Summon/Sandnado.cs similarity index 91% rename from Projectiles/Sandnado.cs rename to Projectiles/Summon/Sandnado.cs index 92ac640bd3..a824b030dc 100644 --- a/Projectiles/Sandnado.cs +++ b/Projectiles/Summon/Sandnado.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Summon { public class Sandnado : ModProjectile { @@ -39,7 +39,9 @@ namespace CalamityMod.Projectiles { if (projectile.localAI[1] == 0f) { - int num226 = 36; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue = projectile.damage; + int num226 = 36; for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; @@ -52,7 +54,14 @@ namespace CalamityMod.Projectiles } projectile.localAI[1] += 1f; } - bool flag64 = projectile.type == mod.ProjectileType("Sandnado"); + if (Main.player[projectile.owner].minionDamage != projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) + { + int damage2 = (int)(((float)projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue / + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) * + Main.player[projectile.owner].minionDamage); + projectile.damage = damage2; + } + bool flag64 = projectile.type == mod.ProjectileType("Sandnado"); Player player = Main.player[projectile.owner]; CalamityPlayer modPlayer = player.GetModPlayer(mod); player.AddBuff(mod.BuffType("Sandnado"), 3600); @@ -295,5 +304,10 @@ namespace CalamityMod.Projectiles Main.spriteBatch.Draw(texture2D13, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y6, texture2D13.Width, num214)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)num214 / 2f), projectile.scale, SpriteEffects.None, 0f); return false; } - } + + public override bool CanDamage() + { + return false; + } + } } \ No newline at end of file diff --git a/Projectiles/Sandnado.png b/Projectiles/Summon/Sandnado.png similarity index 100% rename from Projectiles/Sandnado.png rename to Projectiles/Summon/Sandnado.png diff --git a/Projectiles/SandyWaifu.cs b/Projectiles/Summon/SandyWaifu.cs similarity index 88% rename from Projectiles/SandyWaifu.cs rename to Projectiles/Summon/SandyWaifu.cs index b9b4abe700..2f5bc00bcb 100644 --- a/Projectiles/SandyWaifu.cs +++ b/Projectiles/Summon/SandyWaifu.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Summon { public class SandyWaifu : ModProjectile { @@ -65,7 +65,9 @@ namespace CalamityMod.Projectiles dust--; if (dust >= 0) { - int num501 = 50; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue = projectile.damage; + int num501 = 50; for (int num502 = 0; num502 < num501; num502++) { int num503 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 16f), projectile.width, projectile.height - 16, 32, 0f, 0f, 0, default(Color), 1f); @@ -73,7 +75,14 @@ namespace CalamityMod.Projectiles Main.dust[num503].scale *= 1.15f; } } - if ((double)Math.Abs(projectile.velocity.X) > 0.2) + if (Main.player[projectile.owner].minionDamage != projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) + { + int damage2 = (int)(((float)projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue / + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) * + Main.player[projectile.owner].minionDamage); + projectile.damage = damage2; + } + if ((double)Math.Abs(projectile.velocity.X) > 0.2) { projectile.spriteDirection = -projectile.direction; } diff --git a/Projectiles/SandyWaifu.png b/Projectiles/Summon/SandyWaifu.png similarity index 100% rename from Projectiles/SandyWaifu.png rename to Projectiles/Summon/SandyWaifu.png diff --git a/Projectiles/Shroomling.png b/Projectiles/Summon/Shroomling.png similarity index 100% rename from Projectiles/Shroomling.png rename to Projectiles/Summon/Shroomling.png diff --git a/Projectiles/SilvaCrystal.cs b/Projectiles/Summon/SilvaCrystal.cs similarity index 88% rename from Projectiles/SilvaCrystal.cs rename to Projectiles/Summon/SilvaCrystal.cs index 1271c18036..554f988728 100644 --- a/Projectiles/SilvaCrystal.cs +++ b/Projectiles/Summon/SilvaCrystal.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Summon { public class SilvaCrystal : ModProjectile { @@ -23,18 +23,31 @@ namespace CalamityMod.Projectiles projectile.width = 32; projectile.height = 32; projectile.ignoreWater = true; - projectile.minionSlots = 0f; + projectile.minion = true; + projectile.minionSlots = 0f; projectile.timeLeft = 18000; projectile.alpha = 255; projectile.tileCollide = false; projectile.timeLeft *= 5; - projectile.sentry = true; projectile.penetrate = -1; } public override void AI() { - bool flag64 = projectile.type == mod.ProjectileType("SilvaCrystal"); + if (projectile.localAI[1] == 0f) + { + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue = projectile.damage; + projectile.localAI[1] += 1f; + } + if (Main.player[projectile.owner].minionDamage != projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) + { + int damage2 = (int)(((float)projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue / + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) * + Main.player[projectile.owner].minionDamage); + projectile.damage = damage2; + } + bool flag64 = projectile.type == mod.ProjectileType("SilvaCrystal"); Player player = Main.player[projectile.owner]; CalamityPlayer modPlayer = player.GetModPlayer(mod); if (!modPlayer.silvaSummon) @@ -213,5 +226,10 @@ namespace CalamityMod.Projectiles } return false; } - } + + public override bool CanDamage() + { + return false; + } + } } \ No newline at end of file diff --git a/Projectiles/SilvaCrystal.png b/Projectiles/Summon/SilvaCrystal.png similarity index 100% rename from Projectiles/SilvaCrystal.png rename to Projectiles/Summon/SilvaCrystal.png diff --git a/Projectiles/SilvaCrystalExplosion.cs b/Projectiles/Summon/SilvaCrystalExplosion.cs similarity index 97% rename from Projectiles/SilvaCrystalExplosion.cs rename to Projectiles/Summon/SilvaCrystalExplosion.cs index abb078c052..bfc4465edf 100644 --- a/Projectiles/SilvaCrystalExplosion.cs +++ b/Projectiles/Summon/SilvaCrystalExplosion.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Summon { public class SilvaCrystalExplosion : ModProjectile { diff --git a/Projectiles/SilvaCrystalExplosion.png b/Projectiles/Summon/SilvaCrystalExplosion.png similarity index 100% rename from Projectiles/SilvaCrystalExplosion.png rename to Projectiles/Summon/SilvaCrystalExplosion.png diff --git a/Projectiles/SirenLure.cs b/Projectiles/Summon/SirenLure.cs similarity index 79% rename from Projectiles/SirenLure.cs rename to Projectiles/Summon/SirenLure.cs index d77c507147..d6f935e5fa 100644 --- a/Projectiles/SirenLure.cs +++ b/Projectiles/Summon/SirenLure.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Summon { public class SirenLure : ModProjectile { @@ -15,24 +15,24 @@ namespace CalamityMod.Projectiles public override void SetStaticDefaults() { DisplayName.SetDefault("Siren Lure"); - Main.projFrames[projectile.type] = 4; + Main.projFrames[projectile.type] = 6; Main.projPet[projectile.type] = true; ProjectileID.Sets.MinionSacrificable[projectile.type] = true; } public override void SetDefaults() { - projectile.width = 120; + projectile.width = 70; projectile.height = 120; projectile.netImportant = true; projectile.friendly = true; projectile.ignoreWater = true; - projectile.minionSlots = 0f; + projectile.minion = true; + projectile.minionSlots = 0f; projectile.timeLeft = 18000; projectile.penetrate = -1; projectile.tileCollide = false; projectile.timeLeft *= 5; - projectile.sentry = true; } public override void AI() @@ -58,7 +58,9 @@ namespace CalamityMod.Projectiles } if (dust > 0) { - int num501 = 50; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue = projectile.damage; + int num501 = 50; for (int num502 = 0; num502 < num501; num502++) { int num503 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 16f), projectile.width, projectile.height - 16, 33, 0f, 0f, 0, default(Color), 1f); @@ -67,14 +69,21 @@ namespace CalamityMod.Projectiles } dust--; } - Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0f) / 255f, ((255 - projectile.alpha) * 0.25f) / 255f, ((255 - projectile.alpha) * 1.5f) / 255f); + if (Main.player[projectile.owner].minionDamage != projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) + { + int damage2 = (int)(((float)projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue / + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) * + Main.player[projectile.owner].minionDamage); + projectile.damage = damage2; + } + Lighting.AddLight(projectile.Center, 0f, 0.25f, 1.5f); projectile.frameCounter++; if (projectile.frameCounter > 12) { projectile.frame++; projectile.frameCounter = 0; } - if (projectile.frame > 3) + if (projectile.frame > 5) { projectile.frame = 0; } @@ -159,8 +168,6 @@ namespace CalamityMod.Projectiles projectileType = mod.ProjectileType("SirenSongFriendly"); } float num403 = Main.rand.Next(12, 20); - int damage = NPC.downedMoonlord ? 200 : 80; - float damageMult = CalamityWorld.downedDoG ? 2f : 1f; Vector2 vector29 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); float num404 = num516 - vector29.X; float num405 = num517 - vector29.Y; @@ -168,11 +175,20 @@ namespace CalamityMod.Projectiles num406 = num403 / num406; num404 *= num406; num405 *= num406; - Projectile.NewProjectile(projectile.Center.X - 4f, projectile.Center.Y, num404, num405, projectileType, (int)((float)damage * damageMult), projectile.knockBack, projectile.owner, 0f, 0f); + Projectile.NewProjectile(projectile.Center.X - 4f, projectile.Center.Y, num404, num405, projectileType, projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); projectile.ai[0] = 12f; - return; } } } - } + + public override Color? GetAlpha(Color lightColor) + { + return new Color(200, 200, 200, 200); + } + + public override bool CanDamage() + { + return false; + } + } } \ No newline at end of file diff --git a/Projectiles/Summon/SirenLure.png b/Projectiles/Summon/SirenLure.png new file mode 100644 index 0000000000..4823435d44 Binary files /dev/null and b/Projectiles/Summon/SirenLure.png differ diff --git a/Projectiles/SirenSongFriendly.cs b/Projectiles/Summon/SirenSongFriendly.cs similarity index 73% rename from Projectiles/SirenSongFriendly.cs rename to Projectiles/Summon/SirenSongFriendly.cs index fcb1774b93..9d42b5637f 100644 --- a/Projectiles/SirenSongFriendly.cs +++ b/Projectiles/Summon/SirenSongFriendly.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Summon { public class SirenSongFriendly : ModProjectile { @@ -48,8 +48,16 @@ namespace CalamityMod.Projectiles if (projectile.ai[1] == 0f) { projectile.ai[1] = 1f; - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 26); - } - } - } + float soundPitch = (Main.rand.NextFloat() - 0.5f) * 0.5f; + Main.harpNote = soundPitch; + Main.PlaySound(SoundID.Item26, projectile.position); + } + Lighting.AddLight(projectile.Center, 0f, 0f, 1.2f); + } + + public override Color? GetAlpha(Color lightColor) + { + return new Color(255, 255, 255, 0); + } + } } \ No newline at end of file diff --git a/Projectiles/SirenSongFriendly.png b/Projectiles/Summon/SirenSongFriendly.png similarity index 73% rename from Projectiles/SirenSongFriendly.png rename to Projectiles/Summon/SirenSongFriendly.png index 2d410bffb7..c2832ae6e8 100644 Binary files a/Projectiles/SirenSongFriendly.png and b/Projectiles/Summon/SirenSongFriendly.png differ diff --git a/Projectiles/SlimeGod.cs b/Projectiles/Summon/SlimeGod.cs similarity index 74% rename from Projectiles/SlimeGod.cs rename to Projectiles/Summon/SlimeGod.cs index 4fddde1e41..6828fea92d 100644 --- a/Projectiles/SlimeGod.cs +++ b/Projectiles/Summon/SlimeGod.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Summon { public class SlimeGod : ModProjectile { @@ -49,7 +49,9 @@ namespace CalamityMod.Projectiles { if (dust == 0f) { - int num226 = 16; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue = projectile.damage; + int num226 = 16; for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; @@ -62,7 +64,14 @@ namespace CalamityMod.Projectiles } dust += 1f; } - bool flag64 = projectile.type == mod.ProjectileType("SlimeGod"); + if (Main.player[projectile.owner].minionDamage != projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) + { + int damage2 = (int)(((float)projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue / + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) * + Main.player[projectile.owner].minionDamage); + projectile.damage = damage2; + } + bool flag64 = projectile.type == mod.ProjectileType("SlimeGod"); Player player = Main.player[projectile.owner]; CalamityPlayer modPlayer = player.GetModPlayer(mod); player.AddBuff(mod.BuffType("SlimeGod"), 3600); diff --git a/Projectiles/SlimeGod.png b/Projectiles/Summon/SlimeGod.png similarity index 100% rename from Projectiles/SlimeGod.png rename to Projectiles/Summon/SlimeGod.png diff --git a/Projectiles/SlimeGodAlt.cs b/Projectiles/Summon/SlimeGodAlt.cs similarity index 73% rename from Projectiles/SlimeGodAlt.cs rename to Projectiles/Summon/SlimeGodAlt.cs index bc20d5c726..91506432ed 100644 --- a/Projectiles/SlimeGodAlt.cs +++ b/Projectiles/Summon/SlimeGodAlt.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Summon { public class SlimeGodAlt : ModProjectile { @@ -49,7 +49,9 @@ namespace CalamityMod.Projectiles { if (dust == 0f) { - int num226 = 16; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue = projectile.damage; + int num226 = 16; for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; @@ -62,7 +64,14 @@ namespace CalamityMod.Projectiles } dust += 1f; } - bool flag64 = projectile.type == mod.ProjectileType("SlimeGodAlt"); + if (Main.player[projectile.owner].minionDamage != projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) + { + int damage2 = (int)(((float)projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue / + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) * + Main.player[projectile.owner].minionDamage); + projectile.damage = damage2; + } + bool flag64 = projectile.type == mod.ProjectileType("SlimeGodAlt"); Player player = Main.player[projectile.owner]; CalamityPlayer modPlayer = player.GetModPlayer(mod); player.AddBuff(mod.BuffType("SlimeGod"), 3600); diff --git a/Projectiles/SlimeGodAlt.png b/Projectiles/Summon/SlimeGodAlt.png similarity index 100% rename from Projectiles/SlimeGodAlt.png rename to Projectiles/Summon/SlimeGodAlt.png diff --git a/Projectiles/SolarBeam.cs b/Projectiles/Summon/SolarBeam.cs similarity index 93% rename from Projectiles/SolarBeam.cs rename to Projectiles/Summon/SolarBeam.cs index c54a2d3b13..80a2e8a550 100644 --- a/Projectiles/SolarBeam.cs +++ b/Projectiles/Summon/SolarBeam.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Summon { public class SolarBeam : ModProjectile { @@ -42,7 +42,6 @@ namespace CalamityMod.Projectiles Main.dust[num448].scale = (float)Main.rand.Next(70, 110) * 0.013f; Main.dust[num448].velocity *= 0.2f; } - return; } } } diff --git a/Projectiles/SolarBeam.png b/Projectiles/Summon/SolarBeam.png similarity index 100% rename from Projectiles/SolarBeam.png rename to Projectiles/Summon/SolarBeam.png diff --git a/Projectiles/SolarGod.cs b/Projectiles/Summon/SolarGod.cs similarity index 76% rename from Projectiles/SolarGod.cs rename to Projectiles/Summon/SolarGod.cs index 91bb5aad0a..c679c4b040 100644 --- a/Projectiles/SolarGod.cs +++ b/Projectiles/Summon/SolarGod.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Summon { public class SolarGod : ModProjectile { @@ -67,7 +67,9 @@ namespace CalamityMod.Projectiles projectile.scale = num395 + 0.95f; if (projectile.localAI[0] == 0f) { - int num501 = 50; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue = projectile.damage; + int num501 = 50; for (int num502 = 0; num502 < num501; num502++) { int num503 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 16f), projectile.width, projectile.height - 16, 244, 0f, 0f, 0, default(Color), 1f); @@ -76,6 +78,13 @@ namespace CalamityMod.Projectiles } projectile.localAI[0] += 1f; } + if (Main.player[projectile.owner].minionDamage != projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) + { + int damage2 = (int)(((float)projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue / + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) * + Main.player[projectile.owner].minionDamage); + projectile.damage = damage2; + } if (projectile.owner == Main.myPlayer) { if (projectile.ai[0] != 0f) @@ -105,7 +114,7 @@ namespace CalamityMod.Projectiles } if (flag11) { - float num403 = 35f; //modify the speed the projectile are shot. Lower number = slower projectile. + float num403 = 35f; Vector2 vector29 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); float num404 = num396 - vector29.X; float num405 = num397 - vector29.Y; @@ -113,11 +122,20 @@ namespace CalamityMod.Projectiles num406 = num403 / num406; num404 *= num406; num405 *= num406; - Projectile.NewProjectile(projectile.Center.X - 4f, projectile.Center.Y, num404, num405, mod.ProjectileType("SolarBeam"), (int)(60f * player.minionDamage), projectile.knockBack, projectile.owner, 0f, 0f); + Projectile.NewProjectile(projectile.Center.X - 4f, projectile.Center.Y, num404, num405, mod.ProjectileType("SolarBeam"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); projectile.ai[0] = 30f; - return; } } } - } + + public override Color? GetAlpha(Color lightColor) + { + return new Color(200, 200, 200, 200); + } + + public override bool CanDamage() + { + return false; + } + } } \ No newline at end of file diff --git a/Projectiles/SolarGod.png b/Projectiles/Summon/SolarGod.png similarity index 100% rename from Projectiles/SolarGod.png rename to Projectiles/Summon/SolarGod.png diff --git a/Projectiles/SolarPixie.cs b/Projectiles/Summon/SolarPixie.cs similarity index 77% rename from Projectiles/SolarPixie.cs rename to Projectiles/Summon/SolarPixie.cs index f99cbf59d3..dfc9b8295b 100644 --- a/Projectiles/SolarPixie.cs +++ b/Projectiles/Summon/SolarPixie.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Summon { public class SolarPixie : ModProjectile { @@ -67,7 +67,9 @@ namespace CalamityMod.Projectiles projectile.scale = num395 + 0.95f; if (projectile.localAI[0] == 0f) { - int num501 = 25; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue = projectile.damage; + int num501 = 25; for (int num502 = 0; num502 < num501; num502++) { int num503 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 16f), projectile.width, projectile.height - 16, 244, 0f, 0f, 0, default(Color), 1f); @@ -76,6 +78,13 @@ namespace CalamityMod.Projectiles } projectile.localAI[0] += 1f; } + if (Main.player[projectile.owner].minionDamage != projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) + { + int damage2 = (int)(((float)projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue / + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) * + Main.player[projectile.owner].minionDamage); + projectile.damage = damage2; + } if (projectile.owner == Main.myPlayer) { if (projectile.ai[0] != 0f) @@ -105,7 +114,7 @@ namespace CalamityMod.Projectiles } if (flag11) { - float num403 = 30f; //modify the speed the projectile are shot. Lower number = slower projectile. + float num403 = 30f; Vector2 vector29 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); float num404 = num396 - vector29.X; float num405 = num397 - vector29.Y; @@ -113,13 +122,22 @@ namespace CalamityMod.Projectiles num406 = num403 / num406; num404 *= num406; num405 *= num406; - int beam = Projectile.NewProjectile(projectile.Center.X - 4f, projectile.Center.Y, num404, num405, 260, (int)(6f * player.minionDamage), projectile.knockBack, projectile.owner, 0f, 0f); + int beam = Projectile.NewProjectile(projectile.Center.X - 4f, projectile.Center.Y, num404, num405, 260, projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); Main.projectile[beam].magic = false; Main.projectile[beam].minion = true; projectile.ai[0] = 50f; - return; } } } - } + + public override Color? GetAlpha(Color lightColor) + { + return new Color(200, 200, 200, 200); + } + + public override bool CanDamage() + { + return false; + } + } } \ No newline at end of file diff --git a/Projectiles/SolarPixie.png b/Projectiles/Summon/SolarPixie.png similarity index 100% rename from Projectiles/SolarPixie.png rename to Projectiles/Summon/SolarPixie.png diff --git a/Projectiles/StormMarkSummon.cs b/Projectiles/Summon/StormMarkSummon.cs similarity index 96% rename from Projectiles/StormMarkSummon.cs rename to Projectiles/Summon/StormMarkSummon.cs index 6d94d7e10f..6266ad2fbd 100644 --- a/Projectiles/StormMarkSummon.cs +++ b/Projectiles/Summon/StormMarkSummon.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Summon { public class StormMarkSummon : ModProjectile { diff --git a/Projectiles/StormMarkSummon.png b/Projectiles/Summon/StormMarkSummon.png similarity index 100% rename from Projectiles/StormMarkSummon.png rename to Projectiles/Summon/StormMarkSummon.png diff --git a/Projectiles/Urchin.cs b/Projectiles/Summon/Urchin.cs similarity index 80% rename from Projectiles/Urchin.cs rename to Projectiles/Summon/Urchin.cs index 8ec63ce823..b7214b7ea7 100644 --- a/Projectiles/Urchin.cs +++ b/Projectiles/Summon/Urchin.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Summon { public class Urchin : ModProjectile { @@ -25,12 +25,12 @@ namespace CalamityMod.Projectiles projectile.netImportant = true; projectile.friendly = true; projectile.ignoreWater = true; - projectile.minionSlots = 0f; + projectile.minion = true; + projectile.minionSlots = 0f; projectile.timeLeft = 18000; projectile.penetrate = -1; projectile.tileCollide = false; projectile.timeLeft *= 5; - projectile.sentry = true; } public override void AI() @@ -57,7 +57,9 @@ namespace CalamityMod.Projectiles dust--; if (dust >= 0) { - int num501 = 50; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue = projectile.damage; + int num501 = 50; for (int num502 = 0; num502 < num501; num502++) { int num503 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 16f), projectile.width, projectile.height - 16, 179, 0f, 0f, 0, default(Color), 1f); @@ -65,7 +67,14 @@ namespace CalamityMod.Projectiles Main.dust[num503].scale *= 1.15f; } } - float num395 = (float)Main.mouseTextColor / 200f - 0.35f; + if (Main.player[projectile.owner].minionDamage != projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) + { + int damage2 = (int)(((float)projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue / + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) * + Main.player[projectile.owner].minionDamage); + projectile.damage = damage2; + } + float num395 = (float)Main.mouseTextColor / 200f - 0.35f; num395 *= 0.2f; projectile.scale = num395 + 0.95f; projectile.position.X = Main.player[projectile.owner].Center.X - (float)(projectile.width / 2); @@ -137,15 +146,19 @@ namespace CalamityMod.Projectiles } value15.Normalize(); value15 *= (float)Main.rand.Next(70, 101) * 0.1f; - int spore = Projectile.NewProjectile(projectile.Center.X - 4f, projectile.Center.Y, value15.X, value15.Y, mod.ProjectileType("UrchinSpike"), (int)((double)7 * player.minionDamage), 1f, projectile.owner, 0f, 0f); + int spore = Projectile.NewProjectile(projectile.Center.X - 4f, projectile.Center.Y, value15.X, value15.Y, mod.ProjectileType("UrchinSpike"), projectile.damage, 1f, projectile.owner, 0f, 0f); Main.projectile[spore].minion = true; Main.projectile[spore].minionSlots = 0f; } Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); projectile.ai[0] = 60f; - return; } } } - } + + public override bool CanDamage() + { + return false; + } + } } \ No newline at end of file diff --git a/Projectiles/Urchin.png b/Projectiles/Summon/Urchin.png similarity index 100% rename from Projectiles/Urchin.png rename to Projectiles/Summon/Urchin.png diff --git a/Projectiles/UrchinSpike.cs b/Projectiles/Summon/UrchinSpike.cs similarity index 92% rename from Projectiles/UrchinSpike.cs rename to Projectiles/Summon/UrchinSpike.cs index b872c0e788..6f180fa425 100644 --- a/Projectiles/UrchinSpike.cs +++ b/Projectiles/Summon/UrchinSpike.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Summon { public class UrchinSpike : ModProjectile { diff --git a/Projectiles/UrchinSpike.png b/Projectiles/Summon/UrchinSpike.png similarity index 100% rename from Projectiles/UrchinSpike.png rename to Projectiles/Summon/UrchinSpike.png diff --git a/Projectiles/Valkyrie.cs b/Projectiles/Summon/Valkyrie.cs similarity index 86% rename from Projectiles/Valkyrie.cs rename to Projectiles/Summon/Valkyrie.cs index 58543d6db5..42803d5ccf 100644 --- a/Projectiles/Valkyrie.cs +++ b/Projectiles/Summon/Valkyrie.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Summon { public class Valkyrie : ModProjectile { @@ -57,7 +57,9 @@ namespace CalamityMod.Projectiles } if (projectile.localAI[0] == 0f) { - int num501 = 30; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue = projectile.damage; + int num501 = 30; for (int num502 = 0; num502 < num501; num502++) { int num503 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 16f), projectile.width, projectile.height - 16, 59, 0f, 0f, 0, default(Color), 1f); @@ -66,7 +68,14 @@ namespace CalamityMod.Projectiles } projectile.localAI[0] += 1f; } - if ((double)Math.Abs(projectile.velocity.X) > 0.2) + if (Main.player[projectile.owner].minionDamage != projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) + { + int damage2 = (int)(((float)projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue / + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) * + Main.player[projectile.owner].minionDamage); + projectile.damage = damage2; + } + if ((double)Math.Abs(projectile.velocity.X) > 0.2) { projectile.spriteDirection = -projectile.direction; } diff --git a/Projectiles/Valkyrie.png b/Projectiles/Summon/Valkyrie.png similarity index 100% rename from Projectiles/Valkyrie.png rename to Projectiles/Summon/Valkyrie.png diff --git a/Projectiles/WaterSpearFriendly.cs b/Projectiles/Summon/WaterSpearFriendly.cs similarity index 90% rename from Projectiles/WaterSpearFriendly.cs rename to Projectiles/Summon/WaterSpearFriendly.cs index 203257dce3..a226e77a08 100644 --- a/Projectiles/WaterSpearFriendly.cs +++ b/Projectiles/Summon/WaterSpearFriendly.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Summon { public class WaterSpearFriendly : ModProjectile { @@ -78,7 +78,12 @@ namespace CalamityMod.Projectiles return false; } - public override void Kill(int timeLeft) + public override Color? GetAlpha(Color lightColor) + { + return new Color(200, 200, 200, projectile.alpha); + } + + public override void Kill(int timeLeft) { for (int k = 0; k < 3; k++) { diff --git a/Projectiles/Summon/WaterSpearFriendly.png b/Projectiles/Summon/WaterSpearFriendly.png new file mode 100644 index 0000000000..b923a9ea8b Binary files /dev/null and b/Projectiles/Summon/WaterSpearFriendly.png differ diff --git a/Projectiles/WulfrumDroid.png b/Projectiles/Summon/WulfrumDroid.png similarity index 100% rename from Projectiles/WulfrumDroid.png rename to Projectiles/Summon/WulfrumDroid.png diff --git a/Projectiles/Summon/desktop.ini b/Projectiles/Summon/desktop.ini new file mode 100644 index 0000000000..5c9af8eb7b --- /dev/null +++ b/Projectiles/Summon/desktop.ini @@ -0,0 +1,2 @@ +[LocalizedFileNames] +WaterSpear.png=@WaterSpear,0 diff --git a/Projectiles/SunkenSea/AquaStream.cs b/Projectiles/SunkenSea/AquaStream.cs new file mode 100644 index 0000000000..400b6e990d --- /dev/null +++ b/Projectiles/SunkenSea/AquaStream.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.SunkenSea +{ + public class AquaStream : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Aqua Stream"); + } + + public override void SetDefaults() + { + projectile.width = 6; + projectile.height = 6; + projectile.scale = 1f; + projectile.friendly = true; + projectile.alpha = 150; + projectile.penetrate = 1; + projectile.timeLeft = 14; + projectile.melee = true; + } + + public override void AI() + { + //projectile.ai[0] is the X increment while projectile.ai[1] is the Y increment + projectile.velocity.X += projectile.ai[0]; + projectile.velocity.Y += projectile.ai[1]; + if (Main.rand.NextFloat() < 1f) + { + Dust dust; + // You need to set position depending on what you are doing. You may need to subtract width/2 and height/2 as well to center the spawn rectangle. + Vector2 position = projectile.Center; + dust = Terraria.Dust.NewDustPerfect(position, 33, new Vector2(0f, 0f), 0, new Color(0, 142, 255), 2.368421f); + dust.noGravity = true; + } + } + } +} \ No newline at end of file diff --git a/Projectiles/SunkenSea/AquaStream.png b/Projectiles/SunkenSea/AquaStream.png new file mode 100644 index 0000000000..20a538ba9f Binary files /dev/null and b/Projectiles/SunkenSea/AquaStream.png differ diff --git a/Projectiles/SunkenSea/AquamarineBolt.cs b/Projectiles/SunkenSea/AquamarineBolt.cs new file mode 100644 index 0000000000..267dcdd189 --- /dev/null +++ b/Projectiles/SunkenSea/AquamarineBolt.cs @@ -0,0 +1,56 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.SunkenSea +{ + public class AquamarineBolt : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bolt"); + } + + public override void SetDefaults() + { + projectile.width = 8; + projectile.height = 8; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.penetrate = 1; + projectile.magic = true; + } + + public override void AI() + { + Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0f) / 255f, ((255 - projectile.alpha) * 0.25f) / 255f, ((255 - projectile.alpha) * 0.25f) / 255f); + for (int num151 = 0; num151 < 3; num151++) + { + int num154 = 14; + int num155 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width - num154 * 2, projectile.height - num154 * 2, 68, 0f, 0f, 100, default(Color), 1.5f); + Main.dust[num155].noGravity = true; + Main.dust[num155].velocity *= 0.1f; + Main.dust[num155].velocity += projectile.velocity * 0.5f; + } + if (Main.rand.Next(8) == 0) + { + int num156 = 16; + int num157 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width - num156 * 2, projectile.height - num156 * 2, 68, 0f, 0f, 100, default(Color), 1f); + Main.dust[num157].velocity *= 0.25f; + Main.dust[num157].velocity += projectile.velocity * 0.5f; + return; + } + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D tex = Main.projectileTexture[projectile.type]; + spriteBatch.Draw(tex, projectile.Center - Main.screenPosition, null, projectile.GetAlpha(lightColor), projectile.rotation, tex.Size() / 2f, projectile.scale, SpriteEffects.None, 0f); + return false; + } + } +} \ No newline at end of file diff --git a/Projectiles/ChaosFlare2.png b/Projectiles/SunkenSea/AquamarineBolt.png similarity index 100% rename from Projectiles/ChaosFlare2.png rename to Projectiles/SunkenSea/AquamarineBolt.png diff --git a/Projectiles/SunkenSea/Aquashard.cs b/Projectiles/SunkenSea/Aquashard.cs new file mode 100644 index 0000000000..7a5ea80feb --- /dev/null +++ b/Projectiles/SunkenSea/Aquashard.cs @@ -0,0 +1,63 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.SunkenSea +{ + public class Aquashard : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Aquashard"); + } + + public override void SetDefaults() + { + projectile.width = 10; + projectile.height = 16; + projectile.friendly = true; + projectile.ranged = true; + projectile.penetrate = 1; + projectile.timeLeft = 300; + projectile.aiStyle = 1; + } + + public override void AI() + { + projectile.velocity.X *= 0.9995f; + projectile.velocity.Y = projectile.velocity.Y + 0.01f; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + int num251 = Main.rand.Next(2, 4); + if (projectile.owner == Main.myPlayer) + { + for (int num252 = 0; num252 < num251; num252++) + { + Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + while (value15.X == 0f && value15.Y == 0f) + { + value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + } + value15.Normalize(); + value15 *= (float)Main.rand.Next(70, 101) * 0.1f; + Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), value15.X, value15.Y, mod.ProjectileType("AquashardSplit"), (int)((double)projectile.damage * 0.5), 0f, projectile.owner, 0f, 0f); + } + } + } + + public override void Kill(int timeLeft) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 27); + for (int k = 0; k < 5; k++) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 154, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); + } + } + } +} \ No newline at end of file diff --git a/Projectiles/SunkenSea/Aquashard.png b/Projectiles/SunkenSea/Aquashard.png new file mode 100644 index 0000000000..0e32025173 Binary files /dev/null and b/Projectiles/SunkenSea/Aquashard.png differ diff --git a/Projectiles/SunkenSea/AquashardSplit.cs b/Projectiles/SunkenSea/AquashardSplit.cs new file mode 100644 index 0000000000..d16a063cfb --- /dev/null +++ b/Projectiles/SunkenSea/AquashardSplit.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.SunkenSea +{ + public class AquashardSplit : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Aquashard"); + } + + public override void SetDefaults() + { + projectile.width = 10; + projectile.height = 16; + projectile.friendly = true; + projectile.ranged = true; + projectile.penetrate = 3; + projectile.timeLeft = 180; + projectile.aiStyle = 1; + } + + public override void AI() + { + projectile.velocity.X *= 0.9995f; + projectile.velocity.Y = projectile.velocity.Y + 0.01f; + } + + public override void Kill(int timeLeft) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 27); + for (int k = 0; k < 5; k++) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 154, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); + } + } + } +} \ No newline at end of file diff --git a/Projectiles/SunkenSea/AquashardSplit.png b/Projectiles/SunkenSea/AquashardSplit.png new file mode 100644 index 0000000000..0e32025173 Binary files /dev/null and b/Projectiles/SunkenSea/AquashardSplit.png differ diff --git a/Projectiles/SunkenSea/ClamCrusherFlail.cs b/Projectiles/SunkenSea/ClamCrusherFlail.cs new file mode 100644 index 0000000000..fade868095 --- /dev/null +++ b/Projectiles/SunkenSea/ClamCrusherFlail.cs @@ -0,0 +1,205 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.SunkenSea +{ + public class ClamCrusherFlail : ModProjectile + { + public int finalDamage; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Clam Crusher"); + } + + public override void SetDefaults() + { + projectile.width = 58; + projectile.height = 74; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.penetrate = -1; + projectile.melee = true; + projectile.alpha = 255; + projectile.tileCollide = false; + } + + public override void AI() + { + projectile.ai[1] += 1f; + if (projectile.ai[1] == 1f) + { + finalDamage = (int)(projectile.damage * 2.5f); + } + if (projectile.ai[1] >= 5f && (projectile.ai[1] <= 10f)) + { + for (int num105 = 0; num105 < 10; num105++) + { + float num99 = projectile.velocity.X / 3f * (float)num105; + float num100 = projectile.velocity.Y / 3f * (float)num105; + int num101 = 4; + int waterDust = Dust.NewDust(new Vector2(projectile.position.X + (float)num101, projectile.position.Y + (float)num101), projectile.width - num101 * 2, projectile.height - num101 * 2, 33, 0f, 0f, 0, new Color(0, 142, 255), 1.5f); + Main.dust[waterDust].noGravity = true; + Main.dust[waterDust].velocity *= 0.1f; + Main.dust[waterDust].velocity += projectile.velocity * 0.1f; + Dust expr_47FA_cp_0 = Main.dust[waterDust]; + expr_47FA_cp_0.position.X = expr_47FA_cp_0.position.X - num99; + Dust expr_4815_cp_0 = Main.dust[waterDust]; + expr_4815_cp_0.position.Y = expr_4815_cp_0.position.Y - num100; + } + } + if (projectile.ai[1] == 5f) + { + projectile.tileCollide = true; + } + Vector2 vector62 = Main.player[projectile.owner].Center - projectile.Center; + projectile.rotation = vector62.ToRotation() - 1.57f; + if (Main.player[projectile.owner].dead) + { + projectile.Kill(); + return; + } + Main.player[projectile.owner].itemAnimation = 10; + Main.player[projectile.owner].itemTime = 10; + float arg_1DC8F_0 = vector62.X; + if (vector62.X < 0f) + { + Main.player[projectile.owner].ChangeDir(1); + projectile.direction = 1; + } + else + { + Main.player[projectile.owner].ChangeDir(-1); + projectile.direction = -1; + } + Main.player[projectile.owner].itemRotation = (vector62 * -1f * (float)projectile.direction).ToRotation(); + projectile.spriteDirection = ((vector62.X > 0f) ? -1 : 1); + if (projectile.ai[1] >= 45f && (projectile.ai[0] != 1f || projectile.ai[0] != 2f)) + { + projectile.velocity.Y += 1f; + projectile.velocity.X *= 0.995f; + projectile.damage = finalDamage; + } + if (projectile.ai[0] == 0f && vector62.Length() > 1000f) + { + projectile.ai[0] = 1f; + } + if (projectile.ai[0] == 1f || projectile.ai[0] == 2f) + { + float num693 = vector62.Length(); + if (num693 > 1500f) + { + projectile.Kill(); + return; + } + if (num693 > 600f) + { + projectile.ai[0] = 2f; + } + projectile.tileCollide = false; + float num694 = 20f; + if (projectile.ai[0] == 2f) + { + num694 = 40f; + } + projectile.velocity = Vector2.Normalize(vector62) * num694; + if (vector62.Length() < num694) + { + projectile.Kill(); + return; + } + } + float[] var_2_1DE21_cp_0 = projectile.ai; + int var_2_1DE21_cp_1 = 1; + float num73 = var_2_1DE21_cp_0[var_2_1DE21_cp_1]; + var_2_1DE21_cp_0[var_2_1DE21_cp_1] = num73 + 1f; + if (projectile.ai[1] > 5f) + { + projectile.alpha = 0; + } + } + + public override bool OnTileCollide(Vector2 oldVelocity) + { + if (projectile.ai[1] >= 5f) + { + Collision.HitTiles(projectile.position, projectile.velocity, projectile.width, projectile.height); + projectile.ai[0] = 1f; + projectile.netUpdate = true; + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/ClamImpact"), (int)projectile.position.X, (int)projectile.position.Y); + for (int num105 = 0; num105 < 50; num105++) + { + Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + while (value15.X == 0f && value15.Y == 0f) + { + value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + } + value15.Normalize(); + value15 *= (float)Main.rand.Next(70, 101) * 0.1f; + int waterDust = Dust.NewDust(new Vector2(projectile.Center.X, projectile.Center.Y), projectile.width / 2, projectile.height / 2, 33, value15.X, value15.Y, 0, new Color(0, 142, 255), 1.5f); + Main.dust[waterDust].velocity *= 2f; + } + } + return false; + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Vector2 mountedCenter = Main.player[projectile.owner].MountedCenter; + Microsoft.Xna.Framework.Color transparent = Microsoft.Xna.Framework.Color.Transparent; + Texture2D texture2D2 = mod.GetTexture("ExtraTextures/Chains/ClamCrusherChain"); + Vector2 vector17 = projectile.Center; + Microsoft.Xna.Framework.Rectangle? sourceRectangle = null; + Vector2 origin = new Vector2((float)texture2D2.Width * 0.5f, (float)texture2D2.Height * 0.5f); + float num91 = (float)texture2D2.Height; + Vector2 vector18 = mountedCenter - vector17; + float rotation15 = (float)Math.Atan2((double)vector18.Y, (double)vector18.X) - 1.57f; + bool flag13 = true; + if (float.IsNaN(vector17.X) && float.IsNaN(vector17.Y)) + { + flag13 = false; + } + if (float.IsNaN(vector18.X) && float.IsNaN(vector18.Y)) + { + flag13 = false; + } + while (flag13) + { + if (vector18.Length() < num91 + 1f) + { + flag13 = false; + } + else + { + Vector2 value2 = vector18; + value2.Normalize(); + vector17 += value2 * num91; + vector18 = mountedCenter - vector17; + Microsoft.Xna.Framework.Color color17 = Lighting.GetColor((int)vector17.X / 16, (int)(vector17.Y / 16f)); + Main.spriteBatch.Draw(texture2D2, vector17 - Main.screenPosition, sourceRectangle, color17, rotation15, origin, 1f, SpriteEffects.None, 0f); + } + } + return true; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + if (target.rarity != 2 && !target.boss) + { + target.AddBuff(mod.BuffType("SilvaStun"), 60); + } + else if (projectile.ai[1] >= 45f && (projectile.ai[0] != 1f || projectile.ai[0] != 2f)) + { + target.AddBuff(mod.BuffType("SilvaStun"), 30); + } + projectile.ai[0] = 1f; + projectile.netUpdate = true; + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/ClamImpact"), (int)projectile.position.X, (int)projectile.position.Y); + } + } +} \ No newline at end of file diff --git a/Projectiles/SunkenSea/ClamCrusherFlail.png b/Projectiles/SunkenSea/ClamCrusherFlail.png new file mode 100644 index 0000000000..3752350c4b Binary files /dev/null and b/Projectiles/SunkenSea/ClamCrusherFlail.png differ diff --git a/Projectiles/SunkenSea/ClamorRifleProj.cs b/Projectiles/SunkenSea/ClamorRifleProj.cs new file mode 100644 index 0000000000..ad865dcc26 --- /dev/null +++ b/Projectiles/SunkenSea/ClamorRifleProj.cs @@ -0,0 +1,106 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.SunkenSea +{ + public class ClamorRifleProj : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Energy Bolt"); + } + + public override void SetDefaults() + { + projectile.width = 8; + projectile.height = 8; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.penetrate = 1; + projectile.ranged = true; + } + + public override void AI() + { + projectile.localAI[0] += 1f; + if (projectile.localAI[0] > 3f) + { + Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0f) / 255f, ((255 - projectile.alpha) * 0.25f) / 255f, ((255 - projectile.alpha) * 0.25f) / 255f); + for (int num151 = 0; num151 < 3; num151++) + { + int num154 = 14; + int num155 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width - num154 * 2, projectile.height - num154 * 2, 68, 0f, 0f, 100, default(Color), 1f); + Main.dust[num155].noGravity = true; + Main.dust[num155].velocity *= 0.1f; + Main.dust[num155].velocity += projectile.velocity * 0.5f; + } + } + float centerX = projectile.Center.X; + float centerY = projectile.Center.Y; + float num474 = 300f; + bool homeIn = false; + for (int num475 = 0; num475 < 200; num475++) + { + if (Main.npc[num475].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1)) + { + float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2); + float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2); + float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477); + if (num478 < num474) + { + num474 = num478; + centerX = num476; + centerY = num477; + homeIn = true; + } + } + } + if (homeIn) + { + float num483 = 18f; + Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + float num484 = centerX - vector35.X; + float num485 = centerY - vector35.Y; + float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485)); + num486 = num483 / num486; + num484 *= num486; + num485 *= num486; + projectile.velocity.X = (projectile.velocity.X * 25f + num484) / 26f; + projectile.velocity.Y = (projectile.velocity.Y * 25f + num485) / 26f; + return; + } + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D tex = Main.projectileTexture[projectile.type]; + spriteBatch.Draw(tex, projectile.Center - Main.screenPosition, null, projectile.GetAlpha(lightColor), projectile.rotation, tex.Size() / 2f, projectile.scale, SpriteEffects.None, 0f); + return false; + } + + public override void Kill(int timeLeft) + { + int num251 = Main.rand.Next(2, 3); + if (projectile.owner == Main.myPlayer) + { + for (int num252 = 0; num252 < num251; num252++) + { + Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + while (value15.X == 0f && value15.Y == 0f) + { + value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + } + value15.Normalize(); + value15 *= (float)Main.rand.Next(70, 101) * 0.1f; + Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), value15.X, value15.Y, mod.ProjectileType("ClamorRifleProjSplit"), (int)((double)projectile.damage * 0.5), 0f, projectile.owner, 0f, 0f); + } + } + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 118); + } + } +} \ No newline at end of file diff --git a/Projectiles/GodSlayerShrapnelRound.png b/Projectiles/SunkenSea/ClamorRifleProj.png similarity index 100% rename from Projectiles/GodSlayerShrapnelRound.png rename to Projectiles/SunkenSea/ClamorRifleProj.png diff --git a/Projectiles/SunkenSea/ClamorRifleProjSplit.cs b/Projectiles/SunkenSea/ClamorRifleProjSplit.cs new file mode 100644 index 0000000000..8ad2d2e6be --- /dev/null +++ b/Projectiles/SunkenSea/ClamorRifleProjSplit.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.SunkenSea +{ + public class ClamorRifleProjSplit : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Energy Bolt"); + } + + public override void SetDefaults() + { + projectile.width = 8; + projectile.height = 8; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.penetrate = 1; + projectile.ranged = true; + } + + public override void AI() + { + Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0f) / 255f, ((255 - projectile.alpha) * 0.25f) / 255f, ((255 - projectile.alpha) * 0.25f) / 255f); + for (int num151 = 0; num151 < 3; num151++) + { + int num154 = 14; + int num155 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width - num154 * 2, projectile.height - num154 * 2, 68, 0f, 0f, 100, default(Color), 1f); + Main.dust[num155].noGravity = true; + Main.dust[num155].velocity *= 0.1f; + Main.dust[num155].velocity += projectile.velocity * 0.5f; + } + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D tex = Main.projectileTexture[projectile.type]; + spriteBatch.Draw(tex, projectile.Center - Main.screenPosition, null, projectile.GetAlpha(lightColor), projectile.rotation, tex.Size() / 2f, projectile.scale, SpriteEffects.None, 0f); + return false; + } + } +} \ No newline at end of file diff --git a/Projectiles/GoldenGun.png b/Projectiles/SunkenSea/ClamorRifleProjSplit.png similarity index 100% rename from Projectiles/GoldenGun.png rename to Projectiles/SunkenSea/ClamorRifleProjSplit.png diff --git a/Projectiles/SunkenSea/CoralBubble.cs b/Projectiles/SunkenSea/CoralBubble.cs new file mode 100644 index 0000000000..09c7cb2b90 --- /dev/null +++ b/Projectiles/SunkenSea/CoralBubble.cs @@ -0,0 +1,114 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.SunkenSea +{ + public class CoralBubble : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bubble"); + } + + public override void SetDefaults() + { + projectile.width = 28; + projectile.height = 28; + projectile.scale = 0.01f; + projectile.friendly = true; + projectile.alpha = 255; + projectile.timeLeft = 360; + projectile.penetrate = 1; + } + + public override void AI() + { + if (projectile.localAI[1] < 1f) + { + projectile.localAI[1] += 0.01f; + projectile.scale += 0.01f; + projectile.width = (int)(28f * projectile.scale); + projectile.height = (int)(28f * projectile.scale); + } + else + { + projectile.width = 28; + projectile.height = 28; + } + if (projectile.localAI[0] > 2f) + { + projectile.alpha -= 5; + if (projectile.alpha < 100) + { + projectile.alpha = 100; + } + } + else + { + projectile.localAI[0] += 1f; + } + if (projectile.ai[1] > 30f) + { + if (projectile.velocity.Y > -1.5f) + { + projectile.velocity.Y = projectile.velocity.Y - 0.05f; + } + } + else + { + projectile.ai[1] += 1f; + } + if (projectile.wet) + { + if (projectile.velocity.Y > 0f) + { + projectile.velocity.Y = projectile.velocity.Y * 0.98f; + } + if (projectile.velocity.Y > -1f) + { + projectile.velocity.Y = projectile.velocity.Y - 0.2f; + } + } + if (projectile.localAI[1] >= 1f) + { + int closestPlayer = (int)Player.FindClosest(projectile.Center, 1, 1); + Vector2 distance = Main.player[closestPlayer].Center - projectile.Center; + if (projectile.Distance(Main.player[closestPlayer].Center) < 14f) + { + Main.player[closestPlayer].AddBuff(BuffID.Gills, 90); + projectile.Kill(); + } + } + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D texture2D13 = Main.projectileTexture[projectile.type]; + int num214 = Main.projectileTexture[projectile.type].Height / Main.projFrames[projectile.type]; + int y6 = num214 * projectile.frame; + Main.spriteBatch.Draw(texture2D13, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y6, texture2D13.Width, num214)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)num214 / 2f), projectile.scale, SpriteEffects.None, 0f); + return false; + } + + public override void Kill(int timeLeft) + { + Main.PlaySound(SoundID.Item54, projectile.position); + projectile.position = projectile.Center; + projectile.position.X = projectile.position.X - (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + int num190 = Main.rand.Next(5, 9); + for (int num191 = 0; num191 < num190; num191++) + { + int num192 = Dust.NewDust(projectile.Center, 0, 0, 206, 0f, 0f, 100, default(Color), 1.4f); + Main.dust[num192].velocity *= 0.8f; + Main.dust[num192].position = Vector2.Lerp(Main.dust[num192].position, projectile.Center, 0.5f); + Main.dust[num192].noGravity = true; + } + } + } +} \ No newline at end of file diff --git a/Projectiles/SunkenSea/CoralBubble.png b/Projectiles/SunkenSea/CoralBubble.png new file mode 100644 index 0000000000..e3e51784ba Binary files /dev/null and b/Projectiles/SunkenSea/CoralBubble.png differ diff --git a/Projectiles/SunkenSea/CoralBubbleSmall.cs b/Projectiles/SunkenSea/CoralBubbleSmall.cs new file mode 100644 index 0000000000..9ca5a44014 --- /dev/null +++ b/Projectiles/SunkenSea/CoralBubbleSmall.cs @@ -0,0 +1,114 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.SunkenSea +{ + public class CoralBubbleSmall : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bubble"); + } + + public override void SetDefaults() + { + projectile.width = 28; + projectile.height = 28; + projectile.scale = 0.01f; + projectile.friendly = true; + projectile.alpha = 255; + projectile.timeLeft = 360; + projectile.penetrate = 1; + } + + public override void AI() + { + if (projectile.localAI[1] < 0.5f) + { + projectile.localAI[1] += 0.005f; + projectile.scale += 0.005f; + projectile.width = (int)(28f * projectile.scale); + projectile.height = (int)(28f * projectile.scale); + } + else + { + projectile.width = 14; + projectile.height = 14; + } + if (projectile.localAI[0] > 2f) + { + projectile.alpha -= 5; + if (projectile.alpha < 100) + { + projectile.alpha = 100; + } + } + else + { + projectile.localAI[0] += 1f; + } + if (projectile.ai[1] > 30f) + { + if (projectile.velocity.Y > -1.5f) + { + projectile.velocity.Y = projectile.velocity.Y - 0.05f; + } + } + else + { + projectile.ai[1] += 1f; + } + if (projectile.wet) + { + if (projectile.velocity.Y > 0f) + { + projectile.velocity.Y = projectile.velocity.Y * 0.98f; + } + if (projectile.velocity.Y > -1f) + { + projectile.velocity.Y = projectile.velocity.Y - 0.2f; + } + } + if (projectile.localAI[1] >= 0.5f) + { + int closestPlayer = (int)Player.FindClosest(projectile.Center, 1, 1); + Vector2 distance = Main.player[closestPlayer].Center - projectile.Center; + if (projectile.Distance(Main.player[closestPlayer].Center) < 7f) + { + Main.player[closestPlayer].AddBuff(BuffID.Gills, 30); + projectile.Kill(); + } + } + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D texture2D13 = Main.projectileTexture[projectile.type]; + int num214 = Main.projectileTexture[projectile.type].Height / Main.projFrames[projectile.type]; + int y6 = num214 * projectile.frame; + Main.spriteBatch.Draw(texture2D13, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y6, texture2D13.Width, num214)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)num214 / 2f), projectile.scale, SpriteEffects.None, 0f); + return false; + } + + public override void Kill(int timeLeft) + { + Main.PlaySound(SoundID.Item54, projectile.position); + projectile.position = projectile.Center; + projectile.position.X = projectile.position.X - (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + int num190 = Main.rand.Next(5, 9); + for (int num191 = 0; num191 < num190; num191++) + { + int num192 = Dust.NewDust(projectile.Center, 0, 0, 206, 0f, 0f, 100, default(Color), 1.4f); + Main.dust[num192].velocity *= 0.8f; + Main.dust[num192].position = Vector2.Lerp(Main.dust[num192].position, projectile.Center, 0.5f); + Main.dust[num192].noGravity = true; + } + } + } +} \ No newline at end of file diff --git a/Projectiles/SunkenSea/CoralBubbleSmall.png b/Projectiles/SunkenSea/CoralBubbleSmall.png new file mode 100644 index 0000000000..e3e51784ba Binary files /dev/null and b/Projectiles/SunkenSea/CoralBubbleSmall.png differ diff --git a/Projectiles/SunkenSea/EutrophicScimitarProj.cs b/Projectiles/SunkenSea/EutrophicScimitarProj.cs new file mode 100644 index 0000000000..e7b0ef2f21 --- /dev/null +++ b/Projectiles/SunkenSea/EutrophicScimitarProj.cs @@ -0,0 +1,84 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.Graphics.Shaders; +using Terraria.GameContent.Achievements; +using Microsoft.Xna.Framework.Graphics; + +namespace CalamityMod.Projectiles.SunkenSea +{ + class EutrophicScimitarProj : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Scimitar Zap"); + Main.projFrames[projectile.type] = 3; + } + + public override void SetDefaults() + { + projectile.width = 34; + projectile.height = 18; + projectile.friendly = true; + projectile.penetrate = 1; + projectile.tileCollide = true; + projectile.melee = true; + } + + public override Color? GetAlpha(Color lightColor) + { + return new Color(127, 255, 253); + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + if (target.rarity != 2 && !target.boss) + { + target.AddBuff(mod.BuffType("SilvaStun"), 10); + } + } + + public override void AI() + { + Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0f) / 255f, ((255 - projectile.alpha) * 0.35f) / 255f, ((255 - projectile.alpha) * 0.35f) / 255f); + projectile.frameCounter++; + if (projectile.frameCounter > 2) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame > 2) + { + projectile.frame = 0; + } + if (projectile.velocity.X < 0f) + { + projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X); + } + else + { + projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X); + } + if (Main.rand.Next(2) == 0) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 226, projectile.velocity.X * 0.25f, projectile.velocity.Y * 0.25f, 0, new Color(255, 255, 255), 0.5f); + } + projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X); + } + + public override void Kill(int timeLeft) + { + for (int i = 0; i <= 10; i++) + { + Dust dust; + Vector2 position = new Vector2(projectile.position.X - 4, projectile.position.Y - 4); + dust = Main.dust[Terraria.Dust.NewDust(position, 58, 58, 226, 0f, 0f, 0, new Color(255, 255, 255), 0.4605263f)]; + dust.noGravity = true; + dust.fadeIn = 0.9473684f; + } + } + } +} diff --git a/Projectiles/SunkenSea/EutrophicScimitarProj.png b/Projectiles/SunkenSea/EutrophicScimitarProj.png new file mode 100644 index 0000000000..7c03384584 Binary files /dev/null and b/Projectiles/SunkenSea/EutrophicScimitarProj.png differ diff --git a/Projectiles/SunkenSea/EutrophicSpark.cs b/Projectiles/SunkenSea/EutrophicSpark.cs new file mode 100644 index 0000000000..a1e98450f1 --- /dev/null +++ b/Projectiles/SunkenSea/EutrophicSpark.cs @@ -0,0 +1,100 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.SunkenSea +{ + public class EutrophicSpark : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Eutrophic Spark"); + } + + public override void SetDefaults() + { + projectile.width = 6; + projectile.height = 12; + projectile.friendly = true; + projectile.penetrate = 2; + projectile.timeLeft = 30; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 15; + projectile.melee = true; + } + + public override void AI() + { + if (projectile.velocity.X != projectile.velocity.X) + { + projectile.velocity.X = projectile.velocity.X * -0.1f; + } + if (projectile.velocity.X != projectile.velocity.X) + { + projectile.velocity.X = projectile.velocity.X * -0.5f; + } + if (projectile.velocity.Y != projectile.velocity.Y && projectile.velocity.Y > 1f) + { + projectile.velocity.Y = projectile.velocity.Y * -0.5f; + } + projectile.ai[0] += 1f; + if (projectile.ai[0] > 5f) + { + projectile.ai[0] = 5f; + if (projectile.velocity.Y == 0f && projectile.velocity.X != 0f) + { + projectile.velocity.X = projectile.velocity.X * 0.97f; + if ((double)projectile.velocity.X > -0.01 && (double)projectile.velocity.X < 0.01) + { + projectile.velocity.X = 0f; + projectile.netUpdate = true; + } + } + projectile.velocity.Y = projectile.velocity.Y + 0.2f; + } + projectile.rotation += projectile.velocity.X * 0.1f; + int num199 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 206, 0f, 0f, 100, default(Color), 1f); + Dust expr_8976_cp_0 = Main.dust[num199]; + expr_8976_cp_0.position.X = expr_8976_cp_0.position.X - 2f; + Dust expr_8994_cp_0 = Main.dust[num199]; + expr_8994_cp_0.position.Y = expr_8994_cp_0.position.Y + 2f; + Main.dust[num199].scale += (float)Main.rand.Next(50) * 0.01f; + Main.dust[num199].noGravity = true; + Dust expr_89E7_cp_0 = Main.dust[num199]; + expr_89E7_cp_0.velocity.Y = expr_89E7_cp_0.velocity.Y - 2f; + if (Main.rand.Next(2) == 0) + { + int num200 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 206, 0f, 0f, 100, default(Color), 1f); + Dust expr_8A4E_cp_0 = Main.dust[num200]; + expr_8A4E_cp_0.position.X = expr_8A4E_cp_0.position.X - 2f; + Dust expr_8A6C_cp_0 = Main.dust[num200]; + expr_8A6C_cp_0.position.Y = expr_8A6C_cp_0.position.Y + 2f; + Main.dust[num200].scale += 0.3f + (float)Main.rand.Next(50) * 0.01f; + Main.dust[num200].noGravity = true; + Main.dust[num200].velocity *= 0.1f; + } + if ((double)projectile.velocity.Y < 0.25 && (double)projectile.velocity.Y > 0.15) + { + projectile.velocity.X = projectile.velocity.X * 0.8f; + } + projectile.rotation = -projectile.velocity.X * 0.05f; + if (projectile.velocity.Y > 16f) + { + projectile.velocity.Y = 16f; + return; + } + } + + public override bool OnTileCollide(Vector2 oldVelocity) + { + if (projectile.penetrate == 0) + { + projectile.Kill(); + } + return false; + } + } +} \ No newline at end of file diff --git a/Projectiles/GodSlayerShrapnel.png b/Projectiles/SunkenSea/EutrophicSpark.png similarity index 100% rename from Projectiles/GodSlayerShrapnel.png rename to Projectiles/SunkenSea/EutrophicSpark.png diff --git a/Projectiles/SunkenSea/PearlBurst.cs b/Projectiles/SunkenSea/PearlBurst.cs new file mode 100644 index 0000000000..1bdd00a055 --- /dev/null +++ b/Projectiles/SunkenSea/PearlBurst.cs @@ -0,0 +1,88 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.SunkenSea +{ + public class PearlBurst : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Pearl Burst"); + Main.projFrames[projectile.type] = 4; + } + + public override void SetDefaults() + { + projectile.width = 40; + projectile.height = 64; + projectile.hostile = true; + projectile.penetrate = -1; + projectile.alpha = 255; + projectile.timeLeft = 300; + projectile.ignoreWater = true; + projectile.tileCollide = false; + } + + public override void AI() + { + Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0f) / 255f, ((255 - projectile.alpha) * 0.5f) / 255f, ((255 - projectile.alpha) * 0.5f) / 255f); + if (Main.rand.Next(5) == 0) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 92, projectile.velocity.X * 0.25f, projectile.velocity.Y * 0.25f, 0, new Color(255, 255, 255), 0.7f); + } + projectile.frameCounter++; + if (projectile.frameCounter > 3) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame > 3) + { + projectile.frame = 0; + } + projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) - 1.57f; + projectile.alpha -= 6; + projectile.ai[1] += 1f; + if (projectile.ai[1] <= 20f) + { + projectile.velocity.X *= 0.975f; + projectile.velocity.Y *= 0.975f; + } + else if (projectile.ai[1] > 20f && projectile.ai[1] <= 39f) + { + projectile.velocity.X *= 1.05f; + projectile.velocity.Y *= 1.05f; + } + else if (projectile.ai[1] == 40f) + { + projectile.ai[1] = 0f; + } + projectile.localAI[0] += 1f; + if (projectile.localAI[0] == 30f) + { + projectile.localAI[0] = 0f; + for (int l = 0; l < 12; l++) + { + Vector2 vector3 = Vector2.UnitX * (float)(-(float)projectile.width) / 2f; + vector3 += -Vector2.UnitY.RotatedBy((double)((float)l * 3.14159274f / 6f), default(Vector2)) * new Vector2(8f, 16f); + vector3 = vector3.RotatedBy((double)(projectile.rotation - 1.57079637f), default(Vector2)); + int num9 = Dust.NewDust(projectile.Center, 0, 0, 92, 0f, 0f, 160, default(Color), 1f); + Main.dust[num9].scale = 1.1f; + Main.dust[num9].noGravity = true; + Main.dust[num9].position = projectile.Center + vector3; + Main.dust[num9].velocity = projectile.velocity * 0.1f; + Main.dust[num9].velocity = Vector2.Normalize(projectile.Center - projectile.velocity * 3f - Main.dust[num9].position) * 1.25f; + } + } + } + + public override Color? GetAlpha(Color lightColor) + { + return new Color(255, 255, 255); + } + } +} \ No newline at end of file diff --git a/Projectiles/SunkenSea/PearlBurst.png b/Projectiles/SunkenSea/PearlBurst.png new file mode 100644 index 0000000000..075c983ece Binary files /dev/null and b/Projectiles/SunkenSea/PearlBurst.png differ diff --git a/Projectiles/SunkenSea/PearlRain.cs b/Projectiles/SunkenSea/PearlRain.cs new file mode 100644 index 0000000000..7445bd1e2d --- /dev/null +++ b/Projectiles/SunkenSea/PearlRain.cs @@ -0,0 +1,56 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.SunkenSea +{ + public class PearlRain : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Pearl Rain"); + Main.projFrames[projectile.type] = 4; + } + + public override void SetDefaults() + { + projectile.width = 40; + projectile.height = 64; + projectile.hostile = true; + projectile.penetrate = -1; + projectile.alpha = 255; + projectile.timeLeft = 300; + projectile.ignoreWater = true; + projectile.tileCollide = false; + } + + public override void AI() + { + Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0f) / 255f, ((255 - projectile.alpha) * 0.5f) / 255f, ((255 - projectile.alpha) * 0.5f) / 255f); + if (Main.rand.Next(5) == 0) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 92, projectile.velocity.X * 0.25f, projectile.velocity.Y * 0.25f, 0, new Color(255, 255, 255), 0.7f); + } + projectile.frameCounter++; + if (projectile.frameCounter > 3) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame > 3) + { + projectile.frame = 0; + } + projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) - 1.57f; + projectile.alpha -= 6; + } + + public override Color? GetAlpha(Color lightColor) + { + return new Color(255, 255, 255); + } + } +} \ No newline at end of file diff --git a/Projectiles/SunkenSea/PearlRain.png b/Projectiles/SunkenSea/PearlRain.png new file mode 100644 index 0000000000..075c983ece Binary files /dev/null and b/Projectiles/SunkenSea/PearlRain.png differ diff --git a/Projectiles/SunkenSea/PendantProjectile1.cs b/Projectiles/SunkenSea/PendantProjectile1.cs new file mode 100644 index 0000000000..c7419f821b --- /dev/null +++ b/Projectiles/SunkenSea/PendantProjectile1.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.SunkenSea +{ + public class PendantProjectile1 : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Prism Shard"); + } + + public override void SetDefaults() + { + projectile.width = 10; + projectile.height = 16; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.timeLeft = 600; + projectile.penetrate = 1; + projectile.magic = true; + } + + public override void AI() + { + Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0f) / 255f, ((255 - projectile.alpha) * 0.35f) / 255f, ((255 - projectile.alpha) * 0.35f) / 255f); + projectile.rotation += projectile.velocity.X * 1.25f; + for (int num457 = 0; num457 < 5; num457++) + { + int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 187, 0f, 0f, 100, default(Color), 0.6f); + Main.dust[num458].noGravity = true; + Main.dust[num458].velocity *= 0.5f; + Main.dust[num458].velocity += projectile.velocity * 0.1f; + } + return; + } + } +} \ No newline at end of file diff --git a/Projectiles/SunkenSea/PendantProjectile1.png b/Projectiles/SunkenSea/PendantProjectile1.png new file mode 100644 index 0000000000..4575a9239f Binary files /dev/null and b/Projectiles/SunkenSea/PendantProjectile1.png differ diff --git a/Projectiles/SunkenSea/PendantProjectile2.cs b/Projectiles/SunkenSea/PendantProjectile2.cs new file mode 100644 index 0000000000..5490451b87 --- /dev/null +++ b/Projectiles/SunkenSea/PendantProjectile2.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.SunkenSea +{ + public class PendantProjectile2 : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Prism Shard"); + } + + public override void SetDefaults() + { + projectile.width = 10; + projectile.height = 16; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.timeLeft = 600; + projectile.penetrate = 1; + projectile.magic = true; + } + + public override void AI() + { + Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0f) / 255f, ((255 - projectile.alpha) * 0.35f) / 255f, ((255 - projectile.alpha) * 0.35f) / 255f); + projectile.rotation += projectile.velocity.X * 1.25f; + for (int num457 = 0; num457 < 5; num457++) + { + int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 187, 0f, 0f, 100, default(Color), 0.6f); + Main.dust[num458].noGravity = true; + Main.dust[num458].velocity *= 0.5f; + Main.dust[num458].velocity += projectile.velocity * 0.1f; + } + return; + } + } +} \ No newline at end of file diff --git a/Projectiles/SunkenSea/PendantProjectile2.png b/Projectiles/SunkenSea/PendantProjectile2.png new file mode 100644 index 0000000000..6a547a5884 Binary files /dev/null and b/Projectiles/SunkenSea/PendantProjectile2.png differ diff --git a/Projectiles/SunkenSea/PendantProjectile3.cs b/Projectiles/SunkenSea/PendantProjectile3.cs new file mode 100644 index 0000000000..fb7af97c41 --- /dev/null +++ b/Projectiles/SunkenSea/PendantProjectile3.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.SunkenSea +{ + public class PendantProjectile3 : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Prism Shard"); + } + + public override void SetDefaults() + { + projectile.width = 14; + projectile.height = 26; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.timeLeft = 600; + projectile.penetrate = 1; + projectile.magic = true; + } + + public override void AI() + { + Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0f) / 255f, ((255 - projectile.alpha) * 0.35f) / 255f, ((255 - projectile.alpha) * 0.35f) / 255f); + projectile.rotation += projectile.velocity.X * 1.25f; + for (int num457 = 0; num457 < 5; num457++) + { + int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 187, 0f, 0f, 100, default(Color), 0.6f); + Main.dust[num458].noGravity = true; + Main.dust[num458].velocity *= 0.5f; + Main.dust[num458].velocity += projectile.velocity * 0.1f; + } + return; + } + } +} \ No newline at end of file diff --git a/Projectiles/SunkenSea/PendantProjectile3.png b/Projectiles/SunkenSea/PendantProjectile3.png new file mode 100644 index 0000000000..f9ca3762ce Binary files /dev/null and b/Projectiles/SunkenSea/PendantProjectile3.png differ diff --git a/Projectiles/SunkenSea/PoseidonTyphoon.cs b/Projectiles/SunkenSea/PoseidonTyphoon.cs new file mode 100644 index 0000000000..854681c8e6 --- /dev/null +++ b/Projectiles/SunkenSea/PoseidonTyphoon.cs @@ -0,0 +1,102 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework.Graphics; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.SunkenSea +{ + public class PoseidonTyphoon : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Poseidon Typhoon"); + } + + public override void SetDefaults() + { + projectile.width = 30; + projectile.height = 30; + projectile.friendly = true; + projectile.magic = true; + projectile.penetrate = 10; + projectile.timeLeft = 300; + projectile.tileCollide = true; + projectile.ignoreWater = true; + } + + public override void AI() + { + projectile.rotation += projectile.velocity.X * 0.05f; + float centerX = projectile.Center.X; + float centerY = projectile.Center.Y; + float num474 = 600f; + bool homeIn = false; + for (int i = 0; i < 200; i++) + { + if (Main.npc[i].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[i].Center, 1, 1)) + { + float num476 = Main.npc[i].position.X + (float)(Main.npc[i].width / 2); + float num477 = Main.npc[i].position.Y + (float)(Main.npc[i].height / 2); + float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477); + if (num478 < num474) + { + num474 = num478; + centerX = num476; + centerY = num477; + homeIn = true; + } + } + } + if (homeIn) + { + float num483 = 6f; + Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + float num484 = centerX - vector35.X; + float num485 = centerY - vector35.Y; + float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485)); + num486 = num483 / num486; + num484 *= num486; + num485 *= num486; + projectile.velocity.X = (projectile.velocity.X * 30f + num484) / 31f; + projectile.velocity.Y = (projectile.velocity.Y * 30f + num485) / 31f; + return; + } + } + + public override void Kill(int timeLeft) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 10); + } + + public override Color? GetAlpha(Color lightColor) + { + return new Color(200, 200, 200, 0); + } + + public override bool OnTileCollide(Vector2 oldVelocity) + { + projectile.penetrate--; + if (projectile.penetrate <= 0) + { + projectile.Kill(); + } + else + { + projectile.ai[0] += 0.1f; + if (projectile.velocity.X != oldVelocity.X) + { + projectile.velocity.X = -oldVelocity.X; + } + if (projectile.velocity.Y != oldVelocity.Y) + { + projectile.velocity.Y = -oldVelocity.Y; + } + } + return false; + } + } +} \ No newline at end of file diff --git a/Projectiles/SunkenSea/PoseidonTyphoon.png b/Projectiles/SunkenSea/PoseidonTyphoon.png new file mode 100644 index 0000000000..41fbfafb65 Binary files /dev/null and b/Projectiles/SunkenSea/PoseidonTyphoon.png differ diff --git a/Projectiles/SunkenSea/Prismalline.cs b/Projectiles/SunkenSea/Prismalline.cs new file mode 100644 index 0000000000..fd1525c2fe --- /dev/null +++ b/Projectiles/SunkenSea/Prismalline.cs @@ -0,0 +1,91 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.SunkenSea +{ + public class Prismalline : ModProjectile + { + public bool hitEnemy = false; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Prismalline"); + } + + public override void SetDefaults() + { + projectile.width = 20; + projectile.height = 20; + projectile.friendly = true; + projectile.penetrate = 2; + projectile.aiStyle = 113; + projectile.timeLeft = 180; + aiType = 598; + projectile.GetGlobalProjectile(mod).rogue = true; + } + + public override void AI() + { + projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 2.355f; + if (projectile.spriteDirection == -1) + { + projectile.rotation -= 1.57f; + } + projectile.ai[1] += 1f; + if (projectile.ai[1] == 40f) + { + int numProj = 4; + int numSpecProj = 0; + float rotation = MathHelper.ToRadians(50); + if (projectile.owner == Main.myPlayer) + { + for (int i = 0; i < numProj + 1; i++) + { + Vector2 speed = new Vector2((float)Main.rand.Next(-50, 51), (float)Main.rand.Next(-50, 51)); + while (speed.X == 0f && speed.Y == 0f) + { + speed = new Vector2((float)Main.rand.Next(-50, 51), (float)Main.rand.Next(-50, 51)); + } + speed.Normalize(); + speed *= ((float)Main.rand.Next(30, 61) * 0.1f) * 2f; + if (numSpecProj < 2 && !hitEnemy) + { + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, speed.X, speed.Y, mod.ProjectileType("Prismalline3"), (int)((double)projectile.damage * 1.25), projectile.knockBack, projectile.owner, 0f, 0f); + ++numSpecProj; + } + else + { + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, speed.X, speed.Y, mod.ProjectileType("Prismalline2"), (int)((double)projectile.damage * 0.75), projectile.knockBack, projectile.owner, 0f, 0f); + } + } + } + } + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D tex = Main.projectileTexture[projectile.type]; + spriteBatch.Draw(tex, projectile.Center - Main.screenPosition, null, projectile.GetAlpha(lightColor), projectile.rotation, tex.Size() / 2f, projectile.scale, SpriteEffects.None, 0f); + return false; + } + + public override void Kill(int timeLeft) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 27); + for (int k = 0; k < 5; k++) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 154, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); + } + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + hitEnemy = true; + } + } +} \ No newline at end of file diff --git a/Projectiles/SunkenSea/Prismalline.png b/Projectiles/SunkenSea/Prismalline.png new file mode 100644 index 0000000000..91fbee0144 Binary files /dev/null and b/Projectiles/SunkenSea/Prismalline.png differ diff --git a/Projectiles/SunkenSea/Prismalline2.cs b/Projectiles/SunkenSea/Prismalline2.cs new file mode 100644 index 0000000000..e35da0d5c8 --- /dev/null +++ b/Projectiles/SunkenSea/Prismalline2.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.SunkenSea +{ + public class Prismalline2 : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Prismalline"); + } + + public override void SetDefaults() + { + projectile.width = 20; + projectile.height = 20; + projectile.friendly = true; + projectile.penetrate = 1; + projectile.aiStyle = 113; + projectile.timeLeft = 60; + aiType = 598; + projectile.GetGlobalProjectile(mod).rogue = true; + } + + public override void AI() + { + projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 2.355f; + if (projectile.spriteDirection == -1) + { + projectile.rotation -= 1.57f; + } + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D tex = Main.projectileTexture[projectile.type]; + spriteBatch.Draw(tex, projectile.Center - Main.screenPosition, null, projectile.GetAlpha(lightColor), projectile.rotation, tex.Size() / 2f, projectile.scale, SpriteEffects.None, 0f); + return false; + } + + public override void Kill(int timeLeft) + { + for (int k = 0; k < 5; k++) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 154, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); + } + } + } +} \ No newline at end of file diff --git a/Projectiles/SunkenSea/Prismalline2.png b/Projectiles/SunkenSea/Prismalline2.png new file mode 100644 index 0000000000..91fbee0144 Binary files /dev/null and b/Projectiles/SunkenSea/Prismalline2.png differ diff --git a/Projectiles/SunkenSea/Prismalline3.cs b/Projectiles/SunkenSea/Prismalline3.cs new file mode 100644 index 0000000000..a9735c927a --- /dev/null +++ b/Projectiles/SunkenSea/Prismalline3.cs @@ -0,0 +1,86 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.SunkenSea +{ + public class Prismalline3 : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Prismalline"); + } + + public override void SetDefaults() + { + projectile.width = 20; + projectile.height = 20; + projectile.friendly = true; + projectile.penetrate = 1; + projectile.timeLeft = 180; + projectile.GetGlobalProjectile(mod).rogue = true; + } + + public override void AI() + { + projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 2.355f; + if (projectile.spriteDirection == -1) + { + projectile.rotation -= 1.57f; + } + float centerX = projectile.Center.X; + float centerY = projectile.Center.Y; + float num474 = 300f; + bool homeIn = false; + for (int num475 = 0; num475 < 200; num475++) + { + if (Main.npc[num475].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1)) + { + float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2); + float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2); + float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477); + if (num478 < num474) + { + num474 = num478; + centerX = num476; + centerY = num477; + homeIn = true; + } + } + } + if (homeIn) + { + float num483 = 25f; + Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + float num484 = centerX - vector35.X; + float num485 = centerY - vector35.Y; + float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485)); + num486 = num483 / num486; + num484 *= num486; + num485 *= num486; + projectile.velocity.X = (projectile.velocity.X * 20f + num484) / 21f; + projectile.velocity.Y = (projectile.velocity.Y * 20f + num485) / 21f; + return; + } + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D tex = Main.projectileTexture[projectile.type]; + spriteBatch.Draw(tex, projectile.Center - Main.screenPosition, null, projectile.GetAlpha(lightColor), projectile.rotation, tex.Size() / 2f, projectile.scale, SpriteEffects.None, 0f); + return false; + } + + public override void Kill(int timeLeft) + { + for (int k = 0; k < 5; k++) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 154, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); + } + } + } +} \ No newline at end of file diff --git a/Projectiles/SunkenSea/Prismalline3.png b/Projectiles/SunkenSea/Prismalline3.png new file mode 100644 index 0000000000..91fbee0144 Binary files /dev/null and b/Projectiles/SunkenSea/Prismalline3.png differ diff --git a/Projectiles/SunkenSea/SeafoamBomb.cs b/Projectiles/SunkenSea/SeafoamBomb.cs new file mode 100644 index 0000000000..3c12ecc2bc --- /dev/null +++ b/Projectiles/SunkenSea/SeafoamBomb.cs @@ -0,0 +1,76 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.SunkenSea +{ + public class SeafoamBomb : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Seafoam Bomb"); + } + + public override void SetDefaults() + { + projectile.width = 14; + projectile.height = 20; + projectile.friendly = true; + projectile.penetrate = 1; + projectile.timeLeft = 240; + projectile.GetGlobalProjectile(mod).rogue = true; + } + + public override void AI() + { + projectile.rotation += projectile.velocity.X * 0.1f; + projectile.velocity.Y = projectile.velocity.Y + 0.15f; + projectile.velocity.X = projectile.velocity.X * 0.99f; + } + + public override void Kill(int timeLeft) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, mod.ProjectileType("SeafoamBubble"), (int)((double)projectile.damage * 0.5), 0f, projectile.owner, 0f, 0f); + for (int num625 = 0; num625 < 3; num625++) + { + float scaleFactor10 = 0.33f; + if (num625 == 1) + { + scaleFactor10 = 0.66f; + } + if (num625 == 2) + { + scaleFactor10 = 1f; + } + int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num626].velocity *= scaleFactor10; + Gore expr_13AB6_cp_0 = Main.gore[num626]; + expr_13AB6_cp_0.velocity.X = expr_13AB6_cp_0.velocity.X + 1f; + Gore expr_13AD6_cp_0 = Main.gore[num626]; + expr_13AD6_cp_0.velocity.Y = expr_13AD6_cp_0.velocity.Y + 1f; + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num626].velocity *= scaleFactor10; + Gore expr_13B79_cp_0 = Main.gore[num626]; + expr_13B79_cp_0.velocity.X = expr_13B79_cp_0.velocity.X - 1f; + Gore expr_13B99_cp_0 = Main.gore[num626]; + expr_13B99_cp_0.velocity.Y = expr_13B99_cp_0.velocity.Y + 1f; + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num626].velocity *= scaleFactor10; + Gore expr_13C3C_cp_0 = Main.gore[num626]; + expr_13C3C_cp_0.velocity.X = expr_13C3C_cp_0.velocity.X + 1f; + Gore expr_13C5C_cp_0 = Main.gore[num626]; + expr_13C5C_cp_0.velocity.Y = expr_13C5C_cp_0.velocity.Y - 1f; + } + projectile.width = 128; + projectile.height = 128; + projectile.position.X = projectile.position.X - (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + projectile.Damage(); + } + } +} \ No newline at end of file diff --git a/Projectiles/SunkenSea/SeafoamBomb.png b/Projectiles/SunkenSea/SeafoamBomb.png new file mode 100644 index 0000000000..128c4f76bb Binary files /dev/null and b/Projectiles/SunkenSea/SeafoamBomb.png differ diff --git a/Projectiles/SunkenSea/SeafoamBubble.cs b/Projectiles/SunkenSea/SeafoamBubble.cs new file mode 100644 index 0000000000..75c086c4e9 --- /dev/null +++ b/Projectiles/SunkenSea/SeafoamBubble.cs @@ -0,0 +1,71 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.SunkenSea +{ + public class SeafoamBubble : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Seafoam Bubble"); + } + + public override void SetDefaults() + { + projectile.width = 28; + projectile.height = 28; + projectile.friendly = true; + projectile.penetrate = -1; + projectile.timeLeft = 180; + projectile.tileCollide = false; + projectile.alpha = 255; + projectile.scale = 1f; + projectile.localNPCHitCooldown = 30; + projectile.GetGlobalProjectile(mod).rogue = true; + } + + public override void AI() + { + projectile.ai[0] += 1f; + if(projectile.alpha < 50) + { + projectile.alpha = 50; + } + else if(projectile.alpha > 50) + { + projectile.alpha -= 10; + } + projectile.scale += 0.002f; + if( projectile.ai[0] % 60 == 0) + { + projectile.damage *= 2; + } + } + + public override void Kill(int timeLeft) + { + Main.PlaySound(SoundID.Item54, projectile.position); + projectile.position = projectile.Center; + projectile.width = (projectile.height = 60); + projectile.position.X = projectile.position.X - (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + int num3; + for (int num246 = 0; num246 < 25; num246 = num3 + 1) + { + int num247 = Dust.NewDust(projectile.Center, projectile.width, projectile.height, 154, 0f, 0f, 0, default(Color), 1f); + Main.dust[num247].position = (Main.dust[num247].position + projectile.position) / 2f; + Main.dust[num247].velocity = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Main.dust[num247].velocity.Normalize(); + Dust dust = Main.dust[num247]; + dust.velocity *= (float)Main.rand.Next(1, 30) * 0.1f; + Main.dust[num247].alpha = projectile.alpha; + num3 = num246; + } + } + } +} \ No newline at end of file diff --git a/Projectiles/SunkenSea/SeafoamBubble.png b/Projectiles/SunkenSea/SeafoamBubble.png new file mode 100644 index 0000000000..e3e51784ba Binary files /dev/null and b/Projectiles/SunkenSea/SeafoamBubble.png differ diff --git a/Projectiles/SunkenSea/SeashineSwordProj.cs b/Projectiles/SunkenSea/SeashineSwordProj.cs new file mode 100644 index 0000000000..afb5cc2a31 --- /dev/null +++ b/Projectiles/SunkenSea/SeashineSwordProj.cs @@ -0,0 +1,49 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.Graphics.Shaders; +using Terraria.GameContent.Achievements; +using Microsoft.Xna.Framework.Graphics; + +namespace CalamityMod.Projectiles.SunkenSea +{ + class SeashineSwordProj : ModProjectile + { + public override void SetDefaults() + { + projectile.width = 20; + projectile.height = 20; + projectile.aiStyle = 27; + projectile.friendly = true; + projectile.penetrate = 1; + projectile.tileCollide = true; + projectile.melee = true; + } + + public override Color? GetAlpha(Color lightColor) + { + return new Color(127, 255, 253); + } + + public override void AI() + { + Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0f) / 255f, ((255 - projectile.alpha) * 0.25f) / 255f, ((255 - projectile.alpha) * 0.25f) / 255f); + if (Main.rand.Next(2) == 0) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 187, projectile.velocity.X * 0.25f, projectile.velocity.Y * 0.25f, 0, new Color(255, 255, 255), 1.2f); + } + } + + public override void Kill(int timeLeft) + { + Main.PlaySound(SoundID.Item10, projectile.position); + for (int k = 0; k < 5; k++) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 187, projectile.oldVelocity.X, projectile.oldVelocity.Y, 0, new Color(255, 255, 255), 1.5f); + } + } + } +} diff --git a/Projectiles/SunkenSea/SeashineSwordProj.png b/Projectiles/SunkenSea/SeashineSwordProj.png new file mode 100644 index 0000000000..6cf9a23667 Binary files /dev/null and b/Projectiles/SunkenSea/SeashineSwordProj.png differ diff --git a/Projectiles/SunkenSea/SerpentineBody.cs b/Projectiles/SunkenSea/SerpentineBody.cs new file mode 100644 index 0000000000..91d7abfdcd --- /dev/null +++ b/Projectiles/SunkenSea/SerpentineBody.cs @@ -0,0 +1,99 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.SunkenSea +{ + public class SerpentineBody : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Serpentine"); + } + + public override void SetDefaults() + { + projectile.width = 14; + projectile.height = 16; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.netImportant = true; + projectile.tileCollide = false; + projectile.alpha = 255; + projectile.penetrate = -1; + projectile.magic = true; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 20; + } + + public override void AI() + { + Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0f) / 255f, ((255 - projectile.alpha) * 0.55f) / 255f, ((255 - projectile.alpha) * 0.55f) / 255f); + int num1051 = 10; + Vector2 value68 = Vector2.Zero; + float num1064 = 0f; + float scaleFactor17 = 0f; + float scaleFactor18 = 1f; + if (projectile.ai[1] == 1f) + { + projectile.ai[1] = 0f; + projectile.netUpdate = true; + } + int chase = (int)projectile.ai[0]; + if (chase >= 0 && Main.projectile[chase].active) + { + value68 = Main.projectile[chase].Center; + Vector2 arg_2DE6A_0 = Main.projectile[chase].velocity; + num1064 = Main.projectile[chase].rotation; + scaleFactor18 = MathHelper.Clamp(Main.projectile[chase].scale, 0f, 50f); + scaleFactor17 = 16f; + Main.projectile[chase].localAI[0] = projectile.localAI[0] + 1f; + } + else + { + for (int k = 0; k < 8; k++) + { + int num114 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 68, 0f, 0f, 100, default(Color), 1.25f); + Dust dust = Main.dust[num114]; + dust.velocity *= 0.3f; + Main.dust[num114].position.X = projectile.position.X + (float)(projectile.width / 2) + 4f + (float)Main.rand.Next(-4, 5); + Main.dust[num114].position.Y = projectile.position.Y + (float)(projectile.height / 2) + (float)Main.rand.Next(-4, 5); + Main.dust[num114].noGravity = true; + } + projectile.active = false; + projectile.Kill(); + return; + } + if (projectile.alpha > 0) + { + projectile.alpha -= 40; + } + if (projectile.alpha < 0) + { + projectile.alpha = 0; + } + projectile.velocity = Vector2.Zero; + Vector2 vector134 = value68 - projectile.Center; + if (num1064 != projectile.rotation) + { + float num1068 = MathHelper.WrapAngle(num1064 - projectile.rotation); + vector134 = vector134.RotatedBy((double)(num1068 * 0.1f), default(Vector2)); + } + projectile.rotation = vector134.ToRotation() + 1.57079637f; + projectile.position = projectile.Center; + projectile.scale = scaleFactor18; + projectile.width = (projectile.height = (int)((float)num1051 * projectile.scale)); + projectile.Center = projectile.position; + if (vector134 != Vector2.Zero) + { + projectile.Center = value68 - Vector2.Normalize(vector134) * scaleFactor17 * scaleFactor18; + } + projectile.spriteDirection = ((vector134.X > 0f) ? 1 : -1); + return; + } + } +} \ No newline at end of file diff --git a/Projectiles/SunkenSea/SerpentineBody.png b/Projectiles/SunkenSea/SerpentineBody.png new file mode 100644 index 0000000000..0611fac64d Binary files /dev/null and b/Projectiles/SunkenSea/SerpentineBody.png differ diff --git a/Projectiles/SunkenSea/SerpentineHead.cs b/Projectiles/SunkenSea/SerpentineHead.cs new file mode 100644 index 0000000000..0efb545a7d --- /dev/null +++ b/Projectiles/SunkenSea/SerpentineHead.cs @@ -0,0 +1,176 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.SunkenSea +{ + public class SerpentineHead : ModProjectile + { + + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Serpentine"); + } + + public override void SetDefaults() + { + projectile.width = 14; + projectile.height = 16; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.netImportant = true; + projectile.penetrate = 5; + projectile.timeLeft = 600; + projectile.magic = true; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 20; + } + + public override void AI() + { + Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0f) / 255f, ((255 - projectile.alpha) * 0.55f) / 255f, ((255 - projectile.alpha) * 0.55f) / 255f); + if (projectile.alpha > 0) + { + projectile.alpha -= 40; + } + if (projectile.alpha < 0) + { + projectile.alpha = 0; + } + int num114 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 68, 0f, 0f, 100, default(Color), 1.25f); + Dust dust = Main.dust[num114]; + dust.velocity *= 0.3f; + Main.dust[num114].position.X = projectile.position.X + (float)(projectile.width / 2) + 4f + (float)Main.rand.Next(-4, 5); + Main.dust[num114].position.Y = projectile.position.Y + (float)(projectile.height / 2) + (float)Main.rand.Next(-4, 5); + Main.dust[num114].noGravity = true; + projectile.rotation = projectile.velocity.ToRotation() + 1.57079637f; + int direction = projectile.direction; + projectile.direction = (projectile.spriteDirection = ((projectile.velocity.X > 0f) ? 1 : -1)); + if (direction != projectile.direction) + { + projectile.netUpdate = true; + } + float num1061 = MathHelper.Clamp(projectile.localAI[0], 0f, 50f); + projectile.position = projectile.Center; + projectile.scale = 1f + num1061 * 0.01f; + projectile.width = (projectile.height = (int)(10 * projectile.scale)); + projectile.Center = projectile.position; + + projectile.ai[0] += 1f; + if (projectile.ai[0] >= 20f && projectile.ai[0] < 40f) + { + projectile.velocity.Y = projectile.velocity.Y + 0.3f; + } + else if (projectile.ai[0] >= 40f && projectile.ai[0] < 60f) + { + projectile.velocity.Y = projectile.velocity.Y - 0.3f; + } + else if (projectile.ai[0] >= 60f) + { + projectile.ai[0] = 0f; + } + if (Main.myPlayer == projectile.owner && projectile.ai[0] <= 0f) + { + if (Main.player[projectile.owner].channel) + { + float num115 = 18f; + Vector2 vector10 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + float num116 = (float)Main.mouseX + Main.screenPosition.X - vector10.X; + float num117 = (float)Main.mouseY + Main.screenPosition.Y - vector10.Y; + if (Main.player[projectile.owner].gravDir == -1f) + { + num117 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector10.Y; + } + float num118 = (float)Math.Sqrt((double)(num116 * num116 + num117 * num117)); + num118 = (float)Math.Sqrt((double)(num116 * num116 + num117 * num117)); + if (num118 > num115) + { + num118 = num115 / num118; + num116 *= num118; + num117 *= num118; + int num119 = (int)(num116 * 1000f); + int num120 = (int)(projectile.velocity.X * 1000f); + int num121 = (int)(num117 * 1000f); + int num122 = (int)(projectile.velocity.Y * 1000f); + if (num119 != num120 || num121 != num122) + { + projectile.netUpdate = true; + } + projectile.velocity.X = num116; + projectile.velocity.Y = num117; + } + else + { + int num123 = (int)(num116 * 1000f); + int num124 = (int)(projectile.velocity.X * 1000f); + int num125 = (int)(num117 * 1000f); + int num126 = (int)(projectile.velocity.Y * 1000f); + if (num123 != num124 || num125 != num126) + { + projectile.netUpdate = true; + } + projectile.velocity.X = num116; + projectile.velocity.Y = num117; + } + } + else if (projectile.ai[0] <= 0f) + { + projectile.netUpdate = true; + float num127 = 12f; + Vector2 vector11 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + float num128 = (float)Main.mouseX + Main.screenPosition.X - vector11.X; + float num129 = (float)Main.mouseY + Main.screenPosition.Y - vector11.Y; + if (Main.player[projectile.owner].gravDir == -1f) + { + num129 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector11.Y; + } + float num130 = (float)Math.Sqrt((double)(num128 * num128 + num129 * num129)); + if (num130 == 0f || projectile.ai[0] < 0f) + { + vector11 = new Vector2(Main.player[projectile.owner].position.X + (float)(Main.player[projectile.owner].width / 2), Main.player[projectile.owner].position.Y + (float)(Main.player[projectile.owner].height / 2)); + num128 = projectile.position.X + (float)projectile.width * 0.5f - vector11.X; + num129 = projectile.position.Y + (float)projectile.height * 0.5f - vector11.Y; + num130 = (float)Math.Sqrt((double)(num128 * num128 + num129 * num129)); + } + num130 = num127 / num130; + num128 *= num130; + num129 *= num130; + projectile.velocity.X = num128; + projectile.velocity.Y = num129; + if (projectile.velocity.X == 0f && projectile.velocity.Y == 0f) + { + projectile.Kill(); + } + projectile.ai[0] = 1f; + } + } + if (projectile.velocity.X != 0f || projectile.velocity.Y != 0f) + { + projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; + } + if (projectile.velocity.Y > 16f) + { + projectile.velocity.Y = 16f; + } + } + + public override void Kill(int timeLeft) + { + Main.PlaySound(SoundID.Item10, projectile.position); + for (int k = 0; k < 8; k++) + { + int num114 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 68, 0f, 0f, 100, default(Color), 1.25f); + Dust dust = Main.dust[num114]; + dust.velocity *= 0.3f; + Main.dust[num114].position.X = projectile.position.X + (float)(projectile.width / 2) + 4f + (float)Main.rand.Next(-4, 5); + Main.dust[num114].position.Y = projectile.position.Y + (float)(projectile.height / 2) + (float)Main.rand.Next(-4, 5); + Main.dust[num114].noGravity = true; + } + } + } +} diff --git a/Projectiles/SunkenSea/SerpentineHead.png b/Projectiles/SunkenSea/SerpentineHead.png new file mode 100644 index 0000000000..eadae1c932 Binary files /dev/null and b/Projectiles/SunkenSea/SerpentineHead.png differ diff --git a/Projectiles/SunkenSea/SerpentineTail.cs b/Projectiles/SunkenSea/SerpentineTail.cs new file mode 100644 index 0000000000..934df204fa --- /dev/null +++ b/Projectiles/SunkenSea/SerpentineTail.cs @@ -0,0 +1,99 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.SunkenSea +{ + public class SerpentineTail : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Serpentine"); + } + + public override void SetDefaults() + { + projectile.width = 14; + projectile.height = 20; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.netImportant = true; + projectile.tileCollide = false; + projectile.alpha = 255; + projectile.penetrate = -1; + projectile.magic = true; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 20; + } + + public override void AI() + { + Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0f) / 255f, ((255 - projectile.alpha) * 0.25f) / 255f, ((255 - projectile.alpha) * 0.25f) / 255f); + int num1051 = 10; + Vector2 value68 = Vector2.Zero; + float num1064 = 0f; + float scaleFactor17 = 0f; + float scaleFactor18 = 1f; + if (projectile.ai[1] == 1f) + { + projectile.ai[1] = 0f; + projectile.netUpdate = true; + } + int chase = (int)projectile.ai[0]; + if (chase >= 0 && Main.projectile[chase].active) + { + value68 = Main.projectile[chase].Center; + Vector2 arg_2DE6A_0 = Main.projectile[chase].velocity; + num1064 = Main.projectile[chase].rotation; + scaleFactor18 = MathHelper.Clamp(Main.projectile[chase].scale, 0f, 50f); + scaleFactor17 = 16f; + Main.projectile[chase].localAI[0] = projectile.localAI[0] + 1f; + } + else + { + for (int k = 0; k < 8; k++) + { + int num114 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 68, 0f, 0f, 100, default(Color), 1.25f); + Dust dust = Main.dust[num114]; + dust.velocity *= 0.3f; + Main.dust[num114].position.X = projectile.position.X + (float)(projectile.width / 2) + 4f + (float)Main.rand.Next(-4, 5); + Main.dust[num114].position.Y = projectile.position.Y + (float)(projectile.height / 2) + (float)Main.rand.Next(-4, 5); + Main.dust[num114].noGravity = true; + } + projectile.active = false; + projectile.Kill(); + return; + } + if (projectile.alpha > 0) + { + projectile.alpha -= 40; + } + if (projectile.alpha < 0) + { + projectile.alpha = 0; + } + projectile.velocity = Vector2.Zero; + Vector2 vector134 = value68 - projectile.Center; + if (num1064 != projectile.rotation) + { + float num1068 = MathHelper.WrapAngle(num1064 - projectile.rotation); + vector134 = vector134.RotatedBy((double)(num1068 * 0.1f), default(Vector2)); + } + projectile.rotation = vector134.ToRotation() + 1.57079637f; + projectile.position = projectile.Center; + projectile.scale = scaleFactor18; + projectile.width = (projectile.height = (int)((float)num1051 * projectile.scale)); + projectile.Center = projectile.position; + if (vector134 != Vector2.Zero) + { + projectile.Center = value68 - Vector2.Normalize(vector134) * scaleFactor17 * scaleFactor18; + } + projectile.spriteDirection = ((vector134.X > 0f) ? 1 : -1); + return; + } + } +} \ No newline at end of file diff --git a/Projectiles/SunkenSea/SerpentineTail.png b/Projectiles/SunkenSea/SerpentineTail.png new file mode 100644 index 0000000000..2db39a20a5 Binary files /dev/null and b/Projectiles/SunkenSea/SerpentineTail.png differ diff --git a/Projectiles/SunkenSea/Shellfish.cs b/Projectiles/SunkenSea/Shellfish.cs new file mode 100644 index 0000000000..954d3b9f1c --- /dev/null +++ b/Projectiles/SunkenSea/Shellfish.cs @@ -0,0 +1,480 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.SunkenSea +{ + public class Shellfish : ModProjectile + { + private int playerStill = 0; + private bool fly = false; + private bool spawnDust = true; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Shellfish"); + Main.projFrames[projectile.type] = 2; + ProjectileID.Sets.MinionSacrificable[projectile.type] = true; + ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true; + } + + public override void SetDefaults() + { + projectile.width = 28; + projectile.height = 24; + projectile.netImportant = true; + projectile.friendly = true; + projectile.minionSlots = 2; + projectile.timeLeft = 18000; + projectile.penetrate = -1; + projectile.timeLeft *= 5; + projectile.minion = true; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 5; + } + + public override bool TileCollideStyle(ref int width, ref int height, ref bool fallThrough) + { + fallThrough = false; + return true; + } + + public override void AI() + { + if (spawnDust) + { + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue = projectile.damage; + int num501 = 20; + for (int num502 = 0; num502 < num501; num502++) + { + int num503 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 16f), projectile.width, projectile.height - 16, 33, 0f, 0f, 0, default(Color), 1f); + Main.dust[num503].velocity *= 2f; + Main.dust[num503].scale *= 1.15f; + } + spawnDust = false; + } + if (Main.player[projectile.owner].minionDamage != projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) + { + int damage2 = (int)(((float)projectile.GetGlobalProjectile(mod).spawnedPlayerMinionProjectileDamageValue / + projectile.GetGlobalProjectile(mod).spawnedPlayerMinionDamageValue) * + Main.player[projectile.owner].minionDamage); + projectile.damage = damage2; + } + bool flag64 = projectile.type == mod.ProjectileType("Shellfish"); + Player player = Main.player[projectile.owner]; + CalamityPlayer modPlayer = player.GetModPlayer(mod); + player.AddBuff(mod.BuffType("Shellfish"), 3600); + if (flag64) + { + if (player.dead) + { + modPlayer.shellfish = false; + } + if (modPlayer.shellfish) + { + projectile.timeLeft = 2; + } + } + projectile.frameCounter++; + if (projectile.frameCounter > 3) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame > 1) + { + projectile.frame = 0; + } + if (projectile.ai[0] == 0f) + { + projectile.damage = 100; + float[] var0 = projectile.ai; + int var1 = 1; + float num73 = var0[var1]; + var0[var1] = num73 + 1f; + Vector2 vector46 = projectile.position; + if (!fly) + { + projectile.tileCollide = true; + Vector2 center2 = projectile.Center; + Vector2 vector48 = player.Center - center2; + float playerDistance = vector48.Length(); + if (projectile.velocity.Y == 0f && (projectile.velocity.X != 0f || playerDistance > 200f)) + { + switch (Main.rand.Next(1, 3)) + { + + case 1: + projectile.velocity.Y -= 5f; + break; + + case 2: + projectile.velocity.Y -= 7.5f; + break; + + case 3: + projectile.velocity.Y -= 10f; + break; + } + } + projectile.velocity.Y += 0.3f; + float num633 = 1000f; + bool chaseNPC = false; + float npcPositionX = 0f; + for (int num645 = 0; num645 < 200; num645++) + { + NPC npcTarget = Main.npc[num645]; + if (npcTarget.CanBeChasedBy(projectile, false)) + { + float num646 = Vector2.Distance(npcTarget.Center, projectile.Center); + if (((Vector2.Distance(projectile.Center, vector46) > num646 && num646 < num633) || !chaseNPC)) + { + num633 = num646; + vector46 = npcTarget.Center; + npcPositionX = npcTarget.position.X; + chaseNPC = true; + } + } + } + if (chaseNPC) + { + if (npcPositionX - projectile.position.X > 0f) + { + switch (Main.rand.Next(1, 2)) + { + + case 1: + projectile.velocity.X += 0.15f; + break; + + case 2: + projectile.velocity.X += 0.20f; + break; + } + + if (projectile.velocity.X > 8f) + { + projectile.velocity.X = 8f; + } + } + else + { + switch (Main.rand.Next(1, 2)) + { + + case 1: + projectile.velocity.X -= 0.15f; + break; + + case 2: + projectile.velocity.X -= 0.20f; + break; + } + + if (projectile.velocity.X < -8f) + { + projectile.velocity.X = -8f; + } + } + } + else + { + if (playerDistance > 800f) + { + fly = true; + projectile.velocity.X = 0f; + projectile.velocity.Y = 0f; + projectile.tileCollide = false; + } + if (playerDistance > 200f) + { + if (player.position.X - projectile.position.X > 0f) + { + switch (Main.rand.Next(1, 3)) + { + case 1: + projectile.velocity.X += 0.05f; + break; + + case 2: + projectile.velocity.X += 0.10f; + break; + + case 3: + projectile.velocity.X += 0.15f; + break; + } + + if (projectile.velocity.X > 6f) + { + projectile.velocity.X = 6f; + } + } + else + { + switch (Main.rand.Next(1, 3)) + { + case 1: + projectile.velocity.X -= 0.05f; + break; + + case 2: + projectile.velocity.X -= 0.10f; + break; + + case 3: + projectile.velocity.X -= 0.15f; + break; + } + + if (projectile.velocity.X < -6f) + { + projectile.velocity.X = -6f; + } + } + } + if (playerDistance < 200f) + { + if (projectile.velocity.X != 0f) + { + if (projectile.velocity.X > 0.5f) + { + switch (Main.rand.Next(1, 3)) + { + case 1: + projectile.velocity.X -= 0.05f; + break; + + case 2: + projectile.velocity.X -= 0.10f; + break; + + case 3: + projectile.velocity.X -= 0.15f; + break; + } + } + else if (projectile.velocity.X < -0.5f) + { + switch (Main.rand.Next(1, 3)) + { + case 1: + projectile.velocity.X += 0.05f; + break; + + case 2: + projectile.velocity.X += 0.10f; + break; + + case 3: + projectile.velocity.X += 0.15f; + break; + } + } + else if (projectile.velocity.X < 0.5f && projectile.velocity.X > -0.5f) + { + projectile.velocity.X = 0f; + } + } + } + } + } + else if (fly) + { + Vector2 center2 = projectile.Center; + Vector2 vector48 = player.Center - center2 + new Vector2(0f, 0f); + float playerDistance = vector48.Length(); + vector48.Normalize(); + vector48 *= 14f; + projectile.velocity = (projectile.velocity * 40f + vector48) / 41f; + + projectile.rotation = projectile.velocity.X * 0.03f; + if (playerDistance > 1500f) + { + projectile.position.X = Main.player[projectile.owner].Center.X - (float)(projectile.width / 2); + projectile.position.Y = Main.player[projectile.owner].Center.Y - (float)(projectile.height / 2); + projectile.netUpdate = true; + } + if (playerDistance < 100f) + { + if (player.velocity.Y == 0f) + { + ++playerStill; + } + else + { + playerStill = 0; + } + if (playerStill > 30 && !Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) + { + fly = false; + projectile.tileCollide = true; + projectile.rotation = 0; + projectile.velocity.X *= 0.30f; + projectile.velocity.Y *= 0.30f; + } + } + } + if ((double)projectile.velocity.X > 0.25) + { + projectile.spriteDirection = -1; + } + else if ((double)projectile.velocity.X < -0.25) + { + projectile.spriteDirection = 1; + } + } + if (projectile.ai[0] == 1f) + { + projectile.rotation = 0; + projectile.tileCollide = false; + int num988 = 10; + bool flag54 = false; + bool flag55 = false; + float[] var0 = projectile.localAI; + int var1 = 0; + float num73 = var0[var1]; + var0[var1] = num73 + 1f; + if (projectile.localAI[0] % 30f == 0f) + { + flag55 = true; + } + int num989 = (int)projectile.ai[1]; + if (projectile.localAI[0] >= (float)(60000 * num988)) //tryna make it stay on there "forever" without glitching + { + flag54 = true; + } + else if (num989 < 0 || num989 >= 200) + { + flag54 = true; + } + else if (Main.npc[num989].active && !Main.npc[num989].dontTakeDamage) + { + projectile.Center = Main.npc[num989].Center - projectile.velocity * 2f; + projectile.gfxOffY = Main.npc[num989].gfxOffY; + if (flag55) + { + Main.npc[num989].HitEffect(0, 1.0); + } + } + else + { + flag54 = true; + } + if (flag54) + { + projectile.ai[0] = 0f; + projectile.velocity.X = 0f; + projectile.velocity.Y = 0f; + } + } + } + + public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) + { + Rectangle myRect = new Rectangle((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height); + if (projectile.owner == Main.myPlayer) + { + for (int i = 0; i < 200; i++) + { + if (((Main.npc[i].active && !Main.npc[i].dontTakeDamage)) && + ((projectile.friendly && (!Main.npc[i].friendly || projectile.type == 318 || (Main.npc[i].type == 22 && projectile.owner < 255 && Main.player[projectile.owner].killGuide) || (Main.npc[i].type == 54 && projectile.owner < 255 && Main.player[projectile.owner].killClothier))) || + (projectile.hostile && Main.npc[i].friendly && !Main.npc[i].dontTakeDamageFromHostiles)) && (projectile.owner < 0 || Main.npc[i].immune[projectile.owner] == 0 || projectile.maxPenetrate == 1)) + { + if (Main.npc[i].noTileCollide || !projectile.ownerHitCheck || projectile.CanHit(Main.npc[i])) + { + bool flag3; + if (Main.npc[i].type == 414) + { + Rectangle rect = Main.npc[i].getRect(); + int num5 = 8; + rect.X -= num5; + rect.Y -= num5; + rect.Width += num5 * 2; + rect.Height += num5 * 2; + flag3 = projectile.Colliding(myRect, rect); + } + else + { + flag3 = projectile.Colliding(myRect, Main.npc[i].getRect()); + } + if (flag3) + { + if (Main.npc[i].reflectingProjectiles && projectile.CanReflect()) + { + Main.npc[i].ReflectProjectile(projectile.whoAmI); + return; + } + projectile.ai[0] = 1f; + projectile.ai[1] = (float)i; + projectile.velocity = (Main.npc[i].Center - projectile.Center) * 0.75f; + projectile.netUpdate = true; + projectile.StatusNPC(i); + projectile.damage = 0; + int num28 = 10; + Point[] array2 = new Point[num28]; + int num29 = 0; + for (int l = 0; l < 1000; l++) + { + if (l != projectile.whoAmI && Main.projectile[l].active && Main.projectile[l].owner == Main.myPlayer && Main.projectile[l].type == projectile.type && Main.projectile[l].ai[0] == 1f && Main.projectile[l].ai[1] == (float)i) + { + array2[num29++] = new Point(l, Main.projectile[l].timeLeft); + if (num29 >= array2.Length) + { + break; + } + } + } + if (num29 >= array2.Length) + { + int num30 = 0; + for (int m = 1; m < array2.Length; m++) + { + if (array2[m].Y < array2[num30].Y) + { + num30 = m; + } + } + Main.projectile[array2[num30].X].Kill(); + } + } + } + } + } + } + } + + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) + { + if (targetHitbox.Width > 8 && targetHitbox.Height > 8) + { + targetHitbox.Inflate(-targetHitbox.Width / 8, -targetHitbox.Height / 8); + } + return null; + } + + public override bool OnTileCollide(Vector2 oldVelocity) + { + if (projectile.penetrate == 0) + { + projectile.Kill(); + } + return false; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.buffImmune[mod.BuffType("ShellfishEating")] = false; + if (target.type == mod.NPCType("CeaselessVoid") || target.type == mod.NPCType("EidolonWyrmHeadHuge")) + { + target.buffImmune[mod.BuffType("ShellfishEating")] = true; + } + target.AddBuff(mod.BuffType("ShellfishEating"), 600000); + } + } +} \ No newline at end of file diff --git a/Projectiles/SunkenSea/Shellfish.png b/Projectiles/SunkenSea/Shellfish.png new file mode 100644 index 0000000000..59218cfb99 Binary files /dev/null and b/Projectiles/SunkenSea/Shellfish.png differ diff --git a/Projectiles/SunkenSea/WhirlpoolProjectile.cs b/Projectiles/SunkenSea/WhirlpoolProjectile.cs new file mode 100644 index 0000000000..6bb2ed6161 --- /dev/null +++ b/Projectiles/SunkenSea/WhirlpoolProjectile.cs @@ -0,0 +1,65 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.SunkenSea +{ + public class WhirlpoolProjectile : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Riptide"); + } + + public override void SetDefaults() + { + projectile.width = 16; + projectile.height = 16; + projectile.scale = 0.75f; + projectile.friendly = true; + projectile.alpha = 150; + projectile.penetrate = -1; + projectile.timeLeft = 99; + projectile.melee = true; + aiType = ProjectileID.Amarok; + projectile.CloneDefaults(ProjectileID.CorruptYoyo); + } + + public override void AI() + { + if (Main.rand.Next(1, 51) == 1) + { + switch (Main.rand.Next(1, 9)) + { + case 1: + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0, -10, mod.ProjectileType("AquaStream"), 4, 0.0f, projectile.owner, 1.2f/*X Increment*/, 0.2f/*Y Increment*/); + break; + case 2: + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 5, -5, mod.ProjectileType("AquaStream"), 4, 0.0f, projectile.owner, 0.7f/*X Increment*/, 0.7f/*Y Increment*/); + break; + case 3: + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 10, 0, mod.ProjectileType("AquaStream"), 4, 0.0f, projectile.owner, 0.2f/*X Increment*/, 1.2f/*Y Increment*/); + break; + case 4: + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 5, 5, mod.ProjectileType("AquaStream"), 4, 0.0f, projectile.owner, -0.7f/*X Increment*/, 0.7f/*Y Increment*/); + break; + case 5: + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, -0, 10, mod.ProjectileType("AquaStream"), 4, 0.0f, projectile.owner, -1.2f/*X Increment*/, -0.2f/*Y Increment*/); + break; + case 6: + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, -5, 5, mod.ProjectileType("AquaStream"), 4, 0.0f, projectile.owner, -0.7f/*X Increment*/, -0.7f/*Y Increment*/); + break; + case 7: + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, -10, -0, mod.ProjectileType("AquaStream"), 4, 0.0f, projectile.owner, -0.2f/*X Increment*/, -1.2f/*Y Increment*/); + break; + case 8: + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, -10, -10, mod.ProjectileType("AquaStream"), 4, 0.0f, projectile.owner, 0.7f/*X Increment*/, -0.7f/*Y Increment*/); + break; + } + } + } + } +} \ No newline at end of file diff --git a/Projectiles/SunkenSea/WhirlpoolProjectile.png b/Projectiles/SunkenSea/WhirlpoolProjectile.png new file mode 100644 index 0000000000..97b8560044 Binary files /dev/null and b/Projectiles/SunkenSea/WhirlpoolProjectile.png differ diff --git a/Projectiles/TheGodsGambitProjectile.png b/Projectiles/TheGodsGambitProjectile.png deleted file mode 100644 index 64bc4036d6..0000000000 Binary files a/Projectiles/TheGodsGambitProjectile.png and /dev/null differ diff --git a/Projectiles/TheObliterator.png b/Projectiles/TheObliterator.png deleted file mode 100644 index 357e5630d7..0000000000 Binary files a/Projectiles/TheObliterator.png and /dev/null differ diff --git a/Projectiles/AstralFallingSand.cs b/Projectiles/Typeless/AstralFallingSand.cs similarity index 97% rename from Projectiles/AstralFallingSand.cs rename to Projectiles/Typeless/AstralFallingSand.cs index 8454230f5a..59d59bcef8 100644 --- a/Projectiles/AstralFallingSand.cs +++ b/Projectiles/Typeless/AstralFallingSand.cs @@ -9,7 +9,7 @@ using Terraria.ModLoader; using Microsoft.Xna.Framework; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Typeless { public class AstralFallingSand : ModProjectile { diff --git a/Projectiles/AstralFallingSand.png b/Projectiles/Typeless/AstralFallingSand.png similarity index 100% rename from Projectiles/AstralFallingSand.png rename to Projectiles/Typeless/AstralFallingSand.png diff --git a/Projectiles/AstralSpray.cs b/Projectiles/Typeless/AstralSpray.cs similarity index 98% rename from Projectiles/AstralSpray.cs rename to Projectiles/Typeless/AstralSpray.cs index 480b89861c..638c0367c8 100644 --- a/Projectiles/AstralSpray.cs +++ b/Projectiles/Typeless/AstralSpray.cs @@ -8,7 +8,7 @@ using Terraria.ModLoader; using Microsoft.Xna.Framework; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Typeless { public class AstralSpray : ModProjectile { diff --git a/Projectiles/AstralSpray.png b/Projectiles/Typeless/AstralSpray.png similarity index 100% rename from Projectiles/AstralSpray.png rename to Projectiles/Typeless/AstralSpray.png diff --git a/Projectiles/AstralStar.cs b/Projectiles/Typeless/AstralStar.cs similarity index 94% rename from Projectiles/AstralStar.cs rename to Projectiles/Typeless/AstralStar.cs index afe71ff767..6ec81850f3 100644 --- a/Projectiles/AstralStar.cs +++ b/Projectiles/Typeless/AstralStar.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Typeless { public class AstralStar : ModProjectile { @@ -28,6 +28,10 @@ namespace CalamityMod.Projectiles public override void AI() { + if (projectile.ai[0] == 2f) + { + projectile.GetGlobalProjectile(mod).rogue = true; + } int randomToSubtract = Main.rand.Next(1, 3); noTileHitCounter -= randomToSubtract; if (noTileHitCounter == 0) diff --git a/Projectiles/AstralStar.png b/Projectiles/Typeless/AstralStar.png similarity index 100% rename from Projectiles/AstralStar.png rename to Projectiles/Typeless/AstralStar.png diff --git a/Projectiles/AtaxiaOrb.cs b/Projectiles/Typeless/AtaxiaOrb.cs similarity index 96% rename from Projectiles/AtaxiaOrb.cs rename to Projectiles/Typeless/AtaxiaOrb.cs index 56695966c4..19c753cd1d 100644 --- a/Projectiles/AtaxiaOrb.cs +++ b/Projectiles/Typeless/AtaxiaOrb.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Typeless { public class AtaxiaOrb : ModProjectile { diff --git a/Projectiles/AtaxiaOrb.png b/Projectiles/Typeless/AtaxiaOrb.png similarity index 100% rename from Projectiles/AtaxiaOrb.png rename to Projectiles/Typeless/AtaxiaOrb.png diff --git a/Projectiles/BallisticPoisonCloud.cs b/Projectiles/Typeless/BallisticPoisonCloud.cs similarity index 93% rename from Projectiles/BallisticPoisonCloud.cs rename to Projectiles/Typeless/BallisticPoisonCloud.cs index ea0548e280..040ff47fac 100644 --- a/Projectiles/BallisticPoisonCloud.cs +++ b/Projectiles/Typeless/BallisticPoisonCloud.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Typeless { public class BallisticPoisonCloud : ModProjectile { diff --git a/Projectiles/BallisticPoisonCloud.png b/Projectiles/Typeless/BallisticPoisonCloud.png similarity index 100% rename from Projectiles/BallisticPoisonCloud.png rename to Projectiles/Typeless/BallisticPoisonCloud.png diff --git a/Projectiles/BallisticPoisonCloud2.cs b/Projectiles/Typeless/BallisticPoisonCloud2.cs similarity index 93% rename from Projectiles/BallisticPoisonCloud2.cs rename to Projectiles/Typeless/BallisticPoisonCloud2.cs index 5ab24c40f7..dbedd6d497 100644 --- a/Projectiles/BallisticPoisonCloud2.cs +++ b/Projectiles/Typeless/BallisticPoisonCloud2.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Typeless { public class BallisticPoisonCloud2 : ModProjectile { diff --git a/Projectiles/BallisticPoisonCloud2.png b/Projectiles/Typeless/BallisticPoisonCloud2.png similarity index 100% rename from Projectiles/BallisticPoisonCloud2.png rename to Projectiles/Typeless/BallisticPoisonCloud2.png diff --git a/Projectiles/BallisticPoisonCloud3.cs b/Projectiles/Typeless/BallisticPoisonCloud3.cs similarity index 93% rename from Projectiles/BallisticPoisonCloud3.cs rename to Projectiles/Typeless/BallisticPoisonCloud3.cs index 06347dcb4c..8a897c9208 100644 --- a/Projectiles/BallisticPoisonCloud3.cs +++ b/Projectiles/Typeless/BallisticPoisonCloud3.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Typeless { public class BallisticPoisonCloud3 : ModProjectile { diff --git a/Projectiles/BallisticPoisonCloud3.png b/Projectiles/Typeless/BallisticPoisonCloud3.png similarity index 100% rename from Projectiles/BallisticPoisonCloud3.png rename to Projectiles/Typeless/BallisticPoisonCloud3.png diff --git a/Projectiles/BloodBomb.cs b/Projectiles/Typeless/BloodBomb.cs similarity index 93% rename from Projectiles/BloodBomb.cs rename to Projectiles/Typeless/BloodBomb.cs index 0c4a275db2..0b67adcea3 100644 --- a/Projectiles/BloodBomb.cs +++ b/Projectiles/Typeless/BloodBomb.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Typeless { public class BloodBomb : ModProjectile { @@ -22,7 +22,6 @@ namespace CalamityMod.Projectiles projectile.penetrate = 1; projectile.extraUpdates = 1; projectile.timeLeft = 600; - projectile.ranged = true; } public override void AI() diff --git a/Projectiles/BloodBomb.png b/Projectiles/Typeless/BloodBomb.png similarity index 100% rename from Projectiles/BloodBomb.png rename to Projectiles/Typeless/BloodBomb.png diff --git a/Projectiles/BloodBombExplosion.cs b/Projectiles/Typeless/BloodBombExplosion.cs similarity index 94% rename from Projectiles/BloodBombExplosion.cs rename to Projectiles/Typeless/BloodBombExplosion.cs index 8a12d93c7c..6e0f79182f 100644 --- a/Projectiles/BloodBombExplosion.cs +++ b/Projectiles/Typeless/BloodBombExplosion.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Typeless { public class BloodBombExplosion : ModProjectile { @@ -23,7 +23,6 @@ namespace CalamityMod.Projectiles projectile.tileCollide = false; projectile.penetrate = -1; projectile.timeLeft = 60; - projectile.ranged = true; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 2; } diff --git a/Projectiles/BloodBombExplosion.png b/Projectiles/Typeless/BloodBombExplosion.png similarity index 100% rename from Projectiles/BloodBombExplosion.png rename to Projectiles/Typeless/BloodBombExplosion.png diff --git a/Projectiles/ChaosBlaze.cs b/Projectiles/Typeless/ChaosBlaze.cs similarity index 95% rename from Projectiles/ChaosBlaze.cs rename to Projectiles/Typeless/ChaosBlaze.cs index e3cd916f01..c985becf86 100644 --- a/Projectiles/ChaosBlaze.cs +++ b/Projectiles/Typeless/ChaosBlaze.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Typeless { public class ChaosBlaze : ModProjectile { diff --git a/Projectiles/ChaosBlaze.png b/Projectiles/Typeless/ChaosBlaze.png similarity index 100% rename from Projectiles/ChaosBlaze.png rename to Projectiles/Typeless/ChaosBlaze.png diff --git a/Projectiles/ChaosFlare.cs b/Projectiles/Typeless/ChaosFlare.cs similarity index 95% rename from Projectiles/ChaosFlare.cs rename to Projectiles/Typeless/ChaosFlare.cs index 3bd23fe2e3..5d8032e179 100644 --- a/Projectiles/ChaosFlare.cs +++ b/Projectiles/Typeless/ChaosFlare.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Typeless { public class ChaosFlare : ModProjectile { @@ -22,7 +22,6 @@ namespace CalamityMod.Projectiles projectile.ignoreWater = true; projectile.timeLeft = 120; projectile.penetrate = 1; - projectile.ranged = true; projectile.extraUpdates = 1; } diff --git a/Projectiles/LunicBeam.png b/Projectiles/Typeless/ChaosFlare.png similarity index 100% rename from Projectiles/LunicBeam.png rename to Projectiles/Typeless/ChaosFlare.png diff --git a/Projectiles/ChaosFlare2.cs b/Projectiles/Typeless/ChaosFlare2.cs similarity index 95% rename from Projectiles/ChaosFlare2.cs rename to Projectiles/Typeless/ChaosFlare2.cs index e15d380641..7101d9fd54 100644 --- a/Projectiles/ChaosFlare2.cs +++ b/Projectiles/Typeless/ChaosFlare2.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Typeless { public class ChaosFlare2 : ModProjectile { diff --git a/Projectiles/TarraEnergy.png b/Projectiles/Typeless/ChaosFlare2.png similarity index 100% rename from Projectiles/TarraEnergy.png rename to Projectiles/Typeless/ChaosFlare2.png diff --git a/Projectiles/ChaosGeyser.cs b/Projectiles/Typeless/ChaosGeyser.cs similarity index 95% rename from Projectiles/ChaosGeyser.cs rename to Projectiles/Typeless/ChaosGeyser.cs index 490703a8c1..28c2a6b0bf 100644 --- a/Projectiles/ChaosGeyser.cs +++ b/Projectiles/Typeless/ChaosGeyser.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Typeless { public class ChaosGeyser : ModProjectile { diff --git a/Projectiles/ChaosGeyser.png b/Projectiles/Typeless/ChaosGeyser.png similarity index 100% rename from Projectiles/ChaosGeyser.png rename to Projectiles/Typeless/ChaosGeyser.png diff --git a/Projectiles/DarkEnergySpawn.cs b/Projectiles/Typeless/DarkEnergySpawn.cs similarity index 92% rename from Projectiles/DarkEnergySpawn.cs rename to Projectiles/Typeless/DarkEnergySpawn.cs index 13e236496b..f132466c4b 100644 --- a/Projectiles/DarkEnergySpawn.cs +++ b/Projectiles/Typeless/DarkEnergySpawn.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Typeless { public class DarkEnergySpawn : ModProjectile { diff --git a/Projectiles/DarkEnergySpawn.png b/Projectiles/Typeless/DarkEnergySpawn.png similarity index 100% rename from Projectiles/DarkEnergySpawn.png rename to Projectiles/Typeless/DarkEnergySpawn.png diff --git a/Projectiles/DragonDust.cs b/Projectiles/Typeless/DragonDust.cs similarity index 95% rename from Projectiles/DragonDust.cs rename to Projectiles/Typeless/DragonDust.cs index 6e1b66f440..b7bf7f3a99 100644 --- a/Projectiles/DragonDust.cs +++ b/Projectiles/Typeless/DragonDust.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Typeless { public class DragonDust : ModProjectile { diff --git a/Projectiles/DragonDust.png b/Projectiles/Typeless/DragonDust.png similarity index 100% rename from Projectiles/DragonDust.png rename to Projectiles/Typeless/DragonDust.png diff --git a/Projectiles/FabsolDust.cs b/Projectiles/Typeless/FabsolDust.cs similarity index 93% rename from Projectiles/FabsolDust.cs rename to Projectiles/Typeless/FabsolDust.cs index 55a500824a..f4e22d2cdd 100644 --- a/Projectiles/FabsolDust.cs +++ b/Projectiles/Typeless/FabsolDust.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Typeless { public class FabsolDust : ModProjectile { diff --git a/Projectiles/FabsolDust.png b/Projectiles/Typeless/FabsolDust.png similarity index 100% rename from Projectiles/FabsolDust.png rename to Projectiles/Typeless/FabsolDust.png diff --git a/Projectiles/FlareExplosion.cs b/Projectiles/Typeless/FlareExplosion.cs similarity index 94% rename from Projectiles/FlareExplosion.cs rename to Projectiles/Typeless/FlareExplosion.cs index 7ad80846d2..34e74bc141 100644 --- a/Projectiles/FlareExplosion.cs +++ b/Projectiles/Typeless/FlareExplosion.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Typeless { public class FlareExplosion : ModProjectile { diff --git a/Projectiles/FlareExplosion.png b/Projectiles/Typeless/FlareExplosion.png similarity index 100% rename from Projectiles/FlareExplosion.png rename to Projectiles/Typeless/FlareExplosion.png diff --git a/Projectiles/GhostlyBolt.cs b/Projectiles/Typeless/GhostlyBolt.cs similarity index 94% rename from Projectiles/GhostlyBolt.cs rename to Projectiles/Typeless/GhostlyBolt.cs index 76db60526c..1017294d77 100644 --- a/Projectiles/GhostlyBolt.cs +++ b/Projectiles/Typeless/GhostlyBolt.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Typeless { public class GhostlyBolt : ModProjectile { @@ -25,7 +25,6 @@ namespace CalamityMod.Projectiles projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 6; projectile.timeLeft = 900; - projectile.magic = true; projectile.ignoreWater = true; projectile.tileCollide = false; } diff --git a/Projectiles/GhostlyBolt.png b/Projectiles/Typeless/GhostlyBolt.png similarity index 100% rename from Projectiles/GhostlyBolt.png rename to Projectiles/Typeless/GhostlyBolt.png diff --git a/Projectiles/GodKiller.cs b/Projectiles/Typeless/GodKiller.cs similarity index 96% rename from Projectiles/GodKiller.cs rename to Projectiles/Typeless/GodKiller.cs index 44576381dc..a3ec92922f 100644 --- a/Projectiles/GodKiller.cs +++ b/Projectiles/Typeless/GodKiller.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Typeless { public class GodKiller : ModProjectile { diff --git a/Projectiles/GodKiller.png b/Projectiles/Typeless/GodKiller.png similarity index 100% rename from Projectiles/GodKiller.png rename to Projectiles/Typeless/GodKiller.png diff --git a/Projectiles/GodSlayerBlaze.cs b/Projectiles/Typeless/GodSlayerBlaze.cs similarity index 94% rename from Projectiles/GodSlayerBlaze.cs rename to Projectiles/Typeless/GodSlayerBlaze.cs index 73d3b79524..5eae590e2c 100644 --- a/Projectiles/GodSlayerBlaze.cs +++ b/Projectiles/Typeless/GodSlayerBlaze.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Typeless { public class GodSlayerBlaze : ModProjectile { @@ -21,7 +21,6 @@ namespace CalamityMod.Projectiles projectile.friendly = true; projectile.ignoreWater = false; projectile.tileCollide = false; - projectile.magic = true; projectile.penetrate = -1; projectile.timeLeft = 60; projectile.usesLocalNPCImmunity = true; diff --git a/Projectiles/GodSlayerBlaze.png b/Projectiles/Typeless/GodSlayerBlaze.png similarity index 100% rename from Projectiles/GodSlayerBlaze.png rename to Projectiles/Typeless/GodSlayerBlaze.png diff --git a/Projectiles/GodSlayerOrb.cs b/Projectiles/Typeless/GodSlayerOrb.cs similarity index 95% rename from Projectiles/GodSlayerOrb.cs rename to Projectiles/Typeless/GodSlayerOrb.cs index c1d14ad558..83c5c92183 100644 --- a/Projectiles/GodSlayerOrb.cs +++ b/Projectiles/Typeless/GodSlayerOrb.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Typeless { public class GodSlayerOrb : ModProjectile { diff --git a/Projectiles/GodSlayerOrb.png b/Projectiles/Typeless/GodSlayerOrb.png similarity index 100% rename from Projectiles/GodSlayerOrb.png rename to Projectiles/Typeless/GodSlayerOrb.png diff --git a/Projectiles/GodSlayerPhantom.cs b/Projectiles/Typeless/GodSlayerPhantom.cs similarity index 96% rename from Projectiles/GodSlayerPhantom.cs rename to Projectiles/Typeless/GodSlayerPhantom.cs index 96dd53c1de..b3e5f430b9 100644 --- a/Projectiles/GodSlayerPhantom.cs +++ b/Projectiles/Typeless/GodSlayerPhantom.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Typeless { public class GodSlayerPhantom : ModProjectile { @@ -23,10 +23,8 @@ namespace CalamityMod.Projectiles projectile.alpha = 100; projectile.friendly = true; projectile.ignoreWater = true; - projectile.minion = true; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 10; - projectile.minionSlots = 0f; projectile.penetrate = -1; projectile.timeLeft = 300; } diff --git a/Projectiles/GodSlayerPhantom.png b/Projectiles/Typeless/GodSlayerPhantom.png similarity index 100% rename from Projectiles/GodSlayerPhantom.png rename to Projectiles/Typeless/GodSlayerPhantom.png diff --git a/Projectiles/GodSlayerShrapnel.cs b/Projectiles/Typeless/GodSlayerShrapnel.cs similarity index 95% rename from Projectiles/GodSlayerShrapnel.cs rename to Projectiles/Typeless/GodSlayerShrapnel.cs index d8af61645c..32dcdbefda 100644 --- a/Projectiles/GodSlayerShrapnel.cs +++ b/Projectiles/Typeless/GodSlayerShrapnel.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Typeless { public class GodSlayerShrapnel : ModProjectile { diff --git a/Projectiles/StandingFire.png b/Projectiles/Typeless/GodSlayerShrapnel.png similarity index 100% rename from Projectiles/StandingFire.png rename to Projectiles/Typeless/GodSlayerShrapnel.png diff --git a/Projectiles/GodSlayerShrapnelRound.cs b/Projectiles/Typeless/GodSlayerShrapnelRound.cs similarity index 93% rename from Projectiles/GodSlayerShrapnelRound.cs rename to Projectiles/Typeless/GodSlayerShrapnelRound.cs index 305ac61a16..25e5fc15f4 100644 --- a/Projectiles/GodSlayerShrapnelRound.cs +++ b/Projectiles/Typeless/GodSlayerShrapnelRound.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Typeless { public class GodSlayerShrapnelRound : ModProjectile { @@ -22,7 +22,6 @@ namespace CalamityMod.Projectiles projectile.penetrate = 1; projectile.extraUpdates = 1; projectile.timeLeft = 300; - projectile.ranged = true; } public override void AI() diff --git a/Projectiles/Typeless/GodSlayerShrapnelRound.png b/Projectiles/Typeless/GodSlayerShrapnelRound.png new file mode 100644 index 0000000000..0056fc1e24 Binary files /dev/null and b/Projectiles/Typeless/GodSlayerShrapnelRound.png differ diff --git a/Projectiles/GoldenGun.cs b/Projectiles/Typeless/GoldenGun.cs similarity index 94% rename from Projectiles/GoldenGun.cs rename to Projectiles/Typeless/GoldenGun.cs index 30c1657f79..253bcab81b 100644 --- a/Projectiles/GoldenGun.cs +++ b/Projectiles/Typeless/GoldenGun.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Typeless { public class GoldenGun : ModProjectile { @@ -20,7 +20,9 @@ namespace CalamityMod.Projectiles projectile.height = 8; projectile.friendly = true; projectile.ignoreWater = true; - projectile.penetrate = 2; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 10; + projectile.penetrate = 1; projectile.alpha = 255; projectile.timeLeft = 300; projectile.extraUpdates = 2; diff --git a/Projectiles/Typeless/GoldenGun.png b/Projectiles/Typeless/GoldenGun.png new file mode 100644 index 0000000000..0056fc1e24 Binary files /dev/null and b/Projectiles/Typeless/GoldenGun.png differ diff --git a/Projectiles/GraySpawn.cs b/Projectiles/Typeless/GraySpawn.cs similarity index 90% rename from Projectiles/GraySpawn.cs rename to Projectiles/Typeless/GraySpawn.cs index 13ec448b67..b871377cee 100644 --- a/Projectiles/GraySpawn.cs +++ b/Projectiles/Typeless/GraySpawn.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Typeless { public class GraySpawn : ModProjectile { diff --git a/Projectiles/GraySpawn.png b/Projectiles/Typeless/GraySpawn.png similarity index 100% rename from Projectiles/GraySpawn.png rename to Projectiles/Typeless/GraySpawn.png diff --git a/Projectiles/GrenadeRound.cs b/Projectiles/Typeless/GrenadeRound.cs similarity index 95% rename from Projectiles/GrenadeRound.cs rename to Projectiles/Typeless/GrenadeRound.cs index bade2e9444..3aad64e08e 100644 --- a/Projectiles/GrenadeRound.cs +++ b/Projectiles/Typeless/GrenadeRound.cs @@ -1,111 +1,111 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles -{ - public class GrenadeRound : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Grenade Round"); - } - - public override void SetDefaults() - { - projectile.width = 14; - projectile.height = 14; - projectile.friendly = true; - projectile.ignoreWater = true; - projectile.penetrate = 1; - projectile.timeLeft = 300; - } - - public override void AI() - { - projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; - if (projectile.soundDelay == 0) - { - projectile.soundDelay = 90; - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/BazookaRocket"), (int)projectile.position.X, (int)projectile.position.Y); - } - projectile.ai[0] += 1f; - if (projectile.ai[0] >= 30f) - { - projectile.velocity.Y = projectile.velocity.Y + 0.1f; - } - if (projectile.velocity.Y > 16f) - { - projectile.velocity.Y = 16f; - } - if (Math.Abs(projectile.velocity.X) >= 8f || Math.Abs(projectile.velocity.Y) >= 8f) - { - for (int num246 = 0; num246 < 2; num246++) - { - float num247 = 0f; - float num248 = 0f; - if (num246 == 1) - { - num247 = projectile.velocity.X * 0.5f; - num248 = projectile.velocity.Y * 0.5f; - } - int num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 6, 0f, 0f, 100, default(Color), 1f); - Main.dust[num249].scale *= 2f + (float)Main.rand.Next(10) * 0.1f; - Main.dust[num249].velocity *= 0.2f; - Main.dust[num249].noGravity = true; - num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 31, 0f, 0f, 100, default(Color), 0.5f); - Main.dust[num249].fadeIn = 1f + (float)Main.rand.Next(5) * 0.1f; - Main.dust[num249].velocity *= 0.05f; - } - } - } - - public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) - { - if (target.HitSound != SoundID.NPCHit1 && target.HitSound != SoundID.NPCHit6 && target.HitSound != SoundID.NPCHit7 && - target.HitSound != SoundID.NPCHit8 && target.HitSound != SoundID.NPCHit9 && target.HitSound != SoundID.NPCHit12 && - target.HitSound != SoundID.NPCHit13 && target.HitSound != SoundID.NPCHit14 && target.HitSound != SoundID.NPCHit18 && - target.HitSound != SoundID.NPCHit19 && target.HitSound != SoundID.NPCHit20 && target.HitSound != SoundID.NPCHit21 && - target.HitSound != SoundID.NPCHit22 && target.HitSound != SoundID.NPCHit23 && target.HitSound != SoundID.NPCHit24 && - target.HitSound != SoundID.NPCHit25 && target.HitSound != SoundID.NPCHit26 && target.HitSound != SoundID.NPCHit27 && - target.HitSound != SoundID.NPCHit28 && target.HitSound != SoundID.NPCHit29 && target.HitSound != SoundID.NPCHit31 && - target.HitSound != SoundID.NPCHit32 && target.HitSound != SoundID.NPCHit33 && target.HitSound != SoundID.NPCHit35 && - target.HitSound != SoundID.NPCHit37 && target.HitSound != SoundID.NPCHit38 && target.HitSound != SoundID.NPCHit40 && - target.HitSound != SoundID.NPCHit43 && target.HitSound != SoundID.NPCHit44 && target.HitSound != SoundID.NPCHit45 && - target.HitSound != SoundID.NPCHit46 && target.HitSound != SoundID.NPCHit47 && target.HitSound != SoundID.NPCHit48 && - target.HitSound != SoundID.NPCHit50 && target.HitSound != SoundID.NPCHit51 && target.HitSound != SoundID.NPCHit55 && - target.HitSound != SoundID.NPCHit56 && target.HitSound != SoundID.NPCHit57) - { - damage += target.lifeMax / 20; - } - if (damage > target.lifeMax / 12 && CalamityPlayer.areThereAnyDamnBosses) - damage = target.lifeMax / 12; - } - - public override void Kill(int timeLeft) - { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); - projectile.position = projectile.Center; - projectile.width = (projectile.height = 96); - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); - for (int num193 = 0; num193 < 6; num193++) - { - Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default(Color), 1.5f); - } - for (int num194 = 0; num194 < 60; num194++) - { - int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 0, default(Color), 2.5f); - Main.dust[num195].noGravity = true; - Main.dust[num195].velocity *= 3f; - num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 1.5f); - Main.dust[num195].velocity *= 2f; - Main.dust[num195].noGravity = true; - } - projectile.Damage(); - } - } +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Typeless +{ + public class GrenadeRound : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Grenade Round"); + } + + public override void SetDefaults() + { + projectile.width = 14; + projectile.height = 14; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.penetrate = 1; + projectile.timeLeft = 300; + } + + public override void AI() + { + projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; + if (projectile.soundDelay == 0) + { + projectile.soundDelay = 90; + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/BazookaRocket"), (int)projectile.position.X, (int)projectile.position.Y); + } + projectile.ai[0] += 1f; + if (projectile.ai[0] >= 30f) + { + projectile.velocity.Y = projectile.velocity.Y + 0.1f; + } + if (projectile.velocity.Y > 16f) + { + projectile.velocity.Y = 16f; + } + if (Math.Abs(projectile.velocity.X) >= 8f || Math.Abs(projectile.velocity.Y) >= 8f) + { + for (int num246 = 0; num246 < 2; num246++) + { + float num247 = 0f; + float num248 = 0f; + if (num246 == 1) + { + num247 = projectile.velocity.X * 0.5f; + num248 = projectile.velocity.Y * 0.5f; + } + int num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 6, 0f, 0f, 100, default(Color), 1f); + Main.dust[num249].scale *= 2f + (float)Main.rand.Next(10) * 0.1f; + Main.dust[num249].velocity *= 0.2f; + Main.dust[num249].noGravity = true; + num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 31, 0f, 0f, 100, default(Color), 0.5f); + Main.dust[num249].fadeIn = 1f + (float)Main.rand.Next(5) * 0.1f; + Main.dust[num249].velocity *= 0.05f; + } + } + } + + public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) + { + if (target.HitSound != SoundID.NPCHit1 && target.HitSound != SoundID.NPCHit6 && target.HitSound != SoundID.NPCHit7 && + target.HitSound != SoundID.NPCHit8 && target.HitSound != SoundID.NPCHit9 && target.HitSound != SoundID.NPCHit12 && + target.HitSound != SoundID.NPCHit13 && target.HitSound != SoundID.NPCHit14 && target.HitSound != SoundID.NPCHit18 && + target.HitSound != SoundID.NPCHit19 && target.HitSound != SoundID.NPCHit20 && target.HitSound != SoundID.NPCHit21 && + target.HitSound != SoundID.NPCHit22 && target.HitSound != SoundID.NPCHit23 && target.HitSound != SoundID.NPCHit24 && + target.HitSound != SoundID.NPCHit25 && target.HitSound != SoundID.NPCHit26 && target.HitSound != SoundID.NPCHit27 && + target.HitSound != SoundID.NPCHit28 && target.HitSound != SoundID.NPCHit29 && target.HitSound != SoundID.NPCHit31 && + target.HitSound != SoundID.NPCHit32 && target.HitSound != SoundID.NPCHit33 && target.HitSound != SoundID.NPCHit35 && + target.HitSound != SoundID.NPCHit37 && target.HitSound != SoundID.NPCHit38 && target.HitSound != SoundID.NPCHit40 && + target.HitSound != SoundID.NPCHit43 && target.HitSound != SoundID.NPCHit44 && target.HitSound != SoundID.NPCHit45 && + target.HitSound != SoundID.NPCHit46 && target.HitSound != SoundID.NPCHit47 && target.HitSound != SoundID.NPCHit48 && + target.HitSound != SoundID.NPCHit50 && target.HitSound != SoundID.NPCHit51 && target.HitSound != SoundID.NPCHit55 && + target.HitSound != SoundID.NPCHit56 && target.HitSound != SoundID.NPCHit57) + { + damage += target.lifeMax / 20; //500 + 200 = 700 + (100000 / 20 = 5000) = 5700 * 2 (explosion) = 11400 = 11.4% of boss HP + } + if (damage > target.lifeMax / 12 && CalamityPlayer.areThereAnyDamnBosses) + damage = target.lifeMax / 12; + } + + public override void Kill(int timeLeft) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); + projectile.position = projectile.Center; + projectile.width = (projectile.height = 96); + projectile.position.X = projectile.position.X - (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + for (int num193 = 0; num193 < 6; num193++) + { + Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default(Color), 1.5f); + } + for (int num194 = 0; num194 < 60; num194++) + { + int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 0, default(Color), 2.5f); + Main.dust[num195].noGravity = true; + Main.dust[num195].velocity *= 3f; + num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 1.5f); + Main.dust[num195].velocity *= 2f; + Main.dust[num195].noGravity = true; + } + projectile.Damage(); + } + } } \ No newline at end of file diff --git a/Projectiles/GrenadeRound.png b/Projectiles/Typeless/GrenadeRound.png similarity index 100% rename from Projectiles/GrenadeRound.png rename to Projectiles/Typeless/GrenadeRound.png diff --git a/Projectiles/HolyEruption.cs b/Projectiles/Typeless/HolyEruption.cs similarity index 95% rename from Projectiles/HolyEruption.cs rename to Projectiles/Typeless/HolyEruption.cs index 4781bea162..fa64265729 100644 --- a/Projectiles/HolyEruption.cs +++ b/Projectiles/Typeless/HolyEruption.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Typeless { public class HolyEruption : ModProjectile { diff --git a/Projectiles/HolyEruption.png b/Projectiles/Typeless/HolyEruption.png similarity index 100% rename from Projectiles/HolyEruption.png rename to Projectiles/Typeless/HolyEruption.png diff --git a/Projectiles/HolyExplosion.cs b/Projectiles/Typeless/HolyExplosion.cs similarity index 95% rename from Projectiles/HolyExplosion.cs rename to Projectiles/Typeless/HolyExplosion.cs index 38ca432d81..3f1ee675fa 100644 --- a/Projectiles/HolyExplosion.cs +++ b/Projectiles/Typeless/HolyExplosion.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Typeless { public class HolyExplosion : ModProjectile { diff --git a/Projectiles/HolyExplosion.png b/Projectiles/Typeless/HolyExplosion.png similarity index 100% rename from Projectiles/HolyExplosion.png rename to Projectiles/Typeless/HolyExplosion.png diff --git a/Projectiles/HolyExplosionSupreme.cs b/Projectiles/Typeless/HolyExplosionSupreme.cs similarity index 95% rename from Projectiles/HolyExplosionSupreme.cs rename to Projectiles/Typeless/HolyExplosionSupreme.cs index 9a591655dd..b3c09e4c21 100644 --- a/Projectiles/HolyExplosionSupreme.cs +++ b/Projectiles/Typeless/HolyExplosionSupreme.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Typeless { public class HolyExplosionSupreme : ModProjectile { diff --git a/Projectiles/HolyExplosionSupreme.png b/Projectiles/Typeless/HolyExplosionSupreme.png similarity index 100% rename from Projectiles/HolyExplosionSupreme.png rename to Projectiles/Typeless/HolyExplosionSupreme.png diff --git a/Projectiles/HolyFlameBomb.cs b/Projectiles/Typeless/HolyFlameBomb.cs similarity index 95% rename from Projectiles/HolyFlameBomb.cs rename to Projectiles/Typeless/HolyFlameBomb.cs index db3696f690..cb2d4502d0 100644 --- a/Projectiles/HolyFlameBomb.cs +++ b/Projectiles/Typeless/HolyFlameBomb.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Typeless { public class HolyFlameBomb : ModProjectile { diff --git a/Projectiles/HolyFlameBomb.png b/Projectiles/Typeless/HolyFlameBomb.png similarity index 100% rename from Projectiles/HolyFlameBomb.png rename to Projectiles/Typeless/HolyFlameBomb.png diff --git a/Projectiles/LunicBeam.cs b/Projectiles/Typeless/LunicBeam.cs similarity index 96% rename from Projectiles/LunicBeam.cs rename to Projectiles/Typeless/LunicBeam.cs index c72ee4ccf8..343b77dd4f 100644 --- a/Projectiles/LunicBeam.cs +++ b/Projectiles/Typeless/LunicBeam.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Typeless { public class LunicBeam : ModProjectile { @@ -21,7 +21,7 @@ namespace CalamityMod.Projectiles projectile.height = 8; projectile.friendly = true; projectile.ignoreWater = true; - projectile.penetrate = 2; + projectile.penetrate = 1; projectile.extraUpdates = 2; projectile.alpha = 255; } @@ -65,7 +65,7 @@ namespace CalamityMod.Projectiles } } } - if (num36 < 20f) + if (num36 < 8f) { projectile.Kill(); return; diff --git a/Projectiles/Typeless/LunicBeam.png b/Projectiles/Typeless/LunicBeam.png new file mode 100644 index 0000000000..0056fc1e24 Binary files /dev/null and b/Projectiles/Typeless/LunicBeam.png differ diff --git a/Projectiles/MageHammerBoom.cs b/Projectiles/Typeless/MageHammerBoom.cs similarity index 91% rename from Projectiles/MageHammerBoom.cs rename to Projectiles/Typeless/MageHammerBoom.cs index 798471014c..6c153fdcb4 100644 --- a/Projectiles/MageHammerBoom.cs +++ b/Projectiles/Typeless/MageHammerBoom.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Typeless { public class MageHammerBoom : ModProjectile { diff --git a/Projectiles/MageHammerBoom.png b/Projectiles/Typeless/MageHammerBoom.png similarity index 100% rename from Projectiles/MageHammerBoom.png rename to Projectiles/Typeless/MageHammerBoom.png diff --git a/Projectiles/MagnumRound.cs b/Projectiles/Typeless/MagnumRound.cs similarity index 89% rename from Projectiles/MagnumRound.cs rename to Projectiles/Typeless/MagnumRound.cs index 7e775a31f1..2f356571eb 100644 --- a/Projectiles/MagnumRound.cs +++ b/Projectiles/Typeless/MagnumRound.cs @@ -1,51 +1,51 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles -{ - public class MagnumRound : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Magnum Round"); - } - - public override void SetDefaults() - { - projectile.width = 4; - projectile.height = 4; - projectile.light = 0.5f; - projectile.alpha = 255; - projectile.extraUpdates = 10; - projectile.friendly = true; - projectile.ignoreWater = true; - projectile.aiStyle = 1; - aiType = 242; - projectile.penetrate = 1; - projectile.timeLeft = 600; - } - - public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) - { - if (target.HitSound != SoundID.NPCHit4 && target.HitSound != SoundID.NPCHit41 && target.HitSound != SoundID.NPCHit2 && - target.HitSound != SoundID.NPCHit5 && target.HitSound != SoundID.NPCHit11 && target.HitSound != SoundID.NPCHit30 && - target.HitSound != SoundID.NPCHit34 && target.HitSound != SoundID.NPCHit36 && target.HitSound != SoundID.NPCHit42 && - target.HitSound != SoundID.NPCHit49 && target.HitSound != SoundID.NPCHit52 && target.HitSound != SoundID.NPCHit53 && - target.HitSound != SoundID.NPCHit54 && target.HitSound != null) - { - damage += target.lifeMax / 25; - } - if (damage > target.lifeMax / 15 && CalamityPlayer.areThereAnyDamnBosses) - damage = target.lifeMax / 15; - if (crit) - { - damage = (int)((double)damage * 1.25); - knockback *= 1.25f; - } - } - } +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Typeless +{ + public class MagnumRound : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Magnum Round"); + } + + public override void SetDefaults() + { + projectile.width = 4; + projectile.height = 4; + projectile.light = 0.5f; + projectile.alpha = 255; + projectile.extraUpdates = 10; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.aiStyle = 1; + aiType = 242; + projectile.penetrate = 1; + projectile.timeLeft = 600; + } + + public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) + { + if (target.HitSound != SoundID.NPCHit4 && target.HitSound != SoundID.NPCHit41 && target.HitSound != SoundID.NPCHit2 && + target.HitSound != SoundID.NPCHit5 && target.HitSound != SoundID.NPCHit11 && target.HitSound != SoundID.NPCHit30 && + target.HitSound != SoundID.NPCHit34 && target.HitSound != SoundID.NPCHit36 && target.HitSound != SoundID.NPCHit42 && + target.HitSound != SoundID.NPCHit49 && target.HitSound != SoundID.NPCHit52 && target.HitSound != SoundID.NPCHit53 && + target.HitSound != SoundID.NPCHit54 && target.HitSound != null) + { + damage += target.lifeMax / 25; //400 + 80 = 480 + (100000 / 25 = 4000) = 4480, if crit = 5600 = 5.6% of boss HP + } + if (damage > target.lifeMax / 15 && CalamityPlayer.areThereAnyDamnBosses) + damage = target.lifeMax / 15; + if (crit) + { + damage = (int)((double)damage * 1.25); + knockback *= 1.25f; + } + } + } } \ No newline at end of file diff --git a/Projectiles/MagnumRound.png b/Projectiles/Typeless/MagnumRound.png similarity index 100% rename from Projectiles/MagnumRound.png rename to Projectiles/Typeless/MagnumRound.png diff --git a/Projectiles/MarkRound.cs b/Projectiles/Typeless/MarkRound.cs similarity index 96% rename from Projectiles/MarkRound.cs rename to Projectiles/Typeless/MarkRound.cs index bfcf08d05b..21df39f16b 100644 --- a/Projectiles/MarkRound.cs +++ b/Projectiles/Typeless/MarkRound.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Typeless { public class MarkRound : ModProjectile { diff --git a/Projectiles/MarkRound.png b/Projectiles/Typeless/MarkRound.png similarity index 100% rename from Projectiles/MarkRound.png rename to Projectiles/Typeless/MarkRound.png diff --git a/Projectiles/Nanotech.cs b/Projectiles/Typeless/Nanotech.cs similarity index 96% rename from Projectiles/Nanotech.cs rename to Projectiles/Typeless/Nanotech.cs index 44403e5d06..8c278f5913 100644 --- a/Projectiles/Nanotech.cs +++ b/Projectiles/Typeless/Nanotech.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Typeless { public class Nanotech : ModProjectile { diff --git a/Projectiles/Nanotech.png b/Projectiles/Typeless/Nanotech.png similarity index 100% rename from Projectiles/Nanotech.png rename to Projectiles/Typeless/Nanotech.png diff --git a/Projectiles/NebulaDust.cs b/Projectiles/Typeless/NebulaDust.cs similarity index 93% rename from Projectiles/NebulaDust.cs rename to Projectiles/Typeless/NebulaDust.cs index 665415ce7b..15181e7ca2 100644 --- a/Projectiles/NebulaDust.cs +++ b/Projectiles/Typeless/NebulaDust.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Typeless { public class NebulaDust : ModProjectile { diff --git a/Projectiles/NebulaDust.png b/Projectiles/Typeless/NebulaDust.png similarity index 100% rename from Projectiles/NebulaDust.png rename to Projectiles/Typeless/NebulaDust.png diff --git a/Projectiles/NebulaStar.cs b/Projectiles/Typeless/NebulaStar.cs similarity index 86% rename from Projectiles/NebulaStar.cs rename to Projectiles/Typeless/NebulaStar.cs index faee1ce63d..6c399407da 100644 --- a/Projectiles/NebulaStar.cs +++ b/Projectiles/Typeless/NebulaStar.cs @@ -1,11 +1,12 @@ using System; using System.Collections.Generic; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Typeless { public class NebulaStar : ModProjectile { @@ -16,8 +17,8 @@ namespace CalamityMod.Projectiles public override void SetDefaults() { - projectile.width = 16; - projectile.height = 16; + projectile.width = 34; + projectile.height = 34; projectile.friendly = true; projectile.alpha = 255; projectile.penetrate = 1; @@ -132,10 +133,6 @@ namespace CalamityMod.Projectiles { num947 *= 1.7f; } - /*if (!Main.player[projectile.owner].sporeSac) - { - num947 += 100f; - }*/ projectile.ai[0] += num947; if (projectile.alpha > 50) { @@ -175,7 +172,6 @@ namespace CalamityMod.Projectiles if ((double)projectile.velocity.Length() > 0.2) { projectile.velocity *= 0.98f; - return; } } @@ -189,5 +185,11 @@ namespace CalamityMod.Projectiles Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value10.X, value10.Y, mod.ProjectileType("NebulaDust"), projectile.damage, 0f, projectile.owner, 0f, 0f); } } - } + + public override void PostDraw(SpriteBatch spriteBatch, Color lightColor) + { + Vector2 origin = new Vector2(17f, 17f); + spriteBatch.Draw(mod.GetTexture("Projectiles/Typeless/NebulaStarGlow"), projectile.Center - Main.screenPosition, null, Color.White, projectile.rotation, origin, projectile.scale, SpriteEffects.None, 0f); + } + } } \ No newline at end of file diff --git a/Projectiles/Typeless/NebulaStar.png b/Projectiles/Typeless/NebulaStar.png new file mode 100644 index 0000000000..1c2222cad4 Binary files /dev/null and b/Projectiles/Typeless/NebulaStar.png differ diff --git a/Projectiles/Typeless/NebulaStarGlow.png b/Projectiles/Typeless/NebulaStarGlow.png new file mode 100644 index 0000000000..ae2602e6fc Binary files /dev/null and b/Projectiles/Typeless/NebulaStarGlow.png differ diff --git a/Projectiles/NobodyKnows.cs b/Projectiles/Typeless/NobodyKnows.cs similarity index 88% rename from Projectiles/NobodyKnows.cs rename to Projectiles/Typeless/NobodyKnows.cs index 44e153840b..3412c24291 100644 --- a/Projectiles/NobodyKnows.cs +++ b/Projectiles/Typeless/NobodyKnows.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Typeless { public class NobodyKnows : ModProjectile { diff --git a/Projectiles/NobodyKnows.png b/Projectiles/Typeless/NobodyKnows.png similarity index 100% rename from Projectiles/NobodyKnows.png rename to Projectiles/Typeless/NobodyKnows.png diff --git a/Projectiles/OmegaBlueTentacle.cs b/Projectiles/Typeless/OmegaBlueTentacle.cs similarity index 97% rename from Projectiles/OmegaBlueTentacle.cs rename to Projectiles/Typeless/OmegaBlueTentacle.cs index bc1edeab15..73552df2fb 100644 --- a/Projectiles/OmegaBlueTentacle.cs +++ b/Projectiles/Typeless/OmegaBlueTentacle.cs @@ -1,229 +1,229 @@ -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using Terraria; -using Terraria.ID; -using Terraria.DataStructures; -using Terraria.Graphics.Shaders; -using Terraria.ModLoader; -using System; - -namespace CalamityMod.Projectiles -{ - public class OmegaBlueTentacle : ModProjectile - { - public bool initSegments = false; - public Vector2[] segment = new Vector2[6]; - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Omega Blue Tentacle"); - } - - public override void SetDefaults() - { - projectile.width = 24; - projectile.height = 24; - projectile.timeLeft = 6; - projectile.friendly = true; - projectile.tileCollide = false; - projectile.ignoreWater = true; - projectile.penetrate = -1; - projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 10; - } - - public override bool PreAI() - { - if (!initSegments) - { - initSegments = true; - for (int i = 0; i < 6; i++) - { - segment[i] = projectile.Center; - //Main.NewText("init segment " + segment[i].X.ToString() + " " + segment[i].Y.ToString()); - } - } - return true; - } - - public override void AI() - { - Player player = Main.player[projectile.owner]; - bool hentai = player.GetModPlayer().omegaBlueHentai; - if (player.active && player.GetModPlayer().omegaBlueSet) - projectile.timeLeft = 3; - - //tentacle head movement (homing) - Vector2 playerVel = player.position - player.oldPosition; - projectile.position += playerVel; - projectile.ai[0]++; - if (projectile.ai[0] >= 0f) - { - Vector2 home = player.Center + new Vector2(50, 0).RotatedBy(MathHelper.ToRadians(60) * projectile.ai[1]); - Vector2 distance = home - projectile.Center; - float range = distance.Length(); - distance.Normalize(); - if (projectile.ai[0] == 0f) - { - if (range > 13f) - { - projectile.ai[0] = -1f; //if in fast mode, stay fast until back in range - if (range > 1300f) - { - projectile.Kill(); - return; - } - } - else - { - if (hentai) - projectile.ai[0] = 120f;//45f + Main.rand.Next(45); - projectile.velocity.Normalize(); - projectile.velocity *= 3f + Main.rand.NextFloat(3f); - projectile.netUpdate = true; - } - } - else - { - distance /= 8f; - } - if (range > 120f) //switch to fast return mode - { - projectile.ai[0] = -1f; - projectile.netUpdate = true; - } - projectile.velocity += distance; - if (range > 30f) - projectile.velocity *= 0.96f; - - if (projectile.ai[0] > 120f) //attack nearby enemy - { - projectile.ai[0] = 10 + Main.rand.Next(10); - float maxDistance = hentai ? 900f : 600f; - int target = -1; - for (int i = 0; i < 200; i++) - { - NPC npc = Main.npc[i]; - if (npc.CanBeChasedBy(projectile)) - { - float npcDistance = projectile.Distance(npc.Center); - if (npcDistance < maxDistance) - { - maxDistance = npcDistance; - target = i; - } - } - } - if (target != -1) - { - projectile.velocity = Main.npc[target].Center - projectile.Center; - projectile.velocity.Normalize(); - projectile.velocity *= 13f; - projectile.velocity += Main.npc[target].velocity / 2f; - projectile.velocity -= playerVel / 2f; - projectile.ai[0] *= -1f; - } - projectile.netUpdate = true; - } - } - - //tentacle segment updates - segment[0] = player.Center; - for (int i = 1; i < 5; i++) - { - MoveSegment(segment[i - 1], ref segment[i], segment[i + 1]); - } - MoveSegment(segment[4], ref segment[5], projectile.Center + projectile.velocity); - - if (hentai) - { - if (projectile.ai[0] != -1f) - projectile.ai[0]++; - projectile.position += projectile.velocity; - //SMOOTH ASS DUST - Vector2 dustPos = projectile.position + projectile.velocity; - Vector2 tickVel = dustPos - projectile.oldPosition; //playerVel + projectile.velocity * 2f; - dustPos += new Vector2(projectile.width / 2, 0).RotatedBy(projectile.rotation); - dustPos.X -= 4; - dustPos.X += projectile.width / 2; - dustPos.Y -= 4; - dustPos.Y += projectile.height / 2; - const float factor = 3f; - int limit = (int)(tickVel.Length() / factor); - if (limit == 0) - { - int d = Dust.NewDust(dustPos, 0, 0, 20, 0, 0, 100, Color.Transparent, 0.9f); - Main.dust[d].noGravity = true; - Main.dust[d].noLight = true; - Main.dust[d].fadeIn = 1f; - Main.dust[d].velocity = Vector2.Zero; - } - else - { - tickVel.Normalize(); - tickVel *= factor; - for (int i = 0; i <= limit; i++) - { - int d = Dust.NewDust(dustPos, 0, 0, 20, 0, 0, 100, Color.Transparent, 0.9f); - Main.dust[d].noGravity = true; - Main.dust[d].noLight = true; - Main.dust[d].fadeIn = 1f; - Main.dust[d].position -= tickVel * i; - Main.dust[d].velocity = Vector2.Zero; - } - } - } - } - - private static void MoveSegment(Vector2 previous, ref Vector2 current, Vector2 next) - { - current = previous + next; - current /= 2; - } - - public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) - { - if (Main.player[projectile.owner].GetModPlayer().omegaBlueHentai) - crit = true; - } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - if (projectile.owner == Main.myPlayer && Main.player[Main.myPlayer].lifeSteal > 0f && target.type != NPCID.TargetDummy) - { - int healAmount = 10 * damage / projectile.damage; //should always be around max, less if enemy has defense/DR - if (healAmount > 0) - { - Main.player[Main.myPlayer].lifeSteal -= healAmount; - if (Main.player[Main.myPlayer].GetModPlayer().omegaBlueHentai) //hentai always crits, this makes it have same lifesteal delay - Main.player[Main.myPlayer].lifeSteal += healAmount / 2; - /*Main.player[Main.myPlayer].statLife += healAmount; - if (Main.player[Main.myPlayer].statLife > Main.player[Main.myPlayer].statLifeMax2) - Main.player[Main.myPlayer].statLife = Main.player[Main.myPlayer].statLifeMax2; - Main.player[Main.myPlayer].HealEffect(healAmount, false);*/ - Projectile.NewProjectile(projectile.Center, Vector2.Zero, ProjectileID.SpiritHeal, 0, 0f, projectile.owner, projectile.owner, healAmount); - } - } - } - - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - Main.spriteBatch.End(); - Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.LinearClamp/*.PointWrap*/, DepthStencilState.Default, RasterizerState.CullNone, null, Main.GameViewMatrix.ZoomMatrix); - - GameShaders.Armor.ApplySecondary(Main.player[projectile.owner].cBody, Main.player[projectile.owner], new DrawData?()); - projectile.rotation = (projectile.Center - segment[5]).ToRotation(); - Texture2D texture2D13 = Main.projectileTexture[projectile.type]; - Texture2D segmentSprite = mod.GetTexture("ExtraTextures/Chains/OmegaBlueTentacleSegment"); - for (int i = 0; i < 6; i++) - { - Main.spriteBatch.Draw(segmentSprite, segment[i] - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), segmentSprite.Bounds, projectile.GetAlpha(lightColor), 0f, segmentSprite.Bounds.Size() / 2f, projectile.scale, SpriteEffects.None, 0f); - } - Main.spriteBatch.Draw(texture2D13, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), texture2D13.Bounds, projectile.GetAlpha(lightColor), projectile.rotation, texture2D13.Bounds.Size() / 2f, projectile.scale, SpriteEffects.None, 0f); - - Main.spriteBatch.End(); - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, RasterizerState.CullCounterClockwise, null, Main.Transform); - return false; - } - } -} +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.DataStructures; +using Terraria.Graphics.Shaders; +using Terraria.ModLoader; +using System; + +namespace CalamityMod.Projectiles.Typeless +{ + public class OmegaBlueTentacle : ModProjectile + { + public bool initSegments = false; + public Vector2[] segment = new Vector2[6]; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Omega Blue Tentacle"); + } + + public override void SetDefaults() + { + projectile.width = 24; + projectile.height = 24; + projectile.timeLeft = 6; + projectile.friendly = true; + projectile.tileCollide = false; + projectile.ignoreWater = true; + projectile.penetrate = -1; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 10; + } + + public override bool PreAI() + { + if (!initSegments) + { + initSegments = true; + for (int i = 0; i < 6; i++) + { + segment[i] = projectile.Center; + //Main.NewText("init segment " + segment[i].X.ToString() + " " + segment[i].Y.ToString()); + } + } + return true; + } + + public override void AI() + { + Player player = Main.player[projectile.owner]; + bool hentai = player.GetModPlayer().omegaBlueHentai; + if (player.active && player.GetModPlayer().omegaBlueSet) + projectile.timeLeft = 3; + + //tentacle head movement (homing) + Vector2 playerVel = player.position - player.oldPosition; + projectile.position += playerVel; + projectile.ai[0]++; + if (projectile.ai[0] >= 0f) + { + Vector2 home = player.Center + new Vector2(50, 0).RotatedBy(MathHelper.ToRadians(60) * projectile.ai[1]); + Vector2 distance = home - projectile.Center; + float range = distance.Length(); + distance.Normalize(); + if (projectile.ai[0] == 0f) + { + if (range > 13f) + { + projectile.ai[0] = -1f; //if in fast mode, stay fast until back in range + if (range > 1300f) + { + projectile.Kill(); + return; + } + } + else + { + if (hentai) + projectile.ai[0] = 120f;//45f + Main.rand.Next(45); + projectile.velocity.Normalize(); + projectile.velocity *= 3f + Main.rand.NextFloat(3f); + projectile.netUpdate = true; + } + } + else + { + distance /= 8f; + } + if (range > 120f) //switch to fast return mode + { + projectile.ai[0] = -1f; + projectile.netUpdate = true; + } + projectile.velocity += distance; + if (range > 30f) + projectile.velocity *= 0.96f; + + if (projectile.ai[0] > 120f) //attack nearby enemy + { + projectile.ai[0] = 10 + Main.rand.Next(10); + float maxDistance = hentai ? 900f : 600f; + int target = -1; + for (int i = 0; i < 200; i++) + { + NPC npc = Main.npc[i]; + if (npc.CanBeChasedBy(projectile)) + { + float npcDistance = projectile.Distance(npc.Center); + if (npcDistance < maxDistance) + { + maxDistance = npcDistance; + target = i; + } + } + } + if (target != -1) + { + projectile.velocity = Main.npc[target].Center - projectile.Center; + projectile.velocity.Normalize(); + projectile.velocity *= 13f; + projectile.velocity += Main.npc[target].velocity / 2f; + projectile.velocity -= playerVel / 2f; + projectile.ai[0] *= -1f; + } + projectile.netUpdate = true; + } + } + + //tentacle segment updates + segment[0] = player.Center; + for (int i = 1; i < 5; i++) + { + MoveSegment(segment[i - 1], ref segment[i], segment[i + 1]); + } + MoveSegment(segment[4], ref segment[5], projectile.Center + projectile.velocity); + + if (hentai) + { + if (projectile.ai[0] != -1f) + projectile.ai[0]++; + projectile.position += projectile.velocity; + //SMOOTH ASS DUST + Vector2 dustPos = projectile.position + projectile.velocity; + Vector2 tickVel = dustPos - projectile.oldPosition; //playerVel + projectile.velocity * 2f; + dustPos += new Vector2(projectile.width / 2, 0).RotatedBy(projectile.rotation); + dustPos.X -= 4; + dustPos.X += projectile.width / 2; + dustPos.Y -= 4; + dustPos.Y += projectile.height / 2; + const float factor = 3f; + int limit = (int)(tickVel.Length() / factor); + if (limit == 0) + { + int d = Dust.NewDust(dustPos, 0, 0, 20, 0, 0, 100, Color.Transparent, 0.9f); + Main.dust[d].noGravity = true; + Main.dust[d].noLight = true; + Main.dust[d].fadeIn = 1f; + Main.dust[d].velocity = Vector2.Zero; + } + else + { + tickVel.Normalize(); + tickVel *= factor; + for (int i = 0; i <= limit; i++) + { + int d = Dust.NewDust(dustPos, 0, 0, 20, 0, 0, 100, Color.Transparent, 0.9f); + Main.dust[d].noGravity = true; + Main.dust[d].noLight = true; + Main.dust[d].fadeIn = 1f; + Main.dust[d].position -= tickVel * i; + Main.dust[d].velocity = Vector2.Zero; + } + } + } + } + + private static void MoveSegment(Vector2 previous, ref Vector2 current, Vector2 next) + { + current = previous + next; + current /= 2; + } + + public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) + { + if (Main.player[projectile.owner].GetModPlayer().omegaBlueHentai) + crit = true; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + if (projectile.owner == Main.myPlayer && Main.player[Main.myPlayer].lifeSteal > 0f && target.type != NPCID.TargetDummy) + { + int healAmount = 10 * damage / projectile.damage; //should always be around max, less if enemy has defense/DR + if (healAmount > 0) + { + Main.player[Main.myPlayer].lifeSteal -= healAmount; + if (Main.player[Main.myPlayer].GetModPlayer().omegaBlueHentai) //hentai always crits, this makes it have same lifesteal delay + Main.player[Main.myPlayer].lifeSteal += healAmount / 2; + /*Main.player[Main.myPlayer].statLife += healAmount; + if (Main.player[Main.myPlayer].statLife > Main.player[Main.myPlayer].statLifeMax2) + Main.player[Main.myPlayer].statLife = Main.player[Main.myPlayer].statLifeMax2; + Main.player[Main.myPlayer].HealEffect(healAmount, false);*/ + Projectile.NewProjectile(projectile.Center, Vector2.Zero, ProjectileID.SpiritHeal, 0, 0f, projectile.owner, projectile.owner, healAmount); + } + } + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Main.spriteBatch.End(); + Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.LinearClamp/*.PointWrap*/, DepthStencilState.Default, RasterizerState.CullNone, null, Main.GameViewMatrix.ZoomMatrix); + + GameShaders.Armor.ApplySecondary(Main.player[projectile.owner].cBody, Main.player[projectile.owner], new DrawData?()); + projectile.rotation = (projectile.Center - segment[5]).ToRotation(); + Texture2D texture2D13 = Main.projectileTexture[projectile.type]; + Texture2D segmentSprite = mod.GetTexture("ExtraTextures/Chains/OmegaBlueTentacleSegment"); + for (int i = 0; i < 6; i++) + { + Main.spriteBatch.Draw(segmentSprite, segment[i] - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), segmentSprite.Bounds, projectile.GetAlpha(lightColor), 0f, segmentSprite.Bounds.Size() / 2f, projectile.scale, SpriteEffects.None, 0f); + } + Main.spriteBatch.Draw(texture2D13, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), texture2D13.Bounds, projectile.GetAlpha(lightColor), projectile.rotation, texture2D13.Bounds.Size() / 2f, projectile.scale, SpriteEffects.None, 0f); + + Main.spriteBatch.End(); + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, RasterizerState.CullCounterClockwise, null, Main.Transform); + return false; + } + } +} diff --git a/Projectiles/OmegaBlueTentacle.png b/Projectiles/Typeless/OmegaBlueTentacle.png similarity index 100% rename from Projectiles/OmegaBlueTentacle.png rename to Projectiles/Typeless/OmegaBlueTentacle.png diff --git a/Projectiles/PoisonousSeawater.cs b/Projectiles/Typeless/PoisonousSeawater.cs similarity index 94% rename from Projectiles/PoisonousSeawater.cs rename to Projectiles/Typeless/PoisonousSeawater.cs index c2fc8d1a26..439d5d1bdb 100644 --- a/Projectiles/PoisonousSeawater.cs +++ b/Projectiles/Typeless/PoisonousSeawater.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Typeless { public class PoisonousSeawater : ModProjectile { diff --git a/Projectiles/PoisonousSeawater.png b/Projectiles/Typeless/PoisonousSeawater.png similarity index 100% rename from Projectiles/PoisonousSeawater.png rename to Projectiles/Typeless/PoisonousSeawater.png diff --git a/Projectiles/ReaverBlast.cs b/Projectiles/Typeless/ReaverBlast.cs similarity index 95% rename from Projectiles/ReaverBlast.cs rename to Projectiles/Typeless/ReaverBlast.cs index 632ff07023..ed1535e9c2 100644 --- a/Projectiles/ReaverBlast.cs +++ b/Projectiles/Typeless/ReaverBlast.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Typeless { public class ReaverBlast : ModProjectile { diff --git a/Projectiles/ReaverBlast.png b/Projectiles/Typeless/ReaverBlast.png similarity index 100% rename from Projectiles/ReaverBlast.png rename to Projectiles/Typeless/ReaverBlast.png diff --git a/Projectiles/RedSpawn.cs b/Projectiles/Typeless/RedSpawn.cs similarity index 90% rename from Projectiles/RedSpawn.cs rename to Projectiles/Typeless/RedSpawn.cs index 3f5383d164..2649e804fe 100644 --- a/Projectiles/RedSpawn.cs +++ b/Projectiles/Typeless/RedSpawn.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Typeless { public class RedSpawn : ModProjectile { diff --git a/Projectiles/RedSpawn.png b/Projectiles/Typeless/RedSpawn.png similarity index 100% rename from Projectiles/RedSpawn.png rename to Projectiles/Typeless/RedSpawn.png diff --git a/Projectiles/Seashell.cs b/Projectiles/Typeless/Seashell.cs similarity index 92% rename from Projectiles/Seashell.cs rename to Projectiles/Typeless/Seashell.cs index 93f1d3f677..ba389f1ece 100644 --- a/Projectiles/Seashell.cs +++ b/Projectiles/Typeless/Seashell.cs @@ -4,7 +4,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Typeless { public class Seashell : ModProjectile { diff --git a/Projectiles/Seashell.png b/Projectiles/Typeless/Seashell.png similarity index 100% rename from Projectiles/Seashell.png rename to Projectiles/Typeless/Seashell.png diff --git a/Projectiles/SkyFlareFriendly.cs b/Projectiles/Typeless/SkyFlareFriendly.cs similarity index 97% rename from Projectiles/SkyFlareFriendly.cs rename to Projectiles/Typeless/SkyFlareFriendly.cs index 711635e9c5..5d4ec8614c 100644 --- a/Projectiles/SkyFlareFriendly.cs +++ b/Projectiles/Typeless/SkyFlareFriendly.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Typeless { public class SkyFlareFriendly : ModProjectile { diff --git a/Projectiles/SkyFlareFriendly.png b/Projectiles/Typeless/SkyFlareFriendly.png similarity index 100% rename from Projectiles/SkyFlareFriendly.png rename to Projectiles/Typeless/SkyFlareFriendly.png diff --git a/Projectiles/SparkInfernal.cs b/Projectiles/Typeless/SparkInfernal.cs similarity index 93% rename from Projectiles/SparkInfernal.cs rename to Projectiles/Typeless/SparkInfernal.cs index 7a846d0e33..42963e4b6d 100644 --- a/Projectiles/SparkInfernal.cs +++ b/Projectiles/Typeless/SparkInfernal.cs @@ -4,7 +4,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Typeless { public class SparkInfernal : ModProjectile { diff --git a/Projectiles/SparkInfernal.png b/Projectiles/Typeless/SparkInfernal.png similarity index 100% rename from Projectiles/SparkInfernal.png rename to Projectiles/Typeless/SparkInfernal.png diff --git a/Projectiles/StandingFire.cs b/Projectiles/Typeless/StandingFire.cs similarity index 95% rename from Projectiles/StandingFire.cs rename to Projectiles/Typeless/StandingFire.cs index d3bd8cf189..65feb1345d 100644 --- a/Projectiles/StandingFire.cs +++ b/Projectiles/Typeless/StandingFire.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Typeless { public class StandingFire : ModProjectile { diff --git a/Projectiles/XerocFire.png b/Projectiles/Typeless/StandingFire.png similarity index 100% rename from Projectiles/XerocFire.png rename to Projectiles/Typeless/StandingFire.png diff --git a/Projectiles/StickyFeatherAero.cs b/Projectiles/Typeless/StickyFeatherAero.cs similarity index 96% rename from Projectiles/StickyFeatherAero.cs rename to Projectiles/Typeless/StickyFeatherAero.cs index 15b1b968cb..48f89d2372 100644 --- a/Projectiles/StickyFeatherAero.cs +++ b/Projectiles/Typeless/StickyFeatherAero.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Typeless { public class StickyFeatherAero : ModProjectile { diff --git a/Projectiles/StickyFeatherAero.png b/Projectiles/Typeless/StickyFeatherAero.png similarity index 100% rename from Projectiles/StickyFeatherAero.png rename to Projectiles/Typeless/StickyFeatherAero.png diff --git a/Projectiles/StormBolt.cs b/Projectiles/Typeless/StormBolt.cs similarity index 93% rename from Projectiles/StormBolt.cs rename to Projectiles/Typeless/StormBolt.cs index b9c89fd769..9094a42858 100644 --- a/Projectiles/StormBolt.cs +++ b/Projectiles/Typeless/StormBolt.cs @@ -4,7 +4,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Typeless { public class StormBolt : ModProjectile { diff --git a/Projectiles/StormBolt.png b/Projectiles/Typeless/StormBolt.png similarity index 100% rename from Projectiles/StormBolt.png rename to Projectiles/Typeless/StormBolt.png diff --git a/Projectiles/TarraEnergy.cs b/Projectiles/Typeless/TarraEnergy.cs similarity index 95% rename from Projectiles/TarraEnergy.cs rename to Projectiles/Typeless/TarraEnergy.cs index f12c8f391c..8cac87bf3b 100644 --- a/Projectiles/TarraEnergy.cs +++ b/Projectiles/Typeless/TarraEnergy.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Typeless { public class TarraEnergy : ModProjectile { diff --git a/Projectiles/Typeless/TarraEnergy.png b/Projectiles/Typeless/TarraEnergy.png new file mode 100644 index 0000000000..0056fc1e24 Binary files /dev/null and b/Projectiles/Typeless/TarraEnergy.png differ diff --git a/Projectiles/TheDeadlyMicrobeProjectile.png b/Projectiles/Typeless/TheDeadlyMicrobeProjectile.png similarity index 100% rename from Projectiles/TheDeadlyMicrobeProjectile.png rename to Projectiles/Typeless/TheDeadlyMicrobeProjectile.png diff --git a/Projectiles/TrueBattleSpawn.cs b/Projectiles/Typeless/TrueBattleSpawn.cs similarity index 90% rename from Projectiles/TrueBattleSpawn.cs rename to Projectiles/Typeless/TrueBattleSpawn.cs index e37e142dc4..e7cfb57f3c 100644 --- a/Projectiles/TrueBattleSpawn.cs +++ b/Projectiles/Typeless/TrueBattleSpawn.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Typeless { public class TrueBattleSpawn : ModProjectile { diff --git a/Projectiles/TrueBattleSpawn.png b/Projectiles/Typeless/TrueBattleSpawn.png similarity index 100% rename from Projectiles/TrueBattleSpawn.png rename to Projectiles/Typeless/TrueBattleSpawn.png diff --git a/Projectiles/VanquisherArrow2.cs b/Projectiles/Typeless/VanquisherArrow2.cs similarity index 95% rename from Projectiles/VanquisherArrow2.cs rename to Projectiles/Typeless/VanquisherArrow2.cs index 2f52a38a73..3daba80403 100644 --- a/Projectiles/VanquisherArrow2.cs +++ b/Projectiles/Typeless/VanquisherArrow2.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Typeless { public class VanquisherArrow2 : ModProjectile { diff --git a/Projectiles/VanquisherArrow2.png b/Projectiles/Typeless/VanquisherArrow2.png similarity index 100% rename from Projectiles/VanquisherArrow2.png rename to Projectiles/Typeless/VanquisherArrow2.png diff --git a/Projectiles/XerocBlast.cs b/Projectiles/Typeless/XerocBlast.cs similarity index 95% rename from Projectiles/XerocBlast.cs rename to Projectiles/Typeless/XerocBlast.cs index b9ca974fe3..17c8948160 100644 --- a/Projectiles/XerocBlast.cs +++ b/Projectiles/Typeless/XerocBlast.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Typeless { public class XerocBlast : ModProjectile { diff --git a/Projectiles/XerocBlast.png b/Projectiles/Typeless/XerocBlast.png similarity index 100% rename from Projectiles/XerocBlast.png rename to Projectiles/Typeless/XerocBlast.png diff --git a/Projectiles/XerocBubble.cs b/Projectiles/Typeless/XerocBubble.cs similarity index 95% rename from Projectiles/XerocBubble.cs rename to Projectiles/Typeless/XerocBubble.cs index f6c84ed047..2884a6a73d 100644 --- a/Projectiles/XerocBubble.cs +++ b/Projectiles/Typeless/XerocBubble.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Typeless { public class XerocBubble : ModProjectile { diff --git a/Projectiles/XerocBubble.png b/Projectiles/Typeless/XerocBubble.png similarity index 100% rename from Projectiles/XerocBubble.png rename to Projectiles/Typeless/XerocBubble.png diff --git a/Projectiles/XerocFire.cs b/Projectiles/Typeless/XerocFire.cs similarity index 95% rename from Projectiles/XerocFire.cs rename to Projectiles/Typeless/XerocFire.cs index 68cd213c20..6322692240 100644 --- a/Projectiles/XerocFire.cs +++ b/Projectiles/Typeless/XerocFire.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Typeless { public class XerocFire : ModProjectile { diff --git a/Projectiles/Typeless/XerocFire.png b/Projectiles/Typeless/XerocFire.png new file mode 100644 index 0000000000..28f94674d6 Binary files /dev/null and b/Projectiles/Typeless/XerocFire.png differ diff --git a/Projectiles/XerocOrb.cs b/Projectiles/Typeless/XerocOrb.cs similarity index 96% rename from Projectiles/XerocOrb.cs rename to Projectiles/Typeless/XerocOrb.cs index 359a0f6b4d..6e3f7b3a1a 100644 --- a/Projectiles/XerocOrb.cs +++ b/Projectiles/Typeless/XerocOrb.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Typeless { public class XerocOrb : ModProjectile { diff --git a/Projectiles/XerocOrb.png b/Projectiles/Typeless/XerocOrb.png similarity index 100% rename from Projectiles/XerocOrb.png rename to Projectiles/Typeless/XerocOrb.png diff --git a/Projectiles/XerocStar.cs b/Projectiles/Typeless/XerocStar.cs similarity index 95% rename from Projectiles/XerocStar.cs rename to Projectiles/Typeless/XerocStar.cs index 552215b5e2..3f039d6553 100644 --- a/Projectiles/XerocStar.cs +++ b/Projectiles/Typeless/XerocStar.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles +namespace CalamityMod.Projectiles.Typeless { public class XerocStar : ModProjectile { diff --git a/Projectiles/XerocStar.png b/Projectiles/Typeless/XerocStar.png similarity index 100% rename from Projectiles/XerocStar.png rename to Projectiles/Typeless/XerocStar.png diff --git a/Projectiles/Vehemence.png b/Projectiles/Vehemence.png deleted file mode 100644 index 389700308e..0000000000 Binary files a/Projectiles/Vehemence.png and /dev/null differ diff --git a/Projectiles/WaterSpearFriendly.png b/Projectiles/WaterSpearFriendly.png deleted file mode 100644 index c5b595d096..0000000000 Binary files a/Projectiles/WaterSpearFriendly.png and /dev/null differ diff --git a/Projectiles/YharimsCrystal.png b/Projectiles/YharimsCrystal.png deleted file mode 100644 index 5b6217dcfe..0000000000 Binary files a/Projectiles/YharimsCrystal.png and /dev/null differ diff --git a/Sounds/Custom/AdrenalineBurnout1.cs b/Sounds/Custom/AdrenalineBurnout1.cs new file mode 100644 index 0000000000..55cdea9707 --- /dev/null +++ b/Sounds/Custom/AdrenalineBurnout1.cs @@ -0,0 +1,18 @@ +using Microsoft.Xna.Framework.Audio; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Sounds.Custom +{ + public class AdrenalineBurnout1 : ModSound + { + public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan, SoundType type) + { + soundInstance = sound.CreateInstance(); + soundInstance.Volume = volume * 1f; + soundInstance.Pan = pan; + Main.PlaySoundInstance(soundInstance); + return soundInstance; + } + } +} \ No newline at end of file diff --git a/Sounds/Custom/AdrenalineBurnout1.wav b/Sounds/Custom/AdrenalineBurnout1.wav new file mode 100644 index 0000000000..cee133c615 Binary files /dev/null and b/Sounds/Custom/AdrenalineBurnout1.wav differ diff --git a/Sounds/Custom/AdrenalineBurnout2.cs b/Sounds/Custom/AdrenalineBurnout2.cs new file mode 100644 index 0000000000..4231676f1a --- /dev/null +++ b/Sounds/Custom/AdrenalineBurnout2.cs @@ -0,0 +1,18 @@ +using Microsoft.Xna.Framework.Audio; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Sounds.Custom +{ + public class AdrenalineBurnout2 : ModSound + { + public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan, SoundType type) + { + soundInstance = sound.CreateInstance(); + soundInstance.Volume = volume * 1f; + soundInstance.Pan = pan; + Main.PlaySoundInstance(soundInstance); + return soundInstance; + } + } +} \ No newline at end of file diff --git a/Sounds/Custom/AdrenalineBurnout2.wav b/Sounds/Custom/AdrenalineBurnout2.wav new file mode 100644 index 0000000000..0aa80f483c Binary files /dev/null and b/Sounds/Custom/AdrenalineBurnout2.wav differ diff --git a/Sounds/Custom/BazookaRocket.cs b/Sounds/Custom/BazookaRocket.cs index 58031295e9..6be8d4e9c6 100644 --- a/Sounds/Custom/BazookaRocket.cs +++ b/Sounds/Custom/BazookaRocket.cs @@ -1,18 +1,18 @@ -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom -{ - public class BazookaRocket : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan, SoundType type) - { - soundInstance = sound.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - Main.PlaySoundInstance(soundInstance); - return soundInstance; - } - } +using Microsoft.Xna.Framework.Audio; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Sounds.Custom +{ + public class BazookaRocket : ModSound + { + public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan, SoundType type) + { + soundInstance = sound.CreateInstance(); + soundInstance.Volume = volume * 1f; + soundInstance.Pan = pan; + Main.PlaySoundInstance(soundInstance); + return soundInstance; + } + } } \ No newline at end of file diff --git a/Sounds/Custom/DevilMaskBreak.cs b/Sounds/Custom/DevilMaskBreak.cs index 9f3f229ebb..7c6368fe9d 100644 --- a/Sounds/Custom/DevilMaskBreak.cs +++ b/Sounds/Custom/DevilMaskBreak.cs @@ -1,18 +1,18 @@ -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom -{ - public class DevilMaskBreak : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan, SoundType type) - { - soundInstance = sound.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - Main.PlaySoundInstance(soundInstance); - return soundInstance; - } - } -} +using Microsoft.Xna.Framework.Audio; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Sounds.Custom +{ + public class DevilMaskBreak : ModSound + { + public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan, SoundType type) + { + soundInstance = sound.CreateInstance(); + soundInstance.Volume = volume * 1f; + soundInstance.Pan = pan; + Main.PlaySoundInstance(soundInstance); + return soundInstance; + } + } +} diff --git a/Sounds/Custom/FullAdrenaline.cs b/Sounds/Custom/FullAdrenaline.cs index 28566d730f..f9b1c38153 100644 --- a/Sounds/Custom/FullAdrenaline.cs +++ b/Sounds/Custom/FullAdrenaline.cs @@ -1,18 +1,18 @@ -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom -{ - public class FullAdrenaline : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan, SoundType type) - { - soundInstance = sound.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - Main.PlaySoundInstance(soundInstance); - return soundInstance; - } - } +using Microsoft.Xna.Framework.Audio; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Sounds.Custom +{ + public class FullAdrenaline : ModSound + { + public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan, SoundType type) + { + soundInstance = sound.CreateInstance(); + soundInstance.Volume = volume * 1f; + soundInstance.Pan = pan; + Main.PlaySoundInstance(soundInstance); + return soundInstance; + } + } } \ No newline at end of file diff --git a/Sounds/Custom/FullRage.cs b/Sounds/Custom/FullRage.cs index 2efb6baae7..30747d0056 100644 --- a/Sounds/Custom/FullRage.cs +++ b/Sounds/Custom/FullRage.cs @@ -1,18 +1,18 @@ -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom -{ - public class FullRage : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan, SoundType type) - { - soundInstance = sound.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - Main.PlaySoundInstance(soundInstance); - return soundInstance; - } - } +using Microsoft.Xna.Framework.Audio; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Sounds.Custom +{ + public class FullRage : ModSound + { + public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan, SoundType type) + { + soundInstance = sound.CreateInstance(); + soundInstance.Volume = volume * 1f; + soundInstance.Pan = pan; + Main.PlaySoundInstance(soundInstance); + return soundInstance; + } + } } \ No newline at end of file diff --git a/Sounds/Custom/RogueStealth.cs b/Sounds/Custom/RogueStealth.cs new file mode 100644 index 0000000000..5c142c3338 --- /dev/null +++ b/Sounds/Custom/RogueStealth.cs @@ -0,0 +1,18 @@ +using Microsoft.Xna.Framework.Audio; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Sounds.Custom +{ + public class RogueStealth : ModSound + { + public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan, SoundType type) + { + soundInstance = sound.CreateInstance(); + soundInstance.Volume = volume * 1f; + soundInstance.Pan = pan; + Main.PlaySoundInstance(soundInstance); + return soundInstance; + } + } +} \ No newline at end of file diff --git a/Sounds/Custom/RogueStealth.wav b/Sounds/Custom/RogueStealth.wav new file mode 100644 index 0000000000..320b47b806 Binary files /dev/null and b/Sounds/Custom/RogueStealth.wav differ diff --git a/Sounds/Custom/SilvaActivation.cs b/Sounds/Custom/SilvaActivation.cs new file mode 100644 index 0000000000..20a2842ae3 --- /dev/null +++ b/Sounds/Custom/SilvaActivation.cs @@ -0,0 +1,18 @@ +using Microsoft.Xna.Framework.Audio; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Sounds.Custom +{ + public class SilvaActivation : ModSound + { + public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan, SoundType type) + { + soundInstance = sound.CreateInstance(); + soundInstance.Volume = volume * 1f; + soundInstance.Pan = pan; + Main.PlaySoundInstance(soundInstance); + return soundInstance; + } + } +} \ No newline at end of file diff --git a/Sounds/Custom/SilvaActivation.wav b/Sounds/Custom/SilvaActivation.wav new file mode 100644 index 0000000000..63e3439ae6 Binary files /dev/null and b/Sounds/Custom/SilvaActivation.wav differ diff --git a/Sounds/Custom/SilvaDispel.cs b/Sounds/Custom/SilvaDispel.cs new file mode 100644 index 0000000000..a26a6e81fa --- /dev/null +++ b/Sounds/Custom/SilvaDispel.cs @@ -0,0 +1,18 @@ +using Microsoft.Xna.Framework.Audio; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Sounds.Custom +{ + public class SilvaDispel : ModSound + { + public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan, SoundType type) + { + soundInstance = sound.CreateInstance(); + soundInstance.Volume = volume * 1f; + soundInstance.Pan = pan; + Main.PlaySoundInstance(soundInstance); + return soundInstance; + } + } +} \ No newline at end of file diff --git a/Sounds/Custom/SilvaDispel.wav b/Sounds/Custom/SilvaDispel.wav new file mode 100644 index 0000000000..9b1e092225 Binary files /dev/null and b/Sounds/Custom/SilvaDispel.wav differ diff --git a/Sounds/Item/BazookaFull.cs b/Sounds/Item/BazookaFull.cs index 706b192231..f0b1b62eba 100644 --- a/Sounds/Item/BazookaFull.cs +++ b/Sounds/Item/BazookaFull.cs @@ -1,18 +1,18 @@ -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Item -{ - public class BazookaFull : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan, SoundType type) - { - soundInstance = sound.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - Main.PlaySoundInstance(soundInstance); - return soundInstance; - } - } -} +using Microsoft.Xna.Framework.Audio; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Sounds.Item +{ + public class BazookaFull : ModSound + { + public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan, SoundType type) + { + soundInstance = sound.CreateInstance(); + soundInstance.Volume = volume * 1f; + soundInstance.Pan = pan; + Main.PlaySoundInstance(soundInstance); + return soundInstance; + } + } +} diff --git a/Sounds/Item/ClamImpact.cs b/Sounds/Item/ClamImpact.cs new file mode 100644 index 0000000000..9fd8b71338 --- /dev/null +++ b/Sounds/Item/ClamImpact.cs @@ -0,0 +1,18 @@ +using Microsoft.Xna.Framework.Audio; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Sounds.Item +{ + public class ClamImpact : ModSound + { + public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan, SoundType type) + { + soundInstance = sound.CreateInstance(); + soundInstance.Volume = volume * 1f; + soundInstance.Pan = pan; + Main.PlaySoundInstance(soundInstance); + return soundInstance; + } + } +} diff --git a/Sounds/Item/ClamImpact.wav b/Sounds/Item/ClamImpact.wav new file mode 100644 index 0000000000..9d7500434b Binary files /dev/null and b/Sounds/Item/ClamImpact.wav differ diff --git a/Sounds/Item/Hydra.cs b/Sounds/Item/Hydra.cs index 65397a6c00..6c9a272856 100644 --- a/Sounds/Item/Hydra.cs +++ b/Sounds/Item/Hydra.cs @@ -1,18 +1,18 @@ -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Item -{ - public class Hydra : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan, SoundType type) - { - soundInstance = sound.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - Main.PlaySoundInstance(soundInstance); - return soundInstance; - } - } -} +using Microsoft.Xna.Framework.Audio; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Sounds.Item +{ + public class Hydra : ModSound + { + public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan, SoundType type) + { + soundInstance = sound.CreateInstance(); + soundInstance.Volume = volume * 1f; + soundInstance.Pan = pan; + Main.PlaySoundInstance(soundInstance); + return soundInstance; + } + } +} diff --git a/Sounds/Item/Magnum.cs b/Sounds/Item/Magnum.cs index 01b9968393..a3d8f4e9a8 100644 --- a/Sounds/Item/Magnum.cs +++ b/Sounds/Item/Magnum.cs @@ -1,18 +1,18 @@ -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Item -{ - public class Magnum : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan, SoundType type) - { - soundInstance = sound.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - Main.PlaySoundInstance(soundInstance); - return soundInstance; - } - } -} +using Microsoft.Xna.Framework.Audio; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Sounds.Item +{ + public class Magnum : ModSound + { + public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan, SoundType type) + { + soundInstance = sound.CreateInstance(); + soundInstance.Volume = volume * 1f; + soundInstance.Pan = pan; + Main.PlaySoundInstance(soundInstance); + return soundInstance; + } + } +} diff --git a/Sounds/Item/TankCannon.cs b/Sounds/Item/TankCannon.cs new file mode 100644 index 0000000000..21e1f6194c --- /dev/null +++ b/Sounds/Item/TankCannon.cs @@ -0,0 +1,19 @@ +using Microsoft.Xna.Framework.Audio; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Sounds.Item +{ + public class TankCannon : ModSound + { + public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan, SoundType type) + { + soundInstance = sound.CreateInstance(); + soundInstance.Volume = volume * 1.85f; + soundInstance.Pan = pan; + soundInstance.Pitch = (float)Main.rand.Next(-25, 26) * 0.01f; + Main.PlaySoundInstance(soundInstance); + return soundInstance; + } + } +} diff --git a/Sounds/Item/TankCannon.wav b/Sounds/Item/TankCannon.wav new file mode 100644 index 0000000000..4d6ea145c1 Binary files /dev/null and b/Sounds/Item/TankCannon.wav differ diff --git a/Tiles/Astral/AstralChestLocked.cs b/Tiles/Astral/AstralChestLocked.cs new file mode 100644 index 0000000000..ac2f790e07 --- /dev/null +++ b/Tiles/Astral/AstralChestLocked.cs @@ -0,0 +1,235 @@ +using System; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.DataStructures; +using Terraria.Enums; +using Terraria.ID; +using Terraria.Localization; +using Terraria.ModLoader; +using Terraria.ObjectData; +using Terraria.GameInput; +using Terraria.GameContent.Achievements; + +namespace CalamityMod.Tiles.Astral +{ + public class AstralChestLocked : ModTile + { + public override void SetDefaults() + { + Main.tileSpelunker[Type] = true; + Main.tileContainer[Type] = true; + Main.tileShine2[Type] = true; + Main.tileShine[Type] = 1200; + Main.tileFrameImportant[Type] = true; + Main.tileNoAttach[Type] = true; + Main.tileValue[Type] = 500; + TileID.Sets.HasOutlines[Type] = true; + TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); + TileObjectData.newTile.Origin = new Point16(0, 1); + TileObjectData.newTile.CoordinateHeights = new int[] { 16, 18 }; + TileObjectData.newTile.HookCheck = new PlacementHook(new Func(Chest.FindEmptyChest), -1, 0, true); + TileObjectData.newTile.HookPostPlaceMyPlayer = new PlacementHook(new Func(Chest.AfterPlacement_Hook), -1, 0, false); + TileObjectData.newTile.AnchorInvalidTiles = new int[] { 127 }; + TileObjectData.newTile.StyleHorizontal = true; + TileObjectData.newTile.LavaDeath = false; + TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.SolidSide, TileObjectData.newTile.Width, 0); + TileObjectData.addTile(Type); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Astral Chest"); + AddMapEntry(new Color(174, 129, 92), name, MapChestName); + dustType = mod.DustType("AstralBasic"); + disableSmartCursor = true; + adjTiles = new int[] { TileID.Containers }; + chest = "Astral Chest"; + chestDrop = mod.ItemType("AstralChest"); + } + + public override bool HasSmartInteract() + { + return true; + } + + public string MapChestName(string name, int i, int j) + { + int left = i; + int top = j; + Tile tile = Main.tile[i, j]; + if (tile == null) + { + return name; + } + if (tile.frameX % 36 != 0) + { + left--; + } + if (tile.frameY != 0) + { + top--; + } + int chest = Chest.FindChest(left, top); + string newName = name; + if (Chest.isLocked(left, top)) + { + newName = "Locked " + newName; + } + if (chest == -1 || Main.chest[chest].name == "") + { + return newName; + } + else + { + return newName + ": " + Main.chest[chest].name; + } + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = 1; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 32, 32, chestDrop); + Chest.DestroyChest(i, j); + } + + public override void RightClick(int i, int j) + { + Player player = Main.LocalPlayer; + Tile tile = Main.tile[i, j]; + Main.mouseRightRelease = false; + int left = i; + int top = j; + if (tile.frameX % 36 != 0) + { + left--; + } + if (tile.frameY != 0) + { + top--; + } + if (player.sign >= 0) + { + Main.PlaySound(SoundID.MenuClose); + player.sign = -1; + Main.editSign = false; + Main.npcChatText = ""; + } + if (Main.editChest) + { + Main.PlaySound(SoundID.MenuTick); + Main.editChest = false; + Main.npcChatText = ""; + } + if (player.editedChestName) + { + NetMessage.SendData(33, -1, -1, NetworkText.FromLiteral(Main.chest[player.chest].name), player.chest, 1f, 0f, 0f, 0, 0, 0); + player.editedChestName = false; + } + if (Main.netMode == 1 && Main.tile[left, top].frameX < 72) + { + if (left == player.chestX && top == player.chestY && player.chest >= 0) + { + player.chest = -1; + Recipe.FindRecipes(); + Main.PlaySound(SoundID.MenuClose); + } + else + { + NetMessage.SendData(31, -1, -1, null, left, (float)top, 0f, 0f, 0, 0, 0); + Main.stackSplit = 600; + } + } + else + { + if (Chest.isLocked(left, top)) + { + if (!CalamityWorld.downedStarGod) + { + return; + } + if (Chest.Unlock(left, top)) + { + AchievementsHelper.NotifyProgressionEvent(AchievementHelperID.Events.UnlockedBiomeChest); + if (Main.netMode == NetmodeID.MultiplayerClient) + { + NetMessage.SendData(MessageID.Unlock, -1, -1, null, player.whoAmI, 1f, left, top); + } + } + } + else + { + int chest = Chest.FindChest(left, top); + if (chest >= 0) + { + Main.stackSplit = 600; + if (chest == player.chest) + { + player.chest = -1; + Main.PlaySound(SoundID.MenuClose); + } + else + { + player.chest = chest; + Main.playerInventory = true; + if (PlayerInput.GrappleAndInteractAreShared) + { + PlayerInput.Triggers.JustPressed.Grapple = false; + } + Main.recBigList = false; + player.chestX = left; + player.chestY = top; + Main.PlaySound(player.chest < 0 ? SoundID.MenuOpen : SoundID.MenuTick); + } + Recipe.FindRecipes(); + } + } + } + } + + public override void MouseOver(int i, int j) + { + Player player = Main.LocalPlayer; + Tile tile = Main.tile[i, j]; + int left = i; + int top = j; + if (tile.frameX % 36 != 0) + { + left--; + } + if (tile.frameY != 0) + { + top--; + } + int chest = Chest.FindChest(left, top); + player.showItemIcon2 = -1; + if (chest < 0) + { + player.showItemIconText = Language.GetTextValue("LegacyChestType.0"); + } + else + { + player.showItemIconText = Main.chest[chest].name.Length > 0 ? Main.chest[chest].name : "Astral Chest"; + if (player.showItemIconText == "Astral Chest") + { + player.showItemIcon2 = mod.ItemType("AstralChestLocked"); + player.showItemIconText = ""; + } + } + player.noThrow = 2; + player.showItemIcon = true; + } + + public override void MouseOverFar(int i, int j) + { + MouseOver(i, j); + Player player = Main.LocalPlayer; + if (player.showItemIconText == "") + { + player.showItemIcon = false; + player.showItemIcon2 = 0; + } + } + } +} \ No newline at end of file diff --git a/Tiles/Astral/AstralChestLocked.png b/Tiles/Astral/AstralChestLocked.png new file mode 100644 index 0000000000..e89b474a0a Binary files /dev/null and b/Tiles/Astral/AstralChestLocked.png differ diff --git a/Tiles/Astral/AstralChestLocked_Highlight.png b/Tiles/Astral/AstralChestLocked_Highlight.png new file mode 100644 index 0000000000..bdb785f0a2 Binary files /dev/null and b/Tiles/Astral/AstralChestLocked_Highlight.png differ diff --git a/Tiles/BlueCandle.cs b/Tiles/BlueCandle.cs new file mode 100644 index 0000000000..4d919c90d1 --- /dev/null +++ b/Tiles/BlueCandle.cs @@ -0,0 +1,55 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles +{ + public class BlueCandle : ModTile + { + public override void SetDefaults() + { + Main.tileLighted[Type] = true; + Main.tileFrameImportant[Type] = true; + Main.tileLavaDeath[Type] = true; + TileObjectData.newTile.CopyFrom(TileObjectData.Style1x2); + TileObjectData.addTile(Type); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Weightless Candle"); + AddMapEntry(new Color(238, 145, 105), name); + animationFrameHeight = 34; + } + + public override void AnimateTile(ref int frame, ref int frameCounter) + { + frameCounter++; + if (frameCounter >= 6) + { + frame = (frame + 1) % 6; + frameCounter = 0; + } + } + + public override void NearbyEffects(int i, int j, bool closer) + { + Player player = Main.LocalPlayer; + if (!player.dead && player.active) + player.AddBuff(mod.BuffType("BlueSpeedCandle"), 20); + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + r = 0.35f; + g = 0.55f; + b = 0.85f; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 16, 32, mod.ItemType("BlueCandle")); + } + } +} diff --git a/Tiles/BlueCandle.png b/Tiles/BlueCandle.png new file mode 100644 index 0000000000..db4aea46c8 Binary files /dev/null and b/Tiles/BlueCandle.png differ diff --git a/Tiles/BossTrophy.png b/Tiles/BossTrophy.png index 3f3d0b5f17..5d6ce0f30c 100644 Binary files a/Tiles/BossTrophy.png and b/Tiles/BossTrophy.png differ diff --git a/Tiles/CalamityGlobalTile.cs b/Tiles/CalamityGlobalTile.cs index 3c5dce85a2..f51c603834 100644 --- a/Tiles/CalamityGlobalTile.cs +++ b/Tiles/CalamityGlobalTile.cs @@ -12,580 +12,569 @@ using CalamityMod.NPCs; namespace CalamityMod.Tiles { - public class CalamityGlobalTile : GlobalTile - { - public static ushort[] PlantTypes = new ushort[] - { - TileID.Plants, - TileID.CorruptPlants, - TileID.JunglePlants, - TileID.MushroomPlants, - TileID.Plants2, - TileID.JunglePlants2, - TileID.HallowedPlants, - TileID.HallowedPlants2, - TileID.FleshWeeds, - (ushort)CalamityMod.Instance.TileType("AstralShortPlants"), - (ushort)CalamityMod.Instance.TileType("AstralTallPlants") - }; + public class CalamityGlobalTile : GlobalTile + { + public static ushort[] PlantTypes = new ushort[] + { + TileID.Plants, + TileID.CorruptPlants, + TileID.JunglePlants, + TileID.MushroomPlants, + TileID.Plants2, + TileID.JunglePlants2, + TileID.HallowedPlants, + TileID.HallowedPlants2, + TileID.FleshWeeds, + (ushort)CalamityMod.Instance.TileType("AstralShortPlants"), + (ushort)CalamityMod.Instance.TileType("AstralTallPlants") + }; - public override bool TileFrame(int i, int j, int type, ref bool resetFrame, ref bool noBreak) - { - for (int k = 0; k < PlantTypes.Length; k++) - { - if (PlantTypes[k] == type) - { - CustomTileFraming.CheckPlants(i, j); - return false; - } - } - if (type == TileID.Vines || type == TileID.CrimsonVines || type == TileID.HallowedVines || type == mod.TileType("AstralVines")) - { - CustomTileFraming.VineFrame(i, j); - return false; - } - return base.TileFrame(i, j, type, ref resetFrame, ref noBreak); - } + public override bool TileFrame(int i, int j, int type, ref bool resetFrame, ref bool noBreak) + { + for (int k = 0; k < PlantTypes.Length; k++) + { + if (PlantTypes[k] == type) + { + CustomTileFraming.CheckPlants(i, j); + return false; + } + } + if (type == TileID.Vines || type == TileID.CrimsonVines || type == TileID.HallowedVines || type == mod.TileType("AstralVines")) + { + CustomTileFraming.VineFrame(i, j); + return false; + } + return base.TileFrame(i, j, type, ref resetFrame, ref noBreak); + } - public override void PostDraw(int i, int j, int type, SpriteBatch spriteBatch) - { - Tile tile = Main.tile[i, j]; + public override void PostDraw(int i, int j, int type, SpriteBatch spriteBatch) + { + Tile tile = Main.tile[i, j]; - if (type == TileID.Cactus) - { - //GRABBING VARIABLES FOR CERTAIN THINGS - Vector2 zero = new Vector2(Main.offScreenRange, Main.offScreenRange); - if (Main.drawToScreen) - zero = Vector2.Zero; - //TESTING STUFF - int frameX = tile.frameX; - int frameY = tile.frameY; - bool astralCactus = false; - if (!Main.canDrawColorTile(i, j)) - { - int xTile = i; - if (frameX == 36) - { - xTile--; - } - if (frameX == 54) - { - xTile++; - } - if (frameX == 108) - { - if (frameY == 18) - { - xTile--; - } - else - { - xTile++; - } - } - int yTile = j; - bool flag = false; - if (Main.tile[xTile, yTile].type == 80 && Main.tile[xTile, yTile].active()) - { - flag = true; - } - while (!Main.tile[xTile, yTile].active() || !Main.tileSolid[(int)Main.tile[xTile, yTile].type] || !flag) - { - if (Main.tile[xTile, yTile].type == 80 && Main.tile[xTile, yTile].active()) - { - flag = true; - } - yTile++; - if (yTile > i + 20) - { - break; - } - } - //CACTUS CHECK - if (Main.tile[xTile, yTile].type == (ushort)mod.TileType("AstralSand")) - { - astralCactus = true; - } - } - //Draw Glow - if (astralCactus) - { - spriteBatch.Draw(CalamityMod.AstralCactusGlowTexture, new Vector2((float)(i * 16 - (int)Main.screenPosition.X), (float)(j * 16 - (int)Main.screenPosition.Y)) + zero, new Rectangle((int)frameX, (int)frameY, 16, 18), Color.White * 0.75f, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); - } - return; - } - } + if (type == TileID.Cactus) + { + //GRABBING VARIABLES FOR CERTAIN THINGS + Vector2 zero = new Vector2(Main.offScreenRange, Main.offScreenRange); + if (Main.drawToScreen) + zero = Vector2.Zero; + //TESTING STUFF + int frameX = tile.frameX; + int frameY = tile.frameY; + bool astralCactus = false; + if (!Main.canDrawColorTile(i, j)) + { + int xTile = i; + if (frameX == 36) + { + xTile--; + } + if (frameX == 54) + { + xTile++; + } + if (frameX == 108) + { + if (frameY == 18) + { + xTile--; + } + else + { + xTile++; + } + } + int yTile = j; + bool flag = false; + if (Main.tile[xTile, yTile].type == 80 && Main.tile[xTile, yTile].active()) + { + flag = true; + } + while (!Main.tile[xTile, yTile].active() || !Main.tileSolid[(int)Main.tile[xTile, yTile].type] || !flag) + { + if (Main.tile[xTile, yTile].type == 80 && Main.tile[xTile, yTile].active()) + { + flag = true; + } + yTile++; + if (yTile > i + 20) + { + break; + } + } + //CACTUS CHECK + if (Main.tile[xTile, yTile].type == (ushort)mod.TileType("AstralSand")) + { + astralCactus = true; + } + } + //Draw Glow + if (astralCactus) + { + spriteBatch.Draw(CalamityMod.AstralCactusGlowTexture, new Vector2((float)(i * 16 - (int)Main.screenPosition.X), (float)(j * 16 - (int)Main.screenPosition.Y)) + zero, new Rectangle((int)frameX, (int)frameY, 16, 18), Color.White * 0.75f, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + } + return; + } + } - public override bool Drop(int i, int j, int type) - { - if (type == 28) - { - int x = Main.maxTilesX; - int y = Main.maxTilesY; - int genLimit = x / 2; - int abyssChasmSteps = y / 4; - int abyssChasmY = ((y - abyssChasmSteps) + (int)((double)y * 0.055)); //132 = 1932 large - if (y < 1500) - { - abyssChasmY = ((y - abyssChasmSteps) + (int)((double)y * 0.095)); //114 = 1014 small - } - else if (y < 2100) - { - abyssChasmY = ((y - abyssChasmSteps) + (int)((double)y * 0.0735)); //132 = 1482 medium - } - int abyssChasmX = (CalamityWorld.abyssSide ? genLimit - (genLimit - 135) : genLimit + (genLimit - 135)); + public override void KillTile(int i, int j, int type, ref bool fail, ref bool effectOnly, ref bool noItem) + { + if (Main.tile[i, j].type != mod.TileType("LumenylCrystals") && Main.tile[i, j].type != mod.TileType("SeaPrismCrystals") && Main.tileSolid[Main.tile[i, j].type]) + { + if (Main.tile[i + 1, j] != null) + { + if (Main.tile[i + 1, j].active()) + { + if (Main.tile[i + 1, j].type == mod.TileType("LumenylCrystals") || (Main.tile[i + 1, j].type == mod.TileType("SeaPrismCrystals") && CalamityWorld.downedDesertScourge)) + { + WorldGen.KillTile(i + 1, j, false, false, false); + if (!Main.tile[i + 1, j].active() && Main.netMode != 0) + { + NetMessage.SendData(17, -1, -1, null, 0, (float)i + 1, (float)j, 0f, 0, 0, 0); + } + } + } + } + if (Main.tile[i - 1, j] != null) + { + if (Main.tile[i - 1, j].active()) + { + if (Main.tile[i - 1, j].type == mod.TileType("LumenylCrystals") || (Main.tile[i - 1, j].type == mod.TileType("SeaPrismCrystals") && CalamityWorld.downedDesertScourge)) + { + WorldGen.KillTile(i - 1, j, false, false, false); + if (!Main.tile[i - 1, j].active() && Main.netMode != 0) + { + NetMessage.SendData(17, -1, -1, null, 0, (float)i - 1, (float)j, 0f, 0, 0, 0); + } + } + } + } + if (Main.tile[i, j + 1] != null) + { + if (Main.tile[i, j + 1].active()) + { + if (Main.tile[i, j + 1].type == mod.TileType("LumenylCrystals") || (Main.tile[i, j + 1].type == mod.TileType("SeaPrismCrystals") && CalamityWorld.downedDesertScourge)) + { + WorldGen.KillTile(i, j + 1, false, false, false); + if (!Main.tile[i, j + 1].active() && Main.netMode != 0) + { + NetMessage.SendData(17, -1, -1, null, 0, (float)i, (float)j + 1, 0f, 0, 0, 0); + } + } + } + } + if (Main.tile[i, j - 1] != null) + { + if (Main.tile[i, j - 1].active()) + { + if (Main.tile[i, j - 1].type == mod.TileType("LumenylCrystals") || (Main.tile[i, j - 1].type == mod.TileType("SeaPrismCrystals") && CalamityWorld.downedDesertScourge)) + { + WorldGen.KillTile(i, j - 1, false, false, false); + if (!Main.tile[i, j - 1].active() && Main.netMode != 0) + { + NetMessage.SendData(17, -1, -1, null, 0, (float)i, (float)j - 1, 0f, 0, 0, 0); + } + } + } + } + } + } - bool abyssPosX = false; - bool sulphurPosX = false; - bool abyssPosY = (j <= abyssChasmY); - if (CalamityWorld.abyssSide) - { - if (i < 380) - { - sulphurPosX = true; - } - if (i < abyssChasmX + 80) - { - abyssPosX = true; - } - } - else - { - if (i > Main.maxTilesX - 380) - { - sulphurPosX = true; - } - if (i > abyssChasmX - 80) - { - abyssPosX = true; - } - } - if (abyssPosX && abyssPosY) - { - if (Main.rand.Next(10) == 0) - { - int expr_B64 = WorldGen.genRand.Next(15); - if (expr_B64 == 0) - { - Item.NewItem(i * 16, j * 16, 16, 16, 296, 1, false, 0, false, false); - } - if (expr_B64 == 1) - { - Item.NewItem(i * 16, j * 16, 16, 16, 294, 1, false, 0, false, false); - } - if (expr_B64 == 2) - { - Item.NewItem(i * 16, j * 16, 16, 16, 298, 1, false, 0, false, false); - } - if (expr_B64 == 3) - { - Item.NewItem(i * 16, j * 16, 16, 16, 302, 1, false, 0, false, false); - } - if (expr_B64 == 4) - { - Item.NewItem(i * 16, j * 16, 16, 16, 288, 1, false, 0, false, false); - } - if (expr_B64 == 5) - { - Item.NewItem(i * 16, j * 16, 16, 16, 305, 1, false, 0, false, false); - } - if (expr_B64 == 6) - { - Item.NewItem(i * 16, j * 16, 16, 16, 289, 1, false, 0, false, false); - } - if (expr_B64 == 7) - { - Item.NewItem(i * 16, j * 16, 16, 16, 302, 1, false, 0, false, false); - } - if (expr_B64 == 8) - { - Item.NewItem(i * 16, j * 16, 16, 16, mod.ItemType("AnechoicCoating"), 1, false, 0, false, false); - } - if (expr_B64 == 9) - { - Item.NewItem(i * 16, j * 16, 16, 16, 291, 1, false, 0, false, false); - } - if (expr_B64 == 10) - { - Item.NewItem(i * 16, j * 16, 16, 16, 2346, 1, false, 0, false, false); - } - if (expr_B64 == 11) - { - Item.NewItem(i * 16, j * 16, 16, 16, 2323, 1, false, 0, false, false); - } - if (expr_B64 == 12) - { - Item.NewItem(i * 16, j * 16, 16, 16, 2327, 1, false, 0, false, false); - } - if (expr_B64 == 13) - { - Item.NewItem(i * 16, j * 16, 16, 16, 2345, 1, false, 0, false, false); - } - if (expr_B64 == 14) - { - Item.NewItem(i * 16, j * 16, 16, 16, 2348, 1, false, 0, false, false); - } - } - else - { - int num9 = Main.rand.Next(10); //0 to 9 - if (num9 == 0) //spelunker glowsticks - { - int num10 = Main.rand.Next(2, 6); - if (Main.expertMode) - { - num10 += Main.rand.Next(1, 7); - } - Item.NewItem(i * 16, j * 16, 16, 16, 3002, num10, false, 0, false, false); - } - else if (num9 == 1) //hellfire arrows - { - int stack = Main.rand.Next(10, 21); - Item.NewItem(i * 16, j * 16, 16, 16, 265, stack, false, 0, false, false); - } - else if (num9 == 2) //stew - { - Item.NewItem(i * 16, j * 16, 16, 16, mod.ItemType("SunkenStew"), 1, false, 0, false, false); - } - else if (num9 == 3) //sticky dynamite - { - Item.NewItem(i * 16, j * 16, 16, 16, 2896, 1, false, 0, false, false); - } - else //money - { - float num13 = (float)(5000 + WorldGen.genRand.Next(-100, 101)); - while ((int)num13 > 0) - { - if (num13 > 1000000f) - { - int num14 = (int)(num13 / 1000000f); - if (num14 > 50 && Main.rand.Next(2) == 0) - { - num14 /= Main.rand.Next(3) + 1; - } - if (Main.rand.Next(2) == 0) - { - num14 /= Main.rand.Next(3) + 1; - } - num13 -= (float)(1000000 * num14); - Item.NewItem(i * 16, j * 16, 16, 16, 74, num14, false, 0, false, false); - } - else if (num13 > 10000f) - { - int num15 = (int)(num13 / 10000f); - if (num15 > 50 && Main.rand.Next(2) == 0) - { - num15 /= Main.rand.Next(3) + 1; - } - if (Main.rand.Next(2) == 0) - { - num15 /= Main.rand.Next(3) + 1; - } - num13 -= (float)(10000 * num15); - Item.NewItem(i * 16, j * 16, 16, 16, 73, num15, false, 0, false, false); - } - else if (num13 > 100f) - { - int num16 = (int)(num13 / 100f); - if (num16 > 50 && Main.rand.Next(2) == 0) - { - num16 /= Main.rand.Next(3) + 1; - } - if (Main.rand.Next(2) == 0) - { - num16 /= Main.rand.Next(3) + 1; - } - num13 -= (float)(100 * num16); - Item.NewItem(i * 16, j * 16, 16, 16, 72, num16, false, 0, false, false); - } - else - { - int num17 = (int)num13; - if (num17 > 50 && Main.rand.Next(2) == 0) - { - num17 /= Main.rand.Next(3) + 1; - } - if (Main.rand.Next(2) == 0) - { - num17 /= Main.rand.Next(4) + 1; - } - if (num17 < 1) - { - num17 = 1; - } - num13 -= (float)num17; - Item.NewItem(i * 16, j * 16, 16, 16, 71, num17, false, 0, false, false); - } - } - } - } - } - else if (sulphurPosX) - { - if (Main.rand.Next(15) == 0) - { - int expr_B64 = WorldGen.genRand.Next(15); - if (expr_B64 == 0) - { - Item.NewItem(i * 16, j * 16, 16, 16, 296, 1, false, 0, false, false); - } - if (expr_B64 == 1) - { - Item.NewItem(i * 16, j * 16, 16, 16, 294, 1, false, 0, false, false); - } - if (expr_B64 == 2) - { - Item.NewItem(i * 16, j * 16, 16, 16, 298, 1, false, 0, false, false); - } - if (expr_B64 == 3) - { - Item.NewItem(i * 16, j * 16, 16, 16, 302, 1, false, 0, false, false); - } - if (expr_B64 == 4) - { - Item.NewItem(i * 16, j * 16, 16, 16, 288, 1, false, 0, false, false); - } - if (expr_B64 == 5) - { - Item.NewItem(i * 16, j * 16, 16, 16, 305, 1, false, 0, false, false); - } - if (expr_B64 == 6) - { - Item.NewItem(i * 16, j * 16, 16, 16, 289, 1, false, 0, false, false); - } - if (expr_B64 == 7) - { - Item.NewItem(i * 16, j * 16, 16, 16, 302, 1, false, 0, false, false); - } - if (expr_B64 == 8) - { - Item.NewItem(i * 16, j * 16, 16, 16, mod.ItemType("AnechoicCoating"), 1, false, 0, false, false); - } - if (expr_B64 == 9) - { - Item.NewItem(i * 16, j * 16, 16, 16, 291, 1, false, 0, false, false); - } - if (expr_B64 == 10) - { - Item.NewItem(i * 16, j * 16, 16, 16, 2346, 1, false, 0, false, false); - } - if (expr_B64 == 11) - { - Item.NewItem(i * 16, j * 16, 16, 16, 2323, 1, false, 0, false, false); - } - if (expr_B64 == 12) - { - Item.NewItem(i * 16, j * 16, 16, 16, 2327, 1, false, 0, false, false); - } - if (expr_B64 == 13) - { - Item.NewItem(i * 16, j * 16, 16, 16, 2345, 1, false, 0, false, false); - } - if (expr_B64 == 14) - { - Item.NewItem(i * 16, j * 16, 16, 16, 2348, 1, false, 0, false, false); - } - } - else - { - int num9 = Main.rand.Next(10); //0 to 9 - if (num9 == 0) //glowsticks - { - int num10 = Main.rand.Next(2, 6); - if (Main.expertMode) - { - num10 += Main.rand.Next(1, 7); - } - Item.NewItem(i * 16, j * 16, 16, 16, 282, num10, false, 0, false, false); - } - else if (num9 == 1) //jesters arrows - { - int stack = Main.rand.Next(10, 21); - Item.NewItem(i * 16, j * 16, 16, 16, 51, stack, false, 0, false, false); - } - else if (num9 == 2) //potion - { - Item.NewItem(i * 16, j * 16, 16, 16, 188, 1, false, 0, false, false); - } - else if (num9 == 3) //bomb - { - int stack = Main.rand.Next(5, 9); - Item.NewItem(i * 16, j * 16, 16, 16, 166, 1, false, 0, false, false); - } - else //money - { - float num13 = (float)(2500 + WorldGen.genRand.Next(-100, 101)); - while ((int)num13 > 0) - { - if (num13 > 1000000f) - { - int num14 = (int)(num13 / 1000000f); - if (num14 > 50 && Main.rand.Next(2) == 0) - { - num14 /= Main.rand.Next(3) + 1; - } - if (Main.rand.Next(2) == 0) - { - num14 /= Main.rand.Next(3) + 1; - } - num13 -= (float)(1000000 * num14); - Item.NewItem(i * 16, j * 16, 16, 16, 74, num14, false, 0, false, false); - } - else if (num13 > 10000f) - { - int num15 = (int)(num13 / 10000f); - if (num15 > 50 && Main.rand.Next(2) == 0) - { - num15 /= Main.rand.Next(3) + 1; - } - if (Main.rand.Next(2) == 0) - { - num15 /= Main.rand.Next(3) + 1; - } - num13 -= (float)(10000 * num15); - Item.NewItem(i * 16, j * 16, 16, 16, 73, num15, false, 0, false, false); - } - else if (num13 > 100f) - { - int num16 = (int)(num13 / 100f); - if (num16 > 50 && Main.rand.Next(2) == 0) - { - num16 /= Main.rand.Next(3) + 1; - } - if (Main.rand.Next(2) == 0) - { - num16 /= Main.rand.Next(3) + 1; - } - num13 -= (float)(100 * num16); - Item.NewItem(i * 16, j * 16, 16, 16, 72, num16, false, 0, false, false); - } - else - { - int num17 = (int)num13; - if (num17 > 50 && Main.rand.Next(2) == 0) - { - num17 /= Main.rand.Next(3) + 1; - } - if (Main.rand.Next(2) == 0) - { - num17 /= Main.rand.Next(4) + 1; - } - if (num17 < 1) - { - num17 = 1; - } - num13 -= (float)num17; - Item.NewItem(i * 16, j * 16, 16, 16, 71, num17, false, 0, false, false); - } - } - } - } - } - } - return true; - } + public override bool Drop(int i, int j, int type) + { + if (type == 28) + { + int x = Main.maxTilesX; + int y = Main.maxTilesY; + int genLimit = x / 2; + int abyssChasmSteps = y / 4; + int abyssChasmY = ((y - abyssChasmSteps) + (int)((double)y * 0.055)); //132 = 1932 large + if (y < 1500) + { + abyssChasmY = ((y - abyssChasmSteps) + (int)((double)y * 0.095)); //114 = 1014 small + } + else if (y < 2100) + { + abyssChasmY = ((y - abyssChasmSteps) + (int)((double)y * 0.0735)); //132 = 1482 medium + } + int abyssChasmX = (CalamityWorld.abyssSide ? genLimit - (genLimit - 135) : genLimit + (genLimit - 135)); - public override bool PreHitWire(int i, int j, int type) - { - return !CalamityWorld.bossRushActive; - } + bool abyssPosX = false; + bool sulphurPosX = false; + bool abyssPosY = (j <= abyssChasmY); + if (CalamityWorld.abyssSide) + { + if (i < 380) + { + sulphurPosX = true; + } + if (i < abyssChasmX + 80) + { + abyssPosX = true; + } + } + else + { + if (i > Main.maxTilesX - 380) + { + sulphurPosX = true; + } + if (i > abyssChasmX - 80) + { + abyssPosX = true; + } + } + if (abyssPosX && abyssPosY) + { + if (Main.rand.Next(10) == 0) + { + int expr_B64 = WorldGen.genRand.Next(15); + if (expr_B64 == 0) + { + Item.NewItem(i * 16, j * 16, 16, 16, 296, 1, false, 0, false, false); + } + if (expr_B64 == 1) + { + Item.NewItem(i * 16, j * 16, 16, 16, 294, 1, false, 0, false, false); + } + if (expr_B64 == 2) + { + Item.NewItem(i * 16, j * 16, 16, 16, 298, 1, false, 0, false, false); + } + if (expr_B64 == 3) + { + Item.NewItem(i * 16, j * 16, 16, 16, 302, 1, false, 0, false, false); + } + if (expr_B64 == 4) + { + Item.NewItem(i * 16, j * 16, 16, 16, 288, 1, false, 0, false, false); + } + if (expr_B64 == 5) + { + Item.NewItem(i * 16, j * 16, 16, 16, 305, 1, false, 0, false, false); + } + if (expr_B64 == 6) + { + Item.NewItem(i * 16, j * 16, 16, 16, 289, 1, false, 0, false, false); + } + if (expr_B64 == 7) + { + Item.NewItem(i * 16, j * 16, 16, 16, 302, 1, false, 0, false, false); + } + if (expr_B64 == 8) + { + Item.NewItem(i * 16, j * 16, 16, 16, mod.ItemType("AnechoicCoating"), 1, false, 0, false, false); + } + if (expr_B64 == 9) + { + Item.NewItem(i * 16, j * 16, 16, 16, 291, 1, false, 0, false, false); + } + if (expr_B64 == 10) + { + Item.NewItem(i * 16, j * 16, 16, 16, 2346, 1, false, 0, false, false); + } + if (expr_B64 == 11) + { + Item.NewItem(i * 16, j * 16, 16, 16, 2323, 1, false, 0, false, false); + } + if (expr_B64 == 12) + { + Item.NewItem(i * 16, j * 16, 16, 16, 2327, 1, false, 0, false, false); + } + if (expr_B64 == 13) + { + Item.NewItem(i * 16, j * 16, 16, 16, 2345, 1, false, 0, false, false); + } + if (expr_B64 == 14) + { + Item.NewItem(i * 16, j * 16, 16, 16, 2348, 1, false, 0, false, false); + } + } + else + { + int num9 = Main.rand.Next(10); //0 to 9 + if (num9 == 0) //spelunker glowsticks + { + int num10 = Main.rand.Next(2, 6); + if (Main.expertMode) + { + num10 += Main.rand.Next(1, 7); + } + Item.NewItem(i * 16, j * 16, 16, 16, 3002, num10, false, 0, false, false); + } + else if (num9 == 1) //hellfire arrows + { + int stack = Main.rand.Next(10, 21); + Item.NewItem(i * 16, j * 16, 16, 16, 265, stack, false, 0, false, false); + } + else if (num9 == 2) //stew + { + Item.NewItem(i * 16, j * 16, 16, 16, mod.ItemType("SunkenStew"), 1, false, 0, false, false); + } + else if (num9 == 3) //sticky dynamite + { + Item.NewItem(i * 16, j * 16, 16, 16, 2896, 1, false, 0, false, false); + } + else //money + { + float num13 = (float)(5000 + WorldGen.genRand.Next(-100, 101)); + while ((int)num13 > 0) + { + if (num13 > 1000000f) + { + int num14 = (int)(num13 / 1000000f); + if (num14 > 50 && Main.rand.Next(2) == 0) + { + num14 /= Main.rand.Next(3) + 1; + } + if (Main.rand.Next(2) == 0) + { + num14 /= Main.rand.Next(3) + 1; + } + num13 -= (float)(1000000 * num14); + Item.NewItem(i * 16, j * 16, 16, 16, 74, num14, false, 0, false, false); + } + else if (num13 > 10000f) + { + int num15 = (int)(num13 / 10000f); + if (num15 > 50 && Main.rand.Next(2) == 0) + { + num15 /= Main.rand.Next(3) + 1; + } + if (Main.rand.Next(2) == 0) + { + num15 /= Main.rand.Next(3) + 1; + } + num13 -= (float)(10000 * num15); + Item.NewItem(i * 16, j * 16, 16, 16, 73, num15, false, 0, false, false); + } + else if (num13 > 100f) + { + int num16 = (int)(num13 / 100f); + if (num16 > 50 && Main.rand.Next(2) == 0) + { + num16 /= Main.rand.Next(3) + 1; + } + if (Main.rand.Next(2) == 0) + { + num16 /= Main.rand.Next(3) + 1; + } + num13 -= (float)(100 * num16); + Item.NewItem(i * 16, j * 16, 16, 16, 72, num16, false, 0, false, false); + } + else + { + int num17 = (int)num13; + if (num17 > 50 && Main.rand.Next(2) == 0) + { + num17 /= Main.rand.Next(3) + 1; + } + if (Main.rand.Next(2) == 0) + { + num17 /= Main.rand.Next(4) + 1; + } + if (num17 < 1) + { + num17 = 1; + } + num13 -= (float)num17; + Item.NewItem(i * 16, j * 16, 16, 16, 71, num17, false, 0, false, false); + } + } + } + } + } + else if (sulphurPosX) + { + if (Main.rand.Next(15) == 0) + { + int expr_B64 = WorldGen.genRand.Next(15); + if (expr_B64 == 0) + { + Item.NewItem(i * 16, j * 16, 16, 16, 296, 1, false, 0, false, false); + } + if (expr_B64 == 1) + { + Item.NewItem(i * 16, j * 16, 16, 16, 294, 1, false, 0, false, false); + } + if (expr_B64 == 2) + { + Item.NewItem(i * 16, j * 16, 16, 16, 298, 1, false, 0, false, false); + } + if (expr_B64 == 3) + { + Item.NewItem(i * 16, j * 16, 16, 16, 302, 1, false, 0, false, false); + } + if (expr_B64 == 4) + { + Item.NewItem(i * 16, j * 16, 16, 16, 288, 1, false, 0, false, false); + } + if (expr_B64 == 5) + { + Item.NewItem(i * 16, j * 16, 16, 16, 305, 1, false, 0, false, false); + } + if (expr_B64 == 6) + { + Item.NewItem(i * 16, j * 16, 16, 16, 289, 1, false, 0, false, false); + } + if (expr_B64 == 7) + { + Item.NewItem(i * 16, j * 16, 16, 16, 302, 1, false, 0, false, false); + } + if (expr_B64 == 8) + { + Item.NewItem(i * 16, j * 16, 16, 16, mod.ItemType("AnechoicCoating"), 1, false, 0, false, false); + } + if (expr_B64 == 9) + { + Item.NewItem(i * 16, j * 16, 16, 16, 291, 1, false, 0, false, false); + } + if (expr_B64 == 10) + { + Item.NewItem(i * 16, j * 16, 16, 16, 2346, 1, false, 0, false, false); + } + if (expr_B64 == 11) + { + Item.NewItem(i * 16, j * 16, 16, 16, 2323, 1, false, 0, false, false); + } + if (expr_B64 == 12) + { + Item.NewItem(i * 16, j * 16, 16, 16, 2327, 1, false, 0, false, false); + } + if (expr_B64 == 13) + { + Item.NewItem(i * 16, j * 16, 16, 16, 2345, 1, false, 0, false, false); + } + if (expr_B64 == 14) + { + Item.NewItem(i * 16, j * 16, 16, 16, 2348, 1, false, 0, false, false); + } + } + else + { + int num9 = Main.rand.Next(10); //0 to 9 + if (num9 == 0) //glowsticks + { + int num10 = Main.rand.Next(2, 6); + if (Main.expertMode) + { + num10 += Main.rand.Next(1, 7); + } + Item.NewItem(i * 16, j * 16, 16, 16, 282, num10, false, 0, false, false); + } + else if (num9 == 1) //jesters arrows + { + int stack = Main.rand.Next(10, 21); + Item.NewItem(i * 16, j * 16, 16, 16, 51, stack, false, 0, false, false); + } + else if (num9 == 2) //potion + { + Item.NewItem(i * 16, j * 16, 16, 16, 188, 1, false, 0, false, false); + } + else if (num9 == 3) //bomb + { + int stack = Main.rand.Next(5, 9); + Item.NewItem(i * 16, j * 16, 16, 16, 166, 1, false, 0, false, false); + } + else //money + { + float num13 = (float)(2500 + WorldGen.genRand.Next(-100, 101)); + while ((int)num13 > 0) + { + if (num13 > 1000000f) + { + int num14 = (int)(num13 / 1000000f); + if (num14 > 50 && Main.rand.Next(2) == 0) + { + num14 /= Main.rand.Next(3) + 1; + } + if (Main.rand.Next(2) == 0) + { + num14 /= Main.rand.Next(3) + 1; + } + num13 -= (float)(1000000 * num14); + Item.NewItem(i * 16, j * 16, 16, 16, 74, num14, false, 0, false, false); + } + else if (num13 > 10000f) + { + int num15 = (int)(num13 / 10000f); + if (num15 > 50 && Main.rand.Next(2) == 0) + { + num15 /= Main.rand.Next(3) + 1; + } + if (Main.rand.Next(2) == 0) + { + num15 /= Main.rand.Next(3) + 1; + } + num13 -= (float)(10000 * num15); + Item.NewItem(i * 16, j * 16, 16, 16, 73, num15, false, 0, false, false); + } + else if (num13 > 100f) + { + int num16 = (int)(num13 / 100f); + if (num16 > 50 && Main.rand.Next(2) == 0) + { + num16 /= Main.rand.Next(3) + 1; + } + if (Main.rand.Next(2) == 0) + { + num16 /= Main.rand.Next(3) + 1; + } + num13 -= (float)(100 * num16); + Item.NewItem(i * 16, j * 16, 16, 16, 72, num16, false, 0, false, false); + } + else + { + int num17 = (int)num13; + if (num17 > 50 && Main.rand.Next(2) == 0) + { + num17 /= Main.rand.Next(3) + 1; + } + if (Main.rand.Next(2) == 0) + { + num17 /= Main.rand.Next(4) + 1; + } + if (num17 < 1) + { + num17 = 1; + } + num13 -= (float)num17; + Item.NewItem(i * 16, j * 16, 16, 16, 71, num17, false, 0, false, false); + } + } + } + } + } + } + return true; + } - public override void RandomUpdate(int i, int j, int type) - { - if (Main.netMode != 1) - { - if (type == (ushort)mod.TileType("ArenaTile")) - { - if (!NPC.AnyNPCs(mod.NPCType("SupremeCalamitas"))) - { - for (int k = 0; k < Main.maxTilesX; k++) - { - for (int l = 0; l < Main.maxTilesY; l++) - { - if (Main.tile[k, l].type == (ushort)mod.TileType("ArenaTile")) - { - Main.tile[k, l].active(false); - WorldGen.SquareTileFrame(k, l); - } - } - } - } - } - } - if (Main.hardMode && !NPC.downedPlantBoss && !NPC.downedGolemBoss && !NPC.downedAncientCultist && !NPC.downedMoonlord && !CalamityWorld.downedCalamitas) - { - if (j > (int)Main.worldSurface) - { - if (Main.tile[i, j] != null) - { - if (Main.tile[i, j].nactive()) - { - if (type == 60) - { - int j2 = j - 1; - if (Main.tile[i, j2] != null) - { - if (Main.tile[i, j2].liquid == 0) - { - if (WorldGen.genRand.Next(3) == 0) - { - bool flag18 = true; - int num80 = 400; - for (int num81 = i - num80; num81 < i + num80; num81 += 2) - { - for (int num82 = j - num80; num82 < j + num80; num82 += 2) - { - if (num81 > 1 && num81 < Main.maxTilesX - 2 && num82 > 1 && num82 < Main.maxTilesY - 2 && Main.tile[num81, num82].active() && Main.tile[num81, num82].type == 238) - { - flag18 = false; - break; - } - } - } - if (flag18) - { - WorldGen.PlaceJunglePlant(i, j2, 238, 0, 0); - WorldGen.SquareTileFrame(i, j2, true); - WorldGen.SquareTileFrame(i + 1, j2 + 1, true); - if (Main.tile[i, j2].type == 238 && Main.netMode == 2) - { - NetMessage.SendTileSquare(-1, i, j2, 4, TileChangeType.None); - } - } - } - if (NPC.downedMechBossAny && WorldGen.genRand.Next(6) == 0) - { - bool flag19 = true; - int num83 = 150; - for (int num84 = i - num83; num84 < i + num83; num84 += 2) - { - for (int num85 = j - num83; num85 < j + num83; num85 += 2) - { - if (num84 > 1 && num84 < Main.maxTilesX - 2 && num85 > 1 && num85 < Main.maxTilesY - 2 && Main.tile[num84, num85].active() && Main.tile[num84, num85].type == 236) - { - flag19 = false; - break; - } - } - } - if (flag19) - { - WorldGen.PlaceJunglePlant(i, j2, 236, WorldGen.genRand.Next(3), 0); - WorldGen.SquareTileFrame(i, j2, true); - WorldGen.SquareTileFrame(i + 1, j2 + 1, true); - if (Main.tile[i, j2].type == 236 && Main.netMode == 2) - { - NetMessage.SendTileSquare(-1, i, j2, 4, TileChangeType.None); - } - } - } - } - } - } - } - } - } - } - } - } + public override bool PreHitWire(int i, int j, int type) + { + return !CalamityWorld.bossRushActive; + } + + public override void RandomUpdate(int i, int j, int type) + { + if (Main.netMode != 1) + { + if (type == (ushort)mod.TileType("ArenaTile")) + { + if (!NPC.AnyNPCs(mod.NPCType("SupremeCalamitas"))) + { + for (int k = 0; k < Main.maxTilesX; k++) + { + for (int l = 0; l < Main.maxTilesY; l++) + { + if (Main.tile[k, l].type == (ushort)mod.TileType("ArenaTile")) + { + Main.tile[k, l].active(false); + WorldGen.SquareTileFrame(k, l); + } + } + } + } + } + } + } + } } diff --git a/Tiles/ChaosCandle.cs b/Tiles/ChaosCandle.cs new file mode 100644 index 0000000000..63a388cadc --- /dev/null +++ b/Tiles/ChaosCandle.cs @@ -0,0 +1,65 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles +{ + public class ChaosCandle : ModTile + { + public override void SetDefaults() + { + Main.tileLighted[Type] = true; + Main.tileFrameImportant[Type] = true; + Main.tileLavaDeath[Type] = true; + TileObjectData.newTile.CopyFrom(TileObjectData.StyleOnTable1x1); + TileObjectData.addTile(Type); + drop = mod.ItemType("ChaosCandle"); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Chaos Candle"); + AddMapEntry(new Color(238, 145, 105), name); + animationFrameHeight = 20; + } + + public override void AnimateTile(ref int frame, ref int frameCounter) + { + frameCounter++; + if (frameCounter >= 4) + { + frame = (frame + 1) % 6; + frameCounter = 0; + } + } + + public override void MouseOver(int i, int j) + { + Player player = Main.LocalPlayer; + player.noThrow = 2; + player.showItemIcon = true; + player.showItemIcon2 = mod.ItemType("ChaosCandle"); + } + + public override void NearbyEffects(int i, int j, bool closer) + { + Player player = Main.LocalPlayer; + if (!player.dead && player.active) + player.AddBuff(mod.BuffType("ChaosCandle"), 20); + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + r = 0.85f; + g = 0.25f; + b = 0.25f; + } + + /*public override void RightClick(int i, int j) + { + Item.NewItem(i * 16, j * 16, 8, 8, mod.ItemType("ChaosCandle")); + ?? KillTile( i, j); + }*/ + } +} diff --git a/Tiles/ChaosCandle.png b/Tiles/ChaosCandle.png new file mode 100644 index 0000000000..cba57df220 Binary files /dev/null and b/Tiles/ChaosCandle.png differ diff --git a/Tiles/ChaoticBrick.png b/Tiles/ChaoticBrick.png index 214ef48da6..5affdec8d0 100644 Binary files a/Tiles/ChaoticBrick.png and b/Tiles/ChaoticBrick.png differ diff --git a/Tiles/ChaoticBrickWall.png b/Tiles/ChaoticBrickWall.png new file mode 100644 index 0000000000..359d068c30 Binary files /dev/null and b/Tiles/ChaoticBrickWall.png differ diff --git a/Tiles/ChaoticOre.png b/Tiles/ChaoticOre.png index 16c7a065f0..9b3521d430 100644 Binary files a/Tiles/ChaoticOre.png and b/Tiles/ChaoticOre.png differ diff --git a/Tiles/CosmiliteBasin.cs b/Tiles/CosmiliteBasin.cs index cdd5178f92..b9ba9497a2 100644 --- a/Tiles/CosmiliteBasin.cs +++ b/Tiles/CosmiliteBasin.cs @@ -1,101 +1,101 @@ -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using Terraria.ObjectData; - -namespace CalamityMod.Tiles -{ - class CosmiliteBasin : ModTile - { - public override void SetDefaults() - { - Main.tileLighted[Type] = true; - Main.tileFrameImportant[Type] = true; - Main.tileLavaDeath[Type] = true; - - TileObjectData.newTile.CopyFrom(TileObjectData.Style3x3); - TileObjectData.addTile(Type); - ModTranslation name = CreateMapEntryName(); - name.SetDefault("Cosmilite Basin"); - AddMapEntry(new Color(238, 145, 105), name); - animationFrameHeight = 54; - AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTorch); - adjTiles = new int[] { TileID.Torches }; - } - - public override void AnimateTile(ref int frame, ref int frameCounter) - { - frameCounter++; - if (frameCounter >= 6) - { - frame = (frame + 1) % 6; - frameCounter = 0; - } - } - - public override void RightClick(int i, int j) - { - Main.PlaySound(SoundID.Mech, i * 16, j * 16, 0); - HitWire(i, j); - } - - public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) - { - Tile tile = Main.tile[i, j]; - //227 79 79 - if (tile.frameX < 54) - { - r = 1f; - g = 0.6f; - b = 1f; - } - } - - public override void KillMultiTile(int i, int j, int frameX, int frameY) - { - Item.NewItem(i * 16, j * 16, 16, 32, mod.ItemType("CosmiliteBasin")); - } - - public override void HitWire(int i, int j) - { - int x = i - (Main.tile[i, j].frameX / 18) % 1; - int y = j - (Main.tile[i, j].frameY / 18) % 3; - for (int l = x - 3; l < x + 3; l++) - { - for (int m = y - 3; m < y + 3; m++) - { - if (Main.tile[l, m] == null) - { - Main.tile[l, m] = new Tile(); - } - if (Main.tile[l, m].active() && Main.tile[l, m].type == Type) - { - if (Main.tile[l, m].frameX < 54) - { - Main.tile[l, m].frameX += 54; - } - else - { - Main.tile[l, m].frameX -= 54; - } - } - } - } - if (Wiring.running) - { - Wiring.SkipWire(x, y); - Wiring.SkipWire(x, y + 1); - Wiring.SkipWire(x, y + 2); - Wiring.SkipWire(x + 1, y); - Wiring.SkipWire(x + 1, y + 1); - Wiring.SkipWire(x + 1, y + 2); - Wiring.SkipWire(x + 2, y); - Wiring.SkipWire(x + 2, y + 1); - Wiring.SkipWire(x + 2, y + 2); - } - } - } -} +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles +{ + class CosmiliteBasin : ModTile + { + public override void SetDefaults() + { + Main.tileLighted[Type] = true; + Main.tileFrameImportant[Type] = true; + Main.tileLavaDeath[Type] = true; + + TileObjectData.newTile.CopyFrom(TileObjectData.Style3x3); + TileObjectData.addTile(Type); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Cosmilite Basin"); + AddMapEntry(new Color(238, 145, 105), name); + animationFrameHeight = 54; + AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTorch); + adjTiles = new int[] { TileID.Torches }; + } + + public override void AnimateTile(ref int frame, ref int frameCounter) + { + frameCounter++; + if (frameCounter >= 6) + { + frame = (frame + 1) % 6; + frameCounter = 0; + } + } + + public override void RightClick(int i, int j) + { + Main.PlaySound(SoundID.Mech, i * 16, j * 16, 0); + HitWire(i, j); + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + Tile tile = Main.tile[i, j]; + //227 79 79 + if (tile.frameX < 54) + { + r = 1f; + g = 0.6f; + b = 1f; + } + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 16, 32, mod.ItemType("CosmiliteBasin")); + } + + public override void HitWire(int i, int j) + { + int x = i - (Main.tile[i, j].frameX / 18) % 1; + int y = j - (Main.tile[i, j].frameY / 18) % 3; + for (int l = x - 3; l < x + 3; l++) + { + for (int m = y - 3; m < y + 3; m++) + { + if (Main.tile[l, m] == null) + { + Main.tile[l, m] = new Tile(); + } + if (Main.tile[l, m].active() && Main.tile[l, m].type == Type) + { + if (Main.tile[l, m].frameX < 54) + { + Main.tile[l, m].frameX += 54; + } + else + { + Main.tile[l, m].frameX -= 54; + } + } + } + } + if (Wiring.running) + { + Wiring.SkipWire(x, y); + Wiring.SkipWire(x, y + 1); + Wiring.SkipWire(x, y + 2); + Wiring.SkipWire(x + 1, y); + Wiring.SkipWire(x + 1, y + 1); + Wiring.SkipWire(x + 1, y + 2); + Wiring.SkipWire(x + 2, y); + Wiring.SkipWire(x + 2, y + 1); + Wiring.SkipWire(x + 2, y + 2); + } + } + } +} diff --git a/Tiles/CosmiliteSconce.cs b/Tiles/CosmiliteSconce.cs index b60fb2a63a..8a7c51fb25 100644 --- a/Tiles/CosmiliteSconce.cs +++ b/Tiles/CosmiliteSconce.cs @@ -1,88 +1,88 @@ -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using Terraria.ObjectData; - -namespace CalamityMod.Tiles -{ - class CosmiliteSconce : ModTile - { - public override void SetDefaults() - { - Main.tileLighted[Type] = true; - Main.tileFrameImportant[Type] = true; - Main.tileLavaDeath[Type] = true; - - TileObjectData.newTile.CopyFrom(TileObjectData.Style3x3Wall); - TileObjectData.newTile.Width = 1; - TileObjectData.newTile.Origin = new Point16(0, 1); - TileObjectData.addTile(Type); - ModTranslation name = CreateMapEntryName(); - name.SetDefault("Cosmilite Sconce"); - AddMapEntry(new Color(238, 145, 105), name); - animationFrameHeight = 54; - AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTorch); - disableSmartCursor = true; - adjTiles = new int[] { TileID.Torches }; - drop = mod.ItemType("CosmiliteSconce"); - } - - public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) - { - if (Main.tile[i, j].frameX < 18) - { - r = 1f; - g = 0.6f; - b = 1f; - } - else - { - r = 0f; - g = 0f; - b = 0f; - } - } - - public override void KillMultiTile(int i, int j, int frameX, int frameY) - { - Item.NewItem(i * 16, j * 16, 16, 32, mod.ItemType("CosmiliteSconce")); - } - - public override void HitWire(int i, int j) - { - int x = i - (Main.tile[i, j].frameX / 18) % 1; - int y = j - (Main.tile[i, j].frameY / 18) % 3; - for (int l = x; l < x + 1; l++) - { - for (int m = y; m < y + 3; m++) - { - if (Main.tile[l, m] == null) - { - Main.tile[l, m] = new Tile(); - } - if (Main.tile[l, m].active() && Main.tile[l, m].type == Type) - { - if (Main.tile[l, m].frameX < 18) - { - Main.tile[l, m].frameX += 18; - } - else - { - Main.tile[l, m].frameX -= 18; - } - } - } - } - if (Wiring.running) - { - Wiring.SkipWire(x, y); - Wiring.SkipWire(x, y + 1); - Wiring.SkipWire(x, y + 2); - } - //NetMessage.SendTileSquare(-1, x, y + 1, 3); - } - } -} +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles +{ + class CosmiliteSconce : ModTile + { + public override void SetDefaults() + { + Main.tileLighted[Type] = true; + Main.tileFrameImportant[Type] = true; + Main.tileLavaDeath[Type] = true; + + TileObjectData.newTile.CopyFrom(TileObjectData.Style3x3Wall); + TileObjectData.newTile.Width = 1; + TileObjectData.newTile.Origin = new Point16(0, 1); + TileObjectData.addTile(Type); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Cosmilite Sconce"); + AddMapEntry(new Color(238, 145, 105), name); + animationFrameHeight = 54; + AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTorch); + disableSmartCursor = true; + adjTiles = new int[] { TileID.Torches }; + drop = mod.ItemType("CosmiliteSconce"); + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + if (Main.tile[i, j].frameX < 18) + { + r = 1f; + g = 0.6f; + b = 1f; + } + else + { + r = 0f; + g = 0f; + b = 0f; + } + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 16, 32, mod.ItemType("CosmiliteSconce")); + } + + public override void HitWire(int i, int j) + { + int x = i - (Main.tile[i, j].frameX / 18) % 1; + int y = j - (Main.tile[i, j].frameY / 18) % 3; + for (int l = x; l < x + 1; l++) + { + for (int m = y; m < y + 3; m++) + { + if (Main.tile[l, m] == null) + { + Main.tile[l, m] = new Tile(); + } + if (Main.tile[l, m].active() && Main.tile[l, m].type == Type) + { + if (Main.tile[l, m].frameX < 18) + { + Main.tile[l, m].frameX += 18; + } + else + { + Main.tile[l, m].frameX -= 18; + } + } + } + } + if (Wiring.running) + { + Wiring.SkipWire(x, y); + Wiring.SkipWire(x, y + 1); + Wiring.SkipWire(x, y + 2); + } + //NetMessage.SendTileSquare(-1, x, y + 1, 3); + } + } +} diff --git a/Tiles/EutrophicSand.cs b/Tiles/EutrophicSand.cs deleted file mode 100644 index 37f1822ce9..0000000000 --- a/Tiles/EutrophicSand.cs +++ /dev/null @@ -1,36 +0,0 @@ -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Tiles -{ - public class EutrophicSand : ModTile - { - public override void SetDefaults() - { - Main.tileSolid[Type] = true; - Main.tileMergeDirt[Type] = true; - Main.tileBlockLight[Type] = true; - ModTranslation name = CreateMapEntryName(); - name.SetDefault("Eutrophic Sand"); - AddMapEntry(new Color(0, 255, 150), name); - soundType = 0; - dustType = 185; - } - - public override bool CanKillTile(int i, int j, ref bool blockDamaged) - { - return false; - } - - 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 ? 1 : 3; - } - } -} \ No newline at end of file diff --git a/Tiles/EutrophicSand.png b/Tiles/EutrophicSand.png deleted file mode 100644 index 603cc1b751..0000000000 Binary files a/Tiles/EutrophicSand.png and /dev/null differ diff --git a/Tiles/LumenylCrystals.cs b/Tiles/LumenylCrystals.cs index d17a784249..07a17daab1 100644 --- a/Tiles/LumenylCrystals.cs +++ b/Tiles/LumenylCrystals.cs @@ -1,37 +1,72 @@ -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Tiles -{ - public class LumenylCrystals : ModTile - { - public override void SetDefaults() - { - Main.tileLighted[Type] = true; - Main.tileFrameImportant[Type] = true; - Main.tileObsidianKill[Type] = true; - Main.tileNoFail[Type] = true; - ModTranslation name = CreateMapEntryName(); - name.SetDefault("Lumenyl"); - AddMapEntry(new Color(0, 150, 200), name); +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles +{ + public class LumenylCrystals : ModTile + { + public override void SetDefaults() + { + Main.tileLighted[Type] = true; + Main.tileNoFail[Type] = true; + Main.tileFrameImportant[Type] = true; + Main.tileObsidianKill[Type] = true; + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Lumenyl"); + AddMapEntry(new Color(0, 150, 200), name); soundType = 2; - soundStyle = 27; - dustType = 67; - drop = mod.ItemType("Lumenite"); - } - - public override void NumDust(int i, int j, bool fail, ref int num) - { - num = fail ? 1 : 3; - } - - public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) - { - r = 0.00f; - g = 0.3f; - b = 0.4f; - } - } + soundStyle = 27; + dustType = 67; + drop = mod.ItemType("Lumenite"); + Main.tileSpelunker[Type] = true; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + r = 0.00f; + g = 0.3f; + b = 0.4f; + } + + public override bool CanPlace(int i, int j) + { + if (Main.tile[i, j + 1].slope() == 0 && !Main.tile[i, j + 1].halfBrick()) + return true; + if (Main.tile[i, j - 1].slope() == 0 && !Main.tile[i, j - 1].halfBrick()) + return true; + if (Main.tile[i + 1, j].slope() == 0 && !Main.tile[i + 1, j].halfBrick()) + return true; + if (Main.tile[i - 1, j].slope() == 0 && !Main.tile[i - 1, j].halfBrick()) + return true; + return false; + } + + public override void PlaceInWorld(int i, int j, Item item) + { + if (Main.tile[i, j + 1].active() && Main.tileSolid[Main.tile[i, j + 1].type] && Main.tile[i, j + 1].slope() == 0 && !Main.tile[i, j + 1].halfBrick()) + { + Main.tile[i, j].frameY = (short)(0 * 18); + } + else if (Main.tile[i, j - 1].active() && Main.tileSolid[Main.tile[i, j - 1].type] && Main.tile[i, j - 1].slope() == 0 && !Main.tile[i, j - 1].halfBrick()) + { + Main.tile[i, j].frameY = (short)(1 * 18); + } + else if (Main.tile[i + 1, j].active() && Main.tileSolid[Main.tile[i + 1, j].type] && Main.tile[i + 1, j].slope() == 0 && !Main.tile[i + 1, j].halfBrick()) + { + Main.tile[i, j].frameY = (short)(2 * 18); + } + else if (Main.tile[i - 1, j].active() && Main.tileSolid[Main.tile[i - 1, j].type] && Main.tile[i - 1, j].slope() == 0 && !Main.tile[i - 1, j].halfBrick()) + { + Main.tile[i, j].frameY = (short)(3 * 18); + } + Main.tile[i, j].frameX = (short)(WorldGen.genRand.Next(18) * 18); + } + } } \ No newline at end of file diff --git a/Tiles/LumenylCrystals.png b/Tiles/LumenylCrystals.png index 86757d77bb..2907c6a880 100644 Binary files a/Tiles/LumenylCrystals.png and b/Tiles/LumenylCrystals.png differ diff --git a/Tiles/MonsterBanner.cs b/Tiles/MonsterBanner.cs new file mode 100644 index 0000000000..749899241b --- /dev/null +++ b/Tiles/MonsterBanner.cs @@ -0,0 +1,714 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles +{ + public class MonsterBanner : ModTile + { + public override void SetDefaults() + { + Main.tileFrameImportant[Type] = true; + Main.tileNoAttach[Type] = true; + Main.tileLavaDeath[Type] = true; + TileObjectData.newTile.CopyFrom(TileObjectData.Style1x2Top); + TileObjectData.newTile.Height = 3; + TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16, 16 }; + TileObjectData.newTile.StyleHorizontal = true; + TileObjectData.newTile.StyleWrapLimit = 111; + TileObjectData.addTile(Type); + dustType = -1; + disableSmartCursor = true; + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Banner"); + AddMapEntry(new Color(13, 88, 130), name); + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + int style = frameX / 18; + string item; + switch (style) + { + case 0: + item = "AquaticParasiteBanner"; + break; + case 1: + item = "FlounderBanner"; + break; + case 2: + item = "GnasherBanner"; + break; + case 3: + item = "TrasherBanner"; + break; + case 4: + item = "CatfishBanner"; + break; + case 5: + item = "MaulerBanner"; + break; + case 6: + item = "AquaticSeekerBanner"; + break; + case 7: + item = "AquaticUrchinBanner"; + break; + case 8: + item = "FrogfishBanner"; + break; + case 9: + item = "MantisShrimpBanner"; + break; + case 10: + item = "AquaticAberrationBanner"; + break; + case 11: + item = "ParaseaBanner"; + break; + case 12: + item = "SeaUrchinBanner"; + break; + case 13: + item = "BoxJellyfishBanner"; + break; + case 14: + item = "MorayEelBanner"; + break; + case 15: + item = "DevilFishBanner"; + break; + case 16: + item = "CuttlefishBanner"; + break; + case 17: + item = "ToxicMinnowBanner"; + break; + case 18: + item = "ViperfishBanner"; + break; + case 19: + item = "LuminousCorvinaBanner"; + break; + case 20: + item = "GiantSquidBanner"; + break; + case 21: + item = "LaserfishBanner"; + break; + case 22: + item = "OarfishBanner"; + break; + case 23: + item = "ColossalSquidBanner"; + break; + case 24: + item = "MirageJellyBanner"; + break; + case 25: + item = "EidolistBanner"; + break; + case 26: + item = "GulperEelBanner"; + break; + case 27: + item = "EidolonWyrmJuvenileBanner"; + break; + case 28: + item = "BloatfishBanner"; + break; + case 29: + item = "BobbitWormBanner"; + break; + case 30: + item = "ChaoticPufferBanner"; + break; + case 31: + item = "AstralProbeBanner"; + break; + case 32: + item = "SmallSightseerBanner"; + break; + case 33: + item = "BigSightseerBanner"; + break; + case 34: + item = "AriesBanner"; + break; + case 35: + item = "AstralSlimeBanner"; + break; + case 36: + item = "AtlasBanner"; + break; + case 37: + item = "MantisBanner"; + break; + case 38: + item = "NovaBanner"; + break; + case 39: + item = "AstralachneaBanner"; + break; + case 40: + item = "HiveBanner"; + break; + case 41: + item = "StellarCullexBanner"; + break; + case 42: + item = "FusionFeederBanner"; + break; + case 43: + item = "HadarianBanner"; + break; + case 44: + item = "HeatSpiritBanner"; + break; + case 45: + item = "ScryllarBanner"; + break; + case 46: + item = "DespairStoneBanner"; + break; + case 47: + item = "SoulSlurperBanner"; + break; + case 48: + item = "ImpiousImmolatorBanner"; + break; + case 49: + item = "ScornEaterBanner"; + break; + case 50: + item = "ProfanedEnergyBanner"; + break; + case 51: + item = "WulfrumSlimeBanner"; + break; + case 52: + item = "WulfrumDroneBanner"; + break; + case 53: + item = "PitbullBanner"; + break; + case 54: + item = "BlightedEyeBanner"; + break; + case 55: + item = "CalamityEyeBanner"; + break; + case 56: + item = "SunskaterBanner"; + break; + case 57: + item = "ShockstormShuttleBanner"; + break; + case 58: + item = "CloudElementalBanner"; + break; + case 59: + item = "AngryDogBanner"; + break; + case 60: + item = "CryonBanner"; + break; + case 61: + item = "IceClasperBanner"; + break; + case 62: + item = "StormlionBanner"; + break; + case 63: + item = "CnidrionBanner"; + break; + case 64: + item = "SandTortoiseBanner"; + break; + case 65: + item = "GreatSandSharkBanner"; + break; + case 66: + item = "AmethystCrawlerBanner"; + break; + case 67: + item = "TopazCrawlerBanner"; + break; + case 68: + item = "SapphireCrawlerBanner"; + break; + case 69: + item = "EmeraldCrawlerBanner"; + break; + case 70: + item = "RubyCrawlerBanner"; + break; + case 71: + item = "DiamondCrawlerBanner"; + break; + case 72: + item = "AmberCrawlerBanner"; + break; + case 73: + item = "CrystalCrawlerBanner"; + break; + case 74: + item = "SunBatBanner"; + break; + case 75: + item = "CosmicElementalBanner"; + break; + case 76: + item = "EarthElementalBanner"; + break; + case 77: + item = "ArmoredDiggerBanner"; + break; + case 78: + item = "MelterBanner"; + break; + case 79: + item = "PestilentSlimeBanner"; + break; + case 80: + item = "PlagueshellBanner"; + break; + case 81: + item = "PlagueChargerBanner"; + break; + case 82: + item = "VirulingBanner"; + break; + case 83: + item = "PlaguebringerBanner"; + break; + case 84: + item = "PhantomSpiritBanner"; + break; + case 85: + item = "OverloadedSoldierBanner"; + break; + case 86: + item = "PhantomDebrisBanner"; + break; + case 87: + item = "BOHLDOHRBanner"; + break; + case 88: + item = "EbonianBlightSlimeBanner"; + break; + case 89: + item = "CrimulanBlightSlimeBanner"; + break; + case 90: + item = "AeroSlimeBanner"; + break; + case 91: + item = "CryoSlimeBanner"; + break; + case 92: + item = "PerennialSlimeBanner"; + break; + case 93: + item = "CharredSlimeBanner"; + break; + case 94: + item = "BloomSlimeBanner"; + break; + case 95: + item = "CultistAssassinBanner"; + break; + case 96: + item = "ReaperSharkBanner"; + break; + case 97: + item = "IrradiatedSlimeBanner"; + break; + case 98: + item = "PrismTurtleBanner"; + break; + case 99: + item = "ClamBanner"; + break; + case 100: + item = "EutrophicRayBanner"; + break; + case 101: + item = "GhostBellBanner"; + break; + case 102: + item = "GhostBellSmallBanner"; + break; + case 103: + item = "SeaFloatyBanner"; + break; + case 104: + item = "BlindedAnglerBanner"; + break; + case 105: + item = "SeaMinnowBanner"; + break; + case 106: + item = "SeaSerpentBanner"; + break; + case 107: + item = "GiantClamBanner"; + break; + default: + return; + } + Item.NewItem(i * 16, j * 16, 16, 48, mod.ItemType(item)); + } + + public override void NearbyEffects(int i, int j, bool closer) + { + if (closer) + { + Player player = Main.LocalPlayer; + int style = Main.tile[i, j].frameX / 18; + string type; + switch (style) + { + case 0: + type = "AquaticParasite"; + break; + case 1: + type = "Flounder"; + break; + case 2: + type = "Gnasher"; + break; + case 3: + type = "Trasher"; + break; + case 4: + type = "Catfish"; + break; + case 5: + type = "Mauler"; + break; + case 6: + type = "AquaticSeekerHead"; + break; + case 7: + type = "AquaticUrchin"; + break; + case 8: + type = "Frogfish"; + break; + case 9: + type = "MantisShrimp"; + break; + case 10: + type = "AquaticAberration"; + break; + case 11: + type = "Parasea"; + break; + case 12: + type = "SeaUrchin"; + break; + case 13: + type = "BoxJellyfish"; + break; + case 14: + type = "MorayEel"; + break; + case 15: + type = "DevilFish"; + break; + case 16: + type = "Cuttlefish"; + break; + case 17: + type = "ToxicMinnow"; + break; + case 18: + type = "Viperfish"; + break; + case 19: + type = "LuminousCorvina"; + break; + case 20: + type = "GiantSquid"; + break; + case 21: + type = "Laserfish"; + break; + case 22: + type = "OarfishHead"; + break; + case 23: + type = "ColossalSquid"; + break; + case 24: + type = "MirageJelly"; + break; + case 25: + type = "Eidolist"; + break; + case 26: + type = "GulperEelHead"; + break; + case 27: + type = "EidolonWyrmHead"; + break; + case 28: + type = "Bloatfish"; + break; + case 29: + type = "BobbitWormHead"; + break; + case 30: + type = "ChaoticPuffer"; + break; + case 31: + type = "AstralProbe"; + break; + case 32: + type = "SmallSightseer"; + break; + case 33: + type = "BigSightseer"; + break; + case 34: + type = "Aries"; + break; + case 35: + type = "AstralSlime"; + break; + case 36: + type = "Atlas"; + break; + case 37: + type = "Mantis"; + break; + case 38: + type = "Nova"; + break; + case 39: + type = "AstralachneaGround"; + break; + case 40: + type = "Hive"; + break; + case 41: + type = "StellarCulex"; + break; + case 42: + type = "FusionFeeder"; + break; + case 43: + type = "Hadarian"; + break; + case 44: + type = "HeatSpirit"; + break; + case 45: + type = "Scryllar"; + break; + case 46: + type = "DespairStone"; + break; + case 47: + type = "SoulSlurper"; + break; + case 48: + type = "ImpiousImmolator"; + break; + case 49: + type = "ScornEater"; + break; + case 50: + type = "ProfanedEnergyBody"; + break; + case 51: + type = "WulfrumSlime"; + break; + case 52: + type = "WulfrumDrone"; + break; + case 53: + type = "Pitbull"; + break; + case 54: + type = "BlightedEye"; + break; + case 55: + type = "CalamityEye"; + break; + case 56: + type = "Sunskater"; + break; + case 57: + type = "ShockstormShuttle"; + break; + case 58: + type = "ThiccWaifu"; + break; + case 59: + type = "AngryDog"; + break; + case 60: + type = "Cryon"; + break; + case 61: + type = "IceClasper"; + break; + case 62: + type = "StormlionCharger"; + break; + case 63: + type = "Cnidrion"; + break; + case 64: + type = "SandTortoise"; + break; + case 65: + type = "GreatSandShark"; + break; + case 66: + type = "CrawlerAmethyst"; + break; + case 67: + type = "CrawlerTopaz"; + break; + case 68: + type = "CrawlerSapphire"; + break; + case 69: + type = "CrawlerEmerald"; + break; + case 70: + type = "CrawlerRuby"; + break; + case 71: + type = "CrawlerDiamond"; + break; + case 72: + type = "CrawlerAmber"; + break; + case 73: + type = "CrawlerCrystal"; + break; + case 74: + type = "SunBat"; + break; + case 75: + type = "CosmicElemental"; + break; + case 76: + type = "Horse"; + break; + case 77: + type = "ArmoredDiggerHead"; + break; + case 78: + type = "PlaguedFlyingFox"; + break; + case 79: + type = "PlaguedJungleSlime"; + break; + case 80: + type = "PlaguedTortoise"; + break; + case 81: + type = "PlagueBee"; + break; + case 82: + type = "PlaguedDerpling"; + break; + case 83: + type = "PlaguebringerShade"; + break; + case 84: + type = "PhantomSpirit"; + break; + case 85: + type = "OverloadedSoldier"; + break; + case 86: + type = "PhantomDebris"; + break; + case 87: + type = "Bohldohr"; + break; + case 88: + type = "EbonianBlightSlime"; + break; + case 89: + type = "CrimulanBlightSlime"; + break; + case 90: + type = "AeroSlime"; + break; + case 91: + type = "CryoSlime"; + break; + case 92: + type = "PerennialSlime"; + break; + case 93: + type = "CharredSlime"; + break; + case 94: + type = "BloomSlime"; + break; + case 95: + type = "CultistAssassin"; + break; + case 96: + type = "Reaper"; + break; + case 97: + type = "IrradiatedSlime"; + break; + case 98: + type = "PrismTurtle"; + break; + case 99: + type = "Clam"; + break; + case 100: + type = "EutrophicRay"; + break; + case 101: + type = "GhostBell"; + break; + case 102: + type = "GhostBellSmall"; + break; + case 103: + type = "SeaFloaty"; + break; + case 104: + type = "BlindedAngler"; + break; + case 105: + type = "SeaMinnow"; + break; + case 106: + type = "SeaSerpent1"; + break; + case 107: + type = "GiantClam"; + break; + default: + return; + } + player.NPCBannerBuff[mod.NPCType(type)] = true; + player.hasBanner = true; + } + } + + public override void SetSpriteEffects(int i, int j, ref SpriteEffects spriteEffects) + { + if (i % 2 == 1) + { + spriteEffects = SpriteEffects.FlipHorizontally; + } + } + } +} \ No newline at end of file diff --git a/Tiles/MonsterBanner.png b/Tiles/MonsterBanner.png new file mode 100644 index 0000000000..c63cfccea6 Binary files /dev/null and b/Tiles/MonsterBanner.png differ diff --git a/Tiles/PinkCandle.cs b/Tiles/PinkCandle.cs new file mode 100644 index 0000000000..183fb9a965 --- /dev/null +++ b/Tiles/PinkCandle.cs @@ -0,0 +1,55 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles +{ + public class PinkCandle : ModTile + { + public override void SetDefaults() + { + Main.tileLighted[Type] = true; + Main.tileFrameImportant[Type] = true; + Main.tileLavaDeath[Type] = true; + TileObjectData.newTile.CopyFrom(TileObjectData.Style1x2); + TileObjectData.addTile(Type); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Vigorous Candle"); + AddMapEntry(new Color(238, 145, 105), name); + animationFrameHeight = 34; + } + + public override void AnimateTile(ref int frame, ref int frameCounter) + { + frameCounter++; + if (frameCounter >= 6) + { + frame = (frame + 1) % 6; + frameCounter = 0; + } + } + + public override void NearbyEffects(int i, int j, bool closer) + { + Player player = Main.LocalPlayer; + if (!player.dead && player.active) + player.AddBuff(mod.BuffType("PinkHealthCandle"), 20); + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + r = 0.75f; + g = 0.35f; + b = 0.65f; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 16, 32, mod.ItemType("PinkCandle")); + } + } +} diff --git a/Tiles/PinkCandle.png b/Tiles/PinkCandle.png new file mode 100644 index 0000000000..a74d8acee8 Binary files /dev/null and b/Tiles/PinkCandle.png differ diff --git a/Tiles/PurpleCandle.cs b/Tiles/PurpleCandle.cs new file mode 100644 index 0000000000..33ffe5d17a --- /dev/null +++ b/Tiles/PurpleCandle.cs @@ -0,0 +1,55 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles +{ + public class PurpleCandle : ModTile + { + public override void SetDefaults() + { + Main.tileLighted[Type] = true; + Main.tileFrameImportant[Type] = true; + Main.tileLavaDeath[Type] = true; + TileObjectData.newTile.CopyFrom(TileObjectData.Style1x2); + TileObjectData.addTile(Type); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Resilient Candle"); + AddMapEntry(new Color(238, 145, 105), name); + animationFrameHeight = 34; + } + + public override void AnimateTile(ref int frame, ref int frameCounter) + { + frameCounter++; + if (frameCounter >= 6) + { + frame = (frame + 1) % 6; + frameCounter = 0; + } + } + + public override void NearbyEffects(int i, int j, bool closer) + { + Player player = Main.LocalPlayer; + if (!player.dead && player.active) + player.AddBuff(mod.BuffType("PurpleDefenseCandle"), 20); + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + r = 0.65f; + g = 0.35f; + b = 0.85f; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 16, 32, mod.ItemType("PurpleCandle")); + } + } +} diff --git a/Tiles/PurpleCandle.png b/Tiles/PurpleCandle.png new file mode 100644 index 0000000000..e8c72dee6d Binary files /dev/null and b/Tiles/PurpleCandle.png differ diff --git a/Tiles/SeaPrism.cs b/Tiles/SeaPrism.cs deleted file mode 100644 index 7dbbe97bcc..0000000000 --- a/Tiles/SeaPrism.cs +++ /dev/null @@ -1,41 +0,0 @@ -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Tiles -{ - public class SeaPrism : ModTile - { - public override void SetDefaults() - { - Main.tileSolid[Type] = true; - Main.tileMergeDirt[Type] = true; - Main.tileBlockLight[Type] = true; - dustType = 33; - //drop = mod.ItemType("CryonicOre"); - ModTranslation name = CreateMapEntryName(); - name.SetDefault("Sea Prism"); - AddMapEntry(new Color(0, 150, 200), name); - mineResist = 3f; - minPick = 199; - soundType = 21; - Main.tileSpelunker[Type] = true; - } - - public override void RandomUpdate(int i, int j) - { - Main.tileValue[Type] = (short)(Main.hardMode ? 700 : 0); - } - - public override bool CanExplode(int i, int j) - { - return CalamityWorld.downedLeviathan; - } - - public override void NumDust(int i, int j, bool fail, ref int num) - { - num = fail ? 1 : 3; - } - } -} \ No newline at end of file diff --git a/Tiles/SeaPrism.png b/Tiles/SeaPrism.png deleted file mode 100644 index a99275ea3d..0000000000 Binary files a/Tiles/SeaPrism.png and /dev/null differ diff --git a/Tiles/SunkenSea/BrainCoral.cs b/Tiles/SunkenSea/BrainCoral.cs new file mode 100644 index 0000000000..b58f14364a --- /dev/null +++ b/Tiles/SunkenSea/BrainCoral.cs @@ -0,0 +1,57 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Terraria; +using Terraria.ObjectData; +using Terraria.ModLoader; +using Microsoft.Xna.Framework; + +namespace CalamityMod.Tiles.SunkenSea +{ + public class BrainCoral : ModTile + { + public override void SetDefaults() + { + Main.tileFrameImportant[Type] = true; + Main.tileNoAttach[Type] = true; + Main.tileBlockLight[Type] = true; + TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2); + TileObjectData.addTile(Type); + dustType = 253; + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Brain Coral"); + AddMapEntry(new Color(0, 0, 80)); + mineResist = 3f; + + base.SetDefaults(); + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void NearbyEffects(int i, int j, bool closer) + { + if (closer) + { + if (Main.rand.Next(300) == 0) + { + int tileLocationY = j - 1; + if (Main.tile[i, tileLocationY] != null) + { + if (!Main.tile[i, tileLocationY].active()) + { + if (Main.tile[i, tileLocationY].liquid == 255 && Main.tile[i, tileLocationY - 1].liquid == 255 && + Main.tile[i, tileLocationY - 2].liquid == 255 && Main.netMode != 1) + { + Projectile.NewProjectile((float)(i * 16 + 16), (float)(tileLocationY * 16 + 16), 0f, -0.1f, mod.ProjectileType("CoralBubble"), 0, 0f, Main.myPlayer, 0f, 0f); + } + } + } + } + } + } + } +} diff --git a/Tiles/SunkenSea/BrainCoral.png b/Tiles/SunkenSea/BrainCoral.png new file mode 100644 index 0000000000..dc87921c20 Binary files /dev/null and b/Tiles/SunkenSea/BrainCoral.png differ diff --git a/Tiles/SunkenSea/EutrophicSand.cs b/Tiles/SunkenSea/EutrophicSand.cs new file mode 100644 index 0000000000..727c536cb6 --- /dev/null +++ b/Tiles/SunkenSea/EutrophicSand.cs @@ -0,0 +1,38 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.SunkenSea +{ + public class EutrophicSand : ModTile + { + public override void SetDefaults() + { + Main.tileSolid[Type] = true; + Main.tileMergeDirt[Type] = true; + Main.tileBlockLight[Type] = true; + dustType = 108; + drop = mod.ItemType("EutrophicSand"); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Eutrophic Sand"); + AddMapEntry(new Color(100, 100, 150), name); + mineResist = 2f; + } + + public override bool CanKillTile(int i, int j, ref bool blockDamaged) + { + return CalamityWorld.downedDesertScourge; + } + + public override bool CanExplode(int i, int j) + { + return CalamityWorld.downedDesertScourge; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + } +} \ No newline at end of file diff --git a/Tiles/SunkenSea/EutrophicSand.png b/Tiles/SunkenSea/EutrophicSand.png new file mode 100644 index 0000000000..04c9f26a5a Binary files /dev/null and b/Tiles/SunkenSea/EutrophicSand.png differ diff --git a/Tiles/SunkenSea/FanCoral.cs b/Tiles/SunkenSea/FanCoral.cs new file mode 100644 index 0000000000..167f956bd3 --- /dev/null +++ b/Tiles/SunkenSea/FanCoral.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Terraria; +using Terraria.Enums; +using Terraria.ObjectData; +using Terraria.DataStructures; +using Terraria.ModLoader; +using Microsoft.Xna.Framework; + +namespace CalamityMod.Tiles.SunkenSea +{ + public class FanCoral : ModTile + { + public override void SetDefaults() + { + Main.tileFrameImportant[Type] = true; + Main.tileNoAttach[Type] = true; + Main.tileLighted[Type] = true; + TileObjectData.newTile.CopyFrom(TileObjectData.Style3x3); + TileObjectData.addTile(Type); + dustType = 253; + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Fan Coral"); + AddMapEntry(new Color(0, 0, 80)); + mineResist = 3f; + + base.SetDefaults(); + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + r = 0.3f; + g = 0.75f; + b = 0.75f; + } + } +} diff --git a/Tiles/SunkenSea/FanCoral.png b/Tiles/SunkenSea/FanCoral.png new file mode 100644 index 0000000000..0ffee8ecf3 Binary files /dev/null and b/Tiles/SunkenSea/FanCoral.png differ diff --git a/Tiles/SunkenSea/Navystone.cs b/Tiles/SunkenSea/Navystone.cs new file mode 100644 index 0000000000..1d759aa521 --- /dev/null +++ b/Tiles/SunkenSea/Navystone.cs @@ -0,0 +1,94 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.SunkenSea +{ + public class Navystone : ModTile + { + public override void SetDefaults() + { + Main.tileSolid[Type] = true; + Main.tileMergeDirt[Type] = true; + Main.tileBlockLight[Type] = true; + dustType = 96; + drop = mod.ItemType("Navystone"); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Navystone"); + AddMapEntry(new Color(0, 50, 50), name); + mineResist = 2f; + minPick = 54; + soundType = 21; + } + + public override bool CanKillTile(int i, int j, ref bool blockDamaged) + { + return CalamityWorld.downedDesertScourge; + } + + public override bool CanExplode(int i, int j) + { + return CalamityWorld.downedDesertScourge; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void RandomUpdate(int i, int j) + { + int random = WorldGen.genRand.Next(4); + if (random == 0) + { + i++; + } + if (random == 1) + { + i--; + } + if (random == 2) + { + j++; + } + if (random == 3) + { + j--; + } + if (Main.tile[i, j] != null) + { + if (!Main.tile[i, j].active()) + { + if (Main.rand.Next(20) == 0 && !Main.tile[i, j].lava() && Main.tile[i, j].slope() == 0 && !Main.tile[i, j].halfBrick()) + { + Main.tile[i, j].type = (ushort)mod.TileType("SeaPrismCrystals"); + Main.tile[i, j].active(true); + if (Main.tile[i, j + 1].active() && Main.tileSolid[Main.tile[i, j + 1].type] && Main.tile[i, j + 1].slope() == 0 && !Main.tile[i, j + 1].halfBrick()) + { + Main.tile[i, j].frameY = (short)(0 * 18); + } + else if (Main.tile[i, j - 1].active() && Main.tileSolid[Main.tile[i, j - 1].type] && Main.tile[i, j - 1].slope() == 0 && !Main.tile[i, j - 1].halfBrick()) + { + Main.tile[i, j].frameY = (short)(1 * 18); + } + else if (Main.tile[i + 1, j].active() && Main.tileSolid[Main.tile[i + 1, j].type] && Main.tile[i + 1, j].slope() == 0 && !Main.tile[i + 1, j].halfBrick()) + { + Main.tile[i, j].frameY = (short)(2 * 18); + } + else if (Main.tile[i - 1, j].active() && Main.tileSolid[Main.tile[i - 1, j].type] && Main.tile[i - 1, j].slope() == 0 && !Main.tile[i - 1, j].halfBrick()) + { + Main.tile[i, j].frameY = (short)(3 * 18); + } + Main.tile[i, j].frameX = (short)(WorldGen.genRand.Next(18) * 18); + WorldGen.SquareTileFrame(i, j, true); + if (Main.netMode == 2) + { + NetMessage.SendTileSquare(-1, i, j, 1, TileChangeType.None); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/Tiles/SunkenSea/Navystone.png b/Tiles/SunkenSea/Navystone.png new file mode 100644 index 0000000000..35103a30e0 Binary files /dev/null and b/Tiles/SunkenSea/Navystone.png differ diff --git a/Tiles/SunkenSea/SeaAnemone.cs b/Tiles/SunkenSea/SeaAnemone.cs new file mode 100644 index 0000000000..e530c95f9d --- /dev/null +++ b/Tiles/SunkenSea/SeaAnemone.cs @@ -0,0 +1,52 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Terraria; +using Terraria.Enums; +using Terraria.ObjectData; +using Terraria.DataStructures; +using Terraria.ModLoader; +using Microsoft.Xna.Framework; + +namespace CalamityMod.Tiles.SunkenSea +{ + public class SeaAnemone : ModTile + { + public override void SetDefaults() + { + animationFrameHeight = 36; + Main.tileFrameImportant[Type] = true; + Main.tileNoAttach[Type] = true; + Main.tileBlockLight[Type] = true; + TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); + TileObjectData.addTile(Type); + dustType = 253; + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Sea Anemone"); + AddMapEntry(new Color(0, 0, 80)); + mineResist = 2f; + + base.SetDefaults(); + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void AnimateTile(ref int frame, ref int frameCounter) + { + frameCounter++; + if (frameCounter > 12) + { + frameCounter = 0; + frame++; + if (frame > 5) + { + frame = 0; + } + } + } + } +} diff --git a/Tiles/SunkenSea/SeaAnemone.png b/Tiles/SunkenSea/SeaAnemone.png new file mode 100644 index 0000000000..0a1a862135 Binary files /dev/null and b/Tiles/SunkenSea/SeaAnemone.png differ diff --git a/Tiles/SunkenSea/SeaPrism.cs b/Tiles/SunkenSea/SeaPrism.cs new file mode 100644 index 0000000000..cdc7790d96 --- /dev/null +++ b/Tiles/SunkenSea/SeaPrism.cs @@ -0,0 +1,95 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.SunkenSea +{ + public class SeaPrism : ModTile + { + public override void SetDefaults() + { + Main.tileSolid[Type] = true; + Main.tileMergeDirt[Type] = true; + Main.tileBlockLight[Type] = true; + dustType = 33; + drop = mod.ItemType("SeaPrism"); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Sea Prism"); + AddMapEntry(new Color(0, 150, 200), name); + mineResist = 3f; + minPick = 54; + soundType = 21; + Main.tileSpelunker[Type] = true; + } + + public override bool CanKillTile(int i, int j, ref bool blockDamaged) + { + return CalamityWorld.downedDesertScourge; + } + + public override bool CanExplode(int i, int j) + { + return CalamityWorld.downedDesertScourge; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void RandomUpdate(int i, int j) + { + int random = WorldGen.genRand.Next(4); + if (random == 0) + { + i++; + } + if (random == 1) + { + i--; + } + if (random == 2) + { + j++; + } + if (random == 3) + { + j--; + } + if (Main.tile[i, j] != null) + { + if (!Main.tile[i, j].active()) + { + if (Main.rand.Next(4) == 0 && !Main.tile[i, j].lava() && Main.tile[i, j].slope() == 0 && !Main.tile[i, j].halfBrick()) + { + Main.tile[i, j].type = (ushort)mod.TileType("SeaPrismCrystals"); + Main.tile[i, j].active(true); + if (Main.tile[i, j + 1].active() && Main.tileSolid[Main.tile[i, j + 1].type] && Main.tile[i, j + 1].slope() == 0 && !Main.tile[i, j + 1].halfBrick()) + { + Main.tile[i, j].frameY = (short)(0 * 18); + } + else if (Main.tile[i, j - 1].active() && Main.tileSolid[Main.tile[i, j - 1].type] && Main.tile[i, j - 1].slope() == 0 && !Main.tile[i, j - 1].halfBrick()) + { + Main.tile[i, j].frameY = (short)(1 * 18); + } + else if (Main.tile[i + 1, j].active() && Main.tileSolid[Main.tile[i + 1, j].type] && Main.tile[i + 1, j].slope() == 0 && !Main.tile[i + 1, j].halfBrick()) + { + Main.tile[i, j].frameY = (short)(2 * 18); + } + else if (Main.tile[i - 1, j].active() && Main.tileSolid[Main.tile[i - 1, j].type] && Main.tile[i - 1, j].slope() == 0 && !Main.tile[i - 1, j].halfBrick()) + { + Main.tile[i, j].frameY = (short)(3 * 18); + } + Main.tile[i, j].frameX = (short)(WorldGen.genRand.Next(18) * 18); + WorldGen.SquareTileFrame(i, j, true); + if (Main.netMode == 2) + { + NetMessage.SendTileSquare(-1, i, j, 1, TileChangeType.None); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/Tiles/SunkenSea/SeaPrism.png b/Tiles/SunkenSea/SeaPrism.png new file mode 100644 index 0000000000..8a1548d781 Binary files /dev/null and b/Tiles/SunkenSea/SeaPrism.png differ diff --git a/Tiles/SunkenSea/SeaPrismCrystals.cs b/Tiles/SunkenSea/SeaPrismCrystals.cs new file mode 100644 index 0000000000..858e063434 --- /dev/null +++ b/Tiles/SunkenSea/SeaPrismCrystals.cs @@ -0,0 +1,82 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.SunkenSea +{ + public class SeaPrismCrystals : ModTile + { + public override void SetDefaults() + { + Main.tileLighted[Type] = true; + Main.tileNoFail[Type] = true; + Main.tileFrameImportant[Type] = true; + Main.tileObsidianKill[Type] = true; + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Sea Prism Crystal"); + AddMapEntry(new Color(0, 150, 200), name); + soundType = 2; + soundStyle = 27; + dustType = 67; + drop = mod.ItemType("PrismShard"); + Main.tileSpelunker[Type] = true; + } + + public override bool CanKillTile(int i, int j, ref bool blockDamaged) + { + return CalamityWorld.downedDesertScourge; + } + + public override bool CanExplode(int i, int j) + { + return CalamityWorld.downedDesertScourge; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + r = 0.2f; + g = 0.5f; + b = 0.5f; + } + + public override bool CanPlace(int i, int j) + { + if (Main.tile[i, j + 1].slope() == 0 && !Main.tile[i, j + 1].halfBrick()) + return true; + if (Main.tile[i, j - 1].slope() == 0 && !Main.tile[i, j - 1].halfBrick()) + return true; + if (Main.tile[i + 1, j].slope() == 0 && !Main.tile[i + 1, j].halfBrick()) + return true; + if (Main.tile[i - 1, j].slope() == 0 && !Main.tile[i - 1, j].halfBrick()) + return true; + return false; + } + + public override void PlaceInWorld(int i, int j, Item item) + { + if (Main.tile[i, j + 1].active() && Main.tileSolid[Main.tile[i, j + 1].type] && Main.tile[i, j + 1].slope() == 0 && !Main.tile[i, j + 1].halfBrick()) + { + Main.tile[i, j].frameY = (short)(0 * 18); + } + else if (Main.tile[i, j - 1].active() && Main.tileSolid[Main.tile[i, j - 1].type] && Main.tile[i, j - 1].slope() == 0 && !Main.tile[i, j - 1].halfBrick()) + { + Main.tile[i, j].frameY = (short)(1 * 18); + } + else if (Main.tile[i + 1, j].active() && Main.tileSolid[Main.tile[i + 1, j].type] && Main.tile[i + 1, j].slope() == 0 && !Main.tile[i + 1, j].halfBrick()) + { + Main.tile[i, j].frameY = (short)(2 * 18); + } + else if (Main.tile[i - 1, j].active() && Main.tileSolid[Main.tile[i - 1, j].type] && Main.tile[i - 1, j].slope() == 0 && !Main.tile[i - 1, j].halfBrick()) + { + Main.tile[i, j].frameY = (short)(3 * 18); + } + Main.tile[i, j].frameX = (short)(WorldGen.genRand.Next(18) * 18); + } + } +} \ No newline at end of file diff --git a/Tiles/SunkenSea/SeaPrismCrystals.png b/Tiles/SunkenSea/SeaPrismCrystals.png new file mode 100644 index 0000000000..f53ca4fade Binary files /dev/null and b/Tiles/SunkenSea/SeaPrismCrystals.png differ diff --git a/Tiles/SunkenSea/SmallBrainCoral.cs b/Tiles/SunkenSea/SmallBrainCoral.cs new file mode 100644 index 0000000000..e364cbe393 --- /dev/null +++ b/Tiles/SunkenSea/SmallBrainCoral.cs @@ -0,0 +1,57 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Terraria; +using Terraria.ObjectData; +using Terraria.ModLoader; +using Microsoft.Xna.Framework; + +namespace CalamityMod.Tiles.SunkenSea +{ + public class SmallBrainCoral : ModTile + { + public override void SetDefaults() + { + Main.tileFrameImportant[Type] = true; + Main.tileNoAttach[Type] = true; + Main.tileBlockLight[Type] = true; + TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); + TileObjectData.addTile(Type); + dustType = 253; + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Small Brain Coral"); + AddMapEntry(new Color(0, 0, 80)); + mineResist = 3f; + + base.SetDefaults(); + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void NearbyEffects(int i, int j, bool closer) + { + if (closer) + { + if (Main.rand.Next(300) == 0) + { + int tileLocationY = j - 1; + if (Main.tile[i, tileLocationY] != null) + { + if (!Main.tile[i, tileLocationY].active()) + { + if (Main.tile[i, tileLocationY].liquid == 255 && Main.tile[i, tileLocationY - 1].liquid == 255 && + Main.tile[i, tileLocationY - 2].liquid == 255 && Main.netMode != 1) + { + Projectile.NewProjectile((float)(i * 16 + 16), (float)(tileLocationY * 16 + 16), 0f, -0.1f, mod.ProjectileType("CoralBubbleSmall"), 0, 1f, Main.myPlayer, 0f, 0f); + } + } + } + } + } + } + } +} diff --git a/Tiles/SunkenSea/SmallBrainCoral.png b/Tiles/SunkenSea/SmallBrainCoral.png new file mode 100644 index 0000000000..31de0f162e Binary files /dev/null and b/Tiles/SunkenSea/SmallBrainCoral.png differ diff --git a/Tiles/SunkenSea/SmallTubeCoral.cs b/Tiles/SunkenSea/SmallTubeCoral.cs new file mode 100644 index 0000000000..2c39da12d7 --- /dev/null +++ b/Tiles/SunkenSea/SmallTubeCoral.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Terraria; +using Terraria.Enums; +using Terraria.ObjectData; +using Terraria.DataStructures; +using Terraria.ModLoader; +using Microsoft.Xna.Framework; + +namespace CalamityMod.Tiles.SunkenSea +{ + public class SmallTubeCoral : ModTile + { + public override void SetDefaults() + { + Main.tileFrameImportant[Type] = true; + Main.tileNoAttach[Type] = true; + Main.tileBlockLight[Type] = true; + TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); + TileObjectData.addTile(Type); + dustType = 253; + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Small Tube Coral"); + AddMapEntry(new Color(0, 0, 80)); + mineResist = 3f; + + base.SetDefaults(); + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + } +} diff --git a/Tiles/SunkenSea/SmallTubeCoral.png b/Tiles/SunkenSea/SmallTubeCoral.png new file mode 100644 index 0000000000..b4e9092d42 Binary files /dev/null and b/Tiles/SunkenSea/SmallTubeCoral.png differ diff --git a/Tiles/SunkenSea/SunkenSeaStalactite.cs b/Tiles/SunkenSea/SunkenSeaStalactite.cs new file mode 100644 index 0000000000..f143bfd4c5 --- /dev/null +++ b/Tiles/SunkenSea/SunkenSeaStalactite.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Terraria; +using Terraria.ObjectData; +using Terraria.ModLoader; +using Microsoft.Xna.Framework; + +namespace CalamityMod.Tiles.SunkenSea +{ + public class SunkenSeaStalactite : ModTile + { + public override void SetDefaults() + { + Main.tileFrameImportant[Type] = true; + Main.tileNoFail[Type] = true; + Main.tileObsidianKill[Type] = true; + Main.tileBlockLight[Type] = true; + dustType = 96; + AddMapEntry(new Color(0, 50, 50)); + + base.SetDefaults(); + } + + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height) + { + Tile tile = Main.tile[i, j]; + if (tile.frameY <= 18 || tile.frameY == 72) + { + offsetY = -2; + } + else if ((tile.frameY >= 36 && tile.frameY <= 54) || tile.frameY == 90) + { + offsetY = 2; + } + } + + public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) + { + WorldGen.CheckTight(i, j); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 4; + } + } +} diff --git a/Tiles/SunkenSea/SunkenSeaStalactite.png b/Tiles/SunkenSea/SunkenSeaStalactite.png new file mode 100644 index 0000000000..7ed7c07179 Binary files /dev/null and b/Tiles/SunkenSea/SunkenSeaStalactite.png differ diff --git a/Tiles/SunkenSea/TableCoral.cs b/Tiles/SunkenSea/TableCoral.cs new file mode 100644 index 0000000000..bd9a822e85 --- /dev/null +++ b/Tiles/SunkenSea/TableCoral.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Terraria; +using Terraria.Enums; +using Terraria.ObjectData; +using Terraria.ModLoader; +using Terraria.DataStructures; +using Microsoft.Xna.Framework; + +namespace CalamityMod.Tiles.SunkenSea +{ + public class TableCoral : ModTile + { + public override void SetDefaults() + { + Main.tileFrameImportant[Type] = true; + Main.tileNoAttach[Type] = true; + Main.tileBlockLight[Type] = true; + Main.tileSolidTop[Type] = true; + TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2); + TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.None, 0, 0); + TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); + TileObjectData.newAlternate.AnchorLeft = new AnchorData(AnchorType.SolidTile, 2, 0); + TileObjectData.addAlternate(1); + TileObjectData.newTile.AnchorRight = new AnchorData(AnchorType.SolidTile, 2, 0); + TileObjectData.addTile(Type); + dustType = 253; + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Table Coral"); + AddMapEntry(new Color(0, 0, 80)); + mineResist = 3f; + + base.SetDefaults(); + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + } +} diff --git a/Tiles/SunkenSea/TableCoral.png b/Tiles/SunkenSea/TableCoral.png new file mode 100644 index 0000000000..42d2201e27 Binary files /dev/null and b/Tiles/SunkenSea/TableCoral.png differ diff --git a/Tiles/SunkenSea/TubeCoral.cs b/Tiles/SunkenSea/TubeCoral.cs new file mode 100644 index 0000000000..19acf556b8 --- /dev/null +++ b/Tiles/SunkenSea/TubeCoral.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Terraria; +using Terraria.Enums; +using Terraria.ObjectData; +using Terraria.DataStructures; +using Terraria.ModLoader; +using Microsoft.Xna.Framework; + +namespace CalamityMod.Tiles.SunkenSea +{ + public class TubeCoral : ModTile + { + public override void SetDefaults() + { + Main.tileFrameImportant[Type] = true; + Main.tileNoAttach[Type] = true; + Main.tileBlockLight[Type] = true; + TileObjectData.newTile.CopyFrom(TileObjectData.Style2xX); + TileObjectData.newTile.Height = 3; + TileObjectData.newTile.CoordinateHeights = new[] + { + 16, + 16, + 16 + }; + TileObjectData.addTile(Type); + dustType = 253; + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Tube Coral"); + AddMapEntry(new Color(0, 0, 80)); + mineResist = 3f; + + base.SetDefaults(); + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + } +} diff --git a/Tiles/SunkenSea/TubeCoral.png b/Tiles/SunkenSea/TubeCoral.png new file mode 100644 index 0000000000..d4b509f0df Binary files /dev/null and b/Tiles/SunkenSea/TubeCoral.png differ diff --git a/Tiles/Tenebris.cs b/Tiles/Tenebris.cs index ebc45cabe4..9f2c2143be 100644 --- a/Tiles/Tenebris.cs +++ b/Tiles/Tenebris.cs @@ -70,7 +70,7 @@ namespace CalamityMod.Tiles { if (Main.tile[i, j].active()) { - if (Main.rand.Next(5) == 0 && !Main.tile[i, j].lava()) + if (Main.tile[i, j].type == mod.TileType("PlantyMush") && WorldGen.genRand.Next(5) == 0 && !Main.tile[i, j].lava()) { Main.tile[i, j].type = (ushort)mod.TileType("Tenebris"); WorldGen.SquareTileFrame(i, j, true); diff --git a/Tiles/TranquilityCandle.cs b/Tiles/TranquilityCandle.cs new file mode 100644 index 0000000000..9f5f0bc509 --- /dev/null +++ b/Tiles/TranquilityCandle.cs @@ -0,0 +1,65 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles +{ + public class TranquilityCandle : ModTile + { + public override void SetDefaults() + { + Main.tileLighted[Type] = true; + Main.tileFrameImportant[Type] = true; + Main.tileLavaDeath[Type] = true; + TileObjectData.newTile.CopyFrom(TileObjectData.StyleOnTable1x1); + TileObjectData.addTile(Type); + drop = mod.ItemType("TranquilityCandle"); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Tranquility Candle"); + AddMapEntry(new Color(238, 145, 105), name); + animationFrameHeight = 20; + } + + public override void AnimateTile(ref int frame, ref int frameCounter) + { + frameCounter++; + if (frameCounter >= 4) + { + frame = (frame + 1) % 10; + frameCounter = 0; + } + } + + public override void MouseOver(int i, int j) + { + Player player = Main.LocalPlayer; + player.noThrow = 2; + player.showItemIcon = true; + player.showItemIcon2 = mod.ItemType("TranquilityCandle"); + } + + public override void NearbyEffects(int i, int j, bool closer) + { + Player player = Main.LocalPlayer; + if (!player.dead && player.active) + player.AddBuff(mod.BuffType("TranquilityCandle"), 20); + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + r = 0.55f; + g = 0.055f; + b = 0.55f; + } + + /*public override void RightClick(int i, int j) + { + Item.NewItem(i * 16, j * 16, 8, 8, mod.ItemType("TranquilityCandle")); + ?? KillTile( i, j); + }*/ + } +} \ No newline at end of file diff --git a/Tiles/TranquilityCandle.png b/Tiles/TranquilityCandle.png new file mode 100644 index 0000000000..eb1f0f44a4 Binary files /dev/null and b/Tiles/TranquilityCandle.png differ diff --git a/Tiles/ViperVines.cs b/Tiles/ViperVines.cs index 2fe598ee2a..b46ef5fe8a 100644 --- a/Tiles/ViperVines.cs +++ b/Tiles/ViperVines.cs @@ -32,7 +32,21 @@ namespace CalamityMod.Tiles { Item.NewItem(new Vector2(i * 16 + 8f, j * 16 + 8f), ItemID.VineRope); } - } + if (Main.tile[i, j + 1] != null) + { + if (Main.tile[i, j + 1].active()) + { + if (Main.tile[i, j + 1].type == mod.TileType("ViperVines")) + { + WorldGen.KillTile(i, j + 1, false, false, false); + if (!Main.tile[i, j + 1].active() && Main.netMode != 0) + { + NetMessage.SendData(17, -1, -1, null, 0, (float)i, (float)j + 1, 0f, 0, 0, 0); + } + } + } + } + } public override void RandomUpdate(int i, int j) { @@ -61,12 +75,18 @@ namespace CalamityMod.Tiles int num53 = i; int num54 = j + 1; Main.tile[num53, num54].type = (ushort)mod.TileType("ViperVines"); - Main.tile[num53, num54].active(true); + Main.tile[num53, num54].frameX = (short)(WorldGen.genRand.Next(8) * 18); + Main.tile[num53, num54].frameY = (short)(4 * 18); + Main.tile[num53, num54 - 1].frameX = (short)(WorldGen.genRand.Next(12) * 18); + Main.tile[num53, num54 - 1].frameY = (short)(WorldGen.genRand.Next(4) * 18); + Main.tile[num53, num54].active(true); WorldGen.SquareTileFrame(num53, num54, true); - if (Main.netMode == 2) + WorldGen.SquareTileFrame(num53, num54 - 1, true); + if (Main.netMode == 2) { NetMessage.SendTileSquare(-1, num53, num54, 3, TileChangeType.None); - } + NetMessage.SendTileSquare(-1, num53, num54 - 1, 3, TileChangeType.None); + } } } } diff --git a/Tiles/Voidstone.cs b/Tiles/Voidstone.cs index 7c06360142..557deb439b 100644 --- a/Tiles/Voidstone.cs +++ b/Tiles/Voidstone.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Tiles { if (NPC.downedPlantBoss || CalamityWorld.downedCalamitas) { - int random = WorldGen.genRand.Next(3); + int random = WorldGen.genRand.Next(4); if (random == 0) { i++; @@ -57,17 +57,38 @@ namespace CalamityMod.Tiles } if (random == 2) { - j--; + j++; } + if (random == 3) + { + j--; + } if (Main.tile[i, j] != null) { if (!Main.tile[i, j].active()) { - if (Main.rand.Next(20) == 0 && !Main.tile[i, j].lava()) + if (Main.rand.Next(20) == 0 && !Main.tile[i, j].lava() && Main.tile[i, j].slope() == 0 && !Main.tile[i, j].halfBrick()) { Main.tile[i, j].type = (ushort)mod.TileType("LumenylCrystals"); Main.tile[i, j].active(true); - WorldGen.SquareTileFrame(i, j, true); + if (Main.tile[i, j + 1].active() && Main.tileSolid[Main.tile[i, j + 1].type] && Main.tile[i, j + 1].slope() == 0 && !Main.tile[i, j + 1].halfBrick()) + { + Main.tile[i, j].frameY = (short)(0 * 18); + } + else if (Main.tile[i, j - 1].active() && Main.tileSolid[Main.tile[i, j - 1].type] && Main.tile[i, j - 1].slope() == 0 && !Main.tile[i, j - 1].halfBrick()) + { + Main.tile[i, j].frameY = (short)(1 * 18); + } + else if (Main.tile[i + 1, j].active() && Main.tileSolid[Main.tile[i + 1, j].type] && Main.tile[i + 1, j].slope() == 0 && !Main.tile[i + 1, j].halfBrick()) + { + Main.tile[i, j].frameY = (short)(2 * 18); + } + else if (Main.tile[i - 1, j].active() && Main.tileSolid[Main.tile[i - 1, j].type] && Main.tile[i - 1, j].slope() == 0 && !Main.tile[i - 1, j].halfBrick()) + { + Main.tile[i, j].frameY = (short)(3 * 18); + } + Main.tile[i, j].frameX = (short)(WorldGen.genRand.Next(18) * 18); + WorldGen.SquareTileFrame(i, j, true); if (Main.netMode == 2) { NetMessage.SendTileSquare(-1, i, j, 1, TileChangeType.None); diff --git a/Tiles/YellowCandle.cs b/Tiles/YellowCandle.cs new file mode 100644 index 0000000000..ab0916f22c --- /dev/null +++ b/Tiles/YellowCandle.cs @@ -0,0 +1,72 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles +{ + public class YellowCandle : ModTile + { + public override void SetDefaults() + { + Main.tileLighted[Type] = true; + Main.tileFrameImportant[Type] = true; + Main.tileLavaDeath[Type] = true; + TileObjectData.newTile.CopyFrom(TileObjectData.Style1x2); + TileObjectData.addTile(Type); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Spiteful Candle"); + AddMapEntry(new Color(238, 145, 105), name); + animationFrameHeight = 34; + } + + public override void AnimateTile(ref int frame, ref int frameCounter) + { + frameCounter++; + if (frameCounter >= 6) + { + frame = (frame + 1) % 6; + frameCounter = 0; + } + } + + public override void NearbyEffects(int i, int j, bool closer) + { + Player player = Main.LocalPlayer; + if (!player.dead && player.active) + { + player.AddBuff(mod.BuffType("YellowDamageCandle"), 20); + if (Main.netMode != 1) + { + for (int m = 0; m < 200; m++) + { + if (Main.npc[m].active && !Main.npc[m].friendly) + { + Main.npc[m].buffImmune[mod.BuffType("YellowDamageCandle")] = false; + if (Main.npc[m].type == mod.NPCType("CeaselessVoid") || Main.npc[m].type == mod.NPCType("EidolonWyrmHeadHuge")) + { + Main.npc[m].buffImmune[mod.BuffType("YellowDamageCandle")] = true; + } + Main.npc[m].AddBuff(mod.BuffType("YellowDamageCandle"), 20, false); + } + } + } + } + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + r = 0.75f; + g = 0.75f; + b = 0.35f; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 16, 32, mod.ItemType("YellowCandle")); + } + } +} diff --git a/Tiles/YellowCandle.png b/Tiles/YellowCandle.png new file mode 100644 index 0000000000..3bc79d5a42 Binary files /dev/null and b/Tiles/YellowCandle.png differ diff --git a/UI/BossHealthBarManager.cs b/UI/BossHealthBarManager.cs index fcb992cdac..aceed87f8e 100644 --- a/UI/BossHealthBarManager.cs +++ b/UI/BossHealthBarManager.cs @@ -158,7 +158,6 @@ namespace CalamityMod.UI { ExclusionList = new List(); - //True Eye of Cthulhu, can't kill em so ExclusionList.Add(NPCID.MoonLordFreeEye); ExclusionList.Add(NPCID.MoonLordHead); ExclusionList.Add(NPCID.MoonLordHand); @@ -193,14 +192,14 @@ namespace CalamityMod.UI MinibossHPBarList.Add(NPCID.DD2Betsy); MinibossHPBarList.Add(NPCID.DD2OgreT2); MinibossHPBarList.Add(NPCID.DD2OgreT3); - MinibossHPBarList.Add(NPCID.DD2DarkMageT1); + MinibossHPBarList.Add(NPCID.DD2DarkMageT1); //800 HP MinibossHPBarList.Add(NPCID.DD2DarkMageT3); //Prehardmode MinibossHPBarList.Add(NPCID.DungeonGuardian); //Hardmode - MinibossHPBarList.Add(NPCID.GoblinSummoner); + MinibossHPBarList.Add(NPCID.GoblinSummoner); //2000 HP MinibossHPBarList.Add(NPCID.Paladin); MinibossHPBarList.Add(NPCID.IceGolem); MinibossHPBarList.Add(NPCID.SandElemental); @@ -221,9 +220,6 @@ namespace CalamityMod.UI Mod calamity = ModLoader.GetMod("CalamityMod"); if (calamity != null) { - //Prehardmode - MinibossHPBarList.Add(calamity.NPCType("Cnidrion")); - //Hardmode MinibossHPBarList.Add(calamity.NPCType("ThiccWaifu")); MinibossHPBarList.Add(calamity.NPCType("Horse")); @@ -552,7 +548,7 @@ namespace CalamityMod.UI dead = true; int life = _npc.life; - if (life < 0 || !_npc.active || _npc.lifeMax < 400) + if (life < 0 || !_npc.active || _npc.lifeMax < 800) dead = true; if (_oneToMany) diff --git a/UIHandler.cs b/UIHandler.cs index f6cce4e919..cee41c5042 100644 --- a/UIHandler.cs +++ b/UIHandler.cs @@ -23,31 +23,31 @@ namespace CalamityMod public class UIHandler { public static UserInterface userBar; - public static UserInterface userBar2; - public static UIBar uiBar; - public static UIBar2 uiBar2; + public static UserInterface userBar2; + public static UIBar uiBar; + public static UIBar2 uiBar2; - //call this in mod.Load() - public static void OnLoad(Mod mod) + //call this in mod.Load() + public static void OnLoad(Mod mod) { Texture2D borderTex = mod.GetTexture("ExtraTextures/UI/BarStressBorder"), barTex = mod.GetTexture("ExtraTextures/UI/BarStress"); //replace 'null' with your textures. uiBar = new UIBar(borderTex, barTex, 4); //the 4 is how many pixels inwards to stick the bar, which in this case is 4. userBar = new UserInterface(); userBar.SetState(uiBar); - Texture2D borderTex2 = mod.GetTexture("ExtraTextures/UI/BarAdrenalineBorder"), barTex2 = mod.GetTexture("ExtraTextures/UI/BarAdrenaline"); //replace 'null' with your textures. - uiBar2 = new UIBar2(borderTex2, barTex2, 4); //the 4 is how many pixels inwards to stick the bar, which in this case is 4. - userBar2 = new UserInterface(); - userBar2.SetState(uiBar2); - } - + Texture2D borderTex2 = mod.GetTexture("ExtraTextures/UI/BarAdrenalineBorder"), barTex2 = mod.GetTexture("ExtraTextures/UI/BarAdrenaline"); //replace 'null' with your textures. + uiBar2 = new UIBar2(borderTex2, barTex2, 4); //the 4 is how many pixels inwards to stick the bar, which in this case is 4. + userBar2 = new UserInterface(); + userBar2.SetState(uiBar2); + } + //call this in mod.ModifyInterfaceLayers() public static void ModifyInterfaceLayers(Mod mod, List layers) { AddInterfaceLayer(mod, layers, userBar, uiBar, "Calamity: Stress Bar", "Vanilla: Mouse Text", true); - AddInterfaceLayer(mod, layers, userBar2, uiBar2, "Calamity: Adrenaline Bar", "Vanilla: Mouse Text", true); - } - + AddInterfaceLayer(mod, layers, userBar2, uiBar2, "Calamity: Adrenaline Bar", "Vanilla: Mouse Text", true); + } + public static void AddInterfaceLayer(Mod mod, List list, UserInterface uInterface, UIElement uElement, string layerName, string parent, bool first) { GameInterfaceLayer item = new LegacyGameInterfaceLayer(mod.Name + ":" + layerName, delegate @@ -58,12 +58,12 @@ namespace CalamityMod }, InterfaceScaleType.UI); int insertAt = -1; - for (int m = 0; m < list.Count; m++) - { - GameInterfaceLayer dl = list[m]; - if (dl.Name.Contains(parent)) { insertAt = m; break; } - } - if (insertAt == -1) list.Add(item); else list.Insert(first ? insertAt : insertAt + 1, item); - } + for (int m = 0; m < list.Count; m++) + { + GameInterfaceLayer dl = list[m]; + if (dl.Name.Contains(parent)) { insertAt = m; break; } + } + if (insertAt == -1) list.Add(item); else list.Insert(first ? insertAt : insertAt + 1, item); + } } } \ No newline at end of file diff --git a/Walls/EutrophicSandWall.cs b/Walls/EutrophicSandWall.cs new file mode 100644 index 0000000000..0d15d3f9bb --- /dev/null +++ b/Walls/EutrophicSandWall.cs @@ -0,0 +1,19 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Walls +{ + public class EutrophicSandWall : ModWall + { + public override void SetDefaults() + { + dustType = 108; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + } +} \ No newline at end of file diff --git a/Walls/EutrophicSandWall.png b/Walls/EutrophicSandWall.png new file mode 100644 index 0000000000..2f53060752 Binary files /dev/null and b/Walls/EutrophicSandWall.png differ diff --git a/Walls/NavystoneWall.cs b/Walls/NavystoneWall.cs new file mode 100644 index 0000000000..688ba5c8d4 --- /dev/null +++ b/Walls/NavystoneWall.cs @@ -0,0 +1,42 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Walls +{ + public class NavystoneWall : ModWall + { + private Rectangle _area; + + public override void SetDefaults() + { + dustType = 96; + } + + public override void RandomUpdate(int i, int j) + { + int myRadius = 5; + int diameter = myRadius * 2; + _area = new Rectangle(i - myRadius, j - myRadius, diameter, diameter); + if (CalamityWorld.SunkenSeaLocation.Contains(_area)) + { + for (int x = _area.Left; x < _area.Width; x++) + { + for (int y = _area.Top; y < _area.Height; y++) + { + if (Main.tile[x, y].liquid <= 0) + { + Main.tile[i, j].liquid = 255; + Main.tile[i, j].lava(false); + } + } + } + } + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + } +} \ No newline at end of file diff --git a/Walls/NavystoneWall.png b/Walls/NavystoneWall.png new file mode 100644 index 0000000000..83238b1b57 Binary files /dev/null and b/Walls/NavystoneWall.png differ diff --git a/Waters/GreatSeaWater.png b/Waters/GreatSeaWater.png deleted file mode 100644 index 62e9093972..0000000000 Binary files a/Waters/GreatSeaWater.png and /dev/null differ diff --git a/Waters/GreatSeaWater_Block.png b/Waters/GreatSeaWater_Block.png deleted file mode 100644 index 0adc5583cb..0000000000 Binary files a/Waters/GreatSeaWater_Block.png and /dev/null differ diff --git a/Waters/GreatSeaWaterflow.png b/Waters/GreatSeaWaterflow.png deleted file mode 100644 index 22a2918f2c..0000000000 Binary files a/Waters/GreatSeaWaterflow.png and /dev/null differ diff --git a/Waters/GreatSeaWater.cs b/Waters/SunkenSeaWater.cs similarity index 70% rename from Waters/GreatSeaWater.cs rename to Waters/SunkenSeaWater.cs index 1f75ae6b62..c9cd17d18c 100644 --- a/Waters/GreatSeaWater.cs +++ b/Waters/SunkenSeaWater.cs @@ -4,21 +4,21 @@ using Terraria.ModLoader; namespace CalamityMod.Waters { - public class GreatSeaWater : ModWaterStyle + public class SunkenSeaWater : ModWaterStyle { public override bool ChooseWaterStyle() { - return Main.LocalPlayer.GetModPlayer(mod).ZoneGreatSea; + return Main.LocalPlayer.GetModPlayer(mod).ZoneSunkenSea; } public override int ChooseWaterfallStyle() { - return mod.GetWaterfallStyleSlot("GreatSeaWaterflow"); + return mod.GetWaterfallStyleSlot("SunkenSeaWaterflow"); } public override int GetSplashDust() { - return 185; + return 33; } public override int GetDropletGore() @@ -28,7 +28,7 @@ namespace CalamityMod.Waters public override Color BiomeHairColor() { - return Color.Cyan; + return Color.Blue; } } } \ No newline at end of file diff --git a/Waters/SunkenSeaWater.png b/Waters/SunkenSeaWater.png new file mode 100644 index 0000000000..45af5a5c94 Binary files /dev/null and b/Waters/SunkenSeaWater.png differ diff --git a/Waters/SunkenSeaWater_Block.png b/Waters/SunkenSeaWater_Block.png new file mode 100644 index 0000000000..87a5f07a83 Binary files /dev/null and b/Waters/SunkenSeaWater_Block.png differ diff --git a/Waters/GreatSeaWaterflow.cs b/Waters/SunkenSeaWaterflow.cs similarity index 57% rename from Waters/GreatSeaWaterflow.cs rename to Waters/SunkenSeaWaterflow.cs index 4c8b80e45b..631c9cf0ee 100644 --- a/Waters/GreatSeaWaterflow.cs +++ b/Waters/SunkenSeaWaterflow.cs @@ -3,7 +3,7 @@ using Terraria.ModLoader; namespace CalamityMod.Waters { - public class GreatSeaWaterflow : ModWaterfallStyle + public class SunkenSeaWaterflow : ModWaterfallStyle { } diff --git a/Waters/SunkenSeaWaterflow.png b/Waters/SunkenSeaWaterflow.png new file mode 100644 index 0000000000..17626db60c Binary files /dev/null and b/Waters/SunkenSeaWaterflow.png differ diff --git a/WeakReferenceSupport.cs b/WeakReferenceSupport.cs new file mode 100644 index 0000000000..2d2bf98fe9 --- /dev/null +++ b/WeakReferenceSupport.cs @@ -0,0 +1,63 @@ +using System; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod +{ + internal class WeakReferenceSupport + { + public static void Setup() + { + BossChecklistSupport(); + CensusSupport(); + } + + private static void BossChecklistSupport() + { + Mod mod = ModLoader.GetMod("CalamityMod"); + Mod bossChecklist = ModLoader.GetMod("BossChecklist"); + + if (bossChecklist != null) + { + // 14 is moonlord, 12 is duke fishron + bossChecklist.Call("AddBossWithInfo", "Desert Scourge", 1.5f, (Func)(() => CalamityWorld.downedDesertScourge), "Use a [i:" + mod.ItemType("DriedSeafood") + "] in the Desert Biome"); //1 + bossChecklist.Call("AddBossWithInfo", "Crabulon", 2.5f, (Func)(() => CalamityWorld.downedCrabulon), "Use a [i:" + mod.ItemType("DecapoditaSprout") + "] in the Mushroom Biome"); //1.5 + bossChecklist.Call("AddBossWithInfo", "Hive Mind / Perforator", 3.5f, (Func)(() => (CalamityWorld.downedPerforator || CalamityWorld.downedHiveMind)), "By killing a Cyst in the World's Evil Biome"); //2 + bossChecklist.Call("AddBossWithInfo", "Slime God", 5.5f, (Func)(() => CalamityWorld.downedSlimeGod), "Use an [i:" + mod.ItemType("OverloadedSludge") + "]"); //4 + bossChecklist.Call("AddBossWithInfo", "Cryogen", 6.5f, (Func)(() => CalamityWorld.downedCryogen), "Use a [i:" + mod.ItemType("CryoKey") + "] in the Snow Biome"); //5 + bossChecklist.Call("AddBossWithInfo", "Brimstone Elemental", 7.5f, (Func)(() => CalamityWorld.downedBrimstoneElemental), "Use a [i:" + mod.ItemType("CharredIdol") + "] in the Hell Crag"); //6 + bossChecklist.Call("AddBossWithInfo", "Aquatic Scourge", 8.5f, (Func)(() => CalamityWorld.downedAquaticScourge), "Use a [i:" + mod.ItemType("Seafood") + "] in the Sulphuric Sea or wait for it to spawn in the Sulphuric Sea"); //6 + bossChecklist.Call("AddBossWithInfo", "Calamitas", 9.7f, (Func)(() => CalamityWorld.downedCalamitas), "Use an [i:" + mod.ItemType("BlightedEyeball") + "] at Night"); //7 + bossChecklist.Call("AddBossWithInfo", "Leviathan", 10.5f, (Func)(() => CalamityWorld.downedLeviathan), "By killing an unknown entity in the Ocean Biome"); //8 + bossChecklist.Call("AddBossWithInfo", "Astrum Aureus", 10.55f, (Func)(() => CalamityWorld.downedAstrageldon), "Use an [i:" + mod.ItemType("AstralChunk") + "] at Night"); //8.25 + bossChecklist.Call("AddBossWithInfo", "Astrum Deus", 10.6f, (Func)(() => CalamityWorld.downedStarGod), "Use a [i:" + mod.ItemType("Starcore") + "] at Night"); //8.5 + bossChecklist.Call("AddBossWithInfo", "Plaguebringer Goliath", 11.5f, (Func)(() => CalamityWorld.downedPlaguebringer), "Use an [i:" + mod.ItemType("Abomination") + "] in the Jungle Biome"); //9 + bossChecklist.Call("AddBossWithInfo", "Ravager", 12.5f, (Func)(() => CalamityWorld.downedScavenger), "Use an [i:" + mod.ItemType("AncientMedallion") + "]"); //9.5 + //bossChecklist.Call("AddBossWithInfo", "The Old Duke", 13.5f, (Func)(() => CalamityWorld.downedOldDuke), "Fishing with some type of bait in the Sulphuric Sea"); //9.6 + bossChecklist.Call("AddBossWithInfo", "Profaned Guardians", 14.5f, (Func)(() => CalamityWorld.downedGuardians), "Use a [i:" + mod.ItemType("ProfanedShard") + "] in the Hallow or Underworld Biomes"); //10 + bossChecklist.Call("AddBossWithInfo", "Bumblebirb", 14.6f, (Func)(() => CalamityWorld.downedBumble), "Use [i:" + mod.ItemType("BirbPheromones") + "] in the Jungle Biome"); //16 + bossChecklist.Call("AddBossWithInfo", "Providence", 15f, (Func)(() => CalamityWorld.downedProvidence), "Use a [i:" + mod.ItemType("ProfanedCore") + "] in the Hallow or Underworld Biomes"); //11 + bossChecklist.Call("AddBossWithInfo", "Ceaseless Void", 15.1f, (Func)(() => CalamityWorld.downedSentinel1), "Use a [i:" + mod.ItemType("RuneofCos") + "] in the Dungeon"); //12 + bossChecklist.Call("AddBossWithInfo", "Storm Weaver", 15.2f, (Func)(() => CalamityWorld.downedSentinel2), "Use a [i:" + mod.ItemType("RuneofCos") + "] in Space"); //13 + bossChecklist.Call("AddBossWithInfo", "Signus", 15.3f, (Func)(() => CalamityWorld.downedSentinel3), "Use a [i:" + mod.ItemType("RuneofCos") + "] in the Underworld"); //14 + bossChecklist.Call("AddBossWithInfo", "Polterghast", 15.5f, (Func)(() => CalamityWorld.downedPolterghast), "Use a [i:" + mod.ItemType("NecroplasmicBeacon") + "] in the Dungeon or kill 30 phantom spirits"); //11 + bossChecklist.Call("AddBossWithInfo", "Devourer of Gods", 16f, (Func)(() => CalamityWorld.downedDoG), "Use a [i:" + mod.ItemType("CosmicWorm") + "]"); //15 + bossChecklist.Call("AddBossWithInfo", "Yharon", 17f, (Func)(() => CalamityWorld.downedYharon), "Use a [i:" + mod.ItemType("ChickenEgg") + "] in the Jungle Biome"); //17 + bossChecklist.Call("AddBossWithInfo", "Supreme Calamitas", 18f, (Func)(() => CalamityWorld.downedSCal), "Use an [i:" + mod.ItemType("EyeofExtinction") + "]"); //18 + //bossChecklist.Call("AddBossWithInfo", "MEME GOD", 19f, (Func)(() => CalamityWorld.downedLORDE), "Use [i:" + mod.ItemType("NO") + "]"); //19 + } + } + + private static void CensusSupport() + { + Mod mod = ModLoader.GetMod("CalamityMod"); + Mod censusMod = ModLoader.GetMod("Census"); + if (censusMod != null) + { + censusMod.Call("TownNPCCondition", mod.NPCType("SEAHOE"), "Defeat a Giant Clam"); + censusMod.Call("TownNPCCondition", mod.NPCType("FAP"), "Have [i:" + mod.ItemType("FabsolsVodka") + "] in your inventory in Hardmode"); + censusMod.Call("TownNPCCondition", mod.NPCType("DILF"), "Defeat Cryogen"); + } + } + } +} diff --git a/World/Planets/MainPlanet.cs b/World/Planets/MainPlanet.cs index 9843ac102a..eecebef6dc 100644 --- a/World/Planets/MainPlanet.cs +++ b/World/Planets/MainPlanet.cs @@ -19,7 +19,8 @@ namespace CalamityMod.World.Planets { public override bool Place(Point origin, StructureMap structures) { - int radius = _random.Next(50, 65); + float scale = (float)Main.maxTilesX / 4200f; + int radius = (int)((float)_random.Next(30, 36) * scale); //50 to 65 if (!CheckIfPlaceable(origin, radius, structures)) { @@ -63,14 +64,14 @@ namespace CalamityMod.World.Planets //PLACE STONE THEN DIRT PATCHES int numStone = _random.Next(30, 40); - while(numStone > 0) + while (numStone > 0) { Point p = outerCore.RandomPointOnCircleEdge().ToTileCoordinates(); WorldGen.TileRunner(p.X, p.Y, _random.NextFloat(3f, 6f), _random.Next(5, 15), TileID.Stone); numStone--; } int numDirt = _random.Next(80, 110); - while(numDirt > 0) + while (numDirt > 0) { Point p = outerCore.RandomPointInCircle().ToTileCoordinates(); WorldGen.TileRunner(p.X, p.Y, _random.NextFloat(3f, 6f), _random.Next(7, 17), TileID.Dirt); diff --git a/World/Planets/Planetoid.cs b/World/Planets/Planetoid.cs index 6dbd19af2b..169bb6d4d2 100644 --- a/World/Planets/Planetoid.cs +++ b/World/Planets/Planetoid.cs @@ -4,6 +4,7 @@ using System.Linq; using System.Text; using Terraria; +using Terraria.ID; using Terraria.ModLoader; using Terraria.World.Generation; using Terraria.GameContent.Generation; @@ -20,9 +21,28 @@ namespace CalamityMod.World.Planets //Fluff is used to create padding between the planets. this is the minimum distance between planets (they can't be within "fluff" blocks) int fluff = 10; int myRadius = radius + fluff; - int diameter = myRadius * 2 ; + int diameter = myRadius * 2; _area = new Rectangle(origin.X - myRadius, origin.Y - myRadius, diameter, diameter); + Mod varia = ModLoader.GetMod("Varia"); + for (int i = _area.Left; i < _area.Width; i++) + { + for (int j = _area.Top; j < _area.Height; j++) + { + if (Main.tile[i, j].type == TileID.Cloud || Main.tile[i, j].type == TileID.RainCloud || Main.tile[i, j].type == TileID.Sunplate) + { + return false; + } + if (varia != null) + { + if (Main.tile[i, j].type == varia.TileType("StarplateBrick") || Main.tile[i, j].type == varia.TileType("ForgottenCloud")) + { + return false; + } + } + } + } + if (!structures.CanPlace(_area)) { return false; diff --git a/World/SunkenSea.cs b/World/SunkenSea.cs new file mode 100644 index 0000000000..7374e343ed --- /dev/null +++ b/World/SunkenSea.cs @@ -0,0 +1,610 @@ +using Microsoft.Xna.Framework; +using System; +using System.Collections.Generic; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.World.Generation; +using Terraria.Graphics.Effects; +using Terraria.GameContent.Generation; +using Terraria.IO; +using Terraria.Localization; +using Terraria.GameContent.Events; +using Terraria.ModLoader.IO; +using CalamityMod.Tiles; + +namespace CalamityMod.World +{ + public class SunkenSea : ModWorld + { + private struct Hub + { + public Vector2 Position; + + public Hub(Vector2 position) + { + this.Position = position; + } + + public Hub(float x, float y) + { + this.Position = new Vector2(x, y); + } + } + + private class Cluster : List + { + } + + private class ClusterGroup : List + { + public int Width; + + public int Height; + + private void SearchForCluster(bool[,] hubMap, List pointCluster, int x, int y, int level = 2) + { + pointCluster.Add(new Point(x, y)); + hubMap[x, y] = false; + level--; + if (level == -1) + { + return; + } + if (x > 0 && hubMap[x - 1, y]) + { + this.SearchForCluster(hubMap, pointCluster, x - 1, y, level); + } + if (x < hubMap.GetLength(0) - 1 && hubMap[x + 1, y]) + { + this.SearchForCluster(hubMap, pointCluster, x + 1, y, level); + } + if (y > 0 && hubMap[x, y - 1]) + { + this.SearchForCluster(hubMap, pointCluster, x, y - 1, level); + } + if (y < hubMap.GetLength(1) - 1 && hubMap[x, y + 1]) + { + this.SearchForCluster(hubMap, pointCluster, x, y + 1, level); + } + } + + private void AttemptClaim(int x, int y, int[,] clusterIndexMap, List> pointClusters, int index) //Attempts to create a cluster + { + int num = clusterIndexMap[x, y]; + if (num != -1 && num != index) + { + int num2 = (WorldGen.genRand.Next(2) == 0) ? -1 : index; + foreach (Point current in pointClusters[num]) + { + clusterIndexMap[current.X, current.Y] = num2; + } + } + } + + public void Generate(int width, int height) //Creates clusters for cluster group + { + this.Width = width; + this.Height = height; + base.Clear(); + bool[,] array = new bool[width, height]; + int num = (width >> 1) - 1; + int num2 = (height >> 1) - 1; + int num3 = (num + 1) * (num + 1); + Point point = new Point(num, num2); + for (int i = point.Y - num2; i <= point.Y + num2; i++) + { + float num4 = (float)num / (float)num2 * (float)(i - point.Y); + int num5 = Math.Min(num, (int)Math.Sqrt((double)((float)num3 - num4 * num4))); + for (int j = point.X - num5; j <= point.X + num5; j++) + { + array[j, i] = (WorldGen.genRand.Next(2) == 0); + } + } + List> list = new List>(); + for (int k = 0; k < array.GetLength(0); k++) + { + for (int l = 0; l < array.GetLength(1); l++) + { + if (array[k, l] && WorldGen.genRand.Next(2) == 0) + { + List list2 = new List(); + this.SearchForCluster(array, list2, k, l, 2); + if (list2.Count > 2) + { + list.Add(list2); + } + } + } + } + int[,] array2 = new int[array.GetLength(0), array.GetLength(1)]; + for (int m = 0; m < array2.GetLength(0); m++) + { + for (int n = 0; n < array2.GetLength(1); n++) + { + array2[m, n] = -1; + } + } + for (int num6 = 0; num6 < list.Count; num6++) + { + foreach (Point current in list[num6]) + { + array2[current.X, current.Y] = num6; + } + } + for (int num7 = 0; num7 < list.Count; num7++) + { + foreach (Point expr_205 in list[num7]) + { + int x = expr_205.X; + int y = expr_205.Y; + if (array2[x, y] == -1) + { + break; + } + int index = array2[x, y]; + if (x > 0) + { + this.AttemptClaim(x - 1, y, array2, list, index); + } + if (x < array2.GetLength(0) - 1) + { + this.AttemptClaim(x + 1, y, array2, list, index); + } + if (y > 0) + { + this.AttemptClaim(x, y - 1, array2, list, index); + } + if (y < array2.GetLength(1) - 1) + { + this.AttemptClaim(x, y + 1, array2, list, index); + } + } + } + using (List>.Enumerator enumerator2 = list.GetEnumerator()) + { + while (enumerator2.MoveNext()) + { + enumerator2.Current.Clear(); + } + } + for (int num8 = 0; num8 < array2.GetLength(0); num8++) + { + for (int num9 = 0; num9 < array2.GetLength(1); num9++) + { + if (array2[num8, num9] != -1) + { + list[array2[num8, num9]].Add(new Point(num8, num9)); + } + } + } + foreach (List current2 in list) + { + if (current2.Count < 4) + { + current2.Clear(); + } + } + foreach (List current3 in list) + { + SunkenSea.Cluster cluster = new SunkenSea.Cluster(); + if (current3.Count > 0) + { + foreach (Point current4 in current3) + { + cluster.Add(new SunkenSea.Hub((float)current4.X + (WorldGen.genRand.NextFloat() - 0.5f) * 0.5f, (float)current4.Y + (WorldGen.genRand.NextFloat() - 0.5f) * 0.5f)); + } + base.Add(cluster); + } + } + } + } + + private static void PlaceClusters(SunkenSea.ClusterGroup clusters, Point start, Vector2 scale) //Places tile/wall clusters in Sunken Sea area + { + Mod mod = ModLoader.GetMod("CalamityMod"); + int num = (int)(scale.X * (float)clusters.Width); + int num2 = (int)(scale.Y * (float)clusters.Height); + Vector2 value = new Vector2((float)num, (float)num2); + Vector2 value2 = new Vector2((float)clusters.Width, (float)clusters.Height); + for (int i = -20; i < num + 20; i++) + { + for (int j = -20; j < num2 + 20; j++) + { + float num3 = 0f; + int num4 = -1; + float num5 = 0f; + int num6 = i + start.X; + int num7 = j + start.Y; + Vector2 vector = new Vector2((float)i, (float)j) / value * value2; + float num8 = (new Vector2((float)i, (float)j) / value * 2f - Vector2.One).Length(); + for (int k = 0; k < clusters.Count; k++) + { + SunkenSea.Cluster cluster = clusters[k]; + if (Math.Abs(cluster[0].Position.X - vector.X) <= 10f && Math.Abs(cluster[0].Position.Y - vector.Y) <= 10f) + { + float num9 = 0f; + foreach (SunkenSea.Hub current in cluster) + { + num9 += 1f / Vector2.DistanceSquared(current.Position, vector); + } + if (num9 > num3) + { + if (num3 > num5) + { + num5 = num3; + } + num3 = num9; + num4 = k; + } + else if (num9 > num5) + { + num5 = num9; + } + } + } + float num10 = num3 + num5; + Tile tile = Main.tile[num6, num7]; + bool flag = num8 >= 0.8f; + if (num10 > 3.5f) //Adjust num10 for all cases if you want different tile frequencies; higher is less frequent, lower is more frequent + { + tile.ClearEverything(); + tile.wall = (ushort)mod.WallType("NavystoneWall"); + tile.liquid = 192; + if (num4 % 15 == 2) + { + tile.ResetToType((ushort)mod.TileType("Navystone")); + tile.active(true); + tile.liquid = 0; + } + Tile.SmoothSlope(num6, num7, true); + } + else if (num10 > 1.8f) + { + tile.wall = (ushort)mod.WallType("NavystoneWall"); + tile.liquid = 192; + if (!flag || tile.active()) + { + tile.ResetToType((ushort)mod.TileType("Navystone")); + tile.active(true); + Tile.SmoothSlope(num6, num7, true); + tile.liquid = 0; + } + } + else if (num10 > 0.7f || !flag) + { + tile.liquid = 192; + if (!flag || tile.active()) + { + tile.ResetToType((ushort)mod.TileType("EutrophicSand")); + tile.active(true); + Tile.SmoothSlope(num6, num7, true); + tile.liquid = 0; + } + tile.wall = (ushort)mod.WallType("EutrophicSandWall"); + } + else if (num10 > 0.25f) + { + float num11 = (num10 - 0.25f) / 0.45f; + if (WorldGen.genRand.NextFloat() < num11) + { + if (tile.active()) + { + tile.ResetToType((ushort)mod.TileType("EutrophicSand")); + tile.active(true); + Tile.SmoothSlope(num6, num7, true); + tile.wall = (ushort)mod.WallType("EutrophicSandWall"); + tile.liquid = 0; + } + else + { + tile.wall = (ushort)mod.WallType("NavystoneWall"); + tile.liquid = 192; + } + } + } + } + } + } + + private static void AddTileVariance(SunkenSea.ClusterGroup clusters, Point start, Vector2 scale, float size) /*Adds tile variation to the generated tile clusters and generates open areas with sea prism ore; + Generates sea prism crystals on prism ore and occasionally on navystone*/ + { + Mod mod = ModLoader.GetMod("CalamityMod"); + int num = (int)(scale.X * (float)clusters.Width); + int num2 = (int)(scale.Y * (float)clusters.Height); + bool genCentalHole = true; + Rectangle rectangle = default(Rectangle); + int radius = (int)(((float)WorldGen.genRand.Next(24, 28)) * size); //Radius of the generated hole + int diameter = radius * 2; + Point point = new Point(WorldGen.UndergroundDesertLocation.Left + (WorldGen.UndergroundDesertLocation.Width / 2), + WorldGen.UndergroundDesertLocation.Bottom + (WorldGen.UndergroundDesertLocation.Height / 3)); //Around the center of the Sunken Sea area + ShapeData holeShape = new ShapeData(); + int radiusSmall = 0; + float outerRadiusPercentage = (float)((double)WorldGen.genRand.Next(40, 56) * 0.01); //Small radius for ore patch to fit inside holes + int sunkenSeaBottom = WorldGen.UndergroundDesertLocation.Bottom + (int)((double)WorldGen.UndergroundDesertLocation.Height * 0.7); + int smallHoles = 0; + int amt = (int)(4f * size); //Scale amount of holes with world size + for (int i = -20; i < num + 20; i++) + { + for (int j = -20; j < num2 + 20; j++) + { + if (genCentalHole) + { + genCentalHole = false; + rectangle = new Rectangle(WorldGen.UndergroundDesertLocation.Left + (WorldGen.UndergroundDesertLocation.Width / 2) - radius, + WorldGen.UndergroundDesertLocation.Bottom + (WorldGen.UndergroundDesertLocation.Height / 3) - radius, diameter, diameter); + + WorldUtils.Gen(point, new Shapes.Circle(radius), Actions.Chain(new GenAction[] + { + new Modifiers.Blotches(2, 0.6).Output(holeShape), //Adds uneven shape to the outer tiles + new Actions.ClearTile(true), //Clear all tiles + new Actions.SetLiquid(0, 192) //Leave some air pockets + })); + + WorldUtils.Gen(point, new ModShapes.OuterOutline(holeShape, true, true), Actions.Chain(new GenAction[] //Smooth the outer parts + { + new CustomActions.DistanceFromOrigin(true, radius * 16f - 48), + new Modifiers.Conditions(new CustomConditions.RandomChance(4)), + new Actions.Smooth(), + new Actions.SetFrames(true) + })); + + WorldUtils.Gen(point, new Shapes.Circle((int)((float)radius * outerRadiusPercentage)), Actions.Chain(new GenAction[] //Smallest is 6 + { + new Modifiers.Blotches(2, 0.3).Output(holeShape), + new Actions.SetTile((ushort)mod.TileType("Navystone"), true) //Place outer shell + })); + + WorldUtils.Gen(point, new ModShapes.OuterOutline(holeShape, true, true), Actions.Chain(new GenAction[] //Smooth outer shell + { + new CustomActions.DistanceFromOrigin(true, radius * 16f - 48), + new Modifiers.Conditions(new CustomConditions.RandomChance(3)), + new Actions.Smooth(), + new Actions.SetFrames(true) + })); + + WorldUtils.Gen(point, new Shapes.Circle((int)((float)radius * (outerRadiusPercentage * 0.6f))), Actions.Chain(new GenAction[] //Smallest is 4 + { + new Modifiers.Blotches(2, 0.3), + new Actions.SetTile((ushort)mod.TileType("SeaPrism"), true) //Place prism + })); + + WorldUtils.Gen(point, new Shapes.Circle((int)((float)radius * (outerRadiusPercentage * 0.3f))), Actions.Chain(new GenAction[] //Smallest is 2 + { + new Modifiers.Blotches(2, 0.3).Output(holeShape), + new Actions.ClearTile(true), //Clear all tiles + new Actions.SetLiquid(0, 255) + })); + + WorldUtils.Gen(point, new ModShapes.OuterOutline(holeShape, true, true), Actions.Chain(new GenAction[] //Smooth inner shell + { + new CustomActions.DistanceFromOrigin(true, radius * 16f - 48), + new Modifiers.Conditions(new CustomConditions.RandomChance(2)), + new Actions.Smooth(), + new Actions.SetFrames(true) + })); + } + point = new Point(WorldGen.genRand.Next(WorldGen.UndergroundDesertLocation.Left + 20, WorldGen.UndergroundDesertLocation.Right - 20), + WorldGen.genRand.Next(WorldGen.UndergroundDesertLocation.Bottom + 20, sunkenSeaBottom)); + if (smallHoles < amt && WorldGen.genRand.Next(3) == 0 && !rectangle.Contains(point)) + { + smallHoles++; + radiusSmall = (int)(((float)WorldGen.genRand.Next(8, 11)) * size); + WorldUtils.Gen(point, new Shapes.Circle(radiusSmall), Actions.Chain(new GenAction[] + { + new Modifiers.Blotches(2, 0.45).Output(holeShape), + new Actions.ClearTile(true), + new Actions.SetLiquid(0, 192) + })); + + WorldUtils.Gen(point, new ModShapes.OuterOutline(holeShape, true, true), Actions.Chain(new GenAction[] + { + new CustomActions.DistanceFromOrigin(true, radiusSmall * 16f - 48), + new Modifiers.Conditions(new CustomConditions.RandomChance(3)), + new Actions.Smooth(), + new Actions.SetFrames(true) + })); + + outerRadiusPercentage = (float)((double)WorldGen.genRand.Next(65, 81) * 0.01); + WorldUtils.Gen(point, new Shapes.Circle((int)((float)radiusSmall * outerRadiusPercentage)), Actions.Chain(new GenAction[] //Smallest is 4 + { + new Modifiers.Blotches(2, 0.3).Output(holeShape), + new Actions.SetTile((ushort)mod.TileType("Navystone"), true) //Place outer shell + })); + + WorldUtils.Gen(point, new ModShapes.OuterOutline(holeShape, true, true), Actions.Chain(new GenAction[] //Smooth outer shell + { + new CustomActions.DistanceFromOrigin(true, radiusSmall * 16f - 48), + new Modifiers.Conditions(new CustomConditions.RandomChance(3)), + new Actions.Smooth(), + new Actions.SetFrames(true) + })); + + WorldUtils.Gen(point, new Shapes.Circle((int)((float)radiusSmall * (outerRadiusPercentage * 0.6f))), Actions.Chain(new GenAction[] //Smallest is 2 + { + new Modifiers.Blotches(2, 0.3), + new Actions.SetTile((ushort)mod.TileType("SeaPrism"), true) //Place prism + })); + + WorldUtils.Gen(point, new Shapes.Circle((int)((float)radiusSmall * (outerRadiusPercentage * 0.3f))), Actions.Chain(new GenAction[] //Smallest is 1 + { + new Modifiers.Blotches(2, 0.3).Output(holeShape), + new Actions.ClearTile(true), //Clear center + new Actions.SetLiquid(0, 255) + })); + + WorldUtils.Gen(point, new ModShapes.OuterOutline(holeShape, true, true), Actions.Chain(new GenAction[] //Smooth inner shell + { + new CustomActions.DistanceFromOrigin(true, radius * 16f - 48), + new Modifiers.Conditions(new CustomConditions.RandomChance(2)), + new Actions.Smooth(), + new Actions.SetFrames(true) + })); + } + int num3 = i + start.X; + int num4 = j + start.Y; + Tile tile = Main.tile[num3, num4]; + Tile testTile = Main.tile[num3, num4 + 1]; + Tile testTile2 = Main.tile[num3, num4 + 2]; + if (tile.type == mod.TileType("EutrophicSand") && (!WorldGen.SolidTile(testTile) || !WorldGen.SolidTile(testTile2))) //Tile variation + { + tile.type = (ushort)mod.TileType("Navystone"); + } + } + } + for (int k = -20; k < num + 20; k++) + { + for (int l = -20; l < num2 + 20; l++) + { + int num5 = k + start.X; + int num6 = l + start.Y; + Tile tile2 = Main.tile[num5, num6]; + if (tile2.active() && (tile2.type == mod.TileType("SeaPrism") || tile2.type == mod.TileType("Navystone"))) + { + bool flag = true; + for (int m = -1; m >= -3; m--) + { + if (Main.tile[num5, num6 + m].active()) + { + flag = false; + break; + } + } + bool flag2 = true; + for (int n = 1; n <= 3; n++) + { + if (Main.tile[num5, num6 + n].active()) + { + flag2 = false; + break; + } + } + bool flag3 = true; + for (int o = -1; o >= -3; o--) + { + if (Main.tile[num5 + o, num6].active()) + { + flag3 = false; + break; + } + } + bool flag4 = true; + for (int p = 1; p <= 3; p++) + { + if (Main.tile[num5 + p, num6].active()) + { + flag4 = false; + break; + } + } + if (tile2.type == mod.TileType("SeaPrism") || (tile2.type == mod.TileType("Navystone") && WorldGen.genRand.Next(8) == 0)) + { + if (flag3 ^ flag4) + { + if (tile2.slope() == 0 && !tile2.halfBrick()) + { + Tile tile3 = Main.tile[num5 + (flag3 ? -1 : 1), num6]; + tile3.type = (ushort)mod.TileType("SeaPrismCrystals"); + if (Main.tile[num5 - 1, num6].type == mod.TileType("SeaPrismCrystals")) + { + Main.tile[num5 - 1, num6].frameY = (short)(2 * 18); + } + else if (Main.tile[num5 + 1, num6].type == mod.TileType("SeaPrismCrystals")) + { + Main.tile[num5 + 1, num6].frameY = (short)(3 * 18); + } + tile3.frameX = (short)(WorldGen.genRand.Next(18) * 18); + tile3.active(true); + } + } + if (flag ^ flag2) + { + if (tile2.slope() == 0 && !tile2.halfBrick()) + { + Tile tile3 = Main.tile[num5, num6 + (flag ? -1 : 1)]; + tile3.type = (ushort)mod.TileType("SeaPrismCrystals"); + if (Main.tile[num5, num6 - 1].type == mod.TileType("SeaPrismCrystals")) + { + Main.tile[num5, num6 - 1].frameY = (short)(0 * 18); + } + else if (Main.tile[num5, num6 + 1].type == mod.TileType("SeaPrismCrystals")) + { + Main.tile[num5, num6 + 1].frameY = (short)(1 * 18); + } + tile3.frameX = (short)(WorldGen.genRand.Next(18) * 18); + tile3.active(true); + } + } + } + } + if (!tile2.active()) + { + if (tile2.wall == mod.WallType("NavystoneWall") || tile2.wall == mod.WallType("EutrophicSandWall")) + { + if (WorldGen.genRand.Next(5) == 0) + { + CalamityWorld.PlaceTit(num5, num6, (ushort)mod.TileType("SunkenSeaStalactite")); + } + if (WorldGen.genRand.Next(8) == 0) + { + WorldGen.PlaceTile(num5, num6, (ushort)mod.TileType("BrainCoral"), true, false, -1, 0); + } + if (WorldGen.genRand.Next(6) == 0) + { + WorldGen.PlaceTile(num5, num6, (ushort)mod.TileType("SmallBrainCoral"), true, false, -1, 0); + } + if (WorldGen.genRand.Next(10) == 0) + { + WorldGen.PlaceTile(num5, num6, (ushort)mod.TileType("FanCoral"), true, false, -1, 0); + } + if (WorldGen.genRand.Next(6) == 0) + { + WorldGen.PlaceTile(num5, num6, (ushort)mod.TileType("SeaAnemone"), true, false, -1, 0); + } + if (WorldGen.genRand.Next(8) == 0) + { + WorldGen.PlaceTile(num5, num6, (ushort)mod.TileType("TubeCoral"), true, false, -1, 0); + } + if (WorldGen.genRand.Next(6) == 0) + { + WorldGen.PlaceTile(num5, num6, (ushort)mod.TileType("SmallTubeCoral"), true, false, -1, 0); + } + if (WorldGen.genRand.Next(4) == 0) + { + WorldGen.PlaceTile(num5, num6, (ushort)mod.TileType("TableCoral"), true, false, -1, 0); + } + } + } + } + } + } + + public static bool Place(Point origin) + { + float scale = (float)Main.maxTilesX / 4200f; + int sunkenSeaAreaX = (int)(80f * scale); //80f + int sunkenSeaAreaY = (int)((WorldGen.genRand.NextFloat() + 1f) * 60f * scale); //80f + float radius = (float)WorldGen.genRand.Next(6, 10); + Vector2 vector = new Vector2(4f, 2f); //4, 2 + SunkenSea.ClusterGroup clusterGroup = new SunkenSea.ClusterGroup(); + clusterGroup.Generate(sunkenSeaAreaX, sunkenSeaAreaY); + SunkenSea.PlaceClusters(clusterGroup, origin, vector); + SunkenSea.AddTileVariance(clusterGroup, origin, vector, scale); + int num4 = (int)(vector.X * (float)clusterGroup.Width); + int num5 = (int)(vector.Y * (float)clusterGroup.Height); + for (int i = -40; i < num4 + 40; i++) //40 + { + for (int j = -40; j < num5 + 40; j++) //40 + { + if (i + origin.X > 0 && i + origin.X < Main.maxTilesX - 1 && j + origin.Y > 0 && j + origin.Y < Main.maxTilesY - 1) + { + WorldGen.SquareWallFrame(i + origin.X, j + origin.Y, true); + WorldUtils.TileFrame(i + origin.X, j + origin.Y, true); + } + } + } + return true; + } + } +} diff --git a/build.txt b/build.txt index 71aa618d08..0d270c1293 100644 --- a/build.txt +++ b/build.txt @@ -1,7 +1,8 @@ author = MountainDrew -version = 1.4.1.004 +version = 1.4.2.001 displayName = Calamity Mod (No Calamity Music) homepage = https://forums.terraria.org/index.php?threads/calamity-mod.44065/ +buildIgnore = .vs\*, Properties\*, *.csproj, *.user, obj\*, bin\*, *.config, .git\*, LICENSE, README.md, .editorconfig, .gitignore, .gitattributes hideCode = true hideResources = true includeSource = false diff --git a/description.txt b/description.txt index dd432f0ebb..3c32ad6b1d 100644 --- a/description.txt +++ b/description.txt @@ -4,7 +4,7 @@ It currently contains: 24 new bosses 4 new modes for extra challenge 3 new biomes -250+ new enemy NPCs -1250+ new items +275+ new enemy NPCs +1400+ new items Cross-content support for GRealm PLEASE BE ADVISED: Download the Calamity Mod Music mod if you want Calamity Mod music to be in your game! \ No newline at end of file