god_smites_you().
This fixes a problem where you could worship Beogh, draw the Wrath card to make him smite you, and have him possibly protect you from his own smiting. The smiting code in beogh_idol_revenge() wouldn't allow this, but the smiting code in beogh_retribution() would.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2906 c06c8d41-db1a-0410-9941-cceddc491573
RRNEVUYOK5S4M4QH77N34IXSSNUXVQAIZQLXAQKQCRITMPUKGP6AC
NLQNXH3SVJ52CWXEV35FSSZP32VHC4QFGN3HINF4KO5GZHZMOBKQC
RLN5WLM2K5U6QBIBWBLK5XTDD3MPPXXXOVPUT33JKOQF3PHF6WZQC
Y3TBP4UVQ6GM53J64HGTLPC3WKN3EAJEW2L7XBRBUHYAP6POBQUAC
K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC
E42EFZ3RINKLTGOJJZAH2N5QF3P4S5NCO5T52HLXJRMBPP463HTAC
XUCCWGMXKPIR34BBCCOI67YHI3RST4STDWSDUZTN4B2CJWXQLQ7AC
JW2KRJHES33W7UTWZ6NDO4TLMK4EFU4HKZXBWR2UJOMPCCOTR4CQC
SWOYPTHJAWFEDBMB3ROT33VQZIXGZD5UOXEV456DDUENW2HGA66QC
L4PKJZERR7WADKWHY3MR6J6OZFREVPL3CB43I6MLJ2BVKWCUTE7AC
74LQ7JXVLAFSHLI7LCBKFX47CNTYSKGUQSXNX5FCIUIGCC2JTR3QC
RPOZZWKG5GLPHVZZ7ZKMKS64ZMV2LDCQSARBJFJ6FZOTOKCQO7FAC
XMX2Y7QSEXGV2SPDOFDNM2BQJH3S3WTMYLJYUREYV72NWTURHMSQC
V4DWL5WBO2JCODVS5QQNWXDH4DAYZN3D5V3UDCHM2KKOMADOTEDQC
6A3UHWB2EORRGBKEWCL2SPBH2BGCYRWWPNKCQLGFJHOLEQZLTFLAC
{
if (!player_under_penance() && you.piety > random2(400))
{
snprintf(info, INFO_SIZE, "Mortal, I have averted the wrath "
"of %s... this time.", god_name(god));
god_speaks(you.religion, info);
}
else
{
int divine_hurt = 10 + random2(10);
for (int i = 0; i < 5; i++)
divine_hurt += random2( you.experience_level );
simple_god_message( " smites you!", god );
ouch( divine_hurt, 0, KILLED_BY_TSO_SMITING );
dec_penance( god, 1 );
}
}
god_smites_you(GOD_SHINING_ONE, KILLED_BY_TSO_SMITING);
{
if (!player_under_penance() && you.piety > random2(400))
{
snprintf(info, INFO_SIZE, "Mortal, I have averted the wrath "
"of %s... this time.", god_name(god));
god_speaks(you.religion, info);
}
else
{
int divine_hurt = 10 + random2(10);
for (int i = 0; i < 5; i++)
divine_hurt += random2( you.experience_level );
simple_god_message( " smites you!", god );
ouch( divine_hurt, 0, KILLED_BY_BEOGH_SMITING );
dec_penance( god, 1 );
}
god_smites_you(GOD_BEOGH, KILLED_BY_BEOGH_SMITING);
snprintf(info, INFO_SIZE, "Mortal, I have averted the wrath "
"of %s... this time.", god_name(GOD_BEOGH));
god_speaks(you.religion, info);
const char* messages[3] = {
"Beogh fumes, \"This is no small sin, orc. Repent!\"",
"Beogh whispers, \"You will pay for this transgression.\"",
"Beogh rages, \"An eye for an eye...\""
};
revenge = RANDOM_ELEMENT(messages);
if (you.religion == GOD_BEOGH)
{
const char* messages[3] = {
" fumes, \"This is no small sin, orc. Repent!\"",
" whispers, \"You will pay for this transgression.\"",
" rages, \"An eye for an eye...\""
};
simple_god_message(RANDOM_ELEMENT(messages), GOD_BEOGH);
}
else if (you.species == SP_HILL_ORC)
{
const char* messages[2] = {
"Beogh's voice booms out: \"Heretic, die!\"",
"You hear Beogh's thundering voice: \"Suffer, infidel!\""
};
god_speaks(GOD_BEOGH, RANDOM_ELEMENT(messages));
}
else
{
const char* messages[2] = {
" is not amused about the destruction of his idols.",
" seems highly displeased."
};
simple_god_message(RANDOM_ELEMENT(messages), GOD_BEOGH);
}
const char* messages[2] = {
"Beogh's voice booms out: \"Heretic, die!\"",
"You hear Beogh's thundering voice: \"Suffer, infidel!\""
};
void god_smites_you(god_type god, kill_method_type death_type,
const char *message)
{
// Your god won't protect you from his own smiting, and Xom is too
// capricious to protect you from any god's smiting.
if (you.religion != god && you.religion != GOD_XOM &&
!player_under_penance() && you.piety > random2(400))
{
snprintf(info, INFO_SIZE, "Mortal, I have averted the wrath "
"of %s... this time.", god_name(god));
god_speaks(you.religion, info);
}
else
{
// If there's a message, display it before smiting.
if (message)
god_speaks(god, message);
int divine_hurt = 10 + random2(10);
for (int i = 0; i < 5; i++)
divine_hurt += random2( you.experience_level );
simple_god_message( " smites you!", god );
ouch( divine_hurt, 0, death_type );
dec_penance( god, 1 );
}
}