Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Verbs clean up #721

Merged
merged 4 commits into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 15 additions & 16 deletions modular_ss220/mobs/code/pet_carrier.dm
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,6 @@
for(var/mob/living/M in contents)
M.ex_act(intensity)

/obj/item/pet_carrier/AltClick(mob/user)
if(ishuman(user) && Adjacent(user) && !user.incapacitated(FALSE, TRUE, TRUE))
try_free_content(user = user)

/obj/item/pet_carrier/proc/put_in_carrier(mob/living/target, mob/living/user)
if(!opened)
to_chat(user, "<span class='warning'>Ваша переноска закрыта!</span>")
Expand Down Expand Up @@ -200,25 +196,28 @@
change_state()
return

/obj/item/pet_carrier/verb/open_close()
set name = "Открыть/закрыть переноску"
set desc = "Меняет состояние дверцы переноски, блокируя или разблокируя возможность достать содержимое."
set category = "Object"
/obj/item/pet_carrier/examine(mob/user)
. = ..()
. += span_notice("<b>Alt-Click</b> to unload.")
. += span_notice("<b>Alt-Shift-Click</b> to toggle lock.")

if(usr.stat || !ishuman(usr) || usr.restrained())
/obj/item/pet_carrier/AltClick(mob/user)
unload_content(user)

/obj/item/pet_carrier/AltShiftClick(mob/user)
open_close(user)

/obj/item/pet_carrier/proc/open_close(mob/user)
if(user.stat || !ishuman(user) || user.restrained())
return

change_state()

/obj/item/pet_carrier/verb/unload_content()
set name = "Опустошить переноску"
set desc = "Вытаскивает животное из переноски."
set category = "Object"

if(usr.stat || !ishuman(usr) || usr.restrained())
/obj/item/pet_carrier/proc/unload_content(mob/user)
if(user.stat || !ishuman(user) || user.restrained())
return

try_free_content(user = usr)
try_free_content(user)

/obj/item/pet_carrier/MouseDrop(obj/over_object)
if(ishuman(usr))
Expand Down
12 changes: 6 additions & 6 deletions modular_ss220/objects/code/officetoys.dm
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,12 @@
update_icon()
return TRUE

/obj/item/toy/desk/verb/rotate()
set name = "Rotate"
set category = "Object"
set src in oview(1)
/obj/item/toy/desk/examine(mob/user)
. = ..()
. += span_notice("<b>Alt-Click</b> to rotate.")

if(usr.incapacitated())
/obj/item/toy/desk/proc/rotate(mob/user)
if(user.incapacitated())
return
dir = turn(dir, 270)
return TRUE
Expand All @@ -133,7 +133,7 @@
if(!in_range(src, user))
return
else
rotate()
rotate(user)

/obj/item/toy/desk/officetoy
name = "office toy"
Expand Down
19 changes: 9 additions & 10 deletions modular_ss220/objects/code/papershredder.dm
Original file line number Diff line number Diff line change
Expand Up @@ -55,24 +55,23 @@
else
WRENCH_UNANCHOR_MESSAGE

/obj/machinery/papershredder/AltClick(mob/user)
/obj/machinery/papershredder/examine(mob/user)
. = ..()
empty_contents()
. += span_notice("<b>Alt-Click</b> to empty [src].")

/obj/machinery/papershredder/verb/empty_contents()
set name = "Empty Bin"
set category = "Object"
set src in oview(1)
/obj/machinery/papershredder/AltClick(mob/user)
empty_contents(user)

if(usr.stat || usr.restrained())
to_chat(usr, span_notice("You need your hands and legs free for this."))
/obj/machinery/papershredder/proc/empty_contents(mob/user)
if(user.stat || user.restrained())
to_chat(user, span_notice("You need your hands and legs free for this."))
return

if(!paperamount)
to_chat(usr, span_notice("[src] is empty."))
to_chat(user, span_notice("[src] is empty."))
return

empty_bin(usr)
empty_bin(user)

/obj/machinery/papershredder/proc/empty_bin(mob/living/user, obj/item/storage/empty_into)

Expand Down
34 changes: 6 additions & 28 deletions modular_ss220/objects/code/platform.dm
Original file line number Diff line number Diff line change
Expand Up @@ -41,47 +41,25 @@
/obj/structure/platform/examine(mob/user)
. = ..()
. += span_notice("[src] is [anchored == TRUE ? "screwed" : "unscrewed"] [anchored == TRUE ? "to" : "from"] the floor.")
. += span_notice("<b>Alt-Click</b> to rotate.")

/obj/structure/platform/verb/rotate()
set name = "Rotate Platform Counter-Clockwise"
set category = "Object"
set src in oview(1)

if(usr.incapacitated())
/obj/structure/platform/proc/rotate(mob/user)
if(user.incapacitated())
return

if(anchored)
to_chat(usr, span_warning("[src] cannot be rotated while it is screwed to the floor!"))
to_chat(user, span_warning("[src] cannot be rotated while it is screwed to the floor!"))
return FALSE

var/target_dir = turn(dir, 90)

setDir(target_dir)
air_update_turf(1)
add_fingerprint(usr)
return TRUE

/obj/structure/platform/verb/revrotate()
set name = "Rotate Platform Clockwise"
set category = "Object"
set src in oview(1)

if(usr.incapacitated())
return

if(anchored)
to_chat(usr, span_warning("[src] cannot be rotated while it is screwed to the floor!"))
return FALSE

var/target_dir = turn(dir, 270)

setDir(target_dir)
air_update_turf(1)
add_fingerprint(usr)
add_fingerprint(user)
return TRUE

/obj/structure/platform/AltClick(mob/user)
rotate()
rotate(user)

// Construction
/obj/structure/platform/screwdriver_act(mob/user, obj/item/I)
Expand Down