git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1819 c06c8d41-db1a-0410-9941-cceddc491573
35KOQQV4ZBNNIAXGKPOYHOWTN7RBQY7HRZTVMR3WAS4GOYFBM6PQC SS6MUIJYTGIVBYU356Z563QJWLJ47QNHSJWS7GJTS7EATZH2ESJQC KFULGQQOHWUTXOM3BXCCYPGGVGGY4Z6265XUFRCBPNLTZAEHJZSQC RPOZZWKG5GLPHVZZ7ZKMKS64ZMV2LDCQSARBJFJ6FZOTOKCQO7FAC K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC 3KAINFIXO7WNWGUGZB43EUNFRS2ZPBLQZDTY456QACMRHYIJ7WDAC JIMH7VEMQ7QF6VV2D65UISCRG5W55UX5YSQLLUW6SZNSTZMFWQ5AC XUCCWGMXKPIR34BBCCOI67YHI3RST4STDWSDUZTN4B2CJWXQLQ7AC WVFKGV3AMOYUZ53MWH2RWRITRRCPKKNPTO7QASA5WVKWAUGDJ2OQC DH3YTI6VVI727SQXO4CXSDCSBG2UN3UAWLFULBGRLBVH22ACRXIAC SJXOZ6J66G3S5VYGIZ3YHEUCKUF5554YEFUYLVBH7X4ALYSXKTGQC coord_def pick_adjacent_free_square(int x, int y){int num_ok = 0;coord_def result(-1, -1);for ( int ux = x-1; ux <= x+1; ++ux ){for ( int uy = y-1; uy <= y+1; ++uy ){if ( ux == x && uy == y )continue;if ( ux >= 0 && ux < GXM && uy >= 0 && uy < GYM &&grd[ux][uy] == DNGN_FLOOR && mgrd[ux][uy] == NON_MONSTER ){++num_ok;if ( one_chance_in(num_ok) )result.set(ux, uy);}}}return result;}
// XXX not yet implemented
const int power_level = get_power_level(power, rarity);bool done_stuff = false;if ( power_level >= 2 ){// XXX FIXME Vaults not implemented// generate a vault}else if ( power_level == 1 ){if (coinflip()){// Create a random bad statue// This could be really bad, because it's placed adjacent// to you...const monster_type statues[] = {MONS_ORANGE_STATUE, MONS_SILVER_STATUE, MONS_ICE_STATUE};const monster_type mons = RANDOM_ELEMENT(statues);if ( create_monster(mons, 0, BEH_HOSTILE, you.x_pos, you.y_pos,MHITYOU, 250) != -1 ){mpr("A menacing statue appears!");done_stuff = true;}}else{coord_def pos = pick_adjacent_free_square(you.x_pos, you.y_pos);if ( pos.x >= 0 && pos.y >= 0 ){const dungeon_feature_type statfeat[] = {DNGN_GRANITE_STATUE, DNGN_ORCISH_IDOL};// We leave the items on the squaregrd[pos.x][pos.y] = RANDOM_ELEMENT(statfeat);mpr("A statue takes form beside you.");done_stuff = true;}}}else{// generate an altarif ( grd[you.x_pos][you.y_pos] == DNGN_FLOOR ){// might get GOD_NO_GOD and no altargrd[you.x_pos][you.y_pos] =altar_for_god(static_cast<god_type>(random2(NUM_GODS)));if ( grd[you.x_pos][you.y_pos] != DNGN_FLOOR ){done_stuff = true;mpr("An altar grows from the floor before you!");}}}if ( !done_stuff )mprf("Nothing appears to happen.", power_level);
case CARD_SPADE:// XXX not yet implementedmpr("Sorry, this card is not yet available.");break;
case CARD_TROWEL: trowel_card(power, rarity); break;case CARD_SPADE: your_spells(SPELL_DIG, random2(power/4), false); break;