aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra/magic_eob.cpp
diff options
context:
space:
mode:
authorathrxx2011-07-18 01:22:58 +0200
committerJohannes Schickel2011-12-26 16:18:12 +0100
commit9140fd8e91882250e23e2e4b44bf3088f3da827a (patch)
tree37deb0048ed88ffff3995ab230535f92cb16842f /engines/kyra/magic_eob.cpp
parentdb83458330310072c743d5acc7e1a470c888ec3b (diff)
downloadscummvm-rg350-9140fd8e91882250e23e2e4b44bf3088f3da827a.tar.gz
scummvm-rg350-9140fd8e91882250e23e2e4b44bf3088f3da827a.tar.bz2
scummvm-rg350-9140fd8e91882250e23e2e4b44bf3088f3da827a.zip
KYRA: (EOB) - implement party resting
Diffstat (limited to 'engines/kyra/magic_eob.cpp')
-rw-r--r--engines/kyra/magic_eob.cpp38
1 files changed, 35 insertions, 3 deletions
diff --git a/engines/kyra/magic_eob.cpp b/engines/kyra/magic_eob.cpp
index 7a9750fb69..fe770d465e 100644
--- a/engines/kyra/magic_eob.cpp
+++ b/engines/kyra/magic_eob.cpp
@@ -235,7 +235,7 @@ void EobCoreEngine::removeCharacterEffect(int spell, int charIndex, int showWarn
if (showWarning) {
if (s->flags & 0x20A0)
gui_drawCharPortraitWithStats(charIndex);
- else if (s->flags & 0x20A0)
+ else if (s->flags & 0x40)
gui_drawAllCharPortraitsWithStats();
}
}
@@ -416,8 +416,40 @@ void EobCoreEngine::setSpellEventTimer(int spell, int timerBaseFactor, int timer
setCharEventTimer(_activeSpellCaster, countdown, -spell, updateExistingTimer);
}
-void EobCoreEngine::cleanupCharacterSpellList(int charIndex) {
+void EobCoreEngine::sortCharacterSpellList(int charIndex) {
+ int8 *list = _characters[charIndex].mageSpells;
+ for (int i = 0; i < 16; ) {
+ bool p = false;
+ for (int ii = 0; ii < 9; ii++) {
+ int8 *pos = &list[ii];
+
+ int s1 = pos[0];
+ int s2 = pos[1];
+
+ if (s1 == 0)
+ s1 = 80;
+ else if (s1 < 0)
+ s1 = s1 * -1 + 40;
+
+ if (s2 == 0)
+ s2 = 80;
+ else if (s2 < 0)
+ s2 = s2 * -1 + 40;
+
+ if (s1 > s2) {
+ SWAP(pos[0], pos[1]);
+ p = true;
+ }
+ }
+
+ if (p)
+ continue;
+
+ list += 10;
+ if (++i == 8)
+ list = _characters[charIndex].clericSpells;
+ }
}
bool EobCoreEngine::magicObjectHit(EobFlyingObject *fo, int dcTimes, int dcPips, int dcOffs, int level) {
@@ -685,7 +717,7 @@ void EobCoreEngine::spellCallback_start_createFood() {
for (int i = 0; i < 6; i++) {
if (!testCharacter(i, 3))
continue;
- _characters[_activeSpellCaster].food = 100;
+ _characters[i].food = 100;
}
}