Пример #1
0
 private static Talk CreateTalk(string line)
 {
     var talk = new Talk();
     talk.Title = GetTitle(line);
     talk.Minutes = GetMinutes(line);
     talk.Description = line;
     return talk;
 }
Пример #2
0
 void Start()
 {
     careerCoolDown = 0;
     countdown = 0;
     button.GetComponent<Button>().interactable = true;
     buttonImage.SetActive(false);
     options = canvas.GetComponent<Options>();
     display = canvas.GetComponent<Display>();
     relationship = canvas.GetComponent<Relationship>();
     talk = canvas.GetComponent<Talk>();
     CareerFocus = false;
 }
    //send to the modal panel to set up the buttons and functions to call
    //    public void TestButtons() {
    //modalPanel.Choice ("Please make a choice\nTest them all", myResponse1Action, myResponse2Action, myResponse3Action);
    //        modalPanel.Choice ("Please make a choice\nTest them all", TestResponse1, TestResponse2,TestResponse3);
    //    }
    //    public void TestButtonsImage() {
    //        modalPanel.Choice ("This is the guard\nPlease test the buttons below", icon, TestResponse1, TestResponse2,TestResponse3);
    //    }
    public void OnTriggerEnter(Collider col)
    {
        // If the colliding gameobject is the player...
        if (col.CompareTag ("Player")) {
            Debug.Log ("guard trigger");
            if (isBellRung) {
                currentTalk = timesBellRung;
                isBellRung = false;
            }

            talk = database.talkList [currentTalk];
            modalPanel.Choice (talk.talkSpeech, icon, talk.talkResponse, TestResponse1, talk.talkResponse1, TestResponse2, talk.talkResponse2, TestResponse3);
        }
    }
Пример #4
0
        void Spawn(DudeAnimationInfo LoadedCharacter, Scene.Document LoadedScene)
        {
            var ViewSize = new Size { Width = 640, Height = 480 };

            var Container = new IHTMLDiv();
            Container.AttachToDocument();
            Container.style.SetSize(ViewSize.Width, ViewSize.Height + 22);
            Container.KeepInCenter();

            //Container.MakeCSSShaderCrumple();

            var Wallpaper = new IHTMLDiv().AttachTo(Container);
            Wallpaper.style.SetSize(ViewSize.Width, ViewSize.Height + 22);


            new power().ToBackground(Wallpaper.style);
            Wallpaper.style.position = IStyle.PositionEnum.absolute;
            Wallpaper.style.backgroundRepeat = "no-repeat";
            Wallpaper.style.backgroundPosition = "center center";





            var Margin = 48;
            var MarginSafe = 72;



            var CurrentFrame = LoadedScene.Frames.Randomize().First();
            //var CurrentFrame = LoadedScene.Frames.Single(f => f.Name == "C");

            var Room = new IHTMLDiv();



            Room.style.border = "1px solid #00ff00";
            Room.style.SetSize(ViewSize.Width, ViewSize.Height);
            Room.style.position = IStyle.PositionEnum.absolute;
            Room.style.overflow = IStyle.OverflowEnum.hidden;

            Room.AttachTo(Container);
            Room.style.SetLocation(0, 22);

            //Room.AttachToDocument();
            //Room.KeepInCenter();




            var tween = Room.ToOpacityTween();

            Action HideRoom = () => tween.Value = 1;
            Action ShowRoom = () => tween.Value = 0;

            HideRoom();

            //var GroundOverlay2 = new IHTMLDiv();

            //GroundOverlay2.style.backgroundColor = Color.Blue;
            ////GroundOverlay.style.Opacity = 0;

            //GroundOverlay2.style.position = IStyle.PositionEnum.absolute;
            //GroundOverlay2.style.SetLocation(0, 0, ViewSize.Width, ViewSize.Height);
            //GroundOverlay2.AttachTo(Room);

            var LostInTime_Images = new ImpAdventures.HTML.Pages.LostInTimeImages().Images;

            var BackgroundImage = new IHTMLImage();

            LostInTime_Images.FirstOrDefault(
                                   k => k.src.SkipUntilLastIfAny("/") == CurrentFrame.Image.Source.SkipUntilLastIfAny("/")
                               ).With(
                                   ImageSource =>
                                   {
                                       Console.WriteLine(ImageSource.src);
                                       BackgroundImage.src = ImageSource.src;
                                   }
                               );

            BackgroundImage.style.SetLocation(0, 0, ViewSize.Width, ViewSize.Height);
            BackgroundImage.alt = "BackgroundImage";
            BackgroundImage.AttachTo(Room);

            //GroundOverlay2.style.backgroundImage = "url(" + CurrentFrame.Image.Source + ")";
            //BackgroundImage.InvokeOnComplete(
            //    delegate
            //    {
            //        //BackgroundImage.style.backgroundColor = Color.Red;
            //        //BackgroundImage.style.SetLocation(0,0, ViewSize.Width, ViewSize.Height);
            //        BackgroundImage.AttachTo(GroundOverlay2);
            //    }
            //);


            var GroundOverlay = new IHTMLDiv();

            GroundOverlay.style.backgroundColor = Color.Blue;
            GroundOverlay.style.Opacity = 0;
            GroundOverlay.style.SetLocation(0, 0, ViewSize.Width, ViewSize.Height);
            GroundOverlay.AttachTo(Room);

            var Ground = new IHTMLDiv();

            Ground.style.SetLocation(0, 0, ViewSize.Width, ViewSize.Height);
            Ground.AttachTo(Room);




            var AnimateRoomChange = default(Action<Action>);

            #region TryToChangeRooms
            Func<TryToChangeRoomsArgs, bool> TryToChangeRooms =
                e =>
                {
                    if (e == null)
                        return false;

                    if (e.NextRoomSelector == null) throw new ArgumentNullException("NextRoomSelector");

                    var next = LoadedScene.Frames.SingleOrDefault(e.NextRoomSelector);

                    var r = next != null;

                    if (r)
                    {
                        AnimateRoomChange(
                            delegate
                            {
                                CurrentFrame = next;

                                Console.WriteLine("AnimateRoomChange");

                                LostInTime_Images.FirstOrDefault(
                                    k => k.src.SkipUntilLastIfAny("/") == CurrentFrame.Image.Source.SkipUntilLastIfAny("/")
                                ).With(
                                    ImageSource =>
                                    {
                                        Console.WriteLine(ImageSource.src);
                                        BackgroundImage.src = ImageSource.src;
                                    }
                                );

                                //GroundOverlay2.style.backgroundImage = "url(" + CurrentFrame.Image.Source + ")";
                                //BackgroundImage.src = CurrentFrame.Image.Source;

                                e.ReadyToTeleport();
                            }
                        );
                    }


                    return r;
                };
            #endregion


            var dude = CreateDude(LoadedCharacter);

            dude.Control.AttachTo(Ground);

            #region Doors
            var Doors = new[]
                {
                    new TryToChangeRoomsArgs
                            {
                                Condition = () => dude.CurrentLocation.X > ViewSize.Width - Margin,
                                NextRoomSelector = f => f.Name == CurrentFrame.Right,
                                ReadyToTeleport = delegate
                                {

                                    dude.TeleportTo(-MarginSafe, dude.CurrentLocation.Y);
                                    dude.LookAt(new Point(MarginSafe, (int)dude.CurrentLocation.Y));
                                }
                            },
                    new TryToChangeRoomsArgs
                            {
                                Condition = () => dude.CurrentLocation.X < Margin,
                                NextRoomSelector = f => f.Name == CurrentFrame.Left,
                                ReadyToTeleport = delegate
                                {

                                    dude.TeleportTo(ViewSize.Width + MarginSafe, dude.CurrentLocation.Y);
                                    dude.LookAt(new Point(ViewSize.Width - MarginSafe, (int)dude.CurrentLocation.Y));
                                }
                            },
                    new TryToChangeRoomsArgs
                            {
                                Condition = () => dude.CurrentLocation.Y < Margin,
                                NextRoomSelector = f => f.Name == CurrentFrame.Top,
                                ReadyToTeleport = delegate
                                {

                                     dude.TeleportTo(dude.CurrentLocation.X, ViewSize.Height + MarginSafe);
                                    dude.LookAt(new Point((int)dude.CurrentLocation.X, ViewSize.Height - MarginSafe));

                                }
                            },
                    new TryToChangeRoomsArgs
                            {
                                Condition = () => dude.CurrentLocation.Y > ViewSize.Height - Margin,
                                NextRoomSelector = f => f.Name == CurrentFrame.Bottom,
                                ReadyToTeleport = delegate
                                {

                                  dude.TeleportTo(dude.CurrentLocation.X, -Margin);
                                dude.LookAt(new Point((int)dude.CurrentLocation.X, MarginSafe));

                                }
                            }
                };
            #endregion

            Console.WriteLine(new { Doors = Doors.Length });

            Doors.WithEachIndex(
                (x, index) =>
                {
                    Console.WriteLine(new { index, x });
                    Console.WriteLine(new { index, x.Condition });
                }
            );


            var ChangeRoom = new ChangeRoom { autobuffer = true };
            var Talk = new Talk { autobuffer = true };
            var Argh_RChannel = new Argh_RChannel { autobuffer = true };
            var Argh_LChannel = new Argh_LChannel { autobuffer = true };
            var Argh_Disabled = false;
            var Argh_VolumeMultiplier = 1.0;

            #region Argh_Stereo
            Action<double, double> Argh_Stereo =
                (volume, balance) =>
                {
                    if (Argh_Disabled)
                        return;

                    Argh_RChannel.AttachToDocument();
                    Argh_LChannel.AttachToDocument();

                    Argh_RChannel.volume = Argh_VolumeMultiplier * volume * balance;
                    Argh_LChannel.volume = Argh_VolumeMultiplier * volume * (1 - balance);

                    Argh_RChannel.play();
                    Argh_LChannel.play();

                    Argh_RChannel = new Argh_RChannel { autobuffer = true };
                    Argh_LChannel = new Argh_LChannel { autobuffer = true };

                    Argh_Disabled = true;
                    Argh_VolumeMultiplier /= 2;

                    new Timer(t => Argh_Disabled = false).StartTimeout(800);
                    new Timer(t => Argh_VolumeMultiplier = 1).StartTimeout(5000);
                };
            #endregion

            #region PrintText
            Action<string, Action> PrintText =
                (text, done) =>
                {
                    Talk.AttachToDocument();
                    Talk.load();
                    Talk.volume = Math.Min(1, dude.Zoom.DynamicZoom / 4);
                    Talk.play();
                    Talk = new Talk { autobuffer = true };

                    text.Length.Range().AsyncForEach(
                        i =>
                        {
                            Wallpaper.innerText = text.Left(i + 1);

                            var c = text[i];

                            if (LoadedScene.SlowText.Contains("" + c))
                                return 100.Random();

                            return 50.Random();
                        }, done
                    );
                };
            #endregion

            Action<string, Action> PrintRandomText =
                (text, done) => PrintText(text.Split(LoadedScene.TextDelimiter).Randomize().First(), done);




            dude.DoneWalking +=
                delegate
                {
                    // compiler bug: cannot invoke Action<func, action> delegate ?

                    System.Console.WriteLine("done walking in " + CurrentFrame.Name + " at " + dude.CurrentLocation);

                    var xFirstOrDefault = Doors.FirstOrDefault(d => d.Condition());

                    System.Console.WriteLine("done walking in " + new { xFirstOrDefault });

                    // Doors null?
                    if (TryToChangeRooms(xFirstOrDefault))
                        return;


                    if (CurrentFrame.Items != null)
                    {
                        var item = CurrentFrame.Items.Where(
                            i => new Point(i.X.ToInt32(), i.Y.ToInt32()).GetRange(dude.CurrentLocation) < i.R.ToInt32()
                            ).FirstOrDefault();

                        if (item != null)
                        {


                            dude.IsSelected = false;
                            dude.LookDown();

                            PrintRandomText(item.Text,
                                delegate
                                {

                                    dude.WalkingOnce +=
                                        delegate
                                        {
                                            Wallpaper.innerText = "";
                                        };

                                    dude.IsSelected = true;
                                }
                            );
                        }
                    }

                };

            #region AnimateRoomChange
            AnimateRoomChange =
                ReadyToTeleport =>
                {
                    var Step1 = default(System.Action);
                    var Step2 = default(System.Action);
                    var Step3 = default(Action);

                    Step1 =
                        delegate
                        {
                            tween.Done -= Step1;

                            ReadyToTeleport();

                            tween.Done += Step2;

                            ShowRoom();
                        };

                    Step2 =
                        delegate
                        {
                            tween.Done -= Step2;

                            dude.DoneWalking += Step3;

                            dude.IsWalking = true;

                        };

                    Step3 =
                        delegate
                        {
                            dude.DoneWalking -= Step3;

                            dude.IsSelected = true;
                        };

                    dude.IsSelected = false;

                    tween.Done += Step1;
                    // go left
                    HideRoom();

                    // http://stackoverflow.com/questions/3009888/autoplay-audio-files-on-an-ipad-with-html5
                    ChangeRoom.AttachToDocument();
                    ChangeRoom.load();
                    ChangeRoom.volume = 0.2;
                    ChangeRoom.play();
                    ChangeRoom = new ChangeRoom();
                };
            #endregion

            var pointer_x = 0;
            var pointer_y = 0;

            #region onmousemove
            Container.onmousemove +=
                ev =>
                {
                    if (Native.Document.pointerLockElement == Container)
                    {
                        if (dude.IsSelected)
                        {
                            var volume = Math.Min(1, dude.Zoom.DynamicZoom / 4);
                            var balance = dude.CurrentLocation.X / ViewSize.Width;

                            pointer_x += ev.movementX;
                            pointer_y += ev.movementY;

                            pointer_x = Math.Min(ViewSize.Width - 0, Math.Max(0, pointer_x));
                            pointer_y = Math.Min(ViewSize.Height - 0, Math.Max(0, pointer_y));

                            var OffsetPosition = new Point(pointer_x, pointer_y

                            );

                            Console.WriteLine(OffsetPosition);

                            Argh_Stereo(volume, balance);
                            dude.WalkTo(OffsetPosition);
                        }
                    }
                };
            #endregion

            #region ontouchstart
            Container.ontouchstart +=
                ev =>
                {
                    ev.preventDefault();

                    System.Console.WriteLine(ev.CursorPosition);

                    if (dude.IsSelected)
                    {
                        var volume = Math.Min(1, dude.Zoom.DynamicZoom / 4);
                        var balance = dude.CurrentLocation.X / ViewSize.Width;

                        var ev_OffsetPosition = new Point(
                            ev.touches[0].clientX - Container.Bounds.Left,
                            ev.touches[0].clientY - Container.Bounds.Top
                            );

                        Argh_Stereo(volume, balance);
                        dude.WalkTo(ev_OffsetPosition);
                    }
                };
            #endregion

            #region onclick
            Container.onclick +=
                ev =>
                {
                    ev.preventDefault();

                    if (ev.MouseButton == IEvent.MouseButtonEnum.Middle)
                    {
                        if (Native.Document.pointerLockElement == Container)
                        {
                            Native.Document.exitPointerLock();
                            return;
                        }

                        pointer_x = (int)dude.CurrentLocation.X;
                        pointer_y = (int)dude.CurrentLocation.Y;

                        //Container.requestFullscreen();
                        Container.requestPointerLock();
                        return;
                    }

                    if (ev.Element != Ground)
                        return;

                    System.Console.WriteLine(ev.CursorPosition);

                    if (dude.IsSelected)
                    {
                        var volume = Math.Min(1, dude.Zoom.DynamicZoom / 4);
                        var balance = dude.CurrentLocation.X / ViewSize.Width;

                        Argh_Stereo(volume, balance);
                        dude.WalkTo(ev.OffsetPosition);
                    }
                };
            #endregion



            //GroundOverlay.onclick +=
            //    ev =>
            //    {
            //        if (ev.Element != GroundOverlay)
            //            return;

            //        System.Console.WriteLine(ev.CursorPosition);

            //        if (dude.IsSelected)
            //        {
            //            new Argh().play();

            //            dude.WalkTo(ev.OffsetPosition);
            //        }
            //    };


            dude.TeleportTo(ViewSize.Width / 2, (ViewSize.Height - MarginSafe) / 2);
            dude.LookDown();

            ShowRoom();

            dude.DoneWalkingOnce +=
                delegate
                {
                    PrintRandomText(
                        LoadedScene.IntroText,
                        delegate
                        {

                            dude.WalkingOnce +=
                              delegate
                              {
                                  Wallpaper.innerText = "";
                              };

                            dude.IsSelected = true;
                        }
                    );
                };

            dude.WalkToArc(MarginSafe, dude.Direction);

        }
Пример #5
0
        /// <summary>
        /// Command list for the game
        /// </summary>
        /// <param name="commandOptions">Everything after the 1st occurance of a space</param>
        /// <param name="commandKey">The string before the 1st occurance of a space</param>
        /// <param name="playerData">Player Data</param>
        /// <param name="room">Current room</param>
        /// <returns>Returns Dictionary of commands</returns>
        public static Dictionary <string, Action> Commands(string commandOptions, string commandKey, PlayerSetup.Player playerData, Room.Room room)
        {
            var commandList = new Dictionary <String, Action>
            {
                { "north", () => Movement.Move(playerData, room, "North") },
                { "south", () => Movement.Move(playerData, room, "South") },
                { "east", () => Movement.Move(playerData, room, "East") },
                { "west", () => Movement.Move(playerData, room, "West") },
                { "down", () => Movement.Move(playerData, room, "Down") },
                { "up", () => Movement.Move(playerData, room, "Up") },
                { "look", () => LoadRoom.ReturnRoom(playerData, room, commandOptions, "look") },
                { "l in", () => LoadRoom.ReturnRoom(playerData, room, commandOptions, "look in") },
                { "look in", () => LoadRoom.ReturnRoom(playerData, room, commandOptions, "look in") },
                { "examine", () => LoadRoom.ReturnRoom(playerData, room, commandOptions, "examine") },
                { "touch", () => LoadRoom.ReturnRoom(playerData, room, commandOptions, "touch") },
                { "smell", () => LoadRoom.ReturnRoom(playerData, room, commandOptions, "smell") },
                { "taste", () => LoadRoom.ReturnRoom(playerData, room, commandOptions, "taste") },
                { "score", () => Score.ReturnScore(playerData) },
                { "inventory", () => Inventory.ReturnInventory(playerData.Inventory, playerData) },
                { "equipment", () => Equipment.ShowEquipment(playerData) },
                { "garb", () => Equipment.ShowEquipment(playerData) },
                { "get", () => ManipulateObject.GetItem(room, playerData, commandOptions, commandKey, "item") },
                { "take", () => ManipulateObject.GetItem(room, playerData, commandOptions, commandKey, "item") },
                { "drop", () => ManipulateObject.DropItem(room, playerData, commandOptions, commandKey) },
                { "give", () => ManipulateObject.GiveItem(room, playerData, commandOptions, commandKey, "killable") },
                { "put", () => ManipulateObject.DropItem(room, playerData, commandOptions, commandKey) },
                { "save", () => Save.UpdatePlayer(playerData) },
                { "'", () => Communicate.Say(commandOptions, playerData, room) },
                { "newbie", () => Communicate.NewbieChannel(commandOptions, playerData) },
                { "gossip", () => Communicate.GossipChannel(commandOptions, playerData) },
                { "ooc", () => Communicate.OocChannel(commandOptions, playerData) },
                { "say", () => Communicate.Say(commandOptions, playerData, room) },
                { "sayto", () => Communicate.SayTo(commandOptions, room, playerData) },
                { ">", () => Communicate.SayTo(commandOptions, room, playerData) },
                { "talkto", () => Talk.TalkTo(commandOptions, room, playerData) },
                { "emote", () => Emote.EmoteActionToRoom(commandOptions, playerData) },
                { "quit", () => HubContext.Quit(playerData.HubGuid, room) },
                { "wear", () => Equipment.WearItem(playerData, commandOptions) },
                { "remove", () => Equipment.RemoveItem(playerData, commandOptions) },
                { "doff", () => Equipment.RemoveItem(playerData, commandOptions) },
                { "wield", () => Equipment.WearItem(playerData, commandOptions, true) },
                { "unwield", () => Equipment.RemoveItem(playerData, commandOptions, false, true) },
                { "kill", () => Fight2.PerpareToFight(playerData, room, commandOptions) },
                { "flee", () => Flee.fleeCombat(playerData, room) },

                //spells
                { "c magic missile", () => MagicMissile.StartMagicMissile(playerData, room, commandOptions) },
                { "cast magic missile", () => MagicMissile.StartMagicMissile(playerData, room, commandOptions) },

                { "c armour", () => Armour.StartArmour(playerData, room, commandOptions) },
                { "cast armour", () => Armour.StartArmour(playerData, room, commandOptions) },

                { "c armor", () => Armour.StartArmour(playerData, room, commandOptions) },
                { "cast armor", () => Armour.StartArmour(playerData, room, commandOptions) },

                { "c continual light", () => ContinualLight.StarContinualLight(playerData, room, commandOptions) },
                { "cast continual light", () => ContinualLight.StarContinualLight(playerData, room, commandOptions) },

                { "c invis", () => Invis.StartInvis(playerData, room, commandOptions) },
                { "cast invis", () => Invis.StartInvis(playerData, room, commandOptions) },

                { "c weaken", () => Weaken.StartWeaken(playerData, room, commandOptions) },
                { "cast weaken", () => Weaken.StartWeaken(playerData, room, commandOptions) },

                { "c chill touch", () => ChillTouch.StartChillTouch(playerData, room, commandOptions) },
                { "cast chill touch", () => ChillTouch.StartChillTouch(playerData, room, commandOptions) },

                { "c fly", () => Fly.StartFly(playerData, room, commandOptions) },
                { "cast fly", () => Fly.StartFly(playerData, room, commandOptions) },

                { "c refresh", () => Refresh.StartRefresh(playerData, room, commandOptions) },
                { "cast refresh", () => Refresh.StartRefresh(playerData, room, commandOptions) },

                { "c faerie fire", () => FaerieFire.StartFaerieFire(playerData, room, commandOptions) },
                { "cast faerie fire", () => FaerieFire.StartFaerieFire(playerData, room, commandOptions) },

                { "c teleport", () => Teleport.StartTeleport(playerData, room) },
                { "cast teleport", () => Teleport.StartTeleport(playerData, room) },

                { "c blindness", () => Blindness.StartBlind(playerData, room, commandOptions) },
                { "cast blindess", () => Blindness.StartBlind(playerData, room, commandOptions) },

                { "c haste", () => Haste.StartHaste(playerData, room, commandOptions) },
                { "cast haste", () => Haste.StartHaste(playerData, room, commandOptions) },

                { "c create spring", () => CreateSpring.StartCreateSpring(playerData, room) },
                { "cast create spring", () => CreateSpring.StartCreateSpring(playerData, room) },

                { "c shocking grasp", () =>
                  {
                      var shockingGRasp = new ShockingGrasp();

                      shockingGRasp.StartShockingGrasp(playerData, room, commandOptions);
                  } },
                { "cast shocking grasp", () =>
                  {
                      var shockingGRasp = new ShockingGrasp();

                      shockingGRasp.StartShockingGrasp(playerData, room, commandOptions);
                  } },

                //skills
                { "punch", () => Punch.StartPunch(playerData, room) },
                { "kick", () => Kick.StartKick(playerData, room) },

                //
                { "unlock", () => ManipulateObject.UnlockItem(room, playerData, commandOptions, commandKey) },
                { "lock", () => ManipulateObject.LockItem(room, playerData, commandOptions, commandKey) },
                { "open", () => ManipulateObject.Open(room, playerData, commandOptions, commandKey) },
                { "close", () => ManipulateObject.Close(room, playerData, commandOptions, commandKey) },
                { "drink", () => ManipulateObject.Drink(room, playerData, commandOptions, commandKey) },
                { "help", () => Help.ShowHelp(commandOptions, playerData) },
                { "time", Update.Time.ShowTime },
                { "clock", Update.Time.ShowTime },
                { "skills", () => ShowSkills.ShowPlayerSkills(playerData, commandOptions) },
                { "skills all", () => ShowSkills.ShowPlayerSkills(playerData, commandOptions) },
                { "practice", () => Trainer.Practice(playerData, room, commandOptions) },
                { "list", () => Shop.listItems(playerData, room) },
                { "buy", () => Shop.buyItems(playerData, room, commandOptions) },
                { "quest log", () => Quest.QuestLog(playerData) },
                { "qlog", () => Quest.QuestLog(playerData) },
                { "wake", () => Status.WakePlayer(playerData, room) },
                { "sleep", () => Status.SleepPlayer(playerData, room) },
                { "greet", () => Greet.GreetMob(playerData, room, commandOptions) },
                { "who", () => Who.Connected(playerData) },
                { "affects", () => Affect.Show(playerData) },
                { "follow", () => Follow.FollowThing(playerData, room, commandOptions) },

                //admin
                { "/debug", () => PlayerSetup.Player.DebugPlayer(playerData) }
            };


            return(commandList);
        }
        void Start()
        {
            gameManager = GameObject.Find ("Follow Camera").GetComponent<GmaeManage> ();
            cmaera = GameObject.Find ("Follow Camera");

            NPC_dropoff = GameObject.Find ("NPC_Cat");
            npc_Animator = NPC_dropoff.GetComponent<Animator> ();
            overHereLight = NPC_dropoff.transform.FindChild ("Sphere").transform.FindChild ("Activate").gameObject;//where ever the light is on the NPC_Talk characters. I think it's a child of the 'head'.
            npc_Interact = NPC_dropoff.GetComponent<NPC_Interaction> ();
            catDropOff = GameObject.Find ("Drop-Off Zone (Cat)").GetComponent<MeshRenderer> ();

            cat_Activate = GameObject.Find("kitten").transform.FindChild("Activate").GetComponent<Light>();

            talkCoroutine = GameObject.Find ("NPC_TalkBox").GetComponent<Talk> ();
            jumpAround_Cat = true;
            catMission = true;
        }
Пример #7
0
 public void SetTalk(Talk t, Vector3 OtherPos, Vector3 PlayerPos)
 {
     talk      = t;
     otherPos  = OtherPos;
     playerPos = PlayerPos;
 }
Пример #8
0
        protected override Composite CreateBehavior()
        {
            return(new PrioritySelector(
                       new Decorator(ret => DateTime.Now > saveNow + TimeSpan.FromSeconds(_timeout) && currentstep == 0,
                                     new Action(r => OnTimeout())),
                       // This one will run always kind of a pulse one
                       new Sequence(
                           new Action(r => CountDeath()),
                           new Action(r => IsFateStillActive()),
                           new Action(r => UpdateFateData()),
                           new ActionAlwaysFail() //always fail that the rest of the tree is traveresd
                           ),
                       //Start fighting Fate Mobs but only when we are in close range to the fate position.TBD enhance this filter

                       #region sync//level Sync

                       new Decorator(r => currentfate != null && FateManager.WithinFate && currentfate.MaxLevel < Core.Player.ClassLevel && !Core.Me.IsLevelSynced,
                                     new ActionRunCoroutine(async r =>
            {
                Logging.Write("Applying Level Sync.");

                ToDoList.LevelSync();

                await Coroutine.Sleep(500);

                return false;
            })
                                     ),

                       #endregion sync//level Sync

                       #region Movment

                       new Decorator(ret => currentstep == 1 && Vector3.Distance(Core.Player.Location, Position) > (currentfate.Radius - 10),
                                     CommonBehaviors.MoveAndStop(ret => Position, Distance, stopInRange: true, destinationName: "Moving to Fates.")

                                     ),

                       #region Handin

                       new Decorator(r => currentfate != null && FateManager.WithinFate && currentfate.Icon == FateIconType.KillHandIn && currentfate.TimeLeft.Minutes <= 8,
                                     new Sequence(
                                         new Action(r =>
            {
                Poi.Clear("Handing in items.");
                Logging.Write("Hand-in Fate");
                var npc = GameObjectManager
                          .GetObjectsOfType <BattleCharacter>()
                          .Where(
                    b => b.IsFate && !b.CanAttack && b.FateId == currentfate.Id);
                var q = from s in npc
                        group s by s into g
                        orderby g.Count() descending
                        select g.Key;
                if (q.LastOrDefault() == null)
                {
                    Logging.Write("Could not find handin NPC. Something is wrong.");
                    return;
                }
                tempProvider = CombatTargeting.Instance.Provider;
                CombatTargeting.Instance.Provider = new NullTargetingProvider();
                MoveTo(q.LastOrDefault().Location);
                GameObjectManager.GetObjectByNPCId(q.LastOrDefault().NpcId).Interact();
                Talk.Next();
                InventoryManager.GetBagByInventoryBagId(InventoryBagId.KeyItems).FilledSlots.LastOrDefault().Handover();
                Request.HandOver();
                CombatTargeting.Instance.Provider = tempProvider;
            }),
                                         new ActionAlwaysFail() //always fail that the rest of the tree is traveresd
                                         )),

                       new Decorator(ret => Talk.DialogOpen,
                                     new Action(r =>
            {
                Talk.Next();
            })),
                       new Decorator(ret => Request.IsOpen,
                                     new Action(r =>
            {
                GameObjectManager.GetObjectByNPCId(npc.NpcId).Interact();
                InventoryManager.GetBagByInventoryBagId(InventoryBagId.KeyItems).FilledSlots.LastOrDefault().Handover();
                Request.HandOver();
            })),

                       //Find fates

                       #endregion Handin

                       #endregion Movment

                       #region escort

                       new Decorator(r => currentfate != null && fateid != 0 && Poi.Current.Type != PoiType.Kill,
                                     new ActionRunCoroutine(async r => MoveToFocusedFate())

                                     ),

                       #endregion escort

                       new Decorator(ret => currentfate == null && currentstep == 0,
                                     new Sequence(
                                         new Action(r =>
            {
                getFates();
                if (currentfate != null)
                {
                    GoFate();
                }
                else
                {
                    GoHunting();
                }
            }
                                                    )
                                         )),
                       new ActionAlwaysSucceed()
                       ));
        }
Пример #9
0
    public CharacterData(int scene, int slot, int world, int levelUpsAvailable, int experience, int hitDie,
	int expGive, bool friendly, Talk talk,
	EnumList.Race race, EnumList.Alignment alignment, EnumList.Affiliation affiliation, EnumList.Profession profession, EnumList.Title title, EnumList.CharacterClass characterClass1, EnumList.CharacterClass characterClass2, EnumList.CharacterClass prestigeClass, bool controlled,
	string name, int level1, int level2, int prestigeLevel, int totalLevel, int strength, int dexterity, int constitution, int intelligence, int wisdom, int charisma, int initiativeBonus, bool hostile, bool initSet, bool turn, bool done, int initiative, int[] basicAttackBonus, int fortitude, int reflex, int will, int[] skill, Feat[] feat, int skillPoints, int featPoints, bool[] classSkill, float xLocation, float yLocation, float xDirection, float yDirection, Inventory inventory, EnumList.Status status,
	int currentHealth, int maxHealth, int armorClass, string prefabName,
	DateTime dateTime, float transformLocationX, float transformLocationY,
	int standardAction, int moveAction, int freeAction, int swiftAction, int immediateAction, int aoo, int currentSpeed, int maxSpeed, bool moveLock, bool aooProvoked, float xEnd, float yEnd, float xDir, float yDir)
    {
        //controlled
        this.scene = scene;
        this.slot = slot;
        this.world = world;
        this.levelUpsAvailable = levelUpsAvailable;
        this.experience = experience;
        this.hitDie = hitDie;

        //!controlled
        this.expGive = expGive;
        this.friendly = friendly;
        this.talk = talk;

        //character
        this.race = race;
        this.alignment = alignment;
        this.affiliation = affiliation;
        this.profession = profession;
        this.title = title;
        this.characterClass1 = characterClass1;
        this.characterClass2 = characterClass2;
        this.prestigeClass = prestigeClass;
        this.controlled = controlled;

        //entity
        this.name = name;
        this.level1 = level1;
        this.level2 = level2;
        this.prestigeLevel = prestigeLevel;
        this.totalLevel = totalLevel;
        this.strength = strength;
        this.dexterity = dexterity;
        this.constitution = constitution;
        this.intelligence = intelligence;
        this.wisdom = wisdom;
        this.charisma = charisma;
        this.initiativeBonus = initiativeBonus;
        this.hostile = hostile;
        this.initSet = initSet;
        this.turn = turn;
        this.done = done;
        this.initiative = initiative;
        this.basicAttackBonus = basicAttackBonus;
        this.fortitude = fortitude;
        this.reflex = reflex;
        this.will = will;
        this.skill = skill;
        this.feat = feat;
        this.skillPoints = skillPoints;
        this.featPoints = featPoints;
        this.classSkill = classSkill;
        this.xLocation = xLocation;
        this.yLocation = yLocation;
        this.xDirection = xDirection;
        this.yDirection = yDirection;
        this.inventory = inventory;
        this.status = status;

        //attackable
        this.currentHealth = currentHealth;
        this.maxHealth = maxHealth;
        this.armorClass = armorClass;
        this.prefabName = prefabName;

        //system
        this.dateTime = dateTime;
        this.transformLocationX = transformLocationX;
        this.transformLocationY = transformLocationY;

        //action
        this.standardAction = standardAction;
        this.moveAction = moveAction;
        this.freeAction = freeAction;
        this.swiftAction = swiftAction;
        this.immediateAction = immediateAction;
        this.aoo = aoo;
        this.currentSpeed = currentSpeed;
        this.maxSpeed = maxSpeed;
        this.moveLock = moveLock;
        this.aooProvoked = aooProvoked;
        this.xEnd = xEnd;
        this.yEnd = yEnd;
        this.xDir = xDir;
        this.yDir = yDir;
    }
Пример #10
0
        void Spawn(DudeAnimationInfo LoadedCharacter, Scene.Document LoadedScene)
        {
            var ViewSize = new Size {
                Width = 640, Height = 480
            };

            var Container = new IHTMLDiv();

            Container.AttachToDocument();
            Container.style.SetSize(ViewSize.Width, ViewSize.Height + 22);
            Container.KeepInCenter();

            //Container.MakeCSSShaderCrumple();

            var Wallpaper = new IHTMLDiv().AttachTo(Container);

            Wallpaper.style.SetSize(ViewSize.Width, ViewSize.Height + 22);


            new power().ToBackground(Wallpaper.style);
            Wallpaper.style.position           = IStyle.PositionEnum.absolute;
            Wallpaper.style.backgroundRepeat   = "no-repeat";
            Wallpaper.style.backgroundPosition = "center center";



            var Margin     = 48;
            var MarginSafe = 72;



            var CurrentFrame = LoadedScene.Frames.Randomize().First();
            //var CurrentFrame = LoadedScene.Frames.Single(f => f.Name == "C");

            var Room = new IHTMLDiv();



            Room.style.border = "1px solid #00ff00";
            Room.style.SetSize(ViewSize.Width, ViewSize.Height);
            Room.style.position = IStyle.PositionEnum.absolute;
            Room.style.overflow = IStyle.OverflowEnum.hidden;

            Room.AttachTo(Container);
            Room.style.SetLocation(0, 22);

            //Room.AttachToDocument();
            //Room.KeepInCenter();



            var tween = Room.ToOpacityTween();

            Action HideRoom = () => tween.Value = 1;
            Action ShowRoom = () => tween.Value = 0;

            HideRoom();

            //var GroundOverlay2 = new IHTMLDiv();

            //GroundOverlay2.style.backgroundColor = Color.Blue;
            ////GroundOverlay.style.Opacity = 0;

            //GroundOverlay2.style.position = IStyle.PositionEnum.absolute;
            //GroundOverlay2.style.SetLocation(0, 0, ViewSize.Width, ViewSize.Height);
            //GroundOverlay2.AttachTo(Room);

            var LostInTime_Images = new ImpAdventures.HTML.Pages.LostInTimeImages().Images;

            var BackgroundImage = new IHTMLImage();

            LostInTime_Images.FirstOrDefault(
                k => k.src.SkipUntilLastIfAny("/") == CurrentFrame.Image.Source.SkipUntilLastIfAny("/")
                ).With(
                ImageSource =>
            {
                Console.WriteLine(ImageSource.src);
                BackgroundImage.src = ImageSource.src;
            }
                );

            BackgroundImage.style.SetLocation(0, 0, ViewSize.Width, ViewSize.Height);
            BackgroundImage.alt = "BackgroundImage";
            BackgroundImage.AttachTo(Room);

            //GroundOverlay2.style.backgroundImage = "url(" + CurrentFrame.Image.Source + ")";
            //BackgroundImage.InvokeOnComplete(
            //    delegate
            //    {
            //        //BackgroundImage.style.backgroundColor = Color.Red;
            //        //BackgroundImage.style.SetLocation(0,0, ViewSize.Width, ViewSize.Height);
            //        BackgroundImage.AttachTo(GroundOverlay2);
            //    }
            //);


            var GroundOverlay = new IHTMLDiv();

            GroundOverlay.style.backgroundColor = Color.Blue;
            GroundOverlay.style.Opacity         = 0;
            GroundOverlay.style.SetLocation(0, 0, ViewSize.Width, ViewSize.Height);
            GroundOverlay.AttachTo(Room);

            var Ground = new IHTMLDiv();

            Ground.style.SetLocation(0, 0, ViewSize.Width, ViewSize.Height);
            Ground.AttachTo(Room);



            var AnimateRoomChange = default(Action <Action>);

            #region TryToChangeRooms
            Func <TryToChangeRoomsArgs, bool> TryToChangeRooms =
                e =>
            {
                if (e == null)
                {
                    return(false);
                }

                if (e.NextRoomSelector == null)
                {
                    throw new ArgumentNullException("NextRoomSelector");
                }

                var next = LoadedScene.Frames.SingleOrDefault(e.NextRoomSelector);

                var r = next != null;

                if (r)
                {
                    AnimateRoomChange(
                        delegate
                    {
                        CurrentFrame = next;

                        Console.WriteLine("AnimateRoomChange");

                        LostInTime_Images.FirstOrDefault(
                            k => k.src.SkipUntilLastIfAny("/") == CurrentFrame.Image.Source.SkipUntilLastIfAny("/")
                            ).With(
                            ImageSource =>
                        {
                            Console.WriteLine(ImageSource.src);
                            BackgroundImage.src = ImageSource.src;
                        }
                            );

                        //GroundOverlay2.style.backgroundImage = "url(" + CurrentFrame.Image.Source + ")";
                        //BackgroundImage.src = CurrentFrame.Image.Source;

                        e.ReadyToTeleport();
                    }
                        );
                }


                return(r);
            };
            #endregion


            var dude = CreateDude(LoadedCharacter);

            dude.Control.AttachTo(Ground);

            #region Doors
            var Doors = new[]
            {
                new TryToChangeRoomsArgs
                {
                    Condition        = () => dude.CurrentLocation.X > ViewSize.Width - Margin,
                    NextRoomSelector = f => f.Name == CurrentFrame.Right,
                    ReadyToTeleport  = delegate
                    {
                        dude.TeleportTo(-MarginSafe, dude.CurrentLocation.Y);
                        dude.LookAt(new Point(MarginSafe, (int)dude.CurrentLocation.Y));
                    }
                },
                new TryToChangeRoomsArgs
                {
                    Condition        = () => dude.CurrentLocation.X < Margin,
                    NextRoomSelector = f => f.Name == CurrentFrame.Left,
                    ReadyToTeleport  = delegate
                    {
                        dude.TeleportTo(ViewSize.Width + MarginSafe, dude.CurrentLocation.Y);
                        dude.LookAt(new Point(ViewSize.Width - MarginSafe, (int)dude.CurrentLocation.Y));
                    }
                },
                new TryToChangeRoomsArgs
                {
                    Condition        = () => dude.CurrentLocation.Y < Margin,
                    NextRoomSelector = f => f.Name == CurrentFrame.Top,
                    ReadyToTeleport  = delegate
                    {
                        dude.TeleportTo(dude.CurrentLocation.X, ViewSize.Height + MarginSafe);
                        dude.LookAt(new Point((int)dude.CurrentLocation.X, ViewSize.Height - MarginSafe));
                    }
                },
                new TryToChangeRoomsArgs
                {
                    Condition        = () => dude.CurrentLocation.Y > ViewSize.Height - Margin,
                    NextRoomSelector = f => f.Name == CurrentFrame.Bottom,
                    ReadyToTeleport  = delegate
                    {
                        dude.TeleportTo(dude.CurrentLocation.X, -Margin);
                        dude.LookAt(new Point((int)dude.CurrentLocation.X, MarginSafe));
                    }
                }
            };
            #endregion

            Console.WriteLine(new { Doors = Doors.Length });

            Doors.WithEachIndex(
                (x, index) =>
            {
                Console.WriteLine(new { index, x });
                Console.WriteLine(new { index, x.Condition });
            }
                );


            var ChangeRoom = new ChangeRoom {
                autobuffer = true
            };
            var Talk = new Talk {
                autobuffer = true
            };
            var Argh_RChannel = new Argh_RChannel {
                autobuffer = true
            };
            var Argh_LChannel = new Argh_LChannel {
                autobuffer = true
            };
            var Argh_Disabled         = false;
            var Argh_VolumeMultiplier = 1.0;

            #region Argh_Stereo
            Action <double, double> Argh_Stereo =
                (volume, balance) =>
            {
                if (Argh_Disabled)
                {
                    return;
                }

                Argh_RChannel.AttachToDocument();
                Argh_LChannel.AttachToDocument();

                Argh_RChannel.volume = Argh_VolumeMultiplier * volume * balance;
                Argh_LChannel.volume = Argh_VolumeMultiplier * volume * (1 - balance);

                Argh_RChannel.play();
                Argh_LChannel.play();

                Argh_RChannel = new Argh_RChannel {
                    autobuffer = true
                };
                Argh_LChannel = new Argh_LChannel {
                    autobuffer = true
                };

                Argh_Disabled          = true;
                Argh_VolumeMultiplier /= 2;

                new Timer(t => Argh_Disabled         = false).StartTimeout(800);
                new Timer(t => Argh_VolumeMultiplier = 1).StartTimeout(5000);
            };
            #endregion

            #region PrintText
            Action <string, Action> PrintText =
                (text, done) =>
            {
                Talk.AttachToDocument();
                Talk.load();
                Talk.volume = Math.Min(1, dude.Zoom.DynamicZoom / 4);
                Talk.play();
                Talk = new Talk {
                    autobuffer = true
                };

                text.Length.Range().AsyncForEach(
                    i =>
                {
                    Wallpaper.innerText = text.Left(i + 1);

                    var c = text[i];

                    if (LoadedScene.SlowText.Contains("" + c))
                    {
                        return(100.Random());
                    }

                    return(50.Random());
                }, done
                    );
            };
            #endregion

            Action <string, Action> PrintRandomText =
                (text, done) => PrintText(text.Split(LoadedScene.TextDelimiter).Randomize().First(), done);



            dude.DoneWalking +=
                delegate
            {
                // compiler bug: cannot invoke Action<func, action> delegate ?

                System.Console.WriteLine("done walking in " + CurrentFrame.Name + " at " + dude.CurrentLocation);

                var xFirstOrDefault = Doors.FirstOrDefault(d => d.Condition());

                System.Console.WriteLine("done walking in " + new { xFirstOrDefault });

                // Doors null?
                if (TryToChangeRooms(xFirstOrDefault))
                {
                    return;
                }


                if (CurrentFrame.Items != null)
                {
                    var item = CurrentFrame.Items.Where(
                        i => new Point(i.X.ToInt32(), i.Y.ToInt32()).GetRange(dude.CurrentLocation) < i.R.ToInt32()
                        ).FirstOrDefault();

                    if (item != null)
                    {
                        dude.IsSelected = false;
                        dude.LookDown();

                        PrintRandomText(item.Text,
                                        delegate
                        {
                            dude.WalkingOnce +=
                                delegate
                            {
                                Wallpaper.innerText = "";
                            };

                            dude.IsSelected = true;
                        }
                                        );
                    }
                }
            };

            #region AnimateRoomChange
            AnimateRoomChange =
                ReadyToTeleport =>
            {
                var Step1 = default(System.Action);
                var Step2 = default(System.Action);
                var Step3 = default(Action);

                Step1 =
                    delegate
                {
                    tween.Done -= Step1;

                    ReadyToTeleport();

                    tween.Done += Step2;

                    ShowRoom();
                };

                Step2 =
                    delegate
                {
                    tween.Done -= Step2;

                    dude.DoneWalking += Step3;

                    dude.IsWalking = true;
                };

                Step3 =
                    delegate
                {
                    dude.DoneWalking -= Step3;

                    dude.IsSelected = true;
                };

                dude.IsSelected = false;

                tween.Done += Step1;
                // go left
                HideRoom();

                // http://stackoverflow.com/questions/3009888/autoplay-audio-files-on-an-ipad-with-html5
                ChangeRoom.AttachToDocument();
                ChangeRoom.load();
                ChangeRoom.volume = 0.2;
                ChangeRoom.play();
                ChangeRoom = new ChangeRoom();
            };
            #endregion

            var pointer_x = 0;
            var pointer_y = 0;

            #region onmousemove
            Container.onmousemove +=
                ev =>
            {
                if (Native.Document.pointerLockElement == Container)
                {
                    if (dude.IsSelected)
                    {
                        var volume  = Math.Min(1, dude.Zoom.DynamicZoom / 4);
                        var balance = dude.CurrentLocation.X / ViewSize.Width;

                        pointer_x += ev.movementX;
                        pointer_y += ev.movementY;

                        pointer_x = Math.Min(ViewSize.Width - 0, Math.Max(0, pointer_x));
                        pointer_y = Math.Min(ViewSize.Height - 0, Math.Max(0, pointer_y));

                        var OffsetPosition = new Point(pointer_x, pointer_y

                                                       );

                        Console.WriteLine(OffsetPosition);

                        Argh_Stereo(volume, balance);
                        dude.WalkTo(OffsetPosition);
                    }
                }
            };
            #endregion

            #region ontouchstart
            Container.ontouchstart +=
                ev =>
            {
                ev.preventDefault();

                System.Console.WriteLine(ev.CursorPosition);

                if (dude.IsSelected)
                {
                    var volume  = Math.Min(1, dude.Zoom.DynamicZoom / 4);
                    var balance = dude.CurrentLocation.X / ViewSize.Width;

                    var ev_OffsetPosition = new Point(
                        ev.touches[0].clientX - Container.Bounds.Left,
                        ev.touches[0].clientY - Container.Bounds.Top
                        );

                    Argh_Stereo(volume, balance);
                    dude.WalkTo(ev_OffsetPosition);
                }
            };
            #endregion

            #region onclick
            Container.onclick +=
                ev =>
            {
                ev.preventDefault();

                if (ev.MouseButton == IEvent.MouseButtonEnum.Middle)
                {
                    if (Native.Document.pointerLockElement == Container)
                    {
                        Native.Document.exitPointerLock();
                        return;
                    }

                    pointer_x = (int)dude.CurrentLocation.X;
                    pointer_y = (int)dude.CurrentLocation.Y;

                    //Container.requestFullscreen();
                    Container.requestPointerLock();
                    return;
                }

                if (ev.Element != Ground)
                {
                    return;
                }

                System.Console.WriteLine(ev.CursorPosition);

                if (dude.IsSelected)
                {
                    var volume  = Math.Min(1, dude.Zoom.DynamicZoom / 4);
                    var balance = dude.CurrentLocation.X / ViewSize.Width;

                    Argh_Stereo(volume, balance);
                    dude.WalkTo(ev.OffsetPosition);
                }
            };
            #endregion



            //GroundOverlay.onclick +=
            //    ev =>
            //    {
            //        if (ev.Element != GroundOverlay)
            //            return;

            //        System.Console.WriteLine(ev.CursorPosition);

            //        if (dude.IsSelected)
            //        {
            //            new Argh().play();

            //            dude.WalkTo(ev.OffsetPosition);
            //        }
            //    };


            dude.TeleportTo(ViewSize.Width / 2, (ViewSize.Height - MarginSafe) / 2);
            dude.LookDown();

            ShowRoom();

            dude.DoneWalkingOnce +=
                delegate
            {
                PrintRandomText(
                    LoadedScene.IntroText,
                    delegate
                {
                    dude.WalkingOnce +=
                        delegate
                    {
                        Wallpaper.innerText = "";
                    };

                    dude.IsSelected = true;
                }
                    );
            };

            dude.WalkToArc(MarginSafe, dude.Direction);
        }
Пример #11
0
        //public static void Log(string text, params object[] args) { Logger.Info(text, args); }

        public static async Task <bool> Main(Vector3 gardenLoc)
        {
            var watering = GardenManager.Plants.Where(r => !Blacklist.Contains(r) && r.Distance2D(gardenLoc) < 10).ToArray();

            foreach (var plant in watering)
            {
                //Water it if it needs it or if we have fertilized it 5 or more times.
                if (AlwaysWater || GardenManager.NeedsWatering(plant))
                {
                    var result = GardenManager.GetCrop(plant);
                    if (result != null)
                    {
                        Log($"Watering {result} {plant.ObjectId:X}");
                        await Navigation.FlightorMove(plant.Location);

                        plant.Interact();
                        if (!await Coroutine.Wait(5000, () => Talk.DialogOpen))
                        {
                            continue;
                        }
                        Talk.Next();
                        if (!await Coroutine.Wait(5000, () => SelectString.IsOpen))
                        {
                            continue;
                        }
                        if (!await Coroutine.Wait(5000, () => SelectString.LineCount > 0))
                        {
                            continue;
                        }
                        if (SelectString.LineCount == 4)
                        {
                            SelectString.ClickSlot(1);
                            await Coroutine.Sleep(2300);
                        }
                        else
                        {
                            Log("Plant is ready to be harvested");
                            SelectString.ClickSlot(1);
                            await Coroutine.Sleep(1000);
                        }
                    }
                    else
                    {
                        Log($"GardenManager.GetCrop returned null {plant.ObjectId:X}");
                    }
                }
            }
            var plants = GardenManager.Plants.Where(r => r.Distance2D(gardenLoc) < 10).ToArray();

            foreach (var plant in plants)
            {
                var result = GardenManager.GetCrop(plant);
                if (result == null)
                {
                    continue;
                }
                Log($"Fertilizing {GardenManager.GetCrop(plant)} {plant.ObjectId:X}");
                await Navigation.FlightorMove(plant.Location);

                plant.Interact();
                if (!await Coroutine.Wait(5000, () => Talk.DialogOpen))
                {
                    continue;
                }
                Talk.Next();
                if (!await Coroutine.Wait(5000, () => SelectString.IsOpen))
                {
                    continue;
                }
                if (!await Coroutine.Wait(5000, () => SelectString.LineCount > 0))
                {
                    continue;
                }
                if (SelectString.LineCount == 4)
                {
                    SelectString.ClickSlot(0);
                    if (await Coroutine.Wait(2000, () => GardenManager.ReadyToFertilize))
                    {
                        if (GardenManager.Fertilize() != FertilizeResult.Success)
                        {
                            continue;
                        }
                        Log($"Plant with objectId {plant.ObjectId:X} was fertilized");
                        await Coroutine.Sleep(2300);
                    }
                    else
                    {
                        Log($"Plant with objectId {plant.ObjectId:X} not able to be fertilized, trying again later");
                    }
                }
                else
                {
                    Log("Plant is ready to be harvested");
                    SelectString.ClickSlot(1);
                    await Coroutine.Sleep(1000);
                }
            }
            return(true);
        }
Пример #12
0
 public async Task <bool> SaveTalkAsync(Talk talk)
 {
     return(await _engagementDataStore.SaveTalkAsync(talk));
 }
Пример #13
0
        /// <summary>
        /// Command list for the game
        /// </summary>
        /// <param name="commandOptions">Everything after the 1st occurance of a space</param>
        /// <param name="commandKey">The string before the 1st occurance of a space</param>
        /// <param name="playerData">Player Data</param>
        /// <param name="room">Current room</param>
        /// <returns>Returns Dictionary of commands</returns>
        public static void Commands(string commandOptions, string commandKey, PlayerSetup.Player playerData, Room.Room room)
        {
            var context = HubContext.Instance;

            switch (commandKey)
            {
            case "north":
                Movement.Move(playerData, room, "North");
                break;

            case "east":
                Movement.Move(playerData, room, "East");
                break;

            case "south":
                Movement.Move(playerData, room, "South");
                break;

            case "west":
                Movement.Move(playerData, room, "West");
                break;

            case "up":
                Movement.Move(playerData, room, "Up");
                break;

            case "down":
                Movement.Move(playerData, room, "Down");
                break;

            case "look":
            case "look at":
            case "l at":
            case "search":
                LoadRoom.ReturnRoom(playerData, room, commandOptions, "look");
                break;

            case "l in":
            case "search in":
                LoadRoom.ReturnRoom(playerData, room, commandOptions, "look in");
                break;

            case "examine":
                LoadRoom.ReturnRoom(playerData, room, commandOptions, "examine");
                break;

            case "touch":
                LoadRoom.ReturnRoom(playerData, room, commandOptions, "touch");
                break;

            case "smell":
                LoadRoom.ReturnRoom(playerData, room, commandOptions, "smell");
                break;

            case "taste":
                LoadRoom.ReturnRoom(playerData, room, commandOptions, "taste");
                break;

            case "score":
                Score.ReturnScore(playerData);
                break;

            case "inventory":
                Inventory.ReturnInventory(playerData.Inventory, playerData);
                break;

            case "eq":
            case "equip":
            case "equipment":
            case "garb":
                Equipment.ShowEquipment(playerData);
                break;

            case "loot":
            case "get":
            case "take":
                ManipulateObject.GetItem(room, playerData, commandOptions, commandKey, "item");
                break;

            case "plunder":
                ManipulateObject.GetItem(room, playerData, "all " + commandOptions, commandKey, "item");
                break;

            case "drop":
            case "put":
                ManipulateObject.DropItem(room, playerData, commandOptions, commandKey);
                break;

            case "give":
                ManipulateObject.GiveItem(room, playerData, commandOptions, commandKey, "killable");
                break;

            case "save":
                Save.SavePlayer(playerData);
                break;

            case "say":
            case "'":
                Communicate.Say(commandOptions, playerData, room);
                break;

            case "sayto":
            case ">":
                Communicate.SayTo(commandOptions, room, playerData);
                break;

            case "newbie":
                Communicate.NewbieChannel(commandOptions, playerData);
                break;

            case "gossip":
                Communicate.GossipChannel(commandOptions, playerData);
                break;

            case "ooc":
                Communicate.OocChannel(commandOptions, playerData);
                break;

            case "yes":
                Communicate.Say("Yes", playerData, room);
                break;

            case "no":
                Communicate.Say("No", playerData, room);
                break;

            case "yell":
                Communicate.Yell(commandOptions, room, playerData);
                break;

            case "talkto":
                Talk.TalkTo(commandOptions, room, playerData);
                break;

            case "emote":
                Emote.EmoteActionToRoom(commandOptions, playerData);
                break;

            case "use":
            case "wear":
            case "wield":
                Equipment.WearItem(playerData, commandOptions);
                break;

            case "remove":
            case "doff":
            case "unwield":
                Equipment.RemoveItem(playerData, commandOptions);
                break;

            case "hit":
            case "kill":
            case "attack":
                Fight2.PerpareToFight(playerData, room, commandOptions);
                break;

            case "flee":
                Flee.fleeCombat(playerData, room);
                break;

            case "sacrifice":
            case "harvest":
                Harvest.Body(playerData, room, commandOptions);
                break;

            case "peek":
                Peak.DoPeak(context, playerData, room, commandOptions);
                break;

            case "steal":
                Steal.DoSteal(context, playerData, room, commandOptions);
                break;

            case "pick":
                LockPick.DoLockPick(context, playerData, room, commandOptions);
                break;

            case "c magic missile":
            case "cast magic missile":
                MagicMissile.StartMagicMissile(playerData, room, commandOptions);
                break;

            case "c armour":
            case "cast armour":
            case "c armor":
            case "cast armor":
                new Armour().StartArmour(playerData, room, commandOptions);
                break;

            case "c continual light":
            case "cast continual light":
                ContinualLight.StarContinualLight(playerData, room, commandOptions);
                break;

            case "c invis":
            case "cast invis":
                Invis.StartInvis(playerData, room, commandOptions);
                break;

            case "c weaken":
            case "cast weaken":
                Weaken.StartWeaken(playerData, room, commandOptions);
                break;

            case "c chill touch":
            case "cast chill touch":
                ChillTouch.StartChillTouch(playerData, room, commandOptions);
                break;

            case "c fly":
            case "cast fly":
                Fly.StartFly(playerData, room, commandOptions);
                break;

            case "c refresh":
            case "cast refresh":
                Refresh.StartRefresh(playerData, room, commandOptions);
                break;

            case "c faerie fire":
            case "cast faerie fire":
                FaerieFire.StartFaerieFire(playerData, room, commandOptions);
                break;

            case "c teleport":
            case "cast teleport":
                Teleport.StartTeleport(playerData, room);
                break;

            case "c blindness":
            case "cast blindness":
                Blindness.StartBlind(playerData, room, commandOptions);
                break;

            case "c haste":
            case "cast haste":
                Haste.StartHaste(playerData, room, commandOptions);
                break;

            case "c create spring":
            case "cast create spring":
                CreateSpring.StartCreateSpring(playerData, room);
                break;

            case "c shocking grasp":
            case "cast shocking grasp":
                new ShockingGrasp().StartShockingGrasp(playerData, room, commandOptions);
                break;

            case "c cause light":
            case "cast cause light":
                new CauseLight().StartCauseLight(context, playerData, room, commandOptions);
                break;

            case "c cure light":
            case "cast cure light":
                new CureLight().StartCureLight(context, playerData, room, commandOptions);
                break;

            case "c cure blindness":
                new CureBlindness().StartCureBlindness(context, playerData, room, commandOptions);
                break;

            case "c detect invis":
            case "cast detect invis":
                DetectInvis.DoDetectInvis(context, playerData, room);
                break;

            case "forage":
                new Foraging().StartForaging(playerData, room);
                break;

            case "fish":
            case "angle":
            case "line":
            case "trawl":
            case "lure":
                new Fishing().StartFishing(playerData, room);
                break;

            case "reel":
                Fishing.GetFish(playerData, room);
                break;

            case "dirt kick":
                new DirtKick().StartDirtKick(context, playerData, room, commandOptions);
                break;

            case "bash":
                new Bash().StartBash(context, playerData, room, commandOptions);
                break;

            case "shield bash":
                new ShieldBash().StartBash(context, playerData, room, commandOptions);
                break;

            case "punch":
                Punch.StartPunch(playerData, room);
                break;

            case "kick":
                new Kick().StartKick(context, playerData, room, commandOptions);
                break;

            case "spin kick":
                new SpinKick().StartKick(context, playerData, room, commandOptions);
                break;

            case "rescue":
                new Rescue().StartRescue(context, playerData, room, commandOptions);
                break;

            case "lunge":
                new Lunge().StartLunge(context, playerData, room, commandOptions);
                break;

            case "disarm":
                new Disarm().StartDisarm(context, playerData, room);
                break;

            case "backstab":
                new Backstab().StartBackstab(context, playerData, room, commandOptions);
                break;

            case "feint":
                new Feint().StartFeint(context, playerData, room, commandOptions);
                break;

            case "mount":
            case "ride":
                Mount.StartMount(playerData, room, commandOptions);
                break;

            case "dismount":
                Mount.Dismount(playerData, room, commandOptions);
                break;

            case "trip":
                new Trip().StartTrip(context, playerData, room, commandOptions);
                break;

            case "sneak":
                Sneak.DoSneak(context, playerData);
                break;

            case "hide":
                Hide.DoHide(context, playerData);
                break;

            case "lore":
                Lore.DoLore(context, playerData, commandOptions);
                break;

            case "unlock":
                ManipulateObject.UnlockItem(room, playerData, commandOptions, commandKey);
                break;

            case "lock":
                ManipulateObject.LockItem(room, playerData, commandOptions, commandKey);
                break;

            case "close":
            case "shut":
                ManipulateObject.Close(room, playerData, commandOptions, commandKey);
                break;

            case "drink":
                ManipulateObject.Drink(room, playerData, commandOptions, commandKey);
                break;

            case "help":
            case "/help":
            case "?":
            case "commands":
                Help.ShowHelp(commandOptions, playerData);
                break;

            case "time":
            case "clock":
                Update.Time.ShowTime();
                break;

            case "skills":
            case "spells":
            case "skills all":
                ShowSkills.ShowPlayerSkills(playerData, commandOptions);
                break;

            case "practice":
                Trainer.Practice(playerData, room, commandOptions);
                break;

            case "list":
                Shop.listItems(playerData, room);
                break;

            case "buy":
                Shop.buyItems(playerData, room, commandOptions);
                break;

            case "sell":
                Shop.sellItems(playerData, room, commandOptions);
                break;

            case "quest log":
            case "qlog":
                Quest.QuestLog(playerData);
                break;

            case "wake":
                Status.WakePlayer(context, playerData, room);
                break;

            case "sleep":
                Status.SleepPlayer(context, playerData, room);
                break;

            case "rest":
            case "sit":
                Status.RestPlayer(context, playerData, room);
                break;

            case "stand":
                Status.StandPlayer(context, playerData, room);
                break;

            case "greet":
                Greet.GreetMob(playerData, room, commandOptions);
                break;

            case "who":
                Who.Connected(playerData);
                break;

            case "affects":
                Effect.Show(playerData);
                break;

            case "follow":
                Follow.FollowThing(playerData, room, commandOptions);
                break;

            case "nofollow":
                Follow.FollowThing(playerData, room, "noFollow");
                break;

            case "quit":
                HubContext.Instance.Quit(playerData.HubGuid, room);
                break;

            case "craft":
                Craft.CraftItem(playerData, room, commandOptions, CraftType.Craft);
                break;

            case "chop":
                Craft.CraftItem(playerData, room, commandOptions, CraftType.Chop);
                break;

            case "cook":
                Craft.CraftItem(playerData, room, commandOptions, CraftType.Cook);
                break;

            case "brew":
                Craft.CraftItem(playerData, room, commandOptions, CraftType.Brew);
                break;

            case "forge":
                Craft.CraftItem(playerData, room, commandOptions, CraftType.Forge);
                break;

            case "carve":
                Craft.CraftItem(playerData, room, commandOptions, CraftType.Carve);
                break;

            case "knit":
                Craft.CraftItem(playerData, room, commandOptions, CraftType.Knitting);
                break;

            case "make":
            case "build":
                Craft.CraftItem(playerData, room, commandOptions, CraftType.Craft);
                break;

            case "show crafts":
            case "craftlist":
                Craft.CraftList(playerData);
                break;

            case "set up camp":
                Camp.SetUpCamp(playerData, room);
                break;

            case "repair":
                Events.Repair.RepairItem(playerData, room, commandOptions);
                break;

            case "/debug":
                PlayerSetup.Player.DebugPlayer(playerData);
                break;

            case "/setGold":
                PlayerSetup.Player.SetGold(playerData, commandOptions);
                break;

            case "/setAc":
                PlayerSetup.Player.SetAC(playerData, commandOptions);
                break;

            case "/map":
                SigmaMap.DrawMap(playerData.HubGuid);     //not what you think it does
                break;

            default:
                HubContext.Instance.SendToClient("Sorry you can't do that. Try help commands or ask on the discord channel.", playerData.HubGuid);
                var log = new Error.Error
                {
                    Date         = DateTime.Now,
                    ErrorMessage = commandKey + " " + commandOptions,
                    MethodName   = "Wrong command"
                };

                Save.LogError(log);
                break;
            }
        }
Пример #14
0
 private static string GetTalkLine(Talk talk)
 {
     var time = DateTime.Today.Add(talk.StartTime).ToString("hh:mmtt");
     var talkLine = string.Format("{0} {1}", time, talk.Description);
     return talkLine;
 }
Пример #15
0
 public void Update([FromBody] Talk talk)
 {
     throw new NotImplementedException();
 }
Пример #16
0
 public BeginVoting(Talk talk)
 {
     this.Talk = talk;
 }
Пример #17
0
 public string PostTalk(Talk talk)
 {
     talk.Id = ObjectId.GenerateNewId().ToString();
     dbContext.Talks.InsertOne(talk);
     return(talk.Id);
 }
Пример #18
0
 public VotingActor(Talk talk)
 {
     Talk = talk;
     Become(OpenForVoting);
 }
Пример #19
0
        public async Task ImportTalks()
        {
            var seeAlso    = new List <(int, List <string>)>();
            var talksLinks =
                await _gitHub.Repository.Content.GetAllContentsByRef("DotNetRu", "Audit", "db/talks", "master");

            foreach (var talkLink in talksLinks)
            {
                var responseData = await _httpClient.GetByteArrayAsync(talkLink.DownloadUrl);

                using (var ms = new MemoryStream(responseData))
                {
                    var responseXml = XDocument.Load(ms).Root;
                    var exportId    = responseXml?.Element("Id")?.Value;
                    if (string.IsNullOrEmpty(exportId))
                    {
                        continue;
                    }

                    var existing = await _context.Talks.FirstOrDefaultAsync(x => x.ExportId == exportId.Trim());

                    if (existing != null)
                    {
                        continue;
                    }

                    var speakerTalkList = new List <SpeakerTalk>();
                    var speakersIds     = responseXml.Element("SpeakerIds")?.Descendants();
                    foreach (var id in speakersIds)
                    {
                        var speaker = await _context.Speakers.FirstAsync(x => x.ExportId == id.Value);

                        speakerTalkList.Add(new SpeakerTalk
                        {
                            SpeakerId = speaker.Id
                        });
                    }

                    var talk = new Talk
                    {
                        ExportId    = exportId,
                        Title       = responseXml.Element("Title")?.Value,
                        Description = responseXml.Element("Description")?.Value,
                        SlidesUrl   = responseXml.Element("SlidesUrl")?.Value,
                        CodeUrl     = responseXml.Element("CodeUrl")?.Value,
                        VideoUrl    = responseXml.Element("VideoUrl")?.Value,
                        Speakers    = speakerTalkList
                    };

                    _context.Talks.Add(talk);
                    _context.SaveChanges();

                    var seeAlsoTalksTemp = responseXml.Element("SeeAlsoTalkIds")?.Descendants().Select(x => x.Value)
                                           .ToList();
                    if (seeAlsoTalksTemp != null && seeAlsoTalksTemp.Count > 0)
                    {
                        seeAlso.Add((talk.Id, seeAlsoTalksTemp));
                    }
                }
            }


            foreach (var item in seeAlso)
            {
                var parent = await _context.Talks.FirstAsync(x => x.Id == item.Item1);

                foreach (var exportId in item.Item2)
                {
                    var child = await _context.Talks.Include(x => x.SeeAlsoTalks)
                                .FirstAsync(x => x.ExportId == exportId);

                    if (parent.SeeAlsoTalks == null)
                    {
                        parent.SeeAlsoTalks = new List <SeeAlsoTalk>();
                    }

                    parent.SeeAlsoTalks.Add(new SeeAlsoTalk
                    {
                        ChildTalkId = child.Id
                    });
                    _context.SaveChanges();
                }
            }
        }
Пример #20
0
        private static void UpdateEventDataFromJsonData(EventAgenda eventData, IEnumerable<TalkData> talksJson)
        {
            var slots = new List<TimeSlot>();

            foreach (var t in talksJson)
            {
                var newTalk = new Talk
                {
                    Title = t.title,
                    Subtitle = t.subtitle,
                    Description = t.description,
                    Room = t.room,
                    Speaker = new Speaker
                    {
                        Name = t.speaker,
                        PictureUrl = t.speakerimage,
                        WebsiteUrl = t.speakerlink,
                        TwitterUrl = String.IsNullOrEmpty(t.speakertwitter) ? null : String.Format("https://www.twitter.com/{0}",t.speakertwitter)
                    }
                };

                var newSlot = new TimeSlot(t.slot);
                var existingSlot = slots.FirstOrDefault (s => newSlot.Equals(s));

                if (existingSlot == null) {
                    slots.Add(newSlot);
                }

                (existingSlot ?? newSlot).Talks.Add (newTalk);
            }

            // Link up timeslots
            foreach (var slot in slots)
            {
                foreach (var talk in slot.Talks)
                {
                    talk.TimeSlot = slot;
                }

                slot.Talks = slot.Talks.OrderBy (t => t.Room).ToList();
            }

            // Add slots to eventData
            foreach (var slot in slots.OrderBy (s => s.StartTime))
            {
                eventData.Slots.Add(slot);
            }
        }
Пример #21
0
 public TalkQuery(Talk talk, Exception exception)
 {
     Talk      = talk;
     Exception = exception;
 }
Пример #22
0
 public void NavigateToTalkDetails(Talk selectedTalk)
 {
     _navigationService.NavigateToAsync <TalkDetailsViewModel>(selectedTalk);
 }
Пример #23
0
    public void Start()
    {
        pausebutton.GetComponent<Button>().interactable = false;
        playbutton.GetComponent<Button>().interactable = true;
        fastbutton.GetComponent<Button>().interactable = true;
        infertileAge = Random.Range (37,45);
        glowing = true;
        glowUp = true;
        glowColor = Glowfade.color;
        glowColor.a = 0;
        FadeInCycle = 0;
        FadeIn = false;
        startTime = false;
        quickTime = false;
        startButton.interactable = false;
        maleToggle.isOn = true;
        playerIsMale = true;
        birthPanel.SetActive(true);
        deathfadeCount = 0;
        datingPanel.SetActive(false);
        deathPanel.SetActive(false);
        deathYear = 50 + Random.Range(0, 20) + Random.Range(0, 20) + Random.Range(0, 20);
        deathMonth = Random.Range(1, 12);
        startAge = 16;
        age = startAge;
        time = 0f;
        monthsSinceBirth = 0;
        alive = true;
        married = false;
        divorceCount = 0;
        monthCount = 2;
        status = "You are single";
        fastforward = 0;
        partner = canvas.GetComponent<Partner>();
        options = canvas.GetComponent<Options>();
        relationship = canvas.GetComponent<Relationship>();
        textupdate = canvas.GetComponent<TextUpdate>();
        talk = canvas.GetComponent<Talk>();
        obituary = canvas.GetComponent<Obituary>();
        career = canvas.GetComponent<Career>();
        colorName = partner.nameText.color;
        colorName.a = 0;
        relationshipCount = 0;
        marriageCount = 0;
        childrenCount = 0;
        pregnant = false;
        birthMonth = 0;
        birthYear = 0;
        durationMonths = 0;
        durationYears = 0;
        fastForwardCount = 0;
        fastTimeOn = false;
        partner.exName = "";
        partner.exDuration = 0;
        maxHappiness = 50;
        jumpTime = 5;
        deathColor = Deathfade.color;
        birthColor = Birthfade.color;
        impendingDeath = false;
        relationship.playerpositiveemitter.GetComponent<ParticleSystem>().enableEmission = false;
        relationship.playernegativeemitter.GetComponent<ParticleSystem>().enableEmission = false;

        for ( int i = 0; i < 3; i++ )
        {
            obituary.soNames[i] = "";
            obituary.soLength[i] = 0;
            obituary.marriedSO[i] = false;
            obituary.soChildren[i] = 0;
        }

        if ( Random.Range (0,101) > 50)
        {
            nameCount = Random.Range(0,partner.maleNames.Length);
            playerName = partner.maleNames[nameCount];
        }
        else
        {
            nameCount = Random.Range(0,partner.femaleNames.Length);
            playerName = partner.femaleNames[nameCount];
        }
        inputNameText.text = playerName;
        monthInput.text = Random.Range (1,13).ToString();
        yearInput.text = Random.Range (1950,1995).ToString();
        impendingDeath = false;
        hotnessText.text = aspectText[0];
        personalityText.text = aspectText[1];
        wealthText.text = aspectText[2];
        careerText.text = aspectText[3];
    }
Пример #24
0
 public async Task <bool> RemoveTalkFromEngagementAsync(Talk talk)
 {
     return(await _engagementDataStore.RemoveTalkFromEngagementAsync(talk));
 }
Пример #25
0
        public void Talk_Should_Be_Hello()
        {
            var result = Talk.Hello();

            Assert.Equal("Hello", result);
        }
        private async Task BuyItem(int itemId, int npcId, int count, int selectString)
        {
            var unit = GameObjectManager.GetObjectsByNPCId <Character>((uint)npcId).OrderBy(r => r.Distance()).FirstOrDefault();

            if (unit == null)
            {
                _isDone = true;
                return;
            }

            if (!ShopExchangeCurrency.Open && unit.Location.Distance(Core.Me.Location) > 4f)
            {
                await Navigation.OffMeshMove(unit.Location);

                await Coroutine.Sleep(500);
            }

            unit.Interact();

            if (dialog)
            {
                await Coroutine.Wait(5000, () => Talk.DialogOpen);

                while (Talk.DialogOpen)
                {
                    Talk.Next();
                    await Coroutine.Sleep(1000);
                }
            }

            await Coroutine.Wait(5000, () => Conversation.IsOpen);

            if (Conversation.IsOpen)
            {
                Conversation.SelectLine((uint)selectString);

                if (dialog)
                {
                    await Coroutine.Wait(5000, () => Talk.DialogOpen);

                    while (Talk.DialogOpen)
                    {
                        Talk.Next();
                        await Coroutine.Sleep(1000);
                    }
                }

                await Coroutine.Wait(5000, () => ShopExchangeCurrency.Open);


                if (ShopExchangeCurrency.Open)
                {
                    //Log("Opened");
                    ShopExchangeCurrency.Purchase((uint)itemId, (uint)count);
                    await Coroutine.Wait(2000, () => SelectYesno.IsOpen || Request.IsOpen);

                    if (SelectYesno.IsOpen)
                    {
                        SelectYesno.Yes();
                        await Coroutine.Sleep(1000);
                    }
                }

                await Coroutine.Wait(2000, () => ShopExchangeCurrency.Open);

                if (ShopExchangeCurrency.Open)
                {
                    ShopExchangeCurrency.Close();
                }
            }

            _isDone = true;
        }
Пример #27
0
 void Start()
 {
     partner = canvas.GetComponent<Partner>();
     display = canvas.GetComponent<Display>();
     options = canvas.GetComponent<Options>();
     talk = canvas.GetComponent<Talk>();
     career = canvas.GetComponent<Career>();
     relationshipStrength = 50;
     playerHappiness = 50;
     partnerHappiness = 50;
     buttonImage.SetActive(false);
     button.GetComponent<Button>().interactable = true;
     countdown = 0;
     invest = false;
     investEffectPlayer = 0;
     investmentEffect = 0.15f;
     investmentDecay = 60f;
     pastplayerhappiness = 50;
 }
Пример #28
0
 public void TestButtonsText()
 {
     talk = database.talkList [currentTalk];
     modalPanel.Choice ( talk.talkSpeech, icon, talk.talkResponse, TestResponse1, talk.talkResponse1,TestResponse2,talk.talkResponse2,TestResponse3);
 }
Пример #29
0
    public void talk(int x, int y, TileData otherTileData)
    {
        Talk talk = otherTileData.gameObject.GetComponent <Talk>();

        Dialoguer.StartDialogue(talk.dialogureID);
    }
Пример #30
0
    private void Awake()
    {
        if (game == null)
        {
            game = this;
        }

#if UNITY_EDITOR
        if (SceneManager.GetActiveScene().name == "Sopen")
        {
            CSV.GetInstance().loadFile(Application.dataPath + "/Resources", "opentest1221");                                               //loadCSV
        }
        else if (SceneManager.GetActiveScene().name == "SmainFake")
        {
            CSV.GetInstance().loadFile(Application.dataPath + "/Resources", "fakeopentest1223");
        }
        else if (SceneManager.GetActiveScene().name == "Sbird" || SceneManager.GetActiveScene().name == "Schuchu" || SceneManager.GetActiveScene().name == "Sroad")
        {
            CSV.GetInstance().loadFile(Application.dataPath + "/Resources", "artest0524");
        }
        else
        {
            CSV.GetInstance().loadFile(Application.dataPath + "/Resources", "test1223"); //loadCSV
        }
#else
        if (SceneManager.GetActiveScene().name == "Sopen")
        {
            CSV.GetInstance().loadFile(Application.dataPath + "/StreamingAssets", "opentest1221");                                               //loadCSV
        }
        else if (SceneManager.GetActiveScene().name == "SmainFake")
        {
            CSV.GetInstance().loadFile(Application.dataPath + "/StreamingAssets", "fakeopentest1223");
        }
        else if (SceneManager.GetActiveScene().name == "Sbird" || SceneManager.GetActiveScene().name == "Schuchu" || SceneManager.GetActiveScene().name == "Sroad")
        {
            CSV.GetInstance().loadFile(Application.dataPath + "/StreamingAssets", "artest0524");
        }
        else
        {
            CSV.GetInstance().loadFile(Application.dataPath + "/StreamingAssets", "test1223"); //loadCSV
        }
#endif


        if (SceneManager.GetActiveScene().name == "SblueRoom")
        {
            SaveData._data.tutorialEnd = true;
        }
        else if (SceneManager.GetActiveScene().name == "Sout")
        {
            SaveData._data.tutorialEnd = false;
        }
        //load player position
        if (SaveData._data.tutorialEnd)
        {
            SaveData.SceneInfo roomInfo = SaveData._data.getRoomInfo(SceneManager.GetActiveScene().name);

            if ((roomInfo.name != "SblueRoom" || !roomInfo.firstTalk))
            {
                Debug.Log(SaveData._data.nowScene);
                Player.transform.position = GameObject.Find(SaveData._data.nowScene).transform.position;
                SaveData._data.playerPos  = Player.transform.position;
            }
            SaveData._data.nowScene = roomInfo.name;//first set scene name
        }

        Items = GameObject.FindGameObjectsWithTag("item");

        if (SceneManager.GetActiveScene().name != "Stitle" && SceneManager.GetActiveScene().name != "ARcamera" && SceneManager.GetActiveScene().name != "Sanimation")
        {
            _talky = _TalkUI.GetComponent <Talk>();
        }
    }
Пример #31
0
        /// <summary>
        /// Update AdditionalGameinfo.
        /// </summary>
        /// <param name="gameInfo">Game information.</param>
        public void Update(GameInfo gameInfo)
        {
            // 1日の最初の呼び出しではその日の初期化などを行う
            if (gameInfo.Day != day)
            {
                day          = gameInfo.Day;
                talkListHead = 0;
                AddExecutedAgent(gameInfo.ExecutedAgent); // 前日に追放されたエージェントを登録
                if (gameInfo.LastDeadAgentList.Count != 0)
                {
                    LastKilledAgent = gameInfo.LastDeadAgentList[0]; // 妖狐がいないので長さ最大1
                }
                if (LastKilledAgent != null)
                {
                    if (!KilledAgents.Contains(LastKilledAgent))
                    {
                        KilledAgents.Add(LastKilledAgent);
                    }
                    AliveOthers.Remove(LastKilledAgent);
                }
            }
            // (夜フェーズ限定)追放されたエージェントを登録
            AddExecutedAgent(gameInfo.LatestExecutedAgent);
            // talkListからカミングアウト,占い結果,霊媒結果を抽出
            for (int i = talkListHead; i < gameInfo.TalkList.Count; i++)
            {
                Talk    talk    = gameInfo.TalkList[i];
                Agent   talker  = talk.Agent;
                Content content = new Content(talk.Text);
                Agent   target  = content.Target;
                switch (content.Topic)
                {
                case Topic.COMINGOUT:
                    ComingoutMap[talker] = content.Role;
                    break;

                case Topic.DIVINED:
                    DivinationList.Add(new Judge(day, talker, content.Target, content.Result));
                    break;

                case Topic.IDENTIFIED:
                    IdentList.Add(new Judge(day, talker, target, content.Result));
                    break;

                case Topic.ESTIMATE:
                    if (target != null)
                    {
                        if (EstimateMap[target] == null)
                        {
                            EstimateMap[target] = new List <Talk>();
                        }
                        EstimateMap[target].Add(talk);
                    }
                    break;

                default:
                    break;
                }
            }
            talkListHead = gameInfo.TalkList.Count;
        }
Пример #32
0
        static void foo()
        {
            Talk talk = new Talk();

            Console.WriteLine(talk.sayHello() + " " + talk.sayWorld() + "!");
        }
Пример #33
0
    // Update is called once per frame
    void Update()
    {
        DemonOn = Trap01.GetComponent <DemonTrap>().DemonTrapOn;
        GhostOn = Trap02.GetComponent <GhostTrap>().GhostTrapOn;
        LoadOn  = Trap03.GetComponent <LoadTrap>().LoadTrapOn;

        if (DemonOn && GhostOn && LoadOn /*|| Input.GetKey(KeyCode.B)*/)
        {
            Diablo.SetActive(true);
            if (!TrapOn)
            {
                StartCoroutine(DiabloSummon());
                DiabloSound.GetComponent <AudioSource>().Play();
                TrapOn = true;
            }
        }

        if (player_c.die)
        {
            GameOver.SetActive(true);
        }

        if (Input.GetKeyDown(KeyCode.Q))
        {
            GameObject.Find("Vol").GetComponent <AudioSource>().Play();

            if (!Quest.active)
            {
                if (status.active)
                {
                    status.SetActive(false);
                }
                Quest.SetActive(true);
                cam.GetComponent <CameraSize>().Button01();
                //cam.transform.position -= new Vector3(2, 0, 0);
            }
            else
            {
                Quest.SetActive(false);
                cam.GetComponent <CameraSize>().Button01();
                player_c.wait = true;
                //cam.transform.position += new Vector3(2, 0, 0);
            }
        }

        if (Input.GetKeyDown(KeyCode.I))
        {
            GameObject.Find("Vol").GetComponent <AudioSource>().Play();

            if (!Inven.active)
            {
                if (skill.active)
                {
                    skill.SetActive(false);
                }
                PlayerControl.DontMove = true;
                Inven.SetActive(true);
                cam.GetComponent <CameraSize>().Button02();
                //cam.transform.position += new Vector3(2, 0, 0);
            }
            else
            {
                PlayerControl.DontMove = false;
                Inven.SetActive(false);
                cam.GetComponent <CameraSize>().Button02();
                player_c.wait = true;
                //cam.transform.position -= new Vector3(2, 0, 0);
            }
        }

        if (Input.GetKeyDown(KeyCode.Escape))
        {
            if (player_c.die)
            {
                SceneManager.LoadScene("Title");
            }
            else
            {
                GameObject.Find("Vol").GetComponent <AudioSource>().Play();

                if (skill.active)
                {
                    skill.SetActive(false);
                    player_c.wait           = true;
                    cam.transform.position -= new Vector3(2, 0, 0);
                    cam.GetComponent <CameraSize>().status = false;
                }
                else if (skill_right.active)
                {
                    skill_right.SetActive(false);
                    player_c.wait = true;
                }
                else if (skill_left.active)
                {
                    skill_left.SetActive(false);
                    player_c.wait = true;
                }
                else if (status.active)
                {
                    status.SetActive(false);
                    player_c.wait           = true;
                    cam.transform.position += new Vector3(2, 0, 0);
                    cam.GetComponent <CameraSize>().skill = false;
                }
                else if (Inven.active)
                {
                    Inven.SetActive(false);
                    PlayerControl.DontMove  = false;
                    player_c.wait           = true;
                    cam.transform.position -= new Vector3(2, 0, 0);
                    cam.GetComponent <CameraSize>().status = false;
                }
                else if (Quest.active)
                {
                    Quest.SetActive(false);
                    player_c.wait           = true;
                    cam.transform.position += new Vector3(2, 0, 0);
                    cam.GetComponent <CameraSize>().skill = false;
                }

                else if (NPC_menu01.active)
                {
                    NPC_menu01.SetActive(false);
                    player_c.Play();
                }

                else if (NPC_menu02.active)
                {
                    NPC_menu02.SetActive(false);
                    player_c.Play();
                }

                else if (Talk.active)
                {
                    Talk.SetActive(false);
                    if (NPCTalk.Intro || NPCTalk.Gossip)
                    {
                        NPC_menu02.SetActive(true);
                        NPCTalk.Intro  = false;
                        NPCTalk.Gossip = false;
                    }
                }

                else if (!skill.active && !Inven.active && !skill_left.active && !skill_right.active && !status.active && !Quest.active && !NPC_menu01.active && !NPC_menu02.active && !Talk.active && !player_c.die)
                {
                    OnOff.Play();
                    state++;

                    if (state % 2 == 1)
                    {
                        player_m.isRun  = false;
                        player_m.isWalk = false;

                        player_m.animator.SetBool("Walk", false);
                        player_m.animator.SetBool("Run", false);

                        //Time.timeScale = 0f;
                        Option.SetActive(true);

                        if (Option.activeSelf)
                        {
                            player_c.wait = false;
                        }
                    }

                    else
                    {
                        player_c.wait = true;
                        for (int i = 0; i < Focus_d.Length; i++)
                        {
                            Focus_d[i].SetActive(false);
                        }
                        Option.SetActive(false);
                        SeOption.SetActive(false);
                        SoundOption.SetActive(false);
                        VideoOption.SetActive(false);
                        //Time.timeScale = 1f;
                        state = 0;
                    }
                }
            }
        }
    }
Пример #34
0
        void Talk()
        {
            foreach (var agent in AliveAgentList)
            {
                gameData.RemainTalkMap[agent] = gameSetting.MaxTalk;
            }

            var skipCounter = new Dictionary <Agent, int>();

            for (var turn = 0; turn < gameSetting.MaxTalkTurn; turn++)
            {
                var continueTalk = false;
                foreach (var agent in AliveAgentList.Shuffle())
                {
                    var text = Lib.Talk.OVER;
                    if (gameData.RemainTalkMap[agent] > 0)
                    {
                        text = gameServer.RequestTalk(agent);
                    }
                    if (text == null || text.Length == 0)
                    {
                        text = Lib.Talk.SKIP;
                    }
                    else
                    {
                        text = StripText(text);
                    }
                    if (text == Lib.Talk.SKIP)
                    {
                        if (skipCounter.ContainsKey(agent))
                        {
                            skipCounter[agent]++;
                        }
                        else
                        {
                            skipCounter[agent] = 1;
                        }
                        if (skipCounter[agent] > gameSetting.MaxSkip)
                        {
                            text = Lib.Talk.OVER;
                        }
                    }
                    var talk = new Talk(gameData.NextTalkIdx, Day, turn, agent, text);
                    gameData.AddTalk(talk.Agent, talk);
                    if (GameLogger != null)
                    {
                        GameLogger.Log($"{Day},talk,{talk.Idx},{talk.Turn},{talk.Agent.AgentIdx},{talk.Text}");
                    }
                    if (text != Lib.Talk.OVER && text != Lib.Talk.SKIP)
                    {
                        skipCounter[agent] = 0;
                    }
                    if (talk.Text != Lib.Talk.OVER)
                    {
                        continueTalk = true;
                    }
                }
                if (!continueTalk)
                {
                    break;
                }
            }
        }
 public void Add(Talk newTalk)
 {
     db.Add(newTalk);
 }
        //--------------------------------------------------------------------------------------------------------------≠//
        void Start()
        {
            gameManager = GameObject.Find ("Follow Camera").GetComponent<GmaeManage> ();

            if (gameManager.gameState != GameState.NullState) {
                bridge_npc = GameObject.Find ("NPC_Bridge");
                priest = GameObject.Find ("Priest");
                lightHouseKeeper = GameObject.Find ("NPC_LightHouseKeeper");
                NPC_worker = GameObject.Find ("NPC_Worker");
                pickupTool = GameObject.Find ("Pickaxe");
                lighthouseRotate = GameObject.Find ("LigthHouse_Glass").GetComponent<LightOnRotate> ();
                LightHouseKeep_DropOff = GameObject.Find ("LightHouseKeep_DropOff");

                if (LightHouseKeep_DropOff.activeSelf) {
                    LightHouseKeep_DropOff.SetActive (false);
                }

                bridgeDrop = GameObject.Find ("Walkway-Bridge_C-Basic").GetComponent<DropTheBridge> ();
                overHereLight = bridge_npc.transform.FindChild ("Sphere").transform.FindChild ("Activate").gameObject;
                talkCoroutine = GameObject.Find ("NPC_TalkBox").GetComponent<Talk> ();

                if (lookAtObjects.Length != 4) {
                    lookAtObjects = new GameObject[4];
                }
                lookAtObjects [0] = GameObject.Find ("Church_Roof");
                lookAtObjects [1] = GameObject.Find ("Lighthouse_LookAt");
                lookAtObjects [2] = GameObject.Find ("Pickaxe");
                lookAtObjects [3] = GameObject.Find ("Walkway-Bridge_C-Basic");

                if (moveToObjects.Length != 3) {
                    moveToObjects = new Transform[3];
                }

                moveToObjects [0] = GameObject.Find ("lighthouseMove").transform;
                moveToObjects [1] = GameObject.Find ("Robbing_Point").transform;
                moveToObjects [2] = GameObject.Find ("Lighthouse_Move").transform;

                umbrella = GameObject.Find ("main_Sphere");

                npc_Interact = bridge_npc.GetComponent<NPC_Interaction> ();
                npc_Interact.missionDelegate = StartFinalMission;

                npc_Animator = bridge_npc.GetComponent<Animator> ();

                jumpAround_Final = true;
                currentPerson = bridge_npc;
                cmaera = GameObject.Find ("Follow Camera");
                cmaeraMove = cmaera.GetComponent<_MoveCamera> ();

                handle = GameObject.Find ("handle");

                workingSource = lighthouseRotate.transform.GetChild(1).GetComponent<AudioSource>();
            //				workingSFX = workingSource.clip;
            }
        }
 public void Delete(Talk talk)
 {
     db.Remove(talk);
 }
        public void Update(Talk updatedTalk)
        {
            var entity = db.Attach(updatedTalk);

            entity.State = EntityState.Modified;
        }
Пример #39
0
 public bool RegisterTalk(int conventionId, Talk talk)
 {
     return(conventionsRepository.RegisterTalk(conventionId, talk));
 }
        void Start()
        {
            gameManager = GameObject.Find ("Follow Camera").GetComponent<GmaeManage> ();

            horseGuy = GameObject.Find ("HorseMan");
            horseGuy.GetComponent<NPC_Interaction> ().missionDelegate = StartHorsesMission;// he will only give you the horse mission.

            overHereLight = horseGuy.transform.FindChild ("Sphere").transform.FindChild ("Activate").gameObject;
            overHereLight.SetActive (false);

            npc_Interact = horseGuy.GetComponent<NPC_Interaction> ();
            if (horseGuy.GetComponent<Animator> ()) {
                npc_Animator = horseGuy.GetComponent<Animator> ();
                if (!npc_Animator.isActiveAndEnabled) {
                    npc_Animator.enabled = true;
                }
            }
            horseDropOff = GameObject.Find ("HorseDropoff").GetComponent<MeshRenderer> ();
            horses = GameObject.Find ("Horses").transform;

            if (GetComponent<Animator> ()) {
                if (!npc_Animator.isActiveAndEnabled) {
                    npc_Animator.enabled = true;
                }
            }

            horse_X = 0;
            talkCoroutine = GameObject.Find ("NPC_TalkBox").GetComponent<Talk> ();
        }
Пример #41
0
        public static void Initialize(SacramentMeetingContext context)
        {
            // context.Database.EnsureCreated();

            // Look for any Members
            if (context.Member.Any())
            {
                return; // Db already has data
            }
            var members = new Member[]
            {
                new Member {
                    FirstName = "Joseph", LastName = "Smith", MembersGender = Gender.Male
                },
                new Member {
                    FirstName = "Emma", LastName = "Smith", MembersGender = Gender.Female
                },
                new Member {
                    FirstName = "Jeffrey", LastName = "Holland", MembersGender = Gender.Male
                },
                new Member {
                    FirstName = "Donnie", LastName = "Osmond", MembersGender = Gender.Male
                },
                new Member {
                    FirstName = "Marie", LastName = "Osmond", MembersGender = Gender.Female
                },
                new Member {
                    FirstName = "David", LastName = "Archuletta", MembersGender = Gender.Male
                },
                new Member {
                    FirstName = "Katherine", LastName = "Heigl", MembersGender = Gender.Female
                },
                new Member {
                    FirstName = "Glenn", LastName = "Beck", MembersGender = Gender.Male
                },
                new Member {
                    FirstName = "Mitt", LastName = "Romney", MembersGender = Gender.Male
                },
                new Member {
                    FirstName = "Julianne", LastName = "Hough", MembersGender = Gender.Female
                },
                new Member {
                    FirstName = "Brandon", LastName = "Flowers", MembersGender = Gender.Male
                },
                new Member {
                    FirstName = "Merlin", LastName = "Olsen", MembersGender = Gender.Male
                },
                new Member {
                    FirstName = "Ricky", LastName = "Schroder", MembersGender = Gender.Male
                },
                new Member {
                    FirstName = "Gladys", LastName = "Knight", MembersGender = Gender.Female
                },
                new Member {
                    FirstName = "Jack", LastName = "Dempsey", MembersGender = Gender.Male
                },
                new Member {
                    FirstName = "Danny", LastName = "Ainge", MembersGender = Gender.Male
                },
                new Member {
                    FirstName = "Dieter", LastName = "Uchtdorf", MembersGender = Gender.Male
                },
            };

            foreach (Member m in members)
            {
                context.Member.Add(m);
            }
            context.SaveChanges();

            var callings = new Calling[]
            {
                new Calling {
                    Title = "Bishop", Organization = Organizations.Bishopric, CallingGender = GenderCl.Male
                },
                new Calling {
                    Title = "1st Counselor", Organization = Organizations.Bishopric, CallingGender = GenderCl.Male
                },
                new Calling {
                    Title = "2nd Counselor", Organization = Organizations.Bishopric, CallingGender = GenderCl.Male
                },
                new Calling {
                    Title = "Organist", Organization = Organizations.Music, CallingGender = GenderCl.Both
                },
                new Calling {
                    Title = "Choirister", Organization = Organizations.Music, CallingGender = GenderCl.Both
                },
                new Calling {
                    Title = "2nd Counselor", Organization = Organizations.Young_Men, CallingGender = GenderCl.Male
                },
                new Calling {
                    Title = "President", Organization = Organizations.Young_Men, CallingGender = GenderCl.Male
                },
                new Calling {
                    Title = "1st Counselor", Organization = Organizations.Young_Men, CallingGender = GenderCl.Male
                },
                new Calling {
                    Title = "2nd Counselor", Organization = Organizations.Primary, CallingGender = GenderCl.Female
                },
                new Calling {
                    Title = "2nd Counselor", Organization = Organizations.Young_Women, CallingGender = GenderCl.Female
                },
                new Calling {
                    Title = "President", Organization = Organizations.Primary, CallingGender = GenderCl.Female
                },
                new Calling {
                    Title = "President", Organization = Organizations.Young_Women, CallingGender = GenderCl.Female
                },
                new Calling {
                    Title = "1st Counselor", Organization = Organizations.Young_Women, CallingGender = GenderCl.Female
                },
                new Calling {
                    Title = "1st Counselor", Organization = Organizations.Primary, CallingGender = GenderCl.Female
                },
                new Calling {
                    Title = "Teacher 8yr Olds", Organization = Organizations.Primary, CallingGender = GenderCl.Both
                },
                new Calling {
                    Title = "Teacher 7yr Old", Organization = Organizations.Primary, CallingGender = GenderCl.Both
                },
            };

            foreach (Calling c in callings)
            {
                context.Calling.Add(c);
            }
            context.SaveChanges();

            var currentCallings = new CurrentCalling[]
            {
                new CurrentCalling {
                    MemberID = 4, CallingID = 1, DateCalled = DateTime.Parse("2018-3-01")
                },
                new CurrentCalling {
                    MemberID = 1, CallingID = 2, DateCalled = DateTime.Parse("2018-3-01")
                },
                new CurrentCalling {
                    MemberID = 9, CallingID = 3, DateCalled = DateTime.Parse("2018-3-01")
                },
                new CurrentCalling {
                    MemberID = 5, CallingID = 4, DateCalled = DateTime.Parse("2002-9-05")
                },
                new CurrentCalling {
                    MemberID = 7, CallingID = 5, DateCalled = DateTime.Parse("2017-4-19")
                },
                new CurrentCalling {
                    MemberID = 11, CallingID = 6, DateCalled = DateTime.Parse("2015-8-13")
                },
                new CurrentCalling {
                    MemberID = 13, CallingID = 7, DateCalled = DateTime.Parse("2015-8-06")
                },
            };

            foreach (CurrentCalling c in currentCallings)
            {
                context.CurrentCalling.Add(c);
            }
            context.SaveChanges();

            var songs = new Song[]
            {
                new Song {
                    SongID = 2, Title = "The Spirit of God"
                },
                new Song {
                    SongID = 8, Title = "Redeemer Of Israel"
                },
                new Song {
                    SongID = 19, Title = "We Thank The O God For A Prophet"
                },
                new Song {
                    SongID = 26, Title = "Joseph Smith's First Prayer"
                },
                new Song {
                    SongID = 35, Title = "For The Strength Of The Hills"
                },
                new Song {
                    SongID = 41, Title = "Let Zion In Her Beauty Rise"
                },
                new Song {
                    SongID = 58, Title = "Come Ye Children Of The Lord"
                },
                new Song {
                    SongID = 66, Title = "Rejoice, The Lord Is King"
                },
                new Song {
                    SongID = 85, Title = "How Firm A Foundation"
                },
                new Song {
                    SongID = 89, Title = "The Lord Is My Light"
                },
                new Song {
                    SongID = 92, Title = "For The Beauty Of The Earth"
                },
                new Song {
                    SongID = 96, Title = "Dearest Children God Is Near You"
                },
                new Song {
                    SongID = 97, Title = "Lead Kindly Light"
                },
                new Song {
                    SongID = 98, Title = "I Need Thee Every Hour"
                },
                new Song {
                    SongID = 116, Title = "Come, Follow Me"
                },
                new Song {
                    SongID = 169, Title = "As Now We Take The Sacrament"
                },
                new Song {
                    SongID = 173, Title = "While Of These Emblems We Partake"
                },
                new Song {
                    SongID = 181, Title = "Jesus Of Nazereth, Savior And King"
                },
                new Song {
                    SongID = 184, Title = "Upon The Cross of Calvary"
                },
                new Song {
                    SongID = 185, Title = "Reverently And Meekly Now"
                },
                new Song {
                    SongID = 188, Title = "Thy Will O Lord, Be Done"
                },
                new Song {
                    SongID = 193, Title = "I Stand All Amazed"
                },
                new Song {
                    SongID = 194, Title = "There Is A Green Hill Far Away"
                },
                new Song {
                    SongID = 196, Title = "Jesus, Once Of Humble Birth"
                }
            };

            foreach (Song s in songs)
            {
                context.Song.Add(s);
            }
            context.SaveChanges();

            var meetings = new Meeting[]
            {
                new Meeting {
                    MeetingDate = DateTime.Parse("2019-12-9"), CallingID = 1
                },
                new Meeting {
                    MeetingDate = DateTime.Parse("2019-12-16"), CallingID = 1
                },
                new Meeting {
                    MeetingDate = DateTime.Parse("2019-12-23"), CallingID = 1
                },
                new Meeting {
                    MeetingDate = DateTime.Parse("2019-12-30"), CallingID = 1
                },
            };

            foreach (Meeting m in meetings)
            {
                context.Meeting.Add(m);
            }
            context.SaveChanges();

            var songSelections = new SongSelection[]
            {
                new SongSelection {
                    SongID = 2, MeetingID = 1, Schedule = SongPosition.Opening
                },
                new SongSelection {
                    SongID = 173, MeetingID = 1, Schedule = SongPosition.Sacrament
                },
                new SongSelection {
                    SongID = 8, MeetingID = 1, Schedule = SongPosition.Closing
                },
                new SongSelection {
                    SongID = 19, MeetingID = 2, Schedule = SongPosition.Opening
                },
                new SongSelection {
                    SongID = 181, MeetingID = 2, Schedule = SongPosition.Sacrament
                },
                new SongSelection {
                    SongID = 26, MeetingID = 2, Schedule = SongPosition.Closing
                },
                new SongSelection {
                    SongID = 35, MeetingID = 3, Schedule = SongPosition.Opening
                },
                new SongSelection {
                    SongID = 194, MeetingID = 3, Schedule = SongPosition.Sacrament
                },
                new SongSelection {
                    SongID = 66, MeetingID = 3, Schedule = SongPosition.Closing
                },
                new SongSelection {
                    SongID = 85, MeetingID = 4, Schedule = SongPosition.Opening
                },
                new SongSelection {
                    SongID = 196, MeetingID = 4, Schedule = SongPosition.Sacrament
                },
                new SongSelection {
                    SongID = 98, MeetingID = 4, Schedule = SongPosition.Closing
                },
            };

            foreach (SongSelection s in songSelections)
            {
                context.SongSelection.Add(s);
            }
            context.SaveChanges();

            var prayers = new Prayer[]
            {
                new Prayer {
                    MeetingID = 1, MemberID = 10, Schedule = PrayerPosition.Opening
                },
                new Prayer {
                    MeetingID = 1, MemberID = 11, Schedule = PrayerPosition.Closing
                },
                new Prayer {
                    MeetingID = 2, MemberID = 12, Schedule = PrayerPosition.Opening
                },
                new Prayer {
                    MeetingID = 2, MemberID = 13, Schedule = PrayerPosition.Closing
                },
                new Prayer {
                    MeetingID = 3, MemberID = 14, Schedule = PrayerPosition.Opening
                },
                new Prayer {
                    MeetingID = 3, MemberID = 15, Schedule = PrayerPosition.Closing
                },
                new Prayer {
                    MeetingID = 4, MemberID = 16, Schedule = PrayerPosition.Opening
                },
                new Prayer {
                    MeetingID = 4, MemberID = 1, Schedule = PrayerPosition.Closing
                },
            };

            foreach (Prayer p in prayers)
            {
                context.Prayer.Add(p);
            }
            context.SaveChanges();

            var talks = new Talk[]
            {
                new Talk {
                    MeetingID = 1, MemberID = 1, Topic = "Coming closer to Christ through Christmas traditions"
                },
                new Talk {
                    MeetingID = 1, MemberID = 2, Topic = "Jesus in America"
                },
                new Talk {
                    MeetingID = 1, MemberID = 3, Topic = "Prophets fortell of Jesus Birth"
                },
                new Talk {
                    MeetingID = 2, MemberID = 4, Topic = "Forgiveness"
                },
                new Talk {
                    MeetingID = 2, MemberID = 5, Topic = "Giving Service during the Holidays"
                },
                new Talk {
                    MeetingID = 3, MemberID = 6, Topic = "Christ-Like Attributes"
                },
                new Talk {
                    MeetingID = 3, MemberID = 7, Topic = "'Taking Upon Ourselves the Name of Jesus Christ' by Robert C Gay Oct.2018"
                },
            };

            foreach (Talk t in talks)
            {
                context.Talk.Add(t);
            }
            context.SaveChanges();
        }
Пример #42
0
 public void setTalk(Talk i)
 {
     talk = i;
 }
Пример #43
0
 public async Task <bool> AddTalkToEngagementAsync(int engagementId, Talk talk)
 {
     return(await _engagementDataStore.AddTalkToEngagementAsync(engagementId, talk));
 }
Пример #44
0
    public CharacterData(Character c, Action a)
    {
        //controlled
        scene = c.getScene();
        slot = c.getSlot();
        world = c.getWorld();
        levelUpsAvailable = c.getLevelUpsAvailable();
        experience = c.getExperience();
        hitDie = c.getHitDie();

        //!controlled
        expGive = c.getExpGive();
        friendly = c.getFriendly();
        talk = c.getTalk();

        //character
        race = c.getRace();
        alignment = c.getAlignment();
        affiliation = c.getAffiliation();
        profession = c.getProfession();
        title = c.getTitle();
        characterClass1 = c.getCharacterClass1();
        characterClass2 = c.getCharacterClass2();
        prestigeClass = c.getPrestigeClass();
        controlled = c.getControlled();

        //entity
        name = c.getName();
        level1 = c.getLevel1();
        level2 = c.getLevel2();
        prestigeLevel = c.getPrestigeLevel();
        totalLevel = c.getTotalLevel();
        strength = c.getStrength();
        dexterity = c.getDexterity();
        constitution = c.getConstitution();
        intelligence = c.getIntelligence();
        wisdom = c.getWisdom();
        charisma = c.getCharisma();
        initiativeBonus = c.getInitiativeBonus();
        hostile = c.getHostile();
        initSet = c.getInitSet();
        turn = c.getTurn();
        done = c.getDone();
        initiative = c.getInitiative();
        basicAttackBonus = c.getBasicAttackBonus();
        fortitude = c.getFortitude();
        reflex = c.getReflex();
        will = c.getWill();
        skill = c.getSkill();
        feat = c.getFeat();
        skillPoints = c.getSkillPoints();
        featPoints = c.getFeatPoints();
        classSkill = c.getClassSkill();
        xLocation = c.getXLocation();
        yLocation = c.getYLocation();
        xDirection = c.getXDirection();
        yDirection = c.getYDirection();
        inventory = c.getInventory();
        status = c.getStatus();

        //attackable
        currentHealth = c.getCurrentHealth();
        maxHealth = c.getMaxHealth();
        armorClass = c.getArmorClass();
        prefabName = c.getPrefabName();

        //action
        standardAction = a.getStandardAction();
        moveAction = a.getMoveAction();
        freeAction = a.getFreeAction();
        swiftAction = a.getSwiftAction();
        immediateAction = a.getImmediateAction();
        aoo = a.getAoo();
        currentSpeed = a.getCurrentSpeed();
        maxSpeed = a.getMaxSpeed();
        moveLock = a.getMoveLock();
        aooProvoked = a.getAooProvoked();
        xEnd = a.getXEnd();
        yEnd = a.getYEnd();
        xDir = a.getXDir();
        yDir = a.getYDir();
    }
Пример #45
0
        private static int CurrentDurationofsessionPlusTalk(ICollection <Talk> session, Talk talk)
        {
            session.Add(talk);
            var durationcount = session.Sum(x => x.Duration);

            session.Remove(talk);

            return(durationcount);
        }