DEGENESIS-FoundryVTT
DEGENESIS-FoundryVTT copied to clipboard
spent ego bonus accumulates on combat actor
When spending ego and then rolling initiative on an actor that is in combat the bonus from ego stacks. From what I've seen this does not happen to actors that aren't in combat. And it doesn't happen when opening the character sheet from the right hand side.
Steps to reproduce:
- create an actor
- add the actor to the scene
- create an encounter and add actor to encoutner
- begin combat
- open character sheet by clicking on the actor token in the scene
- increase 'SPEND EGO'
- click 'INITIATIVE'
- repeat the previous 2 steps
The image below is what I got from doing this a few times
After poking around this more I don't think it'll come up in normal play as you'd have to go out of your way to not roll anything other than initiative or the modifier would go down.
Anyways I'm sure there's a better way to do this fixes it between rounds
Hooks.on("combatRound", function () {
const encounter = game.combats.combats.find(e => e.active === true)
encounter.combatants.forEach(function(combatant, index) {
const itemIds = combatant.actor.items.filter(e => e.name === 'Spent Ego Bonus').map(function (value, index) {
return value._id
})
combatant.actor.deleteEmbeddedDocuments('Item', itemIds)
})
});
Will look into that, thanks for feedback :)
I checked and tested some functionality. Main conclusions are:
- Rolling initiative from character sheet does not update initiative value in combat tracker
- Combat tracker initiative roll does not use spend ego points
- Functionality spend ego points works weird to say the least, entire feature needs a rework.
I think this fix was implemented back in a days. Closing for now as resolved.