Whats the actual formula? int elysianDamage = damage/10 - 30%;?
|
Alright guys, so i'm trying to add Elysian spirit shield effect to my server.
But i ain't got a clue how to reduce the damage by 30% As i simply do not know how to use the percent with Java.
My attempt was
Code:int elysianDamage = damage/10 - 30%;
Whats the actual formula? int elysianDamage = damage/10 - 30%;?
Percent can be represented by a decimal. So let's say if you wanted to have 30 percent of 100. You could times one hundred by 0.3 to get 30% of a hundred (would be 30 obviously).
If you wanted to remove 30% of the attackers whatever you'd times it by 0.7 (0.3 would be 30% and you want 70% since your reducing by 30%).
Hope this helps.
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |