Files
CalamityModPublic/Items/Weapons/Melee/ExoGladius.cs
T
Ozzatron 72bb69852a 1 - There is now a Utility function to give players immunity frames. Immunity frames should not be given to players any other way.
2 - Gael's Greatsword right click parry removed.
3 - Removed Determination Breaker.
4 - Shield slam iframes normalized. Ornate Shield and Plaguebringer set give 4. Asgard's Valor line gives 6.
5 - Shield of Cthulhu gives 6 iframes and 6 no-collide frames instead of 10 no-collide frames.
6 - Shield of Cthulhu can't cause you to get double-hit anymore.
7 - Calamity-granted iframes will never cause the player to get double-hit.
8 - Solar Flare Armor set bonus now has a base damage of 400. Its spawned explosion now has the same damage and scales with melee stats.
9 - Solar Flare Armor set bonus now gives 12 iframes.
10 - Solar Flare Armor set bonus can't cause you to get double-hit anymore.
11 - Exo Gladius on-hit gives 3 iframes.
12 - Lucrecia (and its projectiles) on-hit give 5 iframes.
13 - Phosphorescent Gauntlet on-hit gives 15 iframes.
14 - Cosmic Plushie explicitly removes all your iframes immediately upon stabbing you.
2021-11-11 18:50:12 -05:00

92 lines
3.4 KiB
C#

using CalamityMod.Items.Materials;
using CalamityMod.Projectiles.Melee;
using CalamityMod.Tiles.Furniture.CraftingStations;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Weapons.Melee
{
public class ExoGladius : ModItem
{
public const int OnHitIFrames = 3;
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Exo Gladius");
Tooltip.SetDefault("Do not underestimate the power of Exoblade's younger brother\n" +
"Striking an enemy with the blade makes you immune for a short time and summons comets from the sky\n" +
"Fires a rainbow orb that summons sword beams on hit");
}
public override void SetDefaults()
{
item.useStyle = ItemUseStyleID.Stabbing;
item.useTurn = false;
item.useAnimation = 12;
item.useTime = 12;
item.width = 56;
item.height = 56;
item.damage = 690;
item.melee = true;
item.knockBack = 9.9f;
item.UseSound = SoundID.Item1;
item.useTurn = true;
item.autoReuse = true;
item.value = CalamityGlobalItem.Rarity15BuyPrice;
item.rare = ItemRarityID.Red;
item.shoot = ModContent.ProjectileType<ExoGladProj>();
item.shootSpeed = 19f;
item.Calamity().customRarity = CalamityRarity.Violet;
}
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
Projectile.NewProjectile(position.X, position.Y, item.shootSpeed * player.direction, 0f, type, damage, knockBack, player.whoAmI);
return false;
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ModContent.ItemType<GalileoGladius>());
recipe.AddIngredient(ModContent.ItemType<CosmicShiv>());
recipe.AddIngredient(ModContent.ItemType<Lucrecia>());
recipe.AddIngredient(ModContent.ItemType<MiracleMatter>());
recipe.AddTile(ModContent.TileType<DraedonsForge>());
recipe.SetResult(this);
recipe.AddRecipe();
}
public override void MeleeEffects(Player player, Rectangle hitbox)
{
if (Main.rand.NextBool(5))
Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 107);
}
public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit)
{
target.ExoDebuffs();
OnHitEffects(player);
}
public override void OnHitPvp(Player player, Player target, int damage, bool crit)
{
target.ExoDebuffs();
OnHitEffects(player);
}
private void OnHitEffects(Player player)
{
player.GiveIFrames(OnHitIFrames, false);
if (player.whoAmI == Main.myPlayer)
{
int damage = player.GetWeaponDamage(player.ActiveItem());
CalamityUtils.ProjectileRain(player.Center, 400f, 100f, 500f, 800f, 25f, ModContent.ProjectileType<ExoGladComet>(), damage, 15f, player.whoAmI);
}
}
}
}