DEADSOFTWARE

.cfg option to control autoswitching to superfist: Game/BerserkAutoswitch
authorKetmar Dark <ketmar@ketmar.no-ip.org>
Tue, 5 Sep 2017 17:07:03 +0000 (20:07 +0300)
committerKetmar Dark <ketmar@ketmar.no-ip.org>
Tue, 5 Sep 2017 17:07:39 +0000 (20:07 +0300)
src/game/g_options.pas
src/game/g_player.pas

index e4dd8875eadb7b4bc62597bf1b4690f950978a10..623c10a5bb8c11b797914a9457529b2d51eede6e 100644 (file)
@@ -129,6 +129,7 @@ var
   gSFSDebug: Boolean          = False;
   gSFSFastMode: Boolean       = False;
   gDefaultMegawadStart: AnsiString = DF_Default_Megawad_Start;
+  gBerserkAutoswitch: Boolean = True;
 
 implementation
 
@@ -436,6 +437,7 @@ begin
   wadoptFast := gSFSFastMode;
   e_FastScreenshots := config.ReadBool('Game', 'FastScreenshots', True);
   gDefaultMegawadStart := config.ReadStr('Game', 'DefaultMegawadStart', 'megawads/DOOM2D.WAD:\MAP01');
+  gBerserkAutoswitch := config.ReadBool('Game', 'BerserkAutoswitch', False);
 
 // Ãåéìïëåé â ñâîåé èãðå
   gcMap := config.ReadStr('GameplayCustom', 'Map', '');
@@ -673,6 +675,7 @@ begin
   config.WriteBool('Game', 'SFSFastMode', gSFSFastMode);
   config.WriteBool('Game', 'FastScreenshots', e_FastScreenshots);
   config.WriteStr('Game', 'DefaultMegawadStart', gDefaultMegawadStart);
+  config.WriteBool('Game', 'BerserkAutoswitch', gBerserkAutoswitch);
 
   config.WriteStr ('GameplayCustom', 'Map', gcMap);
   config.WriteStr ('GameplayCustom', 'GameMode', gcGameMode);
index 64b400d3dbb6c679b1fdb5a8f6ec18cf788ac078..300979a87de4011a595a4d59af4704d9132f74a3 100644 (file)
@@ -3980,15 +3980,17 @@ begin
         if not (R_BERSERK in FRulez) then
         begin
           Include(FRulez, R_BERSERK);
-          if FBFGFireCounter = -1 then
+          if gBerserkAutoswitch and (FBFGFireCounter = -1) then
           begin
             FCurrWeap := WEAPON_KASTET;
             resetWeaponQueue();
             FModel.SetWeapon(WEAPON_KASTET);
           end;
           if gFlash <> 0 then
+          begin
             Inc(FPain, 100);
             if gFlash = 2 then Inc(FPickup, 5);
+          end;
           FBerserk := gTime+30000;
           Result := True;
           remove := True;