Erwan
-fix issue 270
This commit is contained in:
@@ -251,6 +251,7 @@ icatian_priest.txt
|
|||||||
imaginary_pet.txt
|
imaginary_pet.txt
|
||||||
immaculate_magistrate.txt
|
immaculate_magistrate.txt
|
||||||
instill_energy_i166.txt
|
instill_energy_i166.txt
|
||||||
|
iron_will_i270.txt
|
||||||
jodahs_avenger.txt
|
jodahs_avenger.txt
|
||||||
juggernaut.txt
|
juggernaut.txt
|
||||||
jump.txt
|
jump.txt
|
||||||
|
|||||||
+10
-2
@@ -10,11 +10,19 @@ firstmain
|
|||||||
[PLAYER1]
|
[PLAYER1]
|
||||||
inplay:Suntail Hawk
|
inplay:Suntail Hawk
|
||||||
hand:Iron Will
|
hand:Iron Will
|
||||||
library:Plains
|
library:plains
|
||||||
manapool:{W}{W}
|
manapool:{W}{W}
|
||||||
[PLAYER2]
|
[PLAYER2]
|
||||||
[DO]
|
[DO]
|
||||||
Iron Will
|
Iron Will
|
||||||
choice 0
|
choice 0
|
||||||
Suntail Hawk
|
Suntail Hawk
|
||||||
human
|
[ASSERT]
|
||||||
|
firstmain
|
||||||
|
[PLAYER1]
|
||||||
|
inplay:Suntail Hawk
|
||||||
|
graveyard:iron will
|
||||||
|
library:plains
|
||||||
|
manapool:{W}
|
||||||
|
[PLAYER2]
|
||||||
|
[END]
|
||||||
@@ -111,7 +111,7 @@ class Constants
|
|||||||
RARITY_U = 'U', //Uncommons
|
RARITY_U = 'U', //Uncommons
|
||||||
RARITY_C = 'C', //Commons
|
RARITY_C = 'C', //Commons
|
||||||
RARITY_L = 'L', //Lands
|
RARITY_L = 'L', //Lands
|
||||||
RARITY_T = 'T', //Tokens, reserved for internal logic.
|
RARITY_T = 'T', //Tokens
|
||||||
|
|
||||||
//Price for singles
|
//Price for singles
|
||||||
PRICE_1M = 3000,
|
PRICE_1M = 3000,
|
||||||
|
|||||||
@@ -104,10 +104,7 @@ void ActionLayer::Render (){
|
|||||||
for (int i=0;i<mCount;i++){
|
for (int i=0;i<mCount;i++){
|
||||||
if (mObjects[i]!=NULL){
|
if (mObjects[i]!=NULL){
|
||||||
ActionElement * currentAction = (ActionElement *)mObjects[i];
|
ActionElement * currentAction = (ActionElement *)mObjects[i];
|
||||||
//if (currentAction->getActivity() > 0){
|
|
||||||
currentAction->Render();
|
currentAction->Render();
|
||||||
//return;
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -119,11 +116,6 @@ void ActionLayer::setCurrentWaitingAction(ActionElement * ae){
|
|||||||
}
|
}
|
||||||
|
|
||||||
TargetChooser * ActionLayer::getCurrentTargetChooser(){
|
TargetChooser * ActionLayer::getCurrentTargetChooser(){
|
||||||
/* for (int i=0;i<mCount;i++){
|
|
||||||
ActionElement * currentAction = (ActionElement *)mObjects[i];
|
|
||||||
if(currentAction->waitingForAnswer) return currentAction->tc;
|
|
||||||
}
|
|
||||||
return NULL;*/
|
|
||||||
if (currentWaitingAction && currentWaitingAction->waitingForAnswer)
|
if (currentWaitingAction && currentWaitingAction->waitingForAnswer)
|
||||||
return currentWaitingAction->tc;
|
return currentWaitingAction->tc;
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -247,8 +239,7 @@ void ActionLayer::doReactTo(int menuIndex){
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ActionLayer::ButtonPressed(int controllerid, int controlid){
|
void ActionLayer::ButtonPressed(int controllerid, int controlid){
|
||||||
if (controlid == -1){
|
if (controlid != -1){
|
||||||
}else{
|
|
||||||
ActionElement * currentAction = (ActionElement *)mObjects[controlid];
|
ActionElement * currentAction = (ActionElement *)mObjects[controlid];
|
||||||
currentAction->reactToTargetClick(menuObject);
|
currentAction->reactToTargetClick(menuObject);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -403,6 +403,17 @@ void GameObserver::cardClick (MTGCardInstance * card, Targetable * object){
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (card){
|
if (card){
|
||||||
|
|
||||||
|
/* Fix for Issue http://code.google.com/p/wagic/issues/detail?id=270
|
||||||
|
put into play is hopefully the only ability causing that kind of trouble
|
||||||
|
If the same kind of issue occurs with other abilities, let's think of a cleaner solution
|
||||||
|
*/
|
||||||
|
if (targetChooser) {
|
||||||
|
MTGAbility * a = mLayers->actionLayer()->getAbility(MTGAbility::PUT_INTO_PLAY);
|
||||||
|
a->reactToClick(card);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
reaction = mLayers->actionLayer()->isReactingToClick(card);
|
reaction = mLayers->actionLayer()->isReactingToClick(card);
|
||||||
if (reaction == -1) mLayers->actionLayer()->reactToClick(card);
|
if (reaction == -1) mLayers->actionLayer()->reactToClick(card);
|
||||||
}else{
|
}else{
|
||||||
@@ -410,8 +421,10 @@ void GameObserver::cardClick (MTGCardInstance * card, Targetable * object){
|
|||||||
if (reaction == -1) mLayers->actionLayer()->reactToTargetClick(object);
|
if (reaction == -1) mLayers->actionLayer()->reactToTargetClick(object);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (reaction != -1){
|
if (reaction == -1) return;
|
||||||
|
|
||||||
if (!card) return;
|
if (!card) return;
|
||||||
|
|
||||||
//Current player's hand
|
//Current player's hand
|
||||||
if (currentPlayer->game->hand->hasCard(card) && currentGamePhase == Constants::MTG_PHASE_CLEANUP && currentPlayer->game->hand->nb_cards > 7){
|
if (currentPlayer->game->hand->hasCard(card) && currentGamePhase == Constants::MTG_PHASE_CLEANUP && currentPlayer->game->hand->nb_cards > 7){
|
||||||
currentPlayer->game->putInGraveyard(card);
|
currentPlayer->game->putInGraveyard(card);
|
||||||
@@ -424,7 +437,7 @@ void GameObserver::cardClick (MTGCardInstance * card, Targetable * object){
|
|||||||
}else if (card->isTapped() && card->controller() == currentPlayer){
|
}else if (card->isTapped() && card->controller() == currentPlayer){
|
||||||
ConstraintResolver::untap(this, card);
|
ConstraintResolver::untap(this, card);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user