Dont remove farmable monsters from the scene when they are defeated

This commit is contained in:
Melledy
2023-11-09 00:35:19 -08:00
parent 2328c26550
commit d1c96aa9a3
2 changed files with 10 additions and 0 deletions

View File

@@ -205,6 +205,9 @@ public class BattleService extends BaseGameService {
case BATTLE_END_WIN -> {
// Remove monsters from the map - Could optimize it a little better
for (var monster : battle.getNpcMonsters()) {
// Dont remove farmable monsters from the scene when they are defeated
if (monster.isFarmElement()) continue;
// Remove monster
player.getScene().removeEntity(monster);
}
// Drops

View File

@@ -26,6 +26,8 @@ public class EntityMonster implements GameEntity {
private final Position pos;
private final Position rot;
private int farmElementId;
public EntityMonster(Scene scene, NpcMonsterExcel excel, GroupInfo group, MonsterInfo monsterInfo) {
this.scene = scene;
this.excel = excel;
@@ -33,6 +35,11 @@ public class EntityMonster implements GameEntity {
this.rot = monsterInfo.getRot().clone();
this.groupId = group.getId();
this.instId = monsterInfo.getID();
this.farmElementId = monsterInfo.getFarmElementID();
}
public boolean isFarmElement() {
return this.farmElementId > 0;
}
public int getStageId() {