Files
Paradise/code/modules/reagents/reagent_containers/patch.dm
warriorstar-orion 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

93 lines
3.0 KiB
Plaintext

/obj/item/reagent_containers/patch
name = "chemical patch"
desc = "A chemical patch for touch based applications."
icon = 'icons/obj/chemical.dmi'
icon_state = "bandaid"
item_state = "bandaid"
possible_transfer_amounts = null
visible_transfer_rate = FALSE
volume = 30
temperature_min = 270
temperature_max = 350
var/instant_application = FALSE
var/needs_to_apply_reagents = TRUE
/obj/item/reagent_containers/patch/attack__legacy__attackchain(mob/living/carbon/C, mob/user)
return apply(C, user)
/obj/item/reagent_containers/patch/attack_self__legacy__attackchain(mob/user)
return apply(user, user)
/obj/item/reagent_containers/patch/proc/apply(mob/living/carbon/C, mob/user)
if(!istype(C))
return FALSE
if(ismachineperson(C))
to_chat(user, "<span class='warning'>[user == C ? "You" : C] can't use [src]!</span>")
return FALSE
if(user == C)
to_chat(user, "<span class='notice'>You apply [src].</span>")
else
if(!instant_application)
C.visible_message("<span class='warning'>[user] attempts to force [C] to apply [src].</span>")
if(!do_after(user, 3 SECONDS, TRUE, C, TRUE))
return FALSE
C.forceFedAttackLog(src, user)
C.visible_message("<span class='warning'>[user] forces [C] to apply [src].</span>")
if(user.get_active_hand() == src)
user.drop_item() // Only drop if they're holding the patch directly
forceMove(C)
LAZYADD(C.processing_patches, src)
return TRUE
/obj/item/reagent_containers/patch/styptic
name = "brute patch"
desc = "Helps with brute injuries."
icon_state = "bandaid_brute"
instant_application = TRUE
list_reagents = list("styptic_powder" = 30)
/obj/item/reagent_containers/patch/styptic/small
name = "brute mini-patch"
icon_state = "bandaid_brute_small"
list_reagents = list("styptic_powder" = 15)
/obj/item/reagent_containers/patch/silver_sulf
name = "burn patch"
desc = "Helps with burn injuries."
icon_state = "bandaid_burn"
instant_application = TRUE
list_reagents = list("silver_sulfadiazine" = 30)
/obj/item/reagent_containers/patch/silver_sulf/small
name = "burn mini-patch"
icon_state = "bandaid_burn_small"
list_reagents = list("silver_sulfadiazine" = 15)
/obj/item/reagent_containers/patch/synthflesh
name = "synthflesh patch"
desc = "Helps with brute and burn injuries."
icon_state = "bandaid_med"
instant_application = TRUE
list_reagents = list("synthflesh" = 10)
/obj/item/reagent_containers/patch/nicotine
name = "nicotine patch"
desc = "Helps temporarily curb the cravings of nicotine dependency."
list_reagents = list("nicotine" = 10)
/obj/item/reagent_containers/patch/jestosterone
name = "jestosterone patch"
desc = "Helps with brute injuries if the affected person is a clown, otherwise inflicts various annoying effects."
icon_state = "bandaid_clown"
list_reagents = list("jestosterone" = 20)
/obj/item/reagent_containers/patch/perfluorodecalin
name = "perfluorodecalin patch"
desc = "Incredibly potent respiratory aid drug, may cause shortness of breath if used in large amounts."
icon_state = "bandaid_med"
list_reagents = list("perfluorodecalin" = 10)