he is activating this as a trigger....
auto=@each my combatbegins:activepokemon
see....
theres so many ways this is incorrect...he logic is not handled correctly for what this is supposed to be...
at all times both players have to have 1 pokemon that is active...when a player has no more pokemon to make active they lose the game...
this should be handled in the mtgrule.cpp as a game rule....not coded into a trigger....becuase what happens if i have a pokemon that is not active....but during "combat" my active one dies....
i lose the game...which is incorrect....
becuase we won't have a chance to set another active pokemon til the next combat...
i was not incorrect in my thought....he is recreating the wheel, and doing it incorrectly.....i did not at all suggest that my code suggestion was correct....i simply suggested that the EXACT thing hes code is doing is already supported....
- Code: Select all
TargetChooserFactory tcf;
tc = tcf.createTargetChooser("creature|myBattlefield", NULL);
ManaCost * _cost = new ManaCost();
_cost->add(0,0);
MTGAbility * a = new AActiveRetrace(icard->getId(), icard, _tg,1);
MTGAbility * tr = new GenericTargetAbility(icard->getId(),icard, tc,a,_cost);
tr->reactToTargetClick(icard);
this section for example is absolutely useless....he is going to be activating this with a trigger...use
auto=@blah:
target(creature|mybattlefield)if it is supposed to have a cost, which having an active pokemon is not something that cost anything, you either have one or lose the game.
then lord the ability with a cost to the creatures, instead of attaching it to a trigger....
- Code: Select all
int AActivePokemon::addToGame()
{
Player * player;
player = game->currentPlayer;
MTGGameZone * zone = player->game->inPlay;
MTGCardInstance * icard;
[b] int ifind = 0;
for (int k = zone->nb_cards - 1; k >= 0; k--)
{
MTGCardInstance * _card = zone->cards[k];
if (_card->isActive())
{
return 0;
}
if (_card->isCreature())
{
icard = _card;
ifind = 1;
}
}
if (zone->nb_cards == 0 || ifind == 0)return 0;[/b]
he added this becuase he is force creating a TC, and if he didn't have this useless section of code it would lock him in a targetchooser with no way out...so lets review the parts that can be handled with "target(creature|mybattlefield)"
ill edit the code removing the useless things....
- Code: Select all
AActivePokemon::AActivePokemon(int _id, MTGCardInstance * source, MTGCardInstance * _target):
MTGAbility(_id, source, _target)
{
_tg = _target;
}
int AActivePokemon::addToGame()
{
Player * player;
player = game->currentPlayer;
MTGGameZone * zone = player->game->inPlay;
return MTGAbility::addToGame();
}
AActiveRetrace::AActiveRetrace(int _id,MTGCardInstance * source, MTGCardInstance * _target, int iactive):
MTGAbility(_id, source, _target)
{
_active = iactive;
_tg = _target;
}
int AActiveRetrace::reactToTargetClick(Targetable * object)
{
_tg = (MTGCardInstance *)object;
if (_tg)
{
if (_active == 1)
_tg->addType(Subtypes::TYPE_ACTIVE);
else
_tg->removeType(Subtypes::TYPE_ACTIVE);
return 1;
}
}
ok moving forward we are left with an ability that give the card "active" as a type....hmmmmm transforms((active))...lets further edit out useless stuff....
- Code: Select all
AActivePokemon::AActivePokemon(int _id, MTGCardInstance * source, MTGCardInstance * _target):
MTGAbility(_id, source, _target)
{
_tg = _target;
}
int AActivePokemon::addToGame()
{
Player * player;
player = game->currentPlayer;
MTGGameZone * zone = player->game->inPlay;
return MTGAbility::addToGame();
}
AActiveRetrace::AActiveRetrace(int _id,MTGCardInstance * source, MTGCardInstance * _target, int iactive):
MTGAbility(_id, source, _target)
{
_active = iactive;
_tg = _target;
}
int AActiveRetrace::reactToTargetClick(Targetable * object)
{
_tg = (MTGCardInstance *)object;
}
}
now wololo...tell me again that what i used was not EXACTLY what his ability was doing?
or did you miss the part where he stated the use of this ability? this is why you don't "half read" things...you end up being super wrong.....
this needs to be a game rule....not an ability i have already told him exactly where and how to handle this.....yet he choose to repost in a new thread the same exact thing....if he openly ignores the dev that has been actively adding abilities and rules for over a year now at an extremely alarming rate, i will simply begin locking his threads and moving them to achieves...
to me its like hes asking for help, then you go as far as give him exact code...he then comes back with something completely different from what you suggested....so what is the point in helping someone or wasting time trying to suggest anything to help the code when he won't take any of the suggestions AT ALL....to me, it just becomes useless forum noise.....