]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Allow plungers to be fired by bows and embedded into entities (#23406)
authorzzylex <146784470+zzylex@users.noreply.github.com>
Wed, 3 Jan 2024 05:36:16 +0000 (00:36 -0500)
committerGitHub <noreply@github.com>
Wed, 3 Jan 2024 05:36:16 +0000 (22:36 -0700)
* allow plungers to be fired by bows and embedded into entities

* fixed bow being able to shoot every object

Resources/Audio/Weapons/attributions.yml
Resources/Audio/Weapons/pop.ogg [new file with mode: 0644]
Resources/Prototypes/Entities/Objects/Specific/Janitorial/janitor.yml
Resources/Prototypes/Entities/Objects/Weapons/Guns/Bow/bow.yml
Resources/Textures/Objects/Weapons/Guns/Bow/bow.rsi/meta.json
Resources/Textures/Objects/Weapons/Guns/Bow/bow.rsi/unwielded-plunger.png [new file with mode: 0644]
Resources/Textures/Objects/Weapons/Guns/Bow/bow.rsi/wielded-plunger.png [new file with mode: 0644]

index b29f498fee66b763f0dc24c303d8160f5914ee57..310b01b7280a9f41b3965a906b3b8382fcf6d152 100644 (file)
@@ -82,3 +82,8 @@
   license: "CC0-1.0"
   copyright: "Taken from ScreamStudio on freesound.org"
   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/"
diff --git a/Resources/Audio/Weapons/pop.ogg b/Resources/Audio/Weapons/pop.ogg
new file mode 100644 (file)
index 0000000..99b58b2
Binary files /dev/null and b/Resources/Audio/Weapons/pop.ogg differ
index 8774dbf60e09d49a7cfe41c66b03c24f365c0b8e..e819d6c39f53c178aa0832e5e4add1d424f17c48 100644 (file)
   parent: BaseItem
   description: A plunger with a red plastic suction-cup and a wooden handle. Used to unclog drains.
   components:
-    - type: Tag
-      tags:
-        - Plunger
-        - WhitelistChameleon
-    - type: Sprite
-      sprite: Objects/Specific/Janitorial/plunger.rsi
-      state: plunger
-    - type: Item
-      sprite: Objects/Specific/Janitorial/plunger.rsi
-      heldPrefix: plunger
-    - type: ItemCooldown
-    - type: GuideHelp
-      guides:
-      - Janitorial
-    - type: Clothing
-      sprite: Objects/Specific/Janitorial/plunger.rsi
-      slots:
-        - HEAD
-      clothingVisuals:
-        head:
-          - state: equipped-HELMET
-            offset: "0, 0.15625"
+  - type: Tag
+    tags:
+       - Plunger
+       - WhitelistChameleon
+  - type: Sprite
+    sprite: Objects/Specific/Janitorial/plunger.rsi
+    state: plunger
+  - type: Item
+    sprite: Objects/Specific/Janitorial/plunger.rsi
+    heldPrefix: plunger
+  - type: ItemCooldown
+  - type: GuideHelp
+    guides:
+    - Janitorial
+  - type: Clothing
+    sprite: Objects/Specific/Janitorial/plunger.rsi
+    slots:
+      - HEAD
+    clothingVisuals:
+      head:
+        - state: equipped-HELMET
+          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
   parent: BaseItem
index 4b7125f571f5f0c527bb798219699f77074e6296..db98c6eabe90731e85bc58628419282f81bbb663 100644 (file)
@@ -1,4 +1,4 @@
-- type: entity
+- type: entity
   name: bow
   parent: BaseItem
   id: BaseBow
     soundEmpty: null
   - type: ItemSlots
     slots:
-      arrow:
-        name: Arrow
+      projectiles:
+        name: Projectiles
         startingItem: null
         insertSound: /Audio/Weapons/Guns/Misc/arrow_nock.ogg
         whitelist:
           tags:
           - Arrow
+          - Plunger
   - type: ContainerContainer
     containers:
-      arrow: !type:ContainerSlot
+      projectiles: !type:ContainerSlot
   - type: ContainerAmmoProvider
-    container: arrow
+    container: projectiles
 
 - type: entity
   id: BowImprovised
@@ -55,6 +56,9 @@
     - state: unwielded-arrow
       map: [ arrow ]
       visible: false
+    - state: unwielded-plunger
+      map: [ plunger ]
+      visible: false
   # to elucidate whats intended here:
   # 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`
   - type: ItemMapper
     spriteLayers:
     - arrow
+    - plunger
     mapLayers:
       arrow:
         whitelist:
           tags:
           - Arrow
+      plunger:
+        whitelist:
+          tags:
+          - Plunger
   - type: GenericVisualizer
     visuals:
       enum.WieldableVisuals.Wielded:
         arrow:
           True: { state: wielded-arrow }
           False: { state: unwielded-arrow }
+        plunger:
+          True: { state: wielded-plunger }
+          False: { state: unwielded-plunger }
         base:
           True: { state: wielded }
           False: { state: unwielded }
index f19b1121c1e6f7eb4aafc9bff669f4bb6c7088c2..71e01e8b14e1965a068d5169669ffdc389ddc0f9 100644 (file)
     },
     {
       "name": "unwielded-arrow"
+    },
+       {
+      "name": "unwielded-plunger"
     },
     {
       "name": "wielded"
     },
     {
       "name": "wielded-arrow"
+    },
+       {
+      "name": "wielded-plunger"
     },
     {
       "name": "equipped-BACKPACK",
diff --git a/Resources/Textures/Objects/Weapons/Guns/Bow/bow.rsi/unwielded-plunger.png b/Resources/Textures/Objects/Weapons/Guns/Bow/bow.rsi/unwielded-plunger.png
new file mode 100644 (file)
index 0000000..9b1c3a7
Binary files /dev/null and b/Resources/Textures/Objects/Weapons/Guns/Bow/bow.rsi/unwielded-plunger.png differ
diff --git a/Resources/Textures/Objects/Weapons/Guns/Bow/bow.rsi/wielded-plunger.png b/Resources/Textures/Objects/Weapons/Guns/Bow/bow.rsi/wielded-plunger.png
new file mode 100644 (file)
index 0000000..4c2ec44
Binary files /dev/null and b/Resources/Textures/Objects/Weapons/Guns/Bow/bow.rsi/wielded-plunger.png differ