Exemplo n.º 1
0
 public static void Prefix(Grenades.Grenade __instance, ref Team value)
 {
     Log.Debug($"[GrenadeThrowerPatch] value:{value} isscp018:{__instance is Grenades.Scp018Grenade}");
     if (Configs.scp018_friendly_fire && __instance is Grenades.Scp018Grenade)
     {
         value = Team.TUT;
     }
 }
Exemplo n.º 2
0
        public static void SpawnGrenade(Vector3 position, bool isFlash = false, float fusedur = -1, ReferenceHub player = null)
        {
            if (player == null)
            {
                player = ReferenceHub.GetHub(PlayerManager.localPlayer);
            }
            var gm = player.GetComponent <Grenades.GrenadeManager>();

            Grenades.Grenade component = UnityEngine.Object.Instantiate(gm.availableGrenades[isFlash ? (int)GRENADE_ID.FLASH_NADE : (int)GRENADE_ID.FRAG_NADE].grenadeInstance).GetComponent <Grenades.Grenade>();
            if (fusedur != -1)
            {
                component.fuseDuration = fusedur;
            }
            component.FullInitData(gm, position, Quaternion.Euler(component.throwStartAngle), Vector3.zero, component.throwAngularVelocity);
            NetworkServer.Spawn(component.gameObject);
        }
Exemplo n.º 3
0
 public static bool Prefix(Grenades.Grenade __instance, ref bool __result)
 {
     try
     {
         if (__instance.thrower?.name != "Host")
         {
             string text = (__instance.thrower != null) ? (__instance.thrower.ccm.UserId + " (" + __instance.thrower.nick.MyNick + ")") : "(UNKNOWN)";
             ServerLogs.AddLog(ServerLogs.Modules.Logger, "Player " + text + "'s " + __instance.logName + " grenade exploded.", ServerLogs.ServerLogType.GameEvent);
         }
         __result = true;
         return(false);
     }
     catch (Exception)
     {
         return(true);
     }
 }