#config scanner=3 #config weapon=3 #config armor=3 #config engine=2 #config heatsinks=1 #config mines=0 #config shield=0 #def dist #def reldir #def cycledelay #def closeshotlim #def confuse #msg I beat you anytime! je !start jne !start ; *******************************************; ; - PREDICTION TABLE - ; ; ****************************************** ; ; (2600) *256, 256, 256, 256 *256, 256, 256, 256 *256, 256, 256, 256 *256, 256, 256, 256 *256, 256, 256, 256 *256, 256, 256, 256 *256, 256, 256, 256 *256, 256, 256, 256 *256, 256, 256, 256 *256, 256, 256, 256 *256, 256, 256, 256 *256, 256, 256, 256 *256, 256, 256, 256 *256, 256, 256, 256 *256, 256, 256, 256 *256, 256, 256, 256 *256, 256, 256, 256 *256, 256, 256, 256 *256, 256, 256, 256 *256, 256, 256, 256 *256, 256, 256, 256 *256, 256, 256, 256 *256, 256, 256, 256 *256, 256, 256, 256 *256, 256, 256, 256 *256, 256, 256, 256 *256, 256, 256, 256 *256, 256, 256, 256 *256, 256, 256, 256 *256, 256, 256, 256 *256, 256, 256, 256 *256, 256, 256, 256 *256, 256, 256, 256 *256, 256, 256, 256 *256, 257, 257, 257 *257, 257, 257, 257 *257, 257, 257, 257 *257, 257, 257, 256 *256, 256, 256, 256 *256, 256, 256, 256 *256, 256, 256, 256 *256, 256, 256, 256 *256, 255, 255, 255 *255, 255, 255, 255 *255, 255, 255, 255 *255, 255, 255, 256 *256, 256, 256, 256 *256, 256, 256, 256 *256, 256, 256, 256 *256, 256, 257, 257 *257, 257, 257, 257 *257, 257, 257, 257 *257, 257, 257, 257 *257, 257, 257, 257 *257, 257, 256, 256 *256, 256, 256, 256 *256, 256, 256, 256 *256, 256, 255, 255 *255, 255, 255, 255 *255, 255, 255, 255 *255, 255, 255, 255 *255, 255, 255, 255 *255, 255, 256, 256 *256, 256, 256, 256 *256, 256, 256, 256 *256, 257, 257, 257 *257, 257, 257, 258 *258, 258, 258, 258 *258, 258, 258, 258 *258, 257, 257, 257 *257, 257, 257, 256 *256, 256, 256, 256 *256, 256, 256, 256 *256, 255, 255, 255 *255, 255, 255, 254 *254, 254, 254, 254 *254, 254, 254, 254 *254, 255, 255, 255 *255, 255, 255, 256 *256, 256, 256, 256 *256, 256, 256, 256 *257, 257, 257, 257 *258, 258, 258, 258 *258, 258, 258, 258 *258, 258, 258, 258 *258, 258, 258, 258 *257, 257, 257, 257 *256, 256, 256, 256 *256, 256, 256, 256 *255, 255, 255, 255 *254, 254, 254, 254 *254, 254, 254, 254 *254, 254, 254, 254 *254, 254, 254, 254 *255, 255, 255, 255 *256, 256, 256, 256 *256, 256, 256, 257 *257, 257, 257, 258 *258, 258, 258, 258 *259, 259, 259, 259 *259, 259, 259, 259 *258, 258, 258, 258 *258, 257, 257, 257 *257, 256, 256, 256 *256, 256, 256, 255 *255, 255, 255, 254 *254, 254, 254, 254 *253, 253, 253, 253 *253, 253, 253, 253 *254, 254, 254, 254 *254, 255, 255, 255 *255, 256, 256, 256 *256, 256, 256, 257 *257, 257, 258, 258 *258, 259, 259, 259 *259, 259, 259, 259 *259, 259, 259, 259 *259, 259, 259, 258 *258, 258, 257, 257 *257, 256, 256, 256 *256, 256, 256, 255 *255, 255, 254, 254 *254, 253, 253, 253 *253, 253, 253, 253 *253, 253, 253, 253 *253, 253, 253, 254 *254, 254, 255, 255 *255, 256, 256, 256 *256, 256, 257, 257 *257, 258, 258, 258 *259, 259, 259, 259 *260, 260, 260, 260 *260, 260, 260, 260 *259, 259, 259, 259 *258, 258, 258, 257 *257, 257, 256, 256 *256, 256, 255, 255 *255, 254, 254, 254 *253, 253, 253, 253 *252, 252, 252, 252 *252, 252, 252, 252 *253, 253, 253, 253 *254, 254, 254, 255 *255, 255, 256, 256 *256, 256, 257, 257 *258, 258, 258, 259 *259, 259, 260, 260 *260, 260, 260, 260 *260, 260, 260, 260 *260, 260, 259, 259 *259, 258, 258, 258 *257, 257, 256, 256 *256, 256, 255, 255 *254, 254, 254, 253 *253, 253, 252, 252 *252, 252, 252, 252 *252, 252, 252, 252 *252, 252, 253, 253 *253, 254, 254, 254 *255, 255, 256, 256 *256, 256, 257, 257 *258, 258, 259, 259 *259, 260, 260, 260 *260, 261, 261, 261 *261, 261, 261, 260 *260, 260, 260, 259 *259, 259, 258, 258 *257, 257, 256, 256 *256, 256, 255, 255 *254, 254, 253, 253 *253, 252, 252, 252 *252, 251, 251, 251 *251, 251, 251, 252 *252, 252, 252, 253 *253, 253, 254, 254 *255, 255, 256, 256 *256, 256, 257, 257 *258, 258, 259, 259 *260, 260, 260, 261 *261, 261, 261, 261 *261, 261, 261, 261 *261, 260, 260, 260 *259, 259, 258, 258 *257, 257, 256, 256 *256, 256, 255, 255 *254, 254, 253, 253 *252, 252, 252, 251 *251, 251, 251, 251 *251, 251, 251, 251 *251, 252, 252, 252 *253, 253, 254, 254 *255, 255, 256, 256 *256, 256, 257, 258 *258, 259, 259, 260 *260, 261, 261, 261 *261, 262, 262, 262 *262, 262, 262, 261 *261, 261, 261, 260 *260, 259, 259, 258 *258, 257, 256, 256 *256, 256, 255, 254 *254, 253, 253, 252 *252, 251, 251, 251 *251, 250, 250, 250 *250, 250, 250, 251 *251, 251, 251, 252 *252, 253, 253, 254 *254, 255, 256, 256 *256, 256, 257, 258 *258, 259, 260, 260 *261, 261, 261, 262 *262, 262, 262, 262 *262, 262, 262, 262 *262, 261, 261, 261 *260, 260, 259, 258 *258, 257, 256, 256 *256, 256, 255, 254 *254, 253, 252, 252 *251, 251, 251, 250 *250, 250, 250, 250 *250, 250, 250, 250 *250, 251, 251, 251 *252, 252, 253, 254 *254, 255, 256, 256 *256, 257, 257, 258 *259, 259, 260, 260 *261, 261, 262, 262 *262, 263, 263, 263 *263, 263, 263, 262 *262, 262, 261, 261 *260, 260, 259, 259 *258, 257, 257, 256 *256, 255, 255, 254 *253, 253, 252, 252 *251, 251, 250, 250 *250, 249, 249, 249 *249, 249, 249, 250 *250, 250, 251, 251 *252, 252, 253, 253 *254, 255, 255, 256 *256, 257, 257, 258 *259, 260, 260, 261 *261, 262, 262, 263 *263, 263, 263, 263 *263, 263, 263, 263 *263, 262, 262, 261 *261, 260, 260, 259 *258, 257, 257, 256 *256, 255, 255, 254 *253, 252, 252, 251 *251, 250, 250, 249 *249, 249, 249, 249 *249, 249, 249, 249 *249, 250, 250, 251 *251, 252, 252, 253 *254, 255, 255, 256 *256, 257, 258, 258 *259, 260, 260, 261 *262, 262, 263, 263 *263, 264, 264, 264 *264, 264, 264, 263 *263, 263, 262, 262 *261, 260, 260, 259 *258, 258, 257, 256 *256, 255, 254, 254 *253, 252, 252, 251 *250, 250, 249, 249 *249, 248, 248, 248 *248, 248, 248, 249 *249, 249, 250, 250 *251, 252, 252, 253 *254, 254, 255, 256 *256, 257, 258, 258 *259, 260, 261, 261 *262, 263, 263, 263 *264, 264, 264, 264 *264, 264, 264, 264 *263, 263, 263, 262 *261, 261, 260, 259 *258, 258, 257, 256 *256, 255, 254, 254 *253, 252, 251, 251 *250, 249, 249, 249 *248, 248, 248, 248 *248, 248, 248, 248 *249, 249, 249, 250 *251, 251, 252, 253 *254, 254, 255, 256 *256, 257, 258, 259 *259, 260, 261, 262 *262, 263, 264, 264 *264, 265, 265, 265 *265, 265, 265, 264 *264, 264, 263, 262 *262, 261, 260, 259 *259, 258, 257, 256 *256, 255, 254, 253 *253, 252, 251, 250 *250, 249, 248, 248 *248, 247, 247, 247 *247, 247, 247, 248 *248, 248, 249, 250 *250, 251, 252, 253 *253, 254, 255, 256 *256, 257, 258, 259 *260, 261, 261, 262 *263, 263, 264, 264 *265, 265, 265, 265 *265, 265, 265, 265 *264, 264, 263, 263 *262, 261, 261, 260 *259, 258, 257, 256 *256, 255, 254, 253 *252, 251, 251, 250 *249, 249, 248, 248 *247, 247, 247, 247 *247, 247, 247, 247 *248, 248, 249, 249 *250, 251, 251, 252 *253, 254, 255, 256 *256, 257, 258, 259 *260, 261, 262, 262 *263, 264, 264, 265 *265, 266, 266, 266 *266, 266, 266, 265 *265, 264, 264, 263 *262, 262, 261, 260 *259, 258, 257, 256 *256, 255, 254, 253 *252, 251, 250, 250 *249, 248, 248, 247 *247, 246, 246, 246 *246, 246, 246, 247 *247, 248, 248, 249 *250, 250, 251, 252 *253, 254, 255, 256 *256, 257, 258, 259 *260, 261, 262, 263 *264, 264, 265, 265 *266, 266, 266, 266 *266, 266, 266, 266 *265, 265, 264, 264 *263, 262, 261, 260 *259, 258, 257, 256 *256, 255, 254, 253 *252, 251, 250, 249 *248, 248, 247, 247 *246, 246, 246, 246 *246, 246, 246, 246 *247, 247, 248, 248 *249, 250, 251, 252 *253, 254, 255, 256 *256, 257, 258, 259 *260, 261, 262, 263 *264, 265, 265, 266 *266, 267, 267, 267 *267, 267, 267, 266 *266, 265, 265, 264 *263, 262, 261, 260 *259, 258, 257, 256 *256, 255, 254, 253 *252, 251, 250, 249 *248, 247, 247, 246 *246, 245, 245, 245 *245, 245, 245, 246 *246, 247, 247, 248 *249, 250, 251, 252 *253, 254, 255, 256 *256, 257, 258, 259 *261, 262, 263, 263 *264, 265, 266, 266 *267, 267, 267, 267 *267, 267, 267, 267 *266, 266, 265, 264 *263, 263, 262, 261 *259, 258, 257, 256 *256, 255, 254, 253 *251, 250, 249, 249 *248, 247, 246, 246 *245, 245, 245, 245 *245, 245, 245, 245 *246, 246, 247, 248 *249, 249, 250, 251 *253, 254, 255, 256 *256, 257, 258, 260 *261, 262, 263, 264 *265, 265, 266, 267 *267, 268, 268, 268 *268, 268, 268, 267 *267, 266, 265, 265 *264, 263, 262, 261 *260, 258, 257, 256 *256, 255, 254, 252 *251, 250, 249, 248 *247, 247, 246, 245 *245, 244, 244, 244 *244, 244, 244, 245 *245, 246, 247, 247 *248, 249, 250, 251 *252, 254, 255, 256 *256, 257, 259, 260 *261, 262, 263, 264 *265, 266, 267, 267 *268, 268, 268, 268 *268, 268, 268, 268 *267, 267, 266, 265 *264, 263, 262, 261 *260, 259, 257, 256 *256, 255, 253, 252 *251, 250, 249, 248 *247, 246, 245, 245 *244, 244, 244, 244 *244, 244, 244, 244 *245, 245, 246, 247 *248, 249, 250, 251 *252, 253, 255, 256 *256, 257, 259, 260 *261, 262, 263, 264 *265, 266, 267, 268 *268, 269, 269, 269 *269, 269, 269, 268 *268, 267, 266, 265 *264, 263, 262, 261 *260, 259, 257, 256 *256, 255, 253, 252 *251, 250, 249, 248 *247, 246, 245, 244 *244, 243, 243, 243 *243, 243, 243, 244 *244, 245, 246, 247 *248, 249, 250, 251 *252, 253, 255, 256 *256, 258, 259, 260 *261, 263, 264, 265 *266, 267, 268, 268 *269, 269, 269, 270 *270, 269, 269, 269 *268, 268, 267, 266 *265, 264, 263, 261 *260, 259, 258, 256 *256, 254, 253, 252 *251, 249, 248, 247 *246, 245, 244, 244 *243, 243, 243, 242 *242, 243, 243, 243 *244, 244, 245, 246 *247, 248, 249, 251 *252, 253, 254, 256 *256, 258, 259, 260 *262, 263, 264, 265 *266, 267, 268, 269 *269, 270, 270, 270 *270, 270, 270, 269 *269, 268, 267, 266 *265, 264, 263, 262 *260, 259, 258, 256 *256, 254, 253, 252 *250, 249, 248, 247 *246, 245, 244, 243 *243, 242, 242, 242 *242, 242, 242, 243 *243, 244, 245, 246 *247, 248, 249, 250 *252, 253, 254, 256 *256, 258, 259, 260 *262, 263, 264, 266 *267, 268, 268, 269 *270, 270, 270, 271 *271, 270, 270, 270 *269, 268, 268, 267 *266, 264, 263, 262 *260, 259, 258, 256 *256, 254, 253, 252 *250, 249, 248, 246 *245, 244, 244, 243 *242, 242, 242, 241 *241, 242, 242, 242 *243, 244, 244, 245 *246, 248, 249, 250 *252, 253, 254, 256 *256, 258, 259, 261 *262, 263, 265, 266 *267, 268, 269, 270 *270, 271, 271, 271 *271, 271, 271, 270 *270, 269, 268, 267 *266, 265, 263, 262 *261, 259, 258, 256 *256, 254, 253, 251 *250, 249, 247, 246 *245, 244, 243, 242 *242, 241, 241, 241 *241, 241, 241, 242 *242, 243, 244, 245 *246, 247, 249, 250 *251, 253, 254, 256 *256, 258, 259, 261 *262, 264, 265, 266 *267, 268, 269, 270 *271, 271, 272, 272 *272, 272, 271, 271 *270, 269, 268, 267 *266, 265, 264, 262 *261, 259, 258, 256 *256, 254, 253, 251 *250, 248, 247, 246 *245, 244, 243, 242 *241, 241, 240, 240 *240, 240, 241, 241 *242, 243, 244, 245 *246, 247, 248, 250 *251, 253, 254, 256 *256, 258, 259, 261 *263, 264, 265, 267 *268, 269, 270, 271 *271, 272, 272, 272 *272, 272, 272, 271 *271, 270, 269, 268 *267, 265, 264, 263 *261, 259, 258, 256 *256, 254, 253, 251 *249, 248, 247, 245 *244, 243, 242, 241 *241, 240, 240, 240 *240, 240, 240, 241 *241, 242, 243, 244 *245, 247, 248, 249 *251, 253, 254, 256 ; ************************************** ; ; TURRET CORRECTION TABLE (TCT) ; ; ************************************** ; *0, 0, 0, 0 *0, 0, 0, 0 *0, 0, 0, 0 *0, 0, 1, 1 *1, 1, 1, 1 *1, 1, 1, 1 *1, 1, 1, 1 *1, 1, 1, 1 *1, 1, 1, 1 *1, 1, 1, 1 *1, 1, 1, 1 *1, 1, 1, 1 *1, 1, 1, 1 *1, 1, 1, 1 *1, 1, 1, 1 *1, 1, 1, 1 *2, 1, 1, 1 *1, 1, 1, 1 *1, 1, 1, 1 *1, 1, 1, 1 *1, 1, 1, 1 *1, 1, 1, 1 *1, 1, 1, 1 *1, 1, 1, 1 *1, 1, 1, 1 *1, 1, 1, 1 *1, 1, 1, 1 *1, 1, 1, 1 *1, 1, 1, 0 *0, 0, 0, 0 *0, 0, 0, 0 *0, 0, 0, 0 *0, 0, 0, 0 *0, 0, 0, 0 *0, 0, 0, 0 *0, 0, -1, -1 *-1, -1, -1, -1 *-1, -1, -1, -1 *-1, -1, -1, -1 *-1, -1, -1, -1 *-1, -1, -1, -1 *-1, -1, -1, -1 *-1, -1, -1, -1 *-1, -1, -1, -1 *-1, -1, -1, -1 *-1, -1, -1, -1 *-1, -1, -1, -1 *-1, -1, -1, -1 *-2, -1, -1, -1 *-1, -1, -1, -1 *-1, -1, -1, -1 *-1, -1, -1, -1 *-1, -1, -1, -1 *-1, -1, -1, -1 *-1, -1, -1, -1 *-1, -1, -1, -1 *-1, -1, -1, -1 *-1, -1, -1, -1 *-1, -1, -1, -1 *-1, -1, -1, -1 *-1, -1, -1, 0 *0, 0, 0, 0 *0, 0, 0, 0 *0, 0, 0, 0 !start out 22, 10 ;Lay two mines out 22, 10 mov ax, 1 int i_keepshift mov confuse, 64 mov closeshotlim, 300 mov cycledelay, 3 mov cx, cycledelay ;mov fx, 40 ;mov dx, 0 ;mov ex, 100 mov reldir, 96 out p_throttle, 100 !rescan out p_arc, 64 !turn loop !nocheck1 call !DoCycle2 !nocheck1 out p_trotate, 128 !loop in p_scan, dist cmp dist, 1600 ja !turn cmp @3, 0 je !next_2 mov ax, @3 shl ax, 5 out p_trotate, ax !next_1 out p_arc, 32 loop !nocheck2 call !DoCycle !nocheck2 in p_scan, dist cmp dist, 1600 ja !rescan cmp @3, 0 je !next_3 mov ax, @3 shl ax, 4 out p_trotate, ax !next_2 out p_arc, 16 loop !nocheck3 call !DoCycle !nocheck3 in p_scan, dist cmp dist, 1600 jbe !dont_next_1 je !next_1 jne !next_1 !dont_next_1 cmp dist, closeshotlim jbe !closeshot cmp @3, 0 je !next_4 mov ax, @3 shl ax, 3 out p_trotate, ax !next_3 out p_arc, 8 loop !nocheck4 call !DoCycle !nocheck4 in p_scan, dist cmp dist, 1600 jbe !dont_next_2 je !next_2 jne !next_2 !dont_next_2 cmp dist, closeshotlim jbe !closeshotinit cmp @3, 0 je !next_5 mov ax, @3 shl ax, 2 out p_trotate, ax !next_4 out p_arc, 4 loop !nocheck5 call !DoCycle !nocheck5 in p_scan, dist cmp dist, 1600 jbe !dont_next_3 je !next_3 jne !next_3 !dont_next_3 cmp dist, closeshotlim jbe !closeshotinit mov ax, @3 shl ax, 1 out p_trotate, ax !next_5 out p_arc, 2 !contscan loop !nocheck6 call !DoCycle !nocheck6 in p_scan, dist cmp dist, 1600 jbe !dont_next_4 je !next_4 jne !next_4 !dont_next_4 cmp dist, closeshotlim jbe !closeshotinit in p_heat, ax ;cmp dist, 150 ;jb !closeshot cmp ax, 100 ja !contscan !shoot ;mov ax, @3 mov ex, @13 mov fx, @6 cmp ex, 0 ja !cpred neg ex add fx, 128 and fx, 255 !cpred sar ex, 5 sar fx, 2 sal ex, 6 add ex, 1032 add ex, fx cmp [ex], 256 je !sitkill out p_fire, @3 ;This should maybe be moved up a little ;out p_fire, @3 ;mov ax, 3144 ;add ax, @2 ;mov ax, [ax] ;add ax, [ex] ;out p_trotate, ax out p_trotate, [ex] out p_fire, @3 ;out p_fire, @3 ;out p_fire, @3 ;out p_trotate, ax ;Try to follow the bot jne !contscan je !contscan !sitkill ;Kill sitting duck efficently ;int 11 ;Get robot info (robot speed in dx) ;mov dx, @13 ;mov fx, @2 ;add fx, 128 ;and fx, 255 ;sar dx, 5 ;sar fx, 2 ;sal dx, 6 ;add dx, 1032 ;add dx, fx ;out p_trotate, [ex] mov ax, 3144 add ax, @2 mov ax, [ax] add ax, @3 out p_trotate, ax out p_fire out p_fire out p_fire out p_fire out p_fire ;out p_trotate, @3 jne !contscan je !contscan !closeshotinit out p_arc, 16 !closeshotstart loop !nocheck7 call !DoCycle !nocheck7 in p_scan, dist cmp dist, 350 ja !next_1 !closeshot in p_heat, ax cmp ax, 200 ja !closeshotstart mov ex, @13 mov fx, @6 cmp ex, 0 ja !cpred3 neg ex add fx, 128 and fx, 255 !cpred3 sar ex, 5 sar fx, 2 sal ex, 6 add ex, 1032 add ex, fx mov ax, @3 shl ax, 3 add ax, [ex] out p_trotate, ax out p_fire ;out p_fire jne !closeshotstart je !closeshotstart !DoCycle ;Does navigation and speed adjustments mov cx, cycledelay int i_locate ;Get position in ex:fx cmp ex, 100 jb !tofarleft cmp ex, 900 ja !tofarright cmp fx, 100 jb !tofarup cmp fx, 900 ja !tofardown ;neg reldir ;mov ax, @2 ;sub ax, reldir ;and ax, 255 ;out p_steering, ax out p_steering, 159 ;Navigation is primitive but very efficient! je !turndone jne !turndone !tofarleft mov ax, 96 sub ax, @1 out p_steering, ax je !turndone jne !turndone !tofarright mov ax, 224 sub ax, @1 out p_steering, ax je !turndone jne !turndone !tofarup mov ax, 160 sub ax, @1 out p_steering, ax je !turndone jne !turndone !tofardown mov ax, 32 sub ax, @1 out p_steering, ax je !turndone jne !turndone !turndone cmp @0, 100 je !nospeedchange out p_throttle, 100 !nospeedchange ret !DoCycle2 ;Does navigation and speed adjustments mov cx, cycledelay int i_locate ;Get position in ex:fx cmp ex, 100 jb !tofarleft2 cmp ex, 900 ja !tofarright2 cmp fx, 100 jb !tofarup2 cmp fx, 900 ja !tofardown2 neg confuse out p_steering, confuse je !turndone2 jne !turndone2 !tofarleft2 mov ax, 96 sub ax, @1 out p_steering, ax je !turndone2 jne !turndone2 !tofarright2 mov ax, 224 sub ax, @1 out p_steering, ax je !turndone2 jne !turndone2 !tofarup2 mov ax, 160 sub ax, @1 out p_steering, ax je !turndone2 jne !turndone2 !tofardown2 mov ax, 32 sub ax, @1 out p_steering, ax je !turndone2 jne !turndone2 !turndone2 cmp @0, 100 je !nospeedchange2 out p_throttle, 100 !nospeedchange2 ret