From 0a5742e55b15d3510777e981b82e0ed30e56b1cd Mon Sep 17 00:00:00 2001 From: Kashargul <144968721+Kashargul@users.noreply.github.com> Date: Sun, 3 Nov 2024 02:30:01 +0100 Subject: [PATCH] list helper --- code/__defines/faction.dm | 1 + code/game/objects/mob_spawner_vr.dm | 8 ++-- code/game/objects/random/mob.dm | 8 ++-- code/global.dm | 42 +++++++++++++++++ .../client/preference_setup/vore/02_size.dm | 30 +----------- code/modules/client/preferences.dm | 31 +------------ .../station/protean_vr/protean_blob.dm | 2 +- code/modules/mob/living/living_vr.dm | 46 +------------------ code/modules/mob/living/login.dm | 30 +----------- 9 files changed, 57 insertions(+), 141 deletions(-) diff --git a/code/__defines/faction.dm b/code/__defines/faction.dm index 2d975b6cbb..84f329fb79 100644 --- a/code/__defines/faction.dm +++ b/code/__defines/faction.dm @@ -110,6 +110,7 @@ #define FACTION_WOLFTAUR "wolftaur" #define FACTION_WORM "worm" #define FACTION_XENO "xeno" +#define FACTION_CORGI "corgi" #define FACTION_PLANTS "plants" diff --git a/code/game/objects/mob_spawner_vr.dm b/code/game/objects/mob_spawner_vr.dm index 463caa43a6..0169683e01 100644 --- a/code/game/objects/mob_spawner_vr.dm +++ b/code/game/objects/mob_spawner_vr.dm @@ -133,7 +133,7 @@ It also makes it so a ghost wont know where all the goodies/mobs are. name = "Corgi Lazy Spawner" desc = "This is a proof of concept, not sure why you would use this one" spawn_delay = 3 MINUTES - mob_faction = "Corgi" + mob_faction = FACTION_CORGI spawn_types = list( /mob/living/simple_mob/animal/passive/dog/corgi = 75, /mob/living/simple_mob/animal/passive/dog/corgi/puppy = 50 @@ -150,7 +150,7 @@ It also makes it so a ghost wont know where all the goodies/mobs are. spawn_delay = 10 MINUTES range = 10 simultaneous_spawns = 1 - mob_faction = "wild animal" + mob_faction = FACTION_WILD_ANIMAL total_spawns = -1 destructible = 0 anchored = TRUE @@ -167,7 +167,7 @@ It also makes it so a ghost wont know where all the goodies/mobs are. spawn_delay = 10 MINUTES range = 10 simultaneous_spawns = 1 - mob_faction = "xeno" + mob_faction = FACTION_XENO total_spawns = -1 destructible = 1 health = 50 @@ -186,7 +186,7 @@ It also makes it so a ghost wont know where all the goodies/mobs are. spawn_delay = 10 MINUTES range = 10 simultaneous_spawns = 1 - mob_faction = "xeno" + mob_faction = FACTION_XENO total_spawns = 1 destructible = 1 health = 50 diff --git a/code/game/objects/random/mob.dm b/code/game/objects/random/mob.dm index e00c10a6db..5d1a0f5ecb 100644 --- a/code/game/objects/random/mob.dm +++ b/code/game/objects/random/mob.dm @@ -174,7 +174,7 @@ overwrite_hostility = 1 - mob_faction = "malf_drone" + mob_faction = FACTION_MALF_DRONE mob_returns_home = 1 mob_wander = 1 mob_wander_distance = 5 @@ -203,7 +203,7 @@ overwrite_hostility = 1 - mob_faction = "malf_drone" + mob_faction = FACTION_MALF_DRONE mob_returns_home = 1 mob_wander = 1 mob_wander_distance = 5 @@ -220,7 +220,7 @@ desc = "This is a random hivebot." icon_state = "robot" - mob_faction = "hivebot" + mob_faction = FACTION_HIVEBOT /obj/random/mob/robotic/hivebot/item_to_spawn() return pick(prob(10);/mob/living/simple_mob/mechanical/hivebot, @@ -292,7 +292,7 @@ desc = "This is a random PoI mercenary." icon_state = "humanoid" - mob_faction = "syndicate" + mob_faction = FACTION_SYNDICATE mob_returns_home = 1 mob_wander_distance = 7 // People like to wander, and these people probably have a lot of stuff to guard. diff --git a/code/global.dm b/code/global.dm index 3626077f06..8eaebe3cc3 100644 --- a/code/global.dm +++ b/code/global.dm @@ -186,3 +186,45 @@ var/static/icon/buildmode_hud = icon('icons/misc/buildmode.dmi') //Keyed list for caching icons so you don't need to make them for records, IDs, etc all separately. //Could be useful for AI impersonation or something at some point? var/static/list/cached_character_icons = list() + +var/list/talk_sound_map = rlist( + list( + "beep-boop", + "goon speak 1", + "goon speak 2", + "goon speak 3", + "goon speak 4", + "goon speak blub", + "goon speak bottalk", + "goon speak buwoo", + "goon speak cow", + "goon speak lizard", + "goon speak pug", + "goon speak pugg", + "goon speak roach", + "goon speak skelly", + // "xeno speak" // Does not exist on virgo + ), + list( + talk_sound, + goon_speak_one_sound, + goon_speak_two_sound, + goon_speak_three_sound, + goon_speak_four_sound, + goon_speak_blub_sound, + goon_speak_bottalk_sound, + goon_speak_buwoo_sound, + goon_speak_cow_sound, + goon_speak_lizard_sound, + goon_speak_pug_sound, + goon_speak_pugg_sound, + goon_speak_roach_sound, + goon_speak_skelly_sound, + // xeno_speak_sound // Does not exist on virgo + ) + ) + +/proc/get_talk_sound(var/voice_sound) + if(!voice_sound) + return talk_sound_map[1] + return talk_sound_map[2][voice_sound] diff --git a/code/modules/client/preference_setup/vore/02_size.dm b/code/modules/client/preference_setup/vore/02_size.dm index 26cfdc197b..447b329837 100644 --- a/code/modules/client/preference_setup/vore/02_size.dm +++ b/code/modules/client/preference_setup/vore/02_size.dm @@ -68,35 +68,7 @@ if(!pref.voice_sound) character.voice_sounds_list = talk_sound else - switch(pref.voice_sound) - if("beep-boop") - character.voice_sounds_list = talk_sound - if("goon speak 1") - character.voice_sounds_list = goon_speak_one_sound - if("goon speak 2") - character.voice_sounds_list = goon_speak_two_sound - if("goon speak 3") - character.voice_sounds_list = goon_speak_three_sound - if("goon speak 4") - character.voice_sounds_list = goon_speak_four_sound - if("goon speak blub") - character.voice_sounds_list = goon_speak_blub_sound - if("goon speak bottalk") - character.voice_sounds_list = goon_speak_bottalk_sound - if("goon speak buwoo") - character.voice_sounds_list = goon_speak_buwoo_sound - if("goon speak cow") - character.voice_sounds_list = goon_speak_cow_sound - if("goon speak lizard") - character.voice_sounds_list = goon_speak_lizard_sound - if("goon speak pug") - character.voice_sounds_list = goon_speak_pug_sound - if("goon speak pugg") - character.voice_sounds_list = goon_speak_pugg_sound - if("goon speak roach") - character.voice_sounds_list = goon_speak_roach_sound - if("goon speak skelly") - character.voice_sounds_list = goon_speak_skelly_sound + character.voice_sounds_list = get_talk_sound(pref.voice_sound) character.custom_speech_bubble = pref.custom_speech_bubble /datum/category_item/player_setup_item/vore/size/content(var/mob/user) diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 3711feed93..9894fea4a8 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -746,36 +746,7 @@ var/list/preferences_datums = list() if(!voice_sound) character.voice_sounds_list = talk_sound else - switch(voice_sound) - if("beep-boop") - character.voice_sounds_list = talk_sound - if("goon speak 1") - character.voice_sounds_list = goon_speak_one_sound - if("goon speak 2") - character.voice_sounds_list = goon_speak_two_sound - if("goon speak 3") - character.voice_sounds_list = goon_speak_three_sound - if("goon speak 4") - character.voice_sounds_list = goon_speak_four_sound - if("goon speak blub") - character.voice_sounds_list = goon_speak_blub_sound - if("goon speak bottalk") - character.voice_sounds_list = goon_speak_bottalk_sound - if("goon speak buwoo") - character.voice_sounds_list = goon_speak_buwoo_sound - if("goon speak cow") - character.voice_sounds_list = goon_speak_cow_sound - if("goon speak lizard") - character.voice_sounds_list = goon_speak_lizard_sound - if("goon speak pug") - character.voice_sounds_list = goon_speak_pug_sound - if("goon speak pugg") - character.voice_sounds_list = goon_speak_pugg_sound - if("goon speak roach") - character.voice_sounds_list = goon_speak_roach_sound - if("goon speak skelly") - character.voice_sounds_list = goon_speak_skelly_sound - //character.voice_sounds_list = get_talk_sound(voice_sound) + character.voice_sounds_list = get_talk_sound(voice_sound) character.species?.blood_color = blood_color diff --git a/code/modules/mob/living/carbon/human/species/station/protean_vr/protean_blob.dm b/code/modules/mob/living/carbon/human/species/station/protean_vr/protean_blob.dm index ac80b13b8a..4105077311 100644 --- a/code/modules/mob/living/carbon/human/species/station/protean_vr/protean_blob.dm +++ b/code/modules/mob/living/carbon/human/species/station/protean_vr/protean_blob.dm @@ -9,7 +9,7 @@ icon_rest = "puddle0-eyes" icon_dead = "puddle0-eyes" - faction = "neutral" + faction = FACTION_NEUTRAL maxHealth = 200 health = 200 say_list_type = /datum/say_list/protean_blob diff --git a/code/modules/mob/living/living_vr.dm b/code/modules/mob/living/living_vr.dm index 82850fea56..661ee9215e 100644 --- a/code/modules/mob/living/living_vr.dm +++ b/code/modules/mob/living/living_vr.dm @@ -140,50 +140,8 @@ set desc = "Sets your voice style!" set category = "OOC" - var/list/possible_voice_types = list( - "beep-boop", - "goon speak 1", - "goon speak 2", - "goon speak 3", - "goon speak 4", - "goon speak blub", - "goon speak bottalk", - "goon speak buwoo", - "goon speak cow", - "goon speak lizard", - "goon speak pug", - "goon speak pugg", - "goon speak roach", - "goon speak skelly") + var/list/possible_voice_types = get_talk_sound() var/choice = tgui_input_list(usr, "Which set of sounds would you like to use for your character's speech sounds?", "Voice Sounds", possible_voice_types) if(!choice) voice_sounds_list = talk_sound - switch(choice) - if("beep-boop") - voice_sounds_list = talk_sound - if("goon speak 1") - voice_sounds_list = goon_speak_one_sound - if("goon speak 2") - voice_sounds_list = goon_speak_two_sound - if("goon speak 3") - voice_sounds_list = goon_speak_three_sound - if("goon speak 4") - voice_sounds_list = goon_speak_four_sound - if("goon speak blub") - voice_sounds_list = goon_speak_blub_sound - if("goon speak bottalk") - voice_sounds_list = goon_speak_bottalk_sound - if("goon speak buwoo") - voice_sounds_list = goon_speak_buwoo_sound - if("goon speak cow") - voice_sounds_list = goon_speak_cow_sound - if("goon speak lizard") - voice_sounds_list = goon_speak_lizard_sound - if("goon speak pug") - voice_sounds_list = goon_speak_pug_sound - if("goon speak pugg") - voice_sounds_list = goon_speak_pugg_sound - if("goon speak roach") - voice_sounds_list = goon_speak_roach_sound - if("goon speak skelly") - voice_sounds_list = goon_speak_skelly_sound + voice_sounds_list = get_talk_sound(choice) diff --git a/code/modules/mob/living/login.dm b/code/modules/mob/living/login.dm index 94819c56c9..ab322eb9bc 100644 --- a/code/modules/mob/living/login.dm +++ b/code/modules/mob/living/login.dm @@ -29,35 +29,7 @@ if(!voice_sounds_list.len || !voice_sounds_list) if(client.prefs.voice_sound) var/prefsound = client.prefs.voice_sound - switch(prefsound) - if("beep-boop") - voice_sounds_list = talk_sound - if("goon speak 1") - voice_sounds_list = goon_speak_one_sound - if("goon speak 2") - voice_sounds_list = goon_speak_two_sound - if("goon speak 3") - voice_sounds_list = goon_speak_three_sound - if("goon speak 4") - voice_sounds_list = goon_speak_four_sound - if("goon speak blub") - voice_sounds_list = goon_speak_blub_sound - if("goon speak bottalk") - voice_sounds_list = goon_speak_bottalk_sound - if("goon speak buwoo") - voice_sounds_list = goon_speak_buwoo_sound - if("goon speak cow") - voice_sounds_list = goon_speak_cow_sound - if("goon speak lizard") - voice_sounds_list = goon_speak_lizard_sound - if("goon speak pug") - voice_sounds_list = goon_speak_pug_sound - if("goon speak pugg") - voice_sounds_list = goon_speak_pugg_sound - if("goon speak roach") - voice_sounds_list = goon_speak_roach_sound - if("goon speak skelly") - voice_sounds_list = goon_speak_skelly_sound + voice_sounds_list = get_talk_sound(prefsound) else voice_sounds_list = talk_sound //VOREStation Add End