Error fixes...guh...
This commit is contained in:
1 parent
b1367d7ae1
commit
7231789cee
57 files changed
+119
-133
No files matched your search
@@ -831,11 +831,9 @@ namespace CalamityMod.NPCs.ExoMechs
|
||||
// Always instantly kill Draedon when he's vulnerable
|
||||
public override void ModifyIncomingHit(ref NPC.HitModifiers modifiers)
|
||||
{
|
||||
damage *= 56D;
|
||||
if (damage < NPC.lifeMax)
|
||||
damage = NPC.lifeMax + Main.rand.NextFloat(50f, 750f);
|
||||
crit = true;
|
||||
return true;
|
||||
modifiers.SourceDamage *= 56f;
|
||||
modifiers.SourceDamage += NPC.lifeMax + Main.rand.NextFloat(50f, 750f);
|
||||
modifiers.SetCrit();
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
|
||||
|
||||
@@ -549,9 +549,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
|
||||
public override void ModifyIncomingHit(ref NPC.HitModifiers modifiers)
|
||||
{
|
||||
if (NPC.Calamity().newAI[2] < ThanatosHead.immunityTime)
|
||||
damage *= 0.01;
|
||||
|
||||
return true;
|
||||
modifiers.SourceDamage *= 0.01f;
|
||||
}
|
||||
|
||||
public override void FindFrame(int frameHeight) // 5 total frames
|
||||
|
||||
@@ -550,9 +550,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
|
||||
public override void ModifyIncomingHit(ref NPC.HitModifiers modifiers)
|
||||
{
|
||||
if (NPC.Calamity().newAI[2] < ThanatosHead.immunityTime)
|
||||
damage *= 0.01;
|
||||
|
||||
return true;
|
||||
modifiers.SourceDamage *= 0.01f;
|
||||
}
|
||||
|
||||
public override void FindFrame(int frameHeight) // 5 total frames
|
||||
|
||||
@@ -1052,9 +1052,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
|
||||
public override void ModifyIncomingHit(ref NPC.HitModifiers modifiers)
|
||||
{
|
||||
if (NPC.localAI[3] < immunityTime)
|
||||
damage *= 0.01;
|
||||
|
||||
return true;
|
||||
modifiers.SourceDamage *= 0.01f;
|
||||
}
|
||||
|
||||
public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position)
|
||||
|
||||
@@ -550,9 +550,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
|
||||
public override void ModifyIncomingHit(ref NPC.HitModifiers modifiers)
|
||||
{
|
||||
if (NPC.Calamity().newAI[2] < ThanatosHead.immunityTime)
|
||||
damage *= 0.01;
|
||||
|
||||
return true;
|
||||
modifiers.SourceDamage *= 0.01f;
|
||||
}
|
||||
|
||||
public override void FindFrame(int frameHeight) // 5 total frames
|
||||
|
||||
@@ -1030,13 +1030,12 @@ namespace CalamityMod.NPCs.HiveMind
|
||||
|
||||
public override void ModifyIncomingHit(ref NPC.HitModifiers modifiers)
|
||||
{
|
||||
if (phase2timer < 0 && damage > 1)
|
||||
if (phase2timer < 0)
|
||||
{
|
||||
NPC.velocity *= -4f;
|
||||
ReelBack();
|
||||
NPC.netUpdate = true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment)
|
||||
|
||||
@@ -908,11 +908,11 @@ namespace CalamityMod.NPCs.ProfanedGuardians
|
||||
{
|
||||
if (projectile.penetrate <= -1 || projectile.penetrate > 5)
|
||||
{
|
||||
damage = (int)(damage * 2.5f);
|
||||
modifiers.SourceDamage *= 2.5f;
|
||||
}
|
||||
else
|
||||
{
|
||||
damage *= projectile.penetrate / 2;
|
||||
modifiers.SourceDamage *= projectile.penetrate / 2f;
|
||||
}
|
||||
projectile.active = false;
|
||||
}
|
||||
|
||||
@@ -56,9 +56,9 @@ namespace CalamityMod.NPCs.Ravager
|
||||
|
||||
if (CalamityGlobalNPC.scavenger < 0 || !Main.npc[CalamityGlobalNPC.scavenger].active)
|
||||
{
|
||||
NPC.life = 0;
|
||||
HitEffect(NPC.direction, 9999);
|
||||
NPC.netUpdate = true;
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
NPC.StrikeInstantKill();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -129,9 +129,8 @@ namespace CalamityMod.NPCs.Ravager
|
||||
}
|
||||
else
|
||||
{
|
||||
NPC.life = 0;
|
||||
HitEffect(NPC.direction, 9999);
|
||||
NPC.netUpdate = true;
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
NPC.StrikeInstantKill();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,10 +58,9 @@ namespace CalamityMod.NPCs.Ravager
|
||||
{
|
||||
if (CalamityGlobalNPC.scavenger < 0 || !Main.npc[CalamityGlobalNPC.scavenger].active)
|
||||
{
|
||||
NPC.life = 0;
|
||||
NPC.HitEffect();
|
||||
NPC.active = false;
|
||||
NPC.netUpdate = true;
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
NPC.StrikeInstantKill();
|
||||
|
||||
return;
|
||||
}
|
||||
bool death = CalamityWorld.death || BossRushEvent.BossRushActive;
|
||||
|
||||
@@ -59,10 +59,9 @@ namespace CalamityMod.NPCs.Ravager
|
||||
//Main.NewText(NPC.ai[0]);
|
||||
if (CalamityGlobalNPC.scavenger < 0 || !Main.npc[CalamityGlobalNPC.scavenger].active)
|
||||
{
|
||||
NPC.life = 0;
|
||||
NPC.HitEffect();
|
||||
NPC.active = false;
|
||||
NPC.netUpdate = true;
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
NPC.StrikeInstantKill();
|
||||
|
||||
return;
|
||||
}
|
||||
bool death = CalamityWorld.death || BossRushEvent.BossRushActive;
|
||||
|
||||
@@ -55,10 +55,9 @@ namespace CalamityMod.NPCs.Ravager
|
||||
{
|
||||
if (CalamityGlobalNPC.scavenger < 0 || !Main.npc[CalamityGlobalNPC.scavenger].active)
|
||||
{
|
||||
NPC.life = 0;
|
||||
NPC.HitEffect();
|
||||
NPC.active = false;
|
||||
NPC.netUpdate = true;
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
NPC.StrikeInstantKill();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -54,9 +54,9 @@ namespace CalamityMod.NPCs.Ravager
|
||||
{
|
||||
if (CalamityGlobalNPC.scavenger < 0 || !Main.npc[CalamityGlobalNPC.scavenger].active)
|
||||
{
|
||||
NPC.life = 0;
|
||||
HitEffect(NPC.direction, 9999);
|
||||
NPC.netUpdate = true;
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
NPC.StrikeInstantKill();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -51,10 +51,9 @@ namespace CalamityMod.NPCs.Ravager
|
||||
{
|
||||
if (CalamityGlobalNPC.scavenger < 0 || !Main.npc[CalamityGlobalNPC.scavenger].active)
|
||||
{
|
||||
NPC.life = 0;
|
||||
NPC.HitEffect();
|
||||
NPC.active = false;
|
||||
NPC.netUpdate = true;
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
NPC.StrikeInstantKill();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -51,10 +51,9 @@ namespace CalamityMod.NPCs.Ravager
|
||||
{
|
||||
if (CalamityGlobalNPC.scavenger < 0 || !Main.npc[CalamityGlobalNPC.scavenger].active)
|
||||
{
|
||||
NPC.life = 0;
|
||||
NPC.HitEffect();
|
||||
NPC.active = false;
|
||||
NPC.netUpdate = true;
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
NPC.StrikeInstantKill();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -43,9 +43,9 @@ namespace CalamityMod.NPCs.Ravager
|
||||
{
|
||||
if (CalamityGlobalNPC.scavenger < 0 || !Main.npc[CalamityGlobalNPC.scavenger].active)
|
||||
{
|
||||
NPC.life = 0;
|
||||
HitEffect(NPC.direction, 9999);
|
||||
NPC.netUpdate = true;
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
NPC.StrikeInstantKill();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -109,9 +109,10 @@ namespace CalamityMod.NPCs.Ravager
|
||||
{
|
||||
SoundEngine.PlaySound(SoundID.Item14, NPC.Center);
|
||||
NPC.ai[0] = 0f;
|
||||
NPC.life = 0;
|
||||
HitEffect(NPC.direction, 9999);
|
||||
NPC.netUpdate = true;
|
||||
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
NPC.StrikeInstantKill();
|
||||
|
||||
return;
|
||||
}
|
||||
else
|
||||
@@ -134,9 +135,9 @@ namespace CalamityMod.NPCs.Ravager
|
||||
target.AddBuff(ModContent.BuffType<ArmorCrunch>(), 240, true);
|
||||
SoundEngine.PlaySound(SoundID.Item14, NPC.Center);
|
||||
NPC.ai[0] = 0f;
|
||||
NPC.life = 0;
|
||||
HitEffect(NPC.direction, 9999);
|
||||
NPC.netUpdate = true;
|
||||
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
NPC.StrikeInstantKill();
|
||||
}
|
||||
|
||||
public override void HitEffect(NPC.HitInfo hit)
|
||||
|
||||
@@ -63,10 +63,9 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
{
|
||||
if (CalamityGlobalNPC.SCal < 0 || !Main.npc[CalamityGlobalNPC.SCal].active)
|
||||
{
|
||||
NPC.life = 0;
|
||||
NPC.HitEffect();
|
||||
NPC.active = false;
|
||||
NPC.netUpdate = true;
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
NPC.StrikeInstantKill();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -164,7 +163,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
public override void ModifyHitByProjectile(Projectile projectile, ref NPC.HitModifiers modifiers)
|
||||
{
|
||||
if (projectile.type == ModContent.ProjectileType<CelestusMiniScythe>())
|
||||
damage = (int)(damage * 0.66);
|
||||
modifiers.SourceDamage *= 0.66f;
|
||||
}
|
||||
|
||||
public override bool CheckActive() => false;
|
||||
|
||||
@@ -98,9 +98,10 @@ namespace CalamityMod.Projectiles.Magic
|
||||
// TODO -- this damage should be after Terraria vanilla multipliers, so it won't one shot people
|
||||
public override void ModifyHitPlayer(Player target, ref Player.HurtModifiers modifiers)
|
||||
{
|
||||
if (Main.masterMode) damage = 540;
|
||||
else if (Main.expertMode) damage = 450;
|
||||
else damage = 360;
|
||||
modifiers.SourceDamage *= 0f;
|
||||
if (Main.masterMode) modifiers.SourceDamage += 540f;
|
||||
else if (Main.expertMode) modifiers.SourceDamage += 450f;
|
||||
else modifiers.SourceDamage += 360f;
|
||||
}
|
||||
|
||||
public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType<VulnerabilityHex>(), 180);
|
||||
|
||||
@@ -140,9 +140,10 @@ namespace CalamityMod.Projectiles.Magic
|
||||
{
|
||||
if (Projectile.friendly)
|
||||
{
|
||||
if (Main.masterMode) damage = 450;
|
||||
else if (Main.expertMode) damage = 375;
|
||||
else damage = 300;
|
||||
modifiers.SourceDamage *= 0f;
|
||||
if (Main.masterMode) modifiers.SourceDamage += 450f;
|
||||
else if (Main.expertMode) modifiers.SourceDamage += 375f;
|
||||
else modifiers.SourceDamage += 300f;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -73,8 +73,8 @@ namespace CalamityMod.Projectiles.Magic
|
||||
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
|
||||
{
|
||||
int type = ModContent.ProjectileType<FuckYou>();
|
||||
int boomDamage = (int)(damage * 1.1);
|
||||
int boom = Projectile.NewProjectile(Projectile.GetSource_FromThis(), target.Center, Vector2.Zero, type, boomDamage, knockback, Projectile.owner, 0f, Main.rand.NextFloat(0.85f, 2f));
|
||||
int boomDamage = (int)(hit.Damage * 1.1);
|
||||
int boom = Projectile.NewProjectile(Projectile.GetSource_FromThis(), target.Center, Vector2.Zero, type, boomDamage, hit.Knockback, Projectile.owner, 0f, Main.rand.NextFloat(0.85f, 2f));
|
||||
Main.projectile[boom].DamageType = DamageClass.Magic;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,12 +70,12 @@ namespace CalamityMod.Projectiles.Magic
|
||||
float spawnOffsetSpread = Main.rand.NextFloat(MathHelper.ToRadians(36f), MathHelper.ToRadians(64f));
|
||||
float baseOffsetAngle = Main.rand.NextFloat(-0.6f, 0.6f);
|
||||
int type = ModContent.ProjectileType<BeamStar>();
|
||||
damage = (int)(Projectile.damage * 0.7);
|
||||
hit.Damage = (int)(Projectile.damage * 0.7);
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
float spawnOffsetAngle = MathHelper.Lerp(spawnOffsetSpread * -0.5f, spawnOffsetSpread * 0.5f, i / 4f) + baseOffsetAngle;
|
||||
Vector2 spawnPosition = target.Top - Vector2.UnitY.RotatedBy(spawnOffsetAngle) * 65f;
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), spawnPosition, -Vector2.UnitY.RotatedBy(spawnOffsetAngle) * 2f, type, damage, knockback, Projectile.owner);
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), spawnPosition, -Vector2.UnitY.RotatedBy(spawnOffsetAngle) * 2f, type, hit.Damage, hit.Knockback, Projectile.owner);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -236,7 +236,7 @@ namespace CalamityMod.Projectiles.Melee
|
||||
public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers)
|
||||
{
|
||||
//Add some damage falloff
|
||||
modifiers.SourceDamage *= Math.Pow(1 - ArkoftheCosmos.blastFalloffStrenght, Projectile.numHits * ArkoftheCosmos.blastFalloffSpeed);
|
||||
modifiers.SourceDamage *= (float)Math.Pow(1 - ArkoftheCosmos.blastFalloffStrenght, Projectile.numHits * ArkoftheCosmos.blastFalloffSpeed);
|
||||
}
|
||||
|
||||
public override void Kill(int timeLeft)
|
||||
|
||||
@@ -163,7 +163,7 @@ namespace CalamityMod.Projectiles.Melee
|
||||
public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers)
|
||||
{
|
||||
//Add some damage falloff
|
||||
modifiers.SourceDamage *= Math.Pow(1 - ArkoftheElements.blastFalloffStrenght, Projectile.numHits * ArkoftheElements.blastFalloffSpeed);
|
||||
modifiers.SourceDamage *= (float)Math.Pow(1 - ArkoftheElements.blastFalloffStrenght, Projectile.numHits * ArkoftheElements.blastFalloffSpeed);
|
||||
}
|
||||
|
||||
//Animation keys
|
||||
|
||||
@@ -67,7 +67,7 @@ namespace CalamityMod.Projectiles.Melee
|
||||
target.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 180);
|
||||
if (Main.myPlayer == Projectile.owner && Projectile.numHits == 0)
|
||||
{
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), target.Center, Vector2.Zero, ModContent.ProjectileType<BrimstoneSwordExplosion>(), (int)(Projectile.damage * 0.5), knockback, Projectile.owner);
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), target.Center, Vector2.Zero, ModContent.ProjectileType<BrimstoneSwordExplosion>(), (int)(Projectile.damage * 0.5), hit.Knockback, Projectile.owner);
|
||||
}
|
||||
if (Projectile.damage > 1)
|
||||
Projectile.damage = (int)(Projectile.damage * 0.6);
|
||||
|
||||
@@ -98,7 +98,7 @@ namespace CalamityMod.Projectiles.Melee
|
||||
{
|
||||
SoundEngine.PlaySound(SoundID.Item4, Projectile.position);
|
||||
|
||||
float healAmt = damage * 0.075f;
|
||||
float healAmt = hit.Damage * 0.075f;
|
||||
if ((int)healAmt == 0)
|
||||
return;
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ namespace CalamityMod.Projectiles.Melee
|
||||
|
||||
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
|
||||
{
|
||||
float healAmt = damage * 0.005f;
|
||||
float healAmt = hit.Damage * 0.005f;
|
||||
if ((int)healAmt == 0)
|
||||
return;
|
||||
|
||||
@@ -93,7 +93,7 @@ namespace CalamityMod.Projectiles.Melee
|
||||
|
||||
public override void OnHitPlayer(Player target, Player.HurtInfo info)
|
||||
{
|
||||
float healAmt = damage * 0.005f;
|
||||
float healAmt = info.Damage * 0.005f;
|
||||
if ((int)healAmt == 0)
|
||||
return;
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ namespace CalamityMod.Projectiles.Melee
|
||||
{
|
||||
target.AddBuff(ModContent.BuffType<MiracleBlight>(), 300);
|
||||
|
||||
float healAmt = damage * 0.01f;
|
||||
float healAmt = hit.Damage * 0.01f;
|
||||
if ((int)healAmt == 0)
|
||||
return;
|
||||
|
||||
@@ -103,7 +103,7 @@ namespace CalamityMod.Projectiles.Melee
|
||||
{
|
||||
target.AddBuff(ModContent.BuffType<MiracleBlight>(), 300);
|
||||
|
||||
float healAmt = damage * 0.01f;
|
||||
float healAmt = info.Damage * 0.01f;
|
||||
if ((int)healAmt == 0)
|
||||
return;
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ namespace CalamityMod.Projectiles.Melee
|
||||
NPC potentialTarget = TargetNext(target.Center, i);
|
||||
if (potentialTarget == null)
|
||||
break;
|
||||
Projectile proj = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), target.Center, target.SafeDirectionTo(potentialTarget.Center, Vector2.Zero) * 25f, ProjectileType<GalaxiaBolt>(), (int)(damage * FourSeasonsGalaxia.AriesAttunement_OnHitBoltDamageReduction), 0, Owner.whoAmI, 0.9f, MathHelper.PiOver4 * 0.4f);
|
||||
Projectile proj = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), target.Center, target.SafeDirectionTo(potentialTarget.Center, Vector2.Zero) * 25f, ProjectileType<GalaxiaBolt>(), (int)(hit.Damage * FourSeasonsGalaxia.AriesAttunement_OnHitBoltDamageReduction), 0, Owner.whoAmI, 0.9f, MathHelper.PiOver4 * 0.4f);
|
||||
proj.scale = 2f;
|
||||
}
|
||||
Array.Clear(excludedTargets, 0, 3);
|
||||
|
||||
@@ -56,13 +56,13 @@ namespace CalamityMod.Projectiles.Melee
|
||||
|
||||
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
|
||||
{
|
||||
OnHitEffects(target.Center, crit);
|
||||
OnHitEffects(target.Center, hit.Crit);
|
||||
target.AddBuff(BuffID.Venom, 180);
|
||||
}
|
||||
|
||||
public override void OnHitPlayer(Player target, Player.HurtInfo info)
|
||||
{
|
||||
OnHitEffects(target.Center, crit);
|
||||
OnHitEffects(target.Center, true);
|
||||
target.AddBuff(BuffID.Venom, 180);
|
||||
}
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ namespace CalamityMod.Projectiles.Melee
|
||||
{
|
||||
target.AddBuff(ModContent.BuffType<HolyFlames>(), 180);
|
||||
|
||||
float healAmt = damage * 0.015f;
|
||||
float healAmt = hit.Damage * 0.015f;
|
||||
if ((int)healAmt == 0)
|
||||
return;
|
||||
|
||||
@@ -92,7 +92,7 @@ namespace CalamityMod.Projectiles.Melee
|
||||
{
|
||||
target.AddBuff(ModContent.BuffType<HolyFlames>(), 180);
|
||||
|
||||
float healAmt = damage * 0.015f;
|
||||
float healAmt = info.Damage * 0.015f;
|
||||
if ((int)healAmt == 0)
|
||||
return;
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ namespace CalamityMod.Projectiles.Melee
|
||||
|
||||
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
|
||||
{
|
||||
if (crit)
|
||||
if (hit.Crit)
|
||||
{
|
||||
bool boing = false;
|
||||
excludedTargets[0] = target;
|
||||
|
||||
@@ -55,7 +55,7 @@ namespace CalamityMod.Projectiles.Melee.Shortswords
|
||||
Player player = Main.player[Projectile.owner];
|
||||
var source = Projectile.GetSource_FromThis();
|
||||
int sparkDamage = player.CalcIntDamage<MeleeDamageClass>(0.5f * Projectile.damage);
|
||||
Projectile.NewProjectile(source, target.Center, Vector2.Zero, ModContent.ProjectileType<Spark>(), sparkDamage, knockback, Main.myPlayer);
|
||||
Projectile.NewProjectile(source, target.Center, Vector2.Zero, ModContent.ProjectileType<Spark>(), sparkDamage, hit.Knockback, Main.myPlayer);
|
||||
}
|
||||
|
||||
public override void OnHitPlayer(Player target, Player.HurtInfo info)
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace CalamityMod.Projectiles.Melee.Spears
|
||||
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
|
||||
{
|
||||
target.AddBuff(ModContent.BuffType<AstralInfectionDebuff>(), 300);
|
||||
if (crit)
|
||||
if (hit.Crit)
|
||||
{
|
||||
var source = Projectile.GetSource_FromThis();
|
||||
for (int i = 0; i < 3; i++)
|
||||
|
||||
@@ -128,7 +128,7 @@ namespace CalamityMod.Projectiles.Melee.Spears
|
||||
{
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(),
|
||||
target.Center, Vector2.Zero,
|
||||
ModContent.ProjectileType<BansheeHookBoom>(), (int)(damage * 0.25),
|
||||
ModContent.ProjectileType<BansheeHookBoom>(), (int)(hit.Damage * 0.25),
|
||||
10f, Projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Melee.Spears
|
||||
if (Projectile.owner == Main.myPlayer)
|
||||
{
|
||||
if (Main.player[Projectile.owner].ownedProjectileCounts[ModContent.ProjectileType<BrimlanceHellfireExplosion>()] < 3)
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), target.Center, Vector2.Zero, ModContent.ProjectileType<BrimlanceHellfireExplosion>(), (int)(Projectile.damage * 0.65), knockback, Main.myPlayer);
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), target.Center, Vector2.Zero, ModContent.ProjectileType<BrimlanceHellfireExplosion>(), (int)(Projectile.damage * 0.65), hit.Knockback, Main.myPlayer);
|
||||
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
|
||||
@@ -41,13 +41,13 @@ namespace CalamityMod.Projectiles.Melee.Spears
|
||||
|
||||
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
|
||||
{
|
||||
OnHitEffects(target.Center, crit);
|
||||
OnHitEffects(target.Center, hit.Crit);
|
||||
target.AddBuff(BuffID.Venom, 300);
|
||||
}
|
||||
|
||||
public override void OnHitPlayer(Player target, Player.HurtInfo info)
|
||||
{
|
||||
OnHitEffects(target.Center, crit);
|
||||
OnHitEffects(target.Center, true);
|
||||
target.AddBuff(BuffID.Venom, 300);
|
||||
}
|
||||
|
||||
|
||||
@@ -48,13 +48,13 @@ namespace CalamityMod.Projectiles.Melee.Spears
|
||||
|
||||
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
|
||||
{
|
||||
OnHitEffects(target.Center, crit);
|
||||
OnHitEffects(target.Center, hit.Crit);
|
||||
target.AddBuff(BuffID.OnFire3, 240);
|
||||
}
|
||||
|
||||
public override void OnHitPlayer(Player target, Player.HurtInfo info)
|
||||
{
|
||||
OnHitEffects(target.Center, crit);
|
||||
OnHitEffects(target.Center, true);
|
||||
target.AddBuff(BuffID.OnFire3, 240);
|
||||
}
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ namespace CalamityMod.Projectiles.Melee
|
||||
public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers)
|
||||
{
|
||||
//Add some damage falloff
|
||||
modifiers.SourceDamage *= Math.Pow(1 - TrueArkoftheAncients.blastFalloffStrenght, Projectile.numHits * TrueArkoftheAncients.blastFalloffSpeed);
|
||||
modifiers.SourceDamage *= (float)Math.Pow(1 - TrueArkoftheAncients.blastFalloffStrenght, Projectile.numHits * TrueArkoftheAncients.blastFalloffSpeed);
|
||||
}
|
||||
|
||||
public override bool PreDraw(ref Color lightColor)
|
||||
|
||||
@@ -141,7 +141,7 @@ namespace CalamityMod.Projectiles.Melee
|
||||
//hitDirection = Math.Sign(target.Center.X - Owner.Center.X);
|
||||
|
||||
//Doing it this way lets the player choose if they want to knockback enemies towards them by pointing away from them
|
||||
modifiers.HitDirection = Owner.direction;
|
||||
modifiers.HitDirectionOverride = Owner.direction;
|
||||
}
|
||||
|
||||
public override bool PreDraw(ref Color lightColor)
|
||||
|
||||
@@ -106,7 +106,7 @@ namespace CalamityMod.Projectiles.Melee
|
||||
// Play a splatter and impact sound.
|
||||
SoundEngine.PlaySound(SoundID.DD2_CrystalCartImpact, Projectile.Center);
|
||||
|
||||
float damageInterpolant = Utils.GetLerpValue(950f, 2000f, damage, true);
|
||||
float damageInterpolant = Utils.GetLerpValue(950f, 2000f, hit.Damage, true);
|
||||
float impactAngularVelocity = MathHelper.Lerp(0.08f, 0.2f, damageInterpolant);
|
||||
float impactParticleScale = MathHelper.Lerp(0.6f, 1f, damageInterpolant);
|
||||
impactAngularVelocity *= Main.rand.NextBool().ToDirectionInt() * Main.rand.NextFloat(0.75f, 1.25f);
|
||||
|
||||
@@ -93,7 +93,7 @@ namespace CalamityMod.Projectiles.Melee
|
||||
bool screwRegained = false;
|
||||
|
||||
//50% chance to gain back the screw on kill.
|
||||
if (target.life - damage <= 0)
|
||||
if (target.life - hit.Damage <= 0)
|
||||
{
|
||||
if (Main.rand.NextBool() && Main.myPlayer == Owner.whoAmI)
|
||||
{
|
||||
|
||||
@@ -143,7 +143,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos
|
||||
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
|
||||
{
|
||||
// On hit effects do not apply if no damage was done.
|
||||
if (damage <= 0)
|
||||
if (hit.Damage <= 0)
|
||||
return;
|
||||
|
||||
// Charge up the red lightning aura with every hit.
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
|
||||
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
|
||||
{
|
||||
OnHitEffects(target.Center, crit);
|
||||
OnHitEffects(target.Center, hit.Crit);
|
||||
|
||||
target.AddBuff(ModContent.BuffType<MarkedforDeath>(), 600);
|
||||
|
||||
@@ -68,7 +68,7 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
|
||||
public override void OnHitPlayer(Player target, Player.HurtInfo info)
|
||||
{
|
||||
OnHitEffects(target.Center, crit);
|
||||
OnHitEffects(target.Center, true);
|
||||
|
||||
target.AddBuff(ModContent.BuffType<MarkedforDeath>(), 600);
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) => damage += OnHitEffect(Main.player[Projectile.owner]);
|
||||
public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) => modifiers.SourceDamage += OnHitEffect(Main.player[Projectile.owner]);
|
||||
|
||||
// Returns the amount of bonus damage that should be dealt. Boosts life regeneration appropriately as a side effect.
|
||||
private int OnHitEffect(Player owner)
|
||||
|
||||
@@ -56,13 +56,13 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
|
||||
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
|
||||
{
|
||||
OnHitEffects(target.Center, crit);
|
||||
OnHitEffects(target.Center, hit.Crit);
|
||||
target.AddBuff(ModContent.BuffType<MarkedforDeath>(), 600);
|
||||
}
|
||||
|
||||
public override void OnHitPlayer(Player target, Player.HurtInfo info)
|
||||
{
|
||||
OnHitEffects(target.Center, crit);
|
||||
OnHitEffects(target.Center, true);
|
||||
target.AddBuff(ModContent.BuffType<MarkedforDeath>(), 600);
|
||||
}
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
{
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, 0f, 0f, ModContent.ProjectileType<PlanarRipperExplosion>(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0f, 0f);
|
||||
}
|
||||
if (crit)
|
||||
if (hit.Crit)
|
||||
{
|
||||
if (modPlayer.planarSpeedBoost < 20)
|
||||
{
|
||||
@@ -79,12 +79,9 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
{
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, 0f, 0f, ModContent.ProjectileType<PlanarRipperExplosion>(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0f, 0f);
|
||||
}
|
||||
if (crit)
|
||||
if (modPlayer.planarSpeedBoost < 20)
|
||||
{
|
||||
if (modPlayer.planarSpeedBoost < 20)
|
||||
{
|
||||
modPlayer.planarSpeedBoost++;
|
||||
}
|
||||
modPlayer.planarSpeedBoost++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
if (Main.player[Projectile.owner].moonLeech)
|
||||
return;
|
||||
|
||||
float healAmt = damage * 0.05f;
|
||||
float healAmt = hit.Damage * 0.05f;
|
||||
if ((int)healAmt == 0)
|
||||
return;
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
|
||||
public override void OnHitPlayer(Player target, Player.HurtInfo info)
|
||||
{
|
||||
if (damage <= 0)
|
||||
if (info.Damage <= 0)
|
||||
return;
|
||||
|
||||
RestrictLifetime();
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
{
|
||||
target.AddBuff(ModContent.BuffType<CrushDepth>(), 240);
|
||||
|
||||
if (crit)
|
||||
if (hit.Crit)
|
||||
target.Calamity().miscDefenseLoss = Math.Min(target.defense, 15);
|
||||
|
||||
if (Projectile.Calamity().stealthStrike)
|
||||
|
||||
@@ -62,7 +62,7 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
|
||||
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
|
||||
{
|
||||
OnHitEffects(crit);
|
||||
OnHitEffects(hit.Crit);
|
||||
}
|
||||
|
||||
public override void OnHitPlayer(Player target, Player.HurtInfo info)
|
||||
|
||||
@@ -128,9 +128,10 @@ namespace CalamityMod.Projectiles.Summon
|
||||
// TODO -- this damage should be after Terraria vanilla multipliers, so it won't one shot people
|
||||
public override void ModifyHitPlayer(Player target, ref Player.HurtModifiers modifiers)
|
||||
{
|
||||
if (Main.masterMode) damage = 320;
|
||||
else if (Main.expertMode) damage = 260;
|
||||
else damage = 200;
|
||||
modifiers.SourceDamage *= 0f;
|
||||
if (Main.masterMode) modifiers.SourceDamage += 320f;
|
||||
else if (Main.expertMode) modifiers.SourceDamage += 260f;
|
||||
else modifiers.SourceDamage += 200f;
|
||||
}
|
||||
|
||||
public override bool? CanDamage() => Projectile.Opacity >= 1f;
|
||||
|
||||
@@ -76,9 +76,10 @@ namespace CalamityMod.Projectiles.Summon
|
||||
// TODO -- this damage should be after Terraria vanilla multipliers, so it won't one shot people
|
||||
public override void ModifyHitPlayer(Player target, ref Player.HurtModifiers modifiers)
|
||||
{
|
||||
if (Main.masterMode) damage = 320;
|
||||
else if (Main.expertMode) damage = 260;
|
||||
else damage = 200;
|
||||
modifiers.SourceDamage *= 0f;
|
||||
if (Main.masterMode) modifiers.SourceDamage += 320f;
|
||||
else if (Main.expertMode) modifiers.SourceDamage += 260f;
|
||||
else modifiers.SourceDamage += 200f;
|
||||
}
|
||||
|
||||
public override bool? CanDamage() => Projectile.Opacity >= 1f;
|
||||
|
||||
@@ -150,7 +150,7 @@ namespace CalamityMod.Projectiles.Summon
|
||||
|
||||
public override void OnHitPlayer(Player target, Player.HurtInfo info)
|
||||
{
|
||||
if (damage <= 0)
|
||||
if (info.Damage <= 0)
|
||||
return;
|
||||
|
||||
if (Main.myPlayer == Projectile.owner)
|
||||
|
||||
@@ -676,9 +676,10 @@ namespace CalamityMod.Projectiles.Summon
|
||||
// TODO -- this damage should be after Terraria vanilla multipliers, so it won't one shot people
|
||||
public override void ModifyHitPlayer(Player target, ref Player.HurtModifiers modifiers)
|
||||
{
|
||||
if (Main.masterMode) damage = 450;
|
||||
else if (Main.expertMode) damage = 375;
|
||||
else damage = 300;
|
||||
modifiers.SourceDamage *= 0f;
|
||||
if (Main.masterMode) modifiers.SourceDamage += 450f;
|
||||
else if (Main.expertMode) modifiers.SourceDamage += 375f;
|
||||
else modifiers.SourceDamage += 300f;
|
||||
}
|
||||
|
||||
public override bool? CanHitNPC(NPC target)
|
||||
|
||||
@@ -67,7 +67,7 @@ namespace CalamityMod.Projectiles.Summon
|
||||
public override void ModifyHitPlayer(Player target, ref Player.HurtModifiers modifiers)
|
||||
{
|
||||
// Prevent absurd quantities of damage to the player.
|
||||
damage = (int)(damage * 0.018);
|
||||
modifiers.SourceDamage *= 0.018f;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -69,7 +69,7 @@ namespace CalamityMod.Projectiles.Typeless
|
||||
|
||||
if (CalamityGlobalNPC.ShouldAffectNPC(target))
|
||||
{
|
||||
float knockbackMultiplier = knockback - (1f - target.knockBackResist);
|
||||
float knockbackMultiplier = hit.Knockback - (1f - target.knockBackResist);
|
||||
if (knockbackMultiplier < 0)
|
||||
knockbackMultiplier = 0;
|
||||
|
||||
|
||||
@@ -209,9 +209,10 @@ namespace CalamityMod.Projectiles.Typeless
|
||||
// TODO -- this damage should be after Terraria vanilla multipliers, so it won't one shot people
|
||||
public override void ModifyHitPlayer(Player target, ref Player.HurtModifiers modifiers)
|
||||
{
|
||||
if (Main.masterMode) damage = 540;
|
||||
else if (Main.expertMode) damage = 450;
|
||||
else damage = 360;
|
||||
modifiers.SourceDamage *= 0f;
|
||||
if (Main.masterMode) modifiers.SourceDamage += 540f;
|
||||
else if (Main.expertMode) modifiers.SourceDamage += 450f;
|
||||
else modifiers.SourceDamage += 360f;
|
||||
}
|
||||
|
||||
public float FlameTrailWidthFunction(float completionRatio) => MathHelper.SmoothStep(21f, 8f, completionRatio);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using CalamityMod.NPCs;
|
||||
using CalamityMod.NPCs;
|
||||
using CalamityMod.NPCs.AcidRain;
|
||||
using CalamityMod.Buffs.StatDebuffs;
|
||||
using CalamityMod.Buffs.Potions;
|
||||
@@ -79,7 +79,7 @@ namespace CalamityMod.Projectiles.Typeless
|
||||
|
||||
if (CalamityGlobalNPC.ShouldAffectNPC(target))
|
||||
{
|
||||
float knockbackMultiplier = knockback - (1f - target.knockBackResist);
|
||||
float knockbackMultiplier = hit.Knockback - (1f - target.knockBackResist);
|
||||
if (knockbackMultiplier < 0)
|
||||
{
|
||||
knockbackMultiplier = 0;
|
||||
|
||||
Reference in new issue
Block a user