Beispiel #1
0
    void Update()
    {
        if (action != menuOptions.None)//execute the action by activating and deactivating the UIs
        {
            Atack.atacando = true;
            Atack.atack(action, atackScript.enemyCor, atackScript.cor);
            action = menuOptions.None;
        }

        if (atackScript.enemyCor.Ps <= 0 && contador <= 4)
        {
            BattleController.active = false;
            end1.SetActive(true);
            contador += Time.deltaTime;
        }
        if (atackScript.cor.Ps <= 0 && contador <= 4)
        {
            BattleController.active = false;
            //falta cambiar el pokemon y que te ataquen
            end2.SetActive(true);
            contador += Time.deltaTime;
        }
        if (contador > 4)
        {
            //Debug.Log("maaarmotaMediterranea");
            controllerCoremon.applyExpRewardExp(atackScript.cor, atackScript.enemyCor);
            SceneController.loadOverworld();
        }
        if (Atack.atacando)
        {
            action = menu.getActions();                   //Calling the menu controller to open the menu and get an action
        }
        //Do stuff according to the actions received
    }
Beispiel #2
0
 void TakePureDamage(Atack atack) // Чистый урон урон
 {
     Health -= atack.Damage * ((100 - Armor) / 100);
     if (Health <= 0)
     {
         Death();
     }
 }
Beispiel #3
0
 void TakePhysicalDamage(Atack atack) // Физический урон
 {
     Health -= atack.Damage * ((100 - Armor) / 100);
     if (Health <= 0)
     {
         Death();
     }
 }
Beispiel #4
0
 void TakeMagicDamage(Atack atack) // магический урон
 {
     Health -= atack.Damage * ((100 - Resist) / 100);
     if (Health <= 0)
     {
         Death();
     }
 }
Beispiel #5
0
 private void Start()
 {
     anim  = GetComponent <Animator>();
     atack = GetComponent <Atack>();
     //agent = GetComponent<NavMeshAgent>();
     agentCustom = GetComponent <MoveSimpleIA>();
     setListWayPoints();
 }
Beispiel #6
0
    void Start()
    {
        atackScript = GameObject.Find("Batalla").GetComponent <Atack>();

        at1Text = transform.GetChild(0).GetComponent <Text>();
        at2Text = transform.GetChild(1).GetComponent <Text>();
        at3Text = transform.GetChild(2).GetComponent <Text>();
        at4Text = transform.GetChild(3).GetComponent <Text>();
    }
Beispiel #7
0
 private void Start()
 {
     Time.timeScale = 1.0f;
     SetWeapon();
     weaponImage = GameObject.Find("WeaponSprite").GetComponent <Image>();
     atack       = GetComponentInChildren <Atack>();
     _stats      = GetComponent <PlayerStats>();
     _animator   = gameObject.GetComponent <Animator>();
 }
Beispiel #8
0
 private void Start()
 {
     menu              = gameObject.GetComponent <AtackController>(); //Initializing menu controller script
     atackScript       = transform.parent.gameObject.GetComponent <Atack>();
     controllerCoremon = GameObject.Find("Batalla").GetComponent <CoremonController>();
     end1.SetActive(false);
     end2.SetActive(false);
     contador = 0f;
 }
Beispiel #9
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        Creature creature = collision.GetComponent <Creature>();

        if (creature != null)
        {
            Atack atack = new Atack(Sender, creature, DamageType, dmg);
            creature.TakeDamage(atack);
        }
        Destroy(gameObject);
    }
    void Start()
    {
        textOp1 = transform.Find("Option1").gameObject;
        textOp2 = transform.Find("Option2").gameObject;

        pointer     = transform.Find("TeamPointerMaster").gameObject.GetComponent <TeamPointerMaster>();
        atackScript = GameObject.Find("Batalla").GetComponent <Atack>();

        menu = gameObject;

        setOptions();
    }
Beispiel #11
0
 public float MoveSpeed;             //
 //Методы со временем нужно расширить чтобы получать больше сведений от того кто наносит урон и урон какого типа.
 public void TakeDamage(Atack atack) // Определяям какой урон
 {
     if (atack.type == 1)
     {
         TakePureDamage(atack);
     }
     else
     {
         if (atack.type == 2)
         {
             TakePhysicalDamage(atack);
         }
         else
         {
             TakeMagicDamage(atack);
         }
     }
 }
Beispiel #12
0
    private void Awake()
    {
        Batalla     = GameObject.Find("Batalla");
        atackScript = Batalla.GetComponent <Atack>();
        controller  = Batalla.GetComponent <CoremonController>();

        cor        = transform.GetChild(0).gameObject;
        enemyCor   = transform.GetChild(1).gameObject;
        corUI      = transform.GetChild(2).gameObject;
        enemyCorUI = transform.GetChild(3).gameObject;

        corUIInfo      = corUI.GetComponent <CoremonUI>();
        enemtCorUIInfo = enemyCorUI.GetComponent <CoremonUI>();

        corScale = cor.GetComponent <RectTransform>().localScale;
        corScale = new Vector3(corScale.x * -1, corScale.y, corScale.z);
        cor.GetComponent <RectTransform>().localScale = corScale;
    }
Beispiel #13
0
 //Two_Hand weapon
 public Item(int id, string item_name, int cost, int Type, Sprite Sprite, Sprite Inventory_Sprite, float DMG, Atack atack, float Armor = 0, float Resist = 0, int Strength_bonus = 0, int Agility_bonus = 0, int Intelligence_bonus = 0, int Strength_require = 0, int Agility_require = 0, int Intelligence_require = 0)
 {
     this.Id                   = id;
     this.Item_name            = item_name;
     this.Cost                 = cost;
     this.Type                 = Type;
     this.Sprite               = Sprite;
     this.Armor                = Armor;
     this.Damage               = DMG;
     this.Resist               = Resist;
     this.Strength_bonus       = Strength_bonus;
     this.Agility_bonus        = Agility_bonus;
     this.Intelligence_bonus   = Intelligence_bonus;
     this.Strength_require     = Strength_require;
     this.Agility_require      = Agility_require;
     this.Intelligence_require = Intelligence_require;
     this.MaxStack             = 1;
     this.NowInStack           = 1;
     this.projectile           = null;
     this.Inventory_Sprite     = Inventory_Sprite;
     Main = atack;
 }
    IEnumerator Turnos()
    {
        esperando = true;
        yield return(new WaitForSeconds(2f - velocidade)); //dando um tempo

        if (phase == 1)                                    //heroi turn -------------------------------------------- 1

        {
            animLenhador.SetInteger("Walk", 1);
            animLenhador.SetInteger("Estado", 4);

            yield return(new WaitForSeconds(2f));             //tempo para andar

            animLenhador.SetInteger("Estado", 0);
            Atack.SetActive(true);
            presPermision = true;
            //print ("Click");

            yield return(new WaitForSeconds(2f - velocidade));             //verificação e tempo do QTE

            Atack.SetActive(false);

            if (presPos == true)
            {
                animLenhador.SetInteger("Estado", Random.Range(1, 3));
                vida_Lobo -= 1;
                animLobo.SetInteger("Estado", 5);
                Perder_Vida(ShowVidaLobo, vida_Lobo, 6);
                if (velocidade < 1.5f)
                {
                    velocidade += 0.3f;
                }
            }
            Reset_Press();

            yield return(new WaitForSeconds(2f));             //tempo animação de ataque

            animLenhador.SetInteger("Estado", 0);
            animLobo.SetInteger("Estado", 0);

            yield return(new WaitForSeconds(.5f));             //tempo do reset das anim

            animLenhador.SetInteger("Walk", 0);
            animLenhador.SetInteger("Estado", 4);
        }

        if (phase == 2)         //vilao turn -------------------------------------------- 2

        {
            animLobo.SetInteger("Walk", 1);
            animLobo.SetInteger("Estado", 4);

            yield return(new WaitForSeconds(2f));             //tempo para andar

            animLobo.SetInteger("Estado", 0);
            Defesa.SetActive(true);
            presPermision = true;
            //print ("Click");

            yield return(new WaitForSeconds(2f - velocidade));             //verificação e tempo do QTE

            animLobo.SetInteger("Estado", 1);
            Defesa.SetActive(false);

            if (presNeg == false)
            {
                vida_Lenhador -= 1;
                animLenhador.SetInteger("Estado", 5);
                Perder_Vida(ShowVidaLenhador, vida_Lenhador, 3);
            }
            else
            {
                animLenhador.SetInteger("Estado", 3);
            }

            Reset_Press();

            yield return(new WaitForSeconds(2f));             //tempo animação de ataque

            animLenhador.SetInteger("Estado", 0);
            animLobo.SetInteger("Estado", 0);

            yield return(new WaitForSeconds(.5f));             //tempo do reset das anim

            animLobo.SetInteger("Walk", 0);
            animLobo.SetInteger("Estado", 4);
        }

        yield return(new WaitForSeconds(2f));         // tempo para voltar

        animLenhador.SetInteger("Estado", 0);
        animLobo.SetInteger("Estado", 0);
        esperando = false;
        if (phase == 2)
        {
            phase = 0;
        }
        phase++;
    }
    void Update()
    {
        if (JoyStick_detection.isJoyConnect == true)
        {
            Atack.GetComponentInChildren <Text> ().text  = "B";
            Defesa.GetComponentInChildren <Text> ().text = "X";
        }
        else
        {
            Atack.GetComponentInChildren <Text> ().text  = "D";
            Defesa.GetComponentInChildren <Text> ().text = "A";
        }

        //camera
        Vector3 centerPos = Vector3.Lerp(Lenhador.transform.position, Lobo.transform.position, 0.5f);

        Camera.main.transform.position = new Vector3(centerPos.x, -2f, -10);


        if (axisDown == false && presPermision == true)
        {
            //positivo - Ataque
            if (Input.GetAxisRaw("QuickTime") > 0)
            {
                axisDown      = true;
                presNeg       = false;
                presPos       = true;
                presPermision = false;
            }

            //negativo - Defesa
            if (Input.GetAxisRaw("QuickTime") < 0)
            {
                axisDown      = true;
                presNeg       = true;
                presPos       = false;
                presPermision = false;
            }
        }

        if (Input.GetAxisRaw("QuickTime") == 0)
        {
            axisDown = false;
        }

        //QTE - Quick Time Event
        if (vida_Lobo == 0)
        {
            StartCoroutine(Ending_Fight(animLobo, "Vitoria"));
        }
        else if (vida_Lenhador == 0)
        {
            StartCoroutine(Ending_Fight(animLenhador, "Death"));
        }

        else if (esperando == false)
        {
            StartCoroutine(Turnos());
        }

        //print("N " + presNeg);	print("P " + presPos); print ("Velocidade: " + (2f - velocidade));
    }