public static SLevelContext CreatePvpLevelContext(byte mapType, uint mapID, COM_GAME_TYPE GameType, int difficult) { SLevelContext sLevelContext = new SLevelContext(); sLevelContext.SetGameType(GameType); sLevelContext.m_mapType = (int)mapType; sLevelContext.m_levelDifficulty = difficult; sLevelContext.m_horizonEnableMethod = Horizon.EnableMethod.EnableAll; ResDT_LevelCommonInfo pvpMapCommonInfo = CLevelCfgLogicManager.GetPvpMapCommonInfo(mapType, mapID); sLevelContext.InitPvpData(pvpMapCommonInfo, mapID); if (mapType != 1) { if (mapType != 3) { if (mapType == 4) { ResEntertainmentLevelInfo dataByKey = GameDataMgr.entertainLevelDatabin.GetDataByKey(mapID); sLevelContext.m_entertainmentSubMapType = (int)dataByKey.bEntertainmentSubType; } else if (mapType == 5) { ResRewardMatchLevelInfo dataByKey2 = GameDataMgr.uinionBattleLevelDatabin.GetDataByKey(mapID); sLevelContext.m_SecondName = dataByKey2.szMatchName; } else if (mapType == 2) { } } } return(sLevelContext); }
public static ResDT_LevelCommonInfo GetPvpMapCommonInfo(byte mapType, uint mapId) { ResDT_LevelCommonInfo resDT_LevelCommonInfo = new ResDT_LevelCommonInfo(); if (mapType == 1) { ResAcntBattleLevelInfo dataByKey = GameDataMgr.pvpLevelDatabin.GetDataByKey(mapId); DebugHelper.Assert(dataByKey != null); resDT_LevelCommonInfo = dataByKey.stLevelCommonInfo; } else if (mapType == 3) { ResRankLevelInfo dataByKey2 = GameDataMgr.rankLevelDatabin.GetDataByKey(mapId); DebugHelper.Assert(dataByKey2 != null); resDT_LevelCommonInfo = dataByKey2.stLevelCommonInfo; } else if (mapType == 4) { ResEntertainmentLevelInfo dataByKey3 = GameDataMgr.entertainLevelDatabin.GetDataByKey(mapId); DebugHelper.Assert(dataByKey3 != null); resDT_LevelCommonInfo = dataByKey3.stLevelCommonInfo; } else if (mapType == 5) { ResRewardMatchLevelInfo dataByKey4 = GameDataMgr.uinionBattleLevelDatabin.GetDataByKey(mapId); DebugHelper.Assert(dataByKey4 != null); resDT_LevelCommonInfo = dataByKey4.stLevelCommonInfo; } else if (mapType == 6) { ResGuildMatchLevelInfo dataByKey5 = GameDataMgr.guildMatchLevelDatabin.GetDataByKey(mapId); DebugHelper.Assert(dataByKey5 != null); resDT_LevelCommonInfo = dataByKey5.stLevelCommonInfo; } else if (mapType == 2) { ResCounterPartLevelInfo dataByKey6 = GameDataMgr.cpLevelDatabin.GetDataByKey(mapId); DebugHelper.Assert(dataByKey6 != null); resDT_LevelCommonInfo = dataByKey6.stLevelCommonInfo; } if (resDT_LevelCommonInfo == null) { resDT_LevelCommonInfo = new ResDT_LevelCommonInfo(); } return(resDT_LevelCommonInfo); }
public ResDT_LevelCommonInfo GetPvpMapCommonInfo(int mapType, uint mapId) { ResDT_LevelCommonInfo resDT_LevelCommonInfo = null; switch (mapType) { case 1: { ResAcntBattleLevelInfo dataByKey = GameDataMgr.pvpLevelDatabin.GetDataByKey(mapId); resDT_LevelCommonInfo = dataByKey.stLevelCommonInfo; break; } case 2: { ResCounterPartLevelInfo dataByKey2 = GameDataMgr.cpLevelDatabin.GetDataByKey(mapId); resDT_LevelCommonInfo = dataByKey2.stLevelCommonInfo; break; } case 3: { ResRankLevelInfo dataByKey3 = GameDataMgr.rankLevelDatabin.GetDataByKey(mapId); resDT_LevelCommonInfo = dataByKey3.stLevelCommonInfo; break; } case 4: { ResEntertainmentLevelInfo dataByKey4 = GameDataMgr.entertainLevelDatabin.GetDataByKey(mapId); resDT_LevelCommonInfo = dataByKey4.stLevelCommonInfo; break; } case 5: { ResRewardMatchLevelInfo dataByKey5 = GameDataMgr.uinionBattleLevelDatabin.GetDataByKey(mapId); resDT_LevelCommonInfo = dataByKey5.stLevelCommonInfo; break; } } if (resDT_LevelCommonInfo == null) { } return(resDT_LevelCommonInfo); }
public static ResDT_LevelCommonInfo GetPvpMapCommonInfo(byte mapType, uint mapId) { ResDT_LevelCommonInfo stLevelCommonInfo = new ResDT_LevelCommonInfo(); if (mapType == 1) { ResAcntBattleLevelInfo dataByKey = GameDataMgr.pvpLevelDatabin.GetDataByKey(mapId); DebugHelper.Assert(dataByKey != null); stLevelCommonInfo = dataByKey.stLevelCommonInfo; } else if (mapType == 3) { ResRankLevelInfo info3 = GameDataMgr.rankLevelDatabin.GetDataByKey(mapId); DebugHelper.Assert(info3 != null); stLevelCommonInfo = info3.stLevelCommonInfo; } else if (mapType == 4) { ResEntertainmentLevelInfo info4 = GameDataMgr.entertainLevelDatabin.GetDataByKey(mapId); DebugHelper.Assert(info4 != null); stLevelCommonInfo = info4.stLevelCommonInfo; } else if (mapType == 5) { ResRewardMatchLevelInfo info5 = GameDataMgr.uinionBattleLevelDatabin.GetDataByKey(mapId); DebugHelper.Assert(info5 != null); stLevelCommonInfo = info5.stLevelCommonInfo; } else if (mapType == 2) { ResCounterPartLevelInfo info6 = GameDataMgr.cpLevelDatabin.GetDataByKey(mapId); DebugHelper.Assert(info6 != null); stLevelCommonInfo = info6.stLevelCommonInfo; } if (stLevelCommonInfo == null) { stLevelCommonInfo = new ResDT_LevelCommonInfo(); } return(stLevelCommonInfo); }
private void _InitMultiGame(COM_GAME_TYPE GameType, int mapType, uint mapID, bool isWarmBattle = false, int warmAiLv = 0) { ResDT_LevelCommonInfo pvpMapCommonInfo = this.GetPvpMapCommonInfo(mapType, mapID); this._gameContextCommonData.GameType = GameType; this._gameContextCommonData.IsMultiPlayerGame = true; this._gameContextCommonData.MapId = (int)mapID; this._gameContextCommonData.IsMobaGame = true; this._gameContextCommonData.SelectHeroType = (enSelectType)pvpMapCommonInfo.stPickRuleInfo.bPickType; this._gameContextCommonData.LevelDifficulty = 1; this._gameContextCommonData.HeroAiType = pvpMapCommonInfo.iHeroAIType; this._gameContextCommonData.SoulGrowActive = true; this._gameContextCommonData.BaseReviveTime = 15000; this._gameContextCommonData.DynamicPropertyConfigId = pvpMapCommonInfo.dwDynamicPropertyCfg; this._gameContextCommonData.MiniMapPath = pvpMapCommonInfo.szThumbnailPath; this._gameContextCommonData.BigMapPath = pvpMapCommonInfo.szBigMapPath; this._gameContextCommonData.MapWidth = pvpMapCommonInfo.iMapWidth; this._gameContextCommonData.MapHeight = pvpMapCommonInfo.iMapHeight; this._gameContextCommonData.BigMapWidth = pvpMapCommonInfo.iBigMapWidth; this._gameContextCommonData.BigMapHeight = pvpMapCommonInfo.iBigMapHeight; this._gameContextCommonData.MapFOWScale = pvpMapCommonInfo.fBigMapFowScale; this._gameContextCommonData.BigMapFOWScale = pvpMapCommonInfo.fBigMapFowScale; this._gameContextCommonData.MapName = pvpMapCommonInfo.szName; this._gameContextCommonData.MapDesignFileName = pvpMapCommonInfo.szDesignFileName; this._gameContextCommonData.MapArtistFileName = pvpMapCommonInfo.szArtistFileName; this._gameContextCommonData.MusicStartEvent = pvpMapCommonInfo.szMusicStartEvent; this._gameContextCommonData.MusicEndEvent = pvpMapCommonInfo.szMusicEndEvent; this._gameContextCommonData.AmbientSoundEvent = pvpMapCommonInfo.szBankResourceName; this._gameContextCommonData.MusicBankResName = pvpMapCommonInfo.szAmbientSoundEvent; this._gameContextCommonData.HorizonEnableMethod = Horizon.EnableMethod.EnableAll; this._gameContextCommonData.SoulId = pvpMapCommonInfo.dwSoulID; this._gameContextCommonData.SoulAllocId = pvpMapCommonInfo.dwSoulAllocId; this._gameContextCommonData.ExtraMapSkillId = pvpMapCommonInfo.iExtraSkillId; this._gameContextCommonData.ExtraMapSkill2Id = pvpMapCommonInfo.iExtraSkill2Id; this._gameContextCommonData.ExtraPassiveSkillId = pvpMapCommonInfo.iExtraPassiveSkillId; this._gameContextCommonData.OrnamentSkillId = pvpMapCommonInfo.iOrnamentSkillId; this._gameContextCommonData.OrnamentSwitchCd0 = pvpMapCommonInfo.iOrnamentSwitchCD; this._gameContextCommonData.EnableFOW = (pvpMapCommonInfo.bIsEnableFow > 0); this._gameContextCommonData.EnableShopHorizonTab = (pvpMapCommonInfo.bIsEnableOrnamentSlot > 0); this._gameContextCommonData.EnableOrnamentSlot = (pvpMapCommonInfo.bIsEnableShopHorizonTab > 0); this._gameContextCommonData.CanRightJoyStickCameraDrag = (pvpMapCommonInfo.bSupportCameraDrag > 0); this._gameContextCommonData.CameraFlip = (pvpMapCommonInfo.bCameraFlip > 0); this._gameContextMobaData.IsValid = true; this._gameContextMobaData.MapType = mapType; this._gameContextMobaData.OriginalGoldCoinInBattle = pvpMapCommonInfo.wOriginalGoldCoinInBattle; this._gameContextMobaData.PlayerNum = (int)pvpMapCommonInfo.bMaxAcntNum; this._gameContextMobaData.BattleEquipLimit = (pvpMapCommonInfo.bBattleEquipLimit > 0); this._gameContextMobaData.HeadPtsMaxLimit = (int)pvpMapCommonInfo.bHeadPtsUpperLimit; this._gameContextMobaData.BirthLevelConfig = (int)pvpMapCommonInfo.bBirthLevelConfig; this._gameContextMobaData.IsShowHonor = (pvpMapCommonInfo.bShowHonor > 0); this._gameContextMobaData.CooldownReduceMaxLimit = pvpMapCommonInfo.dwCooldownReduceUpperLimit; this._gameContextMobaData.IsOpenExpCompensate = (pvpMapCommonInfo.bIsOpenExpCompensate > 0); this._gameContextMobaData.ExpCompensateInfo = pvpMapCommonInfo.astExpCompensateDetail; this._gameContextMobaData.SoldierActivateDelay = pvpMapCommonInfo.iSoldierActivateDelay; this._gameContextMobaData.SoldierActivateCountDelay1 = pvpMapCommonInfo.iSoldierActivateCountDelay1; this._gameContextMobaData.SoldierActivateCountDelay2 = pvpMapCommonInfo.iSoldierActivateCountDelay2; this._gameContextMobaData.TimeDuration = pvpMapCommonInfo.dwTimeDuration; this._gameContextMobaData.AddWinCondStarId = pvpMapCommonInfo.dwAddWinCondStarId; this._gameContextMobaData.AddLoseCondStarId = pvpMapCommonInfo.dwAddLoseCondStarId; this._gameContextMobaData.SecondName = string.Empty; this._gameContextMobaData.GameMatchName = pvpMapCommonInfo.szGameMatchName; this._gameContextMobaData.IsWarmBattle = false; this._gameContextMobaData.WarmHeroAiDiffInfo = null; this._gameContextMobaData.IsWarmBattle = isWarmBattle; this._gameContextMobaData.WarmHeroAiDiffInfo = ((!isWarmBattle) ? null : GameDataMgr.battleDynamicDifficultyDB.GetDataByKey((long)warmAiLv)); if (mapType == 4) { ResEntertainmentLevelInfo dataByKey = GameDataMgr.entertainLevelDatabin.GetDataByKey(mapID); this._gameContextMobaData.EntertainmentMapSubType = dataByKey.bEntertainmentSubType; } else if (mapType == 5) { ResRewardMatchLevelInfo dataByKey2 = GameDataMgr.uinionBattleLevelDatabin.GetDataByKey(mapID); this._gameContextMobaData.SecondName = dataByKey2.szMatchName; } }
public static SLevelContext MakeMobaContext(uint LevelId, COM_GAME_TYPE GameType, int difficult) { SLevelContext context = new SLevelContext { isPVPLevel = true, GameType = GameType, isPVPMode = true, difficulty = difficult, horizonEnableMethod = Horizon.EnableMethod.EnableAll }; if (GameType == COM_GAME_TYPE.COM_MULTI_GAME_OF_ENTERTAINMENT) { context.MapType = 4; } if ((GameType == COM_GAME_TYPE.COM_MULTI_GAME_OF_REWARDMATCH) && IsLuanDouRuleWithUnion(LevelId)) { context.MapType = 4; } if (((GameType == COM_GAME_TYPE.COM_MULTI_GAME_OF_PVP_MATCH) || (GameType == COM_GAME_TYPE.COM_SINGLE_GAME_OF_COMBAT)) || ((GameType == COM_GAME_TYPE.COM_MULTI_GAME_OF_PVP_ROOM) || (GameType == COM_GAME_TYPE.COM_MULTI_GAME_OF_ENTERTAINMENT))) { ResAcntBattleLevelInfo info = GameDataMgr.pvpLevelDatabin.GetDataByKey(LevelId); ResDT_LevelCommonInfo stLevelCommonInfo = null; ResCounterPartLevelInfo info3 = null; if (info == null) { info3 = GameDataMgr.cpLevelDatabin.GetDataByKey(LevelId); object[] inParameters = new object[] { LevelId }; DebugHelper.Assert(info3 != null, "Failed find counterpart level config for id {0}", inParameters); stLevelCommonInfo = info3.stLevelCommonInfo; } else { stLevelCommonInfo = info.stLevelCommonInfo; } context.LevelName = StringHelper.UTF8BytesToString(ref stLevelCommonInfo.szName); context.LevelDesignFileName = StringHelper.UTF8BytesToString(ref stLevelCommonInfo.szDesignFileName); if (stLevelCommonInfo.szArtistFileName != null) { context.LevelArtistFileName = StringHelper.UTF8BytesToString(ref stLevelCommonInfo.szArtistFileName); } context.mapWidth = stLevelCommonInfo.iMapWidth; context.mapHeight = stLevelCommonInfo.iMapHeight; context.bigMapWidth = stLevelCommonInfo.iBigMapWidth; context.bigMapHeight = stLevelCommonInfo.iBigMapHeight; context.miniMapPath = stLevelCommonInfo.szThumbnailPath; context.bigMapPath = stLevelCommonInfo.szBigMapPath; context.mapPath = StringHelper.UTF8BytesToString(ref stLevelCommonInfo.szMapPath); context.AIModeType = (RES_LEVEL_HEROAITYPE)stLevelCommonInfo.iHeroAIType; if (info == null) { context.iLevelID = (int)info3.dwMapId; context.dwAttackOrder = info3.dwAttackOrderID; context.dynamicPropertyConfig = info3.dwDynamicPropertyCfg; context.battleTaskOfCamps[1] = info3.dwBattleTaskOfCamp1; context.battleTaskOfCamps[2] = info3.dwBattleTaskOfCamp2; context.musicStartEvent = StringHelper.UTF8BytesToString(ref info3.szMusicStartEvent); context.musicEndEvent = StringHelper.UTF8BytesToString(ref info3.szMusicEndEvent); context.bankResName = StringHelper.UTF8BytesToString(ref info3.szBankResourceName); context.ambientSoundEvent = StringHelper.UTF8BytesToString(ref info3.szAmbientSoundEvent); } else { context.iLevelID = (int)info.dwMapId; context.dwAttackOrder = info.dwAttackOrderID; context.dynamicPropertyConfig = info.dwDynamicPropertyCfg; context.battleTaskOfCamps[1] = info.dwBattleTaskOfCamp1; context.battleTaskOfCamps[2] = info.dwBattleTaskOfCamp2; context.musicStartEvent = StringHelper.UTF8BytesToString(ref info.szMusicStartEvent); context.musicEndEvent = StringHelper.UTF8BytesToString(ref info.szMusicEndEvent); context.bankResName = StringHelper.UTF8BytesToString(ref info.szBankResourceName); context.ambientSoundEvent = StringHelper.UTF8BytesToString(ref info.szAmbientSoundEvent); context.pvpLevelPlayerNum = info.stLevelCommonInfo.bMaxAcntNum; } } else if (GameType == COM_GAME_TYPE.COM_MULTI_GAME_OF_LADDER) { ResRankLevelInfo info4 = GameDataMgr.rankLevelDatabin.GetDataByKey(LevelId); DebugHelper.Assert(info4 != null); context.LevelName = StringHelper.UTF8BytesToString(ref info4.stLevelCommonInfo.szName); context.LevelDesignFileName = StringHelper.UTF8BytesToString(ref info4.stLevelCommonInfo.szDesignFileName); if (info4.stLevelCommonInfo.szArtistFileName != null) { context.LevelArtistFileName = StringHelper.UTF8BytesToString(ref info4.stLevelCommonInfo.szArtistFileName); } context.iLevelID = (int)info4.dwMapId; context.dwAttackOrder = info4.dwAttackOrderID; context.dynamicPropertyConfig = info4.dwDynamicPropertyCfg; context.AIModeType = (RES_LEVEL_HEROAITYPE)info4.stLevelCommonInfo.iHeroAIType; context.mapWidth = info4.stLevelCommonInfo.iMapWidth; context.mapHeight = info4.stLevelCommonInfo.iMapHeight; context.bigMapWidth = info4.stLevelCommonInfo.iBigMapWidth; context.bigMapHeight = info4.stLevelCommonInfo.iBigMapHeight; context.miniMapPath = info4.stLevelCommonInfo.szThumbnailPath; context.bigMapPath = info4.stLevelCommonInfo.szBigMapPath; context.battleTaskOfCamps[1] = info4.dwBattleTaskOfCamp1; context.battleTaskOfCamps[2] = info4.dwBattleTaskOfCamp2; context.musicStartEvent = StringHelper.UTF8BytesToString(ref info4.szMusicStartEvent); context.musicEndEvent = StringHelper.UTF8BytesToString(ref info4.szMusicEndEvent); context.ambientSoundEvent = StringHelper.UTF8BytesToString(ref info4.szAmbientSoundEvent); context.bankResName = StringHelper.UTF8BytesToString(ref info4.szBankResourceName); context.pvpLevelPlayerNum = info4.stLevelCommonInfo.bMaxAcntNum; } else if (GameType == COM_GAME_TYPE.COM_MULTI_GAME_OF_REWARDMATCH) { ResRewardMatchLevelInfo info5 = GameDataMgr.uinionBattleLevelDatabin.GetDataByKey(LevelId); DebugHelper.Assert(info5 != null); context.LevelName = StringHelper.UTF8BytesToString(ref info5.stLevelCommonInfo.szName); context.LevelDesignFileName = StringHelper.UTF8BytesToString(ref info5.stLevelCommonInfo.szDesignFileName); if (info5.stLevelCommonInfo.szArtistFileName != null) { context.LevelArtistFileName = StringHelper.UTF8BytesToString(ref info5.stLevelCommonInfo.szArtistFileName); } context.iLevelID = (int)info5.dwMapId; context.dwAttackOrder = info5.dwAttackOrderID; context.dynamicPropertyConfig = info5.dwDynamicPropertyCfg; context.AIModeType = (RES_LEVEL_HEROAITYPE)info5.stLevelCommonInfo.iHeroAIType; context.mapWidth = info5.stLevelCommonInfo.iMapWidth; context.mapHeight = info5.stLevelCommonInfo.iMapHeight; context.bigMapWidth = info5.stLevelCommonInfo.iBigMapWidth; context.bigMapHeight = info5.stLevelCommonInfo.iBigMapHeight; context.miniMapPath = info5.stLevelCommonInfo.szThumbnailPath; context.bigMapPath = info5.stLevelCommonInfo.szBigMapPath; context.battleTaskOfCamps[1] = info5.dwBattleTaskOfCamp1; context.battleTaskOfCamps[2] = info5.dwBattleTaskOfCamp2; context.musicStartEvent = StringHelper.UTF8BytesToString(ref info5.szMusicStartEvent); context.musicEndEvent = StringHelper.UTF8BytesToString(ref info5.szMusicEndEvent); context.ambientSoundEvent = StringHelper.UTF8BytesToString(ref info5.szAmbientSoundEvent); context.bankResName = StringHelper.UTF8BytesToString(ref info5.szBankResourceName); context.pvpLevelPlayerNum = info5.stLevelCommonInfo.bMaxAcntNum; context.m_SecondName = info5.szMatchName; } ResEntertainmentLevelInfo dataByKey = GameDataMgr.entertainLevelDatabin.GetDataByKey(LevelId); if (dataByKey != null) { context.SubMapType = dataByKey.bEntertainmentSubType; } return(context); }