Okay, so I was looking into the script of the default battle system and I found this on line 150:
Presumably, this tells the game how much gold to give me after I kill the enemy group.
Is there a way to do something somewhere along the lines of...
Multiply enemy.gold by a random number between 0.8 and 1.2, then round up to nearest whole number?
Example of what I want in the outcome:
I kill an enemy who's "GOLD" value in the database is 100.
I want the game to give me a random amount of gold between 80 and 120,
or if the enemy was supposed to give me 73 gold, then an amount between 58.4 (round to 59) and 87.6 (round to 88).
Is there a way to do that kind of a calculation in ruby?
Am I even looking at the right part of the script for this?
If someone could let me know, that would be great.
EDIT:
To be more specific about "0.8 and 1.2", it would probably be more like a number chosen from an array.
I don't need to be multiplying things by 0.83657 or something like that.
So like... [0.8, 0.9, 1, 1.1, 1.2] or something.
Code:
    gold += enemy.gold
Is there a way to do something somewhere along the lines of...
Multiply enemy.gold by a random number between 0.8 and 1.2, then round up to nearest whole number?
Example of what I want in the outcome:
I kill an enemy who's "GOLD" value in the database is 100.
I want the game to give me a random amount of gold between 80 and 120,
or if the enemy was supposed to give me 73 gold, then an amount between 58.4 (round to 59) and 87.6 (round to 88).
Is there a way to do that kind of a calculation in ruby?
Am I even looking at the right part of the script for this?
If someone could let me know, that would be great.
EDIT:
To be more specific about "0.8 and 1.2", it would probably be more like a number chosen from an array.
I don't need to be multiplying things by 0.83657 or something like that.
So like... [0.8, 0.9, 1, 1.1, 1.2] or something.