1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
|
int main()
{
// Seeds a random number based on time()
srand(time(NULL));
// Player properties
Player player =
{
"Name", // name
300, // max_health
300, // health
500, // max_mana
500, // mana
12, // attack
6, // defense
11, // max_agility
11, // agility
// Spells
{"Fireball", "Lightning Bolt", "Ice Blast"},
// Status
{
false, // faster
false, // burned
false, // paralyzed
false, // freezing
0, // max_turns_paralyzed
0 // turns_paralyzed
}
};
// Enemy properties
Player enemy =
{
"Enemy", // name
350, // max_health
350, // health
0, // max_mana
0, // mana
10, // attack
8, // defense
10, // max_agility
10, // agility
// Spells
{},
// Status
{
false, // faster
false, // burned
false, // paralyzed
false, // freezing
0, // max_turns_paralyzed
0 // turns_paralyzed
}
};
// Pointers
Player *p_ptr = &player;
Player *e_ptr = &enemy;
// Name the player
// name_player(p_ptr);
do
{
battle(p_ptr, e_ptr);
}while(1);
return 0;
}// end main()
|