hedgewars/uGearsUtils.pas
changeset 7010 10a0a31804f3
parent 6990 40e5af28d026
child 7053 8c9dcaedc7a8
equal deleted inserted replaced
7007:0ccdff4ae8e9 7010:10a0a31804f3
   130                                     Gear^.State:= (Gear^.State or gstMoving) and (not gstWinner);
   130                                     Gear^.State:= (Gear^.State or gstMoving) and (not gstWinner);
   131                                 Gear^.Active:= true;
   131                                 Gear^.Active:= true;
   132                                 if Gear^.Kind <> gtFlame then FollowGear:= Gear
   132                                 if Gear^.Kind <> gtFlame then FollowGear:= Gear
   133                                 end;
   133                                 end;
   134                             if ((Mask and EXPLPoisoned) <> 0) and (Gear^.Kind = gtHedgehog) and (not Gear^.Invulnerable) then
   134                             if ((Mask and EXPLPoisoned) <> 0) and (Gear^.Kind = gtHedgehog) and (not Gear^.Invulnerable) then
   135                                 Gear^.Hedgehog^.Effects[hePoisoned] := true;
   135                                 Gear^.Hedgehog^.Effects[hePoisoned] := 1;
   136                             end;
   136                             end;
   137 
   137 
   138                         end;
   138                         end;
   139                 gtGrave: begin
   139                 gtGrave: begin
   140 // Run the calcs only once we know we have a type that will need damage
   140 // Run the calcs only once we know we have a type that will need damage
   369                 Gear^.RenderTimer := false;
   369                 Gear^.RenderTimer := false;
   370                 if (Gear^.Kind <> gtSniperRifleShot) and (Gear^.Kind <> gtShotgunShot)
   370                 if (Gear^.Kind <> gtSniperRifleShot) and (Gear^.Kind <> gtShotgunShot)
   371                 and (Gear^.Kind <> gtDEagleShot) and (Gear^.Kind <> gtSineGunShot) then
   371                 and (Gear^.Kind <> gtDEagleShot) and (Gear^.Kind <> gtSineGunShot) then
   372                     if Gear^.Kind = gtHedgehog then
   372                     if Gear^.Kind = gtHedgehog then
   373                         begin
   373                         begin
   374                         if Gear^.Hedgehog^.Effects[heResurrectable] then
   374                         if Gear^.Hedgehog^.Effects[heResurrectable] <> 0 then
   375                             ResurrectHedgehog(Gear)
   375                             ResurrectHedgehog(Gear)
   376                         else
   376                         else
   377                             begin
   377                             begin
   378                             Gear^.doStep := @doStepDrowningGear;
   378                             Gear^.doStep := @doStepDrowningGear;
   379                             Gear^.State := Gear^.State and (not gstHHDriven);
   379                             Gear^.State := Gear^.State and (not gstHHDriven);
   447     AttackBar:= 0;
   447     AttackBar:= 0;
   448     gear^.dX := _0;
   448     gear^.dX := _0;
   449     gear^.dY := _0;
   449     gear^.dY := _0;
   450     gear^.Damage := 0;
   450     gear^.Damage := 0;
   451     gear^.Health := gear^.Hedgehog^.InitialHealth;
   451     gear^.Health := gear^.Hedgehog^.InitialHealth;
   452     gear^.Hedgehog^.Effects[hePoisoned] := false;
   452     gear^.Hedgehog^.Effects[hePoisoned] := 0;
   453     if not CurrentHedgehog^.Effects[heResurrectable] then
   453     if CurrentHedgehog^.Effects[heResurrectable] = 0 then
   454         with CurrentHedgehog^ do 
   454         with CurrentHedgehog^ do 
   455             begin
   455             begin
   456             inc(Team^.stats.AIKills);
   456             inc(Team^.stats.AIKills);
   457             FreeTexture(Team^.AIKillsTex);
   457             FreeTexture(Team^.AIKillsTex);
   458             Team^.AIKillsTex := RenderStringTex(inttostr(Team^.stats.AIKills), Team^.Clan^.Color, fnt16);
   458             Team^.AIKillsTex := RenderStringTex(inttostr(Team^.stats.AIKills), Team^.Clan^.Color, fnt16);
   591         end
   591         end
   592     else
   592     else
   593     begin
   593     begin
   594     OutError('Can''t find place for Gear', false);
   594     OutError('Can''t find place for Gear', false);
   595     if Gear^.Kind = gtHedgehog then
   595     if Gear^.Kind = gtHedgehog then
   596         Gear^.Hedgehog^.Effects[heResurrectable] := false;
   596         Gear^.Hedgehog^.Effects[heResurrectable] := 0;
   597     DeleteGear(Gear);
   597     DeleteGear(Gear);
   598     Gear:= nil
   598     Gear:= nil
   599     end
   599     end
   600 end;
   600 end;
   601 
   601