From ba0366210ebcaecae26fa65f217150d424f7966e Mon Sep 17 00:00:00 2001 From: Profakos Date: Thu, 8 Sep 2022 02:59:50 +0200 Subject: [PATCH] Sentience preference selection and antag datum (#69569) --- code/__HELPERS/game.dm | 8 ++-- code/_globalvars/lists/poll_ignore.dm | 10 +++++ code/modules/admin/fun_balloon.dm | 2 +- .../sentient_creature/sentient_creature.dm | 37 +++++++++++++++++ .../client/preferences/middleware/antags.dm | 1 + .../clothing/head/mind_monkey_helmet.dm | 2 +- code/modules/events/sentience.dm | 2 +- .../simple_animal/hostile/gorilla/gorilla.dm | 8 ++-- .../hostile/mining_mobs/elites/elite.dm | 2 +- .../living/simple_animal/hostile/regalrat.dm | 2 +- .../research/xenobiology/xenobiology.dm | 7 +--- ...nshot_antag_icons_sentiencepotionspawn.png | Bin 0 -> 2339 bytes tgstation.dme | 1 + .../tgui/interfaces/AntagInfoSentient.js | 39 ++++++++++++++++++ .../antagonists/sentiencepotionspawn.ts | 23 +++++++++++ 15 files changed, 126 insertions(+), 18 deletions(-) create mode 100644 code/modules/antagonists/sentient_creature/sentient_creature.dm create mode 100644 code/modules/unit_tests/screenshots/screenshot_antag_icons_sentiencepotionspawn.png create mode 100644 tgui/packages/tgui/interfaces/AntagInfoSentient.js create mode 100644 tgui/packages/tgui/interfaces/PreferencesMenu/antagonists/antagonists/sentiencepotionspawn.ts diff --git a/code/__HELPERS/game.dm b/code/__HELPERS/game.dm index 3d78363b776..80a62205e00 100644 --- a/code/__HELPERS/game.dm +++ b/code/__HELPERS/game.dm @@ -245,10 +245,10 @@ * Arguments: * * question - question to show players as part of poll * * jobban_type - Type of jobban to use to filter out potential candidates. - * * be_special_flag - Unknown/needs further documentation. + * * be_special_flag - The required role that the player has to have enabled to see the prompt. * * poll_time - Length of time in deciseconds that the poll input box exists before closing. * * target_mob - The mob that is being polled for. - * * ignore_category - Unknown/needs further documentation. + * * ignore_category - The notification preference that hides the prompt. */ /proc/poll_candidates_for_mob(question, jobban_type, be_special_flag = 0, poll_time = 30 SECONDS, mob/target_mob, ignore_category = null) var/static/list/mob/currently_polling_mobs = list() @@ -272,10 +272,10 @@ * Arguments: * * question - question to show players as part of poll * * jobban_type - Type of jobban to use to filter out potential candidates. - * * be_special_flag - Unknown/needs further documentation. + * * be_special_flag - The required role that the player has to have enabled to see the prompt. * * poll_time - Length of time in deciseconds that the poll input box exists before closing. * * mobs - The list of mobs being polled for. This list is mutated and invalid mobs are removed from it before the proc returns. - * * ignore_category - Unknown/needs further documentation. + * * ignore_category - The notification preference that hides the prompt. */ /proc/poll_candidates_for_mobs(question, jobban_type, be_special_flag = 0, poll_time = 30 SECONDS, list/mobs, ignore_category = null) var/list/candidate_list = poll_ghost_candidates(question, jobban_type, be_special_flag, poll_time, ignore_category) diff --git a/code/_globalvars/lists/poll_ignore.dm b/code/_globalvars/lists/poll_ignore.dm index db5a23e7685..96d49f88a1c 100644 --- a/code/_globalvars/lists/poll_ignore.dm +++ b/code/_globalvars/lists/poll_ignore.dm @@ -21,6 +21,11 @@ #define POLL_IGNORE_ACADEMY_WIZARD "academy_wizard" #define POLL_IGNORE_PAI "pai" #define POLL_IGNORE_VENUSHUMANTRAP "venus_human_trap" +#define POLL_IGNORE_REGAL_RAT "regal_rat" +#define POLL_IGNORE_CARGORILLA "cargorilla" +#define POLL_IGNORE_MONKEY_HELMET "mind_magnified_monkey" +#define POLL_IGNORE_LAVALAND_ELITE "lavaland_elite" +#define POLL_IGNORE_SHUTTLE_DENIZENS "shuttle_denizens" GLOBAL_LIST_INIT(poll_ignore_desc, list( @@ -45,6 +50,11 @@ GLOBAL_LIST_INIT(poll_ignore_desc, list( POLL_IGNORE_ACADEMY_WIZARD = "Academy Wizard Defender", POLL_IGNORE_PAI = JOB_PERSONAL_AI, POLL_IGNORE_VENUSHUMANTRAP = "Venus Human Traps", + POLL_IGNORE_REGAL_RAT = "Regal rat", + POLL_IGNORE_CARGORILLA = "Cargorilla", + POLL_IGNORE_MONKEY_HELMET = "Mind magnified monkey", + POLL_IGNORE_LAVALAND_ELITE = "Lavaland elite", + POLL_IGNORE_SHUTTLE_DENIZENS = "Shuttle denizens", )) GLOBAL_LIST_INIT(poll_ignore, init_poll_ignore()) diff --git a/code/modules/admin/fun_balloon.dm b/code/modules/admin/fun_balloon.dm index 77d9fdd0fbe..cdef9b9194c 100644 --- a/code/modules/admin/fun_balloon.dm +++ b/code/modules/admin/fun_balloon.dm @@ -88,7 +88,7 @@ bodies += possessable var/question = "Would you like to be [group_name]?" - var/list/candidates = poll_candidates_for_mobs(question, ROLE_PAI, FALSE, 10 SECONDS, bodies) + var/list/candidates = poll_candidates_for_mobs(question, ROLE_SENTIENCE, ROLE_SENTIENCE, 10 SECONDS, bodies, POLL_IGNORE_SHUTTLE_DENIZENS) while(LAZYLEN(candidates) && LAZYLEN(bodies)) var/mob/dead/observer/C = pick_n_take(candidates) var/mob/living/body = pick_n_take(bodies) diff --git a/code/modules/antagonists/sentient_creature/sentient_creature.dm b/code/modules/antagonists/sentient_creature/sentient_creature.dm new file mode 100644 index 00000000000..5b2d98e0697 --- /dev/null +++ b/code/modules/antagonists/sentient_creature/sentient_creature.dm @@ -0,0 +1,37 @@ +/datum/antagonist/sentient_creature + name = "\improper Sentient Creature" + show_in_antagpanel = FALSE + show_in_roundend = FALSE + count_against_dynamic_roll_chance = FALSE + ui_name = "AntagInfoSentient" + +/datum/antagonist/sentient_creature/get_preview_icon() + var/icon/final_icon = icon('icons/mob/simple/pets.dmi', "corgi") + + var/icon/broodmother = icon('icons/mob/simple/lavaland/lavaland_elites.dmi', "broodmother") + broodmother.Blend(rgb(128, 128, 128, 128), ICON_MULTIPLY) + final_icon.Blend(broodmother, ICON_UNDERLAY, -world.icon_size / 4, 0) + + var/icon/rat = icon('icons/mob/simple/animal.dmi', "regalrat") + rat.Blend(rgb(128, 128, 128, 128), ICON_MULTIPLY) + final_icon.Blend(rat, ICON_UNDERLAY, world.icon_size / 4, 0) + + final_icon.Scale(ANTAGONIST_PREVIEW_ICON_SIZE, ANTAGONIST_PREVIEW_ICON_SIZE) + return final_icon + +/datum/antagonist/sentient_creature/on_gain() + if(owner.enslaved_to) + owner.current.copy_languages(owner.enslaved_to, LANGUAGE_MASTER) + owner.current.update_atom_languages() + . = ..() + +/datum/antagonist/sentient_creature/ui_static_data(mob/user) + var/list/data = list() + if(owner.enslaved_to) + data["enslaved_to"] = owner.enslaved_to.real_name + data["p_them"] = owner.enslaved_to.p_them() + data["p_their"] = owner.enslaved_to.p_their() + data["holographic"] = owner.current.flags_1 & HOLOGRAM_1 + return data + + diff --git a/code/modules/client/preferences/middleware/antags.dm b/code/modules/client/preferences/middleware/antags.dm index 08936bcd23e..dbbaa1b8b0f 100644 --- a/code/modules/client/preferences/middleware/antags.dm +++ b/code/modules/client/preferences/middleware/antags.dm @@ -118,6 +118,7 @@ var/static/list/non_ruleset_antagonists = list( ROLE_FUGITIVE = /datum/antagonist/fugitive, ROLE_LONE_OPERATIVE = /datum/antagonist/nukeop/lone, + ROLE_SENTIENCE = /datum/antagonist/sentient_creature, ) var/list/antagonists = non_ruleset_antagonists.Copy() diff --git a/code/modules/clothing/head/mind_monkey_helmet.dm b/code/modules/clothing/head/mind_monkey_helmet.dm index 6534cdbc128..869ddd1d7f0 100644 --- a/code/modules/clothing/head/mind_monkey_helmet.dm +++ b/code/modules/clothing/head/mind_monkey_helmet.dm @@ -48,7 +48,7 @@ playsound(src, 'sound/machines/ping.ogg', 30, TRUE) RegisterSignal(magnification, COMSIG_SPECIES_LOSS, .proc/make_fall_off) polling = TRUE - var/list/candidates = poll_candidates_for_mob("Do you want to play as a mind magnified monkey?", ROLE_SENTIENCE, ROLE_SENTIENCE, 5 SECONDS, magnification, POLL_IGNORE_SENTIENCE_POTION) + var/list/candidates = poll_candidates_for_mob("Do you want to play as a mind magnified monkey?", ROLE_MONKEY_HELMET, null, 5 SECONDS, magnification, POLL_IGNORE_MONKEY_HELMET) polling = FALSE if(!magnification) return diff --git a/code/modules/events/sentience.dm b/code/modules/events/sentience.dm index 9880b32ee15..3888c4cf631 100644 --- a/code/modules/events/sentience.dm +++ b/code/modules/events/sentience.dm @@ -44,7 +44,7 @@ GLOBAL_LIST_INIT(high_priority_sentience, typecacheof(list( /datum/round_event/ghost_role/sentience/spawn_role() var/list/mob/dead/observer/candidates - candidates = get_candidates(ROLE_ALIEN, ROLE_ALIEN) + candidates = get_candidates(ROLE_SENTIENCE, ROLE_SENTIENCE) // find our chosen mob to breathe life into // Mobs have to be simple animals, mindless, on station, and NOT holograms. diff --git a/code/modules/mob/living/simple_animal/hostile/gorilla/gorilla.dm b/code/modules/mob/living/simple_animal/hostile/gorilla/gorilla.dm index 4f81e2ece3e..820cd294df3 100644 --- a/code/modules/mob/living/simple_animal/hostile/gorilla/gorilla.dm +++ b/code/modules/mob/living/simple_animal/hostile/gorilla/gorilla.dm @@ -154,9 +154,11 @@ being_polled_for = TRUE var/list/mob/dead/candidates = poll_candidates_for_mob( "Do you want to play as a Cargorilla?", - jobban_type = ROLE_SENTIENCE, - poll_time = 30 SECONDS, - target_mob = src, + ROLE_SENTIENCE, + ROLE_SENTIENCE, + 30 SECONDS, + src, + POLL_IGNORE_CARGORILLA ) being_polled_for = FALSE diff --git a/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/elite.dm b/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/elite.dm index 8b17bfce984..d33529be570 100644 --- a/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/elite.dm +++ b/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/elite.dm @@ -179,7 +179,7 @@ While using this makes the system rely on OnFire, it still gives options for tim addtimer(CALLBACK(src, .proc/spawn_elite), 30) return visible_message(span_boldwarning("Something within [src] stirs...")) - var/list/candidates = poll_candidates_for_mob("Do you want to play as a lavaland elite?", ROLE_SENTIENCE, ROLE_SENTIENCE, 5 SECONDS, src, POLL_IGNORE_SENTIENCE_POTION) + var/list/candidates = poll_candidates_for_mob("Do you want to play as a lavaland elite?", ROLE_SENTIENCE, ROLE_SENTIENCE, 5 SECONDS, src, POLL_IGNORE_LAVALAND_ELITE) if(candidates.len) audible_message(span_boldwarning("The stirring sounds increase in volume!")) elitemind = pick(candidates) diff --git a/code/modules/mob/living/simple_animal/hostile/regalrat.dm b/code/modules/mob/living/simple_animal/hostile/regalrat.dm index 105dd25db2b..9bbb1d0a44c 100644 --- a/code/modules/mob/living/simple_animal/hostile/regalrat.dm +++ b/code/modules/mob/living/simple_animal/hostile/regalrat.dm @@ -50,7 +50,7 @@ return ..() /mob/living/simple_animal/hostile/regalrat/proc/get_player() - var/list/mob/dead/observer/candidates = poll_ghost_candidates("Do you want to play as the Royal Rat, cheesey be their crown?", ROLE_SENTIENCE, FALSE, 100, POLL_IGNORE_SENTIENCE_POTION) + var/list/mob/dead/observer/candidates = poll_ghost_candidates("Do you want to play as the Regal Rat, cheesey be their crown?", ROLE_SENTIENCE, ROLE_SENTIENCE, 100, POLL_IGNORE_REGAL_RAT) if(LAZYLEN(candidates) && !mind) var/mob/dead/observer/C = pick(candidates) key = C.key diff --git a/code/modules/research/xenobiology/xenobiology.dm b/code/modules/research/xenobiology/xenobiology.dm index 2da2b25fe79..08e350cb38a 100644 --- a/code/modules/research/xenobiology/xenobiology.dm +++ b/code/modules/research/xenobiology/xenobiology.dm @@ -719,13 +719,8 @@ if(isanimal(dumb_mob)) var/mob/living/simple_animal/smart_animal = dumb_mob smart_animal.sentience_act() - to_chat(dumb_mob, span_warning("All at once it makes sense: you know what you are and who you are! Self awareness is yours!")) - to_chat(dumb_mob, span_userdanger("You are grateful to be self aware and owe [user.real_name] a great debt. Serve [user.real_name], and assist [user.p_them()] in completing [user.p_their()] goals at any cost.")) - if(dumb_mob.flags_1 & HOLOGRAM_1) //Check to see if it's a holodeck creature - to_chat(dumb_mob, span_userdanger("You also become depressingly aware that you are not a real creature, but instead a holoform. Your existence is limited to the parameters of the holodeck.")) + dumb_mob.mind.add_antag_datum(/datum/antagonist/sentient_creature) to_chat(user, span_notice("[dumb_mob] accepts [src] and suddenly becomes attentive and aware. It worked!")) - dumb_mob.copy_languages(user, LANGUAGE_MASTER) - dumb_mob.update_atom_languages() after_success(user, dumb_mob) qdel(src) else diff --git a/code/modules/unit_tests/screenshots/screenshot_antag_icons_sentiencepotionspawn.png b/code/modules/unit_tests/screenshots/screenshot_antag_icons_sentiencepotionspawn.png new file mode 100644 index 0000000000000000000000000000000000000000..1d01c240008e47483cba8c51dc793525945443ed GIT binary patch literal 2339 zcmYLLc{~(q7ak>)eTHmVA`F>9-0aIR4I_pujazAKQ`t47Y{^oVVKiot43h0ynwVs{ zMOngF%hnx@eHlWQ>@Kc;`F-CX?|aUF&w0;tp69&rHYhXRQ{txp001x29Bz9UoqruJ zj>CK6*?sN9;2C1?7zoD(xZynf13mnF0e}Y-yQ}`Vdz))^{wwQK%9kO^-JLylMYf3)zytsLVqN)bO|I}c7^KqJB%~}ZG#jv2$8N%ML(-fy*PT)!vca(r1-uJ_?*a2MUXsfg>$M0;m*J-z<%z6j&w*I) zaivKFE)r*-wBU}vCc>H1+Q4$jcZ(tNQJKX;Ytv~@rJTh)038pQB4!_EZ8z4Xr9Nt% zlM9E^FU6YT?!FU6Z`7Yk&0APr*VvLvE6+Dcdo9s>Tt$x8S?p?*z*VS>T5#Kq4m!&5 z<@N8WPL!T8v{K8}1y8?$K^-+s@$X_mZ>v4$rA5UD(lTWXK3?brq^(dUQg$9)SQW^h zu@vrYxJ$%`jRo@{=T2RL8tU!jDys@1L8_x$R-uqq#aKSD-sys7#`Ju(y@AWLdB`Jd zKAXy9a+J(y?=b4PG#O7&_IkL6eoWXh0XI))OYvvuZzG^2xHYvKm?~ zE>>E6doS~%n7)VFQStl%DqwEErO%kp8eGyfagXE6wsz*k${&)&`A~$yKE@AhsPEm1 z+l=}k7IoEHfz(c@S^MC4SGgVG(dd;dnIHF;cs{2iLj2vGVwP9 zTO6*Kd!!^_WEC>dT~?17{$c*h?!UY16Sdggw?9XMUx6%V`E$+}+uYi$w)TU3vqGYW z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@ -2333,6 +2333,7 @@ #include "code\modules\antagonists\revolution\enemy_of_the_state.dm" #include "code\modules\antagonists\revolution\revolution.dm" #include "code\modules\antagonists\santa\santa.dm" +#include "code\modules\antagonists\sentient_creature\sentient_creature.dm" #include "code\modules\antagonists\separatist\nation_creation.dm" #include "code\modules\antagonists\separatist\objectives.dm" #include "code\modules\antagonists\separatist\separatist.dm" diff --git a/tgui/packages/tgui/interfaces/AntagInfoSentient.js b/tgui/packages/tgui/interfaces/AntagInfoSentient.js new file mode 100644 index 00000000000..a389fe2df7e --- /dev/null +++ b/tgui/packages/tgui/interfaces/AntagInfoSentient.js @@ -0,0 +1,39 @@ +import { useBackend } from '../backend'; +import { BlockQuote, Section, Stack } from '../components'; +import { Window } from '../layouts'; + +export const AntagInfoSentient = (props, context) => { + const { act, data } = useBackend(context); + const { enslaved_to, holographic, p_them, p_their } = data; + return ( + + +

+ + + You are a sentient creature! + + +
+ All at once it makes sense: you know what you are and who you + are! Self awareness is yours! + {!!enslaved_to && + ' You are grateful to be self aware and owe ' + + enslaved_to + + ' a great debt. Serve ' + + enslaved_to + + ', and assist ' + + p_them + + ' in completing ' + + p_their + + ' goals at any cost.'} + {!!holographic && + ' You also become depressingly aware that you are not a real creature, but instead a holoform. Your existence is limited to the parameters of the holodeck.'} +
+
+
+
+ + + ); +}; diff --git a/tgui/packages/tgui/interfaces/PreferencesMenu/antagonists/antagonists/sentiencepotionspawn.ts b/tgui/packages/tgui/interfaces/PreferencesMenu/antagonists/antagonists/sentiencepotionspawn.ts new file mode 100644 index 00000000000..247b88aed0d --- /dev/null +++ b/tgui/packages/tgui/interfaces/PreferencesMenu/antagonists/antagonists/sentiencepotionspawn.ts @@ -0,0 +1,23 @@ +import { Antagonist, Category } from '../base'; +import { multiline } from 'common/string'; + +const SentientCreature: Antagonist = { + key: 'sentiencepotionspawn', + name: 'Sentient Creature', + description: [ + multiline` + Either by cosmic happenstance, or due to crew's shenanigans, you have been + given sentience! + `, + + multiline` + This is a blanket preference. The more benign ones include random human + level intelligence events, the cargorilla, and creatures uplifted via sentience + potions. The less friendly ones include the regal rat, and the boosted + mining elite mobs. + `, + ], + category: Category.Midround, +}; + +export default SentientCreature;