- 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
[/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
abilities=flying
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 target(other creature) <1
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
[/card]
[card]
@@ -6687,8 +6687,7 @@ mana={u}
name=Palinchron
auto=token(-12305)*7
auto={2}{U}{U}:moveto(myhand) all(this)
text= Flying
When Palinchron enters the battlefield, untap up to seven lands.{2}{U}{U}: Return Palinchron to its owner's hand.
text=Flying. When Palinchron enters the battlefield, untap up to seven lands.{2}{U}{U}: Return Palinchron to its owner's hand.
type=creature
subtype=illusion
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=@each mydraw:counter(0/0,-10,fetch)
auto={t}:add{w}
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.
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.
type=land
mana={0}
[/card]
@@ -6985,8 +6983,7 @@ auto={T}:Add{W}
auto=counter(0/0,1,Spire)
auto={1}:counter(0/0,-1,Spire)
auto=bury target(land[counter{0/0.1.spire}]|mybattlefield)
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.
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.
type=land
mana={0}
[/card]
+1
View File
@@ -55,6 +55,7 @@ generic/regenerate.txt
generic/regenerate_wither_i146.txt
generic/sacrifice.txt
generic/summoning_sickness.txt
generic/tap_other_card_as_cost.txt
generic/targetController_life.txt
generic/targetController_life2.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";
}else if (dest == g->players[i]->game->library && tc->targetsZone(g->players[i]->game->graveyard)){
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){
return "Put in Library";
}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;
};
//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{
public:
Counter * counter;
+1 -1
View File
@@ -56,7 +56,7 @@ private:
};
//Why do we need this ? could it move somewhere else ?
#if defined (LINUX)
#if !defined (WIN32)
#define BYTE u8
#define DWORD u32
#endif
+61
View File
@@ -20,7 +20,68 @@ int ExtraCost::setSource(MTGCardInstance * _source){
if (tc){ tc->source = _source; tc->targetter = _source;}
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 * ec = NEW SacrificeCost(*this);
if (tc) ec->tc = tc->clone();
+1 -1
View File
@@ -178,7 +178,7 @@ void GameStateOptions::Render()
"",
"Dev Team: Abrasax, almosthumane, Daddy32, Dr.Solomat"
"J, Jeck, Leungclj, linshier, Salmelo, Superhiro",
"Psyringe, Wololo, Yeshua",
"Psyringe, Wololo, Yeshua, Zethfox",
"",
"Music by Celestial Aeon Project, http://www.jamendo.com",
"",
+15 -1
View File
@@ -65,7 +65,21 @@ ManaCost * ManaCost::parseManaCost(string s, ManaCost * _manaCost, MTGCardInstan
tc = tcf.createTargetChooser(target,c);
}
manaCost->addExtraCost(NEW SacrificeCost(tc));
}else if (value[0] == 'c'){
//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'){
//Counters
OutputDebugString("Counter\n");
size_t counter_start = value.find("(");