Exemplo n.º 1
0
        public static void Init()
        {
            CreateRuneBasicBlank = new HexAction("Create Basic Blank Rune").SetOutput(ItemData.RuneBasicBlank, 1);

            CreateRuneBasicSpace = new HexAction("Create Basic Space Rune");
            CreateRuneBasicSpace.SetOutput(ItemData.RuneBasicSpace, 1);
            CreateRuneBasicSpace.SetInput(ItemData.RuneBasicBlank, 1);

            CreateRuneBasicStability = new HexAction("Create Basic Stability Rune");
            CreateRuneBasicStability.SetOutput(ItemData.RuneBasicStability, 1);
            CreateRuneBasicStability.SetInput(ItemData.RuneBasicBlank, 1);

            CreateRuneBasicOre = new HexAction("Create Basic Ore Rune");
            CreateRuneBasicOre.SetOutput(ItemData.RuneBasicOre, 1);
            CreateRuneBasicOre.SetInput(ItemData.RuneBasicBlank, 1);

            CreateClusterBasicExpansion = new HexAction("Create Basic Expansion Cluster");
            CreateClusterBasicExpansion.SetOutput(ItemData.ClusterBasicExpansion, 1);
            CreateClusterBasicExpansion.AddInput(ItemData.RuneBasicSpace, 2);
            CreateClusterBasicExpansion.AddInput(ItemData.RuneBasicStability, 1);

            CreateClusterBasicWorkshop = new HexAction("Create Basic Workshop Cluster");
            CreateClusterBasicWorkshop.SetOutput(ItemData.ClusterBasicWorkshop, 1);
            CreateClusterBasicWorkshop.SetInput(ItemData.ClusterBasicExpansion, 1);
            CreateClusterBasicWorkshop.SetInput(ItemData.RuneBasicStability, 2);
        }
Exemplo n.º 2
0
        public void DoAction(HexAction action)
        {
            Debug.Log(action.Name);
            if (action.GetInput().Count > 0)
            {
                foreach (Item i in action.GetInput())
                {
                    int amount = Inventory.GlobalInventory.CanRemoveItem(i);
                    if (amount > 0)
                    {
                        Debug.Log("Missing " + amount + " " + i.ItemData.Name);
                        return;
                    }
                }

                foreach (Item i in action.GetInput())
                {
                    Inventory.GlobalInventory.RemoveItem(i);
                }
            }

            if (action.Output != null)
            {
                Inventory.GlobalInventory.AddItem(action.Output);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Instatiate the HexMap script
        /// </summary>
        void Start()
        {
            ItemData.CreateItemDatas();
            HexAction.Init();
            HexType.Init();

            GenerateMap();
        }
Exemplo n.º 4
0
 public HexType AddAction(HexAction action)
 {
     Actions.Add(action);
     return(this);
 }