Skip to content

Commit

Permalink
pAI radial chassis selection
Browse files Browse the repository at this point in the history
  • Loading branch information
Skies-Of-Blue committed Jan 15, 2024
1 parent 19b0d11 commit b2d62ad
Showing 1 changed file with 23 additions and 4 deletions.
27 changes: 23 additions & 4 deletions code/modules/mob/living/silicon/pai/pai_shell.dm
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,18 @@
holoform = FALSE
set_resting(resting)


//Sets a new holochassis skin based on a pAI's choice

/mob/living/silicon/pai/proc/choose_chassis()
if(!isturf(loc) && loc != card)
to_chat(src, "<span class='boldwarning'>You can not change your holochassis composite while not on the ground or in your card!</span>")
return FALSE
var/choice = input(src, "What would you like to use for your holochassis composite?") as null|anything in sortList(possible_chassis)
var/list/skins = list()
for(var/holochassis_option in possible_chassis)
var/image/item_image = image(icon = src.icon, icon_state = holochassis_option)
skins += list("[holochassis_option]" = item_image)
sortList(skins)

var/atom/anchor = get_atom_on_turf(src)
var/choice = show_radial_menu(src, anchor, skins, custom_check = CALLBACK(src, .proc/check_menu, anchor), radius = 40, require_near = TRUE)
if(!choice)
return FALSE
chassis = choice
Expand All @@ -85,6 +92,18 @@
update_resting()
to_chat(src, "<span class='boldnotice'>You switch your holochassis projection composite to [chassis].</span>")

//Checks if we are allowed to interact with a radial menu

/mob/living/silicon/pai/proc/check_menu(atom/anchor)
if(incapacitated())
return FALSE
if(get_turf(src) != get_turf(anchor))
return FALSE
if(!isturf(loc) && loc != card)
to_chat(src, "<span class='boldwarning'>You can not change your holochassis composite while not on the ground or in your card!</span>")
return FALSE
return TRUE

/mob/living/silicon/pai/update_resting()
. = ..()
if(resting)
Expand Down

0 comments on commit b2d62ad

Please sign in to comment.