如图,默认选择的是“史莱姆A”, 如果想要改成选择本体的话该怎么做呢……?脚本小白,求详细一些
纸飞机哟 发表于 2015-3-13 23:32 论坛里搜索了一下没找到,在百度找到28M的一个包,不知道是不是…如果可以的话请贴上来一下?? ...
#==============================================================================# +++ MOG - Battle Cursor (1.0) +++#==============================================================================# By Moghunter # [url]http://www.atelier-rgss.com/[/url]#==============================================================================# Sistema de cursor animado de batalha nos sprites dos battlers.#==============================================================================# Arquivo necessário. (Graphics/System)# # Battle_Cursor.png##============================================================================== #==============================================================================# ■ CURSOR SETTING#==============================================================================module MOG_BATTLE_CURSOR #Definição da posição do cursor em relação ao alvo. CURSOR_POSITION = [-45, -16] #Definição da posição do nome do alvo. CURSOR_NAME_POSITION = [-10, 35] #Ativar efeito deslizar. CURSOR_SLIDE_EFFECT = true #Ativar animação de levitação. CURSOR_FLOAT_EFFECT = true #Definição da prioridade do cursor. CURSOR_Z = 0end #==============================================================================# ■ Game Temp#==============================================================================class Game_Temp attr_accessor :battle_cursor #-------------------------------------------------------------------------- # ● Initialize #-------------------------------------------------------------------------- alias mog_battle_cursor_initialize initialize def initialize @battle_cursor = [0,0,false,""] mog_battle_cursor_initialize end end #==============================================================================# ■ Spriteset Battle Cursor#==============================================================================class Sprite_Battle_Cursor < Sprite include MOG_BATTLE_CURSOR #-------------------------------------------------------------------------- # ● Initialize #-------------------------------------------------------------------------- def initialize(viewport = nil) super(viewport) $game_temp.battle_cursor = [0,0,false,""] self.bitmap = Cache.system("Battle_Cursor") self.visible = $game_temp.battle_cursor[2] self.z = CURSOR_Z self.z = 10 if $mog_rgss3_battle_hud != nil @cursor_name = Sprite.new @cursor_name.bitmap = Bitmap.new(120,32) @cursor_name.z = self.z + 1 @cursor_name.bitmap.font.size = 16 @cursor_name_enemy = $game_temp.battle_cursor[3] @cursor_name_position = [CURSOR_NAME_POSITION[0] ,CURSOR_NAME_POSITION[1]] @cursor_float = [0,0] refresh_cursor_name end #-------------------------------------------------------------------------- # ● Dispose Sprite #-------------------------------------------------------------------------- def dispose super dispose_sprite_cursor end #-------------------------------------------------------------------------- # ● Dispose Sprite Cursor #-------------------------------------------------------------------------- def dispose_sprite_cursor if @cursor_name != nil @cursor_name.bitmap.dispose @cursor_name.dispose end self.bitmap.dispose end #-------------------------------------------------------------------------- # ● Refresh Cursor Name #-------------------------------------------------------------------------- def refresh_cursor_name @cursor_name_enemy = $game_temp.battle_cursor[3] @cursor_name.bitmap.clear @cursor_name.bitmap.draw_text(0,0,120,32,@cursor_name_enemy.to_s,1) end #-------------------------------------------------------------------------- # ● Update #-------------------------------------------------------------------------- def update super update_sprite_cursor end #-------------------------------------------------------------------------- # ● Update Sprite Cursor #-------------------------------------------------------------------------- def update_sprite_cursor update_visible update_cursor_float_effect execute_move(0,self.x,$game_temp.battle_cursor[0]) execute_move(1,self.y,$game_temp.battle_cursor[1] + @cursor_float[1]) update_sprite_name end #-------------------------------------------------------------------------- # ● Update Visible #-------------------------------------------------------------------------- def update_visible self.visible = $game_temp.battle_cursor[2] if !self.visible self.x = -64 self.y = -64 end end #-------------------------------------------------------------------------- # ● Update Sprite Name #-------------------------------------------------------------------------- def update_sprite_name return if @cursor_name == nil refresh_cursor_name if @cursor_name_enemy != $game_temp.battle_cursor[3] @cursor_name.x = self.x + @cursor_name_position[0] @cursor_name.y = self.y + @cursor_name_position[1] @cursor_name.opacity = self.opacity @cursor_name.visible = self.visible end #-------------------------------------------------------------------------- # ● Update Cursor Float Effect #-------------------------------------------------------------------------- def update_cursor_float_effect return if !CURSOR_FLOAT_EFFECT @cursor_float[0] += 1 case @cursor_float[0] when 0..20 @cursor_float[1] += 1 when 21..40 @cursor_float[1] -= 1 else @cursor_float[0] = 0 @cursor_float[1] = 0 end end #-------------------------------------------------------------------------- # ● Execute Move #-------------------------------------------------------------------------- def execute_move(type,cp,np) sp = 5 + ((cp - np).abs / 5) if cp > np cp -= sp cp = np if cp < np elsif cp < np cp += sp cp = np if cp > np end self.x = cp if type == 0 self.y = cp if type == 1 end end #==============================================================================# ■ Spriteset Battle#==============================================================================class Spriteset_Battle #-------------------------------------------------------------------------- # ● Initialize #-------------------------------------------------------------------------- alias mog_battle_cursor_initialize initialize def initialize mog_battle_cursor_initialize create_cursor end #-------------------------------------------------------------------------- # ● Dispose #-------------------------------------------------------------------------- alias mog_battle_cursor_dispose dispose def dispose mog_battle_cursor_dispose dispose_cursor end #-------------------------------------------------------------------------- # ● Update #-------------------------------------------------------------------------- alias mog_battle_cursor_update update def update mog_battle_cursor_update update_battle_cursor end #-------------------------------------------------------------------------- # ● Create_Cursor #-------------------------------------------------------------------------- def create_cursor return if @battle_cursor != nil @battle_cursor = Sprite_Battle_Cursor.new end #-------------------------------------------------------------------------- # ● Dispose Cursor #-------------------------------------------------------------------------- def dispose_cursor return if @battle_cursor == nil @battle_cursor.dispose end #-------------------------------------------------------------------------- # ● Update Battle Cursor #-------------------------------------------------------------------------- def update_battle_cursor return if @battle_cursor == nil @battle_cursor.update end end #==============================================================================# ■ Battle Cursor Index#==============================================================================module Battle_Cursor_index include MOG_BATTLE_CURSOR #-------------------------------------------------------------------------- # ● Check Index Limit #-------------------------------------------------------------------------- def check_index_limit self.index = 0 if self.index >= item_max self.index = (item_max - 1) if self.index < 0 end #-------------------------------------------------------------------------- # ● Set Cursor Position Enemy #-------------------------------------------------------------------------- def set_cursor_position_enemy return if !self.active $game_temp.battle_cursor[0] = $game_troop.alive_members[self.index].screen_x + CURSOR_POSITION[0] rescue nil $game_temp.battle_cursor[1] = $game_troop.alive_members[self.index].screen_y + CURSOR_POSITION[1] rescue nil $game_temp.battle_cursor[3] = $game_troop.alive_members[self.index].name rescue nil $game_temp.battle_cursor = [0,0,false,0] if $game_temp.battle_cursor[0] == nil end #-------------------------------------------------------------------------- # ● Set Cursor Position Actor #-------------------------------------------------------------------------- def set_cursor_position_actor return if !self.active $game_temp.battle_cursor[0] = $game_party.members[self.index].screen_x + CURSOR_POSITION[0] rescue nil $game_temp.battle_cursor[1] = $game_party.members[self.index].screen_y + CURSOR_POSITION[1] rescue nil $game_temp.battle_cursor[3] = $game_party.members[self.index].name rescue nil $game_temp.battle_cursor = [0,0,false,0] if $game_temp.battle_cursor[0] == nil end #-------------------------------------------------------------------------- # ● Process Cursor Move #-------------------------------------------------------------------------- def process_cursor_move return unless cursor_movable? last_index = @index cursor_move_index(+1) if Input.repeat?(:DOWN) cursor_move_index(-1) if Input.repeat?(:UP) cursor_move_index(+1) if Input.repeat?(:RIGHT) cursor_move_index(-1) if Input.repeat?(:LEFT) if @index != last_index Sound.play_cursor end end #-------------------------------------------------------------------------- # ● Process Cursor Move Index #-------------------------------------------------------------------------- def cursor_move_index(value = 0) self.index += value check_index_limit end end #==============================================================================# ■ Window_BattleActor#==============================================================================class Window_BattleActor < Window_BattleStatus include Battle_Cursor_index #-------------------------------------------------------------------------- # ● Update #-------------------------------------------------------------------------- def update super set_cursor_position_actor end #-------------------------------------------------------------------------- # ● Show #-------------------------------------------------------------------------- alias mog_battle_cursor_show show def show if @info_viewport set_cursor_position_actor $game_temp.battle_cursor[2] = true end mog_battle_cursor_show end #-------------------------------------------------------------------------- # ● Hide #-------------------------------------------------------------------------- alias mog_battle_cursor_hide hide def hide if @info_viewport $game_temp.battle_cursor[2] = false end mog_battle_cursor_hide end end #==============================================================================# ■ Window_BattleEnemy#==============================================================================class Window_BattleEnemy < Window_Selectable include Battle_Cursor_index #-------------------------------------------------------------------------- # ● Update #-------------------------------------------------------------------------- def update super set_cursor_position_enemy end #-------------------------------------------------------------------------- # ● Show #-------------------------------------------------------------------------- alias mog_battle_cursor_show show def show if @info_viewport set_cursor_position_enemy $game_temp.battle_cursor[2] = true end mog_battle_cursor_show end #-------------------------------------------------------------------------- # ● Hide #-------------------------------------------------------------------------- alias mog_battle_cursor_hide hide def hide if @info_viewport $game_temp.battle_cursor[2] = false end mog_battle_cursor_hide end end $mog_rgss3_battle_cursor = true
#============================================================================== # +++ MOG - Battle Cursor (1.0) +++ #============================================================================== # By Moghunter # [url]http://www.atelier-rgss.com/[/url] #============================================================================== # Sistema de cursor animado de batalha nos sprites dos battlers. #============================================================================== # Arquivo necessário. (Graphics/System) # # Battle_Cursor.png # #============================================================================== #============================================================================== # ■ CURSOR SETTING #============================================================================== module MOG_BATTLE_CURSOR #Definição da posição do cursor em relação ao alvo. CURSOR_POSITION = [-45, -16] #Definição da posição do nome do alvo. CURSOR_NAME_POSITION = [-10, 35] #Ativar efeito deslizar. CURSOR_SLIDE_EFFECT = true #Ativar animação de levitação. CURSOR_FLOAT_EFFECT = true #Definição da prioridade do cursor. CURSOR_Z = 0 end #============================================================================== # ■ Game Temp #============================================================================== class Game_Temp attr_accessor :battle_cursor #-------------------------------------------------------------------------- # ● Initialize #-------------------------------------------------------------------------- alias mog_battle_cursor_initialize initialize def initialize @battle_cursor = [0,0,false,""] mog_battle_cursor_initialize end end #============================================================================== # ■ Spriteset Battle Cursor #============================================================================== class Sprite_Battle_Cursor < Sprite include MOG_BATTLE_CURSOR #-------------------------------------------------------------------------- # ● Initialize #-------------------------------------------------------------------------- def initialize(viewport = nil) super(viewport) $game_temp.battle_cursor = [0,0,false,""] self.bitmap = Cache.system("Battle_Cursor") self.visible = $game_temp.battle_cursor[2] self.z = CURSOR_Z self.z = 10 if $mog_rgss3_battle_hud != nil @cursor_name = Sprite.new @cursor_name.bitmap = Bitmap.new(120,32) @cursor_name.z = self.z + 1 @cursor_name.bitmap.font.size = 16 @cursor_name_enemy = $game_temp.battle_cursor[3] @cursor_name_position = [CURSOR_NAME_POSITION[0] ,CURSOR_NAME_POSITION[1]] @cursor_float = [0,0] refresh_cursor_name end #-------------------------------------------------------------------------- # ● Dispose Sprite #-------------------------------------------------------------------------- def dispose super dispose_sprite_cursor end #-------------------------------------------------------------------------- # ● Dispose Sprite Cursor #-------------------------------------------------------------------------- def dispose_sprite_cursor if @cursor_name != nil @cursor_name.bitmap.dispose @cursor_name.dispose end self.bitmap.dispose end #-------------------------------------------------------------------------- # ● Refresh Cursor Name #-------------------------------------------------------------------------- def refresh_cursor_name @cursor_name_enemy = $game_temp.battle_cursor[3] @cursor_name.bitmap.clear @cursor_name.bitmap.draw_text(0,0,120,32,@cursor_name_enemy.to_s,1) end #-------------------------------------------------------------------------- # ● Update #-------------------------------------------------------------------------- def update super update_sprite_cursor end #-------------------------------------------------------------------------- # ● Update Sprite Cursor #-------------------------------------------------------------------------- def update_sprite_cursor update_visible update_cursor_float_effect execute_move(0,self.x,$game_temp.battle_cursor[0]) execute_move(1,self.y,$game_temp.battle_cursor[1] + @cursor_float[1]) update_sprite_name end #-------------------------------------------------------------------------- # ● Update Visible #-------------------------------------------------------------------------- def update_visible self.visible = $game_temp.battle_cursor[2] if !self.visible self.x = -64 self.y = -64 end end #-------------------------------------------------------------------------- # ● Update Sprite Name #-------------------------------------------------------------------------- def update_sprite_name return if @cursor_name == nil refresh_cursor_name if @cursor_name_enemy != $game_temp.battle_cursor[3] @cursor_name.x = self.x + @cursor_name_position[0] @cursor_name.y = self.y + @cursor_name_position[1] @cursor_name.opacity = self.opacity @cursor_name.visible = self.visible end #-------------------------------------------------------------------------- # ● Update Cursor Float Effect #-------------------------------------------------------------------------- def update_cursor_float_effect return if !CURSOR_FLOAT_EFFECT @cursor_float[0] += 1 case @cursor_float[0] when 0..20 @cursor_float[1] += 1 when 21..40 @cursor_float[1] -= 1 else @cursor_float[0] = 0 @cursor_float[1] = 0 end end #-------------------------------------------------------------------------- # ● Execute Move #-------------------------------------------------------------------------- def execute_move(type,cp,np) sp = 5 + ((cp - np).abs / 5) if cp > np cp -= sp cp = np if cp < np elsif cp < np cp += sp cp = np if cp > np end self.x = cp if type == 0 self.y = cp if type == 1 end end #============================================================================== # ■ Spriteset Battle #============================================================================== class Spriteset_Battle #-------------------------------------------------------------------------- # ● Initialize #-------------------------------------------------------------------------- alias mog_battle_cursor_initialize initialize def initialize mog_battle_cursor_initialize create_cursor end #-------------------------------------------------------------------------- # ● Dispose #-------------------------------------------------------------------------- alias mog_battle_cursor_dispose dispose def dispose mog_battle_cursor_dispose dispose_cursor end #-------------------------------------------------------------------------- # ● Update #-------------------------------------------------------------------------- alias mog_battle_cursor_update update def update mog_battle_cursor_update update_battle_cursor end #-------------------------------------------------------------------------- # ● Create_Cursor #-------------------------------------------------------------------------- def create_cursor return if @battle_cursor != nil @battle_cursor = Sprite_Battle_Cursor.new end #-------------------------------------------------------------------------- # ● Dispose Cursor #-------------------------------------------------------------------------- def dispose_cursor return if @battle_cursor == nil @battle_cursor.dispose end #-------------------------------------------------------------------------- # ● Update Battle Cursor #-------------------------------------------------------------------------- def update_battle_cursor return if @battle_cursor == nil @battle_cursor.update end end #============================================================================== # ■ Battle Cursor Index #============================================================================== module Battle_Cursor_index include MOG_BATTLE_CURSOR #-------------------------------------------------------------------------- # ● Check Index Limit #-------------------------------------------------------------------------- def check_index_limit self.index = 0 if self.index >= item_max self.index = (item_max - 1) if self.index < 0 end #-------------------------------------------------------------------------- # ● Set Cursor Position Enemy #-------------------------------------------------------------------------- def set_cursor_position_enemy return if !self.active $game_temp.battle_cursor[0] = $game_troop.alive_members[self.index].screen_x + CURSOR_POSITION[0] rescue nil $game_temp.battle_cursor[1] = $game_troop.alive_members[self.index].screen_y + CURSOR_POSITION[1] rescue nil $game_temp.battle_cursor[3] = $game_troop.alive_members[self.index].name rescue nil $game_temp.battle_cursor = [0,0,false,0] if $game_temp.battle_cursor[0] == nil end #-------------------------------------------------------------------------- # ● Set Cursor Position Actor #-------------------------------------------------------------------------- def set_cursor_position_actor return if !self.active $game_temp.battle_cursor[0] = $game_party.members[self.index].screen_x + CURSOR_POSITION[0] rescue nil $game_temp.battle_cursor[1] = $game_party.members[self.index].screen_y + CURSOR_POSITION[1] rescue nil $game_temp.battle_cursor[3] = $game_party.members[self.index].name rescue nil $game_temp.battle_cursor = [0,0,false,0] if $game_temp.battle_cursor[0] == nil end #-------------------------------------------------------------------------- # ● Process Cursor Move #-------------------------------------------------------------------------- def process_cursor_move return unless cursor_movable? last_index = @index cursor_move_index(+1) if Input.repeat?(:DOWN) cursor_move_index(-1) if Input.repeat?(:UP) cursor_move_index(+1) if Input.repeat?(:RIGHT) cursor_move_index(-1) if Input.repeat?(:LEFT) if @index != last_index Sound.play_cursor end end #-------------------------------------------------------------------------- # ● Process Cursor Move Index #-------------------------------------------------------------------------- def cursor_move_index(value = 0) self.index += value check_index_limit end end #============================================================================== # ■ Window_BattleActor #============================================================================== class Window_BattleActor < Window_BattleStatus include Battle_Cursor_index #-------------------------------------------------------------------------- # ● Update #-------------------------------------------------------------------------- def update super set_cursor_position_actor end #-------------------------------------------------------------------------- # ● Show #-------------------------------------------------------------------------- alias mog_battle_cursor_show show def show if @info_viewport set_cursor_position_actor $game_temp.battle_cursor[2] = true end mog_battle_cursor_show end #-------------------------------------------------------------------------- # ● Hide #-------------------------------------------------------------------------- alias mog_battle_cursor_hide hide def hide if @info_viewport $game_temp.battle_cursor[2] = false end mog_battle_cursor_hide end end #============================================================================== # ■ Window_BattleEnemy #============================================================================== class Window_BattleEnemy < Window_Selectable include Battle_Cursor_index #-------------------------------------------------------------------------- # ● Update #-------------------------------------------------------------------------- def update super set_cursor_position_enemy end #-------------------------------------------------------------------------- # ● Show #-------------------------------------------------------------------------- alias mog_battle_cursor_show show def show if @info_viewport set_cursor_position_enemy $game_temp.battle_cursor[2] = true end mog_battle_cursor_show end #-------------------------------------------------------------------------- # ● Hide #-------------------------------------------------------------------------- alias mog_battle_cursor_hide hide def hide if @info_viewport $game_temp.battle_cursor[2] = false end mog_battle_cursor_hide end end $mog_rgss3_battle_cursor = true
tan12345 发表于 2015-3-13 23:09 请使用MOG的MOG - Battle Cursor这个脚本
折叠内容标题(非必须)
折叠内容
站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作
GMT+8, 2024-11-15 22:39
Powered by Discuz! X3.1
© 2001-2013 Comsenz Inc.