mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 20:58:03 +00:00
- Convert Leeches to Cost/Target
This commit is contained in:
@@ -3121,14 +3121,17 @@ public class CardFactory_Sorceries {
|
|||||||
* Target player loses all poison counters.
|
* Target player loses all poison counters.
|
||||||
* Leeches deals that much damage to that player.
|
* Leeches deals that much damage to that player.
|
||||||
*/
|
*/
|
||||||
SpellAbility spell = new Spell(card) {
|
final Target tgt = new Target(card, "Select a player", "Player");
|
||||||
|
Cost cost = new Cost("1 W W", cardName, false);
|
||||||
|
SpellAbility spell = new Spell(card, cost, tgt) {
|
||||||
private static final long serialVersionUID = 8555498267738686288L;
|
private static final long serialVersionUID = 8555498267738686288L;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void resolve() {
|
public void resolve() {
|
||||||
int counters = getTargetPlayer().getPoisonCounters();
|
Player p = tgt.getTargetPlayers().get(0);
|
||||||
getTargetPlayer().addDamage(counters, card);
|
int counters = p.getPoisonCounters();
|
||||||
getTargetPlayer().subtractPoisonCounters(counters);
|
p.addDamage(counters, card);
|
||||||
|
p.subtractPoisonCounters(counters);
|
||||||
}// resolve()
|
}// resolve()
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -3137,12 +3140,12 @@ public class CardFactory_Sorceries {
|
|||||||
int compPoison = AllZone.ComputerPlayer.getPoisonCounters();
|
int compPoison = AllZone.ComputerPlayer.getPoisonCounters();
|
||||||
|
|
||||||
if(AllZone.HumanPlayer.getLife() <= humanPoison ) {
|
if(AllZone.HumanPlayer.getLife() <= humanPoison ) {
|
||||||
setTargetPlayer(AllZone.HumanPlayer);
|
tgt.addTarget(AllZone.HumanPlayer);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( (2*(11 - compPoison) < AllZone.ComputerPlayer.getLife() || compPoison > 7) && compPoison < AllZone.ComputerPlayer.getLife() - 2) {
|
if( (2*(11 - compPoison) < AllZone.ComputerPlayer.getLife() || compPoison > 7) && compPoison < AllZone.ComputerPlayer.getLife() - 2) {
|
||||||
setTargetPlayer(AllZone.ComputerPlayer);
|
tgt.addTarget(AllZone.ComputerPlayer);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3150,8 +3153,6 @@ public class CardFactory_Sorceries {
|
|||||||
}
|
}
|
||||||
};// SpellAbility
|
};// SpellAbility
|
||||||
|
|
||||||
spell.setBeforePayMana(CardFactoryUtil.input_targetPlayer(spell));
|
|
||||||
|
|
||||||
// Do not remove SpellAbilities created by AbilityFactory or Keywords.
|
// Do not remove SpellAbilities created by AbilityFactory or Keywords.
|
||||||
card.clearFirstSpellAbility();
|
card.clearFirstSpellAbility();
|
||||||
card.addSpellAbility(spell);
|
card.addSpellAbility(spell);
|
||||||
|
|||||||
@@ -170,6 +170,10 @@ public class Target {
|
|||||||
this(src, select, valid, "1", "1");
|
this(src, select, valid, "1", "1");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Target(Card src, String select, String valid){
|
||||||
|
this(src, select, valid.split(","), "1", "1");
|
||||||
|
}
|
||||||
|
|
||||||
public Target(Card src, String select, String[] valid, String min, String max){
|
public Target(Card src, String select, String[] valid, String min, String max){
|
||||||
srcCard = src;
|
srcCard = src;
|
||||||
tgtValid = true;
|
tgtValid = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user