summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-ench.cc
diff options
context:
space:
mode:
authorSteve Melenchuk <smelenchuk@gmail.com>2014-01-20 21:11:37 -0700
committerSteve Melenchuk <smelenchuk@gmail.com>2014-01-21 22:11:38 -0700
commita9049cb8c574255e8e86ff79f4fef2572506a0a7 (patch)
treec3a87031704d13296e40000974541cf70ac6a78a /crawl-ref/source/mon-ench.cc
parentaed014cc4cf451338c355e1fe671a21716ddb6b4 (diff)
downloadcrawl-ref-a9049cb8c574255e8e86ff79f4fef2572506a0a7.tar.gz
crawl-ref-a9049cb8c574255e8e86ff79f4fef2572506a0a7.zip
Demonspawn blood saint: Ephemeral Infusion.
Heals allies in LOS temporarily for an average of (2 * HD) hit points, lasting an average of (HD * 10) aut; expiry never kills the beneficiaries.
Diffstat (limited to 'crawl-ref/source/mon-ench.cc')
-rw-r--r--crawl-ref/source/mon-ench.cc36
1 files changed, 35 insertions, 1 deletions
diff --git a/crawl-ref/source/mon-ench.cc b/crawl-ref/source/mon-ench.cc
index 448dc34298..f6de847921 100644
--- a/crawl-ref/source/mon-ench.cc
+++ b/crawl-ref/source/mon-ench.cc
@@ -299,6 +299,21 @@ void monster::add_enchantment_effect(const mon_enchant &ench, bool quiet)
calc_speed();
break;
+ case ENCH_EPHEMERAL_INFUSION:
+ {
+ if (!props.exists("eph_amount"))
+ {
+ int amount = min((ench.degree / 2) + random2avg(ench.degree, 2),
+ max_hit_points - hit_points);
+ if (amount > 0 && heal(amount) && !quiet)
+ simple_monster_message(this, " seems to gain new vigour!");
+ else
+ amount = 0;
+ props["eph_amount"].get_byte() = amount;
+ }
+ break;
+ }
+
default:
break;
}
@@ -887,6 +902,22 @@ void monster::remove_enchantment_effect(const mon_enchant &me, bool quiet)
calc_speed();
break;
+ case ENCH_EPHEMERAL_INFUSION:
+ {
+ int dam = 0;
+ if (props.exists("eph_amount"))
+ {
+ dam = props["eph_amount"].get_byte();
+ props.erase("eph_amount");
+ }
+ dam = min(dam, hit_points - 1);
+ if (dam > 0)
+ hurt(NULL, dam);
+ if (!quiet)
+ simple_monster_message(this, " looks less vigorous.");
+ break;
+ }
+
default:
break;
}
@@ -995,6 +1026,7 @@ void monster::timeout_enchantments(int levels)
case ENCH_OZOCUBUS_ARMOUR: case ENCH_WRETCHED: case ENCH_SCREAMED:
case ENCH_BLIND: case ENCH_WORD_OF_RECALL: case ENCH_INJURY_BOND:
case ENCH_FLAYED: case ENCH_AGILE: case ENCH_FROZEN:
+ case ENCH_EPHEMERAL_INFUSION:
lose_ench_levels(i->second, levels);
break;
@@ -1206,6 +1238,7 @@ void monster::apply_enchantment(const mon_enchant &me)
case ENCH_FIRE_VULN:
case ENCH_AGILE:
case ENCH_FROZEN:
+ case ENCH_EPHEMERAL_INFUSION:
// case ENCH_ROLLING:
decay_enchantment(en);
break;
@@ -2051,7 +2084,7 @@ static const char *enchant_names[] =
"awaken vines", "control_winds", "wind_aided", "summon_capped",
"toxic_radiance", "grasping_roots_source", "grasping_roots",
"iood_charged", "fire_vuln", "tornado_cooldown", "icemail", "agile",
- "frozen", "buggy",
+ "frozen", "ephemeral_infusion", "buggy",
};
static const char *_mons_enchantment_name(enchant_type ench)
@@ -2203,6 +2236,7 @@ int mon_enchant::calc_duration(const monster* mons,
case ENCH_RAISED_MR:
case ENCH_MIRROR_DAMAGE:
case ENCH_DEATHS_DOOR:
+ case ENCH_EPHEMERAL_INFUSION:
cturn = 300 / _mod_speed(25, mons->speed);
break;
case ENCH_SLOW: