Removed Sun bats and Phantom Debris
This commit is contained in:
1 parent
82427fa2a0
commit
7482b348fd
8 files changed
+2
-497
No files matched your search
@@ -805,7 +805,6 @@ namespace CalamityMod
|
||||
NPCType<MantisShrimp>(),
|
||||
NPCType<OverloadedSoldier>(),
|
||||
NPCType<PerennialSlime>(),
|
||||
NPCType<PhantomDebris>(),
|
||||
NPCType<Rotdog>(),
|
||||
NPCType<Scryllar>(),
|
||||
NPCType<ScryllarRage>(),
|
||||
@@ -813,7 +812,6 @@ namespace CalamityMod
|
||||
NPCType<StellarCulex>(),
|
||||
NPCType<StormlionCharger>(),
|
||||
NPCType<SuperDummyNPC>(),
|
||||
NPCType<SunBat>(),
|
||||
NPCType<WulfrumGyrator>(),
|
||||
NPCType<WulfrumRover>()
|
||||
};
|
||||
|
||||
@@ -5321,7 +5321,7 @@ namespace CalamityMod.NPCs
|
||||
#region Bat AI
|
||||
public static bool BuffedBatAI(NPC npc, Mod mod)
|
||||
{
|
||||
if (npc.type == NPCID.Hellbat || npc.type == NPCID.Lavabat || npc.type == ModContent.NPCType<SunBat>())
|
||||
if (npc.type == NPCID.Hellbat || npc.type == NPCID.Lavabat)
|
||||
{
|
||||
int num203 = Dust.NewDust(npc.position, npc.width, npc.height, 6, npc.velocity.X * 0.2f, npc.velocity.Y * 0.2f, 100, default(Color), 2f);
|
||||
Main.dust[num203].noGravity = true;
|
||||
@@ -5431,7 +5431,6 @@ namespace CalamityMod.NPCs
|
||||
npc.type == NPCID.IceBat ||
|
||||
npc.type == NPCID.Lavabat ||
|
||||
npc.type == NPCID.GiantFlyingFox ||
|
||||
npc.type == ModContent.NPCType<SunBat>() ||
|
||||
npc.type == ModContent.NPCType<PlaguedFlyingFox>())
|
||||
{
|
||||
maxSpeedX = 6f;
|
||||
|
||||
@@ -3254,7 +3254,7 @@ namespace CalamityMod.NPCs
|
||||
}
|
||||
break;
|
||||
case 14:
|
||||
if (npc.type == NPCType<StellarCulex>() || npc.type == NPCType<PlaguedFlyingFox>() || npc.type == NPCType<AeroSlime>() || npc.type == NPCType<SunBat>())
|
||||
if (npc.type == NPCType<StellarCulex>() || npc.type == NPCType<PlaguedFlyingFox>() || npc.type == NPCType<AeroSlime>())
|
||||
{
|
||||
return CalamityGlobalAI.BuffedBatAI(npc, Mod);
|
||||
}
|
||||
|
||||
@@ -1,388 +0,0 @@
|
||||
using System;
|
||||
using Microsoft.Xna.Framework;
|
||||
using CalamityMod.Buffs.StatDebuffs;
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Placeables.Banners;
|
||||
using CalamityMod.World;
|
||||
using Terraria;
|
||||
using Terraria.GameContent.Bestiary;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ModLoader.Utilities;
|
||||
|
||||
namespace CalamityMod.NPCs.NormalNPCs
|
||||
{
|
||||
public class PhantomDebris : ModNPC
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Phantom Debris");
|
||||
Main.npcFrameCount[NPC.type] = 4;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
NPC.damage = NPC.downedMoonlord ? 60 : 30;
|
||||
NPC.width = 44;
|
||||
NPC.height = 22;
|
||||
NPC.defense = 20;
|
||||
NPC.DR_NERD(0.1f);
|
||||
NPC.lifeMax = NPC.downedMoonlord ? 1200 : 120;
|
||||
NPC.aiStyle = -1;
|
||||
AIType = -1;
|
||||
NPC.knockBackResist = 0f;
|
||||
NPC.value = Item.buyPrice(0, 0, 2, 0);
|
||||
NPC.HitSound = SoundID.NPCHit2;
|
||||
NPC.DeathSound = SoundID.NPCDeath36;
|
||||
Banner = NPC.type;
|
||||
BannerItem = ModContent.ItemType<PhantomDebrisBanner>();
|
||||
NPC.Calamity().VulnerableToSickness = false;
|
||||
NPC.Calamity().VulnerableToWater = true;
|
||||
}
|
||||
|
||||
public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry)
|
||||
{
|
||||
bestiaryEntry.Info.AddRange(new IBestiaryInfoElement[] {
|
||||
BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Underground,
|
||||
|
||||
// Will move to localization whenever that is cleaned up.
|
||||
new FlavorTextBestiaryInfoElement("Scraps of a soul, not enough to even feel anger, often fall from wayward spirits. These have enough autonomy to move about on their own.")
|
||||
});
|
||||
}
|
||||
|
||||
public override void FindFrame(int frameHeight)
|
||||
{
|
||||
NPC.frameCounter += (double)Math.Abs(NPC.velocity.X);
|
||||
if (NPC.frameCounter > 6.0)
|
||||
{
|
||||
NPC.frameCounter = 0.0;
|
||||
NPC.frame.Y = NPC.frame.Y + frameHeight;
|
||||
}
|
||||
if (NPC.velocity.Y == 0f)
|
||||
{
|
||||
if (NPC.direction == 1)
|
||||
NPC.spriteDirection = 1;
|
||||
if (NPC.direction == -1)
|
||||
NPC.spriteDirection = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
NPC.frameCounter = 0.0;
|
||||
NPC.frame.Y = 0;
|
||||
return;
|
||||
}
|
||||
if (NPC.velocity.X == 0f)
|
||||
{
|
||||
NPC.frameCounter = 0.0;
|
||||
NPC.frame.Y = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (NPC.frame.Y > frameHeight * 3)
|
||||
NPC.frame.Y = 0;
|
||||
}
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
Lighting.AddLight((int)((NPC.position.X + (float)(NPC.width / 2)) / 16f), (int)((NPC.position.Y + (float)(NPC.height / 2)) / 16f), 0.35f, 0f, 0.15f);
|
||||
bool flag3 = false;
|
||||
if (NPC.velocity.X == 0f)
|
||||
{
|
||||
flag3 = true;
|
||||
}
|
||||
if (NPC.justHit)
|
||||
{
|
||||
flag3 = false;
|
||||
}
|
||||
bool flag4 = false;
|
||||
bool flag5 = false;
|
||||
int num35 = 60;
|
||||
if (NPC.velocity.Y == 0f && ((NPC.velocity.X > 0f && NPC.direction < 0) || (NPC.velocity.X < 0f && NPC.direction > 0)))
|
||||
{
|
||||
flag4 = true;
|
||||
}
|
||||
if ((NPC.position.X == NPC.oldPosition.X || NPC.ai[3] >= (float)num35) | flag4)
|
||||
{
|
||||
NPC.ai[3] += 1f;
|
||||
}
|
||||
else if ((double)Math.Abs(NPC.velocity.X) > 0.9 && NPC.ai[3] > 0f)
|
||||
{
|
||||
NPC.ai[3] -= 1f;
|
||||
}
|
||||
if (NPC.ai[3] > (float)(num35 * 10))
|
||||
{
|
||||
NPC.ai[3] = 0f;
|
||||
}
|
||||
if (NPC.justHit)
|
||||
{
|
||||
NPC.ai[3] = 0f;
|
||||
}
|
||||
if (NPC.ai[3] == (float)num35)
|
||||
{
|
||||
NPC.netUpdate = true;
|
||||
}
|
||||
if (NPC.ai[3] < (float)num35)
|
||||
{
|
||||
NPC.TargetClosest(true);
|
||||
}
|
||||
else if (NPC.ai[2] <= 0f)
|
||||
{
|
||||
if (NPC.velocity.X == 0f)
|
||||
{
|
||||
if (NPC.velocity.Y == 0f)
|
||||
{
|
||||
NPC.ai[0] += 1f;
|
||||
if (NPC.ai[0] >= 2f)
|
||||
{
|
||||
NPC.direction *= -1;
|
||||
NPC.spriteDirection = NPC.direction;
|
||||
NPC.ai[0] = 0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
NPC.ai[0] = 0f;
|
||||
}
|
||||
if (NPC.direction == 0)
|
||||
{
|
||||
NPC.direction = 1;
|
||||
}
|
||||
}
|
||||
float num65 = 1.2f + ((Main.player[NPC.target].Center - NPC.Center).Length() * 0.005f);
|
||||
float num66 = 0.12f + ((Main.player[NPC.target].Center - NPC.Center).Length() * 0.0005f);
|
||||
if (CalamityWorld.death)
|
||||
{
|
||||
num65 *= 1.5f;
|
||||
num66 *= 1.5f;
|
||||
}
|
||||
if (NPC.velocity.X < -num65 || NPC.velocity.X > num65)
|
||||
{
|
||||
if (NPC.velocity.Y == 0f)
|
||||
NPC.velocity *= 0.7f;
|
||||
}
|
||||
else if (NPC.velocity.X < num65 && NPC.direction == 1)
|
||||
{
|
||||
NPC.velocity.X = NPC.velocity.X + num66;
|
||||
if (NPC.velocity.X > num65)
|
||||
NPC.velocity.X = num65;
|
||||
}
|
||||
else if (NPC.velocity.X > -num65 && NPC.direction == -1)
|
||||
{
|
||||
NPC.velocity.X = NPC.velocity.X - num66;
|
||||
if (NPC.velocity.X < -num65)
|
||||
NPC.velocity.X = -num65;
|
||||
}
|
||||
bool flag22 = false;
|
||||
if (NPC.velocity.Y == 0f)
|
||||
{
|
||||
int num161 = (int)(NPC.position.Y + (float)NPC.height + 7f) / 16;
|
||||
int arg_A8FB_0 = (int)NPC.position.X / 16;
|
||||
int num162 = (int)(NPC.position.X + (float)NPC.width) / 16;
|
||||
for (int num163 = arg_A8FB_0; num163 <= num162; num163++)
|
||||
{
|
||||
if (Main.tile[num163, num161] == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (Main.tile[num163, num161].HasUnactuatedTile && Main.tileSolid[(int)Main.tile[num163, num161].TileType])
|
||||
{
|
||||
flag22 = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (NPC.velocity.Y >= 0f)
|
||||
{
|
||||
int num164 = 0;
|
||||
if (NPC.velocity.X < 0f)
|
||||
{
|
||||
num164 = -1;
|
||||
}
|
||||
if (NPC.velocity.X > 0f)
|
||||
{
|
||||
num164 = 1;
|
||||
}
|
||||
Vector2 position2 = NPC.position;
|
||||
position2.X += NPC.velocity.X;
|
||||
int num165 = (int)((position2.X + (float)(NPC.width / 2) + (float)((NPC.width / 2 + 1) * num164)) / 16f);
|
||||
int num166 = (int)((position2.Y + (float)NPC.height - 1f) / 16f);
|
||||
if ((float)(num165 * 16) < position2.X + (float)NPC.width && (float)(num165 * 16 + 16) > position2.X && ((Main.tile[num165, num166].HasUnactuatedTile && !Main.tile[num165, num166].TopSlope && !Main.tile[num165, num166 - 1].TopSlope && Main.tileSolid[(int)Main.tile[num165, num166].TileType] && !Main.tileSolidTop[(int)Main.tile[num165, num166].TileType]) || (Main.tile[num165, num166 - 1].IsHalfBlock && Main.tile[num165, num166 - 1].HasUnactuatedTile)) && (!Main.tile[num165, num166 - 1].HasUnactuatedTile || !Main.tileSolid[(int)Main.tile[num165, num166 - 1].TileType] || Main.tileSolidTop[(int)Main.tile[num165, num166 - 1].TileType] || (Main.tile[num165, num166 - 1].IsHalfBlock && (!Main.tile[num165, num166 - 4].HasUnactuatedTile || !Main.tileSolid[(int)Main.tile[num165, num166 - 4].TileType] || Main.tileSolidTop[(int)Main.tile[num165, num166 - 4].TileType]))) && (!Main.tile[num165, num166 - 2].HasUnactuatedTile || !Main.tileSolid[(int)Main.tile[num165, num166 - 2].TileType] || Main.tileSolidTop[(int)Main.tile[num165, num166 - 2].TileType]) && (!Main.tile[num165, num166 - 3].HasUnactuatedTile || !Main.tileSolid[(int)Main.tile[num165, num166 - 3].TileType] || Main.tileSolidTop[(int)Main.tile[num165, num166 - 3].TileType]) && (!Main.tile[num165 - num164, num166 - 3].HasUnactuatedTile || !Main.tileSolid[(int)Main.tile[num165 - num164, num166 - 3].TileType]))
|
||||
{
|
||||
float num167 = (float)(num166 * 16);
|
||||
if (Main.tile[num165, num166].IsHalfBlock)
|
||||
{
|
||||
num167 += 8f;
|
||||
}
|
||||
if (Main.tile[num165, num166 - 1].IsHalfBlock)
|
||||
{
|
||||
num167 -= 8f;
|
||||
}
|
||||
if (num167 < position2.Y + (float)NPC.height)
|
||||
{
|
||||
float num168 = position2.Y + (float)NPC.height - num167;
|
||||
float num169 = 16.1f;
|
||||
if (num168 <= num169)
|
||||
{
|
||||
NPC.gfxOffY += NPC.position.Y + (float)NPC.height - num167;
|
||||
NPC.position.Y = num167 - (float)NPC.height;
|
||||
if (num168 < 9f)
|
||||
{
|
||||
NPC.stepSpeed = 1f;
|
||||
}
|
||||
else
|
||||
{
|
||||
NPC.stepSpeed = 2f;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (flag22)
|
||||
{
|
||||
int num170 = (int)((NPC.position.X + (float)(NPC.width / 2) + (float)(15 * NPC.direction)) / 16f);
|
||||
int num171 = (int)((NPC.position.Y + (float)NPC.height - 15f) / 16f);
|
||||
if ((Main.tile[num170, num171 - 1].HasUnactuatedTile && (Main.tile[num170, num171 - 1].TileType == 10 || Main.tile[num170, num171 - 1].TileType == 388)) & flag5)
|
||||
{
|
||||
NPC.ai[2] += 1f;
|
||||
NPC.ai[3] = 0f;
|
||||
if (NPC.ai[2] >= 60f)
|
||||
{
|
||||
NPC.velocity.X = 0.5f * (float)-(float)NPC.direction;
|
||||
int num172 = 5;
|
||||
if (Main.tile[num170, num171 - 1].TileType == 388)
|
||||
{
|
||||
num172 = 2;
|
||||
}
|
||||
NPC.ai[1] += (float)num172;
|
||||
NPC.ai[2] = 0f;
|
||||
bool flag23 = false;
|
||||
if (NPC.ai[1] >= 10f)
|
||||
{
|
||||
flag23 = true;
|
||||
NPC.ai[1] = 10f;
|
||||
}
|
||||
WorldGen.KillTile(num170, num171 - 1, true, false, false);
|
||||
if ((Main.netMode != NetmodeID.MultiplayerClient || !flag23) && flag23 && Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
if (Main.tile[num170, num171 - 1].TileType == 10)
|
||||
{
|
||||
bool flag24 = WorldGen.OpenDoor(num170, num171 - 1, NPC.direction);
|
||||
if (!flag24)
|
||||
{
|
||||
NPC.ai[3] = (float)num35;
|
||||
NPC.netUpdate = true;
|
||||
}
|
||||
if (Main.netMode == NetmodeID.Server & flag24)
|
||||
{
|
||||
NetMessage.SendData(MessageID.ToggleDoorState, -1, -1, null, 0, (float)num170, (float)(num171 - 1), (float)NPC.direction, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
if (Main.tile[num170, num171 - 1].TileType == 388)
|
||||
{
|
||||
bool flag25 = WorldGen.ShiftTallGate(num170, num171 - 1, false);
|
||||
if (!flag25)
|
||||
{
|
||||
NPC.ai[3] = (float)num35;
|
||||
NPC.netUpdate = true;
|
||||
}
|
||||
if (Main.netMode == NetmodeID.Server & flag25)
|
||||
{
|
||||
NetMessage.SendData(MessageID.ToggleDoorState, -1, -1, null, 4, (float)num170, (float)(num171 - 1), 0f, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
int num173 = NPC.spriteDirection;
|
||||
if ((NPC.velocity.X < 0f && num173 == -1) || (NPC.velocity.X > 0f && num173 == 1))
|
||||
{
|
||||
if (NPC.height >= 32 && Main.tile[num170, num171 - 2].HasUnactuatedTile && Main.tileSolid[(int)Main.tile[num170, num171 - 2].TileType])
|
||||
{
|
||||
if (Main.tile[num170, num171 - 3].HasUnactuatedTile && Main.tileSolid[(int)Main.tile[num170, num171 - 3].TileType])
|
||||
{
|
||||
NPC.velocity.Y = -8f;
|
||||
NPC.netUpdate = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
NPC.velocity.Y = -7f;
|
||||
NPC.netUpdate = true;
|
||||
}
|
||||
}
|
||||
else if (Main.tile[num170, num171 - 1].HasUnactuatedTile && Main.tileSolid[(int)Main.tile[num170, num171 - 1].TileType])
|
||||
{
|
||||
NPC.velocity.Y = -6f;
|
||||
NPC.netUpdate = true;
|
||||
}
|
||||
else if (NPC.position.Y + (float)NPC.height - (float)(num171 * 16) > 20f && Main.tile[num170, num171].HasUnactuatedTile && !Main.tile[num170, num171].TopSlope && Main.tileSolid[(int)Main.tile[num170, num171].TileType])
|
||||
{
|
||||
NPC.velocity.Y = -5f;
|
||||
NPC.netUpdate = true;
|
||||
}
|
||||
else if (NPC.directionY < 0 && (!Main.tile[num170, num171 + 1].HasUnactuatedTile || !Main.tileSolid[(int)Main.tile[num170, num171 + 1].TileType]) && (!Main.tile[num170 + NPC.direction, num171 + 1].HasUnactuatedTile || !Main.tileSolid[(int)Main.tile[num170 + NPC.direction, num171 + 1].TileType]))
|
||||
{
|
||||
NPC.velocity.Y = -8f;
|
||||
NPC.velocity.X = NPC.velocity.X * 1.5f;
|
||||
NPC.netUpdate = true;
|
||||
}
|
||||
else if (flag5)
|
||||
{
|
||||
NPC.ai[1] = 0f;
|
||||
NPC.ai[2] = 0f;
|
||||
}
|
||||
if ((NPC.velocity.Y == 0f & flag3) && NPC.ai[3] == 1f)
|
||||
{
|
||||
NPC.velocity.Y = -5f;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (flag5)
|
||||
{
|
||||
NPC.ai[1] = 0f;
|
||||
NPC.ai[2] = 0f;
|
||||
}
|
||||
}
|
||||
|
||||
public override float SpawnChance(NPCSpawnInfo spawnInfo)
|
||||
{
|
||||
if (spawnInfo.PlayerSafe || !Main.hardMode || spawnInfo.Player.Calamity().ZoneAbyss ||
|
||||
spawnInfo.Player.Calamity().ZoneSunkenSea)
|
||||
{
|
||||
return 0f;
|
||||
}
|
||||
return SpawnCondition.Underground.Chance * 0.02f;
|
||||
}
|
||||
|
||||
public override void OnHitPlayer(Player player, int damage, bool crit)
|
||||
{
|
||||
player.AddBuff(ModContent.BuffType<WarCleave>(), 120);
|
||||
}
|
||||
|
||||
public override void HitEffect(int hitDirection, double damage)
|
||||
{
|
||||
for (int k = 0; k < 3; k++)
|
||||
{
|
||||
Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.Phantoplasm, hitDirection, -1f, 0, default, 1f);
|
||||
}
|
||||
if (NPC.life <= 0)
|
||||
{
|
||||
for (int k = 0; k < 15; k++)
|
||||
{
|
||||
Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.Phantoplasm, hitDirection, -1f, 0, default, 1f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void ModifyNPCLoot(NPCLoot npcLoot)
|
||||
{
|
||||
npcLoot.Add(ModContent.ItemType<AncientBoneDust>());
|
||||
npcLoot.AddIf(() => NPC.downedMoonlord, ModContent.ItemType<Phantoplasm>());
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.6 KiB |
@@ -1,103 +0,0 @@
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Placeables.Banners;
|
||||
using Terraria;
|
||||
using Terraria.GameContent.Bestiary;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ModLoader.Utilities;
|
||||
namespace CalamityMod.NPCs.NormalNPCs
|
||||
{
|
||||
public class SunBat : ModNPC
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Sun Bat");
|
||||
Main.npcFrameCount[NPC.type] = 7;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
NPC.lavaImmune = true;
|
||||
NPC.aiStyle = -1;
|
||||
AIType = -1;
|
||||
NPC.damage = 35;
|
||||
NPC.width = 26;
|
||||
NPC.height = 20;
|
||||
NPC.defense = 10;
|
||||
NPC.lifeMax = 200;
|
||||
NPC.knockBackResist = 0.65f;
|
||||
NPC.value = Item.buyPrice(0, 0, 5, 0);
|
||||
NPC.HitSound = SoundID.NPCHit1;
|
||||
NPC.DeathSound = SoundID.NPCDeath4;
|
||||
Banner = NPC.type;
|
||||
BannerItem = ModContent.ItemType<SunBatBanner>();
|
||||
NPC.Calamity().VulnerableToHeat = false;
|
||||
NPC.Calamity().VulnerableToCold = true;
|
||||
NPC.Calamity().VulnerableToSickness = true;
|
||||
NPC.Calamity().VulnerableToWater = true;
|
||||
}
|
||||
|
||||
public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry)
|
||||
{
|
||||
bestiaryEntry.Info.AddRange(new IBestiaryInfoElement[] {
|
||||
BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Underground,
|
||||
|
||||
// Will move to localization whenever that is cleaned up.
|
||||
new FlavorTextBestiaryInfoElement("Truly a Sunny Delight.")
|
||||
});
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
CalamityGlobalAI.BuffedBatAI(NPC, Mod);
|
||||
}
|
||||
|
||||
public override void FindFrame(int frameHeight)
|
||||
{
|
||||
if (NPC.velocity.X > 0f)
|
||||
NPC.spriteDirection = 1;
|
||||
if (NPC.velocity.X < 0f)
|
||||
NPC.spriteDirection = -1;
|
||||
|
||||
NPC.rotation = NPC.velocity.X * 0.1f;
|
||||
|
||||
NPC.frameCounter += 0.15f;
|
||||
NPC.frameCounter %= Main.npcFrameCount[NPC.type];
|
||||
int frame = (int)NPC.frameCounter;
|
||||
NPC.frame.Y = frame * frameHeight;
|
||||
}
|
||||
|
||||
public override float SpawnChance(NPCSpawnInfo spawnInfo)
|
||||
{
|
||||
if (spawnInfo.PlayerSafe || !Main.hardMode || spawnInfo.Player.Calamity().ZoneAbyss ||
|
||||
spawnInfo.Player.Calamity().ZoneSunkenSea)
|
||||
{
|
||||
return 0f;
|
||||
}
|
||||
return SpawnCondition.Underground.Chance * 0.12f;
|
||||
}
|
||||
|
||||
public override void OnHitPlayer(Player player, int damage, bool crit)
|
||||
{
|
||||
player.AddBuff(ModContent.BuffType<HolyFlames>(), 120, true);
|
||||
}
|
||||
|
||||
public override void HitEffect(int hitDirection, double damage)
|
||||
{
|
||||
for (int k = 0; k < 5; k++)
|
||||
{
|
||||
Dust.NewDust(NPC.position, NPC.width, NPC.height, 64, hitDirection, -1f, 0, default, 1f);
|
||||
}
|
||||
if (NPC.life <= 0)
|
||||
{
|
||||
for (int k = 0; k < 20; k++)
|
||||
{
|
||||
Dust.NewDust(NPC.position, NPC.width, NPC.height, 64, hitDirection, -1f, 0, default, 1f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void ModifyNPCLoot(NPCLoot npcLoot) => npcLoot.Add(ModContent.ItemType<EssenceofSunlight>(), 3);
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 2.8 KiB |
@@ -294,7 +294,6 @@ namespace CalamityMod
|
||||
{ ModContent.NPCType<ImpiousImmolator>(), new Tuple<bool, int[]>(false, CalamityMod.holyEnemyImmunities) },
|
||||
{ ModContent.NPCType<ProfanedEnergyBody>(), new Tuple<bool, int[]>(false, CalamityMod.holyEnemyImmunities) },
|
||||
{ ModContent.NPCType<Sunskater>(), new Tuple<bool, int[]>(false, CalamityMod.holyEnemyImmunities) },
|
||||
{ ModContent.NPCType<SunBat>(), new Tuple<bool, int[]>(false, CalamityMod.holyEnemyImmunities) },
|
||||
|
||||
{ ModContent.NPCType<ArmoredDiggerHead>(), new Tuple<bool, int[]>(true, new int[] { }) },
|
||||
{ ModContent.NPCType<ArmoredDiggerBody>(), new Tuple<bool, int[]>(true, new int[] { }) },
|
||||
|
||||
Reference in new issue
Block a user