|
| Realisation volontaire de script !! | |
| |
Auteur | Message |
---|
shin Chevalier Dragon (niveau 1)
Messages postés : 726 Date d'inscription : 18/10/2011
| Sujet: Re: Realisation volontaire de script !! Jeu 28 Nov 2013 - 20:41 | |
| Je le ferais demain j'ai pas le temps se soir. |
| | | Chaos17 Chevalier (niveau 2)
Messages postés : 90 Date d'inscription : 09/02/2013 Jauge LPC :
| Sujet: Re: Realisation volontaire de script !! Jeu 28 Nov 2013 - 21:36 | |
| Pas de soucis Shin. |
| | | shin Chevalier Dragon (niveau 1)
Messages postés : 726 Date d'inscription : 18/10/2011 Jauge LPC :
| Sujet: Re: Realisation volontaire de script !! Ven 29 Nov 2013 - 19:36 | |
| Et voilas le script de full screen doit être positionné au dessus de celui des option Aucune modification dans le script Full screen. Script option - Code:
-
#============================================================================== # # ▼ Yanfly Engine Ace - System Options v1.00 # -- Last Updated: 2012.01.01 # -- Level: Normal # -- Requires: n/a # #============================================================================== $imported = {} if $imported.nil? $imported["YEA-SystemOptions"] = true #============================================================================== # ▼ Updates # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # 2012.01.01 - Started Script and Finished. # #============================================================================== # ▼ Introduction # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # This script replaces the "Game End" option in the Main Menu with a "System" # menu where the player can adjust various settings in the game. Of them, the # player can change the window colour, the volume for BGM, BGS, SFX, set # automatic dashing, message text to display instantly, and speed up battles by # hiding battle animations. # #============================================================================== # ▼ Instructions # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # To install this script, open up your script editor and copy/paste this script # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save. # # ----------------------------------------------------------------------------- # Script Calls - These commands are used with script calls. # ----------------------------------------------------------------------------- # $game_system.volume_change(:bgm, x) # $game_system.volume_change(:bgs, x) # $game_system.volume_change(:sfx, x) # Unlike the previous Yanfly Engines, this version does not bind volume to a # variable. Use the script call to change the bgm, bgs, or sfx sound rate by # x increment. Use a negative value to lower the volume. # # $game_system.set_autodash(true) # $game_system.set_autodash(false) # Turns autodash on (true) or off (false). # # $game_system.set_instantmsg(true) # $game_system.set_instantmsg(false) # Turns instant messages on (true) or off (false). # # $game_system.set_animations(true) # $game_system.set_animations(false) # Turns battle animations on (true) or off (false). # #============================================================================== # ▼ Compatibility # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that # it will run with RPG Maker VX without adjusting. # #============================================================================== module YEA module SYSTEM #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # - General Setting - #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # These are the general settings that govern the System settings. This will # change the "Game End" vocab, and disable or enable autodash, instant # messages, or animations by default. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- COMMAND_NAME = "Options" # Command name used to replace Game End. DEFAULT_AUTODASH = false # Enable automatic dashing by default? DEFAULT_INSTANTMSG = false # Enable instant message text by default? DEFAULT_ANIMATIONS = true # Enable battle animations by default? #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # - Command Settings - #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # These settings adjust the commands shown in the command list. Add, remove # or rearrange the commands as you see fit. Here's a list of which commands # do what: # # ------------------------------------------------------------------------- # :command Description # ------------------------------------------------------------------------- # :blank Inserts an empty blank space. # # :window_red Changes the red tone for all windows. # :window_grn Changes the green tone for all windows. # :window_blu Changes the blue tone for all windows. # # :volume_bgm Changes the BGM volume used. # :volume_bgs Changes the BGS volume used. # :volume_sfx Changes the SFX volume used. # # :autodash Sets the player to automatically dash. # :instantmsg Sets message text to appear instantly. # :animations Enables battle animations or disables them. # # :to_title Returns to the title screen. # :shutdown Shuts down the game. # #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- COMMANDS =[ :window_red, # Changes the red tone for all windows. :window_grn, # Changes the green tone for all windows. :window_blu, # Changes the blue tone for all windows. :volume_bgm, # Changes the BGM volume used. :volume_bgs, # Changes the BGS volume used. :volume_sfx, # Changes the SFX volume used. :blank, # :autodash, # Sets the player to automatically dash. :instantmsg, # Sets message text to appear instantly. # :animations, # Enables battle animations or disables them. # :switch_1, # Custom Switch 1. Adjust settings below. # :switch_2, # Custom Switch 2. Adjust settings below. # :variable_1, # Custom Variable 1. Adjust settings below. # :variable_2, # Custom Variable 2. Adjust settings below. :fullscreen, :blank, :to_title, # Returns to the title screen. :shutdown, # Shuts down the game. ] # Do not remove this. #-------------------------------------------------------------------------- # - Custom Switches - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # If you want your game to have system options other than just the ones # listed above, you can insert custom switches here to produce such an # effect. Adjust the settings here as you see fit. #-------------------------------------------------------------------------- CUSTOM_SWITCHES ={ # ------------------------------------------------------------------------- # :switch => [Switch, Name, Off Text, On Text, # Help Window Description # ], # Do not remove this. # ------------------------------------------------------------------------- :switch_1 => [ 1, "Custom Switch 1", "OFF", "ON", "Help description used for custom switch 1." ], # ------------------------------------------------------------------------- :switch_2 => [ 2, "Custom Switch 2", "OFF", "ON", "Help description used for custom switch 2." ], # ------------------------------------------------------------------------- } # Do not remove this. #-------------------------------------------------------------------------- # - Custom Variables - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # If you want your game to have system options other than just the ones # listed above, you can insert custom variables here to produce such an # effect. Adjust the settings here as you see fit. #-------------------------------------------------------------------------- CUSTOM_VARIABLES ={ # ------------------------------------------------------------------------- # :variable => [Switch, Name, Colour1, Colour2, Min, Max, # Help Window Description # ], # Do not remove this. # ------------------------------------------------------------------------- :variable_1 => [ 1, "Custom Variable 1", 9, 1, -100, 100, "Help description used for custom variable 1." ], # ------------------------------------------------------------------------- :variable_2 => [ 2, "Custom Variable 2", 10, 2, -10, 10, "Help description used for custom variable 2." ], # ------------------------------------------------------------------------- } # Do not remove this. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # - Vocab Settings - #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # This hash adjusts the vocab used for both the commands and the help # description that appears above the command window. Note that for the # command help descriptions, you may use text codes. Use \n to linebreak. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- COMMAND_VOCAB ={ # ------------------------------------------------------------------------- # :command => [Command Name, Option1, Option2 # Help Window Description, # ], # Do not remove this. # ------------------------------------------------------------------------- :blank => ["", "None", "None", "" ], # Do not remove this. # ------------------------------------------------------------------------- :window_red => ["Fenêtre : Rouge", "None", "None", "Change le ton de couleur rouge de la fenêtre.\n" + "Maintenez SHIFT pour modifier par palier de 10." ], # Do not remove this. # ------------------------------------------------------------------------- :window_grn => ["Fenêtre : Vert", "None", "None", "Change le ton de couleur vert de la fenêtre.\n" + "Maintenez SHIFT pour modifier par palier de 10." ], # Do not remove this. # ------------------------------------------------------------------------- :window_blu => ["Fenêtre : Bleu", "None", "None", "Change le ton de couleur bleu de la fenêtre.\n" + "Maintenez SHIFT pour modifier par palier de 10." ], # Do not remove this. # ------------------------------------------------------------------------- :volume_bgm => ["BGM Volume", 12, 4, # Options 1 & 2 are Gauge Colours. "Change le volume pour les musiques.\n" + "Maintenez SHIFT pour modifier par palier de 10." ], # Do not remove this. # ------------------------------------------------------------------------- :volume_bgs => ["BGS Volume", 13, 5, # Options 1 & 2 are Gauge Colours. "Change le volume pour les sons d'ambiance.\n" + "Maintenez SHIFT pour modifier par palier de 10." ], # Do not remove this. # ------------------------------------------------------------------------- :volume_sfx => ["SFX Volume", 14, 6, # Options 1 & 2 are Gauge Colours. "Change le volume pour les effets sonores.\n" + "Maintenez SHIFT pour modifier par palier de 10." ], # Do not remove this. # ------------------------------------------------------------------------- :autodash => ["Auto-Dash", "Walk", "Dash", "Automatically dash without holding the run button." ], # Do not remove this. # ------------------------------------------------------------------------- :instantmsg => ["Texte instantané", "Normal", "Instantané", "Change la vitesse d'apparition des dialogues." ], # Do not remove this. # ------------------------------------------------------------------------- :animations => ["Battle Animations", "Hide", "Show", "Hide animations during battle to speed up battles?" ], # Do not remove this. # ------------------------------------------------------------------------- :fullscreen => ["Full screen", "activer", "désactiver", "pleine écran si activé" ], # ------------------------------------------------------------------------- :to_title => ["Retourner à l'écran titre", "None", "None", "Retourne à l'écran titre." ], # Do not remove this. # ------------------------------------------------------------------------- :shutdown => ["Quitter le jeu", "None", "None", "Quitte le jeu." ], # Do not remove this. # ------------------------------------------------------------------------- } # Do not remove this. end # SYSTEM end # YEA #============================================================================== # ▼ Editting anything past this point may potentially result in causing # computer damage, incontinence, explosion of user's head, coma, death, and/or # halitosis so edit at your own risk. #============================================================================== #============================================================================== # ■ Vocab #============================================================================== module Vocab #-------------------------------------------------------------------------- # overwrite method: self.game_end #-------------------------------------------------------------------------- def self.game_end return YEA::SYSTEM::COMMAND_NAME end end # Vocab #============================================================================== # ■ RPG::BGM #============================================================================== class RPG::BGM < RPG::AudioFile #-------------------------------------------------------------------------- # overwrite method: play #-------------------------------------------------------------------------- def play(pos = 0) if @name.empty? Audio.bgm_stop @@last = RPG::BGM.new else volume = @volume volume *= $game_system.volume(:bgm) * 0.01 unless $game_system.nil? Audio.bgm_play('Audio/BGM/' + @name, volume, @pitch, pos) @@last = self.clone end end end # RPG::BGM #============================================================================== # ■ RPG::ME #============================================================================== class RPG::ME < RPG::AudioFile #-------------------------------------------------------------------------- # overwrite method: play #-------------------------------------------------------------------------- def play if @name.empty? Audio.me_stop else volume = @volume volume *= $game_system.volume(:bgm) * 0.01 unless $game_system.nil? Audio.me_play('Audio/ME/' + @name, volume, @pitch) end end end # RPG::ME #============================================================================== # ■ RPG::BGS #============================================================================== class RPG::BGS < RPG::AudioFile #-------------------------------------------------------------------------- # overwrite method: play #-------------------------------------------------------------------------- def play(pos = 0) if @name.empty? Audio.bgs_stop @@last = RPG::BGS.new else volume = @volume volume *= $game_system.volume(:bgs) * 0.01 unless $game_system.nil? Audio.bgs_play('Audio/BGS/' + @name, volume, @pitch, pos) @@last = self.clone end end end # RPG::BGS #============================================================================== # ■ RPG::SE #============================================================================== class RPG::SE < RPG::AudioFile #-------------------------------------------------------------------------- # overwrite method: play #-------------------------------------------------------------------------- def play unless @name.empty? volume = @volume volume *= $game_system.volume(:sfx) * 0.01 unless $game_system.nil? Audio.se_play('Audio/SE/' + @name, volume, @pitch) end end end # RPG::SE #============================================================================== # ■ Game_System #============================================================================== class Game_System #-------------------------------------------------------------------------- # alias method: initialize #-------------------------------------------------------------------------- alias game_system_initialize_so initialize def initialize game_system_initialize_so init_volume_control init_autodash init_instantmsg init_animations end #-------------------------------------------------------------------------- # new method: init_volume_control #-------------------------------------------------------------------------- def init_volume_control @volume = {} @volume[:bgm] = 100 @volume[:bgs] = 100 @volume[:sfx] = 100 end #-------------------------------------------------------------------------- # new method: volume #-------------------------------------------------------------------------- def volume(type) init_volume_control if @volume.nil? return [[@volume[type], 0].max, 100].min end #-------------------------------------------------------------------------- # new method: volume_change #-------------------------------------------------------------------------- def volume_change(type, increment) init_volume_control if @volume.nil? @volume[type] += increment @volume[type] = [[@volume[type], 0].max, 100].min end #-------------------------------------------------------------------------- # new method: init_autodash #-------------------------------------------------------------------------- def init_autodash @autodash = YEA::SYSTEM::DEFAULT_AUTODASH end #-------------------------------------------------------------------------- # new method: autodash? #-------------------------------------------------------------------------- def autodash? init_autodash if @autodash.nil? return @autodash end #-------------------------------------------------------------------------- # new method: set_autodash #-------------------------------------------------------------------------- def set_autodash(value) @autodash = value end #-------------------------------------------------------------------------- # new method: init_instantmsg #-------------------------------------------------------------------------- def init_instantmsg @instantmsg = YEA::SYSTEM::DEFAULT_INSTANTMSG end #-------------------------------------------------------------------------- # new method: instantmsg? #-------------------------------------------------------------------------- def instantmsg? init_instantmsg if @instantmsg.nil? return @instantmsg end #-------------------------------------------------------------------------- # new method: set_instantmsg #-------------------------------------------------------------------------- def set_instantmsg(value) @instantmsg = value end #-------------------------------------------------------------------------- # new method: init_animations #-------------------------------------------------------------------------- def init_animations @animations = YEA::SYSTEM::DEFAULT_ANIMATIONS end #-------------------------------------------------------------------------- # new method: animations? #-------------------------------------------------------------------------- def animations? init_animations if @animations.nil? return @animations end #-------------------------------------------------------------------------- # new method: set_animations #-------------------------------------------------------------------------- def set_animations(value) @animations = value end end # Game_System #============================================================================== # ■ Game_Player #============================================================================== class Game_Player < Game_Character #-------------------------------------------------------------------------- # alias method: dash? #-------------------------------------------------------------------------- alias game_player_dash_so dash? def dash? if $game_system.autodash? return false if @move_route_forcing return false if $game_map.disable_dash? return false if vehicle return !Input.press?(:A) else return game_player_dash_so end end end # Game_Player #============================================================================== # ■ Scene_Battle #============================================================================== class Scene_Battle < Scene_Base #-------------------------------------------------------------------------- # alias method: show_fast? #-------------------------------------------------------------------------- alias scene_battle_show_fast_so show_fast? def show_fast? return true unless $game_system.animations? return scene_battle_show_fast_so end #-------------------------------------------------------------------------- # alias method: show_normal_animation #-------------------------------------------------------------------------- alias scene_battle_show_normal_animation_so show_normal_animation def show_normal_animation(targets, animation_id, mirror = false) return unless $game_system.animations? scene_battle_show_normal_animation_so(targets, animation_id, mirror) end end # Scene_Battle #============================================================================== # ■ Window_Message #============================================================================== class Window_Message < Window_Base #-------------------------------------------------------------------------- # alias method: clear_flags #-------------------------------------------------------------------------- alias window_message_clear_flags_so clear_flags def clear_flags window_message_clear_flags_so @show_fast = true if $game_system.instantmsg? end end # Window_Message #============================================================================== # ■ Window_SystemOptions #============================================================================== class Window_SystemOptions < Window_Command #-------------------------------------------------------------------------- # initialize #-------------------------------------------------------------------------- def initialize(help_window) @help_window = help_window super(0, @help_window.height) refresh end #-------------------------------------------------------------------------- # window_width #-------------------------------------------------------------------------- def window_width; return Graphics.width; end #-------------------------------------------------------------------------- # window_height #-------------------------------------------------------------------------- def window_height; return Graphics.height - @help_window.height; end #-------------------------------------------------------------------------- # update_help #-------------------------------------------------------------------------- def update_help if current_symbol == :custom_switch || current_symbol == :custom_variable text = @help_descriptions[current_ext] else text = @help_descriptions[current_symbol] end text = "" if text.nil? @help_window.set_text(text) end #-------------------------------------------------------------------------- # ok_enabled? #-------------------------------------------------------------------------- def ok_enabled? return true if [:to_title, :shutdown].include?(current_symbol) return false end #-------------------------------------------------------------------------- # make_command_list #-------------------------------------------------------------------------- def make_command_list @help_descriptions = {} for command in YEA::SYSTEM::COMMANDS case command when :blank add_command(YEA::SYSTEM::COMMAND_VOCAB[command][0], command) @help_descriptions[command] = YEA::SYSTEM::COMMAND_VOCAB[command][3] when :window_red, :window_grn, :window_blu add_command(YEA::SYSTEM::COMMAND_VOCAB[command][0], command) @help_descriptions[command] = YEA::SYSTEM::COMMAND_VOCAB[command][3] when :volume_bgm, :volume_bgs, :volume_sfx add_command(YEA::SYSTEM::COMMAND_VOCAB[command][0], command) @help_descriptions[command] = YEA::SYSTEM::COMMAND_VOCAB[command][3] when :autodash, :instantmsg, :animations add_command(YEA::SYSTEM::COMMAND_VOCAB[command][0], command) @help_descriptions[command] = YEA::SYSTEM::COMMAND_VOCAB[command][3] when :fullscreen add_command(YEA::SYSTEM::COMMAND_VOCAB[command][0], command) @help_descriptions[command] = YEA::SYSTEM::COMMAND_VOCAB[command][3] when :to_title, :shutdown add_command(YEA::SYSTEM::COMMAND_VOCAB[command][0], command) @help_descriptions[command] = YEA::SYSTEM::COMMAND_VOCAB[command][3] else process_custom_switch(command) process_custom_variable(command) end end end #-------------------------------------------------------------------------- # process_custom_switch #-------------------------------------------------------------------------- def process_custom_switch(command) return unless YEA::SYSTEM::CUSTOM_SWITCHES.include?(command) name = YEA::SYSTEM::CUSTOM_SWITCHES[command][1] add_command(name, :custom_switch, true, command) @help_descriptions[command] = YEA::SYSTEM::CUSTOM_SWITCHES[command][4] end #-------------------------------------------------------------------------- # process_custom_variable #-------------------------------------------------------------------------- def process_custom_variable(command) return unless YEA::SYSTEM::CUSTOM_VARIABLES.include?(command) name = YEA::SYSTEM::CUSTOM_VARIABLES[command][1] add_command(name, :custom_variable, true, command) @help_descriptions[command] = YEA::SYSTEM::CUSTOM_VARIABLES[command][6] end #-------------------------------------------------------------------------- # draw_item #-------------------------------------------------------------------------- def draw_item(index) reset_font_settings rect = item_rect(index) contents.clear_rect(rect) case @list[index][:symbol] when :window_red, :window_grn, :window_blu draw_window_tone(rect, index, @list[index][:symbol]) when :volume_bgm, :volume_bgs, :volume_sfx draw_volume(rect, index, @list[index][:symbol]) when :autodash, :instantmsg, :animations draw_toggle(rect, index, @list[index][:symbol]) when :fullscreen draw_toggle(rect, index, @list[index][:symbol]) when :to_title, :shutdown draw_text(item_rect_for_text(index), command_name(index), 1) when :custom_switch draw_custom_switch(rect, index, @list[index][:ext]) when :custom_variable draw_custom_variable(rect, index, @list[index][:ext]) end end #-------------------------------------------------------------------------- # draw_window_tone #-------------------------------------------------------------------------- def draw_window_tone(rect, index, symbol) name = @list[index][:name] draw_text(0, rect.y, contents.width/2, line_height, name, 1) #--- dx = contents.width / 2 tone = $game_system.window_tone case symbol when :window_red rate = (tone.red + 255.0) / 510.0 colour1 = Color.new(128, 0, 0) colour2 = Color.new(255, 0, 0) value = tone.red.to_i when :window_grn rate = (tone.green + 255.0) / 510.0 colour1 = Color.new(0, 128, 0) colour2 = Color.new(0, 255, 0) value = tone.green.to_i when :window_blu rate = (tone.blue + 255.0) / 510.0 colour1 = Color.new(0, 0, 128) colour2 = Color.new(0, 0, 255) value = tone.blue.to_i end draw_gauge(dx, rect.y, contents.width - dx - 48, rate, colour1, colour2) draw_text(dx, rect.y, contents.width - dx - 48, line_height, value, 2) end #-------------------------------------------------------------------------- # draw_volume #-------------------------------------------------------------------------- def draw_volume(rect, index, symbol) name = @list[index][:name] draw_text(0, rect.y, contents.width/2, line_height, name, 1) #--- dx = contents.width / 2 case symbol when :volume_bgm rate = $game_system.volume(:bgm) when :volume_bgs rate = $game_system.volume(:bgs) when :volume_sfx rate = $game_system.volume(:sfx) end colour1 = text_color(YEA::SYSTEM::COMMAND_VOCAB[symbol][1]) colour2 = text_color(YEA::SYSTEM::COMMAND_VOCAB[symbol][2]) value = sprintf("%d%%", rate) rate *= 0.01 draw_gauge(dx, rect.y, contents.width - dx - 48, rate, colour1, colour2) draw_text(dx, rect.y, contents.width - dx - 48, line_height, value, 2) end #-------------------------------------------------------------------------- # draw_toggle #-------------------------------------------------------------------------- def draw_toggle(rect, index, symbol) name = @list[index][:name] draw_text(0, rect.y, contents.width/2, line_height, name, 1) #--- dx = contents.width / 2 case symbol when :autodash enabled = $game_system.autodash? when :instantmsg enabled = $game_system.instantmsg? when :animations enabled = $game_system.animations? when :fullscreen enabled = !Graphics.fullscreen? end dx = contents.width/2 change_color(normal_color, !enabled) option1 = YEA::SYSTEM::COMMAND_VOCAB[symbol][1] draw_text(dx, rect.y, contents.width/4, line_height, option1, 1) dx += contents.width/4 change_color(normal_color, enabled) option2 = YEA::SYSTEM::COMMAND_VOCAB[symbol][2] draw_text(dx, rect.y, contents.width/4, line_height, option2, 1) end #-------------------------------------------------------------------------- # cursor_right #-------------------------------------------------------------------------- def draw_custom_switch(rect, index, ext) name = @list[index][:name] draw_text(0, rect.y, contents.width/2, line_height, name, 1) #--- dx = contents.width / 2 enabled = $game_switches[YEA::SYSTEM::CUSTOM_SWITCHES[ext][0]] dx = contents.width/2 change_color(normal_color, !enabled) option1 = YEA::SYSTEM::CUSTOM_SWITCHES[ext][2] draw_text(dx, rect.y, contents.width/4, line_height, option1, 1) dx += contents.width/4 change_color(normal_color, enabled) option2 = YEA::SYSTEM::CUSTOM_SWITCHES[ext][3] draw_text(dx, rect.y, contents.width/4, line_height, option2, 1) end #-------------------------------------------------------------------------- # draw_custom_variable #-------------------------------------------------------------------------- def draw_custom_variable(rect, index, ext) name = @list[index][:name] draw_text(0, rect.y, contents.width/2, line_height, name, 1) #--- dx = contents.width / 2 value = $game_variables[YEA::SYSTEM::CUSTOM_VARIABLES[ext][0]] colour1 = text_color(YEA::SYSTEM::CUSTOM_VARIABLES[ext][2]) colour2 = text_color(YEA::SYSTEM::CUSTOM_VARIABLES[ext][3]) minimum = YEA::SYSTEM::CUSTOM_VARIABLES[ext][4] maximum = YEA::SYSTEM::CUSTOM_VARIABLES[ext][5] rate = (value - minimum).to_f / [(maximum - minimum).to_f, 0.01].max dx = contents.width/2 draw_gauge(dx, rect.y, contents.width - dx - 48, rate, colour1, colour2) draw_text(dx, rect.y, contents.width - dx - 48, line_height, value, 2) end #-------------------------------------------------------------------------- # cursor_right #-------------------------------------------------------------------------- def cursor_right(wrap = false) cursor_change(:right) super(wrap) end #-------------------------------------------------------------------------- # cursor_left #-------------------------------------------------------------------------- def cursor_left(wrap = false) cursor_change(:left) super(wrap) end #-------------------------------------------------------------------------- # cursor_change #-------------------------------------------------------------------------- def cursor_change(direction) case current_symbol when :window_red, :window_blu, :window_grn change_window_tone(direction) when :volume_bgm, :volume_bgs, :volume_sfx change_volume(direction) when :autodash, :instantmsg, :animations change_toggle(direction) when :fullscreen change_toggle(direction) when :custom_switch change_custom_switch(direction) when :custom_variable change_custom_variables(direction) end end #-------------------------------------------------------------------------- # change_window_tone #-------------------------------------------------------------------------- def change_window_tone(direction) Sound.play_cursor value = direction == :left ? -1 : 1 value *= 10 if Input.press?(:A) tone = $game_system.window_tone.clone case current_symbol when :window_red; tone.red += value when :window_grn; tone.green += value when :window_blu; tone.blue += value end $game_system.window_tone = tone draw_item(index) end #-------------------------------------------------------------------------- # change_window_tone #-------------------------------------------------------------------------- def change_volume(direction) Sound.play_cursor value = direction == :left ? -1 : 1 value *= 10 if Input.press?(:A) case current_symbol when :volume_bgm $game_system.volume_change(:bgm, value) RPG::BGM::last.play when :volume_bgs $game_system.volume_change(:bgs, value) RPG::BGS::last.play when :volume_sfx $game_system.volume_change(:sfx, value) end draw_item(index) end #-------------------------------------------------------------------------- # change_toggle #-------------------------------------------------------------------------- def change_toggle(direction) value = direction == :left ? false : true case current_symbol when :autodash current_case = $game_system.autodash? $game_system.set_autodash(value) when :instantmsg current_case = $game_system.instantmsg? $game_system.set_instantmsg(value) when :animations current_case = $game_system.animations? $game_system.set_animations(value) when :fullscreen current_case = !Graphics.fullscreen? Graphics.fullscreen_mode if !value Graphics.windowed_mode if value end Sound.play_cursor if value != current_case draw_item(index) end #-------------------------------------------------------------------------- # change_custom_switch #-------------------------------------------------------------------------- def change_custom_switch(direction) value = direction == :left ? false : true ext = current_ext current_case = $game_switches[YEA::SYSTEM::CUSTOM_SWITCHES[ext][0]] $game_switches[YEA::SYSTEM::CUSTOM_SWITCHES[ext][0]] = value Sound.play_cursor if value != current_case draw_item(index) end #-------------------------------------------------------------------------- # change_custom_variables #-------------------------------------------------------------------------- def change_custom_variables(direction) Sound.play_cursor value = direction == :left ? -1 : 1 value *= 10 if Input.press?(:A) ext = current_ext var = YEA::SYSTEM::CUSTOM_VARIABLES[ext][0] minimum = YEA::SYSTEM::CUSTOM_VARIABLES[ext][4] maximum = YEA::SYSTEM::CUSTOM_VARIABLES[ext][5] $game_variables[var] += value $game_variables[var] = [[$game_variables[var], minimum].max, maximum].min draw_item(index) end end # Window_SystemOptions #============================================================================== # ■ Scene_Menu #============================================================================== class Scene_Menu < Scene_MenuBase #-------------------------------------------------------------------------- # overwrite method: command_game_end #-------------------------------------------------------------------------- def command_game_end SceneManager.call(Scene_System) end end # Scene_Menu #============================================================================== # ■ Scene_System #============================================================================== class Scene_System < Scene_MenuBase #-------------------------------------------------------------------------- # start #-------------------------------------------------------------------------- def start super create_help_window create_command_window end #-------------------------------------------------------------------------- # create_command_window #-------------------------------------------------------------------------- def create_command_window @command_window = Window_SystemOptions.new(@help_window) @command_window.set_handler(:cancel, method(:return_scene)) @command_window.set_handler(:to_title, method(:command_to_title)) @command_window.set_handler(:shutdown, method(:command_shutdown)) end #-------------------------------------------------------------------------- # command_to_title #-------------------------------------------------------------------------- def command_to_title fadeout_all SceneManager.goto(Scene_Title) end #-------------------------------------------------------------------------- # command_shutdown #-------------------------------------------------------------------------- def command_shutdown fadeout_all SceneManager.exit end end # Scene_System #============================================================================== # # ▼ End of File # #==============================================================================
|
| | | Chaos17 Chevalier (niveau 2)
Messages postés : 90 Date d'inscription : 09/02/2013 Jauge LPC :
| Sujet: Re: Realisation volontaire de script !! Sam 30 Nov 2013 - 10:56 | |
| Shin, tu me surprends à chaque fois! On m'avait dis que c'était trop reloue de rajouter cette option. Toi, tu viens, tu t'exécutes et hop, ça marche du premier coup sans bug, sans larme! Je te donne tout mes points parce que tu as déjà réaliser 2 requêtes pour moi. Je suis touché, j'ai tellement eu de déboire avec les scripts (j'en ai toujours tiens).Bon week-end |
| | | Zexion Administrateur
Messages postés : 6228 Date d'inscription : 04/01/2012 Jauge LPC :
| Sujet: Re: Realisation volontaire de script !! Sam 30 Nov 2013 - 11:42 | |
| Voilà, j'ai ajouté les points de Chaos plus quelques points "normaux". |
| | | Revan Ancien staffeux
Messages postés : 578 Date d'inscription : 01/11/2013 Jauge LPC :
| Sujet: Re: Realisation volontaire de script !! Mer 4 Déc 2013 - 21:57 | |
| Une petite demande de point pour l'ami Shin qui m'a fait un battle script sur mesure. Du gros boulot et toujours avec le sourire, ça mérite bien une récompense |
| | | Zexion Administrateur
Messages postés : 6228 Date d'inscription : 04/01/2012 Jauge LPC :
| Sujet: Re: Realisation volontaire de script !! Mer 4 Déc 2013 - 23:52 | |
| Eh bien, il est en forme shin ! :p (ajouté) |
| | | Revan Ancien staffeux
Messages postés : 578 Date d'inscription : 01/11/2013 Jauge LPC :
| Sujet: Re: Realisation volontaire de script !! Jeu 5 Déc 2013 - 0:01 | |
| Merci Zexion ! |
| | | shin Chevalier Dragon (niveau 1)
Messages postés : 726 Date d'inscription : 18/10/2011 Jauge LPC :
| Sujet: Re: Realisation volontaire de script !! Jeu 5 Déc 2013 - 0:22 | |
| - Zexion a écrit:
- Eh bien, il est en forme shin ! :p
Et t'as pas encore vue mes 3 prochains scripts que je vais sortir (faudras surement attendre 2014) ^^ |
| | | Magicalichigo Ancienne staffeuse
Messages postés : 4252 Date d'inscription : 02/08/2011 Jauge LPC :
| Sujet: Re: Realisation volontaire de script !! Jeu 19 Déc 2013 - 23:02 | |
| Hop petite demande ! Si possible il me faudrait ça assez rapidement ^^' J'utilise ce système de bestiaire : - Code:
-
#============================================================================== # +++ MOG - MONSTER BOOK (v1.4) +++ #============================================================================== # By Moghunter # http://www.atelier-rgss.com/ #============================================================================== # Sistema que permite verificar os parâmetros dos inimigos derrotados, # o que inclui o battleback e a música de batalha. # #============================================================================== # Para chamar o script use o comando abaixo. # # SceneManager.call(Monster_Book) # #==============================================================================
#============================================================================== # ● Histórico (Version History) #============================================================================== # v 1.4 - Correção do Crash quando não há definição de música de batalha. # v 1.3 - Correção do Crash aleatório. # v 1.2 - Melhoria no sistema de dispose. # v 1.1 - Correção na atualização do battleback em imagens repetidas. # - Correção na execução da música quando o pitch ou volume é diferente. # - Correção no espaço entre os números de parametros. #==============================================================================
module MOG_MONSTER_BOOK #Ocultar inimigos especificos da lista de inimigos. HIDE_ENEMIES_ID = [9,10] #Ativar a música de batalha. PLAY_MUSIC = true #Definição da palavra Completado. COMPLETED_WORD = "Complété : " #Ativar o Monster Book no Menu. MENU_COMMAND = false #Nome do comando apresentado no menu. MENU_COMMAND_NAME = "Bestiary" end #============================================================================== # ■ Game_Temp #============================================================================== class Game_Temp attr_accessor :bestiary_battleback1_name attr_accessor :bestiary_battleback2_name #-------------------------------------------------------------------------- # ● Initialize #-------------------------------------------------------------------------- alias mog_bestiary_initialize initialize def initialize @bestiary_battleback1_name = "" @bestiary_battleback1_name = "" mog_bestiary_initialize end end #============================================================================== # ■ Game_System #============================================================================== class Game_System attr_accessor :bestiary_defeated attr_accessor :bestiary_battleback attr_accessor :bestiary_music #-------------------------------------------------------------------------- # ● Initialize #-------------------------------------------------------------------------- alias mog_monster_book_initialize initialize def initialize @bestiary_defeated = [] @bestiary_battleback = [] @bestiary_music = [] mog_monster_book_initialize end end
#============================================================================== # ■ Spriteset_Battle #============================================================================== class Spriteset_Battle #-------------------------------------------------------------------------- # ● Initialize #-------------------------------------------------------------------------- alias mog_bestiary_initialize initialize def initialize mog_bestiary_initialize $game_temp.bestiary_battleback1_name = battleback1_name $game_temp.bestiary_battleback2_name = battleback2_name end end
#============================================================================== # ■ Game_Enemy #============================================================================== class Game_Enemy < Game_Battler attr_accessor :enemy_id #-------------------------------------------------------------------------- # ● Die #-------------------------------------------------------------------------- alias mog_monster_book_die die def die mog_monster_book_die check_monster_book end #-------------------------------------------------------------------------- # ● Check Monster Book #-------------------------------------------------------------------------- def check_monster_book if $game_system.bestiary_defeated[@enemy_id] == nil $game_system.bestiary_defeated[@enemy_id] = 0 $game_system.bestiary_battleback[@enemy_id] = [$game_temp.bestiary_battleback1_name,$game_temp.bestiary_battleback2_name] $game_system.bestiary_music[@enemy_id] = $game_system.battle_bgm end $game_system.bestiary_defeated[@enemy_id] += 1 end end
#============================================================================== # ■ Window_Monster_Status #==============================================================================
class Window_Monster_Status < Window_Selectable #-------------------------------------------------------------------------- # ● Initialize #-------------------------------------------------------------------------- def initialize(enemy) super(0, 288, 544, 128) self.opacity = 255 self.z = 300 refresh(enemy) activate end
#-------------------------------------------------------------------------- # ● Refresh #-------------------------------------------------------------------------- def refresh(enemy) self.contents.clear if $game_system.bestiary_defeated[enemy.id] == nil self.contents.draw_text(0,0 , 180, 24, "Pas de données",0) else change_color(system_color) w_max = 50 ex = 16 self.contents.draw_text(0,0 , w_max, 24, Vocab::param(0),0) self.contents.draw_text(0,24 * 1 , w_max, 24, Vocab::param(1),0) self.contents.draw_text(0,24 * 2 , w_max, 24, Vocab::param(2),0) self.contents.draw_text(0,24 * 3 , w_max, 24, Vocab::param(3),0) self.contents.draw_text(128,24 * 0 , w_max, 24, Vocab::param(4),0) self.contents.draw_text(128,24 * 1 , w_max, 24, Vocab::param(5),0) self.contents.draw_text(128,24 * 2 , w_max, 24, Vocab::param(6),0) self.contents.draw_text(128,24 * 3 , w_max, 24, Vocab::param(7),0) self.contents.draw_text(256,24 * 0 , w_max, 24, "Exp",0) self.contents.draw_text(384,24 * 0 , w_max, 24, Vocab::currency_unit,0) self.contents.draw_text(256,24 * 1 , w_max, 24, "Gains : ",0) change_color(normal_color,true) w_max2 = 64 #HP self.contents.draw_text(32 + ex,0 , w_max2, 24, enemy.params[0],2) #MP self.contents.draw_text(32 + ex,24 * 1 , w_max2, 24, enemy.params[1],2) #ATK self.contents.draw_text(32 + ex,24 * 2 ,w_max2 , 24, enemy.params[2],2) #Def self.contents.draw_text(32 + ex,24 * 3 , w_max2, 24, enemy.params[3],2) #Mag Power self.contents.draw_text(160 + ex,24 * 0 , w_max2, 24, enemy.params[4],2) #Mag Def self.contents.draw_text(160 + ex,24 * 1 , w_max2, 24, enemy.params[5],2) #Agility self.contents.draw_text(160 + ex,24 * 2 , w_max2, 24, enemy.params[6],2) #Luck self.contents.draw_text(160 + ex,24 * 3 , w_max2, 24, enemy.params[7],2) #EXP self.contents.draw_text(280,24 * 0 , 96, 24, enemy.exp,2) #Gold self.contents.draw_text(400,24 * 0 , 96, 24, enemy.gold,2) #Drop Items tr = 0 for i in enemy.drop_items next if i.kind == 0 tr += 1 tr_name = $data_items[i.data_id] if i.kind == 1 tr_name = $data_weapons[i.data_id] if i.kind == 2 tr_name = $data_armors [i.data_id] if i.kind == 3 draw_icon(tr_name.icon_index, 336, 24 * tr) self.contents.draw_text(368,24 * tr , 160, 24, tr_name.name.to_s,0) end end end end
#============================================================================== # ■ Window_Monster_List #============================================================================== class Window_Monster_List < Window_Selectable #------------------------------------------------------------------------------ # ● Initialize #------------------------------------------------------------------------------ def initialize(data) super(312, 64, 232, 224) self.opacity = 255 self.z = 301 @index = -1 @data = data @item_max = @data.size refresh(data) select(0) activate end
#------------------------------------------------------------------------------ # ● Refresh #------------------------------------------------------------------------------ def refresh(data) self.contents.clear if @item_max > 0 self.contents = Bitmap.new(width - 32, @item_max * 24) for i in 0...@item_max draw_item(i) end end end #------------------------------------------------------------------------------ # ● draw_item MAX #------------------------------------------------------------------------------ def check_item_max @data_max = 0 for i in $data_enemies next if i == nil or MOG_MONSTER_BOOK::HIDE_ENEMIES_ID.include?(i.id) @data_max += 1 end end #------------------------------------------------------------------------------ # ● draw_item #------------------------------------------------------------------------------ def draw_item(index) x = 0 y = index / col_max * 24 n_index = index + 1 if $game_system.bestiary_defeated[@data[index].id] == nil monster_name = "No Data" defeated = " ---- " change_color(normal_color,false) else monster_name = @data[index].name change_color(normal_color,true) end check_item_max d = @data_max > 99 ? "%03d" : @data_max > 9 ? "%02d" : "%01d" text = sprintf(d, n_index).to_s + " - " self.contents.draw_text(x,y , 56, 24, text,0) self.contents.draw_text(x + 56,y , 140, 24, monster_name,0) end
#------------------------------------------------------------------------------ # ● Item Max #------------------------------------------------------------------------------ def item_max return @item_max == nil ? 0 : @item_max end end
#============================================================================== # ■ Window_Monster_Comp #============================================================================== class Window_Monster_Comp < Window_Selectable include MOG_MONSTER_BOOK #-------------------------------------------------------------------------- # ● Initialize #-------------------------------------------------------------------------- def initialize super(312,0, 232, 64) self.opacity = 255 self.z = 300 refresh activate end #-------------------------------------------------------------------------- # ● Check Completition #-------------------------------------------------------------------------- def check_completion data_max = 0 for i in $data_enemies next if i == nil or MOG_MONSTER_BOOK::HIDE_ENEMIES_ID.include?(i.id) data_max += 1 end comp = 0 for i in 0...$game_system.bestiary_defeated.size comp += 1 if $game_system.bestiary_defeated[i] != nil end @completed = COMPLETED_WORD + " " + comp.to_s + "/" + data_max.to_s end #-------------------------------------------------------------------------- # ● Refresh #-------------------------------------------------------------------------- def refresh self.contents.clear check_completion self.contents.draw_text(0,0, 160, 24, @completed.to_s,0) end end
#============================================================================== # ■ Monster_Book #============================================================================== class Monster_Book #-------------------------------------------------------------------------- # ● Main #-------------------------------------------------------------------------- def main Graphics.transition execute_loop execute_dispose end
#-------------------------------------------------------------------------- # ● Execute Loop #-------------------------------------------------------------------------- def execute_loop loop do Graphics.update Input.update update break if SceneManager.scene != self end end #-------------------------------------------------------------------------- # ● Initialize #-------------------------------------------------------------------------- def initialize load_data execute_dispose create_window_guide create_enemy_sprite create_battleback @music = [nil,nil,nil] refresh_bgm end #------------------------------------------------------------------------------ # ● Initialize #------------------------------------------------------------------------------ def load_data BattleManager.save_bgm_and_bgs @data = [] for i in $data_enemies next if i == nil or MOG_MONSTER_BOOK::HIDE_ENEMIES_ID.include?(i.id) @data.push(i) end end #-------------------------------------------------------------------------- # ● Execute Dispose #-------------------------------------------------------------------------- def execute_dispose return if @windows_guide == nil Graphics.freeze @windows_guide.dispose @windows_guide = nil @windows_status.dispose if @enemy_sprite.bitmap != nil @enemy_sprite.bitmap.dispose end @enemy_sprite.dispose dispose_battleback @battleback1.dispose @battleback2.dispose @window_comp.dispose BattleManager.replay_bgm_and_bgs end #-------------------------------------------------------------------------- # ● Dispose_battleback #-------------------------------------------------------------------------- def dispose_battleback if @battleback1.bitmap != nil @battleback1.bitmap.dispose @battleback1.bitmap = nil end if @battleback2.bitmap != nil @battleback2.bitmap.dispose @battleback2.bitmap = nil end end #-------------------------------------------------------------------------- # ● Create Window Guide #-------------------------------------------------------------------------- def create_window_guide @windows_guide = Window_Monster_List.new(@data) @enemy = @data[@windows_guide.index] @windows_status = Window_Monster_Status.new(@enemy) @window_comp = Window_Monster_Comp.new @old_index = @windows_guide.index @org_pos = [@windows_guide.x,@windows_guide.y] @fade_time = 60 end #-------------------------------------------------------------------------- # ● Create Enemy Sprite #-------------------------------------------------------------------------- def create_enemy_sprite @enemy_sprite = Sprite.new @enemy_sprite.z = 100 @enemy_sprite_org = @enemy_sprite.x refresh_enemy_sprite end #-------------------------------------------------------------------------- # ● Create_Battleback #-------------------------------------------------------------------------- def create_battleback @battleback1 = Sprite.new @battleback1.z = 1 @battleback1.opacity = 0 @battleback2 = Sprite.new @battleback2.z = 2 @battleback2.opacity = 0 @old_battleback = [nil,nil] refresh_batteback end #-------------------------------------------------------------------------- # ● Update #-------------------------------------------------------------------------- def update @windows_guide.update update_command update_animation refresh if @old_index != @windows_guide.index end #-------------------------------------------------------------------------- # ● Update Animation #-------------------------------------------------------------------------- def update_animation update_window_fade_animation update_battleback_animation update_enemy_sprite_animation end #-------------------------------------------------------------------------- # ● Update Enemy Sprite Animation #-------------------------------------------------------------------------- def update_enemy_sprite_animation @enemy_sprite.opacity += 15 if @enemy_sprite.x < @enemy_sprite_org @enemy_sprite.x += 15 if @enemy_sprite.x >= @enemy_sprite_org @enemy_sprite.x = @enemy_sprite_org end end end #-------------------------------------------------------------------------- # ● Update Window Fade Animation #-------------------------------------------------------------------------- def update_window_fade_animation if @windows_guide.visible @windows_guide.opacity += 15 @windows_guide.contents_opacity += 15 if @windows_guide.y > @org_pos[1] @windows_guide.y -= 25 if @windows_guide.y < @org_pos[1] @windows_guide.y = @org_pos[1] @windows_guide.opacity += 255 @windows_guide.contents_opacity = 255 end end else @windows_guide.opacity -= 15 @windows_guide.contents_opacity -= 15 if @windows_guide.y < (@windows_guide.height + 416) @windows_guide.y += 25 @windows_guide.y = (@windows_guide.height + 416) if @windows_guide.y > (@windows_guide.height + 416) end end end #-------------------------------------------------------------------------- # ● Update Battleback Animation #-------------------------------------------------------------------------- def update_battleback_animation if @old_battleback == nil @battleback1.opacity -= 10 @battleback2.opacity -= 10 else @battleback1.opacity += 10 @battleback2.opacity += 10 end end #-------------------------------------------------------------------------- # ● Update Command #-------------------------------------------------------------------------- def update_command if Input.trigger?(Input::B) or Input.press?(Input::B) Sound.play_cancel SceneManager.return elsif Input.trigger?(Input::C) Sound.play_ok return if @windows_guide.visible @windows_guide.visible = false else @windows_guide.visible = true end end end #-------------------------------------------------------------------------- # ● Refresh Animation #-------------------------------------------------------------------------- def refresh @old_index = @windows_guide.index @enemy = @data[@windows_guide.index] @windows_status.refresh(@enemy) refresh_bgm refresh_enemy_sprite refresh_batteback end #-------------------------------------------------------------------------- # ● Refresh Animation #-------------------------------------------------------------------------- def refresh_enemy_sprite if @enemy_sprite.bitmap != nil @enemy_sprite.bitmap.dispose @enemy_sprite.bitmap = nil end if $game_system.bestiary_defeated[@enemy.id] != nil @enemy_sprite.bitmap = Cache.battler(@enemy.battler_name, @enemy.battler_hue) @enemy_sprite_org = (312/ 2) - (@enemy_sprite.bitmap.width / 2) @enemy_sprite.x = -@enemy_sprite.bitmap.width @enemy_sprite.y = 272 - @enemy_sprite.bitmap.height @enemy_sprite.opacity = 0 end end
#-------------------------------------------------------------------------- # ● BGM Refresh #-------------------------------------------------------------------------- def refresh_bgm return unless MOG_MONSTER_BOOK::PLAY_MUSIC if $game_system.bestiary_music[@enemy.id] != nil and (@music[0] != $game_system.bestiary_music[@enemy.id].name or @music[1] != $game_system.bestiary_music[@enemy.id].volume or @music[2] != $game_system.bestiary_music[@enemy.id].pitch) m = $game_system.bestiary_music[@enemy.id] @music = [m.name, m.volume, m.pitch] RPG::BGM.stop Audio.bgm_play("Audio/BGM/" + m.name, m.volume, m.pitch) rescue nil end end #-------------------------------------------------------------------------- # ● Refresh Battleback #-------------------------------------------------------------------------- def refresh_batteback if $game_system.bestiary_battleback[@enemy.id] != nil and (@old_battleback[0] != $game_system.bestiary_battleback[@enemy.id][0] or @old_battleback[1] != $game_system.bestiary_battleback[@enemy.id][1]) @old_battleback = [$game_system.bestiary_battleback[@enemy.id][0], $game_system.bestiary_battleback[@enemy.id][1]] dispose_battleback @battleback1.opacity = 0 @battleback2.opacity = 0 if $game_system.bestiary_battleback[@enemy.id][0] != nil @battleback1.bitmap = Cache.battleback1($game_system.bestiary_battleback[@enemy.id][0]) else @battleback1.bitmap = Cache.battleback1("") end if $game_system.bestiary_battleback[@enemy.id][1] != nil @battleback2.bitmap = Cache.battleback2($game_system.bestiary_battleback[@enemy.id][1]) else @battleback2.bitmap = Cache.battleback2("") end end end end
if MOG_MONSTER_BOOK::MENU_COMMAND #============================================================================== # ■ Window Menu Command #============================================================================== class Window_MenuCommand < Window_Command #------------------------------------------------------------------------------ # ● Add Main Commands #------------------------------------------------------------------------------ alias mog_bestiary_add_main_commands add_main_commands def add_main_commands mog_bestiary_add_main_commands add_command(MOG_MONSTER_BOOK::MENU_COMMAND_NAME, :bestiary, main_commands_enabled) end end
#============================================================================== # ■ Scene Menu #============================================================================== class Scene_Menu < Scene_MenuBase #------------------------------------------------------------------------------ # ● Create Command Windows #------------------------------------------------------------------------------ alias mog_bestiary_create_command_window create_command_window def create_command_window mog_bestiary_create_command_window @command_window.set_handler(:bestiary, method(:Monster_Book)) end #------------------------------------------------------------------------------ # ● Monster Book #------------------------------------------------------------------------------ def Monster_Book SceneManager.call(Monster_Book) end end end
$mog_rgss3_monster_book = true Etce système de Scan : - Code:
-
###--------------------------------------------------------------------------### # CP Enemy Scan script # # Version 1.2 # # # # Credits: # # Original code by: Neon Black # # Modified slightly by: Levi Stepp # # # ###--------------------------------------------------------------------------###
###--------------------------------------------------------------------------### # Revision information: # # V1.2 - 11.12.2012 # # Added libra effect # # Recoded how discovered elements are stored/called # # Added new options and visuals # # V1.1 - 11.11.2012 # # Fixed a bug related to adding weak states # # Added pop-ups when used with battleview 1 # # V1.0 - 11.6.2012-11.9.2012 # # Wrote and debugged main script # ###--------------------------------------------------------------------------###
###--------------------------------------------------------------------------### # Compatibility: # # Alias - Game_System: initialize # # Game_Battler: item_apply, item_effect_add_state_attack, # # item_effect_add_state_normal # # Scene_Battle: create_all_windows, create_enemy_window, # # next_command, update, invoke_item # # Window_BattleEnemy: update # # New Methods - Game_System: scan_known_elements, scan_known_states, # # add_known_element, add_known_state # # Game_Battler: scan_check_rate, cp_scan_enemy, # # scan_element_affinities, scan_state_affinities, # # scan_weak_elements, scan_weak_states, # # scan_strong_elements, scan_strong_states # # Scene_Battle: create_scan_windows, open_enemy_scan, # # close_enemy_scan, next_enemy, last_enemy # # scan_windows, open_scan_window, # # close_scan_window, close_from_selection # # Window_ScanEnemy: initialize, refresh, enemy, draw_enemy_hp, # # draw_enemy_mp, draw_enemy_tp, # # process_pageup, process_pagedown, # # update_cursor # Window_ScanElements: initialize, window_width, refresh, # # disc_element_type, draw_all_weak, # # draw_all_resist, xicon, col2, # # weaknesses, resistances, # # all_element_type, draw_all_elements, # # draw_all_states, line_offset, text_pos, # # font_size, row_height, state_color, # # enemy, update_cursor # # Window_ScanBio: initialize, refresh, bio, enemy, # # contents_height, update_cursor # # RPG::Enemy: bio, hidden_stats, set_bio_info, # # set_hidden_stats # # RPG::UsableItem: scan_types, libra?, set_scan_type # ###--------------------------------------------------------------------------###
###--------------------------------------------------------------------------### # Instructions: # # Place this script in the "Materials" section of the scripts above main. # # This script adds a scan scene to battles that allows the player to view # # info on enemies by pressing a designated key. There are multiple tags # # that may be used in enemies, skills, and items to allow different types of # # scan functions to be used. # ###----- -----### # Enemy Tags: # # <bio> -and- </bio> # # Sets the text between these tags to the bio description for the enemy. # # This automatically formats allowing you to type the entire bio in a # # single line in the notebox and then showing it over the required lines # # on the scan screen. # # USAGE: # # <bio> # # Enemy bio goes here. You can type it all on one line. # # Or you can use more than one line. # # </bio> # # hide hp -and/or- hide mp -and/or- hide tp # # Hides the designated stat in the info box. You can use one or each tag # # to hide several options at once. # ###----- -----### # Skill/Item Tags: # # scan[libra] # # The skill gains a libra effect opening a scan window on the enemy the # # skill is used on. # # scan[all] # # When the skill use used on a foe, it reveals all info about an enemy. # # This does not count hidden stats such as HP and MP. Also, this tag will # # have no effect unless DISCOVER_TYPE is set to true. # # scan[weak elements] -or- scan[strong states] -or- scan[weak] -etc- # # Scans only specific parts of the attributes sections. You can use the # # words "strong" or "weak" and/or "elements" or "states" to reveal # # whichever attributes you want revealed. Note that if you use two words, # # strong/weak must come before elements/states. Several similar tags can # # be present in a single skill or item. # ###--------------------------------------------------------------------------###
###--------------------------------------------------------------------------### # These are the default values used by several of the functions in the # # script. You may change these values as you find your game requires in # # order to give the player a better playing experience based on your game. # # # module CP # Do not touch # module SCAN # these two lines. # ###----- -----### # These are the high and low values of STATES. A state with an chance higher # # than "TOP" is considered weak. A state with a chance lower than "BOT" is # # considered strong. 1.0 = 100% chance. # STATE_NORM_TOP = 1.0 # Default = 1.0 # STATE_NORM_BOT = 1.0 # Default = 1.0 # # # # Sets the button that can be used to open the scan menu. This can be set to # # nil to disable normal opening of the scan menu. # BUTTON_SCAN = :A # Default = :A # # # # Choose to use the percentage based scan screen (all elements and states # # shown) or the icon based scan screen. # PERCENTAGE_BASED = false # Default = false # # # # Choose if stats and states must be discovered or if they are all shown by # # default. # DISCOVER_TYPE = true # Default = true # # # # This is the text that displays on undiscovered affinities in the percentage # # based screen. # HIDDEN_STAT = "--%" # Default = "--%" # # # # Determine if an info window is used to tell the player what button to press, # # the text of this window, and the X and Y position of the window. # INFO_WINDOW = false # Default = true # INFO_X = 264 # Default = 304 # INFO_Y = 248 # Default = 248 # INFO_TEXT = "Press shift for enemy info" # # # # This is the text that displays in the discovery type scan screen that above # # the icons. # WEAK_TEXT = "Faiblesses" # Default = "Weaknesses" # RESIST_TEXT = "Resistances" # Default = "Resistances" # # # # This is the text that displays when HP, MP, or TP is hidden. # HIDDEN_TEXT = "? ? ?" # Default = "? ? ?" # # # # This hash contains all the elements that can be displayed in the scan screen # # and the icon to go with them. You may have as many or as few as you want. # # The ID relates to the element's ID in the "Terms" page of the database. # ELEMENTS ={ # # ID => Icon, #
3 => 1984, 4 => 1985, 5 => 1986, 6 => 1987, 7 => 1988, 8 => 1989, 9 => 1990, 10 => 1991, } # # # # This hash contains all the states that can be displayed in the scan screen # # and the icon to go with them. If you want to use the same icon from the # # database, set the icon number to nil. # STATES ={ # # ID => Icon, # 1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5, 6 => 6, 7 => 7, 8 => 8, } # # # # These are the different things to be shown in each row of the namebox. You # # can set up as many or as few as you want in each one. You may also remove # # any lines of this hash as you want. The valid tags for terms are :name, # # :states, :hp, :mp, and :tp. If you want a blank to be included, use an # # empty array for that line. Also note that the height of the name and # # element windows are dependent on the number of rows you set here with a max # # of 4 rows and a minimum of 2 rows. # NAMEBOX ={ # 0 => [:name,], 1 => [:hp], # 2 => [:mp,], # 3 => [], } # # # ###----- -----### # The following options can only be used if CP Pop-ups version 1.2 or higher # # is also present in the game. # # # # The text to display for skills that a battler is strong or weak to. # WEAK_POP = "Faible à" # Default = "Weakness" # STRONG_POP = "Fort à" # Default = "Resist" # # # ###--------------------------------------------------------------------------###
###--------------------------------------------------------------------------### # The following lines are the actual core code of the script. While you are # # certainly invited to look, modifying it may result in undesirable results. # # Modify at your own risk! # ###--------------------------------------------------------------------------###
end end
$imported = {} if $imported.nil? $imported["CP_SCAN_SCENE"] = 1.2
class Game_System alias cp_scan_init initialize def initialize ## Adds the new hashes to store known affinities. cp_scan_init @known_elements = {} @known_states = {} end def scan_known_elements(mob) mob = mob.enemy.id ## Checks known elements/states based on arguments. @known_elements = {} if @known_elements.nil? @known_elements[mob] = [] unless @known_elements.include?(mob) return @known_elements[mob] end def scan_known_states(mob) mob = mob.enemy.id @known_states = {} if @known_states.nil? @known_states[mob] = [] unless @known_states.include?(mob) return @known_states[mob] end def add_known_element(mob, element) mob = mob.id ## Adds a new id to the affinity array. return unless CP::SCAN::ELEMENTS.include?(element) @known_elements = {} if @known_elements.nil? @known_elements[mob] = [] unless @known_elements.include?(mob) return if @known_elements[mob].include?(element) @known_elements[mob].push(element) end def add_known_state(mob, state) mob = mob.id return unless CP::SCAN::STATES.include?(state) @known_states = {} if @known_states.nil? @known_states[mob] = [] unless @known_states.include?(mob) return if @known_states[mob].include?(state) @known_states[mob].push(state) end end
class Game_Battler alias cp_scan_item_apply item_apply def item_apply(user, item) cp_scan_item_apply(user, item) cp_scan_enemy(item) unless item.scan_types.empty? return if !@result.hit? ## Adds an element to the affinity array. if item.damage.element_id < 0 return if user.atk_elements.empty? max_id_val = elements_max_rate(user.atk_elements) do_weak_res_pop(max_id_val) return if actor? user.atk_elements.each do |id| next unless element_rate(id) == max_id_val $game_system.add_known_element(enemy, id) end else rate = element_rate(item.damage.element_id) do_weak_res_pop(rate) return if actor? $game_system.add_known_element(enemy, item.damage.element_id) end end def do_weak_res_pop(rate) return unless $imported["CP_BATTLEVIEW"] && $imported["CP_BATTLEVIEW"] >= 1.2 do_weak_pop if rate > 1.0 do_strong_pop if rate < 1.0 end def do_weak_pop pop = CP::BATTLEVIEW::POP_STYLE[:weak_pop] create_pop(CP::SCAN::WEAK_POP, :weak_pop, pop) end def do_strong_pop pop = CP::BATTLEVIEW::POP_STYLE[:strong_pop] create_pop(CP::SCAN::STRONG_POP, :strong_pop, pop) end alias cp_scan_state_attack item_effect_add_state_attack def item_effect_add_state_attack(user, item, effect) cp_scan_state_attack(user, item, effect) user.atk_states.each do |id| scan_check_rate(id) end end ## Check the states used by the skill and adds them to the array. alias cp_scan_state_normal item_effect_add_state_normal def item_effect_add_state_normal(user, item, effect) cp_scan_state_normal(user, item, effect) scan_check_rate(effect.data_id) end def scan_check_rate(id) ## Common function that determines array args. return if actor? $game_system.add_known_state(enemy, id) end def cp_scan_enemy(item) ## Gets the basic types of scans on a skill. return if actor? item.scan_types.each do |type| case type when :we scan_weak_elements when :se scan_strong_elements when :ws scan_weak_states when :ss scan_strong_states when :e scan_element_affinities when :s scan_state_affinities end end end def scan_element_affinities CP::SCAN::ELEMENTS.each do |id, icon| $game_system.add_known_element(enemy, id) end end def scan_state_affinities CP::SCAN::STATES.each do |id, icon| $game_system.add_known_state(enemy, id) end end def scan_weak_elements ## Performs the designated scan. CP::SCAN::ELEMENTS.each do |id, icon| rate = element_rate(id) next if rate <= 1.0 $game_system.add_known_element(enemy, id) end end def scan_weak_states CP::SCAN::STATES.each do |id, icon| rate = state_rate(id) next if rate <= CP::SCAN::STATE_NORM_TOP $game_system.add_known_state(enemy, id) end end def scan_strong_elements CP::SCAN::ELEMENTS.each do |id, icon| rate = element_rate(id) next if rate >= 1.0 $game_system.add_known_element(enemy, id) end end def scan_strong_states CP::SCAN::STATES.each do |id, icon| rate = state_rate(id) next if rate >= CP::SCAN::STATE_NORM_BOT $game_system.add_known_state(enemy, id) end end end
class Scene_Battle < Scene_Base alias cp_scan_create_all_windows create_all_windows def create_all_windows ## Adds the new scan window stuff. cp_scan_create_all_windows create_scan_windows end alias cp_create_enemy_window create_enemy_window def create_enemy_window ## Adds a new enemy window method. cp_create_enemy_window @enemy_window.set_handler(:scan, method(:open_enemy_scan)) end def create_scan_windows ## Creates all required graphics for scanning. @scan_viewport = Viewport.new(0, 0, Graphics.width, Graphics.height) @scan_viewport.z = 400 @scan_viewport.visible = false @scan_enemy = Window_ScanEnemy.new @scan_bio = Window_ScanBio.new @scan_elements = Window_ScanElements.new @scan_info = Window_ScanInfo.new @scan_info.z = 400 @scan_info.visible = false scan_windows.each do |wind| wind.viewport = @scan_viewport end @scan_enemy.set_handler(:ok, method(:close_enemy_scan)) @scan_enemy.set_handler(:cancel, method(:close_enemy_scan)) @scan_enemy.set_handler(:pagedown, method(:next_enemy)) @scan_enemy.set_handler(:pageup, method(:last_enemy)) end def open_enemy_scan @from_selection = true open_scan_window @scan_enemy.lock_foe = false @enemy_window.deactivate @scan_enemy.activate end ## Open and close the enemy scan. def close_enemy_scan close_scan_window close_from_selection if @from_selection @from_selection = false end def next_enemy scan_windows.each do |wind| wind.index += 1 next unless wind.index == $game_troop.alive_members.size wind.index = 0 end scan_windows.each {|wind| wind.refresh} @scan_enemy.activate end ## Next and last enemies.... def last_enemy scan_windows.each do |wind| wind.index -= 1 next unless wind.index == -1 wind.index = $game_troop.alive_members.size - 1 end scan_windows.each {|wind| wind.refresh} @scan_enemy.activate end def scan_windows ## Quickly returns each scan window. return [@scan_enemy, @scan_bio, @scan_elements] end alias cp_scan_next_command next_command def next_command @scan_info.visible = false cp_scan_next_command end alias cp_scan_update update def update cp_scan_update return unless @scan_info && @enemy_window @scan_info.visible = @enemy_window.active end def open_scan_window @window_tot_vis = {} instance_variables.each do |varname| ivar = instance_variable_get(varname) next unless ivar.is_a?(Window) next if ivar.viewport == @scan_viewport @window_tot_vis[varname] = ivar.visible ivar.visible = false end scan_windows.each {|wind| wind.index = @enemy_window.index; wind.refresh} @scan_viewport.visible = true @scan_enemy.lock_foe = true @scan_enemy.activate end def close_scan_window instance_variables.each do |varname| ivar = instance_variable_get(varname) next unless ivar.is_a?(Window) next if ivar.viewport == @scan_viewport ivar.visible = @window_tot_vis[varname] end scan_windows.each do |wind| wind.index = @enemy_window.index end @scan_viewport.visible = false end def close_from_selection @enemy_window.activate @scan_enemy.deactivate end alias cp_scan_action invoke_item def invoke_item(target, item) scan_windows.each {|w| w.index = $game_troop.alive_members.index(target)} target.cp_scan_enemy(item) if item.libra? open_scan_window if item.libra? update_for_wait while @scan_viewport.visible cp_scan_action(target, item) end end
##----- ## The new windows are located below. ##----- class Window_ScanEnemy < Window_Selectable attr_accessor :lock_foe def initialize w = !CP::SCAN::PERCENTAGE_BASED ? 208 : 200 h = fitting_height([[CP::SCAN::NAMEBOX.size, 2].max, 4].min) super(0, 0, w, h) @index = 0 @lock_foe refresh end def refresh contents.clear CP::SCAN::NAMEBOX.each do |id, array| next unless [0, 1, 2, 3].include?(id) next if (array.nil? || !array.is_a?(Array) || array.empty?) wd = contents.width / array.size array.each_with_index do |key, i| case key when :name draw_text(wd * i + 2, id * line_height, wd, line_height, enemy.name) when :states draw_actor_icons(enemy, wd * i, id * line_height, wd) when :hp draw_enemy_hp(enemy, wd * i + 2, id * line_height, wd - 4) when :mp draw_enemy_mp(enemy, wd * i + 2, id * line_height, wd - 4) when :tp draw_enemy_tp(enemy, wd * i + 2, id * line_height, wd - 4) end end end end def enemy $game_troop.alive_members[@index] end def draw_enemy_hp(battler, x, y, width = 124) unless battler.enemy.hidden_stats.include?(:hp) draw_gauge(x, y, width, battler.hp_rate, hp_gauge_color1, hp_gauge_color2) change_color(system_color) draw_text(x, y, 30, line_height, Vocab::hp_a) change_color(hp_color(battler)) draw_text(x + 32, y, width - 32, line_height, battler.hp.to_i, 2) else change_color(system_color) draw_text(x, y, 30, line_height, Vocab::hp_a) change_color(normal_color) draw_text(x + 32, y, width - 32, line_height, CP::SCAN::HIDDEN_TEXT, 2) end end def draw_enemy_mp(battler, x, y, width = 124) unless battler.enemy.hidden_stats.include?(:mp) draw_gauge(x, y, width, battler.mp_rate, mp_gauge_color1, mp_gauge_color2) change_color(system_color) draw_text(x, y, 30, line_height, Vocab::mp_a) change_color(mp_color(battler)) draw_text(x + 32, y, width - 32, line_height, battler.mp.to_i, 2) else change_color(system_color) draw_text(x, y, 30, line_height, Vocab::mp_a) change_color(normal_color) draw_text(x + 32, y, width - 32, line_height, CP::SCAN::HIDDEN_TEXT, 2) end end def draw_enemy_tp(battler, x, y, width = 124) unless battler.enemy.hidden_stats.include?(:tp) draw_gauge(x, y, width, battler.tp_rate, tp_gauge_color1, tp_gauge_color2) change_color(system_color) draw_text(x, y, 30, line_height, Vocab::tp_a) change_color(tp_color(battler)) draw_text(x + 32, y, width - 32, line_height, battler.tp.to_i, 2) else change_color(system_color) draw_text(x, y, 30, line_height, Vocab::tp_a) change_color(normal_color) draw_text(x + 32, y, width - 32, line_height, CP::SCAN::HIDDEN_TEXT, 2) end end def process_pageup return if @lock_foe super end def process_pagedown return if @lock_foe super end def update_cursor end end
class Window_ScanElements < Window_Selectable def initialize w = window_width h = fitting_height([[CP::SCAN::NAMEBOX.size, 2].max, 4].min) super(Graphics.width - w, 0, w, h) @index = 0 refresh end def window_width if !CP::SCAN::PERCENTAGE_BASED return Graphics.width - 208 else icons = [CP::SCAN::ELEMENTS.size, CP::SCAN::STATES.size].max + 24 return [icons * 32, Graphics.width - 200].min end end def refresh contents.clear !CP::SCAN::PERCENTAGE_BASED ? disc_element_type : all_element_type end def disc_element_type draw_all_weak draw_all_resist end def draw_all_weak draw_text(2, 0, 144, line_height, CP::SCAN::WEAK_TEXT, 1) weaknesses.each_with_index do |id, i| draw_icon(id, 24 * (i % xicon), line_height + 24 * (i / xicon)) end end def draw_all_resist draw_text(col2 + 2, 0, 144, line_height, CP::SCAN::RESIST_TEXT, 1) resistances.each_with_index do |id, i| draw_icon(id, col2 + 24 * (i % xicon), line_height + 24 * (i / xicon)) end end def xicon (contents.width / 2) / 24 end def col2 contents.width - xicon * 24 end def weaknesses result = [] CP::SCAN::ELEMENTS.each do |id, icon| next unless enemy.element_rate(id) > 1.0 if CP::SCAN::DISCOVER_TYPE next unless $game_system.scan_known_elements(enemy).include?(id) end result.push(icon) end CP::SCAN::STATES.each do |id, icon| next unless enemy.state_rate(id) > CP::SCAN::STATE_NORM_TOP next if enemy.state_resist?(id) if CP::SCAN::DISCOVER_TYPE next unless $game_system.scan_known_states(enemy).include?(id) end result.push(icon ? icon : $data_states[id].icon_index) end return result end def resistances result = [] CP::SCAN::ELEMENTS.each do |id, icon| next unless enemy.element_rate(id) < 1.0 if CP::SCAN::DISCOVER_TYPE next unless $game_system.scan_known_elements(enemy).include?(id) end result.push(icon) end CP::SCAN::STATES.each do |id, icon| next unless (enemy.state_rate(id) < CP::SCAN::STATE_NORM_BOT || enemy.state_resist?(id)) if CP::SCAN::DISCOVER_TYPE next unless $game_system.scan_known_states(enemy).include?(id) end result.push(icon ? icon : $data_states[id].icon_index) end return result end def all_element_type draw_all_elements draw_all_states end def draw_all_elements i = 0 contents.font.size = font_size CP::SCAN::ELEMENTS.each do |id, icon| known = $game_system.scan_known_elements(enemy).include?(id) if known rate = sprintf("%d%", enemy.element_rate(id) * 100) state_color(enemy.element_rate(id)) else rate = CP::SCAN::HIDDEN_STAT contents.font.color.set(normal_color) end draw_icon(icon, 32 * i + 4, line_offset) draw_text(32 * i, text_pos, 32, font_size, rate, 1) i += 1 end end def draw_all_states i = 0 contents.font.size = font_size CP::SCAN::STATES.each do |id, icon| known = $game_system.scan_known_states(enemy).include?(id) if known perc = enemy.state_resist?(id) ? 0 : enemy.state_rate(id) rate = sprintf("%d%", perc * 100) state_color(perc, true) else rate = CP::SCAN::HIDDEN_STAT contents.font.color.set(normal_color) end iconid = icon ? icon : $data_states[id].icon_index draw_icon(iconid, 32 * i + 4, row_height + line_offset) draw_text(32 * i, row_height + text_pos, 32, font_size, rate, 1) i += 1 end end def line_offset return 0 if CP::SCAN::NAMEBOX.size != 4 return (row_height - line_height) / 2 end def text_pos row_height - font_size end def font_size (line_height * 0.75).to_i end def row_height contents.height / 2 end def state_color(rate, state = false) hrate = state ? CP::SCAN::STATE_NORM_TOP : 1.0 lrate = state ? CP::SCAN::STATE_NORM_BOT : 1.0 if rate > hrate contents.font.color.set(power_up_color) elsif rate < lrate contents.font.color.set(power_down_color) else contents.font.color.set(normal_color) end end def enemy $game_troop.alive_members[@index] end def update_cursor end end
class Window_ScanBio < Window_Selectable def initialize w = Graphics.width h = fitting_height(4) super(0, Graphics.height - h, w, h) refresh end def refresh contents.clear draw_text_ex(0, 0, bio) end def bio temp = enemy.bio result = ""; line = "" temp.split(/ /).each do |word| sz = contents.text_size(line).width + contents.text_size("#{word}").width if sz > contents.width - 2 result += "#{line}\n" line = "#{word} " next else line += "#{word} " end nl = (line =~ /\\n/i) if line.length - 2 == nl result += "#{line}\n" line = word end end result += "#{line}" return result end def enemy $game_troop.alive_members[@index].enemy end def contents_height height - standard_padding * 2 end def update_cursor end end
class Window_BattleEnemy < Window_Selectable alias cp_scan_update update def update cp_scan_update return unless active call_handler(:scan) if Input.trigger?(CP::SCAN::BUTTON_SCAN) end end
class RPG::Enemy < RPG::BaseItem def bio set_bio_info if @bio.nil? return @bio end def hidden_stats set_hidden_stats if @hidden_stats.nil? return @hidden_stats end def set_bio_info @bio = "" get_bio = false self.note.split(/[\r\n]+/).each do |line| case line when /<bio>/i get_bio = true next when /<\/bio>/i return end next unless get_bio @bio += "#{line}\n" end end def set_hidden_stats @hidden_stats = [] self.note.split(/[\r\n]+/).each do |line| case line when /hide hp/i @hidden_stats.push(:hp) when /hide mp/i @hidden_stats.push(:mp) when /hide tp/i @hidden_stats.push(:tp) end end @hidden_stats.uniq! end end
class RPG::UsableItem < RPG::BaseItem def scan_types set_scan_type if @scan_types.nil? return @scan_types end def libra? set_scan_type if @libra_skill.nil? return @libra_skill end def set_scan_type @scan_types = [] @libra_skill = false self.note.split(/[\r\n]+/).each do |line| case line when /scan\[libra\]/i @libra_skill = true when /scan\[all\]/i @scan_types = [:e, :s] when /scan\[(strong|weak)?\s*(elements|states)?\]/i affinity = $1.to_s.downcase; type = $2.to_s.downcase if affinity == "" @scan_types += [:e] if type == "elements" @scan_types += [:s] if type == "states" elsif type == "" @scan_types += [:se, :ss] if affinity == "strong" @scan_types += [:we, :ws] if affinity == "weak" elsif affinity == "strong" if type == "elements" @scan_types.push(:se) elsif type == "states" @scan_types.push(:ss) end elsif affinity == "weak" if type == "elements" @scan_types.push(:we) elsif type == "states" @scan_types.push(:ws) end end end end @scan_types.uniq! end end
class Window_ScanInfo < Window_Base def initialize super(CP::SCAN::INFO_X, CP::SCAN::INFO_Y, 280, fitting_height(1)) self.back_opacity = 255 refresh end def refresh contents.clear draw_text(2, 0, contents.width - 4, line_height, CP::SCAN::INFO_TEXT, 1) self.opacity = 0 if !CP::SCAN::INFO_WINDOW self.contents_opacity = 0 if !CP::SCAN::INFO_WINDOW end end
###--------------------------------------------------------------------------### # End of script. # ###--------------------------------------------------------------------------### Et en gros ce que je voudrais, c'est que les informations dans le bestiaire ne s'affichent que si on a scanné l'ennemi, sinon il faudrait que ça affiche "Pas d'infos", est-ce que c'est possible ? A savoir que le script passe par un objet de la BDD pour scanner ^^ |
| | | shin Chevalier Dragon (niveau 1)
Messages postés : 726 Date d'inscription : 18/10/2011 Jauge LPC :
| Sujet: Re: Realisation volontaire de script !! Ven 20 Déc 2013 - 0:06 | |
| Ok je m'en occupe ce WE. |
| | | Magicalichigo Ancienne staffeuse
Messages postés : 4252 Date d'inscription : 02/08/2011 Jauge LPC :
| Sujet: Re: Realisation volontaire de script !! Ven 20 Déc 2013 - 1:05 | |
| |
| | | shin Chevalier Dragon (niveau 1)
Messages postés : 726 Date d'inscription : 18/10/2011 Jauge LPC :
| Sujet: Re: Realisation volontaire de script !! Ven 20 Déc 2013 - 14:31 | |
| Petite question pour le script de scan, tu en a quelle utilisation; tu utilise scan[all], scan[libra], scan[weak elements], ... ?? |
| | | Magicalichigo Ancienne staffeuse
Messages postés : 4252 Date d'inscription : 02/08/2011 Jauge LPC :
| Sujet: Re: Realisation volontaire de script !! Ven 20 Déc 2013 - 22:06 | |
| J'utilise scan[libra] et scan[all] pour scanner les monstres en combat, et je voudrais que seulement après avoir scanné ça apparaisse dans le bestiaire ^^ |
| | | shin Chevalier Dragon (niveau 1)
Messages postés : 726 Date d'inscription : 18/10/2011 Jauge LPC :
| Sujet: Re: Realisation volontaire de script !! Ven 20 Déc 2013 - 23:05 | |
| voilas t'as juste a mettre ça sous les deux autres script et mettre l'id des items que tu utilise pour le scan. - Code:
-
module SCAN ID_ITEM = 17 ID_ITEM2 = 18 end
#=============================================================================== class Game_System #=============================================================================== attr_accessor :enemy_checked alias zib_monster_book_initialize initialize def initialize @enemy_checked = [] zib_monster_book_initialize end end #=============================================================================== class Game_Enemy < Game_Battler #=============================================================================== attr_accessor :enemy_id def die mog_monster_book_die check_monster_book end #------------------------------------------------------------------------------- def check_monster_book if $game_system.enemy_checked[@enemy_id] != nil
end if $game_system.bestiary_defeated[@enemy_id] == nil $game_system.bestiary_defeated[@enemy_id] = 0 end $game_system.bestiary_defeated[@enemy_id] += 1 end end #=============================================================================== class Window_Monster_Status < Window_Selectable #=============================================================================== def refresh(enemy) self.contents.clear if $game_system.enemy_checked[enemy.id] == nil self.contents.draw_text(0,0 , 180, 24, "Pas de données",0) else change_color(system_color) w_max = 50 ex = 16 self.contents.draw_text(0,0 , w_max, 24, Vocab::param(0),0) self.contents.draw_text(0,24 * 1 , w_max, 24, Vocab::param(1),0) self.contents.draw_text(0,24 * 2 , w_max, 24, Vocab::param(2),0) self.contents.draw_text(0,24 * 3 , w_max, 24, Vocab::param(3),0) self.contents.draw_text(128,24 * 0 , w_max, 24, Vocab::param(4),0) self.contents.draw_text(128,24 * 1 , w_max, 24, Vocab::param(5),0) self.contents.draw_text(128,24 * 2 , w_max, 24, Vocab::param(6),0) self.contents.draw_text(128,24 * 3 , w_max, 24, Vocab::param(7),0) self.contents.draw_text(256,24 * 0 , w_max, 24, "Exp",0) self.contents.draw_text(384,24 * 0 , w_max, 24, Vocab::currency_unit,0) self.contents.draw_text(256,24 * 1 , w_max, 24, "Gains : ",0) change_color(normal_color,true) w_max2 = 64 #HP self.contents.draw_text(32 + ex,0 , w_max2, 24, enemy.params[0],2) #MP self.contents.draw_text(32 + ex,24 * 1 , w_max2, 24, enemy.params[1],2) #ATK self.contents.draw_text(32 + ex,24 * 2 ,w_max2 , 24, enemy.params[2],2) #Def self.contents.draw_text(32 + ex,24 * 3 , w_max2, 24, enemy.params[3],2) #Mag Power self.contents.draw_text(160 + ex,24 * 0 , w_max2, 24, enemy.params[4],2) #Mag Def self.contents.draw_text(160 + ex,24 * 1 , w_max2, 24, enemy.params[5],2) #Agility self.contents.draw_text(160 + ex,24 * 2 , w_max2, 24, enemy.params[6],2) #Luck self.contents.draw_text(160 + ex,24 * 3 , w_max2, 24, enemy.params[7],2) #EXP self.contents.draw_text(280,24 * 0 , 96, 24, enemy.exp,2) #Gold self.contents.draw_text(400,24 * 0 , 96, 24, enemy.gold,2) #Drop Items tr = 0 for i in enemy.drop_items next if i.kind == 0 tr += 1 tr_name = $data_items[i.data_id] if i.kind == 1 tr_name = $data_weapons[i.data_id] if i.kind == 2 tr_name = $data_armors [i.data_id] if i.kind == 3 draw_icon(tr_name.icon_index, 336, 24 * tr) self.contents.draw_text(368,24 * tr , 160, 24, tr_name.name.to_s,0) end end end end #=============================================================================== class Window_Monster_List < Window_Selectable #=============================================================================== def draw_item(index) x = 0 y = index / col_max * 24 n_index = index + 1 if $game_system.enemy_checked[@data[index].id] == nil monster_name = "No Data" defeated = " ---- " change_color(normal_color,false) else monster_name = @data[index].name change_color(normal_color,true) end check_item_max d = @data_max > 99 ? "%03d" : @data_max > 9 ? "%02d" : "%01d" text = sprintf(d, n_index).to_s + " - " self.contents.draw_text(x,y , 56, 24, text,0) self.contents.draw_text(x + 56,y , 140, 24, monster_name,0) end end #=============================================================================== class Window_Monster_Comp < Window_Selectable #=============================================================================== def check_completion data_max = 0 for i in $data_enemies next if i == nil or MOG_MONSTER_BOOK::HIDE_ENEMIES_ID.include?(i.id) data_max += 1 end comp = 0 for i in 0...$game_system.enemy_checked.size comp += 1 if $game_system.enemy_checked[i] != nil end @completed = COMPLETED_WORD + " " + comp.to_s + "/" + data_max.to_s end end #=============================================================================== class Monster_Book #=============================================================================== def refresh_enemy_sprite if @enemy_sprite.bitmap != nil @enemy_sprite.bitmap.dispose @enemy_sprite.bitmap = nil end if $game_system.enemy_checked[@enemy.id] != nil @enemy_sprite.bitmap = Cache.battler(@enemy.battler_name, @enemy.battler_hue) @enemy_sprite_org = (312/ 2) - (@enemy_sprite.bitmap.width / 2) @enemy_sprite.x = -@enemy_sprite.bitmap.width @enemy_sprite.y = 272 - @enemy_sprite.bitmap.height @enemy_sprite.opacity = 0 end end end #=============================================================================== class Scene_Battle < Scene_Base #=============================================================================== alias zib_scan_action invoke_item def invoke_item(target, item) zib_scan_action(target, item) p $game_system.enemy_checked if !target.actor? && (item.id == SCAN::ID_ITEM || item.id == SCAN::ID_ITEM2) $game_system.bestiary_battleback[target.enemy_id] = [$game_temp.bestiary_battleback1_name,$game_temp.bestiary_battleback2_name] $game_system.bestiary_music[target.enemy_id] = $game_system.battle_bgm $game_system.enemy_checked[target.enemy_id] = target end end end |
| | | Magicalichigo Ancienne staffeuse
Messages postés : 4252 Date d'inscription : 02/08/2011 Jauge LPC :
| Sujet: Re: Realisation volontaire de script !! Sam 21 Déc 2013 - 0:19 | |
| Merci beaucoup ! Ca marche niquel ! |
| | | Zexion Administrateur
Messages postés : 6228 Date d'inscription : 04/01/2012 Jauge LPC :
| Sujet: Re: Realisation volontaire de script !! Sam 21 Déc 2013 - 0:57 | |
| Merci Shin, je t'ajoute des points pour le service. |
| | | Magicalichigo Ancienne staffeuse
Messages postés : 4252 Date d'inscription : 02/08/2011 Jauge LPC :
| Sujet: Re: Realisation volontaire de script !! Mer 8 Jan 2014 - 18:37 | |
| J'aimerais faire une nouvelle demande, tu peux toujours y répondre shin ? ^^ |
| | | shin Chevalier Dragon (niveau 1)
Messages postés : 726 Date d'inscription : 18/10/2011 Jauge LPC :
| Sujet: Re: Realisation volontaire de script !! Sam 15 Fév 2014 - 12:49 | |
| j’attends ta demande. (je risque de mettre du temps pour la faire car pas trop le temps en se moment) |
| | | City Hunter Administrateur
Messages postés : 6524 Date d'inscription : 25/05/2011 Jauge LPC :
| Sujet: Re: Realisation volontaire de script !! Sam 15 Fév 2014 - 19:51 | |
| Oh Shin^^ Bien de te revoir parmi nous =) |
| | | Magicalichigo Ancienne staffeuse
Messages postés : 4252 Date d'inscription : 02/08/2011 Jauge LPC :
| Sujet: Re: Realisation volontaire de script !! Dim 16 Fév 2014 - 20:12 | |
| Ca fait plaisir de te revoir Shin ^^ T'inquiète c'est pas à obtenir dans l'heure du tout, je tiens à te l'envoyer seulement si ça ne te genera pas, sinon j'attendrais que tu ais plus de temps ! |
| | | shin Chevalier Dragon (niveau 1)
Messages postés : 726 Date d'inscription : 18/10/2011 Jauge LPC :
| Sujet: Re: Realisation volontaire de script !! Dim 16 Fév 2014 - 20:15 | |
| Le mieux c'est que tu me l'envoie le plus tôt possible comme ça je peut avancer quand j'ai le temps |
| | | Magicalichigo Ancienne staffeuse
Messages postés : 4252 Date d'inscription : 02/08/2011 Jauge LPC :
| Sujet: Re: Realisation volontaire de script !! Dim 16 Fév 2014 - 20:16 | |
| Okay ça me va je t'envoie tout ça par MP de la façon la plus claire possible |
| | | shin Chevalier Dragon (niveau 1)
Messages postés : 726 Date d'inscription : 18/10/2011 Jauge LPC :
| Sujet: Re: Realisation volontaire de script !! Jeu 13 Mar 2014 - 13:22 | |
| Petit message pour dire qu'à partir de maintenant j’accepte les demandes venant de toutes les versions de RM c'est à dire XP, VX, VX Ace. |
| | | Contenu sponsorisé
| Sujet: Re: Realisation volontaire de script !! | |
| |
| | | |
Sujets similaires | |
|
| Permission de ce forum: | Vous ne pouvez pas répondre aux sujets dans ce forum
| |
| |
| |