Erwan
- 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:
@@ -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();
|
||||
|
||||
@@ -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",
|
||||
"",
|
||||
|
||||
@@ -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("(");
|
||||
|
||||
Reference in New Issue
Block a user