private static void EndRound() { //Force game transition to the post match screen in order to reload wrestlers MatchMain main = MatchMain.inst; main.isMatchEnd = true; MatchSetting settings = GlobalWork.GetInst().MatchSetting; main.isInterruptedMatch = false; //Determine if full HP regen rule is in effect if (isRegen) { RefreshPlayer(0); if (isTag) { RefreshPlayer(1); } } //Ensure the 3 Game Rule Doesn't Force Match to End settings.MatchCnt = 0; settings.is3GameMatch = true; global::GlobalParam.is3GamesMatch = true; global::GlobalParam.m_MacthCount = 0; global::GlobalParam.flg_MacthForceEnd = false; //global::GlobalParam.flg_MacthCount = true; //Update Game Details if (!endRound) { UpdateDetails(); endRound = true; } }
public static void UnlockAbilities() { MatchSetting settings = GlobalWork.GetInst().MatchSetting; //Enable Top Rope Throw if (QoL_Form.form.au_overTopRope.Checked && GlobalWork.inst.MatchSetting.BattleRoyalKind == BattleRoyalKindEnum.Off) { enableTopRopeThrow = true; } else { enableTopRopeThrow = false; } }
private static void EndMatch() { //Ensure this isn't executed multiple times if (!endMatch) { MatchSetting settings = GlobalWork.GetInst().MatchSetting; //Ensure that we reset the 3 Game Match settings settings.is3GameMatch = false; global::GlobalParam.is3GamesMatch = false; global::GlobalParam.flg_MacthForceEnd = true; endRound = false; endMatch = true; UpdateDetails(); } }
public static void SetEmployees() { ringName = ""; promotion = null; playerNum = GetPlayerCount(); MatchSetting settings = GlobalWork.GetInst().MatchSetting; fpwEnable = War_Form.form.fpw_Enable.Checked; if (fpwEnable) { try { if ((int)settings.ringID < (int)RingID.EditRingIDTop) { ringName += settings.ringID; } else if ((int)settings.ringID >= (int)RingID.EditRingIDTop) { ringName = global::SaveData.GetInst().GetEditRingData(settings.ringID).name.Replace(War_Form.listSeparator, ' '); } } catch (ArgumentOutOfRangeException e) { ringName = "none"; } promotion = War_Form.form.GetRingPromotion(ringName); if (promotion != null) { employeeData = new Employee[8]; for (int i = 0; i < 8; i++) { Player plObj = PlayerMan.inst.GetPlObj(i); if (!plObj) { continue; } employeeData[i] = promotion.GetEmployeeData(DataBase.GetWrestlerFullName(plObj.WresParam)); } } //Get team names teamNames = new String[2]; List <String> members = new List <String>(); //Get Blue Team Name for (int i = 0; i < 4; i++) { Player player = PlayerMan.inst.GetPlObj(i); if (!player) { continue; } if (player.isSecond || player.isIntruder) { continue; } members.Add(DataBase.GetWrestlerFullName(player.WresParam)); } GetTeamName(members, out teamNames[0]); //Get Red Team Name members.Clear(); for (int i = 4; i < 8; i++) { Player player = PlayerMan.inst.GetPlObj(i); if (!player) { continue; } if (player.isSecond || player.isIntruder) { continue; } members.Add(DataBase.GetWrestlerFullName(player.WresParam)); } GetTeamName(members, out teamNames[1]); //Check for champions in a non-title match titleData = new TitleMatch_Data[8]; hasChamp = false; try { if (GlobalParam.TitleMatch_BeltData == null) { for (int i = 0; i < 8; i++) { Player player = PlayerMan.inst.GetPlObj(i); if (!player) { continue; } if (player.isSecond || player.isIntruder) { continue; } foreach (var item in SaveData.inst.titleMatch_Data) { String currentChamp = item.GetCurrentTitleHolderName(); if (currentChamp.Equals(DataBase.GetWrestlerFullName(player.WresParam))) { hasChamp = true; titleData[i] = item; break; } else { if (i < 4) { if (!teamNames[0].Equals(String.Empty) && teamNames[0].Equals(currentChamp)) { hasChamp = true; titleData[i] = item; break; } } else { if (!teamNames[1].Equals(String.Empty) && teamNames[1].Equals(currentChamp)) { hasChamp = true; titleData[i] = item; break; } } } } } } } catch (Exception ex) { L.D("SetEmployees-NonTitleMatchException: " + ex); } if (teamNames[0] != String.Empty) { L.D("Blue Team: " + teamNames[0]); } if (teamNames[1] != String.Empty) { L.D("Red Team: " + teamNames[1]); } } }
private void sr_start_Click(object sender, EventArgs e) { if (!ValidateMatch()) { return; } if (MoreMatchTypes_Form.SurvivalRoadData.InProgress) { ShowError("Please end the current Survival Road session first."); } #region Variables MatchSetting settings = GlobalWork.GetInst().MatchSetting; MatchConfig.WresIDGroup player = (MatchConfig.WresIDGroup)sr_wrestler.SelectedItem; MatchConfig.WresIDGroup second = (MatchConfig.WresIDGroup)sr_second.SelectedItem; String selectedType = sr_matchType.SelectedItem.ToString(); WrestlerID wrestlerNo = WrestlerID.AbbieJones; bool isSecond = true; bool controlBoth = false; bool validEntry = false; int control = 0; int oppCount = sr_teamList.Items.Count; #endregion try { settings = SetMatchConfig("Survival", settings); sr_progress.Clear(); //Set-up player team for (int i = 0; i < 4; i++) { //Handling the first player if (i == 0) { wrestlerNo = (WrestlerID)player.ID; isSecond = false; control = 1; validEntry = true; } else if (i == 1) { if (second != null) { validEntry = true; wrestlerNo = (WrestlerID)second.ID; if (sr_tag.Checked) { isSecond = false; if (sr_controlBoth.Checked) { control = 1; } else { control = 0; } } else if (!sr_tag.Checked) { isSecond = true; } //Ensure we handle cases where a second isn't allowed, and a tag match hasn't been selected. if (!sr_tag.Checked && (!selectedType.Equals("Normal"))) { validEntry = false; } } else { validEntry = false; } } else if (i > 1) { validEntry = false; } //Determine if this is a simulation if (sr_simulate.Checked) { control = 0; if (sr_simSecond.Checked && i == 1 && selectedType.Equals("Normal")) { control = 1; } } settings = MatchConfiguration.AddPlayers(validEntry, wrestlerNo, i, control, isSecond, 0, settings); } //Set-up opponents MatchConfig.WresIDGroup opponent; int opponentCount = sr_teamList.Items.Count; for (int i = 4; i < 8; i++) { if (i > 5) { validEntry = false; } else { validEntry = true; int searchIndex; //Get Random opponent if (sr_random.Checked) { searchIndex = UnityEngine.Random.Range(0, opponentCount); } else { searchIndex = 0; } //Determine if we're creating a tag team or single competitor if (opponentCount == 1) { opponent = (MatchConfig.WresIDGroup)sr_teamList.Items[searchIndex]; wrestlerNo = MatchConfiguration.GetWrestlerNo(opponent); initialOpponents[0] = opponent; } else if (i == 4) { opponent = (MatchConfig.WresIDGroup)sr_teamList.Items[searchIndex]; wrestlerNo = MatchConfiguration.GetWrestlerNo(opponent); initialOpponents[0] = opponent; } else if (sr_tag.Checked && i == 5) { opponent = (MatchConfig.WresIDGroup)sr_teamList.Items[searchIndex]; wrestlerNo = MatchConfiguration.GetWrestlerNo(opponent); //Ensure that we aren't fielding duplicate wrestlers while (initialOpponents[0].ID == (int)wrestlerNo) { searchIndex = UnityEngine.Random.Range(0, opponentCount); opponent = (MatchConfig.WresIDGroup)sr_teamList.Items[searchIndex]; wrestlerNo = MatchConfiguration.GetWrestlerNo(opponent); } initialOpponents[1] = opponent; } else if (!sr_tag.Checked && i == 5) { validEntry = false; } } settings = MatchConfiguration.AddPlayers(validEntry, wrestlerNo, i, 0, false, 0, settings); } StartMatch(); } catch (Exception ex) { ShowError("An error has occured."); L.D("ValidateSurvivalMatchError: " + ex); } }
private void btn_matchStart_Click(object sender, EventArgs e) { if (!ValidateMatch()) { return; } if (MoreMatchTypes_Form.ExEliminationData.InProgress) { ShowError("Please end the current Extended Elimination Match first."); return; } #region Variables MatchSetting settings = GlobalWork.GetInst().MatchSetting; WrestlerID wrestlerNo = WrestlerID.AbbieJones; bool isSecond = true; bool controlBoth = false; bool validEntry = false; int control = 0; #endregion //Adding initial teams try { settings = SetMatchConfig(settings); //Set-up Blue team for (int i = 0; i < 4; i++) { if (i >= el_blueList.Items.Count) { break; } //Prepare wrestler wrestlerNo = (WrestlerID)((MatchConfig.WresIDGroup)el_blueList.Items[i]).ID; validEntry = true; if (i == 0) { isSecond = false; if (el_blueControl.Checked) { control = 1; } else { control = 0; } } else { isSecond = true; } settings = MatchConfiguration.AddPlayers(validEntry, wrestlerNo, i, control, isSecond, 0, settings); } //Set-up Red team for (int i = 0; i < 4; i++) { if (i >= el_redList.Items.Count) { break; } //Prepare wrestler wrestlerNo = (WrestlerID)((MatchConfig.WresIDGroup)el_redList.Items[i]).ID; validEntry = true; if (i == 4) { isSecond = false; if (el_redControl.Checked) { control = 1; } else { control = 0; } } else { isSecond = true; } settings = MatchConfiguration.AddPlayers(validEntry, wrestlerNo, i + 4, control, isSecond, 0, settings); } StartMatch(); } catch (Exception ex) { ShowError("An error has occured."); L.D("ValidateExElimMatch: " + ex); } }