Code: |
#============================================================================== # ■ Pokemon_Menu # Pokemon Script Project - Krosk # 18/07/07 # Modifier par Slash le 15/07/09 #----------------------------------------------------------------------------- # Scène modifiable #----------------------------------------------------------------------------- # Menu principal accessible par échap #----------------------------------------------------------------------------- module POKEMON_S class Pokemon_Menu #-------------------------------------------------------------------------- # #-------------------------------------------------------------------------- def initialize(menu_index = 0) @menu_index = menu_index end #-------------------------------------------------------------------------- # #-------------------------------------------------------------------------- def main Graphics.freeze @z_level = 10000 @background = Sprite.new @background.bitmap = RPG::Cache.picture("Menu.PNG") @background.x = 0 @background.y = 0 @background.z = @z_level @location = Window_Location.new @location.x = 0 @location.y = 394 @location.z = @z_level + 2 @location.opacity = 0 @argent = Window_Argent.new @argent.x = 480 @argent.y = 424 @argent.z = @z_level + 2 @argent.opacity = 0 @pokemon = Window_Pokemon.new @pokemon.x = -2 @pokemon.y = 0 @pokemon.z = @z_level + 2 @pokemon.opacity = 0 @spriteset = Spriteset_Map.new s1 = " POKéDEX" s2 = " POKéMON" s3 = " SAC" s4 = " " + Player.name s5 = " SAUVER" s6 = " QUITTER" @command_window = Window_Command.new(180, [s1, s2, s3, s4, s5, s6]) @command_window.index = @menu_index @command_window.x = 467 - 3 @command_window.y = 105 @command_window.z = @z_level + 2 @command_window.opacity = 0 if $pokemon_party.size == 0 # Enlève accès Equipe @command_window.disable_item(1) end if not($data_pokedex[0]) # Enlève accès Pokédex si non possédé @command_window.disable_item(0) end if $game_system.save_disabled @command_window.disable_item(4) end Graphics.transition loop do Graphics.update Input.update update if $scene != self break end end Graphics.freeze @pokemon.dispose @location.dispose @argent.dispose @command_window.dispose @background.dispose @spriteset.dispose end #-------------------------------------------------------------------------- # #-------------------------------------------------------------------------- def update # ウィンドウを更新 @command_window.update @spriteset.update # コマンドウィンドウがアクティブの場合: update_command を呼ぶ if @command_window.active update_command return end end #-------------------------------------------------------------------------- # ● フレーム更新 (コマンドウィンドウがアクティブの場合) #-------------------------------------------------------------------------- def update_command # B ボタンが押された場合 if Input.trigger?(Input::B) # キャンセル SE を演奏 $game_system.se_play($data_system.cancel_se) # マップ画面に切り替え $scene = Scene_Map.new return end # C ボタンが押された場合 if Input.trigger?(Input::C) # パーティ人数が 0 人で、セーブ、ゲーム終了以外のコマンドの場合 if $game_party.actors.size == 0 and @command_window.index < 4 # ブザー SE を演奏 $game_system.se_play($data_system.buzzer_se) return end # コマンドウィンドウのカーソル位置で分岐 case @command_window.index when 0 # Pokédex if not($data_pokedex[0]) $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.decision_se) $scene = POKEMON_S::Pokemon_Pokedex.new when 1 # Menu if $pokemon_party.size == 0 $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.decision_se) $scene = POKEMON_S::Pokemon_Party_Menu.new when 2 # Sac $game_system.se_play($data_system.decision_se) $scene = Pokemon_Item_Bag.new when 3 # Carte dresseur $game_system.se_play($data_system.decision_se) $game_temp.common_event_id = 19 $scene = Scene_Map.new when 4 # Sauvegarde if $game_system.save_disabled $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.decision_se) $scene = POKEMON_S::Pokemon_Save.new when 5 # Quitter le menu $game_system.se_play($data_system.decision_se) $scene = Scene_Map.new end return end end end end #=================================================== #Window_Location #=================================================== class Window_Location < Window_Base #-------------------------------------------------------------------------- def initialize super(0, 0, 160, 96) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.name = $fontface self.contents.font.size = $fontsize refresh end #-------------------------------------------------------------------------- def refresh self.contents.clear self.contents.font.color = normal_color self.contents.draw_text(4, 32, 120, 32,$data_mapzone[$game_map.map_id][1], 2) end end #=================================================== #Window_Argent #=================================================== class Window_Argent < Window_Base #-------------------------------------------------------------------------- def initialize super(0, 0, 160, 64) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.name = $fontface self.contents.font.size = $fontsize refresh end #-------------------------------------------------------------------------- def refresh self.contents.clear cx = contents.text_size($data_system.words.gold).width self.contents.font.color = normal_color self.contents.draw_text(4, 0, 120-cx-2, 32, $pokemon_party.money.to_s + "$", 2) end end #=================================================== #Window_Pokémon #=================================================== class Window_Pokemon < Window_Base #-------------------------------------------------------------------------- def initialize super(0, 0, 470, 480) self.contents = Bitmap.new(width - 0, height - 0) self.contents.font.name = $fontface self.contents.font.size = $fontsize refresh end #-------------------------------------------------------------------------- def refresh if $pokemon_party.size > 0 @order = [0,1,2,3,4,5] self.contents.clear cx = contents.text_size($data_system.words.gold).width self.contents.font.color = normal_color src_rect = Rect.new(0, 10, 64, 64) for i in 0..($pokemon_party.size - 1) @pokemon = $pokemon_party.actors[@order[i]] if i < 3 if @pokemon.egg self.contents.draw_text(56,64 + (i*106) , 120, 32,@pokemon.given_name ) else self.contents.draw_text(56,64 + (i*106) , 120, 32,@pokemon.given_name ) self.contents.draw_text(62,95 + (i*106) , 120, 32,"Nv " + @pokemon.level.to_s ) draw_gender(149, 99 + (i*106), @pokemon.gender) end bitmap = RPG::Cache.battler(@pokemon.icon, 0) self.contents.blt(-8, 67 + (i*107), bitmap, src_rect, 255) else if @pokemon.egg self.contents.draw_text(283,64 + ((i-3)*106) , 120, 32,@pokemon.given_name ) else self.contents.draw_text(283,64 + ((i-3)*106) , 120, 32,@pokemon.given_name ) self.contents.draw_text(289,95 + ((i-3)*106) , 120, 32,"Nv " + @pokemon.level.to_s ) draw_gender(376, 99 + ((i-3)*106), @pokemon.gender) end bitmap = RPG::Cache.battler(@pokemon.icon, 0) self.contents.blt(219, 67 + ((i-3)*107), bitmap, src_rect, 255) end end return end end def draw_gender(x, y, gender) if gender == 1 rect = Rect.new(0, 0, 18, 33) bitmap = RPG::Cache.picture("Maleb.png") self.contents.blt(x, y, bitmap, rect, 255) end if gender == 2 rect = Rect.new(0, 0, 18, 33) bitmap = RPG::Cache.picture("Femaleb.png") self.contents.blt(x, y, bitmap, rect, 255) end end end |
Sphinx a écrit: |
joli ! Mais si il n'y a pas 6 pokés, ca fait des emplacements vides ^o^ |
Aten974 a écrit: |
@Sphinx => Avec 6 images et 6 conditions c'est bon, non ? |
Aten974 a écrit: |
J'aime bien le rendu =D @Sphinx => Avec 6 images et 6 conditions c'est bon, non ? |
happy man 2 a écrit: |
oui mais il y a un pb au script scene_map ligne 43 :( please aidez moi !!! :( |
happy man 2 a écrit: |
oui mais il y a un pb au script scene_map ligne 43 :( please aidez moi !!! :( |
happy man 2 a écrit: |
oui mais il y a un pb au script scene_map ligne 43 :( please aidez moi !!! :( |
-Antooinne a écrit: |
Moi il dise qu'il a une erreur sur la ligne 37 Solfay Comment Ta Fait Pour Q'uil Marche ? |
Sphinx a écrit: |
alors ton bug est plus qu'insoluble... Une ligne de commentaire ne peut pas causer de bug :? Elle est ignorée lorsque le script est exécuté. Elle n'existe pas, donc elle ne peut pas bugger... |
Newtiteuf a écrit: |
:shock: ... c'est flashy tout de même ! |
Ace Attorney Man a écrit: |
Quentin, tu as enlevé le saut de ligne dans ton script, c'est peut-être ça le problème... Sphinx (pour éviter de reposter +/- inutilement) : ^o^ en effet, c'est bien ca. Mais ce n'est pas grave, n'allez pas vous tracasser pour ca Pour en revenir à ton pb, comme Ace l'a compris, je pense qu'il manque un # au tout début de ta ligne n°1. Ceci explique sans aucun doute l'erreur de syntaxe. |