#============================================================================== # ■ Pokemon_Pokedex # Pokemon Script Project - Krosk & Shaolan # 16/02/08 #----------------------------------------------------------------------------- # Scène modifiable #----------------------------------------------------------------------------- # Pokédex #-----------------------------------------------------------------------------
module POKEMON_S class Pokemon_Pokedex #(Numérique) def initialize(index = 0, list=nil, tr = false) @index = index @list = list @tronquage = tr end def main # Fenêtre principale # Fond @background = Sprite.new @background.bitmap = RPG::Cache.picture("Menu_Pokedex2.png") # Liste if @list == nil @list = [] for i in 1..$data_pokedex.length-1 if $data_pokedex[i][0] @list.push(i) end end end @pokemon_list = POKEMON_S::Pokemon_List.new(@list, @index, @tronquage) @pokemon_list.active = true # Vu/Capture @pokemon_amount = Window_Base.new(27 - 16, 70, 155, 400) @pokemon_amount.contents = Bitmap.new(150, 400) @pokemon_amount.contents.font.name = $fontface @pokemon_amount.contents.font.size = 28 @pokemon_amount.z = 2 #print $fontsizebig @pokemon_amount.contents.font.italic = true @pokemon_amount.opacity = 0 #viewed = @list.length.to_s captured = 0 viewed = 0 for i in 1..$data_pokedex.length-1 if $data_pokedex[i][0] viewed += 1 end end for i in 1..$data_pokedex.length-1 if $data_pokedex[i][1] captured += 1 end end rect = Rect.new (32, 30, 120, 3) @pokemon_amount.contents.fill_rect(rect, Color.new(0, 0, 0)) rect = Rect.new (30, 28, 120, 3) @pokemon_amount.contents.fill_rect(rect, Color.new(255, 255, 255))
rect = Rect.new (32, 78 + 30, 120, 3) @pokemon_amount.contents.fill_rect(rect, Color.new(0, 0, 0)) rect = Rect.new (30, 78 + 28, 120, 3) @pokemon_amount.contents.fill_rect(rect, Color.new(255, 255, 255))
@pokemon_amount.contents.draw_text(0, 0, 150, 28, "VUS", 1)# + viewed, 1) @pokemon_amount.contents.draw_text(0, 78, 150, 28, "PRIS", 1)# + captured.to_s, 1) @pokemon_amount.contents.font.size = 38 viewed = sprintf("% 3s", viewed) captured = sprintf("% 3s", captured.to_s) @pokemon_amount.contents.draw_text(0, 34, 150, 38, viewed, 1) @pokemon_amount.contents.draw_text(0, 78 + 34, 150, 38, captured, 1) @pokemon_list.update @pokemon_list.refresh # Fin Fenêtre principale # Fenêtre détail # Sprite @pokemon_sprite = Sprite.new @pokemon_sprite.x = 400 @pokemon_sprite.y = 75 @pokemon_sprite.z = 10 @pokemon_sprite.visible = false # Identité @data_window = Window_Base.new(39 - 16, 75 - 16 , 220 + 32, 170 + 32) @data_window.contents = Bitmap.new(220 , 170) color = Color.new(60,60,60) @data_window.contents.font.name = $fontface @data_window.contents.font.size = $fontsize @data_window.contents.font.color = color @data_window.opacity = 0 @data_window.z = 10 @data_window.visible = false # Descr @text_window = Window_Base.new(60 - 16, 264 - 16, 550 + 32, 160 + 32) @text_window.contents = Bitmap.new(550 , 160) @text_window.contents.font.name = $fontface @text_window.contents.font.size = $fontsize @text_window.contents.font.color = color @text_window.opacity = 0 @text_window.z = 10 @text_window.visible = false Graphics.transition loop do Graphics.update Input.update update if $scene != self break end end Graphics.freeze @pokemon_list.dispose @pokemon_amount.dispose @background.dispose @data_window.dispose @pokemon_sprite.dispose @text_window.dispose ################################################################################ @pokemon_list.dispose_image Graphics.transition Graphics.freeze end def update @pokemon_list.update @index = @pokemon_list.index if Input.trigger?(Input::B) and @pokemon_sprite.visible == false $game_system.se_play($data_system.cancel_se) $scene = POKEMON_S::Pokemon_Menu.new(0) return end if Input.trigger?(Input::C) and ((@tronquage == false and @list.include?(@index + 1)) or (@tronquage == true)) $scene = POKEMON_S::Pokemon_Pokedex_Detail.new(@index, @list, @tronquage) return end if Input.trigger?(Input::B) and @pokemon_sprite.visible == true $game_system.se_play($data_system.cancel_se) Graphics.freeze @background.bitmap = RPG::Cache.picture("Menu_Pokedex2.png") @pokemon_sprite.visible = false @data_window.visible = false @text_window.visible = false @pokemon_amount.visible = true @pokemon_list.visible = true @pokemon_list.active = true Graphics.transition return end =begin if Input.trigger?(Input::Y) or Input.trigger?(Input::CTRL) if @tronquage @tronquage = false @pokemon_list.dispose_image @pokemon_list.dispose @pokemon_list = POKEMON_S::Pokemon_List.new(@list, @list[@index]-1, @tronquage) @pokemon_list.active = true @pokemon_list.update @pokemon_list.refresh else @tronquage = true a = @list.index(@index+1) if a == nil a = 0 end @pokemon_list.dispose_image @pokemon_list.dispose @pokemon_list = POKEMON_S::Pokemon_List.new(@list, a, @tronquage) @pokemon_list.active = true @pokemon_list.update @pokemon_list.refresh end end =end if Input.trigger?(Input::Z) $scene= POKEMON_S::Pokemon_Pokedex_Recherche.new(@index, @list, @tronquage) end end def data_refresh @index = @pokemon_list.index @pokemon = $data_pokemon[@index+1] ida = sprintf("%03d", @index+1) @pokemon_sprite.bitmap = RPG::Cache.battler("Front_Male/" + ida + ".png", 0) name = "N." + ida + " " + @pokemon[0] show = $data_pokedex[@index+1][1] if show # Descr accessible species = @pokemon[9][1] height_data = @pokemon[9][2] weight = @pokemon[9][3] else species = "???" height_data = "???" weight = "???" end @data_window.contents.clear @data_window.contents.draw_text(0, 0, 260, 39, name) @data_window.contents.draw_text(0, 44, 220, 39, species) @data_window.contents.draw_text(0, 88, 220, 30, "Taille: "+ height_data) @data_window.contents.draw_text(0, 132, 220, 30, "Poids: "+ weight) @text_window.contents.clear if show text = @pokemon[9][0] string = string_builder(text, 51) string1 = string[0] string2 = string[1] string3 = string[2] string4 = string[3] @text_window.contents.draw_text(0, 0, 550, 40, string1) @text_window.contents.draw_text(0, 40, 550, 40, string2) @text_window.contents.draw_text(0, 80, 550, 40, string3) @text_window.contents.draw_text(0, 120, 550, 40, string4) end end def string_builder(text, limit) length = text.length full1 = false full2 = false full3 = false full4 = false string1 = "" string2 = "" string3 = "" string4 = "" word = "" for i in 0..length letter = text[i..i] if letter != " " and i != length word += letter.to_s else word = word + " " if (string1 + word).length < limit and not(full1) string1 += word word = "" else full1 = true end if (string2 + word).length < limit and not(full2) string2 += word word = "" else full2 = true end if (string3 + word).length < limit and not(full3) string3 += word word = "" else full3 = true end if (string4 + word).length < limit and not(full4) string4 += word word = "" else full4 = true end end end return [string1, string2, string3, string4] end end class Pokemon_List < Window_Selectable def dispose_image @image_pokemon.dispose end def initialize(id_list = [], menu_index = 0, tronquage = false) #print id_list # show montre les pokémons intermédiaires # id_list liste des pokémons vu/attrapés @hauteur = 35 super(640 - 320, (480-418-32)/2, 560+32, 418+32, @hauteur)#(640 - 320, 48-16, 560+32, 387+32, 43) @index = menu_index @id_list = id_list @last = id_list[-1] self.oy = (-1 * ((self.height - 32)/2)) + ((@hauteur) * menu_index) + @hauteur/2 self.opacity = 0 if tronquage == false value = @last else value = id_list.length end @tronquage = tronquage #print "tronquage : #@tronquage" if value == nil value = 1 @last = 1 end @item_max = value self.contents = Bitmap.new(width - 32, value * @hauteur) self.contents.font.name = $fontface self.contents.font.size = 35 @image_pokemon = POKEMON_S::Image_Pokemon.new(id_list, @index, @tronquage) end def refresh self.contents.clear normal_color = Color.new(60,60,60) self.contents.font.color = normal_color if @tronquage #print "tronquage oui " + @id_list.to_s calcul = 0 @id_list.each do |i| #print i ida = sprintf("%03d", i) string = " N." + ida self.contents.draw_text(5, @hauteur * calcul, 480, @hauteur, string) string = $pokemon_info.name(i) self.contents.draw_text(120, @hauteur * calcul, 300, @hauteur, string) if $data_pokedex[i][1] bitmap = RPG::Cache.picture("Pokedexball.png") self.contents.blt(92, 5 + @hauteur * calcul, bitmap, Rect.new(0, 0, 24, 24)) #type1 = $pokemon_info.type1(i) #type2 = $pokemon_info.type2(i) #src_rect = Rect.new(0, 0, 96, 42) #bitmap = RPG::Cache.picture("T" + type1.to_s + ".png") #self.contents.blt(336, 43 * (i-1), bitmap, src_rect, 255) #bitmap = RPG::Cache.picture("T" + type2.to_s + ".png") #self.contents.blt(432, 43 * (i-1), bitmap, src_rect, 255) end calcul += 1 end else for i in 1.. @last #self.contents.font.size = (i <= 96 and i >= 8) ? i : 38 ida = sprintf("%03d", i) string = " N." + ida self.contents.draw_text(5, @hauteur * (i-1), 480, @hauteur, string) if @id_list.include?(i) string = $pokemon_info.name(i) else string = "-------" end self.contents.draw_text(120, @hauteur * (i-1), 300, @hauteur, string) if $data_pokedex[i][1] bitmap = RPG::Cache.picture("Pokedexball.png") self.contents.blt(92, 5 + @hauteur * (i-1), bitmap, Rect.new(0, 0, 24, 24)) #type1 = $pokemon_info.type1(i) #type2 = $pokemon_info.type2(i) #src_rect = Rect.new(0, 0, 96, 42) #bitmap = RPG::Cache.picture("T" + type1.to_s + ".png") #self.contents.blt(336, 43 * (i-1), bitmap, src_rect, 255) #bitmap = RPG::Cache.picture("T" + type2.to_s + ".png") #self.contents.blt(432, 43 * (i-1), bitmap, src_rect, 255) end end end end def update # super @image_pokemon.update if @image_pokemon.flag_move_up or @image_pokemon.flag_move_down if @image_pokemon.flag_move_up self.oy += @hauteur/10 return end if @image_pokemon.flag_move_down self.oy -= @hauteur/10 return end else if self.oy != (-1 * ((self.height - 32)/2)) + ((@hauteur) * @index) + @hauteur/2 self.oy = (-1 * ((self.height - 32)/2)) + ((@hauteur) * @index) + @hauteur/2 end end # カーソルの移動が可能な状態の場合 if self.active and @item_max > 0 and @index >= 0 # 方向ボタンの下が押された場合 if Input.repeat?(Input::DOWN) # 列数が 1 かつ 方向ボタンの下の押下状態がリピートでない場合か、 # またはカーソル位置が(項目数 - 列数)より前の場合 if (@column_max == 1 and Input.trigger?(Input::DOWN)) or @index < @item_max - @column_max # カーソルを下に移動 $game_system.se_play($data_system.cursor_se) if (@index == @id_list[@id_list.size - 1] - 1 and @tronquage == false) or (@index == (@id_list.size - 1) and @tronquage == true) @index = 0 self.oy = (-1 * ((self.height-32)/2)) + ((@hauteur) * @index) + @hauteur/2 else @index += 1 #self.oy += @hauteur end @image_pokemon.move_up(@index) end end # 方向ボタンの上が押された場合 if Input.repeat?(Input::UP) # 列数が 1 かつ 方向ボタンの上の押下状態がリピートでない場合か、 # またはカーソル位置が列数より後ろの場合 if (@column_max == 1 and Input.trigger?(Input::UP)) or @index >= @column_max # カーソルを上に移動 $game_system.se_play($data_system.cursor_se) if @index == 0 if @tronquage @index = @id_list.size - 1 else @index = @id_list[@id_list.size - 1] - 1 end self.oy = (-1 * ((self.height-32)/2)) + ((@hauteur) * @index) + @hauteur/2 else @index -= 1 #self.oy -= @hauteur end @image_pokemon.move_down(@index) #@image_pokemon.refresh(@index) end end # R ボタンが押された場合 if Input.repeat?(Input::R) # 表示されている最後尾の行が、データ上の最後の行よりも前の場合 if self.top_row + (self.page_row_max - 1) < (self.row_max - 1) # カーソルを 1 ページ後ろに移動 $game_system.se_play($data_system.cursor_se) #if @index == @id_list[@id_list.size - 1] - 1 # @index = 0 # self.oy = (-1 * ((self.height-32)/2)) + ((@hauteur) * @index) + @hauteur/2 #end if (@index + 8) >= @id_list[@id_list.size - 1] - 1 @index = @id_list[@id_list.size - 1] - 1 self.oy = (-1 * ((self.height-32)/2)) + ((@hauteur) * @index) + @hauteur/2 else @index += 8 self.oy += @hauteur*8 end @image_pokemon.refresh(@index) else @index = self.row_max - 1 self.oy = (-1 * ((self.height-32)/2)) + ((@hauteur) * @index) + @hauteur/2 @image_pokemon.refresh(@index) end end # L ボタンが押された場合 if Input.repeat?(Input::L) # 表示されている先頭の行が 0 より後ろの場合 if self.top_row > 0 $game_system.se_play($data_system.cursor_se) #if @index == @id_list[@id_list.size - 1] - 1 # @index = 0 # self.oy = (-1 * ((self.height-32)/2)) + ((@hauteur) * @index) + @hauteur/2 #end if (@index - 8) < 0 @index = 0 self.oy = (-1 * ((self.height-32)/2)) + ((@hauteur) * @index) + @hauteur/2 else @index -= 8 self.oy -= @hauteur*8 end @image_pokemon.refresh(@index) else @index = 0 self.oy = (-1 * ((self.height-32)/2)) + ((@hauteur) * @index) + @hauteur/2 @image_pokemon.refresh(@index) end end end # ヘルプテキストを更新 (update_help は継承先で定義される) if self.active and @help_window != nil update_help end
# カーソルの矩形を更新 #update_cursor_rect end end class Pokemon_Pokedex_Detail def initialize(index, list, tronquage) #print list @index = index @list = list @tronquage = tronquage end def main @commande = Sprite.new @commande.z = 500 @arriere_plan = Sprite.new @index_commande = 0 refresh_page @commande.bitmap = RPG::Cache.picture("commande 0") loop do Graphics.update Input.update update if $scene != self break end end #self.dispose @arriere_plan.dispose Graphics.freeze end def update if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) Graphics.freeze self.dispose @commande.bitmap = RPG::Cache.clear Graphics.transition Graphics.freeze $scene = POKEMON_S::Pokemon_Pokedex.new(@index, @list, @tronquage) return end if Input.trigger?(Input::C) if @index_commande == 2 if @tronquage index = @list[@index] else index = @index + 1 end filename = "Audio/SE/Cries/" + sprintf("%03d", index) + "Cry.wav" if FileTest.exist?(filename) Audio.se_play(filename) end end end if Input.trigger?(Input::DOWN) if @tronquage if @list[@index +1] != nil @index +=1 else return end else calcul = @list.index(@index + 1)+1 if @list[calcul] != nil #print "calcul : " + (@list.index(@index + 1) + 1).to_s #print "acien index #@index" @index = @list[@list.index(@index + 1)+1] - 1 #print "nouveau index #@index" else return end end $game_system.se_play($data_system.cursor_se) Graphics.freeze @commande.bitmap = RPG::Cache.clear @commande.bitmap = RPG::Cache.clear self.dispose Graphics.transition Graphics.freeze @commande.bitmap = RPG::Cache.picture("commande 0") #@arriere_plan = Sprite.new @index_commande = 0 refresh_page Graphics.transition end
if Input.trigger?(Input::UP) if @tronquage if @index > 0 @index -=1 else return end else calcul = @list.index(@index + 1)-1 if (@index+1)>@list[0] @index = @list[calcul] - 1 else return end end $game_system.se_play($data_system.cursor_se) Graphics.freeze @commande.bitmap = RPG::Cache.clear @commande.bitmap = RPG::Cache.clear self.dispose Graphics.transition Graphics.freeze @commande.bitmap = RPG::Cache.picture("commande 0") #@arriere_plan = Sprite.new @index_commande = 0 refresh_page Graphics.transition end if Input.trigger?(Input::LEFT) if @index_commande > 0 Graphics.freeze self.dispose Graphics.transition @index_commande -= 1 @commande.bitmap = RPG::Cache.clear @commande.bitmap = RPG::Cache.picture("commande " + @index_commande.to_s) Graphics.freeze case @index_commande when 0 refresh_page when 1 refresh_zone when 2 refresh_cri when 3 refresh_tail end end end if Input.trigger?(Input::RIGHT) if @index_commande < 3 if @tronquage ida = @list[@index] else ida = @index + 1 end if @index_commande == 2 and $data_pokedex[ida][1] == false return end Graphics.freeze self.dispose Graphics.transition @index_commande += 1 @commande.bitmap = RPG::Cache.clear @commande.bitmap = RPG::Cache.picture("commande " + @index_commande.to_s) Graphics.freeze case @index_commande when 0 refresh_page when 1 refresh_zone when 2 refresh_cri when 3 refresh_tail end end end end def data_refresh if @tronquage index = @list[@index] else index = @index + 1 end @pokemon = $data_pokemon[index] ida = sprintf("%03d", index) @pokemon_sprite = Sprite.new @pokemon_sprite.x = 26 @pokemon_sprite.y = 75 @pokemon_sprite.z = 10 @pokemon_sprite.bitmap = RPG::Cache.battler("Front_Male/" + ida + ".png", 0) name = ida + " " + @pokemon[0] show = $data_pokedex[index][1] if show # Descr accessible species = @pokemon[9][1] height_data = @pokemon[9][2] weight = @pokemon[9][3] #print weight.slice!(" kg")
else species = "???" height_data = "???" weight = "???" end if @data_window != nil and @data_window.disposed? == false @data_window.contents.clear end @data_window = Window_Base.new(255-16, 81-22, 340 + 30, 170 + 62) @data_window.contents = Bitmap.new(250 , 200) color = Color.new(60,60,60) @data_window.opacity = 0 @data_window.contents.font.name = $fontface @data_window.contents.font.size = 45 @data_window.contents.font.color = color @data_window.contents.draw_text(0, 0, 260, 45, name) @data_window.contents.draw_text(0, 45, 220, 45, species) @data_window.contents.draw_text(0, 96, 213, 45, height_data,2) @data_window.contents.draw_text(0, 146, 230, 45, weight,2) if @text_window != nil and @text_window.disposed? == false @text_window.contents.clear end @text_window = Window_Base.new(60 - 16, 264 + 25, 550 + 32, 160 + 32) @text_window.contents = Bitmap.new(550 , 160) @text_window.contents.font.name = $fontface @text_window.contents.font.size = $fontsize @text_window.contents.font.color = color @text_window.opacity = 0 @text_window.z = 10
if show text = @pokemon[9][0] string = string_builder(text, 51) string1 = string[0] string2 = string[1] string3 = string[2] string4 = string[3] @text_window.contents.draw_text(0, 0, 550, 40, string1) @text_window.contents.draw_text(0, 40, 550, 40, string2) @text_window.contents.draw_text(0, 80, 550, 40, string3) @text_window.contents.draw_text(0, 120, 550, 40, string4) end end def string_builder(text, limit) length = text.length full1 = false full2 = false full3 = false full4 = false string1 = "" string2 = "" string3 = "" string4 = "" word = "" for i in 0..length letter = text[i..i] if letter != " " and i != length word += letter.to_s else word = word + " " if (string1 + word).length < limit and not(full1) string1 += word word = "" else full1 = true end if (string2 + word).length < limit and not(full2) string2 += word word = "" else full2 = true end if (string3 + word).length < limit and not(full3) string3 += word word = "" else full3 = true end if (string4 + word).length < limit and not(full4) string4 += word word = "" else full4 = true end end end return [string1, string2, string3, string4] end
def refresh_page @arriere_plan.bitmap = Bitmap.new("Graphics/Pictures/Pokedex_page.png") data_refresh Graphics.transition if @tronquage index = @list[@index] else index = @index + 1 end filename = "Audio/SE/Cries/" + sprintf("%03d", index) + "Cry.wav" if FileTest.exist?(filename) Audio.se_play(filename) end end def dispose case @index_commande when 0 @data_window.dispose @text_window.dispose @pokemon_sprite.dispose when 1 @window_zone.dispose when 2 @texte.dispose @img_pok.dispose when 3 @img_pok.dispose @img_dre.dispose @texte.dispose end @arriere_plan.bitmap.dispose #@commande.bitmap = RPG::Cache.clear #@commande.dispose end def refresh_zone @window_zone = Window_Base.new(144+ 25, 149, 320 + 32, 100 + 32) @window_zone.contents = Bitmap.new(320, 100) @window_zone.contents.font.name = $fontface @window_zone.contents.font.size = 50 @window_zone.contents.font.color = Color.new(72, 72, 72) @window_zone.contents.draw_text(@window_zone.contents.rect, "Fonction indisponible", 1) Graphics.transition end def refresh_cri @arriere_plan.bitmap = Bitmap.new("Graphics/Pictures/Pokedex_cri.png") @texte = Window_Base.new(220 -16, 86 - 16, 169 +32, 80 + 32) @texte.contents = Bitmap.new(169, 80) @texte.opacity = 0 @texte.contents.font.name = $fontface @texte.contents.font.size = 45 @texte.contents.font.color = Color.new(72, 72, 72) @texte.contents.draw_text(0, 0, 169, 80/2, "CRI DE") if @tronquage at = $data_pokemon[@list[@index]][0] ida = @list[@index] else at = $data_pokemon[@index+1][0] ida = @index + 1 end ida = sprintf("%03d", ida) @texte.contents.draw_text(0, 80/2, 169, 80/2, at.to_s) @img_pok = Sprite.new @img_pok.x = 51 @img_pok.y = 75 @img_pok.bitmap = RPG::Cache.battler("Front_Male/" + ida + ".png", 0) Graphics.transition end def refresh_tail @arriere_plan.bitmap = Bitmap.new("Graphics/Pictures/Pokedex_tail.png") @texte = Window_Base.new(40 -16, 348 - 16, 560 + 32, 84 + 32) @texte.contents = Bitmap.new(560, 84) @texte.opacity = 0 @texte.contents.font.name = $fontface @texte.contents.font.size = 50 @texte.contents.font.color = Color.new(72, 72, 72) @texte.contents.draw_text(0, 0, 560, 84, "TAILLE COMPAREE A " + $data_actors[1].name.to_s, 1)# + ) if @tronquage ida = @list[@index] else ida = @index + 1 end #print $data_pokemon[ida][9][2].to_f if $data_pokemon[ida][9][2].to_f > 1.40 zoom_pok = 1.00 zoom_dre = 1.40 / $data_pokemon[ida][9][2].to_f else zoom_pok = $data_pokemon[ida][9][2].to_f/1.40 zoom_dre = 1.00 end @img_pok = Sprite.new @img_pok.ox = 160/2 @img_pok.oy = 160 ida = sprintf("%03d", ida) @img_pok.bitmap = RPG::Cache.battler("Front_Male/" + ida.to_s + ".png", 0) @img_pok.x = 150 + 80 @img_pok.y = 95 + 160 @img_dre = Sprite.new @img_dre.ox = 160/2 @img_dre.oy = 160 @img_dre.bitmap = RPG::Cache.picture("img_dresseur") @img_dre.x = 330 + 160/2 @img_dre.y = 95 + 160 #print zoom_pok @img_pok.zoom_x = @img_pok.zoom_y = zoom_pok @img_dre.zoom_x = @img_dre.zoom_y = zoom_dre Graphics.transition end end
class Image_Pokemon attr_reader :flag_move_up attr_reader :flag_move_down def initialize (list, index = 0, tronquage = false) @viewport = Viewport.new(205, 127, 130, 226) @viewport.z = 5000 @id_list = list @pokeball = Sprite.new @pokeball.bitmap = RPG::Cache.picture("pokeball_menu.png") @pokeball.ox = 240 @pokeball.oy = 240 @pokeball.y = 240 @tronquage = tronquage refresh(index) end def refresh(index) if @image3 != nil and @image3.disposed? == false @image3.dispose end if @image2 != nil and @image2.disposed? == false @image2.dispose end if @image4 != nil and @image4.disposed? == false @image4.dispose end @image3 = Sprite.new(@viewport) if @tronquage if @id_list[index] != nil ida = sprintf("%03d", @id_list[index]) @image3.bitmap = RPG::Cache.battler("Front_Male/" + ida + ".png", 0) else @image3.bitmap = RPG::Cache.picture("inconnu") end @image3.ox = @image3.bitmap.width/2 @image3.oy = @image3.bitmap.height/2 @image3.x = @viewport.rect.width/2 @image3.y = @viewport.rect.height/2 @image3.zoom_x = 0.82 @image3.zoom_y = 0.82 #print "id list index - 1 : " + (index - 1).to_s if (index - 1) >= 0 @image2 = Sprite.new(@viewport) if @id_list[index - 1] != nil ida = sprintf("%03d", @id_list[index - 1]) @image2.bitmap = RPG::Cache.battler("Front_Male/" + ida + ".png", 0) else @image2.bitmap = RPG::Cache.picture("inconnu") end @image2.ox = @image2.bitmap.width/2 @image2.oy = @image2.bitmap.height/2 @image2.x = @viewport.rect.width/2 @image2.y = 8 #@viewport.rect.height/10 @image2.zoom_x = 0.82 @image2.zoom_y = 0.62 end if @id_list[index+1] != nil @image4 = Sprite.new(@viewport) if @id_list.include?(@id_list[index+1]) ida = sprintf("%03d", @id_list[index+1]) @image4.bitmap = RPG::Cache.battler("Front_Male/" + ida + ".png", 0) else @image4.bitmap = RPG::Cache.picture("inconnu") end @image4.ox = @image4.bitmap.width/2 @image4.oy = @image4.bitmap.height/2 @image4.x = @viewport.rect.width/2 @image4.y = @viewport.rect.height - 8 @image4.zoom_x = 0.82 @image4.zoom_y = 0.62 end @pokeball.angle = (index % 8.00) * -22.5 else if @id_list.include?(index+1) ida = sprintf("%03d", index+1) @image3.bitmap = RPG::Cache.battler("Front_Male/" + ida + ".png", 0) else @image3.bitmap = RPG::Cache.picture("inconnu") end @image3.ox = @image3.bitmap.width/2 @image3.oy = @image3.bitmap.height/2 @image3.x = @viewport.rect.width/2 @image3.y = @viewport.rect.height/2 @image3.zoom_x = 0.82 @image3.zoom_y = 0.82 if (index-1) >= 0 @image2 = Sprite.new(@viewport) if @id_list.include?(index) ida = sprintf("%03d", index) @image2.bitmap = RPG::Cache.battler("Front_Male/" + ida + ".png", 0) else @image2.bitmap = RPG::Cache.picture("inconnu") end @image2.ox = @image2.bitmap.width/2 @image2.oy = @image2.bitmap.height/2 @image2.x = @viewport.rect.width/2 @image2.y = 8 #@viewport.rect.height/10 @image2.zoom_x = 0.82 @image2.zoom_y = 0.62 end if (index+1) < @id_list[@id_list.size - 1] @image4 = Sprite.new(@viewport) if @id_list.include?(index+2) ida = sprintf("%03d", index+2) @image4.bitmap = RPG::Cache.battler("Front_Male/" + ida + ".png", 0) else @image4.bitmap = RPG::Cache.picture("inconnu") end @image4.ox = @image4.bitmap.width/2 @image4.oy = @image4.bitmap.height/2 @image4.x = @viewport.rect.width/2 @image4.y = @viewport.rect.height - 8 @image4.zoom_x = 0.82 @image4.zoom_y = 0.62 end @pokeball.angle = (index % 8.00) * -22.5 end end def dispose @image3.dispose =begin if @image2 != nil and @image2.disposed? == false @image2.dispose end if @image4 != nil and @image4.disposed? == false @image4.dispose end =end @viewport.dispose @pokeball.dispose end def update if @image2 != nil and @image2.disposed? == false @image2.update end @image3.update if @image4 != nil and @image4.disposed? == false @image4.update end if @flag_move_up update_move_up end if @flag_move_down update_move_down end end def move_up(index = @id_list[@id_list.size - 1]) @index = index @flag_move_up = true if @tronquage #print " animation tronquage move_up" if @id_list[index+1] != nil @image1 = Sprite.new(@viewport) if @id_list[index+1] != nil ida = sprintf("%03d", @id_list[index+1]) @image1.bitmap = RPG::Cache.battler("Front_Male/" + ida + ".png", 0) else @image1.bitmap = RPG::Cache.picture("inconnu") end @image1.ox = @image1.bitmap.width/2 @image1.oy = @image1.bitmap.height/2 @image1.x = @viewport.rect.width/2 @image1.y = (@viewport.rect.height - 8) + (@viewport.rect.height/2.00) - 8.00 @image1.zoom_x = 0.82 @image1.zoom_y = 0.62 end else if (index+1) < @id_list[@id_list.size - 1] @image1 = Sprite.new(@viewport) if @id_list.include?(index+2) ida = sprintf("%03d", index+2) @image1.bitmap = RPG::Cache.battler("Front_Male/" + ida + ".png", 0) else @image1.bitmap = RPG::Cache.picture("inconnu") end @image1.ox = @image1.bitmap.width/2 @image1.oy = @image1.bitmap.height/2 @image1.x = @viewport.rect.width/2 @image1.y = (@viewport.rect.height - 8) + (@viewport.rect.height/2.00) - 8.00 @image1.zoom_x = 0.82 @image1.zoom_y = 0.62 end end end def move_down(index = @id_list[@id_list.size - 1]) @flag_move_down = true @index = index if @tronquage #print " animation tronquage move_up" if (index-1) > 0 @image1 = Sprite.new(@viewport) if @id_list[index-1] != nil ida = sprintf("%03d", @id_list[index-1]) @image1.bitmap = RPG::Cache.battler("Front_Male/" + ida + ".png", 0) else @image1.bitmap = RPG::Cache.picture("inconnu") end @image1.ox = @image1.bitmap.width/2 @image1.oy = @image1.bitmap.height/2 @image1.x = @viewport.rect.width/2 @image1.y = - ((@viewport.rect.height/2.00) - 8.00) @image1.zoom_x = 0.82 @image1.zoom_y = 0.62 end else if (index) > 0 @image1 = Sprite.new(@viewport) if @id_list.include?(index) ida = sprintf("%03d", index) @image1.bitmap = RPG::Cache.battler("Front_Male/" + ida + ".png", 0) else @image1.bitmap = RPG::Cache.picture("inconnu") end @image1.ox = @image1.bitmap.width/2 @image1.oy = @image1.bitmap.height/2 @image1.x = @viewport.rect.width/2 @image1.y = - ((@viewport.rect.height/2.00) - 8.00) @image1.zoom_x = 0.82 @image1.zoom_y = 0.62 end end end def update_move_up if @image3.y != 13 #print "image 3 " + @image3.y.to_s + " zoom_y : " + @image3.zoom_y.to_s @image3.y -= ((@viewport.rect.height/2)- 8) /10 @image3.zoom_y -= 0.02 if @image2 != nil and @image2.disposed? == false #print "image 2" @image2.y -= ((@viewport.rect.height/2)- 8) /10 #@image2.zoom_y -= 2 end if @image4 != nil and @image4.disposed? == false #print "image 4" @image4.y -= ((@viewport.rect.height/2)- 8) /10 @image4.zoom_y += 0.02 end if @image1 != nil and @image1.disposed? == false #print "image 1" @image1.y -= ((@viewport.rect.height/2)- 8) /10 #@image2.zoom_y -= 2 end @pokeball.angle += -2.25 else #print "fin move" @flag_move_up = false @image3.dispose if @image2 != nil and @image2.disposed? == false @image2.dispose end if @image4 != nil and @image4.disposed? == false @image4.dispose end if @image1 != nil and @image1.disposed? == false @image1.dispose end refresh(@index) end end def update_move_down #print @image3.y if @image3.y != 213 #print "image 3 " + @image3.y.to_s + " zoom_y : " + @image3.zoom_y.to_s @image3.y += ((@viewport.rect.height/2)- 8) /10 @image3.zoom_y -= 0.02 if @image2 != nil and @image2.disposed? == false #print "image 2" @image2.y += ((@viewport.rect.height/2)- 8) /10 @image2.zoom_y += 0.02 end if @image4 != nil and @image4.disposed? == false #print "image 4" @image4.y += ((@viewport.rect.height/2)- 8) /10 #@image4.zoom_y -= 0.02 end if @image1 != nil and @image1.disposed? == false #print "image 1" @image1.y += ((@viewport.rect.height/2)- 8) /10 #@image2.zoom_y -= 2 end @pokeball.angle -= -2.25 else #print "fin move" @flag_move_down = false @image3.dispose if @image2 != nil and @image2.disposed? == false @image2.dispose end if @image4 != nil and @image4.disposed? == false @image4.dispose end if @image1 != nil and @image1.disposed? == false @image1.dispose end refresh(@index) end end
end
class Pokemon_Pokedex_Recherche def initialize(index=0, list=[], tronquage=false) @index = index @list = list @tronquage = tronquage end def main @arrire_plan = Sprite.new @arrire_plan.bitmap = RPG::Cache.picture("Menu_recherche") @window_choix = POKEMON_S::Window_Choix.new @window_choix.active = true #@window_type_rech = Window_Command.New #@window_donnee_rech = Window_Command.New @window_aide = Window_Aide.new @window_choix.aide_window = @window_aide @window_type_rech = Window_Type_Rech.new @window_type_rech.aide_window = @window_aide #Graphics.transition Graphics.transition loop do Graphics.update Input.update update if $scene != self break end end Graphics.freeze @arrire_plan.bitmap = RPG::Cache.clear @window_choix.dispose @window_type_rech.dispose @window_aide.dispose Graphics.transition Graphics.freeze end def update @window_choix.update @window_type_rech.update if @window_choix.quitte $scene = POKEMON_S::Pokemon_Pokedex.new(@index, @list, @tronquage) end if @window_choix.active == false and @window_choix.go @window_type_rech.active = true @window_type_rech.min_index = @window_type_rech.index = 3 * @window_choix.index @window_type_rech.update_cursor @window_type_rech.update_aide @window_choix.go = false end if @window_type_rech.active == false and @window_choix.active == false @window_choix.active = true end end end #=============================================================================== # ■ Window_Choix #------------------------------------------------------------------------------- # #=============================================================================== class Window_Choix < Window_Base attr_reader :aide_window attr_reader :quitte attr_reader :index attr_accessor :go def initialize(index = 0) super(-16 +8, -16, 351 + 32, 45 + 32) self.windowskin = RPG::Cache.clear self.contents = Bitmap.new(351, 45) self.contents.font.name = $fontface self.contents.font.size = 30 self.contents.font.color = Color.new(32, 32, 32) self.contents.draw_text(0+2, 3+1, 96, 39, "RECH.", 1) self.contents.draw_text(129+2 , 3+1, 96, 39, "TRI", 1) self.contents.draw_text(258+2, 3+1, 96, 39, "RETOUR", 1)
self.contents.font.color = Color.new(255, 255, 255) self.contents.draw_text(0, 3, 96, 39, "RECH.", 1) self.contents.draw_text(129 , 3, 96, 39, "TRI", 1) self.contents.draw_text(258, 3, 96, 39, "RETOUR", 1) @index = index @cursor = Sprite.new @cursor.bitmap = RPG::Cache.picture("recherce_curseur.png") @cursor.opacity = 0 @cursor.x = 8 + (129 * @index) @cursor.y = 3 @quitte = false @viewport = Viewport.new(5, 48, 369, 0) @sprite = Sprite.new(@viewport) @sprite.bitmap = Bitmap.new("Graphics/Pictures/disable.png") @go = false end def update super if self.active @cursor.opacity = 255 if Input.trigger?(Input::RIGHT) if @index < 2 $game_system.se_play($data_system.cursor_se) @index += 1 update_cursor update_aide end end if Input.trigger?(Input::LEFT) if @index > 0 $game_system.se_play($data_system.cursor_se) @index -= 1 update_cursor update_aide end end if Input.trigger?(Input::B) @quitte = true end if Input.trigger?(Input::C) case @index when 0 self.active = false @go = true when 1 self.active = false @go = true when 2 @quitte = true end end else #if @cursor.opacity != 0 # @cursor.opacity = 0 #end end end def aide_window=(aide_window) @aide_window = aide_window if self.active and @aide_window != nil update_aide end end
def update_cursor if self.active @cursor.x = 8 + (129 * @index) end end def update_aide case @index when 0 @sprite.bitmap.dispose @viewport = Viewport.new(5, 48, 369, 0) @sprite = Sprite.new(@viewport) @sprite.bitmap = Bitmap.new("Graphics/Pictures/disable.png") text = ["Recherche de certaines pokémons", "selon certaines critères"] #@window_type_rech.index = 0 when 1 @sprite.bitmap.dispose @viewport = Viewport.new(5, 48, 369, 143) @sprite = Sprite.new(@viewport) @sprite.bitmap = Bitmap.new("Graphics/Pictures/disable.png") text = ["Changer le classement du POKEDEX"] #@window_type_rech.index = 3 when 2 @sprite.bitmap.dispose @viewport = Viewport.new(5, 48, 369, 237) @sprite = Sprite.new(@viewport) @sprite.bitmap = Bitmap.new("Graphics/Pictures/disable.png") text = ["Revenir au POKEDEX"] end @aide_window.update_text(text) end alias new_dispose dispose def dispose @cursor.bitmap = RPG::Cache.clear @sprite.dispose @viewport.dispose new_dispose end end #============================================================================== # ■ Window_Type_Rech #------------------------------------------------------------------------------ # #==============================================================================
class Window_Type_Rech < Window_Base
attr_reader :aide_window attr_accessor :index attr_accessor:min_index def initialize super(5 - 16, 48 -16, 360 + 32, 237 + 32) self.windowskin = RPG::Cache.clear @critere = [0, 0, [0,0], 0] self.contents = Bitmap.new(360, 237) #draw_text self.contents.font.name = $fontface self.contents.font.size = 30 self.contents.font.color = Color.new(32, 32, 32) self.contents.draw_text(3+2, 3+1, 96, 39, "NOM.", 1) self.contents.draw_text(3+2, 51+1, 96, 39, "COUL.", 1) self.contents.draw_text(3+2, 99+1, 96, 39, "TYPE", 1) self.contents.draw_text(3+2, 147+1, 96, 39, "ORDRE", 1) self.contents.draw_text(0+2, 192+1, 102, 45, "OK", 1)
self.contents.font.color = Color.new(255, 255, 255) self.contents.draw_text(3, 3, 96, 39, "NOM.", 1) self.contents.draw_text(3, 51, 96, 39, "COUL.", 1) self.contents.draw_text(3, 99, 96, 39, "TYPE", 1) self.contents.draw_text(3, 147, 96, 39, "ORDRE", 1) self.contents.draw_text(0, 192, 102, 45, "OK", 1) self.contents.font.color = Color.new(72, 72, 72) self.contents.font.size = 45 self.contents.draw_text(114, 3-2, 249, 45, "INDIFFERENT") self.contents.draw_text(114, 51-2, 249, 45, "INDIFFERENT") self.contents.draw_text(114, 99-2, 115, 39, "AUCUN") self.contents.draw_text(243, 99-2, 115, 39, "AUCUN") self.contents.draw_text(114, 147-2, 249, 45, "MODE NUMERIQUE") #self.contents.fill_rect(114, 52, 244, 37, Color.new(248, 248, 248)) #self.contents.draw_text(114, 51-2, 249, 45, "ROUGE")
self.active = false @index = 0 @cursor = Sprite.new @cursor.x = 8 @cursor.y = 51 + (48 * @index) @cursor2 = Sprite.new @cursor2.x = 8 @cursor2.y = 51 + (48 * @index) @min_index = 0 @index_bis = 0 end def update super if @window_donnee != nil @window_donnee.update if Input.trigger?(Input::B) @window_donnee.dispose @window_donnee = nil end if Input.trigger?(Input::C) if @index == 2 @critere[2][@index_bis] = @window_donnee.index else @critere[@index] = @window_donnee.index end draw_text @window_donnee.dispose @window_donnee = nil #print @critere end
return end if self.active @cursor.opacity = 255 if Input.trigger?(Input::RIGHT) if @index == 2 and @index_bis < 1 $game_system.se_play($data_system.cursor_se) @index_bis += 1 update_cursor update_aide end end if Input.trigger?(Input::LEFT) if @index == 2 and @index_bis > 0 $game_system.se_play($data_system.cursor_se) @index_bis -= 1 update_cursor update_aide end end if Input.trigger?(Input::DOWN) if @index < 4 $game_system.se_play($data_system.cursor_se) @index += 1 update_cursor update_aide end end if Input.trigger?(Input::UP) if @index > @min_index $game_system.se_play($data_system.cursor_se) @index -= 1 update_cursor update_aide end end
if Input.trigger?(Input::B) @cursor2.bitmap = RPG::Cache.clear @cursor.bitmap = RPG::Cache.clear self.active = false end if Input.trigger?(Input::C) if @index < 4 @window_donnee = Window_Donnee_Rech.new(@index) end if @index == 4 lance_rech end end else if @cursor.opacity != 0 @cursor.opacity = 0 end end end def aide_window=(aide_window) @aide_window = aide_window if self.active and @aide_window != nil update_aide end end
def update_cursor #print "upadate cursor type rech" if self.active if @index < 4 if @index == 2 @cursor2.bitmap = RPG::Cache.clear @cursor2.bitmap = RPG::Cache.picture("e.png") @cursor2.zoom_x = 0.49#0.4859 @cursor2.y = 51 + (48 * @index) -3 @cursor2.x = 116 + 128*@index_bis
else @cursor2.bitmap = RPG::Cache.clear @cursor2.bitmap = RPG::Cache.picture("e.png") @cursor2.zoom_x = 1.00 @cursor2.y = 51 + (48 * @index) - 3 @cursor2.x = 116
end
@cursor.bitmap = RPG::Cache.clear @cursor.bitmap = RPG::Cache.picture("c.png") @cursor.y = 51 + (48 * @index) @cursor.x = 8 else @cursor2.bitmap = RPG::Cache.clear @cursor.bitmap = RPG::Cache.clear @cursor.bitmap = RPG::Cache.picture("d.png") @cursor.y = 240 @cursor.x = 5 end end end def update_aide case @index when 0 text = ["Recherche par la première lettre du nom : ", "POKEMON vus uniquement."] when 1 text = ["Recherche par la couleur", "POKEMON vus uniquement."] when 2 text = ["Recherche par le type ", "POKEMON pris uniquement."] when 3 text = ["Choisis le modede classement du POKEDEX."] when 4 text = ["Exécuter Recherche/Changement."] end #print text @aide_window.update_text(text) end
def draw_text #if self.contents.disposed? == false # self.contents.dispose #end self.contents.dispose self.contents = Bitmap.new(360, 237) self.contents.font.name = $fontface self.contents.font.size = 30 self.contents.font.color = Color.new(32, 32, 32) self.contents.draw_text(3+2, 3+1, 96, 39, "NOM.", 1) self.contents.draw_text(3+2, 51+1, 96, 39, "COUL.", 1) self.contents.draw_text(3+2, 99+1, 96, 39, "TYPE", 1) self.contents.draw_text(3+2, 147+1, 96, 39, "ORDRE", 1) self.contents.draw_text(0+2, 192+1, 102, 45, "OK", 1)
self.contents.font.color = Color.new(255, 255, 255) self.contents.draw_text(3, 3, 96, 39, "NOM.", 1) self.contents.draw_text(3, 51, 96, 39, "COUL.", 1) self.contents.draw_text(3, 99, 96, 39, "TYPE", 1) self.contents.draw_text(3, 147, 96, 39, "ORDRE", 1) self.contents.draw_text(0, 192, 102, 45, "OK", 1) self.contents.font.color = Color.new(72, 72, 72) self.contents.font.size = 45 self.contents.draw_text(114, 3-2, 249, 45, @window_donnee.amt[0][@critere[0]]) self.contents.draw_text(114, 51-2, 249, 45, @window_donnee.amt[1][@critere[1]]) self.contents.draw_text(114, 99-2, 115, 39, @window_donnee.amt[2][@critere[2][0]]) self.contents.draw_text(243, 99-2, 115, 39, @window_donnee.amt[2][@critere[2][1]]) self.contents.draw_text(114, 147-2, 249, 45, @window_donnee.amt[3][@critere[3]]) end alias new_dispose dispose def dispose @cursor.bitmap = RPG::Cache.clear @cursor2.bitmap = RPG::Cache.clear new_dispose end
def lance_rech @aide_window.update_text(["Recherche en cours...", "Veuillez patientez."]) if @min_index == 0 @list = [] if @critere[2][0] != 0 or @critere[2][1] != 0 if @critere[2][0] != 0 and @critere[2][1] != 0 for i in 1..$data_pokedex.length-1 if $data_pokedex[i][1] and (($data_pokemon[i][6][0] == @critere[2][0] or $data_pokemon[i][6][0] == @critere[2][1]) and ($data_pokemon[i][6][1] != nil and ($data_pokemon[i][6][1] == @critere[2][0] or $data_pokemon[i][6][1] == @critere[2][1]))) @list.push($data_pokemon[i]) end end else for i in 1..$data_pokedex.length-1 if $data_pokedex[i][1] and (($data_pokemon[i][6][0] == @critere[2][0] or $data_pokemon[i][6][0] == @critere[2][1]) or ($data_pokemon[i][6][1] != nil and ($data_pokemon[i][6][1] == @critere[2][0] or $data_pokemon[i][6][1] == @critere[2][1]))) @list.push($data_pokemon[i]) end end end else if @critere[3] >= 2 and @critere[3] <= 5 #print "critere tri" for i in 1..$data_pokedex.length-1 if $data_pokedex[i][1] @list.push($data_pokemon[i]) end end else #print "pokemon tout" for i in 1..$data_pokedex.length-1 if $data_pokedex[i][0] @list.push($data_pokemon[i]) end end end end if @critere[0] != 0 @amt = ["INDIFFERENT", "ABC", "DEF", "GHI", "JKL", "MNO", "PQR", "STU", "VWX", "YZ"] @i = @list.size - 1 @list_temp = [] @list.each do |i| #print i[2] @lettres = @amt[@critere[0]].scan(/./) @nom = i[0].scan(/./) if @nom[0] == @lettres[0] or @nom[0] == @lettres[1] or @nom[0] == @lettres[2] #print "retirer" + @nom.to_s @list_temp.push(i) end end @list = @list_temp.dup @list_temp.clear #print @lettres #print @nom end else @list = [] if @critere[3] >= 2 and @critere[3] <= 5 #print "critere tri" for i in 1..$data_pokedex.length-1 if $data_pokedex[i][1] @list.push($data_pokemon[i]) end end else #print "pokemon tout" for i in 1..$data_pokedex.length-1 if $data_pokedex[i][0] @list.push($data_pokemon[i]) end end end #print "pokemon tri" end @list_temp = @list.dup #print "@critere[3] : " + @list.to_s case @critere[3] when 0 @list.clear #print "@list_temp : " + @list_temp.to_s @list_temp.each do |i| @list.push($data_pokemon.index(i)) end when 1 @list_temp = @list_temp.sort do |a, b| a[0] <=> b[0] end @list.clear #print "essai : " + $data_pokemon[3][1].to_s @list_temp.each do |i| @list.push($data_pokemon.index(i)) end when 2 @list_temp = @list_temp.sort do |b, a| #print "tri : " + a[9][3].gsub(" kg"){""}.to_f.to_s a[9][3].gsub(" kg"){""}.to_f <=> b[9][3].gsub(" kg"){""}.to_f end @list.clear #print "essai : " + $data_pokemon[3][1].to_s @list_temp.each do |i| @list.push($data_pokemon.index(i)) end when 3 @list_temp = @list_temp.sort do |a, b| a[9][3].gsub(" kg"){""}.to_f <=> b[9][3].gsub(" kg"){""}.to_f end @list.clear #print "essai : " + $data_pokemon[3][1].to_s @list_temp.each do |i| @list.push($data_pokemon.index(i)) end when 4 @list_temp = @list_temp.sort do |b, a| a[9][2].gsub(" kg"){""}.to_f <=> b[9][2].gsub(" kg"){""}.to_f end @list.clear #print "essai : " + $data_pokemon[3][1].to_s @list_temp.each do |i| @list.push($data_pokemon.index(i)) end when 5 @list_temp = @list_temp.sort do |a, b| a[9][2].gsub(" kg"){""}.to_f <=> b[9][2].gsub(" kg"){""}.to_f end @list.clear #print "essai : " + $data_pokemon[3][1].to_s @list_temp.each do |i| @list.push($data_pokemon.index(i)) end end if @min_index == 0 if @list.size == 0 @aide_window.update_text(["Aucun POKEMON correspondant trouvé"]) #print "nb pokemon restant" + @list.size.to_s #print @list else @aide_window.update_text(["Recherche terminée."]) #print "nb pokemon restant" + @list.size.to_s #print @list Graphics.freeze Graphics.transition $scene = POKEMON_S::Pokemon_Pokedex.new(0, @list, true) end else #print "nb pokemon restant" + @list.size.to_s #print @list $scene = POKEMON_S::Pokemon_Pokedex.new(0, @list, true) end end end #============================================================================== # ■ Window_Donnee_Rech #------------------------------------------------------------------------------ # #==============================================================================
class Window_Donnee_Rech < Window_Command attr_reader :amt def initialize(type) @amt=[] @amt[0] = ["INDIFFERENT", "ABC", "DEF", "GHI", "JKL", "MNO", "PQR", "STU", "VWX", "YZ"] @amt[1] = ["INDIFFERENT", "ROUGE", "BLEU", "JAUNE", "VERT", "NOIR", "MARRON", "VIOLET", "GRIS", "BLANC", "ROSE"] @amt[2] = ["AUCUN", "NORMAL", "FEU", "EAU", "ELECTR", "PLANTE", "GLACE", "COMBAT", "POISON", "SOL","VOL", "PSY", "INSECT", "ROCHE", "SPECTR", "DRAGON" ,"ACIER", "TENEBR"] @amt[3] = ["MODE NUMERIQUE", "MODE A à Z", "MODE + - LOURD", "MODE + - LEGER", "MODE + - GRAND", "MODE + - PETIT"] super(270, @amt[type], 40, 1, 42) self.x = 370 self.height = 337 end end #============================================================================== # ■ Window_Aide #------------------------------------------------------------------------------ # #==============================================================================
class Window_Aide < Window_Base def initialize super(24 - 16, 348 - 16, 592 + 32, 120 + 32) self.windowskin = RPG::Cache.clear self.contents = Bitmap.new(592, 120) @text = ["", ""] end def update_text(text=["", ""]) if text == ["", ""] and text != @text self.contents.clear @text = text return end if text != @text @text = text self.contents.clear self.contents.font.name = $fontface self.contents.font.color = Color.new(72, 72, 72) self.contents.font.size = 45 self.contents.draw_text(0, 0, 592, 60, @text[0]) if @text[1] != nil self.contents.draw_text(0, 60, 592, 60, @text[1]) end end end end end
|