Removed a lot of dead code and fixed some minor bugs in wanderer generation.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2840 c06c8d41-db1a-0410-9941-cceddc491573
B5OK4FEITJ6MUT7J76OJJH2TOPTZGG7J7UPIJ6Z6WA5FC526FLTAC WBR247GZY2FDL5EX6P25SKNL3R764R25ZGHHALGQGOIYBJG56UYAC Z6343ZVG2VOE7WOLBS7YLIWJ6XGCRCGJRJLP5WUVRTG7VOIXRRLAC 2PAHDAPDO6PN4FNGB5N7CQNEGHSE3NOGPXYZMIAOJC4VW34FRVOAC TGKAO3VB562WPSNRDP2MHE6FGMIB75A6254APKTIPCO6DHLCFCZAC RGWUYJO74FDGTH22CYSHBKFDGJ4S76WTLIULKPXA4QT5ZCNOB4LQC K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC LABXKXWWQY2V4FUDLGVTDYHXINAP6KRHZDHBQ2FE22FFOEIZPL6QC RPOZZWKG5GLPHVZZ7ZKMKS64ZMV2LDCQSARBJFJ6FZOTOKCQO7FAC 77H4BWWPPGLM3PLZH4QTAJRXIZTSDVNCOKZE223I437FN2UJ34RQC GUXTGUEMZYBRGV5QUAQSJHG3AOIQDWWCDIMOX4LASFJAZVGL2WQAC H7BW6SEIQ57X6V4BM2RX54W42W6BH5XJBAS6FYCYKLQQG43ZMU4QC 5OVWAD2MGK2NT6Q546KW7HZHELVDBBRC2CQX6VZMZF2YVRC7CPVAC SJP5BHX6MFWF3OSQPEF4WUWZWPUGMOVURTT2CUVT6H3A66LETXUAC S4BRP4VHB23F2FCC6BXNAN2MZRVUGW7QMXUEOAVZVGFXKXJPVLLQC SDLKLUNFGVKDS55DDJZCBAVIB7NL3RRYPTACAY65SCUQKV6APFSAC #ifdef USE_SPELLCASTER_AND_RANGER_WANDERER_TEMPLATESstatic void give_random_wand( int slot );static void give_random_scroll( int slot );#endif
#ifdef USE_SPELLCASTER_AND_RANGER_WANDERER_TEMPLATESstatic void give_random_scroll( int slot ){you.inv[ slot ].quantity = 1;you.inv[ slot ].base_type = OBJ_SCROLLS;you.inv[ slot ].plus = 0;you.inv[ slot ].special = 0;switch (random2(8)){case 0:you.inv[ slot ].sub_type = SCR_DETECT_CURSE;break;
case 1:you.inv[ slot ].sub_type = SCR_IDENTIFY;break;case 2:case 3:you.inv[ slot ].sub_type = SCR_BLINKING;break;case 4:you.inv[ slot ].sub_type = SCR_FEAR;break;case 5:you.inv[ slot ].sub_type = SCR_SUMMONING;break;case 6:case 7:default:you.inv[ slot ].sub_type = SCR_TELEPORTATION;break;}}#endif
#ifdef USE_SPELLCASTER_AND_RANGER_WANDERER_TEMPLATESstatic void give_random_wand( int slot ){you.inv[ slot ].quantity = 1;you.inv[ slot ].base_type = OBJ_WANDS;you.inv[ slot ].special = 0;you.inv[ slot ].plus2 = 0;switch (random2(4)){case 0:you.inv[ slot ].sub_type = WAND_SLOWING;you.inv[ slot ].plus = 7 + random2(5);break;case 1:you.inv[ slot ].sub_type = WAND_PARALYSIS;you.inv[ slot ].plus = 5 + random2(4);break;case 2:you.inv[ slot ].sub_type = coinflip() ? WAND_FROST : WAND_FLAME;you.inv[ slot ].plus = 6 + random2(4);break;case 3:you.inv[ slot ].sub_type = WAND_TELEPORTATION;you.inv[ slot ].plus = 3 + random2(4);break;}}#endif
#ifdef USE_SPELLCASTER_AND_RANGER_WANDERER_TEMPLATESelse if (you.skills[ SK_SPELLCASTING ]){// Spellcaster style wanderer// Could only have learned spells in common schools...const int school_list[5] ={ SK_CONJURATIONS,SK_ENCHANTMENTS, SK_ENCHANTMENTS,SK_TRANSLOCATIONS, SK_NECROMANCY };//jmf: Two of those spells are gone due to their munchkinicity.// crush() and arc() are like having good melee capability.// Therefore giving them to "harder" class makes less-than-// zero sense, and they're now gone.const int spell_list[5] ={ SPELL_MAGIC_DART,SPELL_CONFUSING_TOUCH, SPELL_BACKLIGHT,SPELL_APPORTATION, SPELL_ANIMATE_SKELETON };// Choose one of the schools we have at random.int school = SK_SPELLCASTING;int num_schools = 0;for (int i = 0; i < 5; i++){if (you.skills[ school_list[ i ]]){num_schools++;if (one_chance_in( num_schools ))school = i;}}// Magic dart is quite a good spell, so if the player only has// spellcasting and conjurations, we sometimes hold off... and// treat them like an unskilled spellcaster.if (school == SK_SPELLCASTING|| (num_schools == 1 && school == SK_CONJURATIONS && coinflip())){// Not much melee potential and no common spell school,// we'll give the player a dagger.you.inv[0].sub_type = WPN_DAGGER;// ... and a random scrollgive_random_scroll(4);// ... and knowledge of anothergive_random_scroll(5);you.inv[5].quantity = 0;// ... and a wand.give_random_wand(6);}else{// Give them an appropriate spelladd_spell_to_memory( spell_list[ school ] );}}else if (you.skills[ SK_THROWING ] && one_chance_in(3)) // these are rare{// Ranger style wanderer// Rare since starting with a throwing weapon is very good// Create a default launcher template, but the// quantity may be reset to 0 if we don't want one -- bwr// throwing weapons are lowered to -1 to make them// not as good as the one's hunters get, ammo is// also much smaller -- bwrnewgame_make_item(1, EQ_NONE, OBJ_WEAPONS, WPN_BOW, 1, -1, -1);// Create default ammo template (darts) (armour is slot 2)newgame_make_item(4, EQ_NONE, OBJ_MISSILES, MI_DART,10 + roll_dice( 2, 6 ));if (you.skills[ SK_SLINGS ]){// slingers get some extra ammoyou.inv[4].quantity += random2avg(20,5);you.inv[4].sub_type = MI_STONE;you.inv[1].sub_type = WPN_SLING;you.inv[1].plus = 0; // slings aren't so goodyou.inv[1].plus2 = 0; // so we'll make them +0you.inv[3].quantity = 0; // remove potionyou.inv[3].base_type = 0; // forget potionyou.inv[3].sub_type = 0;}else if (you.skills[ SK_BOWS ]){you.inv[4].sub_type = MI_ARROW;you.inv[1].sub_type = WPN_BOW;you.inv[3].quantity = 0; // remove potionyou.inv[3].base_type = 0; // forget potionyou.inv[3].sub_type = 0;// lower throwing skill (useless with arrows anyway)you.skills[SK_THROWING]--;}else if (you.skills[ SK_CROSSBOWS ]){// Hand crossbows want the darts.you.inv[1].sub_type = WPN_HAND_CROSSBOW;you.inv[3].quantity = 0; // remove potionyou.inv[3].base_type = 0; // forget potionyou.inv[3].sub_type = 0;// lower throwing skillyou.skills[SK_THROWING]--;}else{// little extra poisoned darts for throwersyou.inv[4].quantity += random2avg(10,5);set_item_ego_type( you.inv[4], OBJ_MISSILES, SPMSL_POISONED );you.inv[0].sub_type = WPN_DAGGER; // up knife to daggeryou.inv[1].quantity = 0; // remove bow}}#endif
if (keyn == 'a')return JOB_FIGHTER;else if (keyn == 'b')return JOB_WIZARD;else if (keyn == 'c')return JOB_PRIEST;else if (keyn == 'd')return JOB_THIEF;else if (keyn == 'e')return JOB_GLADIATOR;else if (keyn == 'f')return JOB_NECROMANCER;else if (keyn == 'g')return JOB_PALADIN;else if (keyn == 'h')return JOB_ASSASSIN;else if (keyn == 'i')return JOB_BERSERKER;else if (keyn == 'j')return JOB_HUNTER;else if (keyn == 'k')return JOB_CONJURER;else if (keyn == 'l')return JOB_ENCHANTER;else if (keyn == 'm')return JOB_FIRE_ELEMENTALIST;else if (keyn == 'n')return JOB_ICE_ELEMENTALIST;else if (keyn == 'o')return JOB_SUMMONER;else if (keyn == 'p')return JOB_AIR_ELEMENTALIST;else if (keyn == 'q')return JOB_EARTH_ELEMENTALIST;else if (keyn == 'r')return JOB_CRUSADER;else if (keyn == 's')return JOB_DEATH_KNIGHT;else if (keyn == 't')return JOB_VENOM_MAGE;else if (keyn == 'u')return JOB_CHAOS_KNIGHT;else if (keyn == 'v')return JOB_TRANSMUTER;else if (keyn == 'w')return JOB_HEALER;else if (keyn == 'y')return JOB_REAVER;else if (keyn == 'z')return JOB_STALKER;else if (keyn == 'A')return JOB_MONK;else if (keyn == 'B')return JOB_WARPER;else if (keyn == 'C')return JOB_WANDERER;
switch ( keyn ){case 'a': return JOB_FIGHTER;case 'b': return JOB_WIZARD;case 'c': return JOB_PRIEST;case 'd': return JOB_THIEF;case 'e': return JOB_GLADIATOR;case 'f': return JOB_NECROMANCER;case 'g': return JOB_PALADIN;case 'h': return JOB_ASSASSIN;case 'i': return JOB_BERSERKER;case 'j': return JOB_HUNTER;case 'k': return JOB_CONJURER;case 'l': return JOB_ENCHANTER;case 'm': return JOB_FIRE_ELEMENTALIST;case 'n': return JOB_ICE_ELEMENTALIST;case 'o': return JOB_SUMMONER;case 'p': return JOB_AIR_ELEMENTALIST;case 'q': return JOB_EARTH_ELEMENTALIST;case 'r': return JOB_CRUSADER;case 's': return JOB_DEATH_KNIGHT;case 't': return JOB_VENOM_MAGE;case 'u': return JOB_CHAOS_KNIGHT;case 'v': return JOB_TRANSMUTER;case 'w': return JOB_HEALER;case 'y': return JOB_REAVER;case 'z': return JOB_STALKER;case 'A': return JOB_MONK;case 'B': return JOB_WARPER;case 'C': return JOB_WANDERER;}
// Use this is you want the occasional spellcaster or ranger type wanderer// to show up... comment it if you find these types silly or too powerful,// or just want fighter type wanderers.// #define USE_SPELLCASTER_AND_RANGER_WANDERER_TEMPLATES