#msg Sniperboy Mk2 ;NOW WITH TARGET PREDICTION!!! WOO HOO!! ;(mite be shit tho :oP ) ; Declarations: #def angle #def scan #def acc #def arc #def heat #def tspd #def limit #def tdir #def tsp ; Config: #config scanner=5 #config weapon=2 #config armor=2 #config engine=1 #config heatsinks=2 ; Code: ;Target Prediction table put 0 400 put 0 401 put 0 402 put 0 403 put 0 404 put 1 405 put 2 406 put 2 407 put 1 408 put 2 409 put 3 410 put 4 411 put 1 412 put 2 413 put 4 414 put 5 415 put 1 416 put 2 417 put 4 418 put 5 419 put 1 420 put 2 421 put 4 422 put 5 423 put 1 424 put 2 425 put 3 426 put 4 427 put 0 428 put 1 429 put 2 430 put 2 431 put 0 432 put 0 433 put 0 434 put 0 435 put 0 436 put -1 437 put -2 438 put -2 439 put -1 440 put -2 441 put -3 442 put -4 443 put -1 444 put -2 445 put -4 446 put -5 447 put -1 448 put -2 449 put -4 450 put -5 451 put -1 452 put -2 453 put -4 454 put -5 455 put -1 456 put -2 457 put -3 458 put -4 459 put 0 460 put -1 461 put -2 462 put -2 463 ;End Target Prediction mov ax 1 int i_keepshift !start mov ax 1 int i_locate int i_overburn cmp ex 500 mov ex 0 mov dx 96 jle !1 add ex 1000 mov bx 1 add dx 64 !1 cmp fx 500 mov fx 0 jle !2 add fx 1000 cmp bx 1 je !3 sub dx 64 jne !2 !3 add dx 64 !2 ; head for corner int i_angle ; ax = bearing to corner mov bx @1 and ax 255 sub ax bx opo p_steering ax opo p_throttle 100 mov angle dx ipo p_turret_abs bx ; aim out of corner and dx 255 sub dx bx opo p_trotate dx !5 mov ax @0 cmp ax 0 jne !5 mov dx angle mov bx @1 and dx 255 sub dx bx opo p_steering dx mov ax 0 int i_overburn mov arc 32 opo p_scanarc arc !scan cmp arc 0 jgr !scan2 add arc 1 opo p_scanarc arc !scan2 ipo p_scan scan mov tspd @7 cmp scan maxint jls !aim cmp arc 32 jls !widen opo p_trotate arc jge !scan mov arc 32 opo p_scanarc arc jmp !scan !widen shl arc 2 opo p_scanarc arc jle !scan jge !scan !aim cmp arc 2 ipo p_accuracy ax jle !fire add ax 102 jne ax je ax jmp !scan :100 neg arc opo p_trotate arc neg arc shr arc 2 opo p_scanarc arc jne !fire je !fire :101 shr arc 1 neg arc opo p_trotate arc neg arc shr arc 1 opo p_scanarc arc jne !fire je !fire :102 shr arc 2 opo p_scanarc arc jne !fire je !fire :103 shr arc 1 opo p_trotate arc shr arc 1 opo p_scanarc arc jne !fire je !fire :104 opo p_trotate arc shr arc 2 opo p_scanarc arc jne !fire je !fire !fire mov ax 0 int i_overburn cmp arc 2 jgr !scan cmp tspd 20 jgr !shoot1 cmp tspd -20 jls !shoot1 ipo p_scan scan ipo p_accuracy acc opo p_trotate acc ipo p_heat heat ;temp management cmp heat 150 jge !scan mov ax 1 int i_overburn mov cx 6 !loop sub cx 1 opo p_fire acc cmp cx 0 jgr !loop mov ax 0 int i_overburn je !scan jne !scan jmp !scan !shoot1 ipo p_heat heat ;heat management cmp heat 150 jge !scan ipo p_scan scan ;Targ-pred from here... ipo p_accuracy acc set tsp @7 set tdir @6 shr tdir 4 shl tdir 2 shr tsp 5 add tdir tsp add tdir 400 opo p_trotate [tdir] ;...to here opo p_fire acc jgr !scan jle !scan