hedgewars/HHHandlers.inc
changeset 15 6200cca92480
parent 7 b472e4b1a106
child 16 b6f4b413dd41
equal deleted inserted replaced
14:81f125629b25 15:6200cca92480
    33 
    33 
    34 procedure doStepHedgehog(Gear: PGear); forward;
    34 procedure doStepHedgehog(Gear: PGear); forward;
    35 ////////////////////////////////////////////////////////////////////////////////
    35 ////////////////////////////////////////////////////////////////////////////////
    36 procedure doStepHedgehogDriven(Gear: PGear);
    36 procedure doStepHedgehogDriven(Gear: PGear);
    37 const StepTicks: LongWord = 0;
    37 const StepTicks: LongWord = 0;
       
    38 var t: PGear;
    38 begin
    39 begin
    39 if isinMultiShoot and (Gear.Damage = 0) then exit;
    40 if isinMultiShoot and (Gear.Damage = 0) then exit;
    40 AllInactive:= false;
    41 AllInactive:= false;
    41 if (TurnTimeLeft = 0) or (Gear.Damage > 0) then
    42 if (TurnTimeLeft = 0) or (Gear.Damage > 0) then
    42    begin
    43    begin
    44       and (CurAmmoGear = nil) then Gear.dX:= 0.0000001 * Sign(Gear.dX);
    45       and (CurAmmoGear = nil) then Gear.dX:= 0.0000001 * Sign(Gear.dX);
    45    Gear.State:= Gear.State and not gstHHDriven;
    46    Gear.State:= Gear.State and not gstHHDriven;
    46    if Gear.Damage > 0 then
    47    if Gear.Damage > 0 then
    47       Gear.State:= Gear.State and not gstHHJumping;
    48       Gear.State:= Gear.State and not gstHHJumping;
    48    exit
    49    exit
       
    50    end;
       
    51    
       
    52 // check for case with ammo
       
    53 t:= CheckGearNear(Gear, gtCase, 25, 25);
       
    54 if t <> nil then
       
    55    begin
       
    56    t.Message:= gm_Destroy;
       
    57    ; // take ammo from it
    49    end;
    58    end;
    50 
    59 
    51 if CurAmmoGear <> nil then
    60 if CurAmmoGear <> nil then
    52    begin
    61    begin
    53    CurAmmoGear.Message:= Gear.Message;
    62    CurAmmoGear.Message:= Gear.Message;