From: Ketmar Dark Date: Tue, 5 Sep 2017 17:07:03 +0000 (+0300) Subject: .cfg option to control autoswitching to superfist: Game/BerserkAutoswitch X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=ac11c0bdc792cb54cc54da011f80ecb0ae09392c;p=d2df-sdl.git .cfg option to control autoswitching to superfist: Game/BerserkAutoswitch --- diff --git a/src/game/g_options.pas b/src/game/g_options.pas index e4dd887..623c10a 100644 --- a/src/game/g_options.pas +++ b/src/game/g_options.pas @@ -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); diff --git a/src/game/g_player.pas b/src/game/g_player.pas index 64b400d..300979a 100644 --- a/src/game/g_player.pas +++ b/src/game/g_player.pas @@ -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;