From 891c1a9ccb6579006040af82a2e050dcdff73513 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Mon, 8 Dec 2008 11:59:07 +0000 Subject: Apply Artificer patch, with small modifications: * Artificers start with a knife unless their second wand is a supporting one (confusion, enslavement) in which case they get a dagger. * Enslavement only has 6 charges. * Centaurs and Ghouls are restricted, as well. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7781 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/enum.h | 3 +- crawl-ref/source/itemname.cc | 2 +- crawl-ref/source/itemname.h | 5 ++ crawl-ref/source/newgame.cc | 152 +++++++++++++++++++++++++++++++++++++++++-- crawl-ref/source/view.cc | 2 - 5 files changed, 154 insertions(+), 10 deletions(-) (limited to 'crawl-ref/source') diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h index 4523d77359..e35290b58a 100644 --- a/crawl-ref/source/enum.h +++ b/crawl-ref/source/enum.h @@ -1075,7 +1075,7 @@ enum dungeon_feature_type DNGN_PERMADRY_FOUNTAIN, DNGN_ABANDONED_SHOP, - NUM_REAL_FEATURES, // 207 + NUM_REAL_FEATURES, // 208 // Real terrain must all occur before 256 to guarantee it fits // into the unsigned char used for the grid! @@ -1416,6 +1416,7 @@ enum job_type JOB_MONK, // 25 JOB_WARPER, JOB_WANDERER, // 27 + JOB_ARTIFICER, // 28 -Greenberg/Bane NUM_JOBS, // always after the last job JOB_UNKNOWN = 100 diff --git a/crawl-ref/source/itemname.cc b/crawl-ref/source/itemname.cc index e63611b2cc..46bc2c6cd4 100644 --- a/crawl-ref/source/itemname.cc +++ b/crawl-ref/source/itemname.cc @@ -378,7 +378,7 @@ static const char* armour_ego_name( special_armour_type sparm, bool terse ) } } -static const char* wand_type_name(int wandtype) +const char* wand_type_name(int wandtype) { switch (static_cast(wandtype)) { diff --git a/crawl-ref/source/itemname.h b/crawl-ref/source/itemname.h index 54060663a0..baab01e6b7 100644 --- a/crawl-ref/source/itemname.h +++ b/crawl-ref/source/itemname.h @@ -139,4 +139,9 @@ item_types_pair item_types_by_name(std::string name); std::vector item_name_list_for_glyph(unsigned glyph); +/* *********************************************************************** + * called from: newgame + * *********************************************************************** */ +const char* wand_type_name(int wandtype); + #endif diff --git a/crawl-ref/source/newgame.cc b/crawl-ref/source/newgame.cc index 4126748058..20fa84eaa7 100644 --- a/crawl-ref/source/newgame.cc +++ b/crawl-ref/source/newgame.cc @@ -187,7 +187,8 @@ static job_type old_jobs_order[] = { JOB_CHAOS_KNIGHT, JOB_TRANSMUTER, JOB_HEALER, JOB_REAVER, JOB_STALKER, JOB_MONK, - JOB_WARPER, JOB_WANDERER + JOB_WARPER, JOB_WANDERER, + JOB_ARTIFICER }; // First plain fighters, then religious fighters, then spell-casting @@ -210,7 +211,8 @@ static job_type new_jobs_order[] = { // poison specialists and stabbers JOB_VENOM_MAGE, JOB_STALKER, JOB_THIEF, JOB_ASSASSIN, - JOB_HUNTER, JOB_WANDERER + JOB_HUNTER, JOB_ARTIFICER, + JOB_WANDERER }; static job_type _get_class(const int index) @@ -308,7 +310,7 @@ int get_species_by_abbrev( const char *abbrev ) static const char * Class_Abbrev_List[ NUM_JOBS ] = { "Fi", "Wz", "Pr", "Th", "Gl", "Ne", "Pa", "As", "Be", "Hu", "Cj", "En", "FE", "IE", "Su", "AE", "EE", "Cr", "DK", "VM", - "CK", "Tm", "He", "Re", "St", "Mo", "Wr", "Wn" }; + "CK", "Tm", "He", "Re", "St", "Mo", "Wr", "Wn", "Ar" }; static const char * Class_Name_List[ NUM_JOBS ] = { "Fighter", "Wizard", "Priest", "Thief", "Gladiator", "Necromancer", @@ -316,7 +318,7 @@ static const char * Class_Name_List[ NUM_JOBS ] = "Fire Elementalist", "Ice Elementalist", "Summoner", "Air Elementalist", "Earth Elementalist", "Crusader", "Death Knight", "Venom Mage", "Chaos Knight", "Transmuter", "Healer", "Reaver", "Stalker", - "Monk", "Warper", "Wanderer" }; + "Monk", "Warper", "Wanderer", "Artificer" }; int get_class_index_by_abbrev( const char *abbrev ) { @@ -1822,6 +1824,20 @@ static char_choice_restriction _class_allowed(species_type speci, return (CC_UNRESTRICTED); } + case JOB_ARTIFICER: + switch (speci) + { + case SP_CENTAUR: + case SP_TROLL: + case SP_MINOTAUR: + case SP_OGRE: + case SP_MUMMY: + case SP_GHOUL: + return (CC_RESTRICTED); + default: + return (CC_UNRESTRICTED); + } + case JOB_WANDERER: return (CC_RESTRICTED); @@ -2019,7 +2035,7 @@ static bool _choose_book( item_def& book, int firstbook, int numbooks ) textcolor( CYAN ); cprintf(EOL "You have a choice of books: " - "(Press %% for a list of aptitudes)" EOL); + "(Press %% for a list of aptitudes)" EOL); for (int i = 0; i < numbooks; ++i) { @@ -2304,7 +2320,7 @@ static bool _choose_weapon() textcolor( CYAN ); cprintf(EOL "You have a choice of weapons: " - "(Press %% for a list of aptitudes)" EOL); + "(Press %% for a list of aptitudes)" EOL); bool prevmatch = false; for (int i = 0; i < num_choices; i++) @@ -2731,6 +2747,8 @@ static void _jobs_stat_init(job_type which_job) case JOB_NECROMANCER: s = 0; i = 6; d = 4; hp = 10; mp = 3; break; case JOB_WANDERER: s = 2; i = 2; d = 2; hp = 11; mp = 1; break; + + case JOB_ARTIFICER: s = 3; i = 3; d = 4; hp = 13; mp = 0; break; default: s = 0; i = 0; d = 0; hp = 10; mp = 0; break; } @@ -2856,6 +2874,9 @@ static void _give_basic_knowledge(job_type which_job) set_ident_type( OBJ_POTIONS, POT_POISON, ID_KNOWN_TYPE ); break; + case JOB_ARTIFICER: + set_ident_type( OBJ_SCROLLS, SCR_RECHARGING, ID_KNOWN_TYPE ); + default: break; } @@ -4177,6 +4198,96 @@ bool _needs_butchering_tool() return (true); } +static bool _choose_wand() +{ + // Wand-choosing interface for Artificers -- Greenberg/Bane + + const wand_type startwand[5] = { WAND_ENSLAVEMENT, WAND_CONFUSION, + WAND_MAGIC_DARTS, WAND_FROST, WAND_FLAME }; + const int num_choices = 5; + + int keyin = 0; + if (!Options.random_pick) + { + _print_character_info(); + + textcolor( CYAN ); + cprintf(EOL "You have a choice of wands: " + "(Press %% for a list of aptitudes)" EOL); + + for (int i = 0; i < num_choices; i++) + { + textcolor(LIGHTGREY); + + const char letter = 'a' + i; + cprintf("%c - %s" EOL, letter, wand_type_name(startwand[i])); + } + + textcolor(BROWN); + cprintf(EOL "* - Random choice; " + "Bksp - Back to species and class selection; " + "X - Quit" EOL); + + cprintf(EOL); + + do + { + textcolor( CYAN ); + cprintf(EOL "Which wand? "); + textcolor( LIGHTGREY ); + + keyin = c_getch(); + + switch (keyin) + { + case 'X': + cprintf(EOL "Goodbye!"); + end(0); + break; + case CK_BKSP: + case CK_ESCAPE: + case ' ': + return (false); + case '\r': + case '%': + list_commands('%'); + return _choose_wand(); + default: + break; + } + } + while (keyin != '*' && (keyin < 'a' || keyin >= ('a' + num_choices))); + } + + if (Options.random_pick || keyin == '*') + { + keyin = random2(num_choices); + keyin += 'a'; + } + + const wand_type choice = startwand[keyin - 'a']; + int nCharges; + switch (choice) + { + case WAND_MAGIC_DARTS: + case WAND_ENSLAVEMENT: + nCharges = 6; + break; + case WAND_FROST: + case WAND_FLAME: + nCharges = 7; + break; + default: + nCharges = 8; + break; + } + + _newgame_make_item(3, EQ_NONE, OBJ_WANDS, choice, -1, 1, + nCharges, 0); + + return (true); +} + bool _give_items_skills() { char keyn; @@ -5293,6 +5404,35 @@ bool _give_items_skills() _create_wanderer(); break; + case JOB_ARTIFICER: + // Equipment. Knife and armor or robe. + _newgame_make_item(0, EQ_WEAPON, OBJ_WEAPONS, WPN_KNIFE); + _newgame_make_item(1, EQ_BODY_ARMOUR, OBJ_ARMOUR, + ARM_LEATHER_ARMOUR, ARM_ROBE); + // 1 wand of random effects and one chosen lesser wand + _newgame_make_item(2, EQ_NONE, OBJ_WANDS, WAND_RANDOM_EFFECTS, -1, 1, + 6, 0); + // Choice of lesser wands: confusion (8), enslavement (8), + // slowing (8), magic dart (6), frost (7), flame (7) + if (!_choose_wand()) + return (false); + + // If a supporting wand was chosen, hand out a dagger instead of + // the knife. + if (you.inv[3].sub_type == WAND_CONFUSION + || you.inv[3].sub_type == WAND_ENSLAVEMENT) + { + you.inv[0].sub_type = WPN_DAGGER; + } + + // Skills + you.skills[SK_EVOCATIONS] = 4; + you.skills[SK_TRAPS_DOORS] = 3; + //you.skills[SK_CROSSBOWS] = 2; + you.skills[SK_DODGING] = 2; + you.skills[SK_FIGHTING] = 1; + break; + default: break; } diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc index 935db3a3ef..aea3359687 100644 --- a/crawl-ref/source/view.cc +++ b/crawl-ref/source/view.cc @@ -2817,14 +2817,12 @@ bool is_feature(int feature, const coord_def& where) case DNGN_ENTER_PORTAL_VAULT: case DNGN_EXIT_PORTAL_VAULT: case DNGN_ENTER_SHOP: - case DNGN_ABANDONED_SHOP: case DNGN_ENTER_DIS: case DNGN_ENTER_GEHENNA: case DNGN_ENTER_COCYTUS: case DNGN_ENTER_TARTARUS: case DNGN_ENTER_ABYSS: case DNGN_EXIT_ABYSS: - case DNGN_STONE_ARCH: case DNGN_ENTER_PANDEMONIUM: case DNGN_EXIT_PANDEMONIUM: case DNGN_TRANSIT_PANDEMONIUM: -- cgit v1.2.3-54-g00ecf