-fix issue 275
This commit is contained in:
wagic.the.homebrew@gmail.com
2010-01-16 06:26:22 +00:00
parent b9b3810bd9
commit 9d4e9ab5de
5 changed files with 23 additions and 26 deletions

View File

@@ -338,6 +338,7 @@ righteous_cause.txt
rockslide_elemental.txt
rootwalla.txt
royal_assassin.txt
sacred_foundry_i275.txt
safehold_duo.txt
scourge_of_kher_ridges.txt
scourge_of_kher_ridges2.txt

View File

@@ -263,7 +263,7 @@ class AAFizzler:public ActivatedAbility{
//MayAbility: May do something when comes into play (should be extended)
//MayAbility: May do ...
class MayAbility:public MTGAbility{
public:
int triggered;
@@ -297,19 +297,15 @@ public:
if (!triggered) return 0;
if (game->mLayers->actionLayer()->menuObject) return 0;
if (game->mLayers->actionLayer()->getIndexOf(mClone) !=-1) return 0;
//if (game->mLayers->actionLayer()->getIndexOf(this) !=-1) return 0;
OutputDebugString("Destroy!\n");
return 1;
}
int isReactingToTargetClick(Targetable * card){
OutputDebugString("IsReacting ???\n");
if (card == source) return 1;
return 0;
}
int reactToTargetClick(Targetable * object){
OutputDebugString("ReactToTargetClick!\n");
mClone = ability->clone();
mClone->addToGame();
mClone->forceDestroy = 1;

View File

@@ -245,11 +245,7 @@ void ActionLayer::doReactTo(int menuIndex){
char buf[4096];
sprintf(buf, "ACTIONLAYER doReact To %i\n",controlid);
OutputDebugString(buf);
if (controlid != -1){
ActionElement * currentAction = (ActionElement *)mObjects[controlid];
currentAction->reactToTargetClick(menuObject);
}
menuObject = 0;
ButtonPressed(0,controlid);
}
}
@@ -257,6 +253,8 @@ void ActionLayer::ButtonPressed(int controllerid, int controlid){
if (controlid != -1){
ActionElement * currentAction = (ActionElement *)mObjects[controlid];
currentAction->reactToTargetClick(menuObject);
}else{
GameObserver::GetInstance()->mLayers->stackLayer()->endOfInterruption();
}
menuObject = 0;

View File

@@ -34,26 +34,25 @@ void GuiAvatar::Render()
r->FillRect(actX+2, actY+2, Width * actZ, Height *actZ, ARGB((int)(actA / 2), 0, 0, 0));
float x0 = actX;
float y0 = actY;
JQuad * quad = player->mAvatar;
if (quad)
{
if (corner == BOTTOM_RIGHT){
x0 -= quad->mWidth * actZ;
y0 -= quad->mHeight * actZ;
}
switch (corner)
{
case TOP_LEFT : quad->SetHotSpot(0, 0); break;
case BOTTOM_RIGHT : quad->SetHotSpot(35, 50); break;
}
{
case TOP_LEFT : quad->SetHotSpot(0, 0); break;
case BOTTOM_RIGHT : quad->SetHotSpot(35, 50); break;
}
quad->SetColor(ARGB((int)actA, 255, avatarRed, avatarRed));
r->RenderQuad(quad, actX, actY, actT, actZ, actZ);
if (mHasFocus){
switch (corner)
{
case TOP_LEFT :
r->FillRect(actX,actY,quad->mWidth * actZ,quad->mHeight * actZ, ARGB(abs(128 - wave),255,255,255));
break;
case BOTTOM_RIGHT :
r->FillRect(actX - quad->mWidth * actZ,actY - quad->mHeight * actZ,quad->mWidth * actZ,quad->mHeight * actZ, ARGB(abs(128 - wave),255,255,255));
break;
}
r->FillRect(x0,x0,quad->mWidth * actZ,quad->mHeight * actZ, ARGB(abs(128 - wave),255,255,255));
}
}
@@ -62,12 +61,15 @@ void GuiAvatar::Render()
if (avatarRed > 255)
avatarRed = 255;
}
if (game->currentPlayer == player)
r->DrawRect(actX-1, actY-1, 37 * actZ, 52*actZ, ARGB((int)actA, 0, 255, 0));
r->DrawRect(x0-1, y0-1, 36 * actZ, 51*actZ, ARGB((int)actA, 0, 255, 0));
else if (game->currentActionPlayer == player)
r->DrawRect(actX, actY, 35 *actZ, 50 * actZ, ARGB((int)actA, 0, 0, 255));
r->DrawRect(x0, y0, 34 *actZ, 49 * actZ, ARGB((int)actA, 0, 0, 255));
if (game->isInterrupting == player)
r->DrawRect(actX, actY, 35 * actZ, 50*actZ, ARGB((int)actA, 255, 0, 0));
r->DrawRect(x0, y0, 34 * actZ, 49*actZ, ARGB((int)actA, 255, 0, 0));