From 49eaa015c9d35a9fd8955798cdffc3d5ce2a6068 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Sat, 19 Dec 2020 14:48:31 -0500 Subject: [PATCH] cleanliness and forgot summon right click code --- Items/Weapons/Summon/TacticalPlagueEngine.cs | 9 +++++++++ Projectiles/Ranged/BloodfireBulletProj.cs | 3 +-- Projectiles/Summon/TacticalPlagueJet.cs | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Items/Weapons/Summon/TacticalPlagueEngine.cs b/Items/Weapons/Summon/TacticalPlagueEngine.cs index d31b0ab22d..77ab16720a 100644 --- a/Items/Weapons/Summon/TacticalPlagueEngine.cs +++ b/Items/Weapons/Summon/TacticalPlagueEngine.cs @@ -1,5 +1,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; +using Microsoft.Xna.Framework; +using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -34,6 +36,13 @@ namespace CalamityMod.Items.Weapons.Summon item.shootSpeed = 16f; } + 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) + 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); diff --git a/Projectiles/Ranged/BloodfireBulletProj.cs b/Projectiles/Ranged/BloodfireBulletProj.cs index e21273f0a6..96aa569f8a 100644 --- a/Projectiles/Ranged/BloodfireBulletProj.cs +++ b/Projectiles/Ranged/BloodfireBulletProj.cs @@ -74,8 +74,7 @@ namespace CalamityMod.Projectiles.Ranged // For the sake of bonus damage, life regen time caps at 3600, aka 60 seconds. This is its natural cap in vanilla. int regenTimeForCalc = (int)MathHelper.Clamp(owner.lifeRegenTime, 0f, 3600f); - int bloodFireBonus = (int)(regenDamageRatio * regenTimeForCalc); - return bloodFireBonus; + return (int)(regenDamageRatio * regenTimeForCalc); } public override void Kill(int timeLeft) diff --git a/Projectiles/Summon/TacticalPlagueJet.cs b/Projectiles/Summon/TacticalPlagueJet.cs index 7b0dc7c41c..2ee531c320 100644 --- a/Projectiles/Summon/TacticalPlagueJet.cs +++ b/Projectiles/Summon/TacticalPlagueJet.cs @@ -177,7 +177,7 @@ namespace CalamityMod.Projectiles.Summon bool dontConsumeAmmo = Main.rand.NextBool() || shootRocket; int projIndex; - // This function uses the fake gun item (changed to be ranged) with the appropriate base damage as the "firing item". + // Vanilla function tricked into using a fake gun item with the appropriate base damage as the "firing item". player.PickAmmo(FalseGun, ref projID, ref shootSpeed, ref canShoot, ref damage, ref kb, dontConsumeAmmo); // One in every 20 shots is a rocket which deals 1.5x total damage and extreme knockback.