Skip to content

Commit

Permalink
Merge pull request #440 from FFXIV-CombatReborn/mergeWIP
Browse files Browse the repository at this point in the history
another sphene ex improvement
  • Loading branch information
CarnifexOptimus authored Nov 16, 2024
2 parents 6c5f384 + 53a455d commit 175e6bb
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ public class Ex3QueenEternal(WorldState ws, Actor primary) : BossModule(ws, prim
public static readonly ArenaBoundsSquare NormalBounds = Trial.T03QueenEternal.T03QueenEternal.DefaultBounds;
public static readonly ArenaBoundsComplex WindBounds = Trial.T03QueenEternal.T03QueenEternal.XArena;
public static readonly ArenaBoundsComplex EarthBounds = Trial.T03QueenEternal.T03QueenEternal.SplitArena;
public static readonly Rectangle[] IceRects = [new Rectangle(new(112, 95), 4, 15), new Rectangle(new(88, 95), 4, 15), new Rectangle(ArenaCenter, 2, 10)];
private static readonly Rectangle[] iceBridges = [new Rectangle(new(100, 96), 8, 2), new Rectangle(new(100, 104), 8, 2)];
public static readonly ArenaBoundsComplex IceBounds = new(IceRects, Offset: Trial.T03QueenEternal.T03QueenEternal.OffSet);
public static readonly ArenaBoundsComplex IceBridgeBounds = new([.. IceRects, .. iceBridges], Offset: Trial.T03QueenEternal.T03QueenEternal.OffSet);
private static readonly Rectangle[] iceRects = [new Rectangle(new(112, 95), 4, 15), new Rectangle(new(88, 95), 4, 15), new Rectangle(ArenaCenter, 2, 10)];
public static readonly Rectangle[] IceRectsAll = [.. iceRects, new Rectangle(new(100, 96), 8, 2), new Rectangle(new(100, 104), 8, 2)];
public static readonly ArenaBoundsComplex IceBounds = new(iceRects, Offset: Trial.T03QueenEternal.T03QueenEternal.OffSet);
public static readonly ArenaBoundsComplex IceBridgeBounds = new(IceRectsAll, Offset: Trial.T03QueenEternal.T03QueenEternal.OffSet);

private Actor? _bossP2;
public Actor? BossP1() => PrimaryActor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public enum Rotation { None, Left, Right }
private static readonly Square[] defaultSquare = [new(Ex3QueenEternal.ArenaCenter, 20)];
private static readonly AOEShapeCustom windArena = new(defaultSquare, Trial.T03QueenEternal.T03QueenEternal.XArenaRects);
private static readonly AOEShapeCustom earthArena = new(defaultSquare, Trial.T03QueenEternal.T03QueenEternal.SplitArenaRects);
private static readonly AOEShapeCustom iceArena = new(defaultSquare, Ex3QueenEternal.IceRects);
private static readonly AOEShapeCustom iceArena = new(defaultSquare, Ex3QueenEternal.IceRectsAll);

public override IEnumerable<AOEInstance> ActiveAOEs(int slot, Actor actor) => Utils.ZeroOrOne(_aoe);

Expand All @@ -37,7 +37,7 @@ public override void OnEventEnvControl(byte index, uint state)
{
9 => Ex3QueenEternal.WindBounds,
10 => Ex3QueenEternal.EarthBounds,
11 => Ex3QueenEternal.IceBounds,
11 => Ex3QueenEternal.IceBridgeBounds,
_ => null
};
if (platform != null)
Expand Down Expand Up @@ -78,7 +78,7 @@ private void UpdateAOE(ArenaBoundsCustom? platform)
_aoe = new(windArena, Arena.Center, default, activation);
else if (platform == Ex3QueenEternal.EarthBounds)
_aoe = new(earthArena, Arena.Center, default, activation);
else if (platform == Ex3QueenEternal.IceBounds)
else if (platform == Ex3QueenEternal.IceBridgeBounds)
_aoe = new(iceArena, Arena.Center, default, activation);
}
}
Expand Down
36 changes: 34 additions & 2 deletions BossMod/Replay/ReplayParserLog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,42 @@ public override FourCC NextEntry()
public override bool CanRead() => true;
public override void ReadVoid() { }
public override string ReadString() => _input.ReadString();
public override float ReadFloat() => _input.ReadSingle();
public override float ReadFloat()
{
try
{
return _input.ReadSingle();
}
catch (EndOfStreamException)
{
Service.Log("Reached the end of the file unexpectedly. Returning default value.");
return 0f;
}
catch (Exception ex)
{
Service.Log($"An unexpected error occurred: {ex.Message}");
throw;
}
}
public override double ReadDouble() => _input.ReadDouble();
public override Vector3 ReadVec3() => new(_input.ReadSingle(), _input.ReadSingle(), _input.ReadSingle());
public override Angle ReadAngle() => _input.ReadSingle().Radians();
public override Angle ReadAngle()
{
try
{
return _input.ReadSingle().Radians();
}
catch (EndOfStreamException)
{
Service.Log("Reached the end of the file unexpectedly. Returning default angle.");
return 0f.Radians();
}
catch (Exception ex)
{
Service.Log($"An unexpected error occurred while reading an angle: {ex.Message}");
throw;
}
}
public override bool ReadBool() => _input.ReadBoolean();
public override sbyte ReadSByte() => _input.ReadSByte();
public override short ReadShort() => _input.ReadInt16();
Expand Down

0 comments on commit 175e6bb

Please sign in to comment.