hedgewars/GSHandlers.inc
branchhedgeroid
changeset 5385 a864a0aeed96
parent 5366 bfdd925e89a5
child 5368 a66d5141a3ba
equal deleted inserted replaced
5383:cb217271f344 5385:a864a0aeed96
   603     end
   603     end
   604 else if GameTicks and $7 = 0 then
   604 else if GameTicks and $7 = 0 then
   605     begin
   605     begin
   606     with Gear^ do
   606     with Gear^ do
   607         begin
   607         begin
   608         X:= X + cWindSpeed * 1600 + dX;
   608         State:= State and not gstInvisible;
       
   609         X:= X + cWindSpeed * 3200 + dX;
   609         Y:= Y + dY + cGravity * vobFallSpeed * 8;  // using same value as flakes to try and get similar results
   610         Y:= Y + dY + cGravity * vobFallSpeed * 8;  // using same value as flakes to try and get similar results
   610         xx:= hwRound(X);
   611         xx:= hwRound(X);
   611         yy:= hwRound(Y);
   612         yy:= hwRound(Y);
   612         if vobVelocity <> 0 then
   613         if vobVelocity <> 0 then
   613             begin
   614             begin
   623             inc(Timer);
   624             inc(Timer);
   624             if Timer = vobFramesCount then Timer:= 0
   625             if Timer = vobFramesCount then Timer:= 0
   625             end;
   626             end;
   626     // move back to cloud layer
   627     // move back to cloud layer
   627         if yy > cWaterLine then move:= true
   628         if yy > cWaterLine then move:= true
   628         else if ((yy and LAND_HEIGHT_MASK) <> 0) or ((xx and LAND_WIDTH_MASK) <> 0) then move:=true
   629         else if ((yy and LAND_HEIGHT_MASK) <> 0) or (xx > LAND_WIDTH + 512) or (xx < -512) then move:=true
   629         // Solid pixel encountered
   630         // Solid pixel encountered
   630         else if (Land[yy, xx] <> 0) then
   631         else if ((xx and LAND_WIDTH_MASK) = 0) and (Land[yy, xx] <> 0) then
   631             begin
   632             begin
   632             // If there's room below keep falling
   633             // If there's room below keep falling
   633             if (((yy-1) and LAND_HEIGHT_MASK) = 0) and (Land[yy-1, xx] = 0) then
   634             if (((yy-1) and LAND_HEIGHT_MASK) = 0) and (Land[yy-1, xx] = 0) then
   634                 begin
   635                 begin
   635                 X:= X - cWindSpeed * 1600 - dX;
   636                 X:= X - cWindSpeed * 1600 - dX;
  2563     if ((Gear^.Message and not gmSwitch) <> 0) or (TurnTimeLeft = 0) then
  2564     if ((Gear^.Message and not gmSwitch) <> 0) or (TurnTimeLeft = 0) then
  2564     begin
  2565     begin
  2565         HHGear := Gear^.Hedgehog^.Gear;
  2566         HHGear := Gear^.Hedgehog^.Gear;
  2566         Msg := Gear^.Message and not gmSwitch;
  2567         Msg := Gear^.Message and not gmSwitch;
  2567         DeleteGear(Gear);
  2568         DeleteGear(Gear);
  2568         OnUsedAmmo(HHGear^.Hedgehog^);
       
  2569         ApplyAmmoChanges(HHGear^.Hedgehog^);
  2569         ApplyAmmoChanges(HHGear^.Hedgehog^);
  2570 
  2570 
  2571         HHGear := CurrentHedgehog^.Gear;
  2571         HHGear := CurrentHedgehog^.Gear;
  2572         ApplyAmmoChanges(HHGear^.Hedgehog^);
  2572         ApplyAmmoChanges(HHGear^.Hedgehog^);
  2573         HHGear^.Message := Msg;
  2573         HHGear^.Message := Msg;
  2612     HHGear: PGear;
  2612     HHGear: PGear;
  2613 begin
  2613 begin
  2614     Gear^.doStep := @doStepSwitcherWork;
  2614     Gear^.doStep := @doStepSwitcherWork;
  2615 
  2615 
  2616     HHGear := Gear^.Hedgehog^.Gear;
  2616     HHGear := Gear^.Hedgehog^.Gear;
       
  2617     OnUsedAmmo(HHGear^.Hedgehog^);
  2617     with HHGear^ do
  2618     with HHGear^ do
  2618     begin
  2619     begin
  2619         State := State and not gstAttacking;
  2620         State := State and not gstAttacking;
  2620         Message := Message and not gmAttack
  2621         Message := Message and not gmAttack
  2621     end
  2622     end
  4532     dec(Gear^.Timer);
  4533     dec(Gear^.Timer);
  4533     Gear^.X:= Gear^.X + Gear^.dX;
  4534     Gear^.X:= Gear^.X + Gear^.dX;
  4534     Gear^.Y:= Gear^.Y + Gear^.dY;
  4535     Gear^.Y:= Gear^.Y + Gear^.dY;
  4535     Gear^.dX := Gear^.dX + cWindSpeed / 4;
  4536     Gear^.dX := Gear^.dX + cWindSpeed / 4;
  4536     Gear^.dY := Gear^.dY + cGravity / 100;
  4537     Gear^.dY := Gear^.dY + cGravity / 100;
  4537     if (GameTicks mod 250) = 0 then
  4538     if (GameTicks and $FF) = 0 then
  4538         doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 20, Gear^.Hedgehog, EXPLDontDraw or EXPLNoGfx or EXPLNoDamage or EXPLDoNotTouchAny or EXPLPoisoned);
  4539         doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 20, Gear^.Hedgehog, EXPLDontDraw or EXPLNoGfx or EXPLNoDamage or EXPLDoNotTouchAny or EXPLPoisoned);
  4539     AllInactive:= false;
  4540     AllInactive:= false;
  4540 end;
  4541 end;
  4541 
  4542 
  4542 ////////////////////////////////////////////////////////////////////////////////
  4543 ////////////////////////////////////////////////////////////////////////////////