summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authorStefan O'Rear <stefanor@cox.net>2009-11-02 00:08:28 -0800
committerStefan O'Rear <stefanor@cox.net>2009-11-02 00:08:28 -0800
commit945b0cd6507cb5453e099e0cc245706f70c87d98 (patch)
treebf34de1939ba603929fcfe15c06d7d079a467ab9 /crawl-ref
parent22dc55568b1c6bbc4a3e3e9374acf0a889645810 (diff)
downloadcrawl-ref-945b0cd6507cb5453e099e0cc245706f70c87d98.tar.gz
crawl-ref-945b0cd6507cb5453e099e0cc245706f70c87d98.zip
Implement 'Icemail' mutation for new DS
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/acr.cc10
m---------crawl-ref/source/contrib/freetype0
m---------crawl-ref/source/contrib/sdl-image0
-rw-r--r--crawl-ref/source/defines.h3
-rw-r--r--crawl-ref/source/enum.h4
-rw-r--r--crawl-ref/source/mutation.cc17
-rw-r--r--crawl-ref/source/ouch.cc7
-rw-r--r--crawl-ref/source/output.cc2
-rw-r--r--crawl-ref/source/player.cc5
9 files changed, 47 insertions, 1 deletions
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc
index 7e0da4b3a1..5fe36dfd01 100644
--- a/crawl-ref/source/acr.cc
+++ b/crawl-ref/source/acr.cc
@@ -2122,6 +2122,16 @@ static void _decrement_durations()
else
you.duration[DUR_GOURMAND] = 0;
+ if (you.duration[DUR_ICEMAIL_DEPLETED] > 0)
+ {
+ --you.duration[DUR_ICEMAIL_DEPLETED];
+
+ if (!you.duration[DUR_ICEMAIL_DEPLETED])
+ mpr("Your icy envelope is fully restored.", MSGCH_DURATION);
+
+ you.redraw_armour_class = true;
+ }
+
// Must come before might/haste/berserk.
if (_decrement_a_duration(DUR_BUILDING_RAGE))
go_berserk(false);
diff --git a/crawl-ref/source/contrib/freetype b/crawl-ref/source/contrib/freetype
-Subproject 7874a109a69e517de726d9bea18d2b4b75ded3e
+Subproject d1da3f0151edd9ae677247d65abc9089b07e5a9
diff --git a/crawl-ref/source/contrib/sdl-image b/crawl-ref/source/contrib/sdl-image
-Subproject 8c30f0d79add3b6ef586c8207bec7dc23759856
+Subproject 2462061b9ab636f1c50fb7d3f61d58e7dc7603d
diff --git a/crawl-ref/source/defines.h b/crawl-ref/source/defines.h
index 0a1b8b1e0a..8da0d7cd2b 100644
--- a/crawl-ref/source/defines.h
+++ b/crawl-ref/source/defines.h
@@ -159,6 +159,9 @@ const int GOURMAND_NUTRITION_BASE = 10;
const int CHUNK_BASE_NUTRITION = 1000;
+const int ICEMAIL_MAX = 10;
+const int ICEMAIL_TIME = 300;
+
// The maximum number of abilities any god can have
#define MAX_GOD_ABILITIES 5
diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h
index 89edf64181..59e4ec48fe 100644
--- a/crawl-ref/source/enum.h
+++ b/crawl-ref/source/enum.h
@@ -158,7 +158,7 @@ enum attribute_type
ATTR_DIVINE_DEATH_CHANNEL,
ATTR_TRANSFORMATION,
ATTR_CARD_COUNTDOWN,
- ATTR_NUM_DEMONIC_POWERS,
+ ATTR_NUM_DEMONIC_POWERS, // No longer used - for 0.5 demonspawn
ATTR_WAS_SILENCED, //jmf: added for silenced messages
ATTR_GOD_GIFT_COUNT, //jmf: added to help manage god gift giving
ATTR_DELAYED_FIREBALL, // bwr: reserve fireballs
@@ -1242,6 +1242,7 @@ enum duration_type
DUR_REPEL_STAIRS_CLIMB,
DUR_SLIMIFY,
DUR_TIME_STEP,
+ DUR_ICEMAIL_DEPLETED, // Wait this many turns for full Icemail
NUM_DURATIONS
};
@@ -2416,6 +2417,7 @@ enum mutation_type
MUT_STOCHASTIC_TORMENT_RESISTANCE,
MUT_PASSIVE_MAPPING,
+ MUT_ICEMAIL,
NUM_MUTATIONS,
RANDOM_MUTATION = 100,
diff --git a/crawl-ref/source/mutation.cc b/crawl-ref/source/mutation.cc
index 68dcf7f71a..8ba260a302 100644
--- a/crawl-ref/source/mutation.cc
+++ b/crawl-ref/source/mutation.cc
@@ -1211,6 +1211,13 @@ mutation_def mutation_defs[] = {
"passive mapping"
},
+
+ { MUT_ICEMAIL, 0, 1, false, false,
+ {"A meltable icy envelope protects you from harm (AC+", "", ""},
+ {"An icy envelope takes form around you.", "", ""},
+ {"", "", ""},
+ "icemail"
+ },
};
const mutation_def& get_mutation_def(mutation_type mut)
@@ -2651,6 +2658,16 @@ std::string mutation_name(mutation_type mut, int level, bool colour)
ostr << mdef.have[0] << level << ").";
result = ostr.str();
}
+ else if (mut == MUT_ICEMAIL)
+ {
+ std::ostringstream ostr;
+
+ int amt = ICEMAIL_MAX;
+ amt -= you.duration[DUR_ICEMAIL_DEPLETED] * ICEMAIL_MAX / ICEMAIL_TIME;
+
+ ostr << mdef.have[0] << amt << ").";
+ result = ostr.str();
+ }
else if (result.empty() && level > 0)
result = mdef.have[level - 1];
diff --git a/crawl-ref/source/ouch.cc b/crawl-ref/source/ouch.cc
index 5fd554d40f..8a06b6357e 100644
--- a/crawl-ref/source/ouch.cc
+++ b/crawl-ref/source/ouch.cc
@@ -601,6 +601,13 @@ bool expose_player_to_element(beam_type flavour, int strength)
{
if (you.duration[DUR_CONDENSATION_SHIELD] > 0)
remove_condensation_shield();
+
+ if (you.mutation[MUT_ICEMAIL])
+ {
+ mpr("Your icy envelope dissipates!", MSGCH_DURATION);
+ you.duration[DUR_ICEMAIL_DEPLETED] = ICEMAIL_TIME;
+ you.redraw_armour_class = true;
+ }
}
if (strength <= 0)
diff --git a/crawl-ref/source/output.cc b/crawl-ref/source/output.cc
index 6914326466..03a4eb2fac 100644
--- a/crawl-ref/source/output.cc
+++ b/crawl-ref/source/output.cc
@@ -477,6 +477,8 @@ static void _print_stats_ac(int x, int y)
textcolor(_dur_colour( BLUE, dur_expiring(DUR_STONEMAIL) ));
else if (you.duration[DUR_ICY_ARMOUR] || you.duration[DUR_STONESKIN])
textcolor( LIGHTBLUE );
+ else if (you.duration[DUR_ICEMAIL_DEPLETED] > ICEMAIL_TIME / ICEMAIL_MAX)
+ textcolor( RED );
else
textcolor( HUD_VALUE_COLOUR );
cprintf( "%2d ", player_AC() );
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index 7bd1d6dc25..1e1fa06931 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -2157,6 +2157,11 @@ int player_AC(void)
if (you.duration[DUR_STONESKIN])
AC += 200 + 100 * you.skills[SK_EARTH_MAGIC] / 5; // max 7
+ if (you.mutation[MUT_ICEMAIL])
+ AC += (100 * ICEMAIL_MAX)
+ - (you.duration[DUR_ICEMAIL_DEPLETED] * 100
+ * ICEMAIL_MAX / ICEMAIL_TIME);
+
if (you.attribute[ATTR_TRANSFORMATION] == TRAN_NONE
|| you.attribute[ATTR_TRANSFORMATION] == TRAN_LICH
|| you.attribute[ATTR_TRANSFORMATION] == TRAN_BLADE_HANDS)