DirectHits and EarnedMoney counters added (for summary)

This commit is contained in:
Pecusx
2022-08-03 14:36:03 +02:00
parent 3ac678e68b
commit 54cc76464e
6 changed files with 74 additions and 7 deletions
+1 -1
View File
@@ -210,5 +210,5 @@ purchaseTextEnd
GameOverTitle GameOverTitle
dta d" game over "* dta d" game over "*
GameOverTitle2 GameOverTitle2
dta d" Player Points Hits Money " dta d" Player Points Hits Earned Money "
.endif .endif
+37 -2
View File
@@ -225,10 +225,41 @@ zeromoney
lda #0 lda #0
sta moneyL,x sta moneyL,x
sta moneyH,x sta moneyH,x
skipzeroing skipzeroing
; and earned money for summary
clc
lda EarnedMoneyL,x
adc gainL,x
sta EarnedMoneyL,x
lda EarnedMoneyH,x
adc gainH,x
sta EarnedMoneyH,x
; substract lose
; if lose is greater than money then zero money
lda EarnedMoneyH,x
cmp loseH,x
bcc ezeromoney
bne esubstractlose
lda EarnedMoneyL,x
cmp loseL,x
bcc ezeromoney
esubstractlose
sec
lda EarnedMoneyL,x
sbc loseL,x
sta EarnedMoneyL,x
lda EarnedMoneyH,x
sbc loseH,x
sta EarnedMoneyH,x
jmp eskipzeroing
ezeromoney
lda #0
sta EarnedMoneyL,x
sta EarnedMoneyH,x
eskipzeroing
dex dex
bpl CalculateGains jpl CalculateGains
lda GameIsOver lda GameIsOver
beq NoGameOverYet beq NoGameOverYet
@@ -934,6 +965,10 @@ MakeTanksVisible
txa txa
ClearResults ClearResults
sta ResultsTable,x sta ResultsTable,x
sta DirectHitsL,x
sta DirectHitsH,x
sta EarnedMoneyL,x
sta EarnedMoneyH,x
inx inx
cpx #MaxPlayers cpx #MaxPlayers
bne ClearResults bne ClearResults
BIN
View File
Binary file not shown.
+18 -4
View File
@@ -1882,13 +1882,27 @@ NextChar
adw temp #11 displayposition adw temp #11 displayposition
jsr displaydec jsr displaydec
mva #0 displayposition ; overwrite first digit mva #0 displayposition ; overwrite first digit
; put hits points on the screen
ldx TankNr
; lda DirectHitsL,x
sta decimal
lda DirectHitsH,x
sta decimal+1
adw temp #20 displayposition
jsr displaydec
mva #0 displayposition ; overwrite first digit
; put earned money on the screen
ldx TankNr
lda EarnedMoneyL,x
sta decimal
lda EarnedMoneyH,x
sta decimal+1
adw temp #28 displayposition
jsr displaydec
ply ply
iny iny
dec ResultOfTankNr dec ResultOfTankNr
bpl FinalResultOfTheNextPlayer jpl FinalResultOfTheNextPlayer
MakeBlackLines MakeBlackLines
cpy #$06 cpy #$06
beq AllLinesReady beq AllLinesReady
+8
View File
@@ -88,6 +88,14 @@ ResultsTable ;the results in the gameeeeee
.DS [MaxPlayers] .DS [MaxPlayers]
TempResults TempResults
.DS [MaxPlayers] .DS [MaxPlayers]
DirectHitsH
.DS [MaxPlayers]
DirectHitsL
.DS [MaxPlayers]
EarnedMoneyH
.DS [MaxPlayers]
EarnedMoneyL
.DS [MaxPlayers]
;---------------------------------------------------- ;----------------------------------------------------
ForceTableL ;shooting Force of the tank during the round ForceTableL ;shooting Force of the tank during the round
.DS [MaxPlayers] .DS [MaxPlayers]
+10
View File
@@ -1855,6 +1855,16 @@ EndOfFlight2
lda HitFlag lda HitFlag
jeq NoHitAtEndOfFight ; RTS only !!! jeq NoHitAtEndOfFight ; RTS only !!!
jmi NoTankHitAtEndOfFight jmi NoTankHitAtEndOfFight
; tank hit - increase direct hits points
ldx TankNr
inx
cpx HitFlag ; we don't count suicides :)
beq @+
dex
inc DirectHitsL,x
bne @+
inc DirectHitsH,x
@
; tank hit - check defensive weapon of this tank ; tank hit - check defensive weapon of this tank
tax tax
dex ; index of tank in X dex ; index of tank in X