=begin
[ ===================================================================== ]
[ ==================================================================== ]
[ ============= ]| SCRIPT CRIADO POR: |[ ============= ]
[ ============= ]| |[ ============= ]
[ ============= ]| >>> Rafidelis <<< |[ ============= ]
[ ============= ]| ------------------------------ |[ ============= ]
[ ============= ]| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |[ ============= ]
[ ============= ]| >>> New Scene Visual Skill <<< |[ ============= ]
[ ============= ]| Rafa_fidelis@hotmail.com |[ ============= ]
[ ==================================================================== ]
[ ============ ] Mais Scripts de Rafidelis em : [ ============= ]
[ ============ ] >>> ReinoRpg.com <<< [ ============= ]
[ ==================================================================== ]
[ =============== ] CREDITOS [ ================ ]
[ ===== ] www.ReinoRpg.com| [ ===== ]
[ ==================================================================== ]
[ ==================================================================== ]
N E W S C E N E V I S U A L S K I L L
INSTRUÇÕES:
|===============================================================================
|
| 1° Mude na linha 62 se você ira ou não usar uma imagem de fundo |
| |
| Use true para usar imagem de fundo (A imagem tem que estar na pasta Pictures)|
| |
| Use false para não usar uma imagem no fundo |
================================================================================
|
| Para usar uma imagem de fundo a qualquer momento do jogo use o comando |
| chamar script e digite: |
| $USAR_IMG_FUNDO_SKILL = true |
| |
| Para retirar a imagem de fundo a qualquer momento do jogo use o comando |
| chamar script e digite: |
| $USAR_IMG_FUNDO_SKILL = false |
| ==============================================================================|
| |
| 2° Vá ate a linha 66 e defina o nome da imagem que deseja usar,caso o valor |
| da variavel na linha 62 for false,deixe o nome da imagem como está,ou em "" |
|===============================================================================
|
| Para mudar o nome da imagem de fundo a qualquer momento use o comando chamar |
| script e digite: |
| $NAME_IMG_SKILL = "NOME_DA_IMG" |
| Assim,a imagem de fundo da janela de equipamentos será a que você escolheu o |
| nome,caso a imagem não esteja na pasta picture,o script ira dizer que não |
| pode encontrar a imagem,sendo assim,ira gerar um erro. |
| ==============================================================================|
| OBS: O tamanho da imagem não pode superar o tamanho 544 x 416,mas recomendo |
| usar 544 x 209,assim a imagem ficara somente na parte da cima,não |
| atrapalhandoa visualização da janela de equipamentos. |
| Caso sua imagem não fique na posição desejada,mude nas linhas 64 e 65 as |
| posições horizontais e verticais da imagem |
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
=end
#===============================================================================
# I N I C I O D A S C O N F I G U R A Ç Õ E S
#-------------------------------------------------------------------------------
module Rafidelis
module Rafidelis_Skill
$USAR_IMG_FUNDO_SKILL = true # Use true Para Exibir | false para não usar imagem
#===============================================================================
# C O N F I G U R A Ç Õ E S D A I M A G E M
#-------------------------------------------------------------------------------
$NAME_IMG_SKILL = "IMAGEM4" # Nome da Imagem a ser usada
IMG_SKILL_POS_X = 0 # Opacidade da Imagem (0 ~ 255)
IMG_SKILL_POS_Y = 0 # Posição X (horizontal) da imagem
IMG_SKILL_OPACITY = 255 # Posição Y (vertical) da imagem
#===============================================================================
# C O N F I G U R A Ç Õ E S D A S J A N E L A S
#-------------------------------------------------------------------------------
OPACIDADE_WIN_HELP_SKILL = 0 # Opacidade da janela de ajuda,onde são exibidas as descrições das habilidades
OPACIDADE_WIN_STATUS_SKILL =0 # Opacidade da janela de status,onde são exibidos o HP,MP,NOME do personagem
OPACIDADE_WIN_COMAND_SKILL = 0 # Opacidade da janela de comando,onde são exibidos todas as habilidades(se for usar img deixe em 0)
OPACIDADE_WIN_USO_SKILL = 0 # Opacidade da janela que e exibida quando você decide usar uma habilidade
#===============================================================================
# F I M D A S C O N F I G U R A Ç Õ E S
#-------------------------------------------------------------------------------
end
end
class Scene_Skill < Scene_Base
def initialize(actor_index = 0, equip_index = 0)
@actor_index = actor_index
end
def start
super
create_menu_background
if $USAR_IMG_FUNDO_SKILL
@back_skill_img = Sprite.new
@back_skill_img.bitmap = Cache.picture($NAME_IMG_SKILL)
@back_skill_img.x = Rafidelis::Rafidelis_Skill::IMG_SKILL_POS_X
@back_skill_img.y = Rafidelis::Rafidelis_Skill::IMG_SKILL_POS_Y
@back_skill_img.opacity = Rafidelis::Rafidelis_Skill::IMG_SKILL_OPACITY
end
@actor = $game_party.members[@actor_index]
@viewport = Viewport.new(0, 0, 544, 416)
@help_window = Window_Help.new
@help_window.opacity = Rafidelis::Rafidelis_Skill::OPACIDADE_WIN_HELP_SKILL
@help_window.viewport = @viewport
@status_window = Window_SkillStatus.new(0, 56, @actor)
@status_window.opacity = Rafidelis::Rafidelis_Skill::OPACIDADE_WIN_STATUS_SKILL
@status_window.viewport = @viewport
@skill_window = Window_Skill.new(0, 112, 544, 304, @actor)
@skill_window.opacity = Rafidelis::Rafidelis_Skill::OPACIDADE_WIN_COMAND_SKILL
@skill_window.viewport = @viewport
@skill_window.help_window = @help_window
@target_window = Window_MenuStatus.new(0, 0)
@target_window.opacity = Rafidelis::Rafidelis_Skill::OPACIDADE_WIN_USO_SKILL
hide_target_window
end
def terminate
super
dispose_menu_background
@help_window.dispose
@status_window.dispose
@skill_window.dispose
@target_window.dispose
if $USAR_IMG_SKILL then @back_skill_img.dispose end
end
def return_scene
$scene = Scene_Menu.new(1)
end
def next_actor
@actor_index += 1
@actor_index %= $game_party.members.size
$scene = Scene_Skill.new(@actor_index)
end
def prev_actor
@actor_index += $game_party.members.size - 1
@actor_index %= $game_party.members.size
$scene = Scene_Skill.new(@actor_index)
end
def update
super
update_menu_background
@help_window.update
@status_window.update
@skill_window.update
@target_window.update
if $USAR_IMG_SKILL then @back_skill_img.update end
if @skill_window.active
update_skill_selection
elsif @target_window.active
update_target_selection
end
end
def update_skill_selection
if Input.trigger?(Input::

Sound.play_cancel
return_scene
elsif Input.trigger?(Input::R)
Sound.play_cursor
next_actor
elsif Input.trigger?(Input::L)
Sound.play_cursor
prev_actor
elsif Input.trigger?(Input::C)
@skill = @skill_window.skill
if @skill != nil
@actor.last_skill_id = @skill.id
end
if @actor.skill_can_use?(@skill)
Sound.play_decision
determine_skill
else
Sound.play_buzzer
end
end
end
def determine_skill
if @skill.for_friend?
show_target_window(@skill_window.index % 2 == 0)
if @skill.for_all?
@target_window.index = 99
elsif @skill.for_user?
@target_window.index = @actor_index + 100
else
if $game_party.last_target_index < @target_window.item_max
@target_window.index = $game_party.last_target_index
else
@target_window.index = 0
end
end
else
use_skill_nontarget
end
end
def update_target_selection
@help_window.opacity = Rafidelis::Rafidelis_Skill::OPACIDADE_WIN_USO_SKILL
if Input.trigger?(Input::
Sound.play_cancel
@help_window.opacity = Rafidelis::Rafidelis_Skill::OPACIDADE_WIN_HELP_SKILL
hide_target_window
elsif Input.trigger?(Input::C)
if not @actor.skill_can_use?(@skill)
Sound.play_buzzer
else
determine_target
end
end
end
def determine_target
used = false
if @skill.for_all?
for target in $game_party.members
target.skill_effect(@actor, @skill)
used = true unless target.skipped
end
elsif @skill.for_user?
target = $game_party.members[@target_window.index - 100]
target.skill_effect(@actor, @skill)
used = true unless target.skipped
else
$game_party.last_target_index = @target_window.index
target = $game_party.members[@target_window.index]
target.skill_effect(@actor, @skill)
used = true unless target.skipped
end
if used
use_skill_nontarget
else
Sound.play_buzzer
end
end
def show_target_window(right)
@skill_window.active = false
width_remain = 544 - @target_window.width
@target_window.x = right ? width_remain : 0
@target_window.visible = true
@target_window.active = true
if right
@viewport.rect.set(0, 0, width_remain, 416)
@viewport.ox = 0
else
@viewport.rect.set(@target_window.width, 0, width_remain, 416)
@viewport.ox = @target_window.width
end
end
def hide_target_window
@skill_window.active = true
@target_window.visible = false
@target_window.active = false
@viewport.rect.set(0, 0, 544, 416)
@viewport.ox = 0
end
def use_skill_nontarget
Sound.play_use_skill
@actor.mp -= @actor.calc_mp_cost(@skill)
@status_window.refresh
@skill_window.refresh
@target_window.refresh
if $game_party.all_dead?
$scene = Scene_Gameover.new
elsif @skill.common_event_id > 0
$game_temp.common_event_id = @skill.common_event_id
$scene = Scene_Map.new
end
end
end