Erwan
- (Finally) adding "must" abilities. Usage is as natural as possible, check Aven cloudchaser in 10E.
This commit is contained in:
@@ -37,7 +37,7 @@ class ActionLayer: public GuiLayer, public JGuiListener{
|
||||
int reactToClick(ActionElement * ability,MTGCardInstance * card);
|
||||
int reactToTargetClick(ActionElement * ability,Targetable * card);
|
||||
int stillInUse(MTGCardInstance * card);
|
||||
void setMenuObject(Targetable * object);
|
||||
void setMenuObject(Targetable * object, bool must = false);
|
||||
void ButtonPressed(int controllerid, int controlid);
|
||||
void doReactTo(int menuIndex);
|
||||
TargetChooser * getCurrentTargetChooser();
|
||||
@@ -47,6 +47,7 @@ class ActionLayer: public GuiLayer, public JGuiListener{
|
||||
int cleanGarbage();
|
||||
protected:
|
||||
ActionElement * currentWaitingAction;
|
||||
int cantCancel;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -267,9 +267,10 @@ class AAFizzler:public ActivatedAbility{
|
||||
class MayAbility:public MTGAbility{
|
||||
public:
|
||||
int triggered;
|
||||
bool must;
|
||||
MTGAbility * ability;
|
||||
MTGAbility * mClone;
|
||||
MayAbility(int _id, MTGAbility * _ability, MTGCardInstance * _source):MTGAbility(_id,_source),ability(_ability){
|
||||
MayAbility(int _id, MTGAbility * _ability, MTGCardInstance * _source, bool must = false):MTGAbility(_id,_source),must(must),ability(_ability){
|
||||
triggered = 0;
|
||||
mClone = NULL;
|
||||
}
|
||||
@@ -279,7 +280,10 @@ public:
|
||||
MTGAbility::Update(dt);
|
||||
if (!triggered){
|
||||
triggered = 1;
|
||||
game->mLayers->actionLayer()->setMenuObject(source);
|
||||
if (TargetAbility * ta = dynamic_cast<TargetAbility *>(ability)){
|
||||
if (!ta->tc->validTargetsExist()) return;
|
||||
}
|
||||
game->mLayers->actionLayer()->setMenuObject(source,must);
|
||||
game->mLayers->stackLayer()->setIsInterrupting(source->controller());
|
||||
OutputDebugString("ALLABILITIES SetMenuObject!\n");
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ class TargetChooser: public TargetsList {
|
||||
MTGCardInstance * targetter; //Optional, usually equals source, used for protection from...
|
||||
|
||||
int maxtargets; //Set to -1 for "unlimited"
|
||||
|
||||
bool validTargetsExist();
|
||||
virtual int setAllZones(){return 0;}
|
||||
virtual bool targetsZone(MTGGameZone * z){return false;};
|
||||
int ForceTargetListReady();
|
||||
|
||||
Reference in New Issue
Block a user