MOG Cross Battle Command V1.1

15 de abril de 2014
MOG Cross Battle Command V1.1

MOG Cross Battle Command é um script para o RPG Maker XP, desenvolvido pelo Moghunter, que adiciona o Menu Battle Command (Menu de Comando de Batalha) com figuras e movimento durante as batalhas.

O script é de fácil instalação e utilização e pode dar ao seu projeto um visual diferente com pouco trabalho:

MOG Cross Battle Command

Instalação

Copie as imagens abaixo para dentro da pasta Graphics/Pictures:

Cursor

Bat_Com

Insira o código abaixo acima do “Main”:

#_________________________________________________
# MOG_Cross Battle Command V1.1            
#_________________________________________________
# By Moghunter   
# http://www.atelier-rgss.com
#_________________________________________________
# Adiciona o Menu Battle Command em picture com movimento.
#_________________________________________________
module MOG
# Posição na horizontal.  
COM_X = 30
# Posição na vertical.  
COM_Y = 180
# Velocidade do deslize.
COM_SPEED = 15
# Definição do nome da Picture do cursor.
COMPIC_CUR = "Cursor"
# Definição do nome da Picture do comando.
COMPIC_COM = "Bat_Com"
end  
$mogscript = {} if $mogscript == nil
$mogscript["cross_battle_command"] = true
#############
# Com_Selec #
#############
class Com_Selec < Window_Base
attr_reader   :index       
include MOG
def initialize(x, y, width, height)
super(x, y, width, height)
@item_max = 1
@column_max = 1
@index = -1
@cursor = Sprite.new
@cursor.bitmap = RPG::Cache.picture(COMPIC_CUR)
@cursor.visible = false
end
def index=(index)
@index = index    
update_cursor_rect
end
def row_max
return (@item_max + @column_max - 1) / @column_max
end
def top_row
return self.oy / 32
end
def top_row=(row)
if row < 0
row = 0
end
if row > row_max - 1
row = row_max - 1
end
self.oy = row * 32
end
def page_row_max
return 
end
def page_item_max
return page_row_max * @column_max
end
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
@cursor.dispose if @cursor != nil 
return
end
if self.active == false
@cursor.visible = false
else
@cursor.visible = true
end
row = @index / @column_max
cursor_width = self.width / @column_max - 32
x = @index % @column_max 
y = @index / @column_max 
if @index == 0 
@cursor.x = self.x + x + 32
@cursor.y = self.y + y + 22  
elsif @index == 1
@cursor.x = self.x + x 
@cursor.y = self.y + y + 48  
elsif @index == 2
@cursor.x = self.x + x + 60
@cursor.y = self.y + y + 48 
else
@cursor.x = self.x + x + 32
@cursor.y = self.y + y + 72   
end    
@cursor.z = self.z + 5       
end
def update
super
if @index < 0
@cursor.dispose if @cursor != nil 
return
end
if self.active and @item_max > 0 and @index >= 0  
if Input.repeat?(Input::DOWN)
$game_system.se_play($data_system.cursor_se)
@index = 3
end
if Input.repeat?(Input::UP)
$game_system.se_play($data_system.cursor_se)
@index = 0
end
if Input.repeat?(Input::RIGHT)
$game_system.se_play($data_system.cursor_se)
@index = 2
end
if Input.repeat?(Input::LEFT)
$game_system.se_play($data_system.cursor_se)
@index = 1
end
end
update_cursor_rect
end
end
###############
# Window_Base #
###############
class Window_Base < Window  
def draw_batcom(x,y)  
com = RPG::Cache.picture(MOG::COMPIC_COM)    
cw = com.width  
ch = com.height 
src_rect = Rect.new(0, 0, cw, ch)    
self.contents.blt(x , y - ch , com, src_rect)
end
end
##################
# Win_Battle_Com #
##################
class Win_Battle_Com < Com_Selec
def initialize
super(50, 0, 125, 125)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = 0
refresh    
self.index = 0
end
def item
return @data[self.index]
end  
def refresh
self.contents.clear 
draw_batcom(0,90)
@item_max = 4
end
end
################
# Scene_Battle #
################
class Scene_Battle
include MOG
alias mog31_start_phase1 start_phase1
def start_phase1
@actor_command_window = Win_Battle_Com.new
@actor_command_window.y = 400
@actor_command_window.back_opacity = 0
@actor_command_window.opacity = 0
@actor_command_window.contents_opacity = 0    
@actor_command_window.active = false
@actor_command_window.visible = false
@actor_command_window.update
mog31_start_phase1
end
alias mog31_update_phase3_basic_command update_phase3_basic_command
def update_phase3_basic_command
mog31_update_phase3_basic_command  
@actor_command_window.x = COM_X + @actor_index * 160
if @actor_command_window.visible == false
@actor_command_window.y = 400
@actor_command_window.contents_opacity = 0
end
if @actor_command_window.y > COM_Y
@actor_command_window.y -= COM_SPEED
@actor_command_window.contents_opacity += 15
elsif @actor_command_window.y <= COM_Y
@actor_command_window.y = COM_Y
@actor_command_window.contents_opacity = 255
end
if Input.trigger?(Input::B) or Input.trigger?(Input::C)
@actor_command_window.y = 480
@actor_command_window.opacity = 0
@actor_command_window.contents_opacity = 0
end
end
end

Deixe um comentário

  • Seja social e nos siga!

           
  • Páginas

  • Tags Especiais

  • Categorias

  • Parceiros

  • eXTReMe Tracker
    Copyright © 2001 - 2017 Gaming Room. Todos os Direitos Reservados - É expressamente proibida a reprodução total ou parcial deste site sem o consentimento dos autores.