RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
need help merging 2 battle scripts

0 Members and 1 Guest are viewing this topic.

**
Rep:
Level 87
I have two battle systems but I want the first one's graphics and the second ones ffX system

here is the first
Spoiler for:
Code: [Select]
#==============================================================================

class Sprite_Battler < RPG::Sprite
#--------------------------------------------------------------------------
# * Initialize
#--------------------------------------------------------------------------
alias cbs_initialize initialize
def initialize(viewport, battler = nil)

# Configuration
@speed = 7 # Framerate speed of the battlers
@frames = 4 # Number of frames in each pose
@poses = 11 # Number of poses (stances) in the template
@mirror_enemies = true # Enemy battlers use reversed image
@stationary_enemies = false # If the enemies don't move while attacking
@stationary_actors = false # If the actors don't move while attacking
@calculate_speed = true # System calculates a mean/average speed
@phasing = true # Characters fade in/out while attacking
@default_collapse = false # Restores the old 'red fade' effect to enemies
# Array that holds the id # of weapons that forces the hero to be stationary
@stationary_weapons = [17,18,19,20,21,22,23,24] # (examples are bows & guns)

# DO NOT EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOU'RE DOING
@frame, @pose = 0, 0
@last_time = 0
@last_move_time = 0
cbs_initialize(viewport, battler)
self.mirror = !!battler and @mirror_enemies
viewport.z = 99
end
#--------------------------------------------------------------------------
# * Update
#--------------------------------------------------------------------------
alias cbs_update update
def update
return unless @battler

# Regular Update
cbs_update

# Start Routine
unless @started
@pose = state
@width = @width / @frames
@height = @height / @poses
@display_x = @battler.screen_x
@display_y = @battler.screen_y
@destination_x = @display_x
@destination_y = @display_y
@started = true
end

# Cut Out Frame
self.src_rect.set(@width * @frame, @height * @pose, @width, @height)

# Position Sprite
self.x = @display_x
self.y = @display_y
self.z = @display_y
self.ox = @width / 2
self.oy = @height

# Setup Animation
time = Graphics.frame_count / (Graphics.frame_rate / @speed)
if @last_time < time
@frame = (@frame + 1) % @frames
if @frame == 0
if @freeze
@frame = @frames - 1
return
end
@pose = state
end
end
@last_time = time

# Move It
move if moving
end
#--------------------------------------------------------------------------
# * Current State
#--------------------------------------------------------------------------
def state
# Damage State
if [nil,{}].include?(@battler.damage)
# Battler Fine
@state = 0
# Battler Wounded
@state = 2 if @battler.hp < @battler.maxhp / 4

if @default_collapse
# Battler Dead (Red-Out Collapse)
if @battler.dead? and @battler.is_a?(Game_Actor)
@state = 10
# Fix Opacity
self.opacity = 255
end
else
# Battler Dead (Pose-Type Collapse)
if @battler.dead?
@state = 10
# Fix Opacity
self.opacity = 255
end
end
end
# Guarding State
@state = 3 if @battler.guarding?
# Moving State
if moving
# If enemy battler moving
if @battler.is_a?(Game_Enemy)
# Battler Moving Left
@state = 5 if moving.eql?(0)
# Battler Moving Right
@state = 4 if moving.eql?(1)
# Else actor battler moving
else
# Battler Moving Left
@state = 4 if moving.eql?(0)
# Battler Moving Right
@state = 5 if moving.eql?(1)
end
end
# Return State
return @state
end
#--------------------------------------------------------------------------
# * Move
#--------------------------------------------------------------------------
def move
time = Graphics.frame_count / (Graphics.frame_rate.to_f / (@speed * 5))
if @last_move_time < time

# Pause for Animation
return if @pose != state

# Phasing
if @phasing
d1 = (@display_x - @original_x).abs
d2 = (@display_y - @original_y).abs
d3 = (@display_x - @destination_x).abs
d4 = (@display_y - @destination_y).abs
self.opacity = [255 - ([d1 + d2, d3 + d4].min * 1.75).to_i, 0].max
end

# Calculate Difference
difference_x = (@display_x - @destination_x).abs
difference_y = (@display_y - @destination_y).abs

# Done? Reset, Stop
if [difference_x, difference_y].max.between?(0, 8)
@display_x = @destination_x
@display_y = @destination_y
@pose = state
return
end

# Calculate Movement Increments
increment_x = increment_y = 1
if difference_x < difference_y
increment_x = 1.0 / (difference_y.to_f / difference_x)
elsif difference_y < difference_x
increment_y = 1.0 / (difference_x.to_f / difference_y)
end

# Calculate Movement Speed
if @calculate_speed
total = 0; $game_party.actors.each{ |actor| total += actor.agi }
speed = @battler.agi.to_f / (total / $game_party.actors.size)
increment_x *= speed
increment_y *= speed
end

# Multiply and Move
multiplier_x = (@destination_x - @display_x > 0 ? 8 : -8)
multiplier_y = (@destination_y - @display_y > 0 ? 8 : -8)
@display_x += (increment_x * multiplier_x).to_i
@display_y += (increment_y * multiplier_y).to_i
end
@last_move_time = time
end
#--------------------------------------------------------------------------
# * Set Movement
#--------------------------------------------------------------------------
def setmove(destination_x, destination_y)
unless (@battler.is_a?(Game_Enemy) and @stationary_enemies) or
(@battler.is_a?(Game_Actor) and @stationary_actors)
unless @stationary_weapons.include?(@battler.weapon_id)
@original_x = @display_x
@original_y = @display_y
@destination_x = destination_x
@destination_y = destination_y
end
end
end
#--------------------------------------------------------------------------
# * Movement Check
#--------------------------------------------------------------------------
def moving
if (@display_x != @destination_x and @display_y != @destination_y and !@battler.dead?)
return (@display_x > @destination_x ? 0 : 1)
end
end
#--------------------------------------------------------------------------
# * Set Pose
#--------------------------------------------------------------------------
def pose=(pose)
@pose = pose
@frame = 0
end
#--------------------------------------------------------------------------
# * Freeze
#--------------------------------------------------------------------------
def freeze
@freeze = true
end
#--------------------------------------------------------------------------
# * Fallen Pose
#--------------------------------------------------------------------------
alias cbs_collapse collapse
def collapse
if @default_collapse
cbs_collapse if @battler.is_a?(Game_Enemy)
end
end
end

#==============================================================================
# ** Game_Actor
#==============================================================================

class Game_Actor
#--------------------------------------------------------------------------
# * Actor X Coordinate
#--------------------------------------------------------------------------
def screen_x
if self.index != nil
return self.index * 45 + 450
else
return 0
end
end
#--------------------------------------------------------------------------
# * Actor Y Coordinate
#--------------------------------------------------------------------------
def screen_y
return self.index * 35 + 200
end
#--------------------------------------------------------------------------
# * Actor Z Coordinate
#--------------------------------------------------------------------------
def screen_z
return screen_y
end
end

#==============================================================================
# ** Scene_Battle
#==============================================================================

class Scene_Battle
#--------------------------------------------------------------------------
# * Action Animation, Movement
#--------------------------------------------------------------------------
alias cbs_update_phase4_step3 update_phase4_step3
def update_phase4_step3(battler = @active_battler)
@rtab = !@target_battlers
target = (@rtab ? battler.target : @target_battlers)[0]
@moved = {} unless @moved
return if @spriteset.battler(battler).moving
case battler.current_action.kind
when 0 # Attack
if not (@moved[battler] or battler.guarding?)
offset = (battler.is_a?(Game_Actor) ? 40 : -40)
@spriteset.battler(battler).setmove(target.screen_x + offset, target.screen_y)
@moved[battler] = true
return
elsif not battler.guarding?
@spriteset.battler(battler).pose = 6 + rand(2)
@spriteset.battler(battler).setmove(battler.screen_x, battler.screen_y)
end
when 1 # Skill
@spriteset.battler(battler).pose = 8
when 2 # Item
@spriteset.battler(battler).pose = 8
end
@moved[battler] = false
@rtab ? cbs_update_phase4_step3(battler) : cbs_update_phase4_step3
end
#--------------------------------------------------------------------------
# * Hit Animation
#--------------------------------------------------------------------------
alias cbs_update_phase4_step4 update_phase4_step4
def update_phase4_step4(battler = @active_battler)
for target in (@rtab ? battler.target : @target_battlers)
damage = (@rtab ? target.damage[battler] : target.damage)
if damage.is_a?(Numeric) and damage > 0
@spriteset.battler(target).pose = 1
end
end
@rtab ? cbs_update_phase4_step4(battler) : cbs_update_phase4_step4
end
#--------------------------------------------------------------------------
# * Victory Animation
#--------------------------------------------------------------------------
alias cbs_start_phase5 start_phase5
def start_phase5
for actor in $game_party.actors
return if @spriteset.battler(actor).moving
end
for actor in $game_party.actors
unless actor.dead?
@spriteset.battler(actor).pose = 9
@spriteset.battler(actor).freeze
end
end
cbs_start_phase5
end
#--------------------------------------------------------------------------
# * Change Arrow Viewport
#--------------------------------------------------------------------------
alias cbs_start_enemy_select start_enemy_select
def start_enemy_select
cbs_start_enemy_select
@enemy_arrow.dispose
@enemy_arrow = Arrow_Enemy.new(@spriteset.viewport2)
@enemy_arrow.help_window = @help_window
end
end

#==============================================================================
# ** Spriteset_Battle
#==============================================================================

class Spriteset_Battle
#--------------------------------------------------------------------------
# * Change Enemy Viewport
#--------------------------------------------------------------------------
alias cbs_initialize initialize
def initialize
cbs_initialize
@enemy_sprites = []
for enemy in $game_troop.enemies.reverse
@enemy_sprites.push(Sprite_Battler.new(@viewport2, enemy))
end
end
#--------------------------------------------------------------------------
# * Find Sprite From Battler Handle
#--------------------------------------------------------------------------
def battler(handle)
for sprite in @actor_sprites + @enemy_sprites
return sprite if sprite.battler == handle
end
end
end

#==============================================================================
# ** Arrow_Base
#==============================================================================

class Arrow_Base < Sprite
#--------------------------------------------------------------------------
# * Reposition Arrows
#--------------------------------------------------------------------------
alias cbs_initialize initialize
def initialize(viewport)
cbs_initialize(viewport)
self.ox = 14
self.oy = 10
end
end

here is the second
Spoiler for:
Code: [Select]
#########################################################################
# FF10??????????????????????
#
# ?????ATB(??????????????????)????
# ?????????????????????
# ATB????????????????????????
# ????????????(???????0???????)??????
# ???????????CTB????(??CTB)???
# ??????????????????
# ?????????????????????????
# ?????????ATB????????????????
#
# ????????????????????
# ?????????????????????
# ????????????????????????????
# ???????????????????????????????????
# ???????????????????????????????????
#
# ???
# ?????????
# ???????????????????????
# ?????????????????????
#
# ??????????????
# ??????????????????????????????
# ??????????????????????
#
# ?????
# ??????????????
# ???????????????????X????????????
# ??????????????????
# ???????????????
# ???????50??????????????
# ????????????????
# ???L?R???????????????????
# ????????CP???????????????????????????
#
# ????????
# ?????,?????,?????????????????????
# ??????????????????????CP???????????
# ????????????CP_COST_ATTACK??????????
# ????????????????????
# ?????????????????????????
# ????????????????????
# ?????????????????0????
# ???????????
# ????????,120,0?
# ???CP_COST_ATTACK?120?????????
# ???????????????????
# ?????????,100,120?
# ???????????????????????????120??????
#########################################################################

#==============================================================================
# ? ????
#==============================================================================
module RPG
class Skill
CP_COST_DELAY = 300 # ??????????????????????
CP_COST_SPELL = 300 # ?????????????????????
end
end

module CTB_Define
# ???????ID
SPELL_STATE_ID = 300
# ??CP
# ??CP?????????CP(?????)×??????÷????????
CP_COST_ITEM = 200 # ???????????????
CP_COST_ATTACK = 300 # ??????????
CP_COST_GUARD = 200 # ??????????
CP_COST_NOTHING = 100 # ????????????
CP_COST_ESCAPE = 100 # ??????*???*????
CP_COST_SKILL = [0,300,300,400,300,300,300,300,400,300,300,400,300,300,400,300,300,400,300,300,400,300,300,400,300,300,400,300,300,400,400,550,250,350,250,350,250,350,250,350,250,350,250,350,250,350,250,350,250,350,250,350,400,400,400,400,200,300,400,500,200,300,400,500,200,300,400,500,200,300,400,500,200,300,400,500,200,300,400,500,900]
end

#==============================================================================
# ? RPG::Skill
#==============================================================================
module RPG
class Skill
def name
name = @name.split(/,/)[0]
return name != nil ? name : ''
end
def delay
name = @name.split(/,/)[1].to_i
return name != nil ? name : CP_COST_DELAY
end
def spell
name = @name.split(/,/)[2].to_i
return name != nil ? name : CP_COST_SPELL
end
end
end

#==============================================================================
# ? Window_CTB
#------------------------------------------------------------------------------
# ????????????????????
#==============================================================================
class Window_CTB < Window_Base
# ???????ID????
include CTB_Define
#--------------------------------------------------------------------------
# ? ?????????
#--------------------------------------------------------------------------
def initialize(avg)
super(0, 320, 160, 160)
self.contents = Bitmap.new(self.width - 32, self.height - 32)
# ??AGI??
@agi_avg = avg
# ?????
@names = []
end
#--------------------------------------------------------------------------
# ? ??????
#--------------------------------------------------------------------------
def refresh
# ?????
self.contents.clear
self.contents.font.name = "Tahoma"
self.contents.font.size = 20
self.contents.font.color = system_color
self.contents.font.size = 16
self.contents.draw_text(0, 0, 100, 17, "Turn Ratio")
# ?????
@names = []
# ???????????CP????
get_cps
# cp??????
@names.sort!{|a,b| b[0] <=> a[0] }
h = 0
self.contents.font.size = 17
for i in 0...6
@nam = @names[i]
if @nam == nil
break
end
x = 4
y = 18 * h + 17
if @nam[0] >= 500 # 500???????????
if @nam[2] == true
self.contents.font.color = Color.new(230, 255, 255, 255)
else
self.contents.font.name = "Tahoma"
self.contents.font.size = 12
self.contents.font.color = normal_color
end
else
if @nam[2] == true
self.contents.font.color = Color.new(190, 225, 225, 255)
else
self.contents.font.color = disabled_color
end
end
self.contents.draw_text(x, y, 128, 18, @nam[1])
h += 1
end
end
#--------------------------------------------------------------------------
# ? ????CP???
#--------------------------------------------------------------------------
def get_cps
# ???????????CP????@names???
i = 0
while @names.size < 15
for member in $game_party.actors + $game_troop.enemies
next if member.dead? or !member.exist?
cp = CP_COST_ATTACK * @agi_avg / member.agi # ????????CP???
if i == 1 and member.current_action.kind == 1
skill = $data_skills[member.current_action.skill_id]
cp = CP_COST_SKILL[skill.id] * @agi_avg / member.agi
end
cp = member.cp - (cp * i)
if i == 0
spell = member.state?(SPELL_STATE_ID)
else
spell = false
end
@names.push([cp, member.name, spell])
end
i += 1
end
end
#--------------------------------------------------------------------------
# ? CTB???????????????????
#--------------------------------------------------------------------------
def names_empty
if @names == []
return true
else
return false
end
end
end

#==============================================================================
# ? Window_CTB_All
#------------------------------------------------------------------------------
# ????????????????????????
#==============================================================================
class Window_CTB_All < Window_Base
# ???????ID????
include CTB_Define
#--------------------------------------------------------------------------
# ? ?????????
#--------------------------------------------------------------------------
def initialize(avg)
super(0, 0, 160, 480)
self.contents = Bitmap.new(self.width - 32, self.height - 32)
self.contents.font.name = "Tahoma"
self.contents.font.size = 12
# ??AGI??
@agi_avg = avg
# ?????
@names = []
# ???????????CP????
get_init_cps
# cp??????
@names.sort!{|a,b| b[0] <=> a[0] }
end
#--------------------------------------------------------------------------
# ? ??????
#--------------------------------------------------------------------------
def refresh(id)
# ?????
self.contents.clear
self.contents.font.name = "Tahoma"
self.contents.font.size = 20
self.contents.font.color = system_color
self.contents.font.size = 18
self.contents.draw_text(0, 0, 100, 20, "Turn Ratio")
h = 0
self.contents.font.size = 19
for i in id-1...[id+18,50].min
@nam = @names[i]
if @nam == nil
break
end
x = 4
y = 22 * h + 20
if @nam[0] >= 500 # 500???????????
if @nam[2] == true
self.contents.font.color = Color.new(230, 255, 255, 255)
else
self.contents.font.color = normal_color
end
else
if @nam[2] == true
self.contents.font.color = Color.new(190, 225, 225, 255)
else
self.contents.font.color = disabled_color
end
end
self.contents.font.name = "Tahoma"
self.contents.font.size = $fontsize
self.contents.draw_text(x, y, 32, 22, (i+1).to_s)
self.contents.draw_text(x+32, y, 128, 22, @nam[1])
h += 1
end
end
#--------------------------------------------------------------------------
# ? ????CP???
#--------------------------------------------------------------------------
def get_init_cps
# ???????????CP????@names???
i = 0
while @names.size < 75
for member in $game_party.actors + $game_troop.enemies
next if member.dead? or !member.exist?
cp = CP_COST_ATTACK * @agi_avg / member.agi # ????????CP???
if i == 1 and member.current_action.kind == 1
@skill = $data_skills[@active_battler.current_action.skill_id]
skill = $data_skills[member.current_action.skill_id]
cp = CP_COST_SKILL[skill.id] * @agi_avg / member.agi
end
cp = member.cp - (cp * i)
if i == 0
spell = member.state?(SPELL_STATE_ID)
else
spell = false
end
@names.push([cp, member.name, spell])
end
i += 1
end
end
#--------------------------------------------------------------------------
# ? CTB???????????????????
#--------------------------------------------------------------------------
def names_full(id)
if @names[id] == nil
return false
end
return true
end
end
#==============================================================================
# ? Window_PartyCommand(????????????????????????)
#==============================================================================
class Window_PartyCommand < Window_Selectable
#--------------------------------------------------------------------------
# ? ?????????(???)
#--------------------------------------------------------------------------
def initialize
super(0, 0, 640, 64)
self.contents = Bitmap.new(width - 32, height - 32)
self.back_opacity = 160
# ??????
@commands = ["Battle", "Special", "Escape"]
@item_max = 3
@column_max = 3
draw_item(0, normal_color)
draw_item(1, normal_color)
draw_item(2, $game_temp.battle_can_escape ? normal_color : disabled_color)
self.active = false
self.visible = false
self.index = 0
end
#--------------------------------------------------------------------------
# ? ?????(???)
# index : ????
# color : ???
#--------------------------------------------------------------------------
def draw_item(index, color)
self.contents.font.color = color
rect = Rect.new(80 + index * 160 + 4, 0, 128 - 10, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
self.contents.draw_text(rect, @commands[index], 1)
end
#--------------------------------------------------------------------------
# ? ?????????(???)
#--------------------------------------------------------------------------
def update_cursor_rect
self.cursor_rect.set(80 + index * 160, 0, 128, 32)
end
end
#==============================================================================
# ? Window_BattleStatus
#==============================================================================
class Window_BattleStatus < Window_Base
#--------------------------------------------------------------------------
# ? ?????????(???)(???????)
#--------------------------------------------------------------------------
def initialize
super(160, 320, 480, 160)
self.contents = Bitmap.new(width - 32, height - 32)
@level_up_flags = [false, false, false, false]
refresh
end
#--------------------------------------------------------------------------
# ? ??????(???)(???????)
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.name = "Tahoma"
self.contents.font.size = 19
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
actor_x = i * 115 + 9
draw_actor_name(actor, actor_x, 0)
draw_actor_hp(actor, actor_x, 31, 90)
draw_actor_sp(actor, actor_x, 65, 90)
if @level_up_flags[i]
self.contents.font.color = normal_color
self.contents.draw_text(actor_x, 99, 120, 32, "Level Up!")
else
draw_actor_state(actor, actor_x, 99)
end
end
end
end

#==============================================================================
# ? Game_Battler
#==============================================================================
class Game_Battler
# ???????ID????
include CTB_Define

attr_accessor :now_guarding # ????????
attr_accessor :cp # ??CP
#--------------------------------------------------------------------------
# ? ??????????
#--------------------------------------------------------------------------
alias ctb_sys_inputable? inputable?
def inputable?
bool = ctb_sys_inputable?
return false if state?(SPELL_STATE_ID)
return false if bool == false
return false if @cp < 500
return true
end
end

#==============================================================================
# ? Game_Actor
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# ? ??????
#--------------------------------------------------------------------------
alias ctb_sys_setup setup
def setup(actor_id)
ctb_sys_setup(actor_id)
@cp = 0
@now_guarding = false
end
#--------------------------------------------------------------------------
# ? ????? X ?????(???)
#--------------------------------------------------------------------------
def screen_x
# ??????????? X ?????????
if self.index != nil
return self.index * 115 + 215
else
return 0
end
end
end

#==============================================================================
# ? Game_Enemy
#==============================================================================
class Game_Enemy < Game_Battler
#--------------------------------------------------------------------------
# ? ?????????
#--------------------------------------------------------------------------
alias ctb_sys_initialize initialize
def initialize(troop_id, member_index)
ctb_sys_initialize(troop_id, member_index)
@cp = 0
@now_guarding = false
end
end

#==============================================================================
# ? Game_BattleAction
#==============================================================================
class Game_BattleAction
#--------------------------------------------------------------------------
# ? ??????????
#--------------------------------------------------------------------------
attr_accessor :spell # ??????
#--------------------------------------------------------------------------
# ? ?????????
#--------------------------------------------------------------------------
alias ctb_sys_initialize initialize
def initialize
@spell = false # spell?false???
ctb_sys_initialize
end

#--------------------------------------------------------------------------
# ? ???
#--------------------------------------------------------------------------
alias ctb_sys_clear clear
def clear
# spell ?true????????
return if @spell
ctb_sys_clear
end
end

#==============================================================================
# ? Scene_Battle
#==============================================================================
class Scene_Battle
# ???????ID????
include CTB_Define

#--------------------------------------------------------------------------
# ? ????? (???)
#--------------------------------------------------------------------------
def main
# ???????????????
$game_temp.in_battle = true
$game_temp.battle_turn = 0
$game_temp.battle_event_flags.clear
$game_temp.battle_abort = false
$game_temp.battle_main_phase = false
$game_temp.battleback_name = $game_map.battleback_name
$game_temp.forcing_battler = nil
# ??????????????????
$game_system.battle_interpreter.setup(nil, 0)
# ???????
@troop_id = $game_temp.battle_troop_id
$game_troop.setup(@troop_id)
# ????????????????
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(115, [s1, s2, s3, s4])
@actor_command_window.y = 160
@actor_command_window.back_opacity = 0
@actor_command_window.active = false
@actor_command_window.visible = false
# ????????????
@party_command_window = Window_PartyCommand.new
@help_window = Window_Help.new
@help_window.back_opacity = 0
@help_window.visible = false
@status_window = Window_BattleStatus.new
@message_window = Window_Message.new

### ????????
# ???????????????
@avg = read_avg
# CTB?Window???
@ctb_window = Window_CTB.new(@avg)
# ?????CP???
first_cp
### ????????

# ???????????
@spriteset = Spriteset_Battle.new
# ????????????
@wait_count = 0
# ?????????
if $data_system.battle_transition == ""
Graphics.transition(20)
else
Graphics.transition(40, "Graphics/Transitions/" +
$data_system.battle_transition)
end

# ???????????
start_phase1
# ??????
loop do
# ????????
Graphics.update
# ???????
Input.update
# ??????
update
# ????????????????
if $scene != self
break
end
end
# ??????????
$game_map.refresh
# ?????????
Graphics.freeze
# ????????
@actor_command_window.dispose
@party_command_window.dispose
@help_window.dispose
@status_window.dispose
@message_window.dispose
### ????????
@ctb_window.dispose
if @skill_window != nil
@skill_window.dispose
end
### ????????
if @skill_window != nil
@skill_window.dispose
end
if @item_window != nil
@item_window.dispose
end
if @result_window != nil
@result_window.dispose
end
# ???????????
@spriteset.dispose
# ???????????????
if $scene.is_a?(Scene_Title)
# ??????????
Graphics.transition
Graphics.freeze
end
# ???????????????????????????
if $BTEST and not $scene.is_a?(Scene_Gameover)
$scene = nil
end
end
#--------------------------------------------------------------------------
# ? ??????(???)
#--------------------------------------------------------------------------
def update
# ?????????????
if $game_system.battle_interpreter.running?
# ?????????
$game_system.battle_interpreter.update
# ?????????????????????????
if $game_temp.forcing_battler == nil
# ?????????????????
unless $game_system.battle_interpreter.running?
# ??????????????????????????
unless judge
setup_battle_event
end
end
# ????????????????
if @phase != 5
# ?????????????????
@status_window.refresh
end
end
end
# ???? (????)??????
$game_system.update
$game_screen.update
# ????? 0 ??????
if $game_system.timer_working and $game_system.timer == 0
# ?????
$game_temp.battle_abort = true
end

# ??????
# CP??
if @phase != 4
cp_countup
end
@ctb_window.update
# CTB ???????????????????(?????)?refresh
@ctb_window.refresh if @ctb_window.names_empty
# ??????

# ????????
@help_window.update
@party_command_window.update
@actor_command_window.update
@status_window.update
@message_window.update
# ???????????
@spriteset.update
# ?????????????
if $game_temp.transition_processing
# ?????????????????
$game_temp.transition_processing = false
# ?????????
if $game_temp.transition_name == ""
Graphics.transition(20)
else
Graphics.transition(40, "Graphics/Transitions/" +
$game_temp.transition_name)
end
end
# ????????????????
if $game_temp.message_window_showing
return
end
# ???????????
if @spriteset.effect?
return
end
# ??????????
if $game_temp.gameover
# ??????????????
$scene = Scene_Gameover.new
return
end
# ???????????
if $game_temp.to_title
# ???????????
$scene = Scene_Title.new
return
end
# ????????
if $game_temp.battle_abort
# ??????? BGM ???
$game_system.bgm_play($game_temp.map_bgm)
# ?????
battle_end(1)
return
end
# ????????
if @wait_count > 0
# ????????????
@wait_count -= 1
return
end
# ???????????????????????
# ????????????????
if $game_temp.forcing_battler == nil and
$game_system.battle_interpreter.running?
return
end
# ??????????
case @phase
when 1 # ?????????
update_phase1
when 2 # ????????????
update_phase2
when 3 # ????????????
update_phase3
when 4 # ???????
update_phase4
when 5 # ???????????
update_phase5
# ??????
when 6 # ??????????(????)
update_ctb_all
end
end
#--------------------------------------------------------------------------
# ? ??????????????(???)
#--------------------------------------------------------------------------
def start_phase2
# ???? 2 ???
@phase = 2
# ?????????????
@actor_index = -1
@active_battler = nil
# ??????
# ?????????????????
@actor_command_window.active = false
@actor_command_window.visible = false
# ??????
# ??????????????
$game_temp.battle_main_phase = false
# ????????????????
$game_party.clear_actions
# ????????????
unless $game_party.inputable?
# ?????????
start_phase4
end
# ??????
# ????????????????????????????????
if @party_command_window.active != true
start_phase3
else
update_phase2
end
# ??????
end
#--------------------------------------------------------------------------
# ? ?????? (????????????)(???)
#--------------------------------------------------------------------------
def update_phase2
# ????????
# C ??????????
if Input.trigger?(Input::C)
# ???????????????????????
case @party_command_window.index
when 0 # ??
# ?? SE ???
$game_system.se_play($data_system.decision_se)
# ??????????????
start_phase3
when 1 # CTBWindow2
# ?? SE ???
$game_system.se_play($data_system.decision_se)
# CTB????
start_phase2_CTB
when 2 # ???
# ??????????
if $game_temp.battle_can_escape == false
# ??? SE ???
$game_system.se_play($data_system.buzzer_se)
return
end
# ?? SE ???
$game_system.se_play($data_system.decision_se)
# ????
update_phase2_escape
end
return
elsif Input.trigger?(Input::B)
# ?? SE ???
$game_system.se_play($data_system.cancel_se)
# ??????????????
start_phase3
end
end
#--------------------------------------------------------------------------
# ? ?????? (???????????? : ???)
#--------------------------------------------------------------------------
alias ctb_sys_update_phase2_escape update_phase2_escape
def update_phase2_escape
# CP?? (??)
for actor in $game_party.actors
if actor.exist?
actor.cp -= CP_COST_ESCAPE * @avg / actor.agi
end
end
ctb_sys_update_phase2_escape
end
#--------------------------------------------------------------------------
# ? ????????????????????
#--------------------------------------------------------------------------
alias ctb_sys_phase3_setup_command_window phase3_setup_command_window
def phase3_setup_command_window
ctb_sys_phase3_setup_command_window
# ???????false???
@active_battler.now_guarding = false
# ????????????????????(??160??)
@actor_command_window.x = @actor_index * 105 + 160
end
#--------------------------------------------------------------------------
# ? ?????? (???????????? : ??????)
#--------------------------------------------------------------------------
alias ctb_sys_update_phase3_basic_command update_phase3_basic_command
def update_phase3_basic_command
# X ??????????
if Input.trigger?(Input::X)
# ?? SE ???
$game_system.se_play($data_system.decision_se)
# ?????????????
@party_command_window.active = true
@party_command_window.visible = true
start_phase2
else
ctb_sys_update_phase3_basic_command
end
end
#--------------------------------------------------------------------------
# ? ?????? (???)
#--------------------------------------------------------------------------
def make_action_orders
# CP500????????push?????????
# ?? @action_battlers ????
@action_battlers = []
# CP500?????????? @action_battlers ???
for enemy in $game_troop.enemies
if enemy.cp >= 500
@action_battlers.push(enemy)
end
end
# CP500?????????? @action_battlers ???
for actor in $game_party.actors
if actor.cp >= 500
@action_battlers.push(actor)
end
end
# ???????????????
for battler in @action_battlers
battler.make_action_speed
end
# ???????????????????
@action_battlers.sort! {|a,b|
b.current_action.speed - a.current_action.speed }
end
#--------------------------------------------------------------------------
# ? ?????? (??????? ???? 1 : ???????)
#--------------------------------------------------------------------------
alias ctb_sys_update_phase4_step1 update_phase4_step1
def update_phase4_step1
# CTB??????
@ctb_window.refresh
ctb_sys_update_phase4_step1
end
#--------------------------------------------------------------------------
# ? ?????? (??????? ???? 2 : ???????)(???)
#--------------------------------------------------------------------------
def update_phase4_step2
# ????????????
unless @active_battler.current_action.forcing
# ??? [????????] ? [?????????] ???
if @active_battler.restriction == 2 or @active_battler.restriction == 3
# ???????????
@active_battler.current_action.kind = 0
@active_battler.current_action.basic = 0
end
# ??? [??????] ???
if @active_battler.restriction == 4
# ??????????????????
$game_temp.forcing_battler = nil
if @active_battler.cp >= 500
# ????????
@active_battler.remove_states_auto
# CP?? (???????????????????) ????
@active_battler.cp -= CP_COST_NOTHING * @avg / @active_battler.agi
# cp????????
cp_countup
end
# ???? 1 ???
@phase4_step = 1
return
end
end
# ??????????
@target_battlers = []
# ???????????
case @active_battler.current_action.kind
when 0 # ??
make_basic_action_result
when 1 # ???
make_skill_action_result
when 2 # ????
make_item_action_result
end
# ???? 3 ???
if @phase4_step == 2
@phase4_step = 3
end
end
#--------------------------------------------------------------------------
# ? ??????? ????
#--------------------------------------------------------------------------
alias ctb_sys_make_basic_action_result make_basic_action_result
def make_basic_action_result
# ?????
if @active_battler.current_action.basic == 0
@active_battler.cp -= CP_COST_ATTACK * @avg / @active_battler.agi
end
# ?????
if @active_battler.current_action.basic == 1
# CP??
@active_battler.cp -= CP_COST_GUARD * @avg / @active_battler.agi
end
# ????????
if @active_battler.is_a?(Game_Enemy) and
@active_battler.current_action.basic == 2
# CP??
@active_battler.cp -= CP_COST_ESCAPE * @avg / @active_battler.agi
end
# ????????
if @active_battler.current_action.basic == 3
# CP??
@active_battler.cp -= CP_COST_NOTHING * @avg / @active_battler.agi
# ??????????????????
$game_temp.forcing_battler = nil
# cp????????
cp_countup
# ???? 1 ???
@phase4_step = 1
return
end
# ????
ctb_sys_make_basic_action_result
end
#--------------------------------------------------------------------------
# ? ???????? ????(???)
#--------------------------------------------------------------------------
def make_skill_action_result
# ??????
@skill = $data_skills[@active_battler.current_action.skill_id]
skill = $data_skills[@active_battler.current_action.skill_id]
# ?????????????????
@status_window.refresh
@ctb_window.refresh
# ????????????????
@help_window.set_text(@skill.name, 1)
# ??????
if @active_battler.state?(SPELL_STATE_ID)
# ???????????
@active_battler.remove_state(SPELL_STATE_ID)
@active_battler.current_action.spell = false
else
# SP ??
@active_battler.sp -= @skill.sp_cost
# Skill?Spell??1?????
if @skill.spell > 0
# CP ?? skill.spell???
@active_battler.cp -= CP_COST_SKILL[skill.id] * @avg / @active_battler.agi
# ??????????
@active_battler.add_state(SPELL_STATE_ID)
@active_battler.current_action.spell = true
end
end
# ?????????????????
unless @active_battler.state?(SPELL_STATE_ID)
# SP ??????
@active_battler.sp += @skill.sp_cost
# ????????????
unless @active_battler.current_action.forcing
# SP ????????????????
unless @active_battler.skill_can_use?(@skill.id)
# ??????????????????
$game_temp.forcing_battler = nil
# ???? 1 ???
@phase4_step = 1
return
end
end
# SP ?????
@active_battler.sp -= @skill.sp_cost
# CP ?? skill.delay???
@active_battler.cp -= CP_COST_SKILL[skill.id] * @avg / @active_battler.agi
# ??????? ID ???
@animation1_id = @skill.animation1_id
@animation2_id = @skill.animation2_id
# ??????? ID ???
@common_event_id = @skill.common_event_id
# ??????????
set_target_battlers(@skill.scope)
# ?????????
for target in @target_battlers
target.skill_effect(@active_battler, @skill)
end
end
end
#--------------------------------------------------------------------------
# ? ????????? ????
#--------------------------------------------------------------------------
def make_item_action_result
alias ctb_sys_make_item_action_result make_item_action_result
ctb_sys_make_item_action_result
# CP ??
@active_battler.cp -= CP_COST_ITEM * @avg / @active_battler.agi
end
#--------------------------------------------------------------------------
# ? ?????? (??????? ???? 6 : ??????)
#--------------------------------------------------------------------------
alias ctb_sys_update_phase4_step6 update_phase4_step6
def update_phase4_step6
ctb_sys_update_phase4_step6
# cp????????
cp_countup
end
#--------------------------------------------------------------------------
# ? ??????????
#--------------------------------------------------------------------------
def read_avg
temp = 0
for member in $game_party.actors + $game_troop.enemies
temp += member.agi
end
temp /= $game_troop.enemies.size + $game_party.actors.size
return temp
end
#--------------------------------------------------------------------------
# ? ?????CP???
#--------------------------------------------------------------------------
def first_cp
for member in $game_party.actors + $game_troop.enemies
member.cp = [[5 * (rand(20) + 60) * member.agi / @avg, 0].max, 490].min
end
end
#----------------------------------------------------------------------------
# ? ???????CP????????
#----------------------------------------------------------------------------
def cp_countup
# 500 - cp?????????
cpmin = 500
edead = 0
for enemy in $game_troop.enemies
# ??????????
if enemy.dead? == true
edead +=1
enemy.cp = 0
next
end
cpmin = [cpmin, 500 - enemy.cp].min
end

# ?????????????return
return if $game_troop.enemies.size == edead

for actor in $game_party.actors
# ??????????
if actor.dead? == true
actor.cp = 0
next
end
cpmin = [cpmin, 500 - actor.cp].min
end

# cpmin?0??????????
return if cpmin <= 0

# ???CP?cpmin??
for member in $game_party.actors + $game_troop.enemies
# ??????????
next if member.dead?
member.cp += cpmin
# cp?500?????????
next if member.cp < 500
# ????????
member.remove_states_auto
# MP??
plus = [member.maxsp * 5/ 100,1].max
member.sp = [member.sp + plus,member.maxsp].min
if member.slip_damage?
# ????????
member.slip_damage_effect
member.damage_pop = true
end
end
@status_window.refresh
end
#--------------------------------------------------------------------------
# ? ?????? (???????????? : ?????)
#--------------------------------------------------------------------------
def start_phase2_CTB
@party_command_window.active = false
@party_command_window.visible = false
# ???? 6 ???
@phase = 6
@ctb_window.visible = false
@ctb_window_all = Window_CTB_All.new(@avg)
@ctb_window_all.update
@id = 1
@ctb_window_all.refresh(@id)
end
#--------------------------------------------------------------------------
# ? ?????? (???????????? : ?????????)
#--------------------------------------------------------------------------
def update_ctb_all
# ? ??????????
if Input.trigger?(Input::DOWN) or Input.repeat?(Input::DOWN)
if @id < 50
@id +=1
else
@id = 1
end
@ctb_window_all.refresh(@id)
# ? ??????????
elsif Input.trigger?(Input::UP) or Input.repeat?(Input::UP)
if @id > 1
@id -= 1
else
@id = 50
end
@ctb_window_all.refresh(@id)
# L ??????????
elsif Input.trigger?(Input::L)
@id = [@id-18,1].max
@ctb_window_all.refresh(@id)
# R ??????????
elsif Input.trigger?(Input::R)
@id = [@id+18, 50].min
@ctb_window_all.refresh(@id)
# B?A??????
elsif Input.trigger?(Input::B)
# ????? SE ???
$game_system.se_play($data_system.cancel_se)
@ctb_window.visible = true
@ctb_window_all.dispose
@party_command_window.active = true
@party_command_window.visible = true
start_phase2
end
end
end


These two scripts work together but it just doesn't look very good, so if you could just help me pretty up the menu's and things (nothing major) that would great!
Thanx.
« Last Edit: June 10, 2007, 02:03:41 PM by poser7 »
I don't have a signature

**
Rep:
Level 87
72 hrs. Bump.
I don't have a signature

**
Rep:
Level 87
*sigh* bump again.
I don't have a signature

**
Rep:
Level 87
I'm not giving up, so... bump bump bump.
I don't have a signature

**
Rep:
Level 87
another bump.
I don't have a signature

**
Rep:
Level 87
Am I not making myself clear? If not, please let me know so I can change it, but until then, ....Bump.
I don't have a signature

***
Rep:
Level 88
It could be becuase of:
1. No one might not know how to do it
2. Or people just don't want to do it