Ejemplo n.º 1
0
    public void AddEvent(WrestlingEvent wrestlingEvent)
    {
        float oldPopularity = this.Popularity;

        eventHistory.Insert(0, wrestlingEvent.AsHistoricalEvent());
        float newPopularity = this.Popularity;

        if (newPopularity >= oldPopularity)
        {
            AttemptToUnlockVenue();
        }
        Save(this, SavedGameManager.Instance.CurrentGameID);
    }
Ejemplo n.º 2
0
    public override void OnEnter(GameManager gameManager)
    {
        WrestlingEvent currentEvent = gameManager.GetCurrentEvent();

        if (canSellTickets && waitTime > 0 && currentEvent.EventVenue != null)
        {
            float ticketsSold = currentEvent.EventInterest * currentEvent.EventVenue.capacity;
            Debug.Log(string.Format("Tickets: {0} x {1} = {2}", currentEvent.EventInterest, currentEvent.EventVenue.capacity, ticketsSold));
            ticketsPerSecond = ticketsSold / waitTime;
        }
        else
        {
            ticketsPerSecond = 0;
        }
    }
Ejemplo n.º 3
0
    public override void OnEnter(GameManager gameManager)
    {
        this.gameManager = gameManager;
        matches          = gameManager.GetCurrentEvent().matches;
        currentEvent     = gameManager.GetCurrentEvent();

        if (matches.Count > 0)
        {
            ProcessNextMatch();
        }
        else
        {
            Debug.LogError("Unable to run event: There are no matches set.");
            FinishedRunningEvent();
        }
    }
    public void UpdateEventStatus(WrestlingEvent wrestlingEvent)
    {
        eventName.text        = wrestlingEvent.eventName;
        ticketsSoldCount.text = (wrestlingEvent.TicketsSold >= 0 && wrestlingEvent.EventVenue != null ? string.Format("{0} / {1}", wrestlingEvent.TicketsSold.ToString(), wrestlingEvent.EventVenue.capacity) : "0");
        revenue.text          = string.Format("${0}", Mathf.Round(wrestlingEvent.revenue));

        if (wrestlingEvent.EventVenue != null)
        {
            ticketsSoldProgress.minValue = 0;
            ticketsSoldProgress.maxValue = wrestlingEvent.EventVenue.capacity;
            ticketsSoldProgress.value    = wrestlingEvent.TicketsSold;
        }
        else
        {
            ticketsSoldProgress.value = 0;
        }
    }
    // Event creation callbacks
    void CreateNewEvent()
    {
        if (currentEvent != null)
        {
            GameObject.Destroy(currentEvent.gameObject);
        }

        currentEvent = Instantiate(wrestlingEventPrefab) as WrestlingEvent;
        GetGUIManager().GetStatusPanel().UpdateEventStatus(currentEvent);

        GameState startState = StateMachine.FindState("ChooseEventTypeGameState");

        startState.SetTransition("EventTypeChosen", OnFinishedEventCreationStep);
        startState.SetTransition("NoEventsAvailable", OnCancelEventCreate);
        startState.SetTransition("Cancel", OnCancelEventCreate);
        StateMachine.PushState(startState);
    }
Ejemplo n.º 6
0
    void OnMatchPicked()
    {
        WrestlingEvent currentEvent = gameManager.GetCurrentEvent();

        currentEvent.matches.Add(match);

        gameManager.OnWrestlingEventUpdated();

        InfoDialog makeAnotherDialog = gameManager.GetGUIManager().InstantiateInfoDialog();

        if (wrestlers.Count - usedWrestlers.Count >= 2)
        {
            makeAnotherDialog.Initialize("Add another match?", "Would you like to add another match?", new UnityAction(MakeNewMatch), true, new UnityAction(DoneWithMatches), "Yes", "No");
        }
        else
        {
            makeAnotherDialog.Initialize("Card finished", "All your wrestlers have a spot on the card, great job!", new UnityAction(DoneWithMatches));
        }
    }
    public override void OnEnter(GameManager gameManager)
    {
        WrestlingEvent wrestlingEvent = gameManager.GetCurrentEvent();

        float ticketRevenue = wrestlingEvent.ticketPrice * wrestlingEvent.TicketsSold;
        float merchSales    = 0f;
        float ppvSales      = 0f;
        float tvAdSales     = 0f;

        float venueCost     = wrestlingEvent.EventVenue.GetVenueCost(wrestlingEvent);
        float eventTypeCost = wrestlingEvent.Type.cost;
        float talentCost    = 0.0f;

        // Calculate per match / per wrestler costs and revenue.
        foreach (WrestlingMatch match in wrestlingEvent.matches)
        {
            foreach (WrestlingTeam team in match.teams)
            {
                foreach (Wrestler wrestler in team.wrestlers)
                {
                    talentCost += wrestler.perMatchCost;

                    // @TODO Calculate merch sales.

                    wrestler.AddUsedMatchType(match.type);
                    wrestler.AddUsedMatchFinish(match.finish);
                }
            }

            // @TODO Calculate ad revenue.

            wrestlingEvent.EventVenue.AddSeenMatchType(match.type);
            wrestlingEvent.EventVenue.AddSeenMatchFinish(match.finish);
        }

        // @TODO Calculate PPV revenue.

        float eventRevenue = ticketRevenue + merchSales + tvAdSales + ppvSales;
        float eventCosts   = venueCost + eventTypeCost + talentCost;

        wrestlingEvent.revenue = eventRevenue - eventCosts;
        gameManager.OnWrestlingEventUpdated();

        gameManager.GetPlayerCompany().money += wrestlingEvent.revenue;
        gameManager.GetPlayerCompany().AddEvent(wrestlingEvent);
        gameManager.OnCompanyUpdated();

        InfoDialog dialog     = gameManager.GetGUIManager().InstantiateInfoDialog();
        string     reportText = string.Format("{0} tickets @ ${1} = ${2}\n{3} buys = ${4}\n\n{5} costs: -${6}\nVenue: -${7}\nTalent: -${8}\n\nTotal profit: ${9}\n\nOverall rating: {10} / 10",
                                              wrestlingEvent.TicketsSold,
                                              wrestlingEvent.ticketPrice,
                                              ticketRevenue,
                                              wrestlingEvent.Type.typeName,
                                              (tvAdSales > 0 ? tvAdSales : ppvSales),
                                              wrestlingEvent.Type.typeName,
                                              eventTypeCost,
                                              Mathf.RoundToInt(venueCost),
                                              talentCost,
                                              Mathf.RoundToInt(wrestlingEvent.revenue),
                                              Mathf.RoundToInt(wrestlingEvent.Rating * 10.0f)
                                              );

        dialog.Initialize(string.Format("Event Report: {0}", wrestlingEvent.eventName), reportText, new UnityAction(OnAcknowledgeReport));
    }
Ejemplo n.º 8
0
 public float GetVenueCost(WrestlingEvent wrestlingEvent)
 {
     return(wrestlingEvent.TicketsSold * gatePercentage + baseCost);
 }