Verified Commit abde741d authored by gumi's avatar gumi 👾

add a changesex pseudo-atcommand

parent a182c50a
// @gender atcommand
// changes or returns the gender
- script @gender 32767,{
end;
OnCall:
if (.@atcmd_parameters$[0] == "") {
dispbottom("Your current gender is " + genderToString());
end;
}
.@desired = stringToGender(.@atcmd_parameters$[0]);
if (.@desired == Gender) {
dispbottom("Your gender is already " + genderToString());
} else {
Gender = .@desired;
dispbottom("Gender changed to " + genderToString());
}
end;
OnInit:
bindatcmd("gender", "@gender::OnCall", 99, 99, false);
add_group_command("gender", 40, true, false);
add_group_command("gender", 50, true, true);
add_group_command("gender", 60, true, true);
add_group_command("gender", 80, true, true);
bindatcmd("changesex", "@gender::OnCall", 99, 99, false);
add_group_command("changesex", 40, true, false);
add_group_command("changesex", 50, true, true);
add_group_command("changesex", 60, true, true);
add_group_command("changesex", 80, true, true);
}
function script stringToGender {
.@short$ = strtolower(charat(getarg(0, ""), 0));
return .@short$ == "f" ? GENDER_FEMALE :
.@short$ == "m" ? GENDER_MALE : GENDER_NONBINARY;
}
function script genderToString {
.@gender = getarg(0, Gender);
return .@gender == GENDER_FEMALE ? l("female") :
.@gender == GENDER_MALE ? l("male") : l("non-binary");
}
......@@ -12,6 +12,7 @@
"npc/functions/RNGesus.txt",
"npc/functions/math.txt",
"npc/functions/warp.txt",
"npc/functions/gender.txt",
// Misc functions
"npc/functions/main.txt",
......@@ -127,6 +128,7 @@
"npc/commands/super-menu.txt",
"npc/commands/resync.txt",
"npc/commands/python.txt",
"npc/commands/gender.txt",
// config script
"npc/config/hairstyle_config.txt",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment