using Robust.Shared.GameStates;
+using Robust.Shared.Prototypes;
namespace Content.Shared.Silicons.Borgs.Components;
[DataField]
[AutoNetworkedField]
public bool DefaultModule;
+
+ /// <summary>
+ /// List of types of borgs this module fits into.
+ /// This only affects examine text. The actual whitelist for modules that can be inserted into a borg is defined in its <see cref="BorgChassisComponent"/>.
+ /// </summary>
+ [DataField]
+ public HashSet<LocId>? BorgFitTypes;
}
/// <summary>
using Content.Shared.Containers.ItemSlots;
+using Content.Shared.Examine;
using Content.Shared.IdentityManagement;
using Content.Shared.Item.ItemToggle;
+using Content.Shared.Localizations;
using Content.Shared.Movement.Components;
using Content.Shared.Movement.Systems;
using Content.Shared.Popups;
SubscribeLocalEvent<BorgChassisComponent, RefreshMovementSpeedModifiersEvent>(OnRefreshMovementSpeedModifiers);
SubscribeLocalEvent<BorgChassisComponent, ActivatableUIOpenAttemptEvent>(OnUIOpenAttempt);
SubscribeLocalEvent<TryGetIdentityShortInfoEvent>(OnTryGetIdentityShortInfo);
+ SubscribeLocalEvent<BorgModuleComponent, ExaminedEvent>(OnModuleExamine);
InitializeRelay();
}
+ private void OnModuleExamine(Entity<BorgModuleComponent> ent, ref ExaminedEvent args)
+ {
+ if (ent.Comp.BorgFitTypes == null)
+ return;
+
+ if (ent.Comp.BorgFitTypes.Count == 0)
+ return;
+
+ var typeList = new List<string>();
+
+ foreach (var type in ent.Comp.BorgFitTypes)
+ {
+ typeList.Add(Loc.GetString(type));
+ }
+
+ var types = ContentLocalizationManager.FormatList(typeList);
+ args.PushMarkup(Loc.GetString("borg-module-fit", ("types", types)));
+ }
+
private void OnTryGetIdentityShortInfo(TryGetIdentityShortInfoEvent args)
{
if (args.Handled)
--- /dev/null
+borg-module-fit = This module fits into {$types}.
+
+borg-type-all = [color=white]any cyborg[/color]
+borg-type-salvage = [color= #d6b328]salvage cyborgs[/color]
+borg-type-engineer = [color= #ff9900]engineer cyborgs[/color]
+borg-type-generic = [color= #666680]generic cyborgs[/color]
+borg-type-janitor = [color= #a747c0]janitor cyborgs[/color]
+borg-type-medical = [color= #5995ba]medical cyborgs[/color]
+borg-type-service = [color= #508242]service cyborgs[/color]
+
+borg-type-syndicate = [color= #962023]syndicate cyborgs[/color]
+borg-type-syndicate-assault = [color= #680a0d]syndicate assault cyborgs[/color]
+
+xenoborg-type-all = [color= #3d94ff]any xenoborg[/color]
+xenoborg-type-engi = [color= #edd45b]engi xenoborgs[/color]
+xenoborg-type-heavy = [color= #d62020]heavy xenoborgs[/color]
+xenoborg-type-scout = [color= #6a6b6f]scout xenoborgs[/color]
+xenoborg-type-stealth = [color= #ff00cc]stealth xenoborgs[/color]
- type: Sprite
sprite: Objects/Specific/Robotics/borgmodule.rsi
- type: BorgModule
+ borgFitTypes:
+ - borg-type-all
- type: BorgModuleIcon
icon: { sprite: Interface/Actions/actions_borg.rsi, state: no-action }
- type: StaticPrice
parent: BaseBorgModule
abstract: true
components:
+ - type: BorgModule
+ borgFitTypes:
+ - borg-type-salvage
- type: Tag
tags:
- BorgModuleCargo
parent: BaseBorgModule
abstract: true
components:
+ - type: BorgModule
+ borgFitTypes:
+ - borg-type-engineer
- type: Tag
tags:
- BorgModuleEngineering
parent: BaseBorgModule
abstract: true
components:
+ - type: BorgModule
+ borgFitTypes:
+ - borg-type-janitor
- type: Tag
tags:
- BorgModuleJanitor
parent: BaseBorgModule
abstract: true
components:
+ - type: BorgModule
+ borgFitTypes:
+ - borg-type-medical
- type: Tag
tags:
- BorgModuleMedical
parent: BaseBorgModule
abstract: true
components:
+ - type: BorgModule
+ borgFitTypes:
+ - borg-type-generic
- type: Tag
tags:
- BorgModuleScience
parent: BaseBorgModule
abstract: true
components:
+ - type: BorgModule
+ borgFitTypes:
+ - borg-type-service
- type: Tag
tags:
- BorgModuleService
parent: BaseBorgModule
abstract: true
components:
+ - type: BorgModule
+ borgFitTypes:
+ - borg-type-syndicate
- type: Tag
tags:
- BorgModuleSyndicate
parent: BaseBorgModule
abstract: true
components:
+ - type: BorgModule
+ borgFitTypes:
+ - borg-type-syndicate-assault
- type: Tag
tags:
- BorgModuleSyndicateAssault
parent: BaseBorgModule
id: BaseXenoborgModuleGeneric
components:
+ - type: BorgModule
+ borgFitTypes:
+ - xenoborg-type-all
- type: Tag
tags:
- XenoborgModuleGeneric
parent: BaseBorgModule
id: BaseXenoborgModuleEngi
components:
+ - type: BorgModule
+ borgFitTypes:
+ - xenoborg-type-engi
- type: Tag
tags:
- XenoborgModuleEngi
id: BaseXenoborgModuleHeavy
abstract: true
components:
+ - type: BorgModule
+ borgFitTypes:
+ - xenoborg-type-heavy
- type: Tag
tags:
- XenoborgModuleHeavy
id: BaseXenoborgModuleScout
abstract: true
components:
+ - type: BorgModule
+ borgFitTypes:
+ - xenoborg-type-scout
- type: Tag
tags:
- XenoborgModuleScout
id: BaseXenoborgModuleStealth
abstract: true
components:
+ - type: BorgModule
+ borgFitTypes:
+ - xenoborg-type-stealth
- type: Tag
tags:
- XenoborgModuleStealth