Skip to content

Commit

Permalink
Rename floating energy --> excess energy
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmyt857 committed Sep 10, 2023
1 parent 5f8c9b5 commit 03f907c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 deletions.
4 changes: 2 additions & 2 deletions proto/apl.proto
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ message APLValue {

// Class or Spec-specific values
APLValueTotemRemainingTime totem_remaining_time = 49;
APLValueCatFloatingEnergy cat_floating_energy = 52;
APLValueCatExcessEnergy cat_excess_energy = 52;
}
}

Expand Down Expand Up @@ -402,5 +402,5 @@ message APLValueSequenceTimeToReady {
message APLValueTotemRemainingTime {
ShamanTotems.TotemType totem_type = 1;
}
message APLValueCatFloatingEnergy {
message APLValueCatExcessEnergy {
}
21 changes: 11 additions & 10 deletions sim/druid/feral/apl_values.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,27 @@ import (

func (cat *FeralDruid) NewAPLValue(rot *core.APLRotation, config *proto.APLValue) core.APLValue {
switch config.Value.(type) {
case *proto.APLValue_CatFloatingEnergy:
return cat.newValueCatFloatingEnergy(rot, config.GetCatFloatingEnergy())
case *proto.APLValue_CatExcessEnergy:
return cat.newValueCatExcessEnergy(rot, config.GetCatExcessEnergy())
default:
return nil
}
}

type APLValueCatFloatingEnergy struct {
type APLValueCatExcessEnergy struct {
core.DefaultAPLValueImpl
cat *FeralDruid
}

func (cat *FeralDruid) newValueCatFloatingEnergy(rot *core.APLRotation, config *proto.APLValueCatFloatingEnergy) core.APLValue {
return &APLValueCatFloatingEnergy{
func (cat *FeralDruid) newValueCatExcessEnergy(rot *core.APLRotation, config *proto.APLValueCatExcessEnergy) core.APLValue {
return &APLValueCatExcessEnergy{
cat: cat,
}
}
func (value *APLValueCatFloatingEnergy) Type() proto.APLValueType {
func (value *APLValueCatExcessEnergy) Type() proto.APLValueType {
return proto.APLValueType_ValueTypeFloat
}
func (value *APLValueCatFloatingEnergy) GetFloat(sim *core.Simulation) float64 {
func (value *APLValueCatExcessEnergy) GetFloat(sim *core.Simulation) float64 {
cat := value.cat
pendingPool := PoolingActions{}
pendingPool.create(4)
Expand Down Expand Up @@ -61,8 +61,9 @@ func (value *APLValueCatFloatingEnergy) GetFloat(sim *core.Simulation) float64 {

pendingPool.sort()

return pendingPool.calcFloatingEnergy(cat, sim)
floatingEnergy := pendingPool.calcFloatingEnergy(cat, sim)
return cat.CurrentEnergy() - floatingEnergy
}
func (value *APLValueCatFloatingEnergy) String() string {
return "Cat Floating Energy()"
func (value *APLValueCatExcessEnergy) String() string {
return "Cat Excess Energy()"
}
8 changes: 4 additions & 4 deletions ui/core/components/individual_sim_ui/apl_values.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ import {
APLValueNextRuneCooldown,
APLValueNumberTargets,
APLValueTotemRemainingTime,
APLValueCatFloatingEnergy,
APLValueCatExcessEnergy,
} from '../../proto/apl.js';

import { EventID } from '../../typed_event.js';
Expand Down Expand Up @@ -896,11 +896,11 @@ const valueKindFactories: {[f in NonNullable<APLValueKind>]: ValueKindConfig<APL
totemTypeFieldConfig('totemType'),
],
}),
'catFloatingEnergy': inputBuilder({
label: 'Floating Energy',
'catExcessEnergy': inputBuilder({
label: 'Excess Energy',
submenu: ['Feral Druid'],
shortDescription: 'Returns the amount of excess energy available, after subtracting energy that will be needed to maintain DoTs.',
newValue: APLValueCatFloatingEnergy.create,
newValue: APLValueCatExcessEnergy.create,
includeIf: (player: Player<any>, isPrepull: boolean) => player.spec == Spec.SpecFeralDruid,
fields: [
],
Expand Down

0 comments on commit 03f907c

Please sign in to comment.