This repository has been archived by the owner on Sep 12, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from SynapseSL/development
Version 1.1.1
- Loading branch information
Showing
48 changed files
with
353 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
Synapse/Events/Patches/EventPatches/MapPatches/TeslaTriggerEvent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using Harmony; | ||
using Synapse.Api; | ||
using UnityEngine; | ||
|
||
namespace Synapse.Events.Patches | ||
{ | ||
[HarmonyPatch(typeof(TeslaGate), nameof(TeslaGate.PlayersInRange))] | ||
public static class TeslaTriggerEvent | ||
{ | ||
public static void Postfix(TeslaGate __instance, bool hurtRange, ref List<PlayerStats> __result) | ||
{ | ||
try | ||
{ | ||
__result = new List<PlayerStats>(); | ||
|
||
foreach(var player in Player.GetAllPlayers()) | ||
{ | ||
var triggerable = true; | ||
|
||
if (Vector3.Distance(__instance.transform.position,player.Position) < __instance.sizeOfTrigger && player.Role != RoleType.Spectator) | ||
{ | ||
Events.InvokeTeslaTrigger(player, hurtRange, ref triggerable); | ||
|
||
if (triggerable) __result.Add(player.GetComponent<PlayerStats>()); | ||
} | ||
} | ||
} | ||
catch(Exception e) | ||
{ | ||
Log.Error($"TriggerTeslaEvent error: {e}"); | ||
} | ||
} | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.