hedgewars/GSHandlers.inc
changeset 5748 70d7f8e40f53
parent 5738 a81fc23356e7
child 5750 6bbf7aee2cdf
equal deleted inserted replaced
5747:65006a679352 5748:70d7f8e40f53
   764 
   764 
   765 ////////////////////////////////////////////////////////////////////////////////
   765 ////////////////////////////////////////////////////////////////////////////////
   766 procedure doStepBeeWork(Gear: PGear);
   766 procedure doStepBeeWork(Gear: PGear);
   767 var 
   767 var 
   768     t: hwFloat;
   768     t: hwFloat;
   769     gX,gY: LongInt;
   769     gX,gY,i: LongInt;
   770     nuw: boolean;
   770     nuw: boolean;
       
   771     flower: PVisualGear;
   771 
   772 
   772 const uw: boolean =   false;
   773 const uw: boolean =   false;
   773 begin
   774 begin
   774     AllInactive := false;
   775     AllInactive := false;
   775     gX := hwRound(Gear^.X);
   776     gX := hwRound(Gear^.X);
   814     dec(Gear^.Timer);
   815     dec(Gear^.Timer);
   815     if ((Gear^.State and gstCollision) <> 0) or (Gear^.Timer = 0) then
   816     if ((Gear^.State and gstCollision) <> 0) or (Gear^.Timer = 0) then
   816     begin
   817     begin
   817         StopSound(Gear^.SoundChannel);
   818         StopSound(Gear^.SoundChannel);
   818         doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 50, Gear^.Hedgehog, EXPLAutoSound);
   819         doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 50, Gear^.Hedgehog, EXPLAutoSound);
       
   820         for i:= 0 to 31 do
       
   821             begin
       
   822             flower:= AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtStraightShot);
       
   823             if flower <> nil then 
       
   824                 with flower^ do
       
   825                     begin
       
   826                     Scale:= 0.75;
       
   827                     dx:= 0.001 * (random(200));
       
   828                     dy:= 0.001 * (random(200));
       
   829                     if random(2) = 0 then dx := -dx;
       
   830                     if random(2) = 0 then dy := -dy;
       
   831                     FrameTicks:= random(250) + 250;
       
   832                     State:= ord(sprTargetBee);
       
   833                     end;
       
   834             end;
   819         DeleteGear(Gear);
   835         DeleteGear(Gear);
   820     end;
   836     end;
   821 end;
   837 end;
   822 
   838 
   823 procedure doStepBee(Gear: PGear);
   839 procedure doStepBee(Gear: PGear);
  3017                 dx:= 0.001 * (random(200));
  3033                 dx:= 0.001 * (random(200));
  3018                 dy:= 0.001 * (random(200));
  3034                 dy:= 0.001 * (random(200));
  3019                 if random(2) = 0 then dx := -dx;
  3035                 if random(2) = 0 then dx := -dx;
  3020                 if random(2) = 0 then dy := -dy;
  3036                 if random(2) = 0 then dy := -dy;
  3021                 FrameTicks:= random(750) + 1000;
  3037                 FrameTicks:= random(750) + 1000;
  3022                 heart^.State:= ord(sprSeduction)
  3038                 State:= ord(sprSeduction)
  3023                 end;
  3039                 end;
  3024         end;
  3040         end;
  3025 
  3041 
  3026     if Gear^.Pos = 15 then
  3042     if Gear^.Pos = 15 then
  3027         Gear^.doStep := @doStepSeductionWork
  3043         Gear^.doStep := @doStepSeductionWork