Wulf battery & drive can be extractinated

This commit is contained in:
IbanPlay authored and Cameron Ewell committed 2022-07-11 19:05:37 -04:00
1 parent 54a46f02a5
commit 5b8943bf74
4 files changed
+56 -2

No files matched your search

+22
View File
@@ -2,6 +2,7 @@
using Terraria;
using Terraria.ModLoader;
using Terraria.ID;
using CalamityMod.Items.Materials;
namespace CalamityMod.Items.Accessories
{
@@ -14,6 +15,8 @@ namespace CalamityMod.Items.Accessories
Tooltip.SetDefault("Activates a protective shield that grants 15 defense for 10 seconds\n" +
//Actually 10.1 seconds at full power with a dissipation across 0.1666 seconds but whatever
"The shield then dissipates and recharges for 20 seconds before being reactivated");
ItemID.Sets.ExtractinatorMode[Item.type] = Item.type;
}
public override void SetDefaults()
@@ -23,6 +26,12 @@ namespace CalamityMod.Items.Accessories
Item.value = CalamityGlobalItem.Rarity1BuyPrice;
Item.rare = ItemRarityID.Blue;
Item.accessory = true;
//Needed for extractination
Item.useStyle = ItemUseStyleID.HiddenAnimation;
Item.useAnimation = 10;
Item.useTime = 2;
Item.consumable = true;
}
public override void UpdateAccessory(Player player, bool hideVisual)
@@ -30,5 +39,18 @@ namespace CalamityMod.Items.Accessories
CalamityPlayer modPlayer = player.Calamity();
modPlayer.roverDrive = true;
}
//Scrappable for 3-6 wulfrum scrap or a 20% chance to get an energy core
public override void ExtractinatorUse(ref int resultType, ref int resultStack)
{
resultType = ModContent.ItemType<WulfrumMetalScrap>();
resultStack = Main.rand.Next(3, 6);
if (Main.rand.NextFloat() > 0.8f)
{
resultStack = 1;
resultType = ModContent.ItemType<EnergyCore>();
}
}
}
}
+24 -1
View File
@@ -3,6 +3,7 @@ using Terraria.ModLoader;
using Terraria.ID;
using Terraria.DataStructures;
using Terraria.Audio;
using CalamityMod.Items.Materials;
namespace CalamityMod.Items.Accessories
{
@@ -16,7 +17,10 @@ namespace CalamityMod.Items.Accessories
DisplayName.SetDefault("Wulfrum Battery");
Tooltip.SetDefault("7% increased summon damage\n" +
"Attaches a spotlight on your first summon\n" +
"50% chance to get an extra scrap when killing wulfrum robots");
"50% chance to get an extra scrap when killing wulfrum robots\n" +
"Can also be scrapped at an extractinator");
ItemID.Sets.ExtractinatorMode[Item.type] = Item.type;
}
public override void SetDefaults()
@@ -26,6 +30,12 @@ namespace CalamityMod.Items.Accessories
Item.value = Item.buyPrice(0, 1, 0, 0);
Item.accessory = true;
Item.rare = ItemRarityID.Blue;
//Needed for extractination
Item.useStyle = ItemUseStyleID.HiddenAnimation;
Item.useAnimation = 10;
Item.useTime = 2;
Item.consumable = true;
}
public override void UpdateAccessory(Player player, bool hideVisual)
@@ -33,6 +43,19 @@ namespace CalamityMod.Items.Accessories
player.GetDamage<SummonDamageClass>() += 0.07f;
player.GetModPlayer<WulfrumBatteryPlayer>().battery = true;
}
//Scrappable for 3-6 wulfrum scrap or a 20% chance to get an energy core
public override void ExtractinatorUse(ref int resultType, ref int resultStack)
{
resultType = ModContent.ItemType<WulfrumMetalScrap>();
resultStack = Main.rand.Next(3, 6);
if (Main.rand.NextFloat() > 0.8f)
{
resultStack = 1;
resultType = ModContent.ItemType<EnergyCore>();
}
}
}
public class WulfrumBatteryPlayer : ModPlayer
@@ -48,6 +48,15 @@ namespace CalamityMod.Items.Weapons.Melee
SacrificeTotal = 1;
}
public override float UseSpeedMultiplier(Player player)
{
//Super speedy
if (player.altFunctionUse == 2)
return 2f;
return base.UseSpeedMultiplier(player);
}
public override void SetDefaults()
{
Item.width = 14;
+1 -1
View File
@@ -100,7 +100,7 @@ namespace CalamityMod.Projectiles.Melee
{
if (Owner.HeldItem.ModItem is WulfrumScrewdriver screwdriver && !screwdriver.ScrewStored)
{
WulfrumScrewdriver.ScrewStart = new Vector3(Projectile.Center + Projectile.velocity * 14f * Main.rand.NextFloat() - Main.screenPosition, Main.rand.NextFloat(MathHelper.PiOver2 - MathHelper.PiOver4));
WulfrumScrewdriver.ScrewStart = new Vector3(Projectile.Center + Projectile.velocity.SafeNormalize(Vector2.Zero) * 14f * Main.rand.NextFloat() - Main.screenPosition, Main.rand.NextFloat(MathHelper.PiOver2 - MathHelper.PiOver4));
WulfrumScrewdriver.ScrewTimer = WulfrumScrewdriver.ScrewTime;
screwdriver.ScrewStored = true;