mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-25 07:36:30 +00:00
Fix triggered Monster Tide spawn; fix Tower dungeon handoff (#2397)
* Abyss: Fix monster tide trigger; fix dungeon handoff * back out unrelated changes
This commit is contained in:
parent
d32a75e980
commit
fd75ba7b9b
@ -131,7 +131,9 @@ public final class DungeonSystem extends BaseGameSystem {
|
||||
dungeonId);
|
||||
|
||||
if (player.getWorld().transferPlayerToScene(player, data.getSceneId(), data)) {
|
||||
dungeonSettleListeners.forEach(player.getScene()::addDungeonSettleObserver);
|
||||
var scene = player.getScene();
|
||||
scene.setDungeonManager(new DungeonManager(scene, data));
|
||||
dungeonSettleListeners.forEach(scene::addDungeonSettleObserver);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -774,9 +774,9 @@ public class SceneScriptManager {
|
||||
}
|
||||
|
||||
public void startMonsterTideInGroup(
|
||||
SceneGroup group, Integer[] ordersConfigId, int tideCount, int sceneLimit) {
|
||||
String source, SceneGroup group, Integer[] ordersConfigId, int tideCount, int sceneLimit) {
|
||||
this.scriptMonsterTideService =
|
||||
new ScriptMonsterTideService(this, group, tideCount, sceneLimit, ordersConfigId);
|
||||
new ScriptMonsterTideService(this, source, group, tideCount, sceneLimit, ordersConfigId);
|
||||
}
|
||||
|
||||
public void unloadCurrentMonsterTide() {
|
||||
|
@ -310,14 +310,14 @@ public class ScriptLib {
|
||||
// TODO: AttachGalleryAbilityGroup
|
||||
// TODO: AttachGalleryTeamAbilityGroup
|
||||
|
||||
public int AutoMonsterTide(int challengeIndex, int groupId, Integer[] ordersConfigId, int tideCount, int sceneLimit, int param6) {
|
||||
logger.debug("[LUA] Call AutoMonsterTide with {},{},{},{},{},{}", challengeIndex, groupId, ordersConfigId, tideCount, sceneLimit, param6);
|
||||
public int AutoMonsterTide(int sourceId, int groupId, Integer[] ordersConfigId, int tideCount, int sceneLimit, int param6) {
|
||||
logger.debug("[LUA] Call AutoMonsterTide with {},{},{},{},{},{}", sourceId, groupId, ordersConfigId, tideCount, sceneLimit, param6);
|
||||
// Some fields are guessed
|
||||
SceneGroup group = getSceneScriptManager().getGroupById(groupId);
|
||||
if (group == null || group.monsters == null) {
|
||||
return 1;
|
||||
}
|
||||
this.getSceneScriptManager().startMonsterTideInGroup(group, ordersConfigId, tideCount, sceneLimit);
|
||||
this.getSceneScriptManager().startMonsterTideInGroup(Integer.toString(sourceId), group, ordersConfigId, tideCount, sceneLimit);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -20,9 +20,11 @@ public final class ScriptMonsterTideService {
|
||||
private final List<Integer> monsterConfigIds;
|
||||
private final OnMonsterCreated onMonsterCreated = new OnMonsterCreated();
|
||||
private final OnMonsterDead onMonsterDead = new OnMonsterDead();
|
||||
private final String source;
|
||||
|
||||
public ScriptMonsterTideService(
|
||||
SceneScriptManager sceneScriptManager,
|
||||
String source,
|
||||
SceneGroup group,
|
||||
int tideCount,
|
||||
int monsterSceneLimit,
|
||||
@ -35,6 +37,7 @@ public final class ScriptMonsterTideService {
|
||||
this.monsterAlive = new AtomicInteger(0);
|
||||
this.monsterConfigOrders = new ConcurrentLinkedQueue<>(List.of(ordersConfigId));
|
||||
this.monsterConfigIds = List.of(ordersConfigId);
|
||||
this.source = source;
|
||||
|
||||
this.sceneScriptManager
|
||||
.getScriptMonsterSpawnService()
|
||||
@ -83,11 +86,10 @@ public final class ScriptMonsterTideService {
|
||||
sceneScriptManager.createMonster(
|
||||
currentGroup.id, currentGroup.block_id, getNextMonster()));
|
||||
}
|
||||
// spawn the last turn of monsters
|
||||
// fix the 5-2
|
||||
sceneScriptManager.callEvent(
|
||||
new ScriptArgs(
|
||||
currentGroup.id, EventType.EVENT_MONSTER_TIDE_DIE, monsterKillCount.get()));
|
||||
// call registered events that may spawn in more monsters
|
||||
var scriptArgs = new ScriptArgs(currentGroup.id, EventType.EVENT_MONSTER_TIDE_DIE, monsterKillCount.get());
|
||||
scriptArgs.setEventSource(source);
|
||||
sceneScriptManager.callEvent(scriptArgs);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user