Advertisement
Guest User

Untitled

a guest
Jul 12th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.15 KB | None | 0 0
  1. using Microsoft.Xna.Framework;
  2. using Terraria;
  3. using Terraria.ID;
  4. using Terraria.ModLoader;
  5.    
  6. namespace Narutoria.NPCs
  7. {
  8.    public class MyGlobalNPC : GlobalNPC
  9.    {
  10.  
  11.          public override void ResetEffects(NPC npc)
  12.         {
  13.             Dying = false;
  14.             Genjutsu = false;
  15.         }
  16.  
  17.         public override bool InstancePerEntity { get { return true; } }
  18.         public bool Dying;
  19.         public override void UpdateLifeRegen(NPC npc, ref int damage) {
  20.             if (Dying) {
  21.                 if (npc.lifeRegen > 0) {
  22.                     npc.lifeRegen = 0;
  23.                 }
  24.                 npc.lifeRegen -=10;
  25.                 if (damage < 2f) {
  26.                     damage = 3;
  27.                 }
  28.             }
  29.         }
  30.  
  31.  
  32.        
  33.         public bool Genjutsu = false;
  34.  
  35.  
  36.          public override void DrawEffects(NPC npc, ref Color drawColor)
  37.         {
  38.             if (Genjutsu)
  39.                 for (var k = 0; k < 2; k++)
  40.                     if (Main.rand.NextBool(1, 3))
  41.                     {
  42.                         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);
  43.                         Main.dust[dust].noGravity = true;
  44.                         Main.dust[dust].velocity.Y += 2f;
  45.                     }
  46.         }
  47.  
  48.     }
  49.    
  50.    
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement