mirror of
https://github.com/FlourishingWorld/hk4e.git
synced 2026-02-17 16:02:28 +08:00
GCG流程至投掷骰子
This commit is contained in:
@@ -21,6 +21,7 @@ type GameDataConfig struct {
|
||||
AvatarSkillDataMap map[int32]*AvatarSkillData // 角色技能
|
||||
AvatarSkillDepotDataMap map[int32]*AvatarSkillDepotData // 角色技能库
|
||||
DropGroupDataMap map[int32]*DropGroupData // 掉落组
|
||||
GCGCharDataMap map[int32]*GCGCharData // 角色卡牌
|
||||
}
|
||||
|
||||
func InitGameDataConfig() {
|
||||
@@ -62,6 +63,7 @@ func (g *GameDataConfig) load() {
|
||||
g.loadAvatarSkillData() // 角色技能
|
||||
g.loadAvatarSkillDepotData() // 角色技能库
|
||||
g.loadDropGroupData() // 掉落组
|
||||
g.loadGCGCharData() // 角色卡牌
|
||||
}
|
||||
|
||||
func (g *GameDataConfig) readCsvFileData(fileName string) []byte {
|
||||
|
||||
75
gdconf/game_data_config/csv/GCGCharData.csv
Normal file
75
gdconf/game_data_config/csv/GCGCharData.csv
Normal file
@@ -0,0 +1,75 @@
|
||||
CharId,,TagId1,TagId2,TagId3,TagId4,TagId5,,,,,SkillListStr,,HPBase,MaxElemVal,,
|
||||
int32,,int32,int32,int32,int32,int32,,,,,string,,int32,int32,,
|
||||
ID,卡牌类型,[卡牌标签列表]1,[卡牌标签列表]2,[卡牌标签列表]3,[卡牌标签列表]4,[卡牌标签列表]5,[卡牌变量]1类型,[卡牌变量]1值,[卡牌变量]2类型,[卡牌变量]2值,卡牌技能列表,可进构筑,角色生命值,角色充能上限,最大行动意图数,死亡后移出游戏
|
||||
1001,1,303,503,502,201,,,,,,80,,50,1,1,
|
||||
1002,1,301,503,502,204,,,,,,80,,50,1,1,1
|
||||
1003,1,303,503,502,201,,,,,,80#1130211,,50,1,1,
|
||||
1101,1,301,204,402,,,16,0,,,11011# 11012# 11013# 11014,1,10,2,2,
|
||||
1102,1,301,204,401,,,,,,,11021# 11022# 11023,1,10,3,2,
|
||||
1103,1,301,201,401,,,,,,,11031# 11032# 11033,1,10,2,2,
|
||||
1104,1,301,203,402,,,,,,,11041# 11042# 11043,1,10,3,2,
|
||||
1105,1,301,201,403,,,,,,,11051# 11052# 11053# 11054,1,10,3,2,
|
||||
1201,1,302,202,401,,,,,,,12011# 12012# 12013,1,10,3,2,
|
||||
1202,1,302,201,402,,,,,,,12021# 12022# 12023,1,10,2,2,
|
||||
1203,1,302,202,401,,,,,,,12031# 12032# 12033# 12034,1,10,3,2,
|
||||
1301,1,303,203,401,,,,,,,13011# 13012# 13013,1,10,3,2,
|
||||
1302,1,303,205,402,,,,,,,13021# 13022# 13023,1,10,2,2,
|
||||
1303,1,303,201,401,,,,,,,13031# 13032# 13033,1,10,2,2,
|
||||
1305,1,303,204,403,,,,,,,13051# 13052# 13053,1,10,2,2,
|
||||
1401,1,304,204,401,,,,,,,14011# 14012# 14013,1,10,3,2,
|
||||
1402,1,304,203,401,,,,,,,14021# 14022# 14023,1,10,3,2,
|
||||
1403,1,304,201,402,,,,,,,14031# 14032# 14033,1,10,3,2,
|
||||
1404,1,304,205,404,,,,,,,14041# 14042# 14043# 14044,1,10,2,2,
|
||||
1501,1,307,202,401,,,,,,,15011# 15012# 15013,1,10,2,2,
|
||||
1502,1,307,201,401,,,,,,,15021# 15022# 15023,1,10,3,2,
|
||||
1601,1,305,202,402,,,,,,,16011# 16012# 16013,1,10,3,2,
|
||||
1602,1,305,203,401,,,,,,,16021# 16022# 16023,1,10,2,2,
|
||||
1701,1,306,204,404,,,,,,,17011# 17012# 17013,1,10,2,2,
|
||||
2201,1,302,200,503,,,,,,,22011# 22012# 22013# 22014,1,10,3,2,
|
||||
2202,1,302,200,501,,,,,,,22021# 22022# 22023,1,10,2,2,
|
||||
2301,1,303,200,501,,,,,,,23011# 23012# 23013# 23014,1,10,2,2,
|
||||
2501,1,307,200,503,,,,,,,25011# 25012# 25013# 25014,1,10,3,2,
|
||||
2601,1,305,200,503,502,,,,,,26011# 26012# 26013# 26014,1,8,2,2,
|
||||
2701,1,306,200,503,,,,,,,27011# 27012# 27013# 27014,1,10,2,2,
|
||||
3001,1,300,503,502,,,,,,,30011# 30012# 30013,,4,2,1,1
|
||||
3002,1,300,503,502,,,,,,,30021# 30022# 30023,,3,2,1,1
|
||||
3003,1,300,504,,,,,,,,30031# 30032# 30033# 30034# 30035# 30036,,6,2,1,1
|
||||
3101,1,301,503,502,,,,,,,31011# 31012# 31013# 31014# 31015,,8,2,2,1
|
||||
3102,1,301,503,502,,,,,,,31021# 31022# 31023,,3,2,1,1
|
||||
3103,1,301,503,,,,,,,,31031# 31032# 31033# 31034# 31035,,4,2,2,1
|
||||
3201,1,302,503,,,,,,,,32011# 32012# 32013# 32014# 32015,,4,3,2,1
|
||||
3202,1,302,503,502,,,,,,,32021# 32022# 32023,,4,2,2,1
|
||||
3203,1,302,501,,,,,,,,32031# 32032# 32033# 32034# 32035,,10,3,2,1
|
||||
3204,1,302,503,,,,,,,,32041# 32042# 32043,,4,2,1,1
|
||||
3301,1,303,503,,,,,,,,33011# 33012# 33013# 33014# 33015,,4,3,2,1
|
||||
3302,1,303,503,502,,,,,,,33021# 33022# 33023# 33024,,8,2,2,1
|
||||
3303,1,303,504,,,,,,,,33031# 33032# 33033# 33034# 33035# 33036# 33037,,10,2,2,1
|
||||
3304,1,303,503,502,,,,,,,33041# 33042# 33043,,4,2,1,1
|
||||
3305,1,303,504,,,,,,,,33051# 33052# 30033# 30034# 30035# 30036,,6,2,1,1
|
||||
3401,1,304,504,,,,,,,,34011# 34012# 34013# 34014# 34015# 34016# 34017,,10,2,2,1
|
||||
3402,1,304,503,502,,,,,,,34021# 34022# 34023,,3,2,1,1
|
||||
3403,1,304,503,502,,,,,,,34031# 34032# 34033# 34034,,8,2,2,1
|
||||
3405,1,304,504,,,,,,,,34051# 34052# 30033# 30034# 30035# 30036,,6,2,1,1
|
||||
3406,1,304,503,,,,,,,,34061# 34062# 34063,,4,2,1,1
|
||||
3501,1,307,503,502,,,,,,,35011# 35012# 35013,,4,2,2,1
|
||||
3502,1,307,501,,,,,,,,35021# 35022# 35023# 35024# 35025,,10,2,2,1
|
||||
3701,1,306,503,,,,,,,,37011# 37012# 37013# 37014,,6,2,2,1
|
||||
3703,1,306,503,502,,,,,,,37031# 37032# 37033,,4,2,1,1
|
||||
4601,1,305,200,503,502,,,,,,26011# 26012 # 26013,,12,2,2,1
|
||||
4602,1,305,200,503,502,,,,,,26011# 26012 # 26013# 26014,,16,2,3,1
|
||||
4603,1,305,200,503,502,,,,,,26011# 26012 # 26013# 26014,,24,2,3,1
|
||||
4604,1,305,200,503,502,,,,,,26011# 26012 # 26013# 26014,,8,2,2,1
|
||||
4201,1,302,200,503,,,,,,,22011# 22012 # 22013# 22014# 32043,,30,3,4,1
|
||||
4202,1,302,200,503,,,,,,,22011# 22012 # 22013# 22014# 32043,,45,3,4,1
|
||||
4203,1,302,200,501,,,,,,,22021# 22022 # 22023,,10,2,3,1
|
||||
4204,1,302,200,501,,,,,,,22021# 22022 # 22023,,10,2,2,1
|
||||
4301,1,303,200,501,,,,,,,23011# 23012 # 23013# 23014,,10,2,3,1
|
||||
4302,1,303,200,501,,,,,,,23011# 23012 # 23013# 23014,,10,2,2,1
|
||||
4501,1,307,200,503,,,,,,,25011# 25012 # 25013# 25014,,20,3,2,1
|
||||
4502,1,307,200,503,,,,,,,25011# 25012 # 25013# 25014,,28,3,2,1
|
||||
4701,1,306,200,503,,,,,,,27011# 27012 # 27013# 27014,,36,2,4,1
|
||||
4702,1,306,200,503,,,,,,,27011# 27012 # 27013# 27014,,48,2,4,1
|
||||
4703,1,306,200,503,,,,,,,27011# 27012 # 27013# 27014,,10,2,2,1
|
||||
4704,1,306,200,503,,,,,,,27011# 27012 # 27013# 27014,,30,2,3,1
|
||||
5201,1,302,503,,,,,,,,32011# 32012# 32013# 32014# 32015# 32016,,4,3,2,1
|
||||
5301,1,303,503,,,,,,,,33011# 33012# 33013# 33014# 33015# 33016,,4,3,2,1
|
||||
|
66
gdconf/gcg_char_data.go
Normal file
66
gdconf/gcg_char_data.go
Normal file
@@ -0,0 +1,66 @@
|
||||
package gdconf
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"hk4e/pkg/logger"
|
||||
|
||||
"github.com/jszwec/csvutil"
|
||||
)
|
||||
|
||||
// 角色卡牌配置表
|
||||
|
||||
type GCGCharData struct {
|
||||
CharId int32 `csv:"CharId"` // ID
|
||||
TagId1 int32 `csv:"TagId1,omitempty"` // 卡牌标签列表1
|
||||
TagId2 int32 `csv:"TagId2,omitempty"` // 卡牌标签列表2
|
||||
TagId3 int32 `csv:"TagId3,omitempty"` // 卡牌标签列表3
|
||||
TagId4 int32 `csv:"TagId4,omitempty"` // 卡牌标签列表4
|
||||
TagId5 int32 `csv:"TagId5,omitempty"` // 卡牌标签列表5
|
||||
SkillListStr string `csv:"SkillListStr,omitempty"` // 卡牌技能列表文本
|
||||
HPBase int32 `csv:"HPBase,omitempty"` // 角色生命值
|
||||
MaxElemVal int32 `csv:"MaxElemVal,omitempty"` // 角色充能上限
|
||||
|
||||
TagList []uint32 // 卡牌标签列表
|
||||
SkillList []uint32 // 卡牌技能列表
|
||||
}
|
||||
|
||||
func (g *GameDataConfig) loadGCGCharData() {
|
||||
g.GCGCharDataMap = make(map[int32]*GCGCharData)
|
||||
data := g.readCsvFileData("GCGCharData.csv")
|
||||
var gcgCharDataList []*GCGCharData
|
||||
err := csvutil.Unmarshal(data, &gcgCharDataList)
|
||||
if err != nil {
|
||||
info := fmt.Sprintf("parse file error: %v", err)
|
||||
panic(info)
|
||||
}
|
||||
for _, gcgCharData := range gcgCharDataList {
|
||||
// 将TagId整合进TagList
|
||||
gcgCharData.TagList = make([]uint32, 0, 5)
|
||||
tempTagList := make([]int32, 0, 5)
|
||||
tempTagList = append(tempTagList, gcgCharData.TagId1, gcgCharData.TagId2, gcgCharData.TagId3, gcgCharData.TagId4, gcgCharData.TagId5)
|
||||
for _, tagId := range tempTagList {
|
||||
// 跳过为0的tag
|
||||
if tagId == 0 {
|
||||
continue
|
||||
}
|
||||
gcgCharData.TagList = append(gcgCharData.TagList, uint32(tagId))
|
||||
}
|
||||
// 技能列表读取转换
|
||||
tempSkillList := strings.Split(strings.ReplaceAll(gcgCharData.SkillListStr, " ", ""), "#")
|
||||
gcgCharData.SkillList = make([]uint32, 0, len(tempSkillList))
|
||||
for _, s := range tempSkillList {
|
||||
skillId, err := strconv.Atoi(s)
|
||||
if err != nil {
|
||||
logger.Error("skill id to i err, %v", err)
|
||||
return
|
||||
}
|
||||
gcgCharData.SkillList = append(gcgCharData.SkillList, uint32(skillId))
|
||||
}
|
||||
// list -> map
|
||||
g.GCGCharDataMap[gcgCharData.CharId] = gcgCharData
|
||||
}
|
||||
logger.Info("GCGCharData count: %v", len(g.GCGCharDataMap))
|
||||
}
|
||||
Reference in New Issue
Block a user