Advance time a little after combat.

This commit is contained in:
Martin Haye 2020-07-07 09:13:59 -07:00
parent 7c911c34c3
commit a520c90646
2 changed files with 9 additions and 2 deletions

View File

@ -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

View File

@ -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()