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.
153 lines
4.9 KiB
C#
153 lines
4.9 KiB
C#
using CalamityMod.Items.Placeables.Banners;
|
|
using CalamityMod.Items.Weapons.Magic;
|
|
using CalamityMod.Items.Materials;
|
|
using CalamityMod.World;
|
|
using System.IO;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
namespace CalamityMod.NPCs.NormalNPCs
|
|
{
|
|
public class AngryDog : ModNPC
|
|
{
|
|
private bool reset = false;
|
|
|
|
public override void SetStaticDefaults()
|
|
{
|
|
DisplayName.SetDefault("Angry Dog");
|
|
Main.npcFrameCount[npc.type] = 9;
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
npc.aiStyle = -1;
|
|
npc.damage = 10;
|
|
npc.width = 56;
|
|
npc.height = 56;
|
|
npc.defense = 4;
|
|
npc.lifeMax = 50;
|
|
if (CalamityWorld.downedCryogen)
|
|
{
|
|
npc.damage = 60;
|
|
npc.defense = 10;
|
|
npc.lifeMax = 1000;
|
|
}
|
|
npc.knockBackResist = 0.3f;
|
|
animationType = NPCID.Hellhound;
|
|
aiType = -1;
|
|
npc.value = Item.buyPrice(0, 0, 3, 0);
|
|
npc.HitSound = mod.GetLegacySoundSlot(SoundType.NPCHit, "Sounds/NPCHit/AngryDogHit");
|
|
npc.DeathSound = SoundID.NPCDeath5;
|
|
banner = npc.type;
|
|
bannerItem = ModContent.ItemType<AngryDogBanner>();
|
|
npc.coldDamage = true;
|
|
}
|
|
|
|
public override void SendExtraAI(BinaryWriter writer)
|
|
{
|
|
writer.Write(reset);
|
|
}
|
|
|
|
public override void ReceiveExtraAI(BinaryReader reader)
|
|
{
|
|
reset = reader.ReadBoolean();
|
|
}
|
|
|
|
public override void AI()
|
|
{
|
|
if (Main.rand.NextBool(900))
|
|
{
|
|
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/AngryDogGrowl"), (int)npc.position.X, (int)npc.position.Y);
|
|
}
|
|
bool phase2 = (double)npc.life <= (double)npc.lifeMax * (CalamityWorld.death ? 0.9 : 0.5);
|
|
if (phase2)
|
|
{
|
|
if (!reset)
|
|
{
|
|
npc.ai[0] = 0f;
|
|
npc.ai[3] = 0f;
|
|
reset = true;
|
|
npc.netUpdate = true;
|
|
}
|
|
if (npc.ai[1] < 7f)
|
|
{
|
|
npc.ai[1] += 1f;
|
|
}
|
|
CalamityAI.UnicornAI(npc, mod, true, CalamityWorld.death ? 6f : 4f, 5f, 0.2f);
|
|
return;
|
|
}
|
|
CalamityAI.UnicornAI(npc, mod, false, CalamityWorld.death ? 6f : 4f, 6f, CalamityWorld.death ? 0.1f : 0.07f);
|
|
}
|
|
|
|
public override void FindFrame(int frameHeight)
|
|
{
|
|
if (npc.ai[1] < 7f && npc.ai[1] > 0f)
|
|
{
|
|
npc.frame.Y = frameHeight * 7;
|
|
npc.frameCounter = 0.0;
|
|
return;
|
|
}
|
|
if (npc.ai[1] >= 7f)
|
|
{
|
|
npc.frame.Y = frameHeight * 8;
|
|
npc.frameCounter = 0.0;
|
|
return;
|
|
}
|
|
if (npc.velocity.Y > 0f || npc.velocity.Y < 0f)
|
|
{
|
|
npc.frame.Y = frameHeight * 5;
|
|
npc.frameCounter = 0.0;
|
|
}
|
|
else
|
|
{
|
|
npc.spriteDirection = npc.direction;
|
|
npc.frameCounter += (double)(npc.velocity.Length() / 16f);
|
|
if (npc.frameCounter > 12.0)
|
|
{
|
|
npc.frame.Y = npc.frame.Y + frameHeight;
|
|
npc.frameCounter = 0.0;
|
|
}
|
|
if (npc.frame.Y >= frameHeight * 6)
|
|
{
|
|
npc.frame.Y = 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
public override float SpawnChance(NPCSpawnInfo spawnInfo)
|
|
{
|
|
return spawnInfo.player.ZoneSnow &&
|
|
!spawnInfo.player.PillarZone() &&
|
|
!spawnInfo.player.ZoneDungeon &&
|
|
!spawnInfo.player.InSunkenSea() &&
|
|
!spawnInfo.playerInTown && !spawnInfo.player.ZoneOldOneArmy && !Main.snowMoon && !Main.pumpkinMoon ? 0.012f : 0f;
|
|
}
|
|
|
|
public override void OnHitPlayer(Player player, int damage, bool crit)
|
|
{
|
|
player.AddBuff(BuffID.Bleeding, 180, true);
|
|
}
|
|
|
|
public override void HitEffect(int hitDirection, double damage)
|
|
{
|
|
for (int k = 0; k < 5; 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 < 20; k++)
|
|
{
|
|
Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f);
|
|
}
|
|
}
|
|
}
|
|
|
|
public override void NPCLoot()
|
|
{
|
|
DropHelper.DropItemChance(npc, ItemID.Leather, 1, 1, 2);
|
|
DropHelper.DropItemCondition(npc, ModContent.ItemType<EssenceofEleum>(), CalamityWorld.downedCryogen, 3, 1, 1);
|
|
}
|
|
}
|
|
}
|