Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
stephaniewhoo authored Jan 11, 2018
1 parent 81fa8c7 commit 0b31bf6
Show file tree
Hide file tree
Showing 66 changed files with 2,845 additions and 0 deletions.
22 changes: 22 additions & 0 deletions GiantStre.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#include "GiantStre.h"
#include <iostream>
using namespace std;

GiantStre::GiantStre(Player *owner): Enchantment{ "Giant Strength", "Enchantment", "", 1, owner, 2, 2 } {}

GiantStre::~GiantStre(){}

void GiantStre::activate(shared_ptr<Card> c) {
cout<< "activating Giant Strength" << endl;
int points = c->getAttack() + 2;
c->setAttack(points);
points = c->getDefence() + 2;
c->setDefence(points);
}
void GiantStre::deactivate(shared_ptr<Card> c) {
cout << "deactivate Giant strength" << endl;
int points = c->getAttack() - 2;
c->setAttack(points);
points = c->getDefence() - 2;
c->setDefence(points);
}
13 changes: 13 additions & 0 deletions GiantStre.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#ifndef MAGFAT_H
#define MAGFAT_H
#include "enchantment.h"

class GiantStre :public Enchantment {
public:
GiantStre(Player *owner);
~GiantStre();
void activate(std::shared_ptr<Card> c) override;
void deactivate(std::shared_ptr<Card> c) override;
};
#endif // !MAGFAT_H

16 changes: 16 additions & 0 deletions MagicFati.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#include "MagicFati.h"
using namespace std;

MagicFati::MagicFati(Player *owner): Enchantment{ "Magic Fatigue", "Enchantment", "Enchanted minion's activated ability costs 2 more", 0, owner, 0, 0 } {}

MagicFati::~MagicFati(){}

void MagicFati::activate(shared_ptr<Card> c){
int cost = c->getAbCost() + 2;
c->setAbCost(cost);
}

void MagicFati::deactivate(shared_ptr<Card> c) {
int cost = c->getAbCost() - 2;
c->setAbCost(cost);
}
13 changes: 13 additions & 0 deletions MagicFati.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#ifndef MAGICFATI_H
#define MAGICFATI_H
#include "enchantment.h"

class MagicFati :public Enchantment {
public:
MagicFati(Player *owner);
~MagicFati();
void activate(std::shared_ptr<Card> c) override;
void deactivate(std::shared_ptr<Card> c) override;
};
#endif // !MAGICFATI_H

14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
CXX = g++-5
CXXFLAGS = -std=c++14 -Werror=vla
EXEC = sorcery
OBJECTS = ascii_graphics.o board.o card.o deck.o main.o minion.o player.o ritual.o spell.o enchantment.o textdisplay.o airelem.o apprentice.o auraofpower.o banish.o blizzard.o bonegolem.o darkritual.o disenchant.o earthelem.o enrage.o fireelem.o GiantStre.o haste.o MagicFati.o massum.o novice.o potionsell.o raisedead.o recharge.o Silence.o standstill.o unsummon.o
DEPENDS = ${OBJECTS.o: .d}

${EXEC}: ${OBJECTS}
${CXX} ${CXXFLAGS} ${OBJECTS} -o ${EXEC}
-include ${DEPENDS}

.PHONY: clean

clean:
rm ${OBJECTS} ${EXEC} ${DEPENDS}
15 changes: 15 additions & 0 deletions Silence.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#include "Silence.h"
#include <iostream>
using namespace std;

Silence::Silence(Player *owner): Enchantment{ "Silence", "Enchantment", "Enchanted minion cannot use abilities", 1, owner, 0, 0 } {}

Silence::~Silence() {}

void Silence::activate(shared_ptr<Card> c) {
cout<<"using silence"<<endl;
c->silence();
}

void Silence::deactivate(shared_ptr<Card> c) {
}
13 changes: 13 additions & 0 deletions Silence.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#ifndef SILENCE_H
#define SILENCE_H
#include "enchantment.h"

class Silence :public Enchantment {
public:
Silence(Player *owner);
~Silence();
void activate(std::shared_ptr<Card> c) override;
void deactivate(std::shared_ptr<Card> c) override;
};
#endif // !SILENCE_H

14 changes: 14 additions & 0 deletions airelem.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#include "airelem.h"
#include <iostream>
using namespace std;

AirElem:: AirElem(Player *owner):
Minion{"Air Elemental","Minion","",0,owner,1,1,0}{}

AirElem::~AirElem(){}

void AirElem::activate(){}

void AirElem::activate(shared_ptr<Card> target){}

void AirElem::notify(const string event){}
21 changes: 21 additions & 0 deletions airelem.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#ifndef AIRELEM_H
#define AIRELEM_H
#include "player.h"
#include "card.h"
#include "minion.h"
#include <string>

class AirElem : public Minion {
public:
AirElem(Player *owner);
~AirElem();
void activate() override;
void activate(std::shared_ptr<Card>) override;
void notify(const std::string event) override;
};




#endif

23 changes: 23 additions & 0 deletions apprentice.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#include "apprentice.h"
#include "airelem.h"
#include <iostream>
using namespace std;

AppSum:: AppSum(Player *owner):
Minion{"Apprentice Summoner","Minion","Summon a 1/1 air elemental",1,owner,1,1,1}{}

AppSum::~AppSum(){}

void AppSum::activate(){
if (actionpts <= 0) return;
--actionpts;
if (owner->getMagic() >= abCost && !isSilence && owner->getMinion().size()<5){
owner->getMinion().push_back(make_shared<AirElem>(owner));
owner->subMagic(abCost);
}
}

void AppSum::activate(shared_ptr<Card> target){}

void AppSum::notify(const string event){}

18 changes: 18 additions & 0 deletions apprentice.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#ifndef APPRENTICE_H
#define APPRENTICE_H
#include "player.h"
#include "card.h"
#include "minion.h"

class AppSum : public Minion {
public:
AppSum(Player *owner);
~AppSum();
void activate() override;
void activate(std::shared_ptr<Card>) override;
void notify(const std::string event) override;
};


#endif

Loading

0 comments on commit 0b31bf6

Please sign in to comment.