summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/tags.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-07-10 19:35:05 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-07-10 19:35:05 +0000
commiteae61da171bd07d54eb09775a244257411359221 (patch)
tree488fae4fa0bce9a941ce789d65cb38d962e211d3 /crawl-ref/source/tags.cc
parent68f11497c4e4cc2ea402ac135f833a41565d6a65 (diff)
downloadcrawl-ref-eae61da171bd07d54eb09775a244257411359221.tar.gz
crawl-ref-eae61da171bd07d54eb09775a244257411359221.zip
Monster enchantment overhaul:
* Enchantment degree is converted into duration up-front. The average enchantment duration should be nearly the same as before, but we guarantee minimum durations on enchantments. Enchantment duration variance is much less, needs testing to see whether this makes enchantments and summoning too strong. * Enchantments that rely on degree (like poison, sticky flame) still use it. * Durations are now based on individual movement ticks, not turns (10 ticks = 1 normal player turn). * Breaks saves, abjuration doesn't work (will fix). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1828 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/tags.cc')
-rw-r--r--crawl-ref/source/tags.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/crawl-ref/source/tags.cc b/crawl-ref/source/tags.cc
index 8b779c0995..c4d039134f 100644
--- a/crawl-ref/source/tags.cc
+++ b/crawl-ref/source/tags.cc
@@ -1426,6 +1426,8 @@ static void marshall_mon_enchant(tagHeader &th, const mon_enchant &me)
marshallShort(th, me.ench);
marshallShort(th, me.degree);
marshallShort(th, me.who);
+ marshallShort(th, me.duration);
+ marshallShort(th, me.maxduration);
}
static mon_enchant unmarshall_mon_enchant(tagHeader &th)
@@ -1434,6 +1436,8 @@ static mon_enchant unmarshall_mon_enchant(tagHeader &th)
me.ench = static_cast<enchant_type>( unmarshallShort(th) );
me.degree = unmarshallShort(th);
me.who = static_cast<kill_category>( unmarshallShort(th) );
+ me.duration = unmarshallShort(th);
+ me.maxduration = unmarshallShort(th);
return (me);
}
@@ -1455,7 +1459,7 @@ static void marshall_monster(tagHeader &th, const monsters &m)
for (mon_enchant_list::const_iterator i = m.enchantments.begin();
i != m.enchantments.end(); ++i)
{
- marshall_mon_enchant(th, *i);
+ marshall_mon_enchant(th, i->second);
}
marshallShort(th, m.type);
@@ -1612,7 +1616,10 @@ static void unmarshall_monster(tagHeader &th, monsters &m)
m.enchantments.clear();
const int nenchs = unmarshallShort(th);
for (int i = 0; i < nenchs; ++i)
- m.enchantments.insert( unmarshall_mon_enchant(th) );
+ {
+ mon_enchant me = unmarshall_mon_enchant(th);
+ m.enchantments[me.ench] = me;
+ }
m.type = unmarshallShort(th);
m.hit_points = unmarshallShort(th);