hedgewars/uGears.pas
changeset 3848 32ceb775906b
parent 3845 90034acb2e43
child 3894 9abce5468583
equal deleted inserted replaced
3847:771562124b16 3848:32ceb775906b
   729             begin
   729             begin
   730             if Gear^.Tex <> nil then FreeTexture(Gear^.Tex);
   730             if Gear^.Tex <> nil then FreeTexture(Gear^.Tex);
   731             Gear^.Tex:= RenderStringTex(inttostr(Gear^.Timer div 1000), cWhiteColor, fntSmall);
   731             Gear^.Tex:= RenderStringTex(inttostr(Gear^.Timer div 1000), cWhiteColor, fntSmall);
   732             end;
   732             end;
   733         Gear^.doStep(Gear);
   733         Gear^.doStep(Gear);
       
   734         // might be useful later
       
   735         //ScriptCall('OnGearStep', Gear^.uid);
   734         end
   736         end
   735     end;
   737     end;
   736 
   738 
   737 if AllInactive then
   739 if AllInactive then
   738 case step of
   740 case step of
   967            spawnHealthTagForHH(CurrentHedgehog^.Gear, tmpDmg);
   969            spawnHealthTagForHH(CurrentHedgehog^.Gear, tmpDmg);
   968            end;
   970            end;
   969         end;
   971         end;
   970     end;
   972     end;
   971     inc(Gear^.Damage, Damage);
   973     inc(Gear^.Damage, Damage);
       
   974     ScriptCall('OnGearDamage', Gear^.UID, Damage);
   972 end;
   975 end;
   973 
   976 
   974 procedure SetAllToActive;
   977 procedure SetAllToActive;
   975 var t: PGear;
   978 var t: PGear;
   976 begin
   979 begin
  1571     tempTeam := PHedgehog(gear^.Hedgehog)^.Team;
  1574     tempTeam := PHedgehog(gear^.Hedgehog)^.Team;
  1572     DeleteCI(gear);
  1575     DeleteCI(gear);
  1573     FindPlace(gear, false, 0, LAND_WIDTH); 
  1576     FindPlace(gear, false, 0, LAND_WIDTH); 
  1574     if gear <> nil then begin
  1577     if gear <> nil then begin
  1575         RenderHealth(PHedgehog(gear^.Hedgehog)^);
  1578         RenderHealth(PHedgehog(gear^.Hedgehog)^);
  1576         ScriptCall('onResurrect', gear^.uid);
  1579         ScriptCall('onGearResurrect', gear^.uid);
  1577     end;
  1580     end;
  1578     RecountTeamHealth(tempTeam);
  1581     RecountTeamHealth(tempTeam);
  1579 end;
  1582 end;
  1580 
  1583 
  1581 function SpawnCustomCrateAt(x, y: LongInt; crate: TCrateType; content: Longword): PGear;
  1584 function SpawnCustomCrateAt(x, y: LongInt; crate: TCrateType; content: Longword): PGear;