Exemplo n.º 1
0
 public override void Draw(Camera2D camera)
 {
     if (State == 0)
     {
         ChestConditionChecker.SetConditionState(this, m_player);
     }
     if (!IsOpen)
     {
         if (Game.ScreenManager.CurrentScreen is ProceduralLevelScreen && m_sparkleCounter > 0f)
         {
             m_sparkleCounter -= (float)camera.GameTime.ElapsedGameTime.TotalSeconds;
             if (m_sparkleCounter <= 0f)
             {
                 m_sparkleCounter = 1f;
                 var num = 0f;
                 for (var i = 0; i < 2; i++)
                 {
                     Tween.To(this, num, Linear.EaseNone);
                     Tween.AddEndHandlerToLastTween(m_player.AttachedLevel.ImpactEffectPool,
                                                    "DisplayChestSparkleEffect", new Vector2(X, Y - Height / 2));
                     num += 0.5f;
                 }
             }
         }
         if (ConditionType == 8 && State == 0)
         {
             if (!m_player.AttachedLevel.IsPaused)
             {
                 Timer -= (float)camera.GameTime.ElapsedGameTime.TotalSeconds;
             }
             m_timerText.Position = new Vector2(Position.X, Y - 50f);
             m_timerText.Text     = ((int)Timer + 1).ToString();
             m_timerText.Draw(camera);
             m_player.AttachedLevel.UpdateObjectiveProgress(
                 (DialogueManager.GetText("Chest_Locked " + ConditionType).Dialogue[0] + (int)(Timer + 1f)));
         }
     }
     if (ConditionType != 10 || IsOpen)
     {
         base.Draw(camera);
         m_lockSprite.Flip = Flip;
         if (Flip == SpriteEffects.None)
         {
             m_lockSprite.Position = new Vector2(X - 10f, Y - Height / 2);
         }
         else
         {
             m_lockSprite.Position = new Vector2(X + 10f, Y - Height / 2);
         }
         m_lockSprite.Draw(camera);
         m_errorSprite.Position = new Vector2(X, Y - Height / 2);
         m_errorSprite.Draw(camera);
     }
 }
Exemplo n.º 2
0
        public void SetDialogueChoice(string dialogueObjName)
        {
            var text = DialogueManager.GetText(dialogueObjName);

            (m_dialogChoiceContainer.GetChildAt(2) as TextObj).Text = text.Speakers[0];
            (m_dialogChoiceContainer.GetChildAt(3) as TextObj).Text = text.Dialogue[0];
            if (Game.PlayerStats.Traits.X == 5f || Game.PlayerStats.Traits.Y == 5f)
            {
                (m_dialogChoiceContainer.GetChildAt(2) as TextObj).RandomizeSentence(false);
                (m_dialogChoiceContainer.GetChildAt(3) as TextObj).RandomizeSentence(false);
            }
            m_runChoiceDialogue = true;
        }
Exemplo n.º 3
0
        public override void OnEnter()
        {
            m_inputDelayTimer = 0.5f;
            SoundManager.PlaySound("DialogOpen");
            m_lockControls                          = false;
            m_runCancelEndHandler                   = false;
            m_highlightedChoice                     = 2;
            m_dialogChoiceContainer.Scale           = new Vector2(1f, 1f);
            m_dialogChoiceContainer.GetChildAt(1).Y = m_dialogChoiceContainer.GetChildAt(m_highlightedChoice).Y +
                                                      m_dialogChoiceContainer.GetChildAt(1).Height / 2 + 3f;
            m_dialogChoiceContainer.Scale = Vector2.Zero;
            var text      = DialogueManager.GetText(m_dialogueObjName);
            var speakers  = text.Speakers;
            var dialogue  = text.Dialogue;
            var spriteObj = m_dialogContainer.GetChildAt(3) as SpriteObj;

            if (dialogue.Length > 1)
            {
                spriteObj.ChangeSprite("ContinueTextIcon_Sprite");
            }
            else
            {
                spriteObj.ChangeSprite("EndTextIcon_Sprite");
            }
            m_dialogCounter           = 0;
            m_dialogTitles            = speakers;
            m_dialogText              = dialogue;
            m_dialogContainer.Scale   = Vector2.One;
            m_dialogContainer.Opacity = 0f;
            (m_dialogContainer.GetChildAt(2) as TextObj).Text = dialogue[m_dialogCounter];
            (m_dialogContainer.GetChildAt(2) as TextObj).WordWrap(850);
            (m_dialogContainer.GetChildAt(1) as TextObj).Text = speakers[m_dialogCounter];
            if (Game.PlayerStats.Traits.X == 5f || Game.PlayerStats.Traits.Y == 5f)
            {
                (m_dialogContainer.GetChildAt(2) as TextObj).RandomizeSentence(false);
                (m_dialogContainer.GetChildAt(1) as TextObj).RandomizeSentence(false);
            }
            (m_dialogContainer.GetChildAt(2) as TextObj).BeginTypeWriting(
                dialogue[m_dialogCounter].Length * m_textScrollSpeed, "dialogue_tap");
            Tween.To(m_dialogContainer, 0.3f, Quad.EaseInOut, "Opacity", "1", "Y", "150");
            Tween.To(this, 0.3f, Linear.EaseNone, "BackBufferOpacity", "0.5");
            base.OnEnter();
        }
Exemplo n.º 4
0
        public void DisplayFairyChestInfo()
        {
            FairyChestObj fairyChestObj = null;

            foreach (var current in GameObjList)
            {
                if (current is FairyChestObj)
                {
                    fairyChestObj = (current as FairyChestObj);
                }
                var arg_2D_0 = current as WaypointObj;
            }
            if (fairyChestObj != null && !fairyChestObj.IsOpen && fairyChestObj.ConditionType != 0 &&
                fairyChestObj.ConditionType != 10 && fairyChestObj.State != 1)
            {
                Player.AttachedLevel.DisplayObjective("Fairy Chest Objective",
                                                      DialogueManager.GetText("Chest_Locked " + fairyChestObj.ConditionType).Speakers[0],
                                                      DialogueManager.GetText("Chest_Locked " + fairyChestObj.ConditionType).Dialogue[0], true);
                return;
            }
            m_fairyChestText.Text = "";
        }