-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Proximity fuse * Proximity fuse is now purchasable * Fix "PS" not being "PF"
- Loading branch information
1 parent
c8fb819
commit e7b8e58
Showing
10 changed files
with
391 additions
and
6 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
Content.Server/_FTL/TriggerOnEnterGrid/TriggerOnEnterGridComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace Content.Server._FTL.TriggerOnEnterGrid; | ||
|
||
[RegisterComponent] | ||
public sealed partial class TriggerOnEnterGridComponent : Component | ||
{ | ||
public bool ReadyToTrigger = false; | ||
} |
35 changes: 35 additions & 0 deletions
35
Content.Server/_FTL/TriggerOnEnterGrid/TriggerOnEnterGridSystem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using Content.Server.Explosion.EntitySystems; | ||
|
||
namespace Content.Server._FTL.TriggerOnEnterGrid; | ||
|
||
/// <summary> | ||
/// This handles... | ||
/// </summary> | ||
public sealed class TriggerOnEnterGridSystem : EntitySystem | ||
{ | ||
public override void Update(float frameTime) | ||
{ | ||
base.Update(frameTime); | ||
|
||
var query = EntityQueryEnumerator<TriggerOnEnterGridComponent, TransformComponent>(); | ||
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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
Resources/Prototypes/_FTL/Entities/Objects/Weapons/Guns/Ammunition/Boxes/ps.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
102 changes: 102 additions & 0 deletions
102
Resources/Prototypes/_FTL/Entities/Objects/Weapons/Guns/Ammunition/Cartridges/ps.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
File renamed without changes.
Oops, something went wrong.