Bandit antag (#508)

* remove default antags

* simple bandit antag

* greetings audio and gear

* fixes

* Update AntagPreferenceTest.cs

* gamemodes

* Update game_presets.yml
This commit is contained in:
Ed
2024-10-24 18:19:14 +03:00
committed by GitHub
parent f2b8713dc2
commit 0f6dd2905d
19 changed files with 124 additions and 21 deletions

View File

@@ -15,7 +15,7 @@ namespace Content.IntegrationTests.Tests.GameRules;
// Lets not let that happen again.
[TestFixture]
public sealed class AntagPreferenceTest
{
{/* CP14 disabled
[Test]
public async Task TestLobbyPlayersValid()
{
@@ -72,5 +72,5 @@ public sealed class AntagPreferenceTest
await server.WaitPost(() => server.EntMan.DeleteEntity(uid));
await pair.CleanReturnAsync();
}
}*/
}

View File

@@ -1,3 +1,4 @@
using Content.Server._CP14.Roles;
using Content.Server.Administration.Commands;
using Content.Server.Antag;
using Content.Server.GameTicking.Rules.Components;
@@ -52,6 +53,23 @@ public sealed partial class AdminVerbSystem
var targetPlayer = targetActor.PlayerSession;
Verb CP14Bandit = new()
{
Text = Loc.GetString("cp14-admin-verb-text-make-bandit"),
Category = VerbCategory.Antag,
Icon = new SpriteSpecifier.Rsi(new ResPath("/Textures/Clothing/Hands/Gloves/Color/black.rsi"),
"icon"), //TODO
Act = () =>
{
//_antag.ForceMakeAntag<CP14BanditRoleComponent>(targetPlayer, "CP14Bandit"); //TODO
},
Impact = LogImpact.High,
Message = Loc.GetString("cp14-admin-verb-make-bandit"),
};
args.Verbs.Add(CP14Bandit);
/* CP14 disable default antags
Verb traitor = new()
{
Text = Loc.GetString("admin-verb-text-make-traitor"),
@@ -151,5 +169,6 @@ public sealed partial class AdminVerbSystem
Message = Loc.GetString("admin-verb-make-thief"),
};
args.Verbs.Add(thief);
*/
}
}

View File

@@ -0,0 +1,11 @@
using Content.Shared.Roles;
namespace Content.Server._CP14.Roles;
/// <summary>
/// Added to mind role entities to tag that they are a bandit.
/// </summary>
[RegisterComponent]
public sealed partial class CP14BanditRoleComponent : BaseMindRoleComponent
{
}

View File

@@ -0,0 +1,4 @@
- files: ["bandit_start.ogg"]
license: "CC-BY-4.0"
copyright: 'by Victor_Natas of Freesound.org'
source: "https://freesound.org/people/Victor_Natas/sounds/612156/"

Binary file not shown.

View File

@@ -0,0 +1,2 @@
cp14-admin-verb-text-make-bandit = Make bandit
cp14-admin-verb-make-bandit = Add to target antagonist role “Bandit”

View File

@@ -0,0 +1,3 @@
cp14-roles-antag-bandit-name = Bandit
cp14-roles-antag-bandit-objective = Defy morality and the law. You need money. A lot of money, and you can earn it in any way you want, including robbery and murder.
cp14-roles-antag-bandit-briefing = The cruel past has opened your eyes: the creatures around you are weaklings trying to cling to so-called “morality”. That word is foreign to you. You know that murder or robbery is just one of the tools to achieve your goals.

View File

@@ -0,0 +1,2 @@
cp14-admin-verb-text-make-bandit = Сделать бандитом
cp14-admin-verb-make-bandit = Добавить цели роль антагониста "Бандит"

View File

@@ -0,0 +1,3 @@
cp14-roles-antag-bandit-name = Бандит
cp14-roles-antag-bandit-objective = Отриньте моральные нормы и закон. Вам нужны деньги. Много денег, и вы можете зарабатывать их любыми способами, включая грабежи, разбой и убийства.
cp14-roles-antag-bandit-briefing = Жестокое прошлое открыло вам глаза: окружающие вас существа - слабаки, старающиеся держаться за так называемую "мораль". Вам это слово чуждо. Вы знаете, что убийство или грабежи - это просто один из инструментов достижения ваших целей.

View File

@@ -2,7 +2,7 @@
id: Nukeops
name: roles-antag-nuclear-operative-name
antagonist: true
setPreference: true
setPreference: false #CP14
objective: roles-antag-nuclear-operative-objective
requirements:
- !type:OverallPlaytimeRequirement
@@ -13,7 +13,7 @@
id: NukeopsMedic
name: roles-antag-nuclear-operative-agent-name
antagonist: true
setPreference: true
setPreference: false #CP14
objective: roles-antag-nuclear-operative-agent-objective
requirements:
- !type:OverallPlaytimeRequirement
@@ -27,7 +27,7 @@
id: NukeopsCommander
name: roles-antag-nuclear-operative-commander-name
antagonist: true
setPreference: true
setPreference: false #CP14
objective: roles-antag-nuclear-operative-commander-objective
requirements:
- !type:OverallPlaytimeRequirement

View File

@@ -2,7 +2,7 @@
id: HeadRev
name: roles-antag-rev-head-name
antagonist: true
setPreference: true
setPreference: false #CP14
objective: roles-antag-rev-head-objective
guides: [ Revolutionaries ]

View File

@@ -2,7 +2,7 @@
id: Thief
name: roles-antag-thief-name
antagonist: true
setPreference: true
setPreference: false #CP14
objective: roles-antag-thief-objective
guides: [ Thieves ]

View File

@@ -2,7 +2,7 @@
id: Traitor
name: roles-antag-syndicate-agent-name
antagonist: true
setPreference: true
setPreference: false #CP14
objective: roles-antag-syndicate-agent-objective
guides: [ Traitors ]
@@ -10,7 +10,7 @@
id: TraitorSleeper
name: roles-antag-syndicate-agent-sleeper-name
antagonist: true
setPreference: true
setPreference: false #CP14
objective: roles-antag-syndicate-agent-sleeper-objective
guides: [ Traitors ]

View File

@@ -2,7 +2,7 @@
id: InitialInfected
name: roles-antag-initial-infected-name
antagonist: true
setPreference: true
setPreference: false #CP14
objective: roles-antag-initial-infected-objective
guides: [ Zombies ]

View File

@@ -28,6 +28,8 @@
description: A thief's tool that, with proper skill and skill, allows you to pick any lock.
categories: [ ForkFiltered ]
components:
- type: Item
storedRotation: -90
- type: Sprite
sprite: _CP14/Objects/keys.rsi
state: lockpick

View File

@@ -10,7 +10,6 @@
- type: entity
id: CP14RoundObjectivesRule
parent: CP14BaseGameRule
categories: [ HideSpawnMenu ]
components:
- type: CP14CommonObjectivesRule
departmentObjectives:
@@ -20,4 +19,26 @@
departmentObjectives:
CP14Mercenary:
- CP14PersonalCurrencyCollectObjectiveGroup
- type: entity
id: CP14BanditsRule
parent: CP14BaseGameRule
components:
- type: GameRule
minPlayers: 0 #Increase when bigger online
- type: AntagSelection
definitions:
- prefRoles: [ CP14Bandit ]
startingGear: CP14BanditGear
max: 8
playerRatio: 10
blacklist:
components:
- AntagImmune
lateJoinAdditional: true
mindRoles:
- CP14MindRoleBandit
briefing:
text: cp14-roles-antag-bandit-briefing
color: "#cc3010"
sound: "/Audio/_CP14/Ambience/Antag/bandit_start.ogg"

View File

@@ -0,0 +1,32 @@
- type: antag
id: CP14Bandit
name: cp14-roles-antag-bandit-name
antagonist: true
setPreference: true
objective: cp14-roles-antag-bandit-objective
requirements:
- !type:OverallPlaytimeRequirement
time: 3600 # 1h
#guides: TODO
- type: startingGear
id: CP14BanditGear
storage:
back:
- CP14BaseLockpick
- CP14BaseLockpick
- CP14BaseLockpick
- type: entity
parent: BaseMindRoleAntag
id: CP14MindRoleBandit
categories: [ ForkFiltered ]
name: Bandit Role
# description: cp14-roles-antag-bandit-objective
components:
- type: MindRole
antagPrototype: CP14Bandit
exclusiveAntag: true
- type: CP14BanditRole
- type: RoleBriefing
briefing: cp14-roles-antag-bandit-briefing

View File

@@ -10,14 +10,15 @@
rules:
- Secret
#- type: gamePreset
# id: CP14ResourceHarvesting
# name: cp14-gamepreset-resource-harvest
# description: cp14-gamepreset-resource-harvest-desc
# showInVote: true
# cP14Allowed: true
# rules:
# - CP14ResourceHarvesting
- type: gamePreset
id: CP14Greenshift
name: greenshift-title
description: greenshift-description
showInVote: true
cP14Allowed: true
rules:
- CP14BanditsRule
- CP14RoundObjectivesRule
- type: gamePreset
id: CP14Sandbox
@@ -26,6 +27,8 @@
name: sandbox-title
description: sandbox-description
showInVote: true # For playtest period only
cP14Allowed: true
rules:
- Sandbox
- CP14BanditsRule
- CP14RoundObjectivesRule

View File

@@ -1,4 +1,5 @@
- type: weightedRandom
id: Secret
weights:
CP14Sandbox: 1
CP14Sandbox: 0.5
CP14Greenshift: 0.5