Skip to content

Commit

Permalink
Merge branch 'forest/pred/voiceline' into forest/pred/HOLDER
Browse files Browse the repository at this point in the history
  • Loading branch information
realforest2001 committed Jul 16, 2023
2 parents 545e5bd + b637531 commit 442019a
Show file tree
Hide file tree
Showing 15 changed files with 387 additions and 166 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@
#define JOE_EMOTE_CATEGORY_WARNING "Warning"
#define JOE_EMOTE_CATEGORY_QUESTION "Question"
#define JOE_EMOTE_CATEGORY_NOTICE "Notice"

#define YAUTJA_EMOTE_CATEGORY_FAKESOUND "Fake Sound"
#define YAUTJA_EMOTE_CATEGORY_VOICE "Voice Synthesizer"
#define YAUTJA_EMOTE_CATEGORY_SPECIES "Yautja"
145 changes: 0 additions & 145 deletions code/modules/mob/living/carbon/human/species/emote-yautja.dm

This file was deleted.

2 changes: 2 additions & 0 deletions code/modules/mob/living/carbon/human/species/species.dm
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@

/datum/species/proc/larva_impregnated(obj/item/alien_embryo/embryo)
return
/datum/species/proc/open_emote_panel()
return

/datum/species/proc/handle_npc(mob/living/carbon/human/H)
set waitfor = FALSE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
species_type_allowed_typecache = list(/datum/species/synthetic/colonial/working_joe)
keybind_category = CATEGORY_SYNTH_EMOTE
volume = 75
/// A general category for the emote, for use in the WJ emote panel. See [code/__DEFINES/wj_emotes.dm] for categories.
/// A general category for the emote, for use in the WJ emote panel. See [code/__DEFINES/emote_panels.dm] for categories.
var/category = ""
/// Override text for the emote to be displayed in the WJ emote panel
var/override_say = ""
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@


/// Open the WJ's emote panel, which allows them to use voicelines
/datum/species/synthetic/colonial/working_joe/proc/open_emote_panel()
/datum/species/synthetic/colonial/working_joe/open_emote_panel()
var/datum/joe_emote_panel/ui = new(usr)
ui.ui_interact(usr)

Expand Down
10 changes: 10 additions & 0 deletions code/modules/mob/living/carbon/human/species/yautja/_emote.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/datum/emote/living/carbon/human/yautja
species_type_allowed_typecache = list(/datum/species/yautja)
keybind_category = CATEGORY_YAUTJA_EMOTE
emote_type = EMOTE_AUDIBLE
/// A general category for the emote, for use in the Yautja emote panel. See [code/__DEFINES/emote_panels.dm] for categories.
var/category = ""
/// Override text for the emote to be displayed in the Yautja emote panel
var/override_say = ""
/// Override for being in panel or not
var/no_panel = FALSE
Original file line number Diff line number Diff line change
Expand Up @@ -180,16 +180,16 @@
limb.max_damage = 35
limb.time_to_knit = -1

/datum/species/yautja/handle_post_spawn(mob/living/carbon/human/H)
GLOB.alive_human_list -= H
H.universal_understand = 1
/datum/species/yautja/handle_post_spawn(mob/living/carbon/human/hunter)
GLOB.alive_human_list -= hunter
hunter.universal_understand = 1

H.blood_type = "Y*"
H.h_style = "Standard"
hunter.blood_type = "Y*"
hunter.h_style = "Standard"
#ifndef UNIT_TESTS // Since this is a hard ref, we shouldn't confuse create_and_destroy
GLOB.yautja_mob_list += H
GLOB.yautja_mob_list += hunter
#endif
for(var/obj/limb/limb in H.limbs)
for(var/obj/limb/limb in hunter.limbs)
switch(limb.name)
if("groin","chest")
limb.min_broken_damage = 145
Expand All @@ -208,7 +208,8 @@
limb.max_damage = 150
limb.time_to_knit = 600 // 1 minute to self heal bone break, time is in tenths of a second

H.set_languages(list(LANGUAGE_YAUTJA))
hunter.set_languages(list(LANGUAGE_YAUTJA))
give_action(hunter, /datum/action/yautja_emote_panel)
return ..()

/datum/species/yautja/get_hairstyle(style)
Expand All @@ -220,3 +221,97 @@

/datum/species/yautja/handle_paygrades()
return ""

/// Open the Yautja emote panel, which allows them to use their emotes easier.
/datum/species/yautja/open_emote_panel()
var/datum/yautja_emote_panel/ui = new(usr)
ui.ui_interact(usr)

/datum/action/yautja_emote_panel
name = "Open Emote Panel"
action_icon_state = "looc_toggle"

/datum/action/yautja_emote_panel/can_use_action()
. = ..()
if(!.)
return FALSE

if(!isyautja(owner))
return FALSE

return TRUE

/datum/action/yautja_emote_panel/action_activate()
if(!can_use_action())
return

var/mob/living/carbon/human/human_owner = owner
var/datum/species/yautja/yautja_species = human_owner.species
yautja_species.open_emote_panel()

/datum/yautja_emote_panel
/// Static dict ("category" : (emotes)) of every yautja emote typepath
var/static/list/yautja_emotes
/// Static list of categories
var/static/list/yautja_categories = list()

/datum/yautja_emote_panel/New()
if(!length(yautja_emotes))
var/list/emotes_to_add = list()
for(var/datum/emote/living/carbon/human/yautja/emote as anything in subtypesof(/datum/emote/living/carbon/human/yautja))
if(!initial(emote.key))
continue

if(!(initial(emote.category) in yautja_categories))
yautja_categories += initial(emote.category)
emotes_to_add += emote
/// I hate this method, but anything else I tried just seemed to make the whole UI blank.
emotes_to_add -= /datum/emote/living/carbon/human/yautja/species_sound/loudroar
yautja_emotes = emotes_to_add

/datum/yautja_emote_panel/proc/ui_interact(mob/user, datum/tgui/ui)
ui = SStgui.try_update_ui(user, src, ui)
if(!ui)
ui = new(user, src, "YautjaEmotes")
ui.open()

/datum/yautja_emote_panel/ui_state(mob/user)
return GLOB.conscious_state

/datum/yautja_emote_panel/ui_static_data(mob/user)
var/list/data = list()

data["categories"] = yautja_categories
data["emotes"] = list()

for(var/datum/emote/living/carbon/human/yautja/emote as anything in yautja_emotes)
data["emotes"] += list(list(
"id" = initial(emote.key),
"text" = (initial(emote.override_say) || initial(emote.say_message) || initial(emote.key)),
"category" = initial(emote.category),
"path" = "[emote]",
))

return data

/datum/yautja_emote_panel/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state)
. = ..()
if(.)
return

switch(action)
if("emote")
var/datum/emote/living/carbon/human/yautja/path
if(!params["emotePath"])
return FALSE

path = text2path(params["emotePath"])

if(!path)
return FALSE

if(!(path in subtypesof(/datum/emote/living/carbon/human/yautja)))
return FALSE

usr.emote(initial(path.key))
return TRUE
22 changes: 22 additions & 0 deletions code/modules/mob/living/carbon/human/species/yautja/fake_sounds.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/datum/emote/living/carbon/human/yautja/fake_sound
category = YAUTJA_EMOTE_CATEGORY_FAKESOUND

/datum/emote/living/carbon/human/yautja/fake_sound/aliengrowl
key = "aliengrowl"

/datum/emote/living/carbon/human/yautja/fake_sound/aliengrowl/get_sound(mob/living/user)
return pick('sound/voice/alien_growl1.ogg', 'sound/voice/alien_growl2.ogg')

/datum/emote/living/carbon/human/yautja/fake_sound/alienhelp
key = "alienhelp"

/datum/emote/living/carbon/human/yautja/fake_sound/alienhelp/get_sound(mob/living/user)
return pick('sound/voice/alien_help1.ogg', 'sound/voice/alien_help2.ogg')

/datum/emote/living/carbon/human/yautja/fake_sound/malescream
key = "malescream"
sound = "male_scream"

/datum/emote/living/carbon/human/yautja/fake_sound/femalescream
key = "femalescream"
sound = "female_scream"
50 changes: 50 additions & 0 deletions code/modules/mob/living/carbon/human/species/yautja/fake_voice.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/datum/emote/living/carbon/human/yautja/voice
category = YAUTJA_EMOTE_CATEGORY_VOICE

/datum/emote/living/carbon/human/yautja/voice/anytime
key = "anytime"
sound = 'sound/voice/pred_anytime.ogg'


/datum/emote/living/carbon/human/yautja/voice/helpme
key = "helpme"
sound = 'sound/voice/pred_helpme.ogg'
volume = 25


/datum/emote/living/carbon/human/yautja/voice/iseeyou
key = "iseeyou"
sound = 'sound/hallucinations/i_see_you2.ogg'


/datum/emote/living/carbon/human/yautja/voice/itsatrap
key = "itsatrap"
sound = 'sound/voice/pred_itsatrap.ogg'
volume = 25


/datum/emote/living/carbon/human/yautja/voice/overhere
key = "overhere"
sound = 'sound/voice/pred_overhere.ogg'
volume = 25


/datum/emote/living/carbon/human/yautja/voice/turnaround
key = "turnaround"
sound = 'sound/voice/pred_turnaround.ogg'
volume = 25


/datum/emote/living/carbon/human/yautja/voice/comeonout
key = "comeonout"
sound = 'sound/voice/pred_come_on_out.ogg'


/datum/emote/living/carbon/human/yautja/voice/overthere
key = "overthere"
sound = 'sound/voice/pred_over_there.ogg'


/datum/emote/living/carbon/human/yautja/voice/uglyfreak
key = "uglyfreak"
sound = 'sound/voice/pred_ugly_freak.ogg'
Loading

0 comments on commit 442019a

Please sign in to comment.