Wulfrum Power Suit
No files matched your search
@@ -26,6 +26,7 @@ using CalamityMod.Items.Armor.GemTech;
|
||||
using CalamityMod.Items.Armor.OmegaBlue;
|
||||
using CalamityMod.Items.Armor.PlagueReaper;
|
||||
using CalamityMod.Items.Armor.Silva;
|
||||
using CalamityMod.Items.Armor.Wulfrum;
|
||||
using CalamityMod.Items.Dyes;
|
||||
using CalamityMod.Items.Mounts;
|
||||
using CalamityMod.Items.Mounts.Minecarts;
|
||||
@@ -610,7 +611,6 @@ namespace CalamityMod.CalPlayer
|
||||
public bool silverMedkit = false;
|
||||
public int silverMedkitTimer = 0;
|
||||
public bool goldArmorGoldDrops = false;
|
||||
public bool wulfrumSet = false;
|
||||
public bool desertProwler = false;
|
||||
public bool snowRuffianSet = false;
|
||||
public bool forbiddenCirclet = false;
|
||||
@@ -1740,8 +1740,6 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
astralStarRain = false;
|
||||
|
||||
wulfrumSet = false;
|
||||
|
||||
desertProwler = false;
|
||||
|
||||
snowRuffianSet = false;
|
||||
@@ -2444,7 +2442,6 @@ namespace CalamityMod.CalPlayer
|
||||
ataxiaVolley = false;
|
||||
ataxiaBlaze = false;
|
||||
hydrothermalSmoke = false;
|
||||
wulfrumSet = false;
|
||||
desertProwler = false;
|
||||
snowRuffianSet = false;
|
||||
forbiddenCirclet = false;
|
||||
@@ -5865,6 +5862,7 @@ namespace CalamityMod.CalPlayer
|
||||
// The amount of damage that will be dealt is yet to be determined.
|
||||
//
|
||||
|
||||
//Todo - At some point it'd be nice to have a "TransformationPlayer" that has all the transformation sfx and visuals so their priorities can be more easily managed.
|
||||
#region Custom Hurt Sounds
|
||||
if (hurtSoundTimer == 0)
|
||||
{
|
||||
@@ -5892,7 +5890,13 @@ namespace CalamityMod.CalPlayer
|
||||
SoundEngine.PlaySound(NPCs.Astral.Atlas.HurtSound, Player.position);
|
||||
hurtSoundTimer = 10;
|
||||
}
|
||||
else if (wulfrumSet && (Player.name.ToLower() == "wagstaff" || Player.name.ToLower() == "john wulfrum"))
|
||||
else if (Player.GetModPlayer<WulfrumTransformationPlayer>().transformationActive)
|
||||
{
|
||||
playSound = false;
|
||||
SoundEngine.PlaySound(SoundID.NPCHit4, Player.position);
|
||||
hurtSoundTimer = 10;
|
||||
}
|
||||
else if (Player.GetModPlayer<WulfrumArmorPlayer>().wulfrumSet && (Player.name.ToLower() == "wagstaff" || Player.name.ToLower() == "john wulfrum"))
|
||||
{
|
||||
playSound = false;
|
||||
SoundEngine.PlaySound(SoundID.DSTMaleHurt, Player.position);
|
||||
|
||||
@@ -12,6 +12,7 @@ using Terraria.GameContent;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Items.Weapons.Magic;
|
||||
using CalamityMod.Items.Armor.Wulfrum;
|
||||
|
||||
namespace CalamityMod.CalPlayer
|
||||
{
|
||||
@@ -39,7 +40,7 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
}
|
||||
|
||||
if (Player.HeldItem.type == ModContent.ItemType<WulfrumProthesis>())
|
||||
if (Player.HeldItem.ModItem is IHideFrontArm amputator && amputator.ShouldHideArm(Player))
|
||||
{
|
||||
PlayerDrawLayers.ArmOverItem.Hide();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria;
|
||||
|
||||
/// <summary>
|
||||
/// Interface that can be used by items that need to hide the players front arm when held.
|
||||
/// Useful for prothesis type items.
|
||||
/// </summary>
|
||||
public interface IHideFrontArm
|
||||
{
|
||||
/// <summary>
|
||||
/// When should the arm be hidden. Defauls to always
|
||||
/// </summary>
|
||||
bool ShouldHideArm(Player player) => true;
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.Graphics.Shaders;
|
||||
using static Terraria.ModLoader.ModContent;
|
||||
using CalamityMod.Items.Armor.Wulfrum;
|
||||
|
||||
namespace CalamityMod.Cooldowns
|
||||
{
|
||||
public class WulfrumBastion : CooldownHandler
|
||||
{
|
||||
public bool PowerActive => instance.timeLeft > WulfrumHat.BastionCooldown;
|
||||
public float DurabilityPercent => (instance.timeLeft - WulfrumHat.BastionCooldown) / (float)WulfrumHat.BastionTime;
|
||||
|
||||
|
||||
public static new string ID => "WulfrumBastion";
|
||||
public override bool ShouldDisplay => true;
|
||||
public override string DisplayName => PowerActive ? "Power Armor Durability" : "Wulfrum Bastion Cooldown";
|
||||
public override string Texture => PowerActive ? "CalamityMod/Cooldowns/WulfrumBastionActive" : "CalamityMod/Cooldowns/WulfrumBastion";
|
||||
public override string OutlineTexture => "CalamityMod/Cooldowns/WulfrumBastionOutline";
|
||||
public override string OverlayTexture => "CalamityMod/Cooldowns/WulfrumBastionOverlay";
|
||||
public override Color OutlineColor => PowerActive ? new Color(194, 255, 67) : new Color(206, 201, 170);
|
||||
public override Color CooldownStartColor => PowerActive ? Color.Lerp(new Color(112, 244, 244), new Color(54, 177, 221), DurabilityPercent) : new Color(92, 187, 99);
|
||||
public override Color CooldownEndColor => PowerActive ? Color.Lerp(new Color(112, 244, 244), new Color(54, 177, 221), DurabilityPercent) : new Color(160, 232, 77);
|
||||
public override SoundStyle? EndSound => new("CalamityMod/Sounds/Custom/AbilitySounds/WulfrumBastionRecharge");
|
||||
|
||||
public override void OnCompleted()
|
||||
{
|
||||
for (int i = 0; i < 66; i++)
|
||||
{
|
||||
int d = Dust.NewDust(instance.player.position, instance.player.width, instance.player.height, 20, 0, 0, 100, Color.Transparent, 2.6f);
|
||||
Main.dust[d].noGravity = true;
|
||||
Main.dust[d].noLight = true;
|
||||
Main.dust[d].fadeIn = 1f;
|
||||
Main.dust[d].velocity *= 6.6f;
|
||||
}
|
||||
|
||||
//explode into gores
|
||||
}
|
||||
|
||||
//Charge down at first, and then charge back up
|
||||
private float AdjustedCompletion => PowerActive ? (instance.timeLeft - WulfrumHat.BastionCooldown) / (float)WulfrumHat.BastionTime : 1 - (instance.timeLeft / (float)WulfrumHat.BastionCooldown);
|
||||
|
||||
public override void ApplyBarShaders(float opacity)
|
||||
{
|
||||
//Use the adjusted completion
|
||||
GameShaders.Misc["CalamityMod:CircularBarShader"].UseOpacity(opacity);
|
||||
GameShaders.Misc["CalamityMod:CircularBarShader"].UseSaturation(AdjustedCompletion);
|
||||
GameShaders.Misc["CalamityMod:CircularBarShader"].UseColor(CooldownStartColor);
|
||||
GameShaders.Misc["CalamityMod:CircularBarShader"].UseSecondaryColor(CooldownEndColor);
|
||||
GameShaders.Misc["CalamityMod:CircularBarShader"].Apply();
|
||||
}
|
||||
|
||||
public override void DrawCompact(SpriteBatch spriteBatch, Vector2 position, float opacity, float scale)
|
||||
{
|
||||
Texture2D sprite = Request<Texture2D>(Texture).Value;
|
||||
Texture2D outline = Request<Texture2D>(OutlineTexture).Value;
|
||||
Texture2D overlay = Request<Texture2D>(OverlayTexture).Value;
|
||||
|
||||
//Draw the outline
|
||||
spriteBatch.Draw(outline, position, null, OutlineColor * opacity, 0, outline.Size() * 0.5f, scale, SpriteEffects.None, 0f);
|
||||
|
||||
//Draw the icon
|
||||
spriteBatch.Draw(sprite, position, null, Color.White * opacity, 0, sprite.Size() * 0.5f, scale, SpriteEffects.None, 0f);
|
||||
|
||||
//Draw the small overlay
|
||||
int lostHeight = (int)Math.Ceiling(overlay.Height * AdjustedCompletion);
|
||||
Rectangle crop = new Rectangle(0, lostHeight, overlay.Width, overlay.Height - lostHeight);
|
||||
spriteBatch.Draw(overlay, position + Vector2.UnitY * lostHeight * scale, crop, OutlineColor * opacity * 0.9f, 0, sprite.Size() * 0.5f, scale, SpriteEffects.None, 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 489 B |
|
After Width: | Height: | Size: 500 B |
|
After Width: | Height: | Size: 281 B |
|
After Width: | Height: | Size: 262 B |
|
After Width: | Height: | Size: 331 B |
|
After Width: | Height: | Size: 340 B |
|
After Width: | Height: | Size: 179 B |
|
After Width: | Height: | Size: 128 B |
|
After Width: | Height: | Size: 392 B |
|
After Width: | Height: | Size: 400 B |
|
After Width: | Height: | Size: 227 B |
|
After Width: | Height: | Size: 243 B |
|
After Width: | Height: | Size: 256 B |
|
After Width: | Height: | Size: 326 B |
|
After Width: | Height: | Size: 449 B |
|
After Width: | Height: | Size: 428 B |
@@ -66,29 +66,28 @@ namespace CalamityMod.Items.Accessories.Vanity
|
||||
|
||||
public override void UpdateVanity(Player player)
|
||||
{
|
||||
player.GetModPlayer<WulfrumTransformationPlayer>().vanityEquiped = true;
|
||||
player.GetModPlayer<WulfrumTransformationPlayer>().transformationActive = true;
|
||||
}
|
||||
|
||||
public override void UpdateAccessory(Player player, bool hideVisual)
|
||||
{
|
||||
if (!hideVisual)
|
||||
player.GetModPlayer<WulfrumTransformationPlayer>().vanityEquiped = true;
|
||||
player.GetModPlayer<WulfrumTransformationPlayer>().transformationActive = true;
|
||||
}
|
||||
}
|
||||
|
||||
public class WulfrumTransformationPlayer : ModPlayer
|
||||
{
|
||||
public bool vanityEquiped = false;
|
||||
public int hurtSoundTimer;
|
||||
public bool transformationActive = false;
|
||||
|
||||
public override void ResetEffects()
|
||||
{
|
||||
vanityEquiped = false;
|
||||
transformationActive = false;
|
||||
}
|
||||
|
||||
public override void FrameEffects()
|
||||
{
|
||||
if (vanityEquiped)
|
||||
if (transformationActive)
|
||||
{
|
||||
Player.legs = EquipLoader.GetEquipSlot(Mod, "AbandonnedWulfrumHelmet", EquipType.Legs);
|
||||
Player.body = EquipLoader.GetEquipSlot(Mod, "AbandonnedWulfrumHelmet", EquipType.Body);
|
||||
@@ -96,23 +95,5 @@ namespace CalamityMod.Items.Accessories.Vanity
|
||||
Player.face = -1;
|
||||
}
|
||||
}
|
||||
|
||||
public override void PostUpdateMiscEffects()
|
||||
{
|
||||
if (hurtSoundTimer > 0)
|
||||
hurtSoundTimer--;
|
||||
}
|
||||
|
||||
public override bool PreHurt(bool pvp, bool quiet, ref int damage, ref int hitDirection, ref bool crit, ref bool customDamage, ref bool playSound, ref bool genGore, ref PlayerDeathReason damageSource)
|
||||
{
|
||||
if (vanityEquiped && hurtSoundTimer == 0)
|
||||
{
|
||||
playSound = false;
|
||||
SoundEngine.PlaySound(SoundID.NPCHit4, Player.position);
|
||||
hurtSoundTimer = 10;
|
||||
}
|
||||
|
||||
return base.PreHurt(pvp, quiet, ref damage, ref hitDirection, ref crit, ref customDamage, ref playSound, ref genGore, ref damageSource);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ID;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.Audio;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Materials;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
|
||||
|
After Width: | Height: | Size: 564 B |
@@ -1,77 +0,0 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria.DataStructures;
|
||||
|
||||
namespace CalamityMod.Items.Armor.Wulfrum
|
||||
{
|
||||
[AutoloadEquip(EquipType.Head)]
|
||||
[LegacyName("WulfrumHelmet")]
|
||||
[LegacyName("WulfrumHeadSummon")]
|
||||
public class WulfrumHat : ModItem, IExtendedHat
|
||||
{
|
||||
public string ExtensionTexture => "CalamityMod/Items/Armor/Wulfrum/WulfrumHat_HeadExtension";
|
||||
public Vector2 ExtensionSpriteOffset(PlayerDrawSet drawInfo) => -Vector2.UnitY * 2f;
|
||||
public string EquipSlotName(Player drawPlayer) => drawPlayer.Male ? Name : "WulfrumHatFemale";
|
||||
|
||||
public override void Load()
|
||||
{
|
||||
if (Main.netMode != NetmodeID.Server)
|
||||
{
|
||||
EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Armor/Wulfrum/WulfrumHat_FemaleHead", EquipType.Head, name : "WulfrumHatFemale");
|
||||
}
|
||||
}
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
SacrificeTotal = 1;
|
||||
DisplayName.SetDefault("Wulfrum Hat & Goggles");
|
||||
Tooltip.SetDefault("10% increased minion damage\n"+
|
||||
"Comes equipped with hair extensions"
|
||||
);
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 18;
|
||||
Item.height = 18;
|
||||
Item.value = Item.buyPrice(0, 0, 75, 0);
|
||||
Item.rare = ItemRarityID.Blue;
|
||||
}
|
||||
|
||||
public override bool IsArmorSet(Item head, Item body, Item legs)
|
||||
{
|
||||
return body.type == ModContent.ItemType<WulfrumJacket>() && legs.type == ModContent.ItemType<WulfrumOveralls>();
|
||||
}
|
||||
|
||||
public override void UpdateArmorSet(Player player)
|
||||
{
|
||||
player.setBonus = "+3 defense and +1 max minion\n" +
|
||||
"+5 defense when below 50% life";
|
||||
player.statDefense += 3; //8
|
||||
player.maxMinions++;
|
||||
if (player.statLife <= (int)(player.statLifeMax2 * 0.5))
|
||||
{
|
||||
player.statDefense += 5; //13
|
||||
}
|
||||
|
||||
player.Calamity().wulfrumSet = true;
|
||||
}
|
||||
|
||||
public override void UpdateEquip(Player player)
|
||||
{
|
||||
player.GetDamage<SummonDamageClass>() += 0.1f;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe().
|
||||
AddIngredient<WulfrumMetalScrap>(5).
|
||||
AddIngredient<EnergyCore>().
|
||||
AddTile(TileID.Anvils).
|
||||
Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Armor.Wulfrum
|
||||
{
|
||||
[AutoloadEquip(EquipType.Body)]
|
||||
[LegacyName("WulfrumArmor")]
|
||||
public class WulfrumJacket : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
SacrificeTotal = 1;
|
||||
DisplayName.SetDefault("Wulfrum Jacket");
|
||||
Tooltip.SetDefault("3% increased critical strike chance");
|
||||
|
||||
if (Main.netMode != NetmodeID.Server)
|
||||
{
|
||||
var equipSlot = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Body);
|
||||
ArmorIDs.Body.Sets.HidesArms[equipSlot] = true;
|
||||
ArmorIDs.Body.Sets.HidesTopSkin[equipSlot] = true;
|
||||
}
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 18;
|
||||
Item.height = 18;
|
||||
Item.value = Item.buyPrice(0, 0, 50, 0);
|
||||
Item.rare = ItemRarityID.Blue;
|
||||
Item.defense = 2;
|
||||
}
|
||||
|
||||
public override void UpdateEquip(Player player) => player.GetCritChance<GenericDamageClass>() += 3;
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe().
|
||||
AddIngredient<WulfrumMetalScrap>(12).
|
||||
AddIngredient<EnergyCore>().
|
||||
AddTile(TileID.Anvils).
|
||||
Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Armor.Wulfrum
|
||||
{
|
||||
[AutoloadEquip(EquipType.Legs)]
|
||||
[LegacyName("WulfrumLeggings")]
|
||||
public class WulfrumOveralls : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
SacrificeTotal = 1;
|
||||
DisplayName.SetDefault("Wulfrum Overalls");
|
||||
Tooltip.SetDefault("Movement speed increased by 5%");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 18;
|
||||
Item.height = 18;
|
||||
Item.value = Item.buyPrice(0, 0, 25, 0);
|
||||
Item.rare = ItemRarityID.Blue;
|
||||
Item.defense = 1;
|
||||
|
||||
if (Main.netMode != NetmodeID.Server)
|
||||
{
|
||||
var equipSlot = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Legs);
|
||||
ArmorIDs.Legs.Sets.HidesBottomSkin[equipSlot] = true;
|
||||
}
|
||||
}
|
||||
|
||||
public override void UpdateEquip(Player player)
|
||||
{
|
||||
player.moveSpeed += 0.05f;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe().
|
||||
AddIngredient<WulfrumMetalScrap>(8).
|
||||
AddIngredient<EnergyCore>().
|
||||
AddTile(TileID.Anvils).
|
||||
Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,469 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Accessories.Vanity;
|
||||
using CalamityMod.Cooldowns;
|
||||
using CalamityMod.Projectiles.Magic;
|
||||
using Terraria.Audio;
|
||||
using ReLogic.Content;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System.Linq;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Magic;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using ReLogic.Content;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using static CalamityMod.CalamityUtils;
|
||||
using static Terraria.ModLoader.ModContent;
|
||||
using static Microsoft.Xna.Framework.Input.Keys;
|
||||
using System;
|
||||
using CalamityMod.Items.BaseItems;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace CalamityMod.Items.Armor.Wulfrum
|
||||
{
|
||||
#region Armor pieces
|
||||
|
||||
//Datsuzei / Moonstone armor from starlight river was a nice jumping off point for this kind of set.
|
||||
|
||||
[AutoloadEquip(EquipType.Head)]
|
||||
[LegacyName("WulfrumHelmet")]
|
||||
[LegacyName("WulfrumHeadSummon")]
|
||||
public class WulfrumHat : ModItem, IExtendedHat
|
||||
{
|
||||
#region big hat
|
||||
public string ExtensionTexture => "CalamityMod/Items/Armor/Wulfrum/WulfrumHat_HeadExtension";
|
||||
public Vector2 ExtensionSpriteOffset(PlayerDrawSet drawInfo) => -Vector2.UnitY * 2f;
|
||||
public string EquipSlotName(Player drawPlayer) => drawPlayer.Male ? Name : "WulfrumHatFemale";
|
||||
#endregion
|
||||
|
||||
public static int BastionTime = 30 * 60;
|
||||
public static int TimeLostPerHit = 2 * 60;
|
||||
public static int BastionCooldown = 20 * 60;
|
||||
|
||||
public static int BastionShootDamage = 10;
|
||||
public static float BastionShootSpeed = 18f;
|
||||
public static int BastionShootTime = 10;
|
||||
|
||||
internal static Item DummyCannon = new Item(); //Used for the attack swap. Basically we force the player to hold a fake item.
|
||||
|
||||
public static bool PowerModeEngaged(Player player, out CooldownInstance cd)
|
||||
{
|
||||
cd = null;
|
||||
bool hasWulfrumBastionCD = player.Calamity().cooldowns.TryGetValue(WulfrumBastion.ID, out cd);
|
||||
return (hasWulfrumBastionCD && cd.timeLeft > BastionCooldown);
|
||||
}
|
||||
|
||||
public override void Load()
|
||||
{
|
||||
if (Main.netMode != NetmodeID.Server)
|
||||
{
|
||||
EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Armor/Wulfrum/WulfrumHat_FemaleHead", EquipType.Head, name : "WulfrumHatFemale");
|
||||
}
|
||||
|
||||
On.Terraria.Player.KeyDoubleTap += ActivateSetBonus;
|
||||
On.Terraria.Main.DrawPendingMouseText += SpoofMouseItem;
|
||||
}
|
||||
|
||||
public override void Unload()
|
||||
{
|
||||
On.Terraria.Player.KeyDoubleTap -= ActivateSetBonus;
|
||||
On.Terraria.Main.DrawPendingMouseText -= SpoofMouseItem;
|
||||
|
||||
|
||||
DummyCannon.TurnToAir();
|
||||
DummyCannon = null;
|
||||
}
|
||||
|
||||
private void ActivateSetBonus(On.Terraria.Player.orig_KeyDoubleTap orig, Player player, int keyDir)
|
||||
{
|
||||
if (keyDir == 0 && HasArmorSet(player))
|
||||
{
|
||||
//Only activate if no cooldown & available scrap.
|
||||
if (!player.Calamity().cooldowns.TryGetValue(WulfrumBastion.ID, out CooldownInstance cd) && player.HasItem(ModContent.ItemType<WulfrumMetalScrap>()))
|
||||
{
|
||||
player.ConsumeItem(ModContent.ItemType<WulfrumMetalScrap>());
|
||||
//I Thiiiinnnk there's no need to add mp syncing packets sicne cooldowns get auto synced right.
|
||||
player.AddCooldown(WulfrumBastion.ID, BastionCooldown + BastionTime);
|
||||
//Though do i need to sync that or is the player inventory auto synced?
|
||||
DummyCannon.SetDefaults(ItemType<WulfrumFusionCannon>());
|
||||
}
|
||||
}
|
||||
|
||||
orig(player, keyDir);
|
||||
}
|
||||
|
||||
//Replaces the tooltip of the armor set with the fusion cannon if the player holds shift
|
||||
private void SpoofMouseItem(On.Terraria.Main.orig_DrawPendingMouseText orig)
|
||||
{
|
||||
var player = Main.LocalPlayer;
|
||||
|
||||
if (DummyCannon.IsAir && !Main.gameMenu)
|
||||
DummyCannon.SetDefaults(ItemType<WulfrumFusionCannon>());
|
||||
|
||||
if (IsPartOfSet(Main.HoverItem) && HasArmorSet(player) && Main.keyState.IsKeyDown(LeftShift))
|
||||
{
|
||||
Main.HoverItem = DummyCannon.Clone();
|
||||
Main.hoverItemName = DummyCannon.Name;
|
||||
}
|
||||
|
||||
orig();
|
||||
}
|
||||
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
SacrificeTotal = 1;
|
||||
DisplayName.SetDefault("Wulfrum Hat & Goggles");
|
||||
Tooltip.SetDefault("10% increased minion damage\n"+
|
||||
"Comes equipped with hair extensions"
|
||||
);
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 18;
|
||||
Item.height = 18;
|
||||
Item.value = Item.buyPrice(0, 0, 75, 0);
|
||||
Item.rare = ItemRarityID.Blue;
|
||||
}
|
||||
|
||||
public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ItemType<WulfrumJacket>() && legs.type == ItemType<WulfrumOveralls>();
|
||||
public static bool HasArmorSet(Player player) => player.armor[0].type == ItemType<WulfrumHat>() && player.armor[1].type == ItemType<WulfrumJacket>() && player.armor[2].type == ItemType<WulfrumOveralls>();
|
||||
public bool IsPartOfSet(Item item) => item.type == ItemType<WulfrumHat>() ||
|
||||
item.type == ItemType<WulfrumJacket>() ||
|
||||
item.type == ItemType<WulfrumOveralls>();
|
||||
|
||||
public override void UpdateArmorSet(Player player)
|
||||
{
|
||||
player.GetModPlayer<WulfrumArmorPlayer>().wulfrumSet = true;
|
||||
|
||||
player.setBonus = "+3 defense and +1 max minion"; //The cooler part of the set bonus happens in modifytooltips because i can't recolor it otherwise. Madge
|
||||
player.statDefense += 3;
|
||||
player.maxMinions++;
|
||||
if (PowerModeEngaged(player, out _))
|
||||
{
|
||||
player.GetModPlayer<WulfrumTransformationPlayer>().transformationActive = true;
|
||||
player.moveSpeed *= 0.8f;
|
||||
player.statDefense += 15;
|
||||
|
||||
//Drop the player's held item if they were holding something before
|
||||
if (!(Main.mouseItem.type == DummyCannon.type) && !Main.mouseItem.IsAir)
|
||||
Main.LocalPlayer.QuickSpawnClonedItem(null, Main.mouseItem, Main.mouseItem.stack);
|
||||
|
||||
//Slot 58 is the "fake" slot thats used for the item the player is holding in their mouse.
|
||||
Main.mouseItem = DummyCannon;
|
||||
player.inventory[58] = DummyCannon;
|
||||
player.selectedItem = 58;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
//Clear the player's hand
|
||||
if (Main.mouseItem.type == ItemType<WulfrumFusionCannon>())
|
||||
Main.mouseItem = new Item();
|
||||
|
||||
DummyCannon.TurnToAir();
|
||||
}
|
||||
}
|
||||
|
||||
public static void ModifySetTooltips(ModItem item, List<TooltipLine> tooltips)
|
||||
{
|
||||
if (HasArmorSet(Main.LocalPlayer))
|
||||
{
|
||||
int setBonusIndex = tooltips.FindIndex(x => x.Name == "SetBonus" && x.Mod == "Terraria");
|
||||
|
||||
if (setBonusIndex != -1)
|
||||
{
|
||||
TooltipLine setBonus1 = new TooltipLine(item.Mod, "CalamityMod:SetBonus1", "Wulfrum Bastion - Double tap DOWN to equip a heavy wulfrum armor");
|
||||
setBonus1.OverrideColor = new Color(194, 255, 67);
|
||||
tooltips.Insert(setBonusIndex + 1, setBonus1);
|
||||
|
||||
TooltipLine setBonus2 = new TooltipLine(item.Mod, "CalamityMod:SetBonus2", "While the power armor is active, you can only use the integrated fusion cannon, but get increased defensive stats");
|
||||
setBonus2.OverrideColor = new Color(110, 192, 93);
|
||||
tooltips.Insert(setBonusIndex + 2, setBonus2);
|
||||
|
||||
TooltipLine setBonus3 = new TooltipLine(item.Mod, "CalamityMod:SetBonus3", "Calling down the armor consumes one piece of wulfrum scrap, and the armor will loose durability faster when hit");
|
||||
setBonus3.OverrideColor = new Color(110, 192, 93);
|
||||
tooltips.Insert(setBonusIndex + 3, setBonus3);
|
||||
}
|
||||
|
||||
TooltipLine itemDisplay = new TooltipLine(item.Mod, "CalamityMod:ArmorItemDisplay", "Hold SHIFT to see the stats of the fusion cannon");
|
||||
itemDisplay.OverrideColor = new Color(190, 190, 190);
|
||||
tooltips.Add(itemDisplay);
|
||||
}
|
||||
}
|
||||
|
||||
public override void ModifyTooltips(List<TooltipLine> tooltips) => ModifySetTooltips(this, tooltips);
|
||||
|
||||
public override void UpdateEquip(Player player)
|
||||
{
|
||||
player.GetDamage<SummonDamageClass>() += 0.1f;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe().
|
||||
AddIngredient<WulfrumMetalScrap>(5).
|
||||
AddIngredient<EnergyCore>().
|
||||
AddTile(TileID.Anvils).
|
||||
Register();
|
||||
}
|
||||
}
|
||||
|
||||
[AutoloadEquip(EquipType.Body)]
|
||||
[LegacyName("WulfrumArmor")]
|
||||
public class WulfrumJacket : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
SacrificeTotal = 1;
|
||||
DisplayName.SetDefault("Wulfrum Jacket");
|
||||
Tooltip.SetDefault("3% increased critical strike chance");
|
||||
|
||||
if (Main.netMode != NetmodeID.Server)
|
||||
{
|
||||
var equipSlot = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Body);
|
||||
ArmorIDs.Body.Sets.HidesArms[equipSlot] = true;
|
||||
ArmorIDs.Body.Sets.HidesTopSkin[equipSlot] = true;
|
||||
}
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 18;
|
||||
Item.height = 18;
|
||||
Item.value = Item.buyPrice(0, 0, 50, 0);
|
||||
Item.rare = ItemRarityID.Blue;
|
||||
Item.defense = 2;
|
||||
}
|
||||
|
||||
public override void ModifyTooltips(List<TooltipLine> tooltips) => WulfrumHat.ModifySetTooltips(this, tooltips);
|
||||
|
||||
public override void UpdateEquip(Player player) => player.GetCritChance<GenericDamageClass>() += 3;
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe().
|
||||
AddIngredient<WulfrumMetalScrap>(12).
|
||||
AddIngredient<EnergyCore>().
|
||||
AddTile(TileID.Anvils).
|
||||
Register();
|
||||
}
|
||||
}
|
||||
|
||||
[AutoloadEquip(EquipType.Legs)]
|
||||
[LegacyName("WulfrumLeggings")]
|
||||
public class WulfrumOveralls : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
SacrificeTotal = 1;
|
||||
DisplayName.SetDefault("Wulfrum Overalls");
|
||||
Tooltip.SetDefault("Movement speed increased by 5%");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 18;
|
||||
Item.height = 18;
|
||||
Item.value = Item.buyPrice(0, 0, 25, 0);
|
||||
Item.rare = ItemRarityID.Blue;
|
||||
Item.defense = 1;
|
||||
|
||||
if (Main.netMode != NetmodeID.Server)
|
||||
{
|
||||
var equipSlot = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Legs);
|
||||
ArmorIDs.Legs.Sets.HidesBottomSkin[equipSlot] = true;
|
||||
}
|
||||
}
|
||||
public override void ModifyTooltips(List<TooltipLine> tooltips) => WulfrumHat.ModifySetTooltips(this, tooltips);
|
||||
public override void UpdateEquip(Player player)
|
||||
{
|
||||
player.moveSpeed += 0.05f;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe().
|
||||
AddIngredient<WulfrumMetalScrap>(8).
|
||||
AddIngredient<EnergyCore>().
|
||||
AddTile(TileID.Anvils).
|
||||
Register();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
public class WulfrumFusionCannon : HeldOnlyItem, IHideFrontArm
|
||||
{
|
||||
|
||||
public static readonly SoundStyle ShootSound = new("CalamityMod/Sounds/Item/WulfrumProthesisShoot") { PitchVariance = 0.1f, Volume = 0.55f };
|
||||
public static readonly SoundStyle HitSound = new("CalamityMod/Sounds/Item/WulfrumProthesisHit") { PitchVariance = 0.1f, Volume = 0.75f, MaxInstances = 3 };
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Experimental Wulfrum Fusion Array");
|
||||
Tooltip.SetDefault("Fires quick bursts of medium-range pellets\n");
|
||||
//Imaging hiding lore in there... :drool: that would be so dark souls
|
||||
}
|
||||
public override string Texture => "CalamityMod/Items/Armor/Wulfrum/WulfrumFusionCannon";
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.damage = 12;
|
||||
Item.DamageType = DamageClass.Summon;
|
||||
Item.width = 34;
|
||||
Item.height = 42;
|
||||
Item.useStyle = ItemUseStyleID.Shoot;
|
||||
Item.noMelee = true;
|
||||
Item.knockBack = 2;
|
||||
Item.value = Item.buyPrice(0, 1, 0, 0);
|
||||
Item.rare = ItemRarityID.Green;
|
||||
Item.UseSound = ShootSound;
|
||||
Item.autoReuse = true;
|
||||
Item.shoot = ModContent.ProjectileType<WulfrumBolt>();
|
||||
Item.shootSpeed = 18f;
|
||||
Item.holdStyle = 16; //Custom hold style
|
||||
|
||||
Item.useAnimation = 10;
|
||||
Item.useTime = 4;
|
||||
Item.reuseDelay = 17;
|
||||
}
|
||||
|
||||
public override void HoldItem(Player player)
|
||||
{
|
||||
player.Calamity().mouseWorldListener = true;
|
||||
|
||||
if (player.whoAmI == Main.myPlayer)
|
||||
{
|
||||
if (!WulfrumHat.HasArmorSet(player))
|
||||
{
|
||||
Item.TurnToAir();
|
||||
Main.mouseItem = new Item();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void ModifyShootStats(Player player, ref Vector2 position, ref Vector2 velocity, ref int type, ref int damage, ref float knockback)
|
||||
{
|
||||
velocity = velocity.RotatedByRandom(MathHelper.PiOver4 * 0.1f);
|
||||
}
|
||||
|
||||
public void SetItemInHand(Player player, Rectangle heldItemFrame)
|
||||
{
|
||||
//Make the player face where they're aiming.
|
||||
if (player.Calamity().mouseWorld.X > player.Center.X)
|
||||
{
|
||||
player.ChangeDir(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
player.ChangeDir(-1);
|
||||
}
|
||||
|
||||
float animProgress = 1 - player.itemAnimation / (float)player.itemAnimationMax;
|
||||
|
||||
//Default
|
||||
Vector2 itemPosition = player.MountedCenter + new Vector2(-2f * player.direction, -1f * player.gravDir);
|
||||
float itemRotation = (player.Calamity().mouseWorld - itemPosition).ToRotation();
|
||||
|
||||
//Adjust for animation
|
||||
|
||||
if (animProgress < 0.7f)
|
||||
itemPosition -= itemRotation.ToRotationVector2() * (1 - (float)Math.Pow(1 - (0.7f - animProgress) / 0.7f, 4)) * 4f;
|
||||
|
||||
if (animProgress < 0.4f)
|
||||
itemRotation += -0.45f * (float)Math.Pow((0.4f - animProgress) / 0.4f, 2) * player.direction * player.gravDir;
|
||||
|
||||
//Shakezzz
|
||||
if (player.itemTime == 1 && Main.projectile.Any(n => n.active && n.owner == player.whoAmI && n.type == ModContent.ProjectileType<WulfrumManaDrain>()))
|
||||
{
|
||||
itemPosition += Main.rand.NextVector2Circular(2f, 2f);
|
||||
}
|
||||
|
||||
|
||||
Vector2 itemSize = new Vector2(38, 18);
|
||||
Vector2 itemOrigin = new Vector2(-12, 0);
|
||||
CleanHoldStyle(player, itemRotation, itemPosition, itemSize, itemOrigin, true);
|
||||
}
|
||||
|
||||
public override void HoldStyle(Player player, Rectangle heldItemFrame) => SetItemInHand(player, heldItemFrame);
|
||||
public override void UseStyle(Player player, Rectangle heldItemFrame) => SetItemInHand(player, heldItemFrame);
|
||||
public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale) => false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public class WulfrumArmorPlayer : ModPlayer
|
||||
{
|
||||
public static int BastionShootDamage = 10;
|
||||
public static float BastionShootSpeed = 18f;
|
||||
public static int BastionShootTime = 10;
|
||||
|
||||
public bool wulfrumSet = false;
|
||||
|
||||
|
||||
public override void ResetEffects()
|
||||
{
|
||||
wulfrumSet = false;
|
||||
}
|
||||
|
||||
public override void UpdateDead()
|
||||
{
|
||||
wulfrumSet = false;
|
||||
}
|
||||
|
||||
public override void Kill(double damage, int hitDirection, bool pvp, PlayerDeathReason damageSource)
|
||||
{
|
||||
if (WulfrumHat.PowerModeEngaged(Player, out var cd) && Main.netMode != NetmodeID.Server)
|
||||
{
|
||||
for (int i = 1; i < 9; i++)
|
||||
{
|
||||
Vector2 shrapnelVelocity = Main.rand.NextVector2Circular(9f, 9f);
|
||||
string goreType = "WulfrumPowerSuit" + i.ToString();
|
||||
Gore.NewGore(Player.GetSource_Death(), Player.Center, shrapnelVelocity, Mod.Find<ModGore>(goreType).Type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void PostUpdate()
|
||||
{
|
||||
if (wulfrumSet && Player.Calamity().cooldowns.TryGetValue(WulfrumBastion.ID, out var cd) && cd.timeLeft == WulfrumHat.BastionCooldown)
|
||||
{
|
||||
for (int i = 1; i < 9; i++)
|
||||
{
|
||||
Vector2 shrapnelVelocity = Main.rand.NextVector2Circular(9f, 9f);
|
||||
string goreType = "WulfrumPowerSuit" + i.ToString();
|
||||
Gore.NewGore(Player.GetSource_FromThis(), Player.Center, shrapnelVelocity, Mod.Find<ModGore>(goreType).Type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void PostHurt(bool pvp, bool quiet, double damage, int hitDirection, bool crit)
|
||||
{
|
||||
if (WulfrumHat.PowerModeEngaged(Player, out var cd))
|
||||
{
|
||||
cd.timeLeft -= WulfrumHat.TimeLostPerHit;
|
||||
if (cd.timeLeft < WulfrumHat.BastionCooldown)
|
||||
cd.timeLeft = WulfrumHat.BastionCooldown;
|
||||
|
||||
//Gore
|
||||
}
|
||||
}
|
||||
|
||||
public override void PostUpdateMiscEffects()
|
||||
{
|
||||
if (!wulfrumSet && WulfrumHat.PowerModeEngaged(Player, out var cd))
|
||||
{
|
||||
cd.timeLeft = WulfrumHat.BastionCooldown;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ID;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.Audio;
|
||||
using CalamityMod.Items.Materials;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
|
||||
namespace CalamityMod.Items.BaseItems
|
||||
{
|
||||
/// <summary>
|
||||
/// A item that only exists as a held item. Useful if for example, it is used as a mean to temporarily replace the players attack ability.
|
||||
/// </summary>
|
||||
public abstract class HeldOnlyItem : ModItem
|
||||
{
|
||||
public override void Load()
|
||||
{
|
||||
On.Terraria.Player.dropItemCheck += DontDropCoolStuff;
|
||||
On.Terraria.UI.ItemSlot.LeftClick_ItemArray_int_int += LockMouseToSpecialItem;
|
||||
}
|
||||
public override void Unload()
|
||||
{
|
||||
On.Terraria.Player.dropItemCheck -= DontDropCoolStuff;
|
||||
On.Terraria.UI.ItemSlot.LeftClick_ItemArray_int_int -= LockMouseToSpecialItem;
|
||||
}
|
||||
|
||||
public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI) => false;
|
||||
|
||||
public override void PostUpdate()
|
||||
{
|
||||
//Die if in the world
|
||||
Item.type = 0;
|
||||
Item.stack = 0;
|
||||
}
|
||||
|
||||
public override bool CanPickup(Player player) => false;
|
||||
|
||||
|
||||
private void LockMouseToSpecialItem(On.Terraria.UI.ItemSlot.orig_LeftClick_ItemArray_int_int orig, Item[] inv, int context, int slot)
|
||||
{
|
||||
if (!(Main.mouseItem.ModItem is HeldOnlyItem))
|
||||
orig(inv, context, slot);
|
||||
}
|
||||
|
||||
//https://media.discordapp.net/attachments/458432092301295618/993675527539916850/unknown.png
|
||||
private void DontDropCoolStuff(On.Terraria.Player.orig_dropItemCheck orig, Terraria.Player self)
|
||||
{
|
||||
if (!(Main.mouseItem.ModItem is HeldOnlyItem))
|
||||
orig(self);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,10 @@ using Terraria.ModLoader;
|
||||
using Terraria.ID;
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Accessories;
|
||||
using CalamityMod.Items.Armor.Wulfrum;
|
||||
using Terraria.Audio;
|
||||
using CalamityMod.Cooldowns;
|
||||
using static CalamityMod.CalamityUtils;
|
||||
|
||||
namespace CalamityMod.Items.Materials
|
||||
{
|
||||
|
||||
@@ -14,9 +14,8 @@ using static CalamityMod.CalamityUtils;
|
||||
namespace CalamityMod.Items.Weapons.Magic
|
||||
{
|
||||
[LegacyName("WulfrumStaff")]
|
||||
public class WulfrumProthesis : ModItem
|
||||
public class WulfrumProthesis : ModItem, IHideFrontArm
|
||||
{
|
||||
|
||||
public static readonly SoundStyle ShootSound = new("CalamityMod/Sounds/Item/WulfrumProthesisShoot") { PitchVariance = 0.1f, Volume = 0.55f };
|
||||
public static readonly SoundStyle HitSound = new("CalamityMod/Sounds/Item/WulfrumProthesisHit") { PitchVariance = 0.1f, Volume = 0.75f , MaxInstances = 3};
|
||||
public static readonly SoundStyle SuckSound = new("CalamityMod/Sounds/Item/WulfrumProthesisSucc") { Volume = 0.5f };
|
||||
@@ -154,7 +153,8 @@ namespace CalamityMod.Items.Weapons.Magic
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe().
|
||||
AddIngredient<WulfrumMetalScrap>(12).
|
||||
AddIngredient<WulfrumMetalScrap>(10).
|
||||
AddIngredient<EnergyCore>().
|
||||
AddTile(TileID.Anvils).
|
||||
Register();
|
||||
}
|
||||
@@ -164,10 +164,6 @@ namespace CalamityMod.Items.Weapons.Magic
|
||||
{
|
||||
public bool ManaDrainActive = false;
|
||||
|
||||
public override void ResetEffects()
|
||||
{
|
||||
}
|
||||
|
||||
public override void UpdateDead()
|
||||
{
|
||||
ManaDrainActive = false;
|
||||
|
||||
@@ -82,6 +82,7 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
{
|
||||
CreateRecipe().
|
||||
AddIngredient<WulfrumMetalScrap>(12).
|
||||
AddIngredient<EnergyCore>().
|
||||
AddTile(TileID.Anvils).
|
||||
Register();
|
||||
}
|
||||
|
||||