Skip to content

Commit

Permalink
add rebel_cant_lr
Browse files Browse the repository at this point in the history
  • Loading branch information
destoer committed Jan 26, 2024
1 parent 26d51a2 commit f38ca9f
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
"warden.swap_guard_desc": "Expected usage: !swap_guard <player name>",
"warden.wsd_command_desc": "!wsd - Call a warden special day",
"warden.wsd_ff_command_desc": "!wsd - Call a warden friendly fire special day",
"warden.give_pardon_command_desc": "!give_pardon : pardon a rebel",
"warden.give_freeday_command_desc": "!give_freeday: give a t a freeday",
"warden.colour_command_desc": "!colour : set prisoner colour",
"warden.warden_req_alive": "You must be alive to warden",
"warden.warden_req_ct": "You must be a CT to warden",
"warden.warden_taken": "{0} is already the warden",
Expand Down Expand Up @@ -130,6 +133,7 @@
"lr.knife_rebel": "{0} is knife a rebel!",
"lr.ready": "Last request is available! Type !lr",
"lr.wait": "Please wait 15 seconds into the round before starting an lr",
"lr.rebel_cant_lr": "Rebels cannot lr please ask the warden for a pardon",

"lr.cancel_lr_cmd": "cancel_lr",
"lr.start_lr_cmd": "lr",
Expand Down
3 changes: 3 additions & 0 deletions src/Jail.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ public class JailConfig : BasePluginConfig
[JsonPropertyName("colour_rebel")]
public bool colour_rebel { get; set; } = false;

[JsonPropertyName("rebel_cant_lr")]
public bool rebel_cant_lr { get; set; } = false;

[JsonPropertyName("lr_knife")]
public bool lr_knife { get; set; } = true;

Expand Down
7 changes: 7 additions & 0 deletions src/LastRequest/LastRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,13 @@ bool can_start_lr(CCSPlayerController? player)
{
return false;
}

if(JailPlugin.warden.is_alive_rebel(player) && config.rebel_cant_lr)
{
player.localise_prefix(LR_PREFIX,"lr.rebel_cant_lr");
return false;
}


if(Lib.alive_t_count() > active_lr.Length)
{
Expand Down
5 changes: 4 additions & 1 deletion src/Warden/Warden.cs
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ public void give_pardon_callback(CCSPlayerController? invoke, ChatMenuOption opt
jail_player?.give_pardon(player);
}

bool is_alive_rebel(CCSPlayerController? player)
public bool is_alive_rebel(CCSPlayerController? player)
{
var jail_player = jail_player_from_player(player);

Expand Down Expand Up @@ -390,6 +390,9 @@ public void cmd_info(CCSPlayerController? player, CommandInfo command)
player.localize("warden.marker_colour_command_desc");
player.localize("warden.wsd_command_desc");
player.localize("warden.wsd_ff_command_desc");
player.localize("warden.give_pardon_command_desc");
player.localize("warden.give_freeday_command_desc");
player.localize("warden.colour_command_desc");
}

public void take_warden_cmd(CCSPlayerController? player, CommandInfo command)
Expand Down

0 comments on commit f38ca9f

Please sign in to comment.