Esempio n. 1
0
        // Methods start here

        public string getInfo()
        {
            string stats;

            stats = Name + "\nHealth: " + HLT.ToString() + "\nAttack: " + ATK.ToString() + "\nDefense: " + DEF.ToString()
                    + "\nSpeed: " + SPD.ToString() + "\nEvasiveness: " + EVA.ToString() + "\nFaction: " + Faction + "\n\n";

            return(stats);
        }
Esempio n. 2
0
        public string getInfo()
        {
            string stats;

            stats = Name + "\nHealth: " + HLT.ToString() + "\nAttack: " + ATK.ToString() + "\nDefense: " + DEF.ToString()
                    + "\nSpeed: " + SPD.ToString() + "\nEvasiveness: " + EVA.ToString() + "\nCurrent Item: " + CurrentlyHolding + "\n\n";

            return(stats);
        }
Esempio n. 3
0
        public string GetData()
        {
            if (this == null)
            {
                return("");
            }
            string result = "";

            result += this.Name;
            if (this.IsMonster())
            {
                result += Environment.NewLine;
                result += this.IsFrame(FRAME.Xyz)
                    ? string.Format("Rank {0}", (double.IsNaN(Rank) ? "?" : Rank.ToString()))
                    : string.Format("Level {0}", (double.IsNaN(Level) ? "?" : Level.ToString()));
                result += " " + this.Attribute.ToString();
                if (Type != TYPE.NONE)
                {
                    result += " " + string.Format("{0}-Type", this.Type.GetString());
                }
                if (this.IsPendulum)
                {
                    result += " Pendulum";
                }
                result += " " + this.Frame;
                if (this.Abilities.Count > 0)
                {
                    result += " " + string.Join(" ", this.Abilities);
                }
                result += " Monster";
                result += Environment.NewLine;
                result += string.Format("ATK {0}\nDEF {1}",
                                        (double.IsNaN(ATK) ? "?" : ATK.ToString()),
                                        (double.IsNaN(DEF) ? "?" : DEF.ToString()));
                if (this.IsPendulum)
                {
                    result += "\nPendulum Scale ";
                    if (ScaleLeft.Equals(ScaleRight))
                    {
                        result += (double.IsNaN(ScaleLeft) ? "?" : ScaleLeft.ToString());
                    }
                    else
                    {
                        result += (double.IsNaN(ScaleLeft) ? "?" : ScaleLeft.ToString());
                        result += "/";
                        result += (double.IsNaN(ScaleRight) ? "?" : ScaleRight.ToString());
                    }
                }
                result += Environment.NewLine;
                if (this.IsPendulum)
                {
                    result += "Pendulum Effect:\n";
                    result += this.PendulumEffect.CleanUpUnnecessarySpace();
                    result += Environment.NewLine;
                    if (this.IsFrame(FRAME.Normal))
                    {
                        result += "Lore:";
                        result += Environment.NewLine;
                    }
                    else
                    {
                        result += "Monster Effect:";
                        result += Environment.NewLine;
                    }
                }
            }
            else
            {
                result += Environment.NewLine;
                if (Property != PROPERTY.NONE && Property != PROPERTY.Normal)
                {
                    result += Property.GetString() + " ";
                }
                result += Frame.ToString() + " Card";
                result += Environment.NewLine;
            }

            result += this.Description.CleanUpUnnecessarySpace();

            return(result);
        }
Esempio n. 4
0
    // Update is called once per frame
    void Update()
    {
        heading       = GameObject.Find("Jefe").transform.position - transform.position;
        distanciajefe = heading.magnitude;
        direccionjefe = heading / distanciajefe;

        if (vida > 40)
        {
            vida = 40;          // para que la vida maxima sea 40
        }

        if (vida <= 0)
        {
            vida = 0;
            SceneManager.LoadScene("gameover");
        }

        monedastienda.text     = monedas.ToString();      // que se muestren las monedas en la tienda
        PocionesVida.text      = pocionesvida.ToString(); // que se muestren la cantidad de pociones (int)
        PocionesVelocidad.text = pocionesvelocidad.ToString();
        PocionesFuerza.text    = pocionesfuerza.ToString();
        ATK_t.text             = ATK.ToString();
        DEF_t.text             = defensa.ToString();
        VEL_t.text             = ((velocidad - 2.5) * -10).ToString("F0");



        if (Input.GetKeyDown(KeyCode.Alpha1))
        {
            if (pocionesvida > 0)
            {
                vida         += 8;
                pocionesvida -= 1;      // al presionar la tecla "1" si hay pociones de vida aumenta esta en 8 unidades
            }
        }

        if (Input.GetKeyDown(KeyCode.Alpha2))
        {
            if (pocionesfuerza > 0)
            {
                if (!pocionfuerza)
                {
                    ATK            += 3;
                    pocionesfuerza -= 1;      // al presionar la tecla "1" si hay pociones de vida aumenta esta en 8 unidades
                    Invoke("FueraFuerza", 10f);
                }
            }
        }

        if (Input.GetKeyDown(KeyCode.Alpha3))
        {
            if (pocionesfuerza > 0)
            {
                if (!pocionvelocidadd)
                {
                    velocidad         -= 0.5f;
                    pocionesvelocidad -= 1;      // al presionar la tecla "1" si hay pociones de vida aumenta esta en 8 unidades
                    Invoke("Fueravelocidad", 10f);
                }
            }
        }

        /// movimiento
        if (Input.GetKey(KeyCode.A))
        {
            transform.Translate(Vector3.back * 3 * Time.deltaTime);
            if (modo == 1)
            {
                anim.CrossFade("IzquierdaPistola", 0);
            }
        }

        if (Input.GetKey(KeyCode.D))
        {
            transform.Translate(Vector3.forward * 3 * Time.deltaTime);
        }

        if (Input.GetKey(KeyCode.W))
        {
            transform.Translate(Vector3.left * 5 * Time.deltaTime);
            if (modo == 1 && !atacando)
            {
                anim.CrossFade("WalkingArma", 0);
            }
            else if (!atacando)
            {
                anim.CrossFade("WalkingShakespeare", 0);
            }
        }

        if (Input.GetKey(KeyCode.S))
        {
            transform.Translate(Vector3.right * 2 * Time.deltaTime);
        }

        if (Input.GetKeyDown(KeyCode.Space))
        {
            if (suelo)
            {
                saltar(alturasalto);
            }
        }

        if (Input.GetKeyDown(KeyCode.C))
        {
            modo *= -1;
            anim.CrossFade("CambiarArma", 0);
        }


        if (Input.GetMouseButtonDown(0))
        {
            if (modo == 1)
            {
                if (!generador.GetComponent <Generador>().tiendactiva&& !generador.GetComponent <Generador>().inventarioactivo)
                {
                    if (!atacando)
                    {
                        Disparar();
                        anim.CrossFade("DisparoShakespeare", 0);
                        atacando = true;
                        StartCoroutine(espera());
                    }
                }
            }

            if (modo == -1)
            {
                if (!atacando)
                {
                    atacando = true;
                    StartCoroutine(espera());
                    StartCoroutine(espada());
                    StartCoroutine(espadas());
                    anim.CrossFade("EspadaShakespeare", 0);
                }
            }
        }
    }