public override void Draw()
        {
            base.Draw();

            if (BattleManager.Instance.ShouldShowPlayerTurnUI == true)
            {
                int showHP = EntityProperties.GetAdditionalProperty <int>(Enumerations.AdditionalProperty.ShowHP);

                if (showHP > 0)
                {
                    //Show HP
                    SpriteRenderer.Instance.DrawText(AssetManager.Instance.TTYDFont, $"{CurHP}/{BattleStats.MaxHP}", Position + new Vector2(0, 40), Color.White, .2f, false);
                }
            }
        }
예제 #2
0
        public override void OnTurnStart()
        {
            base.OnTurnStart();

            AnimManager.PlayAnimation(AnimationGlobals.PlayerBattleAnimations.ChoosingActionName);

            int itemTurns = EntityProperties.GetAdditionalProperty <int>(Enumerations.AdditionalProperty.DipItemTurns);

            if (itemTurns > 0)
            {
                BattleUIManager.Instance.PushMenu(new ItemSubMenu(1, 0, true));
            }
            else
            {
                BattleUIManager.Instance.PushMenu(GetMainBattleMenu());
            }
        }
예제 #3
0
        private void UnFlip()
        {
            Flipped = false;
            AnimManager.PlayAnimation(GetIdleAnim(), true);

            int immobile = EntityProperties.GetAdditionalProperty <int>(Enumerations.AdditionalProperty.Immobile) - 1;

            EntityProperties.RemoveAdditionalProperty(Enumerations.AdditionalProperty.Immobile);
            if (immobile > 0)
            {
                EntityProperties.AddAdditionalProperty(Enumerations.AdditionalProperty.Immobile, immobile);
            }

            //Raise defense again after unflipping
            RaiseDefense(DefenseLoss);

            ElapsedFlippedTurns = 0;
        }
예제 #4
0
        public void HandleFlipped()
        {
            if (Flipped == false)
            {
                int immobile = EntityProperties.GetAdditionalProperty <int>(Enumerations.AdditionalProperty.Immobile) + 1;
                EntityProperties.AddAdditionalProperty(Enumerations.AdditionalProperty.Immobile, immobile);

                //Lower defense by an amount when flipped
                LowerDefense(DefenseLoss);
            }

            Flipped = true;

            //Don't play this animation if dead
            if (IsDead == false)
            {
                BattleEventManager.Instance.QueueBattleEvent((int)BattleGlobals.StartEventPriorities.Damage - 2,
                                                             new BattleManager.BattleState[] { BattleManager.BattleState.Turn, BattleManager.BattleState.TurnEnd },
                                                             new PlayAnimBattleEvent(this, GetIdleAnim(), false));
            }

            //Getting hit again while flipped refreshes the flip timer
            ElapsedFlippedTurns = 0;
        }
예제 #5
0
        public override void OnTurnStart()
        {
            base.OnTurnStart();

            if (IsInDanger == true || EntityProperties.HasStatus(StatusTypes.Poison) == true)
            {
                AnimManager.PlayAnimation(AnimationGlobals.PlayerBattleAnimations.DangerChoosingActionName);
            }
            else
            {
                AnimManager.PlayAnimation(AnimationGlobals.PlayerBattleAnimations.ChoosingActionName);
            }

            int itemTurns = EntityProperties.GetAdditionalProperty <int>(Enumerations.AdditionalProperty.DipItemTurns);

            if (itemTurns > 0)
            {
                BManager.battleUIManager.PushMenu(new ItemSubMenu(this, 1, 0, true));
            }
            else
            {
                BManager.battleUIManager.PushMenu(GetMainBattleMenu());
            }
        }