-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add equipment * chore: add simple equipment system for the player Collected collectibles are now displayed if we click on a non-collectible item * feat: Improve equipment system * add InventoryPopup * Update src/main/java/io/rpg/controller/PopupController.java Co-authored-by: Marcin Hawryluk <70582973+mhawryluk@users.noreply.github.com> * Update src/main/java/io/rpg/model/data/Inventory.java Co-authored-by: Marcin Hawryluk <70582973+mhawryluk@users.noreply.github.com> * Update src/main/java/io/rpg/model/object/CollectibleGameObject.java Co-authored-by: Marcin Hawryluk <70582973+mhawryluk@users.noreply.github.com> * Update src/main/java/io/rpg/view/InventoryPopup.java Co-authored-by: Marcin Hawryluk <70582973+mhawryluk@users.noreply.github.com> * Update src/main/java/io/rpg/viewmodel/InventoryPopupViewModel.java Co-authored-by: Marcin Hawryluk <70582973+mhawryluk@users.noreply.github.com> * Update src/main/java/io/rpg/view/InventoryGameObjectView.java Co-authored-by: Marcin Hawryluk <70582973+mhawryluk@users.noreply.github.com> * fix: make equipment work on current arch Co-authored-by: Marcin Hawryluk <70582973+mhawryluk@users.noreply.github.com> Co-authored-by: Kacper Kafara <kacperkafara@gmail.com> * add minor improvements (Proper)Gathering items is now available, collectibles are no longer visible on the ground after picking them up * fix: proper items are displayed in the equipment * chore: add battle logic implementation * chore: add BattlePopup * changes * fix: make things work KLEJONE GRUBĄ WARSTWĄ KLEJU Co-authored-by: Marcin Hawryluk <70582973+mhawryluk@users.noreply.github.com> Co-authored-by: Kacper Kafara <kacperkafara@gmail.com>
- Loading branch information
1 parent
8c1ca50
commit fea281c
Showing
23 changed files
with
548 additions
and
8 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions
10
configurations/demo-config-1/locations/location-1/objects/object-2.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"tag": "object-2", | ||
"position": { "row": 5, "col": 5 }, | ||
"assetPath": "assets/key.png", | ||
"onLeftClick": { | ||
"tag": "dialogue-action", | ||
"type": "collect", | ||
"assetPath": "assets/coin.png" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,4 @@ | |
], | ||
"assetPath": "assets/goblin.png" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package io.rpg.model.actions; | ||
|
||
import io.rpg.model.actions.condition.Condition; | ||
import io.rpg.model.object.GameObject; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
public class CollectAction extends BaseAction { | ||
private final String assetPath; | ||
|
||
public CollectAction(String assetPath, @Nullable Condition condition) { | ||
super(condition); | ||
this.assetPath = assetPath; | ||
} | ||
|
||
public GameObject getOwner() { | ||
return getEmitter(); | ||
} | ||
|
||
@Override | ||
public void acceptActionEngine(ActionEngine engine) { | ||
engine.onAction(this); | ||
} | ||
|
||
public String getAssetPath() { | ||
return assetPath; | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package io.rpg.model.data; | ||
|
||
import io.rpg.model.object.GameObject; | ||
import io.rpg.view.InventoryGameObjectView; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class Inventory { | ||
|
||
public List<InventoryGameObjectView> items; | ||
|
||
public Inventory() { | ||
items = new ArrayList<>(); | ||
} | ||
|
||
public void add(InventoryGameObjectView object) { | ||
items.add(object); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
src/main/java/io/rpg/model/object/CollectibleGameObject.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package io.rpg.model.object; | ||
|
||
import io.rpg.model.data.Position; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
public final class CollectibleGameObject extends InteractiveGameObject { | ||
public CollectibleGameObject(@NotNull String tag, @NotNull Position position, String assetPath) { | ||
super(tag, position, assetPath); | ||
} | ||
|
||
@Override | ||
public void onAction() { | ||
System.out.println("Collectible object action"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
src/main/java/io/rpg/model/object/InteractiveGameObject.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package io.rpg.model.object; | ||
|
||
import io.rpg.model.data.Position; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
public abstract class InteractiveGameObject extends GameObject { | ||
public InteractiveGameObject(@NotNull String tag, @NotNull Position position, String assetPath) { | ||
super(tag, position); | ||
} | ||
public InteractiveGameObject(@NotNull String tag, @NotNull Position position) { | ||
super(tag, position); | ||
} | ||
|
||
abstract public void onAction(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.