Greetings!
I'm looking for a little help with a skill for an enemy I'm tinkering around with. This encounter is going to be a greed demon/spirit, and I am trying to intially get the enemy to steal x amount of gold from the player, eventually I would like to have this be a percentage range. Being a demon/spirit of that vice genre, the enemy would gain attack power by the amount of gold stolen, this would also be a percentage based on the amount of gold stolen.
Loose example, 10% of gold is stolen, +10% attack power. 100% of gold stolen, +100% attack power.
I'm slowly learning Java, but yeah I'm no good at it to be able to figure things out. The best I could come up with for a random percentage is: Math.random();
Per my screenshot, I was attempting to define how much gold would be in inventory, multiply that by the percentage modifier then change gold by that amount. Text would show what that integer would be.
The attack modifier would have to be 1+Math.random();
At first I was getting a syntax error, but now it seems as though the flow works but gold doesn't change.
Anyways, thanks for any help you'd be able to provide
I'm looking for a little help with a skill for an enemy I'm tinkering around with. This encounter is going to be a greed demon/spirit, and I am trying to intially get the enemy to steal x amount of gold from the player, eventually I would like to have this be a percentage range. Being a demon/spirit of that vice genre, the enemy would gain attack power by the amount of gold stolen, this would also be a percentage based on the amount of gold stolen.
Loose example, 10% of gold is stolen, +10% attack power. 100% of gold stolen, +100% attack power.
I'm slowly learning Java, but yeah I'm no good at it to be able to figure things out. The best I could come up with for a random percentage is: Math.random();
Per my screenshot, I was attempting to define how much gold would be in inventory, multiply that by the percentage modifier then change gold by that amount. Text would show what that integer would be.
The attack modifier would have to be 1+Math.random();
At first I was getting a syntax error, but now it seems as though the flow works but gold doesn't change.
Anyways, thanks for any help you'd be able to provide