Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

file 52 lines (28 sloc) 0.936 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
---
syntax:
- "put <prop:this> <relation> <prop:that>"

logic: |

  output = ''

  this_prop = arg['this']
  that_prop = arg['that']

  if arg['relation'] == 'on'

    if that_prop.traits['supports']

      if !that_prop.traits['only_supports'] or that_prop.traits['only_supports'].index(this_prop.id)

        if !that_prop.traits['supporting'] or !that_prop.traits['supporting'].index(this_prop.id)

          that_prop.traits['supporting'] ||= []

          that_prop.traits['supporting'] << this_prop.id

          this_prop.location = @player.location

          output << "You put #{this_prop.noun} on #{that_prop.noun}.\n"

        else

          output << "It's already on there.\n"

        end

      else

        output << "You can't put #{this_prop.noun} on #{that_prop.noun}.\n"

      end

    else

      output << "You can't do that.\n"

    end

  else

    output << "I'm not sure what you mean.\n"

  end

  output
Something went wrong with that request. Please try again.