diff --git a/ai.asm b/ai.asm index 01ee367..cff865a 100644 --- a/ai.asm +++ b/ai.asm @@ -843,8 +843,8 @@ PurchaseAIRoutines .word PoolsharkPurchase-1 ;PoolsharkPurchase .word TosserPurchase-1 ;TosserPurchase .word TosserPurchase-1 ;ChooserPurchase - .word TosserPurchase-1 ;SpoilerPurchase - .word TosserPurchase-1 ;CyborgPurchase + .word CyborgPurchase-1 ;SpoilerPurchase + .word CyborgPurchase-1 ;CyborgPurchase .word TosserPurchase-1 ;UnknownPurchase ;---------------------------------------------- @@ -853,6 +853,16 @@ PurchaseAIRoutines rts .endp ;------- +.proc TryToPurchaseOnePiece2 ; for Cyborg + ; A - weapon number, better it will be in range(1,32) + ; TankNr in X + ; DOES NOT CHANGE X + tay + lda PurchaseMeTable2,y + beq TryToPurchaseOnePiece.SorryNoPurchase + jmp TryToPurchaseOnePiece.PurchaseIt +.endp +;------- .proc TryToPurchaseOnePiece ; A - weapon number, better it will be in range(1,32) ; TankNr in X @@ -860,6 +870,7 @@ PurchaseAIRoutines tay lda PurchaseMeTable,y beq SorryNoPurchase +PurchaseIt lda WeaponPriceL,y sta temp lda WeaponPriceH,y @@ -953,7 +964,7 @@ SorryNoPurchase lda MoneyH,x ; money / 256 sta tempXroller ; perform this many purchase attempts ; first try to buy defensives - mva #3 tempXroller; number of defensive purchases to perform + mva #2 tempXroller; number of defensive purchases to perform @ randomize ind_Battery________ ind_Auto_Defense___ jsr TryToPurchaseOnePiece @@ -972,3 +983,31 @@ SorryNoPurchase rts .endp +;---------------------------------------------- +.proc CyborgPurchase + + ; what is my money level + ldx TankNr + ;lda MoneyH,x ; money / 256 + ;sta tempXroller ; perform this many purchase attempts + ; first try to buy defensives + mva #2 tempXroller; number of defensive purchases to perform +@ + randomize ind_Battery________ ind_Auto_Defense___ + jsr TryToPurchaseOnePiece2 + dec tempXroller + bne @- + + ; and now offensives + lda MoneyH,x ; money / 256 + asl ;*4 + asl + sta tempXroller ; perform this many purchase attempts +@ + randomize ind_Missile________ ind_Plasma_Blast___ + jsr TryToPurchaseOnePiece2 + dec tempXroller + bne @- + + rts +.endp diff --git a/constants.asm b/constants.asm index 6315214..e47adc5 100644 --- a/constants.asm +++ b/constants.asm @@ -568,6 +568,72 @@ PurchaseMeTable ;weapons good to be purchased by the robot dta 0 ;"Fuel Tank " ; 62 dta 0 ;"Nuclear Winter " ; 63 +PurchaseMeTable2 ;weapons good to be purchased by the robot (Cyborg) + ;the comment is an index in the tables + dta 1 ;"Baby Missile " ; 0 + dta 1 ;"Missile " ; 1 + dta 1 ;"Baby Nuke " ; 2 + dta 1 ;"Nuke " ; 3 + dta 0 ;"LeapFrog " ; 4 + dta 0 ;"Funky Bomb " ; 5 + dta 0 ;"MIRV " ; 6 + dta 0 ;"Death's Head " ; 7 + dta 0 ;"Napalm " ; 8 + dta 1 ;"Hot Napalm " ; 9 + dta 0 ;"Tracer " ; 10 + dta 0 ;"Smoke Tracer " ; 11 + dta 0 ;"Baby Roller " ; 12 + dta 0 ;"Roller " ; 13 + dta 0 ;"Heavy Roller " ; 14 + dta 0 ;"Riot Charge " ; 15 + dta 0 ;"Riot Blast " ; 16 + dta 0 ;"Riot Bomb " ; 17 + dta 0 ;"Heavy Riot Bomb " ; 18 + dta 0 ;"Baby Digger " ; 19 + dta 0 ;"Digger " ; 20 + dta 0 ;"Heavy Digger " ; 21 + dta 0 ;"Baby Sandhog " ; 22 + dta 0 ;"Sandhog " ; 23 + dta 0 ;"Heavy Sandhog " ; 24 + dta 0 ;"Dirt Clod " ; 25 + dta 0 ;"Dirt Ball " ; 26 + dta 0 ;"Ton of Dirt " ; 27 + dta 0 ;"Liquid Dirt " ; 28 + dta 0 ;"Dirt Charge " ; 29 + dta 0 ;"Earth Disrupter " ; 30 + dta 1 ;"Plasma Blast " ; 31 + dta 1 ;"Laser " ; 32 + dta 0 ;"----------------" ; 33 + dta 0 ;"----------------" ; 34 + dta 0 ;"----------------" ; 35 + dta 0 ;"----------------" ; 36 + dta 0 ;"----------------" ; 37 + dta 0 ;"----------------" ; 38 + dta 0 ;"----------------" ; 39 + dta 0 ;"----------------" ; 40 + dta 0 ;"----------------" ; 41 + dta 0 ;"----------------" ; 42 + dta 0 ;"----------------" ; 43 + dta 0 ;"----------------" ; 44 + dta 0 ;"----------------" ; 45 + dta 0 ;"----------------" ; 46 + dta 0 ;"----------------" ; 47 + dta 0 ;"White Flag " ; 48 + dta 1 ;"Battery " ; 49 + dta 0 ;"Bal Guidance " ; 50 + dta 0 ;"Horz Guidance " ; 51 + dta 0 ;"Vert Guidance " ; 52 + dta 0 ;"Lazy Boy " ; 53 + dta 1 ;"Parachute " ; 54 + dta 1 ;"Strong Parachute" ; 55 + dta 1 ;"Mag Deflector " ; 56 + dta 1 ;"Shield " ; 57 + dta 1 ;"Heavy Shield " ; 58 + dta 1 ;"Force Shield " ; 59 + dta 0 ;"Super Mag " ; 60 + dta 1 ;"Auto Defense " ; 61 + dta 0 ;"Fuel Tank " ; 62 + dta 0 ;"Nuclear Winter " ; 63 ;------------------------------------------------- ; Screen codes of icons (chars) representing a given weapon diff --git a/display.asm b/display.asm index 5deb05c..9264773 100644 --- a/display.asm +++ b/display.asm @@ -210,5 +210,5 @@ purchaseTextEnd GameOverTitle dta d" game over "* GameOverTitle2 - dta d" Player Points Hits Earned Money " + dta d" Player Points Hits Earned Money " .endif \ No newline at end of file diff --git a/scorch.xex b/scorch.xex index 6b80169..b1dd3d6 100644 Binary files a/scorch.xex and b/scorch.xex differ diff --git a/textproc.asm b/textproc.asm index dd0fb30..0884e7d 100644 --- a/textproc.asm +++ b/textproc.asm @@ -1854,8 +1854,15 @@ FinalResultOfTheNextPlayer adw temp #40 jmp @- LineAdresReady + ; put position of tank on the screen + pla + pha ; now we have line number in A register + ldy #1 + tax + lda zero+1,x + sta (temp),y ; puts name of the tank on the screen - ldy #$01 + ldy #$03 lda TankNr :3 asl ; 8 chars per name tax @@ -1864,14 +1871,14 @@ NextChar sta (temp),y inx iny - cpy #$08+1 + cpy #$08+3 bne NextChar ; put big points on the screen ldx TankNr lda ResultsTable,x sta decimal mva #0 decimal+1 - adw temp #10 displayposition + adw temp #12 displayposition jsr displaydec5 mva #0 displayposition ; overwrite first digit ; put hits points on the screen @@ -1889,9 +1896,9 @@ NextChar sta decimal lda EarnedMoneyH,x sta decimal+1 - adw temp #28 displayposition + adw temp #30 displayposition jsr displaydec5 - ldy #33 + ldy #35 lda zero sta (temp),y ; and last zero ply