Skip to content
Permalink
master
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
#include <iostream>
//#include "eNames.cpp"
#include "enemy.hh"
using namespace std;
enemy::enemy()
{
/* idk somehting goes here coding is hard k bye */
/* so idk what to do with level i kinda want it to be a calculation */
/* using the dmg, def, hp and stm so the player will have an idea of */
/* how strong the enemy is before they fight them or somthing */
/* also id like the dmg def and hp to be random but scale with */
/* the players stats so the player is very op but also so the ai is */
/* also never op -harry */
name = "veryevilman";
dmg = 3;
def = 3;
hp = 5;
stm = 2;
level = dmg+def+hp+stm;
xCo = 7;
yCo = 7;
}
void enemy::sayStats()
{
/* returns the stats of a specified character including the position (x and y coordinate) */
cout << "My name is " << name << "\n"
<< "dmg: " << dmg << "\n"
<< "def: " << def << "\n"
<< "hp: " << hp << "\n"
<< "stm: " << stm << "\n"
<< "x: " << xCo << "\n"
<< "y: " << yCo << "\n"
<< endl;
}
int enemy::Stamina(int val)
{
/* stamina cannot go below 0 */
if ((stm - val) < 0)
{
return stm;
}
else
{
return stm - val;
}
}
/* changes player's damage
input is change in damage
output is new damage value */
int enemy::changeDmg(int val)
{
return dmg += val;
}
/* changes player's defence
input is change in defence
output is new defence value */
int enemy::changeDef(int val)
{
return def += val;
}
/* changes player's health
input is health change
output is new health value */
int enemy::health(int val)
{
if ((hp + val) < 0)
{
return 0;
}
else
{
return (hp + val);
}
}
void enemy::nextTurn()
{
stm = 5;
health(3);
}
int enemy::movement()
{
int i = 0;
if (stm==0)
{
return 0;
}
if (i==1)
{
yCo++;
}
else if (i==2)
{
xCo++;
}
else if (i==3)
{
yCo--;
}
else if (i==4)
{
xCo--;
}
else
{
i=0;
}
return(0);
}