hedgewars/uGearsHandlersMess.pas
changeset 13642 3d14950641a4
parent 13640 cb0191394133
child 13651 56a925256039
equal deleted inserted replaced
13641:007813b81f1b 13642:3d14950641a4
  1651     gtATStartGame:
  1651     gtATStartGame:
  1652         begin
  1652         begin
  1653         AllInactive := false;
  1653         AllInactive := false;
  1654         if Gear^.Timer = 0 then
  1654         if Gear^.Timer = 0 then
  1655             begin
  1655             begin
  1656             AddCaption(GetEventString(eidRoundStart), cWhiteColor, capgrpGameState);
  1656             AddCaption(GetEventString(eidRoundStart), capcolDefault, capgrpGameState);
  1657             end
  1657             end
  1658         end;
  1658         end;
  1659     gtATFinishGame:
  1659     gtATFinishGame:
  1660         begin
  1660         begin
  1661         AllInactive := false;
  1661         AllInactive := false;
  3391                             dy := -dy;
  3391                             dy := -dy;
  3392                         FrameTicks:= random(400) + 250
  3392                         FrameTicks:= random(400) + 250
  3393                         end
  3393                         end
  3394                 end;
  3394                 end;
  3395         s:= ansistring(Gear^.Hedgehog^.Name);
  3395         s:= ansistring(Gear^.Hedgehog^.Name);
  3396         AddCaption(FormatA(GetEventString(eidKamikaze), s), cWhiteColor, capgrpMessage);
  3396         AddCaption(FormatA(GetEventString(eidKamikaze), s), capcolDefault, capgrpMessage);
  3397         uStats.HedgehogSacrificed(Gear^.Hedgehog);
  3397         uStats.HedgehogSacrificed(Gear^.Hedgehog);
  3398         AfterAttack;
  3398         AfterAttack;
  3399         HHGear^.Message:= HHGear^.Message or gmDestroy;
  3399         HHGear^.Message:= HHGear^.Message or gmDestroy;
  3400         DeleteGear(Gear);
  3400         DeleteGear(Gear);
  3401         end
  3401         end
  4148             AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtAirBomb, 0, Gear^.dX * _0_5, Gear^.dY *
  4148             AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtAirBomb, 0, Gear^.dX * _0_5, Gear^.dY *
  4149             _0_5, 0);
  4149             _0_5, 0);
  4150             dec(Gear^.Health)
  4150             dec(Gear^.Health)
  4151             end;
  4151             end;
  4152         s:= ansistring(inttostr(Gear^.Health));
  4152         s:= ansistring(inttostr(Gear^.Health));
  4153         AddCaption(formatA(trmsg[sidRemaining], s), cWhiteColor, capgrpAmmostate);
  4153         AddCaption(formatA(trmsg[sidRemaining], s), capcolDefault, capgrpAmmostate);
  4154         end;
  4154         end;
  4155 
  4155 
  4156     if (HHGear <> nil) and ((HHGear^.Message and gmLJump) <> 0) and ((Gear^.State and gsttmpFlag) = 0) then
  4156     if (HHGear <> nil) and ((HHGear^.Message and gmLJump) <> 0) and ((Gear^.State and gsttmpFlag) = 0) then
  4157         begin
  4157         begin
  4158         Gear^.State := Gear^.State or gsttmpFlag;
  4158         Gear^.State := Gear^.State or gsttmpFlag;
  4477             AddGear(hwRound(Gear^.X), hwRound(Gear^.Y) + 32, gtEgg, 0, Gear^.dX * _0_5, Gear^.dY, 0);
  4477             AddGear(hwRound(Gear^.X), hwRound(Gear^.Y) + 32, gtEgg, 0, Gear^.dX * _0_5, Gear^.dY, 0);
  4478             PlaySound(sndBirdyLay);
  4478             PlaySound(sndBirdyLay);
  4479             dec(Gear^.FlightTime)
  4479             dec(Gear^.FlightTime)
  4480             end;
  4480             end;
  4481         s:= ansistring(inttostr(Gear^.FlightTime));
  4481         s:= ansistring(inttostr(Gear^.FlightTime));
  4482         AddCaption(formatA(trmsg[sidRemaining], s), cWhiteColor, capgrpAmmostate);
  4482         AddCaption(formatA(trmsg[sidRemaining], s), capcolDefault, capgrpAmmostate);
  4483         end;
  4483         end;
  4484 
  4484 
  4485     if HHGear^.Message and (gmUp or gmPrecise or gmLeft or gmRight) <> 0 then
  4485     if HHGear^.Message and (gmUp or gmPrecise or gmLeft or gmRight) <> 0 then
  4486         Gear^.State := Gear^.State and (not gsttmpFlag);
  4486         Gear^.State := Gear^.State and (not gsttmpFlag);
  4487 
  4487 
  5888                 graves.ar^[i]^.Active:= true;
  5888                 graves.ar^[i]^.Active:= true;
  5889                 RenderHealth(resgear^.Hedgehog^);
  5889                 RenderHealth(resgear^.Hedgehog^);
  5890                 RecountTeamHealth(resgear^.Hedgehog^.Team);
  5890                 RecountTeamHealth(resgear^.Hedgehog^.Team);
  5891                 resgear^.Hedgehog^.Effects[heResurrected]:= 1;
  5891                 resgear^.Hedgehog^.Effects[heResurrected]:= 1;
  5892                 s:= ansistring(resgear^.Hedgehog^.Name);
  5892                 s:= ansistring(resgear^.Hedgehog^.Name);
  5893                 AddCaption(FormatA(GetEventString(eidResurrected), s), cWhiteColor, capgrpMessage);
  5893                 AddCaption(FormatA(GetEventString(eidResurrected), s), capcolDefault, capgrpMessage);
  5894                 // only make hat-less hedgehogs look like zombies, preserve existing hats
  5894                 // only make hat-less hedgehogs look like zombies, preserve existing hats
  5895 
  5895 
  5896                 if resgear^.Hedgehog^.Hat = 'NoHat' then
  5896                 if resgear^.Hedgehog^.Hat = 'NoHat' then
  5897                     LoadHedgehogHat(resgear^.Hedgehog^, 'Reserved/Zombie');
  5897                     LoadHedgehogHat(resgear^.Hedgehog^, 'Reserved/Zombie');
  5898                 end;
  5898                 end;
  6114         //else if (HH^.Gear <> nil) and (HH^.Gear^.State and gstInvisible <> 0) then
  6114         //else if (HH^.Gear <> nil) and (HH^.Gear^.State and gstInvisible <> 0) then
  6115         else if (HH^.GearHidden <> nil) then// and (HH^.Gear^.State and gstInvisible <> 0) then
  6115         else if (HH^.GearHidden <> nil) then// and (HH^.Gear^.State and gstInvisible <> 0) then
  6116             begin
  6116             begin
  6117             RestoreHog(HH);
  6117             RestoreHog(HH);
  6118             s:= ansistring(HH^.Name);
  6118             s:= ansistring(HH^.Name);
  6119             AddCaption(FormatA(GetEventString(eidTimeTravelEnd), s), cWhiteColor, capgrpMessage)
  6119             AddCaption(FormatA(GetEventString(eidTimeTravelEnd), s), capcolDefault, capgrpMessage)
  6120             end
  6120             end
  6121         end;
  6121         end;
  6122 
  6122 
  6123     inc(Gear^.Timer);
  6123     inc(Gear^.Timer);
  6124     if (Gear^.Timer > 2000) and ((GameTicks mod 2000) = 1000) then
  6124     if (Gear^.Timer > 2000) and ((GameTicks mod 2000) = 1000) then