07-17-2008, 01:00 PM
Unique Class Commands
by vinardo
Version: 1.0 (17.07.08)
Introduction
If you don't like defense and you like steal, peep/scan or treatment, then this script can help you.
Demo
UniqueClassCommand.zip (Size: 299.45 KB / Downloads: 1)
Script
Author's Notes
It's my first script, so there can be errors...
Sorry for my english lang. - I'm from Poland...
by vinardo
Version: 1.0 (17.07.08)
This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss.
No support is given. If you are the owner of the thread, please contact administration.
No support is given. If you are the owner of the thread, please contact administration.
Introduction
If you don't like defense and you like steal, peep/scan or treatment, then this script can help you.
Demo
UniqueClassCommand.zip (Size: 299.45 KB / Downloads: 1)
Script
Script
Code:
#==============================================================================
# UNIQUE CLASS COMMAND
# It is my first script...
# Vinardo
#==============================================================================
class Game_Temp
attr_reader :guard_skill
end
class Scene_Battle
Guard_command_names = [
# Change names of unique commands ('Defendx' x- number)
{'CLASS_ID'=>1,'Defend'=>'Defend1'},
{'CLASS_ID'=>2,'Defend'=>'Defend2'},
{'CLASS_ID'=>3,'Defend'=>'Defend3'},
{'CLASS_ID'=>4,'Defend'=>'Defend4'},
{'CLASS_ID'=>5,'Defend'=>'Defend5'},
{'CLASS_ID'=>6,'Defend'=>'Defend6'},
{'CLASS_ID'=>7,'Defend'=>'Defend7'},
{'CLASS_ID'=>8,'Defend'=>'Defend8'}
]
end
class Window_Command
def set_command_name(index,name)
@commands[index] = name
refresh
end
end
class Scene_Battle
alias diverse_guard_commands_phase3_setup_command_window phase3_setup_command_window
def phase3_setup_command_window
diverse_guard_commands_phase3_setup_command_window
return if @active_battler.nil?
Guard_command_names.each do |names|
if names['CLASS_ID'] == @active_battler.class_id
@actor_command_window.set_command_name(2,names['Defend'])
break
end
end
end
end
class Scene_Battle
def update_phase3_basic_command
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
phase3_prior_actor
return
end
if Input.trigger?(Input::C)
case @actor_command_window.index
when 0
$game_system.se_play($data_system.decision_se)
@active_battler.current_action.kind = 0
@active_battler.current_action.basic = 0
start_enemy_select
when 1
$game_system.se_play($data_system.decision_se)
@active_battler.current_action.kind = 1
start_skill_select
#---------------------------------------------------------------------------
# Here! Change class and skills if you want
# if @active_battler.class_id == x
# @skill = $data_skills[y]
# x- number of actor class
# y- number of unique skill
# If you change anything, then copy this.
#---------------------------------------------------------------------------
when 2
$game_system.se_play($data_system.decision_se)
@active_battler.current_action.basic = 1
#COPY
if @active_battler.class_id == 1
@skill = $data_skills[1]
elsif @active_battler.class_id == 2
@skill = $data_skills[2]
elsif @active_battler.class_id == 3
@skill = $data_skills[3]
elsif @active_battler.class_id == 4
@skill = $data_skills[4]
elsif @active_battler.class_id == 5
@skill = $data_skills[5]
elsif @active_battler.class_id == 6
@skill = $data_skills[6]
elsif @active_battler.class_id == 7
@skill = $data_skills[7]
else
@skill = $data_skills[8]
end
#END OF COPY
if @skill.scope == 1
start_enemy_select
elsif @skill.scope == 3 or @skill.scope == 5
start_actor_select
elsif @skill.scope == 4 or @skill.scope == 6
target = $game_party.actors
phase3_next_actor
elsif @skill.scope == 2
target = $game_troop.enemies
phase3_next_actor
elsif @skill.scope == 7
target = @active_battler
phase3_next_actor
else
end_skill_select
phase3_next_actor
end
when 3
$game_system.se_play($data_system.decision_se)
@active_battler.current_action.kind = 2
start_item_select
end
return
end
end
def start_enemy_select
@enemy_arrow = Arrow_Enemy.new(@spriteset.viewport1)
@enemy_arrow.help_window = @help_window
@actor_command_window.active = false
@actor_command_window.visible = false
end
def end_enemy_select
@enemy_arrow.dispose
@enemy_arrow = nil
@help_window.visible = false
if @actor_command_window.index == 0
@actor_command_window.active = true
@actor_command_window.visible = true
@help_window.visible = false
end
if @actor_command_window.index == 2
@actor_command_window.active = true
@actor_command_window.visible = true
@help_window.visible = false
end
end
def start_actor_select
@actor_arrow = Arrow_Actor.new(@spriteset.viewport2)
@actor_arrow.index = @actor_index
@actor_arrow.help_window = @help_window
@actor_command_window.active = false
@actor_command_window.visible = false
end
def end_actor_select
@help_window.visible = false
@actor_arrow.dispose
@actor_arrow = nil
if @actor_command_window.index == 2
@actor_command_window.active = true
@actor_command_window.visible = true
@help_window.visible = false
end
end
def make_basic_action_result
if @active_battler.current_action.basic == 0
@animation1_id = @active_battler.animation1_id
@animation2_id = @active_battler.animation2_id
if @active_battler.is_a?(Game_Enemy)
if @active_battler.restriction == 3
target = $game_troop.random_target_enemy
elsif @active_battler.restriction == 2
target = $game_party.random_target_actor
else
index = @active_battler.current_action.target_index
target = $game_party.smooth_target_actor(index)
end
end
if @active_battler.is_a?(Game_Actor)
if @active_battler.restriction == 3
target = $game_party.random_target_actor
elsif @active_battler.restriction == 2
target = $game_troop.random_target_enemy
else
index = @active_battler.current_action.target_index
target = $game_troop.smooth_target_enemy(index)
end
end
@target_battlers = [target]
for target in @target_battlers
target.attack_effect(@active_battler)
end
return
end
if @active_battler.current_action.basic == 1
#Now, if you changed class or/and skills then paste it here!
#PASTE
if @active_battler.class_id == 1
@skill = $data_skills[1]
elsif @active_battler.class_id == 2
@skill = $data_skills[2]
elsif @active_battler.class_id == 3
@skill = $data_skills[3]
elsif @active_battler.class_id == 4
@skill = $data_skills[4]
elsif @active_battler.class_id == 5
@skill = $data_skills[5]
elsif @active_battler.class_id == 6
@skill = $data_skills[6]
elsif @active_battler.class_id == 7
@skill = $data_skills[7]
else
@skill = $data_skills[8]
end
#END OF PASTE
@active_battler.current_action.skill_id = @skill.id
@status_window.refresh
@help_window.set_text(@skill.name, 1)
@animation1_id = @skill.animation1_id
@animation2_id = @skill.animation2_id
@common_event_id = @skill.common_event_id
set_target_battlers(@skill.scope)
for target in @target_battlers
target.skill_effect(@active_battler, @skill)
end
return
end
if @active_battler.is_a?(Game_Enemy) and
@active_battler.current_action.basic == 2
@help_window.set_text("Escape", 1)
@active_battler.escape
return
end
if @active_battler.current_action.basic == 3
$game_temp.forcing_battler = nil
@phase4_step = 1
return
end
end
def make_guard_action_result
@skill = $data_skills[7]
@active_battler.current_action.skill_id = @skill.id
@skill = $data_skills[@active_battler.current_action.skill_id]
unless @active_battler.current_action.forcing
unless @active_battler.skill_can_use?(@skill.id)
$game_temp.forcing_battler = nil
@phase4_step = 1
return
end
end
@status_window.refresh
@help_window.set_text(@skill.name, 1)
@animation1_id = @skill.animation1_id
@animation2_id = @skill.animation2_id
@common_event_id = @skill.common_event_id
set_target_battlers(@skill.scope)
for target in @target_battlers
target.skill_effect(@active_battler, @skill)
end
end
def update_phase3_enemy_select
@enemy_arrow.update
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
end_enemy_select
return
end
if Input.trigger?(Input::C)
$game_system.se_play($data_system.decision_se)
@active_battler.current_action.target_index = @enemy_arrow.index
end_enemy_select
if @skill_window != nil
end_skill_select
end
if @item_window != nil
end_item_select
end
phase3_next_actor
end
end
end
Author's Notes
It's my first script, so there can be errors...
Sorry for my english lang. - I'm from Poland...