/// <summary>
 /// Check if this entity performed the attack.
 /// </summary>
 /// <param name="attacker">The attacker that performed the attack</param>
 private void CheckAttackPerformed(AttackLogic attacker)
 {
     if (attacker.gameObject == gameObject)
     {
         OnAttackPerformed();
     }
 }
Esempio n. 2
0
 /// <summary>
 /// Gets references and sets up the controls.
 /// </summary>
 protected override void Awake()
 {
     base.Awake();
     _attackLogic   = GetComponent <AttackLogic>();
     _interactLogic = GetComponent <InteractLogic>();
     SetUpControls();
 }
Esempio n. 3
0
 private void Awake()
 {
     _playerState = GetComponent <PlayerState>();
     _movable     = GetComponent <Movable>();
     _attackLogic = GetComponent <AttackLogic>();
     _probability = new Probability();
 }
Esempio n. 4
0
        public int Action(int strength, double crit, double multiplier, int increase)
        {
            var dmg = 5 + strength * 4;

            crit = crit + 25;
            return(AttackLogic.CalculateAttackDamage(dmg, crit, multiplier, increase));
        }
 private void Awake()
 {
     _playerState = GetComponent <PlayerState>();
     _attackLogic = GetComponent <AttackLogic>();
     OnHealthUpdated(100);
     OnSaturationUpdated(100);
     OnHydrationUpdated(100);
 }
Esempio n. 6
0
 void OnTriggerEnter(Collider col)
 {
     if (col.transform.GetComponentInParent <AttackLogic> () != attackController)
     {
         attackController = col.transform.GetComponentInParent <AttackLogic> ();
     }
     StoreImpactInfo(attackController.GetCurrentAttack());
     if (OnImpact != null)
     {
         OnImpact(this, new OnReceivingHitEventArgs(attackController, gameObject));
     }
 }
Esempio n. 7
0
 protected override void Awake()
 {
     base.Awake();
     // init components
     _wanderAI = new WanderAI();
     if (isAggressive)
     {
         _attackLogic = GetComponent <AttackLogic>();
         if (!_attackLogic)
         {
             Debug.LogError("NPC is not able to attack without an AttackLogic component.");
         }
     }
 }
    private void PerformAttack(MonsterOnTheField monster, BattleManager bm, AttackLogic.AttackType at, UnityEngine.Events.UnityAction doneCallback)
    {
        AttackLogic attack = monster.m_MyMonster.IsAwakened() ? m_NormalAbilities[(int)at] : m_AwakenedAbilities[(int)at];

        if (attack != null)
        {
            attack.PlayLogic(monster, bm, doneCallback);
        }
        else
        {
            if (doneCallback != null)
            {
                doneCallback();
            }
        }
    }
    void ImpactAnalysis(object sender, OnReceivingHitEventArgs e)
    {
        Attack      incomingAttack = e.attackLogic.lightAttacks [e.attackLogic.comboNumber];
        AttackLogic logic          = e.attackLogic;

        if (activeStatus != Status.Idle)
        {
            if (activeStatus == Status.Blocking)
            {
                health.Hurt(incomingAttack.damage / 2);
                if (incomingAttack.specialQuality == Specials.Knockback)
                {
                }
            }
        }
        else
        {
            health.Hurt(incomingAttack.damage);
        }
    }
Esempio n. 10
0
    // Use this for initialization
    void Start()
    {
        rot = new Rotation(transform);
        rot.setRight();

        position = new Vector2Int((int)Mathf.Round(transform.position.x), (int)Mathf.Round(transform.position.y));
        xDir     = 0;
        yDir     = 0;
        canMove  = true;

        GameObject masterObj = GameObject.Find("Master");

        master = masterObj.GetComponent <Master>();

        master.entityMap[position.x, position.y] = this.gameObject;

        GameObject controllerObj = GameObject.Find("Controller");

        controller = controllerObj.GetComponent <Controller>();

        attackLogic = GameObject.Find("AttackLogic").GetComponent <AttackLogic>();
    }
Esempio n. 11
0
        public int Poison(int strength)
        {
            var dmg = Convert.ToInt32(strength * .25);

            return(AttackLogic.CalculateAttackDamage(dmg, 0, 1, 0));
        }
Esempio n. 12
0
 public AttackAction(AttackLogic al, ObjectInteraction i)
 {
     logic       = al;
     interaction = i;
 }
Esempio n. 13
0
 public TargetState(AttackLogic attackLogic)
 {
     _attackLogic = attackLogic;
 }
Esempio n. 14
0
        public int DoT(int spellPower, double crit, double multi, int increase)
        {
            var dmg = Convert.ToInt32(spellPower * .9);

            return(AttackLogic.CalculateAttackDamage(dmg, crit, multi, increase));
        }
Esempio n. 15
0
        public int Action(int sp, double crit, double multiplier, int increase)
        {
            var heal = sp * 3;

            return(AttackLogic.CalculateAttackDamage(heal, crit, multiplier, increase));
        }
Esempio n. 16
0
        public int Action(int spellPower, double crit, double multiplier, int increase)
        {
            var dmg = spellPower * 3;

            return(AttackLogic.CalculateAttackDamage(dmg, crit, multiplier, increase));
        }
Esempio n. 17
0
        public int DoT(int sp, double crit, double multiplier, int increase)
        {
            var dmg = Convert.ToInt32(sp * .7);

            return(AttackLogic.CalculateAttackDamage(dmg, crit, multiplier, increase));
        }
Esempio n. 18
0
        public int Action(int spellPower, double crit, double multiplier, int increase)
        {
            var value = Convert.ToInt32(spellPower * 1.4);

            return(AttackLogic.CalculateAttackDamage(value, crit, multiplier, increase));
        }
Esempio n. 19
0
 public void Test1()
 {
     Assert.AreEqual(200, AttackLogic.CalculateAttackDamage(100, 20, 1, 0));
 }
Esempio n. 20
0
        public int Action(int spellPower, double crit, double multi, int increase)
        {
            var heal = Convert.ToInt32(spellPower * 2.2);

            return(AttackLogic.CalculateAttackDamage(heal, crit, multi, increase));
        }
Esempio n. 21
0
        public int Action(int spellpower, double crit, double multiplier, int increase)
        {
            var dmg = Convert.ToInt32(spellpower * 1.5);

            return(AttackLogic.CalculateAttackDamage(dmg, crit, multiplier, increase));
        }
Esempio n. 22
0
    private void Init()
    {
        m_NormalAbilities   = new AttackLogic[(int)AttackLogic.AttackType.Count];
        m_AwakenedAbilities = new AttackLogic[(int)AttackLogic.AttackType.Count];

        m_AssetInfo         = new PrefabManager.AssetPathInfo(m_Params.Params.AssetFolder, m_Params.Params.AssetName);
        m_AssetInfo.m_Scale = m_Params.Params.m_Scale;
        var attacks = m_Params.Params.Attacks;

        if (attacks != null)
        {
            m_AllAttacks = new List <AttackLogic>(attacks.Length);

            for (int i = 0; i < attacks.Length; i++)
            {
                AttackLogic al = MonstersManager.GetAttackLogc(attacks[i]);
                if (al == null)
                {
                    Debug.LogError("Attack wasn't found " + attacks[i] + " for mob " + m_Params.Params.Name);
                }
                else
                {
                    m_AllAttacks.Add(al);
                }
            }

            for (int i = 0; i < m_AllAttacks.Count; i++)
            {
                if (!m_AllAttacks[i].m_AwakenedAbility)
                {
                    if (m_AllAttacks[i].m_AttackType == AttackLogic.AttackType.Passive)
                    {
                        if (m_PassiveAbilities == null)
                        {
                            m_PassiveAbilities = new List <AttackLogic>();
                        }
                        if (m_PassiveAwakenAbilities == null)
                        {
                            m_PassiveAwakenAbilities = new List <AttackLogic>();
                        }
                        m_PassiveAbilities.Add(m_AllAttacks[i]);
                        m_PassiveAwakenAbilities.Add(m_AllAttacks[i]);
                    }
                    else
                    {
                        m_AwakenedAbilities[(int)m_AllAttacks[i].m_AttackType] = m_NormalAbilities[(int)m_AllAttacks[i].m_AttackType] = m_AllAttacks[i];
                    }
                }
            }

            for (int i = 0; i < m_AllAttacks.Count; i++)
            {
                if (m_AllAttacks[i].m_AwakenedAbility)
                {
                    if (m_AllAttacks[i].m_AttackType == AttackLogic.AttackType.Passive)
                    {
                        if (m_PassiveAwakenAbilities == null)
                        {
                            m_PassiveAwakenAbilities = new List <AttackLogic>();
                        }
                        m_PassiveAwakenAbilities.Add(m_AllAttacks[i]);
                    }
                    else
                    {
                        m_AwakenedAbilities[(int)m_AllAttacks[i].m_AttackType] = m_AllAttacks[i];
                    }
                }
            }
        }
    }
Esempio n. 23
0
 public CancelState(AttackLogic attackLogic)
 {
     _attackLogic = attackLogic;
 }
Esempio n. 24
0
 private void Awake()
 {
     _maxHealth       = health;
     _attackLogic     = GetComponent <AttackLogic>();
     _enemyController = GetComponent <EnemyController>();
 }
Esempio n. 25
0
 public int Action(int SpellPower, double crit, double multi, int increase)
 {
     return(AttackLogic.CalculateAttackDamage(SpellPower, crit, multi, increase));
 }
Esempio n. 26
0
 public OnReceivingHitEventArgs(AttackLogic targetAttackLogic, GameObject newhurtbox)
 {
     attackLogic = targetAttackLogic;
     hurtbox     = newhurtbox;
 }
Esempio n. 27
0
        public int Action(int strength, double crit, double multiplier, int increase)
        {
            var dmg = Convert.ToInt32(strength * 2.2);

            return(AttackLogic.CalculateAttackDamage(dmg, crit, multiplier, increase));
        }
Esempio n. 28
0
 public AttackController(AttackLogic attackLogic)
 {
     _attackLogic = attackLogic;
 }
Esempio n. 29
0
 public int Action(int strength, double crit, double multiplier, int increase)
 {
     return(AttackLogic.CalculateAttackDamage(strength, crit, multiplier, increase));
 }
Esempio n. 30
0
 public AttackState(AttackLogic attackLogic)
 {
     _attackLogic = attackLogic;
 }