diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-05-15 16:33:50 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-05-15 16:33:50 +0000 |
commit | 0be746e8fe67b689a7158c703571009f9bd2facb (patch) | |
tree | 8f00e126397dd339439ed7f01e0ccea9a9640e56 /crawl-ref | |
parent | a9fdbb0f00c69102a08ce24236b4d9a358b6b5f4 (diff) | |
download | crawl-ref-0be746e8fe67b689a7158c703571009f9bd2facb.tar.gz crawl-ref-0be746e8fe67b689a7158c703571009f9bd2facb.zip |
Fix chaining again.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5056 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-rw-r--r-- | crawl-ref/source/spells1.cc | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/crawl-ref/source/spells1.cc b/crawl-ref/source/spells1.cc index 8b92958c4b..08e98a6fd1 100644 --- a/crawl-ref/source/spells1.cc +++ b/crawl-ref/source/spells1.cc @@ -807,7 +807,7 @@ int cast_revitalisation(int pow) { step = 0; step_max = std::min(pow, step_max_chain); - type = random2(type_max_chain * 3 / 2); + type = random2(type_max_chain + 1); hp_amt = 3; mp_amt = 1; need_chain = false; @@ -835,7 +835,7 @@ int cast_revitalisation(int pow) step = 1; // Deliberate fall through. - if (step == step_max) + if (step >= step_max) break; // Remove sickness and rotting. @@ -852,7 +852,7 @@ int cast_revitalisation(int pow) step = 2; // Deliberate fall through. - if (step == step_max) + if (step >= step_max) break; // Restore rotted HP. @@ -868,7 +868,7 @@ int cast_revitalisation(int pow) step = 3; // Deliberate fall through. - if (step == step_max) + if (step >= step_max) break; // Divine robustness. @@ -970,6 +970,9 @@ int cast_revitalisation(int pow) step = 3; // Deliberate fall through. + if (step >= step_max) + break; + // Divine stamina. case 3: case 4: @@ -1000,6 +1003,9 @@ int cast_revitalisation(int pow) break; } + step = 6; + // Deliberate fall through. + default: break; } @@ -1018,6 +1024,12 @@ int cast_revitalisation(int pow) break; } +#ifdef DEBUG_DIAGNOSTICS + mprf(MSGCH_DIAGNOSTICS, + "revitalising: step = %d, type = %d, step_max = %d", + step, type, step_max); +#endif + // If revitalisation has succeeded, display an appropriate message. if (success) { @@ -1048,7 +1060,7 @@ int cast_revitalisation(int pow) // If revitalisation has succeeded, it hasn't succeeded as far // as possible, and revitalisation chaining is needed, turn on // revitalisation chaining for several turns. - if (success && step != step_max && need_chain) + if (success && step < step_max && need_chain) revitalisation_chain(6); // Otherwise, turn off revitalisation chaining. else |