hedgewars/GSHandlers.inc
changeset 4024 1ffb84b3823d
parent 4023 8de77872ef21
child 4026 afae5a3b8424
equal deleted inserted replaced
4023:8de77872ef21 4024:1ffb84b3823d
  4111     if Gear^.Power < 45 then begin
  4111     if Gear^.Power < 45 then begin
  4112         inc(Gear^.Power);
  4112         inc(Gear^.Power);
  4113         Gear^.Y := Gear^.Y - _1;
  4113         Gear^.Y := Gear^.Y - _1;
  4114     end;
  4114     end;
  4115 
  4115 
  4116     graves := GearsNear(hh^.Gear, gtGrave, Gear^.Radius);
  4116     graves := GearsNear(hh^.Gear^.X, hh^.Gear^.Y + int2hwFloat(Gear^.Power),
  4117 
  4117                     gtGrave, Gear^.Radius);
  4118     if Length(graves) = 0 then 
  4118 
  4119         begin
  4119     if Length(graves) = 0 then begin
  4120         StopSound(Gear^.SoundChannel);
  4120         StopSound(Gear^.SoundChannel);
  4121         Gear^.Timer := 250;
  4121         Gear^.Timer := 250;
  4122         Gear^.doStep := @doStepIdle;
  4122         Gear^.doStep := @doStepIdle;
  4123         exit;
  4123         exit;
  4124         end;
  4124     end;
  4125 
  4125 
  4126     if ((Gear^.Message and gmAttack) <> 0) and (hh^.Gear^.Health > 0) then begin
  4126     if ((Gear^.Message and gmAttack) <> 0) and (hh^.Gear^.Health > 0) then begin
  4127         i := getRandom(Length(graves));
  4127         i := getRandom(Length(graves));
  4128         dec(hh^.Gear^.Health);
  4128         dec(hh^.Gear^.Health);
  4129         if (hh^.Gear^.Health = 0) and (hh^.Gear^.Damage = 0) then
  4129         if (hh^.Gear^.Health = 0) and (hh^.Gear^.Damage = 0) then
  4168     hh: PHedgehog;
  4168     hh: PHedgehog;
  4169     i: LongInt;
  4169     i: LongInt;
  4170 begin
  4170 begin
  4171     AllInactive := false;
  4171     AllInactive := false;
  4172     hh := PHedgehog(Gear^.Hedgehog);
  4172     hh := PHedgehog(Gear^.Hedgehog);
  4173     graves := GearsNear(hh^.Gear, gtGrave, Gear^.Radius);
  4173     graves := GearsNear(hh^.Gear^.X, hh^.Gear^.Y, gtGrave, Gear^.Radius);
  4174 
  4174 
  4175     if Length(graves) > 0 then begin
  4175     if Length(graves) > 0 then begin
  4176         for i:= 0 to High(graves) do begin
  4176         for i:= 0 to High(graves) do begin
  4177             PHedgehog(graves[i]^.Hedgehog)^.Gear := nil;
  4177             PHedgehog(graves[i]^.Hedgehog)^.Gear := nil;
  4178             graves[i]^.Health := 0;
  4178             graves[i]^.Health := 0;