Esempio n. 1
0
    public static PersonalStory GenerateRandom()
    {
        var newStory = new PersonalStory();

        newStory.personalEXP = -1; //Just in case
        newStory.currentGoal = PersonalGoals.PART_0;
        newStory.expGainRate = Random.Range(0.75f, 1.10f);
        newStory.storyID     = JsonData.GetRandomStoryID();

        //Example of how to get the data.
        //Debug.Log(JsonData.GetDialogueFromStoryID(newStory.storyID, PersonalGoals.PART_1));

        return(newStory);
    }
Esempio n. 2
0
        private async Task <IMessageActivity> CreateResponse(IDialogContext context, PersonalStory story)
        {
            var reply = context.MakeMessage();

            reply.Recipient = reply.From;
            reply.Type      = "message";

            switch (story.Task)
            {
            case PersonalStoryTask.Theme:
                reply.Text = "please add theme";
                break;

            case PersonalStoryTask.Description:
                reply.Text = "please add description";
                break;

            case PersonalStoryTask.Images:
                reply.Text = "please add images";
                break;

            case PersonalStoryTask.Done:
                var storage = new Storage();
                var count   = await storage.MessagesSinceDone(reply.From.Id);

                if (0 >= count)
                {
                    reply.Attachments = new List <Attachment>();
                    var cardImages = new List <CardImage>();
                    cardImages.AddRange(story.Images.Select(i => new CardImage(url: i)));

                    var card = new HeroCard()
                    {
                        Title    = $"Your hustle: {story.Theme}",
                        Subtitle = story.Content,
                        Images   = cardImages,
                        Text     = "Thanks, come back soon. There will be more!"
                    };

                    reply.Attachments.Add(card.ToAttachment());
                }
                else
                {
                    reply.Text = "I am thinking about your hustle... more coming soon. Please feel free to add more photos.";
                }
                break;
            }

            return(reply);
        }
Esempio n. 3
0
    public virtual void Init(bool flagged = false)
    {
        // TODO TEMP REMOVE
        GenerateAppearanceFromData(PersonInfo.GenerateRandom(JsonData.GetRandomName(), flagged));

        FlaggingGay = flagged;
        if (flagged)
        {
            //Personal Story
            Data.StoryData = PersonalStory.GenerateRandom();
        }

        // Make people walk out of step.
        foreach (var animator in transform.GetComponentsInChildren <Animator>())
        {
            animator.SetFloat("CycleOffset", Random.Range(0.0f, 1.0f));
        }

        isInitialised = true;
    }