Skip to content

Commit

Permalink
airbag tweaks (#13683)
Browse files Browse the repository at this point in the history
* 1

* Update ties.dm

* Update designs.dm

* Update ties.dm

* 1
  • Loading branch information
simb11 authored Dec 26, 2024
1 parent 96c99cd commit bffb385
Show file tree
Hide file tree
Showing 17 changed files with 43 additions and 35 deletions.
1 change: 1 addition & 0 deletions code/__DEFINES/traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@
#define TRAIT_WILLPOWER_IMPLANT "willpower_implant"
#define TRAIT_CAN_LEAP "can_leap"
#define TRAIT_AUTOFIRE_SHOOTS "autofire_shoots"
#define TRAIT_AIRBAG_PROTECTION "airbag_protection"

/*
* Used for movables that need to be updated, via COMSIG_ENTER_AREA and COMSIG_EXIT_AREA, when transitioning areas.
Expand Down
20 changes: 0 additions & 20 deletions code/game/objects/items/airbag.dm

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
new /obj/item/device/flash(src)
new /obj/item/weapon/reagent_containers/hypospray/cmo(src)
new /obj/item/clothing/suit/surgicalapron(src)
new /obj/item/airbag(src)
new /obj/item/clothing/neck/airbag(src)
new /obj/item/weapon/storage/pouch/medical_supply(src)
new /obj/item/weapon/storage/lockbox/medal/cmo(src)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@
new /obj/item/clothing/mask/gas/coloured(src)
new /obj/item/device/flash(src)
new /obj/item/device/remote_device/research_director(src)
new /obj/item/airbag(src)
new /obj/item/clothing/neck/airbag(src)
new /obj/item/weapon/storage/lockbox/medal/rd(src)
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
new /obj/item/clothing/under/dress/dress_cap(src)
new /obj/item/clothing/under/rank/capcamsole(src)
new /obj/item/device/remote_device/captain(src)
new /obj/item/airbag(src)
new /obj/item/clothing/neck/airbag(src)
new /obj/item/weapon/storage/pouch/pistol_holster(src)
new /obj/item/weapon/storage/lockbox/medal/captain(src)
if(SSenvironment.envtype[z] == ENV_TYPE_SNOW)
Expand Down Expand Up @@ -99,7 +99,7 @@

new /obj/item/clothing/accessory/holster/armpit(src)
new /obj/item/device/flash(src)
new /obj/item/airbag(src)
new /obj/item/clothing/neck/airbag(src)
new /obj/item/weapon/storage/pouch/pistol_holster(src)
new /obj/item/weapon/storage/lockbox/medal/hop(src)

Expand Down Expand Up @@ -173,7 +173,7 @@
new /obj/item/weapon/melee/telebaton(src)
new /obj/item/device/flashlight/flare(src)
new /obj/item/device/flashlight/seclite(src)
new /obj/item/airbag(src)
new /obj/item/clothing/neck/airbag(src)
new /obj/item/weapon/storage/pouch/pistol_holster(src)
new /obj/item/weapon/storage/pouch/baton_holster(src)
new /obj/item/weapon/storage/lockbox/medal/hos(src)
Expand Down
4 changes: 2 additions & 2 deletions code/modules/atmospheric/ZAS/Airflow.dm
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,8 @@ Contains helper procs for airflow, handled in /connection_group.

/mob/living/carbon/human/airflow_hit(atom/A)
playsound(src, pick(SOUNDIN_PUNCH_MEDIUM), VOL_EFFECTS_MASTER, 25)
var/obj/item/airbag/I = locate() in get_contents()
if(I)
var/obj/item/clothing/neck/airbag/I = locate() in get_contents()
if(I && !I.deployed)
I.deploy(src)
return

Expand Down
25 changes: 25 additions & 0 deletions code/modules/clothing/neck/ties.dm
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,28 @@
icon_state = "mantle-unathi"
item_state = "mantle-unathi"
body_parts_covered = UPPER_TORSO

/obj/item/clothing/neck/airbag
name = "personal airbag"
desc = "One-use protection from high-speed collisions and low pressure."
icon_state = "airbag"
item_state = "airbag"
slot_flags = SLOT_FLAGS_BELT | SLOT_FLAGS_NECK
var/deployed = FALSE

/obj/item/clothing/neck/airbag/proc/deploy(mob/user)
user.drop_from_inventory(src, get_turf(src))
icon_state = "airbag_deployed"
anchored = TRUE
user.forceMove(src)
deployed = TRUE
ADD_TRAIT(user, TRAIT_AIRBAG_PROTECTION, GENERIC_TRAIT)
to_chat(user, "<span class='warning'>Your [src] deploys!</span>")
playsound(src, 'sound/effects/inflate.ogg', VOL_EFFECTS_MASTER)
addtimer(CALLBACK(src, PROC_REF(delete)), 5 SECOND)

/obj/item/clothing/neck/airbag/proc/delete(mob/user)
for(var/atom/movable/AM in contents)
AM.forceMove(get_turf(src))
REMOVE_TRAIT(user, TRAIT_AIRBAG_PROTECTION, GENERIC_TRAIT)
qdel(src)
3 changes: 3 additions & 0 deletions code/modules/mob/living/carbon/human/life.dm
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@
var/pressure_loss = S.damage * 0.1
pressure_adjustment_coefficient = pressure_loss

if(HAS_TRAIT(src, TRAIT_AIRBAG_PROTECTION))
pressure_adjustment_coefficient = 0

pressure_adjustment_coefficient = CLAMP01(pressure_adjustment_coefficient) //So it isn't less than 0 or larger than 1.
pressure_adjustment_coefficient *= 1 - species.get_pressure_protection(src)

Expand Down
4 changes: 2 additions & 2 deletions code/modules/research/designs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2649,11 +2649,11 @@ other types of metals and chemistry for reagents).

/datum/design/airbag
name = "Personal airbag"
desc = "One-use protection from high-speed collisions"
desc = "One-use protection from high-speed collisions and low pressure."
id = "airbag"
build_type = PROTOLATHE
materials = list(MAT_METAL = 500, MAT_SILVER = 500)
build_path = /obj/item/airbag
build_path = /obj/item/clothing/neck/airbag
category = list("Support")

/datum/design/universal_pyrometer
Expand Down
Binary file modified icons/mob/inhands/clothing_lefthand.dmi
Binary file not shown.
Binary file modified icons/mob/inhands/clothing_righthand.dmi
Binary file not shown.
Binary file modified icons/mob/neck.dmi
Binary file not shown.
Binary file modified icons/obj/clothing/neck.dmi
Binary file not shown.
Binary file modified icons/obj/items.dmi
Binary file not shown.
2 changes: 1 addition & 1 deletion maps/boxstation/boxstation.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -15747,7 +15747,7 @@
},
/area/station/hallway/primary/central)
"aBd" = (
/obj/item/airbag,
/obj/item/clothing/neck/airbag,
/turf/environment/space,
/area/space)
"aBe" = (
Expand Down
8 changes: 4 additions & 4 deletions maps/gamma/gamma.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -36327,7 +36327,7 @@
/area/station/bridge/captain_quarters)
"gtk" = (
/obj/structure/lattice,
/obj/item/airbag,
/obj/item/clothing/neck/airbag,
/turf/environment/space,
/area/space)
"gtC" = (
Expand Down Expand Up @@ -66762,15 +66762,15 @@
},
/area/station/aisat)
"mqc" = (
/obj/item/airbag{
/obj/item/clothing/neck/airbag{
pixel_x = -5;
pixel_y = -1
},
/obj/item/airbag{
/obj/item/clothing/neck/airbag{
pixel_x = 7;
pixel_y = -1
},
/obj/item/airbag{
/obj/item/clothing/neck/airbag{
pixel_x = 1;
pixel_y = 8
},
Expand Down
1 change: 0 additions & 1 deletion taucetistation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -1025,7 +1025,6 @@
#include "code\game\objects\effects\temp_visual\cult.dm"
#include "code\game\objects\effects\temp_visual\miscellaneous.dm"
#include "code\game\objects\effects\temp_visual\temp_visual.dm"
#include "code\game\objects\items\airbag.dm"
#include "code\game\objects\items\apc_frame.dm"
#include "code\game\objects\items\ashtray.dm"
#include "code\game\objects\items\blueprints.dm"
Expand Down

0 comments on commit bffb385

Please sign in to comment.