summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-15 09:21:50 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-15 09:21:50 +0000
commit1b94af7d48228ba637b4b0648ff7adabe521c2c5 (patch)
treef4ba25db86e7d2521f5367beaa1059adeae01ce7 /crawl-ref/source
parent6e5f05d27bd0f6cc12028f970d79f9fc3d2b6ff9 (diff)
downloadcrawl-ref-1b94af7d48228ba637b4b0648ff7adabe521c2c5.tar.gz
crawl-ref-1b94af7d48228ba637b4b0648ff7adabe521c2c5.zip
* Clean up duration handling some more.
* Fix Xom confusing unconfusable monsters (plants!) - Xom may be Xom but even he has to follow some rules. * Add a message for shortlasting durations when cast since they miss out on the "transformation about to time out" message. * Add Eino's description for Death's Door. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8459 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source')
-rw-r--r--crawl-ref/source/acr.cc65
-rw-r--r--crawl-ref/source/dat/descript/spells.txt5
-rw-r--r--crawl-ref/source/mutation.cc26
-rw-r--r--crawl-ref/source/transfor.cc31
-rw-r--r--crawl-ref/source/xom.cc38
5 files changed, 105 insertions, 60 deletions
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc
index ca1e0e33d3..46c5be41f6 100644
--- a/crawl-ref/source/acr.cc
+++ b/crawl-ref/source/acr.cc
@@ -2584,12 +2584,21 @@ static void _prep_input()
}
// Decrement a single duration. Print the message if the duration runs out.
+// At midpoint (defined by get_expiration_threshold() in player.cc)
+// print midmsg and decrease duration by midloss (a randomized amount so as
+// to make it impossible to know the exact remaining duration for sure).
+// NOTE: The maximum possible midloss should be greater than midpoint,
+// otherwise the duration may end in the same turn the warning
+// message is printed which would be a bit late.
static bool _decrement_a_duration(duration_type dur, const char* endmsg = NULL,
- int midpoint = -1, int midloss = 0,
- const char* midmsg = NULL,
- msg_channel_type chan = MSGCH_DURATION )
+ int midloss = 0, const char* midmsg = NULL,
+ msg_channel_type chan = MSGCH_DURATION)
{
+ if (you.duration[dur] < 1)
+ return (false);
+
bool rc = false;
+ const int midpoint = get_expiration_threshold(dur);
if (you.duration[dur] > 1)
{
@@ -2602,7 +2611,11 @@ static bool _decrement_a_duration(duration_type dur, const char* endmsg = NULL,
you.duration[dur] -= midloss;
}
}
- else if (you.duration[dur] == 1)
+
+ // In case midloss caused the duration to end prematurely.
+ // (This really shouldn't happen, else the whole point of the
+ // "begins to time out" message is lost!)
+ if (you.duration[dur] <= 1)
{
if (endmsg)
mpr(endmsg, chan);
@@ -2643,9 +2656,7 @@ static void _decrement_durations()
dec_napalm_player();
if (_decrement_a_duration(DUR_ICY_ARMOUR,
- "Your icy armour evaporates.",
- get_expiration_threshold(DUR_ICY_ARMOUR),
- coinflip(),
+ "Your icy armour evaporates.", coinflip(),
"Your icy armour starts to melt."))
{
you.redraw_armour_class = true;
@@ -2656,19 +2667,16 @@ static void _decrement_durations()
_decrement_a_duration(DUR_REPEL_MISSILES,
"You feel less protected from missiles.",
- get_expiration_threshold(DUR_REPEL_MISSILES),
coinflip(),
"Your repel missiles spell is about to expire...");
_decrement_a_duration(DUR_DEFLECT_MISSILES,
"You feel less protected from missiles.",
- get_expiration_threshold(DUR_DEFLECT_MISSILES),
coinflip(),
"Your deflect missiles spell is about to expire...");
_decrement_a_duration(DUR_REGENERATION,
"Your skin stops crawling.",
- get_expiration_threshold(DUR_REGENERATION),
coinflip(),
"Your skin is crawling a little less now.");
@@ -2748,9 +2756,7 @@ static void _decrement_durations()
|| you.attribute[ATTR_TRANSFORMATION] != TRAN_BAT
|| you.duration[DUR_TRANSFORMATION] <= 5)
{
- if ( _decrement_a_duration(DUR_TRANSFORMATION, NULL,
- get_expiration_threshold(DUR_TRANSFORMATION),
- random2(3),
+ if ( _decrement_a_duration(DUR_TRANSFORMATION, NULL, random2(3),
"Your transformation is almost over.") )
{
untransform();
@@ -2760,25 +2766,20 @@ static void _decrement_durations()
// Must come after transformation duration.
_decrement_a_duration(DUR_BREATH_WEAPON, "You have got your breath back.",
- -1, 0, NULL, MSGCH_RECOVERY);
+ 0, NULL, MSGCH_RECOVERY);
_decrement_a_duration(DUR_REPEL_UNDEAD,
- "Your holy aura fades away.",
- get_expiration_threshold(DUR_REPEL_UNDEAD),
- random2(3),
+ "Your holy aura fades away.", random2(3),
"Your holy aura is starting to fade.");
_decrement_a_duration(DUR_SWIFTNESS,
- "You feel sluggish.",
- get_expiration_threshold(DUR_SWIFTNESS), coinflip(),
+ "You feel sluggish.", coinflip(),
"You start to feel a little slower.");
_decrement_a_duration(DUR_INSULATION,
- "You feel conductive.",
- get_expiration_threshold(DUR_INSULATION), coinflip(),
+ "You feel conductive.", coinflip(),
"You start to feel a little less insulated.");
if (_decrement_a_duration(DUR_STONEMAIL,
"Your scaly stone armour disappears.",
- get_expiration_threshold(DUR_STONEMAIL),
coinflip(),
"Your scaly stone armour is starting "
"to flake away."))
@@ -2789,7 +2790,6 @@ static void _decrement_durations()
if (_decrement_a_duration(DUR_FORESCRY,
"You feel firmly rooted in the present.",
- get_expiration_threshold(DUR_FORESCRY),
coinflip(),
"Your vision of the future begins to falter."))
{
@@ -2799,8 +2799,6 @@ static void _decrement_durations()
if (_decrement_a_duration(DUR_SEE_INVISIBLE) && !player_see_invis())
mpr("Your eyesight blurs momentarily.", MSGCH_DURATION);
- _decrement_a_duration(DUR_SEE_INVISIBLE); // jmf: cute message
- // handled elsewhere
_decrement_a_duration(DUR_TELEPATHY, "You feel less empathic.");
if (_decrement_a_duration(DUR_CONDENSATION_SHIELD))
@@ -2829,14 +2827,12 @@ static void _decrement_durations()
}
_decrement_a_duration(DUR_CONTROL_TELEPORT,
- "You feel uncertain.",
- get_expiration_threshold(DUR_CONTROL_TELEPORT),
- coinflip(), "You start to feel a little uncertain.");
+ "You feel uncertain.", coinflip(),
+ "You start to feel a little uncertain.");
if (_decrement_a_duration(DUR_DEATH_CHANNEL,
- "Your unholy channel expires.",
- get_expiration_threshold(DUR_DEATH_CHANNEL),
- coinflip(), "Your unholy channel is weakening."))
+ "Your unholy channel expires.", coinflip(),
+ "Your unholy channel is weakening."))
{
you.attribute[ATTR_DIVINE_DEATH_CHANNEL] = 0;
}
@@ -2849,8 +2845,7 @@ static void _decrement_durations()
_decrement_a_duration(DUR_SLAYING, "You feel less lethal.");
_decrement_a_duration(DUR_INVIS, "You flicker back into view.",
- get_expiration_threshold(DUR_INVIS), coinflip(),
- "You flicker for a moment.");
+ coinflip(), "You flicker for a moment.");
_decrement_a_duration(DUR_BARGAIN, "You feel less charismatic.");
_decrement_a_duration(DUR_CONF, "You feel less confused.");
@@ -2878,7 +2873,7 @@ static void _decrement_durations()
"The bond with your blade fades away." );
if ( _decrement_a_duration(DUR_MESMERISED, "You break out of your daze.",
- -1, 0, NULL, MSGCH_RECOVERY ))
+ 0, NULL, MSGCH_RECOVERY ))
{
you.mesmerised_by.clear();
}
@@ -2988,7 +2983,6 @@ static void _decrement_durations()
{
if (_decrement_a_duration(DUR_LEVITATION,
"You float gracefully downwards.",
- get_expiration_threshold(DUR_LEVITATION),
random2(6),
"You are starting to lose your buoyancy!"))
{
@@ -3058,7 +3052,6 @@ static void _decrement_durations()
else
_decrement_a_duration(DUR_DEATHS_DOOR,
"Your life is in your own hands again!",
- get_expiration_threshold(DUR_DEATHS_DOOR),
random2(6),
"Your time is quickly running out!");
}
diff --git a/crawl-ref/source/dat/descript/spells.txt b/crawl-ref/source/dat/descript/spells.txt
index d535cbf5d4..93596b23ea 100644
--- a/crawl-ref/source/dat/descript/spells.txt
+++ b/crawl-ref/source/dat/descript/spells.txt
@@ -173,7 +173,10 @@ This spell raises living creatures slain by the caster into a state of unliving
%%%%
Death's Door
-This spell is extremely powerful, but carries a degree of risk. It renders living casters nigh invulnerable to harm for a brief period, but can bring them dangerously close to death (how close depends on one's necromantic abilities). The spell can be cancelled at any time by any healing effect, and the caster will receive one warning shortly before the spell expires. Undead cannot use this spell.
+This spell is extremely powerful, but carries a degree of risk. It renders living casters nigh invulnerable to harm for a brief period, but
+can bring them dangerously close to death. So close in fact, that the body believes itself to be dead - healing effects will confuse and paralyze the caster, while cancelling the spell.
+
+The caster will receive one warning shortly before the spell expires. Being more skilled at Necromancy leaves the caster more resilent. Undead cannot use this spell.
%%%%
Debugging Ray
diff --git a/crawl-ref/source/mutation.cc b/crawl-ref/source/mutation.cc
index ff31ad660b..cf14fe0572 100644
--- a/crawl-ref/source/mutation.cc
+++ b/crawl-ref/source/mutation.cc
@@ -1218,15 +1218,23 @@ formatted_string describe_mutations()
break;
case SP_VAMPIRE:
+ have_any = true;
if (you.hunger_state == HS_STARVING)
result += "<green>You do not heal.</green>" EOL;
+ else if (you.hunger_state == HS_ENGORGED)
+ result += "<green>Your natural rate of healing is extremely fast.</green>" EOL;
else if (you.hunger_state <= HS_HUNGRY)
result += "<green>You heal slowly.</green>" EOL;
else if (you.hunger_state >= HS_FULL)
result += "<green>Your natural rate of healing is unusually fast.</green>" EOL;
- else if (you.hunger_state == HS_ENGORGED)
- result += "<green>Your natural rate of healing is extremely fast.</green>" EOL;
- have_any = true;
+ else
+ have_any = false;
+
+ if (you.experience_level >= 6)
+ {
+ result += "You can bottle blood from corpses with 'c'." EOL;
+ have_any = true;
+ }
break;
default:
@@ -1257,17 +1265,17 @@ formatted_string describe_mutations()
textcolor(LIGHTGREY);
- // first add (non-removable) inborn abilities and demon powers
+ // First add (non-removable) inborn abilities and demon powers.
for (int i = 0; i < NUM_MUTATIONS; i++)
{
- // mutation is actually a demonic power
+ // Mutation is actually a demonic power.
if (you.mutation[i] != 0 && you.demon_pow[i])
{
mutation_type mut_type = static_cast<mutation_type>(i);
have_any = true;
- // these are already handled above:
+ // These are already handled above:
if (you.species == SP_NAGA
&& (i == MUT_BREATHE_POISON || i == MUT_FAST
|| i == MUT_DEFORMED))
@@ -1288,13 +1296,13 @@ formatted_string describe_mutations()
fully_inactive = _mutation_is_fully_inactive(mut_type);
const char* colourname = "";
- if ( you.species == SP_DEMONSPAWN )
+ if (you.species == SP_DEMONSPAWN)
{
if (fully_inactive)
colourname = "darkgrey";
else if (!fully_active)
colourname = "yellow";
- else if ( you.demon_pow[i] < you.mutation[i] )
+ else if (you.demon_pow[i] < you.mutation[i])
colourname = "lightred";
else
colourname = "red";
@@ -1305,7 +1313,7 @@ formatted_string describe_mutations()
colourname = "darkgrey";
else if (!fully_active)
colourname = "blue";
- else if ( you.demon_pow[i] < you.mutation[i] )
+ else if (you.demon_pow[i] < you.mutation[i])
colourname = "cyan";
else
colourname = "lightblue";
diff --git a/crawl-ref/source/transfor.cc b/crawl-ref/source/transfor.cc
index 2737cdecf5..c245c27cbd 100644
--- a/crawl-ref/source/transfor.cc
+++ b/crawl-ref/source/transfor.cc
@@ -409,6 +409,15 @@ size_type player::transform_size(int psize) const
}
}
+static void _transformation_expiration_warning()
+{
+ if (you.duration[DUR_TRANSFORMATION]
+ <= get_expiration_threshold(DUR_TRANSFORMATION))
+ {
+ mpr("You have a feeling this form won't last long.");
+ }
+}
+
// Transforms you into the specified form. If quiet is true, fails silently
// (if it fails).
bool transform(int pow, transformation_type which_trans, bool quiet)
@@ -507,6 +516,8 @@ bool transform(int pow, transformation_type which_trans, bool quiet)
you.symbol = 's';
you.colour = BROWN;
+
+ _transformation_expiration_warning();
return (true);
case TRAN_BAT:
@@ -535,7 +546,10 @@ bool transform(int pow, transformation_type which_trans, bool quiet)
you.symbol = 'b';
you.colour = (you.species == SP_VAMPIRE ? DARKGREY : LIGHTGREY);
- return (true);
+
+ if (you.species != SP_VAMPIRE)
+ _transformation_expiration_warning();
+ return (true);
case TRAN_ICE_BEAST: // also AC +3, cold +3, fire -1, pois +1
if (_check_for_cursed_equipment(rem_stuff, which_trans, quiet))
@@ -562,6 +576,8 @@ bool transform(int pow, transformation_type which_trans, bool quiet)
you.symbol = 'I';
you.colour = WHITE;
+
+ _transformation_expiration_warning();
return (true);
case TRAN_BLADE_HANDS:
@@ -580,6 +596,8 @@ bool transform(int pow, transformation_type which_trans, bool quiet)
if (you.duration[ DUR_TRANSFORMATION ] > 100)
you.duration[ DUR_TRANSFORMATION ] = 100;
+
+ _transformation_expiration_warning();
return (true);
case TRAN_STATUE: // also AC +20, ev -5, elec +1, pois +1, neg +1, slow
@@ -616,6 +634,8 @@ bool transform(int pow, transformation_type which_trans, bool quiet)
you.symbol = '8';
you.colour = LIGHTGREY;
+
+ _transformation_expiration_warning();
return (true);
case TRAN_DRAGON: // also AC +10, ev -3, cold -1, fire +2, pois +1, flight
@@ -657,6 +677,8 @@ bool transform(int pow, transformation_type which_trans, bool quiet)
if (net != NON_ITEM)
destroy_item(net);
}
+
+ _transformation_expiration_warning();
return (true);
case TRAN_LICH:
@@ -714,6 +736,8 @@ bool transform(int pow, transformation_type which_trans, bool quiet)
you.is_undead = US_UNDEAD;
you.hunger_state = HS_SATIATED; // no hunger effects while transformed
set_redraw_status( REDRAW_HUNGER );
+
+ _transformation_expiration_warning();
return (true);
case TRAN_AIR:
@@ -751,6 +775,8 @@ bool transform(int pow, transformation_type which_trans, bool quiet)
if (net != NON_ITEM)
remove_item_stationary(mitm[net]);
}
+
+ _transformation_expiration_warning();
return (true);
case TRAN_SERPENT_OF_HELL:
@@ -778,7 +804,10 @@ bool transform(int pow, transformation_type which_trans, bool quiet)
you.symbol = 'S';
you.colour = RED;
+
+ _transformation_expiration_warning();
return (true);
+
case TRAN_NONE:
case NUM_TRANSFORMATIONS:
break;
diff --git a/crawl-ref/source/xom.cc b/crawl-ref/source/xom.cc
index 1d10b81805..bec45e8d9e 100644
--- a/crawl-ref/source/xom.cc
+++ b/crawl-ref/source/xom.cc
@@ -771,16 +771,21 @@ static bool _xom_is_good(int sever, int tension)
{
monster = &menv[i];
- if (monster->type == -1 || !mons_near(monster) || mons_wont_attack(monster) || one_chance_in(20))
+ if (monster->type == -1 || !mons_near(monster)
+ || mons_wont_attack(monster)
+ || !mons_class_is_confusable(monster->type)
+ || one_chance_in(20))
+ {
continue;
+ }
if (monster->add_ench(mon_enchant(ENCH_CONFUSION, 0, KC_FRIENDLY, random2(sever))))
{
if (!done)
god_speaks(GOD_XOM, _get_xom_speech("confusion").c_str());
+
+ simple_monster_message(monster, " looks rather confused.");
done = true;
- if (player_monster_visible( monster ))
- simple_monster_message(monster, " looks rather confused.");
}
}
}
@@ -970,16 +975,17 @@ static bool _xom_is_good(int sever, int tension)
if (!done)
god_speaks(GOD_XOM, _get_xom_speech("rearrange the pieces").c_str());
- done = true;
-
if (confusem)
{
- if (monster->add_ench(mon_enchant(ENCH_CONFUSION, 0, KC_FRIENDLY, random2(sever))))
+ if (mons_class_is_confusable(monster->type)
+ && monster->add_ench(mon_enchant(ENCH_CONFUSION, 0,
+ KC_FRIENDLY, random2(sever))))
{
- if (player_monster_visible(monster))
- simple_monster_message(monster, " looks rather confused.");
+ simple_monster_message(monster,
+ " looks rather confused.");
}
}
+ done = true;
}
// If he blinked at least one monster, blink the player,
@@ -991,7 +997,7 @@ static bool _xom_is_good(int sever, int tension)
else if (x_chance_in_y(11, sever) && (you.level_type != LEVEL_ABYSS))
{
// The Xom teleportation train takes you on instant teleportation to
- // a few random areas, stopping randomly but mostly likely in an area
+ // a few random areas, stopping randomly but most likely in an area
// that is not dangerous to you.
god_speaks(GOD_XOM, _get_xom_speech("teleportation journey").c_str());
do
@@ -1722,12 +1728,18 @@ static bool _xom_is_bad(int sever, int tension)
{
monster = &menv[i];
- if (monster->type == -1 || !mons_near(monster) || one_chance_in(20))
+ if (monster->type == -1 || !mons_near(monster)
+ || !mons_class_is_confusable(monster->type)
+ || one_chance_in(20))
+ {
continue;
+ }
- if (monster->add_ench(mon_enchant(ENCH_CONFUSION, 0, KC_FRIENDLY, random2(sever)))) {
- if (player_monster_visible(monster))
- simple_monster_message(monster, " looks rather confused.");
+ if (monster->add_ench(mon_enchant(ENCH_CONFUSION, 0,
+ KC_FRIENDLY, random2(sever))))
+ {
+ simple_monster_message(monster,
+ " looks rather confused.");
}
}
}