public override IEnumerator PlayInternal(CinematicDirector player)
    {
        List <string> setups     = LocalizedText.GetKeysInList("[" + mType + "_SETUP]");
        List <string> punchlines = LocalizedText.GetKeysInList("[" + mType + "_PUNCHLINE]");

        int    jokeNum      = Random.Range(0, setups.Count);
        string setupKey     = setups[jokeNum];
        string punchlineKey = punchlines[jokeNum];
        string setup        = LocalizedText.Get(setupKey);
        string punchline    = LocalizedText.Get(punchlineKey);

        CinematicActionTypewriter   setupAction = new CinematicActionTypewriter();
        Dictionary <string, string> setupParams = new Dictionary <string, string>();

        setupParams.Add("text", setup);
        setupParams.Add("keep_open", "true");
        setupAction.SetParameters(setupParams);
        yield return(player.PlayAction(setupAction));

        CinematicActionTypewriter   punchlineAction = new CinematicActionTypewriter();
        Dictionary <string, string> punchlineParams = new Dictionary <string, string>();

        punchlineParams.Add("text", punchline);
        punchlineAction.SetParameters(punchlineParams);
        yield return(player.PlayAction(punchlineAction));

        yield break;
    }
Exemplo n.º 2
0
    private IEnumerator DeathTransition(string extraData)
    {
        isTransitioning = true;

        deathMessage.GetComponentInChildren <TextMeshProUGUI>().CrossFadeAlpha(1f, 0f, false);

        yield return(StartCoroutine(Fade(new Color(0, 0, 0, 0), new Color(0, 0, 0, 1))));

        mCharacterImageCapture = GameObject.Find("CharacterImageCapture");
        CharacterModel model = mCharacterImageCapture.GetComponentInChildren <CharacterModel>();

        model.transform.localPosition = Vector3.zero;
        model.ChangeModel(Game.instance.followerData);

        deathSpeakerImage.gameObject.SetActive(true);
        StartCoroutine(FadeDeathSpeaker(new Color(0, 0, 0, 0), new Color(1, 1, 1, 1)));

        string msg = null;

        if (extraData == "success")
        {
            msg = LocalizedText.Get(LocalizedText.GetKeysInList("[DUNGEON_SUCCESS]").Sample());
        }
        else
        {
            msg = LocalizedText.Get(LocalizedText.GetKeysInList("[BREAKUP]").Sample());
        }

        if (!Game.instance.finishedTutorial)
        {
            msg = LocalizedText.Get("[BREAKUP_1]");
        }
        yield return(deathMessage.ShowTextCoroutine(msg, 1f, false));

        yield return(new WaitForSeconds(1f));

        deathMessage.GetComponentInChildren <TextMeshProUGUI>().CrossFadeAlpha(0f, 0.5f, false);
        yield return(StartCoroutine(FadeDeathSpeaker(new Color(1, 1, 1, 1), new Color(0, 0, 0, 0))));

        deathSpeakerImage.gameObject.SetActive(false);

        yield return(StartCoroutine(ShowUnlocks()));

        yield return(StartCoroutine(ChangeScene("HUB")));

        yield return(new WaitForSeconds(0.1f));

        yield return(StartCoroutine(Fade(new Color(0, 0, 0, 1), new Color(0, 0, 0, 0))));

        fullScreenQuad.gameObject.SetActive(false);

        deathMessage.gameObject.SetActive(false);

        isTransitioning = false;

        yield break;
    }
Exemplo n.º 3
0
    // Update is called once per frame
    void Update()
    {
        // Only update this if the parent enemy is revealed
        if (parentEnemy != null && !parentEnemy.commonComponents.revealWhenAvatarIsClose.fullyRevealed)
        {
            return;
        }

        mChangeTextTimer -= Time.deltaTime;
        if (mChangeTextTimer <= 0f)
        {
            string message = LocalizedText.Get(LocalizedText.GetKeysInList("[MANSPLAIN]").Sample());
            typewriter.ShowText(message, 1f, false);

            mChangeTextTimer = Random.Range(3f, 10f);
        }
    }
Exemplo n.º 4
0
    public CharacterData BuildRandomCharacter(Quirk quirkOverride = null, Spell spellOverride = null)
    {
        CharacterData randomCharacter = ScriptableObject.CreateInstance <CharacterData>();

        int    genderNum = Random.Range(0, 2);
        string gender    = genderNum == 0 ? "MALE" : "FEMALE";

        // todo bdsowers - add large window for taglines + bios, names
        // also pull from the NEUTRAL list for taglines + bios

        randomCharacter.age = GenerateCharacterAge();

        List <string> taglines = new List <string>();

        LocalizedText.GetKeysInListCopy("[NEUTRAL_TAGLINE]", taglines);
        LocalizedText.GetKeysInListCopy("[MALE_TAGLINE]", taglines);
        LocalizedText.GetKeysInListCopy("[FEMALE_TAGLINE]", taglines);

        List <string> bios = new List <string>();

        LocalizedText.GetKeysInListCopy("[NEUTRAL_BIO]", bios);
        LocalizedText.GetKeysInListCopy("[MALE_BIO]", bios);
        LocalizedText.GetKeysInListCopy("[FEMALE_BIO]", bios);

        // To get our repetition guards to work properly, things need to maintain positions.
        // But we still want to support gendered text, so create a temporary ignore list
        // that contains the previously used positions plus any gender-invalid positions
        List <int> ignoreList = new List <int>(previouslyUsedBios);
        string     invalid    = "[MALE";

        if (genderNum == 0)
        {
            invalid = "[FEMALE";
        }

        for (int i = 0; i < bios.Count; ++i)
        {
            if (bios[i].StartsWith(invalid))
            {
                ignoreList.Add(i);
            }
        }

        int bioAndTaglinePosition = bios.SamplePosition(ignoreList);

        randomCharacter.bio              = bios[bioAndTaglinePosition];
        randomCharacter.characterName    = LocalizedText.GetKeysInList("[" + gender + "_NAME]").Sample((genderNum == 0 ? previouslyUsedMaleNames : previouslyUsedFemaleNames));
        randomCharacter.levelRequirement = 1;

        List <CharacterModelData> unusableModels = new List <CharacterModelData>(previouslyUsedModels);

        unusableModels.Add(PlayerModel());

        CharacterModelData modelData = Game.instance.characterDataList.CharacterModelsWithGender(genderNum).Sample(unusableModels);

        randomCharacter.model             = modelData.model.name;
        randomCharacter.tagline           = taglines[bioAndTaglinePosition];
        randomCharacter.characterUniqueId = randomCharacter.characterName + ":::" + randomCharacter.bio + ":::" + randomCharacter.tagline + ":::" + randomCharacter.model;
        randomCharacter.quirk             = QuirksInLevel(Game.instance.playerData.attractiveness, -1, Game.instance.playerData.scoutLevel, -1).Sample(previouslyUsedQuirks).GetComponent <Quirk>();
        randomCharacter.spell             = SpellsInLevel(Game.instance.playerData.attractiveness, -1, Game.instance.playerData.scoutLevel, -1).Sample(previouslyUsedSpells).GetComponent <Spell>();
        randomCharacter.statBoost         = (CharacterStatType)Random.Range(1, 6);
        randomCharacter.statBoostAmount   = 1 + Random.Range(0, MaximumPassiveStatBoost(randomCharacter.statBoost) + 1);
        randomCharacter.material          = materials.Sample();

        if (quirkOverride != null)
        {
            randomCharacter.quirk = quirkOverride;
        }

        if (spellOverride != null)
        {
            randomCharacter.spell = spellOverride;
        }

        previouslyUsedQuirks.AddWindowed(randomCharacter.quirk, GAMEPLAY_REUSE_WINDOW_SIZE);
        previouslyUsedSpells.AddWindowed(randomCharacter.spell, GAMEPLAY_REUSE_WINDOW_SIZE);
        previouslyUsedModels.AddWindowed(modelData, GAMEPLAY_REUSE_WINDOW_SIZE);

        previouslyUsedBios.AddWindowed(bioAndTaglinePosition, TEXT_REUSE_WINDOW_SIZE);
        if (genderNum == 0)
        {
            previouslyUsedMaleNames.AddWindowed(randomCharacter.characterName, TEXT_REUSE_WINDOW_SIZE);
        }
        else
        {
            previouslyUsedFemaleNames.AddWindowed(randomCharacter.characterName, TEXT_REUSE_WINDOW_SIZE);
        }

        return(randomCharacter);
    }