1 - Nebulous Core tooltip updated, will add revive effect later.
2 - Afterimages for Apollo, Artemis and Ares. 3 - Circular hitboxes for Apollo and Artemis. 4 - T Hanos fixes. 5 - Storm Weaver lightning orb spawns are more predictable and less random.
This commit is contained in:
1 parent
f2744b1033
commit
f46eed9cc4
14 files changed
+354
-46
No files matched your search
@@ -12,10 +12,10 @@ namespace CalamityMod.Items.Accessories
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Nebulous Core");
|
||||
Tooltip.SetDefault("12% increased damage\n" +
|
||||
Tooltip.SetDefault("10% increased damage\n" +
|
||||
"Summons floating nebula stars to protect you\n" +
|
||||
"You have a 10% chance to survive an attack that would have killed you\n" +
|
||||
"If this effect activates you will be healed by 100 HP");
|
||||
"You will survive an attack that would have killed you and be healed 100 HP\n" +
|
||||
"This effect has a 90 second cooldown");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
@@ -30,7 +30,7 @@ namespace CalamityMod.Items.Accessories
|
||||
|
||||
public override void Update(ref float gravity, ref float maxFallSpeed)
|
||||
{
|
||||
float num = (float)Main.rand.Next(90, 111) * 0.01f;
|
||||
float num = Main.rand.Next(90, 111) * 0.01f;
|
||||
num *= Main.essScale;
|
||||
Lighting.AddLight((int)((item.position.X + (float)(item.width / 2)) / 16f), (int)((item.position.Y + (float)(item.height / 2)) / 16f), 0.35f * num, 0.05f * num, 0.35f * num);
|
||||
}
|
||||
@@ -39,8 +39,8 @@ namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
CalamityPlayer modPlayer = player.Calamity();
|
||||
modPlayer.nCore = true;
|
||||
player.allDamage += 0.12f;
|
||||
int damage = (int)(750 * player.AverageDamage());
|
||||
player.allDamage += 0.1f;
|
||||
int damage = (int)(500 * player.AverageDamage());
|
||||
float knockBack = 3f;
|
||||
if (Main.rand.NextBool(15))
|
||||
{
|
||||
@@ -99,7 +99,7 @@ namespace CalamityMod.Items.Accessories
|
||||
}
|
||||
if (flag && Main.myPlayer == player.whoAmI)
|
||||
{
|
||||
Projectile.NewProjectile(center.X, center.Y, 0f, 0f, ModContent.ProjectileType<NebulaStar>(), damage, knockBack, player.whoAmI, 0f, 0f);
|
||||
Projectile.NewProjectile(center.X, center.Y, 0f, 0f, ModContent.ProjectileType<NebulaStar>(), damage, knockBack, player.whoAmI);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -555,6 +555,28 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo
|
||||
}*/
|
||||
}
|
||||
|
||||
public override bool CanHitPlayer(Player target, ref int cooldownSlot)
|
||||
{
|
||||
cooldownSlot = 1;
|
||||
|
||||
Rectangle targetHitbox = target.Hitbox;
|
||||
|
||||
float dist1 = Vector2.Distance(npc.Center, targetHitbox.TopLeft());
|
||||
float dist2 = Vector2.Distance(npc.Center, targetHitbox.TopRight());
|
||||
float dist3 = Vector2.Distance(npc.Center, targetHitbox.BottomLeft());
|
||||
float dist4 = Vector2.Distance(npc.Center, targetHitbox.BottomRight());
|
||||
|
||||
float minDist = dist1;
|
||||
if (dist2 < minDist)
|
||||
minDist = dist2;
|
||||
if (dist3 < minDist)
|
||||
minDist = dist3;
|
||||
if (dist4 < minDist)
|
||||
minDist = dist4;
|
||||
|
||||
return minDist <= 100f && npc.Opacity == 1f;
|
||||
}
|
||||
|
||||
public override bool StrikeNPC(ref double damage, int defense, ref float knockback, int hitDirection, ref bool crit) => !CalamityUtils.AntiButcher(npc, ref damage, 0.5f);
|
||||
|
||||
public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position)
|
||||
@@ -619,10 +641,44 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo
|
||||
Texture2D texture = Main.npcTexture[npc.type];
|
||||
Rectangle frame = new Rectangle(npc.width * frameX, npc.height * frameY, npc.width, npc.height);
|
||||
Vector2 vector = new Vector2(npc.width / 2, npc.height / 2);
|
||||
Color afterimageBaseColor = Color.White;
|
||||
int numAfterimages = 5;
|
||||
|
||||
if (CalamityConfig.Instance.Afterimages)
|
||||
{
|
||||
for (int i = 1; i < numAfterimages; i += 2)
|
||||
{
|
||||
Color afterimageColor = drawColor;
|
||||
afterimageColor = Color.Lerp(afterimageColor, afterimageBaseColor, 0.5f);
|
||||
afterimageColor = npc.GetAlpha(afterimageColor);
|
||||
afterimageColor *= (numAfterimages - i) / 15f;
|
||||
Vector2 afterimageCenter = npc.oldPos[i] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition;
|
||||
afterimageCenter -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f;
|
||||
afterimageCenter += vector * npc.scale + new Vector2(0f, npc.gfxOffY);
|
||||
spriteBatch.Draw(texture, afterimageCenter, npc.frame, afterimageColor, npc.rotation, vector, npc.scale, SpriteEffects.None, 0f);
|
||||
}
|
||||
}
|
||||
|
||||
Vector2 center = npc.Center - Main.screenPosition;
|
||||
spriteBatch.Draw(texture, center, frame, npc.GetAlpha(drawColor), npc.rotation, vector, npc.scale, SpriteEffects.None, 0f);
|
||||
|
||||
texture = ModContent.GetTexture("CalamityMod/NPCs/ExoMechs/Apollo/ApolloGlow");
|
||||
|
||||
if (CalamityConfig.Instance.Afterimages)
|
||||
{
|
||||
for (int i = 1; i < numAfterimages; i += 2)
|
||||
{
|
||||
Color afterimageColor = drawColor;
|
||||
afterimageColor = Color.Lerp(afterimageColor, afterimageBaseColor, 0.5f);
|
||||
afterimageColor = npc.GetAlpha(afterimageColor);
|
||||
afterimageColor *= (numAfterimages - i) / 15f;
|
||||
Vector2 afterimageCenter = npc.oldPos[i] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition;
|
||||
afterimageCenter -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f;
|
||||
afterimageCenter += vector * npc.scale + new Vector2(0f, npc.gfxOffY);
|
||||
spriteBatch.Draw(texture, afterimageCenter, npc.frame, afterimageColor, npc.rotation, vector, npc.scale, SpriteEffects.None, 0f);
|
||||
}
|
||||
}
|
||||
|
||||
spriteBatch.Draw(texture, center, frame, Color.White * npc.Opacity, npc.rotation, vector, npc.scale, SpriteEffects.None, 0f);
|
||||
|
||||
return false;
|
||||
|
||||
@@ -637,10 +637,44 @@ namespace CalamityMod.NPCs.ExoMechs.Ares
|
||||
Texture2D texture = Main.npcTexture[npc.type];
|
||||
Rectangle frame = new Rectangle(npc.width * frameX, npc.height * frameY, npc.width, npc.height);
|
||||
Vector2 vector = new Vector2(npc.width / 2, npc.height / 2);
|
||||
Color afterimageBaseColor = Color.White;
|
||||
int numAfterimages = 5;
|
||||
|
||||
if (CalamityConfig.Instance.Afterimages)
|
||||
{
|
||||
for (int i = 1; i < numAfterimages; i += 2)
|
||||
{
|
||||
Color afterimageColor = drawColor;
|
||||
afterimageColor = Color.Lerp(afterimageColor, afterimageBaseColor, 0.5f);
|
||||
afterimageColor = npc.GetAlpha(afterimageColor);
|
||||
afterimageColor *= (numAfterimages - i) / 15f;
|
||||
Vector2 afterimageCenter = npc.oldPos[i] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition;
|
||||
afterimageCenter -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f;
|
||||
afterimageCenter += vector * npc.scale + new Vector2(0f, npc.gfxOffY);
|
||||
spriteBatch.Draw(texture, afterimageCenter, npc.frame, afterimageColor, npc.rotation, vector, npc.scale, SpriteEffects.None, 0f);
|
||||
}
|
||||
}
|
||||
|
||||
Vector2 center = npc.Center - Main.screenPosition;
|
||||
spriteBatch.Draw(texture, center, frame, npc.GetAlpha(drawColor), npc.rotation, vector, npc.scale, SpriteEffects.None, 0f);
|
||||
|
||||
texture = ModContent.GetTexture("CalamityMod/NPCs/ExoMechs/Ares/AresBodyGlow");
|
||||
|
||||
if (CalamityConfig.Instance.Afterimages)
|
||||
{
|
||||
for (int i = 1; i < numAfterimages; i += 2)
|
||||
{
|
||||
Color afterimageColor = drawColor;
|
||||
afterimageColor = Color.Lerp(afterimageColor, afterimageBaseColor, 0.5f);
|
||||
afterimageColor = npc.GetAlpha(afterimageColor);
|
||||
afterimageColor *= (numAfterimages - i) / 15f;
|
||||
Vector2 afterimageCenter = npc.oldPos[i] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition;
|
||||
afterimageCenter -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f;
|
||||
afterimageCenter += vector * npc.scale + new Vector2(0f, npc.gfxOffY);
|
||||
spriteBatch.Draw(texture, afterimageCenter, npc.frame, afterimageColor, npc.rotation, vector, npc.scale, SpriteEffects.None, 0f);
|
||||
}
|
||||
}
|
||||
|
||||
spriteBatch.Draw(texture, center, frame, Color.White * npc.Opacity, npc.rotation, vector, npc.scale, SpriteEffects.None, 0f);
|
||||
|
||||
return false;
|
||||
|
||||
@@ -443,10 +443,44 @@ namespace CalamityMod.NPCs.ExoMechs.Ares
|
||||
Texture2D texture = Main.npcTexture[npc.type];
|
||||
Rectangle frame = new Rectangle(npc.width * frameX, npc.height * frameY, npc.width, npc.height);
|
||||
Vector2 vector = new Vector2(npc.width / 2, npc.height / 2);
|
||||
Color afterimageBaseColor = Color.White;
|
||||
int numAfterimages = 5;
|
||||
|
||||
if (CalamityConfig.Instance.Afterimages)
|
||||
{
|
||||
for (int i = 1; i < numAfterimages; i += 2)
|
||||
{
|
||||
Color afterimageColor = drawColor;
|
||||
afterimageColor = Color.Lerp(afterimageColor, afterimageBaseColor, 0.5f);
|
||||
afterimageColor = npc.GetAlpha(afterimageColor);
|
||||
afterimageColor *= (numAfterimages - i) / 15f;
|
||||
Vector2 afterimageCenter = npc.oldPos[i] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition;
|
||||
afterimageCenter -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f;
|
||||
afterimageCenter += vector * npc.scale + new Vector2(0f, npc.gfxOffY);
|
||||
spriteBatch.Draw(texture, afterimageCenter, npc.frame, afterimageColor, npc.rotation, vector, npc.scale, spriteEffects, 0f);
|
||||
}
|
||||
}
|
||||
|
||||
Vector2 center = npc.Center - Main.screenPosition;
|
||||
spriteBatch.Draw(texture, center, frame, npc.GetAlpha(drawColor), npc.rotation, vector, npc.scale, spriteEffects, 0f);
|
||||
|
||||
texture = ModContent.GetTexture("CalamityMod/NPCs/ExoMechs/Ares/AresGaussNukeGlow");
|
||||
|
||||
if (CalamityConfig.Instance.Afterimages)
|
||||
{
|
||||
for (int i = 1; i < numAfterimages; i += 2)
|
||||
{
|
||||
Color afterimageColor = drawColor;
|
||||
afterimageColor = Color.Lerp(afterimageColor, afterimageBaseColor, 0.5f);
|
||||
afterimageColor = npc.GetAlpha(afterimageColor);
|
||||
afterimageColor *= (numAfterimages - i) / 15f;
|
||||
Vector2 afterimageCenter = npc.oldPos[i] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition;
|
||||
afterimageCenter -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f;
|
||||
afterimageCenter += vector * npc.scale + new Vector2(0f, npc.gfxOffY);
|
||||
spriteBatch.Draw(texture, afterimageCenter, npc.frame, afterimageColor, npc.rotation, vector, npc.scale, spriteEffects, 0f);
|
||||
}
|
||||
}
|
||||
|
||||
spriteBatch.Draw(texture, center, frame, Color.White * npc.Opacity, npc.rotation, vector, npc.scale, spriteEffects, 0f);
|
||||
|
||||
return false;
|
||||
|
||||
@@ -501,10 +501,44 @@ namespace CalamityMod.NPCs.ExoMechs.Ares
|
||||
Texture2D texture = Main.npcTexture[npc.type];
|
||||
Rectangle frame = new Rectangle(npc.width * frameX, npc.height * frameY, npc.width, npc.height);
|
||||
Vector2 vector = new Vector2(npc.width / 2, npc.height / 2);
|
||||
Color afterimageBaseColor = Color.White;
|
||||
int numAfterimages = 5;
|
||||
|
||||
if (CalamityConfig.Instance.Afterimages)
|
||||
{
|
||||
for (int i = 1; i < numAfterimages; i += 2)
|
||||
{
|
||||
Color afterimageColor = drawColor;
|
||||
afterimageColor = Color.Lerp(afterimageColor, afterimageBaseColor, 0.5f);
|
||||
afterimageColor = npc.GetAlpha(afterimageColor);
|
||||
afterimageColor *= (numAfterimages - i) / 15f;
|
||||
Vector2 afterimageCenter = npc.oldPos[i] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition;
|
||||
afterimageCenter -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f;
|
||||
afterimageCenter += vector * npc.scale + new Vector2(0f, npc.gfxOffY);
|
||||
spriteBatch.Draw(texture, afterimageCenter, npc.frame, afterimageColor, npc.rotation, vector, npc.scale, spriteEffects, 0f);
|
||||
}
|
||||
}
|
||||
|
||||
Vector2 center = npc.Center - Main.screenPosition;
|
||||
spriteBatch.Draw(texture, center, frame, npc.GetAlpha(drawColor), npc.rotation, vector, npc.scale, spriteEffects, 0f);
|
||||
|
||||
texture = ModContent.GetTexture("CalamityMod/NPCs/ExoMechs/Ares/AresLaserCannonGlow");
|
||||
|
||||
if (CalamityConfig.Instance.Afterimages)
|
||||
{
|
||||
for (int i = 1; i < numAfterimages; i += 2)
|
||||
{
|
||||
Color afterimageColor = drawColor;
|
||||
afterimageColor = Color.Lerp(afterimageColor, afterimageBaseColor, 0.5f);
|
||||
afterimageColor = npc.GetAlpha(afterimageColor);
|
||||
afterimageColor *= (numAfterimages - i) / 15f;
|
||||
Vector2 afterimageCenter = npc.oldPos[i] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition;
|
||||
afterimageCenter -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f;
|
||||
afterimageCenter += vector * npc.scale + new Vector2(0f, npc.gfxOffY);
|
||||
spriteBatch.Draw(texture, afterimageCenter, npc.frame, afterimageColor, npc.rotation, vector, npc.scale, spriteEffects, 0f);
|
||||
}
|
||||
}
|
||||
|
||||
spriteBatch.Draw(texture, center, frame, Color.White * npc.Opacity, npc.rotation, vector, npc.scale, spriteEffects, 0f);
|
||||
|
||||
return false;
|
||||
|
||||
@@ -421,10 +421,44 @@ namespace CalamityMod.NPCs.ExoMechs.Ares
|
||||
Texture2D texture = Main.npcTexture[npc.type];
|
||||
Rectangle frame = new Rectangle(npc.width * frameX, npc.height * frameY, npc.width, npc.height);
|
||||
Vector2 vector = new Vector2(npc.width / 2, npc.height / 2);
|
||||
Color afterimageBaseColor = Color.White;
|
||||
int numAfterimages = 5;
|
||||
|
||||
if (CalamityConfig.Instance.Afterimages)
|
||||
{
|
||||
for (int i = 1; i < numAfterimages; i += 2)
|
||||
{
|
||||
Color afterimageColor = drawColor;
|
||||
afterimageColor = Color.Lerp(afterimageColor, afterimageBaseColor, 0.5f);
|
||||
afterimageColor = npc.GetAlpha(afterimageColor);
|
||||
afterimageColor *= (numAfterimages - i) / 15f;
|
||||
Vector2 afterimageCenter = npc.oldPos[i] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition;
|
||||
afterimageCenter -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f;
|
||||
afterimageCenter += vector * npc.scale + new Vector2(0f, npc.gfxOffY);
|
||||
spriteBatch.Draw(texture, afterimageCenter, npc.frame, afterimageColor, npc.rotation, vector, npc.scale, spriteEffects, 0f);
|
||||
}
|
||||
}
|
||||
|
||||
Vector2 center = npc.Center - Main.screenPosition;
|
||||
spriteBatch.Draw(texture, center, frame, npc.GetAlpha(drawColor), npc.rotation, vector, npc.scale, spriteEffects, 0f);
|
||||
|
||||
texture = ModContent.GetTexture("CalamityMod/NPCs/ExoMechs/Ares/AresPlasmaFlamethrowerGlow");
|
||||
|
||||
if (CalamityConfig.Instance.Afterimages)
|
||||
{
|
||||
for (int i = 1; i < numAfterimages; i += 2)
|
||||
{
|
||||
Color afterimageColor = drawColor;
|
||||
afterimageColor = Color.Lerp(afterimageColor, afterimageBaseColor, 0.5f);
|
||||
afterimageColor = npc.GetAlpha(afterimageColor);
|
||||
afterimageColor *= (numAfterimages - i) / 15f;
|
||||
Vector2 afterimageCenter = npc.oldPos[i] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition;
|
||||
afterimageCenter -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f;
|
||||
afterimageCenter += vector * npc.scale + new Vector2(0f, npc.gfxOffY);
|
||||
spriteBatch.Draw(texture, afterimageCenter, npc.frame, afterimageColor, npc.rotation, vector, npc.scale, spriteEffects, 0f);
|
||||
}
|
||||
}
|
||||
|
||||
spriteBatch.Draw(texture, center, frame, Color.White * npc.Opacity, npc.rotation, vector, npc.scale, spriteEffects, 0f);
|
||||
|
||||
return false;
|
||||
|
||||
@@ -422,10 +422,44 @@ namespace CalamityMod.NPCs.ExoMechs.Ares
|
||||
Texture2D texture = Main.npcTexture[npc.type];
|
||||
Rectangle frame = new Rectangle(npc.width * frameX, npc.height * frameY, npc.width, npc.height);
|
||||
Vector2 vector = new Vector2(npc.width / 2, npc.height / 2);
|
||||
Color afterimageBaseColor = Color.White;
|
||||
int numAfterimages = 5;
|
||||
|
||||
if (CalamityConfig.Instance.Afterimages)
|
||||
{
|
||||
for (int i = 1; i < numAfterimages; i += 2)
|
||||
{
|
||||
Color afterimageColor = drawColor;
|
||||
afterimageColor = Color.Lerp(afterimageColor, afterimageBaseColor, 0.5f);
|
||||
afterimageColor = npc.GetAlpha(afterimageColor);
|
||||
afterimageColor *= (numAfterimages - i) / 15f;
|
||||
Vector2 afterimageCenter = npc.oldPos[i] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition;
|
||||
afterimageCenter -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f;
|
||||
afterimageCenter += vector * npc.scale + new Vector2(0f, npc.gfxOffY);
|
||||
spriteBatch.Draw(texture, afterimageCenter, npc.frame, afterimageColor, npc.rotation, vector, npc.scale, spriteEffects, 0f);
|
||||
}
|
||||
}
|
||||
|
||||
Vector2 center = npc.Center - Main.screenPosition;
|
||||
spriteBatch.Draw(texture, center, frame, npc.GetAlpha(drawColor), npc.rotation, vector, npc.scale, spriteEffects, 0f);
|
||||
|
||||
texture = ModContent.GetTexture("CalamityMod/NPCs/ExoMechs/Ares/AresTeslaCannonGlow");
|
||||
|
||||
if (CalamityConfig.Instance.Afterimages)
|
||||
{
|
||||
for (int i = 1; i < numAfterimages; i += 2)
|
||||
{
|
||||
Color afterimageColor = drawColor;
|
||||
afterimageColor = Color.Lerp(afterimageColor, afterimageBaseColor, 0.5f);
|
||||
afterimageColor = npc.GetAlpha(afterimageColor);
|
||||
afterimageColor *= (numAfterimages - i) / 15f;
|
||||
Vector2 afterimageCenter = npc.oldPos[i] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition;
|
||||
afterimageCenter -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f;
|
||||
afterimageCenter += vector * npc.scale + new Vector2(0f, npc.gfxOffY);
|
||||
spriteBatch.Draw(texture, afterimageCenter, npc.frame, afterimageColor, npc.rotation, vector, npc.scale, spriteEffects, 0f);
|
||||
}
|
||||
}
|
||||
|
||||
spriteBatch.Draw(texture, center, frame, Color.White * npc.Opacity, npc.rotation, vector, npc.scale, spriteEffects, 0f);
|
||||
|
||||
return false;
|
||||
|
||||
@@ -813,6 +813,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis
|
||||
// Shoot lens gore at the target at the proper time
|
||||
if (calamityGlobalNPC.newAI[2] == lensPopTime)
|
||||
{
|
||||
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/LargeWeaponFire"), npc.Center);
|
||||
Vector2 goreVelocity = Vector2.Normalize(rotationVector);
|
||||
Vector2 offset = goreVelocity * 70f;
|
||||
Gore.NewGore(npc.Center + offset, goreVelocity * 24f, mod.GetGoreSlot("Gores/Artemis/ArtemisTransitionGore"), 1f);
|
||||
@@ -832,6 +833,28 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis
|
||||
}
|
||||
}
|
||||
|
||||
public override bool CanHitPlayer(Player target, ref int cooldownSlot)
|
||||
{
|
||||
cooldownSlot = 1;
|
||||
|
||||
Rectangle targetHitbox = target.Hitbox;
|
||||
|
||||
float dist1 = Vector2.Distance(npc.Center, targetHitbox.TopLeft());
|
||||
float dist2 = Vector2.Distance(npc.Center, targetHitbox.TopRight());
|
||||
float dist3 = Vector2.Distance(npc.Center, targetHitbox.BottomLeft());
|
||||
float dist4 = Vector2.Distance(npc.Center, targetHitbox.BottomRight());
|
||||
|
||||
float minDist = dist1;
|
||||
if (dist2 < minDist)
|
||||
minDist = dist2;
|
||||
if (dist3 < minDist)
|
||||
minDist = dist3;
|
||||
if (dist4 < minDist)
|
||||
minDist = dist4;
|
||||
|
||||
return minDist <= 100f && npc.Opacity == 1f;
|
||||
}
|
||||
|
||||
public override bool StrikeNPC(ref double damage, int defense, ref float knockback, int hitDirection, ref bool crit) => !CalamityUtils.AntiButcher(npc, ref damage, 0.5f);
|
||||
|
||||
public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position)
|
||||
@@ -919,10 +942,44 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis
|
||||
Texture2D texture = Main.npcTexture[npc.type];
|
||||
Rectangle frame = new Rectangle(npc.width * frameX, npc.height * frameY, npc.width, npc.height);
|
||||
Vector2 vector = new Vector2(npc.width / 2, npc.height / 2);
|
||||
Color afterimageBaseColor = Color.White;
|
||||
int numAfterimages = 5;
|
||||
|
||||
if (CalamityConfig.Instance.Afterimages)
|
||||
{
|
||||
for (int i = 1; i < numAfterimages; i += 2)
|
||||
{
|
||||
Color afterimageColor = drawColor;
|
||||
afterimageColor = Color.Lerp(afterimageColor, afterimageBaseColor, 0.5f);
|
||||
afterimageColor = npc.GetAlpha(afterimageColor);
|
||||
afterimageColor *= (numAfterimages - i) / 15f;
|
||||
Vector2 afterimageCenter = npc.oldPos[i] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition;
|
||||
afterimageCenter -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f;
|
||||
afterimageCenter += vector * npc.scale + new Vector2(0f, npc.gfxOffY);
|
||||
spriteBatch.Draw(texture, afterimageCenter, npc.frame, afterimageColor, npc.rotation, vector, npc.scale, SpriteEffects.None, 0f);
|
||||
}
|
||||
}
|
||||
|
||||
Vector2 center = npc.Center - Main.screenPosition;
|
||||
spriteBatch.Draw(texture, center, frame, npc.GetAlpha(drawColor), npc.rotation, vector, npc.scale, SpriteEffects.None, 0f);
|
||||
|
||||
texture = ModContent.GetTexture("CalamityMod/NPCs/ExoMechs/Artemis/ArtemisGlow");
|
||||
|
||||
if (CalamityConfig.Instance.Afterimages)
|
||||
{
|
||||
for (int i = 1; i < numAfterimages; i += 2)
|
||||
{
|
||||
Color afterimageColor = drawColor;
|
||||
afterimageColor = Color.Lerp(afterimageColor, afterimageBaseColor, 0.5f);
|
||||
afterimageColor = npc.GetAlpha(afterimageColor);
|
||||
afterimageColor *= (numAfterimages - i) / 15f;
|
||||
Vector2 afterimageCenter = npc.oldPos[i] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition;
|
||||
afterimageCenter -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f;
|
||||
afterimageCenter += vector * npc.scale + new Vector2(0f, npc.gfxOffY);
|
||||
spriteBatch.Draw(texture, afterimageCenter, npc.frame, afterimageColor, npc.rotation, vector, npc.scale, SpriteEffects.None, 0f);
|
||||
}
|
||||
}
|
||||
|
||||
spriteBatch.Draw(texture, center, frame, Color.White * npc.Opacity, npc.rotation, vector, npc.scale, SpriteEffects.None, 0f);
|
||||
|
||||
return false;
|
||||
|
||||
@@ -143,9 +143,16 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
|
||||
npc.Opacity = 0f;
|
||||
}
|
||||
|
||||
// Number of body segments
|
||||
int numSegments = ThanatosHead.minLength;
|
||||
|
||||
// Set timer to whoAmI so that segments don't all fire lasers at the same time
|
||||
if (npc.localAI[2] == 0f)
|
||||
{
|
||||
npc.localAI[2] = npc.ai[0];
|
||||
if (npc.localAI[2] > numSegments)
|
||||
npc.localAI[2] -= numSegments;
|
||||
}
|
||||
|
||||
// Percent life remaining
|
||||
float lifeRatio = npc.life / (float)npc.lifeMax;
|
||||
@@ -175,11 +182,10 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
|
||||
if (npc.Calamity().newAI[0] == 0f)
|
||||
npc.ai[3] += 1f;
|
||||
|
||||
double numSegmentsAbleToFire = malice ? 30D : death ? 20D : revenge ? 17.5 : expertMode ? 15D : 10D;
|
||||
if (calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge && !berserk)
|
||||
{
|
||||
float divisor = 120f;
|
||||
int numSegments = ThanatosHead.minLength;
|
||||
double numSegmentsAbleToFire = malice ? 30D : death ? 20D : revenge ? 17.5 : expertMode ? 15D : 10D;
|
||||
float segmentDivisor = (float)Math.Round(numSegments / numSegmentsAbleToFire);
|
||||
if ((npc.ai[3] % divisor == 0f && npc.localAI[2] % segmentDivisor == 0f) || npc.Calamity().newAI[0] > 0f)
|
||||
{
|
||||
@@ -191,6 +197,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
|
||||
npc.Calamity().newAI[0] += 1f;
|
||||
if (npc.Calamity().newAI[0] >= 72f)
|
||||
{
|
||||
npc.ai[3] = 0f;
|
||||
npc.Calamity().newAI[1] = 1f;
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
@@ -243,15 +250,9 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
|
||||
else
|
||||
{
|
||||
// This is only used in deathray phase to prevent laser spam
|
||||
int numSegments = ThanatosHead.minLength;
|
||||
double numSegmentsAbleToFire = 5D;
|
||||
float segmentDivisor = (float)Math.Round(numSegments / numSegmentsAbleToFire);
|
||||
|
||||
npc.ai[3] += 1f;
|
||||
float shootProjectile = 120f;
|
||||
float timer = npc.ai[0] + 15f;
|
||||
float divisor = timer + shootProjectile;
|
||||
if ((npc.ai[3] % divisor == 0f && (npc.localAI[2] % segmentDivisor == 0f || !berserk)) || npc.Calamity().newAI[0] > 0f)
|
||||
float segmentDivisor = (float)Math.Round(numSegments / (berserk ? 5D : numSegmentsAbleToFire));
|
||||
float divisor = npc.localAI[2] * 3f; // Ranges from 3 to 300
|
||||
if ((npc.ai[3] == divisor && npc.localAI[2] % segmentDivisor == 0f) || npc.Calamity().newAI[0] > 0f)
|
||||
{
|
||||
// Body is vulnerable while firing lasers
|
||||
vulnerable = true;
|
||||
@@ -261,6 +262,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
|
||||
npc.Calamity().newAI[0] += 1f;
|
||||
if (npc.Calamity().newAI[0] >= 72f)
|
||||
{
|
||||
npc.ai[3] = 0f;
|
||||
npc.Calamity().newAI[1] = 1f;
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
@@ -333,12 +335,17 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
|
||||
}
|
||||
else
|
||||
{
|
||||
if (npc.ai[3] > 0f)
|
||||
npc.ai[3] = 0f;
|
||||
|
||||
// Set alternating laser-firing body segments every 3 seconds
|
||||
npc.localAI[1] += 1f;
|
||||
if (npc.localAI[1] >= 180f)
|
||||
{
|
||||
npc.localAI[1] = 0f;
|
||||
npc.localAI[2] += 1f;
|
||||
if (npc.localAI[2] > numSegments)
|
||||
npc.localAI[2] -= numSegments;
|
||||
}
|
||||
|
||||
npc.Calamity().newAI[0] -= 1f;
|
||||
|
||||
@@ -143,9 +143,16 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
|
||||
npc.Opacity = 0f;
|
||||
}
|
||||
|
||||
// Number of body segments
|
||||
int numSegments = ThanatosHead.minLength;
|
||||
|
||||
// Set timer to whoAmI so that segments don't all fire lasers at the same time
|
||||
if (npc.localAI[2] == 0f)
|
||||
{
|
||||
npc.localAI[2] = npc.ai[0];
|
||||
if (npc.localAI[2] > numSegments)
|
||||
npc.localAI[2] -= numSegments;
|
||||
}
|
||||
|
||||
// Percent life remaining
|
||||
float lifeRatio = npc.life / (float)npc.lifeMax;
|
||||
@@ -175,11 +182,10 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
|
||||
if (npc.Calamity().newAI[0] == 0f)
|
||||
npc.ai[3] += 1f;
|
||||
|
||||
double numSegmentsAbleToFire = malice ? 30D : death ? 20D : revenge ? 17.5 : expertMode ? 15D : 10D;
|
||||
if (calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge && !berserk)
|
||||
{
|
||||
float divisor = 120f;
|
||||
int numSegments = ThanatosHead.minLength;
|
||||
double numSegmentsAbleToFire = malice ? 30D : death ? 20D : revenge ? 17.5 : expertMode ? 15D : 10D;
|
||||
float segmentDivisor = (float)Math.Round(numSegments / numSegmentsAbleToFire);
|
||||
if ((npc.ai[3] % divisor == 0f && npc.localAI[2] % segmentDivisor == 0f) || npc.Calamity().newAI[0] > 0f)
|
||||
{
|
||||
@@ -191,6 +197,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
|
||||
npc.Calamity().newAI[0] += 1f;
|
||||
if (npc.Calamity().newAI[0] >= 72f)
|
||||
{
|
||||
npc.ai[3] = 0f;
|
||||
npc.Calamity().newAI[1] = 1f;
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
@@ -243,15 +250,9 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
|
||||
else
|
||||
{
|
||||
// This is only used in deathray phase to prevent laser spam
|
||||
int numSegments = ThanatosHead.minLength;
|
||||
double numSegmentsAbleToFire = 5D;
|
||||
float segmentDivisor = (float)Math.Round(numSegments / numSegmentsAbleToFire);
|
||||
|
||||
npc.ai[3] += 1f;
|
||||
float shootProjectile = 120f;
|
||||
float timer = npc.ai[0] + 15f;
|
||||
float divisor = timer + shootProjectile;
|
||||
if ((npc.ai[3] % divisor == 0f && (npc.localAI[2] % segmentDivisor == 0f || !berserk)) || npc.Calamity().newAI[0] > 0f)
|
||||
float segmentDivisor = (float)Math.Round(numSegments / (berserk ? 5D : numSegmentsAbleToFire));
|
||||
float divisor = npc.localAI[2] * 3f; // Ranges from 3 to 300
|
||||
if ((npc.ai[3] == divisor && npc.localAI[2] % segmentDivisor == 0f) || npc.Calamity().newAI[0] > 0f)
|
||||
{
|
||||
// Body is vulnerable while firing lasers
|
||||
vulnerable = true;
|
||||
@@ -261,6 +262,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
|
||||
npc.Calamity().newAI[0] += 1f;
|
||||
if (npc.Calamity().newAI[0] >= 72f)
|
||||
{
|
||||
npc.ai[3] = 0f;
|
||||
npc.Calamity().newAI[1] = 1f;
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
@@ -333,12 +335,17 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
|
||||
}
|
||||
else
|
||||
{
|
||||
if (npc.ai[3] > 0f)
|
||||
npc.ai[3] = 0f;
|
||||
|
||||
// Set alternating laser-firing body segments every 3 seconds
|
||||
npc.localAI[1] += 1f;
|
||||
if (npc.localAI[1] >= 180f)
|
||||
{
|
||||
npc.localAI[1] = 0f;
|
||||
npc.localAI[2] += 1f;
|
||||
if (npc.localAI[2] > numSegments)
|
||||
npc.localAI[2] -= numSegments;
|
||||
}
|
||||
|
||||
npc.Calamity().newAI[0] -= 1f;
|
||||
|
||||
@@ -374,6 +374,11 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
|
||||
baseVelocity *= 1.5f;
|
||||
turnDegrees *= 1.5f;
|
||||
}
|
||||
|
||||
// Increase top velocity if target is dead
|
||||
if (targetDead)
|
||||
baseVelocity *= 4f;
|
||||
|
||||
float turnSpeed = MathHelper.ToRadians(turnDegrees);
|
||||
float chargeVelocityMult = MathHelper.Lerp(1f, 1.5f, chargeVelocityScalar);
|
||||
float chargeTurnSpeedMult = MathHelper.Lerp(1f, 1.5f, chargeVelocityScalar);
|
||||
|
||||
@@ -142,9 +142,16 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
|
||||
npc.Opacity = 0f;
|
||||
}
|
||||
|
||||
// Number of body segments
|
||||
int numSegments = ThanatosHead.minLength;
|
||||
|
||||
// Set timer to whoAmI so that segments don't all fire lasers at the same time
|
||||
if (npc.localAI[2] == 0f)
|
||||
{
|
||||
npc.localAI[2] = npc.ai[0];
|
||||
if (npc.localAI[2] > numSegments)
|
||||
npc.localAI[2] -= numSegments;
|
||||
}
|
||||
|
||||
// Percent life remaining
|
||||
float lifeRatio = npc.life / (float)npc.lifeMax;
|
||||
@@ -174,11 +181,10 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
|
||||
if (npc.Calamity().newAI[0] == 0f)
|
||||
npc.ai[3] += 1f;
|
||||
|
||||
double numSegmentsAbleToFire = malice ? 30D : death ? 20D : revenge ? 17.5 : expertMode ? 15D : 10D;
|
||||
if (calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge && !berserk)
|
||||
{
|
||||
float divisor = 120f;
|
||||
int numSegments = ThanatosHead.minLength;
|
||||
double numSegmentsAbleToFire = malice ? 30D : death ? 20D : revenge ? 17.5 : expertMode ? 15D : 10D;
|
||||
float segmentDivisor = (float)Math.Round(numSegments / numSegmentsAbleToFire);
|
||||
if ((npc.ai[3] % divisor == 0f && npc.localAI[2] % segmentDivisor == 0f) || npc.Calamity().newAI[0] > 0f)
|
||||
{
|
||||
@@ -190,6 +196,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
|
||||
npc.Calamity().newAI[0] += 1f;
|
||||
if (npc.Calamity().newAI[0] >= 72f)
|
||||
{
|
||||
npc.ai[3] = 0f;
|
||||
npc.Calamity().newAI[1] = 1f;
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
@@ -242,15 +249,9 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
|
||||
else
|
||||
{
|
||||
// This is only used in deathray phase to prevent laser spam
|
||||
int numSegments = ThanatosHead.minLength;
|
||||
double numSegmentsAbleToFire = 5D;
|
||||
float segmentDivisor = (float)Math.Round(numSegments / numSegmentsAbleToFire);
|
||||
|
||||
npc.ai[3] += 1f;
|
||||
float shootProjectile = 120f;
|
||||
float timer = npc.ai[0] + 15f;
|
||||
float divisor = timer + shootProjectile;
|
||||
if ((npc.ai[3] % divisor == 0f && (npc.localAI[2] % segmentDivisor == 0f || !berserk)) || npc.Calamity().newAI[0] > 0f)
|
||||
float segmentDivisor = (float)Math.Round(numSegments / (berserk ? 5D : numSegmentsAbleToFire));
|
||||
float divisor = npc.localAI[2] * 3f; // Ranges from 3 to 300
|
||||
if ((npc.ai[3] == divisor && npc.localAI[2] % segmentDivisor == 0f) || npc.Calamity().newAI[0] > 0f)
|
||||
{
|
||||
// Body is vulnerable while firing lasers
|
||||
vulnerable = true;
|
||||
@@ -260,6 +261,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
|
||||
npc.Calamity().newAI[0] += 1f;
|
||||
if (npc.Calamity().newAI[0] >= 72f)
|
||||
{
|
||||
npc.ai[3] = 0f;
|
||||
npc.Calamity().newAI[1] = 1f;
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
@@ -332,12 +334,17 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos
|
||||
}
|
||||
else
|
||||
{
|
||||
if (npc.ai[3] > 0f)
|
||||
npc.ai[3] = 0f;
|
||||
|
||||
// Set alternating laser-firing body segments every 3 seconds
|
||||
npc.localAI[1] += 1f;
|
||||
if (npc.localAI[1] >= 180f)
|
||||
{
|
||||
npc.localAI[1] = 0f;
|
||||
npc.localAI[2] += 1f;
|
||||
if (npc.localAI[2] > numSegments)
|
||||
npc.localAI[2] -= numSegments;
|
||||
}
|
||||
|
||||
npc.Calamity().newAI[0] -= 1f;
|
||||
|
||||
@@ -152,8 +152,9 @@ namespace CalamityMod.NPCs.StormWeaver
|
||||
npc.localAI[0] = 0f;
|
||||
npc.TargetClosest();
|
||||
npc.netUpdate = true;
|
||||
float xPos = Main.rand.NextBool(2) ? Main.player[npc.target].position.X + 500f : Main.player[npc.target].position.X - 500f;
|
||||
Vector2 spawnPos = new Vector2(xPos, Main.player[npc.target].position.Y + Main.rand.Next(-500, 501));
|
||||
float xPos = Main.rand.NextBool(2) ? Main.player[npc.target].position.X + 375f : Main.player[npc.target].position.X - 375f;
|
||||
float yPos = Main.rand.NextBool(2) ? Main.player[npc.target].position.Y + 375f : Main.player[npc.target].position.Y - 375f;
|
||||
Vector2 spawnPos = new Vector2(xPos, yPos);
|
||||
int type = ProjectileID.CultistBossLightningOrb;
|
||||
int damage = npc.GetProjectileDamage(type);
|
||||
Projectile.NewProjectile(spawnPos, Vector2.Zero, type, damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
|
||||
@@ -209,10 +209,8 @@ namespace CalamityMod.NPCs.StormWeaver
|
||||
npc.localAI[0] = 0f;
|
||||
npc.netUpdate = true;
|
||||
|
||||
int random = Main.rand.Next(250, 501);
|
||||
float xPos = Main.rand.NextBool(2) ? Main.player[npc.target].position.X + random : Main.player[npc.target].position.X - random;
|
||||
random = Main.rand.Next(250, 501);
|
||||
float yPos = Main.rand.NextBool(2) ? Main.player[npc.target].position.Y + random : Main.player[npc.target].position.Y - random;
|
||||
float xPos = Main.rand.NextBool(2) ? Main.player[npc.target].position.X + 250f : Main.player[npc.target].position.X - 250f;
|
||||
float yPos = Main.rand.NextBool(2) ? Main.player[npc.target].position.Y + 250f : Main.player[npc.target].position.Y - 250f;
|
||||
Vector2 spawnPos = new Vector2(xPos, yPos);
|
||||
|
||||
int type = ProjectileID.CultistBossLightningOrb;
|
||||
|
||||
Reference in new issue
Block a user