Rerolling blob strains now uses a radial menu, and lets you see what the strain does before picking it (#55559)

Also provides a generic, forward proof way to provide information to radial menu choices.
Why It's Good For The Game

    input is old and crummy.
    Blob is a very wiki reliant mechanic. This moves a bit of it into the game itself to fix that.
    Provides a real cancel option, whereas the old one had none. This is not a balance change, but a QoL one--everyone just moved the input window off to the side.
This commit is contained in:
Jared-Fogle
2020-12-21 10:28:21 +13:00
committed by GitHub
parent 1a05b9349a
commit e4edb06fb8
10 changed files with 129 additions and 26 deletions
@@ -8,7 +8,7 @@ GLOBAL_LIST_INIT(valid_blobstrains, subtypesof(/datum/blobstrain) - list(/datum/
var/shortdesc = null //just damage and on_mob effects, doesn't include special, blob-tile only effects
var/effectdesc = null //any long, blob-tile specific effects
var/analyzerdescdamage = "Unknown. Report this bug to a coder, or just adminhelp."
var/analyzerdesceffect = "N/A"
var/analyzerdesceffect
var/blobbernaut_message = "slams" //blobbernaut attack verb
var/message = "The blob strikes you" //message sent to any mob hit by the blob
var/message_living = null //extension to first mob sent to only living mobs i.e. silicons have no skin to be burnt
@@ -43,6 +43,9 @@ GLOBAL_LIST_EMPTY(blob_nodes)
var/announcement_time
var/has_announced = FALSE
/// The list of strains the blob can reroll for.
var/list/strain_choices
/mob/camera/blob/Initialize(mapload, starting_points = 60)
validate_location()
blob_points = starting_points
@@ -182,6 +185,7 @@ GLOBAL_LIST_EMPTY(blob_nodes)
BM.overmind = null
BM.update_icons()
GLOB.overminds -= src
QDEL_LIST_ASSOC_VAL(strain_choices)
SSshuttle.clearHostileEnvironment(src)
STOP_PROCESSING(SSobj, src)
+51 -16
View File
@@ -1,3 +1,6 @@
#define BLOB_REROLL_CHOICES 6
#define BLOB_REROLL_RADIUS 60
/mob/camera/blob/proc/can_buy(cost = 15)
if(blob_points < cost)
to_chat(src, "<span class='warning'>You cannot afford this, you need at least [cost] resources!</span>")
@@ -349,25 +352,54 @@
set category = "Blob"
set name = "Reactive Strain Adaptation (40)"
set desc = "Replaces your strain with a random, different one."
if(!rerolling && (free_strain_rerolls || can_buy(40)))
rerolling = TRUE
reroll_strain()
rerolling = FALSE
if(free_strain_rerolls)
free_strain_rerolls--
last_reroll_time = world.time
/mob/camera/blob/proc/reroll_strain()
var/list/choices = list()
while (length(choices) < 6)
var/datum/blobstrain/bs = pick((GLOB.valid_blobstrains))
choices[initial(bs.name)] = bs
if (!free_strain_rerolls && blob_points < BLOB_REROLL_COST)
to_chat(src, "<span class='warning'>You need at least [BLOB_REROLL_COST] resources to reroll your strain again!</span>")
return
var/choice = input(usr, "Please choose a new strain","Strain") as anything in sortList(choices, /proc/cmp_typepaths_asc)
if (choice && choices[choice] && !QDELETED(src))
var/datum/blobstrain/bs = choices[choice]
set_strain(bs)
open_reroll_menu()
/// Open the menu to reroll strains
/mob/camera/blob/proc/open_reroll_menu()
if (!strain_choices)
strain_choices = list()
var/list/new_strains = GLOB.valid_blobstrains.Copy()
for (var/_ in 1 to BLOB_REROLL_CHOICES)
var/datum/blobstrain/strain = pick_n_take(new_strains)
var/image/strain_icon = image('icons/mob/blob.dmi', "blob_core")
strain_icon.color = initial(strain.color)
var/info_text = "<span class='boldnotice'>[initial(strain.name)]</span>"
info_text += "<br><span class='notice'>[initial(strain.analyzerdescdamage)]</span>"
if (!isnull(initial(strain.analyzerdesceffect)))
info_text += "<br><span class='notice'>[initial(strain.analyzerdesceffect)]</span>"
var/datum/radial_menu_choice/choice = new
choice.image = strain_icon
choice.info = info_text
strain_choices[initial(strain.name)] = choice
var/strain_result = show_radial_menu(src, src, strain_choices, radius = BLOB_REROLL_RADIUS, tooltips = TRUE)
if (isnull(strain_result))
return
if (!free_strain_rerolls && !can_buy(BLOB_REROLL_COST))
return
for (var/_other_strain in GLOB.valid_blobstrains)
var/datum/blobstrain/other_strain = _other_strain
if (initial(other_strain.name) == strain_result)
set_strain(other_strain)
if (free_strain_rerolls)
free_strain_rerolls -= 1
last_reroll_time = world.time
return
/mob/camera/blob/verb/blob_help()
set category = "Blob"
@@ -392,3 +424,6 @@
if(!placed && autoplace_max_time <= world.time)
to_chat(src, "<span class='big'><font color=\"#EE4000\">You will automatically place your blob core in [DisplayTimeText(autoplace_max_time - world.time)].</font></span>")
to_chat(src, "<span class='big'><font color=\"#EE4000\">You [manualplace_min_time ? "will be able to":"can"] manually place your blob core by pressing the Place Blob Core button in the bottom right corner of the screen.</font></span>")
#undef BLOB_REROLL_CHOICES
#undef BLOB_REROLL_RADIUS
@@ -235,7 +235,7 @@
if(overmind)
. += list("<b>Material: <font color=\"[overmind.blobstrain.color]\">[overmind.blobstrain.name]</font><span class='notice'>.</span></b>",
"<b>Material Effects:</b> <span class='notice'>[overmind.blobstrain.analyzerdescdamage]</span>",
"<b>Material Properties:</b> <span class='notice'>[overmind.blobstrain.analyzerdesceffect]</span>")
"<b>Material Properties:</b> <span class='notice'>[overmind.blobstrain.analyzerdesceffect || "N/A"]</span>")
else
. += "<b>No Material Detected!</b>"