Esempio n. 1
0
        public override void OnCollideWithCharacter(CharacterBehaviour character)
        {
            if (character == Caster && Distance < 1)
            {
                return;
            }

            int damage = (int)(MaxDamage * (Distance / MaxDistance));

            character.Change(StatType.Hp, -damage);
            Caster.Change(StatType.Hp, damage);
            Destroy(gameObject);
        }
Esempio n. 2
0
        public override void OnCollideWithCharacter(CharacterBehaviour character)
        {
            if (character == Caster && Distance < 1)
            {
                return;
            }

            character.Change(StatType.Hp, Damage);
            var direction = (character.transform.position - transform.position).normalized;
            var move      = character.gameObject.AddComponent <MoveEffect>();

            move.Init(direction, MoveSpeed, MoveDistance);
            Destroy(gameObject);
        }
Esempio n. 3
0
        public override void OnCollideWithCharacter(CharacterBehaviour character)
        {
            if (character == Caster)
            {
                return;
            }

            var direction  = (_projectilePosition - character.transform.position).normalized;
            var moveEffect = character.gameObject.AddComponent <MoveEffect>();

            moveEffect.Init(-direction, PushSpeed, PushDistance);

            character.Change(StatType.Hp, Damage);
            Destroy(gameObject);
        }