Exemplo n.º 1
0
    public override void StateFixedUpdate(Player player)
    {
        if (!hit && ScaledCurrentFrame == whooshFrameDelay)
        {
            player.PlayHitClip(RandClip.GetRandomClip(whooshClips).AudioClip);
        }

        ApplyTrajectoryMod(player);

        if (InputBuffer.Instance.GetButtonDownBuffered(player.InputGenerator, PlayerCompositeActions.JUMP.DisplayName(), consumeIfDown: true, maxBuffer: 1) && (Grounded(player) || hit))
        {
            JumpCancel(player);
        }
    }
Exemplo n.º 2
0
    public override void StateOnHit(Player player, HitBox hitBox, HurtBox hurtBox, Entity receiving)
    {
        base.StateOnHit(player, hitBox, hurtBox, receiving);

        RandClip hitSound = hitSounds[player.ConsecutiveHits % hitSounds.Count];

        player.PlayThudClip(RandClip.GetRandomClip(thudSounds).AudioClip);
        player.PlayHitClip(RandClip.GetRandomClip(hitSounds).AudioClip);

        hit = true;

        //jump if holding jump
        if (InputBuffer.Instance.GetButton(player.InputGenerator, PlayerCompositeActions.JUMP.DisplayName()))
        {
            player.VelY = jumpGain;
            StatsTracker.Instance.NamedTallier.AddToNamedTally("Jump Gain");

            OnJumpGainEvent.Invoke(player, this);
        }

        OnHitEvent.Invoke(player, this);
    }
Exemplo n.º 3
0
    public override void OnHitReceived(HitBox hitBox, HurtBox hurtBox, Entity initiator)
    {
        base.OnHitReceived(hitBox, hurtBox, initiator);

        AudioSourcePool.Instance.PlayOneShotClipAt(RandClip.GetRandomClip(metalSounds).AudioClip, transform.position);
    }