示例#1
0
        private string Found(Riches r)
        {
            List <string> things = new List <string>();

            if (r.gold > 0)
            {
                things.Add(string.Format("{0} gold", r.gold));
            }
            if (r.food > 0)
            {
                things.Add(string.Format("{0} food", r.food));
            }
            if (r.items.Count > 0)
            {
                string s;
                if (r.items.Count == 1)
                {
                    s = "the treasure " + r.items[0].MetaName();
                }
                else
                {
                    s  = "the following treasures: ";
                    s += r.items.Select(item => item.MetaName());
                }
                things.Add(s);
            }
            return(string.Format("They found {0}.", things.FancyJoin("nothing")));
        }
示例#2
0
        private void QuestFailContent()
        {
            Riches riches = quest.reward.Generate();

            P.ui.SetTitle("Quest Failed...");
            P.ui.ClearDescription();
            string s = string.Format(
                QUEST_FAILED,
                CharacterEntity.MetaNames(questers),
                quest.name
                );

            P.ui.AddDescription(s);
            History.Append(s);
            Game.data.quests.Remove(quest);
        }
示例#3
0
        private void QuestSuccessContent()
        {
            Riches riches = quest.reward.Generate();

            P.ui.SetTitle("Quest Succeeded!");
            P.ui.ClearDescription();
            string s = string.Format(
                QUEST_SUCCESS,
                CharacterEntity.MetaNames(questers),
                quest.name
                );

            s += "\n";
            s += Found(riches);
            P.ui.AddDescription(s);
            History.Append(s);
            Game.data.quests.Remove(quest);
            Game.data.inventory.Add(riches);
        }
示例#4
0
 public void Add(Riches other)
 {
     gold += other.gold;
     food += other.food;
     items.AddRange(other.items);
 }