Example #1
0
 public void endDialogue(bool isDialoguing)
 {
     this.getPartnerAt(this.selectedPartner + 1).isPresent  = false;
     this.getPartnerAt(this.selectedPartner + 1).returnTime = myTimeLord.getCurrentTimestep() + 1;
     myGameState.currentGameState = GameState.gameStates.PROWL;
     this.setConversationMode(isDialoguing);
     this.selectedPartner = -1;
 }
 private void expireOldDates()
 {
     foreach (Date d in getAllDates())
     {
         if (d.dateTime < myTimelord.getCurrentTimestep())
         {
             d.isOver = true;
         }
     }
 }
Example #3
0
    public void execute(bool toFastForward)
    {
        Action setCharacterPresentFalse = () =>
        {
            myDialogueManager.getCharacterForName(characterToRemove).isPresent  = false;
            myDialogueManager.getCharacterForName(characterToRemove).returnTime = myTimeLord.getCurrentTimestep() + 1;
        };

        List <Character> charList = GameObject.FindObjectOfType <DialogueManager>().getAllCurrentLocalPresentConversationPartners();

        for (int i = 0; i < charList.Count; i++)
        {
            if (charList[i].givenName.ToLower() == characterToRemove.ToLower())
            {
                if (!toFastForward)
                {
                    myAnimationMaestro.fadeOutCharacterImage(i + 1, fadeDuration);
                    myAnimationMaestro.StartCoroutine(myAnimationMaestro.delayGameCoroutine(fadeDuration, setCharacterPresentFalse));
                }
                else
                {
                    myAnimationMaestro.setImageColor(GameObject.Find("Character " + (i + 1) + " Portrait").GetComponent <Image>(), new Color(255, 255, 255, 0));
                    myDialogueManager.getCharacterForName(characterToRemove).isPresent  = false;
                    myDialogueManager.getCharacterForName(characterToRemove).returnTime = myTimeLord.getCurrentTimestep() + 1;
                }
            }
        }
        myAnimationMaestro.writeDescriptionText(textToWrite, GameObject.Find("TextPanel").GetComponentInChildren <Text>());
    }
Example #4
0
    public void achieveNextExperience(bool playCutscene)
    {
        System.Random random = new System.Random();
        Experience    toReturn;

        if (isIrresponsible)
        {
            toReturn = remainingExperiences["responsibility"];
            remainingExperiences.Remove("responsibility");
            isIrresponsible = false;
        }
        else if (isEndOfGame())
        {
            toReturn = remainingExperiences["create"];
            remainingExperiences.Remove("create");
        }
        else
        {
            List <Experience> expList           = getExperiencesExceptFinal();
            Experience        toRemoveAndReturn = expList[random.Next(expList.Count)];
            remainingExperiences.Remove(toRemoveAndReturn.experienceName);
            toReturn = toRemoveAndReturn;
        }

        achievedExperiences.Add(toReturn);

        Character datePartner = GameObject.FindObjectOfType <RelationshipCounselor>().getDatePartner(mySceneCatalogue.getCurrentLocation(), myTimeLord.getCurrentTimestep());

        if (toReturn.experienceName == "protect")
        {
            myCommandBuilder.createAndEnqueueKeepCharInDateCutSceneSequence(myDialogueManager.getCharacterForName(datePartner.givenName), "God, I'm having so much fun!");
            myCommandBuilder.createAndEnqueueChangeDialogueSequence(new List <string>()
            {
                "Things are going pretty good!",
                "I wonder if I should make my move?...",
                "............."
            });
            myCommandBuilder.createAndEnqueueSummonDateCutSceneCharacterSequence(myDialogueManager.getCharacterForName("chad"), "Hey buddy! What's going on here? I see you all are up to some fun!");
            myCommandBuilder.createAndEnqueueChangeDialogueSequence(new List <string>()
            {
                "I respect you though, dog. And for that I'm gonna let you enjoy this one. Smell ya later...",
            }, isEndOfGame());
            myCommandBuilder.build(stateToBeginIn: GameState.gameStates.DATECUTSCENE, stateToEndIn: GameState.gameStates.DATEOUTRO);
        }
        else
        {
            myCommandBuilder.createAndEnqueueKeepCharInDateCutSceneSequence(myDialogueManager.getCharacterForName(datePartner.givenName), "God, I'm having so much fun!");
            myCommandBuilder.createAndEnqueueSummonDateCutSceneCharacterSequence(myDialogueManager.getCharacterForName("chad"), "Hey buddy! What's going on here? I see you all are up to some fun!");
            myCommandBuilder.createAndEnqueueSummonDateCutSceneCharacterSequence(myDialogueManager.getCharacterForName("evan"), "Hi!");
            myCommandBuilder.createAndEnqueueChangeDialogueSequence(new List <string>()
            {
                "GET OUTTA HERE!"
            });
            myCommandBuilder.createAndEnqueueRemoveDateCutSceneCharacterSequence("chad", "Whoa!!");
            myCommandBuilder.createAndEnqueueChangeDialogueSequence(new List <string>(toReturn.experienceCutSceneTexts), isEndOfGame());
            myCommandBuilder.build(stateToBeginIn: GameState.gameStates.DATECUTSCENE, stateToEndIn: GameState.gameStates.DATEOUTRO);
        }
    }
    public void scheduleDate(Location location)
    {
        int randomTimestepFromPresent = new System.Random().Next(0, 19);
        int randomDateTime            = myTimelord.getCurrentTimestep() + randomTimestepFromPresent;

        randomDateTime = setClubDatesNight(location, randomDateTime);
        myRelationshipCounselor.createDate(location, randomDateTime, this.currentConversation.speaker);
        endConversation("Sounds good. see you " + myTimelord.getTimeString(randomDateTime) + "!");
    }
Example #6
0
    private void updateUIComponentsForState(GameState.gameStates currentState)
    {
        this.deactivateUIComponents();

        if (currentState == GameState.gameStates.COMMANDSEQUENCE)
        {
            mainPanel.SetActive(true);
            characterPanel.gameObject.SetActive(true);
            sequenceButtonsPanel.SetActive(true);
            updatePotentialPartnersSprites(myDialogueManager.getAllCurrentLocalPresentConversationPartners());
        }
        else if (currentState == GameState.gameStates.CUTSCENE)
        {
            updateUIForCutSceneState();
        }
        else if (currentState == GameState.gameStates.PROWL)
        {
            mainPanel.SetActive(true);
            mainPanelButtonsPanel.SetActive(true);
            mapButton.SetActive(!mySceneCatalogue.getIsInInteriorScene());
            characterPanel.gameObject.SetActive(true);

            toggleMainPanelIfUIEnabled(mapPanel, this.mapEnabled);
            toggleMainPanelIfUIEnabled(journalPanel, this.journalEnabled);

            if (mainPanel.activeSelf == true)
            {
                myAnimationMaestro.writeDescriptionText(mySceneCatalogue.getLocationDescription(), textPanel);
                updatePotentialPartnersSprites(myDialogueManager.getAllCurrentLocalPresentConversationPartners());
                updateSelectedPartnerButtonUI();
                updateToggleInteriorButtonUI();
            }
        }
        else if (currentState == GameState.gameStates.CONVERSATION)
        {
            dialoguePanel.SetActive(true);
            characterPanel.gameObject.SetActive(true);
            Image speakerPortrait = GameObject.Find("SpeakerPortrait").GetComponent <Image>();
            speakerPortrait.sprite = BackgroundSwapper.createSpriteFromTex2D(myConversationTracker.currentConversation.speaker.portrait);
            askOnDateButton.SetActive(myConversationTracker.canAskOnDateEnabled());
        }
        else if (currentState == GameState.gameStates.DATEINTRO)
        {
            mainPanel.SetActive(true);
            dateButtonsPanel.SetActive(myRelationshipCounselor.isAtDate);
            dateActionButton.SetActive(!myRelationshipCounselor.getDateAbandonedOrExperienced());
            dateActionButton.GetComponentInChildren <Text>().text = mySceneCatalogue.getCurrentLocation().currentDateAction;
            characterPanel.gameObject.SetActive(true);
            updatePotentialPartnersSprites(new List <Character>()
            {
                myRelationshipCounselor.getDatePartner(mySceneCatalogue.getCurrentLocation(), myTimelord.getCurrentTimestep())
            });
            myAnimationMaestro.writeDescriptionText(mySceneCatalogue.getCurrentLocation().descriptionDate, textPanel);
        }
        else if (currentState == GameState.gameStates.DATE)
        {
            mainPanel.SetActive(true);
            dateButtonsPanel.SetActive(myRelationshipCounselor.isAtDate);
            dateActionButton.SetActive(!myRelationshipCounselor.getDateAbandonedOrExperienced());
            dateActionButton.GetComponentInChildren <Text>().text = mySceneCatalogue.getCurrentLocation().currentDateAction;
            characterPanel.gameObject.SetActive(true);
            updatePotentialPartnersSprites(new List <Character>()
            {
                myRelationshipCounselor.getDatePartner(mySceneCatalogue.getCurrentLocation(), myTimelord.getCurrentTimestep())
            });
        }
        else if (currentState == GameState.gameStates.DATECUTSCENE)
        {
            mainPanel.SetActive(true);
            characterPanel.gameObject.SetActive(true);
            sequenceButtonsPanel.SetActive(true);
            updatePotentialPartnersSprites(GameObject.FindObjectOfType <CommandBuilder>().dateCutSceneCharList);
        }
        else if (currentState == GameState.gameStates.DATEOUTRO)
        {
            mainPanel.SetActive(true);
            dateButtonsPanel.SetActive(true);
            dateActionButton.SetActive(!myRelationshipCounselor.getDateAbandonedOrExperienced());
            myAnimationMaestro.writeDescriptionText("One good date can change your life.", textPanel);
        }
    }