hedgewars/uGears.pas
changeset 511 2b5b9e00419d
parent 509 fd58135a4407
child 515 270f10276d2e
equal deleted inserted replaced
510:4e994e1b7abb 511:2b5b9e00419d
    42              Elasticity: hwFloat;
    42              Elasticity: hwFloat;
    43              Friction  : hwFloat;
    43              Friction  : hwFloat;
    44              Message : Longword;
    44              Message : Longword;
    45              Hedgehog: pointer;
    45              Hedgehog: pointer;
    46              Health, Damage: LongInt;
    46              Health, Damage: LongInt;
    47              CollIndex: Longword;
    47              CollisionIndex: LongInt;
    48              Tag: LongInt;
    48              Tag: LongInt;
    49              Surf: PSDL_Surface;
    49              Surf: PSDL_Surface;
    50              Z: Longword;
    50              Z: Longword;
    51              IntersectGear: PGear;
    51              IntersectGear: PGear;
    52              end;
    52              end;
   173 Result^.State:= State;
   173 Result^.State:= State;
   174 Result^.Active:= true;
   174 Result^.Active:= true;
   175 Result^.dX:= dX;
   175 Result^.dX:= dX;
   176 Result^.dY:= dY;
   176 Result^.dY:= dY;
   177 Result^.doStep:= doStepHandlers[Kind];
   177 Result^.doStep:= doStepHandlers[Kind];
   178 Result^.CollIndex:= High(Longword);
   178 Result^.CollisionIndex:= -1;
   179 Result^.Timer:= Timer;
   179 Result^.Timer:= Timer;
   180 
   180 
   181 if CurrentTeam <> nil then
   181 if CurrentTeam <> nil then
   182    begin
   182    begin
   183    Result^.Hedgehog:= @(CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog]);
   183    Result^.Hedgehog:= @(CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog]);
   275                 end;
   275                 end;
   276      gtAirBomb: begin
   276      gtAirBomb: begin
   277                 Result^.Radius:= 10;
   277                 Result^.Radius:= 10;
   278                 end;
   278                 end;
   279    gtBlowTorch: begin
   279    gtBlowTorch: begin
   280                 Result^.Radius:= cHHRadius;
   280                 Result^.Radius:= cHHRadius + cBlowTorchC;
   281                 Result^.Timer:= 7500;
   281                 Result^.Timer:= 7500;
   282                 end;
   282                 end;
   283      end;
   283      end;
   284 InsertGearToList(Result);
   284 InsertGearToList(Result);
   285 AddGear:= Result
   285 AddGear:= Result
   462              hwSign(Gear^.dX), 0,
   462              hwSign(Gear^.dX), 0,
   463              PHedgehog(Gear^.Hedgehog)^.visStepPos div 2,
   463              PHedgehog(Gear^.Hedgehog)^.visStepPos div 2,
   464              Surface);
   464              Surface);
   465 
   465 
   466 with PHedgehog(Gear^.Hedgehog)^ do
   466 with PHedgehog(Gear^.Hedgehog)^ do
   467      if Gear^.State = 0 then
   467      if (Gear^.State and not gstAnimation) = 0 then
   468         begin
   468         begin
   469         t:= hwRound(Gear^.Y) - cHHRadius - 10 + WorldDy;
   469         t:= hwRound(Gear^.Y) - cHHRadius - 10 + WorldDy;
   470         dec(t, HealthTag^.h + 2);
   470         dec(t, HealthTag^.h + 2);
   471         DrawCentered(hwRound(Gear^.X) + WorldDx, t, HealthTag, Surface);
   471         DrawCentered(hwRound(Gear^.X) + WorldDx, t, HealthTag, Surface);
   472         dec(t, NameTag^.h + 2);
   472         dec(t, NameTag^.h + 2);