Skip to content

Commit

Permalink
New Special Days, Fixes, and Enhancements (#261)
Browse files Browse the repository at this point in the history
**Summary:** This PR merges the latest changes from the `dev` branch
into the `main` branch, encompassing numerous enhancements and fixes.

**Key Changes:**
1. **Speedrunners Day:** 
   - Introduced Speedrunners Day with a new trail system.
   - Added various fixes and improvements.

2. **Teleport Day:**
   - Implemented Teleport Day.
   - Fixed teleportation logic.

3. **One in the Chamber (OITC):**
   - Added OITC as a special day.
   - Enhanced handling for null values and weapon overrides.

4. **New Special Days:**
   - Introduced Shot4Shot and Mag4Mag days.

5. **General Fixes and Improvements:**
   - Fixed SQL messages, zombie logic, and event hooks.
   - Updated formatting and code clean-up.

6. **Automation:**
   - Added automatic zone generation.
  • Loading branch information
MSWS authored Aug 3, 2024
2 parents 997ae02 + 49163c4 commit 62ca702
Show file tree
Hide file tree
Showing 153 changed files with 3,187 additions and 1,300 deletions.
7 changes: 7 additions & 0 deletions Jailbreak.sln
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jailbreak.SpecialDay", "mod
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jailbreak.Zones", "mod\Jailbreak.Zones\Jailbreak.Zones.csproj", "{C93A626A-BB44-4309-8DAD-4B28B2941870}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jailbreak.Trail", "mod\Jailbreak.Trail\Jailbreak.Trail.csproj", "{91F4EC7A-993A-4CA0-84C3-9F1100124A9C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -110,6 +112,10 @@ Global
{C93A626A-BB44-4309-8DAD-4B28B2941870}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C93A626A-BB44-4309-8DAD-4B28B2941870}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C93A626A-BB44-4309-8DAD-4B28B2941870}.Release|Any CPU.Build.0 = Release|Any CPU
{91F4EC7A-993A-4CA0-84C3-9F1100124A9C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{91F4EC7A-993A-4CA0-84C3-9F1100124A9C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{91F4EC7A-993A-4CA0-84C3-9F1100124A9C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{91F4EC7A-993A-4CA0-84C3-9F1100124A9C}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{9135CCC9-66C5-4A9C-AE3C-91475B5F0437} = {177DA48D-8306-4102-918D-992569878581}
Expand All @@ -128,5 +134,6 @@ Global
{79B7496B-116D-4B87-BBBE-46DD19A9BFEB} = {59311734-3648-43C2-B43C-385718B0D103}
{A6249693-5B7E-4E14-A675-C292914F10F3} = {36BA84C0-291C-4930-A7C6-97CDF8F7F0D7}
{C93A626A-BB44-4309-8DAD-4B28B2941870} = {36BA84C0-291C-4930-A7C6-97CDF8F7F0D7}
{91F4EC7A-993A-4CA0-84C3-9F1100124A9C} = {36BA84C0-291C-4930-A7C6-97CDF8F7F0D7}
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace Jailbreak.English.Generic;

public class GenericCommandNotifications : IGenericCommandNotifications,
public class GenericCmdLocale : IGenericCmdLocale,
ILanguage<Formatting.Languages.English> {
private static readonly FormatObject PREFIX =
new HiddenFormatObject(
Expand Down Expand Up @@ -53,4 +53,10 @@ public IView NoPermissionMessage(string permission) {
$"{ChatColors.Red}This command requires the {ChatColors.White}{permission}{ChatColors.Red} permission."
};
}

public IView Error(string message) {
return new SimpleView {
PREFIX, $"{ChatColors.Red}An error occurred: {ChatColors.White}{message}"
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@

namespace Jailbreak.English.LastGuard;

public class LastGuardNotifications : ILastGuardNotifications,
ILanguage<Formatting.Languages.English> {
public class LGLocale : ILGLocale, ILanguage<Formatting.Languages.English> {
private static readonly FormatObject PREFIX =
new HiddenFormatObject(
$" {ChatColors.DarkRed}[{ChatColors.LightRed}Last Guard{ChatColors.DarkRed}]") {
Expand Down
17 changes: 17 additions & 0 deletions lang/Jailbreak.English/LastRequest/B4BLocale.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using CounterStrikeSharp.API.Core;
using Jailbreak.Formatting.Base;
using Jailbreak.Formatting.Views.LastRequest;

namespace Jailbreak.English.LastRequest;

public class B4BLocale : LastRequestLocale, ILRB4BLocale {
public IView PlayerGoesFirst(CCSPlayerController player) {
return new SimpleView {
PREFIX, "Randomly selected", player, "to go first."
};
}

public IView WeaponSelected(CCSPlayerController player, string weapon) {
return new SimpleView { PREFIX, player, "picked", weapon };
}
}
40 changes: 40 additions & 0 deletions lang/Jailbreak.English/LastRequest/CoinflipLocale.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
using CounterStrikeSharp.API.Core;
using CounterStrikeSharp.API.Modules.Utils;
using Jailbreak.Formatting.Base;
using Jailbreak.Formatting.Views.LastRequest;

namespace Jailbreak.English.LastRequest;

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"
};
}

public IView GuardChose(CCSPlayerController guard, bool choice) {
return new SimpleView {
PREFIX,
guard,
" chose " + ChatColors.Green,
choice ? "Heads" : "Tails",
ChatColors.Default + ", flipping..."
};
}

public IView CoinLandsOn(bool heads) {
return new SimpleView {
PREFIX, "The coin lands on " + ChatColors.Green, heads ? "Heads" : "Tails"
};
}

public IView FailedToChooseInTime(string choice) {
return new SimpleView {
PREFIX,
"You failed to choose in time, defaulting to " + ChatColors.Green,
choice
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
using Jailbreak.Formatting.Core;
using Jailbreak.Formatting.Logistics;
using Jailbreak.Formatting.Objects;
using Jailbreak.Formatting.Views;
using Jailbreak.Formatting.Views.LastRequest;
using Jailbreak.Public.Extensions;
using Jailbreak.Public.Mod.LastRequest;
using Jailbreak.Public.Mod.LastRequest.Enums;

namespace Jailbreak.English.LastRequest;

public class LastRequestMessages : ILastRequestMessages,
public class LastRequestLocale : ILRLocale,
ILanguage<Formatting.Languages.English> {
public static readonly FormatObject PREFIX =
new HiddenFormatObject(
Expand Down Expand Up @@ -48,16 +48,6 @@ public IView InvalidLastRequest(string query) {
return new SimpleView { PREFIX, "Invalid Last Request: ", query };
}

public IView InvalidPlayerChoice(CCSPlayerController player, string reason) {
return new SimpleView {
PREFIX,
"Invalid player choice: ",
player,
" Reason: ",
reason
};
}

public IView InformLastRequest(AbstractLastRequest lr) {
return new SimpleView {
PREFIX,
Expand Down Expand Up @@ -132,11 +122,41 @@ public IView CannotLR(CCSPlayerController player, string reason) {
};
}

public IView LastRequestCountdown(int seconds) {
return new SimpleView { PREFIX, "Starting in", seconds, "..." };
}

public IView WinByDefault(CCSPlayerController player) {
return new SimpleView { PREFIX, player, "won by default." };
}

public IView WinByHealth(CCSPlayerController player) {
return new SimpleView { PREFIX, player, "won by health." };
}

public IView WinByReason(CCSPlayerController player, string reason) {
return new SimpleView { PREFIX, player, "won by", reason + "." };
}

public IView Win(CCSPlayerController player) {
return new SimpleView { PREFIX, player, "won." };
}

public IView DamageBlockedInsideLastRequest
=> new SimpleView { PREFIX, "You or they are in LR, damage blocked." };

public IView DamageBlockedNotInSameLR
=> new SimpleView {
PREFIX, "You are not in the same LR as them, damage blocked."
};

public IView InvalidPlayerChoice(CCSPlayerController player, string reason) {
return new SimpleView {
PREFIX,
"Invalid player choice: ",
player,
" Reason: ",
reason
};
}
}
45 changes: 45 additions & 0 deletions lang/Jailbreak.English/LastRequest/RPSLocale.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
using CounterStrikeSharp.API.Core;
using Jailbreak.Formatting.Base;
using Jailbreak.Formatting.Views.LastRequest;

namespace Jailbreak.English.LastRequest;

public class RPSLocale : LastRequestLocale, ILRRPSLocale {
public IView PlayerMadeChoice(CCSPlayerController player) {
return new SimpleView { PREFIX, player, "made their choice." };
}

public IView BothPlayersMadeChoice() {
return new SimpleView {
PREFIX, "Both players have rocked, papered, and scissored! (ew)"
};
}

public IView Tie() {
return new SimpleView { PREFIX, "It's a tie! Let's go again!" };
}

public IView Results(CCSPlayerController guard, CCSPlayerController prisoner,
int guardPick, int prisonerPick) {
return new SimpleView {
PREFIX,
"Results: ",
guard,
" picked ",
toRPS(guardPick),
" and ",
prisoner,
" picked ",
toRPS(prisonerPick)
};
}

private string toRPS(int pick) {
return pick switch {
0 => "Rock",
1 => "Paper",
2 => "Scissors",
_ => "Unknown"
};
}
}
Original file line number Diff line number Diff line change
@@ -1,35 +1,33 @@
using CounterStrikeSharp.API.Core;
using CounterStrikeSharp.API.Modules.Utils;
using Jailbreak.Formatting.Base;
using Jailbreak.Formatting.Logistics;
using Jailbreak.Formatting.Views;
using Jailbreak.Formatting.Views.LastRequest;

namespace Jailbreak.English.LastRequest;

// ReSharper disable ClassNeverInstantiated.Global
public class RaceLRMessages : IRaceLRMessages,
ILanguage<Formatting.Languages.English> {
public class RaceLocale : LastRequestLocale, ILRRaceLocale {
public IView EndRaceInstruction
=> new SimpleView {
{
LastRequestMessages.PREFIX,
$"Type ${ChatColors.Blue}!endrace${ChatColors.White} to set the end point!"
PREFIX,
$"Type {ChatColors.Blue}!endrace{ChatColors.White} to set the end point!"
},
SimpleView.NEWLINE, {
LastRequestMessages.PREFIX,
$"Type ${ChatColors.Blue}!endrace${ChatColors.White} to set the end point!"
PREFIX,
$"Type {ChatColors.Blue}!endrace{ChatColors.White} to set the end point!"
},
SimpleView.NEWLINE, {
LastRequestMessages.PREFIX,
$"Type ${ChatColors.Blue}!endrace${ChatColors.White} to set the end point!"
PREFIX,
$"Type {ChatColors.Blue}!endrace{ChatColors.White} to set the end point!"
},
SimpleView.NEWLINE
};

public IView RaceStartingMessage(CCSPlayerController prisoner) {
return new SimpleView {
{
LastRequestMessages.PREFIX, prisoner,
PREFIX, prisoner,
" is starting a race. Pay attention to where they set the end point!"
}
};
Expand All @@ -38,18 +36,15 @@ public IView RaceStartingMessage(CCSPlayerController prisoner) {
public IView NotInRaceLR() {
return new SimpleView {
{
LastRequestMessages.PREFIX,
PREFIX,
$"You must be in a race {ChatColors.Blue + "!lr" + ChatColors.White} to use this command"
}
};
}

public IView NotInPendingState() {
return new SimpleView {
{
LastRequestMessages.PREFIX,
"You must be in the pending state to use this command."
}
{ PREFIX, "You must be in the pending state to use this command." }
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@

namespace Jailbreak.English.Logs;

public class
LogMessages : ILogMessages, ILanguage<Formatting.Languages.English> {
public class LogLocale : ILogLocale, ILanguage<Formatting.Languages.English> {
public IView BeginJailbreakLogs
=> new SimpleView {
"********************************",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
using Jailbreak.Formatting.Core;
using Jailbreak.Formatting.Logistics;
using Jailbreak.Formatting.Objects;
using Jailbreak.Formatting.Views;
using Jailbreak.Formatting.Views.Warden;

namespace Jailbreak.English.Mute;

public class PeaceMessages : IPeaceMessages,
public class WardenPeaceLocale : IWardenPeaceLocale,
ILanguage<Formatting.Languages.English> {
private static readonly FormatObject PREFIX =
new HiddenFormatObject(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,16 @@

namespace Jailbreak.English.Rebel;

public class JihadC4Notifications : IJihadC4Notifications,
ILanguage<Formatting.Languages.English> {
public class C4Locale : IC4Locale, ILanguage<Formatting.Languages.English> {
public IView JihadC4Pickup
=> new SimpleView {
RebelNotifications.PREFIX, "You picked up a Jihad C4!"
};
=> new SimpleView { RebelLocale.PREFIX, "You picked up a Jihad C4!" };

public IView JihadC4Received
=> new SimpleView { RebelNotifications.PREFIX, "You received a Jihad C4!" };
=> new SimpleView { RebelLocale.PREFIX, "You received a Jihad C4!" };

public IView JihadC4Usage1
=> new SimpleView {
RebelNotifications.PREFIX,
RebelLocale.PREFIX,
$"To detonate it, hold it out and press {ChatColors.Yellow + "E" + ChatColors.Default}."
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace Jailbreak.English.Rebel;

public class RebelNotifications : IRebelNotifications,
public class RebelLocale : IRebelLocale,
ILanguage<Formatting.Languages.English> {
public static readonly FormatObject PREFIX =
new HiddenFormatObject(
Expand Down
27 changes: 27 additions & 0 deletions lang/Jailbreak.English/SpecialDay/HNSDayLocale.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using Jailbreak.Formatting.Base;

namespace Jailbreak.English.SpecialDay;

public class HNSDayLocale() : TeamDayLocale("Hide and Seek",
"CTs must hide while the Ts seek!", "Ts have 250 HP!") {
public IView StayInArmory
=> new SimpleView { PREFIX, "Today is", Name, ", stay in the armory!" };

public override IView BeginsIn(int seconds) {
if (seconds == 0)
return new SimpleView { PREFIX, "Ready or not, here they come!" };
return new SimpleView {
PREFIX,
Name,
"begins in",
seconds,
"seconds."
};
}

public IView DamageWarning(int seconds) {
return new SimpleView {
PREFIX, "You will be vulnerable to damage in", seconds, "seconds."
};
}
}
Loading

0 comments on commit 62ca702

Please sign in to comment.