hedgewars/GSHandlers.inc
changeset 3358 546e75f839ce
parent 3356 3ae3fccb439e
child 3359 d17b9f6adae5
equal deleted inserted replaced
3357:3836a31879e7 3358:546e75f839ce
  3051 
  3051 
  3052 procedure doStepPiano(Gear: PGear);
  3052 procedure doStepPiano(Gear: PGear);
  3053 var r0, r1: LongInt;
  3053 var r0, r1: LongInt;
  3054 begin
  3054 begin
  3055 AllInactive:= false;
  3055 AllInactive:= false;
  3056 doStepFallingGear(Gear);
       
  3057 if (CurrentHedgehog <> nil) and (CurrentHedgehog^.Gear <> nil) and ((CurrentHedgehog^.Gear^.Message and gm_Slot) <> 0) then
  3056 if (CurrentHedgehog <> nil) and (CurrentHedgehog^.Gear <> nil) and ((CurrentHedgehog^.Gear^.Message and gm_Slot) <> 0) then
  3058     begin
  3057     begin
  3059     case CurrentHedgehog^.Gear^.MsgParam of
  3058     case CurrentHedgehog^.Gear^.MsgParam of
  3060         0: PlaySound(sndPiano0);
  3059         0: PlaySound(sndPiano0);
  3061         1: PlaySound(sndPiano1);
  3060         1: PlaySound(sndPiano1);
  3069         end;
  3068         end;
  3070     CurrentHedgehog^.Gear^.MsgParam:= 0;
  3069     CurrentHedgehog^.Gear^.MsgParam:= 0;
  3071     CurrentHedgehog^.Gear^.Message:= CurrentHedgehog^.Gear^.Message and not gm_Slot;
  3070     CurrentHedgehog^.Gear^.Message:= CurrentHedgehog^.Gear^.Message and not gm_Slot;
  3072     end;
  3071     end;
  3073 
  3072 
       
  3073 if ((Gear^.Pos = 3) and ((GameFlags and gfSolidLand) <> 0)) or (Gear^.Pos = 20) then // bounce up to 20 times (3 times on gameflagged solid land) before dropping past landscape
       
  3074     begin
       
  3075     Gear^.dY:= Gear^.dY + cGravity * 3;
       
  3076     Gear^.Y:= Gear^.Y + Gear^.dY;
       
  3077     CheckGearDrowning(Gear);
       
  3078     exit
       
  3079     end;
       
  3080 
       
  3081 doStepFallingGear(Gear);
       
  3082 
  3074 if (Gear^.State and gstDrowning) <> 0 then
  3083 if (Gear^.State and gstDrowning) <> 0 then
  3075     ResumeMusic
  3084     ResumeMusic
  3076 else if (Gear^.State and gstCollision) <> 0 then
  3085 else if (Gear^.State and gstCollision) <> 0 then
  3077     begin
  3086     begin
  3078     r0:= GetRandom(21);
  3087     r0:= GetRandom(21);
  3079     r1:= GetRandom(21);
  3088     r1:= GetRandom(21);
  3080     doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 80 + r0, EXPLAutoSound);
  3089     doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 80 + r0, EXPLAutoSound);
  3081     doMakeExplosion(hwRound(Gear^.X) - 30 - r0, hwRound(Gear^.Y) + 40, 40 + r1, EXPLAutoSound);
  3090     doMakeExplosion(hwRound(Gear^.X) - 30 - r0, hwRound(Gear^.Y) + 40, 40 + r1, EXPLAutoSound);
  3082     doMakeExplosion(hwRound(Gear^.X) + 30 + r1, hwRound(Gear^.Y) + 40, 40 + r0, EXPLAutoSound);
  3091     doMakeExplosion(hwRound(Gear^.X) + 30 + r1, hwRound(Gear^.Y) + 40, 40 + r0, EXPLAutoSound);
  3083     Gear^.dY:= -_1;
  3092     Gear^.dY:= -_1;
       
  3093     Gear^.Pos:= Gear^.Pos + 1;
  3084     end
  3094     end
  3085 else
  3095 else
  3086     Gear^.dY:= Gear^.dY + cGravity * 2; // let it fall faster so itdoesn't take too long for the whole attack
  3096     Gear^.dY:= Gear^.dY + cGravity * 2; // let it fall faster so itdoesn't take too long for the whole attack
  3087 end;
  3097 end;