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
@@ -3151,6 +3151,32 @@ public class CardFactoryUtil
|
||||
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
|
||||
static public Card getRandomCard(CardList list)
|
||||
{
|
||||
|
||||
@@ -9107,6 +9107,15 @@ public class CardFactory_Creatures {
|
||||
PlayerZone from = AllZone.getZone(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());
|
||||
to.add(c);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user