Hello, looking for help in implementing a game. I don't know if anyone is familiar with it. No Third Libraries allowed. I've been on it for 3 weeks and I've been getting a lot of errors. Researching everything and looking for all the help I can get. Keep in mind I am a not that experienced in OOP.
#include "Cards.h"
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
Cards::Cards(string Name) :
CardName(Name),
CardType(""),
CardManaCost(""),
CardAttackPower(0),
CardHP(0),
isAlive(true),
CardAbility(""),
CardHasAbiity(false),
CardHasEffect(false),
CardIsDrawn(false),
CardInHand(0)
{
}
void Cards::DecreaseHP(unsigned int DamageRecieved)
{
if (DamageRecieved >= CardHP)
{
CardHP = 0;
isAlive = false;
cout << "Card " << CardName << " Died" << endl;
}
else
{
CardHP -= DamageRecieved;
cout << "Card " << CardName << " Got Damage " << DamageRecieved << endl;
}
}
void Cards::shuffle()
{
random_shuffle(cards.begin(), cards.end());
}
void Cards::DrawCard()
{
if (CardIsDrawn)
{
Cards result = cards.back();
cards.pop_back();
cout << "Card Drawn" << endl;
}
else
{
cout << "You Can't Draw a Card Right Now!" << endl;
}
}
void Cards::PrintInformation()
{
cout << "Name Mana Cost CardType Card Color " << endl;
cout << CardName << " " << CardManaCost << " " << CardType << " " << CardColor << endl;
if (!isAlive)
{
cout << CardName << " Is Dead.." << endl;
}
}
void MyCards::printMyCardsInfo()
{
cout << "Name Mana Cost CardType Card Color " << endl;
cout << CardName << " " << CardManaCost << " " << CardType << " " << CardColor << endl;
if (!isAlive)
{
cout << CardName << " Is Dead.." << endl;
}
}
bool MyCards::Attack(int SkillDamage, OpponentCards& Target, vector<MyCards> myCards)
{
MyCards foo;
if (CardAttackPower < CardHP)
{
CardHP -= CardAttackPower;
return true;
}
else
{
}
}
MyCards::MyCards(string name, string manaCost, string Cardcolor, string cardType, int AP, int HP)
{
if (CardType == "Land Card")
{
name = CardName;
manaCost = CardManaCost;
}
else
{
name = CardName;
manaCost = CardManaCost;
cardType = CardType;
Cardcolor = CardColor;
AP = CardAttackPower;
}
}
OpponentCards::OpponentCards(string name, string manaCost, string Cardcolor, string cardType, int AP, int HP)
{
if (CardType == "Land Card")
{
name = CardName;
manaCost = CardManaCost;
}
else
{
name = CardName;
manaCost = CardManaCost;
cardType = CardType;
Cardcolor = CardColor;
AP = CardAttackPower;
}
}
landCard::landCard(string name, string cardType, string manaCost)
{
name = CardName;
cardType = "Land Card";
cardType = CardType;
manaCost = CardManaCost;
}
CreatureCard::CreatureCard(string name, string manaCost, int AP, int HP, string ability, string cardColor, string cardType)
{
name = CardName;
manaCost = CardManaCost;
cardType = CardType;
cardColor = CardColor;
AP = CardAttackPower;
}
bool CreatureCard::DoesCreatureHaveAbilty(string CardName)
{
if (CardName == "White Knight" || CardName == "Black Knight")
{
CardHasAbiity = true;
CardAbility == "First Strike";
}
else if (CardName == "Angry Bear" || CardName == "Werewolf")
{
CardHasAbiity = true;
CardAbility == "Trample";
}
}
SorceryCards::SorceryCards(string Cardname, string manaCost, string color, string effect, string Type)
{
Cardname = CardName;
manaCost = CardManaCost;
color = CardColor;
effect = Effect;
Type == "Sorcery Card";
Type = CardType;
}
EnchantmentCards::EnchantmentCards(string name, string manaCost, string cardcolor, string effect, string type)
{
name = CardName;
manaCost = CardManaCost;
cardcolor = CardColor;
effect = Effect;
type == "Enchantment Card";
type = CardType;
}
I don't think I need to add my header file since the functions are all here in the cpp file.
The problem is nothing is being initilized and I can't seem to figure out the turn function.