summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-05-26 17:40:43 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-05-26 17:40:43 +0000
commit417903c52d17d0366f4dc2cfba89424b3455dbf2 (patch)
treeb5786f30a57dbb30acd8563bdf11edbeb1a86b73 /crawl-ref/source
parent16287466f10a261173b68b61cec77f6472039879 (diff)
downloadcrawl-ref-417903c52d17d0366f4dc2cfba89424b3455dbf2.tar.gz
crawl-ref-417903c52d17d0366f4dc2cfba89424b3455dbf2.zip
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. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5262 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source')
-rw-r--r--crawl-ref/source/enum.h7
-rw-r--r--crawl-ref/source/items.cc34
-rw-r--r--crawl-ref/source/monstuff.cc9
-rw-r--r--crawl-ref/source/player.cc12
-rw-r--r--crawl-ref/source/player.h4
-rw-r--r--crawl-ref/source/skills2.cc156
6 files changed, 128 insertions, 94 deletions
diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h
index f49633c301..3ded9f9b4a 100644
--- a/crawl-ref/source/enum.h
+++ b/crawl-ref/source/enum.h
@@ -2263,7 +2263,7 @@ enum shop_type // (unsigned char) env.sh_type[], item_in_shop(), in_a_shop()
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 @@ enum skill_type
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,
diff --git a/crawl-ref/source/items.cc b/crawl-ref/source/items.cc
index f1f2915a0a..f97806f52e 100644
--- a/crawl-ref/source/items.cc
+++ b/crawl-ref/source/items.cc
@@ -344,10 +344,8 @@ int get_item_slot( int reserve )
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 @@ void unlink_item( int dest )
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 @@ void unlink_item( int dest )
// 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 @@ void destroy_item( item_def &item, bool never_created )
}
}
- // paranoia, shouldn't be needed
+ // Paranoia, shouldn't be needed.
item.clear();
}
@@ -1099,19 +1097,25 @@ std::string origin_desc(const item_def &item)
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 @@ void move_item_stack_to_grid( int x, int y, int targ_x, int targ_y )
}
-// 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 @@ bool copy_item_to_grid( const item_def &item, int x_plos, int y_plos,
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 @@ bool copy_item_to_grid( const item_def &item, int x_plos, int y_plos,
}
}
- // 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 @@ bool copy_item_to_grid( const item_def &item, int x_plos, int y_plos,
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 @@ bool copy_item_to_grid( const item_def &item, int x_plos, int y_plos,
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]);
}
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index 7f586238b1..887ffe8987 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -321,6 +321,7 @@ static void _place_monster_corpse(const monsters *monster)
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 @@ static void _place_monster_corpse(const monsters *monster)
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()
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index 21f45ae029..7ee82d0959 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -4034,11 +4034,16 @@ int str_to_species(const std::string &species)
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 @@ std::string species_name(species_type speci, int level, bool genus, bool adj)
// 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;
diff --git a/crawl-ref/source/player.h b/crawl-ref/source/player.h
index ed7c244819..664d2c7a05 100644
--- a/crawl-ref/source/player.h
+++ b/crawl-ref/source/player.h
@@ -79,8 +79,8 @@ bool wearing_amulet(char which_am, bool calc_unid = true);
/* ***********************************************************************
* 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);
/* ***********************************************************************
diff --git a/crawl-ref/source/skills2.cc b/crawl-ref/source/skills2.cc
index 5110c4f98b..e3d7f6555d 100644
--- a/crawl-ref/source/skills2.cc
+++ b/crawl-ref/source/skills2.cc
@@ -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"},
-
- {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"},
-
- {"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
+ {"Unarmed Combat", "Ruffian", "Grappler", "Brawler", "Wrestler", "%sweight Champion"},
+
+ {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"},
+
+ {"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"},
+
+ // 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 *martial_arts_titles[6] =
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 @@ std::string skill_title( unsigned char best_skill, unsigned char skill_lev,
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,7 +1978,22 @@ std::string skill_title( unsigned char best_skill, unsigned char skill_lev,
}
}
- 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)
@@ -2020,14 +2038,16 @@ std::string skill_title( unsigned char best_skill, unsigned char skill_lev,
}
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);
}
}