public void PerformBasicAction(BasicActions action)
 {
     if (action == BasicActions.Travel)
     {
         TravelBasicAction();
     }
     if (action == BasicActions.Acquire)
     {
         AcquireBasicAction();
     }
     if (action == BasicActions.Trade)
     {
         TradeBasicAction();
     }
     if (action == BasicActions.Rest)
     {
         RestBasicAction();
     }
     if (action == BasicActions.Prepare)
     {
         PrepareBasicAction();
     }
     if (action == BasicActions.Focus)
     {
         FocusBasicAction();
     }
 }
Exemple #2
0
            public void Awake()
            {
                inputBuffer = GetComponent <InputBuffer>();

                inputActions = new BasicActions();

                inputActions.GamePlay.Move.performed    += OnMove;
                inputActions.GamePlay.ButtonA.performed += OnButtonA;
                inputActions.GamePlay.ButtonB.performed += OnButtonB;
                inputActions.GamePlay.ButtonC.performed += OnButtonC;
                inputActions.GamePlay.ButtonD.performed += OnButtonD;
                inputActions.GamePlay.ButtonS.performed += OnButtonS;

                FrameEnforcer frame = GameObject.FindGameObjectWithTag("rspTime").GetComponent <FrameEnforcer>();

                frame.AddUpdate((int)FramePriority.InputBuffer, new Action <int>(FrameUpdate));
            }
Exemple #3
0
        public ListShowsButton(BasicActions filterType)
        {
            InitializeComponent();
            switch (filterType)
            {
            case BasicActions.SEARCH:
                Title             = "Search";
                IsSelected        = false;
                _actionController = new SearchAction();
                break;

            case BasicActions.ALL:
                Title             = "All";
                IsSelected        = false;
                _actionController = new AllAction();
                break;
            }
        }
        public void PerformAttackPhaseAction(BasicActions action, Player player)
        {
            switch (action)
            {
            case BasicActions.StrengthAttack:
                var playerToAttack = GetRandomPlayerToAttack(player);
                StrengthAttackPlayer(player, playerToAttack);
                break;

            case BasicActions.PerceptionAttack:
                //TODO: Implement
                break;

            case BasicActions.Heal:
                player.Health += GameConstants.AttackPhaseHealthGain;
                break;

            case BasicActions.RollForCard:
                var drawCardAction = ResolveDrawCardForPlayer(player);
                PerformDrawCardActionPhaseAction(drawCardAction, player);     //TODO: Needs to be replaced with simpler call
                break;
            }
        }
    public override void OnInspectorGUI()
    {
        // The ActionSet instance being edited by this inspector
        ActionSet    actionSet    = (ActionSet)target;
        BasicActions basicActions = actionSet.basicActions;

        // Add undo support to the ActionSet instance.
        Undo.RecordObject(actionSet, "Action Set Undo");

        /*************************
        * BASIC ACTIONS FOLDOUT *
        * ***********************/
        EditorGUI.indentLevel = 0;

        showBasicActionsFoldout = EditorGUILayout.Foldout(showBasicActionsFoldout, "Basic Actions");

        if (showBasicActionsFoldout)
        {
            EditorGUILayout.BeginVertical();
            {
                EditorGUI.indentLevel = 1;

                // Cycle through each basic action in the ActionSet
                for (int i = 0; i < basicActionEditors.Length; i++)
                {
                    BasicActionEditor basicActionEditor = basicActionEditors[i];

                    basicActionEditor.Display();
                }
            }
            EditorGUILayout.EndHorizontal();
        }

        /**************************
        * COMBAT ACTIONS FOLDOUT *
        **************************/
        EditorGUI.indentLevel = 0;

        // "Attack Actions" foldout
        showCombatActionsFoldout = EditorGUILayout.Foldout(showCombatActionsFoldout, "Combat Actions (" + actionSet.combatActionScriptableObjects.Length + ")");

        if (showCombatActionsFoldout)
        {
            EditorGUILayout.BeginVertical();
            {
                EditorGUI.indentLevel = 1;

                // Display each Action in the action set
                for (int i = 0; i < actionSet.combatActionScriptableObjects.Length; i++)
                {
                    // Select an action
                    EditorGUILayout.BeginHorizontal();
                    {
                        actionSet.combatActionScriptableObjects[i] = (ActionScriptableObject)EditorGUILayout.ObjectField(actionSet.combatActionScriptableObjects[i],
                                                                                                                         typeof(ActionScriptableObject), false);

                        // Delete action from action set
                        if (GUILayout.Button("X", GUILayout.Width(40)))
                        {
                            actionSet.combatActionScriptableObjects = ArrayUtils.Remove <ActionScriptableObject>(actionSet.combatActionScriptableObjects,
                                                                                                                 actionSet.combatActionScriptableObjects[i]);
                        }
                    }
                    EditorGUILayout.EndHorizontal();
                }

                // Add action ("+") button
                EditorGUILayout.BeginHorizontal();
                {
                    EditorGUILayout.LabelField("");
                    // Add animation string
                    if (GUILayout.Button("+", GUILayout.Width(40)))
                    {
                        actionSet.combatActionScriptableObjects = ArrayUtils.Add <ActionScriptableObject>(actionSet.combatActionScriptableObjects, null);
                    }
                }
                EditorGUILayout.EndHorizontal();

                EditorGUILayout.HelpBox("The combat actions at the top of the list have priority over the lower ones. " +
                                        "That is, if two actions are activated using the same input, the one higher on the " +
                                        "list will be chosen", MessageType.Info);
            }
            EditorGUILayout.EndVertical();
        }         // End "Attack Actions" foldout
    }
        public void PerformDrawCardActionPhaseAction(BasicActions action, Player player)
        {
            var availablePlayerOptions = new List <CardActions>()
            {
                CardActions.EquiptCard,
                CardActions.StoreCardInBackpack,
                CardActions.DiscardCard
            };

            ICard card = null;

            switch (action)
            {
            case BasicActions.DrawHeadCard:
                card = HeadsDeck.Draw();
                break;

            case BasicActions.DrawTorsoCard:
                card = TorsosDeck.Draw();
                break;

            case BasicActions.DrawArmsCard:
                card = ArmsDeck.Draw();
                break;

            case BasicActions.DrawLegsCard:
                card = LegsDeck.Draw();
                break;

            case BasicActions.DrawWeaponCard:
                card = WeaponsDeck.Draw();
                break;

            case BasicActions.DrawSpecialCard:
                card = SpecialsDeck.Draw();
                break;
            }

            var drawnCardAction = player.PerformCardAction(GameplayEvent.CardDrawn, availablePlayerOptions, this, card);

            if (drawnCardAction.Item1 == CardActions.EquiptCard)
            {
                EquipCardForPlayer(player, card);
            }
            else if (drawnCardAction.Item1 == CardActions.StoreCardInBackpack)
            {
                var cardToRemoveFromBackpackSpecified = drawnCardAction.Item2 != null;

                if (cardToRemoveFromBackpackSpecified)
                {
                    var discardedCard = player.Backpack.RemoveFromBackpack(drawnCardAction.Item2);

                    if (discardedCard != null)
                    {
                        DiscardDeck.AddToDeck(discardedCard);
                    }
                }

                player.Backpack.StoreInBackpack(card);
            }
            else if (drawnCardAction.Item1 == CardActions.DiscardCard)
            {
                DiscardDeck.AddToDeck(card);
            }
        }
Exemple #7
0
 public void PerformBasicAction(BasicActions action)
 {
     App.View.actionPhaseView.ActionSelected();
     App.Model.actionPhaseModel.investigators[App.Model.actionPhaseModel.turnIndex].PerformBasicAction(action);
 }