Sha256: 80760835c98aa2d9635fd88728a667179eaa6e02c5a0a24c4487d24109ff0a82

Contents?: true

Size: 966 Bytes

Versions: 3

Compression:

Stored size: 966 Bytes

Contents

Gamefic.script do
  respond :talk do |actor|
    actor.tell "You talk to yourself."
  end

  respond :talk, Use.itself do |actor, yourself|
    actor.perform :talk
  end

  respond :talk, Use.available do |actor, thing|
    actor.tell "Nothing happens."
  end

  respond :talk, Use.available(Character) do |actor, character|
    if actor == character
      actor.perform :talk
    else
      actor.tell "#{The character} has nothing to say."
    end
  end

  interpret "talk to :character", "talk :character"
  interpret "talk to :character about :subject", "talk :character :subject"
  interpret "ask :character :subject", "talk :character :subject"
  interpret "ask :character about :subject", "talk :character :subject"
  interpret "tell :character :subject", "talk :character :subject"
  interpret "tell :character about :subject", "talk :character :subject"
  interpret "ask :character for :subject", "talk :character :subject"
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
gamefic-standard-2.2.0 lib/gamefic-standard/actions/talk.rb
gamefic-standard-2.1.0 lib/gamefic-standard/actions/talk.rb
gamefic-standard-2.0.0 lib/gamefic-standard/actions/talk.rb