#include "Entity.h" #include "Grid.h" #include "Moves.h" #include #include #include #include using namespace std; class MoveSet; // void Entity::action() {} void Entity::move() {} void Entity::setPos() { srand(time(0)); // Random Positioning this->colPos = rand() % 3; this->rowPos = rand() % 3; } bool Entity::checkHealth() { return (con > 0); } Player::Player() { setPos(); this->con = 10; this->str = 10; this->dex = 10; // setClass('a'); } void Player::action() { char act; do { cout << "What will you do?" << endl; cout << " a. Light Attack" << endl; cout << " b. Heavy Attack" << endl; cout << " c. Defend" << endl; cout << " d. Counter" << endl; cout << " e. Flee" << endl; cout << " Enter Action Here: "; cin >> act; switch (act) { case 'a': // callLightAttack(); break; case 'b': // callHeavyAttack(); break; case 'c': // callDefend(); break; case 'd': break; case 'e': break; default: cout << "Please enter a valid option." << endl; break; } } while (act != 'a' && act != 'b' && act != 'c' && act != 'd' && act != 'e' && act != 'f'); } void Player::setClass(char Class) { switch (Class) { case 'a': // Warrior this->str = 14; this->con = 12; this->dex = 8; break; case 'b': // Rogue break; } } void Enemy::action() { int act = rand() % 10; if (con <= 2) { // Attempt flee } else { if (act <= 2) { // Heavy Attack } else if (act >= 3 && act <= 5) { // Light Attack } else if (act >= 6 && act <= 8) { // Defend } else if (act >= 9) { // Counter } } } void Enemy::setBossClassByChoice(int boss) { switch (boss) { case 1: // Minotaur this->str = 16; this->con = 14; this->dex = 8; break; case 2: // Dragonoid this->str = 14; this->con = 16; this->dex = 12; break; case 3: // Cyclops this->str = 18; this->con = 16; this->dex = 6; break; } } void Enemy::setBossClassByRand() { int monster = rand() % 3; // Boss Monster Randomization setBossClassByChoice(monster); } void Enemy::setClassByChoice(int monster) { switch (monster) { case 1: // Goblin this->str = 6; this->con = 6; this->dex = 12; break; case 2: // Orc this->str = 14; this->con = 10; this->dex = 8; break; case 3: // Skeleton this->str = 8; this->con = 10; this->dex = 10; break; } } void Enemy::setClassByRand() { int monster = rand() % 3; // Monster Randomization setClassByChoice(monster); } Enemy::Enemy(bool boss) { setPos(); if (boss) { setBossClassByRand(); } else { setClassByRand(); } }