/// <summary> /// 攻击BOSS /// </summary> public void ProcessAttackBossInAngelTempleScene(GameClient client, Monster monster, int nDamage) { AngelTemplePointInfo tmpInfo; lock (m_PointDamageInfoMutex) { if (!m_RoleDamageAngelValue.TryGetValue(client.ClientData.RoleID, out tmpInfo)) { tmpInfo = new AngelTemplePointInfo(); tmpInfo.m_RoleID = client.ClientData.RoleID; tmpInfo.m_DamagePoint = nDamage; tmpInfo.m_GetAwardFlag = 0; tmpInfo.m_RoleName = Global.FormatRoleName(client, client.ClientData.RoleName); m_RoleDamageAngelValue.Add(client.ClientData.RoleID, tmpInfo); } else { tmpInfo.m_DamagePoint += nDamage; } if (tmpInfo.CompareTo(m_PointInfoArray[4]) < 0) { if (tmpInfo.Ranking < 0) { m_PointInfoArray[5] = tmpInfo; tmpInfo.Ranking = 1; //不看具体排名了,随意设个吧 } Array.Sort(m_PointInfoArray, AngelTemplePointInfo.Compare_static); if (null != m_PointInfoArray[5]) { m_PointInfoArray[5].Ranking = -1; } } } client.ClientData.AngelTempleCurrentPoint = tmpInfo.m_DamagePoint; if (client.ClientData.AngelTempleCurrentPoint > client.ClientData.AngelTempleTopPoint) { client.ClientData.AngelTempleTopPoint = client.ClientData.AngelTempleCurrentPoint; } if (tmpInfo.m_DamagePoint > m_nTotalDamageValue) { string strName = Global.FormatRoleName(client, client.ClientData.RoleName); SetTotalPointInfo(strName, tmpInfo.m_DamagePoint); } long lTicks = TimeUtil.NOW(); int percent = (int)(100.0 * monster.VLife / m_BossHP); if (lTicks >= (m_NotifyInfoTickForSingle + m_NotifyInfoDelayTick) || percent != m_LastNotifyBossHPPercent) { m_LastNotifyBossHPPercent = percent; m_NotifyInfoTickForSingle = lTicks; NotifyInfoToClient(client); NotifyInfoToAllClient(monster.VLife); } }
public void InitAngelTemple() { Global.QueryDayActivityTotalPointInfoToDB(SpecialActivityTypes.AngelTemple); this.AngelTempleMonsterUpgradePercent = Global.SafeConvertToDouble(GameManager.GameConfigMgr.GetGameConifgItem("AngelTempleMonsterUpgradeNumber")); this.AngelTempleMinHurt = GameManager.systemParamsList.GetParamValueIntByName("AngelTempleMinHurt", -1); double[] AngelTempleBossUpgradeParams = GameManager.systemParamsList.GetParamValueDoubleArrayByName("AngelTempleBossUpgrade", ','); if (AngelTempleBossUpgradeParams != null && AngelTempleBossUpgradeParams.Length == 4) { this.AngelTempleBossUpgradeTime = (int)AngelTempleBossUpgradeParams[0]; this.AngelTempleBossUpgradeParam1 = AngelTempleBossUpgradeParams[1]; this.AngelTempleBossUpgradeParam2 = AngelTempleBossUpgradeParams[2]; this.AngelTempleBossUpgradeParam3 = AngelTempleBossUpgradeParams[3]; } this.m_sKillBossRoleName = GameManager.GameConfigMgr.GetGameConifgItem("AngelTempleRole"); for (int i = 0; i < 5; i++) { AngelTemplePointInfo tmp = new AngelTemplePointInfo(); tmp.m_RoleID = 0; tmp.m_DamagePoint = 0L; tmp.m_GetAwardFlag = 0; tmp.m_RoleName = ""; this.m_PointInfoArray[i] = tmp; } this.m_BossHP = 10000L; SystemXmlItem ItemAngelTempleData = null; GameManager.systemAngelTempleData.SystemXmlItemDict.TryGetValue(1, out ItemAngelTempleData); if (ItemAngelTempleData == null) { throw new Exception("AngelTemple Scene ERROR"); } this.m_AngelTempleData.MapCode = ItemAngelTempleData.GetIntValue("MapCode", -1); this.m_AngelTempleData.MinChangeLifeNum = ItemAngelTempleData.GetIntValue("MinZhuangSheng", -1); this.m_AngelTempleData.MinLevel = ItemAngelTempleData.GetIntValue("MinLevel", -1); List <string> strTimeList = new List <string>(); string timePoints = ItemAngelTempleData.GetStringValue("TimePoints"); if (timePoints != null && timePoints != "") { string[] sField = timePoints.Split(new char[] { ',' }); for (int i = 0; i < sField.Length; i++) { strTimeList.Add(sField[i].Trim()); } } this.m_AngelTempleData.BeginTime = strTimeList; this.m_AngelTempleData.PrepareTime = Global.GMax(ItemAngelTempleData.GetIntValue("PrepareSecs", -1), ItemAngelTempleData.GetIntValue("WaitingEnterSecs", -1)); this.m_AngelTempleData.DurationTime = ItemAngelTempleData.GetIntValue("FightingSecs", -1); this.m_AngelTempleData.LeaveTime = ItemAngelTempleData.GetIntValue("ClearRolesSecs", -1); this.m_AngelTempleData.MinPlayerNum = ItemAngelTempleData.GetIntValue("MinRequestNum", -1); this.m_AngelTempleData.MaxPlayerNum = ItemAngelTempleData.GetIntValue("MaxEnterNum", -1); this.m_AngelTempleData.BossID = ItemAngelTempleData.GetIntValue("BossID", -1); this.m_AngelTempleData.BossPosX = ItemAngelTempleData.GetIntValue("BossPosX", -1); this.m_AngelTempleData.BossPosY = ItemAngelTempleData.GetIntValue("BossPosY", -1); }
private void SetLeaveFlag(GameClient client, bool leaveFlag) { AngelTemplePointInfo tmpInfo = null; lock (m_PointDamageInfoMutex) { if (m_RoleDamageAngelValue.TryGetValue(client.ClientData.RoleID, out tmpInfo)) { tmpInfo.LeaveScene = leaveFlag; //离开状态,即使在线也不发放奖励 } } }
/// <summary> // 清空处理 /// </summary> public void CleanUpAngelTempleScene() { m_AngelTempleScene.CleanAll(); lock (m_PointDamageInfoMutex) { m_RoleDamageAngelValue.Clear(); for (int i = 0; i < m_PointInfoArray.Length; ++i) { if (null != m_PointInfoArray[i]) { m_PointInfoArray[i] = new AngelTemplePointInfo(); } } } }
/// <summary> /// 初始化场景 /// </summary> public void InitAngelTemple() { Global.QueryDayActivityTotalPointInfoToDB(SpecialActivityTypes.AngelTemple); AngelTempleMonsterUpgradePercent = Global.SafeConvertToDouble(GameManager.GameConfigMgr.GetGameConifgItem(GameConfigNames.AngelTempleMonsterUpgradeNumber)); AngelTempleMinHurt = GameManager.systemParamsList.GetParamValueIntByName("AngelTempleMinHurt"); double[] AngelTempleBossUpgradeParams = GameManager.systemParamsList.GetParamValueDoubleArrayByName("AngelTempleBossUpgrade"); if (null != AngelTempleBossUpgradeParams && AngelTempleBossUpgradeParams.Length == 4) { AngelTempleBossUpgradeTime = (int)AngelTempleBossUpgradeParams[0]; AngelTempleBossUpgradeParam1 = AngelTempleBossUpgradeParams[1]; AngelTempleBossUpgradeParam2 = AngelTempleBossUpgradeParams[2]; AngelTempleBossUpgradeParam3 = AngelTempleBossUpgradeParams[3]; } /*int nRole = -1; * nRole = Global.SafeConvertToInt32(GameManager.GameConfigMgr.GetGameConifgItem(GameConfigNames.AngelTempleRole)); * * if (nRole > 0) * { * GameClient client = null; * client = GameManager.ClientMgr.FindClient(nRole); * * if (client != null) * { * m_sKillBossRoleID = nRole; * m_sKillBossRoleName = Global.FormatRoleName(client, client.ClientData.RoleName); * } * }*/ m_sKillBossRoleName = GameManager.GameConfigMgr.GetGameConifgItem(GameConfigNames.AngelTempleRole); for (int i = 0; i < 5; ++i) { AngelTemplePointInfo tmp = new AngelTemplePointInfo(); tmp.m_RoleID = 0; tmp.m_DamagePoint = 0; tmp.m_GetAwardFlag = 0; tmp.m_RoleName = ""; m_PointInfoArray[i] = tmp; } m_BossHP = 10000; SystemXmlItem ItemAngelTempleData = null; GameManager.systemAngelTempleData.SystemXmlItemDict.TryGetValue(1, out ItemAngelTempleData); if (ItemAngelTempleData == null) { throw new Exception("AngelTemple Scene ERROR"); } m_AngelTempleData.MapCode = ItemAngelTempleData.GetIntValue("MapCode"); m_AngelTempleData.MinChangeLifeNum = ItemAngelTempleData.GetIntValue("MinZhuangSheng"); m_AngelTempleData.MinLevel = ItemAngelTempleData.GetIntValue("MinLevel"); List <string> strTimeList = new List <string>(); string[] sField = null; string timePoints = ItemAngelTempleData.GetStringValue("TimePoints"); if (null != timePoints && timePoints != "") { sField = timePoints.Split(','); for (int i = 0; i < sField.Length; i++) { strTimeList.Add(sField[i].Trim()); } } m_AngelTempleData.BeginTime = strTimeList; m_AngelTempleData.PrepareTime = Global.GMax(ItemAngelTempleData.GetIntValue("PrepareSecs"), ItemAngelTempleData.GetIntValue("WaitingEnterSecs")); m_AngelTempleData.DurationTime = ItemAngelTempleData.GetIntValue("FightingSecs"); m_AngelTempleData.LeaveTime = ItemAngelTempleData.GetIntValue("ClearRolesSecs"); m_AngelTempleData.MinPlayerNum = ItemAngelTempleData.GetIntValue("MinRequestNum"); m_AngelTempleData.MaxPlayerNum = ItemAngelTempleData.GetIntValue("MaxEnterNum"); m_AngelTempleData.BossID = ItemAngelTempleData.GetIntValue("BossID"); m_AngelTempleData.BossPosX = ItemAngelTempleData.GetIntValue("BossPosX"); m_AngelTempleData.BossPosY = ItemAngelTempleData.GetIntValue("BossPosY"); }
public void ProcessAttackBossInAngelTempleScene(GameClient client, Monster monster, int nDamage) { if (nDamage > 0) { AngelTemplePointInfo tmpInfo; lock (this.m_PointDamageInfoMutex) { if (!this.m_RoleDamageAngelValue.TryGetValue(client.ClientData.RoleID, out tmpInfo)) { tmpInfo = new AngelTemplePointInfo(); tmpInfo.m_RoleID = client.ClientData.RoleID; tmpInfo.m_DamagePoint = (long)nDamage; tmpInfo.m_GetAwardFlag = 0; tmpInfo.m_RoleName = Global.FormatRoleName(client, client.ClientData.RoleName); this.m_RoleDamageAngelValue.Add(client.ClientData.RoleID, tmpInfo); } else { tmpInfo.m_DamagePoint += (long)nDamage; } this.AddRoleAuctionData(client, nDamage); if (tmpInfo.m_DamagePoint > this.LastMinDamage) { if (tmpInfo.Ranking < 0) { this.m_PointInfoArray[5] = tmpInfo; tmpInfo.Ranking = 1; Array.Sort <AngelTemplePointInfo>(this.m_PointInfoArray, tmpInfo); } else { Array.Sort <AngelTemplePointInfo>(this.m_PointInfoArray, 0, 5, tmpInfo); } if (null != this.m_PointInfoArray[5]) { this.m_PointInfoArray[5].Ranking = -1; } this.LastMinDamage = ((this.m_PointInfoArray[4] != null) ? this.m_PointInfoArray[4].m_DamagePoint : 0L); } } client.ClientData.AngelTempleCurrentPoint = tmpInfo.m_DamagePoint; if (client.ClientData.AngelTempleCurrentPoint > client.ClientData.AngelTempleTopPoint) { client.ClientData.AngelTempleTopPoint = client.ClientData.AngelTempleCurrentPoint; } if (tmpInfo.m_DamagePoint > this.m_nTotalDamageValue) { string strName = Global.FormatRoleName(client, client.ClientData.RoleName); this.SetTotalPointInfo(strName, tmpInfo.m_DamagePoint); } long lTicks = TimeUtil.NOW(); int percent = (int)(100.0 * monster.VLife / (double)this.m_BossHP); if (lTicks >= client.ClientData.m_NotifyInfoTickForSingle + this.m_NotifyInfoDelayTick) { client.ClientData.m_NotifyInfoTickForSingle = lTicks; this.NotifyInfoToClient(client); } if (lTicks >= this.m_NotifyInfoTickForSingle + this.m_NotifyInfoDelayTick || percent != this.m_LastNotifyBossHPPercent) { this.m_LastNotifyBossHPPercent = percent; this.m_NotifyInfoTickForSingle = lTicks; this.NotifyInfoToAllClient(monster.VLife); } } }