diff options
Diffstat (limited to 'npc/functions/gender.txt')
-rw-r--r-- | npc/functions/gender.txt | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/npc/functions/gender.txt b/npc/functions/gender.txt new file mode 100644 index 00000000..0f153c53 --- /dev/null +++ b/npc/functions/gender.txt @@ -0,0 +1,13 @@ +function script stringToGender { + .@short$ = strtolower(charat(getarg(0, ""), 0)); + + return .@short$ == "f" ? GENDER_FEMALE : + .@short$ == "m" ? GENDER_MALE : GENDER_HIDDEN; +} + +function script genderToString { + .@gender = getarg(0, Gender); + + return .@gender == GENDER_FEMALE ? l("female") : + .@gender == GENDER_MALE ? l("male") : l("non-binary"); +} |