Skip to content

Commit

Permalink
Merge pull request #3122 from Tharre/warlock_fixes
Browse files Browse the repository at this point in the history
Warlock fixes
  • Loading branch information
Tharre authored May 28, 2023
2 parents c008fbe + 6dfbc55 commit 7f880c0
Show file tree
Hide file tree
Showing 10 changed files with 593 additions and 453 deletions.
8 changes: 8 additions & 0 deletions sim/core/item_swaps.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ type ItemSwap struct {

// Holds items that are currently not equipped
unEquippedItems [3]Item
swapped bool
}

/*
Expand All @@ -41,6 +42,7 @@ func (character *Character) EnableItemSwap(itemSwap *proto.ItemSwap, mhCritMulti
ohCritMultiplier: ohCritMultiplier,
rangedCritMultiplier: rangedCritMultiplier,
unEquippedItems: items,
swapped: false,
}
}

Expand Down Expand Up @@ -90,6 +92,10 @@ func (swap *ItemSwap) IsEnabled() bool {
return swap.character != nil
}

func (swap *ItemSwap) IsSwapped() bool {
return swap.swapped
}

func (swap *ItemSwap) GetItem(slot proto.ItemSlot) *Item {
if slot-offset < 0 {
panic("Not able to swap Item " + slot.String() + " not supported")
Expand Down Expand Up @@ -148,6 +154,7 @@ func (swap *ItemSwap) SwapItems(sim *Simulation, slots []proto.ItemSlot, useGCD
if useGCD {
character.SetGCDTimer(sim, 1500*time.Millisecond+sim.CurrentTime)
}
swap.swapped = !swap.swapped
}

func (swap *ItemSwap) swapItem(slot proto.ItemSlot, has2H bool) (bool, stats.Stats) {
Expand Down Expand Up @@ -231,6 +238,7 @@ func (swap *ItemSwap) reset(sim *Simulation) {
}

swap.unEquippedItems = swap.initialUnequippedItems
swap.swapped = false

for _, onSwap := range swap.onSwapCallbacks {
onSwap(sim)
Expand Down
Loading

0 comments on commit 7f880c0

Please sign in to comment.