hedgewars/uGears.pas
changeset 868 4884bce5e5eb
parent 867 dc7901b1120e
child 869 daddcd31ef34
equal deleted inserted replaced
867:dc7901b1120e 868:4884bce5e5eb
    19 unit uGears;
    19 unit uGears;
    20 interface
    20 interface
    21 uses SDLh, uConsts, uFloat;
    21 uses SDLh, uConsts, uFloat;
    22 {$INCLUDE options.inc}
    22 {$INCLUDE options.inc}
    23 const AllInactive: boolean = false;
    23 const AllInactive: boolean = false;
       
    24       PrvInactive: boolean = false;
    24 
    25 
    25 type PGear = ^TGear;
    26 type PGear = ^TGear;
    26      TGearStepProcedure = procedure (Gear: PGear);
    27      TGearStepProcedure = procedure (Gear: PGear);
    27      TGear = record
    28      TGear = record
    28              NextGear, PrevGear: PGear;
    29              NextGear, PrevGear: PGear;
   385 const delay: LongWord = 0;
   386 const delay: LongWord = 0;
   386       step: (stDelay, stChDmg, stChWin, stTurnReact,
   387       step: (stDelay, stChDmg, stChWin, stTurnReact,
   387              stAfterDelay, stSpawn, stNTurn) = stDelay;
   388              stAfterDelay, stSpawn, stNTurn) = stDelay;
   388 var Gear, t: PGear;
   389 var Gear, t: PGear;
   389 begin
   390 begin
       
   391 PrvInactive:= AllInactive;
   390 AllInactive:= true;
   392 AllInactive:= true;
   391 t:= GearsList;
   393 t:= GearsList;
   392 while t<>nil do
   394 while t<>nil do
   393       begin
   395       begin
   394       Gear:= t;
   396       Gear:= t;
   484 	amt: TAmmoType;
   486 	amt: TAmmoType;
   485 	hx, hy, m: LongInt;
   487 	hx, hy, m: LongInt;
   486 	aAngle, dAngle: real;
   488 	aAngle, dAngle: real;
   487 	defaultPos: boolean;
   489 	defaultPos: boolean;
   488 begin
   490 begin
       
   491 if (Gear^.State and gstHHDeath) <> 0 then
       
   492 	begin
       
   493 	DrawSprite(sprHHDeath, hwRound(Gear^.X) - 16 + WorldDx, hwRound(Gear^.Y) - 26 + WorldDy, Gear^.Pos);
       
   494 	exit
       
   495 	end;
   489 defaultPos:= true;
   496 defaultPos:= true;
   490 
   497 
   491 hx:= hwRound(Gear^.X) + 1 + 8 * hwSign(Gear^.dX) + WorldDx;
   498 hx:= hwRound(Gear^.X) + 1 + 8 * hwSign(Gear^.dX) + WorldDx;
   492 hy:= hwRound(Gear^.Y) - 2 + WorldDy;
   499 hy:= hwRound(Gear^.Y) - 2 + WorldDy;
   493 aangle:= Gear^.Angle * 180 / cMaxAngle - 90;
   500 aangle:= Gear^.Angle * 180 / cMaxAngle - 90;