Skip to content

Commit

Permalink
Merge branch 'master' into feature/add-trinket-swapping
Browse files Browse the repository at this point in the history
  • Loading branch information
1337LutZ committed Jan 3, 2025
2 parents ced524b + d35ff71 commit 95bffaa
Show file tree
Hide file tree
Showing 12 changed files with 2,294 additions and 719 deletions.
8 changes: 7 additions & 1 deletion proto/apl.proto
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ message APLListItem {
APLAction action = 3; // The action to be performed.
}

// NextIndex: 24
// NextIndex: 25
message APLAction {
APLValue condition = 1; // If set, action will only execute if value is true or != 0.

Expand All @@ -68,6 +68,7 @@ message APLAction {
// Misc
APLActionChangeTarget change_target = 9;
APLActionActivateAura activate_aura = 13;
APLActionActivateAuraWithStacks activate_aura_with_stacks = 24;
APLActionCancelAura cancel_aura = 10;
APLActionTriggerICD trigger_icd = 11;
APLActionItemSwap item_swap = 17;
Expand Down Expand Up @@ -292,6 +293,11 @@ message APLActionActivateAura {
ActionID aura_id = 1;
}

message APLActionActivateAuraWithStacks {
ActionID aura_id = 1;
int32 num_stacks = 2;
}

message APLActionTriggerICD {
ActionID aura_id = 1;
}
Expand Down
2 changes: 2 additions & 0 deletions sim/core/apl_action.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ func (rot *APLRotation) newAPLActionImpl(config *proto.APLAction) APLActionImpl
return rot.newActionChangeTarget(config.GetChangeTarget())
case *proto.APLAction_ActivateAura:
return rot.newActionActivateAura(config.GetActivateAura())
case *proto.APLAction_ActivateAuraWithStacks:
return rot.newActionActivateAuraWithStacks(config.GetActivateAuraWithStacks())
case *proto.APLAction_CancelAura:
return rot.newActionCancelAura(config.GetCancelAura())
case *proto.APLAction_TriggerIcd:
Expand Down
34 changes: 34 additions & 0 deletions sim/core/apl_actions_misc.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,40 @@ func (action *APLActionActivateAura) String() string {
return fmt.Sprintf("Activate Aura(%s)", action.aura.ActionID)
}

type APLActionActivateAuraWithStacks struct {
defaultAPLActionImpl
aura *Aura
numStacks int32
}

func (rot *APLRotation) newActionActivateAuraWithStacks(config *proto.APLActionActivateAuraWithStacks) APLActionImpl {
aura := rot.GetAPLAura(rot.GetSourceUnit(&proto.UnitReference{Type: proto.UnitReference_Self}), config.AuraId)
if aura.Get() == nil {
return nil
}
if aura.Get().MaxStacks == 0 {
rot.ValidationMessage(proto.LogLevel_Warning, "%s is not a stackable aura", ProtoToActionID(config.AuraId))
return nil
}
return &APLActionActivateAuraWithStacks{
aura: aura.Get(),
numStacks: int32(min(config.NumStacks, aura.Get().MaxStacks)),
}
}
func (action *APLActionActivateAuraWithStacks) IsReady(sim *Simulation) bool {
return true
}
func (action *APLActionActivateAuraWithStacks) Execute(sim *Simulation) {
if sim.Log != nil {
action.aura.Unit.Log(sim, "Activating aura %s (%d stacks)", action.aura.ActionID, action.numStacks)
}
action.aura.Activate(sim)
action.aura.SetStacks(sim, action.numStacks)
}
func (action *APLActionActivateAuraWithStacks) String() string {
return fmt.Sprintf("Activate Aura(%s) Stacks(%d)", action.aura.ActionID, action.numStacks)
}

type APLActionTriggerICD struct {
defaultAPLActionImpl
aura *Aura
Expand Down
1 change: 1 addition & 0 deletions sim/druid/starsurge.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ func (druid *Druid) registerStarsurgeSpell() {
ProcMask: core.ProcMaskSpellDamage,
ClassSpellMask: DruidSpellStarsurge,
Flags: core.SpellFlagAPL | SpellFlagOmenTrigger,
MissileSpeed: 20,

DamageMultiplier: 1,
DamageMultiplierAdditive: 1,
Expand Down
Loading

0 comments on commit 95bffaa

Please sign in to comment.