Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

АПИИ 2 #38

Merged
merged 18 commits into from
Nov 10, 2024
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using Content.Server._CorvaxNext.Api;
using Content.Server.Administration.Commands;
using Content.Server.Antag;
using Content.Server.GameTicking.Rules.Components;
Expand Down Expand Up @@ -165,7 +166,7 @@ private void AddAntagVerbs(GetVerbsEvent<Verb> args)
Icon = new SpriteSpecifier.Rsi(new ResPath("/Textures/Mobs/Silicon/station_ai.rsi"), "ai"),
Act = () =>
{
_antag.ForceMakeAntag<ThiefRuleComponent>(targetPlayer, DefaultApiRule);
_antag.ForceMakeAntag<ApiRuleComponent>(targetPlayer, DefaultApiRule);
},
Impact = LogImpact.High,
Message = Loc.GetString("admin-verb-make-api"),
Expand Down
22 changes: 3 additions & 19 deletions Content.Server/GameTicking/Rules/ThiefRuleSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using Content.Server.GameTicking.Rules.Components;
using Content.Server.Roles;
using Content.Shared.Humanoid;
using Content.Shared.Roles;

namespace Content.Server.GameTicking.Rules;

Expand All @@ -23,7 +22,7 @@ public override void Initialize()
private void AfterAntagSelected(Entity<ThiefRuleComponent> mindId, ref AfterAntagEntitySelectedEvent args)
{
var ent = args.EntityUid;
_antag.SendBriefing(ent, MakeBriefing(ent, args.Def.PrefRoles.Contains("Api")), null, null); // Corvax-Next-Api
_antag.SendBriefing(ent, MakeBriefing(ent), null, null);
}

// Character screen briefing
Expand All @@ -33,26 +32,11 @@ private void OnGetBriefing(Entity<ThiefRoleComponent> role, ref GetBriefingEvent

if (ent is null)
return;

// Corvax-Next-Api-Start
var api = false;

foreach (var id in args.Mind.Comp.MindRoles)
if (TryComp<MindRoleComponent>(id, out var mindRole))
if (mindRole.AntagPrototype == "Api")
api = true;

args.Append(MakeBriefing(ent.Value, api));
// Corvax-Next-Api-End
args.Append(MakeBriefing(ent.Value));
}

private string MakeBriefing(EntityUid ent, bool api) // Corvax-Next-Api
private string MakeBriefing(EntityUid ent)
{
// Corvax-Next-Api-Start
if (api)
return Loc.GetString("api-role-greeting");
// Corvax-Next-Api-End

var isHuman = HasComp<HumanoidAppearanceComponent>(ent);
var briefing = isHuman
? Loc.GetString("thief-role-greeting-human")
Expand Down
4 changes: 4 additions & 0 deletions Content.Server/_CorvaxNext/Api/ApiRuleComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
namespace Content.Server._CorvaxNext.Api;

[RegisterComponent]
public sealed partial class ApiRuleComponent : Component;
28 changes: 28 additions & 0 deletions Content.Server/_CorvaxNext/Api/ApiRuleSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using Content.Server.Antag;
using Content.Server.GameTicking.Rules;
using Content.Server.Roles;

namespace Content.Server._CorvaxNext.Api;

public sealed class ApiRuleSystem : GameRuleSystem<ApiRuleComponent>
{
[Dependency] private readonly AntagSelectionSystem _antag = default!;

public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<ApiRuleComponent, AfterAntagEntitySelectedEvent>(OnAfterAntagEntitySelected);
SubscribeLocalEvent<ApiRuleComponent, GetBriefingEvent>(OnGetBriefing);
}

private void OnAfterAntagEntitySelected(EntityUid entity, ApiRuleComponent apiRule, AfterAntagEntitySelectedEvent e)
{
_antag.SendBriefing(e.EntityUid, Loc.GetString("api-role-greeting"), null, null);
}

private void OnGetBriefing(EntityUid entity, ApiRuleComponent apiRule, GetBriefingEvent e)
{
e.Append(Loc.GetString("api-role-greeting"));
}
}
Binary file not shown.
4 changes: 4 additions & 0 deletions Resources/Audio/_CorvaxNext/Misc/attributions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- files: ["api_greeting.ogg"]
license: "CC-BY-4.0"
copyright: "Created by AivelCry using sounds from vengeance-sound.com/samples.php."
source: "https://github.com/FireNameFN/space-station-14-next/blob/503ef7641a977c2e5de70defcf7e2d399fc16a79/Resources/Audio/_CorvaxNext/Misc/api_greeting.ogg"
11 changes: 8 additions & 3 deletions Resources/Locale/ru-RU/_corvaxnext/api.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,25 @@ admin-verb-make-api = Сделать цель агентом похищения
api-backpack-category-utilities-name = Набор Утилит
api-backpack-category-utilities-description =
Набор полезных вещей, содержащий имплантер
хранилища, лазерный кинжал, а также
хранилища, энергокинжал, а также
криптографический секвенсор.

ent-ToolboxApi = ящик воровских инструментов неопределённости
.desc = Здесь лежат ваши излюбленные воровские штучки. Осталось вспомнить, какие именно.

api-round-end-agent-name = агент похищения искусственного интеллекта
api-round-end-agent-name = АПИИ

roles-antag-api-objective = Украдите станционный ИИ, действуя скрытно.

objective-condition-api-description = То, зачем я сюда прилетел. Осталось найти интелкарту и пробраться к нему.
objective-issuer-api = [color=#2ed2fd]Агенство[/color]

objective-condition-api-description = То, зачем вы сюда прилетели. Осталось найти интелкарту и пробраться к нему.

steal-target-groups-ai = станционный ИИ, помещённый на интелкарту

ent-EscapeApiShuttleObjective = Улететь на Центком живым и свободным.
.desc = Вы ещё нужны агенству. Не дайте себя арестовать.

api-role-greeting =
Вы агент похищения искусственного интеллекта, также известный как АПИИ.
У вас здесь одна цель: украсть станционный ИИ с помощью интелкарты.
Expand Down
8 changes: 3 additions & 5 deletions Resources/Prototypes/_CorvaxNext/GameRules/api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
parent: BaseGameRule
id: Api
components:
- type: ThiefRule
- type: ApiRule
- type: AntagObjectives
objectives:
- EscapeThiefShuttleObjective
- EscapeApiShuttleObjective
- AiStealObjective
- type: AntagSelection
agentName: api-round-end-agent-name
Expand All @@ -17,9 +17,7 @@
allowNonHumans: true
multiAntagSetting: NotExclusive
startingGear: ApiGear
# components: # Corvax-MRP
# - type: Pacified
mindRoles:
- MindRoleApi
briefing:
sound: "/Audio/Misc/thief_greeting.ogg"
sound: "/Audio/_CorvaxNext/Misc/api_greeting.ogg"
15 changes: 14 additions & 1 deletion Resources/Prototypes/_CorvaxNext/Objectives/api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
id: BaseApiObjective
components:
- type: Objective
issuer: objective-issuer-thief
issuer: objective-issuer-api
- type: RoleRequirement
roles:
mindRoles:
Expand All @@ -29,3 +29,16 @@
checkHasAi: true
- type: Objective
difficulty: 1

- type: entity
parent: [BaseApiObjective, BaseLivingObjective]
id: EscapeApiShuttleObjective
name: Escape to centcomm alive and unrestrained.
description: You don't want your illegal activities to be discovered by anyone, do you?
components:
- type: Objective
difficulty: 1.3
icon:
sprite: Structures/Furniture/chairs.rsi
state: shuttle
- type: EscapeShuttleCondition
Loading