Fixed Lava Slime config
This commit is contained in:
1 parent
e2a160834b
commit
7752d55e5a
6 files changed
+21
-84
No files matched your search
@@ -139,6 +139,7 @@ namespace CalamityMod.ILEditing
|
||||
IL_WorldGen.MakeDungeon += ChangeDungeonSpikeQuantities;
|
||||
|
||||
// Removal of vanilla stupidity
|
||||
IL_NPC.VanillaHitEffect += PreventLavaSlimeLavaDrop;
|
||||
IL_Player.UpdateBuffs += RemoveFeralBiteRandomDebuffs;
|
||||
IL_Sandstorm.HasSufficientWind += DecreaseSandstormWindSpeedRequirement;
|
||||
IL_Item.TryGetPrefixStatMultipliersForItem += RelaxPrefixRequirements;
|
||||
|
||||
@@ -121,6 +121,25 @@ namespace CalamityMod.ILEditing
|
||||
}
|
||||
#endregion Prevention of Slime Rain Spawns When Near Bosses
|
||||
|
||||
#region Prevent Lava Slime Dropping Lava
|
||||
private static void PreventLavaSlimeLavaDrop(ILContext il)
|
||||
{
|
||||
// Disable Lava Slimes dropping lava if its respective config is enabled.
|
||||
var cursor = new ILCursor(il);
|
||||
|
||||
// Go to the check for Remix world.
|
||||
if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdsfld<Main>("remixWorld")))
|
||||
{
|
||||
LogFailure("Prevent Lava Slime Dropping Lava", "Could not find the check for Remix World.");
|
||||
return;
|
||||
}
|
||||
|
||||
// Add an additional check for the config.
|
||||
cursor.Remove();
|
||||
cursor.EmitDelegate<Func<bool>>(() => CalamityConfig.Instance.RemoveLavaDropsFromLavaSlimes || Main.remixWorld);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Remove Feral Bite Random Debuffs
|
||||
private static void RemoveFeralBiteRandomDebuffs(ILContext il)
|
||||
{
|
||||
|
||||
@@ -314,7 +314,7 @@ CalamityConfig: {
|
||||
|
||||
RemoveLavaDropsFromLavaSlimes: {
|
||||
Label: "[i:LavaWaders] Remove Lava Drops From Lava Slimes"
|
||||
Tooltip: When enabled, Lava Slimes will be replaced with a new Lava Slime that no longer drops lava.
|
||||
Tooltip: When enabled, Lava Slimes will be prevented from dropping lava in Expert Mode.
|
||||
}
|
||||
|
||||
RemoveReforgeRNG: {
|
||||
|
||||
@@ -6127,13 +6127,6 @@ namespace CalamityMod.NPCs
|
||||
spawnInfo.Player.Calamity().ZoneSunkenSea ||
|
||||
(spawnInfo.Player.Calamity().ZoneAstral && !spawnInfo.Player.PillarZone());
|
||||
|
||||
// Replace vanilla Lava Slimes with Calamity Lava Slimes to avoid annoying lava drops
|
||||
if (spawnInfo.Player.ZoneUnderworldHeight && !calamityBiomeZone && CalamityConfig.Instance.RemoveLavaDropsFromLavaSlimes && Main.expertMode)
|
||||
{
|
||||
pool.Add(NPCType<LavaSlimeNoLavaDrop>(), SpawnCondition.Underworld.Chance);
|
||||
pool.Remove(NPCID.LavaSlime);
|
||||
}
|
||||
|
||||
// Spawn Green Jellyfish in prehm and Blue Jellyfish in hardmode
|
||||
if (spawnInfo.Player.ZoneRockLayerHeight && spawnInfo.Water && !calamityBiomeZone)
|
||||
{
|
||||
|
||||
@@ -1,75 +0,0 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.NPCs.NormalNPCs
|
||||
{
|
||||
public class LavaSlimeNoLavaDrop : ModNPC
|
||||
{
|
||||
public override string Texture => $"Terraria/Images/NPC_{NPCID.LavaSlime}";
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.npcFrameCount[NPC.type] = 2;
|
||||
this.HideFromBestiary();
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
NPC.aiStyle = NPCAIStyleID.Slime;
|
||||
AIType = NPCID.LavaSlime;
|
||||
AnimationType = NPCID.LavaSlime;
|
||||
NPC.width = 24;
|
||||
NPC.height = 18;
|
||||
NPC.damage = 15;
|
||||
NPC.defense = 10;
|
||||
NPC.lifeMax = 50;
|
||||
NPC.HitSound = SoundID.NPCHit1;
|
||||
NPC.DeathSound = SoundID.NPCDeath1;
|
||||
NPC.scale = 1.1f;
|
||||
NPC.alpha = 50;
|
||||
NPC.lavaImmune = true;
|
||||
NPC.value = 120f;
|
||||
if (Main.remixWorld)
|
||||
{
|
||||
NPC.damage = 7;
|
||||
NPC.defense = 2;
|
||||
NPC.lifeMax = 25;
|
||||
NPC.value = 25f;
|
||||
}
|
||||
//Banner = NPCID.LavaSlime;
|
||||
//BannerItem = ItemID.LavaSlimeBanner;
|
||||
|
||||
NPC.Calamity().VulnerableToCold = true;
|
||||
NPC.Calamity().VulnerableToSickness = false;
|
||||
NPC.Calamity().VulnerableToHeat = false;
|
||||
NPC.Calamity().VulnerableToWater = true;
|
||||
|
||||
// Scale stats in Expert and Master
|
||||
CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC);
|
||||
CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC);
|
||||
}
|
||||
|
||||
public override void HitEffect(NPC.HitInfo hit)
|
||||
{
|
||||
if (NPC.life > 0)
|
||||
{
|
||||
for (int i = 0; (double)i < hit.Damage / (double)NPC.lifeMax * 80D; i++)
|
||||
{
|
||||
int dust = Dust.NewDust(NPC.position, NPC.width, NPC.height, 6, hit.HitDirection * 2, -1f, NPC.alpha, default, 1.5f);
|
||||
if (Main.rand.Next(8) != 0)
|
||||
Main.dust[dust].noGravity = true;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < 40; i++)
|
||||
{
|
||||
int dust = Dust.NewDust(NPC.position, NPC.width, NPC.height, 6, hit.HitDirection * 2, -1f, NPC.alpha, default, 1.5f);
|
||||
if (Main.rand.Next(8) != 0)
|
||||
Main.dust[dust].noGravity = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,6 @@ namespace CalamityMod.Systems
|
||||
// Manually register variants post-initiailization
|
||||
ContentSamples.NpcBestiaryCreditIdsByNpcNetIds[NPCType<AstralachneaGround>()] = ContentSamples.NpcBestiaryCreditIdsByNpcNetIds[NPCType<AstralachneaWall>()];
|
||||
ContentSamples.NpcBestiaryCreditIdsByNpcNetIds[NPCType<DevilFishAlt>()] = ContentSamples.NpcBestiaryCreditIdsByNpcNetIds[NPCType<DevilFish>()];
|
||||
ContentSamples.NpcBestiaryCreditIdsByNpcNetIds[NPCType<LavaSlimeNoLavaDrop>()] = ContentSamples.NpcBestiaryCreditIdsByNpcNetIds[NPCID.LavaSlime];
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user