hedgewars/uGears.pas
changeset 7477 26706bf32ecf
parent 7426 55b49cc1f33a
child 7517 f287f00063e8
equal deleted inserted replaced
7474:bbecb1b4f59b 7477:26706bf32ecf
    75     delay2: LongWord;
    75     delay2: LongWord;
    76     step: (stDelay, stChDmg, stSweep, stTurnReact,
    76     step: (stDelay, stChDmg, stSweep, stTurnReact,
    77     stAfterDelay, stChWin, stWater, stChWin2, stHealth,
    77     stAfterDelay, stChWin, stWater, stChWin2, stHealth,
    78     stSpawn, stNTurn);
    78     stSpawn, stNTurn);
    79     upd: Longword;
    79     upd: Longword;
       
    80     snowLeft,snowRight: LongInt;
    80     //SDMusic: shortstring;
    81     //SDMusic: shortstring;
    81 
    82 
    82 // For better maintainability the step handlers of gears are stored in
    83 // For better maintainability the step handlers of gears are stored in
    83 // separate files.
    84 // separate files.
    84 // Note: step handlers of gears that are hedgehogs are in a different file
    85 // Note: step handlers of gears that are hedgehogs are in a different file
   640     rdx:= _90-(GetRandomf*_360);
   641     rdx:= _90-(GetRandomf*_360);
   641     rdy:= _90-(GetRandomf*_360);
   642     rdy:= _90-(GetRandomf*_360);
   642     AddGear(rx, ry, gtGenericFaller, gstInvisible, rdx, rdy, $FFFFFFFF);
   643     AddGear(rx, ry, gtGenericFaller, gstInvisible, rdx, rdy, $FFFFFFFF);
   643     end;
   644     end;
   644 
   645 
       
   646 snowRight:= max(LAND_WIDTH,4096)+512;
       
   647 snowLeft:= -(snowRight-LAND_WIDTH);
       
   648 
   645 if not hasBorder and ((Theme = 'Snow') or (Theme = 'Christmas')) then
   649 if not hasBorder and ((Theme = 'Snow') or (Theme = 'Christmas')) then
   646     for i:= 0 to Pred(vobCount*2) do
   650     for i:= vobCount * max(LAND_WIDTH,4096) div 2048 downto 1 do
   647         AddGear(GetRandom(LAND_WIDTH+1024)-512, LAND_HEIGHT - GetRandom(LAND_HEIGHT div 2), gtFlake, 0, _0, _0, 0);
   651         AddGear(GetRandom(snowRight-snowLeft)+snowLeft, LAND_HEIGHT-1300+GetRandom(750), gtFlake, 0, _0, _0, 0);
   648 end;
   652 end;
   649 
   653 
   650 
   654 
   651 procedure ShotgunShot(Gear: PGear);
   655 procedure ShotgunShot(Gear: PGear);
   652 var t: PGear;
   656 var t: PGear;