Esempio n. 1
0
        public static bool OnStrikeNpc(NPC npc, ref int damage, ref float knockback, ref int hitdirection, ref bool crit, ref bool noEffect, ref double retdamage)
        {
            if (NpcHooks.StrikeNpc == null)
            {
                return(false);
            }
            NpcStrikeEventArgs npcStrikeEventArgs = new NpcStrikeEventArgs
            {
                Npc          = npc,
                Damage       = damage,
                KnockBack    = knockback,
                HitDirection = hitdirection,
                Critical     = crit,
                NoEffect     = noEffect,
                ReturnDamage = retdamage
            };

            NpcHooks.StrikeNpc(npcStrikeEventArgs);
            crit         = npcStrikeEventArgs.Critical;
            damage       = npcStrikeEventArgs.Damage;
            knockback    = npcStrikeEventArgs.KnockBack;
            hitdirection = npcStrikeEventArgs.HitDirection;
            noEffect     = npcStrikeEventArgs.NoEffect;
            retdamage    = npcStrikeEventArgs.ReturnDamage;
            return(npcStrikeEventArgs.Handled);
        }
Esempio n. 2
0
 private void NpcHooks_OnStrikeNpc(NpcStrikeEventArgs e)
 {
     if (Config.InfiniteInvasion)
     {
         IncrementKills();
         if (Main.invasionSize < 10)
         {
             Main.invasionSize = 20000000;
         }
     }
 }
Esempio n. 3
0
 public static bool OnStrikeNpc(NPC npc, ref int damage, ref float knockback, ref int hitdirection, ref bool crit, ref bool noEffect, ref double retdamage)
 {
     if (NpcHooks.StrikeNpc == null)
     {
         return false;
     }
     NpcStrikeEventArgs npcStrikeEventArgs = new NpcStrikeEventArgs
     {
         Npc = npc,
         Damage = damage,
         KnockBack = knockback,
         HitDirection = hitdirection,
         Critical = crit,
         NoEffect = noEffect,
         ReturnDamage = retdamage
     };
     NpcHooks.StrikeNpc(npcStrikeEventArgs);
     crit = npcStrikeEventArgs.Critical;
     damage = npcStrikeEventArgs.Damage;
     knockback = npcStrikeEventArgs.KnockBack;
     hitdirection = npcStrikeEventArgs.HitDirection;
     noEffect = npcStrikeEventArgs.NoEffect;
     retdamage = npcStrikeEventArgs.ReturnDamage;
     return npcStrikeEventArgs.Handled;
 }