Files
wagic/projects/mtg/include/ActionLayer.h
omegablast2002@yahoo.com ca3dc49d71 added basic card draw replacement,
auto=replacedraw choice damage:2

auto=replacedraw choice draw:2 noreplace

notice noreplace exempts the draw from sending a draw event. draw events and drawn events are seperate events.

added dredge and it's rules.

[card]
name=Dakmor Salvage
auto=tap
auto={t}:add{b}
dredge=dredge(2)
text=Dakmor Salvage enters the battlefield tapped. -- {T}: Add {B} to your mana pool. -- Dredge 2 (If you would draw a card, instead you may put exactly two cards from the top of your library into your graveyard. If you do, return this card from your graveyard to your hand. Otherwise, draw a card.)
type=Land
[/card]
2013-01-20 20:13:07 +00:00

70 lines
2.2 KiB
C++

/*
* Wagic, The Homebrew ?! is licensed under the BSD license
* See LICENSE in the Folder's root
* http://wololo.net/wagic/
*/
#ifndef _ACTIONLAYER_H_
#define _ACTIONLAYER_H_
#include "GuiLayers.h"
#include "ActionElement.h"
#include "SimpleMenu.h"
#include "MTGAbility.h"
#include <set>
class GuiLayer;
class Targetable;
class WEvent;
class ActionLayer: public GuiLayer, public JGuiListener
{
public:
vector<ActionElement *> garbage;
Targetable * menuObject;
SimpleMenu * abilitiesMenu;
SimpleMenu * abilitiesTriggered;
MTGCardInstance * currentActionCard;
int stuffHappened;
virtual void Render();
virtual void Update(float dt);
bool CheckUserInput(JButton key);
ActionLayer(GameObserver *observer);
~ActionLayer();
int cancelCurrentAction();
ActionElement * isWaitingForAnswer();
int isReactingToTargetClick(Targetable * card);
int receiveEventPlus(WEvent * event);
int reactToTargetClick(Targetable * card);
int isReactingToClick(MTGCardInstance * card);
bool getMenuIdFromCardAbility(MTGCardInstance *card, MTGAbility *ability, int& menuId);
int reactToClick(MTGCardInstance * card);
int reactToClick(ActionElement * ability, MTGCardInstance * card);
int reactToTargetClick(ActionElement * ability, Targetable * card);
int stillInUse(MTGCardInstance * card);
void setMenuObject(Targetable * object, bool must = false);
void setCustomMenuObject(Targetable * object, bool must = false,vector<MTGAbility*>abilities = vector<MTGAbility*>(),string customName = "");
void ButtonPressed(int controllerid, int controlid);
void ButtonPressedOnMultipleChoice(int choice = -1);
void doReactTo(int menuIndex);
TargetChooser * getCurrentTargetChooser();
void setCurrentWaitingAction(ActionElement * ae);
MTGAbility * getAbility(int type);
int checkCantCancel(){return cantCancel;};
//Removes from game but does not move the element to garbage. The caller must take care of deleting the element.
int removeFromGame(ActionElement * e);
bool moveToGarbage(ActionElement * e);
void cleanGarbage();
protected:
ActionElement * currentWaitingAction;
int cantCancel;
std::set<ActionElement*> mReactions;
};
#endif