Shit up to Anahita/Levi

This commit is contained in:
Dominic committed 2022-04-07 19:22:43 -05:00
1 parent 7efa9f5b1e
commit 01bd3beec7
75 files changed
+791 -817

No files matched your search

@@ -192,8 +192,6 @@ namespace CalamityMod.NPCs.AdultEidolonWyrm
public override bool CheckActive() => false;
public override bool PreNPCLoot() => false;
public override void HitEffect(int hitDirection, double damage)
{
if (NPC.life <= 0)
@@ -192,8 +192,6 @@ namespace CalamityMod.NPCs.AdultEidolonWyrm
public override bool CheckActive() => false;
public override bool PreNPCLoot() => false;
public override void HitEffect(int hitDirection, double damage)
{
if (NPC.life <= 0)
@@ -157,8 +157,6 @@ namespace CalamityMod.NPCs.AdultEidolonWyrm
public override bool CheckActive() => false;
public override bool PreNPCLoot() => false;
public override void HitEffect(int hitDirection, double damage)
{
if (NPC.life <= 0)
-12
View File
@@ -141,18 +141,6 @@ namespace CalamityMod.NPCs.AquaticScourge
}
int num268 = (int)(NPC.position.X + (float)(NPC.width / 2)) / 16;
int num269 = (int)(NPC.position.Y + (float)(NPC.height / 2)) / 16;
if (Main.tile[num268, num269 - 1] == null)
{
Main.tile[num268, num269 - 1] = new Tile();
}
if (Main.tile[num268, num269 + 1] == null)
{
Main.tile[num268, num269 + 1] = new Tile();
}
if (Main.tile[num268, num269 + 2] == null)
{
Main.tile[num268, num269 + 2] = new Tile();
}
if (Main.tile[num268, num269 - 1].LiquidAmount > 128)
{
if (Main.tile[num268, num269 + 1].HasTile)
@@ -123,11 +123,6 @@ namespace CalamityMod.NPCs.AquaticScourge
return false;
}
public override bool PreNPCLoot()
{
return false;
}
public override void ScaleExpertStats(int numPlayers, float bossLifeScale)
{
NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * bossLifeScale);
@@ -122,11 +122,6 @@ namespace CalamityMod.NPCs.AquaticScourge
return false;
}
public override bool PreNPCLoot()
{
return false;
}
public override void ScaleExpertStats(int numPlayers, float bossLifeScale)
{
NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * bossLifeScale);
+38 -38
View File
@@ -21,6 +21,8 @@ using Terraria.ID;
using Terraria.ModLoader;
using CalamityMod.Items.Armor.Vanity;
using Terraria.Audio;
using Terraria.GameContent.ItemDropRules;
using System;
namespace CalamityMod.NPCs.AquaticScourge
{
@@ -55,7 +57,6 @@ namespace CalamityMod.NPCs.AquaticScourge
NPC.HitSound = SoundID.NPCHit1;
NPC.DeathSound = SoundID.NPCDeath1;
NPC.netAlways = true;
bossBag = ModContent.ItemType<AquaticScourgeBag>();
if (CalamityWorld.malice || BossRushEvent.BossRushActive)
NPC.scale = 1.25f;
@@ -177,7 +178,7 @@ namespace CalamityMod.NPCs.AquaticScourge
potionType = ModContent.ItemType<SulphurousSand>();
}
public override bool SpecialNPCLoot()
public override bool SpecialOnKill()
{
int closestSegmentID = DropHelper.FindClosestWormSegment(NPC,
ModContent.NPCType<AquaticScourgeHead>(),
@@ -185,49 +186,48 @@ namespace CalamityMod.NPCs.AquaticScourge
ModContent.NPCType<AquaticScourgeBodyAlt>(),
ModContent.NPCType<AquaticScourgeTail>());
NPC.position = Main.npc[closestSegmentID].position;
return false;
return true;
}
public override void NPCLoot()
public override void ModifyNPCLoot(NPCLoot npcLoot)
{
// Boss bag
npcLoot.Add(ItemDropRule.BossBag(ModContent.ItemType<AquaticScourgeBag>()));
// Normal drops: Everything that would otherwise be in the bag
var normalOnly = npcLoot.DefineNormalOnlyDropSet();
{
// Weapons
int[] weapons = new int[]
{
ModContent.ItemType<SubmarineShocker>(),
ModContent.ItemType<Barinautical>(),
ModContent.ItemType<Downpour>(),
ModContent.ItemType<DeepseaStaff>(),
ModContent.ItemType<ScourgeoftheSeas>(),
ModContent.ItemType<CorrosiveSpine>()
};
normalOnly.Add(ItemDropRule.OneFromOptions(DropHelper.NormalWeaponDropRateInt, weapons));
// Vanity
normalOnly.Add(ModContent.ItemType<AquaticScourgeMask>(), 7);
// Fishing
normalOnly.Add(ModContent.ItemType<BleachedAnglingKit>());
}
npcLoot.Add(ItemID.GreaterHealingPotion, 1, 8, 14);
npcLoot.Add(ModContent.ItemType<AquaticScourgeTrophy>(), 10);
npcLoot.AddIf(() => !Main.expertMode, ModContent.ItemType<KnowledgeAquaticScourge>());
npcLoot.AddIf(() => !Main.expertMode, ModContent.ItemType<KnowledgeSulphurSea>());
}
public override void OnKill()
{
CalamityGlobalNPC.SetNewBossJustDowned(NPC);
DropHelper.DropBags(NPC);
DropHelper.DropItem(NPC, ItemID.GreaterHealingPotion, 8, 14);
DropHelper.DropItemChance(NPC, ModContent.ItemType<AquaticScourgeTrophy>(), 10);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<KnowledgeAquaticScourge>(), true, !DownedBossSystem.downedAquaticScourge);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<KnowledgeSulphurSea>(), true, !DownedBossSystem.downedAquaticScourge);
CalamityGlobalNPC.SetNewShopVariable(new int[] { ModContent.NPCType<SEAHOE>() }, DownedBossSystem.downedAquaticScourge);
// All other drops are contained in the bag, so they only drop directly on Normal
if (!Main.expertMode)
{
// Weapons
float w = DropHelper.NormalWeaponDropRateFloat;
DropHelper.DropEntireWeightedSet(NPC,
DropHelper.WeightStack<SubmarineShocker>(w),
DropHelper.WeightStack<Barinautical>(w),
DropHelper.WeightStack<Downpour>(w),
DropHelper.WeightStack<DeepseaStaff>(w),
DropHelper.WeightStack<ScourgeoftheSeas>(w),
DropHelper.WeightStack<CorrosiveSpine>(w)
);
// Equipment
DropHelper.DropItem(NPC, ModContent.ItemType<AquaticEmblem>(), true);
// Vanity
DropHelper.DropItemChance(NPC, ModContent.ItemType<AquaticScourgeMask>(), 7);
// Fishing
DropHelper.DropItem(NPC, ModContent.ItemType<BleachedAnglingKit>());
}
DropHelper.DropItemCondition(NPC, ModContent.ItemType<DeepDiver>(), !Main.expertMode, 0.1f);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<SeasSearing>(), !Main.expertMode, 0.1f);
// If Aquatic Scourge has not yet been killed, notify players of buffed Acid Rain
if (!DownedBossSystem.downedAquaticScourge)
{
@@ -122,11 +122,6 @@ namespace CalamityMod.NPCs.AquaticScourge
return false;
}
public override bool PreNPCLoot()
{
return false;
}
public override void ScaleExpertStats(int numPlayers, float bossLifeScale)
{
NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * bossLifeScale);
-5
View File
@@ -129,11 +129,6 @@ namespace CalamityMod.NPCs.AquaticScourge
return false;
}
public override bool PreNPCLoot()
{
return false;
}
public override void HitEffect(int hitDirection, double damage)
{
for (int k = 0; k < 3; k++)
-5
View File
@@ -129,11 +129,6 @@ namespace CalamityMod.NPCs.AquaticScourge
return false;
}
public override bool PreNPCLoot()
{
return false;
}
public override void HitEffect(int hitDirection, double damage)
{
for (int k = 0; k < 3; k++)
+7 -6
View File
@@ -9,6 +9,7 @@ using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ModLoader;
using Terraria.Audio;
using ReLogic.Content;
namespace CalamityMod.NPCs.Astral
{
@@ -21,7 +22,7 @@ namespace CalamityMod.NPCs.Astral
DisplayName.SetDefault("Aries");
Main.npcFrameCount[NPC.type] = 8;
if (!Main.dedServ)
glowmask = ModContent.Request<Texture2D>("CalamityMod/NPCs/Astral/AriesGlow").Value;
glowmask = ModContent.Request<Texture2D>("CalamityMod/NPCs/Astral/AriesGlow", AssetRequestMode.ImmediateLoad).Value;
}
public override void SetDefaults()
@@ -35,7 +36,7 @@ namespace CalamityMod.NPCs.Astral
NPC.lifeMax = 300;
NPC.knockBackResist = 0.6f;
NPC.value = Item.buyPrice(0, 0, 10, 0);
NPC.DeathSound = Mod.GetLegacySoundSlot(SoundType.NPCKilled, "Sounds/NPCKilled/AstralEnemyDeath");
NPC.DeathSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCKilled/AstralEnemyDeath");
Banner = NPC.type;
BannerItem = ModContent.ItemType<AriesBanner>();
if (DownedBossSystem.downedAstrumAureus)
@@ -120,11 +121,11 @@ namespace CalamityMod.NPCs.Astral
player.AddBuff(ModContent.BuffType<AstralInfectionDebuff>(), 120, true);
}
public override void NPCLoot()
public override void ModifyNPCLoot(NPCLoot npcLoot)
{
DropHelper.DropItemChance(NPC, ModContent.ItemType<Stardust>(), 0.5f, 1, 2);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<Stardust>(), Main.expertMode);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<StellarKnife>(), DownedBossSystem.downedAstrumAureus, 7, 1, 1);
npcLoot.AddIf(() => !Main.expertMode, ModContent.ItemType<Stardust>(), 2, 1, 2);
npcLoot.AddIf(() => Main.expertMode, ModContent.ItemType<Stardust>(), 1, 1, 3);
npcLoot.AddIf(() => DownedBossSystem.downedAstrumAureus, ModContent.ItemType<StellarKnife>(), 7);
}
}
}
+3 -3
View File
@@ -282,10 +282,10 @@ namespace CalamityMod.NPCs.Astral
}
}
public override void NPCLoot()
public override void ModifyNPCLoot(NPCLoot npcLoot)
{
DropHelper.DropItemChance(NPC, ModContent.ItemType<Stardust>(), 0.5f, 1, 2);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<Stardust>(), Main.expertMode);
npcLoot.AddIf(() => !Main.expertMode, ModContent.ItemType<Stardust>(), 2, 1, 2);
npcLoot.AddIf(() => Main.expertMode, ModContent.ItemType<Stardust>(), 1, 1, 3);
}
public override float SpawnChance(NPCSpawnInfo spawnInfo)
+8 -8
View File
@@ -1,4 +1,4 @@
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Dusts;
using CalamityMod.Items.Materials;
using CalamityMod.Items.Placeables.Banners;
@@ -33,7 +33,7 @@ namespace CalamityMod.NPCs.Astral
NPC.alpha = 60;
NPC.HitSound = SoundID.NPCHit1;
NPC.DeathSound = SoundID.NPCDeath1;
animationType = NPCID.BlueSlime;
AnimationType = NPCID.BlueSlime;
Banner = NPC.type;
BannerItem = ModContent.ItemType<AstralSlimeBanner>();
if (DownedBossSystem.downedAstrumAureus)
@@ -79,13 +79,13 @@ namespace CalamityMod.NPCs.Astral
player.AddBuff(ModContent.BuffType<AstralInfectionDebuff>(), 120, true);
}
public override void NPCLoot()
public override void ModifyNPCLoot(NPCLoot npcLoot)
{
DropHelper.DropItemChance(NPC, ModContent.ItemType<Stardust>(), Main.expertMode ? 1 : 2, 1, 3);
int oreMin = Main.expertMode ? 11 : 8;
int oreMax = Main.expertMode ? 16 : 12;
DropHelper.DropItemCondition(NPC, ModContent.ItemType<AstralOre>(), DownedBossSystem.downedAstrumDeus, oreMin, oreMax);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<AbandonedSlimeStaff>(), DownedBossSystem.downedAstrumAureus, 0.05f, 1, 1);
npcLoot.AddIf(() => !Main.expertMode, ModContent.ItemType<Stardust>(), 2, 1, 3);
npcLoot.AddIf(() => Main.expertMode, ModContent.ItemType<Stardust>(), 1, 1, 3);
npcLoot.AddIf(() => DownedBossSystem.downedAstrumAureus, ModContent.ItemType<AbandonedSlimeStaff>(), 7);
npcLoot.AddIf(() => DownedBossSystem.downedAstrumDeus && !Main.expertMode, ModContent.ItemType<AstralOre>(), 1, 8, 12);
npcLoot.AddIf(() => DownedBossSystem.downedAstrumDeus && Main.expertMode, ModContent.ItemType<AstralOre>(), 1, 11, 16);
}
}
}
+10 -7
View File
@@ -11,6 +11,7 @@ using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.Audio;
using ReLogic.Content;
namespace CalamityMod.NPCs.Astral
{
@@ -25,7 +26,7 @@ namespace CalamityMod.NPCs.Astral
Main.npcFrameCount[NPC.type] = 5;
if (!Main.dedServ)
glowmask = ModContent.Request<Texture2D>("CalamityMod/NPCs/Astral/AstralachneaGroundGlow").Value;
glowmask = ModContent.Request<Texture2D>("CalamityMod/NPCs/Astral/AstralachneaGroundGlow", AssetRequestMode.ImmediateLoad).Value;
base.SetStaticDefaults();
}
@@ -39,11 +40,11 @@ namespace CalamityMod.NPCs.Astral
NPC.defense = 20;
NPC.DR_NERD(0.15f);
NPC.lifeMax = 500;
NPC.DeathSound = Mod.GetLegacySoundSlot(SoundType.NPCKilled, "Sounds/NPCKilled/AstralEnemyDeath");
NPC.DeathSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCKilled/AstralEnemyDeath");
NPC.knockBackResist = 0.38f;
NPC.value = Item.buyPrice(0, 0, 20, 0);
NPC.timeLeft = NPC.activeTime * 2;
animationType = NPCID.WallCreeper;
AnimationType = NPCID.WallCreeper;
Banner = NPC.type;
BannerItem = ModContent.ItemType<AstralachneaBanner>();
if (DownedBossSystem.downedAstrumAureus)
@@ -167,11 +168,13 @@ namespace CalamityMod.NPCs.Astral
player.AddBuff(ModContent.BuffType<AstralInfectionDebuff>(), 120, true);
}
public override void NPCLoot()
public static void ModifyAstralachneaLoot(NPCLoot npcLoot)
{
DropHelper.DropItem(NPC, ModContent.ItemType<Stardust>(), 2, 3);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<Stardust>(), Main.expertMode);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<AstralachneaStaff>(), DownedBossSystem.downedAstrumAureus, 7, 1, 1);
npcLoot.AddIf(() => !Main.expertMode, ModContent.ItemType<Stardust>(), 2, 2, 3);
npcLoot.AddIf(() => Main.expertMode, ModContent.ItemType<Stardust>(), 1, 1, 4);
npcLoot.AddIf(() => DownedBossSystem.downedAstrumAureus, ModContent.ItemType<AstralachneaStaff>(), 7);
}
public override void ModifyNPCLoot(NPCLoot npcLoot) => ModifyAstralachneaLoot(npcLoot);
}
}
+5 -9
View File
@@ -11,6 +11,7 @@ using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.Audio;
using ReLogic.Content;
namespace CalamityMod.NPCs.Astral
{
@@ -25,7 +26,7 @@ namespace CalamityMod.NPCs.Astral
Main.npcFrameCount[NPC.type] = 4;
if (!Main.dedServ)
glowmask = ModContent.Request<Texture2D>("CalamityMod/NPCs/Astral/AstralachneaWallGlow").Value;
glowmask = ModContent.Request<Texture2D>("CalamityMod/NPCs/Astral/AstralachneaWallGlow", AssetRequestMode.ImmediateLoad).Value;
base.SetStaticDefaults();
}
@@ -39,12 +40,12 @@ namespace CalamityMod.NPCs.Astral
NPC.defense = 20;
NPC.DR_NERD(0.15f);
NPC.lifeMax = 500;
NPC.DeathSound = Mod.GetLegacySoundSlot(SoundType.NPCKilled, "Sounds/NPCKilled/AstralEnemyDeath");
NPC.DeathSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCKilled/AstralEnemyDeath");
NPC.knockBackResist = 0f;
NPC.noGravity = true;
NPC.value = Item.buyPrice(0, 0, 20, 0);
NPC.timeLeft = NPC.activeTime * 2;
animationType = NPCID.BlackRecluseWall;
AnimationType = NPCID.BlackRecluseWall;
Banner = ModContent.NPCType<AstralachneaGround>();
BannerItem = ModContent.ItemType<AstralachneaBanner>();
if (DownedBossSystem.downedAstrumAureus)
@@ -140,11 +141,6 @@ namespace CalamityMod.NPCs.Astral
player.AddBuff(ModContent.BuffType<AstralInfectionDebuff>(), 120, true);
}
public override void NPCLoot()
{
DropHelper.DropItem(NPC, ModContent.ItemType<Stardust>(), 2, 3);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<Stardust>(), Main.expertMode);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<AstralachneaStaff>(), DownedBossSystem.downedAstrumAureus, 7, 1, 1);
}
public override void ModifyNPCLoot(NPCLoot npcLoot) => AstralachneaGround.ModifyAstralachneaLoot(npcLoot);
}
}
+8 -9
View File
@@ -14,6 +14,7 @@ using Terraria.GameContent;
using Terraria.DataStructures;
using Terraria.ModLoader;
using Terraria.Audio;
using ReLogic.Content;
namespace CalamityMod.NPCs.Astral
{
@@ -99,7 +100,7 @@ namespace CalamityMod.NPCs.Astral
//also it's visuals are messed up on npc spawners etc. because the sheet is 3 wide.
//not much we can do. looks fine in-game so /shrug
if (!Main.dedServ)
glowmask = ModContent.Request<Texture2D>("CalamityMod/NPCs/Astral/AtlasGlow").Value;
glowmask = ModContent.Request<Texture2D>("CalamityMod/NPCs/Astral/AtlasGlow", AssetRequestMode.ImmediateLoad).Value;
}
public override void SetDefaults()
@@ -115,7 +116,7 @@ namespace CalamityMod.NPCs.Astral
NPC.knockBackResist = 0.08f;
NPC.value = Item.buyPrice(0, 1, 0, 0);
NPC.aiStyle = -1;
NPC.DeathSound = Mod.GetLegacySoundSlot(SoundType.NPCKilled, "Sounds/NPCKilled/AtlasDeath");
NPC.DeathSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCKilled/AtlasDeath");
Banner = NPC.type;
BannerItem = ModContent.ItemType<AtlasBanner>();
if (DownedBossSystem.downedAstrumAureus)
@@ -638,14 +639,12 @@ namespace CalamityMod.NPCs.Astral
player.AddBuff(ModContent.BuffType<AstralInfectionDebuff>(), 300, true);
}
public override void NPCLoot()
public override void ModifyNPCLoot(NPCLoot npcLoot)
{
int minStardust = Main.expertMode ? 7 : 6;
int maxStardust = Main.expertMode ? 9 : 8;
DropHelper.DropItem(NPC, ModContent.ItemType<Stardust>(), minStardust, maxStardust);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<TitanArm>(), DownedBossSystem.downedAstrumAureus, 7, 1, 1);
DropHelper.DropItem(NPC, ModContent.ItemType<TitanHeart>());
npcLoot.Add(ModContent.ItemType<TitanHeart>());
npcLoot.AddIf(() => !Main.expertMode, ModContent.ItemType<Stardust>(), 1, 6, 8);
npcLoot.AddIf(() => Main.expertMode, ModContent.ItemType<Stardust>(), 1, 7, 9);
npcLoot.AddIf(() => DownedBossSystem.downedAstrumAureus, ModContent.ItemType<TitanArm>(), 7);
}
}
}
+10 -11
View File
@@ -10,6 +10,7 @@ using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.Audio;
using ReLogic.Content;
namespace CalamityMod.NPCs.Astral
{
@@ -22,7 +23,7 @@ namespace CalamityMod.NPCs.Astral
DisplayName.SetDefault("Big Sightseer");
Main.npcFrameCount[NPC.type] = 4;
if (!Main.dedServ)
glowmask = ModContent.Request<Texture2D>("CalamityMod/NPCs/Astral/BigSightseerGlow").Value;
glowmask = ModContent.Request<Texture2D>("CalamityMod/NPCs/Astral/BigSightseerGlow", AssetRequestMode.ImmediateLoad).Value;
}
public override void SetDefaults()
@@ -33,7 +34,7 @@ namespace CalamityMod.NPCs.Astral
NPC.defense = 20;
NPC.DR_NERD(0.15f);
NPC.lifeMax = 430;
NPC.DeathSound = Mod.GetLegacySoundSlot(SoundType.NPCKilled, "Sounds/NPCKilled/AstralEnemyDeath");
NPC.DeathSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCKilled/AstralEnemyDeath");
NPC.noGravity = true;
NPC.knockBackResist = 0.8f;
NPC.value = Item.buyPrice(0, 0, 20, 0);
@@ -168,10 +169,10 @@ namespace CalamityMod.NPCs.Astral
player.AddBuff(ModContent.BuffType<AstralInfectionDebuff>(), 120, true);
}
public override void NPCLoot()
public override void ModifyNPCLoot(NPCLoot npcLoot)
{
DropHelper.DropItem(NPC, ModContent.ItemType<Stardust>(), 2, 3);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<Stardust>(), Main.expertMode);
npcLoot.AddIf(() => !Main.expertMode, ModContent.ItemType<Stardust>(), 2, 2, 3);
npcLoot.AddIf(() => Main.expertMode, ModContent.ItemType<Stardust>(), 1, 1, 4);
}
}
@@ -211,8 +212,8 @@ namespace CalamityMod.NPCs.Astral
float pulse = (float)Math.Sin(NPC.ai[0]);
float radius = 5.8f;
Vector2 offset = angle.ToRotationVector2() * pulse * radius;
Dust pink = Dust.NewDustPerfect(NPC.Center + offset, ModContent.DustType<AstralOrange>(), Vector2.Zero);
Dust blue = Dust.NewDustPerfect(NPC.Center - offset, ModContent.DustType<AstralBlue>(), Vector2.Zero);
Dust.NewDustPerfect(NPC.Center + offset, ModContent.DustType<AstralOrange>(), Vector2.Zero);
Dust.NewDustPerfect(NPC.Center - offset, ModContent.DustType<AstralBlue>(), Vector2.Zero);
//kill on tile collide
if (Collision.SolidCollision(NPC.position, NPC.width, NPC.height))
@@ -237,11 +238,9 @@ namespace CalamityMod.NPCs.Astral
}
}
//On death
public override bool PreNPCLoot()
public override void HitEffect(int hitDirection, double damage)
{
DoKillDust();
return false;
}
public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
@@ -264,7 +263,7 @@ namespace CalamityMod.NPCs.Astral
Vector2 vel = (angle + Main.rand.NextFloat(-0.04f, 0.04f)).ToRotationVector2();
int dustType = Main.rand.NextBool(2) ? ModContent.DustType<AstralOrange>() : ModContent.DustType<AstralBlue>();
Dust d = Dust.NewDustPerfect(NPC.Center, dustType, vel * Main.rand.NextFloat(1.8f, 2.2f));
d.customData = npc;
d.customData = NPC;
angle += rotPerIter;
}
+4 -3
View File
@@ -11,6 +11,7 @@ using Terraria.GameContent;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.Audio;
using ReLogic.Content;
namespace CalamityMod.NPCs.Astral
{
@@ -22,7 +23,7 @@ namespace CalamityMod.NPCs.Astral
{
DisplayName.SetDefault("Fusion Feeder");
if (!Main.dedServ)
glowmask = ModContent.Request<Texture2D>("CalamityMod/NPCs/Astral/FusionFeederGlow").Value;
glowmask = ModContent.Request<Texture2D>("CalamityMod/NPCs/Astral/FusionFeederGlow", AssetRequestMode.ImmediateLoad).Value;
Main.npcFrameCount[NPC.type] = 4;
}
@@ -39,8 +40,8 @@ namespace CalamityMod.NPCs.Astral
NPC.value = Item.buyPrice(0, 0, 20, 0);
NPC.knockBackResist = 0.8f;
NPC.behindTiles = true;
NPC.DeathSound = Mod.GetLegacySoundSlot(SoundType.NPCKilled, "Sounds/NPCKilled/AstralEnemyDeath");
animationType = NPCID.SandShark;
NPC.DeathSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCKilled/AstralEnemyDeath");
AnimationType = NPCID.SandShark;
Banner = NPC.type;
BannerItem = ModContent.ItemType<FusionFeederBanner>();
if (DownedBossSystem.downedAstrumAureus)
+9 -8
View File
@@ -12,6 +12,7 @@ using Terraria.GameContent;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.Audio;
using ReLogic.Content;
namespace CalamityMod.NPCs.Astral
{
@@ -23,7 +24,7 @@ namespace CalamityMod.NPCs.Astral
{
DisplayName.SetDefault("Hadarian");
if (!Main.dedServ)
glowmask = ModContent.Request<Texture2D>("CalamityMod/NPCs/Astral/HadarianGlow").Value;
glowmask = ModContent.Request<Texture2D>("CalamityMod/NPCs/Astral/HadarianGlow", AssetRequestMode.ImmediateLoad).Value;
Main.npcFrameCount[NPC.type] = 7;
}
@@ -36,7 +37,7 @@ namespace CalamityMod.NPCs.Astral
NPC.defense = 8;
NPC.DR_NERD(0.15f);
NPC.lifeMax = 330;
NPC.DeathSound = Mod.GetLegacySoundSlot(SoundType.NPCKilled, "Sounds/NPCKilled/AstralEnemyDeath");
NPC.DeathSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCKilled/AstralEnemyDeath");
NPC.knockBackResist = 0.75f;
NPC.value = Item.buyPrice(0, 0, 15, 0);
Banner = NPC.type;
@@ -188,12 +189,12 @@ namespace CalamityMod.NPCs.Astral
public override float SpawnChance(NPCSpawnInfo spawnInfo)
{
Tile tile = Main.tile[spawnInfo.spawnTileX, spawnInfo.spawnTileY];
Tile tile = Main.tile[spawnInfo.SpawnTileX, spawnInfo.SpawnTileY];
if (CalamityGlobalNPC.AnyEvents(spawnInfo.Player))
{
return 0f;
}
else if (spawnInfo.Player.InAstral(3) && spawnInfo.spawnTileType == ModContent.TileType<AstralSand>() && tile.WallType == WallID.None)
else if (spawnInfo.Player.InAstral(3) && spawnInfo.SpawnTileType == ModContent.TileType<AstralSand>() && tile.WallType == WallID.None)
{
return 0.25f;
}
@@ -205,11 +206,11 @@ namespace CalamityMod.NPCs.Astral
player.AddBuff(ModContent.BuffType<AstralInfectionDebuff>(), 120, true);
}
public override void NPCLoot()
public override void ModifyNPCLoot(NPCLoot npcLoot)
{
DropHelper.DropItem(NPC, ModContent.ItemType<Stardust>(), 2, 3);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<Stardust>(), Main.expertMode);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<HadarianMembrane>(), DownedBossSystem.downedAstrumAureus, 2, 2, 3);
npcLoot.AddIf(() => !Main.expertMode, ModContent.ItemType<Stardust>(), 2, 1, 3);
npcLoot.AddIf(() => Main.expertMode, ModContent.ItemType<Stardust>(), 1, 1, 4);
npcLoot.AddIf(() => DownedBossSystem.downedAstrumAureus, ModContent.ItemType<HadarianMembrane>(), 2, 2, 3);
}
}
}
+7 -6
View File
@@ -10,6 +10,7 @@ using System;
using Terraria;
using Terraria.ModLoader;
using Terraria.Audio;
using ReLogic.Content;
namespace CalamityMod.NPCs.Astral
{
@@ -21,7 +22,7 @@ namespace CalamityMod.NPCs.Astral
{
DisplayName.SetDefault("Hive");
if (!Main.dedServ)
glowmask = ModContent.Request<Texture2D>("CalamityMod/NPCs/Astral/HiveGlow").Value;
glowmask = ModContent.Request<Texture2D>("CalamityMod/NPCs/Astral/HiveGlow", AssetRequestMode.ImmediateLoad).Value;
Main.npcFrameCount[NPC.type] = 6;
}
@@ -34,7 +35,7 @@ namespace CalamityMod.NPCs.Astral
NPC.defense = 15;
NPC.DR_NERD(0.15f);
NPC.lifeMax = 470;
NPC.DeathSound = Mod.GetLegacySoundSlot(SoundType.NPCKilled, "Sounds/NPCKilled/AstralEnemyDeath");
NPC.DeathSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCKilled/AstralEnemyDeath");
NPC.knockBackResist = 0f;
NPC.value = Item.buyPrice(0, 0, 15, 0);
Banner = NPC.type;
@@ -139,11 +140,11 @@ namespace CalamityMod.NPCs.Astral
player.AddBuff(ModContent.BuffType<AstralInfectionDebuff>(), 120, true);
}
public override void NPCLoot()
public override void ModifyNPCLoot(NPCLoot npcLoot)
{
DropHelper.DropItem(NPC, ModContent.ItemType<Stardust>(), 2, 3);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<Stardust>(), Main.expertMode);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<HivePod>(), DownedBossSystem.downedAstrumAureus, 7, 1, 1);
npcLoot.AddIf(() => !Main.expertMode, ModContent.ItemType<Stardust>(), 2, 1, 3);
npcLoot.AddIf(() => Main.expertMode, ModContent.ItemType<Stardust>(), 1, 1, 4);
npcLoot.AddIf(() => DownedBossSystem.downedAstrumAureus, ModContent.ItemType<HivePod>(), 7);
}
}
}
+3 -2
View File
@@ -7,6 +7,7 @@ using System;
using Terraria;
using Terraria.ModLoader;
using Terraria.Audio;
using ReLogic.Content;
namespace CalamityMod.NPCs.Astral
{
@@ -18,7 +19,7 @@ namespace CalamityMod.NPCs.Astral
{
DisplayName.SetDefault("Hiveling");
if (!Main.dedServ)
glowmask = ModContent.Request<Texture2D>("CalamityMod/NPCs/Astral/HivelingGlow").Value;
glowmask = ModContent.Request<Texture2D>("CalamityMod/NPCs/Astral/HivelingGlow", AssetRequestMode.ImmediateLoad).Value;
Main.npcFrameCount[NPC.type] = 4;
}
@@ -30,7 +31,7 @@ namespace CalamityMod.NPCs.Astral
NPC.damage = 30;
NPC.defense = 0;
NPC.lifeMax = 150;
NPC.DeathSound = Mod.GetLegacySoundSlot(SoundType.NPCKilled, "Sounds/NPCKilled/AstralEnemyDeath");
NPC.DeathSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCKilled/AstralEnemyDeath");
NPC.knockBackResist = 0.5f;
NPC.noGravity = true;
NPC.value = Item.buyPrice(0, 0, 5, 0);
+8 -7
View File
@@ -12,6 +12,7 @@ using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.Audio;
using ReLogic.Content;
namespace CalamityMod.NPCs.Astral
{
@@ -24,7 +25,7 @@ namespace CalamityMod.NPCs.Astral
DisplayName.SetDefault("Mantis");
Main.npcFrameCount[NPC.type] = 14;
if (!Main.dedServ)
glowmask = ModContent.Request<Texture2D>("CalamityMod/NPCs/Astral/MantisGlow").Value;
glowmask = ModContent.Request<Texture2D>("CalamityMod/NPCs/Astral/MantisGlow", AssetRequestMode.ImmediateLoad).Value;
}
public override void SetDefaults()
@@ -39,7 +40,7 @@ namespace CalamityMod.NPCs.Astral
NPC.lifeMax = 340;
NPC.knockBackResist = 0.2f;
NPC.value = Item.buyPrice(0, 0, 15, 0);
NPC.DeathSound = Mod.GetLegacySoundSlot(SoundType.NPCKilled, "Sounds/NPCKilled/AstralEnemyDeath");
NPC.DeathSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCKilled/AstralEnemyDeath");
Banner = NPC.type;
BannerItem = ModContent.ItemType<MantisBanner>();
if (DownedBossSystem.downedAstrumAureus)
@@ -119,7 +120,7 @@ namespace CalamityMod.NPCs.Astral
Vector2 vector = Main.player[NPC.target].Center - NPC.Center;
vector.Normalize();
int damage = DownedBossSystem.downedAstrumAureus ? 55 : 45;
Projectile.NewProjectile(NPC.Center + (NPC.Center.X < target.Center.X ? -14f : 14f) * Vector2.UnitX, vector * 7f, ModContent.ProjectileType<MantisRing>(), damage, 0f);
Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center + (NPC.Center.X < target.Center.X ? -14f : 14f) * Vector2.UnitX, vector * 7f, ModContent.ProjectileType<MantisRing>(), damage, 0f);
}
}
@@ -236,11 +237,11 @@ namespace CalamityMod.NPCs.Astral
player.AddBuff(ModContent.BuffType<AstralInfectionDebuff>(), 120, true);
}
public override void NPCLoot()
public override void ModifyNPCLoot(NPCLoot npcLoot)
{
DropHelper.DropItem(NPC, ModContent.ItemType<Stardust>(), 2, 3);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<Stardust>(), Main.expertMode);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<AstralScythe>(), DownedBossSystem.downedAstrumAureus, 7, 1, 1);
npcLoot.AddIf(() => !Main.expertMode, ModContent.ItemType<Stardust>(), 2, 1, 2);
npcLoot.AddIf(() => Main.expertMode, ModContent.ItemType<Stardust>(), 1, 1, 3);
npcLoot.AddIf(() => DownedBossSystem.downedAstrumAureus, ModContent.ItemType<AstralScythe>(), 7);
}
}
}
+9 -13
View File
@@ -13,6 +13,7 @@ using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.Audio;
using ReLogic.Content;
namespace CalamityMod.NPCs.Astral
{
@@ -32,7 +33,7 @@ namespace CalamityMod.NPCs.Astral
Main.npcFrameCount[NPC.type] = 8;
if (!Main.dedServ)
glowmask = ModContent.Request<Texture2D>("CalamityMod/NPCs/Astral/NovaGlow").Value;
glowmask = ModContent.Request<Texture2D>("CalamityMod/NPCs/Astral/NovaGlow", AssetRequestMode.ImmediateLoad).Value;
}
public override void SetDefaults()
@@ -43,7 +44,7 @@ namespace CalamityMod.NPCs.Astral
NPC.defense = 15;
NPC.DR_NERD(0.15f);
NPC.lifeMax = 230;
NPC.DeathSound = Mod.GetLegacySoundSlot(SoundType.NPCKilled, "Sounds/NPCKilled/AstralEnemyDeath");
NPC.DeathSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCKilled/AstralEnemyDeath");
NPC.noGravity = true;
NPC.knockBackResist = 0.5f;
NPC.value = Item.buyPrice(0, 0, 20, 0);
@@ -196,7 +197,7 @@ namespace CalamityMod.NPCs.Astral
//other things
NPC.ai[3] = -20000f;
NPC.value = 0f;
NPC.extraValue = 0f;
NPC.extraValue = 0;
NPC.StrikeNPCNoInteraction(9999, 1f, 1);
int size = 30;
@@ -256,9 +257,12 @@ namespace CalamityMod.NPCs.Astral
}
}
public override bool PreNPCLoot()
public override void ModifyNPCLoot(NPCLoot npcLoot)
{
return NPC.ai[3] > -10000;
npcLoot.AddIf(() => NPC.ai[3] <= -10000f && !Main.expertMode, ModContent.ItemType<Stardust>(), 1, 2, 3);
npcLoot.AddIf(() => NPC.ai[3] <= -10000f && Main.expertMode, ModContent.ItemType<Stardust>(), 1, 3, 4);
npcLoot.AddIf(() => NPC.ai[3] <= -10000f, ModContent.ItemType<StellarCannon>(), 7);
npcLoot.AddIf(() => NPC.ai[3] <= -10000f, ModContent.ItemType<GloriousEnd>(), 7);
}
public override void PostDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
@@ -283,13 +287,5 @@ namespace CalamityMod.NPCs.Astral
{
player.AddBuff(ModContent.BuffType<AstralInfectionDebuff>(), 120, true);
}
public override void NPCLoot()
{
DropHelper.DropItem(NPC, ModContent.ItemType<Stardust>(), 2, 3);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<Stardust>(), Main.expertMode);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<StellarCannon>(), DownedBossSystem.downedAstrumAureus, 7, 1, 1);
DropHelper.DropItemChance(NPC, ModContent.ItemType<GloriousEnd>(), 7, 1, 1);
}
}
}
+6 -5
View File
@@ -10,6 +10,7 @@ using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.Audio;
using ReLogic.Content;
namespace CalamityMod.NPCs.Astral
{
@@ -23,7 +24,7 @@ namespace CalamityMod.NPCs.Astral
Main.npcFrameCount[NPC.type] = 4;
if (!Main.dedServ)
glowmask = ModContent.Request<Texture2D>("CalamityMod/NPCs/Astral/SmallSightseerGlow").Value;
glowmask = ModContent.Request<Texture2D>("CalamityMod/NPCs/Astral/SmallSightseerGlow", AssetRequestMode.ImmediateLoad).Value;
}
public override void SetDefaults()
@@ -34,7 +35,7 @@ namespace CalamityMod.NPCs.Astral
NPC.defense = 16;
NPC.DR_NERD(0.15f);
NPC.lifeMax = 310;
NPC.DeathSound = Mod.GetLegacySoundSlot(SoundType.NPCKilled, "Sounds/NPCKilled/AstralEnemyDeath");
NPC.DeathSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCKilled/AstralEnemyDeath");
NPC.noGravity = true;
NPC.knockBackResist = 0.58f;
NPC.value = Item.buyPrice(0, 0, 10, 0);
@@ -136,10 +137,10 @@ namespace CalamityMod.NPCs.Astral
player.AddBuff(ModContent.BuffType<AstralInfectionDebuff>(), 60, true);
}
public override void NPCLoot()
public override void ModifyNPCLoot(NPCLoot npcLoot)
{
DropHelper.DropItemChance(NPC, ModContent.ItemType<Stardust>(), 0.5f, 1, 2);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<Stardust>(), Main.expertMode);
npcLoot.AddIf(() => !Main.expertMode, ModContent.ItemType<Stardust>(), 2, 1, 2);
npcLoot.AddIf(() => Main.expertMode, ModContent.ItemType<Stardust>(), 1, 1, 3);
}
}
}
+8 -7
View File
@@ -11,6 +11,7 @@ using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.Audio;
using ReLogic.Content;
namespace CalamityMod.NPCs.Astral
{
@@ -22,7 +23,7 @@ namespace CalamityMod.NPCs.Astral
{
DisplayName.SetDefault("Stellar Culex");
if (!Main.dedServ)
glowmask = ModContent.Request<Texture2D>("CalamityMod/NPCs/Astral/StellarCulexGlow").Value;
glowmask = ModContent.Request<Texture2D>("CalamityMod/NPCs/Astral/StellarCulexGlow", AssetRequestMode.ImmediateLoad).Value;
Main.npcFrameCount[NPC.type] = 4;
}
@@ -38,8 +39,8 @@ namespace CalamityMod.NPCs.Astral
NPC.knockBackResist = 0.65f;
NPC.lifeMax = 210;
NPC.value = Item.buyPrice(0, 0, 10, 0);
NPC.DeathSound = Mod.GetLegacySoundSlot(SoundType.NPCKilled, "Sounds/NPCKilled/AstralEnemyDeath");
animationType = NPCID.GiantFlyingFox;
NPC.DeathSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCKilled/AstralEnemyDeath");
AnimationType = NPCID.GiantFlyingFox;
Banner = NPC.type;
BannerItem = ModContent.ItemType<StellarCulexBanner>();
if (DownedBossSystem.downedAstrumAureus)
@@ -122,11 +123,11 @@ namespace CalamityMod.NPCs.Astral
player.AddBuff(ModContent.BuffType<AstralInfectionDebuff>(), 120, true);
}
public override void NPCLoot()
public override void ModifyNPCLoot(NPCLoot npcLoot)
{
DropHelper.DropItemChance(NPC, ModContent.ItemType<Stardust>(), 0.5f, 1, 2);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<Stardust>(), Main.expertMode);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<StarbusterCore>(), DownedBossSystem.downedAstrumAureus, 7, 1, 1);
npcLoot.AddIf(() => !Main.expertMode, ModContent.ItemType<Stardust>(), 2, 1, 2);
npcLoot.AddIf(() => Main.expertMode, ModContent.ItemType<Stardust>(), 1, 1, 3);
npcLoot.AddIf(() => DownedBossSystem.downedAstrumAureus, ModContent.ItemType<StarbusterCore>(), 7);
}
}
}
+41 -44
View File
@@ -24,6 +24,7 @@ using Terraria.GameContent;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.Audio;
using Terraria.GameContent.ItemDropRules;
namespace CalamityMod.NPCs.AstrumAureus
{
@@ -57,8 +58,7 @@ namespace CalamityMod.NPCs.AstrumAureus
NPC.value = Item.buyPrice(0, 60, 0, 0);
NPC.boss = true;
NPC.DeathSound = SoundID.NPCDeath14;
music = CalamityMod.Instance.GetMusicFromMusicMod("AstrumAureus") ?? MusicID.Boss3;
bossBag = ModContent.ItemType<AstrageldonBag>();
Music = CalamityMod.Instance.GetMusicFromMusicMod("AstrumAureus") ?? MusicID.Boss3;
double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01;
NPC.lifeMax += (int)(NPC.lifeMax * HPBoost);
NPC.Calamity().VulnerableToHeat = true;
@@ -311,53 +311,47 @@ namespace CalamityMod.NPCs.AstrumAureus
potionType = ItemID.GreaterHealingPotion;
}
public override void NPCLoot()
public override void ModifyNPCLoot(NPCLoot npcLoot)
{
// Boss bag
npcLoot.Add(ItemDropRule.BossBag(ModContent.ItemType<AstrageldonBag>()));
// Normal drops: Everything that would otherwise be in the bag
var normalOnly = npcLoot.DefineNormalOnlyDropSet();
{
// Weapons
int[] weapons = new int[]
{
ModContent.ItemType<Nebulash>(),
ModContent.ItemType<AuroraBlazer>(),
ModContent.ItemType<AlulaAustralis>(),
ModContent.ItemType<BorealisBomber>(),
ModContent.ItemType<AuroradicalThrow>(),
};
normalOnly.Add(ItemDropRule.OneFromOptions(DropHelper.NormalWeaponDropRateInt, weapons));
// Equipment
normalOnly.Add(ModContent.ItemType<AureusMask>(), 7);
// Other
normalOnly.Add(ModContent.ItemType<AstralJelly>(), 1, 9, 12);
}
npcLoot.AddIf(() => !Main.expertMode, ModContent.ItemType<LeonidProgenitor>(), 10);
npcLoot.Add(ModContent.ItemType<AstrageldonTrophy>(), 10);
npcLoot.AddIf(() => !DownedBossSystem.downedAstrumAureus, ModContent.ItemType<KnowledgeAstrumAureus>());
// Other
npcLoot.Add(ItemID.HallowedKey, 3);
}
public override void OnKill()
{
CalamityGlobalNPC.SetNewBossJustDowned(NPC);
DropHelper.DropBags(NPC);
DropHelper.DropItemChance(NPC, ModContent.ItemType<AstrageldonTrophy>(), 10);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<KnowledgeAstrumAureus>(), true, !DownedBossSystem.downedAstrumAureus);
CalamityGlobalNPC.SetNewShopVariable(new int[] { NPCID.Wizard, ModContent.NPCType<FAP>() }, DownedBossSystem.downedAstrumAureus);
// All other drops are contained in the bag, so they only drop directly on Normal
if (!Main.expertMode)
{
// Materials
DropHelper.DropItemSpray(NPC, ModContent.ItemType<Stardust>(), 20, 30, 2);
DropHelper.DropItemSpray(NPC, ItemID.FallenStar, 18, 24, 2);
// Weapons
float w = DropHelper.NormalWeaponDropRateFloat;
DropHelper.DropEntireWeightedSet(NPC,
DropHelper.WeightStack<Nebulash>(w),
DropHelper.WeightStack<AuroraBlazer>(w),
DropHelper.WeightStack<AlulaAustralis>(w),
DropHelper.WeightStack<BorealisBomber>(w),
DropHelper.WeightStack<AuroradicalThrow>(w)
);
// Equipment
DropHelper.DropItem(NPC, ModContent.ItemType<GravistarSabaton>(), true);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<SquishyBeanMount>(), NPC.downedMoonlord);
// Vanity
DropHelper.DropItemChance(NPC, ModContent.ItemType<AureusMask>(), 7);
// Other
DropHelper.DropItem(NPC, ModContent.ItemType<AstralJelly>(), 9, 12);
}
DropHelper.DropItemCondition(NPC, ModContent.ItemType<LeonidProgenitor>(), !Main.expertMode, 0.1f);
// Other
DropHelper.DropItemChance(NPC, ItemID.HallowedKey, 3);
// Drop an Astral Meteor if applicable
ThreadPool.QueueUserWorkItem(_ => AstralBiome.PlaceAstralMeteor());
// If Astrum Aureus has not yet been killed, notify players of new Astral enemy drops
if (!DownedBossSystem.downedAstrumAureus)
{
@@ -369,6 +363,9 @@ namespace CalamityMod.NPCs.AstrumAureus
CalamityUtils.DisplayLocalizedText(key2, messageColor);
}
// Drop an Astral Meteor if applicable
ThreadPool.QueueUserWorkItem(_ => AstralBiome.PlaceAstralMeteor());
// Mark Astrum Aureus as dead
DownedBossSystem.downedAstrumAureus = true;
CalamityNetcode.SyncWorld();
+1 -3
View File
@@ -173,7 +173,7 @@ namespace CalamityMod.NPCs.AstrumAureus
num7 *= num8;
int type = ModContent.ProjectileType<AstralFlame>();
int damage = NPC.GetProjectileDamage(type);
Projectile.NewProjectile(NPC.Center.X, NPC.Center.Y, num6, num7, type, damage, 0f, Main.myPlayer);
Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center.X, NPC.Center.Y, num6, num7, type, damage, 0f, Main.myPlayer);
}
}
}
@@ -360,8 +360,6 @@ namespace CalamityMod.NPCs.AstrumAureus
player.AddBuff(ModContent.BuffType<AstralInfectionDebuff>(), 120, true);
}
public override bool PreNPCLoot() => false;
public override bool CheckDead()
{
SoundEngine.PlaySound(SoundID.Item, (int)NPC.position.X, (int)NPC.position.Y, 14);
+2 -7
View File
@@ -50,10 +50,10 @@ namespace CalamityMod.NPCs.AstrumDeus
NPC.noTileCollide = true;
NPC.canGhostHeal = false;
NPC.HitSound = SoundID.NPCHit4;
NPC.DeathSound = Mod.GetLegacySoundSlot(SoundType.NPCKilled, "Sounds/NPCKilled/AstrumDeusDeath");
NPC.DeathSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCKilled/AstrumDeusDeath");
NPC.netAlways = true;
NPC.boss = true;
music = CalamityMod.Instance.GetMusicFromMusicMod("AstrumDeus") ?? MusicID.Boss3;
Music = CalamityMod.Instance.GetMusicFromMusicMod("AstrumDeus") ?? MusicID.Boss3;
NPC.dontCountMe = true;
NPC.Calamity().VulnerableToHeat = true;
NPC.Calamity().VulnerableToSickness = false;
@@ -177,11 +177,6 @@ namespace CalamityMod.NPCs.AstrumDeus
return false;
}
public override bool PreNPCLoot()
{
return false;
}
public override void HitEffect(int hitDirection, double damage)
{
if (NPC.life <= 0)
+54 -55
View File
@@ -21,6 +21,7 @@ using Terraria;
using Terraria.GameContent;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.GameContent.ItemDropRules;
namespace CalamityMod.NPCs.AstrumDeus
{
@@ -65,10 +66,9 @@ namespace CalamityMod.NPCs.AstrumDeus
NPC.noGravity = true;
NPC.noTileCollide = true;
NPC.HitSound = SoundID.NPCHit4;
NPC.DeathSound = Mod.GetLegacySoundSlot(SoundType.NPCKilled, "Sounds/NPCKilled/AstrumDeusDeath");
NPC.DeathSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCKilled/AstrumDeusDeath");
NPC.netAlways = true;
music = CalamityMod.Instance.GetMusicFromMusicMod("AstrumDeus") ?? MusicID.Boss3;
bossBag = ModContent.ItemType<AstrumDeusBag>();
Music = CalamityMod.Instance.GetMusicFromMusicMod("AstrumDeus") ?? MusicID.Boss3;
NPC.Calamity().VulnerableToHeat = true;
NPC.Calamity().VulnerableToSickness = false;
}
@@ -207,10 +207,12 @@ namespace CalamityMod.NPCs.AstrumDeus
public override void BossLoot(ref string name, ref int potionType) => potionType = ModContent.ItemType<Stardust>();
public override bool SpecialNPCLoot()
public bool ShouldNotDropThings() => NPC.Calamity().newAI[0] == 0f || ((CalamityWorld.death || BossRushEvent.BossRushActive) && NPC.Calamity().newAI[0] != 3f);
public override bool SpecialOnKill()
{
if (NPC.Calamity().newAI[0] == 0f || ((CalamityWorld.death || BossRushEvent.BossRushActive) && NPC.Calamity().newAI[0] != 3f))
return false;
if (ShouldNotDropThings())
return true;
int closestSegmentID = DropHelper.FindClosestWormSegment(NPC,
ModContent.NPCType<AstrumDeusHeadSpectral>(),
@@ -218,14 +220,13 @@ namespace CalamityMod.NPCs.AstrumDeus
ModContent.NPCType<AstrumDeusTailSpectral>());
NPC.position = Main.npc[closestSegmentID].position;
return false;
return true;
}
public override bool PreNPCLoot()
public override void OnKill()
{
// Unsplit Deus does not drop anything when killed/despawned.
if (NPC.Calamity().newAI[0] == 0f || ((CalamityWorld.death || BossRushEvent.BossRushActive) && NPC.Calamity().newAI[0] != 3f))
return false;
if (ShouldNotDropThings())
return;
// Killing ANY split Deus makes all other Deus heads die immediately.
for (int i = 0; i < Main.maxNPCs; ++i)
@@ -241,52 +242,8 @@ namespace CalamityMod.NPCs.AstrumDeus
}
}
return true;
}
public override void NPCLoot()
{
CalamityGlobalNPC.SetNewBossJustDowned(NPC);
DropHelper.DropBags(NPC);
DropHelper.DropItem(NPC, ItemID.GreaterHealingPotion, 8, 14);
DropHelper.DropItemChance(NPC, ModContent.ItemType<AstrumDeusTrophy>(), 10);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<KnowledgeAstrumDeus>(), !DownedBossSystem.downedAstrumDeus);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<KnowledgeAstralInfection>(), !DownedBossSystem.downedAstrumDeus);
// Drop a large spray of all 4 lunar fragments
int minFragments = Main.expertMode ? 20 : 16;
int maxFragments = Main.expertMode ? 32 : 24;
DropHelper.DropItemSpray(NPC, ItemID.FragmentSolar, minFragments, maxFragments, 4);
DropHelper.DropItemSpray(NPC, ItemID.FragmentVortex, minFragments, maxFragments, 4);
DropHelper.DropItemSpray(NPC, ItemID.FragmentNebula, minFragments, maxFragments, 4);
DropHelper.DropItemSpray(NPC, ItemID.FragmentStardust, minFragments, maxFragments, 4);
// All other drops are contained in the bag, so they only drop directly on Normal
if (!Main.expertMode)
{
DropHelper.DropItemSpray(NPC, ModContent.ItemType<Stardust>(), 50, 80, 5);
DropHelper.DropItemSpray(NPC, ItemID.FallenStar, 25, 40, 5);
// Weapons
float w = DropHelper.NormalWeaponDropRateFloat;
DropHelper.DropEntireWeightedSet(NPC,
DropHelper.WeightStack<TheMicrowave>(w),
DropHelper.WeightStack<StarSputter>(w),
DropHelper.WeightStack<Starfall>(w),
DropHelper.WeightStack<GodspawnHelixStaff>(w),
DropHelper.WeightStack<RegulusRiot>(w)
);
// Equipment
DropHelper.DropItem(NPC, ModContent.ItemType<HideofAstrumDeus>(), true);
DropHelper.DropItemChance(NPC, ModContent.ItemType<ChromaticOrb>(), 5);
// Vanity
DropHelper.DropItemChance(NPC, ModContent.ItemType<AstrumDeusMask>(), 7);
}
// Notify players that Astral Ore can be mined if Deus has never been killed yet
if (!DownedBossSystem.downedAstrumDeus)
{
@@ -300,6 +257,48 @@ namespace CalamityMod.NPCs.AstrumDeus
CalamityNetcode.SyncWorld();
}
public override void ModifyNPCLoot(NPCLoot npcLoot)
{
npcLoot.Add(ItemDropRule.BossBag(ModContent.ItemType<AstrumDeusBag>()));
// Normal drops: Everything that would otherwise be in the bag
var normalOnly = npcLoot.DefineNormalOnlyDropSet();
{
// Weapons
int[] weapons = new int[]
{
ModContent.ItemType<TheMicrowave>(),
ModContent.ItemType<StarSputter>(),
ModContent.ItemType<Starfall>(),
ModContent.ItemType<GodspawnHelixStaff>(),
ModContent.ItemType<RegulusRiot>(),
};
normalOnly.Add(ItemDropRule.OneFromOptions(DropHelper.NormalWeaponDropRateInt, weapons));
// Equipment
normalOnly.Add(ModContent.ItemType<AureusMask>(), 7);
normalOnly.Add(ModContent.ItemType<HideofAstrumDeus>());
normalOnly.Add(ModContent.ItemType<ChromaticOrb>(), 5);
// Materials
normalOnly.Add(ItemID.FallenStar, 25, 40);
normalOnly.Add(ModContent.ItemType<Stardust>(), 50, 80);
}
npcLoot.Add(ItemID.GreaterHealingPotion, 1, 8, 14);
npcLoot.Add(ModContent.ItemType<AstrumDeusTrophy>(), 5);
npcLoot.AddIf(() => !DownedBossSystem.downedAstrumDeus, ModContent.ItemType<KnowledgeAstrumDeus>());
npcLoot.AddIf(() => !DownedBossSystem.downedAstrumDeus, ModContent.ItemType<KnowledgeAstralInfection>());
npcLoot.AddIf(() => !Main.expertMode, ItemID.FragmentSolar, 16, 24);
npcLoot.AddIf(() => !Main.expertMode, ItemID.FragmentVortex, 16, 24);
npcLoot.AddIf(() => !Main.expertMode, ItemID.FragmentNebula, 16, 24);
npcLoot.AddIf(() => !Main.expertMode, ItemID.FragmentStardust, 16, 24);
npcLoot.AddIf(() => Main.expertMode, ItemID.FragmentSolar, 20, 32);
npcLoot.AddIf(() => Main.expertMode, ItemID.FragmentVortex, 20, 32);
npcLoot.AddIf(() => Main.expertMode, ItemID.FragmentNebula, 20, 32);
npcLoot.AddIf(() => Main.expertMode, ItemID.FragmentStardust, 20, 32);
}
public override void OnHitPlayer(Player player, int damage, bool crit)
{
player.AddBuff(ModContent.BuffType<AstralInfectionDebuff>(), 240, true);
+2 -7
View File
@@ -50,10 +50,10 @@ namespace CalamityMod.NPCs.AstrumDeus
NPC.noTileCollide = true;
NPC.canGhostHeal = false;
NPC.HitSound = SoundID.NPCHit4;
NPC.DeathSound = Mod.GetLegacySoundSlot(SoundType.NPCKilled, "Sounds/NPCKilled/AstrumDeusDeath");
NPC.DeathSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCKilled/AstrumDeusDeath");
NPC.netAlways = true;
NPC.boss = true;
music = CalamityMod.Instance.GetMusicFromMusicMod("AstrumDeus") ?? MusicID.Boss3;
Music = CalamityMod.Instance.GetMusicFromMusicMod("AstrumDeus") ?? MusicID.Boss3;
NPC.dontCountMe = true;
NPC.Calamity().VulnerableToHeat = true;
NPC.Calamity().VulnerableToSickness = false;
@@ -189,11 +189,6 @@ namespace CalamityMod.NPCs.AstrumDeus
return false;
}
public override bool PreNPCLoot()
{
return false;
}
public override void OnHitPlayer(Player player, int damage, bool crit)
{
player.AddBuff(ModContent.BuffType<AstralInfectionDebuff>(), 120, true);
+3 -3
View File
@@ -121,7 +121,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental
num7 *= num8;
int type = ModContent.ProjectileType<BrimstoneHellfireball>();
int damage = NPC.GetProjectileDamage(type);
Projectile.NewProjectile(NPC.Center.X, NPC.Center.Y, num6, num7, type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, Main.player[NPC.target].Center.X, Main.player[NPC.target].Center.Y);
Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center.X, NPC.Center.Y, num6, num7, type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, Main.player[NPC.target].Center.X, Main.player[NPC.target].Center.Y);
}
if (vector251.Length() > 400f || !flag104)
{
@@ -246,13 +246,13 @@ namespace CalamityMod.NPCs.BrimstoneElemental
}
}
public override void NPCLoot()
public override void OnKill()
{
if (!CalamityWorld.revenge)
{
int closestPlayer = Player.FindClosest(NPC.Center, 1, 1);
if (Main.rand.Next(4) == 0 && Main.player[closestPlayer].statLife < Main.player[closestPlayer].statLifeMax2)
Item.NewItem((int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart);
Item.NewItem(NPC.GetItemSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart);
}
}
+42 -38
View File
@@ -16,6 +16,7 @@ using CalamityMod.World;
using Microsoft.Xna.Framework;
using System.IO;
using Terraria;
using Terraria.GameContent.ItemDropRules;
using Terraria.ID;
using Terraria.ModLoader;
@@ -58,8 +59,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental
NPC.netAlways = true;
NPC.HitSound = SoundID.NPCHit23;
NPC.DeathSound = SoundID.NPCDeath39;
music = CalamityMod.Instance.GetMusicFromMusicMod("BrimstoneElemental") ?? MusicID.Boss4;
bossBag = ModContent.ItemType<BrimstoneWaifuBag>();
Music = CalamityMod.Instance.GetMusicFromMusicMod("BrimstoneElemental") ?? MusicID.Boss4;
NPC.Calamity().VulnerableToHeat = false;
NPC.Calamity().VulnerableToCold = true;
NPC.Calamity().VulnerableToWater = true;
@@ -149,47 +149,51 @@ namespace CalamityMod.NPCs.BrimstoneElemental
potionType = ItemID.GreaterHealingPotion;
}
public override void NPCLoot()
public override void ModifyNPCLoot(NPCLoot npcLoot)
{
npcLoot.Add(ItemDropRule.BossBag(ModContent.ItemType<BrimstoneWaifuBag>()));
npcLoot.Add(ModContent.ItemType<BrimstoneElementalTrophy>(), 10);
npcLoot.AddIf(() => DownedBossSystem.downedBrimstoneElemental, ModContent.ItemType<KnowledgeBrimstoneElemental>());
// Normal drops: Everything that would otherwise be in the bag
var normalOnly = npcLoot.DefineNormalOnlyDropSet();
{
// Weapons
int[] weapons = new int[]
{
ModContent.ItemType<Brimlance>(),
ModContent.ItemType<SeethingDischarge>(),
ModContent.ItemType<DormantBrimseeker>(),
ModContent.ItemType<RoseStone>(),
};
normalOnly.Add(ItemDropRule.OneFromOptions(DropHelper.NormalWeaponDropRateInt, weapons));
// Materials
normalOnly.Add(ModContent.ItemType<EssenceofChaos>(), 1, 4, 8);
// Equipment
normalOnly.Add(ModContent.ItemType<Gehenna>());
normalOnly.Add(ModContent.ItemType<Abaddon>());
normalOnly.Add(ModContent.ItemType<Gehenna>());
// Vanity
normalOnly.Add(ModContent.ItemType<BrimstoneWaifuMask>(), 7);
}
npcLoot.AddIf(() => !Main.expertMode, ModContent.ItemType<FabledTortoiseShell>(), 10);
npcLoot.AddIf(() => !Main.expertMode, ModContent.ItemType<Hellborn>(), 10);
npcLoot.AddIf(() => !Main.expertMode && DownedBossSystem.downedProvidence, ModContent.ItemType<Brimrose>());
npcLoot.AddIf(() => !Main.expertMode && DownedBossSystem.downedProvidence, ModContent.ItemType<Bloodstone>(), 1, 20, 30);
}
public override void OnKill()
{
CalamityGlobalNPC.SetNewBossJustDowned(NPC);
DropHelper.DropBags(NPC);
DropHelper.DropItemChance(NPC, ModContent.ItemType<BrimstoneElementalTrophy>(), 10);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<KnowledgeBrimstoneCrag>(), true, !DownedBossSystem.downedBrimstoneElemental);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<KnowledgeBrimstoneElemental>(), true, !DownedBossSystem.downedBrimstoneElemental);
CalamityGlobalNPC.SetNewShopVariable(new int[] { NPCID.Wizard }, DownedBossSystem.downedBrimstoneElemental);
if (!Main.expertMode)
{
//Materials
DropHelper.DropItemSpray(NPC, ModContent.ItemType<EssenceofChaos>(), 4, 8);
if (DownedBossSystem.downedProvidence)
DropHelper.DropItemSpray(NPC, ModContent.ItemType<Bloodstone>(), 20, 30, 2);
// Weapons
float w = DropHelper.NormalWeaponDropRateFloat;
DropHelper.DropEntireWeightedSet(NPC,
DropHelper.WeightStack<Brimlance>(w),
DropHelper.WeightStack<SeethingDischarge>(w),
DropHelper.WeightStack<DormantBrimseeker>(w),
DropHelper.WeightStack<RoseStone>(w)
);
// Equipment
DropHelper.DropItem(NPC, ModContent.ItemType<Gehenna>(), true);
DropHelper.DropItem(NPC, ModContent.ItemType<Abaddon>(), true);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<Brimrose>(), DownedBossSystem.downedProvidence);
// Vanity
DropHelper.DropItemChance(NPC, ModContent.ItemType<BrimstoneWaifuMask>(), 7);
}
DropHelper.DropItemCondition(NPC, ModContent.ItemType<FabledTortoiseShell>(), !Main.expertMode, 0.1f);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<Hellborn>(), !Main.expertMode, 0.1f);
// mark brimmy as dead
// Mark brimmy as dead
DownedBossSystem.downedBrimstoneElemental = true;
CalamityNetcode.SyncWorld();
}
+28 -24
View File
@@ -17,6 +17,7 @@ using System;
using System.IO;
using Terraria;
using Terraria.GameContent;
using Terraria.GameContent.ItemDropRules;
using Terraria.ID;
using Terraria.ModLoader;
@@ -52,13 +53,12 @@ namespace CalamityMod.NPCs.Bumblebirb
NPC.knockBackResist = 0f;
NPC.boss = true;
NPC.noTileCollide = true;
music = CalamityMod.Instance.GetMusicFromMusicMod("Dragonfolly") ?? MusicID.Boss4;
Music = CalamityMod.Instance.GetMusicFromMusicMod("Dragonfolly") ?? MusicID.Boss4;
NPC.lavaImmune = true;
NPC.noGravity = true;
NPC.value = Item.buyPrice(1, 25, 0, 0);
NPC.HitSound = SoundID.NPCHit51;
NPC.DeathSound = SoundID.NPCDeath46;
bossBag = ModContent.ItemType<BumblebirbBag>();
NPC.Calamity().VulnerableToHeat = true;
NPC.Calamity().VulnerableToCold = true;
NPC.Calamity().VulnerableToSickness = true;
@@ -391,42 +391,46 @@ namespace CalamityMod.NPCs.Bumblebirb
potionType = ModContent.ItemType<SupremeHealingPotion>();
}
public override void NPCLoot()
public override void ModifyNPCLoot(NPCLoot npcLoot)
{
CalamityGlobalNPC.SetNewBossJustDowned(NPC);
npcLoot.Add(ModContent.ItemType<BumblebirbBag>());
npcLoot.Add(ModContent.ItemType<BumblebirbTrophy>(), 10);
npcLoot.AddIf(() => !DownedBossSystem.downedDragonfolly, ModContent.ItemType<KnowledgeBumblebirb>());
DropHelper.DropBags(NPC);
DropHelper.DropItemChance(NPC, ModContent.ItemType<BumblebirbTrophy>(), 10);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<KnowledgeBumblebirb>(), true, !DownedBossSystem.downedDragonfolly);
// All other drops are contained in the bag, so they only drop directly on Normal
if (!Main.expertMode)
// Normal drops: Everything that would otherwise be in the bag
var normalOnly = npcLoot.DefineNormalOnlyDropSet();
{
// Materials
DropHelper.DropItemSpray(NPC, ModContent.ItemType<EffulgentFeather>(), 11, 17);
// Weapons
float w = DropHelper.NormalWeaponDropRateFloat;
DropHelper.DropEntireWeightedSet(NPC,
DropHelper.WeightStack<GildedProboscis>(w),
DropHelper.WeightStack<GoldenEagle>(w),
DropHelper.WeightStack<RougeSlash>(w),
DropHelper.WeightStack<BirdSeed>(w)
);
int[] weapons = new int[]
{
ModContent.ItemType<GildedProboscis>(),
ModContent.ItemType<GoldenEagle>(),
ModContent.ItemType<RougeSlash>(),
ModContent.ItemType<BirdSeed>(),
};
normalOnly.Add(ItemDropRule.OneFromOptions(DropHelper.NormalWeaponDropRateInt, weapons));
// Materials
normalOnly.Add(ModContent.ItemType<EffulgentFeather>(), 1, 11, 17);
// Equipment
DropHelper.DropItem(NPC, ModContent.ItemType<DynamoStemCells>(), true);
normalOnly.Add(ModContent.ItemType<DynamoStemCells>());
// Vanity
DropHelper.DropItemChance(NPC, ModContent.ItemType<BumblefuckMask>(), 7);
normalOnly.Add(ModContent.ItemType<BumblefuckMask>(), 7);
}
DropHelper.DropItemCondition(NPC, ModContent.ItemType<Swordsplosion>(), !Main.expertMode, 0.1f);
npcLoot.AddIf(() => !Main.expertMode, ModContent.ItemType<Swordsplosion>(), 10);
}
public override void OnKill()
{
CalamityGlobalNPC.SetNewBossJustDowned(NPC);
// Mark The Dragonfolly as dead
DownedBossSystem.downedDragonfolly = true;
CalamityNetcode.SyncWorld();
}
public override void ScaleExpertStats(int numPlayers, float bossLifeScale)
+2 -3
View File
@@ -56,15 +56,14 @@ namespace CalamityMod.NPCs.Bumblebirb
CalamityAI.Bumblebirb2AI(NPC, Mod, true);
}
public override bool PreNPCLoot()
public override void OnKill()
{
if (!CalamityWorld.revenge)
{
int closestPlayer = Player.FindClosest(NPC.Center, 1, 1);
if (Main.rand.Next(4) == 0 && Main.player[closestPlayer].statLife < Main.player[closestPlayer].statLifeMax2)
Item.NewItem((int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart);
Item.NewItem(NPC.GetItemSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart);
}
return false;
}
public override void FindFrame(int frameHeight)
+9 -6
View File
@@ -53,7 +53,7 @@ namespace CalamityMod.NPCs.Calamitas
NPC.noTileCollide = true;
NPC.HitSound = SoundID.NPCHit4;
NPC.DeathSound = SoundID.NPCDeath14;
music = CalamityMod.Instance.GetMusicFromMusicMod("Calamitas") ?? MusicID.Boss2;
Music = CalamityMod.Instance.GetMusicFromMusicMod("Calamitas") ?? MusicID.Boss2;
NPC.Calamity().VulnerableToHeat = false;
NPC.Calamity().VulnerableToCold = true;
NPC.Calamity().VulnerableToWater = true;
@@ -143,18 +143,21 @@ namespace CalamityMod.NPCs.Calamitas
return NPC.Calamity().newAI[0] == 1f;
}
public override void NPCLoot()
public override void OnKill()
{
if (!CalamityWorld.revenge)
{
int heartAmt = Main.rand.Next(3) + 3;
for (int i = 0; i < heartAmt; i++)
Item.NewItem((int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart);
Item.NewItem(NPC.GetItemSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart);
}
}
DropHelper.DropItemChance(NPC, ModContent.ItemType<CataclysmTrophy>(), 10);
DropHelper.DropItemChance(NPC, ModContent.ItemType<BrimstoneFlamesprayer>(), Main.expertMode ? 4 : 5);
DropHelper.DropItemChance(NPC, ModContent.ItemType<BrimstoneFlameblaster>(), Main.expertMode ? 4 : 5);
public override void ModifyNPCLoot(NPCLoot npcLoot)
{
npcLoot.Add(ModContent.ItemType<CataclysmTrophy>(), 10);
npcLoot.Add(ModContent.ItemType<BrimstoneFlamesprayer>(), 4);
npcLoot.Add(ModContent.ItemType<BrimstoneFlameblaster>(), 4);
}
public override void HitEffect(int hitDirection, double damage)
+8 -5
View File
@@ -53,7 +53,7 @@ namespace CalamityMod.NPCs.Calamitas
NPC.noTileCollide = true;
NPC.HitSound = SoundID.NPCHit4;
NPC.DeathSound = SoundID.NPCDeath14;
music = CalamityMod.Instance.GetMusicFromMusicMod("Calamitas") ?? MusicID.Boss2;
Music = CalamityMod.Instance.GetMusicFromMusicMod("Calamitas") ?? MusicID.Boss2;
NPC.Calamity().VulnerableToHeat = false;
NPC.Calamity().VulnerableToCold = true;
NPC.Calamity().VulnerableToWater = true;
@@ -143,17 +143,20 @@ namespace CalamityMod.NPCs.Calamitas
return NPC.Calamity().newAI[0] == 1f;
}
public override void NPCLoot()
public override void OnKill()
{
if (!CalamityWorld.revenge)
{
int heartAmt = Main.rand.Next(3) + 3;
for (int i = 0; i < heartAmt; i++)
Item.NewItem((int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart);
Item.NewItem(NPC.GetItemSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart);
}
}
DropHelper.DropItemChance(NPC, ModContent.ItemType<CatastropheTrophy>(), 10);
DropHelper.DropItemChance(NPC, ModContent.ItemType<CrushsawCrasher>(), Main.expertMode ? 4 : 5);
public override void ModifyNPCLoot(NPCLoot npcLoot)
{
npcLoot.Add(ModContent.ItemType<CatastropheTrophy>(), 10);
npcLoot.Add(ModContent.ItemType<CrushsawCrasher>(), 4);
}
public override void HitEffect(int hitDirection, double damage)
+42 -41
View File
@@ -21,6 +21,7 @@ using Terraria.GameContent;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.Audio;
using Terraria.GameContent.ItemDropRules;
namespace CalamityMod.NPCs.Calamitas
{
@@ -66,8 +67,7 @@ namespace CalamityMod.NPCs.Calamitas
NPC.noTileCollide = true;
NPC.HitSound = SoundID.NPCHit4;
NPC.DeathSound = SoundID.NPCDeath14;
music = CalamityMod.Instance.GetMusicFromMusicMod("Calamitas") ?? MusicID.Boss2;
bossBag = ModContent.ItemType<CalamitasBag>();
Music = CalamityMod.Instance.GetMusicFromMusicMod("Calamitas") ?? MusicID.Boss2;
NPC.Calamity().VulnerableToHeat = false;
NPC.Calamity().VulnerableToCold = true;
NPC.Calamity().VulnerableToWater = true;
@@ -162,50 +162,51 @@ namespace CalamityMod.NPCs.Calamitas
return false;
}
public override void NPCLoot()
public override void ModifyNPCLoot(NPCLoot npcLoot)
{
npcLoot.Add(ItemDropRule.BossBag(ModContent.ItemType<CalamitasBag>()));
npcLoot.Add(ItemID.BrokenHeroSword);
npcLoot.Add(ModContent.ItemType<BrimstoneElementalTrophy>(), 10);
npcLoot.AddIf(() => DownedBossSystem.downedCalamitas, ModContent.ItemType<KnowledgeCalamitasClone>());
// Normal drops: Everything that would otherwise be in the bag
var normalOnly = npcLoot.DefineNormalOnlyDropSet();
{
// Weapons
int[] weapons = new int[]
{
ModContent.ItemType<TheEyeofCalamitas>(),
ModContent.ItemType<Animosity>(),
ModContent.ItemType<CalamitasInferno>(),
ModContent.ItemType<BlightedEyeStaff>(),
ModContent.ItemType<ChaosStone>(),
};
normalOnly.Add(ItemDropRule.OneFromOptions(DropHelper.NormalWeaponDropRateInt, weapons));
// Equipment
normalOnly.Add(ModContent.ItemType<CalamityRing>());
// Materials
normalOnly.Add(ModContent.ItemType<EssenceofChaos>(), 1, 4, 8);
normalOnly.Add(ModContent.ItemType<CalamityDust>(), 1, 9, 14);
normalOnly.Add(ModContent.ItemType<BlightedLens>(), 1, 1, 2);
// Vanity
normalOnly.Add(ModContent.ItemType<CalamitasMask>(), 7);
normalOnly.Add(ItemDropRule.Common(ModContent.ItemType<CalamityHood>(), 10).OnSuccess(ItemDropRule.Common(ModContent.ItemType<CalamityRobes>())));
}
npcLoot.AddIf(() => !Main.expertMode, ModContent.ItemType<Regenator>(), 10);
npcLoot.AddIf(() => !Main.expertMode && DownedBossSystem.downedProvidence, ModContent.ItemType<Bloodstone>(), 1, 30, 40);
}
public override void OnKill()
{
CalamityGlobalNPC.SetNewBossJustDowned(NPC);
DropHelper.DropBags(NPC);
DropHelper.DropItem(NPC, ItemID.BrokenHeroSword, true);
DropHelper.DropItemChance(NPC, ModContent.ItemType<CalamitasTrophy>(), 10);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<KnowledgeCalamitasClone>(), !DownedBossSystem.downedCalamitas);
CalamityGlobalNPC.SetNewShopVariable(new int[] { ModContent.NPCType<THIEF>() }, DownedBossSystem.downedCalamitas);
if (!Main.expertMode)
{
//Materials
DropHelper.DropItemSpray(NPC, ModContent.ItemType<EssenceofChaos>(), 4, 8);
DropHelper.DropItem(NPC, ModContent.ItemType<CalamityDust>(), 9, 14);
DropHelper.DropItem(NPC, ModContent.ItemType<BlightedLens>(), 1, 2);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<Bloodstone>(), DownedBossSystem.downedProvidence, 1f, 30, 40);
// Weapons
float w = DropHelper.NormalWeaponDropRateFloat;
DropHelper.DropEntireWeightedSet(NPC,
DropHelper.WeightStack<TheEyeofCalamitas>(w),
DropHelper.WeightStack<Animosity>(w),
DropHelper.WeightStack<CalamitasInferno>(w),
DropHelper.WeightStack<BlightedEyeStaff>(w),
DropHelper.WeightStack<ChaosStone>(w)
);
// Equipment
DropHelper.DropItem(NPC, ModContent.ItemType<CalamityRing>(), true);
// Vanity
DropHelper.DropItemChance(NPC, ModContent.ItemType<CalamitasMask>(), 7);
if (Main.rand.NextBool(10))
{
DropHelper.DropItem(NPC, ModContent.ItemType<CalamityHood>());
DropHelper.DropItem(NPC, ModContent.ItemType<CalamityRobes>());
}
}
DropHelper.DropItemCondition(NPC, ModContent.ItemType<Regenator>(), !Main.expertMode, 0.1f);
// Abyss awakens after killing Calamitas
string key = "Mods.CalamityMod.PlantBossText";
Color messageColor = Color.RoyalBlue;
+3 -3
View File
@@ -98,7 +98,7 @@ namespace CalamityMod.NPCs.Calamitas
int type = ModContent.ProjectileType<BrimstoneBarrage>();
int damage = NPC.GetProjectileDamage(type);
Projectile.NewProjectile(NPC.Center, velocity, type, damage, 1f, NPC.target, 1f, 0f);
Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, velocity, type, damage, 1f, NPC.target, 1f, 0f);
}
timer = 0;
}
@@ -150,13 +150,13 @@ namespace CalamityMod.NPCs.Calamitas
}
}
public override void NPCLoot()
public override void OnKill()
{
if (!CalamityWorld.revenge)
{
int closestPlayer = Player.FindClosest(NPC.Center, 1, 1);
if (Main.rand.Next(4) == 0 && Main.player[closestPlayer].statLife < Main.player[closestPlayer].statLifeMax2)
Item.NewItem((int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart);
Item.NewItem(NPC.GetItemSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart);
}
}
+39 -33
View File
@@ -17,6 +17,7 @@ using Terraria.ID;
using Terraria.ModLoader;
using System.IO;
using Terraria.Audio;
using Terraria.GameContent.ItemDropRules;
namespace CalamityMod.NPCs.CeaselessVoid
{
@@ -63,7 +64,6 @@ namespace CalamityMod.NPCs.CeaselessVoid
NPC.noTileCollide = true;
NPC.boss = true;
NPC.DeathSound = SoundID.NPCDeath14;
bossBag = ModContent.ItemType<CeaselessVoidBag>();
NPC.Calamity().VulnerableToSickness = false;
}
@@ -178,42 +178,17 @@ namespace CalamityMod.NPCs.CeaselessVoid
return false;
}
public override void NPCLoot()
public static bool AtFullStrength() => !DownedBossSystem.downedCeaselessVoid || CalamityWorld.DoGSecondStageCountdown <= 0;
public static bool LastSentinelKilled() => !DownedBossSystem.downedCeaselessVoid && DownedBossSystem.downedStormWeaver && DownedBossSystem.downedSignus;
public override void OnKill()
{
// Only drop items if fought at full strength
bool fullStrength = !DownedBossSystem.downedCeaselessVoid || CalamityWorld.DoGSecondStageCountdown <= 0;
bool fullStrength = AtFullStrength();
if (fullStrength)
{
CalamityGlobalNPC.SetNewBossJustDowned(NPC);
DropHelper.DropBags(NPC);
DropHelper.DropItemChance(NPC, ModContent.ItemType<CeaselessVoidTrophy>(), 10);
bool lastSentinelKilled = !DownedBossSystem.downedCeaselessVoid && DownedBossSystem.downedStormWeaver && DownedBossSystem.downedSignus;
DropHelper.DropItemCondition(NPC, ModContent.ItemType<KnowledgeSentinels>(), true, lastSentinelKilled);
if (!Main.expertMode)
{
// Materials
DropHelper.DropItem(NPC, ModContent.ItemType<DarkPlasma>(), true, 2, 3);
// Weapons
float dropChance = DropHelper.NormalWeaponDropRateFloat;
DropHelper.DropItemChance(NPC, ModContent.ItemType<MirrorBlade>(), dropChance);
DropHelper.DropItemChance(NPC, ModContent.ItemType<VoidConcentrationStaff>(), dropChance);
// Equipment
DropHelper.DropItem(NPC, ModContent.ItemType<TheEvolution>(), true);
// Vanity
DropHelper.DropItemChance(NPC, ModContent.ItemType<CeaselessVoidMask>(), 7);
if (Main.rand.NextBool(20))
{
DropHelper.DropItem(NPC, ModContent.ItemType<AncientGodSlayerHelm>());
DropHelper.DropItem(NPC, ModContent.ItemType<AncientGodSlayerChestplate>());
DropHelper.DropItem(NPC, ModContent.ItemType<AncientGodSlayerLeggings>());
}
}
}
// If DoG's fight is active, set the timer for the remaining two sentinels
@@ -237,6 +212,37 @@ namespace CalamityMod.NPCs.CeaselessVoid
}
}
public override void ModifyNPCLoot(NPCLoot npcLoot)
{
npcLoot.Add(ItemDropRule.BossBagByCondition(DropHelper.If(AtFullStrength), ModContent.ItemType<CeaselessVoidBag>()));
npcLoot.AddIf(AtFullStrength, ModContent.ItemType<CeaselessVoidTrophy>(), 10);
npcLoot.AddIf(LastSentinelKilled, ModContent.ItemType<KnowledgeSentinels>());
// Normal drops: Everything that would otherwise be in the bag
var normalOnly = npcLoot.DefineNormalOnlyDropSet();
{
// Weapons
int[] weapons = new int[]
{
ModContent.ItemType<MirrorBlade>(),
ModContent.ItemType<VoidConcentrationStaff>(),
};
normalOnly.Add(ItemDropRule.OneFromOptions(DropHelper.NormalWeaponDropRateInt, weapons));
// Materials
normalOnly.Add(ModContent.ItemType<DarkPlasma>(), 1, 2, 3);
// Equipment
normalOnly.Add(ModContent.ItemType<TheEvolution>());
// Vanity
normalOnly.Add(ModContent.ItemType<CeaselessVoidMask>(), 7);
normalOnly.Add(ItemDropRule.Common(ModContent.ItemType<AncientGodSlayerHelm>(), 20).
OnSuccess(ItemDropRule.Common(ModContent.ItemType<AncientGodSlayerChestplate>())).
OnSuccess(ItemDropRule.Common(ModContent.ItemType<AncientGodSlayerLeggings>())));
}
}
public override void ScaleExpertStats(int numPlayers, float bossLifeScale)
{
NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * bossLifeScale);
+23 -24
View File
@@ -20,6 +20,8 @@ using Terraria.GameContent;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.Audio;
using Terraria.GameContent.ItemDropRules;
namespace CalamityMod.NPCs.Crabulon
{
[AutoloadBossHead]
@@ -55,7 +57,6 @@ namespace CalamityMod.NPCs.Crabulon
NPC.value = Item.buyPrice(0, 10, 0, 0);
NPC.HitSound = SoundID.NPCHit45;
NPC.DeathSound = SoundID.NPCDeath1;
bossBag = ModContent.ItemType<CrabulonBag>();
NPC.Calamity().VulnerableToHeat = true;
NPC.Calamity().VulnerableToCold = true;
NPC.Calamity().VulnerableToSickness = true;
@@ -717,38 +718,36 @@ namespace CalamityMod.NPCs.Crabulon
return false;
}
public override void NPCLoot()
public override void ModifyNPCLoot(NPCLoot npcLoot)
{
CalamityGlobalNPC.SetNewBossJustDowned(NPC);
npcLoot.Add(ItemDropRule.BossBag(ModContent.ItemType<CrabulonBag>()));
npcLoot.AddIf(() => !DownedBossSystem.downedCrabulon, ModContent.ItemType<KnowledgeCrabulon>());
DropHelper.DropBags(NPC);
DropHelper.DropItemChance(NPC, ModContent.ItemType<CrabulonTrophy>(), 10);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<KnowledgeCrabulon>(), true, !DownedBossSystem.downedCrabulon);
// All other drops are contained in the bag, so they only drop directly on Normal
if (!Main.expertMode)
// Normal drops: Everything that would otherwise be in the bag
var normalOnly = npcLoot.DefineNormalOnlyDropSet();
{
// Materials
DropHelper.DropItem(NPC, ItemID.GlowingMushroom, 20, 30);
DropHelper.DropItem(NPC, ItemID.MushroomGrassSeeds, 3, 6);
// Weapons
float w = DropHelper.NormalWeaponDropRateFloat;
DropHelper.DropEntireWeightedSet(NPC,
DropHelper.WeightStack<MycelialClaws>(w),
DropHelper.WeightStack<Fungicide>(w),
DropHelper.WeightStack<HyphaeRod>(w),
DropHelper.WeightStack<Mycoroot>(w),
DropHelper.WeightStack<Shroomerang>(w)
);
int[] weapons = new int[]
{
ModContent.ItemType<MycelialClaws>(),
ModContent.ItemType<Fungicide>(),
ModContent.ItemType<HyphaeRod>(),
ModContent.ItemType<Mycoroot>(),
ModContent.ItemType<Shroomerang>(),
};
normalOnly.Add(ItemDropRule.OneFromOptions(DropHelper.NormalWeaponDropRateInt, weapons));
// Equipment
DropHelper.DropItem(NPC, ModContent.ItemType<FungalClump>(), true);
normalOnly.Add(ModContent.ItemType<FungalClump>());
// Vanity
DropHelper.DropItemChance(NPC, ModContent.ItemType<CrabulonMask>(), 7);
normalOnly.Add(ModContent.ItemType<CrabulonMask>(), 7);
}
}
public override void OnKill()
{
CalamityGlobalNPC.SetNewBossJustDowned(NPC);
// Mark Crabulon as dead
DownedBossSystem.downedCrabulon = true;
+7 -7
View File
@@ -1,4 +1,4 @@
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Items.Materials;
using CalamityMod.Items.Placeables.Banners;
using CalamityMod.World;
@@ -26,7 +26,7 @@ namespace CalamityMod.NPCs.Crags
NPC.defense = 12;
NPC.lifeMax = 140;
NPC.knockBackResist = 0f;
animationType = NPCID.DemonEye;
AnimationType = NPCID.DemonEye;
NPC.value = Item.buyPrice(0, 0, 5, 0);
NPC.HitSound = SoundID.NPCHit1;
NPC.DeathSound = SoundID.NPCDeath1;
@@ -121,12 +121,12 @@ namespace CalamityMod.NPCs.Crags
player.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 120, true);
}
public override void NPCLoot()
public override void ModifyNPCLoot(NPCLoot npcLoot)
{
DropHelper.DropItemCondition(NPC, ModContent.ItemType<Bloodstone>(), DownedBossSystem.downedProvidence, 2, 1, 1);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<EssenceofChaos>(), Main.hardMode, 3, 1, 1);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<BlightedLens>(), Main.hardMode, 2, 1, 1);
DropHelper.DropItemChance(NPC, ItemID.Lens, 2);
npcLoot.Add(ItemID.Lens, 2);
npcLoot.AddIf(() => Main.hardMode, ModContent.ItemType<BlightedLens>(), 2);
npcLoot.AddIf(() => Main.hardMode, ModContent.ItemType<EssenceofChaos>(), 3);
npcLoot.AddIf(() => DownedBossSystem.downedProvidence, ModContent.ItemType<Bloodstone>(), 2);
}
}
}
+6 -6
View File
@@ -1,4 +1,4 @@
using CalamityMod.World;
using CalamityMod.World;
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Dusts;
using CalamityMod.Items.Placeables.Banners;
@@ -27,7 +27,7 @@ namespace CalamityMod.NPCs.Crags
NPC.defense = 10;
NPC.lifeMax = 250;
NPC.knockBackResist = 0f;
animationType = NPCID.CorruptSlime;
AnimationType = NPCID.CorruptSlime;
NPC.value = Item.buyPrice(0, 0, 5, 0);
NPC.alpha = 50;
NPC.lavaImmune = true;
@@ -77,11 +77,11 @@ namespace CalamityMod.NPCs.Crags
}
}
public override void NPCLoot()
public override void ModifyNPCLoot(NPCLoot npcLoot)
{
DropHelper.DropItem(NPC, ModContent.ItemType<CharredOre>(), 10, 26);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<Bloodstone>(), DownedBossSystem.downedProvidence, 2, 1, 1);
DropHelper.DropItemChance(NPC, ModContent.ItemType<EssenceofChaos>(), 3, 1, 1);
npcLoot.Add(ModContent.ItemType<CharredOre>(), 1, 10, 26);
npcLoot.AddIf(() => Main.hardMode, ModContent.ItemType<EssenceofChaos>(), 3);
npcLoot.AddIf(() => DownedBossSystem.downedProvidence, ModContent.ItemType<Bloodstone>(), 2);
}
}
}
+3 -3
View File
@@ -75,10 +75,10 @@ namespace CalamityMod.NPCs.Crags
}
}
public override void NPCLoot()
public override void ModifyNPCLoot(NPCLoot npcLoot)
{
DropHelper.DropItemCondition(NPC, ModContent.ItemType<Bloodstone>(), DownedBossSystem.downedProvidence, 2, 1, 1);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<EssenceofChaos>(), Main.hardMode, 3, 1, 1);
npcLoot.AddIf(() => Main.hardMode, ModContent.ItemType<EssenceofChaos>(), 3);
npcLoot.AddIf(() => DownedBossSystem.downedProvidence, ModContent.ItemType<Bloodstone>(), 2);
}
}
}
+3 -3
View File
@@ -54,10 +54,10 @@ namespace CalamityMod.NPCs.Crags
return spawnInfo.Player.Calamity().ZoneCalamity ? 0.25f : 0f;
}
public override void NPCLoot()
public override void ModifyNPCLoot(NPCLoot npcLoot)
{
DropHelper.DropItemCondition(NPC, ModContent.ItemType<Bloodstone>(), DownedBossSystem.downedProvidence, 2, 1, 1);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<EssenceofChaos>(), Main.hardMode, 3, 1, 1);
npcLoot.AddIf(() => Main.hardMode, ModContent.ItemType<EssenceofChaos>(), 3);
npcLoot.AddIf(() => DownedBossSystem.downedProvidence, ModContent.ItemType<Bloodstone>(), 2);
}
public override void OnHitPlayer(Player player, int damage, bool crit)
+3 -3
View File
@@ -1,4 +1,4 @@
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Dusts;
using CalamityMod.Items.Materials;
using CalamityMod.Items.Placeables.Banners;
@@ -90,9 +90,9 @@ namespace CalamityMod.NPCs.Crags
}
}
public override void NPCLoot()
public override void ModifyNPCLoot(NPCLoot npcLoot)
{
DropHelper.DropItemCondition(NPC, ModContent.ItemType<EssenceofChaos>(), Main.hardMode, 4, 1, 1);
npcLoot.AddIf(() => Main.hardMode, ModContent.ItemType<EssenceofChaos>(), 4);
}
}
}
+4 -12
View File
@@ -108,10 +108,6 @@ namespace CalamityMod.NPCs.Crags
int num285 = 3;
for (int num308 = num284; num308 < num284 + num285; num308++)
{
if (Main.tile[num283, num308] == null)
{
Main.tile[num283, num308] = new Tile();
}
if ((Main.tile[num283, num308].HasUnactuatedTile && Main.tileSolid[(int)Main.tile[num283, num308].TileType]) || Main.tile[num283, num308].LiquidAmount > 0)
{
flag23 = false;
@@ -123,10 +119,6 @@ namespace CalamityMod.NPCs.Crags
bool flag25 = false;
for (int num309 = num284; num309 < num284 + num285 - 2; num309++)
{
if (Main.tile[num283, num309] == null)
{
Main.tile[num283, num309] = new Tile();
}
if ((Main.tile[num283, num309].HasUnactuatedTile && Main.tileSolid[(int)Main.tile[num283, num309].TileType]) || Main.tile[num283, num309].LiquidAmount > 0)
{
flag25 = true;
@@ -255,11 +247,11 @@ namespace CalamityMod.NPCs.Crags
return spawnInfo.Player.Calamity().ZoneCalamity ? 0.25f : 0f;
}
public override void NPCLoot()
public override void ModifyNPCLoot(NPCLoot npcLoot)
{
DropHelper.DropItemCondition(NPC, ModContent.ItemType<LanternoftheSoul>(), DownedBossSystem.downedProvidence, 20, 1, 1);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<Bloodstone>(), DownedBossSystem.downedProvidence, 2, 1, 1);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<EssenceofChaos>(), Main.hardMode, 3, 1, 1);
npcLoot.AddIf(() => Main.hardMode, ModContent.ItemType<EssenceofChaos>(), 3);
npcLoot.AddIf(() => DownedBossSystem.downedProvidence, ModContent.ItemType<Bloodstone>(), 2);
npcLoot.AddIf(() => DownedBossSystem.downedProvidence, ModContent.ItemType<LanternoftheSoul>(), 20);
}
public override void OnHitPlayer(Player player, int damage, bool crit)
+4 -12
View File
@@ -108,10 +108,6 @@ namespace CalamityMod.NPCs.Crags
int num285 = 3;
for (int num308 = num284; num308 < num284 + num285; num308++)
{
if (Main.tile[num283, num308] == null)
{
Main.tile[num283, num308] = new Tile();
}
if ((Main.tile[num283, num308].HasUnactuatedTile && Main.tileSolid[(int)Main.tile[num283, num308].TileType]) || Main.tile[num283, num308].LiquidAmount > 0)
{
flag23 = false;
@@ -123,10 +119,6 @@ namespace CalamityMod.NPCs.Crags
bool flag25 = false;
for (int num309 = num284; num309 < num284 + num285 - 2; num309++)
{
if (Main.tile[num283, num309] == null)
{
Main.tile[num283, num309] = new Tile();
}
if ((Main.tile[num283, num309].HasUnactuatedTile && Main.tileSolid[(int)Main.tile[num283, num309].TileType]) || Main.tile[num283, num309].LiquidAmount > 0)
{
flag25 = true;
@@ -255,11 +247,11 @@ namespace CalamityMod.NPCs.Crags
return spawnInfo.Player.Calamity().ZoneCalamity ? 0.125f : 0f;
}
public override void NPCLoot()
public override void ModifyNPCLoot(NPCLoot npcLoot)
{
DropHelper.DropItemCondition(NPC, ModContent.ItemType<LanternoftheSoul>(), DownedBossSystem.downedProvidence, 20, 1, 1);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<Bloodstone>(), DownedBossSystem.downedProvidence, 2, 1, 1);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<EssenceofChaos>(), Main.hardMode, 3, 1, 1);
npcLoot.AddIf(() => Main.hardMode, ModContent.ItemType<EssenceofChaos>(), 3);
npcLoot.AddIf(() => DownedBossSystem.downedProvidence, ModContent.ItemType<Bloodstone>(), 2);
npcLoot.AddIf(() => DownedBossSystem.downedProvidence, ModContent.ItemType<LanternoftheSoul>(), 20);
}
public override void OnHitPlayer(Player player, int damage, bool crit)
+5 -4
View File
@@ -277,11 +277,12 @@ namespace CalamityMod.NPCs.Crags
return false;
}
public override void NPCLoot()
public override void ModifyNPCLoot(NPCLoot npcLoot)
{
DropHelper.DropItemCondition(NPC, ModContent.ItemType<Bloodstone>(), DownedBossSystem.downedProvidence, 2, 1, 1);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<EssenceofChaos>(), Main.hardMode, 3, 1, 1);
DropHelper.DropItemChance(NPC, ModContent.ItemType<SlurperPole>(), (Main.hardMode ? 30 : 10));
npcLoot.AddIf(() => !Main.hardMode, ModContent.ItemType<SlurperPole>(), 10);
npcLoot.AddIf(() => Main.hardMode, ModContent.ItemType<SlurperPole>(), 30);
npcLoot.AddIf(() => Main.hardMode, ModContent.ItemType<EssenceofChaos>(), 3);
npcLoot.AddIf(() => DownedBossSystem.downedProvidence, ModContent.ItemType<Bloodstone>(), 2);
}
public override void OnHitPlayer(Player player, int damage, bool crit)
+46 -40
View File
@@ -25,6 +25,7 @@ using Terraria.GameContent;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.Audio;
using Terraria.GameContent.ItemDropRules;
namespace CalamityMod.NPCs.Cryogen
{
@@ -66,7 +67,6 @@ namespace CalamityMod.NPCs.Cryogen
NPC.HitSound = SoundID.NPCHit5;
NPC.DeathSound = SoundID.NPCDeath15;
Music = CalamityMod.Instance.GetMusicFromMusicMod("Cryogen") ?? MusicID.FrostMoon;
bossBag = ModContent.ItemType<CryogenBag>();
NPC.Calamity().VulnerableToHeat = true;
NPC.Calamity().VulnerableToCold = false;
NPC.Calamity().VulnerableToSickness = false;
@@ -1050,50 +1050,56 @@ namespace CalamityMod.NPCs.Cryogen
potionType = ItemID.GreaterHealingPotion;
}
public override void NPCLoot()
public override void ModifyNPCLoot(NPCLoot npcLoot)
{
// Boss bag
npcLoot.Add(ItemDropRule.BossBag(ModContent.ItemType<CryogenBag>()));
// Trophy (always directly from boss, never in bag)
npcLoot.Add(ModContent.ItemType<CryogenTrophy>(), 10);
// Lore
npcLoot.AddIf(() => !DownedBossSystem.downedCryogen, ModContent.ItemType<KnowledgeCryogen>());
// Normal drops: Everything that would otherwise be in the bag
var normalOnly = npcLoot.DefineNormalOnlyDropSet();
{
// Weapons
int[] weapons = new int[]
{
ModContent.ItemType<Avalanche>(),
ModContent.ItemType<GlacialCrusher>(),
ModContent.ItemType<EffluviumBow>(),
ModContent.ItemType<SnowstormStaff>(),
ModContent.ItemType<Icebreaker>(),
ModContent.ItemType<CryoStone>(),
ModContent.ItemType<FrostFlare>()
};
normalOnly.Add(ItemDropRule.OneFromOptions(DropHelper.NormalWeaponDropRateInt, weapons));
// Vanity
normalOnly.Add(ModContent.ItemType<CryogenMask>(), 7);
// Materials
normalOnly.Add(ModContent.ItemType<EssenceofEleum>(), 1, 4, 8);
// Equipment
normalOnly.Add(ModContent.ItemType<SoulofCryogen>());
}
npcLoot.Add(ItemID.FrozenKey, 3);
npcLoot.AddIf(() => !Main.expertMode, ModContent.ItemType<ColdDivinity>(), 10);
}
public override void OnKill()
{
CalamityGlobalNPC.SetNewBossJustDowned(NPC);
DropHelper.DropBags(NPC);
DropHelper.DropItemChance(NPC, ModContent.ItemType<CryogenTrophy>(), 10);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<KnowledgeCryogen>(), true, !DownedBossSystem.downedCryogen);
if (!Main.expertMode)
{
// Materials
DropHelper.DropItemSpray(NPC, ModContent.ItemType<EssenceofEleum>(), 4, 8);
// Weapons
float w = DropHelper.NormalWeaponDropRateFloat;
DropHelper.DropEntireWeightedSet(NPC,
DropHelper.WeightStack<Avalanche>(w),
DropHelper.WeightStack<GlacialCrusher>(w),
DropHelper.WeightStack<EffluviumBow>(w),
DropHelper.WeightStack<SnowstormStaff>(w),
DropHelper.WeightStack<Icebreaker>(w),
DropHelper.WeightStack<CryoStone>(w),
DropHelper.WeightStack<FrostFlare>(w)
);
// Equipment
DropHelper.DropItem(NPC, ModContent.ItemType<SoulofCryogen>(), true);
// Vanity
DropHelper.DropItemChance(NPC, ModContent.ItemType<CryogenMask>(), 7);
}
DropHelper.DropItemCondition(NPC, ModContent.ItemType<ColdDivinity>(), !Main.expertMode, 0.1f);
// Other
DropHelper.DropItemChance(NPC, ItemID.FrozenKey, 3);
// Spawn Permafrost if he isn't in the world
int permafrostNPC = NPC.FindFirstNPC(ModContent.NPCType<DILF>());
if (permafrostNPC == -1 && Main.netMode != NetmodeID.MultiplayerClient)
{
NPC.NewNPC((int)NPC.Center.X, (int)NPC.Center.Y, ModContent.NPCType<DILF>(), 0, 0f, 0f, 0f, 0f, 255);
}
if (permafrostNPC == -1)
NPC.NewNPC(NPC.GetSpawnSource_NPCHurt(), (int)NPC.Center.X, (int)NPC.Center.Y, ModContent.NPCType<DILF>(), 0, 0f, 0f, 0f, 0f, 255);
// If Cryogen has not been killed, notify players about Cryonic Ore
if (!DownedBossSystem.downedCryogen)
-2
View File
@@ -98,8 +98,6 @@ namespace CalamityMod.NPCs.Cryogen
NPC.lifeMax = (int)(NPC.lifeMax * 0.5f * bossLifeScale);
}
public override bool PreNPCLoot() => false;
public override void HitEffect(int hitDirection, double damage)
{
for (int k = 0; k < 3; k++)
-5
View File
@@ -124,11 +124,6 @@ namespace CalamityMod.NPCs.DesertScourge
return false;
}
public override bool PreNPCLoot()
{
return false;
}
public override void HitEffect(int hitDirection, double damage)
{
for (int k = 0; k < 3; k++)
-2
View File
@@ -376,8 +376,6 @@ namespace CalamityMod.NPCs.DesertScourge
}
}
public override bool PreNPCLoot() => false;
public override void HitEffect(int hitDirection, double damage)
{
for (int k = 0; k < 3; k++)
-5
View File
@@ -143,11 +143,6 @@ namespace CalamityMod.NPCs.DesertScourge
return false;
}
public override bool PreNPCLoot()
{
return false;
}
public override void ScaleExpertStats(int numPlayers, float bossLifeScale)
{
NPC.lifeMax = (int)(NPC.lifeMax * 0.7f * bossLifeScale);
-5
View File
@@ -180,11 +180,6 @@ namespace CalamityMod.NPCs.DesertScourge
return false;
}
public override bool PreNPCLoot()
{
return false;
}
public override void HitEffect(int hitDirection, double damage)
{
for (int k = 0; k < 3; k++)
+57 -50
View File
@@ -19,6 +19,7 @@ using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.Audio;
using Terraria.GameContent.ItemDropRules;
namespace CalamityMod.NPCs.DesertScourge
{
@@ -57,7 +58,6 @@ namespace CalamityMod.NPCs.DesertScourge
NPC.HitSound = SoundID.NPCHit1;
NPC.DeathSound = SoundID.NPCDeath1;
NPC.netAlways = true;
bossBag = ModContent.ItemType<DesertScourgeBag>();
Music = CalamityMod.Instance.GetMusicFromMusicMod("DesertScourge") ?? MusicID.Boss1;
if (CalamityWorld.malice || BossRushEvent.BossRushActive)
@@ -546,58 +546,10 @@ namespace CalamityMod.NPCs.DesertScourge
potionType = ItemID.SandBlock;
}
public override bool SpecialNPCLoot()
{
int closestSegmentID = DropHelper.FindClosestWormSegment(NPC,
ModContent.NPCType<DesertScourgeHead>(),
ModContent.NPCType<DesertScourgeBody>(),
ModContent.NPCType<DesertScourgeTail>());
NPC.position = Main.npc[closestSegmentID].position;
return false;
}
public override void NPCLoot()
public override void OnKill()
{
CalamityGlobalNPC.SetNewBossJustDowned(NPC);
DropHelper.DropBags(NPC);
DropHelper.DropItem(NPC, ItemID.LesserHealingPotion, 8, 14);
DropHelper.DropItemChance(NPC, ModContent.ItemType<DesertScourgeTrophy>(), 10);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<KnowledgeDesertScourge>(), true, !DownedBossSystem.downedDesertScourge);
// All other drops are contained in the bag, so they only drop directly on Normal
if (!Main.expertMode)
{
// Materials
DropHelper.DropItem(NPC, ModContent.ItemType<VictoryShard>(), 7, 14);
DropHelper.DropItem(NPC, ItemID.Coral, 5, 9);
DropHelper.DropItem(NPC, ItemID.Seashell, 5, 9);
DropHelper.DropItem(NPC, ItemID.Starfish, 5, 9);
// Weapons
// Set up the base drop set, which includes Scourge of the Desert at its normal drop chance.
float w = DropHelper.NormalWeaponDropRateFloat;
DropHelper.DropEntireWeightedSet(NPC,
DropHelper.WeightStack<AquaticDischarge>(w),
DropHelper.WeightStack<Barinade>(w),
DropHelper.WeightStack<StormSpray>(w),
DropHelper.WeightStack<SeaboundStaff>(w),
DropHelper.WeightStack<ScourgeoftheDesert>(w),
DropHelper.WeightStack<AeroStone>(w),
DropHelper.WeightStack<SandCloak>(w)
);
// Equipment
DropHelper.DropItem(NPC, ModContent.ItemType<OceanCrest>(), true);
// Vanity
DropHelper.DropItemChance(NPC, ModContent.ItemType<DesertScourgeMask>(), 7);
// Fishing
DropHelper.DropItem(NPC, ModContent.ItemType<SandyAnglingKit>());
}
// If Desert Scourge has not been killed yet, notify players that the Sunken Sea is open and Sandstorms can happen
if (!DownedBossSystem.downedDesertScourge)
{
@@ -617,6 +569,61 @@ namespace CalamityMod.NPCs.DesertScourge
DownedBossSystem.downedDesertScourge = true;
CalamityNetcode.SyncWorld();
}
public override bool SpecialOnKill()
{
int closestSegmentID = DropHelper.FindClosestWormSegment(NPC,
ModContent.NPCType<DesertScourgeHead>(),
ModContent.NPCType<DesertScourgeBody>(),
ModContent.NPCType<DesertScourgeTail>());
NPC.position = Main.npc[closestSegmentID].position;
return true;
}
public override void ModifyNPCLoot(NPCLoot npcLoot)
{
// Boss bag
npcLoot.Add(ItemDropRule.BossBag(ModContent.ItemType<DesertScourgeBag>()));
// Extraneous potions
npcLoot.Add(ItemID.LesserHealingPotion, 1, 8, 14);
// Trophy (always directly from boss, never in bag)
npcLoot.Add(ModContent.ItemType<DesertScourgeTrophy>(), 10);
// Lore
npcLoot.AddIf(() => !DownedBossSystem.downedDesertScourge, ModContent.ItemType<KnowledgeDesertScourge>());
// Normal drops: Everything that would otherwise be in the bag
var normalOnly = npcLoot.DefineNormalOnlyDropSet();
{
// Weapons
int[] weapons = new int[]
{
ModContent.ItemType<AquaticDischarge>(),
ModContent.ItemType<Barinade>(),
ModContent.ItemType<StormSpray>(),
ModContent.ItemType<SeaboundStaff>(),
ModContent.ItemType<ScourgeoftheDesert>(),
ModContent.ItemType<AeroStone>(),
ModContent.ItemType<SandCloak>()
};
normalOnly.Add(ItemDropRule.OneFromOptions(DropHelper.NormalWeaponDropRateInt, weapons));
// Vanity
normalOnly.Add(ModContent.ItemType<DesertScourgeMask>(), 7);
// Materials
normalOnly.Add(ItemID.Coral, 1, 5, 9);
normalOnly.Add(ItemID.Seashell, 1, 5, 9);
normalOnly.Add(ItemID.Starfish, 1, 5, 9);
normalOnly.Add(ModContent.ItemType<VictoryShard>(), 1, 7, 14);
// Equipment
normalOnly.Add(ModContent.ItemType<OceanCrest>());
normalOnly.Add(ModContent.ItemType<SandyAnglingKit>());
}
}
#endregion
public override void HitEffect(int hitDirection, double damage)
-5
View File
@@ -162,11 +162,6 @@ namespace CalamityMod.NPCs.DesertScourge
return false;
}
public override bool PreNPCLoot()
{
return false;
}
public override void ScaleExpertStats(int numPlayers, float bossLifeScale)
{
NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * bossLifeScale);
+1 -6
View File
@@ -283,7 +283,7 @@ namespace CalamityMod.NPCs.DevourerofGods
spriteBatch.EnterShaderRegion();
GameShaders.Misc["CalamityMod:DoGDisintegration"].UseOpacity(disintegrationFactor);
GameShaders.Misc["CalamityMod:DoGDisintegration"].UseSaturation(NPC.whoAmI);
GameShaders.Misc["CalamityMod:DoGDisintegration"].UseImage("Images/Misc/Perlin");
GameShaders.Misc["CalamityMod:DoGDisintegration"].UseImage0("Images/Misc/Perlin");
GameShaders.Misc["CalamityMod:DoGDisintegration"].Apply();
}
@@ -380,11 +380,6 @@ namespace CalamityMod.NPCs.DevourerofGods
return false;
}
public override bool PreNPCLoot()
{
return false;
}
public override void HitEffect(int hitDirection, double damage)
{
if (NPC.life <= 0)
@@ -183,11 +183,6 @@ namespace CalamityMod.NPCs.DevourerofGods
return false;
}
public override bool PreNPCLoot()
{
return false;
}
public override void HitEffect(int hitDirection, double damage)
{
if (NPC.life <= 0)
+65 -52
View File
@@ -33,6 +33,7 @@ using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;
using Terraria.Audio;
using Terraria.GameContent.ItemDropRules;
namespace CalamityMod.NPCs.DevourerofGods
{
@@ -163,7 +164,6 @@ namespace CalamityMod.NPCs.DevourerofGods
NPC.DeathSound = SoundID.NPCDeath14;
NPC.netAlways = true;
Music = CalamityMod.Instance.GetMusicFromMusicMod("DevourerOfGodsP1") ?? MusicID.Boss3;
bossBag = ModContent.ItemType<DevourerofGodsBag>();
}
public override void BossHeadSlot(ref int index)
@@ -2046,7 +2046,7 @@ namespace CalamityMod.NPCs.DevourerofGods
Main.npc[i].position = newPosition;
if (Main.npc[i].type == ModContent.NPCType<DevourerofGodsTail>())
((DevourerofGodsTail)Main.npc[i].modNPC).setInvulTime(720);
((DevourerofGodsTail)Main.npc[i].ModNPC).setInvulTime(720);
Main.npc[i].netUpdate = true;
}
@@ -2186,7 +2186,7 @@ namespace CalamityMod.NPCs.DevourerofGods
spriteBatch.EnterShaderRegion();
GameShaders.Misc["CalamityMod:DoGDisintegration"].UseOpacity(disintegrationFactor);
GameShaders.Misc["CalamityMod:DoGDisintegration"].UseSaturation(NPC.whoAmI);
GameShaders.Misc["CalamityMod:DoGDisintegration"].UseImage("Images/Misc/Perlin");
GameShaders.Misc["CalamityMod:DoGDisintegration"].UseImage0("Images/Misc/Perlin");
GameShaders.Misc["CalamityMod:DoGDisintegration"].Apply();
}
@@ -2227,63 +2227,15 @@ namespace CalamityMod.NPCs.DevourerofGods
potionType = ModContent.ItemType<CosmiliteBrick>();
}
public override bool SpecialNPCLoot()
{
int closestSegmentID = DropHelper.FindClosestWormSegment(NPC,
ModContent.NPCType<DevourerofGodsHead>(),
ModContent.NPCType<DevourerofGodsBody>(),
ModContent.NPCType<DevourerofGodsTail>());
NPC.position = Main.npc[closestSegmentID].position;
return false;
}
public override void NPCLoot()
public override void OnKill()
{
// Stop the countdown -- if you kill DoG in less than 60 frames, this will stop another one from spawning.
CalamityWorld.DoGSecondStageCountdown = 0;
CalamityGlobalNPC.SetNewBossJustDowned(NPC);
DropHelper.DropBags(NPC);
DropHelper.DropItem(NPC, ModContent.ItemType<OmegaHealingPotion>(), 5, 15);
DropHelper.DropItemChance(NPC, ModContent.ItemType<DevourerofGodsTrophy>(), 10);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<KnowledgeDevourerofGods>(), true, !DownedBossSystem.downedDoG);
CalamityGlobalNPC.SetNewShopVariable(new int[] { ModContent.NPCType<THIEF>() }, DownedBossSystem.downedDoG);
// Mount
CalamityPlayer mp = Main.player[Player.FindClosest(NPC.position, NPC.width, NPC.height)].Calamity();
DropHelper.DropItemCondition(NPC, ModContent.ItemType<Fabsol>(), true, mp.fabsolVodka);
// All other drops are contained in the bag, so they only drop directly on Normal
if (!Main.expertMode)
{
// Materials
DropHelper.DropItem(NPC, ModContent.ItemType<CosmiliteBar>(), 25, 35);
DropHelper.DropItem(NPC, ModContent.ItemType<CosmiliteBrick>(), 150, 250);
// Weapons
float w = DropHelper.NormalWeaponDropRateFloat;
DropHelper.DropEntireWeightedSet(NPC,
DropHelper.WeightStack<Excelsus>(w),
DropHelper.WeightStack<TheObliterator>(w),
DropHelper.WeightStack<Deathwind>(w),
DropHelper.WeightStack<DeathhailStaff>(w),
DropHelper.WeightStack<StaffoftheMechworm>(w),
DropHelper.WeightStack<Eradicator>(w)
);
// Equipment
DropHelper.DropItem(NPC, ModContent.ItemType<NebulousCore>(), true);
// Vanity
DropHelper.DropItemChance(NPC, ModContent.ItemType<DevourerofGodsMask>(), 7);
}
DropHelper.DropItemCondition(NPC, ModContent.ItemType<Norfleet>(), !Main.expertMode, 0.1f);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<CosmicDischarge>(), !Main.expertMode, 0.1f);
// If DoG has not been killed yet, notify players that the holiday moons are buffed
if (!DownedBossSystem.downedDoG)
{
@@ -2303,6 +2255,67 @@ namespace CalamityMod.NPCs.DevourerofGods
CalamityNetcode.SyncWorld();
}
public override bool SpecialOnKill()
{
int closestSegmentID = DropHelper.FindClosestWormSegment(NPC,
ModContent.NPCType<DevourerofGodsHead>(),
ModContent.NPCType<DevourerofGodsBody>(),
ModContent.NPCType<DevourerofGodsTail>());
NPC.position = Main.npc[closestSegmentID].position;
return true;
}
public override void ModifyNPCLoot(NPCLoot npcLoot)
{
// Boss bag
npcLoot.Add(ItemDropRule.BossBag(ModContent.ItemType<DevourerofGodsBag>()));
// Extraneous potions
npcLoot.Add(ModContent.ItemType<OmegaHealingPotion>(), 1, 5, 15);
// Trophy (always directly from boss, never in bag)
npcLoot.Add(ModContent.ItemType<DevourerofGodsTrophy>(), 10);
// Lore
npcLoot.AddIf(() => !DownedBossSystem.downedDoG, ModContent.ItemType<KnowledgeDevourerofGods>());
// Fabsol Mount
npcLoot.AddIf(() =>
{
CalamityPlayer mp = Main.player[Player.FindClosest(NPC.position, NPC.width, NPC.height)].Calamity();
return mp.vodka;
}, ModContent.ItemType<KnowledgeDevourerofGods>());
// Normal drops: Everything that would otherwise be in the bag
var normalOnly = npcLoot.DefineNormalOnlyDropSet();
{
// Weapons
int[] weapons = new int[]
{
ModContent.ItemType<Excelsus>(),
ModContent.ItemType<TheObliterator>(),
ModContent.ItemType<Deathwind>(),
ModContent.ItemType<DeathhailStaff>(),
ModContent.ItemType<StaffoftheMechworm>(),
ModContent.ItemType<Eradicator>()
};
normalOnly.Add(ItemDropRule.OneFromOptions(DropHelper.NormalWeaponDropRateInt, weapons));
// Vanity
normalOnly.Add(ModContent.ItemType<DevourerofGodsMask>(), 7);
// Materials
normalOnly.Add(ModContent.ItemType<CosmiliteBar>(), 1, 25, 35);
normalOnly.Add(ModContent.ItemType<CosmiliteBrick>(), 1, 150, 250);
// Equipment
normalOnly.Add(ModContent.ItemType<NebulousCore>());
}
npcLoot.AddIf(() => !Main.expertMode, ModContent.ItemType<Norfleet>(), 10);
npcLoot.AddIf(() => !Main.expertMode, ModContent.ItemType<CosmicDischarge>(), 10);
}
// Can only hit the target if within certain distance
public override bool CanHitPlayer(Player target, ref int cooldownSlot)
{
+2 -2
View File
@@ -328,13 +328,13 @@ namespace CalamityMod.NPCs.DevourerofGods
return false;
}
public override void NPCLoot()
public override void OnKill()
{
if (!CalamityWorld.revenge)
{
int heartAmt = Main.rand.Next(3) + 3;
for (int i = 0; i < heartAmt; i++)
Item.NewItem((int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart);
Item.NewItem(NPC.GetItemSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart);
}
}
+1 -6
View File
@@ -303,7 +303,7 @@ namespace CalamityMod.NPCs.DevourerofGods
spriteBatch.EnterShaderRegion();
GameShaders.Misc["CalamityMod:DoGDisintegration"].UseOpacity(disintegrationFactor);
GameShaders.Misc["CalamityMod:DoGDisintegration"].UseSaturation(NPC.whoAmI);
GameShaders.Misc["CalamityMod:DoGDisintegration"].UseImage("Images/Misc/Perlin");
GameShaders.Misc["CalamityMod:DoGDisintegration"].UseImage0("Images/Misc/Perlin");
GameShaders.Misc["CalamityMod:DoGDisintegration"].Apply();
}
@@ -437,11 +437,6 @@ namespace CalamityMod.NPCs.DevourerofGods
return false;
}
public override bool PreNPCLoot()
{
return false;
}
public override void ScaleExpertStats(int numPlayers, float bossLifeScale)
{
NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * bossLifeScale);
@@ -219,11 +219,6 @@ namespace CalamityMod.NPCs.DevourerofGods
return false;
}
public override bool PreNPCLoot()
{
return false;
}
public override void OnHitPlayer(Player player, int damage, bool crit)
{
player.AddBuff(ModContent.BuffType<GodSlayerInferno>(), 90, true);
+2 -2
View File
@@ -305,9 +305,9 @@ namespace CalamityMod.NPCs.DraedonLabThings
}
}
public override void NPCLoot()
public override void ModifyNPCLoot(NPCLoot npcLoot)
{
DropHelper.DropItemChance(NPC, ModContent.ItemType<PowerCell>(), 2, 2, 4);
npcLoot.Add(ModContent.ItemType<PowerCell>(), 2, 2, 4);
}
public override void FindFrame(int frameHeight)
+3 -3
View File
@@ -23,7 +23,7 @@ namespace CalamityMod.NPCs.ExoMechs
public bool ShouldStartStandingUp;
public Vector2 HoverDestinationOffset
{
get => new Vector2(NPC.ai[1], NPC.ai[2]);
get => new(NPC.ai[1], NPC.ai[2]);
set
{
NPC.ai[1] = value.X;
@@ -57,8 +57,8 @@ namespace CalamityMod.NPCs.ExoMechs
return false;
}
}
public static readonly Color TextColor = new Color(155, 255, 255);
public static readonly Color TextColorEdgy = new Color(213, 4, 11);
public static readonly Color TextColor = new(155, 255, 255);
public static readonly Color TextColorEdgy = new(213, 4, 11);
public const int HologramFadeinTime = 45;
public const int TalkDelay = 150;
public const int DelayPerDialogLine = 130;
+7 -4
View File
@@ -597,12 +597,15 @@ namespace CalamityMod.NPCs.GreatSandShark
}
}
public override void NPCLoot()
public override void ModifyNPCLoot(NPCLoot npcLoot)
{
DropHelper.DropItem(NPC, ItemID.AncientBattleArmorMaterial, 1, 1);
DropHelper.DropItem(NPC, ModContent.ItemType<GrandScale>(), 1, 1);
DropHelper.DropItemCondition(NPC, ModContent.ItemType<GrandScale>(), Main.expertMode, 3, 1, 1);
npcLoot.Add(ItemID.AncientBattleArmorMaterial);
npcLoot.Add(ModContent.ItemType<GrandScale>());
npcLoot.AddIf(() => Main.expertMode, ModContent.ItemType<GrandScale>(), 3);
}
public override void OnKill()
{
// Mark Great Sand Shark as dead
DownedBossSystem.downedGSS = true;
CalamityNetcode.SyncWorld();
+2 -4
View File
@@ -112,13 +112,13 @@ namespace CalamityMod.NPCs.HiveMind
}
}
public override bool PreNPCLoot()
public override void OnKill()
{
if (!CalamityWorld.revenge)
{
int closestPlayer = Player.FindClosest(NPC.Center, 1, 1);
if (Main.rand.Next(4) == 0 && Main.player[closestPlayer].statLife < Main.player[closestPlayer].statLifeMax2)
Item.NewItem((int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart);
Item.NewItem(NPC.GetItemSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart);
}
if ((Main.expertMode || BossRushEvent.BossRushActive) && Main.netMode != NetmodeID.MultiplayerClient)
@@ -127,8 +127,6 @@ namespace CalamityMod.NPCs.HiveMind
int damage = NPC.GetProjectileDamage(type);
Projectile.NewProjectile(NPC.GetSpawnSource_ForProjectile(), NPC.Center, Vector2.Zero, type, damage, 0f, Main.myPlayer);
}
return false;
}
}
}
+2 -2
View File
@@ -123,13 +123,13 @@ namespace CalamityMod.NPCs.HiveMind
}
}
public override void NPCLoot()
public override void OnKill()
{
if (!CalamityWorld.revenge)
{
int closestPlayer = Player.FindClosest(NPC.Center, 1, 1);
if (Main.rand.Next(4) == 0 && Main.player[closestPlayer].statLife < Main.player[closestPlayer].statLifeMax2)
Item.NewItem((int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart);
Item.NewItem(NPC.GetItemSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart);
}
}
+3 -3
View File
@@ -153,13 +153,13 @@ namespace CalamityMod.NPCs.HiveMind
}
}
public override void NPCLoot()
public override void OnKill()
{
if (!CalamityWorld.revenge)
{
int closestPlayer = Player.FindClosest(NPC.Center, 1, 1);
if (Main.rand.Next(8) == 0 && Main.player[closestPlayer].statLife < Main.player[closestPlayer].statLifeMax2)
Item.NewItem((int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart);
if (Main.rand.Next(4) == 0 && Main.player[closestPlayer].statLife < Main.player[closestPlayer].statLifeMax2)
Item.NewItem(NPC.GetItemSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart);
}
}
+3 -3
View File
@@ -153,13 +153,13 @@ namespace CalamityMod.NPCs.HiveMind
}
}
public override void NPCLoot()
public override void OnKill()
{
if (!CalamityWorld.revenge)
{
int closestPlayer = Player.FindClosest(NPC.Center, 1, 1);
if (Main.rand.Next(8) == 0 && Main.player[closestPlayer].statLife < Main.player[closestPlayer].statLifeMax2)
Item.NewItem((int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart);
if (Main.rand.Next(4) == 0 && Main.player[closestPlayer].statLife < Main.player[closestPlayer].statLifeMax2)
Item.NewItem(NPC.GetItemSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart);
}
}
+4 -4
View File
@@ -1,4 +1,4 @@
using CalamityMod.World;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
@@ -49,7 +49,7 @@ namespace CalamityMod.NPCs.HiveMind
return 0f;
bool anyBossElements = NPC.AnyNPCs(ModContent.NPCType<HiveCyst>()) || NPC.AnyNPCs(ModContent.NPCType<HiveMind>());
bool corrupt = TileID.Sets.Corrupt[spawnInfo.spawnTileType] || spawnInfo.spawnTileType == TileID.Demonite && spawnInfo.Player.ZoneCorrupt;
bool corrupt = TileID.Sets.Corrupt[spawnInfo.SpawnTileType] || spawnInfo.SpawnTileType == TileID.Demonite && spawnInfo.Player.ZoneCorrupt;
if (anyBossElements || spawnInfo.PlayerSafe || !corrupt)
return 0f;
@@ -79,8 +79,8 @@ namespace CalamityMod.NPCs.HiveMind
}
if (Main.netMode != NetmodeID.MultiplayerClient && NPC.CountNPCS(ModContent.NPCType<HiveMind>()) < 1)
{
Vector2 spawnAt = NPC.Center + new Vector2(0f, (float)NPC.height / 2f);
NPC.NewNPC((int)spawnAt.X, (int)spawnAt.Y, ModContent.NPCType<HiveMind>());
Vector2 spawnAt = NPC.Bottom;
NPC.NewNPC(NPC.GetSpawnSource_NPCHurt(), (int)spawnAt.X, (int)spawnAt.Y, ModContent.NPCType<HiveMind>());
}
}
}
+1 -3
View File
@@ -228,7 +228,7 @@ namespace CalamityMod.NPCs.Leviathan
}
}
public override bool PreNPCLoot()
public override void OnKill()
{
if (!CalamityWorld.revenge)
{
@@ -236,8 +236,6 @@ namespace CalamityMod.NPCs.Leviathan
if (Main.rand.Next(4) == 0 && Main.player[closestPlayer].statLife < Main.player[closestPlayer].statLifeMax2)
Item.NewItem((int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart);
}
return false;
}
public override float SpawnChance(NPCSpawnInfo spawnInfo)
+58 -52
View File
@@ -22,6 +22,7 @@ using Terraria.GameContent;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.Audio;
using Terraria.GameContent.ItemDropRules;
namespace CalamityMod.NPCs.Leviathan
{
@@ -702,65 +703,70 @@ namespace CalamityMod.NPCs.Leviathan
potionType = ItemID.GreaterHealingPotion;
}
// The Leviathan runs the same loot code as Anahita, but only if she dies last.
public override void NPCLoot()
public override void OnKill()
{
//Trophy dropped regardless of Anahita, precedent of Twins
DropHelper.DropItemChance(NPC, ModContent.ItemType<LeviathanTrophy>(), 10);
if (!NPC.AnyNPCs(ModContent.NPCType<Siren>()))
DropSirenLeviLoot(NPC);
}
// This loot code is shared with Anahita.
public static void DropSirenLeviLoot(NPC npc)
{
CalamityGlobalNPC.SetNewBossJustDowned(npc);
DropHelper.DropBags(npc);
DropHelper.DropItemCondition(npc, ModContent.ItemType<KnowledgeOcean>(), true, !DownedBossSystem.downedLeviathan);
DropHelper.DropItemCondition(npc, ModContent.ItemType<KnowledgeLeviathanandSiren>(), true, !DownedBossSystem.downedLeviathan);
// All other drops are contained in the bag, so they only drop directly on Normal
if (!Main.expertMode)
{
// Weapons
float w = DropHelper.NormalWeaponDropRateFloat;
DropHelper.DropEntireWeightedSet(npc,
DropHelper.WeightStack<Greentide>(w),
DropHelper.WeightStack<Leviatitan>(w),
DropHelper.WeightStack<SirensSong>(w),
DropHelper.WeightStack<Atlantis>(w),
DropHelper.WeightStack<GastricBelcherStaff>(w),
DropHelper.WeightStack<BrackishFlask>(w),
DropHelper.WeightStack<LeviathanTeeth>(w),
DropHelper.WeightStack<LureofEnthrallment>(w)
);
// Equipment
DropHelper.DropItem(npc, ModContent.ItemType<LeviathanAmbergris>(), true);
// Vanity
DropHelper.DropItemChance(npc, ModContent.ItemType<LeviathanMask>(), 7);
DropHelper.DropItemChance(npc, ModContent.ItemType<AnahitaMask>(), 7);
// Fishing
DropHelper.DropItemChance(npc, ItemID.HotlineFishingHook, 10);
DropHelper.DropItemChance(npc, ItemID.BottomlessBucket, 10);
DropHelper.DropItemChance(npc, ItemID.SuperAbsorbantSponge, 10);
DropHelper.DropItemChance(npc, ItemID.FishingPotion, 5, 5, 8);
DropHelper.DropItemChance(npc, ItemID.SonarPotion, 5, 5, 8);
DropHelper.DropItemChance(npc, ItemID.CratePotion, 5, 5, 8);
}
DropHelper.DropItemCondition(npc, ModContent.ItemType<TheCommunity>(), !Main.expertMode, 0.1f);
CalamityGlobalNPC.SetNewBossJustDowned(NPC);
// Mark Siren & Levi as dead
DownedBossSystem.downedLeviathan = true;
CalamityNetcode.SyncWorld();
}
public static bool ReadyToDropLoot(NPC npc)
{
if (npc.type == ModContent.NPCType<Siren>() && !NPC.AnyNPCs(ModContent.NPCType<Leviathan>()))
return true;
if (npc.type == ModContent.NPCType<Leviathan>() && !NPC.AnyNPCs(ModContent.NPCType<Siren>()))
return true;
return false;
}
// This loot code is shared with Anahita.
// The Leviathan runs the same loot code as Anahita, but only if she dies last.
public override void ModifyNPCLoot(NPCLoot npcLoot)
{
npcLoot.Add(ItemDropRule.BossBagByCondition(DropHelper.If(() => ReadyToDropLoot(NPC)), ModContent.ItemType<LeviathanBag>()));
// Trophy (always directly from boss, never in bag)
npcLoot.Add(ModContent.ItemType<LeviathanTrophy>(), 10);
// Lore
npcLoot.AddIf(() => !DownedBossSystem.downedLeviathan && ReadyToDropLoot(NPC), ModContent.ItemType<KnowledgeOcean>());
npcLoot.AddIf(() => !DownedBossSystem.downedLeviathan && ReadyToDropLoot(NPC), ModContent.ItemType<KnowledgeLeviathanandSiren>());
// Weapons.
var normalOnly = npcLoot.DefineConditionalDropSet(DropHelper.If(() => Main.expertMode && ReadyToDropLoot(NPC)));
{
int[] weapons = new int[]
{
ModContent.ItemType<Greentide>(),
ModContent.ItemType<Leviatitan>(),
ModContent.ItemType<SirensSong>(),
ModContent.ItemType<Atlantis>(),
ModContent.ItemType<GastricBelcherStaff>(),
ModContent.ItemType<BrackishFlask>(),
ModContent.ItemType<LeviathanTeeth>(),
ModContent.ItemType<LureofEnthrallment>()
};
npcLoot.Add(ItemDropRule.OneFromOptions(DropHelper.NormalWeaponDropRateInt, weapons));
// Vanity
normalOnly.Add(ModContent.ItemType<LeviathanMask>(), 7);
normalOnly.Add(ModContent.ItemType<AnahitaMask>(), 7);
// Equipment
normalOnly.Add(ItemID.HotlineFishingHook, 10);
normalOnly.Add(ItemID.BottomlessBucket, 10);
normalOnly.Add(ItemID.SuperAbsorbantSponge, 10);
normalOnly.Add(ItemID.FishingPotion, 5, 5, 8);
normalOnly.Add(ItemID.SonarPotion, 5, 5, 8);
normalOnly.Add(ItemID.CratePotion, 5, 5, 8);
normalOnly.Add(ModContent.ItemType<LeviathanAmbergris>());
}
npcLoot.AddIf(() => !DownedBossSystem.downedLeviathan && ReadyToDropLoot(NPC), ModContent.ItemType<TheCommunity>(), 10);
}
public override void OnHitPlayer(Player target, int damage, bool crit)
{
target.AddBuff(BuffID.Bleeding, 240, true);
+4 -4
View File
@@ -132,10 +132,10 @@ namespace CalamityMod.NPCs.Leviathan
return SpawnCondition.OceanMonster.Chance * 0.4f;
}
public override void NPCLoot()
public override void ModifyNPCLoot(NPCLoot npcLoot)
{
DropHelper.DropItemChance(NPC, ModContent.ItemType<SirensHeart>(), 0.25f);
npcLoot.Add(ModContent.ItemType<SirensHeart>(), 4);
}
public override void HitEffect(int hitDirection, double damage)
@@ -149,7 +149,7 @@ namespace CalamityMod.NPCs.Leviathan
}
else if (Main.netMode != NetmodeID.MultiplayerClient)
{
int siren = NPC.NewNPC((int)NPC.Center.X, (int)NPC.position.Y + NPC.height, ModContent.NPCType<Siren>(), NPC.whoAmI);
int siren = NPC.NewNPC(NPC.GetSpawnSource_NPCHurt(), (int)NPC.Center.X, (int)NPC.position.Y + NPC.height, ModContent.NPCType<Siren>(), NPC.whoAmI);
CalamityUtils.BossAwakenMessage(siren);
}
}
+52 -9
View File
@@ -12,6 +12,15 @@ using Terraria.GameContent;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.Audio;
using Terraria.GameContent.ItemDropRules;
using CalamityMod.Items.Accessories;
using CalamityMod.Items.Armor.Vanity;
using CalamityMod.Items.Weapons.Rogue;
using CalamityMod.Items.Weapons.Summon;
using CalamityMod.Items.Weapons.Magic;
using CalamityMod.Items.Weapons.Ranged;
using CalamityMod.Items.Weapons.Melee;
using CalamityMod.Items.LoreItems;
namespace CalamityMod.NPCs.Leviathan
{
@@ -62,8 +71,7 @@ namespace CalamityMod.NPCs.Leviathan
NPC.noTileCollide = true;
NPC.HitSound = SoundID.NPCHit1;
NPC.DeathSound = SoundID.NPCDeath1;
music = CalamityMod.Instance.GetMusicFromMusicMod("Anahita") ?? MusicID.Boss3;
bossBag = ModContent.ItemType<LeviathanBag>();
Music = CalamityMod.Instance.GetMusicFromMusicMod("Anahita") ?? MusicID.Boss3;
NPC.Calamity().VulnerableToHeat = false;
NPC.Calamity().VulnerableToSickness = true;
NPC.Calamity().VulnerableToElectricity = true;
@@ -215,7 +223,7 @@ namespace CalamityMod.NPCs.Leviathan
// Change music.
if (leviAlive)
music = CalamityMod.Instance.GetMusicFromMusicMod("LeviathanAndAnahita") ?? MusicID.Boss3;
Music = CalamityMod.Instance.GetMusicFromMusicMod("LeviathanAndAnahita") ?? MusicID.Boss3;
// Ice Shield
if (NPC.localAI[2] < 3f)
@@ -599,7 +607,7 @@ namespace CalamityMod.NPCs.Leviathan
totalProjectiles = 6;
type = ModContent.ProjectileType<SirenSong>();
float soundPitch = (Main.rand.NextFloat() - 0.5f) * 0.5f;
Main.harpNote = soundPitch;
Main.musicPitch = soundPitch;
SoundEngine.PlaySound(SoundID.Item26, player.position);
break;
}
@@ -818,13 +826,48 @@ namespace CalamityMod.NPCs.Leviathan
}
// Anahita runs the same loot code as the Leviathan, but only if she dies last.
public override void NPCLoot()
public override void ModifyNPCLoot(NPCLoot npcLoot)
{
//Trophy dropped regardless of Levi, precedent of Twins
DropHelper.DropItemChance(NPC, ModContent.ItemType<AnahitaTrophy>(), 10);
npcLoot.Add(ItemDropRule.BossBagByCondition(DropHelper.If(() => Leviathan.ReadyToDropLoot(NPC)), ModContent.ItemType<LeviathanBag>()));
if (!NPC.AnyNPCs(ModContent.NPCType<Leviathan>()))
Leviathan.DropSirenLeviLoot(NPC);
// Trophy (always directly from boss, never in bag)
npcLoot.Add(ModContent.ItemType<AnahitaTrophy>(), 10);
// Lore
npcLoot.AddIf(() => !DownedBossSystem.downedLeviathan && Leviathan.ReadyToDropLoot(NPC), ModContent.ItemType<KnowledgeOcean>());
npcLoot.AddIf(() => !DownedBossSystem.downedLeviathan && Leviathan.ReadyToDropLoot(NPC), ModContent.ItemType<KnowledgeLeviathanandSiren>());
// Weapons.
var normalOnly = npcLoot.DefineConditionalDropSet(DropHelper.If(() => Main.expertMode && Leviathan.ReadyToDropLoot(NPC)));
{
int[] weapons = new int[]
{
ModContent.ItemType<Greentide>(),
ModContent.ItemType<Leviatitan>(),
ModContent.ItemType<SirensSong>(),
ModContent.ItemType<Atlantis>(),
ModContent.ItemType<GastricBelcherStaff>(),
ModContent.ItemType<BrackishFlask>(),
ModContent.ItemType<LeviathanTeeth>(),
ModContent.ItemType<LureofEnthrallment>()
};
npcLoot.Add(ItemDropRule.OneFromOptions(DropHelper.NormalWeaponDropRateInt, weapons));
// Vanity
normalOnly.Add(ModContent.ItemType<LeviathanMask>(), 7);
normalOnly.Add(ModContent.ItemType<AnahitaMask>(), 7);
// Equipment
normalOnly.Add(ItemID.HotlineFishingHook, 10);
normalOnly.Add(ItemID.BottomlessBucket, 10);
normalOnly.Add(ItemID.SuperAbsorbantSponge, 10);
normalOnly.Add(ItemID.FishingPotion, 5, 5, 8);
normalOnly.Add(ItemID.SonarPotion, 5, 5, 8);
normalOnly.Add(ItemID.CratePotion, 5, 5, 8);
normalOnly.Add(ModContent.ItemType<LeviathanAmbergris>());
}
npcLoot.AddIf(() => !DownedBossSystem.downedLeviathan && Leviathan.ReadyToDropLoot(NPC), ModContent.ItemType<TheCommunity>(), 10);
}
public override bool CheckActive()
+1 -3
View File
@@ -1,4 +1,4 @@
using CalamityMod.Events;
using CalamityMod.Events;
using Microsoft.Xna.Framework;
using System.IO;
using Terraria;
@@ -115,8 +115,6 @@ namespace CalamityMod.NPCs.Leviathan
player.AddBuff(BuffID.Frostburn, 240, true);
}
public override bool PreNPCLoot() => false;
public override void HitEffect(int hitDirection, double damage)
{
for (int k = 0; k < 5; k++)