public override void ModifyHitByProjectile(NPC npc, Projectile projectile, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) { if (npc.boss && npc.HasBuff(ModContent.BuffType <EnragedBuff>())) { EnragedBuff.ModifyHitIf(npc, ref damage, ref knockback); } }
//////////////// public override void ModifyHitByItem(NPC npc, Player player, Item item, ref int damage, ref float knockback, ref bool crit) { if (npc.boss && npc.HasBuff(ModContent.BuffType <EnragedBuff>())) { EnragedBuff.ModifyHitIf(npc, ref damage, ref knockback); } }
//////////////// public override void DrawEffects(NPC npc, ref Color drawColor) { if (npc.boss) { if (npc.HasBuff(ModContent.BuffType <EnragedBuff>())) { EnragedBuff.ApplyVisualFx(npc, ref drawColor, this.LastKnownDrawScale); } else { this.LastKnownDrawScale = npc.scale; } } }
//////////////// // private bool _IsUpdating = false; public override bool PreAI(NPC npc) { /*!this._IsUpdating*/ if (npc.HasPlayerTarget) { Player player = Main.player[npc.target]; if (player?.active == true) { //this._IsUpdating = true; this.UpdateRageGeneralSourcesIf(npc, player); //this._IsUpdating = false; } } if (npc.HasBuff(ModContent.BuffType <EnragedBuff>())) { EnragedBuff.ApplyExternalEffectsIf(npc); } return(base.PreAI(npc)); }