Minigun -> Kingsbane

This commit is contained in:
Xyk authored and Cameron Ewell committed 2023-11-01 11:42:47 -04:00
1 parent e490da1fdf
commit 35316ca088
7 files changed
+11 -19

No files matched your search

@@ -11,10 +11,9 @@ using Terraria.ModLoader;
namespace CalamityMod.Items.Weapons.Ranged
{
public class Minigun : ModItem, ILocalizedModType
[LegacyName("Minigun")]
public class Kingsbane : ModItem, ILocalizedModType
{
public static readonly SoundStyle AuricFire = new("CalamityMod/Sounds/Item/MinigunAuricFire") { Volume = 0.7f }; //unsused
public static readonly SoundStyle RevSound = new("CalamityMod/Sounds/Item/ArcNovaDiffuserChargeLV2") { Volume = 0.7f }; //unused
public new string LocalizationCategory => "Items.Weapons.Ranged";
public override void SetDefaults()
{
@@ -32,7 +31,7 @@ namespace CalamityMod.Items.Weapons.Ranged
Item.UseSound = null;
Item.autoReuse = true;
Item.noUseGraphic = true;
Item.shoot = ModContent.ProjectileType<MinigunHoldout>();
Item.shoot = ModContent.ProjectileType<KingsbaneHoldout>();
Item.shootSpeed = 2f;
Item.useAmmo = AmmoID.Bullet;
Item.rare = ModContent.RarityType<Violet>();
@@ -41,7 +40,7 @@ namespace CalamityMod.Items.Weapons.Ranged
public override bool CanConsumeAmmo(Item ammo, Player player) => Main.rand.NextFloat() > 0.95f && player.ownedProjectileCounts[Item.shoot] > 0;
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType<MinigunHoldout>(), damage, knockback, player.whoAmI, 0f, 0f);
Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType<KingsbaneHoldout>(), damage, knockback, player.whoAmI, 0f, 0f);
return false;
}
public override void AddRecipes()
File renamed without changes.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

+1 -1
View File
@@ -65,7 +65,7 @@ namespace CalamityMod.Items.Weapons.Ranged
{
CreateRecipe().
AddIngredient<P90>().
AddIngredient<Minigun>().
AddIngredient<Kingsbane>().
AddIngredient<ShadowspecBar>(5).
AddTile<DraedonsForge>().
Register();
@@ -725,8 +725,8 @@ MineralMortar: {
Tooltip: Shoots an onyx bomb that explodes into sand sharks on death
}
Minigun: {
DisplayName: Minigun
Kingsbane: {
DisplayName: Kingsbane
Tooltip:
'''
After revving up, rapidly fire bullets
@@ -11,14 +11,13 @@ using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Ranged
{
public class MinigunHoldout : ModProjectile
public class KingsbaneHoldout : ModProjectile
{
// Take the name and texture from the weapon
public override LocalizedText DisplayName => CalamityUtils.GetItemName<Minigun>();
public override LocalizedText DisplayName => CalamityUtils.GetItemName<Kingsbane>();
private bool OwnerCanShoot => Owner.channel && !Owner.noItems && !Owner.CCed;
public override string Texture => "CalamityMod/Projectiles/Ranged/MinigunWindUp";
public override string Texture => "CalamityMod/Projectiles/Ranged/KingsbaneWindUp";
private Player Owner => Main.player[Projectile.owner];
//public SlotId MinigunRevSlot;
public int Time = 0;
public int revTimer = 0; //revving timer
@@ -98,7 +97,7 @@ namespace CalamityMod.Projectiles.Ranged
Owner.velocity += -Projectile.velocity * fullRevShots * (Main.zenithWorld ? 0.028f : 0.013f);
Projectile.NewProjectile(Projectile.GetSource_FromThis(), tipPosition + Projectile.velocity * 5 + Main.rand.NextVector2Circular(7, 7), shootVelocity.RotatedByRandom(MathHelper.ToRadians(4f)), ModContent.ProjectileType<AuricBullet>(), (int)(Projectile.damage * 0.9f), Projectile.knockBack, Projectile.owner);
SoundEngine.PlaySound(SoundID.Item40 with { PitchVariance = 0.4f }, Projectile.Center);
//SoundEngine.PlaySound(Minigun.AuricFire with { PitchVariance = 0.4f }, Projectile.Center);
//SoundEngine.PlaySound(Kingsbane.AuricFire with { PitchVariance = 0.4f }, Projectile.Center);
fullRevShots--;
}
}
@@ -165,12 +164,6 @@ namespace CalamityMod.Projectiles.Ranged
Owner.itemAnimation = 2;
Owner.itemRotation = (Projectile.velocity * Projectile.direction).ToRotation();
}
public override void OnKill(int timeLeft)
{
//if (SoundEngine.TryGetActiveSound(MinigunRevSlot, out var ChargeSound))
//ChargeSound?.Stop();
}
public override bool? CanDamage() => false;
}
}
File renamed without changes.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.