Skip to content

Commit

Permalink
v10.15 update
Browse files Browse the repository at this point in the history
  • Loading branch information
argonlefou committed Jun 16, 2023
1 parent b4f5446 commit 2b80d8a
Show file tree
Hide file tree
Showing 13 changed files with 1,582 additions and 1,367 deletions.
9 changes: 4 additions & 5 deletions DemulShooter/DemulShooterWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -605,19 +605,19 @@ public DemulShooterWindow(string[] Args, bool isVerbose)
} break;
case "hfa":
{
_Game = new Game_WndHeavyFire3Pc("hfa", _Configurator.HF3_Path, _Configurator.HF3_CoverSensibility, _NoInput, false, isVerbose);
_Game = new Game_WndHeavyFire3Pc("hfa", _Configurator.HF3_Path, _Configurator.HF3_CoverSensibility, _Configurator.HF3_ReverseCover, _NoInput, false, isVerbose);
}; break;
case "hfa2p":
{
_Game = new Game_WndHeavyFire3Pc("hfa", _Configurator.HF3_Path, _Configurator.HF3_CoverSensibility, _NoInput, true, isVerbose);
_Game = new Game_WndHeavyFire3Pc("hfa", _Configurator.HF3_Path, _Configurator.HF3_CoverSensibility, _Configurator.HF4_ReverseCover, _NoInput, true, isVerbose);
}; break;
case "hfss":
{
_Game = new Game_WndHeavyFire4Pc("hfss", _Configurator.HF4_Path, _Configurator.HF4_CoverSensibility, _NoInput, false, isVerbose);
_Game = new Game_WndHeavyFire4Pc("hfss", _Configurator.HF4_Path, _Configurator.HF4_CoverSensibility, _Configurator.HF3_ReverseCover, _NoInput, false, isVerbose);
}; break;
case "hfss2p":
{
_Game = new Game_WndHeavyFire4Pc("hfss", _Configurator.HF4_Path, _Configurator.HF4_CoverSensibility, _NoInput, true, isVerbose);
_Game = new Game_WndHeavyFire4Pc("hfss", _Configurator.HF4_Path, _Configurator.HF4_CoverSensibility, _Configurator.HF4_ReverseCover, _NoInput, true, isVerbose);
}; break;
case "hod2pc":
{
Expand Down Expand Up @@ -817,7 +817,6 @@ private void ProcessRawInputMessage(IntPtr RawInputHandle)
Logger.WriteLog("ActLabs adaptated OnScreen Cursor Position (Px) = [ " + Player.RIController.Computed_X + ", " + Player.RIController.Computed_Y + " ]");
}


//Change X asxis scaling based on user requirements
if (_ForceScalingX != 1.0)
{
Expand Down
78 changes: 52 additions & 26 deletions DemulShooter/Games/Game_WndHeavyFire3Pc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ class Game_WndHeavyFire3Pc : Game
//Cover Bottom = S
//Cover Right = D
//QTE = Space
private const VirtualKeyCode P1_QTE_W_VK = VirtualKeyCode.VK_W;
private const VirtualKeyCode P1_COVERLEFT_VK = VirtualKeyCode.VK_A;
private const VirtualKeyCode P1_COVERRIGHT_VK = VirtualKeyCode.VK_D;
private const VirtualKeyCode P1_COVERBOTTOM_VK = VirtualKeyCode.VK_S;
private const VirtualKeyCode P1_QTE_SPACE_VK = VirtualKeyCode.VK_SPACE;
private const VirtualKeyCode _P1_QTE_W_VK = VirtualKeyCode.VK_W;
private const VirtualKeyCode _P1_COVERLEFT_VK = VirtualKeyCode.VK_A;
private const VirtualKeyCode _P1_COVERRIGHT_VK = VirtualKeyCode.VK_D;
private const VirtualKeyCode _P1_COVERBOTTOM_VK = VirtualKeyCode.VK_S;
private const VirtualKeyCode _P1_QTE_SPACE_VK = VirtualKeyCode.VK_SPACE;
//For player 2 if used, keys are choosed for x360kb.ini:
//I usually prefer to send VirtualKeycodes (less troublesome when no physical Keyboard is plugged)
//But with x360kb only DIK keycodes are working
Expand All @@ -70,6 +70,7 @@ class Game_WndHeavyFire3Pc : Game

protected float _Axis_X_Min;
protected float _Axis_X_Max;
protected bool _Reversecover = false;
protected float _CoverDelta = 0.3f;
protected bool _CoverLeftEnabled = false;
protected bool _CoverBottomEnabled = false;
Expand All @@ -80,7 +81,7 @@ class Game_WndHeavyFire3Pc : Game
/// <summary>
/// Constructor
/// </summary>
public Game_WndHeavyFire3Pc(String RomName, String GamePath, int CoverSensibility, bool EnableP2, bool DisableInputHack, bool Verbose)
public Game_WndHeavyFire3Pc(String RomName, String GamePath, int CoverSensibility, bool Reversecover, bool EnableP2, bool DisableInputHack, bool Verbose)
: base(RomName, "HeavyFire3", DisableInputHack, Verbose)
{
_ExecutableFilePath = GamePath + @"\" + HFA_FILENAME;
Expand All @@ -98,6 +99,7 @@ public Game_WndHeavyFire3Pc(String RomName, String GamePath, int CoverSensibilit
_KnownMd5Prints.Add("Heavy Fire 3 - MASTIFF", "3f49951ae8232817a91ef5503374d6b3");
_KnownMd5Prints.Add("Heavy Fire 3 - STEAM", "1841e571286acb17a98546a439c08e57");

_Reversecover = Reversecover;
_EnableP2 = EnableP2;
_CoverDelta = (float)CoverSensibility / 10.0f;
Logger.WriteLog("Setting Cover delta to screen border to " + _CoverDelta.ToString());
Expand Down Expand Up @@ -445,65 +447,81 @@ public override void SendInput(PlayerSettings PlayerData)
{
//If the player is aiming on the left side of the screen before pressing the button
//=> Cover Left
if (_P1_X_Value < _Axis_X_Min + _CoverDelta)
if ((_P1_X_Value < _Axis_X_Min + _CoverDelta) && !_Reversecover)
{
Send_VK_KeyDown(P1_COVERLEFT_VK);
Send_VK_KeyDown(_P1_COVERLEFT_VK);
_CoverLeftEnabled = true;
}
//If the player is aiming on the bottom side of the screen before pressing the button
//=> Cover Down
else if (_P1_Y_Value > (1.0f - _CoverDelta))
//If the player is aiming on the right side of the screen before pressing the button
//=> Cover Left
else if ((_P1_X_Value > _Axis_X_Max - _CoverDelta) && _Reversecover)
{
Send_VK_KeyDown(P1_COVERBOTTOM_VK);
_CoverBottomEnabled = true;
Send_VK_KeyDown(_P1_COVERLEFT_VK);
_CoverLeftEnabled = true;
}

//If the player is aiming on the right side of the screen before pressing the button
//=> Cover Right
else if (_P1_X_Value > _Axis_X_Max - _CoverDelta)
else if ((_P1_X_Value > _Axis_X_Max - _CoverDelta) && !_Reversecover)
{
Send_VK_KeyDown(P1_COVERRIGHT_VK);
Send_VK_KeyDown(_P1_COVERRIGHT_VK);
_CoverRightEnabled = true;
}
//If the player is aiming on the left side of the screen before pressing the button
//=> Cover Right
else if ((_P1_X_Value < _Axis_X_Min + _CoverDelta) && _Reversecover)
{
Send_VK_KeyDown(_P1_COVERRIGHT_VK);
_CoverRightEnabled = true;
}

//If the player is aiming on the bottom side of the screen before pressing the button
//=> Cover Down
else if (_P1_Y_Value > (1.0f - _CoverDelta))
{
Send_VK_KeyDown(_P1_COVERBOTTOM_VK);
_CoverBottomEnabled = true;
}
//If the player is aiming on the top side of the screen before pressing the button
//=> W [QTE]
else if (_P1_Y_Value < (-1.0f + _CoverDelta))
{
Send_VK_KeyDown(P1_QTE_W_VK);
Send_VK_KeyDown(_P1_QTE_W_VK);
_QTE_W_Enabled = true;
}
//If nothing above
//=> Spacebar [QTE]
else
{
Send_VK_KeyDown(P1_QTE_SPACE_VK);
Send_VK_KeyDown(_P1_QTE_SPACE_VK);
_QTE_Spacebar_Enabled = true;
}
}
if ((PlayerData.RIController.Computed_Buttons & RawInputcontrollerButtonEvent.ActionUp) != 0)
{
if (_CoverLeftEnabled)
{
Send_VK_KeyUp(P1_COVERLEFT_VK);
Send_VK_KeyUp(_P1_COVERLEFT_VK);
_CoverLeftEnabled = false;
}
if (_CoverBottomEnabled)
{
Send_VK_KeyUp(P1_COVERBOTTOM_VK);
Send_VK_KeyUp(_P1_COVERBOTTOM_VK);
_CoverBottomEnabled = false;
}
if (_CoverRightEnabled)
{
Send_VK_KeyUp(P1_COVERRIGHT_VK);
Send_VK_KeyUp(_P1_COVERRIGHT_VK);
_CoverRightEnabled = false;
}
if (_QTE_W_Enabled)
{
Send_VK_KeyUp(P1_QTE_W_VK);
Send_VK_KeyUp(_P1_QTE_W_VK);
_QTE_W_Enabled = false;
}
if (_QTE_Spacebar_Enabled)
{
Send_VK_KeyUp(P1_QTE_SPACE_VK);
Send_VK_KeyUp(_P1_QTE_SPACE_VK);
_QTE_Spacebar_Enabled = false;
}
}
Expand All @@ -529,18 +547,26 @@ public override void SendInput(PlayerSettings PlayerData)

if ((PlayerData.RIController.Computed_Buttons & RawInputcontrollerButtonEvent.ActionDown) != 0)
{
if (_P2_X_Value < _Axis_X_Min + _CoverDelta)
if ((_P2_X_Value < _Axis_X_Min + _CoverDelta) && !_Reversecover)
{
SendKeyDown(_P2_CoverLeft_DIK);
}
else if (_P2_Y_Value > (1.0f - _CoverDelta))
else if ((_P2_X_Value > _Axis_X_Max - _CoverDelta) && !_Reversecover)
{
SendKeyDown(_P2_CoverDown_DIK);
SendKeyDown(_P2_CoverLeft_DIK);
}
else if ((_P2_X_Value > _Axis_X_Max - _CoverDelta) && _Reversecover)
{
SendKeyDown(_P2_CoverRight_DIK);
}
else if (_P2_X_Value > _Axis_X_Max - _CoverDelta)
else if ((_P2_X_Value < _Axis_X_Min + _CoverDelta) && _Reversecover)
{
SendKeyDown(_P2_CoverRight_DIK);
}
else if (_P2_Y_Value > (1.0f - _CoverDelta))
{
SendKeyDown(_P2_CoverDown_DIK);
}
}
if ((PlayerData.RIController.Computed_Buttons & RawInputcontrollerButtonEvent.ActionUp) != 0)
{
Expand Down
50 changes: 38 additions & 12 deletions DemulShooter/Games/Game_WndHeavyFire4Pc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ class Game_WndHeavyFire4Pc : Game

protected float _Axis_X_Min;
protected float _Axis_X_Max;
protected bool _Reversecover = false;
protected float _CoverDelta = 0.3f;
protected bool _CoverLeftEnabled = false;
protected bool _CoverBottomEnabled = false;
Expand All @@ -78,7 +79,7 @@ class Game_WndHeavyFire4Pc : Game
/// <summary>
/// Constructor
/// </summary>
public Game_WndHeavyFire4Pc(String RomName, String GamePath, int CoverSensibility, bool EnableP2, bool DisableInputHack, bool Verbose)
public Game_WndHeavyFire4Pc(String RomName, String GamePath, int CoverSensibility, bool Reversecover, bool EnableP2, bool DisableInputHack, bool Verbose)
: base(RomName, "HeavyFire4", DisableInputHack, Verbose)
{
_ExecutableFilePath = GamePath + @"\" + HFA_FILENAME;
Expand All @@ -96,6 +97,7 @@ public Game_WndHeavyFire4Pc(String RomName, String GamePath, int CoverSensibilit
_KnownMd5Prints.Add("Heavy Fire 4 - MASTIFF", "9476f9bba48aea6ca04d06158be07f1c");
_KnownMd5Prints.Add("Heavy Fire 4 - STEAM", "7f8bf20aaba80ac1239efc553d94a53f");

_Reversecover = Reversecover;
_EnableP2 = EnableP2;
_CoverDelta = (float)CoverSensibility / 10.0f;
Logger.WriteLog("Setting Cover delta to screen border to " + _CoverDelta.ToString());
Expand Down Expand Up @@ -446,25 +448,41 @@ public override void SendInput(PlayerSettings PlayerData)
{
//If the player is aiming on the left side of the screen before pressing the button
//=> Cover Left
if (_P1_X_Value < _Axis_X_Min + _CoverDelta)
if ((_P1_X_Value < _Axis_X_Min + _CoverDelta) && !_Reversecover)
{
Send_VK_KeyDown(_P1_CoverLeft_VK);
_CoverLeftEnabled = true;
}
//If the player is aiming on the bottom side of the screen before pressing the button
//=> Cover Down
else if (_P1_Y_Value > (1.0f - _CoverDelta))
//If the player is aiming on the right side of the screen before pressing the button
//=> Cover Left
else if ((_P1_X_Value > _Axis_X_Max - _CoverDelta) && _Reversecover)
{
Send_VK_KeyDown(_P1_CoverBottom_VK);
_CoverBottomEnabled = true;
Send_VK_KeyDown(_P1_CoverLeft_VK);
_CoverLeftEnabled = true;
}

//If the player is aiming on the right side of the screen before pressing the button
//=> Cover Right
else if (_P1_X_Value > _Axis_X_Max - _CoverDelta)
else if ((_P1_X_Value > _Axis_X_Max - _CoverDelta) && !_Reversecover)
{
Send_VK_KeyDown(_P1_CoverRight_VK);
_CoverRightEnabled = true;
}
//If the player is aiming on the left side of the screen before pressing the button
//=> Cover Right
else if ((_P1_X_Value < _Axis_X_Min + _CoverDelta) && _Reversecover)
{
Send_VK_KeyDown(_P1_CoverRight_VK);
_CoverRightEnabled = true;
}

//If the player is aiming on the bottom side of the screen before pressing the button
//=> Cover Down
else if (_P1_Y_Value > (1.0f - _CoverDelta))
{
Send_VK_KeyDown(_P1_CoverBottom_VK);
_CoverBottomEnabled = true;
}
//If the player is aiming on the top side of the screen before pressing the button
//=> W [QTE]
else if (_P1_Y_Value < (-1.0f + _CoverDelta))
Expand Down Expand Up @@ -530,18 +548,26 @@ public override void SendInput(PlayerSettings PlayerData)

if ((PlayerData.RIController.Computed_Buttons & RawInputcontrollerButtonEvent.ActionDown) != 0)
{
if (_P2_X_Value < _Axis_X_Min + _CoverDelta)
if ((_P2_X_Value < _Axis_X_Min + _CoverDelta) && !_Reversecover)
{
SendKeyDown(_P2_CoverLeft_DIK);
}
else if (_P2_Y_Value > (1.0f - _CoverDelta))
else if ((_P2_X_Value > _Axis_X_Max - _CoverDelta) && !_Reversecover)
{
SendKeyDown(_P2_CoverDown_DIK);
SendKeyDown(_P2_CoverLeft_DIK);
}
else if ((_P2_X_Value > _Axis_X_Max - _CoverDelta) && _Reversecover)
{
SendKeyDown(_P2_CoverRight_DIK);
}
else if (_P2_X_Value > _Axis_X_Max - _CoverDelta)
else if ((_P2_X_Value < _Axis_X_Min + _CoverDelta) && _Reversecover)
{
SendKeyDown(_P2_CoverRight_DIK);
}
else if (_P2_Y_Value > (1.0f - _CoverDelta))
{
SendKeyDown(_P2_CoverDown_DIK);
}
}
if ((PlayerData.RIController.Computed_Buttons & RawInputcontrollerButtonEvent.ActionUp) != 0)
{
Expand Down
2 changes: 1 addition & 1 deletion DemulShooter/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@
// Vous pouvez spécifier toutes les valeurs ou indiquer les numéros de build et de révision par défaut
// en utilisant '*', comme indiqué ci-dessous :
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("10.14.0.0")]
[assembly: AssemblyVersion("10.15.0.0")]
Loading

0 comments on commit 2b80d8a

Please sign in to comment.