Ejemplo n.º 1
0
        public static bool OnStrikeNpc(NPC npc, ref int damage, ref float knockback, ref int hitdirection, ref double retdamage)
        {
            if (StrikeNpc == null)
            {
                return(false);
            }

            var args = new NpcStrikeEventArgs()
            {
                Npc          = npc,
                Damage       = damage,
                KnockBack    = knockback,
                HitDirection = hitdirection,
                ReturnDamage = 0,
            };

            StrikeNpc(args);

            retdamage    = args.ReturnDamage;
            damage       = args.Damage;
            knockback    = args.KnockBack;
            hitdirection = args.HitDirection;

            return(args.Handled);
        }
Ejemplo n.º 2
0
        public static bool OnStrikeNpc(NPC npc, ref int damage, ref float knockback, ref int hitdirection, ref double retdamage)
        {
            if (StrikeNpc == null)
                return false;

            var args = new NpcStrikeEventArgs()
            {
                Npc = npc,
                Damage = damage,
                KnockBack = knockback,
                HitDirection = hitdirection,
                ReturnDamage = 0,
            };

            StrikeNpc(args);

            retdamage = args.ReturnDamage;
            damage = args.Damage;
            knockback = args.KnockBack;
            hitdirection = args.HitDirection;

            return args.Handled;
        }
Ejemplo n.º 3
0
 private void NpcHooks_OnStrikeNpc(NpcStrikeEventArgs e)
 {
     if (Config.InfiniteInvasion)
     {
         IncrementKills();
         if (Main.invasionSize < 10)
         {
             Main.invasionSize = 20000000;
         }
     }
 }
Ejemplo n.º 4
0
 /*
  * Hooks:
  * */
 void NpcHooks_OnStrikeNpc(NpcStrikeEventArgs e)
 {
     try
     {
         if (ConfigurationManager.infiniteInvasion)
         {
             IncrementKills();
             if (Main.invasionSize < 10)
             {
                 Main.invasionSize = 20000000;
             }
         }
     }
     catch (Exception ex)
     {
         FileTools.WriteError(ex.ToString());
     }
 }