示例#1
0
        //お店のときはお店の倍率にあわせて表示を変える。
        //もっといい方法ありそうだけど、わからん。あとメソッドの名前変えるべきか。
        public void ShowItem(TextBox textline, Charactar chara, ItemShop shop)
        {
            //表示する前に初期化
            textline.Text = "";

            foreach (Item i in chara.ItemList.Values)
            {
                if (i != null)
                {
                    textline.Text += i.Name + ":" + i.Count + "個   " + (int)(i.Value * shop.BuyScale) + " gold/個" + "\r\n";
                }
            }
        }
示例#2
0
        public void ShowItem(TextBox textline, ItemShop shop)
        {
            //表示する前に初期化
            textline.Text = "";

            textline.Text += "お店の名前:\r\n「" + shop.Name + "」\r\n\r\n";
            foreach (Item i in shop.ItemList.Values)
            {
                if (i != null)
                {
                    textline.Text += i.Name + ":" + i.Count + "個   " + (int)(i.Value * shop.SellScale) + " gold/個" + "\r\n";
                }
            }
        }
示例#3
0
        //ゲームマスターが作られたときに初期化する。RPG作るの大変だなー
        public GameMaster()
        {
            //アイテム辞書を読み込む
            ItemDictionary itemdic = new ItemDictionary();

            turn = 0;//よくわからないターン数

            //キャラクターを適当に作る。特に表示とかはしてない。

            //戦後は弓3個と薬草10個持っている
            sengo = new Charactar("戦後");
            sengo.AddItem(itemdic.GetItem("弓", 3));
            sengo.AddItem(itemdic.GetItem("薬草", 10));


            uruoi = new Charactar("うるおい");
            //うるおいは薬草5個、圧を3個持ってる
            uruoi.AddItem(itemdic.GetItem("薬草", 5));
            uruoi.AddItem(itemdic.GetItem("圧", 3));

            //うるおいちゃんだけHPが高い!今回は意味ない
            uruoi.MaxHp += 6;
            uruoi.Hp    += 6;

            nampo = new Charactar("Nampo");
            //Nampoは薬草を3個持ってる
            //アイテム辞書からアイテムを追加、間違ったアイテム名を指定したときはテストアイテムがでる。
            nampo.AddItem(itemdic.GetItem("薬草???", 3));

            //お店を作成
            itemshop = new ItemShop("お店1");
            itemshop.AddItem(itemdic.GetItem("薬草", 5));
            itemshop.AddItem(itemdic.GetItem("弓", 3));
            itemshop.AddItem(itemdic.GetItem("矢", 3));
            itemshop.AddItem(itemdic.GetItem("盾", 3));

            //パーティ作成
            MainParty = new List <Charactar>();
            MainParty.Add(sengo);
            MainParty.Add(uruoi);
            MainParty.Add(nampo);

            //ここ微妙。もっといい書き方あると思う。パーティクラスにしたほうがよさそう。
            SelectedChara = 0;
            PartyGold     = 103;
        }
示例#4
0
        public void CharaShowItem(TextBox textbox, ItemShop shop)
        {
            switch (SelectedChara)
            {
            case 0:
                ShowItem(textbox, sengo, shop);
                break;

            case 1:
                ShowItem(textbox, uruoi, shop);
                break;

            case 2:
                ShowItem(textbox, nampo, shop);
                break;

            default: break;
            }
        }