mirror of
https://github.com/edgegamers/Jailbreak.git
synced 2025-12-05 20:40:29 -08:00
Formatting
This commit is contained in:
@@ -9,8 +9,8 @@ public class CoinflipLocale : LastRequestLocale, ILRCFLocale {
|
||||
public IView FailedToChooseInTime(bool choice) {
|
||||
return new SimpleView {
|
||||
PREFIX,
|
||||
"You failed to choose in time, defaulting to" + ChatColors.Green,
|
||||
choice ? "Heads" : "Tails"
|
||||
"You failed to choose in time, defaulting to",
|
||||
$"{ChatColors.Green} {(choice ? "Heads" : "Tails")}{ChatColors.Grey}."
|
||||
};
|
||||
}
|
||||
|
||||
@@ -18,17 +18,16 @@ public class CoinflipLocale : LastRequestLocale, ILRCFLocale {
|
||||
return new SimpleView {
|
||||
PREFIX,
|
||||
guard,
|
||||
"chose" + ChatColors.Green,
|
||||
choice ? "Heads" : "Tails",
|
||||
ChatColors.Default + ", flipping..."
|
||||
"chose",
|
||||
$" {ChatColors.Green}{(choice ? "Heads" : "Tails")}{ChatColors.Grey}, flipping..."
|
||||
};
|
||||
}
|
||||
|
||||
public IView CoinLandsOn(bool heads) {
|
||||
return new SimpleView {
|
||||
PREFIX,
|
||||
"The coin landed on" + ChatColors.Green,
|
||||
heads ? "Heads" : "Tails" + ChatColors.White + "."
|
||||
"The coin landed on",
|
||||
$" {ChatColors.Green}{(heads ? "Heads" : "Tails")}{ChatColors.Grey}."
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -13,10 +13,11 @@ public class DebugZone(IServiceProvider services, BasePlugin plugin)
|
||||
private readonly IDictionary<ulong, ITypedZoneCreator> creators =
|
||||
new Dictionary<ulong, ITypedZoneCreator>();
|
||||
|
||||
private readonly IZoneFactory? factory = services.GetService<IZoneFactory>();
|
||||
private readonly IZoneFactory factory =
|
||||
services.GetRequiredService<IZoneFactory>();
|
||||
|
||||
private readonly IZoneManager? zoneManager =
|
||||
services.GetService<IZoneManager>();
|
||||
private readonly IZoneManager zoneManager =
|
||||
services.GetRequiredService<IZoneManager>();
|
||||
|
||||
public override void OnCommand(CCSPlayerController? executor,
|
||||
WrappedInfo info) {
|
||||
@@ -27,11 +28,6 @@ public class DebugZone(IServiceProvider services, BasePlugin plugin)
|
||||
return;
|
||||
}
|
||||
|
||||
if (factory == null || zoneManager == null) {
|
||||
info.ReplyToCommand("Zone factory or manager not found");
|
||||
return;
|
||||
}
|
||||
|
||||
var position = executor.PlayerPawn.Value.AbsOrigin;
|
||||
|
||||
if (info.ArgCount <= 1) {
|
||||
@@ -90,17 +86,15 @@ public class DebugZone(IServiceProvider services, BasePlugin plugin)
|
||||
}
|
||||
|
||||
if (zoneCount == 0) {
|
||||
if (specifiedType.HasValue)
|
||||
info.ReplyToCommand($"No {specifiedType} zones found");
|
||||
else
|
||||
info.ReplyToCommand("No zones found");
|
||||
info.ReplyToCommand(specifiedType.HasValue ?
|
||||
$"No {specifiedType} zones found" :
|
||||
"No zones found");
|
||||
return;
|
||||
}
|
||||
|
||||
if (specifiedType.HasValue)
|
||||
info.ReplyToCommand($"Showing {zoneCount} {specifiedType} zones");
|
||||
else
|
||||
info.ReplyToCommand($"Showing {zoneCount} zones");
|
||||
info.ReplyToCommand(specifiedType.HasValue ?
|
||||
$"Showing {zoneCount} {specifiedType} zones" :
|
||||
$"Showing {zoneCount} zones");
|
||||
return;
|
||||
case "remove":
|
||||
case "delete":
|
||||
@@ -130,7 +124,6 @@ public class DebugZone(IServiceProvider services, BasePlugin plugin)
|
||||
return;
|
||||
case "reload":
|
||||
case "refresh":
|
||||
// Server.NextFrameAsync(async () => {
|
||||
Task.Run(async () => {
|
||||
await zoneManager.LoadZones(Server.MapName);
|
||||
var count = (await zoneManager.GetAllZones()).SelectMany(e => e.Value)
|
||||
@@ -186,11 +179,10 @@ public class DebugZone(IServiceProvider services, BasePlugin plugin)
|
||||
.GetAwaiter()
|
||||
.GetResult();
|
||||
|
||||
var toRemove = new List<IZone>();
|
||||
foreach (var spawn in spawns)
|
||||
if (doNotTeleport.Any(d
|
||||
=> d.IsInsideZone(spawn.CalculateCenterPoint())))
|
||||
toRemove.Add(spawn);
|
||||
var toRemove = spawns.Where(spawn
|
||||
=> doNotTeleport.Any(
|
||||
d => d.IsInsideZone(spawn.CalculateCenterPoint())))
|
||||
.ToList();
|
||||
|
||||
info.ReplyToCommand("Removing " + toRemove.Count
|
||||
+ " auto-generated zones");
|
||||
|
||||
@@ -16,19 +16,11 @@ public class SoccerCommandBehavior(IWardenService warden,
|
||||
new("css_jb_max_soccers",
|
||||
"The maximum number of soccer balls that the warden can spawn", 3);
|
||||
|
||||
private int soccers;
|
||||
|
||||
public void Start(BasePlugin basePlugin) {
|
||||
basePlugin.RegisterListener<Listeners.OnServerPrecacheResources>(manifest
|
||||
=> {
|
||||
manifest.AddResource(
|
||||
"models/props/de_dust/hr_dust/dust_soccerball/dust_soccer_ball001.vmdl");
|
||||
});
|
||||
}
|
||||
private int soccerBalls;
|
||||
|
||||
[GameEventHandler]
|
||||
public HookResult OnRoundStart(EventRoundStart @event, GameEventInfo info) {
|
||||
soccers = 0;
|
||||
soccerBalls = 0;
|
||||
return HookResult.Continue;
|
||||
}
|
||||
|
||||
@@ -42,7 +34,7 @@ public class SoccerCommandBehavior(IWardenService warden,
|
||||
return;
|
||||
}
|
||||
|
||||
if (soccers >= CV_MAX_SOCCERS.Value) {
|
||||
if (soccerBalls >= CV_MAX_SOCCERS.Value) {
|
||||
locale.TooManySoccers.ToChat(player);
|
||||
return;
|
||||
}
|
||||
@@ -66,6 +58,6 @@ public class SoccerCommandBehavior(IWardenService warden,
|
||||
ball.Teleport(loc);
|
||||
locale.SoccerSpawned.ToAllChat();
|
||||
ball.DispatchSpawn();
|
||||
soccers++;
|
||||
soccerBalls++;
|
||||
}
|
||||
}
|
||||
@@ -39,6 +39,8 @@ public class Jailbreak : BasePlugin {
|
||||
manifest.AddResource("soundevents/soundevents_jb.vsndevts");
|
||||
manifest.AddResource("sounds/explosion.vsnd");
|
||||
manifest.AddResource("sounds/jihad.vsnd");
|
||||
manifest.AddResource(
|
||||
"models/props/de_dust/hr_dust/dust_soccerball/dust_soccer_ball001.vmdl");
|
||||
});
|
||||
|
||||
// Load Managers
|
||||
|
||||
Reference in New Issue
Block a user