Files
CalamityModPublic/Items/Accessories/TheTransformer.cs
T
Xyk 532771061c More Changes/Fixes
-Adjusted the balance on Comet Quasher
-Made it so enemy kills give you blobs with The Transformer, reduced the time needed to collect blobs from the same projectile, and buffed projectile damage slightly
-Gave Monolith Sword a bit or armor pen
-Made it so all players can knock out the impaled blades of others (Oathsword line)
-Fixed a large oversight that made only a single start of dash effect work rather than all of them
-Fixed ambergris dash damage being weaker on the first frame
-Fixed Monolith Sword swing FX appearing on players who are not using it in MP
-Tried to adjusted various MP syncs that didn't work/didn't work well so they do work (definitely not guaranteed to have worked)
-Fixed Ursa Sergeant having no cooldown if you're dead
2025-02-26 16:20:50 -08:00

85 lines
3.2 KiB
C#

using System.Collections.Generic;
using CalamityMod.CalPlayer;
using CalamityMod.Items.Materials;
using CalamityMod.Items.Placeables.SunkenSea;
using CalamityMod.Items.Weapons.Melee;
using CalamityMod.Projectiles.Typeless;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.DataStructures;
using Terraria.GameContent;
using Terraria.ID;
using Terraria.ModLoader;
using static Terraria.ModLoader.ModContent;
namespace CalamityMod.Items.Accessories
{
public class TheTransformer : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Accessories";
public override void ModifyTooltips(List<TooltipLine> list)
{
list.IntegrateHotkey(CalamityKeybinds.TransformerHotKey);
list.FindAndReplace("[GFB]", Lang.SupportGlyphs(this.GetLocalizedValue(Main.zenithWorld ? "TooltipGFB" : "TooltipNormal")));
}
public override void SetStaticDefaults()
{
Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 16));
ItemID.Sets.AnimatesAsSoul[Type] = true;
}
public static int blobCap = 30;
public static int blobDamage = 50;
public override void SetDefaults()
{
Item.width = 42;
Item.height = 56;
Item.value = CalamityGlobalItem.RarityPinkBuyPrice;
Item.rare = ItemRarityID.Pink;
Item.accessory = true;
}
public override void UpdateAccessory(Player player, bool hideVisual)
{
CalamityPlayer modPlayer = player.Calamity();
modPlayer.transformer = true;
modPlayer.transformerVisual = !hideVisual;
if (player.ownedProjectileCounts[ProjectileType<TransformerAura>()] < 1 && !hideVisual && !player.dead && player.Calamity().transformerCooldown == 0)
{
Projectile light = Projectile.NewProjectileDirect(player.GetSource_FromThis(), player.Center, Vector2.Zero, ProjectileType<TransformerAura>(), 0, 0f, player.whoAmI);
}
}
public override void AddRecipes()
{
CreateRecipe().
AddIngredient<SeaPrism>(10).
AddRecipeGroup("AnyMythrilBar", 5).
AddIngredient<EssenceofSunlight>(2).
AddIngredient<EssenceofEleum>(2).
AddIngredient<EssenceofHavoc>(2).
AddIngredient(ItemID.SoulofNight, 3).
AddIngredient(ItemID.SoulofLight, 3).
AddTile(TileID.MythrilAnvil).
Register();
}
public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale)
{
CalamityUtils.DrawInventoryCustomScale(
spriteBatch,
texture: TextureAssets.Item[Type].Value,
position,
frame,
drawColor,
itemColor,
origin,
scale,
wantedScale: 0.95f,
drawOffset: new(0f, 0f)
);
return false;
}
}
}