hedgewars/uAIMisc.pas
changeset 1753 2ccba26f1aa4
parent 1519 7b6adbe5266a
child 1799 b945f4174d00
equal deleted inserted replaced
1752:769986d39202 1753:2ccba26f1aa4
   174 end;
   174 end;
   175 
   175 
   176 function TestColl(x, y, r: LongInt): boolean;
   176 function TestColl(x, y, r: LongInt): boolean;
   177 var b: boolean;
   177 var b: boolean;
   178 begin
   178 begin
   179 b:= (((x-r) and $FFFFF800) = 0)and(((y-r) and $FFFFFC00) = 0) and (Land[y-r, x-r] <> 0);
   179 b:= (((x-r) and LAND_WIDTH_MASK) = 0)and(((y-r) and LAND_HEIGHT_MASK) = 0) and (Land[y-r, x-r] <> 0);
   180 if b then exit(true);
   180 if b then exit(true);
   181 b:=(((x-r) and $FFFFF800) = 0)and(((y+r) and $FFFFFC00) = 0) and (Land[y+r, x-r] <> 0);
   181 b:=(((x-r) and LAND_WIDTH_MASK) = 0)and(((y+r) and LAND_HEIGHT_MASK) = 0) and (Land[y+r, x-r] <> 0);
   182 if b then exit(true);
   182 if b then exit(true);
   183 b:=(((x+r) and $FFFFF800) = 0)and(((y-r) and $FFFFFC00) = 0) and (Land[y-r, x+r] <> 0);
   183 b:=(((x+r) and LAND_WIDTH_MASK) = 0)and(((y-r) and LAND_HEIGHT_MASK) = 0) and (Land[y-r, x+r] <> 0);
   184 if b then exit(true);
   184 if b then exit(true);
   185 TestColl:=(((x+r) and $FFFFF800) = 0)and(((y+r) and $FFFFFC00) = 0) and (Land[y+r, x+r] <> 0)
   185 TestColl:=(((x+r) and LAND_WIDTH_MASK) = 0)and(((y+r) and LAND_HEIGHT_MASK) = 0) and (Land[y+r, x+r] <> 0)
   186 end;
   186 end;
   187 
   187 
   188 function RateExplosion(Me: PGear; x, y, r: LongInt): LongInt;
   188 function RateExplosion(Me: PGear; x, y, r: LongInt): LongInt;
   189 var i, dmg, Result: LongInt;
   189 var i, dmg, Result: LongInt;
   190 begin
   190 begin