ATTENTION: changes to map format.

Object Group can be set property "active" to "false" to disable all
objects within at new game (except Spawn Areas, those are treated
individually).
(de)activateMapChangeArea script rewards become
(de)activateMapObjectGroup
Persistence of active object groups in saves is implemented.
Debug map showcases the new feature, with beer !
This commit is contained in:
Zukero
2016-07-19 17:00:19 +02:00
parent 6f757c66f4
commit d126d1ebfd
11 changed files with 212 additions and 80 deletions

View File

@@ -181,5 +181,44 @@
}
],
"message": "Sorry. You already spent 100 gold..."
}
},
{
"message":"Hmmm.... Beer....",
"id":"signbeer"
},
{
"message":"Do you want beer ?",
"id":"npc3_0",
"replies":[
{
"nextPhraseID":"npc3_1",
"text":"Beer !"
}
]
},
{
"message":"Bees & beer !",
"id":"npc3_1",
"rewards":[
{
"rewardID":"debug_insect_inactive",
"mapName":"debugmap",
"rewardType":"spawnAll"
},
{
"rewardID":"Inactive",
"mapName":"debugmap",
"rewardType":"activateMapObjectGroup"
},
{
"rewardID":"Active",
"mapName":"debugmap",
"rewardType":"deactivateMapObjectGroup"
}
]
},
{
"message":"No beer for you !",
"id":"signnobeer"
}
]

View File

@@ -37,6 +37,24 @@
"max": 2
}
},
{
"id": "traveller3",
"iconID": "monsters_man1:0",
"name": "Traveller3",
"spawnGroup": "debugNPC3",
"monsterClass": "humanoid",
"unique": 1,
"maxHP": 10,
"maxAP": 10,
"moveCost": 10,
"attackCost": 10,
"attackChance": 50,
"phraseID": "npc3_0",
"attackDamage": {
"min": 1,
"max": 2
}
},
{
"id": "debug_black_ant",
"iconID": "monsters_insects:0",

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.0" orientation="orthogonal" width="10" height="10" tilewidth="32" tileheight="32">
<map version="1.0" orientation="orthogonal" width="18" height="18" tilewidth="32" tileheight="32">
<tileset firstgid="1" name="map_bed_1" tilewidth="32" tileheight="32">
<image source="../drawable/map_bed_1.png" width="512" height="256"/>
</tileset>
@@ -120,27 +120,27 @@
<tileset firstgid="4917" name="map_window_2" tilewidth="32" tileheight="32">
<image source="../drawable/map_window_2.png" width="512" height="256"/>
</tileset>
<layer name="Ground" width="10" height="10">
<layer name="Ground" width="18" height="18">
<data encoding="base64" compression="zlib">
eJw7ysbAcHQQ4wYOBoYnVDTvBBKmpbpbZJoHAISsT2I=
eJw7ysbAcHQU48QNHAwMTwaBO2D4BBIezObcGiD3jOJRTAkGAI9+ARE=
</data>
</layer>
<layer name="Objects" width="10" height="10">
<layer name="Objects" width="18" height="18">
<data encoding="base64" compression="zlib">
eJyby88AB7FI7JvMDBSDbDLMyOQnrIZYYMtEPbNIBfPI9AcAQ5QDxw==
eJyby88AB7FI7JvMDAMOsmnghkx+wmroBWyZBtoFtAPzBlE4jwLSQCz3QLtg4AAAxj0ELw==
</data>
</layer>
<layer name="Above" width="10" height="10">
<layer name="Above" width="18" height="18">
<data encoding="base64" compression="zlib">
eJxjYBgFgwkAAAGQAAE=
eJxjYBgFo2AUjIJRAAIABRAAAQ==
</data>
</layer>
<layer name="Walkable" width="10" height="10">
<layer name="Walkable" width="18" height="18">
<data encoding="base64" compression="zlib">
eJxjYBi+wFVgoF1AOgAAPUQAVg==
eJxjYBgFAwVcBQbaBaNgFIwCZAAANTMAVg==
</data>
</layer>
<objectgroup name="Object Layer 1" width="0" height="0">
<objectgroup name="Object Layer 1" width="18" height="18">
<object name="debugsign" type="sign" x="192" y="96" width="32" height="32"/>
<object name="start" type="rest" x="96" y="64" width="32" height="32"/>
<object name="Unopenable key area" type="key" x="32" y="128" width="32" height="32">
@@ -181,18 +181,35 @@
</properties>
</object>
</objectgroup>
<objectgroup name="Spawn" width="0" height="0">
<object name="debug_insect" type="spawn" x="96" y="128" width="192" height="160">
<objectgroup name="Spawn" width="18" height="18">
<object name="debug_insect" type="spawn" x="384" y="128" width="192" height="160">
<properties>
<property name="quantity" value="15"/>
</properties>
</object>
<object name="debug_troll" type="spawn" x="256" y="256" width="64" height="64">
<object name="debug_troll" type="spawn" x="512" y="256" width="64" height="64">
<properties>
<property name="quantity" value="3"/>
</properties>
</object>
<object name="debugNPC1" type="spawn" x="288" y="0" width="32" height="32"/>
<object name="debugNPC2" type="spawn" x="256" y="0" width="32" height="32"/>
<object name="debugNPC3" type="spawn" x="32" y="448" width="32" height="32"/>
</objectgroup>
<objectgroup name="Inactive" width="18" height="18">
<properties>
<property name="active" value="false"/>
</properties>
<object name="signbeer" type="sign" x="288" y="448" width="32" height="32"/>
<object name="debug_insect_inactive" type="spawn" x="96" y="416" width="160" height="96">
<properties>
<property name="active" value="false"/>
<property name="quantity" value="11"/>
<property name="spawngroup" value="debug_insect"/>
</properties>
</object>
</objectgroup>
<objectgroup name="Active" width="18" height="18">
<object name="signnobeer" type="sign" x="288" y="448" width="32" height="32"/>
</objectgroup>
</map>

View File

@@ -17,10 +17,10 @@ public final class AndorsTrailApplication extends Application {
public static final boolean DEVELOPMENT_DEBUGRESOURCES = false;
public static final boolean DEVELOPMENT_FORCE_STARTNEWGAME = false;
public static final boolean DEVELOPMENT_FORCE_CONTINUEGAME = false;
public static final boolean DEVELOPMENT_DEBUGBUTTONS = false;
public static final boolean DEVELOPMENT_DEBUGBUTTONS = true;
public static final boolean DEVELOPMENT_FASTSPEED = false;
public static final boolean DEVELOPMENT_VALIDATEDATA = true;
public static final boolean DEVELOPMENT_DEBUGMESSAGES = true;
public static final boolean DEVELOPMENT_DEBUGMESSAGES = false;
public static final boolean DEVELOPMENT_INCOMPATIBLE_SAVEGAMES = DEVELOPMENT_DEBUGRESOURCES || DEVELOPMENT_DEBUGBUTTONS || DEVELOPMENT_FASTSPEED;
public static final int CURRENT_VERSION = DEVELOPMENT_INCOMPATIBLE_SAVEGAMES ? 999 : 43;
public static final String CURRENT_VERSION_DISPLAY = "0.7.2dev";

View File

@@ -107,11 +107,11 @@ public final class ConversationController {
case deactivateSpawnArea:
deactivateSpawnArea(effect.mapName, effect.effectID, false);
break;
case activateMapChangeArea:
activateMapChangeArea(effect.mapName, effect.effectID);
case activateMapObjectGroup:
activateMapObjectGroup(effect.mapName, effect.effectID);
break;
case deactivateMapChangeArea:
deactivateMapChangeArea(effect.mapName, effect.effectID);
case deactivateMapObjectGroup:
deactivateMapObjectGroup(effect.mapName, effect.effectID);
break;
case removeQuestProgress:
addRemoveQuestProgressReward(player, effect.effectID, effect.value);
@@ -119,10 +119,9 @@ public final class ConversationController {
}
}
private void deactivateMapChangeArea(String mapName, String mapObjectID) {
private void deactivateMapObjectGroup(String mapName, String mapObjectGroupID) {
PredefinedMap map = findMapForScriptEffect(mapName);
MapObject o = map.findEventObject(MapObject.MapObjectType.newmap, mapObjectID);
controllers.mapController.deactivateMapObject(o);
controllers.mapController.deactivateMapObjectGroup(map, mapObjectGroupID);
}
private PredefinedMap findMapForScriptEffect(String mapName) {
@@ -130,10 +129,9 @@ public final class ConversationController {
return world.maps.findPredefinedMap(mapName);
}
private void activateMapChangeArea(String mapName, String mapObjectID) {
private void activateMapObjectGroup(String mapName, String mapObjectGroupID) {
PredefinedMap map = findMapForScriptEffect(mapName);
MapObject o = map.findEventObject(MapObject.MapObjectType.newmap, mapObjectID);
controllers.mapController.activateMapObject(map, o);
controllers.mapController.activateMapObjectGroup(map, mapObjectGroupID);
}
private void spawnAll(String mapName, String monsterTypeSpawnGroup) {

View File

@@ -39,7 +39,7 @@ public final class MapController {
switch (mapObject.evaluateWhen) {
case afterEveryRound:
return;
continue;
case whenEntering:
// Do not trigger event if the player already was on the same MapObject before.
if (mapObject.position.contains(lastPosition)) return;
@@ -213,13 +213,11 @@ public final class MapController {
mapScriptExecutor = new ConversationController.ConversationStatemachine(world, controllers, conversationStateListener);
}
public void activateMapObject(PredefinedMap map, MapObject o) {
if (o.isActive) return;
o.isActive = true;
if (o.type == MapObject.MapObjectType.container) map.createContainerLoot(o);
public void activateMapObjectGroup(PredefinedMap map, String group) {
map.activateMapObjectGroup(group);
}
public void deactivateMapObject(MapObject o) {
o.isActive = false;
public void deactivateMapObjectGroup(PredefinedMap map, String group) {
map.deactivateMapObjectGroup(group);
}
}

View File

@@ -26,12 +26,11 @@ public final class MapObject {
public final String id; //placeName on this map or phraseID
public final String map;
public final String place;
private final String group;
public final String group;
public final Requirement enteringRequirement;
public final DropList dropList;
public final MapObjectEvaluationType evaluateWhen;
public boolean isActive;
public final boolean isActiveForNewGame;
private MapObject(
final CoordRect position
@@ -43,7 +42,6 @@ public final class MapObject {
, final DropList dropList
, final MapObjectEvaluationType evaluateWhen
, final String group
, final boolean isActiveForNewGame
) {
this.position = new CoordRect(position);
this.type = type;
@@ -54,21 +52,16 @@ public final class MapObject {
this.dropList = dropList;
this.evaluateWhen = evaluateWhen;
this.group = group;
this.isActiveForNewGame = isActiveForNewGame;
this.isActive = isActiveForNewGame;
this.isActive = true;
}
public void resetForNewGame() {
isActive = isActiveForNewGame;
}
public static MapObject createMapSignEvent(
final CoordRect position
, final String phraseID
, String group
, boolean isActiveForNewGame
) {
return new MapObject(position, MapObjectType.sign, phraseID, null, null, null, null, MapObjectEvaluationType.whenEntering, group, isActiveForNewGame);
return new MapObject(position, MapObjectType.sign, phraseID, null, null, null, null, MapObjectEvaluationType.whenEntering, group);
}
public static MapObject createMapChangeArea(
@@ -77,18 +70,16 @@ public final class MapObject {
, final String destinationMap
, final String destinationPlace
, String group
, boolean isActiveForNewGame
) {
return new MapObject(position, MapObjectType.newmap, thisMapTitle, destinationMap, destinationPlace, null, null, MapObjectEvaluationType.whenEntering, group, isActiveForNewGame);
return new MapObject(position, MapObjectType.newmap, thisMapTitle, destinationMap, destinationPlace, null, null, MapObjectEvaluationType.whenEntering, group);
}
public static MapObject createRestArea(
final CoordRect position
, final String placeId
, String group
, boolean isActiveForNewGame
) {
return new MapObject(position, MapObjectType.rest, placeId, null, null, null, null, MapObjectEvaluationType.whenEntering, group, isActiveForNewGame);
return new MapObject(position, MapObjectType.rest, placeId, null, null, null, null, MapObjectEvaluationType.whenEntering, group);
}
public static MapObject createKeyArea(
@@ -96,18 +87,16 @@ public final class MapObject {
, final String phraseID
, final Requirement enteringRequirement
, String group
, boolean isActiveForNewGame
) {
return new MapObject(position, MapObjectType.keyarea, phraseID, null, null, enteringRequirement, null, MapObjectEvaluationType.whenEntering, group, isActiveForNewGame);
return new MapObject(position, MapObjectType.keyarea, phraseID, null, null, enteringRequirement, null, MapObjectEvaluationType.whenEntering, group);
}
public static MapObject createContainerArea(
final CoordRect position
, final DropList dropList
, String group
, boolean isActiveForNewGame
) {
return new MapObject(position, MapObjectType.container, null, null, null, null, dropList, MapObjectEvaluationType.whenEntering, group, isActiveForNewGame);
return new MapObject(position, MapObjectType.container, null, null, null, null, dropList, MapObjectEvaluationType.whenEntering, group);
}
public static MapObject createScriptArea(
@@ -115,8 +104,7 @@ public final class MapObject {
, final String phraseID
, final MapObjectEvaluationType evaluateWhen
, String group
, boolean isActiveForNewGame
) {
return new MapObject(position, MapObjectType.script, phraseID, null, null, null, null, evaluateWhen, group, isActiveForNewGame);
return new MapObject(position, MapObjectType.script, phraseID, null, null, null, null, evaluateWhen, group);
}
}

View File

@@ -8,6 +8,7 @@ import com.gpl.rpg.AndorsTrail.controller.VisualEffectController.BloodSplatter;
import com.gpl.rpg.AndorsTrail.model.actor.Monster;
import com.gpl.rpg.AndorsTrail.model.item.ItemType;
import com.gpl.rpg.AndorsTrail.model.item.Loot;
import com.gpl.rpg.AndorsTrail.model.map.MapObject.MapObjectType;
import com.gpl.rpg.AndorsTrail.util.Coord;
import com.gpl.rpg.AndorsTrail.util.CoordRect;
import com.gpl.rpg.AndorsTrail.util.L;
@@ -17,6 +18,7 @@ import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
public final class PredefinedMap {
@@ -27,6 +29,8 @@ public final class PredefinedMap {
public final Size size;
public final MapObject[] eventObjects;
public final MonsterSpawnArea[] spawnAreas;
public final List<String> initiallyActiveMapObjectGroups;
public final List<String> activeMapObjectGroups;
public final ArrayList<Loot> groundBags = new ArrayList<Loot>();
public boolean visited = false;
public long lastVisitTime = VISIT_RESET;
@@ -41,6 +45,7 @@ public final class PredefinedMap {
, Size size
, MapObject[] eventObjects
, MonsterSpawnArea[] spawnAreas
, List<String> initiallyActiveMapObjectGroups
, boolean isOutdoors
) {
this.xmlResourceId = xmlResourceId;
@@ -48,6 +53,8 @@ public final class PredefinedMap {
this.size = size;
this.eventObjects = eventObjects;
this.spawnAreas = spawnAreas;
this.initiallyActiveMapObjectGroups = initiallyActiveMapObjectGroups;
this.activeMapObjectGroups = new LinkedList<String>();
assert(size.width > 0);
assert(size.height > 0);
this.isOutdoors = isOutdoors;
@@ -84,6 +91,7 @@ public final class PredefinedMap {
for (MapObject o : eventObjects) {
if (!o.isActive) continue;
if (!o.position.contains(p)) continue;
if (!activeMapObjectGroups.contains(o.group)) continue;
if (result == null) result = new ArrayList<MapObject>();
result.add(o);
}
@@ -155,9 +163,9 @@ public final class PredefinedMap {
for (MonsterSpawnArea a : spawnAreas) {
a.resetForNewGame();
}
for (MapObject o : eventObjects) {
o.resetForNewGame();
}
activeMapObjectGroups.clear();
activeMapObjectGroups.addAll(initiallyActiveMapObjectGroups);
activateMapObjects();
resetTemporaryData();
groundBags.clear();
visited = false;
@@ -197,6 +205,44 @@ public final class PredefinedMap {
}
private void activateMapObjects() {
if (AndorsTrailApplication.DEVELOPMENT_DEBUGMESSAGES) {
L.log("Applying active status to all map objects in map "+name);
}
for (MapObject o : eventObjects) {
o.isActive = activeMapObjectGroups.contains(o.group);
}
}
public void activateMapObjectGroup(String group) {
if (AndorsTrailApplication.DEVELOPMENT_DEBUGMESSAGES) {
L.log("Applying active status to object group "+group+" in map "+name);
}
if (!activeMapObjectGroups.contains(group)) {
activeMapObjectGroups.add(group);
for (MapObject o : eventObjects) {
if (o.group.equals(group)) {
o.isActive = true;
if (o.type == MapObjectType.container) createContainerLoot(o);
}
}
}
}
public void deactivateMapObjectGroup(String group) {
if (AndorsTrailApplication.DEVELOPMENT_DEBUGMESSAGES) {
L.log("Removing active status to object group "+group+" in map"+name);
}
if (activeMapObjectGroups.contains(group)) {
activeMapObjectGroups.remove(group);
for (MapObject o : eventObjects) {
if (o.group.equals(group)) {
o.isActive = false;
}
}
}
}
// ====== PARCELABLE ===================================================================
@@ -215,10 +261,7 @@ public final class PredefinedMap {
}
if(fileversion >= 43) {
//Spawn areas now have unique IDs. Need to check as maps can change.
int idLength = src.readInt();
byte[] idBytes = new byte[idLength];
src.read(idBytes);
String id = new String(idBytes);
String id = src.readUTF();
int j = i;
boolean found = false;
do {
@@ -238,6 +281,18 @@ public final class PredefinedMap {
this.spawnAreas[i].readFromParcel(src, world, fileversion);
}
}
activeMapObjectGroups.clear();
if(fileversion >= 43) {
int activeListLength = src.readInt();
for (int i = 0; i < activeListLength; i++) {
String activeGroupID = src.readUTF();
activeMapObjectGroups.add(activeGroupID);
}
} else {
activeMapObjectGroups.addAll(initiallyActiveMapObjectGroups);
}
activateMapObjects();
groundBags.clear();
if (fileversion <= 5) return;
@@ -265,6 +320,10 @@ public final class PredefinedMap {
/*int lastVisitVersion = */src.readInt();
}
}
} else {
activeMapObjectGroups.clear();
activeMapObjectGroups.addAll(initiallyActiveMapObjectGroups);
activateMapObjects();
}
if (fileversion >= 37) {
if (fileversion < 41) visited = true;
@@ -289,9 +348,8 @@ public final class PredefinedMap {
if (this.visited && a.isUnique) return true;
if (a.isSpawning != a.isSpawningForNewGame) return true;
}
for (MapObject o : eventObjects) {
if (o.isActive != o.isActiveForNewGame) return true;
}
if (!activeMapObjectGroups.containsAll(initiallyActiveMapObjectGroups)
|| !initiallyActiveMapObjectGroups.containsAll(activeMapObjectGroups)) return true;
return false;
}
@@ -300,11 +358,13 @@ public final class PredefinedMap {
dest.writeBoolean(true);
dest.writeInt(spawnAreas.length);
for(MonsterSpawnArea a : spawnAreas) {
byte[] idBytes = a.areaID.getBytes();
dest.writeInt(idBytes.length);
dest.write(idBytes);
dest.writeUTF(a.areaID);
a.writeToParcel(dest);
}
dest.writeInt(activeMapObjectGroups.size());
for(String s : activeMapObjectGroups) {
dest.writeUTF(s);
}
dest.writeInt(groundBags.size());
for(Loot l : groundBags) {
l.writeToParcel(dest);

View File

@@ -144,6 +144,8 @@ public final class TMXMapFileParser {
public void handleTag(XmlResourceParser xrp, String tagName) throws XmlPullParserException, IOException {
if (tagName.equals("object")) {
group.objects.add(readTMXObject(xrp));
} else if (tagName.equals("property")) {
group.properties.add(readTMXProperty(xrp));
}
}
});
@@ -291,6 +293,7 @@ public final class TMXMapFileParser {
public static final class TMXObjectGroup {
public String name;
public final ArrayList<TMXObject> objects = new ArrayList<TMXObject>();
public final ArrayList<TMXProperty> properties = new ArrayList<TMXProperty>();
}
public static final class TMXObject {
public String name;

View File

@@ -1,6 +1,7 @@
package com.gpl.rpg.AndorsTrail.model.map;
import android.content.res.Resources;
import com.gpl.rpg.AndorsTrail.AndorsTrailApplication;
import com.gpl.rpg.AndorsTrail.model.actor.MonsterType;
import com.gpl.rpg.AndorsTrail.model.actor.MonsterTypeCollection;
@@ -47,14 +48,25 @@ public final class TMXMapTranslator {
}
final Size mapSize = new Size(m.width, m.height);
ArrayList<MapObject> mapObjects = new ArrayList<MapObject>();
ArrayList<MonsterSpawnArea> spawnAreas = new ArrayList<MonsterSpawnArea>();
List<MapObject> mapObjects = new LinkedList<MapObject>();
List<MonsterSpawnArea> spawnAreas = new LinkedList<MonsterSpawnArea>();
List<String> activeGroups = new LinkedList<String>();
for (TMXObjectGroup group : m.objectGroups) {
boolean active = true;
for (TMXProperty p : group.properties) {
if (p.name.equalsIgnoreCase("active")) {
active = Boolean.parseBoolean(p.value);
} else if (AndorsTrailApplication.DEVELOPMENT_VALIDATEDATA) {
L.log("OPTIMIZE: Map " + m.name + ", group " + group.name + " has unrecognized property \"" + p.name + "\".");
}
}
if (active) {
activeGroups.add(group.name);
}
for (TMXObject object : group.objects) {
final CoordRect position = getTMXObjectPosition(object, m);
final Coord topLeft = position.topLeft;
boolean isActiveForNewGame = true;
if (object.type == null) {
if (AndorsTrailApplication.DEVELOPMENT_VALIDATEDATA)
@@ -64,7 +76,7 @@ public final class TMXMapTranslator {
for (TMXProperty p : object.properties) {
if (AndorsTrailApplication.DEVELOPMENT_VALIDATEDATA) L.log("OPTIMIZE: Map " + m.name + ", sign " + object.name + "@" + topLeft.toString() + " has unrecognized property \"" + p.name + "\".");
}
mapObjects.add(MapObject.createMapSignEvent(position, phraseID, group.name, isActiveForNewGame));
mapObjects.add(MapObject.createMapSignEvent(position, phraseID, group.name));
} else if (object.type.equalsIgnoreCase("mapchange")) {
String map = null;
String place = null;
@@ -73,14 +85,13 @@ public final class TMXMapTranslator {
map = p.value;
} else if (p.name.equalsIgnoreCase("place")) {
place = p.value;
} else if (p.name.equalsIgnoreCase("active")) {
isActiveForNewGame = Boolean.parseBoolean(p.value);
} else if (AndorsTrailApplication.DEVELOPMENT_VALIDATEDATA) {
L.log("OPTIMIZE: Map " + m.name + ", mapchange " + object.name + "@" + topLeft.toString() + " has unrecognized property \"" + p.name + "\".");
}
}
mapObjects.add(MapObject.createMapChangeArea(position, object.name, map, place, group.name, isActiveForNewGame));
mapObjects.add(MapObject.createMapChangeArea(position, object.name, map, place, group.name));
} else if (object.type.equalsIgnoreCase("spawn")) {
boolean isActiveForNewGame = true;
int maxQuantity = 1;
int spawnChance = 10;
String spawnGroup = object.name;
@@ -149,13 +160,13 @@ public final class TMXMapTranslator {
L.log("OPTIMIZE: Map " + m.name + ", key " + object.name + "@" + topLeft.toString() + " has unrecognized property \"" + p.name + "\".");
}
}
mapObjects.add(MapObject.createKeyArea(position, phraseID, new Requirement(requireType, requireId, requireValue, requireNegation), group.name, isActiveForNewGame));
mapObjects.add(MapObject.createKeyArea(position, phraseID, new Requirement(requireType, requireId, requireValue, requireNegation), group.name));
} else if (object.type.equals("rest")) {
mapObjects.add(MapObject.createRestArea(position, object.name, group.name, isActiveForNewGame));
mapObjects.add(MapObject.createRestArea(position, object.name, group.name));
} else if (object.type.equals("container")) {
DropList dropList = dropLists.getDropList(object.name);
if (dropList == null) continue;
mapObjects.add(MapObject.createContainerArea(position, dropList, group.name, isActiveForNewGame));
mapObjects.add(MapObject.createContainerArea(position, dropList, group.name));
} else if (object.type.equals("replace")) {
// Do nothing. Will be handled when reading map layers instead.
} else if (object.type.equalsIgnoreCase("script")) {
@@ -178,7 +189,7 @@ public final class TMXMapTranslator {
L.log("OPTIMIZE: Map " + m.name + ", script " + object.name + "@" + topLeft.toString() + " has unrecognized property \"" + p.name + "\".");
}
}
mapObjects.add(MapObject.createScriptArea(position, phraseID, evaluateWhen, group.name, isActiveForNewGame));
mapObjects.add(MapObject.createScriptArea(position, phraseID, evaluateWhen, group.name));
} else if (AndorsTrailApplication.DEVELOPMENT_VALIDATEDATA) {
L.log("OPTIMIZE: Map " + m.name + ", has unrecognized object type \"" + object.type + "\" for name \"" + object.name + "\".");
}
@@ -189,7 +200,7 @@ public final class TMXMapTranslator {
MonsterSpawnArea[] _spawnAreas = new MonsterSpawnArea[spawnAreas.size()];
_spawnAreas = spawnAreas.toArray(_spawnAreas);
result.add(new PredefinedMap(m.xmlResourceId, m.name, mapSize, _eventObjects, _spawnAreas, isOutdoors));
result.add(new PredefinedMap(m.xmlResourceId, m.name, mapSize, _eventObjects, _spawnAreas, activeGroups, isOutdoors));
}
return result;

View File

@@ -12,8 +12,8 @@ public final class ScriptEffect {
, spawnAll
, removeSpawnArea
, deactivateSpawnArea
, activateMapChangeArea
, deactivateMapChangeArea
, activateMapObjectGroup
, deactivateMapObjectGroup
, removeQuestProgress
}