- a few extra cards in Alara
- Added missing phaseRing files (sorry...)
This commit is contained in:
wagic.the.homebrew
2008-11-09 07:34:40 +00:00
parent 01d2110e8d
commit 62a7a0e211
4 changed files with 153 additions and 30 deletions

View File

@@ -93,6 +93,19 @@ subtype=Elf Scout
toughness=2
[/card]
[card]
text=Exalted (Whenever a creature you control attacks alone, that creature gets +1/+1 until end of turn.) {W}, {T}: Dawnray Archer deals 1 damage to target attacking or blocking creature.
abilities=exalted
auto={W}{T}:damage:1 target(creature[attacking;blocking])
id=175085
name=Dawnray Archer
rarity=U
type=Creature
mana={2}{U}
power=1
subtype=Human Archer
toughness=1
[/card]
[card]
text=First strike Shroud (This creature can't be the target of spells or abilities.)
abilities=first strike, shroud
id=175121
@@ -142,6 +155,18 @@ subtype=Elf Shaman
toughness=1
[/card]
[card]
text={2}{U}: Untap target artifact.
auto={2}{U}:untap target(artifact)
id=174888
name=Filigree Sages
rarity=U
type=Artifact Creature
mana={3}{U}
power=2
subtype=Vedalken Wizard
toughness=3
[/card]
[card]
text={T}: Add {G} to your mana pool.
auto={T}:Add {G}
id=174927
@@ -309,6 +334,15 @@ mana={2}{R}
subtype=Aura
[/card]
[card]
text={T}: You gain 1 life.
auto={T}:life:1
id=175249
name=Marble Chalice
rarity=C
type=Artifact
mana={2}{W}
[/card]
[card]
text={W}, {T}: Regenerate target artifact.
id=175113
auto={W},{T}:Regenerate target(artifact)

View File

@@ -342,17 +342,6 @@ subtype=Human Wizard
toughness=2
[/card]
[card]
text=Exalted (Whenever a creature you control attacks alone, that creature gets +1/+1 until end of turn.) {W}, {T}: Dawnray Archer deals 1 damage to target attacking or blocking creature.
id=175085
name=Dawnray Archer
rarity=U
type=Creature
mana={2}{U}
power=1
subtype=Human Archer
toughness=1
[/card]
[card]
text=Skeleton creatures you control and other Zombie creatures you control get +1/+1 and have deathtouch.
id=176430
name=Death Baron
@@ -561,17 +550,6 @@ subtype=Hydra Beast
toughness=0
[/card]
[card]
text={2}{U}: Untap target artifact.
id=174888
name=Filigree Sages
rarity=U
type=Artifact Creature
mana={3}{U}
power=2
subtype=Vedalken Wizard
toughness=3
[/card]
[card]
text=First strike Unearth {U}{B}{R} ({U}{B}{R}: Return this card from your graveyard to play. It gains haste. Remove it from the game at end of turn or if it would leave play. Unearth only as a sorcery.)
id=176447
name=Fire-Field Ogre
@@ -929,14 +907,6 @@ subtype=Ooze
toughness=1
[/card]
[card]
text={T}: You gain 1 life.
id=175249
name=Marble Chalice
rarity=C
type=Artifact
mana={2}{W}
[/card]
[card]
text=Master of Etherium's power and toughness are each equal to the number of artifacts you control. Other artifact creatures you control get +1/+1.
id=175114
name=Master of Etherium

View File

@@ -0,0 +1,34 @@
#ifndef _PHASERING_H_
#define _PHASERING_H_
#include <list>
using std::list;
/*
The class that handles the phases of a turn
*/
class Player;
class Phase{
public:
int id;
Player * player;
Phase(int _id, Player * _player):id(_id),player(_player){};
};
class PhaseRing{
public:
list<Phase *> ring;
list<Phase *>::iterator current;
Phase * getCurrentPhase();
Phase * forward();
Phase * goToPhase(int id, Player * player);
PhaseRing(Player* players[], int nbPlayers=2);
~PhaseRing();
int addPhase(Phase * phase);
int addPhaseBefore(int id, Player* player,int after_id, Player * after_player, int allOccurences = 1);
int removePhase (int id, Player * player, int allOccurences = 1);
};
#endif

View File

@@ -0,0 +1,85 @@
#include "../include/PhaseRing.h"
#include "../include/MTGDefinitions.h"
#include "../include/Player.h"
#include "../include/debug.h"
/* Creates a new phase ring with the default rules */
PhaseRing::PhaseRing(Player* players[], int nbPlayers){
for (int i = 0; i < nbPlayers; i++){
for (int j = 0; j <NB_MTG_PHASES; j++){
Phase * phase = NEW Phase(j,players[i]);
addPhase(phase);
}
}
current = ring.begin();
}
PhaseRing::~PhaseRing(){
list<Phase *>::iterator it;
for (it = ring.begin(); it != ring.end(); it++){
Phase * currentPhase = *it;
delete(currentPhase);
}
}
Phase * PhaseRing::getCurrentPhase(){
if (current == ring.end()){
current = ring.begin();
}
return *current;
}
Phase * PhaseRing::forward(){
if (current != ring.end()) current++;
if (current == ring.end()) current = ring.begin();
return *current;
}
Phase * PhaseRing::goToPhase(int id, Player * player){
Phase * currentPhase = *current;
while(currentPhase->id !=id || currentPhase->player !=player){ //Dangerous, risk for inifinte loop !
#ifdef WIN32
OutputDebugString("goto");
#endif
currentPhase = forward();
}
return currentPhase;
}
int PhaseRing::addPhase(Phase * phase){
ring.push_back(phase);
return 1;
}
int PhaseRing::addPhaseBefore(int id, Player* player,int after_id, Player * after_player, int allOccurences){
int result = 0;
list<Phase *>::iterator it;
for (it = ring.begin(); it != ring.end(); it++){
Phase * currentPhase = *it;
if (currentPhase->id == after_id && currentPhase->player == after_player){
result++;
ring.insert(it,NEW Phase(id,player));
if (!allOccurences) return 1;
}
}
return result;
}
int PhaseRing::removePhase (int id, Player * player, int allOccurences){
int result = 0;
list<Phase *>::iterator it = ring.begin();
while (it != ring.end()){
Phase * currentPhase = *it;
if (currentPhase->id == id && currentPhase->player == player){
if (current == it) current++; //Avoid our cursor to get invalidated
it = ring.erase(it);
delete(currentPhase);
result++;
if (!allOccurences) return 1;
}else{
it++;
}
}
return result;
}