Handful of missed cases
This commit is contained in:
1 parent
04817b2160
commit
cc52e63fbb
13 files changed
+87
-112
No files matched your search
@@ -132,10 +132,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, 3, 4);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -106,16 +106,14 @@ namespace CalamityMod.NPCs.Crabulon
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool PreNPCLoot()
|
||||
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);
|
||||
Item.NewItem(NPC.GetItemSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void HitEffect(int hitDirection, double damage)
|
||||
|
||||
+54
-57
@@ -21,15 +21,16 @@ using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.Audio;
|
||||
using Terraria.GameContent.ItemDropRules;
|
||||
/* states:
|
||||
* 0 = slow drift
|
||||
* 1 = reelback and teleport after spawn enemy
|
||||
* 2 = reelback for spin lunge + death legacy
|
||||
* 3 = spin lunge
|
||||
* 4 = semicircle spawn arc
|
||||
* 5 = raindash
|
||||
* 6 = deceleration
|
||||
*/
|
||||
* 0 = slow drift
|
||||
* 1 = reelback and teleport after spawn enemy
|
||||
* 2 = reelback for spin lunge + death legacy
|
||||
* 3 = spin lunge
|
||||
* 4 = semicircle spawn arc
|
||||
* 5 = raindash
|
||||
* 6 = deceleration
|
||||
*/
|
||||
|
||||
namespace CalamityMod.NPCs.HiveMind
|
||||
{
|
||||
@@ -107,7 +108,6 @@ namespace CalamityMod.NPCs.HiveMind
|
||||
NPC.HitSound = SoundID.NPCHit1;
|
||||
NPC.DeathSound = SoundID.NPCDeath1;
|
||||
Music = CalamityMod.Instance.GetMusicFromMusicMod("HiveMind") ?? MusicID.Boss2;
|
||||
bossBag = ModContent.ItemType<HiveMindBag>();
|
||||
|
||||
if (Main.expertMode)
|
||||
{
|
||||
@@ -549,15 +549,10 @@ namespace CalamityMod.NPCs.HiveMind
|
||||
int tilePosX = (int)NPC.Center.X / 16;
|
||||
int tilePosY = (int)(NPC.position.Y + NPC.height) / 16 + 1;
|
||||
|
||||
if (Main.tile[tilePosX, tilePosY] == null)
|
||||
Main.tile[tilePosX, tilePosY] = new Tile();
|
||||
|
||||
while (!(Main.tile[tilePosX, tilePosY].HasUnactuatedTile && Main.tileSolid[Main.tile[tilePosX, tilePosY].TileType]))
|
||||
{
|
||||
tilePosY++;
|
||||
NPC.position.Y += 16;
|
||||
if (Main.tile[tilePosX, tilePosY] == null)
|
||||
Main.tile[tilePosX, tilePosY] = new Tile();
|
||||
}
|
||||
}
|
||||
NPC.netUpdate = true;
|
||||
@@ -1010,7 +1005,7 @@ namespace CalamityMod.NPCs.HiveMind
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient && Main.rand.NextBool(15) && NPC.CountNPCS(ModContent.NPCType<HiveBlob2>()) < 2)
|
||||
{
|
||||
Vector2 spawnAt = NPC.Center + new Vector2(0f, NPC.height / 2f);
|
||||
NPC.NewNPC((int)spawnAt.X, (int)spawnAt.Y, ModContent.NPCType<HiveBlob2>());
|
||||
NPC.NewNPC(NPC.GetSpawnSource_NPCHurt(), (int)spawnAt.X, (int)spawnAt.Y, ModContent.NPCType<HiveBlob2>());
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1020,13 +1015,13 @@ namespace CalamityMod.NPCs.HiveMind
|
||||
if (Main.rand.NextBool(60) && Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
Vector2 spawnAt = NPC.Center + new Vector2(0f, NPC.height / 2f);
|
||||
NPC.NewNPC((int)spawnAt.X, (int)spawnAt.Y, NPCID.EaterofSouls);
|
||||
NPC.NewNPC(NPC.GetSpawnSource_NPCHurt(), (int)spawnAt.X, (int)spawnAt.Y, NPCID.EaterofSouls);
|
||||
}
|
||||
|
||||
if (Main.rand.NextBool(150) && Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
Vector2 spawnAt = NPC.Center + new Vector2(0f, NPC.height / 2f);
|
||||
NPC.NewNPC((int)spawnAt.X, (int)spawnAt.Y, NPCID.DevourerHead);
|
||||
NPC.NewNPC(NPC.GetSpawnSource_NPCHurt(), (int)spawnAt.X, (int)spawnAt.Y, NPCID.DevourerHead);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1072,49 +1067,10 @@ namespace CalamityMod.NPCs.HiveMind
|
||||
potionType = ItemID.HealingPotion;
|
||||
}
|
||||
|
||||
public override void NPCLoot()
|
||||
public override void OnKill()
|
||||
{
|
||||
CalamityGlobalNPC.SetNewBossJustDowned(NPC);
|
||||
|
||||
DropHelper.DropBags(NPC);
|
||||
|
||||
DropHelper.DropItemChance(NPC, ModContent.ItemType<HiveMindTrophy>(), 10);
|
||||
DropHelper.DropItemCondition(NPC, ModContent.ItemType<KnowledgeHiveMind>(), true, !DownedBossSystem.downedHiveMind);
|
||||
|
||||
CalamityGlobalNPC.SetNewShopVariable(new int[] { NPCID.Dryad }, DownedBossSystem.downedHiveMind);
|
||||
|
||||
// All other drops are contained in the bag, so they only drop directly on Normal
|
||||
if (!Main.expertMode)
|
||||
{
|
||||
// Materials
|
||||
DropHelper.DropItemSpray(NPC, ModContent.ItemType<TrueShadowScale>(), 25, 30, 5);
|
||||
DropHelper.DropItemSpray(NPC, ItemID.DemoniteBar, 8, 12, 2);
|
||||
DropHelper.DropItemSpray(NPC, ItemID.RottenChunk, 9, 15, 3);
|
||||
if (Main.hardMode)
|
||||
DropHelper.DropItemSpray(NPC, ItemID.CursedFlame, 10, 20, 2);
|
||||
DropHelper.DropItem(NPC, ItemID.CorruptSeeds, 10, 15);
|
||||
|
||||
// Weapons
|
||||
float w = DropHelper.NormalWeaponDropRateFloat;
|
||||
DropHelper.DropEntireWeightedSet(NPC,
|
||||
DropHelper.WeightStack<PerfectDark>(w),
|
||||
DropHelper.WeightStack<LeechingDagger>(w),
|
||||
DropHelper.WeightStack<Shadethrower>(w),
|
||||
DropHelper.WeightStack<ShadowdropStaff>(w),
|
||||
DropHelper.WeightStack<ShaderainStaff>(w),
|
||||
DropHelper.WeightStack<DankStaff>(w),
|
||||
DropHelper.WeightStack<RotBall>(w, 30, 50),
|
||||
DropHelper.WeightStack<FilthyGlove>(w)
|
||||
);
|
||||
|
||||
// Equipment
|
||||
DropHelper.DropItem(NPC, ModContent.ItemType<RottenBrain>(), true);
|
||||
|
||||
// Vanity
|
||||
DropHelper.DropItemChance(NPC, ModContent.ItemType<HiveMindMask>(), 7);
|
||||
DropHelper.DropItemChance(NPC, ModContent.ItemType<RottingEyeball>(), 10);
|
||||
}
|
||||
|
||||
// If neither The Hive Mind nor The Perforator Hive have been killed yet, notify players of Aerialite Ore
|
||||
if (!DownedBossSystem.downedHiveMind && !DownedBossSystem.downedPerforator)
|
||||
{
|
||||
@@ -1129,5 +1085,46 @@ namespace CalamityMod.NPCs.HiveMind
|
||||
DownedBossSystem.downedHiveMind = true;
|
||||
CalamityNetcode.SyncWorld();
|
||||
}
|
||||
|
||||
public override void ModifyNPCLoot(NPCLoot npcLoot)
|
||||
{
|
||||
npcLoot.Add(ItemDropRule.BossBag(ModContent.ItemType<HiveMindBag>()));
|
||||
|
||||
npcLoot.Add(ModContent.ItemType<HiveMindTrophy>(), 10);
|
||||
npcLoot.AddIf(() => !DownedBossSystem.downedHiveMind, ModContent.ItemType<KnowledgeHiveMind>());
|
||||
|
||||
// Normal drops: Everything that would otherwise be in the bag
|
||||
var normalOnly = npcLoot.DefineNormalOnlyDropSet();
|
||||
{
|
||||
// Weapons
|
||||
int[] weapons = new int[]
|
||||
{
|
||||
ModContent.ItemType<PerfectDark>(),
|
||||
ModContent.ItemType<LeechingDagger>(),
|
||||
ModContent.ItemType<SausageMaker>(),
|
||||
ModContent.ItemType<Shadethrower>(),
|
||||
ModContent.ItemType<ShadowdropStaff>(),
|
||||
ModContent.ItemType<ShaderainStaff>(),
|
||||
ModContent.ItemType<DankStaff>(),
|
||||
ModContent.ItemType<FilthyGlove>(),
|
||||
};
|
||||
normalOnly.Add(ItemDropRule.OneFromOptions(DropHelper.NormalWeaponDropRateInt, weapons));
|
||||
normalOnly.Add(ModContent.ItemType<RotBall>(), 1, 30, 50);
|
||||
|
||||
// Materials
|
||||
normalOnly.Add(ItemID.DemoniteBar, 1, 12, 15);
|
||||
normalOnly.Add(ItemID.RottenChunk, 1, 12, 15);
|
||||
normalOnly.Add(ItemID.CorruptSeeds, 1, 12, 15);
|
||||
normalOnly.Add(ModContent.ItemType<TrueShadowScale>(), 1, 25, 30);
|
||||
normalOnly.Add(ItemDropRule.ByCondition(new Conditions.IsHardmode(), ItemID.CursedFlame, 1, 10, 20));
|
||||
|
||||
// Equipment
|
||||
normalOnly.Add(ModContent.ItemType<RottenBrain>());
|
||||
|
||||
// Vanity
|
||||
normalOnly.Add(ModContent.ItemType<HiveMindMask>(), 7);
|
||||
normalOnly.Add(ModContent.ItemType<RottingEyeball>(), 10);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -211,11 +211,6 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
player.AddBuff(ModContent.BuffType<HolyFlames>(), 120, true);
|
||||
}
|
||||
|
||||
public override void NPCLoot()
|
||||
{
|
||||
DropHelper.DropItemCondition(NPC, ModContent.ItemType<EssenceofCinder>(), Main.hardMode, 3, 1, 1);
|
||||
}
|
||||
|
||||
public override void ModifyNPCLoot(NPCLoot npcLoot)
|
||||
{
|
||||
npcLoot.AddIf(() => Main.hardMode, ModContent.ItemType<EssenceofCinder>(), 3);
|
||||
|
||||
@@ -185,11 +185,6 @@ namespace CalamityMod.NPCs.Perforator
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool PreNPCLoot()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void OnHitPlayer(Player player, int damage, bool crit)
|
||||
{
|
||||
player.AddBuff(ModContent.BuffType<BurningBlood>(), 90, true);
|
||||
|
||||
@@ -183,16 +183,14 @@ namespace CalamityMod.NPCs.Perforator
|
||||
return false;
|
||||
}
|
||||
|
||||
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 OnHitPlayer(Player player, int damage, bool crit)
|
||||
|
||||
@@ -184,11 +184,6 @@ namespace CalamityMod.NPCs.Perforator
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool PreNPCLoot()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void OnHitPlayer(Player player, int damage, bool crit)
|
||||
{
|
||||
player.AddBuff(ModContent.BuffType<BurningBlood>(), 60, true);
|
||||
|
||||
@@ -139,8 +139,6 @@ namespace CalamityMod.NPCs.Signus
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool PreNPCLoot() => false;
|
||||
|
||||
public override bool CanHitPlayer(Player target, ref int cooldownSlot)
|
||||
{
|
||||
cooldownSlot = 1;
|
||||
|
||||
@@ -199,8 +199,6 @@ namespace CalamityMod.NPCs.Signus
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool PreNPCLoot() => false;
|
||||
|
||||
public override bool CheckDead()
|
||||
{
|
||||
SoundEngine.PlaySound(SoundID.Item, (int)NPC.position.X, (int)NPC.position.Y, 14);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using CalamityMod.Events;
|
||||
using CalamityMod.Events;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
@@ -27,7 +27,7 @@ namespace CalamityMod.NPCs.SlimeGod
|
||||
NPC.lifeMax = 10000;
|
||||
}
|
||||
NPC.knockBackResist = 0f;
|
||||
animationType = 121;
|
||||
AnimationType = 121;
|
||||
NPC.alpha = 55;
|
||||
NPC.lavaImmune = false;
|
||||
NPC.noGravity = false;
|
||||
@@ -39,14 +39,12 @@ namespace CalamityMod.NPCs.SlimeGod
|
||||
NPC.Calamity().VulnerableToSickness = false;
|
||||
}
|
||||
|
||||
public override bool PreNPCLoot() => false;
|
||||
|
||||
public override void HitEffect(int hitDirection, double damage)
|
||||
{
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient && NPC.life <= 0)
|
||||
{
|
||||
Vector2 spawnAt = NPC.Center + new Vector2(0f, (float)NPC.height / 2f);
|
||||
NPC.NewNPC((int)spawnAt.X, (int)spawnAt.Y, ModContent.NPCType<SlimeSpawnCorrupt2>());
|
||||
NPC.NewNPC(NPC.GetItemSource_Loot(), (int)spawnAt.X, (int)spawnAt.Y, ModContent.NPCType<SlimeSpawnCorrupt2>());
|
||||
}
|
||||
for (int k = 0; k < 5; k++)
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using CalamityMod.Events;
|
||||
using CalamityMod.Events;
|
||||
using CalamityMod.World;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
@@ -27,7 +27,7 @@ namespace CalamityMod.NPCs.SlimeGod
|
||||
NPC.lifeMax = 5000;
|
||||
}
|
||||
NPC.knockBackResist = 0f;
|
||||
animationType = NPCID.CorruptSlime;
|
||||
AnimationType = NPCID.CorruptSlime;
|
||||
NPC.alpha = 55;
|
||||
NPC.lavaImmune = false;
|
||||
NPC.noGravity = false;
|
||||
@@ -54,18 +54,19 @@ namespace CalamityMod.NPCs.SlimeGod
|
||||
}
|
||||
}
|
||||
|
||||
public override bool PreNPCLoot()
|
||||
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);
|
||||
Item.NewItem(NPC.GetItemSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart);
|
||||
}
|
||||
}
|
||||
|
||||
DropHelper.DropItemChance(NPC, ItemID.Vitamins, Main.expertMode ? 50 : 100);
|
||||
|
||||
return false;
|
||||
public override void ModifyNPCLoot(NPCLoot npcLoot)
|
||||
{
|
||||
npcLoot.Add(ItemID.Vitamins, 50);
|
||||
}
|
||||
|
||||
public override void OnHitPlayer(Player player, int damage, bool crit)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using CalamityMod.Events;
|
||||
using CalamityMod.Events;
|
||||
using CalamityMod.World;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
@@ -27,7 +27,7 @@ namespace CalamityMod.NPCs.SlimeGod
|
||||
NPC.lifeMax = 10000;
|
||||
}
|
||||
NPC.knockBackResist = 0f;
|
||||
animationType = NPCID.CorruptSlime;
|
||||
AnimationType = NPCID.CorruptSlime;
|
||||
NPC.alpha = 55;
|
||||
NPC.lavaImmune = false;
|
||||
NPC.noGravity = false;
|
||||
@@ -54,18 +54,19 @@ namespace CalamityMod.NPCs.SlimeGod
|
||||
}
|
||||
}
|
||||
|
||||
public override bool PreNPCLoot()
|
||||
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);
|
||||
Item.NewItem(NPC.GetItemSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart);
|
||||
}
|
||||
}
|
||||
|
||||
DropHelper.DropItemChance(NPC, ItemID.Blindfold, Main.expertMode ? 50 : 100);
|
||||
|
||||
return false;
|
||||
public override void ModifyNPCLoot(NPCLoot npcLoot)
|
||||
{
|
||||
npcLoot.Add(ItemID.Blindfold, 50);
|
||||
}
|
||||
|
||||
public override void OnHitPlayer(Player player, int damage, bool crit)
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace CalamityMod.NPCs.SlimeGod
|
||||
int frameY = 1;
|
||||
if (!Main.dedServ)
|
||||
{
|
||||
if (!Main.NPCLoaded[NPC.type] || TextureAssets.Npc[NPC.type].Value is null)
|
||||
if (TextureAssets.Npc[NPC.type].Value is null)
|
||||
return;
|
||||
frameY = TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type];
|
||||
}
|
||||
@@ -143,18 +143,19 @@ namespace CalamityMod.NPCs.SlimeGod
|
||||
}
|
||||
}
|
||||
|
||||
public override bool PreNPCLoot()
|
||||
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);
|
||||
Item.NewItem(NPC.GetItemSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart);
|
||||
}
|
||||
}
|
||||
|
||||
DropHelper.DropItemChance(NPC, ItemID.Blindfold, Main.expertMode ? 50 : 100);
|
||||
|
||||
return false;
|
||||
public override void ModifyNPCLoot(NPCLoot npcLoot)
|
||||
{
|
||||
npcLoot.Add(ItemID.Blindfold, 50);
|
||||
}
|
||||
|
||||
public override void OnHitPlayer(Player player, int damage, bool crit)
|
||||
|
||||
Reference in new issue
Block a user