Magnetic Meltdown reworked.
1 - Much higher damage and mana cost, much slower. 2 - Fired orbs spread out in a diamond pattern and go further before stopping. 3 - Lasers are fired 1/3 as fast.
This commit is contained in:
1 parent
73f75f1776
commit
71c7e750a8
2 files changed
+32
-21
No files matched your search
@@ -1,6 +1,5 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Magic;
|
||||
using CalamityMod.Tiles.Furniture.CraftingStations;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
@@ -13,28 +12,28 @@ namespace CalamityMod.Items.Weapons.Magic
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Magnetic Meltdown");
|
||||
Tooltip.SetDefault("Fires a spread of magnetic orbs");
|
||||
Tooltip.SetDefault("Launches a diamond cross of supercharged magnet spheres");
|
||||
Item.staff[item.type] = true;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.damage = 33;
|
||||
item.damage = 63;
|
||||
item.magic = true;
|
||||
item.mana = 25;
|
||||
item.mana = 40;
|
||||
item.width = 78;
|
||||
item.height = 78;
|
||||
item.useTime = 27;
|
||||
item.useAnimation = 27;
|
||||
item.useTime = 49;
|
||||
item.useAnimation = 49;
|
||||
item.useStyle = ItemUseStyleID.HoldingOut;
|
||||
item.noMelee = true;
|
||||
item.knockBack = 4f;
|
||||
item.value = CalamityGlobalItem.Rarity12BuyPrice;
|
||||
item.rare = ItemRarityID.Purple;
|
||||
item.UseSound = SoundID.Item20;
|
||||
item.autoReuse = true;
|
||||
item.shoot = ModContent.ProjectileType<MagneticOrb>();
|
||||
item.shootSpeed = 12f;
|
||||
|
||||
item.value = CalamityGlobalItem.Rarity12BuyPrice;
|
||||
item.Calamity().customRarity = CalamityRarity.Turquoise;
|
||||
}
|
||||
|
||||
@@ -42,12 +41,14 @@ namespace CalamityMod.Items.Weapons.Magic
|
||||
|
||||
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 index = 0; index < 4; ++index)
|
||||
{
|
||||
float SpeedX = speedX + Main.rand.NextFloat(-2.5f, 2.5f);
|
||||
float SpeedY = speedY + Main.rand.NextFloat(-2.5f, 2.5f);
|
||||
Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI, 1f, 0f);
|
||||
}
|
||||
Vector2 v = new Vector2(speedX, speedY);
|
||||
float offset = 3f;
|
||||
|
||||
// Fire four orbs at once
|
||||
Projectile.NewProjectile(position, v + offset * Vector2.UnitX, type, damage, knockBack, player.whoAmI, 1f);
|
||||
Projectile.NewProjectile(position, v - offset * Vector2.UnitX, type, damage, knockBack, player.whoAmI, 1f);
|
||||
Projectile.NewProjectile(position, v + offset * Vector2.UnitY, type, damage, knockBack, player.whoAmI, 1f);
|
||||
Projectile.NewProjectile(position, v - offset * Vector2.UnitY, type, damage, knockBack, player.whoAmI, 1f);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,10 +3,14 @@ using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Magic
|
||||
{
|
||||
public class MagneticOrb : ModProjectile
|
||||
{
|
||||
private const int Lifetime = 120;
|
||||
private const float FramesPerBeam = 12f;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Magnetic Orb");
|
||||
@@ -18,17 +22,24 @@ namespace CalamityMod.Projectiles.Magic
|
||||
projectile.width = 38;
|
||||
projectile.height = 38;
|
||||
projectile.friendly = true;
|
||||
projectile.light = 0.5f;
|
||||
projectile.tileCollide = false;
|
||||
projectile.penetrate = -1;
|
||||
projectile.timeLeft = 150;
|
||||
projectile.penetrate = 1;
|
||||
projectile.timeLeft = 120;
|
||||
projectile.magic = true;
|
||||
}
|
||||
|
||||
public override bool CanDamage() => false;
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
projectile.velocity *= 0.96f;
|
||||
// Drift to a stop after being launched
|
||||
projectile.velocity *= 0.972f;
|
||||
|
||||
// On frame 1, pick a random offset to use for the firing pattern.
|
||||
if (projectile.timeLeft == Lifetime)
|
||||
projectile.localAI[0] = Main.rand.NextFloat(0f, FramesPerBeam);
|
||||
|
||||
// What in the hell does this code do
|
||||
if (projectile.velocity.X > 0f)
|
||||
{
|
||||
projectile.rotation += (Math.Abs(projectile.velocity.Y) + Math.Abs(projectile.velocity.X)) * 0.001f;
|
||||
@@ -38,6 +49,7 @@ namespace CalamityMod.Projectiles.Magic
|
||||
projectile.rotation -= (Math.Abs(projectile.velocity.Y) + Math.Abs(projectile.velocity.X)) * 0.001f;
|
||||
}
|
||||
|
||||
// Update animation
|
||||
projectile.frameCounter++;
|
||||
if (projectile.frameCounter > 6)
|
||||
{
|
||||
@@ -49,7 +61,7 @@ namespace CalamityMod.Projectiles.Magic
|
||||
}
|
||||
}
|
||||
|
||||
CalamityGlobalProjectile.MagnetSphereHitscan(projectile, 400f, 8f, 4f, 2, ModContent.ProjectileType<MagneticBeam>(), 1D, true);
|
||||
CalamityGlobalProjectile.MagnetSphereHitscan(projectile, 400f, 8f, FramesPerBeam, 1, ModContent.ProjectileType<MagneticBeam>(), 1D, true);
|
||||
}
|
||||
|
||||
public override Color? GetAlpha(Color lightColor)
|
||||
@@ -70,7 +82,5 @@ namespace CalamityMod.Projectiles.Magic
|
||||
Main.spriteBatch.Draw(texture2D13, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new 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() => false;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user