- minor fix in Zethfox cards addon (Bad lines error from parser)
- Zethfox's patch for {t(target)} as an extra Cost. Works the same way as sacrifice, check Azami, Lady of Scrolls for an example
- fixed compilation on the PSP (sorry!)
This commit is contained in:
wagic.the.homebrew@gmail.com
2010-08-01 03:21:59 +00:00
parent f40af0b1cb
commit ce69e23357
10 changed files with 137 additions and 10 deletions
+11 -1
View File
@@ -3027,6 +3027,16 @@ power=7
toughness=3 toughness=3
[/card] [/card]
[card] [card]
name=Azami, Lady of Scrolls
auto={t(wizard[-tapped]|mybattle?field)}:draw:1 controller
text=Tap an untapped Wizard you control: Draw a card.
type=legendary creature
subtype=human wizard
power=0
toughness=2
mana={2}{U}{U}{U}
[/card]
[card]
name=Azimaet Drake name=Azimaet Drake
abilities=flying abilities=flying
auto={U}:1/0 limit:1 auto={U}:1/0 limit:1
@@ -48478,7 +48488,7 @@ auto=aslongas(*|myhand) damage:2 target(other creature) >=1
auto=aslongas(*|myhand) destroy <1 auto=aslongas(*|myhand) destroy <1
auto=aslongas(*|myhand) destroy target(other creature) <1 auto=aslongas(*|myhand) destroy target(other creature) <1
mana={3}{B}{R} mana={3}{B}{R}
text=Twinstrike deals 2 damage to each of two target creatures. -- Hellbent Destroy those creatures instead if you have no cards in hand. text=Twinstrike deals 2 damage to each of two target creatures. -- Hellbent EDestroy those creatures instead if you have no cards in hand.
type=Instant type=Instant
[/card] [/card]
[card] [card]
@@ -6687,8 +6687,7 @@ mana={u}
name=Palinchron name=Palinchron
auto=token(-12305)*7 auto=token(-12305)*7
auto={2}{U}{U}:moveto(myhand) all(this) auto={2}{U}{U}:moveto(myhand) all(this)
text= Flying text=Flying. When Palinchron enters the battlefield, untap up to seven lands.{2}{U}{U}: Return Palinchron to its owner's hand.
When Palinchron enters the battlefield, untap up to seven lands.{2}{U}{U}: Return Palinchron to its owner's hand.
type=creature type=creature
subtype=illusion subtype=illusion
abilities=flying abilities=flying
@@ -6757,8 +6756,7 @@ auto=@each myupkeep:aslongas(plains|mybattlefield) counter(0/0,1,fetch) >6 myupk
auto={c(0/0.-1.fetch)}:moveto(mybattlefield) target(creature|mygraveyard) limit:1 auto={c(0/0.-1.fetch)}:moveto(mybattlefield) target(creature|mygraveyard) limit:1
auto=@each mydraw:counter(0/0,-10,fetch) auto=@each mydraw:counter(0/0,-10,fetch)
auto={t}:add{w} auto={t}:add{w}
text=Emeria, the Sky Ruin enters the battlefield tapped. text=Emeria, the Sky Ruin enters the battlefield tapped. At the beginning of your upkeep, if you control seven or more Plains, you may return target creature card from your graveyard to the battlefield.
At the beginning of your upkeep, if you control seven or more Plains, you may return target creature card from your graveyard to the battlefield.
type=land type=land
mana={0} mana={0}
[/card] [/card]
@@ -6985,8 +6983,7 @@ auto={T}:Add{W}
auto=counter(0/0,1,Spire) auto=counter(0/0,1,Spire)
auto={1}:counter(0/0,-1,Spire) auto={1}:counter(0/0,-1,Spire)
auto=bury target(land[counter{0/0.1.spire}]|mybattlefield) auto=bury target(land[counter{0/0.1.spire}]|mybattlefield)
text=Rupture Spire enters the battlefield tapped. text=Rupture Spire enters the battlefield tapped. When Rupture Spire enters the battlefield, sacrifice it unless you pay {1}.have the {1} mana ready in your mana pool as you play this card.{T}: Add one mana of any color to your mana pool.
When Rupture Spire enters the battlefield, sacrifice it unless you pay {1}.have the {1} mana ready in your mana pool as you play this card.{T}: Add one mana of any color to your mana pool.
type=land type=land
mana={0} mana={0}
[/card] [/card]
+1
View File
@@ -55,6 +55,7 @@ generic/regenerate.txt
generic/regenerate_wither_i146.txt generic/regenerate_wither_i146.txt
generic/sacrifice.txt generic/sacrifice.txt
generic/summoning_sickness.txt generic/summoning_sickness.txt
generic/tap_other_card_as_cost.txt
generic/targetController_life.txt generic/targetController_life.txt
generic/targetController_life2.txt generic/targetController_life2.txt
generic/targetController_damage.txt generic/targetController_damage.txt
@@ -0,0 +1,28 @@
# Test: {t(target)} as an extra cost
# 78697 is Azami, Lady of Scrolls
# Tap an untapped Wizard you control: Draw a card.
[INIT]
FIRSTMAIN
[PLAYER1]
inplay:78697,Cathartic Adept
library:forest
[PLAYER2]
[DO]
78697
Cathartic Adept
next
#combat begins
next
#attackers
#if he is tapped, Cathartic Adept houldn't be able to attack
Cathartic Adept
next
#endofcombat
[ASSERT]
COMBATEND
[PLAYER1]
inplay:78697,Cathartic Adept
hand:forest
[PLAYER2]
life:20
[END]
+2
View File
@@ -559,6 +559,8 @@ public:
return "Sacrifice"; return "Sacrifice";
}else if (dest == g->players[i]->game->library && tc->targetsZone(g->players[i]->game->graveyard)){ }else if (dest == g->players[i]->game->library && tc->targetsZone(g->players[i]->game->graveyard)){
return "Recycle"; return "Recycle";
}else if (dest == g->players[i]->game->battlefield && tc->targetsZone(g->players[i]->game->graveyard)){
return "Reanimate";
}else if (dest == g->players[i]->game->library){ }else if (dest == g->players[i]->game->library){
return "Put in Library"; return "Put in Library";
}else if (dest == g->players[i]->game->graveyard && tc->targetsZone(g->players[i]->game->hand)){ }else if (dest == g->players[i]->game->graveyard && tc->targetsZone(g->players[i]->game->hand)){
+14
View File
@@ -55,6 +55,20 @@ public:
virtual SacrificeCost * clone() const; virtual SacrificeCost * clone() const;
}; };
//tap other cost
class TapTargetCost: public ExtraCost{
public:
MTGCardInstance * target;
TapTargetCost(TargetChooser *_tc = NULL);
virtual int setPayment(MTGCardInstance * card);
virtual int isPaymentSet();
virtual int canPay();
virtual int doPay();
virtual void Render();
virtual int setSource(MTGCardInstance * _source);
virtual TapTargetCost * clone() const;
};
class CounterCost: public ExtraCost{ class CounterCost: public ExtraCost{
public: public:
Counter * counter; Counter * counter;
+1 -1
View File
@@ -56,7 +56,7 @@ private:
}; };
//Why do we need this ? could it move somewhere else ? //Why do we need this ? could it move somewhere else ?
#if defined (LINUX) #if !defined (WIN32)
#define BYTE u8 #define BYTE u8
#define DWORD u32 #define DWORD u32
#endif #endif
+61
View File
@@ -20,7 +20,68 @@ int ExtraCost::setSource(MTGCardInstance * _source){
if (tc){ tc->source = _source; tc->targetter = _source;} if (tc){ tc->source = _source; tc->targetter = _source;}
return 1; return 1;
} }
//Tap target cost
TapTargetCost * TapTargetCost::clone() const{
TapTargetCost * ec = NEW TapTargetCost(*this);
if (tc) ec->tc = tc->clone();
return ec;
}
TapTargetCost::TapTargetCost(TargetChooser *_tc):ExtraCost(_tc){
if (tc) tc->targetter = NULL; //tapping targets is not targetting, protections do not apply
target = NULL;
}
int TapTargetCost::setSource(MTGCardInstance * card){
ExtraCost::setSource(card);
if (tc) tc->targetter = NULL; //Tapping targets is not targetting, protections do not apply
if (!tc) target = card;
return 1;
}
int TapTargetCost::setPayment(MTGCardInstance * card){
if (tc) {
int result = tc->addTarget(card);
if (result) {
target = card;
return result;
}
}
return 0;
}
int TapTargetCost::isPaymentSet(){
if (target) return 1;
return 0;
}
int TapTargetCost::canPay(){
//tap target does not have any additional restrictions.
return 1;
}
int TapTargetCost::doPay(){
MTGCardInstance * _target = (MTGCardInstance *) target;
if(target){
_target->tap();
target = NULL;
if (tc) tc->initTargets();
return 1;
}
return 0;
}
void TapTargetCost::Render(){
//TODO : real stuff
WFont * mFont = resources.GetWFont(Constants::MAIN_FONT);
mFont->SetScale(DEFAULT_MAIN_FONT_SCALE);
mFont->SetColor(ARGB(255,255,255,255));
char buffer[200];
sprintf(buffer, "%s", _("Tap Target").c_str());
mFont->DrawString(buffer, 20 ,20, JGETEXT_LEFT);
}
//endtaptargetcost
SacrificeCost * SacrificeCost::clone() const{ SacrificeCost * SacrificeCost::clone() const{
SacrificeCost * ec = NEW SacrificeCost(*this); SacrificeCost * ec = NEW SacrificeCost(*this);
if (tc) ec->tc = tc->clone(); if (tc) ec->tc = tc->clone();
+1 -1
View File
@@ -178,7 +178,7 @@ void GameStateOptions::Render()
"", "",
"Dev Team: Abrasax, almosthumane, Daddy32, Dr.Solomat" "Dev Team: Abrasax, almosthumane, Daddy32, Dr.Solomat"
"J, Jeck, Leungclj, linshier, Salmelo, Superhiro", "J, Jeck, Leungclj, linshier, Salmelo, Superhiro",
"Psyringe, Wololo, Yeshua", "Psyringe, Wololo, Yeshua, Zethfox",
"", "",
"Music by Celestial Aeon Project, http://www.jamendo.com", "Music by Celestial Aeon Project, http://www.jamendo.com",
"", "",
+14
View File
@@ -65,6 +65,20 @@ ManaCost * ManaCost::parseManaCost(string s, ManaCost * _manaCost, MTGCardInstan
tc = tcf.createTargetChooser(target,c); tc = tcf.createTargetChooser(target,c);
} }
manaCost->addExtraCost(NEW SacrificeCost(tc)); manaCost->addExtraCost(NEW SacrificeCost(tc));
//tap cost
}else if (value[0] == 't'){
//tap
OutputDebugString("Tap\n");
TargetChooserFactory tcf;
TargetChooser * tc = NULL;
size_t target_start = value.find("(");
size_t target_end = value.find(")");
if (target_start!=string::npos && target_end!=string::npos){
string target = value.substr(target_start+1, target_end-1 - target_start);
tc = tcf.createTargetChooser(target,c);
}
manaCost->addExtraCost(NEW TapTargetCost(tc));
//tapcost
}else if (value[0] == 'c'){ }else if (value[0] == 'c'){
//Counters //Counters
OutputDebugString("Counter\n"); OutputDebugString("Counter\n");