if (hints.hasHint(hintKey, CS_HAS_MULTIPLYER))
{
amount = getSourceMultiplyAmount( player, hintKey, hints);
}
if (hints.hasAnyHint(hintKey, new HintBundle(S_IS_OWNER)))
{
if (hints.hasAnyHint(hintKey, new HintBundle(SY_HEAL)))
{
life[tPlayer] += amount;
}
if (hints.hasAnyHint(hintKey, new HintBundle(SY_DAMAGE)))
{
life[tPlayer] -= amount;
}
}
if (hints.hasAnyHint(hintKey, new HintBundle(SY_NEGATE_DAMAGE_AMOUNT)))
{
tCard.addPreventDamage(amount);
}
if (hints.hasAnyHint(hintKey, new HintBundle(SY_SELF_DESTRUCT)))
{
creatureToGrave(source);
}
if (hints.hasAnyHint(hintKey, new HintBundle(SY_TO_TAP)))
{
tCard.setTapped(true);
}
if (hints.hasAnyHint(hintKey, new HintBundle(SY_TO_UNTAP)))
{
tCard.setTapped(false);
}
if (hints.hasAnyHint(hintKey, new HintBundle(SY_ABILISY_ADD)))
{
String v = hints.getHintValue(hintKey, SY_ABILISY_ADD);
if (!reverseEffect)
tCard.addAbility(v);
else
tCard.subAbility(v);
}
if (hints.hasAnyHint(hintKey, new HintBundle(SY_DAMAGE, SY_TOUGHNESS_SUB)))
{
if (amount == 0)
amount = hints.getHintValueInt(hintKey, SY_TOUGHNESS_SUB);
if (hints.hasHint(hintKey, CS_X_COUNT))
{
amount = source.xMana;
}
if (!reverseEffect)
tCard.addToughness(-amount);
else
tCard.subToughness(-amount);
if (tCard.getNowToughness() <= 0)
{
creatureToGrave(tCard);
}
}
if (hints.hasAnyHint(hintKey, new HintBundle(SY_TOUGHNESS_ADD)))
{
amount = hints.getHintValueInt(hintKey, SY_TOUGHNESS_ADD);
if (hints.hasHint(hintKey, CS_X_COUNT))
{
amount = source.xMana;
}
if (!reverseEffect)
tCard.addToughness(amount);
else
tCard.subToughness(amount);
}
if (hints.hasAnyHint(hintKey, new HintBundle(SY_POWER_ADD)))
{
amount = hints.getHintValueInt(hintKey, SY_POWER_ADD);
if (hints.hasHint(hintKey, CS_X_COUNT))
{
amount = source.xMana;
}
if (!reverseEffect)
tCard.addPower(amount);
else
tCard.subPower(amount);
}
if (hints.hasAnyHint(hintKey, new HintBundle(SY_POWER_SUB)))
{
amount = hints.getHintValueInt(hintKey, SY_POWER_SUB);
if (hints.hasHint(hintKey, CS_X_COUNT))
{
amount = source.xMana;
}
if (!reverseEffect)
tCard.addPower(-amount);
else
tCard.subPower(-amount);
}
if(hints.hasAnyHint(hintKey, new HintBundle(SY_ONE_ONLY_BLOCCK)))
{
if (!reverseEffect)
tCard.addAbility("NoBlock");
else
tCard.subAbility("NoBlock");
}
CardSimList from = null;
CardSimList to = null;
if(hints.hasAnyHint(hintKey, new HintBundle(SY_LIBRARY_ROCHADE)))
{
if (!tCard.getCard().isDummy())
{
// NO Dummy library
initLibrary();
from = null;
to = null;
from = mHand[tPlayer];
to = mLibrary[tPlayer];
from.moveCardTo(tCard, to);
to.shuffle();
// draw first
CardSim nCard = to.getCard(to.size()-1);
to.moveCardTo(nCard, from);
}
return;
}
if(hints.hasAnyHint(hintKey, new HintBundle(SY_LIBRARY_GRAVE_ROCHADE)))
{
if (!tCard.getCard().isDummy())
{
// NO Dummy library
initLibrary();
from = mHand[tPlayer];
to = mGraveyard[tPlayer];
from.moveCardTo(tCard, to);
CardSimList from2 = null;
CardSimList to2 = null;
from2 = mLibrary[tPlayer];
to2 = mHand[tPlayer];
from2.shuffle();
// draw first
CardSim nCard = from2.getCard(to.size()-1);
to2.moveCardTo(nCard, from2);
}
return;
}
from = null;
to = null;
if (hints.hasAnyHint(hintKey, new HintBundle(SY_COMTROL_CHANGE)))
{
if (hints.hasAnyHint(hintKey, new HintBundle(S_FROM_LAND)))
{
to = mLand[player];
}
if (hints.hasAnyHint(hintKey, new HintBundle(S_FROM_FIELD)))
{
to = mBattlefield[player];
}
to.addCard(tCard);
mControlChange = true;
}
from = null;
to = null;
boolean sicken = false;
if (hints.hasAnyHint(hintKey, new HintBundle(SY_HAND_TO_GRAVE, SY_HAND_TO_LAND, SY_HAND_TO_FIELD, SY_HAND_TO_LIBRARY, SY_HAND_TO_EXILE)))
from = mHand[tPlayer];
if (hints.hasAnyHint(hintKey, new HintBundle(SY_LAND_TO_GRAVE, SY_LAND_TO_HAND, SY_LAND_TO_LIBRARY, SY_LAND_TO_EXILE)))
from = mLand[tPlayer];
if (hints.hasAnyHint(hintKey, new HintBundle(SY_LIBRARY_TO_GRAVE, SY_LIBRARY_TO_HAND, SY_LIBRARY_TO_LAND, SY_LIBRARY_TO_FIELD, SY_LIBRARY_TO_EXILE, SY_LIBRARY_TO_LIBRARY)))
from = mLibrary[tPlayer];
if (hints.hasAnyHint(hintKey, new HintBundle(SY_FIELD_TO_GRAVE, SY_FIELD_TO_HAND, SY_FIELD_TO_LIBRARY, SY_FIELD_TO_EXILE)))
from = mBattlefield[tPlayer];
if (hints.hasAnyHint(hintKey, new HintBundle(SY_GRAVE_TO_HAND, SY_GRAVE_TO_FIELD, SY_GRAVE_TO_LAND, SY_GRAVE_TO_LIBRARY, SY_GRAVE_TO_EXILE)))
from = mGraveyard[tPlayer];
if (hints.hasAnyHint(hintKey, new HintBundle(SY_HAND_TO_GRAVE, SY_LAND_TO_GRAVE, SY_LIBRARY_TO_GRAVE, SY_FIELD_TO_GRAVE)))
to = mGraveyard[tPlayer];
if (hints.hasAnyHint(hintKey, new HintBundle(SY_HAND_TO_LIBRARY, SY_LAND_TO_LIBRARY, SY_GRAVE_TO_LIBRARY, SY_FIELD_TO_LIBRARY, SY_LIBRARY_TO_LIBRARY)))
to = mLibrary[tPlayer];
if (hints.hasAnyHint(hintKey, new HintBundle(SY_HAND_TO_FIELD, SY_GRAVE_TO_FIELD, SY_LIBRARY_TO_FIELD)))
{
to = mBattlefield[tPlayer];
sicken = true;
}
if (hints.hasAnyHint(hintKey, new HintBundle(SY_FIELD_TO_HAND, SY_GRAVE_TO_HAND, SY_LAND_TO_HAND, SY_LIBRARY_TO_HAND)))
to = mHand[tPlayer];
if (hints.hasAnyHint(hintKey, new HintBundle(SY_GRAVE_TO_LAND, SY_LIBRARY_TO_LAND, SY_HAND_TO_LAND)))
to = mLand[tPlayer];
if (hints.hasAnyHint(hintKey, new HintBundle(SY_HAND_TO_EXILE, SY_LAND_TO_EXILE, SY_FIELD_TO_EXILE, SY_GRAVE_TO_EXILE, SY_LIBRARY_TO_EXILE)))
to = mGraveyard[tPlayer];
if (hints.hasAnyHint(hintKey, new HintBundle(SY_LIBRARY_TOP)))
to = mLibrary[tPlayer];
if (hints.hasAnyHint(hintKey, new HintBundle(SY_LIBRARY_BOTTOM)))
to = mLibrary[tPlayer];
if (from == null)
{
if (mHand[tPlayer].isInList(tCard)) from = mHand[tPlayer];
if (mLand[tPlayer].isInList(tCard)) from = mLand[tPlayer];
if (mGraveyard[tPlayer].isInList(tCard)) from = mGraveyard[tPlayer];
if (mLibrary[tPlayer].isInList(tCard)) from = mLibrary[tPlayer];
if (mBattlefield[tPlayer].isInList(tCard)) from = mBattlefield[tPlayer];
}
if ((from != null) && (to != null))
{
if ((to == mGraveyard[tPlayer]) && (from == mBattlefield[tPlayer]))
{
creatureToGrave(tCard);
}
else
{
boolean done = false;
if (hints.hasAnyHint(hintKey, new HintBundle(TY_LIBRARY_BOTTOM)))
{
if (to == mLibrary[tPlayer])
{
done = true;
from.remove(tCard);
to.addCardFront(tCard);
}
}
if (!done)
from.moveCardTo(tCard, to);
if (to == mGraveyard[player])
checkTriggerMoveToGrave(tCard);
removeFromAttack(tCard);
removeFromBlock(tCard);
}
if (sicken)
{
tCard.setSick(true);
}
// shuffle AFTER libryry top!
if (hints.hasAnyHint(hintKey, new HintBundle(SY_LIBRARY_TOP)))
{
if(hints.hasAnyHint(hintKey, new HintBundle(HintAll.SY_LIBRARY_SHUFFLE)))
{
CardSim newCard = mLibrary[tCard.owner].getCard(mLibrary[tCard.owner].size()-1);
int size = mLibrary[tCard.owner].size()-1;
mLibrary[tCard.owner] = new CardSimList();
for (int i=0; i< size; i++)