Skip to content

Commit

Permalink
First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
FireNameFN committed Nov 9, 2024
1 parent 9933ab1 commit 88bbe84
Show file tree
Hide file tree
Showing 14 changed files with 205 additions and 3 deletions.
19 changes: 19 additions & 0 deletions Content.Server/Administration/Systems/AdminVerbSystem.Antags.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ public sealed partial class AdminVerbSystem
[ValidatePrototypeId<EntityPrototype>]
private const string DefaultThiefRule = "Thief";

// Corvax-Next-Api
[ValidatePrototypeId<EntityPrototype>]
private const string DefaultApiRule = "Api";

[ValidatePrototypeId<StartingGearPrototype>]
private const string PirateGearId = "PirateGear";

Expand Down Expand Up @@ -151,5 +155,20 @@ private void AddAntagVerbs(GetVerbsEvent<Verb> args)
Message = Loc.GetString("admin-verb-make-thief"),
};
args.Verbs.Add(thief);

// Corvax-Next-Api
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<ThiefRuleComponent>(targetPlayer, DefaultApiRule);
},
Impact = LogImpact.High,
Message = Loc.GetString("admin-verb-make-api"),
};
args.Verbs.Add(api);
}
}
20 changes: 17 additions & 3 deletions Content.Server/GameTicking/Rules/ThiefRuleSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -22,7 +23,7 @@ public override void Initialize()
private void AfterAntagSelected(Entity<ThiefRuleComponent> 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
Expand All @@ -32,11 +33,24 @@ private void OnGetBriefing(Entity<ThiefRoleComponent> role, ref GetBriefingEvent

if (ent is null)
return;
args.Append(MakeBriefing(ent.Value));

// Corvax-Next-Api
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));
}

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

var isHuman = HasComp<HumanoidAppearanceComponent>(ent);
var briefing = isHuman
? Loc.GetString("thief-role-greeting-human")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ public sealed partial class StealConditionComponent : Component
[DataField]
public bool CheckAlive = false;

// Corvax-Next-Api
[DataField]
public bool CheckHasAi = false;

/// <summary>
/// The minimum number of items you need to steal to fulfill a objective
/// </summary>
Expand Down
7 changes: 7 additions & 0 deletions Content.Server/Objectives/Systems/StealConditionSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -196,6 +197,12 @@ private int CheckStealTarget(EntityUid entity, StealConditionComponent condition
}
}

// Corvax-Next-Api
if (condition.CheckHasAi)
if (TryComp<StationAiHolderComponent>(entity, out var holder))
if (holder.Slot.Item is null)
return 0;

return TryComp<StackComponent>(entity, out var stack) ? stack.Count : 1;
}
}
21 changes: 21 additions & 0 deletions Resources/Locale/ru-RU/_CorvaxNext/api.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
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 =
Вы агент похищения искуственного интеллекта, также известный как АПИИ.
У вас здесь одна цель: украсть станционный ИИ с помощью интелкарты.
Старайтесь действовать скрытно, вы это любите.
2 changes: 2 additions & 0 deletions Resources/Prototypes/Entities/Mobs/Player/silicon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,8 @@
unshaded:
Empty: { state: empty }
Occupied: { state: full }
- type: StealTarget # Corvax-Next-Api
stealGroup: Ai

- type: entity
id: PlayerStationAiEmpty
Expand Down
11 changes: 11 additions & 0 deletions Resources/Prototypes/_CorvaxNext/Catalog/api_toolbox_sets.yml
Original file line number Diff line number Diff line change
@@ -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
- BoxHoloparasite
- EnergyDaggerBox
Original file line number Diff line number Diff line change
@@ -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:
- ChameleonSet
- SyndieSet
- UtilitiesSet
- type: ActivatableUI
key: enum.ThiefBackpackUIKey.Key
- type: UserInterface
interfaces:
enum.ThiefBackpackUIKey.Key:
type: ThiefBackpackBoundUserInterface
29 changes: 29 additions & 0 deletions Resources/Prototypes/_CorvaxNext/GameRules/api.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
- type: entity
parent: BaseGameRule
id: Api
components:
- type: ThiefRule
- type: AntagObjectives
objectives:
- EscapeThiefShuttleObjective
- type: AntagRandomObjectives
sets:
- groups: ApiObjectiveGroups
maxPicks: 1
maxDifficulty: 1
- 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"
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- type: stealTargetGroup
id: Ai
name: steal-target-groups-ai
sprite:
sprite: Mobs/Silicon/station_ai.rsi
state: ai
31 changes: 31 additions & 0 deletions Resources/Prototypes/_CorvaxNext/Objectives/api.yml
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
- type: weightedRandom
id: ApiObjectiveGroups
weights:
ApiObjectiveGroupAi: 1

- type: weightedRandom
id: ApiObjectiveGroupAi
weights:
AiStealObjective: 1
18 changes: 18 additions & 0 deletions Resources/Prototypes/_CorvaxNext/Roles/Antags/api.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
- type: antag
id: Api
name: roles-antag-thief-name
antagonist: true
setPreference: true
objective: roles-antag-api-objective
guides: [ Thieves ]
requirements:
- !type:OverallPlaytimeRequirement
time: 108000 # 30h # Corvax-RoleTime

- type: startingGear
id: ApiGear
storage:
back:
- ToolboxApi
- ClothingHandsChameleonThief
- ThiefBeacon
10 changes: 10 additions & 0 deletions Resources/Prototypes/_CorvaxNext/Roles/MindRoles/api_mind_role.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 88bbe84

Please sign in to comment.