예제 #1
0
    public IEnumerator SetCharacterMovementImpairingEffect(Character_Physics character, MovementImpairingEffect effect, float length)
    {
        character.SetMovementImpairingEffect(effect);

        yield return(new WaitForSeconds(length));

        character.SetMovementImpairingEffect(MovementImpairingEffect.None);
    }
예제 #2
0
    public override void Cast()
    {
        Health            targetHealth;
        Character_Physics target = characterCombat.GetCombatCharacterComponents(abilityDistance, out targetHealth);

        if (target != null && characterPhysics.currentGravityState == GravityState.Grounded)
        {
            StartCoroutine(characterPhysics.PauseGroundCheck());
            StartCoroutine(target.PauseGroundCheck());
            target.SetMovementImpairingEffect(MovementImpairingEffect.Immobilization);
            target.currentGravityState           = GravityState.InAir;
            characterPhysics.currentGravityState = GravityState.InAir;

            characterPhysics.AddForce(Vector3.up, 80f);
            target.AddOutsideForce(Vector3.up, 80f);
            targetHealth.DecreaseHealth(damage.GetAmount() * 2f);
        }
    }