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
|
#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 one;
Monster two;
Monster three;
kyle.init(1, 10, 10, 3, 5, 6, 15, 12, 500, 1000);
one.init(1, 10, 10, 2, 5, 6, 15, 12, 500, 1000);
two.init(1, 10, 10, 1, 5, 6, 15, 12, 500, 1000);
three.init(1, 10, 10, 4, 5, 6, 15, 12, 500, 1000);
one._name = "Orrin";
two._name = "Braedon";
three._name = "Brent";
int turn = checkSpeed(kyle._speed, one._speed, two._speed, three._speed);
if (turn == 1) {
int choice = kyle.pickAction();
if (choice == 1) {
kyle.makeAttack(one, two, three);
}
}
else if (turn == 2) {
one.monAttack;
}
else if (turn == 3) {
two.monAttack;
}
else {
three.monAttack;
}
}
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 (crea3 > crea1 && crea2 && crea4) {
return 3;
}
else {
return 4;
}
}
|