From a5812e02451193922a789e42bda2047816cb2ee0 Mon Sep 17 00:00:00 2001 From: JimKil3 <47290811+JimKil3@users.noreply.github.com> Date: Tue, 31 Oct 2023 14:36:53 -0400 Subject: [PATCH] Dionae can now drop nymphs they've picked up (#23020) * the feature * sirryan review * oopsies (adds an #undef) --- code/_onclick/hud/alert.dm | 20 +++++++++++++++++++ .../simple_animal/friendly/diona_nymph.dm | 16 +++++++++++---- 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/code/_onclick/hud/alert.dm b/code/_onclick/hud/alert.dm index de24f45198f..24a186227b7 100644 --- a/code/_onclick/hud/alert.dm +++ b/code/_onclick/hud/alert.dm @@ -402,6 +402,26 @@ Recharging stations are available in robotics, the dormitory bathrooms, and the var/mob/living/simple_animal/diona/D = usr return D.resist() +/obj/screen/alert/gestalt + name = "Merged nymph" + desc = "You have merged with one or more diona nymphs. Click here to drop it (or one of them)." + +/obj/screen/alert/gestalt/Click() + if(!usr || !usr.client) + return + + var/list/nymphs = list() + for(var/mob/living/simple_animal/diona/D in usr.contents) + nymphs += D + + if(length(nymphs) == 1) + var/mob/living/simple_animal/diona/D = nymphs[1] + D.split() + else + var/mob/living/simple_animal/diona/D = input("Select a nymph to drop:", "Nymph Dropping", nymphs[1]) as anything in nymphs + if(D in usr.contents) + D.split() + //Need to cover all use cases - emag, illegal upgrade module, malf AI hack, traitor cyborg /obj/screen/alert/hacked name = "Hacked" diff --git a/code/modules/mob/living/simple_animal/friendly/diona_nymph.dm b/code/modules/mob/living/simple_animal/friendly/diona_nymph.dm index dd5db122407..9798ece8d26 100644 --- a/code/modules/mob/living/simple_animal/friendly/diona_nymph.dm +++ b/code/modules/mob/living/simple_animal/friendly/diona_nymph.dm @@ -3,6 +3,9 @@ */ //Mob defines. +#define GESTALT_ALERT "gestalt screen alert" +#define NYMPH_ALERT "nymph screen alert" + /mob/living/simple_animal/diona name = "diona nymph" icon = 'icons/mob/monkey.dmi' @@ -43,7 +46,6 @@ can_collar = TRUE a_intent = INTENT_HELP - var/gestalt_alert = "merged with gestalt" //used in adding and clearing alert var/evolve_donors = 5 //amount of blood donors needed before evolving var/awareness_donors = 3 //amount of blood donors needed for understand language var/nutrition_need = 500 //amount of nutrition needed before evolving @@ -105,7 +107,8 @@ if(isdiona(M)) to_chat(M, "You feel your being twine with that of [src] as it merges with your biomass.") to_chat(src, "You feel your being twine with that of [M] as you merge with its biomass.") - throw_alert(gestalt_alert, /obj/screen/alert/nymph, new_master = src) //adds a screen alert that can call resist + throw_alert(GESTALT_ALERT, /obj/screen/alert/nymph, new_master = src) //adds a screen alert that can call resist + M.throw_alert(NYMPH_ALERT, /obj/screen/alert/gestalt, new_master = src) forceMove(M) else if(isrobot(M)) M.visible_message("[M] playfully boops [src] on the head!", "You playfully boop [src] on the head!") @@ -138,7 +141,8 @@ M.status_flags |= PASSEMOTES to_chat(src, "You feel your being twine with that of [M] as you merge with its biomass.") forceMove(M) - throw_alert(gestalt_alert, /obj/screen/alert/nymph, new_master = src) //adds a screen alert that can call resist + throw_alert(GESTALT_ALERT, /obj/screen/alert/nymph, new_master = src) //adds a screen alert that can call resist + M.throw_alert(NYMPH_ALERT, /obj/screen/alert/gestalt, new_master = src) return TRUE else return FALSE @@ -160,8 +164,9 @@ hasMobs = TRUE if(!hasMobs) D.status_flags &= ~PASSEMOTES + D.clear_alert(NYMPH_ALERT) - clear_alert(gestalt_alert) + clear_alert(GESTALT_ALERT) return TRUE /mob/living/simple_animal/diona/proc/evolve() @@ -280,3 +285,6 @@ if(!jobban_isbanned(user, ROLE_NYMPH)) return TRUE return FALSE + +#undef GESTALT_ALERT +#undef NYMPH_ALERT