summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/transfor.cc
diff options
context:
space:
mode:
authorCharles Otto <ottochar@gmail.com>2009-11-15 14:39:35 -0500
committerCharles Otto <ottochar@gmail.com>2009-11-15 23:46:45 -0500
commit0da3322c570c3e94859b94fe3bc747c01d1e1364 (patch)
tree88d0cc79fac060d6f02046eab87dece4c9286c8c /crawl-ref/source/transfor.cc
parent01e5123d492ba9292a52960031c18d8069d25d83 (diff)
downloadcrawl-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/transfor.cc')
-rw-r--r--crawl-ref/source/transfor.cc7
1 files changed, 2 insertions, 5 deletions
diff --git a/crawl-ref/source/transfor.cc b/crawl-ref/source/transfor.cc
index ae5f5e1221..c81574ef0d 100644
--- a/crawl-ref/source/transfor.cc
+++ b/crawl-ref/source/transfor.cc
@@ -559,10 +559,7 @@ bool transform(int pow, transformation_type which_trans, bool force,
mpr("You feel you'll be a pig longer.");
else
mpr("You extend your transformation's duration.");
- you.duration[DUR_TRANSFORMATION] += random2(pow) * BASELINE_DELAY;
-
- if (you.duration[DUR_TRANSFORMATION] > 100 * BASELINE_DELAY)
- you.duration[DUR_TRANSFORMATION] = 100 * BASELINE_DELAY;
+ you.increase_duration(DUR_TRANSFORMATION, random2(pow), 100);
return (true);
}
@@ -756,7 +753,7 @@ bool transform(int pow, transformation_type which_trans, bool force,
// Update your status.
you.attribute[ATTR_TRANSFORMATION] = which_trans;
- you.duration[DUR_TRANSFORMATION] = dur * BASELINE_DELAY;
+ you.set_duration(DUR_TRANSFORMATION, dur);
you.symbol = symbol;
you.colour = colour;