Esempio 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);
        }
Esempio 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;
        }
Esempio n. 3
0
 private void NpcHooks_OnStrikeNpc(NpcStrikeEventArgs e)
 {
     if (Config.InfiniteInvasion)
     {
         IncrementKills();
         if (Main.invasionSize < 10)
         {
             Main.invasionSize = 20000000;
         }
     }
 }
Esempio 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());
     }
 }