Files

52 lines
917 B
C++

#pragma once
#include <iomanip>
#include <iostream>
#include <math.h>
#include <string>
#include <vector>
enum DmgType { SINGLE, MULTI };
struct Stat {
int statID;
float stat;
};
struct Stats {
float hp;
float speed;
float magic;
float defense;
};
struct RoomInfo {
int roomID;
int x, y;
};
class Creature {
protected:
int id = -1;
int level = 0;
Stats stats = {};
// std::map<std::string, Stat> stats;
std::string name;
std::string description;
public:
virtual void Init() = 0;
virtual void LevelUp() = 0;
virtual void Die() = 0;
virtual void TakeDamage(int damageType, float damage) = 0;
virtual float GetHealth() = 0;
bool IsAlive() { return GetHealth() > 0; }
void PrintDescription() { printf("%s\n", description.c_str()); }
void PrintName() { printf("%s\n", name.c_str()); }
virtual ~Creature() = default;
};