Skip to content

Commit

Permalink
Merge pull request #55 from CarnifexOptimus/slave_lotsofchanges
Browse files Browse the repository at this point in the history
masked carnivale stage 30
  • Loading branch information
CarnifexOptimus authored Apr 23, 2024
2 parents ef83f64 + 2cc4fbe commit f20622d
Show file tree
Hide file tree
Showing 51 changed files with 542 additions and 149 deletions.
2 changes: 1 addition & 1 deletion BossMod/Components/Knockback.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public static void DrawKnockback(WPos from, WPos to, Angle rot, MiniArena arena)
public abstract IEnumerable<Source> Sources(int slot, Actor actor);

// called to determine whether we need to show hint
public virtual bool DestinationUnsafe(int slot, Actor actor, WPos pos) => StopAtWall ? false : !Module.Bounds.Contains(pos);
public virtual bool DestinationUnsafe(int slot, Actor actor, WPos pos) => !StopAtWall && !Module.Bounds.Contains(pos);

public override void AddHints(int slot, Actor actor, TextHints hints)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@ public override void OnCastFinished(Actor caster, ActorCastInfo spell)
}
}

public override bool DestinationUnsafe(int slot, Actor actor, WPos pos) => Module.FindComponent<SerpentsTide>()?.ActiveAOEs(slot, actor).Any(z => z.Shape.Check(pos, z.Origin, z.Rotation)) ?? false || !Module.Bounds.Contains(pos);
public override bool DestinationUnsafe(int slot, Actor actor, WPos pos) => (Module.FindComponent<SerpentsTide>()?.ActiveAOEs(slot, actor).Any(z => z.Shape.Check(pos, z.Origin, z.Rotation)) ?? false) || !Module.Bounds.Contains(pos);
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ public override void OnCastFinished(Actor caster, ActorCastInfo spell)
_knockback = null;
}

public override bool DestinationUnsafe(int slot, Actor actor, WPos pos) => Module.FindComponent<DownhillP1>()?.ActiveAOEs(slot, actor).Any(z => z.Shape.Check(pos, z.Origin, z.Rotation)) ?? false || !Module.Bounds.Contains(pos);
public override bool DestinationUnsafe(int slot, Actor actor, WPos pos) => (Module.FindComponent<DownhillP1>()?.ActiveAOEs(slot, actor).Any(z => z.Shape.Check(pos, z.Origin, z.Rotation)) ?? false) || !Module.Bounds.Contains(pos);
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public override void OnCastFinished(Actor caster, ActorCastInfo spell)
}
}

public override bool DestinationUnsafe(int slot, Actor actor, WPos pos) => Module.FindComponent<DownhillBig>()?.ActiveAOEs(slot, actor).Any(z => z.Shape.Check(pos, z.Origin, z.Rotation)) ?? false || !Module.Bounds.Contains(pos);
public override bool DestinationUnsafe(int slot, Actor actor, WPos pos) => (Module.FindComponent<DownhillBig>()?.ActiveAOEs(slot, actor).Any(z => z.Shape.Check(pos, z.Origin, z.Rotation)) ?? false) || !Module.Bounds.Contains(pos);
}

class WanderingVolleyAOE(BossModule module) : Components.GenericAOEs(module)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ public override void OnEventCast(Actor caster, ActorCastEvent spell)
_knockback = null;
}

public override bool DestinationUnsafe(int slot, Actor actor, WPos pos) => Module.FindComponent<EverFireOnceBurned>()?.ActiveAOEs(slot, actor).Any(z => z.Shape.Check(pos, z.Origin, z.Rotation)) ?? false || !Module.Bounds.Contains(pos);
public override bool DestinationUnsafe(int slot, Actor actor, WPos pos) => (Module.FindComponent<EverFireOnceBurned>()?.ActiveAOEs(slot, actor).Any(z => z.Shape.Check(pos, z.Origin, z.Rotation)) ?? false) || !Module.Bounds.Contains(pos);
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,7 @@ public override void OnCastFinished(Actor caster, ActorCastInfo spell)
_casters.Remove(caster);
}

public override bool DestinationUnsafe(int slot, Actor actor, WPos pos)
{
if (Module.FindComponent<Towerfall>() is var towerfall && towerfall != null && towerfall.ActiveAOEs(slot, actor).Any(z => z.Shape.Check(pos, z.Origin, z.Rotation)))
return true;
if (!Module.Bounds.Contains(pos))
return true;
else
return false;
}
public override bool DestinationUnsafe(int slot, Actor actor, WPos pos) => (Module.FindComponent<Towerfall>()?.ActiveAOEs(slot, actor).Any(z => z.Shape.Check(pos, z.Origin, z.Rotation)) ?? false) || !Module.Bounds.Contains(pos);
}

class EarthenGeyser(BossModule module) : Components.StackWithCastTargets(module, ActionID.MakeSpell(AID.EarthenGeyser2), 10);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class Stage01 : BossModule
ActivateComponent<Hints>();
}

protected override bool CheckPull() { return PrimaryActor.IsTargetable && PrimaryActor.InCombat || Enemies(OID.Slime).Any(e => e.InCombat); }
protected override bool CheckPull() => PrimaryActor.IsTargetable && PrimaryActor.InCombat || Enemies(OID.Slime).Any(e => e.InCombat);

protected override void DrawEnemies(int pcSlot, Actor pc)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public enum AID : uint
GoldenTongue = 14265, // 25C0/25C2/25C4->self, 5,0s cast, single-target
}

class GoldenTongue(BossModule module) : Components.CastHint(module, ActionID.MakeSpell(AID.GoldenTongue), "Can be interrupted, increase its magic damage");
class GoldenTongue(BossModule module) : Components.CastInterruptHint(module, ActionID.MakeSpell(AID.GoldenTongue));

class Hints(BossModule module) : BossComponent(module)
{
Expand Down Expand Up @@ -53,7 +53,7 @@ public class Stage02Act1 : BossModule
ActivateComponent<Hints>();
}

protected override bool CheckPull() { return PrimaryActor.IsTargetable && PrimaryActor.InCombat || Enemies(OID.Marshmallow).Any(e => e.InCombat) || Enemies(OID.Bavarois).Any(e => e.InCombat); }
protected override bool CheckPull() => PrimaryActor.IsTargetable && PrimaryActor.InCombat || Enemies(OID.Marshmallow).Any(e => e.InCombat) || Enemies(OID.Bavarois).Any(e => e.InCombat);

protected override void DrawEnemies(int pcSlot, Actor pc)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ public enum OID : uint
Boss = 0x25C1, //R1.8
Flan = 0x25C5, //R1.8
Licorice = 0x25C3, //R=1.8

}

public enum AID : uint
Expand All @@ -16,7 +15,7 @@ public enum AID : uint
GoldenTongue = 14265, // 25C5/25C3/25C1->self, 5,0s cast, single-target
}

class GoldenTongue(BossModule module) : Components.CastHint(module, ActionID.MakeSpell(AID.GoldenTongue), "Can be interrupted, increases its magic damage.");
class GoldenTongue(BossModule module) : Components.CastInterruptHint(module, ActionID.MakeSpell(AID.GoldenTongue));

class Hints(BossModule module) : BossComponent(module)
{
Expand All @@ -40,7 +39,7 @@ public Stage02Act2States(BossModule module) : base(module)
[ModuleInfo(BossModuleInfo.Maturity.Contributed, Contributors = "Malediktus", GroupType = BossModuleInfo.GroupType.MaskedCarnivale, GroupID = 612, NameID = 8079, SortOrder = 2)]
public class Stage02Act2(WorldState ws, Actor primary) : BossModule(ws, primary, new ArenaBoundsCircle(new(100, 100), 25))
{
protected override bool CheckPull() { return PrimaryActor.IsTargetable && PrimaryActor.InCombat || Enemies(OID.Flan).Any(e => e.InCombat) || Enemies(OID.Licorice).Any(e => e.InCombat); }
protected override bool CheckPull() => PrimaryActor.IsTargetable && PrimaryActor.InCombat || Enemies(OID.Flan).Any(e => e.InCombat) || Enemies(OID.Licorice).Any(e => e.InCombat);

protected override void DrawEnemies(int pcSlot, Actor pc)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,22 @@ public enum AID : uint
}

class BoulderClap(BossModule module) : Components.SelfTargetedAOEs(module, ActionID.MakeSpell(AID.BoulderClap), new AOEShapeCone(14, 60.Degrees()));

class Dreadstorm(BossModule module) : Components.PersistentVoidzoneAtCastTarget(module, 6, ActionID.MakeSpell(AID.EarthenHeart), m => m.Enemies(OID.voidzone), 0);

class Obliterate(BossModule module) : Components.RaidwideCast(module, ActionID.MakeSpell(AID.Obliterate), "Interruptible raidwide");
class EarthenHeart(BossModule module) : Components.PersistentVoidzoneAtCastTarget(module, 6, ActionID.MakeSpell(AID.EarthenHeart), m => m.Enemies(OID.voidzone).Where(e => e.EventState != 7), 1.2f);
class Obliterate(BossModule module) : Components.CastInterruptHint(module, ActionID.MakeSpell(AID.Obliterate));

class Hints(BossModule module) : BossComponent(module)
{
public override void AddGlobalHints(GlobalHints hints)
{
hints.Add("Zipacna is weak against water based spells.\nFlying Sardine is recommended to interrupt raidwide.");
hints.Add($"{Module.PrimaryActor.Name} is weak against water based spells.\nFlying Sardine is recommended to interrupt raidwide.");
}
}

class Hints2(BossModule module) : BossComponent(module)
{
public override void AddGlobalHints(GlobalHints hints)
{
hints.Add("Zipacna is weak against water based spells.\nEarth based spells are useless against Zipacna.");
hints.Add($"{Module.PrimaryActor.Name} is weak against water based spells.\nEarth based spells are useless against {Module.PrimaryActor.Name}.");
}
}

Expand All @@ -42,7 +40,7 @@ public Stage03States(BossModule module) : base(module)
{
TrivialPhase()
.ActivateOnEnter<BoulderClap>()
.ActivateOnEnter<Dreadstorm>()
.ActivateOnEnter<EarthenHeart>()
.ActivateOnEnter<Obliterate>()
.ActivateOnEnter<Hints2>()
.DeactivateOnEnter<Hints>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public class Stage04Act1 : BossModule
ActivateComponent<Hints>();
}

protected override bool CheckPull() { return PrimaryActor.IsTargetable && PrimaryActor.InCombat || Enemies(OID.Bat).Any(e => e.InCombat); }
protected override bool CheckPull() => PrimaryActor.IsTargetable && PrimaryActor.InCombat || Enemies(OID.Bat).Any(e => e.InCombat);

protected override void DrawEnemies(int pcSlot, Actor pc)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,21 @@ public enum AID : uint

class MagitekRay(BossModule module) : Components.LocationTargetedAOEs(module, ActionID.MakeSpell(AID.MagitekRay), 6);

class MagitekField(BossModule module) : Components.CastHint(module, ActionID.MakeSpell(AID.MagitekField), "Interruptible, increases its defenses");
class MagitekField(BossModule module) : Components.CastInterruptHint(module, ActionID.MakeSpell(AID.MagitekField));

class Hints(BossModule module) : BossComponent(module)
{
public override void AddGlobalHints(GlobalHints hints)
{
hints.Add("Kreios is weak to lightning spells.\nDuring the fight he will spawn 6 beetles.\nIf available use the Ram's Voice + Ultravibration combo for the instant kill.");
hints.Add($"{Module.PrimaryActor.Name} is weak to lightning spells.\nDuring the fight he will spawn 6 beetles.\nIf available use the Ram's Voice + Ultravibration combo for the instant kill.");
}
}

class Hints2(BossModule module) : BossComponent(module)
{
public override void AddGlobalHints(GlobalHints hints)
{
hints.Add("Kreios is weak against lightning spells and can be frozen.");
hints.Add($"{Module.PrimaryActor.Name} is weak against lightning spells and can be frozen.");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public enum SID : uint

class DemonEye(BossModule module) : Components.CastGaze(module, ActionID.MakeSpell(AID.DemonEye))
{
private BitMask _blinded;
private readonly BitMask _blinded;

public override void OnStatusGain(Actor actor, ActorStatus status)
{
Expand All @@ -37,13 +37,13 @@ public override void OnStatusLose(Actor actor, ActorStatus status)

public override IEnumerable<Eye> ActiveEyes(int slot, Actor actor)
{
return _blinded[slot] ? Enumerable.Empty<Eye>() : base.ActiveEyes(slot, actor);
return _blinded[slot] ? [] : base.ActiveEyes(slot, actor);
}
}

class ColdStare(BossModule module) : Components.SelfTargetedAOEs(module, ActionID.MakeSpell(AID.ColdStare), new AOEShapeCone(42.53f, 45.Degrees())) //TODO: cone based gaze
{
private BitMask _blinded;
private readonly BitMask _blinded;

public override void OnStatusGain(Actor actor, ActorStatus status)
{
Expand All @@ -59,13 +59,13 @@ public override void OnStatusLose(Actor actor, ActorStatus status)

public override IEnumerable<AOEInstance> ActiveAOEs(int slot, Actor actor)
{
return _blinded[slot] ? Enumerable.Empty<AOEInstance>() : base.ActiveAOEs(slot, actor);
return _blinded[slot] ? [] : base.ActiveAOEs(slot, actor);
}
}

class TearyTwirl(BossModule module) : Components.StackWithCastTargets(module, ActionID.MakeSpell(AID.TearyTwirl), 6.3f)
{
private BitMask _blinded;
private readonly BitMask _blinded;

public override void OnStatusGain(Actor actor, ActorStatus status)
{
Expand Down Expand Up @@ -118,7 +118,7 @@ public class Stage06Act1 : BossModule
ActivateComponent<DemonEye>();
}

protected override bool CheckPull() { return PrimaryActor.IsTargetable && PrimaryActor.InCombat || Enemies(OID.Mandragora).Any(e => e.InCombat); }
protected override bool CheckPull() => PrimaryActor.IsTargetable && PrimaryActor.InCombat || Enemies(OID.Mandragora).Any(e => e.InCombat);

protected override void DrawEnemies(int pcSlot, Actor pc)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public enum SID : uint

class DemonEye(BossModule module) : Components.CastGaze(module, ActionID.MakeSpell(AID.DemonEye))
{
private BitMask _blinded;
private readonly BitMask _blinded;

public override void OnStatusGain(Actor actor, ActorStatus status)
{
Expand All @@ -40,13 +40,13 @@ public override void OnStatusLose(Actor actor, ActorStatus status)

public override IEnumerable<Eye> ActiveEyes(int slot, Actor actor)
{
return _blinded[slot] ? Enumerable.Empty<Eye>() : base.ActiveEyes(slot, actor);
return _blinded[slot] ? [] : base.ActiveEyes(slot, actor);
}
}

class ColdStare(BossModule module) : Components.SelfTargetedAOEs(module, ActionID.MakeSpell(AID.ColdStare), new AOEShapeCone(42.53f, 45.Degrees())) //TODO: cone based gaze
{
private BitMask _blinded;
private readonly BitMask _blinded;

public override void OnStatusGain(Actor actor, ActorStatus status)
{
Expand All @@ -62,13 +62,13 @@ public override void OnStatusLose(Actor actor, ActorStatus status)

public override IEnumerable<AOEInstance> ActiveAOEs(int slot, Actor actor)
{
return _blinded[slot] ? Enumerable.Empty<AOEInstance>() : base.ActiveAOEs(slot, actor);
return _blinded[slot] ? [] : base.ActiveAOEs(slot, actor);
}
}

class TearyTwirl(BossModule module) : Components.StackWithCastTargets(module, ActionID.MakeSpell(AID.TearyTwirl), 6.3f)
{
private BitMask _blinded;
private readonly BitMask _blinded;

public override void OnStatusGain(Actor actor, ActorStatus status)
{
Expand All @@ -93,7 +93,7 @@ public override void AddHints(int slot, Actor actor, TextHints hints)

class DreadGaze(BossModule module) : Components.SelfTargetedAOEs(module, ActionID.MakeSpell(AID.DreadGaze), new AOEShapeCone(7.35f, 45.Degrees())) //TODO: cone based gaze
{
private BitMask _blinded;
private readonly BitMask _blinded;

public override void OnStatusGain(Actor actor, ActorStatus status)
{
Expand All @@ -109,7 +109,7 @@ public override void OnStatusLose(Actor actor, ActorStatus status)

public override IEnumerable<AOEInstance> ActiveAOEs(int slot, Actor actor)
{
return _blinded[slot] ? Enumerable.Empty<AOEInstance>() : base.ActiveAOEs(slot, actor);
return _blinded[slot] ? [] : base.ActiveAOEs(slot, actor);
}
}

Expand Down Expand Up @@ -142,7 +142,7 @@ public class Stage06Act2 : BossModule
ActivateComponent<Hints>();
}

protected override bool CheckPull() { return PrimaryActor.IsTargetable && PrimaryActor.InCombat || Enemies(OID.Mandragora).Any(e => e.InCombat) || Enemies(OID.Eye).Any(e => e.InCombat); }
protected override bool CheckPull() => PrimaryActor.IsTargetable && PrimaryActor.InCombat || Enemies(OID.Mandragora).Any(e => e.InCombat) || Enemies(OID.Eye).Any(e => e.InCombat);

protected override void DrawEnemies(int pcSlot, Actor pc)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class Hints2(BossModule module) : BossComponent(module)
{
public override void AddGlobalHints(GlobalHints hints)
{
hints.Add("Hit the Lava Slime from a safe distance to win this act.");
hints.Add($"Hit the {Module.PrimaryActor.Name} from a safe distance to win this act.");
}
}

Expand All @@ -67,7 +67,7 @@ public class Stage07Act1 : BossModule
ActivateComponent<SlimeExplosion>();
}

protected override bool CheckPull() { return PrimaryActor.IsTargetable && PrimaryActor.InCombat || Enemies(OID.Sprite).Any(e => e.InCombat); }
protected override bool CheckPull() => PrimaryActor.IsTargetable && PrimaryActor.InCombat || Enemies(OID.Sprite).Any(e => e.InCombat);

protected override void DrawEnemies(int pcSlot, Actor pc)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public class Stage07Act2 : BossModule
ActivateComponent<SlimeExplosion>();
}

protected override bool CheckPull() { return PrimaryActor.IsTargetable && PrimaryActor.InCombat || Enemies(OID.Sprite).Any(e => e.InCombat); }
protected override bool CheckPull() => PrimaryActor.IsTargetable && PrimaryActor.InCombat || Enemies(OID.Sprite).Any(e => e.InCombat);

protected override void DrawEnemies(int pcSlot, Actor pc)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public class Stage07Act3 : BossModule
ActivateComponent<SlimeExplosion>();
}

protected override bool CheckPull() { return PrimaryActor.IsTargetable && PrimaryActor.InCombat || Enemies(OID.Slime).Any(e => e.InCombat); }
protected override bool CheckPull() => PrimaryActor.IsTargetable && PrimaryActor.InCombat || Enemies(OID.Slime).Any(e => e.InCombat);

protected override void DrawEnemies(int pcSlot, Actor pc)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public enum AID : uint

class Selfdetonations(BossModule module) : BossComponent(module)
{
private static readonly string hint = "In bomb explosion radius!";
private const string hint = "In bomb explosion radius!";

public override void DrawArenaForeground(int pcSlot, Actor pc)
{
Expand Down Expand Up @@ -89,7 +89,7 @@ public class Stage08Act1 : BossModule
ActivateComponent<Selfdetonations>();
}

protected override bool CheckPull() { return PrimaryActor.IsTargetable && PrimaryActor.InCombat || Enemies(OID.Bomb).Any(e => e.InCombat) || Enemies(OID.Snoll).Any(e => e.InCombat); }
protected override bool CheckPull() => PrimaryActor.IsTargetable && PrimaryActor.InCombat || Enemies(OID.Bomb).Any(e => e.InCombat) || Enemies(OID.Snoll).Any(e => e.InCombat);

protected override void DrawEnemies(int pcSlot, Actor pc)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ public enum AID : uint
}

class Sap(BossModule module) : Components.LocationTargetedAOEs(module, ActionID.MakeSpell(AID.Sap), 8);
class Burst(BossModule module) : Components.CastHint(module, ActionID.MakeSpell(AID.Burst), "Interrupt or wipe!");
class Burst(BossModule module) : Components.CastInterruptHint(module, ActionID.MakeSpell(AID.Burst));

class Selfdetonations(BossModule module) : BossComponent(module)
{
private static readonly string hint = "In bomb explosion radius!";
private const string hint = "In bomb explosion radius!";

public override void DrawArenaForeground(int pcSlot, Actor pc)
{
Expand Down Expand Up @@ -79,7 +79,7 @@ public class Stage08Act2 : BossModule
ActivateComponent<Selfdetonations>();
}

protected override bool CheckPull() { return PrimaryActor.IsTargetable && PrimaryActor.InCombat || Enemies(OID.Bomb).Any(e => e.InCombat) || Enemies(OID.Snoll).Any(e => e.InCombat); }
protected override bool CheckPull() => PrimaryActor.IsTargetable && PrimaryActor.InCombat || Enemies(OID.Bomb).Any(e => e.InCombat) || Enemies(OID.Snoll).Any(e => e.InCombat);

protected override void DrawEnemies(int pcSlot, Actor pc)
{
Expand Down
Loading

0 comments on commit f20622d

Please sign in to comment.