From: <j-...@us...> - 2008-05-26 17:40:51
|
Revision: 5262 http://crawl-ref.svn.sourceforge.net/crawl-ref/?rev=5262&view=rev Author: j-p-e-g Date: 2008-05-26 10:40:43 -0700 (Mon, 26 May 2008) Log Message: ----------- Modify skill titles * Replace the "Foo" in Foo Blade, Foo Porcupine, Foo Catapult, Foo Arbalest, Foo Ballista, and Foo Barricade with the capitalized genus (Elf, Orc, Draconian, ...) * Merry Foo, Foo of Death, Placeless Foo and Shapeless Foo still use the species name, though that's debatable, of course. * Marksfoo uses the lowercase genus name, in particular "ogre" for Ogre and Ogre-Mage, both. * Add "Plane Glider" as "Plane Foo" variant for Kenku. Clean up the skill title array a bit. Modified Paths: -------------- trunk/crawl-ref/source/enum.h trunk/crawl-ref/source/items.cc trunk/crawl-ref/source/monstuff.cc trunk/crawl-ref/source/player.cc trunk/crawl-ref/source/player.h trunk/crawl-ref/source/skills2.cc Modified: trunk/crawl-ref/source/enum.h =================================================================== --- trunk/crawl-ref/source/enum.h 2008-05-26 17:40:05 UTC (rev 5261) +++ trunk/crawl-ref/source/enum.h 2008-05-26 17:40:43 UTC (rev 5262) @@ -2263,7 +2263,7 @@ SHOP_RANDOM = 255 // keep set at 255 for now {dlb} }; -// These are often addressed relative to each other (esp. delta SIZE_MEDIUM) +// These are often addressed relative to each other (esp. delta SIZE_MEDIUM). enum size_type { SIZE_TINY, // rat/bat @@ -2305,6 +2305,11 @@ SK_SHIELDS, SK_TRAPS_DOORS, SK_UNARMED_COMBAT, // 19 + SK_UNUSED_2, + SK_UNUSED_3, + SK_UNUSED_4, + SK_UNUSED_5, + SK_UNUSED_6, SK_SPELLCASTING = 25, // 25 SK_CONJURATIONS, SK_ENCHANTMENTS, Modified: trunk/crawl-ref/source/items.cc =================================================================== --- trunk/crawl-ref/source/items.cc 2008-05-26 17:40:05 UTC (rev 5261) +++ trunk/crawl-ref/source/items.cc 2008-05-26 17:40:43 UTC (rev 5262) @@ -344,10 +344,8 @@ int item = NON_ITEM; for (item = 0; item < (MAX_ITEMS - reserve); item++) - { if (!is_valid_item( mitm[item] )) break; - } if (item >= MAX_ITEMS - reserve) { @@ -427,11 +425,11 @@ return; } - // Okay, item is buried, find item that's on top of it: + // Okay, item is buried, find item that's on top of it. for (c = igrd[ mitm[dest].x ][ mitm[dest].y ]; c != NON_ITEM; c = mitm[c].link) { - // find item linking to dest item + // Find item linking to dest item. if (is_valid_item( mitm[c] ) && mitm[c].link == dest) { // unlink dest @@ -459,10 +457,10 @@ // clean the relevant parts of the object: mitm[dest].base_type = OBJ_UNASSIGNED; - mitm[dest].quantity = 0; + mitm[dest].quantity = 0; mitm[dest].x = 0; mitm[dest].y = 0; - mitm[dest].link = NON_ITEM; + mitm[dest].link = NON_ITEM; mitm[dest].props.clear(); // Look through all items for links to this item. @@ -524,7 +522,7 @@ } } - // paranoia, shouldn't be needed + // Paranoia, shouldn't be needed. item.clear(); } @@ -1099,19 +1097,25 @@ break; default: if (iorig > GOD_NO_GOD && iorig < NUM_GODS) + { desc += god_name(static_cast<god_type>(iorig)) + " gifted " + _article_it(item) + " to you "; + } else + { // Bug really. desc += "You stumbled upon " + _article_it(item) + " "; + } break; } } else if (item.orig_monnum - 1 == MONS_DANCING_WEAPON) desc += "You subdued it "; else + { desc += "You took " + _article_it(item) + " off " + _origin_monster_desc(item) + " "; + } } else desc += "You found " + _article_it(item) + " "; @@ -1738,7 +1742,7 @@ } -// returns quantity dropped +// Returns quantity dropped. bool copy_item_to_grid( const item_def &item, int x_plos, int y_plos, int quant_drop, bool mark_dropped ) { @@ -1749,7 +1753,7 @@ if (quant_drop < 0) quant_drop = item.quantity; - // loop through items at current location + // Loop through items at current location. if (is_stackable_item( item )) { for (int i = igrd[x_plos][y_plos]; i != NON_ITEM; i = mitm[i].link) @@ -1773,15 +1777,15 @@ } } - // item not found in current stack, add new item to top. + // Item not found in current stack, add new item to top. int new_item = get_item_slot(10); if (new_item == NON_ITEM) return (false); - // copy item + // Copy item. mitm[new_item] = item; - // set quantity, and set the item as unlinked + // Set quantity, and set the item as unlinked. mitm[new_item].quantity = quant_drop; mitm[new_item].x = 0; mitm[new_item].y = 0; @@ -1789,7 +1793,7 @@ if (mark_dropped) { - mitm[new_item].slot = index_to_letter(item.link); + mitm[new_item].slot = index_to_letter(item.link); mitm[new_item].flags |= ISFLAG_DROPPED; mitm[new_item].flags &= ~ISFLAG_THROWN; origin_set_unknown(mitm[new_item]); @@ -1799,8 +1803,8 @@ if (is_blood_potion(item) && item.quantity != quant_drop) // partial drop only { - // since only the oldest potions have been dropped, - // remove the newest ones + // Since only the oldest potions have been dropped, + // remove the newest ones. remove_newest_blood_potion(mitm[new_item]); } Modified: trunk/crawl-ref/source/monstuff.cc =================================================================== --- trunk/crawl-ref/source/monstuff.cc 2008-05-26 17:40:05 UTC (rev 5261) +++ trunk/crawl-ref/source/monstuff.cc 2008-05-26 17:40:43 UTC (rev 5262) @@ -321,6 +321,7 @@ else if (monster->has_ench(ENCH_GLOWING_SHAPESHIFTER)) corpse_class = MONS_GLOWING_SHAPESHIFTER; + // Doesn't leave a corpse. if (mons_weight(corpse_class) == 0 || coinflip()) return; @@ -348,13 +349,13 @@ return; } - // Don't care if 'o' is changed, and it shouldn't be (corpses don't stack) + // Don't care if 'o' is changed, and it shouldn't be (corpses don't stack). move_item_to_grid( &o, monster->x, monster->y ); if (see_grid(monster->x, monster->y)) { - tutorial_dissection_reminder( - mons_corpse_effect(monster->type) != CE_POISONOUS - || player_res_poison() > 0 ); + const bool poison = (mons_corpse_effect(monster->type) == CE_POISONOUS + && player_res_poison() <= 0); + tutorial_dissection_reminder(!poison); } } // end place_monster_corpse() Modified: trunk/crawl-ref/source/player.cc =================================================================== --- trunk/crawl-ref/source/player.cc 2008-05-26 17:40:05 UTC (rev 5261) +++ trunk/crawl-ref/source/player.cc 2008-05-26 17:40:43 UTC (rev 5262) @@ -4034,11 +4034,16 @@ return (SP_HUMAN); } -std::string species_name(species_type speci, int level, bool genus, bool adj) -// defaults: false false +std::string species_name(species_type speci, int level, bool genus, bool adj, + bool ogre) +// defaults: false false false { std::string res; + // If 'ogre' is true, the Ogre-Mage is described as like the Ogre. + if (ogre && speci == SP_OGRE_MAGE) + speci = SP_OGRE; + if (player_genus( GENPC_DRACONIAN, speci )) { if (adj || genus) // adj doesn't care about exact species @@ -4114,8 +4119,7 @@ // We've previously declared that these are radically // different from Ogres... so we're not going to // refer to them as Ogres. -- bwr - // Not the species, but genus... why not? -- jpeg - case SP_OGRE_MAGE: res = (genus? "Ogre" : "Ogre-Mage"); break; + case SP_OGRE_MAGE: res = "Ogre-Mage"; break; case SP_CENTAUR: res = "Centaur"; break; case SP_SPRIGGAN: res = "Spriggan"; break; case SP_MINOTAUR: res = "Minotaur"; break; Modified: trunk/crawl-ref/source/player.h =================================================================== --- trunk/crawl-ref/source/player.h 2008-05-26 17:40:05 UTC (rev 5261) +++ trunk/crawl-ref/source/player.h 2008-05-26 17:40:43 UTC (rev 5262) @@ -79,8 +79,8 @@ /* *********************************************************************** * called from: acr - chardump - describe - newgame - view * *********************************************************************** */ -std::string species_name( species_type speci, int level, - bool genus = false, bool adj = false); +std::string species_name( species_type speci, int level, bool genus = false, + bool adj = false, bool ogre = false ); int str_to_species(const std::string &species); /* *********************************************************************** Modified: trunk/crawl-ref/source/skills2.cc =================================================================== --- trunk/crawl-ref/source/skills2.cc 2008-05-26 17:40:05 UTC (rev 5261) +++ trunk/crawl-ref/source/skills2.cc 2008-05-26 17:40:43 UTC (rev 5262) @@ -46,70 +46,74 @@ No overlaps, high diversity. */ -// Note: Even though %s could be used with most of these, remember that +// Replace @genus@ with lowercase genus, @Genus@ with uppercase, and %s +// with special cases defined below, including but not limited to species. + +// NOTE: Even though %s could be used with most of these, remember that // the character's race will be listed on the next line. It's only really // intended for cases where things might be really awkward without it. -- bwr - const char *skills[50][6] = { - {"Fighting", "Skirmisher", "Fighter", "Warrior", "Slayer", "Conqueror"}, // 0 - {"Short Blades", "Cutter", "Slicer", "Swashbuckler", "Blademaster", "Eviscerator"}, - {"Long Blades", "Slasher", "Carver", "Fencer", "%s Blade", "Swordmaster"}, - {NULL}, // 3- was: great swords {dlb} - {"Axes", "Chopper", "Cleaver", "Hacker", "Severer", "Executioner"}, - {"Maces & Flails", "Cudgeler", "Basher", "Bludgeoner", "Shatterer", "Skullcrusher"}, // 5 - {"Polearms", "Poker", "Spear-Bearer", "Impaler", "Phalangite", "%s Porcupine"}, - {"Staves", "Twirler", "Cruncher", "Stickfighter", "Pulverizer", "Chief of Staff"}, - {"Slings", "Vandal", "Slinger", "Whirler", "Slingshot", "%s Catapult"}, - {"Bows", "Shooter", "Archer", "Marks%s", "Crack Shot", "Merry %s"}, - {"Crossbows", "Bolt Thrower", "Quickloader", "Sharpshooter", "Sniper", "%s Arbalest"}, // 10 - {"Darts", "Dart Thrower", "Hurler", "Hedgehog", "Darts Champion", "Perforator"}, - {"Throwing", "Chucker", "Thrower", "Deadly Accurate", "Hawkeye", "%s Ballista"}, - {"Armour", "Covered", "Protected", "Tortoise", "Impregnable", "Invulnerable"}, - {"Dodging", "Ducker", "Nimble", "Spry", "Acrobat", "Intangible"}, - {"Stealth", "Sneak", "Covert", "Unseen", "Imperceptible", "Ninja"}, // 15 - {"Stabbing", "Miscreant", "Blackguard", "Backstabber", "Cutthroat", "Politician"}, - {"Shields", "Shield-Bearer", "Hoplite", "Blocker", "Peltast", "%s Barricade"}, - {"Traps & Doors", "Scout", "Disarmer", "Vigilant", "Perceptive", "Dungeon Master"}, + // Skill name levels 1-7 levels 8-14 levels 15-20 levels 21-26 level 27 + {"Fighting", "Skirmisher", "Fighter", "Warrior", "Slayer", "Conqueror"}, // 0 + {"Short Blades", "Cutter", "Slicer", "Swashbuckler", "Blademaster", "Eviscerator"}, + {"Long Blades", "Slasher", "Carver", "Fencer", "@Genus@ Blade", "Swordmaster"}, + {NULL}, // 3- was: great swords {dlb} + {"Axes", "Chopper", "Cleaver", "Hacker", "Severer", "Executioner"}, + {"Maces & Flails", "Cudgeler", "Basher", "Bludgeoner", "Shatterer", "Skullcrusher"}, // 5 + {"Polearms", "Poker", "Spear-Bearer", "Impaler", "Phalangite", "@Genus@ Porcupine"}, + {"Staves", "Twirler", "Cruncher", "Stickfighter", "Pulverizer", "Chief of Staff"}, + {"Slings", "Vandal", "Slinger", "Whirler", "Slingshot", "@Genus@ Catapult"}, + {"Bows", "Shooter", "Archer", "Marks@genus@", "Crack Shot", "Merry %s"}, + {"Crossbows", "Bolt Thrower", "Quickloader", "Sharpshooter", "Sniper", "@Genus@ Arbalest"}, // 10 + {"Darts", "Dart Thrower", "Hurler", "Hedgehog", "Darts Champion", "Perforator"}, + {"Throwing", "Chucker", "Thrower", "Deadly Accurate", "Hawkeye", "@Genus@ Ballista"}, + {"Armour", "Covered", "Protected", "Tortoise", "Impregnable", "Invulnerable"}, + {"Dodging", "Ducker", "Nimble", "Spry", "Acrobat", "Intangible"}, + {"Stealth", "Sneak", "Covert", "Unseen", "Imperceptible", "Ninja"}, // 15 + {"Stabbing", "Miscreant", "Blackguard", "Backstabber", "Cutthroat", "Politician"}, + {"Shields", "Shield-Bearer", "Hoplite", "Blocker", "Peltast", "@Genus@ Barricade"}, + {"Traps & Doors", "Scout", "Disarmer", "Vigilant", "Perceptive", "Dungeon Master"}, // STR based fighters, for DEX/martial arts titles see below - {"Unarmed Combat", "Ruffian", "Grappler", "Brawler", "Wrestler", "%sweight Champion"}, + {"Unarmed Combat", "Ruffian", "Grappler", "Brawler", "Wrestler", "%sweight Champion"}, - {NULL}, // 20- empty - {NULL}, // 21- empty - {NULL}, // 22- empty - {NULL}, // 23- empty - {NULL}, // 24- empty + {NULL}, // 20- empty + {NULL}, // 21- empty + {NULL}, // 22- empty + {NULL}, // 23- empty + {NULL}, // 24- empty - {"Spellcasting", "Magician", "Thaumaturge", "Eclecticist", "Sorcerer", "Archmage"}, // 25 - {"Conjurations", "Ruinous", "Conjurer", "Destroyer", "Devastator", "Annihilator"}, - {"Enchantments", "Charm-Maker", "Infuser", "Bewitcher", "Enchanter", "Spellbinder"}, - {"Summonings", "Caller", "Summoner", "Convoker", "Demonologist", "Hellbinder"}, - {"Necromancy", "Grave Robber", "Reanimator", "Necromancer", "Thanatomancer", "%s of Death"}, - {"Translocations", "Grasshopper", "Placeless %s", "Blinker", "Portalist", "Plane %s"}, // 30 - {"Transmigration", "Changer", "Transmogrifier", "Alchemist", "Malleable", "Shapeless %s"}, - {"Divinations", "Seer", "Soothsayer", "Diviner", "Augur", "Oracle"}, + {"Spellcasting", "Magician", "Thaumaturge", "Eclecticist", "Sorcerer", "Archmage"}, // 25 + {"Conjurations", "Ruinous", "Conjurer", "Destroyer", "Devastator", "Annihilator"}, + {"Enchantments", "Charm-Maker", "Infuser", "Bewitcher", "Enchanter", "Spellbinder"}, + {"Summonings", "Caller", "Summoner", "Convoker", "Demonologist", "Hellbinder"}, + {"Necromancy", "Grave Robber", "Reanimator", "Necromancer", "Thanatomancer", "%s of Death"}, + {"Translocations", "Grasshopper", "Placeless %s", "Blinker", "Portalist", "Plane %s"}, // 30 + {"Transmigration", "Changer", "Transmogrifier", "Alchemist", "Malleable", "Shapeless %s"}, + {"Divinations", "Seer", "Soothsayer", "Diviner", "Augur", "Oracle"}, - {"Fire Magic", "Firebug", "Arsonist", "Scorcher", "Pyromancer", "Infernalist"}, - {"Ice Magic", "Chiller", "Frost Mage", "Gelid", "Cryomancer", "Englaciator"}, - {"Air Magic", "Gusty", "Cloud Mage", "Aerator", "Anemomancer", "Meteorologist"}, // 35 - {"Earth Magic", "Digger", "Geomancer", "Earth Mage", "Metallomancer", "Petrodigitator"}, - {"Poison Magic", "Stinger", "Tainter", "Polluter", "Contaminator", "Envenomancer"}, + {"Fire Magic", "Firebug", "Arsonist", "Scorcher", "Pyromancer", "Infernalist"}, + {"Ice Magic", "Chiller", "Frost Mage", "Gelid", "Cryomancer", "Englaciator"}, + {"Air Magic", "Gusty", "Cloud Mage", "Aerator", "Anemomancer", "Meteorologist"}, // 35 + {"Earth Magic", "Digger", "Geomancer", "Earth Mage", "Metallomancer", "Petrodigitator"}, + {"Poison Magic", "Stinger", "Tainter", "Polluter", "Contaminator", "Envenomancer"}, - {"Invocations", "Believer", "Agitator", "Worldly Agent", "Theurge", "Avatar"}, // 38 - {"Evocations", "Charlatan", "Prestidigitator", "Fetichist", "Evocator", "Talismancer"}, // 39 + // for titles for godless characters, see below + {"Invocations", "Believer", "Agitator", "Worldly Agent", "Theurge", "Avatar"}, + {"Evocations", "Charlatan", "Prestidigitator", "Fetichist", "Evocator", "Talismancer"}, // 39 /*NOTE: If more skills are added, must change ranges in level_change() in player.cc */ - {NULL}, // 40- empty - {NULL}, // 41- empty - {NULL}, // 42- empty - {NULL}, // 43- empty - {NULL}, // 44- empty - {NULL}, // 45- empty - {NULL}, // 46- empty - {NULL}, // 47- empty - {NULL}, // 48- empty - {NULL} // 49- empty {end of array} + {NULL}, // 40- empty + {NULL}, // 41- empty + {NULL}, // 42- empty + {NULL}, // 43- empty + {NULL}, // 44- empty + {NULL}, // 45- empty + {NULL}, // 46- empty + {NULL}, // 47- empty + {NULL}, // 48- empty + {NULL} // 49- empty {end of array} }; const char *martial_arts_titles[6] = @@ -118,12 +122,11 @@ const char *atheist_inv_titles[6] = {"Invocations", "Unbeliever", "Agnostic", "Dissident", "Heretic", "Apostate"}; -/* Note that this (humans have 100 for all skills) is assumed in the - level_change function in player.cc, if CLASSES is def'd +// The Human aptitude set of 100 for all skills allows to define all other +// species relative to Humans. - 3.10: but it never is, and CLASSES is probably broken now. Anyway, - the Spellcasting skill (25) is actually about 130% of what is shown here. - */ +// Spellcasting and In/Evocations form the exceptions here: +// Spellcasting skill is actually about 130%, the other two about 75%. const int spec_skills[ NUM_SPECIES ][40] = { { // SP_HUMAN (1) @@ -1933,8 +1936,8 @@ if (god == -1) god = you.religion; - // translate skill level into skill ranking {dlb}: - // increment rank by one to "skip" skill name in array {dlb}: + // Translate skill level into skill ranking {dlb}: + // Increment rank by one to "skip" skill name in array {dlb}: const int skill_rank = ((skill_lev <= 7) ? 1 : (skill_lev <= 14) ? 2 : (skill_lev <= 20) ? 3 : @@ -1975,9 +1978,24 @@ } } - const std::string::size_type where = result.find("%s"); + // Replace all occurrences of @genus@ with the player genus. + std::string genus = species_name(you.species, 1, true, false, true); + std::string::size_type where = result.find("@genus@"); if (where != std::string::npos) { + lowercase(genus); + result = replace_all(result, "@genus@", genus); + } + else + { + if (you.species == SP_OGRE_MAGE) + genus = species_name(you.species, 1, true, false, false); + result = replace_all(result, "@Genus@", genus); + } + + where = result.find("%s"); + if (where != std::string::npos) + { if (best_skill == SK_UNARMED_COMBAT) { std::string weightclass = ""; @@ -2020,14 +2038,16 @@ } else if (best_skill == SK_TRANSLOCATIONS && skill_rank == 5) { - result.replace(where, 2, (species == SP_NAGA ? "Slider" - : "Walker")); + result.replace(where, 2, (species == SP_NAGA ? "Slider" : + species == SP_KENKU ? "Glider" + : "Walker")); } else { const bool need_cap = (best_skill != SK_BOWS); - const std::string sp = species_name(static_cast<species_type>(species), - 0, true, need_cap); + const std::string sp = + species_name(static_cast<species_type>(species), 0, true, + need_cap); result.replace(where, 2, sp); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |