private void PlayLine() { if (currentLine < lines.Length) { if (lines[currentLine].StartsWith("*")) { string operation = lines[currentLine].Substring(1).Split(' ')[0]; string objectIndex = lines[currentLine].Split(' ')[1]; EnableObject(operation == "enable", int.Parse(objectIndex)); currentLine++; OnInteraction(); } else if (lines[currentLine].StartsWith("[")) { Game.instance.keys.AddOrRemoveKeyFromLine(lines[currentLine]); currentLine++; OnInteraction(); } else if (lines[currentLine].StartsWith("w_")) { WrestlingMatch wrestlingMatch = GetComponent <WrestlingMatch>(); string line = ""; if (wrestlingMatch) { line = wrestlingMatch.OnLine(lines[currentLine]); } if (!string.IsNullOrEmpty(line)) { Game.instance.refs.GetTextbox().PlayText(line); } currentLine++; } else if (lines[currentLine] == funfare) { Game.instance.gameAudio.PlayFunfare(); currentLine++; OnInteraction(); } else if (lines[currentLine] == pickup) { Game.instance.gameAudio.PlayPickupSound(); currentLine++; OnInteraction(); } else { Game.instance.refs.GetTextbox().PlayText(lines[currentLine]); currentLine++; } } else { Game.instance.refs.GetTextbox().Hide(); currentLine = 0; } }
void ProcessNextMatch() { WrestlingMatch match = matches[currentMatchIndex]; currentMatchIndex++; bool unlockedMatchType = false; // These weights should all add up to 1.0f float matchTypeWeight = 0.1f; float matchFinishWeight = 0.4f; float matchWrestlerPerformanceWeight = 0.5f; float matchTypeRating = currentEvent.EventVenue.GetMatchTypePreference(match.type); float matchFinishRating = currentEvent.EventVenue.GetMatchFinishPreference(match.finish); // Add wrestler affinities. float wrestlerPerformanceRating = 0.0f; if (match.ParticipantCount > 0) { foreach (Wrestler wrestler in match.Participants) { wrestlerPerformanceRating += wrestler.GetMatchTypeAffinity(match.type) * wrestler.work; } wrestlerPerformanceRating /= match.ParticipantCount; } match.rating = (matchTypeRating * matchTypeWeight) + (matchFinishRating * matchFinishWeight) + (wrestlerPerformanceRating * matchWrestlerPerformanceWeight); if (currentEvent.EventVenue.GetMatchTypePreference(match.type) > 0.5 && !unlockedMatchType) { gameManager.GetPlayerCompany().AttemptUnlockMatchTypeByVenue(currentEvent.EventVenue); unlockedMatchType = true; } string matchReport = ""; matchReport += GetFanMatchTypeReview(matchTypeRating) + "\n"; matchReport += GetFanPerformanceReview(wrestlerPerformanceRating) + "\n"; matchReport += GetFanFinishReview(matchFinishRating) + "\n"; matchReport += "\n" + GetFanMatchReview(match.rating) + "\n"; // Note: currentMatchIndex is used as-is in the dialog title because it's already been incremented, eliminating the need to add one to eliminate zero-indexing confusion. matchDialog = gameManager.GetGUIManager().InstantiateInfoSliderDialog(); matchDialog.Initialize(match.VersusString(), matchReport, "", 0f, 1f, match.rating, 1f, (currentMatchIndex < matches.Count ? new UnityAction(ProcessNextMatch) : new UnityAction(FinishedRunningEvent))); }
public void Update(WrestlingMatch wrestlingMatch) { Results.Add(wrestlingMatch); }
void MakeNewMatch() { match = new WrestlingMatch(); wrestlersDialog = gameManager.GetGUIManager().InstantiateSinglesMatchDialog(); wrestlersDialog.Initialize("Wrestlers", GetAvailableWrestlers(), GetAvailableWrestlers(), new UnityAction(OnWrestlersPicked)); }