Код
// rpg v0.1.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
#include <time.h>
#include <Windows.h>
#include <string>
using namespace std;
struct Human abstract
{
string name;
int HP;
int MP;
int damage;
};
struct Warrior abstract
{
int distanceAttack;
};
struct Archer abstract
{
public:
Archer();
~Archer();
protected:
int distanceAttack = 30;
};
struct HeavyCavalry abstract : Human
{
int armor = 40;
int mobility = 18;
int criticalDamage = 0.3;
};
struct LightCavalry abstract : Human
{
int armor = 15;
int mobility = 25;
int criticalDamage = 0.4;
};
struct HeavyInfantry abstract : Human
{
int armor = 32;
int mobility = 10;
int criticalDamage = 0.2;
};
struct LightInfantry abstract : Human
{
int armor = 7;
int mobility = 16;
int criticalDamage = 0.35;
};
class LongbowArcher;
class Arbalester;
void battle();
int main()
{
return 0;
}
void battle(){
}
class LongbowArcher : public LightInfantry, public Archer
{
public:
LongbowArcher();
~LongbowArcher();
friend void battle();
};
LongbowArcher::LongbowArcher()
{
this->name = "LongbowArcher";
this->HP = 200;
this->MP = 0;
this->damage = 120;
}
LongbowArcher::~LongbowArcher()
{
}
class Arbalester : public HeavyInfantry, public Archer
{
public:
Arbalester();
~Arbalester();
};
Arbalester::Arbalester()
{
this->name = "Arbalester";
this->HP = 250;
this->MP = 0;
this->damage = 180;
}
Arbalester::~Arbalester()
{
}