mirror of
https://github.com/Melledy/LunarCore.git
synced 2025-12-14 06:14:45 +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 -> {
|
case BATTLE_END_WIN -> {
|
||||||
// Remove monsters from the map - Could optimize it a little better
|
// Remove monsters from the map - Could optimize it a little better
|
||||||
for (var monster : battle.getNpcMonsters()) {
|
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);
|
player.getScene().removeEntity(monster);
|
||||||
}
|
}
|
||||||
// Drops
|
// Drops
|
||||||
|
|||||||
@@ -26,6 +26,8 @@ public class EntityMonster implements GameEntity {
|
|||||||
private final Position pos;
|
private final Position pos;
|
||||||
private final Position rot;
|
private final Position rot;
|
||||||
|
|
||||||
|
private int farmElementId;
|
||||||
|
|
||||||
public EntityMonster(Scene scene, NpcMonsterExcel excel, GroupInfo group, MonsterInfo monsterInfo) {
|
public EntityMonster(Scene scene, NpcMonsterExcel excel, GroupInfo group, MonsterInfo monsterInfo) {
|
||||||
this.scene = scene;
|
this.scene = scene;
|
||||||
this.excel = excel;
|
this.excel = excel;
|
||||||
@@ -33,6 +35,11 @@ public class EntityMonster implements GameEntity {
|
|||||||
this.rot = monsterInfo.getRot().clone();
|
this.rot = monsterInfo.getRot().clone();
|
||||||
this.groupId = group.getId();
|
this.groupId = group.getId();
|
||||||
this.instId = monsterInfo.getID();
|
this.instId = monsterInfo.getID();
|
||||||
|
this.farmElementId = monsterInfo.getFarmElementID();
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isFarmElement() {
|
||||||
|
return this.farmElementId > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getStageId() {
|
public int getStageId() {
|
||||||
|
|||||||
Reference in New Issue
Block a user