Files
Bubberstation/code/game/objects/items/latexballoon.dm
Alexis 21b4095dfd [MDB IGNORE] [IDB IGNORE] Upstream Sync - 04/17/2026 (#5453)
Upstream 04/17/2026

fixes https://github.com/Bubberstation/Bubberstation/issues/5549

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: tgstation-ci[bot] <179393467+tgstation-ci[bot]@users.noreply.github.com>
Co-authored-by: ArcaneMusic <41715314+ArcaneMusic@users.noreply.github.com>
Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
Co-authored-by: Rhials <28870487+Rhials@users.noreply.github.com>
Co-authored-by: rageguy505 <54517726+rageguy505@users.noreply.github.com>
Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com>
Co-authored-by: Aliceee2ch <160794176+Aliceee2ch@users.noreply.github.com>
Co-authored-by: Time-Green <7501474+Time-Green@users.noreply.github.com>
Co-authored-by: Tsar-Salat <62388554+Tsar-Salat@users.noreply.github.com>
Co-authored-by: SmArtKar <44720187+SmArtKar@users.noreply.github.com>
Co-authored-by: Maxipat <108554989+Maxipat112@users.noreply.github.com>
Co-authored-by: SyncIt21 <110812394+SyncIt21@users.noreply.github.com>
Co-authored-by: deltanedas <39013340+deltanedas@users.noreply.github.com>
Co-authored-by: SimplyLogan <47579821+loganuk@users.noreply.github.com>
Co-authored-by: loganuk <fakeemail123@aol.com>
Co-authored-by: Leland Kemble <70413276+lelandkemble@users.noreply.github.com>
Co-authored-by: FalloutFalcon <86381784+FalloutFalcon@users.noreply.github.com>
Co-authored-by: Roxy <75404941+TealSeer@users.noreply.github.com>
Co-authored-by: Lucy <lucy@absolucy.moe>
Co-authored-by: siliconOpossum <138069572+siliconOpossum@users.noreply.github.com>
Co-authored-by: Isratosh <Isratosh@hotmail.com>
Co-authored-by: TheRyeGuyWhoWillNowDie <70169560+TheRyeGuyWhoWillNowDie@users.noreply.github.com>
Co-authored-by: Neocloudy <88008002+Neocloudy@users.noreply.github.com>
Co-authored-by: Alexander V. <volas@ya.ru>
Co-authored-by: ElGitificador <168473461+ElGitificador@users.noreply.github.com>
Co-authored-by: Twaticus <46540570+Twaticus@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com>
Co-authored-by: Cameron Lennox <killer65311@gmail.com>
Co-authored-by: Tim <timothymtorres@gmail.com>
Co-authored-by: Iamgoofball <iamgoofball@gmail.com>
Co-authored-by: Layzu666 <121319428+Layzu666@users.noreply.github.com>
Co-authored-by: Arturlang <24881678+Arturlang@users.noreply.github.com>
Co-authored-by: _0Steven <42909981+00-Steven@users.noreply.github.com>
Co-authored-by: mrmanlikesbt <99309552+mrmanlikesbt@users.noreply.github.com>
Co-authored-by: Ben10Omintrix <138636438+Ben10Omintrix@users.noreply.github.com>
Co-authored-by: John F. Kennedy <54908920+MacaroniCritter@users.noreply.github.com>
Co-authored-by: Cursor <102828457+theselfish@users.noreply.github.com>
Co-authored-by: Josh <josh.adam.powell@gmail.com>
Co-authored-by: Josh Powell <josh.powell@softwire.com>
Co-authored-by: Yobrocharlie <Charliemiller5617@gmail.com>
Co-authored-by: Hardly3D <66234359+Hardly3D@users.noreply.github.com>
Co-authored-by: shayoki <96078776+shayoki@users.noreply.github.com>
Co-authored-by: LT3 <83487515+lessthnthree@users.noreply.github.com>
2026-05-16 00:56:00 +02:00

118 lines
3.1 KiB
Plaintext

#define INFLATED "inflated"
#define POPPED "popped"
#define DEFLATED "deflated"
/obj/item/latexballoon
name = "latex glove"
desc = "Sterile and airtight."
icon_state = "latexballoon"
icon = 'icons/obj/weapons/hand.dmi'
inhand_icon_state = "greyscale_gloves"
lefthand_file = 'icons/mob/inhands/clothing/gloves_righthand.dmi'
righthand_file = 'icons/mob/inhands/clothing/gloves_lefthand.dmi'
force = 0
throwforce = 0
w_class = WEIGHT_CLASS_TINY
throw_speed = 1
throw_range = 7
custom_materials = list(/datum/material/iron = SMALL_MATERIAL_AMOUNT * 0.2, /datum/material/glass = SMALL_MATERIAL_AMOUNT * 0.2)
var/state = DEFLATED
var/datum/gas_mixture/air_contents = null
/obj/item/latexballoon/Initialize(mapload)
. = ..()
AddElement(/datum/element/atmos_sensitive, mapload)
AddElement(/datum/element/update_icon_updates_onmob)
/obj/item/latexballoon/proc/set_state(state_to_set)
state = state_to_set
update_appearance(UPDATE_ICON | UPDATE_DESC)
/obj/item/latexballoon/update_icon_state()
. = ..()
switch(state)
if(INFLATED)
icon_state = "latexballoon_blow"
lefthand_file = 'icons/mob/inhands/items_lefthand.dmi'
righthand_file = 'icons/mob/inhands/items_righthand.dmi'
inhand_icon_state = "latexballoon"
if(POPPED)
icon_state = "latexballoon_bursted"
inhand_icon_state = initial(inhand_icon_state)
lefthand_file = initial(lefthand_file)
righthand_file = initial(righthand_file)
/obj/item/latexballoon/update_desc()
. = ..()
switch(state)
if(INFLATED)
desc = "It's a blown up latex glove on a string."
if(POPPED)
desc = "The remains of a latex glove."
/obj/item/latexballoon/proc/blow(obj/item/tank/tank, mob/user)
if(state == POPPED)
return
air_contents = tank.remove_air_volume(3)
if(isnull(air_contents))
balloon_alert(user, "tank is empty!")
return
if(state == INFLATED)
burst() // too much air, pop it!
return
playsound(src, 'sound/items/modsuit/inflate_bloon.ogg', 50, TRUE)
balloon_alert(user, "you blow up the balloon!") // because it's a balloon obviously
set_state(INFLATED)
/obj/item/latexballoon/should_atmos_process(datum/gas_mixture/air, exposed_temperature)
return (exposed_temperature > T0C+100)
/obj/item/latexballoon/atmos_expose(datum/gas_mixture/air, exposed_temperature)
burst()
/obj/item/latexballoon/proc/burst()
if (!air_contents || state != INFLATED)
return
set_state(POPPED)
playsound(src, 'sound/items/balloon_pop.ogg', 75, TRUE)
loc.assume_air(air_contents)
/obj/item/latexballoon/ex_act(severity, target)
burst()
switch(severity)
if (EXPLODE_DEVASTATE)
qdel(src)
if (EXPLODE_HEAVY)
if (prob(50))
qdel(src)
return TRUE
/obj/item/latexballoon/bullet_act(obj/projectile/projectile)
if(projectile.damage > 0)
burst()
return ..()
/obj/item/latexballoon/attackby(obj/item/item, mob/user, list/modifiers, list/attack_modifiers)
if(istype(item, /obj/item/tank))
var/obj/item/tank/air_tank = item
blow(air_tank, user)
return
if(item.get_sharpness() || item.get_temperature() >= FIRE_MINIMUM_TEMPERATURE_TO_EXIST)
burst()
return
return ..()
#undef INFLATED
#undef POPPED
#undef DEFLATED