Sha256: cb59472d172eb8498ce2c25b3bdd9cdc8a4c1e6a4b287d605c874892b87c9ad4

Contents?: true

Size: 1.04 KB

Versions: 1

Compression:

Stored size: 1.04 KB

Contents

meta nil, Query::Text.new() do |actor, string|
  words = string.split_words
  list = verbs
  if list.include?(words[0])
    if words.length > 1
      actor.tell "I recognize '#{words[0]}' as a verb but could not understand the rest of your sentence."
    else
      actor.tell "I recognize '#{words[0]}' as a verb but could not understand it in this context."
    end
  else
    found = []
    list.each { |c|
      next if c.include?('_')
      if c.length > words[0].length and c.start_with?(words[0])
        found.push c
      end
    }
    if found.length == 1
      words[0] = found[0]
      actor.perform words.join(' ')
    elsif found.length > 1 and words[0].length > 2
      actor.tell "I'm not sure if #{words[0]} means #{found.join_and(', ', ' or ')}."
    else
      actor.tell "I don't recognize '#{words[0]}' as a verb."
    end
  end
end

meta nil, Query::Text.new(/^it$/) do |actor, string|
  words = string.split_words
  if verbs(to_s: true).include?(words[0])
    actor.tell "I'm not sure what you mean by \"it.\""
  else
    actor.proceed
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gamefic-sdk-1.7.0 scripts/standard/actions/nil.plot.rb