if (effects != null)
{
card.clearEffects();
for (int j = 0; j < effects.size(); j++)
{
OneEffect oneEffect = effects.elementAt(j);
CardSim effectCard = oneEffect.effectCard;
effectCard = allCards.get(effectCard.getCard().getUniqueID());
// null might happen, if
// effect card is moved to library top
// library is on short copy / library dummy
// not included in "allCards"
// but this also means, that this card
// is "dead" so we dont have to do anything and can just go on
if (effectCard == null) continue;
AIEnhancedCardHints hints = AIEnhancedCardHints.getHints(effectCard);
if (hints.hasHint(TI_SOURCE_DEATH))
{
if (mBattlefield[p].isInList(effectCard))
{
if (oneEffect.isSource)
{
doSourceEffectOnOneCard(card, card.getOwner(), oneEffect.key, hints, effectCard.getOwner(), effectCard);
}
else
{
doTargetEffectOnOneCard(card, card.getOwner(), oneEffect.key, hints, effectCard.getOwner(), effectCard);
}
}
}
}
}
}
//half reset "opponent" battlefield
mBattlefield[(newActivePlayer+1)%2].newRound(false);
// apply auras etc
for (int i = 0; i < mBattlefield[(newActivePlayer+1)%2].size(); i++)
{
int p = (newActivePlayer+1)%2;
CardSim card = mBattlefield[p].getCard(i);
Vector<OneEffect> effects = card.getEffects();
if (effects != null)
{
card.clearEffects();
for (int j = 0; j < effects.size(); j++)
{
OneEffect oneEffect = effects.elementAt(j);
CardSim effectCard = oneEffect.effectCard;
effectCard = allCards.get(effectCard.getCard().getUniqueID());
// null might happen, if
// effect card is moved to library top