mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 02:38:02 +00:00
- If a Sower of Temptation leaves play, and the creature it stole was attacking, that creature will be removed from combat now.
- Added a makeToken method in CardFactoryUtil, and changed most token creation code in to use this. - Bunch of cleanups.
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -3150,6 +3150,32 @@ public class CardFactoryUtil
|
|||||||
list.add(creatureLands[i]);
|
list.add(creatureLands[i]);
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void makeToken(String name, String imageName, Card source, String manaCost, String[] types, int baseAttack, int baseDefense,
|
||||||
|
String[] intrinsicKeywords)
|
||||||
|
{
|
||||||
|
Card c = new Card();
|
||||||
|
c.setName(name);
|
||||||
|
c.setImageName(imageName);
|
||||||
|
|
||||||
|
c.setOwner(source.getController());
|
||||||
|
c.setController(source.getController());
|
||||||
|
|
||||||
|
c.setManaCost(manaCost);
|
||||||
|
c.setToken(true);
|
||||||
|
|
||||||
|
for (String t : types)
|
||||||
|
c.addType(t);
|
||||||
|
|
||||||
|
c.setBaseAttack(baseAttack);
|
||||||
|
c.setBaseDefense(baseDefense);
|
||||||
|
|
||||||
|
for (String kw : intrinsicKeywords)
|
||||||
|
c.addIntrinsicKeyword(kw);
|
||||||
|
|
||||||
|
PlayerZone play = AllZone.getZone(Constant.Zone.Play, source.getController());
|
||||||
|
play.add(c);
|
||||||
|
}
|
||||||
|
|
||||||
//may return null
|
//may return null
|
||||||
static public Card getRandomCard(CardList list)
|
static public Card getRandomCard(CardList list)
|
||||||
|
|||||||
@@ -9092,7 +9092,7 @@ public class CardFactory_Creatures {
|
|||||||
{
|
{
|
||||||
private static final long serialVersionUID = -8961588142846220965L;
|
private static final long serialVersionUID = -8961588142846220965L;
|
||||||
|
|
||||||
public void execute()
|
public void execute()
|
||||||
{
|
{
|
||||||
Card c = moveCreature[0];
|
Card c = moveCreature[0];
|
||||||
|
|
||||||
@@ -9107,6 +9107,15 @@ public class CardFactory_Creatures {
|
|||||||
PlayerZone from = AllZone.getZone(c);
|
PlayerZone from = AllZone.getZone(c);
|
||||||
from.remove(c);
|
from.remove(c);
|
||||||
|
|
||||||
|
//make sure the creature is removed from combat:
|
||||||
|
CardList list = new CardList(AllZone.Combat.getAttackers());
|
||||||
|
if (list.contains(c))
|
||||||
|
AllZone.Combat.removeFromCombat(c);
|
||||||
|
|
||||||
|
CardList pwlist = new CardList(AllZone.pwCombat.getAttackers());
|
||||||
|
if (pwlist.contains(c))
|
||||||
|
AllZone.pwCombat.removeFromCombat(c);
|
||||||
|
|
||||||
PlayerZone to = AllZone.getZone(Constant.Zone.Play, c.getOwner());
|
PlayerZone to = AllZone.getZone(Constant.Zone.Play, c.getOwner());
|
||||||
to.add(c);
|
to.add(c);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user