From: David L. R. <dol...@us...> - 2010-04-04 23:39:20
|
via 08b9c7c3dd94231c41e73998c0c418eccc1443e3 (commit) via df206bed948c6748671126487f7e20e531578138 (commit) via 56b0e60d1fc46e0e12244858aef82337a51a2109 (commit) from 0f48a71b946f7a5d5448221c13cfcadc2acd7f62 (commit) ----------------------------------------------------------------------- commit 08b9c7c3dd94231c41e73998c0c418eccc1443e3 Author: David Lawrence Ramsey <dol...@us...> Date: Sun Apr 4 18:34:30 2010 -0500 Implement part of Mantis 1268. Give trolls and ghouls the claws mutation intrinsically, instead of faking it in several different places. Trolls now get claws 3, while ghouls get claws 1, as species_has_claws() already effectively gave them. Also, replace species-specific checks for trolls and ghouls with checks for the intrinsic claws mutation. commit df206bed948c6748671126487f7e20e531578138 Author: David Lawrence Ramsey <dol...@us...> Date: Sun Apr 4 18:31:01 2010 -0500 Add spacing fix. commit 56b0e60d1fc46e0e12244858aef82337a51a2109 Author: David Lawrence Ramsey <dol...@us...> Date: Sun Apr 4 18:17:06 2010 -0500 For consistency, rename GENPC_OGRE to GENPC_OGREISH. The genus enum uses adjectives in all other cases. ----------------------------------------------------------------------- Summary of changes: crawl-ref/source/abl-show.cc | 2 +- crawl-ref/source/fight.cc | 10 +------ crawl-ref/source/ghost.cc | 2 +- crawl-ref/source/mutation.cc | 50 +----------------------------------------- crawl-ref/source/newgame.cc | 12 ++++++---- crawl-ref/source/ng-restr.cc | 2 +- crawl-ref/source/output.cc | 2 +- crawl-ref/source/player.cc | 9 +------ crawl-ref/source/skills2.cc | 2 +- crawl-ref/source/species.cc | 2 +- crawl-ref/source/species.h | 2 +- 11 files changed, 19 insertions(+), 76 deletions(-) diff --git a/crawl-ref/source/abl-show.cc b/crawl-ref/source/abl-show.cc index f56aac9..a295911 100644 --- a/crawl-ref/source/abl-show.cc +++ b/crawl-ref/source/abl-show.cc @@ -652,7 +652,7 @@ static talent _get_talent(ability_type ability, bool check_confused) if (you.species == SP_TROLL) failure -= 30; else if (player_genus(GENPC_DWARVEN) || you.species == SP_HILL_ORC - || player_genus(GENPC_OGRE)) + || player_genus(GENPC_OGREISH)) { failure -= 10; } diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc index 489e4d8..2ebeb98 100644 --- a/crawl-ref/source/fight.cc +++ b/crawl-ref/source/fight.cc @@ -3841,8 +3841,7 @@ int melee_attack::player_to_hit(bool random_factor) } else { // ...you must be unarmed - your_to_hit += - (you.species == SP_TROLL || you.species == SP_GHOUL) ? 4 : 2; + your_to_hit += you.demon_pow[MUT_CLAWS] ? 4 : 2; your_to_hit += maybe_random2(1 + you.skills[SK_UNARMED_COMBAT], random_factor); @@ -4144,14 +4143,9 @@ int melee_attack::player_calc_base_unarmed_damage() break; } } - else if (you.equip[ EQ_GLOVES ] == -1) + else if (you.equip[EQ_GLOVES] == -1) { // Claw damage only applies for bare hands. - if (you.species == SP_TROLL) - damage += 5; - else if (you.species == SP_GHOUL) - damage += 2; - damage += player_mutation_level(MUT_CLAWS) * 2; } diff --git a/crawl-ref/source/ghost.cc b/crawl-ref/source/ghost.cc index 2b62b47..1f5e934 100644 --- a/crawl-ref/source/ghost.cc +++ b/crawl-ref/source/ghost.cc @@ -380,7 +380,7 @@ void ghost_demon::init_player_ghost() else { // Unarmed combat. - if (you.species == SP_TROLL) + if (you.demon_pow[MUT_CLAWS]) damage += you.experience_level; damage += you.skills[SK_UNARMED_COMBAT]; diff --git a/crawl-ref/source/mutation.cc b/crawl-ref/source/mutation.cc index 9cc5375..a22a097 100644 --- a/crawl-ref/source/mutation.cc +++ b/crawl-ref/source/mutation.cc @@ -50,25 +50,6 @@ static int _body_covered(); -const char *troll_claw_descrip[4] = { - "You have claws for hands.", - "You have sharp claws for hands.", - "You have very sharp claws for hands.", - "You have claws sharper than steel for hands." -}; - -const char *troll_claw_gain[3] = { - "Your claws sharpen.", - "Your claws sharpen.", - "Your claws steel!" -}; - -const char *troll_claw_lose[3] = { - "Your claws look duller.", - "Your claws look duller.", - "Your claws feel softer." -}; - const char *naga_speed_descrip[4] = { "You cover ground very slowly.", // 10*14/10 = 14 "You cover ground rather slowly.", // 8*14/10 = 11 @@ -143,17 +124,6 @@ void fixup_mutations() _seek_mutation(MUT_BIG_WINGS)->rarity = 1; } - if (you.species == SP_TROLL) - { - mutation_def* mdef = _seek_mutation(MUT_CLAWS); - ASSERT(mdef); - for (int j = 0; j < 3; ++j) - { - mdef->gain[j] = troll_claw_gain[j]; - mdef->lose[j] = troll_claw_lose[j]; - } - } - if (you.species == SP_NAGA) { ASSERT(is_valid_mutation(MUT_STINGER)); @@ -246,16 +216,6 @@ formatted_string describe_mutations() case SP_GHOUL: result += "Your body is rotting away.\n"; - result += "You have sharp claws for hands.\n"; - have_any = true; - break; - - case SP_TROLL: - if (!you.mutation[MUT_CLAWS]) - { - result += mutation_name(MUT_CLAWS, -1, true); - result += "\n"; - } have_any = true; break; @@ -394,7 +354,7 @@ formatted_string describe_mutations() } // a bit more stuff - if (player_genus(GENPC_OGRE) || you.species == SP_TROLL + if (player_genus(GENPC_OGREISH) || you.species == SP_TROLL || player_genus(GENPC_DRACONIAN) || you.species == SP_SPRIGGAN) { result += "Your body does not fit into most forms of armour.\n"; @@ -1490,14 +1450,6 @@ std::string mutation_name(mutation_type mut, int level, bool colour) std::string result; bool innate = false; - if (mut == MUT_CLAWS - && (you.species == SP_TROLL || you.species == SP_GHOUL)) - { - innate = true; - if (you.species == SP_TROLL) - result = troll_claw_descrip[level]; - } - if ((mut == MUT_FAST || mut == MUT_BREATHE_POISON) && you.species == SP_NAGA) { diff --git a/crawl-ref/source/newgame.cc b/crawl-ref/source/newgame.cc index 7ee5498..4e84d0b 100644 --- a/crawl-ref/source/newgame.cc +++ b/crawl-ref/source/newgame.cc @@ -359,7 +359,7 @@ static void _give_starting_food() { item.base_type = OBJ_FOOD; if (you.species == SP_HILL_ORC || you.species == SP_KOBOLD - || player_genus(GENPC_OGRE) || you.species == SP_TROLL) + || player_genus(GENPC_OGREISH) || you.species == SP_TROLL) { item.sub_type = FOOD_MEAT_RATION; } @@ -1521,6 +1521,7 @@ void give_basic_mutations(species_type speci) you.mutation[MUT_POISON_RESISTANCE] = 1; you.mutation[MUT_COLD_RESISTANCE] = 1; you.mutation[MUT_NEGATIVE_ENERGY_RESISTANCE] = 3; + you.mutation[MUT_CLAWS] = 1; you.mutation[MUT_SAPROVOROUS] = 3; you.mutation[MUT_CARNIVOROUS] = 3; you.mutation[MUT_SLOW_HEALING] = 1; @@ -1533,6 +1534,7 @@ void give_basic_mutations(species_type speci) you.mutation[MUT_TOUGH_SKIN] = 2; you.mutation[MUT_REGENERATION] = 2; you.mutation[MUT_FAST_METABOLISM] = 3; + you.mutation[MUT_CLAWS] = 3; you.mutation[MUT_SAPROVOROUS] = 2; you.mutation[MUT_GOURMAND] = 1; you.mutation[MUT_SHAGGY_FUR] = 1; @@ -3766,7 +3768,7 @@ bool _give_items_skills() if (species_skills(SK_MACES_FLAILS, you.species) < species_skills(SK_AXES, you.species)) { - startwep = (player_genus(GENPC_OGRE)) ? WPN_ANKUS : WPN_MACE; + startwep = (player_genus(GENPC_OGREISH)) ? WPN_ANKUS : WPN_MACE; } _newgame_make_item(0, EQ_WEAPON, OBJ_WEAPONS, startwep); @@ -4550,7 +4552,7 @@ bool _give_items_skills() if (you.species == SP_SPRIGGAN) you.inv[0].sub_type = WPN_DAGGER; - if (player_genus(GENPC_OGRE) || you.species == SP_TROLL) + if (player_genus(GENPC_OGREISH) || you.species == SP_TROLL) you.inv[0].sub_type = WPN_CLUB; weap_skill = 1; @@ -4668,7 +4670,7 @@ bool _give_items_skills() _newgame_make_item(2, EQ_CLOAK, OBJ_ARMOUR, ARM_CLOAK); _newgame_make_item(3, EQ_NONE, OBJ_BOOKS, BOOK_STALKING); - if (player_genus(GENPC_OGRE) || you.species == SP_TROLL) + if (player_genus(GENPC_OGREISH) || you.species == SP_TROLL) you.inv[0].sub_type = WPN_CLUB; weap_skill = 1; @@ -4693,7 +4695,7 @@ bool _give_items_skills() if (you.species == SP_SPRIGGAN) you.inv[0].sub_type = WPN_DAGGER; - if (player_genus(GENPC_OGRE) || you.species == SP_TROLL) + if (player_genus(GENPC_OGREISH) || you.species == SP_TROLL) you.inv[0].sub_type = WPN_CLUB; weap_skill = 2; diff --git a/crawl-ref/source/ng-restr.cc b/crawl-ref/source/ng-restr.cc index de1500f..a1bc85f 100644 --- a/crawl-ref/source/ng-restr.cc +++ b/crawl-ref/source/ng-restr.cc @@ -792,7 +792,7 @@ char_choice_restriction weapon_restriction(weapon_type wpn, return (weapon_restriction(WPN_SPEAR, ng)); case WPN_ANKUS: - if (species_genus(ng.species) == GENPC_OGRE) + if (species_genus(ng.species) == GENPC_OGREISH) return (CC_UNRESTRICTED); // intentional fall-through default: diff --git a/crawl-ref/source/output.cc b/crawl-ref/source/output.cc index 10a5fed..99fadf5 100644 --- a/crawl-ref/source/output.cc +++ b/crawl-ref/source/output.cc @@ -2442,7 +2442,7 @@ std::string _status_mut_abilities() } //end switch - innate abilities // a bit more stuff - if (player_genus(GENPC_OGRE) || you.species == SP_TROLL + if (player_genus(GENPC_OGREISH) || you.species == SP_TROLL || player_genus(GENPC_DRACONIAN) || you.species == SP_SPRIGGAN) { mutations.push_back("unfitting armour"); diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index 506724a..b83365e 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -594,7 +594,7 @@ bool you_can_wear(int eq, bool special_armour) // Of the remaining items, these races can't wear anything. if (you.species == SP_TROLL || you.species == SP_SPRIGGAN - || player_genus(GENPC_OGRE) || player_genus(GENPC_DRACONIAN)) + || player_genus(GENPC_OGREISH) || player_genus(GENPC_DRACONIAN)) { return (false); } @@ -5985,11 +5985,6 @@ int player::has_claws(bool allow_tran) const } } - // XXX: Some assumptions about mutations and species in here. - int sp_claws = species_has_claws(species); - if (sp_claws > 0) - return (sp_claws); - return (player_mutation_level(MUT_CLAWS)); } @@ -6202,7 +6197,7 @@ bool player::cannot_act() const bool player::can_throw_large_rocks() const { - return (player_genus(GENPC_OGRE) || species == SP_TROLL); + return (player_genus(GENPC_OGREISH) || species == SP_TROLL); } bool player::can_smell() const diff --git a/crawl-ref/source/skills2.cc b/crawl-ref/source/skills2.cc index 7b6f565..5018b6f 100644 --- a/crawl-ref/source/skills2.cc +++ b/crawl-ref/source/skills2.cc @@ -1714,7 +1714,7 @@ std::string skill_title( unsigned char best_skill, unsigned char skill_lev, break; case SK_SPELLCASTING: - if (player_genus(GENPC_OGRE, static_cast<species_type>(species))) + if (player_genus(GENPC_OGREISH, static_cast<species_type>(species))) { result = "Ogre Mage"; break; diff --git a/crawl-ref/source/species.cc b/crawl-ref/source/species.cc index f04160a..c57e361 100644 --- a/crawl-ref/source/species.cc +++ b/crawl-ref/source/species.cc @@ -299,7 +299,7 @@ genus_type species_genus(species_type species) return (GENPC_DWARVEN); case SP_OGRE: - return (GENPC_OGRE); + return (GENPC_OGREISH); default: return (GENPC_NONE); diff --git a/crawl-ref/source/species.h b/crawl-ref/source/species.h index 5b701a7..488c572 100644 --- a/crawl-ref/source/species.h +++ b/crawl-ref/source/species.h @@ -6,7 +6,7 @@ enum genus_type GENPC_DRACONIAN, GENPC_ELVEN, GENPC_DWARVEN, - GENPC_OGRE, + GENPC_OGREISH, GENPC_NONE }; -- Dungeon Crawl Stone Soup |