diff --git a/AndorsTrail/res/raw/conversationlist_debug.json b/AndorsTrail/res/raw/conversationlist_debug.json index b57fee232..c8a3cef14 100644 --- a/AndorsTrail/res/raw/conversationlist_debug.json +++ b/AndorsTrail/res/raw/conversationlist_debug.json @@ -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" + } ] diff --git a/AndorsTrail/res/raw/monsterlist_debug.json b/AndorsTrail/res/raw/monsterlist_debug.json index a93ff42de..fd5fdf344 100644 --- a/AndorsTrail/res/raw/monsterlist_debug.json +++ b/AndorsTrail/res/raw/monsterlist_debug.json @@ -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", diff --git a/AndorsTrail/res/xml/debugmap.tmx b/AndorsTrail/res/xml/debugmap.tmx index da2f41e84..c4bec0de0 100644 --- a/AndorsTrail/res/xml/debugmap.tmx +++ b/AndorsTrail/res/xml/debugmap.tmx @@ -1,5 +1,5 @@ - + @@ -120,27 +120,27 @@ - + - eJw7ysbAcHQQ4wYOBoYnVDTvBBKmpbpbZJoHAISsT2I= + eJw7ysbAcHQU48QNHAwMTwaBO2D4BBIezObcGiD3jOJRTAkGAI9+ARE= - + - eJyby88AB7FI7JvMDBSDbDLMyOQnrIZYYMtEPbNIBfPI9AcAQ5QDxw== + eJyby88AB7FI7JvMDAMOsmnghkx+wmroBWyZBtoFtAPzBlE4jwLSQCz3QLtg4AAAxj0ELw== - + - eJxjYBgFgwkAAAGQAAE= + eJxjYBgFo2AUjIJRAAIABRAAAQ== - + - eJxjYBi+wFVgoF1AOgAAPUQAVg== + eJxjYBgFAwVcBQbaBaNgFIwCZAAANTMAVg== - + @@ -181,18 +181,35 @@ - - + + - + + + + + + + + + + + + + + + + + + diff --git a/AndorsTrail/src/com/gpl/rpg/AndorsTrail/AndorsTrailApplication.java b/AndorsTrail/src/com/gpl/rpg/AndorsTrail/AndorsTrailApplication.java index e15015a79..b4b81c93e 100644 --- a/AndorsTrail/src/com/gpl/rpg/AndorsTrail/AndorsTrailApplication.java +++ b/AndorsTrail/src/com/gpl/rpg/AndorsTrail/AndorsTrailApplication.java @@ -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"; diff --git a/AndorsTrail/src/com/gpl/rpg/AndorsTrail/controller/ConversationController.java b/AndorsTrail/src/com/gpl/rpg/AndorsTrail/controller/ConversationController.java index e242ad5d9..f5a59d042 100644 --- a/AndorsTrail/src/com/gpl/rpg/AndorsTrail/controller/ConversationController.java +++ b/AndorsTrail/src/com/gpl/rpg/AndorsTrail/controller/ConversationController.java @@ -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) { diff --git a/AndorsTrail/src/com/gpl/rpg/AndorsTrail/controller/MapController.java b/AndorsTrail/src/com/gpl/rpg/AndorsTrail/controller/MapController.java index 7327dd233..5e62a4938 100644 --- a/AndorsTrail/src/com/gpl/rpg/AndorsTrail/controller/MapController.java +++ b/AndorsTrail/src/com/gpl/rpg/AndorsTrail/controller/MapController.java @@ -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); } } diff --git a/AndorsTrail/src/com/gpl/rpg/AndorsTrail/model/map/MapObject.java b/AndorsTrail/src/com/gpl/rpg/AndorsTrail/model/map/MapObject.java index 24fcb2250..d313461ff 100644 --- a/AndorsTrail/src/com/gpl/rpg/AndorsTrail/model/map/MapObject.java +++ b/AndorsTrail/src/com/gpl/rpg/AndorsTrail/model/map/MapObject.java @@ -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); } } diff --git a/AndorsTrail/src/com/gpl/rpg/AndorsTrail/model/map/PredefinedMap.java b/AndorsTrail/src/com/gpl/rpg/AndorsTrail/model/map/PredefinedMap.java index 83e0bd0ae..b68e6e8bf 100644 --- a/AndorsTrail/src/com/gpl/rpg/AndorsTrail/model/map/PredefinedMap.java +++ b/AndorsTrail/src/com/gpl/rpg/AndorsTrail/model/map/PredefinedMap.java @@ -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 initiallyActiveMapObjectGroups; + public final List activeMapObjectGroups; public final ArrayList groundBags = new ArrayList(); public boolean visited = false; public long lastVisitTime = VISIT_RESET; @@ -41,6 +45,7 @@ public final class PredefinedMap { , Size size , MapObject[] eventObjects , MonsterSpawnArea[] spawnAreas + , List 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(); 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(); 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); diff --git a/AndorsTrail/src/com/gpl/rpg/AndorsTrail/model/map/TMXMapFileParser.java b/AndorsTrail/src/com/gpl/rpg/AndorsTrail/model/map/TMXMapFileParser.java index 3abadd9b0..959ddef5d 100644 --- a/AndorsTrail/src/com/gpl/rpg/AndorsTrail/model/map/TMXMapFileParser.java +++ b/AndorsTrail/src/com/gpl/rpg/AndorsTrail/model/map/TMXMapFileParser.java @@ -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 objects = new ArrayList(); + public final ArrayList properties = new ArrayList(); } public static final class TMXObject { public String name; diff --git a/AndorsTrail/src/com/gpl/rpg/AndorsTrail/model/map/TMXMapTranslator.java b/AndorsTrail/src/com/gpl/rpg/AndorsTrail/model/map/TMXMapTranslator.java index 8820ac392..79849c5b4 100644 --- a/AndorsTrail/src/com/gpl/rpg/AndorsTrail/model/map/TMXMapTranslator.java +++ b/AndorsTrail/src/com/gpl/rpg/AndorsTrail/model/map/TMXMapTranslator.java @@ -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 mapObjects = new ArrayList(); - ArrayList spawnAreas = new ArrayList(); + List mapObjects = new LinkedList(); + List spawnAreas = new LinkedList(); + List activeGroups = new LinkedList(); 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; diff --git a/AndorsTrail/src/com/gpl/rpg/AndorsTrail/model/script/ScriptEffect.java b/AndorsTrail/src/com/gpl/rpg/AndorsTrail/model/script/ScriptEffect.java index 096ac1e1c..cd106a4cd 100644 --- a/AndorsTrail/src/com/gpl/rpg/AndorsTrail/model/script/ScriptEffect.java +++ b/AndorsTrail/src/com/gpl/rpg/AndorsTrail/model/script/ScriptEffect.java @@ -12,8 +12,8 @@ public final class ScriptEffect { , spawnAll , removeSpawnArea , deactivateSpawnArea - , activateMapChangeArea - , deactivateMapChangeArea + , activateMapObjectGroup + , deactivateMapObjectGroup , removeQuestProgress }