Skip to content

Commit

Permalink
[add] timing mode (#235)
Browse files Browse the repository at this point in the history
  • Loading branch information
Garume authored Dec 14, 2024
1 parent a17bf2f commit c3d4a7a
Showing 1 changed file with 30 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class P4_AutoTargetSwitcher : SplatoonScript
private Timings _currentTiming = Timings.Start;
private float _lastMinPercentage;
public override HashSet<uint>? ValidTerritories => [1238];
public override Metadata? Metadata => new(2, "Garume");
public override Metadata? Metadata => new(3, "Garume");

private Config C => Controller.GetConfig<Config>();

Expand Down Expand Up @@ -98,6 +98,7 @@ public override void OnSettingsDraw()
ImGui.Checkbox("DebugMode", ref C.DebugMode);
ImGui.Text($"Timings: {C.TimingMode}");
ImGui.Text($"IsActive: {IsActive}");
ImGui.Text($"Current Timing: {_currentTiming}");
ImGui.Text($"Current Target: {_currentTarget?.Name}");

ImGui.Separator();
Expand Down Expand Up @@ -125,6 +126,26 @@ public override void OnActionEffectEvent(ActionEffectSet set)

switch (set.Action.Value.RowId)
{
case 40285:
_currentTiming = Timings.SomberDanceEnd;
break;
case 40249:
_mornAfahCount++;
_currentTiming = _mornAfahCount == 1 ? Timings.FirstMornAfahEnd : Timings.SecondMornAfahEnd;
break;

}
}

private int _akhMornCount = 0;
private int _mornAfahCount = 0;

public override void OnStartingCast(uint source, uint castId)
{
if (castId == 40247)
{
_akhMornCount++;
_currentTiming = _akhMornCount == 1 ? Timings.FirstAkhMorn : Timings.SecondAkhMorn;
}
}

Expand Down Expand Up @@ -201,13 +222,20 @@ public override void OnReset()
_currentTarget = null;
_currentTiming = Timings.Start;
_lastMinPercentage = 0f;
_akhMornCount = 0;
_mornAfahCount = 0;
_targets.Clear();
_percentages.Clear();
}

private enum Timings
{
Start
Start,
SomberDanceEnd,
FirstAkhMorn,
FirstMornAfahEnd,
SecondAkhMorn,
SecondMornAfahEnd
}

private class Config : IEzConfig
Expand Down

0 comments on commit c3d4a7a

Please sign in to comment.