mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-26 22:50:26 +01:00
Merge pull request #6049 from phil235/LatexballoonFix
Fixes latexballons icon update problem and the infinite burst issue.
This commit is contained in:
@@ -11,19 +11,26 @@
|
||||
var/state
|
||||
var/datum/gas_mixture/air_contents = null
|
||||
|
||||
/obj/item/latexballon/proc/blow(obj/item/weapon/tank/tank)
|
||||
/obj/item/latexballon/proc/blow(obj/item/weapon/tank/tank, mob/user as mob)
|
||||
if (icon_state == "latexballon_bursted")
|
||||
return
|
||||
src.air_contents = tank.remove_air_volume(3)
|
||||
icon_state = "latexballon_blow"
|
||||
item_state = "latexballon"
|
||||
user.update_inv_r_hand()
|
||||
user.update_inv_l_hand()
|
||||
user << "<span class='notice'> You blow up [src] with [tank].</span>"
|
||||
air_contents = tank.remove_air_volume(3)
|
||||
|
||||
/obj/item/latexballon/proc/burst()
|
||||
if (!air_contents)
|
||||
if (!air_contents || icon_state != "latexballon_blow")
|
||||
return
|
||||
playsound(src, 'sound/weapons/Gunshot.ogg', 100, 1)
|
||||
icon_state = "latexballon_bursted"
|
||||
item_state = "lgloves"
|
||||
if(istype(src.loc, /mob/living))
|
||||
var/mob/living/user = src.loc
|
||||
user.update_inv_r_hand()
|
||||
user.update_inv_l_hand()
|
||||
loc.assume_air(air_contents)
|
||||
|
||||
/obj/item/latexballon/ex_act(severity)
|
||||
@@ -44,5 +51,9 @@
|
||||
return
|
||||
|
||||
/obj/item/latexballon/attackby(obj/item/W as obj, mob/user as mob)
|
||||
if (is_sharp(W))
|
||||
burst()
|
||||
if(istype(W, /obj/item/weapon/tank))
|
||||
var/obj/item/weapon/tank/T = W
|
||||
blow(T, user)
|
||||
return
|
||||
if (is_sharp(W) || is_hot(W))
|
||||
burst()
|
||||
|
||||
@@ -83,10 +83,6 @@
|
||||
|
||||
if ((istype(W, /obj/item/device/analyzer)) && get_dist(user, src) <= 1)
|
||||
atmosanalyzer_scan(air_contents, user)
|
||||
else if (istype(W,/obj/item/latexballon))
|
||||
var/obj/item/latexballon/LB = W
|
||||
LB.blow(src)
|
||||
src.add_fingerprint(user)
|
||||
|
||||
if(istype(W, /obj/item/device/assembly_holder))
|
||||
bomb_assemble(W,user)
|
||||
|
||||
Reference in New Issue
Block a user