diff options
author | Chris Oelmueller <chris.oelmueller@gmail.com> | 2014-04-10 01:06:32 +0200 |
---|---|---|
committer | Nicholas Feinberg <pleasingfung@gmail.com> | 2014-06-13 23:41:47 -0700 |
commit | 6537abdd850278128eb7b5d4954eba2d7d0a5526 (patch) | |
tree | 527c10ebda198a195aa04a4692427aec6b9d3c85 /crawl-ref/source/tags.cc | |
parent | 1b4b79b5505598c32d5aabc183851e8b556b74dd (diff) | |
download | crawl-ref-6537abdd850278128eb7b5d4954eba2d7d0a5526.tar.gz crawl-ref-6537abdd850278128eb7b5d4954eba2d7d0a5526.zip |
Combine plus/plus2 for rings of slaying, and Acc+/Dam+ on artefacts
Phase out ARTP_ACCURACY, rename ARTP_DAMAGE to ARTP_SLAYING which now
combines both Acc+ and Dam+ bonuses.
Bracers of archery are +4 now instead of +5,+3.
[Committer's note: fixed a description and cleaned up various other
small issues.]
Diffstat (limited to 'crawl-ref/source/tags.cc')
-rw-r--r-- | crawl-ref/source/tags.cc | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/crawl-ref/source/tags.cc b/crawl-ref/source/tags.cc index a1334a006a..ca3ea01e45 100644 --- a/crawl-ref/source/tags.cc +++ b/crawl-ref/source/tags.cc @@ -3822,6 +3822,32 @@ void unmarshallItem(reader &th, item_def &item) } } + // Combine old rings of slaying (Acc/Dam) to new (Dam). + // Also handle the changes to the respective ARTP_. + if (th.getMinorVersion() < TAG_MINOR_SLAYRING_PLUSES) + { + int acc, dam, slay = 0; + + if (is_artefact(item)) + { + acc = artefact_wpn_property(item, ARTP_ACCURACY); + dam = artefact_wpn_property(item, ARTP_SLAYING); + slay = dam < 0 ? dam : max(acc, dam); + + artefact_set_property(item, ARTP_SLAYING, slay); + } + + if (item.base_type == OBJ_JEWELLERY && item.sub_type == RING_SLAYING) + { + acc = item.plus; + dam = item.plus2; + slay = dam < 0 ? dam : max(acc, dam); + + item.plus = slay; + item.plus2 = 0; + } + } + #endif if (is_unrandom_artefact(item)) |