Files
CalamityModPublic/Items/Accessories/EyeoftheStorm.cs
T
Ozzatron 22afdd3933 1 - Calamity sell prices increase much more sharply with rarity.
2 - (Example) Post DoG items are now 2 platinum instead of 1 platinum 40 gold.
3 - (Example) Dev items are now 2 platinum 80 gold instead of 2 platinum.
4 - Privated numeric rarity item values.
5 - All assigned item values use the rarity's names, e.g. RarityLightPurpleBuyPrice.
2024-04-17 21:20:17 -04:00

83 lines
3.4 KiB
C#

using CalamityMod.Buffs.Summon;
using CalamityMod.CalPlayer;
using CalamityMod.Items.Potions.Alcohol;
using CalamityMod.Projectiles.Summon;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Accessories
{
public class EyeoftheStorm : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Accessories";
public override void SetDefaults()
{
Item.width = 20;
Item.height = 26;
Item.value = CalamityGlobalItem.RarityPinkBuyPrice;
Item.rare = ItemRarityID.Pink;
Item.accessory = true;
}
public override bool CanEquipAccessory(Player player, int slot, bool modded)
{
CalamityPlayer modPlayer = player.Calamity();
if (modPlayer.elementalHeart)
{
return false;
}
return true;
}
public override void UpdateAccessory(Player player, bool hideVisual)
{
CalamityPlayer modPlayer = player.Calamity();
modPlayer.cloudWaifu = true;
if (player.whoAmI == Main.myPlayer)
{
if (player.FindBuffIndex(ModContent.BuffType<CloudyWaifu>()) == -1)
{
player.AddBuff(ModContent.BuffType<CloudyWaifu>(), 3600, true);
}
if (player.ownedProjectileCounts[ModContent.ProjectileType<CloudElementalMinion>()] < 1)
{
var source = player.GetSource_Accessory(Item);
// 08DEC2023: Ozzatron: Cloud Elementals spawned with Old Fashioned active will retain their bonus damage indefinitely. Oops. Don't care.
int baseDamage = player.ApplyArmorAccDamageBonusesTo(45);
int damage = (int)player.GetTotalDamage<SummonDamageClass>().ApplyTo(baseDamage);
var p = Projectile.NewProjectileDirect(source, player.Center, -Vector2.UnitY, ModContent.ProjectileType<CloudElementalMinion>(), damage, 2f, Main.myPlayer, 0f, 0f);
p.originalDamage = baseDamage;
}
}
}
public override void UpdateVanity(Player player)
{
CalamityPlayer modPlayer = player.Calamity();
modPlayer.cloudWaifuVanity = true;
if (player.whoAmI == Main.myPlayer)
{
if (player.FindBuffIndex(ModContent.BuffType<CloudyWaifu>()) == -1)
{
player.AddBuff(ModContent.BuffType<CloudyWaifu>(), 3600, true);
}
if (player.ownedProjectileCounts[ModContent.ProjectileType<CloudElementalMinion>()] < 1)
{
var source = player.GetSource_Accessory(Item);
// 08DEC2023: Ozzatron: Cloud Elementals spawned with... Hold on a second. Why the fuck are we doing damage calculations when the accessory is in vanity?!
int baseDamage = 45;
int damage = (int)player.GetTotalDamage<SummonDamageClass>().ApplyTo(baseDamage);
var p = Projectile.NewProjectileDirect(source, player.Center, -Vector2.UnitY, ModContent.ProjectileType<CloudElementalMinion>(), damage, 2f, Main.myPlayer, 0f, 0f);
p.originalDamage = baseDamage;
}
}
}
}
}