mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-22 00:45:34 +00:00
Format code [skip actions]
This commit is contained in:
parent
f5703e5964
commit
837e30e04b
@ -324,9 +324,10 @@ public final class DungeonManager {
|
||||
p.getBattlePassManager().triggerMission(WatcherTriggerType.TRIGGER_FINISH_DUNGEON);
|
||||
}
|
||||
});
|
||||
var future = scene
|
||||
.getScriptManager()
|
||||
.callEvent(new ScriptArgs(0, EventType.EVENT_DUNGEON_SETTLE, successfully ? 1 : 0));
|
||||
var future =
|
||||
scene
|
||||
.getScriptManager()
|
||||
.callEvent(new ScriptArgs(0, EventType.EVENT_DUNGEON_SETTLE, successfully ? 1 : 0));
|
||||
// Note: There is a possible race condition with calling
|
||||
// EVENT_DUNGEON_SETTLE here asynchronously:
|
||||
// 1. EVENT_DUNGEON_SETTLE triggers some Lua-side logic,
|
||||
|
@ -47,7 +47,9 @@ public class TowerManager extends BasePlayerManager {
|
||||
while (stars < currentPossibleStars) {
|
||||
player
|
||||
.getSession()
|
||||
.send(new PacketTowerLevelStarCondNotify(getTowerData().currentFloorId, getCurrentLevel(), currentPossibleStars));
|
||||
.send(
|
||||
new PacketTowerLevelStarCondNotify(
|
||||
getTowerData().currentFloorId, getCurrentLevel(), currentPossibleStars));
|
||||
currentPossibleStars--;
|
||||
}
|
||||
}
|
||||
@ -117,7 +119,9 @@ public class TowerManager extends BasePlayerManager {
|
||||
currentPossibleStars = 3;
|
||||
player
|
||||
.getSession()
|
||||
.send(new PacketTowerLevelStarCondNotify(getTowerData().currentFloorId, getCurrentLevel(), currentPossibleStars + 1));
|
||||
.send(
|
||||
new PacketTowerLevelStarCondNotify(
|
||||
getTowerData().currentFloorId, getCurrentLevel(), currentPossibleStars + 1));
|
||||
}
|
||||
|
||||
public void notifyCurLevelRecordChange() {
|
||||
@ -143,7 +147,8 @@ public class TowerManager extends BasePlayerManager {
|
||||
var cond = levelData.getCondType(star);
|
||||
if (cond == TowerLevelData.TowerCondType.TOWER_COND_CHALLENGE_LEFT_TIME_MORE_THAN) {
|
||||
var params = levelData.getTimeCond(star);
|
||||
var timeRemaining = challenge.getTimeLimit() - (scene.getSceneTimeSeconds() - challenge.getStartedAt());
|
||||
var timeRemaining =
|
||||
challenge.getTimeLimit() - (scene.getSceneTimeSeconds() - challenge.getStartedAt());
|
||||
if (timeRemaining >= params.getMinimumTimeInSeconds()) {
|
||||
break;
|
||||
}
|
||||
@ -151,7 +156,11 @@ public class TowerManager extends BasePlayerManager {
|
||||
// TODO: Check monolith health
|
||||
break;
|
||||
} else {
|
||||
Grasscutter.getLogger().error("getCurLevelStars: Tower level {} has no or unknown condition defined for {} stars", getCurrentLevelId(), star + 1);
|
||||
Grasscutter.getLogger()
|
||||
.error(
|
||||
"getCurLevelStars: Tower level {} has no or unknown condition defined for {} stars",
|
||||
getCurrentLevelId(),
|
||||
star + 1);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@ -174,8 +183,7 @@ public class TowerManager extends BasePlayerManager {
|
||||
prevStars = prevRecord.getLevelStars(getCurrentLevelId());
|
||||
}
|
||||
if (stars > prevStars) {
|
||||
recordMap.put(
|
||||
currentFloorId, prevRecord.setLevelStars(getCurrentLevelId(), stars));
|
||||
recordMap.put(currentFloorId, prevRecord.setLevelStars(getCurrentLevelId(), stars));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -9,9 +9,7 @@ public class PacketTowerLevelStarCondNotify extends BasePacket {
|
||||
public PacketTowerLevelStarCondNotify(int floorId, int levelIndex, int lostStar) {
|
||||
super(PacketOpcodes.TowerLevelStarCondNotify);
|
||||
|
||||
var proto = TowerLevelStarCondNotify.newBuilder()
|
||||
.setFloorId(floorId)
|
||||
.setLevelIndex(levelIndex);
|
||||
var proto = TowerLevelStarCondNotify.newBuilder().setFloorId(floorId).setLevelIndex(levelIndex);
|
||||
|
||||
if (1 <= lostStar && lostStar <= 3) {
|
||||
proto.addCondDataList(
|
||||
@ -26,15 +24,9 @@ public class PacketTowerLevelStarCondNotify extends BasePacket {
|
||||
.build());
|
||||
} else {
|
||||
proto
|
||||
.addCondDataList(
|
||||
TowerLevelStarCondData.newBuilder()
|
||||
.build())
|
||||
.addCondDataList(
|
||||
TowerLevelStarCondData.newBuilder()
|
||||
.build())
|
||||
.addCondDataList(
|
||||
TowerLevelStarCondData.newBuilder()
|
||||
.build());
|
||||
.addCondDataList(TowerLevelStarCondData.newBuilder().build())
|
||||
.addCondDataList(TowerLevelStarCondData.newBuilder().build())
|
||||
.addCondDataList(TowerLevelStarCondData.newBuilder().build());
|
||||
}
|
||||
|
||||
this.setData(proto.build());
|
||||
|
Loading…
Reference in New Issue
Block a user