diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-09-20 14:21:49 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-09-20 14:21:49 +0000 |
commit | 7f87a01c11f21ffa4dbb9660268eaa88494237ae (patch) | |
tree | e8bcab90531f6bff227b329365e3766cb31c2b94 | |
parent | 1db426b1b8d3fcfa2122dee47290597bcd63ee91 (diff) | |
download | crawl-ref-7f87a01c11f21ffa4dbb9660268eaa88494237ae.tar.gz crawl-ref-7f87a01c11f21ffa4dbb9660268eaa88494237ae.zip |
Remove guaranteed acid resistance for acid-flavored (very) ugly things,
and add rotting resistance for rotting-flavored very ugly things.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10741 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r-- | crawl-ref/source/ghost.cc | 79 |
1 files changed, 49 insertions, 30 deletions
diff --git a/crawl-ref/source/ghost.cc b/crawl-ref/source/ghost.cc index 05a4cac72a..334a05d125 100644 --- a/crawl-ref/source/ghost.cc +++ b/crawl-ref/source/ghost.cc @@ -506,6 +506,7 @@ void ghost_demon::init_ugly_thing(bool very_ugly, bool only_mutate) resists.cold = 0; resists.acid = 0; resists.sticky_flame = false; + resists.rotting = false; // An ugly thing gets one random resistance. ugly_thing_add_resistance(); @@ -562,45 +563,63 @@ void ghost_demon::ugly_thing_to_very_ugly_thing() void ghost_demon::ugly_thing_add_resistance() { - int base_rand = 6; - if (resists.sticky_flame) - base_rand--; + int res = 0; - switch (random2(base_rand)) + do { - case 0: - resists.elec++; - break; - - case 1: - resists.poison++; - break; - - case 2: - resists.fire++; - break; - - case 3: - resists.cold++; - break; - - case 4: - resists.acid++; - break; + switch (random2(7)) + { + case 0: + resists.elec++; + res++; + break; + + case 1: + resists.poison++; + res++; + break; + + case 2: + resists.fire++; + res++; + break; + + case 3: + resists.cold++; + res++; + break; + + case 4: + resists.acid++; + res++; + break; + + case 5: + if (!resists.sticky_flame) + { + resists.sticky_flame = true; + res++; + } + break; - case 5: - resists.sticky_flame = true; - break; + case 6: + if (!resists.rotting) + { + resists.rotting = true; + res++; + } + break; + } } + while (res == 0); - // Guarantee certain resistances for certain attack flavours, - // including the upgraded ones. + // Guarantee certain resistances for upgraded attack flavours. if (att_flav == AF_POISON_MEDIUM && !resists.poison) resists.poison++; - else if (att_flav == AF_ACID && !resists.acid) - resists.acid++; else if (att_flav == AF_NAPALM && !resists.sticky_flame) resists.sticky_flame = true; + else if (att_flav == AF_ROT && !resists.rotting) + resists.rotting = true; } static spell_type search_first_list(int ignore_spell) |