mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
- Somewhat more explicit method name.
This commit is contained in:
@@ -383,7 +383,7 @@ public class DamageDealAi extends DamageAiBase {
|
|||||||
for (SpellAbility sa : pw.getSpellAbilities()) {
|
for (SpellAbility sa : pw.getSpellAbilities()) {
|
||||||
if (sa.hasParam("Ultimate")) {
|
if (sa.hasParam("Ultimate")) {
|
||||||
int loyaltyCost = 0;
|
int loyaltyCost = 0;
|
||||||
CostRemoveCounter remLoyalty = sa.getPayCosts().getCostPart(CostRemoveCounter.class);
|
CostRemoveCounter remLoyalty = sa.getPayCosts().getCostPartByType(CostRemoveCounter.class);
|
||||||
if (remLoyalty != null) {
|
if (remLoyalty != null) {
|
||||||
// if remLoyalty is null, generally there's an AddCounter<0/LOYALTY> cost, like for Gideon Jura.
|
// if remLoyalty is null, generally there's an AddCounter<0/LOYALTY> cost, like for Gideon Jura.
|
||||||
loyaltyCost = remLoyalty.convertAmount();
|
loyaltyCost = remLoyalty.convertAmount();
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ public class Cost implements Serializable {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public <T extends CostPart> T getCostPart(Class<T> costType) {
|
public <T extends CostPart> T getCostPartByType(Class<T> costType) {
|
||||||
for (CostPart p : getCostParts()) {
|
for (CostPart p : getCostParts()) {
|
||||||
if (costType.isInstance(p)) {
|
if (costType.isInstance(p)) {
|
||||||
return (T)p;
|
return (T)p;
|
||||||
|
|||||||
Reference in New Issue
Block a user