예제 #1
0
 private static void ProcessPlayers(FlashbangGrenade grenade, List <Player> players)
 {
     foreach (Player player in players)
     {
         if (HitboxIdentity.CheckFriendlyFire(grenade.PreviousOwner.Role, player.ReferenceHub.characterClassManager.CurClass))
         {
             grenade.ProcessPlayer(player.ReferenceHub);
         }
     }
 }
예제 #2
0
        private static bool PlayExplosionEffects(FlashbangGrenade __instance)
        {
            try
            {
                float time = __instance._blindingOverDistance.keys[__instance._blindingOverDistance.length - 1].time;
                float num  = time * time;
                foreach (KeyValuePair <GameObject, ReferenceHub> keyValuePair in ReferenceHub.GetAllHubs())
                {
                    if (!(keyValuePair.Value == null) && (__instance.transform.position - keyValuePair.Value.transform.position).sqrMagnitude <= num && !(keyValuePair.Value == __instance.PreviousOwner.Hub) && HitboxIdentity.CheckFriendlyFire(__instance.PreviousOwner.Hub, keyValuePair.Value, false))
                    {
                        __instance.ProcessPlayer(keyValuePair.Value);
                    }
                }

                return(false);
            }
            catch (Exception ex)
            {
                Logger.Get.Error($"Synapse-FF: PlayExplosionFlash failed!!\n{ex}");
                return(true);
            }
        }