From b51dc9e9720a5cdb08d240da53948d34bb8a6c5a Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Sat, 28 Mar 2009 19:59:33 +0000 Subject: Xom again: * tweak values for tension and amusement * Xom only laughs about "funny" deaths * gift_timeout rerolling after a bad act depends on its severity * replace the blink effect with position swapping git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9561 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/decks.cc | 69 ++++++----------------------------------------- 1 file changed, 8 insertions(+), 61 deletions(-) (limited to 'crawl-ref/source/decks.cc') diff --git a/crawl-ref/source/decks.cc b/crawl-ref/source/decks.cc index 2e5364414c..659c986278 100644 --- a/crawl-ref/source/decks.cc +++ b/crawl-ref/source/decks.cc @@ -941,7 +941,13 @@ static void _describe_cards(std::vector cards) desc = "No description found."; name = uppercase_first(name); - data << "" << name << "" << EOL << desc << EOL; + data << "" << name << "\n" + << get_linebreak_string(desc, get_number_of_cols()) +#ifdef USE_TILE + // For some reason we need another linebreak here, for the tiles version. + << EOL +#endif + << EOL; } formatted_string fs = formatted_string::parse_string(data.str()); clrscr(); @@ -1422,66 +1428,7 @@ static void _swap_monster_card(int power, deck_rarity_type rarity) if (!mon_to_swap) mpr("You spin around."); else - { - monsters& mon(*mon_to_swap); - const coord_def newpos = mon.pos(); - - // Be nice: no swapping into uninhabitable environments. - if (!you.is_habitable(newpos) || !mon.is_habitable(you.pos())) - { - mpr("You spin around."); - return; - } - - const bool mon_caught = mons_is_caught(&mon); - const bool you_caught = you.attribute[ATTR_HELD]; - - // If it was submerged, it surfaces first. - mon.del_ench(ENCH_SUBMERGED); - - // Pick the monster up. - mgrd(newpos) = NON_MONSTER; - mon.moveto(you.pos()); - - // Plunk it down. - mgrd(mon.pos()) = mon_to_swap->mindex(); - - if (you_caught) - { - check_net_will_hold_monster(&mon); - if (!mon_caught) - you.attribute[ATTR_HELD] = 0; - } - - // Move you to its previous location. - move_player_to_grid(newpos, false, true, true, false); - - if (mon_caught) - { - if (you.body_size(PSIZE_BODY) >= SIZE_GIANT) - { - mpr("The net rips apart!"); - you.attribute[ATTR_HELD] = 0; - int net = get_trapping_net(you.pos()); - if (net != NON_ITEM) - destroy_item(net); - } - else - { - you.attribute[ATTR_HELD] = 10; - mpr("You become entangled in the net!"); - - // Xom thinks this is hilarious if you trap yourself this way. - if (you_caught) - xom_is_stimulated(16); - else - xom_is_stimulated(255); - } - - if (!you_caught) - mon.del_ench(ENCH_HELD, true); - } - } + swap_with_monster(mon_to_swap); } static void _velocity_card(int power, deck_rarity_type rarity) -- cgit v1.2.3-54-g00ecf