hedgewars/uGears.pas
changeset 505 fcba7d7aea0d
parent 503 2cfdc4bfc2be
child 506 0889d833d47e
equal deleted inserted replaced
504:13b6ebc53627 505:fcba7d7aea0d
    46              Health, Damage: LongInt;
    46              Health, Damage: LongInt;
    47              CollIndex: Longword;
    47              CollIndex: Longword;
    48              Tag: LongInt;
    48              Tag: LongInt;
    49              Surf: PSDL_Surface;
    49              Surf: PSDL_Surface;
    50              Z: Longword;
    50              Z: Longword;
       
    51              IntersectGear: PGear;
    51              end;
    52              end;
    52 
    53 
    53 function  AddGear(X, Y: LongInt; Kind: TGearType; State: Longword; dX, dY: hwFloat; Timer: LongWord): PGear;
    54 function  AddGear(X, Y: LongInt; Kind: TGearType; State: Longword; dX, dY: hwFloat; Timer: LongWord): PGear;
    54 procedure ProcessGears;
    55 procedure ProcessGears;
    55 procedure SetAllToActive;
    56 procedure SetAllToActive;
   173 Result^.dX:= dX;
   174 Result^.dX:= dX;
   174 Result^.dY:= dY;
   175 Result^.dY:= dY;
   175 Result^.doStep:= doStepHandlers[Kind];
   176 Result^.doStep:= doStepHandlers[Kind];
   176 Result^.CollIndex:= High(Longword);
   177 Result^.CollIndex:= High(Longword);
   177 Result^.Timer:= Timer;
   178 Result^.Timer:= Timer;
       
   179 
   178 if CurrentTeam <> nil then
   180 if CurrentTeam <> nil then
       
   181    begin
   179    Result^.Hedgehog:= @(CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog]);
   182    Result^.Hedgehog:= @(CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog]);
       
   183    Result^.IntersectGear:= CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog].Gear
       
   184    end;
       
   185    
   180 case Kind of
   186 case Kind of
   181        gtCloud: Result^.Z:= High(Result^.Z);
   187        gtCloud: Result^.Z:= High(Result^.Z);
   182    gtAmmo_Bomb: begin
   188    gtAmmo_Bomb: begin
   183                 Result^.Radius:= 4;
   189                 Result^.Radius:= 4;
   184                 Result^.Elasticity:= _0_6;
   190                 Result^.Elasticity:= _0_6;