mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-22 05:19:17 +00:00
Format code [skip actions]
This commit is contained in:
parent
b7a9d28f02
commit
bc8e7c21ce
@ -1,7 +1,7 @@
|
||||
package emu.grasscutter.data.excels.dungeon;
|
||||
|
||||
import emu.grasscutter.game.dungeons.enums.*;
|
||||
import emu.grasscutter.data.*;
|
||||
import emu.grasscutter.game.dungeons.enums.*;
|
||||
import java.util.List;
|
||||
import lombok.*;
|
||||
|
||||
@ -39,7 +39,8 @@ public class DungeonEntryData extends GameResource {
|
||||
|
||||
public int getLevelCondition() {
|
||||
for (var cond : satisfiedCond) {
|
||||
if (cond.type != null && cond.type.equals(DungeonEntrySatisfiedConditionType.DUNGEON_ENTRY_CONDITION_LEVEL)) {
|
||||
if (cond.type != null
|
||||
&& cond.type.equals(DungeonEntrySatisfiedConditionType.DUNGEON_ENTRY_CONDITION_LEVEL)) {
|
||||
return cond.param1;
|
||||
}
|
||||
}
|
||||
@ -48,7 +49,8 @@ public class DungeonEntryData extends GameResource {
|
||||
|
||||
public int getQuestCondition() {
|
||||
for (var cond : satisfiedCond) {
|
||||
if (cond.type != null && cond.type.equals(DungeonEntrySatisfiedConditionType.DUNGEON_ENTRY_CONDITION_QUEST)) {
|
||||
if (cond.type != null
|
||||
&& cond.type.equals(DungeonEntrySatisfiedConditionType.DUNGEON_ENTRY_CONDITION_QUEST)) {
|
||||
return cond.param1;
|
||||
}
|
||||
}
|
||||
|
@ -7,14 +7,10 @@ import emu.grasscutter.data.excels.dungeon.*;
|
||||
import emu.grasscutter.game.dungeons.handlers.DungeonBaseHandler;
|
||||
import emu.grasscutter.game.player.Player;
|
||||
import emu.grasscutter.game.props.SceneType;
|
||||
import emu.grasscutter.game.props.EnterReason;
|
||||
import emu.grasscutter.game.world.*;
|
||||
import emu.grasscutter.net.packet.*;
|
||||
import emu.grasscutter.server.game.*;
|
||||
import emu.grasscutter.server.packet.send.PacketDungeonEntryInfoRsp;
|
||||
import emu.grasscutter.game.world.data.TeleportProperties;
|
||||
import emu.grasscutter.server.event.player.PlayerTeleportEvent.TeleportType;
|
||||
import emu.grasscutter.net.proto.EnterTypeOuterClass.EnterType;
|
||||
import it.unimi.dsi.fastutil.ints.*;
|
||||
import java.util.List;
|
||||
import lombok.val;
|
||||
|
@ -1,8 +1,6 @@
|
||||
package emu.grasscutter.server.packet.recv;
|
||||
|
||||
import emu.grasscutter.net.packet.*;
|
||||
import emu.grasscutter.net.proto.DungeonRestartReqOuterClass.DungeonRestartReq;
|
||||
import emu.grasscutter.net.proto.DungeonRestartRspOuterClass.DungeonRestartRsp;
|
||||
import emu.grasscutter.server.game.GameSession;
|
||||
|
||||
@Opcodes(PacketOpcodes.DungeonRestartReq)
|
||||
|
@ -1,11 +1,9 @@
|
||||
package emu.grasscutter.server.packet.recv;
|
||||
|
||||
import emu.grasscutter.Grasscutter;
|
||||
import emu.grasscutter.net.packet.*;
|
||||
import emu.grasscutter.server.game.GameSession;
|
||||
import emu.grasscutter.server.packet.send.PacketGetDungeonEntryExploreConditionRsp;
|
||||
import emu.grasscutter.server.packet.send.PacketDungeonEntryToBeExploreNotify;
|
||||
import emu.grasscutter.net.proto.GetDungeonEntryExploreConditionReqOuterClass.GetDungeonEntryExploreConditionReq;
|
||||
import emu.grasscutter.server.game.GameSession;
|
||||
import emu.grasscutter.server.packet.send.PacketDungeonEntryToBeExploreNotify;
|
||||
|
||||
@Opcodes(PacketOpcodes.GetDungeonEntryExploreConditionReq)
|
||||
public class HandlerGetDungeonEntryExploreConditionReq extends PacketHandler {
|
||||
@ -16,12 +14,11 @@ public class HandlerGetDungeonEntryExploreConditionReq extends PacketHandler {
|
||||
// TODO Send GetDungeonEntryExploreConditionRsp if condition
|
||||
// (adventurer rank or quest completion) is not met. Parse
|
||||
// dungeon entry conditions from DungeonEntryExcelConfigData.json.
|
||||
//session.send(new PacketGetDungeonEntryExploreConditionRsp(req.getDungeonEntryConfigId()));
|
||||
// session.send(new PacketGetDungeonEntryExploreConditionRsp(req.getDungeonEntryConfigId()));
|
||||
|
||||
// For now, just unlock any domain the player touches.
|
||||
session.send(new PacketDungeonEntryToBeExploreNotify(
|
||||
req.getDungeonEntryScenePointId(),
|
||||
req.getSceneId(),
|
||||
req.getDungeonEntryConfigId()));
|
||||
session.send(
|
||||
new PacketDungeonEntryToBeExploreNotify(
|
||||
req.getDungeonEntryScenePointId(), req.getSceneId(), req.getDungeonEntryConfigId()));
|
||||
}
|
||||
}
|
||||
|
@ -6,15 +6,16 @@ import emu.grasscutter.net.proto.DungeonEntryToBeExploreNotifyOuterClass.Dungeon
|
||||
public class PacketDungeonEntryToBeExploreNotify extends BasePacket {
|
||||
|
||||
/**
|
||||
* Marks the dungeon as pending exploration.
|
||||
* This creates the "Unknown" text bubble above the dungeon entry in the world map.
|
||||
* Marks the dungeon as pending exploration. This creates the "Unknown" text bubble above the
|
||||
* dungeon entry in the world map.
|
||||
*/
|
||||
public PacketDungeonEntryToBeExploreNotify(int dungeonEntryScenePointId, int sceneId, int dungeonEntryConfigId) {
|
||||
public PacketDungeonEntryToBeExploreNotify(
|
||||
int dungeonEntryScenePointId, int sceneId, int dungeonEntryConfigId) {
|
||||
super(PacketOpcodes.DungeonEntryToBeExploreNotify);
|
||||
this.setData(DungeonEntryToBeExploreNotify.newBuilder()
|
||||
.setDungeonEntryScenePointId(dungeonEntryScenePointId)
|
||||
.setSceneId(sceneId)
|
||||
.setDungeonEntryConfigId(dungeonEntryConfigId)
|
||||
);
|
||||
this.setData(
|
||||
DungeonEntryToBeExploreNotify.newBuilder()
|
||||
.setDungeonEntryScenePointId(dungeonEntryScenePointId)
|
||||
.setSceneId(sceneId)
|
||||
.setDungeonEntryConfigId(dungeonEntryConfigId));
|
||||
}
|
||||
}
|
||||
|
@ -2,29 +2,32 @@ package emu.grasscutter.server.packet.send;
|
||||
|
||||
import emu.grasscutter.data.GameData;
|
||||
import emu.grasscutter.net.packet.*;
|
||||
import emu.grasscutter.net.proto.GetDungeonEntryExploreConditionRspOuterClass.GetDungeonEntryExploreConditionRsp;
|
||||
import emu.grasscutter.net.proto.DungeonEntryCondOuterClass.DungeonEntryCond;
|
||||
import emu.grasscutter.net.proto.DungeonEntryBlockReasonOuterClass.DungeonEntryBlockReason;
|
||||
import emu.grasscutter.net.proto.DungeonEntryCondOuterClass.DungeonEntryCond;
|
||||
import emu.grasscutter.net.proto.GetDungeonEntryExploreConditionRspOuterClass.GetDungeonEntryExploreConditionRsp;
|
||||
|
||||
public class PacketGetDungeonEntryExploreConditionRsp extends BasePacket {
|
||||
public PacketGetDungeonEntryExploreConditionRsp(int dungeonId) {
|
||||
super(PacketOpcodes.GetDungeonEntryExploreConditionRsp);
|
||||
|
||||
var data = GameData.getDungeonEntryDataMap().values().stream()
|
||||
.filter(d -> d.getId() == dungeonId)
|
||||
.toList().get(0);
|
||||
var data =
|
||||
GameData.getDungeonEntryDataMap().values().stream()
|
||||
.filter(d -> d.getId() == dungeonId)
|
||||
.toList()
|
||||
.get(0);
|
||||
|
||||
var level = data.getLevelCondition();
|
||||
var quest = data.getQuestCondition();
|
||||
var proto = GetDungeonEntryExploreConditionRsp.newBuilder()
|
||||
.setRetcode(0)
|
||||
.setDungeonEntryCond(DungeonEntryCond.newBuilder()
|
||||
// There is also a DUNGEON_ENTRY_REASON_MULIPLE but only one param1
|
||||
// field to put values in. Only report the required level for now, then.
|
||||
.setCondReason(DungeonEntryBlockReason.DUNGEON_ENTRY_REASON_LEVEL)
|
||||
.setParam1(level)
|
||||
)
|
||||
.build();
|
||||
var proto =
|
||||
GetDungeonEntryExploreConditionRsp.newBuilder()
|
||||
.setRetcode(0)
|
||||
.setDungeonEntryCond(
|
||||
DungeonEntryCond.newBuilder()
|
||||
// There is also a DUNGEON_ENTRY_REASON_MULIPLE but only one param1
|
||||
// field to put values in. Only report the required level for now, then.
|
||||
.setCondReason(DungeonEntryBlockReason.DUNGEON_ENTRY_REASON_LEVEL)
|
||||
.setParam1(level))
|
||||
.build();
|
||||
|
||||
this.setData(proto);
|
||||
}
|
||||
|
@ -6,9 +6,6 @@ import emu.grasscutter.net.proto.UnfreezeGroupLimitNotifyOuterClass.UnfreezeGrou
|
||||
public class PacketUnfreezeGroupLimitNotify extends BasePacket {
|
||||
public PacketUnfreezeGroupLimitNotify(int pointId, int sceneId) {
|
||||
super(PacketOpcodes.UnfreezeGroupLimitNotify);
|
||||
this.setData(UnfreezeGroupLimitNotify.newBuilder()
|
||||
.setPointId(pointId)
|
||||
.setSceneId(sceneId)
|
||||
);
|
||||
this.setData(UnfreezeGroupLimitNotify.newBuilder().setPointId(pointId).setSceneId(sceneId));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user