Skip to content

Commit d2f1cce

Browse files
Disable snowball impact effect, copy custom gamemode script
1 parent 080cc92 commit d2f1cce

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

Mods/Buttons.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1275,6 +1275,8 @@ public class Buttons
12751275
new ButtonInfo { buttonText = "Get Decryptable Cosmetic Data", method =() => Miscellaneous.DecryptableCosmeticData(), isTogglable = false, toolTip = "Dumps the cosmetics and their data to a easily decryptable file for databases."},
12761276
new ButtonInfo { buttonText = "Get RPC Data", method =() => Miscellaneous.DumpRPCData(), isTogglable = false, toolTip = "Dumps the data of every RPC to a file."},
12771277

1278+
new ButtonInfo { buttonText = "Copy Custom Gamemode Script", method =() => Miscellaneous.CopyCustomGamemodeScript(), isTogglable = false, toolTip = "Copies the lua script source code of the current custom map being played."},
1279+
12781280
new ButtonInfo { buttonText = "Better FPS Boost", enableMethod =() => Experimental.BetterFPSBoost(), disableMethod =() => Experimental.DisableBetterFPSBoost(), toolTip = "Makes everything one color, boosting your FPS."},
12791281

12801282
new ButtonInfo { buttonText = "Disorganize Menu", method =() => Settings.DisorganizeMenu(), isTogglable = false, toolTip = "Disorganizes the entire menu. This cannot be undone."},
@@ -1301,7 +1303,7 @@ public class Buttons
13011303

13021304
new ButtonInfo[] { // Overpowered Settings [31]
13031305
new ButtonInfo { buttonText = "Exit Overpowered Settings", method =() => currentCategoryName = "Settings", isTogglable = false, toolTip = "Returns you back to the settings menu."},
1304-
new ButtonInfo { buttonText = "Disable Snowball Impact Effects", method =() => Overpowered.DisableSnowballImpactEffect(), toolTip = "Disables the impact effect that people get when hit with snowballs."}
1306+
new ButtonInfo { buttonText = "Disable Snowball Impact Effect", method =() => Overpowered.DisableSnowballImpactEffect(), toolTip = "Disables the impact effect that people get when hit with snowballs."}
13051307
},
13061308

13071309
new ButtonInfo[] { // Keybind Settings [32]

Mods/Miscellaneous.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,5 +327,8 @@ public static void DumpRPCData()
327327
LogManager.Log("Could not open process " + filePath);
328328
}
329329
}
330+
331+
public static void CopyCustomGamemodeScript() =>
332+
GUIUtility.systemCopyBuffer = CustomGameMode.LuaScript;
330333
}
331334
}

Mods/Overpowered.cs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -740,22 +740,25 @@ public static int GetProjectileIncrement(Vector3 Position, Vector3 Velocity, flo
740740
}
741741
}
742742

743+
private static float timeSinceCallInvalidated;
743744
public static void DisableSnowballImpactEffect()
744745
{
745-
if (PhotonNetwork.InRoom && Time.time < snowballSpawnDelay + 0.1f)
746+
if (PhotonNetwork.InRoom && Time.time < snowballDelay + 0.1f && Time.time > timeSinceCallInvalidated)
746747
{
747-
while (RoomSystem.callbackInstance.roomSettings.PlayerEffectLimiter.CheckCallServerTime(PhotonNetwork.ServerTimestamp))
748+
timeSinceCallInvalidated = Time.time + 1f;
749+
750+
for (int i = 0; i < 11; i++)
748751
{
749752
object[] playerEffectData = new object[6];
750753
playerEffectData[0] = -1;
751754
playerEffectData[1] = -1;
752755

753756
object[] sendEventData = new object[3];
754-
sendEventData[0] = PhotonNetwork.ServerTimestamp;
757+
sendEventData[0] = NetworkSystem.Instance.ServerTimestamp - (11 - i);
755758
sendEventData[1] = (byte)6;
756759
sendEventData[2] = playerEffectData;
757760

758-
PhotonNetwork.RaiseEvent(3, sendEventData, new RaiseEventOptions { Receivers = ReceiverGroup.Others }, SendOptions.SendUnreliable);
761+
PhotonNetwork.RaiseEvent(3, sendEventData, new RaiseEventOptions { Receivers = ReceiverGroup.All }, SendOptions.SendUnreliable);
759762
}
760763
RPCProtection();
761764
}
@@ -833,7 +836,7 @@ public static void BetaSnowballImpact(Player Target)
833836
playerEffectData[1] = 0;
834837

835838
object[] sendEventData = new object[3];
836-
sendEventData[0] = PhotonNetwork.ServerTimestamp;
839+
sendEventData[0] = NetworkSystem.Instance.ServerTimestamp;
837840
sendEventData[1] = (byte)6;
838841
sendEventData[2] = playerEffectData;
839842

@@ -1800,7 +1803,7 @@ public static void BetaSetStatus(int state, RaiseEventOptions balls)
18001803
object[] statusSendData = new object[1];
18011804
statusSendData[0] = state;
18021805
object[] sendEventData = new object[3];
1803-
sendEventData[0] = PhotonNetwork.ServerTimestamp;
1806+
sendEventData[0] = NetworkSystem.Instance.ServerTimestamp;
18041807
sendEventData[1] = (byte)2;
18051808
sendEventData[2] = statusSendData;
18061809
PhotonNetwork.RaiseEvent(3, sendEventData, balls, SendOptions.SendUnreliable);

0 commit comments

Comments
 (0)