mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 11:48:02 +00:00
- Added Jinxed Choker by marc with some new AILogics.
This commit is contained in:
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -5567,6 +5567,7 @@ res/cardsfolder/j/jihad.txt -text
|
|||||||
res/cardsfolder/j/jilt.txt -text
|
res/cardsfolder/j/jilt.txt -text
|
||||||
res/cardsfolder/j/jin_gitaxias_core_augur.txt svneol=native#text/plain
|
res/cardsfolder/j/jin_gitaxias_core_augur.txt svneol=native#text/plain
|
||||||
res/cardsfolder/j/jinx.txt -text
|
res/cardsfolder/j/jinx.txt -text
|
||||||
|
res/cardsfolder/j/jinxed_choker.txt -text
|
||||||
res/cardsfolder/j/jinxed_idol.txt -text
|
res/cardsfolder/j/jinxed_idol.txt -text
|
||||||
res/cardsfolder/j/jinxed_ring.txt -text
|
res/cardsfolder/j/jinxed_ring.txt -text
|
||||||
res/cardsfolder/j/jiwari_the_earth_aflame.txt svneol=native#text/plain
|
res/cardsfolder/j/jiwari_the_earth_aflame.txt svneol=native#text/plain
|
||||||
|
|||||||
16
res/cardsfolder/j/jinxed_choker.txt
Normal file
16
res/cardsfolder/j/jinxed_choker.txt
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
Name:Jinxed Choker
|
||||||
|
ManaCost:3
|
||||||
|
Types:Artifact
|
||||||
|
T:Mode$ Phase | Phase$ End of Turn | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ ChangeControl | TriggerDescription$ At the beginning of your end step, target opponent gains control of CARDNAME and puts a charge counter on it.
|
||||||
|
SVar:ChangeControl:AB$ GainControl | Cost$ 0 | Defined$ Self | ValidTgts$ Opponent | TgtPrompt$ Select target opponent | SubAbility$ PutCounter | SpellDescription$ Target opponent gains control of CARDNAME.
|
||||||
|
SVar:PutCounter:DB$ PutCounter | Cost$ 3 | CounterType$ CHARGE | CounterNum$ 1
|
||||||
|
T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | Execute$ TrigDamage | TriggerZones$ Battlefield | TriggerDescription$ At the beginning of your upkeep, CARDNAME deals damage to you equal to the number of charge counters on it.
|
||||||
|
SVar:TrigDamage:DB$ DealDamage | Defined$ You | NumDmg$ X | References$ X
|
||||||
|
SVar:X:Count$CardCounters.CHARGE
|
||||||
|
A:AB$ PutCounter | Cost$ 3 | CounterType$ CHARGE | CounterNum$ 1 | AILogic$ Never | SpellDescription$ Put a charge counter on CARDNAME.
|
||||||
|
A:AB$ RemoveCounter | Cost$ 3 | CounterType$ CHARGE | CounterNum$ 1 | AILogic$ EndOfOpponentsTurn | SpellDescription$ Remove a charge counter from CARDNAME.
|
||||||
|
SVar:SacMe:4
|
||||||
|
SVar:RemAIDeck:True
|
||||||
|
SVar:Picture:http://www.wizards.com/global/images/magic/general/jinxed_choker.jpg
|
||||||
|
Oracle:At the beginning of your end step, target opponent gains control of Jinxed Choker and puts a charge counter on it.\nAt the beginning of your upkeep, Jinxed Choker deals damage to you equal to the number of charge counters on it.\n{3}: Put a charge counter on Jinxed Choker or remove one from it.
|
||||||
|
SetInfo:MRD Rare
|
||||||
@@ -46,19 +46,8 @@ public class CountersPutAi extends SpellAbilityAi {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
list = CardLists.filter(player.getCardsIn(ZoneType.Battlefield), new Predicate<Card>() {
|
if ("Never".equals(sa.getParam("AILogic"))) {
|
||||||
@Override
|
return false;
|
||||||
public boolean apply(final Card c) {
|
|
||||||
return c.canBeTargetedBy(sa) && c.canReceiveCounters(CounterType.valueOf(type));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if (abTgt != null) {
|
|
||||||
list = CardLists.getValidCards(list, abTgt.getValidTgts(), source.getController(), source);
|
|
||||||
|
|
||||||
if (list.size() < abTgt.getMinTargets(source, sa)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (abCost != null) {
|
if (abCost != null) {
|
||||||
@@ -102,8 +91,21 @@ public class CountersPutAi extends SpellAbilityAi {
|
|||||||
if (abTgt != null) {
|
if (abTgt != null) {
|
||||||
abTgt.resetTargets();
|
abTgt.resetTargets();
|
||||||
// target loop
|
// target loop
|
||||||
|
|
||||||
|
list = CardLists.filter(player.getCardsIn(ZoneType.Battlefield), new Predicate<Card>() {
|
||||||
|
@Override
|
||||||
|
public boolean apply(final Card c) {
|
||||||
|
return c.canBeTargetedBy(sa) && c.canReceiveCounters(CounterType.valueOf(type));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
list = CardLists.getValidCards(list, abTgt.getValidTgts(), source.getController(), source);
|
||||||
|
|
||||||
|
if (list.size() < abTgt.getMinTargets(source, sa)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
while (abTgt.getNumTargeted() < abTgt.getMaxTargets(sa.getSourceCard(), sa)) {
|
while (abTgt.getNumTargeted() < abTgt.getMaxTargets(sa.getSourceCard(), sa)) {
|
||||||
if (list.size() == 0) {
|
if (list.isEmpty()) {
|
||||||
if ((abTgt.getNumTargeted() < abTgt.getMinTargets(sa.getSourceCard(), sa))
|
if ((abTgt.getNumTargeted() < abTgt.getMinTargets(sa.getSourceCard(), sa))
|
||||||
|| (abTgt.getNumTargeted() == 0)) {
|
|| (abTgt.getNumTargeted() == 0)) {
|
||||||
abTgt.resetTargets();
|
abTgt.resetTargets();
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import forge.card.ability.SpellAbilityAi;
|
|||||||
import forge.card.cost.Cost;
|
import forge.card.cost.Cost;
|
||||||
import forge.card.spellability.SpellAbility;
|
import forge.card.spellability.SpellAbility;
|
||||||
import forge.card.spellability.Target;
|
import forge.card.spellability.Target;
|
||||||
|
import forge.game.ai.ComputerUtil;
|
||||||
import forge.game.ai.ComputerUtilCost;
|
import forge.game.ai.ComputerUtilCost;
|
||||||
import forge.game.phase.PhaseType;
|
import forge.game.phase.PhaseType;
|
||||||
import forge.game.player.Player;
|
import forge.game.player.Player;
|
||||||
@@ -53,12 +54,20 @@ public class CountersRemoveAi extends SpellAbilityAi {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if ("EndOfOpponentsTurn".equals(sa.getParam("AILogic"))) {
|
||||||
|
if (!source.getGame().getPhaseHandler().is(PhaseType.END_OF_TURN) || source.getGame().getPhaseHandler().getNextTurn() != ai) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// TODO handle proper calculation of X values based on Cost
|
// TODO handle proper calculation of X values based on Cost
|
||||||
// final int amount = calculateAmount(sa.getSourceCard(), amountStr, sa);
|
// final int amount = calculateAmount(sa.getSourceCard(), amountStr, sa);
|
||||||
|
|
||||||
// prevent run-away activations - first time will always return true
|
if (ComputerUtil.preventRunAwayActivations(sa)) {
|
||||||
boolean chance = r.nextFloat() <= Math.pow(.6667, sa.getActivationsThisTurn());
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// currently, not targeted
|
// currently, not targeted
|
||||||
if (abTgt != null) {
|
if (abTgt != null) {
|
||||||
@@ -78,7 +87,7 @@ public class CountersRemoveAi extends SpellAbilityAi {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return ((r.nextFloat() < .6667) && chance);
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user