mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 04:08:01 +00:00
retire keyword "Whenever CARDNAME becomes blocked, it gets +1/+1 until end of turn for each creature blocking it."
This commit is contained in:
@@ -907,8 +907,8 @@ public class CombatUtil {
|
||||
if(attacker.getKeyword().contains("Indestructible") &&
|
||||
!(defender.getKeyword().contains("Wither") || defender.getKeyword().contains("Infect"))) return false;
|
||||
|
||||
int attBushidoMagnitude = attacker.getKeywordMagnitude("Bushido");
|
||||
attBushidoMagnitude += attacker.getAmountOfKeyword("Whenever CARDNAME becomes blocked, it gets +1/+1 until end of turn for each creature blocking it.");
|
||||
//unused
|
||||
//int attBushidoMagnitude = attacker.getKeywordMagnitude("Bushido");
|
||||
|
||||
int defenderDamage = defender.getNetAttack() + predictPowerBonusOfBlocker(attacker, defender);
|
||||
int attackerDamage = attacker.getNetAttack() + predictPowerBonusOfAttacker(attacker, defender);
|
||||
@@ -997,9 +997,8 @@ public class CombatUtil {
|
||||
return true;
|
||||
}
|
||||
|
||||
int attBushidoMagnitude = attacker.getKeywordMagnitude("Bushido");
|
||||
attBushidoMagnitude += attacker.getAmountOfKeyword(
|
||||
"Whenever CARDNAME becomes blocked, it gets +1/+1 until end of turn for each creature blocking it.");
|
||||
//unused
|
||||
//int attBushidoMagnitude = attacker.getKeywordMagnitude("Bushido");
|
||||
|
||||
int defenderDamage = defender.getNetAttack() + predictPowerBonusOfBlocker(attacker, defender);
|
||||
int attackerDamage = attacker.getNetAttack() + predictPowerBonusOfAttacker(attacker, defender);
|
||||
@@ -1974,42 +1973,6 @@ public class CombatUtil {
|
||||
for(Ability ab:CardFactoryUtil.getBushidoEffects(a))
|
||||
AllZone.Stack.add(ab);
|
||||
|
||||
|
||||
|
||||
if(a.getKeyword().contains(
|
||||
"Whenever CARDNAME becomes blocked, it gets +1/+1 until end of turn for each creature blocking it.")) {
|
||||
Ability ability = new Ability(a, "0") {
|
||||
@Override
|
||||
public void resolve() {
|
||||
final Command untilEOT = new Command() {
|
||||
private static final long serialVersionUID = -5476584542164560128L;
|
||||
|
||||
public void execute() {
|
||||
if(AllZone.GameAction.isCardInPlay(a)) {
|
||||
a.addTempAttackBoost(-blockers);
|
||||
a.addTempDefenseBoost(-blockers);
|
||||
}
|
||||
}
|
||||
};//Command
|
||||
|
||||
if(AllZone.GameAction.isCardInPlay(a)) {
|
||||
a.addTempAttackBoost(blockers);
|
||||
a.addTempDefenseBoost(blockers);
|
||||
|
||||
AllZone.EndOfTurn.addUntil(untilEOT);
|
||||
}
|
||||
}//resolve
|
||||
};
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(a.getName()+" - gains +1/+1 for each blocker");
|
||||
ability.setStackDescription(sb.toString());
|
||||
int amount = a.getAmountOfKeyword("Whenever CARDNAME becomes blocked, it gets +1/+1 until end of turn for each creature blocking it.");
|
||||
|
||||
for(int i=0 ; i < amount ; i++)
|
||||
AllZone.Stack.add(ability);
|
||||
}
|
||||
|
||||
//Rampage
|
||||
ArrayList<String> keywords = a.getKeyword();
|
||||
Pattern p = Pattern.compile("Rampage [0-9]+");
|
||||
|
||||
@@ -255,22 +255,22 @@ public class ComputerUtil_Block2
|
||||
|
||||
attackersLeft = new CardList(currentAttackers.toArray());
|
||||
|
||||
//Reinforce blockers blocking attackers with trample if life is still in danger
|
||||
//Reinforce blockers blocking attackers with trample if life is still in danger
|
||||
if (CombatUtil.lifeInDanger(combat)) {
|
||||
tramplingAttackers = attackers.getKeyword("Trample");
|
||||
tramplingAttackers = tramplingAttackers.getKeywordsDontContain("Rampage"); //Don't make it worse
|
||||
tramplingAttackers = tramplingAttackers.
|
||||
getKeywordsDontContain("Whenever CARDNAME becomes blocked, it gets +1/+1 until end of turn for each creature blocking it.");
|
||||
//TODO - should check here for a "rampage-like" trigger that replaced the keyword:
|
||||
// "Whenever CARDNAME becomes blocked, it gets +1/+1 until end of turn for each creature blocking it."
|
||||
|
||||
for(Card attacker : tramplingAttackers) {
|
||||
chumpBlockers = getPossibleBlockers(attacker, blockersLeft, combat);
|
||||
for(Card blocker : chumpBlockers) {
|
||||
//Add an additional blocker if the current blockers are not enough and the new one would suck some of the damage
|
||||
if(CombatUtil.getAttack(attacker) > CombatUtil.totalShieldDamage(attacker,combat.getBlockers(attacker))
|
||||
&& CombatUtil.shieldDamage(attacker, blocker) > 0 && CombatUtil.canBlock(attacker,blocker, combat)
|
||||
&& CombatUtil.lifeInDanger(combat)) {
|
||||
combat.addBlocker(attacker, blocker);
|
||||
blockersLeft.remove(blocker);
|
||||
//Add an additional blocker if the current blockers are not enough and the new one would suck some of the damage
|
||||
if(CombatUtil.getAttack(attacker) > CombatUtil.totalShieldDamage(attacker,combat.getBlockers(attacker))
|
||||
&& CombatUtil.shieldDamage(attacker, blocker) > 0 && CombatUtil.canBlock(attacker,blocker, combat)
|
||||
&& CombatUtil.lifeInDanger(combat)) {
|
||||
combat.addBlocker(attacker, blocker);
|
||||
blockersLeft.remove(blocker);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -279,8 +279,8 @@ public class ComputerUtil_Block2
|
||||
//Support blockers not destroying the attacker with more blockers to try to kill the attacker
|
||||
if (blockedButUnkilled.size() > 0) {
|
||||
CardList targetAttackers = blockedButUnkilled.getKeywordsDontContain("Rampage"); //Don't make it worse
|
||||
targetAttackers = targetAttackers.
|
||||
getKeywordsDontContain("Whenever CARDNAME becomes blocked, it gets +1/+1 until end of turn for each creature blocking it.");
|
||||
//TODO - should check here for a "rampage-like" trigger that replaced the keyword:
|
||||
// "Whenever CARDNAME becomes blocked, it gets +1/+1 until end of turn for each creature blocking it."
|
||||
|
||||
for(Card attacker : targetAttackers) {
|
||||
blockers = getPossibleBlockers(attacker, blockersLeft, combat);
|
||||
@@ -288,13 +288,13 @@ public class ComputerUtil_Block2
|
||||
//Try to use safe blockers first
|
||||
safeBlockers = getSafeBlockers(attacker, blockers);
|
||||
for(Card blocker : safeBlockers) {
|
||||
//Add an additional blocker if the current blockers are not enough and the new one would deal additional damage
|
||||
if(attacker.getKillDamage() > CombatUtil.totalDamageOfBlockers(attacker,combat.getBlockers(attacker))
|
||||
&& CombatUtil.dealsDamageAsBlocker(attacker, blocker) > 0 && CombatUtil.canBlock(attacker,blocker, combat)) {
|
||||
combat.addBlocker(attacker, blocker);
|
||||
blockersLeft.remove(blocker);
|
||||
}
|
||||
blockers.remove(blocker); //Don't check them again next
|
||||
//Add an additional blocker if the current blockers are not enough and the new one would deal additional damage
|
||||
if(attacker.getKillDamage() > CombatUtil.totalDamageOfBlockers(attacker,combat.getBlockers(attacker))
|
||||
&& CombatUtil.dealsDamageAsBlocker(attacker, blocker) > 0 && CombatUtil.canBlock(attacker,blocker, combat)) {
|
||||
combat.addBlocker(attacker, blocker);
|
||||
blockersLeft.remove(blocker);
|
||||
}
|
||||
blockers.remove(blocker); //Don't check them again next
|
||||
}
|
||||
|
||||
//Try to add blockers that could be destroyed, but are worth less than the attacker
|
||||
@@ -306,15 +306,15 @@ public class ComputerUtil_Block2
|
||||
else safeBlockers = new CardList(blockers.toArray());
|
||||
|
||||
for(Card blocker : safeBlockers) {
|
||||
//Add an additional blocker if the current blockers are not enough and the new one would deal the remaining damage
|
||||
//Add an additional blocker if the current blockers are not enough and the new one would deal the remaining damage
|
||||
int currentDamage = CombatUtil.totalDamageOfBlockers(attacker,combat.getBlockers(attacker));
|
||||
int additionalDamage = CombatUtil.dealsDamageAsBlocker(attacker, blocker);
|
||||
if(attacker.getKillDamage() > currentDamage
|
||||
&& !(attacker.getKillDamage() > currentDamage + additionalDamage)
|
||||
&& CardFactoryUtil.evaluateCreature(blocker) + diff < CardFactoryUtil.evaluateCreature(attacker)
|
||||
&& CombatUtil.canBlock(attacker,blocker,combat)) {
|
||||
combat.addBlocker(attacker, blocker);
|
||||
blockersLeft.remove(blocker);
|
||||
if(attacker.getKillDamage() > currentDamage
|
||||
&& !(attacker.getKillDamage() > currentDamage + additionalDamage)
|
||||
&& CardFactoryUtil.evaluateCreature(blocker) + diff < CardFactoryUtil.evaluateCreature(attacker)
|
||||
&& CombatUtil.canBlock(attacker,blocker,combat)) {
|
||||
combat.addBlocker(attacker, blocker);
|
||||
blockersLeft.remove(blocker);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user