Files
CalamityModPublic/Items/Accessories/RoseStone.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

82 lines
3.6 KiB
C#

using CalamityMod.Buffs.Summon;
using CalamityMod.CalPlayer;
using CalamityMod.Items.Potions.Alcohol;
using CalamityMod.Projectiles.Summon;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Accessories
{
public class RoseStone : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Accessories";
public override void SetDefaults()
{
Item.width = 20;
Item.height = 20;
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.brimstoneWaifu = true;
if (player.whoAmI == Main.myPlayer)
{
var source = player.GetSource_Accessory(Item);
if (player.FindBuffIndex(ModContent.BuffType<BrimstoneWaifu>()) == -1)
{
player.AddBuff(ModContent.BuffType<BrimstoneWaifu>(), 3600, true);
}
if (player.ownedProjectileCounts[ModContent.ProjectileType<BrimstoneElementalMinion>()] < 1)
{
// 08DEC2023: Ozzatron: Brimstone Elementals spawned with Old Fashioned active will retain their bonus damage indefinitely. Oops. Don't care.
int baseDamage = player.ApplyArmorAccDamageBonusesTo(60);
int damage = (int)player.GetTotalDamage<SummonDamageClass>().ApplyTo(baseDamage);
int p = Projectile.NewProjectile(source, player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType<BrimstoneElementalMinion>(), damage, 2f, Main.myPlayer, 0f, 0f);
if (Main.projectile.IndexInRange(p))
Main.projectile[p].originalDamage = baseDamage;
}
}
}
public override void UpdateVanity(Player player)
{
CalamityPlayer modPlayer = player.Calamity();
modPlayer.brimstoneWaifuVanity = true;
if (player.whoAmI == Main.myPlayer)
{
var source = player.GetSource_Accessory(Item);
if (player.FindBuffIndex(ModContent.BuffType<BrimstoneWaifu>()) == -1)
{
player.AddBuff(ModContent.BuffType<BrimstoneWaifu>(), 3600, true);
}
if (player.ownedProjectileCounts[ModContent.ProjectileType<BrimstoneElementalMinion>()] < 1)
{
// 08DEC2023: Ozzatron: Brimstone Elementals spawned with... Hold on a second. Why the fuck are we doing damage calculations when the accessory is in vanity?!
int baseDamage = player.ApplyArmorAccDamageBonusesTo(60);
int damage = (int)player.GetTotalDamage<SummonDamageClass>().ApplyTo(baseDamage);
int p = Projectile.NewProjectile(source, player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType<BrimstoneElementalMinion>(), damage, 2f, Main.myPlayer, 0f, 0f);
if (Main.projectile.IndexInRange(p))
Main.projectile[p].originalDamage = baseDamage;
}
}
}
}
}