Aventurier Lv.16
Age : 40 Inscrit le : 03/09/2009 Messages : 1503
| Sujet: Problème de compatilité entre deux scripts Mar 23 Mar 2010 - 12:03 | |
| Bonjour. Voilà j'utilise le système de sauvegarde FFIX - Spoiler:
- Code:
-
=begin BigEd781's Final Fantasy IX Save Screen
Rewritten Methods ----------------- Scene_File write_save_data create_savefile_windows start ----------------- =end module FFIXSave
# use an image instead of the hazy map background USE_CUSTOM_BACK = true # the name of the background image file (if above is set to 'true') BACK_NAME = 'StoneBackground' # the name of the 'time' image file TIMER_NAME = 'SaveTimer' # the name of the 'gold' image file GOLDCOIN_NAME = 'GoldCoin' # the font to use. Example: 'Times New Roman' FONT_NAME = Font.default_name FONT_SIZE = 20 # Use character sprites instead of faces USE_CHARAS = false # the color of the font. (red, green, blue) FONT_COLOR = Color.new(238, 238, 238) # changing this will move the timer and gold # icons left or right (for - or + values). # this is useful if you have long names, or use a smaller font. ICON_OFFSET_X = 0
end
class Rect
def shift_y(value) new_y = self.y + value return Rect.new(self.x, new_y, self.width, self.height) end
end #============================================================================== # ** Sprite_HeaderBar #------------------------------------------------------------------------------ # This is the top right window in the save/load menu #============================================================================== class Sprite_LoadSave < Sprite_Base
def initialize(x, y, text, viewport=nil) super(viewport) @bg_image = Cache.picture('LoadSaveDisplay') @text = text self.bitmap = Bitmap.new(@bg_image.width, @bg_image.height) self.x = x self.y = y update end
def update self.bitmap.blt(0, 0, @bg_image, @bg_image.rect) self.bitmap.draw_text(self.bitmap.rect.shift_y(3), @text, 1) end
end #============================================================================== # ** Sprite_HeaderBar #------------------------------------------------------------------------------ # This is the top left window in the save/load menu #============================================================================== class Sprite_HeaderBar < Sprite_Base #-------------------------------------------------------------------------- # * initialize #-------------------------------------------------------------------------- def initialize(viewport=nil) @image = Cache.picture('FF9_HeaderBar') @slot = 1 super(viewport) self.bitmap = Bitmap.new(@image.width, @image.height) self.x = 16 self.y = 18 update end #-------------------------------------------------------------------------- # * slot= #-------------------------------------------------------------------------- def slot=(value) @slot = value end #-------------------------------------------------------------------------- # * update #-------------------------------------------------------------------------- def update self.bitmap.blt(0, 0, @image, @image.rect) text_y = 10 text_h = 24 self.bitmap.draw_text(16, text_y, 220, text_h, "Select a block.") self.bitmap.draw_text(self.width - 72, text_y, 64, text_h, "Slot #{@slot}") end
end #============================================================================== # ** Scene_File #------------------------------------------------------------------------------ # #============================================================================== class Scene_File < Scene_Base
#-------------------------------------------------------------------------- # * Start processing #-------------------------------------------------------------------------- alias :eds_pre_ff9_save_start :start def start super create_menu_background @help_window = Sprite_HeaderBar.new create_loadsave_sprite create_savefile_windows @index = @saving ? $game_temp.last_file_index : self.latest_file_index @savefile_windows[@index].selected = true end #-------------------------------------------------------------------------- # * create_menu_background (only if USE_CUSTOM_BACK == true) #-------------------------------------------------------------------------- if FFIXSave::USE_CUSTOM_BACK def create_menu_background @menuback_sprite = Sprite.new @menuback_sprite.bitmap = Cache.picture(FFIXSave::BACK_NAME) @menuback_sprite.color.set(16, 16, 16, 128) update_menu_background end end #-------------------------------------------------------------------------- # * create_loadsave_sprite #-------------------------------------------------------------------------- def create_loadsave_sprite sx = @help_window.x + @help_window.width + 6 sy = @help_window.y text = @saving ? "Save" : "Load" @loadsave_sprite = Sprite_LoadSave.new(sx, sy, text) end #-------------------------------------------------------------------------- # * Update Save File Selection #-------------------------------------------------------------------------- alias :eds_pre_ff9_save_update_savefile_selection :update_savefile_selection def update_savefile_selection eds_pre_ff9_save_update_savefile_selection @help_window.slot = @index + 1 end #-------------------------------------------------------------------------- # * write_save_data #-------------------------------------------------------------------------- def write_save_data(file) characters = [] map_name = load_data("Data/MapInfos.rvdata")[$game_map.map_id].name for actor in $game_party.members characters.push([ actor.character_name, actor.character_index, actor.face_name, # line added actor.face_index, # line added actor.name, # line added actor.level, # line added $game_party.gold, # line added map_name ]) # line added end $game_system.save_count += 1 $game_system.version_id = $data_system.version_id @last_bgm = RPG::BGM::last @last_bgs = RPG::BGS::last Marshal.dump(characters, file) Marshal.dump(Graphics.frame_count, file) Marshal.dump(@last_bgm, file) Marshal.dump(@last_bgs, file) Marshal.dump($game_system, file) Marshal.dump($game_message, file) Marshal.dump($game_switches, file) Marshal.dump($game_variables, file) Marshal.dump($game_self_switches, file) Marshal.dump($game_actors, file) Marshal.dump($game_party, file) Marshal.dump($game_troop, file) Marshal.dump($game_map, file) Marshal.dump($game_player, file) end #-------------------------------------------------------------------------- # * Create Save File Window #-------------------------------------------------------------------------- def create_savefile_windows @savefile_windows = [] for i in 0..3 @savefile_windows.push(Window_FFIXSaveFile.new(i, make_filename(i))) end @item_max = 4 end
alias :eds_pre_ff9_terminate :terminate def terminate eds_pre_ff9_terminate @loadsave_sprite.dispose end
end #============================================================================== # ** Window_FFIXSaveFile #------------------------------------------------------------------------------ # This is the window displayed for each save slot #============================================================================== class Window_FFIXSaveFile < Window_SaveFile
# the x , y position of the first column and line of text TEXT_COL1_X = 298 TEXT_LINE1_Y = 0 # the y position of the second line of text, Level and Gold display TEXT_LINE2_Y = 20 #-------------------------------------------------------------------------- # * initialize #-------------------------------------------------------------------------- def initialize(file_index, filename) unless FileTest.exist?(filename) image_name = 'FF9_SaveFileWindow_no_overlay' else image_name = 'FF9_SaveFileWindow' end @bg_image = Cache.picture(image_name) @timer_image = Cache.picture(FFIXSave::TIMER_NAME) @gold_image = Cache.picture(FFIXSave::GOLDCOIN_NAME) super(file_index, filename) self.x = 0 self.height = @bg_image.height + 32 # do this so that they images can be close together, # ignoring the 16 pixel window border self.y -= self.y * 0.1 self.contents.dispose self.contents = Bitmap.new(512, @bg_image.height) self.contents.font.name = FFIXSave::FONT_NAME self.contents.font.size = FFIXSave::FONT_SIZE self.opacity = 0 @arrow_sprite = Sprite.new @arrow_sprite.bitmap = Cache.picture('pointer') @arrow_sprite.x = 0 @arrow_sprite.y = self.y + (0.4 * self.height) @arrow_sprite.visible = false @arrow_sprite.z = self.z + 1 refresh end
def selected=(value) @arrow_sprite.visible = value end #-------------------------------------------------------------------------- # * refresh #-------------------------------------------------------------------------- def refresh self.contents.clear self.contents.font.color = FFIXSave::FONT_COLOR draw_background_panel begin if @file_exist if FFIXSave::USE_CHARAS draw_party_characters(64, self.height / 2) else draw_party_characters end draw_playtime draw_leader_name draw_leader_level draw_gold draw_location draw_icons end rescue # do nothing or the game will crash # before the first save file is created. end end #-------------------------------------------------------------------------- # * draw_background_panel #-------------------------------------------------------------------------- def draw_background_panel self.contents.blt(0, 0, @bg_image, @bg_image.rect) end
unless FFIXSave::USE_CHARAS
#-------------------------------------------------------------------------- # * draw_party_characters #-------------------------------------------------------------------------- def draw_party_characters x, y, size = 5, 5, (self.contents.height - 10) for i in 0...@characters.size name = @characters[i][2] index = @characters[i][3] draw_face(name, index, x, y, size) x += size + 2 end end
end #-------------------------------------------------------------------------- # * draw_playtime #-------------------------------------------------------------------------- def draw_playtime hour = @total_sec / 60 / 60 min = @total_sec / 60 % 60 sec = @total_sec % 60 time_string = sprintf("%02d:%02d:%02d", hour, min, sec) len = contents.text_size(time_string).width + 6 contents.font.color = FFIXSave::FONT_COLOR contents.draw_text(contents.width - len, TEXT_LINE1_Y, contents.width - 4, WLH, time_string) end #-------------------------------------------------------------------------- # * draw_leader_name #-------------------------------------------------------------------------- def draw_leader_name name = @characters[0][4] self.contents.draw_text(TEXT_COL1_X, TEXT_LINE1_Y, 128, WLH, name) end #-------------------------------------------------------------------------- # * draw_leader_level #-------------------------------------------------------------------------- def draw_leader_level level = "Level #{@characters[0][5]}" self.contents.draw_text(TEXT_COL1_X, TEXT_LINE2_Y, 128, WLH, level) end #-------------------------------------------------------------------------- # * draw_gold #-------------------------------------------------------------------------- def draw_gold gold = "#{@characters[0][6]} #{Vocab.gold[0,1]}" text_x = contents.width - (contents.text_size(gold).width + 6) self.contents.draw_text(text_x, TEXT_LINE2_Y, 96, WLH, gold) end #-------------------------------------------------------------------------- # * draw_location #-------------------------------------------------------------------------- def draw_location loc = @characters[0][7] text_y = TEXT_LINE2_Y + 28 self.contents.draw_text(308, text_y, contents.width - 312, WLH, loc) end #-------------------------------------------------------------------------- # * draw_icons #-------------------------------------------------------------------------- def draw_icons self.contents.blt(TEXT_COL1_X + 93 + FFIXSave::ICON_OFFSET_X, TEXT_LINE1_Y + 7, @timer_image, @timer_image.rect) self.contents.blt(TEXT_COL1_X + 93 + FFIXSave::ICON_OFFSET_X, TEXT_LINE2_Y + 7, @gold_image, @gold_image.rect) end #-------------------------------------------------------------------------- # * update_cursor #-------------------------------------------------------------------------- def update_cursor # not needed end #-------------------------------------------------------------------------- # * dispose #-------------------------------------------------------------------------- def dispose super @bg_image.dispose @timer_image.dispose @arrow_sprite.dispose end
end
Et le Dinamic bestiary V 1 de Falcao - Spoiler:
- Code:
-
#====================================================================# # #*****************# Dinamic bestiary V 1 Falcao script # # #*** By Falcao ***# Permite mostrar un albun de cada # # #*****************# mostruo que derrotas V 1.5 # # RMVX # # makerpalace.onlinegoo.com Date: 10/29/2009 # #====================================================================#
#--------------------------------------------------------------------- # * Instructions # # Solo copiar y pegar el script encima de main luego llamarlo con # tecla 'A' puesta por defecto. Editar el modulo de abajo a su gusto # # Place the script above main, then call it with key 'A' by deafault # Edit the module below as you prefer. # # License: Puede ser usado en juegos comerciales o no comerciales # This script can be used in comercial or non-comercial games #---------------------------------------------------------------------
module Falcao
# Descripcion Para cada enemigo / Enemy desciption # A = Id del enemigo / Enemy ID # B = Description Description = {
1=> 'Monstre de forme amusante', 2=> 'Se mata facilmente con un ataque normal, es devil al elemento agua', 3=> 'Habita en el bosque shulton, devil al elemento fuego', 4=> 'Ponsoñosa araña que habita dentro de cuevas, si pica tomar antidoto', 5=> 'Rata escurridiza, suele dejar buena experiencia', 21=> 'Habita alrededor del castillo tridan, devil a luz', }
# Tecla que llama el script / Key to call script # Puesdes elejir entre las siguientes / choose between the followings keys # Z, A, S, D, Q, W, ALT TeclaBestiary = 'A'
# Interruptor que desabilita llamar el script con la tecla especificada # Disable script call by input key KeyDisable_Switch = 100
# Tocar musica / play music (true o false) PlayMusic = true
# Declaracion de arrays / Arrays declaration $derrotados = [] $enemy_counter = [] EnemyLevel = []
# Vocabulario / Vocabulary FalVocab = ['-No hay datos-', # No datos / No data 'Bultin', # Tesoro 1 / Treasure 1 'Bultin rare', # tesoro 2 / Treasure 2 'None', # Sin tesoro / No treasure '????', # Enemigo no derrotado / Enemy no defeated 'Bestiary', # Titulo / Title 'Battu', # Derrotado / defeated 'Rang', # Clase de enemigo / enemy class 'Puissance', # Energia maxima / Power 'Des fois', # Veces derrotado / times defeated 'Progression'] # Progreso / Progress
# Clases de enemigos / enemy classes # Calculos basados en parametros / Values based on parameters(Def, atk, etc.) EnemyLevel[1] = "Très faible" EnemyLevel[2] = "Amateaur" EnemyLevel[3] = "King master" EnemyLevel[4] = "Boss fighter" EnemyLevel[5] = "Master boss"
#----------------------------------------------------------------------------- # Cuando un enemigo es derrotado es automaticamente agregado al invetario pero # puedes administrarlos manualmente con los siguientes comandos
# When you defeat an enemy automaticly is added, but you can add or remove # enemies manualy with the following comands
# Falcao.add_enemy(X) Agrega enemigo X, en ves de X poner ID de enemigo # Add enemy X, instead X put enemy ID # # Falcao.remove_enemy(X) remueve enemigo X, En ves de X poner ID de enemigo # Remove Enemy X, Instead X put enemy ID # # Falcao.fill_bestiary Agrega todos los monstruos al bestiario # Fill bestiary # # Para llamar el script manualmente llamarlo directamente asi # To call the script manually call it # # $scene = Scene_Monsters.new # # * Creditos: # # script creado por Falcao, puede ser publicado en cualquier foro siempre # y cuando los creditos sean mencionados #-----------------------------------------------------------------------------
def self.fill_bestiary for enemy in $data_enemies next if enemy == nil unless $derrotados.include?(enemy.id) $derrotados.push(enemy.id) $enemy_counter.push(enemy.id) end end end def self.add_enemy(id) unless $derrotados.include?(id) $derrotados.push(id) $enemy_counter.push(id) end end def self.remove_enemy(id) if $derrotados.include?(id) $derrotados.delete(id) $enemy_counter.push(id) end end end
#-------------------------------------------------------------------------- # * Créer une information générale et des paramètres ennemis #-------------------------------------------------------------------------- class Moster_Info < Window_Base include Falcao def initialize(x, y) super(x, y, 385, 380) self.opacity = 0 end def refresh(enemy_id) self.contents.clear @enemigo = $data_enemies[enemy_id] if $derrotados.include?(@enemigo.id) contents.font.size = 20 draw_enemy_hp(0, 205) draw_enemy_mp(0, 230) enemy_parametros draw_drop_item1 draw_drop_item2 else contents.font.size = 30 contents.draw_text(100, 100, 500, 92, FalVocab[0]) end end def enemy_parametros y1 = 0; y2 = 0; y3 = 0; y4 = 0 terms = $data_system.terms param1={1=>@enemigo.maxhp,2=>@enemigo.maxmp,3=>@enemigo.spi,4=>@enemigo.exp} name1 = {1=> terms.hp, 2=> terms.mp, 3=> terms.spi, 4=> "Exp"} param2={1=>@enemigo.atk,2=>@enemigo.def,3=>@enemigo.agi,4=> @enemigo.gold} name2 = {1=> terms.atk, 2=> terms.def, 3=> terms.agi, 4=> terms.gold} param1.sort.each do |keys, values| y1 += 25 contents.draw_text(100, y1 + 134, 92, 92, values) end param2.sort.each do |keys, values| y2 += 25 contents.draw_text(300, y2 + 134, 92, 92, values) end name1.sort.each do |keys, values| y3 += 25 contents.draw_text(0, y3 + 134, 102, 92, values) end name2.sort.each do |keys, values| y4 += 25 contents.draw_text(200, y4 + 134, 102, 92, values) end end def draw_drop_item1 item = @enemigo.drop_item1 contents.draw_text(35, 260, 92, 92, FalVocab[1]) if item.kind == 0 contents.draw_text(0, 284, 92, 92, FalVocab[3]) return end case item.kind when 1; drop_item = $data_items[item.item_id] when 2; drop_item = $data_weapons[item.item_id] when 3; drop_item = $data_armors[item.armor_id] end draw_icon(drop_item.icon_index,94, 318) contents.draw_text(0, 284, 92, 92, drop_item.name) end def draw_drop_item2 item = @enemigo.drop_item2 contents.draw_text(226, 260, 92, 92, FalVocab[2]) if item.kind == 0 contents.draw_text(200, 284, 92, 92, FalVocab[3]) return end case item.kind when 1; drop_item = $data_items[item.item_id] when 2; drop_item = $data_weapons[item.item_id] when 3; drop_item = $data_armors[item.armor_id] end draw_icon(drop_item.icon_index,300, 318) contents.draw_text(200, 284, 92, 92, drop_item.name) end def draw_enemy_hp(x, y) self.contents.fill_rect(x, y, 102, 10, Color.new(0,0,0)) self.contents.fill_rect(x+1, y+1, 100*@enemigo.maxhp/@enemigo.maxhp, 4, Color.new(205,255,205)) self.contents.fill_rect(x+1, y+5, 100*@enemigo.maxhp/@enemigo.maxhp, 4, Color.new(10,220,45)) end def draw_enemy_mp(x, y) if @enemigo.maxmp != 0 self.contents.fill_rect(x, y, 102, 10, Color.new(0,0,0)) self.contents.fill_rect(x+1, y+1, 100*@enemigo.maxmp/@enemigo.maxmp, 4, Color.new(180,225,245)) self.contents.fill_rect(x+1, y+5, 100*@enemigo.maxmp/@enemigo.maxmp, 4, Color.new(20,160,225)) else self.contents.fill_rect(x, y, 102, 10, Color.new(0,0,0)) end end end
#-------------------------------------------------------------------------- # * Un objet créateur des descriptions et du progrès dans un pourcentage #-------------------------------------------------------------------------- class Moster_Description < Window_Base include Falcao def initialize(x, y, ancho = 544, alto = 56) super(x, y, ancho, alto) @tiempo = 0 @scroll = 0 end def set_texto(texto) self.contents.clear self.contents.draw_text(0, -4, 92, 32, texto) for i in 0...$derrotados.size number = i + 1 end texto2 = "#{FalVocab[10]} #{number * 100/$all_mosnters}%" rescue texto2 = "#{FalVocab[10]} 0 %" self.contents.draw_text(0, 24, self.width, 32, texto2) end def refresh(enemy_id) self.contents.clear @enemigo = $data_enemies[enemy_id] if $derrotados.include?(@enemigo.id) draw_descriptions else self.contents.draw_text(-130, -4, 600, 32 , FalVocab[0],1) end end def draw_descriptions if Description.has_key?(@enemigo.id) Description.each do |id, value| if id == @enemigo.id cx = contents.text_size(value).width scroll_text(value) self.contents.draw_text(@scroll, -4, cx + 10, 32 , value) end end else text = [" ", " ", "Description no available ", "Falcao script Bestiary V 1.5 " ] scroll_text(text,false) cx = contents.text_size(text).width self.contents.draw_text(@scroll, -4, cx + 10, 32, text ) end end def scroll_text(texto, result_ok=true) cx = contents.text_size(texto).width if cx > 350 @tiempo += 1 if @tiempo > 60 @scroll -= 1 if @result == nil if @scroll == -cx @result = true end end end if @result result_ok ? @scroll += 10 : @scroll = 0 if @scroll >= 0 @scroll = 0; @tiempo = 0 @result = nil end end if Input.press?(Input::UP) or Input.press?(Input::DOWN) @scroll = 0; @tiempo = 0; @result = nil end end end
#-------------------------------------------------------------------------- # * L'objet qui dessine l'indice des ennemis avec son nom(nombre) #-------------------------------------------------------------------------- class Monster_indice < Window_Selectable def initialize(y) super(0, y, 160, 334) @column_max = 1 refresh self.index = 0 end def refresh if self.contents != nil self.contents.dispose self.contents = nil end @data = [] for i in 1...$data_enemies.size @data.push($data_enemies[i]) end @item_max = @data.size if @item_max > 0 self.contents = Bitmap.new(width - 32, row_max * 26) for i in 0...@item_max draw_item(i) $all_mosnters = i + 1 end end end def draw_item(index) enemy = @data[index] self.contents.font.color = normal_color x, y = 4, index * 24 rect = Rect.new(x, y, self.width / @column_max - 32, 32) self.contents.fill_rect(rect, Color.new(0, 0, 0, 0)) opacity = self.contents.font.color == normal_color ? 255 : 128 if $derrotados.include?(index+1) contents.draw_text(x, y, 212, 24, enemy.name) else contents.draw_text(x, y, 212, 24, Falcao::FalVocab[4]) end end end
#-------------------------------------------------------------------------- # * L'objet que le Power et l'estimation dessine de monstres battus #-------------------------------------------------------------------------- class Adicional_Data < Window_Base include Falcao attr_accessor :number attr_accessor :counter def initialize super(0, 0, 160, 334) @number = 0.0 @counter = 0.0 @color = [Color.new(180,225,245), Color.new(20,160,225)] end def refresh(enemy_id) self.contents.clear @enemigo = $data_enemies[enemy_id] if $derrotados.include?(@enemigo.id) draw_enemy_counter draw_enemy_power(0,186) contents.font.color = Color.new(255, 140, 0) contents.draw_text(30, 0, 212, 24, @enemigo.name) else contents.font.color = normal_color self.contents.draw_text(2, 50, 600, 32 , FalVocab[0]) end end def draw_enemy_counter i = 0 for c in $enemy_counter if c == @enemigo.id i += 1 number = i end end contents.font.color = normal_color contents.draw_text(0, 40, 212, 24, FalVocab[6]) contents.draw_text(80, 70, 212, 24, number.to_s) contents.draw_text(0, 70, 212, 24, FalVocab[9]) end def get_power(enemy) add = 0 number1 = enemy.spi + enemy.agi number2 = enemy.atk + enemy.def case enemy.maxhp when 1...400 add = 60 when 400...1000 add = 100 when 1000...10000 add = 140 when 10000...999999 add = 200 end @number = number1 + number2 + add @counter = @number @number = 1 end def draw_enemy_power(x,y) case @counter when 1...150 value = 150; add = 1; level = EnemyLevel[1] @color = [Color.new(180,225,245), Color.new(20,160,225)] when 150...350 value = 350; add = 3; level = EnemyLevel[2] @color = [Color.new(255, 120, 0), Color.new(255, 80, 50)] when 350...600 value = 600; add = 6; level = EnemyLevel[3] @color = [Color.new(205,255,205), Color.new(10,220,45)] when 600...1000 value = 1000; add = 10; level = EnemyLevel[4] @color = [Color.new(255,255,100), Color.new(255,200,0) ] when 1000...4196 value = 3996; add = 20; level = EnemyLevel[5] @color = [Color.new(255,255,100), Color.new(255,200,0) ] end @number = @counter if @number >= @counter @number += add if @number < @counter contents.font.color = Color.new(255, 140, 0) contents.draw_text(30, 120, 212, 24, FalVocab[7]) contents.font.color = normal_color contents.draw_text(0, 150, 212, 24, level) self.contents.fill_rect(x, y, 128, 14, Color.new(0,0,0)) self.contents.fill_rect(x+1, y+1, 126*@number/value, 6, @color[0]) self.contents.fill_rect(x+1, y+7, 126*@number/value, 6, @color[1]) contents.draw_text(0, 210, 212, 24, FalVocab[8]) contents.draw_text(80, 210, 212, 24, @number.to_s) end end
#-------------------------------------------------------------------------- # * Clase que agrega los enemigos al bestiario automaticamente #-------------------------------------------------------------------------- class Game_Enemy < Game_Battler alias falcao_collapse perform_collapse def perform_collapse falcao_collapse unless $derrotados.include?(enemy.id) $derrotados.push(enemy.id) end if $game_temp.in_battle and dead? $enemy_counter.push(enemy.id) end end end
#-------------------------------------------------------------------------- # * Clase que define la fuente del bestiario #-------------------------------------------------------------------------- class Font alias falcaoBest_font initialize def initialize falcaoBest_font if $scene.is_a?(Scene_Monsters) self.name = "Georgia" self.size = 20 end end end
#-------------------------------------------------------------------------- # * Ici on crée le scene qui organise tout dans l'ensemble #-------------------------------------------------------------------------- class Scene_Monsters < Scene_Base def start super @spriteset = Spriteset_Bestiary.new @mostruos_index = Monster_indice.new(84) @info_mosters = Moster_Info.new(160,56) @help = Moster_Description.new(160,0, 386) @title = Moster_Description.new(0,0, 160, 84) @title.set_texto(Falcao::FalVocab[5]) @info_mosters.refresh(@mostruos_index.index + 1) @help.refresh(@mostruos_index.index + 1) @extra_data = Adicional_Data.new @extra_data.y = 84 @extra_data.visible = false @moster_graphic = Sprite.new @moster_graphic.bitmap = Cache.battler("",0) @moster_graphic.z = 99 @moster_graphic.y = 65 @time = 0 if Falcao::PlayMusic $game_temp.map_bgm = RPG::BGM.last $game_temp.map_bgs = RPG::BGS.last $game_system.battle_bgm.play end create_enemy_graphics end def terminate super @mostruos_index.dispose @info_mosters.dispose @help.dispose @spriteset.dispose @title.dispose @moster_graphic.dispose end def update super @spriteset.update @mostruos_index.update @help.refresh(@mostruos_index.index + 1) animate_graphic if Input.press?(Input::DOWN) or Input.press?(Input::UP) @info_mosters.refresh(@mostruos_index.index + 1) create_enemy_graphics if @extra_data.visible @extra_data.get_power($data_enemies[@mostruos_index.index + 1]) end end if Input.trigger?(Input::C) and @extra_data.visible == false Sound.play_decision @extra_data.get_power($data_enemies[@mostruos_index.index + 1]) @extra_data.refresh(@mostruos_index.index + 1) @extra_data.visible = true @mostruos_index.y = 600 end if @extra_data.visible if @extra_data.number < @extra_data.counter @extra_data.refresh(@mostruos_index.index + 1) end end if Input.trigger?(Input::B) if @extra_data.visible Sound.play_cancel @extra_data.visible = false @mostruos_index.y = 84 else Sound.play_cancel if Falcao::PlayMusic $game_temp.map_bgm.play $game_temp.map_bgs.play end $scene = Scene_Map.new end end end def create_enemy_graphics enemy = $data_enemies[@mostruos_index.index + 1] if $derrotados.include?(enemy.id) @moster_graphic.bitmap = Cache.battler(enemy.battler_name, enemy.battler_hue) cw = @moster_graphic.width @moster_graphic.x = 360 - cw / 2 @moster_graphic.visible = true else @moster_graphic.visible = false end end def animate_graphic if Input.trigger?(Input::UP) or Input.trigger?(Input::DOWN) @moster_graphic.zoom_x = 1 @moster_graphic.zoom_y = 1 @time = 0 end h = 240; @time += 1 if @time < 40 if @moster_graphic.height <= h @moster_graphic.zoom_x += 0.002 @moster_graphic.zoom_y += 0.002 elsif @moster_graphic.height > h @moster_graphic.zoom_x += 0.001 @moster_graphic.zoom_y += 0.001 end elsif @time > 40 if @moster_graphic.height <= h @moster_graphic.zoom_x -= 0.002 @moster_graphic.zoom_y -= 0.002 elsif @moster_graphic.height > h @moster_graphic.zoom_x -= 0.001 @moster_graphic.zoom_y -= 0.001 end if @time == 80 @moster_graphic.zoom_x = 1 @moster_graphic.zoom_y = 1 @time = 0 end end end end
#-------------------------------------------------------------------------- # * L'objet qui définit la touche pour accéder au bestaire #-------------------------------------------------------------------------- class Scene_Map alias falcao_bestiary_update update def update falcao_bestiary_update update_finput end def update_finput return if $game_switches[FalcaoKeyDisable_Switch] case Falcao::TeclaBestiary when 'Z'; key = Input::C #C when 'A'; key = Input::X #X when 'S'; key = Input::Y #Y when 'D'; key = Input::Z #Z when 'Q'; key = Input::L #L when 'W'; key = Input::R #R when 'ALT'; key = Input::ALT #alt end if Input.trigger?(key) $scene = Scene_Monsters.new end end end
#-------------------------------------------------------------------------- # * Garder variables des ennemis battus #-------------------------------------------------------------------------- class Scene_File < Scene_Base alias falcaosave_data write_save_data def write_save_data(file) falcaosave_data(file) Marshal.dump($derrotados, file) Marshal.dump($enemy_counter, file) end end
#-------------------------------------------------------------------------- # * Cargar variables de enemigos derrotados #-------------------------------------------------------------------------- class Scene_File < Scene_Base alias falcaoload_data read_save_data def read_save_data(file) falcaoload_data(file) $derrotados = Marshal.load(file) $enemy_counter = Marshal.load(file) end end
#-------------------------------------------------------------------------- # * Objeto que crea el fondo animado usando el mapa #-------------------------------------------------------------------------- class Spriteset_Bestiary def initialize create_battleback update end def create_battleback @viewport1 = Viewport.new(0, 0, 544, 416) source = $game_temp.background_bitmap bitmap = Bitmap.new(640, 480) bitmap.stretch_blt(bitmap.rect, source, source.rect) bitmap.radial_blur(90, 12) @battleback_sprite = Sprite.new(@viewport1) @battleback_sprite.bitmap = bitmap @battleback_sprite.ox = 320 @battleback_sprite.oy = 240 @battleback_sprite.x = 272 @battleback_sprite.y = 176 @battleback_sprite.wave_amp = 8 @battleback_sprite.wave_length = 240 @battleback_sprite.wave_speed = 120 end def dispose @battleback_sprite.bitmap.dispose @battleback_sprite.dispose @viewport1.dispose end def update @battleback_sprite.update @viewport1.update end end
Mon problème est du à la ligne 646 - Spoiler:
- Code:
-
642class Scene_File < Scene_Base 643alias falcaoload_data read_save_data 644def read_save_data(file) 645falcaoload_data(file) 646$derrotados = Marshal.load(file) 647$enemy_counter = Marshal.load(file) 648end 649end
Voilà donc si quel'qu'un pourrai m'aider se sera très sympa et ça me sauverai la vie. Merci d'avance.
Dernière édition par CloudStrife le Mar 23 Mar 2010 - 16:23, édité 1 fois |
|