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 14:19:17 -06:00
committed by GitHub
parent f65d120711
commit 35754c77ea
90 changed files with 754 additions and 1609 deletions
@@ -287,20 +287,6 @@
add_fingerprint(user)
toggle(user)
/obj/structure/closet/verb/verb_toggleopen()
set src in oview(1)
set category = null
set name = "Toggle Open"
if(usr.incapacitated())
return
if(ishuman(usr) || isrobot(usr))
add_fingerprint(usr)
toggle(usr)
return
to_chat(usr, "<span class='warning'>This mob type can't use this verb.</span>")
/obj/structure/closet/update_icon_state()
if(!opened)
icon_state = "[icon_closed][transparent ? "_trans" : ""]"
@@ -127,38 +127,6 @@
// no, you can't shove people into a fireaxe cabinet either
return FALSE
/obj/structure/closet/fireaxecabinet/verb/toggle_openness() //nice name, huh? HUH?! -Erro //YEAH -Agouri
set name = "Open/Close"
set category = "Object"
if(isrobot(usr) || locked || smashed)
if(locked)
to_chat(usr, "<span class='warning'>The cabinet won't budge!</span>")
else if(smashed)
to_chat(usr, "<span class='notice'>The protective glass is broken!</span>")
return
operate_panel()
/obj/structure/closet/fireaxecabinet/verb/remove_fire_axe()
set name = "Remove Fire Axe"
set category = "Object"
if(isrobot(usr))
return
if(localopened)
if(fireaxe)
usr.put_in_hands(fireaxe)
to_chat(usr, "<span class='notice'>You take \the [fireaxe] from [src].</span>")
has_axe = "empty"
fireaxe = null
else
to_chat(usr, "<span class='notice'>[src] is empty.</span>")
else
to_chat(usr, "<span class='notice'>[src] is closed.</span>")
update_icon(UPDATE_ICON_STATE)
/obj/structure/closet/fireaxecabinet/attack_ai(mob/user as mob)
if(smashed)
to_chat(user, "<span class='warning'>The security of the cabinet is compromised.</span>")
@@ -82,20 +82,6 @@
else
toggle(user)
/obj/structure/closet/secure_closet/verb/verb_togglelock()
set src in oview(1) // One square distance
set category = "Object"
set name = "Toggle Lock"
if(usr.incapacitated()) // Don't use it if you're not able to! Checks for stuns, ghost and restrain
return
if(ishuman(usr)||isrobot(usr))
add_fingerprint(usr)
togglelock(usr)
return
to_chat(usr, "<span class='warning'>This mob type can't use this verb.</span>")
/obj/structure/closet/secure_closet/update_overlays() //Putting the welded stuff in update_overlays() so it's easy to overwrite for special cases (Fridges, cabinets, and whatnot)
cut_overlays()
if(opened)
@@ -71,7 +71,7 @@
M.take_overall_damage((M.health - obj_integrity - 100),0) //any new damage the statue incurred is transfered to the mob
..()
/obj/structure/closet/statue/shove_impact(mob/living/target, mob/living/attacker)
return FALSE
@@ -105,9 +105,6 @@
/obj/structure/closet/statue/attack_hand()
return
/obj/structure/closet/statue/verb_toggleopen()
return
/obj/structure/closet/statue/update_icon_state()
return
@@ -229,25 +229,13 @@
/obj/structure/closet/crate/secure/AltClick(mob/user)
if(Adjacent(user) && !opened)
verb_togglelock()
if(HAS_TRAIT(user, TRAIT_HANDS_BLOCKED) || user.stat) // Don't use it if you're not able to! Checks for stuns, ghost and restrain
return
togglelock()
return
. = ..()
/obj/structure/closet/crate/secure/verb/verb_togglelock()
set src in oview(1) // One square distance
set category = null
set name = "Toggle Lock"
if(HAS_TRAIT(usr, TRAIT_HANDS_BLOCKED) || usr.stat || usr.restrained()) // Don't use it if you're not able to! Checks for stuns, ghost and restrain
return
if(ishuman(usr) || isrobot(usr))
add_fingerprint(usr)
togglelock(usr)
return
to_chat(usr, "<span class='warning'>This mob type can't use this verb.</span>")
/obj/structure/closet/crate/secure/attack_hand(mob/user)
if(manifest)
to_chat(user, "<span class='notice'>You tear the manifest off of the crate.</span>")
@@ -25,6 +25,10 @@
part.part1 = part1
part.part2 = part2
/obj/structure/chair/e_chair/examine(mob/user)
. = ..()
. += "<span class='warning'>You can <b>Alt-Click</b> [src] to activate it.</span>"
/obj/structure/chair/e_chair/attackby(obj/item/W as obj, mob/user as mob, params)
if(istype(W, /obj/item/wrench))
var/obj/structure/chair/C = new /obj/structure/chair(loc)
@@ -37,16 +41,13 @@
return
return ..()
/obj/structure/chair/e_chair/verb/activate_e_chair()
set name = "Activate Electric Chair"
set category = "Object"
set src in oview(1)
if(usr.stat || HAS_TRAIT(usr, TRAIT_HANDS_BLOCKED) || usr.restrained())
/obj/structure/chair/e_chair/AltClick(mob/user)
if(user.stat || HAS_TRAIT(user, TRAIT_HANDS_BLOCKED) || !Adjacent(user))
return
if(last_time + delay_time > world.time)
to_chat(usr, "<span class='warning'>\The [src] is not ready yet!</span>")
to_chat(user, "<span class='warning'>[src] is not ready yet!</span>")
return
to_chat(usr, "<span class='notice'>You activate \the [src].</span>")
to_chat(user, "<span class='notice'>You activate [src].</span>")
shock()
/obj/structure/chair/e_chair/rotate()
+5 -21
View File
@@ -100,30 +100,14 @@
/obj/structure/reflector/proc/get_reflection(srcdir,pdir)
return 0
/obj/structure/reflector/verb/rotate()
set name = "Rotate"
set category = "Object"
set src in oview(1)
if(usr.incapacitated())
return
if(anchored)
to_chat(usr, "<span class='warning'>It is fastened to the floor!</span>")
return 0
dir = turn(dir, 270)
return 1
/obj/structure/reflector/AltClick(mob/user)
..()
if(user.incapacitated())
to_chat(user, "<span class='warning'>You can't do that right now!</span>")
if(user.stat || HAS_TRAIT(user, TRAIT_HANDS_BLOCKED) || !Adjacent(user))
return
if(!in_range(src, user))
if(anchored)
to_chat(user, "<span class='warning'>You cannot rotate [src] right now. It is fastened to the floor!</span>")
return
else
rotate()
dir = turn(dir, 90)
//TYPES OF REFLECTORS, SINGLE, DOUBLE, BOX
@@ -21,6 +21,10 @@
/// Used to handle rotation properly, should only be 1, 4, or 8
var/possible_dirs = 4
/obj/structure/chair/examine(mob/user)
. = ..()
. += "<span class='info'>You can <b>Alt-Click</b> [src] to rotate it.</span>"
/obj/structure/chair/narsie_act()
if(prob(20))
var/obj/structure/chair/wood/W = new/obj/structure/chair/wood(get_turf(src))
@@ -123,30 +127,22 @@
..()
handle_rotation(newdir)
/obj/structure/chair/verb/rotate()
set name = "Rotate Chair"
set category = "Object"
set src in oview(1)
/obj/structure/chair/AltClick(mob/user)
if(user.stat || HAS_TRAIT(user, TRAIT_HANDS_BLOCKED) || !Adjacent(user))
return
rotate()
/obj/structure/chair/attack_ghost(mob/user)
if(GLOB.configuration.general.ghost_interaction)
setDir(turn(dir, (360 / possible_dirs))) //90 for 4 possible dirs, 45 for 8.
handle_rotation()
return
if(usr.incapacitated())
rotate()
return
..()
/obj/structure/chair/proc/rotate()
setDir(turn(dir, (360 / possible_dirs)))
handle_rotation()
/obj/structure/chair/AltClick(mob/user)
if(!Adjacent(user))
return
if(user.incapacitated())
to_chat(user, "<span class='warning'>You can't do that right now!</span>")
return
rotate()
// Chair types
/obj/structure/chair/light
name = "chair"
+20 -36
View File
@@ -41,6 +41,8 @@
var/slippery = FALSE
/// The minimum level of environment_smash required for simple animals to be able to one-shot this.
var/minimum_env_smash = ENVIRONMENT_SMASH_WALLS
/// Can this table be flipped?
var/can_be_flipped = TRUE
/obj/structure/table/Initialize(mapload)
. = ..()
@@ -50,6 +52,11 @@
/obj/structure/table/examine(mob/user)
. = ..()
. += deconstruction_hints(user)
if(can_be_flipped)
if(flipped)
. += "<span class='info'><b>Alt-Shift-Click</b> to right the table again.</span>"
else
. += "<span class='info'><b>Alt-Shift-Click</b> to flip over the table.</span>"
/obj/structure/table/proc/deconstruction_hints(mob/user)
return "<span class='notice'>The top is <b>screwed</b> on, but the main <b>bolts</b> are also visible.</span>"
@@ -318,39 +325,22 @@
return 0
return T.straight_table_check(direction)
/obj/structure/table/verb/do_flip()
set name = "Flip table"
set desc = "Flips a non-reinforced table"
set category = null
set src in oview(1)
if(!can_touch(usr) || ismouse(usr))
/obj/structure/table/AltShiftClick(mob/living/carbon/human/user)
if(user.stat || HAS_TRAIT(user, TRAIT_HANDS_BLOCKED) || !Adjacent(user) || !can_be_flipped)
return
if(!flip(get_cardinal_dir(usr,src)))
to_chat(usr, "<span class='notice'>It won't budge.</span>")
return
if(!flipped)
if(!flip(get_cardinal_dir(user, src)))
to_chat(user, "<span class='notice'>It won't budge.</span>")
return
usr.visible_message("<span class='warning'>[usr] flips \the [src]!</span>")
if(climbable)
structure_shaken()
return
/obj/structure/table/proc/do_put()
set name = "Put table back"
set desc = "Puts flipped table back"
set category = "Object"
set src in oview(1)
if(!can_touch(usr) || ismouse(usr))
return
if(!unflip())
to_chat(usr, "<span class='notice'>It won't budge.</span>")
return
user.visible_message("<span class='warning'>[user] flips \the [src]!</span>")
if(climbable)
structure_shaken()
else
if(!unflip())
to_chat(user, "<span class='notice'>It won't budge.</span>")
/obj/structure/table/proc/flip(direction)
if(flipped)
@@ -359,9 +349,6 @@
if( !straight_table_check(turn(direction,90)) || !straight_table_check(turn(direction,-90)) )
return 0
verbs -=/obj/structure/table/verb/do_flip
verbs +=/obj/structure/table/proc/do_put
dir = direction
if(dir != NORTH)
layer = 5
@@ -397,9 +384,6 @@
if(!can_flip)
return 0
verbs -=/obj/structure/table/proc/do_put
verbs +=/obj/structure/table/verb/do_flip
layer = initial(layer)
flipped = FALSE
// Initial smoothing flags doesn't add the required SMOOTH_OBJ flag, thats done on init
@@ -800,12 +784,12 @@
icon_state = "tray"
buildstack = /obj/item/stack/sheet/mineral/titanium
buildstackamount = 2
can_be_flipped = FALSE
var/list/typecache_can_hold = list(/mob, /obj/item)
var/list/held_items = list()
/obj/structure/table/tray/Initialize()
. = ..()
verbs -= /obj/structure/table/verb/do_flip
typecache_can_hold = typecacheof(typecache_can_hold)
for(var/atom/movable/held in get_turf(src))
if(!held.anchored && held.move_resist != INFINITY && is_type_in_typecache(held, typecache_can_hold))
@@ -47,7 +47,8 @@
else
. += "<span class='notice'>The maintenance panel is <b>wired</b>, but the circuit slot is <i>empty</i>.</span>"
. += "<span class='notice'>Alt-click to rotate it clockwise.</span>"
. += "<span class='info'><b>Alt-Click</b> to rotate it.</span>"
. += "<span class='info'><b>Alt-Shift-Click</b> to flip it.</span>"
/obj/structure/windoor_assembly/Initialize(mapload, set_dir)
. = ..()
@@ -337,55 +338,38 @@
to_chat(user, "<span class='notice'>You [polarized_glass ? "enable" : "disable"] the electrochromic panel in the windoor assembly.</span>")
//Rotates the windoor assembly clockwise
/obj/structure/windoor_assembly/verb/revrotate()
set name = "Rotate Windoor Assembly"
set category = "Object"
set src in oview(1)
if(usr.stat || HAS_TRAIT(usr, TRAIT_HANDS_BLOCKED) || usr.restrained())
/obj/structure/windoor_assembly/AltClick(mob/user)
if(user.stat || HAS_TRAIT(user, TRAIT_HANDS_BLOCKED) || !Adjacent(user))
return
if(anchored)
to_chat(usr, "<span class='warning'>[src] cannot be rotated while it is fastened to the floor!</span>")
return FALSE
var/target_dir = turn(dir, 270)
to_chat(user, "<span class='warning'>[src] cannot be rotated while it is fastened to the floor!</span>")
return
var/target_dir = turn(dir, 90)
if(!valid_window_location(loc, target_dir))
to_chat(usr, "<span class='warning'>[src] cannot be rotated in that direction!</span>")
return FALSE
to_chat(user, "<span class='warning'>[src] cannot be rotated in that direction!</span>")
return
setDir(target_dir)
ini_dir = dir
update_icon(UPDATE_ICON_STATE)
return TRUE
/obj/structure/windoor_assembly/AltClick(mob/user)
..()
if(user.incapacitated())
to_chat(user, "<span class='warning'>You can't do that right now!</span>")
return
if(!in_range(src, user))
return
else
revrotate()
//Flips the windoor assembly, determines whather the door opens to the left or the right
/obj/structure/windoor_assembly/verb/flip()
set name = "Flip Windoor Assembly"
set category = "Object"
set src in oview(1)
if(usr.stat || HAS_TRAIT(usr, TRAIT_HANDS_BLOCKED) || usr.restrained())
/obj/structure/windoor_assembly/AltShiftClick(mob/user)
if(user.stat || HAS_TRAIT(user, TRAIT_HANDS_BLOCKED) || !Adjacent(user))
return
if(facing == "l")
to_chat(usr, "The windoor will now slide to the right.")
to_chat(user, "The windoor will now slide to the right.")
facing = "r"
else
facing = "l"
to_chat(usr, "The windoor will now slide to the left.")
to_chat(user, "The windoor will now slide to the left.")
update_icon(UPDATE_ICON_STATE)
return
#undef EMPTY_ASSEMBLY
#undef WIRED_ASSEMBLY
+2 -54
View File
@@ -53,7 +53,7 @@
else
. += "<span class='notice'>The window is <i>unscrewed</i> from the floor, and could be deconstructed by <b>wrenching</b>.</span>"
if(!anchored && !fulltile)
. += "<span class='notice'>Alt-click to rotate it.</span>"
. += "<span class='notice'><b>Alt-Click</b> to rotate it.</span>"
/obj/structure/window/Initialize(mapload, direct)
. = ..()
@@ -372,61 +372,10 @@
if(fulltile)
. += new shardtype(location)
/obj/structure/window/verb/rotate()
set name = "Rotate Window Counter-Clockwise"
set category = "Object"
set src in oview(1)
if(usr.incapacitated())
return
if(anchored)
to_chat(usr, "<span class='warning'>[src] cannot be rotated while it is fastened to the floor!</span>")
return FALSE
var/target_dir = turn(dir, 90)
if(!valid_window_location(loc, target_dir))
to_chat(usr, "<span class='warning'>[src] cannot be rotated in that direction!</span>")
return FALSE
setDir(target_dir)
air_update_turf(1)
ini_dir = dir
add_fingerprint(usr)
return TRUE
/obj/structure/window/verb/revrotate()
set name = "Rotate Window Clockwise"
set category = "Object"
set src in oview(1)
if(usr.incapacitated())
return
if(anchored)
to_chat(usr, "<span class='warning'>[src] cannot be rotated while it is fastened to the floor!</span>")
return FALSE
var/target_dir = turn(dir, 270)
if(!valid_window_location(loc, target_dir))
to_chat(usr, "<span class='warning'>[src] cannot be rotated in that direction!</span>")
return FALSE
setDir(target_dir)
ini_dir = dir
add_fingerprint(usr)
return TRUE
/obj/structure/window/AltClick(mob/user)
if(fulltile) // Can't rotate these.
return ..()
if(user.incapacitated())
to_chat(user, "<span class='warning'>You can't do that right now!</span>")
return
if(!Adjacent(user))
to_chat(user, "<span class='warning'>Move closer to the window!</span>")
if(user.stat || HAS_TRAIT(user, TRAIT_HANDS_BLOCKED) || !Adjacent(user))
return
if(anchored)
@@ -444,7 +393,6 @@
setDir(target_dir)
ini_dir = dir
add_fingerprint(user)
return TRUE
/obj/structure/window/Destroy()
density = FALSE