Доступы для Мехов и Патрульный Под (#883)

* Mech Access and Sec Pod

* fix shit
This commit is contained in:
DragonDidlo 2024-12-21 18:06:32 +03:00 committed by GitHub
parent 3b13850036
commit 9118217bce
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 227 additions and 43 deletions

View file

@ -33,6 +33,8 @@ using Robust.Server.GameObjects;
using Robust.Shared.Containers;
using Robust.Shared.Player;
using Content.Shared.Whitelist;
using Content.Shared.Access.Components;
using Content.Shared.Access.Systems;
namespace Content.Server.Mech.Systems;
@ -54,6 +56,7 @@ public sealed partial class MechSystem : SharedMechSystem
[Dependency] private readonly SharedHandsSystem _hands = default!;
[Dependency] private readonly TagSystem _tag = default!;
[Dependency] private readonly MobThresholdSystem _mobThresholdSystem = default!;
[Dependency] private readonly AccessReaderSystem _accessReader = default!;
/// <inheritdoc/>
public override void Initialize()
@ -249,7 +252,14 @@ public sealed partial class MechSystem : SharedMechSystem
_popup.PopupEntity(Loc.GetString("mech-no-enter", ("item", uid)), args.User);
return;
}
if (TryComp<AccessReaderComponent>(uid, out var accessReader))
if (!_accessReader.IsAllowed(args.Args.User, uid, accessReader))
{
_popup.PopupEntity(Loc.GetString("mech-no-access", ("item", uid)), args.User);
return;
}
if (TryComp<HandsComponent>(args.Args.User, out var handsComponent))
foreach (var hand in _hands.EnumerateHands(args.Args.User, handsComponent))
_hands.DoDrop(args.Args.User, hand, true, handsComponent);

View file

@ -1,2 +1,2 @@
ent-MechSecPod = Security Pod
.desc = While lightly armored, the Gygax has incredible mobility thanks to its ability that lets it smash through walls at high speeds.
.desc = Despite its size, the Security Pod has incredible mobility in space thanks to its engines.

View file

@ -38,3 +38,6 @@ ent-SpawnMechMaulerSyndie = Mauler Spawner
ent-SpawnMechMaulerSyndieFilled = Mauler Spawner
.suffix = Filled
.desc = { ent-MarkerBase.desc }
ent-SpawnMechSecPodFilled = Sec Pod Spawner
.suffix = Filled
.desc = { ent-MarkerBase.desc }

View file

@ -17,5 +17,6 @@ mech-energy-missing = Energy: MISSING
mech-slot-display = Open Slots: {$amount}
mech-no-enter = You cannot pilot this.
mech-no-access = You do not have access to pilot this.
mech-eject-pilot-alert = {$user} is pulling the pilot out of the {$item}!

View file

@ -6,3 +6,5 @@ ent-MechMolotBattery = { ent-MechMolot }
ent-MechMolotFilled = { ent-MechMolotBattery }
.desc = { ent-MechMolotBattery.desc }
.suffix = Батарея, Заполнен
ent-MechSecPod = Патрульный Под
.desc = Несмотря на свои габариты, Охранный Под обладает невероятной мобильностью в космосе благодаря своим двигателям.

View file

@ -38,3 +38,6 @@ ent-SpawnMechMaulerSyndie = спавнер Маулер
ent-SpawnMechMaulerSyndieFilled = спавнер Маулер
.desc = { ent-MarkerBase.desc }
.suffix = Заполнен
ent-SpawnMechSecPodFilled = спавнер Патрульного Пода
.suffix = Filled
.desc = { ent-MarkerBase.desc }

View file

@ -11,4 +11,5 @@ mech-energy-display = Энергия: { $amount }%
mech-energy-missing = Энергия: ОТСУТСТВУЕТ
mech-slot-display = Доступно слотов: { $amount }
mech-no-enter = Вы не можете пилотировать это.
mech-no-access = У вас нет доступа для пилотирования.
mech-eject-pilot-alert = { $user } вытягивает пилота из { $item }!

View file

@ -240,4 +240,19 @@
state: mauler
- type: ConditionalSpawner
prototypes:
- MechMaulerSyndieFilled
- MechMaulerSyndieFilled
- type: entity
name: Sec Pod Spawner
suffix: Filled
id: SpawnMechSecPodFilled
parent: MarkerBase
components:
- type: Sprite
layers:
- state: green
- sprite: _Sunrise/Objects/Specific/Mech/sec_pod.rsi
state: sec_pod
- type: ConditionalSpawner
prototypes:
- MechSecPod

View file

@ -178,6 +178,7 @@
autoRot: true
radius: 4
netsync: false
- type: AccessReader
# Ripley MK-I
- type: entity
@ -860,6 +861,8 @@
- DoorBumpOpener
- FootstepSound
- Gygax
- type: AccessReader
access: [["CentralCommand"]]
- type: entity
id: MechNTGygaxBattery
@ -938,6 +941,8 @@
800: Critical
showOverlays: false
allowRevives: true
- type: AccessReader
access: [["CentralCommand"]]
- type: entity
id: MechMarauderBattery
@ -1016,6 +1021,8 @@
800: Critical
showOverlays: false
allowRevives: true
- type: AccessReader
access: [["CentralCommand"]]
- type: entity
id: MechSeraphBattery
@ -1102,6 +1109,8 @@
- DoorBumpOpener
- FootstepSound
- Gygax
- type: AccessReader
access: [["NuclearOperative"]]
- type: entity
id: MechGygaxSyndieBattery
@ -1178,6 +1187,8 @@
780: Critical
showOverlays: false
allowRevives: true
- type: AccessReader
access: [["NuclearOperative"]]
- type: entity
id: MechRoverSyndieBattery
@ -1259,6 +1270,8 @@
800: Critical
showOverlays: false
allowRevives: true
- type: AccessReader
access: [["NuclearOperative"]]
- type: entity
id: MechMaulerSyndieBattery

View file

@ -1,45 +1,71 @@
- type: entity
id: MechSecPod
parent: [ BaseMech, CombatMech, BaseRestrictedContraband ]
name: Security Pod
description: While lightly armored, the Gygax has incredible mobility thanks to its ability that lets it smash through walls at high speeds.
id: BaseMechPod
save: false
abstract: true
components:
- type: Sprite
drawdepth: Mobs
noRot: true
sprite: _Sunrise/Objects/Specific/Mech/sec_pod.rsi
scale: 1.08, 1.08
layers:
- map: [ "enum.MechVisualLayers.Base" ]
state: sec_pod
- type: FootstepModifier
footstepSoundCollection:
path: /Audio/Mecha/sound_mecha_powerloader_step.ogg
- type: MobMover
- type: Mech
baseState: sec_pod
openState: sec_pod
brokenState: sec_pod
mechToPilotDamageMultiplier: 0.3
airtight: true
pilotWhitelist:
components:
- HumanoidAppearance
- type: MeleeWeapon
hidden: true
attackRate: 1
- type: MechAir
- type: AirFilter
# everything except oxygen and nitrogen
gases:
- CarbonDioxide
- Plasma
- Tritium
- WaterVapor
- Ammonia
- NitrousOxide
- Frezon
#- Helium3 TODO: fusion
# remove everything except oxygen to maintain oxygen ratio
overflowGases:
- Nitrogen
- CarbonDioxide
- Plasma
- Tritium
- WaterVapor
- Ammonia
- NitrousOxide
- Frezon
#- Helium3 TODO: fusion
- type: AirIntake
# for intake and filter to work
- type: AtmosDevice
requireAnchored: false
joinSystem: true
- type: DoAfter
- type: Repairable
doAfterDelay: 2
damage:
types:
Blunt: 0
Structural: 0
Blunt: -15
Slash: -15
Piercing: -15
- type: UserInterface
interfaces:
enum.MechUiKey.Key:
type: MechBoundUserInterface
- type: Puller
needsHands: false
- type: InputMover
- type: InteractionOutline
- type: MovementSpeedModifier
baseWalkSpeed: 2.5
baseWalkSpeed: 2
baseSprintSpeed: 3
- type: Reflect
reflectProb: 0.25
spread: 180
soundOnReflect: /Audio/Weapons/block_metal1.ogg
reflects:
- NonEnergy
friction: 5
weightlessFriction: 5
weightlessAcceleration: 4
weightlessModifier: 2.8
- type: MovementAlwaysTouching
- type: Pullable
- type: Clickable
- type: WiresPanel
- type: Physics
bodyType: Dynamic
- type: MobState
allowedStates:
- Alive
- Critical
- type: MobThresholds
currentThresholdState : Alive
thresholds:
@ -47,4 +73,109 @@
300: Critical
showOverlays: false
allowRevives: true
- type: Tag
- type: HealthExaminable
examinableTypes:
- Blunt
- Slash
- Piercing
- Heat
- Shock
locPrefix: mech
- type: Appearance
- type: ContainerContainer
containers:
mech-pilot-slot: !type:ContainerSlot
mech-equipment-container: !type:Container
mech-battery-slot: !type:ContainerSlot
- type: Damageable
damageContainer: Mech
damageModifierSet: LightArmor
- type: GuideHelp
guides:
- Robotics
- type: Destructible
thresholds:
- trigger:
!type:DamageTrigger
damage: 900
behaviors:
- !type:PlaySoundBehavior
sound:
collection: MetalBreak
- !type:ChangeConstructionNodeBehavior
node: start
- !type:DoActsBehavior
acts: ["Destruction"]
- type: StatusIcon
bounds: "-0.6,-0.6, 0.6, 0.6"
- type: PointLight
enabled: false
mask: /Textures/Effects/LightMasks/cone.png
autoRot: true
radius: 9
netsync: false
- type: entity
id: MechSecPod
parent: [ BaseMechPod, BaseRestrictedContraband ]
name: Security Pod
description: Despite its size, the Security Pod has incredible mobility in space thanks to its engines.
suffix: Filled
components:
- type: Sprite
drawdepth: Mobs
sprite: _Sunrise/Objects/Specific/Mech/sec_pod.rsi
scale: 1.08, 1.08
layers:
- state: sec_pod
map: ["enum.MechVisualLayers.Base"]
- type: Fixtures
fixtures:
fix1:
shape:
!type:PhysShapeCircle
radius: 0.9
density: 1000
mask:
- FlyingMobMask
layer:
- FlyingMobLayer
- type: AmbientSound
range: 4
volume: -4
sound:
path: /Audio/Effects/shuttle_thruster.ogg
- type: Mech
baseState: sec_pod
openState: sec_pod_open
brokenState: sec_pod_broken
mechToPilotDamageMultiplier: 0.3
maxEquipmentAmount: 2
airtight: true
pilotWhitelist:
components:
- HumanoidAppearance
equipmentWhitelist:
tags:
- CombatMech
startingEquipment:
- WeaponMechCombatSolarisLaser
- type: Reflect
reflectProb: 0.2
spread: 180
soundOnReflect: /Audio/Weapons/block_metal1.ogg
reflects:
- NonEnergy
- type: MobThresholds
currentThresholdState: Alive
thresholds:
0: Alive
450: Critical
showOverlays: false
allowRevives: true
- type: ContainerFill
containers:
mech-battery-slot:
- PowerCageMedium
- type: AccessReader
access: [["Security"]]

View file

@ -3,13 +3,18 @@
"license" : "CC-BY-SA-3.0",
"version": 1,
"size": {
"x": 32,
"y": 32
"x": 64,
"y": 64
},
"states": [
{
"name": "sec_pod",
"directions": 4
"name": "sec_pod"
},
{
"name": "sec_pod_broken"
},
{
"name": "sec_pod_open"
}
]
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB