From f8322d548e6c4306911e4a5d3fcaef49418ae03e Mon Sep 17 00:00:00 2001 From: SlamBamActionman <83650252+SlamBamActionman@users.noreply.github.com> Date: Tue, 15 Jul 2025 02:51:14 +0200 Subject: [PATCH] Adjust throwables hitboxes to match sprites (#38985) Initial commit --- .../Prototypes/Entities/Objects/Misc/pen.yml | 14 +++++++++ .../Objects/Specific/Janitorial/janitor.yml | 3 +- .../Entities/Objects/Specific/chemistry.yml | 2 +- .../Weapons/Guns/Projectiles/arrows.yml | 2 +- .../Entities/Objects/Weapons/Melee/knife.yml | 30 +++++++++++++++++++ .../Entities/Objects/Weapons/Melee/mining.yml | 15 ++++++++++ .../Objects/Weapons/Throwable/bola.yml | 10 +++++++ .../Objects/Weapons/Throwable/grenades.yml | 10 +++++++ .../Weapons/Throwable/projectile_grenades.yml | 10 +++++++ .../Weapons/Throwable/scattering_grenades.yml | 10 +++++++ 10 files changed, 103 insertions(+), 3 deletions(-) diff --git a/Resources/Prototypes/Entities/Objects/Misc/pen.yml b/Resources/Prototypes/Entities/Objects/Misc/pen.yml index bead4786b1..a9329b6782 100644 --- a/Resources/Prototypes/Entities/Objects/Misc/pen.yml +++ b/Resources/Prototypes/Entities/Objects/Misc/pen.yml @@ -42,6 +42,20 @@ damage: types: Piercing: 3 + - type: Fixtures + fixtures: + fix1: + shape: !type:PolygonShape + vertices: + - -0.3,0.1 + - -0.1,0.3 + - 0.3,-0.1 + - 0.1,-0.3 + density: 20 # derived from base_item + mask: + - ItemMask + restitution: 0.3 + friction: 0.2 #TODO: I want the luxury pen to write a cool font like Merriweather in the future. diff --git a/Resources/Prototypes/Entities/Objects/Specific/Janitorial/janitor.yml b/Resources/Prototypes/Entities/Objects/Specific/Janitorial/janitor.yml index 0a01e65eb9..35c9e51533 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/Janitorial/janitor.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/Janitorial/janitor.yml @@ -240,7 +240,7 @@ projectile: shape: !type:PhysShapeAabb - bounds: "-0.1,-0.1,0.1,0.1" + bounds: "-0.2,-0.4,0.2,-0.1" hard: false mask: - Impassable @@ -248,6 +248,7 @@ - type: EmbeddableProjectile sound: /Audio/Weapons/pop.ogg embedOnThrow: True + offset: "0,-0.1" - type: ThrowingAngle angle: 0 - type: LandAtCursor diff --git a/Resources/Prototypes/Entities/Objects/Specific/chemistry.yml b/Resources/Prototypes/Entities/Objects/Specific/chemistry.yml index 86214ca224..ebd785ab7e 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/chemistry.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/chemistry.yml @@ -473,7 +473,7 @@ inHandsMaxFillLevels: 3 inHandsFillBaseName: -fill- - type: EmbeddableProjectile - offset: "-0.1,0" + offset: "0,-0.1" minimumSpeed: 3 removalTime: 0.25 embedOnThrow: false diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/arrows.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/arrows.yml index 2c770adaa0..e9a0c6a381 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/arrows.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/arrows.yml @@ -20,7 +20,7 @@ projectile: shape: !type:PhysShapeAabb - bounds: "-0.1,-0.1,0.1,0.1" + bounds: "-0.1,-0.3,0.1,-0.1" hard: false mask: - Impassable diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Melee/knife.yml b/Resources/Prototypes/Entities/Objects/Weapons/Melee/knife.yml index edab0e8a94..71e6d16382 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Melee/knife.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Melee/knife.yml @@ -111,6 +111,21 @@ malus: 0.225 - type: ThrowingAngle angle: 225 + - type: Fixtures + fixtures: + fix1: + shape: !type:PolygonShape + radius: 0.01 + vertices: + - -0.4,-0.2 + - -0.2,-0.4 + - 0.4,0.2 + - 0.2,0.4 + density: 20 # derived from base_item + mask: + - ItemMask + restitution: 0.3 + friction: 0.2 - type: entity name: survival knife @@ -304,3 +319,18 @@ angle: 225 - type: StaticPrice price: 500 # 2000 for a set of 4 + - type: Fixtures + fixtures: + fix1: + shape: !type:PolygonShape + radius: 0.01 + vertices: + - -0.475,-0.225 + - -0.225,-0.475 + - 0.525,0.275 + - 0.275,0.525 + density: 20 # derived from base_item + mask: + - ItemMask + restitution: 0.3 + friction: 0.2 diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Melee/mining.yml b/Resources/Prototypes/Entities/Objects/Weapons/Melee/mining.yml index 3ed57e0495..cc09a5a378 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Melee/mining.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Melee/mining.yml @@ -195,6 +195,21 @@ malus: 0.225 - type: ThrowingAngle angle: 225 + - type: Fixtures + fixtures: + fix1: + shape: !type:PolygonShape + radius: 0.01 + vertices: + - -0.4,-0.2 + - -0.2,-0.4 + - 0.4,0.2 + - 0.2,0.4 + density: 20 # derived from base_item + mask: + - ItemMask + restitution: 0.3 + friction: 0.2 # Less mark damage in exchange for more healing. Also has a better ratio of blunt to slash damage, but less structural. - type: entity diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Throwable/bola.yml b/Resources/Prototypes/Entities/Objects/Weapons/Throwable/bola.yml index 7e4071b37e..69f3700426 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Throwable/bola.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Throwable/bola.yml @@ -49,3 +49,13 @@ canMoveBreakout: true maxEnsnares: 1 - type: LandAtCursor + - type: Fixtures + fixtures: + fix1: + shape: !type:PhysShapeCircle + radius: 0.4 + density: 20 # derived from base_item + mask: + - ItemMask + restitution: 0.3 + friction: 0.2 diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Throwable/grenades.yml b/Resources/Prototypes/Entities/Objects/Weapons/Throwable/grenades.yml index fbc7bc74ea..4d65cc0806 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Throwable/grenades.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Throwable/grenades.yml @@ -38,6 +38,16 @@ - type: Tag tags: - HandGrenade + - type: Fixtures + fixtures: + fix1: + shape: !type:PhysShapeCircle + radius: 0.2 + density: 20 # derived from base_item + mask: + - ItemMask + restitution: 0.3 + friction: 0.2 - type: entity name: explosive grenade diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Throwable/projectile_grenades.yml b/Resources/Prototypes/Entities/Objects/Weapons/Throwable/projectile_grenades.yml index b6e235292c..bdd8370b10 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Throwable/projectile_grenades.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Throwable/projectile_grenades.yml @@ -28,6 +28,16 @@ - type: Tag tags: - HandGrenade + - type: Fixtures + fixtures: + fix1: + shape: !type:PhysShapeCircle + radius: 0.2 + density: 20 # derived from base_item + mask: + - ItemMask + restitution: 0.3 + friction: 0.2 - type: entity parent: [ProjectileGrenadeBase, BaseSecurityContraband] diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Throwable/scattering_grenades.yml b/Resources/Prototypes/Entities/Objects/Weapons/Throwable/scattering_grenades.yml index 0fbc9e1694..9038df13e0 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Throwable/scattering_grenades.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Throwable/scattering_grenades.yml @@ -23,6 +23,16 @@ - type: Tag tags: - HandGrenade + - type: Fixtures + fixtures: + fix1: + shape: !type:PhysShapeCircle + radius: 0.2 + density: 20 # derived from base_item + mask: + - ItemMask + restitution: 0.3 + friction: 0.2 - type: entity parent: [ScatteringGrenadeBase, BaseSecurityContraband] -- 2.52.0