more code cleanup
This commit is contained in:
1 parent
da3967b745
commit
efcdba29c1
7 files changed
+51
-43
No files matched your search
@@ -262,29 +262,12 @@ namespace CalamityMod.NPCs.SunkenSea
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.npcFrameCount[Type] = 8;
|
||||
Main.npcCatchable[Type] = true;
|
||||
NPCID.Sets.CountsAsCritter[Type] = true;
|
||||
this.HideFromBestiary();
|
||||
base.SetStaticDefaults();
|
||||
}
|
||||
public override void SetDefaults()
|
||||
{
|
||||
NPC.npcSlots = 0.1f;
|
||||
NPC.noGravity = true;
|
||||
NPC.damage = 0;
|
||||
NPC.width = 40;
|
||||
NPC.height = 32;
|
||||
NPC.defense = 0;
|
||||
NPC.lifeMax = 5;
|
||||
NPC.aiStyle = -1;
|
||||
AIType = -1;
|
||||
NPC.HitSound = SoundID.NPCHit1;
|
||||
NPC.DeathSound = SoundID.NPCDeath1;
|
||||
//Banner = NPC.type;
|
||||
//BannerItem = ModContent.ItemType<AlphaSeaMinnowBanner>();
|
||||
NPC.chaseable = false;
|
||||
SpawnModBiomes = new int[1] { ModContent.GetInstance<SunkenSeaBiome>().Type };
|
||||
base.SetDefaults();
|
||||
NPC.rarity = 3;
|
||||
NPC.catchItem = ModContent.ItemType<AlphaSeaMinnowGoldItem>();
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using CalamityMod.BiomeManagers;
|
||||
using CalamityMod.Enums;
|
||||
using CalamityMod.Items.Accessories;
|
||||
using CalamityMod.Items.Critters;
|
||||
using CalamityMod.Items.Fishing.SunkenSeaCatches;
|
||||
@@ -20,7 +22,7 @@ using Terraria.ModLoader.Utilities;
|
||||
|
||||
namespace CalamityMod.NPCs.SunkenSea
|
||||
{
|
||||
public class BabyGhostBell : ModNPC
|
||||
public class BabyGhostBell : SunkenSeaNPC
|
||||
{
|
||||
public bool hasBeenHit = false;
|
||||
public static Texture2D RadiantTexture;
|
||||
@@ -39,7 +41,11 @@ namespace CalamityMod.NPCs.SunkenSea
|
||||
Gold = 5
|
||||
}
|
||||
|
||||
public static Asset<Texture2D> GlowTexture;
|
||||
protected override List<int> PreyIDs => new List<int>();
|
||||
|
||||
protected override List<int> PredatorIDs => new List<int>();
|
||||
|
||||
protected override SunkenSeaBiomeFlags BiomeDesignation => SunkenSeaBiomeFlags.GleamingBurrows;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
@@ -252,7 +258,7 @@ namespace CalamityMod.NPCs.SunkenSea
|
||||
|
||||
public override float SpawnChance(NPCSpawnInfo spawnInfo)
|
||||
{
|
||||
if (spawnInfo.Player.Calamity().ZoneSunkenSea && spawnInfo.Water && !spawnInfo.Player.Calamity().clamity)
|
||||
if (spawnInfo.Player.Calamity().ZoneGleamingBurrows && spawnInfo.Water && !spawnInfo.Player.Calamity().clamity)
|
||||
{
|
||||
return SpawnCondition.CaveJellyfish.Chance * 1.5f;
|
||||
}
|
||||
|
||||
@@ -353,7 +353,7 @@ namespace CalamityMod.NPCs.SunkenSea
|
||||
|
||||
public override float SpawnChance(NPCSpawnInfo spawnInfo)
|
||||
{
|
||||
if (spawnInfo.Player.Calamity().ZoneSunkenSea && spawnInfo.Water && !spawnInfo.Player.Calamity().clamity)
|
||||
if (spawnInfo.Player.Calamity().ZonePolypForest && spawnInfo.Water && !spawnInfo.Player.Calamity().clamity)
|
||||
{
|
||||
return SpawnCondition.CaveJellyfish.Chance * 0.9f;
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ using Terraria.DataStructures;
|
||||
using Terraria.GameContent;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ModLoader.Utilities;
|
||||
using static CalamityMod.CalamityUtils;
|
||||
using static Terraria.ModLoader.ModContent;
|
||||
|
||||
@@ -40,7 +41,7 @@ namespace CalamityMod.NPCs.SunkenSea
|
||||
[
|
||||
// NPCType<IlmerianAxolotl>(),
|
||||
NPCType<Sharkoon>(),
|
||||
// NPCType<Polyperil>(),
|
||||
NPCType<Polyperil>(),
|
||||
// NPCType<CrestedStalker>(),
|
||||
// NPCType<Hermititan>(),
|
||||
];
|
||||
@@ -352,6 +353,8 @@ namespace CalamityMod.NPCs.SunkenSea
|
||||
}
|
||||
}
|
||||
|
||||
public override bool CanBeHitByNPC(NPC attacker) => PredatorIDs.Contains(attacker.type);
|
||||
|
||||
#endregion
|
||||
|
||||
#region Drawing & Animation
|
||||
@@ -419,6 +422,16 @@ namespace CalamityMod.NPCs.SunkenSea
|
||||
NPC.Calamity().VulnerableToWater = false;
|
||||
}
|
||||
|
||||
public override float SpawnChance(NPCSpawnInfo spawnInfo)
|
||||
{
|
||||
if (spawnInfo.Water && !spawnInfo.Player.Calamity().clamity)
|
||||
{
|
||||
if (spawnInfo.Player.Calamity().ZoneRadiantReefs)
|
||||
return SpawnCondition.CaveJellyfish.Chance * 0.3f;
|
||||
}
|
||||
return 0f;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Syncing
|
||||
@@ -464,5 +477,15 @@ namespace CalamityMod.NPCs.SunkenSea
|
||||
Gore.NewGoreDirect(NPC.GetSource_Death(), NPC.Center, new Vector2(hit.HitDirection, -1f), Mod.Find<ModGore>($"{Name}{i + 1}").Type);
|
||||
}
|
||||
}
|
||||
|
||||
public override float SpawnChance(NPCSpawnInfo spawnInfo)
|
||||
{
|
||||
if (spawnInfo.Water && !spawnInfo.Player.Calamity().clamity)
|
||||
{
|
||||
if (spawnInfo.Player.Calamity().ZoneRadiantReefs)
|
||||
return SpawnCondition.CaveJellyfish.Chance * 0.015f;
|
||||
}
|
||||
return 0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -570,7 +570,7 @@ namespace CalamityMod.NPCs.SunkenSea
|
||||
|
||||
public override float SpawnChance(NPCSpawnInfo spawnInfo)
|
||||
{
|
||||
if (Main.hardMode && spawnInfo.Player.Calamity().ZoneSunkenSea && spawnInfo.Water &&
|
||||
if (Main.hardMode && spawnInfo.Player.Calamity().ZonePolypForest && spawnInfo.Water &&
|
||||
!NPC.AnyNPCs(ModContent.NPCType<SandProwler>()) && !spawnInfo.Player.Calamity().clamity && !spawnInfo.PlayerSafe)
|
||||
return SpawnCondition.CaveJellyfish.Chance * 0.3f;
|
||||
|
||||
|
||||
@@ -300,32 +300,17 @@ namespace CalamityMod.NPCs.SunkenSea
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.npcFrameCount[Type] = 8;
|
||||
Main.npcCatchable[Type] = true;
|
||||
NPCID.Sets.CountsAsCritter[Type] = true;
|
||||
this.HideFromBestiary();
|
||||
base.SetStaticDefaults();
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
NPC.npcSlots = 0.1f;
|
||||
NPC.noGravity = true;
|
||||
NPC.damage = 0;
|
||||
NPC.width = 36;
|
||||
NPC.height = 22;
|
||||
NPC.defense = 0;
|
||||
NPC.lifeMax = 5;
|
||||
NPC.aiStyle = -1;
|
||||
AIType = -1;
|
||||
NPC.HitSound = SoundID.NPCHit1;
|
||||
NPC.DeathSound = SoundID.NPCDeath1;
|
||||
Banner = NPC.type;
|
||||
BannerItem = ModContent.ItemType<SeaMinnowBanner>();
|
||||
NPC.chaseable = false;
|
||||
NPC.catchItem = (short)ModContent.ItemType<SeaMinnowGoldItem>();
|
||||
SpawnModBiomes = new int[1] { ModContent.GetInstance<SunkenSeaBiome>().Type };
|
||||
base.SetDefaults();
|
||||
NPC.catchItem = (short)ModContent.ItemType<SeaMinnowItem>();
|
||||
NPC.rarity = 3;
|
||||
}
|
||||
|
||||
public override void HitEffect(NPC.HitInfo hit)
|
||||
{
|
||||
for (int k = 0; k < 5; k++)
|
||||
|
||||
@@ -13,6 +13,7 @@ using Terraria.DataStructures;
|
||||
using Terraria.GameContent;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ModLoader.Utilities;
|
||||
using static CalamityMod.CalamityUtils;
|
||||
using static Terraria.ModLoader.ModContent;
|
||||
|
||||
@@ -519,6 +520,16 @@ namespace CalamityMod.NPCs.SunkenSea
|
||||
}
|
||||
}
|
||||
|
||||
public override float SpawnChance(NPCSpawnInfo spawnInfo)
|
||||
{
|
||||
if (spawnInfo.Water && !spawnInfo.Player.Calamity().clamity)
|
||||
{
|
||||
if (spawnInfo.Player.Calamity().ZoneRadiantReefs)
|
||||
return SpawnCondition.CaveJellyfish.Chance * 0.2f;
|
||||
}
|
||||
return 0f;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Drawing & Animation
|
||||
|
||||
Reference in new issue
Block a user