changed the rest of the NPCs to use DropHelper

This commit is contained in:
termigator1359 committed 2020-08-02 09:31:57 -04:00
1 parent f992fd98a0
commit dcbc09311f
26 files changed
+47 -117

No files matched your search

+10 -13
View File
@@ -77,7 +77,7 @@ namespace CalamityMod.NPCs.Leviathan
npc.Opacity = MathHelper.Clamp(npc.ai[0] / 90f, 0f, 1f);
Lighting.AddLight((int)((npc.position.X + (npc.width / 2)) / 16f), (int)((npc.position.Y + (npc.height / 2)) / 16f), 0f, 0f, 0.8f * npc.Opacity);
Lighting.AddLight((int)npc.Center.X / 16, (int)npc.Center.Y / 16, 0f, 0f, 0.8f * npc.Opacity);
if (CalamityPlayer.areThereAnyDamnBosses)
npc.active = false;
@@ -89,17 +89,17 @@ namespace CalamityMod.NPCs.Leviathan
if (npc.spriteDirection == 1)
spriteEffects = SpriteEffects.FlipHorizontally;
Texture2D texture2D15 = Main.npcTexture[npc.type];
Vector2 vector11 = new Vector2(Main.npcTexture[npc.type].Width / 2, Main.npcTexture[npc.type].Height / 2);
Texture2D drawTex = Main.npcTexture[npc.type];
Vector2 origin = new Vector2(drawTex.Width / 2, drawTex.Height / 2);
Vector2 vector43 = npc.Center - Main.screenPosition;
vector43 -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f;
vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f);
Vector2 drawPos = npc.Center - Main.screenPosition;
drawPos -= new Vector2(drawTex.Width, drawTex.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f;
drawPos += origin * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
spriteBatch.Draw(drawTex, drawPos, npc.frame, npc.GetAlpha(lightColor), npc.rotation, origin, npc.scale, spriteEffects, 0f);
texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/Leviathan/LeviathanStartGlow");
drawTex = ModContent.GetTexture("CalamityMod/NPCs/Leviathan/LeviathanStartGlow");
spriteBatch.Draw(texture2D15, vector43, npc.frame, Color.White, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
spriteBatch.Draw(drawTex, drawPos, npc.frame, Color.White, npc.rotation, origin, npc.scale, spriteEffects, 0f);
return false;
}
@@ -129,10 +129,7 @@ namespace CalamityMod.NPCs.Leviathan
public override void NPCLoot()
{
if (CalamityWorld.revenge && Main.rand.NextBool(4))
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType<SirensHeart>());
}
DropHelper.DropItemCondition(npc, ModContent.ItemType<SirensHeart>(), CalamityWorld.revenge, 0.25f);
}
public override void HitEffect(int hitDirection, double damage)
+1 -4
View File
@@ -63,10 +63,7 @@ namespace CalamityMod.NPCs.NormalNPCs
public override void NPCLoot()
{
if (Main.rand.NextBool(2))
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType<BlightedLens>());
}
DropHelper.DropItemChance(npc, ModContent.ItemType<BlightedLens>(), 0.5f);
}
}
}
+1 -1
View File
@@ -65,7 +65,7 @@ namespace CalamityMod.NPCs.NormalNPCs
if (CalamityWorld.downedSCal)
{
// RIP LORDE
// Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType<NO>());
// DropHelper.DropItem(npc, ModContent.ItemType<NO>());
}
DropHelper.DropItem(npc, ItemID.LihzahrdBrick, 10, 30);
DropHelper.DropItemChance(npc, ItemID.LunarTabletFragment, 7, 1, 3); //solar tablet fragment
+1 -1
View File
@@ -74,7 +74,7 @@ namespace CalamityMod.NPCs.NormalNPCs
{
int item = Item.NewItem(npc.Center, npc.Size, ModContent.ItemType<EbonianGel>(), Main.rand.Next(15, 21), false, 0, false, false);
Main.item[item].color = new Color(250, 50, 50, 255);
NetMessage.SendData(88, -1, -1, null, item, 1f, 0f, 0f, 0, 0, 0);
NetMessage.SendData(MessageID.ItemTweaker, -1, -1, null, item, 1f, 0f, 0f, 0, 0, 0);
DropHelper.DropItem(npc, ItemID.Gel, 10, 14);
DropHelper.DropItemCondition(npc, ModContent.ItemType<Carnage>(), NPC.downedBoss3, 0.01f, 1, 1);
+1 -4
View File
@@ -99,10 +99,7 @@ namespace CalamityMod.NPCs.NormalNPCs
public override void NPCLoot()
{
if (Main.rand.NextBool(2))
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType<EssenceofEleum>());
}
DropHelper.DropItemChance(npc, ModContent.ItemType<EssenceofEleum>(), 0.5f);
}
}
}
+2 -5
View File
@@ -458,11 +458,8 @@ namespace CalamityMod.NPCs.NormalNPCs
public override void NPCLoot()
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.TinHelmet);
if (Main.hardMode)
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.MagicDagger);
}
DropHelper.DropItem(npc, ItemID.TinHelmet);
DropHelper.DropItemCondition(npc, ItemID.MagicDagger, Main.hardMode);
}
}
}
+1 -4
View File
@@ -95,10 +95,7 @@ namespace CalamityMod.NPCs.NormalNPCs
public override void NPCLoot()
{
if (Main.rand.NextBool(4))
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType<EssenceofChaos>());
}
DropHelper.DropItemChance(npc, ModContent.ItemType<EssenceofChaos>(), 0.25f);
}
}
}
+4 -16
View File
@@ -105,22 +105,10 @@ namespace CalamityMod.NPCs.NormalNPCs
public override void NPCLoot()
{
if (Main.rand.NextBool(3))
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType<AridArtifact>());
}
if (Main.rand.NextBool(4))
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType<SlagMagnum>());
}
if (Main.rand.NextBool(4))
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType<Aftershock>());
}
if (Main.rand.NextBool(4))
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType<EarthenPike>());
}
DropHelper.DropItemChance(npc, ModContent.ItemType<AridArtifact>(), 3);
DropHelper.DropItemChance(npc, ModContent.ItemType<SlagMagnum>(), 4);
DropHelper.DropItemChance(npc, ModContent.ItemType<Aftershock>(), 4);
DropHelper.DropItemChance(npc, ModContent.ItemType<EarthenPike>(), 4);
}
public override void HitEffect(int hitDirection, double damage)
+3 -9
View File
@@ -275,15 +275,9 @@ namespace CalamityMod.NPCs.NormalNPCs
public override void NPCLoot()
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType<EssenceofEleum>());
if (Main.rand.NextBool(10))
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType<FrostBarrier>());
}
if (Main.rand.NextBool(3))
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType<AncientIceChunk>());
}
DropHelper.DropItem(npc, ModContent.ItemType<EssenceofEleum>());
DropHelper.DropItemChance(npc, ModContent.ItemType<FrostBarrier>(), 10);
DropHelper.DropItemChance(npc, ModContent.ItemType<AncientIceChunk>(), 3);
}
}
}
+2 -5
View File
@@ -279,11 +279,8 @@ namespace CalamityMod.NPCs.NormalNPCs
public override void NPCLoot()
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType<UnholyEssence>(), Main.rand.Next(2, 5));
if (Main.rand.NextBool(15))
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType<EnergyStaff>());
}
DropHelper.DropItem(npc, ModContent.ItemType<UnholyEssence>(), 2, 4);
DropHelper.DropItemChance(npc, ModContent.ItemType<EnergyStaff>(), 15);
}
public override void HitEffect(int hitDirection, double damage)
+1 -4
View File
@@ -105,10 +105,7 @@ namespace CalamityMod.NPCs.NormalNPCs
public override void NPCLoot()
{
if (Main.rand.NextBool(5) && NPC.downedPlantBoss)
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType<MantisClaws>());
}
DropHelper.DropItemCondition(npc, ModContent.ItemType<MantisClaws>(), NPC.downedPlantBoss, 0.2f);
}
public override void HitEffect(int hitDirection, double damage)
+2 -5
View File
@@ -435,11 +435,8 @@ namespace CalamityMod.NPCs.NormalNPCs
public override void NPCLoot()
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType<AncientBoneDust>());
if (NPC.downedMoonlord)
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType<Phantoplasm>());
}
DropHelper.DropItem(npc, ModContent.ItemType<AncientBoneDust>());
DropHelper.DropItemCondition(npc, ModContent.ItemType<Phantoplasm>(), NPC.downedMoonlord);
}
}
}
+2 -5
View File
@@ -429,11 +429,8 @@ namespace CalamityMod.NPCs.NormalNPCs
public override void NPCLoot()
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType<AncientBoneDust>());
if (NPC.downedMoonlord)
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType<Phantoplasm>());
}
DropHelper.DropItem(npc, ModContent.ItemType<AncientBoneDust>());
DropHelper.DropItemCondition(npc, ModContent.ItemType<Phantoplasm>(), NPC.downedMoonlord);
}
}
}
+1 -1
View File
@@ -130,7 +130,7 @@ namespace CalamityMod.NPCs.NormalNPCs
public override void NPCLoot()
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType<Phantoplasm>(), Main.rand.Next(2, 5));
DropHelper.DropItem(npc, ModContent.ItemType<Phantoplasm>(), 2, 4);
}
}
}
+1 -1
View File
@@ -91,7 +91,7 @@ namespace CalamityMod.NPCs.NormalNPCs
public override void NPCLoot()
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType<Phantoplasm>(), Main.rand.Next(1, 4));
DropHelper.DropItem(npc, ModContent.ItemType<Phantoplasm>(), 1, 3);
}
}
}
+1 -1
View File
@@ -89,7 +89,7 @@ namespace CalamityMod.NPCs.NormalNPCs
public override void NPCLoot()
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType<Phantoplasm>(), Main.rand.Next(1, 3));
DropHelper.DropItem(npc, ModContent.ItemType<Phantoplasm>(), 1, 2);
}
}
}
+1 -1
View File
@@ -187,7 +187,7 @@ namespace CalamityMod.NPCs.NormalNPCs
public override void NPCLoot()
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType<PlagueCellCluster>(), Main.rand.Next(1, 3));
DropHelper.DropItem(npc, ModContent.ItemType<PlagueCellCluster>(), 1, 2);
}
}
}
+1 -1
View File
@@ -71,7 +71,7 @@ namespace CalamityMod.NPCs.NormalNPCs
public override void NPCLoot()
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType<PlagueCellCluster>(), Main.rand.Next(1, 3));
DropHelper.DropItem(npc, ModContent.ItemType<PlagueCellCluster>(), 1, 2);
}
}
}
+1 -1
View File
@@ -71,7 +71,7 @@ namespace CalamityMod.NPCs.NormalNPCs
public override void NPCLoot()
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType<PlagueCellCluster>(), Main.rand.Next(3, 5));
DropHelper.DropItem(npc, ModContent.ItemType<PlagueCellCluster>(), 3, 4);
}
}
}
+1 -1
View File
@@ -80,7 +80,7 @@ namespace CalamityMod.NPCs.NormalNPCs
public override void NPCLoot()
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType<UnholyEssence>(), Main.rand.Next(2, 5));
DropHelper.DropItem(npc, ModContent.ItemType<UnholyEssence>(), 2, 4);
}
}
}
+1 -4
View File
@@ -60,10 +60,7 @@ namespace CalamityMod.NPCs.NormalNPCs
public override void NPCLoot()
{
if (Main.rand.NextBool(10))
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.TurtleShell);
}
DropHelper.DropItemChance(npc, ItemID.TurtleShell, 0.1f);
}
}
}
+1 -1
View File
@@ -204,7 +204,7 @@ namespace CalamityMod.NPCs.NormalNPCs
public override void NPCLoot()
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType<UnholyEssence>(), Main.rand.Next(2, 5));
DropHelper.DropItem(npc, ModContent.ItemType<UnholyEssence>(), 2, 4);
}
}
}
+1 -4
View File
@@ -79,10 +79,7 @@ namespace CalamityMod.NPCs.NormalNPCs
public override void NPCLoot()
{
if (Main.rand.NextBool(3))
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType<EssenceofCinder>());
}
DropHelper.DropItemChance(npc, ModContent.ItemType<EssenceofCinder>(), 3);
}
}
}
+1 -4
View File
@@ -221,10 +221,7 @@ namespace CalamityMod.NPCs.NormalNPCs
public override void NPCLoot()
{
if (Main.hardMode && Main.rand.NextBool(3))
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType<EssenceofCinder>());
}
DropHelper.DropItemCondition(npc, ModContent.ItemType<EssenceofCinder>(), Main.hardMode, 3, 1, 1);
}
public override void HitEffect(int hitDirection, double damage)
+4 -20
View File
@@ -306,26 +306,10 @@ namespace CalamityMod.NPCs.NormalNPCs
public override void NPCLoot()
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType<EssenceofCinder>(), Main.rand.Next(2, 4));
if (Main.rand.NextBool(100) && CalamityWorld.downedProvidence)
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType<Thunderstorm>());
}
if (Main.expertMode)
{
if (Main.rand.NextBool(3))
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType<EyeoftheStorm>());
}
}
else if (Main.rand.NextBool(4))
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType<EyeoftheStorm>());
}
if (Main.rand.NextBool(5))
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType<StormSaber>());
}
DropHelper.DropItem(npc, ModContent.ItemType<EssenceofCinder>(), 2, 3);
DropHelper.DropItemCondition(npc, ModContent.ItemType<Thunderstorm>(), CalamityWorld.downedProvidence, 100, 1, 1);
DropHelper.DropItemChance(npc, ModContent.ItemType<EyeoftheStorm>(), Main.expertMode ? 3 : 4);
DropHelper.DropItemChance(npc, ModContent.ItemType<StormSaber>(), 5);
}
}
}
+1 -1
View File
@@ -353,7 +353,7 @@ namespace CalamityMod.NPCs.SulphurousSea
DropHelper.DropItemCondition(npc, ModContent.ItemType<SulphuricAcidCannon>(), CalamityWorld.downedPolterghast, 3, 1, 1);
int item = Item.NewItem(npc.Center, npc.Size, ItemID.SharkFin, Main.rand.Next(2, 5), false, 0, false, false);
Main.item[item].color = new Color(151, 115, 57, 255);
NetMessage.SendData(88, -1, -1, null, item, 1f, 0f, 0f, 0, 0, 0);
NetMessage.SendData(MessageID.ItemTweaker, -1, -1, null, item, 1f, 0f, 0f, 0, 0, 0);
}
public override float SpawnChance(NPCSpawnInfo spawnInfo)