#============================================================================== # ■ 魔物図鑑 ver 1.04 本体プログラム #------------------------------------------------------------------------------ #  配布元: # 白の魔 http://izumiwhite.web.fc2.com/ # #  利用規約: # RPGツクールVXの正規の登録者のみご利用になれます。 # 利用報告・著作権表示とかは必要ありません。 # 改造もご自由にどうぞ。 # 何か問題が発生しても責任は持ちません。 #============================================================================== module WD_monsterdictionary def m_dictionary_encount_switch_on(id) $game_system.m_dic_encount_sw = [] if $game_system.m_dic_encount_sw == nil $game_system.m_dic_encount_sw[id] = false if $game_system.m_dic_encount_sw[id] == nil $game_system.m_dic_encount_sw[id] = true end def m_dictionary_encount_switch_off(id) $game_system.m_dic_encount_sw = [] if $game_system.m_dic_encount_sw == nil $game_system.m_dic_encount_sw[id] = false if $game_system.m_dic_encount_sw[id] == nil $game_system.m_dic_encount_sw[id] = false end def m_dictionary_victory_switch_on(id) $game_system.m_dic_victory_sw = [] if $game_system.m_dic_victory_sw == nil $game_system.m_dic_victory_sw[id] = false if $game_system.m_dic_victory_sw[id] == nil $game_system.m_dic_victory_sw[id] = true end def m_dictionary_victory_switch_off(id) $game_system.m_dic_victory_sw = [] if $game_system.m_dic_victory_sw == nil $game_system.m_dic_victory_sw[id] = false if $game_system.m_dic_victory_sw[id] == nil $game_system.m_dic_victory_sw[id] = false end def m_dictionary_drop1_switch_on(id) $game_system.m_dic_drop1_sw = [] if $game_system.m_dic_drop1_sw == nil $game_system.m_dic_drop1_sw[id] = false if $game_system.m_dic_drop1_sw[id] == nil $game_system.m_dic_drop1_sw[id] = true end def m_dictionary_drop1_switch_off(id) $game_system.m_dic_drop1_sw = [] if $game_system.m_dic_drop1_sw == nil $game_system.m_dic_drop1_sw[id] = false if $game_system.m_dic_drop1_sw[id] == nil $game_system.m_dic_drop1_sw[id] = false end def m_dictionary_drop2_switch_on(id) $game_system.m_dic_drop2_sw = [] if $game_system.m_dic_drop2_sw == nil $game_system.m_dic_drop2_sw[id] = false if $game_system.m_dic_drop2_sw[id] == nil $game_system.m_dic_drop2_sw[id] = true end def m_dictionary_drop2_switch_off(id) $game_system.m_dic_drop2_sw = [] if $game_system.m_dic_drop2_sw == nil $game_system.m_dic_drop2_sw[id] = false if $game_system.m_dic_drop2_sw[id] == nil $game_system.m_dic_drop2_sw[id] = false end def m_dictionary_genoside_number_add(id, n) $game_system.m_dic_genoside_num = [] if $game_system.m_dic_genoside_num == nil $game_system.m_dic_genoside_num[id] = 0 if $game_system.m_dic_genoside_num[id] == nil $game_system.m_dic_genoside_num[id] += n end def m_dictionary_perfection(n) dic_max = 0 dic_num = 0 for i in 1...$data_enemies.size hantei = /<図鑑無効>/ =~ $data_enemies[i].note if $data_enemies[i].name.size > 0 and hantei == nil dic_max += 1 case WD_monsterdictionary_ini::Perfection_timing when 1 $game_system.m_dic_encount_sw = [] if $game_system.m_dic_encount_sw == nil $game_system.m_dic_encount_sw[i] = false if $game_system.m_dic_encount_sw[i] == nil if $game_system.m_dic_encount_sw[i] == true dic_num += 1 end when 2 $game_system.m_dic_victory_sw = [] if $game_system.m_dic_victory_sw == nil $game_system.m_dic_victory_sw[i] = false if $game_system.m_dic_victory_sw[i] == nil if $game_system.m_dic_victory_sw[i] == true dic_num += 1 end end end end $game_variables[n] = (100*dic_num)/dic_max end end class Game_System #-------------------------------------------------------------------------- # ● 公開インスタンス変数 #-------------------------------------------------------------------------- attr_accessor :m_dic_encount_sw attr_accessor :m_dic_victory_sw attr_accessor :m_dic_drop1_sw attr_accessor :m_dic_drop2_sw attr_accessor :m_dic_genoside_num #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- alias wd_orig_initialize15 initialize def initialize wd_orig_initialize15 @m_dic_encount_sw = [] @m_dic_victory_sw = [] @m_dic_drop1_sw = [] @m_dic_drop2_sw = [] @m_dic_genoside_num = [] end end class Game_Interpreter include WD_monsterdictionary end class Game_Troop < Game_Unit include WD_monsterdictionary #-------------------------------------------------------------------------- # ● ドロップアイテムの配列作成(再定義) #-------------------------------------------------------------------------- def make_drop_items drop_items = [] for enemy in dead_members di = enemy.drop_item1 if di.kind != 0 and rand(di.denominator) == 0 if di.kind == 1 drop_items.push($data_items[di.item_id]) elsif di.kind == 2 drop_items.push($data_weapons[di.weapon_id]) elsif di.kind == 3 drop_items.push($data_armors[di.armor_id]) end m_dictionary_drop1_switch_on(enemy.enemy_id) #ドロップアイテム1を図鑑登録 end di = enemy.drop_item2 if di.kind != 0 and rand(di.denominator) == 0 if di.kind == 1 drop_items.push($data_items[di.item_id]) elsif di.kind == 2 drop_items.push($data_weapons[di.weapon_id]) elsif di.kind == 3 drop_items.push($data_armors[di.armor_id]) end m_dictionary_drop2_switch_on(enemy.enemy_id) #ドロップアイテム2を図鑑登録 end end return drop_items end #-------------------------------------------------------------------------- # ● 図鑑への登録(遭遇済み判定) #-------------------------------------------------------------------------- def dictionary1 for enemy in members m_dictionary_encount_switch_on(enemy.enemy_id) unless enemy.hidden #遭遇済み図鑑登録 end end #-------------------------------------------------------------------------- # ● 図鑑への登録(撃破済み判定) #-------------------------------------------------------------------------- def dictionary2 for enemy in dead_members m_dictionary_victory_switch_on(enemy.enemy_id) unless enemy.hidden #撃破済み図鑑登録 m_dictionary_genoside_number_add(enemy.enemy_id, 1) unless enemy.hidden #撃破数カウント end end end class Scene_Battle < Scene_Base #-------------------------------------------------------------------------- # ● 情報表示ビューポートの作成 #-------------------------------------------------------------------------- alias wd_orig_create_info_viewport15 create_info_viewport def create_info_viewport wd_orig_create_info_viewport15 $game_troop.dictionary1 #図鑑への登録(遭遇済み判定) end #-------------------------------------------------------------------------- # ● 勝利の処理 #-------------------------------------------------------------------------- alias wd_orig_process_victory15 process_victory def process_victory $game_troop.dictionary2 #図鑑への登録(撃破済み判定) wd_orig_process_victory15 end end class Game_Interpreter #-------------------------------------------------------------------------- # ● 敵キャラの出現 #-------------------------------------------------------------------------- alias wd_orig_command_335 command_335 def command_335 enemy = $game_troop.members[@params[0]] if enemy != nil and enemy.hidden enemy.hidden = false $game_troop.dictionary1 #図鑑への登録(遭遇済み判定) enemy.hidden = true end wd_orig_command_335 end end #============================================================================== # ■ Scene_MonsterDictionary #------------------------------------------------------------------------------ #  魔物図鑑画面の処理を行うクラスです。 #============================================================================== class Scene_MonsterDictionary < Scene_Base #-------------------------------------------------------------------------- # ● 初期化 #-------------------------------------------------------------------------- def initialize @dic_index = -1 @page = 1 @last_page = 1 end #-------------------------------------------------------------------------- # ● 開始処理 #-------------------------------------------------------------------------- def start super create_menu_background @viewport = Viewport.new(0, 0, 544, 416) @left_window = Window_MonsterDictionaryLeft.new @left_window.viewport = @viewport @right_window = Window_MonsterDictionaryRight.new @right_window.viewport = @viewport @bottom_window = Window_DictionaryPerfection2.new @bottom_window.viewport = @viewport end #-------------------------------------------------------------------------- # ● 終了処理 #-------------------------------------------------------------------------- def terminate super dispose_menu_background @left_window.dispose @right_window.dispose @bottom_window.dispose end #-------------------------------------------------------------------------- # ● 元の画面へ戻る #-------------------------------------------------------------------------- def return_scene $scene = Scene_Map.new # $scene = Scene_Menu.new(6) end #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- def update super update_menu_background @left_window.update @right_window.update @bottom_window.update if @dic_index != @right_window.index or @page != @last_page @left_window.refresh(@right_window.data_id[@right_window.index], @right_window.index, @page) @dic_index = @right_window.index @last_page = @page end if WD_monsterdictionary_ini::M_page_number > 1 if Input.trigger?(Input::RIGHT) @page += 1 @page = 1 if @page > WD_monsterdictionary_ini::M_page_number Sound.play_cursor end end if WD_monsterdictionary_ini::M_page_number > 1 if Input.trigger?(Input::LEFT) @page -= 1 @page = WD_monsterdictionary_ini::M_page_number if @page < 1 Sound.play_cursor end end if Input.trigger?(Input::B) Sound.play_cancel return_scene end end end #============================================================================== # ■ Window_MonsterDictionaryLeft #------------------------------------------------------------------------------ #  魔物のステータスを表示するウィンドウです。 #============================================================================== class Window_MonsterDictionaryLeft < Window_Base #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize x = 0 y = 0 width = 544-200 height = 416 super(x, y, width, height) end #-------------------------------------------------------------------------- # ● リフレッシュ #-------------------------------------------------------------------------- def refresh(id, index, page) self.contents.clear self.contents.font.color = normal_color $game_system.m_dic_encount_sw = [] if $game_system.m_dic_encount_sw == nil $game_system.m_dic_encount_sw[id] = false if $game_system.m_dic_encount_sw[id] == nil $game_system.m_dic_victory_sw = [] if $game_system.m_dic_victory_sw == nil $game_system.m_dic_victory_sw[id] = false if $game_system.m_dic_victory_sw[id] == nil $game_system.m_dic_drop1_sw = [] if $game_system.m_dic_drop1_sw == nil $game_system.m_dic_drop1_sw[id] = false if $game_system.m_dic_drop1_sw[id] == nil $game_system.m_dic_drop2_sw = [] if $game_system.m_dic_drop2_sw == nil $game_system.m_dic_drop2_sw[id] = false if $game_system.m_dic_drop2_sw[id] == nil $game_system.m_dic_genoside_num = [] if $game_system.m_dic_genoside_num == nil $game_system.m_dic_genoside_num[id] = 0 if $game_system.m_dic_genoside_num[id] == nil if WD_monsterdictionary_ini::M_number_display n = WD_monsterdictionary_ini::M_number_display_page.index(page) if n != nil x = WD_monsterdictionary_ini::M_number_display_x[n] y = WD_monsterdictionary_ini::M_number_display_y[n] width = WD_monsterdictionary_ini::M_number_display_width[n] text = sprintf("%0#{WD_monsterdictionary_ini::M_number_display_digit}d",index+1) self.contents.draw_text(x, y, width, WLH, text, 0) end end if $game_system.m_dic_encount_sw[id] == true enemy = $data_enemies[id] if WD_monsterdictionary_ini::M_name_display n = WD_monsterdictionary_ini::M_name_display_page.index(page) if n != nil x = WD_monsterdictionary_ini::M_name_display_x[n] y = WD_monsterdictionary_ini::M_name_display_y[n] width = WD_monsterdictionary_ini::M_name_display_width[n] self.contents.draw_text(x, y, width, WLH, enemy.name, 0) end end if WD_monsterdictionary_ini::M_picture_display n = WD_monsterdictionary_ini::M_picture_display_page.index(page) if n != nil x = WD_monsterdictionary_ini::M_picture_display_x[n] y = WD_monsterdictionary_ini::M_picture_display_y[n] bitmap = Cache.battler(enemy.battler_name, enemy.battler_hue) rect = Rect.new(0, 0, bitmap.width, bitmap.height) if /<半透明>/ =~ enemy.note opacity = WD_monsterdictionary_ini::M_picture_display_opacity/2 else opacity = WD_monsterdictionary_ini::M_picture_display_opacity end self.contents.blt(x - rect.width/2, y - rect.height, bitmap, rect, opacity) end end if WD_monsterdictionary_ini::M_hp_display n = WD_monsterdictionary_ini::M_hp_display_page.index(page) if n != nil x = WD_monsterdictionary_ini::M_hp_display_x[n] y = WD_monsterdictionary_ini::M_hp_display_y[n] width = WD_monsterdictionary_ini::M_hp_display_width[n] self.contents.font.color = system_color self.contents.draw_text(x, y, width, WLH, Vocab::hp, 0) self.contents.font.color = normal_color if $game_system.m_dic_victory_sw[id] == true self.contents.draw_text(x, y, width, WLH, enemy.maxhp, 2) else self.contents.draw_text(x, y, width, WLH, "?", 2) end end end if WD_monsterdictionary_ini::M_mp_display n = WD_monsterdictionary_ini::M_mp_display_page.index(page) if n != nil x = WD_monsterdictionary_ini::M_mp_display_x[n] y = WD_monsterdictionary_ini::M_mp_display_y[n] width = WD_monsterdictionary_ini::M_mp_display_width[n] self.contents.font.color = system_color self.contents.draw_text(x, y, width, WLH, Vocab::mp, 0) self.contents.font.color = normal_color if $game_system.m_dic_victory_sw[id] == true self.contents.draw_text(x, y, width, WLH, enemy.maxmp, 2) else self.contents.draw_text(x, y, width, WLH, "?", 2) end end end if WD_monsterdictionary_ini::M_atk_display n = WD_monsterdictionary_ini::M_atk_display_page.index(page) if n != nil x = WD_monsterdictionary_ini::M_atk_display_x[n] y = WD_monsterdictionary_ini::M_atk_display_y[n] width = WD_monsterdictionary_ini::M_atk_display_width[n] self.contents.font.color = system_color self.contents.draw_text(x, y, width, WLH, Vocab::atk, 0) self.contents.font.color = normal_color if $game_system.m_dic_victory_sw[id] == true self.contents.draw_text(x, y, width, WLH, enemy.atk, 2) else self.contents.draw_text(x, y, width, WLH, "?", 2) end end end if WD_monsterdictionary_ini::M_def_display n = WD_monsterdictionary_ini::M_def_display_page.index(page) if n != nil x = WD_monsterdictionary_ini::M_def_display_x[n] y = WD_monsterdictionary_ini::M_def_display_y[n] width = WD_monsterdictionary_ini::M_def_display_width[n] self.contents.font.color = system_color self.contents.draw_text(x, y, width, WLH, Vocab::def, 0) self.contents.font.color = normal_color if $game_system.m_dic_victory_sw[id] == true self.contents.draw_text(x, y, width, WLH, enemy.def, 2) else self.contents.draw_text(x, y, width, WLH, "?", 2) end end end if WD_monsterdictionary_ini::M_spi_display n = WD_monsterdictionary_ini::M_spi_display_page.index(page) if n != nil x = WD_monsterdictionary_ini::M_spi_display_x[n] y = WD_monsterdictionary_ini::M_spi_display_y[n] width = WD_monsterdictionary_ini::M_spi_display_width[n] self.contents.font.color = system_color self.contents.draw_text(x, y, width, WLH, Vocab::spi, 0) self.contents.font.color = normal_color if $game_system.m_dic_victory_sw[id] == true self.contents.draw_text(x, y, width, WLH, enemy.spi, 2) else self.contents.draw_text(x, y, width, WLH, "?", 2) end end end if WD_monsterdictionary_ini::M_agi_display n = WD_monsterdictionary_ini::M_agi_display_page.index(page) if n != nil x = WD_monsterdictionary_ini::M_agi_display_x[n] y = WD_monsterdictionary_ini::M_agi_display_y[n] width = WD_monsterdictionary_ini::M_agi_display_width[n] self.contents.font.color = system_color self.contents.draw_text(x, y, width, WLH, Vocab::agi, 0) self.contents.font.color = normal_color if $game_system.m_dic_victory_sw[id] == true self.contents.draw_text(x, y, width, WLH, enemy.agi, 2) else self.contents.draw_text(x, y, width, WLH, "?", 2) end end end if WD_monsterdictionary_ini::M_hit_display n = WD_monsterdictionary_ini::M_hit_display_page.index(page) if n != nil x = WD_monsterdictionary_ini::M_hit_display_x[n] y = WD_monsterdictionary_ini::M_hit_display_y[n] width = WD_monsterdictionary_ini::M_hit_display_width[n] self.contents.font.color = system_color self.contents.draw_text(x, y, width, WLH, WD_monsterdictionary_ini::M_hit_display_text1, 0) self.contents.font.color = normal_color if $game_system.m_dic_victory_sw[id] == true self.contents.draw_text(x, y, width, WLH, "#{enemy.hit}%", 2) else self.contents.draw_text(x, y, width, WLH, "?", 2) end end end if WD_monsterdictionary_ini::M_eva_display n = WD_monsterdictionary_ini::M_eva_display_page.index(page) if n != nil x = WD_monsterdictionary_ini::M_eva_display_x[n] y = WD_monsterdictionary_ini::M_eva_display_y[n] width = WD_monsterdictionary_ini::M_eva_display_width[n] self.contents.font.color = system_color self.contents.draw_text(x, y, width, WLH, WD_monsterdictionary_ini::M_eva_display_text1, 0) self.contents.font.color = normal_color if $game_system.m_dic_victory_sw[id] == true self.contents.draw_text(x, y, width, WLH, "#{enemy.eva}%", 2) else self.contents.draw_text(x, y, width, WLH, "?", 2) end end end if WD_monsterdictionary_ini::M_exp_display n = WD_monsterdictionary_ini::M_exp_display_page.index(page) if n != nil x = WD_monsterdictionary_ini::M_exp_display_x[n] y = WD_monsterdictionary_ini::M_exp_display_y[n] width = WD_monsterdictionary_ini::M_exp_display_width[n] self.contents.font.color = system_color self.contents.draw_text(x, y, width, WLH, WD_monsterdictionary_ini::M_exp_display_text1, 0) self.contents.font.color = normal_color if $game_system.m_dic_victory_sw[id] == true self.contents.draw_text(x, y, width, WLH, enemy.exp, 2) else self.contents.draw_text(x, y, width, WLH, "?", 2) end end end if WD_monsterdictionary_ini::M_gold_display n = WD_monsterdictionary_ini::M_gold_display_page.index(page) if n != nil x = WD_monsterdictionary_ini::M_gold_display_x[n] y = WD_monsterdictionary_ini::M_gold_display_y[n] width = WD_monsterdictionary_ini::M_gold_display_width[n] self.contents.font.color = system_color self.contents.draw_text(x, y, width, WLH, WD_monsterdictionary_ini::M_gold_display_text1, 0) self.contents.font.color = normal_color if $game_system.m_dic_victory_sw[id] == true self.contents.draw_text(x, y, width, WLH, "#{enemy.gold}#{Vocab::gold}", 2) else self.contents.draw_text(x, y, width, WLH, "?", 2) end end end if WD_monsterdictionary_ini::M_drop1_display n = WD_monsterdictionary_ini::M_drop1_display_page.index(page) if n != nil x = WD_monsterdictionary_ini::M_drop1_display_x[n] y = WD_monsterdictionary_ini::M_drop1_display_y[n] width = WD_monsterdictionary_ini::M_drop1_display_width[n] self.contents.font.color = system_color self.contents.draw_text(x, y, width, WLH, WD_monsterdictionary_ini::M_drop1_display_text1, 0) self.contents.font.color = normal_color if enemy.drop_item1.kind != 0 if $game_system.m_dic_drop1_sw[id] == true case enemy.drop_item1.kind when 1 item = $data_items[enemy.drop_item1.item_id] when 2 item = $data_weapons[enemy.drop_item1.weapon_id] when 3 item = $data_armors[enemy.drop_item1.armor_id] end draw_item_name(item, x + 24, y + 24) self.contents.draw_text(x + 24, y + 24, width - 24, WLH, "1/#{enemy.drop_item1.denominator}", 2) else self.contents.draw_text(x + 48, y + 24, width - 24, WLH, "?", 0) end else self.contents.draw_text(x + 48, y + 24, width - 24, WLH, "−", 0) end end end if WD_monsterdictionary_ini::M_drop2_display n = WD_monsterdictionary_ini::M_drop2_display_page.index(page) if n != nil x = WD_monsterdictionary_ini::M_drop2_display_x[n] y = WD_monsterdictionary_ini::M_drop2_display_y[n] width = WD_monsterdictionary_ini::M_drop2_display_width[n] self.contents.font.color = system_color self.contents.draw_text(x, y, width, WLH, WD_monsterdictionary_ini::M_drop2_display_text1, 0) self.contents.font.color = normal_color if enemy.drop_item2.kind != 0 if $game_system.m_dic_drop2_sw[id] == true case enemy.drop_item2.kind when 1 item = $data_items[enemy.drop_item2.item_id] when 2 item = $data_weapons[enemy.drop_item2.weapon_id] when 3 item = $data_armors[enemy.drop_item2.armor_id] end draw_item_name(item, x + 24, y + 24) self.contents.draw_text(x + 24, y + 24, width - 24, WLH, "1/#{enemy.drop_item2.denominator}", 2) else self.contents.draw_text(x + 48, y + 24, width - 24, WLH, "?", 0) end else self.contents.draw_text(x + 48, y + 24, width - 24, WLH, "−", 0) end end end if WD_monsterdictionary_ini::M_geno_display n = WD_monsterdictionary_ini::M_geno_display_page.index(page) if n != nil x = WD_monsterdictionary_ini::M_geno_display_x[n] y = WD_monsterdictionary_ini::M_geno_display_y[n] width = WD_monsterdictionary_ini::M_geno_display_width[n] self.contents.font.color = system_color self.contents.draw_text(x, y, width, WLH, WD_monsterdictionary_ini::M_geno_display_text1, 0) self.contents.font.color = normal_color self.contents.draw_text(x, y, width, WLH, "#{$game_system.m_dic_genoside_num[id]}#{WD_monsterdictionary_ini::M_geno_display_text2}", 2) end end if WD_monsterdictionary_ini::M_help_display n = WD_monsterdictionary_ini::M_help_display_page.index(page) if n != nil x = WD_monsterdictionary_ini::M_help_display_x[n] y = WD_monsterdictionary_ini::M_help_display_y[n] width = WD_monsterdictionary_ini::M_help_display_width[n] self.contents.font.color = system_color self.contents.draw_text(x, y, width, WLH, WD_monsterdictionary_ini::M_help_display_text1, 0) self.contents.font.color = normal_color if $game_system.m_dic_victory_sw[id] == true if /<図鑑説明:(.+)>/ =~ enemy.note matched = $1 text = matched.split(/\\n/) for i in 0...text.size self.contents.draw_text(x+16, y+WLH*(i+1), width-16, WLH, text[i], 0) end end else self.contents.draw_text(x, y+WLH, width, WLH, "?", 0) end end end if WD_monsterdictionary_ini::M_element_display n = WD_monsterdictionary_ini::M_element_display_page.index(page) if n != nil x = WD_monsterdictionary_ini::M_element_display_x[n] y = WD_monsterdictionary_ini::M_element_display_y[n] width = WD_monsterdictionary_ini::M_element_display_width[n] indent = WD_monsterdictionary_ini::M_element_display_indent[n] for i in 1...WD_monsterdictionary_ini::M_element_display_range.size + 1 element_id = WD_monsterdictionary_ini::M_element_display_range[i-1] column = (i+1) % WD_monsterdictionary_ini::M_element_display_column[n] row = (i-1) / WD_monsterdictionary_ini::M_element_display_column[n] self.contents.font.color = system_color self.contents.draw_text(x+(width+indent)*(column), y+WLH*(row), width, WLH, $data_system.elements[element_id], 0) self.contents.font.color = normal_color if $game_system.m_dic_victory_sw[id] == true rank = WD_monsterdictionary_ini::M_element_display_text1[enemy.element_ranks[element_id]-1] self.contents.draw_text(x+(width+indent)*(column), y+WLH*(row), width, WLH, "#{rank}", 2) else self.contents.draw_text(x+(width+indent)*(column), y+WLH*(row), width, WLH, "?", 2) end end end end if WD_monsterdictionary_ini::M_state_display n = WD_monsterdictionary_ini::M_state_display_page.index(page) if n != nil x = WD_monsterdictionary_ini::M_state_display_x[n] y = WD_monsterdictionary_ini::M_state_display_y[n] width = WD_monsterdictionary_ini::M_state_display_width[n] indent = WD_monsterdictionary_ini::M_state_display_indent[n] for i in 1...WD_monsterdictionary_ini::M_state_display_range.size + 1 state_id = WD_monsterdictionary_ini::M_state_display_range[i-1] column = (i+1) % WD_monsterdictionary_ini::M_state_display_column[n] row = (i-1) / WD_monsterdictionary_ini::M_state_display_column[n] self.contents.font.color = system_color self.contents.draw_text(x+(width+indent)*(column), y+WLH*(row), width, WLH, $data_states[state_id].name, 0) self.contents.font.color = normal_color if $game_system.m_dic_victory_sw[id] == true rank = WD_monsterdictionary_ini::M_state_display_text1[enemy.state_ranks[state_id]-1] self.contents.draw_text(x+(width+indent)*(column), y+WLH*(row), width, WLH, "#{rank}", 2) else self.contents.draw_text(x+(width+indent)*(column), y+WLH*(row), width, WLH, "?", 2) end end end end if WD_monsterdictionary_ini::M_page_display n = WD_monsterdictionary_ini::M_page_display_page.index(page) if n != nil x = WD_monsterdictionary_ini::M_page_display_x[n] y = WD_monsterdictionary_ini::M_page_display_y[n] width = WD_monsterdictionary_ini::M_page_display_width[n] self.contents.font.color = normal_color self.contents.draw_text(x, y, width, WLH, "-#{page}/#{WD_monsterdictionary_ini::M_page_number}-", 2) end end else x = WD_monsterdictionary_ini::M_non_display_x y = WD_monsterdictionary_ini::M_non_display_y width = WD_monsterdictionary_ini::M_non_display_width text1 = WD_monsterdictionary_ini::M_non_display_text1 self.contents.draw_text(x, y, width, WLH, text1, 0) end end end #============================================================================== # ■ Window_MonsterDictionaryRight #------------------------------------------------------------------------------ #  魔物の一覧を表示するウィンドウです。 #============================================================================== class Window_MonsterDictionaryRight < Window_Selectable #-------------------------------------------------------------------------- # ● 公開インスタンス変数 #-------------------------------------------------------------------------- attr_reader :data_id #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize x = 544 -200 y = 0 width = 200 height = 416-56 super(x, y, width, height) @index=0 @column_max = 1 refresh end #-------------------------------------------------------------------------- # ● リフレッシュ #-------------------------------------------------------------------------- def refresh @data = [] @data_id = [] for i in 1...$data_enemies.size hantei = /<図鑑無効>/ =~ $data_enemies[i].note if $data_enemies[i].name.size > 0 and hantei == nil $game_system.m_dic_encount_sw = [] if $game_system.m_dic_encount_sw == nil $game_system.m_dic_encount_sw[i] = false if $game_system.m_dic_encount_sw[i] == nil if $game_system.m_dic_encount_sw[i] == true @data.push($data_enemies[i].name) else @data.push(WD_monsterdictionary_ini::C_non_display_text1) end @data_id.push($data_enemies[i].id) end end self.contents.clear @item_max = @data.size create_contents for i in 0...@item_max draw_item(i) end end #-------------------------------------------------------------------------- # ● 項目の描画 #-------------------------------------------------------------------------- def draw_item(index) rect = item_rect(index) rect.x += 4 rect.width -= 8 self.contents.clear_rect(rect) self.contents.font.color.alpha = 255 self.contents.font.color.alpha = 128 if @data[index] == WD_monsterdictionary_ini::C_non_display_text1 self.contents.draw_text(rect, @data[index], 0) end end #============================================================================== # ■ Window_DictionaryPerfection2 #------------------------------------------------------------------------------ #  図鑑完成度を表示するウィンドウです。 #============================================================================== class Window_DictionaryPerfection2 < Window_Base #-------------------------------------------------------------------------- # ● オブジェクト初期化 # x : ウィンドウの X 座標 # y : ウィンドウの Y 座標 #-------------------------------------------------------------------------- def initialize super(544 - 200, 416 - 56, 200, 56) refresh end #-------------------------------------------------------------------------- # ● リフレッシュ #-------------------------------------------------------------------------- def refresh self.contents.clear dic_max = 0 dic_num = 0 self.contents.draw_text(0, 0, 200 - 32, WLH, "図鑑完成度:", 0) for i in 1...$data_enemies.size hantei = /<図鑑無効>/ =~ $data_enemies[i].note if $data_enemies[i].name.size > 0 and hantei == nil dic_max += 1 case WD_monsterdictionary_ini::Perfection_timing when 1 $game_system.m_dic_encount_sw = [] if $game_system.m_dic_encount_sw == nil $game_system.m_dic_encount_sw[i] = false if $game_system.m_dic_encount_sw[i] == nil if $game_system.m_dic_encount_sw[i] == true dic_num += 1 end when 2 $game_system.m_dic_victory_sw = [] if $game_system.m_dic_victory_sw == nil $game_system.m_dic_victory_sw[i] = false if $game_system.m_dic_victory_sw[i] == nil if $game_system.m_dic_victory_sw[i] == true dic_num += 1 end end end end self.contents.draw_text(0, 0, 200 - 32, WLH, "#{(100*dic_num)/dic_max}%", 2) end end