Skip to content

Commit

Permalink
Disable drawing if player has AoE to bait and dont need to form any t…
Browse files Browse the repository at this point in the history
…hing (#254)

* Disable drawing if player has AoE

If the player has an aoe to bait the script dont show any information. player must know his spot

* enable log again
  • Loading branch information
Lusaca87 authored Feb 17, 2025
1 parent dd8d53a commit 6c3f31a
Showing 1 changed file with 16 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
using Splatoon;
using Splatoon.SplatoonScripting;
using Splatoon.SplatoonScripting.Priority;
using ECommons.DalamudServices;

namespace SplatoonScriptsOfficial.Duties.Dawntrail.The_Futures_Rewritten;

Expand All @@ -39,10 +40,11 @@ public enum State
}

private readonly HashSet<string> _aoeTargets = new();

private bool _PlayerHasAoE;

private State _state = State.None;
public override HashSet<uint>? ValidTerritories => [1238];
public override Metadata? Metadata => new(2, "Garume");
public override Metadata? Metadata => new(3, "Garume, Lusaca");

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

Expand All @@ -59,13 +61,21 @@ public override void OnReset()
{
_state = State.None;
_aoeTargets.Clear();
_PlayerHasAoE = false;
}

public override void OnVFXSpawn(uint target, string vfxPath)
{
if (_state is (State.Start or State.Split) && vfxPath == "vfx/lockon/eff/target_ae_s7k1.avfx")
{
if (target.GetObject() is IPlayerCharacter player) _aoeTargets.Add(player.Name.ToString());
if (target.GetObject() is IPlayerCharacter player)
{
_aoeTargets.Add(player.Name.ToString());

if (player.Name.ToString().Equals(Svc.ClientState.LocalPlayer.Name.ToString()))
_PlayerHasAoE = true;

}

var count = 0;
foreach (var aoeTarget in _aoeTargets)
Expand Down Expand Up @@ -119,7 +129,8 @@ public override void OnStartingCast(uint source, uint castId)

public override void OnUpdate()
{
if (_state == State.Split)

if (_state == State.Split && !_PlayerHasAoE)
Controller.GetRegisteredElements()
.Each(x => x.Value.color = GradientColor.Get(C.BaitColor1, C.BaitColor2).ToUint());
else
Expand Down Expand Up @@ -204,4 +215,4 @@ public class Config : IEzConfig

public int PlayersCount = 2;
}
}
}

0 comments on commit 6c3f31a

Please sign in to comment.