Beispiel #1
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);
        }
Beispiel #2
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);
        }
Beispiel #3
0
 public void MouseOn()
 {
     IsPointOn = true;
     if (!Data.Name.Equals(string.Empty) && !IsDrag)
     {
         bool temp = (Data.Type == CardType.Minion) ? true : false;
         CardView.SetActive(true);
         ATK.SetActive(temp);
         HP.SetActive(temp);
     }
 }
Beispiel #4
0
        //-------------------------------------------------
        #region Virtual Methods Region
        public virtual StrongString GetForServer()
        {
            StrongString myString =
                CustomName + InCharSeparator +                      // index : 0
                HeroID + InCharSeparator +                          // index : 1
                Level.ToString() + InCharSeparator +                // index : 2
                Power.GetForServer() + InCharSeparator +            // index : 3
                SkillPoint.GetForServer() + InCharSeparator +       // index : 4
                Stars.ToString() + InCharSeparator +                // index : 5
                HeroSkill.GetForServer() + InCharSeparator +        // index : 6
                HP.GetForServer() + InCharSeparator +               // index : 7
                ATK.GetForServer() + InCharSeparator +              // index : 8
                INT.GetForServer() + InCharSeparator +              // index : 9
                DEF.GetForServer() + InCharSeparator +              // index : 10
                RES.GetForServer() + InCharSeparator +              // index : 11
                SPD.GetForServer() + InCharSeparator +              // index : 12
                PEN.GetForServer() + InCharSeparator +              // index : 13
                Block.GetForServer() + InCharSeparator +            // index : 14
                HeroCurrentExp.GetForServer() + InCharSeparator;    // index : 15

            return(myString);
        }
Beispiel #5
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);
        }
Beispiel #6
0
 internal static IEffect SetAttack(int n)
 {
     return(ATK.Effect(EffectOperator.SET, n));
 }
Beispiel #7
0
 internal static IEffect Attack_N(int n)
 {
     return(ATK.Effect(EffectOperator.ADD, n));
 }
        public void Update()
        {
            if (_on)
            {
                int value;

                if (_isSwitching)
                {
                    value = _condition.Eval(_owner) ? 1 : 0;

                    if (value == _lastValue)
                    {
                        return;
                    }


                    if (_tag == GameTag.ATK)
                    {
                        ATK.Effect(_operator, _lastValue).RemoveFrom(_owner);
                        ATK.Effect(_operator, value).ApplyTo(_owner);
                    }
                    else
                    {
                        new Effect(_tag, _operator, _lastValue).RemoveFrom(_owner);
                        new Effect(_tag, _operator, value).ApplyTo(_owner);
                    }
                }
                else
                {
                    value = _valueFunction(_owner);

                    if (_tag == GameTag.ATK)
                    {
                        if (!(_owner is Character c))
                        {
                            if (_owner is Weapon)
                            {
                                c = _owner.Controller.Hero;
                            }
                            else
                            {
                                throw new Exception($"Can't apply ATK aura {this} to entity {_owner}");
                            }
                        }

                        if (_operator == EffectOperator.SET)
                        {
                            c._modifiedATK = 0;
                            ATK.Effect(EffectOperator.ADD, _lastValue).RemoveAuraFrom(c);
                            value = value - (c.AuraEffects?.ATK ?? 0);
                            ATK.Effect(EffectOperator.ADD, value).ApplyAuraTo(c);
                        }
                        else
                        {
                            ATK.Effect(_operator, _lastValue).RemoveAuraFrom(c);
                            ATK.Effect(_operator, value).ApplyAuraTo(c);
                        }
                    }
                    else
                    {
                        new Effect(_tag, _operator, _lastValue).RemoveAuraFrom(_owner);
                        new Effect(_tag, _operator, value).ApplyAuraTo(_owner);
                    }
                }

                _lastValue = value;
            }
            else
            {
                if (_isSwitching)
                {
                    if (_tag == GameTag.ATK)
                    {
                        ATK.Effect(_operator, _lastValue).RemoveFrom(_owner);
                    }
                    else
                    {
                        new Effect(_tag, _operator, _lastValue).RemoveFrom(_owner);
                    }
                }
                else
                {
                    if (_tag == GameTag.ATK)
                    {
                        ATK.Effect(_operator, _lastValue).RemoveAuraFrom(_owner is Weapon ? _owner.Controller.Hero : _owner);
                    }
                    else
                    {
                        new Effect(_tag, _operator, _lastValue).RemoveAuraFrom(_owner);
                    }
                }

                _owner.Game.Auras.Remove(this);
            }
        }
Beispiel #9
0
    ///////////////////////////////////////////////////////////////////////////////////////////////
    //
    void FixedUpdate()
    {
        if (m_bDataLoaded == false)
        {
            return;
        }
        if (m_bIsDead == true)
        {
            m_bGotHit         = false;
            m_bIsAbleToMove   = false;
            m_bIsAbleToAttack = false;
            m_nAttackCounter  = 0;
            UpdateAnimator();
            return;
        }
        if (m_fCurrentHP <= 0.0f)
        {
            m_bIsDead = true;
        }
        AnimatorStateInfo _asiCurrentState = m_animatorController.GetCurrentAnimatorStateInfo(0);

        if (m_nAttackCounter == 0)
        {
            float _fDecideAttack = Random.Range(0.0f, 1.0f);
            float _fCritical     = Random.Range(0.0f, 1.0f);
            foreach (ATK _oTempAttack in m_arATKList)
            {
                if (_oTempAttack.RankATK == 1)
                {
                    if (_fDecideAttack <= _oTempAttack.Rate)
                    {
                        m_nAttackCounter  = 1;
                        m_bIsCritical     = _fCritical < _oTempAttack.RateCrist ? true : false;
                        m_oSelectedAttack = _oTempAttack;
                    }
                }
                if (_oTempAttack.RankATK == 2)
                {
                    if ((m_fAttack1Rate < _fDecideAttack) && (_fDecideAttack <= (m_fAttack1Rate + m_fAttack2Rate)))
                    {
                        m_nAttackCounter  = 2;
                        m_bIsCritical     = _fCritical < _oTempAttack.RateCrist ? true : false;
                        m_oSelectedAttack = _oTempAttack;
                    }
                }
                if (_oTempAttack.RankATK == 3)
                {
                    if ((m_fAttack1Rate + m_fAttack2Rate) < _fDecideAttack)
                    {
                        m_nAttackCounter  = 3;
                        m_bIsCritical     = _fCritical < _oTempAttack.RateCrist ? true : false;
                        m_oSelectedAttack = _oTempAttack;
                    }
                }
            }
        }
        float _fDistance = transform.position.x - m_tfTarget.position.x;

        m_nDirection = _fDistance > 0.0f ? -1 : 1;
        _fDistance   = Mathf.Abs(_fDistance);
        if (_fDistance > m_oSelectedAttack.RangerATK)
        {
            m_bIsAbleToMove   = true;
            m_bIsAbleToAttack = false;
        }
        else
        {
            m_bIsAbleToMove   = false;
            m_bIsAbleToAttack = true;
        }
        if (_fDistance <= m_oMonsterEsc.RangerArlet)
        {
            AvoidHero();
            if (m_fAnchorTimeForNextMove < Time.time + m_oMonsterEsc.DelayESC)
            {
                m_bIsAbleToMove = false;
            }
            if (Time.time > m_fAnchorTimeForNextMove)
            {
                m_fAnchorTimeForNextMove += m_oMonsterEsc.RangerESC / m_fMovementSpeed + m_oMonsterEsc.DelayESC;
            }
        }
        else
        {
            if (m_fAnchorTimeForNextMove < Time.time + m_fBreakTimeCycle)
            {
                m_bIsAbleToMove = false;
            }
            if (Time.time > m_fAnchorTimeForNextMove)
            {
                m_fAnchorTimeForNextMove += m_fMoveCycle + m_fBreakTimeCycle;
            }
        }
        if (m_fAnchorTimeForNextLockAttack >= Time.time)
        {
            m_bIsAbleToAttack = false;
        }
        if (m_fAnchorTimeForNextAttack >= Time.time)
        {
            m_bIsAbleToAttack = true;
        }

        if (_asiCurrentState.IsName("atk_1") == true || _asiCurrentState.IsName("atk_2") == true || _asiCurrentState.IsName("atk_3") == true)
        {
            if (m_fAnchorTimeForNextLockAttack <= Time.time)
            {
                m_fAnchorTimeForNextAttack     = Time.time + _asiCurrentState.length;
                m_fAnchorTimeForNextLockAttack = m_fAnchorTimeForNextAttack + m_fDelayAttack;
                Invoke("ResetAttackCounter", _asiCurrentState.length);
            }
            m_bIsAbleToMove        = false;
            m_rb2dBody.constraints = RigidbodyConstraints2D.FreezePosition | RigidbodyConstraints2D.FreezeRotation;
        }
        else
        {
            //gameObject.GetComponent<CircleCollider2D> ().enabled = false;
            //gameObject.GetComponent<CircleCollider2D> ().isTrigger = false;
            ShakingDisable();
            m_rb2dBody.constraints = RigidbodyConstraints2D.FreezeRotation;
        }

        if (m_bGotHit == true)
        {
            m_bIsAbleToAttack = false;
            m_bIsAbleToMove   = false;
            if (_asiCurrentState.IsName("get_hit"))
            {
                m_bGotHit = false;
            }
        }
        if (_asiCurrentState.IsName("fall") || _asiCurrentState.IsName("get_up"))
        {
            m_animatorController.SetBool("isFall", false);
            m_bGotHit       = false;
            m_bIsAbleToMove = false;
        }

        UpdateAnimator();
    }
Beispiel #10
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);
                }
            }
        }
    }