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FFJH4HEQHUROLBJEYLOSTBKORAGQ5BEZ7DCKYDQC
FBK5ECMQ6HJSQSN7C3DICKJIRJ3CSO3CHCQ3ONPBKLLSHDGPBQ7QC
HOUSHQ4DQK4MVKTCJ56MKYGYPDTF77HJCFVB5PYV7ALNZZJWFYFQC
VOCEACH7R3X342DNSFRTSN5URHL2YIOKEMGIGE6J2HIMSB5RPNSAC
YFAWC4DXLGL3RXD2UTKVHXEXTMZRM7UDRTRHKWV7HAPNYQBD3OYAC
BRGAZR5AXWC2IALBVXO5SB354IRQEIRHSK55RZPGFI4AGIOD4LUQC
X76YXE6RFL7QY5WL6MSSS44WHVA5FQMDQY3XTYP2UL6UZB4E6XMQC
RVJJOTPIEADHXAPIDZPFCCYJNIR6UGPVNF6YZMW4JBI52G2NSEXQC
O6ZMFKDI3XO2SWPNEYHIPYFDWJR4TVDP5BAATK6LVCVETQID6E7AC
QEX3OFNT4IDUY3FNCPNKXB2RWHXRGEXTQQXB63GMVOTGQQ3IO5TAC
DH3YTI6VVI727SQXO4CXSDCSBG2UN3UAWLFULBGRLBVH22ACRXIAC
SS6TGQMYUEQEFVKYE77VHVQRKSR3ELRQ5Q6VE5KYXZF226OJUSXAC
XUCCWGMXKPIR34BBCCOI67YHI3RST4STDWSDUZTN4B2CJWXQLQ7AC
}
// Returns the medium duration value which is usually announced by a special
// message ("XY is about to time out") or a change of colour in the
// status display.
// Note that these values cannot be relied on when playing since there are
// random decrements precisely to avoid this.
int get_expiration_threshold(duration_type dur)
{
switch (dur)
{
case DUR_REPEL_UNDEAD:
return 4;
case DUR_FIRE_SHIELD:
case DUR_SILENCE: // no message
return 5;
case DUR_DEFLECT_MISSILES:
case DUR_REPEL_MISSILES:
case DUR_REGENERATION:
case DUR_INSULATION:
case DUR_STONEMAIL:
case DUR_SWIFTNESS:
case DUR_INVIS:
case DUR_HASTE:
// The following are not shown in the status lines.
case DUR_ICY_ARMOUR:
case DUR_FORESCRY:
case DUR_CONTROL_TELEPORT:
case DUR_DEATH_CHANNEL:
return 6;
case DUR_LEVITATION:
case DUR_TRANSFORMATION: // not on status
case DUR_DEATHS_DOOR: // not on status
return 10;
// These get no messages when they "flicker".
case DUR_SAGE:
case DUR_BARGAIN:
return 15;
case DUR_CONFUSING_TOUCH:
return 20;
default:
return 0;
}
}
// Is a given duration about to expire?
bool dur_expiring(duration_type dur)
{
const int value = you.duration[dur];
if (value <= 0)
return (false);
return (value <= get_expiration_threshold(dur));
case TRAN_SPIDER:
mpr( "You are in spider-form." );
break;
case TRAN_BAT:
mprf( "You are in %sbat-form.",
you.species == SP_VAMPIRE ? "vampire " : "" );
break;
case TRAN_BLADE_HANDS:
mpr( "You have blades for hands." );
break;
case TRAN_STATUE:
mpr( "You are a statue." );
break;
case TRAN_ICE_BEAST:
mpr( "You are an ice creature." );
break;
case TRAN_DRAGON:
mpr( "You are in dragon-form." );
break;
case TRAN_LICH:
mpr( "You are in lich-form." );
break;
case TRAN_SERPENT_OF_HELL:
mpr( "You are a huge demonic serpent." );
break;
case TRAN_AIR:
mpr( "You are a cloud of diffuse gas." );
break;
std::string text = "";
if ((you.species != SP_VAMPIRE
|| you.attribute[ATTR_TRANSFORMATION] != TRAN_BAT)
&& dur_expiring(DUR_TRANSFORMATION))
{
text = "Expiring: ";
}
switch (you.attribute[ATTR_TRANSFORMATION])
{
case TRAN_SPIDER:
text += "You are in spider-form.";
break;
case TRAN_BAT:
text += "You are in ";
if (you.species == SP_VAMPIRE)
text += "vampire ";
text += "bat-form.";
break;
case TRAN_BLADE_HANDS:
text += "You have blades for hands.";
break;
case TRAN_STATUE:
text += "You are a statue.";
break;
case TRAN_ICE_BEAST:
text += "You are an ice creature.";
break;
case TRAN_DRAGON:
text += "You are in dragon-form.";
break;
case TRAN_LICH:
text += "You are in lich-form.";
break;
case TRAN_SERPENT_OF_HELL:
text += "You are a huge demonic serpent.";
break;
case TRAN_AIR:
text += "You are a cloud of diffuse gas.";
break;
}
mpr(text.c_str());
mprf("You are studying %s.", skill_name(you.sage_bonus_skill));
{
std::string msg = "You are studying ";
msg += skill_name(you.sage_bonus_skill);
msg += ".";
_output_expiring_message(DUR_SAGE, msg.c_str());
}
_output_expiring_message(DUR_BARGAIN, "You get a bargain in shops.");
mpr("You are surrounded by a ring of flames.");
mpr("You are immune to clouds of flame.");
_output_expiring_message(DUR_FIRE_SHIELD,
"You are surrounded by a ring of flames.");
_output_expiring_message(DUR_FIRE_SHIELD,
"You are immune to clouds of flame.");
// These are not so unreasonable anymore now that the new overview screen
// is dumped. When the player dies while paralysed it's important
// information. If so, move them to the front. (jpeg)
if (you.paralysed())
status.push_back("paralysed");
if (you.duration[DUR_PETRIFIED])
status.push_back("petrified");
if (you.duration[DUR_SLEEP])
status.push_back("sleeping");
text += "stone skin, ";
// resistance part already says so
// if (you.duration[DUR_CONTROLLED_FLIGHT])
// text += "control flight, ";
status.push_back("stone skin");
// resistance part already says so
// if (you.duration[DUR_CONTROL_TELEPORT])
// text += "control teleport, ";
// MR output already says so
// if (you.duration[DUR_LOWERED_MR])
// text += "vulnerable to magic, ";
// How exactly did you get to show the status?
// It's not so unreasonable anymore now that the new overview screen is
// dumped. When the player dies while paralysed it's important information.
if (you.paralysed())
text += "paralysed, ";
if (you.duration[DUR_PETRIFIED])
text += "petrified, ";
if (you.duration[DUR_SLEEP])
text += "sleeping, ";
text += "levitating, ";
{
std::string help;
if (wearing_amulet( AMU_CONTROLLED_FLIGHT ))
help += "flying";
else
help += "levitating";
if (dur_expiring(DUR_LEVITATION) && !you.permanent_flight())
help += " (expires)";
status.push_back(help);
}
text += (you.duration[DUR_POISONING] > 10) ? "extremely" :
(you.duration[DUR_POISONING] > 5) ? "very" :
(you.duration[DUR_POISONING] > 3) ? "quite"
: "mildly";
text += " poisoned, ";
std::string help = (you.duration[DUR_POISONING] > 10) ? "extremely" :
(you.duration[DUR_POISONING] > 5) ? "very" :
(you.duration[DUR_POISONING] > 3) ? "quite"
: "mildly";
help += " poisoned";
status.push_back(help);
text += (move_cost < 8) ? "very quick, " :
(move_cost < 10) ? "quick, " :
(move_cost == 10) ? "" :
(move_cost < 13) ? "slow, " : "";
if (move_cost != 10)
{
std::string help = (move_cost < 8) ? "very quick" :
(move_cost < 10) ? "quick" :
(move_cost < 13) ? "slow"
: "";
if (!help.empty())
status.push_back(help);
}
case TRAN_SPIDER:
text += "\nYou are in spider-form.";
break;
case TRAN_BAT:
text += "\nYou are in ";
if (you.species == SP_VAMPIRE)
text += "vampire ";
text += "bat-form.";
break;
case TRAN_BLADE_HANDS:
text += "\nYou have blades for hands.";
break;
case TRAN_STATUE:
text += "\nYou are a statue.";
break;
case TRAN_ICE_BEAST:
text += "\nYou are an ice creature.";
break;
case TRAN_DRAGON:
text += "\nYou are in dragon-form.";
break;
case TRAN_LICH:
text += "\nYou are in lich-form.";
break;
case TRAN_SERPENT_OF_HELL:
text += "\nYou are a huge demonic serpent.";
break;
case TRAN_AIR:
text += "\nYou are a cloud of diffuse gas.";
break;
switch (you.attribute[ATTR_TRANSFORMATION])
{
case TRAN_SPIDER:
text += "\nYou are in spider-form.";
break;
case TRAN_BAT:
text += "\nYou are in ";
if (you.species == SP_VAMPIRE)
text += "vampire ";
text += "bat-form.";
break;
case TRAN_BLADE_HANDS:
text += "\nYou have blades for hands.";
break;
case TRAN_STATUE:
text += "\nYou are a statue.";
break;
case TRAN_ICE_BEAST:
text += "\nYou are an ice creature.";
break;
case TRAN_DRAGON:
text += "\nYou are in dragon-form.";
break;
case TRAN_LICH:
text += "\nYou are in lich-form.";
break;
case TRAN_SERPENT_OF_HELL:
text += "\nYou are a huge demonic serpent.";
break;
case TRAN_AIR:
text += "\nYou are a cloud of diffuse gas.";
break;
}
if ((you.species != SP_VAMPIRE
|| you.attribute[ATTR_TRANSFORMATION] != TRAN_BAT)
&& dur_expiring(DUR_TRANSFORMATION))
{
text += " (Expiring.)";
}
"You float gracefully downwards.",
10, random2(6),
"You are starting to lose your buoyancy!"))
"You float gracefully downwards.",
get_expiration_threshold(DUR_LEVITATION),
random2(6),
"You are starting to lose your buoyancy!"))
you.duration[DUR_DEATHS_DOOR]--;
if (you.duration[DUR_DEATHS_DOOR] == 10)
{
mpr("Your time is quickly running out!", MSGCH_DURATION);
you.duration[DUR_DEATHS_DOOR] -= random2(6);
}
if (you.duration[DUR_DEATHS_DOOR] == 1)
{
mpr("Your life is in your own hands again!", MSGCH_DURATION);
more();
}
_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!");