mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
- Added canPayLife(int lifePayment) to the payer class and made use of it in several places.
This commit is contained in:
@@ -13845,39 +13845,10 @@ public class CardFactory_Creatures {
|
|||||||
card.addComesIntoPlayCommand(gain2Life);
|
card.addComesIntoPlayCommand(gain2Life);
|
||||||
}//*************** END ************ END **************************
|
}//*************** END ************ END **************************
|
||||||
|
|
||||||
/*
|
|
||||||
//*************** START *********** START **************************
|
|
||||||
else if(cardName.equals("Godsire")) {
|
|
||||||
final SpellAbility a1 = new Ability_Tap(card) {
|
|
||||||
private static final long serialVersionUID = -1160527561099142816L;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void resolve() {
|
|
||||||
makeToken();
|
|
||||||
}
|
|
||||||
|
|
||||||
void makeToken() {
|
|
||||||
CardFactoryUtil.makeToken("Beast", "RGW 8 8 Beast", card, "R G W", new String[] {
|
|
||||||
"Creature", "Beast"}, 8, 8, new String[] {""});
|
|
||||||
}//makeToken()
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canPlayAI() {
|
|
||||||
return AllZone.Phase.getPhase().equals("Main2");
|
|
||||||
}
|
|
||||||
|
|
||||||
};//SpellAbility
|
|
||||||
card.addSpellAbility(a1);
|
|
||||||
a1.setDescription("tap: Put an 8/8 Beast creature token into play that's red, green, and white.");
|
|
||||||
a1.setStackDescription("Put an 8/8 Beast creature token into play that's red, green, and white.");
|
|
||||||
|
|
||||||
//a1.setBeforePayMana(new Input_PayManaCost(a1));
|
|
||||||
}//*************** END ************ END **************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
//*************** START *********** START **************************
|
//*************** START *********** START **************************
|
||||||
else if(cardName.equals("Wydwen, the Biting Gale")) {
|
else if(cardName.equals("Wydwen, the Biting Gale")) {
|
||||||
final SpellAbility a1 = new Ability(card, "U B") {
|
final SpellAbility a1 = new Ability(card, "U B PayLife<1>") {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canPlayAI() {
|
public boolean canPlayAI() {
|
||||||
@@ -13886,8 +13857,6 @@ public class CardFactory_Creatures {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void resolve() {
|
public void resolve() {
|
||||||
//or payLife()...
|
|
||||||
card.getController().loseLife(1, card);
|
|
||||||
PlayerZone hand = AllZone.getZone(Constant.Zone.Hand, card.getOwner());
|
PlayerZone hand = AllZone.getZone(Constant.Zone.Hand, card.getOwner());
|
||||||
/*
|
/*
|
||||||
AllZone.getZone(card).remove(card);
|
AllZone.getZone(card).remove(card);
|
||||||
|
|||||||
@@ -103,10 +103,7 @@ public class Cost_Payment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (cost.getLifeCost()){
|
if (cost.getLifeCost()){
|
||||||
int curLife = card.getController().getLife();
|
if (!card.getController().canPayLife(cost.getLifeAmount())) return false;
|
||||||
if (curLife < cost.getLifeAmount())
|
|
||||||
return false;
|
|
||||||
if(cost.getLifeAmount() > 0 && AllZoneUtil.isCardInPlay("Platinum Emperion",card.getController())) return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cost.getDiscardCost()){
|
if (cost.getDiscardCost()){
|
||||||
|
|||||||
@@ -10127,7 +10127,7 @@ public class GameActionUtil {
|
|||||||
public void selectCard(Card card, PlayerZone zone) {
|
public void selectCard(Card card, PlayerZone zone) {
|
||||||
if(zone.is(Constant.Zone.Hand) && true == card.getDrawnThisTurn()) {
|
if(zone.is(Constant.Zone.Hand) && true == card.getDrawnThisTurn()) {
|
||||||
/////////////////////////////////////////
|
/////////////////////////////////////////
|
||||||
if ((player.getLife() >= 4) && GameActionUtil.showYesNoDialog(source, cardQuestion)) {
|
if (player.canPayLife(4) && GameActionUtil.showYesNoDialog(source, cardQuestion)) {
|
||||||
player.payLife(4, source);
|
player.payLife(4, source);
|
||||||
//card stays in hand
|
//card stays in hand
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -162,8 +162,14 @@ public abstract class Player extends MyObservable{
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
public boolean canPayLife(int lifePayment) {
|
||||||
|
if(life < lifePayment) return false;
|
||||||
|
if(lifePayment > 0 && AllZoneUtil.isCardInPlay("Platinum Emperion",this)) return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean payLife(int lifePayment, Card source) {
|
public boolean payLife(int lifePayment, Card source) {
|
||||||
|
if (!canPayLife(lifePayment)) return false;
|
||||||
//rule 118.8
|
//rule 118.8
|
||||||
if (life >= lifePayment){
|
if (life >= lifePayment){
|
||||||
return loseLife(lifePayment, source);
|
return loseLife(lifePayment, source);
|
||||||
|
|||||||
Reference in New Issue
Block a user