-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3260 from wowsims/apl
Implement multidotting and more values for APL
- Loading branch information
Showing
15 changed files
with
497 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
package core | ||
|
||
import ( | ||
"time" | ||
|
||
"github.com/wowsims/wotlk/sim/core/proto" | ||
) | ||
|
||
func (unit *Unit) aplGetAura(auraId *proto.ActionID) *Aura { | ||
return unit.GetAuraByID(ProtoToActionID(auraId)) | ||
} | ||
|
||
type APLValueAuraIsActive struct { | ||
defaultAPLValueImpl | ||
aura *Aura | ||
} | ||
|
||
func (unit *Unit) newValueAuraIsActive(config *proto.APLValueAuraIsActive) APLValue { | ||
aura := unit.aplGetAura(config.AuraId) | ||
if aura == nil { | ||
return nil | ||
} | ||
return &APLValueAuraIsActive{ | ||
aura: aura, | ||
} | ||
} | ||
func (value *APLValueAuraIsActive) Type() proto.APLValueType { | ||
return proto.APLValueType_ValueTypeBool | ||
} | ||
func (value *APLValueAuraIsActive) GetBool(sim *Simulation) bool { | ||
return value.aura.IsActive() | ||
} | ||
|
||
type APLValueAuraRemainingTime struct { | ||
defaultAPLValueImpl | ||
aura *Aura | ||
} | ||
|
||
func (unit *Unit) newValueAuraRemainingTime(config *proto.APLValueAuraRemainingTime) APLValue { | ||
aura := unit.aplGetAura(config.AuraId) | ||
if aura == nil { | ||
return nil | ||
} | ||
return &APLValueAuraRemainingTime{ | ||
aura: aura, | ||
} | ||
} | ||
func (value *APLValueAuraRemainingTime) Type() proto.APLValueType { | ||
return proto.APLValueType_ValueTypeDuration | ||
} | ||
func (value *APLValueAuraRemainingTime) GetDuration(sim *Simulation) time.Duration { | ||
return value.aura.RemainingDuration(sim) | ||
} | ||
|
||
type APLValueAuraNumStacks struct { | ||
defaultAPLValueImpl | ||
aura *Aura | ||
} | ||
|
||
func (unit *Unit) newValueAuraNumStacks(config *proto.APLValueAuraNumStacks) APLValue { | ||
aura := unit.aplGetAura(config.AuraId) | ||
if aura == nil { | ||
return nil | ||
} | ||
if aura.MaxStacks == 0 { | ||
return nil | ||
} | ||
return &APLValueAuraNumStacks{ | ||
aura: aura, | ||
} | ||
} | ||
func (value *APLValueAuraNumStacks) Type() proto.APLValueType { | ||
return proto.APLValueType_ValueTypeInt | ||
} | ||
func (value *APLValueAuraNumStacks) GetInt(sim *Simulation) int32 { | ||
return value.aura.GetStacks() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package core | ||
|
||
import ( | ||
"time" | ||
|
||
"github.com/wowsims/wotlk/sim/core/proto" | ||
) | ||
|
||
type APLValueGCDIsReady struct { | ||
defaultAPLValueImpl | ||
unit *Unit | ||
} | ||
|
||
func (unit *Unit) newValueGCDIsReady(config *proto.APLValueGCDIsReady) APLValue { | ||
return &APLValueGCDIsReady{ | ||
unit: unit, | ||
} | ||
} | ||
func (value *APLValueGCDIsReady) Type() proto.APLValueType { | ||
return proto.APLValueType_ValueTypeBool | ||
} | ||
func (value *APLValueGCDIsReady) GetBool(sim *Simulation) bool { | ||
return value.unit.GCD.IsReady(sim) | ||
} | ||
|
||
type APLValueGCDTimeToReady struct { | ||
defaultAPLValueImpl | ||
unit *Unit | ||
} | ||
|
||
func (unit *Unit) newValueGCDTimeToReady(config *proto.APLValueGCDTimeToReady) APLValue { | ||
return &APLValueGCDTimeToReady{ | ||
unit: unit, | ||
} | ||
} | ||
func (value *APLValueGCDTimeToReady) Type() proto.APLValueType { | ||
return proto.APLValueType_ValueTypeDuration | ||
} | ||
func (value *APLValueGCDTimeToReady) GetDuration(sim *Simulation) time.Duration { | ||
return value.unit.GCD.TimeToReady(sim) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
package core | ||
|
||
import ( | ||
"time" | ||
|
||
"github.com/wowsims/wotlk/sim/core/proto" | ||
) | ||
|
||
func (unit *Unit) aplGetSpell(spellId *proto.ActionID) *Spell { | ||
return unit.GetSpell(ProtoToActionID(spellId)) | ||
} | ||
|
||
type APLValueSpellCanCast struct { | ||
defaultAPLValueImpl | ||
spell *Spell | ||
} | ||
|
||
func (unit *Unit) newValueSpellCanCast(config *proto.APLValueSpellCanCast) APLValue { | ||
spell := unit.aplGetSpell(config.SpellId) | ||
if spell == nil { | ||
return nil | ||
} | ||
return &APLValueSpellCanCast{ | ||
spell: spell, | ||
} | ||
} | ||
func (value *APLValueSpellCanCast) Type() proto.APLValueType { | ||
return proto.APLValueType_ValueTypeBool | ||
} | ||
func (value *APLValueSpellCanCast) GetBool(sim *Simulation) bool { | ||
return value.spell.CanCast(sim, value.spell.Unit.CurrentTarget) | ||
} | ||
|
||
type APLValueSpellIsReady struct { | ||
defaultAPLValueImpl | ||
spell *Spell | ||
} | ||
|
||
func (unit *Unit) newValueSpellIsReady(config *proto.APLValueSpellIsReady) APLValue { | ||
spell := unit.aplGetSpell(config.SpellId) | ||
if spell == nil { | ||
return nil | ||
} | ||
return &APLValueSpellIsReady{ | ||
spell: spell, | ||
} | ||
} | ||
func (value *APLValueSpellIsReady) Type() proto.APLValueType { | ||
return proto.APLValueType_ValueTypeBool | ||
} | ||
func (value *APLValueSpellIsReady) GetBool(sim *Simulation) bool { | ||
return value.spell.IsReady(sim) | ||
} | ||
|
||
type APLValueSpellTimeToReady struct { | ||
defaultAPLValueImpl | ||
spell *Spell | ||
} | ||
|
||
func (unit *Unit) newValueSpellTimeToReady(config *proto.APLValueSpellTimeToReady) APLValue { | ||
spell := unit.aplGetSpell(config.SpellId) | ||
if spell == nil { | ||
return nil | ||
} | ||
return &APLValueSpellTimeToReady{ | ||
spell: spell, | ||
} | ||
} | ||
func (value *APLValueSpellTimeToReady) Type() proto.APLValueType { | ||
return proto.APLValueType_ValueTypeDuration | ||
} | ||
func (value *APLValueSpellTimeToReady) GetDuration(sim *Simulation) time.Duration { | ||
return value.spell.TimeToReady(sim) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.