mirror of
https://github.com/magefree/mage.git
synced 2025-12-24 12:31:59 -08:00
Planechase: refactor planes;
This commit is contained in:
parent
b6557201b4
commit
823d677068
25 changed files with 229 additions and 241 deletions
|
|
@ -13,6 +13,7 @@ import mage.choices.Choice;
|
|||
import mage.choices.ChoiceImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Planes;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import mage.game.Game;
|
||||
|
|
@ -538,12 +539,11 @@ public final class SystemUtil {
|
|||
break;
|
||||
}
|
||||
}
|
||||
Class<?> c = Class.forName("mage.game.command.planes." + command.cardName);
|
||||
Constructor<?> cons = c.getConstructor();
|
||||
Object plane = cons.newInstance();
|
||||
if (plane instanceof mage.game.command.Plane) {
|
||||
((mage.game.command.Plane) plane).setControllerId(player.getId());
|
||||
game.addPlane((mage.game.command.Plane) plane, null, player.getId());
|
||||
Planes planeType = Planes.fromClassName(command.cardName);
|
||||
Plane plane = Plane.createPlane(planeType);
|
||||
if (plane != null) {
|
||||
plane.setControllerId(player.getId());
|
||||
game.addPlane(plane, null, player.getId());
|
||||
continue;
|
||||
}
|
||||
} else if ("loyalty".equalsIgnoreCase(command.zone)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue