diff options
author | Emistry <Equinox1991@gmail.com> | 2016-01-25 23:00:26 +0800 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2016-02-29 01:03:25 +0100 |
commit | 75ba7024fe3b68718d0f0a289a68ea0719054d3b (patch) | |
tree | 684d87f0f52705fa51b711b3ae5d0235a8b1ca0f | |
parent | 844d429119e671f8abbdb335233eba1bb156721c (diff) | |
download | hercules-75ba7024fe3b68718d0f0a289a68ea0719054d3b.tar.gz hercules-75ba7024fe3b68718d0f0a289a68ea0719054d3b.tar.bz2 hercules-75ba7024fe3b68718d0f0a289a68ea0719054d3b.tar.xz hercules-75ba7024fe3b68718d0f0a289a68ea0719054d3b.zip |
Added gender-related constants SEX_MALE/SEX_FEMALE
-rw-r--r-- | db/constants.conf | 4 | ||||
-rw-r--r-- | doc/script_commands.txt | 9 |
2 files changed, 10 insertions, 3 deletions
diff --git a/db/constants.conf b/db/constants.conf index 4ee6a8333..ee78cf32e 100644 --- a/db/constants.conf +++ b/db/constants.conf @@ -3828,4 +3828,8 @@ constants_db: { C_CHOCOLATE: 0xD2691E C_GOLD: 0xFFD700 C_VIOLET: 0xEE82EE + + comment__: "Genders" + SEX_FEMALE: 0 + SEX_MALE: 1 } diff --git a/doc/script_commands.txt b/doc/script_commands.txt index 709aa39dd..c45b4e602 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -552,7 +552,7 @@ Weight - Amount of weight the character currently carries. Display as in Weight/10. MaxWeight - Maximum weight the character can carry. Display as in MaxWeight/10. -Sex - 0 if female, 1 if male. +Sex - Character's gender (SEX_MALE or SEX_FEMALE). Class - Character's job. Upper - 0 if the character is normal class, 1 if advanced, 2 if baby. BaseClass - The character's 1-1 'normal' job, regardless of Upper value. @@ -889,11 +889,14 @@ and are the following: ?: - Conditional operator Very useful e.g. to replace - if(Sex) mes "..."; else mes "..."; + if (Sex == SEX_MALE) + mes "You're Male."; + else + mes "You're Female."; clauses with simple - mes "Welcome, " + (Sex?"Mr.":"Mrs.") + " " + strcharinfo(0); + mes "Welcome, " + (Sex == SEX_MALE ? "Mr." : "Mrs.") + " " + strcharinfo(0); or to replace any other simple if-else clauses. It might be worth mentioning that ?: has low priority and has to be enclosed with |