mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 20:58:03 +00:00
move more small stuff from GameAction to Player
This commit is contained in:
@@ -274,7 +274,7 @@ public class ComputerAI_General implements Computer {
|
|||||||
c.setDefendingPlayer(AllZone.Combat.getDefendingPlayer());
|
c.setDefendingPlayer(AllZone.Combat.getDefendingPlayer());
|
||||||
|
|
||||||
//check for planeswalker
|
//check for planeswalker
|
||||||
Card walker = AllZone.GameAction.getPlaneswalker(AllZone.HumanPlayer);
|
Card walker = AllZone.HumanPlayer.getPlaneswalker();
|
||||||
|
|
||||||
if(walker != null && MyRandom.random.nextBoolean()) {
|
if(walker != null && MyRandom.random.nextBoolean()) {
|
||||||
c.setPlaneswalker(walker);
|
c.setPlaneswalker(walker);
|
||||||
|
|||||||
@@ -24,17 +24,6 @@ public class GameAction {
|
|||||||
|
|
||||||
//private boolean fantasyQuest = false;
|
//private boolean fantasyQuest = false;
|
||||||
|
|
||||||
//returns null if player does not have a Planeswalker
|
|
||||||
public Card getPlaneswalker(Player player) {
|
|
||||||
PlayerZone p = AllZone.getZone(Constant.Zone.Play, player);
|
|
||||||
CardList c = new CardList(p.getCards());
|
|
||||||
c = c.getType("Planeswalker");
|
|
||||||
|
|
||||||
if(c.isEmpty()) return null;
|
|
||||||
|
|
||||||
return c.get(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void resetActivationsPerTurn(){
|
public void resetActivationsPerTurn(){
|
||||||
CardList all = AllZoneUtil.getCardsInGame();
|
CardList all = AllZoneUtil.getCardsInGame();
|
||||||
|
|
||||||
|
|||||||
@@ -358,6 +358,20 @@ public abstract class Player extends MyObservable{
|
|||||||
doScry(topN, topN.size());
|
doScry(topN, topN.size());
|
||||||
}
|
}
|
||||||
///////////////////////////////
|
///////////////////////////////
|
||||||
|
|
||||||
|
///////////////////////////////
|
||||||
|
////
|
||||||
|
//// properties about the player and his/her cards/game status
|
||||||
|
////
|
||||||
|
///////////////////////////////
|
||||||
|
public boolean hasPlaneswalker() {
|
||||||
|
return null != getPlaneswalker();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Card getPlaneswalker() {
|
||||||
|
CardList c = AllZoneUtil.getPlayerTypeInPlay(this, "Planeswalker");
|
||||||
|
return c.get(0);
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////
|
////////////////////////////////
|
||||||
//
|
//
|
||||||
|
|||||||
Reference in New Issue
Block a user