2 - Nerfed Astralachnea Staff damage by 10. 3 - Reduced Miasma clouds per shot from 5 - 8 to 3 - 5, reduced cloud duration from 5 seconds to 4 and buffed damage by 5. 4 - Tried to fix some true melee issues with Devil's Devastation, Forbidden Oathblade and True Forbidden Oathblade. 5 - Fixed some tooltip issues with the DD2 armor changes I made. 6 - Adjusted some Malice Mode AIs again. 7 - Adjusted Cryophobia ice wave duration. 8 - Fixed an issue with Malice Mode Moon Lord Phantasmal Spheres.
68 lines
2.1 KiB
C#
68 lines
2.1 KiB
C#
using CalamityMod.Projectiles.Magic;
|
|
using Microsoft.Xna.Framework;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Items.Weapons.Magic
|
|
{
|
|
public class ApoctosisArray : ModItem
|
|
{
|
|
public override void SetStaticDefaults()
|
|
{
|
|
DisplayName.SetDefault("Apoctosis Array");
|
|
Tooltip.SetDefault("Fires ion blasts that speed up and then explode\n" +
|
|
"Damage scales with how full your mana is\n" +
|
|
"Using Astral Injection reduces the effectiveness of the mana boost");
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
item.damage = 99;
|
|
item.width = 98;
|
|
item.height = 34;
|
|
item.magic = true;
|
|
item.mana = 12;
|
|
item.useAnimation = 7;
|
|
item.useTime = 7;
|
|
item.useStyle = ItemUseStyleID.HoldingOut;
|
|
item.knockBack = 6.75f;
|
|
item.UseSound = SoundID.Item91;
|
|
item.autoReuse = true;
|
|
item.noMelee = true;
|
|
item.value = CalamityGlobalItem.Rarity11BuyPrice;
|
|
item.rare = ItemRarityID.Purple;
|
|
item.shoot = ModContent.ProjectileType<IonBlast>();
|
|
item.shootSpeed = 8f;
|
|
}
|
|
|
|
public override Vector2? HoldoutOffset() => new Vector2(-25, 0);
|
|
|
|
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
|
{
|
|
float manaRatio = (float)player.statMana / player.statManaMax2;
|
|
bool injectionNerf = player.Calamity().astralInjection;
|
|
if (injectionNerf)
|
|
manaRatio = MathHelper.Min(manaRatio, 0.65f);
|
|
|
|
// 20% to 220% damage. Astral Injection caps it at 124% damage.
|
|
float damageRatio = 0.2f + 1.6f * manaRatio;
|
|
int finalDamage = (int)(damage * damageRatio);
|
|
|
|
Projectile proj = Projectile.NewProjectileDirect(position, new Vector2(speedX, speedY), type, finalDamage, knockBack, player.whoAmI);
|
|
proj.scale = 0.75f + 0.75f * manaRatio;
|
|
return false;
|
|
}
|
|
|
|
public override void AddRecipes()
|
|
{
|
|
ModRecipe recipe = new ModRecipe(mod);
|
|
recipe.AddIngredient(ModContent.ItemType<IonBlaster>());
|
|
recipe.AddIngredient(ItemID.LunarBar, 5);
|
|
recipe.AddTile(TileID.LunarCraftingStation);
|
|
recipe.SetResult(this);
|
|
recipe.AddRecipe();
|
|
}
|
|
}
|
|
}
|