Example #1
0
    // 랜덤한 종류의 노드를 생성해서 반환한다.
    public Node GetRandomNode()
    {
        Node     node = null;
        NodeName rand = (NodeName)Random.Range((int)NodeName.StartNode, (int)NodeName.EndNode);

        switch (rand)
        {
        case NodeName.StartNode:
            node = new Node(nTree.Root);
            break;

        case NodeName.MonsterNode:
            node = new MonsterNode(nTree.Root);
            break;

        case NodeName.EliteMonstaerNode:
            node = new EliteMonsterNode(nTree.Root);
            break;

        case NodeName.EventNode:
            node = new EventNode(nTree.Root);
            break;

        case NodeName.FogNode:
            node = new FogNode(nTree.Root);
            break;

        case NodeName.ShopNode:
            node = new ShopNode(nTree.Root);
            break;

        case NodeName.CampNode:
            node = new CampNode(nTree.Root);
            break;

        default:
            Debug.Log("RandomNode Error");
            break;
        }

        return(node);
    }
Example #2
0
        public override Embed GetEmbed()
        {
            EmbedBuilder eb = new EmbedBuilder();

            eb.WithTitle("Shop");

            if (Page == -1)
            {
                eb.WithColor(BotUtils.Kamtro);

                string s = "";

                for (int i = 0; i < ShopManager.Shop.Count; i++)
                {
                    ShopNode sn = ShopManager.Shop[i];

                    s += $"{(Cursor == i ? CustomEmotes.CursorAnimated:CustomEmotes.CursorBlankSpace)} {ItemManager.GetItem(sn.ItemID).Name} [{sn.Price} K]\n";
                }

                if (ShopManager.Shop.Count == 0)
                {
                    s = "Shop Unavailable.";
                }

                eb.AddField("Daily Listings", s);

                eb.AddField("Current Balance", $"{Customer.Kamtrokens}");

                eb.WithDescription("Select an item to purchase, prices are listed next to the item name");
            }
            else
            {
                if (Page > ShopManager.Shop.Count)
                {
                    Page = 0;
                }

                ShopNode sn = ShopManager.Shop[Page];

                eb.WithColor(Item.GetColorFromRarity(ItemManager.GetItem(sn.ItemID).Rarity));

                eb.AddField(ItemManager.GetItem(sn.ItemID).Name, ItemManager.GetItem(sn.ItemID).Description);

                eb.AddField("Price", $"{sn.Price} Kamtrokens");

                eb.AddField("Item Count", $"{ItemCount}");
                eb.AddField("Total Cost", $"{sn.Price * ItemCount}");
                eb.AddField("Current Balance", $"{Customer.Kamtrokens} Kamtroken{(Customer.Kamtrokens == 1 ? "":"s")}");

                eb.WithDescription("Use the arrows to increase or decrease the number of items you want to purchase, then use the checkmark to buy them.");
            }

            if (ShowBadNumberWarn)
            {
                ShowBadNumberWarn = false;
                eb.AddField("Error", "Please enter a valid number of items greater than 0");
            }

            if (PurchaseThank)
            {
                PurchaseThank = false;
                eb.AddField("Purchase Successful!", "Thank you for your purchase");
            }

            AddMenu(eb);

            return(eb.Build());
        }