Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add: [bounty] Voice update #6326

Closed
wants to merge 32 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
02328c7
ладно похуй уже
Pelmenik123 Dec 1, 2024
1c44ae7
микрофикс
Pelmenik123 Dec 8, 2024
a18ef9f
умер от кринжа
Pelmenik123 Dec 8, 2024
e64f2c7
костыльный фикс
Pelmenik123 Dec 8, 2024
6116f77
уу бляя
Pelmenik123 Jan 6, 2025
494e2d7
Merge branch 'master220' into VOICE-UPDATE
Pelmenik123 Jan 6, 2025
c4a3473
буэээ
Pelmenik123 Jan 7, 2025
e8345a3
Merge branch 'VOICE-UPDATE' of https://github.com/Pelmenik123/Pelmen-…
Pelmenik123 Jan 7, 2025
a39ddcd
bugfix
Pelmenik123 Jan 7, 2025
9b42ae5
nanofix
Pelmenik123 Jan 7, 2025
ae87b01
пендосия апдейт
Pelmenik123 Jan 8, 2025
6cd72b2
ух бля, ложка компоненты апдейт
Pelmenik123 Jan 12, 2025
6848e9e
ложка вантуз апдейт
Pelmenik123 Jan 12, 2025
e0969e5
фпмпмфпмф
Pelmenik123 Jan 12, 2025
157f632
нанотрахен
Pelmenik123 Jan 12, 2025
3536689
ДА КАК ВЫ
Pelmenik123 Jan 12, 2025
fa4acca
уэээ
Pelmenik123 Jan 12, 2025
7908280
уэээ сбэу
Pelmenik123 Jan 12, 2025
a357cc0
я хочу пиццу
Pelmenik123 Jan 13, 2025
a5503e5
GET OUT
Pelmenik123 Jan 13, 2025
6f8c836
бобр курва
Pelmenik123 Jan 13, 2025
2aea791
ыфвыфвыф
Pelmenik123 Jan 13, 2025
64516f4
суки
Pelmenik123 Jan 14, 2025
e8082ea
change comment back
Den109G Jan 14, 2025
caf3822
cultist
Den109G Jan 14, 2025
c14ac8a
апдейте форматирование
Pelmenik123 Jan 14, 2025
3a1ee78
adsfa
Pelmenik123 Jan 14, 2025
0d7156b
very nice
Pelmenik123 Jan 14, 2025
74a2fff
Update code/datums/voice.dm
Pelmenik123 Jan 15, 2025
bfa77b1
фмпмфппмфпмф апдейте
Pelmenik123 Jan 15, 2025
6195c0f
я ебал в сраку
Pelmenik123 Jan 15, 2025
4c6f42b
Merge branch 'master220' into VOICE-UPDATE
Pelmenik123 Jan 16, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions code/__DEFINES/dcs/signals.dm
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,15 @@
#define COMSIG_ATOM_NO_LONGER_PULLED "movable_no_longer_pulled"
///signal sent out by an atom when it is no longer pulling something : (atom/pulling)
#define COMSIG_ATOM_NO_LONGER_PULLING "movable_no_longer_pulling"
//signal for mass roundstart store voice (very english)
#define COMSIG_SPECIAL_MASS_STORE_VOICE "store_voice"
#define COMSIG_DATACORE_VOICE_COLLEAGUE_INJECT "manifest_injection"
#define COMSIG_RENAME_VOICE_INJECT "rename_inject"
#define COMSIG_VOICE_UPDATE "voice_update"
#define COMSIG_GET_VOICE_GENDER "get_voice_gender"
#define COMSIG_TRY_RECOLLECT_VOICE "try_recollect_voice"
#define COMSIG_CAN_REMEMBER_VOICE "can_rem_voice"
#define COMSIG_GET_MANIFEST_KWON_VOICE "get_manigest_voice"

///from base of atom/attackby(): (/obj/item, /mob/living, params)
#define COMSIG_PARENT_ATTACKBY "atom_attackby"
Expand Down Expand Up @@ -1111,7 +1120,7 @@
///(obj/item/insertion_candidate, mob/user, silent) - returns bool
#define COMSIG_TRY_STORAGE_CAN_INSERT "storage_can_equip"

// /datum/component/two_handed signals
// datum/component/two_handed signals

///from base of datum/component/two_handed/proc/wield(mob/living/carbon/user): (/mob/user)
#define COMSIG_TWOHANDED_WIELD "twohanded_wield"
Expand Down Expand Up @@ -1152,7 +1161,7 @@
#define OBJECTIVE_VALID_TARGET (1<<0)
#define OBJECTIVE_INVALID_TARGET (1<<1)

// /datum/component/bluespace_rift_scanner signals
// datum/component/bluespace_rift_scanner signals
/// from scanner's `process()` : (seconds, emagged)
#define COMSIG_SCANNING_RIFTS "scanning_rifts"
/// No rifts within the scanner's range
Expand All @@ -1164,7 +1173,7 @@
/// There are no servers available
#define COMPONENT_SCANNED_NO_SERVERS (1<<3)

// /datum/component/overlay_lighting signals, (for-future-backporting)
// datum/component/overlay_lighting signals, (for-future-backporting)
///from base of atom/CheckParts(): (atom/movable/new_craft) - The atom has just been used in a crafting recipe and has been moved inside new_craft.
#define COMSIG_ATOM_USED_IN_CRAFT "atom_used_in_craft"

Expand Down
4 changes: 4 additions & 0 deletions code/__DEFINES/is_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@

#define isitem(A) (istype(A, /obj/item))

#define isidcard(A) (istype(A, /obj/item/card/id))

#define iswallet(A) (istype(A, /obj/item/storage/wallet))

#define isstack(A) (istype(A, /obj/item/stack))

#define isstorage(A) (istype(A, /obj/item/storage))
Expand Down
2 changes: 2 additions & 0 deletions code/__DEFINES/job.dm
Original file line number Diff line number Diff line change
Expand Up @@ -149,3 +149,5 @@
#define TAIPAN_HUD_COMMS 7
#define TAIPAN_HUD_RD 8
#define TAIPAN_HUD_CYBORG 9

#define STATION_DEPARTMENTS list("Command", "Medical", "Engineering", "Science", "Security", "Cargo", "Support", "Civilian")
2 changes: 1 addition & 1 deletion code/_onclick/hud/plane_master/render_plate.dm
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
/atom/movable/screen/plane_master/rendering_plate/master/hide_from(mob/oldmob)
. = ..()
if(offset == 0)
return
return
var/datum/hud/hud = home.our_hud
if(hud)
UnregisterSignal(hud, COMSIG_HUD_OFFSET_CHANGED, PROC_REF(on_offset_change))
Expand Down
2 changes: 1 addition & 1 deletion code/controllers/subsystem/capitalism.dm
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ SUBSYSTEM_DEF(capitalism)
create_station_account()

if(GLOB.department_accounts.len == 0)
for(var/department in GLOB.station_departments)
for(var/department in STATION_DEPARTMENTS)
create_department_account(department)

/datum/controller/subsystem/capitalism/proc/salary_account_init()
Expand Down
15 changes: 14 additions & 1 deletion code/datums/datacore.dm
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@

GLOBAL_LIST_EMPTY(capitalist_manifest)

/datum/datacore
var/list/medical = list()
var/list/general = list()
Expand Down Expand Up @@ -111,6 +114,7 @@ GLOBAL_LIST_EMPTY(PDA_Manifest)
/datum/datacore/proc/manifest()
for(var/mob/living/carbon/human/H in GLOB.player_list)
manifest_inject(H)
SEND_GLOBAL_SIGNAL(COMSIG_DATACORE_VOICE_COLLEAGUE_INJECT, GLOB.capitalist_manifest)
Pelmenik123 marked this conversation as resolved.
Show resolved Hide resolved

/datum/datacore/proc/manifest_modify(name, rank, assignment)
if(GLOB.PDA_Manifest.len)
Expand Down Expand Up @@ -142,15 +146,24 @@ GLOBAL_VAR_INIT(record_id_num, 1001)
assignment = H.job
else
assignment = "Unassigned"

var/id = num2hex(GLOB.record_id_num++, 6)
H.update_voice()
var/prom_voice = H.voice_name
var/datum/job/prom_job = SSjobs.GetJob(H.job)

for(var/dep_flag in prom_job.colleagues_department)
if(!isnull(GLOB.capitalist_manifest?[dep_flag]))
GLOB.capitalist_manifest[dep_flag][prom_voice] = H.real_name
else
GLOB.capitalist_manifest[dep_flag] = list((prom_voice) = (H.real_name))

//General Record
var/datum/data/record/G = new()
G.fields["id"] = id
G.fields["name"] = H.real_name
G.fields["real_rank"] = H.mind.assigned_role
G.fields["voice"] = H.GetVoice()
G.fields["rank"] = assignment
G.fields["age"] = H.age
G.fields["fingerprint"] = md5(H.dna.uni_identity)
Expand Down
3 changes: 2 additions & 1 deletion code/datums/mind.dm
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@

var/assigned_role //assigned role is what job you're assigned to when you join the station.
var/playtime_role //if set, overrides your assigned_role for the purpose of playtime awards. Set by IDcomputer when your ID is changed.
var/special_role //special roles are typically reserved for antags or roles like ERT. If you want to avoid a character being automatically announced by the AI, on arrival (becuase they're an off station character or something); ensure that special_role and assigned_role are equal.
var/special_role //special roles are typically reserved for antags or roles like ETP. If you want to avoid a character being automatically announced by the AI, on arrival (becuase they're an off station character or something); ensure that special_role and assigned_role are equal.
var/special_role_meta_know = FALSE
var/offstation_role = FALSE //set to true for ERT, deathsquad, abductors, etc, that can go from and to z2 at will and shouldn't be antag targets
var/list/restricted_roles = list()

Expand Down
193 changes: 193 additions & 0 deletions code/datums/voice.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
#define GENDER_NAME_UNKNOWN list(MALE = "Неизвестный", FEMALE = "Неизвестная", NEUTER = "Неизвестное", PLURAL = "Неизвестные")
#define MANIFEST_UNKNOWNS list("Неизвестный", "Неизвестная", "Неизвестное", "Неизвестные")
//Voice cumponent
/datum/component/voice_model
var/mob/host = null
var/tts_seed_string = "Arthas"
var/voice_gender = MALE

var/list/known_voices = list()
var/list/known_faces = list()

/datum/component/voice_model/Initialize()
if(!ismob(parent))
return COMPONENT_INCOMPATIBLE //GET OUT

var/mob/owner_voice = parent
host = owner_voice
voice_gender = owner_voice.gender
known_voices[owner_voice.GetVoice()] = owner_voice.name
tts_seed_string = owner_voice.tts_seed

/datum/component/voice_model/RegisterWithParent()
RegisterSignal(SSdcs, COMSIG_SPECIAL_MASS_STORE_VOICE, PROC_REF(special_mass_add_voice))
RegisterSignal(SSdcs, COMSIG_DATACORE_VOICE_COLLEAGUE_INJECT, PROC_REF(special_mass_add_voice))
RegisterSignal(SSdcs, COMSIG_RENAME_VOICE_INJECT, PROC_REF(special_mass_add_voice))

RegisterSignal(parent, COMSIG_MOB_RUN_EXAMINATE, PROC_REF(try_store))
RegisterSignal(parent, COMSIG_VOICE_UPDATE, PROC_REF(voice_update))
RegisterSignal(parent, COMSIG_GET_VOICE_GENDER, PROC_REF(get_voice_gender))
RegisterSignal(parent, COMSIG_TRY_RECOLLECT_VOICE, PROC_REF(try_recollect_voice))
RegisterSignal(parent, COMSIG_CAN_REMEMBER_VOICE, PROC_REF(can_remember_voice))
RegisterSignal(parent, COMSIG_GET_MANIFEST_KWON_VOICE, PROC_REF(get_manifest_know_voice))


/datum/component/voice_model/UnregisterFromParent()
UnregisterSignal(SSdcs, COMSIG_SPECIAL_MASS_STORE_VOICE)
UnregisterSignal(SSdcs, COMSIG_DATACORE_VOICE_COLLEAGUE_INJECT)
UnregisterSignal(SSdcs, COMSIG_RENAME_VOICE_INJECT)
UnregisterSignal(parent, COMSIG_MOB_RUN_EXAMINATE)
UnregisterSignal(parent, COMSIG_VOICE_UPDATE)
UnregisterSignal(parent, COMSIG_TRY_RECOLLECT_VOICE)
UnregisterSignal(parent, COMSIG_GET_VOICE_GENDER)
UnregisterSignal(parent, COMSIG_CAN_REMEMBER_VOICE)
UnregisterSignal(parent, COMSIG_GET_MANIFEST_KWON_VOICE)

/datum/component/voice_model/proc/special_mass_add_voice(source, list/list_voice)
SIGNAL_HANDLER
UnregisterSignal(SSdcs, COMSIG_DATACORE_VOICE_COLLEAGUE_INJECT)
var/datum/job/prom_job = SSjobs.GetJob(host.job)
if(prom_job)
var/list/prom_data = list_voice?[prom_job.department]

if(prom_data)
LAZYOR(known_voices, prom_data)

/datum/component/voice_model/proc/voice_update(mob/source)
SIGNAL_HANDLER
voice_gender = host.gender
tts_seed_string = host.tts_seed

/* Not used
/datum/voice_model/proc/CopyInVoice(datum/voice_model/voice_to_copy)
tts_seed_string = voice_to_copy.tts_seed_string
voice_gender = voice_to_copy.voice_gender
voice_name = voice_to_copy.voice_name

/datum/voice_model/proc/FullCopyInVoice(datum/voice_model/voice_to_copy)
CopyInVoice(voice_to_copy)
real_voice_name = voice_to_copy.real_voice_name
famous_voices = voice_to_copy.famous_voices
*/

/datum/component/voice_model/proc/get_manifest_know_voice(mob/source, returned)
SIGNAL_HANDLER
*returned = "IDENTIFICATION ERROR"
for(var/datum/data/record/t in GLOB.data_core.general)
if(t)
if(t.fields["voice"] == host.voice_name)
*returned = t.fields["name"]
break

/* Not used
/datum/component/voice_model/proc/GetManifestKnowFace(mob/face_target)
for(var/datum/data/record/t in GLOB.data_core.general)
if(t)
if(t.fields["name"] == face_target.name)
return t.fields["name"]
return "IDENTIFICATION FACE ERROR"
*/

/datum/component/voice_model/proc/get_voice_name(mob/source, name)
SIGNAL_HANDLER
*name = host.voice_name

/datum/component/voice_model/proc/get_voice_gender(mob/source, target_gender)
SIGNAL_HANDLER
*target_gender = voice_gender

/datum/component/voice_model/proc/try_store(mob/source, mob/target)
SIGNAL_HANDLER
if(target == source)
return FALSE
//if(target.voice_name in MANIFEST_UNKNOWNS)
// return FALSE

. = FALSE
if(!ishuman(target))
return target.name
var/mob/living/carbon/human/target_H = target
var/obj/item/card/id/prov_wear_id = null

if(isidcard(target_H.wear_id))
prov_wear_id = target_H.wear_id
if(iswallet(target_H.wear_id))
var/obj/item/storage/wallet/prom = target_H.wear_id
prov_wear_id = prom.front_id

if(!((target_H.wear_mask?.flags_inv & HIDENAME) || (target_H.head?.flags_inv & HIDENAME)) && prov_wear_id)
//known_faces[target_H.name] = prov_wear_id.registered_name
known_voices[target.voice_name] = prov_wear_id.registered_name
. = TRUE
else if(prov_wear_id)
known_voices[target.voice_name] = prov_wear_id.registered_name
. = TRUE
return

/* Not used
/datum/component/voice_model/proc/TryRecollectFace(mob/target)
if(src == target.adv_voice)
return target.name
if(!ishuman(target)) //:Roflcat:
return target.name
var/mob/living/carbon/human/target_H = target

if(!((target_H.wear_mask?.flags_inv & HIDENAME) || (target_H.head?.flags_inv & HIDENAME)))
. = known_faces?[target_H.name]

if(.)
return

if((target_H.wear_suit?.flags_inv & HIDEJUMPSUIT) && (target_H.head?.flags_inv & HIDENAME))
. = get_gender_unknown_name(NEUTER)
else
. = get_gender_unknown_name(target_H.gender)
return
*/

//For hear
/datum/component/voice_model/proc/try_recollect_voice(mob/source, mob/target, returned_name)
SIGNAL_HANDLER
var/target_gender = NEUTER
SEND_SIGNAL(target, COMSIG_GET_VOICE_GENDER, &target_gender)
*returned_name = get_gender_unknown_name(target_gender)

if(!ishuman(host))
*returned_name = target.name
return
if(host.mind.special_role_meta_know && ((target.mind.special_role) == (host.mind.special_role)))
*returned_name = target.name
return

if(host == target)
*returned_name = target.name
return
if(!ishuman(target))
*returned_name = target.name
return
. = known_voices?[target.voice_name]
if(.)
*returned_name = .

/datum/component/voice_model/proc/can_remember_voice(mob/source, mob/target, returned_param)
SIGNAL_HANDLER
if(known_voices?[target.voice_name])
*returned_param = TRUE
else
*returned_param = FALSE

//HELPERS
/proc/gen_departament_voice_tree(mob/target, list/departments)
var/list/result = list()
for(var/dep_flag in departments)
result[dep_flag] = list((target.voice_name) = (target.name))

return result

/proc/get_gender_unknown_name(gender_string)
var/result = (GENDER_NAME_UNKNOWN)?[gender_string]
if(result)
return result
return "Неизвестный"

#undef GENDER_NAME_UNKNOWN
5 changes: 5 additions & 0 deletions code/game/atoms.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1706,6 +1706,11 @@ GLOBAL_LIST_EMPTY(blood_splatter_icons)
/atom/proc/GetTTSVoice()
return tts_seed

/mob/proc/update_voice()
voice_name = GetVoice()
tts_seed = GetTTSVoice()
SEND_SIGNAL(src, COMSIG_VOICE_UPDATE)

/// Passes Stat Browser Panel clicks to the game and calls client click on an atom
/atom/Topic(href, list/href_list)
. = ..()
Expand Down
1 change: 1 addition & 0 deletions code/game/gamemodes/clockwork/clockwork.dm
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ GLOBAL_LIST_EMPTY(all_clockers)
clockwork_cult += clock_mind
clock_mind.current.faction |= "clockwork_cult"
clock_mind.special_role = SPECIAL_ROLE_CLOCKER
clock_mind.special_role_meta_know = TRUE

if(clock_mind.assigned_role == JOB_TITLE_CLOWN)
to_chat(clock_mind.current, "<span class='clockitalic'>A dark power has allowed you to overcome your clownish nature, letting you wield weapons without harming yourself.</span>")
Expand Down
1 change: 1 addition & 0 deletions code/game/gamemodes/cult/cult.dm
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ GLOBAL_LIST_EMPTY(all_cults)
cult += cult_mind
cult_mind.current.faction |= "cult"
cult_mind.special_role = SPECIAL_ROLE_CULTIST
cult_mind.special_role_meta_know = TRUE
ADD_TRAIT(cult_mind.current, TRAIT_HEALS_FROM_CULT_PYLONS, CULT_TRAIT)

if(cult_mind.assigned_role == JOB_TITLE_CLOWN)
Expand Down
5 changes: 2 additions & 3 deletions code/game/gamemodes/game_mode.dm
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@

/**
* Everyone should now be on the station and have their normal gear. This is the place to give the special roles extra things.
*/
*/
/datum/game_mode/proc/post_setup()

spawn(ROUNDSTART_LOGOUT_REPORT_TIME)
display_roundstart_logout_report()


INVOKE_ASYNC(src, PROC_REF(set_mode_in_db)) // Async query, dont bother slowing roundstart

SScargo_quests.roll_start_quests()
Expand All @@ -99,7 +99,6 @@
GLOB.start_state.count()
return TRUE


/datum/game_mode/proc/set_mode_in_db() // I wonder what this could do guessing by the name
if(SSticker?.mode && SSdbcore.IsConnected())
var/datum/db_query/query_round_game_mode = SSdbcore.NewQuery("UPDATE round SET game_mode=:gm WHERE id=:rid", list(
Expand Down
3 changes: 3 additions & 0 deletions code/game/jobs/job/engineering.dm
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
min_start_money = 400
max_start_money = 700

default_dep = FALSE
colleagues_department= STATION_DEPARTMENTS

/datum/outfit/job/chief_engineer
name = "Chief Engineer"
jobtype = /datum/job/chief_engineer
Expand Down
Loading
Loading