def i_dictionary_switch_on(id)
$game_system.i_dic_sw = [] if $game_system.i_dic_sw == nil
$game_system.i_dic_sw[id] = false if $game_system.i_dic_sw[id] == nil
$game_system.i_dic_sw[id] = true
end
def i_dictionary_switch_off(id)
$game_system.i_dic_sw = [] if $game_system.i_dic_sw == nil
$game_system.i_dic_sw[id] = false if $game_system.i_dic_sw[id] == nil
$game_system.i_dic_sw[id] = false
end
def i_dictionary_switch_on?(id)
$game_system.i_dic_sw = [] if $game_system.i_dic_sw == nil
$game_system.i_dic_sw[id] = false if $game_system.i_dic_sw[id] == nil
return $game_system.i_dic_sw[id]
end
def w_dictionary_switch_on(id)
$game_system.w_dic_sw = [] if $game_system.w_dic_sw == nil
$game_system.w_dic_sw[id] = false if $game_system.w_dic_sw[id] == nil
$game_system.w_dic_sw[id] = true
end
def w_dictionary_switch_off(id)
$game_system.w_dic_sw = [] if $game_system.w_dic_sw == nil
$game_system.w_dic_sw[id] = false if $game_system.w_dic_sw[id] == nil
$game_system.w_dic_sw[id] = false
end
def w_dictionary_switch_on?(id)
$game_system.w_dic_sw = [] if $game_system.w_dic_sw == nil
$game_system.w_dic_sw[id] = false if $game_system.w_dic_sw[id] == nil
return $game_system.w_dic_sw[id]
end
def a_dictionary_switch_on(id)
$game_system.a_dic_sw = [] if $game_system.a_dic_sw == nil
$game_system.a_dic_sw[id] = false if $game_system.a_dic_sw[id] == nil
$game_system.a_dic_sw[id] = true
end
def a_dictionary_switch_off(id)
$game_system.a_dic_sw = [] if $game_system.a_dic_sw == nil
$game_system.a_dic_sw[id] = false if $game_system.a_dic_sw[id] == nil
$game_system.a_dic_sw[id] = false
end
def a_dictionary_switch_on?(id)
$game_system.a_dic_sw = [] if $game_system.a_dic_sw == nil
$game_system.a_dic_sw[id] = false if $game_system.a_dic_sw[id] == nil
return $game_system.a_dic_sw[id]
end
def t_dictionary_switch_on(item)
if item.is_a?(RPG::Item)
i_dictionary_switch_on(item.id)
end
if item.is_a?(RPG::Weapon)
w_dictionary_switch_on(item.id)
end
if item.is_a?(RPG::Armor)
a_dictionary_switch_on(item.id)
end
end
def t_dictionary_switch_on?(item)
if item.is_a?(RPG::Item)
return i_dictionary_switch_on?(item.id)
end
if item.is_a?(RPG::Weapon)
return w_dictionary_switch_on?(item.id)
end
if item.is_a?(RPG::Armor)
return a_dictionary_switch_on?(item.id)
end
end
def print_dictionary?(item)
if item != nil
if item.name.size > 0
hantei = /<图鉴无效>/ =~ item.note
if hantei == nil
return true
end
end
end
return false
end
def item_dictionary_perfection
dic_max = 0
dic_num = 0
$data_items.each do |item|
if print_dictionary?(item)
dic_max += 1
if i_dictionary_switch_on?(item.id) == true
dic_num += 1
end
end
end
$data_weapons.each do |item|
if print_dictionary?(item)
dic_max += 1
if w_dictionary_switch_on?(item.id) == true
dic_num += 1
end
end
end
$data_armors.each do |item|
if print_dictionary?(item)
dic_max += 1
if a_dictionary_switch_on?(item.id) == true
dic_num += 1
end
end
end
return (100*dic_num)/dic_max
end
end
class Game_Interpreter
include WD_itemdictionary
end
class Game_System
#--------------------------------------------------------------------------
# ● 公開インスタンス変数
#--------------------------------------------------------------------------
attr_accessor :i_dic_sw
attr_accessor :w_dic_sw
attr_accessor :a_dic_sw
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
alias wd_orig_initialize001 initialize
def initialize
wd_orig_initialize001
@i_dic_sw = []
@w_dic_sw = []
@a_dic_sw = []
end
end
class Game_Party < Game_Unit
include WD_itemdictionary
#--------------------------------------------------------------------------
# ● アイテムの増加(減少)
# include_equip : 装備品も含める
#--------------------------------------------------------------------------
alias wd_orig_gain_item001 gain_item
def gain_item(item, amount, include_equip = false)
wd_orig_gain_item001(item, amount, include_equip = false)
if amount > 0
t_dictionary_switch_on(item)
end
end
end
class Window_ItemDictionaryStatus < Window_Selectable
include WD_itemdictionary
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize(x, y, width, height)
super
@item = nil
refresh
end
#--------------------------------------------------------------------------
# ● アイテムの設定
#--------------------------------------------------------------------------
def set_item(item, index=-1, print=false)
return if ((@item == item) and (@index == index))
@item = item
@index = index
@print = print
refresh
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
contents.clear
contents.font.size = 24
if @print
if @item.is_a?(RPG::Item)
if WD_itemdictionary_layout::I_id_display
text1 = sprintf("%0#{WD_itemdictionary_layout::I_id_display_digit}d",@index+1)
x = WD_itemdictionary_layout::I_id_display_x
y = WD_itemdictionary_layout::I_id_display_y
width = WD_itemdictionary_layout::I_id_display_width
height = line_height
draw_text(x, y, width, height, text1, 0)
end
if WD_itemdictionary_layout::I_name_display
x = WD_itemdictionary_layout::I_name_display_x
y = WD_itemdictionary_layout::I_name_display_y
draw_item_name(@item, x, y, true)
end
font_size = WD_itemdictionary_layout::C_font_size
contents.font.size = font_size
if WD_itemdictionary_layout::I_price_display
text1 = WD_itemdictionary_layout::I_price_display_text1
text2 = @item.price
text3 = Vocab::currency_unit
x = WD_itemdictionary_layout::I_price_display_x
y = WD_itemdictionary_layout::I_price_display_y
width = WD_itemdictionary_layout::I_price_display_width
change_color(system_color)
draw_text(x, y, width, font_size, text1, 0)
cx = text_size(Vocab::currency_unit).width
change_color(normal_color)
draw_text(x, y, width - cx - 2, font_size, text2, 2)
change_color(system_color)
draw_text(x, y, width, font_size, text3, 2)
change_color(normal_color)
end
if WD_itemdictionary_layout::I_occasion_display
text1 = WD_itemdictionary_layout::I_occasion_display_text1
text2 = WD_itemdictionary_layout::I_occasion_display_text2
text3 = WD_itemdictionary_layout::I_occasion_display_text3
text4 = WD_itemdictionary_layout::I_occasion_display_text4
text5 = WD_itemdictionary_layout::I_occasion_display_text5
x = WD_itemdictionary_layout::I_occasion_display_x
y = WD_itemdictionary_layout::I_occasion_display_y
width = WD_itemdictionary_layout::I_occasion_display_width
change_color(system_color)
draw_text(x, y, width, font_size, text1, 0)
change_color(normal_color)
case @item.occasion
when 0
draw_text(x, y, width, font_size, text2, 2)
when 1
draw_text(x, y, width, font_size, text3, 2)
when 2
draw_text(x, y, width, font_size, text4, 2)
when 3
draw_text(x, y, width, font_size, text5, 2)
end
end
if WD_itemdictionary_layout::I_consumable_display
text1 = WD_itemdictionary_layout::I_consumable_display_text1
text2 = WD_itemdictionary_layout::I_consumable_display_text2
text3 = WD_itemdictionary_layout::I_consumable_display_text3
x = WD_itemdictionary_layout::I_consumable_display_x
y = WD_itemdictionary_layout::I_consumable_display_y
width = WD_itemdictionary_layout::I_consumable_display_width
change_color(system_color)
draw_text(x, y, width, font_size, text1, 0)
change_color(normal_color)
if @item.consumable
draw_text(x, y, width, font_size, text2, 2)
else
draw_text(x, y, width, font_size, text3, 2)
end
end
if WD_itemdictionary_layout::I_option_display
text1 = WD_itemdictionary_layout::I_option_display_text1
text2 = WD_itemdictionary_layout::I_option_display_text2
x = WD_itemdictionary_layout::I_option_display_x
y = WD_itemdictionary_layout::I_option_display_y
width = WD_itemdictionary_layout::I_option_display_width
change_color(system_color)
draw_text(x, y, width, font_size, text1, 0)
change_color(normal_color)
i = 0
@item.note.scan(/<图鉴功能:(.*)>/){|matched|
i += 1
self.contents.draw_text(x + font_size, y + font_size * i, width - font_size, font_size, matched[0], 0)
}
if i == 0
self.contents.draw_text(x + font_size, y + font_size, width - font_size, font_size, text2, 0)
end
end
elsif @item.is_a?(RPG::Weapon)
if WD_itemdictionary_layout::W_id_display
text1 = sprintf("%0#{WD_itemdictionary_layout::W_id_display_digit}d",@index+1)
x = WD_itemdictionary_layout::W_id_display_x
y = WD_itemdictionary_layout::W_id_display_y
width = WD_itemdictionary_layout::W_id_display_width
height = line_height
draw_text(x, y, width, height, text1, 0)
end
if WD_itemdictionary_layout::W_name_display
x = WD_itemdictionary_layout::W_name_display_x
y = WD_itemdictionary_layout::W_name_display_y
draw_item_name(@item, x, y, true)
end
font_size = WD_itemdictionary_layout::C_font_size
contents.font.size = font_size
if WD_itemdictionary_layout::W_type_display
text1 = WD_itemdictionary_layout::W_type_display_text1
text2 = $data_system.weapon_types[@item.wtype_id]
x = WD_itemdictionary_layout::W_type_display_x
y = WD_itemdictionary_layout::W_type_display_y
width = WD_itemdictionary_layout::W_type_display_width
change_color(system_color)
draw_text(x, y, width, font_size, text1, 0)
change_color(normal_color)
draw_text(x, y, width, font_size, text2, 2)
end
if WD_itemdictionary_layout::W_price_display
text1 = WD_itemdictionary_layout::W_price_display_text1
text2 = @item.price
text3 = Vocab::currency_unit
x = WD_itemdictionary_layout::W_price_display_x
y = WD_itemdictionary_layout::W_price_display_y
width = WD_itemdictionary_layout::W_price_display_width
change_color(system_color)
draw_text(x, y, width, font_size, text1, 0)
cx = text_size(Vocab::currency_unit).width
change_color(normal_color)
draw_text(x, y, width - cx - 2, font_size, text2, 2)
change_color(system_color)
draw_text(x, y, width, font_size, text3, 2)
change_color(normal_color)
end
if WD_itemdictionary_layout::W_atk_display
text1 = Vocab::param(2)
text2 = @item.params[2]
x = WD_itemdictionary_layout::W_atk_display_x
y = WD_itemdictionary_layout::W_atk_display_y
width = WD_itemdictionary_layout::W_atk_display_width
change_color(system_color)
draw_text(x, y, width, font_size, text1, 0)
change_color(normal_color)
draw_text(x, y, width, font_size, text2, 2)
end
if WD_itemdictionary_layout::W_def_display
text1 = Vocab::param(3)
text2 = @item.params[3]
x = WD_itemdictionary_layout::W_def_display_x
y = WD_itemdictionary_layout::W_def_display_y
width = WD_itemdictionary_layout::W_def_display_width
change_color(system_color)
draw_text(x, y, width, font_size, text1, 0)
change_color(normal_color)
draw_text(x, y, width, font_size, text2, 2)
end
if WD_itemdictionary_layout::W_mat_display
text1 = Vocab::param(4)
text2 = @item.params[4]
x = WD_itemdictionary_layout::W_mat_display_x
y = WD_itemdictionary_layout::W_mat_display_y
width = WD_itemdictionary_layout::W_mat_display_width
change_color(system_color)
draw_text(x, y, width, font_size, text1, 0)
change_color(normal_color)
draw_text(x, y, width, font_size, text2, 2)
end
if WD_itemdictionary_layout::W_mdf_display
text1 = Vocab::param(5)
text2 = @item.params[5]
x = WD_itemdictionary_layout::W_mdf_display_x
y = WD_itemdictionary_layout::W_mdf_display_y
width = WD_itemdictionary_layout::W_mdf_display_width
change_color(system_color)
draw_text(x, y, width, font_size, text1, 0)
change_color(normal_color)
draw_text(x, y, width, font_size, text2, 2)
end
if WD_itemdictionary_layout::W_agi_display
text1 = Vocab::param(6)
text2 = @item.params[6]
x = WD_itemdictionary_layout::W_agi_display_x
y = WD_itemdictionary_layout::W_agi_display_y
width = WD_itemdictionary_layout::W_agi_display_width
change_color(system_color)
draw_text(x, y, width, font_size, text1, 0)
change_color(normal_color)
draw_text(x, y, width, font_size, text2, 2)
end
if WD_itemdictionary_layout::W_luk_display
text1 = Vocab::param(7)
text2 = @item.params[7]
x = WD_itemdictionary_layout::W_luk_display_x
y = WD_itemdictionary_layout::W_luk_display_y
width = WD_itemdictionary_layout::W_luk_display_width
change_color(system_color)
draw_text(x, y, width, font_size, text1, 0)
change_color(normal_color)
draw_text(x, y, width, font_size, text2, 2)
end
if WD_itemdictionary_layout::W_mhp_display
text1 = Vocab::param(0)
text2 = @item.params[0]
x = WD_itemdictionary_layout::W_mhp_display_x
y = WD_itemdictionary_layout::W_mhp_display_y
width = WD_itemdictionary_layout::W_mhp_display_width
change_color(system_color)
draw_text(x, y, width, font_size, text1, 0)
change_color(normal_color)
draw_text(x, y, width, font_size, text2, 2)
end
if WD_itemdictionary_layout::W_mmp_display
text1 = Vocab::param(1)
text2 = @item.params[1]
x = WD_itemdictionary_layout::W_mmp_display_x
y = WD_itemdictionary_layout::W_mmp_display_y
width = WD_itemdictionary_layout::W_mmp_display_width
change_color(system_color)
draw_text(x, y, width, font_size, text1, 0)
change_color(normal_color)
draw_text(x, y, width, font_size, text2, 2)
end
if WD_itemdictionary_layout::W_option_display
text1 = WD_itemdictionary_layout::W_option_display_text1
text2 = WD_itemdictionary_layout::W_option_display_text2
x = WD_itemdictionary_layout::W_option_display_x
y = WD_itemdictionary_layout::W_option_display_y
width = WD_itemdictionary_layout::W_option_display_width
change_color(system_color)
draw_text(x, y, width, font_size, text1, 0)
change_color(normal_color)
i = 0
@item.note.scan(/<图鉴功能:(.*)>/){|matched|
i += 1
self.contents.draw_text(x + font_size, y + font_size * i, width - font_size, font_size, matched[0], 0)
}
if i == 0
self.contents.draw_text(x + font_size, y + font_size, width - font_size, font_size, text2, 0)
end
end
elsif @item.is_a?(RPG::Armor)
if WD_itemdictionary_layout::A_id_display
text1 = sprintf("%0#{WD_itemdictionary_layout::A_id_display_digit}d",@index+1)
x = WD_itemdictionary_layout::A_id_display_x
y = WD_itemdictionary_layout::A_id_display_y
width = WD_itemdictionary_layout::A_id_display_width
height = line_height
draw_text(x, y, width, height, text1, 0)
end
if WD_itemdictionary_layout::A_name_display
x = WD_itemdictionary_layout::A_name_display_x
y = WD_itemdictionary_layout::A_name_display_y
draw_item_name(@item, x, y, true)
end
font_size = WD_itemdictionary_layout::C_font_size
contents.font.size = font_size
if WD_itemdictionary_layout::A_type_display
text1 = WD_itemdictionary_layout::A_type_display_text1
text2 = $data_system.armor_types[@item.atype_id]
x = WD_itemdictionary_layout::A_type_display_x
y = WD_itemdictionary_layout::A_type_display_y
width = WD_itemdictionary_layout::A_type_display_width
change_color(system_color)
draw_text(x, y, width, font_size, text1, 0)
change_color(normal_color)
draw_text(x, y, width, font_size, text2, 2)
end
if WD_itemdictionary_layout::A_price_display
text1 = WD_itemdictionary_layout::A_price_display_text1
text2 = @item.price
text3 = Vocab::currency_unit
x = WD_itemdictionary_layout::A_price_display_x
y = WD_itemdictionary_layout::A_price_display_y
width = WD_itemdictionary_layout::A_price_display_width
change_color(system_color)
draw_text(x, y, width, font_size, text1, 0)
cx = text_size(Vocab::currency_unit).width
change_color(normal_color)
draw_text(x, y, width - cx - 2, font_size, text2, 2)
change_color(system_color)
draw_text(x, y, width, font_size, text3, 2)
change_color(normal_color)
end
if WD_itemdictionary_layout::A_atk_display
text1 = Vocab::param(2)
text2 = @item.params[2]
x = WD_itemdictionary_layout::A_atk_display_x
y = WD_itemdictionary_layout::A_atk_display_y
width = WD_itemdictionary_layout::A_atk_display_width
change_color(system_color)
draw_text(x, y, width, font_size, text1, 0)
change_color(normal_color)
draw_text(x, y, width, font_size, text2, 2)
end
if WD_itemdictionary_layout::A_def_display
text1 = Vocab::param(3)
text2 = @item.params[3]
x = WD_itemdictionary_layout::A_def_display_x
y = WD_itemdictionary_layout::A_def_display_y
width = WD_itemdictionary_layout::A_def_display_width
change_color(system_color)
draw_text(x, y, width, font_size, text1, 0)
change_color(normal_color)
draw_text(x, y, width, font_size, text2, 2)
end
if WD_itemdictionary_layout::A_mat_display
text1 = Vocab::param(4)
text2 = @item.params[4]
x = WD_itemdictionary_layout::A_mat_display_x
y = WD_itemdictionary_layout::A_mat_display_y
width = WD_itemdictionary_layout::A_mat_display_width
change_color(system_color)
draw_text(x, y, width, font_size, text1, 0)
change_color(normal_color)
draw_text(x, y, width, font_size, text2, 2)
end
if WD_itemdictionary_layout::A_mdf_display
text1 = Vocab::param(5)
text2 = @item.params[5]
x = WD_itemdictionary_layout::A_mdf_display_x
y = WD_itemdictionary_layout::A_mdf_display_y
width = WD_itemdictionary_layout::A_mdf_display_width
change_color(system_color)
draw_text(x, y, width, font_size, text1, 0)
change_color(normal_color)
draw_text(x, y, width, font_size, text2, 2)
end
if WD_itemdictionary_layout::A_agi_display
text1 = Vocab::param(6)
text2 = @item.params[6]
x = WD_itemdictionary_layout::A_agi_display_x
y = WD_itemdictionary_layout::A_agi_display_y
width = WD_itemdictionary_layout::A_agi_display_width
change_color(system_color)
draw_text(x, y, width, font_size, text1, 0)
change_color(normal_color)
draw_text(x, y, width, font_size, text2, 2)
end
if WD_itemdictionary_layout::A_luk_display
text1 = Vocab::param(7)
text2 = @item.params[7]
x = WD_itemdictionary_layout::A_luk_display_x
y = WD_itemdictionary_layout::A_luk_display_y
width = WD_itemdictionary_layout::A_luk_display_width
change_color(system_color)
draw_text(x, y, width, font_size, text1, 0)
change_color(normal_color)
draw_text(x, y, width, font_size, text2, 2)
end
if WD_itemdictionary_layout::A_mhp_display
text1 = Vocab::param(0)
text2 = @item.params[0]
x = WD_itemdictionary_layout::A_mhp_display_x
y = WD_itemdictionary_layout::A_mhp_display_y
width = WD_itemdictionary_layout::A_mhp_display_width
change_color(system_color)
draw_text(x, y, width, font_size, text1, 0)
change_color(normal_color)
draw_text(x, y, width, font_size, text2, 2)
end
if WD_itemdictionary_layout::A_mmp_display
text1 = Vocab::param(1)
text2 = @item.params[1]
x = WD_itemdictionary_layout::A_mmp_display_x
y = WD_itemdictionary_layout::A_mmp_display_y
width = WD_itemdictionary_layout::A_mmp_display_width
change_color(system_color)
draw_text(x, y, width, font_size, text1, 0)
change_color(normal_color)
draw_text(x, y, width, font_size, text2, 2)
end
if WD_itemdictionary_layout::A_option_display
text1 = WD_itemdictionary_layout::A_option_display_text1
text2 = WD_itemdictionary_layout::A_option_display_text2
x = WD_itemdictionary_layout::A_option_display_x
y = WD_itemdictionary_layout::A_option_display_y
width = WD_itemdictionary_layout::A_option_display_width
change_color(system_color)
draw_text(x, y, width, font_size, text1, 0)
change_color(normal_color)
i = 0
@item.note.scan(/<图鉴功能:(.*)>/){|matched|
i += 1
self.contents.draw_text(x + font_size, y + font_size * i, width - font_size, font_size, matched[0], 0)
}
if i == 0
self.contents.draw_text(x + font_size, y + font_size, width - font_size, font_size, text2, 0)
end
end
end
elsif @item != nil
if @item.is_a?(RPG::Item)
if WD_itemdictionary_layout::I_id_display
text1 = sprintf("%0#{WD_itemdictionary_layout::I_id_display_digit}d",@index+1)
x = WD_itemdictionary_layout::I_id_display_x
y = WD_itemdictionary_layout::I_id_display_y
width = WD_itemdictionary_layout::I_id_display_width
height = line_height
draw_text(x, y, width, height, text1, 0)
end
if WD_itemdictionary_layout::I_name_display
text1 = "- No Data -"
x = WD_itemdictionary_layout::I_name_display_x
y = WD_itemdictionary_layout::I_name_display_y
width = WD_itemdictionary_layout::I_name_display_width
height = line_height
draw_text(x, y, width, height, text1, 0)
end
end
if @item.is_a?(RPG::Weapon)
if WD_itemdictionary_layout::W_id_display
text1 = sprintf("%0#{WD_itemdictionary_layout::W_id_display_digit}d",@index+1)
x = WD_itemdictionary_layout::W_id_display_x
y = WD_itemdictionary_layout::W_id_display_y
width = WD_itemdictionary_layout::W_id_display_width
height = line_height
draw_text(x, y, width, height, text1, 0)
end
if WD_itemdictionary_layout::W_name_display
text1 = "- No Data -"
x = WD_itemdictionary_layout::W_name_display_x
y = WD_itemdictionary_layout::W_name_display_y
width = WD_itemdictionary_layout::W_name_display_width
height = line_height
draw_text(x, y, width, height, text1, 0)
end
end
if @item.is_a?(RPG::Armor)
if WD_itemdictionary_layout::A_id_display
text1 = sprintf("%0#{WD_itemdictionary_layout::A_id_display_digit}d",@index+1)
x = WD_itemdictionary_layout::A_id_display_x
y = WD_itemdictionary_layout::A_id_display_y
width = WD_itemdictionary_layout::A_id_display_width
height = line_height
draw_text(x, y, width, height, text1, 0)
end
if WD_itemdictionary_layout::A_name_display
text1 = "- No Data -"
x = WD_itemdictionary_layout::A_name_display_x
y = WD_itemdictionary_layout::A_name_display_y
width = WD_itemdictionary_layout::A_name_display_width
height = line_height
draw_text(x, y, width, height, text1, 0)
end
end