mirror of
https://github.com/Melledy/LunarCore.git
synced 2025-12-13 22:04:36 +01:00
Dont remove farmable monsters from the scene when they are defeated
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user