1 - Various things now obey the life steal cooldown and spawn life steal projectiles.

2 - Iridescent Excalibur glowmask.
This commit is contained in:
mountaindrew10 committed 2024-03-20 16:01:41 -05:00
1 parent 16239c22ab
commit bb0e5d43e4
19 files changed
+158 -83

No files matched your search

+2
View File
@@ -14,6 +14,7 @@ namespace CalamityMod.Items.Weapons.Melee
public class EssenceFlayer : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Weapons.Melee";
public override void SetDefaults()
{
Item.width = 100;
@@ -43,6 +44,7 @@ namespace CalamityMod.Items.Weapons.Melee
if (Main.rand.NextBool(3))
{
int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, DustID.ShadowbeamStaff);
Main.dust[dust].velocity *= 0f;
}
}
+7 -1
View File
@@ -6,6 +6,7 @@ using CalamityMod.Projectiles.Melee;
using CalamityMod.Rarities;
using CalamityMod.Tiles.Furniture.CraftingStations;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
@@ -51,6 +52,11 @@ namespace CalamityMod.Items.Weapons.Melee
Item.rare = ModContent.RarityType<Rainbow>();
}
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
{
Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.Request<Texture2D>("CalamityMod/Items/Weapons/Melee/IridescentExcaliburGlow").Value);
}
// Terraria seems to really dislike high crit values in SetDefaults
public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 10;
@@ -101,7 +107,7 @@ namespace CalamityMod.Items.Weapons.Melee
{
if (Main.rand.NextBool())
{
Color rainbowColor = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB);
Color rainbowColor = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB, Alpha);
Color color = Color.White;
int dustChoice = player.altFunctionUse == 2 ? Main.rand.Next(12) : BeamType;
switch (dustChoice)
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

+21 -6
View File
@@ -1,4 +1,5 @@
using System;
using CalamityMod.Balancing;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
@@ -11,8 +12,11 @@ namespace CalamityMod.Projectiles.Healing
public class GladiatorHealOrb : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Healing";
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
public int target = -1;
public override void SetStaticDefaults()
{
ProjectileID.Sets.TrailingMode[Projectile.type] = 0;
@@ -52,6 +56,7 @@ namespace CalamityMod.Projectiles.Healing
}
else HealHome();
}
public void PassiveBehavior()
{
float maxYVelocity = 2f;
@@ -61,28 +66,38 @@ namespace CalamityMod.Projectiles.Healing
Projectile.velocity.Y += 0.02f;
if (Projectile.velocity.Y > maxYVelocity) { Projectile.velocity.Y = maxYVelocity; }
}
public void HealHome()
{
if (Main.player[Main.myPlayer].lifeSteal <= 0f)
{
Projectile.Kill();
return;
}
Player player = Main.player[target];
//Code snippet taken from the HealingProjectile utility, to do what I want with it easier.
Vector2 playerVector = player.Center - Projectile.Center;
float playerDist = playerVector.Length();
if (playerDist < 50f && Projectile.position.X < player.position.X + player.width && Projectile.position.X + Projectile.width > player.position.X && Projectile.position.Y < player.position.Y + player.height && Projectile.position.Y + Projectile.height > player.position.Y)
{
int healAmt = 10;
player.HealEffect(healAmt, false);
player.statLife += healAmt;
int heal = 10;
Main.player[Main.myPlayer].lifeSteal -= heal * BalancingConstants.LifeStealAccessoryCooldownMultiplier;
player.HealEffect(heal, false);
player.statLife += heal;
if (player.statLife > player.statLifeMax2)
{
player.statLife = player.statLifeMax2;
}
SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Custom/OrbHeal", 5) { Volume = 0.15f }, Projectile.Center);
NetMessage.SendData(MessageID.SpiritHeal, -1, -1, null, target, healAmt, 0f, 0f, 0, 0, 0);
NetMessage.SendData(MessageID.SpiritHeal, -1, -1, null, target, heal, 0f, 0f, 0, 0, 0);
Projectile.Kill();
}
Projectile.velocity = (playerVector.SafeNormalize(Vector2.UnitY) * 3.5f) + (player.velocity / 4);
}
public override bool PreDraw(ref Color lightColor)
{
Texture2D lightTexture = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/SmallGreyscaleCircle").Value;
+4 -4
View File
@@ -1,4 +1,5 @@
using System;
using CalamityMod.Balancing;
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Dusts;
using Microsoft.Xna.Framework;
@@ -94,12 +95,11 @@ namespace CalamityMod.Projectiles.Magic
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
if (Main.player[Projectile.owner].moonLeech)
int heal = (int)Math.Round(hit.Damage * 0.025);
if (Main.player[Main.myPlayer].lifeSteal <= 0f || heal <= 0)
return;
Player player = Main.player[Projectile.owner];
player.statLife += 1;
player.HealEffect(1);
CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange);
}
public override bool PreDraw(ref Color lightColor)
+8 -4
View File
@@ -7,6 +7,8 @@ using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.Audio;
using CalamityMod.Balancing;
using System;
namespace CalamityMod.Projectiles.Magic
{
@@ -20,6 +22,7 @@ namespace CalamityMod.Projectiles.Magic
ProjectileID.Sets.TrailCacheLength[Projectile.type] = 20;
ProjectileID.Sets.TrailingMode[Projectile.type] = 2;
}
public override void SetDefaults()
{
Projectile.width = 9;
@@ -88,13 +91,13 @@ namespace CalamityMod.Projectiles.Magic
}
}
if (Main.player[Projectile.owner].moonLeech)
int heal = (int)Math.Round(hit.Damage * 0.05);
if (Main.player[Main.myPlayer].lifeSteal <= 0f || heal <= 0)
return;
Player player = Main.player[Projectile.owner];
player.statLife += 1;
player.HealEffect(1);
CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange);
}
public override void AI()
{
Player Owner = Main.player[Projectile.owner];
@@ -143,6 +146,7 @@ namespace CalamityMod.Projectiles.Magic
}
}
}
public override bool PreDraw(ref Color lightColor)
{
return false;
+6 -6
View File
@@ -1,4 +1,6 @@
using Microsoft.Xna.Framework;
using CalamityMod.Balancing;
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -41,13 +43,11 @@ namespace CalamityMod.Projectiles.Melee
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
Player player = Main.player[Projectile.owner];
if (player.moonLeech)
int heal = (int)Math.Round(hit.Damage * 0.075);
if (Main.player[Main.myPlayer].lifeSteal <= 0f || heal <= 0)
return;
int healAmt = 2;
player.statLife += healAmt;
player.HealEffect(healAmt);
CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange);
}
}
}
@@ -1,4 +1,6 @@
using CalamityMod.Items.Weapons.Melee;
using CalamityMod.Balancing;
using System;
using CalamityMod.Items.Weapons.Melee;
using CalamityMod.Projectiles.BaseProjectiles;
using Terraria;
using Terraria.ID;
@@ -40,12 +42,11 @@ namespace CalamityMod.Projectiles.Melee.Spears
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
if (Main.player[Projectile.owner].moonLeech)
int heal = (int)Math.Round(hit.Damage * 0.01);
if (Main.player[Main.myPlayer].lifeSteal <= 0f || heal <= 0)
return;
Player player = Main.player[Projectile.owner];
player.statLife += 1;
player.HealEffect(1);
CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange);
}
}
}
+9 -7
View File
@@ -1,9 +1,11 @@
using System;
using System.Collections.Generic;
using System.Linq;
using CalamityMod.Balancing;
using CalamityMod.Buffs.StatDebuffs;
using CalamityMod.Graphics.Primitives;
using CalamityMod.Items.Weapons.Melee;
using CalamityMod.Projectiles.Healing;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
@@ -275,13 +277,13 @@ namespace CalamityMod.Projectiles.Melee
#region Hit Effects and Collision
public void OnHitHealEffect()
public void OnHitHealEffect(int damage)
{
if (Owner.moonLeech)
int heal = (int)Math.Round(damage * 0.025);
if (Main.player[Main.myPlayer].lifeSteal <= 0f || heal <= 0)
return;
Owner.statLife += Terratomere.TrueMeleeHitHeal;
Owner.HealEffect(Terratomere.TrueMeleeHitHeal);
CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ModContent.ProjectileType<ReaverHealOrb>(), BalancingConstants.LifeStealRange);
}
public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox)
@@ -295,7 +297,7 @@ namespace CalamityMod.Projectiles.Melee
{
target.AddBuff(ModContent.BuffType<GlacialState>(), Terratomere.TrueMeleeGlacialStateTime);
if (!Owner.moonLeech)
OnHitHealEffect();
OnHitHealEffect(hit.Damage);
// Create a slash creator on top of the hit target.
int slashCreatorID = ModContent.ProjectileType<TerratomereSlashCreator>();
@@ -309,7 +311,7 @@ namespace CalamityMod.Projectiles.Melee
public override void OnHitPlayer(Player target, Player.HurtInfo info)
{
target.AddBuff(ModContent.BuffType<GlacialState>(), Terratomere.TrueMeleeGlacialStateTime);
OnHitHealEffect();
OnHitHealEffect(info.Damage);
}
#endregion Hit Effects and Collision
}
+27 -4
View File
@@ -22,6 +22,7 @@ namespace CalamityMod.Projectiles.Ranged
public bool improvedHeal = false;
public bool setHomingVelocity = false;
public float HomingVelocity = 0.18f;
public override void SetDefaults()
{
Projectile.width = 43;
@@ -36,6 +37,7 @@ namespace CalamityMod.Projectiles.Ranged
Projectile.localNPCHitCooldown = -1;
Projectile.timeLeft = 300;
}
public override void AI()
{
if (Projectile.timeLeft > 220) // Main visual size changes
@@ -56,6 +58,7 @@ namespace CalamityMod.Projectiles.Ranged
BloodParticle blood = new BloodParticle(Projectile.Center, bloodVelocity, bloodLifetime, bloodScale, bloodColor);
GeneralParticleHandler.SpawnParticle(blood);
}
if (Projectile.timeLeft < 296) // The main visual of the projectile and the blood mist it produces before turning around
{
BloodBoilerMetaball2.SpawnParticle(Projectile.Center, particleSize * 2.3f);
@@ -80,6 +83,7 @@ namespace CalamityMod.Projectiles.Ranged
GeneralParticleHandler.SpawnParticle(pulse);
}
}
if (!playedSound)
{
SoundEngine.PlaySound(SoundID.Item34, Projectile.position);
@@ -91,8 +95,10 @@ namespace CalamityMod.Projectiles.Ranged
// A bunch of small things mostly for visuals when the projectile starts turning around before it homes on the player
if (Projectile.timeLeft == 235)
bloodCloudReturn = Projectile.velocity;
if (Projectile.timeLeft <= 235 && Projectile.ai[1] == 0f)
Projectile.velocity *= 0.98f;
if (Projectile.timeLeft == 220)
{
Projectile.velocity = -bloodCloudReturn.RotatedBy(Projectile.ai[2] == 5 ? -0.7f : 0.7f) * 1.2f;
@@ -106,6 +112,7 @@ namespace CalamityMod.Projectiles.Ranged
dust2.scale = Main.rand.NextFloat(1.2f, 2f);
}
}
if (Projectile.timeLeft == 209) // Begin returning to player
{
Projectile.ai[1] = 1f;
@@ -118,6 +125,7 @@ namespace CalamityMod.Projectiles.Ranged
HomingVelocity = Main.rand.NextFloat(0.29f, 0.32f);
setHomingVelocity = true;
}
Projectile.extraUpdates = 5;
bool dustEffect = Main.rand.NextBool(3) ? false : true;
int dustColor = dustEffect ? 296 : 60;
@@ -167,19 +175,33 @@ namespace CalamityMod.Projectiles.Ranged
if (Projectile.velocity.Y > 0f && yDist < 0f)
Projectile.velocity.Y -= HomingVelocity;
}
if (Projectile.timeLeft == 5) // Absolutely make sure the player gets the chance to heal
Projectile.Center = playerCenter;
// Delete the projectile if it touches its owner. Has a chance to heal the player again
if (Main.myPlayer == Projectile.owner)
{
if (Projectile.Hitbox.Intersects(player.Hitbox))
{
if (Main.rand.NextBool(4) && !Main.player[Projectile.owner].moonLeech)
if (!Main.player[Projectile.owner].moonLeech)
{
int bonusHeal = Main.rand.NextBool(3) ? 3 : 2;
player.statLife += improvedHeal ? bonusHeal : 1;
player.HealEffect(improvedHeal ? bonusHeal : 1);
int bonusHeal = Main.rand.NextBool(3) ? 6 : 4;
int heal = improvedHeal ? bonusHeal : 2;
if (Main.player[Main.myPlayer].lifeSteal <= 0f)
{
Projectile.Kill();
return;
}
Main.player[Main.myPlayer].lifeSteal -= heal;
player.statLife += heal;
player.HealEffect(heal);
if (Main.player[Projectile.owner].statLife > Main.player[Projectile.owner].statLifeMax2)
Main.player[Projectile.owner].statLife = Main.player[Projectile.owner].statLifeMax2;
}
Projectile.Kill();
}
}
@@ -191,6 +213,7 @@ namespace CalamityMod.Projectiles.Ranged
target.AddBuff(ModContent.BuffType<BurningBlood>(), 600);
improvedHeal = true;
}
public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers)
{
if (Projectile.numHits > 0)
+2 -4
View File
@@ -1,4 +1,5 @@
using System;
using CalamityMod.Balancing;
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Dusts;
using CalamityMod.Items.Weapons.Ranged;
@@ -110,10 +111,7 @@ namespace CalamityMod.Projectiles.Ranged
bool bonusHeal = Main.rand.NextFloat() < chanceOfOneMoreHP;
int finalHeal = guaranteedHeal + (bonusHeal ? 1 : 0);
if (finalHeal > 0)
{
player.HealEffect(finalHeal);
player.statLife += finalHeal;
}
CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], finalHeal, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange);
}
public override bool PreDraw(ref Color lightColor)
+6 -5
View File
@@ -1,4 +1,6 @@
using CalamityMod.Buffs.DamageOverTime;
using System;
using CalamityMod.Balancing;
using CalamityMod.Buffs.DamageOverTime;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Audio;
@@ -59,12 +61,11 @@ namespace CalamityMod.Projectiles.Ranged
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
Player player = Main.player[Projectile.owner];
if (player.moonLeech)
int heal = (int)Math.Round(hit.Damage * 0.01);
if (Main.player[Main.myPlayer].lifeSteal <= 0f || heal <= 0)
return;
player.statLife += 1;
player.HealEffect(1);
CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange);
}
public override bool PreDraw(ref Color lightColor)
+6 -8
View File
@@ -1,4 +1,6 @@
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Balancing;
using System;
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Dusts;
using Microsoft.Xna.Framework;
using Terraria;
@@ -54,15 +56,11 @@ namespace CalamityMod.Projectiles.Ranged
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
if (Main.player[Projectile.owner].moonLeech)
int heal = (int)Math.Round(hit.Damage * 0.02);
if (Main.player[Main.myPlayer].lifeSteal <= 0f || heal <= 0)
return;
Player player = Main.player[Projectile.owner];
if (Main.rand.NextBool())
{
player.statLife += 1;
player.HealEffect(1);
}
CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange);
}
public override bool PreDraw(ref Color lightColor)
+9 -8
View File
@@ -1,4 +1,6 @@
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Balancing;
using System;
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Projectiles.Melee;
using Microsoft.Xna.Framework;
using Terraria;
@@ -85,15 +87,15 @@ namespace CalamityMod.Projectiles.Rogue
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
OnHitEffects(Main.player[Projectile.owner].moonLeech);
OnHitEffects(hit.Damage);
}
public override void OnHitPlayer(Player target, Player.HurtInfo info)
{
OnHitEffects(Main.player[Projectile.owner].moonLeech);
OnHitEffects(info.Damage);
}
private void OnHitEffects(bool cannotLifesteal)
private void OnHitEffects(int damage)
{
grind += 5; //THE GRIND NEVER STOPS
if (grind > 15)
@@ -112,12 +114,11 @@ namespace CalamityMod.Projectiles.Rogue
}
}
if (cannotLifesteal)
int heal = (int)Math.Round(damage * 0.01);
if (Main.player[Main.myPlayer].lifeSteal <= 0f || heal <= 0)
return;
Player player = Main.player[Projectile.owner];
player.statLife += 1;
player.HealEffect(1);
CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange);
}
public override bool PreDraw(ref Color lightColor) //afterimages
+10 -3
View File
@@ -55,10 +55,17 @@ namespace CalamityMod.Projectiles.Rogue
{
if (!Owner.moonLeech && AbleToHealOwner)
{
int healAmount = Projectile.Calamity().stealthStrike ? 40 : 3;
int heal = Projectile.Calamity().stealthStrike ? 40 : 3;
Owner.HealEffect(healAmount);
Owner.statLife += healAmount;
if (Main.player[Main.myPlayer].lifeSteal <= 0f)
{
Projectile.Kill();
return;
}
Main.player[Main.myPlayer].lifeSteal -= heal;
Owner.HealEffect(heal);
Owner.statLife += heal;
if (Owner.statLife > Owner.statLifeMax2)
Owner.statLife = Owner.statLifeMax2;
}
+12 -8
View File
@@ -1,4 +1,5 @@
using System;
using CalamityMod.Balancing;
using CalamityMod.Graphics.Primitives;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
@@ -126,12 +127,12 @@ namespace CalamityMod.Projectiles.Rogue
if (!Projectile.Calamity().stealthStrike)
return;
if (!Main.player[Projectile.owner].moonLeech)
{
// Give on-heal effects from stealth strikes.
Main.player[Projectile.owner].statLife += 90;
Main.player[Projectile.owner].HealEffect(90);
}
// Give on-heal effects from stealth strikes.
int heal = (int)Math.Round(hit.Damage * 0.01);
if (Main.player[Main.myPlayer].lifeSteal <= 0f || heal <= 0)
return;
CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange);
// And spawn a bloom of bullets.
SpawnOnStealthStrikeBullets();
@@ -145,8 +146,11 @@ namespace CalamityMod.Projectiles.Rogue
return;
// Give on-heal effects from stealth strikes.
Main.player[Projectile.owner].statLife += 120;
Main.player[Projectile.owner].HealEffect(120);
int heal = (int)Math.Round(info.Damage * 0.01);
if (Main.player[Main.myPlayer].lifeSteal <= 0f || heal <= 0)
return;
CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange);
// And spawn a bloom of bullets.
SpawnOnStealthStrikeBullets();
+10 -7
View File
@@ -1,13 +1,15 @@
using Microsoft.Xna.Framework;
using CalamityMod.Balancing;
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Summon
{
public class BloodSpit : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Summon";
public const int OnDeathHealValue = 1;
public Player Owner => Main.player[Projectile.owner];
@@ -39,7 +41,7 @@ namespace CalamityMod.Projectiles.Summon
}
}
public override void OnKill(int timeLeft)
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
for (int i = 0; i < 15; i++)
{
@@ -48,10 +50,11 @@ namespace CalamityMod.Projectiles.Summon
blood.noGravity = true;
}
Owner.HealEffect(OnDeathHealValue, false);
Owner.statLife += OnDeathHealValue;
if (Owner.statLife > Owner.statLifeMax2)
Owner.statLife = Owner.statLifeMax2;
int heal = (int)Math.Round(hit.Damage * 0.01);
if (Main.player[Main.myPlayer].lifeSteal <= 0f || heal <= 0)
return;
CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange);
}
}
}
+10 -2
View File
@@ -11,6 +11,7 @@ namespace CalamityMod.Projectiles.Typeless
public class BlazingStarHeal : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Typeless";
public override string Texture => "CalamityMod/Projectiles/StarProj";
public override void SetDefaults()
@@ -27,6 +28,12 @@ namespace CalamityMod.Projectiles.Typeless
public override void AI()
{
if (Main.player[Main.myPlayer].lifeSteal <= 0f)
{
Projectile.Kill();
return;
}
if (Projectile.timeLeft % 4 == 0) //only once per 4 frames
Lighting.AddLight(Projectile.Center, 0f, 0.6f, 0f);
if (Projectile.timeLeft > 190)
@@ -45,13 +52,14 @@ namespace CalamityMod.Projectiles.Typeless
if (!player.immune && playerDist < 50f && !player.dead && Projectile.position.X < player.position.X + player.width && Projectile.position.X + Projectile.width > player.position.X && Projectile.position.Y < player.position.Y + player.height && Projectile.position.Y + Projectile.height > player.position.Y)
{
int healAmt = Utils.Clamp((200 - Projectile.timeLeft) / 10, 1, 10); //min heal is 5, max heal is 10, achievable after 2 seconds
Main.player[Main.myPlayer].lifeSteal -= healAmt;
player.HealEffect(healAmt, false);
player.statLife += healAmt;
if (player.statLife > player.statLifeMax2)
{
player.statLife = player.statLifeMax2;
}
NetMessage.SendData(MessageID.SpiritHeal, -1, -1, null, index, healAmt);
Projectile.Kill();
}
}
+3 -1
View File
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using CalamityMod.Balancing;
using CalamityMod.Items.VanillaArmorChanges;
using CalamityMod.Projectiles.VanillaProjectileOverrides;
using Microsoft.Xna.Framework;
@@ -49,10 +50,11 @@ namespace CalamityMod.Projectiles.Typeless
foreach (Player player in membersOfSameTeam)
{
if (player.Calamity().ChlorophyteHealDelay > 0)
if (player.Calamity().ChlorophyteHealDelay > 0 || Main.player[Main.myPlayer].lifeSteal <= 0f)
continue;
int healQuantity = (int)owner.GetBestClassDamage().ApplyTo(ChlorophyteArmorSetChange.AmountToHealPerPulse);
Main.player[Main.myPlayer].lifeSteal -= healQuantity * BalancingConstants.LifeStealSetBonusCooldownMultiplier;
player.statLife += healQuantity;
player.HealEffect(healQuantity);
player.Calamity().ChlorophyteHealDelay = ChlorophyteArmorSetChange.DelayBetweenHeals;