hedgewars/uGears.pas
changeset 7767 d1ea9b3f543e
parent 7761 6dc1be8ff73e
child 7805 2a249a4faf5b
equal deleted inserted replaced
7766:98edc0724a28 7767:d1ea9b3f543e
   650     end;
   650     end;
   651 
   651 
   652 snowRight:= max(LAND_WIDTH,4096)+512;
   652 snowRight:= max(LAND_WIDTH,4096)+512;
   653 snowLeft:= -(snowRight-LAND_WIDTH);
   653 snowLeft:= -(snowRight-LAND_WIDTH);
   654 
   654 
   655 if not hasBorder and ((Theme = 'Snow') or (Theme = 'Christmas')) then
   655 if (not hasBorder) and ((Theme = 'Snow') or (Theme = 'Christmas')) then
   656     for i:= vobCount * Longword(max(LAND_WIDTH,4096)) div 2048 downto 1 do
   656     for i:= vobCount * Longword(max(LAND_WIDTH,4096)) div 2048 downto 1 do
   657         AddGear(LongInt(GetRandom(snowRight - snowLeft)) + snowLeft, LongInt(LAND_HEIGHT + GetRandom(750)) - 1300, gtFlake, 0, _0, _0, 0);
   657         AddGear(LongInt(GetRandom(snowRight - snowLeft)) + snowLeft, LongInt(LAND_HEIGHT + GetRandom(750)) - 1300, gtFlake, 0, _0, _0, 0);
   658 end;
   658 end;
   659 
   659 
   660 
   660 
   697 
   697 
   698                         DeleteCI(t);
   698                         DeleteCI(t);
   699                         t^.dX:= t^.dX + Gear^.dX * dmg * _0_01 + SignAs(cHHKick, Gear^.dX);
   699                         t^.dX:= t^.dX + Gear^.dX * dmg * _0_01 + SignAs(cHHKick, Gear^.dX);
   700                         t^.dY:= t^.dY + Gear^.dY * dmg * _0_01;
   700                         t^.dY:= t^.dY + Gear^.dY * dmg * _0_01;
   701                         t^.State:= t^.State or gstMoving;
   701                         t^.State:= t^.State or gstMoving;
   702                         if t^.Kind = gtKnife then t^.State:= t^.State and not gstCollision;
   702                         if t^.Kind = gtKnife then t^.State:= t^.State and (not gstCollision);
   703                         t^.Active:= true;
   703                         t^.Active:= true;
   704                         FollowGear:= t
   704                         FollowGear:= t
   705                         end
   705                         end
   706                     end;
   706                     end;
   707             gtGrave: begin
   707             gtGrave: begin
   828             if (not isZero(Gear^.dX)) or (not isZero(Gear^.dY)) then
   828             if (not isZero(Gear^.dX)) or (not isZero(Gear^.dY)) then
   829                 begin
   829                 begin
   830                 Gear^.Active:= true;
   830                 Gear^.Active:= true;
   831                 DeleteCI(Gear);
   831                 DeleteCI(Gear);
   832                 Gear^.State:= Gear^.State or gstMoving;
   832                 Gear^.State:= Gear^.State or gstMoving;
   833                 if Gear^.Kind = gtKnife then Gear^.State:= Gear^.State and not gstCollision;
   833                 if Gear^.Kind = gtKnife then Gear^.State:= Gear^.State and (not gstCollision);
   834                 // move the gear upwards a bit to throw it over tiny obstacles at start
   834                 // move the gear upwards a bit to throw it over tiny obstacles at start
   835                 if TestCollisionXwithGear(Gear, hwSign(Gear^.dX)) then
   835                 if TestCollisionXwithGear(Gear, hwSign(Gear^.dX)) then
   836                     begin
   836                     begin
   837                     if not (TestCollisionXwithXYShift(Gear, _0, -3, hwSign(Gear^.dX))
   837                     if not (TestCollisionXwithXYShift(Gear, _0, -3, hwSign(Gear^.dX))
   838                     or (TestCollisionYwithGear(Gear, -1) <> 0)) then
   838                     or (TestCollisionYwithGear(Gear, -1) <> 0)) then