Portable Recharger: Arsenal T3 (#26655)
* sys * item * ahm. * Update Content.Server/Power/Components/ChargerComponent.cs --------- Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
using Content.Shared.Power;
|
||||
using Content.Shared.Whitelist;
|
||||
using Content.Shared.Power;
|
||||
using Content.Shared.Whitelist;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
using Robust.Shared.ViewVariables;
|
||||
|
||||
namespace Content.Server.Power.Components
|
||||
{
|
||||
@@ -26,5 +31,12 @@ namespace Content.Server.Power.Components
|
||||
/// </summary>
|
||||
[DataField("whitelist")]
|
||||
public EntityWhitelist? Whitelist;
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether the charger is portable and thus subject to EMP effects
|
||||
/// and bypasses checks for transform, anchored, and ApcPowerReceiverComponent.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public bool Portable = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
using Content.Server.Power.Components;
|
||||
using Content.Server.Emp;
|
||||
using Content.Server.PowerCell;
|
||||
using Content.Shared.Examine;
|
||||
using Content.Shared.Power;
|
||||
using Content.Shared.PowerCell.Components;
|
||||
using Content.Shared.Emp;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.Containers;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
@@ -28,6 +30,8 @@ internal sealed class ChargerSystem : EntitySystem
|
||||
SubscribeLocalEvent<ChargerComponent, ContainerIsInsertingAttemptEvent>(OnInsertAttempt);
|
||||
SubscribeLocalEvent<ChargerComponent, InsertIntoEntityStorageAttemptEvent>(OnEntityStorageInsertAttempt);
|
||||
SubscribeLocalEvent<ChargerComponent, ExaminedEvent>(OnChargerExamine);
|
||||
|
||||
SubscribeLocalEvent<ChargerComponent, EmpPulseEvent>(OnEmpPulse);
|
||||
}
|
||||
|
||||
private void OnStartup(EntityUid uid, ChargerComponent component, ComponentStartup args)
|
||||
@@ -158,18 +162,27 @@ internal sealed class ChargerSystem : EntitySystem
|
||||
}
|
||||
}
|
||||
|
||||
private void OnEmpPulse(EntityUid uid, ChargerComponent component, ref EmpPulseEvent args)
|
||||
{
|
||||
args.Affected = true;
|
||||
args.Disabled = true;
|
||||
}
|
||||
|
||||
private CellChargerStatus GetStatus(EntityUid uid, ChargerComponent component)
|
||||
{
|
||||
if (!TryComp(uid, out TransformComponent? transformComponent))
|
||||
return CellChargerStatus.Off;
|
||||
|
||||
if (!transformComponent.Anchored)
|
||||
if (!component.Portable)
|
||||
{
|
||||
if (!TryComp(uid, out TransformComponent? transformComponent) || !transformComponent.Anchored)
|
||||
return CellChargerStatus.Off;
|
||||
}
|
||||
|
||||
if (!TryComp(uid, out ApcPowerReceiverComponent? apcPowerReceiverComponent))
|
||||
return CellChargerStatus.Off;
|
||||
|
||||
if (!apcPowerReceiverComponent.Powered)
|
||||
if (!component.Portable && !apcPowerReceiverComponent.Powered)
|
||||
return CellChargerStatus.Off;
|
||||
|
||||
if (HasComp<EmpDisabledComponent>(uid))
|
||||
return CellChargerStatus.Off;
|
||||
|
||||
if (!_container.TryGetContainer(uid, component.SlotId, out var container))
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
- type: entity
|
||||
parent: Clothing
|
||||
id: PortableRecharger
|
||||
name: portable recharger
|
||||
description: High-tech recharger adapted for portability
|
||||
components:
|
||||
- type: Item
|
||||
size: Huge
|
||||
- type: Sprite
|
||||
sprite: Objects/Power/portable_recharger.rsi
|
||||
state: charging
|
||||
- type: Clothing
|
||||
equippedPrefix: charging
|
||||
quickEquip: false
|
||||
slots:
|
||||
- back
|
||||
- type: Charger
|
||||
slotId: charger_slot
|
||||
portable: true
|
||||
- type: PowerChargerVisuals
|
||||
- type: ApcPowerReceiver
|
||||
needsPower: false
|
||||
powerLoad: 0
|
||||
- type: StaticPrice
|
||||
price: 500
|
||||
- type: Tag
|
||||
tags: [] # ignore "WhitelistChameleon" tag
|
||||
- type: ItemSlots
|
||||
slots:
|
||||
charger_slot:
|
||||
ejectOnInteract: true
|
||||
whitelist:
|
||||
components:
|
||||
- HitscanBatteryAmmoProvider
|
||||
- ProjectileBatteryAmmoProvider
|
||||
@@ -737,6 +737,14 @@
|
||||
- WeaponLaserCannon
|
||||
- WeaponLaserCarbine
|
||||
- WeaponXrayCannon
|
||||
- PowerCageSmall
|
||||
- PowerCageMedium
|
||||
- PowerCageHigh
|
||||
- ShuttleGunSvalinnMachineGunCircuitboard
|
||||
- ShuttleGunPerforatorCircuitboard
|
||||
- ShuttleGunFriendshipCircuitboard
|
||||
- ShuttleGunDusterCircuitboard
|
||||
- PortableRecharger
|
||||
- type: MaterialStorage
|
||||
whitelist:
|
||||
tags:
|
||||
|
||||
@@ -690,3 +690,14 @@
|
||||
Steel: 150
|
||||
Plastic: 100
|
||||
Glass: 20
|
||||
|
||||
- type: latheRecipe
|
||||
id: PortableRecharger
|
||||
result: PortableRecharger
|
||||
completetime: 15
|
||||
materials:
|
||||
Steel: 2000
|
||||
Uranium: 2000
|
||||
Plastic: 1000
|
||||
Plasma: 500
|
||||
Glass: 500
|
||||
@@ -175,6 +175,7 @@
|
||||
cost: 15000
|
||||
recipeUnlocks:
|
||||
- WeaponAdvancedLaser
|
||||
- PortableRecharger
|
||||
|
||||
- type: technology
|
||||
id: ExperimentalBatteryAmmo
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 539 B |
Binary file not shown.
|
After Width: | Height: | Size: 964 B |
Binary file not shown.
|
After Width: | Height: | Size: 714 B |
Binary file not shown.
|
After Width: | Height: | Size: 735 B |
@@ -0,0 +1,92 @@
|
||||
{
|
||||
"version": 1,
|
||||
"license": "CC-BY-SA-3.0",
|
||||
"copyright": "Sprited by Lomovar",
|
||||
"size": {
|
||||
"x": 32,
|
||||
"y": 32
|
||||
},
|
||||
"states": [
|
||||
{
|
||||
"name": "charging",
|
||||
"delays": [
|
||||
[
|
||||
0.3,
|
||||
0.3,
|
||||
0.3,
|
||||
0.3,
|
||||
0.3,
|
||||
0.3
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "charging-equipped-BACKPACK",
|
||||
"directions": 4,
|
||||
"delays": [
|
||||
[
|
||||
0.3,
|
||||
0.3,
|
||||
0.3,
|
||||
0.3,
|
||||
0.3,
|
||||
0.3,
|
||||
0.3,
|
||||
0.3
|
||||
],
|
||||
[
|
||||
0.3,
|
||||
0.3,
|
||||
0.3,
|
||||
0.3,
|
||||
0.3,
|
||||
0.3,
|
||||
0.3,
|
||||
0.3
|
||||
],
|
||||
[
|
||||
0.3,
|
||||
0.3,
|
||||
0.3,
|
||||
0.3,
|
||||
0.3,
|
||||
0.3,
|
||||
0.3,
|
||||
0.3
|
||||
],
|
||||
[
|
||||
0.3,
|
||||
0.3,
|
||||
0.3,
|
||||
0.3,
|
||||
0.3,
|
||||
0.3,
|
||||
0.3,
|
||||
0.3
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "charging-unlit",
|
||||
"delays": [
|
||||
[
|
||||
0.3,
|
||||
0.3,
|
||||
0.3,
|
||||
0.3,
|
||||
0.3,
|
||||
0.3
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "inhand-left",
|
||||
"directions": 4
|
||||
},
|
||||
{
|
||||
"name": "inhand-right",
|
||||
"directions": 4
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user