In my game I would like to have a damage dealt to an enemy at random. I searched through the forum but everything else has a different purpose making it hard for me to understand it.
I have this in the attack call.
[code]
if(EnemyST -= 5){
Log.AddItem("Dave attacked Behemoth.");
Log.AddItem("Behemoth lose [?] HP.");
}
else if(EnemyST -= 0){
Log.AddItem("Attack missed .");
Log.AddItem("Behemoth lose 0 HP.");
}
[/code]
- Attacks range from 5,6,7,8,9,10,0 [This is used if missed]
- How do I add the random # to the game so that they can be called?
- And how do I add the random number to the Log to replace the [?].
[code]// new module script
struct Random(6){
int Random[0] = EnemyST -= 5;
int Random[1] = EnemyST -= 6;
int Random[2] = EnemyST -= 7;
int Random[3] = EnemyST -= 8;
int Random[4] = EnemyST -= 9;
int Random[5] = EnemyST -= 10;
};[/code]