Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using Microsoft.Xna.Framework;
- using Terraria;
- using Terraria.ID;
- using Terraria.ModLoader;
- namespace Narutoria.NPCs
- {
- public class MyGlobalNPC : GlobalNPC
- {
- public override void ResetEffects(NPC npc)
- {
- Dying = false;
- Genjutsu = false;
- }
- public override bool InstancePerEntity { get { return true; } }
- public bool Dying;
- public override void UpdateLifeRegen(NPC npc, ref int damage) {
- if (Dying) {
- if (npc.lifeRegen > 0) {
- npc.lifeRegen = 0;
- }
- npc.lifeRegen -=10;
- if (damage < 2f) {
- damage = 3;
- }
- }
- }
- public bool Genjutsu = false;
- public override void DrawEffects(NPC npc, ref Color drawColor)
- {
- if (Genjutsu)
- for (var k = 0; k < 2; k++)
- if (Main.rand.NextBool(1, 3))
- {
- var dust = Dust.NewDust(npc.position, npc.width, npc.height, 29, npc.velocity.X * 0.4f, npc.velocity.Y * 0.4f, 100, default(Color), 1.5f);
- Main.dust[dust].noGravity = true;
- Main.dust[dust].velocity.Y += 2f;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement