hedgewars/GSHandlers.inc
changeset 1712 f5b916de40f0
parent 1708 62e1d9af1dd9
child 1713 194ed95f9e8d
equal deleted inserted replaced
1711:3f80fb49d21b 1712:f5b916de40f0
  2011 if ((HHGear^.Message and gm_Attack) <> 0) and (Gear^.Health <> 0) then
  2011 if ((HHGear^.Message and gm_Attack) <> 0) and (Gear^.Health <> 0) then
  2012 	begin
  2012 	begin
  2013 	HHGear^.Message := HHGear^.Message and not gm_Attack;
  2013 	HHGear^.Message := HHGear^.Message and not gm_Attack;
  2014 	AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtAirBomb, 0, Gear^.dX * _0_5, Gear^.dY * _0_5, 0);
  2014 	AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtAirBomb, 0, Gear^.dX * _0_5, Gear^.dY * _0_5, 0);
  2015 	dec(Gear^.Health)
  2015 	dec(Gear^.Health)
  2016 	end;
  2016     end;
       
  2017 
       
  2018 // Ride of the Valkyries
       
  2019 // This does actually work, interestingly, if music is turned off
       
  2020 // However, I'm not actually sure how this works with game state, and some
       
  2021 // sort of flag specific to the purpose of avoiding duplicate playSounds might be better.  Can't use lastChan reasonably, unfortunately
       
  2022 if ((HHGear^.Message and gm_LJump) <> 0)
       
  2023 	and ((Gear^.State and gsttmpFlag) = 0) then
       
  2024     begin
       
  2025     Gear^.State:= Gear^.State or gsttmpFlag;
       
  2026     PauseMusic;
       
  2027     playSound(sndRideOfTheValkyries, false, nil);
       
  2028     end;
  2017 
  2029 
  2018 // pickup bonuses
  2030 // pickup bonuses
  2019 t:= CheckGearNear(Gear, gtCase, 36, 36);
  2031 t:= CheckGearNear(Gear, gtCase, 36, 36);
  2020 if t <> nil then
  2032 if t <> nil then
  2021 	PickUp(HHGear, t);
  2033 	PickUp(HHGear, t);
  2022 
  2034 
  2023 CheckCollision(Gear);
  2035 CheckCollision(Gear);
  2024 
  2036 
  2025 if ((Gear^.State and gstCollision) <> 0) then
  2037 if ((Gear^.State and gstCollision) <> 0)
  2026 	begin
  2038 	or CheckGearDrowning(Gear) then
  2027 	HHGear^.Message:= 0;
  2039 	begin
  2028 	//HHGear^.State:= HHGear^.State and (not gstNotKickable);
  2040 	StopSound(sndRCPlane);
  2029 	doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 25, EXPLAutoSound);
  2041 	StopSound(sndRideOfTheValkyries);
  2030 	for i:= 0 to 25 do
  2042 	ResumeMusic;
  2031 		begin
  2043 	
  2032 		dX:= AngleCos(i * 16) * _0_5 * (GetRandom + _1);
  2044 	if ((Gear^.State and gstCollision) <> 0) then
  2033 		dY:= AngleSin(i * 16) * _0_5 * (GetRandom + _1);
  2045 		begin
  2034 		AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtFlame, 0, dX, dY, 0);
  2046 		doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 25, EXPLAutoSound);
  2035 		AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtFlame, 0, dX, -dY, 0);
  2047 		for i:= 0 to 25 do
  2036 		end;
  2048 			begin
  2037 	DeleteGear(Gear);
  2049 			dX:= AngleCos(i * 16) * _0_5 * (GetRandom + _1);
       
  2050 			dY:= AngleSin(i * 16) * _0_5 * (GetRandom + _1);
       
  2051 			AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtFlame, 0, dX, dY, 0);
       
  2052 			AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtFlame, 0, dX, -dY, 0);
       
  2053 			end;
       
  2054 		DeleteGear(Gear)
       
  2055 		end;
       
  2056 	
  2038 	AfterAttack;
  2057 	AfterAttack;
  2039 	TurnTimeLeft:= 14 * 125;
  2058 	TurnTimeLeft:= 14 * 125;
  2040 	ParseCommand('/taunt '#1, true)
  2059 	HHGear^.Message:= 0;
  2041 	end;
       
  2042 
       
  2043 if CheckGearDrowning(Gear) then
       
  2044 	begin
       
  2045 	AfterAttack;
       
  2046 	TurnTimeLeft:= 14 * 125;
       
  2047 	ParseCommand('/taunt '#1, true)
  2060 	ParseCommand('/taunt '#1, true)
  2048 	end
  2061 	end
  2049 end;
  2062 end;
  2050 
  2063 
  2051 procedure doStepRCPlane(Gear: PGear);
  2064 procedure doStepRCPlane(Gear: PGear);