武器圣遗物角色面板属性加成
This commit is contained in:
1 parent
331c935484
commit
86999bbdc0
6 files changed
+260
-15
No files matched your search
@@ -12,9 +12,10 @@ type AddProp struct {
|
||||
|
||||
// AvatarPromoteData 角色突破配置表
|
||||
type AvatarPromoteData struct {
|
||||
PromoteId int32 `csv:"角色突破ID"`
|
||||
PromoteLevel int32 `csv:"突破等级,omitempty"`
|
||||
CostCoin int32 `csv:"消耗金币,omitempty"`
|
||||
PromoteId int32 `csv:"角色突破ID"`
|
||||
PromoteLevel int32 `csv:"突破等级,omitempty"`
|
||||
CostCoin int32 `csv:"消耗金币,omitempty"`
|
||||
|
||||
CostItemId1 int32 `csv:"[消耗物品]1ID,omitempty"`
|
||||
CostItemCount1 int32 `csv:"[消耗物品]1数量,omitempty"`
|
||||
CostItemId2 int32 `csv:"[消耗物品]2ID,omitempty"`
|
||||
@@ -23,6 +24,7 @@ type AvatarPromoteData struct {
|
||||
CostItemCount3 int32 `csv:"[消耗物品]3数量,omitempty"`
|
||||
CostItemId4 int32 `csv:"[消耗物品]4ID,omitempty"`
|
||||
CostItemCount4 int32 `csv:"[消耗物品]4数量,omitempty"`
|
||||
|
||||
LevelLimit int32 `csv:"解锁等级上限,omitempty"`
|
||||
MinPlayerLevel int32 `csv:"冒险等级要求,omitempty"`
|
||||
|
||||
|
||||
@@ -82,6 +82,7 @@ type GameDataConfig struct {
|
||||
ProudSkillDataMap map[int32]map[int32]*ProudSkillData // 天赋
|
||||
AvatarCurveDataMap map[int32]*AvatarCurveData // 角色曲线
|
||||
WeaponCurveDataMap map[int32]*WeaponCurveData // 武器曲线
|
||||
ReliquaryLevelDataMap map[int32]map[int32]*ReliquaryLevelData // 圣遗物等级
|
||||
}
|
||||
|
||||
func InitGameDataConfig() {
|
||||
@@ -195,6 +196,7 @@ func (g *GameDataConfig) load(loadSceneLua bool) {
|
||||
g.loadProudSkillData() // 天赋
|
||||
g.loadAvatarCurveData() // 角色曲线
|
||||
g.loadWeaponCurveData() // 武器曲线
|
||||
g.loadReliquaryLevelData() // 圣遗物等级
|
||||
}
|
||||
|
||||
// CSV相关
|
||||
|
||||
+9
-4
@@ -59,10 +59,15 @@ type ItemData struct {
|
||||
PropList []*Prop
|
||||
|
||||
// 圣遗物
|
||||
ReliquaryType int32 `csv:"圣遗物类别,omitempty"`
|
||||
MainPropDepotId int32 `csv:"主属性库ID,omitempty"`
|
||||
AppendPropDepotId int32 `csv:"追加属性库ID,omitempty"`
|
||||
AppendPropCount int32 `csv:"追加属性初始条数,omitempty"`
|
||||
ReliquaryType int32 `csv:"圣遗物类别,omitempty"`
|
||||
Stage int32 `csv:"阶数,omitempty"`
|
||||
MainPropDepotId int32 `csv:"主属性库ID,omitempty"`
|
||||
AppendPropDepotId int32 `csv:"追加属性库ID,omitempty"`
|
||||
AppendPropCount int32 `csv:"追加属性初始条数,omitempty"`
|
||||
SuitId int32 `csv:"套装ID,omitempty"`
|
||||
PropAddLevel IntArray `csv:"属性加成等级,omitempty"`
|
||||
BaseConvExp int32 `csv:"基础转化经验,omitempty"`
|
||||
UpgradeLevelMax int32 `csv:"强化等级上限,omitempty"`
|
||||
}
|
||||
|
||||
func (g *GameDataConfig) loadItemData() {
|
||||
|
||||
@@ -6,10 +6,13 @@ import (
|
||||
|
||||
// ReliquaryAffixData 圣遗物追加属性配置表
|
||||
type ReliquaryAffixData struct {
|
||||
AppendPropId int32 `csv:"追加属性ID"`
|
||||
AppendPropDepotId int32 `csv:"追加属性库ID,omitempty"`
|
||||
PropType int32 `csv:"属性类别,omitempty"`
|
||||
RandomWeight int32 `csv:"随机权重,omitempty"`
|
||||
AppendPropId int32 `csv:"追加属性ID"`
|
||||
AppendPropDepotId int32 `csv:"追加属性库ID,omitempty"`
|
||||
Group int32 `csv:"组别,omitempty"`
|
||||
PropType int32 `csv:"属性类别,omitempty"`
|
||||
AppendPropValue float32 `csv:"追加属性值,omitempty"`
|
||||
RandomWeight int32 `csv:"随机权重,omitempty"`
|
||||
UpgradeWeight int32 `csv:"升级权重,omitempty"`
|
||||
}
|
||||
|
||||
func (g *GameDataConfig) loadReliquaryAffixData() {
|
||||
|
||||
@@ -0,0 +1,201 @@
|
||||
package gdconf
|
||||
|
||||
import (
|
||||
"hk4e/pkg/logger"
|
||||
)
|
||||
|
||||
// ReliquaryLevelData 圣遗物等级配置表
|
||||
type ReliquaryLevelData struct {
|
||||
Stage int32 `csv:"阶数"`
|
||||
Level int32 `csv:"等级,omitempty"`
|
||||
Exp int32 `csv:"升到下一级所需经验,omitempty"`
|
||||
|
||||
AddProp1Type int32 `csv:"[增加属性]1类型,omitempty"`
|
||||
AddProp1Value float32 `csv:"[增加属性]1值,omitempty"`
|
||||
AddProp2Type int32 `csv:"[增加属性]2类型,omitempty"`
|
||||
AddProp2Value float32 `csv:"[增加属性]2值,omitempty"`
|
||||
AddProp3Type int32 `csv:"[增加属性]3类型,omitempty"`
|
||||
AddProp3Value float32 `csv:"[增加属性]3值,omitempty"`
|
||||
AddProp4Type int32 `csv:"[增加属性]4类型,omitempty"`
|
||||
AddProp4Value float32 `csv:"[增加属性]4值,omitempty"`
|
||||
AddProp5Type int32 `csv:"[增加属性]5类型,omitempty"`
|
||||
AddProp5Value float32 `csv:"[增加属性]5值,omitempty"`
|
||||
AddProp6Type int32 `csv:"[增加属性]6类型,omitempty"`
|
||||
AddProp6Value float32 `csv:"[增加属性]6值,omitempty"`
|
||||
AddProp7Type int32 `csv:"[增加属性]7类型,omitempty"`
|
||||
AddProp7Value float32 `csv:"[增加属性]7值,omitempty"`
|
||||
AddProp8Type int32 `csv:"[增加属性]8类型,omitempty"`
|
||||
AddProp8Value float32 `csv:"[增加属性]8值,omitempty"`
|
||||
AddProp9Type int32 `csv:"[增加属性]9类型,omitempty"`
|
||||
AddProp9Value float32 `csv:"[增加属性]9值,omitempty"`
|
||||
AddProp10Type int32 `csv:"[增加属性]10类型,omitempty"`
|
||||
AddProp10Value float32 `csv:"[增加属性]10值,omitempty"`
|
||||
AddProp11Type int32 `csv:"[增加属性]11类型,omitempty"`
|
||||
AddProp11Value float32 `csv:"[增加属性]11值,omitempty"`
|
||||
AddProp12Type int32 `csv:"[增加属性]12类型,omitempty"`
|
||||
AddProp12Value float32 `csv:"[增加属性]12值,omitempty"`
|
||||
AddProp13Type int32 `csv:"[增加属性]13类型,omitempty"`
|
||||
AddProp13Value float32 `csv:"[增加属性]13值,omitempty"`
|
||||
AddProp14Type int32 `csv:"[增加属性]14类型,omitempty"`
|
||||
AddProp14Value float32 `csv:"[增加属性]14值,omitempty"`
|
||||
AddProp15Type int32 `csv:"[增加属性]15类型,omitempty"`
|
||||
AddProp15Value float32 `csv:"[增加属性]15值,omitempty"`
|
||||
AddProp16Type int32 `csv:"[增加属性]16类型,omitempty"`
|
||||
AddProp16Value float32 `csv:"[增加属性]16值,omitempty"`
|
||||
AddProp17Type int32 `csv:"[增加属性]17类型,omitempty"`
|
||||
AddProp17Value float32 `csv:"[增加属性]17值,omitempty"`
|
||||
AddProp18Type int32 `csv:"[增加属性]18类型,omitempty"`
|
||||
AddProp18Value float32 `csv:"[增加属性]18值,omitempty"`
|
||||
AddProp19Type int32 `csv:"[增加属性]19类型,omitempty"`
|
||||
AddProp19Value float32 `csv:"[增加属性]19值,omitempty"`
|
||||
AddProp20Type int32 `csv:"[增加属性]20类型,omitempty"`
|
||||
AddProp20Value float32 `csv:"[增加属性]20值,omitempty"`
|
||||
|
||||
AddPropMap map[int32]*AddProp // 增加属性集合
|
||||
}
|
||||
|
||||
func (g *GameDataConfig) loadReliquaryLevelData() {
|
||||
g.ReliquaryLevelDataMap = make(map[int32]map[int32]*ReliquaryLevelData)
|
||||
reliquaryLevelDataList := make([]*ReliquaryLevelData, 0)
|
||||
readTable[ReliquaryLevelData](g.txtPrefix+"ReliquaryLevelData.txt", &reliquaryLevelDataList)
|
||||
for _, reliquaryLevelData := range reliquaryLevelDataList {
|
||||
_, ok := g.ReliquaryLevelDataMap[reliquaryLevelData.Stage]
|
||||
if !ok {
|
||||
g.ReliquaryLevelDataMap[reliquaryLevelData.Stage] = make(map[int32]*ReliquaryLevelData)
|
||||
}
|
||||
// 增加属性集合
|
||||
addPropMap := make(map[int32]*AddProp)
|
||||
if reliquaryLevelData.AddProp1Type != 0 {
|
||||
addPropMap[reliquaryLevelData.AddProp1Type] = &AddProp{
|
||||
Type: reliquaryLevelData.AddProp1Type,
|
||||
Value: reliquaryLevelData.AddProp1Value,
|
||||
}
|
||||
}
|
||||
if reliquaryLevelData.AddProp2Type != 0 {
|
||||
addPropMap[reliquaryLevelData.AddProp2Type] = &AddProp{
|
||||
Type: reliquaryLevelData.AddProp2Type,
|
||||
Value: reliquaryLevelData.AddProp2Value,
|
||||
}
|
||||
}
|
||||
if reliquaryLevelData.AddProp3Type != 0 {
|
||||
addPropMap[reliquaryLevelData.AddProp3Type] = &AddProp{
|
||||
Type: reliquaryLevelData.AddProp3Type,
|
||||
Value: reliquaryLevelData.AddProp3Value,
|
||||
}
|
||||
}
|
||||
if reliquaryLevelData.AddProp4Type != 0 {
|
||||
addPropMap[reliquaryLevelData.AddProp4Type] = &AddProp{
|
||||
Type: reliquaryLevelData.AddProp4Type,
|
||||
Value: reliquaryLevelData.AddProp4Value,
|
||||
}
|
||||
}
|
||||
if reliquaryLevelData.AddProp5Type != 0 {
|
||||
addPropMap[reliquaryLevelData.AddProp5Type] = &AddProp{
|
||||
Type: reliquaryLevelData.AddProp5Type,
|
||||
Value: reliquaryLevelData.AddProp5Value,
|
||||
}
|
||||
}
|
||||
if reliquaryLevelData.AddProp6Type != 0 {
|
||||
addPropMap[reliquaryLevelData.AddProp6Type] = &AddProp{
|
||||
Type: reliquaryLevelData.AddProp6Type,
|
||||
Value: reliquaryLevelData.AddProp6Value,
|
||||
}
|
||||
}
|
||||
if reliquaryLevelData.AddProp7Type != 0 {
|
||||
addPropMap[reliquaryLevelData.AddProp7Type] = &AddProp{
|
||||
Type: reliquaryLevelData.AddProp7Type,
|
||||
Value: reliquaryLevelData.AddProp7Value,
|
||||
}
|
||||
}
|
||||
if reliquaryLevelData.AddProp8Type != 0 {
|
||||
addPropMap[reliquaryLevelData.AddProp8Type] = &AddProp{
|
||||
Type: reliquaryLevelData.AddProp8Type,
|
||||
Value: reliquaryLevelData.AddProp8Value,
|
||||
}
|
||||
}
|
||||
if reliquaryLevelData.AddProp9Type != 0 {
|
||||
addPropMap[reliquaryLevelData.AddProp9Type] = &AddProp{
|
||||
Type: reliquaryLevelData.AddProp9Type,
|
||||
Value: reliquaryLevelData.AddProp9Value,
|
||||
}
|
||||
}
|
||||
if reliquaryLevelData.AddProp10Type != 0 {
|
||||
addPropMap[reliquaryLevelData.AddProp10Type] = &AddProp{
|
||||
Type: reliquaryLevelData.AddProp10Type,
|
||||
Value: reliquaryLevelData.AddProp10Value,
|
||||
}
|
||||
}
|
||||
if reliquaryLevelData.AddProp11Type != 0 {
|
||||
addPropMap[reliquaryLevelData.AddProp11Type] = &AddProp{
|
||||
Type: reliquaryLevelData.AddProp11Type,
|
||||
Value: reliquaryLevelData.AddProp11Value,
|
||||
}
|
||||
}
|
||||
if reliquaryLevelData.AddProp12Type != 0 {
|
||||
addPropMap[reliquaryLevelData.AddProp12Type] = &AddProp{
|
||||
Type: reliquaryLevelData.AddProp12Type,
|
||||
Value: reliquaryLevelData.AddProp12Value,
|
||||
}
|
||||
}
|
||||
if reliquaryLevelData.AddProp13Type != 0 {
|
||||
addPropMap[reliquaryLevelData.AddProp13Type] = &AddProp{
|
||||
Type: reliquaryLevelData.AddProp13Type,
|
||||
Value: reliquaryLevelData.AddProp13Value,
|
||||
}
|
||||
}
|
||||
if reliquaryLevelData.AddProp14Type != 0 {
|
||||
addPropMap[reliquaryLevelData.AddProp14Type] = &AddProp{
|
||||
Type: reliquaryLevelData.AddProp14Type,
|
||||
Value: reliquaryLevelData.AddProp14Value,
|
||||
}
|
||||
}
|
||||
if reliquaryLevelData.AddProp15Type != 0 {
|
||||
addPropMap[reliquaryLevelData.AddProp15Type] = &AddProp{
|
||||
Type: reliquaryLevelData.AddProp15Type,
|
||||
Value: reliquaryLevelData.AddProp15Value,
|
||||
}
|
||||
}
|
||||
if reliquaryLevelData.AddProp16Type != 0 {
|
||||
addPropMap[reliquaryLevelData.AddProp16Type] = &AddProp{
|
||||
Type: reliquaryLevelData.AddProp16Type,
|
||||
Value: reliquaryLevelData.AddProp16Value,
|
||||
}
|
||||
}
|
||||
if reliquaryLevelData.AddProp17Type != 0 {
|
||||
addPropMap[reliquaryLevelData.AddProp17Type] = &AddProp{
|
||||
Type: reliquaryLevelData.AddProp17Type,
|
||||
Value: reliquaryLevelData.AddProp17Value,
|
||||
}
|
||||
}
|
||||
if reliquaryLevelData.AddProp18Type != 0 {
|
||||
addPropMap[reliquaryLevelData.AddProp18Type] = &AddProp{
|
||||
Type: reliquaryLevelData.AddProp18Type,
|
||||
Value: reliquaryLevelData.AddProp18Value,
|
||||
}
|
||||
}
|
||||
if reliquaryLevelData.AddProp19Type != 0 {
|
||||
addPropMap[reliquaryLevelData.AddProp19Type] = &AddProp{
|
||||
Type: reliquaryLevelData.AddProp19Type,
|
||||
Value: reliquaryLevelData.AddProp19Value,
|
||||
}
|
||||
}
|
||||
if reliquaryLevelData.AddProp20Type != 0 {
|
||||
addPropMap[reliquaryLevelData.AddProp20Type] = &AddProp{
|
||||
Type: reliquaryLevelData.AddProp20Type,
|
||||
Value: reliquaryLevelData.AddProp20Value,
|
||||
}
|
||||
}
|
||||
reliquaryLevelData.AddPropMap = addPropMap
|
||||
// 通过突破等级找到突破数据
|
||||
g.ReliquaryLevelDataMap[reliquaryLevelData.Stage][reliquaryLevelData.Level] = reliquaryLevelData
|
||||
}
|
||||
logger.Info("ReliquaryLevelData count: %v", len(g.ReliquaryLevelDataMap))
|
||||
}
|
||||
|
||||
func GetReliquaryLevelDataByStageAndLevel(stage int32, level int32) *ReliquaryLevelData {
|
||||
value, exist := CONF.ReliquaryLevelDataMap[stage]
|
||||
if !exist {
|
||||
return nil
|
||||
}
|
||||
return value[level]
|
||||
}
|
||||
@@ -641,10 +641,6 @@ func (g *Game) UpdatePlayerAvatarFightProp(userId uint32, avatarId uint32) {
|
||||
avatar.FightPropMap[constant.FIGHT_PROP_BASE_ATTACK] = gdconf.GetAvatarBaseADH(avatar.AvatarId, avatar.Level, avatar.Promote, constant.FIGHT_PROP_BASE_ATTACK)
|
||||
avatar.FightPropMap[constant.FIGHT_PROP_BASE_DEFENSE] = gdconf.GetAvatarBaseADH(avatar.AvatarId, avatar.Level, avatar.Promote, constant.FIGHT_PROP_BASE_DEFENSE)
|
||||
avatar.FightPropMap[constant.FIGHT_PROP_BASE_HP] = gdconf.GetAvatarBaseADH(avatar.AvatarId, avatar.Level, avatar.Promote, constant.FIGHT_PROP_BASE_HP)
|
||||
// 白字+绿字攻防血
|
||||
avatar.FightPropMap[constant.FIGHT_PROP_CUR_ATTACK] = gdconf.GetAvatarBaseADH(avatar.AvatarId, avatar.Level, avatar.Promote, constant.FIGHT_PROP_BASE_ATTACK)
|
||||
avatar.FightPropMap[constant.FIGHT_PROP_CUR_DEFENSE] = gdconf.GetAvatarBaseADH(avatar.AvatarId, avatar.Level, avatar.Promote, constant.FIGHT_PROP_BASE_DEFENSE)
|
||||
avatar.FightPropMap[constant.FIGHT_PROP_MAX_HP] = gdconf.GetAvatarBaseADH(avatar.AvatarId, avatar.Level, avatar.Promote, constant.FIGHT_PROP_BASE_HP)
|
||||
// 双暴
|
||||
avatar.FightPropMap[constant.FIGHT_PROP_CRITICAL] = avatarDataConfig.Critical
|
||||
avatar.FightPropMap[constant.FIGHT_PROP_CRITICAL_HURT] = avatarDataConfig.CriticalHurt
|
||||
@@ -666,6 +662,42 @@ func (g *Game) UpdatePlayerAvatarFightProp(userId uint32, avatarId uint32) {
|
||||
avatar.FightPropMap[uint32(prop.Type)] += prop.Value * curveConfig.Value
|
||||
}
|
||||
|
||||
// 圣遗物属性加成
|
||||
for _, reliquary := range avatar.EquipReliquaryMap {
|
||||
// 主词条
|
||||
reliquaryItemConfig := gdconf.GetItemDataById(int32(reliquary.ItemId))
|
||||
if reliquaryItemConfig == nil {
|
||||
logger.Error("reliquaryItemConfig is nil, itemId: %v", reliquary.ItemId)
|
||||
return
|
||||
}
|
||||
reliquaryMainConfig := gdconf.GetReliquaryMainDataByDepotIdAndPropId(reliquaryItemConfig.MainPropDepotId, int32(reliquary.MainPropId))
|
||||
if reliquaryMainConfig == nil {
|
||||
logger.Error("reliquaryMainConfig is nil, mainPropDepotId: %v, mainPropId: %v", reliquaryItemConfig.MainPropDepotId, reliquary.MainPropId)
|
||||
return
|
||||
}
|
||||
reliquaryLevelConfig := gdconf.GetReliquaryLevelDataByStageAndLevel(reliquaryItemConfig.Stage, int32(reliquary.Level))
|
||||
if reliquaryLevelConfig == nil {
|
||||
logger.Error("reliquaryLevelConfig is nil, stage: %v, level: %v", reliquaryItemConfig.Stage, reliquary.Level)
|
||||
return
|
||||
}
|
||||
addProp := reliquaryLevelConfig.AddPropMap[reliquaryMainConfig.PropType]
|
||||
avatar.FightPropMap[uint32(addProp.Type)] += addProp.Value
|
||||
// 副词条
|
||||
for _, appendPropId := range reliquary.AppendPropIdList {
|
||||
reliquaryAffixConfig := gdconf.GetReliquaryAffixDataByDepotIdAndPropId(reliquaryItemConfig.AppendPropDepotId, int32(appendPropId))
|
||||
if reliquaryAffixConfig == nil {
|
||||
logger.Error("reliquaryAffixConfig is nil, appendPropDepotId: %v, appendPropId: %v", reliquaryItemConfig.AppendPropDepotId, appendPropId)
|
||||
return
|
||||
}
|
||||
avatar.FightPropMap[uint32(reliquaryAffixConfig.PropType)] += reliquaryAffixConfig.AppendPropValue
|
||||
}
|
||||
}
|
||||
|
||||
// 白字+绿字攻防血
|
||||
avatar.FightPropMap[constant.FIGHT_PROP_CUR_ATTACK] = avatar.FightPropMap[constant.FIGHT_PROP_BASE_ATTACK] * (1.0 + avatar.FightPropMap[constant.FIGHT_PROP_ATTACK_PERCENT])
|
||||
avatar.FightPropMap[constant.FIGHT_PROP_CUR_DEFENSE] = avatar.FightPropMap[constant.FIGHT_PROP_BASE_DEFENSE] * (1.0 + avatar.FightPropMap[constant.FIGHT_PROP_DEFENSE_PERCENT])
|
||||
avatar.FightPropMap[constant.FIGHT_PROP_MAX_HP] = avatar.FightPropMap[constant.FIGHT_PROP_BASE_HP] * (1.0 + avatar.FightPropMap[constant.FIGHT_PROP_HP_PERCENT])
|
||||
|
||||
avatarFightPropNotify := &proto.AvatarFightPropNotify{
|
||||
AvatarGuid: avatar.Guid,
|
||||
FightPropMap: avatar.FightPropMap,
|
||||
|
||||
Reference in new issue
Block a user