Files
wagic/projects/mtg/include/Damage.h
jean.chalard 3349f974f1 J :
* New interface.
* This breaks a lot of things. It is not feature-equivalent. It
  probably doesn't compile under windows and doesn't work on PSP.
* Damage is not resolved any more. This will have to be fixed.
* Blockers can't be ordered any more. This will have to be fixed.
* A lot of new art is included.
2009-08-22 05:59:43 +00:00

60 lines
1.3 KiB
C++

#ifndef _DAMAGE_H_
#define _DAMAGE_H_
#include <JGui.h>
#include "GuiLayers.h"
#include "ActionStack.h"
class GuiLayer;
class JGuiObject;
class MTGCardInstance;
class GameObserver;
#define DAMAGEABLE_MTGCARDINSTANCE 0
#define DAMAGEABLE_PLAYER 1
class Damageable:public Targetable {
protected:
public:
int life;
int type_as_damageable;
Damageable(int _life){life=_life;};
int getLife(){return life;};
virtual int dealDamage(int damage){life-=damage;return life;};
virtual int afterDamage(){return 0;}
virtual JQuad * getIcon(){return NULL;};
};
class Damage: public Interruptible {
protected:
void init(MTGCardInstance * source, Damageable * target, int damage);
public:
Damageable * target;
int damage;
void Render();
Damage(int id, MTGCardInstance* source, Damageable * target);
Damage(int id, MTGCardInstance* source, Damageable * target, int damage);
int resolve();
virtual ostream& toString(ostream& out) const;
};
class DamageStack :public GuiLayer, public Interruptible{
protected:
int currentState;
GameObserver* game;
public:
int resolve();
void Render();
int CombatDamages();//Deprecated ?
int CombatDamages(int strike);
virtual ostream& toString(ostream& out) const;
DamageStack(GameObserver* game);
};
#endif