Ejemplo n.º 1
0
 // Called when the pilot level goes up
 public void HandleLevelUp()
 {
     // update stats and recover shields
     mStats      = GameManager.Instance.Progress.CurPilotStats;
     mShieldLeft = mStats.ShieldPoints;
     UpdateShield();
     UpdateAim();
     UnlockRankBasedAchievements();
 }
    int mFingerId = -1; // the ID of the finger that's steering

    void Start() {
        mLevelController = LevelController.GetComponent<LevelController>();
        mStats = GameManager.Instance.Progress.CurPilotStats;
        mShieldLeft = mStats.ShieldPoints;
        mFireCountdown = new Countdown(false, mStats.FireCooldown);
        UpdateAim();
        UpdateShield();
        UnlockRankBasedAchievements();
    }
 // Called when the pilot level goes up
 public void HandleLevelUp()
 {
     // update stats and recover shields
     mStats = GameManager.Instance.Progress.CurPilotStats;
     mShieldLeft = mStats.ShieldPoints;
     UpdateShield();
     UpdateAim();
     UnlockRankBasedAchievements();
 }
Ejemplo n.º 4
0
    int mFingerId     = -1; // the ID of the finger that's steering

    void Start()
    {
        mLevelController = LevelController.GetComponent <LevelController>();
        mStats           = GameManager.Instance.Progress.CurPilotStats;
        mShieldLeft      = mStats.ShieldPoints;
        mFireCountdown   = new Countdown(false, mStats.FireCooldown);
        UpdateAim();
        UpdateShield();
        UnlockRankBasedAchievements();
    }
 public GameProgress () {
     mProgress = new LevelProgress[LevelCount];
     int i;
     for (i = 0; i < LevelCount; i++) {
         mProgress[i] = new LevelProgress();
     }
     for (i = 0; i < LevelCount; i++) {
         mPilotStats[i] = new PilotStats(i);
     }
 }
Ejemplo n.º 6
0
    public void DrawPilotInfo()
    {
        Gu.SetColor(Color.black);
        PilotStats stats    = GameManager.Instance.Progress.CurPilotStats;
        float      fontSize = SmallFormat ? GameConsts.Menu.PilotInfoFontSizeSmall :
                              GameConsts.Menu.PilotInfoFontSize;
        float y = SmallFormat ? GameConsts.Menu.PilotInfoYSmallFont :
                  GameConsts.Menu.PilotInfoY;

        // show summary info
        string summary;

        if (GameManager.Instance.Progress.IsMaxLevel())
        {
            summary = string.Format(Strings.ExpStringMaxLevel,
                                    stats.Level, stats.Title,
                                    GameManager.Instance.Progress.PilotExperience);
        }
        else
        {
            summary = string.Format(Strings.ExpString,
                                    stats.Level, stats.Title,
                                    GameManager.Instance.Progress.PilotExperience,
                                    GameManager.Instance.Progress.GetExpForNextLevel());
        }

        if (ShowPilotLevel)
        {
            Gu.Label(Gu.Left(GameConsts.Menu.PilotInfoX),
                     Gu.Top(y), Gu.Dim(fontSize),
                     summary, false);
        }

        if (!SmallFormat)
        {
            int total = GameManager.Instance.Progress.TotalScore;
            int stars = GameManager.Instance.Progress.TotalStars;
            Gu.Label(Gu.Right(GameConsts.Menu.TotalScoreLabelX),
                     Gu.Top(GameConsts.Menu.TotalScoreLabelY),
                     Gu.Dim(GameConsts.Menu.TotalScoreLabelFontSize),
                     Strings.TotalScore);
            Gu.Label(Gu.Right(GameConsts.Menu.TotalScoreX),
                     Gu.Top(GameConsts.Menu.TotalScoreY),
                     Gu.Dim(GameConsts.Menu.TotalScoreFontSize),
                     total.ToString("D7"));
            Gu.Label(Gu.Right(GameConsts.Menu.StarsX),
                     Gu.Top(GameConsts.Menu.StarsY),
                     Gu.Dim(GameConsts.Menu.StarsFontSize),
                     string.Format(Strings.TotalStarsFmt, stars));
        }
    }
Ejemplo n.º 7
0
    public GameProgress()
    {
        mProgress = new LevelProgress[LevelCount];
        int i;

        for (i = 0; i < LevelCount; i++)
        {
            mProgress[i] = new LevelProgress();
        }
        for (i = 0; i < LevelCount; i++)
        {
            mPilotStats[i] = new PilotStats(i);
        }
    }
Ejemplo n.º 8
0
        private void BuildAndDisplaySquadForm(string squadName, Squad squad)
        {
            Registry.RemovePilot(squadName);

            var startTour            = squad.GetMinTour(squad);
            var endTour              = squad.GetMaxTour(squad);
            var inException          = false;
            var reloadPilotsRequired = false;

            try
            {
                Registry.GetSquad(squadName).CheckSquadInSync(startTour, endTour);

                var squadBuilder = ServiceLocator.Instance.Resolve <SquadScoreStatsBuilder>();
                for (var tour = startTour; tour <= endTour; tour++)
                {
                    var score = squadBuilder.BuildSquadScoreObject(squad, tour);
                    if (score.TourDetails.Contains("[NO DATA]"))
                    {
                        continue;
                    }

                    var stats         = squadBuilder.BuildSquadStatsObject(squad, tour, ref reloadPilotsRequired);
                    var squadStatsReg = new PilotStats();
                    Registry.AddPilotStatsToRegistry(squadName, squadStatsReg);
                    Registry.ConstructScoresForPilot(score, squadName);
                    Registry.ConstructStatsForPilot(stats, squadName);
                }
            }
            catch (SquadOutOfSyncException ex)
            {
                MessageBox.Show(ex.Text, "Squad out of sync error");
                inException = true;
            }
            catch (SquadDoesNotExistInRegistryException squadEx)
            {
                MessageBox.Show(squadEx.Text, "Squad loading error");
                inException = true;
            }

            if (FindAndDisplayStatsWindow(squadName) || inException)
            {
                return;
            }

            var form = BuildPilotStatsForm(squadName, true);

            form.CompositeObjVsObjDataIncomplete = reloadPilotsRequired;
            form.Show();
        }