diff --git a/Content.Server/_FTL/TriggerOnEnterGrid/TriggerOnEnterGridComponent.cs b/Content.Server/_FTL/TriggerOnEnterGrid/TriggerOnEnterGridComponent.cs new file mode 100644 index 0000000000..4fe4f36914 --- /dev/null +++ b/Content.Server/_FTL/TriggerOnEnterGrid/TriggerOnEnterGridComponent.cs @@ -0,0 +1,7 @@ +namespace Content.Server._FTL.TriggerOnEnterGrid; + +[RegisterComponent] +public sealed partial class TriggerOnEnterGridComponent : Component +{ + public bool ReadyToTrigger = false; +} diff --git a/Content.Server/_FTL/TriggerOnEnterGrid/TriggerOnEnterGridSystem.cs b/Content.Server/_FTL/TriggerOnEnterGrid/TriggerOnEnterGridSystem.cs new file mode 100644 index 0000000000..d7b67bf475 --- /dev/null +++ b/Content.Server/_FTL/TriggerOnEnterGrid/TriggerOnEnterGridSystem.cs @@ -0,0 +1,35 @@ +using Content.Server.Explosion.EntitySystems; + +namespace Content.Server._FTL.TriggerOnEnterGrid; + +/// +/// This handles... +/// +public sealed class TriggerOnEnterGridSystem : EntitySystem +{ + public override void Update(float frameTime) + { + base.Update(frameTime); + + var query = EntityQueryEnumerator(); + while (query.MoveNext(out var entity, out var component, out var xform)) + { + switch (component.ReadyToTrigger) + { + case true when xform.GridUid.HasValue: + Trigger(entity); + break; + case false when !xform.GridUid.HasValue: + component.ReadyToTrigger = true; + break; + } + } + } + + public bool Trigger(EntityUid trigger, EntityUid? user = null) + { + var triggerEvent = new TriggerEvent(trigger, user); + EntityManager.EventBus.RaiseLocalEvent(trigger, triggerEvent, true); + return triggerEvent.Handled; + } +} diff --git a/Resources/Locale/en-US/_ftl/crates.ftl b/Resources/Locale/en-US/_ftl/crates.ftl index 0768fd24d3..e6b995ba26 100644 --- a/Resources/Locale/en-US/_ftl/crates.ftl +++ b/Resources/Locale/en-US/_ftl/crates.ftl @@ -37,6 +37,15 @@ ent-120mmAmmoAP = { ent-Crate120mmAmmoAP } ent-140mmAmmoAP = { ent-Crate140mmAmmoAP } .desc = { ent-Crate140mmAmmoAP.desc } +ent-105mmAmmoPS = { ent-Crate105mmAmmoPS } + .desc = { ent-Crate105mmAmmoPS.desc } + +ent-120mmAmmoPS = { ent-Crate120mmAmmoPS } + .desc = { ent-Crate120mmAmmoPS.desc } + +ent-140mmAmmoPS = { ent-Crate140mmAmmoPS } + .desc = { ent-Crate140mmAmmoPS.desc } + # crates # missiles ent-CrateT1Missiles = structural damage missiles @@ -50,13 +59,13 @@ ent-CrateT3Missiles = total area destruction missiles # ammo ent-Crate20mmAmmo = 20mm mixed ammo crate - .desc = This crate contains 20 boxes of 20mm, both HE and AP. + .desc = This crate contains 30 boxes of 20mm of several types of ammunition. ent-Crate53mmAmmo = 53mm mixed ammo crate - .desc = This crate contains 10 boxes of 53mm, both HE and AP. + .desc = This crate contains 15 boxes of 53mm of several types of ammunition. ent-Crate80mmAmmo = 80mm mixed ammo crate - .desc = This crate contains 6 boxes of 80mm, both HE and AP. + .desc = This crate contains 9 boxes of 80mm of several types of ammunition. ent-Crate105mmAmmoHE = 105mm ammo crate (HE) .desc = This crate contains 30 shells of high-explosive 105mm. @@ -75,3 +84,12 @@ ent-Crate120mmAmmoAP = 120mm ammo crate (AP) ent-Crate140mmAmmoAP = 140mm ammo crate (AP) .desc = This crate contains 10 shells of armor-piercing 140mm. + +ent-Crate105mmAmmoPS = 105mm ammo crate (PF) + .desc = This crate contains 30 shells of proximity-fuse 105mm. + +ent-Crate120mmAmmoPS = 120mm ammo crate (PF) + .desc = This crate contains 20 shells of proximity-fuse 120mm. + +ent-Crate140mmAmmoPS = 140mm ammo crate (PF) + .desc = This crate contains 10 shells of proximity-fuse 140mm. diff --git a/Resources/Prototypes/_FTL/Catalog/Cargo/cargo_security.yml b/Resources/Prototypes/_FTL/Catalog/Cargo/cargo_security.yml index cb8802b898..6e81de7ae8 100644 --- a/Resources/Prototypes/_FTL/Catalog/Cargo/cargo_security.yml +++ b/Resources/Prototypes/_FTL/Catalog/Cargo/cargo_security.yml @@ -107,3 +107,33 @@ cost: 30000 category: Security group: market + +- type: cargoProduct + id: 105mmAmmoPF + icon: + sprite: _FTL/Structures/Weapons/silo.rsi + state: closed + product: Crate105mmAmmoPF + cost: 10000 + category: Security + group: market + +- type: cargoProduct + id: 120mmAmmoPF + icon: + sprite: _FTL/Structures/Weapons/silo.rsi + state: closed + product: Crate120mmAmmoPF + cost: 10000 + category: Security + group: market + +- type: cargoProduct + id: 140mmAmmoPF + icon: + sprite: _FTL/Structures/Weapons/silo.rsi + state: closed + product: Crate140mmAmmoPF + cost: 30000 + category: Security + group: market diff --git a/Resources/Prototypes/_FTL/Catalog/Fills/Crates/ammo.yml b/Resources/Prototypes/_FTL/Catalog/Fills/Crates/ammo.yml index 2a55706892..6605a2511c 100644 --- a/Resources/Prototypes/_FTL/Catalog/Fills/Crates/ammo.yml +++ b/Resources/Prototypes/_FTL/Catalog/Fills/Crates/ammo.yml @@ -8,6 +8,8 @@ amount: 10 - id: MagazineBox20mmAP amount: 10 + - id: MagazineBox20mmPF + amount: 10 - type: entity id: Crate53mmAmmo @@ -19,6 +21,8 @@ amount: 5 - id: MagazineBox53mmAP amount: 5 + - id: MagazineBox53mmPF + amount: 5 - type: entity id: Crate80mmAmmo @@ -30,6 +34,8 @@ amount: 3 - id: MagazineBox80mmAP amount: 3 + - id: MagazineBox80mmPF + amount: 3 - type: entity id: Crate105mmAmmoHE @@ -84,3 +90,30 @@ contents: - id: Cartridge140mmAP amount: 10 + +- type: entity + id: Crate105mmAmmoPF + parent: CrateGenericSteel + components: + - type: StorageFill + contents: + - id: Cartridge105mmPF + amount: 30 + +- type: entity + id: Crate120mmAmmoPF + parent: CrateGenericSteel + components: + - type: StorageFill + contents: + - id: Cartridge120mmPF + amount: 20 + +- type: entity + id: Crate140mmAmmoPF + parent: CrateGenericSteel + components: + - type: StorageFill + contents: + - id: Cartridge140mmPF + amount: 10 diff --git a/Resources/Prototypes/_FTL/Entities/Objects/Weapons/Guns/Ammunition/Boxes/he.yml b/Resources/Prototypes/_FTL/Entities/Objects/Weapons/Guns/Ammunition/Boxes/he.yml index ac560aa127..b8f4b31695 100644 --- a/Resources/Prototypes/_FTL/Entities/Objects/Weapons/Guns/Ammunition/Boxes/he.yml +++ b/Resources/Prototypes/_FTL/Entities/Objects/Weapons/Guns/Ammunition/Boxes/he.yml @@ -1,6 +1,6 @@ - type: entity id: MagazineBox20mm - name: ammo box (20mm) + name: ammo box (20mm high-explosive) parent: BaseMagazineBox components: - type: Tag @@ -16,7 +16,7 @@ - type: entity id: MagazineBox53mm - name: ammo box (53mm) + name: ammo box (53mm high-explosive) parent: BaseMagazineBox components: - type: Tag @@ -32,7 +32,7 @@ - type: entity id: MagazineBox80mm - name: ammo box (80mm) + name: ammo box (80mm high-explosive) parent: BaseMagazineBox components: - type: Tag diff --git a/Resources/Prototypes/_FTL/Entities/Objects/Weapons/Guns/Ammunition/Boxes/ps.yml b/Resources/Prototypes/_FTL/Entities/Objects/Weapons/Guns/Ammunition/Boxes/ps.yml new file mode 100644 index 0000000000..41414384a5 --- /dev/null +++ b/Resources/Prototypes/_FTL/Entities/Objects/Weapons/Guns/Ammunition/Boxes/ps.yml @@ -0,0 +1,47 @@ +- type: entity + id: MagazineBox20mmPF + name: ammo box (20mm proximity fuse) + parent: BaseMagazineBox + components: + - type: Tag + tags: + - Magazine20mm + - type: BallisticAmmoProvider + mayTransfer: true + whitelist: + tags: + - Cartridge20mm + proto: Cartridge20mmPF + capacity: 500 + +- type: entity + id: MagazineBox53mmPF + name: ammo box (53mm proximity fuse) + parent: BaseMagazineBox + components: + - type: Tag + tags: + - Magazine53mm + - type: BallisticAmmoProvider + mayTransfer: true + whitelist: + tags: + - Cartridge53mm + proto: Cartridge53mmPF + capacity: 500 + +- type: entity + id: MagazineBox80mmPF + name: ammo box (80mm proximity fuse) + parent: BaseMagazineBox + components: + - type: Tag + tags: + - Magazine80mm + - type: BallisticAmmoProvider + mayTransfer: true + whitelist: + tags: + - Cartridge80mm + proto: Cartridge80mmPF + capacity: 250 diff --git a/Resources/Prototypes/_FTL/Entities/Objects/Weapons/Guns/Ammunition/Cartridges/ps.yml b/Resources/Prototypes/_FTL/Entities/Objects/Weapons/Guns/Ammunition/Cartridges/ps.yml new file mode 100644 index 0000000000..7f66090883 --- /dev/null +++ b/Resources/Prototypes/_FTL/Entities/Objects/Weapons/Guns/Ammunition/Cartridges/ps.yml @@ -0,0 +1,102 @@ +- type: entity + id: Cartridge20mmPF + name: cartridge (20mm proximity fuse) + parent: BaseCartridge + components: + - type: Tag + tags: + - Cartridge + - Cartridge20mm + - type: Sprite + sprite: _FTL/Objects/Weapons/Guns/Ammunition/Explosives/explosives.rsi + layers: + - state: 20mm + - type: Appearance + - type: CartridgeAmmo + deleteOnSpawn: true + proto: Bullet20mmPF +- type: entity + id: Cartridge53mmPF + name: cartridge (53mm proximity fuse) + parent: BaseCartridge + components: + - type: Tag + tags: + - Cartridge + - Cartridge53mm + - type: Sprite + sprite: _FTL/Objects/Weapons/Guns/Ammunition/Explosives/explosives.rsi + layers: + - state: 53mm + - type: Appearance + - type: CartridgeAmmo + deleteOnSpawn: true + proto: Bullet53mmPF +- type: entity + id: Cartridge80mmPF + name: cartridge (80mm proximity fuse) + parent: BaseCartridge + components: + - type: Tag + tags: + - Cartridge + - Cartridge80mm + - type: Sprite + sprite: _FTL/Objects/Weapons/Guns/Ammunition/Explosives/explosives.rsi + layers: + - state: 53mm # we do a thing called "reusing sprites" + - type: Appearance + - type: CartridgeAmmo + deleteOnSpawn: true + proto: Bullet80mmPF +- type: entity + id: Cartridge105mmPF + name: cartridge (105mm proximity fuse) + parent: BaseCartridge + components: + - type: Tag + tags: + - Cartridge + - Cartridge105mm + - type: Sprite + sprite: _FTL/Objects/Weapons/Guns/Ammunition/Explosives/explosives.rsi + layers: + - state: 105mm + - type: Appearance + - type: CartridgeAmmo + deleteOnSpawn: true + proto: Bullet105mmPF +- type: entity + id: Cartridge120mmPF + name: cartridge (120mm proximity fuse) + parent: BaseCartridge + components: + - type: Tag + tags: + - Cartridge + - Cartridge120mm + - type: Sprite + sprite: _FTL/Objects/Weapons/Guns/Ammunition/Explosives/explosives.rsi + layers: + - state: 105mm # we do a thing called "reusing sprites" + - type: Appearance + - type: CartridgeAmmo + deleteOnSpawn: true + proto: Bullet120mmPF +- type: entity + id: Cartridge140mmPF + name: cartridge (140mm proximity fuse) + parent: BaseCartridge + components: + - type: Tag + tags: + - Cartridge + - Cartridge140mm + - type: Sprite + sprite: _FTL/Objects/Weapons/Guns/Ammunition/Explosives/explosives.rsi + layers: + - state: 140mm + - type: Appearance + - type: CartridgeAmmo + deleteOnSpawn: true + proto: Bullet140mmPF diff --git a/Resources/Prototypes/_FTL/Entities/Objects/Weapons/Guns/Ammunition/Cartridges/explosive.yml b/Resources/Prototypes/_FTL/Entities/Objects/Weapons/Guns/Ammunition/explosive.yml similarity index 100% rename from Resources/Prototypes/_FTL/Entities/Objects/Weapons/Guns/Ammunition/Cartridges/explosive.yml rename to Resources/Prototypes/_FTL/Entities/Objects/Weapons/Guns/Ammunition/explosive.yml diff --git a/Resources/Prototypes/_FTL/Entities/Objects/Weapons/Guns/Projectiles/ps.yml b/Resources/Prototypes/_FTL/Entities/Objects/Weapons/Guns/Projectiles/ps.yml new file mode 100644 index 0000000000..b169701b23 --- /dev/null +++ b/Resources/Prototypes/_FTL/Entities/Objects/Weapons/Guns/Projectiles/ps.yml @@ -0,0 +1,113 @@ +- type: entity + id: Bullet20mmPF + name: 20mm + parent: BaseBulletTrigger + noSpawn: true + components: + - type: Sprite + sprite: _FTL/Objects/Weapons/Guns/Ammunition/Explosives/explosives.rsi + layers: + - state: 20mm + - type: ExplodeOnTrigger + - type: Explosive + explosionType: Default + totalIntensity: 50.0 + intensitySlope: 8 + maxIntensity: 100 + maxTileBreak: 1 + - type: TriggerOnEnterGrid + +- type: entity + id: Bullet53mmPF + name: 53mm + parent: BaseBulletTrigger + noSpawn: true + components: + - type: Sprite + sprite: _FTL/Objects/Weapons/Guns/Ammunition/Explosives/explosives.rsi + layers: + - state: 53mm + - type: ExplodeOnTrigger + - type: Explosive + explosionType: Default + totalIntensity: 50.0 + intensitySlope: 4 + maxIntensity: 100 + maxTileBreak: 1 + - type: TriggerOnEnterGrid + +- type: entity + id: Bullet80mmPF + name: 80mm + parent: BaseBulletTrigger + noSpawn: true + components: + - type: Sprite + sprite: _FTL/Objects/Weapons/Guns/Ammunition/Explosives/explosives.rsi + layers: + - state: 53mm + - type: ExplodeOnTrigger + - type: Explosive + explosionType: Default + totalIntensity: 250.0 + intensitySlope: 17 + maxIntensity: 250 + maxTileBreak: 1 + - type: TriggerOnEnterGrid + +- type: entity + id: Bullet105mmPF + name: 105mm + parent: BaseBulletTrigger + noSpawn: true + components: + - type: Sprite + sprite: _FTL/Objects/Weapons/Guns/Ammunition/Explosives/explosives.rsi + layers: + - state: 105mm + - type: ExplodeOnTrigger + - type: Explosive + explosionType: Default + totalIntensity: 500.0 + intensitySlope: 15 + maxIntensity: 100 + maxTileBreak: 1 + - type: TriggerOnEnterGrid + +- type: entity + id: Bullet120mmPF + name: 120mm + parent: BaseBulletTrigger + noSpawn: true + components: + - type: Sprite + sprite: _FTL/Objects/Weapons/Guns/Ammunition/Explosives/explosives.rsi + layers: + - state: 105mm + - type: ExplodeOnTrigger + - type: Explosive + explosionType: Default + totalIntensity: 600.0 + intensitySlope: 15 + maxIntensity: 250 + maxTileBreak: 1 + - type: TriggerOnEnterGrid + +- type: entity + id: Bullet140mmPF + name: 140mm + parent: BaseBulletTrigger + noSpawn: true + components: + - type: Sprite + sprite: _FTL/Objects/Weapons/Guns/Ammunition/Explosives/explosives.rsi + layers: + - state: 140mm + - type: ExplodeOnTrigger + - type: Explosive + explosionType: Default + totalIntensity: 700.0 + intensitySlope: 15 + maxIntensity: 500 + maxTileBreak: 1 + - type: TriggerOnEnterGrid