c8333e76b1
- Updated Parser mechanism. Right now this doesn't change functionalities much, but should be more readable, and make it easier to code some new abilities in the future - Fixed regenerate, broken with r532 - Death Ward now works - I think "&&" now works with all abilities, needs to be tested...
37 lines
831 B
C++
37 lines
831 B
C++
#include "../include/ActionElement.h"
|
|
#include "../include/MTGCardInstance.h"
|
|
#include "../include/Targetable.h"
|
|
#include "../include/TargetChooser.h"
|
|
|
|
ActionElement::ActionElement(int id):JGuiObject(id){
|
|
activeState = INACTIVE;
|
|
modal = 0;
|
|
waitingForAnswer = 0;
|
|
currentPhase = -1;
|
|
newPhase = -1;
|
|
tc = NULL;
|
|
isClone = 0;
|
|
}
|
|
|
|
ActionElement::~ActionElement(){
|
|
if (!isClone){
|
|
SAFE_DELETE(tc);
|
|
}
|
|
}
|
|
|
|
int ActionElement::getActivity(){
|
|
|
|
return activeState;
|
|
}
|
|
|
|
|
|
int ActionElement::isReactingToTargetClick(Targetable * object){
|
|
if (object && object->typeAsTarget() == TARGET_CARD) return isReactingToClick((MTGCardInstance *)object);
|
|
return 0;
|
|
}
|
|
|
|
int ActionElement::reactToTargetClick(Targetable * object){
|
|
if (object->typeAsTarget() == TARGET_CARD) return reactToClick((MTGCardInstance *)object);
|
|
return 0;
|
|
}
|