mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 03:38:01 +00:00
Merge branch 'master' of git.cardforge.org:core-developers/forge into agetian-master
This commit is contained in:
@@ -417,7 +417,6 @@ public class DamageDealAi extends DamageAiBase {
|
||||
*/
|
||||
private Card dealDamageChooseTgtPW(final Player ai, final SpellAbility sa, final int d, final boolean noPrevention,
|
||||
final Player pl, final boolean mandatory) {
|
||||
|
||||
final TargetRestrictions tgt = sa.getTargetRestrictions();
|
||||
final Player activator = sa.getActivatingPlayer();
|
||||
final Card source = sa.getHostCard();
|
||||
@@ -526,6 +525,9 @@ public class DamageDealAi extends DamageAiBase {
|
||||
|
||||
PlayerCollection targetableOpps = ai.getOpponents().filter(PlayerPredicates.isTargetableBy(sa));
|
||||
Player enemy = targetableOpps.min(PlayerPredicates.compareByLife());
|
||||
if (enemy == null) {
|
||||
enemy = ai.getWeakestOpponent();
|
||||
}
|
||||
|
||||
if ("PowerDmg".equals(logic)) {
|
||||
// check if it is better to target the player instead, the original target is already set in PumpAi.pumpTgtAI()
|
||||
@@ -568,9 +570,8 @@ public class DamageDealAi extends DamageAiBase {
|
||||
if (shouldTgtP(ai, sa, dmg, noPrevention)) {
|
||||
tcs.add(enemy);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if ("Polukranos".equals(logic)) {
|
||||
int dmgTaken = 0;
|
||||
|
||||
@@ -218,14 +218,15 @@ public class FightAi extends SpellAbilityAi {
|
||||
CardCollection aiCreaturesByPower = new CardCollection(aiCreatures);
|
||||
CardLists.sortByPowerDesc(aiCreaturesByPower);
|
||||
Card maxPower = aiCreaturesByPower.getFirst();
|
||||
if (maxPower != null && maxPower != aiCreature) {
|
||||
if (maxPower != aiCreature) {
|
||||
power += maxPower.getNetPower(); // potential bonus from adding a second target
|
||||
}
|
||||
if (FightAi.canKill(aiCreature, humanCreature, power)) {
|
||||
else if ("2".equals(sa.getParam("TargetMin"))) {
|
||||
continue;
|
||||
}
|
||||
if (canKill(aiCreature, humanCreature, power)) {
|
||||
sa.getTargets().add(aiCreature);
|
||||
if (maxPower != null) {
|
||||
sa.getTargets().add(maxPower);
|
||||
}
|
||||
sa.getTargets().add(maxPower);
|
||||
if (!isChandrasIgnition) {
|
||||
tgtFight.resetTargets();
|
||||
tgtFight.getTargets().add(humanCreature);
|
||||
@@ -234,7 +235,7 @@ public class FightAi extends SpellAbilityAi {
|
||||
}
|
||||
} else {
|
||||
// Other cards that use AILogic PowerDmg and a single target
|
||||
if (FightAi.canKill(aiCreature, humanCreature, power)) {
|
||||
if (canKill(aiCreature, humanCreature, power)) {
|
||||
sa.getTargets().add(aiCreature);
|
||||
if (!isChandrasIgnition) {
|
||||
tgtFight.resetTargets();
|
||||
@@ -244,7 +245,7 @@ public class FightAi extends SpellAbilityAi {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (FightAi.shouldFight(aiCreature, humanCreature, power, toughness)) {
|
||||
if (shouldFight(aiCreature, humanCreature, power, toughness)) {
|
||||
if ("Time to Feed".equals(sourceName)) { // flip targets
|
||||
final Card tmp = aiCreature;
|
||||
aiCreature = humanCreature;
|
||||
@@ -293,7 +294,7 @@ public class FightAi extends SpellAbilityAi {
|
||||
if (!canKill(opponent, fighter, -pumpDefense)) { // can survive
|
||||
return true;
|
||||
} else {
|
||||
if (MyRandom.getRandom().nextInt(20)<(opponent.getCMC() - fighter.getCMC())) { // trade
|
||||
if (MyRandom.getRandom().nextInt(20) < (opponent.getCMC() - fighter.getCMC())) { // trade
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -559,7 +559,7 @@ public class PumpAi extends PumpAiBase {
|
||||
list = CardLists.filter(list, Predicates.or(CardPredicates.Presets.CREATURES, new Predicate<Card>() {
|
||||
@Override
|
||||
public boolean apply(Card card) {
|
||||
for (SpellAbility sa: card.getSpellAbilities()) {
|
||||
for (SpellAbility sa : card.getSpellAbilities()) {
|
||||
if (sa.isAbility()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -128,6 +128,7 @@ public abstract class FDisplayObject {
|
||||
|
||||
public abstract void draw(Graphics g);
|
||||
public void buildTouchListeners(float screenX, float screenY, List<FDisplayObject> listeners) {
|
||||
boolean exact = !GuiBase.isAndroid() && (this instanceof FCardPanel);
|
||||
if (enabled && visible && screenPos.contains(screenX, screenY)) {
|
||||
listeners.add(this);
|
||||
}
|
||||
@@ -136,7 +137,11 @@ public abstract class FDisplayObject {
|
||||
Forge.hoveredCount = listeners.size();
|
||||
if (!Forge.getCurrentScreen().toString().contains("Match"))
|
||||
Forge.hoveredCount = 1;
|
||||
setHovered(this.enabled && this.visible && this.screenPos.contains(screenX, screenY) && Forge.hoveredCount < 2);
|
||||
if (exact) {
|
||||
setHovered(this.enabled && this.visible && ((FCardPanel) this).renderedCardContains(screenToLocalX(screenX), screenToLocalY(screenY)) && Forge.hoveredCount < 2);
|
||||
} else {
|
||||
setHovered(this.enabled && this.visible && this.screenPos.contains(screenX, screenY) && Forge.hoveredCount < 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
Name:Band Together
|
||||
ManaCost:2 G
|
||||
Types:Instant
|
||||
A:SP$ Pump | Cost$ 2 G | ValidTgts$ Creature.YouCtrl | TgtPrompt$ Select up to two target creatures you control | ImprintCards$ Targeted | AILogic$ PowerDmg | SubAbility$ DBPump | TargetMin$ 0 | TargetMax$ 2 | StackDescription$ SpellDescription | SpellDescription$ Up to two target creatures you control each deal damage equal to their power to another target creature.
|
||||
A:SP$ Pump | Cost$ 2 G | ValidTgts$ Creature.YouCtrl | TgtPrompt$ Select up to two target creatures you control | ImprintCards$ ThisTargetedCard | AILogic$ PowerDmg | SubAbility$ DBPump | TargetMin$ 0 | TargetMax$ 2 | StackDescription$ SpellDescription | SpellDescription$ Up to two target creatures you control each deal damage equal to their power to another target creature.
|
||||
SVar:DBPump:DB$ Pump | ValidTgts$ Creature | TgtPrompt$ Select target creature to be dealt damage | RememberObjects$ ThisTargetedCard | IsCurse$ True | SubAbility$ DBEachDamage | StackDescription$ None
|
||||
SVar:DBEachDamage:DB$ EachDamage | ValidCards$ Creature.IsImprinted | NumDmg$ X | DamageDesc$ damage equal to its power | DefinedCards$ Remembered | SubAbility$ DBCleanup | StackDescription$ None
|
||||
#NumDmg isn't really used here. It is left for clarity. The AF pulls Damage straight from "X" hardcoded.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
Name:Combo Attack
|
||||
ManaCost:2 G
|
||||
Types:Sorcery
|
||||
A:SP$ Pump | Cost$ 2 G | ValidTgts$ Creature.YourTeamCtrl | TgtPrompt$ Select two target creatures your team controls | ImprintCards$ Targeted | TargetMin$ 2 | TargetMax$ 2 | AILogic$ PowerDmg | SubAbility$ DBPump | StackDescription$ SpellDescription | SpellDescription$ Two target creatures your team controls each deal damage equal to their power to target creature.
|
||||
A:SP$ Pump | Cost$ 2 G | ValidTgts$ Creature.YourTeamCtrl | TgtPrompt$ Select two target creatures your team controls | ImprintCards$ ThisTargetedCard | TargetMin$ 2 | TargetMax$ 2 | AILogic$ PowerDmg | SubAbility$ DBPump | StackDescription$ SpellDescription | SpellDescription$ Two target creatures your team controls each deal damage equal to their power to target creature.
|
||||
SVar:DBPump:DB$ Pump | ValidTgts$ Creature | TgtPrompt$ Select target creature to be dealt damage | RememberObjects$ ThisTargetedCard | IsCurse$ True | SubAbility$ DBEachDamage | StackDescription$ None
|
||||
SVar:DBEachDamage:DB$ EachDamage | ValidCards$ Creature.IsImprinted | NumDmg$ X | DefinedCards$ Remembered | SubAbility$ DBCleanup | StackDescription$ None
|
||||
#NumDmg isn't really used here. It is left for clarity. The AF pulls Damage straight from "X" hardcoded.
|
||||
|
||||
Reference in New Issue
Block a user