diff options
author | Charles Otto <ottochar@gmail.com> | 2009-11-15 14:39:35 -0500 |
---|---|---|
committer | Charles Otto <ottochar@gmail.com> | 2009-11-15 23:46:45 -0500 |
commit | 0da3322c570c3e94859b94fe3bc747c01d1e1364 (patch) | |
tree | 88d0cc79fac060d6f02046eab87dece4c9286c8c /crawl-ref/source/abl-show.cc | |
parent | 01e5123d492ba9292a52960031c18d8069d25d83 (diff) | |
download | crawl-ref-0da3322c570c3e94859b94fe3bc747c01d1e1364.tar.gz crawl-ref-0da3322c570c3e94859b94fe3bc747c01d1e1364.zip |
On second thought abstract increasing/setting durations a little.
Add (and use) player methods for setting/increasing durations.
Diffstat (limited to 'crawl-ref/source/abl-show.cc')
-rw-r--r-- | crawl-ref/source/abl-show.cc | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/crawl-ref/source/abl-show.cc b/crawl-ref/source/abl-show.cc index 8680f76495..7c38f70b67 100644 --- a/crawl-ref/source/abl-show.cc +++ b/crawl-ref/source/abl-show.cc @@ -1316,7 +1316,7 @@ static bool _do_ability(const ability_def& abil) else { zapping(ZAP_SPIT_POISON, pow, beam); - you.duration[DUR_BREATH_WEAPON] = (3 + random2(5)) * BASELINE_DELAY; + you.set_duration(DUR_BREATH_WEAPON, 3 + random2(5) ); } break; } @@ -1421,10 +1421,8 @@ static bool _do_ability(const ability_def& abil) if (abil.ability != ABIL_SPIT_ACID) { - you.duration[DUR_BREATH_WEAPON] = - 3 + random2(4) + random2(30 - you.experience_level) / 2; - - you.duration[DUR_BREATH_WEAPON] *= BASELINE_DELAY; + you.increase_duration(DUR_BREATH_WEAPON, + 3 + random2(4) + random2(30 - you.experience_level) / 2); if (abil.ability == ABIL_BREATHE_STEAM) you.duration[DUR_BREATH_WEAPON] /= 2; @@ -1546,7 +1544,7 @@ static bool _do_ability(const ability_def& abil) case ABIL_END_TRANSFORMATION: mpr("You feel almost normal."); - you.duration[DUR_TRANSFORMATION] = 2 * BASELINE_DELAY; + you.set_duration(DUR_TRANSFORMATION, 2); break; // INVOCATIONS: @@ -2025,12 +2023,9 @@ static bool _do_ability(const ability_def& abil) } mprf(MSGCH_DURATION, "A thick mucus forms on %s.", msg.c_str()); - int addition = you.skills[SK_INVOCATIONS] * 3 / 2 + 3; - - you.duration[DUR_SLIMIFY] += addition * BASELINE_DELAY; - - if (you.duration[DUR_SLIMIFY] > 100 * BASELINE_DELAY) - you.duration[DUR_SLIMIFY] = 100 * BASELINE_DELAY; + you.increase_duration(DUR_SLIMIFY, + you.skills[SK_INVOCATIONS] * 3 / 2 + 3, + 100); exercise(SK_INVOCATIONS, 3 + random2(5)); break; |