Exemple #1
0
        public CaveIn(Texture2D sprite, Map map, Game1 game, Map nextMap)
            : base(sprite, map)
        {
            this.PhysicalContact += FoundMe;
            this.gameref = game;
            DialogState state = new DialogState(0, "You come across a cavern.\n\n        Dare you venture?");
            state.addResponse("Hells Yah...", -1);
            state.addResponse("It does look a little dark in there...\n    Maybe after a cup of tea.", -2);
            this.Dialog.addState(state);
            state = new DialogState(1, "Its way to scary to enter. \n    Plus, you gotta find more kids first.");
            state.addResponse("Oh.... Ill look then", -1);
            state.addResponse("Who are you to boss me around silly cave?", 2);
            this.Dialog.addState(state);
            state = new DialogState(2, "Im a cave. You know?");
            state.addResponse("Yes, I do know!", 3);
            state.addResponse("So?", 3);
            state.addResponse("Fine, I'll leave you alone", -2);
            this.Dialog.addState(state);
            state = new DialogState(3, "You should listen to me");
            state.addResponse("Why?", 2);
            state.addResponse("Fine!", -2);
            this.Dialog.addState(state);
            this.Position = new Vector2(14, 10 + 32);

            this.nextMap = nextMap;
        }
Exemple #2
0
 public Kid2(Texture2D sprite, Map map, Game1 game)
     : base(sprite, map)
 {
     this.PhysicalContact += FoundMe;
     this.gameref = game;
     DialogState state = new DialogState(0, "... !");
     state.addResponse("Ok...");
     state.addResponse("Allways the mute one.");
     state.addResponse("Noone expects the spanish dictionary!");
     this.Dialog.addState(state);
     this.Position = new Vector2(32 + 24, 16 + 64);
 }
Exemple #3
0
 public Kid1(Texture2D sprite, Map map, Game1 game)
     : base(sprite, map)
 {
     this.PhysicalContact += FoundMe;
     this.gameref = game;
     DialogState state = new DialogState(0, "Awww. I thought you would never find me.\n\n   You wont get me next time though! I promise!");
     state.addResponse("Ok...");
     state.addResponse("To the Next One!");
     state.addResponse("Tau Radience Fills the Galaxy!");
     this.Dialog.addState(state);
     this.Position = new Vector2(45, 17);
 }
Exemple #4
0
        private void SetUpDialog(int targetState)
        {
            if (GameStateManager.CurrentState != this)
                GameStateManager.PushState(this);

            controls = new ControlManager(font);
            controls.selectedControl = 0;
            curState = Char1.Dialog.getCurrentState();
            DialogLabel.Text = curState.stateText;
            DialogLabel.TabStop = false;
            DialogLabel.Position = new Vector2(20, 20);
            DialogLabel.SpriteFont = font;
            if (!controls.Contains(DialogLabel))
                controls.Add(DialogLabel);
            Vector2 pos = new Vector2(300, 300);
            foreach (Response res in curState.responses)
            {
                LinkLabel response = new LinkLabel();
                response.Text = res.responseText;
                response.Value = res.nextStateID;
                response.Function = res.OnSelect;
                response.Position = pos;
                response.Selected += dialog_selected;
                response.SpriteFont = font;
                pos.Y += 32;
                controls.Add(response);
            }
        }
Exemple #5
0
        private void TalkToMe(Object sender, EventArgs e)
        {
            //((PlayerChar)sender).peopleFound++;
            //gameref.Network.ToString();

            //List<SocialGame> games = new List<SocialGame>();

            List<SocialGame> games = gameref.SocialSimStuff.games;  //List of games populated
            //TODO: Figure out how to initialize this games thing...

            /*TO JACK: Jack, I modified more further down.  The commented out code are your original lines*/

            KB_C CKB = gameref.SocialSimStuff.CKB;  //CKB has been initialized.  CKB is populated.
            KB_S SKB = gameref.SocialSimStuff.SKB;  //SKB has been initialized.  SKB is populated.
            SocialPair sp = gameref.Network.getPair(((BlankChar)sender).agent, this.agent); //INVALID CAST EXCEPTION!
            List<SocialGame> playableGames = gameref.Networks.getPlayableGames(sp, games);  //Retrieves the set of playable games.

            //END LIST

            Dialog d = new Dialog();
            //INITIAL DIALOG STATE:

            DialogState state = new DialogState(0, "Hi there.");

            for (int i = 0; Math.Abs(i) < playableGames.Count; i++)
            {
                state.addResponse(playableGames[Math.Abs(i)].gameType.SubjectName.ToString(), i+1);
            }
            //d.addState(state);
            for (int i = 0; Math.Abs(i) < playableGames.Count; i++)
            {
                List<String> spResponses = playableGames[i].getScript(sp);
                if (playableGames[i].gameType.SubjectName == SubjectType.Girl || playableGames[i].gameType.SubjectName == SubjectType.Mushrooms || playableGames[i].gameType.SubjectName == SubjectType.Cave || playableGames[i].gameType.SubjectName == SubjectType.Player)
                {
                    //Subjects: NPC starts dialog. Player, Girl, Mushrooms, Cave
                    //state = new DialogState(0, spResponses[0]);
                    for (int j = 0; j < spResponses.Count; j += 2) //0 = initial statement, 1 = first response. and so on...
                    {
                        d.addState(state);
                        state = new DialogState(i + 1 + j * 20, spResponses[j]);
                        if (spResponses.Count > j + 2)
                            state.addResponse(spResponses[j + 1], i + 1 + (j + 1 ) * 20);
                        else
                            state.addResponse(spResponses[j + 1], i + 1 * -1);
                    }
                }
                else
                {
                    d.addState(state);
                    state = new DialogState(i + 1 , "");
                    for (int j = 0; j < spResponses.Count; j += 2) //0 = initial statement, 1 = first response. and so on...
                    {
                        //state = new DialogState(i + 1 + j * 20, spResponses[j]);
                        if (spResponses.Count > j + 1)
                        {
                            state.addResponse(spResponses[j], i + 1 + (j + 1) * 20);
                            d.addState(state);
                            state = new DialogState(i + 1 + (j + 1) * 20, spResponses[j + 1]);
                        }
                        else
                            state.addResponse(spResponses[j], i + 1 * -1);
                    }
                }
            }
            /*for( int i =  0 ; Math.Abs(i) > games.Count ; i-- )
            {
                state.addResponse(games[i].gameType.SubjectName.ToString(), i);
                //Adds responses based on game
            }*/
            d.addState(state);
            Dialog = d;
            Console.WriteLine(d.ToString());
            gameref.DialogScreen.CallDialog(this, (DialogCharacter)sender);

            //Doesnt Return a String....

            //sp.playGame(games[Math.Abs(d.currentID)], CKB.getTopic(games[Math.Abs(d.currentID)].gameType).Name);    //ONLY modifies values based on algorithm.

            sp.playGame(playableGames[Math.Abs(this.lastDialogEventNum)], CKB.getTopic(playableGames[Math.Abs(this.lastDialogEventNum)].gameType).Name);    //ONLY modifies values based on algorithm.

            //Assuming a Array of Strings, in the order NPC action, then. Player Dialog Options.

               /* String[] spResponses = new String[2];
            state = new DialogState(0,spResponses[0]);
            for (int i = 1; i > spResponses.Length; i++)
            {
                state.addResponse(spResponses[i]);
            }
            */
            /*
            //Subjects: NPC starts dialog. Player, Girl, Mushrooms, Cave
            List<String> spResponses = playableGames[Math.Abs(d.currentID)].getScript(sp);
            state = new DialogState(0, spResponses[0]);
            for (int i = 1; i < spResponses.Count; i++) //0 = initial statement, 1 = first response. and so on...
            {
                state.addResponse(spResponses[i]);
            }

            d = new Dialog();
            d.addState(state);
            Dialog = d;

            gameref.DialogScreen.CallDialog(this, (DialogCharacter)sender);

            //this.PhysicalContact -= FoundMe;
             * */
        }