mirror of
https://github.com/FlourishingWorld/hk4e.git
synced 2026-02-04 15:52:27 +08:00
地牢场景传送
This commit is contained in:
29
gdconf/dungeon_data.go
Normal file
29
gdconf/dungeon_data.go
Normal file
@@ -0,0 +1,29 @@
|
||||
package gdconf
|
||||
|
||||
import (
|
||||
"hk4e/pkg/logger"
|
||||
)
|
||||
|
||||
// DungeonData 地牢配置表
|
||||
type DungeonData struct {
|
||||
DungeonId int32 `csv:"ID"`
|
||||
SceneId int32 `csv:"场景ID,omitempty"`
|
||||
}
|
||||
|
||||
func (g *GameDataConfig) loadDungeonData() {
|
||||
g.DungeonDataMap = make(map[int32]*DungeonData)
|
||||
dungeonDataList := make([]*DungeonData, 0)
|
||||
readTable[DungeonData](g.txtPrefix+"DungeonData.txt", &dungeonDataList)
|
||||
for _, dungeonData := range dungeonDataList {
|
||||
g.DungeonDataMap[dungeonData.DungeonId] = dungeonData
|
||||
}
|
||||
logger.Info("DungeonData count: %v", len(g.DungeonDataMap))
|
||||
}
|
||||
|
||||
func GetDungeonDataById(dungeonId int32) *DungeonData {
|
||||
return CONF.DungeonDataMap[dungeonId]
|
||||
}
|
||||
|
||||
func GetDungeonDataMap() map[int32]*DungeonData {
|
||||
return CONF.DungeonDataMap
|
||||
}
|
||||
@@ -62,6 +62,7 @@ type GameDataConfig struct {
|
||||
DropDataMap map[int32]*DropData // 掉落
|
||||
MonsterDropDataMap map[string]map[int32]*MonsterDropData // 怪物掉落
|
||||
ChestDropDataMap map[string]map[int32]*ChestDropData // 宝箱掉落
|
||||
DungeonDataMap map[int32]*DungeonData // 地牢
|
||||
GCGCharDataMap map[int32]*GCGCharData // 七圣召唤角色卡牌
|
||||
GCGSkillDataMap map[int32]*GCGSkillData // 七圣召唤卡牌技能
|
||||
GachaDropGroupDataMap map[int32]*GachaDropGroupData // 卡池掉落组 临时的
|
||||
@@ -160,6 +161,7 @@ func (g *GameDataConfig) load() {
|
||||
g.loadDropData() // 掉落
|
||||
g.loadMonsterDropData() // 怪物掉落
|
||||
g.loadChestDropData() // 宝箱掉落
|
||||
g.loadDungeonData() // 地牢
|
||||
g.loadGCGCharData() // 七圣召唤角色卡牌
|
||||
g.loadGCGSkillData() // 七圣召唤卡牌技能
|
||||
g.loadGachaDropGroupData() // 卡池掉落组 临时的
|
||||
|
||||
Reference in New Issue
Block a user