Laurent - Updated discard function now function with cost & target (see update from MRD) - Note that this is the discard random function....
Did not try it yet without target (e.g. when comes intoplay auto=discard:19 probably will not work and would make the opponent discard a card randomnly...
This commit is contained in:
@@ -2650,6 +2650,27 @@ class ADeplete:public TargetAbility{
|
||||
|
||||
};
|
||||
|
||||
|
||||
class ADiscard:public TargetAbility{
|
||||
public:
|
||||
int nbcards;
|
||||
ADiscard(int _id, MTGCardInstance * card, ManaCost * _cost, int _nbcards = 1,TargetChooser * _tc = NULL, int _tap = 1):TargetAbility(_id,card, _tc, _cost,0,_tap){
|
||||
if (!tc) tc= NEW PlayerTargetChooser(card);
|
||||
nbcards = _nbcards;
|
||||
}
|
||||
int resolve(){
|
||||
Player * player = tc->getNextPlayerTarget();
|
||||
if (!player) return 0;
|
||||
for (int i = 0; i < 2; i++){
|
||||
game->players[i]->game->discardRandom(game->players[i]->game->hand);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
const char * getMenuText(){
|
||||
return "Discard";
|
||||
}
|
||||
};
|
||||
|
||||
// Generic Karma
|
||||
class ADamageForTypeControlled: public TriggeredAbility{
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user