积分boss 我方 或敌方 buff 带入

This commit is contained in:
meixiongfeng 2024-01-24 18:32:35 +08:00
parent d7770b71fa
commit fd9fb02ca7
9 changed files with 568 additions and 21 deletions

View File

@ -0,0 +1,398 @@
[
{
"skillid": 310001001,
"type": 1,
"val": 1,
"show": 1,
"incompatibility": [
310001002
],
"name": {
"key": "IntegralBoss_Integralbuff_name_01",
"text": "我方增益"
},
"icon": "wp_icon_10021",
"des": {
"key": "IntegralBoss_Integralbuff_des_01",
"text": "我方守护者生命上限提升30%"
}
},
{
"skillid": 310001002,
"type": 1,
"val": 2,
"show": 1,
"incompatibility": [
310001001
],
"name": {
"key": "IntegralBoss_Integralbuff_name_02",
"text": "我方增益"
},
"icon": "wp_icon_10021",
"des": {
"key": "IntegralBoss_Integralbuff_des_02",
"text": "我方守护者受到伤害降低30%"
}
},
{
"skillid": 310001003,
"type": 1,
"val": 3,
"show": 1,
"incompatibility": [
310001001
],
"name": {
"key": "IntegralBoss_Integralbuff_name_03",
"text": "我方增益"
},
"icon": "wp_icon_10021",
"des": {
"key": "IntegralBoss_Integralbuff_des_03",
"text": "守护者血量低于30%时伤害提升60%"
}
},
{
"skillid": 310001004,
"type": 2,
"val": 1,
"show": 1,
"incompatibility": [
310001001
],
"name": {
"key": "IntegralBoss_Integralbuff_name_04",
"text": "敌方增益"
},
"icon": "wp_icon_10021",
"des": {
"key": "IntegralBoss_Integralbuff_des_04",
"text": "敌方全体伤害提升10%"
}
},
{
"skillid": 310001005,
"type": 2,
"val": 2,
"show": 1,
"incompatibility": [
310001001
],
"name": {
"key": "IntegralBoss_Integralbuff_name_05",
"text": "敌方增益"
},
"icon": "wp_icon_10021",
"des": {
"key": "IntegralBoss_Integralbuff_des_05",
"text": "敌方全体伤害提升20%"
}
},
{
"skillid": 310001006,
"type": 2,
"val": 3,
"show": 1,
"incompatibility": [
310001001
],
"name": {
"key": "IntegralBoss_Integralbuff_name_06",
"text": "敌方增益"
},
"icon": "wp_icon_10021",
"des": {
"key": "IntegralBoss_Integralbuff_des_06",
"text": "敌方全体伤害提升30%"
}
},
{
"skillid": 310001007,
"type": 2,
"val": 1,
"show": 2,
"incompatibility": [
310001001
],
"name": {
"key": "IntegralBoss_Integralbuff_name_07",
"text": "敌方增益"
},
"icon": "wp_icon_10021",
"des": {
"key": "IntegralBoss_Integralbuff_des_07",
"text": "敌方全体速度+2"
}
},
{
"skillid": 310001008,
"type": 2,
"val": 2,
"show": 2,
"incompatibility": [
310001001
],
"name": {
"key": "IntegralBoss_Integralbuff_name_08",
"text": "敌方增益"
},
"icon": "wp_icon_10021",
"des": {
"key": "IntegralBoss_Integralbuff_des_08",
"text": "敌方全体速度+3"
}
},
{
"skillid": 310001009,
"type": 2,
"val": 3,
"show": 2,
"incompatibility": [
310001001
],
"name": {
"key": "IntegralBoss_Integralbuff_name_09",
"text": "敌方增益"
},
"icon": "wp_icon_10021",
"des": {
"key": "IntegralBoss_Integralbuff_des_09",
"text": "敌方全体速度+4"
}
},
{
"skillid": 310001010,
"type": 2,
"val": 1,
"show": 3,
"incompatibility": [
310001001
],
"name": {
"key": "IntegralBoss_Integralbuff_name_10",
"text": "敌方增益"
},
"icon": "wp_icon_10021",
"des": {
"key": "IntegralBoss_Integralbuff_des_10",
"text": "我方守护者受到的治疗效果降低10%"
}
},
{
"skillid": 310001011,
"type": 2,
"val": 2,
"show": 3,
"incompatibility": [
310001001
],
"name": {
"key": "IntegralBoss_Integralbuff_name_11",
"text": "敌方增益"
},
"icon": "wp_icon_10021",
"des": {
"key": "IntegralBoss_Integralbuff_des_11",
"text": "我方守护者受到的治疗效果降低20%"
}
},
{
"skillid": 310001012,
"type": 2,
"val": 3,
"show": 3,
"incompatibility": [
310001001
],
"name": {
"key": "IntegralBoss_Integralbuff_name_12",
"text": "敌方增益"
},
"icon": "wp_icon_10021",
"des": {
"key": "IntegralBoss_Integralbuff_des_12",
"text": "我方守护者受到的治疗效果降低30%"
}
},
{
"skillid": 310001013,
"type": 2,
"val": 1,
"show": 4,
"incompatibility": [
310001001
],
"name": {
"key": "IntegralBoss_Integralbuff_name_13",
"text": "敌方增益"
},
"icon": "wp_icon_10021",
"des": {
"key": "IntegralBoss_Integralbuff_des_13",
"text": "战斗开始后我方随机2名守护者获得2回合的流血"
}
},
{
"skillid": 310001014,
"type": 2,
"val": 1,
"show": 5,
"incompatibility": [
310001001
],
"name": {
"key": "IntegralBoss_Integralbuff_name_14",
"text": "敌方增益"
},
"icon": "wp_icon_10021",
"des": {
"key": "IntegralBoss_Integralbuff_des_14",
"text": "敌方造成的流血和眩晕将额外增加1回合持续时间"
}
},
{
"skillid": 310001015,
"type": 2,
"val": 2,
"show": 5,
"incompatibility": [
310001001
],
"name": {
"key": "IntegralBoss_Integralbuff_name_15",
"text": "敌方增益"
},
"icon": "wp_icon_10021",
"des": {
"key": "IntegralBoss_Integralbuff_des_15",
"text": "敌方攻击眩晕状态的敌人时无视受击者15%防御"
}
},
{
"skillid": 310001016,
"type": 2,
"val": 3,
"show": 5,
"incompatibility": [
310001001
],
"name": {
"key": "IntegralBoss_Integralbuff_name_16",
"text": "敌方增益"
},
"icon": "wp_icon_10021",
"des": {
"key": "IntegralBoss_Integralbuff_des_16",
"text": "敌方攻击处于流血状态的敌人时额外增加40%暴击伤害"
}
},
{
"skillid": 310001017,
"type": 2,
"val": 1,
"show": 6,
"incompatibility": [
310001001
],
"name": {
"key": "IntegralBoss_Integralbuff_name_17",
"text": "敌方增益"
},
"icon": "wp_icon_10021",
"des": {
"key": "IntegralBoss_Integralbuff_des_17",
"text": "每3回合驱散敌方全部减益1次"
}
},
{
"skillid": 310001018,
"type": 2,
"val": 2,
"show": 6,
"incompatibility": [
310001001
],
"name": {
"key": "IntegralBoss_Integralbuff_name_18",
"text": "敌方增益"
},
"icon": "wp_icon_10021",
"des": {
"key": "IntegralBoss_Integralbuff_des_18",
"text": "除BOSS外所有友方技能最大冷却时间增加1回合"
}
},
{
"skillid": 310001019,
"type": 2,
"val": 3,
"show": 6,
"incompatibility": [
310001001
],
"name": {
"key": "IntegralBoss_Integralbuff_name_19",
"text": "敌方增益"
},
"icon": "wp_icon_10021",
"des": {
"key": "IntegralBoss_Integralbuff_des_19",
"text": "每3回合驱散我方守护者全部增益1次"
}
},
{
"skillid": 310001020,
"type": 2,
"val": 1,
"show": 7,
"incompatibility": [
310001001
],
"name": {
"key": "IntegralBoss_Integralbuff_name_20",
"text": "敌方增益"
},
"icon": "wp_icon_10021",
"des": {
"key": "IntegralBoss_Integralbuff_des_20",
"text": "战斗开始后我方全体各自失去20%生命"
}
},
{
"skillid": 310001021,
"type": 2,
"val": 1,
"show": 8,
"incompatibility": [
310001001
],
"name": {
"key": "IntegralBoss_Integralbuff_name_21",
"text": "敌方增益"
},
"icon": "wp_icon_10021",
"des": {
"key": "IntegralBoss_Integralbuff_des_21",
"text": "敌方会心提升20%"
}
},
{
"skillid": 310001022,
"type": 2,
"val": 2,
"show": 8,
"incompatibility": [
310001001
],
"name": {
"key": "IntegralBoss_Integralbuff_name_22",
"text": "敌方增益"
},
"icon": "wp_icon_10021",
"des": {
"key": "IntegralBoss_Integralbuff_des_22",
"text": "敌方全体免疫控制效果(小怪生效)"
}
}
]

View File

@ -338,7 +338,7 @@ type (
CreateStoneBattle(session IUserSession, stoneBattle *pb.StroneBattleReq) (errdata *pb.ErrorData, record *pb.DBBattleRecord)
// 可以携带debuff 的战斗
CreateDebuffBattle(session IUserSession, req *pb.BattlePVEReq, dibuff []int32) (errdata *pb.ErrorData, record *pb.DBBattleRecord)
CreateDebuffBattle(session IUserSession, req *pb.BattlePVEReq, webuff []int32, dibuff []int32) (errdata *pb.ErrorData, record *pb.DBBattleRecord)
// 跑服务端战斗
RunServerBattle(session IUserSession, req *pb.BattleRunReq) (errdata *pb.ErrorData, record *pb.BattleRunResp)

View File

@ -1206,7 +1206,7 @@ func (this *modelBattleComp) creatStoneBattle(session comm.IUserSession, stoneBa
}
// 创建pve 战斗记录
func (this *modelBattleComp) createAddDebuffPve(session comm.IUserSession, stag string, conn *db.DBConn, btype pb.BattleType, req *pb.BattlePVEReq, conf *cfg.GameBattleReadyData, dibuff []int32) (record *pb.DBBattleRecord, errdata *pb.ErrorData) {
func (this *modelBattleComp) createAddDebuffPve(session comm.IUserSession, stag string, conn *db.DBConn, btype pb.BattleType, req *pb.BattlePVEReq, conf *cfg.GameBattleReadyData, webuff []int32, dibuff []int32) (record *pb.DBBattleRecord, errdata *pb.ErrorData) {
var (
heros []*pb.DBHero = make([]*pb.DBHero, 5)
captain int32
@ -1257,6 +1257,15 @@ func (this *modelBattleComp) createAddDebuffPve(session comm.IUserSession, stag
} else {
record.Redflist[0].Team[i] = nil
}
sz := make([]*pb.DySkillData, 0)
for _, key := range webuff {
sz = append(sz, &pb.DySkillData{
SkillID: key,
SkillLv: 1, //不纠结 积分boss debuff技能等级只能是1级
Param: 0,
})
}
record.Redflist[0].Team[i].BattleBeforeSkill = append(record.Redflist[0].Team[i].BattleBeforeSkill, sz...)
}
//好友的英雄阵营
for i, v := range req.Format.Friendformat {
@ -1294,6 +1303,7 @@ func (this *modelBattleComp) createAddDebuffPve(session comm.IUserSession, stag
}
}
// 我方buff 带入
if conf.DefaultHero != 0 {
if captain, masters, errdata = this.createMasterRoles(1100, 0, conf.DefaultHero); errdata != nil {
@ -1324,7 +1334,7 @@ func (this *modelBattleComp) createAddDebuffPve(session comm.IUserSession, stag
Param: 0,
})
}
v1.BattleBeforeSkill = append(v1.BattleBeforeSkill)
v1.BattleBeforeSkill = append(v1.BattleBeforeSkill, sz...)
}
}
record.Buleflist[i] = &pb.DBBattleFormt{

View File

@ -619,7 +619,7 @@ func (this *Battle) CreateStoneBattle(session comm.IUserSession, stoneBattle *pb
}
// 创建pve战斗
func (this *Battle) CreateDebuffBattle(session comm.IUserSession, req *pb.BattlePVEReq, dibuff []int32) (errdata *pb.ErrorData, record *pb.DBBattleRecord) {
func (this *Battle) CreateDebuffBattle(session comm.IUserSession, req *pb.BattlePVEReq, webuff []int32, dibuff []int32) (errdata *pb.ErrorData, record *pb.DBBattleRecord) {
var (
conf *cfg.GameBattleReadyData
conn *db.DBConn
@ -674,7 +674,7 @@ func (this *Battle) CreateDebuffBattle(session comm.IUserSession, req *pb.Battle
}
}
if record, errdata = this.modelBattle.createAddDebuffPve(session, stag, conn, pb.BattleType_pve, req, conf, dibuff); errdata != nil {
if record, errdata = this.modelBattle.createAddDebuffPve(session, stag, conn, pb.BattleType_pve, req, conf, webuff, dibuff); errdata != nil {
return
}
if flag {

View File

@ -20,7 +20,8 @@ func (this *apiComp) ChallengeCheck(session comm.IUserSession, req *pb.IntegralC
// /挑战主线关卡
func (this *apiComp) Challenge(session comm.IUserSession, req *pb.IntegralChallengeReq) (errdata *pb.ErrorData) {
var (
dibuff []int32
dibuff []int32 // 敌方buff
webuff []int32 // 我方buff
)
errdata = this.ChallengeCheck(session, req)
if errdata != nil {
@ -52,23 +53,33 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.IntegralChalle
}
return
}
if list.Itype == 2 { // 事件模式
var condiIds []int32
if confList := this.configure.GetIntegralCondition(); len(confList) > 0 {
for _, v := range confList {
condiIds = append(condiIds, v.Id)
}
}
// TODU 稍后处理任务校验
// if list.Itype == 2 { // 事件模式
// var condiIds []int32
// if confList := this.configure.GetIntegralCondition(); len(confList) > 0 {
// for _, v := range confList {
// condiIds = append(condiIds, v.Id)
// }
// }
if _, progress, err := this.module.ModuleBuried.CheckCondition(session, condiIds...); err == nil {
condiIds = []int32{}
for _, v := range progress { // 没有完成的
if v.State == pb.BuriedItemFinishState_buried_finish {
condiIds = append(condiIds, v.Conid)
}
// if _, progress, err := this.module.ModuleBuried.CheckCondition(session, condiIds...); err == nil {
// condiIds = []int32{}
// for _, v := range progress { // 没有完成的
// if v.State == pb.BuriedItemFinishState_buried_finish {
// condiIds = append(condiIds, v.Conid)
// }
// }
// }
// dibuff = this.module.configure.GetIntegralConditionByKeys(condiIds)
// }
for _, v := range req.Buff {
if c, err := this.module.configure.GetIntegralBuffByKey(v); err != nil {
if c.Type == 1 {
webuff = append(webuff, v)
} else if c.Type == 2 {
dibuff = append(dibuff, v)
}
}
dibuff = this.module.configure.GetIntegralConditionByKeys(condiIds)
}
errdata, record := this.module.battle.CreateDebuffBattle(session, &pb.BattlePVEReq{
Rulesid: cfgData.BattleReadyID,
@ -76,7 +87,7 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.IntegralChalle
Title: "",
Format: req.Battle,
Mformat: cfgData.Boss,
}, dibuff)
}, webuff, dibuff)
if errdata != nil {
return

View File

@ -16,6 +16,7 @@ const (
game_integralcondition = "game_integralcondition.json"
game_integralreward = "game_integralreward.json"
game_integraltime = "game_integraltime.json"
game_integralbuff = "game_integralbuff.json"
)
///配置管理基础组件
@ -35,6 +36,7 @@ func (this *configureComp) Init(service core.IService, module core.IModule, comp
err = this.LoadMultiConfigure(map[string]interface{}{
game_integraltime: cfg.NewGameIntegralTime,
game_integralcondition: cfg.NewGameIntegralCondition,
game_integralbuff: cfg.NewGameIntegralBuff,
})
configure.RegisterConfigure(game_integralboss, cfg.NewGameIntegralBoss, this.LoadStageBoss)
configure.RegisterConfigure(game_integralreward, cfg.NewGameIntegralReward, this.LoadIntegralReward)
@ -200,3 +202,18 @@ func (this *configureComp) GetIntegralConditionByTask(taskid int32) (result *cfg
}
return
}
func (this *configureComp) GetIntegralBuffByKey(skillId int32) (result *cfg.GameIntegralBuffData, err error) {
var (
v interface{}
)
if v, err = this.GetConfigure(game_integralbuff); err == nil {
if configure, ok := v.(*cfg.GameIntegralBuff); ok {
if result = configure.Get(skillId); result != nil {
return
}
}
}
err = comm.NewNotFoundConfErr(string(this.module.GetType()), game_integralbuff, skillId)
return
}

View File

@ -0,0 +1,42 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
package cfg
type GameIntegralBuff struct {
_dataMap map[int32]*GameIntegralBuffData
_dataList []*GameIntegralBuffData
}
func NewGameIntegralBuff(_buf []map[string]interface{}) (*GameIntegralBuff, error) {
_dataList := make([]*GameIntegralBuffData, 0, len(_buf))
dataMap := make(map[int32]*GameIntegralBuffData)
for _, _ele_ := range _buf {
if _v, err2 := DeserializeGameIntegralBuffData(_ele_); err2 != nil {
return nil, err2
} else {
_dataList = append(_dataList, _v)
dataMap[_v.Skillid] = _v
}
}
return &GameIntegralBuff{_dataList:_dataList, _dataMap:dataMap}, nil
}
func (table *GameIntegralBuff) GetDataMap() map[int32]*GameIntegralBuffData {
return table._dataMap
}
func (table *GameIntegralBuff) GetDataList() []*GameIntegralBuffData {
return table._dataList
}
func (table *GameIntegralBuff) Get(key int32) *GameIntegralBuffData {
return table._dataMap[key]
}

View File

@ -0,0 +1,62 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
package cfg
import "errors"
type GameIntegralBuffData struct {
Skillid int32
Type int32
Val int32
Show int32
Incompatibility []int32
Name string
Icon string
Des string
}
const TypeId_GameIntegralBuffData = 1837461221
func (*GameIntegralBuffData) GetTypeId() int32 {
return 1837461221
}
func (_v *GameIntegralBuffData)Deserialize(_buf map[string]interface{}) (err error) {
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["skillid"].(float64); !_ok_ { err = errors.New("skillid error"); return }; _v.Skillid = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["type"].(float64); !_ok_ { err = errors.New("type error"); return }; _v.Type = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["val"].(float64); !_ok_ { err = errors.New("val error"); return }; _v.Val = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["show"].(float64); !_ok_ { err = errors.New("show error"); return }; _v.Show = int32(_tempNum_) }
{
var _arr_ []interface{}
var _ok_ bool
if _arr_, _ok_ = _buf["incompatibility"].([]interface{}); !_ok_ { err = errors.New("incompatibility error"); return }
_v.Incompatibility = make([]int32, 0, len(_arr_))
for _, _e_ := range _arr_ {
var _list_v_ int32
{ var _ok_ bool; var _x_ float64; if _x_, _ok_ = _e_.(float64); !_ok_ { err = errors.New("_list_v_ error"); return }; _list_v_ = int32(_x_) }
_v.Incompatibility = append(_v.Incompatibility, _list_v_)
}
}
{var _ok_ bool; var __json_text__ map[string]interface{}; if __json_text__, _ok_ = _buf["name"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.Name error"); return }; { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.Name, _ok_ = __json_text__["text"].(string); !_ok_ { err = errors.New("text error"); return } } }
{ var _ok_ bool; if _v.Icon, _ok_ = _buf["icon"].(string); !_ok_ { err = errors.New("icon error"); return } }
{var _ok_ bool; var __json_text__ map[string]interface{}; if __json_text__, _ok_ = _buf["des"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.Des error"); return }; { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.Des, _ok_ = __json_text__["text"].(string); !_ok_ { err = errors.New("text error"); return } } }
return
}
func DeserializeGameIntegralBuffData(_buf map[string]interface{}) (*GameIntegralBuffData, error) {
v := &GameIntegralBuffData{}
if err := v.Deserialize(_buf); err == nil {
return v, nil
} else {
return nil, err
}
}

View File

@ -331,6 +331,7 @@ type Tables struct {
IntegralBoss *GameIntegralBoss
IntegralReward *GameIntegralReward
IntegralCondition *GameIntegralCondition
IntegralBuff *GameIntegralBuff
IntegralTime *GameIntegralTime
Restore *GameRestore
CatchbugSetstage *GameCatchbugSetstage
@ -2278,6 +2279,12 @@ func NewTables(loader JsonLoader) (*Tables, error) {
if tables.IntegralCondition, err = NewGameIntegralCondition(buf) ; err != nil {
return nil, err
}
if buf, err = loader("game_integralbuff") ; err != nil {
return nil, err
}
if tables.IntegralBuff, err = NewGameIntegralBuff(buf) ; err != nil {
return nil, err
}
if buf, err = loader("game_integraltime") ; err != nil {
return nil, err
}