From a520c906467d144b0aed004eeb5303de84e4ad30 Mon Sep 17 00:00:00 2001 From: Martin Haye Date: Tue, 7 Jul 2020 09:13:59 -0700 Subject: [PATCH] Advance time a little after combat. --- Platform/Apple/virtual/src/plasma/diskops.pla | 2 +- Platform/Apple/virtual/src/plasma/gameloop.pla | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Platform/Apple/virtual/src/plasma/diskops.pla b/Platform/Apple/virtual/src/plasma/diskops.pla index 7fd6162d..006f64e7 100644 --- a/Platform/Apple/virtual/src/plasma/diskops.pla +++ b/Platform/Apple/virtual/src/plasma/diskops.pla @@ -374,7 +374,7 @@ def checkMarks()#0 if fieldLen <> ^($200 + mapNum); err = 'C'; break; fin sp = sp + fieldLen loop - if sp <> limit; err = 'D'; fin + if !err and sp <> limit; err = 'D'; fin if err; printf1("code=%c\n", err); fatal("corrupt automap"); fin // Print out the heap fullness, for later debugging diff --git a/Platform/Apple/virtual/src/plasma/gameloop.pla b/Platform/Apple/virtual/src/plasma/gameloop.pla index 1dbabb91..79ed68f2 100644 --- a/Platform/Apple/virtual/src/plasma/gameloop.pla +++ b/Platform/Apple/virtual/src/plasma/gameloop.pla @@ -27,6 +27,10 @@ const CLOCK_ADV_3D_HOURS = 0 const CLOCK_ADV_3D_MINS = 0 const CLOCK_ADV_3D_SECS = 30 +const CLOCK_ADV_COMBAT_HOURS = 0 +const CLOCK_ADV_COMBAT_MINS = 10 +const CLOCK_ADV_COMBAT_SECS = 0 + // Raycaster tables - must match values in render.i const RAY_TABLE_START = $A800 const RAY_TABLE_SIZE = $1781 @@ -2165,7 +2169,7 @@ def advTime(hours, mins, secs)#0 if (prevHour / 12) <> (global->b_hour / 12) player = global=>p_players while player - add = (rand16 % player->b_stamina)/3 + add = (rand16 % (player->b_stamina+1))/3 setStat(player, @S_HEALTH, player=>w_health + add) player = player=>p_nextObj loop @@ -2852,6 +2856,9 @@ def doCombat(mapCode, backUpOnFlee)#1 fin returnFromEngine(!inScript) // only re-render if outside script + // Advance time a little. It's tricky advancing during combat; this is an ok substitute. + advTime(CLOCK_ADV_COMBAT_HOURS, CLOCK_ADV_COMBAT_MINS, CLOCK_ADV_COMBAT_SECS) + // If the party fled the combat instead of winning, back up to previous square. if !result and backUpOnFlee moveWayBackward()