; ______ ____ ____ ___ _____ ___ ___ ___ ___ ; / ____| / _ \ / _ \ | | | ____| | | | | \ \/ / ; | | | | | | | | | | | | | | __ | | | | \ / ; | |___ | |_| | | | | | | |___ | |__|| | |_| | \ / ; \______ \_____/ \_____/ \_____|\_____| \_____/ |__| ; ______________________________ ; |__________________________ /____________________________ ; Created By Ross Devereux /_______________________________| #def width #def tx #def ty #def accuracy #def turn #DEF sarc #DEF rng #def acc #def lastdmg #def turnok #def turnby #def heat #config armor=3 #config scanner=3 #config engine=3 #config heatsinks=0 #config mines=0 #config weapon=3 #config shield=0 out P_THROTTLE 100 out P_STEERING 120 set ax 1 int I_KEEPSHIFT set width 64 put 0 448 put 0 449 put 0 450 put 1 451 put 1 452 put 2 453 put 2 454 put 3 455 put 3 456 put 3 457 put 4 458 put 4 459 put 4 460 put 4 461 put 5 462 put 5 463 put 5 464 put 5 465 put 5 466 put 4 467 put 4 468 put 4 469 put 4 470 put 3 471 put 3 472 put 3 473 put 2 474 put 2 475 put 1 476 put 1 477 put 0 478 put 0 479 put 0 480 put -0 481 put -0 482 put -1 483 put -1 484 put -2 485 put -2 486 put -3 487 put -3 488 put -3 489 put -4 490 put -4 491 put -4 492 put -4 493 put -5 494 put -5 495 put -5 496 put -5 497 put -5 498 put -4 499 put -4 500 put -4 501 put -4 502 put -3 503 put -3 504 put -3 505 put -2 506 put -2 507 put -1 508 put -1 509 put -0 510 put -0 511 set tx 800 set ty 700 !main_loop int I_LOCATE sub ex tx sub fx ty cmp ex 0 ja !x_pos neg ex !x_pos cmp fx 0 ja !y_pos sub ex fx jmp !check_dist !y_pos add ex fx !check_dist cmp ex 50 ja !no_swap swap tx ty !no_swap set ex tx set fx ty int I_ANGLE sub ax @1 out P_STEERING ax call !hunt_fire call !hunt_fire !hunt_fire in P_HEAT ax out P_THROTTLE 100 cmp ax 200 jb !seek_fire ret !see_none out P_TROTATE 96 set width 64 !seek_fire !do_scan out P_ARC width in P_SCAN ax cmp ax 5000 ja !see_none cmp @3 1 ja !acc_2 je !acc_1 cmp @3 -1 jb !acc_12 je !acc_11 shr width 2 jmp !check_fire !acc_1 shr width 1 out P_TROTATE width shr width 1 jmp !check_fire !acc_2 out P_TROTATE width shr width 2 jmp !check_fire !acc_11 shr width 1 neg width out P_TROTATE width neg width shr width 1 jmp !check_fire !acc_12 neg width out P_TROTATE width neg width shr width 2 !check_fire cmp width 1 ja !seek_fire cmp @7 0 jne !lead_fire out P_FIRE out P_FIRE set width 4 ret !lead_fire set ax @6 and ax 255 shr ax 2 add ax 448 get ax ax out P_FIRE ax out P_FIRE ax set width 4 ret !acc_21 cmp accuracy, 0 je 1001 mov turn, accuracy mpy turn, 3 jmp !cool !cool mov bx, @1 sub ax, bx opo 14, ax jmp !move ret !MOVE ipo 10, ax ;Get random count and ax, 127 ;make it conform int 2 ;where am I? cmp ex, 75 ;check for walls jls !leftwall ;left wall cmp ex, 925 ;right wall jgr !rightwall ;right wall cmp fx, 75 ;top wall jls !topwall ;top wall cmp fx, 925 ;bottom wall jgr !bottomwall ;Everything else ipo 10, bx ;Get Random Direction and bx, 255 ;0..255 jmp !endrotate !leftwall opo 11, 45 ;no damage on impact.. cmp fx, 75 ;top wall jls !topleft ;top wall cmp fx, 925 ;bottom wall jgr !bottomleft ipo 10, bx ;get Random Direction and bx, 63 ;direction.. add bx, 32 ;always leave wall jmp !endrotate !topleft ipo 10, bx ;get Random Direction and bx, 31 ;direction.. add bx, 80 ;add 80 jmp !endrotate !bottomleft ipo 10, bx ;get Random Direction and bx, 31 ;direction.. add bx, 16 ; plus 16 jmp !endrotate !rightwall opo 11, 45 ;no damage on impact cmp fx, 10 ;top wall jls !topright ;top wall cmp fx, 925 ;bottom wall jgr !bottomright ipo 10, bx ;get Random Direction and bx, 63 ;direction.. add bx, 160 jmp !endrotate !topright ipo 10, bx ;get Random Direction and bx, 31 ;direction.. add bx, 144 jmp !endrotate !bottomright ipo 10, bx ;get Random Direction and bx, 31 ;direction.. add bx, 208 jmp !endrotate !topwall opo 11, 45 ;no damage on impact ipo 10, bx ;get Random Direction and bx, 63 ;direction.. add bx, 96 ;64 + jmp !endrotate !bottomwall opo 11, 45 ;no damage on impact ipo 10, bx ;get Random Direction and bx, 63 ;direction.. sub bx, 32 ;64 + !endrotate mov DX, @1 ;get compass heading sub BX, DX ;right direction opo 14, BX ;turn random number of degrees