-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
195 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net7.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\public\Jailbreak.Public\Jailbreak.Public.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using CounterStrikeSharp.API.Core; | ||
using Jailbreak.Public.Mod.LastRequest; | ||
|
||
namespace Jailbreak.LastRequest; | ||
|
||
public class LastRequestService : ILastRequestService | ||
{ | ||
public bool IsLastRequestActive() | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public bool SetLastRequestActive(bool lastRequest) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public AbstractLastRequest? GetLastRequest(CCSPlayerController player) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public bool SetLastRequest(CCSPlayerController player, AbstractLastRequest lastRequest) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using Jailbreak.Public.Mod.LastRequest; | ||
using Microsoft.Extensions.DependencyInjection; | ||
|
||
namespace Jailbreak.LastRequest; | ||
|
||
public static class LastRequestServiceExtension | ||
{ | ||
public static void AddJailbreakLastRequest(this IServiceCollection services) | ||
{ | ||
services.AddPluginBehavior<ILastRequestService, LastRequestService>(); | ||
Check failure on line 10 in mod/Jailbreak.LastRequest/LastRequestServiceExtension.cs GitHub Actions / build
Check failure on line 10 in mod/Jailbreak.LastRequest/LastRequestServiceExtension.cs GitHub Actions / build
|
||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
mod/Jailbreak.LastRequest/LastRequests/OneOnOne/WeaponFight.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using CounterStrikeSharp.API.Core; | ||
using Jailbreak.Public.Mod.LastRequest; | ||
|
||
namespace Jailbreak.LastRequest.LastRequests.OneOnOne; | ||
|
||
public class WeaponFight : AbstractLastRequest | ||
{ | ||
public WeaponFight(BasePlugin plugin, CCSPlayerController prisoner, CCSPlayerController guard) : base(plugin, prisoner, guard) | ||
{ | ||
} | ||
protected override void OnStart() | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} |
50 changes: 50 additions & 0 deletions
50
public/Jailbreak.Public/Mod/LastRequest/AbstractLastRequest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
using CounterStrikeSharp.API.Core; | ||
using CounterStrikeSharp.API.Modules.Utils; | ||
using Jailbreak.Public.Behaviors; | ||
using Jailbreak.Public.Extensions; | ||
|
||
namespace Jailbreak.Public.Mod.LastRequest; | ||
|
||
public abstract class AbstractLastRequest : IPluginBehavior | ||
{ | ||
public string Name { get; } | ||
public LastRequestState State { get; protected set; } | ||
public LastRequestCategory Category { get; } | ||
|
||
protected Dictionary<Type, LastRequestOptions> options = new (); | ||
|
||
protected ISet<CCSPlayerController> members; | ||
protected BasePlugin plugin; | ||
|
||
protected AbstractLastRequest(BasePlugin plugin, CCSPlayerController prisoner, CCSPlayerController guard) | ||
{ | ||
this.plugin = plugin; | ||
members = new HashSet<CCSPlayerController> {prisoner, guard}; | ||
// options[GenericLastRequestOptions] = new GenericLastRequestOptions(this); | ||
} | ||
|
||
public void Start(long delay = 0) | ||
{ | ||
plugin.AddTimer(delay, (() => | ||
{ | ||
OnStart(); | ||
})); | ||
} | ||
|
||
protected abstract void OnStart(); | ||
|
||
public ISet<CCSPlayerController> GetCTs() | ||
{ | ||
return members.Where(x => x.GetTeam() == CsTeam.CounterTerrorist).ToHashSet(); | ||
} | ||
|
||
public ISet<CCSPlayerController> GetTs() | ||
{ | ||
return members.Where(x => x.GetTeam() == CsTeam.Terrorist).ToHashSet(); | ||
} | ||
|
||
public CCSPlayerController GetT() | ||
{ | ||
return GetTs().First(); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
public/Jailbreak.Public/Mod/LastRequest/GenericLastRequestOptions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
namespace Jailbreak.Public.Mod.LastRequest; | ||
|
||
public class GenericLastRequestOptions : LastRequestOptions | ||
{ | ||
public GenericLastRequestOptions(AbstractLastRequest baseRequest) : base(baseRequest) | ||
{ | ||
} | ||
|
||
public override void GetOptions() | ||
{ | ||
} | ||
|
||
public int GetMaxTime() | ||
{ | ||
return 60; | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
public/Jailbreak.Public/Mod/LastRequest/ILastRequestService.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using CounterStrikeSharp.API.Core; | ||
|
||
namespace Jailbreak.Public.Mod.LastRequest; | ||
|
||
public interface ILastRequestService | ||
{ | ||
bool IsLastRequestActive(); | ||
bool SetLastRequestActive(bool lastRequest); | ||
|
||
bool IsInLastRequest(CCSPlayerController player) | ||
{ | ||
return GetLastRequest(player) == null; | ||
} | ||
|
||
AbstractLastRequest? GetLastRequest(CCSPlayerController player); | ||
bool SetLastRequest(CCSPlayerController player, AbstractLastRequest lastRequest); | ||
|
||
} |
10 changes: 10 additions & 0 deletions
10
public/Jailbreak.Public/Mod/LastRequest/LastRequestCategory.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
namespace Jailbreak.Public.Mod.LastRequest; | ||
|
||
public enum LastRequestCategory | ||
{ | ||
COMBAT, | ||
RANDOM, | ||
TECHNICAL, | ||
KNOWLEDGE, | ||
OTHER | ||
} |
13 changes: 13 additions & 0 deletions
13
public/Jailbreak.Public/Mod/LastRequest/LastRequestOptions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
namespace Jailbreak.Public.Mod.LastRequest; | ||
|
||
public abstract class LastRequestOptions | ||
{ | ||
protected AbstractLastRequest baseRequest; | ||
|
||
public LastRequestOptions(AbstractLastRequest baseRequest) | ||
{ | ||
this.baseRequest = baseRequest; | ||
} | ||
|
||
public abstract void GetOptions(); | ||
} |
10 changes: 10 additions & 0 deletions
10
public/Jailbreak.Public/Mod/LastRequest/LastRequestState.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
namespace Jailbreak.Public.Mod.LastRequest; | ||
|
||
public enum LastRequestState | ||
{ | ||
BEGINNING, // Last Request has been announced, players might be frozen or waiting for guns | ||
PLAYING, // Last Request is currently in progress, players should be actively playing (throwing he nades, knife | ||
// fights, etc) | ||
RUSHING, // Last Request is taking too long, we need to speed things up | ||
ENDED // Last Request has ended, one of the players should be dead | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters