hedgewars/GSHandlers.inc
changeset 3350 5cd02aafc612
parent 3342 b4f01613dcd7
child 3351 3fd3f116f2fc
equal deleted inserted replaced
3349:5571592f10a8 3350:5cd02aafc612
  3046 1) Restrict portal gun to X shots.
  3046 1) Restrict portal gun to X shots.
  3047 2) If on first shot, delete all existing gtPortal
  3047 2) If on first shot, delete all existing gtPortal
  3048 3) On any other shot, delete any existing portals of type X%2, and spawn a new portal of type X%2 oriented at angle 180° from the portal gun.  It might possibly be worth linking portals with a Gear reference, to save time on scanning through the Gear list every time we need a portal.
  3048 3) On any other shot, delete any existing portals of type X%2, and spawn a new portal of type X%2 oriented at angle 180° from the portal gun.  It might possibly be worth linking portals with a Gear reference, to save time on scanning through the Gear list every time we need a portal.
  3049 *)
  3049 *)
  3050 end;
  3050 end;
       
  3051 
       
  3052 procedure doStepPiano(Gear: PGear);
       
  3053 var r0, r1: LongInt;
       
  3054 begin
       
  3055 AllInactive:= false;
       
  3056 doStepFallingGear(Gear);
       
  3057 if (Gear^.State and gstCollision) <> 0 then
       
  3058     begin
       
  3059     r0:= GetRandom(21);
       
  3060     r1:= GetRandom(21);
       
  3061     doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 80 + r0, EXPLAutoSound);
       
  3062     doMakeExplosion(hwRound(Gear^.X) - 30 - r0, hwRound(Gear^.Y) + 40, 40 + r1, EXPLAutoSound);
       
  3063     doMakeExplosion(hwRound(Gear^.X) + 30 + r1, hwRound(Gear^.Y) + 40, 40 + r0, EXPLAutoSound);
       
  3064     Gear^.dY:= -_1;
       
  3065     end
       
  3066 else
       
  3067     Gear^.dY += cGravity * 2; // let it fall faster so itdoesn't take too long for the whole attack
       
  3068 end;