Skip to content

Commit

Permalink
Merge pull request #240 from modern-nm/ipc-3
Browse files Browse the repository at this point in the history
Набор исправлений для КПБ.
  • Loading branch information
PyotrIgn authored Dec 23, 2023
2 parents 92674fa + 1b97fd8 commit 5eeffff
Show file tree
Hide file tree
Showing 9 changed files with 95 additions and 37 deletions.
32 changes: 32 additions & 0 deletions Content.Server/SimpleStation14/Radio/IntrinsicRadioKeySystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using Content.Server.Radio.Components;
using Content.Shared.Radio;
using Content.Shared.Radio.Components;

namespace Content.Server.SimpleStation14.Radio;

public sealed class IntrinsicRadioKeySystem : EntitySystem
{
public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<IntrinsicRadioTransmitterComponent, EncryptionChannelsChangedEvent>(OnTransmitterChannelsChanged);
SubscribeLocalEvent<ActiveRadioComponent, EncryptionChannelsChangedEvent>(OnReceiverChannelsChanged);
}

private void OnTransmitterChannelsChanged(EntityUid uid, IntrinsicRadioTransmitterComponent component, EncryptionChannelsChangedEvent args)
{
UpdateChannels(uid, args.Component, ref component.Channels);
}

private void OnReceiverChannelsChanged(EntityUid uid, ActiveRadioComponent component, EncryptionChannelsChangedEvent args)
{
UpdateChannels(uid, args.Component, ref component.Channels);
}

private void UpdateChannels(EntityUid _, EncryptionKeyHolderComponent keyHolderComp, ref HashSet<string> channels)
{
channels.Clear();
channels.UnionWith(keyHolderComp.Channels);
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
silicon-charger-overheatwarning = You feel like you're in a microwave!
silicon-charger-chargerate-string = Charge rate
silicon-charger-efficiency-string = Efficiency
silicon-charger-overheatwarning = Вы чувствуете, будто вы в микроволновке!
silicon-charger-chargerate-string = Скорость зарядки
silicon-charger-efficiency-string = Эффективность
silicon-charger-list-full = {CAPITALIZE(THE($charger))} can only accommodate so many targets!
silicon-charger-list-full = {CAPITALIZE($charger)} может вместить только такое количество целей!
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
ent-MobIpc = Урист МакПозитроник
.desc = Позитронный мозг в металлическом теле.
ent-MobIPC = Урист МакПозитроник
ent-MobIPCDummy = Урист МакПозитроник
.desc = Манекен позитронного мозга в металлическом теле.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ent-SiliconChargerIndustrial = промышленное зарядное устройство
.desc = Мощная машина для индуктивной зарядки роботизированных существ. Она очень сильно нагревается!
ent-IndustrialChargerCircuitboard = плата промышленного зарядного устройства
.desc = Машинная печатная плата для промышленного зарядного устройства
13 changes: 13 additions & 0 deletions Resources/Prototypes/Entities/Objects/Tools/cable_coils.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,19 @@
price: 0
- type: StackPrice
price: 1
- type: Healing # ADT ipc. cables can be used to heal IPC
damageContainers:
- ADTSiliconDamageContainer
damage:
types:
Heat: -5
Cold: -5
Shock: -5
Caustic: -5
# healingBeginSound:
# path: "/Audio/Items/Medical/ointment_begin.ogg"
# healingEndSound:
# path: "/Audio/Items/Medical/ointment_end.ogg"

- type: entity
id: CableHVStack
Expand Down
2 changes: 1 addition & 1 deletion Resources/Prototypes/SimpleStation14/Damage/containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# - Bloodloss

- type: damageContainer
id: ADTSilicon
id: ADTSiliconDamageContainer
supportedGroups:
- Brute
- Burn
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
id: MobIPC
parent: PlayerSiliconHumanoidBase
name: Urist McPositronic
description: A positronic brain in a metal body.
#description: [mob_ipc-desc]
components:
- type: SiliconEmitSoundOnDrained
sound: "/Audio/Weapons/Guns/EmptyAlarm/smg_empty_alarm.ogg"
interval: 15
playChance: 1
popUp: "silicon-power-low"
popUp: silicon-power-low
- type: MobState
allowedStates:
- Alive
Expand All @@ -27,12 +27,12 @@
proto: robot
- type: Destructible
thresholds:
- trigger:
!type:DamageTypeTrigger
damageType: Blunt
damage: 400
behaviors:
- !type:GibBehavior { }
- trigger:
!type:DamageTypeTrigger
damageType: Blunt
damage: 400
behaviors:
- !type:GibBehavior { }
- type: SlowOnDamage
speedModifierThresholds:
60: 0.7
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
- type: entity
save: false
abstract: true
id: PlayerSiliconBase1 # For player controlled silicons
id: ADTPlayerSiliconBase # For player controlled silicons
components:
- type: Reactive
groups:
Expand Down Expand Up @@ -37,7 +37,7 @@
shape:
!type:PhysShapeCircle
radius: 0.35
density: 50
density: 185 ### влияет на шанс Disarm. было 50
mask:
- MobMask
layer:
Expand Down Expand Up @@ -98,7 +98,7 @@
thermalRegulationTemperatureThreshold: 125

- type: entity
parent: PlayerSiliconBase1
parent: ADTPlayerSiliconBase
id: PlayerSiliconHumanoidBase
abstract: true
components:
Expand All @@ -111,7 +111,7 @@
0: Alive
165: Dead
- type: Damageable
damageContainer: ADTSilicon # Not a wall.
damageContainer: ADTSiliconDamageContainer # Not a wall.
- type: Stamina
critThreshold: 200
- type: Destructible
Expand Down Expand Up @@ -182,24 +182,32 @@
state: "creampie_human"
visible: false
- type: Repairable
fuelcost: 60
doAfterDelay: 18
# - type: Bloodstream ### Кровь отключена
# damageBleedModifiers: BloodlossIPC
# bloodReagent: Water
# bleedReductionAmount: 0
# bloodMaxVolume: 500
# chemicalMaxVolume: 0
# bleedPuddleThreshold: 3
# bleedRefreshAmount: 0
# bloodLossThreshold: 0
# maxBleedAmount: 14
# bloodlossDamage:
# types:
# Burn: 1.5
# bloodlossHealDamage:
# types:
# Burn: 0
#fuelcost: 60
doAfterDelay: 10 # was 18
damage:
types:
Blunt: -20
Slash: -20
Piercing: -20
#bloodlossModifier: -100
- type: Bloodstream ### я добавил компонент Bloodstream как заглушку. Он нужен,
# чтобы хилиться с помощью CableStack. Дело в том, что HealingSystem использует проверку на наличие BloodstreamComponent.
# В любом случае Bloodstream здесь является костылём, чтобы не лезть в код. В будущем можно зделать для IPC нормальную bloodstream систему.
damageBleedModifiers: BloodlossIPC
bloodReagent: Water
bleedReductionAmount: 0
bloodMaxVolume: 0
chemicalMaxVolume: 0
bleedPuddleThreshold: 3
bleedRefreshAmount: 0
bloodLossThreshold: 0
maxBleedAmount: 0
bloodlossDamage:
types:
Burn: 1.5
bloodlossHealDamage:
types:
Burn: 0
- type: Flammable
fireSpread: true
canResistFire: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
!type:DamageTrigger
damage: 350
behaviors:
- !type:EmptyAllContainersBehaviour
- !type:ChangeConstructionNodeBehavior
node: machineFrame
- !type:DoActsBehavior
Expand Down

0 comments on commit 5eeffff

Please sign in to comment.