really thanks man
Party Changing Script
RPG Maker ScriptsHrmmm, after messing with it a bit I managed to get it to work but with one snag, for some reason none of character's statuses show up when you go into the menu. I'm not using any other scripts other than this one, would you happen to know what I messed up on?
[QUOTE=Tierra;125254]Hrmmm, after messing with it a bit I managed to get it to work but with one snag, for some reason none of character's statuses show up when you go into the menu. I'm not using any other scripts other than this one, would you happen to know what I messed up on?[/QUOTE]
What do you mean messing? If this is the only script you have, you paste it above main and edit 1 constant to use it.
What do you mean messing? If this is the only script you have, you paste it above main and edit 1 constant to use it.
Oh, by that I just meant trying to place everything in right. Took me awhile to figure out (at least I think I figured out) where everything went in the script. You just insert a new part for each of the "class ___"'s right above the original and paste that part right? I think I copied and pasted it all the right way, but I'm not sure why it's still doing a window error. I'm positive its just something I'm not doing right, I'm just having a hard time figuring out what. I seem to be having a problem with the reserve party members being able to attack when not in the main party, and also none of the stats can be seen in the main menu, like in your pictures.
Sorry for bugging you again, I know you've addressed the reserve party members attacking already, I just can't figure out what to put it above. Anyways, hope your trip was good and you get back safe!
Sorry for bugging you again, I know you've addressed the reserve party members attacking already, I just can't figure out what to put it above. Anyways, hope your trip was good and you get back safe!
[QUOTE=Tierra;125817]Oh, by that I just meant trying to place everything in right. Took me awhile to figure out (at least I think I figured out) where everything went in the script. You just insert a new part for each of the "class ___"'s right above the original and paste that part right? I think I copied and pasted it all the right way, but I'm not sure why it's still doing a window error. I'm positive its just something I'm not doing right, I'm just having a hard time figuring out what. I seem to be having a problem with the reserve party members being able to attack when not in the main party, and also none of the stats can be seen in the main menu, like in your pictures.
Sorry for bugging you again, I know you've addressed the reserve party members attacking already, I just can't figure out what to put it above. Anyways, hope your trip was good and you get back safe![/QUOTE]
Allmost all of my scripts don't require you to edit an existing class yourself this one included. You just need to paste it (all in one go) above main. You can create a section for it by clicking insert when you have main selected.
As for the lack of text that is caused normally by having an illegal version of rpg maker xp.
Sorry for bugging you again, I know you've addressed the reserve party members attacking already, I just can't figure out what to put it above. Anyways, hope your trip was good and you get back safe![/QUOTE]
Allmost all of my scripts don't require you to edit an existing class yourself this one included. You just need to paste it (all in one go) above main. You can create a section for it by clicking insert when you have main selected.
As for the lack of text that is caused normally by having an illegal version of rpg maker xp.
Oh wow, I didn't realize how easy that was. I was over complicating things trying to paste everything individually. As for the legality thing, I was still using a demo my friend sent me before buying the real thing. Guess I should hurry up and do that before working on anything extra, didn't realize there'd be compatibility issues. Anyways, thanks again, it works great now!
[QUOTE=A J;122625]really thanks man[/QUOTE]
Sorry I took soo long.
Make sure the party changing script is above the battle system and then use this for the battle system:
Sorry I took soo long.
Make sure the party changing script is above the battle system and then use this for the battle system:
module Fomar
Attack_Cost = 500
Skill_Cost = 750
Defend_Cost = 250
Item_Cost = 500
Flee_Attempt = 100
Refresh_Rate = 5
def self.attack
return Attack_Cost
end
def self.skill
return Skill_Cost
end
def self.defend
return Defend_Cost
end
def self.item
return Item_Cost
end
def self.critical_value(n)
return (n == Attack_Cost or n == Skill_Cost or n == Defend_Cost or n == Item_Cost)
end
end
class Game_BattleAction
alias cbs_clear clear
def clear
unless (@kind == 0 and @basic == 1)
cbs_clear
return
end
@speed = 0
@skill_id = 0
@item_id = 0
@target_index = -1
@forcing = false
end
end
class Game_Battler
attr_accessor :stamina
attr_accessor :vitality
attr_accessor :max_stamina
alias cbs_initialize initialize
def initialize
cbs_initialize
@stamina = 0
@vitality = 1
@max_stamina = 1000
end
def stamina_action_cost
if (@current_action.kind == 0 and @current_action.basic == 1) or
((@current_action.kind == 0 and @current_action.basic == 0) and
@current_action.target_index == -1)
return
end
if @current_action.kind == 0 and @current_action.basic == 0
@stamina -= Fomar.attack
end
if @current_action.kind == 1
@stamina -= Fomar.skill
end
if @current_action.kind == 2
@stamina -= Fomar.item
end
end
end
class Game_Enemy < Game_Battler
alias cbs_make_action make_action
def make_action
return
end
def can_do_action?
if @current_action.kind == 0 and @current_action.basic == 0
return self.stamina >= Fomar.attack
end
if @current_action.kind == 1
return self.stamina >= Fomar.skill
end
if @current_action.kind == 0 and @current_action.basic == 1
return self.stamina >= Fomar.defend
end
if @current_action.kind == 0 and @current_action.basic == 3
return false
end
end
end
class Window_BattleStatus < Window_Base
def refresh
self.contents.clear
self.contents.font.size = 20
@item_max = [$game_party.actors.size, 4].min
for i in 0...[$game_party.actors.size, 4].min
actor = $game_party.actors[i]
actor_x = i * 160 + 4
draw_actor_name(actor, actor_x, 0)
draw_actor_hp(actor, actor_x, 25, 120)
draw_actor_sp(actor, actor_x, 50, 120)
draw_fomar_bar(actor_x, 80, ((actor.stamina * 100)/actor.max_stamina), 120)
if @level_up_flags[i]
self.contents.font.color = normal_color
self.contents.draw_text(actor_x, 100, 120, 32, "LEVEL UP!")
else
draw_actor_state(actor, actor_x, 100)
end
end
end
def redraw_bars
for i in 0...[$game_party.actors.size, 4].min
actor = $game_party.actors[i]
actor_x = i * 160 + 4
draw_fomar_bar(actor_x, 80, ((actor.stamina * 100)/actor.max_stamina), 120)
end
end
def draw_fomar_bar(x, y, full = 100, width = 128)
self.contents.fill_rect(x, y, width, 20, Color.new(0, 0, 0, 255))
self.contents.fill_rect(x + 2, y + 2, width - 4, 16, Color.new(255, 255, 255, 255))
width *= full
width /= 100
# full is a percentage
self.contents.fill_rect(x +2, y + 2, width - 4, 16, Color.new(255, 0, 0, 255))
end
end
class Scene_Battle
alias cbs_main main
def main
@fleeing = false
@flee_attempt = 0
@refresh_rate = 0
@enemy_decision = 0
for actor in $game_party.actors
actor.current_action.cbs_clear
end
cbs_main
end
alias cbs_update update
def update
if @refresh_rate == Fomar::Refresh_Rate
@status_window.redraw_bars
@refresh_rate = 0
else
@refresh_rate += 1
end
cbs_update
end
alias cbs_start_phase2 start_phase2
def start_phase2
@fleeing = false
cbs_start_phase2
end
def update_phase2_escape
@fleeing = true
@flee_attempt = 0
start_phase3
end
def end_phase2
@party_command_window.active = false
@party_command_window.visible = false
end
def start_phase3
end_phase2
@phase = 3
@actor_index = 0
@active_battler = $game_party.actors[0]
$game_party.clear_actions
unless @fleeing == true
phase3_setup_command_window
end
end
def phase3_setup_command_window
phase3_make_command_window
@party_command_window.active = false
@party_command_window.visible = false
@actor_command_window.active = true
@actor_command_window.visible = true
@actor_command_window.x = @actor_index * 160
end
def phase3_make_command_window
unless @actor_command_window == nil
@actor_command_window.dispose
end
s1 = $data_system.words.attack
s2 = $data_system.words.skill
s3 = $data_system.words.guard
s4 = $data_system.words.item
@actor_command_window = Window_Command.new(160, [s1, s2, s3, s4])
@actor_command_window.y = 160
@actor_command_window.back_opacity = 160
unless @active_battler.inputable?
@actor_command_window.disable_item(0)
@actor_command_window.disable_item(1)
@actor_command_window.disable_item(2)
@actor_command_window.disable_item(3)
return
end
unless @active_battler.stamina >= Fomar.attack
@actor_command_window.disable_item(0)
end
unless @active_battler.stamina >= Fomar.skill
@actor_command_window.disable_item(1)
end
unless @active_battler.stamina >= Fomar.defend
@actor_command_window.disable_item(2)
end
unless @active_battler.stamina >= Fomar.item
@actor_command_window.disable_item(3)
end
end
alias cbs_update_phase3 update_phase3
def update_phase3
if judge
return
end
cbs_update_phase3
if @actor_command_window.active == true or @fleeing == true
@enemy_decision += 1
if @enemy_decision == 50
@enemy_decision -= 50
resolve = false
for enemy in $game_troop.enemies
enemy.cbs_make_action
if enemy.can_do_action?
resolve = true
else
enemy.current_action.clear
end
end
if resolve == true
@check_index = @actor_index
start_phase4
return
end
end
end
if @fleeing == true
if Input.trigger?(Input::B)
start_phase2
end
@flee_attempt += 1
if @flee_attempt == Fomar::Flee_Attempt
enemies_agi = 0
enemies_number = 0
for enemy in $game_troop.enemies
if enemy.exist?
enemies_agi += enemy.agi
enemies_number += 1
end
end
if enemies_number > 0
enemies_agi /= enemies_number
end
actors_agi = 0
actors_number = 0
for actor in $game_party.actors
if actor.exist?
actors_agi += actor.agi
actors_number += 1
end
end
if actors_number > 0
actors_agi /= actors_number
end
success = rand(100) < 50 * actors_agi / enemies_agi
if success
$game_system.se_play($data_system.escape_se)
$game_system.bgm_play($game_temp.map_bgm)
battle_end(1)
else
@flee_attempt -= Fomar::Flee_Attempt
end
end
end
if @active_battler != nil
if Fomar.critical_value(@active_battler.stamina)
i = @actor_command_window.index
k = @actor_command_window.visible
l = @actor_command_window.active
phase3_make_command_window
@actor_command_window.x = @actor_index * 160
@actor_command_window.index = i
@actor_command_window.visible = k
@actor_command_window.active = l
end
end
if @actor_command_window.active
if Input.trigger?(Input::LEFT)
@actor_index -= 1
if @actor_index == -1
@actor_index = [$game_party.actors.size, 4].min - 1
end
@active_battler = $game_party.actors[@actor_index]
phase3_make_command_window
@actor_command_window.x = @actor_index * 160
end
if Input.trigger?(Input::RIGHT)
@actor_index += 1
if @actor_index == [$game_party.actors.size, 4].min
@actor_index = 0
end
@active_battler = $game_party.actors[@actor_index]
phase3_make_command_window
@actor_command_window.x = @actor_index * 160
end
end
if @actor_command_window.active == true or @fleeing == true
phase3_pass_time
end
end
def phase3_pass_time
for battler in $game_party.actors + $game_troop.enemies
battler.stamina += battler.vitality
if battler.stamina > battler.max_stamina
battler.stamina = battler.max_stamina
end
end
end
alias cbs_update_phase4_step1 update_phase4_step1
def update_phase4_step1
if @action_battlers.size == 0
@phase = 3
for battler in $game_party.actors + $game_troop.enemies
battler.stamina_action_cost
end
i = @actor_command_window.index
phase3_make_command_window
@actor_command_window.index = 1
@actor_command_window.visible = true
@actor_command_window.active = true
@actor_index = @check_index
@actor_command_window.x = 160 * @actor_index
@active_battler = $game_party.actors[@actor_index]
$game_party.clear_actions
for enemy in $game_troop.enemies
enemy.current_action.clear
end
return
end
cbs_update_phase4_step1
end
def phase3_next_actor
@check_index = @actor_index
start_phase4
return
end
def phase3_prior_actor
start_phase2
return
end
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
if @active_battler.stamina < Fomar.attack
$game_system.se_play($data_system.buzzer_se)
return
end
$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
if @active_battler.stamina < Fomar.skill
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
@active_battler.current_action.kind = 1
start_skill_select
when 2
if @active_battler.stamina < Fomar.defend
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
@active_battler.current_action.kind = 0
@active_battler.current_action.basic = 1
@active_battler.stamina -= Fomar.defend
phase3_next_actor
when 3
if @active_battler.stamina < Fomar.item
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
@active_battler.current_action.kind = 2
start_item_select
end
return
end
end
end
Attack_Cost = 500
Skill_Cost = 750
Defend_Cost = 250
Item_Cost = 500
Flee_Attempt = 100
Refresh_Rate = 5
def self.attack
return Attack_Cost
end
def self.skill
return Skill_Cost
end
def self.defend
return Defend_Cost
end
def self.item
return Item_Cost
end
def self.critical_value(n)
return (n == Attack_Cost or n == Skill_Cost or n == Defend_Cost or n == Item_Cost)
end
end
class Game_BattleAction
alias cbs_clear clear
def clear
unless (@kind == 0 and @basic == 1)
cbs_clear
return
end
@speed = 0
@skill_id = 0
@item_id = 0
@target_index = -1
@forcing = false
end
end
class Game_Battler
attr_accessor :stamina
attr_accessor :vitality
attr_accessor :max_stamina
alias cbs_initialize initialize
def initialize
cbs_initialize
@stamina = 0
@vitality = 1
@max_stamina = 1000
end
def stamina_action_cost
if (@current_action.kind == 0 and @current_action.basic == 1) or
((@current_action.kind == 0 and @current_action.basic == 0) and
@current_action.target_index == -1)
return
end
if @current_action.kind == 0 and @current_action.basic == 0
@stamina -= Fomar.attack
end
if @current_action.kind == 1
@stamina -= Fomar.skill
end
if @current_action.kind == 2
@stamina -= Fomar.item
end
end
end
class Game_Enemy < Game_Battler
alias cbs_make_action make_action
def make_action
return
end
def can_do_action?
if @current_action.kind == 0 and @current_action.basic == 0
return self.stamina >= Fomar.attack
end
if @current_action.kind == 1
return self.stamina >= Fomar.skill
end
if @current_action.kind == 0 and @current_action.basic == 1
return self.stamina >= Fomar.defend
end
if @current_action.kind == 0 and @current_action.basic == 3
return false
end
end
end
class Window_BattleStatus < Window_Base
def refresh
self.contents.clear
self.contents.font.size = 20
@item_max = [$game_party.actors.size, 4].min
for i in 0...[$game_party.actors.size, 4].min
actor = $game_party.actors[i]
actor_x = i * 160 + 4
draw_actor_name(actor, actor_x, 0)
draw_actor_hp(actor, actor_x, 25, 120)
draw_actor_sp(actor, actor_x, 50, 120)
draw_fomar_bar(actor_x, 80, ((actor.stamina * 100)/actor.max_stamina), 120)
if @level_up_flags[i]
self.contents.font.color = normal_color
self.contents.draw_text(actor_x, 100, 120, 32, "LEVEL UP!")
else
draw_actor_state(actor, actor_x, 100)
end
end
end
def redraw_bars
for i in 0...[$game_party.actors.size, 4].min
actor = $game_party.actors[i]
actor_x = i * 160 + 4
draw_fomar_bar(actor_x, 80, ((actor.stamina * 100)/actor.max_stamina), 120)
end
end
def draw_fomar_bar(x, y, full = 100, width = 128)
self.contents.fill_rect(x, y, width, 20, Color.new(0, 0, 0, 255))
self.contents.fill_rect(x + 2, y + 2, width - 4, 16, Color.new(255, 255, 255, 255))
width *= full
width /= 100
# full is a percentage
self.contents.fill_rect(x +2, y + 2, width - 4, 16, Color.new(255, 0, 0, 255))
end
end
class Scene_Battle
alias cbs_main main
def main
@fleeing = false
@flee_attempt = 0
@refresh_rate = 0
@enemy_decision = 0
for actor in $game_party.actors
actor.current_action.cbs_clear
end
cbs_main
end
alias cbs_update update
def update
if @refresh_rate == Fomar::Refresh_Rate
@status_window.redraw_bars
@refresh_rate = 0
else
@refresh_rate += 1
end
cbs_update
end
alias cbs_start_phase2 start_phase2
def start_phase2
@fleeing = false
cbs_start_phase2
end
def update_phase2_escape
@fleeing = true
@flee_attempt = 0
start_phase3
end
def end_phase2
@party_command_window.active = false
@party_command_window.visible = false
end
def start_phase3
end_phase2
@phase = 3
@actor_index = 0
@active_battler = $game_party.actors[0]
$game_party.clear_actions
unless @fleeing == true
phase3_setup_command_window
end
end
def phase3_setup_command_window
phase3_make_command_window
@party_command_window.active = false
@party_command_window.visible = false
@actor_command_window.active = true
@actor_command_window.visible = true
@actor_command_window.x = @actor_index * 160
end
def phase3_make_command_window
unless @actor_command_window == nil
@actor_command_window.dispose
end
s1 = $data_system.words.attack
s2 = $data_system.words.skill
s3 = $data_system.words.guard
s4 = $data_system.words.item
@actor_command_window = Window_Command.new(160, [s1, s2, s3, s4])
@actor_command_window.y = 160
@actor_command_window.back_opacity = 160
unless @active_battler.inputable?
@actor_command_window.disable_item(0)
@actor_command_window.disable_item(1)
@actor_command_window.disable_item(2)
@actor_command_window.disable_item(3)
return
end
unless @active_battler.stamina >= Fomar.attack
@actor_command_window.disable_item(0)
end
unless @active_battler.stamina >= Fomar.skill
@actor_command_window.disable_item(1)
end
unless @active_battler.stamina >= Fomar.defend
@actor_command_window.disable_item(2)
end
unless @active_battler.stamina >= Fomar.item
@actor_command_window.disable_item(3)
end
end
alias cbs_update_phase3 update_phase3
def update_phase3
if judge
return
end
cbs_update_phase3
if @actor_command_window.active == true or @fleeing == true
@enemy_decision += 1
if @enemy_decision == 50
@enemy_decision -= 50
resolve = false
for enemy in $game_troop.enemies
enemy.cbs_make_action
if enemy.can_do_action?
resolve = true
else
enemy.current_action.clear
end
end
if resolve == true
@check_index = @actor_index
start_phase4
return
end
end
end
if @fleeing == true
if Input.trigger?(Input::B)
start_phase2
end
@flee_attempt += 1
if @flee_attempt == Fomar::Flee_Attempt
enemies_agi = 0
enemies_number = 0
for enemy in $game_troop.enemies
if enemy.exist?
enemies_agi += enemy.agi
enemies_number += 1
end
end
if enemies_number > 0
enemies_agi /= enemies_number
end
actors_agi = 0
actors_number = 0
for actor in $game_party.actors
if actor.exist?
actors_agi += actor.agi
actors_number += 1
end
end
if actors_number > 0
actors_agi /= actors_number
end
success = rand(100) < 50 * actors_agi / enemies_agi
if success
$game_system.se_play($data_system.escape_se)
$game_system.bgm_play($game_temp.map_bgm)
battle_end(1)
else
@flee_attempt -= Fomar::Flee_Attempt
end
end
end
if @active_battler != nil
if Fomar.critical_value(@active_battler.stamina)
i = @actor_command_window.index
k = @actor_command_window.visible
l = @actor_command_window.active
phase3_make_command_window
@actor_command_window.x = @actor_index * 160
@actor_command_window.index = i
@actor_command_window.visible = k
@actor_command_window.active = l
end
end
if @actor_command_window.active
if Input.trigger?(Input::LEFT)
@actor_index -= 1
if @actor_index == -1
@actor_index = [$game_party.actors.size, 4].min - 1
end
@active_battler = $game_party.actors[@actor_index]
phase3_make_command_window
@actor_command_window.x = @actor_index * 160
end
if Input.trigger?(Input::RIGHT)
@actor_index += 1
if @actor_index == [$game_party.actors.size, 4].min
@actor_index = 0
end
@active_battler = $game_party.actors[@actor_index]
phase3_make_command_window
@actor_command_window.x = @actor_index * 160
end
end
if @actor_command_window.active == true or @fleeing == true
phase3_pass_time
end
end
def phase3_pass_time
for battler in $game_party.actors + $game_troop.enemies
battler.stamina += battler.vitality
if battler.stamina > battler.max_stamina
battler.stamina = battler.max_stamina
end
end
end
alias cbs_update_phase4_step1 update_phase4_step1
def update_phase4_step1
if @action_battlers.size == 0
@phase = 3
for battler in $game_party.actors + $game_troop.enemies
battler.stamina_action_cost
end
i = @actor_command_window.index
phase3_make_command_window
@actor_command_window.index = 1
@actor_command_window.visible = true
@actor_command_window.active = true
@actor_index = @check_index
@actor_command_window.x = 160 * @actor_index
@active_battler = $game_party.actors[@actor_index]
$game_party.clear_actions
for enemy in $game_troop.enemies
enemy.current_action.clear
end
return
end
cbs_update_phase4_step1
end
def phase3_next_actor
@check_index = @actor_index
start_phase4
return
end
def phase3_prior_actor
start_phase2
return
end
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
if @active_battler.stamina < Fomar.attack
$game_system.se_play($data_system.buzzer_se)
return
end
$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
if @active_battler.stamina < Fomar.skill
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
@active_battler.current_action.kind = 1
start_skill_select
when 2
if @active_battler.stamina < Fomar.defend
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
@active_battler.current_action.kind = 0
@active_battler.current_action.basic = 1
@active_battler.stamina -= Fomar.defend
phase3_next_actor
when 3
if @active_battler.stamina < Fomar.item
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
@active_battler.current_action.kind = 2
start_item_select
end
return
end
end
end
Expand to see the code.
Thank you Fomar0153 :)
Hi Fomar :D i've a little problem :\
In battle i must use only 3 character and not 4... i've try to change the script and i've fix the number of character in the menÃÂ ¹ and the layout but i don't know how to change the number of fighter in battle can you help me please? :* (i'm using the minkoff ATB aniway)
another question :D How can i make enter or exit the character in the party? Oo, becose i need 8 and with the database i can only have 4 party member, there is some command that allow me to force in or out the party the member? Oo
maybe something i can call whit a map script? like @partymember.force_in = [chara's_id]
Thanks :D
EDIT: I've found another problem XD, i've change the layout of the "Window_Target" class and when i use an item the cursor go over the first 3 character and disappear over the 4th how can i fix it? Oo (sorry for my english again XD - like i draw in all my post :P)
In battle i must use only 3 character and not 4... i've try to change the script and i've fix the number of character in the menÃÂ ¹ and the layout but i don't know how to change the number of fighter in battle can you help me please? :* (i'm using the minkoff ATB aniway)
another question :D How can i make enter or exit the character in the party? Oo, becose i need 8 and with the database i can only have 4 party member, there is some command that allow me to force in or out the party the member? Oo
maybe something i can call whit a map script? like @partymember.force_in = [chara's_id]
Thanks :D
EDIT: I've found another problem XD, i've change the layout of the "Window_Target" class and when i use an item the cursor go over the first 3 character and disappear over the 4th how can i fix it? Oo (sorry for my english again XD - like i draw in all my post :P)
http://www.hbgames.org/forums/showthread.php?t=9723
My party control script mixes this script and my large party (which can be used to limit the party to 3 members in battle). Which I think does everything you want.
My party control script mixes this script and my large party (which can be used to limit the party to 3 members in battle). Which I think does everything you want.
[QUOTE=jbrist;149192]Formar, I have a problem with your script:
As you can see, when I'm on the menu, I cannot see any of their HP, SP, Exp, or Status, and this is the only script that I am using, could you please alter it so I can see them ? Thankyou.[/QUOTE]
Hm... post a copy of your Window_Gold script or your default Window_MenuStatus then I should be able to see the problem hopefully.
As you can see, when I'm on the menu, I cannot see any of their HP, SP, Exp, or Status, and this is the only script that I am using, could you please alter it so I can see them ? Thankyou.[/QUOTE]
Hm... post a copy of your Window_Gold script or your default Window_MenuStatus then I should be able to see the problem hopefully.
==============================================================================
# – Window_MenuStatus
#------------------------------------------------------------------------------
#  メニュー画é¢ã§ãƒ‘ーティメンãƒãƒ¼ã®ã‚¹ãƒ†ãƒ¼ã‚¿ã‚¹ã‚’表示ã™ã‚‹ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã§ã™ã€‚
#==============================================================================
class Window_MenuStatus < Window_Selectable
#--------------------------------------------------------------------------
# — ã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆåˆæœŸåŒ–
#--------------------------------------------------------------------------
def initialize
super(0, 0, 480, 480)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
refresh
self.active = false
self.index = -1
end
#--------------------------------------------------------------------------
# — リフレッシュ
#--------------------------------------------------------------------------
def refresh
self.contents.clear
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
x = 64
y = i * 116
actor = $game_party.actors[i]
draw_actor_graphic(actor, x - 40, y + 80)
draw_actor_name(actor, x, y)
draw_actor_class(actor, x + 144, y)
draw_actor_level(actor, x, y + 32)
draw_actor_state(actor, x + 90, y + 32)
draw_actor_exp(actor, x, y + 64)
draw_actor_hp(actor, x + 236, y + 32)
draw_actor_sp(actor, x + 236, y + 64)
end
end
#--------------------------------------------------------------------------
# — カーソルã®çŸ©å½¢æ›´æ–°
#--------------------------------------------------------------------------
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
else
self.cursor_rect.set(0, @index * 116, self.width - 32, 96)
end
end
end
# – Window_MenuStatus
#------------------------------------------------------------------------------
#  メニュー画é¢ã§ãƒ‘ーティメンãƒãƒ¼ã®ã‚¹ãƒ†ãƒ¼ã‚¿ã‚¹ã‚’表示ã™ã‚‹ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã§ã™ã€‚
#==============================================================================
class Window_MenuStatus < Window_Selectable
#--------------------------------------------------------------------------
# — ã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆåˆæœŸåŒ–
#--------------------------------------------------------------------------
def initialize
super(0, 0, 480, 480)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
refresh
self.active = false
self.index = -1
end
#--------------------------------------------------------------------------
# — リフレッシュ
#--------------------------------------------------------------------------
def refresh
self.contents.clear
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
x = 64
y = i * 116
actor = $game_party.actors[i]
draw_actor_graphic(actor, x - 40, y + 80)
draw_actor_name(actor, x, y)
draw_actor_class(actor, x + 144, y)
draw_actor_level(actor, x, y + 32)
draw_actor_state(actor, x + 90, y + 32)
draw_actor_exp(actor, x, y + 64)
draw_actor_hp(actor, x + 236, y + 32)
draw_actor_sp(actor, x + 236, y + 64)
end
end
#--------------------------------------------------------------------------
# — カーソルã®çŸ©å½¢æ›´æ–°
#--------------------------------------------------------------------------
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
else
self.cursor_rect.set(0, @index * 116, self.width - 32, 96)
end
end
end
Expand to see the code.
[QUOTE=jbrist;149212][/QUOTE]
Get the legal version and the script will work.
==============================================================================
# – Window_MenuStatus
#------------------------------------------------------------------------------
#  メニュー画é¢ã§ãƒ‘ーティメンãƒãƒ¼ã®ã‚¹ãƒ†ãƒ¼ã‚¿ã‚¹ã‚’表示ã™ã‚‹ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã§ã™ã€‚
#==============================================================================
class Window_MenuStatus < Window_Selectable
#--------------------------------------------------------------------------
# — ã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆåˆæœŸåŒ–
#--------------------------------------------------------------------------
def initialize
super(0, 0, 480, 480)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
refresh
self.active = false
self.index = -1
end
#--------------------------------------------------------------------------
# — リフレッシュ
#--------------------------------------------------------------------------
def refresh
self.contents.clear
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
x = 64
y = i * 116
actor = $game_party.actors[i]
draw_actor_graphic(actor, x - 40, y + 80)
draw_actor_name(actor, x, y)
draw_actor_class(actor, x + 144, y)
draw_actor_level(actor, x, y + 32)
draw_actor_state(actor, x + 90, y + 32)
draw_actor_exp(actor, x, y + 64)
draw_actor_hp(actor, x + 236, y + 32)
draw_actor_sp(actor, x + 236, y + 64)
end
end
#--------------------------------------------------------------------------
# — カーソルã®çŸ©å½¢æ›´æ–°
#--------------------------------------------------------------------------
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
else
self.cursor_rect.set(0, @index * 116, self.width - 32, 96)
end
end
end
# – Window_MenuStatus
#------------------------------------------------------------------------------
#  メニュー画é¢ã§ãƒ‘ーティメンãƒãƒ¼ã®ã‚¹ãƒ†ãƒ¼ã‚¿ã‚¹ã‚’表示ã™ã‚‹ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã§ã™ã€‚
#==============================================================================
class Window_MenuStatus < Window_Selectable
#--------------------------------------------------------------------------
# — ã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆåˆæœŸåŒ–
#--------------------------------------------------------------------------
def initialize
super(0, 0, 480, 480)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
refresh
self.active = false
self.index = -1
end
#--------------------------------------------------------------------------
# — リフレッシュ
#--------------------------------------------------------------------------
def refresh
self.contents.clear
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
x = 64
y = i * 116
actor = $game_party.actors[i]
draw_actor_graphic(actor, x - 40, y + 80)
draw_actor_name(actor, x, y)
draw_actor_class(actor, x + 144, y)
draw_actor_level(actor, x, y + 32)
draw_actor_state(actor, x + 90, y + 32)
draw_actor_exp(actor, x, y + 64)
draw_actor_hp(actor, x + 236, y + 32)
draw_actor_sp(actor, x + 236, y + 64)
end
end
#--------------------------------------------------------------------------
# — カーソルã®çŸ©å½¢æ›´æ–°
#--------------------------------------------------------------------------
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
else
self.cursor_rect.set(0, @index * 116, self.width - 32, 96)
end
end
end
Expand to see the code.
Get the legal version and the script will work.
Are you accusing me of having an illegal version of the game? I do have the legal version, I bought it from Enterbrain.com for ÂÂ £30 ($60).
Maybe it's wrong because I had another script, which was a CMS, and I had to paste it into Window_MenuStatus, but I deleted it 3 days later because I didn't like it, maybe thats the problem ?
Maybe it's wrong because I had another script, which was a CMS, and I had to paste it into Window_MenuStatus, but I deleted it 3 days later because I didn't like it, maybe thats the problem ?
jbrist, if you had the legal version, the default scripts wouldn't have Japanese in them. :|
Then obviously you didn't read what I just wrote.
Edit - OMFG, All I had to do was copy and paste the Window_MenuStatus from a New Project, stupid me !, hehe.
Formar, it works ok now :P
Edit #2 - Formar, is there a way I can make it so instead of pressing Q + W to change characters on the equip screen, I can just press LEFT + RIGHT instead ?
Edit - OMFG, All I had to do was copy and paste the Window_MenuStatus from a New Project, stupid me !, hehe.
Formar, it works ok now :P
Edit #2 - Formar, is there a way I can make it so instead of pressing Q + W to change characters on the equip screen, I can just press LEFT + RIGHT instead ?
[QUOTE=jbrist;149232]Then obviously you didn't read what I just wrote.
Edit - OMFG, All I had to do was copy and paste the Window_MenuStatus from a New Project, stupid me !, hehe.
Formar, it works ok now :P
Edit #2 - Formar, is there a way I can make it so instead of pressing Q + W to change characters on the equip screen, I can just press LEFT + RIGHT instead ?[/QUOTE]
This should do it being as you said you have no other scripts:
Edit - OMFG, All I had to do was copy and paste the Window_MenuStatus from a New Project, stupid me !, hehe.
Formar, it works ok now :P
Edit #2 - Formar, is there a way I can make it so instead of pressing Q + W to change characters on the equip screen, I can just press LEFT + RIGHT instead ?[/QUOTE]
This should do it being as you said you have no other scripts:
class Scene_Equip
#--------------------------------------------------------------------------
# * Frame Update (when right window is active)
#--------------------------------------------------------------------------
def update_right
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to menu screen
$scene = Scene_Menu.new(2)
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# If equipment is fixed
if @actor.equip_fix?(@right_window.index)
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Activate item window
@right_window.active = false
@item_window.active = true
@item_window.index = 0
return
end
# If R button was pressed
if Input.trigger?(Input::R) or Input.trigger?(Input::RIGHT)
# 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 equipment screen
$scene = Scene_Equip.new(@actor_index, @right_window.index)
return
end
# If L button was pressed
if Input.trigger?(Input::L) or Input.trigger?(Input::LEFT)
# 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 equipment screen
$scene = Scene_Equip.new(@actor_index, @right_window.index)
return
end
end
end
#--------------------------------------------------------------------------
# * Frame Update (when right window is active)
#--------------------------------------------------------------------------
def update_right
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to menu screen
$scene = Scene_Menu.new(2)
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# If equipment is fixed
if @actor.equip_fix?(@right_window.index)
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Activate item window
@right_window.active = false
@item_window.active = true
@item_window.index = 0
return
end
# If R button was pressed
if Input.trigger?(Input::R) or Input.trigger?(Input::RIGHT)
# 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 equipment screen
$scene = Scene_Equip.new(@actor_index, @right_window.index)
return
end
# If L button was pressed
if Input.trigger?(Input::L) or Input.trigger?(Input::LEFT)
# 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 equipment screen
$scene = Scene_Equip.new(@actor_index, @right_window.index)
return
end
end
end
Expand to see the code.
Nice, it works cool.
Edit - Sorry if I'm being a pain, but could I have 2 more that allow me to do this on the Status and Skills page ? It's really neat !
[/spoiler]
Edit - Sorry if I'm being a pain, but could I have 2 more that allow me to do this on the Status and Skills page ? It's really neat !
Content Hidden
Spoiler
This is just to prove I have the legal version: [spoiler]
#==============================================================================
# ** Window_MenuStatus
#------------------------------------------------------------------------------
# This window displays party member status on the menu screen.
#==============================================================================
class Window_MenuStatus < Window_Selectable
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(0, 0, 480, 480)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
self.active = false
self.index = -1
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
x = 64
y = i * 116
actor = $game_party.actors[i]
draw_actor_graphic(actor, x - 40, y + 80)
draw_actor_name(actor, x, y)
draw_actor_class(actor, x + 144, y)
draw_actor_level(actor, x, y + 32)
draw_actor_state(actor, x + 90, y + 32)
draw_actor_exp(actor, x, y + 64)
draw_actor_hp(actor, x + 236, y + 32)
draw_actor_sp(actor, x + 236, y + 64)
end
end
#--------------------------------------------------------------------------
# * Cursor Rectangle Update
#--------------------------------------------------------------------------
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
else
self.cursor_rect.set(0, @index * 116, self.width - 32, 96)
end
end
end
# ** Window_MenuStatus
#------------------------------------------------------------------------------
# This window displays party member status on the menu screen.
#==============================================================================
class Window_MenuStatus < Window_Selectable
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(0, 0, 480, 480)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
self.active = false
self.index = -1
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
x = 64
y = i * 116
actor = $game_party.actors[i]
draw_actor_graphic(actor, x - 40, y + 80)
draw_actor_name(actor, x, y)
draw_actor_class(actor, x + 144, y)
draw_actor_level(actor, x, y + 32)
draw_actor_state(actor, x + 90, y + 32)
draw_actor_exp(actor, x, y + 64)
draw_actor_hp(actor, x + 236, y + 32)
draw_actor_sp(actor, x + 236, y + 64)
end
end
#--------------------------------------------------------------------------
# * Cursor Rectangle Update
#--------------------------------------------------------------------------
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
else
self.cursor_rect.set(0, @index * 116, self.width - 32, 96)
end
end
end
Expand to see the code.
Skills has 2 columns
That was for status.
class Scene_Status
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to menu screen
$scene = Scene_Menu.new(3)
return
end
# If R button was pressed
if Input.trigger?(Input::R) or Input.trigger?(Input::RIGHT)
# 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 status screen
$scene = Scene_Status.new(@actor_index)
return
end
# If L button was pressed
if Input.trigger?(Input::L) or Input.trigger?(Input::LEFT)
# 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 status screen
$scene = Scene_Status.new(@actor_index)
return
end
end
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to menu screen
$scene = Scene_Menu.new(3)
return
end
# If R button was pressed
if Input.trigger?(Input::R) or Input.trigger?(Input::RIGHT)
# 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 status screen
$scene = Scene_Status.new(@actor_index)
return
end
# If L button was pressed
if Input.trigger?(Input::L) or Input.trigger?(Input::LEFT)
# 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 status screen
$scene = Scene_Status.new(@actor_index)
return
end
end
end
Expand to see the code.
That was for status.
Oh yeah, Lol, Unless I can get someone to make a script which makes it only have 1 collumn ?
I'm not trying to be picky, but is there some way
to make it so that one actor is always at the top?
You see, I have it so that sometimes the other party members are
standing there and you can talk to them like in FFX, but if you can change
your apearence to one of theirs, you'll have duplicates.
Just wanted to know.
to make it so that one actor is always at the top?
You see, I have it so that sometimes the other party members are
standing there and you can talk to them like in FFX, but if you can change
your apearence to one of theirs, you'll have duplicates.
Just wanted to know.
Oddly enough I scripted something which solves your problem yesterday, it's part of my creatures scripts:
Allows you to choose who appears on the map basically. Enjoy.
class Game_Party
attr_accessor :fixed_lead_character
alias fixed_lead_character_initialize initialize
def initialize
fixed_lead_character_initialize
@fixed_lead_character = 5
end
end
class Game_Player < Game_Character
def refresh
if $game_party.fixed_lead_character == 0
# If party members = 0
if $game_party.actors.size == 0
# Clear character file name and hue
@character_name = ""
@character_hue = 0
# End method
return
end
# Get lead actor
actor = $game_party.actors[0]
# Set character file name and hue
@character_name = actor.character_name
@character_hue = actor.character_hue
# Initialize opacity level and blending method
@opacity = 255
@blend_type = 0
end
else
# Get lead actor
actor = $data_actors[$game_party.fixed_lead_character]
# Set character file name and hue
@character_name = actor.character_name
@character_hue = actor.character_hue
# Initialize opacity level and blending method
@opacity = 255
@blend_type = 0
end
end
attr_accessor :fixed_lead_character
alias fixed_lead_character_initialize initialize
def initialize
fixed_lead_character_initialize
@fixed_lead_character = 5
end
end
class Game_Player < Game_Character
def refresh
if $game_party.fixed_lead_character == 0
# If party members = 0
if $game_party.actors.size == 0
# Clear character file name and hue
@character_name = ""
@character_hue = 0
# End method
return
end
# Get lead actor
actor = $game_party.actors[0]
# Set character file name and hue
@character_name = actor.character_name
@character_hue = actor.character_hue
# Initialize opacity level and blending method
@opacity = 255
@blend_type = 0
end
else
# Get lead actor
actor = $data_actors[$game_party.fixed_lead_character]
# Set character file name and hue
@character_name = actor.character_name
@character_hue = actor.character_hue
# Initialize opacity level and blending method
@opacity = 255
@blend_type = 0
end
end
Expand to see the code.
Allows you to choose who appears on the map basically. Enjoy.
Thanks alot!
Hi, i'm pretty new to using RMXP so probably don't know some of the basics, but i've just been playing around with some scripts.
I really like how this script handles bigger parties, and the switching of positions in the list, but i'm having a bit of trouble.
It works very well with the caterpillar script, but is there a way to make it so the character in position 1 cannot be switched with anyone?
Also, i'm having trouble with the battle system i'm using which is ParaDog's ATB and a Side view script that works with that. Basically, after all the party has taken their first hits, the time bars stay stationary, and nothing else happens in the battle, meaning I have to escape to end it.
Great script though, thanks!
I really like how this script handles bigger parties, and the switching of positions in the list, but i'm having a bit of trouble.
It works very well with the caterpillar script, but is there a way to make it so the character in position 1 cannot be switched with anyone?
Also, i'm having trouble with the battle system i'm using which is ParaDog's ATB and a Side view script that works with that. Basically, after all the party has taken their first hits, the time bars stay stationary, and nothing else happens in the battle, meaning I have to escape to end it.
Great script though, thanks!
You didn't read post two, that has a character locking version of the script.
I've never used that battle system so a link to the exact one you're using would be helpful if you want me to look and see if I can see what is causing the problem.
I've never used that battle system so a link to the exact one you're using would be helpful if you want me to look and see if I can see what is causing the problem.
[QUOTE=Fomar0153;202562]You didn't read post two, that has a character locking version of the script.
I've never used that battle system so a link to the exact one you're using would be helpful if you want me to look and see if I can see what is causing the problem.[/QUOTE]
So it does. Not sure how I missed that.
Here is the ATB script:
And here is the side view system i'm using with it:
Thanks!
I've never used that battle system so a link to the exact one you're using would be helpful if you want me to look and see if I can see what is causing the problem.[/QUOTE]
So it does. Not sure how I missed that.
Here is the ATB script:
#=============================================================================
# Active Time Battle v.2.58
# Script by ParaDog
# http://2d6.parasite.jp/
#------------------------------------------------------------------------------
# When the CT Gauge becomes filled, the battler which it controls will then be
# able to perform his/her battle action.
# The system can also adjust the positioning of the BattleStatus window which
# works well with Sideview System scripts.
#------------------------------------------------------------------------------
# INSTALLING:
# When using this system, it is recommended that this script be placed above
# all other 'Custom' scripts... directly below Scene_Debug if possible.
#------------------------------------------------------------------------------
# ESCAPE:
# While a battler's command window is active, pressing the [ESC] button will
# activate the 'Fight / Escape' window at the top of the screen. The more
# actors you have with full CT, the better your chances are of a successful
# escape, while fewer actors results in a lower chance to flee.
#
# NEXT/PREVIOUS BATTLER:
# When two or more actors can act, you can toggle between the actors with full
# CT gauges with the [R] button or the [PageDown] key, or in reverse order with
# the [L] button or the [PageUp] key.
#==============================================================================
module PARA_CTB
# CT gauge pauses while command window is open
COMMAND_WAIT = false
# CT gauge pauses when Skill and Item windows are open, and while targeting
SELECT_WAIT = false
# CT gauge pauses when battlers perform actions
ANIMATION_WAIT = false
# CT Gauge fill / Battle system speed
BATTLE_SPEED = 3
# Maximum size in your Battle Party
PARTY_SIZE = 4
# CT Cost in percentages for each action
ACT_ATTACK_CT = 100 # Normal attack
ACT_GUARD_CT = 100 # Defense
ACT_ESCAPE_CT = 100 # Escape
ACT_SKILL_CT = 100 # Skill
ACT_ITEM_CT = 100 # Item
# Message when failed to escape
UNESCAPE_MES = "Escape failed"
# Sound effect played when the CT Gauge is full (if "", plays no sound)
# Sound effect stored in the project's "Audio/SE" folder
FULL_CT_SE = "015-Jump01"
# Sound Volume
FULL_CT_SE_VOL = 80
# Tone effect of the battler when the CT Gauge is full
# A value of (0,0,0) performs no tone change
FULL_CT_COLOR = Tone.new(32,0,0)
# Color of HP gauge (gradation left edge)
HP_COLOR_LEFT = Color.new(0, 128, 0, 255)
# Color of HP gauge (gradation right edge)
HP_COLOR_RIGHT= Color.new(0, 255, 0, 255)
# Color of SP gauge (gradation left edge)
SP_COLOR_LEFT = Color.new(0, 0, 128, 255)
# Color of SP gauge (gradation right edge)
SP_COLOR_RIGHT= Color.new(0, 0, 255, 255)
# Color of CT gauge (gradation left edge)
COLOR_LEFT = Color.new(128, 128, 64, 255)
# Color of CT gauge (gradation left edge)
COLOR_RIGHT= Color.new(255, 255, 128, 255)
# Color of CT gauge (filled gauge)
COLOR_FULL = Color.new(255, 225, 128, 255)
# Gauge Frame Color
FRAME_COLOR = Color.new(192, 192, 192, 255)
# Gauge Frame Width
FRAME_BORDER = 1
# Gauge Frame Background Color
BACK_COLOR = Color.new(128, 128, 128, 128)
# Font Size of Actor Names
NAME_FONT_SIZE = 16
# Font Size of Actor HP/SP
HPSP_FONT_SIZE = 18
# Font Size of Enemy Names
ENEMY_FONT_SIZE = 16
# Draw maximum values for HP/SP
MAX_DRAW = false
# Group Enemy Names
# Ex: Instead of "Ghost Ghost" it will say "Ghost2"
ENEMY_GROUPING = true
# Draw Bars for Enemies (0: None / 1: HP / 2: CT)
# If ENEMY_GROUPING is used, then this setting is ignored
ENEMY_DRAWING_MATER = 0
# Draw Actor HP/SP bars in the help window
HELP_DRAWING_MATER_ACTOR = false
# Draw Enemy HP/SP bars in the help window
HELP_DRAWING_MATER_ENEMY = false
# Command Window Position System (true/false)
# (Useful with side-view scripts if the position of the Actor Command Window
# appears unnatural). The default setting is false, while true allows you to
# adjust the x/y position of the window.
WINDOWPOS_CHANGE = false
WINDOWPOS_X = 100 # X coordinates of the Actor Command Window
WINDOWPOS_Y = 320 # Y coordinates of the Actor Command Window
# Opacity of the Actor Command Window
WINDOW_OPACITY = 160
# Sets the intervals of the CT bar updates
# The lower a setting, the smoother the CT Bar fill will appear (0 Minimum).
# The higher a setting, the faster the CT Bar refreshes (Useful if lagging).
CT_SKIP = 2
# End of the config section
#------------------------------------------------------------------------------
end
#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------
# This class performs battle screen processing.
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# * CT Update
#--------------------------------------------------------------------------
def update_ct
# When count rise is permitted
if @countup
for actor in $game_party.actors
# If you can act?
if actor.movable? == false and actor.ct_visible and @phase4_step != 5
# In invisibility state count rise
actor.ct_visible = false
actor.countup = true
actor.full_ct = false
elsif actor.movable? and actor.ct_visible == false
# Cancelling invisibility count rise
clear_ct(actor)
actor.ct_visible = true
end
# It corresponds to the replacement of the actor
if actor.max_ct == 0
actor.max_ct = @max_ct
end
# Count rise of actor
if actor.countup
# If the CT Gauge is filled and the actor is not in action
if actor.now_ct >= @max_ct and !(@pre_action_battlers.include?(actor))
# Adds the actor to the command input list
@pre_action_battlers.push(actor)
@action_count += 1
# Play the CG Gauge SE
if PARA_CTB::FULL_CT_SE != "" and actor.ct_visible
Audio.se_play("Audio/SE/" + PARA_CTB::FULL_CT_SE,PARA_CTB::FULL_CT_SE_VOL)
end
# Stop filling the CT Gauge
actor.countup = false
actor.full_ct = true
else
# Count rise
actor.make_action_speed
ct_skip = PARA_CTB::CT_SKIP != 0 ? PARA_CTB::CT_SKIP : 1
actor.now_ct += actor.current_action.speed * PARA_CTB::BATTLE_SPEED * ct_skip
end
end
end
for enemy in $game_troop.enemies
# If you can act
if enemy.movable? == false and enemy.ct_visible and @phase4_step == 5
# In invisibility state count rise
enemy.ct_visible = false
enemy.countup = true
enemy.full_ct = false
elsif enemy.movable? and enemy.ct_visible == false
# Clear the invisible CT
clear_ct(enemy)
enemy.ct_visible = true
end
# Count rise of enemy
if enemy.countup
# if the enemy CT Gauge is full and the enemy is not in action
if enemy.now_ct >= @max_ct and ! @pre_action_battlers.include?(enemy)
# Adds the enemy to the command input list
@pre_action_battlers.push(enemy)
@action_count += 1
# Stop filling the CT Gauge
enemy.countup = false
enemy.full_ct = true
else
# Count rise
enemy.make_action_speed
enemy.now_ct += enemy.current_action.speed * PARA_CTB::BATTLE_SPEED
end
end
end
# Redrawing CT gauge
@status_window.refresh_ct
@status_window2.refresh_ct
end
end
#--------------------------------------------------------------------------
# * Clear the battler CT
#--------------------------------------------------------------------------
def clear_ct(battler)
battler.countup = true
battler.now_ct = 0
battler.full_ct = false
end
#--------------------------------------------------------------------------
# * Percentage of battler CT
#--------------------------------------------------------------------------
def declease_ct(battler,percent)
battler.countup = true
battler.now_ct = battler.now_ct * percent / 100
battler.full_ct = false
end
#--------------------------------------------------------------------------
# * CT Initialization
#--------------------------------------------------------------------------
def initialize_ct
# Deciding the reference level of CT
max_ct
for battler in $game_party.actors + $game_troop.enemies
if battler.movable?
n = $game_party.actors.size + $game_troop.enemies.size
# Set the CT starting level
battler.now_ct = battler.agi * 60 * n
battler.ct_visible = true
else
clear_ct(battler)
battler.ct_visible = false
end
battler.countup = true
battler.full_ct = false
battler.max_ct = @max_ct
end
end
#--------------------------------------------------------------------------
# * Set the reference level of empty CT based on the Battler's speed
#--------------------------------------------------------------------------
def max_ct
for battler in $game_party.actors + $game_troop.enemies
@max_ct += battler.agi
end
@max_ct *= 100
end
#--------------------------------------------------------------------------
# * Modify the Battler's order of performance
#--------------------------------------------------------------------------
def shift_activer(shift)
# When one shifting, the actor of rear 2 or more
if @pre_action_battlers != nil
if shift == 1 and @pre_action_battlers.size >= @actor_array_index + 3
# Acquiring the present actor
act = @pre_action_battlers[@actor_array_index]
# Inserting the present actor in two rear
@pre_action_battlers.insert(@actor_array_index+2, act)
# Presently eliminating position
@pre_action_battlers.delete_at(@actor_array_index)
@actor_array_index -= 1
phase3_next_actor
else
act = @pre_action_battlers[@actor_array_index]
# Most adding the present actor to rear
@pre_action_battlers.push(act)
# Presently eliminating position
@pre_action_battlers.delete_at(@actor_array_index)
@actor_array_index -= 1
phase3_next_actor
end
end
end
#--------------------------------------------------------------------------
# * Main processing
#--------------------------------------------------------------------------
alias main_ctb main
def main
# Drawing up the enemy name window
@status_window2 = Window_BattleStatus_enemy.new
@action_battlers = []
@pre_action_battlers = []
@max_ct = 0
@countup = false
@ct_wait = 0
@action_count = 0
main_ctb
# Dispose the enemy name window
@status_window2.dispose
end
#--------------------------------------------------------------------------
# * Frame renewal
#--------------------------------------------------------------------------
alias ctb_update update
def update
# If battle event is running
if $game_system.battle_interpreter.running?
# Update interpreter
$game_system.battle_interpreter.update
# If a battler which is forcing actions doesn't exist
if $game_temp.forcing_battler == nil
# If battle event has finished running
unless $game_system.battle_interpreter.running?
# Rerun battle event set up if battle continues
unless judge
setup_battle_event
end
end
# If not after battle phase
if @phase != 5
# Refresh status window
@status_window.refresh
# Refresh enemy status window
@status_window2.refresh
end
end
else
if PARA_CTB::CT_SKIP == 0
update_ct
else
if @ct_wait > 0
@ct_wait -= 1
else
update_ct
@ct_wait = PARA_CTB::CT_SKIP
end
end
end
ctb_update
end
#--------------------------------------------------------------------------
# * Start Pre-Battle Phase
#--------------------------------------------------------------------------
alias ctb_start_phase1 start_phase1
def start_phase1
# CT Initialization
initialize_ct
# Start of Count Rise
@countup = true
# Run original call
ctb_start_phase1
end
#--------------------------------------------------------------------------
# * Frame Update (pre-battle phase)
#--------------------------------------------------------------------------
def update_phase1
# Renew the enemy name list
@status_window2.refresh
# Determine win/loss situation
if judge
# If won or lost: end method
return
end
# Start actor command phase
start_phase3
end
#--------------------------------------------------------------------------
# * Start Party Command Phase
#--------------------------------------------------------------------------
def start_phase2
# Shift to phase 2
@phase = 2
# Set actor to non-selecting
@actor_index = -1
@active_battler = nil
# Enable party command window
@party_command_window.active = true
@party_command_window.visible = true
# Disable actor command window
@actor_command_window.active = false
@actor_command_window.visible = false
# Clear main phase flag
$game_temp.battle_main_phase = false
# If impossible to input command
unless $game_party.inputable?
# Start main phase
start_phase4
end
end
#--------------------------------------------------------------------------
# * Frame Update (party command phase: escape)
#--------------------------------------------------------------------------
def update_phase2_escape
# Calculate enemy agility average
enemies_agi = 0
for enemy in $game_troop.enemies
if enemy.exist?
enemies_agi += enemy.agi
end
end
# Calculate actor agility average
actors_agi = 0
for actor in @pre_action_battlers
if actor.is_a?(Game_Actor) and actor.exist?
actors_agi += actor.agi
end
end
# Determine if escape is successful
success = rand(100) < 50 * actors_agi / enemies_agi
# If escape is successful
if success
# Play escape SE
$game_system.se_play($data_system.escape_se)
# Return to BGM before battle started
$game_system.bgm_play($game_temp.map_bgm)
# Clear the Battlers' CT
for battler in $game_party.actors
clear_ct(battler)
end
# Battle ends
battle_end(1)
# If escape is failure
else
# Set the "Escape Failure" message to the help window
@help_window.set_text(PARA_CTB::UNESCAPE_MES, 1)
# Clearing action and CT of the actor
pre_action_battlers = @pre_action_battlers.clone
for act in pre_action_battlers
if act.is_a?(Game_Actor)
declease_ct(act, 100-PARA_CTB::ACT_ESCAPE_CT)
act.current_action.clear
@pre_action_battlers.delete(act)
end
end
@party_command_window.visible = false
# Hide the help window
@help_window.visible = true
@wait_count = 20
# Start main phase
start_phase4
end
end
#--------------------------------------------------------------------------
# * Start Actor Command Phase
#--------------------------------------------------------------------------
def start_phase3
# Shift to phase 3
@phase = 3
# Set actor as unselectable
@actor_index = -1
@active_battler = nil
@actor_array_index = -1
# To command input of the following actor
if @pre_action_battlers != []
phase3_next_actor
else
start_phase4
end
end
#--------------------------------------------------------------------------
# * Go to Command Input for Next Actor
#--------------------------------------------------------------------------
def phase3_next_actor
# Loop
begin
# Actor blink effect OFF
if @active_battler != nil
@active_battler.blink = false
end
# If last actor
if @actor_array_index + 1 == @pre_action_battlers.size
# Start main phase
start_phase4
return
# The next in case of enemy
elsif $game_troop.enemies.include?(@pre_action_battlers[@actor_array_index + 1])
# Start main phase
start_phase4
return
end
# Advance actor index
@actor_array_index += 1
@actor_index = @pre_action_battlers[@actor_array_index].index
@active_battler = $game_party.actors[@actor_index]
@active_battler.blink = true
@active_battler.current_action.clear
# Once more if actor refuses command input
end until @active_battler.inputable?
# Set up actor command window
phase3_setup_command_window
end
#--------------------------------------------------------------------------
# * Go to Command Input of Previous Actor
#--------------------------------------------------------------------------
def phase3_prior_actor
# Loop
begin
# Actor blink effect OFF
if @active_battler != nil
@active_battler.blink = false
end
# If first actor
if @actor_array_index <= 0
# Start party command phase
start_phase2
return
end
# Return to actor index
@actor_array_index -= 1
@actor_index = @pre_action_battlers[@actor_array_index].index
@active_battler = $game_party.actors[@actor_index]
@active_battler.blink = true
@active_battler.current_action.clear
# Once more if actor refuses command input
end until @active_battler.inputable?
# Set up actor command window
phase3_setup_command_window
end
#--------------------------------------------------------------------------
# * Actor Command Window Setup
#--------------------------------------------------------------------------
alias phase3_setup_command_window_ctb phase3_setup_command_window
def phase3_setup_command_window
@actor_command_window.back_opacity = PARA_CTB::WINDOW_OPACITY
phase3_setup_command_window_ctb
if PARA_CTB::WINDOWPOS_CHANGE
# Set actor command window position
@actor_command_window.x = PARA_CTB::WINDOWPOS_X
@actor_command_window.y = PARA_CTB::WINDOWPOS_Y
# Way it does not hide in the status window
@actor_command_window.z = 9999
end
end
#--------------------------------------------------------------------------
# * Frame Update (actor command phase)
#--------------------------------------------------------------------------
def update_phase3
# If enemy arrow is enabled
if @enemy_arrow != nil
@countup = PARA_CTB::SELECT_WAIT ? false : true
update_phase3_enemy_select
# If actor arrow is enabled
elsif @actor_arrow != nil
@countup = PARA_CTB::SELECT_WAIT ? false : true
update_phase3_actor_select
# If skill window is enabled
elsif @skill_window != nil
@countup = PARA_CTB::SELECT_WAIT ? false : true
update_phase3_skill_select
# If item window is enabled
elsif @item_window != nil
@countup = PARA_CTB::SELECT_WAIT ? false : true
update_phase3_item_select
# If actor command window is enabled
elsif @actor_command_window.active
@countup = PARA_CTB::COMMAND_WAIT ? false : true
update_phase3_basic_command
end
end
#--------------------------------------------------------------------------
# * Frame Update (actor command phase : basic command)
#--------------------------------------------------------------------------
alias ctb_update_phase3_basic_command update_phase3_basic_command
def update_phase3_basic_command
ctb_update_phase3_basic_command
# If left or right buttons are pressed
if Input.trigger?(Input::R)
shift_activer(1)
end
if Input.trigger?(Input::L)
shift_activer(-1)
end
end
#--------------------------------------------------------------------------
# * Start Main Phase
#--------------------------------------------------------------------------
def start_phase4
# Shift to phase 4
@phase = 4
battler_count = $game_party.actors.size + $game_troop.enemies.size
if @action_count >= battler_count or $game_temp.battle_turn == 0
# Search all battle event pages
for index in 0...$data_troops[@troop_id].pages.size
# Get event page
page = $data_troops[@troop_id].pages[index]
# If this page span is [turn]
if page.span == 1
# Clear action completed flags
$game_temp.battle_event_flags[index] = false
end
end
# Turn count
$game_temp.battle_turn += 1
@action_count = 0
end
# Set actor as unselectable
@actor_index = -1
@active_battler = nil
# Enable party command window
@party_command_window.active = false
@party_command_window.visible = false
# Disable actor command window
@actor_command_window.active = false
@actor_command_window.visible = false
# Set main phase flag
$game_temp.battle_main_phase = true
# Make enemy action
for enemy in $game_troop.enemies
enemy.make_action
end
# Make action orders
make_action_orders
# Shift to step 1
@phase4_step = 1
end
#--------------------------------------------------------------------------
# * Make Action Orders
#--------------------------------------------------------------------------
def make_action_orders
# Initialize @action_battlers array
@action_battlers = []
if @pre_action_battlers != []
for i in 0..@actor_array_index
# Add the actors to the @action_battle array
@action_battlers.push(@pre_action_battlers[0])
@pre_action_battlers.shift
end
if @pre_action_battlers.size != 0
loop do
if $game_troop.enemies.include?(@pre_action_battlers[0])
# Add the enemies to the @action_battle array
@action_battlers.push(@pre_action_battlers[0])
@pre_action_battlers.shift
else
break
end
end
end
end
end
#--------------------------------------------------------------------------
# * Frame Update (main phase step 1 : action preparation)
#--------------------------------------------------------------------------
alias ctb_update_phase4_step1 update_phase4_step1
def update_phase4_step1
@countup = true
# Hide the help window
@help_window.visible = false
# Determine win/loss situation
if judge
# If won or lost: end method
return
end
# If no actionless battlers exist (all have performed an action)
if @action_battlers.size == 0
# Start actor command phase
start_phase3
return
end
ctb_update_phase4_step1
end
#--------------------------------------------------------------------------
# * Frame Update (main phase step 2 : start action)
#--------------------------------------------------------------------------
alias ctb_update_phase4_step2 update_phase4_step2
def update_phase4_step2
# If not a forcing action
unless @active_battler.current_action.forcing
# If restriction is [cannot perform action]
if @active_battler.restriction == 4
# Clear the CT
clear_ct(@active_battler)
# Clear battler being forced into action
$game_temp.forcing_battler = nil
# Shift to step 1
@phase4_step = 1
return
end
end
# Determines if CT Gauge is filled during animation
@countup = PARA_CTB::ANIMATION_WAIT ? false : true
ctb_update_phase4_step2
end
#--------------------------------------------------------------------------
# * Make Basic Action Results
#--------------------------------------------------------------------------
alias make_basic_action_result_ctb make_basic_action_result
def make_basic_action_result
# If doing nothing
if @active_battler.current_action.basic == 3
# Clear the battler's CT
clear_ct(@active_battler)
# Clear battler being forced into action
$game_temp.forcing_battler = nil
# Shift to step 1
@phase4_step = 1
return
end
make_basic_action_result_ctb
end
#--------------------------------------------------------------------------
# * Make Skill Action Results
#--------------------------------------------------------------------------
def make_skill_action_result
# Get skill
@skill = $data_skills[@active_battler.current_action.skill_id]
# If not a forcing action
unless @active_battler.current_action.forcing
# If unable to use due to SP running out
unless @active_battler.skill_can_use?(@skill.id)
# Clear battler being forced into action
$game_temp.forcing_battler = nil
# Clear the CT
declease_ct(@active_battler,100-PARA_CTB::ACT_SKILL_CT)
# Shift to step 1
@phase4_step = 1
return
end
end
# Use up SP
@active_battler.sp -= @skill.sp_cost
# Refresh status window
@status_window.refresh
# Show skill name on help window
@help_window.set_text(@skill.name, 1)
# Set animation ID
@animation1_id = @skill.animation1_id
@animation2_id = @skill.animation2_id
# Set command event ID
@common_event_id = @skill.common_event_id
# Set target battlers
set_target_battlers(@skill.scope)
# Apply skill effect
for target in @target_battlers
target.skill_effect(@active_battler, @skill)
end
end
#--------------------------------------------------------------------------
# * Make Item Action Results
#--------------------------------------------------------------------------
alias ctb_make_item_action_result make_item_action_result
def make_item_action_result
# Get item
@item = $data_items[@active_battler.current_action.item_id]
# If unable to use due to items running out
unless $game_party.item_can_use?(@item.id)
# Clear the CT
declease_ct(@active_battler,100-PARA_CTB::ACT_ITEM_CT)
# Shift to step 1
@phase4_step = 1
return
end
ctb_make_item_action_result
end
#--------------------------------------------------------------------------
# * Frame Update (main phase step 5 : damage display)
#--------------------------------------------------------------------------
alias update_phase4_step5_ctb update_phase4_step5
def update_phase4_step5
# Display damage
for target in @target_battlers
if target.damage != nil
target.movable_backup = target.movable?
end
end
update_phase4_step5_ctb
end
#--------------------------------------------------------------------------
# * Frame Update (main phase step 6 : refresh)
#--------------------------------------------------------------------------
alias update_phase4_step6_ctb update_phase4_step6
def update_phase4_step6
@active_battler.countup = true
if @active_battler.current_action.basic == 1
# Defense
declease_ct(@active_battler,100-PARA_CTB::ACT_GUARD_CT)
else
case @active_battler.current_action.kind
# Attack
when 0
declease_ct(@active_battler,100-PARA_CTB::ACT_ATTACK_CT)
# Skill
when 1
declease_ct(@active_battler,100-PARA_CTB::ACT_SKILL_CT)
# Item
when 2
declease_ct(@active_battler,100-PARA_CTB::ACT_ITEM_CT)
else
clear_ct(@active_battler)
end
end
# Clear the CT if the battler is incapacitated
for target in @target_battlers
if target.movable? == false and target.movable_backup == true
clear_ct(target)
@status_window.refresh_ct
end
end
# Renew the Enemy Name List
@status_window2.refresh
update_phase4_step6_ctb
end
#--------------------------------------------------------------------------
# * Start After Battle Phase
#--------------------------------------------------------------------------
alias ctb_start_phase5 start_phase5
def start_phase5
@countup = false
ctb_start_phase5
end
end
#==============================================================================
# ** Window_BattleStatus
#------------------------------------------------------------------------------
# This window displays the status of all party members on the battle screen.
#==============================================================================
class Window_BattleStatus < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(160, 320, 480, 160)
self.contents = Bitmap.new(width - 32, height - 32)
@level_up_flags = [false, false, false, false]
@before_hp = []
@before_sp = []
@before_states = []
@now_hp = []
@now_sp = []
@now_states = []
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
line_height = 120 / PARA_CTB::PARTY_SIZE
actor_y = i * line_height + 4
# Present status in arrangement
@now_hp[i] = actor.hp
@now_sp[i] = actor.sp
@now_states[i] = actor.states
# If leveling up
if @level_up_flags[i]
self.contents.fill_rect(344, actor_y+14, 100, 8, Color.new(0, 0, 0, 0))
self.contents.font.color = normal_color
self.contents.draw_text(344, actor_y, 120, 32, "LEVEL UP!")
end
end
# Light weight conversion processing of battle status
# When arrangement of status changes only, drawing processing
if @before_hp == nil or @before_sp == nil or @before_states == nil or
@before_hp != @now_hp or @before_sp != @now_sp or @before_states != @now_states
self.contents.clear
for i2 in 0...$game_party.actors.size
actor = $game_party.actors[i2]
line_height = 120 / PARA_CTB::PARTY_SIZE
actor_y = i2 * line_height + 4
self.contents.font.size = PARA_CTB::NAME_FONT_SIZE
# Draw Actor Name
draw_actor_name(actor, 4, actor_y+16-PARA_CTB::NAME_FONT_SIZE)
# Draw HP
hp_color1 = PARA_CTB::HP_COLOR_LEFT
hp_color2 = PARA_CTB::HP_COLOR_RIGHT
draw_meter(actor.hp, actor.maxhp, 125, actor_y+14, 80, 8, hp_color1, hp_color2)
draw_actor_hp(actor, 102, actor_y+16-PARA_CTB::HPSP_FONT_SIZE, 100)
# Draw SP
sp_color1 = PARA_CTB::SP_COLOR_LEFT
sp_color2 = PARA_CTB::SP_COLOR_RIGHT
draw_meter(actor.sp, actor.maxsp, 245, actor_y+14, 80, 8, sp_color1, sp_color2)
draw_actor_sp(actor, 222, actor_y+16-PARA_CTB::HPSP_FONT_SIZE, 100)
# Status after the changing in arrangement
@before_hp[i2] = actor.hp
@before_sp[i2] = actor.sp
@before_states[i2] = actor.states
# If Leveling up
if @level_up_flags[i2]
self.contents.fill_rect(344, actor_y, 100, 8, Color.new(0, 0, 0, 0))
self.contents.font.color = normal_color
self.contents.draw_text(344, actor_y, 120, 32, "LEVEL UP!")
end
end
end
refresh_ct
end
#--------------------------------------------------------------------------
# * Refresh the CT Gauge
#--------------------------------------------------------------------------
def refresh_ct
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
line_height = 120 / PARA_CTB::PARTY_SIZE
actor_y = i * line_height + 4
# When the CT gauge is full, color of gauge
ct_color_full = PARA_CTB::COLOR_FULL
# Color of CT gauge (left hand edge)
ct_color_start = actor.full_ct ? ct_color_full : PARA_CTB::COLOR_LEFT
# Color of CT gauge (right hand edge)
ct_color_end = actor.full_ct ? ct_color_full : PARA_CTB::COLOR_RIGHT
if @level_up_flags[i] != true and actor.ct_visible
draw_meter(actor.now_ct, actor.max_ct, 344, actor_y+14, 100, 8, ct_color_start, ct_color_end)
elsif @level_up_flags[i] != true
draw_meter(0, actor.max_ct, 344, actor_y+14, 100, 8, ct_color_start, ct_color_end)
end
end
end
#--------------------------------------------------------------------------
# * Frame Renewal
#--------------------------------------------------------------------------
def update
super
end
#--------------------------------------------------------------------------
# * Draw HP
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# width : draw spot width
#--------------------------------------------------------------------------
def draw_actor_hp(actor, x, y, width = 144)
# Draw the "HP" text
self.contents.font.color = system_color
self.contents.font.size = 16
self.contents.draw_text(x, y+2, 32, 32, $data_system.words.hp)
self.contents.font.color = normal_color
self.contents.font.size = PARA_CTB::HPSP_FONT_SIZE
if PARA_CTB::MAX_DRAW
# Draw the MaxHP
self.contents.draw_text(x, y, width, 32, actor.maxhp.to_s, 2)
text_size = self.contents.text_size(actor.maxhp.to_s)
text_x = x + width - text_size.width - 12
self.contents.draw_text(text_x, y, 12, 32, "/", 1)
# Draw the HP
self.contents.font.color = actor.hp == 0 ? knockout_color :
actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
text_x = text_x - text_size.width
self.contents.draw_text(text_x, y, text_size.width, 32, actor.hp.to_s, 2)
else
self.contents.font.color = actor.hp == 0 ? knockout_color :
actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
self.contents.draw_text(x, y, width, 32, actor.hp.to_s, 2)
end
end
#--------------------------------------------------------------------------
# * Draw SP
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# width : draw spot width
#--------------------------------------------------------------------------
def draw_actor_sp(actor, x, y, width = 144)
# Draw the "SP" text
self.contents.font.color = system_color
self.contents.font.size = 16
self.contents.draw_text(x, y+2, 32, 32, $data_system.words.sp)
self.contents.font.color = normal_color
self.contents.font.size = PARA_CTB::HPSP_FONT_SIZE
if PARA_CTB::MAX_DRAW
# Draw the MaxSP
self.contents.draw_text(x, y, width, 32, actor.maxsp.to_s, 2)
text_size = self.contents.text_size(actor.maxsp.to_s)
text_x = x + width - text_size.width - 12
self.contents.draw_text(text_x, y, 12, 32, "/", 1)
# Draw the SP
self.contents.font.color = actor.sp == 0 ? knockout_color :
actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
text_x = text_x - text_size.width
self.contents.draw_text(text_x, y, text_size.width, 32, actor.sp.to_s, 2)
else
self.contents.font.color = actor.sp == 0 ? knockout_color :
actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
self.contents.draw_text(x, y, width, 32, actor.sp.to_s, 2)
end
end
end
#==============================================================================
# ** Window_BattleStatus_enemy
#------------------------------------------------------------------------------
# This window displays the status of all enemy troops on the battle screen.
#==============================================================================
class Window_BattleStatus_enemy < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(0, 320, 160, 160)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.color = normal_color
self.contents.font.size = PARA_CTB::ENEMY_FONT_SIZE
@exist_enemies = []
if $game_troop.enemies != nil
if PARA_CTB::ENEMY_GROUPING
ememy_list = []
ememy_list_index = []
# Loop through the Enemy Troop
for i in 0...$game_troop.enemies.size
enemy = $game_troop.enemies[i]
if enemy.exist?
if ememy_list.include?(enemy.name)
ememy_list_index[ememy_list.index(enemy.name)] += 1
else
# Store the enemy name
ememy_list.push(enemy.name)
ememy_list_index[ememy_list.index(enemy.name)] = 1
end
end
end
# Draw the name and number of the enemy
enemy_index = 0
for enemy_name in ememy_list
enemy_y = enemy_index * (PARA_CTB::ENEMY_FONT_SIZE+6) + 4
if ememy_list_index[enemy_index] > 1
enemy_name = enemy_name + " " + ememy_list_index[enemy_index].to_s
end
self.contents.draw_text(4, enemy_y, 160, 20, enemy_name)
enemy_index += 1
end
else
# Draw the enemy name
enemy_index = 0
for i in 0...$game_troop.enemies.size
enemy = $game_troop.enemies[i]
if enemy.exist?
@exist_enemies.push(enemy)
line_height = PARA_CTB::ENEMY_FONT_SIZE + 6
if PARA_CTB::ENEMY_DRAWING_MATER != 0
line_height += 10
end
enemy_y = enemy_index * line_height + 4
self.contents.draw_text(4, enemy_y, 160, 20, enemy.name)
enemy_index += 1
if PARA_CTB::ENEMY_DRAWING_MATER == 1
hp_color1 = PARA_CTB::HP_COLOR_LEFT
hp_color2 = PARA_CTB::HP_COLOR_RIGHT
y = enemy_y + PARA_CTB::ENEMY_FONT_SIZE + 3
draw_meter(enemy.hp, enemy.maxhp, 4, y, 80, 8, hp_color1, hp_color2)
end
end
end
end
end
refresh_ct
end
#--------------------------------------------------------------------------
# * Refresh the CT gauge
#--------------------------------------------------------------------------
def refresh_ct
if PARA_CTB::ENEMY_DRAWING_MATER == 2 and @exist_enemies != nil
enemy_index = 0
for enemy in @exist_enemies
line_height = PARA_CTB::ENEMY_FONT_SIZE + 16
enemy_y = enemy_index * line_height + 4
y = enemy_y + PARA_CTB::ENEMY_FONT_SIZE + 3
# When the CT gauge is full, color of gauge
ct_color_full = PARA_CTB::COLOR_FULL
# Color of CT gauge (the left edge)
ct_color_start = enemy.full_ct ? ct_color_full : PARA_CTB::COLOR_LEFT
# Color of CT gauge (the right edge)
ct_color_end = enemy.full_ct ? ct_color_full : PARA_CTB::COLOR_RIGHT
if enemy.ct_visible
draw_meter(enemy.now_ct, enemy.max_ct, 4, y, 100, 8, ct_color_start, ct_color_end)
else
draw_meter(0, enemy.max_ct, 4, y, 100, 8, ct_color_start, ct_color_end)
end
enemy_index += 1
end
end
end
end
#==============================================================================
# ** Window_Base
#------------------------------------------------------------------------------
# This class is for all in-game windows.
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# * Draw the meter
#--------------------------------------------------------------------------
def draw_meter(now, max, x, y, width, height, start_color, end_color=start_color )
self.contents.fill_rect(x, y, width, height, PARA_CTB::FRAME_COLOR)
self.contents.fill_rect(x+PARA_CTB::FRAME_BORDER, y+PARA_CTB::FRAME_BORDER, width -
PARA_CTB::FRAME_BORDER*2, height-PARA_CTB::FRAME_BORDER*2, PARA_CTB::BACK_COLOR)
now = now > max ? max : now
percentage = max != 0 ? (width-2) * now / max.to_f : 0
if start_color == end_color
self.contents.fill_rect(x+1, y+1, percentage, height-2, start_color)
else
for i in 1..percentage
r = start_color.red + (end_color.red - start_color.red) / percentage * i
g = start_color.green + (end_color.green - start_color.green) / percentage * i
b = start_color.blue + (end_color.blue - start_color.blue) / percentage * i
a = start_color.alpha + (end_color.alpha - start_color.alpha) / percentage * i
self.contents.fill_rect(x+i, y+1, 1, height-2, Color.new(r, g, b, a))
end
end
end
end
#==============================================================================
# ** Game_Battler
#------------------------------------------------------------------------------
# This class deals with battlers. It's used as a superclass for the Game_Actor
# and Game_Enemy classes.
#==============================================================================
class Game_Battler
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :max_ct
attr_accessor :now_ct
attr_accessor :full_ct
attr_accessor :countup
attr_accessor :ct_visible
attr_accessor :movable_backup
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
alias ctb_initialize initialize
def initialize
ctb_initialize
@max_ct = 0
@now_ct = 0
@full_ct = false
@countup = true
@ct_visible = true
end
end
#==============================================================================
# ** Sprite_Battler
#------------------------------------------------------------------------------
# This sprite is used to display the battler.It observes the Game_Character
# class and automatically changes sprite conditions.
#==============================================================================
class Sprite_Battler < RPG::Sprite
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
alias ctb_update update
def update
ctb_update
if @battler != nil
if @battler.full_ct and @battler.ct_visible
# Change the color tone of the battler when the CT Gauge is full
fullct_color = PARA_CTB::FULL_CT_COLOR
self.tone = fullct_color
else
fullct_color = Tone.new(0,0,0)
self.tone = fullct_color
end
end
end
end
#==============================================================================
# ** Window_Help
#------------------------------------------------------------------------------
# This window shows skill and item explanations along with actor status.
#==============================================================================
class Window_Help < Window_Base
#--------------------------------------------------------------------------
# * Set Actor
# actor : status displaying actor
#--------------------------------------------------------------------------
alias set_actor_ctb set_actor
def set_actor(actor)
if PARA_CTB::HELP_DRAWING_MATER_ACTOR
self.contents.clear
draw_actor_name(actor, 4, 0)
draw_actor_state(actor, 140, 0)
hp_color1 = PARA_CTB::HP_COLOR_LEFT
hp_color2 = PARA_CTB::HP_COLOR_RIGHT
draw_meter(actor.hp, actor.maxhp, 316, 18, 112, 8, hp_color1, hp_color2)
draw_actor_hp(actor, 284, 0)
sp_color1 = PARA_CTB::SP_COLOR_LEFT
sp_color2 = PARA_CTB::SP_COLOR_RIGHT
draw_meter(actor.sp, actor.maxsp, 492, 18, 112, 8, sp_color1, sp_color2)
draw_actor_sp(actor, 460, 0)
@actor = actor
@text = nil
self.visible = true
else
set_actor_ctb(actor)
end
end
#--------------------------------------------------------------------------
# * Set Enemy
# enemy : name and status displaying enemy
#--------------------------------------------------------------------------
alias set_enemy_ctb set_enemy
def set_enemy(enemy)
if PARA_CTB::HELP_DRAWING_MATER_ENEMY
self.contents.clear
draw_actor_name(enemy, 4, 0)
draw_actor_state(enemy, 140, 0)
hp_color1 = PARA_CTB::HP_COLOR_LEFT
hp_color2 = PARA_CTB::HP_COLOR_RIGHT
draw_meter(enemy.hp, enemy.maxhp, 316, 18, 112, 8, hp_color1, hp_color2)
draw_actor_hp(enemy, 284, 0)
sp_color1 = PARA_CTB::SP_COLOR_LEFT
sp_color2 = PARA_CTB::SP_COLOR_RIGHT
draw_meter(enemy.sp, enemy.maxsp, 492, 18, 112, 8, sp_color1, sp_color2)
draw_actor_sp(enemy, 460, 0)
self.visible = true
else
set_enemy_ctb(enemy)
end
end
end
# Active Time Battle v.2.58
# Script by ParaDog
# http://2d6.parasite.jp/
#------------------------------------------------------------------------------
# When the CT Gauge becomes filled, the battler which it controls will then be
# able to perform his/her battle action.
# The system can also adjust the positioning of the BattleStatus window which
# works well with Sideview System scripts.
#------------------------------------------------------------------------------
# INSTALLING:
# When using this system, it is recommended that this script be placed above
# all other 'Custom' scripts... directly below Scene_Debug if possible.
#------------------------------------------------------------------------------
# ESCAPE:
# While a battler's command window is active, pressing the [ESC] button will
# activate the 'Fight / Escape' window at the top of the screen. The more
# actors you have with full CT, the better your chances are of a successful
# escape, while fewer actors results in a lower chance to flee.
#
# NEXT/PREVIOUS BATTLER:
# When two or more actors can act, you can toggle between the actors with full
# CT gauges with the [R] button or the [PageDown] key, or in reverse order with
# the [L] button or the [PageUp] key.
#==============================================================================
module PARA_CTB
# CT gauge pauses while command window is open
COMMAND_WAIT = false
# CT gauge pauses when Skill and Item windows are open, and while targeting
SELECT_WAIT = false
# CT gauge pauses when battlers perform actions
ANIMATION_WAIT = false
# CT Gauge fill / Battle system speed
BATTLE_SPEED = 3
# Maximum size in your Battle Party
PARTY_SIZE = 4
# CT Cost in percentages for each action
ACT_ATTACK_CT = 100 # Normal attack
ACT_GUARD_CT = 100 # Defense
ACT_ESCAPE_CT = 100 # Escape
ACT_SKILL_CT = 100 # Skill
ACT_ITEM_CT = 100 # Item
# Message when failed to escape
UNESCAPE_MES = "Escape failed"
# Sound effect played when the CT Gauge is full (if "", plays no sound)
# Sound effect stored in the project's "Audio/SE" folder
FULL_CT_SE = "015-Jump01"
# Sound Volume
FULL_CT_SE_VOL = 80
# Tone effect of the battler when the CT Gauge is full
# A value of (0,0,0) performs no tone change
FULL_CT_COLOR = Tone.new(32,0,0)
# Color of HP gauge (gradation left edge)
HP_COLOR_LEFT = Color.new(0, 128, 0, 255)
# Color of HP gauge (gradation right edge)
HP_COLOR_RIGHT= Color.new(0, 255, 0, 255)
# Color of SP gauge (gradation left edge)
SP_COLOR_LEFT = Color.new(0, 0, 128, 255)
# Color of SP gauge (gradation right edge)
SP_COLOR_RIGHT= Color.new(0, 0, 255, 255)
# Color of CT gauge (gradation left edge)
COLOR_LEFT = Color.new(128, 128, 64, 255)
# Color of CT gauge (gradation left edge)
COLOR_RIGHT= Color.new(255, 255, 128, 255)
# Color of CT gauge (filled gauge)
COLOR_FULL = Color.new(255, 225, 128, 255)
# Gauge Frame Color
FRAME_COLOR = Color.new(192, 192, 192, 255)
# Gauge Frame Width
FRAME_BORDER = 1
# Gauge Frame Background Color
BACK_COLOR = Color.new(128, 128, 128, 128)
# Font Size of Actor Names
NAME_FONT_SIZE = 16
# Font Size of Actor HP/SP
HPSP_FONT_SIZE = 18
# Font Size of Enemy Names
ENEMY_FONT_SIZE = 16
# Draw maximum values for HP/SP
MAX_DRAW = false
# Group Enemy Names
# Ex: Instead of "Ghost Ghost" it will say "Ghost2"
ENEMY_GROUPING = true
# Draw Bars for Enemies (0: None / 1: HP / 2: CT)
# If ENEMY_GROUPING is used, then this setting is ignored
ENEMY_DRAWING_MATER = 0
# Draw Actor HP/SP bars in the help window
HELP_DRAWING_MATER_ACTOR = false
# Draw Enemy HP/SP bars in the help window
HELP_DRAWING_MATER_ENEMY = false
# Command Window Position System (true/false)
# (Useful with side-view scripts if the position of the Actor Command Window
# appears unnatural). The default setting is false, while true allows you to
# adjust the x/y position of the window.
WINDOWPOS_CHANGE = false
WINDOWPOS_X = 100 # X coordinates of the Actor Command Window
WINDOWPOS_Y = 320 # Y coordinates of the Actor Command Window
# Opacity of the Actor Command Window
WINDOW_OPACITY = 160
# Sets the intervals of the CT bar updates
# The lower a setting, the smoother the CT Bar fill will appear (0 Minimum).
# The higher a setting, the faster the CT Bar refreshes (Useful if lagging).
CT_SKIP = 2
# End of the config section
#------------------------------------------------------------------------------
end
#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------
# This class performs battle screen processing.
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# * CT Update
#--------------------------------------------------------------------------
def update_ct
# When count rise is permitted
if @countup
for actor in $game_party.actors
# If you can act?
if actor.movable? == false and actor.ct_visible and @phase4_step != 5
# In invisibility state count rise
actor.ct_visible = false
actor.countup = true
actor.full_ct = false
elsif actor.movable? and actor.ct_visible == false
# Cancelling invisibility count rise
clear_ct(actor)
actor.ct_visible = true
end
# It corresponds to the replacement of the actor
if actor.max_ct == 0
actor.max_ct = @max_ct
end
# Count rise of actor
if actor.countup
# If the CT Gauge is filled and the actor is not in action
if actor.now_ct >= @max_ct and !(@pre_action_battlers.include?(actor))
# Adds the actor to the command input list
@pre_action_battlers.push(actor)
@action_count += 1
# Play the CG Gauge SE
if PARA_CTB::FULL_CT_SE != "" and actor.ct_visible
Audio.se_play("Audio/SE/" + PARA_CTB::FULL_CT_SE,PARA_CTB::FULL_CT_SE_VOL)
end
# Stop filling the CT Gauge
actor.countup = false
actor.full_ct = true
else
# Count rise
actor.make_action_speed
ct_skip = PARA_CTB::CT_SKIP != 0 ? PARA_CTB::CT_SKIP : 1
actor.now_ct += actor.current_action.speed * PARA_CTB::BATTLE_SPEED * ct_skip
end
end
end
for enemy in $game_troop.enemies
# If you can act
if enemy.movable? == false and enemy.ct_visible and @phase4_step == 5
# In invisibility state count rise
enemy.ct_visible = false
enemy.countup = true
enemy.full_ct = false
elsif enemy.movable? and enemy.ct_visible == false
# Clear the invisible CT
clear_ct(enemy)
enemy.ct_visible = true
end
# Count rise of enemy
if enemy.countup
# if the enemy CT Gauge is full and the enemy is not in action
if enemy.now_ct >= @max_ct and ! @pre_action_battlers.include?(enemy)
# Adds the enemy to the command input list
@pre_action_battlers.push(enemy)
@action_count += 1
# Stop filling the CT Gauge
enemy.countup = false
enemy.full_ct = true
else
# Count rise
enemy.make_action_speed
enemy.now_ct += enemy.current_action.speed * PARA_CTB::BATTLE_SPEED
end
end
end
# Redrawing CT gauge
@status_window.refresh_ct
@status_window2.refresh_ct
end
end
#--------------------------------------------------------------------------
# * Clear the battler CT
#--------------------------------------------------------------------------
def clear_ct(battler)
battler.countup = true
battler.now_ct = 0
battler.full_ct = false
end
#--------------------------------------------------------------------------
# * Percentage of battler CT
#--------------------------------------------------------------------------
def declease_ct(battler,percent)
battler.countup = true
battler.now_ct = battler.now_ct * percent / 100
battler.full_ct = false
end
#--------------------------------------------------------------------------
# * CT Initialization
#--------------------------------------------------------------------------
def initialize_ct
# Deciding the reference level of CT
max_ct
for battler in $game_party.actors + $game_troop.enemies
if battler.movable?
n = $game_party.actors.size + $game_troop.enemies.size
# Set the CT starting level
battler.now_ct = battler.agi * 60 * n
battler.ct_visible = true
else
clear_ct(battler)
battler.ct_visible = false
end
battler.countup = true
battler.full_ct = false
battler.max_ct = @max_ct
end
end
#--------------------------------------------------------------------------
# * Set the reference level of empty CT based on the Battler's speed
#--------------------------------------------------------------------------
def max_ct
for battler in $game_party.actors + $game_troop.enemies
@max_ct += battler.agi
end
@max_ct *= 100
end
#--------------------------------------------------------------------------
# * Modify the Battler's order of performance
#--------------------------------------------------------------------------
def shift_activer(shift)
# When one shifting, the actor of rear 2 or more
if @pre_action_battlers != nil
if shift == 1 and @pre_action_battlers.size >= @actor_array_index + 3
# Acquiring the present actor
act = @pre_action_battlers[@actor_array_index]
# Inserting the present actor in two rear
@pre_action_battlers.insert(@actor_array_index+2, act)
# Presently eliminating position
@pre_action_battlers.delete_at(@actor_array_index)
@actor_array_index -= 1
phase3_next_actor
else
act = @pre_action_battlers[@actor_array_index]
# Most adding the present actor to rear
@pre_action_battlers.push(act)
# Presently eliminating position
@pre_action_battlers.delete_at(@actor_array_index)
@actor_array_index -= 1
phase3_next_actor
end
end
end
#--------------------------------------------------------------------------
# * Main processing
#--------------------------------------------------------------------------
alias main_ctb main
def main
# Drawing up the enemy name window
@status_window2 = Window_BattleStatus_enemy.new
@action_battlers = []
@pre_action_battlers = []
@max_ct = 0
@countup = false
@ct_wait = 0
@action_count = 0
main_ctb
# Dispose the enemy name window
@status_window2.dispose
end
#--------------------------------------------------------------------------
# * Frame renewal
#--------------------------------------------------------------------------
alias ctb_update update
def update
# If battle event is running
if $game_system.battle_interpreter.running?
# Update interpreter
$game_system.battle_interpreter.update
# If a battler which is forcing actions doesn't exist
if $game_temp.forcing_battler == nil
# If battle event has finished running
unless $game_system.battle_interpreter.running?
# Rerun battle event set up if battle continues
unless judge
setup_battle_event
end
end
# If not after battle phase
if @phase != 5
# Refresh status window
@status_window.refresh
# Refresh enemy status window
@status_window2.refresh
end
end
else
if PARA_CTB::CT_SKIP == 0
update_ct
else
if @ct_wait > 0
@ct_wait -= 1
else
update_ct
@ct_wait = PARA_CTB::CT_SKIP
end
end
end
ctb_update
end
#--------------------------------------------------------------------------
# * Start Pre-Battle Phase
#--------------------------------------------------------------------------
alias ctb_start_phase1 start_phase1
def start_phase1
# CT Initialization
initialize_ct
# Start of Count Rise
@countup = true
# Run original call
ctb_start_phase1
end
#--------------------------------------------------------------------------
# * Frame Update (pre-battle phase)
#--------------------------------------------------------------------------
def update_phase1
# Renew the enemy name list
@status_window2.refresh
# Determine win/loss situation
if judge
# If won or lost: end method
return
end
# Start actor command phase
start_phase3
end
#--------------------------------------------------------------------------
# * Start Party Command Phase
#--------------------------------------------------------------------------
def start_phase2
# Shift to phase 2
@phase = 2
# Set actor to non-selecting
@actor_index = -1
@active_battler = nil
# Enable party command window
@party_command_window.active = true
@party_command_window.visible = true
# Disable actor command window
@actor_command_window.active = false
@actor_command_window.visible = false
# Clear main phase flag
$game_temp.battle_main_phase = false
# If impossible to input command
unless $game_party.inputable?
# Start main phase
start_phase4
end
end
#--------------------------------------------------------------------------
# * Frame Update (party command phase: escape)
#--------------------------------------------------------------------------
def update_phase2_escape
# Calculate enemy agility average
enemies_agi = 0
for enemy in $game_troop.enemies
if enemy.exist?
enemies_agi += enemy.agi
end
end
# Calculate actor agility average
actors_agi = 0
for actor in @pre_action_battlers
if actor.is_a?(Game_Actor) and actor.exist?
actors_agi += actor.agi
end
end
# Determine if escape is successful
success = rand(100) < 50 * actors_agi / enemies_agi
# If escape is successful
if success
# Play escape SE
$game_system.se_play($data_system.escape_se)
# Return to BGM before battle started
$game_system.bgm_play($game_temp.map_bgm)
# Clear the Battlers' CT
for battler in $game_party.actors
clear_ct(battler)
end
# Battle ends
battle_end(1)
# If escape is failure
else
# Set the "Escape Failure" message to the help window
@help_window.set_text(PARA_CTB::UNESCAPE_MES, 1)
# Clearing action and CT of the actor
pre_action_battlers = @pre_action_battlers.clone
for act in pre_action_battlers
if act.is_a?(Game_Actor)
declease_ct(act, 100-PARA_CTB::ACT_ESCAPE_CT)
act.current_action.clear
@pre_action_battlers.delete(act)
end
end
@party_command_window.visible = false
# Hide the help window
@help_window.visible = true
@wait_count = 20
# Start main phase
start_phase4
end
end
#--------------------------------------------------------------------------
# * Start Actor Command Phase
#--------------------------------------------------------------------------
def start_phase3
# Shift to phase 3
@phase = 3
# Set actor as unselectable
@actor_index = -1
@active_battler = nil
@actor_array_index = -1
# To command input of the following actor
if @pre_action_battlers != []
phase3_next_actor
else
start_phase4
end
end
#--------------------------------------------------------------------------
# * Go to Command Input for Next Actor
#--------------------------------------------------------------------------
def phase3_next_actor
# Loop
begin
# Actor blink effect OFF
if @active_battler != nil
@active_battler.blink = false
end
# If last actor
if @actor_array_index + 1 == @pre_action_battlers.size
# Start main phase
start_phase4
return
# The next in case of enemy
elsif $game_troop.enemies.include?(@pre_action_battlers[@actor_array_index + 1])
# Start main phase
start_phase4
return
end
# Advance actor index
@actor_array_index += 1
@actor_index = @pre_action_battlers[@actor_array_index].index
@active_battler = $game_party.actors[@actor_index]
@active_battler.blink = true
@active_battler.current_action.clear
# Once more if actor refuses command input
end until @active_battler.inputable?
# Set up actor command window
phase3_setup_command_window
end
#--------------------------------------------------------------------------
# * Go to Command Input of Previous Actor
#--------------------------------------------------------------------------
def phase3_prior_actor
# Loop
begin
# Actor blink effect OFF
if @active_battler != nil
@active_battler.blink = false
end
# If first actor
if @actor_array_index <= 0
# Start party command phase
start_phase2
return
end
# Return to actor index
@actor_array_index -= 1
@actor_index = @pre_action_battlers[@actor_array_index].index
@active_battler = $game_party.actors[@actor_index]
@active_battler.blink = true
@active_battler.current_action.clear
# Once more if actor refuses command input
end until @active_battler.inputable?
# Set up actor command window
phase3_setup_command_window
end
#--------------------------------------------------------------------------
# * Actor Command Window Setup
#--------------------------------------------------------------------------
alias phase3_setup_command_window_ctb phase3_setup_command_window
def phase3_setup_command_window
@actor_command_window.back_opacity = PARA_CTB::WINDOW_OPACITY
phase3_setup_command_window_ctb
if PARA_CTB::WINDOWPOS_CHANGE
# Set actor command window position
@actor_command_window.x = PARA_CTB::WINDOWPOS_X
@actor_command_window.y = PARA_CTB::WINDOWPOS_Y
# Way it does not hide in the status window
@actor_command_window.z = 9999
end
end
#--------------------------------------------------------------------------
# * Frame Update (actor command phase)
#--------------------------------------------------------------------------
def update_phase3
# If enemy arrow is enabled
if @enemy_arrow != nil
@countup = PARA_CTB::SELECT_WAIT ? false : true
update_phase3_enemy_select
# If actor arrow is enabled
elsif @actor_arrow != nil
@countup = PARA_CTB::SELECT_WAIT ? false : true
update_phase3_actor_select
# If skill window is enabled
elsif @skill_window != nil
@countup = PARA_CTB::SELECT_WAIT ? false : true
update_phase3_skill_select
# If item window is enabled
elsif @item_window != nil
@countup = PARA_CTB::SELECT_WAIT ? false : true
update_phase3_item_select
# If actor command window is enabled
elsif @actor_command_window.active
@countup = PARA_CTB::COMMAND_WAIT ? false : true
update_phase3_basic_command
end
end
#--------------------------------------------------------------------------
# * Frame Update (actor command phase : basic command)
#--------------------------------------------------------------------------
alias ctb_update_phase3_basic_command update_phase3_basic_command
def update_phase3_basic_command
ctb_update_phase3_basic_command
# If left or right buttons are pressed
if Input.trigger?(Input::R)
shift_activer(1)
end
if Input.trigger?(Input::L)
shift_activer(-1)
end
end
#--------------------------------------------------------------------------
# * Start Main Phase
#--------------------------------------------------------------------------
def start_phase4
# Shift to phase 4
@phase = 4
battler_count = $game_party.actors.size + $game_troop.enemies.size
if @action_count >= battler_count or $game_temp.battle_turn == 0
# Search all battle event pages
for index in 0...$data_troops[@troop_id].pages.size
# Get event page
page = $data_troops[@troop_id].pages[index]
# If this page span is [turn]
if page.span == 1
# Clear action completed flags
$game_temp.battle_event_flags[index] = false
end
end
# Turn count
$game_temp.battle_turn += 1
@action_count = 0
end
# Set actor as unselectable
@actor_index = -1
@active_battler = nil
# Enable party command window
@party_command_window.active = false
@party_command_window.visible = false
# Disable actor command window
@actor_command_window.active = false
@actor_command_window.visible = false
# Set main phase flag
$game_temp.battle_main_phase = true
# Make enemy action
for enemy in $game_troop.enemies
enemy.make_action
end
# Make action orders
make_action_orders
# Shift to step 1
@phase4_step = 1
end
#--------------------------------------------------------------------------
# * Make Action Orders
#--------------------------------------------------------------------------
def make_action_orders
# Initialize @action_battlers array
@action_battlers = []
if @pre_action_battlers != []
for i in 0..@actor_array_index
# Add the actors to the @action_battle array
@action_battlers.push(@pre_action_battlers[0])
@pre_action_battlers.shift
end
if @pre_action_battlers.size != 0
loop do
if $game_troop.enemies.include?(@pre_action_battlers[0])
# Add the enemies to the @action_battle array
@action_battlers.push(@pre_action_battlers[0])
@pre_action_battlers.shift
else
break
end
end
end
end
end
#--------------------------------------------------------------------------
# * Frame Update (main phase step 1 : action preparation)
#--------------------------------------------------------------------------
alias ctb_update_phase4_step1 update_phase4_step1
def update_phase4_step1
@countup = true
# Hide the help window
@help_window.visible = false
# Determine win/loss situation
if judge
# If won or lost: end method
return
end
# If no actionless battlers exist (all have performed an action)
if @action_battlers.size == 0
# Start actor command phase
start_phase3
return
end
ctb_update_phase4_step1
end
#--------------------------------------------------------------------------
# * Frame Update (main phase step 2 : start action)
#--------------------------------------------------------------------------
alias ctb_update_phase4_step2 update_phase4_step2
def update_phase4_step2
# If not a forcing action
unless @active_battler.current_action.forcing
# If restriction is [cannot perform action]
if @active_battler.restriction == 4
# Clear the CT
clear_ct(@active_battler)
# Clear battler being forced into action
$game_temp.forcing_battler = nil
# Shift to step 1
@phase4_step = 1
return
end
end
# Determines if CT Gauge is filled during animation
@countup = PARA_CTB::ANIMATION_WAIT ? false : true
ctb_update_phase4_step2
end
#--------------------------------------------------------------------------
# * Make Basic Action Results
#--------------------------------------------------------------------------
alias make_basic_action_result_ctb make_basic_action_result
def make_basic_action_result
# If doing nothing
if @active_battler.current_action.basic == 3
# Clear the battler's CT
clear_ct(@active_battler)
# Clear battler being forced into action
$game_temp.forcing_battler = nil
# Shift to step 1
@phase4_step = 1
return
end
make_basic_action_result_ctb
end
#--------------------------------------------------------------------------
# * Make Skill Action Results
#--------------------------------------------------------------------------
def make_skill_action_result
# Get skill
@skill = $data_skills[@active_battler.current_action.skill_id]
# If not a forcing action
unless @active_battler.current_action.forcing
# If unable to use due to SP running out
unless @active_battler.skill_can_use?(@skill.id)
# Clear battler being forced into action
$game_temp.forcing_battler = nil
# Clear the CT
declease_ct(@active_battler,100-PARA_CTB::ACT_SKILL_CT)
# Shift to step 1
@phase4_step = 1
return
end
end
# Use up SP
@active_battler.sp -= @skill.sp_cost
# Refresh status window
@status_window.refresh
# Show skill name on help window
@help_window.set_text(@skill.name, 1)
# Set animation ID
@animation1_id = @skill.animation1_id
@animation2_id = @skill.animation2_id
# Set command event ID
@common_event_id = @skill.common_event_id
# Set target battlers
set_target_battlers(@skill.scope)
# Apply skill effect
for target in @target_battlers
target.skill_effect(@active_battler, @skill)
end
end
#--------------------------------------------------------------------------
# * Make Item Action Results
#--------------------------------------------------------------------------
alias ctb_make_item_action_result make_item_action_result
def make_item_action_result
# Get item
@item = $data_items[@active_battler.current_action.item_id]
# If unable to use due to items running out
unless $game_party.item_can_use?(@item.id)
# Clear the CT
declease_ct(@active_battler,100-PARA_CTB::ACT_ITEM_CT)
# Shift to step 1
@phase4_step = 1
return
end
ctb_make_item_action_result
end
#--------------------------------------------------------------------------
# * Frame Update (main phase step 5 : damage display)
#--------------------------------------------------------------------------
alias update_phase4_step5_ctb update_phase4_step5
def update_phase4_step5
# Display damage
for target in @target_battlers
if target.damage != nil
target.movable_backup = target.movable?
end
end
update_phase4_step5_ctb
end
#--------------------------------------------------------------------------
# * Frame Update (main phase step 6 : refresh)
#--------------------------------------------------------------------------
alias update_phase4_step6_ctb update_phase4_step6
def update_phase4_step6
@active_battler.countup = true
if @active_battler.current_action.basic == 1
# Defense
declease_ct(@active_battler,100-PARA_CTB::ACT_GUARD_CT)
else
case @active_battler.current_action.kind
# Attack
when 0
declease_ct(@active_battler,100-PARA_CTB::ACT_ATTACK_CT)
# Skill
when 1
declease_ct(@active_battler,100-PARA_CTB::ACT_SKILL_CT)
# Item
when 2
declease_ct(@active_battler,100-PARA_CTB::ACT_ITEM_CT)
else
clear_ct(@active_battler)
end
end
# Clear the CT if the battler is incapacitated
for target in @target_battlers
if target.movable? == false and target.movable_backup == true
clear_ct(target)
@status_window.refresh_ct
end
end
# Renew the Enemy Name List
@status_window2.refresh
update_phase4_step6_ctb
end
#--------------------------------------------------------------------------
# * Start After Battle Phase
#--------------------------------------------------------------------------
alias ctb_start_phase5 start_phase5
def start_phase5
@countup = false
ctb_start_phase5
end
end
#==============================================================================
# ** Window_BattleStatus
#------------------------------------------------------------------------------
# This window displays the status of all party members on the battle screen.
#==============================================================================
class Window_BattleStatus < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(160, 320, 480, 160)
self.contents = Bitmap.new(width - 32, height - 32)
@level_up_flags = [false, false, false, false]
@before_hp = []
@before_sp = []
@before_states = []
@now_hp = []
@now_sp = []
@now_states = []
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
line_height = 120 / PARA_CTB::PARTY_SIZE
actor_y = i * line_height + 4
# Present status in arrangement
@now_hp[i] = actor.hp
@now_sp[i] = actor.sp
@now_states[i] = actor.states
# If leveling up
if @level_up_flags[i]
self.contents.fill_rect(344, actor_y+14, 100, 8, Color.new(0, 0, 0, 0))
self.contents.font.color = normal_color
self.contents.draw_text(344, actor_y, 120, 32, "LEVEL UP!")
end
end
# Light weight conversion processing of battle status
# When arrangement of status changes only, drawing processing
if @before_hp == nil or @before_sp == nil or @before_states == nil or
@before_hp != @now_hp or @before_sp != @now_sp or @before_states != @now_states
self.contents.clear
for i2 in 0...$game_party.actors.size
actor = $game_party.actors[i2]
line_height = 120 / PARA_CTB::PARTY_SIZE
actor_y = i2 * line_height + 4
self.contents.font.size = PARA_CTB::NAME_FONT_SIZE
# Draw Actor Name
draw_actor_name(actor, 4, actor_y+16-PARA_CTB::NAME_FONT_SIZE)
# Draw HP
hp_color1 = PARA_CTB::HP_COLOR_LEFT
hp_color2 = PARA_CTB::HP_COLOR_RIGHT
draw_meter(actor.hp, actor.maxhp, 125, actor_y+14, 80, 8, hp_color1, hp_color2)
draw_actor_hp(actor, 102, actor_y+16-PARA_CTB::HPSP_FONT_SIZE, 100)
# Draw SP
sp_color1 = PARA_CTB::SP_COLOR_LEFT
sp_color2 = PARA_CTB::SP_COLOR_RIGHT
draw_meter(actor.sp, actor.maxsp, 245, actor_y+14, 80, 8, sp_color1, sp_color2)
draw_actor_sp(actor, 222, actor_y+16-PARA_CTB::HPSP_FONT_SIZE, 100)
# Status after the changing in arrangement
@before_hp[i2] = actor.hp
@before_sp[i2] = actor.sp
@before_states[i2] = actor.states
# If Leveling up
if @level_up_flags[i2]
self.contents.fill_rect(344, actor_y, 100, 8, Color.new(0, 0, 0, 0))
self.contents.font.color = normal_color
self.contents.draw_text(344, actor_y, 120, 32, "LEVEL UP!")
end
end
end
refresh_ct
end
#--------------------------------------------------------------------------
# * Refresh the CT Gauge
#--------------------------------------------------------------------------
def refresh_ct
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
line_height = 120 / PARA_CTB::PARTY_SIZE
actor_y = i * line_height + 4
# When the CT gauge is full, color of gauge
ct_color_full = PARA_CTB::COLOR_FULL
# Color of CT gauge (left hand edge)
ct_color_start = actor.full_ct ? ct_color_full : PARA_CTB::COLOR_LEFT
# Color of CT gauge (right hand edge)
ct_color_end = actor.full_ct ? ct_color_full : PARA_CTB::COLOR_RIGHT
if @level_up_flags[i] != true and actor.ct_visible
draw_meter(actor.now_ct, actor.max_ct, 344, actor_y+14, 100, 8, ct_color_start, ct_color_end)
elsif @level_up_flags[i] != true
draw_meter(0, actor.max_ct, 344, actor_y+14, 100, 8, ct_color_start, ct_color_end)
end
end
end
#--------------------------------------------------------------------------
# * Frame Renewal
#--------------------------------------------------------------------------
def update
super
end
#--------------------------------------------------------------------------
# * Draw HP
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# width : draw spot width
#--------------------------------------------------------------------------
def draw_actor_hp(actor, x, y, width = 144)
# Draw the "HP" text
self.contents.font.color = system_color
self.contents.font.size = 16
self.contents.draw_text(x, y+2, 32, 32, $data_system.words.hp)
self.contents.font.color = normal_color
self.contents.font.size = PARA_CTB::HPSP_FONT_SIZE
if PARA_CTB::MAX_DRAW
# Draw the MaxHP
self.contents.draw_text(x, y, width, 32, actor.maxhp.to_s, 2)
text_size = self.contents.text_size(actor.maxhp.to_s)
text_x = x + width - text_size.width - 12
self.contents.draw_text(text_x, y, 12, 32, "/", 1)
# Draw the HP
self.contents.font.color = actor.hp == 0 ? knockout_color :
actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
text_x = text_x - text_size.width
self.contents.draw_text(text_x, y, text_size.width, 32, actor.hp.to_s, 2)
else
self.contents.font.color = actor.hp == 0 ? knockout_color :
actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
self.contents.draw_text(x, y, width, 32, actor.hp.to_s, 2)
end
end
#--------------------------------------------------------------------------
# * Draw SP
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# width : draw spot width
#--------------------------------------------------------------------------
def draw_actor_sp(actor, x, y, width = 144)
# Draw the "SP" text
self.contents.font.color = system_color
self.contents.font.size = 16
self.contents.draw_text(x, y+2, 32, 32, $data_system.words.sp)
self.contents.font.color = normal_color
self.contents.font.size = PARA_CTB::HPSP_FONT_SIZE
if PARA_CTB::MAX_DRAW
# Draw the MaxSP
self.contents.draw_text(x, y, width, 32, actor.maxsp.to_s, 2)
text_size = self.contents.text_size(actor.maxsp.to_s)
text_x = x + width - text_size.width - 12
self.contents.draw_text(text_x, y, 12, 32, "/", 1)
# Draw the SP
self.contents.font.color = actor.sp == 0 ? knockout_color :
actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
text_x = text_x - text_size.width
self.contents.draw_text(text_x, y, text_size.width, 32, actor.sp.to_s, 2)
else
self.contents.font.color = actor.sp == 0 ? knockout_color :
actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
self.contents.draw_text(x, y, width, 32, actor.sp.to_s, 2)
end
end
end
#==============================================================================
# ** Window_BattleStatus_enemy
#------------------------------------------------------------------------------
# This window displays the status of all enemy troops on the battle screen.
#==============================================================================
class Window_BattleStatus_enemy < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(0, 320, 160, 160)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.color = normal_color
self.contents.font.size = PARA_CTB::ENEMY_FONT_SIZE
@exist_enemies = []
if $game_troop.enemies != nil
if PARA_CTB::ENEMY_GROUPING
ememy_list = []
ememy_list_index = []
# Loop through the Enemy Troop
for i in 0...$game_troop.enemies.size
enemy = $game_troop.enemies[i]
if enemy.exist?
if ememy_list.include?(enemy.name)
ememy_list_index[ememy_list.index(enemy.name)] += 1
else
# Store the enemy name
ememy_list.push(enemy.name)
ememy_list_index[ememy_list.index(enemy.name)] = 1
end
end
end
# Draw the name and number of the enemy
enemy_index = 0
for enemy_name in ememy_list
enemy_y = enemy_index * (PARA_CTB::ENEMY_FONT_SIZE+6) + 4
if ememy_list_index[enemy_index] > 1
enemy_name = enemy_name + " " + ememy_list_index[enemy_index].to_s
end
self.contents.draw_text(4, enemy_y, 160, 20, enemy_name)
enemy_index += 1
end
else
# Draw the enemy name
enemy_index = 0
for i in 0...$game_troop.enemies.size
enemy = $game_troop.enemies[i]
if enemy.exist?
@exist_enemies.push(enemy)
line_height = PARA_CTB::ENEMY_FONT_SIZE + 6
if PARA_CTB::ENEMY_DRAWING_MATER != 0
line_height += 10
end
enemy_y = enemy_index * line_height + 4
self.contents.draw_text(4, enemy_y, 160, 20, enemy.name)
enemy_index += 1
if PARA_CTB::ENEMY_DRAWING_MATER == 1
hp_color1 = PARA_CTB::HP_COLOR_LEFT
hp_color2 = PARA_CTB::HP_COLOR_RIGHT
y = enemy_y + PARA_CTB::ENEMY_FONT_SIZE + 3
draw_meter(enemy.hp, enemy.maxhp, 4, y, 80, 8, hp_color1, hp_color2)
end
end
end
end
end
refresh_ct
end
#--------------------------------------------------------------------------
# * Refresh the CT gauge
#--------------------------------------------------------------------------
def refresh_ct
if PARA_CTB::ENEMY_DRAWING_MATER == 2 and @exist_enemies != nil
enemy_index = 0
for enemy in @exist_enemies
line_height = PARA_CTB::ENEMY_FONT_SIZE + 16
enemy_y = enemy_index * line_height + 4
y = enemy_y + PARA_CTB::ENEMY_FONT_SIZE + 3
# When the CT gauge is full, color of gauge
ct_color_full = PARA_CTB::COLOR_FULL
# Color of CT gauge (the left edge)
ct_color_start = enemy.full_ct ? ct_color_full : PARA_CTB::COLOR_LEFT
# Color of CT gauge (the right edge)
ct_color_end = enemy.full_ct ? ct_color_full : PARA_CTB::COLOR_RIGHT
if enemy.ct_visible
draw_meter(enemy.now_ct, enemy.max_ct, 4, y, 100, 8, ct_color_start, ct_color_end)
else
draw_meter(0, enemy.max_ct, 4, y, 100, 8, ct_color_start, ct_color_end)
end
enemy_index += 1
end
end
end
end
#==============================================================================
# ** Window_Base
#------------------------------------------------------------------------------
# This class is for all in-game windows.
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# * Draw the meter
#--------------------------------------------------------------------------
def draw_meter(now, max, x, y, width, height, start_color, end_color=start_color )
self.contents.fill_rect(x, y, width, height, PARA_CTB::FRAME_COLOR)
self.contents.fill_rect(x+PARA_CTB::FRAME_BORDER, y+PARA_CTB::FRAME_BORDER, width -
PARA_CTB::FRAME_BORDER*2, height-PARA_CTB::FRAME_BORDER*2, PARA_CTB::BACK_COLOR)
now = now > max ? max : now
percentage = max != 0 ? (width-2) * now / max.to_f : 0
if start_color == end_color
self.contents.fill_rect(x+1, y+1, percentage, height-2, start_color)
else
for i in 1..percentage
r = start_color.red + (end_color.red - start_color.red) / percentage * i
g = start_color.green + (end_color.green - start_color.green) / percentage * i
b = start_color.blue + (end_color.blue - start_color.blue) / percentage * i
a = start_color.alpha + (end_color.alpha - start_color.alpha) / percentage * i
self.contents.fill_rect(x+i, y+1, 1, height-2, Color.new(r, g, b, a))
end
end
end
end
#==============================================================================
# ** Game_Battler
#------------------------------------------------------------------------------
# This class deals with battlers. It's used as a superclass for the Game_Actor
# and Game_Enemy classes.
#==============================================================================
class Game_Battler
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :max_ct
attr_accessor :now_ct
attr_accessor :full_ct
attr_accessor :countup
attr_accessor :ct_visible
attr_accessor :movable_backup
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
alias ctb_initialize initialize
def initialize
ctb_initialize
@max_ct = 0
@now_ct = 0
@full_ct = false
@countup = true
@ct_visible = true
end
end
#==============================================================================
# ** Sprite_Battler
#------------------------------------------------------------------------------
# This sprite is used to display the battler.It observes the Game_Character
# class and automatically changes sprite conditions.
#==============================================================================
class Sprite_Battler < RPG::Sprite
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
alias ctb_update update
def update
ctb_update
if @battler != nil
if @battler.full_ct and @battler.ct_visible
# Change the color tone of the battler when the CT Gauge is full
fullct_color = PARA_CTB::FULL_CT_COLOR
self.tone = fullct_color
else
fullct_color = Tone.new(0,0,0)
self.tone = fullct_color
end
end
end
end
#==============================================================================
# ** Window_Help
#------------------------------------------------------------------------------
# This window shows skill and item explanations along with actor status.
#==============================================================================
class Window_Help < Window_Base
#--------------------------------------------------------------------------
# * Set Actor
# actor : status displaying actor
#--------------------------------------------------------------------------
alias set_actor_ctb set_actor
def set_actor(actor)
if PARA_CTB::HELP_DRAWING_MATER_ACTOR
self.contents.clear
draw_actor_name(actor, 4, 0)
draw_actor_state(actor, 140, 0)
hp_color1 = PARA_CTB::HP_COLOR_LEFT
hp_color2 = PARA_CTB::HP_COLOR_RIGHT
draw_meter(actor.hp, actor.maxhp, 316, 18, 112, 8, hp_color1, hp_color2)
draw_actor_hp(actor, 284, 0)
sp_color1 = PARA_CTB::SP_COLOR_LEFT
sp_color2 = PARA_CTB::SP_COLOR_RIGHT
draw_meter(actor.sp, actor.maxsp, 492, 18, 112, 8, sp_color1, sp_color2)
draw_actor_sp(actor, 460, 0)
@actor = actor
@text = nil
self.visible = true
else
set_actor_ctb(actor)
end
end
#--------------------------------------------------------------------------
# * Set Enemy
# enemy : name and status displaying enemy
#--------------------------------------------------------------------------
alias set_enemy_ctb set_enemy
def set_enemy(enemy)
if PARA_CTB::HELP_DRAWING_MATER_ENEMY
self.contents.clear
draw_actor_name(enemy, 4, 0)
draw_actor_state(enemy, 140, 0)
hp_color1 = PARA_CTB::HP_COLOR_LEFT
hp_color2 = PARA_CTB::HP_COLOR_RIGHT
draw_meter(enemy.hp, enemy.maxhp, 316, 18, 112, 8, hp_color1, hp_color2)
draw_actor_hp(enemy, 284, 0)
sp_color1 = PARA_CTB::SP_COLOR_LEFT
sp_color2 = PARA_CTB::SP_COLOR_RIGHT
draw_meter(enemy.sp, enemy.maxsp, 492, 18, 112, 8, sp_color1, sp_color2)
draw_actor_sp(enemy, 460, 0)
self.visible = true
else
set_enemy_ctb(enemy)
end
end
end
Expand to see the code.
And here is the side view system i'm using with it:
#==============================================================================
# ++ サイドビューãƒãƒˆãƒ«ï¼ˆæ©è¡Œã‚°ãƒ©ãƒ•ィック版) ver. 1.14 ++
#  Script by パラ犬
#  http://2d6.parasite.jp/
#------------------------------------------------------------------------------
# ãƒãƒˆãƒ«ãƒ•ã‚£ãƒ¼ãƒ«ãƒ‰ã«æ©è¡Œã‚°ãƒ©ãƒ•ィックを表示ã—ã¾ã™ã€‚
#==============================================================================
module SDVA
X_LINE = 500 # 横ä½ç½®ã®ãƒãƒˆãƒ©ãƒ¼è¡¨ç¤ºåº§æ¨™
Y_LINE = 200 # 縦ä½ç½®ã®ãƒãƒˆãƒ©ãƒ¼è¡¨ç¤ºåº§æ¨™
X_SPACE = 15 # 横ä½ç½®ã®ãƒãƒˆãƒ©ãƒ¼åŒå£«ã®é–“éš”
Y_SPACE = 40 # 縦ä½ç½®ã®ãƒãƒˆãƒ©ãƒ¼åŒå£«ã®é–“éš”
X_POSITION = 25 # 隊列[å‰è¡›ãƒ»ä¸è¡›ãƒ»å¾Œè¡›ï¼½ã®æ¨ªé–“éš”
Y_POSITION = 0 # 隊列[å‰è¡›ãƒ»ä¸è¡›ãƒ»å¾Œè¡›ï¼½ã®ç¸¦é–“éš”
ATTACK_MOVE = true # 攻撃時ã«å‰ã¸è¸ã¿å‡ºã™ã‹ï¼ˆ true / false )
SKILL_MOVE = true # スã‚ル使用時ã«å‰ã¸è¸ã¿å‡ºã™ã‹ï¼ˆ true / false )
ITEM_MOVE = false # アイテム使用時ã«å‰ã¸è¸ã¿å‡ºã™ã‹ï¼ˆ true / false )
MOVE_STEP = 1 # ç§»å‹•æ©æ•°
MOVE_PIXEL = 10 # 一æ©ã‚ãŸã‚Šã®ãƒ”クセル数
PARTY_POS = 1 # ã‚ャラクターã®å‘ã( 0:下 / 1:å·¦ / 2:å³ / 3:上 )
WINDOWPOS_CHANGE = true # コマンドウインドウをãƒãƒˆãƒ©ãƒ¼ã®æ¨ªã«è¡¨ç¤ºã™ã‚‹ã‹ï¼ˆ true / false )
end
#==============================================================================
# – Game_Actor
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# — ãƒãƒˆãƒ«ç”»é¢ X 座標ã®å–å¾—
#--------------------------------------------------------------------------
def screen_x
if self.index != nil
# 隊列をå–å¾—
pos = $data_classes[self.class_id].position
x_pos = pos * SDVA::X_POSITION
scr_x = self.index * SDVA::X_SPACE + SDVA::X_LINE + x_pos
# 移動アクションã®ã¨ã
if self.current_action.move_action == true
# 横ã«ç§»å‹•
scr_x += @shift_x
end
return scr_x
else
return 0
end
end
#--------------------------------------------------------------------------
# — ãƒãƒˆãƒ«ç”»é¢ Y 座標ã®å–å¾—
#--------------------------------------------------------------------------
def screen_y
if self.index != nil
# 隊列をå–å¾—
pos = $data_classes[self.class_id].position
y_pos = pos * SDVA::Y_POSITION
scr_y = self.index * SDVA::Y_SPACE + SDVA::Y_LINE + y_pos
# 移動アクションã®ã¨ã
if self.current_action.move_action == true
# 縦ã«ç§»å‹•
scr_y += @shift_y
end
return scr_y
else
return 0
end
end
#--------------------------------------------------------------------------
# — ãƒãƒˆãƒ«ç”»é¢ Z 座標ã®å–å¾—
#--------------------------------------------------------------------------
def screen_z
if self.index != nil
return self.index
else
return 0
end
end
end
#==============================================================================
# – Game_Battler (分割定義 1)
#==============================================================================
class Game_Battler
#--------------------------------------------------------------------------
# — 公開インスタンス変数
#--------------------------------------------------------------------------
attr_reader :pattern # æ©è¡Œãƒ‘ターン
attr_reader :trans_x # Xæ–¹å‘ã®ç§»å‹•è·é›¢
attr_reader :moving # 移動ä¸ãƒ•ラグ
#--------------------------------------------------------------------------
# — ã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆåˆæœŸåŒ–
#--------------------------------------------------------------------------
alias initialize_sdva initialize
def initialize
initialize_sdva
move_reset
end
#--------------------------------------------------------------------------
# —‹ 移動カウント
#--------------------------------------------------------------------------
def move
@moving = 1
if @step < SDVA::MOVE_STEP
# æ©æ•°ã‚’満ãŸã™ã¾ã§ç§»å‹•
@pattern = (@pattern + 1) % 4
@step += 1
move_step
else
# 移動終了
@pattern = 1
@moving = 2
end
end
#--------------------------------------------------------------------------
# —‹ 移動処ç†
#--------------------------------------------------------------------------
def move_step
# パーティã®å‘ãã«ã‚ˆã£ã¦ç§»å‹•座標を変ãˆã‚‹
case SDVA::PARTY_POS
when 0
@shift_y = @step * SDVA::MOVE_PIXEL
when 1
@shift_x = -(@step * SDVA::MOVE_PIXEL)
when 2
@shift_x = @step * SDVA::MOVE_PIXEL
when 3
@shift_y = -(@step * SDVA::MOVE_PIXEL)
end
end
#--------------------------------------------------------------------------
# —‹ 移動ã®ãƒªã‚»ãƒƒãƒˆ
#--------------------------------------------------------------------------
def move_reset
@moving = 0
@pattern = 0
@step = 0
@shift_x = 0
@shift_y = 0
end
end
#==============================================================================
# – Game_BattleAction
#==============================================================================
class Game_BattleAction
#--------------------------------------------------------------------------
# — 公開インスタンス変数
#--------------------------------------------------------------------------
attr_accessor :move_action # 移動ã™ã‚‹ã‚¢ã‚¯ã‚·ãƒ§ãƒ³ã‹
#--------------------------------------------------------------------------
# — クリア
#--------------------------------------------------------------------------
alias clear_sdva clear
def clear
clear_sdva
@move_action = false
end
end
#==============================================================================
# – Sprite_Battler
#==============================================================================
class Sprite_Battler < RPG::Sprite
#--------------------------------------------------------------------------
# — フレーム更新
#--------------------------------------------------------------------------
alias update_sdva update
def update
# ãƒãƒˆãƒ©ãƒ¼ãŒã‚¢ã‚¯ã‚¿ãƒ¼ã«å«ã¾ã‚Œã‚‹ã¨ã
if @battler.is_a?(Game_Actor)
# ファイルåã‹è‰²ç›¸ãŒç¾åœ¨ã®ã‚‚ã®ã¨ç•°ãªã‚‹å ´åˆ
# 行動ä¸ã®å ´åˆ
if @battler.battler_name != @battler_name or
@battler.battler_hue != @battler_hue or
@battler.current_action.basic == 0 or
@battler.current_action.kind != 3
# ビットマップをå–å¾—ã€è¨å®š
@character_name = @battler.character_name
@character_hue = @battler.character_hue
# æ©è¡Œã‚°ãƒ©ãƒ•ィックをæç”»
self.bitmap = RPG::Cache.character(@character_name, @character_hue)
cw = self.bitmap.width / 4
ch = self.bitmap.height / 4
@width = cw
@height = ch
if @battler.current_action.move_action == true
# æ©ã‹ã›ã‚‹
@battler.move
else
@battler.move_reset
end
# 転é€å…ƒã®çŸ©å½¢ã‚’è¨å®š
sx = @battler.pattern * cw
sy = SDVA::PARTY_POS * ch
self.src_rect.set(sx, sy, cw, ch)
self.ox = @width / 2
self.oy = @height
# éš ã‚ŒçŠ¶æ…‹ãªã‚‰ä¸é€æ˜Žåº¦ã‚’ 0 ã«ã™ã‚‹
if @battler.hidden
self.opacity = 0
end
end
end
update_sdva
end
end
#==============================================================================
# – Scene_Battle
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# — アクターコマンドウィンドウã®ã‚»ãƒƒãƒˆã‚¢ãƒƒãƒ—
#--------------------------------------------------------------------------
alias phase3_setup_command_window_sdva phase3_setup_command_window
def phase3_setup_command_window
phase3_setup_command_window_sdva
if SDVA::WINDOWPOS_CHANGE
# アクターコマンドウィンドウã®ä½ç½®ã‚’è¨å®š
case SDVA::PARTY_POS
when 0
x_pos = @active_battler.screen_x - (@actor_command_window.width/2)
y_pos = @active_battler.screen_y
when 1
x_pos = @active_battler.screen_x - @actor_command_window.width - 16
y_pos = @active_battler.screen_y - @actor_command_window.height
when 2
x_pos = @active_battler.screen_x + 16
y_pos = @active_battler.screen_y - @actor_command_window.height
when 3
x_pos = @active_battler.screen_x - (@actor_command_window.width/2)
y_pos = @active_battler.screen_y - @actor_command_window.height - 48
end
@actor_command_window.x = x_pos >= 0 ? x_pos : 0
@actor_command_window.x = x_pos+@actor_command_window.width <= 640 ? x_pos : 640-@actor_command_window.width
@actor_command_window.y = y_pos >= 0 ? y_pos : 0
@actor_command_window.y = y_pos+@actor_command_window.height <= 480 ? y_pos : 480-@actor_command_window.height
# ステータスウインドウã«éš れãªã„よã†ã«
@actor_command_window.z = 9999
end
end
#--------------------------------------------------------------------------
# — フレーム更新 (メインフェーズ ステップ 3 : 行動å´ã‚¢ãƒ‹ãƒ¡ãƒ¼ã‚·ãƒ§ãƒ³)
#--------------------------------------------------------------------------
alias update_phase4_step3_sdva update_phase4_step3
def update_phase4_step3
if SDVA::ATTACK_MOVE
if @active_battler.current_action.basic == 0
@active_battler.current_action.move_action = true
end
end
if SDVA::SKILL_MOVE
if @active_battler.current_action.kind == 1
@active_battler.current_action.move_action = true
end
end
if SDVA::ITEM_MOVE
if @active_battler.current_action.kind == 2
@active_battler.current_action.move_action = true
end
end
# ãƒãƒˆãƒ©ãƒ¼ãŒã‚¢ã‚¯ã‚¿ãƒ¼ã«å«ã¾ã‚Œã€ç§»å‹•アクションä¸
if @active_battler.is_a?(Game_Actor) and
@active_battler.current_action.move_action
# 移動終了時
if @active_battler.moving == 2
update_phase4_step3_sdva
end
elsif @active_battler.moving == 0
update_phase4_step3_sdva
end
end
#--------------------------------------------------------------------------
# — フレーム更新 (メインフェーズ ステップ 6 : リフレッシュ)
#--------------------------------------------------------------------------
alias update_phase4_step6_sdva update_phase4_step6
def update_phase4_step6
@active_battler.current_action.move_action = false
@active_battler.move_reset
update_phase4_step6_sdva
end
end
#==============================================================================
# – Spriteset_Battle
#==============================================================================
class Spriteset_Battle
#--------------------------------------------------------------------------
# — ã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆåˆæœŸåŒ–
#--------------------------------------------------------------------------
alias initialize_sdva initialize
def initialize
initialize_sdva
@viewport2.z = 1
end
end
#==============================================================================
# – Arrow_Actor
#==============================================================================
class Arrow_Actor < Arrow_Base
#--------------------------------------------------------------------------
# — フレーム更新
#--------------------------------------------------------------------------
alias update_sdva update
def update
update_sdva
# カーソル下
if Input.repeat?(Input::DOWN)
$game_system.se_play($data_system.cursor_se)
@index += 1
@index %= $game_party.actors.size
end
# カーソル上
if Input.repeat?(Input::UP)
$game_system.se_play($data_system.cursor_se)
@index += $game_party.actors.size - 1
@index %= $game_party.actors.size
end
end
end
#==============================================================================
# – Arrow_Enemy
#==============================================================================
class Arrow_Enemy < Arrow_Base
#--------------------------------------------------------------------------
# — フレーム更新
#--------------------------------------------------------------------------
alias update_sdva update
def update
update_sdva
# カーソル下
if Input.repeat?(Input::DOWN)
$game_system.se_play($data_system.cursor_se)
$game_troop.enemies.size.times do
@index += 1
@index %= $game_troop.enemies.size
break if self.enemy.exist?
end
end
# カーソル上
if Input.repeat?(Input::UP)
$game_system.se_play($data_system.cursor_se)
$game_troop.enemies.size.times do
@index += $game_troop.enemies.size - 1
@index %= $game_troop.enemies.size
break if self.enemy.exist?
end
end
end
end
# ++ サイドビューãƒãƒˆãƒ«ï¼ˆæ©è¡Œã‚°ãƒ©ãƒ•ィック版) ver. 1.14 ++
#  Script by パラ犬
#  http://2d6.parasite.jp/
#------------------------------------------------------------------------------
# ãƒãƒˆãƒ«ãƒ•ã‚£ãƒ¼ãƒ«ãƒ‰ã«æ©è¡Œã‚°ãƒ©ãƒ•ィックを表示ã—ã¾ã™ã€‚
#==============================================================================
module SDVA
X_LINE = 500 # 横ä½ç½®ã®ãƒãƒˆãƒ©ãƒ¼è¡¨ç¤ºåº§æ¨™
Y_LINE = 200 # 縦ä½ç½®ã®ãƒãƒˆãƒ©ãƒ¼è¡¨ç¤ºåº§æ¨™
X_SPACE = 15 # 横ä½ç½®ã®ãƒãƒˆãƒ©ãƒ¼åŒå£«ã®é–“éš”
Y_SPACE = 40 # 縦ä½ç½®ã®ãƒãƒˆãƒ©ãƒ¼åŒå£«ã®é–“éš”
X_POSITION = 25 # 隊列[å‰è¡›ãƒ»ä¸è¡›ãƒ»å¾Œè¡›ï¼½ã®æ¨ªé–“éš”
Y_POSITION = 0 # 隊列[å‰è¡›ãƒ»ä¸è¡›ãƒ»å¾Œè¡›ï¼½ã®ç¸¦é–“éš”
ATTACK_MOVE = true # 攻撃時ã«å‰ã¸è¸ã¿å‡ºã™ã‹ï¼ˆ true / false )
SKILL_MOVE = true # スã‚ル使用時ã«å‰ã¸è¸ã¿å‡ºã™ã‹ï¼ˆ true / false )
ITEM_MOVE = false # アイテム使用時ã«å‰ã¸è¸ã¿å‡ºã™ã‹ï¼ˆ true / false )
MOVE_STEP = 1 # ç§»å‹•æ©æ•°
MOVE_PIXEL = 10 # 一æ©ã‚ãŸã‚Šã®ãƒ”クセル数
PARTY_POS = 1 # ã‚ャラクターã®å‘ã( 0:下 / 1:å·¦ / 2:å³ / 3:上 )
WINDOWPOS_CHANGE = true # コマンドウインドウをãƒãƒˆãƒ©ãƒ¼ã®æ¨ªã«è¡¨ç¤ºã™ã‚‹ã‹ï¼ˆ true / false )
end
#==============================================================================
# – Game_Actor
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# — ãƒãƒˆãƒ«ç”»é¢ X 座標ã®å–å¾—
#--------------------------------------------------------------------------
def screen_x
if self.index != nil
# 隊列をå–å¾—
pos = $data_classes[self.class_id].position
x_pos = pos * SDVA::X_POSITION
scr_x = self.index * SDVA::X_SPACE + SDVA::X_LINE + x_pos
# 移動アクションã®ã¨ã
if self.current_action.move_action == true
# 横ã«ç§»å‹•
scr_x += @shift_x
end
return scr_x
else
return 0
end
end
#--------------------------------------------------------------------------
# — ãƒãƒˆãƒ«ç”»é¢ Y 座標ã®å–å¾—
#--------------------------------------------------------------------------
def screen_y
if self.index != nil
# 隊列をå–å¾—
pos = $data_classes[self.class_id].position
y_pos = pos * SDVA::Y_POSITION
scr_y = self.index * SDVA::Y_SPACE + SDVA::Y_LINE + y_pos
# 移動アクションã®ã¨ã
if self.current_action.move_action == true
# 縦ã«ç§»å‹•
scr_y += @shift_y
end
return scr_y
else
return 0
end
end
#--------------------------------------------------------------------------
# — ãƒãƒˆãƒ«ç”»é¢ Z 座標ã®å–å¾—
#--------------------------------------------------------------------------
def screen_z
if self.index != nil
return self.index
else
return 0
end
end
end
#==============================================================================
# – Game_Battler (分割定義 1)
#==============================================================================
class Game_Battler
#--------------------------------------------------------------------------
# — 公開インスタンス変数
#--------------------------------------------------------------------------
attr_reader :pattern # æ©è¡Œãƒ‘ターン
attr_reader :trans_x # Xæ–¹å‘ã®ç§»å‹•è·é›¢
attr_reader :moving # 移動ä¸ãƒ•ラグ
#--------------------------------------------------------------------------
# — ã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆåˆæœŸåŒ–
#--------------------------------------------------------------------------
alias initialize_sdva initialize
def initialize
initialize_sdva
move_reset
end
#--------------------------------------------------------------------------
# —‹ 移動カウント
#--------------------------------------------------------------------------
def move
@moving = 1
if @step < SDVA::MOVE_STEP
# æ©æ•°ã‚’満ãŸã™ã¾ã§ç§»å‹•
@pattern = (@pattern + 1) % 4
@step += 1
move_step
else
# 移動終了
@pattern = 1
@moving = 2
end
end
#--------------------------------------------------------------------------
# —‹ 移動処ç†
#--------------------------------------------------------------------------
def move_step
# パーティã®å‘ãã«ã‚ˆã£ã¦ç§»å‹•座標を変ãˆã‚‹
case SDVA::PARTY_POS
when 0
@shift_y = @step * SDVA::MOVE_PIXEL
when 1
@shift_x = -(@step * SDVA::MOVE_PIXEL)
when 2
@shift_x = @step * SDVA::MOVE_PIXEL
when 3
@shift_y = -(@step * SDVA::MOVE_PIXEL)
end
end
#--------------------------------------------------------------------------
# —‹ 移動ã®ãƒªã‚»ãƒƒãƒˆ
#--------------------------------------------------------------------------
def move_reset
@moving = 0
@pattern = 0
@step = 0
@shift_x = 0
@shift_y = 0
end
end
#==============================================================================
# – Game_BattleAction
#==============================================================================
class Game_BattleAction
#--------------------------------------------------------------------------
# — 公開インスタンス変数
#--------------------------------------------------------------------------
attr_accessor :move_action # 移動ã™ã‚‹ã‚¢ã‚¯ã‚·ãƒ§ãƒ³ã‹
#--------------------------------------------------------------------------
# — クリア
#--------------------------------------------------------------------------
alias clear_sdva clear
def clear
clear_sdva
@move_action = false
end
end
#==============================================================================
# – Sprite_Battler
#==============================================================================
class Sprite_Battler < RPG::Sprite
#--------------------------------------------------------------------------
# — フレーム更新
#--------------------------------------------------------------------------
alias update_sdva update
def update
# ãƒãƒˆãƒ©ãƒ¼ãŒã‚¢ã‚¯ã‚¿ãƒ¼ã«å«ã¾ã‚Œã‚‹ã¨ã
if @battler.is_a?(Game_Actor)
# ファイルåã‹è‰²ç›¸ãŒç¾åœ¨ã®ã‚‚ã®ã¨ç•°ãªã‚‹å ´åˆ
# 行動ä¸ã®å ´åˆ
if @battler.battler_name != @battler_name or
@battler.battler_hue != @battler_hue or
@battler.current_action.basic == 0 or
@battler.current_action.kind != 3
# ビットマップをå–å¾—ã€è¨å®š
@character_name = @battler.character_name
@character_hue = @battler.character_hue
# æ©è¡Œã‚°ãƒ©ãƒ•ィックをæç”»
self.bitmap = RPG::Cache.character(@character_name, @character_hue)
cw = self.bitmap.width / 4
ch = self.bitmap.height / 4
@width = cw
@height = ch
if @battler.current_action.move_action == true
# æ©ã‹ã›ã‚‹
@battler.move
else
@battler.move_reset
end
# 転é€å…ƒã®çŸ©å½¢ã‚’è¨å®š
sx = @battler.pattern * cw
sy = SDVA::PARTY_POS * ch
self.src_rect.set(sx, sy, cw, ch)
self.ox = @width / 2
self.oy = @height
# éš ã‚ŒçŠ¶æ…‹ãªã‚‰ä¸é€æ˜Žåº¦ã‚’ 0 ã«ã™ã‚‹
if @battler.hidden
self.opacity = 0
end
end
end
update_sdva
end
end
#==============================================================================
# – Scene_Battle
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# — アクターコマンドウィンドウã®ã‚»ãƒƒãƒˆã‚¢ãƒƒãƒ—
#--------------------------------------------------------------------------
alias phase3_setup_command_window_sdva phase3_setup_command_window
def phase3_setup_command_window
phase3_setup_command_window_sdva
if SDVA::WINDOWPOS_CHANGE
# アクターコマンドウィンドウã®ä½ç½®ã‚’è¨å®š
case SDVA::PARTY_POS
when 0
x_pos = @active_battler.screen_x - (@actor_command_window.width/2)
y_pos = @active_battler.screen_y
when 1
x_pos = @active_battler.screen_x - @actor_command_window.width - 16
y_pos = @active_battler.screen_y - @actor_command_window.height
when 2
x_pos = @active_battler.screen_x + 16
y_pos = @active_battler.screen_y - @actor_command_window.height
when 3
x_pos = @active_battler.screen_x - (@actor_command_window.width/2)
y_pos = @active_battler.screen_y - @actor_command_window.height - 48
end
@actor_command_window.x = x_pos >= 0 ? x_pos : 0
@actor_command_window.x = x_pos+@actor_command_window.width <= 640 ? x_pos : 640-@actor_command_window.width
@actor_command_window.y = y_pos >= 0 ? y_pos : 0
@actor_command_window.y = y_pos+@actor_command_window.height <= 480 ? y_pos : 480-@actor_command_window.height
# ステータスウインドウã«éš れãªã„よã†ã«
@actor_command_window.z = 9999
end
end
#--------------------------------------------------------------------------
# — フレーム更新 (メインフェーズ ステップ 3 : 行動å´ã‚¢ãƒ‹ãƒ¡ãƒ¼ã‚·ãƒ§ãƒ³)
#--------------------------------------------------------------------------
alias update_phase4_step3_sdva update_phase4_step3
def update_phase4_step3
if SDVA::ATTACK_MOVE
if @active_battler.current_action.basic == 0
@active_battler.current_action.move_action = true
end
end
if SDVA::SKILL_MOVE
if @active_battler.current_action.kind == 1
@active_battler.current_action.move_action = true
end
end
if SDVA::ITEM_MOVE
if @active_battler.current_action.kind == 2
@active_battler.current_action.move_action = true
end
end
# ãƒãƒˆãƒ©ãƒ¼ãŒã‚¢ã‚¯ã‚¿ãƒ¼ã«å«ã¾ã‚Œã€ç§»å‹•アクションä¸
if @active_battler.is_a?(Game_Actor) and
@active_battler.current_action.move_action
# 移動終了時
if @active_battler.moving == 2
update_phase4_step3_sdva
end
elsif @active_battler.moving == 0
update_phase4_step3_sdva
end
end
#--------------------------------------------------------------------------
# — フレーム更新 (メインフェーズ ステップ 6 : リフレッシュ)
#--------------------------------------------------------------------------
alias update_phase4_step6_sdva update_phase4_step6
def update_phase4_step6
@active_battler.current_action.move_action = false
@active_battler.move_reset
update_phase4_step6_sdva
end
end
#==============================================================================
# – Spriteset_Battle
#==============================================================================
class Spriteset_Battle
#--------------------------------------------------------------------------
# — ã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆåˆæœŸåŒ–
#--------------------------------------------------------------------------
alias initialize_sdva initialize
def initialize
initialize_sdva
@viewport2.z = 1
end
end
#==============================================================================
# – Arrow_Actor
#==============================================================================
class Arrow_Actor < Arrow_Base
#--------------------------------------------------------------------------
# — フレーム更新
#--------------------------------------------------------------------------
alias update_sdva update
def update
update_sdva
# カーソル下
if Input.repeat?(Input::DOWN)
$game_system.se_play($data_system.cursor_se)
@index += 1
@index %= $game_party.actors.size
end
# カーソル上
if Input.repeat?(Input::UP)
$game_system.se_play($data_system.cursor_se)
@index += $game_party.actors.size - 1
@index %= $game_party.actors.size
end
end
end
#==============================================================================
# – Arrow_Enemy
#==============================================================================
class Arrow_Enemy < Arrow_Base
#--------------------------------------------------------------------------
# — フレーム更新
#--------------------------------------------------------------------------
alias update_sdva update
def update
update_sdva
# カーソル下
if Input.repeat?(Input::DOWN)
$game_system.se_play($data_system.cursor_se)
$game_troop.enemies.size.times do
@index += 1
@index %= $game_troop.enemies.size
break if self.enemy.exist?
end
end
# カーソル上
if Input.repeat?(Input::UP)
$game_system.se_play($data_system.cursor_se)
$game_troop.enemies.size.times do
@index += $game_troop.enemies.size - 1
@index %= $game_troop.enemies.size
break if self.enemy.exist?
end
end
end
end
Expand to see the code.
Thanks!
~Please get the legal version of RMXP from download.com~
[QUOTE=Anko4t6;203329]So there's no way to get the text to appear without the legal version in the main menu?[/QUOTE]
There are ways to make the text appear mainly:
http://www.enterbrain.co.jp/tkool/RPG_XP/eng/download.html
There are ways to make the text appear mainly:
http://www.enterbrain.co.jp/tkool/RPG_XP/eng/download.html
There's a slight problem with your script I'm not sure
anyone noticed, and it is hard to notice. I'm testing a battle. There are five
people in my party, four of which are in battle (obviously). While I was casting
a healing spell, I noticed that I could go all the way to the right and use
it on the 5th party member that wasn't in battle. More than this, when my
four top members died, the battle continued because of that 5th party member, so basicly I couldn't atack because my party was dead, and the enemys couldn't atack, but the battle still went on because of that 5th
character. Is there some way to make it so that if your top four characters
die, it's game over?
anyone noticed, and it is hard to notice. I'm testing a battle. There are five
people in my party, four of which are in battle (obviously). While I was casting
a healing spell, I noticed that I could go all the way to the right and use
it on the 5th party member that wasn't in battle. More than this, when my
four top members died, the battle continued because of that 5th party member, so basicly I couldn't atack because my party was dead, and the enemys couldn't atack, but the battle still went on because of that 5th
character. Is there some way to make it so that if your top four characters
die, it's game over?
Original thread: https://www.hbgames.org/forums/viewtopic.php?t=9722