mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
Performance cleanup
This commit is contained in:
@@ -275,11 +275,9 @@ public class AiBlockController {
|
||||
}
|
||||
|
||||
if (mode == TriggerType.DamageDone) {
|
||||
if ((!trigParams.containsKey("ValidSource")
|
||||
|| trigger.matchesValid(attacker, trigParams.get("ValidSource").split(",")))
|
||||
if (trigger.matchesValidParam("ValidSource", attacker)
|
||||
&& attacker.getNetCombatDamage() > 0
|
||||
&& (!trigParams.containsKey("ValidTarget")
|
||||
|| trigger.matchesValid(combat.getDefenderByAttacker(attacker), trigParams.get("ValidTarget").split(",")))) {
|
||||
&& trigger.matchesValidParam("ValidTarget", combat.getDefenderByAttacker(attacker))) {
|
||||
value += 50;
|
||||
}
|
||||
} else if (mode == TriggerType.AttackerUnblocked) {
|
||||
|
||||
@@ -2664,15 +2664,15 @@ public class ComputerUtil {
|
||||
for (Trigger trigger : theTriggers) {
|
||||
final Card source = trigger.getHostCard();
|
||||
|
||||
if (trigger.getMode() != TriggerType.SpellCast) {
|
||||
continue;
|
||||
}
|
||||
if (!trigger.zonesCheck(game.getZoneOf(source))) {
|
||||
continue;
|
||||
}
|
||||
if (!trigger.requirementsCheck(game)) {
|
||||
continue;
|
||||
}
|
||||
if (trigger.getMode() != TriggerType.SpellCast) {
|
||||
continue;
|
||||
}
|
||||
if (trigger.hasParam("ValidCard")) {
|
||||
if (!card.isValid(trigger.getParam("ValidCard").split(","), source.getController(), source, sa)) {
|
||||
continue;
|
||||
@@ -2724,6 +2724,12 @@ public class ComputerUtil {
|
||||
for (Trigger trigger : theTriggers) {
|
||||
final Card source = trigger.getHostCard();
|
||||
|
||||
if (trigger.getMode() != TriggerType.ChangesZone) {
|
||||
continue;
|
||||
}
|
||||
if (!"Battlefield".equals(trigger.getParam("Destination"))) {
|
||||
continue;
|
||||
}
|
||||
if (!trigger.zonesCheck(game.getZoneOf(source))) {
|
||||
continue;
|
||||
}
|
||||
@@ -2734,12 +2740,6 @@ public class ComputerUtil {
|
||||
&& AbilityUtils.getDefinedCards(permanent, source.getSVar(trigger.getParam("CheckOnTriggeredCard").split(" ")[0]), null).isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
if (trigger.getMode() != TriggerType.ChangesZone) {
|
||||
continue;
|
||||
}
|
||||
if (!"Battlefield".equals(trigger.getParam("Destination"))) {
|
||||
continue;
|
||||
}
|
||||
if (trigger.hasParam("ValidCard")) {
|
||||
if (!permanent.isValid(trigger.getParam("ValidCard"), source.getController(), source, null)) {
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user