Art Attack & Gruesome Eminence
This commit is contained in:
1 parent
8a13c91e23
commit
8a222ff370
4 files changed
+22
-4
No files matched your search
@@ -1,5 +1,6 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Magic;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
@@ -18,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Magic
|
||||
Item.height = 70;
|
||||
Item.damage = 80;
|
||||
Item.DamageType = DamageClass.Magic;
|
||||
Item.mana = 20;
|
||||
Item.mana = 100;
|
||||
Item.useAnimation = Item.useTime = 24;
|
||||
Item.useStyle = ItemUseStyleID.Shoot;
|
||||
Item.noMelee = true;
|
||||
@@ -34,6 +35,13 @@ namespace CalamityMod.Items.Weapons.Magic
|
||||
Item.Calamity().donorItem = true;
|
||||
}
|
||||
|
||||
// Cancels out the mana used to summon the holdout
|
||||
public override void OnConsumeMana(Player player, int manaConsumed)
|
||||
{
|
||||
if (player.ownedProjectileCounts[Item.shoot] <= 0)
|
||||
player.statMana += manaConsumed;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe().
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Magic
|
||||
Item.DamageType = DamageClass.Magic;
|
||||
Item.noUseGraphic = true;
|
||||
Item.channel = true;
|
||||
Item.mana = 400;
|
||||
Item.mana = 30;
|
||||
Item.useTime = 27;
|
||||
Item.useAnimation = 27;
|
||||
Item.useStyle = ItemUseStyleID.Shoot;
|
||||
|
||||
@@ -41,12 +41,12 @@ namespace CalamityMod.Projectiles.Magic
|
||||
int attackType = ModContent.ProjectileType<ArtAttackStar>();
|
||||
if (Owner.ownedProjectileCounts[attackType] == 0)
|
||||
{
|
||||
if (Projectile.ai[0] >= 0f && Owner.CheckMana(Owner.HeldItem, -1, true, false))
|
||||
if (Projectile.ai[0] >= 1f && Owner.CheckMana(Owner.HeldItem, -1, true, false))
|
||||
{
|
||||
SoundEngine.PlaySound(ArtAttack.UseSound, Owner.Center);
|
||||
Vector2 initialStarVelocity = Projectile.velocity.SafeNormalize(Vector2.UnitY) * 15f;
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Owner.ClampedMouseWorld(), initialStarVelocity, attackType, Projectile.damage, Projectile.knockBack, Projectile.owner);
|
||||
Projectile.ai[0] = -24f;
|
||||
Projectile.ai[0] -= Owner.HeldItem.useAnimation;
|
||||
}
|
||||
else
|
||||
Projectile.ai[0]++;
|
||||
|
||||
@@ -133,6 +133,16 @@ namespace CalamityMod.Projectiles.Magic
|
||||
if (Projectile.FinalExtraUpdate())
|
||||
Time++;
|
||||
|
||||
if (Time % 12f == 11f)
|
||||
{
|
||||
if (!Owner.CheckMana(Owner.HeldItem, -1, true))
|
||||
{
|
||||
DeathCounter = 1f;
|
||||
Projectile.netUpdate = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Set the hover offset to a zero vector after enough time has passed and the projectile is powerful/tame enough.
|
||||
bool tame = CurrentPower > 0.97f;
|
||||
if (tame)
|
||||
|
||||
Reference in new issue
Block a user