hedgewars/uGears.pas
changeset 2990 b62e567f17b9
parent 2989 b49d87499398
child 2991 142ea64ce8a2
equal deleted inserted replaced
2989:b49d87499398 2990:b62e567f17b9
    53             CollisionIndex: LongInt;
    53             CollisionIndex: LongInt;
    54             Tag: LongInt;
    54             Tag: LongInt;
    55             Tex: PTexture;
    55             Tex: PTexture;
    56             Z: Longword;
    56             Z: Longword;
    57             IntersectGear: PGear;
    57             IntersectGear: PGear;
    58             TriggerId: Longword;
       
    59             FlightTime: Longword;
    58             FlightTime: Longword;
    60             uid: Longword;
    59             uid: Longword;
    61             SoundChannel: LongInt
    60             SoundChannel: LongInt
    62         end;
    61         end;
    63 
    62 
    93 function ModifyDamage(dmg: Longword; Gear: PGear): Longword;
    92 function ModifyDamage(dmg: Longword; Gear: PGear): Longword;
    94 procedure FindPlace(var Gear: PGear; withFall: boolean; Left, Right: LongInt);
    93 procedure FindPlace(var Gear: PGear; withFall: boolean; Left, Right: LongInt);
    95 
    94 
    96 implementation
    95 implementation
    97 uses uWorld, uMisc, uStore, uConsole, uSound, uTeams, uRandom, uCollisions, uLand, uIO, uLandGraphics,
    96 uses uWorld, uMisc, uStore, uConsole, uSound, uTeams, uRandom, uCollisions, uLand, uIO, uLandGraphics,
    98     uAIMisc, uLocale, uAI, uAmmos, uTriggers, uStats, uVisualGears, uScript, 
    97     uAIMisc, uLocale, uAI, uAmmos, uStats, uVisualGears, uScript, 
    99 {$IFDEF GLES11}
    98 {$IFDEF GLES11}
   100     gles11;
    99     gles11;
   101 {$ELSE}
   100 {$ELSE}
   102     GL;
   101     GL;
   103 {$ENDIF}
   102 {$ENDIF}
   505         end;
   504         end;
   506 {$IFDEF DEBUGFILE}
   505 {$IFDEF DEBUGFILE}
   507 with Gear^ do AddFileLog('Delete: #' + inttostr(uid) + ' (' + inttostr(hwRound(x)) + ',' + inttostr(hwRound(y)) + '), d(' + floattostr(dX) + ',' + floattostr(dY) + ') type = ' + inttostr(ord(Kind)));
   506 with Gear^ do AddFileLog('Delete: #' + inttostr(uid) + ' (' + inttostr(hwRound(x)) + ',' + inttostr(hwRound(y)) + '), d(' + floattostr(dX) + ',' + floattostr(dY) + ') type = ' + inttostr(ord(Kind)));
   508 {$ENDIF}
   507 {$ENDIF}
   509 
   508 
   510 if Gear^.TriggerId <> 0 then TickTrigger(Gear^.TriggerId);
       
   511 if CurAmmoGear = Gear then CurAmmoGear:= nil;
   509 if CurAmmoGear = Gear then CurAmmoGear:= nil;
   512 if FollowGear = Gear then FollowGear:= nil;
   510 if FollowGear = Gear then FollowGear:= nil;
   513 RemoveGearFromList(Gear);
   511 RemoveGearFromList(Gear);
   514 Dispose(Gear)
   512 Dispose(Gear)
   515 end;
   513 end;
  1692     // TODO: exclude each other or allow both, mines and explosives, on same map?
  1690     // TODO: exclude each other or allow both, mines and explosives, on same map?
  1693     if ((GameFlags and gfMines) <> 0) then
  1691     if ((GameFlags and gfMines) <> 0) then
  1694         for i:= 0 to Pred(cLandAdditions) do
  1692         for i:= 0 to Pred(cLandAdditions) do
  1695             begin
  1693             begin
  1696             Gear:= AddGear(0, 0, gtMine, 0, _0, _0, 0);
  1694             Gear:= AddGear(0, 0, gtMine, 0, _0, _0, 0);
  1697             Gear^.TriggerId:= i + 1;
       
  1698             FindPlace(Gear, false, 0, LAND_WIDTH);
  1695             FindPlace(Gear, false, 0, LAND_WIDTH);
  1699             end;
  1696             end;
  1700 //  No game flag for this for now
  1697 //  No game flag for this for now
  1701 //  if ((GameFlags and gfExplosives) <> 0) then
  1698 //  if ((GameFlags and gfExplosives) <> 0) then
  1702         for i:= 0 to Pred(cExplosives) do
  1699         for i:= 0 to Pred(cExplosives) do