subfunctions of their own and use them as necessary. Has the side effect of showing Beogh as invalid choice for non-orc priests and tridents as invalid choice for small race Gladiators. Does not yet handle good random choices.
All gods are now unrestricted (if not outright banned, of course), and Necromancy has been unrestricted for a few more species.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6172 c06c8d41-db1a-0410-9941-cceddc491573
PO3IATZV4JX3I3522UAGF53ZLZ4FW7C2J32Z23PEWQVHGGEUO7SAC
3FRPKD2JSN7RA2HKWAO3XV7MMKCIAMWIMU6JNJ452VZEUSXM6PWQC
K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC
C2PRXJYHDRF2642VDAUY76HJKCPQFGWDI6AM3SMCMYCHGWYDQXQQC
VXSORUQOM2VZA4CAZDC6KPAY373NQIN3UT7CXQXTRCYXO2WM62DAC
JJULXW764V5C2HJKZNWQAEWB6QM5YZADD7ZCE35LYTBFEM6PMYCAC
RPOZZWKG5GLPHVZZ7ZKMKS64ZMV2LDCQSARBJFJ6FZOTOKCQO7FAC
B5OK4FEITJ6MUT7J76OJJH2TOPTZGG7J7UPIJ6Z6WA5FC526FLTAC
G5CA5STLILMQZO2ICHZTVTW76V6RMC7KWP4ELU7ANZBNXYSTWV7AC
VDMADGWYGYZJWAEWU3WE7UCPVDS2O6HOHCXLOML64U5UCH4FER3AC
HPDTZAK3CLBMDCJY3747CM6FDSZQOOHVVCU35G6MPDA4ZBAI6DXAC
SDLKLUNFGVKDS55DDJZCBAVIB7NL3RRYPTACAY65SCUQKV6APFSAC
WTBQLBYFLQCF3NRAMB4Z2YA4MHYVFYI5YS7FXXBPICY2KCBA63AQC
S4BRP4VHB23F2FCC6BXNAN2MZRVUGW7QMXUEOAVZVGFXKXJPVLLQC
CQ24AVAI6SW3AHTIDMLPSTRRBEU6FHRF5I5FD6G5QIYE6PO4BQMQC
JDM5R3HYGXKQKZWY35QZ2KOB24TFZ3FW2PCNXCRCMWG72AZC5ZXQC
SJP5BHX6MFWF3OSQPEF4WUWZWPUGMOVURTT2CUVT6H3A66LETXUAC
LECIKTCYNIZX557PIJWPY73WM652RHZDIAY4J7OXIK7NY4LZ2ZJAC
const weapon_type startwep[5] = { WPN_SHORT_SWORD, WPN_MACE,
WPN_HAND_AXE, WPN_SPEAR, WPN_TRIDENT };
char_choice_restriction startwep_restrictions[5];
int keyin = 0;
int num_choices = 5;
case SP_HUMAN:
case SP_HIGH_ELF:
case SP_GREY_ELF:
case SP_DEEP_ELF:
// Sludge elves have bad aptitudes with short swords (110) but are still
// better with them than any other starting weapon.
case SP_SLUDGE_ELF:
case SP_HALFLING:
case SP_KOBOLD:
case SP_GNOME:
case SP_SPRIGGAN:
case SP_NAGA:
case SP_MINOTAUR:
case SP_KENKU:
case SP_VAMPIRE:
startwep_restrictions[0] = CC_UNRESTRICTED;
break;
case WPN_SHORT_SWORD:
switch (you.species)
{
case SP_HUMAN:
case SP_HIGH_ELF:
case SP_GREY_ELF:
case SP_DEEP_ELF:
// Sludge elves have bad aptitudes with short swords (110) but are
// still better with them than any other starting weapon.
case SP_SLUDGE_ELF:
case SP_HALFLING:
case SP_KOBOLD:
case SP_GNOME:
case SP_SPRIGGAN:
case SP_NAGA:
case SP_MINOTAUR:
case SP_KENKU:
case SP_VAMPIRE:
return (CC_UNRESTRICTED);
default:
if (player_genus(GENPC_DRACONIAN))
startwep_restrictions[0] = CC_UNRESTRICTED;
else
startwep_restrictions[0] = CC_RESTRICTED;
}
default:
if (player_genus(GENPC_DRACONIAN))
return (CC_UNRESTRICTED);
else
return (CC_RESTRICTED);
}
switch (you.species)
{
case SP_TROLL:
startwep_restrictions[1] = CC_UNRESTRICTED;
startwep_restrictions[2] = CC_RESTRICTED;
break;
case SP_HUMAN:
case SP_MOUNTAIN_DWARF:
case SP_HILL_ORC:
case SP_MUMMY:
case SP_CENTAUR:
case SP_NAGA:
case SP_OGRE:
case SP_OGRE_MAGE:
case SP_MINOTAUR:
case SP_KENKU:
startwep_restrictions[1] = CC_UNRESTRICTED;
startwep_restrictions[2] = CC_UNRESTRICTED;
break;
case WPN_MACE:
if (you.species == SP_TROLL)
return (CC_UNRESTRICTED);
// else fall-through
case WPN_HAND_AXE:
switch (you.species)
{
case SP_HUMAN:
case SP_MOUNTAIN_DWARF:
case SP_HILL_ORC:
case SP_MUMMY:
case SP_CENTAUR:
case SP_NAGA:
case SP_OGRE:
case SP_OGRE_MAGE:
case SP_MINOTAUR:
case SP_KENKU:
return (CC_UNRESTRICTED);
default:
if (player_genus(GENPC_DRACONIAN))
return (CC_UNRESTRICTED);
else
return (CC_RESTRICTED);
}
startwep_restrictions[1] = CC_UNRESTRICTED;
startwep_restrictions[2] = CC_UNRESTRICTED;
case SP_HUMAN:
case SP_HILL_ORC:
case SP_MERFOLK:
case SP_MUMMY:
case SP_NAGA:
case SP_CENTAUR:
case SP_OGRE_MAGE:
case SP_MINOTAUR:
case SP_KENKU:
return (CC_UNRESTRICTED);
break;
default:
if (player_genus(GENPC_DRACONIAN))
return (CC_UNRESTRICTED);
else
return (CC_RESTRICTED);
// Spear
switch (you.species)
{
case SP_HUMAN:
case SP_HILL_ORC:
case SP_MERFOLK:
case SP_MUMMY:
case SP_NAGA:
case SP_CENTAUR:
case SP_OGRE_MAGE:
case SP_MINOTAUR:
case SP_KENKU:
startwep_restrictions[3] = CC_UNRESTRICTED;
break;
// Both are polearms, right?
return (_weapon_restriction(WPN_SPEAR));
// Trident
if (you.char_class == JOB_GLADIATOR && you.species != SP_KOBOLD
|| you.species == SP_MERFOLK)
{
// Both are polearms, right?
startwep_restrictions[4] = startwep_restrictions[3];
}
else
startwep_restrictions[4] = CC_BANNED;
char_choice_restriction startwep_restrictions[5];
int keyin = 0;
const int num_choices = (you.char_class == JOB_GLADIATOR
|| you.species == SP_MERFOLK ? 5 : 4);
for (int i = 0; i < num_choices; i++)
startwep_restrictions[i] = _weapon_restriction(startwep[i]);
}
// Gods are not restricted but there are some choices that are banned (false).
// Everything else will be unrestricted.
static bool _is_valid_religion(god_type god)
{
// Sanity check.
if (you.species == SP_DEMIGOD)
return (false);
if (god == GOD_BEOGH)
return (you.species == SP_HILL_ORC);
switch (you.species)
{
case SP_DEMONSPAWN:
case SP_MUMMY:
case SP_GHOUL:
case SP_VAMPIRE:
return (!is_good_god(god));
default:
// All gods are allowed.
return (true);
}
if (you.species == SP_HILL_ORC)
{
textcolor( LIGHTGREY );
cprintf("c - Beogh (priest of Orcs)" EOL);
}
const bool valid = _is_valid_religion(GOD_BEOGH);
textcolor( valid ? LIGHTGREY : DARKGREY );
cprintf("%s - Beogh (priest of Orcs)" EOL,
valid ? "c" : " ");
switch (you.species)
{
case SP_HUMAN:
case SP_HIGH_ELF:
case SP_SLUDGE_ELF:
case SP_MOUNTAIN_DWARF:
case SP_HALFLING:
case SP_HILL_ORC:
case SP_MERFOLK:
case SP_GNOME:
case SP_CENTAUR:
case SP_OGRE:
case SP_TROLL:
case SP_RED_DRACONIAN:
case SP_MINOTAUR:
case SP_DEMONSPAWN:
case SP_GHOUL:
textcolor(LIGHTGREY);
break;
default:
textcolor(DARKGREY);
}
switch (you.species)
{
case SP_HUMAN:
case SP_SLUDGE_ELF:
case SP_MOUNTAIN_DWARF:
case SP_HILL_ORC:
case SP_OGRE:
case SP_TROLL:
case SP_CENTAUR:
case SP_MINOTAUR:
case SP_DEMONSPAWN:
case SP_MERFOLK:
case SP_VAMPIRE:
textcolor( LIGHTGREY );
break;
default:
if (player_genus(GENPC_DRACONIAN))
textcolor( LIGHTGREY );
else
textcolor( DARKGREY );
}
// Both Xom and Makhleb are okay choices for everyone.
textcolor( LIGHTGREY );
switch (you.species)
{
case SP_HUMAN:
case SP_HIGH_ELF:
case SP_SLUDGE_ELF:
case SP_MOUNTAIN_DWARF:
case SP_HALFLING:
case SP_HILL_ORC:
case SP_KOBOLD:
case SP_MUMMY:
case SP_GNOME:
case SP_OGRE:
case SP_TROLL:
case SP_CENTAUR:
case SP_MINOTAUR:
case SP_DEMONSPAWN:
case SP_GHOUL:
case SP_MERFOLK:
case SP_VAMPIRE:
textcolor( LIGHTGREY );
break;
default:
if (player_genus(GENPC_DRACONIAN))
textcolor( LIGHTGREY );
else
textcolor( DARKGREY );
}
you.skills[SK_FIGHTING] = 2;
you.skills[SK_DODGING] = 1;
you.skills[SK_THROWING] = 2;
you.skills[SK_STAVES] = 3;
you.skills[SK_FIGHTING] = 2;
you.skills[SK_DODGING] = 1;
you.skills[SK_THROWING] = 2;
you.skills[SK_STAVES] = 3;