hedgewars/uGears.pas
changeset 46 c99140d2355a
parent 43 e297fea1a2f3
child 47 8daf1ee0b9a3
equal deleted inserted replaced
45:1072e7fe85c8 46:c99140d2355a
   491                     end;
   491                     end;
   492        gtExplosion: DrawSprite(sprExplosion50, Round(Gear.X) + WorldDx, Round(Gear.Y) + WorldDy, Gear.State, Surface);
   492        gtExplosion: DrawSprite(sprExplosion50, Round(Gear.X) + WorldDx, Round(Gear.Y) + WorldDy, Gear.State, Surface);
   493             gtMine: if ((Gear.State and gstAttacking) = 0)or((Gear.Timer and $3FF) < 420)
   493             gtMine: if ((Gear.State and gstAttacking) = 0)or((Gear.Timer and $3FF) < 420)
   494                        then DrawSprite(sprMineOff , Round(Gear.X) - 8 + WorldDx, Round(Gear.Y) - 8 + WorldDy, trunc(Gear.DirAngle), Surface)
   494                        then DrawSprite(sprMineOff , Round(Gear.X) - 8 + WorldDx, Round(Gear.Y) - 8 + WorldDy, trunc(Gear.DirAngle), Surface)
   495                        else DrawSprite(sprMineOn  , Round(Gear.X) - 8 + WorldDx, Round(Gear.Y) - 8 + WorldDy, trunc(Gear.DirAngle), Surface);
   495                        else DrawSprite(sprMineOn  , Round(Gear.X) - 8 + WorldDx, Round(Gear.Y) - 8 + WorldDy, trunc(Gear.DirAngle), Surface);
   496         gtDynamite: DrawSprite2(sprDynamite, Round(Gear.X) - 8 + WorldDx, Round(Gear.Y) - 8 + WorldDy, Gear.Tag and 1, Gear.Tag shr 1, Surface);
   496         gtDynamite: DrawSprite2(sprDynamite, Round(Gear.X) - 16 + WorldDx, Round(Gear.Y) - 25 + WorldDy, Gear.Tag and 1, Gear.Tag shr 1, Surface);
   497             gtCase: case Gear.Pos of
   497             gtCase: case Gear.Pos of
   498                          posCaseAmmo  : DrawSprite(sprCase, Round(Gear.X) - 16 + WorldDx, Round(Gear.Y) - 16 + WorldDy, 0, Surface);
   498                          posCaseAmmo  : DrawSprite(sprCase, Round(Gear.X) - 16 + WorldDx, Round(Gear.Y) - 16 + WorldDy, 0, Surface);
   499                          posCaseHealth: DrawSprite(sprFAid, Round(Gear.X) - 16 + WorldDx, Round(Gear.Y) - 16 + WorldDy, (GameTicks shr 6) and $F, Surface);
   499                          posCaseHealth: DrawSprite(sprFAid, Round(Gear.X) - 16 + WorldDx, Round(Gear.Y) - 16 + WorldDy, (GameTicks shr 6) and $F, Surface);
   500                          end;
   500                          end;
   501               end;
   501               end;
   630       begin
   630       begin
   631       if t.Kind in Kind then
   631       if t.Kind in Kind then
   632          if sqr(mX - t.X) / rX + sqr(mY - t.Y) / rY <= 1 then
   632          if sqr(mX - t.X) / rX + sqr(mY - t.Y) / rY <= 1 then
   633             begin
   633             begin
   634             Result:= t;
   634             Result:= t;
   635             {$IFDEF DEBUGFILE}AddFileLog('CheckGearsNear: near ('+inttostr(mx)+','+inttostr(my)+') is gear '+inttostr(integer(t)));{$ENDIF}
   635 //            {$IFDEF DEBUGFILE}AddFileLog('CheckGearsNear: near ('+inttostr(mx)+','+inttostr(my)+') is gear '+inttostr(integer(t)));{$ENDIF}
   636             exit
   636             exit
   637             end;
   637             end;
   638       t:= t.NextGear
   638       t:= t.NextGear
   639       end;
   639       end;
   640 Result:= nil
   640 Result:= nil
   670         while (i <= x + 13) and not b do // 13 is gtCase HalfWidth-1
   670         while (i <= x + 13) and not b do // 13 is gtCase HalfWidth-1
   671               begin
   671               begin
   672               if Land[y, i] <> 0 then
   672               if Land[y, i] <> 0 then
   673                  begin
   673                  begin
   674                  b:= true;
   674                  b:= true;
   675                  {$IFDEF DEBUGFILE}AddFileLog('SpawnBoxOfSmth: Land['+inttostr(y)+','+inttostr(i)+'] <> 0');{$ENDIF}
   675 //                 {$IFDEF DEBUGFILE}AddFileLog('SpawnBoxOfSmth: Land['+inttostr(y)+','+inttostr(i)+'] <> 0');{$ENDIF}
   676                  end;
   676                  end;
   677               inc(i)
   677               inc(i)
   678               end;
   678               end;
   679         end;
   679         end;
   680   if b then
   680   if b then