mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
- Small tweaks to tapXType cost
- Added Hand of Justice
This commit is contained in:
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -1579,6 +1579,7 @@ res/cardsfolder/hammerheim_deadeye.txt -text svneol=native#text/plain
|
|||||||
res/cardsfolder/hand_of_cruelty.txt -text svneol=native#text/plain
|
res/cardsfolder/hand_of_cruelty.txt -text svneol=native#text/plain
|
||||||
res/cardsfolder/hand_of_death.txt -text svneol=native#text/plain
|
res/cardsfolder/hand_of_death.txt -text svneol=native#text/plain
|
||||||
res/cardsfolder/hand_of_honor.txt -text svneol=native#text/plain
|
res/cardsfolder/hand_of_honor.txt -text svneol=native#text/plain
|
||||||
|
res/cardsfolder/hand_of_justice.txt -text svneol=native#text/plain
|
||||||
res/cardsfolder/hanna_ships_navigator.txt -text svneol=native#text/plain
|
res/cardsfolder/hanna_ships_navigator.txt -text svneol=native#text/plain
|
||||||
res/cardsfolder/hannas_custody.txt -text svneol=native#text/plain
|
res/cardsfolder/hannas_custody.txt -text svneol=native#text/plain
|
||||||
res/cardsfolder/harabaz_druid.txt -text svneol=native#text/plain
|
res/cardsfolder/harabaz_druid.txt -text svneol=native#text/plain
|
||||||
|
|||||||
9
res/cardsfolder/hand_of_justice.txt
Normal file
9
res/cardsfolder/hand_of_justice.txt
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
Name:Hand of Justice
|
||||||
|
ManaCost:5 W
|
||||||
|
Types:Creature Avatar
|
||||||
|
Text:no text
|
||||||
|
PT:2/6
|
||||||
|
K:abDestroyTgtV T tapXType<3/Creature.White>:Creature:Destroy target creature.
|
||||||
|
K:SVar:Rarity:Rare
|
||||||
|
K:SVar:Picture:http://www.wizards.com/global/images/magic/general/hand_of_justice.jpg
|
||||||
|
End
|
||||||
@@ -61,6 +61,17 @@ public class Ability_Cost {
|
|||||||
// when adding new costs for cost string, place them here
|
// when adding new costs for cost string, place them here
|
||||||
name = cardName;
|
name = cardName;
|
||||||
|
|
||||||
|
String tapXStr = "tapXType<";
|
||||||
|
if (parse.contains(tapXStr))
|
||||||
|
{
|
||||||
|
tapXTypeCost = true;
|
||||||
|
String[] splitStr = abCostParse(parse, tapXStr, 2);
|
||||||
|
parse = abUpdateParse(parse, tapXStr);
|
||||||
|
|
||||||
|
tapXTypeAmount = Integer.parseInt(splitStr[0]);
|
||||||
|
tapXType = splitStr[1];
|
||||||
|
}
|
||||||
|
|
||||||
String subStr = "SubCounter<";
|
String subStr = "SubCounter<";
|
||||||
if(parse.contains(subStr)) {
|
if(parse.contains(subStr)) {
|
||||||
// SubCounter<NumCounters/CounterType>
|
// SubCounter<NumCounters/CounterType>
|
||||||
@@ -106,17 +117,6 @@ public class Ability_Cost {
|
|||||||
sacThis = (sacType.equals("CARDNAME"));
|
sacThis = (sacType.equals("CARDNAME"));
|
||||||
}
|
}
|
||||||
|
|
||||||
String tapXStr = "tapXType<";
|
|
||||||
if (parse.contains(tapXStr))
|
|
||||||
{
|
|
||||||
tapXTypeCost = true;
|
|
||||||
String[] splitStr = abCostParse(parse, tapXStr, 2);
|
|
||||||
parse = abUpdateParse(parse, tapXStr);
|
|
||||||
|
|
||||||
tapXTypeAmount = Integer.parseInt(splitStr[0]);
|
|
||||||
tapXType = splitStr[1];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (parse.contains("Untap")){
|
if (parse.contains("Untap")){
|
||||||
untapCost = true;
|
untapCost = true;
|
||||||
parse = parse.replace("Untap", "").trim();
|
parse = parse.replace("Untap", "").trim();
|
||||||
@@ -239,9 +239,22 @@ public class Ability_Cost {
|
|||||||
|
|
||||||
if (untapCost){
|
if (untapCost){
|
||||||
if (first)
|
if (first)
|
||||||
cost.append("Untap");
|
cost.append("Untap ");
|
||||||
else
|
else
|
||||||
cost.append(", untap");
|
cost.append(", untap ");
|
||||||
|
first = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tapXTypeCost){
|
||||||
|
if (first)
|
||||||
|
cost.append("Tap ");
|
||||||
|
else
|
||||||
|
cost.append(", tap ");
|
||||||
|
cost.append(tapXTypeAmount);
|
||||||
|
cost.append(" untapped ");
|
||||||
|
cost.append(tapXType); // needs IsValid String converter
|
||||||
|
if (tapXTypeAmount > 1)
|
||||||
|
cost.append("s");
|
||||||
first = false;
|
first = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14901,7 +14901,7 @@ public class CardFactory_Creatures {
|
|||||||
|
|
||||||
//*************** START *********** START **************************
|
//*************** START *********** START **************************
|
||||||
else if(cardName.equals("Tradewind Rider")) {
|
else if(cardName.equals("Tradewind Rider")) {
|
||||||
final SpellAbility a1 = new Ability(card, "0") {
|
final SpellAbility a1 = new Ability_Activated(card, "0") {
|
||||||
private static final long serialVersionUID = 3438865371487994984L;
|
private static final long serialVersionUID = 3438865371487994984L;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -232,6 +232,24 @@ public class ComputerUtil
|
|||||||
if (cost.getUntap() && (card.isUntapped() || card.isSick()))
|
if (cost.getUntap() && (card.isUntapped() || card.isSick()))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (cost.getTapXTypeCost())
|
||||||
|
{
|
||||||
|
PlayerZone play = AllZone.getZone(Constant.Zone.Play, Constant.Player.Computer);
|
||||||
|
CardList typeList = new CardList(play.getCards());
|
||||||
|
typeList = typeList.getValidCards(cost.getTapXType().split(","));
|
||||||
|
|
||||||
|
if (cost.getTap())
|
||||||
|
typeList.remove(sa.getSourceCard());
|
||||||
|
typeList = typeList.filter( new CardListFilter() {
|
||||||
|
public boolean addCard(Card c) {
|
||||||
|
return c.isUntapped();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (cost.getTapXTypeAmount() > typeList.size())
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (cost.getSubCounter()){
|
if (cost.getSubCounter()){
|
||||||
Counters c = cost.getCounterType();
|
Counters c = cost.getCounterType();
|
||||||
if (card.getCounters(c) - cost.getCounterNum() < 0 || !AllZone.GameAction.isCardInPlay(card)){
|
if (card.getCounters(c) - cost.getCounterNum() < 0 || !AllZone.GameAction.isCardInPlay(card)){
|
||||||
@@ -273,23 +291,14 @@ public class ComputerUtil
|
|||||||
Card target = sa.getTargetCard();
|
Card target = sa.getTargetCard();
|
||||||
if (target != null && target.getController().equals(Constant.Player.Computer)) // don't sacrifice the card we're pumping
|
if (target != null && target.getController().equals(Constant.Player.Computer)) // don't sacrifice the card we're pumping
|
||||||
typeList.remove(target);
|
typeList.remove(target);
|
||||||
return typeList.size() >= cost.getSacAmount();
|
|
||||||
|
if (cost.getSacAmount() > typeList.size())
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
else if (cost.getSacThis() && !AllZone.GameAction.isCardInPlay(card))
|
else if (cost.getSacThis() && !AllZone.GameAction.isCardInPlay(card))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cost.getTapXTypeCost())
|
|
||||||
{
|
|
||||||
PlayerZone play = AllZone.getZone(Constant.Zone.Play, Constant.Player.Computer);
|
|
||||||
CardList typeList = new CardList(play.getCards());
|
|
||||||
typeList = typeList.getValidCards(cost.getTapXType().split(","));
|
|
||||||
|
|
||||||
if (cost.getTap())
|
|
||||||
typeList.remove(sa.getSourceCard());
|
|
||||||
|
|
||||||
return typeList.size() >= cost.getTapXTypeAmount();
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -58,6 +58,25 @@ public class Cost_Payment {
|
|||||||
if (cost.getUntap() && (card.isUntapped() || card.isSick()))
|
if (cost.getUntap() && (card.isUntapped() || card.isSick()))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (cost.getTapXTypeCost()){
|
||||||
|
PlayerZone play = AllZone.getZone(Constant.Zone.Play, card.getController());
|
||||||
|
CardList typeList = new CardList(play.getCards());
|
||||||
|
|
||||||
|
typeList = typeList.getValidCards(cost.getTapXType().split(","));
|
||||||
|
|
||||||
|
if (cost.getTap()) {
|
||||||
|
typeList = typeList.filter(new CardListFilter()
|
||||||
|
{
|
||||||
|
public boolean addCard(Card c)
|
||||||
|
{
|
||||||
|
return !c.equals(card) && c.isUntapped();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (typeList.size() == 0)
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
int countersLeft = 0;
|
int countersLeft = 0;
|
||||||
if (cost.getSubCounter()){
|
if (cost.getSubCounter()){
|
||||||
Counters c = cost.getCounterType();
|
Counters c = cost.getCounterType();
|
||||||
@@ -106,27 +125,6 @@ public class Cost_Payment {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cost.getTapXTypeCost())
|
|
||||||
{
|
|
||||||
PlayerZone play = AllZone.getZone(Constant.Zone.Play, card.getController());
|
|
||||||
CardList typeList = new CardList(play.getCards());
|
|
||||||
|
|
||||||
typeList = typeList.getValidCards(cost.getTapXType().split(","));
|
|
||||||
|
|
||||||
if (cost.getTap()) {
|
|
||||||
typeList = typeList.filter(new CardListFilter()
|
|
||||||
{
|
|
||||||
public boolean addCard(Card c)
|
|
||||||
{
|
|
||||||
return !c.equals(card);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if (typeList.size() == 0)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -158,6 +156,16 @@ public class Cost_Payment {
|
|||||||
changeInput.stopSetNext(new Input_PayCostMana(this));
|
changeInput.stopSetNext(new Input_PayCostMana(this));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!payTapXType && cost.getTapXTypeCost()){
|
||||||
|
PlayerZone play = AllZone.getZone(Constant.Zone.Play, card.getController());
|
||||||
|
CardList typeList = new CardList(play.getCards());
|
||||||
|
typeList = typeList.getValidCards(cost.getTapXType().split(","));
|
||||||
|
|
||||||
|
changeInput.stopSetNext(input_tapXCost(cost.getTapXTypeAmount(),cost.getTapXType(), typeList, ability, this));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (!paySubCounter && cost.getSubCounter()){ // pay counters here.
|
if (!paySubCounter && cost.getSubCounter()){ // pay counters here.
|
||||||
Counters c = cost.getCounterType();
|
Counters c = cost.getCounterType();
|
||||||
int countersLeft = card.getCounters(c) - cost.getCounterNum();
|
int countersLeft = card.getCounters(c) - cost.getCounterNum();
|
||||||
@@ -226,16 +234,6 @@ public class Cost_Payment {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!payTapXType && cost.getTapXTypeCost())
|
|
||||||
{
|
|
||||||
PlayerZone play = AllZone.getZone(Constant.Zone.Play, card.getController());
|
|
||||||
CardList typeList = new CardList(play.getCards());
|
|
||||||
typeList = typeList.getValidCards(cost.getTapXType().split(","));
|
|
||||||
|
|
||||||
changeInput.stopSetNext(input_tapXCost(cost.getTapXTypeAmount(),cost.getTapXType(), typeList, ability, this));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
req.finishPaying();
|
req.finishPaying();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -257,6 +255,11 @@ public class Cost_Payment {
|
|||||||
// refund mana
|
// refund mana
|
||||||
AllZone.ManaPool.unpaid();
|
AllZone.ManaPool.unpaid();
|
||||||
|
|
||||||
|
if (cost.getTapXTypeCost() && payTapXType){
|
||||||
|
// todo: it would be great if a user cancels payment that the tapped creatures will untap
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// refund counters
|
// refund counters
|
||||||
if (cost.getSubCounter() && paySubCounter){
|
if (cost.getSubCounter() && paySubCounter){
|
||||||
Counters c = cost.getCounterType();
|
Counters c = cost.getCounterType();
|
||||||
@@ -328,6 +331,11 @@ public class Cost_Payment {
|
|||||||
if (!cost.hasNoManaCost())
|
if (!cost.hasNoManaCost())
|
||||||
ComputerUtil.payManaCost(ability);
|
ComputerUtil.payManaCost(ability);
|
||||||
|
|
||||||
|
if (cost.getTapXTypeCost()){
|
||||||
|
for (Card c : tapXCard)
|
||||||
|
c.tap();
|
||||||
|
}
|
||||||
|
|
||||||
if (cost.getSubCounter())
|
if (cost.getSubCounter())
|
||||||
card.setCounter(cost.getCounterType(), countersLeft);
|
card.setCounter(cost.getCounterType(), countersLeft);
|
||||||
|
|
||||||
@@ -361,12 +369,6 @@ public class Cost_Payment {
|
|||||||
AllZone.GameAction.sacrifice(c);
|
AllZone.GameAction.sacrifice(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cost.getTapXTypeCost())
|
|
||||||
{
|
|
||||||
for (Card c : tapXCard)
|
|
||||||
c.tap();
|
|
||||||
}
|
|
||||||
|
|
||||||
AllZone.Stack.add(ability);
|
AllZone.Stack.add(ability);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -529,7 +531,7 @@ public class Cost_Payment {
|
|||||||
public void showMessage() {
|
public void showMessage() {
|
||||||
if (cardList.size() == 0) stop();
|
if (cardList.size() == 0) stop();
|
||||||
|
|
||||||
AllZone.Display.showMessage("Select a "+ cardType + " card to tap");
|
AllZone.Display.showMessage("Select a "+ cardType + " to tap");
|
||||||
ButtonUtil.enableOnlyCancel();
|
ButtonUtil.enableOnlyCancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -543,6 +545,7 @@ public class Cost_Payment {
|
|||||||
if(zone.is(Constant.Zone.Play) && cardList.contains(card) && card.isUntapped() ) {
|
if(zone.is(Constant.Zone.Play) && cardList.contains(card) && card.isUntapped() ) {
|
||||||
// send in CardList for Typing
|
// send in CardList for Typing
|
||||||
card.tap();
|
card.tap();
|
||||||
|
cardList.remove(card);
|
||||||
nTapped++;
|
nTapped++;
|
||||||
|
|
||||||
if(nTapped == nCards)
|
if(nTapped == nCards)
|
||||||
|
|||||||
Reference in New Issue
Block a user