Player.cpp 1.76 KB
Newer Older
Kameron Kinsey's avatar
Kameron Kinsey committed
1 2 3 4 5 6 7 8 9 10 11
/******************************************************************************
 * 
 *
 *  Random Stat Generator and Player Class
 *  By: Kameron Kinsey
 *
 *
 *
 *
 */

Kameron Kinsey's avatar
Kameron Kinsey committed
12
#include "item.h"
Kameron Kinsey's avatar
Kameron Kinsey committed
13 14 15 16 17 18 19 20
#include "Player.h"
#include <cstring>
#include <cstdlib>
#include <iostream>
using namespace std;

void Player::setStats(int seed) {
    
Kameron Kinsey's avatar
Kameron Kinsey committed
21
    getline(cin,seed);
Kameron Kinsey's avatar
Kameron Kinsey committed
22 23 24 25 26 27 28 29 30 31 32 33 34 35
    srand(seed);
    
    // Set Fight Stat and Modifier
    int fight = getFight();
    fight = rand() % 20 + 5;
    setFight(fight);
    
    // Set Talk Stat and Modifier
    int talk = getTalk();
    talk = rand() % 20 + 5;
    setTalk(talk);

}

Kameron Kinsey's avatar
Kameron Kinsey committed
36 37
void check

Kameron Kinsey's avatar
Kameron Kinsey committed
38 39
bool Player::checkVictory(bool playerWon) {
    if (playerWon == true) {
Kameron Kinsey's avatar
Kameron Kinsey committed
40 41
        cout << "Congratulations " << getPlayerName() << " you have retrieved the Maguffin of Vauge Desirability!" << endl;
    }
Kameron Kinsey's avatar
Kameron Kinsey committed
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 74 75 76 77 78 79 80 81
}

// int main() {
    
//     // Declare Character Details
//     int seed;
//     char command;
//     Player player;
//     string name = player.getPlayerName();
    
    
//     // Set Stats
//     player.setStats(seed);
    
//     // Enter Name
//     cout << "Enter Player Name: ";
//     getline(cin,name);
//     player.setPlayerName(name);
    
//     int health = player.getHealth();
//     int fight = player.getFight();
//     int talk = player.getTalk();
    
//     cout << name << "'s stats" << endl
//          << "========================" << endl
//          << "Health: " << health << endl
//          << "Fight: " << fight + item.getEquippedFight() << endl
//          << "Talk:  " << talk + item.getEquippedTalk() << endl
//          << "Item: " << item.getEquippedItemName() << endl;
          
//     cout << "Check inventory: i";
//     getline(cin,command);
    
//     if (command == 'i') {
//         item.listInventory();
//     }
    
//     return 0;
// }