hedgewars/GSHandlers.inc
changeset 5913 1791f776b726
parent 5896 9ce1cf4e5a32
child 5922 7e7774e7be8c
equal deleted inserted replaced
5912:d31eba29e706 5913:1791f776b726
  2783 const upd: Longword =   0;
  2783 const upd: Longword =   0;
  2784 var 
  2784 var 
  2785     i: LongWord;
  2785     i: LongWord;
  2786     HHGear: PGear;
  2786     HHGear: PGear;
  2787     sparkles: PVisualGear;
  2787     sparkles: PVisualGear;
  2788 begin
  2788     hasWishes: boolean;
  2789     AllInactive := false;
  2789 begin
       
  2790     AllInactive := false;
       
  2791     hasWishes:= ((Gear^.Message and (gmPrecise or gmSwitch)) = (gmPrecise or gmSwitch));
       
  2792     if hasWishes then Gear^.AdvBounce:= 1;
  2790 
  2793 
  2791     HHGear := Gear^.Hedgehog^.Gear;
  2794     HHGear := Gear^.Hedgehog^.Gear;
  2792     HHGear^.State := HHGear^.State or gstNoDamage;
  2795     HHGear^.State := HHGear^.State or gstNoDamage;
  2793     DeleteCI(HHGear);
  2796     DeleteCI(HHGear);
  2794 
  2797 
  2795     Gear^.X := HHGear^.X;
  2798     Gear^.X := HHGear^.X;
  2796     Gear^.Y := HHGear^.Y;
  2799     Gear^.Y := HHGear^.Y;
  2797     if (GameTicks mod 2 = 0) and ((Gear^.Message and (gmPrecise or gmSwitch)) = (gmPrecise or gmSwitch)) then
  2800     if (GameTicks mod 2 = 0) and hasWishes then
  2798         begin
  2801         begin
  2799         sparkles:= AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtDust, 1);
  2802         sparkles:= AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtDust, 1);
  2800         if sparkles <> nil then sparkles^.Tint:= ((random(210)+45) shl 24) or ((random(210)+45) shl 16) or ((random(210)+45) shl 8) or $FF;
  2803         if sparkles <> nil then sparkles^.Tint:= ((random(210)+45) shl 24) or ((random(210)+45) shl 16) or ((random(210)+45) shl 8) or $FF;
  2801         end;
  2804         end;
  2802 
  2805 
  2817     until (i = 0) or (Gear^.Damage > Gear^.Health);
  2820     until (i = 0) or (Gear^.Damage > Gear^.Health);
  2818 
  2821 
  2819     inc(upd);
  2822     inc(upd);
  2820     if upd > 3 then
  2823     if upd > 3 then
  2821     begin
  2824     begin
  2822         if Gear^.Health < 1500 then Gear^.Pos := 2;
  2825         if Gear^.Health < 1500 then
       
  2826         begin
       
  2827             if Gear^.AdvBounce <> 0 then
       
  2828                 Gear^.Pos := 3
       
  2829             else
       
  2830                 Gear^.Pos := 2;
       
  2831         end;
  2823 
  2832 
  2824         AmmoShove(Gear, 30, 40);
  2833         AmmoShove(Gear, 30, 40);
  2825 
  2834 
  2826         DrawTunnel(HHGear^.X - HHGear^.dX * 10,
  2835         DrawTunnel(HHGear^.X - HHGear^.dX * 10,
  2827                    HHGear^.Y - _2 - HHGear^.dY * 10 + hwAbs(HHGear^.dY) * 2,
  2836                    HHGear^.Y - _2 - HHGear^.dY * 10 + hwAbs(HHGear^.dY) * 2,