Merge branch 'master' of https://github.com/UncleDanny/CalamityMod
No files matched your search
@@ -1,4 +1,6 @@
|
||||
using CalamityMod.NPCs;
|
||||
using CalamityMod.CalPlayer;
|
||||
using CalamityMod.NPCs;
|
||||
using CalamityMod.World;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
@@ -27,8 +29,11 @@ namespace CalamityMod.Items.Accessories
|
||||
|
||||
public override void UpdateAccessory(Player player, bool hideVisual)
|
||||
{
|
||||
if (CalamityGlobalNPC.AnyBossNPCS())
|
||||
if (CalamityPlayer.areThereAnyDamnBosses)
|
||||
{ return; }
|
||||
CalamityPlayer modPlayer = player.Calamity();
|
||||
modPlayer.dashMod = modPlayer.dashMod == 7 ? 0 : modPlayer.dashMod; //statis belt memes for projectile spam :feelsgreat:
|
||||
|
||||
if (player.velocity.X > 5f)
|
||||
{
|
||||
player.velocity.X *= 1.025f;
|
||||
|
||||
|
Before Width: | Height: | Size: 304 B After Width: | Height: | Size: 641 B |
@@ -1,6 +1,7 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.NPCs.NormalNPCs;
|
||||
|
||||
namespace CalamityMod.Items
|
||||
{
|
||||
@@ -39,9 +40,9 @@ namespace CalamityMod.Items
|
||||
{
|
||||
if (player.altFunctionUse == 2)
|
||||
{
|
||||
for (int i = 0; i < 200; i++)
|
||||
for (int i = 0; i < Main.maxNPCs; i++)
|
||||
{
|
||||
if (Main.npc[i].type == ModContent.NPCType<NPCs.NormalNPCs.SuperDummy>())
|
||||
if (Main.npc[i].type == ModContent.NPCType<SuperDummyNPC>())
|
||||
{
|
||||
Main.npc[i].life = 0;
|
||||
Main.npc[i].lifeRegen = 0;
|
||||
@@ -54,7 +55,7 @@ namespace CalamityMod.Items
|
||||
{
|
||||
int x = (int)Main.MouseWorld.X - 9;
|
||||
int y = (int)Main.MouseWorld.Y - 20;
|
||||
NPC.NewNPC(x, y, ModContent.NPCType<NPCs.NormalNPCs.SuperDummy>());
|
||||
NPC.NewNPC(x, y, ModContent.NPCType<SuperDummyNPC>());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -63,7 +64,7 @@ namespace CalamityMod.Items
|
||||
{
|
||||
ModRecipe recipe = new ModRecipe(mod);
|
||||
recipe.AddIngredient(ItemID.TargetDummy);
|
||||
recipe.AddTile(TileID.MythrilAnvil);
|
||||
recipe.AddTile(TileID.Anvils);
|
||||
recipe.SetResult(this);
|
||||
recipe.AddRecipe();
|
||||
}
|
||||
|
||||
@@ -309,8 +309,9 @@ namespace CalamityMod.NPCs.AstrumAureus
|
||||
|
||||
for (int num163 = 1; num163 < num153; num163++)
|
||||
{
|
||||
Color color41 = Color.Lerp(Color.White, color40, 0.5f);
|
||||
Color color41 = color40;
|
||||
color41 = Color.Lerp(color41, color36, amount9);
|
||||
color41 = npc.GetAlpha(color41);
|
||||
color41 *= (float)(num153 - num163) / 15f;
|
||||
Vector2 vector44 = npc.oldPos[num163] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition;
|
||||
vector44 -= new Vector2((float)GlowMaskTexture.Width, (float)(GlowMaskTexture.Height / frameCount)) * scale / 2f;
|
||||
|
||||
@@ -207,11 +207,6 @@ namespace CalamityMod.NPCs.AstrumAureus
|
||||
}
|
||||
}
|
||||
|
||||
public override Color? GetAlpha(Color drawColor)
|
||||
{
|
||||
return new Color(200, 200, 200, npc.alpha);
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
|
||||
@@ -21,7 +21,8 @@ namespace CalamityMod.NPCs.Calamitas
|
||||
{
|
||||
DisplayName.SetDefault("Calamitas");
|
||||
Main.npcFrameCount[npc.type] = 6;
|
||||
}
|
||||
NPCID.Sets.TrailingMode[npc.type] = 1;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
@@ -44,8 +45,6 @@ namespace CalamityMod.NPCs.Calamitas
|
||||
npc.aiStyle = -1;
|
||||
aiType = -1;
|
||||
npc.knockBackResist = 0f;
|
||||
NPCID.Sets.TrailCacheLength[npc.type] = 8;
|
||||
NPCID.Sets.TrailingMode[npc.type] = 1;
|
||||
for (int k = 0; k < npc.buffImmune.Length; k++)
|
||||
{
|
||||
npc.buffImmune[k] = true;
|
||||
@@ -92,48 +91,55 @@ namespace CalamityMod.NPCs.Calamitas
|
||||
CalamityAI.CalamitasCloneAI(npc, mod, false);
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor)
|
||||
{
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
Color color24 = npc.GetAlpha(drawColor);
|
||||
Color color25 = Lighting.GetColor((int)((double)npc.position.X + (double)npc.width * 0.5) / 16, (int)(((double)npc.position.Y + (double)npc.height * 0.5) / 16.0));
|
||||
Texture2D texture2D3 = Main.npcTexture[npc.type];
|
||||
int num156 = Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type];
|
||||
int y3 = num156 * (int)npc.frameCounter;
|
||||
Rectangle rectangle = new Rectangle(0, y3, texture2D3.Width, num156);
|
||||
Vector2 origin2 = rectangle.Size() / 2f;
|
||||
int num157 = 8;
|
||||
int num158 = 2;
|
||||
int num159 = 1;
|
||||
float num160 = 0f;
|
||||
int num161 = num159;
|
||||
while (((num158 > 0 && num161 < num157) || (num158 < 0 && num161 > num157)) && Lighting.NotRetro)
|
||||
{
|
||||
Color color26 = npc.GetAlpha(color25);
|
||||
{
|
||||
goto IL_6899;
|
||||
}
|
||||
IL_6881:
|
||||
num161 += num158;
|
||||
continue;
|
||||
IL_6899:
|
||||
float num164 = (float)(num157 - num161);
|
||||
if (num158 < 0)
|
||||
{
|
||||
num164 = (float)(num159 - num161);
|
||||
}
|
||||
color26 *= num164 / ((float)NPCID.Sets.TrailCacheLength[npc.type] * 1.5f);
|
||||
Vector2 value4 = npc.oldPos[num161];
|
||||
float num165 = npc.rotation;
|
||||
Main.spriteBatch.Draw(texture2D3, value4 + npc.Size / 2f - Main.screenPosition + new Vector2(0, npc.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rectangle), color26, num165 + npc.rotation * num160 * (float)(num161 - 1) * -(float)spriteEffects.HasFlag(SpriteEffects.FlipHorizontally).ToDirectionInt(), origin2, npc.scale, spriteEffects, 0f);
|
||||
goto IL_6881;
|
||||
}
|
||||
var something = npc.direction == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally;
|
||||
spriteBatch.Draw(texture2D3, npc.Center - Main.screenPosition + new Vector2(0, npc.gfxOffY), npc.frame, color24, npc.rotation, npc.frame.Size() / 2, npc.scale, something, 0);
|
||||
return false;
|
||||
}
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
if (npc.spriteDirection == 1)
|
||||
spriteEffects = SpriteEffects.FlipHorizontally;
|
||||
|
||||
public override bool PreNPCLoot()
|
||||
Texture2D texture2D15 = Main.npcTexture[npc.type];
|
||||
Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2));
|
||||
Color color36 = Color.White;
|
||||
float amount9 = 0.5f;
|
||||
int num153 = 7;
|
||||
|
||||
for (int num155 = 1; num155 < num153; num155 += 2)
|
||||
{
|
||||
Color color38 = lightColor;
|
||||
color38 = Color.Lerp(color38, color36, amount9);
|
||||
color38 = npc.GetAlpha(color38);
|
||||
color38 *= (float)(num153 - num155) / 15f;
|
||||
Vector2 vector41 = npc.oldPos[num155] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition;
|
||||
vector41 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
|
||||
vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector41, new Rectangle?(npc.frame), color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
}
|
||||
|
||||
Vector2 vector43 = npc.Center - Main.screenPosition;
|
||||
vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
|
||||
vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/Calamitas/CalamitasGlow");
|
||||
Color color37 = Color.Lerp(Color.White, Color.Red, 0.5f);
|
||||
|
||||
for (int num163 = 1; num163 < num153; num163++)
|
||||
{
|
||||
Color color41 = color37;
|
||||
color41 = Color.Lerp(color41, color36, amount9);
|
||||
color41 *= (float)(num153 - num163) / 15f;
|
||||
Vector2 vector44 = npc.oldPos[num163] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition;
|
||||
vector44 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
|
||||
vector44 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector44, new Rectangle?(npc.frame), color41, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
}
|
||||
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), color37, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool PreNPCLoot()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -21,7 +21,8 @@ namespace CalamityMod.NPCs.Calamitas
|
||||
{
|
||||
DisplayName.SetDefault("Cataclysm");
|
||||
Main.npcFrameCount[npc.type] = 6;
|
||||
}
|
||||
NPCID.Sets.TrailingMode[npc.type] = 1;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
@@ -43,8 +44,6 @@ namespace CalamityMod.NPCs.Calamitas
|
||||
npc.aiStyle = -1;
|
||||
aiType = -1;
|
||||
npc.knockBackResist = 0f;
|
||||
NPCID.Sets.TrailCacheLength[npc.type] = 8;
|
||||
NPCID.Sets.TrailingMode[npc.type] = 1;
|
||||
for (int k = 0; k < npc.buffImmune.Length; k++)
|
||||
{
|
||||
npc.buffImmune[k] = true;
|
||||
@@ -95,48 +94,55 @@ namespace CalamityMod.NPCs.Calamitas
|
||||
CalamityAI.CataclysmAI(npc, mod);
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor)
|
||||
{
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
Color color24 = npc.GetAlpha(drawColor);
|
||||
Color color25 = Lighting.GetColor((int)((double)npc.position.X + (double)npc.width * 0.5) / 16, (int)(((double)npc.position.Y + (double)npc.height * 0.5) / 16.0));
|
||||
Texture2D texture2D3 = Main.npcTexture[npc.type];
|
||||
int num156 = Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type];
|
||||
int y3 = num156 * (int)npc.frameCounter;
|
||||
Rectangle rectangle = new Rectangle(0, y3, texture2D3.Width, num156);
|
||||
Vector2 origin2 = rectangle.Size() / 2f;
|
||||
int num157 = 8;
|
||||
int num158 = 2;
|
||||
int num159 = 1;
|
||||
float num160 = 0f;
|
||||
int num161 = num159;
|
||||
while (npc.ai[1] > 0f && Lighting.NotRetro && ((num158 > 0 && num161 < num157) || (num158 < 0 && num161 > num157)))
|
||||
{
|
||||
Color color26 = npc.GetAlpha(color25);
|
||||
{
|
||||
goto IL_6899;
|
||||
}
|
||||
IL_6881:
|
||||
num161 += num158;
|
||||
continue;
|
||||
IL_6899:
|
||||
float num164 = (float)(num157 - num161);
|
||||
if (num158 < 0)
|
||||
{
|
||||
num164 = (float)(num159 - num161);
|
||||
}
|
||||
color26 *= num164 / ((float)NPCID.Sets.TrailCacheLength[npc.type] * 1.5f);
|
||||
Vector2 value4 = npc.oldPos[num161];
|
||||
float num165 = npc.rotation;
|
||||
Main.spriteBatch.Draw(texture2D3, value4 + npc.Size / 2f - Main.screenPosition + new Vector2(0, npc.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rectangle), color26, num165 + npc.rotation * num160 * (float)(num161 - 1) * -(float)spriteEffects.HasFlag(SpriteEffects.FlipHorizontally).ToDirectionInt(), origin2, npc.scale, spriteEffects, 0f);
|
||||
goto IL_6881;
|
||||
}
|
||||
var something = npc.direction == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally;
|
||||
spriteBatch.Draw(texture2D3, npc.Center - Main.screenPosition + new Vector2(0, npc.gfxOffY), npc.frame, color24, npc.rotation, npc.frame.Size() / 2, npc.scale, something, 0);
|
||||
return false;
|
||||
}
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
if (npc.spriteDirection == 1)
|
||||
spriteEffects = SpriteEffects.FlipHorizontally;
|
||||
|
||||
public override bool CheckActive()
|
||||
Texture2D texture2D15 = Main.npcTexture[npc.type];
|
||||
Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2));
|
||||
Color color36 = Color.White;
|
||||
float amount9 = 0.5f;
|
||||
int num153 = 7;
|
||||
|
||||
for (int num155 = 1; num155 < num153; num155 += 2)
|
||||
{
|
||||
Color color38 = lightColor;
|
||||
color38 = Color.Lerp(color38, color36, amount9);
|
||||
color38 = npc.GetAlpha(color38);
|
||||
color38 *= (float)(num153 - num155) / 15f;
|
||||
Vector2 vector41 = npc.oldPos[num155] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition;
|
||||
vector41 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
|
||||
vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector41, new Rectangle?(npc.frame), color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
}
|
||||
|
||||
Vector2 vector43 = npc.Center - Main.screenPosition;
|
||||
vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
|
||||
vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/Calamitas/CalamitasRunGlow");
|
||||
Color color37 = Color.Lerp(Color.White, Color.Red, 0.5f);
|
||||
|
||||
for (int num163 = 1; num163 < num153; num163++)
|
||||
{
|
||||
Color color41 = color37;
|
||||
color41 = Color.Lerp(color41, color36, amount9);
|
||||
color41 *= (float)(num153 - num163) / 15f;
|
||||
Vector2 vector44 = npc.oldPos[num163] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition;
|
||||
vector44 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
|
||||
vector44 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector44, new Rectangle?(npc.frame), color41, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
}
|
||||
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), color37, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool CheckActive()
|
||||
{
|
||||
return npc.Calamity().newAI[0] == 1f;
|
||||
}
|
||||
|
||||
@@ -21,7 +21,8 @@ namespace CalamityMod.NPCs.Calamitas
|
||||
{
|
||||
DisplayName.SetDefault("Catastrophe");
|
||||
Main.npcFrameCount[npc.type] = 6;
|
||||
}
|
||||
NPCID.Sets.TrailingMode[npc.type] = 1;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
@@ -45,8 +46,6 @@ namespace CalamityMod.NPCs.Calamitas
|
||||
npc.knockBackResist = 0f;
|
||||
npc.noGravity = true;
|
||||
npc.noTileCollide = true;
|
||||
NPCID.Sets.TrailCacheLength[npc.type] = 8;
|
||||
NPCID.Sets.TrailingMode[npc.type] = 1;
|
||||
for (int k = 0; k < npc.buffImmune.Length; k++)
|
||||
{
|
||||
npc.buffImmune[k] = true;
|
||||
@@ -95,46 +94,53 @@ namespace CalamityMod.NPCs.Calamitas
|
||||
CalamityAI.CatastropheAI(npc, mod);
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor)
|
||||
{
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
Color color24 = npc.GetAlpha(drawColor);
|
||||
Color color25 = Lighting.GetColor((int)((double)npc.position.X + (double)npc.width * 0.5) / 16, (int)(((double)npc.position.Y + (double)npc.height * 0.5) / 16.0));
|
||||
Texture2D texture2D3 = Main.npcTexture[npc.type];
|
||||
int num156 = Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type];
|
||||
int y3 = num156 * (int)npc.frameCounter;
|
||||
Rectangle rectangle = new Rectangle(0, y3, texture2D3.Width, num156);
|
||||
Vector2 origin2 = rectangle.Size() / 2f;
|
||||
int num157 = 8;
|
||||
int num158 = 2;
|
||||
int num159 = 1;
|
||||
float num160 = 0f;
|
||||
int num161 = num159;
|
||||
while (npc.ai[1] > 0f && Lighting.NotRetro && ((num158 > 0 && num161 < num157) || (num158 < 0 && num161 > num157)))
|
||||
{
|
||||
Color color26 = npc.GetAlpha(color25);
|
||||
{
|
||||
goto IL_6899;
|
||||
}
|
||||
IL_6881:
|
||||
num161 += num158;
|
||||
continue;
|
||||
IL_6899:
|
||||
float num164 = (float)(num157 - num161);
|
||||
if (num158 < 0)
|
||||
{
|
||||
num164 = (float)(num159 - num161);
|
||||
}
|
||||
color26 *= num164 / ((float)NPCID.Sets.TrailCacheLength[npc.type] * 1.5f);
|
||||
Vector2 value4 = npc.oldPos[num161];
|
||||
float num165 = npc.rotation;
|
||||
Main.spriteBatch.Draw(texture2D3, value4 + npc.Size / 2f - Main.screenPosition + new Vector2(0, npc.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rectangle), color26, num165 + npc.rotation * num160 * (float)(num161 - 1) * -(float)spriteEffects.HasFlag(SpriteEffects.FlipHorizontally).ToDirectionInt(), origin2, npc.scale, spriteEffects, 0f);
|
||||
goto IL_6881;
|
||||
}
|
||||
var something = npc.direction == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally;
|
||||
spriteBatch.Draw(texture2D3, npc.Center - Main.screenPosition + new Vector2(0, npc.gfxOffY), npc.frame, color24, npc.rotation, npc.frame.Size() / 2, npc.scale, something, 0);
|
||||
return false;
|
||||
}
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
if (npc.spriteDirection == 1)
|
||||
spriteEffects = SpriteEffects.FlipHorizontally;
|
||||
|
||||
Texture2D texture2D15 = Main.npcTexture[npc.type];
|
||||
Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2));
|
||||
Color color36 = Color.White;
|
||||
float amount9 = 0.5f;
|
||||
int num153 = 7;
|
||||
|
||||
for (int num155 = 1; num155 < num153; num155 += 2)
|
||||
{
|
||||
Color color38 = lightColor;
|
||||
color38 = Color.Lerp(color38, color36, amount9);
|
||||
color38 = npc.GetAlpha(color38);
|
||||
color38 *= (float)(num153 - num155) / 15f;
|
||||
Vector2 vector41 = npc.oldPos[num155] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition;
|
||||
vector41 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
|
||||
vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector41, new Rectangle?(npc.frame), color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
}
|
||||
|
||||
Vector2 vector43 = npc.Center - Main.screenPosition;
|
||||
vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
|
||||
vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/Calamitas/CalamitasRun2Glow");
|
||||
Color color37 = Color.Lerp(Color.White, Color.Red, 0.5f);
|
||||
|
||||
for (int num163 = 1; num163 < num153; num163++)
|
||||
{
|
||||
Color color41 = color37;
|
||||
color41 = Color.Lerp(color41, color36, amount9);
|
||||
color41 *= (float)(num153 - num163) / 15f;
|
||||
Vector2 vector44 = npc.oldPos[num163] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition;
|
||||
vector44 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
|
||||
vector44 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector44, new Rectangle?(npc.frame), color41, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
}
|
||||
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), color37, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool CheckActive()
|
||||
{
|
||||
|
||||
@@ -32,7 +32,8 @@ namespace CalamityMod.NPCs.Calamitas
|
||||
{
|
||||
DisplayName.SetDefault("Calamitas");
|
||||
Main.npcFrameCount[npc.type] = 6;
|
||||
}
|
||||
NPCID.Sets.TrailingMode[npc.type] = 1;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
@@ -56,8 +57,6 @@ namespace CalamityMod.NPCs.Calamitas
|
||||
npc.aiStyle = -1;
|
||||
aiType = -1;
|
||||
npc.knockBackResist = 0f;
|
||||
NPCID.Sets.TrailCacheLength[npc.type] = 8;
|
||||
NPCID.Sets.TrailingMode[npc.type] = 1;
|
||||
for (int k = 0; k < npc.buffImmune.Length; k++)
|
||||
{
|
||||
npc.buffImmune[k] = true;
|
||||
@@ -120,48 +119,55 @@ namespace CalamityMod.NPCs.Calamitas
|
||||
CalamityAI.CalamitasCloneAI(npc, mod, true);
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor)
|
||||
{
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
Color color24 = npc.GetAlpha(drawColor);
|
||||
Color color25 = Lighting.GetColor((int)((double)npc.position.X + (double)npc.width * 0.5) / 16, (int)(((double)npc.position.Y + (double)npc.height * 0.5) / 16.0));
|
||||
Texture2D texture2D3 = Main.npcTexture[npc.type];
|
||||
int num156 = Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type];
|
||||
int y3 = num156 * (int)npc.frameCounter;
|
||||
Rectangle rectangle = new Rectangle(0, y3, texture2D3.Width, num156);
|
||||
Vector2 origin2 = rectangle.Size() / 2f;
|
||||
int num157 = 8;
|
||||
int num158 = 2;
|
||||
int num159 = 1;
|
||||
float num160 = 0f;
|
||||
int num161 = num159;
|
||||
while (((num158 > 0 && num161 < num157) || (num158 < 0 && num161 > num157)) && Lighting.NotRetro)
|
||||
{
|
||||
Color color26 = npc.GetAlpha(color25);
|
||||
{
|
||||
goto IL_6899;
|
||||
}
|
||||
IL_6881:
|
||||
num161 += num158;
|
||||
continue;
|
||||
IL_6899:
|
||||
float num164 = (float)(num157 - num161);
|
||||
if (num158 < 0)
|
||||
{
|
||||
num164 = (float)(num159 - num161);
|
||||
}
|
||||
color26 *= num164 / ((float)NPCID.Sets.TrailCacheLength[npc.type] * 1.5f);
|
||||
Vector2 value4 = npc.oldPos[num161];
|
||||
float num165 = npc.rotation;
|
||||
Main.spriteBatch.Draw(texture2D3, value4 + npc.Size / 2f - Main.screenPosition + new Vector2(0, npc.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rectangle), color26, num165 + npc.rotation * num160 * (float)(num161 - 1) * -(float)spriteEffects.HasFlag(SpriteEffects.FlipHorizontally).ToDirectionInt(), origin2, npc.scale, spriteEffects, 0f);
|
||||
goto IL_6881;
|
||||
}
|
||||
var something = npc.direction == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally;
|
||||
spriteBatch.Draw(texture2D3, npc.Center - Main.screenPosition + new Vector2(0, npc.gfxOffY), npc.frame, color24, npc.rotation, npc.frame.Size() / 2, npc.scale, something, 0);
|
||||
return false;
|
||||
}
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
if (npc.spriteDirection == 1)
|
||||
spriteEffects = SpriteEffects.FlipHorizontally;
|
||||
|
||||
public override void NPCLoot()
|
||||
Texture2D texture2D15 = Main.npcTexture[npc.type];
|
||||
Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2));
|
||||
Color color36 = Color.White;
|
||||
float amount9 = 0.5f;
|
||||
int num153 = 7;
|
||||
|
||||
for (int num155 = 1; num155 < num153; num155 += 2)
|
||||
{
|
||||
Color color38 = lightColor;
|
||||
color38 = Color.Lerp(color38, color36, amount9);
|
||||
color38 = npc.GetAlpha(color38);
|
||||
color38 *= (float)(num153 - num155) / 15f;
|
||||
Vector2 vector41 = npc.oldPos[num155] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition;
|
||||
vector41 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
|
||||
vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector41, new Rectangle?(npc.frame), color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
}
|
||||
|
||||
Vector2 vector43 = npc.Center - Main.screenPosition;
|
||||
vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
|
||||
vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/Calamitas/CalamitasRun3Glow");
|
||||
Color color37 = Color.Lerp(Color.White, Color.Red, 0.5f);
|
||||
|
||||
for (int num163 = 1; num163 < num153; num163++)
|
||||
{
|
||||
Color color41 = color37;
|
||||
color41 = Color.Lerp(color41, color36, amount9);
|
||||
color41 *= (float)(num153 - num163) / 15f;
|
||||
Vector2 vector44 = npc.oldPos[num163] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition;
|
||||
vector44 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
|
||||
vector44 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector44, new Rectangle?(npc.frame), color41, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
}
|
||||
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), color37, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void NPCLoot()
|
||||
{
|
||||
DropHelper.DropBags(npc);
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
@@ -12,7 +14,8 @@ namespace CalamityMod.NPCs.Calamitas
|
||||
{
|
||||
DisplayName.SetDefault("Life Seeker");
|
||||
Main.npcFrameCount[npc.type] = 2;
|
||||
}
|
||||
NPCID.Sets.TrailingMode[npc.type] = 1;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
@@ -37,7 +40,55 @@ namespace CalamityMod.NPCs.Calamitas
|
||||
npc.buffImmune[24] = true;
|
||||
}
|
||||
|
||||
public override bool PreNPCLoot()
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
if (npc.spriteDirection == 1)
|
||||
spriteEffects = SpriteEffects.FlipHorizontally;
|
||||
|
||||
Texture2D texture2D15 = Main.npcTexture[npc.type];
|
||||
Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2));
|
||||
Color color36 = Color.White;
|
||||
float amount9 = 0.5f;
|
||||
int num153 = 5;
|
||||
|
||||
for (int num155 = 1; num155 < num153; num155 += 2)
|
||||
{
|
||||
Color color38 = lightColor;
|
||||
color38 = Color.Lerp(color38, color36, amount9);
|
||||
color38 = npc.GetAlpha(color38);
|
||||
color38 *= (float)(num153 - num155) / 15f;
|
||||
Vector2 vector41 = npc.oldPos[num155] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition;
|
||||
vector41 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
|
||||
vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector41, new Rectangle?(npc.frame), color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
}
|
||||
|
||||
Vector2 vector43 = npc.Center - Main.screenPosition;
|
||||
vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
|
||||
vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/Calamitas/LifeSeekerGlow");
|
||||
Color color37 = Color.Lerp(Color.White, Color.Red, 0.5f);
|
||||
|
||||
for (int num163 = 1; num163 < num153; num163++)
|
||||
{
|
||||
Color color41 = color37;
|
||||
color41 = Color.Lerp(color41, color36, amount9);
|
||||
color41 *= (float)(num153 - num163) / 15f;
|
||||
Vector2 vector44 = npc.oldPos[num163] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition;
|
||||
vector44 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
|
||||
vector44 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector44, new Rectangle?(npc.frame), color41, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
}
|
||||
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), color37, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool PreNPCLoot()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,8 @@ namespace CalamityMod.NPCs.Calamitas
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Soul Seeker");
|
||||
}
|
||||
NPCID.Sets.TrailingMode[npc.type] = 1;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
@@ -166,25 +167,52 @@ namespace CalamityMod.NPCs.Calamitas
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor)
|
||||
{
|
||||
if (npc.velocity != Vector2.Zero)
|
||||
{
|
||||
Texture2D texture = Main.npcTexture[npc.type];
|
||||
Vector2 origin = new Vector2(texture.Width * 0.5f, texture.Height * 0.5f);
|
||||
for (int i = 1; i < npc.oldPos.Length; ++i)
|
||||
{
|
||||
Vector2 vector2_2 = npc.oldPos[i];
|
||||
Color color2 = Color.White * npc.Opacity;
|
||||
color2.R = (byte)(0.5 * (double)color2.R * (double)(10 - i) / 20.0);
|
||||
color2.G = (byte)(0.5 * (double)color2.G * (double)(10 - i) / 20.0);
|
||||
color2.B = (byte)(0.5 * (double)color2.B * (double)(10 - i) / 20.0);
|
||||
color2.A = (byte)(0.5 * (double)color2.A * (double)(10 - i) / 20.0);
|
||||
Main.spriteBatch.Draw(Main.npcTexture[npc.type], new Vector2(npc.oldPos[i].X - Main.screenPosition.X + (npc.width / 2),
|
||||
npc.oldPos[i].Y - Main.screenPosition.Y + npc.height / 2), new Rectangle?(npc.frame), color2, npc.oldRot[i], origin, npc.scale, SpriteEffects.None, 0.0f);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
if (npc.spriteDirection == 1)
|
||||
spriteEffects = SpriteEffects.FlipHorizontally;
|
||||
|
||||
Texture2D texture2D15 = Main.npcTexture[npc.type];
|
||||
Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / 2));
|
||||
Color color36 = Color.White;
|
||||
float amount9 = 0.5f;
|
||||
int num153 = 5;
|
||||
|
||||
for (int num155 = 1; num155 < num153; num155 += 2)
|
||||
{
|
||||
Color color38 = lightColor;
|
||||
color38 = Color.Lerp(color38, color36, amount9);
|
||||
color38 = npc.GetAlpha(color38);
|
||||
color38 *= (float)(num153 - num155) / 15f;
|
||||
Vector2 vector41 = npc.oldPos[num155] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition;
|
||||
vector41 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f;
|
||||
vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector41, new Rectangle?(npc.frame), color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
}
|
||||
|
||||
Vector2 vector43 = npc.Center - Main.screenPosition;
|
||||
vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f;
|
||||
vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/Calamitas/SoulSeekerGlow");
|
||||
Color color37 = Color.Lerp(Color.White, Color.Red, 0.5f);
|
||||
|
||||
for (int num163 = 1; num163 < num153; num163++)
|
||||
{
|
||||
Color color41 = color37;
|
||||
color41 = Color.Lerp(color41, color36, amount9);
|
||||
color41 *= (float)(num153 - num163) / 15f;
|
||||
Vector2 vector44 = npc.oldPos[num163] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition;
|
||||
vector44 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f;
|
||||
vector44 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector44, new Rectangle?(npc.frame), color41, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
}
|
||||
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), color37, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -607,7 +607,7 @@ namespace CalamityMod.NPCs
|
||||
CalamityGlobalNPC.brimstoneElemental = npc.whoAmI;
|
||||
|
||||
// Emit light
|
||||
Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 2f, 0f, 0f);
|
||||
Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 1.2f, 0f, 0f);
|
||||
|
||||
// Center
|
||||
Vector2 vectorCenter = npc.Center;
|
||||
@@ -1146,6 +1146,9 @@ namespace CalamityMod.NPCs
|
||||
{
|
||||
CalamityGlobalNPC calamityGlobalNPC = npc.Calamity();
|
||||
|
||||
// Emit light
|
||||
Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 1f, 0f, 0f);
|
||||
|
||||
// Percent life remaining
|
||||
float lifeRatio = (float)npc.life / (float)npc.lifeMax;
|
||||
|
||||
@@ -1607,6 +1610,9 @@ namespace CalamityMod.NPCs
|
||||
{
|
||||
CalamityGlobalNPC calamityGlobalNPC = npc.Calamity();
|
||||
|
||||
// Emit light
|
||||
Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 1f, 0f, 0f);
|
||||
|
||||
CalamityGlobalNPC.cataclysm = npc.whoAmI;
|
||||
|
||||
bool death = CalamityWorld.death || CalamityWorld.bossRushActive;
|
||||
@@ -1877,6 +1883,9 @@ namespace CalamityMod.NPCs
|
||||
{
|
||||
CalamityGlobalNPC calamityGlobalNPC = npc.Calamity();
|
||||
|
||||
// Emit light
|
||||
Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 1f, 0f, 0f);
|
||||
|
||||
CalamityGlobalNPC.catastrophe = npc.whoAmI;
|
||||
|
||||
bool death = CalamityWorld.death || CalamityWorld.bossRushActive;
|
||||
@@ -2209,7 +2218,7 @@ namespace CalamityMod.NPCs
|
||||
|
||||
// Emit light when not Idle
|
||||
if (npc.ai[0] != 1f)
|
||||
Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 2.55f, 1f, 0f);
|
||||
Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 1.3f, 0.5f, 0f);
|
||||
|
||||
// Fire projectiles while walking, teleporting, or falling
|
||||
if (npc.ai[0] == 2f || npc.ai[0] >= 5f || (npc.ai[0] == 4f && npc.velocity.Y > 0f) ||
|
||||
|
||||
@@ -1533,7 +1533,7 @@ namespace CalamityMod.NPCs
|
||||
{
|
||||
SetPatreonTownNPCName(npc);
|
||||
|
||||
if (npc.type == NPCID.TargetDummy || npc.type == ModContent.NPCType<SuperDummy>())
|
||||
if (npc.type == NPCID.TargetDummy || npc.type == ModContent.NPCType<SuperDummyNPC>())
|
||||
{
|
||||
npc.chaseable = !CalamityPlayer.areThereAnyDamnBosses;
|
||||
npc.dontTakeDamage = CalamityPlayer.areThereAnyDamnBosses;
|
||||
|
||||
@@ -20,7 +20,8 @@ namespace CalamityMod.NPCs.CeaselessVoid
|
||||
{
|
||||
DisplayName.SetDefault("Ceaseless Void");
|
||||
Main.npcFrameCount[npc.type] = 6;
|
||||
}
|
||||
NPCID.Sets.TrailingMode[npc.type] = 1;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
@@ -67,12 +68,53 @@ namespace CalamityMod.NPCs.CeaselessVoid
|
||||
npc.frame.Y = frame * frameHeight;
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor)
|
||||
{
|
||||
Texture2D texture = Main.npcTexture[npc.type];
|
||||
CalamityMod.DrawTexture(spriteBatch, texture, 0, npc, drawColor, true);
|
||||
return false;
|
||||
}
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
if (npc.spriteDirection == 1)
|
||||
spriteEffects = SpriteEffects.FlipHorizontally;
|
||||
|
||||
Texture2D texture2D15 = Main.npcTexture[npc.type];
|
||||
Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2));
|
||||
Color color36 = Color.White;
|
||||
float amount9 = 0.5f;
|
||||
int num153 = 7;
|
||||
|
||||
for (int num155 = 1; num155 < num153; num155 += 2)
|
||||
{
|
||||
Color color38 = lightColor;
|
||||
color38 = Color.Lerp(color38, color36, amount9);
|
||||
color38 = npc.GetAlpha(color38);
|
||||
color38 *= (float)(num153 - num155) / 15f;
|
||||
Vector2 vector41 = npc.oldPos[num155] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition;
|
||||
vector41 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
|
||||
vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector41, new Rectangle?(npc.frame), color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
}
|
||||
|
||||
Vector2 vector43 = npc.Center - Main.screenPosition;
|
||||
vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
|
||||
vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/CeaselessVoid/CeaselessVoidGlow");
|
||||
Color color37 = Color.Lerp(Color.White, Color.Cyan, 0.5f);
|
||||
|
||||
for (int num163 = 1; num163 < num153; num163++)
|
||||
{
|
||||
Color color41 = color37;
|
||||
color41 = Color.Lerp(color41, color36, amount9);
|
||||
color41 *= (float)(num153 - num163) / 15f;
|
||||
Vector2 vector44 = npc.oldPos[num163] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition;
|
||||
vector44 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
|
||||
vector44 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector44, new Rectangle?(npc.frame), color41, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
}
|
||||
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), color37, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
|
||||
|
Before Width: | Height: | Size: 9.4 KiB After Width: | Height: | Size: 6.4 KiB |
@@ -2,6 +2,7 @@
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using System.IO;
|
||||
using Terraria;
|
||||
@@ -19,7 +20,8 @@ namespace CalamityMod.NPCs.CeaselessVoid
|
||||
{
|
||||
DisplayName.SetDefault("Dark Energy");
|
||||
Main.npcFrameCount[npc.type] = 6;
|
||||
}
|
||||
NPCID.Sets.TrailingMode[npc.type] = 1;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
@@ -73,7 +75,66 @@ namespace CalamityMod.NPCs.CeaselessVoid
|
||||
npc.frame.Y = frame * frameHeight;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
if (npc.spriteDirection == 1)
|
||||
spriteEffects = SpriteEffects.FlipHorizontally;
|
||||
|
||||
Texture2D texture2D15 = Main.npcTexture[npc.type];
|
||||
Texture2D texture2D16 = ModContent.GetTexture("CalamityMod/NPCs/CeaselessVoid/DarkEnergyGlow2");
|
||||
Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2));
|
||||
Color color36 = Color.White;
|
||||
float amount9 = 0.5f;
|
||||
int num153 = 5;
|
||||
|
||||
for (int num155 = 1; num155 < num153; num155 += 2)
|
||||
{
|
||||
Color color38 = lightColor;
|
||||
color38 = Color.Lerp(color38, color36, amount9);
|
||||
color38 = npc.GetAlpha(color38);
|
||||
color38 *= (float)(num153 - num155) / 15f;
|
||||
Vector2 vector41 = npc.oldPos[num155] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition;
|
||||
vector41 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
|
||||
vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector41, new Rectangle?(npc.frame), color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
}
|
||||
|
||||
Vector2 vector43 = npc.Center - Main.screenPosition;
|
||||
vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
|
||||
vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/CeaselessVoid/DarkEnergyGlow");
|
||||
Color color37 = Color.Lerp(Color.White, Color.Cyan, 0.5f);
|
||||
Color color42 = Color.Lerp(Color.White, Color.Fuchsia, 0.5f);
|
||||
|
||||
for (int num163 = 1; num163 < num153; num163++)
|
||||
{
|
||||
Color color41 = color37;
|
||||
color41 = Color.Lerp(color41, color36, amount9);
|
||||
color41 = npc.GetAlpha(color41);
|
||||
color41 *= (float)(num153 - num163) / 15f;
|
||||
Vector2 vector44 = npc.oldPos[num163] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition;
|
||||
vector44 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
|
||||
vector44 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector44, new Rectangle?(npc.frame), color41, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
Color color43 = color42;
|
||||
color43 = Color.Lerp(color43, color36, amount9);
|
||||
color43 = npc.GetAlpha(color43);
|
||||
color43 *= (float)(num153 - num163) / 15f;
|
||||
spriteBatch.Draw(texture2D16, vector44, new Rectangle?(npc.frame), color43, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
}
|
||||
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), color37, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
spriteBatch.Draw(texture2D16, vector43, new Rectangle?(npc.frame), color42, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
bool expertMode = Main.expertMode || CalamityWorld.bossRushActive;
|
||||
if (invinceTime > 0)
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using System.IO;
|
||||
using Terraria;
|
||||
@@ -19,7 +20,8 @@ namespace CalamityMod.NPCs.CeaselessVoid
|
||||
{
|
||||
DisplayName.SetDefault("Dark Energy");
|
||||
Main.npcFrameCount[npc.type] = 6;
|
||||
}
|
||||
NPCID.Sets.TrailingMode[npc.type] = 1;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
@@ -73,7 +75,64 @@ namespace CalamityMod.NPCs.CeaselessVoid
|
||||
npc.frame.Y = frame * frameHeight;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
if (npc.spriteDirection == 1)
|
||||
spriteEffects = SpriteEffects.FlipHorizontally;
|
||||
|
||||
Texture2D texture2D15 = Main.npcTexture[npc.type];
|
||||
Texture2D texture2D16 = ModContent.GetTexture("CalamityMod/NPCs/CeaselessVoid/DarkEnergyGlow2");
|
||||
Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2));
|
||||
Color color36 = Color.White;
|
||||
float amount9 = 0.5f;
|
||||
int num153 = 5;
|
||||
|
||||
for (int num155 = 1; num155 < num153; num155 += 2)
|
||||
{
|
||||
Color color38 = lightColor;
|
||||
color38 = Color.Lerp(color38, color36, amount9);
|
||||
color38 = npc.GetAlpha(color38);
|
||||
color38 *= (float)(num153 - num155) / 15f;
|
||||
Vector2 vector41 = npc.oldPos[num155] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition;
|
||||
vector41 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
|
||||
vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector41, new Rectangle?(npc.frame), color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
}
|
||||
|
||||
Vector2 vector43 = npc.Center - Main.screenPosition;
|
||||
vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
|
||||
vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/CeaselessVoid/DarkEnergyGlow");
|
||||
Color color37 = Color.Lerp(Color.White, Color.Cyan, 0.5f);
|
||||
Color color42 = Color.Lerp(Color.White, Color.Fuchsia, 0.5f);
|
||||
|
||||
for (int num163 = 1; num163 < num153; num163++)
|
||||
{
|
||||
Color color41 = color37;
|
||||
color41 = Color.Lerp(color41, color36, amount9);
|
||||
color41 *= (float)(num153 - num163) / 15f;
|
||||
Vector2 vector44 = npc.oldPos[num163] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition;
|
||||
vector44 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
|
||||
vector44 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector44, new Rectangle?(npc.frame), color41, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
Color color43 = color42;
|
||||
color43 = Color.Lerp(color43, color36, amount9);
|
||||
color43 *= (float)(num153 - num163) / 15f;
|
||||
spriteBatch.Draw(texture2D16, vector44, new Rectangle?(npc.frame), color43, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
}
|
||||
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), color37, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
spriteBatch.Draw(texture2D16, vector43, new Rectangle?(npc.frame), color42, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
bool expertMode = Main.expertMode || CalamityWorld.bossRushActive;
|
||||
if (invinceTime > 0)
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using System.IO;
|
||||
using Terraria;
|
||||
@@ -20,7 +21,8 @@ namespace CalamityMod.NPCs.CeaselessVoid
|
||||
{
|
||||
DisplayName.SetDefault("Dark Energy");
|
||||
Main.npcFrameCount[npc.type] = 6;
|
||||
}
|
||||
NPCID.Sets.TrailingMode[npc.type] = 1;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
@@ -74,7 +76,64 @@ namespace CalamityMod.NPCs.CeaselessVoid
|
||||
npc.frame.Y = frame * frameHeight;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
if (npc.spriteDirection == 1)
|
||||
spriteEffects = SpriteEffects.FlipHorizontally;
|
||||
|
||||
Texture2D texture2D15 = Main.npcTexture[npc.type];
|
||||
Texture2D texture2D16 = ModContent.GetTexture("CalamityMod/NPCs/CeaselessVoid/DarkEnergyGlow2");
|
||||
Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2));
|
||||
Color color36 = Color.White;
|
||||
float amount9 = 0.5f;
|
||||
int num153 = 5;
|
||||
|
||||
for (int num155 = 1; num155 < num153; num155 += 2)
|
||||
{
|
||||
Color color38 = lightColor;
|
||||
color38 = Color.Lerp(color38, color36, amount9);
|
||||
color38 = npc.GetAlpha(color38);
|
||||
color38 *= (float)(num153 - num155) / 15f;
|
||||
Vector2 vector41 = npc.oldPos[num155] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition;
|
||||
vector41 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
|
||||
vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector41, new Rectangle?(npc.frame), color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
}
|
||||
|
||||
Vector2 vector43 = npc.Center - Main.screenPosition;
|
||||
vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
|
||||
vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/CeaselessVoid/DarkEnergyGlow");
|
||||
Color color37 = Color.Lerp(Color.White, Color.Cyan, 0.5f);
|
||||
Color color42 = Color.Lerp(Color.White, Color.Fuchsia, 0.5f);
|
||||
|
||||
for (int num163 = 1; num163 < num153; num163++)
|
||||
{
|
||||
Color color41 = color37;
|
||||
color41 = Color.Lerp(color41, color36, amount9);
|
||||
color41 *= (float)(num153 - num163) / 15f;
|
||||
Vector2 vector44 = npc.oldPos[num163] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition;
|
||||
vector44 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
|
||||
vector44 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector44, new Rectangle?(npc.frame), color41, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
Color color43 = color42;
|
||||
color43 = Color.Lerp(color43, color36, amount9);
|
||||
color43 *= (float)(num153 - num163) / 15f;
|
||||
spriteBatch.Draw(texture2D16, vector44, new Rectangle?(npc.frame), color43, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
}
|
||||
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), color37, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
spriteBatch.Draw(texture2D16, vector43, new Rectangle?(npc.frame), color42, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
bool expertMode = Main.expertMode || CalamityWorld.bossRushActive;
|
||||
if (invinceTime > 0)
|
||||
|
||||
|
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 4.4 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
@@ -77,7 +77,7 @@ namespace CalamityMod.NPCs.Crabulon
|
||||
{
|
||||
npc.gfxOffY = -16;
|
||||
|
||||
Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 0f, 0.5f, 1f);
|
||||
Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 0f, 0.3f, 0.7f);
|
||||
|
||||
bool death = CalamityWorld.death || CalamityWorld.bossRushActive;
|
||||
bool revenge = CalamityWorld.revenge || CalamityWorld.bossRushActive;
|
||||
|
||||
@@ -6,6 +6,7 @@ using CalamityMod.Items.Fishing.FishingRods;
|
||||
using CalamityMod.Projectiles.Boss;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
@@ -17,7 +18,8 @@ namespace CalamityMod.NPCs.Crags
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Soul Slurper");
|
||||
}
|
||||
NPCID.Sets.TrailingMode[npc.type] = 1;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
@@ -217,7 +219,55 @@ namespace CalamityMod.NPCs.Crags
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnHitPlayer(Player player, int damage, bool crit)
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
if (npc.spriteDirection == 1)
|
||||
spriteEffects = SpriteEffects.FlipHorizontally;
|
||||
|
||||
Texture2D texture2D15 = Main.npcTexture[npc.type];
|
||||
Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / 2));
|
||||
Color color36 = Color.White;
|
||||
float amount9 = 0.5f;
|
||||
int num153 = 5;
|
||||
|
||||
for (int num155 = 1; num155 < num153; num155 += 2)
|
||||
{
|
||||
Color color38 = lightColor;
|
||||
color38 = Color.Lerp(color38, color36, amount9);
|
||||
color38 = npc.GetAlpha(color38);
|
||||
color38 *= (float)(num153 - num155) / 15f;
|
||||
Vector2 vector41 = npc.oldPos[num155] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition;
|
||||
vector41 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f;
|
||||
vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector41, new Rectangle?(npc.frame), color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
}
|
||||
|
||||
Vector2 vector43 = npc.Center - Main.screenPosition;
|
||||
vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f;
|
||||
vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/Calamitas/SoulSeekerGlow");
|
||||
Color color37 = Color.Lerp(Color.White, Color.Red, 0.5f);
|
||||
|
||||
for (int num163 = 1; num163 < num153; num163++)
|
||||
{
|
||||
Color color41 = color37;
|
||||
color41 = Color.Lerp(color41, color36, amount9);
|
||||
color41 *= (float)(num153 - num163) / 15f;
|
||||
Vector2 vector44 = npc.oldPos[num163] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition;
|
||||
vector44 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f;
|
||||
vector44 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector44, new Rectangle?(npc.frame), color41, npc.rotation, vector11, npc.scale, npc.spriteDirection == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally, 0f);
|
||||
}
|
||||
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), color37, npc.rotation, vector11, npc.scale, npc.spriteDirection == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally, 0f);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void OnHitPlayer(Player player, int damage, bool crit)
|
||||
{
|
||||
if (CalamityWorld.revenge)
|
||||
{
|
||||
|
||||
@@ -3,6 +3,7 @@ using CalamityMod.Buffs.StatDebuffs;
|
||||
using CalamityMod.Projectiles.Boss;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using System.IO;
|
||||
using Terraria;
|
||||
@@ -79,7 +80,7 @@ namespace CalamityMod.NPCs.DevourerofGods
|
||||
public override void AI()
|
||||
{
|
||||
bool expertMode = Main.expertMode;
|
||||
Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 0.2f, 0.05f, 0.2f);
|
||||
Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 0f, 0.2f, 0.25f);
|
||||
if (invinceTime > 0)
|
||||
{
|
||||
invinceTime--;
|
||||
@@ -208,7 +209,29 @@ namespace CalamityMod.NPCs.DevourerofGods
|
||||
}
|
||||
}
|
||||
|
||||
public override bool CanHitPlayer(Player target, ref int cooldownSlot)
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
if (npc.spriteDirection == 1)
|
||||
spriteEffects = SpriteEffects.FlipHorizontally;
|
||||
|
||||
Texture2D texture2D15 = Main.npcTexture[npc.type];
|
||||
Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / 2));
|
||||
|
||||
Vector2 vector43 = npc.Center - Main.screenPosition;
|
||||
vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f;
|
||||
vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/DevourerofGods/DevourerofGodsBodyGlow");
|
||||
Color color37 = Color.Lerp(Color.White, Color.Cyan, 0.5f);
|
||||
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), color37, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool CanHitPlayer(Player target, ref int cooldownSlot)
|
||||
{
|
||||
cooldownSlot = 0;
|
||||
return true;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System.IO;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
@@ -97,7 +98,29 @@ namespace CalamityMod.NPCs.DevourerofGods
|
||||
}
|
||||
}
|
||||
|
||||
public override bool CanHitPlayer(Player target, ref int cooldownSlot)
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
if (npc.spriteDirection == 1)
|
||||
spriteEffects = SpriteEffects.FlipHorizontally;
|
||||
|
||||
Texture2D texture2D15 = Main.npcTexture[npc.type];
|
||||
Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / 2));
|
||||
|
||||
Vector2 vector43 = npc.Center - Main.screenPosition;
|
||||
vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f;
|
||||
vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/DevourerofGods/DevourerofGodsBody2Glow");
|
||||
Color color37 = Color.Lerp(Color.White, Color.Fuchsia, 0.5f);
|
||||
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), color37, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool CanHitPlayer(Player target, ref int cooldownSlot)
|
||||
{
|
||||
cooldownSlot = 1;
|
||||
return true;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using CalamityMod.Buffs.StatDebuffs;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System.IO;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
@@ -195,7 +196,37 @@ namespace CalamityMod.NPCs.DevourerofGods
|
||||
}
|
||||
}
|
||||
|
||||
public override bool CanHitPlayer(Player target, ref int cooldownSlot)
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
if (npc.spriteDirection == 1)
|
||||
spriteEffects = SpriteEffects.FlipHorizontally;
|
||||
|
||||
Texture2D texture2D15 = Main.npcTexture[npc.type];
|
||||
Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / 2));
|
||||
|
||||
Vector2 vector43 = npc.Center - Main.screenPosition;
|
||||
vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f;
|
||||
vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
if (!npc.dontTakeDamage)
|
||||
{
|
||||
texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/DevourerofGods/DevourerofGodsBodySGlow");
|
||||
Color color37 = Color.Lerp(Color.White, Color.Fuchsia, 0.5f);
|
||||
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), color37, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/DevourerofGods/DevourerofGodsBodySGlow2");
|
||||
color37 = Color.Lerp(Color.White, Color.Cyan, 0.5f);
|
||||
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), color37, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool CanHitPlayer(Player target, ref int cooldownSlot)
|
||||
{
|
||||
cooldownSlot = 0;
|
||||
return npc.alpha == 0 && invinceTime <= 0;
|
||||
|
||||
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 672 B |
|
After Width: | Height: | Size: 672 B |
@@ -2,6 +2,7 @@
|
||||
using CalamityMod.Buffs.StatDebuffs;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using System.IO;
|
||||
using Terraria;
|
||||
@@ -709,7 +710,34 @@ namespace CalamityMod.NPCs.DevourerofGods
|
||||
}
|
||||
}
|
||||
|
||||
public override void BossLoot(ref string name, ref int potionType)
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
if (npc.spriteDirection == 1)
|
||||
spriteEffects = SpriteEffects.FlipHorizontally;
|
||||
|
||||
Texture2D texture2D15 = Main.npcTexture[npc.type];
|
||||
Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / 2));
|
||||
|
||||
Vector2 vector43 = npc.Center - Main.screenPosition;
|
||||
vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f;
|
||||
vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/DevourerofGods/DevourerofGodsHeadGlow");
|
||||
Color color37 = Color.Lerp(Color.White, Color.Fuchsia, 0.5f);
|
||||
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), color37, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/DevourerofGods/DevourerofGodsHeadGlow2");
|
||||
color37 = Color.Lerp(Color.White, Color.Cyan, 0.5f);
|
||||
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), color37, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void BossLoot(ref string name, ref int potionType)
|
||||
{
|
||||
potionType = ItemID.None;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using System.IO;
|
||||
using Terraria;
|
||||
@@ -426,7 +427,34 @@ namespace CalamityMod.NPCs.DevourerofGods
|
||||
}
|
||||
}
|
||||
|
||||
public override void BossLoot(ref string name, ref int potionType)
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
if (npc.spriteDirection == 1)
|
||||
spriteEffects = SpriteEffects.FlipHorizontally;
|
||||
|
||||
Texture2D texture2D15 = Main.npcTexture[npc.type];
|
||||
Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / 2));
|
||||
|
||||
Vector2 vector43 = npc.Center - Main.screenPosition;
|
||||
vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f;
|
||||
vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/DevourerofGods/DevourerofGodsHead2Glow");
|
||||
Color color37 = Color.Lerp(Color.White, Color.Fuchsia, 0.5f);
|
||||
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), color37, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/DevourerofGods/DevourerofGodsHead2Glow2");
|
||||
color37 = Color.Lerp(Color.White, Color.Cyan, 0.5f);
|
||||
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), color37, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void BossLoot(ref string name, ref int potionType)
|
||||
{
|
||||
potionType = ItemID.None;
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 366 B |
|
After Width: | Height: | Size: 573 B |
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 708 B |
@@ -15,6 +15,7 @@ using CalamityMod.Items.Weapons.Summon;
|
||||
using CalamityMod.Projectiles.Boss;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using System.IO;
|
||||
using Terraria;
|
||||
@@ -992,7 +993,37 @@ namespace CalamityMod.NPCs.DevourerofGods
|
||||
}
|
||||
}
|
||||
|
||||
public override void BossLoot(ref string name, ref int potionType)
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
if (npc.spriteDirection == 1)
|
||||
spriteEffects = SpriteEffects.FlipHorizontally;
|
||||
|
||||
Texture2D texture2D15 = Main.npcTexture[npc.type];
|
||||
Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / 2));
|
||||
|
||||
Vector2 vector43 = npc.Center - Main.screenPosition;
|
||||
vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f;
|
||||
vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
if (!npc.dontTakeDamage)
|
||||
{
|
||||
texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/DevourerofGods/DevourerofGodsHeadSGlow");
|
||||
Color color37 = Color.Lerp(Color.White, Color.Fuchsia, 0.5f);
|
||||
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), color37, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/DevourerofGods/DevourerofGodsHeadSGlow2");
|
||||
color37 = Color.Lerp(Color.White, Color.Cyan, 0.5f);
|
||||
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), color37, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void BossLoot(ref string name, ref int potionType)
|
||||
{
|
||||
potionType = ModContent.ItemType<CosmiliteBrick>();
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
@@ -2,6 +2,7 @@
|
||||
using CalamityMod.Buffs.StatDebuffs;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
@@ -157,7 +158,34 @@ namespace CalamityMod.NPCs.DevourerofGods
|
||||
}
|
||||
}
|
||||
|
||||
public override bool CanHitPlayer(Player target, ref int cooldownSlot)
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
if (npc.spriteDirection == 1)
|
||||
spriteEffects = SpriteEffects.FlipHorizontally;
|
||||
|
||||
Texture2D texture2D15 = Main.npcTexture[npc.type];
|
||||
Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / 2));
|
||||
|
||||
Vector2 vector43 = npc.Center - Main.screenPosition;
|
||||
vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f;
|
||||
vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/DevourerofGods/DevourerofGodsTailGlow");
|
||||
Color color37 = Color.Lerp(Color.White, Color.Fuchsia, 0.5f);
|
||||
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), color37, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/DevourerofGods/DevourerofGodsTailGlow2");
|
||||
color37 = Color.Lerp(Color.White, Color.Cyan, 0.5f);
|
||||
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), color37, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool CanHitPlayer(Player target, ref int cooldownSlot)
|
||||
{
|
||||
cooldownSlot = 0;
|
||||
return true;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System.IO;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
@@ -94,7 +95,29 @@ namespace CalamityMod.NPCs.DevourerofGods
|
||||
}
|
||||
}
|
||||
|
||||
public override bool CanHitPlayer(Player target, ref int cooldownSlot)
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
if (npc.spriteDirection == 1)
|
||||
spriteEffects = SpriteEffects.FlipHorizontally;
|
||||
|
||||
Texture2D texture2D15 = Main.npcTexture[npc.type];
|
||||
Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / 2));
|
||||
|
||||
Vector2 vector43 = npc.Center - Main.screenPosition;
|
||||
vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f;
|
||||
vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/DevourerofGods/DevourerofGodsTail2Glow");
|
||||
Color color37 = Color.Lerp(Color.White, Color.Cyan, 0.5f);
|
||||
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), color37, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool CanHitPlayer(Player target, ref int cooldownSlot)
|
||||
{
|
||||
cooldownSlot = 1;
|
||||
return true;
|
||||
|
||||
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 429 B |
|
After Width: | Height: | Size: 444 B |
@@ -1,6 +1,7 @@
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.Buffs.StatDebuffs;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System.IO;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
@@ -197,8 +198,38 @@ namespace CalamityMod.NPCs.DevourerofGods
|
||||
}
|
||||
}
|
||||
|
||||
// Can only hit the target if within certain distance
|
||||
public override bool CanHitPlayer(Player target, ref int cooldownSlot)
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
if (npc.spriteDirection == 1)
|
||||
spriteEffects = SpriteEffects.FlipHorizontally;
|
||||
|
||||
Texture2D texture2D15 = Main.npcTexture[npc.type];
|
||||
Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / 2));
|
||||
|
||||
Vector2 vector43 = npc.Center - Main.screenPosition;
|
||||
vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f;
|
||||
vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
if (!npc.dontTakeDamage)
|
||||
{
|
||||
texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/DevourerofGods/DevourerofGodsTailSGlow");
|
||||
Color color37 = Color.Lerp(Color.White, Color.Fuchsia, 0.5f);
|
||||
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), color37, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/DevourerofGods/DevourerofGodsTailSGlow2");
|
||||
color37 = Color.Lerp(Color.White, Color.Cyan, 0.5f);
|
||||
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), color37, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Can only hit the target if within certain distance
|
||||
public override bool CanHitPlayer(Player target, ref int cooldownSlot)
|
||||
{
|
||||
cooldownSlot = 0;
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
@@ -3,7 +3,7 @@ using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.NPCs.NormalNPCs
|
||||
{
|
||||
public class SuperDummy : ModNPC
|
||||
public class SuperDummyNPC : ModNPC
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
|
Before Width: | Height: | Size: 512 B After Width: | Height: | Size: 512 B |
@@ -111,14 +111,29 @@ namespace CalamityMod.NPCs.Perforator
|
||||
}
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor)
|
||||
{
|
||||
Texture2D texture = ModContent.GetTexture("CalamityMod/NPCs/Perforator/PerforatorBodyLargeAlt");
|
||||
CalamityMod.DrawTexture(spriteBatch, npc.localAI[3] == 1f ? texture : Main.npcTexture[npc.type], 0, npc, drawColor);
|
||||
return false;
|
||||
}
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
if (npc.spriteDirection == 1)
|
||||
spriteEffects = SpriteEffects.FlipHorizontally;
|
||||
|
||||
public override bool CheckActive()
|
||||
Texture2D texture2D15 = npc.localAI[3] == 1f ? ModContent.GetTexture("CalamityMod/NPCs/Perforator/PerforatorBodyLargeAlt") : Main.npcTexture[npc.type];
|
||||
Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / 2));
|
||||
|
||||
Vector2 vector43 = npc.Center - Main.screenPosition;
|
||||
vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f;
|
||||
vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
texture2D15 = npc.localAI[3] == 1f ? ModContent.GetTexture("CalamityMod/NPCs/Perforator/PerforatorBodyLargeAltGlow") : ModContent.GetTexture("CalamityMod/NPCs/Perforator/PerforatorBodyLargeGlow");
|
||||
Color color37 = Color.Lerp(Color.White, Color.Yellow, 0.5f);
|
||||
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), color37, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool CheckActive()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
After Width: | Height: | Size: 465 B |
|
After Width: | Height: | Size: 459 B |
@@ -4,6 +4,7 @@ using CalamityMod.Buffs.Potions;
|
||||
using CalamityMod.Projectiles.Boss;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
@@ -110,7 +111,29 @@ namespace CalamityMod.NPCs.Perforator
|
||||
}
|
||||
}
|
||||
|
||||
public override bool CheckActive()
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
if (npc.spriteDirection == 1)
|
||||
spriteEffects = SpriteEffects.FlipHorizontally;
|
||||
|
||||
Texture2D texture2D15 = Main.npcTexture[npc.type];
|
||||
Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / 2));
|
||||
|
||||
Vector2 vector43 = npc.Center - Main.screenPosition;
|
||||
vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f;
|
||||
vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/Perforator/PerforatorBodyMediumGlow");
|
||||
Color color37 = Color.Lerp(Color.White, Color.Yellow, 0.5f);
|
||||
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), color37, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool CheckActive()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
After Width: | Height: | Size: 810 B |
@@ -4,6 +4,7 @@ using CalamityMod.Buffs.Potions;
|
||||
using CalamityMod.Projectiles.Boss;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
@@ -110,7 +111,29 @@ namespace CalamityMod.NPCs.Perforator
|
||||
}
|
||||
}
|
||||
|
||||
public override bool CheckActive()
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
if (npc.spriteDirection == 1)
|
||||
spriteEffects = SpriteEffects.FlipHorizontally;
|
||||
|
||||
Texture2D texture2D15 = Main.npcTexture[npc.type];
|
||||
Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / 2));
|
||||
|
||||
Vector2 vector43 = npc.Center - Main.screenPosition;
|
||||
vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f;
|
||||
vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/Perforator/PerforatorBodySmallGlow");
|
||||
Color color37 = Color.Lerp(Color.White, Color.Yellow, 0.5f);
|
||||
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), color37, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool CheckActive()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
After Width: | Height: | Size: 246 B |
@@ -1,5 +1,6 @@
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
@@ -38,7 +39,29 @@ namespace CalamityMod.NPCs.Perforator
|
||||
npc.frame.Y = frame * frameHeight;
|
||||
}
|
||||
|
||||
public override float SpawnChance(NPCSpawnInfo spawnInfo)
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
if (npc.spriteDirection == 1)
|
||||
spriteEffects = SpriteEffects.FlipHorizontally;
|
||||
|
||||
Texture2D texture2D15 = Main.npcTexture[npc.type];
|
||||
Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2));
|
||||
|
||||
Vector2 vector43 = npc.Center - Main.screenPosition;
|
||||
vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
|
||||
vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/Perforator/PerforatorCystGlow");
|
||||
Color color37 = Color.Lerp(Color.White, Color.Yellow, 0.5f);
|
||||
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), color37, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override float SpawnChance(NPCSpawnInfo spawnInfo)
|
||||
{
|
||||
if (spawnInfo.playerSafe || NPC.AnyNPCs(ModContent.NPCType<PerforatorCyst>()) || NPC.AnyNPCs(ModContent.NPCType<PerforatorHive>()) || spawnInfo.player.Calamity().crimsonLore)
|
||||
{
|
||||
|
||||
@@ -4,6 +4,7 @@ using CalamityMod.Buffs.StatDebuffs;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
@@ -394,7 +395,29 @@ namespace CalamityMod.NPCs.Perforator
|
||||
}
|
||||
}
|
||||
|
||||
public override bool CheckActive()
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
if (npc.spriteDirection == 1)
|
||||
spriteEffects = SpriteEffects.FlipHorizontally;
|
||||
|
||||
Texture2D texture2D15 = Main.npcTexture[npc.type];
|
||||
Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / 2));
|
||||
|
||||
Vector2 vector43 = npc.Center - Main.screenPosition;
|
||||
vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f;
|
||||
vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/Perforator/PerforatorHeadLargeGlow");
|
||||
Color color37 = Color.Lerp(Color.White, Color.Yellow, 0.5f);
|
||||
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), color37, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool CheckActive()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
After Width: | Height: | Size: 405 B |
@@ -4,6 +4,7 @@ using CalamityMod.Buffs.Potions;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
@@ -390,7 +391,29 @@ namespace CalamityMod.NPCs.Perforator
|
||||
}
|
||||
}
|
||||
|
||||
public override bool CheckActive()
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
if (npc.spriteDirection == 1)
|
||||
spriteEffects = SpriteEffects.FlipHorizontally;
|
||||
|
||||
Texture2D texture2D15 = Main.npcTexture[npc.type];
|
||||
Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / 2));
|
||||
|
||||
Vector2 vector43 = npc.Center - Main.screenPosition;
|
||||
vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f;
|
||||
vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/Perforator/PerforatorHeadMediumGlow");
|
||||
Color color37 = Color.Lerp(Color.White, Color.Yellow, 0.5f);
|
||||
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), color37, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool CheckActive()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
After Width: | Height: | Size: 585 B |
@@ -4,6 +4,7 @@ using CalamityMod.Buffs.Potions;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
@@ -388,7 +389,29 @@ namespace CalamityMod.NPCs.Perforator
|
||||
}
|
||||
}
|
||||
|
||||
public override bool CheckActive()
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
if (npc.spriteDirection == 1)
|
||||
spriteEffects = SpriteEffects.FlipHorizontally;
|
||||
|
||||
Texture2D texture2D15 = Main.npcTexture[npc.type];
|
||||
Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / 2));
|
||||
|
||||
Vector2 vector43 = npc.Center - Main.screenPosition;
|
||||
vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f;
|
||||
vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/Perforator/PerforatorHeadSmallGlow");
|
||||
Color color37 = Color.Lerp(Color.White, Color.Yellow, 0.5f);
|
||||
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), color37, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool CheckActive()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
After Width: | Height: | Size: 249 B |
@@ -15,6 +15,7 @@ using CalamityMod.Projectiles.Boss;
|
||||
using CalamityMod.Tiles.Ores;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using System.IO;
|
||||
using Terraria;
|
||||
@@ -79,8 +80,6 @@ namespace CalamityMod.NPCs.Perforator
|
||||
{
|
||||
CalamityGlobalNPC.perfHive = npc.whoAmI;
|
||||
|
||||
Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 1.5f, 0f, 0f);
|
||||
|
||||
npc.TargetClosest(true);
|
||||
Player player = Main.player[npc.target];
|
||||
|
||||
@@ -328,7 +327,29 @@ namespace CalamityMod.NPCs.Perforator
|
||||
}
|
||||
}
|
||||
|
||||
public override bool CheckDead()
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
if (npc.spriteDirection == 1)
|
||||
spriteEffects = SpriteEffects.FlipHorizontally;
|
||||
|
||||
Texture2D texture2D15 = Main.npcTexture[npc.type];
|
||||
Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2));
|
||||
|
||||
Vector2 vector43 = npc.Center - Main.screenPosition;
|
||||
vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
|
||||
vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/Perforator/PerforatorHiveGlow");
|
||||
Color color37 = Color.Lerp(Color.White, Color.Yellow, 0.5f);
|
||||
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), color37, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool CheckDead()
|
||||
{
|
||||
if (NPC.AnyNPCs(ModContent.NPCType<PerforatorHeadLarge>()))
|
||||
{
|
||||
|
||||
@@ -3,6 +3,7 @@ using CalamityMod.Buffs.StatDebuffs;
|
||||
using CalamityMod.Buffs.Potions;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
@@ -65,7 +66,29 @@ namespace CalamityMod.NPCs.Perforator
|
||||
}
|
||||
}
|
||||
|
||||
public override void HitEffect(int hitDirection, double damage)
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
if (npc.spriteDirection == 1)
|
||||
spriteEffects = SpriteEffects.FlipHorizontally;
|
||||
|
||||
Texture2D texture2D15 = Main.npcTexture[npc.type];
|
||||
Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / 2));
|
||||
|
||||
Vector2 vector43 = npc.Center - Main.screenPosition;
|
||||
vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f;
|
||||
vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/Perforator/PerforatorTailLargeGlow");
|
||||
Color color37 = Color.Lerp(Color.White, Color.Yellow, 0.5f);
|
||||
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), color37, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void HitEffect(int hitDirection, double damage)
|
||||
{
|
||||
for (int k = 0; k < 5; k++)
|
||||
{
|
||||
|
||||
|
After Width: | Height: | Size: 480 B |
@@ -3,6 +3,7 @@ using CalamityMod.Buffs.StatDebuffs;
|
||||
using CalamityMod.Buffs.Potions;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
@@ -65,7 +66,29 @@ namespace CalamityMod.NPCs.Perforator
|
||||
}
|
||||
}
|
||||
|
||||
public override void HitEffect(int hitDirection, double damage)
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
if (npc.spriteDirection == 1)
|
||||
spriteEffects = SpriteEffects.FlipHorizontally;
|
||||
|
||||
Texture2D texture2D15 = Main.npcTexture[npc.type];
|
||||
Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / 2));
|
||||
|
||||
Vector2 vector43 = npc.Center - Main.screenPosition;
|
||||
vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f;
|
||||
vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/Perforator/PerforatorTailMediumGlow");
|
||||
Color color37 = Color.Lerp(Color.White, Color.Yellow, 0.5f);
|
||||
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), color37, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void HitEffect(int hitDirection, double damage)
|
||||
{
|
||||
for (int k = 0; k < 5; k++)
|
||||
{
|
||||
|
||||
|
After Width: | Height: | Size: 594 B |
@@ -3,6 +3,7 @@ using CalamityMod.Buffs.StatDebuffs;
|
||||
using CalamityMod.Buffs.Potions;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
@@ -66,7 +67,29 @@ namespace CalamityMod.NPCs.Perforator
|
||||
}
|
||||
}
|
||||
|
||||
public override void HitEffect(int hitDirection, double damage)
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
if (npc.spriteDirection == 1)
|
||||
spriteEffects = SpriteEffects.FlipHorizontally;
|
||||
|
||||
Texture2D texture2D15 = Main.npcTexture[npc.type];
|
||||
Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / 2));
|
||||
|
||||
Vector2 vector43 = npc.Center - Main.screenPosition;
|
||||
vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f;
|
||||
vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/Perforator/PerforatorTailSmallGlow");
|
||||
Color color37 = Color.Lerp(Color.White, Color.Yellow, 0.5f);
|
||||
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), color37, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void HitEffect(int hitDirection, double damage)
|
||||
{
|
||||
for (int k = 0; k < 5; k++)
|
||||
{
|
||||
|
||||
|
After Width: | Height: | Size: 312 B |
@@ -130,7 +130,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath
|
||||
bool expertMode = Main.expertMode || CalamityWorld.bossRushActive;
|
||||
|
||||
// Light
|
||||
Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 0.15f, 0.35f, 0.05f);
|
||||
Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 0.3f, 0.7f, 0f);
|
||||
|
||||
// Show message
|
||||
if (!halfLife && ((double)npc.life <= (double)npc.lifeMax * 0.5 || death))
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 0.05f, 0.15f, 0.025f);
|
||||
Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 0.1f, 0.3f, 0f);
|
||||
bool flag113 = false;
|
||||
if (!Main.player[npc.target].ZoneJungle && !CalamityWorld.bossRushActive)
|
||||
{
|
||||
|
||||
@@ -18,7 +18,8 @@ namespace CalamityMod.NPCs.Polterghast
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Phantom");
|
||||
}
|
||||
NPCID.Sets.TrailingMode[npc.type] = 1;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
@@ -117,25 +118,36 @@ namespace CalamityMod.NPCs.Polterghast
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor)
|
||||
{
|
||||
if (npc.velocity != Vector2.Zero)
|
||||
{
|
||||
Texture2D texture = Main.npcTexture[npc.type];
|
||||
Vector2 origin = new Vector2(texture.Width * 0.5f, texture.Height * 0.5f);
|
||||
for (int i = 1; i < npc.oldPos.Length; ++i)
|
||||
{
|
||||
Vector2 vector2_2 = npc.oldPos[i];
|
||||
Color color2 = Color.White * npc.Opacity;
|
||||
color2.R = (byte)(0.5 * (double)color2.R * (double)(10 - i) / 20.0);
|
||||
color2.G = (byte)(0.5 * (double)color2.G * (double)(10 - i) / 20.0);
|
||||
color2.B = (byte)(0.5 * (double)color2.B * (double)(10 - i) / 20.0);
|
||||
color2.A = (byte)(0.5 * (double)color2.A * (double)(10 - i) / 20.0);
|
||||
Main.spriteBatch.Draw(Main.npcTexture[npc.type], new Vector2(npc.oldPos[i].X - Main.screenPosition.X + (npc.width / 2),
|
||||
npc.oldPos[i].Y - Main.screenPosition.Y + npc.height / 2), new Rectangle?(npc.frame), color2, npc.oldRot[i], origin, npc.scale, SpriteEffects.None, 0.0f);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
if (npc.spriteDirection == 1)
|
||||
spriteEffects = SpriteEffects.FlipHorizontally;
|
||||
|
||||
Texture2D texture2D15 = Main.npcTexture[npc.type];
|
||||
Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / 2));
|
||||
Color color36 = Color.White;
|
||||
float amount9 = 0.5f;
|
||||
int num153 = 5;
|
||||
|
||||
for (int num155 = 1; num155 < num153; num155 += 2)
|
||||
{
|
||||
Color color38 = lightColor;
|
||||
color38 = Color.Lerp(color38, color36, amount9);
|
||||
color38 = npc.GetAlpha(color38);
|
||||
color38 *= (float)(num153 - num155) / 15f;
|
||||
Vector2 vector41 = npc.oldPos[num155] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition;
|
||||
vector41 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f;
|
||||
vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector41, new Rectangle?(npc.frame), color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
}
|
||||
|
||||
Vector2 vector43 = npc.Center - Main.screenPosition;
|
||||
vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f;
|
||||
vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
using CalamityMod.Buffs.StatDebuffs;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using System.IO;
|
||||
using Terraria;
|
||||
@@ -21,7 +22,8 @@ namespace CalamityMod.NPCs.Polterghast
|
||||
{
|
||||
DisplayName.SetDefault("Polterghast");
|
||||
Main.npcFrameCount[npc.type] = 4;
|
||||
}
|
||||
NPCID.Sets.TrailingMode[npc.type] = 1;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
@@ -237,7 +239,39 @@ namespace CalamityMod.NPCs.Polterghast
|
||||
return new Color(200, 150, 255, npc.alpha);
|
||||
}
|
||||
|
||||
public override void FindFrame(int frameHeight)
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
if (npc.spriteDirection == 1)
|
||||
spriteEffects = SpriteEffects.FlipHorizontally;
|
||||
|
||||
Texture2D texture2D15 = Main.npcTexture[npc.type];
|
||||
Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2));
|
||||
Color color36 = Color.White;
|
||||
float amount9 = 0.5f;
|
||||
int num153 = 7;
|
||||
|
||||
for (int num155 = 1; num155 < num153; num155 += 2)
|
||||
{
|
||||
Color color38 = lightColor;
|
||||
color38 = Color.Lerp(color38, color36, amount9);
|
||||
color38 = npc.GetAlpha(color38);
|
||||
color38 *= (float)(num153 - num155) / 15f;
|
||||
Vector2 vector41 = npc.oldPos[num155] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition;
|
||||
vector41 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
|
||||
vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector41, new Rectangle?(npc.frame), color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
}
|
||||
|
||||
Vector2 vector43 = npc.Center - Main.screenPosition;
|
||||
vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
|
||||
vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void FindFrame(int frameHeight)
|
||||
{
|
||||
npc.frameCounter += 1.0;
|
||||
if (npc.frameCounter > 6.0)
|
||||
|
||||
@@ -15,6 +15,7 @@ using CalamityMod.NPCs.NormalNPCs;
|
||||
using CalamityMod.Projectiles.Boss;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using System.IO;
|
||||
using Terraria;
|
||||
@@ -38,7 +39,8 @@ namespace CalamityMod.NPCs.Polterghast
|
||||
{
|
||||
DisplayName.SetDefault("Polterghast");
|
||||
Main.npcFrameCount[npc.type] = 12;
|
||||
}
|
||||
NPCID.Sets.TrailingMode[npc.type] = 1;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
@@ -102,7 +104,7 @@ namespace CalamityMod.NPCs.Polterghast
|
||||
public override void AI()
|
||||
{
|
||||
// Emit light
|
||||
Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 0.5f, 1.25f, 1.25f);
|
||||
Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 0.1f, 0.5f, 0.5f);
|
||||
|
||||
// whoAmI variable
|
||||
CalamityGlobalNPC.ghostBoss = npc.whoAmI;
|
||||
@@ -757,16 +759,75 @@ namespace CalamityMod.NPCs.Polterghast
|
||||
CalamityMod.UpdateServerBoolean();
|
||||
}
|
||||
|
||||
public override void FindFrame(int frameHeight)
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
if (npc.spriteDirection == 1)
|
||||
spriteEffects = SpriteEffects.FlipHorizontally;
|
||||
|
||||
Texture2D texture2D15 = Main.npcTexture[npc.type];
|
||||
Texture2D texture2D16 = ModContent.GetTexture("CalamityMod/NPCs/Polterghast/PolterghastGlow2");
|
||||
Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2));
|
||||
Color color36 = Color.White;
|
||||
float amount9 = 0.5f;
|
||||
int num153 = 7;
|
||||
|
||||
for (int num155 = 1; num155 < num153; num155 += 2)
|
||||
{
|
||||
Color color38 = lightColor;
|
||||
color38 = Color.Lerp(color38, color36, amount9);
|
||||
color38 = npc.GetAlpha(color38);
|
||||
color38 *= (float)(num153 - num155) / 15f;
|
||||
Vector2 vector41 = npc.oldPos[num155] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition;
|
||||
vector41 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
|
||||
vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector41, new Rectangle?(npc.frame), color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
}
|
||||
|
||||
Vector2 vector43 = npc.Center - Main.screenPosition;
|
||||
vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
|
||||
vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/Polterghast/PolterghastGlow");
|
||||
Color color37 = Color.Lerp(Color.White, Color.Cyan, 0.5f);
|
||||
Color color42 = Color.Lerp(Color.White, Color.Red, 0.5f);
|
||||
|
||||
for (int num163 = 1; num163 < num153; num163++)
|
||||
{
|
||||
Color color41 = color37;
|
||||
color41 = Color.Lerp(color41, color36, amount9);
|
||||
color41 = npc.GetAlpha(color41);
|
||||
color41 *= (float)(num153 - num163) / 15f;
|
||||
Vector2 vector44 = npc.oldPos[num163] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition;
|
||||
vector44 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
|
||||
vector44 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector44, new Rectangle?(npc.frame), color41, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
Color color43 = color42;
|
||||
color43 = Color.Lerp(color43, color36, amount9);
|
||||
color43 = npc.GetAlpha(color43);
|
||||
color43 *= (float)(num153 - num163) / 15f;
|
||||
spriteBatch.Draw(texture2D16, vector44, new Rectangle?(npc.frame), color43, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
}
|
||||
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), color37, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
spriteBatch.Draw(texture2D16, vector43, new Rectangle?(npc.frame), color42, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void FindFrame(int frameHeight)
|
||||
{
|
||||
bool revenge = CalamityWorld.revenge || CalamityWorld.bossRushActive;
|
||||
bool death = CalamityWorld.death || CalamityWorld.bossRushActive;
|
||||
bool phase2 = (double)npc.life >= (double)npc.lifeMax * (revenge ? (death ? 0.8 : 0.5) : 0.33);
|
||||
npc.frameCounter += 1.0;
|
||||
if (npc.frameCounter > 6.0)
|
||||
npc.frameCounter += 1D;
|
||||
if (npc.frameCounter > 6D)
|
||||
{
|
||||
npc.frameCounter = 0.0;
|
||||
npc.frame.Y = npc.frame.Y + frameHeight;
|
||||
npc.frameCounter = 0D;
|
||||
npc.frame.Y += frameHeight;
|
||||
}
|
||||
if ((double)npc.life >= (double)npc.lifeMax * (death ? 0.9 : 0.75))
|
||||
{
|
||||
|
||||
@@ -19,7 +19,8 @@ namespace CalamityMod.NPCs.Polterghast
|
||||
{
|
||||
DisplayName.SetDefault("Polterghast Hook");
|
||||
Main.npcFrameCount[npc.type] = 2;
|
||||
}
|
||||
NPCID.Sets.TrailingMode[npc.type] = 1;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
@@ -55,7 +56,7 @@ namespace CalamityMod.NPCs.Polterghast
|
||||
public override void AI()
|
||||
{
|
||||
// Emit light
|
||||
Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 0.3f, 1f, 1f);
|
||||
Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 0f, 0.3f, 0.3f);
|
||||
|
||||
// Bools
|
||||
bool speedBoost = false;
|
||||
@@ -273,7 +274,87 @@ namespace CalamityMod.NPCs.Polterghast
|
||||
}
|
||||
}
|
||||
|
||||
public override void FindFrame(int frameHeight)
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
if (Main.npc[CalamityGlobalNPC.ghostBoss].active && !phase2)
|
||||
{
|
||||
Vector2 center = new Vector2(npc.Center.X, npc.Center.Y);
|
||||
float bossCenterX = Main.npc[CalamityGlobalNPC.ghostBoss].Center.X - center.X;
|
||||
float bossCenterY = Main.npc[CalamityGlobalNPC.ghostBoss].Center.Y - center.Y;
|
||||
float rotation2 = (float)Math.Atan2((double)bossCenterY, (double)bossCenterX) - 1.57f;
|
||||
bool draw = true;
|
||||
while (draw)
|
||||
{
|
||||
int chainWidth = 20; //16 24
|
||||
int chainHeight = 52; //32 16
|
||||
float num10 = (float)Math.Sqrt((double)(bossCenterX * bossCenterX + bossCenterY * bossCenterY));
|
||||
if (num10 < (float)chainHeight)
|
||||
{
|
||||
chainWidth = (int)num10 - chainHeight + chainWidth;
|
||||
draw = false;
|
||||
}
|
||||
num10 = (float)chainWidth / num10;
|
||||
bossCenterX *= num10;
|
||||
bossCenterY *= num10;
|
||||
center.X += bossCenterX;
|
||||
center.Y += bossCenterY;
|
||||
bossCenterX = Main.npc[CalamityGlobalNPC.ghostBoss].Center.X - center.X;
|
||||
bossCenterY = Main.npc[CalamityGlobalNPC.ghostBoss].Center.Y - center.Y;
|
||||
Color color2 = new Color(100, 100, 100, 0);
|
||||
Main.spriteBatch.Draw(ModContent.GetTexture("CalamityMod/NPCs/Polterghast/PolterghastChain"), new Vector2(center.X - Main.screenPosition.X, center.Y - Main.screenPosition.Y),
|
||||
new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, 0, ModContent.GetTexture("CalamityMod/NPCs/Polterghast/PolterghastChain").Width, chainWidth)), color2, rotation2,
|
||||
new Vector2((float)ModContent.GetTexture("CalamityMod/NPCs/Polterghast/PolterghastChain").Width * 0.5f, (float)ModContent.GetTexture("CalamityMod/NPCs/Polterghast/PolterghastChain").Height * 0.5f), 1f, SpriteEffects.None, 0f);
|
||||
}
|
||||
}
|
||||
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
if (npc.spriteDirection == 1)
|
||||
spriteEffects = SpriteEffects.FlipHorizontally;
|
||||
|
||||
Texture2D texture2D15 = Main.npcTexture[npc.type];
|
||||
Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2));
|
||||
Color color36 = Color.White;
|
||||
float amount9 = 0.5f;
|
||||
int num153 = 5;
|
||||
|
||||
for (int num155 = 1; num155 < num153; num155 += 2)
|
||||
{
|
||||
Color color38 = lightColor;
|
||||
color38 = Color.Lerp(color38, color36, amount9);
|
||||
color38 = npc.GetAlpha(color38);
|
||||
color38 *= (float)(num153 - num155) / 15f;
|
||||
Vector2 vector41 = npc.oldPos[num155] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition;
|
||||
vector41 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
|
||||
vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector41, new Rectangle?(npc.frame), color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
}
|
||||
|
||||
Vector2 vector43 = npc.Center - Main.screenPosition;
|
||||
vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
|
||||
vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/Polterghast/PolterghastHookGlow");
|
||||
Color color37 = Color.Lerp(Color.White, Color.Cyan, 0.5f);
|
||||
|
||||
for (int num163 = 1; num163 < num153; num163++)
|
||||
{
|
||||
Color color41 = color37;
|
||||
color41 = Color.Lerp(color41, color36, amount9);
|
||||
color41 = npc.GetAlpha(color41);
|
||||
color41 *= (float)(num153 - num163) / 15f;
|
||||
Vector2 vector44 = npc.oldPos[num163] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition;
|
||||
vector44 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
|
||||
vector44 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector44, new Rectangle?(npc.frame), color41, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
}
|
||||
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), color37, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void FindFrame(int frameHeight)
|
||||
{
|
||||
if (phase2)
|
||||
{
|
||||
@@ -323,41 +404,6 @@ namespace CalamityMod.NPCs.Polterghast
|
||||
}
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor)
|
||||
{
|
||||
if (Main.npc[CalamityGlobalNPC.ghostBoss].active && !phase2)
|
||||
{
|
||||
Vector2 center = new Vector2(npc.Center.X, npc.Center.Y);
|
||||
float bossCenterX = Main.npc[CalamityGlobalNPC.ghostBoss].Center.X - center.X;
|
||||
float bossCenterY = Main.npc[CalamityGlobalNPC.ghostBoss].Center.Y - center.Y;
|
||||
float rotation2 = (float)Math.Atan2((double)bossCenterY, (double)bossCenterX) - 1.57f;
|
||||
bool draw = true;
|
||||
while (draw)
|
||||
{
|
||||
int chainWidth = 20; //16 24
|
||||
int chainHeight = 52; //32 16
|
||||
float num10 = (float)Math.Sqrt((double)(bossCenterX * bossCenterX + bossCenterY * bossCenterY));
|
||||
if (num10 < (float)chainHeight)
|
||||
{
|
||||
chainWidth = (int)num10 - chainHeight + chainWidth;
|
||||
draw = false;
|
||||
}
|
||||
num10 = (float)chainWidth / num10;
|
||||
bossCenterX *= num10;
|
||||
bossCenterY *= num10;
|
||||
center.X += bossCenterX;
|
||||
center.Y += bossCenterY;
|
||||
bossCenterX = Main.npc[CalamityGlobalNPC.ghostBoss].Center.X - center.X;
|
||||
bossCenterY = Main.npc[CalamityGlobalNPC.ghostBoss].Center.Y - center.Y;
|
||||
Color color2 = new Color(100, 100, 100, 0);
|
||||
Main.spriteBatch.Draw(ModContent.GetTexture("CalamityMod/NPCs/Polterghast/PolterghastChain"), new Vector2(center.X - Main.screenPosition.X, center.Y - Main.screenPosition.Y),
|
||||
new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, 0, ModContent.GetTexture("CalamityMod/NPCs/Polterghast/PolterghastChain").Width, chainWidth)), color2, rotation2,
|
||||
new Vector2((float)ModContent.GetTexture("CalamityMod/NPCs/Polterghast/PolterghastChain").Width * 0.5f, (float)ModContent.GetTexture("CalamityMod/NPCs/Polterghast/PolterghastChain").Height * 0.5f), 1f, SpriteEffects.None, 0f);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool CheckActive()
|
||||
{
|
||||
return false;
|
||||
|
||||
@@ -26,7 +26,8 @@ namespace CalamityMod.NPCs.ProfanedGuardians
|
||||
{
|
||||
DisplayName.SetDefault("Profaned Guardian");
|
||||
Main.npcFrameCount[npc.type] = 6;
|
||||
}
|
||||
NPCID.Sets.TrailingMode[npc.type] = 1;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
@@ -50,8 +51,6 @@ namespace CalamityMod.NPCs.ProfanedGuardians
|
||||
music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/Guardians");
|
||||
else
|
||||
music = MusicID.Boss1;
|
||||
NPCID.Sets.TrailCacheLength[npc.type] = 8;
|
||||
NPCID.Sets.TrailingMode[npc.type] = 1;
|
||||
for (int k = 0; k < npc.buffImmune.Length; k++)
|
||||
{
|
||||
npc.buffImmune[k] = true;
|
||||
@@ -364,51 +363,58 @@ namespace CalamityMod.NPCs.ProfanedGuardians
|
||||
}
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor)
|
||||
{
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
if (npc.spriteDirection == 1)
|
||||
{
|
||||
spriteEffects = SpriteEffects.FlipHorizontally;
|
||||
}
|
||||
Color color24 = npc.GetAlpha(drawColor);
|
||||
Color color25 = Lighting.GetColor((int)((double)npc.position.X + (double)npc.width * 0.5) / 16, (int)(((double)npc.position.Y + (double)npc.height * 0.5) / 16.0));
|
||||
Texture2D texture2D3 = Main.npcTexture[npc.type];
|
||||
int num156 = Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type];
|
||||
int y3 = num156 * (int)npc.frameCounter;
|
||||
Rectangle rectangle = new Rectangle(0, y3, texture2D3.Width, num156);
|
||||
Vector2 origin2 = rectangle.Size() / 2f;
|
||||
int num157 = 8;
|
||||
int num158 = 2;
|
||||
int num159 = 1;
|
||||
float num160 = 0f;
|
||||
int num161 = num159;
|
||||
spriteBatch.Draw(texture2D3, npc.Center - Main.screenPosition + new Vector2(0, npc.gfxOffY), npc.frame, color24, npc.rotation, npc.frame.Size() / 2, npc.scale, spriteEffects, 0);
|
||||
while (npc.ai[0] == 2f && Lighting.NotRetro && ((num158 > 0 && num161 < num157) || (num158 < 0 && num161 > num157)))
|
||||
{
|
||||
Color color26 = npc.GetAlpha(color25);
|
||||
{
|
||||
goto IL_6899;
|
||||
}
|
||||
IL_6881:
|
||||
num161 += num158;
|
||||
continue;
|
||||
IL_6899:
|
||||
float num164 = (float)(num157 - num161);
|
||||
if (num158 < 0)
|
||||
{
|
||||
num164 = (float)(num159 - num161);
|
||||
}
|
||||
color26 *= num164 / ((float)NPCID.Sets.TrailCacheLength[npc.type] * 1.5f);
|
||||
Vector2 value4 = npc.oldPos[num161];
|
||||
float num165 = npc.rotation;
|
||||
Main.spriteBatch.Draw(texture2D3, value4 + npc.Size / 2f - Main.screenPosition + new Vector2(0, npc.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rectangle), color26, num165 + npc.rotation * num160 * (float)(num161 - 1) * -(float)spriteEffects.HasFlag(SpriteEffects.FlipHorizontally).ToDirectionInt(), origin2, npc.scale, spriteEffects, 0f);
|
||||
goto IL_6881;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
if (npc.spriteDirection == 1)
|
||||
spriteEffects = SpriteEffects.FlipHorizontally;
|
||||
|
||||
public override bool CanHitPlayer(Player target, ref int cooldownSlot)
|
||||
Texture2D texture2D15 = Main.npcTexture[npc.type];
|
||||
Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2));
|
||||
Color color36 = Color.White;
|
||||
float amount9 = 0.5f;
|
||||
int num153 = 5;
|
||||
if (npc.ai[0] == 2f)
|
||||
num153 = 10;
|
||||
|
||||
for (int num155 = 1; num155 < num153; num155 += 2)
|
||||
{
|
||||
Color color38 = lightColor;
|
||||
color38 = Color.Lerp(color38, color36, amount9);
|
||||
color38 = npc.GetAlpha(color38);
|
||||
color38 *= (float)(num153 - num155) / 15f;
|
||||
Vector2 vector41 = npc.oldPos[num155] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition;
|
||||
vector41 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
|
||||
vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector41, new Rectangle?(npc.frame), color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
}
|
||||
|
||||
Vector2 vector43 = npc.Center - Main.screenPosition;
|
||||
vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
|
||||
vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/ProfanedGuardians/ProfanedGuardianBossGlow");
|
||||
Color color37 = Color.Lerp(Color.White, Color.Yellow, 0.5f);
|
||||
|
||||
for (int num163 = 1; num163 < num153; num163++)
|
||||
{
|
||||
Color color41 = color37;
|
||||
color41 = Color.Lerp(color41, color36, amount9);
|
||||
color41 = npc.GetAlpha(color41);
|
||||
color41 *= (float)(num153 - num163) / 15f;
|
||||
Vector2 vector44 = npc.oldPos[num163] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition;
|
||||
vector44 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
|
||||
vector44 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector44, new Rectangle?(npc.frame), color41, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
}
|
||||
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), color37, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool CanHitPlayer(Player target, ref int cooldownSlot)
|
||||
{
|
||||
cooldownSlot = 1;
|
||||
return true;
|
||||
|
||||
@@ -3,6 +3,7 @@ using CalamityMod.Buffs.StatDebuffs;
|
||||
using CalamityMod.Projectiles.Boss;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
@@ -18,7 +19,8 @@ namespace CalamityMod.NPCs.ProfanedGuardians
|
||||
{
|
||||
DisplayName.SetDefault("Profaned Guardian");
|
||||
Main.npcFrameCount[npc.type] = 6;
|
||||
}
|
||||
NPCID.Sets.TrailingMode[npc.type] = 1;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
@@ -195,7 +197,56 @@ namespace CalamityMod.NPCs.ProfanedGuardians
|
||||
}
|
||||
}
|
||||
|
||||
public override bool CanHitPlayer(Player target, ref int cooldownSlot)
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
if (npc.spriteDirection == 1)
|
||||
spriteEffects = SpriteEffects.FlipHorizontally;
|
||||
|
||||
Texture2D texture2D15 = Main.npcTexture[npc.type];
|
||||
Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2));
|
||||
Color color36 = Color.White;
|
||||
float amount9 = 0.5f;
|
||||
int num153 = 5;
|
||||
|
||||
for (int num155 = 1; num155 < num153; num155 += 2)
|
||||
{
|
||||
Color color38 = lightColor;
|
||||
color38 = Color.Lerp(color38, color36, amount9);
|
||||
color38 = npc.GetAlpha(color38);
|
||||
color38 *= (float)(num153 - num155) / 15f;
|
||||
Vector2 vector41 = npc.oldPos[num155] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition;
|
||||
vector41 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
|
||||
vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector41, new Rectangle?(npc.frame), color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
}
|
||||
|
||||
Vector2 vector43 = npc.Center - Main.screenPosition;
|
||||
vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
|
||||
vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/ProfanedGuardians/ProfanedGuardianBoss2Glow");
|
||||
Color color37 = Color.Lerp(Color.White, Color.Yellow, 0.5f);
|
||||
|
||||
for (int num163 = 1; num163 < num153; num163++)
|
||||
{
|
||||
Color color41 = color37;
|
||||
color41 = Color.Lerp(color41, color36, amount9);
|
||||
color41 = npc.GetAlpha(color41);
|
||||
color41 *= (float)(num153 - num163) / 15f;
|
||||
Vector2 vector44 = npc.oldPos[num163] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition;
|
||||
vector44 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
|
||||
vector44 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector44, new Rectangle?(npc.frame), color41, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
}
|
||||
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), color37, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool CanHitPlayer(Player target, ref int cooldownSlot)
|
||||
{
|
||||
cooldownSlot = 1;
|
||||
return true;
|
||||
|
||||
|
After Width: | Height: | Size: 12 KiB |
@@ -3,6 +3,7 @@ using CalamityMod.Buffs.StatDebuffs;
|
||||
using CalamityMod.Projectiles.Boss;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
@@ -18,7 +19,8 @@ namespace CalamityMod.NPCs.ProfanedGuardians
|
||||
{
|
||||
DisplayName.SetDefault("Profaned Guardian");
|
||||
Main.npcFrameCount[npc.type] = 6;
|
||||
}
|
||||
NPCID.Sets.TrailingMode[npc.type] = 1;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
@@ -195,7 +197,66 @@ namespace CalamityMod.NPCs.ProfanedGuardians
|
||||
}
|
||||
}
|
||||
|
||||
public override bool CanHitPlayer(Player target, ref int cooldownSlot)
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
if (npc.spriteDirection == 1)
|
||||
spriteEffects = SpriteEffects.FlipHorizontally;
|
||||
|
||||
Texture2D texture2D15 = Main.npcTexture[npc.type];
|
||||
Texture2D texture2D16 = ModContent.GetTexture("CalamityMod/NPCs/ProfanedGuardians/ProfanedGuardianBoss3Glow2");
|
||||
Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2));
|
||||
Color color36 = Color.White;
|
||||
float amount9 = 0.5f;
|
||||
int num153 = 5;
|
||||
|
||||
for (int num155 = 1; num155 < num153; num155 += 2)
|
||||
{
|
||||
Color color38 = lightColor;
|
||||
color38 = Color.Lerp(color38, color36, amount9);
|
||||
color38 = npc.GetAlpha(color38);
|
||||
color38 *= (float)(num153 - num155) / 15f;
|
||||
Vector2 vector41 = npc.oldPos[num155] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition;
|
||||
vector41 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
|
||||
vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector41, new Rectangle?(npc.frame), color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
}
|
||||
|
||||
Vector2 vector43 = npc.Center - Main.screenPosition;
|
||||
vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
|
||||
vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/ProfanedGuardians/ProfanedGuardianBoss3Glow");
|
||||
Color color37 = Color.Lerp(Color.White, Color.Yellow, 0.5f);
|
||||
Color color42 = Color.Lerp(Color.White, Color.Violet, 0.5f);
|
||||
|
||||
for (int num163 = 1; num163 < num153; num163++)
|
||||
{
|
||||
Color color41 = color37;
|
||||
color41 = Color.Lerp(color41, color36, amount9);
|
||||
color41 = npc.GetAlpha(color41);
|
||||
color41 *= (float)(num153 - num163) / 15f;
|
||||
Vector2 vector44 = npc.oldPos[num163] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition;
|
||||
vector44 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
|
||||
vector44 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector44, new Rectangle?(npc.frame), color41, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
Color color43 = color42;
|
||||
color43 = Color.Lerp(color43, color36, amount9);
|
||||
color43 = npc.GetAlpha(color43);
|
||||
color43 *= (float)(num153 - num163) / 15f;
|
||||
spriteBatch.Draw(texture2D16, vector44, new Rectangle?(npc.frame), color43, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
}
|
||||
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), color37, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
spriteBatch.Draw(texture2D16, vector43, new Rectangle?(npc.frame), color42, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool CanHitPlayer(Player target, ref int cooldownSlot)
|
||||
{
|
||||
cooldownSlot = 1;
|
||||
return true;
|
||||
|
||||
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 13 KiB |
@@ -2,6 +2,7 @@
|
||||
using CalamityMod.Buffs.StatDebuffs;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
@@ -16,7 +17,8 @@ namespace CalamityMod.NPCs.Providence
|
||||
{
|
||||
DisplayName.SetDefault("A Profaned Guardian");
|
||||
Main.npcFrameCount[npc.type] = 6;
|
||||
}
|
||||
NPCID.Sets.TrailingMode[npc.type] = 1;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
@@ -140,7 +142,56 @@ namespace CalamityMod.NPCs.Providence
|
||||
}
|
||||
}
|
||||
|
||||
public override bool CheckActive()
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
if (npc.spriteDirection == 1)
|
||||
spriteEffects = SpriteEffects.FlipHorizontally;
|
||||
|
||||
Texture2D texture2D15 = Main.npcTexture[npc.type];
|
||||
Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2));
|
||||
Color color36 = Color.White;
|
||||
float amount9 = 0.5f;
|
||||
int num153 = 5;
|
||||
|
||||
for (int num155 = 1; num155 < num153; num155 += 2)
|
||||
{
|
||||
Color color38 = lightColor;
|
||||
color38 = Color.Lerp(color38, color36, amount9);
|
||||
color38 = npc.GetAlpha(color38);
|
||||
color38 *= (float)(num153 - num155) / 15f;
|
||||
Vector2 vector41 = npc.oldPos[num155] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition;
|
||||
vector41 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
|
||||
vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector41, new Rectangle?(npc.frame), color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
}
|
||||
|
||||
Vector2 vector43 = npc.Center - Main.screenPosition;
|
||||
vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
|
||||
vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/ProfanedGuardians/ProfanedGuardianBoss2Glow");
|
||||
Color color37 = Color.Lerp(Color.White, Color.Yellow, 0.5f);
|
||||
|
||||
for (int num163 = 1; num163 < num153; num163++)
|
||||
{
|
||||
Color color41 = color37;
|
||||
color41 = Color.Lerp(color41, color36, amount9);
|
||||
color41 = npc.GetAlpha(color41);
|
||||
color41 *= (float)(num153 - num163) / 15f;
|
||||
Vector2 vector44 = npc.oldPos[num163] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition;
|
||||
vector44 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
|
||||
vector44 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector44, new Rectangle?(npc.frame), color41, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
}
|
||||
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), color37, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool CheckActive()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using CalamityMod.Buffs.StatDebuffs;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
@@ -16,7 +17,8 @@ namespace CalamityMod.NPCs.Providence
|
||||
{
|
||||
DisplayName.SetDefault("A Profaned Guardian");
|
||||
Main.npcFrameCount[npc.type] = 6;
|
||||
}
|
||||
NPCID.Sets.TrailingMode[npc.type] = 1;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
@@ -162,7 +164,66 @@ namespace CalamityMod.NPCs.Providence
|
||||
}
|
||||
}
|
||||
|
||||
public override bool CheckActive()
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
if (npc.spriteDirection == 1)
|
||||
spriteEffects = SpriteEffects.FlipHorizontally;
|
||||
|
||||
Texture2D texture2D15 = Main.npcTexture[npc.type];
|
||||
Texture2D texture2D16 = ModContent.GetTexture("CalamityMod/NPCs/ProfanedGuardians/ProfanedGuardianBoss3Glow2");
|
||||
Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2));
|
||||
Color color36 = Color.White;
|
||||
float amount9 = 0.5f;
|
||||
int num153 = 5;
|
||||
|
||||
for (int num155 = 1; num155 < num153; num155 += 2)
|
||||
{
|
||||
Color color38 = lightColor;
|
||||
color38 = Color.Lerp(color38, color36, amount9);
|
||||
color38 = npc.GetAlpha(color38);
|
||||
color38 *= (float)(num153 - num155) / 15f;
|
||||
Vector2 vector41 = npc.oldPos[num155] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition;
|
||||
vector41 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
|
||||
vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector41, new Rectangle?(npc.frame), color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
}
|
||||
|
||||
Vector2 vector43 = npc.Center - Main.screenPosition;
|
||||
vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
|
||||
vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/ProfanedGuardians/ProfanedGuardianBoss3Glow");
|
||||
Color color37 = Color.Lerp(Color.White, Color.Yellow, 0.5f);
|
||||
Color color42 = Color.Lerp(Color.White, Color.Violet, 0.5f);
|
||||
|
||||
for (int num163 = 1; num163 < num153; num163++)
|
||||
{
|
||||
Color color41 = color37;
|
||||
color41 = Color.Lerp(color41, color36, amount9);
|
||||
color41 = npc.GetAlpha(color41);
|
||||
color41 *= (float)(num153 - num163) / 15f;
|
||||
Vector2 vector44 = npc.oldPos[num163] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition;
|
||||
vector44 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
|
||||
vector44 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector44, new Rectangle?(npc.frame), color41, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
Color color43 = color42;
|
||||
color43 = Color.Lerp(color43, color36, amount9);
|
||||
color43 = npc.GetAlpha(color43);
|
||||
color43 *= (float)(num153 - num163) / 15f;
|
||||
spriteBatch.Draw(texture2D16, vector44, new Rectangle?(npc.frame), color43, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
}
|
||||
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), color37, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
spriteBatch.Draw(texture2D16, vector43, new Rectangle?(npc.frame), color42, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool CheckActive()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -20,7 +20,8 @@ namespace CalamityMod.NPCs.Providence
|
||||
{
|
||||
DisplayName.SetDefault("A Profaned Guardian");
|
||||
Main.npcFrameCount[npc.type] = 6;
|
||||
}
|
||||
NPCID.Sets.TrailingMode[npc.type] = 1;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
@@ -42,8 +43,6 @@ namespace CalamityMod.NPCs.Providence
|
||||
npc.noGravity = true;
|
||||
npc.noTileCollide = true;
|
||||
aiType = -1;
|
||||
NPCID.Sets.TrailCacheLength[npc.type] = 8;
|
||||
NPCID.Sets.TrailingMode[npc.type] = 1;
|
||||
for (int k = 0; k < npc.buffImmune.Length; k++)
|
||||
{
|
||||
npc.buffImmune[k] = true;
|
||||
@@ -218,51 +217,58 @@ namespace CalamityMod.NPCs.Providence
|
||||
}
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor)
|
||||
{
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
if (npc.spriteDirection == 1)
|
||||
{
|
||||
spriteEffects = SpriteEffects.FlipHorizontally;
|
||||
}
|
||||
Color color24 = npc.GetAlpha(drawColor);
|
||||
Color color25 = Lighting.GetColor((int)((double)npc.position.X + (double)npc.width * 0.5) / 16, (int)(((double)npc.position.Y + (double)npc.height * 0.5) / 16.0));
|
||||
Texture2D texture2D3 = Main.npcTexture[npc.type];
|
||||
int num156 = Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type];
|
||||
int y3 = num156 * (int)npc.frameCounter;
|
||||
Rectangle rectangle = new Rectangle(0, y3, texture2D3.Width, num156);
|
||||
Vector2 origin2 = rectangle.Size() / 2f;
|
||||
int num157 = 8;
|
||||
int num158 = 2;
|
||||
int num159 = 1;
|
||||
float num160 = 0f;
|
||||
int num161 = num159;
|
||||
spriteBatch.Draw(texture2D3, npc.Center - Main.screenPosition + new Vector2(0, npc.gfxOffY), npc.frame, color24, npc.rotation, npc.frame.Size() / 2, npc.scale, spriteEffects, 0);
|
||||
while (npc.ai[0] == 2f && Lighting.NotRetro && ((num158 > 0 && num161 < num157) || (num158 < 0 && num161 > num157)))
|
||||
{
|
||||
Color color26 = npc.GetAlpha(color25);
|
||||
{
|
||||
goto IL_6899;
|
||||
}
|
||||
IL_6881:
|
||||
num161 += num158;
|
||||
continue;
|
||||
IL_6899:
|
||||
float num164 = (float)(num157 - num161);
|
||||
if (num158 < 0)
|
||||
{
|
||||
num164 = (float)(num159 - num161);
|
||||
}
|
||||
color26 *= num164 / ((float)NPCID.Sets.TrailCacheLength[npc.type] * 1.5f);
|
||||
Vector2 value4 = npc.oldPos[num161];
|
||||
float num165 = npc.rotation;
|
||||
Main.spriteBatch.Draw(texture2D3, value4 + npc.Size / 2f - Main.screenPosition + new Vector2(0, npc.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rectangle), color26, num165 + npc.rotation * num160 * (float)(num161 - 1) * -(float)spriteEffects.HasFlag(SpriteEffects.FlipHorizontally).ToDirectionInt(), origin2, npc.scale, spriteEffects, 0f);
|
||||
goto IL_6881;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
if (npc.spriteDirection == 1)
|
||||
spriteEffects = SpriteEffects.FlipHorizontally;
|
||||
|
||||
public override bool CheckActive()
|
||||
Texture2D texture2D15 = Main.npcTexture[npc.type];
|
||||
Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2));
|
||||
Color color36 = Color.White;
|
||||
float amount9 = 0.5f;
|
||||
int num153 = 5;
|
||||
if (npc.ai[0] == 2f)
|
||||
num153 = 10;
|
||||
|
||||
for (int num155 = 1; num155 < num153; num155 += 2)
|
||||
{
|
||||
Color color38 = lightColor;
|
||||
color38 = Color.Lerp(color38, color36, amount9);
|
||||
color38 = npc.GetAlpha(color38);
|
||||
color38 *= (float)(num153 - num155) / 15f;
|
||||
Vector2 vector41 = npc.oldPos[num155] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition;
|
||||
vector41 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
|
||||
vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector41, new Rectangle?(npc.frame), color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
}
|
||||
|
||||
Vector2 vector43 = npc.Center - Main.screenPosition;
|
||||
vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
|
||||
vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/ProfanedGuardians/ProfanedGuardianBossGlow");
|
||||
Color color37 = Color.Lerp(Color.White, Color.Yellow, 0.5f);
|
||||
|
||||
for (int num163 = 1; num163 < num153; num163++)
|
||||
{
|
||||
Color color41 = color37;
|
||||
color41 = Color.Lerp(color41, color36, amount9);
|
||||
color41 = npc.GetAlpha(color41);
|
||||
color41 *= (float)(num153 - num163) / 15f;
|
||||
Vector2 vector44 = npc.oldPos[num163] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition;
|
||||
vector44 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
|
||||
vector44 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector44, new Rectangle?(npc.frame), color41, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
}
|
||||
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), color37, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool CheckActive()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -51,7 +51,8 @@ namespace CalamityMod.NPCs.Providence
|
||||
{
|
||||
DisplayName.SetDefault("Providence, the Profaned Goddess");
|
||||
Main.npcFrameCount[npc.type] = 3;
|
||||
}
|
||||
NPCID.Sets.TrailingMode[npc.type] = 1;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
@@ -1245,31 +1246,107 @@ namespace CalamityMod.NPCs.Providence
|
||||
potionType = ItemID.SuperHealingPotion;
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor)
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
Texture2D texture = Main.npcTexture[npc.type];
|
||||
Texture2D textureGlow = ModContent.GetTexture("CalamityMod/NPCs/Providence/ProvidenceGlow");
|
||||
Texture2D textureGlow2 = ModContent.GetTexture("CalamityMod/NPCs/Providence/ProvidenceGlow2");
|
||||
|
||||
if (npc.ai[0] == 2f || npc.ai[0] == 5f)
|
||||
if (npc.ai[0] == 2f || npc.ai[0] == 5f)
|
||||
{
|
||||
if (!useDefenseFrames)
|
||||
texture = ModContent.GetTexture("CalamityMod/NPCs/Providence/ProvidenceDefense");
|
||||
else
|
||||
texture = ModContent.GetTexture("CalamityMod/NPCs/Providence/ProvidenceDefenseAlt");
|
||||
if (!useDefenseFrames)
|
||||
{
|
||||
texture = ModContent.GetTexture("CalamityMod/NPCs/Providence/ProvidenceDefense");
|
||||
textureGlow = ModContent.GetTexture("CalamityMod/NPCs/Providence/ProvidenceDefenseGlow");
|
||||
textureGlow2 = ModContent.GetTexture("CalamityMod/NPCs/Providence/ProvidenceDefenseGlow2");
|
||||
}
|
||||
else
|
||||
{
|
||||
texture = ModContent.GetTexture("CalamityMod/NPCs/Providence/ProvidenceDefenseAlt");
|
||||
textureGlow = ModContent.GetTexture("CalamityMod/NPCs/Providence/ProvidenceDefenseAltGlow");
|
||||
textureGlow2 = ModContent.GetTexture("CalamityMod/NPCs/Providence/ProvidenceDefenseAltGlow2");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (frameUsed == 0)
|
||||
texture = Main.npcTexture[npc.type];
|
||||
else if (frameUsed == 1)
|
||||
texture = ModContent.GetTexture("CalamityMod/NPCs/Providence/ProvidenceAlt");
|
||||
else if (frameUsed == 2)
|
||||
texture = ModContent.GetTexture("CalamityMod/NPCs/Providence/ProvidenceAttack");
|
||||
else
|
||||
texture = ModContent.GetTexture("CalamityMod/NPCs/Providence/ProvidenceAttackAlt");
|
||||
if (frameUsed == 0)
|
||||
{
|
||||
texture = Main.npcTexture[npc.type];
|
||||
textureGlow = ModContent.GetTexture("CalamityMod/NPCs/Providence/ProvidenceGlow");
|
||||
textureGlow2 = ModContent.GetTexture("CalamityMod/NPCs/Providence/ProvidenceGlow2");
|
||||
}
|
||||
else if (frameUsed == 1)
|
||||
{
|
||||
texture = ModContent.GetTexture("CalamityMod/NPCs/Providence/ProvidenceAlt");
|
||||
textureGlow = ModContent.GetTexture("CalamityMod/NPCs/Providence/ProvidenceAltGlow");
|
||||
textureGlow2 = ModContent.GetTexture("CalamityMod/NPCs/Providence/ProvidenceAltGlow2");
|
||||
}
|
||||
else if (frameUsed == 2)
|
||||
{
|
||||
texture = ModContent.GetTexture("CalamityMod/NPCs/Providence/ProvidenceAttack");
|
||||
textureGlow = ModContent.GetTexture("CalamityMod/NPCs/Providence/ProvidenceAttackGlow");
|
||||
textureGlow2 = ModContent.GetTexture("CalamityMod/NPCs/Providence/ProvidenceAttackGlow2");
|
||||
}
|
||||
else
|
||||
{
|
||||
texture = ModContent.GetTexture("CalamityMod/NPCs/Providence/ProvidenceAttackAlt");
|
||||
textureGlow = ModContent.GetTexture("CalamityMod/NPCs/Providence/ProvidenceAttackAltGlow");
|
||||
textureGlow2 = ModContent.GetTexture("CalamityMod/NPCs/Providence/ProvidenceAttackAltGlow2");
|
||||
}
|
||||
}
|
||||
|
||||
CalamityMod.DrawTexture(spriteBatch, texture, 0, npc, drawColor);
|
||||
return false;
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
if (npc.spriteDirection == 1)
|
||||
spriteEffects = SpriteEffects.FlipHorizontally;
|
||||
|
||||
Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2));
|
||||
Color color36 = Color.White;
|
||||
float amount9 = 0.5f;
|
||||
int num153 = 5;
|
||||
|
||||
for (int num155 = 1; num155 < num153; num155 += 2)
|
||||
{
|
||||
Color color38 = lightColor;
|
||||
color38 = Color.Lerp(color38, color36, amount9);
|
||||
color38 = npc.GetAlpha(color38);
|
||||
color38 *= (float)(num153 - num155) / 15f;
|
||||
Vector2 vector41 = npc.oldPos[num155] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition;
|
||||
vector41 -= new Vector2((float)texture.Width, (float)(texture.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
|
||||
vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture, vector41, new Rectangle?(npc.frame), color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
}
|
||||
|
||||
Vector2 vector43 = npc.Center - Main.screenPosition;
|
||||
vector43 -= new Vector2((float)texture.Width, (float)(texture.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
|
||||
vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture, vector43, new Rectangle?(npc.frame), npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
Color color37 = Color.Lerp(Color.White, Color.Yellow, 0.5f);
|
||||
Color color42 = Color.Lerp(Color.White, Color.Violet, 0.5f);
|
||||
|
||||
for (int num163 = 1; num163 < num153; num163++)
|
||||
{
|
||||
Color color41 = color37;
|
||||
color41 = Color.Lerp(color41, color36, amount9);
|
||||
color41 = npc.GetAlpha(color41);
|
||||
color41 *= (float)(num153 - num163) / 15f;
|
||||
Vector2 vector44 = npc.oldPos[num163] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition;
|
||||
vector44 -= new Vector2((float)textureGlow.Width, (float)(textureGlow.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
|
||||
vector44 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(textureGlow, vector44, new Rectangle?(npc.frame), color41, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
Color color43 = color42;
|
||||
color43 = Color.Lerp(color43, color36, amount9);
|
||||
color43 = npc.GetAlpha(color43);
|
||||
color43 *= (float)(num153 - num163) / 15f;
|
||||
spriteBatch.Draw(textureGlow2, vector44, new Rectangle?(npc.frame), color43, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
}
|
||||
|
||||
spriteBatch.Draw(textureGlow, vector43, new Rectangle?(npc.frame), color37, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
spriteBatch.Draw(textureGlow2, vector43, new Rectangle?(npc.frame), color42, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void FindFrame(int frameHeight) //9 total frames
|
||||
|
||||
|
After Width: | Height: | Size: 98 KiB |
|
After Width: | Height: | Size: 55 KiB |
|
After Width: | Height: | Size: 100 KiB |
|
After Width: | Height: | Size: 54 KiB |
|
After Width: | Height: | Size: 97 KiB |
|
After Width: | Height: | Size: 56 KiB |
|
After Width: | Height: | Size: 31 KiB |
|
After Width: | Height: | Size: 50 KiB |
|
After Width: | Height: | Size: 73 KiB |
|
After Width: | Height: | Size: 51 KiB |
|
After Width: | Height: | Size: 98 KiB |
|
After Width: | Height: | Size: 54 KiB |
@@ -1,6 +1,7 @@
|
||||
using CalamityMod.Projectiles.Boss;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
@@ -58,7 +59,10 @@ namespace CalamityMod.NPCs.Ravager
|
||||
{
|
||||
npc.timeLeft = 1800;
|
||||
}
|
||||
if (npc.alpha > 0)
|
||||
|
||||
Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 0f, 0.5f, 0.5f);
|
||||
|
||||
if (npc.alpha > 0)
|
||||
{
|
||||
npc.alpha -= 3;
|
||||
if (npc.alpha < 0)
|
||||
@@ -89,7 +93,7 @@ namespace CalamityMod.NPCs.Ravager
|
||||
{
|
||||
npc.ai[1] -= 1f;
|
||||
npc.localAI[0] += 1f;
|
||||
float SpeedY = 10f;
|
||||
float SpeedY = -10f;
|
||||
if (CalamityWorld.bossRushActive)
|
||||
{
|
||||
SpeedY *= 1.5f;
|
||||
@@ -115,6 +119,28 @@ namespace CalamityMod.NPCs.Ravager
|
||||
}
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
if (npc.spriteDirection == 1)
|
||||
spriteEffects = SpriteEffects.FlipHorizontally;
|
||||
|
||||
Texture2D texture2D15 = Main.npcTexture[npc.type];
|
||||
Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / 2));
|
||||
Vector2 vector43 = npc.Center - Main.screenPosition;
|
||||
vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
|
||||
vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/Ravager/FlamePillarGlow");
|
||||
Color color37 = Color.Lerp(Color.White, Color.Cyan, 0.5f);
|
||||
|
||||
spriteBatch.Draw(texture2D15, vector43, new Rectangle?(npc.frame), color37, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool CheckActive()
|
||||
{
|
||||
return false;
|
||||
|
||||
|
After Width: | Height: | Size: 3.4 KiB |
@@ -576,20 +576,20 @@ namespace CalamityMod.NPCs.Ravager
|
||||
Vector2 vector = center - Main.screenPosition;
|
||||
vector -= new Vector2((float)ModContent.GetTexture("CalamityMod/NPCs/Ravager/RavagerBodyGlow").Width, (float)(ModContent.GetTexture("CalamityMod/NPCs/Ravager/RavagerBodyGlow").Height / Main.npcFrameCount[npc.type])) * 1f / 2f;
|
||||
vector += vector11 * 1f + new Vector2(0f, 0f + 4f + npc.gfxOffY);
|
||||
Color color = new Color(127 - npc.alpha, 127 - npc.alpha, 127 - npc.alpha, 0).MultiplyRGBA(Microsoft.Xna.Framework.Color.Blue);
|
||||
Main.spriteBatch.Draw(ModContent.GetTexture("CalamityMod/NPCs/Ravager/RavagerBodyGlow"), vector,
|
||||
new Microsoft.Xna.Framework.Rectangle?(npc.frame), color, npc.rotation, vector11, 1f, spriteEffects, 0f);
|
||||
Color color = new Color(127 - npc.alpha, 127 - npc.alpha, 127 - npc.alpha, 0).MultiplyRGBA(Color.Blue);
|
||||
spriteBatch.Draw(ModContent.GetTexture("CalamityMod/NPCs/Ravager/RavagerBodyGlow"), vector,
|
||||
new Rectangle?(npc.frame), color, npc.rotation, vector11, 1f, spriteEffects, 0f);
|
||||
Color color2 = Lighting.GetColor((int)center.X / 16, (int)(center.Y / 16f));
|
||||
Main.spriteBatch.Draw(ModContent.GetTexture("CalamityMod/NPCs/Ravager/RavagerLegRight"), new Vector2(center.X - Main.screenPosition.X + 28f, center.Y - Main.screenPosition.Y + 20f), //72
|
||||
new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, 0, ModContent.GetTexture("CalamityMod/NPCs/Ravager/RavagerLegRight").Width, ModContent.GetTexture("CalamityMod/NPCs/Ravager/RavagerLegRight").Height)),
|
||||
spriteBatch.Draw(ModContent.GetTexture("CalamityMod/NPCs/Ravager/RavagerLegRight"), new Vector2(center.X - Main.screenPosition.X + 28f, center.Y - Main.screenPosition.Y + 20f), //72
|
||||
new Rectangle?(new Rectangle(0, 0, ModContent.GetTexture("CalamityMod/NPCs/Ravager/RavagerLegRight").Width, ModContent.GetTexture("CalamityMod/NPCs/Ravager/RavagerLegRight").Height)),
|
||||
color2, 0f, default, 1f, SpriteEffects.None, 0f);
|
||||
Main.spriteBatch.Draw(ModContent.GetTexture("CalamityMod/NPCs/Ravager/RavagerLegLeft"), new Vector2(center.X - Main.screenPosition.X - 112f, center.Y - Main.screenPosition.Y + 20f), //72
|
||||
new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, 0, ModContent.GetTexture("CalamityMod/NPCs/Ravager/RavagerLegLeft").Width, ModContent.GetTexture("CalamityMod/NPCs/Ravager/RavagerLegLeft").Height)),
|
||||
spriteBatch.Draw(ModContent.GetTexture("CalamityMod/NPCs/Ravager/RavagerLegLeft"), new Vector2(center.X - Main.screenPosition.X - 112f, center.Y - Main.screenPosition.Y + 20f), //72
|
||||
new Rectangle?(new Rectangle(0, 0, ModContent.GetTexture("CalamityMod/NPCs/Ravager/RavagerLegLeft").Width, ModContent.GetTexture("CalamityMod/NPCs/Ravager/RavagerLegLeft").Height)),
|
||||
color2, 0f, default, 1f, SpriteEffects.None, 0f);
|
||||
if (NPC.CountNPCS(ModContent.NPCType<RavagerHead>()) > 0)
|
||||
if (NPC.AnyNPCs(ModContent.NPCType<RavagerHead>()))
|
||||
{
|
||||
Main.spriteBatch.Draw(ModContent.GetTexture("CalamityMod/NPCs/Ravager/RavagerHead"), new Vector2(center.X - Main.screenPosition.X - 70f, center.Y - Main.screenPosition.Y - 75f),
|
||||
new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, 0, ModContent.GetTexture("CalamityMod/NPCs/Ravager/RavagerHead").Width, ModContent.GetTexture("CalamityMod/NPCs/Ravager/RavagerHead").Height)),
|
||||
spriteBatch.Draw(ModContent.GetTexture("CalamityMod/NPCs/Ravager/RavagerHead"), new Vector2(center.X - Main.screenPosition.X - 70f, center.Y - Main.screenPosition.Y - 75f),
|
||||
new Rectangle?(new Rectangle(0, 0, ModContent.GetTexture("CalamityMod/NPCs/Ravager/RavagerHead").Width, ModContent.GetTexture("CalamityMod/NPCs/Ravager/RavagerHead").Height)),
|
||||
color2, 0f, default, 1f, SpriteEffects.None, 0f);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -273,8 +273,8 @@ namespace CalamityMod.NPCs.Ravager
|
||||
Vector2 center = new Vector2(npc.Center.X, npc.Center.Y);
|
||||
float drawPositionX = Main.npc[CalamityGlobalNPC.scavenger].Center.X - center.X;
|
||||
float drawPositionY = Main.npc[CalamityGlobalNPC.scavenger].Center.Y - center.Y;
|
||||
drawPositionY += 30f;
|
||||
drawPositionX -= 70f;
|
||||
drawPositionY += 12f;
|
||||
drawPositionX -= 28f;
|
||||
float rotation = (float)Math.Atan2((double)drawPositionY, (double)drawPositionX) - 1.57f;
|
||||
bool draw = true;
|
||||
while (draw)
|
||||
@@ -293,11 +293,11 @@ namespace CalamityMod.NPCs.Ravager
|
||||
center.Y += drawPositionY;
|
||||
drawPositionX = Main.npc[CalamityGlobalNPC.scavenger].Center.X - center.X;
|
||||
drawPositionY = Main.npc[CalamityGlobalNPC.scavenger].Center.Y - center.Y;
|
||||
drawPositionY += 30f;
|
||||
drawPositionX -= 70f;
|
||||
drawPositionY += 12f;
|
||||
drawPositionX -= 28f;
|
||||
Color color = Lighting.GetColor((int)center.X / 16, (int)(center.Y / 16f));
|
||||
Main.spriteBatch.Draw(ModContent.GetTexture("CalamityMod/NPCs/Ravager/RavagerChain"), new Vector2(center.X - Main.screenPosition.X, center.Y - Main.screenPosition.Y),
|
||||
new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, 0, ModContent.GetTexture("CalamityMod/NPCs/Ravager/RavagerChain").Width, ModContent.GetTexture("CalamityMod/NPCs/Ravager/RavagerChain").Height)), color, rotation,
|
||||
spriteBatch.Draw(ModContent.GetTexture("CalamityMod/NPCs/Ravager/RavagerChain"), new Vector2(center.X - Main.screenPosition.X, center.Y - Main.screenPosition.Y),
|
||||
new Rectangle?(new Rectangle(0, 0, ModContent.GetTexture("CalamityMod/NPCs/Ravager/RavagerChain").Width, ModContent.GetTexture("CalamityMod/NPCs/Ravager/RavagerChain").Height)), color, rotation,
|
||||
new Vector2((float)ModContent.GetTexture("CalamityMod/NPCs/Ravager/RavagerChain").Width * 0.5f, (float)ModContent.GetTexture("CalamityMod/NPCs/Ravager/RavagerChain").Height * 0.5f), 1f, SpriteEffects.None, 0f);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -274,8 +274,8 @@ namespace CalamityMod.NPCs.Ravager
|
||||
Vector2 center = new Vector2(npc.Center.X, npc.Center.Y);
|
||||
float drawPositionX = Main.npc[CalamityGlobalNPC.scavenger].Center.X - center.X;
|
||||
float drawPositionY = Main.npc[CalamityGlobalNPC.scavenger].Center.Y - center.Y;
|
||||
drawPositionY += 30f;
|
||||
drawPositionX += 70f;
|
||||
drawPositionY += 12f;
|
||||
drawPositionX += 28f;
|
||||
float rotation = (float)Math.Atan2((double)drawPositionY, (double)drawPositionX) - 1.57f;
|
||||
bool draw = true;
|
||||
while (draw)
|
||||
@@ -294,11 +294,11 @@ namespace CalamityMod.NPCs.Ravager
|
||||
center.Y += drawPositionY;
|
||||
drawPositionX = Main.npc[CalamityGlobalNPC.scavenger].Center.X - center.X;
|
||||
drawPositionY = Main.npc[CalamityGlobalNPC.scavenger].Center.Y - center.Y;
|
||||
drawPositionY += 30f;
|
||||
drawPositionX += 70f;
|
||||
drawPositionY += 12f;
|
||||
drawPositionX += 28f;
|
||||
Color color = Lighting.GetColor((int)center.X / 16, (int)(center.Y / 16f));
|
||||
Main.spriteBatch.Draw(ModContent.GetTexture("CalamityMod/NPCs/Ravager/RavagerChain"), new Vector2(center.X - Main.screenPosition.X, center.Y - Main.screenPosition.Y),
|
||||
new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, 0, ModContent.GetTexture("CalamityMod/NPCs/Ravager/RavagerChain").Width, ModContent.GetTexture("CalamityMod/NPCs/Ravager/RavagerChain").Height)), color, rotation,
|
||||
spriteBatch.Draw(ModContent.GetTexture("CalamityMod/NPCs/Ravager/RavagerChain"), new Vector2(center.X - Main.screenPosition.X, center.Y - Main.screenPosition.Y),
|
||||
new Rectangle?(new Rectangle(0, 0, ModContent.GetTexture("CalamityMod/NPCs/Ravager/RavagerChain").Width, ModContent.GetTexture("CalamityMod/NPCs/Ravager/RavagerChain").Height)), color, rotation,
|
||||
new Vector2((float)ModContent.GetTexture("CalamityMod/NPCs/Ravager/RavagerChain").Width * 0.5f, (float)ModContent.GetTexture("CalamityMod/NPCs/Ravager/RavagerChain").Height * 0.5f), 1f, SpriteEffects.None, 0f);
|
||||
}
|
||||
}
|
||||
|
||||