Exemple #1
0
        /// <summary>
        /// Try to add a modifier to a lexica
        /// </summary>
        /// <param name="modifier">the lexica that is the modifier</param>
        /// <returns>Whether or not it succeeded</returns>
        public ILexica TryModify(LexicalType type, GrammaticalType role, string phrase, bool passthru = false)
        {
            ILexica modifier = new Lexica(type, role, phrase, Context);

            modifier = TryModify(modifier);

            return(passthru ? this : modifier);
        }
Exemple #2
0
        private ILexica RunObscura(MessagingType sensoryType, IEntity observer, bool over)
        {
            ILexica message = null;

            LexicalContext context = new LexicalContext(observer)
            {
                Determinant = true,
                Perspective = NarrativePerspective.FirstPerson,
                Position    = LexicalPosition.Around
            };

            switch (sensoryType)
            {
            case MessagingType.Audible:
                if (!over)
                {
                    message = new Lexica(LexicalType.Verb, GrammaticalType.Verb, "hear", observer, observer)
                              .TryModify(new Lexica(LexicalType.Noun, GrammaticalType.Subject, "sounds", context))
                              .TryModify(new Lexica(LexicalType.Adjective, GrammaticalType.Descriptive, "soft", context));
                }
                else
                {
                    message = new Lexica(LexicalType.Verb, GrammaticalType.Verb, "hear", observer, observer)
                              .TryModify(new Lexica(LexicalType.Noun, GrammaticalType.Subject, "sounds", context))
                              .TryModify(new Lexica(LexicalType.Adjective, GrammaticalType.Descriptive, "loud", context));
                }
                break;

            case MessagingType.Olefactory:
                if (!over)
                {
                    message = new Lexica(LexicalType.Verb, GrammaticalType.Verb, "smell", observer, observer)
                              .TryModify(new Lexica(LexicalType.Noun, GrammaticalType.Subject, "something", context))
                              .TryModify(new Lexica(LexicalType.Adjective, GrammaticalType.Descriptive, "subtle", context));
                }
                else
                {
                    message = new Lexica(LexicalType.Verb, GrammaticalType.Verb, "smell", observer, observer)
                              .TryModify(new Lexica(LexicalType.Noun, GrammaticalType.Subject, "something", context))
                              .TryModify(new Lexica(LexicalType.Adjective, GrammaticalType.Descriptive, "pungent", context));
                }
                break;

            case MessagingType.Psychic:
                if (!over)
                {
                    message = new Lexica(LexicalType.Verb, GrammaticalType.Verb, "sense", observer, observer)
                              .TryModify(new Lexica(LexicalType.Noun, GrammaticalType.Subject, "presence", context))
                              .TryModify(new Lexica(LexicalType.Adjective, GrammaticalType.Descriptive, "vague", context));
                }
                else
                {
                    message = new Lexica(LexicalType.Verb, GrammaticalType.Verb, "sense", observer, observer)
                              .TryModify(new Lexica(LexicalType.Noun, GrammaticalType.Subject, "presence", context))
                              .TryModify(new Lexica(LexicalType.Adjective, GrammaticalType.Descriptive, "disturbing", context));
                }
                break;

            case MessagingType.Tactile:
                context.Position = LexicalPosition.Attached;
                if (!over)
                {
                    message = new Lexica(LexicalType.Verb, GrammaticalType.Verb, "brushes", observer, observer)
                              .TryModify(new Lexica(LexicalType.Noun, GrammaticalType.Subject, "skin", context))
                              .TryModify(new Lexica(LexicalType.Adjective, GrammaticalType.Descriptive, "lightly", context));
                }
                else
                {
                    context.Elegance = -5;
                    message          = new Lexica(LexicalType.Verb, GrammaticalType.Verb, "rubs", observer, observer)
                                       .TryModify(new Lexica(LexicalType.Pronoun, GrammaticalType.Subject, "you", context));
                }
                break;

            case MessagingType.Taste:
                context.Position = LexicalPosition.InsideOf;

                if (!over)
                {
                    message = new Lexica(LexicalType.Verb, GrammaticalType.Verb, "taste", observer, observer)
                              .TryModify(new Lexica(LexicalType.Noun, GrammaticalType.Subject, "something", context))
                              .TryModify(new Lexica(LexicalType.Adjective, GrammaticalType.Descriptive, "subtle", context));
                }
                else
                {
                    context.Elegance = -5;
                    message          = new Lexica(LexicalType.Verb, GrammaticalType.Verb, "taste", observer, observer)
                                       .TryModify(new Lexica(LexicalType.Noun, GrammaticalType.Subject, "something", context))
                                       .TryModify(new Lexica(LexicalType.Adjective, GrammaticalType.Descriptive, "offensive", context));
                }
                break;

            case MessagingType.Visible:
                context.Plural = true;

                if (!over)
                {
                    message = new Lexica(LexicalType.Verb, GrammaticalType.Verb, "see", observer, observer)
                              .TryModify(new Lexica(LexicalType.Noun, GrammaticalType.Subject, "shadows", context));
                }
                else
                {
                    message = new Lexica(LexicalType.Verb, GrammaticalType.Verb, "see", observer, observer)
                              .TryModify(new Lexica(LexicalType.Noun, GrammaticalType.Subject, "lights", context))
                              .TryModify(new Lexica(LexicalType.Adjective, GrammaticalType.Descriptive, "blinding", context));
                }
                break;
            }

            return(message);
        }