-
Notifications
You must be signed in to change notification settings - Fork 3
/
Monster.cpp
48 lines (40 loc) · 930 Bytes
/
Monster.cpp
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
// Monster.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include <random>
#include "Monster.h"
using namespace std;
int Monster::getHitPoints()
{
return hitPoints;
}
int Monster::setHitPoints(int hitpoints) {
hitPoints = hitpoints;
}
int Monster::getAttackPower()
{
return attackPower;
}
void Monster::description() {
if (attackPower == 1) {
cout << "a hairy, mean looking ape." << endl;
}
else
{
cout << "a large ape with red glowing eyes." << endl;
}
}
int Monster::setInitialHitPoints() {
// Randomly generataes a number from 1 to 3
random_device rd;
mt19937 gen(rd());
uniform_int_distribution<> dis(1, 3);
return dis(gen);
}
int Monster::setAttackPower() {
// Randomly generataes a number from 1 to 2
random_device rd;
mt19937 gen(rd());
uniform_int_distribution<> dis(1, 10);
return dis(gen);
}