Пример #1
0
    public override string StartState()
    {
        playerControl.animationAlert.ResetAlerts();
        playerControl.PlayAnimation("Parry Strike");
        playerControl.characterAnimator.SetInteger("Weapon Type", (int)playerControl.playerStats.currentWeapon.WeaponType);

        playerControl.playerStats.currentHitstate = EntityStatus.HitState.i_frame;
        playerControl.gameObject.layer            = LayerMask.NameToLayer("Phase");

        target    = playerControl.playerStats.GetNearestParry();
        direction = (Vector2)playerControl.transform.position - (Vector2)target.entityController.transform.position;
        direction = direction.normalized; direction.z = direction.y;
        direction = -direction;
        playerControl.characterAnimator.SetFloat("Horizontal", direction.x);
        playerControl.characterAnimator.SetFloat("Vertical", direction.y);

        dashTime   = 0.1f;
        speed      = (Vector3.Distance(target.entityController.transform.position, playerControl.transform.position) + 2.5f) * 4.5f;
        brakeSpeed = speed * 0.075f;
        flash      = 1f;

        playerControl.SetSpriteMat("Flash");
        EffectSpawner.instance.SpawnGroundEffectDirected(5, 4f, playerControl.transform.position, direction);
        float damage = playerControl.playerStats.currentWeapon.weaponPower * .8f;

        target.Damage(Attack.AttackType.melee, Mathf.CeilToInt(damage), 0f, 3, direction, playerControl.playerStats);
        Vector3 newDir = (Quaternion.AngleAxis(45, Vector3.forward) * direction);

        EffectSpawner.instance.SpawnFGEffect(4, target.entityController.transform.position + new Vector3(0, 0.5f, -0.3f), 8f, newDir, Color.white, new Color(0, 0, 0, 0));

        PlayerStatus.parryList.Remove(target);

        SoundMaker.i.PlaySound("Strike", playerControl.transform.position, 0.5f);
        SoundMaker.i.PlaySound("Strike2", playerControl.transform.position, 0.5f);
        return(stateName);
    }
Пример #2
0
 //Return a bool to confirm that the entity has actually been hit
 public bool Damage(Attack.AttackType type, int damage, float knockback, int weight, Vector2 direction, EntityStatus ownerStatus)
 {
     return(status.Damage(type, damage, knockback, weight, direction, ownerStatus));
 }