From ef4d8f169af31de8302b8813b7e56dece59622ae Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Mon, 20 May 2024 12:28:57 +0200 Subject: [PATCH] [MIRROR] Sentience balloon can now assign antag to affected mobs (#27778) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Sentience balloon can now assign antag to affected mobs (#83322) ## About The Pull Request ![изображение](https://github.com/tgstation/tgstation/assets/53361823/732725fe-7c87-48dd-a0d0-bab990e54cef) ![изображение](https://github.com/tgstation/tgstation/assets/53361823/4b78a0ae-05e2-40ea-9f48-574fb9ba1140) there's probably a better way to show the list of antags ## Why It's Good For The Game I wanna give out antag datum to things I spawn, doing it one by one is annoying ## Changelog :cl: admin: sentience balloon can now assign antag to affected mobs /:cl: * Sentience balloon can now assign antag to affected mobs --------- Co-authored-by: Striders13 <53361823+Striders13@users.noreply.github.com> --- code/modules/admin/fun_balloon.dm | 11 +++++++++++ .../packages/tgui/interfaces/SentienceFunBalloon.jsx | 12 ++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/code/modules/admin/fun_balloon.dm b/code/modules/admin/fun_balloon.dm index f7f9911d40e..19637e5e94f 100644 --- a/code/modules/admin/fun_balloon.dm +++ b/code/modules/admin/fun_balloon.dm @@ -38,6 +38,8 @@ desc = "When this pops, things are gonna get more aware around here." var/group_name = "a bunch of giant spiders" var/effect_range = 3 + var/antag_type = null + var/make_antag = FALSE /obj/effect/fun_balloon/sentience/ui_interact(mob/user, datum/tgui/ui) ui = SStgui.try_update_ui(user, src, ui) @@ -49,6 +51,7 @@ var/list/data = list() data["group_name"] = group_name data["range"] = effect_range + data["antag"] = make_antag return data /obj/effect/fun_balloon/sentience/ui_state(mob/user) @@ -73,6 +76,11 @@ if("effect_range") effect_range = params["updated_range"] + if("select_antag") + var/list/paths = subtypesof(/datum/antagonist) + antag_type = input(usr,"Select antag", "Antagonist selection") as null|anything in sort_list(paths) + make_antag = TRUE + if("pop") if(!popped) popped = TRUE @@ -104,6 +112,9 @@ message_admins("[key_name_admin(C)] has taken control of ([key_name_admin(body)])") body.ghostize(FALSE) body.key = C.key + if (make_antag) + body.mind.add_antag_datum(antag_type) + continue new /obj/effect/temp_visual/gravpush(get_turf(body)) // ----------- Emergency Shuttle Balloon diff --git a/tgui/packages/tgui/interfaces/SentienceFunBalloon.jsx b/tgui/packages/tgui/interfaces/SentienceFunBalloon.jsx index 62330cc6a05..ab4353aab28 100644 --- a/tgui/packages/tgui/interfaces/SentienceFunBalloon.jsx +++ b/tgui/packages/tgui/interfaces/SentienceFunBalloon.jsx @@ -11,9 +11,9 @@ import { Window } from '../layouts'; export const SentienceFunBalloon = (props) => { const { act, data } = useBackend(); - const { group_name, range } = data; + const { group_name, range, antag } = data; return ( - +
@@ -44,6 +44,14 @@ export const SentienceFunBalloon = (props) => { } /> + + act('select_antag')} + /> +