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
|
#include <iostream>
#include "Combat.h"
#include "Player.h"
#include "Monster.h"
using namespace std;
Combat::Combat()
{
}
bool Combat::runCombat()
{
Player kyle;
Monster bigger;
kyle.init(1, 10, 10, 3, 5, 6, 15, 12, 500, 1000);
bigger.init(1, 10, 10, 2, 5, 6, 15, 12, 500, 1000);
int speed1 = kyle.accessSpeed();
int speed2 = bigger.accessSpeed();
int turn = checkSpeed(speed1, speed2);
if (turn == 1) {
kyle.pickAction();
}
else {
//bigger.pickAction();
}
char turn = 'a';
}
int Combat::checkSpeed(int crea1, int crea2)
{
if (crea1 > crea2) {
return 1;
}
else {
return 2;
}
}
|