Skip to content

Commit

Permalink
v1.0.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
paissaheavyindustries committed May 8, 2024
1 parent 122c213 commit d3ff8a6
Show file tree
Hide file tree
Showing 18 changed files with 927 additions and 62 deletions.
48 changes: 34 additions & 14 deletions Lemegeton/Content/EwCritAloalo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using Dalamud.Interface.Animation;
using static Lemegeton.Content.EwCritAloalo;
using System.Drawing;
using static Lemegeton.Core.State;

namespace Lemegeton.Content
{
Expand Down Expand Up @@ -63,6 +64,7 @@ internal class EwCritAloalo : Core.Content
private const int AbilityPinwheelingDartboard2 = 36031;

private bool ZoneOk = false;
private bool _subbed = false;

private SpringCrystal _springCrystal;
private LalaRotation _lalaRotation;
Expand Down Expand Up @@ -1230,13 +1232,22 @@ protected override bool ExecutionImplementation()

private void SubscribeToEvents()
{
_state.OnHeadMarker += _state_OnHeadMarker;
_state.OnStatusChange += _state_OnStatusChange;
_state.OnCastBegin += _state_OnCastBegin;
_state.OnCombatantAdded += _state_OnCombatantAdded;
_state.OnCombatantRemoved += _state_OnCombatantRemoved;
_state.OnAction += _state_OnAction;
_state.OnTether += _state_OnTether;
lock (this)
{
if (_subbed == true)
{
return;
}
_subbed = true;
Log(LogLevelEnum.Debug, null, "Subscribing to events");
_state.OnHeadMarker += _state_OnHeadMarker;
_state.OnStatusChange += _state_OnStatusChange;
_state.OnCastBegin += _state_OnCastBegin;
_state.OnCombatantAdded += _state_OnCombatantAdded;
_state.OnCombatantRemoved += _state_OnCombatantRemoved;
_state.OnAction += _state_OnAction;
_state.OnTether += _state_OnTether;
}
}

private void _state_OnAction(uint src, uint dest, ushort actionId)
Expand Down Expand Up @@ -1396,13 +1407,22 @@ private void _state_OnTether(uint src, uint dest, uint tetherId)

private void UnsubscribeFromEvents()
{
_state.OnHeadMarker -= _state_OnHeadMarker;
_state.OnStatusChange -= _state_OnStatusChange;
_state.OnCastBegin -= _state_OnCastBegin;
_state.OnCombatantAdded -= _state_OnCombatantAdded;
_state.OnCombatantRemoved -= _state_OnCombatantRemoved;
_state.OnAction -= _state_OnAction;
_state.OnTether -= _state_OnTether;
lock (this)
{
if (_subbed == false)
{
return;
}
Log(LogLevelEnum.Debug, null, "Unsubscribing from events");
_state.OnHeadMarker -= _state_OnHeadMarker;
_state.OnStatusChange -= _state_OnStatusChange;
_state.OnCastBegin -= _state_OnCastBegin;
_state.OnCombatantAdded -= _state_OnCombatantAdded;
_state.OnCombatantRemoved -= _state_OnCombatantRemoved;
_state.OnAction -= _state_OnAction;
_state.OnTether -= _state_OnTether;
_subbed = false;
}
}

private void OnCombatChange(bool inCombat)
Expand Down
28 changes: 24 additions & 4 deletions Lemegeton/Content/EwRaidAbyssos.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Data;
using static Lemegeton.Core.State;

namespace Lemegeton.Content
{
Expand All @@ -22,6 +23,7 @@ internal class EwRaidAbyssos : Core.Content
private const int StatusPurgation4 = 0xd44;

private bool ZoneOk = false;
private bool _subbed = false;

private InviolateAM _inviolateAm;

Expand Down Expand Up @@ -228,8 +230,17 @@ protected override bool ExecutionImplementation()

private void SubscribeToEvents()
{
_state.OnCastBegin += _state_OnCastBegin;
_state.OnStatusChange += _state_OnStatusChange;
lock (this)
{
if (_subbed == true)
{
return;
}
_subbed = true;
Log(LogLevelEnum.Debug, null, "Subscribing to events");
_state.OnCastBegin += _state_OnCastBegin;
_state.OnStatusChange += _state_OnStatusChange;
}
}

private void _state_OnStatusChange(uint src, uint dest, uint statusId, bool gained, float duration, int stacks)
Expand All @@ -242,8 +253,17 @@ private void _state_OnStatusChange(uint src, uint dest, uint statusId, bool gain

private void UnsubscribeFromEvents()
{
_state.OnStatusChange -= _state_OnStatusChange;
_state.OnCastBegin -= _state_OnCastBegin;
lock (this)
{
if (_subbed == false)
{
return;
}
Log(LogLevelEnum.Debug, null, "Unsubscribing from events");
_state.OnStatusChange -= _state_OnStatusChange;
_state.OnCastBegin -= _state_OnCastBegin;
_subbed = false;
}
}

private void _state_OnCastBegin(uint src, uint dest, ushort actionId, float castTime, float rotation)
Expand Down
32 changes: 26 additions & 6 deletions Lemegeton/Content/EwRaidAnabaseios.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using Lemegeton.Core;
using static Lemegeton.Core.State;

namespace Lemegeton.Content
{
Expand Down Expand Up @@ -39,6 +40,7 @@ private ZoneEnum CurrentZone

private bool _sawFirstHeadMarker = false;
private uint _firstHeadMarker = 0;
private bool _subbed = false;

private const int AbilityTwoMinds1 = 33156;
private const int AbilityTwoMinds2 = 33157;
Expand Down Expand Up @@ -529,9 +531,18 @@ protected override bool ExecutionImplementation()

private void SubscribeToEvents()
{
_state.OnHeadMarker += _state_OnHeadMarker;
_state.OnCastBegin += _state_OnCastBegin;
_state.OnStatusChange += _state_OnStatusChange;
lock (this)
{
if (_subbed == true)
{
return;
}
_subbed = true;
Log(LogLevelEnum.Debug, null, "Subscribing to events");
_state.OnHeadMarker += _state_OnHeadMarker;
_state.OnCastBegin += _state_OnCastBegin;
_state.OnStatusChange += _state_OnStatusChange;
}
}

private void _state_OnStatusChange(uint src, uint dest, uint statusId, bool gained, float duration, int stacks)
Expand Down Expand Up @@ -617,9 +628,18 @@ private void _state_OnHeadMarker(uint dest, uint markerId)

private void UnsubscribeFromEvents()
{
_state.OnStatusChange -= _state_OnStatusChange;
_state.OnCastBegin -= _state_OnCastBegin;
_state.OnHeadMarker -= _state_OnHeadMarker;
lock (this)
{
if (_subbed == false)
{
return;
}
Log(LogLevelEnum.Debug, null, "Unsubscribing from events");
_state.OnStatusChange -= _state_OnStatusChange;
_state.OnCastBegin -= _state_OnCastBegin;
_state.OnHeadMarker -= _state_OnHeadMarker;
_subbed = false;
}
}

private void OnCombatChange(bool inCombat)
Expand Down
40 changes: 30 additions & 10 deletions Lemegeton/Content/UltAlexander.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
using System.Diagnostics;
using System.Threading;
using static Lemegeton.Content.UltAlexander;
using static Lemegeton.Core.State;

namespace Lemegeton.Content
{
Expand Down Expand Up @@ -59,6 +60,7 @@ internal class UltAlexander : Core.Content
private const int Headmarker8 = 86;

private bool ZoneOk = false;
private bool _subbed = false;
private bool _sawFirstHeadMarker = false;
private uint _firstHeadMarker = 0;

Expand Down Expand Up @@ -962,11 +964,20 @@ protected override bool ExecutionImplementation()

private void SubscribeToEvents()
{
_state.OnCastBegin += OnCastBegin;
_state.OnAction += OnAction;
_state.OnStatusChange += OnStatusChange;
_state.OnTether += OnTether;
_state.OnHeadMarker += OnHeadMarker;
lock (this)
{
if (_subbed == true)
{
return;
}
_subbed = true;
Log(LogLevelEnum.Debug, null, "Subscribing to events");
_state.OnCastBegin += OnCastBegin;
_state.OnAction += OnAction;
_state.OnStatusChange += OnStatusChange;
_state.OnTether += OnTether;
_state.OnHeadMarker += OnHeadMarker;
}
}

private void OnHeadMarker(uint dest, uint markerId)
Expand Down Expand Up @@ -1104,11 +1115,20 @@ private void OnTether(uint src, uint dest, uint tetherId)

private void UnsubscribeFromEvents()
{
_state.OnHeadMarker -= OnHeadMarker;
_state.OnTether -= OnTether;
_state.OnStatusChange -= OnStatusChange;
_state.OnAction -= OnAction;
_state.OnCastBegin -= OnCastBegin;
lock (this)
{
if (_subbed == false)
{
return;
}
Log(LogLevelEnum.Debug, null, "Unsubscribing from events");
_state.OnHeadMarker -= OnHeadMarker;
_state.OnTether -= OnTether;
_state.OnStatusChange -= OnStatusChange;
_state.OnAction -= OnAction;
_state.OnCastBegin -= OnCastBegin;
_subbed = false;
}
}

private void OnCombatChange(bool inCombat)
Expand Down
Loading

0 comments on commit d3ff8a6

Please sign in to comment.