Esempio n. 1
0
        public override void EndInput()
        {
            base.EndInput();

            ElapsedTime = 0d;

            //Clean up any remaining stars
            for (int i = 0; i < StarsThrown.Count; i++)
            {
                StarsThrown.RemoveAt(i);
                i--;
            }

            IconSpawner.CleanUp();
            IconSpawner = null;

            HealingResponse = default(SweetTreatResponse);

            BUIManager = null;
        }
Esempio n. 2
0
        public override void StartInput(params object[] values)
        {
            base.StartInput(values);

            ElapsedTime = 0d;
            PrevThrow   = 0d;

            StartPosition = Camera.Instance.SpriteToUIPos((Vector2)values[0]);

            //Count how many BattleEntities are affected
            //If there's only one, then don't add any of the Partner information
            int entitiesAffected = (int)values[1];

            CursorAngle = MinCursorAngle;

            //Define the spawner
            Vector2 startPos = new Vector2(500, 15);
            Vector2 endPos   = new Vector2(startPos.X, BattleGlobals.PartnerPos.Y + 350f);

            RestoreTypes[] restoreTypes      = null;
            int[]          restoreTypeCounts = null;
            if (entitiesAffected <= 1)
            {
                restoreTypes      = new RestoreTypes[] { RestoreTypes.MarioHP, RestoreTypes.FP, RestoreTypes.PoisonMushroom };
                restoreTypeCounts = new int[] { 14, 6, 2 };
            }
            else
            {
                restoreTypes      = new RestoreTypes[] { RestoreTypes.MarioHP, RestoreTypes.PartnerHP, RestoreTypes.FP, RestoreTypes.PoisonMushroom };
                restoreTypeCounts = new int[] { 7, 7, 6, 2 };
            }

            IconSpawner = new SweetTreatElementSpawner(BUIManager, 4, 40f, 5000d, 750d, startPos, endPos, restoreTypes, restoreTypeCounts);

            HealingResponse = default(SweetTreatResponse);
        }
Esempio n. 3
0
        public override void EndInput()
        {
            base.EndInput();

            ElapsedTime = 0d;

            //Clean up any remaining stars
            for (int i = 0; i < StarsThrown.Count; i++)
            {
                BattleUIManager.Instance.RemoveUIElement(StarsThrown[i]);
                StarsThrown.RemoveAt(i);
                i--;
            }

            //Remove any UI we added
            BattleUIManager.Instance.RemoveUIElement(Cursor);
            BattleUIManager.Instance.RemoveUIElement(MarioHPIcon);
            BattleUIManager.Instance.RemoveUIElement(PartnerHPIcon);
            BattleUIManager.Instance.RemoveUIElement(FPIcon);
            BattleUIManager.Instance.RemoveUIElement(MarioHPText);
            BattleUIManager.Instance.RemoveUIElement(PartnerHPText);
            BattleUIManager.Instance.RemoveUIElement(FPText);

            Cursor = null;
            MarioHPIcon = null;
            PartnerHPIcon = null;
            FPIcon = null;
            MarioHPText = null;
            PartnerHPText = null;
            FPText = null;

            IconSpawner.CleanUp();
            IconSpawner = null;

            HealingResponse = default(SweetTreatResponse);
        }
Esempio n. 4
0
        public override void StartInput(params object[] values)
        {
            base.StartInput(values);

            ElapsedTime = 0d;
            PrevThrow = 0d;

            StartPosition = Camera.Instance.SpriteToUIPos((Vector2)values[0]);

            //Count how many BattleEntities are affected
            //If there's only one, then don't add any of the Partner information
            int entitiesAffected = (int)values[1];

            CursorAngle = MinCursorAngle;

            //Define the UI to display
            Texture2D battleGFX = AssetManager.Instance.LoadRawTexture2D($"{ContentGlobals.BattleGFX}.png");

            CroppedTexture2D croppedTex2D = new CroppedTexture2D(battleGFX, new Rectangle(14, 273, 46, 46));
            Cursor = new UIFourPiecedTex(croppedTex2D, croppedTex2D.WidthHeightToVector2(), .5f, Color.White);

            MarioHPIcon = new UICroppedTexture2D(new CroppedTexture2D(battleGFX, new Rectangle(324, 407, 61, 58)));
            FPIcon = new UICroppedTexture2D(new CroppedTexture2D(battleGFX, new Rectangle(179, 416, 40, 39)));

            MarioHPText = new UIText("0", Color.Black);
            FPText = new UIText("0", Color.Black);

            //Set UI properties
            MarioHPIcon.Position = MarioHPText.Position = StartPosition + new Vector2(-10, -45);
            FPIcon.Position = FPText.Position = StartPosition + new Vector2(-45, -95);

            MarioHPText.Position += new Vector2(0f, 10f);
            FPText.Position += new Vector2(0f, 10f);

            if (entitiesAffected > 1)
            {
                PartnerHPIcon = new UICroppedTexture2D(new CroppedTexture2D(battleGFX, new Rectangle(324, 407, 61, 58)));
                PartnerHPText = new UIText("0", Color.Black);

                PartnerHPIcon.Position = PartnerHPText.Position = StartPosition + new Vector2(-80, -45);
                PartnerHPText.Position += new Vector2(0f, 10f);
                PartnerHPIcon.Origin = PartnerHPText.Origin = new Vector2(.5f, .5f);
                PartnerHPIcon.Depth = .6f;
                PartnerHPText.Depth = .61f;
            }

            MarioHPIcon.Depth = FPIcon.Depth = .6f;
            MarioHPText.Depth = FPText.Depth = .61f;

            MarioHPIcon.Origin = FPIcon.Origin = MarioHPText.Origin = FPText.Origin = new Vector2(.5f, .5f);

            //Set cursor position
            Cursor.Position = UtilityGlobals.GetPointAroundCircle(new Circle(StartPosition, CircleRadius), CursorAngle, true);

            //Define the spawner
            Vector2 startPos = new Vector2(500, 15);
            Vector2 endPos = new Vector2(startPos.X, BattleManager.Instance.PartnerPos.Y + 350f);

            RestoreTypes[] restoreTypes = null;
            int[] restoreTypeCounts = null;
            if (entitiesAffected <= 1)
            {
                restoreTypes = new RestoreTypes[] { RestoreTypes.MarioHP, RestoreTypes.FP, RestoreTypes.PoisonMushroom };
                restoreTypeCounts = new int[] { 14, 6, 2 };
            }
            else
            {
                restoreTypes = new RestoreTypes[] { RestoreTypes.MarioHP, RestoreTypes.PartnerHP, RestoreTypes.FP, RestoreTypes.PoisonMushroom };
                restoreTypeCounts = new int[] { 7, 7, 6, 2 };
            }

            IconSpawner = new SweetTreatElementSpawner(4, 40f, 5000d, 750d, startPos, endPos, restoreTypes, restoreTypeCounts);

            //Add the cursor and other UI elements
            BattleUIManager.Instance.AddUIElement(Cursor);
            BattleUIManager.Instance.AddUIElement(MarioHPIcon);
            BattleUIManager.Instance.AddUIElement(FPIcon);
            BattleUIManager.Instance.AddUIElement(MarioHPText);
            BattleUIManager.Instance.AddUIElement(FPText);

            if (entitiesAffected > 1)
            {
                BattleUIManager.Instance.AddUIElement(PartnerHPIcon);
                BattleUIManager.Instance.AddUIElement(PartnerHPText);
            }

            HealingResponse = default(SweetTreatResponse);
        }