mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
Add XChoice to PayLife
Add Hatred
This commit is contained in:
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -3417,6 +3417,7 @@ res/cardsfolder/h/hatchet_bully.txt svneol=native#text/plain
|
||||
res/cardsfolder/h/hatching_plans.txt svneol=native#text/plain
|
||||
res/cardsfolder/h/hate_weaver.txt svneol=native#text/plain
|
||||
res/cardsfolder/h/hateflayer.txt svneol=native#text/plain
|
||||
res/cardsfolder/h/hatred.txt -text
|
||||
res/cardsfolder/h/haunted_angel.txt svneol=native#text/plain
|
||||
res/cardsfolder/h/haunted_cadaver.txt svneol=native#text/plain
|
||||
res/cardsfolder/h/haunted_crossroads.txt svneol=native#text/plain
|
||||
|
||||
11
res/cardsfolder/h/hatred.txt
Normal file
11
res/cardsfolder/h/hatred.txt
Normal file
@@ -0,0 +1,11 @@
|
||||
Name:Hatred
|
||||
ManaCost:3 B B
|
||||
Types:Instant
|
||||
Text:no text
|
||||
A:SP$ Pump | Cost$ 3 B B PayLife<X> | Tgt$ TgtC | NumAtt$ ChosenX | SpellDescription$ Target creature gets +X/+0 until end of turn.
|
||||
SVar:X:XChoice
|
||||
#ChosenX SVar created by Cost payment
|
||||
SVar:RemAIDeck:True
|
||||
SVar:Rarity:Rare
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/hatred.jpg
|
||||
End
|
||||
@@ -53,7 +53,8 @@ public class CostPayLife extends CostPart {
|
||||
@Override
|
||||
public boolean payHuman(SpellAbility ability, Card source, Cost_Payment payment) {
|
||||
String amount = getAmount();
|
||||
int life = ability.getActivatingPlayer().getLife();
|
||||
Player activator = ability.getActivatingPlayer();
|
||||
int life = activator.getLife();
|
||||
|
||||
Integer c = convertAmount();
|
||||
if (c == null){
|
||||
@@ -70,8 +71,8 @@ public class CostPayLife extends CostPart {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(source.getName()).append(" - Pay ").append(c).append(" Life?");
|
||||
|
||||
if (GameActionUtil.showYesNoDialog(source, sb.toString())) {
|
||||
AllZone.getHumanPlayer().payLife(c, null);
|
||||
if (GameActionUtil.showYesNoDialog(source, sb.toString()) && activator.canPayLife(c)) {
|
||||
activator.payLife(c, null);
|
||||
setLastPaidAmount(c);
|
||||
payment.setPaidManaPart(this, true);
|
||||
} else {
|
||||
@@ -91,9 +92,7 @@ public class CostPayLife extends CostPart {
|
||||
String sVar = source.getSVar(amount);
|
||||
// Generalize this
|
||||
if (sVar.equals("XChoice")){
|
||||
// This decision should be locked in the AF and be calculable at this state
|
||||
//c = chooseXValue(life);
|
||||
// Figure out what to do here
|
||||
return false;
|
||||
}
|
||||
else{
|
||||
c = AbilityFactory.calculateAmount(source, amount, ability);
|
||||
@@ -102,7 +101,7 @@ public class CostPayLife extends CostPart {
|
||||
if (!activator.canPayLife(c)){
|
||||
return false;
|
||||
}
|
||||
|
||||
activator.payLife(c, null);
|
||||
setLastPaidAmount(c);
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user