Allow plungers to be fired by bows and embedded into entities (#23406)

* allow plungers to be fired by bows and embedded into entities

* fixed bow being able to shoot every object
This commit is contained in:
zzylex
2024-01-03 00:36:16 -05:00
committed by GitHub
parent d008488664
commit 0f85e10747
7 changed files with 81 additions and 27 deletions

View File

@@ -82,3 +82,8 @@
license: "CC0-1.0" license: "CC0-1.0"
copyright: "Taken from ScreamStudio on freesound.org" copyright: "Taken from ScreamStudio on freesound.org"
source: "https://freesound.org/people/ScreamStudio/sounds/392617/" source: "https://freesound.org/people/ScreamStudio/sounds/392617/"
- files: ["pop.ogg"]
license: "CC0-1.0"
copyright: "Taken from 0ne_one111yt on freesound.org"
source: "https://freesound.org/people/0ne_one111yt/sounds/478213/"

Binary file not shown.

View File

@@ -552,28 +552,59 @@
parent: BaseItem parent: BaseItem
description: A plunger with a red plastic suction-cup and a wooden handle. Used to unclog drains. description: A plunger with a red plastic suction-cup and a wooden handle. Used to unclog drains.
components: components:
- type: Tag - type: Tag
tags: tags:
- Plunger - Plunger
- WhitelistChameleon - WhitelistChameleon
- type: Sprite - type: Sprite
sprite: Objects/Specific/Janitorial/plunger.rsi sprite: Objects/Specific/Janitorial/plunger.rsi
state: plunger state: plunger
- type: Item - type: Item
sprite: Objects/Specific/Janitorial/plunger.rsi sprite: Objects/Specific/Janitorial/plunger.rsi
heldPrefix: plunger heldPrefix: plunger
- type: ItemCooldown - type: ItemCooldown
- type: GuideHelp - type: GuideHelp
guides: guides:
- Janitorial - Janitorial
- type: Clothing - type: Clothing
sprite: Objects/Specific/Janitorial/plunger.rsi sprite: Objects/Specific/Janitorial/plunger.rsi
slots: slots:
- HEAD - HEAD
clothingVisuals: clothingVisuals:
head: head:
- state: equipped-HELMET - state: equipped-HELMET
offset: "0, 0.15625" offset: "0, 0.15625"
- type: Fixtures
fixtures:
fix1:
shape: !type:PhysShapeCircle
radius: 0.2
density: 5
mask:
- ItemMask
restitution: 0.3
friction: 0.2
projectile:
shape:
!type:PhysShapeAabb
bounds: "-0.1,-0.1,0.1,0.1"
hard: false
mask:
- Impassable
- BulletImpassable
- type: EmbeddableProjectile
sound: /Audio/Weapons/pop.ogg
embedOnThrow: True
- type: ThrowingAngle
angle: 0
- type: Ammo
muzzleFlash: null
- type: Projectile
deleteOnCollide: false
onlyCollideWhenShot: true
damage:
types:
Blunt: 3
- type: entity - type: entity
parent: BaseItem parent: BaseItem

View File

@@ -1,4 +1,4 @@
- type: entity - type: entity
name: bow name: bow
parent: BaseItem parent: BaseItem
id: BaseBow id: BaseBow
@@ -31,18 +31,19 @@
soundEmpty: null soundEmpty: null
- type: ItemSlots - type: ItemSlots
slots: slots:
arrow: projectiles:
name: Arrow name: Projectiles
startingItem: null startingItem: null
insertSound: /Audio/Weapons/Guns/Misc/arrow_nock.ogg insertSound: /Audio/Weapons/Guns/Misc/arrow_nock.ogg
whitelist: whitelist:
tags: tags:
- Arrow - Arrow
- Plunger
- type: ContainerContainer - type: ContainerContainer
containers: containers:
arrow: !type:ContainerSlot projectiles: !type:ContainerSlot
- type: ContainerAmmoProvider - type: ContainerAmmoProvider
container: arrow container: projectiles
- type: entity - type: entity
id: BowImprovised id: BowImprovised
@@ -55,6 +56,9 @@
- state: unwielded-arrow - state: unwielded-arrow
map: [ arrow ] map: [ arrow ]
visible: false visible: false
- state: unwielded-plunger
map: [ plunger ]
visible: false
# to elucidate whats intended here: # to elucidate whats intended here:
# arrow is inserted -> ItemMapper sets layer with map `arrow` to visible # arrow is inserted -> ItemMapper sets layer with map `arrow` to visible
# bow is wielded -> generic vis sets states of layers with map `arrow` and `base` # bow is wielded -> generic vis sets states of layers with map `arrow` and `base`
@@ -63,17 +67,25 @@
- type: ItemMapper - type: ItemMapper
spriteLayers: spriteLayers:
- arrow - arrow
- plunger
mapLayers: mapLayers:
arrow: arrow:
whitelist: whitelist:
tags: tags:
- Arrow - Arrow
plunger:
whitelist:
tags:
- Plunger
- type: GenericVisualizer - type: GenericVisualizer
visuals: visuals:
enum.WieldableVisuals.Wielded: enum.WieldableVisuals.Wielded:
arrow: arrow:
True: { state: wielded-arrow } True: { state: wielded-arrow }
False: { state: unwielded-arrow } False: { state: unwielded-arrow }
plunger:
True: { state: wielded-plunger }
False: { state: unwielded-plunger }
base: base:
True: { state: wielded } True: { state: wielded }
False: { state: unwielded } False: { state: unwielded }

View File

@@ -12,12 +12,18 @@
}, },
{ {
"name": "unwielded-arrow" "name": "unwielded-arrow"
},
{
"name": "unwielded-plunger"
}, },
{ {
"name": "wielded" "name": "wielded"
}, },
{ {
"name": "wielded-arrow" "name": "wielded-arrow"
},
{
"name": "wielded-plunger"
}, },
{ {
"name": "equipped-BACKPACK", "name": "equipped-BACKPACK",

Binary file not shown.

After

Width:  |  Height:  |  Size: 267 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 265 B