hedgewars/uGears.pas
changeset 2983 25b6b554c516
parent 2968 f59631c3c1c0
child 2985 d268a7fbb868
equal deleted inserted replaced
2982:4213c6a8aceb 2983:25b6b554c516
   179             @doStepBomb,
   179             @doStepBomb,
   180             @doStepRCPlane,
   180             @doStepRCPlane,
   181             @doStepSniperRifleShot,
   181             @doStepSniperRifleShot,
   182             @doStepJetpack,
   182             @doStepJetpack,
   183             @doStepMolotov,
   183             @doStepMolotov,
   184             @doStepCase
   184             @doStepCase,
       
   185             @doStepBirdy
   185             );
   186             );
   186 
   187 
   187 procedure InsertGearToList(Gear: PGear);
   188 procedure InsertGearToList(Gear: PGear);
   188 var tmp, ptmp: PGear;
   189 var tmp, ptmp: PGear;
   189 begin
   190 begin
   430                 gear^.Health:= 2000;
   431                 gear^.Health:= 2000;
   431                 end;
   432                 end;
   432      gtMolotov: begin 
   433      gtMolotov: begin 
   433                 gear^.Radius:= 6;
   434                 gear^.Radius:= 6;
   434                 end;
   435                 end;
       
   436        gtBirdy: begin
       
   437                 gear^.Radius:= 16; // todo: check
       
   438                 gear^.Timer:= 500;
       
   439                 gear^.Health:= 2000;
       
   440                 end;
   435      end;
   441      end;
   436 InsertGearToList(gear);
   442 InsertGearToList(gear);
   437 AddGear:= gear;
   443 AddGear:= gear;
   438 
   444 
   439 ScriptCall('onGearAdd', gear^.uid);
   445 ScriptCall('onGearAdd', gear^.uid);
   584 begin
   590 begin
   585 PrvInactive:= AllInactive;
   591 PrvInactive:= AllInactive;
   586 AllInactive:= true;
   592 AllInactive:= true;
   587 
   593 
   588 if (StepSoundTimer > 0) and (StepSoundChannel < 0) then
   594 if (StepSoundTimer > 0) and (StepSoundChannel < 0) then
   589     begin
       
   590     WriteLnToConsole('playsteps ...');
       
   591     StepSoundChannel:= LoopSound(sndSteps)
   595     StepSoundChannel:= LoopSound(sndSteps)
   592     end
       
   593 else if (StepSoundTimer = 0) and (StepSoundChannel > -1) then
   596 else if (StepSoundTimer = 0) and (StepSoundChannel > -1) then
   594     begin
   597     begin
   595     WriteLnToConsole('stopsteps ...');
       
   596     StopSound(StepSoundChannel);
   598     StopSound(StepSoundChannel);
   597     StepSoundChannel:= -1;
   599     StepSoundChannel:= -1;
   598     end;
   600     end;
   599 
   601 
   600 if StepSoundTimer > 0 then
   602 if StepSoundTimer > 0 then
  1633        gtSeduction: if Gear^.Pos >= 14 then DrawSprite(sprSeduction, hwRound(Gear^.X) - 16 + WorldDx, hwRound(Gear^.Y) - 16 + WorldDy, 0);
  1635        gtSeduction: if Gear^.Pos >= 14 then DrawSprite(sprSeduction, hwRound(Gear^.X) - 16 + WorldDx, hwRound(Gear^.Y) - 16 + WorldDy, 0);
  1634       gtWatermelon: DrawRotatedf(sprWatermelon, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, 0, Gear^.DirAngle);
  1636       gtWatermelon: DrawRotatedf(sprWatermelon, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, 0, Gear^.DirAngle);
  1635       gtMelonPiece: DrawRotatedf(sprWatermelon, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 1, 0, Gear^.DirAngle);
  1637       gtMelonPiece: DrawRotatedf(sprWatermelon, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 1, 0, Gear^.DirAngle);
  1636      gtHellishBomb: DrawRotated(sprHellishBomb, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, Gear^.DirAngle);
  1638      gtHellishBomb: DrawRotated(sprHellishBomb, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, Gear^.DirAngle);
  1637       gtEvilTrace: if Gear^.State < 8 then DrawSprite(sprEvilTrace, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, Gear^.State);
  1639       gtEvilTrace: if Gear^.State < 8 then DrawSprite(sprEvilTrace, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, Gear^.State);
       
  1640            gtBirdy: DrawTextureF(SpritesData[sprBirdy].Texture, 1 - Gear^.Timer / 500, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, ((Gear^.Pos shr 6) or (RealTicks shr 8)) mod 2, Gear^.Tag, 75, 75);
  1638          end;
  1641          end;
  1639       if Gear^.RenderTimer and (Gear^.Tex <> nil) then DrawCentered(hwRound(Gear^.X) + 8 + WorldDx, hwRound(Gear^.Y) + 8 + WorldDy, Gear^.Tex);
  1642       if Gear^.RenderTimer and (Gear^.Tex <> nil) then DrawCentered(hwRound(Gear^.X) + 8 + WorldDx, hwRound(Gear^.Y) + 8 + WorldDy, Gear^.Tex);
  1640       Gear:= Gear^.NextGear
  1643       Gear:= Gear^.NextGear
  1641       end;
  1644       end;
  1642 end;
  1645 end;