Files
CalamityModPublic/Items/Weapons/Rogue/RogueWeapon.cs
T
ben-tk feb3baa47b Added new fields to the RogueWeapon abstract class to make modifying stealth strikes simpler
Also doubled the Celestus stealth strike damage modifier but made it only shoot one projectile
2022-10-03 11:32:21 -04:00

37 lines
1.4 KiB
C#

using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ModLoader;
using static Terraria.ID.ContentSamples.CreativeHelper;
namespace CalamityMod.Items.Weapons.Rogue
{
public abstract class RogueWeapon : ModItem
{
public override bool RangedPrefix() => false;
public override void ModifyResearchSorting(ref ItemGroup itemGroup) => itemGroup = (ItemGroup)CalamityResearchSorting.RogueWeapon;
public virtual float StealthDamageMultiplier => 1f;
public virtual float StealthVelocityMultiplier => 1f;
public virtual float StealthKnockbackMultiplier => 1f;
public virtual bool AdditionalStealthCheck() => false;
public override void ModifyShootStats(Player player, ref Vector2 position, ref Vector2 velocity, ref int type, ref int damage, ref float knockback)
{
bool stealthStrike = player.Calamity().StealthStrikeAvailable();
if (stealthStrike || AdditionalStealthCheck())
{
damage = (int)(damage * StealthDamageMultiplier);
velocity = velocity * StealthVelocityMultiplier;
knockback = knockback * StealthKnockbackMultiplier;
}
ModifyStatsExtra(player, ref position, ref velocity, ref type, ref damage, ref knockback);
}
public virtual void ModifyStatsExtra(Player player, ref Vector2 position, ref Vector2 velocity, ref int type, ref int damage, ref float knockback)
{
}
}
}