mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 18:58:00 +00:00
- Fix the unless cost for abilities.
This commit is contained in:
@@ -1393,25 +1393,40 @@ public class AbilityFactory {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
final Command paidCommand = new Command() {
|
||||||
|
private static final long serialVersionUID = 8094833091127334678L;
|
||||||
|
|
||||||
|
public void execute() {
|
||||||
|
Ability_Sub abSub = sa.getSubAbility();
|
||||||
|
resolve(abSub);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
final Command unpaidCommand = new Command() {
|
final Command unpaidCommand = new Command() {
|
||||||
private static final long serialVersionUID = 8094833091127334678L;
|
private static final long serialVersionUID = 8094833091127334678L;
|
||||||
|
|
||||||
public void execute() {
|
public void execute() {
|
||||||
sa.resolve();
|
sa.resolve();
|
||||||
if(params.containsKey("PowerSink")) GameActionUtil.doPowerSink(AllZone.HumanPlayer);
|
if(params.containsKey("PowerSink")) GameActionUtil.doPowerSink(AllZone.HumanPlayer);
|
||||||
|
Ability_Sub abSub = sa.getSubAbility();
|
||||||
|
resolve(abSub);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if(payer.isHuman()) {
|
if(payer.isHuman()) {
|
||||||
GameActionUtil.payManaDuringAbilityResolve(source + "\r\n", ability.getManaCost(),
|
GameActionUtil.payManaDuringAbilityResolve(source + "\r\n", ability.getManaCost(),
|
||||||
Command.Blank, unpaidCommand);
|
paidCommand, unpaidCommand);
|
||||||
} else {
|
} else {
|
||||||
if(ComputerUtil.canPayCost(ability)) {
|
if(ComputerUtil.canPayCost(ability)) {
|
||||||
ComputerUtil.playNoStack(ability); //Unless cost was payed - no resolve
|
ComputerUtil.playNoStack(ability); //Unless cost was payed - no resolve
|
||||||
|
Ability_Sub abSub = sa.getSubAbility();
|
||||||
|
resolve(abSub);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if(params.containsKey("PowerSink")) GameActionUtil.doPowerSink(AllZone.ComputerPlayer);
|
|
||||||
sa.resolve();
|
sa.resolve();
|
||||||
|
if(params.containsKey("PowerSink")) GameActionUtil.doPowerSink(AllZone.ComputerPlayer);
|
||||||
|
Ability_Sub abSub = sa.getSubAbility();
|
||||||
|
resolve(abSub);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1423,14 +1438,15 @@ public class AbilityFactory {
|
|||||||
|
|
||||||
//check conditions
|
//check conditions
|
||||||
if (AbilityFactory.checkConditional(params, sa)) {
|
if (AbilityFactory.checkConditional(params, sa)) {
|
||||||
if (params.get("UnlessCost") == null)
|
if (params.get("UnlessCost") == null) {
|
||||||
sa.resolve();
|
sa.resolve();
|
||||||
|
|
||||||
|
//try to resolve subabilities (see null check above)
|
||||||
|
Ability_Sub abSub = sa.getSubAbility();
|
||||||
|
resolve(abSub);
|
||||||
|
}
|
||||||
else passUnlessCost(sa);
|
else passUnlessCost(sa);
|
||||||
}
|
}
|
||||||
|
|
||||||
//try to resolve subabilities (see null check above)
|
|
||||||
Ability_Sub abSub = sa.getSubAbility();
|
|
||||||
resolve(abSub);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}//end class AbilityFactory
|
}//end class AbilityFactory
|
||||||
Reference in New Issue
Block a user