Implement basic rooms and navigation
This commit is contained in:
+37
-27
@@ -1,41 +1,51 @@
|
||||
#pragma once
|
||||
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
#include <iostream>
|
||||
#include <math.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
enum DmgType {SINGLE, MULTI};
|
||||
enum DmgType { SINGLE, MULTI };
|
||||
|
||||
struct Stat
|
||||
{
|
||||
int statID;
|
||||
std::string statName;
|
||||
float stat;
|
||||
struct Stat {
|
||||
int statID;
|
||||
float stat;
|
||||
};
|
||||
|
||||
class Creature
|
||||
{
|
||||
protected:
|
||||
int id;
|
||||
int level;
|
||||
std::vector<Stat> stats;
|
||||
std::string name;
|
||||
std::string description;
|
||||
struct Stats {
|
||||
float hp;
|
||||
float speed;
|
||||
float magic;
|
||||
float defense;
|
||||
};
|
||||
|
||||
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;
|
||||
struct RoomInfo {
|
||||
int roomID;
|
||||
int x, y;
|
||||
};
|
||||
|
||||
|
||||
bool IsAlive() { return GetHealth() > 0; }
|
||||
|
||||
void PrintDescription() { printf("%s\n", description); }
|
||||
void PrintName() { printf("%s\n", name); }
|
||||
class Creature {
|
||||
protected:
|
||||
int id = -1;
|
||||
int level = 0;
|
||||
Stats stats = {};
|
||||
// std::map<std::string, Stat> stats;
|
||||
std::string name;
|
||||
std::string description;
|
||||
|
||||
virtual ~Creature() = default;
|
||||
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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user