Added small amount of DR to birb, birb gets a ton of DR while spawning lightning spheres.

This commit is contained in:
Andrew Marheine committed 2020-03-24 22:50:53 -05:00
1 parent aca982f0a5
commit 96f46efc62
3 files changed
+33 -22

No files matched your search

+26 -17
View File
@@ -41,7 +41,12 @@ namespace CalamityMod.NPCs.Bumblebirb
npc.width = 130;
npc.height = 100;
npc.defense = 40;
npc.LifeMaxNERB(227500, 252500, 3000000);
CalamityGlobalNPC global = npc.Calamity();
global.DR = 0.1f;
global.customDR = true;
global.multDRReductions.Add(BuffID.Ichor, 0.88f);
global.multDRReductions.Add(BuffID.CursedInferno, 0.9f);
npc.LifeMaxNERB(227500, 252500, 3000000);
double HPBoost = CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01;
npc.lifeMax += (int)(npc.lifeMax * HPBoost);
npc.knockBackResist = 0f;
@@ -213,7 +218,7 @@ namespace CalamityMod.NPCs.Bumblebirb
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 color = lightColor;
Color color36 = phase2 && calamityGlobalNPC.newAI[2] == 1f ? Color.Yellow : Color.White;
Color color36 = Color.White;
float amount9 = 0f;
int num150 = 120;
@@ -221,23 +226,17 @@ namespace CalamityMod.NPCs.Bumblebirb
if (phase3 && calamityGlobalNPC.newAI[3] == 1f)
{
color = buffColor(color, 0.4f, 0.8f, 0.4f, 1f);
}
else if (phase3 && calamityGlobalNPC.newAI[1] > (float)num150)
{
float num152 = calamityGlobalNPC.newAI[1] - (float)num150;
num152 /= (float)num151;
color = buffColor(color, 1f - 0.5f * num152, 1f - 0.5f * num152, 1f - 0.3f * num152, 1f);
color = buffColor(color, 0.9f, 0.6f, 0.2f, 1f);
}
else if (phase2 && calamityGlobalNPC.newAI[2] == 1f)
{
color = buffColor(color, 0.5f, 0.7f, 0.5f, 1f);
color = buffColor(color, 0.7f, 0.7f, 0.3f, 1f);
}
else if (phase2 && calamityGlobalNPC.newAI[0] > (float)num150)
{
float num152 = calamityGlobalNPC.newAI[0] - (float)num150;
num152 /= (float)num151;
color = buffColor(color, 1f - 0.5f * num152, 1f - 0.5f * num152, 1f - 0.3f * num152, 1f);
color = buffColor(color, 1f - 0.3f * num152, 1f - 0.3f * num152, 1f - 0.7f * num152, 1f);
}
int num153 = 10;
@@ -250,7 +249,7 @@ namespace CalamityMod.NPCs.Bumblebirb
{
num153 = 7;
}
if (npc.ai[0] == 2f || npc.ai[0] == 3.2f)
if (npc.ai[0] == 2f || npc.ai[0] == 3.2f || (phase2 && calamityGlobalNPC.newAI[2] == 1f))
{
color36 = Color.Yellow;
amount9 = 0.5f;
@@ -294,12 +293,22 @@ namespace CalamityMod.NPCs.Bumblebirb
}
}
if (phaseSwitchPhase && (calamityGlobalNPC.newAI[0] > (float)num150 || calamityGlobalNPC.newAI[1] > (float)num150))
if (phaseSwitchPhase)
{
num156 = 6;
num157 = 1f - (float)Math.Cos((double)(((phase3 ? calamityGlobalNPC.newAI[1] : calamityGlobalNPC.newAI[0]) - (float)num150) / (float)num151 * MathHelper.TwoPi));
num157 /= 3f;
scaleFactor9 = 60f;
if (phase3 && calamityGlobalNPC.newAI[1] > (float)num150)
{
num156 = 6;
num157 = 1f - (float)Math.Cos((double)((calamityGlobalNPC.newAI[1] - (float)num150) / (float)num151 * MathHelper.TwoPi));
num157 /= 3f;
scaleFactor9 = 60f;
}
else if (phase2 && calamityGlobalNPC.newAI[0] > (float)num150)
{
num156 = 6;
num157 = 1f - (float)Math.Cos((double)((calamityGlobalNPC.newAI[0] - (float)num150) / (float)num151 * MathHelper.TwoPi));
num157 /= 3f;
scaleFactor9 = 60f;
}
}
for (int num160 = 0; num160 < num156; num160++)
+2
View File
@@ -3701,6 +3701,8 @@ namespace CalamityMod.NPCs
npc.dontTakeDamage = phaseSwitchPhase;
calamityGlobalNPC.DR = npc.ai[0] == 5f ? 0.75f : 0.1f;
if (phaseSwitchPhase)
{
npc.collideX = false;
+5 -5
View File
@@ -251,7 +251,7 @@ namespace CalamityMod.NPCs.OldDuke
if (npc.ai[2] > (float)num158)
{
num156 = 6;
num157 = 1f - (float)Math.Cos((double)((npc.ai[2] - (float)num158) / (float)num159 * 6.28318548f));
num157 = 1f - (float)Math.Cos((double)((npc.ai[2] - (float)num158) / (float)num159 * MathHelper.TwoPi));
num157 /= 3f;
scaleFactor9 = 40f;
}
@@ -260,7 +260,7 @@ namespace CalamityMod.NPCs.OldDuke
if ((npc.ai[0] == 4f || npc.ai[0] == 9f) && npc.ai[2] > (float)num150)
{
num156 = 6;
num157 = 1f - (float)Math.Cos((double)((npc.ai[2] - (float)num150) / (float)num151 * 6.28318548f));
num157 = 1f - (float)Math.Cos((double)((npc.ai[2] - (float)num150) / (float)num151 * MathHelper.TwoPi));
num157 /= 3f;
scaleFactor9 = 60f;
}
@@ -268,7 +268,7 @@ namespace CalamityMod.NPCs.OldDuke
if (npc.ai[0] == 12f)
{
num156 = 6;
num157 = 1f - (float)Math.Cos((double)(npc.ai[2] / 30f * 6.28318548f));
num157 = 1f - (float)Math.Cos((double)(npc.ai[2] / 30f * MathHelper.TwoPi));
num157 /= 3f;
scaleFactor9 = 20f;
}
@@ -279,7 +279,7 @@ namespace CalamityMod.NPCs.OldDuke
color39 = Color.Lerp(color39, color36, amount9);
color39 = npc.GetAlpha(color39);
color39 *= 1f - num157;
Vector2 vector42 = npc.Center + ((float)num160 / (float)num156 * 6.28318548f + npc.rotation).ToRotationVector2() * scaleFactor9 * num157 - Main.screenPosition;
Vector2 vector42 = npc.Center + ((float)num160 / (float)num156 * MathHelper.TwoPi + npc.rotation).ToRotationVector2() * scaleFactor9 * num157 - Main.screenPosition;
vector42 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
vector42 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
spriteBatch.Draw(texture2D15, vector42, new Rectangle?(npc.frame), color39, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
@@ -343,7 +343,7 @@ namespace CalamityMod.NPCs.OldDuke
color42 = Color.Lerp(color42, color36, amount9);
color42 = npc.GetAlpha(color42);
color42 *= 1f - num157;
Vector2 vector45 = npc.Center + ((float)num164 / (float)num156 * 6.28318548f + npc.rotation).ToRotationVector2() * scaleFactor9 * num157 - Main.screenPosition;
Vector2 vector45 = npc.Center + ((float)num164 / (float)num156 * MathHelper.TwoPi + npc.rotation).ToRotationVector2() * scaleFactor9 * num157 - Main.screenPosition;
vector45 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
vector45 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
spriteBatch.Draw(texture2D15, vector45, new Rectangle?(npc.frame), color42, npc.rotation, vector11, npc.scale, spriteEffects, 0f);