Files
CalamityModPublic/Items/Tools/InfernaCutter.cs
T
mountaindrew10 4626974709 1 - Inferna Cutter now inflicts Hellfire instead of On Fire! and no longer inflicts Brimstone Flames.
2 - Mantis Claws now inflict Hellfire.
3 - Vulcanite Lance now inflicts Hellfire instead of On Fire!
4 - Fault Line now inflicts Hellfire instead of On Fire!
5 - Blood Bath now inflicts Burning Blood.
6 - Shaderain Staff no longer inflicts any debuffs.
7 - Icicle Trident no longer inflicts Glacial State.
8 - Infernal Rift now inflicts Hellfire instead of Brimstone Flames.
9 - Vesuvius no longer buffs the player with Molten and now inflicts Hellfire.
10 - Deathhail Staff now inflicts God Slayer Inferno instead of On Fire! and Frostburn.
11 - Divine Retribution no longer inflicts Crush Depth.
12 - Elemental Ray no longer inflicts any debuffs.
13 - Helium Flash no longer inflicts Irradiated.
14 - Ice Barrage no longer inflicts Exo Freeze.
15 - Sanguine Flare no longer inflicts any debuffs.
16 - Soul Piercer now inflicts God Slayer Inferno.
17 - Staff of Blushie now only inflicts Daybroken.
18 - Ultra Liquidator no longer inflicts any debuffs and no longer requires Ichor/Cursed Flames to craft.
19 - Venusian Trident now inflicts Daybroken instead of On Fire!
20 - The Wand now only inflicts Dragonfire.
21 - Gatling Laser no longer inflicts any debuffs.
22 - Ion Blaster no longer inflicts any debuffs.
23 - Lazhar now inflicts Daybroken instead of On Fire!
24 - Aetherflux Cannon now inflicts Holy Flames.
25 - Apoctosis Array no longer inflicts any debuffs.
26 - Plasma Caster no longer inflicts any debuffs.
27 - Purge Guzzler no longer inflicts On Fire!
28 - Death Valley Duster now inflicts Armor Crunch.
29 - Forbidden Sun now inflicts Hellfire instead of On Fire!
30 - Frigidflash Bolt now inflicts Hellfire instead of On Fire!
31 - Poseidon now inflicts Eutrophication.
32 - Primordial Earth now inflicts Armor Crunch.
33 - Seething Discharge now inflicts Brimstone Flames.
34 - Tome of Fates no longer inflicts Brimstone Flames.
35 - Apotheosis no longer inflicts Armor Crunch, Demon Flames and Exo Freeze, but now inflicts Whispering Death.
36 - Augur of the Elements no longer inflicts any debuffs.
37 - Event Horizon no longer inflicts any debuffs.
38 - Nuclear Fury no longer inflicts any debuffs.
39 - Primordial Ancient now inflicts Armor Crunch.
40 - Recitation of the Beast no longer inflicts any debuffs.
41 - Arctic Bear Paw no longer inflicts Confused.
42 - Mad Alchemist's Cocktail Glove no longer inflicts Poisoned, On Fire!, Cursed Inferno, Shadowflame and Frostburn, but now inflicts Electrified and the debuff durations have been doubled.
43 - Yharim's Crystal now inflicts Dragonfire.
2022-12-05 02:47:40 -06:00

151 lines
6.1 KiB
C#

using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Items.Materials;
using CalamityMod.Projectiles.Typeless;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Tools
{
public class InfernaCutter : ModItem
{
public override void SetStaticDefaults()
{
SacrificeTotal = 1;
DisplayName.SetDefault("Inferna Cutter");
Tooltip.SetDefault("Critical hits with the blade cause small explosions\n" +
"Generates a number of small sparks when swung");
}
public override void SetDefaults()
{
Item.damage = 110;
Item.knockBack = 7f;
Item.useTime = 8;
Item.useAnimation = 12;
Item.axe = 135 / 5;
Item.tileBoost += 1;
Item.DamageType = DamageClass.Melee;
Item.width = 80;
Item.height = 66;
Item.useTurn = true;
Item.useStyle = ItemUseStyleID.Swing;
Item.value = Item.buyPrice(0, 36, 0, 0);
Item.rare = ItemRarityID.Pink;
Item.UseSound = SoundID.Item1;
Item.autoReuse = true;
}
// Terraria seems to really dislike high crit values in SetDefaults
public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 10;
public override void UseItemHitbox(Player player, ref Rectangle hitbox, ref bool noHitbox)
{
hitbox = CalamityUtils.FixSwingHitbox(54, 54);
}
public override void AddRecipes()
{
CreateRecipe().
AddIngredient<AxeofPurity>().
AddIngredient(ItemID.SoulofFright, 8).
AddIngredient<EssenceofChaos>(3).
AddTile(TileID.MythrilAnvil).
Register();
}
public override void MeleeEffects(Player player, Rectangle hitbox)
{
if (player.whoAmI == Main.myPlayer)
{
if (player.itemAnimation == (int)(player.itemAnimationMax * 0.1) ||
player.itemAnimation == (int)(player.itemAnimationMax * 0.3) ||
player.itemAnimation == (int)(player.itemAnimationMax * 0.5) ||
player.itemAnimation == (int)(player.itemAnimationMax * 0.7) ||
player.itemAnimation == (int)(player.itemAnimationMax * 0.9))
{
float num339 = 0f;
float num340 = 0f;
float num341 = 0f;
float num342 = 0f;
if (player.itemAnimation == (int)(player.itemAnimationMax * 0.9))
{
num339 = -7f;
}
if (player.itemAnimation == (int)(player.itemAnimationMax * 0.7))
{
num339 = -6f;
num340 = 2f;
}
if (player.itemAnimation == (int)(player.itemAnimationMax * 0.5))
{
num339 = -4f;
num340 = 4f;
}
if (player.itemAnimation == (int)(player.itemAnimationMax * 0.3))
{
num339 = -2f;
num340 = 6f;
}
if (player.itemAnimation == (int)(player.itemAnimationMax * 0.1))
{
num340 = 7f;
}
if (player.itemAnimation == (int)(player.itemAnimationMax * 0.7))
{
num342 = 26f;
}
if (player.itemAnimation == (int)(player.itemAnimationMax * 0.3))
{
num342 -= 4f;
num341 -= 20f;
}
if (player.itemAnimation == (int)(player.itemAnimationMax * 0.1))
{
num341 += 6f;
}
if (player.direction == -1)
{
if (player.itemAnimation == (int)(player.itemAnimationMax * 0.9))
{
num342 -= 8f;
}
if (player.itemAnimation == (int)(player.itemAnimationMax * 0.7))
{
num342 -= 6f;
}
}
num339 *= 1.5f;
num340 *= 1.5f;
num342 *= (float)player.direction;
num341 *= player.gravDir;
var source = player.GetSource_ItemUse(Item);
int damage = (int)player.GetTotalDamage<MeleeDamageClass>().ApplyTo(Item.damage * 0.2f);
int spark = Projectile.NewProjectile(source, (float)(hitbox.X + hitbox.Width / 2) + num342, (float)(hitbox.Y + hitbox.Height / 2) + num341, (float)player.direction * num340, num339 * player.gravDir, ProjectileID.Spark, damage, 0f, player.whoAmI);
if (spark.WithinBounds(Main.maxProjectiles))
Main.projectile[spark].DamageType = DamageClass.Melee;
}
}
if (Main.rand.NextBool(4))
{
int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 6);
}
}
public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit)
{
if (crit)
{
damage /= 2;
var source = player.GetSource_ItemUse(Item);
int boom = Projectile.NewProjectile(source, target.Center, Vector2.Zero, ModContent.ProjectileType<FuckYou>(), damage, knockback, player.whoAmI, 0f, 0.85f + Main.rand.NextFloat() * 1.15f);
if (boom.WithinBounds(Main.maxProjectiles))
Main.projectile[boom].DamageType = DamageClass.Melee;
}
target.AddBuff(BuffID.OnFire3, 300);
}
}
}