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
|
#include <iostream>
#include <string>
#include "Combat.h"
#include "Player.h"
#include "Monster.h"
#include "Scenario.h"
using namespace std;
Combat::Combat()
{
}
bool Combat::runCombat()
{
Player kyle;
Monster enemies[3];
Monster one = enemies[0];
Monster two = enemies[1];
Monster three = enemies[2];
kyle.init(1, 10, 10, 3, 5, 6, 15, 12, 500, 1000);
one.init("Orrin", 1, 10, 10, 2, 5, 6, 15, 12, 500, 1000);
two.init("Braedon", 1, 10, 10, 1, 5, 6, 15, 12, 500, 1000);
three.init("Brent", 1, 10, 10, 4, 5, 6, 15, 12, 500, 1000);
int speed1 = kyle.accessSpeed();
int speed2 = one.accessSpeed();
int speed3 = two.accessSpeed();
int speed4 = three.accessSpeed();
int turn = checkSpeed(speed1, speed2, speed3, speed4);
if (turn == 1) {
int choice = kyle.pickAction();
if (choice == 1) {
kyle.makeAttack(one, two, three);
}
}
else {
//bigger.pickAction();
}
char turn = 'a';
}
int Combat::checkSpeed(int crea1, int crea2, int crea3, int crea4)
{
if (crea1 > crea2 && crea3 && crea4) {
return 1;
}
else if (crea2 > crea1 && crea3 && crea4) {
return 2;
}
else if (crea2 > crea1 && crea3 && crea4) {
return 3;
}
else {
return 4;
}
}
|