Exemplo n.º 1
0
        public void TwoAttacksWithinCooldown_AppliesDamageOnce()
        {
            AttackSkill attack = Data.AttackSkill.SetDamage(10).SetCooldown(1);

            attack.Attack(_target);
            attack.ReduceCooldown(0.75f);
            attack.Attack(_target);
            _target.Received(1).TakeDamage(10);
        }
Exemplo n.º 2
0
        public void TargetIsNull_DoesNoDamage()
        {
            AttackSkill attack = Data.AttackSkill.SetDamage(100);

            attack.Attack(null);
            _target.DidNotReceive().TakeDamage(Arg.Any <int>());
        }
Exemplo n.º 3
0
        public void OffCooldown_AppliesDamageToDamagable([Values(10, 0)] int damage)
        {
            AttackSkill attack = Data.AttackSkill.SetDamage(damage);

            attack.Attack(_target);
            _target.Received().TakeDamage(damage);
        }
Exemplo n.º 4
0
 public void Attack(string attackSkillName)
 {
     if (attackSkillName == "Hit")
     {
         attackSkill.Attack(critter1, critter2, attackSkill.getPower());
         hpText1.text = critter2.getHp().ToString() + " HP";
         attackBool   = true;
         EnemyAttack(1);
     }
     else if (attackSkillName == "Smash")
     {
         attackSkill2.Attack(critter1, critter2, attackSkill2.getPower());
         hpText1.text = critter2.getHp().ToString() + " HP";
         attackBool   = true;
         EnemyAttack(1);
     }
     else if (attackSkillName == "Special")
     {
         attackSkill3.Attack(critter1, critter2, attackSkill3.getPower());
         hpText1.text = critter2.getHp().ToString() + " HP";
         attackBool   = true;
         EnemyAttack(1);
     }
 }
Exemplo n.º 5
0
    private void Update()
    {
        var player = PlayerManager.Instance.Player;

        if (player.IsDead)
        {
            return;
        }
        var position = player.transform.position;

        _mover.Move(position);
        var distance = Vector3.Distance(position, transform.position);

        if (distance < 2f)
        {
            _skill?.Attack(player.GetComponent <CharacterStats>());
        }
        _skill?.ReduceCooldown(Time.deltaTime);
    }
Exemplo n.º 6
0
        public void AttackTest2()
        {
            var attackSkill = new AttackSkill();

            attackSkill.Attack(null, null, null);
        }