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 | |
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')
-rw-r--r-- | crawl-ref/source/main.cc | 2 | ||||
-rw-r--r-- | crawl-ref/source/spells1.cc | 24 | ||||
-rw-r--r-- | crawl-ref/source/spells1.h | 2 | ||||
-rw-r--r-- | crawl-ref/source/traps.cc | 4 |
4 files changed, 19 insertions, 13 deletions
diff --git a/crawl-ref/source/main.cc b/crawl-ref/source/main.cc index f23df365f4..3402701346 100644 --- a/crawl-ref/source/main.cc +++ b/crawl-ref/source/main.cc @@ -2877,7 +2877,7 @@ void world_reacts() manage_clouds(); if (you.duration[DUR_FIRE_SHIELD] > 0) - manage_fire_shield(); + manage_fire_shield(you.time_taken); // Food death check. if (you.is_undead != US_UNDEAD && you.hunger <= 500) 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 diff --git a/crawl-ref/source/spells1.h b/crawl-ref/source/spells1.h index dccf6f543f..ceac072671 100644 --- a/crawl-ref/source/spells1.h +++ b/crawl-ref/source/spells1.h @@ -65,7 +65,7 @@ void stone_scales(int pow); void antimagic(); void identify(int power, int item_slot = -1); -void manage_fire_shield(void); +void manage_fire_shield(int delay); void purification(void); void random_blink(bool, bool override_abyss = false); diff --git a/crawl-ref/source/traps.cc b/crawl-ref/source/traps.cc index 0b9b1f7636..53313da1d5 100644 --- a/crawl-ref/source/traps.cc +++ b/crawl-ref/source/traps.cc @@ -1190,11 +1190,13 @@ void trap_def::shoot_ammo(actor& act, bool was_known) } else { + int repel_turns = you.duration[DUR_REPEL_MISSILES] + / BASELINE_DELAY; // Note that this uses full (not random2limit(foo,40)) // player_evasion. int your_dodge = you.melee_evasion(NULL) - 2 + (random2(you.dex) / 3) - + (you.duration[DUR_REPEL_MISSILES] * 10); + + (repel_turns * 10); // Check if it got past dodging. Deflect Missiles provides // immunity to such traps. |