hedgewars/uGearsHandlersMess.pas
changeset 10011 ead5e4b21671
parent 9998 736015b847e3
child 10015 4feced261c68
child 10038 0a5e651d494c
equal deleted inserted replaced
10010:2a1483d91977 10011:ead5e4b21671
   206     while gi <> nil do
   206     while gi <> nil do
   207         begin
   207         begin
   208         if (gi^.Kind = gtHedgehog) then
   208         if (gi^.Kind = gtHedgehog) then
   209             begin
   209             begin
   210             d := r - hwRound(Distance(gi^.X - x, gi^.Y - y));
   210             d := r - hwRound(Distance(gi^.X - x, gi^.Y - y));
   211             if (d > 1) and ((gi^.Hedgehog^.Effects[heInvulnerable] = 0)) and (GetRandom(2) = 0) then
   211             if (d > 1) and (gi^.Hedgehog^.Effects[heInvulnerable] = 0) and (GetRandom(2) = 0) then
   212                 begin
   212                 begin
   213                 if (CurrentHedgehog^.Gear = gi) then
   213                 if (CurrentHedgehog^.Gear = gi) then
   214                     PlaySoundV(sndOops, gi^.Hedgehog^.Team^.voicepack)
   214                     PlaySoundV(sndOops, gi^.Hedgehog^.Team^.voicepack)
   215 
   215 
   216                 else
   216                 else
  2903                 tdY:= gi^.Y-fY;
  2903                 tdY:= gi^.Y-fY;
  2904                 if hwRound(hwAbs(tdX)+hwAbs(tdY)) < dmgBase then
  2904                 if hwRound(hwAbs(tdX)+hwAbs(tdY)) < dmgBase then
  2905                     dmg:= dmgBase - max(hwRound(Distance(tdX, tdY)),gi^.Radius);
  2905                     dmg:= dmgBase - max(hwRound(Distance(tdX, tdY)),gi^.Radius);
  2906                 if (dmg > 1) then dmg:= ModifyDamage(min(dmg div 2, cakeDmg), gi);
  2906                 if (dmg > 1) then dmg:= ModifyDamage(min(dmg div 2, cakeDmg), gi);
  2907                 if (dmg > 1) then
  2907                 if (dmg > 1) then
  2908                     if (CurrentHedgehog^.Gear = gi) and ((gi^.Hedgehog^.Effects[heInvulnerable] = 0)) then
  2908                     if (CurrentHedgehog^.Gear = gi) and (gi^.Hedgehog^.Effects[heInvulnerable] = 0) then
  2909                         gi^.State := gi^.State or gstLoser
  2909                         gi^.State := gi^.State or gstLoser
  2910                     else
  2910                     else
  2911                         gi^.State := gi^.State or gstWinner;
  2911                         gi^.State := gi^.State or gstWinner;
  2912                 end;
  2912                 end;
  2913             gi := gi^.NextGear
  2913             gi := gi^.NextGear
  4824     tmp:= t^.ar[i];
  4824     tmp:= t^.ar[i];
  4825     if (tmp^.State and gstNoDamage) = 0 then
  4825     if (tmp^.State and gstNoDamage) = 0 then
  4826         if (tmp^.Kind = gtHedgehog) or (tmp^.Kind = gtMine) or (tmp^.Kind = gtExplosives) then
  4826         if (tmp^.Kind = gtHedgehog) or (tmp^.Kind = gtMine) or (tmp^.Kind = gtExplosives) then
  4827             begin
  4827             begin
  4828             //tmp^.State:= tmp^.State or gstFlatened;
  4828             //tmp^.State:= tmp^.State or gstFlatened;
  4829             if (tmp^.Hedgehog^.Effects[heInvulnerable] = 0) then
  4829             if (tmp^.Kind <> gtHedgehog) or (tmp^.Hedgehog^.Effects[heInvulnerable] = 0) then
  4830                 ApplyDamage(tmp, CurrentHedgehog, tmp^.Health div 3, dsUnknown);
  4830                 ApplyDamage(tmp, CurrentHedgehog, tmp^.Health div 3, dsUnknown);
  4831             //DrawTunnel(tmp^.X, tmp^.Y - _1, _0, _0_5, cHHRadius * 6, cHHRadius * 3);
  4831             //DrawTunnel(tmp^.X, tmp^.Y - _1, _0, _0_5, cHHRadius * 6, cHHRadius * 3);
  4832             tmp2:= AddGear(hwRound(tmp^.X), hwRound(tmp^.Y), gtHammerHit, 0, _0, _0, 0);
  4832             tmp2:= AddGear(hwRound(tmp^.X), hwRound(tmp^.Y), gtHammerHit, 0, _0, _0, 0);
  4833             tmp2^.LinkedGear:= tmp;
  4833             tmp2^.LinkedGear:= tmp;
  4834             SetAllToActive
  4834             SetAllToActive