示例#1
0
        void generateStartingAction()
        {
            int next_action = rnd1.Next(0, 3);

            if (next_action == 0)
            {
                this.subActions.Add(new Nothing());
            }
            else
            {
                if (next_action == 1)
                {
                    NPC npc = new NPC();
                    this.subActions.Add(new GoTo(npc));
                    this.subActions.Add(new Listen(npc));
                    if (SimpleQuest.GetSubquestGeneration())
                    {
                        subQuest sq = new subQuest();
                        sq.quest.InitializeStartingStrategies();
                        sq.quest.InitializeObjects();
                        subActions.Add(sq);
                    }
                    this.subActions.Add(new Listen(npc));
                }
                else
                {
                    if (next_action == 2)
                    {
                        Item i = new Item();
                        this.subActions.Add(new GoTo(i));
                        this.subActions.Add(new Get(i));
                        this.subActions.Add(new Read(i));
                    }
                    else
                    {
                        if (obj == null)
                        {
                            Item obj = new Item();
                        }
                        NPC npc = new NPC();
                        this.subActions.Add(new Get(obj));
                        if (SimpleQuest.GetSubquestGeneration())
                        {
                            subQuest sq = new subQuest();
                            sq.quest.InitializeStartingStrategies();
                            sq.quest.InitializeObjects();
                            subActions.Add(sq);
                        }
                        this.subActions.Add(new Give(obj));
                        this.subActions.Add(new Listen(npc));
                    }
                }
            }
        }
示例#2
0
        void generateStartingAction()
        {
            int current_action = rnd1.Next(0, 4);

            if (current_action == 0)
            {
                subActions.Add(new Nothing());
            }
            else
            {
                if (current_action == 1)
                {
                    subActions.Add(new Steal(obj));
                }
                else
                {
                    if (current_action == 2)
                    {
                        subActions.Add(new GoTo(obj));
                        subActions.Add(new Gather(obj));
                    }
                    else
                    {
                        subActions.Add(new GoTo(obj));
                        subActions.Add(new Get(obj));
                        NPC npc = new NPC();
                        subActions.Add(new GoTo(npc));
                        if (SimpleQuest.GetSubquestGeneration())
                        {
                            subQuest sq = new subQuest();
                            sq.quest.InitializeStartingStrategies();
                            sq.quest.InitializeObjects();
                            subActions.Add(sq);
                        }
                        subActions.Add(new Exchange(obj, npc));
                    }
                }
            }
        }