- Buffed Amazon, Anchor, Ball O' Fugu, Breaker Blade, Candy Corn Rifle, Classy Cane, Clockwork Assault Rifle, Cobalt Naginata, Cobalt Repeater, Cobalt Sword, Crackshot Colt, Cutlass, Fates Reveal, Frostbrand, KO Cannon, Orichalcum Repeater, Palladium Repeater, Slag Magnum, Starspawn Helix Staff, The Last Mourning, The Maelstrom, Tundra Flame Blossoms Staff, Unstable Caster's Gauntlet - Nerfed Amber Staff, Bee Keeper, Burnt Sienna, Chain Guillotines, Chlorophyte Partisan, Dart Rifle, Enchanted Boomerang, Enchanted Sword, Meowmere, Muramasa, Swordfish, Thunder Zapper, Veering Wind - Reduced Ark line projectile parry effectiveness to account for the fact most projectiles don't do that much damage anymore - Reverted changes to Starfury stars, now uses the 1.4.4 tile collision style - Caustic Staff dragons spawn less passive dust + reverted shadowflames whoops - Tweaked Face Melter and allowed it to received modifier bonuses on speed (buff) - Applied changes to Marked For Death (effective nerf to Eye of Magnus/buff to Lunic Eye)
81 lines
3.2 KiB
C#
81 lines
3.2 KiB
C#
using System;
|
|
using CalamityMod.Projectiles.Magic;
|
|
using CalamityMod.Rarities;
|
|
using Microsoft.Xna.Framework;
|
|
using Microsoft.Xna.Framework.Graphics;
|
|
using Terraria;
|
|
using Terraria.DataStructures;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Items.Weapons.Magic
|
|
{
|
|
public class FatesReveal : ModItem, ILocalizedModType
|
|
{
|
|
public new string LocalizationCategory => "Items.Weapons.Magic";
|
|
public override void SetStaticDefaults()
|
|
{
|
|
Item.staff[Type] = true;
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
Item.width = 80;
|
|
Item.height = 86;
|
|
Item.damage = 120;
|
|
Item.DamageType = DamageClass.Magic;
|
|
Item.mana = 20;
|
|
Item.useAnimation = Item.useTime = 16;
|
|
Item.useStyle = ItemUseStyleID.Shoot;
|
|
Item.noMelee = true;
|
|
Item.knockBack = 5.5f;
|
|
Item.UseSound = SoundID.Item20;
|
|
Item.autoReuse = true;
|
|
Item.shoot = ModContent.ProjectileType<FatesRevealFlame>();
|
|
Item.shootSpeed = 1f;
|
|
|
|
Item.value = CalamityGlobalItem.RarityPureGreenBuyPrice;
|
|
Item.rare = ModContent.RarityType<PureGreen>();
|
|
}
|
|
|
|
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
|
|
{
|
|
Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.Request<Texture2D>("CalamityMod/Items/Weapons/Magic/FatesRevealGlow").Value);
|
|
}
|
|
|
|
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
|
{
|
|
Vector2 realPlayerPos = player.RotatedRelativePoint(player.MountedCenter, true);
|
|
float mouseXDist = (float)Main.mouseX + Main.screenPosition.X - realPlayerPos.X;
|
|
float mouseYDist = (float)Main.mouseY + Main.screenPosition.Y - realPlayerPos.Y;
|
|
if (player.gravDir == -1f)
|
|
{
|
|
mouseYDist = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - realPlayerPos.Y;
|
|
}
|
|
float mouseDistance = (float)Math.Sqrt((double)(mouseXDist * mouseXDist + mouseYDist * mouseYDist));
|
|
if ((float.IsNaN(mouseXDist) && float.IsNaN(mouseYDist)) || (mouseXDist == 0f && mouseYDist == 0f))
|
|
{
|
|
mouseXDist = (float)player.direction;
|
|
mouseYDist = 0f;
|
|
mouseDistance = Item.shootSpeed;
|
|
}
|
|
else
|
|
{
|
|
mouseDistance = Item.shootSpeed / mouseDistance;
|
|
}
|
|
realPlayerPos += new Vector2(mouseXDist, mouseYDist);
|
|
|
|
int numProjectiles = 6;
|
|
for (int i = 0; i < numProjectiles; i++)
|
|
{
|
|
realPlayerPos.X += (float)Main.rand.Next(-100, 101);
|
|
realPlayerPos.Y += (float)(Main.rand.Next(-25, 26) * i);
|
|
float spawnX = realPlayerPos.X;
|
|
float spawnY = realPlayerPos.Y;
|
|
Projectile.NewProjectile(source, spawnX, spawnY, 0f, 0f, type, damage, knockback, player.whoAmI, 0f, (float)Main.rand.Next(3));
|
|
}
|
|
return false;
|
|
}
|
|
}
|
|
}
|