hedgewars/uGears.pas
changeset 2042 905c554d62e6
parent 2031 b6f3e56fb100
child 2045 b0588498bc3a
equal deleted inserted replaced
2041:9e0b5a6bcecf 2042:905c554d62e6
    51 			Tag: LongInt;
    51 			Tag: LongInt;
    52 			Tex: PTexture;
    52 			Tex: PTexture;
    53 			Z: Longword;
    53 			Z: Longword;
    54 			IntersectGear: PGear;
    54 			IntersectGear: PGear;
    55 			TriggerId: Longword;
    55 			TriggerId: Longword;
    56 			uid: Longword;
    56 			uid: Longword
    57             Text: shortstring;
       
    58 			end;
    57 			end;
    59 
    58 
    60 function  AddGear(X, Y: LongInt; Kind: TGearType; State: Longword; dX, dY: hwFloat; Timer: LongWord): PGear;
    59 function  AddGear(X, Y: LongInt; Kind: TGearType; State: Longword; dX, dY: hwFloat; Timer: LongWord): PGear;
    61 procedure ProcessGears;
    60 procedure ProcessGears;
    62 procedure ResetUtilities;
    61 procedure ResetUtilities;
   161 			@doStepWaterUp,
   160 			@doStepWaterUp,
   162 			@doStepDrill,
   161 			@doStepDrill,
   163 			@doStepBallgun,
   162 			@doStepBallgun,
   164 			@doStepBomb,
   163 			@doStepBomb,
   165 			@doStepRCPlane,
   164 			@doStepRCPlane,
   166 			@doStepSpeechBubble,
       
   167 			@doStepSniperRifleShot
   165 			@doStepSniperRifleShot
   168 			);
   166 			);
   169 
   167 
   170 procedure InsertGearToList(Gear: PGear);
   168 procedure InsertGearToList(Gear: PGear);
   171 var tmp, ptmp: PGear;
   169 var tmp, ptmp: PGear;
   254                 Result^.Radius:= 4;
   252                 Result^.Radius:= 4;
   255                 end;
   253                 end;
   256    gtHealthTag: begin
   254    gtHealthTag: begin
   257                 Result^.Timer:= 1500;
   255                 Result^.Timer:= 1500;
   258                 Result^.Z:= 2002;
   256                 Result^.Z:= 2002;
   259                 end;
       
   260    gtSpeechBubble: begin
       
   261                 Result^.Z:= 2003;
       
   262                 end;
   257                 end;
   263        gtGrave: begin
   258        gtGrave: begin
   264                 Result^.Radius:= 10;
   259                 Result^.Radius:= 10;
   265                 Result^.Elasticity:= _0_6;
   260                 Result^.Elasticity:= _0_6;
   266                 end;
   261                 end;
   652     if (CurrentTeam <> nil) then
   647     if (CurrentTeam <> nil) then
   653        with CurrentTeam^ do
   648        with CurrentTeam^ do
   654           for i:= 0 to cMaxHHIndex do
   649           for i:= 0 to cMaxHHIndex do
   655               with Hedgehogs[i] do
   650               with Hedgehogs[i] do
   656                   begin
   651                   begin
   657                   if (SpeechGear <> nil) then DeleteGear(SpeechGear);  // remove to restore persisting beyond end of turn. Tiy says was too much of a gameplay issue
   652                   if (SpeechGear <> nil) then DeleteVisualGear(SpeechGear);  // remove to restore persisting beyond end of turn. Tiy says was too much of a gameplay issue
   658                   if (Gear <> nil) then
   653                   if (Gear <> nil) then
   659                      if (GameFlags and gfInvulnerable) = 0 then
   654                      if (GameFlags and gfInvulnerable) = 0 then
   660                         Gear^.Invulnerable:= false;
   655                         Gear^.Invulnerable:= false;
   661                   end;
   656                   end;
   662 end;
   657 end;
  1293     
  1288     
  1294     gtAmmo_Grenade: DrawRotated(sprGrenade, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
  1289     gtAmmo_Grenade: DrawRotated(sprGrenade, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
  1295        
  1290        
  1296        gtHealthTag: if Gear^.Tex <> nil then DrawCentered(hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, Gear^.Tex);
  1291        gtHealthTag: if Gear^.Tex <> nil then DrawCentered(hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, Gear^.Tex);
  1297 
  1292 
  1298        gtSpeechBubble: if Gear^.Tex <> nil then DrawCentered(hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, Gear^.Tex);
       
  1299            
       
  1300            gtGrave: DrawSurfSprite(hwRound(Gear^.X) + WorldDx - 16, hwRound(Gear^.Y) + WorldDy - 16, 32, (GameTicks shr 7) and 7, PHedgehog(Gear^.Hedgehog)^.Team^.GraveTex);
  1293            gtGrave: DrawSurfSprite(hwRound(Gear^.X) + WorldDx - 16, hwRound(Gear^.Y) + WorldDy - 16, 32, (GameTicks shr 7) and 7, PHedgehog(Gear^.Hedgehog)^.Team^.GraveTex);
  1301              
  1294              
  1302              gtUFO: DrawSprite(sprUFO, hwRound(Gear^.X) - 16 + WorldDx, hwRound(Gear^.Y) - 16 + WorldDy, (GameTicks shr 7) mod 4);
  1295              gtUFO: DrawSprite(sprUFO, hwRound(Gear^.X) - 16 + WorldDx, hwRound(Gear^.Y) - 16 + WorldDy, (GameTicks shr 7) mod 4);
  1303       
  1296       
  1304       gtPickHammer: DrawSprite(sprPHammer, hwRound(Gear^.X) - 16 + WorldDx, hwRound(Gear^.Y) - 50 + LongInt(((GameTicks shr 5) and 1) * 2) + WorldDy, 0);
  1297       gtPickHammer: DrawSprite(sprPHammer, hwRound(Gear^.X) - 16 + WorldDx, hwRound(Gear^.Y) - 50 + LongInt(((GameTicks shr 5) and 1) * 2) + WorldDy, 0);