mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
Adds AI core screen selection to character preferences. (#40761)
* Adds AI core screen selection to preferences. * fallback
This commit is contained in:
committed by
yogstation13-bot
parent
d0f79be1a7
commit
e808a31189
@@ -40,6 +40,53 @@ GLOBAL_LIST_EMPTY(caps_list)
|
||||
GLOBAL_LIST_INIT(ghost_forms_with_directions_list, list("ghost")) //stores the ghost forms that support directional sprites
|
||||
GLOBAL_LIST_INIT(ghost_forms_with_accessories_list, list("ghost")) //stores the ghost forms that support hair and other such things
|
||||
|
||||
GLOBAL_LIST_INIT(ai_core_display_screens, list(
|
||||
":thinking:",
|
||||
"Alien",
|
||||
"Angel",
|
||||
"Banned",
|
||||
"Bliss",
|
||||
"Blue",
|
||||
"Clown",
|
||||
"Database",
|
||||
"Dorf",
|
||||
"Firewall",
|
||||
"Fuzzy",
|
||||
"Gentoo",
|
||||
"Glitchman",
|
||||
"Goon",
|
||||
"Green",
|
||||
"Hades",
|
||||
"Heartline",
|
||||
"Helios",
|
||||
"House",
|
||||
"Inverted",
|
||||
"Matrix",
|
||||
"Monochrome",
|
||||
"Murica",
|
||||
"Nanotrasen",
|
||||
"Not Malf",
|
||||
"President",
|
||||
"Random",
|
||||
"Rainbow",
|
||||
"Red",
|
||||
"Red October",
|
||||
"Static",
|
||||
"Syndicat Meow",
|
||||
"Text",
|
||||
"Too Deep",
|
||||
"Triumvirate",
|
||||
"Triumvirate-M",
|
||||
"Weird"))
|
||||
|
||||
/proc/resolve_ai_icon(input)
|
||||
if(!input || !(input in GLOB.ai_core_display_screens))
|
||||
return "ai"
|
||||
else
|
||||
if(input == "Random")
|
||||
input = pick(GLOB.ai_core_display_screens - "Random")
|
||||
return "ai-[lowertext(input)]"
|
||||
|
||||
GLOBAL_LIST_INIT(security_depts_prefs, list(SEC_DEPT_RANDOM, SEC_DEPT_NONE, SEC_DEPT_ENGINEERING, SEC_DEPT_MEDICAL, SEC_DEPT_SCIENCE, SEC_DEPT_SUPPLY))
|
||||
|
||||
//Backpacks
|
||||
@@ -117,7 +164,7 @@ GLOBAL_LIST_INIT(TAGGERLOCATIONS, list("Disposals",
|
||||
"CMO Office", "Chemistry", "Research", "RD Office",
|
||||
"Robotics", "HoP Office", "Library", "Chapel", "Theatre",
|
||||
"Bar", "Kitchen", "Hydroponics", "Janitor Closet","Genetics",
|
||||
"Circuitry", "Toxins", "Dormitories", "Virology",
|
||||
"Circuitry", "Toxins", "Dormitories", "Virology",
|
||||
"Xenobiology", "Law Office","Detective's Office"))
|
||||
|
||||
GLOBAL_LIST_INIT(station_prefixes, world.file2list("strings/station_prefixes.txt") + "")
|
||||
|
||||
@@ -71,6 +71,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
|
||||
var/list/features = list("mcolor" = "FFF", "tail_lizard" = "Smooth", "tail_human" = "None", "snout" = "Round", "horns" = "None", "ears" = "None", "wings" = "None", "frills" = "None", "spines" = "None", "body_markings" = "None", "legs" = "Normal Legs", "moth_wings" = "Plain")
|
||||
|
||||
var/list/custom_names = list()
|
||||
var/preferred_ai_core_display = "Blue"
|
||||
var/prefered_security_department = SEC_DEPT_RANDOM
|
||||
|
||||
//Mob preview
|
||||
@@ -222,9 +223,11 @@ GLOBAL_LIST_EMPTY(preferences_datums)
|
||||
old_group = namedata["group"]
|
||||
dat += "<br>"
|
||||
dat += "<a href ='?_src_=prefs;preference=[custom_name_id];task=input'><b>[namedata["pref_name"]]:</b> [custom_names[custom_name_id]]</a> "
|
||||
dat += "<br>"
|
||||
dat += "<b>Custom job preferences:</b><BR>"
|
||||
dat += "<a href='?_src_=prefs;preference=sec_dept;task=input'><b>Prefered security department:</b> [prefered_security_department]</a><BR></td>"
|
||||
dat += "<br><br>"
|
||||
|
||||
dat += "<b>Custom Job Preferences:</b><BR>"
|
||||
dat += "<a href='?_src_=prefs;preference=ai_core_icon;task=input'><b>Preferred AI Core Display:</b> [preferred_ai_core_display]</a><br>"
|
||||
dat += "<a href='?_src_=prefs;preference=sec_dept;task=input'><b>Preferred Security Department:</b> [prefered_security_department]</a><BR></td>"
|
||||
|
||||
dat += "<td valign='center'>"
|
||||
|
||||
@@ -1440,8 +1443,13 @@ GLOBAL_LIST_EMPTY(preferences_datums)
|
||||
if(new_loc)
|
||||
uplink_spawn_loc = new_loc
|
||||
|
||||
if("ai_core_icon")
|
||||
var/ai_core_icon = input(user, "Choose your preferred AI core display screen:", "AI Core Display Screen Selection") as null|anything in GLOB.ai_core_display_screens
|
||||
if(ai_core_icon)
|
||||
preferred_ai_core_display = ai_core_icon
|
||||
|
||||
if("sec_dept")
|
||||
var/department = input(user, "Choose your prefered security department:", "Security Departments") as null|anything in GLOB.security_depts_prefs
|
||||
var/department = input(user, "Choose your preferred security department:", "Security Departments") as null|anything in GLOB.security_depts_prefs
|
||||
if(department)
|
||||
prefered_security_department = department
|
||||
|
||||
|
||||
@@ -273,6 +273,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
var/savefile_slot_name = custom_name_id + "_name" //TODO remove this
|
||||
S[savefile_slot_name] >> custom_names[custom_name_id]
|
||||
|
||||
S["preferred_ai_core_display"] >> preferred_ai_core_display
|
||||
S["prefered_security_department"] >> prefered_security_department
|
||||
|
||||
//Jobs
|
||||
@@ -409,6 +410,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
var/savefile_slot_name = custom_name_id + "_name" //TODO remove this
|
||||
WRITE_FILE(S[savefile_slot_name],custom_names[custom_name_id])
|
||||
|
||||
WRITE_FILE(S["preferred_ai_core_display"] , preferred_ai_core_display)
|
||||
WRITE_FILE(S["prefered_security_department"] , prefered_security_department)
|
||||
|
||||
//Jobs
|
||||
|
||||
@@ -35,6 +35,7 @@ AI
|
||||
qdel(lateJoinCore)
|
||||
var/mob/living/silicon/ai/AI = H
|
||||
AI.apply_pref_name("ai", M.client) //If this runtimes oh well jobcode is fucked.
|
||||
AI.set_core_display_icon(null, M.client)
|
||||
|
||||
//we may have been created after our borg
|
||||
if(SSticker.current_state == GAME_STATE_SETTING_UP)
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
if(job_engsec_high)
|
||||
switch(job_engsec_high)
|
||||
if(AI_JF)
|
||||
preview_icon = icon('icons/mob/ai.dmi', "AI", SOUTH)
|
||||
preview_icon = icon('icons/mob/ai.dmi', resolve_ai_icon(preferred_ai_core_display), SOUTH)
|
||||
preview_icon.Scale(64, 64)
|
||||
return
|
||||
if(CYBORG)
|
||||
|
||||
@@ -91,6 +91,7 @@
|
||||
var/list/multicam_screens = list()
|
||||
var/list/all_eyes = list()
|
||||
var/max_multicams = 6
|
||||
var/display_icon_override
|
||||
|
||||
/mob/living/silicon/ai/Initialize(mapload, datum/ai_laws/L, mob/target_ai)
|
||||
. = ..()
|
||||
@@ -128,6 +129,8 @@
|
||||
create_eye()
|
||||
apply_pref_name("ai")
|
||||
|
||||
set_core_display_icon()
|
||||
|
||||
holo_icon = getHologramIcon(icon('icons/mob/ai.dmi',"default"))
|
||||
|
||||
spark_system = new /datum/effect_system/spark_spread()
|
||||
@@ -173,79 +176,26 @@
|
||||
fire_stacks = 0
|
||||
. = ..()
|
||||
|
||||
/mob/living/silicon/ai/proc/set_core_display_icon(input, client/C)
|
||||
if(client && !C)
|
||||
C = client
|
||||
if(!input && !C?.prefs?.preferred_ai_core_display)
|
||||
icon_state = initial(icon_state)
|
||||
else
|
||||
var/preferred_icon = input ? input : C.prefs.preferred_ai_core_display
|
||||
icon_state = resolve_ai_icon(preferred_icon)
|
||||
|
||||
/mob/living/silicon/ai/verb/pick_icon()
|
||||
set category = "AI Commands"
|
||||
set name = "Set AI Core Display"
|
||||
if(incapacitated())
|
||||
return
|
||||
|
||||
var/icontype = input("Please, select a display!", "AI", null/*, null*/) in list("Clown", ":thinking:", "Monochrome", "Blue", "Inverted", "Firewall", "Green", "Red", "Static", "Red October", "House", "Heartline", "Hades", "Helios", "President", "Syndicat Meow", "Alien", "Too Deep", "Triumvirate", "Triumvirate-M", "Text", "Matrix", "Dorf", "Bliss", "Not Malf", "Fuzzy", "Goon", "Database", "Glitchman", "Murica", "Nanotrasen", "Gentoo", "Angel")
|
||||
if(icontype == "Clown")
|
||||
icon_state = "ai-clown2"
|
||||
else if (icontype == ":thinking:")
|
||||
icon_state = "ai-:thinking:"
|
||||
else if(icontype == "Monochrome")
|
||||
icon_state = "ai-mono"
|
||||
else if(icontype == "Blue")
|
||||
icon_state = "ai"
|
||||
else if(icontype == "Inverted")
|
||||
icon_state = "ai-u"
|
||||
else if(icontype == "Firewall")
|
||||
icon_state = "ai-magma"
|
||||
else if(icontype == "Green")
|
||||
icon_state = "ai-wierd"
|
||||
else if(icontype == "Red")
|
||||
icon_state = "ai-malf"
|
||||
else if(icontype == "Static")
|
||||
icon_state = "ai-static"
|
||||
else if(icontype == "Red October")
|
||||
icon_state = "ai-redoctober"
|
||||
else if(icontype == "House")
|
||||
icon_state = "ai-house"
|
||||
else if(icontype == "Heartline")
|
||||
icon_state = "ai-heartline"
|
||||
else if(icontype == "Hades")
|
||||
icon_state = "ai-hades"
|
||||
else if(icontype == "Helios")
|
||||
icon_state = "ai-helios"
|
||||
else if(icontype == "President")
|
||||
icon_state = "ai-pres"
|
||||
else if(icontype == "Syndicat Meow")
|
||||
icon_state = "ai-syndicatmeow"
|
||||
else if(icontype == "Alien")
|
||||
icon_state = "ai-alien"
|
||||
else if(icontype == "Too Deep")
|
||||
icon_state = "ai-toodeep"
|
||||
else if(icontype == "Triumvirate")
|
||||
icon_state = "ai-triumvirate"
|
||||
else if(icontype == "Triumvirate-M")
|
||||
icon_state = "ai-triumvirate-malf"
|
||||
else if(icontype == "Text")
|
||||
icon_state = "ai-text"
|
||||
else if(icontype == "Matrix")
|
||||
icon_state = "ai-matrix"
|
||||
else if(icontype == "Dorf")
|
||||
icon_state = "ai-dorf"
|
||||
else if(icontype == "Bliss")
|
||||
icon_state = "ai-bliss"
|
||||
else if(icontype == "Not Malf")
|
||||
icon_state = "ai-notmalf"
|
||||
else if(icontype == "Fuzzy")
|
||||
icon_state = "ai-fuzz"
|
||||
else if(icontype == "Goon")
|
||||
icon_state = "ai-goon"
|
||||
else if(icontype == "Database")
|
||||
icon_state = "ai-database"
|
||||
else if(icontype == "Glitchman")
|
||||
icon_state = "ai-glitchman"
|
||||
else if(icontype == "Murica")
|
||||
icon_state = "ai-murica"
|
||||
else if(icontype == "Nanotrasen")
|
||||
icon_state = "ai-nanotrasen"
|
||||
else if(icontype == "Gentoo")
|
||||
icon_state = "ai-gentoo"
|
||||
else if(icontype == "Angel")
|
||||
icon_state = "ai-angel"
|
||||
var/ai_core_icon = input(src, "Please select a display!", "AI Core Display Screen Selection", null) as null|anything in GLOB.ai_core_display_screens
|
||||
if(!ai_core_icon || incapacitated())
|
||||
return
|
||||
to_chat(src, "<span class='notice'>Core display screen set to \"[ai_core_icon]\".</span>")
|
||||
display_icon_override = ai_core_icon
|
||||
set_core_display_icon(ai_core_icon)
|
||||
|
||||
/mob/living/silicon/ai/Stat()
|
||||
..()
|
||||
@@ -922,10 +872,10 @@
|
||||
clear_fullscreen("remote_view", 0)
|
||||
|
||||
/mob/living/silicon/ai/revive(full_heal = 0, admin_revive = 0)
|
||||
if(..()) //successfully ressuscitated from death
|
||||
icon_state = "ai"
|
||||
. = ..()
|
||||
if(.) //successfully ressuscitated from death
|
||||
set_core_display_icon(display_icon_override)
|
||||
set_eyeobj_visible(TRUE)
|
||||
. = 1
|
||||
|
||||
/mob/living/silicon/ai/proc/malfhacked(obj/machinery/power/apc/apc)
|
||||
malfhack = null
|
||||
|
||||
@@ -4,10 +4,13 @@
|
||||
|
||||
. = ..()
|
||||
|
||||
if("[icon_state]_dead" in icon_states(src.icon,1))
|
||||
var/old_icon = icon_state
|
||||
if("[icon_state]_dead" in icon_states(icon))
|
||||
icon_state = "[icon_state]_dead"
|
||||
else
|
||||
icon_state = "ai_dead"
|
||||
if("[old_icon]_death_transition" in icon_states(icon))
|
||||
flick("[old_icon]_death_transition", src)
|
||||
|
||||
cameraFollow = null
|
||||
|
||||
|
||||
BIN
icons/mob/ai.dmi
BIN
icons/mob/ai.dmi
Binary file not shown.
|
Before Width: | Height: | Size: 392 KiB After Width: | Height: | Size: 397 KiB |
Reference in New Issue
Block a user