diff --git a/bin/json/game_stoneevent.json b/bin/json/game_stoneevent.json index 064342a00..1d0746f12 100644 --- a/bin/json/game_stoneevent.json +++ b/bin/json/game_stoneevent.json @@ -6,7 +6,7 @@ "text": "捡垃圾" }, "EventType": 16, - "EventResource": "Treasure", + "EventResource": "event_rewardbox_1", "Value1": 21160001, "Value2": 0, "Value3": 0, @@ -118,7 +118,7 @@ "text": "首领" }, "EventType": 28, - "EventResource": "", + "EventResource": "event_boss_1", "Value1": 110501, "Value2": 0, "Value3": 0, diff --git a/bin/json/game_stoneroom.json b/bin/json/game_stoneroom.json index c4ce7a195..6ee8fcab5 100644 --- a/bin/json/game_stoneroom.json +++ b/bin/json/game_stoneroom.json @@ -6,14 +6,16 @@ "text": "战斗" }, "SceneName": "scenesfight_secret_realm_01", - "PortalName": "", + "PortalName": "portal_1", "EventrewardGroup": 16010101, "EventBattleGroup": 14110100, "EventStoryNpcGroup": 0, "EventTreasureGroup": 0, "EventStoreGroup": 0, "BossEvent": 0, - "Condition": 14110100 + "Condition": [ + 14 + ] }, { "RoomId": 10110102, @@ -22,14 +24,16 @@ "text": "战斗" }, "SceneName": "scenesfight_secret_realm_02", - "PortalName": "", + "PortalName": "portal_1", "EventrewardGroup": 16010101, "EventBattleGroup": 14110100, "EventStoryNpcGroup": 0, "EventTreasureGroup": 0, "EventStoreGroup": 0, "BossEvent": 0, - "Condition": 14110100 + "Condition": [ + 14 + ] }, { "RoomId": 10110103, @@ -38,14 +42,16 @@ "text": "战斗" }, "SceneName": "scenesfight_secret_realm_03", - "PortalName": "", + "PortalName": "portal_1", "EventrewardGroup": 16010101, "EventBattleGroup": 14110100, "EventStoryNpcGroup": 0, "EventTreasureGroup": 0, "EventStoreGroup": 0, "BossEvent": 0, - "Condition": 14110100 + "Condition": [ + 14 + ] }, { "RoomId": 10110104, @@ -54,14 +60,16 @@ "text": "战斗" }, "SceneName": "scenesfight_secret_realm_01", - "PortalName": "", + "PortalName": "portal_1", "EventrewardGroup": 16010101, "EventBattleGroup": 14110100, "EventStoryNpcGroup": 0, "EventTreasureGroup": 0, "EventStoreGroup": 0, "BossEvent": 0, - "Condition": 14110100 + "Condition": [ + 14 + ] }, { "RoomId": 14110501, @@ -70,14 +78,16 @@ "text": "首领" }, "SceneName": "scenesfight_secret_realm_04", - "PortalName": "", + "PortalName": "portal_1", "EventrewardGroup": 16010101, "EventBattleGroup": 0, "EventStoryNpcGroup": 0, "EventTreasureGroup": 0, "EventStoreGroup": 0, - "BossEvent": 28110500, - "Condition": 28110500 + "BossEvent": 28110501, + "Condition": [ + 28 + ] }, { "RoomId": 14110502, @@ -86,14 +96,16 @@ "text": "首领" }, "SceneName": "scenesfight_secret_realm_04", - "PortalName": "", + "PortalName": "portal_1", "EventrewardGroup": 16010101, "EventBattleGroup": 0, "EventStoryNpcGroup": 0, "EventTreasureGroup": 0, "EventStoreGroup": 0, - "BossEvent": 28110500, - "Condition": 28110500 + "BossEvent": 28110501, + "Condition": [ + 28 + ] }, { "RoomId": 14110503, @@ -102,14 +114,16 @@ "text": "首领" }, "SceneName": "scenesfight_secret_realm_04", - "PortalName": "", + "PortalName": "portal_1", "EventrewardGroup": 16010101, "EventBattleGroup": 0, "EventStoryNpcGroup": 0, "EventTreasureGroup": 0, "EventStoreGroup": 0, - "BossEvent": 28110500, - "Condition": 28110500 + "BossEvent": 28110501, + "Condition": [ + 28 + ] }, { "RoomId": 99999, @@ -125,6 +139,6 @@ "EventTreasureGroup": 0, "EventStoreGroup": 0, "BossEvent": 0, - "Condition": 0 + "Condition": [] } ] \ No newline at end of file diff --git a/modules/stonehenge/configure.go b/modules/stonehenge/configure.go index cf1690d86..d41536858 100644 --- a/modules/stonehenge/configure.go +++ b/modules/stonehenge/configure.go @@ -19,6 +19,7 @@ const ( game_stageconf = "game_stonestage.json" game_buffconf = "game_stonebuff.json" game_eventconf = "game_stoneevent.json" + game_bossconf = "game_stoneboss.json" ) ///背包配置管理组件 @@ -80,20 +81,11 @@ func (this *configureComp) Init(service core.IService, module core.IModule, comp err = this.LoadConfigure(game_buffconf, cfg.NewGameStoneBuff) err = this.LoadConfigure(game_eventconf, cfg.NewGameStoneEvent) err = this.LoadConfigure(game_roomconf, cfg.NewGameStoneRoom) + err = this.LoadConfigure(game_bossconf, cfg.NewGameStoneBoss) configure.RegisterConfigure(game_stageconf, cfg.NewGameStoneStage, this.LoadGameStoneStage) configure.RegisterConfigure(game_buffconf, cfg.NewGameStoneBuff, this.LoadGameStoneBuff) - // sz := make(map[int32]struct{}) - // sz[125004312] = struct{}{} - // sz[135006211] = struct{}{} - // sz[135006212] = struct{}{} - // sz[135006312] = struct{}{} - // sz[144004311] = struct{}{} - // sz[144004312] = struct{}{} - // sz[124006311] = struct{}{} - // this.GetBuffGroupDataByLottery(100001, 1, sz) - this.CheckStage() return } @@ -492,7 +484,9 @@ func (this *configureComp) GetBuffGroupDataByLottery(lotteryId int32, addType in curWt int32 // 是否增加权重 sz []*cfg.GameBufflotteryData ) - + if ownerbuff == nil { + ownerbuff = make(map[int32]struct{}, 0) + } if v, ok := this.buffLottery[lotteryId]; ok { for i := 1; ; i++ { for k, v1 := range v { // k buffID v1 cfg.GameBufflotteryData @@ -618,7 +612,7 @@ func (this *configureComp) GetGameStoneBuff(addType int32) (m map[int32]struct{} return this.buff[addType] } -func (this *configureComp) CheckStage() { +func (this *configureComp) CheckStage() (friend []int32, enemy []int32) { var ( boosEvent map[int32]int32 // key stageid value rommid ) @@ -628,21 +622,26 @@ func (this *configureComp) CheckStage() { // 根据传送门组生成传送门 if rooms := this.GetRoomGroupDataByLottery(c.PortalGroup); len(rooms) > 0 { boosEvent[k] = rooms[0] + if roomconf, err := this.GetStoneRoomDataById(rooms[0]); err == nil { + // buff 组 roomconf.BossEvent + this.GetEventGroupDataByLottery(roomconf.BossEvent) + // 生成 我方buff + if bossConf := this.GetBossConfById(roomconf.BossEvent); bossConf != nil { + friend = this.GetBuffGroupDataByLottery(bossConf.FriendlyBuffGroup, 0, nil) + enemy = this.GetBuffGroupDataByLottery(bossConf.EnemyBuffGroup, 0, nil) + } + } } } } - // if v, err := this.GetConfigure(game_stageconf); err == nil { - // if configure, ok := v.(*cfg.GameStoneStage); ok { - // this.hlock.Lock() - // defer this.hlock.Unlock() - // this.stage = make(map[int64]*cfg.GameStoneStageData, 0) - // for _, v := range configure.GetDataList() { - // key := int64(v.StageId)<<16 + int64(v.RoomId) - // this.stage[key] = v - // } - // } - // } - + return +} +func (this *configureComp) GetBossConfById(id int32) (data *cfg.GameStoneBossData) { + if v, err := this.GetConfigure(game_bossconf); err == nil { + if configure, ok := v.(*cfg.GameStoneBoss); ok { + return configure.Get(id) + } + } return } diff --git a/sys/configure/structs/Game.StoneRoomData.go b/sys/configure/structs/Game.StoneRoomData.go index 94fcfe839..65d533ab1 100644 --- a/sys/configure/structs/Game.StoneRoomData.go +++ b/sys/configure/structs/Game.StoneRoomData.go @@ -21,7 +21,7 @@ type GameStoneRoomData struct { EventTreasureGroup int32 EventStoreGroup int32 BossEvent int32 - Condition int32 + Condition []int32 } const TypeId_GameStoneRoomData = -108410450 @@ -41,7 +41,20 @@ func (_v *GameStoneRoomData)Deserialize(_buf map[string]interface{}) (err error) { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["EventTreasureGroup"].(float64); !_ok_ { err = errors.New("EventTreasureGroup error"); return }; _v.EventTreasureGroup = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["EventStoreGroup"].(float64); !_ok_ { err = errors.New("EventStoreGroup error"); return }; _v.EventStoreGroup = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["BossEvent"].(float64); !_ok_ { err = errors.New("BossEvent error"); return }; _v.BossEvent = int32(_tempNum_) } - { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["Condition"].(float64); !_ok_ { err = errors.New("Condition error"); return }; _v.Condition = int32(_tempNum_) } + { + var _arr_ []interface{} + var _ok_ bool + if _arr_, _ok_ = _buf["Condition"].([]interface{}); !_ok_ { err = errors.New("Condition error"); return } + + _v.Condition = 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.Condition = append(_v.Condition, _list_v_) + } + } + return }