From 9f14dc6980b319b84fddd26d1338c21726356c6f Mon Sep 17 00:00:00 2001 From: haranp Date: Fri, 4 Apr 2008 13:01:06 +0000 Subject: Added Flight card to Deck of Emergency. Artefacts yield 2 piety instead of 1. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4070 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/branch.cc | 6 ++++++ crawl-ref/source/branch.h | 1 + crawl-ref/source/decks.cc | 30 ++++++++++++++++++++++++++++++ crawl-ref/source/decks.h | 5 +++-- crawl-ref/source/religion.cc | 5 ++++- 5 files changed, 44 insertions(+), 3 deletions(-) (limited to 'crawl-ref') diff --git a/crawl-ref/source/branch.cc b/crawl-ref/source/branch.cc index 1cfa5fe251..728ce416ff 100644 --- a/crawl-ref/source/branch.cc +++ b/crawl-ref/source/branch.cc @@ -10,6 +10,7 @@ #include "cloud.h" #include "externs.h" #include "mon-pick.h" +#include "place.h" #include "player.h" #include "spells3.h" #include "traps.h" @@ -19,6 +20,11 @@ Branch& your_branch() return branches[you.where_are_you]; } +bool at_branch_bottom() +{ + return your_branch().depth == player_branch_depth(); +} + branch_type str_to_branch(const std::string &branch, branch_type err) { for (int i = 0; i < NUM_BRANCHES; ++i) diff --git a/crawl-ref/source/branch.h b/crawl-ref/source/branch.h index 0598f31247..3427537cfc 100644 --- a/crawl-ref/source/branch.h +++ b/crawl-ref/source/branch.h @@ -58,6 +58,7 @@ struct Branch extern Branch branches[]; Branch& your_branch(); +bool at_branch_bottom(); branch_type str_to_branch(const std::string &branch, branch_type err = NUM_BRANCHES); diff --git a/crawl-ref/source/decks.cc b/crawl-ref/source/decks.cc index ee3fb21958..952028b4a3 100644 --- a/crawl-ref/source/decks.cc +++ b/crawl-ref/source/decks.cc @@ -91,6 +91,7 @@ const deck_archetype deck_of_emergency[] = { { CARD_DAMNATION, {0, 1, 2} }, { CARD_SOLITUDE, {5, 5, 5} }, { CARD_WARPWRIGHT, {5, 5, 5} }, + { CARD_FLIGHT, {5, 5, 5} }, END_OF_DECK }; @@ -290,6 +291,7 @@ const char* card_name(card_type card) case CARD_FAMINE: return "Famine"; case CARD_FEAST: return "the Feast"; case CARD_WARPWRIGHT: return "Warpwright"; + case CARD_FLIGHT: return "Flight"; case CARD_VITRIOL: return "Vitriol"; case CARD_FLAME: return "Flame"; case CARD_FROST: return "Frost"; @@ -1445,6 +1447,33 @@ static void _warpwright_card(int power, deck_rarity_type rarity) } } +static void _flight_card(int power, deck_rarity_type rarity) +{ + const int power_level = get_power_level(power, rarity); + + if ( power_level == 0 ) + transform(random2(power/4), coinflip() ? TRAN_SPIDER : TRAN_BAT); + if ( power_level >= 1 ) + { + cast_fly(random2(power/4)); + cast_swiftness(random2(power/4)); + } + if ( power_level == 2 ) + { + if (is_valid_shaft_level() && grd[you.x_pos][you.y_pos] == DNGN_FLOOR) + { + if ( place_specific_trap(you.x_pos, you.y_pos, TRAP_SHAFT) ) + { + const int i = trap_at_xy(you.x_pos, you.y_pos); + grd[you.x_pos][you.y_pos] = trap_category(env.trap[i].type); + mpr("A shaft materializes beneath you!"); + } + } + } + if ( one_chance_in(4 - power_level) ) + potion_effect(POT_INVISIBILITY, random2(power)/4); +} + static void _minefield_card(int power, deck_rarity_type rarity) { const int power_level = get_power_level(power, rarity); @@ -2497,6 +2526,7 @@ bool card_effect(card_type which_card, deck_rarity_type rarity, case CARD_GENIE: _genie_card(power, rarity); break; case CARD_CURSE: _curse_card(power, rarity); break; case CARD_WARPWRIGHT: _warpwright_card(power, rarity); break; + case CARD_FLIGHT: _flight_card(power, rarity); break; case CARD_TOMB: entomb(power); break; case CARD_WRAITH: drain_exp(false); lose_level(); break; case CARD_WRATH: _godly_wrath(); break; diff --git a/crawl-ref/source/decks.h b/crawl-ref/source/decks.h index 89f24235a8..2245a60d79 100644 --- a/crawl-ref/source/decks.h +++ b/crawl-ref/source/decks.h @@ -65,8 +65,9 @@ enum card_type CARD_BANSHEE, // "the scream" CARD_DAMNATION, // banishment CARD_SOLITUDE, // dispersal - CARD_WARPWRIGHT, // create teleport trap - + CARD_WARPWRIGHT, // create teleport trap + CARD_FLIGHT, + CARD_VITRIOL, // acid damage CARD_FLAME, // fire damage CARD_FROST, // cold damage diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index 7568d06b40..9d92c5e623 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -4388,7 +4388,10 @@ void offer_items() // when you have low piety. || value/2 >= random2(30 + you.piety/2)) { - gain_piety(1); + if ( is_artefact(item) ) + gain_piety(2); + else + gain_piety(1); gained_piety = true; } -- cgit v1.2.3-54-g00ecf