How do i do this?

Ok so sorry but im a COMPLETE beginner and the most experience have in coding is from a tutorial that GAVE the codes to me. It helped but theres one thing I wanna do. I'm making a game and theres a lot of coding involved. I'm wanting to make it to where if a player attacks a certain enemy, then he/she has a chance to get sick, and add a certain number to a sickness variable (the higher the number, the more deadly the sickness) and make it to where after however many seconds or minutes pass than his HP drops by a certain number. I'll accept any helpful answer but if you can give me even just little bits of code than that wold be amazing.
Well, in order to get the change part right you would need to look into random number generation. (Google should help here). As for the adding to the "sickness variable" that would probably also be random number generation. Also, in order to "make it go away" after a certain amount of time you would need to use clocks and timers (google should help here.) I think SFML has a timer class as well. And then the amount of hp lost would probably be in a formula with your "sickness variable". As for code, if you post code, people would be very willing to help you with any errors or problems.
Topic archived. No new replies allowed.