体力扣除

This commit is contained in:
meixiongfeng 2022-12-30 18:24:23 +08:00
parent 17da4862cf
commit a9964388cf
8 changed files with 2522 additions and 396 deletions

File diff suppressed because it is too large Load Diff

View File

@ -5,7 +5,7 @@
"key": "mainline_name_10001", "key": "mainline_name_10001",
"text": "Chapter 1" "text": "Chapter 1"
}, },
"Intensity": 1, "intensity": 1,
"map": "zx_ddt_zj01", "map": "zx_ddt_zj01",
"title": { "title": {
"key": "mainline_title_10001", "key": "mainline_title_10001",
@ -39,22 +39,22 @@
}, },
{ {
"a": "equi", "a": "equi",
"t": "10021", "t": "10110",
"n": 1 "n": 1
}, },
{ {
"a": "equi", "a": "equi",
"t": "10022", "t": "10111",
"n": 1 "n": 1
}, },
{ {
"a": "equi", "a": "equi",
"t": "10023", "t": "10112",
"n": 1 "n": 1
}, },
{ {
"a": "equi", "a": "equi",
"t": "10024", "t": "10113",
"n": 1 "n": 1
} }
] ]
@ -65,7 +65,7 @@
"key": "mainline_name_10002", "key": "mainline_name_10002",
"text": "Chapter 2" "text": "Chapter 2"
}, },
"Intensity": 1, "intensity": 1,
"map": "zx_ddt_zj02", "map": "zx_ddt_zj02",
"title": { "title": {
"key": "mainline_title_10002", "key": "mainline_title_10002",
@ -115,7 +115,7 @@
"key": "mainline_name_10003", "key": "mainline_name_10003",
"text": "Chapter 3" "text": "Chapter 3"
}, },
"Intensity": 1, "intensity": 1,
"map": "zx_ddt_zj03", "map": "zx_ddt_zj03",
"title": { "title": {
"key": "mainline_title_10003", "key": "mainline_title_10003",
@ -149,22 +149,22 @@
}, },
{ {
"a": "equi", "a": "equi",
"t": "10051", "t": "10110",
"n": 1 "n": 1
}, },
{ {
"a": "equi", "a": "equi",
"t": "10052", "t": "10111",
"n": 1 "n": 1
}, },
{ {
"a": "equi", "a": "equi",
"t": "10053", "t": "10112",
"n": 1 "n": 1
}, },
{ {
"a": "equi", "a": "equi",
"t": "10054", "t": "10113",
"n": 1 "n": 1
} }
] ]
@ -175,7 +175,7 @@
"key": "mainline_name_10004", "key": "mainline_name_10004",
"text": "Chapter 4" "text": "Chapter 4"
}, },
"Intensity": 1, "intensity": 1,
"map": "zx_ddt_zj04", "map": "zx_ddt_zj04",
"title": { "title": {
"key": "mainline_title_10004", "key": "mainline_title_10004",
@ -220,7 +220,7 @@
"key": "mainline_name_10005", "key": "mainline_name_10005",
"text": "Chapter 5" "text": "Chapter 5"
}, },
"Intensity": 1, "intensity": 1,
"map": "zx_ddt_zj01", "map": "zx_ddt_zj01",
"title": { "title": {
"key": "mainline_title_10005", "key": "mainline_title_10005",
@ -265,7 +265,7 @@
"key": "mainline_name_10006", "key": "mainline_name_10006",
"text": "Chapter 6" "text": "Chapter 6"
}, },
"Intensity": 1, "intensity": 1,
"map": "zx_ddt_zj02", "map": "zx_ddt_zj02",
"title": { "title": {
"key": "mainline_title_10006", "key": "mainline_title_10006",
@ -310,7 +310,7 @@
"key": "mainline_name_10007", "key": "mainline_name_10007",
"text": "Chapter 7" "text": "Chapter 7"
}, },
"Intensity": 1, "intensity": 1,
"map": "zx_ddt_zj03", "map": "zx_ddt_zj03",
"title": { "title": {
"key": "mainline_title_10007", "key": "mainline_title_10007",
@ -355,7 +355,7 @@
"key": "mainline_name_10008", "key": "mainline_name_10008",
"text": "Chapter 8" "text": "Chapter 8"
}, },
"Intensity": 1, "intensity": 1,
"map": "zx_ddt_zj04", "map": "zx_ddt_zj04",
"title": { "title": {
"key": "mainline_title_10008", "key": "mainline_title_10008",
@ -400,7 +400,7 @@
"key": "mainline_name_10009", "key": "mainline_name_10009",
"text": "Chapter 9" "text": "Chapter 9"
}, },
"Intensity": 1, "intensity": 1,
"map": "zx_ddt_zj01", "map": "zx_ddt_zj01",
"title": { "title": {
"key": "mainline_title_10009", "key": "mainline_title_10009",
@ -445,7 +445,7 @@
"key": "mainline_name_10010", "key": "mainline_name_10010",
"text": "Chapter 10" "text": "Chapter 10"
}, },
"Intensity": 1, "intensity": 1,
"map": "zx_ddt_zj02", "map": "zx_ddt_zj02",
"title": { "title": {
"key": "mainline_title_10010", "key": "mainline_title_10010",
@ -490,7 +490,7 @@
"key": "mainline_name_10011", "key": "mainline_name_10011",
"text": "Chapter 11" "text": "Chapter 11"
}, },
"Intensity": 1, "intensity": 1,
"map": "zx_ddt_zj01", "map": "zx_ddt_zj01",
"title": { "title": {
"key": "mainline_title_10011", "key": "mainline_title_10011",
@ -535,7 +535,7 @@
"key": "mainline_name_10012", "key": "mainline_name_10012",
"text": "Chapter 12" "text": "Chapter 12"
}, },
"Intensity": 1, "intensity": 1,
"map": "zx_ddt_zj02", "map": "zx_ddt_zj02",
"title": { "title": {
"key": "mainline_title_10012", "key": "mainline_title_10012",

View File

@ -48,7 +48,10 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.MainlineChalle
break break
} }
} }
// 消耗
if code = this.module.CheckRes(session, node.PsConsume); code != pb.ErrorCode_Success {
return
}
code, record := this.module.battle.CreatePveBattle(session, &pb.BattlePVEReq{ code, record := this.module.battle.CreatePveBattle(session, &pb.BattlePVEReq{
Ptype: pb.PlayType_mainline, Ptype: pb.PlayType_mainline,
Title: "", Title: "",

View File

@ -48,6 +48,10 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.MainlineCh
code = pb.ErrorCode_MainlineNotFindChapter code = pb.ErrorCode_MainlineNotFindChapter
return return
} }
// 消耗
if code = this.module.ConsumeRes(session, node.PsConsume, true); code != pb.ErrorCode_Success {
return
}
// 校验通过 // 校验通过
code, isWin = this.module.battle.CheckBattleReport(session, req.Report) code, isWin = this.module.battle.CheckBattleReport(session, req.Report)
if code != pb.ErrorCode_Success { if code != pb.ErrorCode_Success {

View File

@ -76,9 +76,7 @@ func (this *configureComp) GetMainlineChapter(id int32) (data *cfg.GameMainlineC
return return
} }
if data, ok = configure.GetDataMap()[id]; ok { data = configure.Get(int(id - 1))
return
}
} }
return return
} }

View File

@ -19,6 +19,7 @@ type GameMainlineData struct {
Order int32 Order int32
Chapter int32 Chapter int32
Episodetype int32 Episodetype int32
MainlineName string
Episodelocation serialization.Vector2 Episodelocation serialization.Vector2
FormatList []int32 FormatList []int32
CaptainId string CaptainId string
@ -29,6 +30,7 @@ type GameMainlineData struct {
Desc string Desc string
Stroyid []int32 Stroyid []int32
Condition []int32 Condition []int32
PsConsume []*Gameatn
} }
const TypeId_GameMainlineData = -79093005 const TypeId_GameMainlineData = -79093005
@ -45,6 +47,7 @@ func (_v *GameMainlineData)Deserialize(_buf map[string]interface{}) (err error)
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["order"].(float64); !_ok_ { err = errors.New("order error"); return }; _v.Order = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["order"].(float64); !_ok_ { err = errors.New("order error"); return }; _v.Order = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["chapter"].(float64); !_ok_ { err = errors.New("chapter error"); return }; _v.Chapter = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["chapter"].(float64); !_ok_ { err = errors.New("chapter error"); return }; _v.Chapter = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["Episodetype"].(float64); !_ok_ { err = errors.New("Episodetype error"); return }; _v.Episodetype = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["Episodetype"].(float64); !_ok_ { err = errors.New("Episodetype error"); return }; _v.Episodetype = int32(_tempNum_) }
{var _ok_ bool; var __json_text__ map[string]interface{}; if __json_text__, _ok_ = _buf["mainlineName"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.MainlineName error"); return }; { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.MainlineName, _ok_ = __json_text__["text"].(string); !_ok_ { err = errors.New("text error"); return } } }
{ var _ok_ bool; var _v_ map[string]interface{}; if _v_, _ok_ = _buf["Episodelocation"].(map[string]interface{}); !_ok_ { err = errors.New("Episodelocation error"); return } { var _ok_ bool; var _v_ map[string]interface{}; if _v_, _ok_ = _buf["Episodelocation"].(map[string]interface{}); !_ok_ { err = errors.New("Episodelocation error"); return }
var _x_, _y_ float32; var _x_, _y_ float32;
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _v_["x"].(float64); !_ok_ { err = errors.New("x error"); return }; _x_ = float32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _v_["x"].(float64); !_ok_ { err = errors.New("x error"); return }; _x_ = float32(_tempNum_) }
@ -113,6 +116,20 @@ func (_v *GameMainlineData)Deserialize(_buf map[string]interface{}) (err error)
} }
} }
{
var _arr_ []interface{}
var _ok_ bool
if _arr_, _ok_ = _buf["ps_consume"].([]interface{}); !_ok_ { err = errors.New("ps_consume error"); return }
_v.PsConsume = make([]*Gameatn, 0, len(_arr_))
for _, _e_ := range _arr_ {
var _list_v_ *Gameatn
{ var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _e_.(map[string]interface{}); !_ok_ { err = errors.New("_list_v_ error"); return }; if _list_v_, err = DeserializeGameatn(_x_); err != nil { return } }
_v.PsConsume = append(_v.PsConsume, _list_v_)
}
}
return return
} }

View File

@ -9,34 +9,26 @@
package cfg package cfg
type GameMainlineChapter struct { type GameMainlineChapter struct {
_dataMap map[int32]*GameMainlineChapterData
_dataList []*GameMainlineChapterData _dataList []*GameMainlineChapterData
} }
func NewGameMainlineChapter(_buf []map[string]interface{}) (*GameMainlineChapter, error) { func NewGameMainlineChapter(_buf []map[string]interface{}) (*GameMainlineChapter, error) {
_dataList := make([]*GameMainlineChapterData, 0, len(_buf)) _dataList := make([]*GameMainlineChapterData, 0, len(_buf))
dataMap := make(map[int32]*GameMainlineChapterData)
for _, _ele_ := range _buf { for _, _ele_ := range _buf {
if _v, err2 := DeserializeGameMainlineChapterData(_ele_); err2 != nil { if _v, err2 := DeserializeGameMainlineChapterData(_ele_); err2 != nil {
return nil, err2 return nil, err2
} else { } else {
_dataList = append(_dataList, _v) _dataList = append(_dataList, _v)
dataMap[_v.Id] = _v
} }
} }
return &GameMainlineChapter{_dataList:_dataList, _dataMap:dataMap}, nil return &GameMainlineChapter{_dataList:_dataList}, nil
}
func (table *GameMainlineChapter) GetDataMap() map[int32]*GameMainlineChapterData {
return table._dataMap
} }
func (table *GameMainlineChapter) GetDataList() []*GameMainlineChapterData { func (table *GameMainlineChapter) GetDataList() []*GameMainlineChapterData {
return table._dataList return table._dataList
} }
func (table *GameMainlineChapter) Get(key int32) *GameMainlineChapterData { func (table *GameMainlineChapter) Get(index int) *GameMainlineChapterData {
return table._dataMap[key] return table._dataList[index]
} }

View File

@ -32,7 +32,7 @@ func (*GameMainlineChapterData) GetTypeId() int32 {
func (_v *GameMainlineChapterData)Deserialize(_buf map[string]interface{}) (err error) { func (_v *GameMainlineChapterData)Deserialize(_buf map[string]interface{}) (err error) {
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["id"].(float64); !_ok_ { err = errors.New("id error"); return }; _v.Id = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["id"].(float64); !_ok_ { err = errors.New("id error"); return }; _v.Id = int32(_tempNum_) }
{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; 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; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["Intensity"].(float64); !_ok_ { err = errors.New("Intensity error"); return }; _v.Intensity = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["intensity"].(float64); !_ok_ { err = errors.New("intensity error"); return }; _v.Intensity = int32(_tempNum_) }
{ var _ok_ bool; if _v.Map, _ok_ = _buf["map"].(string); !_ok_ { err = errors.New("map error"); return } } { var _ok_ bool; if _v.Map, _ok_ = _buf["map"].(string); !_ok_ { err = errors.New("map error"); return } }
{var _ok_ bool; var __json_text__ map[string]interface{}; if __json_text__, _ok_ = _buf["title"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.Title error"); return }; { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.Title, _ok_ = __json_text__["text"].(string); !_ok_ { err = errors.New("text error"); return } } } {var _ok_ bool; var __json_text__ map[string]interface{}; if __json_text__, _ok_ = _buf["title"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.Title error"); return }; { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.Title, _ok_ = __json_text__["text"].(string); !_ok_ { err = errors.New("text error"); return } } }
{var _ok_ bool; var __json_text__ map[string]interface{}; if __json_text__, _ok_ = _buf["desc"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.Desc error"); return }; { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.Desc, _ok_ = __json_text__["text"].(string); !_ok_ { err = errors.New("text error"); return } } } {var _ok_ bool; var __json_text__ map[string]interface{}; if __json_text__, _ok_ = _buf["desc"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.Desc error"); return }; { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.Desc, _ok_ = __json_text__["text"].(string); !_ok_ { err = errors.New("text error"); return } } }