hedgewars/uGearsHedgehog.pas
changeset 10179 26c4256a9e4b
parent 10178 949b51ca18c6
child 10354 56bd029245fc
equal deleted inserted replaced
10177:0f9042536c46 10179:26c4256a9e4b
   604 
   604 
   605 ////////////////////////////////////////////////////////////////////////////////
   605 ////////////////////////////////////////////////////////////////////////////////
   606 procedure doStepHedgehogGone(Gear: PGear);
   606 procedure doStepHedgehogGone(Gear: PGear);
   607 const frametime = 65;
   607 const frametime = 65;
   608       timertime = frametime * 11;
   608       timertime = frametime * 11;
       
   609 var i: LongInt;
   609 begin
   610 begin
   610 if Gear^.Hedgehog^.Unplaced then
   611 if Gear^.Hedgehog^.Unplaced then
   611     exit;
   612     exit;
   612 if Gear^.Timer > 1 then
   613 if Gear^.Timer > 1 then
   613     begin
   614     begin
   626     begin
   627     begin
   627     AllInactive:= false;
   628     AllInactive:= false;
   628     Gear^.Z:= cCurrHHZ;
   629     Gear^.Z:= cCurrHHZ;
   629     RemoveGearFromList(Gear);
   630     RemoveGearFromList(Gear);
   630     InsertGearToList(Gear);
   631     InsertGearToList(Gear);
   631     PlaySoundV(sndByeBye, Gear^.Hedgehog^.Team^.voicepack);
   632     // only play sound for one alive hedgehog
   632     PlaySound(sndWarp);
   633     with Gear^.Hedgehog^.Team^ do
       
   634         for i:= 0 to cMaxHHIndex do
       
   635             begin
       
   636             if (Hedgehogs[i].Gear <> nil) then
       
   637                 begin
       
   638                 if (Hedgehogs[i].Gear = Gear) then
       
   639                     begin
       
   640                     PlaySoundV(sndByeBye, Gear^.Hedgehog^.Team^.voicepack);
       
   641                     PlaySound(sndWarp);
       
   642                     end;
       
   643                 break;
       
   644                 end;
       
   645             end;
   633     Gear^.Pos:= 0;
   646     Gear^.Pos:= 0;
   634     Gear^.Timer:= timertime
   647     Gear^.Timer:= timertime
   635     end
   648     end
   636 end;
   649 end;
   637 
   650