diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-12-13 17:02:38 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-12-13 17:02:38 +0000 |
commit | c4752d24d70640b0e57a7ed227d40ec4e6a617e2 (patch) | |
tree | bc6d9743d03a3dcb61f7943f5a1dc21f6738fae7 | |
parent | 52b146bac6c9f15d8b90331576738204651d6c8c (diff) | |
download | crawl-ref-c4752d24d70640b0e57a7ed227d40ec4e6a617e2.tar.gz crawl-ref-c4752d24d70640b0e57a7ed227d40ec4e6a617e2.zip |
Simplify racialise_starting_equipment(), and clean up related code a
bit.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3054 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r-- | crawl-ref/source/newgame.cc | 20 | ||||
-rw-r--r-- | crawl-ref/source/player.cc | 3 |
2 files changed, 12 insertions, 11 deletions
diff --git a/crawl-ref/source/newgame.cc b/crawl-ref/source/newgame.cc index 9ab25ab614..64214ee4c9 100644 --- a/crawl-ref/source/newgame.cc +++ b/crawl-ref/source/newgame.cc @@ -526,23 +526,25 @@ static void racialise_starting_equipment() if ((you.inv[i].base_type == OBJ_ARMOUR || you.inv[i].base_type == OBJ_WEAPONS || you.inv[i].base_type == OBJ_MISSILES) - && get_equip_race(you.inv[i]) == ISFLAG_NO_RACE ) + && get_equip_race(you.inv[i]) == ISFLAG_NO_RACE) { + int speci = (player_genus(GENPC_ELVEN)) ? 1 : + (player_genus(GENPC_DWARVEN)) ? 2 : + (you.species == SP_HILL_ORC) ? 3 : + 0; + // now add appropriate species type mod - switch (you.species) + switch (speci) { - case SP_HIGH_ELF: - case SP_GREY_ELF: - case SP_DEEP_ELF: - case SP_SLUDGE_ELF: + case 1: set_equip_race( you.inv[i], ISFLAG_ELVEN ); break; - case SP_MOUNTAIN_DWARF: + case 2: set_equip_race( you.inv[i], ISFLAG_DWARVEN ); break; - case SP_HILL_ORC: + case 3: set_equip_race( you.inv[i], ISFLAG_ORCISH ); break; @@ -3301,7 +3303,7 @@ bool give_items_skills() // Elven armour is light, we need to know this up front. racialise_starting_equipment(); - + you.skills[(player_light_armour()? SK_DODGING : SK_ARMOUR)] = 2; if (you.species != SP_VAMPIRE) diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index b264ca8ab1..2cfa244719 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -395,12 +395,11 @@ bool player_genus(genus_type which_genus, species_type species) case SP_GREY_ELF: case SP_DEEP_ELF: case SP_SLUDGE_ELF: - case SP_ELF: return (which_genus == GENPC_ELVEN); case SP_MOUNTAIN_DWARF: return (which_genus == GENPC_DWARVEN); - + case SP_OGRE: case SP_OGRE_MAGE: return (which_genus == GENPC_OGRE); |