class RPG::Item

Public Class Methods

new(hash) click to toggle source
# File lib/rmxp_extractor/classnames.rb, line 896
def initialize(hash)
  hash.each do |key, value|
    if value.is_a?(Hash)
      eval("@#{key.to_s}=RPG::AudioFile.new(value)") #! We know there is only one hash in here so this is fine
    else
      eval("@#{key.to_s}=value")
    end
  end
end

Public Instance Methods

hash() click to toggle source
# File lib/rmxp_extractor/classnames.rb, line 906
def hash
  dump = {
    id: @id,
    name: @name.force_encoding("iso-8859-1").encode("utf-8"),
    icon_name: @icon_name,
    description: @description.force_encoding("iso-8859-1").encode("utf-8"),
    scope: @scope,
    occasion: @occasion,
    animation1_id: @animation1_id,
    animation2_id: @animation2_id,
    menu_se: @menu_se.hash,
    common_event_id: @common_event_id,
    price: @price,
    consumable: @consumable,
    parameter_type: @parameter_type,
    parameter_points: @parameter_points,
    recover_hp_rate: @recover_hp_rate,
    recover_hp: @recover_hp,
    hit: @hit,
    pdef_f: @pdef_f,
    mdef_f: @mdef_f,
    variance: @variance,
    element_set: @element_set,
    plus_state_set: @plus_state_set,
    minus_state_set: @minus_state_set,
  }
end