Add Modular grenades (chemnades). (#7138)

This commit is contained in:
Leon Friedrich
2022-03-25 17:17:29 +13:00
committed by GitHub
parent 414c03978d
commit 1b0e7ae0f5
51 changed files with 994 additions and 96 deletions

View File

@@ -98,6 +98,8 @@
- Syringe
- ReagentGrinderMachineCircuitboard
- PillCanister
- TimerTrigger
- ChemicalPayload
- type: technology
name: "medical machinery"

View File

@@ -0,0 +1,27 @@
# Misc electronic trigger devices.
# TODO:
# - proximity
# - voice
# - machine linking
# - device network
# - biometric/health (maybe just via device nets?)
# - booby-trap / on-storage-open
- type: entity
parent: BaseItem
id: TimerTrigger
name: timer trigger
description: A configurable timer.
components:
- type: Sprite
sprite: Objects/Devices/timer.rsi
state: timer
- type: Item
size: 5
- type: PayloadTrigger
components:
- type: OnUseTimerTrigger
delay: 5
delayOptions: [3, 5, 10, 15, 30]
initialBeepDelay: 0
beepSound: /Audio/Machines/Nuke/general_beep.ogg

View File

@@ -0,0 +1,76 @@
- type: entity
parent: BaseItem
abstract: true
id: BasePayload
components:
- type: Appearance
- type: Sprite
netsync: false
- type: Tag
tags:
- Payload
- type: Damageable
damageContainer: Inorganic
- type: Destructible
thresholds:
- trigger:
!type:DamageTrigger
damage: 50
behaviors:
- !type:DoActsBehavior
acts: [ "Destruction" ]
- type: entity
name: explosive payload
parent: BasePayload
id: ExplosivePayload
components:
- type: Sprite
sprite: Objects/Devices/payload.rsi
state: payload-explosive-armed
- type: Explosive
devastationRange: 0
heavyImpactRange: 2
lightImpactRange: 4
flashRange: 7
- type: ExplodeOnTrigger
- type: Destructible
thresholds:
- trigger:
!type:DamageTypeTrigger
damageType: Heat
damage: 25
behaviors:
- !type:ExplodeBehavior
- trigger:
!type:DamageTrigger
damage: 50
behaviors:
- !type:DoActsBehavior
acts: [ "Destruction" ]
- type: entity
name: chemical payload
parent: BasePayload
id: ChemicalPayload
description: A chemical payload. Has space to store two beakers. In combination with a trigger and a case, this can be used to initiate chemical reactions.
components:
- type: Sprite
sprite: Objects/Devices/payload.rsi
state: payload-empty
- type: ChemicalPayload
beakerSlotA: &slotDef
whitelist:
components:
- FitsInDispenser
swap: false
beakerSlotB: *slotDef
- type: Appearance
visuals:
- type: GenericEnumVisualizer
key: enum.ChemicalPayloadVisuals.Slots
states:
enum.ChemicalPayloadFilledSlots.None: payload-empty
enum.ChemicalPayloadFilledSlots.Left: payload-chemical-left
enum.ChemicalPayloadFilledSlots.Right: payload-chemical-right
enum.ChemicalPayloadFilledSlots.Both: payload-chemical-armed

View File

@@ -19,3 +19,9 @@
variation: 0.125
- type: UseDelay
delay: 0.5
- type: EmitSoundOnTrigger
sound:
collection: BikeHorn
- type: Tag
tags:
- Payload # yes, you can make re-usable prank grenades

View File

@@ -1,8 +1,6 @@
- type: entity
name: beaker
parent: BaseItem
description: Used to contain a moderate amount of chemicals and solutions.
id: Beaker
id: BaseBeaker
components:
- type: Tag
tags:
@@ -39,8 +37,6 @@
interfaces:
- key: enum.TransferAmountUiKey.Key
type: TransferAmountBoundUserInterface
- type: Spillable
solution: beaker
- type: Drink
isOpen: true
- type: Appearance
@@ -60,7 +56,8 @@
- !type:PlaySoundBehavior
sound:
collection: GlassBreak
- !type:SpillBehavior { }
- !type:SpillBehavior
solution: beaker
- !type:SpawnEntitiesBehavior
spawn:
ShardGlass:
@@ -82,12 +79,23 @@
types:
Blunt: 5
- type: entity
name: beaker
parent: BaseBeaker
description: Used to contain a moderate amount of chemicals and solutions.
id: Beaker
components:
- type: Spillable
solution: beaker
- type: entity
name: large beaker
parent: Beaker
parent: BaseBeaker
description: Used to contain a large amount of chemicals or solutions.
id: LargeBeaker
components:
- type: Spillable
solution: beaker
- type: Sprite
sprite: Objects/Specific/Chemistry/beaker_large.rsi
layers:
@@ -109,7 +117,7 @@
- type: entity
name: cryostasis beaker
parent: Beaker
parent: BaseBeaker
description: Used to contain chemicals or solutions without reactions.
id: CryostasisBeaker
components:
@@ -122,13 +130,28 @@
beaker:
maxVol: 40
canReact: false
- type: Damageable
damageContainer: Inorganic
damageModifierSet: FlimsyMetallic
- type: Destructible
thresholds:
- trigger:
!type:DamageTrigger
damage: 100
behaviors:
- !type:SpillBehavior
solution: beaker
- !type:DoActsBehavior
acts: [ "Destruction" ]
- type: entity
name: bluespace beaker
parent: Beaker
parent: BaseBeaker
description: Powered by experimental bluespace technology.
id: BluespaceBeaker
components:
- type: Spillable
solution: beaker
- type: Sprite
sprite: Objects/Specific/Chemistry/beaker_bluespace.rsi
layers:

View File

@@ -64,7 +64,7 @@
path: /Audio/Weapons/Guns/Hits/snap.ogg
- type: FlashOnTrigger
range: 1
- type: SoundOnTrigger
- type: EmitSoundOnTrigger
sound:
path: "/Audio/Effects/flash_bang.ogg"

View File

@@ -58,7 +58,7 @@
delay: 3.5
- type: FlashOnTrigger
range: 7
- type: SoundOnTrigger
- type: EmitSoundOnTrigger
sound:
path: "/Audio/Effects/flash_bang.ogg"
- type: DeleteOnTrigger
@@ -148,3 +148,36 @@
- type: TimerTriggerVisualizer
countdown_sound:
path: /Audio/Effects/countdown.ogg
- type: entity
name: modular grenade
description: A grenade casing. Requires a trigger and a payload.
parent: BaseItem
id: ModularGrenade
components:
- type: Sprite
sprite: Objects/Weapons/Grenades/modular.rsi
state: empty
- type: Item
size: 8
- type: PayloadCase
- type: Construction
graph: ModularGrenadeGraph
node: emptyCase
- type: Damageable
damageContainer: Inorganic
- type: Destructible
thresholds:
- trigger:
!type:DamageTrigger
damage: 50
behaviors:
- !type:DoActsBehavior
acts: [ "Destruction" ]
- type: Appearance
visuals:
- type: GenericEnumVisualizer
key: enum.Trigger.TriggerVisuals.VisualState
states:
enum.Trigger.TriggerVisualState.Primed: primed
enum.Trigger.TriggerVisualState.Unprimed: complete

View File

@@ -56,7 +56,7 @@
id: PortableFlasher
description: An ultrabright flashbulb with a proximity trigger, useful for making an area security-only.
components:
- type: SoundOnTrigger
- type: EmitSoundOnTrigger
sound:
path: /Audio/Weapons/flash.ogg
- type: FlashOnTrigger

View File

@@ -185,6 +185,8 @@
- KitchenKnife
- ButchCleaver
- FlashlightLantern
- TimerTrigger
- ChemicalPayload
- type: ActivatableUI
key: enum.LatheUiKey.Key #Yes only having 1 of them here doesn't break anything
- type: ActivatableUIRequiresPower
@@ -294,6 +296,7 @@
- CableStack
- CableMVStack
- CableHVStack
- TimerTrigger
- type: entity
parent: Autolathe

View File

@@ -0,0 +1,83 @@
- type: constructionGraph
id: ModularGrenadeGraph
start: start
graph:
- node: start
edges:
- to: emptyCase
steps:
- material: Steel
amount: 5
doAfter: 1
- node: emptyCase
entity: ModularGrenade
actions:
- !type:SpriteStateChange
state: empty
edges:
- to: wiredCase
steps:
- material: Cable
doAfter: 0.5
- node: wiredCase
entity: ModularGrenade
actions:
- !type:SpriteStateChange
state: wired
- !type:PlaySound
sound: /Audio/Machines/button.ogg
edges:
- to: emptyCase
steps:
- tool: Cutting
doAfter: 0.5
completed:
- !type:SpawnPrototype
prototype: CableApcStack1
- to: caseWithTrigger
steps:
- component: PayloadTrigger
store: payloadTrigger
name: Trigger
doAfter: 0.5
- node: caseWithTrigger
actions:
- !type:SpriteStateChange
state: no-payload
- !type:PlaySound
sound: /Audio/Machines/button.ogg
edges:
- to: wiredCase
steps:
- tool: Prying
doAfter: 0.5
completed:
- !type:EmptyContainer
container: payloadTrigger
- to: grenade
steps:
- tag: Payload
store: payload
name: Payload
doAfter: 0.5
- node: grenade
actions:
- !type:SpriteStateChange
state: complete
- !type:PlaySound
sound: /Audio/Machines/button.ogg
- !type:AdminLog
message: "A grenade was crafted"
edges:
- to: caseWithTrigger
steps:
- tool: Prying
doAfter: 0.5
completed:
- !type:EmptyContainer
container: payload

View File

@@ -0,0 +1,12 @@
- type: construction
name: Modular Grenade
id: ModularGrenadeRecipe
graph: ModularGrenadeGraph
startNode: start
targetNode: grenade
category: Weapons
description: Construct a grenade using a trigger and a payload.
icon:
sprite: Objects/Weapons/Grenades/modular.rsi
state: complete
objectType: Item

View File

@@ -18,4 +18,4 @@
category: Weapons
description: A simple weapon for tripping someone at a distance.
icon: Objects/Weapons/Throwable/bola.rsi/icon.png
objectType: Item
objectType: Item

View File

@@ -0,0 +1,21 @@
- type: latheRecipe
id: TimerTrigger
icon:
sprite: Objects/Devices/timer.rsi
state: timer
result: TimerTrigger
completetime: 500
materials:
Steel: 300
Plastic: 200
- type: latheRecipe
id: ChemicalPayload
icon:
sprite: Objects/Devices/payload.rsi
state: payload-empty
result: ChemicalPayload
completetime: 500
materials:
Steel: 200
Plastic: 300

View File

@@ -216,6 +216,9 @@
- type: Tag
id: Ore
- type: Tag
id: Payload # for grenade/bomb crafting
- type: Tag
id: PercussionInstrument