Skip to content

Commit

Permalink
АПИИ 2 (#38)
Browse files Browse the repository at this point in the history
* First commit

* Improvements

* Fix

* Removed holo

* Edited items

* Starts and ends

* _corvaxnext

* Fix part 1

* Fix part 2

* Ftl fix

* Added greeting

* Attribution

* ApiRule

* Reverted ThiefRule

* EndRound improvements

* Revert ThiefRuleSystem again

* .ftl changes
  • Loading branch information
FireNameFN authored Nov 10, 2024
1 parent bd06ed9 commit 199dc73
Show file tree
Hide file tree
Showing 11 changed files with 67 additions and 32 deletions.
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: 5 additions & 6 deletions Resources/Locale/ru-RU/_corvaxnext/api.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,16 @@ 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 = станционный ИИ, помещённый на интелкарту
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ent-ToolboxApi = ящик воровских инструментов неопределённости
.desc = Здесь лежат ваши излюбленные воровские штучки. Осталось вспомнить, какие именно.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ent-EscapeApiShuttleObjective = Улететь на Центком живым и свободным.
.desc = Вы ещё нужны агенству. Не дайте себя арестовать.
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

0 comments on commit 199dc73

Please sign in to comment.