Files
Paradise/code/game/objects/items/latexballoon.dm
T
warriorstar-orionandGitHub 525c68d617 Attack chain, initial setup. (pull *immediately* for *any* TM issues) (#26834)
* refactor: Attack chain, initial setup.

* migrate curtain to make dreamchecker happy

* update thurible

* don't call attacked_by separately for legacy attack chain

* remove duplicate proc

* condense similar code, put allowances for legacy code in new procs

* update docs, include diagram source

* add comment on how to update diagram

* fix admonition

* mindflayer updates

* remove commented out code

* clarify all steps

* after_attack should be overridable

* whoops

* retrofit recent changes

* duh, can't restrict this yet because of tool_acts

* i hate ore bags with the fire of a thousand suns

* return correct value for object attack logic

* Various cleanups.

We don't want to attempt to pull stuff out of `/obj/item/attackby`,
because those pieces are part of the related objects' migrations, not
`/obj/item` itself. Attempting to do this causes knockon effects where
things expected to call e.g. `/obj/item/storage/attackby` in the call
chain were not ferried over to the new item interaction code, because
the related objects hadn't actually been migrated over yet.

I've used refactoring /obj/vehicle as the example for migrating
`attackby` methods instead.

* simplify some argument names

* fuck it

* make it do the thing

* Rename CI module call

* Prove that CI works

* improve test output

* aaand fix it again

* fix curtain tool interactions

* fix compile error

* fix compile error

* Better docs, introduce migration plan tool.
2024-12-02 23:36:36 +00:00

67 lines
1.7 KiB
Plaintext

/obj/item/latexballon
name = "latex glove"
desc = "You wanted a fiery fist o' pain, but all you got was this dumb balloon."
icon_state = "latexballon"
item_state = "lgloves"
force = 0
throwforce = 0
w_class = WEIGHT_CLASS_TINY
throw_speed = 1
throw_range = 7
var/state
var/datum/gas_mixture/air_contents = null
/obj/item/latexballon/Destroy()
QDEL_NULL(air_contents)
return ..()
/obj/item/latexballon/proc/blow(obj/item/tank/tank, mob/user)
if(icon_state == "latexballon_bursted")
return
icon_state = "latexballon_blow"
item_state = "latexballon"
user.update_inv_r_hand()
user.update_inv_l_hand()
to_chat(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 || icon_state != "latexballon_blow")
return
playsound(src, 'sound/weapons/gunshots/gunshot.ogg', 100, 1)
icon_state = "latexballon_bursted"
item_state = "lgloves"
if(isliving(loc))
var/mob/living/user = loc
user.update_inv_r_hand()
user.update_inv_l_hand()
var/turf/T = get_turf(src)
T.blind_release_air(air_contents)
/obj/item/latexballon/ex_act(severity)
burst()
switch(severity)
if(1)
qdel(src)
if(2)
if(prob(50))
qdel(src)
/obj/item/latexballon/bullet_act(obj/item/projectile/P)
if(!P.nodamage)
burst()
return ..()
/obj/item/latexballon/temperature_expose(datum/gas_mixture/air, temperature, volume)
..()
if(temperature > T0C+100)
burst()
/obj/item/latexballon/attackby__legacy__attackchain(obj/item/W, mob/user, params)
if(istype(W, /obj/item/tank))
var/obj/item/tank/T = W
blow(T, user)
return
if(W.sharp || W.get_heat() || is_pointed(W))
burst()