hedgewars/uGearsHedgehog.pas
changeset 7053 8c9dcaedc7a8
parent 7028 0f60591f3a16
child 7067 f98ec3aecf4e
equal deleted inserted replaced
7052:cefb73639f70 7053:8c9dcaedc7a8
   306                                  playSound(sndMortar);
   306                                  playSound(sndMortar);
   307                                  newGear:= AddGear(hwRound(lx), hwRound(ly), gtMortar,  0, xx*cMaxPower/cPowerDivisor, yy*cMaxPower/cPowerDivisor, 0);
   307                                  newGear:= AddGear(hwRound(lx), hwRound(ly), gtMortar,  0, xx*cMaxPower/cPowerDivisor, yy*cMaxPower/cPowerDivisor, 0);
   308                                  end;
   308                                  end;
   309                       amRCPlane: begin
   309                       amRCPlane: begin
   310                                  newGear:= AddGear(hwRound(lx), hwRound(ly), gtRCPlane,  0, xx * cMaxPower / cPowerDivisor / 4, yy * cMaxPower / cPowerDivisor / 4, 0);
   310                                  newGear:= AddGear(hwRound(lx), hwRound(ly), gtRCPlane,  0, xx * cMaxPower / cPowerDivisor / 4, yy * cMaxPower / cPowerDivisor / 4, 0);
   311                                  newGear^.SoundChannel:= LoopSound(sndRCPlane, nil)
   311                                  newGear^.SoundChannel:= LoopSound(sndRCPlane)
   312                                  end;
   312                                  end;
   313                      amKamikaze: newGear:= AddGear(hwRound(lx), hwRound(ly), gtKamikaze, 0, xx * _0_5, yy * _0_5, 0);
   313                      amKamikaze: newGear:= AddGear(hwRound(lx), hwRound(ly), gtKamikaze, 0, xx * _0_5, yy * _0_5, 0);
   314                          amCake: newGear:= AddGear(hwRound(lx) + hwSign(dX) * 3, hwRound(ly), gtCake, 0, xx, _0, 0);
   314                          amCake: newGear:= AddGear(hwRound(lx) + hwSign(dX) * 3, hwRound(ly), gtCake, 0, xx, _0, 0);
   315                     amSeduction: newGear:= AddGear(hwRound(lx), hwRound(ly), gtSeduction, 0, _0, _0, 0);
   315                     amSeduction: newGear:= AddGear(hwRound(lx), hwRound(ly), gtSeduction, 0, _0, _0, 0);
   316                    amWatermelon: newGear:= AddGear(hwRound(lx), hwRound(ly), gtWatermelon,  0, newDx, newDy, CurWeapon^.Timer);
   316                    amWatermelon: newGear:= AddGear(hwRound(lx), hwRound(ly), gtWatermelon,  0, newDx, newDy, CurWeapon^.Timer);
   336                                  PlaySound(sndSwitchHog);
   336                                  PlaySound(sndSwitchHog);
   337                                  TurnTimeLeft:= TurnTimeLeft + 30000
   337                                  TurnTimeLeft:= TurnTimeLeft + 30000
   338                                  end;
   338                                  end;
   339                    amLaserSight: cLaserSighting:= true;
   339                    amLaserSight: cLaserSighting:= true;
   340                      amVampiric: begin
   340                      amVampiric: begin
   341                                  PlaySound(sndOw1, Team^.voicepack);
   341                                  PlaySoundV(sndOw1, Team^.voicepack);
   342                                  cVampiric:= true;
   342                                  cVampiric:= true;
   343                                  end;
   343                                  end;
   344                         amPiano: begin
   344                         amPiano: begin
   345                                  // Tuck the hedgehog away until the piano attack is completed
   345                                  // Tuck the hedgehog away until the piano attack is completed
   346                                  Unplaced:= true;
   346                                  Unplaced:= true;
   524     begin
   524     begin
   525     AllInactive:= false;
   525     AllInactive:= false;
   526     Gear^.Z:= cCurrHHZ;
   526     Gear^.Z:= cCurrHHZ;
   527     RemoveGearFromList(Gear);
   527     RemoveGearFromList(Gear);
   528     InsertGearToList(Gear);
   528     InsertGearToList(Gear);
   529     PlaySound(sndByeBye, Gear^.Hedgehog^.Team^.voicepack);
   529     PlaySoundV(sndByeBye, Gear^.Hedgehog^.Team^.voicepack);
   530     Gear^.Pos:= 0;
   530     Gear^.Pos:= 0;
   531     Gear^.Timer:= timertime
   531     Gear^.Timer:= timertime
   532     end
   532     end
   533 end;
   533 end;
   534 
   534 
   556     begin
   556     begin
   557     AllInactive:= false;
   557     AllInactive:= false;
   558     Gear^.Z:= cCurrHHZ;
   558     Gear^.Z:= cCurrHHZ;
   559     RemoveGearFromList(Gear);
   559     RemoveGearFromList(Gear);
   560     InsertGearToList(Gear);
   560     InsertGearToList(Gear);
   561     PlaySound(sndByeBye, Gear^.Hedgehog^.Team^.voicepack);
   561     PlaySoundV(sndByeBye, Gear^.Hedgehog^.Team^.voicepack);
   562     PlaySound(sndWarp);
   562     PlaySound(sndWarp);
   563     Gear^.Pos:= 0;
   563     Gear^.Pos:= 0;
   564     Gear^.Timer:= timertime
   564     Gear^.Timer:= timertime
   565     end
   565     end
   566 end;
   566 end;
   684                 begin
   684                 begin
   685                 Gear^.dY:= -_0_15;
   685                 Gear^.dY:= -_0_15;
   686                 if not cArtillery then
   686                 if not cArtillery then
   687                     Gear^.dX:= SignAs(_0_15, Gear^.dX);
   687                     Gear^.dX:= SignAs(_0_15, Gear^.dX);
   688                 Gear^.State:= Gear^.State or gstMoving or gstHHJumping;
   688                 Gear^.State:= Gear^.State or gstMoving or gstHHJumping;
   689                 PlaySound(sndJump1, Gear^.Hedgehog^.Team^.voicepack);
   689                 PlaySoundV(sndJump1, Gear^.Hedgehog^.Team^.voicepack);
   690         exit
   690         exit
   691         end;
   691         end;
   692     end;
   692     end;
   693 
   693 
   694     if ((Gear^.Message and gmHJump ) <> 0) then
   694     if ((Gear^.Message and gmHJump ) <> 0) then
   697         Gear^.Message:= Gear^.Message and (not gmHJump);
   697         Gear^.Message:= Gear^.Message and (not gmHJump);
   698 
   698 
   699         Gear^.dY:= -_0_2;
   699         Gear^.dY:= -_0_2;
   700         SetLittle(Gear^.dX);
   700         SetLittle(Gear^.dX);
   701         Gear^.State:= Gear^.State or gstMoving or gstHHJumping;
   701         Gear^.State:= Gear^.State or gstMoving or gstHHJumping;
   702         PlaySound(sndJump3, Gear^.Hedgehog^.Team^.voicepack);
   702         PlaySoundV(sndJump3, Gear^.Hedgehog^.Team^.voicepack);
   703         exit
   703         exit
   704         end;
   704         end;
   705 
   705 
   706     PrevdX:= hwSign(Gear^.dX);
   706     PrevdX:= hwSign(Gear^.dX);
   707     if (Gear^.Message and gmLeft  )<>0 then
   707     if (Gear^.Message and gmLeft  )<>0 then
  1025 
  1025 
  1026 if (HHGear^.State and gstAnimation) <> 0 then
  1026 if (HHGear^.State and gstAnimation) <> 0 then
  1027     begin
  1027     begin
  1028     HHGear^.Message:= 0;
  1028     HHGear^.Message:= 0;
  1029     if (HHGear^.Pos = Wavez[TWave(HHGear^.Tag)].VoiceDelay) and (HHGear^.Timer = 0) then
  1029     if (HHGear^.Pos = Wavez[TWave(HHGear^.Tag)].VoiceDelay) and (HHGear^.Timer = 0) then
  1030         PlaySound(Wavez[TWave(HHGear^.Tag)].Voice, Hedgehog^.Team^.voicepack);
  1030         PlaySoundV(Wavez[TWave(HHGear^.Tag)].Voice, Hedgehog^.Team^.voicepack);
  1031     inc(HHGear^.Timer);
  1031     inc(HHGear^.Timer);
  1032     if HHGear^.Timer = Wavez[TWave(HHGear^.Tag)].Interval then
  1032     if HHGear^.Timer = Wavez[TWave(HHGear^.Tag)].Interval then
  1033         begin
  1033         begin
  1034         HHGear^.Timer:= 0;
  1034         HHGear^.Timer:= 0;
  1035         inc(HHGear^.Pos);
  1035         inc(HHGear^.Pos);
  1101             begin
  1101             begin
  1102             HHGear^.State:= HHGear^.State or gstHHHJump;
  1102             HHGear^.State:= HHGear^.State or gstHHHJump;
  1103             HHGear^.dY:= -_0_25;
  1103             HHGear^.dY:= -_0_25;
  1104             if not cArtillery then
  1104             if not cArtillery then
  1105                 HHGear^.dX:= -SignAs(_0_02, HHGear^.dX);
  1105                 HHGear^.dX:= -SignAs(_0_02, HHGear^.dX);
  1106             PlaySound(sndJump2, Hedgehog^.Team^.voicepack)
  1106             PlaySoundV(sndJump2, Hedgehog^.Team^.voicepack)
  1107             end;
  1107             end;
  1108 
  1108 
  1109     HHGear^.Message:= HHGear^.Message and (not (gmLJump or gmHJump));
  1109     HHGear^.Message:= HHGear^.Message and (not (gmLJump or gmHJump));
  1110 
  1110 
  1111     if (not cArtillery) and wasJumping and TestCollisionXwithGear(HHGear, hwSign(HHGear^.dX)) then
  1111     if (not cArtillery) and wasJumping and TestCollisionXwithGear(HHGear, hwSign(HHGear^.dX)) then