Erwan
- Magic 2010: Combat Damages don't go on the stack anymore - Comp rules: "goes to graveyard" effects don't go on the stack anymore - Regenerate "fixed" (untested) - Basic "ReplacementEffect" mechanism for damage prevention. Can be extended to other replacement effects with some limits. - TODO: Damages don't go on the stack, the abilities that create them do.
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
#ifndef _REPLACEMENT_EFFECTS_H_
|
||||
#define _REPLACEMENT_EFFECTS_H_
|
||||
|
||||
#include <list>
|
||||
using namespace std;
|
||||
#include "WEvent.h"
|
||||
|
||||
class TargetChooser;
|
||||
|
||||
class ReplacementEffect {
|
||||
public:
|
||||
virtual WEvent * replace (WEvent * e) {return e;};
|
||||
virtual ~ReplacementEffect(){};
|
||||
};
|
||||
|
||||
class REDamagePrevention: public ReplacementEffect {
|
||||
protected:
|
||||
TargetChooser * tcSource;
|
||||
TargetChooser * tcTarget;
|
||||
int damage;
|
||||
bool oneShot;
|
||||
public:
|
||||
REDamagePrevention(TargetChooser *_tcSource = NULL,TargetChooser *_tcTarget = NULL, int _damage = -1, bool _oneShot = true);
|
||||
WEvent * replace (WEvent *e);
|
||||
~REDamagePrevention();
|
||||
};
|
||||
|
||||
class ReplacementEffects {
|
||||
protected:
|
||||
list<ReplacementEffect *>modifiers;
|
||||
public:
|
||||
ReplacementEffects();
|
||||
WEvent * replace(WEvent *e);
|
||||
int add(ReplacementEffect * re);
|
||||
int remove (ReplacementEffect * re);
|
||||
~ReplacementEffects();
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user