Поделись скриптом)
Поделись скриптом)
Скрины под спойлером не менялись? Если нет то два недоумения:
1. Трава висит в воздухе, что немного странно смотрится.
2. Магазин как-то пустоват. Стол, шкаф и прочие...
Трава в воздухе? где? Магазин поправим.
Вот скрипт курсора
[SPOILER][/SPOILE]Код:#============================================================================== # ** Victor Engine - Target Arrow #------------------------------------------------------------------------------ # Author : Victor Sant # # Version History: # v 1.00 - 2012.01.15 > First relase # v 1.01 - 2012.03.08 > Fixed self action help name display #------------------------------------------------------------------------------ # This script allows to change target selection to a arrow like selection. # It's possible to make it animated and set different graphics for enemies # and actors target selections. # If using the script 'Victor Engine - Loop Animation', it's also possible # to make the cursor an animation #------------------------------------------------------------------------------ # Compatibility # Requires the script 'Victor Engine - Basic Module' v 1.09 or higher # If used with 'Victor Engine - Custom Basic Actions' paste this one bellow # it. # # * Overwrite methods (Default) # class RPG::UsableItem < RPG::BaseItem # def need_selection? # # class Window_BattleEnemy < Window_Selectable # def show # def hide # def cursor_movable? # def cursor_down(wrap = false) # def cursor_up(wrap = false) # def cursor_right(wrap = false) # def cursor_left(wrap = false) # def update_help # # class Window_BattleActor < Window_BattleStatus # def cursor_movable? # def cursor_down(wrap = false) # def cursor_up(wrap = false) # def cursor_right(wrap = false) # def cursor_left(wrap = false) # def update_help # def update_cursor # # * Alias methods (Default) # class Window_BattleEnemy < Window_Selectable # def initialize(info_viewport) # def update # def dispose # # class Window_BattleActor < Window_BattleStatus # def initialize(info_viewport) # def update # def show # def hide # def update_cursor # def dispose # # class Scene_Battle < Scene_Base # def create_actor_window # def create_enemy_window # def command_attack # def on_skill_ok # def on_item_ok # def on_enemy_cancel # def on_actor_cancel # #------------------------------------------------------------------------------ # Instructions: # To instal the script, open you script editor and paste this script on # a new section on bellow the Materials section. This script must also # be bellow the scripts 'Victor Engine - Basic' # #------------------------------------------------------------------------------ # Skills and Items note tags: # Tags to be used on Skills and Items note boxes. # # <target description> # string # </target description> # The target description text, the string is the text, to add a break line # use \\n. # #------------------------------------------------------------------------------ # Additional instructions: # # The cursors graphics must be in the folder Graphics/System. # # To use animations as cursors you need the script # 'Victor Engine - Loop Animation' v 1.02 or higher. # #============================================================================== #============================================================================== # ** Victor Engine #------------------------------------------------------------------------------ # Setting module for the Victor Engine #============================================================================== module Victor_Engine #-------------------------------------------------------------------------- # * Set the automatic text control codes # when false, it's needed to add \# on the start of the text to use # control codes #-------------------------------------------------------------------------- VE_ARROW_DEFAULT = { name: "Cursor", # Cursor graphic filename ("filename") frames: 4, # Number of frames of the arrow (1 for no animation) speed: 10, # Cursto animation wait time (60 frames = 1 second) height: true, # Adjust arrow based on target height help: true, # Show help window when selecting target x: 0, # Coordinate x adjust y: 0, # Coordinate y adjust move: 0, # Set move type. 0 : all directions, 1 : left and right # 2 : up and down anim: 111, # Animation ID displayed as arrow. Requires the script # "Victor Engine - Loop Animation", this makes the # arrow a looping battle animation instead of a # simple bitmap graphic } # Don't remove #-------------------------------------------------------------------------- # * Custom arrow settings # Set different configuration for arrows based on the window class # it is being shown. It needs to add only the changed values. # type: {setting}, # type: actor: or enemy: #-------------------------------------------------------------------------- VE_ARROW_CUSTOM = { actor: {name: "Blue Cursor"}, enemy: {name: "Cursor1"}, } # Don't remove #-------------------------------------------------------------------------- # * Hide skill window during target selection # Since the window is placed above the battlers, the arrow stay behind # the skill window. you can set it false if the window is placed # in a different position with scripts. #-------------------------------------------------------------------------- VE_HIDE_SKILL_WINDOW = true #-------------------------------------------------------------------------- # * Hide item window during target selection # Since the window is placed above the battlers, the arrow stay behind # the item window. you can set it false if the window is placed # in a different position with scripts. #-------------------------------------------------------------------------- VE_HIDE_ITEM_WINDOW = true #-------------------------------------------------------------------------- # * Set the use of target help window #-------------------------------------------------------------------------- VE_USE_TARGET_HELP = true #-------------------------------------------------------------------------- # * Settings for the target help window. #-------------------------------------------------------------------------- VE_TARGET_HELP_WINDOW = { text_align: 1, # Text align, 0: left, 1: center, 2: right target_info: true, # If true show target info, if false show skill name all_enemies: "All Enemies", # Target info for all enemies actions all_actors: "All Allies", # Target info for all actors actions all_target: "All Targets", # Target info for all targets actions random_enemy: "Random Enemy", # Target info for random enemy actions random_actor: "Random Ally", # Target info for random actor actions random_target: "Random Target", # Target info for random target actions } # Don't remove #-------------------------------------------------------------------------- # * required # This method checks for the existance of the basic module and other # VE scripts required for this script to work, don't edit this #-------------------------------------------------------------------------- def self.required(name, req, version, type = nil) if !$imported[:ve_basic_module] msg = "The script '%s' requires the script\n" msg += "'VE - Basic Module' v%s or higher above it to work properly\n" msg += "Go to http://victorscripts.wordpress.com/ to download this script." msgbox(sprintf(msg, self.script_name(name), version)) exit else self.required_script(name, req, version, type) end end #-------------------------------------------------------------------------- # * script_name # Get the script name base on the imported value, don't edit this #-------------------------------------------------------------------------- def self.script_name(name, ext = "VE") name = name.to_s.gsub("_", " ").upcase.split name.collect! {|char| char == ext ? "#{char} -" : char.capitalize } name.join(" ") end end $imported ||= {} $imported[:ve_target_arrow] = 1.01 Victor_Engine.required(:ve_target_arrow, :ve_basic_module, 1.09, :above) #============================================================================== # ** RPG::UsableItem #------------------------------------------------------------------------------ # This is the superclass for skills and items. #============================================================================== class RPG::UsableItem < RPG::BaseItem #-------------------------------------------------------------------------- # * Overwrite method: need_selection? #-------------------------------------------------------------------------- def need_selection? @scope > 0 end end #============================================================================== # ** Window_Selectable #------------------------------------------------------------------------------ # This window contains cursor movement and scroll functions. #============================================================================== class Window_Selectable < Window_Base #-------------------------------------------------------------------------- # * New method: init_arrow #-------------------------------------------------------------------------- def init_arrow @arrows = [] @arrows_anim = 0 @arrows_value = VE_ARROW_CUSTOM.dup @arrows_value.default = VE_ARROW_DEFAULT.dup @arrows_value.each do |key, value| arrow = @arrows_value[key] arrow[:x] = VE_ARROW_DEFAULT[:x] if !value[:x] arrow[:y] = VE_ARROW_DEFAULT[:y] if !value[:y] arrow[:name] = VE_ARROW_DEFAULT[:name] if !value[:name] arrow[:frames] = VE_ARROW_DEFAULT[:frames] if !value[:frames] arrow[:rect] = VE_ARROW_DEFAULT[:rect] if !value[:rect] arrow[:speed] = VE_ARROW_DEFAULT[:speed] if !value[:speed] arrow[:anim] = VE_ARROW_DEFAULT[:anim] if !value[:anim] arrow[:move] = VE_ARROW_DEFAULT[:move] if !value[:move] arrow[:height] = VE_ARROW_DEFAULT[:height] if !value[:height] end end #-------------------------------------------------------------------------- # * New method: init_arrow_sprite #-------------------------------------------------------------------------- def init_arrow_sprite(forced = false) dispose_arrow if @arrows_index != @index || forced return unless self.active if target_all? item_max.times {|i| create_arrow_sprite(i) } elsif @index > -1 create_arrow_sprite(0) end @arrows_index = @index update_arrow_sprite end #-------------------------------------------------------------------------- # * New method: target_all? #-------------------------------------------------------------------------- def target_all? @action && (@action.for_all? || @action.for_random?) end #-------------------------------------------------------------------------- # * New method: target_self? #-------------------------------------------------------------------------- def target_self? @action && @action.for_user? end #-------------------------------------------------------------------------- # * New method: create_arrow_sprite #-------------------------------------------------------------------------- def create_arrow_sprite(i) return if @arrows[i] @arrows[i] = Sprite_Base.new @arrows[i].bitmap = Cache.system(arrow_filename) end #-------------------------------------------------------------------------- # * New method: arrow_animation #-------------------------------------------------------------------------- def arrow_animation? arrow_animation != 0 && $imported[:ve_loop_animation] end #-------------------------------------------------------------------------- # * New method: update_arrow_sprite #-------------------------------------------------------------------------- def update_arrow_sprite @arrows.each_index do |i| next unless @arrows[i] @arrows[i].viewport = target(i).sprite.viewport arrow_animation? ? set_arrow_animation(i) : set_arrow_bitmap(i) update_arrow_position(i) end update_all_arrows end #-------------------------------------------------------------------------- # * New method: set_arrow_bitmap #-------------------------------------------------------------------------- def set_arrow_bitmap(i) bitmap = @arrows[i].bitmap arrow_width = bitmap.width / arrow_frames current_frame = arrow_width * @arrows_anim @arrows[i].src_rect.set(current_frame, 0, arrow_width, bitmap.height) end #-------------------------------------------------------------------------- # * New method: set_arrow_animation #-------------------------------------------------------------------------- def set_arrow_animation(i) target = target(i) return if !target || target.sprite.loop_anim?(:arrow) settings = {anim: arrow_animation, type: :arrow, loop: 1} target.sprite.add_loop_animation(settings) end #-------------------------------------------------------------------------- # * New method: update_arrow_position #-------------------------------------------------------------------------- def update_arrow_position(i) adjust = arrow_height ? target(i).sprite.oy / 2 : 0 @arrows[i].x = target(i).screen_x + arrow_x @arrows[i].y = target(i).screen_y + arrow_y - adjust @arrows[i].z = self.z + 1000 @arrows[i].ox = @arrows[i].width / 2 @arrows[i].oy = @arrows[i].height / 2 end #-------------------------------------------------------------------------- # * New method: update_all_arrows #-------------------------------------------------------------------------- def update_all_arrows @arrows.each {|arrow| arrow.update } end #-------------------------------------------------------------------------- # * New method: arrow_frames #-------------------------------------------------------------------------- def target_window_type self.instance_of?(Window_BattleEnemy) ? :enemy : :actor end #-------------------------------------------------------------------------- # * New method: arrow_filename #-------------------------------------------------------------------------- def arrow_filename arrow_animation? ? "" : @arrows_value[target_window_type][:name] end #-------------------------------------------------------------------------- # * New method: arrow_frames #-------------------------------------------------------------------------- def arrow_frames [@arrows_value[target_window_type][:frames], 1].max end #-------------------------------------------------------------------------- # * New method: arrow_old_rect #-------------------------------------------------------------------------- def arrow_old_rect @arrows_value[target_window_type][:rect] end #-------------------------------------------------------------------------- # * New method: arrow_animspeed #-------------------------------------------------------------------------- def arrow_animspeed [@arrows_value[target_window_type][:speed], 1].max end #-------------------------------------------------------------------------- # * New method: arrow_x #-------------------------------------------------------------------------- def arrow_x @arrows_value[target_window_type][:x] end #-------------------------------------------------------------------------- # * New method: arrow_y #-------------------------------------------------------------------------- def arrow_y @arrows_value[target_window_type][:y] end #-------------------------------------------------------------------------- # * New method: arrow_animation #-------------------------------------------------------------------------- def arrow_animation @arrows_value[target_window_type][:anim] end #-------------------------------------------------------------------------- # * New method: arrow_height #-------------------------------------------------------------------------- def arrow_height @arrows_value[target_window_type][:height] end #-------------------------------------------------------------------------- # * New method: arrow_move #-------------------------------------------------------------------------- def arrow_move @arrows_value[target_window_type][:move] end #-------------------------------------------------------------------------- # * New method: help_info #-------------------------------------------------------------------------- def help_info VE_TARGET_HELP_WINDOW end #-------------------------------------------------------------------------- # * New method: target_description #-------------------------------------------------------------------------- def target_description return "" unless @action value = "TARGET DESCRIPTION" regexp = /<#{value}>((?:[^<]|<[^\/])*)<\/#{value}>/im text = "" @action.note.scan(regexp) do info = $1.dup info.gsub!(/\r\n/) { "" } info.gsub!(/\\n/) { "\r\n" } text += info end text end #-------------------------------------------------------------------------- # * New method: update_target_help #-------------------------------------------------------------------------- def update_target_help text = target_description align = help_info[:text_align] @help_window.visible = true if text != "" @help_window.set_info_text(text, align) else if help_info[:target_info] draw_tartge_info(align) else @help_window.set_item_text(@action, align) end end end #-------------------------------------------------------------------------- # * New method: draw_tartge_inf #-------------------------------------------------------------------------- def draw_tartge_info(align) if @action.for_one? @help_window.set_target_text(target(0), align) elsif @action.for_all? && @action.for_random? text = help_info[:random_enemies] if @action.for_opponent? text = help_info[:random_actors] if @action.for_friend? text = help_info[:random_target] if @action.for_all_targets? @help_window.set_info_text(text, align) elsif @action.for_all? && !@action.for_random? text = help_info[:all_enemies] if @action.for_opponent? text = help_info[:all_actors] if @action.for_friend? text = help_info[:all_target] if @action.for_all_targets? @help_window.set_info_text(text, align) end end end #============================================================================== # ** Window_Help #------------------------------------------------------------------------------ # This window shows skill and item explanations along with actor status. #============================================================================== class Window_Help < Window_Base #-------------------------------------------------------------------------- # * New method: set_target_text #-------------------------------------------------------------------------- def set_target_text(target, align = 0) if target != @target || @target.name != @text @text = "" @target = target @align = align target_info end end #-------------------------------------------------------------------------- # * New method: set_info_text #-------------------------------------------------------------------------- def set_info_text(text, align = 0) if text != @text @text = text contents.clear adj = @text[/\r\n/i] draw_text(0, 0, width, line_height * (adj ? 1 : 2), @text, align) end end #-------------------------------------------------------------------------- # * New method: set_item_text #-------------------------------------------------------------------------- def set_item_text(item, align = 0) if item.name != @text @text = item.name contents.clear iw = item.icon_index == 0 ? 0 : 24 text_width = text_size(@text).width x = align == 0 ? 0 : (contents_width - 24 - text_width) / (3 - align) draw_icon(item.icon_index, x, line_height / 2, true) draw_text(iw + 2, 0, contents_width - iw, line_height * 2, @text, align) end end #-------------------------------------------------------------------------- # * New method: target_info #-------------------------------------------------------------------------- def target_info contents.clear change_color(hp_color(@target)) adj = (@target.state_icons + @target.buff_icons).size == 0 height = line_height * (adj ? 2 : 1) draw_text(0, 0, contents_width, height, @target.name, @align) draw_target_icons end #-------------------------------------------------------------------------- # * New method: draw_target_icons #-------------------------------------------------------------------------- def draw_target_icons icons = (@target.state_icons + @target.buff_icons)[0, contents_width / 24] x = @align == 0 ? 0 : (contents_width - icons.size * 24) / (3 - @align) icons.each_with_index {|n, i| draw_icon(n, x + 24 * i, line_height) } end end #============================================================================== # ** Window_BattleEnemy #------------------------------------------------------------------------------ # This window display a list of enemies on the battle screen. #============================================================================== class Window_BattleEnemy < Window_Selectable #-------------------------------------------------------------------------- # * Overwrite method: show #-------------------------------------------------------------------------- def show result = super select(0) init_arrow_sprite(true) self.visible = false result end #-------------------------------------------------------------------------- # * Overwrite method: hide #-------------------------------------------------------------------------- def hide result = super dispose_arrow result end #-------------------------------------------------------------------------- # * Overwrite method: cursor_movable? #-------------------------------------------------------------------------- def cursor_movable? super && active && !cursor_all && !target_all? && !target_self? end #-------------------------------------------------------------------------- # * Overwrite method: cursor_down #-------------------------------------------------------------------------- def cursor_down(wrap = false) select((index + 1) % item_max) if arrow_move != 1 end #-------------------------------------------------------------------------- # * Overwrite method: cursor_up #-------------------------------------------------------------------------- def cursor_up(wrap = false) select((index - 1 + item_max) % item_max) if arrow_move != 1 end #-------------------------------------------------------------------------- # * Overwrite method: cursor_right #-------------------------------------------------------------------------- def cursor_right(wrap = false) select((index + 1) % item_max) if arrow_move != 2 end #-------------------------------------------------------------------------- # * Overwrite method: cursor_left #-------------------------------------------------------------------------- def cursor_left(wrap = false) select((index - 1 + item_max) % item_max) if arrow_move != 2 end #-------------------------------------------------------------------------- # * Overwrite method: update_help #-------------------------------------------------------------------------- def update_help update_target_help end #-------------------------------------------------------------------------- # * Alias method: initialize #-------------------------------------------------------------------------- alias :initialize_ve_arrow_arrow :initialize def initialize(info_viewport) initialize_ve_arrow_arrow(info_viewport) init_arrow end #-------------------------------------------------------------------------- # * Alias method: update #-------------------------------------------------------------------------- alias :update_ve_arrow_arrow :update def update update_ve_arrow_arrow init_arrow_sprite update_arrow_sprite return if Graphics.frame_count % arrow_animspeed != 0 @arrows_anim = (@arrows_anim + 1) % arrow_frames end #-------------------------------------------------------------------------- # * Alias method: dispose #-------------------------------------------------------------------------- alias :dispose_ve_arrow_arrow :dispose def dispose dispose_ve_arrow_arrow dispose_arrow end #-------------------------------------------------------------------------- # * New method: init_arrow #-------------------------------------------------------------------------- def set_action(action) @action = action end #-------------------------------------------------------------------------- # * New method: enemies #-------------------------------------------------------------------------- def enemies $game_troop.alive_members end #-------------------------------------------------------------------------- # * New method: target #-------------------------------------------------------------------------- def target(i) target_all? ? enemies[i] : enemy end #-------------------------------------------------------------------------- # * New method: dispose_arrow #-------------------------------------------------------------------------- def dispose_arrow if arrow_animation? enemies.each {|enemy| enemy.sprite.end_loop_anim(:arrow) } end @arrows.each {|arrow| arrow.dispose } @arrows.clear end end #============================================================================== # ** Window_BattleActor #------------------------------------------------------------------------------ # This window display a list of actors on the battle screen. #============================================================================== class Window_BattleActor < Window_BattleStatus #-------------------------------------------------------------------------- # * Overwrite method: cursor_movable? #-------------------------------------------------------------------------- def cursor_movable? super && active && !cursor_all && !target_all? && !target_self? end #-------------------------------------------------------------------------- # * Overwrite method: cursor_down #-------------------------------------------------------------------------- def cursor_down(wrap = false) return if show_actor && arrow_move == 1 show_actor ? select((index + 1) % item_max) : super end #-------------------------------------------------------------------------- # * Overwrite method: cursor_up #-------------------------------------------------------------------------- def cursor_up(wrap = false) return if show_actor && arrow_move == 1 show_actor ? select((index - 1 + item_max) % item_max) : super end #-------------------------------------------------------------------------- # * Overwrite method: cursor_right( #-------------------------------------------------------------------------- def cursor_right(wrap = false) return if show_actor && arrow_move == 2 show_actor ? select((index + 1) % item_max) : super end #-------------------------------------------------------------------------- # * Overwrite method: cursor_left #-------------------------------------------------------------------------- def cursor_left(wrap = false) return if show_actor && arrow_move == 2 show_actor ? select((index - 1 + item_max) % item_max) : super end #-------------------------------------------------------------------------- # * Overwrite method: update_help #-------------------------------------------------------------------------- def update_help update_target_help end #-------------------------------------------------------------------------- # * Overwrite method: initialize #-------------------------------------------------------------------------- def update_cursor @cursor_all = cursor_all super end #-------------------------------------------------------------------------- # * Alias method: initialize #-------------------------------------------------------------------------- alias :initialize_ve_arrow_arrow :initialize def initialize(info_viewport) initialize_ve_arrow_arrow(info_viewport) init_arrow if show_actor end #-------------------------------------------------------------------------- # * Alias method: update #-------------------------------------------------------------------------- alias :update_ve_arrow_arrow :update def update update_ve_arrow_arrow return unless show_actor init_arrow_sprite update_arrow_sprite return if Graphics.frame_count % arrow_animspeed != 0 @arrows_anim = (@arrows_anim + 1) % arrow_frames end #-------------------------------------------------------------------------- # * Alias method: show #-------------------------------------------------------------------------- alias :show_ve_arrow_arrow :show def show if show_actor result = super self.visible = false select(0) result else show_ve_arrow_arrow end end #-------------------------------------------------------------------------- # * Alias method: hide #-------------------------------------------------------------------------- alias :hide_ve_arrow_arrow :hide def hide result = hide_ve_arrow_arrow dispose_arrow if show_actor result end #-------------------------------------------------------------------------- # * Alias method: dispose #-------------------------------------------------------------------------- alias :update_cursor_ve_arrow_arrow :update_cursor def update_cursor show_actor ? cursor_rect.empty : update_cursor_ve_arrow_arrow end #-------------------------------------------------------------------------- # * Alias method: dispose #-------------------------------------------------------------------------- alias :dispose_ve_arrow_arrow :dispose def dispose dispose_ve_arrow_arrow dispose_arrow if show_actor end #-------------------------------------------------------------------------- # * New method: set_action #-------------------------------------------------------------------------- def set_action(action) @action = action end #-------------------------------------------------------------------------- # * New method: cursor_all #-------------------------------------------------------------------------- def cursor_all @action && @action.for_all? end #-------------------------------------------------------------------------- # * New method: actor #-------------------------------------------------------------------------- def actor $game_party.battle_members[@index] end #-------------------------------------------------------------------------- # * New method: actors #-------------------------------------------------------------------------- def actors $game_party.battle_members end #-------------------------------------------------------------------------- # * New method: target #-------------------------------------------------------------------------- def target(i) @index = BattleManager.actor.index if @action.for_user? target_all? ? actors[i] : actor end #-------------------------------------------------------------------------- # * New method: show_actor #-------------------------------------------------------------------------- def show_actor $imported[:ve_actor_battlers] end #-------------------------------------------------------------------------- # * New method: dispose_arrow #-------------------------------------------------------------------------- def dispose_arrow if arrow_animation? actors.each {|actor| actor.sprite.end_loop_anim(:arrow) if actor.sprite } end @arrows.each {|arrow| arrow.dispose } @arrows.clear end end #============================================================================== # ** Scene_Battle #------------------------------------------------------------------------------ # This class performs battle screen processing. #============================================================================== class Scene_Battle < Scene_Base #-------------------------------------------------------------------------- # * Alias method: create_actor_window #-------------------------------------------------------------------------- alias :create_actor_window_ve_arrow_arrow :create_actor_window def create_actor_window create_actor_window_ve_arrow_arrow @actor_window.help_window = @help_window if VE_USE_TARGET_HELP end #-------------------------------------------------------------------------- # * Alias method: create_enemy_window #-------------------------------------------------------------------------- alias :create_enemy_window_ve_arrow_arrow :create_enemy_window def create_enemy_window create_enemy_window_ve_arrow_arrow @enemy_window.help_window = @help_window if VE_USE_TARGET_HELP end #-------------------------------------------------------------------------- # * Alias method: command_attack #-------------------------------------------------------------------------- alias :command_attack_ve_arrow_arrow :command_attack def command_attack set_window_action($data_skills[BattleManager.actor.attack_skill_id]) command_attack_ve_arrow_arrow end #-------------------------------------------------------------------------- # * Alias method: on_skill_ok #-------------------------------------------------------------------------- alias :on_skill_ok_ve_arrow_arrow :on_skill_ok def on_skill_ok set_window_action(@skill_window.item) on_skill_ok_ve_arrow_arrow @skill_window.visible = false if VE_HIDE_SKILL_WINDOW end #-------------------------------------------------------------------------- # * Alias method: on_item_ok #-------------------------------------------------------------------------- alias :on_item_ok_ve_arrow_arrow :on_item_ok def on_item_ok set_window_action(@item_window.item) on_item_ok_ve_arrow_arrow @item_window.visible = false if VE_HIDE_ITEM_WINDOW end #-------------------------------------------------------------------------- # * Alias method: on_enemy_cancel #-------------------------------------------------------------------------- alias :on_enemy_cancel_ve_arrow_arrow :on_enemy_cancel def on_enemy_cancel on_enemy_cancel_ve_arrow_arrow case @actor_command_window.current_symbol when :attack then @help_window.visible = false when :skill then @skill_window.visible = true when :item then @item_window.visible = true end end #-------------------------------------------------------------------------- # * Alias method: on_actor_cancel #-------------------------------------------------------------------------- alias :on_actor_cancel_ve_arrow_arrow :on_actor_cancel def on_actor_cancel on_actor_cancel_ve_arrow_arrow case @actor_command_window.current_symbol when :attack then @help_window.visible = false when :skill then @skill_window.visible = true when :item then @item_window.visible = true end end #-------------------------------------------------------------------------- # * New method: set_window_action #-------------------------------------------------------------------------- def set_window_action(item) @enemy_window.set_action(item) if item.for_opponent? @enemy_window.update_help if item.for_opponent? @actor_window.set_action(item) if item.for_friend? @actor_window.update_help if item.for_friend? end end
вот ядро для него
[SPOILER][/SPOILER]Код:#============================================================================== # ** Victor Engine - Basic Module #------------------------------------------------------------------------------ # Author : Victor Sant # # Version History: # v 1.00 - 2011.12.19 > First relase # v 1.01 - 2011.12.21 > Added Event Troop notes # v 1.02 - 2011.12.22 > Added character frames value # v 1.03 - 2011.12.30 > Added Actor and Enemy notes # v 1.04 - 2012.01.01 > Added party average level and map actors # v 1.05 - 2012.01.04 > Compatibility with Characters Scripts # v 1.06 - 2012.01.07 > Compatibility with Fog and Light Effect # > Added new Sprite Character functions # v 1.07 - 2012.01.11 > Compatibility with Control Text and Codes # v 1.08 - 2012.01.13 > Compatibility with Trait Control # v 1.09 - 2012.01.15 > Fixed the Regular Expressions problem with "" and “” # v 1.10 - 2012.01.18 > Compatibility with Automatic Battlers # v 1.11 - 2012.01.26 > Compatibility with Followers Options # Compatibility with Animated Battle beta # v 1.12 - 2012.02.08 > Compatibility with Animated Battle # v 1.13 - 2012.02.18 > Fix for non RTP dependant encrypted projects # v 1.14 - 2012.03.11 > Better version handling and required messages # v 1.15 - 2012.03.11 > Added level variable for enemies (to avoid crashes) # v 1.16 - 2012.03.21 > Compatibility with Follower Control # v 1.17 - 2012.03.22 > Compatibility with Follower Control new method #------------------------------------------------------------------------------ # This is the basic script for the system from Victory Engine and is # required to use the scripts from the engine. This script offer some new # functions to be used within many scripts of the engine. #------------------------------------------------------------------------------ # Compatibility # Required for the Victor Engine # # * Overwrite methods (Default) # module Cache # def self.character(filename) # # class Sprite_Character < Sprite_Base # def set_character_bitmap # # * Alias methods (Default) # class Game_Interpreter # def command_108 # # class Window_Base < Window # def convert_escape_characters(text) # #------------------------------------------------------------------------------ # Instructions: # To instal the script, open you script editor and paste this script on # a new section on bellow the Materials section. # #------------------------------------------------------------------------------ # New functions # # * Random number between two vales # rand_between(min, max) # min : min value # max : max value # Can be called from any class, this method return an random value between # two specific numbers # # * Random array value # <Array>.random # <Array>.random! # Returns a random object from the array, the method .random! is destructive, # removing the value returned from the array. # # * Sum of the numeric values of a array # <Array>.sum # Returns the sum of all numeric values # # * Avarage of all numeric values from the array # <Array>.average(float = false) # float : float flag # Returns the average of all numeric values, if floa is true, the value # returned is a float, otherwise it's a integer. # # * Note for events # <Event>.note # By default, events doesn't have note boxes. This command allows to use # comments as note boxes, following the same format as the ones on the # database. Returns all comments on the active page of the event. # # * Comment calls # <Event>.comment_call # Another function for comment boxes, by default, they have absolutely no # effect in game when called. But this method allows to make the comment # box to behave like an script call, but with the versatility of the # note boxes. Remember that the commands will only take effect if there # is scripts to respond to the comment code. # #============================================================================== #============================================================================== # ** Victor Engine #------------------------------------------------------------------------------ # Setting module for the Victor Engine #============================================================================== module Victor_Engine #-------------------------------------------------------------------------- # * New method: required_script #-------------------------------------------------------------------------- def self.required_script(name, req, version, type = 0) if type != :bellow && (!$imported[req] || $imported[req] < version) msg = "The script '%s' requires the script\n" case type when :above msg += "'%s' v%s or higher above it to work properly\n" else msg += "'%s' v%s or higher to work properly\n" end msg += "Go to http://victorscripts.wordpress.com/ to download this script." self.exit_message(msg, name, req, version) elsif type == :bellow && $imported[req] msg = "The script '%s' requires the script\n" msg += "'%s' to be put bellow it\n" msg += "move the scripts to the proper position" self.exit_message(msg, name, req, version) end end #-------------------------------------------------------------------------- # * New method: exit_message #-------------------------------------------------------------------------- def self.exit_message(message, name, req, version) name = self.script_name(name) req = self.script_name(req) msgbox(sprintf(message, name, req, version)) exit end #-------------------------------------------------------------------------- # * New method: script_name #-------------------------------------------------------------------------- def self.script_name(name, ext = "VE") name = name.to_s.gsub("_", " ").upcase.split name.collect! {|char| char == ext ? "#{char} -" : char.capitalize } name.join(" ") end end $imported ||= {} $imported[:ve_basic_module] = 1.17 #============================================================================== # ** Object #------------------------------------------------------------------------------ # This class is the superclass of all other classes. #============================================================================== class Object #-------------------------------------------------------------------------- # * Include setting module #-------------------------------------------------------------------------- include Victor_Engine #------------------------------------------------------------------------- # * New method: rand_between #------------------------------------------------------------------------- def rand_between(min, max) min + rand(max - min + 1) end #-------------------------------------------------------------------------- # * New method: numeric? #-------------------------------------------------------------------------- def numeric? return false end #-------------------------------------------------------------------------- # * New method: float? #-------------------------------------------------------------------------- def float? return false end #-------------------------------------------------------------------------- # * New method: item? #-------------------------------------------------------------------------- def item? return false end #-------------------------------------------------------------------------- # * New method: skill? #-------------------------------------------------------------------------- def skill? return false end #-------------------------------------------------------------------------- # * New method: file_exist? #-------------------------------------------------------------------------- def file_exist?(path, filename) $file_list ||= {} $file_list[path + filename] ||= file_test(path, filename) $file_list[path + filename] == :exist end #-------------------------------------------------------------------------- # * New method: get_file_list #-------------------------------------------------------------------------- def file_test(path, filename) bitmap = Cache.load_bitmap(path, filename) rescue nil bitmap ? :exist : :inexist end #-------------------------------------------------------------------------- # * New method: character_exist? #-------------------------------------------------------------------------- def character_exist?(filename) file_exist?("Graphics/Characters/", filename) end #-------------------------------------------------------------------------- # * New method: battler_exist? #-------------------------------------------------------------------------- def battler_exist?(filename) file_exist?("Graphics/Battlers/", filename) end #-------------------------------------------------------------------------- # * New method: get_filename #-------------------------------------------------------------------------- def get_filename "[\"'“‘]([^\"'”‘”’]+)[\"'”’]" end #-------------------------------------------------------------------------- # * New method: make_symbol #-------------------------------------------------------------------------- def make_symbol(string) string.downcase.gsub(" ", "_").to_sym end #-------------------------------------------------------------------------- # * New method: make_string #-------------------------------------------------------------------------- def make_string(symbol) symbol.to_s.gsub("_", " ").upcase end #-------------------------------------------------------------------------- # * New method: returing_value #-------------------------------------------------------------------------- def returing_value(i, x) i % (x * 2) >= x ? (x * 2) - i % (x * 2) : i % (x * 2) end end #============================================================================== # ** Numeric #------------------------------------------------------------------------------ # This is the abstract class for numbers. #============================================================================== class Numeric #-------------------------------------------------------------------------- # * New method: numeric? #-------------------------------------------------------------------------- def numeric? return true end end #============================================================================== # ** Float #------------------------------------------------------------------------------ # This is the abstract class for the floating point values. #============================================================================== class Float #-------------------------------------------------------------------------- # * New method: float? #-------------------------------------------------------------------------- def float? return true end end #============================================================================== # ** Array #------------------------------------------------------------------------------ # This class store arbitrary Ruby objects. #============================================================================== class Array #------------------------------------------------------------------------- # * New method: random #------------------------------------------------------------------------- def random self[rand(size)] end #------------------------------------------------------------------------- # * New method: random! #------------------------------------------------------------------------- def random! self.delete_at(rand(size)) end #--------------------------------------------------------------------------- # * New method: sum #--------------------------------------------------------------------------- def sum self.inject(0) {|r, n| r += (n.numeric? ? n : 0)} end #--------------------------------------------------------------------------- # * New method: average #--------------------------------------------------------------------------- def average(float = false) self.sum / [(float ? size.to_f : size.to_i), 1].max end #--------------------------------------------------------------------------- # * New method: next_item #--------------------------------------------------------------------------- def next_item item = self.shift self.push(item) item end #--------------------------------------------------------------------------- # * New method: previous_item #--------------------------------------------------------------------------- def previous_item item = self.pop self.unshift(item) item end end #============================================================================== # ** RPG::Troop::Page #------------------------------------------------------------------------------ # This is the data class for battle events (pages). #============================================================================== class RPG::Troop::Page #-------------------------------------------------------------------------- # * New method: note #-------------------------------------------------------------------------- def note return "" if !@list || @list.size <= 0 comment_list = [] @list.each do |item| next unless item && (item.code == 108 || item.code == 408) comment_list.push(item.parameters[0]) end comment_list.join("\r\n") end end #============================================================================== # ** RPG::Skill #------------------------------------------------------------------------------ # This is the data class for skills. #============================================================================== class RPG::Skill #-------------------------------------------------------------------------- # * New method: item? #-------------------------------------------------------------------------- def item? return false end #-------------------------------------------------------------------------- # * New method: skill? #-------------------------------------------------------------------------- def skill? return true end end #============================================================================== # ** RPG::Item #------------------------------------------------------------------------------ # This is the data class for sitems. #============================================================================== class RPG::Item #-------------------------------------------------------------------------- # * New method: item? #-------------------------------------------------------------------------- def item? return true end #-------------------------------------------------------------------------- # * New method: skill? #-------------------------------------------------------------------------- def skill? return false end end #============================================================================== # ** RPG::UsableItem #------------------------------------------------------------------------------ # This is the superclass for skills and items. #============================================================================== class RPG::UsableItem < RPG::BaseItem #-------------------------------------------------------------------------- # * New method: for_all_targets? #-------------------------------------------------------------------------- def for_all_targets? return false end end #============================================================================== # ** Cache #------------------------------------------------------------------------------ # This module loads each of graphics, creates a Bitmap object, and retains it. # To speed up load times and conserve memory, this module holds the created # Bitmap object in the internal hash, allowing the program to return # preexisting objects when the same bitmap is requested again. #============================================================================== module Cache #-------------------------------------------------------------------------- # * New method: cache #-------------------------------------------------------------------------- def self.cache @cache end #-------------------------------------------------------------------------- # * New method: character #-------------------------------------------------------------------------- def self.character(filename, hue = 0) load_bitmap("Graphics/Characters/", filename, hue) end end #============================================================================== # ** Game_BattlerBase #------------------------------------------------------------------------------ # This class handles battlers. It's used as a superclass of the Game_Battler # classes. #============================================================================== class Game_BattlerBase #-------------------------------------------------------------------------- # * Public Instance Variables #-------------------------------------------------------------------------- attr_reader :buffs #-------------------------------------------------------------------------- # * New method: get_cond #-------------------------------------------------------------------------- def get_cond(text) case text.upcase when "HIGHER" then ">" when "LOWER" then "<" when "EQUAL" then "==" when "DIFFERENT" then "!=" else "!=" end end #-------------------------------------------------------------------------- # * New method: get_param #-------------------------------------------------------------------------- def get_param(text) case text.upcase when "MAXHP" then self.mhp when "MAXMP" then self.mmp when "MAXTP" then self.max_tp else eval("self.#{text.downcase}") end end #-------------------------------------------------------------------------- # * New method: get_param_id #-------------------------------------------------------------------------- def get_param_id(text) case text.upcase when "MAXHP", "HP" then 0 when "MAXMP", "MP" then 1 when "ATK" then 2 when "DEF" then 3 when "MAT" then 4 when "MDF" then 5 when "AGI" then 6 when "LUK" then 7 end end #-------------------------------------------------------------------------- # * New method: danger? #-------------------------------------------------------------------------- def danger? hp < mhp * 25 / 100 end #-------------------------------------------------------------------------- # * New method: sprite #-------------------------------------------------------------------------- def sprite valid = SceneManager.scene_is?(Scene_Battle) && SceneManager.scene.spriteset valid ? SceneManager.scene.spriteset.sprite(self) : nil end end #============================================================================== # ** Game_Enemy #------------------------------------------------------------------------------ # This class handles enemy characters. It's used within the Game_Troop class # ($game_troop). #============================================================================== class Game_Enemy < Game_Battler #-------------------------------------------------------------------------- # * New method: note #-------------------------------------------------------------------------- def note enemy ? enemy.note : "" end #-------------------------------------------------------------------------- # * New method: get_all_notes #-------------------------------------------------------------------------- def get_all_notes result = note states.compact.each {|state| result += state.note } result end #-------------------------------------------------------------------------- # * New method: level #-------------------------------------------------------------------------- def level return 1 end end #============================================================================== # ** Game_Actor #------------------------------------------------------------------------------ # This class handles actors. It's used within the Game_Actors class # ($game_actors) and referenced by the Game_Party class ($game_party). #============================================================================== class Game_Actor < Game_Battler #-------------------------------------------------------------------------- # * New method: note #-------------------------------------------------------------------------- def note actor ? actor.note : "" end #-------------------------------------------------------------------------- # * New method: hue #-------------------------------------------------------------------------- def hue @hue ? @hue : 0 end #-------------------------------------------------------------------------- # * New method: get_all_notes #-------------------------------------------------------------------------- def get_all_notes result = note result += self.class.note equips.compact.each {|equip| result += equip.note } states.compact.each {|state| result += state.note } result end #-------------------------------------------------------------------------- # * New method: in_active_party? #-------------------------------------------------------------------------- def in_active_party? $game_party.battle_members.include?(self) end #-------------------------------------------------------------------------- # * New method: in_reserve_party? #-------------------------------------------------------------------------- def in_reserve_party? $game_party.reserve_members.include?(self) end #-------------------------------------------------------------------------- # * New method: in_party? #-------------------------------------------------------------------------- def in_party? $game_party.all_members.include?(self) end end #============================================================================== # ** Game_Party #------------------------------------------------------------------------------ # This class handles the party. It includes information on amount of gold # and items. The instance of this class is referenced by $game_party. #============================================================================== class Game_Party < Game_Unit #-------------------------------------------------------------------------- # * New method: average_level #-------------------------------------------------------------------------- def average_level battle_members.collect {|actor| actor.level }.average end #-------------------------------------------------------------------------- # * New method: reserve_members #-------------------------------------------------------------------------- def reserve_members all_members - battle_members end end #============================================================================== # ** Game_Map #------------------------------------------------------------------------------ # This class handles maps. It includes scrolling and passage determination # functions. The instance of this class is referenced by $game_map. #============================================================================== class Game_Map #-------------------------------------------------------------------------- # * New method: event_list #-------------------------------------------------------------------------- def event_list events.values end #-------------------------------------------------------------------------- # * New method: note #-------------------------------------------------------------------------- def note @map ? @map.note : "" end #-------------------------------------------------------------------------- # * New method: vehicles #-------------------------------------------------------------------------- def vehicles @vehicles end #-------------------------------------------------------------------------- # * New method: actors #-------------------------------------------------------------------------- def actors [$game_player] + $game_player.followers.visible_followers end end #============================================================================== # ** Game_CharacterBase #------------------------------------------------------------------------------ # This class deals with characters. Common to all characters, stores basic # data, such as coordinates and graphics. It's used as a superclass of the # Game_Character class. #============================================================================== class Game_CharacterBase #-------------------------------------------------------------------------- # * Public Instance Variables #-------------------------------------------------------------------------- attr_accessor :move_speed attr_accessor :move_frequency #-------------------------------------------------------------------------- # * New method: is_player? #-------------------------------------------------------------------------- def is_player? return false end #-------------------------------------------------------------------------- # * New method: is_event? #-------------------------------------------------------------------------- def is_event? return false end #-------------------------------------------------------------------------- # * New method: is_follower? #-------------------------------------------------------------------------- def is_follower? return false end #-------------------------------------------------------------------------- # * New method: is_vehicle? #-------------------------------------------------------------------------- def is_vehicle? return false end #-------------------------------------------------------------------------- # * New method: frames #-------------------------------------------------------------------------- def frames return 3 end #-------------------------------------------------------------------------- # * New method: hue #-------------------------------------------------------------------------- def hue @hue ? @hue : 0 end end #============================================================================== # ** Game_Character #------------------------------------------------------------------------------ # This class deals with characters. It's used as a superclass of the # Game_Player and Game_Event classes. #============================================================================== class Game_Character < Game_CharacterBase #-------------------------------------------------------------------------- # * New method: move_toward_position #-------------------------------------------------------------------------- def move_toward_position(x, y) sx = distance_x_from(x) sy = distance_y_from(y) if sx.abs > sy.abs move_straight(sx > 0 ? 4 : 6) move_straight(sy > 0 ? 8 : 2) if !@move_succeed && sy != 0 elsif sy != 0 move_straight(sy > 0 ? 8 : 2) move_straight(sx > 0 ? 4 : 6) if !@move_succeed && sx != 0 end end end #============================================================================== # ** Game_Player #------------------------------------------------------------------------------ # This class handles the player. # The instance of this class is referenced by $game_map. #============================================================================== class Game_Player < Game_Character #-------------------------------------------------------------------------- # * New method: is_player? #-------------------------------------------------------------------------- def is_player? return true end #-------------------------------------------------------------------------- # * New method: perform_transfer #-------------------------------------------------------------------------- def new_map_id @new_map_id end #-------------------------------------------------------------------------- # * New method: hue #-------------------------------------------------------------------------- def hue actor ? actor.hue : 0 end end #============================================================================== # ** Game_Follower #------------------------------------------------------------------------------ # This class handles the followers. Followers are the actors of the party # that follows the leader in a line. It's used within the Game_Followers class. #============================================================================== class Game_Follower < Game_Character #-------------------------------------------------------------------------- # * New method: is_follower? #-------------------------------------------------------------------------- def is_follower? return true end #-------------------------------------------------------------------------- # * New method: index #-------------------------------------------------------------------------- def index @member_index end end #============================================================================== # ** Game_Followers #------------------------------------------------------------------------------ # This class handles the followers. It's a wrapper for the built-in class # "Array." It's used within the Game_Player class. #============================================================================== class Game_Followers #-------------------------------------------------------------------------- # * New method: get_actor #-------------------------------------------------------------------------- def get_actor(id) list = [$game_player] + visible_followers.select do |follower| follower.actor && follower.actor.id == id end list.first end end #============================================================================== # ** Game_Vehicle #------------------------------------------------------------------------------ # This class handles vehicles. It's used within the Game_Map class. If there # are no vehicles on the current map, the coordinates is set to (-1,-1). #============================================================================== class Game_Vehicle < Game_Character #-------------------------------------------------------------------------- # * New method: is_vehicle? #-------------------------------------------------------------------------- def is_vehicle? return true end #-------------------------------------------------------------------------- # * New method: map_id #-------------------------------------------------------------------------- def map_id @map_id end end #============================================================================== # ** Game_Event #------------------------------------------------------------------------------ # This class deals with events. It handles functions including event page # switching via condition determinants, and running parallel process events. # It's used within the Game_Map class. #============================================================================== class Game_Event < Game_Character #-------------------------------------------------------------------------- # * New method: name #-------------------------------------------------------------------------- def name @event.name end #-------------------------------------------------------------------------- # * New method: is_event? #-------------------------------------------------------------------------- def is_event? return true end #-------------------------------------------------------------------------- # * New method: note #-------------------------------------------------------------------------- def note return "" if !@page || !@page.list || @page.list.size <= 0 comment_list = [] @page.list.each do |item| next unless item && (item.code == 108 || item.code == 408) comment_list.push(item.parameters[0]) end comment_list.join("\r\n") end end #============================================================================== # ** Game_Interpreter #------------------------------------------------------------------------------ # An interpreter for executing event commands. This class is used within the # Game_Map, Game_Troop, and Game_Event classes. #============================================================================== class Game_Interpreter #-------------------------------------------------------------------------- # * Alias method: command_108 #-------------------------------------------------------------------------- alias :command_108_ve_basic_module :command_108 def command_108 command_108_ve_basic_module comment_call end #-------------------------------------------------------------------------- # * New method: comment_call #-------------------------------------------------------------------------- def comment_call end #-------------------------------------------------------------------------- # * New method: note #-------------------------------------------------------------------------- def note @comments ? @comments.join("\r\n") : "" end end #============================================================================== # ** Sprite_Character #------------------------------------------------------------------------------ # This sprite is used to display characters. It observes a instance of the # Game_Character class and automatically changes sprite conditions. #============================================================================== class Sprite_Character < Sprite_Base #-------------------------------------------------------------------------- # * Overwrite method: set_character_bitmap #-------------------------------------------------------------------------- def set_character_bitmap update_character_info set_bitmap set_bitmap_position end #-------------------------------------------------------------------------- # * New method: center_y #-------------------------------------------------------------------------- def actor? @character.is_a?(Game_Player) || @character.is_a?(Game_Follower) end #-------------------------------------------------------------------------- # * New method: center_y #-------------------------------------------------------------------------- def actor actor? ? @character.actor : nil end #-------------------------------------------------------------------------- # * New method: update_character_info #-------------------------------------------------------------------------- def update_character_info end #-------------------------------------------------------------------------- # * New method: hue #-------------------------------------------------------------------------- def hue @character.hue end #-------------------------------------------------------------------------- # * New method: set_bitmap #-------------------------------------------------------------------------- def set_bitmap self.bitmap = Cache.character(set_bitmap_name, hue) end #-------------------------------------------------------------------------- # * New method: set_bitmap_name #-------------------------------------------------------------------------- def set_bitmap_name @character_name end #-------------------------------------------------------------------------- # * New method: set_bitmap_position #-------------------------------------------------------------------------- def set_bitmap_position sign = get_sign if sign && sign.include?('$') @cw = bitmap.width / @character.frames @ch = bitmap.height / 4 else @cw = bitmap.width / (@character.frames * 4) @ch = bitmap.height / 8 end self.ox = @cw / 2 self.oy = @ch end #-------------------------------------------------------------------------- # * New method: get_sign #-------------------------------------------------------------------------- def get_sign @character_name[/^[\!\$]./] end end #============================================================================== # ** Sprite_Battler #------------------------------------------------------------------------------ # This sprite is used to display battlers. It observes a instance of the # Game_Battler class and automatically changes sprite conditions. #============================================================================== class Sprite_Battler < Sprite_Base #-------------------------------------------------------------------------- # * Public Instance Variables #-------------------------------------------------------------------------- attr_accessor :dmg_mirror #-------------------------------------------------------------------------- # * New method: center_x #-------------------------------------------------------------------------- def center_x self.ox end #-------------------------------------------------------------------------- # * New method: center_y #-------------------------------------------------------------------------- def center_y self.oy / 2 end end #============================================================================== # ** Spriteset_Battle #------------------------------------------------------------------------------ # This class brings together battle screen sprites. It's used within the # Scene_Battle class. #============================================================================== class Spriteset_Battle #-------------------------------------------------------------------------- # * Public Instance Variables #-------------------------------------------------------------------------- attr_reader :viewport1 #-------------------------------------------------------------------------- # * New method: sprite #-------------------------------------------------------------------------- def sprite(subject) battler_sprites.compact.select {|sprite| sprite.battler == subject }.first end end #============================================================================== # ** Window_Base #------------------------------------------------------------------------------ # This is a superclass of all windows in the game. #============================================================================== class Window_Base < Window #-------------------------------------------------------------------------- # * Alias method: convert_escape_characters #-------------------------------------------------------------------------- alias :convert_escape_ve_basic_module :convert_escape_characters def convert_escape_characters(text) result = text.to_s.clone result = text_replace(result) result = convert_escape_ve_basic_module(text) result end #-------------------------------------------------------------------------- # * New method: text_replace #-------------------------------------------------------------------------- def text_replace(result) result.gsub!(/\r/) { "" } result.gsub!(/\\/) { "\e" } result end end #============================================================================== # ** Scene_Battle #------------------------------------------------------------------------------ # This class performs battle screen processing. #============================================================================== class Scene_Battle < Scene_Base #-------------------------------------------------------------------------- # * Public Instance Variables #-------------------------------------------------------------------------- attr_reader :spriteset end
а вот сам курсор
вставь его в папку графика\система
Cursor1.png
Благодарю)
Подгони) посмотрим как оно смотреться будет) Сейчас в скрипте на освещение копаюсь.
На счет травы: Та трава что по колено она прямо над рекой висит в воздухе, что смотрится достаточно странно.
Помоему там всё в порядке. Там еще и землица виднеется.
скрипт освещение виктора? а то есть вообще клевый скрипт и для фонарика и для освещение)
держи скрипт худ-системыКод:#=============================================================================== # # YanPac Battle HUD (0.3) # 27/02/2012 # By Yanfly and Pacman (originally by Yanfly, extracted and worked on by Pacman) # This script adds the Actor HUD from Yanfly Engine Ace's Battle System to the # default battle system. It draws the actor's name, face, HP, MP, TP, action # and states. The script automatically detects whether to draw the actor's TP # or MP depending on which skills they have. You can change some simple # aesthetic options below. # You can use simple notetags to make sure the actor's gauges are drawn: # \def_draw_hp - Definitely draw HP # \def_draw_mp - Definitely draw MP # \def_draw_tp - Definitely draw TP # \def_not_hp - Definitely don't draw HP # \def_not_mp - Definitely don't draw MP # \def_not_tp - Definitely don't draw TP # The main point of this standalone script is to optimize compatibility with # other scripts and increase efficiency (currently pending :P). # # Version list: # 0.3: Compatible with Change Gauge Display # http://pacmanvx.wordpress.com/2012/02/11/change-gauge-display/ # 0.2: Compatible with Neo Gauge Ultimate # http://pacmanvx.wordpress.com/2012/02/05/neo-gauge-ultimate/ # 0.l: Script extracted / created. # #=============================================================================== module PAC_HUD #=============================================================================== # BEGIN CONFIGURATION #=============================================================================== BATTLESTATUS_NAME_FONT_SIZE = 20 # Font size used for name. BATTLESTATUS_TEXT_FONT_SIZE = 16 # Font size used for HP, MP, TP. BATTLESTATUS_NO_ACTION_ICON = 185 # No action icon. BATTLESTATUS_HPGAUGE_Y_PLUS = 11 # Y Location buffer used for HP gauge. BATTLESTATUS_CENTER_FACES = false # Center faces for the Battle Status. MP_OVER_TP = true # If TP is not drawn, draw MP? (still # applies notetag effects) #=============================================================================== # END CONFIGURATION #=============================================================================== end $imported ||= {} #============================================================================== # ■ Numeric #------------------------------------------------------------------------------ # Numeric は数値の抽象クラスです。Ruby では異なる数値クラス間で演算を行うことができます。 # 演算や比較を行うメソッド (+, -, *, /, <=>) などはサブクラスで定義されます。また、効率のため Numeric # のメソッドと同じメソッドがサブクラスで再定義されている場合があります。 私のひどい日本語を言い訳。 #============================================================================== class Numeric #-------------------------------------------------------------------------- # * Group Digits #-------------------------------------------------------------------------- unless defined?(group); def group; return self.to_s; end; end end #============================================================================== # ■ Game_Battler #------------------------------------------------------------------------------ # スプライトや行動に関するメソッドを追加したバトラーのクラスです。このクラス # は Game_Actor クラスと Game_Enemy クラスのスーパークラスとして使用されます。 #============================================================================== class Game_Battler < Game_BattlerBase #-------------------------------------------------------------------------- # * Draw Battler's HP? #-------------------------------------------------------------------------- def draw_hp?; return true; end #-------------------------------------------------------------------------- # * Draw Battler's MP? #-------------------------------------------------------------------------- def draw_mp?; return true; end #-------------------------------------------------------------------------- # * Draw Battler's TP? #-------------------------------------------------------------------------- def draw_tp? return $imported[:pac_change_gauge] ? $game_system.opt_display_tp : $data_system.opt_display_tp end end #============================================================================== # ■ Game_Actor #------------------------------------------------------------------------------ # アクターを扱うクラスです。このクラスは Game_Actors クラス($game_actors) # の内部で使用され、Game_Party クラス($game_party)からも参照されます。 #============================================================================== class Game_Actor < Game_Battler #-------------------------------------------------------------------------- # * Draw Actor's HP? #-------------------------------------------------------------------------- def draw_hp? return true if !self.actor.note[/\\def[_ ]?draw[_ ]?hp/i].nil? return false if !self.actor.note[/\\def[_ ]?not[_ ]?hp/i].nil? if $imported[:pac_gauge_change] return false if self.actor.no_hp_display? end return true end #-------------------------------------------------------------------------- # * Draw Actor's MP? #-------------------------------------------------------------------------- def draw_mp? return true if !self.actor.note[/\\def[_ ]?draw[_ ]?mp/i].nil? return false if !self.actor.note[/\\def[_ ]?not[_ ]?mp/i].nil? if $imported[:pac_gauge_change] return false if self.actor.no_mp_display? end return true if !draw_tp? && PAC_HUD::MP_OVER_TP for skill in skills next unless added_skill_types.include?(skill.stype_id) return true if skill.mp_cost > 0 end return false end #-------------------------------------------------------------------------- # * Draw Actor's TP? #-------------------------------------------------------------------------- def draw_tp? return true if !self.actor.note[/\\def[_ ]?draw[_ ]?tp/i].nil? return false if !self.actor.note[/\\def[_ ]?not[_ ]?tp/i].nil? if $imported[:pac_gauge_change] return false if self.actor.no_tp_display? end return false unless $imported[:pac_change_gauge] ? $game_system.opt_display_tp : $data_system.opt_display_tp for skill in skills next unless added_skill_types.include?(skill.stype_id) return true if skill.tp_cost > 0 end return false end end #============================================================================== # ■ Window_BattleStatus #------------------------------------------------------------------------------ # バトル画面で、パーティメンバーのステータスを表示するウィンドウです。 #============================================================================== class Window_BattleStatus < Window_Selectable #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize super(0, 0, window_width, window_height) self.openness = 0 @party = $game_party.battle_members.clone end #-------------------------------------------------------------------------- # * Column Max #-------------------------------------------------------------------------- def col_max; return $game_party.max_battle_members; end #-------------------------------------------------------------------------- # * Get Battle Members #-------------------------------------------------------------------------- def battle_members; return $game_party.battle_members; end #-------------------------------------------------------------------------- # * Get Current Actor #-------------------------------------------------------------------------- def actor; return battle_members[@index]; end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update super return if @party == $game_party.battle_members @party = $game_party.battle_members.clone refresh end #-------------------------------------------------------------------------- # * Draw Item # index : index of item to be drawn #-------------------------------------------------------------------------- def draw_item(index) return if index.nil? clear_item(index) actor = battle_members[index] rect = item_rect(index) return if actor.nil? draw_actor_face(actor, rect.x+2, rect.y+2, actor.alive?) draw_actor_name(actor, rect.x, rect.y, rect.width-8) draw_actor_action(actor, rect.x, rect.y) draw_actor_icons(actor, rect.x, line_height*1, rect.width) gx = PAC_HUD::BATTLESTATUS_HPGAUGE_Y_PLUS contents.font.size = PAC_HUD::BATTLESTATUS_TEXT_FONT_SIZE if draw_hp?(actor) draw_actor_hp(actor, rect.x+2, line_height*2+gx, rect.width-4) end if draw_tp?(actor) && draw_mp?(actor) dw = rect.width/2-2 dw += 1 if $imported["YEA-CoreEngine"] && YEA::CORE::GAUGE_OUTLINE draw_actor_tp(actor, rect.x+2, line_height*3, dw) dw = rect.width - rect.width/2 - 2 draw_actor_mp(actor, rect.x+rect.width/2, line_height*3, dw) elsif draw_tp?(actor) && !draw_mp?(actor) draw_actor_tp(actor, rect.x+2, line_height*3, rect.width-4) elsif !draw_tp?(actor) && draw_mp?(actor) draw_actor_mp(actor, rect.x+2, line_height*3, rect.width-4) else end end #-------------------------------------------------------------------------- # * Get Item Rect # index : index of item to get rect for #-------------------------------------------------------------------------- def item_rect(index) rect = Rect.new rect.width = contents.width / $game_party.max_battle_members rect.height = contents.height rect.x = index * rect.width if PAC_HUD::BATTLESTATUS_CENTER_FACES rect.x += (contents.width - $game_party.members.size * rect.width) / 2 end rect.y = 0 return rect end #-------------------------------------------------------------------------- # * Draw Face (specifically for this HUD) #-------------------------------------------------------------------------- def draw_face(face_name, face_index, dx, dy, enabled = true) bitmap = Cache.face(face_name) fx = [(96 - item_rect(0).width + 1) / 2, 0].max fy = face_index / 4 * 96 + 2 fw = [item_rect(0).width - 4, 92].min rect = Rect.new(fx, fy, fw, 92) rect = Rect.new(face_index % 4 * 96 + fx, fy, fw, 92) contents.blt(dx, dy, bitmap, rect, enabled ? 255 : translucent_alpha) bitmap.dispose end #-------------------------------------------------------------------------- # * Draw Actor Name #-------------------------------------------------------------------------- def draw_actor_name(actor, dx, dy, dw = 112) reset_font_settings contents.font.size = PAC_HUD::BATTLESTATUS_NAME_FONT_SIZE change_color(hp_color(actor)) draw_text(dx+24, dy, dw-24, line_height, actor.name) end #-------------------------------------------------------------------------- # * Draw Actor's Action Icon #-------------------------------------------------------------------------- def draw_actor_action(actor, dx, dy) draw_icon(action_icon(actor), dx, dy) end #-------------------------------------------------------------------------- # * Get Actor's Action Icon #-------------------------------------------------------------------------- def action_icon(actor) return PAC_HUD::BATTLESTATUS_NO_ACTION_ICON if actor.current_action.nil? return PAC_HUD::BATTLESTATUS_NO_ACTION_ICON if actor.current_action.item.nil? return actor.current_action.item.icon_index end #-------------------------------------------------------------------------- # * Draw Actor's TP? #-------------------------------------------------------------------------- def draw_tp?(actor) return actor.draw_tp? end #-------------------------------------------------------------------------- # * Draw Actor's MP? #-------------------------------------------------------------------------- def draw_mp?(actor) return actor.draw_mp? end #-------------------------------------------------------------------------- # * Draw Actor's HP? #-------------------------------------------------------------------------- def draw_hp?(actor) return actor.draw_hp? end #-------------------------------------------------------------------------- # * Draw Current & Max Values #-------------------------------------------------------------------------- def draw_current_and_max_values(dx, dy, dw, current, max, color1, color2) change_color(color1) draw_text(dx, dy, dw, line_height, current.group, 2) end #-------------------------------------------------------------------------- # * Draw Actor's HP Gauge #-------------------------------------------------------------------------- def draw_actor_hp(actor, dx, dy, width = 124, h = 6, *args) if defined?(draw_neo_gauge) # NGU Support gwidth = width * actor.hp / actor.mhp cg = neo_gauge_back_color c1, c2, c3 = cg[0], cg[1], cg[2] draw_neo_gauge(dx, dy + line_height - 8, width, h, c1, c2, c3) (1..3).each { |i| eval("c#{i} = HP_GCOLOR_#{i}")} draw_neo_gauge(dx, dy + line_height - 8, gwidth, h, c1, c2, c3, false, false, width, 40) else draw_gauge(dx, dy, width, actor.hp_rate, hp_gauge_color1, hp_gauge_color2) end change_color(system_color) cy = (Font.default_size - contents.font.size) / 2 + 1 draw_text(dx+2, dy+cy, 30, line_height, Vocab::hp_a) draw_current_and_max_values(dx, dy+cy, width, actor.hp, actor.mhp, hp_color(actor), normal_color) end #-------------------------------------------------------------------------- # * Draw Actor's MP Gauge #-------------------------------------------------------------------------- def draw_actor_mp(actor, dx, dy, width = 124) if defined?(draw_neo_gauge) # NGU Support gwidth = width * actor.mp / [actor.mmp, 1].max cg = neo_gauge_back_color c1, c2, c3 = cg[0], cg[1], cg[2] draw_neo_gauge(dx, dy + line_height - 8, width, 6, c1, c2, c3) (1..3).each { |i| eval("c#{i} = MP_GCOLOR_#{i}")} draw_neo_gauge(dx, dy + line_height - 8, gwidth, 6, c1, c2, c3, false, false, width, 40) else draw_gauge(dx, dy, width, actor.mp_rate, mp_gauge_color1, mp_gauge_color2) end change_color(system_color) cy = (Font.default_size - contents.font.size) / 2 + 1 draw_text(dx+2, dy+cy, 30, line_height, Vocab::mp_a) draw_current_and_max_values(dx, dy+cy, width, actor.mp, actor.mmp, mp_color(actor), normal_color) end #-------------------------------------------------------------------------- # * Draw Actor's TP Gauge #-------------------------------------------------------------------------- def draw_actor_tp(actor, dx, dy, width = 124) if defined?(draw_neo_gauge) # NGU Support gwidth = width * actor.tp / 100 cg = neo_gauge_back_color c1, c2, c3 = cg[0], cg[1], cg[2] draw_neo_gauge(dx, dy + line_height - 8, width, 6, c1, c2, c3) (1..3).each { |i| eval("c#{i} = TP_GCOLOR_#{i}")} draw_neo_gauge(dx, dy + line_height - 8, gwidth, 6, c1, c2, c3, false, false, width, 40) else draw_gauge(dx, dy, width, actor.tp_rate, tp_gauge_color1, tp_gauge_color2) end change_color(system_color) cy = (Font.default_size - contents.font.size) / 2 + 1 draw_text(dx+2, dy+cy, 30, line_height, Vocab::tp_a) change_color(tp_color(actor)) draw_text(dx + width - 42, dy+cy, 42, line_height, actor.tp.to_i, 2) end end $imported[:yanpac_battle_hud] = [0.3] #=============================================================================== # # END OF SCRIPT # #===============================================================================
Эту тему просматривают: 1 (пользователей: 0 , гостей: 1)
Социальные закладки