Exemplo n.º 1
0
            private void DressRootWithInventoryActions(ActionButtonNode root)
            {
                List <Action> inventoryActions = new List <Action> ();

                inventoryActions.Add(new PickUp(this));
                inventoryActions.Add(new DropItem(this));
                inventoryActions.Add(new Equip(this));
                inventoryActions.Add(new GiveItem(this));
                List <ActionButtonNode> nodes = inventoryActions.Select((ac) => {
                    //					actions.Remove(ac);
                    ActionButtonNode actionRoot = ac.GetOptionTreeRoot();

                    if (UsedInteraction())
                    {
                        if (UsedAction())
                        {
                            actionRoot.disabled       = true;
                            actionRoot.disabledReason = "You've already taken an action\n and an interaction this turn.";
                        }
                        else
                        {
                            //Allows the interaction to happen as an action.
                            ac.IsInteraction = false;
                        }
                    }


                    return(actionRoot);
                }).ToList();

                ActionPointer inventory = new ActionPointer("Inventory", nodes);

                inventory.spriteLabel = IconDispenser.instance.SpriteFromIconName(IconName.INVENTORY);
                root.AddChild(inventory.GetRoot());
            }
Exemplo n.º 2
0
            private void DressRootWithBonusActions(ActionButtonNode root)
            {
                //Add bonus actions...
                List <Action> bonus = QueryBonusActions(CharSheet);

                //I think this is doing nothing..... since the folooring line does a select
                foreach (Action act in bonus)
                {
                    ActionButtonNode ro = act.GetOptionTreeRoot();
                }
                ActionPointer p = new ActionPointer("Bonus Action", bonus.Select((act) => act.GetOptionTreeRoot()).ToList());

                p.spriteLabel = IconDispenser.instance.SpriteFromIconName(IconName.BONUS_ACTION);
                ActionButtonNode bonusRoot = p.GetRoot();

                if (UsedBonusAction())
                {
                    bonusRoot.disabled       = true;
                    bonusRoot.disabledReason = "You already used a bonus action this round";
                }
                root.AddChild(bonusRoot);
            }