From 9fdda61f0a984e37de1082aed3642b83bfcd03c6 Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Thu, 14 Sep 2023 00:35:08 -0500 Subject: [PATCH 1/8] Removed random spread from Rev+ Skeletron skulls and made him not fire skulls for a short time after his charge spin ends. --- NPCs/VanillaNPCOverrides/Bosses/SkeletronAI.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/NPCs/VanillaNPCOverrides/Bosses/SkeletronAI.cs b/NPCs/VanillaNPCOverrides/Bosses/SkeletronAI.cs index 1d8caef8c7..271967206e 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/SkeletronAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/SkeletronAI.cs @@ -281,10 +281,10 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses float num158 = bossRush ? 10f : phase2 ? (60f - (death ? 30f * (1f - lifeRatio) : 0f)) : 75f; if (Main.getGoodWorld) num158 *= 0.8f; + num158 = (float)Math.Ceiling(num158); - if (Main.netMode != NetmodeID.MultiplayerClient && calamityGlobalNPC.newAI[1] >= num158) + if (Main.netMode != NetmodeID.MultiplayerClient && calamityGlobalNPC.newAI[1] % num158 == 0f && calamityGlobalNPC.newAI[1] > 45f) { - calamityGlobalNPC.newAI[1] = 0f; Vector2 vector18 = npc.Center; float num159 = Main.player[npc.target].position.X + (Main.player[npc.target].width / 2) - vector18.X; float num160 = Main.player[npc.target].position.Y + (Main.player[npc.target].height / 2) - vector18.Y; @@ -292,8 +292,8 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (Collision.CanHit(vector18, 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) { float num162 = phase2 ? (5f + (death ? 3f * (1f - lifeRatio) : 0f)) : 4f; - float num163 = Main.player[npc.target].position.X + Main.player[npc.target].width * 0.5f - vector18.X + Main.rand.Next(-20, 21); - float num164 = Main.player[npc.target].position.Y + Main.player[npc.target].height * 0.5f - vector18.Y + Main.rand.Next(-20, 21); + float num163 = Main.player[npc.target].position.X + Main.player[npc.target].width * 0.5f - vector18.X; + float num164 = Main.player[npc.target].position.Y + Main.player[npc.target].height * 0.5f - vector18.Y; float num165 = (float)Math.Sqrt(num163 * num163 + num164 * num164); num165 = num162 / num165; num163 *= num165; From 127d3c5c32bc28bf66ca4285be720b2098d980d8 Mon Sep 17 00:00:00 2001 From: Mishiro Usui Date: Thu, 14 Sep 2023 14:37:51 +0100 Subject: [PATCH 2/8] bandaid fix for town pet npcs --- NPCs/CalamityGlobalTownNPC.cs | 41 +++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/NPCs/CalamityGlobalTownNPC.cs b/NPCs/CalamityGlobalTownNPC.cs index 94969bc081..582042accb 100644 --- a/NPCs/CalamityGlobalTownNPC.cs +++ b/NPCs/CalamityGlobalTownNPC.cs @@ -24,7 +24,6 @@ using Terraria.GameContent; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; -using CalamityMod.Items.Placeables.Walls; using static Terraria.ModLoader.ModContent; namespace CalamityMod.NPCs @@ -324,18 +323,22 @@ namespace CalamityMod.NPCs // Annoyingly, because npc.GivenName is a property, it can't be passed as a ref parameter. private string ChooseName(ref bool alreadySet, string currentName, int numVanillaNames, string[] patreonNames, string[] globalNames) { - if (alreadySet || patreonNames is null || patreonNames.Length == 0) + if (alreadySet) { alreadySet = true; return currentName; } alreadySet = true; - int index = Main.rand.Next(numVanillaNames + patreonNames.Length + globalNames.Length); - + // PatreonNames can be null, so can global names, it short circuits in the next step if so + int combinedLength = (patreonNames?.Length ?? 0) + (globalNames?.Length ?? 0); + int index = Main.rand.Next(numVanillaNames + combinedLength); + // If the roll isn't low enough, then a "vanilla name" was picked, meaning we change nothing. - if (index >= patreonNames.Length + globalNames.Length) + if (index >= combinedLength) return currentName; + + // Change the name to be a randomly selected Patreon name if the roll is low enough. if (index >= globalNames.Length) return patreonNames[index - globalNames.Length]; @@ -378,22 +381,22 @@ namespace CalamityMod.NPCs switch (npc.townNpcVariationIndex) { case 0: - npc.GivenName = ChooseName(ref CalamityWorld.catName, npc.GivenName, TownDogLabradorVanillaNames, TownDogLabradorNames, TownDogNames); + npc.GivenName = ChooseName(ref CalamityWorld.dogName, npc.GivenName, TownDogLabradorVanillaNames, TownDogLabradorNames, TownDogNames); break; case 1: - npc.GivenName = ChooseName(ref CalamityWorld.catName, npc.GivenName, TownDogPitBullVanillaNames, TownDogPitBullNames, TownDogNames); + npc.GivenName = ChooseName(ref CalamityWorld.dogName, npc.GivenName, TownDogPitBullVanillaNames, TownDogPitBullNames, TownDogNames); break; case 2: - npc.GivenName = ChooseName(ref CalamityWorld.catName, npc.GivenName, TownDogBeagleVanillaNames, TownDogBeagleNames, TownDogNames); + npc.GivenName = ChooseName(ref CalamityWorld.dogName, npc.GivenName, TownDogBeagleVanillaNames, TownDogBeagleNames, TownDogNames); break; case 3: - npc.GivenName = ChooseName(ref CalamityWorld.catName, npc.GivenName, TownDogCorgiVanillaNames, TownDogCorgiNames, TownDogNames); + npc.GivenName = ChooseName(ref CalamityWorld.dogName, npc.GivenName, TownDogCorgiVanillaNames, TownDogCorgiNames, TownDogNames); break; case 4: - npc.GivenName = ChooseName(ref CalamityWorld.catName, npc.GivenName, TownDogDalmatianVanillaNames, TownDogDalmatianNames, TownDogNames); + npc.GivenName = ChooseName(ref CalamityWorld.dogName, npc.GivenName, TownDogDalmatianVanillaNames, TownDogDalmatianNames, TownDogNames); break; case 5: - npc.GivenName = ChooseName(ref CalamityWorld.catName, npc.GivenName, TownDogHuskyVanillaNames, TownDogHuskyNames, TownDogNames); + npc.GivenName = ChooseName(ref CalamityWorld.dogName, npc.GivenName, TownDogHuskyVanillaNames, TownDogHuskyNames, TownDogNames); break; default: break; @@ -403,22 +406,22 @@ namespace CalamityMod.NPCs switch (npc.townNpcVariationIndex) { case 0: - npc.GivenName = ChooseName(ref CalamityWorld.catName, npc.GivenName, TownBunnyWhiteVanillaNames, TownBunnyWhiteNames, TownBunnyNames); + npc.GivenName = ChooseName(ref CalamityWorld.bunnyName, npc.GivenName, TownBunnyWhiteVanillaNames, TownBunnyWhiteNames, TownBunnyNames); break; case 1: - npc.GivenName = ChooseName(ref CalamityWorld.catName, npc.GivenName, TownBunnyAngoraVanillaNames, TownBunnyAngoraNames, TownBunnyNames); + npc.GivenName = ChooseName(ref CalamityWorld.bunnyName, npc.GivenName, TownBunnyAngoraVanillaNames, TownBunnyAngoraNames, TownBunnyNames); break; case 2: - npc.GivenName = ChooseName(ref CalamityWorld.catName, npc.GivenName, TownBunnyDutchVanillaNames, TownBunnyDutchNames, TownBunnyNames); + npc.GivenName = ChooseName(ref CalamityWorld.bunnyName, npc.GivenName, TownBunnyDutchVanillaNames, TownBunnyDutchNames, TownBunnyNames); break; case 3: - npc.GivenName = ChooseName(ref CalamityWorld.catName, npc.GivenName, TownBunnyFlemishVanillaNames, TownBunnyFlemishNames, TownBunnyNames); + npc.GivenName = ChooseName(ref CalamityWorld.bunnyName, npc.GivenName, TownBunnyFlemishVanillaNames, TownBunnyFlemishNames, TownBunnyNames); break; case 4: - npc.GivenName = ChooseName(ref CalamityWorld.catName, npc.GivenName, TownBunnyLopVanillaNames, TownBunnyLopNames, TownBunnyNames); + npc.GivenName = ChooseName(ref CalamityWorld.bunnyName, npc.GivenName, TownBunnyLopVanillaNames, TownBunnyLopNames, TownBunnyNames); break; case 5: - npc.GivenName = ChooseName(ref CalamityWorld.catName, npc.GivenName, TownBunnySilverVanillaNames, TownBunnySilverNames, TownBunnyNames); + npc.GivenName = ChooseName(ref CalamityWorld.bunnyName, npc.GivenName, TownBunnySilverVanillaNames, TownBunnySilverNames, TownBunnyNames); break; default: break; @@ -530,7 +533,7 @@ namespace CalamityMod.NPCs break; // This function doesn't work with Town Pets currently - /*case NPCID.TownCat: + case NPCID.TownCat: AddNewNames(nameList, TownCatNames); switch (npc.townNpcVariationIndex) { @@ -607,7 +610,7 @@ namespace CalamityMod.NPCs default: break; } - break;*/ + break; default: break; From 31f20a5191ffe0dd2fbf5c9dc5820f6e197a4136 Mon Sep 17 00:00:00 2001 From: HaguriHat <141063931+HaguriHat@users.noreply.github.com> Date: Thu, 14 Sep 2023 23:26:59 -0300 Subject: [PATCH 3/8] Rewrote a few Minion Buffs --- Localization/en-US/Mods.CalamityMod.Buffs.hjson | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Localization/en-US/Mods.CalamityMod.Buffs.hjson b/Localization/en-US/Mods.CalamityMod.Buffs.hjson index c6c7386e63..9fc7656c46 100644 --- a/Localization/en-US/Mods.CalamityMod.Buffs.hjson +++ b/Localization/en-US/Mods.CalamityMod.Buffs.hjson @@ -988,12 +988,12 @@ WitherDebuff: { AbandonedSlimeBuff: { DisplayName: Astral Jelly - Description: The mini astrageldon slime will protect you + Description: Back from the heavens just to protect you! } AncientMineralSharkBuff: { DisplayName: Ancient Mineral Shark - Description: Ancient yet so dangerous + Description: So ancient yet just as powerful } AquaticStar: { @@ -1499,4 +1499,4 @@ AbsorberRegen: { AbsorberAffliction: { DisplayName: Absorber Affliction Description: Damn nature, you scary! -} \ No newline at end of file +} From ccad6e2fe243f9cc0c4be9639803f526bdfdfbcc Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Fri, 15 Sep 2023 11:05:37 -0400 Subject: [PATCH 4/8] Nerfed Sponge DR from 30% to 10% --- Items/Accessories/TheSponge.cs | 4 ++-- Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Items/Accessories/TheSponge.cs b/Items/Accessories/TheSponge.cs index 99a96e5c64..d6d5e03a1f 100644 --- a/Items/Accessories/TheSponge.cs +++ b/Items/Accessories/TheSponge.cs @@ -33,9 +33,9 @@ namespace CalamityMod.Items.Accessories public static int ShieldRechargeDelay = CalamityUtils.SecondsToFrames(9); // was 6 public static int TotalShieldRechargeTime = CalamityUtils.SecondsToFrames(6); - // While active, The Sponge gives 30 defense and 30% DR + // While active, The Sponge gives 30 defense and 10% DR public static int ShieldActiveDefense = 30; - public static float ShieldActiveDamageReduction = 0.3f; + public static float ShieldActiveDamageReduction = 0.1f; public override void SetStaticDefaults() diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson index e6a6ec0227..cdb1a54165 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -1821,7 +1821,7 @@ TheSponge: { Tooltip: ''' Projects a quantum foam barrier that absorbs up to 180 damage - The barrier grants 30 defense and reduces damage taken by 30% while active + The barrier grants 30 defense and reduces damage taken by 10% while active The barrier starts recharging 9 seconds after being hit Recharging from zero to full charge takes 6 seconds Being hit again while recharging restarts the charge timer From 36148e6e0be5daab344a0341a816bd0972a2db67 Mon Sep 17 00:00:00 2001 From: Memes <114233643+Mr-Memes@users.noreply.github.com> Date: Fri, 15 Sep 2023 21:39:08 +0200 Subject: [PATCH 5/8] Fixed I-Frame property in BaseMinionProjectile.cs. :warning: NO CHANGELOG :warning: --- Projectiles/BaseProjectiles/BaseMinionProjectile.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Projectiles/BaseProjectiles/BaseMinionProjectile.cs b/Projectiles/BaseProjectiles/BaseMinionProjectile.cs index dbc891df24..18752d5124 100644 --- a/Projectiles/BaseProjectiles/BaseMinionProjectile.cs +++ b/Projectiles/BaseProjectiles/BaseMinionProjectile.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Projectiles.BaseProjectiles /// Multiplied by so changing won't affect this.
/// Defaults to 10. /// - public int IFrames { get; set; } = 10; + public int IFrames { get => Projectile.localNPCHitCooldown / Projectile.MaxUpdates; set => Projectile.localNPCHitCooldown = value * Projectile.MaxUpdates; } /// /// If , makes the minion only be able to detect and attack enemies through tiles only when there are any bosses alive.
@@ -101,7 +101,6 @@ namespace CalamityMod.Projectiles.BaseProjectiles { Projectile.DamageType = DamageClass.Summon; Projectile.minionSlots = MinionSlots; - Projectile.localNPCHitCooldown = IFrames * Projectile.MaxUpdates; Projectile.penetrate = -1; Projectile.friendly = true; From 0882f40e4ce824b7b73386796b3673c576376cbe Mon Sep 17 00:00:00 2001 From: Memes <114233643+Mr-Memes@users.noreply.github.com> Date: Fri, 15 Sep 2023 21:52:10 +0200 Subject: [PATCH 6/8] Multiple Crimson Weapon changes. 1. Deleted Carnage Ray but kept it's sprite in the source code. 2. Deleted Blood Clot Staff. 3. Re-tier'd Flesh of Infidelity to be a Perforator Hive drop. 4. Made Flesh of Infidelity use the BaseMinionProjectile abstract class. Addendum: - I'll balance Flesh of Infidelity later, but I don't know if I should rework it or not. - Kept Carnage Ray's sprite because it's fucking cool and could be repurposed. --- Items/Weapons/Magic/CarnageRay.cs | 50 ---------------- Items/Weapons/Summon/BloodClotStaff.cs | 57 ------------------ Items/Weapons/Summon/BloodClotStaff.png | Bin 3796 -> 0 bytes Items/Weapons/Summon/FleshOfInfidelity.cs | 43 ++++++-------- NPCs/Perforator/PerforatorHive.cs | 2 +- Projectiles/Summon/FleshBallMinion.cs | 67 +++++++--------------- 6 files changed, 41 insertions(+), 178 deletions(-) delete mode 100644 Items/Weapons/Magic/CarnageRay.cs delete mode 100644 Items/Weapons/Summon/BloodClotStaff.cs delete mode 100644 Items/Weapons/Summon/BloodClotStaff.png diff --git a/Items/Weapons/Magic/CarnageRay.cs b/Items/Weapons/Magic/CarnageRay.cs deleted file mode 100644 index 5715458b8d..0000000000 --- a/Items/Weapons/Magic/CarnageRay.cs +++ /dev/null @@ -1,50 +0,0 @@ -using CalamityMod.Items.Materials; -using CalamityMod.Projectiles.Magic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Weapons.Magic -{ - public class CarnageRay : ModItem, ILocalizedModType - { - public new string LocalizationCategory => "Items.Weapons.Magic"; - public override void SetStaticDefaults() - { - Item.staff[Item.type] = true; - } - - public override void SetDefaults() - { - Item.damage = 24; - Item.DamageType = DamageClass.Magic; - Item.mana = 10; - Item.width = 44; - Item.height = 46; - Item.useTime = 20; - Item.useAnimation = 20; - Item.useStyle = ItemUseStyleID.Shoot; - Item.noMelee = true; - Item.knockBack = 3.25f; - Item.value = CalamityGlobalItem.Rarity4BuyPrice; - Item.rare = ItemRarityID.LightRed; - Item.UseSound = SoundID.Item72; - Item.autoReuse = true; - Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 6f; - } - - public override void AddRecipes() - { - CreateRecipe(). - AddIngredient(ItemID.CrimsonRod). - AddIngredient(ItemID.MagicMissile). - AddIngredient(ItemID.WandofSparking). - AddIngredient(ItemID.AmberStaff). - AddIngredient(10). - AddTile(TileID.DemonAltar). - Register(); - } - } -} diff --git a/Items/Weapons/Summon/BloodClotStaff.cs b/Items/Weapons/Summon/BloodClotStaff.cs deleted file mode 100644 index 0636ef149b..0000000000 --- a/Items/Weapons/Summon/BloodClotStaff.cs +++ /dev/null @@ -1,57 +0,0 @@ -using Terraria.DataStructures; -using CalamityMod.Items.Materials; -using CalamityMod.Projectiles.Summon; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Weapons.Summon -{ - public class BloodClotStaff : ModItem, ILocalizedModType - { - public new string LocalizationCategory => "Items.Weapons.Summon"; - public override void SetDefaults() - { - Item.damage = 9; - Item.mana = 10; - Item.width = 58; - Item.height = 64; - Item.useTime = Item.useAnimation = 30; - Item.useStyle = ItemUseStyleID.Swing; - Item.noMelee = true; - Item.knockBack = 2.25f; - Item.value = CalamityGlobalItem.Rarity3BuyPrice; - Item.rare = ItemRarityID.Orange; - Item.UseSound = SoundID.Item44; - Item.autoReuse = true; - Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; - Item.DamageType = DamageClass.Summon; - } - - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) - { - if (player.altFunctionUse != 2) - { - position = Main.MouseWorld; - velocity.X = 0; - velocity.Y = 0; - int p = Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; - } - return false; - } - - public override void AddRecipes() - { - CreateRecipe(). - AddIngredient(ItemID.CrimtaneBar, 4). - AddIngredient(12). - AddIngredient(ItemID.Vertebrae, 4). - AddTile(TileID.DemonAltar). - Register(); - } - } -} diff --git a/Items/Weapons/Summon/BloodClotStaff.png b/Items/Weapons/Summon/BloodClotStaff.png deleted file mode 100644 index 8951c39fb4996feba820d2fa20fafb3a794ba98f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3796 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 "Items.Weapons.Summon"; + public override void SetDefaults() { Item.damage = 27; - Item.mana = 10; - Item.width = Item.height = 48; - Item.useTime = Item.useAnimation = 30; - Item.useStyle = ItemUseStyleID.Swing; - Item.noMelee = true; + Item.DamageType = DamageClass.Summon; + Item.shoot = ModContent.ProjectileType(); Item.knockBack = 1f; + + Item.useTime = Item.useAnimation = 10; + Item.mana = 10; + Item.width = 42; + Item.height = 42; + Item.noMelee = true; + Item.autoReuse = true; Item.value = CalamityGlobalItem.Rarity3BuyPrice; Item.rare = ItemRarityID.Orange; + Item.useStyle = ItemUseStyleID.Swing; Item.UseSound = SoundID.Zombie24; - Item.autoReuse = true; - Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; - Item.DamageType = DamageClass.Summon; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) - { - int p = Projectile.NewProjectile(source, Main.MouseWorld, Vector2.UnitY * -1f, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; - } + Projectile.NewProjectile(source, Main.MouseWorld, Vector2.UnitY * -1f, type, damage, knockback, player.whoAmI); return false; } public override void AddRecipes() { CreateRecipe(). - AddIngredient(). - AddIngredient(). - AddIngredient(). - AddIngredient(ItemID.ImpStaff). - AddIngredient(10). + AddIngredient(ItemID.CrimtaneBar, 4). + AddIngredient(12). + AddIngredient(ItemID.Vertebrae, 4). AddTile(TileID.DemonAltar). Register(); } diff --git a/NPCs/Perforator/PerforatorHive.cs b/NPCs/Perforator/PerforatorHive.cs index 33c7751f91..3ffbb331b2 100644 --- a/NPCs/Perforator/PerforatorHive.cs +++ b/NPCs/Perforator/PerforatorHive.cs @@ -549,7 +549,7 @@ namespace CalamityMod.NPCs.Perforator ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType(), + ModContent.ItemType(), new WeightedItemStack(ModContent.ItemType(), 1f, 30, 50), })); diff --git a/Projectiles/Summon/FleshBallMinion.cs b/Projectiles/Summon/FleshBallMinion.cs index bcef28f3bf..8997f26b4d 100644 --- a/Projectiles/Summon/FleshBallMinion.cs +++ b/Projectiles/Summon/FleshBallMinion.cs @@ -1,52 +1,43 @@ -using CalamityMod.Buffs.Summon; -using CalamityMod.CalPlayer; +using System; +using CalamityMod.Buffs.Summon; +using CalamityMod.Projectiles.BaseProjectiles; using Microsoft.Xna.Framework; -using System; using Terraria; +using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon { - public class FleshBallMinion : ModProjectile, ILocalizedModType + public class FleshBallMinion : BaseMinionProjectile { - public new string LocalizationCategory => "Projectiles.Summon"; - public Player Owner => Main.player[Projectile.owner]; - public NPC Target => Owner.Center.MinionHoming(950f, Owner, CalamityPlayer.areThereAnyDamnBosses); - public bool SittingOnGround => Math.Abs(Projectile.velocity.X) < 1.55f && Projectile.velocity.Y == 0f; + public override int AssociatedProjectileTypeID => ModContent.ProjectileType(); + public override int AssociatedBuffTypeID => ModContent.BuffType(); + public override ref bool AssociatedMinionBool => ref ModdedOwner.fleshBall; + public override bool PreHardmodeMinionTileVision => true; + public ref float HopTimer => ref Projectile.ai[0]; public ref float HopAmount => ref Projectile.ai[1]; + public bool SittingOnGround => Math.Abs(Projectile.velocity.X) < 1.55f && Projectile.velocity.Y == 0f; public const float Gravity = 0.25f; public const float MaxFallSpeed = 12f; + public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 6; - ProjectileID.Sets.MinionSacrificable[Projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true; + base.SetStaticDefaults(); + Main.projFrames[Type] = 6; } public override void SetDefaults() { + base.SetDefaults(); Projectile.width = 46; Projectile.height = 38; - Projectile.netImportant = true; - Projectile.friendly = true; - Projectile.ignoreWater = true; - Projectile.minionSlots = 1f; - Projectile.timeLeft = 90000; - Projectile.penetrate = -1; Projectile.extraUpdates = 1; - Projectile.tileCollide = false; - Projectile.minion = true; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 60; - Projectile.DamageType = DamageClass.Summon; } - public override void AI() + public override void MinionAI() { - ProvidePlayerMinionBuffs(); - DetermineFrames(); GenerateVisuals(); HopTimer++; @@ -58,27 +49,7 @@ namespace CalamityMod.Projectiles.Summon EnforceGravity(); } - internal void ProvidePlayerMinionBuffs() - { - Owner.AddBuff(ModContent.BuffType(), 3600); - - // Verify player/minion state integrity. The minion cannot stay alive if the - // owner is dead or if the caller of the AI is invalid. - if (Projectile.type != ModContent.ProjectileType()) - return; - - if (Owner.dead) - Owner.Calamity().fleshBall = false; - if (Owner.Calamity().fleshBall) - Projectile.timeLeft = 2; - } - - internal void DetermineFrames() - { - Projectile.frameCounter++; - if (Projectile.frameCounter % 5 == 6) - Projectile.frame = (Projectile.frame + 1) % Main.projFrames[Projectile.type]; - } + #region AI Methods internal void EnforceGravity() { @@ -152,6 +123,10 @@ namespace CalamityMod.Projectiles.Summon } } + #endregion + + public override void OnSpawn(IEntitySource source) => IFrames = 30; + // Prevent immediate death on tile collision, and slow down on tile collision. public override bool OnTileCollide(Vector2 oldVelocity) { From 1db33b91c27db0db11b0058b7778d60fd02f24ff Mon Sep 17 00:00:00 2001 From: Memes <114233643+Mr-Memes@users.noreply.github.com> Date: Fri, 15 Sep 2023 22:01:45 +0200 Subject: [PATCH 7/8] Fixed latest commit's compile errors. --- Items/TreasureBags/PerforatorBag.cs | 2 +- Items/Weapons/Magic/TerraRay.cs | 6 ------ ModSupport/WeakReferenceSupport.cs | 1 - 3 files changed, 1 insertion(+), 8 deletions(-) diff --git a/Items/TreasureBags/PerforatorBag.cs b/Items/TreasureBags/PerforatorBag.cs index d7441cbec8..e227cb4e02 100644 --- a/Items/TreasureBags/PerforatorBag.cs +++ b/Items/TreasureBags/PerforatorBag.cs @@ -74,7 +74,7 @@ namespace CalamityMod.Items.TreasureBags ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType(), + ModContent.ItemType(), new WeightedItemStack(ModContent.ItemType(), 1f, 50, 75), })); diff --git a/Items/Weapons/Magic/TerraRay.cs b/Items/Weapons/Magic/TerraRay.cs index 3101d05973..0250a56571 100644 --- a/Items/Weapons/Magic/TerraRay.cs +++ b/Items/Weapons/Magic/TerraRay.cs @@ -52,12 +52,6 @@ namespace CalamityMod.Items.Weapons.Magic AddIngredient(12). AddTile(TileID.MythrilAnvil). Register(); - CreateRecipe(). - AddIngredient(). - AddIngredient(). - AddIngredient(12). - AddTile(TileID.MythrilAnvil). - Register(); } } } diff --git a/ModSupport/WeakReferenceSupport.cs b/ModSupport/WeakReferenceSupport.cs index 698a5be58f..9f327f595c 100644 --- a/ModSupport/WeakReferenceSupport.cs +++ b/ModSupport/WeakReferenceSupport.cs @@ -1086,7 +1086,6 @@ namespace CalamityMod RegisterSummon(ItemType(), BuffType(), ProjectileType()); RegisterSummon(ItemType(), BuffType(), ProjectileType()); RegisterSummon(ItemType(), BuffType(), ProjectileType()); - RegisterSummon(ItemType(), BuffType(), ProjectileType()); RegisterSummon(ItemType(), BuffType(), ProjectileType()); RegisterSummon(ItemType(), BuffType(), ProjectileType()); RegisterSummon(ItemType(), BuffType(), ProjectileType()); From 6647bcdb5ef73007013e8fc8d19e6a8dc08c76d4 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Fri, 15 Sep 2023 17:09:01 -0400 Subject: [PATCH 8/8] Sandgun nerf :trollage: Let's be real, it's prolly still really good, just not WoF viable --- Items/CalamityGlobalItemTweaks.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/CalamityGlobalItemTweaks.cs b/Items/CalamityGlobalItemTweaks.cs index 86967f443a..847c08c62b 100644 --- a/Items/CalamityGlobalItemTweaks.cs +++ b/Items/CalamityGlobalItemTweaks.cs @@ -189,6 +189,7 @@ namespace CalamityMod.Items { ItemID.RedRyder, Do(PointBlank, DamageExact(24)) }, { ItemID.RocketIII, Do(DamageRatio(0.75f)) }, { ItemID.RocketIV, Do(DamageRatio(0.75f)) }, + { ItemID.Sandgun, Do(PointBlank, DamageExact(22), UseExact(20)) }, { ItemID.SapphireStaff, Do(DamageExact(25)) }, { ItemID.Seedler, Do(UseMeleeSpeed, DamageRatio(1.5f)) }, { ItemID.ShadowbeamStaff, Do(DamageExact(100)) }, @@ -431,7 +432,6 @@ namespace CalamityMod.Items { ItemID.QuadBarrelShotgun, pointBlank }, { ItemID.Revolver, Do(PointBlank, AutoReuse) }, { ItemID.RichMahoganyBow, pointBlank }, - { ItemID.Sandgun, pointBlank }, { ItemID.SDMG, pointBlank }, { ItemID.ShadewoodBow, pointBlank }, { ItemID.SilverBow, pointBlank },