Skip to content

Commit

Permalink
TTS Component (#985)
Browse files Browse the repository at this point in the history
<!-- Пишите **НИЖЕ** заголовков и **ВЫШЕ** комментариев, иначе что то
может пойти не так. -->
<!-- Вы можете прочитать Contributing.MD, если хотите узнать больше. -->

## Что этот PR делает

<!-- Вкратце опишите изменения, которые вносите. -->
<!-- Опишите **все** изменения, так как противное может сказаться на
рассмотрении этого PR'а! -->
<!-- Если вы исправляете Issue, добавьте "Fixes #xxxx" (где xxxx - номер
Issue) где-нибудь в описании PR'а. Это автоматически закроет Issue после
принятия PR'а. -->

- Вынес tts_seed из под атома в отдельный компонент
- Теперь нужно выдавать tts_component, чтобы атом говорил с ТТС
- Добавлен в VV `Change TTS` для простоты смены ТТС сидов / добавления
ТТС компонента
- В большинстве случаев, ТТС работает через компонент. Исключение -
глобальные оповещения.

fixes #560

### Нужно
- [x] проверить работу с API
- [x] проверить на тестовом сервере
- [x] доработать больше... компонентности? Меня лично не до конца
устраивает текущая реализация, нужны идеи.
- [x] хранить трейты (например, силикон для роботизации голоса) в
компоненте и дать возможность передавать в ините
- [x] обновить выдачу компонента у заранее предзаписанных мобов

## Почему это хорошо для игры

<!-- Опишите, почему, по вашему, следует добавить эти изменения в игру.
-->

- Теперь всё может говорить, если захотеть

## Тестирование

<!-- Как вы тестировали свой PR, если делали это вовсе? -->

SILERO API ERROR

Список для теста:
- [x] Без спецификации, выдаётся случайный сид для ТТС компонента
- [x] Подтягивается сид с префов игрока 
- [x] Clone DNA - генокрад ворует компонент
- [x] Работоспособность TTS эксплорера

## Changelog

:cl:
add: В ViewVariables добавлен пункт `Change TTS`
add: Компонент tts_component, который позволяет выдать голос всем атомам
/:cl:

<!-- Оба :cl:'а должны быть на месте, что-бы чейнджлог работал! Вы
можете написать свой ник справа от первого :cl:, если хотите. Иначе
будет использован ваш ник на ГитХабе. -->
<!-- Вы можете использовать несколько записей с одинаковым префиксом
(Они используются только для иконки в игре) и удалить ненужные. Помните,
что чейнджлог должен быть понятен обычным игроком. -->
<!-- Если чейнджлог не влияет на игроков(например, это рефактор), вы
можете исключить всю секцию. -->
  • Loading branch information
larentoun authored Apr 2, 2024
1 parent 8b1f8df commit fe2fb04
Show file tree
Hide file tree
Showing 48 changed files with 696 additions and 440 deletions.
2 changes: 1 addition & 1 deletion code/modules/admin/verbs/gimmick_team.dm
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
if(is_syndicate)
SSticker.mode.traitors |= H.mind //Adds them to extra antag list

H.change_voice(H) // SS220 ADD
H.change_tts_seed(H) // SS220 ADDITION - TTS220

players_spawned++
if(players_spawned >= teamsize)
Expand Down
6 changes: 3 additions & 3 deletions code/modules/client/preference/character.dm
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@
"h_grad_colour" = h_grad_colour,
"h_grad_alpha" = h_grad_alpha,
"custom_emotes" = json_encode(custom_emotes),
"tts_seed" = tts_seed,
"tts_seed" = tts_seed, // SS220 EDIT ADDITION - TTS220
"ckey" = C.ckey,
"slot" = slot_number
))
Expand Down Expand Up @@ -381,7 +381,7 @@
"h_grad_colour" = h_grad_colour,
"h_grad_alpha" = h_grad_alpha,
"custom_emotes" = json_encode(custom_emotes),
"tts_seed" = tts_seed
"tts_seed" = tts_seed // SS220 EDIT ADDITION - TTS220
))

if(!query.warn_execute())
Expand Down Expand Up @@ -469,7 +469,7 @@
var/custom_emotes_tmp = query.item[55]
physique = query.item[56]
height = query.item[57]
tts_seed = query.item[58]
tts_seed = query.item[58] // SS220 EDIT ADDITION - TTS220

//Sanitize
var/datum/species/SP = GLOB.all_species[species]
Expand Down
2 changes: 1 addition & 1 deletion code/modules/client/preference/link_processing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@
return
active_character.flavor_text = msg

// SS220 ADDITION START
// SS220 ADDITION START - TTS220
if("tts_seed")
var/datum/ui_module/tts_seeds_explorer/explorer = explorer_users[user]
if(!explorer)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/client/preference/preferences.dm
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts
else
dat += "<a href=\"byond://?_src_=prefs;preference=records;record=1\">Character Records</a><br>"

// SS220 ADDITION START
// SS220 ADDITION START - TTS220
if(GLOB.configuration.tts.tts_enabled)
dat += {"
<h2>Text-to-Speech</h2>
Expand Down
6 changes: 4 additions & 2 deletions code/modules/mob/new_player/new_player.dm
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,10 @@
ready = FALSE
return FALSE

if(!check_tts_seed_ready()) // SS220 ADDITION
// SS220 ADDITION START - TTS220
if(!check_tts_seed_ready())
return FALSE
// SS220 ADDITION END

ready = !ready
new_player_panel_proc()
Expand Down Expand Up @@ -227,7 +229,7 @@
to_chat(src, alert("You are currently not whitelisted to play [client.prefs.active_character.species]."))
return FALSE

if(!check_tts_seed_ready()) // SS220 ADDITION
if(!check_tts_seed_ready()) // SS220 ADDITION - TTS
return FALSE

LateChoices()
Expand Down
4 changes: 0 additions & 4 deletions modular_ss220/maps220/code/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,6 @@
icon_living = "snake"
icon_dead = "snake_dead"
speak_emote = list("hisses")
tts_seed = "Ladyvashj"
health = 20
maxHealth = 20
attacktext = "кусает"
Expand Down Expand Up @@ -514,7 +513,6 @@
stat_attack = UNCONSCIOUS
see_in_dark = 8
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE
tts_seed = "Anubarak"

/mob/living/simple_animal/hostile/abomination/super
desc = "Оскалившийся, страшный монстр. Этот кажется проворным."
Expand Down Expand Up @@ -589,7 +587,6 @@
speak = list("уааааааааа-хааууууууаааааа!", "ААААаааууАААУааХУААААА!!!", "уууууууухххх.... ххххх-ххьооооонкккхх....", "ХХХХУУАААООНККК!!!")
speak_emote = list("извивается", "корчится", "пульсирует", "бурлит", "расползается")
speak_chance = 10
tts_seed = "Kleiner"
maxHealth = 500
health = 500
pixel_x = -16
Expand Down Expand Up @@ -641,7 +638,6 @@
/obj/item/clothing/suit/imperium_monk,
/obj/effect/particle_effect/smoke/bad,
/obj/item/emerald_stone)
tts_seed = "Abaddon"

/mob/living/simple_animal/hostile/deadwizard/Shoot(atom/targeted_atom)
..()
Expand Down
1 change: 0 additions & 1 deletion modular_ss220/maps220/code/objects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,6 @@
/// How many shields we have protecting us
var/shield_count = 0
faction = list("xen")
tts_seed = "Vortiger"
gold_core_spawnable = NO_SPAWN
del_on_death = TRUE

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
/mob/living/simple_animal/hostile/retaliate/goat
tts_seed = "Muradin"

attacktext = "бодает"
death_sound = 'modular_ss220/mobs/sound/creatures/goat_death.ogg'

/mob/living/simple_animal/cow
tts_seed = "Cairne"

attacktext = "бодает"
death_sound = 'modular_ss220/mobs/sound/creatures/cow_death.ogg'
damaged_sound = list('modular_ss220/mobs/sound/creatures/cow_damaged.ogg')
Expand All @@ -15,7 +11,6 @@
/mob/living/simple_animal/chicken
name = "курица"
desc = "Гордая несушка. Яички должны быть хороши!"
tts_seed = "Windranger"
death_sound = 'modular_ss220/mobs/sound/creatures/chicken_death.ogg'
damaged_sound = list('modular_ss220/mobs/sound/creatures/chicken_damaged1.ogg', 'modular_ss220/mobs/sound/creatures/chicken_damaged2.ogg')
talk_sound = list('modular_ss220/mobs/sound/creatures/chicken_talk.ogg')
Expand All @@ -24,7 +19,6 @@
/mob/living/simple_animal/chick
name = "цыпленок"
desc = "Маленькая прелесть! Но пока что маловата..."
tts_seed = "Meepo"
attacktext = "клюёт"
death_sound = 'modular_ss220/mobs/sound/creatures/mouse_squeak.ogg'
holder_type = /obj/item/holder/chick
Expand All @@ -49,7 +43,6 @@
speak_emote = list("clucks","croons")
emote_hear = list("clucks")
emote_see = list("pecks at the ground","flaps its wings viciously")
tts_seed = "pantheon"
density = 0
speak_chance = 2
turns_per_move = 3
Expand Down Expand Up @@ -80,7 +73,6 @@

/mob/living/simple_animal/pig
name = "свинья"
tts_seed = "Anubarak"
attacktext = "лягает"
death_sound = 'modular_ss220/mobs/sound/creatures/pig_death.ogg'
talk_sound = list('modular_ss220/mobs/sound/creatures/pig_talk1.ogg', 'modular_ss220/mobs/sound/creatures/pig_talk2.ogg')
Expand Down Expand Up @@ -125,5 +117,4 @@
maxHealth = 20

/mob/living/simple_animal/seal
tts_seed = "Narrator"
death_sound = 'modular_ss220/mobs/sound/creatures/seal_death.ogg'
1 change: 0 additions & 1 deletion modular_ss220/mobs/code/simple_animal/friendly/frog.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
talk_sound = list('modular_ss220/mobs/sound/creatures/frog_talk1.ogg', 'modular_ss220/mobs/sound/creatures/frog_talk2.ogg')
damaged_sound = list('modular_ss220/mobs/sound/creatures/frog_damaged.ogg')
death_sound = 'modular_ss220/mobs/sound/creatures/frog_death.ogg'
tts_seed = "pantheon"
speak_chance = 1
turns_per_move = 5
see_in_dark = 10
Expand Down
2 changes: 0 additions & 2 deletions modular_ss220/mobs/code/simple_animal/friendly/hamster.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
animal_species = /mob/living/simple_animal/mouse/hamster
holder_type = /obj/item/holder/hamster
gold_core_spawnable = FRIENDLY_SPAWN
tts_seed = "Gyro"
maxHealth = 10
health = 10

Expand All @@ -23,7 +22,6 @@
name = "хомячок"
real_name = "хомячок"
desc = "Очень миленький! Какие у него пушистые щечки!"
tts_seed = "Meepo"
turns_per_move = 2
response_help = "полапал"
response_disarm = "аккуратно отодвинул"
Expand Down
1 change: 0 additions & 1 deletion modular_ss220/mobs/code/simple_animal/friendly/lizard.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/mob/living/simple_animal/lizard
tts_seed = "Ladyvashj"
death_sound = 'modular_ss220/mobs/sound/creatures/lizard_death.ogg'
holder_type = /obj/item/holder/lizard

Expand Down
2 changes: 0 additions & 2 deletions modular_ss220/mobs/code/simple_animal/friendly/moth.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
butcher_results = list(/obj/item/food/snacks/monstermeat/xenomeat = 1)
gold_core_spawnable = FRIENDLY_SPAWN
holder_type = /obj/item/holder/moth
tts_seed = "Tychus"

/mob/living/simple_animal/mothroach
name = "mothroach"
Expand Down Expand Up @@ -51,4 +50,3 @@
footstep_type = FOOTSTEP_MOB_BAREFOOT
butcher_results = list(/obj/item/food/snacks/monstermeat/xenomeat = 1)
holder_type = /obj/item/holder/mothroach
tts_seed = "Tychus"
9 changes: 0 additions & 9 deletions modular_ss220/mobs/code/simple_animal/friendly/mouse.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
damaged_sound = list('modular_ss220/mobs/sound/creatures/rat_wound.ogg')
blood_volume = BLOOD_VOLUME_SURVIVE
butcher_results = list(/obj/item/food/snacks/meat/mouse)
tts_seed = "Gyro"

/mob/living/simple_animal/mouse/Initialize(mapload)
. = ..()
Expand Down Expand Up @@ -70,14 +69,7 @@
// to_chat(src, "scream, squeak")
// playsound(src, damaged_sound, 40, 1)

/mob/living/simple_animal/mouse/white
tts_seed = "Meepo"

/mob/living/simple_animal/mouse/brown
tts_seed = "Clockwerk"

/mob/living/simple_animal/mouse/brown/Tom
tts_seed = "Arthas"
maxHealth = 10
health = 10

Expand All @@ -94,4 +86,3 @@
butcher_results = list(/obj/item/stack/sheet/metal = 1)
maxHealth = 20
health = 20
tts_seed = "Clockwerk"
1 change: 0 additions & 1 deletion modular_ss220/mobs/code/simple_animal/friendly/possum.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
speak_emote = list("Hsss", "Hisss")
emote_hear = list("Aaaaa!", "Ahhss!")
emote_see = list("shakes its head.", "chases its tail.", "shivers.")
tts_seed = "Clockwerk"
faction = list("neutral")
maxHealth = 30
health = 30
Expand Down
2 changes: 0 additions & 2 deletions modular_ss220/mobs/code/simple_animal/friendly/snail.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
icon_living = "snail"
icon_dead = "snail_dead"
speak = list("Uhh.", "Hurrr.")
tts_seed = "Ladyvashj"
health = 100
maxHealth = 100
speed = 10
Expand Down Expand Up @@ -68,7 +67,6 @@
icon_dead = "yeeslow_dead"
icon_resting = "yeeslow_scared"
speak = list("Uhh.", "Hurrr.")
tts_seed = "Ladyvashj"
health = 500
maxHealth = 500
speed = 20
Expand Down
10 changes: 0 additions & 10 deletions modular_ss220/mobs/code/simple_animal/hostile/alien.dm
Original file line number Diff line number Diff line change
@@ -1,12 +1,2 @@
/mob/living/simple_animal/hostile/alien
attacktext = "кромсает"
tts_seed = "Ladyvashj"

/mob/living/simple_animal/hostile/alien/queen
tts_seed = "Queen"

/mob/living/carbon/alien
tts_seed = "Ladyvashj"

/mob/living/carbon/alien/humanoid/queen
tts_seed = "Queen"
1 change: 0 additions & 1 deletion modular_ss220/mobs/code/simple_animal/hostile/lizard.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
speak_emote = list("growls", "roars")
emote_hear = list("rawrs","grumbles","grawls")
emote_see = list("stares ferociously", "stomps")
tts_seed = "Shaker"
speak_chance = 1
turns_per_move = 5
see_in_dark = 6
Expand Down
1 change: 0 additions & 1 deletion modular_ss220/mobs/code/simple_animal/hostile/snake.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@
attacktext = "кусает"
attack_sound = 'sound/weapons/bite.ogg'
death_sound = 'modular_ss220/mobs/sound/creatures/snake_death.ogg'
tts_seed = "Ladyvashj"
holder_type = /obj/item/holder/snake
40 changes: 0 additions & 40 deletions modular_ss220/mobs/code/simple_animal/hostile/spider.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,8 @@
response_help = "лапает"
response_disarm = "осторожно отталкивает"
friendly = "осторожно проводит лапками по"
tts_seed = "Anubarak"


// Terrors

/mob/living/simple_animal/hostile/poison/terror_spider
response_help = "лапает"
response_disarm = "осторожно отталкивает"
Expand All @@ -24,40 +21,3 @@
response_help = "лапает"
response_disarm = "осторожно отталкивает"
friendly = "осторожно проводит лапками по"
tts_seed = "Anubarak"

/mob/living/simple_animal/hostile/poison/terror_spider/mother
tts_seed = "Deathwhisper"

/mob/living/simple_animal/hostile/poison/terror_spider/queen/princess
tts_seed = "Lissandra"

/mob/living/simple_animal/hostile/poison/terror_spider/queen
tts_seed = "Anivia"

/mob/living/simple_animal/hostile/poison/terror_spider/queen/empress
tts_seed = "Queen"

/mob/living/simple_animal/hostile/poison/terror_spider/prince
tts_seed = "Alduin"

/mob/living/simple_animal/hostile/poison/terror_spider/red
tts_seed = "Chu"

/mob/living/simple_animal/hostile/poison/terror_spider/green
tts_seed = "Myra"

/mob/living/simple_animal/hostile/poison/terror_spider/gray
tts_seed = "Cassiopeia"

/mob/living/simple_animal/hostile/poison/terror_spider/brown
tts_seed = "Zuljin"

/mob/living/simple_animal/hostile/poison/terror_spider/purple
tts_seed = "Avozu"

/mob/living/simple_animal/hostile/poison/terror_spider/black
tts_seed = "Karastamper"

/mob/living/simple_animal/hostile/poison/terror_spider/white
tts_seed = "F_darkelf"
2 changes: 0 additions & 2 deletions modular_ss220/mobs/code/simple_animal/overrides.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
attacktext = "атакует"
attack_sound = null
friendly = "утыкается в" //If the mob does no damage with it's attack

tts_seed = "Angel"
var/list/damaged_sound = null // The sound played when player hits animal
var/list/talk_sound = null // The sound played when talk

Expand Down
2 changes: 0 additions & 2 deletions modular_ss220/mobs/code/simple_animal/pets/cat.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
mob_size = MOB_SIZE_LARGE // THICK!!!
//canmove = FALSE
butcher_results = list(/obj/item/food/snacks/meat = 8)
tts_seed = "Huntress"
maxHealth = 40 // Sooooo faaaat...
health = 40
speed = 10 // TOO FAT
Expand Down Expand Up @@ -89,7 +88,6 @@
icon_living = "floppa"
icon_dead = "floppa_dead"
icon_resting = "floppa_rest"
tts_seed = "Uther"
unique_pet = TRUE

/mob/living/simple_animal/pet/cat/fat/Iriska
Expand Down
Loading

0 comments on commit fe2fb04

Please sign in to comment.