Skip to content

Commit

Permalink
Bodyparts declents (#521)
Browse files Browse the repository at this point in the history
## About The Pull Request
Добавляет поддержку для склонения частей тела
  • Loading branch information
larentoun authored Oct 6, 2024
1 parent 242a575 commit acb508c
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 2 deletions.
8 changes: 6 additions & 2 deletions code/__HELPERS/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -599,10 +599,14 @@ GLOBAL_LIST_INIT(skin_tone_names, list(
return mob

/// Returns a string for the specified body zone. If we have a bodypart in this zone, refers to its plaintext_zone instead.
/mob/living/proc/parse_zone_with_bodypart(zone)
/mob/living/proc/parse_zone_with_bodypart(zone, declent = NOMINATIVE) // BANDASTATION EDIT - Declents
var/obj/item/bodypart/part = get_bodypart(zone)

return part?.plaintext_zone || parse_zone(zone)
// BANDASTATION EDIT START - Declents
if(part?.ru_plaintext_zone[declent])
return part.ru_plaintext_zone[declent]
return ru_parse_zone(zone, declent)
// BANDASTATION EDIT END

///Return a string for the specified body zone. Should be used for parsing non-instantiated bodyparts, otherwise use [/obj/item/bodypart/var/plaintext_zone]
/proc/parse_zone(zone)
Expand Down
1 change: 1 addition & 0 deletions modular_bandastation/translations/_translations.dme
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "_translations.dm"

#include "code/bodyparts.dm"
#include "code/moustache.dm"
#include "code/pronouns.dm"
#include "code/restaurant_customer.dm"
Expand Down
60 changes: 60 additions & 0 deletions modular_bandastation/translations/code/bodyparts.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
// Code for handling declents for bodyparts

/obj/item/bodypart
var/list/ru_plaintext_zone

/obj/item/bodypart/head
ru_plaintext_zone = RU_NAMES_LIST_INIT("head", "голова", "головы", "голове", "голову", "головой", "голове")

/obj/item/bodypart/chest
ru_plaintext_zone = RU_NAMES_LIST_INIT("chest", "грудь", "груди", "груди", "грудь", "грудью", "груди")

/obj/item/bodypart/arm/left
ru_plaintext_zone = RU_NAMES_LIST_INIT("left arm", "левая рука", "левой руки", "левой руке", "левую руку", "левой рукой", "левой руке")

/obj/item/bodypart/arm/right
ru_plaintext_zone = RU_NAMES_LIST_INIT("right arm", "правая рука", "правой руки", "правой руке", "правую руку", "правой рукой", "правой руке")

/obj/item/bodypart/leg/left
ru_plaintext_zone = RU_NAMES_LIST_INIT("left leg", "левая нога", "левой ноги", "левой ноге", "левую ногу", "левой ногой", "левой ноге")

/obj/item/bodypart/leg/right
ru_plaintext_zone = RU_NAMES_LIST_INIT("right leg", "правая нога", "правой ноги", "правой ноге", "правую ногу", "правой ногой", "правой ноге")

/proc/ru_parse_zone(zone, declent = NOMINATIVE)
var/static/list/chest = RU_NAMES_LIST_INIT("chest", "грудь", "груди", "груди", "грудь", "грудью", "груди")
var/static/list/head = RU_NAMES_LIST_INIT("head", "голова", "головы", "голове", "голову", "головой", "голове")
var/static/list/right_hand = RU_NAMES_LIST_INIT("right hand", "правое запястье", "правого запястья", "правому запястью", "правое запястье", "правым запястьем", "правом запястье")
var/static/list/left_hand = RU_NAMES_LIST_INIT("left hand", "левое запястье", "левое запястье", "левой руке", "левую руку", "левой рукой", "левой руке")
var/static/list/left_arm = RU_NAMES_LIST_INIT("left arm", "левая рука", "левой руки", "левой руке", "левую руку", "левой рукой", "левой руке")
var/static/list/right_arm = RU_NAMES_LIST_INIT("right arm", "правая рука", "правой руки", "правой руке", "правую руку", "правой рукой", "правой руке")
var/static/list/left_leg = RU_NAMES_LIST_INIT("left leg", "левая нога", "левой ноги", "левой ноге", "левую ногу", "левой ногой", "левой ноге")
var/static/list/right_leg = RU_NAMES_LIST_INIT("right leg", "правая нога", "правой ноги", "правой ноге", "правую ногу", "правой ногой", "правой ноге")
var/static/list/left_foot = RU_NAMES_LIST_INIT("left leg", "левая стопа", "левой стопы", "левой стопе", "левую стопу", "левой стопой", "левой стопе")
var/static/list/right_foot = RU_NAMES_LIST_INIT("left leg", "правая стопа", "правой стопы", "правой стопе", "правую стопу", "правой стопой", "правой стопе")
var/static/list/groin = RU_NAMES_LIST_INIT("groin", "пах", "паха", "паху", "пах", "пахом", "пахе")
switch(zone)
if(BODY_ZONE_CHEST)
return chest[declent]
if(BODY_ZONE_HEAD)
return head[declent]
if(BODY_ZONE_PRECISE_R_HAND)
return right_hand[declent]
if(BODY_ZONE_PRECISE_L_HAND)
return left_hand[declent]
if(BODY_ZONE_L_ARM)
return left_arm[declent]
if(BODY_ZONE_R_ARM)
return right_arm[declent]
if(BODY_ZONE_L_LEG)
return left_leg[declent]
if(BODY_ZONE_R_LEG)
return right_leg[declent]
if(BODY_ZONE_PRECISE_L_FOOT)
return left_foot[declent]
if(BODY_ZONE_PRECISE_R_FOOT)
return right_foot[declent]
if(BODY_ZONE_PRECISE_GROIN)
return groin[declent]
else
return zone

0 comments on commit acb508c

Please sign in to comment.