mirror of
https://github.com/OMGeeky/andors-trail.git
synced 2026-02-23 15:38:29 +01:00
Merge branch 'master' into stoutford_tests
This commit is contained in:
@@ -41,6 +41,7 @@
|
||||
"iconID":"actorconditions_1:70",
|
||||
"name":"Focused damage",
|
||||
"category":"mental",
|
||||
"isPositive":1,
|
||||
"abilityEffect":{
|
||||
"increaseAttackDamage":{
|
||||
"min":3,
|
||||
@@ -54,6 +55,7 @@
|
||||
"iconID":"actorconditions_1:98",
|
||||
"name":"Focused accuracy",
|
||||
"category":"mental",
|
||||
"isPositive":1,
|
||||
"abilityEffect":{
|
||||
"increaseAttackChance":40,
|
||||
"increaseAttackCost":1
|
||||
@@ -64,7 +66,7 @@
|
||||
"iconID":"actorconditions_1:60",
|
||||
"name":"Irdegh poison",
|
||||
"category":"blood",
|
||||
"stacking":1,
|
||||
"isStacking":1,
|
||||
"roundEffect":{
|
||||
"visualEffectID":"greenSplash",
|
||||
"increaseCurrentHP":{
|
||||
@@ -73,4 +75,4 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
]
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
"iconID":"actorconditions_1:70",
|
||||
"name":"Blessing of Shadow strength",
|
||||
"category":"spiritual",
|
||||
"isPositive":1,
|
||||
"abilityEffect":{
|
||||
"increaseAttackDamage":{
|
||||
"min":1,
|
||||
@@ -27,6 +28,7 @@
|
||||
"iconID":"actorconditions_1:35",
|
||||
"name":"Blessing of Shadow regeneration",
|
||||
"category":"spiritual",
|
||||
"isPositive":1,
|
||||
"roundEffect":{
|
||||
"visualEffectID":"blueSwirl",
|
||||
"increaseCurrentHP":{
|
||||
@@ -40,6 +42,7 @@
|
||||
"iconID":"actorconditions_1:98",
|
||||
"name":"Blessing of Shadow accuracy",
|
||||
"category":"spiritual",
|
||||
"isPositive":1,
|
||||
"abilityEffect":{
|
||||
"increaseAttackChance":30
|
||||
}
|
||||
@@ -49,6 +52,7 @@
|
||||
"iconID":"actorconditions_1:91",
|
||||
"name":"Shadow guardian blessing",
|
||||
"category":"spiritual",
|
||||
"isPositive":1,
|
||||
"abilityEffect":{
|
||||
"increaseMaxHP":30,
|
||||
"increaseDamageResistance":1
|
||||
@@ -59,7 +63,7 @@
|
||||
"iconID":"actorconditions_1:89",
|
||||
"name":"Internal bleeding",
|
||||
"category":"physical",
|
||||
"stacking":1,
|
||||
"isStacking":1,
|
||||
"abilityEffect":{
|
||||
"increaseAttackChance":-50,
|
||||
"increaseAttackDamage":{
|
||||
@@ -74,7 +78,7 @@
|
||||
"iconID":"actorconditions_1:89",
|
||||
"name":"Fracture",
|
||||
"category":"physical",
|
||||
"stacking":1,
|
||||
"isStacking":1,
|
||||
"abilityEffect":{
|
||||
"increaseBlockChance":-50,
|
||||
"increaseDamageResistance":-2
|
||||
@@ -85,9 +89,9 @@
|
||||
"iconID":"actorconditions_1:80",
|
||||
"name":"Concussion",
|
||||
"category":"physical",
|
||||
"stacking":1,
|
||||
"isStacking":1,
|
||||
"abilityEffect":{
|
||||
"increaseAttackChance":-30
|
||||
}
|
||||
}
|
||||
]
|
||||
]
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"iconID":"actorconditions_1:35",
|
||||
"name":"Sustenance",
|
||||
"category":"physical",
|
||||
"isPositive":1,
|
||||
"roundEffect":{
|
||||
"increaseCurrentHP":{
|
||||
"min":1,
|
||||
@@ -23,4 +24,4 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
]
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"iconID":"actorconditions_1:41",
|
||||
"name":"Bless",
|
||||
"category":"spiritual",
|
||||
"isPositive":1,
|
||||
"abilityEffect":{
|
||||
"increaseAttackChance":5
|
||||
}
|
||||
@@ -26,6 +27,7 @@
|
||||
"iconID":"actorconditions_1:70",
|
||||
"name":"Strength",
|
||||
"category":"physical",
|
||||
"isPositive":1,
|
||||
"abilityEffect":{
|
||||
"increaseAttackDamage":{
|
||||
"min":1,
|
||||
@@ -38,6 +40,7 @@
|
||||
"iconID":"actorconditions_1:35",
|
||||
"name":"Shadow Regeneration",
|
||||
"category":"spiritual",
|
||||
"isPositive":1,
|
||||
"roundEffect":{
|
||||
"visualEffectID":"blueSwirl",
|
||||
"increaseCurrentHP":{
|
||||
@@ -46,4 +49,4 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
]
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"iconID":"actorconditions_1:87",
|
||||
"name":"Minor speed",
|
||||
"category":"physical",
|
||||
"isPositive":1,
|
||||
"abilityEffect":{
|
||||
"increaseMaxAP":2
|
||||
}
|
||||
@@ -39,7 +40,7 @@
|
||||
"iconID":"actorconditions_2:0",
|
||||
"name":"Bleeding wound",
|
||||
"category":"blood",
|
||||
"stacking":1,
|
||||
"isStacking":1,
|
||||
"roundEffect":{
|
||||
"visualEffectID":"redSplash",
|
||||
"increaseCurrentHP":{
|
||||
@@ -53,6 +54,7 @@
|
||||
"iconID":"actorconditions_1:90",
|
||||
"name":"Minor berserker rage",
|
||||
"category":"mental",
|
||||
"isPositive":1,
|
||||
"abilityEffect":{
|
||||
"increaseAttackChance":60,
|
||||
"increaseMaxHP":35,
|
||||
@@ -76,6 +78,7 @@
|
||||
"iconID":"actorconditions_2:1",
|
||||
"name":"Intoxicated",
|
||||
"category":"mental",
|
||||
"isPositive":1,
|
||||
"abilityEffect":{
|
||||
"increaseAttackChance":-30,
|
||||
"increaseAttackDamage":{
|
||||
@@ -95,4 +98,4 @@
|
||||
"increaseBlockChance":-40
|
||||
}
|
||||
}
|
||||
]
|
||||
]
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"iconID":"actorconditions_1:56",
|
||||
"name":"Corrosive Slime",
|
||||
"category":"physical",
|
||||
"stacking":1,
|
||||
"isStacking":1,
|
||||
"roundEffect":{
|
||||
"increaseCurrentHP":{
|
||||
"min":-1,
|
||||
@@ -21,6 +21,7 @@
|
||||
"iconID":"actorconditions_1:44",
|
||||
"name":"Heightened senses",
|
||||
"category":"physical",
|
||||
"isPositive":1,
|
||||
"abilityEffect":{
|
||||
"increaseAttackChance":5,
|
||||
"increaseAttackDamage":{
|
||||
@@ -35,6 +36,7 @@
|
||||
"iconID":"actorconditions_1:92",
|
||||
"name":"Courage",
|
||||
"category":"mental",
|
||||
"isPositive":1,
|
||||
"roundEffect":{
|
||||
"visualEffectID":"blueSwirl",
|
||||
"increaseCurrentHP":{
|
||||
@@ -71,6 +73,7 @@
|
||||
"iconID":"actorconditions_1:47",
|
||||
"name":"Fortified defense",
|
||||
"category":"physical",
|
||||
"isPositive":1,
|
||||
"abilityEffect":{
|
||||
"increaseBlockChance":22
|
||||
}
|
||||
@@ -80,6 +83,7 @@
|
||||
"iconID":"actorconditions_1:78",
|
||||
"name":"Vulnerability awareness",
|
||||
"category":"physical",
|
||||
"isPositive":1,
|
||||
"abilityEffect":{
|
||||
"increaseCriticalSkill":10
|
||||
}
|
||||
@@ -89,6 +93,7 @@
|
||||
"iconID":"actorconditions_1:35",
|
||||
"name":"Regeneration",
|
||||
"category":"physical",
|
||||
"isPositive":1,
|
||||
"roundEffect":{
|
||||
"visualEffectID":"blueSwirl",
|
||||
"increaseCurrentHP":{
|
||||
@@ -102,6 +107,7 @@
|
||||
"iconID":"actorconditions_1:20",
|
||||
"name":"Bark skin",
|
||||
"category":"physical",
|
||||
"isPositive":1,
|
||||
"abilityEffect":{
|
||||
"increaseDamageResistance":1
|
||||
}
|
||||
@@ -111,6 +117,7 @@
|
||||
"iconID":"actorconditions_1:101",
|
||||
"name":"Shadow's accuracy",
|
||||
"category":"spiritual",
|
||||
"isPositive":1,
|
||||
"abilityEffect":{
|
||||
"increaseAttackChance":15
|
||||
}
|
||||
@@ -120,6 +127,7 @@
|
||||
"iconID":"actorconditions_1:28",
|
||||
"name":"Shadow's protection",
|
||||
"category":"spiritual",
|
||||
"isPositive":1,
|
||||
"roundEffect":{
|
||||
"visualEffectID":"blueSwirl",
|
||||
"increaseCurrentHP":{
|
||||
@@ -137,6 +145,7 @@
|
||||
"iconID":"actorconditions_1:70",
|
||||
"name":"Shadow's strength",
|
||||
"category":"spiritual",
|
||||
"isPositive":1,
|
||||
"abilityEffect":{
|
||||
"increaseAttackDamage":{
|
||||
"min":0,
|
||||
@@ -149,6 +158,7 @@
|
||||
"iconID":"actorconditions_1:87",
|
||||
"name":"Haste",
|
||||
"category":"physical",
|
||||
"isPositive":1,
|
||||
"abilityEffect":{
|
||||
"increaseMaxAP":2,
|
||||
"increaseMoveCost":-1,
|
||||
@@ -176,7 +186,7 @@
|
||||
"iconID":"actorconditions_1:63",
|
||||
"name":"Minor sting",
|
||||
"category":"physical",
|
||||
"stacking":1,
|
||||
"isStacking":1,
|
||||
"roundEffect":{
|
||||
"increaseCurrentHP":{
|
||||
"min":-1,
|
||||
@@ -184,4 +194,4 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
]
|
||||
|
||||
@@ -192,7 +192,19 @@
|
||||
"replies":[
|
||||
{
|
||||
"nextPhraseID":"npc3_1",
|
||||
"text":"Beer !"
|
||||
"text":"Beer!"
|
||||
},
|
||||
{
|
||||
"nextPhraseID":"npc3_2",
|
||||
"text":"Lights out!"
|
||||
},
|
||||
{
|
||||
"nextPhraseID":"npc3_3",
|
||||
"text":"Lights on!"
|
||||
},
|
||||
{
|
||||
"nextPhraseID":"npc3_4",
|
||||
"text":"Red ligths!"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -220,5 +232,38 @@
|
||||
{
|
||||
"message":"No beer for you !",
|
||||
"id":"signnobeer"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id":"npc3_2",
|
||||
"message":"Ok.",
|
||||
"rewards":[
|
||||
{
|
||||
"rewardType":"changeMapFilter",
|
||||
"rewardID":"black80",
|
||||
"mapName":"debugmap"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id":"npc3_3",
|
||||
"message":"Ok.",
|
||||
"rewards":[
|
||||
{
|
||||
"rewardType":"changeMapFilter",
|
||||
"rewardID":"none",
|
||||
"mapName":"debugmap"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id":"npc3_4",
|
||||
"message":"Ok.",
|
||||
"rewards":[
|
||||
{
|
||||
"rewardType":"changeMapFilter",
|
||||
"rewardID":"redtint",
|
||||
"mapName":"debugmap"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
@@ -14,11 +14,11 @@ import java.util.Locale;
|
||||
|
||||
public final class AndorsTrailApplication extends Application {
|
||||
|
||||
public static final boolean DEVELOPMENT_DEBUGRESOURCES = false;
|
||||
public static final boolean DEVELOPMENT_DEBUGRESOURCES = true;
|
||||
public static final boolean DEVELOPMENT_FORCE_STARTNEWGAME = false;
|
||||
public static final boolean DEVELOPMENT_FORCE_CONTINUEGAME = false;
|
||||
public static final boolean DEVELOPMENT_DEBUGBUTTONS = true;
|
||||
public static final boolean DEVELOPMENT_FASTSPEED = 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_INCOMPATIBLE_SAVEGAMES = DEVELOPMENT_DEBUGRESOURCES || DEVELOPMENT_DEBUGBUTTONS || DEVELOPMENT_FASTSPEED;
|
||||
|
||||
@@ -22,7 +22,6 @@ import com.gpl.rpg.AndorsTrail.model.conversation.Reply;
|
||||
import com.gpl.rpg.AndorsTrail.model.item.ItemTypeCollection;
|
||||
import com.gpl.rpg.AndorsTrail.model.item.Loot;
|
||||
import com.gpl.rpg.AndorsTrail.model.map.LayeredTileMap;
|
||||
import com.gpl.rpg.AndorsTrail.model.map.MapObject;
|
||||
import com.gpl.rpg.AndorsTrail.model.map.MonsterSpawnArea;
|
||||
import com.gpl.rpg.AndorsTrail.model.map.PredefinedMap;
|
||||
import com.gpl.rpg.AndorsTrail.model.quest.QuestLogEntry;
|
||||
@@ -59,12 +58,12 @@ public final class ConversationController {
|
||||
}
|
||||
}
|
||||
|
||||
private ScriptEffectResult applyScriptEffectsForPhrase(final Player player, final Phrase phrase) {
|
||||
private ScriptEffectResult applyScriptEffectsForPhrase(Resources res, final Player player, final Phrase phrase) {
|
||||
if (phrase.scriptEffects == null || phrase.scriptEffects.length == 0) return null;
|
||||
|
||||
final ScriptEffectResult result = new ScriptEffectResult();
|
||||
for (ScriptEffect effect : phrase.scriptEffects) {
|
||||
applyScriptEffect(player, effect, result);
|
||||
applyScriptEffect(res, player, effect, result);
|
||||
}
|
||||
|
||||
if (result.isEmpty()) return null;
|
||||
@@ -75,7 +74,7 @@ public final class ConversationController {
|
||||
return result;
|
||||
}
|
||||
|
||||
private void applyScriptEffect(Player player, ScriptEffect effect, ScriptEffectResult result) {
|
||||
private void applyScriptEffect(Resources res, Player player, ScriptEffect effect, ScriptEffectResult result) {
|
||||
switch (effect.type) {
|
||||
case actorCondition:
|
||||
addActorConditionReward(player, effect.effectID, effect.value, result);
|
||||
@@ -116,9 +115,20 @@ public final class ConversationController {
|
||||
case removeQuestProgress:
|
||||
addRemoveQuestProgressReward(player, effect.effectID, effect.value);
|
||||
break;
|
||||
case changeMapFilter:
|
||||
changeMapFilter(res, effect.mapName, effect.effectID);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void changeMapFilter(Resources res, String mapName, String effectID) {
|
||||
PredefinedMap map = findMapForScriptEffect(mapName);
|
||||
map.currentColorFilter = effectID;
|
||||
if (world.model.currentMap == map) {
|
||||
controllers.mapController.applyCurrentMapReplacements(res, true);
|
||||
}
|
||||
}
|
||||
|
||||
private void deactivateMapObjectGroup(String mapName, String mapObjectGroupID) {
|
||||
PredefinedMap map = findMapForScriptEffect(mapName);
|
||||
controllers.mapController.deactivateMapObjectGroup(map, mapObjectGroupID);
|
||||
@@ -360,7 +370,7 @@ public final class ConversationController {
|
||||
setCurrentPhrase(res, phraseID);
|
||||
|
||||
if (applyScriptEffects) {
|
||||
ScriptEffectResult scriptEffectResult = controllers.conversationController.applyScriptEffectsForPhrase(player, currentPhrase);
|
||||
ScriptEffectResult scriptEffectResult = controllers.conversationController.applyScriptEffectsForPhrase(res, player, currentPhrase);
|
||||
if (scriptEffectResult != null) {
|
||||
listener.onScriptEffectsApplied(scriptEffectResult);
|
||||
}
|
||||
|
||||
@@ -190,6 +190,13 @@ public final class MapController {
|
||||
hasUpdated = true;
|
||||
}
|
||||
}
|
||||
if (map.currentColorFilter != null) {
|
||||
LayeredTileMap.ColorFilterId filter = LayeredTileMap.ColorFilterId.valueOf(map.currentColorFilter);
|
||||
if (filter != tileMap.colorFilter) {
|
||||
tileMap.changeColorFilter(filter);
|
||||
hasUpdated = true;
|
||||
}
|
||||
}
|
||||
map.lastSeenLayoutHash = tileMap.getCurrentLayoutHash();
|
||||
return hasUpdated;
|
||||
}
|
||||
|
||||
@@ -301,6 +301,7 @@ public final class MovementController implements TimedMessageTask.Callback {
|
||||
|
||||
private void cacheCurrentMapData(final Resources res, final PredefinedMap nextMap) {
|
||||
LayeredTileMap mapTiles = TMXMapTranslator.readLayeredTileMap(res, world.tileManager.tileCache, nextMap);
|
||||
mapTiles.changeColorFilter(nextMap.currentColorFilter);
|
||||
TileCollection cachedTiles = world.tileManager.loadTilesFor(nextMap, mapTiles, world, res);
|
||||
world.model.currentTileMap = mapTiles;
|
||||
world.tileManager.currentMapTiles = cachedTiles;
|
||||
|
||||
@@ -19,26 +19,42 @@ public final class LayeredTileMap {
|
||||
private static final ColorFilter colorFilterRedTint = createRedTintColorFilter();
|
||||
private static final ColorFilter colorFilterGreenTint = createGreenTintColorFilter();
|
||||
private static final ColorFilter colorFilterBlueTint = createBlueTintColorFilter();
|
||||
|
||||
|
||||
public enum ColorFilterId {
|
||||
none,
|
||||
black20,
|
||||
black40,
|
||||
black60,
|
||||
black80,
|
||||
invert,
|
||||
bw,
|
||||
redtint,
|
||||
greentint,
|
||||
bluetint
|
||||
}
|
||||
|
||||
private final Size size;
|
||||
public final MapSection currentLayout;
|
||||
private String currentLayoutHash;
|
||||
public final ReplaceableMapSection[] replacements;
|
||||
public final String colorFilter;
|
||||
public final ColorFilterId originalColorFilter;
|
||||
public ColorFilterId colorFilter;
|
||||
public final Collection<Integer> usedTileIDs;
|
||||
public LayeredTileMap(
|
||||
Size size
|
||||
, MapSection layout
|
||||
, ReplaceableMapSection[] replacements
|
||||
, String colorFilter
|
||||
, ColorFilterId colorFilter
|
||||
, Collection<Integer> usedTileIDs
|
||||
) {
|
||||
this.size = size;
|
||||
this.currentLayout = layout;
|
||||
this.replacements = replacements;
|
||||
this.colorFilter = colorFilter;
|
||||
this.originalColorFilter = colorFilter;
|
||||
colorFilter = originalColorFilter;
|
||||
this.usedTileIDs = usedTileIDs;
|
||||
this.currentLayoutHash = currentLayout.calculateHash();
|
||||
this.currentLayoutHash = currentLayout.calculateHash(colorFilter.name());
|
||||
}
|
||||
|
||||
public final boolean isWalkable(final Coord p) {
|
||||
@@ -78,17 +94,30 @@ public final class LayeredTileMap {
|
||||
|
||||
public ColorFilter getColorFilter() {
|
||||
if (colorFilter == null) return null;
|
||||
else if (colorFilter.length() <= 0) return null;
|
||||
else if (colorFilter.equals("black20")) return colorFilterBlack20;
|
||||
else if (colorFilter.equals("black40")) return colorFilterBlack40;
|
||||
else if (colorFilter.equals("black60")) return colorFilterBlack60;
|
||||
else if (colorFilter.equals("black80")) return colorFilterBlack80;
|
||||
else if (colorFilter.equals("invert")) return colorFilterInvert;
|
||||
else if (colorFilter.equals("bw")) return colorFilterBW;
|
||||
else if (colorFilter.equals("redtint")) return colorFilterRedTint;
|
||||
else if (colorFilter.equals("greentint")) return colorFilterGreenTint;
|
||||
else if (colorFilter.equals("bluetint")) return colorFilterBlueTint;
|
||||
return null;
|
||||
switch (colorFilter) {
|
||||
case black20:
|
||||
return colorFilterBlack20;
|
||||
case black40:
|
||||
return colorFilterBlack40;
|
||||
case black60:
|
||||
return colorFilterBlack60;
|
||||
case black80:
|
||||
return colorFilterBlack80;
|
||||
case invert:
|
||||
return colorFilterInvert;
|
||||
case bw:
|
||||
return colorFilterBW;
|
||||
case redtint:
|
||||
return colorFilterRedTint;
|
||||
case greentint:
|
||||
return colorFilterGreenTint;
|
||||
case bluetint:
|
||||
return colorFilterBlueTint;
|
||||
default:
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static ColorMatrixColorFilter createGrayScaleColorFilter(float blackOpacity) {
|
||||
@@ -152,6 +181,22 @@ public final class LayeredTileMap {
|
||||
|
||||
public void applyReplacement(ReplaceableMapSection replacement) {
|
||||
replacement.apply(currentLayout);
|
||||
currentLayoutHash = currentLayout.calculateHash();
|
||||
currentLayoutHash = currentLayout.calculateHash(colorFilter.name());
|
||||
}
|
||||
|
||||
public void changeColorFilter(ColorFilterId id) {
|
||||
if (colorFilter == id) return;
|
||||
colorFilter = id;
|
||||
currentLayoutHash = currentLayout.calculateHash(colorFilter.name());
|
||||
}
|
||||
|
||||
|
||||
public void changeColorFilter(String idString) {
|
||||
ColorFilterId id;
|
||||
if (idString == null) id = originalColorFilter;
|
||||
else id = ColorFilterId.valueOf(idString);
|
||||
if (id != null) {
|
||||
changeColorFilter(id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +47,9 @@ public final class MapSection {
|
||||
}
|
||||
}
|
||||
|
||||
public String calculateHash() {
|
||||
return ByteUtils.toHexString(layoutHash, 4);
|
||||
public String calculateHash(String filter) {
|
||||
byte[] hash = layoutHash.clone();
|
||||
ByteUtils.xorArray(hash, filter.getBytes());
|
||||
return ByteUtils.toHexString(hash, 4);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.gpl.rpg.AndorsTrail.model.map;
|
||||
|
||||
import android.app.ActivityManager.RecentTaskInfo;
|
||||
|
||||
import com.gpl.rpg.AndorsTrail.AndorsTrailApplication;
|
||||
import com.gpl.rpg.AndorsTrail.context.ControllerContext;
|
||||
import com.gpl.rpg.AndorsTrail.context.WorldContext;
|
||||
@@ -36,6 +38,7 @@ public final class PredefinedMap {
|
||||
public long lastVisitTime = VISIT_RESET;
|
||||
public String lastSeenLayoutHash = "";
|
||||
public final boolean isOutdoors;
|
||||
public String currentColorFilter = null;
|
||||
|
||||
public final ArrayList<BloodSplatter> splatters = new ArrayList<BloodSplatter>();
|
||||
|
||||
@@ -173,6 +176,7 @@ public final class PredefinedMap {
|
||||
resetTemporaryData();
|
||||
groundBags.clear();
|
||||
visited = false;
|
||||
currentColorFilter = null;
|
||||
lastSeenLayoutHash = "";
|
||||
}
|
||||
|
||||
@@ -317,6 +321,15 @@ public final class PredefinedMap {
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (fileversion >= 43) {
|
||||
if (src.readBoolean()) {
|
||||
currentColorFilter = src.readUTF();
|
||||
} else {
|
||||
currentColorFilter = null;
|
||||
}
|
||||
}
|
||||
|
||||
lastVisitTime = src.readLong();
|
||||
|
||||
if (visited) {
|
||||
@@ -354,6 +367,7 @@ public final class PredefinedMap {
|
||||
}
|
||||
if (!activeMapObjectGroups.containsAll(initiallyActiveMapObjectGroups)
|
||||
|| !initiallyActiveMapObjectGroups.containsAll(activeMapObjectGroups)) return true;
|
||||
if (currentColorFilter != null) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -373,6 +387,8 @@ public final class PredefinedMap {
|
||||
for(Loot l : groundBags) {
|
||||
l.writeToParcel(dest);
|
||||
}
|
||||
dest.writeBoolean(currentColorFilter != null);
|
||||
if (currentColorFilter != null) dest.writeUTF(currentColorFilter);
|
||||
dest.writeLong(lastVisitTime);
|
||||
} else {
|
||||
dest.writeBoolean(false);
|
||||
|
||||
@@ -232,13 +232,19 @@ public final class TMXMapTranslator {
|
||||
private static final String LAYERNAME_OBJECTS = "objects";
|
||||
private static final String LAYERNAME_ABOVE = "above";
|
||||
private static final String LAYERNAME_WALKABLE = "walkable";
|
||||
private static final String PROPNAME_FILTER = "colorfilter";
|
||||
private static final SetOfLayerNames defaultLayerNames = new SetOfLayerNames(LAYERNAME_GROUND, LAYERNAME_OBJECTS, LAYERNAME_ABOVE, LAYERNAME_WALKABLE);
|
||||
|
||||
private static LayeredTileMap transformMap(TMXLayerMap map, TileCache tileCache) {
|
||||
final Size mapSize = new Size(map.width, map.height);
|
||||
String colorFilter = null;
|
||||
LayeredTileMap.ColorFilterId colorFilter = LayeredTileMap.ColorFilterId.none;
|
||||
for (TMXProperty prop : map.properties) {
|
||||
if (prop.name.equalsIgnoreCase("colorfilter")) colorFilter = prop.value;
|
||||
if (prop.name.equalsIgnoreCase(PROPNAME_FILTER)) {
|
||||
String filterId = prop.value;
|
||||
if (filterId != null) {
|
||||
colorFilter = LayeredTileMap.ColorFilterId.valueOf(filterId);
|
||||
}
|
||||
}
|
||||
}
|
||||
HashSet<Integer> usedTileIDs = new HashSet<Integer>();
|
||||
HashMap<String, TMXLayer> layersPerLayerName = new HashMap<String, TMXLayer>();
|
||||
@@ -388,7 +394,7 @@ public final class TMXMapTranslator {
|
||||
if (srcLayer.layoutHash == null) return;
|
||||
digest.update(srcLayer.layoutHash);
|
||||
}
|
||||
|
||||
|
||||
private static boolean getTile(final TMXLayerMap map, final int gid, final Tile dest) {
|
||||
for(int i = map.tileSets.length - 1; i >= 0; --i) {
|
||||
TMXTileSet ts = map.tileSets[i];
|
||||
|
||||
@@ -15,6 +15,7 @@ public final class ScriptEffect {
|
||||
, activateMapObjectGroup
|
||||
, deactivateMapObjectGroup
|
||||
, removeQuestProgress
|
||||
, changeMapFilter
|
||||
}
|
||||
|
||||
public final ScriptEffectType type;
|
||||
|
||||
@@ -829,6 +829,7 @@ public final class MainView extends SurfaceView
|
||||
public void onMapTilesChanged(PredefinedMap map, LayeredTileMap tileMap) {
|
||||
if (map != currentMap) return;
|
||||
updateBitmaps();
|
||||
currentTileMap.setColorFilter(this.mPaint);
|
||||
redrawAll(RedrawAllDebugReason.MapChanged);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user