rocket storage fix
type detection is now item-based instead of projectile-based allows a stack of 1 to have proper effects prevents prismatic armor rockets from taking in-inventory rocket effects
This commit is contained in:
1 parent
a30041ec97
commit
7db77034f9
13 files changed
+240
-446
No files matched your search
@@ -33,9 +33,13 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
|
||||
public override Vector2? HoldoutOffset() => new Vector2(-10, 0);
|
||||
|
||||
// Figure out which rocket is used
|
||||
public int RocketType;
|
||||
public override void OnConsumeAmmo(Item ammo, Player player) => RocketType = ammo.type;
|
||||
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, ModContent.ProjectileType<Nuke>(), damage, knockback, player.whoAmI);
|
||||
Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType<Nuke>(), damage, knockback, player.whoAmI, RocketType);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
public new string LocalizationCategory => "Items.Weapons.Ranged";
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true;
|
||||
ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
@@ -29,7 +29,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
Item.knockBack = 6.5f;
|
||||
Item.value = CalamityGlobalItem.Rarity10BuyPrice;
|
||||
Item.rare = ItemRarityID.Red;
|
||||
Item.UseSound = null;
|
||||
Item.UseSound = SoundID.Item11;
|
||||
Item.autoReuse = true;
|
||||
Item.shootSpeed = 20f;
|
||||
Item.shoot = ModContent.ProjectileType<MiniRocket>();
|
||||
@@ -38,35 +38,22 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
|
||||
public override Vector2? HoldoutOffset() => new Vector2(-20, 10);
|
||||
|
||||
public override bool AltFunctionUse(Player player)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
public override bool AltFunctionUse(Player player) => true;
|
||||
|
||||
public override bool CanUseItem(Player player)
|
||||
{
|
||||
return base.CanUseItem(player);
|
||||
}
|
||||
public override float UseSpeedMultiplier(Player player) => player.altFunctionUse == 2 ? 0.3333f : 1f;
|
||||
|
||||
public override float UseSpeedMultiplier(Player player)
|
||||
{
|
||||
if (player.altFunctionUse == 2)
|
||||
return 1 / 3f;
|
||||
return 1f;
|
||||
}
|
||||
// Figure out which rocket is used
|
||||
public int RocketType;
|
||||
public override void OnConsumeAmmo(Item ammo, Player player) => RocketType = ammo.type;
|
||||
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.altFunctionUse == 2)
|
||||
{
|
||||
Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, ModContent.ProjectileType<BigNuke>(), (int)(damage * 1.85), knockback * 2f, player.whoAmI);
|
||||
return false;
|
||||
}
|
||||
Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType<BigNuke>(), (int)(damage * 1.85), knockback * 2f, player.whoAmI, RocketType);
|
||||
else
|
||||
{
|
||||
Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, ModContent.ProjectileType<MiniRocket>(), damage, knockback, player.whoAmI);
|
||||
return false;
|
||||
}
|
||||
Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType<MiniRocket>(), damage, knockback, player.whoAmI, RocketType);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
|
||||
@@ -32,6 +32,10 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
|
||||
public override Vector2? HoldoutOffset() => new Vector2(-10, 0);
|
||||
|
||||
// Figure out which rocket is used
|
||||
public int RocketType;
|
||||
public override void OnConsumeAmmo(Item ammo, Player player) => RocketType = ammo.type;
|
||||
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
int rocket = Utils.SelectRandom(Main.rand, new int[]
|
||||
@@ -41,7 +45,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
ModContent.ProjectileType<HiveBomb>(),
|
||||
ModContent.ProjectileType<BeeRPG>()
|
||||
});
|
||||
Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, rocket, damage, knockback, player.whoAmI, 0f, 0f);
|
||||
Projectile.NewProjectile(source, position, velocity, rocket, damage, knockback, player.whoAmI, RocketType);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
public class BeeRPG : ModProjectile, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Projectiles.Ranged";
|
||||
public static Item FalseLauncher = null;
|
||||
private ref float RocketType => ref Projectile.ai[0];
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
@@ -24,13 +24,6 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
Projectile.DamageType = DamageClass.Ranged;
|
||||
}
|
||||
|
||||
private static void DefineFalseLauncher()
|
||||
{
|
||||
int rocketID = ItemID.RocketLauncher;
|
||||
FalseLauncher = new Item();
|
||||
FalseLauncher.SetDefaults(rocketID, true);
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
if (Math.Abs(Projectile.velocity.X) >= 8f || Math.Abs(Projectile.velocity.Y) >= 8f)
|
||||
@@ -72,16 +65,7 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
}
|
||||
Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.ToRadians(90);
|
||||
|
||||
// Construct a fake item to use with vanilla code for the sake of picking ammo.
|
||||
if (FalseLauncher is null)
|
||||
DefineFalseLauncher();
|
||||
Player player = Main.player[Projectile.owner];
|
||||
int projID = ProjectileID.RocketI;
|
||||
float shootSpeed = 0f;
|
||||
int damage = 0;
|
||||
float kb = 0f;
|
||||
player.PickAmmo(FalseLauncher, out projID, out shootSpeed, out damage, out kb, out _, true);
|
||||
if (projID == ProjectileID.DryRocket || projID == ProjectileID.WetRocket || projID == ProjectileID.LavaRocket || projID == ProjectileID.HoneyRocket)
|
||||
if (RocketType == ItemID.DryRocket || RocketType == ItemID.WetRocket || RocketType == ItemID.LavaRocket || RocketType == ItemID.HoneyRocket)
|
||||
{
|
||||
if (Projectile.wet)
|
||||
Projectile.timeLeft = 1;
|
||||
@@ -192,51 +176,42 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
}
|
||||
}
|
||||
|
||||
// Construct a fake item to use with vanilla code for the sake of picking ammo.
|
||||
if (FalseLauncher is null)
|
||||
DefineFalseLauncher();
|
||||
Player player = Main.player[Projectile.owner];
|
||||
int projID = ProjectileID.RocketI;
|
||||
float shootSpeed = 0f;
|
||||
int damage = 0;
|
||||
float kb = 0f;
|
||||
player.PickAmmo(FalseLauncher, out projID, out shootSpeed, out damage, out kb, out _, true);
|
||||
// Only do rocket effects for the owner client side
|
||||
if (Projectile.owner != Main.myPlayer)
|
||||
return;
|
||||
|
||||
int blastRadius = 0;
|
||||
if (projID == ProjectileID.RocketII || projID == ProjectileID.ClusterRocketII) // Not adding the actual shrapnel tho
|
||||
if (RocketType == ItemID.RocketII)
|
||||
blastRadius = 3;
|
||||
else if (projID == ProjectileID.RocketIV)
|
||||
else if (RocketType == ItemID.RocketIV)
|
||||
blastRadius = 6;
|
||||
else if (projID == ProjectileID.MiniNukeRocketII)
|
||||
else if (RocketType == ItemID.MiniNukeII)
|
||||
blastRadius = 9;
|
||||
|
||||
Projectile.ExpandHitboxBy(14);
|
||||
|
||||
if (Projectile.owner == Main.myPlayer && blastRadius > 0)
|
||||
{
|
||||
CalamityUtils.ExplodeandDestroyTiles(Projectile, blastRadius, true, new List<int>() { }, new List<int>() { });
|
||||
}
|
||||
if (Projectile.owner == Main.myPlayer)
|
||||
if (blastRadius > 0)
|
||||
Projectile.ExplodeandDestroyTiles(blastRadius, true, new List<int>(), new List<int>());
|
||||
|
||||
Point center = Projectile.Center.ToTileCoordinates();
|
||||
DelegateMethods.v2_1 = center.ToVector2();
|
||||
DelegateMethods.f_1 = 3f;
|
||||
if (RocketType == ItemID.DryRocket)
|
||||
{
|
||||
Point center = Projectile.Center.ToTileCoordinates();
|
||||
DelegateMethods.v2_1 = center.ToVector2();
|
||||
DelegateMethods.f_1 = 3f;
|
||||
if (projID == ProjectileID.DryRocket)
|
||||
{
|
||||
DelegateMethods.f_1 = 3.5f;
|
||||
Utils.PlotTileArea(center.X, center.Y, DelegateMethods.SpreadDry);
|
||||
}
|
||||
else if (projID == ProjectileID.WetRocket)
|
||||
{
|
||||
Utils.PlotTileArea(center.X, center.Y, DelegateMethods.SpreadWater);
|
||||
}
|
||||
else if (projID == ProjectileID.LavaRocket)
|
||||
{
|
||||
Utils.PlotTileArea(center.X, center.Y, DelegateMethods.SpreadLava);
|
||||
}
|
||||
else if (projID == ProjectileID.HoneyRocket)
|
||||
{
|
||||
Utils.PlotTileArea(center.X, center.Y, DelegateMethods.SpreadHoney);
|
||||
}
|
||||
DelegateMethods.f_1 = 3.5f;
|
||||
Utils.PlotTileArea(center.X, center.Y, DelegateMethods.SpreadDry);
|
||||
}
|
||||
else if (RocketType == ItemID.WetRocket)
|
||||
{
|
||||
Utils.PlotTileArea(center.X, center.Y, DelegateMethods.SpreadWater);
|
||||
}
|
||||
else if (RocketType == ItemID.LavaRocket)
|
||||
{
|
||||
Utils.PlotTileArea(center.X, center.Y, DelegateMethods.SpreadLava);
|
||||
}
|
||||
else if (RocketType == ItemID.HoneyRocket)
|
||||
{
|
||||
Utils.PlotTileArea(center.X, center.Y, DelegateMethods.SpreadHoney);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
public class BigNuke : ModProjectile, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Projectiles.Ranged";
|
||||
public static Item FalseLauncher = null;
|
||||
private ref float RocketType => ref Projectile.ai[0];
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
@@ -26,23 +26,10 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
Projectile.DamageType = DamageClass.Ranged;
|
||||
}
|
||||
|
||||
private static void DefineFalseLauncher()
|
||||
{
|
||||
int rocketID = ItemID.RocketLauncher;
|
||||
FalseLauncher = new Item();
|
||||
FalseLauncher.SetDefaults(rocketID, true);
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.ToRadians(90);
|
||||
|
||||
if (Projectile.ai[0] == 0f)
|
||||
{
|
||||
SoundEngine.PlaySound(SoundID.Item11, Projectile.Center);
|
||||
Projectile.ai[0] = 1f;
|
||||
}
|
||||
|
||||
//Animation
|
||||
Projectile.frameCounter++;
|
||||
if (Projectile.frameCounter > 7)
|
||||
@@ -77,16 +64,7 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
}
|
||||
CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 200f, 12f, 20f);
|
||||
|
||||
// Construct a fake item to use with vanilla code for the sake of picking ammo.
|
||||
if (FalseLauncher is null)
|
||||
DefineFalseLauncher();
|
||||
Player player = Main.player[Projectile.owner];
|
||||
int projID = ProjectileID.RocketI;
|
||||
float shootSpeed = 0f;
|
||||
int damage = 0;
|
||||
float kb = 0f;
|
||||
player.PickAmmo(FalseLauncher, out projID, out shootSpeed, out damage, out kb, out _, true);
|
||||
if (projID == ProjectileID.DryRocket || projID == ProjectileID.WetRocket || projID == ProjectileID.LavaRocket || projID == ProjectileID.HoneyRocket)
|
||||
if (RocketType == ItemID.DryRocket || RocketType == ItemID.WetRocket || RocketType == ItemID.LavaRocket || RocketType == ItemID.HoneyRocket)
|
||||
{
|
||||
if (Projectile.wet)
|
||||
Projectile.timeLeft = 1;
|
||||
@@ -172,44 +150,41 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
}
|
||||
}
|
||||
|
||||
// Construct a fake item to use with vanilla code for the sake of picking ammo.
|
||||
if (FalseLauncher is null)
|
||||
DefineFalseLauncher();
|
||||
Player player = Main.player[Projectile.owner];
|
||||
int projID = ProjectileID.RocketI;
|
||||
float shootSpeed = 0f;
|
||||
int damage = 0;
|
||||
float kb = 0f;
|
||||
player.PickAmmo(FalseLauncher, out projID, out shootSpeed, out damage, out kb, out _, true);
|
||||
// Only do rocket effects for the owner client side
|
||||
if (Projectile.owner != Main.myPlayer)
|
||||
return;
|
||||
|
||||
int blastRadius = 0;
|
||||
if (RocketType == ItemID.RocketII)
|
||||
blastRadius = 17;
|
||||
else if (RocketType == ItemID.RocketIV)
|
||||
blastRadius = 20;
|
||||
else if (RocketType == ItemID.MiniNukeII)
|
||||
blastRadius = 23;
|
||||
Projectile.ExpandHitboxBy(16);
|
||||
|
||||
if (Projectile.owner == Main.myPlayer && (projID == ProjectileID.RocketII || projID == ProjectileID.RocketIV || projID == ProjectileID.MiniNukeRocketII || projID == ProjectileID.ClusterRocketII))
|
||||
{
|
||||
CalamityUtils.ExplodeandDestroyTiles(Projectile, 23, true, new List<int>() { }, new List<int>() { });
|
||||
}
|
||||
if (Projectile.owner == Main.myPlayer)
|
||||
if (blastRadius > 0)
|
||||
Projectile.ExplodeandDestroyTiles(blastRadius, true, new List<int>(), new List<int>());
|
||||
|
||||
Point center = Projectile.Center.ToTileCoordinates();
|
||||
DelegateMethods.v2_1 = center.ToVector2();
|
||||
DelegateMethods.f_1 = 5f;
|
||||
if (RocketType == ItemID.DryRocket)
|
||||
{
|
||||
Point center = Projectile.Center.ToTileCoordinates();
|
||||
DelegateMethods.v2_1 = center.ToVector2();
|
||||
DelegateMethods.f_1 = 5f;
|
||||
if (projID == ProjectileID.DryRocket)
|
||||
{
|
||||
DelegateMethods.f_1 = 5.5f;
|
||||
Utils.PlotTileArea(center.X, center.Y, DelegateMethods.SpreadDry);
|
||||
}
|
||||
else if (projID == ProjectileID.WetRocket)
|
||||
{
|
||||
Utils.PlotTileArea(center.X, center.Y, DelegateMethods.SpreadWater);
|
||||
}
|
||||
else if (projID == ProjectileID.LavaRocket)
|
||||
{
|
||||
Utils.PlotTileArea(center.X, center.Y, DelegateMethods.SpreadLava);
|
||||
}
|
||||
else if (projID == ProjectileID.HoneyRocket)
|
||||
{
|
||||
Utils.PlotTileArea(center.X, center.Y, DelegateMethods.SpreadHoney);
|
||||
}
|
||||
DelegateMethods.f_1 = 5.5f;
|
||||
Utils.PlotTileArea(center.X, center.Y, DelegateMethods.SpreadDry);
|
||||
}
|
||||
else if (RocketType == ItemID.WetRocket)
|
||||
{
|
||||
Utils.PlotTileArea(center.X, center.Y, DelegateMethods.SpreadWater);
|
||||
}
|
||||
else if (RocketType == ItemID.LavaRocket)
|
||||
{
|
||||
Utils.PlotTileArea(center.X, center.Y, DelegateMethods.SpreadLava);
|
||||
}
|
||||
else if (RocketType == ItemID.HoneyRocket)
|
||||
{
|
||||
Utils.PlotTileArea(center.X, center.Y, DelegateMethods.SpreadHoney);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
public class GoliathRocket : ModProjectile, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Projectiles.Ranged";
|
||||
public static Item FalseLauncher = null;
|
||||
private ref float RocketType => ref Projectile.ai[0];
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
@@ -24,13 +24,6 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
Projectile.DamageType = DamageClass.Ranged;
|
||||
}
|
||||
|
||||
private static void DefineFalseLauncher()
|
||||
{
|
||||
int rocketID = ItemID.RocketLauncher;
|
||||
FalseLauncher = new Item();
|
||||
FalseLauncher.SetDefaults(rocketID, true);
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
if (Math.Abs(Projectile.velocity.X) >= 8f || Math.Abs(Projectile.velocity.Y) >= 8f)
|
||||
@@ -72,16 +65,7 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
}
|
||||
Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.ToRadians(90);
|
||||
|
||||
// Construct a fake item to use with vanilla code for the sake of picking ammo.
|
||||
if (FalseLauncher is null)
|
||||
DefineFalseLauncher();
|
||||
Player player = Main.player[Projectile.owner];
|
||||
int projID = ProjectileID.RocketI;
|
||||
float shootSpeed = 0f;
|
||||
int damage = 0;
|
||||
float kb = 0f;
|
||||
player.PickAmmo(FalseLauncher, out projID, out shootSpeed, out damage, out kb, out _, true);
|
||||
if (projID == ProjectileID.DryRocket || projID == ProjectileID.WetRocket || projID == ProjectileID.LavaRocket || projID == ProjectileID.HoneyRocket)
|
||||
if (RocketType == ItemID.DryRocket || RocketType == ItemID.WetRocket || RocketType == ItemID.LavaRocket || RocketType == ItemID.HoneyRocket)
|
||||
{
|
||||
if (Projectile.wet)
|
||||
Projectile.timeLeft = 1;
|
||||
@@ -192,51 +176,42 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
}
|
||||
}
|
||||
|
||||
// Construct a fake item to use with vanilla code for the sake of picking ammo.
|
||||
if (FalseLauncher is null)
|
||||
DefineFalseLauncher();
|
||||
Player player = Main.player[Projectile.owner];
|
||||
int projID = ProjectileID.RocketI;
|
||||
float shootSpeed = 0f;
|
||||
int damage = 0;
|
||||
float kb = 0f;
|
||||
player.PickAmmo(FalseLauncher, out projID, out shootSpeed, out damage, out kb, out _, true);
|
||||
// Only do rocket effects for the owner client side
|
||||
if (Projectile.owner != Main.myPlayer)
|
||||
return;
|
||||
|
||||
int blastRadius = 0;
|
||||
if (projID == ProjectileID.RocketII || projID == ProjectileID.ClusterRocketII)
|
||||
if (RocketType == ItemID.RocketII)
|
||||
blastRadius = 6;
|
||||
else if (projID == ProjectileID.RocketIV)
|
||||
else if (RocketType == ItemID.RocketIV)
|
||||
blastRadius = 9;
|
||||
else if (projID == ProjectileID.MiniNukeRocketII)
|
||||
else if (RocketType == ItemID.MiniNukeII)
|
||||
blastRadius = 12;
|
||||
|
||||
Projectile.ExpandHitboxBy(14);
|
||||
|
||||
if (Projectile.owner == Main.myPlayer && blastRadius > 0)
|
||||
{
|
||||
CalamityUtils.ExplodeandDestroyTiles(Projectile, blastRadius, true, new List<int>() { }, new List<int>() { });
|
||||
}
|
||||
if (Projectile.owner == Main.myPlayer)
|
||||
if (blastRadius > 0)
|
||||
Projectile.ExplodeandDestroyTiles(blastRadius, true, new List<int>(), new List<int>());
|
||||
|
||||
Point center = Projectile.Center.ToTileCoordinates();
|
||||
DelegateMethods.v2_1 = center.ToVector2();
|
||||
DelegateMethods.f_1 = 3f;
|
||||
if (RocketType == ItemID.DryRocket)
|
||||
{
|
||||
Point center = Projectile.Center.ToTileCoordinates();
|
||||
DelegateMethods.v2_1 = center.ToVector2();
|
||||
DelegateMethods.f_1 = 3f;
|
||||
if (projID == ProjectileID.DryRocket)
|
||||
{
|
||||
DelegateMethods.f_1 = 3.5f;
|
||||
Utils.PlotTileArea(center.X, center.Y, DelegateMethods.SpreadDry);
|
||||
}
|
||||
else if (projID == ProjectileID.WetRocket)
|
||||
{
|
||||
Utils.PlotTileArea(center.X, center.Y, DelegateMethods.SpreadWater);
|
||||
}
|
||||
else if (projID == ProjectileID.LavaRocket)
|
||||
{
|
||||
Utils.PlotTileArea(center.X, center.Y, DelegateMethods.SpreadLava);
|
||||
}
|
||||
else if (projID == ProjectileID.HoneyRocket)
|
||||
{
|
||||
Utils.PlotTileArea(center.X, center.Y, DelegateMethods.SpreadHoney);
|
||||
}
|
||||
DelegateMethods.f_1 = 3.5f;
|
||||
Utils.PlotTileArea(center.X, center.Y, DelegateMethods.SpreadDry);
|
||||
}
|
||||
else if (RocketType == ItemID.WetRocket)
|
||||
{
|
||||
Utils.PlotTileArea(center.X, center.Y, DelegateMethods.SpreadWater);
|
||||
}
|
||||
else if (RocketType == ItemID.LavaRocket)
|
||||
{
|
||||
Utils.PlotTileArea(center.X, center.Y, DelegateMethods.SpreadLava);
|
||||
}
|
||||
else if (RocketType == ItemID.HoneyRocket)
|
||||
{
|
||||
Utils.PlotTileArea(center.X, center.Y, DelegateMethods.SpreadHoney);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
public class HiveBomb : ModProjectile, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Projectiles.Ranged";
|
||||
public static Item FalseLauncher = null;
|
||||
private ref float RocketType => ref Projectile.ai[0];
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
@@ -24,13 +24,6 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
Projectile.DamageType = DamageClass.Ranged;
|
||||
}
|
||||
|
||||
private static void DefineFalseLauncher()
|
||||
{
|
||||
int rocketID = ItemID.RocketLauncher;
|
||||
FalseLauncher = new Item();
|
||||
FalseLauncher.SetDefaults(rocketID, true);
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
if (Math.Abs(Projectile.velocity.X) >= 8f || Math.Abs(Projectile.velocity.Y) >= 8f)
|
||||
@@ -72,16 +65,7 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
}
|
||||
Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.ToRadians(90);
|
||||
|
||||
// Construct a fake item to use with vanilla code for the sake of picking ammo.
|
||||
if (FalseLauncher is null)
|
||||
DefineFalseLauncher();
|
||||
Player player = Main.player[Projectile.owner];
|
||||
int projID = ProjectileID.RocketI;
|
||||
float shootSpeed = 0f;
|
||||
int damage = 0;
|
||||
float kb = 0f;
|
||||
player.PickAmmo(FalseLauncher, out projID, out shootSpeed, out damage, out kb, out _, true);
|
||||
if (projID == ProjectileID.DryRocket || projID == ProjectileID.WetRocket || projID == ProjectileID.LavaRocket || projID == ProjectileID.HoneyRocket)
|
||||
if (RocketType == ItemID.DryRocket || RocketType == ItemID.WetRocket || RocketType == ItemID.LavaRocket || RocketType == ItemID.HoneyRocket)
|
||||
{
|
||||
if (Projectile.wet)
|
||||
Projectile.timeLeft = 1;
|
||||
@@ -192,51 +176,42 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
}
|
||||
}
|
||||
|
||||
// Construct a fake item to use with vanilla code for the sake of picking ammo.
|
||||
if (FalseLauncher is null)
|
||||
DefineFalseLauncher();
|
||||
Player player = Main.player[Projectile.owner];
|
||||
int projID = ProjectileID.RocketI;
|
||||
float shootSpeed = 0f;
|
||||
int damage = 0;
|
||||
float kb = 0f;
|
||||
player.PickAmmo(FalseLauncher, out projID, out shootSpeed, out damage, out kb, out _, true);
|
||||
// Only do rocket effects for the owner client side
|
||||
if (Projectile.owner != Main.myPlayer)
|
||||
return;
|
||||
|
||||
int blastRadius = 0;
|
||||
if (projID == ProjectileID.RocketII || projID == ProjectileID.ClusterRocketII)
|
||||
if (RocketType == ItemID.RocketII)
|
||||
blastRadius = 4;
|
||||
else if (projID == ProjectileID.RocketIV)
|
||||
else if (RocketType == ItemID.RocketIV)
|
||||
blastRadius = 7;
|
||||
else if (projID == ProjectileID.MiniNukeRocketII)
|
||||
else if (RocketType == ItemID.MiniNukeII)
|
||||
blastRadius = 10;
|
||||
|
||||
Projectile.ExpandHitboxBy(14);
|
||||
|
||||
if (Projectile.owner == Main.myPlayer && blastRadius > 0)
|
||||
{
|
||||
CalamityUtils.ExplodeandDestroyTiles(Projectile, blastRadius, true, new List<int>() { }, new List<int>() { });
|
||||
}
|
||||
if (Projectile.owner == Main.myPlayer)
|
||||
if (blastRadius > 0)
|
||||
Projectile.ExplodeandDestroyTiles(blastRadius, true, new List<int>(), new List<int>());
|
||||
|
||||
Point center = Projectile.Center.ToTileCoordinates();
|
||||
DelegateMethods.v2_1 = center.ToVector2();
|
||||
DelegateMethods.f_1 = 3f;
|
||||
if (RocketType == ItemID.DryRocket)
|
||||
{
|
||||
Point center = Projectile.Center.ToTileCoordinates();
|
||||
DelegateMethods.v2_1 = center.ToVector2();
|
||||
DelegateMethods.f_1 = 3f;
|
||||
if (projID == ProjectileID.DryRocket)
|
||||
{
|
||||
DelegateMethods.f_1 = 3.5f;
|
||||
Utils.PlotTileArea(center.X, center.Y, DelegateMethods.SpreadDry);
|
||||
}
|
||||
else if (projID == ProjectileID.WetRocket)
|
||||
{
|
||||
Utils.PlotTileArea(center.X, center.Y, DelegateMethods.SpreadWater);
|
||||
}
|
||||
else if (projID == ProjectileID.LavaRocket)
|
||||
{
|
||||
Utils.PlotTileArea(center.X, center.Y, DelegateMethods.SpreadLava);
|
||||
}
|
||||
else if (projID == ProjectileID.HoneyRocket)
|
||||
{
|
||||
Utils.PlotTileArea(center.X, center.Y, DelegateMethods.SpreadHoney);
|
||||
}
|
||||
DelegateMethods.f_1 = 3.5f;
|
||||
Utils.PlotTileArea(center.X, center.Y, DelegateMethods.SpreadDry);
|
||||
}
|
||||
else if (RocketType == ItemID.WetRocket)
|
||||
{
|
||||
Utils.PlotTileArea(center.X, center.Y, DelegateMethods.SpreadWater);
|
||||
}
|
||||
else if (RocketType == ItemID.LavaRocket)
|
||||
{
|
||||
Utils.PlotTileArea(center.X, center.Y, DelegateMethods.SpreadLava);
|
||||
}
|
||||
else if (RocketType == ItemID.HoneyRocket)
|
||||
{
|
||||
Utils.PlotTileArea(center.X, center.Y, DelegateMethods.SpreadHoney);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
public class HiveMissile : ModProjectile, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Projectiles.Ranged";
|
||||
public static Item FalseLauncher = null;
|
||||
private ref float RocketType => ref Projectile.ai[0];
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
@@ -24,13 +24,6 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
Projectile.DamageType = DamageClass.Ranged;
|
||||
}
|
||||
|
||||
private static void DefineFalseLauncher()
|
||||
{
|
||||
int rocketID = ItemID.RocketLauncher;
|
||||
FalseLauncher = new Item();
|
||||
FalseLauncher.SetDefaults(rocketID, true);
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
if (Math.Abs(Projectile.velocity.X) >= 8f || Math.Abs(Projectile.velocity.Y) >= 8f)
|
||||
@@ -72,16 +65,7 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
}
|
||||
Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.ToRadians(90);
|
||||
|
||||
// Construct a fake item to use with vanilla code for the sake of picking ammo.
|
||||
if (FalseLauncher is null)
|
||||
DefineFalseLauncher();
|
||||
Player player = Main.player[Projectile.owner];
|
||||
int projID = ProjectileID.RocketI;
|
||||
float shootSpeed = 0f;
|
||||
int damage = 0;
|
||||
float kb = 0f;
|
||||
player.PickAmmo(FalseLauncher, out projID, out shootSpeed, out damage, out kb, out _, true);
|
||||
if (projID == ProjectileID.DryRocket || projID == ProjectileID.WetRocket || projID == ProjectileID.LavaRocket || projID == ProjectileID.HoneyRocket)
|
||||
if (RocketType == ItemID.DryRocket || RocketType == ItemID.WetRocket || RocketType == ItemID.LavaRocket || RocketType == ItemID.HoneyRocket)
|
||||
{
|
||||
if (Projectile.wet)
|
||||
Projectile.timeLeft = 1;
|
||||
@@ -192,51 +176,42 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
}
|
||||
}
|
||||
|
||||
// Construct a fake item to use with vanilla code for the sake of picking ammo.
|
||||
if (FalseLauncher is null)
|
||||
DefineFalseLauncher();
|
||||
Player player = Main.player[Projectile.owner];
|
||||
int projID = ProjectileID.RocketI;
|
||||
float shootSpeed = 0f;
|
||||
int damage = 0;
|
||||
float kb = 0f;
|
||||
player.PickAmmo(FalseLauncher, out projID, out shootSpeed, out damage, out kb, out _, true);
|
||||
// Only do rocket effects for the owner client side
|
||||
if (Projectile.owner != Main.myPlayer)
|
||||
return;
|
||||
|
||||
int blastRadius = 0;
|
||||
if (projID == ProjectileID.RocketII || projID == ProjectileID.ClusterRocketII)
|
||||
if (RocketType == ItemID.RocketII)
|
||||
blastRadius = 5;
|
||||
else if (projID == ProjectileID.RocketIV)
|
||||
else if (RocketType == ItemID.RocketIV)
|
||||
blastRadius = 8;
|
||||
else if (projID == ProjectileID.MiniNukeRocketII)
|
||||
else if (RocketType == ItemID.MiniNukeII)
|
||||
blastRadius = 11;
|
||||
|
||||
Projectile.ExpandHitboxBy(14);
|
||||
|
||||
if (Projectile.owner == Main.myPlayer && blastRadius > 0)
|
||||
{
|
||||
CalamityUtils.ExplodeandDestroyTiles(Projectile, blastRadius, true, new List<int>() { }, new List<int>() { });
|
||||
}
|
||||
if (Projectile.owner == Main.myPlayer)
|
||||
if (blastRadius > 0)
|
||||
Projectile.ExplodeandDestroyTiles(blastRadius, true, new List<int>(), new List<int>());
|
||||
|
||||
Point center = Projectile.Center.ToTileCoordinates();
|
||||
DelegateMethods.v2_1 = center.ToVector2();
|
||||
DelegateMethods.f_1 = 3f;
|
||||
if (RocketType == ItemID.DryRocket)
|
||||
{
|
||||
Point center = Projectile.Center.ToTileCoordinates();
|
||||
DelegateMethods.v2_1 = center.ToVector2();
|
||||
DelegateMethods.f_1 = 3f;
|
||||
if (projID == ProjectileID.DryRocket)
|
||||
{
|
||||
DelegateMethods.f_1 = 3.5f;
|
||||
Utils.PlotTileArea(center.X, center.Y, DelegateMethods.SpreadDry);
|
||||
}
|
||||
else if (projID == ProjectileID.WetRocket)
|
||||
{
|
||||
Utils.PlotTileArea(center.X, center.Y, DelegateMethods.SpreadWater);
|
||||
}
|
||||
else if (projID == ProjectileID.LavaRocket)
|
||||
{
|
||||
Utils.PlotTileArea(center.X, center.Y, DelegateMethods.SpreadLava);
|
||||
}
|
||||
else if (projID == ProjectileID.HoneyRocket)
|
||||
{
|
||||
Utils.PlotTileArea(center.X, center.Y, DelegateMethods.SpreadHoney);
|
||||
}
|
||||
DelegateMethods.f_1 = 3.5f;
|
||||
Utils.PlotTileArea(center.X, center.Y, DelegateMethods.SpreadDry);
|
||||
}
|
||||
else if (RocketType == ItemID.WetRocket)
|
||||
{
|
||||
Utils.PlotTileArea(center.X, center.Y, DelegateMethods.SpreadWater);
|
||||
}
|
||||
else if (RocketType == ItemID.LavaRocket)
|
||||
{
|
||||
Utils.PlotTileArea(center.X, center.Y, DelegateMethods.SpreadLava);
|
||||
}
|
||||
else if (RocketType == ItemID.HoneyRocket)
|
||||
{
|
||||
Utils.PlotTileArea(center.X, center.Y, DelegateMethods.SpreadHoney);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
public class MiniRocket : ModProjectile, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Projectiles.Ranged";
|
||||
public static Item FalseLauncher = null;
|
||||
private ref float RocketType => ref Projectile.ai[0];
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
@@ -26,23 +26,10 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
Projectile.DamageType = DamageClass.Ranged;
|
||||
}
|
||||
|
||||
private static void DefineFalseLauncher()
|
||||
{
|
||||
int rocketID = ItemID.RocketLauncher;
|
||||
FalseLauncher = new Item();
|
||||
FalseLauncher.SetDefaults(rocketID, true);
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.ToRadians(90);
|
||||
|
||||
if (Projectile.ai[0] == 0f)
|
||||
{
|
||||
SoundEngine.PlaySound(SoundID.Item11, Projectile.Center);
|
||||
Projectile.ai[0] = 1f;
|
||||
}
|
||||
|
||||
//Animation
|
||||
Projectile.frameCounter++;
|
||||
if (Projectile.frameCounter > 7)
|
||||
@@ -77,16 +64,7 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
}
|
||||
CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 200f, 12f, 20f);
|
||||
|
||||
// Construct a fake item to use with vanilla code for the sake of picking ammo.
|
||||
if (FalseLauncher is null)
|
||||
DefineFalseLauncher();
|
||||
Player player = Main.player[Projectile.owner];
|
||||
int projID = ProjectileID.RocketI;
|
||||
float shootSpeed = 0f;
|
||||
int damage = 0;
|
||||
float kb = 0f;
|
||||
player.PickAmmo(FalseLauncher, out projID, out shootSpeed, out damage, out kb, out _, true);
|
||||
if (projID == ProjectileID.DryRocket || projID == ProjectileID.WetRocket || projID == ProjectileID.LavaRocket || projID == ProjectileID.HoneyRocket)
|
||||
if (RocketType == ItemID.DryRocket || RocketType == ItemID.WetRocket || RocketType == ItemID.LavaRocket || RocketType == ItemID.HoneyRocket)
|
||||
{
|
||||
if (Projectile.wet)
|
||||
Projectile.timeLeft = 1;
|
||||
@@ -165,51 +143,41 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
}
|
||||
}
|
||||
|
||||
// Construct a fake item to use with vanilla code for the sake of picking ammo.
|
||||
if (FalseLauncher is null)
|
||||
DefineFalseLauncher();
|
||||
Player player = Main.player[Projectile.owner];
|
||||
int projID = ProjectileID.RocketI;
|
||||
float shootSpeed = 0f;
|
||||
int damage = 0;
|
||||
float kb = 0f;
|
||||
player.PickAmmo(FalseLauncher, out projID, out shootSpeed, out damage, out kb, out _, true);
|
||||
int blastRadius = 0;
|
||||
if (projID == ProjectileID.RocketII || projID == ProjectileID.ClusterRocketII)
|
||||
blastRadius = 3;
|
||||
else if (projID == ProjectileID.RocketIV)
|
||||
blastRadius = 6;
|
||||
else if (projID == ProjectileID.MiniNukeRocketII)
|
||||
blastRadius = 9;
|
||||
// Only do rocket effects for the owner client side
|
||||
if (Projectile.owner != Main.myPlayer)
|
||||
return;
|
||||
|
||||
int blastRadius = 0;
|
||||
if (RocketType == ItemID.RocketII)
|
||||
blastRadius = 3;
|
||||
else if (RocketType == ItemID.RocketIV)
|
||||
blastRadius = 6;
|
||||
else if (RocketType == ItemID.MiniNukeII)
|
||||
blastRadius = 9;
|
||||
Projectile.ExpandHitboxBy(14);
|
||||
|
||||
if (Projectile.owner == Main.myPlayer && blastRadius > 0)
|
||||
{
|
||||
CalamityUtils.ExplodeandDestroyTiles(Projectile, blastRadius, true, new List<int>() { }, new List<int>() { });
|
||||
}
|
||||
if (Projectile.owner == Main.myPlayer)
|
||||
if (blastRadius > 0)
|
||||
Projectile.ExplodeandDestroyTiles(blastRadius, true, new List<int>(), new List<int>());
|
||||
|
||||
Point center = Projectile.Center.ToTileCoordinates();
|
||||
DelegateMethods.v2_1 = center.ToVector2();
|
||||
DelegateMethods.f_1 = 3f;
|
||||
if (RocketType == ItemID.DryRocket)
|
||||
{
|
||||
Point center = Projectile.Center.ToTileCoordinates();
|
||||
DelegateMethods.v2_1 = center.ToVector2();
|
||||
DelegateMethods.f_1 = 3f;
|
||||
if (projID == ProjectileID.DryRocket)
|
||||
{
|
||||
DelegateMethods.f_1 = 3.5f;
|
||||
Utils.PlotTileArea(center.X, center.Y, DelegateMethods.SpreadDry);
|
||||
}
|
||||
else if (projID == ProjectileID.WetRocket)
|
||||
{
|
||||
Utils.PlotTileArea(center.X, center.Y, DelegateMethods.SpreadWater);
|
||||
}
|
||||
else if (projID == ProjectileID.LavaRocket)
|
||||
{
|
||||
Utils.PlotTileArea(center.X, center.Y, DelegateMethods.SpreadLava);
|
||||
}
|
||||
else if (projID == ProjectileID.HoneyRocket)
|
||||
{
|
||||
Utils.PlotTileArea(center.X, center.Y, DelegateMethods.SpreadHoney);
|
||||
}
|
||||
DelegateMethods.f_1 = 3.5f;
|
||||
Utils.PlotTileArea(center.X, center.Y, DelegateMethods.SpreadDry);
|
||||
}
|
||||
else if (RocketType == ItemID.WetRocket)
|
||||
{
|
||||
Utils.PlotTileArea(center.X, center.Y, DelegateMethods.SpreadWater);
|
||||
}
|
||||
else if (RocketType == ItemID.LavaRocket)
|
||||
{
|
||||
Utils.PlotTileArea(center.X, center.Y, DelegateMethods.SpreadLava);
|
||||
}
|
||||
else if (RocketType == ItemID.HoneyRocket)
|
||||
{
|
||||
Utils.PlotTileArea(center.X, center.Y, DelegateMethods.SpreadHoney);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,16 +134,7 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
|
||||
if (Projectile.owner == Main.myPlayer)
|
||||
{
|
||||
CalamityUtils.ExplodeandDestroyTiles(Projectile, 5, false, new List<int>()
|
||||
{
|
||||
ModContent.TileType<AbyssGravel>(),
|
||||
ModContent.TileType<Voidstone>()
|
||||
},
|
||||
new List<int>()
|
||||
{
|
||||
ModContent.WallType<AbyssGravelWall>(),
|
||||
ModContent.WallType<VoidstoneWallUnsafe>()
|
||||
});
|
||||
Projectile.ExplodeandDestroyTiles(5, true, new List<int>(), new List<int>());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+30
-56
@@ -14,7 +14,7 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
{
|
||||
public new string LocalizationCategory => "Projectiles.Ranged";
|
||||
public int flarePowderTimer = 12;
|
||||
public static Item FalseLauncher = null;
|
||||
private ref float RocketType => ref Projectile.ai[0];
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
@@ -34,13 +34,6 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
Projectile.DamageType = DamageClass.Ranged;
|
||||
}
|
||||
|
||||
private static void DefineFalseLauncher()
|
||||
{
|
||||
int rocketID = ItemID.RocketLauncher;
|
||||
FalseLauncher = new Item();
|
||||
FalseLauncher.SetDefaults(rocketID, true);
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
//Animation
|
||||
@@ -82,17 +75,7 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
Main.dust[num249].velocity *= 0.05f;
|
||||
}
|
||||
|
||||
// Construct a fake item to use with vanilla code for the sake of picking ammo.
|
||||
if (FalseLauncher is null)
|
||||
DefineFalseLauncher();
|
||||
|
||||
Player player = Main.player[Projectile.owner];
|
||||
int projID = ProjectileID.RocketI;
|
||||
float shootSpeed = 0f;
|
||||
int damage = 0;
|
||||
float kb = 0f;
|
||||
player.PickAmmo(FalseLauncher, out projID, out shootSpeed, out damage, out kb, out _, true);
|
||||
if (projID == ProjectileID.DryRocket || projID == ProjectileID.WetRocket || projID == ProjectileID.LavaRocket || projID == ProjectileID.HoneyRocket)
|
||||
if (RocketType == ItemID.DryRocket || RocketType == ItemID.WetRocket || RocketType == ItemID.LavaRocket || RocketType == ItemID.HoneyRocket)
|
||||
{
|
||||
Projectile.ignoreWater = false;
|
||||
if (Projectile.wet)
|
||||
@@ -182,51 +165,42 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
}
|
||||
}
|
||||
|
||||
// Construct a fake item to use with vanilla code for the sake of picking ammo.
|
||||
if (FalseLauncher is null)
|
||||
DefineFalseLauncher();
|
||||
Player player = Main.player[Projectile.owner];
|
||||
int projID = ProjectileID.RocketI;
|
||||
float shootSpeed = 0f;
|
||||
int damage = 0;
|
||||
float kb = 0f;
|
||||
player.PickAmmo(FalseLauncher, out projID, out shootSpeed, out damage, out kb, out _, true);
|
||||
// Only do rocket effects for the owner client side
|
||||
if (Projectile.owner != Main.myPlayer)
|
||||
return;
|
||||
|
||||
int blastRadius = 0;
|
||||
if (projID == ProjectileID.RocketII || projID == ProjectileID.ClusterRocketII)
|
||||
if (RocketType == ItemID.RocketII)
|
||||
blastRadius = 6;
|
||||
else if (projID == ProjectileID.RocketIV)
|
||||
else if (RocketType == ItemID.RocketIV)
|
||||
blastRadius = 12;
|
||||
else if (projID == ProjectileID.MiniNukeRocketII)
|
||||
else if (RocketType == ItemID.MiniNukeII)
|
||||
blastRadius = 18;
|
||||
|
||||
Projectile.ExpandHitboxBy(22);
|
||||
|
||||
if (Projectile.owner == Main.myPlayer && blastRadius > 0)
|
||||
{
|
||||
CalamityUtils.ExplodeandDestroyTiles(Projectile, blastRadius, true, new List<int>() { }, new List<int>() { });
|
||||
}
|
||||
if (Projectile.owner == Main.myPlayer)
|
||||
if (blastRadius > 0)
|
||||
Projectile.ExplodeandDestroyTiles(blastRadius, true, new List<int>(), new List<int>());
|
||||
|
||||
Point center = Projectile.Center.ToTileCoordinates();
|
||||
DelegateMethods.v2_1 = center.ToVector2();
|
||||
DelegateMethods.f_1 = 4f;
|
||||
if (RocketType == ItemID.DryRocket)
|
||||
{
|
||||
Point center = Projectile.Center.ToTileCoordinates();
|
||||
DelegateMethods.v2_1 = center.ToVector2();
|
||||
DelegateMethods.f_1 = 4f;
|
||||
if (projID == ProjectileID.DryRocket)
|
||||
{
|
||||
DelegateMethods.f_1 = 4.5f;
|
||||
Utils.PlotTileArea(center.X, center.Y, DelegateMethods.SpreadDry);
|
||||
}
|
||||
else if (projID == ProjectileID.WetRocket)
|
||||
{
|
||||
Utils.PlotTileArea(center.X, center.Y, DelegateMethods.SpreadWater);
|
||||
}
|
||||
else if (projID == ProjectileID.LavaRocket)
|
||||
{
|
||||
Utils.PlotTileArea(center.X, center.Y, DelegateMethods.SpreadLava);
|
||||
}
|
||||
else if (projID == ProjectileID.HoneyRocket)
|
||||
{
|
||||
Utils.PlotTileArea(center.X, center.Y, DelegateMethods.SpreadHoney);
|
||||
}
|
||||
DelegateMethods.f_1 = 4.5f;
|
||||
Utils.PlotTileArea(center.X, center.Y, DelegateMethods.SpreadDry);
|
||||
}
|
||||
else if (RocketType == ItemID.WetRocket)
|
||||
{
|
||||
Utils.PlotTileArea(center.X, center.Y, DelegateMethods.SpreadWater);
|
||||
}
|
||||
else if (RocketType == ItemID.LavaRocket)
|
||||
{
|
||||
Utils.PlotTileArea(center.X, center.Y, DelegateMethods.SpreadLava);
|
||||
}
|
||||
else if (RocketType == ItemID.HoneyRocket)
|
||||
{
|
||||
Utils.PlotTileArea(center.X, center.Y, DelegateMethods.SpreadHoney);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -232,16 +232,7 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
|
||||
private void DestroyTiles()
|
||||
{
|
||||
CalamityUtils.ExplodeandDestroyTiles(Projectile, 5, false, new List<int>()
|
||||
{
|
||||
ModContent.TileType<AbyssGravel>(),
|
||||
ModContent.TileType<Voidstone>()
|
||||
},
|
||||
new List<int>()
|
||||
{
|
||||
ModContent.WallType<AbyssGravelWall>(),
|
||||
ModContent.WallType<VoidstoneWallUnsafe>()
|
||||
});
|
||||
Projectile.ExplodeandDestroyTiles(5, true, new List<int>(), new List<int>());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -573,7 +573,7 @@ namespace CalamityMod
|
||||
}
|
||||
}
|
||||
|
||||
public static void ExplodeandDestroyTiles(Projectile projectile, int explosionRadius, bool checkExplosions, List<int> tilesToCheck, List<int> wallsToCheck)
|
||||
public static void ExplodeandDestroyTiles(this Projectile projectile, int explosionRadius, bool checkExplosions, List<int> tilesToCheck, List<int> wallsToCheck)
|
||||
{
|
||||
int minTileX = (int)projectile.position.X / 16 - explosionRadius;
|
||||
int maxTileX = (int)projectile.position.X / 16 + explosionRadius;
|
||||
|
||||
Reference in new issue
Block a user