// Update is called once per frame
    void Update()         // AudioSource Sm=gameObject.GetComponent<AudioSource>();
    {
        Mercy      Mer = MercyMove.GetComponent <Mercy>();
        Act        Ac  = ActMove.GetComponent <Act> ();
        Item       Ite = ItemMove.GetComponent <Item> ();
        Fight      Fig = FightMove.GetComponent <Fight> ();
        BattleExit BE  = TextBox.GetComponent <BattleExit> ();

        MouseFunc();
        Quitting();


        if (Mer.OnMercyMenu == false && Ite.OnItemMenu == false && Ac.OnActMenuNmb == 0 && Fig.OnFightMenu == false)
        {
            if (BE.InBattle == false)
            {
                if (EventSystem.current.currentSelectedGameObject == null)
                {
                    EventSystem.current.SetSelectedGameObject(lastselect);
                }
                else
                {
                    lastselect = EventSystem.current.currentSelectedGameObject;
                }
            }
        }
    }
Exemplo n.º 2
0
    public void MercyMove()
    {
        Mercy       MercyScript = MercyMoveScript.GetComponent <Mercy> ();
        GameObject  item        = GameObject.Find("ItemMove");
        Item        IScript     = item.GetComponent <Item> ();
        GameObject  act         = GameObject.Find("ActMove");
        Act         Script      = act.GetComponent <Act> ();
        BattleFight BF          = AtkDamage.GetComponent <BattleFight> ();
        Attacks     Attack      = Attacks.GetComponent <Attacks> ();

        if (Spareable)
        {
            MercyScript.MercyTxt.color = yellow;
        }


        if (MercyScript.OnMercyMenu)
        {
            if (Input.GetAxisRaw("Cancel") == 1)
            {
                gameObject.transform.position = Mercy1.transform.position;
                Mercy1.enabled      = true;
                Mercy1.interactable = true;
                MercyTxt.enabled    = false;
                Mercy1.Select();
                MainMenuTxt Main = GetComponent <MainMenuTxt> ();
                Main.MainMenTxt();
                MercyScript.OnMercyMenu = false;
                Script.OnActMenuNmb     = 0;
                IScript.OnItemMenu      = false;
            }

            if (Input.GetAxisRaw("Submit") == 1)
            {
                if (IScript.NOfClicks > 1)
                {
                    if (Spareable == false)
                    {
                        Attack.CancelSpawn           = false;
                        MercyScript.MercyTxt.enabled = false;
                        Mercy1.enabled          = true;
                        Mercy1.enabled          = false;
                        Mercy1.interactable     = false;
                        MercyScript.OnMercyMenu = false;
                        BF.enabled        = true;
                        BF.enabled        = false;                 //Battle Fight works on Enable
                        IScript.NOfClicks = 1;
                    }
                    else if (Spareable)
                    {
                        FadeToBlackAnim.Play("FadeToBlack");
                    }
                }
            }
        }
    }
Exemplo n.º 3
0
        public void SelectsAUniqueMercyFromAvailableLevelAndAddsToMerciesAbility()
        {
            var mercies = new Mercy[] {
                new Mercy("Mercy 1", 3),
                new Mercy("Mercy 2", 3),
                new Mercy("Mercy 3", 6),
                new Mercy("Mercy 4", 6)
            };
            var character = CharacterTestTemplates.Paladin();

            character.SetLevel(5);

            var process = new SelectMercy(EntityGateway <Mercy> .LoadFromList(mercies));

            process.ExecuteStep(character);
            process.ExecuteStep(character);
            var selected = character.Get <Mercies>();

            Assert.Equal(selected.MercyList.Count, 2);
            Assert.Equal(selected.MercyList[0].Level, 3);
            Assert.Equal(selected.MercyList[1].Level, 3);
            Assert.NotEqual(selected.MercyList[0].Name, selected.MercyList[1].Name);
        }
Exemplo n.º 4
0
    public void FightMove()
    {
        Fight          FightScript = FightMoveScript.GetComponent <Fight> ();
        Mercy          MercyScript = MercyMoveScript.GetComponent <Mercy> ();
        FightBar       FightB      = FightBar.GetComponent <FightBar> ();
        SpriteRenderer spr         = FightBar.GetComponent <SpriteRenderer> ();
        HitSound       Hs          = Attack_0.GetComponent <HitSound> ();
        BattleFight    Bf          = AtkDamage.GetComponent <BattleFight> ();
        GameObject     item        = GameObject.Find("ItemMove");
        Item           IScript     = item.GetComponent <Item> ();
        GameObject     act         = GameObject.Find("ActMove");
        Act            Script      = act.GetComponent <Act> ();

        Attacks Attack = Attacks.GetComponent <Attacks> ();

        Animator AtkDamageAnim = AtkDamage.GetComponent <Animator> ();
        Animator BgAnim        = FightBg.GetComponent <Animator> ();

        if (Input.GetAxisRaw("Cancel") == 1)
        {
            if (FightScript.OnFightMenu)
            {
                gameObject.transform.position = Fight1.transform.position;
                Fight1.enabled      = true;
                Fight1.interactable = true;

                Fight1.Select();
                MainMenuTxt Main = GetComponent <MainMenuTxt> ();
                Main.MainMenTxt();
                FightScript.OnFightMenu        = false;
                Script.OnActMenuNmb            = 0;
                IScript.OnItemMenu             = false;
                xFight.enabled                 = false;
                FightName.enabled              = false;
                HealthBar_Enemy.enabled        = false;
                HealthBarDamaged_Enemy.enabled = false;
            }
        }

        if (Input.GetAxisRaw("Submit") == 1)
        {
            if (IScript.NOfClicks > 1)
            {
                if (FightScript.OnFightMenu)
                {
                    Attack.CancelSpawn             = false;
                    xFight.enabled                 = false;
                    FightName.enabled              = false;
                    HealthBar_Enemy.enabled        = false;
                    HealthBarDamaged_Enemy.enabled = false;
                    PressFx.Play();
                    gameObject.SetActive(false);
                    Fight1.enabled          = true;
                    Fight1.enabled          = false;
                    spr.enabled             = true;
                    Attacking               = true;
                    IScript.NOfClicks       = 1;
                    FightB.IsMoving         = true;
                    FightScript.OnFightMenu = false;
                    Hs.enabled              = false;
                    Bf.enabled              = false;
                    BgAnim.enabled          = true;
                    FightBg.enabled         = true;
                }
            }
        }
    }