Made death and combat win configurable instead of hard coded.

This commit is contained in:
Martin Haye 2017-06-02 08:38:31 -07:00
parent 2c50d19c48
commit 2499d41461
2 changed files with 9 additions and 7 deletions

View File

@ -488,9 +488,13 @@ def startCombat(mapCode)
elsif n == 'F'
displayStr("\n\nFleeing... \n")
return 0
// Secret option for testing: just win
// Secret option for testing: just die
elsif n == '#' and global->b_godmode
displayStr("\n\n")
return 99
elsif n == '*' and global->b_godmode
displayStr("\n\n")
return -99
fin
beep()
loop
@ -521,13 +525,14 @@ end
///////////////////////////////////////////////////////////////////////////////////////////////////
// Returns: zero if fled, non-zero if won
def _combat_zoneEncounter(s_encZone)
word p, l
byte answer
word p, l, answer
// Show portrait and threat details, find out if player wants to fight (vs. run)
answer = startCombat(s_encZone)
if answer == 99
killAllEnemies()
elsif answer == -99
return answer // special code for death
elsif !answer
isFleeing = TRUE
fin
@ -547,7 +552,6 @@ def _combat_zoneEncounter(s_encZone)
p = global=>p_combatFirst
while p
if !nPlayersFighting
callGlobalFunc(GS_DEATH, 0, 0, 0)
return -99 // special code for death
elsif !nEnemiesFighting
callGlobalFunc(GS_COMBAT_WIN, 0, 0, 0)

View File

@ -2230,9 +2230,7 @@ end
///////////////////////////////////////////////////////////////////////////////////////////////////
def playerDeath()
displayStr("\nYou have died. Press any key to reload.")
setPortrait(POdeath)
getUpperKey()
callGlobalFunc(GS_DEATH, 0, 0, 0)
startGame(FALSE) // don't ask, just load
end