2 - IL Edited asphalt run speed and removed the multiplier given to player velocity while on asphalt. 3 - Removed Boss Rush Xeroc Curse. 4 - IL Edited Chlorophyte Bullets to have reduced dust and homing range and removed the damage nerf. 5 - Made Counter Scarf a rare variant of the Shield of Cthulhu and slightly increased the dash length. 6 - IL Edited to remove Aerial Bane's damage bonus against in-air enemies and removed the nerf it had. 7 - IL Edited to adjust the random damage variance for attacks both for and against the player from +-15% to +-5%. 8 - IL Edited to reduce Vortex Booster, Nebula Mantle and Betsy Wings horizontal hover speeds. 9 - Crown Jewel is now a legendary drop from King Slime. 10 - Teardrop Cleaver is now a legendary drop from Eye of Cthulhu. 11 - Changed Celestial Jewel recipe to use a Large Ruby and 5 teleportation potions. 12 - Bosses now drop rare variants and legendaries while in Malice Mode, adjusted damages and rarities/values for some that were moved to different tiers. 13 - Magic Mirror, Ice Mirror, Cell Phone and Recall Potions are now disabled while a boss is alive. 14 - Burden Breaker is now a legendary drop from Skeletron Prime. 15 - Rev+ Plantera spore gas no longer deals damage for 2 seconds after spawning in. 16 - Reduced the severity of the stat-changing properties of Nullification Pistol and Molecular Manipulator.
100 lines
3.3 KiB
C#
100 lines
3.3 KiB
C#
using CalamityMod.Events;
|
|
using CalamityMod.Items.Placeables.Banners;
|
|
using CalamityMod.World;
|
|
using Microsoft.Xna.Framework;
|
|
using Microsoft.Xna.Framework.Graphics;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
namespace CalamityMod.NPCs.Leviathan
|
|
{
|
|
public class Parasea : ModNPC
|
|
{
|
|
public override void SetStaticDefaults()
|
|
{
|
|
DisplayName.SetDefault("Parasea");
|
|
Main.npcFrameCount[npc.type] = 4;
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
npc.aiStyle = -1;
|
|
aiType = -1;
|
|
npc.noGravity = true;
|
|
npc.noTileCollide = true;
|
|
npc.canGhostHeal = false;
|
|
npc.GetNPCDamage();
|
|
npc.width = npc.height = 30;
|
|
npc.defense = 8;
|
|
npc.lifeMax = 650;
|
|
if (BossRushEvent.BossRushActive)
|
|
{
|
|
npc.lifeMax = 50000;
|
|
}
|
|
npc.knockBackResist = 0f;
|
|
npc.HitSound = SoundID.NPCHit1;
|
|
npc.DeathSound = SoundID.NPCDeath1;
|
|
banner = npc.type;
|
|
bannerItem = ModContent.ItemType<ParaseaBanner>();
|
|
}
|
|
|
|
public override void AI()
|
|
{
|
|
bool revenge = CalamityWorld.revenge;
|
|
float speed = revenge ? 16f : 13f;
|
|
if (BossRushEvent.BossRushActive || CalamityWorld.malice)
|
|
speed = 24f;
|
|
CalamityAI.DungeonSpiritAI(npc, mod, speed, MathHelper.Pi);
|
|
}
|
|
|
|
public override float SpawnChance(NPCSpawnInfo spawnInfo)
|
|
{
|
|
if (spawnInfo.playerSafe || spawnInfo.player.Calamity().ZoneSulphur || (!NPC.downedPlantBoss && !CalamityWorld.downedCalamitas))
|
|
{
|
|
return 0f;
|
|
}
|
|
return SpawnCondition.OceanMonster.Chance * 0.06f;
|
|
}
|
|
|
|
public override void FindFrame(int frameHeight)
|
|
{
|
|
npc.frameCounter += 0.15f;
|
|
npc.frameCounter %= Main.npcFrameCount[npc.type];
|
|
int frame = (int)npc.frameCounter;
|
|
npc.frame.Y = frame * frameHeight;
|
|
}
|
|
|
|
public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor)
|
|
{
|
|
Texture2D texture = Main.npcTexture[npc.type];
|
|
int height = texture.Height / Main.npcFrameCount[npc.type];
|
|
int width = texture.Width;
|
|
SpriteEffects spriteEffects = SpriteEffects.FlipHorizontally;
|
|
if (npc.spriteDirection == -1)
|
|
spriteEffects = SpriteEffects.None;
|
|
Main.spriteBatch.Draw(texture, npc.Center - Main.screenPosition + new Vector2(0f, npc.gfxOffY), npc.frame, npc.GetAlpha(drawColor), npc.rotation, new Vector2((float)width / 2f, (float)height / 2f), npc.scale, spriteEffects, 0f);
|
|
return false;
|
|
}
|
|
|
|
public override void OnHitPlayer(Player player, int damage, bool crit)
|
|
{
|
|
player.AddBuff(BuffID.Wet, 60, true);
|
|
}
|
|
|
|
public override void HitEffect(int hitDirection, double damage)
|
|
{
|
|
for (int k = 0; k < 3; k++)
|
|
{
|
|
Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f);
|
|
}
|
|
if (npc.life <= 0)
|
|
{
|
|
for (int k = 0; k < 10; k++)
|
|
{
|
|
Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|