Skip to content

Commit

Permalink
Merge pull request Grasscutters#2 from Grasscutters/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
Akka0 committed May 6, 2022
2 parents 2dc6a48 + da99140 commit 7279842
Show file tree
Hide file tree
Showing 36 changed files with 1,181 additions and 337 deletions.
16 changes: 16 additions & 0 deletions proto/TowerBuffSelectReq.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
syntax = "proto3";

option java_package = "emu.grasscutter.net.proto";

message TowerBuffSelectReq {
enum CmdId {
option allow_alias = true;
ENET_CHANNEL_ID = 0;
NONE = 0;
ENET_IS_RELIABLE = 1;
IS_ALLOW_CLIENT = 1;
CMD_ID = 2424;
}

uint32 tower_buff_id = 1;
}
16 changes: 16 additions & 0 deletions proto/TowerBuffSelectRsp.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
syntax = "proto3";

option java_package = "emu.grasscutter.net.proto";

message TowerBuffSelectRsp {
enum CmdId {
option allow_alias = true;
NONE = 0;
ENET_CHANNEL_ID = 0;
ENET_IS_RELIABLE = 1;
CMD_ID = 2491;
}

int32 retcode = 1;
uint32 tower_buff_id = 2;
}
17 changes: 17 additions & 0 deletions proto/TowerCurLevelRecordChangeNotify.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
syntax = "proto3";

option java_package = "emu.grasscutter.net.proto";

import "TowerCurLevelRecord.proto";

message TowerCurLevelRecordChangeNotify {
enum CmdId {
option allow_alias = true;
NONE = 0;
ENET_CHANNEL_ID = 0;
ENET_IS_RELIABLE = 1;
CMD_ID = 2489;
}

TowerCurLevelRecord cur_level_record = 1;
}
16 changes: 16 additions & 0 deletions proto/TowerEnterLevelReq.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
syntax = "proto3";

option java_package = "emu.grasscutter.net.proto";

message TowerEnterLevelReq {
enum CmdId {
option allow_alias = true;
ENET_CHANNEL_ID = 0;
NONE = 0;
ENET_IS_RELIABLE = 1;
IS_ALLOW_CLIENT = 1;
CMD_ID = 2412;
}

uint32 enter_point_id = 1;
}
18 changes: 18 additions & 0 deletions proto/TowerEnterLevelRsp.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
syntax = "proto3";

option java_package = "emu.grasscutter.net.proto";

message TowerEnterLevelRsp {
enum CmdId {
option allow_alias = true;
NONE = 0;
ENET_CHANNEL_ID = 0;
ENET_IS_RELIABLE = 1;
CMD_ID = 2426;
}

int32 retcode = 1;
uint32 floor_id = 2;
uint32 level_index = 3;
repeated uint32 tower_buff_id_list = 4;
}
9 changes: 9 additions & 0 deletions proto/TowerLevelStarCondData.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
syntax = "proto3";

option java_package = "emu.grasscutter.net.proto";

message TowerLevelStarCondData {
uint32 star_cond_index = 3;
uint32 cond_value = 4;
bool is_pause = 5;
}
19 changes: 19 additions & 0 deletions proto/TowerLevelStarCondNotify.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
syntax = "proto3";

option java_package = "emu.grasscutter.net.proto";

import "TowerLevelStarCondData.proto";

message TowerLevelStarCondNotify {
enum CmdId {
option allow_alias = true;
NONE = 0;
ENET_CHANNEL_ID = 0;
ENET_IS_RELIABLE = 1;
CMD_ID = 2492;
}

uint32 floor_id = 1;
uint32 level_index = 2;
repeated TowerLevelStarCondData cond_data_list = 3;
}
19 changes: 19 additions & 0 deletions proto/TowerTeamSelectReq.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
syntax = "proto3";

option java_package = "emu.grasscutter.net.proto";

import "TowerTeam.proto";

message TowerTeamSelectReq {
enum CmdId {
option allow_alias = true;
ENET_CHANNEL_ID = 0;
NONE = 0;
ENET_IS_RELIABLE = 1;
IS_ALLOW_CLIENT = 1;
CMD_ID = 2401;
}

uint32 floor_id = 1;
repeated TowerTeam tower_team_list = 2;
}
15 changes: 15 additions & 0 deletions proto/TowerTeamSelectRsp.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
syntax = "proto3";

option java_package = "emu.grasscutter.net.proto";

message TowerTeamSelectRsp {
enum CmdId {
option allow_alias = true;
NONE = 0;
ENET_CHANNEL_ID = 0;
ENET_IS_RELIABLE = 1;
CMD_ID = 2494;
}

int32 retcode = 1;
}
15 changes: 15 additions & 0 deletions proto/WorldPlayerReviveReq.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
syntax = "proto3";
option csharp_namespace = "YSFreedom.Common.Protocol";


message WorldPlayerReviveReq {
enum CmdId {
option allow_alias = true;
ENET_CHANNEL_ID = 0;
NONE = 0;
ENET_IS_RELIABLE = 1;
IS_ALLOW_CLIENT = 1;
CMD_ID = 288;
}

}
11 changes: 10 additions & 1 deletion src/main/java/emu/grasscutter/data/GameData.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ public class GameData {
private static final Int2ObjectMap<ShopGoodsData> shopGoodsDataMap = new Int2ObjectOpenHashMap<>();
private static final Int2ObjectMap<CombineData> combineDataMap = new Int2ObjectOpenHashMap<>();
private static final Int2ObjectMap<RewardPreviewData> rewardPreviewDataMap = new Int2ObjectOpenHashMap<>();

private static final Int2ObjectMap<TowerFloorData> towerFloorDataMap = new Int2ObjectOpenHashMap<>();
private static final Int2ObjectMap<TowerLevelData> towerLevelDataMap = new Int2ObjectOpenHashMap<>();

// Cache
private static Map<Integer, List<Integer>> fetters = new HashMap<>();
private static Map<Integer, List<ShopGoodsData>> shopGoods = new HashMap<>();
Expand Down Expand Up @@ -311,4 +313,11 @@ public static IntList getScenePointIdList() {
public static Int2ObjectMap<CombineData> getCombineDataMap() {
return combineDataMap;
}

public static Int2ObjectMap<TowerFloorData> getTowerFloorDataMap(){
return towerFloorDataMap;
}
public static Int2ObjectMap<TowerLevelData> getTowerLevelDataMap(){
return towerLevelDataMap;
}
}
73 changes: 73 additions & 0 deletions src/main/java/emu/grasscutter/data/def/TowerFloorData.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
package emu.grasscutter.data.def;

import emu.grasscutter.data.GameResource;
import emu.grasscutter.data.ResourceType;

@ResourceType(name = "TowerFloorExcelConfigData.json")
public class TowerFloorData extends GameResource {

private int FloorId;
private int FloorIndex;
private int LevelId;
private int OverrideMonsterLevel;
private int TeamNum;
private int FloorLevelConfigId;

@Override
public int getId() {
return this.FloorId;
}

@Override
public void onLoad() {
super.onLoad();
}

public int getFloorId() {
return FloorId;
}

public void setFloorId(int floorId) {
FloorId = floorId;
}

public int getFloorIndex() {
return FloorIndex;
}

public void setFloorIndex(int floorIndex) {
FloorIndex = floorIndex;
}

public int getLevelId() {
return LevelId;
}

public void setLevelId(int levelId) {
LevelId = levelId;
}

public int getOverrideMonsterLevel() {
return OverrideMonsterLevel;
}

public void setOverrideMonsterLevel(int overrideMonsterLevel) {
OverrideMonsterLevel = overrideMonsterLevel;
}

public int getTeamNum() {
return TeamNum;
}

public void setTeamNum(int teamNum) {
TeamNum = teamNum;
}

public int getFloorLevelConfigId() {
return FloorLevelConfigId;
}

public void setFloorLevelConfigId(int floorLevelConfigId) {
FloorLevelConfigId = floorLevelConfigId;
}
}
55 changes: 55 additions & 0 deletions src/main/java/emu/grasscutter/data/def/TowerLevelData.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
package emu.grasscutter.data.def;

import emu.grasscutter.data.GameResource;
import emu.grasscutter.data.ResourceType;

@ResourceType(name = "TowerLevelExcelConfigData.json")
public class TowerLevelData extends GameResource {

private int ID;
private int LevelId;
private int LevelIndex;
private int DungeonId;

@Override
public int getId() {
return this.ID;
}

@Override
public void onLoad() {
super.onLoad();
}

public int getID() {
return ID;
}

public void setID(int ID) {
this.ID = ID;
}

public int getLevelId() {
return LevelId;
}

public void setLevelId(int levelId) {
LevelId = levelId;
}

public int getLevelIndex() {
return LevelIndex;
}

public void setLevelIndex(int levelIndex) {
LevelIndex = levelIndex;
}

public int getDungeonId() {
return DungeonId;
}

public void setDungeonId(int dungeonId) {
DungeonId = dungeonId;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ public void exitDungeon(Player player) {
prevPos.set(entry.getPointData().getTranPos());
}
}

// clean temp team if it has
player.getTeamManager().cleanTemporaryTeam();
// Transfer player back to world
player.getWorld().transferPlayerToScene(player, prevScene, prevPos);
player.sendPacket(new BasePacket(PacketOpcodes.PlayerQuitDungeonRsp));
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/emu/grasscutter/game/entity/EntityAvatar.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@ public void onDeath(int killerId) {
this.killedType = PlayerDieType.PLAYER_DIE_KILL_BY_MONSTER;
this.killedBy = killerId;
}

public void onDeath(PlayerDieType dieType, int killerId) {
this.killedType = dieType;
this.killedBy = killerId;
}

public SceneAvatarInfo getSceneAvatarInfo() {
SceneAvatarInfo.Builder avatarInfo = SceneAvatarInfo.newBuilder()
Expand Down
Loading

0 comments on commit 7279842

Please sign in to comment.