RPG::Item

The data class for items.

Superclass

Attributes

itype_id

The item type ID.

price

The item's price.

consumable

The truth value indicating whether the item disappears when used.

Method

key_item?

Determines whether the item type is [Key Item]. Returns true if the value of itype_id is 2.

Definition

class RPG::Item < RPG::UsableItem
  def initialize
    super
    @scope = 7
    @itype_id = 1
    @price = 0
    @consumable = true
  end
  def key_item?
    @itype_id == 2
  end
  attr_accessor :itype_id
  attr_accessor :price
  attr_accessor :consumable
end