Beispiel #1
0
    public void BeginCampaign(string balanceName)
    {
        gameBalance = Resources.Load <GameBalance>(balanceName);
        Debug.Assert(gameBalance != null);

        playerStats = gameObject.AddComponent <VesselStats>();
        playerStats.SetStats(new VesselStatValues());

        playerStatus = gameObject.AddComponent <VesselStatus>();
        //playerStatus.InitialiseFull(gameBalance, playerStats);

        encounter = null;

        state         = State.None;
        nextEncounter = 0;

        state = State.InitialStats;
        int remainingPoints = gameBalance.initialStatPoints;

        while (remainingPoints > 0)
        {
            int statCount = System.Enum.GetValues(typeof(VesselStats.Type)).Length;
            for (int i = 0; remainingPoints > 0 && i < statCount; ++i)
            {
                playerStats.SetRaw((VesselStats.Type)i, playerStats.GetRaw((VesselStats.Type)i) + 1);
                --remainingPoints;
            }
        }
        Game.Instance.pageManager.SetPage("InitialStats");
    }
Beispiel #2
0
    private void InitialiseOpponentStats()
    {
        // don't modify asset's stats array
        var stats = descriptor.enemyStats.Clone();

        // apply
        opponentStats.SetStats(stats);
    }