From 2df585e4620cfb7f53e8927c367220f4f899ba38 Mon Sep 17 00:00:00 2001 From: DreamySkrell <107256943+DreamySkrell@users.noreply.github.com> Date: Wed, 29 Mar 2023 20:35:32 +0200 Subject: [PATCH] Ghosts can jump to a ghost spawner's spawn point (#16102) * ghost spawner jump to * c * Update vueui/src/components/view/misc/ghostspawner.vue Co-authored-by: SleepyGemmy <99297919+SleepyGemmy@users.noreply.github.com> --------- Co-authored-by: DreamySkrell <> Co-authored-by: SleepyGemmy <99297919+SleepyGemmy@users.noreply.github.com> --- code/controllers/subsystems/ghostroles.dm | 10 +++++ code/modules/ghostroles/spawner/base.dm | 4 ++ .../DreamySkrell-ghostspawnerjumpto2356.yml | 41 +++++++++++++++++++ .../src/components/view/misc/ghostspawner.vue | 7 ++-- 4 files changed, 59 insertions(+), 3 deletions(-) create mode 100644 html/changelogs/DreamySkrell-ghostspawnerjumpto2356.yml diff --git a/code/controllers/subsystems/ghostroles.dm b/code/controllers/subsystems/ghostroles.dm index 90d500b37df..7266e36e59e 100644 --- a/code/controllers/subsystems/ghostroles.dm +++ b/code/controllers/subsystems/ghostroles.dm @@ -130,6 +130,7 @@ VUEUI_SET_CHECK(data["spawners"][G.short_name]["desc"], G.desc, ., data) VUEUI_SET_CHECK(data["spawners"][G.short_name]["cant_spawn"], cant_spawn, ., data) VUEUI_SET_CHECK(data["spawners"][G.short_name]["can_edit"], G.can_edit(user), ., data) + VUEUI_SET_CHECK(data["spawners"][G.short_name]["can_jump_to"], G.can_jump_to(user), ., data) VUEUI_SET_CHECK(data["spawners"][G.short_name]["enabled"], G.enabled, ., data) VUEUI_SET_CHECK(data["spawners"][G.short_name]["count"], G.count, ., data) VUEUI_SET_CHECK(data["spawners"][G.short_name]["spawnatoms"], length(G.spawn_atoms), ., data) @@ -165,6 +166,15 @@ return log_and_message_admins("joined as GhostRole: [S.name]", M) SSvueui.check_uis_for_change(src) //Make sure to update all the UIs so the count is updated + if(href_list["jump_to"]) + var/spawner_id = href_list["jump_to"] + var/datum/ghostspawner/human/spawner = spawners[spawner_id] + var/mob/abstract/observer/observer = usr + if(spawner && istype(observer) && spawner.can_jump_to(observer)) + var/atom/turf = spawner.select_spawnlocation(FALSE) + if(isturf(turf)) + observer.on_mob_jump() + observer.forceMove(turf) if(href_list["enable"]) var/datum/ghostspawner/S = spawners[href_list["enable"]] if(!S) diff --git a/code/modules/ghostroles/spawner/base.dm b/code/modules/ghostroles/spawner/base.dm index f787b6b43cc..1bb8f398907 100644 --- a/code/modules/ghostroles/spawner/base.dm +++ b/code/modules/ghostroles/spawner/base.dm @@ -182,6 +182,10 @@ return TRUE return FALSE +//Proc to check if a specific user can jump to this spawner (ghosts should be able to) +/datum/ghostspawner/proc/can_jump_to(mob/user) + return isobserver(user) && loc_type == GS_LOC_POS + /datum/ghostspawner/proc/is_enabled() if(loc_type == GS_LOC_ATOM) return enabled && !!length(spawn_atoms) diff --git a/html/changelogs/DreamySkrell-ghostspawnerjumpto2356.yml b/html/changelogs/DreamySkrell-ghostspawnerjumpto2356.yml new file mode 100644 index 00000000000..37570ecdcb1 --- /dev/null +++ b/html/changelogs/DreamySkrell-ghostspawnerjumpto2356.yml @@ -0,0 +1,41 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +# balance +# admin +# backend +# security +# refactor +################################# + +# Your name. +author: DreamySkrell + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - rscadd: "Ghosts can jump to a ghost spawner's spawn point." diff --git a/vueui/src/components/view/misc/ghostspawner.vue b/vueui/src/components/view/misc/ghostspawner.vue index ddec435cdf8..9759dba85b0 100644 --- a/vueui/src/components/view/misc/ghostspawner.vue +++ b/vueui/src/components/view/misc/ghostspawner.vue @@ -18,9 +18,10 @@