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

АПИИ 3 #52

Merged
merged 10 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Content.Server._CorvaxNext.Api;
using Content.Server._CorvaxNext.Api.Components;
using Content.Server.Administration.Commands;
using Content.Server.Antag;
using Content.Server.GameTicking.Rules.Components;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
namespace Content.Server.Thief.Components;

[RegisterComponent]
public sealed partial class ThiefBeaconAccessComponent : Component; // Corvax-Next-Api
3 changes: 2 additions & 1 deletion Content.Server/Thief/Systems/ThiefBeaconSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using Content.Shared.Verbs;
using Content.Shared.Roles;
using Robust.Shared.Audio.Systems;
using Content.Server._CorvaxNext.Api.Components;

namespace Content.Server.Thief.Systems;

Expand Down Expand Up @@ -38,7 +39,7 @@ private void OnGetInteractionVerbs(Entity<ThiefBeaconComponent> beacon, ref GetV
return;

var mind = _mind.GetMind(args.User);
if (mind == null || !_roles.MindHasRole<ThiefRoleComponent>(mind.Value))
if (mind == null || !_roles.MindHasRole<ThiefBeaconAccessComponent>(mind.Value)) // Corvax-Next-Api
return;

var user = args.User;
Expand Down
14 changes: 11 additions & 3 deletions Content.Server/Thief/Systems/ThiefUndeterminedBackpackSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Robust.Server.GameObjects;
using Robust.Server.Audio;
using Robust.Shared.Prototypes;
using Content.Shared.Implants.Components;

namespace Content.Server.Thief.Systems;

Expand Down Expand Up @@ -34,6 +35,13 @@ private void OnUIOpened(Entity<ThiefUndeterminedBackpackComponent> backpack, ref

private void OnApprove(Entity<ThiefUndeterminedBackpackComponent> backpack, ref ThiefBackpackApproveMessage args)
{
// Corvax-Next-Api-Start
var entity = backpack.Owner;

if (TryComp<SubdermalImplantComponent>(Transform(entity).ParentUid, out var implant) && implant.ImplantedEntity is not null)
entity = implant.ImplantedEntity.Value;
// Corvax-Next-Api-End

if (backpack.Comp.SelectedSets.Count != backpack.Comp.MaxSelectedSets)
return;

Expand All @@ -42,12 +50,12 @@ private void OnApprove(Entity<ThiefUndeterminedBackpackComponent> backpack, ref
var set = _proto.Index(backpack.Comp.PossibleSets[i]);
foreach (var item in set.Content)
{
var ent = Spawn(item, _transform.GetMapCoordinates(backpack.Owner));
var ent = Spawn(item, _transform.GetMapCoordinates(entity)); // Corvax-Next-Api
if (TryComp<ItemComponent>(ent, out var itemComponent))
_transform.DropNextTo(ent, backpack.Owner);
_transform.DropNextTo(ent, entity); // Corvax-Next-Api
}
}
_audio.PlayPvs(backpack.Comp.ApproveSound, backpack.Owner);
_audio.PlayPvs(backpack.Comp.ApproveSound, entity); // Corvax-Next-Api
QueueDel(backpack);
}
private void OnChangeSet(Entity<ThiefUndeterminedBackpackComponent> backpack, ref ThiefBackpackChangeSetMessage args)
Expand Down
5 changes: 3 additions & 2 deletions Content.Server/_CorvaxNext/Api/ApiRuleSystem.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using Content.Server._CorvaxNext.Api.Components;
using Content.Server.Antag;
using Content.Server.GameTicking.Rules;
using Content.Server.Roles;
Expand All @@ -13,15 +14,15 @@ public override void Initialize()
base.Initialize();

SubscribeLocalEvent<ApiRuleComponent, AfterAntagEntitySelectedEvent>(OnAfterAntagEntitySelected);
SubscribeLocalEvent<ApiRuleComponent, GetBriefingEvent>(OnGetBriefing);
SubscribeLocalEvent<ApiRoleComponent, 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)
private void OnGetBriefing(EntityUid entity, ApiRoleComponent apiRole, GetBriefingEvent e)
{
e.Append(Loc.GetString("api-role-greeting"));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
namespace Content.Server._CorvaxNext.Api.Components;

[RegisterComponent]
public sealed partial class ApiRoleComponent : Component;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Content.Server._CorvaxNext.Api;
namespace Content.Server._CorvaxNext.Api.Components;

[RegisterComponent]
public sealed partial class ApiRuleComponent : Component;
9 changes: 5 additions & 4 deletions Resources/Locale/ru-RU/_corvaxnext/api.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ admin-verb-make-api = Сделать цель агентом похищения

api-backpack-category-utilities-name = Набор Утилит
api-backpack-category-utilities-description =
Набор полезных вещей, содержащий имплантер
хранилища, энергокинжал, а также
криптографический секвенсор.
Набор полезных вещей, содержащий энергокинжал,
глушитель связи, а также криптографический секвенсор.

api-round-end-agent-name = АПИИ

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

objective-issuer-api = [color=#2ed2fd]Агенство[/color]
Expand All @@ -18,6 +18,7 @@ objective-condition-api-description = То, зачем вы сюда приле
steal-target-groups-ai = станционный ИИ, помещённый на интелкарту

api-role-greeting =
Вы агент похищения искусственного интеллекта, также известный как АПИИ.
Вы - агент похищения искусственного интеллекта, также известный как АПИИ.
В вас был помещён имплант хранилища со всеми нужными вещами.
У вас здесь одна цель: украсть станционный ИИ с помощью интелкарты.
Старайтесь действовать скрытно, вы это любите.
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
ent-ToolboxApi = ящик воровских инструментов неопределённости
.desc = Здесь лежат ваши излюбленные воровские штучки. Осталось вспомнить, какие именно.
.suffix = АПИИ
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ent-RadioJammerMicroreactor = { ent-RadioJammer }
.desc = { ent-RadioJammer.desc }
.suffix = глушитель связи Синдиката, микрореактор
1 change: 1 addition & 0 deletions Resources/Prototypes/Roles/MindRoles/mind_roles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@
- type: MindRole
antagPrototype: Thief
- type: ThiefRole
- type: ThiefBeaconAccess # Corvax-Next-Api

# Traitors
- type: entity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
sprite: /Textures/Objects/Tools/Toolboxes/toolbox_syn.rsi
state: icon
content:
- StorageImplanter
- RadioJammerMicroreactor
- EnergyDaggerBox
- Emag
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
- type: entity
parent: StorageImplant
id: ApiStorageImplant
categories: [ HideSpawnMenu ]
components:
- type: StorageFill
contents:
- id: ToolboxApi
- id: ThiefBeacon
- id: ClothingHandsChameleonThief
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
id: ToolboxApi
name: api undetermined toolbox
description: This is where your favorite api's supplies lie. Try to remember which ones.
suffix: API
parent: [ BaseItem, BaseMinorContraband ]
components:
- type: Sprite
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
- type: entity
parent: RadioJammer
id: RadioJammerMicroreactor
suffix: Microreactor
components:
- type: ItemSlots
slots:
cell_slot:
name: power-cell-slot-component-slot-name-default
startingItem: PowerCellMicroreactor
4 changes: 3 additions & 1 deletion Resources/Prototypes/_CorvaxNext/GameRules/api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
lateJoinAdditional: true
allowNonHumans: true
multiAntagSetting: NotExclusive
startingGear: ApiGear
components:
- type: AutoImplant
implants: [ ApiStorageImplant ]
mindRoles:
- MindRoleApi
briefing:
Expand Down
2 changes: 1 addition & 1 deletion Resources/Prototypes/_CorvaxNext/Objectives/api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
- type: RoleRequirement
roles:
mindRoles:
- ThiefRole
- ApiRole

- type: entity
abstract: true
Expand Down
10 changes: 1 addition & 9 deletions Resources/Prototypes/_CorvaxNext/Roles/Antags/api.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
- type: antag
id: Api
name: roles-antag-thief-name
name: roles-antag-api-name
antagonist: true
setPreference: false
objective: roles-antag-api-objective
guides: [ Thieves ]
requirements:
- !type:OverallPlaytimeRequirement
time: 108000 # 30h # Corvax-RoleTime

- type: startingGear
id: ApiGear
storage:
back:
- ToolboxApi
- ClothingHandsChameleonThief
- ThiefBeacon
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Thief
- type: entity
parent: BaseMindRoleAntag
id: MindRoleApi
Expand All @@ -7,4 +6,5 @@
components:
- type: MindRole
antagPrototype: Api
- type: ThiefRole
- type: ApiRole
- type: ThiefBeaconAccess
Loading