fix: remove infinity stones from the map on space stone teleports

This commit is contained in:
punchready 2021-08-06 12:45:40 +02:00
parent 315c7d2891
commit d69376c110
1 changed files with 9 additions and 0 deletions

View File

@ -452,6 +452,15 @@ public class GameLogic {
.withOriginField(data.originField)
.withTargetField(data.targetField)
.buildCharacterEvent());
for(Entity entity: state.entities.findByPosition(data.targetField)) {
if(entity instanceof InfinityStone) {
result.add(new EventBuilder(EventType.DestroyedEntityEvent)
.withTargetField(data.targetField)
.withTargetEntity(entity.id)
.buildEntityEvent());
break; //we should only have one entity per field anyways
}
}
}
case MindStone -> {
EntityType target = data.originEntity.type == EntityType.P1 ? EntityType.P2 : EntityType.P1;