Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <string>
- #include <iostream>
- #include <cstdlib>
- #include "creature.h"
- #include <ctime>
- using namespace std;
- /////////////////////////////////////////////////////
- creature::creature()
- {
- strength = 10;
- hitpoints = 10;
- }
- creature::creature(int inStrength, int inHitpoints)
- {
- strength = inStrength;
- hitpoints = inHitpoints;
- }
- int creature::getDamage() const
- {
- int damage = (rand() % strength) + 1;
- return damage;
- }
- string creature::getSpecies() const
- {
- return "creature";
- }
- int creature::getStrength() const
- {
- return strength;
- }
- int creature::getHitpoints() const
- {
- return hitpoints;
- }
- void creature::setStrength(int newStrength)
- {
- strength = newStrength;
- }
- void creature::setHitpoints(int newHitpoints) {
- hitpoints = newHitpoints;
- }
- /////////////////////////////////////////////////////
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement