Verb cleanup (#22224)

* Verb cleanup

* rest of the object verbs

* little more object cleanup

* more changes

* last of it

* this too

* tgui

* code review

* time to go
This commit is contained in:
GDN
2023-11-12 20:19:17 +00:00
committed by GitHub
parent f65d120711
commit 35754c77ea
90 changed files with 754 additions and 1609 deletions
+8 -17
View File
@@ -15,12 +15,8 @@
var/temperature_min = 0 // To limit the temperature of a reagent container can atain when exposed to heat/cold
var/temperature_max = 10000
/obj/item/reagent_containers/verb/set_APTFT() //set amount_per_transfer_from_this
set name = "Set transfer amount"
set category = "Object"
set src in usr
if(!usr.Adjacent(src) || !ishuman(usr) || HAS_TRAIT(usr, TRAIT_HANDS_BLOCKED))
/obj/item/reagent_containers/AltClick(mob/user)
if(!Adjacent(user) || !length(possible_transfer_amounts) || !ishuman(user) || HAS_TRAIT(user, TRAIT_HANDS_BLOCKED))
return
var/default = null
@@ -30,25 +26,20 @@
if(!new_transfer_rate)
return
if(!usr.Adjacent(src))
to_chat(usr, "<span class='warning'>You have moved too far away!</span>")
if(!Adjacent(user))
to_chat(user, "<span class='warning'>You have moved too far away!</span>")
return
if(!ishuman(usr) || HAS_TRAIT(usr, TRAIT_HANDS_BLOCKED))
to_chat(usr, "<span class='warning'>You can't use your hands!</span>")
if(!ishuman(user) || HAS_TRAIT(user, TRAIT_HANDS_BLOCKED))
to_chat(user, "<span class='warning'>You can't use your hands!</span>")
return
amount_per_transfer_from_this = new_transfer_rate
to_chat(usr, "<span class='notice'>[src] will now transfer [amount_per_transfer_from_this] units at a time.</span>")
/obj/item/reagent_containers/AltClick()
set_APTFT()
to_chat(user, "<span class='notice'>[src] will now transfer [amount_per_transfer_from_this] units at a time.</span>")
/obj/item/reagent_containers/Initialize(mapload)
. = ..()
if(!reagents) // Some subtypes create their own reagents
create_reagents(volume, temperature_min, temperature_max)
if(!possible_transfer_amounts)
verbs -= /obj/item/reagent_containers/verb/set_APTFT
if(spawned_disease)
var/datum/disease/F = new spawned_disease(0)
var/list/data = list("viruses" = list(F), "blood_color" = "#A10808")
@@ -109,4 +100,4 @@
// Items that have no valid possible_transfer_amounts shouldn't say their transfer rate is variable
if(possible_transfer_amounts)
. += "<span class='notice'>Alt-click to change the transfer amount.</span>"
. += "<span class='info'><b>Alt-Click</b> to change the transfer amount.</span>"
@@ -17,15 +17,16 @@
var/measured_health = 0 // Used for measuring health; we don't want this to stop applying once the person's health isn't changing.
var/static/list/safe_chem_applicator_list = list("silver_sulfadiazine", "styptic_powder", "synthflesh")
/obj/item/reagent_containers/applicator/examine(mob/user)
. = ..()
. += "<span class='info'><b>Alt-Click</b> to empty it.</span>"
/obj/item/reagent_containers/applicator/emag_act(mob/user)
if(!emagged)
emagged = TRUE
ignore_flags = TRUE
to_chat(user, "<span class='warning'>You short out the safeties on [src].</span>")
/obj/item/reagent_containers/applicator/set_APTFT()
set hidden = TRUE
/obj/item/reagent_containers/applicator/on_reagent_change()
if(!emagged)
var/found_forbidden_reagent = FALSE
@@ -120,18 +121,14 @@
playsound(get_turf(src), pick('sound/goonstation/items/mender.ogg', 'sound/goonstation/items/mender2.ogg'), 50, 1)
/obj/item/reagent_containers/applicator/verb/empty()
set name = "Empty Applicator"
set category = "Object"
set src in usr
if(usr.incapacitated())
/obj/item/reagent_containers/applicator/AltClick(mob/user)
if(user.stat || HAS_TRAIT(user, TRAIT_HANDS_BLOCKED) || !Adjacent(user))
return
if(alert(usr, "Are you sure you want to empty [src]?", "Empty Applicator:", "Yes", "No") != "Yes")
if(alert(user, "Are you sure you want to empty [src]?", "Empty Applicator:", "Yes", "No") != "Yes")
return
if(!usr.incapacitated() && isturf(usr.loc) && loc == usr)
to_chat(usr, "<span class='notice'>You empty [src] onto the floor.</span>")
reagents.reaction(usr.loc)
if(!user.incapacitated() && isturf(user.loc) && loc == user)
to_chat(user, "<span class='notice'>You empty [src] onto the floor.</span>")
reagents.reaction(user.loc)
reagents.clear_reagents()
/obj/item/reagent_containers/applicator/brute
@@ -130,6 +130,11 @@
var/obj/item/assembly_holder/assembly = null
var/can_assembly = 1
/obj/item/reagent_containers/glass/beaker/examine(mob/user)
. = ..()
if(assembly)
. += "<span class='notice'>There is an [assembly] attached to it, use a screwdriver to remove it.</span>"
/obj/item/reagent_containers/glass/beaker/on_reagent_change()
update_icon(UPDATE_OVERLAYS)
@@ -165,20 +170,6 @@
if(assembly)
. += "assembly"
/obj/item/reagent_containers/glass/beaker/verb/remove_assembly()
set name = "Remove Assembly"
set category = "Object"
set src in usr
if(usr.incapacitated())
return
if(assembly)
to_chat(usr, "<span class='notice'>You detach [assembly] from [src]</span>")
usr.put_in_hands(assembly)
assembly = null
update_icon(UPDATE_OVERLAYS)
else
to_chat(usr, "<span class='notice'>There is no assembly to remove.</span>")
/obj/item/reagent_containers/glass/beaker/proc/heat_beaker()
if(reagents)
reagents.temperature_reagents(4000)
@@ -215,6 +206,17 @@
if(assembly)
assembly.hear_message(M, msg)
/obj/item/reagent_containers/glass/beaker/screwdriver_act(mob/living/user, obj/item/I)
if(!I.use_tool(src, user, 0, volume = I.tool_volume))
return
if(assembly)
to_chat(user, "<span class='notice'>You detach [assembly] from [src]</span>")
user.put_in_hands(assembly)
assembly = null
update_icon(UPDATE_OVERLAYS)
else
to_chat(user, "<span class='notice'>There is no assembly to remove.</span>")
/obj/item/reagent_containers/glass/beaker/large
name = "large beaker"
desc = "A large glass beaker with twice the capacity of a normal beaker."
@@ -95,19 +95,16 @@
. = ..()
if(get_dist(user, src) && user == loc)
. += "[round(reagents.total_volume)] units left."
. += "<span class='info'><b>Alt-Click</b> to empty it.</span>"
/obj/item/reagent_containers/spray/verb/empty()
set name = "Empty Spray Bottle"
set category = "Object"
set src in usr
if(usr.stat || HAS_TRAIT(usr, TRAIT_HANDS_BLOCKED) || usr.restrained())
/obj/item/reagent_containers/spray/AltClick(mob/user)
if(user.stat || HAS_TRAIT(user, TRAIT_HANDS_BLOCKED) || !Adjacent(user))
return
if(alert(usr, "Are you sure you want to empty that?", "Empty Bottle:", "Yes", "No") != "Yes")
if(alert(user, "Are you sure you want to empty that?", "Empty Bottle:", "Yes", "No") != "Yes")
return
if(isturf(usr.loc) && loc == usr)
to_chat(usr, "<span class='notice'>You empty [src] onto the floor.</span>")
reagents.reaction(usr.loc)
if(isturf(user.loc) && loc == user)
to_chat(user, "<span class='notice'>You empty [src] onto the floor.</span>")
reagents.reaction(user.loc)
reagents.clear_reagents()
//space cleaner
@@ -23,9 +23,6 @@
mode = SYRINGE_INJECT
update_icon()
/obj/item/reagent_containers/syringe/set_APTFT()
set hidden = TRUE
/obj/item/reagent_containers/syringe/on_reagent_change()
update_icon()