Skip to content
Permalink
ac14ca3c3f
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
28 lines (23 sloc) 540 Bytes
#pragma once
#include <stdlib.h>
#include <string>
class Enemy
{
private:
int level;
int hp;
int hpMax;
int damageMin;
int damageMax;
float dropChance;
int defence;
int accuracy;
public:
Enemy();
virtual ~Enemy();
inline bool isAlive() { return this->hp > 0; }
std::string getAsString() const;
inline void takeDamage(int damage) { this->hp -= damage; };
inline int getGamage() const { return rand() % this->damageMax - this->damageMin; }
inline int getExp() const { return level * 100; }
};