Anything related in any way to game development as a whole is welcome here. Tell us about your game, grace us with your project, show us your new YouTube video, etc.
if(chance == 3); // chance is a random number between one and ten
{
stun = true;
if(stun == true);
{
cout << " your enemy is incapable of attacking "
}
}
what i am not sure on how to do is to make chance different everytime i use the attack and how to include this into the attack
So what you don't know how to do is change chance once you press attack, couldn't you just make an attack function that is called when you choose to attack, and have chance chosen at the beginning of the function?
as for using it just use another function or have a switch case thing...
Edit: My game is set up into different files for like everything, like battlesystem is one cpp file, while shop is another...
If your head doesn't explode from reading all that, you should be good to go.
What should I know when first posting to r.g.r.d?
Some places are more newbie-friendly than others. The developers at rec.games.roguelike.development may sometimes show little patience with questions that have been asked many times before. Here are two simple things you can do to ensure that you get off to a good start:
* Do some research before you ask a question. If the answer is available via a search engine, why ask here? If the research does not turn up a satisfactory answer, then by all means ask, and you will be able to ask a better, more focused question as a result of your earlier work. Demonstrate that you have some initiative, and you will get a much more helpful response. As well as searching the web in general, search r.g.r.d.
* Don't ask what the best programming language for a roguelike is, or if a particular language is suitable for roguelike programming. If you want to know why, search r.g.r.d via Google Groups for "best programming language" and you will find many flamewars sparked by that question and its variants. The topic has been done to death, and many developers are tired of it.
Gold for any community/forum and game. If only everyone followed these guidelines...
I'll write a signature once I get some creativity and inspiration...