Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ bin/
obj/
/packages/
riderModule.iml
/_ReSharper.Caches/
/_ReSharper.Caches/
/resources/
1 change: 1 addition & 0 deletions TarnishedTool/Enums/HotkeyActions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ public enum HotkeyActions
RestOnRevive,
DrawNavigationRoute,
RykardNoMega,
MaleniaNoHpRecovery,
LionMainLightning,
LionMainFrost,
LionMainWind,
Expand Down
46 changes: 46 additions & 0 deletions TarnishedTool/ViewModels/EnemyViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,24 @@ public class EnemyViewModel : BaseViewModel
private const float LionTripleTransitionDuration = 15f;
private const int ChangeHpRateOffset = 0x9c;

private static readonly (uint RowId, float ChangeHpRate)[] MaleniaHpRecoveryRows =
{
(18400, -1.5f),
(18401, -5f),
(18402, -10f),
(18403, -18f),
(18405, -0.5f),
(18410, -0.4f),
(18411, -0.8f),
(18412, -1.6f),
(18413, -3.2f),
(18414, -4.8f),
(18415, -6.4f),
(18416, -8.2f),
(18417, -10.6f),
(18418, -12.8f),
(18419, -16.4f),
};

private static readonly uint[] MainBossPhaseSpEffectRowIds =
{
Expand Down Expand Up @@ -351,6 +369,18 @@ public bool IsRykardNoMegaEnabled
}
}

private bool _isMaleniaNoHpRecoveryEnabled;

public bool IsMaleniaNoHpRecoveryEnabled
{
get => _isMaleniaNoHpRecoveryEnabled;
set
{
if (!SetProperty(ref _isMaleniaNoHpRecoveryEnabled, value)) return;
SetMaleniaNoHpRecovery(_isMaleniaNoHpRecoveryEnabled);
}
}

private void SetLionPhaseSpEffectsLockState(uint entityId, bool locked, uint[] spEffectRowIds)
{
var chrIns = _chrInsService.ChrInsByEntityId(entityId);
Expand Down Expand Up @@ -502,6 +532,7 @@ private void OnGameFirstLoaded()
if (IsNoMoveEnabled) _enemyService.ToggleNoMove(true);
if (IsDisableAiEnabled) _enemyService.ToggleDisableAi(true);
if (IsRykardNoMegaEnabled) _enemyService.ToggleRykardMega(true);
if (IsMaleniaNoHpRecoveryEnabled) SetMaleniaNoHpRecovery(true);
if (IsTargetingViewEnabled) _enemyService.ToggleTargetingView(true);
if (IsDrawReducedTargetViewEnabled && IsTargetingViewEnabled)
_enemyService.ToggleReducedTargetingView(true);
Expand Down Expand Up @@ -532,6 +563,8 @@ private void RegisterHotkeys()
() => { IsDrawNavigationRouteEnabled = !IsDrawNavigationRouteEnabled; });
_hotkeyManager.RegisterAction(HotkeyActions.RykardNoMega,
() => { IsRykardNoMegaEnabled = !IsRykardNoMegaEnabled; });
_hotkeyManager.RegisterAction(HotkeyActions.MaleniaNoHpRecovery,
() => { IsMaleniaNoHpRecoveryEnabled = !IsMaleniaNoHpRecoveryEnabled; });
_hotkeyManager.RegisterAction(HotkeyActions.LionMainLightning,
() => SafeExecute(ForceLionMainBossLightningPhase));
_hotkeyManager.RegisterAction(HotkeyActions.LionMainFrost, () => SafeExecute(ForceLionMainBossFrostPhase));
Expand Down Expand Up @@ -577,6 +610,19 @@ private void RemoveSerpentHunterPercentageDamage(bool enabled)
}
}

private void SetMaleniaNoHpRecovery(bool enabled)
{
var (tableIndex, slotIndex) = ParamIndices.All["SpEffectParam"];

foreach (var (rowId, vanillaChangeHpRate) in MaleniaHpRecoveryRows)
{
nint row = _paramService.GetParamRow(tableIndex, slotIndex, rowId);
if (row == 0) continue;

_paramService.Write(row, ChangeHpRateOffset, enabled ? 0f : vanillaChangeHpRate);
}
}

private void ApplyLionSpEffects(uint entityId)
{
var chrIns = _chrInsService.ChrInsByEntityId(entityId);
Expand Down
1 change: 1 addition & 0 deletions TarnishedTool/ViewModels/SettingsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ public SettingsViewModel(ISettingsService settingsService, HotkeyManager hotkeyM
new("Rest On Revive", HotkeyActions.RestOnRevive),
new("Draw Enemy Nav Route", HotkeyActions.DrawNavigationRoute),
new("Rykard No Mega", HotkeyActions.RykardNoMega),
new("Malenia No HP Recovery", HotkeyActions.MaleniaNoHpRecovery),
new("Lion Main Lightning Phase", HotkeyActions.LionMainLightning),
new("Lion Main Frost Phase", HotkeyActions.LionMainFrost),
new("Lion Main Wind Phase", HotkeyActions.LionMainWind),
Expand Down
35 changes: 34 additions & 1 deletion TarnishedTool/Views/Tabs/EnemyTab.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>

<Border Grid.Row="0"
Expand Down Expand Up @@ -214,6 +215,38 @@
BorderThickness="1"
BorderBrush="#333"
CornerRadius="3">
<StackPanel Margin="10">
<TextBlock Text="Malenia"
Margin="0,0,0,10" />
<StackPanel Orientation="Horizontal">
<CheckBox Content="No HP recovery on hit"
IsChecked="{Binding IsMaleniaNoHpRecoveryEnabled}"
Margin="0,2" />

<Border
Background="#3498db"
CornerRadius="10"
Width="12"
Height="12"
Margin="10,0,0,0"
VerticalAlignment="Center"
ToolTip="Prevents Malenia from getting HP back from hits"
ToolTipService.InitialShowDelay='100'>
<TextBlock Text="i"
Foreground="White"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontWeight="Bold"
FontSize="10" />
</Border>
</StackPanel>
</StackPanel>
</Border>

<Border Grid.Row="4"
BorderThickness="1"
BorderBrush="#333"
CornerRadius="3">
<StackPanel Margin="10">
<TextBlock Text="Lion Main Boss"
Margin="0,0,0,10" />
Expand Down Expand Up @@ -268,7 +301,7 @@
</StackPanel>
</Border>

<Border Grid.Row="4"
<Border Grid.Row="5"
BorderThickness="1"
BorderBrush="#333"
CornerRadius="3">
Expand Down