hedgewars/uGears.pas
changeset 43 e297fea1a2f3
parent 42 72ffe21f027c
child 46 c99140d2355a
equal deleted inserted replaced
42:72ffe21f027c 43:e297fea1a2f3
   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         //!!!              ACHTUNG!!!!
   496         gtDynamite: DrawSprite2(sprDynamite, Round(Gear.X) - 8 + WorldDx, Round(Gear.Y) - 8 + WorldDy, Gear.Tag and 1, Gear.Tag shr 1, Surface);
   497         gtDynamite: if ((Gear.State and gstAttacking) = 0)or((Gear.Timer and $3FF) < 420)
       
   498                        then DrawSprite(sprMineOff , Round(Gear.X) - 8 + WorldDx, Round(Gear.Y) - 8 + WorldDy, trunc(Gear.DirAngle), Surface)
       
   499                        else DrawSprite(sprMineOn  , Round(Gear.X) - 8 + WorldDx, Round(Gear.Y) - 8 + WorldDy, trunc(Gear.DirAngle), Surface);
       
   500         //!!!              ACHTUNG!!!!                     
       
   501             gtCase: case Gear.Pos of
   497             gtCase: case Gear.Pos of
   502                          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);
   503                          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);
   504                          end;
   500                          end;
   505               end;
   501               end;
   658 
   654 
   659 procedure SpawnBoxOfSmth;
   655 procedure SpawnBoxOfSmth;
   660 var i, x, y, k: integer;
   656 var i, x, y, k: integer;
   661     b: boolean;
   657     b: boolean;
   662 begin
   658 begin
   663 if CountGears(gtCase) > 2 then exit;
   659 if (CountGears(gtCase) > 1) or (getrandom(3) <> 0) then exit;
   664 k:= 7;
   660 k:= 7;
   665 repeat
   661 repeat
   666   x:= getrandom(2000) + 24;
   662   x:= getrandom(2000) + 24;
   667 //  {$IFDEF DEBUGFILE}AddFileLog('SpawnBoxOfSmth: check x = '+inttostr(x));{$ENDIF}
   663 //  {$IFDEF DEBUGFILE}AddFileLog('SpawnBoxOfSmth: check x = '+inttostr(x));{$ENDIF}
   668   b:= false;
   664   b:= false;