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
@@ -128,6 +128,10 @@
materials = list()
on = TRUE
/obj/item/flashlight/lamp/examine(mob/user)
. = ..()
. += "<span class='notice'>You can <b>Alt-Click</b> [src] to turn it on/off.</span>"
// green-shaded desk lamp
/obj/item/flashlight/lamp/green
desc = "A classic green-shaded desk lamp."
@@ -137,13 +141,11 @@
/obj/item/flashlight/lamp/green/off
on = FALSE
/obj/item/flashlight/lamp/verb/toggle_light()
set name = "Toggle light"
set category = "Object"
set src in oview(1)
/obj/item/flashlight/lamp/AltClick(mob/user)
if(user.stat || HAS_TRAIT(user, TRAIT_HANDS_BLOCKED) || !Adjacent(user))
return
if(!usr.stat)
attack_self(usr)
attack_self(user)
//Bananalamp
/obj/item/flashlight/lamp/bananalamp
@@ -3,7 +3,6 @@
desc = "A beacon used by a teleporter."
icon_state = "beacon"
item_state = "signaler"
var/code = "Beacon"
origin_tech = "bluespace=1"
var/syndicate = FALSE
var/area_bypass = FALSE
@@ -11,7 +10,6 @@
/obj/item/radio/beacon/New()
..()
code = "[code] ([GLOB.beacons.len + 1])"
GLOB.beacons += src
/obj/item/radio/beacon/Destroy()
@@ -31,20 +29,6 @@
/obj/item/radio/beacon/send_hear()
return null
/obj/item/radio/beacon/verb/alter_signal(t as text)
set name = "Alter Beacon's Signal"
set category = "Object"
set src in usr
if(usr.stat || usr.restrained())
return
code = t
if(isnull(code))
code = initial(code)
src.add_fingerprint(usr)
return
/obj/item/radio/beacon/bacon //Probably a better way of doing this, I'm lazy.
/obj/item/radio/beacon/bacon/proc/digest_delay()
+6 -8
View File
@@ -106,6 +106,10 @@ REAGENT SCANNER
var/mode = 1
var/advanced = FALSE
/obj/item/healthanalyzer/examine(mob/user)
. = ..()
. += "<span class='info'>Use [src] in hand to swap between showing specific limb damage.</span>"
/obj/item/healthanalyzer/attack(mob/living/M, mob/living/user)
if((HAS_TRAIT(user, TRAIT_CLUMSY) || user.getBrainLoss() >= 60) && prob(50))
var/list/msgs = list()
@@ -284,18 +288,12 @@ REAGENT SCANNER
to_chat(user, chat_box_healthscan(msgs.Join("<br>")))
/obj/item/healthanalyzer/attack_self(mob/user)
toggle_mode()
/obj/item/healthanalyzer/verb/toggle_mode()
set name = "Switch Verbosity"
set category = "Object"
mode = !mode
switch(mode)
if(1)
to_chat(usr, "The scanner now shows specific limb damage.")
to_chat(user, "<span class='notice'>The scanner now shows specific limb damage.</span>")
if(0)
to_chat(usr, "The scanner no longer shows limb damage.")
to_chat(user, "<span class='notice'>The scanner no longer shows limb damage.</span>")
/obj/item/healthanalyzer/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/healthupgrade))
@@ -300,6 +300,7 @@
. += "<span class='notice'>It has [remaining_capacity] seconds remaining.</span>" // to avoid having 0 minutes
else
. += "<span class='notice'>It has [seconds_to_time(remaining_capacity)] remaining.</span>"
. += "<span class='notice'>You can <b>Alt-Click</b> [src] to wipe the current tape."
/obj/item/tape/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume, global_overlay = TRUE)
..()
@@ -309,16 +310,16 @@
if(!ruined)
ruin(user)
/obj/item/tape/verb/wipe()
set name = "Wipe Tape"
set category = "Object"
if(usr.stat)
/obj/item/tape/AltClick(mob/user)
if(user.stat || HAS_TRAIT(user, TRAIT_HANDS_BLOCKED) || !Adjacent(user))
return
if(ruined)
to_chat(user, "<span class='notice'>This tape is already ruined!</span>")
return
if(!do_after(user, 3 SECONDS, target = src))
return
to_chat(usr, "<span class='notice'>You erase the data from [src].</span>")
to_chat(user, "<span class='notice'>You erase the data from [src].</span>")
used_capacity = 0
storedinfo.Cut()
timestamp.Cut()
+5 -10
View File
@@ -1207,23 +1207,18 @@
. += "Has [fake_bullets] round\s remaining."
. += "<span class='info'>Use in hand to empty the gun's ammo reserves.</span>"
. += "[fake_bullets] of those are live rounds."
. += "<span class='notice'>You can <b>Alt-Click</b> [src] to spin it's barrel.</span>"
/obj/item/toy/russian_revolver/trick_revolver/post_shot(user)
to_chat(user, "<span class='danger'>[src] did look pretty dodgey!</span>")
SEND_SOUND(user, sound('sound/misc/sadtrombone.ogg')) //HONK
/obj/item/toy/russian_revolver/trick_revolver/verb/trick_spin()
set name = "Spin Chamber"
set category = "Object"
set desc = "Click to spin your revolver's chamber."
var/mob/M = usr
if(M.stat || !in_range(M, src))
/obj/item/toy/russian_revolver/trick_revolver/AltClick(mob/user)
if(user.stat || HAS_TRAIT(user, TRAIT_HANDS_BLOCKED) || !Adjacent(user))
return
to_chat(M, "<span class='warning'>You go to spin the chamber... and it goes off in your face!</span>")
shoot_gun(M)
to_chat(user, "<span class='warning'>You go to spin the chamber... and it goes off in your face!</span>")
shoot_gun(user)
/obj/item/toy/russian_revolver/trick_revolver/attack_self(mob/user)
if(!bullets_left) //You can re-arm the trap...
+5 -45
View File
@@ -6,11 +6,6 @@
* FINGERPRINT CARD
*/
/*
* DATA CARDS - Used for the teleporter
*/
/obj/item/card
name = "card"
desc = "A card."
@@ -23,37 +18,6 @@
/obj/item/card/proc/get_card_account()
return GLOB.station_money_database.find_user_account(associated_account_number)
/obj/item/card/data
name = "data card"
desc = "A disk containing data."
icon_state = "data"
var/function = "storage"
var/data = "null"
var/special = null
item_state = "card-id"
/obj/item/card/data/verb/label(t as text)
set name = "Label Disk"
set category = "Object"
set src in usr
if(t)
src.name = "Data Disk- '[t]'"
else
src.name = "Data Disk"
src.add_fingerprint(usr)
return
/obj/item/card/data/clown
name = "coordinates to clown planet"
icon_state = "data"
item_state = "card-id"
layer = 3
level = 2
desc = "This card contains coordinates to the fabled Clown Planet. Handle with care."
function = "teleporter"
data = "Clown Land"
/*
* ID CARDS
*/
@@ -154,7 +118,7 @@
else
. += "<span class='warning'>It is too far away.</span>"
if(guest_pass)
. += "<span class='notice'>There is a guest pass attached to this ID card</span>"
. += "<span class='notice'>There is a guest pass attached to this ID card, <b>Alt-Click</b> to remove it.</span>"
if(world.time < guest_pass.expiration_time)
. += "<span class='notice'>It expires at [station_time_timestamp("hh:mm:ss", guest_pass.expiration_time)].</span>"
else
@@ -305,20 +269,16 @@
G.loc = src
guest_pass = G
/obj/item/card/id/verb/remove_guest_pass()
set name = "Remove Guest Pass"
set category = "Object"
set src in range(0)
if(usr.stat || HAS_TRAIT(usr, TRAIT_UI_BLOCKED) || usr.restrained())
/obj/item/card/id/AltClick(mob/user)
if(user.stat || HAS_TRAIT(user, TRAIT_HANDS_BLOCKED) || !Adjacent(user))
return
if(guest_pass)
to_chat(usr, "<span class='notice'>You remove the guest pass from this ID.</span>")
to_chat(user, "<span class='notice'>You remove the guest pass from this ID.</span>")
guest_pass.forceMove(get_turf(src))
guest_pass = null
else
to_chat(usr, "<span class='warning'>There is no guest pass attached to this ID</span>")
to_chat(user, "<span class='warning'>There is no guest pass attached to this ID</span>")
/obj/item/card/id/serialize()
var/list/data = ..()
+8 -12
View File
@@ -93,9 +93,9 @@
/obj/item/defibrillator/ui_action_click()
toggle_paddles()
/obj/item/defibrillator/CtrlClick()
if(ishuman(usr) && Adjacent(usr))
toggle_paddles()
/obj/item/defibrillator/CtrlClick(mob/user)
if(ishuman(user) && Adjacent(user))
toggle_paddles(user)
/obj/item/defibrillator/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/stock_parts/cell))
@@ -138,21 +138,17 @@
..()
update_icon(UPDATE_OVERLAYS)
/obj/item/defibrillator/verb/toggle_paddles()
set name = "Toggle Paddles"
set category = "Object"
var/mob/living/carbon/human/user = usr
/obj/item/defibrillator/proc/toggle_paddles(mob/living/carbon/human/user)
if(user.stat || HAS_TRAIT(user, TRAIT_HANDS_BLOCKED) || !Adjacent(user))
return
if(paddles_on_defib)
//Detach the paddles into the user's hands
if(usr.incapacitated()) return
if(!usr.put_in_hands(paddles))
if(!user.put_in_hands(paddles))
to_chat(user, "<span class='warning'>You need a free hand to hold the paddles!</span>")
update_icon(UPDATE_OVERLAYS)
return
paddles.loc = user
paddles.forceMove(user)
paddles_on_defib = FALSE
else if(user.is_in_active_hand(paddles))
//Remove from their hands and back onto the defib unit
@@ -15,6 +15,10 @@
eject_case()
return ..()
/obj/item/implantpad/examine(mob/user)
. = ..()
. += "<span class='notice'>You can <b>Alt-Click</b> [src] to remove it's stored implant.</span>"
/obj/item/implantpad/update_icon_state()
if(case)
icon_state = "implantpad-on"
@@ -56,15 +60,11 @@
case = null
update_icon(UPDATE_ICON_STATE)
/obj/item/implantpad/verb/remove_implant()
set category = "Object"
set name = "Remove Bio-chip"
set src in usr
if(usr.stat || usr.restrained())
/obj/item/implantpad/AltClick(mob/user)
if(user.stat || HAS_TRAIT(user, TRAIT_HANDS_BLOCKED) || !Adjacent(user))
return
eject_case(usr)
eject_case(user)
/obj/item/implantpad/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = TRUE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
@@ -225,21 +225,20 @@
resistance_flags = FIRE_PROOF
var/strap_side_straight = FALSE
/obj/item/storage/backpack/satchel/verb/switch_strap()
set name = "Switch Strap Side"
set category = "Object"
set src in usr
/obj/item/storage/backpack/satchel/examine(mob/user)
. = ..()
. += "<span class='notice'>You can <b>Alt-Shift-Click</b> [src] to flip it's strap side.</span>"
if(usr.incapacitated())
/obj/item/storage/backpack/satchel/AltShiftClick(mob/user)
if(user.stat || HAS_TRAIT(user, TRAIT_HANDS_BLOCKED) || !Adjacent(user))
return
strap_side_straight = !strap_side_straight
item_state = strap_side_straight ? "satchel-flipped" : "satchel"
if(ishuman(loc))
var/mob/living/carbon/human/H = loc
H.update_inv_back()
/obj/item/storage/backpack/satcheldeluxe
name = "leather satchel"
desc = "An NT Deluxe satchel, with the finest quality leather and the company logo in a thin gold stitch"
@@ -17,8 +17,8 @@
// Generic non-item
/obj/item/storage/bag
allow_quick_gather = 1
allow_quick_empty = 1
allow_quick_gather = TRUE
allow_quick_empty = TRUE
display_contents_with_number = 1 // should work fine now
use_to_pickup = 1
slot_flags = SLOT_FLAG_BELT
@@ -253,7 +253,7 @@
var/capacity = 300; //the number of sheets it can carry.
w_class = WEIGHT_CLASS_NORMAL
allow_quick_empty = 1 // this function is superceded
allow_quick_empty = TRUE // this function is superceded
/obj/item/storage/bag/sheetsnatcher/can_be_inserted(obj/item/W as obj, stop_messages = 0)
if(!istype(W,/obj/item/stack/sheet) || istype(W,/obj/item/stack/sheet/mineral/sandstone) || istype(W,/obj/item/stack/sheet/wood))
@@ -333,8 +333,7 @@
return
// Modified quick_empty verb drops appropriate sized stacks
/obj/item/storage/bag/sheetsnatcher/quick_empty()
/obj/item/storage/bag/sheetsnatcher/drop_inventory(mob/user)
var/location = get_turf(src)
for(var/obj/item/stack/sheet/S in contents)
while(S.amount)
@@ -344,8 +343,8 @@
S.amount -= stacksize
if(!S.amount)
qdel(S) // todo: there's probably something missing here
if(usr.s_active)
usr.s_active.show_to(usr)
if(user.s_active)
user.s_active.show_to(user)
update_icon()
// Instead of removing
@@ -57,16 +57,6 @@
can_hold = typecacheof(can_hold)
cant_hold = typecacheof(cant_hold) - typecacheof(cant_hold_override)
if(allow_quick_empty)
verbs += /obj/item/storage/verb/quick_empty
else
verbs -= /obj/item/storage/verb/quick_empty
if(allow_quick_gather)
verbs += /obj/item/storage/verb/toggle_gathering_mode
else
verbs -= /obj/item/storage/verb/toggle_gathering_mode
populate_contents()
boxes = new /obj/screen/storage()
@@ -92,6 +82,13 @@
LAZYCLEARLIST(mobs_viewing)
return ..()
/obj/item/storage/examine(mob/user)
. = ..()
if(allow_quick_empty)
. += "<span class='notice'>You can use [src] in hand to empty it's entire contents.</span>"
if(allow_quick_gather)
. += "<span class='notice'>You can <b>Alt-Shift-Click</b> [src] to switch it's gathering method.</span>"
/obj/item/storage/forceMove(atom/destination)
. = ..()
if(!ismob(destination.loc))
@@ -582,9 +579,7 @@
show_to(user)
return ..()
/obj/item/storage/verb/toggle_gathering_mode()
set name = "Switch Gathering Method"
set category = "Object"
/obj/item/storage/AltShiftClick(mob/living/carbon/human/user)
pickup_all_on_tile = !pickup_all_on_tile
switch(pickup_all_on_tile)
@@ -593,17 +588,6 @@
if(FALSE)
to_chat(usr, "[src] now picks up one item at a time.")
/obj/item/storage/verb/quick_empty()
set name = "Empty Contents"
set category = "Object"
if((!ishuman(usr) && (loc != usr)) || usr.stat || usr.restrained())
return
if(!removal_allowed_check(usr))
return
drop_inventory(usr)
/obj/item/storage/proc/drop_inventory(user)
var/turf/T = get_turf(src)
hide_from(user)
@@ -26,26 +26,22 @@
QDEL_NULL(noz)
return ..()
/obj/item/watertank/ui_action_click()
toggle_mister()
/obj/item/watertank/ui_action_click(mob/user)
toggle_mister(user)
/obj/item/watertank/item_action_slot_check(slot, mob/user)
if(slot == SLOT_HUD_BACK)
return 1
return TRUE
/obj/item/watertank/verb/toggle_mister()
set name = "Toggle Mister"
set category = "Object"
if(usr.get_item_by_slot(SLOT_HUD_BACK) != src)
to_chat(usr, "<span class='notice'>The watertank needs to be on your back to use.</span>")
/obj/item/watertank/proc/toggle_mister(mob/user)
if(user.stat || HAS_TRAIT(user, TRAIT_HANDS_BLOCKED) || !Adjacent(user))
return
if(usr.incapacitated())
if(user.get_item_by_slot(SLOT_HUD_BACK) != src)
to_chat(user, "<span class='notice'>The watertank needs to be on your back to use.</span>")
return
on = !on
var/mob/living/carbon/human/user = usr
if(on)
if(noz == null)
if(!noz)
noz = make_noz()
//Detach the nozzle into the user's hands
@@ -53,7 +49,7 @@
on = FALSE
to_chat(user, "<span class='notice'>You need a free hand to hold the mister.</span>")
return
noz.loc = user
noz.forceMove(user)
else
//Remove from their hands and put back "into" the tank
remove_noz()
@@ -1,94 +1,8 @@
/* Teleportation devices.
* Contains:
* Locator
* Hand-tele
*/
/*
* Locator
*/
/obj/item/locator
name = "locator"
desc = "Used to track those with locater implants."
icon = 'icons/obj/implants.dmi'
icon_state = "locator"
var/temp = null
var/frequency = 1451
var/broadcasting = FALSE
var/listening = TRUE
flags = CONDUCT
w_class = WEIGHT_CLASS_SMALL
item_state = "electronic"
throw_speed = 4
throw_range = 20
materials = list(MAT_METAL=400)
armor = list(MELEE = 0, BULLET = 0, LASER = 0, ENERGY = 0, BOMB = 30, RAD = 0, FIRE = 100, ACID = 100)
origin_tech = "magnets=3;bluespace=2"
/obj/item/locator/attack_self(mob/user as mob)
add_fingerprint(usr)
var/dat
if(temp)
dat = "[src.temp]<BR><BR><A href='byond://?src=[UID()];temp=1'>Clear</A>"
else
dat = {"
<B>Persistent Signal Locator</B><HR>
Frequency:
<A href='byond://?src=[UID()];freq=-10'>-</A>
<A href='byond://?src=[UID()];freq=-2'>-</A> [format_frequency(src.frequency)]
<A href='byond://?src=[UID()];freq=2'>+</A>
<A href='byond://?src=[UID()];freq=10'>+</A><BR>
<A href='?src=[UID()];refresh=1'>Refresh</A>"}
user << browse(dat, "window=radio")
onclose(user, "radio")
return
/obj/item/locator/Topic(href, href_list)
if(..())
return 1
var/turf/current_location = get_turf(usr)//What turf is the user on?
if(!current_location || is_admin_level(current_location.z))//If turf was not found or they're in the admin zone
to_chat(usr, "<span class='warning'>\The [src] is malfunctioning.</span>")
return 1
if(href_list["refresh"])
temp = "<B>Persistent Signal Locator</B><HR>"
var/turf/sr = get_turf(src)
if(sr)
temp += "<B>Located Beacons:</B><BR>"
for(var/obj/item/radio/beacon/W in GLOB.beacons)
if(W.frequency == frequency && !W.syndicate)
if(W && W.z == z)
var/turf/TB = get_turf(W)
temp += "[W.code]: [TB.x], [TB.y], [TB.z]<BR>"
temp += "<B>Located Implants:</B><BR>"
for(var/obj/item/implant/tracking/T in GLOB.tracked_implants)
if(!T.implanted || !T.imp_in)
continue
var/turf/Tr = get_turf(T)
if(Tr && Tr.z == sr.z)
temp += " [Tr.x], [Tr.y], [Tr.z]<BR>"
temp += "<B>You are at \[[sr.x],[sr.y],[sr.z]\]</B>."
temp += "<BR><BR><A href='byond://?src=[UID()];refresh=1'>Refresh</A><BR>"
else
temp += "<B><FONT color='red'>Processing error:</FONT></B> Unable to locate orbital position.<BR>"
else
if(href_list["freq"])
frequency += text2num(href_list["freq"])
frequency = sanitize_frequency(frequency)
else
if(href_list["temp"])
temp = null
attack_self(usr)
return 1
/*
* Hand-tele