Fighting System (for RPG) [SOLVED]

Started by R4L, Thu 01/12/2005 15:00:40

Previous topic - Next topic

R4L

I don't mean to bother anyone with this topic, because I have seen it appear many times lately, but I am not asking for a battle system.

I've made my own but am having a hard time with the Global Ints that I have made. I have a stats system displayed on a GUI called STATS. I have 4 Global Ints:

1: Strength
2: Wisdom
3: Charm
4: Stat points (to build up these attributes)

My battle system is straight forward. The main char is on the left and the enemy char is on the right. Depending on your strength, buttons will be placed on a GUI at the bottom of the screen. Those buttons are the attacks that you can do. For example: If you don't have 250 strength then you won't be able to do certain attacks. But I have just two problems with all of this. I don't know how I can adjust the damage for each attack depending on your strength. For example:

Strength = 100 then you do damage somewhere around 10-35 for weak attacks.
Strength = 200 then you do damage somewhere around 35-65 for medium attacks.
Strength = 300 then you do damage somewhere around 65-125 for strong attacks.

I figure Random could handle whether your attack hit, missed, less effective, critical etc... I was thinking of using the buttons as attacks and storing the damages into global ints and running them through int ran = Random(10); but I haven't the clue of what to do. Can I get some help please? Thank you and my apologies if I annoyed anyone with this topic. Corey.

scourge

#1
hope this is what you meantÃ,  :P

You could make one attack button and when clicked:

Code: ags

int damage = 0;

if (getGlobalInt(1) <= 100) {
	damage = Random(25) + 11;
}
else if (getGlobalInt(1) <= 200) {
	damage = Random(30) + 36;
}
else if (getGlobalInt(1) <= 300) {
Ã,  Ã,  Ã,  Ã,  Ã, damage = Random(60) + 66;
}


R4L

Of course! Thanks alot buloght!

SMF spam blocked by CleanTalk