Skip to content

Commit f022ccc

Browse files
flleeppyygrungussussCheffieGithub
authored
[Bounty][Port] Pronouns/body selector; OOC Pronouns (#2377)
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may not be viewable. --> ## About The Pull Request Makes Vanderlin more woke by porting the pronouns/body selector from Azure Peak, and OOC pronouns from Monkestation This is for a [bounty in the Monkestation Discord](https://canary.discord.com/channels/748354466335686736/1392272358731026473) by cocokailey > either a port or a remake of the azure peak body type selector , voice type selector and pronoun selector. > > A few caveats > > Kobolds must be locked to it/its > Only Kobolds and Halfkin will be allowed to use it/its > They/Them, She/Her and He/Him for all other races and Halfkin. > > Reward 5 dollah + 50 triumphs to be paid out on the 28th this month as thats when I get paid. The caveats have been followed and species datums now have an `allowed_pronouns` list Ports: - GeneralPantsuIsBadAtCoding/Azure-Peak#19 - Monkestation/Monkestation2.0#7036 There was also requested functionality for additional species specific body types to be added, but I do not sprite, so that will not be added in this PR, but the base for adding more body types are there. I ported OOC pronouns to compensate for the fact I cannot sprite. ## Why It's Good For The Game Bounty! also i don't play vanderlin so I don't know how or why this would be good for the game. but, uh, better character customization? ## Pre-Merge Checklist <!-- Don't bother filling these in while creating your Pull Request, just click the checkboxes after the Pull Request is opened and you are redirected to the page. --> - [x] You tested this on a local server. - [x] This code did not runtime during testing. - [x] You documented all of your changes. <!-- Neither the compiler nor workflow checks are perfect at detecting runtimes and errors. It is important to test your code/feature/fix locally. --> # Changelog - You can now change your character's pronouns and voice type. - - The available pronouns are: she/her, he/him, they/them, it/its - - - Only kobolds and half/hollow-kin can use it/its. Kobolds are forced to use it/its. - - The available voice types are: Masculine, Feminine, Androgynous - - - We do not have an androgynous voice pack, so we compensate by using the female voice pack, pitch multiplied by 0.92 to achieve a more androgynous tone. - Randomizing your character now prompts you if you really want to randomize, with the option of "Don't Ask Again This Round (Yes)" - You can now change your OOC pronouns via the verb `Set OOC Pronouns` - - Admins can ban users from setting ooc pronouns - Adds tooltips and conditional tooltips. - - Usage: `span_tooltip(tip, main_text)` - - Usage to show tooltip with condition: `conditional_tooltip(normal_text, tooltip_text, condition)` <img width="396" height="95" alt="image" src="https://github.com/user-attachments/assets/0c51d8f2-f52a-4d84-9510-5ce959e87969" /> <img width="208" height="206" alt="image" src="https://github.com/user-attachments/assets/0d1db857-3d2d-4a41-ac55-d94bbbc39cf9" /> --------- Co-authored-by: grungussuss <[email protected]> Co-authored-by: CheffieGithub <[email protected]>
1 parent e56e9c9 commit f022ccc

File tree

20 files changed

+480
-50
lines changed

20 files changed

+480
-50
lines changed

code/__DEFINES/chat/span.dm

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,16 @@
162162
#define span_love(str) ("<span class='love'>" + str + "</span>")
163163

164164
/* Complex Spans */
165-
// Ones where span_X isn't just the class
166-
165+
/// Ones where span_X isn't just the class
167166
#define span_admin_log(str) ("<span class='admin'><span class='prefix'>ADMIN LOG: </span><span class='message linkify'>" + str + "</span></span>")
167+
168+
/// Normal tooltip with underline and default styling
169+
#define span_tooltip(tip, main_text) ("<span data-tooltip=\"" + tip + "\" class=\"tooltip-trigger\">" + main_text + "</span>")
170+
171+
/// No italics, potentially different styling if 'tooltip-alt-trigger' has unique CSS rules
172+
#define span_tooltip_alt(tip, main_text) ("<span data-tooltip=\"" + tip + "\" class=\"tooltip-trigger tooltip-alt-trigger\">" + main_text + "</span>")
173+
174+
/// Helper which creates a chat message which may have a tooltip in some contexts, but not others.
175+
#define conditional_tooltip(normal_text, tooltip_text, condition) ((condition) ? (span_tooltip(tooltip_text, normal_text)) : (normal_text))
176+
/// No italics
177+
#define conditional_tooltip_alt(normal_text, tooltip_text, condition) ((condition) ? (span_tooltip_alt(tooltip_text, normal_text)) : (normal_text))

code/__DEFINES/preferences.dm

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@
8989
#define RANDOM_SPECIES "random_species"
9090
#define RANDOM_GENDER "random_gender"
9191
#define RANDOM_GENDER_ANTAG "random_gender_antag"
92+
#define RANDOM_PRONOUNS "random_pronouns"
93+
#define RANDOM_PRONOUNS_ANTAG "random_pronouns_antag"
94+
#define RANDOM_VOICETYPE "random_voicetype"
95+
#define RANDOM_VOICETYPE_ANTAG "random_voicetype_antag"
9296
#define RANDOM_AGE "random_age"
9397
#define RANDOM_AGE_ANTAG "random_age_antag"
9498
#define RANDOM_UNDERWEAR "random_underwear"
@@ -100,16 +104,18 @@
100104
// randomise_appearance_prefs() and randomize_human_appearance() proc flags
101105
#define RANDOMIZE_GENDER (1<<0)
102106
#define RANDOMIZE_SPECIES (1<<1)
103-
#define RANDOMIZE_NAME (1<<2)
104-
#define RANDOMIZE_AGE (1<<3)
105-
#define RANDOMIZE_UNDERWEAR (1<<4)
106-
#define RANDOMIZE_HAIRSTYLE (1<<5)
107-
#define RANDOMIZE_FACIAL_HAIRSTYLE (1<<6)
108-
#define RANDOMIZE_HAIR_COLOR (1<<7)
109-
#define RANDOMIZE_FACIAL_HAIR_COLOR (1<<8)
110-
#define RANDOMIZE_SKIN_TONE (1<<9)
111-
#define RANDOMIZE_EYE_COLOR (1<<10)
112-
#define RANDOMIZE_FEATURES (1<<11)
107+
#define RANDOMIZE_PRONOUNS (1<<2)
108+
#define RANDOMIZE_VOICETYPE (1<<3)
109+
#define RANDOMIZE_NAME (1<<4)
110+
#define RANDOMIZE_AGE (1<<5)
111+
#define RANDOMIZE_UNDERWEAR (1<<6)
112+
#define RANDOMIZE_HAIRSTYLE (1<<7)
113+
#define RANDOMIZE_FACIAL_HAIRSTYLE (1<<8)
114+
#define RANDOMIZE_HAIR_COLOR (1<<9)
115+
#define RANDOMIZE_FACIAL_HAIR_COLOR (1<<10)
116+
#define RANDOMIZE_SKIN_TONE (1<<11)
117+
#define RANDOMIZE_EYE_COLOR (1<<12)
118+
#define RANDOMIZE_FEATURES (1<<13)
113119

114120
#define RANDOMIZE_HAIR_FEATURES (RANDOMIZE_HAIRSTYLE | RANDOMIZE_FACIAL_HAIRSTYLE)
115121
#define RANDOMIZE_HAIR_COLORS (RANDOMIZE_HAIR_COLOR | RANDOMIZE_HAIR_COLORS)
@@ -127,6 +133,27 @@
127133
#define ALL_AGES_LIST list(AGE_ADULT, AGE_MIDDLEAGED, AGE_OLD, AGE_IMMORTAL)
128134
#define ALL_AGES_LIST_CHILD list(AGE_CHILD, AGE_ADULT, AGE_MIDDLEAGED, AGE_OLD, AGE_IMMORTAL)
129135

136+
// Pronouns
137+
#define HE_HIM "he/him"
138+
#define SHE_HER "she/her"
139+
#define THEY_THEM "they/them"
140+
#define IT_ITS "it/its"
141+
142+
#define PRONOUNS_LIST list(HE_HIM, SHE_HER, THEY_THEM, IT_ITS)
143+
#define PRONOUNS_LIST_NO_IT list(HE_HIM, SHE_HER, THEY_THEM)
144+
#define PRONOUNS_LIST_IT_ONLY list(IT_ITS)
145+
146+
// Voice types
147+
148+
#define VOICE_TYPE_MASC "Masculine"
149+
#define VOICE_TYPE_FEM "Feminine"
150+
#define VOICE_TYPE_ANDRO "Androgynous"
151+
152+
#define VOICE_TYPES_LIST list(VOICE_TYPE_MASC, VOICE_TYPE_FEM, VOICE_TYPE_ANDRO)
153+
154+
#define VOICE_TYPES_MASCANDRO list(VOICE_TYPE_MASC, VOICE_TYPE_ANDRO)
155+
#define VOICE_TYPES_FEMANDRO list(VOICE_TYPE_FEM, VOICE_TYPE_ANDRO)
156+
130157
//alignment
131158
#define ALIGNMENT_LG "Lawful Good"
132159
#define ALIGNMENT_NG "Neutral Good"

code/__DEFINES/role_bans.dm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#define BAN_MISC_LUNATIC "Lunatic"
66
#define BAN_MISC_LEPROSY "Leprosy"
77
#define BAN_MISC_OOC "OOC"
8+
#define BAN_MISC_OOCPRONOUNS "OOC Pronouns"
89
#define BAN_MISC_DEADCHAT "Deadchat"
910
#define BAN_MISC_LOOC "LOOC"
1011

@@ -14,6 +15,7 @@
1415
BAN_MISC_LEPROSY,\
1516
BAN_MISC_LUNATIC,\
1617
BAN_MISC_OOC,\
18+
BAN_MISC_OOCPRONOUNS,\
1719
BAN_MISC_DEADCHAT,\
1820
BAN_MISC_LOOC,\
1921
)

code/__HELPERS/pronouns.dm

Lines changed: 40 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,16 @@
128128
. = "he"
129129
if(PLURAL)
130130
. = "they"
131+
if (pronouns)
132+
switch (pronouns)
133+
if (HE_HIM)
134+
. = "he"
135+
if (SHE_HER)
136+
. = "she"
137+
if (THEY_THEM)
138+
. = "they"
139+
if (IT_ITS)
140+
. = "it"
131141
if(capitalized)
132142
. = capitalize(.)
133143

@@ -142,6 +152,16 @@
142152
. = "his"
143153
if(PLURAL)
144154
. = "their"
155+
if (pronouns)
156+
switch (pronouns)
157+
if (HE_HIM)
158+
. = "his"
159+
if (SHE_HER)
160+
. = "her"
161+
if (THEY_THEM)
162+
. = "their"
163+
if (IT_ITS)
164+
. = "its"
145165
if(capitalized)
146166
. = capitalize(.)
147167

@@ -158,45 +178,60 @@
158178
. = "them"
159179
if(capitalized)
160180
. = capitalize(.)
181+
if (pronouns)
182+
switch (pronouns)
183+
if (HE_HIM)
184+
. = "him"
185+
if (SHE_HER)
186+
. = "her"
187+
if (THEY_THEM)
188+
. = "them"
189+
if (IT_ITS)
190+
. = "it"
161191

162192
/mob/p_have(temp_gender)
163193
if(!temp_gender)
164194
temp_gender = gender
165195
. = "has"
166196
if(temp_gender == PLURAL)
167197
. = "have"
198+
return
199+
if (pronouns)
200+
if (pronouns == THEY_THEM)
201+
. = "have"
168202

169203
/mob/p_are(temp_gender)
170204
if(!temp_gender)
171205
temp_gender = gender
172206
. = "is"
173-
if(temp_gender == PLURAL)
207+
if(temp_gender == PLURAL || (pronouns && pronouns == THEY_THEM))
174208
. = "are"
175209

176210
/mob/p_were(temp_gender)
177211
if(!temp_gender)
178212
temp_gender = gender
179213
. = "was"
180-
if(temp_gender == PLURAL)
214+
if(temp_gender == PLURAL || (pronouns && pronouns == THEY_THEM))
181215
. = "were"
182216

217+
183218
/mob/p_do(temp_gender)
184219
if(!temp_gender)
185220
temp_gender = gender
186221
. = "does"
187-
if(temp_gender == PLURAL)
222+
if(temp_gender == PLURAL || (pronouns && pronouns == THEY_THEM))
188223
. = "do"
189224

190225
/mob/p_s(temp_gender)
191226
if(!temp_gender)
192227
temp_gender = gender
193-
if(temp_gender != PLURAL)
228+
if(temp_gender != PLURAL || (pronouns && pronouns != THEY_THEM))
194229
. = "s"
195230

196231
/mob/p_es(temp_gender)
197232
if(!temp_gender)
198233
temp_gender = gender
199-
if(temp_gender != PLURAL)
234+
if(temp_gender != PLURAL || (pronouns && pronouns != THEY_THEM))
200235
. = "es"
201236

202237
//humans need special handling, because they can have their gender hidden

code/__HELPERS/text.dm

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -931,3 +931,7 @@ GLOBAL_LIST_INIT(binary, list("0","1"))
931931
if(is_lowercase_character(i_char))
932932
return FALSE
933933
return TRUE
934+
935+
/proc/endswith(input_text, ending)
936+
var/input_length = LAZYLEN(ending)
937+
return !!findtext(input_text, ending, -input_length)

code/datums/emotes.dm

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@
9494
tmp_sound = sound(get_sfx(tmp_sound))
9595
tmp_sound.frequency = pitch
9696
if(tmp_sound && (!only_forced_audio || !intentional))
97+
if (ishuman(user))
98+
var/mob/living/carbon/human/H = user
99+
if(H.voice_type == VOICE_TYPE_ANDRO)
100+
tmp_sound.frequency = pitch * 0.92
97101
playsound(user, tmp_sound, snd_vol, FALSE, snd_range, soundping = soundping)
98102
if(!nomsg)
99103
for(var/mob/M in GLOB.dead_mob_list)
@@ -157,6 +161,15 @@
157161
possible_sounds = H.dna.species.soundpack_f.get_sound(key,modifier)
158162
else if(H.dna.species.soundpack_m)
159163
possible_sounds = H.dna.species.soundpack_m.get_sound(key,modifier)
164+
if(H.voice_type)
165+
switch (H.voice_type)
166+
if (VOICE_TYPE_MASC)
167+
possible_sounds = H.dna.species.soundpack_m.get_sound(key, modifier)
168+
if (VOICE_TYPE_FEM, VOICE_TYPE_ANDRO)
169+
if (H.dna.species.soundpack_f)
170+
possible_sounds = H.dna.species.soundpack_f.get_sound(key, modifier)
171+
else
172+
possible_sounds = H.dna.species.soundpack_m.get_sound(key, modifier)
160173
if(possible_sounds)
161174
if(islist(possible_sounds))
162175
var/list/PS = possible_sounds

code/datums/tgs_handler.dm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
switch(event_code)
66
if(TGS_EVENT_REBOOT_MODE_CHANGE)
77
var/list/reboot_mode_lookup = list ("[TGS_REBOOT_MODE_NORMAL]" = "be normal", "[TGS_REBOOT_MODE_SHUTDOWN]" = "shutdown the server", "[TGS_REBOOT_MODE_RESTART]" = "hard restart the server")
8-
var old_reboot_mode = args[2]
9-
var new_reboot_mode = args[3]
8+
var/old_reboot_mode = args[2]
9+
var/new_reboot_mode = args[3]
1010
message_admins("TGS: Reboot will no longer [reboot_mode_lookup["[old_reboot_mode]"]], it will instead [reboot_mode_lookup["[new_reboot_mode]"]]")
1111
if(TGS_EVENT_PORT_SWAP)
1212
message_admins("TGS: Changing port from [world.port] to [args[2]]")

0 commit comments

Comments
 (0)