Skip to content

Commit

Permalink
code style
Browse files Browse the repository at this point in the history
  • Loading branch information
xanunderscore committed Jul 11, 2024
1 parent 4917a5d commit 9dbf9d2
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,31 +65,27 @@ public override void OnCastFinished(Actor caster, ActorCastInfo spell)

class Resurface(BossModule module) : Components.GenericAOEs(module)
{
private AOEInstance? _inst = null;
private AOEInstance? _aoe;

public override IEnumerable<AOEInstance> ActiveAOEs(int slot, Actor actor)
{
if (_inst != null)
yield return _inst.Value;
}
public override IEnumerable<AOEInstance> ActiveAOEs(int slot, Actor actor) => Utils.ZeroOrOne(_aoe);

public override void OnCastStarted(Actor caster, ActorCastInfo spell)
{
if (spell.Action.ID == (uint)AID.Resurface)
_inst = new AOEInstance(new AOEShapeCone(100, 32.Degrees()), caster.Position, spell.Rotation, spell.NPCFinishAt);
_aoe = new AOEInstance(new AOEShapeCone(100, 32.Degrees()), caster.Position, spell.Rotation, spell.NPCFinishAt);
}

public override void OnCastFinished(Actor caster, ActorCastInfo spell)
{
if (spell.Action.ID == (uint)AID.Resurface2)
_inst = null;
_aoe = null;
}
}

class Decay(BossModule module) : Components.SelfTargetedAOEs(module, ActionID.MakeSpell(AID.Decay), new AOEShapeDonut(5, 40))
{
public override void DrawArenaForeground(int pcSlot, Actor pc)
=> Arena.Actors(module.Enemies(OID.IhuykatumuFlytrap).Where(x => !x.IsDead), ArenaColor.Object, allowDeadAndUntargetable: true);
=> Arena.Actors(Module.Enemies(OID.IhuykatumuFlytrap).Where(x => !x.IsDead), ArenaColor.Object, allowDeadAndUntargetable: true);
}

abstract class TetherBait(BossModule module, bool centerAtTarget = false) : Components.GenericBaitAway(module, default, true, centerAtTarget)
Expand Down
10 changes: 5 additions & 5 deletions BossMod/Modules/Dawntrail/Dungeon/D01Ihuykatumu/D013Apollyon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ class LevinsickleSpark(BossModule module) : Components.LocationTargetedAOEs(modu
// rest are 8 seconds after previous
class Whirlwind(BossModule module) : Components.GenericAOEs(module)
{
private int _activations = 0;
private DateTime _nextActivation = default;
private int _activations;
private DateTime _nextActivation;

private static readonly List<Angle> Rotations = [0.Degrees(), 45.Degrees(), 90.Degrees(), 135.Degrees()];

Expand Down Expand Up @@ -82,11 +82,11 @@ public override IEnumerable<AOEInstance> ActiveAOEs(int slot, Actor actor)
if (_activations >= 12)
yield break;

var whirlwind = module.Enemies(OID.Whirlwind).FirstOrDefault();
var whirlwind = Module.Enemies(OID.Whirlwind).FirstOrDefault();
if (whirlwind == null)
yield break;

var whirlyHelper = module.Enemies(OID.Helper).FirstOrDefault(x => x.NameID == 12715);
var whirlyHelper = Module.Enemies(OID.Helper).FirstOrDefault(x => x.NameID == 12715);
if (whirlyHelper == null)
yield break;

Expand All @@ -99,7 +99,7 @@ public override IEnumerable<AOEInstance> ActiveAOEs(int slot, Actor actor)
private uint Shade(DateTime activation)
{
var clampedETA = Math.Clamp((activation - WorldState.CurrentTime).TotalSeconds, 0, 4);
var opacity = 1 - (clampedETA / 4);
var opacity = 1 - clampedETA / 4;
var alpha = (uint)(opacity * 96) + 32;
return 0x008080 + alpha * 0x1000000;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ class FrostingFracas(BossModule module) : Components.RaidwideCast(module, Action
abstract class FreezableAOEs(BossModule module, ActionID action, AOEShape shape) : Components.GenericAOEs(module)
{
protected Dictionary<Actor, bool> _casters = [];
protected byte _numFrozen = 0;
protected bool _anyCastFinished = false;
protected byte _numFrozen;
protected bool _anyCastFinished;

public override IEnumerable<AOEInstance> ActiveAOEs(int slot, Actor actor)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ private enum Active

private record struct Inout(AOEShape InShape, AOEShape OutShape, WPos Center, Angle Rotation);

private DateTime _finishAt = default;
private DateTime _finishAt;
private readonly List<Inout> _aoes = [];
private Active _active = Active.None;
private byte _castsWhileActive = 0;
private byte _castsWhileActive;

private void Reset()
{
Expand Down

0 comments on commit 9dbf9d2

Please sign in to comment.