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 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169
|
#include <stdio.h>
#include <math.h>
#include <cstdlib>
#include <iostream>
#include <string>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <windows.h>
#include "Item.h"
#include "Title.h"
#include "Equipment.h"
#include "Magic.h"
#include "hub.h"
using namespace std;
class Entity
{
public://protected:
std::string m_name;
//std::string m_cname;
int m_health;
int m_health_max;
int m_level;
int m_urank;
int m_rage;
int m_rage_max;
//public:
PlayerInventory inventory;
Equipment* equipment;
Title mname;
Magic magic;
Entity(){}
Entity(const char * name, int health, int level)
{
m_name = name;
m_health = health;
m_health_max = health;
m_level = level;
equipment = new Equipment();
}
virtual ~Entity(){}
std::string get_name(){ return m_name; }
int get_health() { return m_health; }
int get_mhealth(){ return m_health_max; }
int get_rage() { return m_rage; }
int get_mrage(){ return m_rage_max; }
virtual int dmg_modifier(int stat)
{
int dmg = (stat - 10)/2;
if (dmg <= 0)
dmg = 0;
return dmg;
}
};
class MainCharacter;
class Enemy: public Entity
{
public:
Enemy(const char * name, int health, int level,int str, int def, int dex, int skl, int sol, int intel, int spd, int block, int crit, int mrank): Entity(name,health,level)
{
m_mana_max = 2*sol;
m_mana = 2*sol;
m_str=str;
m_def=def;
m_dex=dex;
m_skl=skl;
m_sol=sol;
m_int=intel;
m_spd=spd;
m_block=block;
m_crit=crit;
magic.m_rank=mrank;
m_xp = m_health_max+((m_health_max*(m_level))/20);
m_gold = m_xp - (m_health_max/2.0);
m_rage = 0;
m_rage_max = (m_health_max/2.0);
m_urank = (m_level/5);
if (m_level == 0)
m_urank = 0;
}
virtual ~Enemy(){}
void Attack(MainCharacter & target);
void take_damage(int damage)
{
m_health -= damage;
if (m_urank > 0)
{
m_rage+=damage;
if (m_rage > m_rage_max)
m_rage=m_rage_max;
}
}
int get_health() { return m_health; }
//protected:
int m_xp;
int m_gold;
int m_mana;
int m_mana_max;
int m_str;
int m_def;
int m_dex;
int m_skl;
int m_sol;
int m_int;
int m_spd;
int m_block;
int m_crit;
};
class Mob: public Enemy
{
//Normal Enemies
public:
Mob(const char * name, int health, int level,int str, int def, int dex, int skl,
int sol, int intel, int spd, int block, int crit, int mrank) : Enemy(name,health,level,str,def,dex,skl,sol,intel,spd,block,crit,mrank)
{
}
};
class Boss: public Enemy
{
//Generic Boss Class
};
class SubBoss: public Boss
{
//a quarter of the way to Story Boss
};
class MidBoss: public Boss
{
//a halfway point to the Story Boss
};
class StoryBoss: public Boss
{
//Story Boss
};
class NPC: public Entity
{
//Parent Class of Non-Playable Characters:
//Possible Recruitment on MC(Main Character)'s team?
};
class ShopKeeper: public NPC
{
// Faun
};
class SpecCharacter: public NPC
{
// Corrupted Enemies...
};
|