Fix: Fix casting

# Conflicts:
#	src/main/java/com/minelittlepony/unicopia/ability/UnicornCastingAbility.java

# Conflicts:
#	src/main/java/com/minelittlepony/unicopia/ability/UnicornCastingAbility.java
This commit is contained in:
Sollace 2024-05-21 22:47:21 +01:00
parent 7560df438c
commit 1f2df6daf5
No known key found for this signature in database
GPG key ID: E52FACE7B5C773DB

View file

@ -107,8 +107,8 @@ public class UnicornCastingAbility extends AbstractSpellCastingAbility {
}
}
boolean hasExact = player.getSpellSlot().contains(spell);
boolean removed = !spell.isStackable() && player.getSpellSlot().removeWhere(s -> s.findMatches(spell.type()).findAny().isPresent(), true);
boolean hasExact = !spell.isStackable() && player.getSpellSlot().contains(s -> !s.getTypeAndTraits().isStackable() && spell.test(s));
boolean removed = !spell.isStackable() && player.getSpellSlot().removeWhere(s -> !s.getTypeAndTraits().isStackable() && s.findMatches(spell.type()).findAny().isPresent(), true);
player.subtractEnergyCost(removed ? 2 : 4);
if (!hasExact && !spell.isEmpty()) {
Spell s = spell.apply(player, CastingMethod.DIRECT);