mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-14 09:48:02 +00:00
Adventure hotfixes (#4477)
Hotfix for quest "What's Yours Is Mine", players were not receiving credit for defeating pirate captain Replacing missing deck file for apprentice red wizard
This commit is contained in:
@@ -178,7 +178,7 @@ public class AdventureQuestStage implements Serializable {
|
|||||||
|
|
||||||
public boolean checkIfTargetEnemy(EnemySprite enemy) {
|
public boolean checkIfTargetEnemy(EnemySprite enemy) {
|
||||||
if (targetEnemyData != null) {
|
if (targetEnemyData != null) {
|
||||||
return enemy.getData() == targetEnemyData;
|
return (enemy.getData().match(targetEnemyData));
|
||||||
}
|
}
|
||||||
else if (targetSprite == null) {
|
else if (targetSprite == null) {
|
||||||
ArrayList<String> candidateTags = new ArrayList<>(Arrays.asList(enemy.getData().questTags));
|
ArrayList<String> candidateTags = new ArrayList<>(Arrays.asList(enemy.getData().questTags));
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ import forge.deck.Deck;
|
|||||||
import forge.util.Aggregates;
|
import forge.util.Aggregates;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Data class that will be used to read Json configuration files
|
* Data class that will be used to read Json configuration files
|
||||||
@@ -90,4 +92,18 @@ public class EnemyData implements Serializable {
|
|||||||
return name;
|
return name;
|
||||||
return "(Unnamed Enemy)";
|
return "(Unnamed Enemy)";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean match(EnemyData other) {
|
||||||
|
//equals() does not cover cases where data is updated to override speed, displayname, etc
|
||||||
|
if (this.equals(other))
|
||||||
|
return true;
|
||||||
|
if (!this.name.equals(other.name))
|
||||||
|
return false;
|
||||||
|
if (questTags.length != other.questTags.length)
|
||||||
|
return false;
|
||||||
|
ArrayList<String> myQuestTags = new ArrayList<>(Arrays.asList(questTags));
|
||||||
|
ArrayList<String> otherQuestTags = new ArrayList<>(Arrays.asList(other.questTags));
|
||||||
|
myQuestTags.removeAll(otherQuestTags);
|
||||||
|
return myQuestTags.isEmpty();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user