Loki Day bugfix

This commit is contained in:
Robert Paciorek 2025-04-01 09:29:14 +00:00
parent b8a7ef847e
commit 9cc16f31ae
2 changed files with 6 additions and 5 deletions

View File

@ -177,6 +177,7 @@ public class Room {
} }
private void OnTimer(Object? source, ElapsedEventArgs e) { private void OnTimer(Object? source, ElapsedEventArgs e) {
SetTimer(random.NextDouble() * 9 + 1);
foreach (var roomClient in Clients) { foreach (var roomClient in Clients) {
roomClient.PlayerData.RandomizeDragon(); roomClient.PlayerData.RandomizeDragon();
@ -188,6 +189,5 @@ public class Room {
roomClient.SendSUV(vl, data); roomClient.SendSUV(vl, data);
} }
SetTimer(random.NextDouble() * 9 + 1);
} }
} }

View File

@ -206,7 +206,7 @@ public class PlayerData {
} }
if (Configuration.ServerConfiguration.MakeChaos) { if (Configuration.ServerConfiguration.MakeChaos) {
if (PetGeometry == geometry) if (PetGeometry == geometry)
return variables["FP"]; return Regex.Replace(value, "\\*C\\$[0-9$]*\\*", colour + "*");
PetGeometry = geometry; PetGeometry = geometry;
} }
if (PetMounted && !Configuration.ServerConfiguration.AllowChaos && if (PetMounted && !Configuration.ServerConfiguration.AllowChaos &&
@ -220,11 +220,12 @@ public class PlayerData {
} }
private Random random = new Random(); private Random random = new Random();
private string colour;
public void RandomizeDragon() { public void RandomizeDragon() {
var s = "*C$"; colour = "*C$";
for (var i=0; i<9; ++i) for (var i=0; i<9; ++i)
s=s+random.Next(0, 255).ToString() + "$"; colour=colour+random.Next(0, 255).ToString() + "$";
variables["FP"] = Regex.Replace(variables["FP"], "\\*C\\$[0-9$]*\\*", s + "*"); variables["FP"] = Regex.Replace(variables["FP"], "\\*C\\$[0-9$]*\\*", colour + "*");
} }
} }