I've been trying (note: trying) to edit the battle formula's to suit my likings. And there's something I'm stuck with;
here's the line which I've been messing around with;
to say thing simple, I'd like to have an extra variable added in there, a random number which can be -2, -1, 0, 1 or 2 (lets call that variable dmgmod for the sake of explanation)
so the code should become
seems simple enough right? Well I can't figure out how to make a random number go from -2 to 2. rand(3) goes from 0 to 2 (right? O.o) I tried some things which work on my calculator (which uses RandInt(-2,2) which could output any number from -2 to 2. But ruby doesn't like my calculator it seems..
EDIT: I've also been messing around with the "critical strike damage modifier" it used to be
but that didn't really fit in with my damage so I changed it to
Now the problem is that I'm getting crits which are like 7.65 damage, how can I make sure that it's rounded off to either 8 (when it's 7.5 or above) or to 7 (when it's 7.49 or below)
If anyone could illuminate me, that would be appreciated :smile:
~Acera
here's the line which I've been messing around with;
Code:
self.damage = atk + (attacker.str / 4)
to say thing simple, I'd like to have an extra variable added in there, a random number which can be -2, -1, 0, 1 or 2 (lets call that variable dmgmod for the sake of explanation)
so the code should become
Code:
self.damage = atk + (attacker.str / 4) + dmgmod
seems simple enough right? Well I can't figure out how to make a random number go from -2 to 2. rand(3) goes from 0 to 2 (right? O.o) I tried some things which work on my calculator (which uses RandInt(-2,2) which could output any number from -2 to 2. But ruby doesn't like my calculator it seems..
EDIT: I've also been messing around with the "critical strike damage modifier" it used to be
Code:
self.damage *= 2
Code:
self.damage *= 1.5
If anyone could illuminate me, that would be appreciated :smile:
~Acera