Skip to content

Commit

Permalink
x
Browse files Browse the repository at this point in the history
  • Loading branch information
Atalay-Ileri committed Jul 3, 2024
1 parent 4efea74 commit d0d2e6c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
12 changes: 2 additions & 10 deletions src/main/java/com/visitor/card/properties/Playable.java
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,8 @@ public void addTargetMultipleCardsOrPlayers(Game.Zone zone, Predicate<Targetable
int minCount, int maxCount, String message, Consumer<UUID> perTargetEffect, boolean withPlayers, boolean forCost) {

String targetingMessage = message != null ? message : "Select " + (minCount < maxCount ? "between " + minCount + " and " + maxCount : minCount) + " cards" + (withPlayers ? " or players." : ".");
Predicate<Targetable> pred = predicate != null ? and(predicate, c -> isPlayer(c) || compareZones(c.getZone(), zone)) : (c -> isPlayer(c) || compareZones(c.getZone(), zone));

Effect t = new Effect(game, card, zone, minCount, maxCount, pred, targetingMessage, perTargetEffect);
Effect t = new Effect(game, card, zone, minCount, maxCount, predicate, targetingMessage, perTargetEffect);
if (forCost) {
costEffects.put(t.getId(), t);
} else {
Expand Down Expand Up @@ -208,15 +207,8 @@ public void addTargetSingleUnitOrPlayer(Consumer<UUID> perTargetEffect, boolean
* @param perTargetEffect
*/
public void addTargetSingleUnit(Game.Zone zone, Predicate<Targetable> predicate, Consumer<UUID> perTargetEffect, String message, boolean forCost) {
Predicate<Targetable> finalCardPredicate = predicate != null ? predicate : Predicates::any;
message = message != null ? message : "Select a unit.";
addTargetSingleCard(zone, and(Predicates::isUnit, finalCardPredicate), message, perTargetEffect, forCost);
}

public void addTargetSingleUnit(Predicate<Targetable> predicate, Consumer<UUID> perTargetEffect, String message, boolean forCost) {
Predicate<Targetable> finalCardPredicate = predicate != null ? predicate : Predicates::any;
message = message != null ? message : "Select a unit.";
addTargetSingleCard(Both_Play, and(Predicates::isUnit, finalCardPredicate), message, perTargetEffect, forCost);
addTargetSingleCard(zone, and(Predicates::isUnit, predicate), message, perTargetEffect, forCost);
}


Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/visitor/sets/base2/InfuseLife.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public InfuseLife(Game game, UUID owner) {
"Additional Cost - Sacrifice a unit.\nUnits you control gains +X/+X where X is sacrificed unit's health.",
owner);

playable.addTargetSingleUnit(Base.Zone.Play, Predicates.controlledBy(controller),
playable.addTargetSingleUnit(Base.Zone.Play, Predicates::any,
c -> {
x = game.getCard(c).getHealth();
game.destroy(c);
Expand Down

0 comments on commit d0d2e6c

Please sign in to comment.