Hi, my question is, could anyone explain or "borrow" me the code for:
In my game I would like to create an item that its chance of hitting the enemy is 80% and if it hits, it steals for example 15 health out of 100. To use it I would have to type 1 in the output window.
I am kind of struggiling and to be honest I have no idea of how I should start it. Would love some help, thanks anyway.
I am not going to use the engine yet, that game is going to be without graphics and only for my use. I want to practice the simple coding, because I'm very bad it ;x therfore I know the pseudocode but not the real code.. ;c
Well 80% is 80/100 = 8/10 = 4/5 so that would mean if the number you get is 0-3 then it is a hit and if it is a 4 then it is a miss. Or alternatively you could make 0 a missing and 1-4 a hit.