1 - Dank Creeper Kill Yourself Ability.
2 - Hive Mind and minion targeting rework. 3 - Brain Rot infliction from Shade Nimbus and Rain is no longer ridiculous. 4 - Hive Mind and Dank Creepers inflict Brain Rot on hit.
This commit is contained in:
1 parent
f94b961920
commit
ddc0312a02
7 files changed
+112
-91
No files matched your search
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.Events;
|
||||
using CalamityMod.Projectiles.Boss;
|
||||
using CalamityMod.World;
|
||||
@@ -25,7 +26,7 @@ namespace CalamityMod.NPCs.HiveMind
|
||||
NPC.height = 70;
|
||||
NPC.defense = 6;
|
||||
|
||||
NPC.lifeMax = 90;
|
||||
NPC.lifeMax = 120;
|
||||
if (BossRushEvent.BossRushActive)
|
||||
NPC.lifeMax = 2000;
|
||||
if (Main.getGoodWorld)
|
||||
@@ -58,10 +59,13 @@ namespace CalamityMod.NPCs.HiveMind
|
||||
// Avoid cheap bullshit
|
||||
NPC.damage = 0;
|
||||
|
||||
NPC.TargetClosest();
|
||||
// Get a target
|
||||
if (NPC.target < 0 || NPC.target == Main.maxPlayers || Main.player[NPC.target].dead || !Main.player[NPC.target].active)
|
||||
NPC.TargetClosest();
|
||||
|
||||
bool masterMode = Main.masterMode;
|
||||
bool revenge = CalamityWorld.revenge;
|
||||
float speed = revenge ? 12f : 11f;
|
||||
float speed = masterMode ? 15f : revenge ? 13f : 11f;
|
||||
if (BossRushEvent.BossRushActive)
|
||||
speed = 18f;
|
||||
|
||||
@@ -73,56 +77,66 @@ namespace CalamityMod.NPCs.HiveMind
|
||||
NPC.rotation = NPC.velocity.X * 0.05f;
|
||||
|
||||
Vector2 targetDirection = new Vector2(NPC.Center.X + (NPC.direction * 20), NPC.Center.Y + 6f);
|
||||
float playerXDist = Main.player[NPC.target].position.X + Main.player[NPC.target].width * 0.5f - targetDirection.X;
|
||||
float playerYDist = Main.player[NPC.target].Center.Y - targetDirection.Y;
|
||||
float playerDistance = (float)Math.Sqrt(playerXDist * playerXDist + playerYDist * playerYDist);
|
||||
float timeToReachTarget = speed / playerDistance;
|
||||
playerXDist *= timeToReachTarget;
|
||||
playerYDist *= timeToReachTarget;
|
||||
Vector2 targetLocation = Main.player[NPC.target].Center;
|
||||
|
||||
NPC.ai[0] -= 1f;
|
||||
if (playerDistance < 200f || NPC.ai[0] > 0f)
|
||||
// Fly above if below 25% HP and burst to spawn a Rain Cloud when high enough
|
||||
bool killYourself = NPC.life / (float)NPC.lifeMax < 0.25f;
|
||||
if (killYourself && (Main.expertMode || BossRushEvent.BossRushActive))
|
||||
{
|
||||
// Set damage
|
||||
NPC.damage = NPC.defDamage;
|
||||
targetLocation -= Vector2.UnitY * 400f;
|
||||
if (NPC.Distance(targetLocation) < 80f)
|
||||
{
|
||||
NPC.life = 0;
|
||||
NPC.HitEffect();
|
||||
NPC.checkDead();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (playerDistance < 200f)
|
||||
NPC.ai[0] = 20f;
|
||||
if (!killYourself)
|
||||
{
|
||||
NPC.ai[0] -= 1f;
|
||||
bool dash = NPC.Distance(targetLocation) < 200f;
|
||||
if (dash || NPC.ai[0] > 0f)
|
||||
{
|
||||
// Set damage
|
||||
NPC.damage = NPC.defDamage;
|
||||
|
||||
if (NPC.velocity.X < 0f)
|
||||
NPC.direction = -1;
|
||||
else
|
||||
NPC.direction = 1;
|
||||
if (dash)
|
||||
NPC.ai[0] = 20f;
|
||||
|
||||
if (NPC.velocity.X < 0f)
|
||||
NPC.direction = -1;
|
||||
else
|
||||
NPC.direction = 1;
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
float inertia = (NPC.Distance(targetLocation) < 300f || killYourself) ? 8f : NPC.Distance(targetLocation) < 400f ? 20f : 50f;
|
||||
Vector2 idealVelocity = (targetLocation - targetDirection).SafeNormalize(Vector2.UnitX * NPC.direction) * speed;
|
||||
NPC.velocity = (NPC.velocity * inertia + idealVelocity) / (inertia + 1f);
|
||||
}
|
||||
|
||||
public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo)
|
||||
{
|
||||
if (hurtInfo.Damage < 0)
|
||||
return;
|
||||
}
|
||||
|
||||
NPC.velocity.X = (NPC.velocity.X * 50f + playerXDist) / 51f;
|
||||
NPC.velocity.Y = (NPC.velocity.Y * 50f + playerYDist) / 51f;
|
||||
if (playerDistance < 350f)
|
||||
{
|
||||
NPC.velocity.X = (NPC.velocity.X * 10f + playerXDist) / 11f;
|
||||
NPC.velocity.Y = (NPC.velocity.Y * 10f + playerYDist) / 11f;
|
||||
}
|
||||
if (playerDistance < 300f)
|
||||
{
|
||||
NPC.velocity.X = (NPC.velocity.X * 7f + playerXDist) / 8f;
|
||||
NPC.velocity.Y = (NPC.velocity.Y * 7f + playerYDist) / 8f;
|
||||
}
|
||||
target.AddBuff(ModContent.BuffType<BrainRot>(), 180);
|
||||
}
|
||||
|
||||
public override void HitEffect(NPC.HitInfo hit)
|
||||
{
|
||||
for (int k = 0; k < 5; k++)
|
||||
{
|
||||
Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Glass, hit.HitDirection, -1f, 0, default, 1f);
|
||||
}
|
||||
|
||||
if (NPC.life <= 0)
|
||||
{
|
||||
for (int k = 0; k < 20; k++)
|
||||
{
|
||||
Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Glass, hit.HitDirection, -1f, 0, default, 1f);
|
||||
}
|
||||
|
||||
if (Main.netMode != NetmodeID.Server)
|
||||
{
|
||||
Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find<ModGore>("DankCreeperGore").Type, 1f);
|
||||
|
||||
+30
-15
@@ -60,15 +60,26 @@ namespace CalamityMod.NPCs.HiveMind
|
||||
// Setting this in SetDefaults will disable expert mode scaling, so put it here instead
|
||||
NPC.damage = 0;
|
||||
|
||||
bool masterMode = Main.masterMode || BossRushEvent.BossRushActive;
|
||||
bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive;
|
||||
bool death = CalamityWorld.death || BossRushEvent.BossRushActive;
|
||||
|
||||
// Float around the player
|
||||
NPC.rotation = NPC.velocity.X / 20f;
|
||||
|
||||
NPC.TargetClosest();
|
||||
// Get a target
|
||||
if (NPC.target < 0 || NPC.target == Main.maxPlayers || Main.player[NPC.target].dead || !Main.player[NPC.target].active)
|
||||
NPC.TargetClosest();
|
||||
|
||||
float velocity = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 10f : revenge ? 6f : 4f;
|
||||
float acceleration = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 0.5f : revenge ? 0.3f : 0.2f;
|
||||
float velocity = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 10f : death ? 7f : revenge ? 6f : 4f;
|
||||
float acceleration = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 0.5f : death ? 0.35f : revenge ? 0.3f : 0.2f;
|
||||
float deceleration = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 0.9f : death ? 0.95f : revenge ? 0.96f : 0.98f;
|
||||
if (masterMode)
|
||||
{
|
||||
velocity += 2f;
|
||||
acceleration += 0.2f;
|
||||
deceleration -= 0.05f;
|
||||
}
|
||||
if (BossRushEvent.BossRushActive)
|
||||
{
|
||||
velocity *= 2f;
|
||||
@@ -78,7 +89,7 @@ namespace CalamityMod.NPCs.HiveMind
|
||||
if (NPC.position.Y > Main.player[NPC.target].position.Y - 350f)
|
||||
{
|
||||
if (NPC.velocity.Y > 0f)
|
||||
NPC.velocity.Y *= 0.98f;
|
||||
NPC.velocity.Y *= deceleration;
|
||||
|
||||
NPC.velocity.Y -= acceleration;
|
||||
|
||||
@@ -88,7 +99,7 @@ namespace CalamityMod.NPCs.HiveMind
|
||||
else if (NPC.position.Y < Main.player[NPC.target].position.Y - 450f)
|
||||
{
|
||||
if (NPC.velocity.Y < 0f)
|
||||
NPC.velocity.Y *= 0.98f;
|
||||
NPC.velocity.Y *= deceleration;
|
||||
|
||||
NPC.velocity.Y += acceleration;
|
||||
|
||||
@@ -97,35 +108,38 @@ namespace CalamityMod.NPCs.HiveMind
|
||||
}
|
||||
|
||||
bool dropRain = NPC.Bottom.Y < Main.player[NPC.target].position.Y - 200f && Collision.CanHit(NPC.position, NPC.width, NPC.height, Main.player[NPC.target].position, Main.player[NPC.target].width, Main.player[NPC.target].height);
|
||||
if (NPC.Center.X > Main.player[NPC.target].Center.X + 400f)
|
||||
float distanceX = masterMode ? 200f : 400f;
|
||||
float velocityX = velocity * 1.5f;
|
||||
if (NPC.Center.X > Main.player[NPC.target].Center.X + distanceX)
|
||||
{
|
||||
dropRain = false;
|
||||
|
||||
if (NPC.velocity.X > 0f)
|
||||
NPC.velocity.X *= 0.98f;
|
||||
NPC.velocity.X *= deceleration;
|
||||
|
||||
NPC.velocity.X -= acceleration;
|
||||
|
||||
if (NPC.velocity.X > 8f)
|
||||
NPC.velocity.X = 8f;
|
||||
if (NPC.velocity.X > velocityX)
|
||||
NPC.velocity.X = velocityX;
|
||||
}
|
||||
if (NPC.Center.X < Main.player[NPC.target].Center.X - 400f)
|
||||
if (NPC.Center.X < Main.player[NPC.target].Center.X - distanceX)
|
||||
{
|
||||
dropRain = false;
|
||||
|
||||
if (NPC.velocity.X < 0f)
|
||||
NPC.velocity.X *= 0.98f;
|
||||
NPC.velocity.X *= deceleration;
|
||||
|
||||
NPC.velocity.X += acceleration;
|
||||
|
||||
if (NPC.velocity.X < -8f)
|
||||
NPC.velocity.X = -8f;
|
||||
if (NPC.velocity.X < -velocityX)
|
||||
NPC.velocity.X = -velocityX;
|
||||
}
|
||||
|
||||
if (dropRain && Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
NPC.ai[0] += 1f;
|
||||
if (NPC.ai[0] >= (Main.getGoodWorld ? 12f : 24f))
|
||||
float rainDropRate = Main.getGoodWorld ? 8f : death ? 16f : revenge ? 20f : 24f;
|
||||
if (NPC.ai[0] >= rainDropRate)
|
||||
{
|
||||
NPC.ai[0] = 0f;
|
||||
int shaderainXPos = (int)(NPC.position.X + 10f + Main.rand.Next(NPC.width - 20));
|
||||
@@ -133,7 +147,8 @@ namespace CalamityMod.NPCs.HiveMind
|
||||
int type = ModContent.ProjectileType<ShaderainHostile>();
|
||||
int damage = NPC.GetProjectileDamage(type);
|
||||
float randomXVelocity = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? Main.rand.NextFloat() * 5f : 0f;
|
||||
Projectile.NewProjectile(NPC.GetSource_FromAI(), shaderainXPos, shaderainYos, randomXVelocity, 4f, type, damage, 0f, Main.myPlayer);
|
||||
float velocityY = 8f;
|
||||
Projectile.NewProjectile(NPC.GetSource_FromAI(), shaderainXPos, shaderainYos, randomXVelocity, velocityY, type, damage, 0f, Main.myPlayer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,8 +104,6 @@ namespace CalamityMod.NPCs.HiveMind
|
||||
}
|
||||
}
|
||||
|
||||
NPC.TargetClosest();
|
||||
|
||||
float hiveMindVelocity = Main.npc[hiveMind].velocity.Length();
|
||||
float relocateSpeed = getFuckedAI ? 1.2f : death ? 0.8f : revenge ? 0.7f : expertMode ? 0.6f : 0.5f;
|
||||
float acceleration = 0.8f;
|
||||
@@ -160,7 +158,7 @@ namespace CalamityMod.NPCs.HiveMind
|
||||
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
if (!Collision.CanHit(NPC.position, NPC.width, NPC.height, Main.player[NPC.target].position, Main.player[NPC.target].width, Main.player[NPC.target].height))
|
||||
if (!Collision.CanHit(NPC.position, NPC.width, NPC.height, Main.player[Main.npc[hiveMind].target].position, Main.player[Main.npc[hiveMind].target].width, Main.player[Main.npc[hiveMind].target].height))
|
||||
NPC.localAI[1] = ShootGateValue * 0.5f;
|
||||
|
||||
float shootGateValue = ShootGateValue;
|
||||
@@ -176,11 +174,10 @@ namespace CalamityMod.NPCs.HiveMind
|
||||
if (NPC.alpha > 0)
|
||||
return;
|
||||
|
||||
if (NPC.localAI[1] >= shootGateValue && Vector2.Distance(Main.player[NPC.target].Center, NPC.Center) > 80f)
|
||||
if (NPC.localAI[1] >= shootGateValue && Vector2.Distance(Main.player[Main.npc[hiveMind].target].Center, NPC.Center) > 80f)
|
||||
{
|
||||
NPC.localAI[1] = 0f;
|
||||
NPC.TargetClosest();
|
||||
if (Collision.CanHit(NPC.position, NPC.width, NPC.height, Main.player[NPC.target].position, Main.player[NPC.target].width, Main.player[NPC.target].height))
|
||||
if (Collision.CanHit(NPC.position, NPC.width, NPC.height, Main.player[Main.npc[hiveMind].target].position, Main.player[Main.npc[hiveMind].target].width, Main.player[Main.npc[hiveMind].target].height))
|
||||
{
|
||||
float projSpeed = death ? 8f : revenge ? 7f : expertMode ? 6f : 4f;
|
||||
if (masterMode)
|
||||
@@ -189,8 +186,8 @@ namespace CalamityMod.NPCs.HiveMind
|
||||
projSpeed *= 1.5f;
|
||||
|
||||
Vector2 projDirection = NPC.Center;
|
||||
float playerX = Main.player[NPC.target].Center.X - projDirection.X;
|
||||
float playerY = Main.player[NPC.target].Center.Y - projDirection.Y;
|
||||
float playerX = Main.player[Main.npc[hiveMind].target].Center.X - projDirection.X;
|
||||
float playerY = Main.player[Main.npc[hiveMind].target].Center.Y - projDirection.Y;
|
||||
float playerDist = (float)Math.Sqrt(playerX * playerX + playerY * playerY);
|
||||
playerDist = projSpeed / playerDist;
|
||||
playerX *= playerDist;
|
||||
@@ -200,7 +197,7 @@ namespace CalamityMod.NPCs.HiveMind
|
||||
Vector2 projectileVelocity = new Vector2(playerX, playerY);
|
||||
if (type == ProjectileID.CursedFlameHostile)
|
||||
{
|
||||
Vector2 v = Main.player[NPC.target].Center - NPC.Center - Main.player[NPC.target].velocity * 20f;
|
||||
Vector2 v = Main.player[Main.npc[hiveMind].target].Center - NPC.Center - Main.player[Main.npc[hiveMind].target].velocity * 20f;
|
||||
projectileVelocity = v.SafeNormalize(Vector2.UnitY) * projSpeed;
|
||||
}
|
||||
Projectile.NewProjectile(NPC.GetSource_FromAI(), projDirection, projectileVelocity, type, damage, 0f, Main.myPlayer);
|
||||
|
||||
@@ -107,8 +107,6 @@ namespace CalamityMod.NPCs.HiveMind
|
||||
}
|
||||
}
|
||||
|
||||
NPC.TargetClosest();
|
||||
|
||||
float hiveMindVelocity = Main.npc[hiveMind].velocity.Length();
|
||||
float relocateSpeed = getFuckedAI ? 1.2f : death ? 0.8f : revenge ? 0.7f : expertMode ? 0.6f : 0.5f;
|
||||
float acceleration = 0.8f;
|
||||
@@ -163,7 +161,7 @@ namespace CalamityMod.NPCs.HiveMind
|
||||
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
if (!Collision.CanHit(NPC.position, NPC.width, NPC.height, Main.player[NPC.target].position, Main.player[NPC.target].width, Main.player[NPC.target].height))
|
||||
if (!Collision.CanHit(NPC.position, NPC.width, NPC.height, Main.player[Main.npc[hiveMind].target].position, Main.player[Main.npc[hiveMind].target].width, Main.player[Main.npc[hiveMind].target].height))
|
||||
NPC.localAI[1] = ShootGateValue * 0.5f;
|
||||
|
||||
float shootGateValue = ShootGateValue;
|
||||
@@ -179,11 +177,10 @@ namespace CalamityMod.NPCs.HiveMind
|
||||
if (NPC.alpha > 0)
|
||||
return;
|
||||
|
||||
if (NPC.localAI[1] >= shootGateValue && Vector2.Distance(Main.player[NPC.target].Center, NPC.Center) > 80f)
|
||||
if (NPC.localAI[1] >= shootGateValue && Vector2.Distance(Main.player[Main.npc[hiveMind].target].Center, NPC.Center) > 80f)
|
||||
{
|
||||
NPC.localAI[1] = 0f;
|
||||
NPC.TargetClosest();
|
||||
if (Collision.CanHit(NPC.position, NPC.width, NPC.height, Main.player[NPC.target].position, Main.player[NPC.target].width, Main.player[NPC.target].height))
|
||||
if (Collision.CanHit(NPC.position, NPC.width, NPC.height, Main.player[Main.npc[hiveMind].target].position, Main.player[Main.npc[hiveMind].target].width, Main.player[Main.npc[hiveMind].target].height))
|
||||
{
|
||||
float projSpeed = death ? 8f : revenge ? 7f : expertMode ? 6f : 4f;
|
||||
if (masterMode)
|
||||
@@ -192,8 +189,8 @@ namespace CalamityMod.NPCs.HiveMind
|
||||
projSpeed *= 1.5f;
|
||||
|
||||
Vector2 projDirection = NPC.Center;
|
||||
float playerX = Main.player[NPC.target].Center.X - projDirection.X;
|
||||
float playerY = Main.player[NPC.target].Center.Y - projDirection.Y;
|
||||
float playerX = Main.player[Main.npc[hiveMind].target].Center.X - projDirection.X;
|
||||
float playerY = Main.player[Main.npc[hiveMind].target].Center.Y - projDirection.Y;
|
||||
float playerDist = (float)Math.Sqrt(playerX * playerX + playerY * playerY);
|
||||
playerDist = projSpeed / playerDist;
|
||||
playerX *= playerDist;
|
||||
@@ -203,7 +200,7 @@ namespace CalamityMod.NPCs.HiveMind
|
||||
Vector2 projectileVelocity = new Vector2(playerX, playerY);
|
||||
if (type == ProjectileID.CursedFlameHostile)
|
||||
{
|
||||
Vector2 v = Main.player[NPC.target].Center - NPC.Center - Main.player[NPC.target].velocity * 20f;
|
||||
Vector2 v = Main.player[Main.npc[hiveMind].target].Center - NPC.Center - Main.player[Main.npc[hiveMind].target].velocity * 20f;
|
||||
projectileVelocity = v.SafeNormalize(Vector2.UnitY) * projSpeed;
|
||||
}
|
||||
Projectile.NewProjectile(NPC.GetSource_FromAI(), projDirection, projectileVelocity, type, damage, 0f, Main.myPlayer);
|
||||
|
||||
+15
-10
@@ -1,4 +1,5 @@
|
||||
using System.IO;
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.Events;
|
||||
using CalamityMod.Items.Accessories;
|
||||
using CalamityMod.Items.Armor.Vanity;
|
||||
@@ -417,10 +418,6 @@ namespace CalamityMod.NPCs.HiveMind
|
||||
if (NPC.target < 0 || NPC.target == Main.maxPlayers || Main.player[NPC.target].dead || !Main.player[NPC.target].active)
|
||||
NPC.TargetClosest();
|
||||
|
||||
// Despawn safety, make sure to target another player if the current player target is too far away
|
||||
if (Vector2.Distance(Main.player[NPC.target].Center, NPC.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles)
|
||||
NPC.TargetClosest();
|
||||
|
||||
Player player = Main.player[NPC.target];
|
||||
|
||||
bool bossRush = BossRushEvent.BossRushActive;
|
||||
@@ -799,11 +796,11 @@ namespace CalamityMod.NPCs.HiveMind
|
||||
NPC.netSpam = 0;
|
||||
}
|
||||
|
||||
if (!player.active || player.dead || Vector2.Distance(NPC.Center, player.Center) > 5000f)
|
||||
if (!player.active || player.dead || Vector2.Distance(NPC.Center, player.Center) > 8000f)
|
||||
{
|
||||
NPC.TargetClosest(false);
|
||||
player = Main.player[NPC.target];
|
||||
if (!player.active || player.dead || Vector2.Distance(NPC.Center, player.Center) > 5000f)
|
||||
if (!player.active || player.dead || Vector2.Distance(NPC.Center, player.Center) > 8000f)
|
||||
{
|
||||
if (NPC.timeLeft > 60)
|
||||
NPC.timeLeft = 60;
|
||||
@@ -830,9 +827,9 @@ namespace CalamityMod.NPCs.HiveMind
|
||||
|
||||
phase2timer--;
|
||||
|
||||
// Use an attack sooner in expert mode if being hit
|
||||
if (NPC.justHit && expertMode)
|
||||
phase2timer--;
|
||||
// Use an attack sooner if being hit
|
||||
if (NPC.justHit)
|
||||
phase2timer -= masterMode ? 7 : expertMode ? 5 : 3;
|
||||
|
||||
// Use an attack sooner if target is close
|
||||
if (NPC.Distance(player.Center) < 160f)
|
||||
@@ -1142,7 +1139,7 @@ namespace CalamityMod.NPCs.HiveMind
|
||||
phase2timer++;
|
||||
if (phase2timer == decelerationTime)
|
||||
{
|
||||
phase2timer = minimumDriftTime + Main.rand.Next(121);
|
||||
phase2timer = minimumDriftTime + Main.rand.Next(masterMode ? 61 : 121);
|
||||
state = 0;
|
||||
NPC.netUpdate = true;
|
||||
NPC.netSpam = 0;
|
||||
@@ -1175,6 +1172,14 @@ namespace CalamityMod.NPCs.HiveMind
|
||||
return minDist <= 60f && NPC.alpha == 0 && NPC.scale == 1f; // No damage while not fully visible or shrunk
|
||||
}
|
||||
|
||||
public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo)
|
||||
{
|
||||
if (hurtInfo.Damage < 0)
|
||||
return;
|
||||
|
||||
target.AddBuff(ModContent.BuffType<BrainRot>(), 300);
|
||||
}
|
||||
|
||||
public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) => NPC.scale == 1f; // Only draw HP bar while at full size
|
||||
|
||||
public override void ModifyIncomingHit(ref NPC.HitModifiers modifiers)
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.Boss
|
||||
Projectile.ai[0] = 0f;
|
||||
int rainSpawnX = (int)(Projectile.position.X + 14f + (float)Main.rand.Next(Projectile.width - 28));
|
||||
int rainSpawnY = (int)(Projectile.position.Y + (float)Projectile.height + 4f);
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), (float)rainSpawnX, (float)rainSpawnY, 0f, 4f, ModContent.ProjectileType<ShaderainHostile>(), Projectile.damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), (float)rainSpawnX, (float)rainSpawnY, 0f, 8f, ModContent.ProjectileType<ShaderainHostile>(), Projectile.damage, 0f, Main.myPlayer);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -63,7 +63,7 @@ namespace CalamityMod.Projectiles.Boss
|
||||
if (info.Damage <= 0)
|
||||
return;
|
||||
|
||||
target.AddBuff(ModContent.BuffType<BrainRot>(), 360);
|
||||
target.AddBuff(ModContent.BuffType<BrainRot>(), 240);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,19 +9,15 @@ namespace CalamityMod.Projectiles.Boss
|
||||
public class ShaderainHostile : ModProjectile, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Projectiles.Boss";
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Projectile.width = 4;
|
||||
Projectile.height = 40;
|
||||
Projectile.hostile = true;
|
||||
Projectile.extraUpdates = 1;
|
||||
Projectile.penetrate = -1;
|
||||
Projectile.ignoreWater = true;
|
||||
Projectile.timeLeft = 300;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
Projectile.alpha = 50;
|
||||
}
|
||||
|
||||
@@ -36,17 +32,14 @@ namespace CalamityMod.Projectiles.Boss
|
||||
dust.scale = 0.95f;
|
||||
}
|
||||
|
||||
public override Color? GetAlpha(Color lightColor)
|
||||
{
|
||||
return new Color(102, 255, 102, Projectile.alpha);
|
||||
}
|
||||
public override Color? GetAlpha(Color lightColor) => new Color(100, 255, 100, Projectile.alpha);
|
||||
|
||||
public override void OnHitPlayer(Player target, Player.HurtInfo info)
|
||||
{
|
||||
if (info.Damage <= 0)
|
||||
return;
|
||||
|
||||
target.AddBuff(ModContent.BuffType<BrainRot>(), 360);
|
||||
target.AddBuff(ModContent.BuffType<BrainRot>(), 120);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user