Skip to content

Commit

Permalink
fix biotic recovery and long reset reset issue
Browse files Browse the repository at this point in the history
  • Loading branch information
queryluke committed Jun 4, 2022
1 parent 163a007 commit df49f8c
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions components/cs/rest/MeCsRestDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -206,18 +206,19 @@ export default {
},
setRecharge (value) {
this.tpRecharge += value
console.log(this.tpRecharge)
},
execRest (type) {
this.working = true
const currentStatsClone = cloneDeep(this.character.currentStats)
const mechanicsToProcess = [
...this.mechanics.filter(i => i.resource?.reset ? i.resource?.reset === type : true),
...this.mechanics.filter(i => type === 'short' ? (i.resource?.reset && i.resource?.reset === type) : (i.resource && [null, undefined, 'short', 'long'].includes(i.resource.reset))),
...(this.character.brews || []).filter(i => i.mechanics?.uses && (type === 'short' ? i.mechanics?.recharge === 'short' : true)),
...this.powers.filter(i => i.resource?.reset ? i.resource?.reset === type : true)
...this.powers.filter(i => type === 'short' ? (i.resource?.reset && i.resource?.reset === type) : (i.resource && [null, undefined, 'short', 'long'].includes(i.resource.reset)))
]
// barrier
currentStatsClone.barrier.used = 0
// powercasting resources
if (type === 'long') {
// LONG REST, all powers/tp
currentStatsClone.psUsed = [0, 0, 0, 0, 0]
Expand All @@ -229,7 +230,13 @@ export default {
currentStatsClone.psUsed[this.pactSlots.slotLevel - 1] = Math.max(0, currentStatsClone.psUsed[this.pactSlots.slotLevel - 1] - this.pactSlots.numSlots)
}
// biotic recovery
// TODO: this
if (this.bioticRecovery.some(i => i > 0)) {
for (let i = 0; i < 3; i++) {
if (this.bioticRecovery[i] > 0) {
currentStatsClone.psUsed[i] = Math.max(0, currentStatsClone.psUsed[i] - this.bioticRecovery[i])
}
}
}
// tech points
if (this.tpRecharge > 0) {
Expand Down

0 comments on commit df49f8c

Please sign in to comment.