hedgewars/uGearsHandlersMess.pas
changeset 14201 ab5e710d353d
parent 14125 7bb0e27910aa
child 14202 3e551b0535fb
equal deleted inserted replaced
14200:43ca01d4fb46 14201:ab5e710d353d
   126 procedure doStepHammerHitWork(Gear: PGear);
   126 procedure doStepHammerHitWork(Gear: PGear);
   127 procedure doStepHammerHit(Gear: PGear);
   127 procedure doStepHammerHit(Gear: PGear);
   128 procedure doStepResurrectorWork(Gear: PGear);
   128 procedure doStepResurrectorWork(Gear: PGear);
   129 procedure doStepResurrector(Gear: PGear);
   129 procedure doStepResurrector(Gear: PGear);
   130 procedure doStepNapalmBomb(Gear: PGear);
   130 procedure doStepNapalmBomb(Gear: PGear);
   131 //procedure doStepStructure(Gear: PGear);
       
   132 procedure doStepTardisWarp(Gear: PGear);
   131 procedure doStepTardisWarp(Gear: PGear);
   133 procedure doStepTardis(Gear: PGear);
   132 procedure doStepTardis(Gear: PGear);
   134 procedure updateFuel(Gear: PGear);
   133 procedure updateFuel(Gear: PGear);
   135 procedure updateTarget(Gear:PGear; newX, newY:HWFloat);
   134 procedure updateTarget(Gear:PGear; newX, newY:HWFloat);
   136 procedure doStepIceGun(Gear: PGear);
   135 procedure doStepIceGun(Gear: PGear);
  6078         end;
  6077         end;
  6079     if (GameTicks and $3F) = 0 then
  6078     if (GameTicks and $3F) = 0 then
  6080         AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtSmokeTrace);
  6079         AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtSmokeTrace);
  6081     dec(Gear^.Timer)
  6080     dec(Gear^.Timer)
  6082 end;
  6081 end;
  6083 
       
  6084 (*
       
  6085 ////////////////////////////////////////////////////////////////////////////////
       
  6086 procedure doStepStructure(Gear: PGear);
       
  6087 var
       
  6088     x, y: LongInt;
       
  6089     HH: PHedgehog;
       
  6090     t: PGear;
       
  6091 begin
       
  6092     HH:= Gear^.Hedgehog;
       
  6093 
       
  6094     if (Gear^.State and gstMoving) <> 0 then
       
  6095         begin
       
  6096         AddCI(Gear);
       
  6097         Gear^.dX:= _0;
       
  6098         Gear^.dY:= _0;
       
  6099         Gear^.State:= Gear^.State and (not gstMoving);
       
  6100         end;
       
  6101 
       
  6102     dec(Gear^.Health, Gear^.Damage);
       
  6103     Gear^.Damage:= 0;
       
  6104 
       
  6105     if Gear^.Pos = 1 then
       
  6106         begin
       
  6107         AddCI(Gear);
       
  6108         AfterAttack;
       
  6109         if Gear = CurAmmoGear then
       
  6110             CurAmmoGear:= nil;
       
  6111         if HH^.Gear <> nil then
       
  6112             HideHog(HH);
       
  6113         Gear^.Pos:= 2
       
  6114         end;
       
  6115 
       
  6116     if Gear^.Pos = 2 then
       
  6117         begin
       
  6118         if ((GameTicks mod 100) = 0) and (Gear^.Timer < 1000) then
       
  6119             begin
       
  6120             if (Gear^.Timer mod 10) = 0 then
       
  6121                 begin
       
  6122                 DeleteCI(Gear);
       
  6123                 Gear^.Y:= Gear^.Y - _0_5;
       
  6124                 AddCI(Gear);
       
  6125                 end;
       
  6126             inc(Gear^.Timer);
       
  6127             end;
       
  6128         if Gear^.Tag <= TotalRoundsPre then
       
  6129             Gear^.Pos:= 3;
       
  6130         end;
       
  6131 
       
  6132     if Gear^.Pos = 3 then
       
  6133         if Gear^.Timer < 1000 then
       
  6134             begin
       
  6135             if (Gear^.Timer mod 10) = 0 then
       
  6136                 begin
       
  6137                 DeleteCI(Gear);
       
  6138                 Gear^.Y:= Gear^.Y - _0_5;
       
  6139                 AddCI(Gear);
       
  6140                 end;
       
  6141             inc(Gear^.Timer);
       
  6142             end
       
  6143         else
       
  6144             begin
       
  6145             if HH^.GearHidden <> nil then
       
  6146                 RestoreHog(HH);
       
  6147             Gear^.Pos:= 4;
       
  6148             end;
       
  6149 
       
  6150     if Gear^.Pos = 4 then
       
  6151         if ((GameTicks mod 1000) = 0) and ((GameFlags and gfInvulnerable) = 0) then
       
  6152             begin
       
  6153             t:= GearsList;
       
  6154             while t <> nil do
       
  6155                 begin
       
  6156                 if (t^.Kind = gtHedgehog) and (t^.Hedgehog^.Team^.Clan = HH^.Team^.Clan) then
       
  6157                     t^.Hedgehog^.Effects[heInvulnerable]:= 1;
       
  6158                 t:= t^.NextGear;
       
  6159                 end;
       
  6160             end;
       
  6161 
       
  6162     if Gear^.Health <= 0 then
       
  6163         begin
       
  6164         if HH^.GearHidden <> nil then
       
  6165             RestoreHog(HH);
       
  6166 
       
  6167         x := hwRound(Gear^.X);
       
  6168         y := hwRound(Gear^.Y);
       
  6169 
       
  6170         DeleteCI(Gear);
       
  6171         DeleteGear(Gear);
       
  6172 
       
  6173         doMakeExplosion(x, y, 50, CurrentHedgehog, EXPLAutoSound);
       
  6174         end;
       
  6175 end;
       
  6176 *)
       
  6177 
  6082 
  6178 ////////////////////////////////////////////////////////////////////////////////
  6083 ////////////////////////////////////////////////////////////////////////////////
  6179 (*
  6084 (*
  6180  TARDIS needs
  6085  TARDIS needs
  6181  Warp in.  Pos = 1
  6086  Warp in.  Pos = 1