hedgewars/uGearsHandlersMess.pas
changeset 13983 3ae88a9f9dca
parent 13980 350adfa0e896
child 13988 cde9920150c6
equal deleted inserted replaced
13982:e340ce5500d7 13983:3ae88a9f9dca
  5186 var
  5186 var
  5187     r0, r1: LongInt;
  5187     r0, r1: LongInt;
  5188     odY: hwFloat;
  5188     odY: hwFloat;
  5189 begin
  5189 begin
  5190     AllInactive := false;
  5190     AllInactive := false;
       
  5191     // Play piano notes with slot keys
  5191     if (CurrentHedgehog <> nil) and (CurrentHedgehog^.Gear <> nil) and
  5192     if (CurrentHedgehog <> nil) and (CurrentHedgehog^.Gear <> nil) and
  5192         ((CurrentHedgehog^.Gear^.Message and gmSlot) <> 0) then
  5193         ((CurrentHedgehog^.Gear^.Message and gmSlot) <> 0) then
  5193             begin
  5194             begin
       
  5195                 // Piano notes are played if sound OR music (or both) is enabled
  5194                 case CurrentHedgehog^.Gear^.MsgParam of
  5196                 case CurrentHedgehog^.Gear^.MsgParam of
  5195                 0: PlaySound(sndPiano0);
  5197                 0: PlaySound(sndPiano0, false, false, true);
  5196                 1: PlaySound(sndPiano1);
  5198                 1: PlaySound(sndPiano1, false, false, true);
  5197                 2: PlaySound(sndPiano2);
  5199                 2: PlaySound(sndPiano2, false, false, true);
  5198                 3: PlaySound(sndPiano3);
  5200                 3: PlaySound(sndPiano3, false, false, true);
  5199                 4: PlaySound(sndPiano4);
  5201                 4: PlaySound(sndPiano4, false, false, true);
  5200                 5: PlaySound(sndPiano5);
  5202                 5: PlaySound(sndPiano5, false, false, true);
  5201                 6: PlaySound(sndPiano6);
  5203                 6: PlaySound(sndPiano6, false, false, true);
  5202                 7: PlaySound(sndPiano7);
  5204                 7: PlaySound(sndPiano7, false, false, true);
  5203                 else PlaySound(sndPiano8);
  5205                 8: PlaySound(sndPiano8, false, false, true);
  5204             end;
  5206             end;
  5205         AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtNote);
  5207         AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtNote);
  5206         CurrentHedgehog^.Gear^.MsgParam := 0;
  5208         CurrentHedgehog^.Gear^.MsgParam := 0;
  5207         CurrentHedgehog^.Gear^.Message := CurrentHedgehog^.Gear^.Message and (not gmSlot);
  5209         CurrentHedgehog^.Gear^.Message := CurrentHedgehog^.Gear^.Message and (not gmSlot);
  5208         end;
  5210         end;