From 9f751c796fa4ca1c22e66d4f31f293c0ea1955b6 Mon Sep 17 00:00:00 2001 From: dolorous Date: Fri, 18 Sep 2009 06:52:42 +0000 Subject: Implement part of [2837033]: Randomize colors, resistances, and attack types/flavors for ugly things. They now use the ghost_demon struct, expanded to account for these characteristics. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10709 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/tags.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'crawl-ref/source/tags.cc') diff --git a/crawl-ref/source/tags.cc b/crawl-ref/source/tags.cc index 5db90d707d..4d133247f1 100644 --- a/crawl-ref/source/tags.cc +++ b/crawl-ref/source/tags.cc @@ -2453,11 +2453,14 @@ static void marshallGhost(writer &th, const ghost_demon &ghost) marshallShort(th, ghost.speed); marshallByte(th, ghost.see_invis); marshallShort(th, ghost.brand); + marshallShort(th, ghost.att_type); + marshallShort(th, ghost.att_flav); marshallResists(th, ghost.resists); marshallByte(th, ghost.spellcaster); marshallByte(th, ghost.cycle_colours); + marshallByte(th, ghost.colour); marshallShort(th, ghost.fly); marshallSpells(th, ghost.spells); @@ -2486,10 +2489,20 @@ static ghost_demon unmarshallGhost(reader &th, char minorVersion) ghost.see_invis = unmarshallByte(th); ghost.brand = static_cast( unmarshallShort(th) ); + if (minorVersion >= TAG_MINOR_UGLY) + { + ghost.att_type = static_cast( unmarshallShort(th) ); + ghost.att_flav = static_cast( unmarshallShort(th) ); + } + unmarshallResists(th, ghost.resists); ghost.spellcaster = unmarshallByte(th); ghost.cycle_colours = unmarshallByte(th); + + if (minorVersion >= TAG_MINOR_UGLY) + ghost.colour = unmarshallByte(th); + ghost.fly = static_cast( unmarshallShort(th) ); unmarshallSpells(th, ghost.spells); -- cgit v1.2.3-54-g00ecf