diff options
author | Charles Otto <ottochar@gmail.com> | 2009-11-15 21:47:16 -0500 |
---|---|---|
committer | Charles Otto <ottochar@gmail.com> | 2009-11-15 23:47:00 -0500 |
commit | 809ee96dad841a541d55401d1ecf7b4c3b7ef05e (patch) | |
tree | b1c0b6486551cf078079313352271e81560ff46c /crawl-ref/source/spells1.cc | |
parent | a647fb948535b182ce98246fc02b600d1990436a (diff) | |
download | crawl-ref-809ee96dad841a541d55401d1ecf7b4c3b7ef05e.tar.gz crawl-ref-809ee96dad841a541d55401d1ecf7b4c3b7ef05e.zip |
Delay adjustments for ring of fire
Update ring of fire's duration, also fix one use of DUR_REPEL I missed
previously.
Diffstat (limited to 'crawl-ref/source/spells1.cc')
-rw-r--r-- | crawl-ref/source/spells1.cc | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/crawl-ref/source/spells1.cc b/crawl-ref/source/spells1.cc index 05c7452fa7..07e730aa1d 100644 --- a/crawl-ref/source/spells1.cc +++ b/crawl-ref/source/spells1.cc @@ -1115,7 +1115,7 @@ void cast_deaths_door(int pow) set_hp( allowed_deaths_door_hp(), false ); deflate_hp( you.hp_max, false ); - you.set_duration(DUR_DEAHTS_DOOR, 10 + random2avg(13, 3) + you.set_duration(DUR_DEATHS_DOOR, 10 + random2avg(13, 3) + (random2(pow) / 10)); if (you.duration[DUR_DEATHS_DOOR] > 25 * BASELINE_DELAY) @@ -1264,11 +1264,7 @@ void extension(int pow) if (you.duration[DUR_FIRE_SHIELD]) { - you.duration[DUR_FIRE_SHIELD] += random2(pow / 20); - - if (you.duration[DUR_FIRE_SHIELD] > 50) - you.duration[DUR_FIRE_SHIELD] = 50; - + you.increase_duration(DUR_FIRE_SHIELD, random2(pow / 20), 50); mpr("Your ring of flames roars with new vigour!"); } @@ -1503,7 +1499,7 @@ void cast_ring_of_flames(int power) you.increase_duration(DUR_FIRE_SHIELD, 5 + (power / 10) + (random2(power) / 5), 50, "The air around you leaps into flame!"); - manage_fire_shield(); + manage_fire_shield(1); } void cast_confusing_touch(int power) @@ -1543,10 +1539,15 @@ bool cast_sure_blade(int power) return (success); } -void manage_fire_shield() +void manage_fire_shield(int delay) { ASSERT(you.duration[DUR_FIRE_SHIELD]); - you.duration[DUR_FIRE_SHIELD]--; + + int old_dur = you.duration[DUR_FIRE_SHIELD]; + + you.duration[DUR_FIRE_SHIELD]-= delay; + if(you.duration[DUR_FIRE_SHIELD] < 0) + you.duration[DUR_FIRE_SHIELD] = 0; if (!you.duration[DUR_FIRE_SHIELD]) { @@ -1554,7 +1555,10 @@ void manage_fire_shield() return; } - if (you.duration[DUR_FIRE_SHIELD] == 5) + int threshold = get_expiration_threshold(DUR_FIRE_SHIELD); + + + if (old_dur > threshold && you.duration[DUR_FIRE_SHIELD] < threshold) mpr("Your ring of flames is guttering out.", MSGCH_WARN); // Place fire clouds all around you |