-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathenchantments.cc
34 lines (27 loc) · 1.17 KB
/
enchantments.cc
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
#include <iostream>
#include <string>
#include "enchantments.h"
#include "ascii_graphics.h"
using namespace std;
Enchantments::Enchantments(string name, int cost, std::string description, Monster *component): Monster(name, cost, description), component{component}{}
Enchantments::~Enchantments(){
delete this->component;
}
void Enchantments::addComponent(Monster* m){
component = m;
}
void Enchantments::disenchant() {
component = nullptr;
}
Monster* Enchantments::getComponent() {
return component;
}
card_template_t Enchantments::getMonsterTemplate() const{
if (!this->component->getEffect() && this->getCompDescription() != "SILENCED") {
return display_minion_no_ability(this->getCompName(), this->getCompCost(), this->getAttack(), this->getDefense());
} else if (this->component->getTriggerType() == TriggerType::None) {
return display_minion_activated_ability(this->getCompName(), this->getCompCost(), this->getAttack(), this->getDefense(), this->getEffectCost(), this->getCompDescription());
} else {
return display_minion_triggered_ability(this->getCompName(), this->getCompCost(), this->getAttack(), this->getDefense(), this->getCompDescription());
}
}