mirror of
https://github.com/MSWS/TTT.git
synced 2025-12-07 06:46:59 -08:00
Compare commits
43 Commits
1.0.1-dev.
...
1.3.0-dev.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0d8643dfe3 | ||
|
|
50d078f78e | ||
|
|
edbff4e17f | ||
|
|
b4452d7ff3 | ||
|
|
fd32744bf6 | ||
|
|
657306c1c7 | ||
|
|
2c800b471b | ||
|
|
2787823f86 | ||
|
|
a5f419aad9 | ||
|
|
430a8c4a7f | ||
|
|
a7a44b50f9 | ||
|
|
3b4bf490bc | ||
|
|
abe75d0347 | ||
|
|
eb79552ba3 | ||
|
|
e2011b8d24 | ||
|
|
ec41a6f367 | ||
|
|
9b1bed6982 | ||
|
|
8584877739 | ||
|
|
410dd407b3 | ||
|
|
a0bba2c4ba | ||
|
|
8aa508bf6d | ||
|
|
642155b1bc | ||
|
|
bacd288fe7 | ||
|
|
29e28038b8 | ||
|
|
7ce5293ad3 | ||
|
|
b253d8ee12 | ||
|
|
02575b51e2 | ||
|
|
d8d365b497 | ||
|
|
1ac38dc0ad | ||
|
|
62e57ffa97 | ||
|
|
81e6b2e695 | ||
|
|
ae99fab18e | ||
|
|
99ed6bd69b | ||
|
|
79ab6f9705 | ||
|
|
80a9cb2af1 | ||
|
|
c4a73f9a24 | ||
|
|
8fa2377e1e | ||
|
|
dbe664d18f | ||
|
|
5717ab612a | ||
|
|
f6b79ef038 | ||
|
|
cc52d19108 | ||
|
|
a1d595ce8a | ||
|
|
23f502a381 |
37
LICENSES.MD
37
LICENSES.MD
@@ -1,20 +1,17 @@
|
||||
| Package | Version | License Information Origin | License Expression | License Url | Copyright | Authors | Package Project Url |
|
||||
| ----------------------------------------------------- | -------- | -------------------------- | ------------------ | --------------------------------------- | ----------------------------------------------- | ------------------------------------ | ------------------------------------------------------------------------------------------------ |
|
||||
| CounterStrikeSharp.API | 1.0.332 | Expression | GPL-3.0-only | https://licenses.nuget.org/GPL-3.0-only | | Roflmuffin | http://docs.cssharp.dev/ |
|
||||
| CounterStrikeSharp.API | 1.0.340 | Expression | GPL-3.0-only | https://licenses.nuget.org/GPL-3.0-only | | Roflmuffin | http://docs.cssharp.dev/ |
|
||||
| Dapper | 2.1.66 | Expression | Apache-2.0 | https://licenses.nuget.org/Apache-2.0 | 2019 Stack Exchange, Inc. | Sam Saffron,Marc Gravell,Nick Craver | https://github.com/DapperLib/Dapper |
|
||||
| JetBrains.Annotations | 2025.2.0 | Expression | MIT | https://licenses.nuget.org/MIT | Copyright (c) 2016-2025 JetBrains s.r.o. | JetBrains | https://www.jetbrains.com/help/resharper/Code_Analysis__Code_Annotations.html |
|
||||
| Microsoft.Data.Sqlite | 9.0.9 | Expression | MIT | https://licenses.nuget.org/MIT | © Microsoft Corporation. All rights reserved. | Microsoft | https://docs.microsoft.com/dotnet/standard/data/sqlite/ |
|
||||
| Microsoft.Extensions.DependencyInjection.Abstractions | 9.0.7 | Expression | MIT | https://licenses.nuget.org/MIT | © Microsoft Corporation. All rights reserved. | Microsoft | https://dot.net/ |
|
||||
| Microsoft.Extensions.Localization.Abstractions | 8.0.3 | Expression | MIT | https://licenses.nuget.org/MIT | © Microsoft Corporation. All rights reserved. | Microsoft | https://asp.net/ |
|
||||
| Microsoft.NET.Test.Sdk | 17.14.1 | Expression | MIT | https://licenses.nuget.org/MIT | © Microsoft Corporation. All rights reserved. | Microsoft | https://github.com/microsoft/vstest |
|
||||
| Microsoft.Reactive.Testing | 6.0.1 | Expression | MIT | https://licenses.nuget.org/MIT | Copyright (c) .NET Foundation and Contributors. | .NET Foundation and Contributors | https://github.com/dotnet/reactive |
|
||||
| Microsoft.Testing.Extensions.CodeCoverage | 17.14.2 | Unknown | | https://aka.ms/deprecateLicenseUrl | © Microsoft Corporation. All rights reserved. | Microsoft | https://github.com/microsoft/codecoverage |
|
||||
| MySqlConnector | 2.4.0 | Expression | MIT | https://licenses.nuget.org/MIT | Copyright 2016–2024 Bradley Grainger | Bradley Grainger | https://mysqlconnector.net/ |
|
||||
| SQLite | 3.13.0 | Unknown | | | Public Domain | SQLite Development Team | |
|
||||
| System.Reactive | 6.0.1 | Expression | MIT | https://licenses.nuget.org/MIT | Copyright (c) .NET Foundation and Contributors. | .NET Foundation and Contributors | https://github.com/dotnet/reactive |
|
||||
| System.Text.Json | 8.0.5 | Expression | MIT | https://licenses.nuget.org/MIT | © Microsoft Corporation. All rights reserved. | Microsoft | https://dot.net/ |
|
||||
| Xunit.DependencyInjection | 10.6.0 | Expression | MIT | https://licenses.nuget.org/MIT | Copyright © 2019 | Wei Peng | https://github.com/pengweiqhca/Xunit.DependencyInjection/tree/main/src/Xunit.DependencyInjection |
|
||||
| xunit.runner.visualstudio | 3.1.3 | Expression | Apache-2.0 | https://licenses.nuget.org/Apache-2.0 | Copyright (C) .NET Foundation | jnewkirk,bradwilson | |
|
||||
| xunit.v3 | 3.0.0 | Expression | Apache-2.0 | https://licenses.nuget.org/Apache-2.0 | Copyright (C) .NET Foundation | jnewkirk,bradwilson | |
|
||||
| YamlDotNet | 16.3.0 | Expression | MIT | https://licenses.nuget.org/MIT | Copyright (c) Antoine Aubry and contributors | Antoine Aubry | https://github.com/aaubry/YamlDotNet/wiki |
|
||||
| Package | Version | License Information Origin | License Expression | License Url | Copyright | Authors | Package Project Url |
|
||||
| ----------------------------------------------------- | -------- | -------------------------- | ------------------ | --------------------------------------- | ----------------------------------------------- | -------------------------------- | ------------------------------------------------------------------------------------------------ |
|
||||
| CounterStrikeSharp.API | 1.0.332 | Expression | GPL-3.0-only | https://licenses.nuget.org/GPL-3.0-only | | Roflmuffin | http://docs.cssharp.dev/ |
|
||||
| CounterStrikeSharp.API | 1.0.342 | Expression | GPL-3.0-only | https://licenses.nuget.org/GPL-3.0-only | | Roflmuffin | http://docs.cssharp.dev/ |
|
||||
| JetBrains.Annotations | 2025.2.0 | Expression | MIT | https://licenses.nuget.org/MIT | Copyright (c) 2016-2025 JetBrains s.r.o. | JetBrains | https://www.jetbrains.com/help/resharper/Code_Analysis__Code_Annotations.html |
|
||||
| Microsoft.Data.Sqlite | 9.0.9 | Expression | MIT | https://licenses.nuget.org/MIT | © Microsoft Corporation. All rights reserved. | Microsoft | https://docs.microsoft.com/dotnet/standard/data/sqlite/ |
|
||||
| Microsoft.Extensions.DependencyInjection.Abstractions | 9.0.7 | Expression | MIT | https://licenses.nuget.org/MIT | © Microsoft Corporation. All rights reserved. | Microsoft | https://dot.net/ |
|
||||
| Microsoft.Extensions.Localization.Abstractions | 8.0.3 | Expression | MIT | https://licenses.nuget.org/MIT | © Microsoft Corporation. All rights reserved. | Microsoft | https://asp.net/ |
|
||||
| Microsoft.NET.Test.Sdk | 17.14.1 | Expression | MIT | https://licenses.nuget.org/MIT | © Microsoft Corporation. All rights reserved. | Microsoft | https://github.com/microsoft/vstest |
|
||||
| Microsoft.Reactive.Testing | 6.0.1 | Expression | MIT | https://licenses.nuget.org/MIT | Copyright (c) .NET Foundation and Contributors. | .NET Foundation and Contributors | https://github.com/dotnet/reactive |
|
||||
| Microsoft.Testing.Extensions.CodeCoverage | 17.14.2 | Unknown | | https://aka.ms/deprecateLicenseUrl | © Microsoft Corporation. All rights reserved. | Microsoft | https://github.com/microsoft/codecoverage |
|
||||
| System.Reactive | 6.0.1 | Expression | MIT | https://licenses.nuget.org/MIT | Copyright (c) .NET Foundation and Contributors. | .NET Foundation and Contributors | https://github.com/dotnet/reactive |
|
||||
| System.Text.Json | 8.0.5 | Expression | MIT | https://licenses.nuget.org/MIT | © Microsoft Corporation. All rights reserved. | Microsoft | https://dot.net/ |
|
||||
| Xunit.DependencyInjection | 10.6.0 | Expression | MIT | https://licenses.nuget.org/MIT | Copyright © 2019 | Wei Peng | https://github.com/pengweiqhca/Xunit.DependencyInjection/tree/main/src/Xunit.DependencyInjection |
|
||||
| xunit.runner.visualstudio | 3.1.3 | Expression | Apache-2.0 | https://licenses.nuget.org/Apache-2.0 | Copyright (C) .NET Foundation | jnewkirk,bradwilson | |
|
||||
| xunit.v3 | 3.0.0 | Expression | Apache-2.0 | https://licenses.nuget.org/Apache-2.0 | Copyright (C) .NET Foundation | jnewkirk,bradwilson | |
|
||||
| YamlDotNet | 16.3.0 | Expression | MIT | https://licenses.nuget.org/MIT | Copyright (c) Antoine Aubry and contributors | Antoine Aubry | https://github.com/aaubry/YamlDotNet/wiki |
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using JetBrains.Annotations;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using SpecialRoundAPI.Configs;
|
||||
using TTT.API;
|
||||
using TTT.API.Events;
|
||||
using TTT.Game.Events.Game;
|
||||
using TTT.Game.Listeners;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
namespace SpecialRoundAPI.Configs;
|
||||
|
||||
public record BhopRoundConfig : SpecialRoundConfig {
|
||||
public override float Weight { get; init; } = 0.2f;
|
||||
public override float Weight { get; init; } = 0.25f;
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
namespace SpecialRoundAPI.Configs;
|
||||
|
||||
public record PistolRoundConfig : SpecialRoundConfig {
|
||||
public override float Weight { get; init; } = 0.75f;
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
namespace SpecialRoundAPI.Configs;
|
||||
|
||||
public record SilentRoundConfig : SpecialRoundConfig {
|
||||
public override float Weight { get; init; } = 0.1f;
|
||||
public override float Weight { get; init; } = 0.5f;
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
namespace SpecialRoundAPI.Configs;
|
||||
|
||||
public record SpeedRoundConfig : SpecialRoundConfig {
|
||||
public override float Weight { get; init; } = 0.6f;
|
||||
public override float Weight { get; init; } = 1;
|
||||
|
||||
public TimeSpan InitialSeconds { get; init; } = TimeSpan.FromSeconds(40);
|
||||
public TimeSpan SecondsPerKill { get; init; } = TimeSpan.FromSeconds(10);
|
||||
public TimeSpan SecondsPerKill { get; init; } = TimeSpan.FromSeconds(8);
|
||||
public TimeSpan MaxTimeEver { get; init; } = TimeSpan.FromSeconds(90);
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
namespace SpecialRoundAPI.Configs;
|
||||
|
||||
public record SuppressedRoundConfig : SpecialRoundConfig {
|
||||
public override float Weight { get; init; } = 0.3f;
|
||||
public override float Weight { get; init; } = 0.75f;
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
namespace SpecialRoundAPI.Configs;
|
||||
|
||||
public record VanillaRoundConfig : SpecialRoundConfig {
|
||||
public override float Weight { get; init; } = 0.2f;
|
||||
public override float Weight { get; init; } = 0.5f;
|
||||
}
|
||||
5
TTT/CS2/API/Items/ITripwireActivator.cs
Normal file
5
TTT/CS2/API/Items/ITripwireActivator.cs
Normal file
@@ -0,0 +1,5 @@
|
||||
namespace TTT.CS2.API.Items;
|
||||
|
||||
public interface ITripwireActivator {
|
||||
public void ActivateTripwire(TripwireInstance tripwire);
|
||||
}
|
||||
7
TTT/CS2/API/Items/ITripwireTracker.cs
Normal file
7
TTT/CS2/API/Items/ITripwireTracker.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
using TTT.CS2.Items.Tripwire;
|
||||
|
||||
namespace TTT.CS2.API.Items;
|
||||
|
||||
public interface ITripwireTracker {
|
||||
public List<TripwireInstance> ActiveTripwires { get; }
|
||||
}
|
||||
8
TTT/CS2/API/Items/TripwireInstance.cs
Normal file
8
TTT/CS2/API/Items/TripwireInstance.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
using CounterStrikeSharp.API.Core;
|
||||
using CounterStrikeSharp.API.Modules.Utils;
|
||||
using TTT.API.Player;
|
||||
|
||||
namespace TTT.CS2.API.Items;
|
||||
|
||||
public record TripwireInstance(IOnlinePlayer owner, CEnvBeam Beam,
|
||||
CDynamicProp TripwireProp, Vector StartPos, Vector EndPos);
|
||||
@@ -66,26 +66,26 @@ public static class CS2ServiceCollection {
|
||||
collection.AddModBehavior<IStorage<SilentAWPConfig>, CS2SilentAWPConfig>();
|
||||
collection
|
||||
.AddModBehavior<IStorage<HealthshotConfig>, CS2HealthshotConfig>();
|
||||
collection.AddModBehavior<IStorage<TripwireConfig>, CS2TripwireConfig>();
|
||||
|
||||
// TTT - CS2 Specific optionals
|
||||
collection.AddScoped<ITextSpawner, TextSpawner>();
|
||||
|
||||
// GameHandlers
|
||||
collection.AddModBehavior<BodySpawner>();
|
||||
collection.AddModBehavior<BombPlantSuppressor>();
|
||||
collection.AddModBehavior<BuyMenuHandler>();
|
||||
collection.AddModBehavior<CombatHandler>();
|
||||
collection.AddModBehavior<DamageCanceler>();
|
||||
collection.AddModBehavior<MapChangeCausesEndListener>();
|
||||
collection.AddModBehavior<MapZoneRemover>();
|
||||
collection.AddModBehavior<NameUpdater>();
|
||||
collection.AddModBehavior<PlayerConnectionsHandler>();
|
||||
collection.AddModBehavior<PlayerMuter>();
|
||||
collection.AddModBehavior<PropMover>();
|
||||
collection.AddModBehavior<RoundStart_GameStartHandler>();
|
||||
collection.AddModBehavior<BombPlantSuppressor>();
|
||||
collection.AddModBehavior<MapZoneRemover>();
|
||||
collection.AddModBehavior<BuyMenuHandler>();
|
||||
collection.AddModBehavior<TeamChangeHandler>();
|
||||
collection.AddModBehavior<TraitorChatHandler>();
|
||||
collection.AddModBehavior<PlayerMuter>();
|
||||
collection.AddModBehavior<MapChangeCausesEndListener>();
|
||||
collection.AddModBehavior<NameUpdater>();
|
||||
// collection.AddModBehavior<EntityTargetHandlers>();
|
||||
|
||||
// Damage Cancelers
|
||||
collection.AddModBehavior<OutOfRoundCanceler>();
|
||||
@@ -95,13 +95,14 @@ public static class CS2ServiceCollection {
|
||||
collection.AddModBehavior<AfkTimerListener>();
|
||||
collection.AddModBehavior<BodyPickupListener>();
|
||||
collection.AddModBehavior<IBodyTracker, BodyTracker>();
|
||||
collection.AddModBehavior<KarmaBanner>();
|
||||
collection.AddModBehavior<KarmaSyncer>();
|
||||
collection.AddModBehavior<LateSpawnListener>();
|
||||
collection.AddModBehavior<MapHookListener>();
|
||||
collection.AddModBehavior<PlayerStatsTracker>();
|
||||
collection.AddModBehavior<RoundTimerListener>();
|
||||
collection.AddModBehavior<ScreenColorApplier>();
|
||||
collection.AddModBehavior<KarmaBanner>();
|
||||
collection.AddModBehavior<KarmaSyncer>();
|
||||
collection.AddModBehavior<MapHookListener>();
|
||||
collection.AddModBehavior<WardenTagAssigner>();
|
||||
|
||||
// Commands
|
||||
collection.AddModBehavior<TestCommand>();
|
||||
|
||||
@@ -48,7 +48,6 @@ public class GiveItemCommand(IServiceProvider provider) : ICommand {
|
||||
|
||||
var purchaseEv = new PlayerPurchaseItemEvent(target, item);
|
||||
provider.GetRequiredService<IEventBus>().Dispatch(purchaseEv);
|
||||
if (purchaseEv.IsCanceled) return;
|
||||
|
||||
shop.GiveItem(target, item);
|
||||
info.ReplySync($"Gave item '{item.Name}' to {target.Name}.");
|
||||
|
||||
@@ -74,13 +74,13 @@ public class CS2KarmaConfig : IStorage<KarmaConfig>, IPluginModule {
|
||||
|
||||
public static readonly FakeConVar<int> CV_KARMA_PER_ROUND = new(
|
||||
"css_ttt_karma_per_round",
|
||||
"Amount of karma a player will gain at the end of each round", 2,
|
||||
"Amount of karma a player will gain at the end of each round", 1,
|
||||
ConVarFlags.FCVAR_NONE, new RangeValidator<int>(0, 50));
|
||||
|
||||
public static readonly FakeConVar<int> CV_KARMA_PER_ROUND_WIN = new(
|
||||
"css_ttt_karma_per_round_win",
|
||||
"Amount of karma a player will gain at the end of each round if their team won",
|
||||
4, ConVarFlags.FCVAR_NONE, new RangeValidator<int>(0, 50));
|
||||
1, ConVarFlags.FCVAR_NONE, new RangeValidator<int>(0, 50));
|
||||
|
||||
public void Dispose() { }
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace TTT.CS2.Configs.ShopItems;
|
||||
|
||||
public class CS2BodyPaintConfig : IStorage<BodyPaintConfig>, IPluginModule {
|
||||
public static readonly FakeConVar<int> CV_PRICE = new(
|
||||
"css_ttt_shop_bodypaint_price", "Price of the Body Paint item", 40,
|
||||
"css_ttt_shop_bodypaint_price", "Price of the Body Paint item", 30,
|
||||
ConVarFlags.FCVAR_NONE, new RangeValidator<int>(0, 10000));
|
||||
|
||||
public static readonly FakeConVar<int> CV_MAX_USES = new(
|
||||
|
||||
104
TTT/CS2/Configs/ShopItems/CS2TripwireConfig.cs
Normal file
104
TTT/CS2/Configs/ShopItems/CS2TripwireConfig.cs
Normal file
@@ -0,0 +1,104 @@
|
||||
using System.Drawing;
|
||||
using CounterStrikeSharp.API;
|
||||
using CounterStrikeSharp.API.Core;
|
||||
using CounterStrikeSharp.API.Modules.Cvars;
|
||||
using CounterStrikeSharp.API.Modules.Cvars.Validators;
|
||||
using ShopAPI.Configs.Traitor;
|
||||
using TTT.API;
|
||||
using TTT.API.Storage;
|
||||
|
||||
namespace TTT.CS2.Configs.ShopItems;
|
||||
|
||||
public class CS2TripwireConfig : IStorage<TripwireConfig>, IPluginModule {
|
||||
public static readonly FakeConVar<int> CV_PRICE = new(
|
||||
"css_ttt_shop_tripwire_price", "Price of the Tripwire item (Traitor)", 45,
|
||||
ConVarFlags.FCVAR_NONE, new RangeValidator<int>(0, 10000));
|
||||
|
||||
public static readonly FakeConVar<int> CV_EXPLOSION_POWER = new(
|
||||
"css_ttt_shop_tripwire_explosion_power",
|
||||
"Explosion power of the Tripwire in damage units", 1000,
|
||||
ConVarFlags.FCVAR_NONE, new RangeValidator<int>(1, 10000));
|
||||
|
||||
public static readonly FakeConVar<float> CV_FALLOFF_DELAY = new(
|
||||
"css_ttt_shop_tripwire_falloff_delay",
|
||||
"Damage falloff of tripwire explosion, higher = quicker falloff", 0.015f,
|
||||
ConVarFlags.FCVAR_NONE, new RangeValidator<float>(0f, 1f));
|
||||
|
||||
public static readonly FakeConVar<float> CV_FF_MULTIPLIER = new(
|
||||
"css_ttt_shop_tripwire_friendlyfire_multiplier",
|
||||
"Damage multiplier applied to friendly fire from Tripwire", 0.5f,
|
||||
ConVarFlags.FCVAR_NONE, new RangeValidator<float>(0f, 1f));
|
||||
|
||||
public static readonly FakeConVar<float> CV_OOLOS_MULTIPLIER = new(
|
||||
"css_ttt_shop_tripwire_outoflineofsight_multiplier",
|
||||
"Damage multiplier for players out of line of sight", 0.3f,
|
||||
ConVarFlags.FCVAR_NONE, new RangeValidator<float>(0f, 1f));
|
||||
|
||||
public static readonly FakeConVar<bool> CV_FF_TRIGGERS = new(
|
||||
"css_ttt_shop_tripwire_friendlyfire_triggers",
|
||||
"Whether Tripwires can be triggered by teammates", true);
|
||||
|
||||
public static readonly FakeConVar<float> CV_MAX_DISTANCE_SQUARED = new(
|
||||
"css_ttt_shop_tripwire_max_distance_squared",
|
||||
"Maximum placement distance squared for Tripwire", 400f * 400f,
|
||||
ConVarFlags.FCVAR_NONE, new RangeValidator<float>(0f, 1000000f));
|
||||
|
||||
public static readonly FakeConVar<float> CV_INITIATION_TIME = new(
|
||||
"css_ttt_shop_tripwire_initiation_time",
|
||||
"Seconds before Tripwire becomes active", 2f, ConVarFlags.FCVAR_NONE,
|
||||
new RangeValidator<float>(0f, 10f));
|
||||
|
||||
public static readonly FakeConVar<float> CV_SIZE_SQUARED = new(
|
||||
"css_ttt_shop_tripwire_size_squared",
|
||||
"Size of tripwire for the purposes of bullet-detection", 500f,
|
||||
ConVarFlags.FCVAR_NONE, new RangeValidator<float>(1f, 100000f));
|
||||
|
||||
public static readonly FakeConVar<int> CV_COLOR_R = new(
|
||||
"css_ttt_shop_tripwire_color_r", "Tripwire color red channel (0–255)", 255,
|
||||
ConVarFlags.FCVAR_NONE, new RangeValidator<int>(0, 255));
|
||||
|
||||
public static readonly FakeConVar<int> CV_COLOR_G = new(
|
||||
"css_ttt_shop_tripwire_color_g", "Tripwire color green channel (0–255)", 0,
|
||||
ConVarFlags.FCVAR_NONE, new RangeValidator<int>(0, 255));
|
||||
|
||||
public static readonly FakeConVar<int> CV_COLOR_B = new(
|
||||
"css_ttt_shop_tripwire_color_b", "Tripwire color blue channel (0–255)", 0,
|
||||
ConVarFlags.FCVAR_NONE, new RangeValidator<int>(0, 255));
|
||||
|
||||
public static readonly FakeConVar<int> CV_COLOR_A = new(
|
||||
"css_ttt_shop_tripwire_color_a", "Tripwire color alpha (0–255)", 64,
|
||||
ConVarFlags.FCVAR_NONE, new RangeValidator<int>(0, 255));
|
||||
|
||||
public static readonly FakeConVar<float> CV_THICKNESS = new(
|
||||
"css_ttt_shop_tripwire_thickness", "Visual thickness of the Tripwire beam",
|
||||
0.5f, ConVarFlags.FCVAR_NONE, new RangeValidator<float>(0.01f, 5f));
|
||||
|
||||
public void Dispose() { }
|
||||
|
||||
public void Start() { }
|
||||
|
||||
public void Start(BasePlugin? plugin) {
|
||||
ArgumentNullException.ThrowIfNull(plugin, nameof(plugin));
|
||||
plugin.RegisterFakeConVars(this);
|
||||
}
|
||||
|
||||
public Task<TripwireConfig?> Load() {
|
||||
var cfg = new TripwireConfig {
|
||||
Price = CV_PRICE.Value,
|
||||
ExplosionPower = CV_EXPLOSION_POWER.Value,
|
||||
FalloffDelay = CV_FALLOFF_DELAY.Value,
|
||||
FriendlyFireMultiplier = CV_FF_MULTIPLIER.Value,
|
||||
OutOfLineOfSightMultiplier = CV_OOLOS_MULTIPLIER.Value,
|
||||
FriendlyFireTriggers = CV_FF_TRIGGERS.Value,
|
||||
MaxPlacementDistanceSquared = CV_MAX_DISTANCE_SQUARED.Value,
|
||||
TripwireInitiationTime = TimeSpan.FromSeconds(CV_INITIATION_TIME.Value),
|
||||
TripwireSizeSquared = CV_SIZE_SQUARED.Value,
|
||||
TripwireColor =
|
||||
Color.FromArgb(CV_COLOR_A.Value, CV_COLOR_R.Value, CV_COLOR_G.Value,
|
||||
CV_COLOR_B.Value),
|
||||
TripwireThickness = CV_THICKNESS.Value
|
||||
};
|
||||
|
||||
return Task.FromResult<TripwireConfig?>(cfg);
|
||||
}
|
||||
}
|
||||
@@ -97,4 +97,11 @@ public static class VectorExtensions {
|
||||
public static Vector toVector(this Vector3 vec) {
|
||||
return new Vector(vec.X, vec.Y, vec.Z);
|
||||
}
|
||||
|
||||
public static QAngle toAngle(this Vector vec) {
|
||||
var pitch = (float)(Math.Atan2(-vec.Z,
|
||||
Math.Sqrt(vec.X * vec.X + vec.Y * vec.Y)) * (180.0 / Math.PI));
|
||||
var yaw = (float)(Math.Atan2(vec.Y, vec.X) * (180.0 / Math.PI));
|
||||
return new QAngle(pitch, yaw, 0);
|
||||
}
|
||||
}
|
||||
@@ -7,8 +7,10 @@ using TTT.API;
|
||||
using TTT.API.Events;
|
||||
using TTT.API.Game;
|
||||
using TTT.API.Player;
|
||||
using TTT.API.Role;
|
||||
using TTT.CS2.API;
|
||||
using TTT.Game.Events.Player;
|
||||
using TTT.Game.Roles;
|
||||
|
||||
namespace TTT.CS2.GameHandlers;
|
||||
|
||||
@@ -21,6 +23,9 @@ public class CombatHandler(IServiceProvider provider) : IPluginModule {
|
||||
private readonly IGameManager games =
|
||||
provider.GetRequiredService<IGameManager>();
|
||||
|
||||
private readonly IRoleAssigner roles =
|
||||
provider.GetRequiredService<IRoleAssigner>();
|
||||
|
||||
private readonly IAliveSpoofer spoofer =
|
||||
provider.GetRequiredService<IAliveSpoofer>();
|
||||
|
||||
@@ -45,7 +50,19 @@ public class CombatHandler(IServiceProvider provider) : IPluginModule {
|
||||
if (games.ActiveGame is not { State: State.IN_PROGRESS })
|
||||
return HookResult.Continue;
|
||||
|
||||
if (ev.Attacker != null) ev.FireEventToClient(ev.Attacker);
|
||||
if (ev.Attacker != null) {
|
||||
ev.FireEventToClient(ev.Attacker);
|
||||
var apiPlayer = converter.GetPlayer(ev.Attacker);
|
||||
var role = roles.GetRoles(apiPlayer);
|
||||
if (role.Any(r => r is TraitorRole))
|
||||
foreach (var p in Utilities.GetPlayers()) {
|
||||
var apiP = converter.GetPlayer(p);
|
||||
if (apiP.Id == apiPlayer.Id) continue;
|
||||
var r = roles.GetRoles(converter.GetPlayer(p));
|
||||
if (role.Intersect(r).Any()) ev.FireEventToClient(p);
|
||||
}
|
||||
}
|
||||
|
||||
info.DontBroadcast = true;
|
||||
spoofer.SpoofAlive(player);
|
||||
Server.NextWorldUpdateAsync(() => bus.Dispatch(deathEvent));
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using CounterStrikeSharp.API;
|
||||
using CounterStrikeSharp.API.Core;
|
||||
using CounterStrikeSharp.API.Core;
|
||||
using CounterStrikeSharp.API.Modules.Utils;
|
||||
using JetBrains.Annotations;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using ShopAPI.Configs.Traitor;
|
||||
@@ -46,6 +46,13 @@ public class DamageStation(IServiceProvider provider)
|
||||
override protected void onInterval() {
|
||||
var players = finder.GetOnline();
|
||||
var toRemove = new List<CPhysicsPropMultiplayer>();
|
||||
var playerMapping = players
|
||||
.Select(p => (ApiPlayer: p, GamePlayer: converter.GetPlayer(p)))
|
||||
.Where(m
|
||||
=> m.GamePlayer != null
|
||||
&& !Roles.GetRoles(m.ApiPlayer).Any(r => r is TraitorRole))
|
||||
.ToList();
|
||||
|
||||
foreach (var (prop, info) in props) {
|
||||
if (_Config.TotalHealthGiven != 0 && Math.Abs(info.HealthGiven)
|
||||
> Math.Abs(_Config.TotalHealthGiven)) {
|
||||
@@ -60,10 +67,6 @@ public class DamageStation(IServiceProvider provider)
|
||||
|
||||
var propPos = prop.AbsOrigin;
|
||||
|
||||
var playerMapping = players.Select(p
|
||||
=> (ApiPlayer: p, GamePlayer: converter.GetPlayer(p)))
|
||||
.Where(m => m.GamePlayer != null);
|
||||
|
||||
var playerDists = playerMapping
|
||||
.Select(t => (t.ApiPlayer, Origin: t.GamePlayer!.Pawn.Value?.AbsOrigin,
|
||||
t.GamePlayer))
|
||||
@@ -74,21 +77,16 @@ public class DamageStation(IServiceProvider provider)
|
||||
.ToList();
|
||||
|
||||
foreach (var (player, dist, gamePlayer) in playerDists) {
|
||||
if ((gamePlayer.Buttons & PlayerButtons.Walk) != PlayerButtons.Walk) {
|
||||
gamePlayer.EmitSound("Player.DamageFall", null, 0.2f);
|
||||
if (Roles.GetRoles(player).Any(r => r is TraitorRole)) continue;
|
||||
}
|
||||
|
||||
var healthScale = 1.0 - dist / _Config.MaxRange;
|
||||
var damageAmount =
|
||||
(int)Math.Floor(_Config.HealthIncrements * healthScale);
|
||||
Math.Abs((int)Math.Floor(_Config.HealthIncrements * healthScale));
|
||||
|
||||
var dmgEvent = new PlayerDamagedEvent(player,
|
||||
info.Owner as IOnlinePlayer, damageAmount) { Weapon = $"[{Name}]" };
|
||||
|
||||
bus.Dispatch(dmgEvent);
|
||||
|
||||
damageAmount = -dmgEvent.DmgDealt;
|
||||
damageAmount = dmgEvent.DmgDealt;
|
||||
|
||||
if (player.Health + damageAmount <= 0) {
|
||||
killedWithStation[player.Id] = info;
|
||||
@@ -98,7 +96,8 @@ public class DamageStation(IServiceProvider provider)
|
||||
bus.Dispatch(playerDeath);
|
||||
}
|
||||
|
||||
player.Health += damageAmount;
|
||||
gamePlayer.EmitSound("Player.DamageFall", SELF(gamePlayer.Slot), 0.2f);
|
||||
player.Health -= damageAmount;
|
||||
info.HealthGiven += damageAmount;
|
||||
}
|
||||
}
|
||||
@@ -106,6 +105,10 @@ public class DamageStation(IServiceProvider provider)
|
||||
foreach (var prop in toRemove) props.Remove(prop);
|
||||
}
|
||||
|
||||
private static RecipientFilter SELF(int slot) {
|
||||
return new RecipientFilter(slot);
|
||||
}
|
||||
|
||||
[UsedImplicitly]
|
||||
[EventHandler]
|
||||
public void OnGameEnd(GameStateUpdateEvent ev) {
|
||||
|
||||
@@ -20,7 +20,7 @@ public abstract class StationItem<T>(IServiceProvider provider,
|
||||
: RoleRestrictedItem<T>(provider), IPluginModule where T : IRole {
|
||||
protected readonly StationConfig _Config = config;
|
||||
|
||||
protected readonly IPlayerConverter<CCSPlayerController> Converter =
|
||||
protected readonly IPlayerConverter<CCSPlayerController> converter =
|
||||
provider.GetRequiredService<IPlayerConverter<CCSPlayerController>>();
|
||||
|
||||
private readonly long PROP_SIZE_SQUARED = 700;
|
||||
@@ -124,7 +124,7 @@ public abstract class StationItem<T>(IServiceProvider provider,
|
||||
prop.SetModel("models/props/cs_office/microwave.vmdl");
|
||||
prop.DispatchSpawn();
|
||||
|
||||
var gamePlayer = Converter.GetPlayer(player);
|
||||
var gamePlayer = converter.GetPlayer(player);
|
||||
if (gamePlayer == null || !gamePlayer.Pawn.IsValid
|
||||
|| gamePlayer.Pawn.Value == null)
|
||||
return;
|
||||
|
||||
47
TTT/CS2/Items/Tripwire/TripwireDamageListener.cs
Normal file
47
TTT/CS2/Items/Tripwire/TripwireDamageListener.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
using CounterStrikeSharp.API.Core;
|
||||
using CounterStrikeSharp.API.Core.Attributes.Registration;
|
||||
using CounterStrikeSharp.API.Modules.Utils;
|
||||
using JetBrains.Annotations;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using ShopAPI.Configs.Traitor;
|
||||
using TTT.API;
|
||||
using TTT.API.Storage;
|
||||
using TTT.CS2.API.Items;
|
||||
using TTT.CS2.Extensions;
|
||||
|
||||
namespace TTT.CS2.Items.Tripwire;
|
||||
|
||||
public class TripwireDamageListener(IServiceProvider provider) : IPluginModule {
|
||||
public void Dispose() { }
|
||||
public void Start() { }
|
||||
|
||||
private readonly ITripwireTracker? tripwires =
|
||||
provider.GetService<ITripwireTracker>();
|
||||
|
||||
private readonly ITripwireActivator? tripwireActivator =
|
||||
provider.GetRequiredService<ITripwireActivator>();
|
||||
|
||||
private TripwireConfig config
|
||||
=> provider.GetService<IStorage<TripwireConfig>>()
|
||||
?.Load()
|
||||
.GetAwaiter()
|
||||
.GetResult() ?? new TripwireConfig();
|
||||
|
||||
[UsedImplicitly]
|
||||
[GameEventHandler]
|
||||
public HookResult OnBulletImpact(EventBulletImpact ev, GameEventInfo info) {
|
||||
if (tripwires == null) return HookResult.Continue;
|
||||
var hitVec = new Vector(ev.X, ev.Y, ev.Z);
|
||||
|
||||
var nearest = tripwires.ActiveTripwires
|
||||
.OrderBy(wire => wire.TripwireProp.AbsOrigin.DistanceSquared(hitVec))
|
||||
.FirstOrDefault();
|
||||
|
||||
if (nearest == null) return HookResult.Continue;
|
||||
var distSquared = nearest.TripwireProp.AbsOrigin.DistanceSquared(hitVec);
|
||||
if (distSquared > config.TripwireSizeSquared) return HookResult.Continue;
|
||||
|
||||
tripwireActivator?.ActivateTripwire(nearest);
|
||||
return HookResult.Continue;
|
||||
}
|
||||
}
|
||||
159
TTT/CS2/Items/Tripwire/TripwireItem.cs
Normal file
159
TTT/CS2/Items/Tripwire/TripwireItem.cs
Normal file
@@ -0,0 +1,159 @@
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Drawing;
|
||||
using System.Reactive.Concurrency;
|
||||
using CounterStrikeSharp.API;
|
||||
using CounterStrikeSharp.API.Core;
|
||||
using CounterStrikeSharp.API.Modules.Utils;
|
||||
using JetBrains.Annotations;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using ShopAPI;
|
||||
using ShopAPI.Configs;
|
||||
using ShopAPI.Configs.Traitor;
|
||||
using TTT.API;
|
||||
using TTT.API.Events;
|
||||
using TTT.API.Extensions;
|
||||
using TTT.API.Game;
|
||||
using TTT.API.Player;
|
||||
using TTT.API.Storage;
|
||||
using TTT.CS2.API.Items;
|
||||
using TTT.CS2.Extensions;
|
||||
using TTT.CS2.RayTrace.Class;
|
||||
using TTT.CS2.RayTrace.Enum;
|
||||
using TTT.CS2.RayTrace.Struct;
|
||||
using TTT.Game.Events.Game;
|
||||
using TTT.Game.Roles;
|
||||
|
||||
namespace TTT.CS2.Items.Tripwire;
|
||||
|
||||
public static class TripwireServiceCollection {
|
||||
public static void AddTripwireServices(this IServiceCollection services) {
|
||||
services.AddModBehavior<ITripwireTracker, TripwireItem>();
|
||||
services.AddModBehavior<ITripwireActivator, TripwireMovementListener>();
|
||||
services.AddModBehavior<TripwireDamageListener>();
|
||||
}
|
||||
}
|
||||
|
||||
public class TripwireItem(IServiceProvider provider)
|
||||
: RoleRestrictedItem<TraitorRole>(provider), IPluginModule, ITripwireTracker {
|
||||
private TripwireConfig config
|
||||
=> Provider.GetService<IStorage<TripwireConfig>>()
|
||||
?.Load()
|
||||
.GetAwaiter()
|
||||
.GetResult() ?? new TripwireConfig();
|
||||
|
||||
private readonly IPlayerConverter<CCSPlayerController> converter =
|
||||
provider.GetRequiredService<IPlayerConverter<CCSPlayerController>>();
|
||||
|
||||
private readonly IScheduler scheduler =
|
||||
provider.GetRequiredService<IScheduler>();
|
||||
|
||||
public List<TripwireInstance> ActiveTripwires { get; } = [];
|
||||
|
||||
public override string Name => Locale[TripwireMsgs.SHOP_ITEM_TRIPWIRE];
|
||||
|
||||
public override string Description
|
||||
=> Locale[TripwireMsgs.SHOP_ITEM_TRIPWIRE_DESC];
|
||||
|
||||
public override ShopItemConfig Config => config;
|
||||
|
||||
public void Start(BasePlugin? plugin) {
|
||||
Start();
|
||||
plugin
|
||||
?.RegisterListener<
|
||||
CounterStrikeSharp.API.Core.Listeners.OnServerPrecacheResources>(
|
||||
onPrecache);
|
||||
}
|
||||
|
||||
private void onPrecache(ResourceManifest manifest) {
|
||||
manifest.AddResource(
|
||||
"models/generic/conveyor_control_panel_01/conveyor_button_02.vmdl");
|
||||
}
|
||||
|
||||
[UsedImplicitly]
|
||||
[EventHandler]
|
||||
public void OnGameEvent(GameStateUpdateEvent ev) {
|
||||
if (ev.NewState != State.FINISHED) return;
|
||||
ActiveTripwires.Clear();
|
||||
}
|
||||
|
||||
public override void OnPurchase(IOnlinePlayer player) {
|
||||
Server.NextWorldUpdate(() => {
|
||||
if (!placeTripwire(player, out var originTrace, out var endTrace,
|
||||
out var tripwire))
|
||||
return;
|
||||
|
||||
scheduler.Schedule(config.TripwireInitiationTime,
|
||||
() => {
|
||||
Server.NextWorldUpdate(() => {
|
||||
createTripwireBeam(player, tripwire,
|
||||
originTrace.Value.EndPos.toVector(),
|
||||
endTrace.Value.EndPos.toVector());
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
private bool placeTripwire(IOnlinePlayer player,
|
||||
[NotNullWhen(true)] out CGameTrace? originTrace,
|
||||
[NotNullWhen(true)] out CGameTrace? endTrace,
|
||||
[NotNullWhen(true)] out CDynamicProp? tripwire) {
|
||||
tripwire = null;
|
||||
originTrace = null;
|
||||
endTrace = null;
|
||||
var gamePlayer = converter.GetPlayer(player);
|
||||
var playerPawn = gamePlayer?.PlayerPawn.Value;
|
||||
if (gamePlayer == null || playerPawn == null) return false;
|
||||
|
||||
originTrace = gamePlayer.GetGameTraceByEyePosition(TraceMask.MaskSolid,
|
||||
Contents.NoDraw, gamePlayer);
|
||||
var origin = gamePlayer.GetEyePosition();
|
||||
if (origin == null || originTrace == null) return false;
|
||||
|
||||
if (origin.DistanceSquared(originTrace.Value.EndPos.toVector())
|
||||
> config.MaxPlacementDistanceSquared) {
|
||||
Shop.AddBalance(player, config.Price, "Refund");
|
||||
Messenger.Message(player, Locale[TripwireMsgs.SHOP_ITEM_TRIPWIRE_TOOFAR]);
|
||||
return false;
|
||||
}
|
||||
|
||||
var angles = originTrace.Value.Normal.toVector().toAngle();
|
||||
|
||||
endTrace = TraceRay.TraceShape(originTrace.Value.EndPos.toVector(), angles,
|
||||
TraceMask.MaskSolid, Contents.NoDraw, gamePlayer);
|
||||
|
||||
tripwire = Utilities.CreateEntityByName<CDynamicProp>("prop_dynamic");
|
||||
if (tripwire == null) return false;
|
||||
|
||||
tripwire.SetModel(
|
||||
"models/generic/conveyor_control_panel_01/conveyor_button_02.vmdl");
|
||||
tripwire.DispatchSpawn();
|
||||
|
||||
tripwire.Teleport(originTrace.Value.EndPos.toVector(),
|
||||
originTrace.Value.Normal.toVector().toAngle());
|
||||
tripwire.EmitSound("Weapon_ELITE.Clipout");
|
||||
return true;
|
||||
}
|
||||
|
||||
private void createTripwireBeam(IOnlinePlayer owner, CDynamicProp prop,
|
||||
Vector start, Vector end) {
|
||||
prop.EmitSound("C4.ExplodeTriggerTrip");
|
||||
var beam = createBeamEnt(start, end);
|
||||
if (beam == null) return;
|
||||
|
||||
var instance = new TripwireInstance(owner, beam, prop, start, end);
|
||||
ActiveTripwires.Add(instance);
|
||||
}
|
||||
|
||||
private CEnvBeam? createBeamEnt(Vector start, Vector end) {
|
||||
var beam = Utilities.CreateEntityByName<CEnvBeam>("env_beam");
|
||||
if (beam == null) return null;
|
||||
beam.RenderMode = RenderMode_t.kRenderTransAlpha;
|
||||
beam.Width = config.TripwireThickness;
|
||||
beam.Render = config.TripwireColor;
|
||||
beam.EndPos.X = end.X;
|
||||
beam.EndPos.Y = end.Y;
|
||||
beam.EndPos.Z = end.Z;
|
||||
beam.Teleport(start);
|
||||
return beam;
|
||||
}
|
||||
}
|
||||
156
TTT/CS2/Items/Tripwire/TripwireMovementListener.cs
Normal file
156
TTT/CS2/Items/Tripwire/TripwireMovementListener.cs
Normal file
@@ -0,0 +1,156 @@
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using CounterStrikeSharp.API.Core;
|
||||
using CounterStrikeSharp.API.Modules.Timers;
|
||||
using CounterStrikeSharp.API.Modules.Utils;
|
||||
using JetBrains.Annotations;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using ShopAPI.Configs.Traitor;
|
||||
using TTT.API;
|
||||
using TTT.API.Events;
|
||||
using TTT.API.Game;
|
||||
using TTT.API.Player;
|
||||
using TTT.API.Storage;
|
||||
using TTT.CS2.API.Items;
|
||||
using TTT.CS2.Extensions;
|
||||
using TTT.CS2.RayTrace.Class;
|
||||
using TTT.CS2.RayTrace.Enum;
|
||||
using TTT.Game.Events.Body;
|
||||
using TTT.Game.Events.Game;
|
||||
using TTT.Game.Events.Player;
|
||||
using TTT.Game.Listeners;
|
||||
using TTT.Game.Roles;
|
||||
|
||||
namespace TTT.CS2.Items.Tripwire;
|
||||
|
||||
public class TripwireMovementListener(IServiceProvider provider)
|
||||
: BaseListener(provider), IPluginModule, ITripwireActivator {
|
||||
private readonly IPlayerConverter<CCSPlayerController> converter =
|
||||
provider.GetRequiredService<IPlayerConverter<CCSPlayerController>>();
|
||||
|
||||
private readonly ITripwireTracker? tripwireTracker =
|
||||
provider.GetService<ITripwireTracker>();
|
||||
|
||||
private readonly Dictionary<string, TripwireInstance> killedWithTripwire =
|
||||
new();
|
||||
|
||||
private TripwireConfig config
|
||||
=> Provider.GetService<IStorage<TripwireConfig>>()
|
||||
?.Load()
|
||||
.GetAwaiter()
|
||||
.GetResult() ?? new TripwireConfig();
|
||||
|
||||
public void Start(BasePlugin? plugin) {
|
||||
if (tripwireTracker == null) return;
|
||||
plugin?.AddTimer(0.2f, checkTripwires, TimerFlags.REPEAT);
|
||||
}
|
||||
|
||||
private void checkTripwires() {
|
||||
if (tripwireTracker == null) return;
|
||||
foreach (var wire in new List<TripwireInstance>(tripwireTracker
|
||||
.ActiveTripwires)) {
|
||||
var ray = TraceRay.TraceShape(wire.StartPos, wire.EndPos, Contents.Player,
|
||||
wire.TripwireProp.Handle);
|
||||
if (!ray.DidHit() || !ray.HitPlayer(out var player)) continue;
|
||||
|
||||
if (!config.FriendlyFireTriggers && player != null) {
|
||||
var apiPlayer = converter.GetPlayer(player);
|
||||
var role = Roles.GetRoles(apiPlayer);
|
||||
if (role.Any(r => r is TraitorRole)) continue;
|
||||
}
|
||||
|
||||
ActivateTripwire(wire);
|
||||
}
|
||||
}
|
||||
|
||||
private void removeTripwire(TripwireInstance wire) {
|
||||
tripwireTracker?.ActiveTripwires.Remove(wire);
|
||||
wire.Beam.Remove();
|
||||
wire.TripwireProp.Remove();
|
||||
}
|
||||
|
||||
private float getDamage(float distance) {
|
||||
return config.ExplosionPower
|
||||
* MathF.Pow(MathF.E, -distance * config.FalloffDelay);
|
||||
}
|
||||
|
||||
private int getDamage(CCSPlayerController gamePlayer, IOnlinePlayer player,
|
||||
Vector tripwire) {
|
||||
var origin = gamePlayer.Pawn.Value?.AbsOrigin;
|
||||
if (origin == null) return 0;
|
||||
var distance = tripwire.Distance(origin);
|
||||
var damage = getDamage(distance);
|
||||
Messenger.DebugAnnounce($"Base damage: {damage} at distance {distance}");
|
||||
if (Roles.GetRoles(player).Any(r => r is TraitorRole)) {
|
||||
damage *= config.FriendlyFireMultiplier;
|
||||
Messenger.DebugAnnounce($"Applied friendly fire multiplier: {damage}");
|
||||
}
|
||||
|
||||
var angleToPlayer = (origin - tripwire).Normalized().toAngle();
|
||||
var losRay = TraceRay.TraceShape(tripwire, angleToPlayer, Contents.Player,
|
||||
gamePlayer);
|
||||
var los = losRay.HitPlayer(out _);
|
||||
if (!los) {
|
||||
damage *= config.OutOfLineOfSightMultiplier;
|
||||
Messenger.DebugAnnounce(
|
||||
$"Applied out of line of sight multiplier: {damage}");
|
||||
}
|
||||
|
||||
return (int)damage;
|
||||
}
|
||||
|
||||
[UsedImplicitly]
|
||||
[EventHandler]
|
||||
public void OnGameEnd(GameStateUpdateEvent ev) {
|
||||
if (ev.NewState != State.FINISHED) return;
|
||||
|
||||
killedWithTripwire.Clear();
|
||||
}
|
||||
|
||||
[UsedImplicitly]
|
||||
[EventHandler]
|
||||
public void OnRagdollSpawn(BodyCreateEvent ev) {
|
||||
if (!killedWithTripwire.TryGetValue(ev.Body.Id, out var info)) return;
|
||||
if (ev.Body.Killer != null && ev.Body.Killer.Id != ev.Body.OfPlayer.Id)
|
||||
return;
|
||||
ev.Body.Killer = info.owner;
|
||||
}
|
||||
|
||||
public void ActivateTripwire(TripwireInstance instance) {
|
||||
removeTripwire(instance);
|
||||
instance.TripwireProp.EmitSound("Flashbang.ExplodeDistant");
|
||||
|
||||
foreach (var player in Finder.GetOnline()) {
|
||||
if (dealTripwireDamage(instance, player, out var gamePlayer)) continue;
|
||||
gamePlayer?.EmitSound("Player.BurnDamage");
|
||||
}
|
||||
}
|
||||
|
||||
private bool dealTripwireDamage(TripwireInstance instance,
|
||||
IOnlinePlayer player,
|
||||
[NotNullWhen(true)] out CCSPlayerController? gamePlayer) {
|
||||
gamePlayer = null;
|
||||
if (!player.IsAlive) return false;
|
||||
|
||||
gamePlayer = converter.GetPlayer(player);
|
||||
if (gamePlayer == null) return false;
|
||||
var damage = getDamage(gamePlayer, player, instance.StartPos);
|
||||
|
||||
if (damage < 1) return false;
|
||||
|
||||
Event ev;
|
||||
if (player.Health - damage <= 0) {
|
||||
killedWithTripwire[player.Id] = instance;
|
||||
ev = new PlayerDeathEvent(player).WithKiller(instance.owner)
|
||||
.WithWeapon("[Tripwire]");
|
||||
} else {
|
||||
ev = new PlayerDamagedEvent(player, instance.owner, damage) {
|
||||
Weapon = "[Tripwire]"
|
||||
};
|
||||
}
|
||||
|
||||
Bus.Dispatch(ev);
|
||||
|
||||
player.Health -= damage;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
14
TTT/CS2/Items/Tripwire/TripwireMsgs.cs
Normal file
14
TTT/CS2/Items/Tripwire/TripwireMsgs.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using TTT.Locale;
|
||||
|
||||
namespace TTT.CS2.Items.Tripwire;
|
||||
|
||||
public class TripwireMsgs {
|
||||
public static IMsg SHOP_ITEM_TRIPWIRE
|
||||
=> MsgFactory.Create(nameof(SHOP_ITEM_TRIPWIRE));
|
||||
|
||||
public static IMsg SHOP_ITEM_TRIPWIRE_DESC
|
||||
=> MsgFactory.Create(nameof(SHOP_ITEM_TRIPWIRE_DESC));
|
||||
|
||||
public static IMsg SHOP_ITEM_TRIPWIRE_TOOFAR
|
||||
=> MsgFactory.Create(nameof(SHOP_ITEM_TRIPWIRE_TOOFAR));
|
||||
}
|
||||
@@ -19,24 +19,20 @@ public class MapHookListener(IServiceProvider provider)
|
||||
[UsedImplicitly]
|
||||
[EventHandler(Priority = Priority.MONITOR, IgnoreCanceled = true)]
|
||||
public void OnRoleAssign(PlayerRoleAssignEvent ev) {
|
||||
Server.NextWorldUpdate(() => {
|
||||
var player = converter.GetPlayer(ev.Player);
|
||||
if (player == null) return;
|
||||
var player = converter.GetPlayer(ev.Player);
|
||||
if (player == null) return;
|
||||
|
||||
switch (ev.Role) {
|
||||
case TraitorRole:
|
||||
player.Pawn.Value?.AcceptInput("AddContext", null, null, "TRAITOR:1");
|
||||
break;
|
||||
case DetectiveRole:
|
||||
player.Pawn.Value?.AcceptInput("AddContext", null, null,
|
||||
"DETECTIVE:1");
|
||||
break;
|
||||
case InnocentRole:
|
||||
player.Pawn.Value?.AcceptInput("AddContext", null, null,
|
||||
"INNOCENT:1");
|
||||
break;
|
||||
}
|
||||
});
|
||||
switch (ev.Role) {
|
||||
case TraitorRole:
|
||||
player.Pawn.Value?.AcceptInput("AddContext", null, null, "TRAITOR:1");
|
||||
break;
|
||||
case DetectiveRole:
|
||||
player.Pawn.Value?.AcceptInput("AddContext", null, null, "DETECTIVE:1");
|
||||
break;
|
||||
case InnocentRole:
|
||||
player.Pawn.Value?.AcceptInput("AddContext", null, null, "INNOCENT:1");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
[UsedImplicitly]
|
||||
|
||||
54
TTT/CS2/Listeners/WardenTagAssigner.cs
Normal file
54
TTT/CS2/Listeners/WardenTagAssigner.cs
Normal file
@@ -0,0 +1,54 @@
|
||||
using CounterStrikeSharp.API;
|
||||
using CounterStrikeSharp.API.Core;
|
||||
using CounterStrikeSharp.API.Modules.Utils;
|
||||
using JetBrains.Annotations;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using TTT.API.Events;
|
||||
using TTT.API.Player;
|
||||
using TTT.CS2.ThirdParties.eGO;
|
||||
using TTT.Game.Events.Player;
|
||||
using TTT.Game.Listeners;
|
||||
using TTT.Game.Roles;
|
||||
|
||||
namespace TTT.CS2.Listeners;
|
||||
|
||||
public class WardenTagAssigner(IServiceProvider provider)
|
||||
: BaseListener(provider) {
|
||||
private readonly IPlayerConverter<CCSPlayerController> converter =
|
||||
provider.GetRequiredService<IPlayerConverter<CCSPlayerController>>();
|
||||
|
||||
private readonly Dictionary<string, (string, char)> oldTags = new();
|
||||
|
||||
[UsedImplicitly]
|
||||
[EventHandler]
|
||||
public void OnRoleAssign(PlayerRoleAssignEvent ev) {
|
||||
var maul = EgoApi.MAUL.Get();
|
||||
if (maul == null) return;
|
||||
Server.NextWorldUpdate(() => {
|
||||
var gamePlayer = converter.GetPlayer(ev.Player);
|
||||
if (gamePlayer == null) return;
|
||||
|
||||
Task.Run(async () => {
|
||||
if (ev.Role is DetectiveRole) {
|
||||
var oldTag = await maul.getTagService().GetTag(gamePlayer.SteamID);
|
||||
var oldTagColor =
|
||||
await maul.getTagService().GetTagColor(gamePlayer.SteamID);
|
||||
oldTags[ev.Player.Id] = (oldTag, oldTagColor);
|
||||
}
|
||||
|
||||
await Server.NextWorldUpdateAsync(() => {
|
||||
if (ev.Role is DetectiveRole) {
|
||||
maul.getTagService().SetTag(gamePlayer, "[DETECTIVE]", false);
|
||||
maul.getTagService()
|
||||
.SetTagColor(gamePlayer, ChatColors.DarkBlue, false);
|
||||
} else if (oldTags.TryGetValue(ev.Player.Id, out var oldTag)) {
|
||||
maul.getTagService().SetTag(gamePlayer, oldTag.Item1, false);
|
||||
maul.getTagService().SetTagColor(gamePlayer, oldTag.Item2, false);
|
||||
|
||||
oldTags.Remove(ev.Player.Id);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -52,4 +52,8 @@ SHOP_ITEM_CLUSTER_GRENADE: "Cluster Grenade"
|
||||
SHOP_ITEM_CLUSTER_GRENADE_DESC: "A grenade that splits into multiple smaller grenades."
|
||||
|
||||
SHOP_ITEM_TELEPORT_DECOY: "Teleport Decoy"
|
||||
SHOP_ITEM_TELEPORT_DECOY_DESC: "A decoy that teleports you to it upon explosion."
|
||||
SHOP_ITEM_TELEPORT_DECOY_DESC: "A decoy that teleports you to it upon explosion."
|
||||
|
||||
SHOP_ITEM_TRIPWIRE: "Tripwire"
|
||||
SHOP_ITEM_TRIPWIRE_DESC: "A tripwire that explodes when triggered."
|
||||
SHOP_ITEM_TRIPWIRE_TOOFAR: "%PREFIX%You are too far away to place the tripwire."
|
||||
@@ -8,7 +8,7 @@ namespace TTT.Game.Events.Player;
|
||||
public class PlayerDamagedEvent(IOnlinePlayer player, IOnlinePlayer? attacker,
|
||||
int originalHp, int hpLeft) : PlayerEvent(player), ICancelableEvent {
|
||||
public PlayerDamagedEvent(IOnlinePlayer player, IOnlinePlayer? attacker,
|
||||
int damageDealt) : this(player, attacker, player.Health - damageDealt,
|
||||
int damageDealt) : this(player, attacker, player.Health + damageDealt,
|
||||
player.Health) { }
|
||||
|
||||
public PlayerDamagedEvent(IPlayerConverter<CCSPlayerController> converter,
|
||||
|
||||
@@ -77,6 +77,7 @@ public class ListCommand(IServiceProvider provider) : ICommand, IItemSorter {
|
||||
public void InvalidateOrder(IOnlinePlayer? player) {
|
||||
if (player == null) return;
|
||||
cache.Remove(player.Id);
|
||||
lastUpdate.Remove(player.Id);
|
||||
}
|
||||
|
||||
private List<IShopItem> calculateSortedItems(IOnlinePlayer? player) {
|
||||
|
||||
@@ -54,5 +54,6 @@ public class DeagleDamageListener(IServiceProvider provider)
|
||||
}
|
||||
|
||||
ev.HpLeft = -100;
|
||||
Messenger.Message(victim, Locale[DeagleMsgs.SHOP_ITEM_DEAGLE_VICTIM]);
|
||||
}
|
||||
}
|
||||
@@ -11,4 +11,7 @@ public class DeagleMsgs {
|
||||
|
||||
public static IMsg SHOP_ITEM_DEAGLE_HIT_FF
|
||||
=> MsgFactory.Create(nameof(SHOP_ITEM_DEAGLE_HIT_FF));
|
||||
|
||||
public static IMsg SHOP_ITEM_DEAGLE_VICTIM
|
||||
=> MsgFactory.Create(nameof(SHOP_ITEM_DEAGLE_VICTIM));
|
||||
}
|
||||
@@ -2,8 +2,8 @@
|
||||
xmlns:s="clr-namespace:System;assembly=mscorlib"
|
||||
xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xml:space="preserve">
|
||||
<s:Boolean
|
||||
x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=items_005Coneshotdeagle/@EntryIndexedValue">True</s:Boolean>
|
||||
x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=items_005Coneshotdeagle/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean
|
||||
x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=lang/@EntryIndexedValue">True</s:Boolean>
|
||||
x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=lang/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean
|
||||
x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=shop/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
|
||||
x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=shop/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
|
||||
@@ -13,6 +13,7 @@ using TTT.CS2.Items.PoisonSmoke;
|
||||
using TTT.CS2.Items.SilentAWP;
|
||||
using TTT.CS2.Items.Station;
|
||||
using TTT.CS2.Items.TeleportDecoy;
|
||||
using TTT.CS2.Items.Tripwire;
|
||||
using TTT.Shop.Commands;
|
||||
using TTT.Shop.Items;
|
||||
using TTT.Shop.Items.Detective.Stickers;
|
||||
@@ -61,5 +62,6 @@ public static class ShopServiceCollection {
|
||||
collection.AddStickerServices();
|
||||
collection.AddTaserServices();
|
||||
collection.AddTeleportDecoyServices();
|
||||
collection.AddTripwireServices();
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@ SHOP_ITEM_NOT_FOUND: "%SHOP_PREFIX%Could not find an item named \"{default}{0}{g
|
||||
SHOP_ITEM_DEAGLE: "One-Hit Revolver"
|
||||
SHOP_ITEM_DEAGLE_DESC: "A one-hit kill revolver with a single bullet. Aim carefully!"
|
||||
SHOP_ITEM_DEAGLE_HIT_FF: "%PREFIX%You hit a teammate!"
|
||||
SHOP_ITEM_DEAGLE_VICTIM: "%PREFIX%You were hit by a {yellow}One-Hit Revolver{grey}."
|
||||
|
||||
SHOP_ITEM_STICKERS: "Stickers"
|
||||
SHOP_ITEM_STICKERS_DESC: "Reveal the roles of all players you taser to others."
|
||||
|
||||
20
TTT/ShopAPI/Configs/Traitor/TripwireConfig.cs
Normal file
20
TTT/ShopAPI/Configs/Traitor/TripwireConfig.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System.Drawing;
|
||||
|
||||
namespace ShopAPI.Configs.Traitor;
|
||||
|
||||
public record TripwireConfig : ShopItemConfig {
|
||||
public override int Price { get; init; } = 60;
|
||||
public int ExplosionPower { get; init; } = 1000;
|
||||
public float FalloffDelay { get; init; } = 0.02f;
|
||||
public float FriendlyFireMultiplier { get; init; } = 0.5f;
|
||||
public float OutOfLineOfSightMultiplier { get; init; } = 0.3f;
|
||||
public bool FriendlyFireTriggers { get; init; } = true;
|
||||
public float MaxPlacementDistanceSquared { get; init; } = 400f * 400f;
|
||||
|
||||
public TimeSpan TripwireInitiationTime { get; init; } =
|
||||
TimeSpan.FromSeconds(2);
|
||||
|
||||
public float TripwireSizeSquared { get; init; } = 500f;
|
||||
public Color TripwireColor { get; init; } = Color.FromArgb(64, Color.Red);
|
||||
public float TripwireThickness { get; init; } = 0.5f;
|
||||
}
|
||||
@@ -40,7 +40,7 @@ public enum PurchaseResult {
|
||||
/// <summary>
|
||||
/// The item cannot be purchased multiple times, and the player already owns it.
|
||||
/// </summary>
|
||||
ALREADY_OWNED
|
||||
ALREADY_OWNED,
|
||||
}
|
||||
|
||||
public static class PurchaseResultExtensions {
|
||||
@@ -58,7 +58,7 @@ public static class PurchaseResultExtensions {
|
||||
PurchaseResult.WRONG_ROLE =>
|
||||
"You do not have the required role to purchase this item",
|
||||
PurchaseResult.ALREADY_OWNED =>
|
||||
"You already own this item and cannot purchase it again",
|
||||
"You have purchased the maximum amount of this item",
|
||||
_ => "An unexpected error occurred"
|
||||
};
|
||||
}
|
||||
|
||||
66
TTT/SpecialRound/Rounds/PistolRound.cs
Normal file
66
TTT/SpecialRound/Rounds/PistolRound.cs
Normal file
@@ -0,0 +1,66 @@
|
||||
using CounterStrikeSharp.API.Core;
|
||||
using CounterStrikeSharp.API.Modules.Memory;
|
||||
using CounterStrikeSharp.API.Modules.Memory.DynamicFunctions;
|
||||
using CounterStrikeSharp.API.Modules.Utils;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using SpecialRound.lang;
|
||||
using SpecialRoundAPI;
|
||||
using SpecialRoundAPI.Configs;
|
||||
using TTT.API;
|
||||
using TTT.API.Game;
|
||||
using TTT.API.Player;
|
||||
using TTT.API.Storage;
|
||||
using TTT.Game.Events.Game;
|
||||
using TTT.Locale;
|
||||
|
||||
namespace SpecialRound.Rounds;
|
||||
|
||||
public class PistolRound(IServiceProvider provider)
|
||||
: AbstractSpecialRound(provider), IPluginModule {
|
||||
private readonly IInventoryManager inventory = provider
|
||||
.GetRequiredService<IInventoryManager>();
|
||||
|
||||
private BasePlugin? plugin;
|
||||
public override string Name => "Pistol";
|
||||
public override IMsg Description => RoundMsgs.SPECIAL_ROUND_PISTOL;
|
||||
|
||||
private PistolRoundConfig config
|
||||
=> Provider.GetService<IStorage<PistolRoundConfig>>()
|
||||
?.Load()
|
||||
.GetAwaiter()
|
||||
.GetResult() ?? new PistolRoundConfig();
|
||||
|
||||
public override SpecialRoundConfig Config => config;
|
||||
|
||||
public void Start(BasePlugin? newPluing) { plugin = newPluing; }
|
||||
|
||||
public override void ApplyRoundEffects() {
|
||||
VirtualFunctions.CCSPlayer_ItemServices_CanAcquireFunc.Hook(canAcquire,
|
||||
HookMode.Pre);
|
||||
foreach (var player in Finder.GetOnline())
|
||||
inventory.RemoveWeaponInSlot(player, 0);
|
||||
}
|
||||
|
||||
private HookResult canAcquire(DynamicHook hook) {
|
||||
var player = hook.GetParam<CCSPlayer_ItemServices>(0)
|
||||
.Pawn.Value.Controller.Value?.As<CCSPlayerController>();
|
||||
var data = VirtualFunctions.GetCSWeaponDataFromKey.Invoke(-1,
|
||||
hook.GetParam<CEconItemView>(1).ItemDefinitionIndex.ToString());
|
||||
|
||||
if (player == null || !player.IsValid) return HookResult.Continue;
|
||||
|
||||
if (Tag.RIFLES.Contains(data.Name)) {
|
||||
hook.SetReturn(AcquireResult.NotAllowedByMode);
|
||||
return HookResult.Handled;
|
||||
}
|
||||
|
||||
return HookResult.Continue;
|
||||
}
|
||||
|
||||
public override void OnGameState(GameStateUpdateEvent ev) {
|
||||
if (ev.NewState != State.FINISHED) return;
|
||||
|
||||
VirtualFunctions.CCSPlayer_ItemServices_CanAcquireFunc.Unhook(canAcquire,
|
||||
HookMode.Pre);
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
using CounterStrikeSharp.API;
|
||||
using CounterStrikeSharp.API.Core;
|
||||
using CounterStrikeSharp.API.Core;
|
||||
using CounterStrikeSharp.API.Modules.UserMessages;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using SpecialRound.lang;
|
||||
@@ -15,23 +14,6 @@ namespace SpecialRound.Rounds;
|
||||
|
||||
public class SuppressedRound(IServiceProvider provider)
|
||||
: AbstractSpecialRound(provider), IPluginModule {
|
||||
public override string Name => "Suppressed";
|
||||
public override IMsg Description => RoundMsgs.SPECIAL_ROUND_SUPPRESSED;
|
||||
public override SpecialRoundConfig Config => config;
|
||||
private BasePlugin? plugin;
|
||||
|
||||
private SuppressedRoundConfig config
|
||||
=> Provider.GetService<IStorage<SuppressedRoundConfig>>()
|
||||
?.Load()
|
||||
.GetAwaiter()
|
||||
.GetResult() ?? new SuppressedRoundConfig();
|
||||
|
||||
public void Start(BasePlugin? newPlugin) { plugin ??= newPlugin; }
|
||||
|
||||
public override void ApplyRoundEffects() {
|
||||
plugin?.HookUserMessage(452, onWeaponSound);
|
||||
}
|
||||
|
||||
private static readonly HashSet<uint> silencedWeapons = new() {
|
||||
1, // deagle
|
||||
2, // dual berettas
|
||||
@@ -45,6 +27,23 @@ public class SuppressedRound(IServiceProvider provider)
|
||||
64 // r8 revolver
|
||||
};
|
||||
|
||||
private BasePlugin? plugin;
|
||||
public override string Name => "Suppressed";
|
||||
public override IMsg Description => RoundMsgs.SPECIAL_ROUND_SUPPRESSED;
|
||||
public override SpecialRoundConfig Config => config;
|
||||
|
||||
private SuppressedRoundConfig config
|
||||
=> Provider.GetService<IStorage<SuppressedRoundConfig>>()
|
||||
?.Load()
|
||||
.GetAwaiter()
|
||||
.GetResult() ?? new SuppressedRoundConfig();
|
||||
|
||||
public void Start(BasePlugin? newPlugin) { plugin ??= newPlugin; }
|
||||
|
||||
public override void ApplyRoundEffects() {
|
||||
plugin?.HookUserMessage(452, onWeaponSound);
|
||||
}
|
||||
|
||||
private HookResult onWeaponSound(UserMessage msg) {
|
||||
var defIndex = msg.ReadUInt("item_def_index");
|
||||
|
||||
|
||||
@@ -15,5 +15,6 @@ public static class SpecialRoundCollection {
|
||||
services.AddModBehavior<VanillaRound>();
|
||||
services.AddModBehavior<SuppressedRound>();
|
||||
services.AddModBehavior<SilentRound>();
|
||||
services.AddModBehavior<PistolRound>();
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
public record SpecialRoundsConfig {
|
||||
public int MinRoundsBetweenSpecial { get; init; } = 3;
|
||||
public int MinPlayersForSpecial { get; init; } = 8;
|
||||
public int MinPlayersForSpecial { get; init; } = 5;
|
||||
public int MinRoundsAfterMapChange { get; init; } = 2;
|
||||
public float SpecialRoundChance { get; init; } = 0.2f;
|
||||
}
|
||||
@@ -22,6 +22,9 @@ public class RoundMsgs {
|
||||
public static IMsg SPECIAL_ROUND_SILENT
|
||||
=> MsgFactory.Create(nameof(SPECIAL_ROUND_SILENT));
|
||||
|
||||
public static IMsg SPECIAL_ROUND_PISTOL
|
||||
=> MsgFactory.Create(nameof(SPECIAL_ROUND_PISTOL));
|
||||
|
||||
public static IMsg SPECIAL_ROUND_STARTED(AbstractSpecialRound round) {
|
||||
return MsgFactory.Create(nameof(SPECIAL_ROUND_STARTED), round.Name);
|
||||
}
|
||||
|
||||
@@ -4,4 +4,5 @@ SPECIAL_ROUND_BHOP: " {Yellow}BHOP{grey}: Bunny hopping is enabled! Hold jump to
|
||||
SPECIAL_ROUND_VANILLA: " {green}VANILLA{grey}: The shop has been disabled!"
|
||||
SPECIAL_ROUND_SUPPRESSED: " {grey}SUPPRESSED{grey}: All pistols are silent!"
|
||||
SPECIAL_ROUND_SILENT: " {grey}SILENT{grey}: All players are muted!"
|
||||
SPECIAL_ROUND_PISTOL: " {blue}PISTOL{grey}: You can only use pistols this round!"
|
||||
VANILLA_ROUND_REMINDER: "%SHOP_PREFIX%This is a {purple}Vanilla{grey} round. The shop is disabled."
|
||||
@@ -1,343 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html lang="en">
|
||||
<head>
|
||||
<link rel="stylesheet" href="/Content/Site.css" />
|
||||
<title>'Apache-2.0' reference</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="main-content">
|
||||
|
||||
|
||||
|
||||
<h1>Apache License 2.0</h1>
|
||||
|
||||
<h2>SPDX identifier</h2>
|
||||
<div id="license-expression">Apache-2.0</div>
|
||||
|
||||
<h2>License text</h2>
|
||||
|
||||
<div class="optional-license-text">
|
||||
<p>Apache License
|
||||
<br />
|
||||
|
||||
Version 2.0, January 2004
|
||||
<br />
|
||||
|
||||
http://www.apache.org/licenses/
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<div class="optional-license-text">
|
||||
<p>TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION</p>
|
||||
|
||||
</div>
|
||||
|
||||
<ul style="list-style:none">
|
||||
|
||||
<li>
|
||||
<var class="replaceable-license-text"> 1.</var>
|
||||
Definitions.
|
||||
|
||||
<ul style="list-style:none">
|
||||
|
||||
<li>
|
||||
<p>"License" shall mean the terms and conditions for use, reproduction, and distribution
|
||||
as defined by Sections 1 through 9 of this document.</p>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<p>"Licensor" shall mean the copyright owner or entity authorized by the copyright owner
|
||||
that is granting the License.</p>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<p>"Legal Entity" shall mean the union of the acting entity and all other entities that
|
||||
control, are controlled by, or are under common control with that entity. For the purposes of
|
||||
this definition, "control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or otherwise, or (ii) ownership of
|
||||
fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such
|
||||
entity.</p>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<p>"You" (or "Your") shall mean an individual or Legal Entity exercising
|
||||
permissions granted by this License.</p>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<p>"Source" form shall mean the preferred form for making modifications, including but not
|
||||
limited to software source code, documentation source, and configuration files.</p>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<p>"Object" form shall mean any form resulting from mechanical transformation or
|
||||
translation of a Source form, including but not limited to compiled object code, generated
|
||||
documentation, and conversions to other media types.</p>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<p>"Work" shall mean the work of authorship, whether in Source or Object form, made
|
||||
available under the License, as indicated by a copyright notice that is included in or
|
||||
attached to the work (an example is provided in the Appendix below).</p>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<p>"Derivative Works" shall mean any work, whether in Source or Object form, that is based
|
||||
on (or derived from) the Work and for which the editorial revisions, annotations,
|
||||
elaborations, or other modifications represent, as a whole, an original work of authorship.
|
||||
For the purposes of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative
|
||||
Works thereof.</p>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<p>"Contribution" shall mean any work of authorship, including the original version of the
|
||||
Work and any modifications or additions to that Work or Derivative Works thereof, that is
|
||||
intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an
|
||||
individual or Legal Entity authorized to submit on behalf of the copyright owner. For the
|
||||
purposes of this definition, "submitted" means any form of electronic, verbal, or
|
||||
written communication sent to the Licensor or its representatives, including but not limited
|
||||
to communication on electronic mailing lists, source code control systems, and issue tracking
|
||||
systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and
|
||||
improving the Work, but excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."</p>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<p>"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom
|
||||
a Contribution has been received by Licensor and subsequently incorporated within the
|
||||
Work.</p>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<var class="replaceable-license-text"> 2.</var>
|
||||
Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor
|
||||
hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
|
||||
irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display,
|
||||
publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or
|
||||
Object form.
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<var class="replaceable-license-text"> 3.</var>
|
||||
Grant of Patent License. Subject to the terms and conditions of this License, each Contributor
|
||||
hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
|
||||
irrevocable (except as stated in this section) patent license to make, have made, use, offer
|
||||
to sell, sell, import, and otherwise transfer the Work, where such license applies only to
|
||||
those patent claims licensable by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s) with the Work to which such
|
||||
Contribution(s) was submitted. If You institute patent litigation against any entity
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a
|
||||
Contribution incorporated within the Work constitutes direct or contributory patent
|
||||
infringement, then any patent licenses granted to You under this License for that Work shall
|
||||
terminate as of the date such litigation is filed.
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<var class="replaceable-license-text"> 4.</var>
|
||||
Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof
|
||||
in any medium, with or without modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
<ul style="list-style:none">
|
||||
|
||||
<li>
|
||||
<var class="replaceable-license-text"> (a)</var>
|
||||
You must give any other recipients of the Work or Derivative Works a copy of this License; and
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<var class="replaceable-license-text"> (b)</var>
|
||||
You must cause any modified files to carry prominent notices stating that You changed the files; and
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<var class="replaceable-license-text"> (c)</var>
|
||||
You must retain, in the Source form of any Derivative Works that You distribute, all
|
||||
copyright, patent, trademark, and attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of the Derivative Works; and
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<var class="replaceable-license-text"> (d)</var>
|
||||
If the Work includes a "NOTICE" text file as part of its distribution, then any
|
||||
Derivative Works that You distribute must include a readable copy of the attribution
|
||||
notices contained within such NOTICE file, excluding those notices that do not pertain to
|
||||
any part of the Derivative Works, in at least one of the following places: within a NOTICE
|
||||
text file distributed as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or, within a display generated
|
||||
by the Derivative Works, if and wherever such third-party notices normally appear. The
|
||||
contents of the NOTICE file are for informational purposes only and do not modify the
|
||||
License. You may add Your own attribution notices within Derivative Works that You
|
||||
distribute, alongside or as an addendum to the NOTICE text from the Work, provided that
|
||||
such additional attribution notices cannot be construed as modifying the License.
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<p>You may add Your own copyright statement to Your modifications and may provide additional or
|
||||
different license terms and conditions for use, reproduction, or distribution of Your
|
||||
modifications, or for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with the conditions stated
|
||||
in this License.</p>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<var class="replaceable-license-text"> 5.</var>
|
||||
Submission of Contributions. Unless You explicitly state otherwise, any Contribution
|
||||
intentionally submitted for inclusion in the Work by You to the Licensor shall be under the
|
||||
terms and conditions of this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate
|
||||
license agreement you may have executed with Licensor regarding such Contributions.
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<var class="replaceable-license-text"> 6.</var>
|
||||
Trademarks. This License does not grant permission to use the trade names, trademarks, service
|
||||
marks, or product names of the Licensor, except as required for reasonable and customary use
|
||||
in describing the origin of the Work and reproducing the content of the NOTICE file.
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<var class="replaceable-license-text"> 7.</var>
|
||||
Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor
|
||||
provides the Work (and each Contributor provides its Contributions) on an "AS IS"
|
||||
BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including,
|
||||
without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY,
|
||||
or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any risks associated with Your
|
||||
exercise of permissions under this License.
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<var class="replaceable-license-text"> 8.</var>
|
||||
Limitation of Liability. In no event and under no legal theory, whether in tort (including
|
||||
negligence), contract, or otherwise, unless required by applicable law (such as deliberate and
|
||||
grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for
|
||||
damages, including any direct, indirect, special, incidental, or consequential damages of any
|
||||
character arising as a result of this License or out of the use or inability to use the Work
|
||||
(including but not limited to damages for loss of goodwill, work stoppage, computer failure or
|
||||
malfunction, or any and all other commercial damages or losses), even if such Contributor has
|
||||
been advised of the possibility of such damages.
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<var class="replaceable-license-text"> 9.</var>
|
||||
Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works
|
||||
thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty,
|
||||
indemnity, or other liability obligations and/or rights consistent with this License. However,
|
||||
in accepting such obligations, You may act only on Your own behalf and on Your sole
|
||||
responsibility, not on behalf of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability incurred by, or claims asserted
|
||||
against, such Contributor by reason of your accepting any such warranty or additional
|
||||
liability.
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<div class="optional-license-text">
|
||||
<p>END OF TERMS AND CONDITIONS</p>
|
||||
|
||||
</div>
|
||||
<div class="optional-license-text">
|
||||
<p>APPENDIX: How to apply the Apache License to your work.</p>
|
||||
|
||||
<p>To apply the Apache License to your work, attach the following boilerplate notice, with the fields
|
||||
enclosed by brackets "[]" replaced with your own identifying information. (Don't
|
||||
include the brackets!) The text should be enclosed in the appropriate comment syntax for the file
|
||||
format. We also recommend that a file or class name and description of purpose be included on the same
|
||||
"printed page" as the copyright notice for easier identification within third-party
|
||||
archives.</p>
|
||||
|
||||
<p>Copyright <var class="replaceable-license-text"> [yyyy] [name of copyright owner]</var></p>
|
||||
|
||||
<p>Licensed under the Apache License, Version 2.0 (the "License");
|
||||
<br />
|
||||
|
||||
you may not use this file except in compliance with the License.
|
||||
<br />
|
||||
|
||||
You may obtain a copy of the License at
|
||||
</p>
|
||||
|
||||
<p>http://www.apache.org/licenses/LICENSE-2.0</p>
|
||||
|
||||
<p>Unless required by applicable law or agreed to in writing, software
|
||||
<br />
|
||||
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
<br />
|
||||
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
<br />
|
||||
|
||||
See the License for the specific language governing permissions and
|
||||
<br />
|
||||
|
||||
limitations under the License.
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<h2>Standard License Header</h2>
|
||||
|
||||
<p>Copyright <var class="replaceable-license-text"> [yyyy] [name of copyright owner]</var></p>
|
||||
|
||||
<p>Licensed under the Apache License, Version 2.0 (the "License");
|
||||
<br />
|
||||
|
||||
you may not use this file except in compliance with the License.
|
||||
<br />
|
||||
|
||||
You may obtain a copy of the License at
|
||||
</p>
|
||||
|
||||
<p>http://www.apache.org/licenses/LICENSE-2.0</p>
|
||||
|
||||
<p>Unless required by applicable law or agreed to in writing, software
|
||||
<br />
|
||||
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
<br />
|
||||
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
<br />
|
||||
|
||||
See the License for the specific language governing permissions and
|
||||
<br />
|
||||
|
||||
limitations under the License.
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
<h2>Notes</h2>
|
||||
<p>This license was released January 2004</p>
|
||||
|
||||
<h2>SPDX web page</h2>
|
||||
<ul>
|
||||
<li><a href="https://spdx.org/licenses/Apache-2.0.html">https://spdx.org/licenses/Apache-2.0.html</a></li>
|
||||
</ul>
|
||||
|
||||
<h2>Notice</h2>
|
||||
<p>This license content is provided by the <a href="https://spdx.dev/">SPDX project</a>. For more information about <b>licenses.nuget.org</b>, see <a href="https://aka.ms/licenses.nuget.org">our documentation</a>.
|
||||
|
||||
<p><i>Data pulled from <a href="https://github.com/spdx/license-list-data">spdx/license-list-data</a> on November 6, 2024.</i></p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,63 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html lang="en">
|
||||
<head>
|
||||
<link rel="stylesheet" href="/Content/Site.css" />
|
||||
<title>'MIT' reference</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="main-content">
|
||||
|
||||
|
||||
|
||||
<h1>MIT License</h1>
|
||||
|
||||
<h2>SPDX identifier</h2>
|
||||
<div id="license-expression">MIT</div>
|
||||
|
||||
<h2>License text</h2>
|
||||
|
||||
<div class="optional-license-text">
|
||||
<p>MIT License</p>
|
||||
|
||||
</div>
|
||||
<div class="replaceable-license-text">
|
||||
<p>Copyright (c) <year> <copyright holders>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
<p>Permission is hereby granted, free of charge, to any person obtaining a copy of <var class="replaceable-license-text"> this software and
|
||||
associated documentation files</var> (the "Software"), to deal in the Software without restriction,
|
||||
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:</p>
|
||||
|
||||
<p>The above copyright notice and this permission notice
|
||||
<var class="optional-license-text"> (including the next paragraph)</var>
|
||||
shall be included in all copies or substantial
|
||||
portions of the Software.</p>
|
||||
|
||||
<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
||||
NO EVENT SHALL <var class="replaceable-license-text"> THE AUTHORS OR COPYRIGHT HOLDERS</var> BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>SPDX web page</h2>
|
||||
<ul>
|
||||
<li><a href="https://spdx.org/licenses/MIT.html">https://spdx.org/licenses/MIT.html</a></li>
|
||||
</ul>
|
||||
|
||||
<h2>Notice</h2>
|
||||
<p>This license content is provided by the <a href="https://spdx.dev/">SPDX project</a>. For more information about <b>licenses.nuget.org</b>, see <a href="https://aka.ms/licenses.nuget.org">our documentation</a>.
|
||||
|
||||
<p><i>Data pulled from <a href="https://github.com/spdx/license-list-data">spdx/license-list-data</a> on November 6, 2024.</i></p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user