Example #1
0
        public override void Enter()
        {
            Pax4ParticleEffect._current.Enable();

            _currentMissionState = this;

            _scoreSpriteModifier.Ini(0.0f, 0.0f, true, 0.0f);

            if (Pax4WorldLavaAndIce._missionIndex > 0)
            {
                String highScoreName = Pax4UiStateLavaAndIceChooseQuest._questName + "_" + Pax4WorldLavaAndIce._missionIndex + "_HighScore";
                ((Pax4SpriteText)_highScoreSprite).SetText(Pax4Tools.NumberCommaFormat(Pax4UiLavaAndIceQuestScore._score[highScoreName]));
            }

            base.Enter();
        }
        public void UpdateScore()
        {
            if (Pax4WorldLavaAndIce._missionIndex <= 0)
            {
                return;
            }

            String totalScoreName     = Pax4UiStateLavaAndIceChooseQuest._questName + "_TotalScore";
            String lastScoreQuestName = Pax4UiStateLavaAndIceChooseQuest._questName + "_LastScore";

            String highScoreName = Pax4UiStateLavaAndIceChooseQuest._questName + "_" + Pax4WorldLavaAndIce._missionIndex + "_HighScore";
            String lastScoreName = Pax4UiStateLavaAndIceChooseQuest._questName + "_" + Pax4WorldLavaAndIce._missionIndex + "_LastScore";

            String lavaKillsName    = Pax4UiStateLavaAndIceChooseQuest._questName + "_LavaKills";
            String iceKillsName     = Pax4UiStateLavaAndIceChooseQuest._questName + "_IceKills";
            String monsterKillsName = Pax4UiStateLavaAndIceChooseQuest._questName + "_MonsterKills";

            int currentScore = ((Pax4WorldLavaAndIce)Pax4World._current)._score;

            int totalScore = Pax4UiLavaAndIceQuestScore._score[totalScoreName];

            Pax4UiLavaAndIceQuestScore._score[totalScoreName] += currentScore;

            Pax4UiLavaAndIceQuestScore._score[lastScoreQuestName] = currentScore;
            Pax4UiLavaAndIceQuestScore._score[lastScoreName]      = currentScore;

            int highScore = Pax4UiLavaAndIceQuestScore._score[highScoreName];

            if (currentScore > highScore)
            {
                Pax4UiLavaAndIceQuestScore._score[highScoreName] = currentScore;
            }

            if (Pax4WorldLavaAndIce._difficulty == Pax4WorldLavaAndIce._difficultyNightmare)
            {
                Pax4UiLavaAndIceQuestScore._score[Pax4UiStateLavaAndIceChooseQuest._questName + "_NightmareMedalCount"]++;
                Pax4UiLavaAndIceQuestScore._score[Pax4UiStateLavaAndIceChooseQuest._questName + "_" + Pax4WorldLavaAndIce._missionIndex + "_NightmareMedalCount"]++;
            }
            else if (Pax4WorldLavaAndIce._difficulty == Pax4WorldLavaAndIce._difficultyHard)
            {
                Pax4UiLavaAndIceQuestScore._score[Pax4UiStateLavaAndIceChooseQuest._questName + "_HardMedalCount"]++;
                Pax4UiLavaAndIceQuestScore._score[Pax4UiStateLavaAndIceChooseQuest._questName + "_" + Pax4WorldLavaAndIce._missionIndex + "_HardMedalCount"]++;
            }
            else if (Pax4WorldLavaAndIce._difficulty == Pax4WorldLavaAndIce._difficultyNormal)
            {
                Pax4UiLavaAndIceQuestScore._score[Pax4UiStateLavaAndIceChooseQuest._questName + "_NormalMedalCount"]++;
                Pax4UiLavaAndIceQuestScore._score[Pax4UiStateLavaAndIceChooseQuest._questName + "_" + Pax4WorldLavaAndIce._missionIndex + "_NormalMedalCount"]++;
            }
            else if (Pax4WorldLavaAndIce._difficulty == Pax4WorldLavaAndIce._difficultyEasy)
            {
                Pax4UiLavaAndIceQuestScore._score[Pax4UiStateLavaAndIceChooseQuest._questName + "_EasyMedalCount"]++;
                Pax4UiLavaAndIceQuestScore._score[Pax4UiStateLavaAndIceChooseQuest._questName + "_" + Pax4WorldLavaAndIce._missionIndex + "_EasyMedalCount"]++;
            }

            Pax4UiLavaAndIceQuestScore._score[lavaKillsName]    += ((Pax4WorldLavaAndIce)Pax4World._current)._lavaKills;
            Pax4UiLavaAndIceQuestScore._score[iceKillsName]     += ((Pax4WorldLavaAndIce)Pax4World._current)._iceKills;
            Pax4UiLavaAndIceQuestScore._score[monsterKillsName] += ((Pax4WorldLavaAndIce)Pax4World._current)._monsterKills;

            Pax4UiLavaAndIceQuestScore._score[Pax4UiStateLavaAndIceChooseQuest._questName + "_" + (Pax4WorldLavaAndIce._missionIndex + 1).ToString() + "_Locked"] = 0;

            Pax4UiLavaAndIceQuestScore._currentScore.Write();

            _currentScoreModifier.Ini(currentScore, 0.0f, true, 5.0f);
            _currentScoreModifier.Trigger();
            _totalScoreModifier.Ini(totalScore, totalScore + currentScore, true, 5.0f);
            _totalScoreModifier.Trigger();
        }