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, EnemyData> enemyTokens = new Hashtable<>();
|
||||||
Dictionary<String, String> otherTokens = new Hashtable<>();
|
Dictionary<String, String> otherTokens = new Hashtable<>();
|
||||||
public boolean storyQuest = false;
|
public boolean storyQuest = false;
|
||||||
public transient boolean isTracked = false;
|
public boolean isTracked = false;
|
||||||
public String sourceID = "";
|
public String sourceID = "";
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
@@ -93,6 +93,7 @@ public class AdventureQuestData implements Serializable {
|
|||||||
poiTokens = data.poiTokens;
|
poiTokens = data.poiTokens;
|
||||||
enemyTokens = data.enemyTokens;
|
enemyTokens = data.enemyTokens;
|
||||||
otherTokens = data.otherTokens;
|
otherTokens = data.otherTokens;
|
||||||
|
isTracked = data.isTracked;
|
||||||
}
|
}
|
||||||
|
|
||||||
public AdventureQuestData()
|
public AdventureQuestData()
|
||||||
|
|||||||
@@ -95,6 +95,12 @@ public class AdventureQuestStage implements Serializable {
|
|||||||
}
|
}
|
||||||
if (candidates.size() < 1)
|
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;
|
return;
|
||||||
}
|
}
|
||||||
count1 = (count1* candidates.size()/ 100);
|
count1 = (count1* candidates.size()/ 100);
|
||||||
@@ -239,15 +245,24 @@ public class AdventureQuestStage implements Serializable {
|
|||||||
|
|
||||||
if (status != AdventureQuestController.QuestStatus.Failed && this.objective == AdventureQuestController.ObjectiveTypes.Defeat) {
|
if (status != AdventureQuestController.QuestStatus.Failed && this.objective == AdventureQuestController.ObjectiveTypes.Defeat) {
|
||||||
{
|
{
|
||||||
List<String> defeatedByTags = Arrays.stream(defeatedBy.getData().questTags).collect(Collectors.toList());
|
if (mixedEnemies){
|
||||||
for (String targetTag : enemyTags) {
|
List<String> defeatedByTags = Arrays.stream(defeatedBy.getData().questTags).collect(Collectors.toList());
|
||||||
if (!defeatedByTags.contains(targetTag)) {
|
for (String targetTag : enemyTags) {
|
||||||
//Does not count
|
if (!defeatedByTags.contains(targetTag)) {
|
||||||
return status;
|
//Does not count
|
||||||
|
return status;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else{
|
||||||
|
if (defeatedBy.getData()!=targetEnemyData)
|
||||||
|
//Does not count
|
||||||
|
return status;
|
||||||
|
}
|
||||||
//All tags matched
|
//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;
|
status = AdventureQuestController.QuestStatus.Failed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -625,10 +625,7 @@ public class GameHUD extends Stage {
|
|||||||
@Override
|
@Override
|
||||||
public boolean act(float v) {
|
public boolean act(float v) {
|
||||||
if (exitDungeon) {
|
if (exitDungeon) {
|
||||||
Forge.switchScene(GameScene.instance());
|
MapStage.getInstance().exitDungeon();
|
||||||
WorldStage.getInstance().getPlayerSprite().setMovementDirection(Vector2.Zero);
|
|
||||||
MapStage.getInstance().getPlayerSprite().setMovementDirection(Vector2.Zero);
|
|
||||||
gameStage.getPlayerSprite().stop();
|
|
||||||
exitToWorldMapActor.setVisible(false);
|
exitToWorldMapActor.setVisible(false);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -68,10 +68,7 @@ public class MapStage extends GameStage {
|
|||||||
MapLayer spriteLayer;
|
MapLayer spriteLayer;
|
||||||
private PointOfInterestChanges changes;
|
private PointOfInterestChanges changes;
|
||||||
private EnemySprite currentMob;
|
private EnemySprite currentMob;
|
||||||
private final Vector2 oldPosition = new Vector2();//todo
|
Queue<Vector2> positions = new LinkedList<>();
|
||||||
private final Vector2 oldPosition2 = new Vector2();
|
|
||||||
private final Vector2 oldPosition3 = new Vector2();
|
|
||||||
private final Vector2 oldPosition4 = new Vector2();
|
|
||||||
private boolean isLoadingMatch = false;
|
private boolean isLoadingMatch = false;
|
||||||
//private HashMap<String, Byte> mapFlags = new HashMap<>(); //Stores local map flags. These aren't available outside this map.
|
//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
|
@Override
|
||||||
public void setWinner(boolean playerWins) {
|
public void setWinner(boolean playerWins) {
|
||||||
isLoadingMatch = false;
|
isLoadingMatch = false;
|
||||||
|
matchJustEnded = true;
|
||||||
if (playerWins) {
|
if (playerWins) {
|
||||||
currentMob.clearCollisionHeight();
|
currentMob.clearCollisionHeight();
|
||||||
Current.player().win();
|
Current.player().win();
|
||||||
@@ -814,7 +812,9 @@ public class MapStage extends GameStage {
|
|||||||
player.setAnimation(CharacterSprite.AnimationTypes.Idle);
|
player.setAnimation(CharacterSprite.AnimationTypes.Idle);
|
||||||
currentMob.setAnimation(CharacterSprite.AnimationTypes.Idle);
|
currentMob.setAnimation(CharacterSprite.AnimationTypes.Idle);
|
||||||
currentMob.resetCollisionHeight();
|
currentMob.resetCollisionHeight();
|
||||||
player.setPosition(oldPosition4);
|
if (positions.peek() != null) {
|
||||||
|
player.setPosition(positions.peek());
|
||||||
|
}
|
||||||
currentMob.freezeMovement();
|
currentMob.freezeMovement();
|
||||||
AdventureQuestController.instance().updateQuestsLose(currentMob);
|
AdventureQuestController.instance().updateQuestsLose(currentMob);
|
||||||
AdventureQuestController.instance().showQuestDialogs(MapStage.this);
|
AdventureQuestController.instance().showQuestDialogs(MapStage.this);
|
||||||
@@ -920,6 +920,11 @@ public class MapStage extends GameStage {
|
|||||||
return;
|
return;
|
||||||
Iterator<EnemySprite> it = enemies.iterator();
|
Iterator<EnemySprite> it = enemies.iterator();
|
||||||
|
|
||||||
|
if (matchJustEnded){
|
||||||
|
if (!positions.contains(player.pos()))
|
||||||
|
matchJustEnded = false;
|
||||||
|
}
|
||||||
|
|
||||||
if (!matchJustEnded) {
|
if (!matchJustEnded) {
|
||||||
while (it.hasNext()) {
|
while (it.hasNext()) {
|
||||||
EnemySprite mob = it.next();
|
EnemySprite mob = it.next();
|
||||||
@@ -949,10 +954,19 @@ public class MapStage extends GameStage {
|
|||||||
|
|
||||||
float sprintingMod = currentModifications.containsKey(PlayerModification.Sprint) ? 2 : 1;
|
float sprintingMod = currentModifications.containsKey(PlayerModification.Sprint) ? 2 : 1;
|
||||||
player.setMoveModifier(2 * sprintingMod);
|
player.setMoveModifier(2 * sprintingMod);
|
||||||
oldPosition4.set(oldPosition3);
|
|
||||||
oldPosition3.set(oldPosition2);
|
// oldPosition4.set(oldPosition3);
|
||||||
oldPosition2.set(oldPosition);
|
// oldPosition3.set(oldPosition2);
|
||||||
oldPosition.set(player.pos());
|
// oldPosition2.set(oldPosition);
|
||||||
|
// oldPosition.set(player.pos());
|
||||||
|
|
||||||
|
positions.add(player.pos());
|
||||||
|
if (positions.size() > 4)
|
||||||
|
positions.remove();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for (MapActor actor : new Array.ArrayIterator<>(actors)) {
|
for (MapActor actor : new Array.ArrayIterator<>(actors)) {
|
||||||
if (actor.collideWithPlayer(player)) {
|
if (actor.collideWithPlayer(player)) {
|
||||||
if (actor instanceof EnemySprite) {
|
if (actor instanceof EnemySprite) {
|
||||||
@@ -1052,7 +1066,9 @@ public class MapStage extends GameStage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void resetPosition() {
|
public void resetPosition() {
|
||||||
player.setPosition(oldPosition4);
|
if (positions.peek() != null){
|
||||||
|
player.setPosition(positions.peek());
|
||||||
|
}
|
||||||
stop();
|
stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1511,26 +1511,6 @@
|
|||||||
</properties>
|
</properties>
|
||||||
</object>
|
</object>
|
||||||
<object id="181" template="../../obj/treasure.tx" x="535.273" y="131.45"/>
|
<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>
|
||||||
<objectgroup id="7" name="Waypoints">
|
<objectgroup id="7" name="Waypoints">
|
||||||
<object id="74" template="../../obj/waypoint.tx" x="501.5" y="770.5"/>
|
<object id="74" template="../../obj/waypoint.tx" x="501.5" y="770.5"/>
|
||||||
|
|||||||
@@ -2746,7 +2746,7 @@
|
|||||||
"POITags": [
|
"POITags": [
|
||||||
"BiomeGreen",
|
"BiomeGreen",
|
||||||
"Hostile",
|
"Hostile",
|
||||||
"SideQuest"
|
"Sidequest"
|
||||||
],
|
],
|
||||||
"objective": "Clear",
|
"objective": "Clear",
|
||||||
"prologue": {},
|
"prologue": {},
|
||||||
@@ -2948,7 +2948,7 @@
|
|||||||
"count2": 25,
|
"count2": 25,
|
||||||
"POITags": [
|
"POITags": [
|
||||||
"Hostile",
|
"Hostile",
|
||||||
"SideQuest"
|
"Sidequest"
|
||||||
],
|
],
|
||||||
"objective": "Clear",
|
"objective": "Clear",
|
||||||
"prologue": {},
|
"prologue": {},
|
||||||
@@ -2964,7 +2964,7 @@
|
|||||||
"objective": "Leave",
|
"objective": "Leave",
|
||||||
"prologue": {},
|
"prologue": {},
|
||||||
"epilogue": {},
|
"epilogue": {},
|
||||||
"POIToken": ""
|
"POIToken": "$(poi_1)"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -3168,7 +3168,7 @@
|
|||||||
"POITags": [
|
"POITags": [
|
||||||
"BiomeWhite",
|
"BiomeWhite",
|
||||||
"Hostile",
|
"Hostile",
|
||||||
"SideQuest"
|
"Sidequest"
|
||||||
],
|
],
|
||||||
"objective": "Clear",
|
"objective": "Clear",
|
||||||
"prologue": {},
|
"prologue": {},
|
||||||
@@ -3596,7 +3596,7 @@
|
|||||||
"POITags": [
|
"POITags": [
|
||||||
"BiomeBlack",
|
"BiomeBlack",
|
||||||
"Hostile",
|
"Hostile",
|
||||||
"SideQuest"
|
"Sidequest"
|
||||||
],
|
],
|
||||||
"objective": "Clear",
|
"objective": "Clear",
|
||||||
"prologue": {},
|
"prologue": {},
|
||||||
@@ -3907,7 +3907,7 @@
|
|||||||
"POITags": [
|
"POITags": [
|
||||||
"BiomeRed",
|
"BiomeRed",
|
||||||
"Hostile",
|
"Hostile",
|
||||||
"SideQuest"
|
"Sidequest"
|
||||||
],
|
],
|
||||||
"objective": "Clear",
|
"objective": "Clear",
|
||||||
"prologue": {},
|
"prologue": {},
|
||||||
@@ -4143,7 +4143,7 @@
|
|||||||
"POITags": [
|
"POITags": [
|
||||||
"BiomeBlue",
|
"BiomeBlue",
|
||||||
"Hostile",
|
"Hostile",
|
||||||
"SideQuest"
|
"Sidequest"
|
||||||
],
|
],
|
||||||
"objective": "Clear",
|
"objective": "Clear",
|
||||||
"prologue": {},
|
"prologue": {},
|
||||||
@@ -4376,7 +4376,7 @@
|
|||||||
"POITags": [
|
"POITags": [
|
||||||
"BiomeColorless",
|
"BiomeColorless",
|
||||||
"Hostile",
|
"Hostile",
|
||||||
"SideQuest"
|
"Sidequest"
|
||||||
],
|
],
|
||||||
"objective": "Clear",
|
"objective": "Clear",
|
||||||
"prologue": {},
|
"prologue": {},
|
||||||
@@ -4607,7 +4607,7 @@
|
|||||||
"POIReference": "$(poi_2)"
|
"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": [
|
"options": [
|
||||||
{
|
{
|
||||||
"name": "(Quest Failed)"
|
"name": "(Quest Failed)"
|
||||||
|
|||||||
Reference in New Issue
Block a user