diff --git a/configurations/demo-config-2/locations/location-1/objects/coin-1.json b/configurations/demo-config-2/locations/location-1/objects/coin-1.json new file mode 100644 index 00000000..a69b6ab5 --- /dev/null +++ b/configurations/demo-config-2/locations/location-1/objects/coin-1.json @@ -0,0 +1,11 @@ +{ + "tag": "coin-1", + "position": { "row": 7, "col": 2 }, + "assetPath": "assets/coin.png", + "onLeftClick": { + "tag": "get-item", + "type": "collect", + "assetPath": "assets/coin.png", + "description": "Świecąca moneta" + } +} diff --git a/configurations/demo-config-2/locations/location-1/objects/diamond-1.json b/configurations/demo-config-2/locations/location-1/objects/diamond-1.json deleted file mode 100644 index beee5a2e..00000000 --- a/configurations/demo-config-2/locations/location-1/objects/diamond-1.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "tag": "diamond-1", - "position": { "row": 7, "col": 2 }, - "assetPath": "assets/diamond.png", - "onLeftClick": { - "tag": "get-item", - "type": "collect", - "assetPath": "assets/diamond.png", - "description": "Świecący diament" - } -} diff --git a/configurations/demo-config-2/locations/location-2/objects/teleport-bunny-2.json b/configurations/demo-config-2/locations/location-2/objects/teleport-bunny-2.json index f3ddb4f9..960b3f15 100644 --- a/configurations/demo-config-2/locations/location-2/objects/teleport-bunny-2.json +++ b/configurations/demo-config-2/locations/location-2/objects/teleport-bunny-2.json @@ -7,7 +7,7 @@ "type": "location-change", "target-location": "location-3", "target-position": { "row": 3, "col": 5 }, - "condition": {"type": "item-required", "item-tag": "diamond-1"} + "condition": {"type": "item-required", "item-tag": "chest-1"} }, "onApproach": { "tag": "dialogue", "type": "show-description", "assetPath": "assets/key.png", "description": "Znajdź diament, a królik przeniesie cię do księżniczki" diff --git a/configurations/demo-config-2/locations/location-3/objects/bandit-1.json b/configurations/demo-config-2/locations/location-3/objects/bandit-1.json index 9baa8a7d..0176df33 100644 --- a/configurations/demo-config-2/locations/location-3/objects/bandit-1.json +++ b/configurations/demo-config-2/locations/location-3/objects/bandit-1.json @@ -1,10 +1,10 @@ { "tag": "bandit-1", "position": { "row": 6, "col": 5 }, - "assetPath": "assets/bandit.png", + "assetPath": "assets/samurai.png", "onLeftClick": { "tag": "battle", - "type": "battle", + "type": "battle-reflex", "reward": 10 } } diff --git a/configurations/demo-config-2/root.json b/configurations/demo-config-2/root.json index cbaaec92..1935ab53 100644 --- a/configurations/demo-config-2/root.json +++ b/configurations/demo-config-2/root.json @@ -24,5 +24,6 @@ "quizPopupBackground": "assets/popup-background-3.png", "inventoryPopupBackground": "assets/popup-background.png", "dialoguePopupBackground": "assets/popup-background.png", - "npcFrame": "assets/npc-frame.png" + "npcFrame": "assets/npc-frame.png", + "assetDir": "../../assets" } diff --git a/src/main/java/io/rpg/model/actions/ActionEngine.java b/src/main/java/io/rpg/model/actions/ActionEngine.java index b9a819d3..5b7c7f38 100644 --- a/src/main/java/io/rpg/model/actions/ActionEngine.java +++ b/src/main/java/io/rpg/model/actions/ActionEngine.java @@ -110,6 +110,7 @@ public void onAction(BattleAction action) { BattleResult result; if (player.getStrength() > opponent.getStrength()) { player.addDefeatedOpponent(opponent.getTag()); + controller().removeObjectFromModel(action.getEmitter()); result = new BattleResult(BattleResult.Result.VICTORY, reward); } else if (player.getStrength() < opponent.getStrength()) { result = new BattleResult(BattleResult.Result.DEFEAT, 0);