コード例 #1
0
        public acegiak_SultanInterestPreference(acegiak_Romancable romancable)
        {
            Romancable = romancable;
            amount     = (float)((Stat.Rnd2.NextDouble() * 2) - 0.9);

            History sultanHistory = XRLCore.Core.Game.sultanHistory;

            HistoricEntityList entitiesWherePropertyEquals = sultanHistory.GetEntitiesWherePropertyEquals("type", "sultan");

            this.faveSultan = entitiesWherePropertyEquals.GetRandomElement(Stat.Rand);


            List <HistoricEvent> list = new List <HistoricEvent>();

            for (int i = 0; i < this.faveSultan.events.Count; i++)
            {
                if (this.faveSultan.events[i].hasEventProperty("gospel"))
                {
                    list.Add(this.faveSultan.events[i]);
                }
            }
            if (list.Count > 0)
            {
                while (this.tales.Count < 2)
                {
                    this.tales.Add(list[Stat.Random(0, list.Count - 1)]);
                }
            }
            //IPart.AddPlayerMessage("They "+(amount>0?"like":"dislike")+" "+this.faveSultan.GetCurrentSnapshot().GetProperty("name","sultan"));
        }
コード例 #2
0
        public static void Read(SerializationReader Reader, acegiak_Romancable romancable)
        {
            string classname         = Reader.ReadString();
            Type   type              = Type.GetType(classname);
            acegiak_RomanceBoon boon = (acegiak_RomanceBoon)Activator.CreateInstance(type, romancable);

            boon.setRomancable(romancable);
            romancable.boons.Add(boon);
        }
コード例 #3
0
        public static void Read(SerializationReader Reader, acegiak_Romancable romancable)
        {
            string classname = Reader.ReadString();
            Type   type      = Type.GetType(classname);
            acegiak_RomancePreference preference = (acegiak_RomancePreference)Activator.CreateInstance(type, romancable);

            preference.setRomancable(romancable);
            preference.Load(Reader);
            romancable.preferences.Add(preference);
        }
コード例 #4
0
        public acegiak_WeaponPreference(acegiak_Romancable romancable)
        {
            GameObject sample = GameObjectFactory.Factory.CreateSampleObject(EncountersAPI.GetARandomDescendentOf("MeleeWeapon"));

            sample.MakeUnderstood();
            this.wantedType  = sample.GetPart <MeleeWeapon>().Skill;
            this.ExampleName = sample.ShortDisplayName;
            Romancable       = romancable;

            amount = (float)((Stat.Rnd2.NextDouble() * 2) - 0.9);
            //IPart.AddPlayerMessage("They "+(amount>0?"like":"dislike")+" "+this.wantedType);
        }
コード例 #5
0
 public acegiak_FactionInterestPreference(acegiak_Romancable romancable)
 {
     Romancable = romancable;
     amount     = (float)(Stat.Rnd2.NextDouble() * 2 - 0.9);
     if (romancable.ParentObject.pBrain.FactionFeelings.Count > 0)
     {
         this.interestedFaction = romancable.ParentObject.pBrain.FactionFeelings.ElementAt(Stat.Rnd2.Next(0, romancable.ParentObject.pBrain.FactionFeelings.Count)).Key;
         this.amount           += romancable.ParentObject.pBrain.FactionFeelings[this.interestedFaction];
     }
     else
     {
         this.interestedFaction = Factions.GetRandomFaction().Name;
     }
     //IPart.AddPlayerMessage("They "+(amount>0?"like":"dislike")+" "+this.interestedFaction);
 }
コード例 #6
0
        public acegiak_FoodPreference(acegiak_Romancable romancable)
        {
            GameObject sample = EncountersAPI.GetAnObject((GameObjectBlueprint b) => b.HasPart("PreparedCookingIngredient"));

            if (sample == null)
            {
                sample = GameObjectFactory.Factory.CreateSampleObject(EncountersAPI.GetARandomDescendentOf("Food"));
            }

            sample.MakeUnderstood();
            this.wantedType = getType(sample);

            this.ExampleName = sample.DisplayNameOnly;
            Romancable       = romancable;
            amount           = (float)((Stat.Rnd2.NextDouble() * 2) - 0.9);
            //IPart.AddPlayerMessage("They "+(amount>0?"like":"dislike")+" "+this.wantedType);
        }
コード例 #7
0
        public acegiak_PatriotPreference(acegiak_Romancable romancable)
        {
            Romancable = romancable;


            List <HistoricEntity> villages = HistoryAPI.GetVillages();
            // .Name.Contains("villagers")
            int high = 0;

            foreach (KeyValuePair <string, int> item in  romancable.ParentObject.pBrain.FactionMembership)
            {
                if (item.Key.Contains("villagers"))
                {
                    if (item.Value > high && villages.Select(v => v.GetCurrentSnapshot()).Where(v => item.Key.Contains(v.Name)).Count() > 0)
                    {
                        village = villages.Select(v => v.GetCurrentSnapshot()).Where(v => item.Key.Contains(v.Name)).FirstOrDefault();
                        high    = item.Value;
                        faction = Factions.get(item.Key);
                    }
                }
            }



            amount = (float)((Stat.Rnd2.NextDouble() * 1.5) - 0.5);



            if (village == null || faction == null)
            {
                throw new Exception("Not a villager.");
            }
            //IPart.AddPlayerMessage("They "+(amount>0?"like":"dislike")+" "+this.interestedFaction);
            List <JournalVillageNote> notesForVillage = JournalAPI.GetNotesForVillage(village.entity.id);

            while (this.historytales.Count < 2)
            {
                this.historytales.Add(notesForVillage[Stat.Rnd2.Next(0, notesForVillage.Count)]);
            }
        }
コード例 #8
0
        public override bool FireEvent(Event E)
        {
            if (E.ID == "GetInventoryActions")
            {
                if (ParentObject.pBrain.GetFeeling(XRLCore.Core.Game.Player.Body) > 5)
                {
                    E.GetParameter <EventParameterGetInventoryActions>("Actions").AddAction("Gift", 'G', false, "&Wg&yift", "InvCommandGift", 10);
                }
            }
            if (E.ID == "InvCommandGift" && Gift(E.GetGameObjectParameter("Owner"), FromDialog: true))
            {
                E.RequestInterfaceExit();
            }
            if (E.ID == "PlayerBeginConversation")
            {
                if (ParentObject.pBrain.GetFeeling(XRLCore.Core.Game.Player.Body) > 0)
                {
                    HandleBeginConversation(E.GetParameter <Conversation>("Conversation"), E.GetParameter <GameObject>("Speaker"));
                    GameObject speaker = E.GetParameter <GameObject>("Speaker");
                    if (speaker.GetPart <acegiak_Romancable>() != null)
                    {
                        //IPart.AddPlayerMessage("Ticks passed:"+(XRLCore.Core.Game.TimeTicks - speaker.GetPart<acegiak_Romancable>().lastseen).ToString());
                        int newPatience = (int)Math.Floor((float)(XRLCore.Core.Game.TimeTicks - speaker.GetPart <acegiak_Romancable>().lastseen) / 1200);

                        //IPart.AddPlayerMessage("patience earned:"+(newPatience).ToString());
                        if (speaker.GetPart <acegiak_Romancable>().lastseen == 0)
                        {
                            newPatience = 0;
                        }
                        if (newPatience > 10)
                        {
                            newPatience = 10;
                        }
                        speaker.GetPart <acegiak_Romancable>().lastseen = (int)XRLCore.Core.Game.TimeTicks;
                        speaker.GetPart <acegiak_Romancable>().patience = speaker.GetPart <acegiak_Romancable>().patience + newPatience;
                    }
                    // if(patience > 5 && ParentObject.pBrain.GetFeeling(XRLCore.Core.Game.Player.Body)>0 && ParentObject.pBrain.GetFeeling(XRLCore.Core.Game.Player.Body)<5){
                    //  ParentObject.pBrain.AdjustFeeling(XRLCore.Core.Game.Player.Body,(int)Math.Min(5,patience-5));
                    // }
                }
            }
            if (E.ID == "VisitConversationNode")
            {
                if (E.GetParameter <ConversationNode>("CurrentNode") != null && E.GetParameter <ConversationNode>("CurrentNode") is acegiak_RomanceChatNode)
                {
                    E.SetParameter("CurrentNode", BuildNode((acegiak_RomanceChatNode)E.GetParameter <ConversationNode>("CurrentNode")));
                }
            }


            if (E.ID == "OwnerGetInventoryActions")
            {
                GameObject         gameObjectParameter2 = E.GetGameObjectParameter("Object");
                acegiak_Romancable romancable           = gameObjectParameter2.GetPart <acegiak_Romancable>();
                if (romancable != null && gameObjectParameter2.pBrain.GetFeeling(ParentObject) > 25)
                {
                    E.GetParameter <EventParameterGetInventoryActions>("Actions").AddAction("ArrangeDate", 'r', true, "A&Wr&yrange a Date", "InvCommandArrangeDate");
                }
            }
            if (E.ID == "InvCommandArrangeDate")
            {
                GameObject         gameObjectParameter2 = E.GetGameObjectParameter("Object");
                acegiak_Romancable romancable           = gameObjectParameter2.GetPart <acegiak_Romancable>();
                if (romancable != null && gameObjectParameter2.pBrain.GetFeeling(ParentObject) > 25)
                {
                    this.date = gameObjectParameter2;
                    Popup.Show(gameObjectParameter2.ShortDisplayName + " seems amenable to the idea.");
                }
            }

            if (E.ID == "OwnerGetInventoryActions")
            {
                GameObject gameObjectParameter2 = E.GetGameObjectParameter("Object");
                if (date != null && date.pBrain.GetFeeling(ParentObject) > 25)
                {
                    E.GetParameter <EventParameterGetInventoryActions>("Actions").AddAction("BeginDate", 'j', true, "Invite " + this.date.ShortDisplayName + " to &Wj&yoin you", "InvCommandBeginDate");
                }
            }
            if (E.ID == "InvCommandBeginDate")
            {
                GameObject         GO         = E.GetGameObjectParameter("Object");
                acegiak_Romancable romancable = this.date.GetPart <acegiak_Romancable>();
                if (romancable != null && date.pBrain.GetFeeling(ParentObject) > 25)
                {
                    this.date.pBrain.PushGoal(new acegiak_WaitWith(10, ParentObject));
                    this.date.pBrain.PushGoal(new acegiak_DateAssess(ParentObject, GO));
                    this.date.pBrain.PushGoal(new acegiak_MoveTo(GO, true));
                    E.RequestInterfaceExit();

                    IPart.AddPlayerMessage(date.ShortDisplayName + " comes to join you at " + GO.the + GO.ShortDisplayName);
                }
            }
            if (E.ID == "CommandRemoveObject" && XRLCore.Core.Game != null && !ParentObject.IsPlayer() && ParentObject != null && ParentObject.id != null)
            {
                GameObject G = E.GetGameObjectParameter("Object");
                if (G.GetPropertyOrTag("GiftedTo") == ParentObject.id && assessGift(G, ParentObject).amount > 0)
                {
                    Popup.Show(ParentObject.The + ParentObject.DisplayNameOnly + " cannot bear to part with " + G.the + G.DisplayNameOnly + ".");
                }
            }



            return(base.FireEvent(E));
        }
コード例 #9
0
 public void setRomancable(acegiak_Romancable romancable)
 {
     this.Romancable = romancable;
 }
コード例 #10
0
ファイル: RomanceGiftBoon.cs プロジェクト: acegiak/qudkissing
 public acegiak_GiftBoon(acegiak_Romancable romancable)
 {
     Romancable = romancable;
 }
コード例 #11
0
ファイル: RomanceMealBoon.cs プロジェクト: acegiak/qudkissing
 public acegiak_MealBoon(acegiak_Romancable romancable)
 {
     Romancable = romancable;
 }
コード例 #12
0
 public acegiak_FollowBoon(acegiak_Romancable romancable)
 {
     Romancable = romancable;
 }