Files
Bubberstation/code/modules/buildmode/submodes/copy.dm
SkyratBot 495b35a679 [MIRROR] Converts all uses of modifiers to lazy access to avoid memes in future (#3331)
* Converts all uses of modifiers to lazy access to avoid memes in future

* Update work_tools.dm

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Co-authored-by: KathrinBailey <53862927+KathrinBailey@users.noreply.github.com>
2021-02-13 11:06:39 +00:00

27 lines
1.1 KiB
Plaintext

/datum/buildmode_mode/copy
key = "copy"
var/atom/movable/stored = null
/datum/buildmode_mode/copy/Destroy()
stored = null
return ..()
/datum/buildmode_mode/copy/show_help(client/c)
to_chat(c, "<span class='notice'>***********************************************************</span>")
to_chat(c, "<span class='notice'>Left Mouse Button on obj/turf/mob = Spawn a Copy of selected target</span>")
to_chat(c, "<span class='notice'>Right Mouse Button on obj/mob = Select target to copy</span>")
to_chat(c, "<span class='notice'>***********************************************************</span>")
/datum/buildmode_mode/copy/handle_click(client/c, params, obj/object)
var/list/modifiers = params2list(params)
if(LAZYACCESS(modifiers, LEFT_CLICK))
var/turf/T = get_turf(object)
if(stored)
DuplicateObject(stored, perfectcopy=1, sameloc=0,newloc=T)
log_admin("Build Mode: [key_name(c)] copied [stored] to [AREACOORD(object)]")
else if(LAZYACCESS(modifiers, RIGHT_CLICK))
if(ismovable(object)) // No copying turfs for now.
to_chat(c, "<span class='notice'>[object] set as template.</span>")
stored = object