diff --git a/Content.Server/Administration/Systems/AdminVerbSystem.Antags.cs b/Content.Server/Administration/Systems/AdminVerbSystem.Antags.cs index 28918e960e5..d990f3e3f10 100644 --- a/Content.Server/Administration/Systems/AdminVerbSystem.Antags.cs +++ b/Content.Server/Administration/Systems/AdminVerbSystem.Antags.cs @@ -33,6 +33,11 @@ public sealed partial class AdminVerbSystem [ValidatePrototypeId] private const string DefaultThiefRule = "Thief"; + // Corvax-Next-Api-Start + [ValidatePrototypeId] + private const string DefaultApiRule = "Api"; + // Corvax-Next-Api-End + [ValidatePrototypeId] private const string PirateGearId = "PirateGear"; @@ -151,5 +156,21 @@ private void AddAntagVerbs(GetVerbsEvent args) Message = Loc.GetString("admin-verb-make-thief"), }; args.Verbs.Add(thief); + + // Corvax-Next-Api-Start + Verb api = new() + { + Text = Loc.GetString("admin-verb-text-make-api"), + Category = VerbCategory.Antag, + Icon = new SpriteSpecifier.Rsi(new ResPath("/Textures/Mobs/Silicon/station_ai.rsi"), "ai"), + Act = () => + { + _antag.ForceMakeAntag(targetPlayer, DefaultApiRule); + }, + Impact = LogImpact.High, + Message = Loc.GetString("admin-verb-make-api"), + }; + args.Verbs.Add(api); + // Corvax-Next-Api-End } } diff --git a/Content.Server/GameTicking/Rules/ThiefRuleSystem.cs b/Content.Server/GameTicking/Rules/ThiefRuleSystem.cs index b00ed386363..3273303a6f9 100644 --- a/Content.Server/GameTicking/Rules/ThiefRuleSystem.cs +++ b/Content.Server/GameTicking/Rules/ThiefRuleSystem.cs @@ -2,6 +2,7 @@ using Content.Server.GameTicking.Rules.Components; using Content.Server.Roles; using Content.Shared.Humanoid; +using Content.Shared.Roles; namespace Content.Server.GameTicking.Rules; @@ -22,7 +23,7 @@ public override void Initialize() private void AfterAntagSelected(Entity mindId, ref AfterAntagEntitySelectedEvent args) { var ent = args.EntityUid; - _antag.SendBriefing(ent, MakeBriefing(ent), null, null); + _antag.SendBriefing(ent, MakeBriefing(ent, args.Def.PrefRoles.Contains("Api")), null, null); // Corvax-Next-Api } // Character screen briefing @@ -32,11 +33,26 @@ private void OnGetBriefing(Entity role, ref GetBriefingEvent if (ent is null) return; - args.Append(MakeBriefing(ent.Value)); + + // Corvax-Next-Api-Start + var api = false; + + foreach (var id in args.Mind.Comp.MindRoles) + if (TryComp(id, out var mindRole)) + if (mindRole.AntagPrototype == "Api") + api = true; + + args.Append(MakeBriefing(ent.Value, api)); + // Corvax-Next-Api-End } - private string MakeBriefing(EntityUid ent) + private string MakeBriefing(EntityUid ent, bool api) // Corvax-Next-Api { + // Corvax-Next-Api-Start + if (api) + return Loc.GetString("api-role-greeting"); + // Corvax-Next-Api-End + var isHuman = HasComp(ent); var briefing = isHuman ? Loc.GetString("thief-role-greeting-human") diff --git a/Content.Server/Objectives/Components/StealConditionComponent.cs b/Content.Server/Objectives/Components/StealConditionComponent.cs index cdade8cc8d7..4d12ad7fcd6 100644 --- a/Content.Server/Objectives/Components/StealConditionComponent.cs +++ b/Content.Server/Objectives/Components/StealConditionComponent.cs @@ -34,6 +34,11 @@ public sealed partial class StealConditionComponent : Component [DataField] public bool CheckAlive = false; + // Corvax-Next-Api-Start + [DataField] + public bool CheckHasAi = false; + // Corvax-Next-Api-End + /// /// The minimum number of items you need to steal to fulfill a objective /// diff --git a/Content.Server/Objectives/Systems/StealConditionSystem.cs b/Content.Server/Objectives/Systems/StealConditionSystem.cs index 48814e7ba3c..64025db78a9 100644 --- a/Content.Server/Objectives/Systems/StealConditionSystem.cs +++ b/Content.Server/Objectives/Systems/StealConditionSystem.cs @@ -13,6 +13,7 @@ using Content.Shared.Mobs.Components; using Content.Shared.Movement.Pulling.Components; using Content.Shared.Stacks; +using Content.Shared.Silicons.StationAi; namespace Content.Server.Objectives.Systems; @@ -196,6 +197,13 @@ private int CheckStealTarget(EntityUid entity, StealConditionComponent condition } } + // Corvax-Next-Api-Start + if (condition.CheckHasAi) + if (TryComp(entity, out var holder)) + if (holder.Slot.Item is null) + return 0; + // Corvax-Next-Api-End + return TryComp(entity, out var stack) ? stack.Count : 1; } } diff --git a/Resources/Locale/en-US/_CorvaxNext/chat/highlights.ftl b/Resources/Locale/en-US/_corvaxnext/chat/highlights.ftl similarity index 100% rename from Resources/Locale/en-US/_CorvaxNext/chat/highlights.ftl rename to Resources/Locale/en-US/_corvaxnext/chat/highlights.ftl diff --git a/Resources/Locale/ru-RU/_corvaxnext/api.ftl b/Resources/Locale/ru-RU/_corvaxnext/api.ftl new file mode 100644 index 00000000000..b72182fd1a0 --- /dev/null +++ b/Resources/Locale/ru-RU/_corvaxnext/api.ftl @@ -0,0 +1,24 @@ +admin-verb-text-make-api = Сделать АПИИ +admin-verb-make-api = Сделать цель агентом похищения искусственного интеллекта. + +api-backpack-category-utilities-name = Набор Утилит +api-backpack-category-utilities-description = + Набор полезных вещей, содержащий имплантер + хранилища, лазерный кинжал, а также + криптографический секвенсор. + +ent-ToolboxApi = ящик воровских инструментов неопределённости + .desc = Здесь лежат ваши излюбленные воровские штучки. Осталось вспомнить, какие именно. + +api-round-end-agent-name = агент похищения искусственного интеллекта + +roles-antag-api-objective = Украдите станционный ИИ, действуя скрытно. + +objective-condition-api-description = То, зачем я сюда прилетел. Осталось найти интелкарту и пробраться к нему. + +steal-target-groups-ai = станционный ИИ, помещённый на интелкарту + +api-role-greeting = + Вы агент похищения искусственного интеллекта, также известный как АПИИ. + У вас здесь одна цель: украсть станционный ИИ с помощью интелкарты. + Старайтесь действовать скрытно, вы это любите. diff --git a/Resources/Locale/ru-RU/_CorvaxNext/chat/highlights.ftl b/Resources/Locale/ru-RU/_corvaxnext/chat/highlights.ftl similarity index 100% rename from Resources/Locale/ru-RU/_CorvaxNext/chat/highlights.ftl rename to Resources/Locale/ru-RU/_corvaxnext/chat/highlights.ftl diff --git a/Resources/Prototypes/Entities/Mobs/Player/silicon.yml b/Resources/Prototypes/Entities/Mobs/Player/silicon.yml index 98cfd5a8a12..9022a5e229c 100644 --- a/Resources/Prototypes/Entities/Mobs/Player/silicon.yml +++ b/Resources/Prototypes/Entities/Mobs/Player/silicon.yml @@ -301,6 +301,8 @@ unshaded: Empty: { state: empty } Occupied: { state: full } + - type: StealTarget # Corvax-Next-Api + stealGroup: Ai - type: entity id: PlayerStationAiEmpty diff --git a/Resources/Prototypes/_CorvaxNext/Catalog/api_toolbox_sets.yml b/Resources/Prototypes/_CorvaxNext/Catalog/api_toolbox_sets.yml new file mode 100644 index 00000000000..800894d79d4 --- /dev/null +++ b/Resources/Prototypes/_CorvaxNext/Catalog/api_toolbox_sets.yml @@ -0,0 +1,11 @@ +- type: thiefBackpackSet + id: UtilitiesSet + name: api-backpack-category-utilities-name + description: api-backpack-category-utilities-description + sprite: + sprite: /Textures/Objects/Tools/Toolboxes/toolbox_syn.rsi + state: icon + content: + - StorageImplanter + - EnergyDaggerBox + - Emag diff --git a/Resources/Prototypes/_CorvaxNext/Entities/Objects/Tools/api_toolbox.yml b/Resources/Prototypes/_CorvaxNext/Entities/Objects/Tools/api_toolbox.yml new file mode 100644 index 00000000000..52f3163d810 --- /dev/null +++ b/Resources/Prototypes/_CorvaxNext/Entities/Objects/Tools/api_toolbox.yml @@ -0,0 +1,21 @@ +- type: entity + id: ToolboxApi + name: api undetermined toolbox + description: This is where your favorite api's supplies lie. Try to remember which ones. + parent: [ BaseItem, BaseMinorContraband ] + components: + - type: Sprite + sprite: Objects/Tools/Toolboxes/toolbox_thief.rsi + state: icon + - type: ThiefUndeterminedBackpack + maxSelectedSets: 3 + possibleSets: + - CommunicatorSet + - ChameleonSet + - UtilitiesSet + - type: ActivatableUI + key: enum.ThiefBackpackUIKey.Key + - type: UserInterface + interfaces: + enum.ThiefBackpackUIKey.Key: + type: ThiefBackpackBoundUserInterface diff --git a/Resources/Prototypes/_CorvaxNext/GameRules/api.yml b/Resources/Prototypes/_CorvaxNext/GameRules/api.yml new file mode 100644 index 00000000000..19aa955c30c --- /dev/null +++ b/Resources/Prototypes/_CorvaxNext/GameRules/api.yml @@ -0,0 +1,25 @@ +- type: entity + parent: BaseGameRule + id: Api + components: + - type: ThiefRule + - type: AntagObjectives + objectives: + - EscapeThiefShuttleObjective + - AiStealObjective + - type: AntagSelection + agentName: api-round-end-agent-name + definitions: + - prefRoles: [ Api ] + max: 1 + playerRatio: 15 + lateJoinAdditional: true + allowNonHumans: true + multiAntagSetting: NotExclusive + startingGear: ApiGear +# components: # Corvax-MRP +# - type: Pacified + mindRoles: + - MindRoleApi + briefing: + sound: "/Audio/Misc/thief_greeting.ogg" diff --git a/Resources/Prototypes/_CorvaxNext/Objectives/ai_steal_target_group.yml b/Resources/Prototypes/_CorvaxNext/Objectives/ai_steal_target_group.yml new file mode 100644 index 00000000000..df26a8b227f --- /dev/null +++ b/Resources/Prototypes/_CorvaxNext/Objectives/ai_steal_target_group.yml @@ -0,0 +1,6 @@ +- type: stealTargetGroup + id: Ai + name: steal-target-groups-ai + sprite: + sprite: Mobs/Silicon/station_ai.rsi + state: ai diff --git a/Resources/Prototypes/_CorvaxNext/Objectives/api.yml b/Resources/Prototypes/_CorvaxNext/Objectives/api.yml new file mode 100644 index 00000000000..862195a1702 --- /dev/null +++ b/Resources/Prototypes/_CorvaxNext/Objectives/api.yml @@ -0,0 +1,31 @@ +- type: entity + abstract: true + parent: BaseObjective + id: BaseApiObjective + components: + - type: Objective + issuer: objective-issuer-thief + - type: RoleRequirement + roles: + mindRoles: + - ThiefRole + +- type: entity + abstract: true + parent: [BaseApiObjective, BaseStealObjective] + id: BaseApiStealObjective + components: + - type: StealCondition + verifyMapExistence: false + descriptionText: objective-condition-api-description + checkStealAreas: true + +- type: entity + parent: BaseApiStealObjective + id: AiStealObjective + components: + - type: StealCondition + stealGroup: Ai + checkHasAi: true + - type: Objective + difficulty: 1 diff --git a/Resources/Prototypes/_CorvaxNext/Roles/Antags/api.yml b/Resources/Prototypes/_CorvaxNext/Roles/Antags/api.yml new file mode 100644 index 00000000000..7846ba83edb --- /dev/null +++ b/Resources/Prototypes/_CorvaxNext/Roles/Antags/api.yml @@ -0,0 +1,18 @@ +- type: antag + id: Api + name: roles-antag-thief-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 diff --git a/Resources/Prototypes/_CorvaxNext/Roles/MindRoles/api_mind_role.yml b/Resources/Prototypes/_CorvaxNext/Roles/MindRoles/api_mind_role.yml new file mode 100644 index 00000000000..9ee673e979f --- /dev/null +++ b/Resources/Prototypes/_CorvaxNext/Roles/MindRoles/api_mind_role.yml @@ -0,0 +1,10 @@ +# Thief +- type: entity + parent: BaseMindRoleAntag + id: MindRoleApi + name: Api Role +# description: mind-role-api-description + components: + - type: MindRole + antagPrototype: Api + - type: ThiefRole