Ejemplo n.º 1
0
    protected override void InitObjectives()
    {
        // Pause
        NewObjective(
            () => !weaponItem.IsSelected || PlayerStatus.Incapacitated, true)
        .AddBehaviour(bvr_Idle);

        // Dash Attack
        NewObjective(
            () => GM.Player.IsDashing)
        .AddBehaviour(bvr_Dash);

        // Slam Attack
        NewObjective(
            () => !GM.Player.IsKicking &&
            !GM.Player.Data.groundDetectionData.isGrounded &&
            Input.GetKey(PlayerMovementKeys.FallThrough) &&
            PlayerWeaponKeys.GetKeyDown(PlayerWeaponKeys.MainAbility))
        .AddBehaviour(bvr_Slam, true);

        // Basic Attack
        NewObjective(
            () => PlayerWeaponKeys.GetKey(PlayerWeaponKeys.MainAbility))
        .AddBehaviour(bvr_Basic, true);

        // Heavy Attack
        NewObjective(
            () => PlayerWeaponKeys.GetKey(PlayerWeaponKeys.SubAbility))
        .AddBehaviour(bvr_Heavy, true);

        // Default
        SetDefaultObjective()
        .AddBehaviour(bvr_Idle);
    }
Ejemplo n.º 2
0
    protected override void InitObjectives()
    {
        // Pause
        NewObjective(
            () => !weaponItem.IsSelected || PlayerStatus.Incapacitated, true)
        .AddBehaviour(bvr_Idle);

        // Auto Reload
        NewObjective(
            () => weaponItem.LoadedBullets == 0 && weaponItem.Main_Shoot_CD.IsEnded)
        .AddBehaviour(bvr_AutoReload);

        // Manual Reload
        NewObjective(
            () => PlayerWeaponKeys.GetKeyDown(PlayerWeaponKeys.Reload) &&
            weaponItem.LoadedBullets < weaponItem.Main_MagazineSize.Value, true)
        .AddBehaviour(bvr_ManualReload, true);

        // Normal
        NewObjective(
            () => weaponItem.LoadedBullets > 0)
        .AddBehaviour(bvr_Normal, true);

        // Default
        SetDefaultObjective()
        .AddBehaviour(bvr_Idle);
    }
Ejemplo n.º 3
0
    protected override void InitObjectives()
    {
        // Stop
        NewObjective(
            () => !weaponItem.IsSelected || PlayerStatus.Incapacitated, true)
        .AddBehaviour(bvr_Stop);

        // Main
        NewObjective(
            () => PlayerWeaponKeys.GetKey(PlayerWeaponKeys.MainAbility) &&
            PlayerStats.Inst.HasMana(weaponItem.Main_ManaUsage.Value) &&
            weaponItem.Main_CD.IsEnded)
        .AddBehaviour(bvr_Main, true);

        // Sub
        NewObjective(
            () => PlayerWeaponKeys.GetKeyDown(PlayerWeaponKeys.SubAbility) &&
            PlayerStats.Inst.HasMana(weaponItem.Sub_ManaUsagePerTick.Value))
        .AddBehaviour(bvr_Sub, true);

        // Special
        NewObjective(
            () => Input.GetKeyDown(PlayerWeaponKeys.SpecialAbility) &&
            PlayerInventoryManager.inventory.GetItemCount("Frozen Soul") >= weaponItem.Spec_FrozenSoulUsage.Value)
        .AddBehaviour(bvr_Special, true);

        // Default
        SetDefaultObjective()
        .AddBehaviour(bvr_Idle);
    }
Ejemplo n.º 4
0
    protected override void InitBehaviours()
    {
        bvr_Idle = new Single(
            state_Idle,
            EMPTY_STATE_ACTION,
            () => false);

        bvr_AutoReload = new Continue(
            (state_SwapMagazine,
             EMPTY_STATE_ACTION,
             () => weaponItem.Main_SwapMagazine_Dur.IsEnded),
            (state_Reload,
             EMPTY_STATE_ACTION,
             () => weaponItem.Main_Reload_Dur.IsEnded));

        bvr_ManualReload = new Sequence(
            (state_SwapMagazine,
             EMPTY_STATE_ACTION,
             () => weaponItem.Main_SwapMagazine_Dur.IsEnded),
            (state_Reload,
             EMPTY_STATE_ACTION,
             () => weaponItem.Main_Reload_Dur.IsEnded));

        bvr_Normal = new Choice(
            (state_Idle,
             EMPTY_STATE_ACTION,
             () =>
        {
            if (PlayerWeaponKeys.GetKeyDown(PlayerWeaponKeys.MainAbility) && weaponItem.Main_Shoot_CD.IsEnded)
            {
                return(state_Main);
            }

            return(state_Idle);
        }),
            (state_Main,
             EMPTY_STATE_ACTION,
             () =>
        {
            if (weaponItem.Main_Shoot_CD.IsEnded)
            {
                return(END_BEHAVIOUR);
            }

            return(state_Main);
        }));
    }