private void OnTimerWarmBattle(int timerSequence) { Singleton <CTimerManager> .instance.RemoveTimer(this.m_timerSeq); CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(FightForm.s_battleUIForm); if (form != null && !form.IsHided()) { this.m_timerSeq = -1; if (this.m_curCnt != this.m_maxCnt) { this.m_curCnt++; this.m_timerSeq = Singleton <CTimerManager> .instance.AddTimer(this.m_random.Next(500, 3000), 1, new CTimer.OnTimeUpHandler(this.OnTimerWarmBattle)); this.OpenSurrenderForm(this.m_maxCnt, this.m_curCnt, this.m_result); } else { this.m_haveRights = true; COM_PLAYERCAMP playerCamp = Singleton <GamePlayerCenter> .instance.GetHostPlayer().PlayerCamp; BattleLogic.ForceKillCrystal((int)playerCamp); } } }
public static void OnGameOverEvent(CSPkg msg) { if (Singleton <BattleLogic> .get_instance().isWaitGameEnd) { return; } if (msg.stPkgData.get_stNtfCltGameOver().bWinCamp > 0) { COM_PLAYERCAMP playerCamp = Singleton <GamePlayerCenter> .get_instance().GetHostPlayer().PlayerCamp; Singleton <BattleLogic> .get_instance().battleStat.iBattleResult = ((playerCamp != msg.stPkgData.get_stNtfCltGameOver().bWinCamp) ? 2 : 1); COM_PLAYERCAMP camp; if (Singleton <BattleLogic> .get_instance().battleStat.iBattleResult == 1) { camp = BattleLogic.GetOppositeCmp(playerCamp); } else { camp = playerCamp; } BattleLogic.ForceKillCrystal(camp); } Singleton <CSurrenderSystem> .get_instance().DelayCloseSurrenderForm(5); }
private void OnSurrenderConfirm(CUIEvent cuiEvent) { if (this.IsWarmBattle() && !Singleton <LobbyLogic> .instance.inMultiGame) { this.m_lastSurrenderTime = (uint)CRoleInfo.GetCurrentUTCTime(); this.m_maxCnt = this.GetTotalAcnt(); this.m_curCnt = 1; if (this.m_maxCnt == 1) { COM_PLAYERCAMP playerCamp = Singleton <GamePlayerCenter> .instance.GetHostPlayer().PlayerCamp; BattleLogic.ForceKillCrystal((int)playerCamp); } else { this.m_haveRights = false; this.m_result = this.ConstrcutData(this.m_maxCnt); this.m_timerSeq = Singleton <CTimerManager> .instance.AddTimer(this.m_random.Next(500, 3000), 1, new CTimer.OnTimeUpHandler(this.OnTimerWarmBattle)); this.OpenSurrenderForm(this.m_maxCnt, this.m_curCnt, this.m_result); } } else { this.SendMsgSurrender(1); } }
private void OnTimerWarmBattle(int timerSequence) { Singleton <CTimerManager> .instance.RemoveTimer(this.m_timerSeq); this.m_timerSeq = -1; if (this.m_curCnt != this.m_maxCnt) { this.m_curCnt++; this.m_timerSeq = Singleton <CTimerManager> .instance.AddTimer(this.m_random.Next(500, 0xbb8), 1, new CTimer.OnTimeUpHandler(this.OnTimerWarmBattle)); this.OpenSurrenderForm(this.m_maxCnt, this.m_curCnt, this.m_result); } else { this.m_haveRights = true; BattleLogic.ForceKillCrystal((int)Singleton <GamePlayerCenter> .instance.GetHostPlayer().PlayerCamp); } }
public static void OnGameOverEvent(CSPkg msg) { if (!Singleton <BattleLogic> .instance.isWaitGameEnd) { if (msg.stPkgData.stNtfCltGameOver.bWinCamp > 0) { COM_PLAYERCAMP playerCamp = Singleton <GamePlayerCenter> .instance.GetHostPlayer().PlayerCamp; Singleton <BattleLogic> .instance.battleStat.iBattleResult = (((byte)playerCamp) != msg.stPkgData.stNtfCltGameOver.bWinCamp) ? 2 : 1; COM_PLAYERCAMP oppositeCmp = COM_PLAYERCAMP.COM_PLAYERCAMP_1; if (Singleton <BattleLogic> .instance.battleStat.iBattleResult == 1) { oppositeCmp = BattleLogic.GetOppositeCmp(playerCamp); } else { oppositeCmp = playerCamp; } BattleLogic.ForceKillCrystal((int)oppositeCmp); } Singleton <CSurrenderSystem> .instance.DelayCloseSurrenderForm(5); } }