Exemple #1
0
        private void affect(List <string> targs, double m)
        {
            int t = (int)clamp(m, -1, 1);

            if (responseListNPC[0].FNC == 0)
            {
                t = 0;
            }
            m = clamp(m, -10, 10);
            foreach (string s in targs)
            {
                if (s == "mom")
                {
                    Mom.changeFNC(m);
                    State.sound_man.loop_enqueue(s, t);
                    respondEmotionally(Mom, t);
                }
                else if (s == "-mom")
                {
                    Mom.changeFNC(-m);
                    State.sound_man.loop_enqueue(s.Substring(1, s.Length - 1), t);
                    respondEmotionally(Mom, t);
                }
                else if (s == "dad")
                {
                    Dad.changeFNC(m);
                    State.sound_man.loop_enqueue(s, t);
                    respondEmotionally(Dad, t);
                }
                else if (s == "-dad")
                {
                    Dad.changeFNC(-m);
                    State.sound_man.loop_enqueue(s.Substring(1, s.Length - 1), t);
                    respondEmotionally(Dad, t);
                }
                else if (s == "alex")
                {
                    Alexis.changeFNC(m);
                    State.sound_man.loop_enqueue(s, t);
                    respondEmotionally(Alexis, t);
                }
                else if (s == "-alex")
                {
                    Alexis.changeFNC(-m);
                    State.sound_man.loop_enqueue(s.Substring(1, s.Length - 1), t);
                    respondEmotionally(Alexis, t);
                }
            }
        }
Exemple #2
0
        protected override void Update()
        {
            screenHelper();

            State.sound_man.update_music();

            if (State.dialogueBox.active == true)
            {
                if (State.dialogueBox.currSpeaker == "alex")
                {
                    Alexis.setTalking(true);
                    Dad.setTalking(false);
                    Mom.setTalking(false);
                }
                else if (State.dialogueBox.currSpeaker == "dad")
                {
                    Alexis.setTalking(false);
                    Dad.setTalking(true);
                    Mom.setTalking(false);
                }
                else if (State.dialogueBox.currSpeaker == "mom")
                {
                    Alexis.setTalking(false);
                    Dad.setTalking(false);
                    Mom.setTalking(true);
                }
            }
            else
            {
                Alexis.setTalking(false);
                Dad.setTalking(false);
                Mom.setTalking(false);
            }

            if (State.GetState() == "game" || State.GetState() == "tutorial")
            {
                if (fadeFlag)
                {
                    if (alphaBlack + fadeFloat <= 255 && alphaBlack + fadeFloat >= 0)
                    {
                        alphaBlack += fadeFloat;
                    }
                    else
                    {
                        fadeFlag = false;
                    }
                }

                blackness.FillColor = new Color(0, 0, 0, (byte)alphaBlack);

                // Update the game timerz
                State.updateTimerz();

                // Get the current UI Textboxes from the UI Manager
                var playerDialogues = ui_man.getPlayerDialogues();

                // Get the mouse coordinates from Input Manager
                var MouseCoord = ManagerOfInput.GetMousePos();

                // If the mouse is currently dragging
                if (ManagerOfInput.GetMouseDown())
                {
                    // Loop through buttons
                    for (var i = 0; i < buttons.Count; i++)
                    {
                        // Find button currently being interacted with
                        if (buttons[i].GetSelected() && !buttons[i].getDisabled())
                        {
                            // Move the button around the screen
                            buttons[i].translate(MouseCoord[0], MouseCoord[1], window.Size.X, window.Size.Y);

                            // Check collision with UI Textboxes
                            // Loop through UI Textboxes

                            if (ui_man.wasMouseIn)
                            {
                                // If the mouse just came from inside a UI Textbox
                                if (!ui_man.contains(buttons[i]))
                                {
                                    // Mouse has now left the UI Textbox so set it to false
                                    ui_man.wasMouseIn = false;
                                    // Reset the color to match its previous color
                                    playerDialogues[0].setBoxColor(playerDialogues[0].getBoxColor("prev"));
                                    ui_man.rootBackgroundBorder.OutlineColor = ui_man.rootBackground.FillColor;
                                    // Update the rest of the buttons in the cluster
                                    ui_man.updateClusterColors(playerDialogues[0], playerDialogues, playerDialogues[0].getBoxColor("prev"), false);
                                }
                            }
                            else
                            {
                                // If mouse just came from outside the UI Textbox
                                if (ui_man.contains(buttons[i]))
                                {
                                    ui_man.wasMouseIn = true;
                                    // Update previous color to current color of the UI Textbox
                                    playerDialogues[0].setPrevColor(playerDialogues[0].getBoxColor("curr"));
                                    // Update current color to selected tonal button color
                                    playerDialogues[0].setBoxColor(buttons[i].getTonalColor());
                                    ui_man.rootBackgroundBorder.OutlineColor = buttons[i].getTonalColor();
                                    // Update the rest of the buttons in the cluster
                                    ui_man.updateClusterColors(playerDialogues[0], playerDialogues, buttons[i].getTonalColor(), true);
                                }
                            }
                        }
                    }
                }
            }
            else if (State.GetState() == "pause")
            {
                //State.getGameTimer("game").PauseTimer();
            }
        }
Exemple #3
0
 private void resetCharacterFNC()
 {
     Mom.setCurrentFNC(0);
     Dad.setCurrentFNC(0);
     Alexis.setCurrentFNC(0);
 }