diff --git a/src/main/java/uulm/teamname/marvelous/gamelibrary/gamelogic/GameLogic.java b/src/main/java/uulm/teamname/marvelous/gamelibrary/gamelogic/GameLogic.java index b1f8404..f9c81fb 100644 --- a/src/main/java/uulm/teamname/marvelous/gamelibrary/gamelogic/GameLogic.java +++ b/src/main/java/uulm/teamname/marvelous/gamelibrary/gamelogic/GameLogic.java @@ -509,7 +509,13 @@ class GameLogic { ((Character)state.entities.findEntity(((CharacterEvent)event).targetEntity)).hp.increaseValue(((CharacterEvent)event).amount); } case MoveEvent -> { - (state.entities.findEntity(((CharacterEvent)event).originEntity)).setPosition(((CharacterEvent)event).targetField); + Character target = (Character)state.entities.findEntity(((CharacterEvent)event).originEntity); + for(Entity entity: state.entities.findByPosition(((CharacterEvent)event).targetField)) { + if(entity instanceof InfinityStone) { + target.inventory.addStone(((InfinityStone)entity).type); + } + } + target.setPosition(((CharacterEvent)event).targetField); } case UseInfinityStoneEvent -> { state.stoneCooldown.setCooldown(((CharacterEvent)event).stoneType, 10); //TODO: use stone cooldown from config