Sha256: 66dc574c62e6c49421c1a13fa3448be9fcacc9d6cb0926dcf9b1fb47866483b1

Contents?: true

Size: 1.07 KB

Versions: 1

Compression:

Stored size: 1.07 KB

Contents

script 'standard/entities/portal'

class Door < Portal
  include Openable
  include Lockable
  
  def post_initialize
    super
    if @name.nil? and !@direction.nil?
      proper_named = false
      rev = @direction.reverse
      self.name = "the #{@direction.adjective} door"
    end
  end
  def open=(bool)
    super
    rev = find_reverse
    if !rev.nil? and rev.open? != bool
      rev.open = bool
    end
  end
  def locked=(bool)
    super
    rev = find_reverse
    if !rev.nil? and rev.locked? != bool
      rev.locked = bool
    end
  end
  def automatic=(bool)
    @automatic = bool
    rev = find_reverse
    if !rev.nil? and rev.automatic? != bool
      rev.automatic = bool
    end
  end
  # HACK Even though Door includes Lockable, we need
  # to add the lock_key definitions here for Opal.
  def lock_key
    @lock_key
  end
  def lock_key=(entity)
    @lock_key = entity
    rev = find_reverse
    if !rev.nil? and rev.lock_key != entity
      rev.lock_key = entity
    end
  end
  def automatic?
    @automatic ||= true
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gamefic-sdk-1.6.0 scripts/standard/entities/door.plot.rb