コード例 #1
0
    public static string GenerateCompliment(Random random)
    {
        string adjective = adjectiveSelector.GetRandomItem();
        string bodyPart  = bodyPartSelector.GetRandomItem();

        bool isPlural = bodyPart.EndsWith("s");

        return(complimentSelector.GetRandomItem()
               .Replace("{BODY_PART}", bodyPart)
               .Replace("{IS_ARE}", isPlural ? "are" : "is")
               .Replace("{POSITIVE_ADJ}", adjective)
               .Replace("{A_OR_BLANK}", isPlural ? "" : "a "));
    }
コード例 #2
0
    public static User UserGenerator(Random random)
    {
        Gender gender = random.Next(2) == 0 ? Gender.Male : Gender.Female;

        return(new User((gender == Gender.Female ? femaleFirstNameSelector.GetRandomItem() : maleFirstNameSelector.GetRandomItem()),
                        lastNameSelector.GetRandomItem(),
                        gender,
                        random.Next(MAX_START_CONVERSION_CHANCE - MIN_START_CONVERSION_CHANCE) + MIN_START_CONVERSION_CHANCE,
                        random.NextDouble() * 10f));
    }
コード例 #3
0
 public static string GenerateComplimentResponse(Random random, int cultChance)
 {
     if (cultChance < 40)
     {
         return(complimentResponseLowSelector.GetRandomItem());
     }
     else if (cultChance < 80)
     {
         return(complimentResponseMidSelector.GetRandomItem());
     }
     else
     {
         return(complimentResponseHighSelector.GetRandomItem());
     }
 }
コード例 #4
0
 public static string GenerateJoinCultResponse(Random random, bool success)
 {
     return(success ? cultJoinResponseAcceptSelector.GetRandomItem() : cultJoinResponseRejectSelector.GetRandomItem());
 }
コード例 #5
0
    public static string GenerateAbort(Random random)
    {
        string bodyPart = bodyPartSelector.GetRandomItem();

        return(abortSelector.GetRandomItem().Replace("{BODY_PART}", bodyPart));
    }