mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
@@ -52,7 +52,7 @@ public class AdventureQuestData implements Serializable {
|
||||
Dictionary<String, EnemyData> enemyTokens = new Hashtable<>();
|
||||
Dictionary<String, String> otherTokens = new Hashtable<>();
|
||||
public boolean storyQuest = false;
|
||||
public transient boolean isTracked = false;
|
||||
public boolean isTracked = false;
|
||||
public String sourceID = "";
|
||||
|
||||
public String getName() {
|
||||
@@ -93,6 +93,7 @@ public class AdventureQuestData implements Serializable {
|
||||
poiTokens = data.poiTokens;
|
||||
enemyTokens = data.enemyTokens;
|
||||
otherTokens = data.otherTokens;
|
||||
isTracked = data.isTracked;
|
||||
}
|
||||
|
||||
public AdventureQuestData()
|
||||
|
||||
@@ -95,6 +95,12 @@ public class AdventureQuestStage implements Serializable {
|
||||
}
|
||||
if (candidates.size() < 1)
|
||||
{
|
||||
//no POI matched, fall back to anyPOI valid for the objective that doesn't match all tags
|
||||
candidates = Current.world().getAllPointOfInterest();
|
||||
if (objective == AdventureQuestController.ObjectiveTypes.Clear)
|
||||
candidates.removeIf(q -> !Arrays.asList(q.getData().questTags).contains("Hostile"));
|
||||
else
|
||||
candidates.removeIf(q -> Arrays.asList(q.getData().questTags).contains("Hostile"));
|
||||
return;
|
||||
}
|
||||
count1 = (count1* candidates.size()/ 100);
|
||||
@@ -239,6 +245,7 @@ public class AdventureQuestStage implements Serializable {
|
||||
|
||||
if (status != AdventureQuestController.QuestStatus.Failed && this.objective == AdventureQuestController.ObjectiveTypes.Defeat) {
|
||||
{
|
||||
if (mixedEnemies){
|
||||
List<String> defeatedByTags = Arrays.stream(defeatedBy.getData().questTags).collect(Collectors.toList());
|
||||
for (String targetTag : enemyTags) {
|
||||
if (!defeatedByTags.contains(targetTag)) {
|
||||
@@ -246,8 +253,16 @@ public class AdventureQuestStage implements Serializable {
|
||||
return status;
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
if (defeatedBy.getData()!=targetEnemyData)
|
||||
//Does not count
|
||||
return status;
|
||||
}
|
||||
//All tags matched
|
||||
if (status == AdventureQuestController.QuestStatus.Active && ++progress2 >= count2){
|
||||
//progress2: number of times defeated by a matching enemy
|
||||
//count2: if > 0, fail once defeated this many times
|
||||
if (status == AdventureQuestController.QuestStatus.Active && ++progress2 >= count2 && count2 > 0){
|
||||
status = AdventureQuestController.QuestStatus.Failed;
|
||||
}
|
||||
|
||||
|
||||
@@ -625,10 +625,7 @@ public class GameHUD extends Stage {
|
||||
@Override
|
||||
public boolean act(float v) {
|
||||
if (exitDungeon) {
|
||||
Forge.switchScene(GameScene.instance());
|
||||
WorldStage.getInstance().getPlayerSprite().setMovementDirection(Vector2.Zero);
|
||||
MapStage.getInstance().getPlayerSprite().setMovementDirection(Vector2.Zero);
|
||||
gameStage.getPlayerSprite().stop();
|
||||
MapStage.getInstance().exitDungeon();
|
||||
exitToWorldMapActor.setVisible(false);
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -68,10 +68,7 @@ public class MapStage extends GameStage {
|
||||
MapLayer spriteLayer;
|
||||
private PointOfInterestChanges changes;
|
||||
private EnemySprite currentMob;
|
||||
private final Vector2 oldPosition = new Vector2();//todo
|
||||
private final Vector2 oldPosition2 = new Vector2();
|
||||
private final Vector2 oldPosition3 = new Vector2();
|
||||
private final Vector2 oldPosition4 = new Vector2();
|
||||
Queue<Vector2> positions = new LinkedList<>();
|
||||
private boolean isLoadingMatch = false;
|
||||
//private HashMap<String, Byte> mapFlags = new HashMap<>(); //Stores local map flags. These aren't available outside this map.
|
||||
|
||||
@@ -790,6 +787,7 @@ public class MapStage extends GameStage {
|
||||
@Override
|
||||
public void setWinner(boolean playerWins) {
|
||||
isLoadingMatch = false;
|
||||
matchJustEnded = true;
|
||||
if (playerWins) {
|
||||
currentMob.clearCollisionHeight();
|
||||
Current.player().win();
|
||||
@@ -814,7 +812,9 @@ public class MapStage extends GameStage {
|
||||
player.setAnimation(CharacterSprite.AnimationTypes.Idle);
|
||||
currentMob.setAnimation(CharacterSprite.AnimationTypes.Idle);
|
||||
currentMob.resetCollisionHeight();
|
||||
player.setPosition(oldPosition4);
|
||||
if (positions.peek() != null) {
|
||||
player.setPosition(positions.peek());
|
||||
}
|
||||
currentMob.freezeMovement();
|
||||
AdventureQuestController.instance().updateQuestsLose(currentMob);
|
||||
AdventureQuestController.instance().showQuestDialogs(MapStage.this);
|
||||
@@ -920,6 +920,11 @@ public class MapStage extends GameStage {
|
||||
return;
|
||||
Iterator<EnemySprite> it = enemies.iterator();
|
||||
|
||||
if (matchJustEnded){
|
||||
if (!positions.contains(player.pos()))
|
||||
matchJustEnded = false;
|
||||
}
|
||||
|
||||
if (!matchJustEnded) {
|
||||
while (it.hasNext()) {
|
||||
EnemySprite mob = it.next();
|
||||
@@ -949,10 +954,19 @@ public class MapStage extends GameStage {
|
||||
|
||||
float sprintingMod = currentModifications.containsKey(PlayerModification.Sprint) ? 2 : 1;
|
||||
player.setMoveModifier(2 * sprintingMod);
|
||||
oldPosition4.set(oldPosition3);
|
||||
oldPosition3.set(oldPosition2);
|
||||
oldPosition2.set(oldPosition);
|
||||
oldPosition.set(player.pos());
|
||||
|
||||
// oldPosition4.set(oldPosition3);
|
||||
// oldPosition3.set(oldPosition2);
|
||||
// oldPosition2.set(oldPosition);
|
||||
// oldPosition.set(player.pos());
|
||||
|
||||
positions.add(player.pos());
|
||||
if (positions.size() > 4)
|
||||
positions.remove();
|
||||
|
||||
|
||||
|
||||
|
||||
for (MapActor actor : new Array.ArrayIterator<>(actors)) {
|
||||
if (actor.collideWithPlayer(player)) {
|
||||
if (actor instanceof EnemySprite) {
|
||||
@@ -1052,7 +1066,9 @@ public class MapStage extends GameStage {
|
||||
}
|
||||
|
||||
public void resetPosition() {
|
||||
player.setPosition(oldPosition4);
|
||||
if (positions.peek() != null){
|
||||
player.setPosition(positions.peek());
|
||||
}
|
||||
stop();
|
||||
}
|
||||
|
||||
|
||||
@@ -1511,26 +1511,6 @@
|
||||
</properties>
|
||||
</object>
|
||||
<object id="181" template="../../obj/treasure.tx" x="535.273" y="131.45"/>
|
||||
<object id="183" template="../../obj/enemy.tx" x="67" y="940.5">
|
||||
<properties>
|
||||
<property name="effect">{
|
||||
"startBattleWithCardInCommandZone": [ "Chandra, Bold Pyromancer" ]
|
||||
}</property>
|
||||
<property name="enemy" value="Chandra"/>
|
||||
<property name="ignoreDungeonEffect" type="bool" value="false"/>
|
||||
<property name="reward">[
|
||||
{
|
||||
"type": "item",
|
||||
"probability": 0.01,
|
||||
"count": 1,
|
||||
"itemName": "Phoenix Charm"
|
||||
}
|
||||
]
|
||||
</property>
|
||||
<property name="spawn.Easy" type="bool" value="false"/>
|
||||
<property name="spawn.Normal" type="bool" value="true"/>
|
||||
</properties>
|
||||
</object>
|
||||
</objectgroup>
|
||||
<objectgroup id="7" name="Waypoints">
|
||||
<object id="74" template="../../obj/waypoint.tx" x="501.5" y="770.5"/>
|
||||
|
||||
@@ -2746,7 +2746,7 @@
|
||||
"POITags": [
|
||||
"BiomeGreen",
|
||||
"Hostile",
|
||||
"SideQuest"
|
||||
"Sidequest"
|
||||
],
|
||||
"objective": "Clear",
|
||||
"prologue": {},
|
||||
@@ -2948,7 +2948,7 @@
|
||||
"count2": 25,
|
||||
"POITags": [
|
||||
"Hostile",
|
||||
"SideQuest"
|
||||
"Sidequest"
|
||||
],
|
||||
"objective": "Clear",
|
||||
"prologue": {},
|
||||
@@ -2964,7 +2964,7 @@
|
||||
"objective": "Leave",
|
||||
"prologue": {},
|
||||
"epilogue": {},
|
||||
"POIToken": ""
|
||||
"POIToken": "$(poi_1)"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -3168,7 +3168,7 @@
|
||||
"POITags": [
|
||||
"BiomeWhite",
|
||||
"Hostile",
|
||||
"SideQuest"
|
||||
"Sidequest"
|
||||
],
|
||||
"objective": "Clear",
|
||||
"prologue": {},
|
||||
@@ -3596,7 +3596,7 @@
|
||||
"POITags": [
|
||||
"BiomeBlack",
|
||||
"Hostile",
|
||||
"SideQuest"
|
||||
"Sidequest"
|
||||
],
|
||||
"objective": "Clear",
|
||||
"prologue": {},
|
||||
@@ -3907,7 +3907,7 @@
|
||||
"POITags": [
|
||||
"BiomeRed",
|
||||
"Hostile",
|
||||
"SideQuest"
|
||||
"Sidequest"
|
||||
],
|
||||
"objective": "Clear",
|
||||
"prologue": {},
|
||||
@@ -4143,7 +4143,7 @@
|
||||
"POITags": [
|
||||
"BiomeBlue",
|
||||
"Hostile",
|
||||
"SideQuest"
|
||||
"Sidequest"
|
||||
],
|
||||
"objective": "Clear",
|
||||
"prologue": {},
|
||||
@@ -4376,7 +4376,7 @@
|
||||
"POITags": [
|
||||
"BiomeColorless",
|
||||
"Hostile",
|
||||
"SideQuest"
|
||||
"Sidequest"
|
||||
],
|
||||
"objective": "Clear",
|
||||
"prologue": {},
|
||||
@@ -4607,7 +4607,7 @@
|
||||
"POIReference": "$(poi_2)"
|
||||
}
|
||||
],
|
||||
"text": "3 $(enemy1)s are proving to be too much trouble to be worth your time, whether your mysterious client knows your name or not. (-2 Local Reputation)",
|
||||
"text": "3 $(enemy_1)s are proving to be too much trouble to be worth your time, whether your mysterious client knows your name or not. (-2 Local Reputation)",
|
||||
"options": [
|
||||
{
|
||||
"name": "(Quest Failed)"
|
||||
|
||||
Reference in New Issue
Block a user