hedgewars/GSHandlers.inc
changeset 3728 9478d13b2f9b
parent 3720 b2b108a6fae8
child 3751 a70c61c076ae
equal deleted inserted replaced
3727:1bee60236515 3728:9478d13b2f9b
  1473     begin
  1473     begin
  1474         AllInactive := false;
  1474         AllInactive := false;
  1475         if (Gear^.Timer and $FF) = 0 then PlaySound(sndMineTick);
  1475         if (Gear^.Timer and $FF) = 0 then PlaySound(sndMineTick);
  1476         if Gear^.Timer = 0 then
  1476         if Gear^.Timer = 0 then
  1477         begin
  1477         begin
  1478             doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 50, EXPLAutoSound);
  1478             doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 30, EXPLAutoSound);
  1479             DeleteGear(Gear);
  1479             DeleteGear(Gear);
  1480             exit
  1480             exit
  1481         end;
  1481         end;
  1482         dec(Gear^.Timer);
  1482         dec(Gear^.Timer);
  1483     end
  1483     end
  3579 end;
  3579 end;
  3580 
  3580 
  3581 procedure doStepPiano(Gear: PGear);
  3581 procedure doStepPiano(Gear: PGear);
  3582 var 
  3582 var 
  3583     r0, r1: LongInt;
  3583     r0, r1: LongInt;
       
  3584     odY: hwFloat;
  3584 begin
  3585 begin
  3585     AllInactive := false;
  3586     AllInactive := false;
  3586     if (CurrentHedgehog <> nil) and (CurrentHedgehog^.Gear <> nil) and ((CurrentHedgehog^.Gear^.
  3587     if (CurrentHedgehog <> nil) and (CurrentHedgehog^.Gear <> nil) and ((CurrentHedgehog^.Gear^.
  3587        Message and gm_Slot) <> 0) then
  3588        Message and gm_Slot) <> 0) then
  3588     begin
  3589     begin
  3600         AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtNote);
  3601         AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtNote);
  3601         CurrentHedgehog^.Gear^.MsgParam := 0;
  3602         CurrentHedgehog^.Gear^.MsgParam := 0;
  3602         CurrentHedgehog^.Gear^.Message := CurrentHedgehog^.Gear^.Message and not gm_Slot;
  3603         CurrentHedgehog^.Gear^.Message := CurrentHedgehog^.Gear^.Message and not gm_Slot;
  3603     end;
  3604     end;
  3604 
  3605 
  3605     if ((Gear^.Pos = 3) and ((GameFlags and gfSolidLand) <> 0)) or (Gear^.Pos = 20) then
  3606     if (*((Gear^.Pos = 3) and ((GameFlags and gfSolidLand) <> 0)) or*) (Gear^.Pos = 5) then
  3606         // bounce up to 20 times (3 times on gameflagged solid land) before dropping past landscape
  3607         // bounce up to 10 times (3 times on gameflagged solid land) before dropping past landscape
  3607     begin
  3608     begin
  3608         Gear^.dY := Gear^.dY + cGravity * 3;
  3609         Gear^.dY := Gear^.dY + cGravity * 2;
  3609         Gear^.Y := Gear^.Y + Gear^.dY;
  3610         Gear^.Y := Gear^.Y + Gear^.dY;
  3610         CheckGearDrowning(Gear);
  3611         CheckGearDrowning(Gear);
  3611         if (Gear^.State and gstDrowning) <> 0 then
  3612         if (Gear^.State and gstDrowning) <> 0 then
  3612         begin
  3613         begin
  3613             if CurrentHedgehog^.Gear <> nil then
  3614             if CurrentHedgehog^.Gear <> nil then
  3621             ResumeMusic
  3622             ResumeMusic
  3622         end;
  3623         end;
  3623         exit
  3624         exit
  3624     end;
  3625     end;
  3625 
  3626 
       
  3627     odY:= Gear^.dY;
  3626     doStepFallingGear(Gear);
  3628     doStepFallingGear(Gear);
  3627 
  3629 
  3628     if (Gear^.State and gstDrowning) <> 0 then
  3630     if (Gear^.State and gstDrowning) <> 0 then
  3629     begin
  3631     begin
  3630         if CurrentHedgehog^.Gear <> nil then
  3632         if CurrentHedgehog^.Gear <> nil then
  3644             doMakeExplosion(hwRound(Gear^.X) - 30 - r0, hwRound(Gear^.Y) + 40, 40 + r1, 0);
  3646             doMakeExplosion(hwRound(Gear^.X) - 30 - r0, hwRound(Gear^.Y) + 40, 40 + r1, 0);
  3645             doMakeExplosion(hwRound(Gear^.X) + 30 + r1, hwRound(Gear^.Y) + 40, 40 + r0, 0);
  3647             doMakeExplosion(hwRound(Gear^.X) + 30 + r1, hwRound(Gear^.Y) + 40, 40 + r0, 0);
  3646             doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 80 + r0, EXPLAutoSound);
  3648             doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 80 + r0, EXPLAutoSound);
  3647             for r0:= 0 to 4 do
  3649             for r0:= 0 to 4 do
  3648                 AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtNote);
  3650                 AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtNote);
  3649             Gear^.dY := -_1;
  3651             Gear^.dY := odY * -1 + cGravity * 2;
  3650             Gear^.Pos := Gear^.Pos + 1;
  3652             Gear^.Pos := Gear^.Pos + 1;
  3651         end
  3653         end
  3652     else
  3654     else
  3653         Gear^.dY := Gear^.dY + cGravity * 2;
  3655         Gear^.dY := Gear^.dY + cGravity * 2;
  3654     // let it fall faster so itdoesn't take too long for the whole attack
  3656     // let it fall faster so itdoesn't take too long for the whole attack