diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-03-20 15:25:41 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-03-20 15:25:41 +0000 |
commit | 65a1827752741ff89176d491067c9233b8b69275 (patch) | |
tree | 1f59cdafa3689240e418605f6691968d163c740f /crawl-ref/source/fight.cc | |
parent | e719cf2f8c9e2fba065abf62fa77526005dfd414 (diff) | |
download | crawl-ref-65a1827752741ff89176d491067c9233b8b69275.tar.gz crawl-ref-65a1827752741ff89176d491067c9233b8b69275.zip |
Add Elyvilon retribution!
Elyvilon can now...
* imitate minor poison miscasts (flavour, mostly)
* confuse you
* prevent you from hitting monsters
* heal natural monsters you or your friends were about to kill, and
* destroy non-randart weapons/missiles in your inventory
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3749 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/fight.cc')
-rw-r--r-- | crawl-ref/source/fight.cc | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc index cf79b80318..90ff0255cb 100644 --- a/crawl-ref/source/fight.cc +++ b/crawl-ref/source/fight.cc @@ -910,7 +910,16 @@ bool melee_attack::player_aux_unarmed() // XXX We're clobbering did_hit did_hit = false; - if (to_hit >= def->ev || one_chance_in(30)) + + bool ely_block = false; + if (you.religion != GOD_ELYVILON && you.penance[GOD_ELYVILON] + && to_hit >= def->ev && one_chance_in(20)) + { + simple_god_message(" blocks your attack.", GOD_ELYVILON); + ely_block = true; + } + + if (!ely_block && (to_hit >= def->ev || one_chance_in(30))) { if (attack_shield_blocked(true)) continue; @@ -927,6 +936,9 @@ bool melee_attack::player_aux_unarmed() miss_verb.empty()? unarmed_attack.c_str() : miss_verb.c_str(), defender->name(DESC_NOCAP_THE).c_str()); + + if (ely_block) + dec_penance(GOD_ELYVILON, 1 + random2(to_hit - def->ev)); } } |