1 - Reduced how strict the life steal nerf is on higher difficulties.

2 - Removed the Calamity life steal cap because it's highly unnecessary considering vanilla already has a life steal cap that should be used instead.
3 - Adjusted various life steal things to avoid rounding errors, adjusted how much they influence the cooldown, etc.
4 - Made Monstrous Knives no longer insane.
5 - Made life steal consistent for many sources of it.
6 - Made Tarragon Melee Regen buff consistently apply.
7 - Made Reaver Melee Rage buff consistently apply.
8 - Reduced Reaver Rage buff damage increase from 30% to 10%.
9 - Fixed various life steal projectiles not creating proper dust.
10 - Reaver Melee set reduces movement speed and flight time by 30% instead of 20%.
11 - Removed stupid Tarragon Mage heal cooldown.
This commit is contained in:
mountaindrew10 committed 2024-03-18 15:47:28 -05:00
1 parent c8ae842d91
commit 738240f09e
30 files changed
+216 -472

No files matched your search

+1 -3
View File
@@ -723,7 +723,6 @@ namespace CalamityMod.CalPlayer
public bool tarragonCloak = false;
public int tarraDefenseTime = 600;
public bool tarraMage = false;
public int tarraMageHealCooldown = 0;
public int tarraCrits = 0;
public bool tarraRanged = false;
public int tarraRangedCooldown = 0;
@@ -2280,7 +2279,6 @@ namespace CalamityMod.CalPlayer
silvaMageCooldown = 0;
bloodflareMageCooldown = 0;
tarraRangedCooldown = 0;
tarraMageHealCooldown = 0;
hideOfDeusMeleeBoostTimer = 0;
externalAbyssLight = 0;
externalColdImmunity = externalHeatImmunity = false;
@@ -3586,7 +3584,7 @@ namespace CalamityMod.CalPlayer
{
float duration = Player.lifeSteal;
float baseCooldown = Main.expertMode ? 0.5f : 0.6f;
float lifeStealNerf = BossRushEvent.BossRushActive ? 0.3f : CalamityWorld.death ? 0.25f : CalamityWorld.revenge ? 0.2f : Main.expertMode ? 0.15f : 0.1f;
float lifeStealNerf = BossRushEvent.BossRushActive ? 0.25f : CalamityWorld.death ? 0.2f : CalamityWorld.revenge ? 0.15f : 0.1f;
duration /= baseCooldown - lifeStealNerf;
duration *= -1f;
+2 -4
View File
@@ -2254,8 +2254,7 @@ namespace CalamityMod.CalPlayer
if (tarraMelee)
{
if (Main.rand.NextBool(4))
Player.AddBuff(ModContent.BuffType<TarraLifeRegen>(), 120);
Player.AddBuff(ModContent.BuffType<TarraLifeRegen>(), 120);
}
else if (xerocSet)
{
@@ -2264,8 +2263,7 @@ namespace CalamityMod.CalPlayer
}
else if (reaverDefense)
{
if (Main.rand.NextBool(4))
Player.AddBuff(ModContent.BuffType<ReaverRage>(), 180);
Player.AddBuff(ModContent.BuffType<ReaverRage>(), 180);
}
if ((fBarrier || (aquaticHeart && NPC.downedBoss3)) && !areThereAnyDamnBosses)
+7 -9
View File
@@ -893,11 +893,11 @@ namespace CalamityMod.CalPlayer
// Life Steal nerf
// Reduces Normal Mode life steal recovery rate from 0.6/s to 0.5/s
// Reduces Expert Mode life steal recovery rate from 0.5/s to 0.35/s
// Revengeance Mode recovery rate is 0.3/s
// Death Mode recovery rate is 0.25/s
// Boss Rush recovery rate is 0.2/s
float lifeStealCooldown = BossRushEvent.BossRushActive ? 0.3f : CalamityWorld.death ? 0.25f : CalamityWorld.revenge ? 0.2f : Main.expertMode ? 0.15f : 0.1f;
// Reduces Expert Mode life steal recovery rate from 0.5/s to 0.4/s
// Revengeance Mode recovery rate is 0.35/s
// Death Mode recovery rate is 0.3/s
// Boss Rush recovery rate is 0.25/s
float lifeStealCooldown = BossRushEvent.BossRushActive ? 0.25f : CalamityWorld.death ? 0.2f : CalamityWorld.revenge ? 0.15f : 0.1f;
Player.lifeSteal -= lifeStealCooldown;
// Bool for drawing boss health bar small text or not
@@ -1364,8 +1364,6 @@ namespace CalamityMod.CalPlayer
bloodflareMageCooldown--;
if (silvaMageCooldown > 0)
silvaMageCooldown--;
if (tarraMageHealCooldown > 0)
tarraMageHealCooldown--;
if (scuttlerCooldown > 0)
scuttlerCooldown--;
if (rogueCrownCooldown > 0)
@@ -2497,7 +2495,7 @@ namespace CalamityMod.CalPlayer
if (rRage)
{
Player.GetDamage<GenericDamageClass>() += 0.3f;
Player.GetDamage<GenericDamageClass>() += 0.1f;
Player.statDefense += 5;
}
@@ -2817,7 +2815,7 @@ namespace CalamityMod.CalPlayer
// Reaver Tank set nuke flight time
if (reaverDefense)
flightTimeMult -= 0.2f;
flightTimeMult -= 0.3f;
// Increase wing time
if (Player.wingTimeMax > 0)
+57 -142
View File
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.Linq;
using CalamityMod.Balancing;
using CalamityMod.Buffs.DamageOverTime;
@@ -1130,9 +1131,7 @@ namespace CalamityMod.CalPlayer
if (!target.canGhostHeal)
{
if (Player.ghostHurt)
{
proj.ghostHurt(damage, target.Center, target);
}
if (Player.setNebula && Player.nebulaCD == 0 && Main.rand.NextBool(3))
{
@@ -1143,14 +1142,13 @@ namespace CalamityMod.CalPlayer
ItemID.NebulaPickup2,
ItemID.NebulaPickup3
});
var source = Player.GetSource_Misc("1");
int nebulaBooster = Item.NewItem(source, target.Center, target.Size, boosterType, 1, false, 0, false, false);
Main.item[nebulaBooster].velocity.Y = Main.rand.Next(-20, 1) * 0.2f;
Main.item[nebulaBooster].velocity.X = Main.rand.Next(10, 31) * 0.2f * proj.direction;
if (Main.netMode == NetmodeID.MultiplayerClient)
{
NetMessage.SendData(MessageID.SyncItem, -1, -1, null, nebulaBooster, 0f, 0f, 0f, 0, 0, 0);
}
}
}
@@ -1205,72 +1203,32 @@ namespace CalamityMod.CalPlayer
if (vampiricTalisman && proj.CountsAsClass<RogueDamageClass>() && crit)
{
float heal = MathHelper.Clamp(damage * 0.011f, 0f, 5f);
if ((int)heal > 0)
{
CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Player, heal, ProjectileID.VampireHeal, 1200f, 3f);
float cooldown = heal * 2f;
Main.player[Main.myPlayer].lifeSteal -= cooldown;
}
int heal = (int)Math.Round(damage * 0.011);
if (CalamityGlobalProjectile.CanSpawnLifeStealProjectile(1f, heal))
CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Player, heal, ProjectileID.VampireHeal, 1200f, 6f);
}
if (bloodyGlove && proj.CountsAsClass<RogueDamageClass>() && modProj.stealthStrike)
{
float cooldown = 20;
Player.statLife += 2;
Player.HealEffect(2);
Main.player[Main.myPlayer].lifeSteal -= cooldown;
}
CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Player, 2, ProjectileID.VampireHeal, 1200f, 10f);
if (target.IsAnEnemy(false))
{
if (bloodflareThrowing && proj.CountsAsClass<ThrowingDamageClass>() && crit && Main.rand.NextBool())
{
float projHitMult = 0.03f;
projHitMult -= proj.numHits * 0.015f;
if (projHitMult < 0f)
projHitMult = 0f;
float cooldownMult = damage * projHitMult;
if (cooldownMult < 0f)
cooldownMult = 0f;
if (Player.lifeSteal > 0f)
{
Player.statLife += 1;
Player.HealEffect(1);
Player.lifeSteal -= cooldownMult * 2f;
}
}
if (bloodflareThrowing && proj.CountsAsClass<ThrowingDamageClass>() && crit)
CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Player, 2, ProjectileID.VampireHeal, 1200f, 3f);
if (bloodflareMelee && proj.IsTrueMelee())
{
int healAmount = Main.rand.Next(2) + 1;
Player.statLife += healAmount;
Player.HealEffect(healAmount);
}
CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Player, 2, ProjectileID.VampireHeal, 1200f, 3f);
}
bool otherHealTypes = auricSet || silvaSet || tarraMage || ataxiaMage;
if (proj.CountsAsClass<MagicDamageClass>() && Player.ActiveItem().CountsAsClass<MagicDamageClass>())
{
if (manaOverloader && otherHealTypes)
if (manaOverloader)
{
if (Main.rand.NextBool())
{
float healMult = 0.2f;
healMult -= proj.numHits * 0.05f;
float heal = damage * healMult * (Player.statMana / (float)Player.statManaMax2);
if (heal > CalamityMod.lifeStealCap)
heal = CalamityMod.lifeStealCap;
if (!CalamityGlobalProjectile.CanSpawnLifeStealProjectile(healMult, heal))
return;
CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Player, heal, ProjectileType<ManaPolarizerHealOrb>(), 1200f, 3f);
}
float healMult = 0.2f;
healMult -= proj.numHits * 0.05f;
float heal = damage * healMult * (Player.statMana / (float)Player.statManaMax2);
if (CalamityGlobalProjectile.CanSpawnLifeStealProjectile(healMult, heal))
CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Player, heal, ProjectileType<ManaPolarizerHealOrb>(), 1200f, 4f);
}
}
@@ -1279,71 +1237,26 @@ namespace CalamityMod.CalPlayer
float healMult = 0.03f;
healMult -= proj.numHits * 0.015f;
float heal = damage * healMult;
if (heal > CalamityMod.lifeStealCap)
heal = CalamityMod.lifeStealCap;
if (!CalamityGlobalProjectile.CanSpawnLifeStealProjectile(healMult, heal))
return;
CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Player, heal, ProjectileType<SilvaOrb>(), 1200f, 3f);
if (CalamityGlobalProjectile.CanSpawnLifeStealProjectile(healMult, heal))
CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Player, heal, ProjectileType<SilvaOrb>(), 1200f, 2f);
}
else if (proj.CountsAsClass<MagicDamageClass>() && Player.ActiveItem().CountsAsClass<MagicDamageClass>())
{
if (manaOverloader)
{
float healMult = 0.2f;
healMult -= proj.numHits * 0.05f;
float heal = damage * healMult * (Player.statMana / (float)Player.statManaMax2);
if (heal > CalamityMod.lifeStealCap)
heal = CalamityMod.lifeStealCap;
if (!CalamityGlobalProjectile.CanSpawnLifeStealProjectile(healMult, heal))
return;
CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Player, heal, ProjectileType<ManaPolarizerHealOrb>(), 1200f, 3f);
}
if (tarraMage)
{
if (tarraMageHealCooldown <= 0)
{
tarraMageHealCooldown = 90;
float healMult = 0.1f;
healMult -= proj.numHits * 0.05f;
float heal = damage * healMult;
if (heal > CalamityMod.lifeStealCap)
heal = CalamityMod.lifeStealCap;
if (!CalamityGlobalProjectile.CanSpawnLifeStealProjectile(healMult, heal))
return;
Main.player[Main.myPlayer].lifeSteal -= heal * 6f;
int healAmount = (int)heal;
Player.statLife += healAmount;
Player.HealEffect(healAmount);
if (Player.statLife > Player.statLifeMax2)
Player.statLife = Player.statLifeMax2;
}
float healMult = 0.1f;
healMult -= proj.numHits * 0.05f;
float heal = damage * healMult;
if (CalamityGlobalProjectile.CanSpawnLifeStealProjectile(healMult, heal))
CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Player, heal, ProjectileType<ReaverHealOrb>(), 1200f, 3f);
}
else if (ataxiaMage)
{
float healMult = 0.1f;
healMult -= proj.numHits * 0.05f;
float heal = damage * healMult;
if (heal > CalamityMod.lifeStealCap)
heal = CalamityMod.lifeStealCap;
if (!CalamityGlobalProjectile.CanSpawnLifeStealProjectile(healMult, heal))
return;
CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Player, heal, ProjectileType<HydrothermicHealOrb>(), 1200f, 3f);
if (CalamityGlobalProjectile.CanSpawnLifeStealProjectile(healMult, heal))
CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Player, heal, ProjectileType<HydrothermicHealOrb>(), 1200f, 3f);
}
}
@@ -1352,16 +1265,8 @@ namespace CalamityMod.CalPlayer
float healMult = 0.2f;
healMult -= proj.numHits * 0.05f;
float heal = damage * healMult;
if (heal > CalamityMod.lifeStealCap)
heal = CalamityMod.lifeStealCap;
if (Main.rand.Next(10) > 0)
heal = 0;
if (!CalamityGlobalProjectile.CanSpawnLifeStealProjectile(healMult, heal))
return;
CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Player, heal, ProjectileType<ReaverHealOrb>(), 1200f, 3f);
if (CalamityGlobalProjectile.CanSpawnLifeStealProjectile(healMult, heal))
CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Player, heal, ProjectileType<ReaverHealOrb>(), 1200f, 3f);
}
if (proj.CountsAsClass<ThrowingDamageClass>())
@@ -1371,14 +1276,8 @@ namespace CalamityMod.CalPlayer
float healMult = 0.06f;
healMult -= proj.numHits * 0.015f;
float heal = damage * healMult;
if (heal > CalamityMod.lifeStealCap)
heal = CalamityMod.lifeStealCap;
if (!CalamityGlobalProjectile.CanSpawnLifeStealProjectile(healMult, heal))
return;
CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Player, heal, ProjectileType<EmpyreanHealOrb>(), 1200f, 3f);
if (CalamityGlobalProjectile.CanSpawnLifeStealProjectile(healMult, heal))
CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Player, heal, ProjectileType<EmpyreanHealOrb>(), 1200f, 3f);
}
}
}
@@ -1395,20 +1294,42 @@ namespace CalamityMod.CalPlayer
}
}
if (target.IsAnEnemy(false) && target.canGhostHeal && !Player.moonLeech)
if (bloodflareMelee && item.CountsAsClass<MeleeDamageClass>())
{
if (bloodflareMelee && item.CountsAsClass<MeleeDamageClass>())
if (target.IsAnEnemy(false) && Main.player[Main.myPlayer].lifeSteal > 0f && target.canGhostHeal && !Player.moonLeech)
{
int healAmount = Main.rand.Next(2) + 1;
Player.statLife += healAmount;
Player.HealEffect(healAmount);
int heal = 4;
if ((int)heal > 0 && !Main.player[Main.myPlayer].moonLeech)
{
Main.player[Main.myPlayer].lifeSteal -= heal * 3f;
float lowestHealthCheck = 0f;
int healTarget = Player.whoAmI;
for (int i = 0; i < Main.maxPlayers; i++)
{
Player otherPlayer = Main.player[i];
if (otherPlayer.active && !otherPlayer.dead && ((!Player.hostile && !otherPlayer.hostile) || Player.team == otherPlayer.team))
{
float playerDist = Vector2.Distance(target.Center, otherPlayer.Center);
if (playerDist < 1200f && (otherPlayer.statLifeMax2 - otherPlayer.statLife) > lowestHealthCheck)
{
lowestHealthCheck = otherPlayer.statLifeMax2 - otherPlayer.statLife;
healTarget = i;
}
}
}
// https://github.com/tModLoader/tModLoader/wiki/IEntitySource#detailed-list
var source = Player.GetSource_FromThis(ReaverHeadTank.HealOrbEntitySourceContext);
Projectile.NewProjectile(source, target.Center, Vector2.Zero, ProjectileID.VampireHeal, 0, 0f, Player.whoAmI, healTarget, heal);
}
}
}
if (gladiatorSword && target.IsAnEnemy(false) && target.life <= 0 && target.Calamity().gladiatorOnKill)
{
target.Calamity().gladiatorOnKill = false;
Projectile.NewProjectile(Player.GetSource_FromThis(), target.Center.X, target.Center.Y, target.velocity.X / 2, target.velocity.Y / 2, ModContent.ProjectileType<GladiatorHealOrb>(), 0, 0f);
Projectile.NewProjectile(Player.GetSource_FromThis(), target.Center, target.velocity * 0.5f, ModContent.ProjectileType<GladiatorHealOrb>(), 0, 0f);
}
if (reaverDefense)
@@ -1417,12 +1338,6 @@ namespace CalamityMod.CalPlayer
{
float healMult = 0.2f;
float heal = damage * healMult;
if (heal > CalamityMod.lifeStealCap)
heal = CalamityMod.lifeStealCap;
if (Main.rand.Next(10) > 0)
heal = 0;
if ((int)heal > 0 && !Main.player[Main.myPlayer].moonLeech)
{
Main.player[Main.myPlayer].lifeSteal -= heal * 3f;
-3
View File
@@ -114,9 +114,6 @@ namespace CalamityMod
// Boss Kill Time data structure
public static SortedDictionary<int, int> bossKillTimes;
// Life steal cap
public const int lifeStealCap = 10;
// Speedrun timer
internal static Stopwatch SpeedrunTimer = new Stopwatch();
+2 -2
View File
@@ -38,14 +38,14 @@ namespace CalamityMod.Items.Armor.Reaver
{
var modPlayer = player.Calamity();
player.thorns += 0.33f;
player.moveSpeed -= 0.2f;
player.moveSpeed -= 0.3f;
player.statDefense += 10;
player.lifeRegen += 3;
player.aggro += 600;
modPlayer.reaverDefense = true;
modPlayer.wearingRogueArmor = true;
player.setBonus = this.GetLocalizedValue("SetBonus");
// Reaver Rage provides 30% damage to offset the helm "bonus", 5 def, and 5% melee speed.
// Reaver Rage provides 10% damage, 5 def, and 5% melee speed.
}
public override void UpdateEquip(Player player)
+6 -18
View File
@@ -43,6 +43,7 @@ namespace CalamityMod.Items.Weapons.Melee
{
yDist = Main.screenPosition.Y + Main.screenHeight - Main.mouseY - playerPos.Y;
}
Vector2 vector = new Vector2(xDist, yDist);
float speedMult = vector.Length();
if ((float.IsNaN(xDist) && float.IsNaN(yDist)) || (xDist == 0f && yDist == 0f))
@@ -55,25 +56,11 @@ namespace CalamityMod.Items.Weapons.Melee
{
speedMult = speed / speedMult;
}
xDist *= speedMult;
yDist *= speedMult;
int knifeAmt = 3;
if (Main.rand.NextBool())
{
knifeAmt++;
}
if (Main.rand.NextBool(4))
{
knifeAmt++;
}
if (Main.rand.NextBool(8))
{
knifeAmt++;
}
if (Main.rand.NextBool(16))
{
knifeAmt++;
}
int knifeAmt = Main.rand.Next(4, 7);
for (int i = 0; i < knifeAmt; i++)
{
float xVec = xDist;
@@ -87,8 +74,9 @@ namespace CalamityMod.Items.Weapons.Melee
xVec *= speedMult;
yVec *= speedMult;
directionToShoot = new Vector2(xVec, yVec);
Projectile.NewProjectile(source, playerPos, directionToShoot, type, damage, knockback, player.whoAmI, 0f, 0f);
Projectile.NewProjectile(source, playerPos, directionToShoot, type, damage, knockback, player.whoAmI);
}
return false;
}
@@ -497,10 +497,10 @@ ReaverHeadTank: {
+10 defense and +1.5 HP/s life regen
Enemies are more likely to target you
Reduces the life regen lost from damage over time debuffs by 20%
All attacks have a small chance to steal life and speed up the rate of life regen
20% decreased movement speed and flight time
All attacks steal life and speed up the rate of life regen
30% decreased movement speed and flight time
Enemy damage is reflected and summons a thorn spike
Reaver Rage has a 25% chance to activate when you are damaged
Reaver Rage activates when you are damaged
'''
}
@@ -140,7 +140,7 @@ BloodflareHeadRogue: {
+120 maximum stealth
Being over 80% life boosts your defense by 30 and rogue crit by 5%
Being below 80% life boosts your rogue damage by 10%
Rogue critical strikes have a 50% chance to heal you
Rogue critical strikes heal you
'''
}
@@ -527,7 +527,7 @@ TarragonHeadMelee: {
'''
15% increased melee speed
Enemies are more likely to target you
You have a 25% chance to gain a life regen buff when you take damage
You gain a life regen buff when you take damage
Press {0} to cloak yourself in life energy that heavily reduces enemy contact damage for 10 seconds
This has a 30 second cooldown
'''
+1 -7
View File
@@ -4165,13 +4165,7 @@ namespace CalamityMod.Projectiles
#endregion
#region Life Steal
public static bool CanSpawnLifeStealProjectile(float healMultiplier, float healAmount)
{
if (healMultiplier <= 0f || (int)healAmount <= 0)
return false;
return true;
}
public static bool CanSpawnLifeStealProjectile(float healMultiplier, float healAmount) => healMultiplier > 0f && (int)healAmount > 0;
public static void SpawnLifeStealProjectile(Projectile projectile, Player player, float healAmount, int healProjectileType, float distanceRequired, float cooldownMultiplier)
{
+6 -5
View File
@@ -8,6 +8,7 @@ namespace CalamityMod.Projectiles.Healing
public class EarthHealOrb : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Healing";
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
public override void SetDefaults()
@@ -24,11 +25,11 @@ namespace CalamityMod.Projectiles.Healing
public override void AI()
{
Projectile.HealingProjectile((int)Projectile.ai[1], (int)Projectile.ai[0], 8f, 15f);
int dusty = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, DustID.GreenFairy, 0f, 0f, 100, default, 1f);
Dust dust = Main.dust[dusty];
dust.noGravity = true;
dust.position.X -= Projectile.velocity.X * 0.2f;
dust.position.Y += Projectile.velocity.Y * 0.2f;
int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.GreenFairy, 0f, 0f, 100);
Main.dust[dust].noGravity = true;
Main.dust[dust].velocity *= 0f;
Main.dust[dust].position.X -= Projectile.velocity.X * 0.2f;
Main.dust[dust].position.Y += Projectile.velocity.Y * 0.2f;
}
}
}
+10 -14
View File
@@ -8,30 +8,26 @@ namespace CalamityMod.Projectiles.Healing
public class EmpyreanHealOrb : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Healing";
public override void SetDefaults()
{
Projectile.width = 4;
Projectile.height = 4;
Projectile.width = 12;
Projectile.height = 12;
Projectile.friendly = true;
Projectile.penetrate = 1;
Projectile.tileCollide = false;
Projectile.timeLeft = 240;
Projectile.timeLeft = 300;
Projectile.extraUpdates = 3;
}
public override void AI()
{
Projectile.HealingProjectile((int)Projectile.ai[1], (int)Projectile.ai[0], 5.5f, 15f);
float dustX = Projectile.velocity.X * 0.2f;
float dustY = -(Projectile.velocity.Y * 0.2f);
if (Projectile.timeLeft % 2 == 0)
{
int healDust = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, DustID.PurpleTorch, 0f, 0f, 100, default, 2f);
Dust dust = Main.dust[healDust];
dust.noGravity = true;
dust.position.X -= dustX;
dust.position.Y -= dustY;
}
Projectile.HealingProjectile((int)Projectile.ai[1], (int)Projectile.ai[0], 6f, 15f);
int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.PurpleTorch, 0f, 0f, 100);
Main.dust[dust].noGravity = true;
Main.dust[dust].velocity *= 0f;
Main.dust[dust].position.X -= Projectile.velocity.X * 0.2f;
Main.dust[dust].position.Y += Projectile.velocity.Y * 0.2f;
}
}
}
+6 -5
View File
@@ -8,6 +8,7 @@ namespace CalamityMod.Projectiles.Healing
public class Exoheal : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Healing";
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
public override void SetDefaults()
@@ -24,11 +25,11 @@ namespace CalamityMod.Projectiles.Healing
public override void AI()
{
Projectile.HealingProjectile((int)Projectile.ai[1], (int)Projectile.ai[0], 8f, 15f);
int dusty = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, DustID.TerraBlade, 0f, 0f, 100, new Color(0, 255, 255), 1f);
Dust dust = Main.dust[dusty];
dust.noGravity = true;
dust.position.X -= Projectile.velocity.X * 0.2f;
dust.position.Y += Projectile.velocity.Y * 0.2f;
int dust = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, DustID.TerraBlade, 0f, 0f, 100, new Color(0, 255, 255));
Main.dust[dust].noGravity = true;
Main.dust[dust].velocity *= 0f;
Main.dust[dust].position.X -= Projectile.velocity.X * 0.2f;
Main.dust[dust].position.Y += Projectile.velocity.Y * 0.2f;
}
}
}
+13 -20
View File
@@ -7,35 +7,28 @@ namespace CalamityMod.Projectiles.Healing
public class FungalHeal : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Healing";
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
public override void SetDefaults()
{
Projectile.width = 6;
Projectile.height = 6;
Projectile.alpha = 255;
Projectile.width = 4;
Projectile.height = 4;
Projectile.penetrate = 1;
Projectile.friendly = true;
Projectile.tileCollide = false;
Projectile.extraUpdates = 10;
Projectile.timeLeft = 600;
Projectile.extraUpdates = 3;
Projectile.timeLeft = 300;
}
public override void AI()
{
Projectile.HealingProjectile((int)Projectile.ai[1], (int)Projectile.ai[0], 5f, 15f);
float dustX = Projectile.velocity.X * 0.334f;
float dustY = -(Projectile.velocity.Y * 0.334f);
int fungi = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.BlueFairy, 0f, 0f, 100, default, 0.5f);
Dust dust = Main.dust[fungi];
dust.noGravity = true;
dust.position.X -= dustX;
dust.position.Y -= dustY;
float dustX2 = Projectile.velocity.X * 0.2f;
float dustY2 = -(Projectile.velocity.Y * 0.2f);
int fungi2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.BlueFairy, 0f, 0f, 100, default, 0.7f);
Dust dust2 = Main.dust[fungi2];
dust2.noGravity = true;
dust2.position.X -= dustX2;
dust2.position.Y -= dustY2;
Projectile.HealingProjectile((int)Projectile.ai[1], (int)Projectile.ai[0], 3f, 15f);
int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.BlueFairy, 0f, 0f, 100);
Main.dust[dust].noGravity = true;
Main.dust[dust].velocity *= 0f;
Main.dust[dust].position.X -= Projectile.velocity.X * 0.2f;
Main.dust[dust].position.Y += Projectile.velocity.Y * 0.2f;
}
}
}
+8 -7
View File
@@ -8,6 +8,7 @@ namespace CalamityMod.Projectiles.Healing
public class HydrothermicHealOrb : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Healing";
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
public override void SetDefaults()
@@ -17,18 +18,18 @@ namespace CalamityMod.Projectiles.Healing
Projectile.friendly = true;
Projectile.penetrate = 1;
Projectile.tileCollide = false;
Projectile.timeLeft = 240;
Projectile.timeLeft = 300;
Projectile.extraUpdates = 3;
}
public override void AI()
{
Projectile.HealingProjectile((int)Projectile.ai[1], (int)Projectile.ai[0], 5.5f, 15f);
int dusty = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, DustID.Flare, 0f, 0f, 100, default, 2f);
Dust dust = Main.dust[dusty];
dust.noGravity = true;
dust.position.X -= Projectile.velocity.X * 0.2f;
dust.position.Y += Projectile.velocity.Y * 0.2f;
Projectile.HealingProjectile((int)Projectile.ai[1], (int)Projectile.ai[0], 5f, 15f);
int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.Flare, 0f, 0f, 100);
Main.dust[dust].noGravity = true;
Main.dust[dust].velocity *= 0f;
Main.dust[dust].position.X -= Projectile.velocity.X * 0.2f;
Main.dust[dust].position.Y += Projectile.velocity.Y * 0.2f;
}
}
}
+7 -6
View File
@@ -8,6 +8,7 @@ namespace CalamityMod.Projectiles.Healing
public class ManaPolarizerHealOrb : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Healing";
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
public override void SetDefaults()
@@ -17,18 +18,18 @@ namespace CalamityMod.Projectiles.Healing
Projectile.friendly = true;
Projectile.penetrate = 1;
Projectile.tileCollide = false;
Projectile.timeLeft = 180;
Projectile.timeLeft = 300;
Projectile.extraUpdates = 3;
}
public override void AI()
{
Projectile.HealingProjectile((int)Projectile.ai[1], (int)Projectile.ai[0], 3f, 15f);
int dusty = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, DustID.SpectreStaff, 0f, 0f, 100, default, 1.3f);
Dust dust = Main.dust[dusty];
dust.noGravity = true;
dust.position.X -= Projectile.velocity.X * 0.2f;
dust.position.Y += Projectile.velocity.Y * 0.2f;
int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.SpectreStaff, 0f, 0f, 100);
Main.dust[dust].noGravity = true;
Main.dust[dust].velocity *= 0f;
Main.dust[dust].position.X -= Projectile.velocity.X * 0.2f;
Main.dust[dust].position.Y += Projectile.velocity.Y * 0.2f;
}
}
}
+9 -7
View File
@@ -8,7 +8,9 @@ namespace CalamityMod.Projectiles.Healing
public class ReaverHealOrb : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Healing";
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
public override void SetDefaults()
{
Projectile.width = 4;
@@ -16,18 +18,18 @@ namespace CalamityMod.Projectiles.Healing
Projectile.friendly = true;
Projectile.penetrate = 1;
Projectile.tileCollide = false;
Projectile.timeLeft = 240;
Projectile.timeLeft = 300;
Projectile.extraUpdates = 3;
}
public override void AI()
{
Projectile.HealingProjectile((int)Projectile.ai[1], (int)Projectile.ai[0], 5.5f, 15f);
int dusty = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, DustID.GreenFairy, 0f, 0f, 100, default, 2f);
Dust dust = Main.dust[dusty];
dust.noGravity = true;
dust.position.X -= Projectile.velocity.X * 0.2f;
dust.position.Y += Projectile.velocity.Y * 0.2f;
Projectile.HealingProjectile((int)Projectile.ai[1], (int)Projectile.ai[0], 5f, 15f);
int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.GreenFairy, 0f, 0f, 100);
Main.dust[dust].noGravity = true;
Main.dust[dust].velocity *= 0f;
Main.dust[dust].position.X -= Projectile.velocity.X * 0.2f;
Main.dust[dust].position.Y += Projectile.velocity.Y * 0.2f;
}
}
}
+13 -25
View File
@@ -8,40 +8,28 @@ namespace CalamityMod.Projectiles.Healing
public class RoyalHeal : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Healing";
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
public override void SetDefaults()
{
Projectile.width = 6;
Projectile.height = 6;
Projectile.alpha = 255;
Projectile.width = 4;
Projectile.height = 4;
Projectile.friendly = true;
Projectile.penetrate = 1;
Projectile.timeLeft = 300;
Projectile.tileCollide = false;
Projectile.extraUpdates = 10;
Projectile.extraUpdates = 3;
}
public override void AI()
{
Projectile.HealingProjectile((int)Projectile.ai[1], (int)Projectile.ai[0], 5.5f, 15f);
for (int i = 0; i < 3; i++)
{
float dustX = Projectile.velocity.X * 0.334f * (float)i;
float dustY = -(Projectile.velocity.Y * 0.334f) * (float)i;
int pureHeal = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, DustID.PurificationPowder, 0f, 0f, 100, default, 1.1f);
Dust dust = Main.dust[pureHeal];
dust.noGravity = true;
dust.position.X -= dustX;
dust.position.Y -= dustY;
}
for (int j = 0; j < 5; j++)
{
float dustX2 = Projectile.velocity.X * 0.2f * (float)j;
float dustY2 = -(Projectile.velocity.Y * 0.2f) * (float)j;
int pureHeal2 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, DustID.PurificationPowder, 0f, 0f, 100, default, 1.3f);
Dust dust2 = Main.dust[pureHeal2];
dust2.noGravity = true;
dust2.position.X -= dustX2;
dust2.position.Y -= dustY2;
}
Projectile.HealingProjectile((int)Projectile.ai[1], (int)Projectile.ai[0], 18f, 10f);
int dust = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, DustID.PurificationPowder, 0f, 0f, 100);
Main.dust[dust].noGravity = true;
Main.dust[dust].velocity *= 0f;
Main.dust[dust].position.X -= Projectile.velocity.X * 0.2f;
Main.dust[dust].position.Y += Projectile.velocity.Y * 0.2f;
}
}
}
+4 -11
View File
@@ -8,6 +8,7 @@ namespace CalamityMod.Projectiles.Healing
public class SilvaOrb : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Healing";
public override void SetDefaults()
{
Projectile.width = 22;
@@ -27,36 +28,28 @@ namespace CalamityMod.Projectiles.Healing
{
Projectile.scale += 0.05f;
if (Projectile.scale > 1.2f)
{
Projectile.localAI[0] = 1f;
}
}
else
{
Projectile.scale -= 0.05f;
if (Projectile.scale < 0.8f)
{
Projectile.localAI[0] = 0f;
}
}
Projectile.HealingProjectile((int)Projectile.ai[1], (int)Projectile.ai[0], 6f, 15f);
return;
}
public override Color? GetAlpha(Color lightColor)
{
return new Color(Main.DiscoR, 203, 103, Projectile.alpha);
}
public override Color? GetAlpha(Color lightColor) => new Color(Main.DiscoR, 203, 103, Projectile.alpha);
public override void OnKill(int timeLeft)
{
for (int i = 0; i < 5; i++)
{
int silvaHeal = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, DustID.ChlorophyteWeapon, 0f, 0f, 0, new Color(Main.DiscoR, 203, 103), 1f);
int silvaHeal = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.ChlorophyteWeapon, 0f, 0f, 0, new Color(Main.DiscoR, 203, 103), 1.5f);
Main.dust[silvaHeal].noGravity = true;
Main.dust[silvaHeal].velocity *= 1.5f;
Main.dust[silvaHeal].scale = 1.5f;
Main.dust[silvaHeal].velocity *= 0f;
}
}
}
+13 -22
View File
@@ -8,37 +8,28 @@ namespace CalamityMod.Projectiles.Healing
public class TransfusionTrail : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Healing";
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
public override void SetDefaults()
{
Projectile.width = 6;
Projectile.height = 6;
Projectile.alpha = 255;
Projectile.width = 4;
Projectile.height = 4;
Projectile.penetrate = 1;
Projectile.timeLeft = 300;
Projectile.friendly = true;
Projectile.tileCollide = false;
Projectile.extraUpdates = 10;
Projectile.extraUpdates = 3;
}
public override void AI()
{
Projectile.HealingProjectile((int)Projectile.ai[1], (int)Projectile.ai[0], 6.5f, 15f);
float dustX = Projectile.velocity.X * 0.334f;
float dustY = -(Projectile.velocity.Y * 0.334f);
int healRed = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, DustID.VampireHeal, 0f, 0f, 100, default, 0.7f);
Dust dust = Main.dust[healRed];
dust.noGravity = true;
dust.position.X -= dustX;
dust.position.Y -= dustY;
for (int i = 0; i < 2; i++)
{
float dustyX = Projectile.velocity.X * 0.2f * (float)i;
float dustyY = -(Projectile.velocity.Y * 0.2f) * (float)i;
int healRedMore = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, DustID.VampireHeal, 0f, 0f, 100, default, 0.9f);
Dust dust2 = Main.dust[healRedMore];
dust2.noGravity = true;
dust2.position.X -= dustyX;
dust2.position.Y -= dustyY;
}
Projectile.HealingProjectile((int)Projectile.ai[1], (int)Projectile.ai[0], 5f, 15f);
int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.VampireHeal, 0f, 0f, 100);
Main.dust[dust].noGravity = true;
Main.dust[dust].velocity *= 0f;
Main.dust[dust].position.X -= Projectile.velocity.X * 0.2f;
Main.dust[dust].position.Y += Projectile.velocity.Y * 0.2f;
}
}
}
+3 -9
View File
@@ -94,17 +94,11 @@ namespace CalamityMod.Projectiles.Melee
{
SoundEngine.PlaySound(SoundID.Item4, Projectile.position);
float healAmt = hit.Damage * 0.075f;
if ((int)healAmt == 0)
int heal = (int)Math.Round(hit.Damage * 0.075);
if (Main.player[Main.myPlayer].lifeSteal <= 0f || heal <= 0)
return;
if (Main.player[Main.myPlayer].lifeSteal <= 0f)
return;
if (healAmt > CalamityMod.lifeStealCap)
healAmt = CalamityMod.lifeStealCap;
CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], healAmt, ModContent.ProjectileType<EarthHealOrb>(), 1200f, 3f);
CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ModContent.ProjectileType<EarthHealOrb>(), 1200f, 2f);
}
}
}
+6 -18
View File
@@ -78,32 +78,20 @@ namespace CalamityMod.Projectiles.Melee
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
float healAmt = hit.Damage * 0.0075f;
if ((int)healAmt == 0)
int heal = (int)Math.Round(hit.Damage * 0.0075);
if (Main.player[Main.myPlayer].lifeSteal <= 0f || heal <= 0)
return;
if (Main.player[Main.myPlayer].lifeSteal <= 0f)
return;
if (healAmt > CalamityMod.lifeStealCap)
healAmt = CalamityMod.lifeStealCap;
CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], healAmt, ProjectileID.VampireHeal, 1200f, 3f);
CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ProjectileID.VampireHeal, 1200f, 2f);
}
public override void OnHitPlayer(Player target, Player.HurtInfo info)
{
float healAmt = info.Damage * 0.005f;
if ((int)healAmt == 0)
int heal = (int)Math.Round(info.Damage * 0.015);
if (Main.player[Main.myPlayer].lifeSteal <= 0f || heal <= 0)
return;
if (Main.player[Main.myPlayer].lifeSteal <= 0f)
return;
if (healAmt > CalamityMod.lifeStealCap)
healAmt = CalamityMod.lifeStealCap;
CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], healAmt, ProjectileID.VampireHeal, 1200f, 3f);
CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ProjectileID.VampireHeal, 1200f, 2f);
}
public override bool PreDraw(ref Color lightColor)
+7 -18
View File
@@ -1,6 +1,7 @@
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Projectiles.Healing;
using Microsoft.Xna.Framework;
using System;
using Terraria;
using Terraria.Audio;
using Terraria.ID;
@@ -85,34 +86,22 @@ namespace CalamityMod.Projectiles.Melee
{
target.AddBuff(ModContent.BuffType<MiracleBlight>(), 300);
float healAmt = hit.Damage * 0.01f;
if ((int)healAmt == 0)
int heal = (int)Math.Round(hit.Damage * 0.01);
if (Main.player[Main.myPlayer].lifeSteal <= 0f || heal <= 0)
return;
if (Main.player[Main.myPlayer].lifeSteal <= 0f)
return;
if (healAmt > CalamityMod.lifeStealCap)
healAmt = CalamityMod.lifeStealCap;
CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], healAmt, ModContent.ProjectileType<Exoheal>(), 1200f, 3f);
CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ModContent.ProjectileType<Exoheal>(), 1200f, 2f);
}
public override void OnHitPlayer(Player target, Player.HurtInfo info)
{
target.AddBuff(ModContent.BuffType<MiracleBlight>(), 300);
float healAmt = info.Damage * 0.01f;
if ((int)healAmt == 0)
int heal = (int)Math.Round(info.Damage * 0.01);
if (Main.player[Main.myPlayer].lifeSteal <= 0f || heal <= 0)
return;
if (Main.player[Main.myPlayer].lifeSteal <= 0f)
return;
if (healAmt > CalamityMod.lifeStealCap)
healAmt = CalamityMod.lifeStealCap;
CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], healAmt, ModContent.ProjectileType<Exoheal>(), 1200f, 3f);
CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ModContent.ProjectileType<Exoheal>(), 1200f, 2f);
}
public override bool PreDraw(ref Color lightColor)
+6 -18
View File
@@ -75,34 +75,22 @@ namespace CalamityMod.Projectiles.Melee
{
target.AddBuff(ModContent.BuffType<HolyFlames>(), 180);
float healAmt = hit.Damage * 0.015f;
if ((int)healAmt == 0)
int heal = (int)Math.Round(hit.Damage * 0.015);
if (Main.player[Main.myPlayer].lifeSteal <= 0f || heal <= 0)
return;
if (Main.player[Main.myPlayer].lifeSteal <= 0f)
return;
if (healAmt > CalamityMod.lifeStealCap)
healAmt = CalamityMod.lifeStealCap;
CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], healAmt, ModContent.ProjectileType<RoyalHeal>(), 1200f, 3f);
CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ModContent.ProjectileType<RoyalHeal>(), 1200f, 2f);
}
public override void OnHitPlayer(Player target, Player.HurtInfo info)
{
target.AddBuff(ModContent.BuffType<HolyFlames>(), 180);
float healAmt = info.Damage * 0.015f;
if ((int)healAmt == 0)
int heal = (int)Math.Round(info.Damage * 0.015);
if (Main.player[Main.myPlayer].lifeSteal <= 0f || heal <= 0)
return;
if (Main.player[Main.myPlayer].lifeSteal <= 0f)
return;
if (healAmt > CalamityMod.lifeStealCap)
healAmt = CalamityMod.lifeStealCap;
CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], healAmt, ModContent.ProjectileType<RoyalHeal>(), 1200f, 3f);
CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ModContent.ProjectileType<RoyalHeal>(), 1200f, 2f);
}
public override bool PreDraw(ref Color lightColor)
+6 -32
View File
@@ -48,46 +48,20 @@ namespace CalamityMod.Projectiles.Melee
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
if (Main.myPlayer != Projectile.owner)
int heal = (int)Math.Round(hit.Damage * Main.rand.NextFloat(0.05f, 0.1f));
if (Main.player[Main.myPlayer].lifeSteal <= 0f || heal <= 0)
return;
if (target.lifeMax <= 5 || Main.player[Projectile.owner].moonLeech)
return;
if (Main.player[Projectile.owner].lifeSteal <= 0f)
return;
float healAmt = hit.Damage * Main.rand.NextFloat(0.075f, 0.9f);
if (healAmt < 1f)
healAmt = 1f;
if (healAmt > CalamityMod.lifeStealCap)
healAmt = CalamityMod.lifeStealCap;
if (Main.rand.NextBool(3))
CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], healAmt, ProjectileID.VampireHeal, 1200f, 3f);
CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ProjectileID.VampireHeal, 1200f, 4f);
}
public override void OnHitPlayer(Player target, Player.HurtInfo info)
{
if (Main.myPlayer != Projectile.owner)
int heal = (int)Math.Round(info.Damage * Main.rand.NextFloat(0.05f, 0.1f));
if (Main.player[Main.myPlayer].lifeSteal <= 0f || heal <= 0)
return;
if (Main.player[Projectile.owner].moonLeech)
return;
if (Main.player[Projectile.owner].lifeSteal <= 0f)
return;
float healAmt = info.Damage * Main.rand.NextFloat(0.075f, 0.9f);
if (healAmt < 1f)
healAmt = 1f;
if (healAmt > CalamityMod.lifeStealCap)
healAmt = CalamityMod.lifeStealCap;
if (Main.rand.NextBool(3))
CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], healAmt, ProjectileID.VampireHeal, 1200f, 3f);
CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ProjectileID.VampireHeal, 1200f, 4f);
}
}
}
+5 -13
View File
@@ -1,4 +1,5 @@
using CalamityMod.Projectiles.Healing;
using System;
using CalamityMod.Projectiles.Healing;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
@@ -80,20 +81,11 @@ namespace CalamityMod.Projectiles.Ranged
Main.projectile[proj].scale = (Projectile.ai[1] * 0.5f) + 1f;
}
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;
float healAmt = hit.Damage * 0.05f;
if ((int)healAmt == 0)
return;
if (Main.player[Main.myPlayer].lifeSteal <= 0f)
return;
if (healAmt > CalamityMod.lifeStealCap)
healAmt = CalamityMod.lifeStealCap;
CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], healAmt, ModContent.ProjectileType<TransfusionTrail>(), 1200f, 3f);
CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ModContent.ProjectileType<TransfusionTrail>(), 1200f, 3f);
}
}
}
+4 -16
View File
@@ -70,31 +70,19 @@ namespace CalamityMod.Projectiles.Rogue
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
float heal = hit.Damage * 0.05f;
if ((int)heal == 0)
int heal = (int)Math.Round(hit.Damage * 0.05);
if (Main.player[Main.myPlayer].lifeSteal <= 0f || heal <= 0)
return;
if (Main.player[Main.myPlayer].lifeSteal <= 0f)
return;
if (heal > CalamityMod.lifeStealCap)
heal = CalamityMod.lifeStealCap;
CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ProjectileID.VampireHeal, 1200f, 3f);
}
public override void OnHitPlayer(Player target, Player.HurtInfo info)
{
float heal = info.Damage * 0.05f;
if ((int)heal == 0)
int heal = (int)Math.Round(info.Damage * 0.05);
if (Main.player[Main.myPlayer].lifeSteal <= 0f || heal <= 0)
return;
if (Main.player[Main.myPlayer].lifeSteal <= 0f)
return;
if (heal > CalamityMod.lifeStealCap)
heal = CalamityMod.lifeStealCap;
CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ProjectileID.VampireHeal, 1200f, 3f);
}
}
+4 -16
View File
@@ -77,31 +77,19 @@ namespace CalamityMod.Projectiles.Rogue
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
float heal = hit.Damage * 0.05f;
if ((int)heal == 0)
int heal = (int)Math.Round(hit.Damage * 0.05);
if (Main.player[Main.myPlayer].lifeSteal <= 0f || heal <= 0)
return;
if (Main.player[Main.myPlayer].lifeSteal <= 0f)
return;
if (heal > CalamityMod.lifeStealCap)
heal = CalamityMod.lifeStealCap;
CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ProjectileID.VampireHeal, 1200f, 3f);
}
public override void OnHitPlayer(Player target, Player.HurtInfo info)
{
float heal = info.Damage * 0.05f;
if ((int)heal == 0)
int heal = ((int)Math.Round(info.Damage * 0.05));
if (Main.player[Main.myPlayer].lifeSteal <= 0f || heal <= 0)
return;
if (Main.player[Main.myPlayer].lifeSteal <= 0f)
return;
if (heal > CalamityMod.lifeStealCap)
heal = CalamityMod.lifeStealCap;
CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ProjectileID.VampireHeal, 1200f, 3f);
}
}
+2 -8
View File
@@ -80,16 +80,10 @@ namespace CalamityMod.Projectiles.Rogue
Main.LocalPlayer.AddBuff(ModContent.BuffType<AvertorBonus>(), CalamityUtils.SecondsToFrames(20f), true);
player.AddBuff(ModContent.BuffType<AvertorBonus>(), CalamityUtils.SecondsToFrames(20f), true);
float heal = damage * 0.025f;
if ((int)heal == 0)
int heal = (int)Math.Round(damage * 0.025);
if (Main.player[Main.myPlayer].lifeSteal <= 0f || heal <= 0)
return;
if (Main.player[Main.myPlayer].lifeSteal <= 0f)
return;
if (heal > CalamityMod.lifeStealCap)
heal = CalamityMod.lifeStealCap;
CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, player, heal, ProjectileID.VampireHeal, 1200f, 3f);
}
}
+3 -9
View File
@@ -233,17 +233,11 @@ namespace CalamityMod.Projectiles.Typeless
if (!target.canGhostHeal)
return;
float healAmt = damageDone * 0.25f;
if ((int)healAmt == 0)
int heal = (int)Math.Round(damageDone * 0.25);
if (Main.player[Main.myPlayer].lifeSteal <= 0f || heal <= 0)
return;
if (Main.player[Main.myPlayer].lifeSteal <= 0f)
return;
if (healAmt > CalamityMod.lifeStealCap)
healAmt = CalamityMod.lifeStealCap;
CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], healAmt, ModContent.ProjectileType<FungalHeal>(), 1200f, 3f);
CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ModContent.ProjectileType<FungalHeal>(), 1200f, 4f);
}
public override bool OnTileCollide(Vector2 oldVelocity) => false;