|
| 1 | +using BossMod.QuestBattle; |
| 2 | + |
| 3 | +namespace BossMod.Dawntrail.Quest.TheIcingOnTheCake; |
| 4 | + |
| 5 | +// Valentione's Day 2026 |
| 6 | +public enum OID : uint |
| 7 | +{ |
| 8 | + MammetPtissier = 0x48DF, // R0.150, x? |
| 9 | + KupkaKupp = 0x48E0, // R0.300, x? |
| 10 | + Boss = KupkaKupp, |
| 11 | + |
| 12 | + CakeStand = 0x1EBE61, |
| 13 | + |
| 14 | + WhippedCreamFrosting = 0x1EBE4D, // 0x56 |
| 15 | + ChocolateFrosting = 0x1EBE4E, |
| 16 | + PistachioFrosting = 0x1EBE4F, |
| 17 | + BerryFrosting = 0x1EBE50, |
| 18 | + LemonFrosting = 0x1EBE51, |
| 19 | + |
| 20 | + WhiteRolanberries = 0x1EBE52, |
| 21 | + Almonds = 0x1EBE53, |
| 22 | + Branchberries = 0x1EBE54, |
| 23 | + Rolanberries = 0x1EBE55, |
| 24 | + SunLemons = 0x1EBE56, |
| 25 | + |
| 26 | + SugarPearls = 0x1EBE57, |
| 27 | + ChocolateCubes = 0x1EBE58, |
| 28 | + ChocolateFlowers = 0x1EBE59, |
| 29 | + ChocolateHearts = 0x1EBE5A, |
| 30 | + LemonMacarons = 0x1EBE5B, |
| 31 | + |
| 32 | + MoogleCakeTopper = 0x1EBE5C, |
| 33 | + ChocolateEggCakeTopper = 0x1EBE5D, |
| 34 | + CactuarCakeTopper = 0x1EBE5E, |
| 35 | + HeartCakeTopper = 0x1EBE5F, |
| 36 | + ChocoboCakeTopper = 0x1EBE60, // 0x6A |
| 37 | +} |
| 38 | + |
| 39 | +public enum AID : uint |
| 40 | +{ |
| 41 | + SugarBlizzard = 44036, // 48DF->self, 3.0s cast, range 15 90-degree cone |
| 42 | +} |
| 43 | + |
| 44 | +public enum SID : uint |
| 45 | +{ |
| 46 | + Transporting = 404 // none->player, extra=0x15 |
| 47 | +} |
| 48 | + |
| 49 | +class DecorateCake(BossModule module) : BossComponent(module) |
| 50 | +{ |
| 51 | + private Actor? CakeStand => WorldState.Actors.FirstOrDefault(o => o.OID == (uint)OID.CakeStand && o.IsTargetable); |
| 52 | + private readonly List<Actor> Ingredients = []; |
| 53 | + |
| 54 | + public override void OnMapEffect(byte index, uint state) |
| 55 | + { |
| 56 | + switch (state) |
| 57 | + { |
| 58 | + case 0x00020001: // ingredients deactivated |
| 59 | + if (MapEffectIndexToOID(index) is { } remove) |
| 60 | + Ingredients.RemoveAll(i => i.OID == (uint)remove); |
| 61 | + break; |
| 62 | + case 0x00080004: // ingredients activated |
| 63 | + if (MapEffectIndexToOID(index) is { } add && WorldState.Actors.FirstOrDefault(o => o.OID == (uint)add) is { } actor) |
| 64 | + Ingredients.Add(actor); |
| 65 | + break; |
| 66 | + } |
| 67 | + } |
| 68 | + |
| 69 | + public override void AddAIHints(int slot, Actor actor, PartyRolesConfig.Assignment assignment, AIHints hints) |
| 70 | + { |
| 71 | + if (actor.FindStatus(SID.Transporting) == null) |
| 72 | + hints.InteractWithTarget = Ingredients.MinBy(actor.DistanceToHitbox); |
| 73 | + else |
| 74 | + hints.InteractWithTarget = CakeStand; |
| 75 | + } |
| 76 | + |
| 77 | + private OID? MapEffectIndexToOID(byte index) => index switch |
| 78 | + { |
| 79 | + var ingredient when ingredient is >= 0x56 and <= 0x6A => (OID)((uint)OID.WhippedCreamFrosting + (index - 0x57)), |
| 80 | + _ => null |
| 81 | + }; |
| 82 | +} |
| 83 | + |
| 84 | +class SugarBlizzard(BossModule module) : Components.StandardAOEs(module, AID.SugarBlizzard, new AOEShapeCone(15, 45.Degrees())); |
| 85 | + |
| 86 | +// someone can finish/fix this if they want. I really do not care enough for a seasonal quest |
| 87 | +class BakeOffAI(BossModule module) : RotationModule<AutoBakeOff>(module); |
| 88 | +public class AutoBakeOff(WorldState ws) : UnmanagedRotation(ws, 5) |
| 89 | +{ |
| 90 | + protected override void Exec(Actor? primaryTarget) |
| 91 | + { |
| 92 | + if (primaryTarget == null) |
| 93 | + return; |
| 94 | + if (Player.FindStatus(SID.Transporting) != null) |
| 95 | + return; |
| 96 | + if (!Player.InCombat) |
| 97 | + return; |
| 98 | + // iterate Hints.PriorityTargets and compare against Hints.NumPriorityTargetsInAOECone. Only execute when they're the same. |
| 99 | + // If they're not the same, set a goal zone for an area that will hit all of them, then call useaction with the correct facing angle |
| 100 | + UseAction(Roleplay.AID.BakeOff, primaryTarget); |
| 101 | + } |
| 102 | +} |
| 103 | + |
| 104 | +class TheIcingOnTheCakeStates : StateMachineBuilder |
| 105 | +{ |
| 106 | + public TheIcingOnTheCakeStates(BossModule module) : base(module) |
| 107 | + { |
| 108 | + TrivialPhase() |
| 109 | + .ActivateOnEnter<DecorateCake>() |
| 110 | + .ActivateOnEnter<SugarBlizzard>(); |
| 111 | + } |
| 112 | +} |
| 113 | + |
| 114 | +[ModuleInfo(BossModuleInfo.Maturity.Contributed, Contributors = "croizat", GroupType = BossModuleInfo.GroupType.CFC, GroupID = 1045, NameID = 14234)] |
| 115 | +public class TheIcingOnTheCake(WorldState ws, Actor primary) : BossModule(ws, primary, new(0, 0), new ArenaBoundsCircle(45)) |
| 116 | +{ |
| 117 | + protected override bool CheckPull() => !PrimaryActor.IsDead; |
| 118 | +} |
0 commit comments