They need balancing, of course. Only the Spade, dancing weapon, and Blade to go, I think…
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1662 c06c8d41-db1a-0410-9941-cceddc491573
SJXOZ6J66G3S5VYGIZ3YHEUCKUF5554YEFUYLVBH7X4ALYSXKTGQC EWQIUA5WOC7YATFBBYEC4FM3V36MPM44EEDIMR4NU2DEUCSB2GSAC WVFKGV3AMOYUZ53MWH2RWRITRRCPKKNPTO7QASA5WVKWAUGDJ2OQC JP7SVXCIKEPVDD4Q5CDYDATPK7X5XOYW3T6QK2Y6EWHFH52LBK3QC K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC DH3YTI6VVI727SQXO4CXSDCSBG2UN3UAWLFULBGRLBVH22ACRXIAC XUCCWGMXKPIR34BBCCOI67YHI3RST4STDWSDUZTN4B2CJWXQLQ7AC 3KAINFIXO7WNWGUGZB43EUNFRS2ZPBLQZDTY456QACMRHYIJ7WDAC void summon_animals(int pow){// maybe we should just generate a Lair monster instead? (and// guarantee that it is mobile)const monster_type animals[] = {MONS_BUMBLEBEE, MONS_WAR_DOG, MONS_SHEEP, MONS_YAK,MONS_HOG, MONS_SOLDIER_ANT, MONS_WOLF,MONS_GRIZZLY_BEAR, MONS_POLAR_BEAR, MONS_BLACK_BEAR,MONS_GIANT_SNAIL, MONS_BORING_BEETLE, MONS_GILA_MONSTER,MONS_KOMODO_DRAGON, MONS_SPINY_FROG, MONS_HOUND};int num_so_far = 0;int power_left = pow + 1;while ( power_left >= 0 && num_so_far < 8 ){// pick a random monster and subtract its costmonster_type mon_chosen = animals[random2(ARRAYSIZE(animals))];const int power_cost = mons_power(mon_chosen) * 3;// allow a certain degree of overuse, but not too muchif ( power_cost >= power_left * 2 &&num_so_far > 0 ) // at least one monster, in any casebreak;power_left -= power_cost;num_so_far++;if ( random2(pow) < 5 ) // unfriendlycreate_monster( mon_chosen, 4, BEH_HOSTILE,you.x_pos, you.y_pos, MHITYOU, 250 );elsecreate_monster( mon_chosen, 4, BEH_FRIENDLY,you.x_pos, you.y_pos, you.pet_target, 250 );}}
}static void summon_any_monster(int power, deck_rarity_type rarity){const int power_level = get_power_level(power, rarity);monster_type mon_chosen = NUM_MONSTERS;int chosen_x, chosen_y;int num_tries;if ( power_level == 0 )num_tries = 1;else if ( power_level == 1 )num_tries = 4;elsenum_tries = 18;for ( int i = 0; i < num_tries; ++i ) {int dx, dy;do {dx = random2(3) - 1;dy = random2(3) - 1;} while ( dx == 0 && dy == 0 );monster_type cur_try;do {cur_try = random_monster_at_grid(you.x_pos + dx, you.y_pos + dy);} while ( mons_is_unique(cur_try) );if ( mon_chosen == NUM_MONSTERS ||mons_power(mon_chosen) < mons_power(cur_try) ){mon_chosen = cur_try;chosen_x = you.x_pos;chosen_y = you.y_pos;}}if ( mon_chosen == NUM_MONSTERS ) // should never happenreturn;if ( power_level == 0 && one_chance_in(4) )create_monster( mon_chosen, 3, BEH_HOSTILE,chosen_x, chosen_y, MHITYOU, 250 );elsecreate_monster( mon_chosen, 3, BEH_FRIENDLY,chosen_x, chosen_y, you.pet_target, 250 );