hedgewars/GSHandlers.inc
branchhedgeroid
changeset 5577 272c82f82cee
parent 5564 4f42009237df
child 5594 3ab68a93434b
equal deleted inserted replaced
5550:50650032c251 5577:272c82f82cee
  2953         for i:= 0 to High(hogs) do
  2953         for i:= 0 to High(hogs) do
  2954             begin
  2954             begin
  2955             if hogs[i] <> CurrentHedgehog^.Gear then
  2955             if hogs[i] <> CurrentHedgehog^.Gear then
  2956                 begin
  2956                 begin
  2957                 //d:= Distance(Gear^.X - hogs[i]^.X, Gear^.Y - hogs[i]^.Y);
  2957                 //d:= Distance(Gear^.X - hogs[i]^.X, Gear^.Y - hogs[i]^.Y);
  2958                 hogs[i]^.dX:= _0_25 * (Gear^.X - hogs[i]^.X) / _250;
  2958                 hogs[i]^.dX:= _50 * cGravity * (Gear^.X - hogs[i]^.X) / _25;
  2959                 //if Gear^.X < hogs[i]^.X then hogs[i]^.dX.isNegative:= true;
  2959                 //if Gear^.X < hogs[i]^.X then hogs[i]^.dX.isNegative:= true;
  2960                 hogs[i]^.dY:= -_0_25;
  2960                 hogs[i]^.dY:= -_450 * cGravity;
  2961                 hogs[i]^.Active:= true;
  2961                 hogs[i]^.Active:= true;
  2962                 end
  2962                 end
  2963             end;
  2963             end;
  2964         end ;
  2964         end ;
  2965         AfterAttack;
  2965         AfterAttack;
  2988         DeleteGear(Gear)
  2988         DeleteGear(Gear)
  2989         end*)
  2989         end*)
  2990 end;
  2990 end;
  2991 
  2991 
  2992 procedure doStepSeductionWear(Gear: PGear);
  2992 procedure doStepSeductionWear(Gear: PGear);
       
  2993 var heart: PVisualGear;
  2993 begin
  2994 begin
  2994     AllInactive := false;
  2995     AllInactive := false;
  2995     inc(Gear^.Timer);
  2996     inc(Gear^.Timer);
  2996     if Gear^.Timer > 250 then
  2997     if Gear^.Timer > 250 then
  2997     begin
  2998         begin
  2998         Gear^.Timer := 0;
  2999         Gear^.Timer := 0;
  2999         inc(Gear^.Pos);
  3000         inc(Gear^.Pos);
  3000         if Gear^.Pos = 5 then
  3001         if Gear^.Pos = 5 then
  3001             PlaySound(sndYoohoo, Gear^.Hedgehog^.Team^.voicepack)
  3002             PlaySound(sndYoohoo, Gear^.Hedgehog^.Team^.voicepack)
  3002     end;
  3003         end;
  3003 
  3004 
  3004     if Gear^.Pos = 14 then
  3005     if (Gear^.Pos = 14) and (RealTicks and $3 = 0) then 
       
  3006         begin
       
  3007         heart:= AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtStraightShot);
       
  3008         if heart <> nil then 
       
  3009             with heart^ do
       
  3010                 begin
       
  3011                 dx:= 0.001 * (random(200));
       
  3012                 dy:= 0.001 * (random(200));
       
  3013                 if random(2) = 0 then dx := -dx;
       
  3014                 if random(2) = 0 then dy := -dy;
       
  3015                 FrameTicks:= random(750) + 1000;
       
  3016                 heart^.State:= ord(sprSeduction)
       
  3017                 end;
       
  3018         end;
       
  3019 
       
  3020     if Gear^.Pos = 15 then
  3005         Gear^.doStep := @doStepSeductionWork
  3021         Gear^.doStep := @doStepSeductionWork
  3006 end;
  3022 end;
  3007 
  3023 
  3008 procedure doStepSeduction(Gear: PGear);
  3024 procedure doStepSeduction(Gear: PGear);
  3009 begin
  3025 begin