;Alyson uses atributes of both peashooter and randman ;with a change in heading that makes it harder to hit ;and changes the tracking system. #config weapon=1 ; gives 1 point #config scanner=3 ; gives 2 points #config engine=4 ; consumes 2 points #config heatsinks=2 ; consumes a point #msg Watch your six! :) #def heading #def armor #def hitcheck #def hit mov ax, 1 int 3 ; Keepshift on. !begin mov dx, 64 ; Set our scan arc to 64 degrees !start opo 11, 100 ; Throttle to 100% ipo 10, heading opo 14 heading opo 11 100 opo 17, dx ; Set arc to DX ipo 7, fx ; Scan for enemy cmp fx 2000 ja !decide ; No one found? Decide what to do !track ; Someone was found mov bx, dx ; BX = DX (dx is the scan width) mpy bx, @3 ; bx = scanwidth*accuracy sar bx, 1 ; bx = scanwidth*accuracy/2 opo 12, bx ; turn turret by that amount. cmp dx, 2 ; check scanwidth jbe !fire ; width<=2? then fire, otherwise tighten shr dx, 1 ; tighten scanwidth !fire opo 15, @3 ; Fire! ; Set course towards target mov bx, @1 ; get current desired heading ; (not actual heading) ipo 3, ax ; Get actual heading add ax, @2 ; And add to it our turret offset ; AX is now our new desired heading. ipo 2 ax ; ax=heat cmp ax 50 ; heat over 50? jgr 8999 ; if so, keep checking it. ; (a quaint shutdown routine) ipo 6 ax ; get armor cmp ax armor ; has it changed? ;if no damage then simply exit. jeq 51 ; no damage.. let's go ;if hit, then say so! set armor ax ; update armor variable set hit 1 ; register the hit. jmp !start ; start over ;Decides what to do if no one found !decide cmp dx 64 ; Compare scanwidth to 64 jae !flip ; If above, then flip shl dx 1 ; otherwise, widen arc jmp !start ; start over !flip opo 12 128 ; rotate turret 128 degrees (180). opo 14 8 ; Turn slightly ; jmp !start ; start over ;program starts over automatically when it runs past the end.