2 - Counter Scarf is no longer dropped by EoC and is now sold by the Clothier for 10 gold.
64 lines
2.4 KiB
C#
64 lines
2.4 KiB
C#
using CalamityMod.Projectiles.Typeless;
|
|
using Microsoft.Xna.Framework;
|
|
using Terraria;
|
|
using Terraria.ModLoader;
|
|
using Terraria.ID;
|
|
|
|
namespace CalamityMod.Items.Accessories
|
|
{
|
|
public class Gehenna : ModItem
|
|
{
|
|
public const int FireProjectiles = 2;
|
|
public const float FireAngleSpread = 120;
|
|
public int FireCountdown = 0;
|
|
|
|
public override void SetStaticDefaults()
|
|
{
|
|
DisplayName.SetDefault("Gehenna");
|
|
Tooltip.SetDefault("Drops brimstone fireballs from the sky occasionally");
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
item.width = 26;
|
|
item.height = 26;
|
|
item.value = CalamityGlobalItem.Rarity5BuyPrice;
|
|
item.rare = ItemRarityID.Pink;
|
|
item.accessory = true;
|
|
}
|
|
|
|
public override void UpdateAccessory(Player player, bool hideVisual)
|
|
{
|
|
if (FireCountdown == 0)
|
|
{
|
|
FireCountdown = 600;
|
|
}
|
|
if (FireCountdown > 0)
|
|
{
|
|
FireCountdown--;
|
|
if (FireCountdown == 0)
|
|
{
|
|
if (player.whoAmI == Main.myPlayer)
|
|
{
|
|
int speed2 = 25;
|
|
float spawnX = Main.rand.Next(1000) - 500 + player.Center.X;
|
|
float spawnY = -1000 + player.Center.Y;
|
|
Vector2 baseSpawn = new Vector2(spawnX, spawnY);
|
|
Vector2 baseVelocity = player.Center - baseSpawn;
|
|
baseVelocity.Normalize();
|
|
baseVelocity *= speed2;
|
|
for (int i = 0; i < FireProjectiles; i++)
|
|
{
|
|
Vector2 spawn = baseSpawn;
|
|
spawn.X = spawn.X + i * 30 - (FireProjectiles * 15);
|
|
Vector2 velocity = baseVelocity.RotatedBy(MathHelper.ToRadians(-FireAngleSpread / 2 + (FireAngleSpread * i / (float)FireProjectiles)));
|
|
velocity.X = velocity.X + 3 * Main.rand.NextFloat() - 1.5f;
|
|
Projectile.NewProjectile(spawn.X, spawn.Y, velocity.X, velocity.Y, ModContent.ProjectileType<BrimstoneHellfireballFriendly2>(), (int)(54 * player.AverageDamage()), 5f, Main.myPlayer, 0f, 0f);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|