From 364adc2454f686bbb23c80790465d8387ab17255 Mon Sep 17 00:00:00 2001 From: Dvir Date: Sun, 16 Jul 2023 02:08:15 +0300 Subject: [PATCH 01/16] WIP --- .../Guns/Ammunition/Boxes/light_rifle.yml | 2 +- .../Weapons/Guns/Ammunition/Boxes/pistol.yml | 15 +++++ .../Weapons/Guns/Ammunition/Boxes/rifle.yml | 2 +- .../Ammunition/Cartridges/caseless_rifle.yml | 2 +- .../Guns/Ammunition/Cartridges/pistol.yml | 8 +++ .../Guns/Ammunition/Magazines/light_rifle.yml | 21 +----- .../Guns/Ammunition/Magazines/pistol.yml | 14 ++++ .../Ammunition/Projectiles/light_rifle.yml | 2 +- .../Guns/Ammunition/Projectiles/pistol.yml | 8 +++ .../Weapons/Guns/Ammunition/explosives.yml | 17 +++++ .../Weapons/Guns/Battery/battery_guns.yml | 61 ++++++++++++++++++ .../Weapons/Guns/Projectiles/hitscan.yml | 22 +++++++ .../Weapons/Guns/Projectiles/projectiles.yml | 31 +++++++++ .../Explosives/explosives.rsi/emp.png | Bin 0 -> 317 bytes .../Explosives/explosives.rsi/meta.json | 3 + 15 files changed, 184 insertions(+), 24 deletions(-) create mode 100644 Resources/Textures/Objects/Weapons/Guns/Ammunition/Explosives/explosives.rsi/emp.png diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Boxes/light_rifle.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Boxes/light_rifle.yml index 7018ff37647..942faa544d6 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Boxes/light_rifle.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Boxes/light_rifle.yml @@ -117,4 +117,4 @@ map: ["enum.GunVisualLayers.Base"] - state: mag-1 map: ["enum.GunVisualLayers.Mag"] - - state: incendiary + - state: incendiary \ No newline at end of file diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Boxes/pistol.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Boxes/pistol.yml index d8bab16cdbc..e22b049f9ce 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Boxes/pistol.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Boxes/pistol.yml @@ -98,3 +98,18 @@ - state: mag-1 map: ["enum.GunVisualLayers.Mag"] - state: incendiary + +- type: entity + parent: BaseMagazineBoxPistol + id: MagazineBoxPistolEMP + name: ammunition box (.35 auto emp) + components: + - type: BallisticAmmoProvider + proto: CartridgePistolEMP + - type: Sprite + layers: + - state: base + map: ["enum.GunVisualLayers.Base"] + - state: mag-1 + map: ["enum.GunVisualLayers.Mag"] + - state: rubber \ No newline at end of file diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Boxes/rifle.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Boxes/rifle.yml index 260237c3c0e..b2093a3a5d6 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Boxes/rifle.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Boxes/rifle.yml @@ -137,4 +137,4 @@ map: ["enum.GunVisualLayers.Base"] - state: mag-1 map: ["enum.GunVisualLayers.Mag"] - - state: incendiary + - state: incendiary \ No newline at end of file diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Cartridges/caseless_rifle.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Cartridges/caseless_rifle.yml index ecf0c4017e5..9f2d06f7493 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Cartridges/caseless_rifle.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Cartridges/caseless_rifle.yml @@ -51,4 +51,4 @@ parent: BaseCartridgeCaselessRifle components: - type: CartridgeAmmo - proto: BulletCaselessRifleRubber + proto: BulletCaselessRifleRubber \ No newline at end of file diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Cartridges/pistol.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Cartridges/pistol.yml index 39d9b945031..8c565054df4 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Cartridges/pistol.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Cartridges/pistol.yml @@ -59,3 +59,11 @@ components: - type: CartridgeAmmo proto: BulletPistolIncendiary + +- type: entity + id: CartridgePistolEMP + name: cartridge (.35 auto emp) + parent: BaseCartridgePistol + components: + - type: CartridgeAmmo + proto: BulletPistolEMP \ No newline at end of file diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Magazines/light_rifle.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Magazines/light_rifle.yml index f09d3e3bb62..98cb2d579fb 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Magazines/light_rifle.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Magazines/light_rifle.yml @@ -122,23 +122,4 @@ proto: CartridgeLightRifle capacity: 96 - type: Sprite - sprite: Objects/Weapons/Guns/Ammunition/Magazine/LightRifle/maxim.rsi - -- type: entity - id: MagazineLightRiflePkBox - name: "PK munitions box (.30 rifle)" - parent: BaseMagazineLightRifle - components: - - type: Tag - tags: - - MagazineLightRifleBox - - type: BallisticAmmoProvider - proto: CartridgeLightRifle - capacity: 80 - - type: Sprite - sprite: Objects/Weapons/Guns/Ammunition/Magazine/LightRifle/pk_box.rsi - - type: MagazineVisuals - magState: mag - steps: 7 - zeroVisible: false - - type: Appearance + sprite: Objects/Weapons/Guns/Ammunition/Magazine/LightRifle/maxim.rsi \ No newline at end of file diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Magazines/pistol.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Magazines/pistol.yml index 42bb1487424..3c05fbb9af5 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Magazines/pistol.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Magazines/pistol.yml @@ -301,3 +301,17 @@ map: ["enum.GunVisualLayers.Base"] - state: mag-1 map: ["enum.GunVisualLayers.Mag"] + +- type: entity + id: MagazinePistolSubMachineGunEMP + name: SMG magazine (.35 auto emp) + parent: BaseMagazinePistolSubMachineGun + components: + - type: BallisticAmmoProvider + proto: CartridgePistolEMP + - type: Sprite + layers: + - state: rubber + map: ["enum.GunVisualLayers.Base"] + - state: mag-1 + map: ["enum.GunVisualLayers.Mag"] \ No newline at end of file diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/light_rifle.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/light_rifle.yml index 8bf5ce5e625..be2484b3851 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/light_rifle.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/light_rifle.yml @@ -51,4 +51,4 @@ - type: Projectile damage: groups: - Burn: 17 + Burn: 17 \ No newline at end of file diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/pistol.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/pistol.yml index 8474160ef77..0bc22fda8d5 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/pistol.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/pistol.yml @@ -52,3 +52,11 @@ damage: groups: Burn: 14 + +- type: entity + id: BulletPistolEMP + name: bullet (.35 auto emp) + parent: BaseBulletEMP + noSpawn: true + components: + - type: Projectile \ No newline at end of file diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/explosives.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/explosives.yml index 56d420cb33c..91e08dc953a 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/explosives.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/explosives.yml @@ -135,3 +135,20 @@ - type: Sprite sprite: Objects/Weapons/Guns/Ammunition/Explosives/explosives.rsi state: ball + +- type: entity + id: GrenadeEMP + name: emp grenade + parent: BaseGrenade + components: + - type: CartridgeAmmo + proto: BulletGrenadeEMP + - type: Sprite + sprite: Objects/Weapons/Guns/Ammunition/Explosives/explosives.rsi + layers: + - state: emp + map: ["enum.AmmoVisualLayers.Base"] + - type: Appearance + - type: SpentAmmoVisuals + state: emp + suffix: false \ No newline at end of file diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Battery/battery_guns.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Battery/battery_guns.yml index 640b606020d..8b10db7b9e9 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Battery/battery_guns.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Battery/battery_guns.yml @@ -31,6 +31,39 @@ - type: StaticPrice price: 500 +- type: entity + id: BaseWeaponEMP + parent: BaseItem + abstract: true + components: + - type: Sprite + - type: Item + size: 50 + - type: Clothing + sprite: Objects/Weapons/Guns/Battery/laser_retro.rsi + quickEquip: false + slots: + - Back + - suitStorage + - type: AmmoCounter + - type: Gun + fireRate: 2 + selectedMode: SemiAuto + availableModes: + - SemiAuto + soundGunshot: + path: /Audio/Weapons/Guns/Gunshots/laser.ogg + - type: Battery + maxCharge: 1000 + startingCharge: 1000 + - type: MagazineVisuals + magState: mag + steps: 5 + zeroVisible: false + - type: Appearance + - type: StaticPrice + price: 500 + - type: entity id: BaseWeaponBatterySmall parent: BaseWeaponBattery @@ -460,3 +493,31 @@ - type: Appearance - type: StaticPrice price: 750 + +- type: entity + name: emp laser + parent: BaseWeaponEMP + id: WeaponEMPLaser + description: EMP-4. + components: + - type: Sprite + sprite: Objects/Weapons/Guns/Battery/xray.rsi + layers: + - state: base + map: ["enum.GunVisualLayers.Base"] + - state: mag-unshaded-0 + map: ["enum.GunVisualLayers.MagUnshaded"] + shader: unshaded + - type: Clothing + sprite: Objects/Weapons/Guns/Battery/xray.rsi + - type: Gun + soundGunshot: + path: /Audio/Weapons/Guns/Gunshots/laser3.ogg + - type: HitscanBatteryAmmoProvider + proto: EMPLaser + fireCost: 100 + - type: MagazineVisuals + magState: mag + steps: 5 + zeroVisible: true + - type: Appearance \ No newline at end of file diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/hitscan.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/hitscan.yml index ce58d69e4b8..15e4ddab275 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/hitscan.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/hitscan.yml @@ -104,3 +104,25 @@ impactFlash: sprite: Objects/Weapons/Guns/Projectiles/projectiles.rsi state: impact_blue + +- type: hitscan + id: EMPLaser + damage: + types: + Heat: 1 + components: + - type: ExplodeOnTrigger + - type: Explosive + - type: TriggerOnCollide + - type: EmpOnTrigger + range: 4 + energyConsumption: 50000 + muzzleFlash: + sprite: Objects/Weapons/Guns/Projectiles/projectiles.rsi + state: muzzle_xray + travelFlash: + sprite: Objects/Weapons/Guns/Projectiles/projectiles.rsi + state: xray + impactFlash: + sprite: Objects/Weapons/Guns/Projectiles/projectiles.rsi + state: impact_xray \ No newline at end of file diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml index 4bae5cf5245..2856d569b92 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml @@ -721,3 +721,34 @@ - Impassable - HighImpassable - type: GrapplingProjectile + +- type: entity + id: BaseBulletEMP + name: base bullet emp + parent: BaseBulletTrigger + noSpawn: true + components: + - type: Projectile + damage: + types: + Shock: 0 + layers: + - state: grenade + - type: EmpOnTrigger + range: 0.3 + energyConsumption: 50000 + disableDuration: 20 + +- type: entity + id: BulletGrenadeEMP + name: emp grenade + parent: BaseBulletTrigger + noSpawn: true + components: + - type: Sprite + sprite: Objects/Weapons/Guns/Projectiles/projectiles2.rsi + layers: + - state: grenade + - type: EmpOnTrigger + range: 4 + energyConsumption: 50000 \ No newline at end of file diff --git a/Resources/Textures/Objects/Weapons/Guns/Ammunition/Explosives/explosives.rsi/emp.png b/Resources/Textures/Objects/Weapons/Guns/Ammunition/Explosives/explosives.rsi/emp.png new file mode 100644 index 0000000000000000000000000000000000000000..6f13f2267722035a9baa3334c054e560a9f1be9c GIT binary patch literal 317 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE3?yBabR7dyjKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCilo1AIbUWi*pi^{uj2UNLf8;TIawKB?2p%=dpQ_y0#-|9_tPzr*3c-i<)D zKK%uYffR2^kYDhBB*0+%La7ZX!CBxDSXwBt@h+f z1@HV169Z}(RkPB?1f-RO0;sR7;yic#^BisHu?S{6?Yvu!8#Ng@b=d#Wzp$PyxVtOwC literal 0 HcmV?d00001 diff --git a/Resources/Textures/Objects/Weapons/Guns/Ammunition/Explosives/explosives.rsi/meta.json b/Resources/Textures/Objects/Weapons/Guns/Ammunition/Explosives/explosives.rsi/meta.json index 5a58b6b6089..ae519a3a4e7 100644 --- a/Resources/Textures/Objects/Weapons/Guns/Ammunition/Explosives/explosives.rsi/meta.json +++ b/Resources/Textures/Objects/Weapons/Guns/Ammunition/Explosives/explosives.rsi/meta.json @@ -18,6 +18,9 @@ }, { "name": "frag" + }, + { + "name": "emp" }, { "name": "rpg" From 2e6e66468c9542000195da2ccbe0cb867d251ec0 Mon Sep 17 00:00:00 2001 From: Dvir Date: Mon, 17 Jul 2023 00:41:43 +0300 Subject: [PATCH 02/16] EMP --- .../Catalog/Fills/Boxes/ammunition.yml | 12 ++- .../Circuitboards/Machine/production.yml | 15 ++++ .../Weapons/Guns/Ammunition/Boxes/pistol.yml | 2 +- .../Weapons/Guns/Ammunition/explosives.yml | 22 +++++- .../Weapons/Guns/Projectiles/projectiles.yml | 13 +++- .../Entities/Structures/Machines/emp.yml | 66 +++++++++++++++++ .../Guns/Ammunition/Boxes/pistol.rsi/emp.png | Bin 0 -> 302 bytes .../Ammunition/Boxes/pistol.rsi/meta.json | 3 + .../emp_generator.rsi/emp-generator-o0.png | Bin 0 -> 5298 bytes .../emp_generator.rsi/emp-generator-o1.png | Bin 0 -> 5639 bytes .../emp_generator.rsi/emp-generator-o2.png | Bin 0 -> 5919 bytes .../emp_generator.rsi/emp-generator-o3.png | Bin 0 -> 5933 bytes .../emp_generator.rsi/emp-generator-o4.png | Bin 0 -> 6080 bytes .../emp-generator-ready-blinking.png | Bin 0 -> 697 bytes .../emp_generator.rsi/emp-generator-ready.png | Bin 0 -> 5312 bytes .../emp-generator-unready-blinking.png | Bin 0 -> 702 bytes .../emp-generator-unready.png | Bin 0 -> 5401 bytes .../emp_generator.rsi/emp-generator.png | Bin 0 -> 950 bytes .../Machines/emp_generator.rsi/meta.json | 69 ++++++++++++++++++ 19 files changed, 195 insertions(+), 7 deletions(-) create mode 100644 Resources/Prototypes/Entities/Structures/Machines/emp.yml create mode 100644 Resources/Textures/Objects/Weapons/Guns/Ammunition/Boxes/pistol.rsi/emp.png create mode 100644 Resources/Textures/Structures/Machines/emp_generator.rsi/emp-generator-o0.png create mode 100644 Resources/Textures/Structures/Machines/emp_generator.rsi/emp-generator-o1.png create mode 100644 Resources/Textures/Structures/Machines/emp_generator.rsi/emp-generator-o2.png create mode 100644 Resources/Textures/Structures/Machines/emp_generator.rsi/emp-generator-o3.png create mode 100644 Resources/Textures/Structures/Machines/emp_generator.rsi/emp-generator-o4.png create mode 100644 Resources/Textures/Structures/Machines/emp_generator.rsi/emp-generator-ready-blinking.png create mode 100644 Resources/Textures/Structures/Machines/emp_generator.rsi/emp-generator-ready.png create mode 100644 Resources/Textures/Structures/Machines/emp_generator.rsi/emp-generator-unready-blinking.png create mode 100644 Resources/Textures/Structures/Machines/emp_generator.rsi/emp-generator-unready.png create mode 100644 Resources/Textures/Structures/Machines/emp_generator.rsi/emp-generator.png create mode 100644 Resources/Textures/Structures/Machines/emp_generator.rsi/meta.json diff --git a/Resources/Prototypes/Catalog/Fills/Boxes/ammunition.yml b/Resources/Prototypes/Catalog/Fills/Boxes/ammunition.yml index 65323e1a3b7..ee346e4cd0c 100644 --- a/Resources/Prototypes/Catalog/Fills/Boxes/ammunition.yml +++ b/Resources/Prototypes/Catalog/Fills/Boxes/ammunition.yml @@ -304,6 +304,17 @@ - id: MagazinePistolSubMachineGunRubber amount: 3 +- type: entity + name: box of SMG .35 auto (emp) magazines + parent: BoxMagazine + id: BoxMagazinePistolSubMachineGunEMP + description: A box full of SMG .35 auto (emp) magazines. + components: + - type: StorageFill + contents: + - id: MagazinePistolSubMachineGunEMP + amount: 3 + # Shotgun - type: entity name: box of (.50 pellet) ammo drums @@ -460,7 +471,6 @@ - state: boxwide - state: shellslug - # Rifle - type: entity name: box of .20 rifle magazines diff --git a/Resources/Prototypes/Entities/Objects/Devices/Circuitboards/Machine/production.yml b/Resources/Prototypes/Entities/Objects/Devices/Circuitboards/Machine/production.yml index 71427232eb4..505402f58a2 100644 --- a/Resources/Prototypes/Entities/Objects/Devices/Circuitboards/Machine/production.yml +++ b/Resources/Prototypes/Entities/Objects/Devices/Circuitboards/Machine/production.yml @@ -928,3 +928,18 @@ Steel: 5 CableHV: 5 Cable: 2 + +- type: entity + parent: BaseMachineCircuitboard + id: EMPGeneratorMachineCircuitboard + name: emp generator machine board + description: A machine printed circuit board for a emp generator. + components: + - type: MachineBoard + prototype: EMPGenerator + requirements: + Capacitor: 4 + materialRequirements: + Steel: 5 + CableHV: 5 + Cable: 2 \ No newline at end of file diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Boxes/pistol.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Boxes/pistol.yml index e22b049f9ce..35836b7c372 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Boxes/pistol.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Boxes/pistol.yml @@ -112,4 +112,4 @@ map: ["enum.GunVisualLayers.Base"] - state: mag-1 map: ["enum.GunVisualLayers.Mag"] - - state: rubber \ No newline at end of file + - state: emp \ No newline at end of file diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/explosives.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/explosives.yml index 91e08dc953a..d27bf49a411 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/explosives.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/explosives.yml @@ -151,4 +151,24 @@ - type: Appearance - type: SpentAmmoVisuals state: emp - suffix: false \ No newline at end of file + suffix: false + +- type: entity + id: CartridgeRocketEMP + name: PG-7VL emp + parent: BaseItem + description: A 1.5 emp warhead designed for the RPG-7 launcher. Has tubular shape. + components: + - type: Tag + tags: + - CartridgeRocket + - type: Item + size: 5 + - type: CartridgeAmmo + proto: BulletRocketEMP + deleteOnSpawn: true + - type: Sprite + sprite: Objects/Weapons/Guns/Ammunition/Explosives/explosives.rsi + state: rpg + - type: StaticPrice + price: 20 \ No newline at end of file diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml index 2856d569b92..3f7ec3b792e 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml @@ -740,15 +740,20 @@ disableDuration: 20 - type: entity - id: BulletGrenadeEMP - name: emp grenade + id: BulletRocketEMP + name: rocket parent: BaseBulletTrigger noSpawn: true components: + - type: Projectile + damage: + types: + Shock: 0 - type: Sprite sprite: Objects/Weapons/Guns/Projectiles/projectiles2.rsi layers: - - state: grenade + - state: frag - type: EmpOnTrigger range: 4 - energyConsumption: 50000 \ No newline at end of file + energyConsumption: 50000 + disableDuration: 60 \ No newline at end of file diff --git a/Resources/Prototypes/Entities/Structures/Machines/emp.yml b/Resources/Prototypes/Entities/Structures/Machines/emp.yml new file mode 100644 index 00000000000..1033e07f4e7 --- /dev/null +++ b/Resources/Prototypes/Entities/Structures/Machines/emp.yml @@ -0,0 +1,66 @@ +- type: entity + parent: [ BaseMachinePowered, ConstructibleMachine ] + id: EmpGenerator + name: emp generator + description: Generate EMP blast. + components: + - type: Sprite + sprite: Structures/Machines/emp_generator.rsi + layers: + - state: emp-generator + - state: emp-generator-ready + visible: false + map: [ "ready" ] + - state: emp-generator-ready-blinking + visible: false + map: [ "readyBlinking" ] + - state: emp-generator-unready + visible: false + map: [ "unready" ] + - state: emp-generator-unready-blinking + visible: false + map: [ "unreadyBlinking" ] + - state: emp-generator-o4 + map: ["chargeState"] + shader: unshaded + - type: Appearance + - type: GenericVisualizer + visuals: + enum.SalvageMagnetVisuals.ChargeState: + chargeState: + 0: { state: emp-generator-o0, shader: "unshaded", visible: false } + 1: { state: emp-generator-o0, shader: "unshaded", visible: true } + 2: { state: emp-generator-o1, shader: "unshaded", visible: true } + 3: { state: emp-generator-o2, shader: "unshaded", visible: true } + 4: { state: emp-generator-o3, shader: "unshaded", visible: true } + 5: { state: emp-generator-o4, shader: "unshaded", visible: true } + enum.SalvageMagnetVisuals.Ready: + ready: + False: { state: emp-generator-ready, visible: false, shader: "unshaded" } + True: { state: emp-generator-ready, visible: true, shader: "unshaded" } + enum.SalvageMagnetVisuals.ReadyBlinking: + readyBlinking: + False: { state: emp-generator-ready-blinking, visible: false, shader: "unshaded" } + True: { state: emp-generator-ready-blinking, visible: true, shader: "unshaded" } + enum.SalvageMagnetVisuals.Unready: + unready: + False: { state: emp-generator-unready, visible: false, shader: "unshaded" } + True: { state: emp-generator-unready, visible: true, shader: "unshaded" } + enum.SalvageMagnetVisuals.UnreadyBlinking: + unreadyBlinking: + False: { state: emp-generator-unready-blinking, visible: false, shader: "unshaded" } + True: { state: emp-generator-unready-blinking, visible: true, shader: "unshaded" } + - type: Rotatable + - type: Transform + noRot: false + - type: IntrinsicRadioReceiver + - type: ActiveRadio + channels: + - Security +# - type: SalvageMagnet +# - type: EmpGenerator + - type: ApcPowerReceiver + powerLoad: 100 # TODO change this to a HV power draw that really hits the grid hard WHEN active +# powerLoad: 2500 # TODO change this to a HV power draw that really hits the grid hard WHEN active + - type: Machine + board: EMPGeneratorMachineCircuitboard \ No newline at end of file diff --git a/Resources/Textures/Objects/Weapons/Guns/Ammunition/Boxes/pistol.rsi/emp.png b/Resources/Textures/Objects/Weapons/Guns/Ammunition/Boxes/pistol.rsi/emp.png new file mode 100644 index 0000000000000000000000000000000000000000..f317d03c212f3d84d7f601471c095bcc8fa328c9 GIT binary patch literal 302 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=ffJubwWBArY;~60D08M0iXRRF3~+ zX6H-jNd5Bu2mhjUk*b6lFCRQ;xU3_V#lmpn)BAIA0pHB#@Gb0Qo}kOl7$keh#rO30 z)ggycf*ilr&$3{c|J2~X&T?tT;uA#-dZ%UIZ#h)!-SbqzAxv+__OsI%?>eP4 zn$K`fV1L8xQgoFeJhU(C~(-S^j+7Ao>22WQ%mvv4FO#s;&d$0fi literal 0 HcmV?d00001 diff --git a/Resources/Textures/Objects/Weapons/Guns/Ammunition/Boxes/pistol.rsi/meta.json b/Resources/Textures/Objects/Weapons/Guns/Ammunition/Boxes/pistol.rsi/meta.json index 67d525fcfd9..6e4341d168c 100644 --- a/Resources/Textures/Objects/Weapons/Guns/Ammunition/Boxes/pistol.rsi/meta.json +++ b/Resources/Textures/Objects/Weapons/Guns/Ammunition/Boxes/pistol.rsi/meta.json @@ -30,6 +30,9 @@ }, { "name": "rubber" + }, + { + "name": "emp" } ] } diff --git a/Resources/Textures/Structures/Machines/emp_generator.rsi/emp-generator-o0.png b/Resources/Textures/Structures/Machines/emp_generator.rsi/emp-generator-o0.png new file mode 100644 index 0000000000000000000000000000000000000000..6df11fbe99c98becf9242ae66248965096667d93 GIT binary patch literal 5298 zcmeHLc~lcu7Y_m=2vpo?l_kcdh)gnBNg@GcGZ8`oL6C}?WfCG}A(=o}WDzL1p@P;z zaRH%FKKVSTSVcu;(P~)*Sro+;)Rsk{fI>?r0TsWm=X}R=zW(Rr%w*=idw=iV-@EU= zH?z~rbFGoVA_Ei(WyE5-_#prB$muw1CUU*q5*LR;=@dly2Eaa?2((Nt6^KG1G#n{| z(2z7GxUkv?bcjYlJ6@ z4eW6E-aN*22QvoUx3TFb)6xgS!`q}kIS=nklju0L)`WFfcBCaqU2KP9m)@%GfkY=d zi3RtbO8w_PIhkqm=qNSo*^Y9B$2Y1pBUp*OabUC7_C*%;`*I9D?2?x~##WfFYd3XI zK2jGn!@+}f>%y3RjLxBWRNk|rh1Z2(=Z!AF&4Frv=42|Xr6aMkWH{8}c~|=h%jYk? zy_P|)ADI)GPwoe%5PDDF4UE@I{Vq4`^e$J+p5w$LY|v)Wml{kkFVR^C0ea?^ssAhAdFm< z?=em{h2BP(BVpI@ zt*Fyss~uCp(iw&WHr_SM)_sw>r#*EJQ*X_JhK+M=LB}FHRC)$;ChceAn!VCJbzU3F zYYL0fcNFsRvc!YB8&|Fz;@!;2DavK}oyjU&SiEtd?ou|;H?WCqlNm@MezxIcnM(fq zZ(Y6BA&)Rtoq_ucs@+$Xa&H^dFWBO5SXdgC@om<*j+2qAa_$(v9%?S_mfVkiq3qwE zpko=?*6;0hgtR0-^M^V+@f({nSf=>qI(Prg3%@;e`ejDx_bt-8EnD|WT1LTAy}KFY zfLaS|@Zov)vlH;1Iu%AI6Y#U56$_8}Jg)8NG8{8G?eqm&nL!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G zfy75{$TTK_iosKv_>b)6Vn~wozpOQj2XG#nat@?I#!u3U##YoaaK+fu*ke4TT}l9; zT@*}#Xe<3zB=RH7JxEE+_*$9TEElSBVd3S^>?L7?2P*_PMoy{A2k`oZ%l?XFQgaZ-Z#T>&X9Qj&0~Bn{>>o(;L9MN z#qSrozR>kq41AXHm+JaL*Jm;CS;k+g>;FcV(TC3|P=@S+5|NLknX0u{kPj^bq4#1o zYE<*fzj$;fBAKM%gs4y`ti9&cQ5U)$tQ#%^Wu#yX0r<*Wa*m TIyWl5tPyZMeb_&`N3Hu07q69W literal 0 HcmV?d00001 diff --git a/Resources/Textures/Structures/Machines/emp_generator.rsi/emp-generator-o2.png b/Resources/Textures/Structures/Machines/emp_generator.rsi/emp-generator-o2.png new file mode 100644 index 0000000000000000000000000000000000000000..ac86dc152da8cd98727348e80c105bc34ba0ca71 GIT binary patch literal 5919 zcmeHLXH-+!7LIgLupl5!LVT8C2&n`JgcguQ3DN`<6>gFn43I(+Ab=o6P>R?`0YP|( z(gX{jzzl;FL1rA<2#6?6up(GS9qPLY*7e?6Z@Jcc|4i1sxp$v$fBT&8>~rqENpf*^ zR8iJehQVMeREoVD^cw>mHcAT6xwCuUJ{U|B>LaG&)tRc^=(1|!E^63%{nsmMTHgap?cVLCI?tUQ zSUa1T#~&|DeoNT#o7vNXJg5FQd-b1HyOs9*McjROa@u`gQJJFruGF6<&gNOprbYL6 zy^gfRbp*}?{s8de?e4TQfW9x}^r`{6zCV3Dwbk z8RPz=Q=-2P&$sT#z;`AGBDYtl^uIe+Tz@un>7iXWO^)`fMuq(x{cEB|ug94rTP~SGlbBVk* z@Nz85(RcDm?hT!a2iXQQTHXB*#+OY~cdPxfW-@a26?=5H|76=NW6iQ?-6uZR*OoL_ zu%FYr6@1J6-OG@>!&YBQ(=5BD?R*;F%IntdiLe$#KhX>YeD-JYab08d8L`C>0>=MSdzT!obKRqNu`TEH^Uda+lH;5LXRKW5?Y zDuXt9-Z~Q-cac+0)abaL45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P|U2_FOc~>Zah>EY??jle9>O^JPaM_fNcEp+AmY3WiWL8quD|2$6J; zYEME);uD!X2AfHgUYeR=OidZ4Xe8R)%nXTV09d3s0}UX}(54I%&eSwO}Aa3FbH~=)AY!2WL zqWD~YX$*8_E(#*RSQvs32nCtaenMOeO^iJN*B^v-j}Phk(a!!4 zsem?Tf&iXrill=WC>6|bP%40CAQCXep+P(yj|I)aui1q>mM9DmfVTdSj*wPRdP=o| zZrlw3D5BCF z6vvjR%3-uGOxi7mOj;rbZxNZtkyPa{X|V`0;bCmi9=N1f^omv0gh0Mjds`3a|K{FY zRTx~!#+EfXKfk)>24Fvdz?pS5C_xa(hj=UfB%@)=BG^G2C~Ev>IT_e&p8w&4PoFnM rhNjwB4ah*Ri~PY2%cba#r<|kmy0G=zu5Y+hATd!Lob5~P{NnxvbJ`;5 literal 0 HcmV?d00001 diff --git a/Resources/Textures/Structures/Machines/emp_generator.rsi/emp-generator-o3.png b/Resources/Textures/Structures/Machines/emp_generator.rsi/emp-generator-o3.png new file mode 100644 index 0000000000000000000000000000000000000000..6a313591d35a6d136d1865b4fed4855c7f9e2558 GIT binary patch literal 5933 zcmeHLc{o&U8y~WSC`9$fYYe@Xn%#_H z(vD#t_kF$QTI2n5qm)b)wmyaIgY~IIjk^YywfT`Bv^-c^qCHj^cCfBuzA0e2cmL$u z6z9qEn_2yydGGOS?-FXwk+>U6H1dDse zFS@*I2|ZYOt{~Fy;%&W;v&bbQult)dSTs!vMS zz0edgLeXmdQL`ewsP+x*g#`msZ1lbrj8nIqlF=YK!k@``yV z(f3kK?%^aKji;?Udq%x0a<45qe>pRxe#^!FBh~~U!lXsNBYu9nsvhR(+-GeuEr~m~ z9oGx*JMLRhua&AID0lOyr`@!qxR3%1ky?6xU4cvBOAC7Oqrnyn8RoiwWG1;!_8qxF zLiIe;Y1#>tv6M?bq71#+isSu>47-FLwV>;YwPOU^(`*y7^fOST+`}3qzVdo2Q`-RPirns$Lt0vOmPPm1u6xiim~)Y~^h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yj_QtDjmXjIxp7|Hemp1;3UQm4Y_1b;? zm)R9OV~^%HG&?7#xZixOd++YWJGb|zzxw-^!Ffy3lyn2b3}C#lC3(BMF#HF>1$&oI z28wVNctjR6Fz6|RFk{71`!b*)dx@v7EBiBUJ|;8HjHZ{1fI^Zbt`Q~9`MJ5Nc_j?a zMX8A;sVNHOnI#zt?w-B@;f;LaKt&TgT^vIyZoR#`k@tWC4~xTs5C1+dGc@&@*mkIK zH>1O*eN`%#rGV;S;6r%r?@q~`_db*)ugjKT1PaGEdwzcUA<0{i1*Qg-4sdbXSN5b> w=RYe40~1&(C+JJBt8j%SqX4Q(28IPYIG>jADR+HVHv>s|y85}Sb4q9e0Bq$IY5)KL literal 0 HcmV?d00001 diff --git a/Resources/Textures/Structures/Machines/emp_generator.rsi/emp-generator-ready.png b/Resources/Textures/Structures/Machines/emp_generator.rsi/emp-generator-ready.png new file mode 100644 index 0000000000000000000000000000000000000000..084dc7ecf0067e3a47335b31459ba2a96ec09cbd GIT binary patch literal 5312 zcmeHLc~lcu7aw*(Hbt>6ZO33$Dw9k?0wgR72^hox29%{#og|YGAPY%=07XTFDis6^ zs6|n*C@7#Pix!H-1+*ZzVGC{uDpWy{!U09(n*>BWU(flD=Y0LoIcG96_ucz@_x|2} z_q~@L-kvLs4CWaC0AS?KWU#U47VKUzO&9yUaeMP-0MO2k@%2}*ktk3qlkkOMD5!{* zq9Cdi@&Q2E*6X)s_oKyzqg}J8nlq=>hHGy4Fe08FaGS9_P&z(y2?#1 zyNLIidn*{b22JR@H0HYX+aQt8Mvm7!&^^0}tcXqPZlk^)O}OLTap&-z!SGn$z?MCS zU!93+sytS6k7_x`^5?m6PYMF()n#(mUA$R&I8NX@pWEYm;a3HqO)_((R(eI_dTKJ z5r!2v+jj&)L%RnILan@B73Mrbx{2vIBY!tEb$;>k`1-+<&sxvNp82Eym!{lsg9e?_ zr9-)2taPv_dS;*8<)^c!Zsx{H&dC!=$K8I=+TU-NCj7k9&9G+dL(PX&+T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=*2EN)6POzM%N87NVi~Cu3o6bB+{VS)){dM}L-|3bN zWSwK{@txdHl$UkSxK?Qt6jVt@P0rla(9JPy&G^=m>2bL$e#rXu5vyyPrwD;`}Hqm?fp7!9r$?4E2fe^yS8c za;ZGrawh`^B@F`*p$Y_4io(Qln$i)c#-(BJDlq{Es#O%BjyQjoH%OPrP>_r#<6+2E zDU2lHoD4t*8IMn6Gu$R1urEhkutFiF5eQLHQTQlpyhJ7-5UEru0VWYhBnZ=hafm1fqHstsnM9_*R0?$p zl)G52K*U^B1%-j*g%}Qxk8texd<5d!P!NdBMMx0UhEIjKJR2U2SaV2JE`JJymrRId zB@#B(D-{$EgW}p+Q(KIQuRPte&|b7Fsd2_j4+5ugeD0i!V`oMCITj?YR0>W9SHx$iGx~UN|C|r#${OX z!fGL5vKUTqhWYz%UK3;SZ*~EKpE~&{em~LmiLQ@g;G>j3W!ERVK8k^lQvQ@(|2Mh} z-XEt>F}4ee!VXI`=2q=n|1?R}QE*izp9_5-Ng0)n?Hz-gpkC6z0xw_Qn1K zY%MkV4K&pLZHdlEvq$HxS(X-g!(t8X>NL?zOiO(Ym;aRcQwv(PXZ{NopbY@Q!PPh1 zM9YdE?wuVE0Q>v;>T{>v(gA_8!O?{&wYyd5Q!l1W>ubo^qJP2Fc9q!O)ss=;vT^Hw E07qW{zW@LL literal 0 HcmV?d00001 diff --git a/Resources/Textures/Structures/Machines/emp_generator.rsi/emp-generator-unready-blinking.png b/Resources/Textures/Structures/Machines/emp_generator.rsi/emp-generator-unready-blinking.png new file mode 100644 index 0000000000000000000000000000000000000000..1bc46e2eb39b590b72090873877f8fb33e97f9e0 GIT binary patch literal 702 zcmeAS@N?(olHy`uVBq!ia0vp^4Is?H1|$#LC7xzrU~J8Fb`J1#c2+1T%1_J8No8Qr zm{>c}*5j~)%+dJZrHeuZtvf7IRx~9zh8zi89niwHFf8Nh!6%pWGcHY7vcrOF9V@%N z*lIq#bGxi|a5X((?^rx}@}ll3KlU%VpmeSIaowKX-*;5Ab6i!ryk=XW!{uCK!S1e= zUsg#}xQbUPB#6`+ZSJx3>{|Tv$FBDN_2q)|uKv0+e{uBL2%Zm}M>d}^$bH27=%w%N z2YdWwk}4xr?bPLrUp5`-j|sP_dpxH&^1)0+kSct9^;wZ*yb8y{csWB6}eu+;p| zQZ0keo>fa1w)QvN%YE=@*Fw$e15f!3KBSyj_QtDjmXjIxp7|Hemp1;3UQm4Y_1b;? zm)R9OV~^%HG&?7#xZixOd++YWJGb|zzxw-^!Ffy3lyn2b3}C#lC3(BM0O|h>Z0mMt zEeEnV3p^r=85s1GL71^(seKtxkiEpy*OmPlHy@Lw;c*Gy&p;u`64!_l=ltB<)VvY~ z=c3falGGH1^30M91$R&1fbd2>aiF59o-U3d6}R5r*~oi9fyecr|F`=$BNY}YaUCgF z73%$}r92U+2o9D@`L|EK^5l@gw*NbNK%%!cT#02Hr;+IHP} zehf?w3>*xMAn6My*PWlX=dfA;NI-#s1tf+52hQbfFXR!Qd_nRVNYK;O&t;ucLK6T% C1r^W$ literal 0 HcmV?d00001 diff --git a/Resources/Textures/Structures/Machines/emp_generator.rsi/emp-generator-unready.png b/Resources/Textures/Structures/Machines/emp_generator.rsi/emp-generator-unready.png new file mode 100644 index 0000000000000000000000000000000000000000..a20b91edd163bdc05e1e45b3a7334dc20914968e GIT binary patch literal 5401 zcmeHLc~lcu7Y~(U*-^BpfTThAa7i+gjSz_hLx3P4BC7>uNG6a%7Lx!0T0vA)R4lf* zE1;kOSB@YBH^dFG6c7rCprFMC6_7GoviU{>mW(;s#|zP+hY9RJR)r^GqECRJ>_cIMoN@kvti$>*76p;jes0U0}A=2Wjd z5h7l4_Kn#}8nrJaqT{J}YJYo(#qi#1bh~7i(JvnHc<{RQZ0Do-O@S3vLHrX3M~sS_hBn%tnEuoH z#rB5FRqNX3^i67vKJnbRGj}n&#;k8ymeWzk?&(RtzFb-OBqr~rw1>%C;cT52U{HE; zzA9ovlR?58{_|H=(!|r+XI5V?o!ecBHT3^K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?viJbrBa&iqcq^YlNaZA@0M*ob6h zWtoKUkmb8)XlPhdQ=_S=X>GECjVV-wdxeH`kD$Dpq@*O!343zbIDnK^NswRge_{cH z(TWc-KwX>#9+AZi40=i+%(&{&-AN1#Ox>O?jv*P&Z>PU5T4f;6ARG|5<(~f5<#U*x zx4r-0lwQ8s!9cOiYkB>rvwVGbWj{^5>ms^6UyXyMQ9*#E>A+Lchl1;2lM*ZI5Koi zZ$B)~Au~~UInO!ql$yqHiDf5q%oeal*epBnRqLf@#dZeC=!UinyICz-lDQx7{MeRo zgJ)0aV|Vj_2YbbSoYC7b$Ir?s<>dLbV!OXMcl#`0SkQK1J8Q%qrT~V#2MUvny!xbd zzrA$jK2xmu;BFI}Sc7wC#L9X${SS+{Y*;d+S1EqUWfZwAwe^4_BU7c`#^q;^eG)p+ zUB&i7a(<<4vv6rgx`WtG-vtfT2Se(E9Bd!4u1_}z*EM1-kmLAj@{vh@tHUz~&IgA> zoITE09DgmDv(nk7WrK_I1%BNJ3ub@Mb7bcBDb&ajk9*)a@0j@gU)veFzADby=ir|+ zJ?g;R<;t$S3)8tX*w(%8W!RFEws(WW@Alo@iVtowsTRm)vw1Mo?ul+Vy0&3*RD;>E z)l#vgS&5HL8ISB{_0XQM?s}C<)fT1-vj&I228ZID3?`G7d%6ve%A}Y5?iM?qve?y~ zq0Q}CLDdb`0=62UF)jNU@}&OFxNvT5b)(|$h7aN|7(Z?Nm9P{P1aB2o*cxxB3LIv# z=?gQck2iSG?#aWX6#eF0)SPG0x<)6gH$JW2pL#RPRkQx@zr{!IZ?BI!v1tkKjc(oe zPgQK&ZUK{m97hK`)3!Yl3JP9lOEd zuRIoaAHI}deqM;B$w7dF$x#8AnDWJT-2KNaJ7Jry<9;4?U|MDHboFyt=akR{04Vd6 Az5oCK literal 0 HcmV?d00001 diff --git a/Resources/Textures/Structures/Machines/emp_generator.rsi/meta.json b/Resources/Textures/Structures/Machines/emp_generator.rsi/meta.json new file mode 100644 index 00000000000..48781e2ef27 --- /dev/null +++ b/Resources/Textures/Structures/Machines/emp_generator.rsi/meta.json @@ -0,0 +1,69 @@ +{ + "version": 1, + "license": "CC-BY-SA-3.0", + "copyright": "Edit by 20kdc using small parts of autolathe from https://github.com/tgstation/tgstation/blob/acb091f9744e9ab7d5a27fb32dd0c03bd019f58c/icons/obj/stationobjs.dmi (may be an earlier version) and tcboss from https://github.com/tgstation/tgstation/blob/e32357e6b0ec0f0a1821d2773f0d1e1d6ce7d494/icons/obj/computer.dmi (may be an earlier version)", + "size": { + "x": 32, + "y": 64 + }, + "states": [ + { + "name": "emp-generator", + "directions": 4 + }, + { + "name": "emp-generator-o0", + "directions": 4, + "commentary": "o0 - 04 represent the amount of time remaining during EMP and cooldown." + }, + { + "name": "emp-generator-o1", + "directions": 4 + }, + { + "name": "emp-generator-o2", + "directions": 4 + }, + { + "name": "emp-generator-o3", + "directions": 4 + }, + { + "name": "emp-generator-o4", + "directions": 4 + }, + { + "name": "emp-generator-unready", + "directions": 4, + "commentary": "Cooldown state" + }, + { + "name": "emp-generator-ready", + "directions": 4, + "commentary": "EMP state" + }, + { + "name": "emp-generator-ready-blinking", + "directions": 4, + "delays": [ + [ 0.2, 0.2], + [ 0.2, 0.2], + [ 0.2, 0.2], + [ 0.2, 0.2] + ], + "commentary": "EMP active state" + }, + { + "name": "emp-generator-unready-blinking", + "directions": 4, + "delays": [ + [ 0.2, 0.2], + [ 0.2, 0.2], + [ 0.2, 0.2], + [ 0.2, 0.2] + ], + "commentary": "EMP inactive state" + } + ] +} + From c36a97035da882d3b9fc32ca24913f0271118d63 Mon Sep 17 00:00:00 2001 From: Dvir Date: Mon, 17 Jul 2023 00:52:03 +0300 Subject: [PATCH 03/16] E --- .../Weapons/Guns/Battery/battery_guns.yml | 66 +++++++++---------- .../Weapons/Guns/Projectiles/projectiles.yml | 17 +++++ 2 files changed, 50 insertions(+), 33 deletions(-) diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Battery/battery_guns.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Battery/battery_guns.yml index 8b10db7b9e9..21387532f3d 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Battery/battery_guns.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Battery/battery_guns.yml @@ -31,39 +31,6 @@ - type: StaticPrice price: 500 -- type: entity - id: BaseWeaponEMP - parent: BaseItem - abstract: true - components: - - type: Sprite - - type: Item - size: 50 - - type: Clothing - sprite: Objects/Weapons/Guns/Battery/laser_retro.rsi - quickEquip: false - slots: - - Back - - suitStorage - - type: AmmoCounter - - type: Gun - fireRate: 2 - selectedMode: SemiAuto - availableModes: - - SemiAuto - soundGunshot: - path: /Audio/Weapons/Guns/Gunshots/laser.ogg - - type: Battery - maxCharge: 1000 - startingCharge: 1000 - - type: MagazineVisuals - magState: mag - steps: 5 - zeroVisible: false - - type: Appearance - - type: StaticPrice - price: 500 - - type: entity id: BaseWeaponBatterySmall parent: BaseWeaponBattery @@ -494,6 +461,39 @@ - type: StaticPrice price: 750 +- type: entity + id: BaseWeaponEMP + parent: BaseItem + abstract: true + components: + - type: Sprite + - type: Item + size: 50 + - type: Clothing + sprite: Objects/Weapons/Guns/Battery/laser_retro.rsi + quickEquip: false + slots: + - Back + - suitStorage + - type: AmmoCounter + - type: Gun + fireRate: 2 + selectedMode: SemiAuto + availableModes: + - SemiAuto + soundGunshot: + path: /Audio/Weapons/Guns/Gunshots/laser.ogg + - type: Battery + maxCharge: 1000 + startingCharge: 1000 + - type: MagazineVisuals + magState: mag + steps: 5 + zeroVisible: false + - type: Appearance + - type: StaticPrice + price: 500 + - type: entity name: emp laser parent: BaseWeaponEMP diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml index 3f7ec3b792e..784e954bb44 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml @@ -739,6 +739,23 @@ energyConsumption: 50000 disableDuration: 20 +- type: entity + id: BulletGrenadeEMP + name: emp grenade + parent: BaseBulletTrigger + noSpawn: true + components: + damage: + types: + Shock: 0 + - type: Sprite + sprite: Objects/Weapons/Guns/Projectiles/projectiles2.rsi + layers: + - state: grenade + - type: EmpOnTrigger + range: 4 + energyConsumption: 50000 + - type: entity id: BulletRocketEMP name: rocket From 5e9382011ba7b70cdc56b9df95463684ed642e89 Mon Sep 17 00:00:00 2001 From: Dvir Date: Mon, 17 Jul 2023 02:36:13 +0300 Subject: [PATCH 04/16] Ye --- .../Weapons/Guns/Ammunition/explosives.yml | 4 +- .../Weapons/Guns/Battery/battery_guns.yml | 2 +- .../Weapons/Guns/Projectiles/hitscan.yml | 8 ++-- .../Weapons/Guns/Projectiles/projectiles.yml | 43 ++++++++++++++++-- .../Explosives/explosives.rsi/meta.json | 3 ++ .../Explosives/explosives.rsi/rpg-emp.png | Bin 0 -> 716 bytes .../Projectiles/projectiles2.rsi/frag-emp.png | Bin 0 -> 269 bytes .../Projectiles/projectiles2.rsi/meta.json | 3 ++ 8 files changed, 51 insertions(+), 12 deletions(-) create mode 100644 Resources/Textures/Objects/Weapons/Guns/Ammunition/Explosives/explosives.rsi/rpg-emp.png create mode 100644 Resources/Textures/Objects/Weapons/Guns/Projectiles/projectiles2.rsi/frag-emp.png diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/explosives.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/explosives.yml index d27bf49a411..0413fbb6263 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/explosives.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/explosives.yml @@ -169,6 +169,4 @@ deleteOnSpawn: true - type: Sprite sprite: Objects/Weapons/Guns/Ammunition/Explosives/explosives.rsi - state: rpg - - type: StaticPrice - price: 20 \ No newline at end of file + state: rpg-emp \ No newline at end of file diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Battery/battery_guns.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Battery/battery_guns.yml index 21387532f3d..7880bd57e84 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Battery/battery_guns.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Battery/battery_guns.yml @@ -498,7 +498,7 @@ name: emp laser parent: BaseWeaponEMP id: WeaponEMPLaser - description: EMP-4. + description: WIP-1. components: - type: Sprite sprite: Objects/Weapons/Guns/Battery/xray.rsi diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/hitscan.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/hitscan.yml index 15e4ddab275..02bbd147df0 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/hitscan.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/hitscan.yml @@ -109,14 +109,12 @@ id: EMPLaser damage: types: - Heat: 1 + Shock: 0 components: - - type: ExplodeOnTrigger - - type: Explosive - - type: TriggerOnCollide - type: EmpOnTrigger - range: 4 + range: 1 energyConsumption: 50000 + disableDuration: 60 muzzleFlash: sprite: Objects/Weapons/Guns/Projectiles/projectiles.rsi state: muzzle_xray diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml index 784e954bb44..be7e4d54c2f 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml @@ -737,7 +737,7 @@ - type: EmpOnTrigger range: 0.3 energyConsumption: 50000 - disableDuration: 20 + disableDuration: 10 - type: entity id: BulletGrenadeEMP @@ -745,6 +745,7 @@ parent: BaseBulletTrigger noSpawn: true components: + - type: Projectile damage: types: Shock: 0 @@ -755,6 +756,7 @@ - type: EmpOnTrigger range: 4 energyConsumption: 50000 + disableDuration: 60 - type: entity id: BulletRocketEMP @@ -769,8 +771,43 @@ - type: Sprite sprite: Objects/Weapons/Guns/Projectiles/projectiles2.rsi layers: - - state: frag + - state: frag-emp - type: EmpOnTrigger range: 4 energyConsumption: 50000 - disableDuration: 60 \ No newline at end of file + disableDuration: 60 + +#- type: entity +# parent: BaseBullet +# id: AnomalousParticleDelta +# name: delta particles +# noSpawn: true +# components: +# - type: Sprite +# sprite: Objects/Weapons/Guns/Projectiles/magic.rsi +# layers: +# - state: magicm +# shader: unshaded +# - type: Ammo +# muzzleFlash: null +# - type: Physics +# - type: Fixtures +# fixtures: +# projectile: +# shape: +# !type:PhysShapeAabb +# bounds: "-0.2,-0.2,0.2,0.2" +# hard: false +# mask: +# - Opaque +# fly-by: *flybyfixture +# - type: Projectile +# damage: +# types: +# Shock: 0 +# - type: TimedDespawn +# lifetime: 3 +# - type: EmpOnTrigger +# range: 4 +# energyConsumption: 50000 +# disableDuration: 60 \ No newline at end of file diff --git a/Resources/Textures/Objects/Weapons/Guns/Ammunition/Explosives/explosives.rsi/meta.json b/Resources/Textures/Objects/Weapons/Guns/Ammunition/Explosives/explosives.rsi/meta.json index ae519a3a4e7..ba4c1d14240 100644 --- a/Resources/Textures/Objects/Weapons/Guns/Ammunition/Explosives/explosives.rsi/meta.json +++ b/Resources/Textures/Objects/Weapons/Guns/Ammunition/Explosives/explosives.rsi/meta.json @@ -25,6 +25,9 @@ { "name": "rpg" }, + { + "name": "rpg-emp" + }, { "name": "ball" }, diff --git a/Resources/Textures/Objects/Weapons/Guns/Ammunition/Explosives/explosives.rsi/rpg-emp.png b/Resources/Textures/Objects/Weapons/Guns/Ammunition/Explosives/explosives.rsi/rpg-emp.png new file mode 100644 index 0000000000000000000000000000000000000000..ddd1f4b6b38738a4dfe1d20beca341764767e347 GIT binary patch literal 716 zcmV;-0yF)IP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vG?Apig_Apr+l{Qm#|0%1u+K~z{r?UK(+ zR8bVizvsR;qfR;*Dzwmc*}@i1hAt|oO&Aokh?YS_wF&wY+T^}XJB4;Z1VxL;jA#)- zgjl9QU=+0p$r*K=(Rn}a?R(ygIq`)+`~Boip4=RSb3p&04sO!HMf?7flqjeyOyTH_gD@y? zV>@7TpeEKGoN>;&Aa=H98Og!Yui>TLmyX`yiNvXAw*>eezW_QtPiSEIa_~GJhZAvj zDKf6dH@c@=iR~MiaM!Lr(0Rh6nI*j`d+~6W>F6KDsljeo`>Viv(?3>nzUks&3w8{%Ze$bYj2HO6 y)M9w+ys*l##?F;FRfG*1`D5DWjalMMM76ggNdS)TmY->1ExK(oV= zdwHR-o1)97w$Dtqf%gY)Mt0$vU1!Df1nih!Y3y*^%hBpqP|vt6PwvFtmzr~dHZpj+`njxgN@xNA>nv8b literal 0 HcmV?d00001 diff --git a/Resources/Textures/Objects/Weapons/Guns/Projectiles/projectiles2.rsi/meta.json b/Resources/Textures/Objects/Weapons/Guns/Projectiles/projectiles2.rsi/meta.json index f9825de1a4a..9cfee3da832 100644 --- a/Resources/Textures/Objects/Weapons/Guns/Projectiles/projectiles2.rsi/meta.json +++ b/Resources/Textures/Objects/Weapons/Guns/Projectiles/projectiles2.rsi/meta.json @@ -28,6 +28,9 @@ { "name": "frag" }, + { + "name": "frag-emp" + }, { "name": "grenade", "delays": [ From 657c7c6c3edc0b4dc5f6d37932b73cd71aea884d Mon Sep 17 00:00:00 2001 From: Dvir Date: Tue, 18 Jul 2023 02:54:37 +0300 Subject: [PATCH 05/16] More EMP --- .../Weapons/Guns/Ammunition/Boxes/pistol.yml | 4 +- .../Guns/Ammunition/Cartridges/pistol.yml | 4 +- .../Guns/Ammunition/Magazines/pistol.yml | 4 +- .../Guns/Ammunition/Projectiles/pistol.yml | 4 +- .../Weapons/Guns/Ammunition/explosives.yml | 8 +- .../Weapons/Guns/Battery/battery_guns.yml | 54 ++++-------- .../Weapons/Guns/Projectiles/hitscan.yml | 22 +---- .../Weapons/Guns/Projectiles/projectiles.yml | 78 +++++++++--------- .../Projectiles/magic.rsi/emp_projectile.png | Bin 0 -> 466 bytes .../Guns/Projectiles/magic.rsi/meta.json | 11 +++ 10 files changed, 79 insertions(+), 110 deletions(-) create mode 100644 Resources/Textures/Objects/Weapons/Guns/Projectiles/magic.rsi/emp_projectile.png diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Boxes/pistol.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Boxes/pistol.yml index 35836b7c372..0e8e6d069e9 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Boxes/pistol.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Boxes/pistol.yml @@ -101,11 +101,11 @@ - type: entity parent: BaseMagazineBoxPistol - id: MagazineBoxPistolEMP + id: MagazineBoxPistolEmp name: ammunition box (.35 auto emp) components: - type: BallisticAmmoProvider - proto: CartridgePistolEMP + proto: CartridgePistolEmp - type: Sprite layers: - state: base diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Cartridges/pistol.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Cartridges/pistol.yml index 8c565054df4..936c702b767 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Cartridges/pistol.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Cartridges/pistol.yml @@ -61,9 +61,9 @@ proto: BulletPistolIncendiary - type: entity - id: CartridgePistolEMP + id: CartridgePistolEmp name: cartridge (.35 auto emp) parent: BaseCartridgePistol components: - type: CartridgeAmmo - proto: BulletPistolEMP \ No newline at end of file + proto: BulletPistolEmp \ No newline at end of file diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Magazines/pistol.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Magazines/pistol.yml index 3c05fbb9af5..93b7420c638 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Magazines/pistol.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Magazines/pistol.yml @@ -303,12 +303,12 @@ map: ["enum.GunVisualLayers.Mag"] - type: entity - id: MagazinePistolSubMachineGunEMP + id: MagazinePistolSubMachineGunEmp name: SMG magazine (.35 auto emp) parent: BaseMagazinePistolSubMachineGun components: - type: BallisticAmmoProvider - proto: CartridgePistolEMP + proto: CartridgePistolEmp - type: Sprite layers: - state: rubber diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/pistol.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/pistol.yml index 0bc22fda8d5..0be43ee4ce2 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/pistol.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/pistol.yml @@ -54,9 +54,9 @@ Burn: 14 - type: entity - id: BulletPistolEMP + id: BulletPistolEmp name: bullet (.35 auto emp) - parent: BaseBulletEMP + parent: BaseBulletEmp noSpawn: true components: - type: Projectile \ No newline at end of file diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/explosives.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/explosives.yml index 0413fbb6263..f2edfb68b4b 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/explosives.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/explosives.yml @@ -137,12 +137,12 @@ state: ball - type: entity - id: GrenadeEMP + id: GrenadeEmp name: emp grenade parent: BaseGrenade components: - type: CartridgeAmmo - proto: BulletGrenadeEMP + proto: BulletGrenadeEmp - type: Sprite sprite: Objects/Weapons/Guns/Ammunition/Explosives/explosives.rsi layers: @@ -154,7 +154,7 @@ suffix: false - type: entity - id: CartridgeRocketEMP + id: CartridgeRocketEmp name: PG-7VL emp parent: BaseItem description: A 1.5 emp warhead designed for the RPG-7 launcher. Has tubular shape. @@ -165,7 +165,7 @@ - type: Item size: 5 - type: CartridgeAmmo - proto: BulletRocketEMP + proto: BulletRocketEmp deleteOnSpawn: true - type: Sprite sprite: Objects/Weapons/Guns/Ammunition/Explosives/explosives.rsi diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Battery/battery_guns.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Battery/battery_guns.yml index 7880bd57e84..7b48e547fbb 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Battery/battery_guns.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Battery/battery_guns.yml @@ -462,43 +462,10 @@ price: 750 - type: entity - id: BaseWeaponEMP - parent: BaseItem - abstract: true - components: - - type: Sprite - - type: Item - size: 50 - - type: Clothing - sprite: Objects/Weapons/Guns/Battery/laser_retro.rsi - quickEquip: false - slots: - - Back - - suitStorage - - type: AmmoCounter - - type: Gun - fireRate: 2 - selectedMode: SemiAuto - availableModes: - - SemiAuto - soundGunshot: - path: /Audio/Weapons/Guns/Gunshots/laser.ogg - - type: Battery - maxCharge: 1000 - startingCharge: 1000 - - type: MagazineVisuals - magState: mag - steps: 5 - zeroVisible: false - - type: Appearance - - type: StaticPrice - price: 500 - -- type: entity - name: emp laser - parent: BaseWeaponEMP - id: WeaponEMPLaser - description: WIP-1. + name: emp emitter + parent: BaseWeaponBattery + id: WeaponEmpEmitter + description: Releases electromagnetic pulses that disrupt or damage many electronic devices or drain power cells. components: - type: Sprite sprite: Objects/Weapons/Guns/Battery/xray.rsi @@ -511,11 +478,18 @@ - type: Clothing sprite: Objects/Weapons/Guns/Battery/xray.rsi - type: Gun + fireRate: 1 + selectedMode: SemiAuto + availableModes: + - SemiAuto soundGunshot: path: /Audio/Weapons/Guns/Gunshots/laser3.ogg - - type: HitscanBatteryAmmoProvider - proto: EMPLaser - fireCost: 100 + - type: Battery + maxCharge: 1000 + startingCharge: 1000 + - type: ProjectileBatteryAmmoProvider + proto: ProjectileEmp + fireCost: 1000 - type: MagazineVisuals magState: mag steps: 5 diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/hitscan.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/hitscan.yml index 02bbd147df0..dbe569c4a76 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/hitscan.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/hitscan.yml @@ -103,24 +103,4 @@ state: beam_blue impactFlash: sprite: Objects/Weapons/Guns/Projectiles/projectiles.rsi - state: impact_blue - -- type: hitscan - id: EMPLaser - damage: - types: - Shock: 0 - components: - - type: EmpOnTrigger - range: 1 - energyConsumption: 50000 - disableDuration: 60 - muzzleFlash: - sprite: Objects/Weapons/Guns/Projectiles/projectiles.rsi - state: muzzle_xray - travelFlash: - sprite: Objects/Weapons/Guns/Projectiles/projectiles.rsi - state: xray - impactFlash: - sprite: Objects/Weapons/Guns/Projectiles/projectiles.rsi - state: impact_xray \ No newline at end of file + state: impact_blue \ No newline at end of file diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml index be7e4d54c2f..22b18a50dd4 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml @@ -723,7 +723,7 @@ - type: GrapplingProjectile - type: entity - id: BaseBulletEMP + id: BaseBulletEmp name: base bullet emp parent: BaseBulletTrigger noSpawn: true @@ -740,7 +740,7 @@ disableDuration: 10 - type: entity - id: BulletGrenadeEMP + id: BulletGrenadeEmp name: emp grenade parent: BaseBulletTrigger noSpawn: true @@ -749,6 +749,8 @@ damage: types: Shock: 0 + - type: TimedDespawn + lifetime: 15 - type: Sprite sprite: Objects/Weapons/Guns/Projectiles/projectiles2.rsi layers: @@ -759,7 +761,7 @@ disableDuration: 60 - type: entity - id: BulletRocketEMP + id: BulletRocketEmp name: rocket parent: BaseBulletTrigger noSpawn: true @@ -768,6 +770,8 @@ damage: types: Shock: 0 + - type: TimedDespawn + lifetime: 15 - type: Sprite sprite: Objects/Weapons/Guns/Projectiles/projectiles2.rsi layers: @@ -777,37 +781,37 @@ energyConsumption: 50000 disableDuration: 60 -#- type: entity -# parent: BaseBullet -# id: AnomalousParticleDelta -# name: delta particles -# noSpawn: true -# components: -# - type: Sprite -# sprite: Objects/Weapons/Guns/Projectiles/magic.rsi -# layers: -# - state: magicm -# shader: unshaded -# - type: Ammo -# muzzleFlash: null -# - type: Physics -# - type: Fixtures -# fixtures: -# projectile: -# shape: -# !type:PhysShapeAabb -# bounds: "-0.2,-0.2,0.2,0.2" -# hard: false -# mask: -# - Opaque -# fly-by: *flybyfixture -# - type: Projectile -# damage: -# types: -# Shock: 0 -# - type: TimedDespawn -# lifetime: 3 -# - type: EmpOnTrigger -# range: 4 -# energyConsumption: 50000 -# disableDuration: 60 \ No newline at end of file +- type: entity + parent: BaseBulletTrigger + id: ProjectileEmp + name: emp projectile + noSpawn: true + components: + - type: Sprite + sprite: Objects/Weapons/Guns/Projectiles/magic.rsi + layers: + - state: emp_projectile + shader: unshaded + - type: Ammo + muzzleFlash: null + - type: Physics + - type: Fixtures + fixtures: + projectile: + shape: + !type:PhysShapeAabb + bounds: "-0.2,-0.2,0.2,0.2" + hard: false + mask: + - Opaque + fly-by: *flybyfixture + - type: Projectile + damage: + types: + Shock: 0 + - type: TimedDespawn + lifetime: 15 + - type: EmpOnTrigger + range: 2 + energyConsumption: 50000 + disableDuration: 30 \ No newline at end of file diff --git a/Resources/Textures/Objects/Weapons/Guns/Projectiles/magic.rsi/emp_projectile.png b/Resources/Textures/Objects/Weapons/Guns/Projectiles/magic.rsi/emp_projectile.png new file mode 100644 index 0000000000000000000000000000000000000000..b824881c5f8c6a3d5b158875e30f5de08137473f GIT binary patch literal 466 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sDEfH31!Z9ZwBhICIC$B>G+x3>=ZG8+oCKIDDMu)Sb`kXM6| zK&k_0$f3qN4P^?Ce|RcqD;o+|E8qA(dC^z3pnDaMEZEbTfQAZ`{r~Ydt-osb4!NJR zt9S!nd|P$LZ}<7bU!P_cS4;G!{yZhNT5+;`Uc>x9-!|EpzTG!1yGd<*P9X2aKiyTl zncN!+e|Ppg+I)J)v$Sju(*;|*Wg+oX3n->3kV^lWz{FM#A<{z9Kp?J}E`SRlD%s{t+K-f{g z%r}Ag;@6e!OAQtU$OgV#qE@9dHT9=ekLlBvjCf}?`#TKwKesU$@8W#>MD=#do&U_U zm~z%!HMn)>iSM?y0Or2Z`zsjMP7w6^=d)dY` z%>ucF_jC4LOY`2=cJ)8cydzwlc~-V_t>uAE__2A}OZMcW_YdCLdv_zqO`fiPF6*2U FngFDY$@u^P literal 0 HcmV?d00001 diff --git a/Resources/Textures/Objects/Weapons/Guns/Projectiles/magic.rsi/meta.json b/Resources/Textures/Objects/Weapons/Guns/Projectiles/magic.rsi/meta.json index 0dbedf2922b..b1022c3c939 100644 --- a/Resources/Textures/Objects/Weapons/Guns/Projectiles/magic.rsi/meta.json +++ b/Resources/Textures/Objects/Weapons/Guns/Projectiles/magic.rsi/meta.json @@ -18,6 +18,17 @@ ] ] }, + { + "name": "emp_projectile", + "delays": [ + [ + 0.1, + 0.1, + 0.1, + 0.1 + ] + ] + }, { "name": "magicm_green", "delays": [ From 22f751cf590d0345dc9fbcbc28fdedd51b28cb9d Mon Sep 17 00:00:00 2001 From: Dvir Date: Wed, 19 Jul 2023 02:40:06 +0300 Subject: [PATCH 06/16] More EMP --- .../Salvage/M_EmpGeneratorComponent.cs | 5 + .../Salvage/M_EmpGeneratorComponent.cs | 131 +++++++ Content.Server/Salvage/M_EmpGridComponent.cs | 14 + Content.Server/Salvage/M_EmpSystem.cs | 362 ++++++++++++++++++ .../Salvage/SharedM_EmpGeneratorComponent.cs | 31 ++ .../Salvage/SharedM_EmpSystem.cs.old | 16 + Resources/Locale/en-US/m_emp/m_emp-system.ftl | 23 ++ .../Circuitboards/Machine/production.yml | 8 +- .../Entities/Structures/Machines/emp.yml | 66 ---- .../Entities/Structures/Machines/m_emp.yml | 64 ++++ .../m_emp-o0.png} | Bin .../m_emp-o1.png} | Bin .../m_emp-o2.png} | Bin .../m_emp-o3.png} | Bin .../m_emp-o4.png} | Bin .../m_emp-ready-blinking.png} | Bin .../m_emp-ready.png} | Bin .../m_emp-unready-blinking.png} | Bin .../m_emp-unready.png} | Bin .../emp-generator.png => m_emp.rsi/m_emp.png} | Bin .../meta.json | 20 +- 21 files changed, 660 insertions(+), 80 deletions(-) create mode 100644 Content.Client/Salvage/M_EmpGeneratorComponent.cs create mode 100644 Content.Server/Salvage/M_EmpGeneratorComponent.cs create mode 100644 Content.Server/Salvage/M_EmpGridComponent.cs create mode 100644 Content.Server/Salvage/M_EmpSystem.cs create mode 100644 Content.Shared/Salvage/SharedM_EmpGeneratorComponent.cs create mode 100644 Content.Shared/Salvage/SharedM_EmpSystem.cs.old create mode 100644 Resources/Locale/en-US/m_emp/m_emp-system.ftl delete mode 100644 Resources/Prototypes/Entities/Structures/Machines/emp.yml create mode 100644 Resources/Prototypes/Entities/Structures/Machines/m_emp.yml rename Resources/Textures/Structures/Machines/{emp_generator.rsi/emp-generator-o0.png => m_emp.rsi/m_emp-o0.png} (100%) rename Resources/Textures/Structures/Machines/{emp_generator.rsi/emp-generator-o1.png => m_emp.rsi/m_emp-o1.png} (100%) rename Resources/Textures/Structures/Machines/{emp_generator.rsi/emp-generator-o2.png => m_emp.rsi/m_emp-o2.png} (100%) rename Resources/Textures/Structures/Machines/{emp_generator.rsi/emp-generator-o3.png => m_emp.rsi/m_emp-o3.png} (100%) rename Resources/Textures/Structures/Machines/{emp_generator.rsi/emp-generator-o4.png => m_emp.rsi/m_emp-o4.png} (100%) rename Resources/Textures/Structures/Machines/{emp_generator.rsi/emp-generator-ready-blinking.png => m_emp.rsi/m_emp-ready-blinking.png} (100%) rename Resources/Textures/Structures/Machines/{emp_generator.rsi/emp-generator-ready.png => m_emp.rsi/m_emp-ready.png} (100%) rename Resources/Textures/Structures/Machines/{emp_generator.rsi/emp-generator-unready-blinking.png => m_emp.rsi/m_emp-unready-blinking.png} (100%) rename Resources/Textures/Structures/Machines/{emp_generator.rsi/emp-generator-unready.png => m_emp.rsi/m_emp-unready.png} (100%) rename Resources/Textures/Structures/Machines/{emp_generator.rsi/emp-generator.png => m_emp.rsi/m_emp.png} (100%) rename Resources/Textures/Structures/Machines/{emp_generator.rsi => m_emp.rsi}/meta.json (77%) diff --git a/Content.Client/Salvage/M_EmpGeneratorComponent.cs b/Content.Client/Salvage/M_EmpGeneratorComponent.cs new file mode 100644 index 00000000000..93ab39118b3 --- /dev/null +++ b/Content.Client/Salvage/M_EmpGeneratorComponent.cs @@ -0,0 +1,5 @@ +using Content.Shared.M_Emp; +using Robust.Shared.GameStates; + +[NetworkedComponent, RegisterComponent] +public sealed class M_EmpGeneratorComponent : SharedM_EmpGeneratorComponent { } diff --git a/Content.Server/Salvage/M_EmpGeneratorComponent.cs b/Content.Server/Salvage/M_EmpGeneratorComponent.cs new file mode 100644 index 00000000000..d5d182d37dc --- /dev/null +++ b/Content.Server/Salvage/M_EmpGeneratorComponent.cs @@ -0,0 +1,131 @@ +using Content.Shared.Radio; +using Content.Shared.Random; +using Content.Shared.M_Emp; +using Robust.Shared.GameStates; +using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; + +namespace Content.Server.M_Emp +{ + /// + /// A M_Emp generator. + /// + [NetworkedComponent, RegisterComponent] + [Access(typeof(M_EmpSystem))] + public sealed class M_EmpGeneratorComponent : SharedM_EmpGeneratorComponent + { + /// + /// The entity attached to the generator + /// + // [ViewVariables(VVAccess.ReadOnly)] + // [DataField("attachedEntity")] + // public EntityUid? AttachedEntity; + + /// + /// Current state of this generator + /// + [ViewVariables(VVAccess.ReadOnly)] + [DataField("generatorState")] + public GeneratorState GeneratorState = GeneratorState.Inactive; + + /// + /// How long it takes for the generator to pull in the debris + /// + [ViewVariables(VVAccess.ReadWrite)] + [DataField("baseAttachingTime")] + public TimeSpan BaseAttachingTime = TimeSpan.FromSeconds(30); + + /// + /// How long it actually takes for the generator to pull in the debris + /// + [ViewVariables(VVAccess.ReadWrite)] + [DataField("attachingTime")] + public TimeSpan AttachingTime = TimeSpan.FromSeconds(30); + + /// + /// How long the generator can hold the debris until it starts losing the lock + /// + [ViewVariables(VVAccess.ReadWrite)] + [DataField("holdTime")] + public TimeSpan HoldTime = TimeSpan.FromSeconds(240); + + /// + /// How long the generator can hold the debris while losing the lock + /// + [ViewVariables(VVAccess.ReadWrite)] + [DataField("detachingTime")] + public TimeSpan DetachingTime = TimeSpan.FromSeconds(30); + + /// + /// How long the generator has to cool down for after use + /// + [ViewVariables(VVAccess.ReadWrite)] + [DataField("baseCooldownTime")] + public TimeSpan BaseCooldownTime = TimeSpan.FromSeconds(60); + + /// + /// How long the generator actually has to cool down for after use + /// + [ViewVariables(VVAccess.ReadWrite)] + [DataField("cooldownTime")] + public TimeSpan CooldownTime = TimeSpan.FromSeconds(60); + + [DataField("M_EmpChannel", customTypeSerializer: typeof(PrototypeIdSerializer))] + public string M_EmpChannel = "Security"; + + /// + /// Current how much charge the generator currently has + /// + [DataField("chargeRemaining")] + public int ChargeRemaining = 5; + + /// + /// How much capacity the generator can hold + /// + [DataField("chargeCapacity")] + public int ChargeCapacity = 5; + + /// + /// Used as a guard to prevent spamming the appearance system + /// + [DataField("previousCharge")] + public int PreviousCharge = 5; + + /// + /// The chance that a random procgen asteroid will be + /// generated rather than a static M_Emp prototype. + /// + // [DataField("asteroidChance"), ViewVariables(VVAccess.ReadWrite)] + // public float AsteroidChance = 0.6f; + + /// + /// A weighted random prototype corresponding to + /// what asteroid entities will be generated. + /// +// [DataField("asteroidPool", customTypeSerializer: typeof(PrototypeIdSerializer)), ViewVariables(VVAccess.ReadWrite)] +// public string AsteroidPool = "RandomAsteroidPool"; + } + + [CopyByRef, DataRecord] + public record struct GeneratorState(GeneratorStateType StateType, TimeSpan Until) + { + public static readonly GeneratorState Inactive = new (GeneratorStateType.Inactive, TimeSpan.Zero); + }; + + public sealed class M_EmpGeneratorActivatedEvent : EntityEventArgs + { + public EntityUid Generator; + + public M_EmpGeneratorActivatedEvent(EntityUid generator) + { + Generator = generator; + } + } + public enum GeneratorStateType + { + Inactive, + Attaching, + Holding, + Detaching, + CoolingDown, + } +} diff --git a/Content.Server/Salvage/M_EmpGridComponent.cs b/Content.Server/Salvage/M_EmpGridComponent.cs new file mode 100644 index 00000000000..90b3eadd766 --- /dev/null +++ b/Content.Server/Salvage/M_EmpGridComponent.cs @@ -0,0 +1,14 @@ +namespace Content.Server.M_Emp +{ + /// + /// A grid spawned by a salvage magnet. + /// + [RegisterComponent] + public sealed class M_EmpGridComponent : Component + { + /// + /// The magnet that spawned this grid. + /// + public EntityUid? SpawnerMagnet; + } +} diff --git a/Content.Server/Salvage/M_EmpSystem.cs b/Content.Server/Salvage/M_EmpSystem.cs new file mode 100644 index 00000000000..4f5fbefdd22 --- /dev/null +++ b/Content.Server/Salvage/M_EmpSystem.cs @@ -0,0 +1,362 @@ +using System.Linq; +using Content.Server.Construction; +using Content.Server.GameTicking; +using Content.Server.Radio.EntitySystems; +using Content.Shared.Examine; +using Content.Shared.Interaction; +using Content.Shared.Popups; +using Content.Shared.Radio; +using Content.Shared.M_Emp; +using Robust.Server.GameObjects; +using Robust.Shared.Configuration; +using Robust.Shared.Map; +using Robust.Shared.Player; +using Robust.Shared.Prototypes; +using Robust.Shared.Random; +using Robust.Shared.Utility; +using Content.Server.Chat.Managers; +using Content.Server.Parallax; +using Content.Server.Procedural; +using Content.Server.Shuttles.Systems; +using Content.Server.Station.Systems; +using Content.Shared.CCVar; +using Content.Shared.Random; +using Content.Shared.Random.Helpers; +using Robust.Server.Maps; +using Robust.Shared.Map.Components; +using Robust.Shared.Timing; + +namespace Content.Server.M_Emp +{ + public sealed partial class M_EmpSystem : EntitySystem + { + [Dependency] private readonly IChatManager _chat = default!; + [Dependency] private readonly IConfigurationManager _configurationManager = default!; + [Dependency] private readonly IGameTiming _timing = default!; + [Dependency] private readonly IMapManager _mapManager = default!; + [Dependency] private readonly IPrototypeManager _prototypeManager = default!; + [Dependency] private readonly IRobustRandom _random = default!; + [Dependency] private readonly ITileDefinitionManager _tileDefManager = default!; + [Dependency] private readonly BiomeSystem _biome = default!; + [Dependency] private readonly DungeonSystem _dungeon = default!; + [Dependency] private readonly MapLoaderSystem _map = default!; + [Dependency] private readonly SharedPopupSystem _popupSystem = default!; + [Dependency] private readonly RadioSystem _radioSystem = default!; + [Dependency] private readonly SharedAppearanceSystem _appearanceSystem = default!; + [Dependency] private readonly SharedAudioSystem _audio = default!; + [Dependency] private readonly SharedTransformSystem _transform = default!; + [Dependency] private readonly ShuttleSystem _shuttle = default!; + [Dependency] private readonly ShuttleConsoleSystem _shuttleConsoles = default!; + [Dependency] private readonly StationSystem _station = default!; + [Dependency] private readonly UserInterfaceSystem _ui = default!; + + // TODO: This is probably not compatible with multi-station + private readonly Dictionary _M_EmpGridStates = new(); + + public override void Initialize() + { + base.Initialize(); + + SubscribeLocalEvent(OnInteractHand); + SubscribeLocalEvent(OnRefreshParts); + SubscribeLocalEvent(OnUpgradeExamine); + SubscribeLocalEvent(OnExamined); +// SubscribeLocalEvent(OnGeneratorRemoval); +// SubscribeLocalEvent(OnGridRemoval); + + // Can't use RoundRestartCleanupEvent, I need to clean up before the grid, and components are gone to prevent the announcements + SubscribeLocalEvent(OnRoundEnd); + +// InitializeExpeditions(); +// InitializeRunner(); + } + + public override void Shutdown() + { + base.Shutdown(); +// ShutdownExpeditions(); + } + + private void OnRoundEnd(GameRunLevelChangedEvent ev) + { + if(ev.New != GameRunLevel.InRound) + { + // _M_EmpGridStates.Clear(); + } + } + + private void UpdateAppearance(EntityUid uid, M_EmpGeneratorComponent? component = null) + { + if (!Resolve(uid, ref component, false)) + return; + + _appearanceSystem.SetData(uid, M_EmpGeneratorVisuals.ReadyBlinking, component.GeneratorState.StateType == GeneratorStateType.Attaching); + _appearanceSystem.SetData(uid, M_EmpGeneratorVisuals.Ready, component.GeneratorState.StateType == GeneratorStateType.Holding); + _appearanceSystem.SetData(uid, M_EmpGeneratorVisuals.Unready, component.GeneratorState.StateType == GeneratorStateType.CoolingDown); + _appearanceSystem.SetData(uid, M_EmpGeneratorVisuals.UnreadyBlinking, component.GeneratorState.StateType == GeneratorStateType.Detaching); + } + + private void UpdateChargeStateAppearance(EntityUid uid, TimeSpan currentTime, M_EmpGeneratorComponent? component = null) + { + if (!Resolve(uid, ref component, false)) + return; + + var timeLeft = Convert.ToInt32(component.GeneratorState.Until.TotalSeconds - currentTime.TotalSeconds); + + component.ChargeRemaining = component.GeneratorState.StateType switch + { + GeneratorStateType.Inactive => 5, + GeneratorStateType.Holding => timeLeft / (Convert.ToInt32(component.HoldTime.TotalSeconds) / component.ChargeCapacity) + 1, + GeneratorStateType.Detaching => 0, + GeneratorStateType.CoolingDown => component.ChargeCapacity - timeLeft / (Convert.ToInt32(component.CooldownTime.TotalSeconds) / component.ChargeCapacity) - 1, + _ => component.ChargeRemaining + }; + + if (component.PreviousCharge == component.ChargeRemaining) + return; + _appearanceSystem.SetData(uid, M_EmpGeneratorVisuals.ChargeState, component.ChargeRemaining); + component.PreviousCharge = component.ChargeRemaining; + } + +// private void OnGridRemoval(GridRemovalEvent ev) +// { +// // If we ever want to give generators names, and announce them individually, we would need to loop this, before removing it. +// if (_M_EmpGridStates.Remove(ev.EntityUid)) +// { +// if (TryComp(ev.EntityUid, out var salvComp) && +// TryComp(salvComp.SpawnerGenerator, out var generator)) +// Report(salvComp.SpawnerGenerator.Value, generator.M_EmpChannel, "M_Emp-system-announcement-spawn-generator-lost"); +// // For the very unlikely possibility that the M_Emp generator was on a M_Emp, we will not return here +// } +// foreach(var gridState in _M_EmpGridStates) +// { +// foreach(var generator in gridState.Value.ActiveGenerators) +// { +// if (!TryComp(generator, out var generatorComponent)) +// continue; + +// if (generatorComponent.AttachedEntity != ev.EntityUid) +// continue; +// generatorComponent.AttachedEntity = null; +// generatorComponent.GeneratorState = GeneratorState.Inactive; +// return; +// } +// } +// } + +// private void OnGeneratorRemoval(EntityUid uid, M_EmpGeneratorComponent component, ComponentShutdown args) +// { +// if (component.GeneratorState.StateType == GeneratorStateType.Inactive) +// return; +// +// var generatorTranform = Transform(uid); +// if (generatorTranform.GridUid is not { } gridId || !_M_EmpGridStates.TryGetValue(gridId, out var M_EmpGridState)) +// return; +// +// M_EmpGridState.ActiveGenerators.Remove(uid); +// Report(uid, component.M_EmpChannel, "M_Emp-system-announcement-spawn-generator-lost"); +// if (component.AttachedEntity.HasValue) +// { +// SafeDeleteM_Emp(component.AttachedEntity.Value); +// component.AttachedEntity = null; +// Report(uid, component.M_EmpChannel, "M_Emp-system-announcement-lost"); +// } +// else if (component.GeneratorState is { StateType: GeneratorStateType.Attaching }) +// { +// Report(uid, component.M_EmpChannel, "M_Emp-system-announcement-spawn-no-debris-available"); +// } +// +// component.GeneratorState = GeneratorState.Inactive; +// } + + private void OnRefreshParts(EntityUid uid, M_EmpGeneratorComponent component, RefreshPartsEvent args) + { + var rating = args.PartRatings[component.MachinePartDelay] - 1; + var factor = MathF.Pow(component.PartRatingDelay, rating); + component.AttachingTime = component.BaseAttachingTime * factor; + component.CooldownTime = component.BaseCooldownTime * factor; + } + + private void OnUpgradeExamine(EntityUid uid, M_EmpGeneratorComponent component, UpgradeExamineEvent args) + { + args.AddPercentageUpgrade("m_emp-system-generator-delay-upgrade", (float) (component.CooldownTime / component.BaseCooldownTime)); + } + + private void OnExamined(EntityUid uid, M_EmpGeneratorComponent component, ExaminedEvent args) + { + if (!args.IsInDetailsRange) + return; + + var gotGrid = false; + var remainingTime = TimeSpan.Zero; + +// if (Transform(uid).GridUid is { } gridId && +// _M_EmpGridStates.TryGetValue(gridId, out var M_EmpGridState)) +// { +// remainingTime = component.GeneratorState.Until - M_EmpGridState.CurrentTime; +// gotGrid = true; +// } +// else +// { +// Log.Warning("Failed to load M_Emp grid state, can't display remaining time"); +// } + + switch (component.GeneratorState.StateType) + { + case GeneratorStateType.Inactive: + args.PushMarkup(Loc.GetString("m_emp-system-generator-examined-inactive")); + break; + case GeneratorStateType.Attaching: + args.PushMarkup(Loc.GetString("m_emp-system-generator-examined-pulling-in")); + break; + case GeneratorStateType.Detaching: + args.PushMarkup(Loc.GetString("m_emp-system-generator-examined-releasing")); + break; + case GeneratorStateType.CoolingDown: + if (gotGrid) + args.PushMarkup(Loc.GetString("m_emp-system-generator-examined-cooling-down", ("timeLeft", Math.Ceiling(remainingTime.TotalSeconds)))); + break; + case GeneratorStateType.Holding: + if (gotGrid) + args.PushMarkup(Loc.GetString("m_emp-system-generator-examined-active", ("timeLeft", Math.Ceiling(remainingTime.TotalSeconds)))); + break; + default: + throw new ArgumentOutOfRangeException(); + } + } + + private void OnInteractHand(EntityUid uid, M_EmpGeneratorComponent component, InteractHandEvent args) + { + if (args.Handled) + return; + args.Handled = true; + StartGenerator(uid, component, args.User); + UpdateAppearance(uid, component); + } + + private void StartGenerator(EntityUid uid, M_EmpGeneratorComponent component, EntityUid user) + { + switch (component.GeneratorState.StateType) + { + case GeneratorStateType.Inactive: + ShowPopup(uid, "m_emp-system-report-activate-success", user); + var generatorTransform = Transform(uid); + var gridId = generatorTransform.GridUid ?? throw new InvalidOperationException("Generator had no grid associated"); + if (!_M_EmpGridStates.TryGetValue(gridId, out var gridState)) + { + gridState = new M_EmpGridState(); + _M_EmpGridStates[gridId] = gridState; + } + gridState.ActiveGenerators.Add(uid); + component.GeneratorState = new GeneratorState(GeneratorStateType.Attaching, gridState.CurrentTime + component.AttachingTime); + RaiseLocalEvent(new M_EmpGeneratorActivatedEvent(uid)); + Report(uid, component.M_EmpChannel, "m_emp-system-report-activate-success"); + break; + case GeneratorStateType.Attaching: + case GeneratorStateType.Holding: + ShowPopup(uid, "m_emp-system-report-already-active", user); + break; + case GeneratorStateType.Detaching: + case GeneratorStateType.CoolingDown: + ShowPopup(uid, "m_emp-system-report-cooling-down", user); + break; + default: + throw new ArgumentOutOfRangeException(); + } + } + private void ShowPopup(EntityUid uid, string messageKey, EntityUid user) + { + _popupSystem.PopupEntity(Loc.GetString(messageKey), uid, user); + } + + private void Report(EntityUid source, string channelName, string messageKey, params (string, object)[] args) + { + var message = args.Length == 0 ? Loc.GetString(messageKey) : Loc.GetString(messageKey, args); + var channel = _prototypeManager.Index(channelName); + _radioSystem.SendRadioMessage(source, message, channel, source); + } + + private void Transition(EntityUid uid, M_EmpGeneratorComponent generator, TimeSpan currentTime) + { + switch (generator.GeneratorState.StateType) + { + case GeneratorStateType.Attaching: +// if (SpawnM_Emp(uid, generator)) +// { +// generator.GeneratorState = new GeneratorState(GeneratorStateType.Holding, currentTime + generator.HoldTime); +// } +// else +// { +// generator.GeneratorState = new GeneratorState(GeneratorStateType.CoolingDown, currentTime + generator.CooldownTime); +// } + break; + case GeneratorStateType.Holding: + Report(uid, generator.M_EmpChannel, "m_emp-system-announcement-losing", ("timeLeft", generator.DetachingTime.TotalSeconds)); + generator.GeneratorState = new GeneratorState(GeneratorStateType.Detaching, currentTime + generator.DetachingTime); + break; + case GeneratorStateType.Detaching: + // if (generator.AttachedEntity.HasValue) + // { + // SafeDeleteM_Emp(generator.AttachedEntity.Value); + // } + // else + // { + // Log.Error("M_Emp detaching was expecting attached entity but it was null"); + // } + Report(uid, generator.M_EmpChannel, "m_emp-system-announcement-lost"); + generator.GeneratorState = new GeneratorState(GeneratorStateType.CoolingDown, currentTime + generator.CooldownTime); + break; + case GeneratorStateType.CoolingDown: + generator.GeneratorState = GeneratorState.Inactive; + break; + } + UpdateAppearance(uid, generator); + UpdateChargeStateAppearance(uid, currentTime, generator); + } + + public override void Update(float frameTime) + { + var secondsPassed = TimeSpan.FromSeconds(frameTime); + // Keep track of time, and state per grid + foreach (var (uid, state) in _M_EmpGridStates) + { + if (state.ActiveGenerators.Count == 0) continue; + // Not handling the case where the M_Emp we spawned got paused + // They both need to be paused, or it doesn't make sense + if (MetaData(uid).EntityPaused) continue; + state.CurrentTime += secondsPassed; + + var deleteQueue = new RemQueue(); + + foreach(var generator in state.ActiveGenerators) + { + if (!TryComp(generator, out var generatorComp)) + continue; + + UpdateChargeStateAppearance(generator, state.CurrentTime, generatorComp); + if (generatorComp.GeneratorState.Until > state.CurrentTime) continue; + Transition(generator, generatorComp, state.CurrentTime); + if (generatorComp.GeneratorState.StateType == GeneratorStateType.Inactive) + { + deleteQueue.Add(generator); + } + } + + foreach(var generator in deleteQueue) + { + state.ActiveGenerators.Remove(generator); + } + } + +// UpdateExpeditions(); +// UpdateRunner(); + } + } + + public sealed class M_EmpGridState + { + public TimeSpan CurrentTime { get; set; } + public List ActiveGenerators { get; } = new(); + } +} + diff --git a/Content.Shared/Salvage/SharedM_EmpGeneratorComponent.cs b/Content.Shared/Salvage/SharedM_EmpGeneratorComponent.cs new file mode 100644 index 00000000000..5a932c196c3 --- /dev/null +++ b/Content.Shared/Salvage/SharedM_EmpGeneratorComponent.cs @@ -0,0 +1,31 @@ +using Content.Shared.Construction.Prototypes; +using Robust.Shared.Prototypes; +using Robust.Shared.Serialization; +using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; + +namespace Content.Shared.M_Emp; + +public abstract class SharedM_EmpGeneratorComponent : Component +{ + /// + /// The machine part that affects the attaching and cooldown times + /// + [DataField("machinePartDelay", customTypeSerializer: typeof(PrototypeIdSerializer)), ViewVariables(VVAccess.ReadWrite)] + public string MachinePartDelay = "Capacitor"; + + /// + /// A multiplier applied to the attaching and cooldown times for each level of + /// + [DataField("partRatingDelay"), ViewVariables(VVAccess.ReadWrite)] + public float PartRatingDelay = 0.75f; +} + +[Serializable, NetSerializable] +public enum M_EmpGeneratorVisuals : byte +{ + ChargeState, + Ready, + ReadyBlinking, + Unready, + UnreadyBlinking +} diff --git a/Content.Shared/Salvage/SharedM_EmpSystem.cs.old b/Content.Shared/Salvage/SharedM_EmpSystem.cs.old new file mode 100644 index 00000000000..8758722f338 --- /dev/null +++ b/Content.Shared/Salvage/SharedM_EmpSystem.cs.old @@ -0,0 +1,16 @@ +using System.Linq; +using Content.Shared.Dataset; +using Content.Shared.Random; +using Content.Shared.Random.Helpers; +using Robust.Shared.Prototypes; +using Robust.Shared.Random; +using Robust.Shared.Serialization; +using Robust.Shared.Utility; + +namespace Content.Shared.M_Emp; + +public abstract class SharedM_EmpSystem : EntitySystem +{ + [Dependency] private readonly ILocalizationManager _loc = default!; + [Dependency] private readonly IPrototypeManager _proto = default!; +} diff --git a/Resources/Locale/en-US/m_emp/m_emp-system.ftl b/Resources/Locale/en-US/m_emp/m_emp-system.ftl new file mode 100644 index 00000000000..c6306d093d9 --- /dev/null +++ b/Resources/Locale/en-US/m_emp/m_emp-system.ftl @@ -0,0 +1,23 @@ +m_emp-system-announcement-source = Salvage Control System +m_emp-system-announcement-arrived = A piece of salvagable debris has been pulled in. Estimated hold time: {$timeLeft} seconds. +m_emp-system-announcement-losing = The generator is no longer able to hold the salvagable debris. Estimated time until loss: {$timeLeft} seconds. +m_emp-system-announcement-lost = The salvagable debris have been lost. + +m_emp-system-announcement-spawn-generator-lost = The M_EMP Generator has been lost. +m_emp-system-announcement-spawn-no-debris-available = No debris could be recovered by the M_EMP Generator. +m_emp-system-announcement-spawn-debris-disintegrated = Debris disintegrated during orbital transfer. + +m_emp-system-report-already-active = The M_EMP Generator is already active. +m_emp-system-report-cooling-down = The M_EMP Generator is cooling down. +m_emp-system-report-activate-success = The M_EMP Generator on MAP at location is starting up! + +m_emp-system-generator-examined-inactive = The M_EMP Generator is inactive. +m_emp-system-generator-examined-pulling-in = The M_EMP Generator is attempting to pull in m_emp. +m_emp-system-generator-examined-active = The M_EMP Generator is holding m_emp in place. Can hold for { $timeLeft -> + [1] one second. + *[other] { $timeLeft } seconds. +} +m_emp-system-generator-examined-releasing = The M_EMP Generator is releasing the m_emp. +m_emp-system-generator-examined-cooling-down = The M_EMP Generator is cooling down. It will be ready in: {$timeLeft} seconds. +m_emp-system-generator-delay-upgrade = Attaching/cooldown delay + diff --git a/Resources/Prototypes/Entities/Objects/Devices/Circuitboards/Machine/production.yml b/Resources/Prototypes/Entities/Objects/Devices/Circuitboards/Machine/production.yml index 505402f58a2..5a0d520b400 100644 --- a/Resources/Prototypes/Entities/Objects/Devices/Circuitboards/Machine/production.yml +++ b/Resources/Prototypes/Entities/Objects/Devices/Circuitboards/Machine/production.yml @@ -931,12 +931,12 @@ - type: entity parent: BaseMachineCircuitboard - id: EMPGeneratorMachineCircuitboard - name: emp generator machine board - description: A machine printed circuit board for a emp generator. + id: M_EmpMachineCircuitboard + name: M_EMP Generator machine board + description: A machine printed circuit board for a mobile EMP generator. components: - type: MachineBoard - prototype: EMPGenerator + prototype: M_Emp requirements: Capacitor: 4 materialRequirements: diff --git a/Resources/Prototypes/Entities/Structures/Machines/emp.yml b/Resources/Prototypes/Entities/Structures/Machines/emp.yml deleted file mode 100644 index 1033e07f4e7..00000000000 --- a/Resources/Prototypes/Entities/Structures/Machines/emp.yml +++ /dev/null @@ -1,66 +0,0 @@ -- type: entity - parent: [ BaseMachinePowered, ConstructibleMachine ] - id: EmpGenerator - name: emp generator - description: Generate EMP blast. - components: - - type: Sprite - sprite: Structures/Machines/emp_generator.rsi - layers: - - state: emp-generator - - state: emp-generator-ready - visible: false - map: [ "ready" ] - - state: emp-generator-ready-blinking - visible: false - map: [ "readyBlinking" ] - - state: emp-generator-unready - visible: false - map: [ "unready" ] - - state: emp-generator-unready-blinking - visible: false - map: [ "unreadyBlinking" ] - - state: emp-generator-o4 - map: ["chargeState"] - shader: unshaded - - type: Appearance - - type: GenericVisualizer - visuals: - enum.SalvageMagnetVisuals.ChargeState: - chargeState: - 0: { state: emp-generator-o0, shader: "unshaded", visible: false } - 1: { state: emp-generator-o0, shader: "unshaded", visible: true } - 2: { state: emp-generator-o1, shader: "unshaded", visible: true } - 3: { state: emp-generator-o2, shader: "unshaded", visible: true } - 4: { state: emp-generator-o3, shader: "unshaded", visible: true } - 5: { state: emp-generator-o4, shader: "unshaded", visible: true } - enum.SalvageMagnetVisuals.Ready: - ready: - False: { state: emp-generator-ready, visible: false, shader: "unshaded" } - True: { state: emp-generator-ready, visible: true, shader: "unshaded" } - enum.SalvageMagnetVisuals.ReadyBlinking: - readyBlinking: - False: { state: emp-generator-ready-blinking, visible: false, shader: "unshaded" } - True: { state: emp-generator-ready-blinking, visible: true, shader: "unshaded" } - enum.SalvageMagnetVisuals.Unready: - unready: - False: { state: emp-generator-unready, visible: false, shader: "unshaded" } - True: { state: emp-generator-unready, visible: true, shader: "unshaded" } - enum.SalvageMagnetVisuals.UnreadyBlinking: - unreadyBlinking: - False: { state: emp-generator-unready-blinking, visible: false, shader: "unshaded" } - True: { state: emp-generator-unready-blinking, visible: true, shader: "unshaded" } - - type: Rotatable - - type: Transform - noRot: false - - type: IntrinsicRadioReceiver - - type: ActiveRadio - channels: - - Security -# - type: SalvageMagnet -# - type: EmpGenerator - - type: ApcPowerReceiver - powerLoad: 100 # TODO change this to a HV power draw that really hits the grid hard WHEN active -# powerLoad: 2500 # TODO change this to a HV power draw that really hits the grid hard WHEN active - - type: Machine - board: EMPGeneratorMachineCircuitboard \ No newline at end of file diff --git a/Resources/Prototypes/Entities/Structures/Machines/m_emp.yml b/Resources/Prototypes/Entities/Structures/Machines/m_emp.yml new file mode 100644 index 00000000000..7c133ce2d10 --- /dev/null +++ b/Resources/Prototypes/Entities/Structures/Machines/m_emp.yml @@ -0,0 +1,64 @@ +- type: entity + parent: [ BaseMachinePowered, ConstructibleMachine ] + id: M_Emp + name: M_EMP Generator + description: Mobile EMP generator. + components: + - type: Sprite + sprite: Structures/Machines/m_emp.rsi + layers: + - state: m_emp + - state: m_emp-ready + visible: false + map: [ "ready" ] + - state: m_emp-ready-blinking + visible: false + map: [ "readyBlinking" ] + - state: m_emp-unready + visible: false + map: [ "unready" ] + - state: m_emp-unready-blinking + visible: false + map: [ "unreadyBlinking" ] + - state: m_emp-o4 + map: ["chargeState"] + shader: unshaded + - type: Appearance + - type: GenericVisualizer + visuals: + enum.M_EmpGeneratorVisuals.ChargeState: + chargeState: + 0: { state: m_emp-o0, shader: "unshaded", visible: false } + 1: { state: m_emp-o0, shader: "unshaded", visible: true } + 2: { state: m_emp-o1, shader: "unshaded", visible: true } + 3: { state: m_emp-o2, shader: "unshaded", visible: true } + 4: { state: m_emp-o3, shader: "unshaded", visible: true } + 5: { state: m_emp-o4, shader: "unshaded", visible: true } + enum.M_EmpGeneratorVisuals.Ready: + ready: + False: { state: m_emp-ready, visible: false, shader: "unshaded" } + True: { state: m_emp-ready, visible: true, shader: "unshaded" } + enum.M_EmpGeneratorVisuals.ReadyBlinking: + readyBlinking: + False: { state: m_emp-ready-blinking, visible: false, shader: "unshaded" } + True: { state: m_emp-ready-blinking, visible: true, shader: "unshaded" } + enum.M_EmpGeneratorVisuals.Unready: + unready: + False: { state: m_emp-unready, visible: false, shader: "unshaded" } + True: { state: m_emp-unready, visible: true, shader: "unshaded" } + enum.M_EmpGeneratorVisuals.UnreadyBlinking: + unreadyBlinking: + False: { state: m_emp-unready-blinking, visible: false, shader: "unshaded" } + True: { state: m_emp-unready-blinking, visible: true, shader: "unshaded" } + - type: Rotatable + - type: Transform + noRot: false + - type: IntrinsicRadioReceiver + - type: ActiveRadio + channels: + - Security + - type: M_EmpGenerator + - type: ApcPowerReceiver + powerLoad: 100 # TODO change this to a HV power draw that really hits the grid hard WHEN active + - type: Machine + board: M_EmpMachineCircuitboard \ No newline at end of file diff --git a/Resources/Textures/Structures/Machines/emp_generator.rsi/emp-generator-o0.png b/Resources/Textures/Structures/Machines/m_emp.rsi/m_emp-o0.png similarity index 100% rename from Resources/Textures/Structures/Machines/emp_generator.rsi/emp-generator-o0.png rename to Resources/Textures/Structures/Machines/m_emp.rsi/m_emp-o0.png diff --git a/Resources/Textures/Structures/Machines/emp_generator.rsi/emp-generator-o1.png b/Resources/Textures/Structures/Machines/m_emp.rsi/m_emp-o1.png similarity index 100% rename from Resources/Textures/Structures/Machines/emp_generator.rsi/emp-generator-o1.png rename to Resources/Textures/Structures/Machines/m_emp.rsi/m_emp-o1.png diff --git a/Resources/Textures/Structures/Machines/emp_generator.rsi/emp-generator-o2.png b/Resources/Textures/Structures/Machines/m_emp.rsi/m_emp-o2.png similarity index 100% rename from Resources/Textures/Structures/Machines/emp_generator.rsi/emp-generator-o2.png rename to Resources/Textures/Structures/Machines/m_emp.rsi/m_emp-o2.png diff --git a/Resources/Textures/Structures/Machines/emp_generator.rsi/emp-generator-o3.png b/Resources/Textures/Structures/Machines/m_emp.rsi/m_emp-o3.png similarity index 100% rename from Resources/Textures/Structures/Machines/emp_generator.rsi/emp-generator-o3.png rename to Resources/Textures/Structures/Machines/m_emp.rsi/m_emp-o3.png diff --git a/Resources/Textures/Structures/Machines/emp_generator.rsi/emp-generator-o4.png b/Resources/Textures/Structures/Machines/m_emp.rsi/m_emp-o4.png similarity index 100% rename from Resources/Textures/Structures/Machines/emp_generator.rsi/emp-generator-o4.png rename to Resources/Textures/Structures/Machines/m_emp.rsi/m_emp-o4.png diff --git a/Resources/Textures/Structures/Machines/emp_generator.rsi/emp-generator-ready-blinking.png b/Resources/Textures/Structures/Machines/m_emp.rsi/m_emp-ready-blinking.png similarity index 100% rename from Resources/Textures/Structures/Machines/emp_generator.rsi/emp-generator-ready-blinking.png rename to Resources/Textures/Structures/Machines/m_emp.rsi/m_emp-ready-blinking.png diff --git a/Resources/Textures/Structures/Machines/emp_generator.rsi/emp-generator-ready.png b/Resources/Textures/Structures/Machines/m_emp.rsi/m_emp-ready.png similarity index 100% rename from Resources/Textures/Structures/Machines/emp_generator.rsi/emp-generator-ready.png rename to Resources/Textures/Structures/Machines/m_emp.rsi/m_emp-ready.png diff --git a/Resources/Textures/Structures/Machines/emp_generator.rsi/emp-generator-unready-blinking.png b/Resources/Textures/Structures/Machines/m_emp.rsi/m_emp-unready-blinking.png similarity index 100% rename from Resources/Textures/Structures/Machines/emp_generator.rsi/emp-generator-unready-blinking.png rename to Resources/Textures/Structures/Machines/m_emp.rsi/m_emp-unready-blinking.png diff --git a/Resources/Textures/Structures/Machines/emp_generator.rsi/emp-generator-unready.png b/Resources/Textures/Structures/Machines/m_emp.rsi/m_emp-unready.png similarity index 100% rename from Resources/Textures/Structures/Machines/emp_generator.rsi/emp-generator-unready.png rename to Resources/Textures/Structures/Machines/m_emp.rsi/m_emp-unready.png diff --git a/Resources/Textures/Structures/Machines/emp_generator.rsi/emp-generator.png b/Resources/Textures/Structures/Machines/m_emp.rsi/m_emp.png similarity index 100% rename from Resources/Textures/Structures/Machines/emp_generator.rsi/emp-generator.png rename to Resources/Textures/Structures/Machines/m_emp.rsi/m_emp.png diff --git a/Resources/Textures/Structures/Machines/emp_generator.rsi/meta.json b/Resources/Textures/Structures/Machines/m_emp.rsi/meta.json similarity index 77% rename from Resources/Textures/Structures/Machines/emp_generator.rsi/meta.json rename to Resources/Textures/Structures/Machines/m_emp.rsi/meta.json index 48781e2ef27..5eca3207be8 100644 --- a/Resources/Textures/Structures/Machines/emp_generator.rsi/meta.json +++ b/Resources/Textures/Structures/Machines/m_emp.rsi/meta.json @@ -8,42 +8,42 @@ }, "states": [ { - "name": "emp-generator", + "name": "m_emp", "directions": 4 }, { - "name": "emp-generator-o0", + "name": "m_emp-o0", "directions": 4, "commentary": "o0 - 04 represent the amount of time remaining during EMP and cooldown." }, { - "name": "emp-generator-o1", + "name": "m_emp-o1", "directions": 4 }, { - "name": "emp-generator-o2", + "name": "m_emp-o2", "directions": 4 }, { - "name": "emp-generator-o3", + "name": "m_emp-o3", "directions": 4 }, { - "name": "emp-generator-o4", + "name": "m_emp-o4", "directions": 4 }, { - "name": "emp-generator-unready", + "name": "m_emp-unready", "directions": 4, "commentary": "Cooldown state" }, { - "name": "emp-generator-ready", + "name": "m_emp-ready", "directions": 4, "commentary": "EMP state" }, { - "name": "emp-generator-ready-blinking", + "name": "m_emp-ready-blinking", "directions": 4, "delays": [ [ 0.2, 0.2], @@ -54,7 +54,7 @@ "commentary": "EMP active state" }, { - "name": "emp-generator-unready-blinking", + "name": "m_emp-unready-blinking", "directions": 4, "delays": [ [ 0.2, 0.2], From f5bb7633a754e4ddf49b0b0aeb590a2e907ec120 Mon Sep 17 00:00:00 2001 From: Dvir Date: Mon, 24 Jul 2023 21:24:49 +0300 Subject: [PATCH 07/16] EMP --- .../M_Emp}/M_EmpGeneratorComponent.cs | 2 +- Content.Server/Emp/EmpIgnoreComponent.cs | 12 ++ Content.Server/Emp/EmpSystem.cs | 7 + .../Light/EntitySystems/PoweredLightSystem.cs | 4 +- .../Power/EntitySystems/ApcSystem.cs | 15 +- .../M_Emp}/M_EmpGeneratorComponent.cs | 41 +--- .../M_Emp}/M_EmpGridComponent.cs | 2 +- .../{Salvage => _NF/M_Emp}/M_EmpSystem.cs | 180 ++++++++---------- .../M_Emp}/SharedM_EmpGeneratorComponent.cs | 2 +- .../M_Emp/SharedM_EmpSystem.cs} | 2 +- Resources/Locale/en-US/m_emp/m_emp-system.ftl | 14 +- .../_NF/Entities/Structures/Power/apc.yml | 10 + 12 files changed, 145 insertions(+), 146 deletions(-) rename Content.Client/{Salvage => _NF/M_Emp}/M_EmpGeneratorComponent.cs (82%) create mode 100644 Content.Server/Emp/EmpIgnoreComponent.cs rename Content.Server/{Salvage => _NF/M_Emp}/M_EmpGeneratorComponent.cs (71%) rename Content.Server/{Salvage => _NF/M_Emp}/M_EmpGridComponent.cs (89%) rename Content.Server/{Salvage => _NF/M_Emp}/M_EmpSystem.cs (71%) rename Content.Shared/{Salvage => _NF/M_Emp}/SharedM_EmpGeneratorComponent.cs (96%) rename Content.Shared/{Salvage/SharedM_EmpSystem.cs.old => _NF/M_Emp/SharedM_EmpSystem.cs} (92%) create mode 100644 Resources/Prototypes/_NF/Entities/Structures/Power/apc.yml diff --git a/Content.Client/Salvage/M_EmpGeneratorComponent.cs b/Content.Client/_NF/M_Emp/M_EmpGeneratorComponent.cs similarity index 82% rename from Content.Client/Salvage/M_EmpGeneratorComponent.cs rename to Content.Client/_NF/M_Emp/M_EmpGeneratorComponent.cs index 93ab39118b3..dd6d3dfa14d 100644 --- a/Content.Client/Salvage/M_EmpGeneratorComponent.cs +++ b/Content.Client/_NF/M_Emp/M_EmpGeneratorComponent.cs @@ -1,4 +1,4 @@ -using Content.Shared.M_Emp; +using Content.Shared._NF.M_Emp; using Robust.Shared.GameStates; [NetworkedComponent, RegisterComponent] diff --git a/Content.Server/Emp/EmpIgnoreComponent.cs b/Content.Server/Emp/EmpIgnoreComponent.cs new file mode 100644 index 00000000000..b5c94652976 --- /dev/null +++ b/Content.Server/Emp/EmpIgnoreComponent.cs @@ -0,0 +1,12 @@ +namespace Content.Server.Emp; + +/// +/// Upon being triggered will EMP area around it. +/// +[RegisterComponent] +[Access(typeof(EmpSystem))] +public sealed class EmpIgnoreComponent : Component +{ + [DataField("IgnoreEmp"), ViewVariables(VVAccess.ReadWrite)] + public float IgnoreEmp = "true"; +} diff --git a/Content.Server/Emp/EmpSystem.cs b/Content.Server/Emp/EmpSystem.cs index b327f086db0..6626c5347e5 100644 --- a/Content.Server/Emp/EmpSystem.cs +++ b/Content.Server/Emp/EmpSystem.cs @@ -1,3 +1,4 @@ +using Content.Server.Entry; using Content.Server.Explosion.EntitySystems; using Content.Server.Power.EntitySystems; using Content.Server.Radio; @@ -20,6 +21,7 @@ public override void Initialize() SubscribeLocalEvent(OnUnpaused); SubscribeLocalEvent(OnExamine); SubscribeLocalEvent(HandleEmpTrigger); + SubscribeLocalEvent(IgnoreEMP); SubscribeLocalEvent(OnRadioSendAttempt); SubscribeLocalEvent(OnRadioReceiveAttempt); @@ -79,6 +81,11 @@ private void HandleEmpTrigger(EntityUid uid, EmpOnTriggerComponent comp, Trigger args.Handled = true; } + private void HandleEmpTrigger(EntityUid uid, EmpIgnoreComponent comp, IgnoreEMP args) + { + args.Ignored = true; + } + private void OnRadioSendAttempt(EntityUid uid, EmpDisabledComponent component, ref RadioSendAttemptEvent args) { args.Cancelled = true; diff --git a/Content.Server/Light/EntitySystems/PoweredLightSystem.cs b/Content.Server/Light/EntitySystems/PoweredLightSystem.cs index bac13274ea7..3a0dc3ee8ce 100644 --- a/Content.Server/Light/EntitySystems/PoweredLightSystem.cs +++ b/Content.Server/Light/EntitySystems/PoweredLightSystem.cs @@ -429,8 +429,8 @@ private void OnDoAfter(EntityUid uid, PoweredLightComponent component, DoAfterEv private void OnEmpPulse(EntityUid uid, PoweredLightComponent component, ref EmpPulseEvent args) { - if (TryDestroyBulb(uid, component)) - args.Affected = true; + // if (TryDestroyBulb(uid, component)) // Make it so EMP isnt exploding lights + // args.Affected = true; // Make it so EMP isnt exploding lights } } } diff --git a/Content.Server/Power/EntitySystems/ApcSystem.cs b/Content.Server/Power/EntitySystems/ApcSystem.cs index 4df8c33c5b6..03f287e14cd 100644 --- a/Content.Server/Power/EntitySystems/ApcSystem.cs +++ b/Content.Server/Power/EntitySystems/ApcSystem.cs @@ -13,6 +13,7 @@ using Robust.Server.GameObjects; using Robust.Shared.Audio; using Robust.Shared.Timing; +using Content.Server.EmpIgnore.Component; namespace Content.Server.Power.EntitySystems { @@ -25,6 +26,7 @@ internal sealed class ApcSystem : EntitySystem [Dependency] private readonly IGameTiming _gameTiming = default!; [Dependency] private readonly SharedAppearanceSystem _appearance = default!; [Dependency] private readonly SharedAudioSystem _audio = default!; + [Dependency] private readonly EmpIgnoreComponent _EmpIgnore = default!; public override void Initialize() { @@ -201,13 +203,16 @@ private ApcExternalPowerState CalcExtPowerState(EntityUid uid, PowerState.Batter return ApcExternalPowerState.Good; } - private void OnEmpPulse(EntityUid uid, ApcComponent component, ref EmpPulseEvent args) + private void OnEmpPulse(EntityUid uid, ApcComponent component, ref EmpPulseEvent args, ref EmpIgnore args) { - if (component.MainBreakerEnabled) + if (component.EmpIgnore) { - args.Affected = true; - args.Disabled = true; - ApcToggleBreaker(uid, component); + if (component.MainBreakerEnabled) + { + args.Affected = true; + args.Disabled = true; + ApcToggleBreaker(uid, component); + } } } } diff --git a/Content.Server/Salvage/M_EmpGeneratorComponent.cs b/Content.Server/_NF/M_Emp/M_EmpGeneratorComponent.cs similarity index 71% rename from Content.Server/Salvage/M_EmpGeneratorComponent.cs rename to Content.Server/_NF/M_Emp/M_EmpGeneratorComponent.cs index d5d182d37dc..44ac6bde5ea 100644 --- a/Content.Server/Salvage/M_EmpGeneratorComponent.cs +++ b/Content.Server/_NF/M_Emp/M_EmpGeneratorComponent.cs @@ -1,10 +1,10 @@ using Content.Shared.Radio; using Content.Shared.Random; -using Content.Shared.M_Emp; +using Content.Shared._NF.M_Emp; using Robust.Shared.GameStates; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; -namespace Content.Server.M_Emp +namespace Content.Server._NF.M_Emp { /// /// A M_Emp generator. @@ -13,13 +13,6 @@ namespace Content.Server.M_Emp [Access(typeof(M_EmpSystem))] public sealed class M_EmpGeneratorComponent : SharedM_EmpGeneratorComponent { - /// - /// The entity attached to the generator - /// - // [ViewVariables(VVAccess.ReadOnly)] - // [DataField("attachedEntity")] - // public EntityUid? AttachedEntity; - /// /// Current state of this generator /// @@ -31,36 +24,36 @@ public sealed class M_EmpGeneratorComponent : SharedM_EmpGeneratorComponent /// How long it takes for the generator to pull in the debris /// [ViewVariables(VVAccess.ReadWrite)] - [DataField("baseAttachingTime")] - public TimeSpan BaseAttachingTime = TimeSpan.FromSeconds(30); + [DataField("baseActivatingTime")] + public TimeSpan BaseActivatingTime = TimeSpan.FromSeconds(10); /// /// How long it actually takes for the generator to pull in the debris /// [ViewVariables(VVAccess.ReadWrite)] - [DataField("attachingTime")] - public TimeSpan AttachingTime = TimeSpan.FromSeconds(30); + [DataField("activatingTime")] + public TimeSpan ActivatingTime = TimeSpan.FromSeconds(10); /// /// How long the generator can hold the debris until it starts losing the lock /// [ViewVariables(VVAccess.ReadWrite)] [DataField("holdTime")] - public TimeSpan HoldTime = TimeSpan.FromSeconds(240); + public TimeSpan HoldTime = TimeSpan.FromSeconds(60); /// /// How long the generator can hold the debris while losing the lock /// [ViewVariables(VVAccess.ReadWrite)] [DataField("detachingTime")] - public TimeSpan DetachingTime = TimeSpan.FromSeconds(30); + public TimeSpan DetachingTime = TimeSpan.FromSeconds(10); /// /// How long the generator has to cool down for after use /// [ViewVariables(VVAccess.ReadWrite)] [DataField("baseCooldownTime")] - public TimeSpan BaseCooldownTime = TimeSpan.FromSeconds(60); + public TimeSpan BaseCooldownTime = TimeSpan.FromSeconds(10); /// /// How long the generator actually has to cool down for after use @@ -89,20 +82,6 @@ public sealed class M_EmpGeneratorComponent : SharedM_EmpGeneratorComponent /// [DataField("previousCharge")] public int PreviousCharge = 5; - - /// - /// The chance that a random procgen asteroid will be - /// generated rather than a static M_Emp prototype. - /// - // [DataField("asteroidChance"), ViewVariables(VVAccess.ReadWrite)] - // public float AsteroidChance = 0.6f; - - /// - /// A weighted random prototype corresponding to - /// what asteroid entities will be generated. - /// -// [DataField("asteroidPool", customTypeSerializer: typeof(PrototypeIdSerializer)), ViewVariables(VVAccess.ReadWrite)] -// public string AsteroidPool = "RandomAsteroidPool"; } [CopyByRef, DataRecord] @@ -123,7 +102,7 @@ public M_EmpGeneratorActivatedEvent(EntityUid generator) public enum GeneratorStateType { Inactive, - Attaching, + Activating, Holding, Detaching, CoolingDown, diff --git a/Content.Server/Salvage/M_EmpGridComponent.cs b/Content.Server/_NF/M_Emp/M_EmpGridComponent.cs similarity index 89% rename from Content.Server/Salvage/M_EmpGridComponent.cs rename to Content.Server/_NF/M_Emp/M_EmpGridComponent.cs index 90b3eadd766..9e46b73a145 100644 --- a/Content.Server/Salvage/M_EmpGridComponent.cs +++ b/Content.Server/_NF/M_Emp/M_EmpGridComponent.cs @@ -1,4 +1,4 @@ -namespace Content.Server.M_Emp +namespace Content.Server._NF.M_Emp { /// /// A grid spawned by a salvage magnet. diff --git a/Content.Server/Salvage/M_EmpSystem.cs b/Content.Server/_NF/M_Emp/M_EmpSystem.cs similarity index 71% rename from Content.Server/Salvage/M_EmpSystem.cs rename to Content.Server/_NF/M_Emp/M_EmpSystem.cs index 4f5fbefdd22..e6bd435c7d5 100644 --- a/Content.Server/Salvage/M_EmpSystem.cs +++ b/Content.Server/_NF/M_Emp/M_EmpSystem.cs @@ -6,7 +6,7 @@ using Content.Shared.Interaction; using Content.Shared.Popups; using Content.Shared.Radio; -using Content.Shared.M_Emp; +using Content.Shared._NF.M_Emp; using Robust.Server.GameObjects; using Robust.Shared.Configuration; using Robust.Shared.Map; @@ -17,16 +17,13 @@ using Content.Server.Chat.Managers; using Content.Server.Parallax; using Content.Server.Procedural; -using Content.Server.Shuttles.Systems; using Content.Server.Station.Systems; using Content.Shared.CCVar; -using Content.Shared.Random; -using Content.Shared.Random.Helpers; using Robust.Server.Maps; -using Robust.Shared.Map.Components; using Robust.Shared.Timing; +using Content.Server.Emp; -namespace Content.Server.M_Emp +namespace Content.Server._NF.M_Emp { public sealed partial class M_EmpSystem : EntitySystem { @@ -45,10 +42,9 @@ public sealed partial class M_EmpSystem : EntitySystem [Dependency] private readonly SharedAppearanceSystem _appearanceSystem = default!; [Dependency] private readonly SharedAudioSystem _audio = default!; [Dependency] private readonly SharedTransformSystem _transform = default!; - [Dependency] private readonly ShuttleSystem _shuttle = default!; - [Dependency] private readonly ShuttleConsoleSystem _shuttleConsoles = default!; [Dependency] private readonly StationSystem _station = default!; [Dependency] private readonly UserInterfaceSystem _ui = default!; + [Dependency] private readonly EmpSystem _emp = default!; // TODO: This is probably not compatible with multi-station private readonly Dictionary _M_EmpGridStates = new(); @@ -61,8 +57,8 @@ public override void Initialize() SubscribeLocalEvent(OnRefreshParts); SubscribeLocalEvent(OnUpgradeExamine); SubscribeLocalEvent(OnExamined); -// SubscribeLocalEvent(OnGeneratorRemoval); -// SubscribeLocalEvent(OnGridRemoval); + SubscribeLocalEvent(OnGeneratorRemoval); + SubscribeLocalEvent(OnGridRemoval); // Can't use RoundRestartCleanupEvent, I need to clean up before the grid, and components are gone to prevent the announcements SubscribeLocalEvent(OnRoundEnd); @@ -74,14 +70,13 @@ public override void Initialize() public override void Shutdown() { base.Shutdown(); -// ShutdownExpeditions(); } private void OnRoundEnd(GameRunLevelChangedEvent ev) { if(ev.New != GameRunLevel.InRound) { - // _M_EmpGridStates.Clear(); + _M_EmpGridStates.Clear(); } } @@ -90,7 +85,7 @@ private void UpdateAppearance(EntityUid uid, M_EmpGeneratorComponent? component if (!Resolve(uid, ref component, false)) return; - _appearanceSystem.SetData(uid, M_EmpGeneratorVisuals.ReadyBlinking, component.GeneratorState.StateType == GeneratorStateType.Attaching); + _appearanceSystem.SetData(uid, M_EmpGeneratorVisuals.ReadyBlinking, component.GeneratorState.StateType == GeneratorStateType.Activating); _appearanceSystem.SetData(uid, M_EmpGeneratorVisuals.Ready, component.GeneratorState.StateType == GeneratorStateType.Holding); _appearanceSystem.SetData(uid, M_EmpGeneratorVisuals.Unready, component.GeneratorState.StateType == GeneratorStateType.CoolingDown); _appearanceSystem.SetData(uid, M_EmpGeneratorVisuals.UnreadyBlinking, component.GeneratorState.StateType == GeneratorStateType.Detaching); @@ -118,62 +113,43 @@ private void UpdateChargeStateAppearance(EntityUid uid, TimeSpan currentTime, M_ component.PreviousCharge = component.ChargeRemaining; } -// private void OnGridRemoval(GridRemovalEvent ev) -// { -// // If we ever want to give generators names, and announce them individually, we would need to loop this, before removing it. -// if (_M_EmpGridStates.Remove(ev.EntityUid)) -// { -// if (TryComp(ev.EntityUid, out var salvComp) && -// TryComp(salvComp.SpawnerGenerator, out var generator)) -// Report(salvComp.SpawnerGenerator.Value, generator.M_EmpChannel, "M_Emp-system-announcement-spawn-generator-lost"); -// // For the very unlikely possibility that the M_Emp generator was on a M_Emp, we will not return here -// } -// foreach(var gridState in _M_EmpGridStates) -// { -// foreach(var generator in gridState.Value.ActiveGenerators) -// { -// if (!TryComp(generator, out var generatorComponent)) -// continue; - -// if (generatorComponent.AttachedEntity != ev.EntityUid) -// continue; -// generatorComponent.AttachedEntity = null; -// generatorComponent.GeneratorState = GeneratorState.Inactive; -// return; -// } -// } -// } - -// private void OnGeneratorRemoval(EntityUid uid, M_EmpGeneratorComponent component, ComponentShutdown args) -// { -// if (component.GeneratorState.StateType == GeneratorStateType.Inactive) -// return; -// -// var generatorTranform = Transform(uid); -// if (generatorTranform.GridUid is not { } gridId || !_M_EmpGridStates.TryGetValue(gridId, out var M_EmpGridState)) -// return; -// -// M_EmpGridState.ActiveGenerators.Remove(uid); -// Report(uid, component.M_EmpChannel, "M_Emp-system-announcement-spawn-generator-lost"); -// if (component.AttachedEntity.HasValue) -// { -// SafeDeleteM_Emp(component.AttachedEntity.Value); -// component.AttachedEntity = null; -// Report(uid, component.M_EmpChannel, "M_Emp-system-announcement-lost"); -// } -// else if (component.GeneratorState is { StateType: GeneratorStateType.Attaching }) -// { -// Report(uid, component.M_EmpChannel, "M_Emp-system-announcement-spawn-no-debris-available"); -// } -// -// component.GeneratorState = GeneratorState.Inactive; -// } + private void OnGridRemoval(GridRemovalEvent ev) + { + // If we ever want to give generators names, and announce them individually, we would need to loop this, before removing it. + if (_M_EmpGridStates.Remove(ev.EntityUid)) + { + // For the very unlikely possibility that the M_Emp generator was on a M_Emp, we will not return here + } + foreach(var gridState in _M_EmpGridStates) + { + foreach(var generator in gridState.Value.ActiveGenerators) + { + if (!TryComp(generator, out var generatorComponent)) + continue; + + generatorComponent.GeneratorState = GeneratorState.Inactive; + return; + } + } + } + + private void OnGeneratorRemoval(EntityUid uid, M_EmpGeneratorComponent component, ComponentShutdown args) + { + if (component.GeneratorState.StateType == GeneratorStateType.Inactive) + return; + + var generatorTranform = Transform(uid); + if (generatorTranform.GridUid is not { } gridId || !_M_EmpGridStates.TryGetValue(gridId, out var M_EmpGridState)) + return; + + component.GeneratorState = GeneratorState.Inactive; + } private void OnRefreshParts(EntityUid uid, M_EmpGeneratorComponent component, RefreshPartsEvent args) { var rating = args.PartRatings[component.MachinePartDelay] - 1; var factor = MathF.Pow(component.PartRatingDelay, rating); - component.AttachingTime = component.BaseAttachingTime * factor; + component.ActivatingTime = component.BaseActivatingTime * factor; component.CooldownTime = component.BaseCooldownTime * factor; } @@ -190,24 +166,24 @@ private void OnExamined(EntityUid uid, M_EmpGeneratorComponent component, Examin var gotGrid = false; var remainingTime = TimeSpan.Zero; -// if (Transform(uid).GridUid is { } gridId && -// _M_EmpGridStates.TryGetValue(gridId, out var M_EmpGridState)) -// { -// remainingTime = component.GeneratorState.Until - M_EmpGridState.CurrentTime; -// gotGrid = true; -// } -// else -// { -// Log.Warning("Failed to load M_Emp grid state, can't display remaining time"); -// } + if (Transform(uid).GridUid is { } gridId && + _M_EmpGridStates.TryGetValue(gridId, out var M_EmpGridState)) + { + remainingTime = component.GeneratorState.Until - M_EmpGridState.CurrentTime; + gotGrid = true; + } + else + { + Log.Warning("Failed to load M_Emp grid state, can't display remaining time"); + } switch (component.GeneratorState.StateType) { case GeneratorStateType.Inactive: args.PushMarkup(Loc.GetString("m_emp-system-generator-examined-inactive")); break; - case GeneratorStateType.Attaching: - args.PushMarkup(Loc.GetString("m_emp-system-generator-examined-pulling-in")); + case GeneratorStateType.Activating: + args.PushMarkup(Loc.GetString("m_emp-system-generator-examined-starting")); break; case GeneratorStateType.Detaching: args.PushMarkup(Loc.GetString("m_emp-system-generator-examined-releasing")); @@ -248,11 +224,12 @@ private void StartGenerator(EntityUid uid, M_EmpGeneratorComponent component, En _M_EmpGridStates[gridId] = gridState; } gridState.ActiveGenerators.Add(uid); - component.GeneratorState = new GeneratorState(GeneratorStateType.Attaching, gridState.CurrentTime + component.AttachingTime); + + component.GeneratorState = new GeneratorState(GeneratorStateType.Activating, gridState.CurrentTime + component.ActivatingTime); RaiseLocalEvent(new M_EmpGeneratorActivatedEvent(uid)); Report(uid, component.M_EmpChannel, "m_emp-system-report-activate-success"); break; - case GeneratorStateType.Attaching: + case GeneratorStateType.Activating: case GeneratorStateType.Holding: ShowPopup(uid, "m_emp-system-report-already-active", user); break; @@ -269,6 +246,25 @@ private void ShowPopup(EntityUid uid, string messageKey, EntityUid user) _popupSystem.PopupEntity(Loc.GetString(messageKey), uid, user); } + private bool SpawnM_Emp(EntityUid uid, M_EmpGeneratorComponent component) + { + EntityUid? salvageEnt; + + var opts = new MapLoadOptions + { + Offset = new Vector2(0, 0) + }; + + Report(uid, component.M_EmpChannel, "m_emp-system-announcement-active", ("timeLeft", component.HoldTime.TotalSeconds)); + + var empRange = 100; + var EmpEnergyConsumption = 50000; + var EmpDisabledDuration = 60; + _emp.EmpPulse(Transform(uid).MapPosition, empRange, EmpEnergyConsumption, EmpDisabledDuration); + + return true; + } + private void Report(EntityUid source, string channelName, string messageKey, params (string, object)[] args) { var message = args.Length == 0 ? Loc.GetString(messageKey) : Loc.GetString(messageKey, args); @@ -280,29 +276,21 @@ private void Transition(EntityUid uid, M_EmpGeneratorComponent generator, TimeSp { switch (generator.GeneratorState.StateType) { - case GeneratorStateType.Attaching: -// if (SpawnM_Emp(uid, generator)) -// { -// generator.GeneratorState = new GeneratorState(GeneratorStateType.Holding, currentTime + generator.HoldTime); -// } -// else -// { -// generator.GeneratorState = new GeneratorState(GeneratorStateType.CoolingDown, currentTime + generator.CooldownTime); -// } + case GeneratorStateType.Activating: + if (SpawnM_Emp(uid, generator)) + { + generator.GeneratorState = new GeneratorState(GeneratorStateType.Holding, currentTime + generator.HoldTime); + } + else + { + generator.GeneratorState = new GeneratorState(GeneratorStateType.CoolingDown, currentTime + generator.CooldownTime); + } break; case GeneratorStateType.Holding: - Report(uid, generator.M_EmpChannel, "m_emp-system-announcement-losing", ("timeLeft", generator.DetachingTime.TotalSeconds)); + Report(uid, generator.M_EmpChannel, "m_emp-system-announcement-cooling-down", ("timeLeft", generator.DetachingTime.TotalSeconds)); generator.GeneratorState = new GeneratorState(GeneratorStateType.Detaching, currentTime + generator.DetachingTime); break; case GeneratorStateType.Detaching: - // if (generator.AttachedEntity.HasValue) - // { - // SafeDeleteM_Emp(generator.AttachedEntity.Value); - // } - // else - // { - // Log.Error("M_Emp detaching was expecting attached entity but it was null"); - // } Report(uid, generator.M_EmpChannel, "m_emp-system-announcement-lost"); generator.GeneratorState = new GeneratorState(GeneratorStateType.CoolingDown, currentTime + generator.CooldownTime); break; diff --git a/Content.Shared/Salvage/SharedM_EmpGeneratorComponent.cs b/Content.Shared/_NF/M_Emp/SharedM_EmpGeneratorComponent.cs similarity index 96% rename from Content.Shared/Salvage/SharedM_EmpGeneratorComponent.cs rename to Content.Shared/_NF/M_Emp/SharedM_EmpGeneratorComponent.cs index 5a932c196c3..5049891d081 100644 --- a/Content.Shared/Salvage/SharedM_EmpGeneratorComponent.cs +++ b/Content.Shared/_NF/M_Emp/SharedM_EmpGeneratorComponent.cs @@ -3,7 +3,7 @@ using Robust.Shared.Serialization; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; -namespace Content.Shared.M_Emp; +namespace Content.Shared._NF.M_Emp; public abstract class SharedM_EmpGeneratorComponent : Component { diff --git a/Content.Shared/Salvage/SharedM_EmpSystem.cs.old b/Content.Shared/_NF/M_Emp/SharedM_EmpSystem.cs similarity index 92% rename from Content.Shared/Salvage/SharedM_EmpSystem.cs.old rename to Content.Shared/_NF/M_Emp/SharedM_EmpSystem.cs index 8758722f338..c40b6cf1ab9 100644 --- a/Content.Shared/Salvage/SharedM_EmpSystem.cs.old +++ b/Content.Shared/_NF/M_Emp/SharedM_EmpSystem.cs @@ -7,7 +7,7 @@ using Robust.Shared.Serialization; using Robust.Shared.Utility; -namespace Content.Shared.M_Emp; +namespace Content.Shared._NF.M_Emp; public abstract class SharedM_EmpSystem : EntitySystem { diff --git a/Resources/Locale/en-US/m_emp/m_emp-system.ftl b/Resources/Locale/en-US/m_emp/m_emp-system.ftl index c6306d093d9..b7f9778135d 100644 --- a/Resources/Locale/en-US/m_emp/m_emp-system.ftl +++ b/Resources/Locale/en-US/m_emp/m_emp-system.ftl @@ -1,18 +1,16 @@ -m_emp-system-announcement-source = Salvage Control System -m_emp-system-announcement-arrived = A piece of salvagable debris has been pulled in. Estimated hold time: {$timeLeft} seconds. -m_emp-system-announcement-losing = The generator is no longer able to hold the salvagable debris. Estimated time until loss: {$timeLeft} seconds. -m_emp-system-announcement-lost = The salvagable debris have been lost. +m_emp-system-announcement-source = M_EMP Generator System +m_emp-system-announcement-active = M_EMP generator activated. Estimated EMP time: {$timeLeft} seconds. +m_emp-system-announcement-cooling-down = The M_EMP geneartor EMP effect is no longer active. Estimated time until EMP cooldown: {$timeLeft} seconds. +m_emp-system-announcement-lost = The M_EMP generator charging up. m_emp-system-announcement-spawn-generator-lost = The M_EMP Generator has been lost. -m_emp-system-announcement-spawn-no-debris-available = No debris could be recovered by the M_EMP Generator. -m_emp-system-announcement-spawn-debris-disintegrated = Debris disintegrated during orbital transfer. m_emp-system-report-already-active = The M_EMP Generator is already active. m_emp-system-report-cooling-down = The M_EMP Generator is cooling down. -m_emp-system-report-activate-success = The M_EMP Generator on MAP at location is starting up! +m_emp-system-report-activate-success = The M_EMP Generator on targetGrid at LOCATION is starting up! m_emp-system-generator-examined-inactive = The M_EMP Generator is inactive. -m_emp-system-generator-examined-pulling-in = The M_EMP Generator is attempting to pull in m_emp. +m_emp-system-generator-examined-starting = The M_EMP Generator is starting up. m_emp-system-generator-examined-active = The M_EMP Generator is holding m_emp in place. Can hold for { $timeLeft -> [1] one second. *[other] { $timeLeft } seconds. diff --git a/Resources/Prototypes/_NF/Entities/Structures/Power/apc.yml b/Resources/Prototypes/_NF/Entities/Structures/Power/apc.yml new file mode 100644 index 00000000000..a4f0f17290a --- /dev/null +++ b/Resources/Prototypes/_NF/Entities/Structures/Power/apc.yml @@ -0,0 +1,10 @@ +# APCs in use +- type: entity + parent: BaseAPC + id: APCBasicEmpImmune + suffix: EMP Immune, 50kW + components: + - type: Battery + maxCharge: 50000 + startingCharge: 50000 + - type: EmpIgnore \ No newline at end of file From 9594415e90d1ac87a34daf235b4c71dbe2069001 Mon Sep 17 00:00:00 2001 From: Dvir Date: Mon, 24 Jul 2023 23:49:16 +0300 Subject: [PATCH 08/16] EMP --- Content.Server/Emp/EmpIgnoreComponent.cs | 12 ------------ Content.Server/Emp/EmpSystem.cs | 6 ------ Content.Server/Power/Components/ApcComponent.cs | 3 +++ Content.Server/Power/EntitySystems/ApcSystem.cs | 11 +++++++---- Content.Server/_NF/M_Emp/M_EmpSystem.cs | 5 ----- Content.Shared/Emp/EmpDisabledComponent.cs | 3 +++ .../Prototypes/_NF/Entities/Structures/Power/apc.yml | 3 ++- 7 files changed, 15 insertions(+), 28 deletions(-) delete mode 100644 Content.Server/Emp/EmpIgnoreComponent.cs diff --git a/Content.Server/Emp/EmpIgnoreComponent.cs b/Content.Server/Emp/EmpIgnoreComponent.cs deleted file mode 100644 index b5c94652976..00000000000 --- a/Content.Server/Emp/EmpIgnoreComponent.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace Content.Server.Emp; - -/// -/// Upon being triggered will EMP area around it. -/// -[RegisterComponent] -[Access(typeof(EmpSystem))] -public sealed class EmpIgnoreComponent : Component -{ - [DataField("IgnoreEmp"), ViewVariables(VVAccess.ReadWrite)] - public float IgnoreEmp = "true"; -} diff --git a/Content.Server/Emp/EmpSystem.cs b/Content.Server/Emp/EmpSystem.cs index 6626c5347e5..8248971c492 100644 --- a/Content.Server/Emp/EmpSystem.cs +++ b/Content.Server/Emp/EmpSystem.cs @@ -21,7 +21,6 @@ public override void Initialize() SubscribeLocalEvent(OnUnpaused); SubscribeLocalEvent(OnExamine); SubscribeLocalEvent(HandleEmpTrigger); - SubscribeLocalEvent(IgnoreEMP); SubscribeLocalEvent(OnRadioSendAttempt); SubscribeLocalEvent(OnRadioReceiveAttempt); @@ -81,11 +80,6 @@ private void HandleEmpTrigger(EntityUid uid, EmpOnTriggerComponent comp, Trigger args.Handled = true; } - private void HandleEmpTrigger(EntityUid uid, EmpIgnoreComponent comp, IgnoreEMP args) - { - args.Ignored = true; - } - private void OnRadioSendAttempt(EntityUid uid, EmpDisabledComponent component, ref RadioSendAttemptEvent args) { args.Cancelled = true; diff --git a/Content.Server/Power/Components/ApcComponent.cs b/Content.Server/Power/Components/ApcComponent.cs index e6e6dc58454..40ed3f87942 100644 --- a/Content.Server/Power/Components/ApcComponent.cs +++ b/Content.Server/Power/Components/ApcComponent.cs @@ -10,6 +10,9 @@ public sealed class ApcComponent : BaseApcNetComponent [DataField("onReceiveMessageSound")] public SoundSpecifier OnReceiveMessageSound = new SoundPathSpecifier("/Audio/Machines/machine_switch.ogg"); + [DataField("apcIgnoreEmp")] + public bool ApcIgnoreEmp = false; + [ViewVariables] public ApcChargeState LastChargeState; public TimeSpan LastChargeStateTime; diff --git a/Content.Server/Power/EntitySystems/ApcSystem.cs b/Content.Server/Power/EntitySystems/ApcSystem.cs index 538c675ac67..ed07ee912a9 100644 --- a/Content.Server/Power/EntitySystems/ApcSystem.cs +++ b/Content.Server/Power/EntitySystems/ApcSystem.cs @@ -12,7 +12,6 @@ using Robust.Server.GameObjects; using Robust.Shared.Audio; using Robust.Shared.Timing; -using Content.Server.EmpIgnore.Component; namespace Content.Server.Power.EntitySystems { @@ -25,7 +24,6 @@ internal sealed class ApcSystem : EntitySystem [Dependency] private readonly IGameTiming _gameTiming = default!; [Dependency] private readonly SharedAppearanceSystem _appearance = default!; [Dependency] private readonly SharedAudioSystem _audio = default!; - [Dependency] private readonly EmpIgnoreComponent _EmpIgnore = default!; public override void Initialize() { @@ -189,9 +187,14 @@ private ApcExternalPowerState CalcExtPowerState(EntityUid uid, PowerState.Batter return ApcExternalPowerState.Good; } - private void OnEmpPulse(EntityUid uid, ApcComponent component, ref EmpPulseEvent args, ref EmpIgnore args) + private void OnEmpPulse(EntityUid uid, ApcComponent component, ref EmpPulseEvent args) { - if (component.EmpIgnore) + if (component.ApcIgnoreEmp) + { + args.Affected = false; + args.Disabled = false; + } + else { if (component.MainBreakerEnabled) { diff --git a/Content.Server/_NF/M_Emp/M_EmpSystem.cs b/Content.Server/_NF/M_Emp/M_EmpSystem.cs index e6bd435c7d5..e3378c73669 100644 --- a/Content.Server/_NF/M_Emp/M_EmpSystem.cs +++ b/Content.Server/_NF/M_Emp/M_EmpSystem.cs @@ -250,11 +250,6 @@ private bool SpawnM_Emp(EntityUid uid, M_EmpGeneratorComponent component) { EntityUid? salvageEnt; - var opts = new MapLoadOptions - { - Offset = new Vector2(0, 0) - }; - Report(uid, component.M_EmpChannel, "m_emp-system-announcement-active", ("timeLeft", component.HoldTime.TotalSeconds)); var empRange = 100; diff --git a/Content.Shared/Emp/EmpDisabledComponent.cs b/Content.Shared/Emp/EmpDisabledComponent.cs index c84bab9d4dc..b1e5c805e36 100644 --- a/Content.Shared/Emp/EmpDisabledComponent.cs +++ b/Content.Shared/Emp/EmpDisabledComponent.cs @@ -20,6 +20,9 @@ public sealed class EmpDisabledComponent : Component [DataField("effectCoolDown"), ViewVariables(VVAccess.ReadWrite)] public float EffectCooldown = 3f; + [DataField("ignored"), ViewVariables(VVAccess.ReadWrite)] + public bool Ignored = false; + /// /// When next effect will be spawned /// diff --git a/Resources/Prototypes/_NF/Entities/Structures/Power/apc.yml b/Resources/Prototypes/_NF/Entities/Structures/Power/apc.yml index a4f0f17290a..3bdab73e958 100644 --- a/Resources/Prototypes/_NF/Entities/Structures/Power/apc.yml +++ b/Resources/Prototypes/_NF/Entities/Structures/Power/apc.yml @@ -7,4 +7,5 @@ - type: Battery maxCharge: 50000 startingCharge: 50000 - - type: EmpIgnore \ No newline at end of file + - type: Apc + apcIgnoreEmp: true \ No newline at end of file From c69eee804b0bf44d2d1a5562b0efbba47547e0ff Mon Sep 17 00:00:00 2001 From: Dvir Date: Wed, 26 Jul 2023 00:25:59 +0300 Subject: [PATCH 09/16] EMP --- .../_NF/M_Emp/M_EmpGeneratorComponent.cs | 16 ++-- Content.Server/_NF/M_Emp/M_EmpSystem.cs | 74 +++++++------------ Resources/Locale/en-US/m_emp/m_emp-system.ftl | 16 ++-- 3 files changed, 43 insertions(+), 63 deletions(-) diff --git a/Content.Server/_NF/M_Emp/M_EmpGeneratorComponent.cs b/Content.Server/_NF/M_Emp/M_EmpGeneratorComponent.cs index 44ac6bde5ea..98822d7229b 100644 --- a/Content.Server/_NF/M_Emp/M_EmpGeneratorComponent.cs +++ b/Content.Server/_NF/M_Emp/M_EmpGeneratorComponent.cs @@ -25,7 +25,7 @@ public sealed class M_EmpGeneratorComponent : SharedM_EmpGeneratorComponent /// [ViewVariables(VVAccess.ReadWrite)] [DataField("baseActivatingTime")] - public TimeSpan BaseActivatingTime = TimeSpan.FromSeconds(10); + public TimeSpan BaseActivatingTime = TimeSpan.FromSeconds(5); /// /// How long it actually takes for the generator to pull in the debris @@ -38,22 +38,22 @@ public sealed class M_EmpGeneratorComponent : SharedM_EmpGeneratorComponent /// How long the generator can hold the debris until it starts losing the lock /// [ViewVariables(VVAccess.ReadWrite)] - [DataField("holdTime")] - public TimeSpan HoldTime = TimeSpan.FromSeconds(60); + [DataField("engagedTime")] + public TimeSpan EngagedTime = TimeSpan.FromSeconds(60); /// /// How long the generator can hold the debris while losing the lock /// [ViewVariables(VVAccess.ReadWrite)] - [DataField("detachingTime")] - public TimeSpan DetachingTime = TimeSpan.FromSeconds(10); + [DataField("coolingDownTime")] + public TimeSpan CoolingDownTime = TimeSpan.FromSeconds(60); /// /// How long the generator has to cool down for after use /// [ViewVariables(VVAccess.ReadWrite)] [DataField("baseCooldownTime")] - public TimeSpan BaseCooldownTime = TimeSpan.FromSeconds(10); + public TimeSpan BaseCooldownTime = TimeSpan.FromSeconds(60); /// /// How long the generator actually has to cool down for after use @@ -103,8 +103,8 @@ public enum GeneratorStateType { Inactive, Activating, - Holding, - Detaching, + Engaged, CoolingDown, + Recharging, } } diff --git a/Content.Server/_NF/M_Emp/M_EmpSystem.cs b/Content.Server/_NF/M_Emp/M_EmpSystem.cs index e3378c73669..aadb923bd22 100644 --- a/Content.Server/_NF/M_Emp/M_EmpSystem.cs +++ b/Content.Server/_NF/M_Emp/M_EmpSystem.cs @@ -10,16 +10,11 @@ using Robust.Server.GameObjects; using Robust.Shared.Configuration; using Robust.Shared.Map; -using Robust.Shared.Player; using Robust.Shared.Prototypes; using Robust.Shared.Random; using Robust.Shared.Utility; using Content.Server.Chat.Managers; -using Content.Server.Parallax; -using Content.Server.Procedural; using Content.Server.Station.Systems; -using Content.Shared.CCVar; -using Robust.Server.Maps; using Robust.Shared.Timing; using Content.Server.Emp; @@ -30,13 +25,7 @@ public sealed partial class M_EmpSystem : EntitySystem [Dependency] private readonly IChatManager _chat = default!; [Dependency] private readonly IConfigurationManager _configurationManager = default!; [Dependency] private readonly IGameTiming _timing = default!; - [Dependency] private readonly IMapManager _mapManager = default!; [Dependency] private readonly IPrototypeManager _prototypeManager = default!; - [Dependency] private readonly IRobustRandom _random = default!; - [Dependency] private readonly ITileDefinitionManager _tileDefManager = default!; - [Dependency] private readonly BiomeSystem _biome = default!; - [Dependency] private readonly DungeonSystem _dungeon = default!; - [Dependency] private readonly MapLoaderSystem _map = default!; [Dependency] private readonly SharedPopupSystem _popupSystem = default!; [Dependency] private readonly RadioSystem _radioSystem = default!; [Dependency] private readonly SharedAppearanceSystem _appearanceSystem = default!; @@ -62,9 +51,6 @@ public override void Initialize() // Can't use RoundRestartCleanupEvent, I need to clean up before the grid, and components are gone to prevent the announcements SubscribeLocalEvent(OnRoundEnd); - -// InitializeExpeditions(); -// InitializeRunner(); } public override void Shutdown() @@ -86,9 +72,9 @@ private void UpdateAppearance(EntityUid uid, M_EmpGeneratorComponent? component return; _appearanceSystem.SetData(uid, M_EmpGeneratorVisuals.ReadyBlinking, component.GeneratorState.StateType == GeneratorStateType.Activating); - _appearanceSystem.SetData(uid, M_EmpGeneratorVisuals.Ready, component.GeneratorState.StateType == GeneratorStateType.Holding); - _appearanceSystem.SetData(uid, M_EmpGeneratorVisuals.Unready, component.GeneratorState.StateType == GeneratorStateType.CoolingDown); - _appearanceSystem.SetData(uid, M_EmpGeneratorVisuals.UnreadyBlinking, component.GeneratorState.StateType == GeneratorStateType.Detaching); + _appearanceSystem.SetData(uid, M_EmpGeneratorVisuals.Ready, component.GeneratorState.StateType == GeneratorStateType.Engaged); + _appearanceSystem.SetData(uid, M_EmpGeneratorVisuals.Unready, component.GeneratorState.StateType == GeneratorStateType.Recharging); + _appearanceSystem.SetData(uid, M_EmpGeneratorVisuals.UnreadyBlinking, component.GeneratorState.StateType == GeneratorStateType.CoolingDown); } private void UpdateChargeStateAppearance(EntityUid uid, TimeSpan currentTime, M_EmpGeneratorComponent? component = null) @@ -101,9 +87,9 @@ private void UpdateChargeStateAppearance(EntityUid uid, TimeSpan currentTime, M_ component.ChargeRemaining = component.GeneratorState.StateType switch { GeneratorStateType.Inactive => 5, - GeneratorStateType.Holding => timeLeft / (Convert.ToInt32(component.HoldTime.TotalSeconds) / component.ChargeCapacity) + 1, - GeneratorStateType.Detaching => 0, - GeneratorStateType.CoolingDown => component.ChargeCapacity - timeLeft / (Convert.ToInt32(component.CooldownTime.TotalSeconds) / component.ChargeCapacity) - 1, + GeneratorStateType.Engaged => timeLeft / (Convert.ToInt32(component.EngagedTime.TotalSeconds) / component.ChargeCapacity) + 1, + GeneratorStateType.CoolingDown => 0, + GeneratorStateType.Recharging => component.ChargeCapacity - timeLeft / (Convert.ToInt32(component.CooldownTime.TotalSeconds) / component.ChargeCapacity) - 1, _ => component.ChargeRemaining }; @@ -185,14 +171,14 @@ private void OnExamined(EntityUid uid, M_EmpGeneratorComponent component, Examin case GeneratorStateType.Activating: args.PushMarkup(Loc.GetString("m_emp-system-generator-examined-starting")); break; - case GeneratorStateType.Detaching: - args.PushMarkup(Loc.GetString("m_emp-system-generator-examined-releasing")); - break; case GeneratorStateType.CoolingDown: + args.PushMarkup(Loc.GetString("m_emp-system-generator-examined-cooling-down")); + break; + case GeneratorStateType.Recharging: if (gotGrid) - args.PushMarkup(Loc.GetString("m_emp-system-generator-examined-cooling-down", ("timeLeft", Math.Ceiling(remainingTime.TotalSeconds)))); + args.PushMarkup(Loc.GetString("m_emp-system-generator-examined-recharging", ("timeLeft", Math.Ceiling(remainingTime.TotalSeconds)))); break; - case GeneratorStateType.Holding: + case GeneratorStateType.Engaged: if (gotGrid) args.PushMarkup(Loc.GetString("m_emp-system-generator-examined-active", ("timeLeft", Math.Ceiling(remainingTime.TotalSeconds)))); break; @@ -230,12 +216,12 @@ private void StartGenerator(EntityUid uid, M_EmpGeneratorComponent component, En Report(uid, component.M_EmpChannel, "m_emp-system-report-activate-success"); break; case GeneratorStateType.Activating: - case GeneratorStateType.Holding: + case GeneratorStateType.Engaged: ShowPopup(uid, "m_emp-system-report-already-active", user); break; - case GeneratorStateType.Detaching: case GeneratorStateType.CoolingDown: - ShowPopup(uid, "m_emp-system-report-cooling-down", user); + case GeneratorStateType.Recharging: + ShowPopup(uid, "m_emp-system-report-recharging", user); break; default: throw new ArgumentOutOfRangeException(); @@ -248,14 +234,13 @@ private void ShowPopup(EntityUid uid, string messageKey, EntityUid user) private bool SpawnM_Emp(EntityUid uid, M_EmpGeneratorComponent component) { - EntityUid? salvageEnt; - - Report(uid, component.M_EmpChannel, "m_emp-system-announcement-active", ("timeLeft", component.HoldTime.TotalSeconds)); + Report(uid, component.M_EmpChannel, "m_emp-system-announcement-active", ("timeLeft", component.EngagedTime.TotalSeconds)); var empRange = 100; - var EmpEnergyConsumption = 50000; - var EmpDisabledDuration = 60; - _emp.EmpPulse(Transform(uid).MapPosition, empRange, EmpEnergyConsumption, EmpDisabledDuration); + var empEnergyConsumption = 50000; + var empDisabledDuration = 60; + + _emp.EmpPulse(Transform(uid).MapPosition, empRange, empEnergyConsumption, empDisabledDuration); return true; } @@ -274,22 +259,22 @@ private void Transition(EntityUid uid, M_EmpGeneratorComponent generator, TimeSp case GeneratorStateType.Activating: if (SpawnM_Emp(uid, generator)) { - generator.GeneratorState = new GeneratorState(GeneratorStateType.Holding, currentTime + generator.HoldTime); + generator.GeneratorState = new GeneratorState(GeneratorStateType.Engaged, currentTime + generator.EngagedTime); } else { - generator.GeneratorState = new GeneratorState(GeneratorStateType.CoolingDown, currentTime + generator.CooldownTime); + generator.GeneratorState = new GeneratorState(GeneratorStateType.Recharging, currentTime + generator.CooldownTime); } break; - case GeneratorStateType.Holding: - Report(uid, generator.M_EmpChannel, "m_emp-system-announcement-cooling-down", ("timeLeft", generator.DetachingTime.TotalSeconds)); - generator.GeneratorState = new GeneratorState(GeneratorStateType.Detaching, currentTime + generator.DetachingTime); - break; - case GeneratorStateType.Detaching: - Report(uid, generator.M_EmpChannel, "m_emp-system-announcement-lost"); - generator.GeneratorState = new GeneratorState(GeneratorStateType.CoolingDown, currentTime + generator.CooldownTime); + case GeneratorStateType.Engaged: + Report(uid, generator.M_EmpChannel, "m_emp-system-announcement-cooling-down", ("timeLeft", generator.CoolingDownTime.TotalSeconds)); + generator.GeneratorState = new GeneratorState(GeneratorStateType.CoolingDown, currentTime + generator.CoolingDownTime); break; case GeneratorStateType.CoolingDown: + Report(uid, generator.M_EmpChannel, "m_emp-system-announcement-recharging"); + generator.GeneratorState = new GeneratorState(GeneratorStateType.Recharging, currentTime + generator.CooldownTime); + break; + case GeneratorStateType.Recharging: generator.GeneratorState = GeneratorState.Inactive; break; } @@ -330,9 +315,6 @@ public override void Update(float frameTime) state.ActiveGenerators.Remove(generator); } } - -// UpdateExpeditions(); -// UpdateRunner(); } } diff --git a/Resources/Locale/en-US/m_emp/m_emp-system.ftl b/Resources/Locale/en-US/m_emp/m_emp-system.ftl index b7f9778135d..62168849fe0 100644 --- a/Resources/Locale/en-US/m_emp/m_emp-system.ftl +++ b/Resources/Locale/en-US/m_emp/m_emp-system.ftl @@ -1,21 +1,19 @@ m_emp-system-announcement-source = M_EMP Generator System -m_emp-system-announcement-active = M_EMP generator activated. Estimated EMP time: {$timeLeft} seconds. -m_emp-system-announcement-cooling-down = The M_EMP geneartor EMP effect is no longer active. Estimated time until EMP cooldown: {$timeLeft} seconds. -m_emp-system-announcement-lost = The M_EMP generator charging up. - -m_emp-system-announcement-spawn-generator-lost = The M_EMP Generator has been lost. +m_emp-system-announcement-active = Activated. Estimated EMP: {$timeLeft} seconds. +m_emp-system-announcement-cooling-down = EMP effect is no longer active. Estimated Recharging: {$timeLeft} seconds. +m_emp-system-announcement-recharging = Recharging. m_emp-system-report-already-active = The M_EMP Generator is already active. m_emp-system-report-cooling-down = The M_EMP Generator is cooling down. -m_emp-system-report-activate-success = The M_EMP Generator on targetGrid at LOCATION is starting up! +m_emp-system-report-activate-success = The M_EMP Generator pulse on GRID at CORDS! m_emp-system-generator-examined-inactive = The M_EMP Generator is inactive. m_emp-system-generator-examined-starting = The M_EMP Generator is starting up. -m_emp-system-generator-examined-active = The M_EMP Generator is holding m_emp in place. Can hold for { $timeLeft -> +m_emp-system-generator-examined-active = The M_EMP active. EMP will last { $timeLeft -> [1] one second. *[other] { $timeLeft } seconds. } -m_emp-system-generator-examined-releasing = The M_EMP Generator is releasing the m_emp. -m_emp-system-generator-examined-cooling-down = The M_EMP Generator is cooling down. It will be ready in: {$timeLeft} seconds. +m_emp-system-generator-examined-cooling-down = Cooling down. +m_emp-system-generator-examined-recharging = Recharging. Ready in: {$timeLeft} seconds. m_emp-system-generator-delay-upgrade = Attaching/cooldown delay From eb4c0d3a596c953e922089d5658397fdd76db6e5 Mon Sep 17 00:00:00 2001 From: Dvir Date: Wed, 26 Jul 2023 02:36:30 +0300 Subject: [PATCH 10/16] EMP --- Content.Server/_NF/M_Emp/M_EmpGeneratorComponent.cs | 12 ++++++------ Content.Server/_NF/M_Emp/M_EmpSystem.cs | 8 +++++++- .../_NF/M_Emp/SharedM_EmpGeneratorComponent.cs | 5 +++++ Resources/Locale/en-US/m_emp/m_emp-system.ftl | 4 ++-- .../Entities/Structures/Machines/m_emp.yml | 2 +- .../Structures/Machines/m_emp.rsi/m_emp-o0.png | Bin .../Structures/Machines/m_emp.rsi/m_emp-o1.png | Bin .../Structures/Machines/m_emp.rsi/m_emp-o2.png | Bin .../Structures/Machines/m_emp.rsi/m_emp-o3.png | Bin .../Structures/Machines/m_emp.rsi/m_emp-o4.png | Bin .../Machines/m_emp.rsi/m_emp-ready-blinking.png | Bin .../Structures/Machines/m_emp.rsi/m_emp-ready.png | Bin .../Machines/m_emp.rsi/m_emp-unready-blinking.png | Bin .../Structures/Machines/m_emp.rsi/m_emp-unready.png | Bin .../Structures/Machines/m_emp.rsi/m_emp.png | Bin .../Structures/Machines/m_emp.rsi/meta.json | 0 16 files changed, 21 insertions(+), 10 deletions(-) rename Resources/Prototypes/{ => _NF}/Entities/Structures/Machines/m_emp.yml (98%) rename Resources/Textures/{ => _NF}/Structures/Machines/m_emp.rsi/m_emp-o0.png (100%) rename Resources/Textures/{ => _NF}/Structures/Machines/m_emp.rsi/m_emp-o1.png (100%) rename Resources/Textures/{ => _NF}/Structures/Machines/m_emp.rsi/m_emp-o2.png (100%) rename Resources/Textures/{ => _NF}/Structures/Machines/m_emp.rsi/m_emp-o3.png (100%) rename Resources/Textures/{ => _NF}/Structures/Machines/m_emp.rsi/m_emp-o4.png (100%) rename Resources/Textures/{ => _NF}/Structures/Machines/m_emp.rsi/m_emp-ready-blinking.png (100%) rename Resources/Textures/{ => _NF}/Structures/Machines/m_emp.rsi/m_emp-ready.png (100%) rename Resources/Textures/{ => _NF}/Structures/Machines/m_emp.rsi/m_emp-unready-blinking.png (100%) rename Resources/Textures/{ => _NF}/Structures/Machines/m_emp.rsi/m_emp-unready.png (100%) rename Resources/Textures/{ => _NF}/Structures/Machines/m_emp.rsi/m_emp.png (100%) rename Resources/Textures/{ => _NF}/Structures/Machines/m_emp.rsi/meta.json (100%) diff --git a/Content.Server/_NF/M_Emp/M_EmpGeneratorComponent.cs b/Content.Server/_NF/M_Emp/M_EmpGeneratorComponent.cs index 98822d7229b..76a4f9c6bff 100644 --- a/Content.Server/_NF/M_Emp/M_EmpGeneratorComponent.cs +++ b/Content.Server/_NF/M_Emp/M_EmpGeneratorComponent.cs @@ -21,28 +21,28 @@ public sealed class M_EmpGeneratorComponent : SharedM_EmpGeneratorComponent public GeneratorState GeneratorState = GeneratorState.Inactive; /// - /// How long it takes for the generator to pull in the debris + /// How long it takes for the generator to EMP /// [ViewVariables(VVAccess.ReadWrite)] [DataField("baseActivatingTime")] - public TimeSpan BaseActivatingTime = TimeSpan.FromSeconds(5); + public TimeSpan BaseActivatingTime = TimeSpan.FromSeconds(3.5); /// - /// How long it actually takes for the generator to pull in the debris + /// How long it actually takes for the generator to EMP /// [ViewVariables(VVAccess.ReadWrite)] [DataField("activatingTime")] - public TimeSpan ActivatingTime = TimeSpan.FromSeconds(10); + public TimeSpan ActivatingTime = TimeSpan.FromSeconds(3.5); /// - /// How long the generator can hold the debris until it starts losing the lock + /// How long the generator EMP is working /// [ViewVariables(VVAccess.ReadWrite)] [DataField("engagedTime")] public TimeSpan EngagedTime = TimeSpan.FromSeconds(60); /// - /// How long the generator can hold the debris while losing the lock + /// How long the generator Cooling Down /// [ViewVariables(VVAccess.ReadWrite)] [DataField("coolingDownTime")] diff --git a/Content.Server/_NF/M_Emp/M_EmpSystem.cs b/Content.Server/_NF/M_Emp/M_EmpSystem.cs index aadb923bd22..40c060a2072 100644 --- a/Content.Server/_NF/M_Emp/M_EmpSystem.cs +++ b/Content.Server/_NF/M_Emp/M_EmpSystem.cs @@ -211,6 +211,8 @@ private void StartGenerator(EntityUid uid, M_EmpGeneratorComponent component, En } gridState.ActiveGenerators.Add(uid); + PlayActivatedSound(uid, component); + component.GeneratorState = new GeneratorState(GeneratorStateType.Activating, gridState.CurrentTime + component.ActivatingTime); RaiseLocalEvent(new M_EmpGeneratorActivatedEvent(uid)); Report(uid, component.M_EmpChannel, "m_emp-system-report-activate-success"); @@ -271,7 +273,7 @@ private void Transition(EntityUid uid, M_EmpGeneratorComponent generator, TimeSp generator.GeneratorState = new GeneratorState(GeneratorStateType.CoolingDown, currentTime + generator.CoolingDownTime); break; case GeneratorStateType.CoolingDown: - Report(uid, generator.M_EmpChannel, "m_emp-system-announcement-recharging"); + //Report(uid, generator.M_EmpChannel, "m_emp-system-announcement-recharging"); //Less chat spam generator.GeneratorState = new GeneratorState(GeneratorStateType.Recharging, currentTime + generator.CooldownTime); break; case GeneratorStateType.Recharging: @@ -316,6 +318,10 @@ public override void Update(float frameTime) } } } + private void PlayActivatedSound(EntityUid uid, SharedM_EmpGeneratorComponent component) + { + _audio.PlayPvs(_audio.GetSound(component.ActivatedSound), uid); + } } public sealed class M_EmpGridState diff --git a/Content.Shared/_NF/M_Emp/SharedM_EmpGeneratorComponent.cs b/Content.Shared/_NF/M_Emp/SharedM_EmpGeneratorComponent.cs index 5049891d081..c5abcf44b27 100644 --- a/Content.Shared/_NF/M_Emp/SharedM_EmpGeneratorComponent.cs +++ b/Content.Shared/_NF/M_Emp/SharedM_EmpGeneratorComponent.cs @@ -2,6 +2,7 @@ using Robust.Shared.Prototypes; using Robust.Shared.Serialization; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; +using Robust.Shared.Audio; namespace Content.Shared._NF.M_Emp; @@ -18,6 +19,10 @@ public abstract class SharedM_EmpGeneratorComponent : Component /// [DataField("partRatingDelay"), ViewVariables(VVAccess.ReadWrite)] public float PartRatingDelay = 0.75f; + + [DataField("activatedSound")] + public SoundSpecifier ActivatedSound = + new SoundPathSpecifier("/Audio/Effects/countdown.ogg"); } [Serializable, NetSerializable] diff --git a/Resources/Locale/en-US/m_emp/m_emp-system.ftl b/Resources/Locale/en-US/m_emp/m_emp-system.ftl index 62168849fe0..ff3222329c1 100644 --- a/Resources/Locale/en-US/m_emp/m_emp-system.ftl +++ b/Resources/Locale/en-US/m_emp/m_emp-system.ftl @@ -5,7 +5,7 @@ m_emp-system-announcement-recharging = Recharging. m_emp-system-report-already-active = The M_EMP Generator is already active. m_emp-system-report-cooling-down = The M_EMP Generator is cooling down. -m_emp-system-report-activate-success = The M_EMP Generator pulse on GRID at CORDS! +m_emp-system-report-activate-success = The M_EMP Generator engaging on GRID at CORDS! m_emp-system-generator-examined-inactive = The M_EMP Generator is inactive. m_emp-system-generator-examined-starting = The M_EMP Generator is starting up. @@ -15,5 +15,5 @@ m_emp-system-generator-examined-active = The M_EMP active. EMP will last { $time } m_emp-system-generator-examined-cooling-down = Cooling down. m_emp-system-generator-examined-recharging = Recharging. Ready in: {$timeLeft} seconds. -m_emp-system-generator-delay-upgrade = Attaching/cooldown delay +m_emp-system-generator-delay-upgrade = Cooling down / Recharging speed diff --git a/Resources/Prototypes/Entities/Structures/Machines/m_emp.yml b/Resources/Prototypes/_NF/Entities/Structures/Machines/m_emp.yml similarity index 98% rename from Resources/Prototypes/Entities/Structures/Machines/m_emp.yml rename to Resources/Prototypes/_NF/Entities/Structures/Machines/m_emp.yml index 7c133ce2d10..e3def20ab61 100644 --- a/Resources/Prototypes/Entities/Structures/Machines/m_emp.yml +++ b/Resources/Prototypes/_NF/Entities/Structures/Machines/m_emp.yml @@ -5,7 +5,7 @@ description: Mobile EMP generator. components: - type: Sprite - sprite: Structures/Machines/m_emp.rsi + sprite: _NF/Structures/Machines/m_emp.rsi layers: - state: m_emp - state: m_emp-ready diff --git a/Resources/Textures/Structures/Machines/m_emp.rsi/m_emp-o0.png b/Resources/Textures/_NF/Structures/Machines/m_emp.rsi/m_emp-o0.png similarity index 100% rename from Resources/Textures/Structures/Machines/m_emp.rsi/m_emp-o0.png rename to Resources/Textures/_NF/Structures/Machines/m_emp.rsi/m_emp-o0.png diff --git a/Resources/Textures/Structures/Machines/m_emp.rsi/m_emp-o1.png b/Resources/Textures/_NF/Structures/Machines/m_emp.rsi/m_emp-o1.png similarity index 100% rename from Resources/Textures/Structures/Machines/m_emp.rsi/m_emp-o1.png rename to Resources/Textures/_NF/Structures/Machines/m_emp.rsi/m_emp-o1.png diff --git a/Resources/Textures/Structures/Machines/m_emp.rsi/m_emp-o2.png b/Resources/Textures/_NF/Structures/Machines/m_emp.rsi/m_emp-o2.png similarity index 100% rename from Resources/Textures/Structures/Machines/m_emp.rsi/m_emp-o2.png rename to Resources/Textures/_NF/Structures/Machines/m_emp.rsi/m_emp-o2.png diff --git a/Resources/Textures/Structures/Machines/m_emp.rsi/m_emp-o3.png b/Resources/Textures/_NF/Structures/Machines/m_emp.rsi/m_emp-o3.png similarity index 100% rename from Resources/Textures/Structures/Machines/m_emp.rsi/m_emp-o3.png rename to Resources/Textures/_NF/Structures/Machines/m_emp.rsi/m_emp-o3.png diff --git a/Resources/Textures/Structures/Machines/m_emp.rsi/m_emp-o4.png b/Resources/Textures/_NF/Structures/Machines/m_emp.rsi/m_emp-o4.png similarity index 100% rename from Resources/Textures/Structures/Machines/m_emp.rsi/m_emp-o4.png rename to Resources/Textures/_NF/Structures/Machines/m_emp.rsi/m_emp-o4.png diff --git a/Resources/Textures/Structures/Machines/m_emp.rsi/m_emp-ready-blinking.png b/Resources/Textures/_NF/Structures/Machines/m_emp.rsi/m_emp-ready-blinking.png similarity index 100% rename from Resources/Textures/Structures/Machines/m_emp.rsi/m_emp-ready-blinking.png rename to Resources/Textures/_NF/Structures/Machines/m_emp.rsi/m_emp-ready-blinking.png diff --git a/Resources/Textures/Structures/Machines/m_emp.rsi/m_emp-ready.png b/Resources/Textures/_NF/Structures/Machines/m_emp.rsi/m_emp-ready.png similarity index 100% rename from Resources/Textures/Structures/Machines/m_emp.rsi/m_emp-ready.png rename to Resources/Textures/_NF/Structures/Machines/m_emp.rsi/m_emp-ready.png diff --git a/Resources/Textures/Structures/Machines/m_emp.rsi/m_emp-unready-blinking.png b/Resources/Textures/_NF/Structures/Machines/m_emp.rsi/m_emp-unready-blinking.png similarity index 100% rename from Resources/Textures/Structures/Machines/m_emp.rsi/m_emp-unready-blinking.png rename to Resources/Textures/_NF/Structures/Machines/m_emp.rsi/m_emp-unready-blinking.png diff --git a/Resources/Textures/Structures/Machines/m_emp.rsi/m_emp-unready.png b/Resources/Textures/_NF/Structures/Machines/m_emp.rsi/m_emp-unready.png similarity index 100% rename from Resources/Textures/Structures/Machines/m_emp.rsi/m_emp-unready.png rename to Resources/Textures/_NF/Structures/Machines/m_emp.rsi/m_emp-unready.png diff --git a/Resources/Textures/Structures/Machines/m_emp.rsi/m_emp.png b/Resources/Textures/_NF/Structures/Machines/m_emp.rsi/m_emp.png similarity index 100% rename from Resources/Textures/Structures/Machines/m_emp.rsi/m_emp.png rename to Resources/Textures/_NF/Structures/Machines/m_emp.rsi/m_emp.png diff --git a/Resources/Textures/Structures/Machines/m_emp.rsi/meta.json b/Resources/Textures/_NF/Structures/Machines/m_emp.rsi/meta.json similarity index 100% rename from Resources/Textures/Structures/Machines/m_emp.rsi/meta.json rename to Resources/Textures/_NF/Structures/Machines/m_emp.rsi/meta.json From 943087763239464d3573f0c6b2a4407cc969fd7f Mon Sep 17 00:00:00 2001 From: Dvir Date: Thu, 27 Jul 2023 18:16:45 +0300 Subject: [PATCH 11/16] EMP --- Content.Server/_NF/M_Emp/M_EmpSystem.cs | 7 ++++++- Resources/Locale/en-US/m_emp/m_emp-system.ftl | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Content.Server/_NF/M_Emp/M_EmpSystem.cs b/Content.Server/_NF/M_Emp/M_EmpSystem.cs index 40c060a2072..6b93211be80 100644 --- a/Content.Server/_NF/M_Emp/M_EmpSystem.cs +++ b/Content.Server/_NF/M_Emp/M_EmpSystem.cs @@ -215,7 +215,12 @@ private void StartGenerator(EntityUid uid, M_EmpGeneratorComponent component, En component.GeneratorState = new GeneratorState(GeneratorStateType.Activating, gridState.CurrentTime + component.ActivatingTime); RaiseLocalEvent(new M_EmpGeneratorActivatedEvent(uid)); - Report(uid, component.M_EmpChannel, "m_emp-system-report-activate-success"); + + var station = _station.GetOwningStation(uid); + var stationName = station is null ? null : Name(station.Value); + + Report(uid, component.M_EmpChannel, "m_emp-system-report-activate-success", ("grid", stationName)); + break; case GeneratorStateType.Activating: case GeneratorStateType.Engaged: diff --git a/Resources/Locale/en-US/m_emp/m_emp-system.ftl b/Resources/Locale/en-US/m_emp/m_emp-system.ftl index ff3222329c1..0142a0646ff 100644 --- a/Resources/Locale/en-US/m_emp/m_emp-system.ftl +++ b/Resources/Locale/en-US/m_emp/m_emp-system.ftl @@ -5,7 +5,7 @@ m_emp-system-announcement-recharging = Recharging. m_emp-system-report-already-active = The M_EMP Generator is already active. m_emp-system-report-cooling-down = The M_EMP Generator is cooling down. -m_emp-system-report-activate-success = The M_EMP Generator engaging on GRID at CORDS! +m_emp-system-report-activate-success = The M_EMP Generator engaging on {$grid}! m_emp-system-generator-examined-inactive = The M_EMP Generator is inactive. m_emp-system-generator-examined-starting = The M_EMP Generator is starting up. From 84002c3a9ed55e5466bb8d1fd5d10a8634fe1ceb Mon Sep 17 00:00:00 2001 From: Dvir Date: Fri, 28 Jul 2023 02:33:37 +0300 Subject: [PATCH 12/16] EMP --- ...eneratorComponent.cs => M_EmpComponent.cs} | 5 ++- .../_NF/M_Emp/M_EmpGeneratorComponent.cs | 20 +++++---- Content.Server/_NF/M_Emp/M_EmpSystem.cs | 41 +++++++++++++------ .../_NF/M_Emp/SharedM_EmpComponent.cs | 13 ++++++ .../_NF/machine-linking/receiver_ports.ftl | 2 + .../m_emp/{m_emp-system.ftl => m_emp.ftl} | 4 +- .../_NF/DeviceLinking/sink_ports.yml | 4 ++ .../_NF/DeviceLinking/source_ports.yml | 0 .../Entities/Structures/Machines/m_emp.yml | 12 +++++- .../_NF/MachineLinking/transmitter_ports.yml | 0 10 files changed, 76 insertions(+), 25 deletions(-) rename Content.Client/_NF/M_Emp/{M_EmpGeneratorComponent.cs => M_EmpComponent.cs} (62%) create mode 100644 Content.Shared/_NF/M_Emp/SharedM_EmpComponent.cs create mode 100644 Resources/Locale/en-US/_NF/machine-linking/receiver_ports.ftl rename Resources/Locale/en-US/m_emp/{m_emp-system.ftl => m_emp.ftl} (92%) create mode 100644 Resources/Prototypes/_NF/DeviceLinking/sink_ports.yml create mode 100644 Resources/Prototypes/_NF/DeviceLinking/source_ports.yml create mode 100644 Resources/Prototypes/_NF/MachineLinking/transmitter_ports.yml diff --git a/Content.Client/_NF/M_Emp/M_EmpGeneratorComponent.cs b/Content.Client/_NF/M_Emp/M_EmpComponent.cs similarity index 62% rename from Content.Client/_NF/M_Emp/M_EmpGeneratorComponent.cs rename to Content.Client/_NF/M_Emp/M_EmpComponent.cs index dd6d3dfa14d..18a740975cd 100644 --- a/Content.Client/_NF/M_Emp/M_EmpGeneratorComponent.cs +++ b/Content.Client/_NF/M_Emp/M_EmpComponent.cs @@ -1,5 +1,8 @@ using Content.Shared._NF.M_Emp; using Robust.Shared.GameStates; +using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; [NetworkedComponent, RegisterComponent] -public sealed class M_EmpGeneratorComponent : SharedM_EmpGeneratorComponent { } +public sealed class M_EmpGeneratorComponent : SharedM_EmpGeneratorComponent +{ +} diff --git a/Content.Server/_NF/M_Emp/M_EmpGeneratorComponent.cs b/Content.Server/_NF/M_Emp/M_EmpGeneratorComponent.cs index 76a4f9c6bff..65b6513e316 100644 --- a/Content.Server/_NF/M_Emp/M_EmpGeneratorComponent.cs +++ b/Content.Server/_NF/M_Emp/M_EmpGeneratorComponent.cs @@ -1,5 +1,4 @@ using Content.Shared.Radio; -using Content.Shared.Random; using Content.Shared._NF.M_Emp; using Robust.Shared.GameStates; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; @@ -45,22 +44,29 @@ public sealed class M_EmpGeneratorComponent : SharedM_EmpGeneratorComponent /// How long the generator Cooling Down /// [ViewVariables(VVAccess.ReadWrite)] + [DataField("baseCoolingDownTime")] + public TimeSpan BaseCoolingDownTime = TimeSpan.FromSeconds(60); + + /// + /// How long the generator actually has to cooldown after use + /// + [ViewVariables(VVAccess.ReadWrite)] [DataField("coolingDownTime")] public TimeSpan CoolingDownTime = TimeSpan.FromSeconds(60); /// - /// How long the generator has to cool down for after use + /// How long the generator has to recharge after use /// [ViewVariables(VVAccess.ReadWrite)] - [DataField("baseCooldownTime")] - public TimeSpan BaseCooldownTime = TimeSpan.FromSeconds(60); + [DataField("baseRecharging")] + public TimeSpan BaseRecharging = TimeSpan.FromSeconds(60); /// - /// How long the generator actually has to cool down for after use + /// How long the generator actually has to recharge after use /// [ViewVariables(VVAccess.ReadWrite)] - [DataField("cooldownTime")] - public TimeSpan CooldownTime = TimeSpan.FromSeconds(60); + [DataField("Recharging")] + public TimeSpan Recharging = TimeSpan.FromSeconds(60); [DataField("M_EmpChannel", customTypeSerializer: typeof(PrototypeIdSerializer))] public string M_EmpChannel = "Security"; diff --git a/Content.Server/_NF/M_Emp/M_EmpSystem.cs b/Content.Server/_NF/M_Emp/M_EmpSystem.cs index 6b93211be80..2c9a7a0bc37 100644 --- a/Content.Server/_NF/M_Emp/M_EmpSystem.cs +++ b/Content.Server/_NF/M_Emp/M_EmpSystem.cs @@ -11,12 +11,18 @@ using Robust.Shared.Configuration; using Robust.Shared.Map; using Robust.Shared.Prototypes; -using Robust.Shared.Random; using Robust.Shared.Utility; using Content.Server.Chat.Managers; using Content.Server.Station.Systems; using Robust.Shared.Timing; using Content.Server.Emp; +using Content.Shared.DeviceLinking; +using Content.Server.DeviceLinking.Systems; + +// TO ANYONE LOOKING AT THIS CODE, IM SORRY +// This code was reused for the salvage magnet and is a mess right now as it is, it has no known issues with it as for now but its not cleaned as it sould be. +// If you know what you are doing, fix this please to look "usable" +// - Dvir01 namespace Content.Server._NF.M_Emp { @@ -34,6 +40,7 @@ public sealed partial class M_EmpSystem : EntitySystem [Dependency] private readonly StationSystem _station = default!; [Dependency] private readonly UserInterfaceSystem _ui = default!; [Dependency] private readonly EmpSystem _emp = default!; + [Dependency] private readonly DeviceLinkSystem _linker = default!; // TODO: This is probably not compatible with multi-station private readonly Dictionary _M_EmpGridStates = new(); @@ -42,6 +49,7 @@ public override void Initialize() { base.Initialize(); + SubscribeLocalEvent(OnInit); // TODO make this function later SubscribeLocalEvent(OnInteractHand); SubscribeLocalEvent(OnRefreshParts); SubscribeLocalEvent(OnUpgradeExamine); @@ -89,7 +97,7 @@ private void UpdateChargeStateAppearance(EntityUid uid, TimeSpan currentTime, M_ GeneratorStateType.Inactive => 5, GeneratorStateType.Engaged => timeLeft / (Convert.ToInt32(component.EngagedTime.TotalSeconds) / component.ChargeCapacity) + 1, GeneratorStateType.CoolingDown => 0, - GeneratorStateType.Recharging => component.ChargeCapacity - timeLeft / (Convert.ToInt32(component.CooldownTime.TotalSeconds) / component.ChargeCapacity) - 1, + GeneratorStateType.Recharging => component.ChargeCapacity - timeLeft / (Convert.ToInt32(component.Recharging.TotalSeconds) / component.ChargeCapacity) - 1, _ => component.ChargeRemaining }; @@ -135,13 +143,13 @@ private void OnRefreshParts(EntityUid uid, M_EmpGeneratorComponent component, Re { var rating = args.PartRatings[component.MachinePartDelay] - 1; var factor = MathF.Pow(component.PartRatingDelay, rating); - component.ActivatingTime = component.BaseActivatingTime * factor; - component.CooldownTime = component.BaseCooldownTime * factor; + component.CoolingDownTime = component.BaseCoolingDownTime * factor; + component.Recharging = component.BaseRecharging * factor; } private void OnUpgradeExamine(EntityUid uid, M_EmpGeneratorComponent component, UpgradeExamineEvent args) { - args.AddPercentageUpgrade("m_emp-system-generator-delay-upgrade", (float) (component.CooldownTime / component.BaseCooldownTime)); + args.AddPercentageUpgrade("m_emp-system-generator-delay-upgrade", (float) (component.Recharging / component.BaseRecharging)); } private void OnExamined(EntityUid uid, M_EmpGeneratorComponent component, ExaminedEvent args) @@ -196,6 +204,11 @@ private void OnInteractHand(EntityUid uid, M_EmpGeneratorComponent component, In UpdateAppearance(uid, component); } + private void OnInit(EntityUid uid, SharedM_EmpComponent component, ComponentInit args) + { + _linker.EnsureSinkPorts(uid, component.ReceiverPort); + } + private void StartGenerator(EntityUid uid, M_EmpGeneratorComponent component, EntityUid user) { switch (component.GeneratorState.StateType) @@ -216,10 +229,7 @@ private void StartGenerator(EntityUid uid, M_EmpGeneratorComponent component, En component.GeneratorState = new GeneratorState(GeneratorStateType.Activating, gridState.CurrentTime + component.ActivatingTime); RaiseLocalEvent(new M_EmpGeneratorActivatedEvent(uid)); - var station = _station.GetOwningStation(uid); - var stationName = station is null ? null : Name(station.Value); - - Report(uid, component.M_EmpChannel, "m_emp-system-report-activate-success", ("grid", stationName)); + //Report(uid, component.M_EmpChannel, "m_emp-system-report-activate-success"); Removed to lower spam break; case GeneratorStateType.Activating: @@ -241,7 +251,12 @@ private void ShowPopup(EntityUid uid, string messageKey, EntityUid user) private bool SpawnM_Emp(EntityUid uid, M_EmpGeneratorComponent component) { - Report(uid, component.M_EmpChannel, "m_emp-system-announcement-active", ("timeLeft", component.EngagedTime.TotalSeconds)); + var station = _station.GetOwningStation(uid); + var stationName = station is null ? null : Name(station.Value); + +#pragma warning disable CS8620 // TODO need to fix it later, this is not creating an actual error + Report(uid, component.M_EmpChannel, "m_emp-system-announcement-active", ("timeLeft", component.EngagedTime.TotalSeconds), ("grid", stationName)); +#pragma warning restore CS8620 // TODO need to fix it later, this is not creating an actual error var empRange = 100; var empEnergyConsumption = 50000; @@ -270,7 +285,7 @@ private void Transition(EntityUid uid, M_EmpGeneratorComponent generator, TimeSp } else { - generator.GeneratorState = new GeneratorState(GeneratorStateType.Recharging, currentTime + generator.CooldownTime); + generator.GeneratorState = new GeneratorState(GeneratorStateType.Recharging, currentTime + generator.Recharging); } break; case GeneratorStateType.Engaged: @@ -278,8 +293,8 @@ private void Transition(EntityUid uid, M_EmpGeneratorComponent generator, TimeSp generator.GeneratorState = new GeneratorState(GeneratorStateType.CoolingDown, currentTime + generator.CoolingDownTime); break; case GeneratorStateType.CoolingDown: - //Report(uid, generator.M_EmpChannel, "m_emp-system-announcement-recharging"); //Less chat spam - generator.GeneratorState = new GeneratorState(GeneratorStateType.Recharging, currentTime + generator.CooldownTime); + //Report(uid, generator.M_EmpChannel, "m_emp-system-announcement-recharging"); // Less chat spam + generator.GeneratorState = new GeneratorState(GeneratorStateType.Recharging, currentTime + generator.Recharging); break; case GeneratorStateType.Recharging: generator.GeneratorState = GeneratorState.Inactive; diff --git a/Content.Shared/_NF/M_Emp/SharedM_EmpComponent.cs b/Content.Shared/_NF/M_Emp/SharedM_EmpComponent.cs new file mode 100644 index 00000000000..0f93204cb61 --- /dev/null +++ b/Content.Shared/_NF/M_Emp/SharedM_EmpComponent.cs @@ -0,0 +1,13 @@ +using Content.Shared._NF.M_Emp; +using Robust.Shared.GameStates; +using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; +using Content.Shared.MachineLinking; + +namespace Content.Shared._NF.M_Emp; + +[NetworkedComponent, RegisterComponent] +public sealed class SharedM_EmpComponent : Component +{ + [DataField("receiverPort", customTypeSerializer: typeof(PrototypeIdSerializer)), ViewVariables(VVAccess.ReadWrite)] + public string ReceiverPort = "M_Emp"; +} diff --git a/Resources/Locale/en-US/_NF/machine-linking/receiver_ports.ftl b/Resources/Locale/en-US/_NF/machine-linking/receiver_ports.ftl new file mode 100644 index 00000000000..90da17cdf23 --- /dev/null +++ b/Resources/Locale/en-US/_NF/machine-linking/receiver_ports.ftl @@ -0,0 +1,2 @@ +signal-port-name-m_emp = M_EMP +signal-port-description-m_emp = Activate the device. \ No newline at end of file diff --git a/Resources/Locale/en-US/m_emp/m_emp-system.ftl b/Resources/Locale/en-US/m_emp/m_emp.ftl similarity index 92% rename from Resources/Locale/en-US/m_emp/m_emp-system.ftl rename to Resources/Locale/en-US/m_emp/m_emp.ftl index 0142a0646ff..4949388230a 100644 --- a/Resources/Locale/en-US/m_emp/m_emp-system.ftl +++ b/Resources/Locale/en-US/m_emp/m_emp.ftl @@ -1,11 +1,11 @@ m_emp-system-announcement-source = M_EMP Generator System -m_emp-system-announcement-active = Activated. Estimated EMP: {$timeLeft} seconds. +m_emp-system-announcement-active = Engaging on {$grid}. EMP: {$timeLeft} seconds. m_emp-system-announcement-cooling-down = EMP effect is no longer active. Estimated Recharging: {$timeLeft} seconds. m_emp-system-announcement-recharging = Recharging. m_emp-system-report-already-active = The M_EMP Generator is already active. m_emp-system-report-cooling-down = The M_EMP Generator is cooling down. -m_emp-system-report-activate-success = The M_EMP Generator engaging on {$grid}! +m_emp-system-report-activate-success = The M_EMP Generator engaging! m_emp-system-generator-examined-inactive = The M_EMP Generator is inactive. m_emp-system-generator-examined-starting = The M_EMP Generator is starting up. diff --git a/Resources/Prototypes/_NF/DeviceLinking/sink_ports.yml b/Resources/Prototypes/_NF/DeviceLinking/sink_ports.yml new file mode 100644 index 00000000000..7523787a58c --- /dev/null +++ b/Resources/Prototypes/_NF/DeviceLinking/sink_ports.yml @@ -0,0 +1,4 @@ +- type: sinkPort + id: M_Emp + name: signal-port-name-m_emp + description: signal-port-description-m_emp \ No newline at end of file diff --git a/Resources/Prototypes/_NF/DeviceLinking/source_ports.yml b/Resources/Prototypes/_NF/DeviceLinking/source_ports.yml new file mode 100644 index 00000000000..e69de29bb2d diff --git a/Resources/Prototypes/_NF/Entities/Structures/Machines/m_emp.yml b/Resources/Prototypes/_NF/Entities/Structures/Machines/m_emp.yml index e3def20ab61..b073361de92 100644 --- a/Resources/Prototypes/_NF/Entities/Structures/Machines/m_emp.yml +++ b/Resources/Prototypes/_NF/Entities/Structures/Machines/m_emp.yml @@ -59,6 +59,14 @@ - Security - type: M_EmpGenerator - type: ApcPowerReceiver - powerLoad: 100 # TODO change this to a HV power draw that really hits the grid hard WHEN active + powerLoad: 2500 # TODO change this to a HV power draw that really hits the grid hard WHEN active - type: Machine - board: M_EmpMachineCircuitboard \ No newline at end of file + board: M_EmpMachineCircuitboard + - type: DeviceNetwork + deviceNetId: Wireless + receiveFrequencyId: BasicDevice + - type: WirelessNetworkConnection + range: 200 + - type: DeviceLinkSink + ports: + - M_Emp \ No newline at end of file diff --git a/Resources/Prototypes/_NF/MachineLinking/transmitter_ports.yml b/Resources/Prototypes/_NF/MachineLinking/transmitter_ports.yml new file mode 100644 index 00000000000..e69de29bb2d From ce54ec63499b053350b9476844ccb0da7feee3a2 Mon Sep 17 00:00:00 2001 From: Dvir Date: Fri, 28 Jul 2023 20:11:19 +0300 Subject: [PATCH 13/16] EMP --- Content.Server/_NF/M_Emp/M_EmpSystem.cs | 2 +- .../Locale/en-US/_NF/store/uplink-catalog.ftl | 2 + .../Catalog/Fills/Boxes/ammunition.yml | 4 +- .../Weapons/Guns/Ammunition/Boxes/pistol.yml | 4 +- .../Guns/Ammunition/Cartridges/pistol.yml | 2 +- .../Guns/Ammunition/Magazines/pistol.yml | 2 +- .../Guns/Ammunition/Projectiles/pistol.yml | 3 +- .../Weapons/Guns/Ammunition/explosives.yml | 35 ---------- .../Weapons/Guns/Battery/battery_guns.yml | 35 ---------- .../Weapons/Guns/Projectiles/projectiles.yml | 2 +- .../_NF/Catalog/Fills/Backpacks/duffelbag.yml | 11 ++++ .../Prototypes/_NF/Catalog/uplink_catalog.yml | 10 +++ .../Weapons/Ammunition/Boxes/pistol.yml | 0 .../Weapons/Ammunition/Cartridges/pistol.yml | 0 .../Weapons/Ammunition/Magazines/pistol.yml | 0 .../Weapons/Ammunition/Projectiles/pistol.yml | 0 .../Objects/Weapons/Ammunition/explosives.yml | 38 +++++++++++ .../Weapons/Guns/Battery/battery_guns.yml | 34 ++++++++++ .../Weapons/Guns/Launchers/launchers.yml | 65 +++++++++++++++++++ .../Weapons/Guns/Projectiles/projectiles.yml | 0 20 files changed, 170 insertions(+), 79 deletions(-) create mode 100644 Resources/Locale/en-US/_NF/store/uplink-catalog.ftl create mode 100644 Resources/Prototypes/_NF/Catalog/Fills/Backpacks/duffelbag.yml create mode 100644 Resources/Prototypes/_NF/Catalog/uplink_catalog.yml create mode 100644 Resources/Prototypes/_NF/Entities/Objects/Weapons/Ammunition/Boxes/pistol.yml create mode 100644 Resources/Prototypes/_NF/Entities/Objects/Weapons/Ammunition/Cartridges/pistol.yml create mode 100644 Resources/Prototypes/_NF/Entities/Objects/Weapons/Ammunition/Magazines/pistol.yml create mode 100644 Resources/Prototypes/_NF/Entities/Objects/Weapons/Ammunition/Projectiles/pistol.yml create mode 100644 Resources/Prototypes/_NF/Entities/Objects/Weapons/Ammunition/explosives.yml create mode 100644 Resources/Prototypes/_NF/Entities/Objects/Weapons/Guns/Battery/battery_guns.yml create mode 100644 Resources/Prototypes/_NF/Entities/Objects/Weapons/Guns/Launchers/launchers.yml create mode 100644 Resources/Prototypes/_NF/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml diff --git a/Content.Server/_NF/M_Emp/M_EmpSystem.cs b/Content.Server/_NF/M_Emp/M_EmpSystem.cs index 2c9a7a0bc37..d5fd68ef916 100644 --- a/Content.Server/_NF/M_Emp/M_EmpSystem.cs +++ b/Content.Server/_NF/M_Emp/M_EmpSystem.cs @@ -20,7 +20,7 @@ using Content.Server.DeviceLinking.Systems; // TO ANYONE LOOKING AT THIS CODE, IM SORRY -// This code was reused for the salvage magnet and is a mess right now as it is, it has no known issues with it as for now but its not cleaned as it sould be. +// This code was reused for the salvage magnet and is a mess right now as it is, it has no known issues with, I hope, but its not cleaned as it sould be. // If you know what you are doing, fix this please to look "usable" // - Dvir01 diff --git a/Resources/Locale/en-US/_NF/store/uplink-catalog.ftl b/Resources/Locale/en-US/_NF/store/uplink-catalog.ftl new file mode 100644 index 00000000000..89f0c2cf6c2 --- /dev/null +++ b/Resources/Locale/en-US/_NF/store/uplink-catalog.ftl @@ -0,0 +1,2 @@ +uplink-emp-grenade-launcher-bundle-name = EMP China-Lake Bundle +uplink-emp-grenade-launcher-bundle-desc = An old China-Lake grenade launcher bundled with 8 rounds of EMP. \ No newline at end of file diff --git a/Resources/Prototypes/Catalog/Fills/Boxes/ammunition.yml b/Resources/Prototypes/Catalog/Fills/Boxes/ammunition.yml index a02b7bbb59b..cd8b5f463b6 100644 --- a/Resources/Prototypes/Catalog/Fills/Boxes/ammunition.yml +++ b/Resources/Prototypes/Catalog/Fills/Boxes/ammunition.yml @@ -307,12 +307,12 @@ - type: entity name: box of SMG .35 auto (emp) magazines parent: BoxMagazine - id: BoxMagazinePistolSubMachineGunEMP + id: BoxMagazinePistolSubMachineGunEmp description: A box full of SMG .35 auto (emp) magazines. components: - type: StorageFill contents: - - id: MagazinePistolSubMachineGunEMP + - id: MagazinePistolSubMachineGunEmp amount: 3 # Shotgun diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Boxes/pistol.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Boxes/pistol.yml index 0e8e6d069e9..b386ee67ac5 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Boxes/pistol.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Boxes/pistol.yml @@ -85,8 +85,8 @@ - state: rubber - type: entity - id: MagazineBoxPistolIncendiary parent: BaseMagazineBoxPistol + id: MagazineBoxPistolIncendiary name: ammunition box (.35 auto incendiary) components: - type: BallisticAmmoProvider @@ -112,4 +112,4 @@ map: ["enum.GunVisualLayers.Base"] - state: mag-1 map: ["enum.GunVisualLayers.Mag"] - - state: emp \ No newline at end of file + - state: emp diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Cartridges/pistol.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Cartridges/pistol.yml index 936c702b767..c7590865aec 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Cartridges/pistol.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Cartridges/pistol.yml @@ -66,4 +66,4 @@ parent: BaseCartridgePistol components: - type: CartridgeAmmo - proto: BulletPistolEmp \ No newline at end of file + proto: BulletPistolEmp diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Magazines/pistol.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Magazines/pistol.yml index 93b7420c638..83b68c37eb2 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Magazines/pistol.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Magazines/pistol.yml @@ -314,4 +314,4 @@ - state: rubber map: ["enum.GunVisualLayers.Base"] - state: mag-1 - map: ["enum.GunVisualLayers.Mag"] \ No newline at end of file + map: ["enum.GunVisualLayers.Mag"] diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/pistol.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/pistol.yml index 0be43ee4ce2..994cb5acb63 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/pistol.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/pistol.yml @@ -59,4 +59,5 @@ parent: BaseBulletEmp noSpawn: true components: - - type: Projectile \ No newline at end of file + - type: Projectile + diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/explosives.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/explosives.yml index f2edfb68b4b..56d420cb33c 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/explosives.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/explosives.yml @@ -135,38 +135,3 @@ - type: Sprite sprite: Objects/Weapons/Guns/Ammunition/Explosives/explosives.rsi state: ball - -- type: entity - id: GrenadeEmp - name: emp grenade - parent: BaseGrenade - components: - - type: CartridgeAmmo - proto: BulletGrenadeEmp - - type: Sprite - sprite: Objects/Weapons/Guns/Ammunition/Explosives/explosives.rsi - layers: - - state: emp - map: ["enum.AmmoVisualLayers.Base"] - - type: Appearance - - type: SpentAmmoVisuals - state: emp - suffix: false - -- type: entity - id: CartridgeRocketEmp - name: PG-7VL emp - parent: BaseItem - description: A 1.5 emp warhead designed for the RPG-7 launcher. Has tubular shape. - components: - - type: Tag - tags: - - CartridgeRocket - - type: Item - size: 5 - - type: CartridgeAmmo - proto: BulletRocketEmp - deleteOnSpawn: true - - type: Sprite - sprite: Objects/Weapons/Guns/Ammunition/Explosives/explosives.rsi - state: rpg-emp \ No newline at end of file diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Battery/battery_guns.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Battery/battery_guns.yml index 7b48e547fbb..640b606020d 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Battery/battery_guns.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Battery/battery_guns.yml @@ -460,38 +460,3 @@ - type: Appearance - type: StaticPrice price: 750 - -- type: entity - name: emp emitter - parent: BaseWeaponBattery - id: WeaponEmpEmitter - description: Releases electromagnetic pulses that disrupt or damage many electronic devices or drain power cells. - components: - - type: Sprite - sprite: Objects/Weapons/Guns/Battery/xray.rsi - layers: - - state: base - map: ["enum.GunVisualLayers.Base"] - - state: mag-unshaded-0 - map: ["enum.GunVisualLayers.MagUnshaded"] - shader: unshaded - - type: Clothing - sprite: Objects/Weapons/Guns/Battery/xray.rsi - - type: Gun - fireRate: 1 - selectedMode: SemiAuto - availableModes: - - SemiAuto - soundGunshot: - path: /Audio/Weapons/Guns/Gunshots/laser3.ogg - - type: Battery - maxCharge: 1000 - startingCharge: 1000 - - type: ProjectileBatteryAmmoProvider - proto: ProjectileEmp - fireCost: 1000 - - type: MagazineVisuals - magState: mag - steps: 5 - zeroVisible: true - - type: Appearance \ No newline at end of file diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml index 22b18a50dd4..38cc45b79cb 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml @@ -814,4 +814,4 @@ - type: EmpOnTrigger range: 2 energyConsumption: 50000 - disableDuration: 30 \ No newline at end of file + disableDuration: 30 diff --git a/Resources/Prototypes/_NF/Catalog/Fills/Backpacks/duffelbag.yml b/Resources/Prototypes/_NF/Catalog/Fills/Backpacks/duffelbag.yml new file mode 100644 index 00000000000..acd53d4e257 --- /dev/null +++ b/Resources/Prototypes/_NF/Catalog/Fills/Backpacks/duffelbag.yml @@ -0,0 +1,11 @@ +- type: entity + parent: ClothingBackpackDuffelSyndicateBundle + id: ClothingBackpackDuffelSyndicateFilledEmpGrenadeLauncher + name: China-Lake EMP bundle + description: "An old China-Lake grenade launcher bundled with 8 rounds of EMP." + components: + - type: StorageFill + contents: + - id: WeaponLauncherChinaLakeEmp + - id: GrenadeEmp + amount: 8 diff --git a/Resources/Prototypes/_NF/Catalog/uplink_catalog.yml b/Resources/Prototypes/_NF/Catalog/uplink_catalog.yml new file mode 100644 index 00000000000..f7c196cb41f --- /dev/null +++ b/Resources/Prototypes/_NF/Catalog/uplink_catalog.yml @@ -0,0 +1,10 @@ +- type: listing + id: UplinkEmpGrenadeLauncherBundle + name: uplink-emp-grenade-launcher-bundle-name + description: uplink-emp-grenade-launcher-bundle-desc + icon: { sprite: /Textures/Objects/Weapons/Guns/Launchers/china_lake.rsi, state: icon } + productEntity: ClothingBackpackDuffelSyndicateFilledEmpGrenadeLauncher + cost: + Telecrystal: 25 + categories: + - UplinkBundles diff --git a/Resources/Prototypes/_NF/Entities/Objects/Weapons/Ammunition/Boxes/pistol.yml b/Resources/Prototypes/_NF/Entities/Objects/Weapons/Ammunition/Boxes/pistol.yml new file mode 100644 index 00000000000..e69de29bb2d diff --git a/Resources/Prototypes/_NF/Entities/Objects/Weapons/Ammunition/Cartridges/pistol.yml b/Resources/Prototypes/_NF/Entities/Objects/Weapons/Ammunition/Cartridges/pistol.yml new file mode 100644 index 00000000000..e69de29bb2d diff --git a/Resources/Prototypes/_NF/Entities/Objects/Weapons/Ammunition/Magazines/pistol.yml b/Resources/Prototypes/_NF/Entities/Objects/Weapons/Ammunition/Magazines/pistol.yml new file mode 100644 index 00000000000..e69de29bb2d diff --git a/Resources/Prototypes/_NF/Entities/Objects/Weapons/Ammunition/Projectiles/pistol.yml b/Resources/Prototypes/_NF/Entities/Objects/Weapons/Ammunition/Projectiles/pistol.yml new file mode 100644 index 00000000000..e69de29bb2d diff --git a/Resources/Prototypes/_NF/Entities/Objects/Weapons/Ammunition/explosives.yml b/Resources/Prototypes/_NF/Entities/Objects/Weapons/Ammunition/explosives.yml new file mode 100644 index 00000000000..f41471aa9bc --- /dev/null +++ b/Resources/Prototypes/_NF/Entities/Objects/Weapons/Ammunition/explosives.yml @@ -0,0 +1,38 @@ +# Rockets + +- type: entity + id: CartridgeRocketEmp + name: PG-7VL emp + parent: BaseItem + description: A 1.5 emp warhead designed for the RPG-7 launcher. Has tubular shape. + components: + - type: Tag + tags: + - CartridgeRocket + - type: Item + size: 5 + - type: CartridgeAmmo + proto: BulletRocketEmp + deleteOnSpawn: true + - type: Sprite + sprite: Objects/Weapons/Guns/Ammunition/Explosives/explosives.rsi + state: rpg-emp + +# Grenades + +- type: entity + id: GrenadeEmp + name: emp grenade # Chinalake EMP + parent: BaseGrenade + components: + - type: CartridgeAmmo + proto: BulletGrenadeEmp + - type: Sprite + sprite: Objects/Weapons/Guns/Ammunition/Explosives/explosives.rsi + layers: + - state: emp + map: ["enum.AmmoVisualLayers.Base"] + - type: Appearance + - type: SpentAmmoVisuals + state: emp + suffix: false diff --git a/Resources/Prototypes/_NF/Entities/Objects/Weapons/Guns/Battery/battery_guns.yml b/Resources/Prototypes/_NF/Entities/Objects/Weapons/Guns/Battery/battery_guns.yml new file mode 100644 index 00000000000..7f64e8c49e6 --- /dev/null +++ b/Resources/Prototypes/_NF/Entities/Objects/Weapons/Guns/Battery/battery_guns.yml @@ -0,0 +1,34 @@ +- type: entity + name: emp emitter + parent: BaseWeaponBattery + id: WeaponEmpEmitter + description: Releases electromagnetic pulses that disrupt or damage many electronic devices or drain power cells. + components: + - type: Sprite + sprite: Objects/Weapons/Guns/Battery/xray.rsi + layers: + - state: base + map: ["enum.GunVisualLayers.Base"] + - state: mag-unshaded-0 + map: ["enum.GunVisualLayers.MagUnshaded"] + shader: unshaded + - type: Clothing + sprite: Objects/Weapons/Guns/Battery/xray.rsi + - type: Gun + fireRate: 1 + selectedMode: SemiAuto + availableModes: + - SemiAuto + soundGunshot: + path: /Audio/Weapons/Guns/Gunshots/laser3.ogg + - type: Battery + maxCharge: 1000 + startingCharge: 1000 + - type: ProjectileBatteryAmmoProvider + proto: ProjectileEmp + fireCost: 1000 + - type: MagazineVisuals + magState: mag + steps: 5 + zeroVisible: true + - type: Appearance diff --git a/Resources/Prototypes/_NF/Entities/Objects/Weapons/Guns/Launchers/launchers.yml b/Resources/Prototypes/_NF/Entities/Objects/Weapons/Guns/Launchers/launchers.yml new file mode 100644 index 00000000000..5ad52d050d9 --- /dev/null +++ b/Resources/Prototypes/_NF/Entities/Objects/Weapons/Guns/Launchers/launchers.yml @@ -0,0 +1,65 @@ +- type: entity + name: china lake + parent: BaseWeaponLauncher + suffix: EMP + id: WeaponLauncherChinaLakeEmp + description: PLOOP + components: + - type: Sprite + sprite: Objects/Weapons/Guns/Launchers/china_lake.rsi + layers: + - state: icon + map: ["enum.GunVisualLayers.Base"] + - type: Clothing + sprite: Objects/Weapons/Guns/Launchers/china_lake.rsi + - type: AmmoCounter + - type: Gun + fireRate: 1 + selectedMode: SemiAuto + availableModes: + - SemiAuto + soundGunshot: + path: /Audio/Weapons/Guns/Gunshots/grenade_launcher.ogg + - type: BallisticAmmoProvider + whitelist: + tags: + - Grenade + autoCycle: false + capacity: 3 + proto: GrenadeEmp + soundInsert: + path: /Audio/Weapons/Guns/MagIn/batrifle_magin.ogg + +- type: entity + name: RPG-7 + suffix: EMP + parent: BaseWeaponLauncher + id: WeaponLauncherRocketEmp + description: A modified ancient rocket-propelled grenade launcher. + components: + - type: Sprite + sprite: Objects/Weapons/Guns/Launchers/rocket.rsi + layers: + - state: base + map: ["enum.GunVisualLayers.Base"] + - state: mag-0 + map: ["enum.GunVisualLayers.Mag"] + - type: Clothing + sprite: Objects/Weapons/Guns/Launchers/rocket.rsi + - type: Gun + fireRate: 0.5 + soundGunshot: + path: /Audio/Weapons/Guns/Gunshots/rpgfire.ogg + - type: BallisticAmmoProvider + whitelist: + tags: + - CartridgeRocket + proto: CartridgeRocketEmp + capacity: 1 + soundInsert: + path: /Audio/Weapons/Guns/MagIn/batrifle_magin.ogg + - type: MagazineVisuals + magState: mag + steps: 2 + zeroVisible: false + - type: Appearance \ No newline at end of file diff --git a/Resources/Prototypes/_NF/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml b/Resources/Prototypes/_NF/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml new file mode 100644 index 00000000000..e69de29bb2d From 88a23e435ce2e7de77e41b279248d789c2836485 Mon Sep 17 00:00:00 2001 From: Cheackraze <71046427+Cheackraze@users.noreply.github.com> Date: Sat, 29 Jul 2023 04:39:58 -0400 Subject: [PATCH 14/16] reporting for duty --- Content.Server/_NF/M_Emp/M_EmpSystem.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Content.Server/_NF/M_Emp/M_EmpSystem.cs b/Content.Server/_NF/M_Emp/M_EmpSystem.cs index d5fd68ef916..460e85683ab 100644 --- a/Content.Server/_NF/M_Emp/M_EmpSystem.cs +++ b/Content.Server/_NF/M_Emp/M_EmpSystem.cs @@ -254,9 +254,7 @@ private bool SpawnM_Emp(EntityUid uid, M_EmpGeneratorComponent component) var station = _station.GetOwningStation(uid); var stationName = station is null ? null : Name(station.Value); -#pragma warning disable CS8620 // TODO need to fix it later, this is not creating an actual error - Report(uid, component.M_EmpChannel, "m_emp-system-announcement-active", ("timeLeft", component.EngagedTime.TotalSeconds), ("grid", stationName)); -#pragma warning restore CS8620 // TODO need to fix it later, this is not creating an actual error + Report(uid, component.M_EmpChannel, "m_emp-system-announcement-active", ("timeLeft", component.EngagedTime.TotalSeconds), ("grid", stationName!)); var empRange = 100; var empEnergyConsumption = 50000; From 625add743ce66dffbf0817f84288ccc65b24e9ab Mon Sep 17 00:00:00 2001 From: Dvir Date: Sat, 29 Jul 2023 15:14:12 +0300 Subject: [PATCH 15/16] Delete M_EmpGridComponent.cs --- Content.Server/_NF/M_Emp/M_EmpGridComponent.cs | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 Content.Server/_NF/M_Emp/M_EmpGridComponent.cs diff --git a/Content.Server/_NF/M_Emp/M_EmpGridComponent.cs b/Content.Server/_NF/M_Emp/M_EmpGridComponent.cs deleted file mode 100644 index 9e46b73a145..00000000000 --- a/Content.Server/_NF/M_Emp/M_EmpGridComponent.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace Content.Server._NF.M_Emp -{ - /// - /// A grid spawned by a salvage magnet. - /// - [RegisterComponent] - public sealed class M_EmpGridComponent : Component - { - /// - /// The magnet that spawned this grid. - /// - public EntityUid? SpawnerMagnet; - } -} From d65042da92bc74224a2cdaafb4c166014718bcf9 Mon Sep 17 00:00:00 2001 From: Cheackraze <71046427+Cheackraze@users.noreply.github.com> Date: Sat, 29 Jul 2023 18:47:48 -0400 Subject: [PATCH 16/16] fix yml linter --- .../Objects/Weapons/Guns/Projectiles/projectiles.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml index 38cc45b79cb..7b43a2cadfc 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml @@ -732,8 +732,11 @@ damage: types: Shock: 0 + - type: Sprite + sprite: Objects/Weapons/Guns/Projectiles/magic.rsi layers: - - state: grenade + - state: emp_projectile + shader: unshaded - type: EmpOnTrigger range: 0.3 energyConsumption: 50000