Super Dummy's revenge.
This commit is contained in:
1 parent
2386071f69
commit
21b008c8ed
2 files changed
+46
-6
No files matched your search
@@ -9,8 +9,8 @@ using CalamityMod.Projectiles.Enemy;
|
||||
using CalamityMod.Projectiles.Magic;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using System.IO;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.GameContent.Bestiary;
|
||||
using Terraria.GameContent.ItemDropRules;
|
||||
using Terraria.ID;
|
||||
@@ -83,6 +83,16 @@ namespace CalamityMod.NPCs.AcidRain
|
||||
});
|
||||
}
|
||||
|
||||
public override void SendExtraAI(BinaryWriter writer)
|
||||
{
|
||||
writer.Write(NPC.Calamity().newAI[0]);
|
||||
}
|
||||
|
||||
public override void ReceiveExtraAI(BinaryReader reader)
|
||||
{
|
||||
NPC.Calamity().newAI[0] = reader.ReadSingle();
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
Time++;
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.Audio;
|
||||
using System;
|
||||
using ReLogic.Utilities;
|
||||
using System.IO;
|
||||
using Terraria;
|
||||
|
||||
namespace CalamityMod.NPCs.NormalNPCs
|
||||
{
|
||||
public class SuperDummyNPC : ModNPC
|
||||
{
|
||||
public int deathCounter = 0;
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
this.HideFromBestiary();
|
||||
@@ -33,6 +32,32 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
NPC.aiStyle = NPCAIStyleID.FaceClosestPlayer;
|
||||
}
|
||||
|
||||
public override void SendExtraAI(BinaryWriter writer)
|
||||
{
|
||||
writer.Write(deathCounter);
|
||||
}
|
||||
|
||||
public override void ReceiveExtraAI(BinaryReader reader)
|
||||
{
|
||||
deathCounter = reader.ReadInt32();
|
||||
}
|
||||
|
||||
public override bool PreAI()
|
||||
{
|
||||
if (Main.getGoodWorld) // move to zenith seed later
|
||||
{
|
||||
deathCounter++;
|
||||
// If you don't attack the Dummy for a minute in gfb, it becomes sentient
|
||||
if (deathCounter >= 6000)
|
||||
{
|
||||
NPC.damage = NPC.lifeMax;
|
||||
CalamityGlobalAI.BuffedMimicAI(NPC, Mod);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void UpdateLifeRegen(ref int damage)
|
||||
{
|
||||
NPC.lifeRegen += 2000000;
|
||||
@@ -47,6 +72,11 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
{
|
||||
// Dummy AI, no way
|
||||
NPC.ai[0] = hitDirection * -NPC.direction;
|
||||
// Reset hit timer if it isn't enraged
|
||||
if (deathCounter > 0 && deathCounter < 6000)
|
||||
{
|
||||
deathCounter = 0;
|
||||
}
|
||||
}
|
||||
|
||||
public override void FindFrame(int frameHeight)
|
||||
@@ -63,9 +93,9 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
}
|
||||
|
||||
// Hit from behind
|
||||
if (NPC.ai[0] == -1)
|
||||
if (NPC.ai[0] == -1 || deathCounter > 6000)
|
||||
{
|
||||
if (NPC.justHit && NPC.frame.Y > frameHeight * 2)
|
||||
if ((NPC.justHit || deathCounter > 6000) && NPC.frame.Y > frameHeight * 2)
|
||||
{
|
||||
NPC.frame.Y = frameHeight;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user