hedgewars/GSHandlers.inc
changeset 3351 3fd3f116f2fc
parent 3350 5cd02aafc612
child 3355 dc9e61e67484
equal deleted inserted replaced
3350:5cd02aafc612 3351:3fd3f116f2fc
  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);
  3056 doStepFallingGear(Gear);
  3057 if (Gear^.State and gstCollision) <> 0 then
  3057 if (CurrentHedgehog <> nil) and (CurrentHedgehog^.Gear <> nil) and ((CurrentHedgehog^.Gear^.Message and gm_Slot) <> 0) then
       
  3058     begin
       
  3059     case CurrentHedgehog^.Gear^.MsgParam of
       
  3060         0: PlaySound(sndPiano0);
       
  3061         1: PlaySound(sndPiano1);
       
  3062         2: PlaySound(sndPiano2);
       
  3063         3: PlaySound(sndPiano3);
       
  3064         4: PlaySound(sndPiano4);
       
  3065         5: PlaySound(sndPiano5);
       
  3066         6: PlaySound(sndPiano6);
       
  3067         7: PlaySound(sndPiano7);
       
  3068         else PlaySound(sndPiano8);
       
  3069         end;
       
  3070     CurrentHedgehog^.Gear^.MsgParam:= 0;
       
  3071     CurrentHedgehog^.Gear^.Message:= CurrentHedgehog^.Gear^.Message and not gm_Slot;
       
  3072     end;
       
  3073 
       
  3074 if (Gear^.State and gstDrowning) <> 0 then
       
  3075     ResumeMusic
       
  3076 else if (Gear^.State and gstCollision) <> 0 then
  3058     begin
  3077     begin
  3059     r0:= GetRandom(21);
  3078     r0:= GetRandom(21);
  3060     r1:= GetRandom(21);
  3079     r1:= GetRandom(21);
  3061     doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 80 + r0, EXPLAutoSound);
  3080     doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 80 + r0, EXPLAutoSound);
  3062     doMakeExplosion(hwRound(Gear^.X) - 30 - r0, hwRound(Gear^.Y) + 40, 40 + r1, EXPLAutoSound);
  3081     doMakeExplosion(hwRound(Gear^.X) - 30 - r0, hwRound(Gear^.Y) + 40, 40 + r1, EXPLAutoSound);