So I am calculating values, snapshotting them and send them into a interval. But the issue is, is its wildly increasing what the sum should be.
Here is the calculations:
// Set up mob attributes - SNAPSHOT
const mobId = '1';
var mob = {
mhp: (mobId + 10) * 15,
hp: (mobId + 10) * 15,
dmg: (mobId + 2) * 3,
defenseRating: (mobId + 3) * 4,
hitRating: (mobId + 2) * 2,
critRating: (mobId + 3) * 2,
critDmg: (mobId + 2) * 2,
dodgeRating: (mobId + 1) * 3,
firstHitRating: (mobId + 3) * 4,
};
console.log(mob);
I don't know about you, but in what world does 11 * 15 = 1650. This is the calculations BEFORE I send it through the interval, so it isn't messing up there. It is the intial calculations that being very weird.
Note: It may be worth noting that I am doing this through a socket event:
socket.on('fight mob', (mobId) => {
I doubt that is the issue but I am at a loss right now.