#==============================================================================
# ** Enable Part III Check
#==============================================================================
if SDK::Parts.include?(4) || SDK::Indidual_Parts.include?('PART 4#SCENE_SKILL')
#==============================================================================
# ** Scene_Skill
#------------------------------------------------------------------------------
# This class performs skill screen processing.
#==============================================================================
class Scene_Skill < SDK::Scene_Base
#--------------------------------------------------------------------------
# * SDK Log Branch
#--------------------------------------------------------------------------
SDK.log_branch(:Scene_Skill, :update_skill, :update_skill_cancel,
:update_skill_decision, :update_skill_next_actor, :update_skill_prev_actor)
SDK.log_branch(:Scene_Skill, :update_skill_decision, :update_skill_cant_use?,
:update_skill_scope_ally, :update_skill_common_event)
#--------------------------------------------------------------------------
# * Frame Update (if skill window is active)
#--------------------------------------------------------------------------
def update_skill
# If B button was pressed
if Input.trigger?(Input::B)
update_skill_cancel
return
# If C button was pressed
elsif Input.trigger?(Input::C)
update_skill_decision
return
# If R button was pressed
elsif Input.trigger?(Input::R)
update_skill_next_actor
return
# If L button was pressed
elsif Input.trigger?(Input::L)
update_skill_prev_actor
return
end
end
#-----------------------------------------------------------------------------
# * Update Skill : Page Up
#-----------------------------------------------------------------------------
def update_skill_next_actor
# Play cursor SE
$game_system.se_play($data_system.cursor_se)
# To next actor
@actor_index += 1
@actor_index %= $game_party.actors.size
# Switch to different skill screen
$scene = Scene_Skill.new(@actor_index)
end
#-----------------------------------------------------------------------------
# * Update Skill : Page Down
#-----------------------------------------------------------------------------
def update_skill_prev_actor
# Play cursor SE
$game_system.se_play($data_system.cursor_se)
# To previous actor
@actor_index += $game_party.actors.size - 1
@actor_index %= $game_party.actors.size
# Switch to different skill screen
$scene = Scene_Skill.new(@actor_index)
end
#-----------------------------------------------------------------------------
# * Update Skill : Cancel
#-----------------------------------------------------------------------------
def update_skill_cancel
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to menu screen
$scene = Scene_Menu.new(1)
return
end
#-----------------------------------------------------------------------------
# * Update Skill : Decision
#-----------------------------------------------------------------------------
def update_skill_decision
# Get currently selected data on the skill window
@skill = @skill_window.skill
# If unable to use
if update_skill_cant_use?
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Play decision SE
$game_system.se_play($data_system.decision_se)
# If effect scope is ally
if @skill.scope >= 3
update_skill_scope_ally
# If effect scope is other than ally
else
# If common event ID is valid
if @skill.common_event_id > 0
update_skill_common_event
return
end
end
end
#-----------------------------------------------------------------------------
# * Update Skill : Can't Use?
#-----------------------------------------------------------------------------
def update_skill_cant_use?
return @skill.nil? ||
[email protected]_can_use?(@skill.id)
end
#-----------------------------------------------------------------------------
# * Update Skill : Scope Ally
#-----------------------------------------------------------------------------
def update_skill_scope_ally
# Activate target window
@skill_window.active = false
@target_window.x = (@skill_window.index + 1) % 2 * 304
@target_window.visible = true
@target_window.active = true
# Set cursor position to effect scope (single / all)
if @skill.scope == 4 || @skill.scope == 6
@target_window.index = -1
elsif @skill.scope == 7
@target_window.index = @actor_index - 10
else
@target_window.index = 0
end
end
#-----------------------------------------------------------------------------
# * Update Skill : Common Event
#-----------------------------------------------------------------------------
def update_skill_common_event
# Common event call reservation
$game_temp.common_event_id = @skill.common_event_id
# Play use skill SE
$game_system.se_play(@skill.menu_se)
# Use up SP
@actor.sp -= @skill.sp_cost
# Remake each window content
@status_window.refresh
@skill_window.refresh
@target_window.refresh
# Switch to map screen
$scene = Scene_Map.new
end
end
#==============================================================================
# ** Ends Enable Part III Check
#==============================================================================
end
Expand to see the code.