Ejemplo n.º 1
0
        public acegiak_RomanceChatNode BuildNode(acegiak_RomanceChatNode node)
        {
            havePreference();
            this.lockout = false;
            node.Choices.Clear();
            //IPart.AddPlayerMessage("They are:"+ParentObject.pBrain.GetOpinion(XRLCore.Core.Game.Player.Body)+": "+ParentObject.pBrain.GetFeeling(XRLCore.Core.Game.Player.Body).ToString()+" patience:"+patience.ToString());

            if (ParentObject.pBrain.GetFeeling(XRLCore.Core.Game.Player.Body) < 1 && patience > 0)
            {
                ParentObject.pBrain.SetFeeling(XRLCore.Core.Game.Player.Body, 1);
            }

            if (ParentObject.pBrain.GetFeeling(XRLCore.Core.Game.Player.Body) < 1 || patience <= 0)
            {
                List <string> Stories = new List <string>(new string[] {
                    "Sorry, I have other things to do.",
                    "Anyway, I'm very busy.",
                    "Maybe we could talk some more another time?"
                });
                node.Text = node.Text + "\n\n" + Stories[Stat.Rnd2.Next(0, Stories.Count - 1)];

                ConversationChoice returntostart = new ConversationChoice();
                returntostart.Ordinal    = 800;
                returntostart.Text       = "Ok.";
                returntostart.GotoID     = node.ParentConversation.StartNodes[0].ID;
                returntostart.ParentNode = node;
                node.Choices.Add(returntostart);
            }
            else if (boons.Where(b => b.BoonReady(XRLCore.Core.Game.Player.Body)).Count() > 0)
            {
                acegiak_RomanceBoon boon = boons.Where(b => b.BoonReady(XRLCore.Core.Game.Player.Body)).OrderBy(o => Stat.Rnd2.NextDouble()).FirstOrDefault();
                try
                {
                    node = boon.BuildNode(node);
                    node.InsertMyReaction(ParentObject, XRLCore.Core.Game.Player.Body);
                    node.ExpandText(GetSelfEntity());
                }
                catch (Exception e)
                {
                    node.Text = e.ToString() + "\n\n" + node.Text;
                }
            }
            else
            {
                int c             = 0;
                int whichquestion = 0;
                do
                {
                    whichquestion = Stat.Rnd2.Next(0, preferences.Count);
                    c++;
                }while(whichquestion == lastQuestion && c < 5);
                lastQuestion = whichquestion;
                try
                {
                    node = preferences[whichquestion].BuildNode(node);
                    node.InsertMyReaction(ParentObject, XRLCore.Core.Game.Player.Body);
                    node.ExpandText(GetSelfEntity());
                }
                catch (Exception e)
                {
                    node.Text = e.ToString() + "\n\n" + node.Text;
                }

                if (ParentObject.pBrain.GetFeeling(XRLCore.Core.Game.Player.Body) > 5)
                {
                    acegiak_RomanceChatChoice giftoption = new acegiak_RomanceChatChoice();
                    giftoption.Ordinal    = 900;
                    giftoption.Text       = "[Offer A Gift]";
                    giftoption.action     = "*Gift";
                    giftoption.ParentNode = node;
                    giftoption.GotoID     = "End";
                    node.Choices.Add(giftoption);
                }
                if (ParentObject.pBrain.GetFeeling(XRLCore.Core.Game.Player.Body) >= 25)
                {
                    acegiak_RomanceChatChoice kissoption = new acegiak_RomanceChatChoice();
                    kissoption.Ordinal    = 910;
                    kissoption.Text       = "[Propose a Date]";
                    kissoption.action     = "*Date";
                    kissoption.ParentNode = node;
                    kissoption.GotoID     = "End";
                    node.Choices.Add(kissoption);
                }
                if (ParentObject.GetPart <acegiak_Kissable>() != null && ParentObject.pBrain.GetFeeling(XRLCore.Core.Game.Player.Body) >= 55)
                {
                    acegiak_RomanceChatChoice kissoption = new acegiak_RomanceChatChoice();
                    kissoption.Ordinal    = 910;
                    kissoption.Text       = "[Attempt to Kiss]";
                    kissoption.action     = "*Kiss";
                    kissoption.ParentNode = node;
                    kissoption.GotoID     = "End";
                    node.Choices.Add(kissoption);
                }
            }
            if (ParentObject.pBrain.GetFeeling(XRLCore.Core.Game.Player.Body) < 1)
            {
                ParentObject.pBrain.SetFeeling(XRLCore.Core.Game.Player.Body, 1);
            }



            patience--;


            ConversationChoice liveanddrink = new ConversationChoice();

            liveanddrink.Ordinal    = 99999;
            liveanddrink.Text       = "Live and drink.";
            liveanddrink.GotoID     = "End";
            liveanddrink.ParentNode = node;
            node.Choices.Add(liveanddrink);


            return(node);
        }