# Ccoa's side view battle system, with modified ATB from an unknown
# Japanese coder v1.0b
# For comments and bugs, please visit www.lrpgm.com/vb/
class Game_Battler
attr_accessor :attack
attr_accessor :skill
attr_accessor :victory
attr_accessor :item
def initialize
@battler_name = ""
@battler_hue = 0
@hp = 0
@sp = 0
@states = []
@states_turn = {}
@maxhp_plus = 0
@maxsp_plus = 0
@str_plus = 0
@dex_plus = 0
@agi_plus = 0
@int_plus = 0
@hidden = false
@immortal = false
@damage_pop = false
@damage = nil
@critical = false
@animation_id = 0
@animation_hit = false
@white_flash = false
@blink = false
@current_action = Game_BattleAction.new
@attack = false
@skill = false
@victory = false
@item = false
end
# Is the battler's HP at 15% or less?
def low_hp?
return ((@hp * 100) / maxhp <= 15)
end
end
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# ? The X-coordinate of the battler
#--------------------------------------------------------------------------
def screen_x
# ??????????? X ?????????
if self.index != nil
return self.index * 40 + 460
else
return 0
end
end
#--------------------------------------------------------------------------
# ? The Y-coordinate of the battler
#--------------------------------------------------------------------------
def screen_y
return self.index * 45 + 175
end
#--------------------------------------------------------------------------
# ? The Z "depth" of the battler
#--------------------------------------------------------------------------
def screen_z
# ??????????? Z ?????????
if self.index != nil
return 0 + self.index
else
return 0
end
end
end
class Sprite_Battler < RPG::Sprite
def initialize(viewport, battler = nil)
super(viewport)
@battler = battler
@battler_visible = false
@frame_num = 0
@next_frame = 0
if (@battler != nil)
@picture_name = @battler.battler_name
else
@picture_name = ""
end
@victory = false
@attacking = false
@acting = false
@update_speed = 7 # the higher this number, the slower the animation
@stop_anime = false
@num_of_frames = 4 # the total number of frames per animation
end
def update
super
# ????? nil ???
if @battler == nil
self.bitmap = nil
loop_animation(nil)
return
end
# ????????????????????
if @battler.battler_name != @battler_name or
@battler.battler_hue != @battler_hue
# ????????????
@battler_name = @battler.battler_name
@battler_hue = @battler.battler_hue
self.bitmap = RPG::Cache.battler(@battler_name + @frame_num.to_s,
@battler_hue)
@width = bitmap.width
@height = bitmap.height
self.ox = @width / 2
self.oy = @height
# ?????????????????? 0 ???
if @battler.dead? or @battler.hidden
self.opacity = 0
end
end
# ??????? ID ????????????
if @battler.damage == nil and
@battler.state_animation_id != @state_animation_id
@state_animation_id = @battler.state_animation_id
loop_animation($data_animations[@state_animation_id])
end
# ??????????????
if @battler_visible
# ***ccoa***
# update the animation every nth update
if @next_frame == 0
if @picture_name == ""
@picture_name = @battler.battler_name
end
if @stop_anime
self.bitmap = RPG::Cache.battler(@battler_name + "_victory" + (@num_of_frames - 1).to_s,
@battler_hue)
else
self.bitmap = RPG::Cache.battler(@picture_name + @frame_num.to_s,
@battler_hue)
end
@frame_num = (@frame_num + 1) % @num_of_frames
if @reset_action
@picture_name = @battler.battler_name
@attacking = false
@acting = false
@battler.attack = false
@battler.skill = false
@battler.item = false
@reset_action = false
end
if ((@attacking or @acting) and @frame_num == @num_of_frames - 1)
@reset_action = true
end
if @victory and @frame_num == @num_of_frames - 1
@stop_anime = true
end
end
# update the frame every @update_speed time update is called,
# or twice as fast when attacking
@next_frame = (@next_frame + 1) % (@update_speed / (@attacking? 2 : 1))
# ???????????????????????
if $game_temp.battle_main_phase
self.opacity += 3 if self.opacity < 255
else
self.opacity -= 3 if self.opacity > 207
end
end
if !@victory
# ***ccoa*** Victory? Guarding? Attacking? Using a skill?
if @battler.victory
@picture_name = @battler.battler_name + "_victory"
@victory = true
@battler.victory = false
@update_speed = 8
elsif @battler.guarding?
@picture_name = @battler.battler_name + "_guard"
elsif @battler.attack
if @battler.is_a?(Game_Actor)
# if the battler is armed, use that weapon's attack animation
weapon = $data_weapons[@battler.weapon_id]
if (weapon != nil)
@picture_name = @battler.battler_name + "_attack_" +
weapon.name.gsub(' ', '_')
else
@picture_name = @battler.battler_name + "_attack"
end
else
@picture_name = @battler.battler_name + "_attack"
end
if !@attacking
@attacking = true
@frame_num = 0
end
elsif @battler.skill
@picture_name = @battler.battler_name + "_skill"
if !@acting
@acting = true
@frame_num = 0
end
elsif @battler.item and @battler.is_a?(Game_Actor)
@picture_name = @battler.battler_name + "_item"
if !@acting
@acting = true
@frame_num = 0
end
elsif @battler.is_a?(Game_Actor) and @battler.low_hp?
@picture_name = @battler.battler_name + "_lowhp"
else
@picture_name = @battler.battler_name
end
end
# ??
if @battler.blink
blink_on
else
blink_off
end
# ??????
unless @battler_visible
# ??
if not @battler.hidden and not @battler.dead? and
(@battler.damage == nil or @battler.damage_pop)
appear
@battler_visible = true
end
end
# ?????
if @battler_visible
# ??
if @battler.hidden
$game_system.se_play($data_system.escape_se)
escape
@battler_visible = false
end
# ***ccoa***
# hit and miss animations
if @battler.damage != nil
if !(@battler.damage.is_a?(String) and @battler.damage = "Miss") and
@battler.damage > 0
self.bitmap = RPG::Cache.battler(@battler.battler_name + "_hit",
@battler_hue)
elsif @battler.damage.is_a?(String) and @battler.damage = "Miss" and
@battler.is_a?(Game_Actor)
self.bitmap = RPG::Cache.battler(@battler.battler_name + "_miss",
@battler_hue)
end
@next_frame = 0
@battler.animation_hit = false
end
# ??????
if @battler.white_flash
whiten
@battler.white_flash = false
end
# ???????
if @battler.animation_id != 0
animation = $data_animations[@battler.animation_id]
animation(animation, @battler.animation_hit)
@battler.animation_id = 0
end
# ????
if @battler.damage_pop
damage(@battler.damage, @battler.critical)
@battler.damage = nil
@battler.critical = false
@battler.damage_pop = false
end
# ????
if @battler.damage == nil and @battler.dead?
if @battler.is_a?(Game_Enemy)
$game_system.se_play($data_system.enemy_collapse_se)
collapse
@battler_visible = false
else
$game_system.se_play($data_system.actor_collapse_se)
self.bitmap = RPG::Cache.battler(@battler.battler_name + "_dead",
@battler_hue)
end
end
end
# ???????????
self.x = @battler.screen_x
self.y = @battler.screen_y
self.z = @battler.screen_z
end
end
class Window_BattleResult < Window_Base
def initialize(exp, gold, treasures)
@exp = exp
@gold = gold
@treasures = treasures
super(160, 0, 320, @treasures.size * 32 + 64)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
self.y = 160 - height / 2
self.z = 6000
self.back_opacity = 160
self.visible = false
refresh
end
end
#^EƒAƒNƒeƒBƒuƒ^ƒCƒ€ƒoƒgƒ‹ Ver 0.999q(l’Œƒo[ƒWƒ‡ƒ“)
class Scene_Battle
#--------------------------------------------------------------------------
# œ ŒöŠJƒCƒ“ƒXƒ^ƒ“ƒX•Ï”
#--------------------------------------------------------------------------
attr_reader :status_window # ƒXƒe[ƒ^ƒXƒEƒBƒ“ƒhƒE
attr_accessor :force # ƒAƒNƒVƒ‡ƒ“‹§“x
#--------------------------------------------------------------------------
# œ ATBŠî‘bƒZƒbƒgƒAƒbƒv
#--------------------------------------------------------------------------
def atb_setup
# ATB‰Šú‰»
# speed : ƒoƒgƒ‹ƒXƒs[ƒhŒˆ’èB’l‚ª¬‚³‚¢‚Ù‚Ç‘‚¢
# @active : ƒAƒNƒeƒBƒu“xÝ’è
# 3:í‚ɃAƒNƒeƒBƒuó‘Ô
# 2:ƒXƒLƒ‹EƒAƒCƒeƒ€‘I‘𒆂̂݃AƒNƒeƒBƒuƒQ[ƒW‚ªŽ~‚Ü‚é
# 1:2‚Ìó‘ԂɉÁ‚¦Aƒ^[ƒQƒbƒg‘I‘ðŽž‚àƒEƒFƒCƒg‚ªŠ|‚©‚é
# 0:1‚Ìó‘ԂɉÁ‚¦AƒRƒ}ƒ“ƒh“ü—ÍŽž‚É‚àƒEƒFƒCƒg‚ªŠ|‚©‚é
# @anime_wait : true‚É‚·‚é‚ƃoƒgƒ‹ƒAƒjƒFƒ_ƒ[ƒW•Ž¦’†‚̓EƒFƒCƒg‚ªŠ|‚©‚é
# @damage_wait : ƒ_ƒ[ƒW•Ž¦ŽžŠÔi’PˆÊ‚̓tƒŒ[ƒ€j
# @force : ‹§ƒAƒNƒVƒ‡ƒ“‚ŃXƒLƒ‹Žg—pŽž‚Ì‹§‹ï‡
# 2:ƒXƒLƒ‹‚Í‘S‚ĉr¥‚¹‚¸A•K‚¸‘¦ŽžŽÀs
# 1:’P“ƃXƒLƒ‹‚͉r¥‚µA˜AŒgƒXƒLƒ‹‚Ì‚Ý‘¦ŽžŽÀs
# 0:‘SƒXƒLƒ‹‰r¥‚ðs‚¤‚¾‚¯
# ($scene.force = x ‚Æ‚·‚邱‚Æ‚É‚æ‚èA’ÊíƒCƒxƒ“ƒg‚̃XƒNƒŠƒvƒg‚©‚ç•ÏX‰Â”j
speed = 200
@active = 3
@anime_wait = false
@damage_wait = 20
@force = 2
@escape == false
@max = 0
@turn_cnt = 0
@action_battlers = []
@synthe = []
@spell_p = {}
@spell_e = {}
@command_a = false
@command = []
@party = false
@phase4_step = 1
$game_troop.setup(@troop_id)
for battler in $game_party.actors + $game_troop.enemies
battler.at = battler.agi * rand(speed / 2)
if battler.is_a?(Game_Actor)
@max += battler.agi
end
spell_reset(battler)
end
@max *= speed
@max /= $game_party.actors.size
for battler in $game_party.actors + $game_troop.enemies
battler.atp = 100 * battler.at / @max
end
end
end
class Window_Base < Window
#--------------------------------------------------------------------------
# œ ATG ‚Ì•`‰æ
# actor : ƒAƒNƒ^[
# x : •`‰ææ X À•W
# y : •`‰ææ Y À•W
# width : •`‰ææ‚Ì•
#--------------------------------------------------------------------------
def draw_actor_atg(actor, x, y, width = 144)
# •Ï”at‚É•`‰æ‚·‚éƒQ[ƒW‚Ì•‚ð‘ã“ü
if actor.rtp == 0
at = width * actor.atp / 100
else
at = width * actor.rt / actor.rtp
end
if at > width
at = width
end
# •Ï”rate‚ÉŒ»Ý‚ÌATƒQ[ƒW‚ÌŠ„‡‚ð‘ã“ü
rate = at.to_f / width
# ˜g•`‰æ
self.contents.fill_rect(x - 2, y + 8, width + 4, 16,
Color.new(0, 0, 0, 255))
self.contents.fill_rect(x - 1, y + 9, width + 2, 14,
Color.new(255, 255, 192, 255))
# ‹óƒQ[ƒW‚ÌFÝ’è color1:ƒXƒ^[ƒgƒJƒ‰[color2:ƒGƒ“ƒhƒJƒ‰[
color1 = Color.new(0, 0, 64, 192)
color2 = Color.new(0, 0, 0, 192)
# ‹óƒQ[ƒW‚Ì•`‰æˆ— c‚ɃOƒ‰ƒf[ƒVƒ‡ƒ“
self.contents.gradation_rect(x, y + 10, width, 12,
color1, color2, 1)
# ƒQ[ƒW‚Ì•`‰æˆ—
if at == width
# ƒQ[ƒW‚ªMAX‚ÌŽž‚ÌFÝ’è
color1 = Color.new(0, 80, 0)
color2 = Color.new(0, 80 + 160 * rate, 0)
else
if actor.rtp == 0
# ’Ê펞‚ÌFÝ’è
color1 = Color.new(0, 64, 80)
color2 = Color.new(0, 64 + 128 * rate, 80 + 160 * rate)
else
if actor.spell == true
# ˜AŒgƒXƒLƒ‹Žg—pŽž‚ÌFÝ’è
color1 = Color.new(80, 64, 32)
color2 = Color.new(80 + 160 * rate, 64 + 128 * rate, 32 + 64 * rate)
else
# ƒXƒLƒ‹‰r¥Žž‚ÌFÝ’è
color1 = Color.new(80, 0, 64)
color2 = Color.new(80 + 160 * rate, 0, 64 + 128 * rate)
end
end
end
# ATƒQ[ƒW‚Ì•`‰æˆ— ‰¡‚ɃOƒ‰ƒf[ƒVƒ‡ƒ“
self.contents.gradation_rect(x, y + 10, at, 12, color1, color2)
end
end
#==============================================================================
# ¡ Scene_Battle (•ªŠ„’è‹` 1)
#------------------------------------------------------------------------------
# @ƒoƒgƒ‹‰æ–ʂ̈—‚ðs‚¤ƒNƒ‰ƒX‚Å‚·B
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# œ ƒƒCƒ“ˆ—
#--------------------------------------------------------------------------
def main
# 퓬—p‚ÌŠeŽíˆêŽžƒf[ƒ^‚ð‰Šú‰»
$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
# ƒoƒgƒ‹ƒCƒxƒ“ƒg—pƒCƒ“ƒ^ƒvƒŠƒ^‚ð‰Šú‰»
$game_system.battle_interpreter.setup(nil, 0)
# ƒgƒ‹[ƒv‚ð€”õ
@troop_id = $game_temp.battle_troop_id
$game_troop.setup(@troop_id)
atb_setup
# ƒAƒNƒ^[ƒRƒ}ƒ“ƒhƒEƒBƒ“ƒhƒE‚ðì¬
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
@actor_command_window.active = false
@actor_command_window.visible = false
# ‚»‚Ì‘¼‚̃EƒBƒ“ƒhƒE‚ðì¬
@party_command_window = Window_PartyCommand.new
@help_window = Window_Help.new
@help_window.back_opacity = 160
@help_window.visible = false
@status_window = Window_BattleStatus.new
@message_window = Window_Message.new
# ƒXƒvƒ‰ƒCƒgƒZƒbƒg‚ðì¬
@spriteset = Spriteset_Battle.new
# ƒEƒFƒCƒgƒJƒEƒ“ƒg‚ð‰Šú‰»
@wait_count = 0
# ƒgƒ‰ƒ“ƒWƒVƒ‡ƒ“ŽÀs
if $data_system.battle_transition == ""
Graphics.transition(20)
else
Graphics.transition(40, "Graphics/Transitions/" +
$data_system.battle_transition)
end
# ƒvƒŒƒoƒgƒ‹ƒtƒF[ƒYŠJŽn
start_phase1
# ƒƒCƒ“ƒ‹[ƒv
loop do
# ƒQ[ƒ€‰æ–Ê‚ðXV
Graphics.update
# “ü—Íî•ñ‚ðXV
Input.update
# ƒtƒŒ[ƒ€XV
update
# ‰æ–Ê‚ªØ‚è‘Ö‚í‚Á‚½‚烋[ƒv‚ð’†’f
if $scene != self
break
end
end
# ƒ}ƒbƒv‚ðƒŠƒtƒŒƒbƒVƒ…
$game_map.refresh
# ƒgƒ‰ƒ“ƒWƒVƒ‡ƒ“€”õ
Graphics.freeze
# ƒEƒBƒ“ƒhƒE‚ð‰ð•ú
@actor_command_window.dispose
@party_command_window.dispose
@help_window.dispose
@status_window.dispose
@message_window.dispose
if @skill_window != nil
@skill_window.dispose
end
if @item_window != nil
@item_window.dispose
end
if @result_window != nil
@result_window.dispose
end
# ƒXƒvƒ‰ƒCƒgƒZƒbƒg‚ð‰ð•ú
@spriteset.dispose
# ƒ^ƒCƒgƒ‹‰æ–Ê‚ÉØ‚è‘Ö‚¦’†‚Ìê‡
if $scene.is_a?(Scene_Title)
# ‰æ–Ê‚ðƒtƒF[ƒhƒAƒEƒg
Graphics.transition
Graphics.freeze
end
# 퓬ƒeƒXƒg‚©‚çƒQ[ƒ€ƒI[ƒo[‰æ–ʈȊO‚ÉØ‚è‘Ö‚¦’†‚Ìê‡
if $BTEST and not $scene.is_a?(Scene_Gameover)
$scene = nil
end
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV
#--------------------------------------------------------------------------
def update
# ƒoƒgƒ‹ƒCƒxƒ“ƒgŽÀs’†‚Ìê‡
if $game_system.battle_interpreter.running?
if @command.size > 0
@command_a = false
@command = []
command_delete
end
@status_window.at_refresh
# ƒCƒ“ƒ^ƒvƒŠƒ^‚ðXV
$game_system.battle_interpreter.update
# ƒAƒNƒVƒ‡ƒ“‚ð‹§‚³‚ê‚Ä‚¢‚éƒoƒgƒ‰[‚ª‘¶Ý‚µ‚È‚¢ê‡
if $game_temp.forcing_battler == nil
# ƒoƒgƒ‹ƒCƒxƒ“ƒg‚ÌŽÀs‚ªI‚í‚Á‚½ê‡
unless $game_system.battle_interpreter.running?
# 퓬Œp‘±‚Ìê‡Aƒoƒgƒ‹ƒCƒxƒ“ƒg‚̃ZƒbƒgƒAƒbƒv‚ðÄŽÀs
unless judge
@status_window.refresh
setup_battle_event
end
end
end
end
# ƒVƒXƒeƒ€ (ƒ^ƒCƒ}[)A‰æ–Ê‚ðXV
$game_system.update
$game_screen.update
# ƒ^ƒCƒ}[‚ª 0 ‚É‚È‚Á‚½ê‡
if $game_system.timer_working and $game_system.timer == 0
# ƒoƒgƒ‹’†’f
$game_temp.battle_abort = true
end
# ƒEƒBƒ“ƒhƒE‚ðXV
@help_window.update
@party_command_window.update
@actor_command_window.update
@status_window.update
@message_window.update
# ƒXƒvƒ‰ƒCƒgƒZƒbƒg‚ðXV
@spriteset.update
# ƒgƒ‰ƒ“ƒWƒVƒ‡ƒ“ˆ—’†‚Ìê‡
if $game_temp.transition_processing
# ƒgƒ‰ƒ“ƒWƒVƒ‡ƒ“ˆ—’†ƒtƒ‰ƒO‚ðƒNƒŠƒA
$game_temp.transition_processing = false
# ƒgƒ‰ƒ“ƒWƒVƒ‡ƒ“ŽÀs
if $game_temp.transition_name == ""
Graphics.transition(20)
else
Graphics.transition(40, "Graphics/Transitions/" +
$game_temp.transition_name)
end
end
# ƒƒbƒZ[ƒWƒEƒBƒ“ƒhƒE•Ž¦’†‚Ìê‡
if $game_temp.message_window_showing
return
end
# ƒQ[ƒ€ƒI[ƒo[‚Ìê‡
if $game_temp.gameover
# ƒQ[ƒ€ƒI[ƒo[‰æ–Ê‚ÉØ‚è‘Ö‚¦
$scene = Scene_Gameover.new
return
end
# ƒ^ƒCƒgƒ‹‰æ–Ê‚É–ß‚·ê‡
if $game_temp.to_title
# ƒ^ƒCƒgƒ‹‰æ–Ê‚ÉØ‚è‘Ö‚¦
$scene = Scene_Title.new
return
end
# ƒoƒgƒ‹’†’f‚Ìê‡
if $game_temp.battle_abort
# ƒoƒgƒ‹ŠJŽn‘O‚Ì BGM ‚É–ß‚·
$game_system.bgm_play($game_temp.map_bgm)
# ƒoƒgƒ‹I—¹
battle_end(1)
return
end
# ƒtƒF[ƒY‚É‚æ‚Á‚Ä•ªŠò
case @phase
when 0 # ATƒQ[ƒWXVƒtƒF[ƒY
if anime_wait_return
update_phase0
end
when 1 # ƒvƒŒƒoƒgƒ‹ƒtƒF[ƒY
update_phase1
return
when 2 # ƒp[ƒeƒBƒRƒ}ƒ“ƒhƒtƒF[ƒY
update_phase2
return
when 5 # ƒAƒtƒ^[ƒoƒgƒ‹ƒtƒF[ƒY
update_phase5
return
end
if $scene != self
return
end
if @phase == 0
if @command.size != 0 # ƒAƒNƒ^[ƒRƒ}ƒ“ƒhƒtƒF[ƒY
if @command_a == false
start_phase3
end
update_phase3
end
# ƒEƒFƒCƒg’†‚Ìê‡
if @wait_count > 0
# ƒEƒFƒCƒgƒJƒEƒ“ƒg‚ðŒ¸‚ç‚·
@wait_count -= 1
return
end
update_phase4
end
end
#==============================================================================
# ¡ Scene_Battle (•ªŠ„’è‹` 2)
#------------------------------------------------------------------------------
# @ƒoƒgƒ‹‰æ–ʂ̈—‚ðs‚¤ƒNƒ‰ƒX‚Å‚·B
#==============================================================================
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV (ATƒQ[ƒWXVƒtƒF[ƒY)
#--------------------------------------------------------------------------
def update_phase0
if $game_temp.battle_turn == 0
$game_temp.battle_turn = 1
end
# B ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽê‡
if @command_a == false and @party == false
if Input.trigger?(Input::B)
# ƒLƒƒƒ“ƒZƒ‹ SE ‚ð‰‰‘t
$game_system.se_play($data_system.cancel_se)
@party = true
end
end
if @party == true and @phase4_step == 1
# ƒp[ƒeƒBƒRƒ}ƒ“ƒhƒtƒF[ƒY‚Ö
start_phase2
return
end
# ATƒQ[ƒW‘‰Áˆ—
cnt = 0
for battler in $game_party.actors + $game_troop.enemies
active?(battler)
if battler.rtp == 0
if battler.at >= @max
if battler.is_a?(Game_Actor)
if battler.inputable?
unless @action_battlers.include?(battler) or
@command.include?(battler) or @escape == true
if battler.current_action.forcing
@action_battlers.push(battler)
else
@command.push(battler)
end
end
else
unless @action_battlers.include?(battler) or
battler == @command[0]
battler.current_action.clear
@command.delete(battler)
@action_battlers.push(battler)
end
end
else
unless @action_battlers.include?(battler)
number = cnt - $game_party.actors.size
enemy_action(number)
end
end
else
battler.at += battler.agi
if battler.guarding?
battler.at += battler.agi
end
if battler.movable?
battler.atp = 100 * battler.at / @max
end
end
else
if battler.rt >= battler.rtp
speller = synthe?(battler)
if speller != nil
battler = speller[0]
end
unless @action_battlers.include?(battler)
battler.rt = battler.rtp
@action_battlers.push(battler)
end
else
battler.rt += battler.agi
speller = synthe?(battler)
if speller != nil
for spell in speller
if spell != battler
spell.rt += battler.agi
end
end
end
end
end
cnt += 1
end
# ATƒQ[ƒW‚ðƒŠƒtƒŒƒbƒVƒ…
@status_window.at_refresh
# “¦‘–ˆ—
if @escape == true and @phase4_step == 1
temp = false
for battler in $game_party.actors
if battler.inputable?
temp = true
end
end
if temp == true
for battler in $game_party.actors
if battler.at < @max and battler.inputable?
temp = false
break
end
end
if temp == true
@escape = false
for battler in $game_party.actors
battler.at %= @max
end
$game_temp.battle_main_phase = false
update_phase2_escape
end
end
end
end
#--------------------------------------------------------------------------
# œ ƒp[ƒeƒBƒRƒ}ƒ“ƒhƒtƒF[ƒYŠJŽn
#--------------------------------------------------------------------------
def start_phase2
# ƒtƒF[ƒY 2 ‚ɈÚs
@phase = 2
@party = false
# ƒp[ƒeƒBƒRƒ}ƒ“ƒhƒEƒBƒ“ƒhƒE‚ð—LŒø‰»
@party_command_window.active = true
@party_command_window.visible = true
# ƒAƒNƒ^[‚ð”ñ‘I‘ðó‘Ô‚ÉÝ’è
@actor_index = -1
# ƒAƒNƒ^[ƒRƒ}ƒ“ƒhƒEƒBƒ“ƒhƒE‚𖳌ø‰»
@actor_command_window.active = false
@actor_command_window.visible = false
if @command.size != 0
# ƒAƒNƒ^[‚Ì–¾–ŃGƒtƒFƒNƒg OFF
if @active_actor != nil
@active_actor.blink = false
end
end
# ƒƒCƒ“ƒtƒF[ƒYƒtƒ‰ƒO‚ðƒNƒŠƒA
$game_temp.battle_main_phase = false
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV (ƒp[ƒeƒBƒRƒ}ƒ“ƒhƒtƒF[ƒY)
#--------------------------------------------------------------------------
def update_phase2
# C ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽê‡
if Input.trigger?(Input::C)
# ƒp[ƒeƒBƒRƒ}ƒ“ƒhƒEƒBƒ“ƒhƒE‚̃J[ƒƒ‹ˆÊ’u‚Å•ªŠò
case @party_command_window.index
when 0 # 키
# ƒp[ƒeƒBƒRƒ}ƒ“ƒhƒEƒBƒ“ƒhƒE‚𖳌ø‰»
@party_command_window.active = false
@party_command_window.visible = false
# Œˆ’è SE ‚ð‰‰‘t
$game_system.se_play($data_system.decision_se)
@escape = false
@phase = 0
if $game_temp.battle_turn == 0
$game_temp.battle_turn = 1
end
if @command_a == true
# ƒAƒNƒ^[ƒRƒ}ƒ“ƒhƒtƒF[ƒYŠJŽn
start_phase3
else
$game_temp.battle_main_phase = true
end
when 1 # “¦‚°‚é
# “¦‘–‰Â”‚Å‚Í‚È‚¢ê‡
if $game_temp.battle_can_escape == false
# ƒuƒU[ SE ‚ð‰‰‘t
$game_system.se_play($data_system.buzzer_se)
return
end
# Œˆ’è SE ‚ð‰‰‘t
$game_system.se_play($data_system.decision_se)
@phase = 0
# ƒp[ƒeƒBƒRƒ}ƒ“ƒhƒEƒBƒ“ƒhƒE‚𖳌ø‰»
@party_command_window.active = false
@party_command_window.visible = false
$game_temp.battle_main_phase = true
if $game_temp.battle_turn == 0
update_phase2_escape
$game_temp.battle_turn = 1
for battler in $game_party.actors
battler.at -= @max / 2
end
return
end
# Œˆ’è SE ‚ð‰‰‘t
$game_system.se_play($data_system.decision_se)
@escape = true
for battler in $game_party.actors
@command_a = false
@command.delete(battler)
@action_battlers.delete(battler)
skill_reset(battler)
end
end
return
end
end
#--------------------------------------------------------------------------
# œ ƒAƒtƒ^[ƒoƒgƒ‹ƒtƒF[ƒYŠJŽn
#--------------------------------------------------------------------------
def start_phase5
for actor in $game_party.actors
actor.victory = true
end
# ƒtƒF[ƒY 5 ‚ɈÚs
@phase = 5
# ƒoƒgƒ‹I—¹ ME ‚ð‰‰‘t
$game_system.me_play($game_system.battle_end_me)
# ƒoƒgƒ‹ŠJŽn‘O‚Ì BGM ‚É–ß‚·
$game_system.bgm_play($game_temp.map_bgm)
# EXPAƒS[ƒ‹ƒhAƒgƒŒƒWƒƒ[‚ð‰Šú‰»
exp = 0
gold = 0
treasures = []
if @active_actor != nil
@active_actor.blink = false
end
# ƒƒCƒ“ƒtƒF[ƒYƒtƒ‰ƒO‚ðƒZƒbƒg
$game_temp.battle_main_phase = true
# ƒp[ƒeƒBƒRƒ}ƒ“ƒhƒEƒBƒ“ƒhƒE‚𖳌ø‰»
@party_command_window.active = false
@party_command_window.visible = false
# ƒAƒNƒ^[ƒRƒ}ƒ“ƒhƒEƒBƒ“ƒhƒE‚𖳌ø‰»
@actor_command_window.active = false
@actor_command_window.visible = false
if @skill_window != nil
# ƒXƒLƒ‹ƒEƒBƒ“ƒhƒE‚ð‰ð•ú
@skill_window.dispose
@skill_window = nil
end
if @item_window != nil
# ƒAƒCƒeƒ€ƒEƒBƒ“ƒhƒE‚ð‰ð•ú
@item_window.dispose
@item_window = nil
end
# ƒwƒ‹ƒvƒEƒBƒ“ƒhƒE‚ð‰B‚·
@help_window.visible = false
# ƒ‹[ƒv
for enemy in $game_troop.enemies
# ƒGƒlƒ~[‚ª‰B‚êó‘Ô‚Å‚È‚¢ê‡
unless enemy.hidden
# Šl“¾ EXPAƒS[ƒ‹ƒh‚ð’ljÁ
exp += enemy.exp
gold += enemy.gold
# ƒgƒŒƒWƒƒ[oŒ»”»’è
if rand(100) < enemy.treasure_prob
if enemy.item_id > 0
treasures.push($data_items[enemy.item_id])
end
if enemy.weapon_id > 0
treasures.push($data_weapons[enemy.weapon_id])
end
if enemy.armor_id > 0
treasures.push($data_armors[enemy.armor_id])
end
end
end
end
# ƒgƒŒƒWƒƒ[‚Ì”‚ð 6 ŒÂ‚Ü‚Å‚ÉŒÀ’è
treasures = treasures[0..5]
# EXP Šl“¾
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
if actor.cant_get_exp? == false
last_level = actor.level
actor.exp += exp
if actor.level > last_level
@status_window.level_up(i)
end
end
end
# ƒS[ƒ‹ƒhŠl“¾
$game_party.gain_gold(gold)
# ƒgƒŒƒWƒƒ[Šl“¾
for item in treasures
case item
when RPG::Item
$game_party.gain_item(item.id, 1)
when RPG::Weapon
$game_party.gain_weapon(item.id, 1)
when RPG::Armor
$game_party.gain_armor(item.id, 1)
end
end
# ƒoƒgƒ‹ƒŠƒUƒ‹ƒgƒEƒBƒ“ƒhƒE‚ðì¬
@result_window = Window_BattleResult.new(exp, gold, treasures)
# ƒEƒFƒCƒgƒJƒEƒ“ƒg‚ðÝ’è
@phase5_wait_count = 100
end
#==============================================================================
# ¡ Scene_Battle (•ªŠ„’è‹` 3)
#------------------------------------------------------------------------------
# @ƒoƒgƒ‹‰æ–ʂ̈—‚ðs‚¤ƒNƒ‰ƒX‚Å‚·B
#==============================================================================
#--------------------------------------------------------------------------
# œ ƒAƒNƒ^[ƒRƒ}ƒ“ƒhƒtƒF[ƒYŠJŽn
#--------------------------------------------------------------------------
def start_phase3
# ƒƒCƒ“ƒtƒF[ƒYƒtƒ‰ƒO‚ðƒNƒŠƒA
$game_temp.battle_main_phase = false
@command_a = true
@active_actor = @command[0]
cnt = 0
for actor in $game_party.actors
if actor == @active_actor
@actor_index = cnt
end
cnt += 1
end
@active_actor.blink = true
unless @active_actor.inputable?
@active_actor.current_action.clear
phase3_next_actor
return
end
phase3_setup_command_window
end
#--------------------------------------------------------------------------
# œ ƒAƒNƒ^[‚̃Rƒ}ƒ“ƒh“ü—ÍI—¹
#--------------------------------------------------------------------------
def phase3_next_actor
@command.shift
@command_a = false
# ƒƒCƒ“ƒtƒF[ƒYƒtƒ‰ƒO‚ðƒZƒbƒg
$game_temp.battle_main_phase = true
# ƒAƒNƒ^[ƒRƒ}ƒ“ƒhƒEƒBƒ“ƒhƒE‚𖳌ø‰»
@actor_command_window.active = false
@actor_command_window.visible = false
# ƒAƒNƒ^[‚Ì–¾–ŃGƒtƒFƒNƒg OFF
if @active_actor != nil
@active_actor.blink = false
end
@action_battlers.push(@active_actor)
return
end
#--------------------------------------------------------------------------
# œ ƒGƒlƒ~[ƒAƒNƒVƒ‡ƒ“ì¬
#--------------------------------------------------------------------------
def enemy_action(number)
enemy = $game_troop.enemies[number]
unless enemy.current_action.forcing
enemy.make_action
end
@action_battlers.push(enemy)
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV (ƒAƒNƒ^[ƒRƒ}ƒ“ƒhƒtƒF[ƒY : Šî–{ƒRƒ}ƒ“ƒh)
#--------------------------------------------------------------------------
def update_phase3_basic_command
unless @active_actor.inputable?
@active_actor.current_action.clear
phase3_next_actor
return
end
# B ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽê‡
if Input.trigger?(Input::B) and @party == false
# ƒLƒƒƒ“ƒZƒ‹ SE ‚ð‰‰‘t
$game_system.se_play($data_system.cancel_se)
@party = true
end
if @party == true and @phase4_step == 1
# ƒp[ƒeƒBƒRƒ}ƒ“ƒhƒtƒF[ƒY‚Ö
start_phase2
return
end
# C ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽê‡
if Input.trigger?(Input::C)
@party = false
# ƒAƒNƒ^[ƒRƒ}ƒ“ƒhƒEƒBƒ“ƒhƒE‚̃J[ƒƒ‹ˆÊ’u‚Å•ªŠò
case @actor_command_window.index
when 0 # UŒ‚
if fin?
# ƒuƒU[ SE ‚ð‰‰‘t
$game_system.se_play($data_system.buzzer_se)
return
end
# Œˆ’è SE ‚ð‰‰‘t
$game_system.se_play($data_system.decision_se)
# ƒGƒlƒ~[‚Ì‘I‘ð‚ðŠJŽn
start_enemy_select
when 1 # ƒXƒLƒ‹
# Œˆ’è SE ‚ð‰‰‘t
$game_system.se_play($data_system.decision_se)
# ƒXƒLƒ‹‚Ì‘I‘ð‚ðŠJŽn
start_skill_select
when 2 # –hŒä
# Œˆ’è SE ‚ð‰‰‘t
$game_system.se_play($data_system.decision_se)
# ƒAƒNƒVƒ‡ƒ“‚ðÝ’è
@active_actor.current_action.kind = 0
@active_actor.current_action.basic = 1
# ŽŸ‚̃AƒNƒ^[‚̃Rƒ}ƒ“ƒh“ü—Í‚Ö
phase3_next_actor
when 3 # ƒAƒCƒeƒ€
# Œˆ’è SE ‚ð‰‰‘t
$game_system.se_play($data_system.decision_se)
# ƒAƒCƒeƒ€‚Ì‘I‘ð‚ðŠJŽn
start_item_select
end
return
end
# R ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽê‡
if Input.trigger?(Input::R)
$game_system.se_play($data_system.cursor_se)
@party = false
# ƒAƒNƒ^[‚Ì–¾–ŃGƒtƒFƒNƒg OFF
if @active_actor != nil
@active_actor.blink = false
end
@command.push(@command[0])
@command.shift
@command_a = false
# ƒƒCƒ“ƒtƒF[ƒYƒtƒ‰ƒO‚ðƒZƒbƒg
$game_temp.battle_main_phase = true
# ƒAƒNƒ^[ƒRƒ}ƒ“ƒhƒEƒBƒ“ƒhƒE‚𖳌ø‰»
@actor_command_window.active = false
@actor_command_window.visible = false
end
# L ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽê‡
if Input.trigger?(Input::L)
$game_system.se_play($data_system.cursor_se)
@party = false
# ƒAƒNƒ^[‚Ì–¾–ŃGƒtƒFƒNƒg OFF
if @active_actor != nil
@active_actor.blink = false
end
@command.unshift(@command[@command.size - 1])
@command.delete_at(@command.size - 1)
@command_a = false
# ƒƒCƒ“ƒtƒF[ƒYƒtƒ‰ƒO‚ðƒZƒbƒg
$game_temp.battle_main_phase = true
# ƒAƒNƒ^[ƒRƒ}ƒ“ƒhƒEƒBƒ“ƒhƒE‚𖳌ø‰»
@actor_command_window.active = false
@actor_command_window.visible = false
end
# ‰E ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽê‡
if Input.trigger?(Input::RIGHT)
$game_system.se_play($data_system.cursor_se)
@party = false
# ƒAƒNƒ^[‚Ì–¾–ŃGƒtƒFƒNƒg OFF
if @active_actor != nil
@active_actor.blink = false
end
actor = $game_party.actors[@actor_index]
while actor == @command[0] or (not @command.include?(actor))
@actor_index += 1
actor = $game_party.actors[@actor_index]
if actor == nil
@actor_index = 0
actor = $game_party.actors[@actor_index]
end
if actor == @command[0]
break
end
end
while actor != @command[0]
@command.push(@command[0])
@command.shift
end
@command_a = false
# ƒƒCƒ“ƒtƒF[ƒYƒtƒ‰ƒO‚ðƒZƒbƒg
$game_temp.battle_main_phase = true
# ƒAƒNƒ^[ƒRƒ}ƒ“ƒhƒEƒBƒ“ƒhƒE‚𖳌ø‰»
@actor_command_window.active = false
@actor_command_window.visible = false
end
# ¶ ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽê‡
if Input.trigger?(Input::LEFT)
$game_system.se_play($data_system.cursor_se)
@party = false
# ƒAƒNƒ^[‚Ì–¾–ŃGƒtƒFƒNƒg OFF
if @active_actor != nil
@active_actor.blink = false
end
actor = $game_party.actors[@actor_index]
while actor == @command[0] or (not @command.include?(actor))
@actor_index -= 1
actor = $game_party.actors[@actor_index]
if actor == nil
@actor_index = $game_party.actors.size - 1
actor = $game_party.actors[@actor_index]
end
if actor == @command[0]
break
end
end
while actor != @command[0]
@command.push(@command[0])
@command.shift
end
@command_a = false
# ƒƒCƒ“ƒtƒF[ƒYƒtƒ‰ƒO‚ðƒZƒbƒg
$game_temp.battle_main_phase = true
# ƒAƒNƒ^[ƒRƒ}ƒ“ƒhƒEƒBƒ“ƒhƒE‚𖳌ø‰»
@actor_command_window.active = false
@actor_command_window.visible = false
end
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV (ƒAƒNƒ^[ƒRƒ}ƒ“ƒhƒtƒF[ƒY : ƒXƒLƒ‹‘I‘ð)
#--------------------------------------------------------------------------
def update_phase3_skill_select
# ƒRƒ}ƒ“ƒh‘I‘𒆂És“®•s”‚É‚È‚Á‚½ê‡
unless @active_actor.inputable?
@active_actor.current_action.clear
command_delete
# ŽŸ‚̃AƒNƒ^[‚̃Rƒ}ƒ“ƒh“ü—Í‚Ö
phase3_next_actor
return
end
# ƒXƒLƒ‹ƒEƒBƒ“ƒhƒE‚ð‰ÂŽ‹ó‘Ô‚É‚·‚é
@skill_window.visible = true
# ƒXƒLƒ‹ƒEƒBƒ“ƒhƒE‚ðXV
@skill_window.update
# B ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽê‡
if Input.trigger?(Input::B)
# ƒLƒƒƒ“ƒZƒ‹ SE ‚ð‰‰‘t
$game_system.se_play($data_system.cancel_se)
# ƒXƒLƒ‹‚Ì‘I‘ð‚ðI—¹
end_skill_select
return
end
# C ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽê‡
if Input.trigger?(Input::C)
# ƒXƒLƒ‹ƒEƒBƒ“ƒhƒE‚ÅŒ»Ý‘I‘ð‚³‚ê‚Ä‚¢‚éƒf[ƒ^‚ðŽæ“¾
@skill = @skill_window.skill
# Žg—p‚Å‚«‚È‚¢ê‡
if @skill == nil or not @active_actor.skill_can_use?(@skill.id)
# ƒuƒU[ SE ‚ð‰‰‘t
$game_system.se_play($data_system.buzzer_se)
return
end
if @skill.scope == 1 or @skill.scope == 2
if fin?
# ƒuƒU[ SE ‚ð‰‰‘t
$game_system.se_play($data_system.buzzer_se)
return
end
end
# Œˆ’è SE ‚ð‰‰‘t
$game_system.se_play($data_system.decision_se)
# ƒAƒNƒVƒ‡ƒ“‚ðÝ’è
@active_actor.current_action.skill_id = @skill.id
# ƒXƒLƒ‹ƒEƒBƒ“ƒhƒE‚ð•s‰ÂŽ‹ó‘Ô‚É‚·‚é
@skill_window.visible = false
# Œø‰Ê”͈͂ª“G’P‘Ì‚Ìê‡
if @skill.scope == 1
# ƒGƒlƒ~[‚Ì‘I‘ð‚ðŠJŽn
start_enemy_select
# Œø‰Ê”͈͂ª–¡•û’P‘Ì‚Ìê‡
elsif @skill.scope == 3 or @skill.scope == 5
# ƒAƒNƒ^[‚Ì‘I‘ð‚ðŠJŽn
start_actor_select
# Œø‰Ê”͈͂ª’P‘Ì‚Å‚Í‚È‚¢ê‡
else
# ƒAƒNƒVƒ‡ƒ“‚ðÝ’è
@active_actor.current_action.kind = 1
# ƒXƒLƒ‹‚Ì‘I‘ð‚ðI—¹
end_skill_select
# ŽŸ‚̃AƒNƒ^[‚̃Rƒ}ƒ“ƒh“ü—Í‚Ö
phase3_next_actor
end
return
end
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV (ƒAƒNƒ^[ƒRƒ}ƒ“ƒhƒtƒF[ƒY : ƒAƒCƒeƒ€‘I‘ð)
#--------------------------------------------------------------------------
def update_phase3_item_select
# ƒRƒ}ƒ“ƒh‘I‘𒆂És“®•s”‚É‚È‚Á‚½ê‡
unless @active_actor.inputable?
@active_actor.current_action.clear
command_delete
# ŽŸ‚̃AƒNƒ^[‚̃Rƒ}ƒ“ƒh“ü—Í‚Ö
phase3_next_actor
return
end
# ƒAƒCƒeƒ€ƒEƒBƒ“ƒhƒE‚ð‰ÂŽ‹ó‘Ô‚É‚·‚é
@item_window.visible = true
# ƒAƒCƒeƒ€ƒEƒBƒ“ƒhƒE‚ðXV
@item_window.update
# B ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽê‡
if Input.trigger?(Input::B)
# ƒLƒƒƒ“ƒZƒ‹ SE ‚ð‰‰‘t
$game_system.se_play($data_system.cancel_se)
# ƒAƒCƒeƒ€‚Ì‘I‘ð‚ðI—¹
end_item_select
return
end
# C ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽê‡
if Input.trigger?(Input::C)
# ƒAƒCƒeƒ€ƒEƒBƒ“ƒhƒE‚ÅŒ»Ý‘I‘ð‚³‚ê‚Ä‚¢‚éƒf[ƒ^‚ðŽæ“¾
@item = @item_window.item
# Žg—p‚Å‚«‚È‚¢ê‡
unless $game_party.item_can_use?(@item.id)
# ƒuƒU[ SE ‚ð‰‰‘t
$game_system.se_play($data_system.buzzer_se)
return
end
if @item.scope == 1 or @item.scope == 2
if fin?
# ƒuƒU[ SE ‚ð‰‰‘t
$game_system.se_play($data_system.buzzer_se)
return
end
end
# Œˆ’è SE ‚ð‰‰‘t
$game_system.se_play($data_system.decision_se)
# ƒAƒNƒVƒ‡ƒ“‚ðÝ’è
@active_actor.current_action.item_id = @item.id
# ƒAƒCƒeƒ€ƒEƒBƒ“ƒhƒE‚ð•s‰ÂŽ‹ó‘Ô‚É‚·‚é
@item_window.visible = false
# Œø‰Ê”͈͂ª“G’P‘Ì‚Ìê‡
if @item.scope == 1
# ƒGƒlƒ~[‚Ì‘I‘ð‚ðŠJŽn
start_enemy_select
# Œø‰Ê”͈͂ª–¡•û’P‘Ì‚Ìê‡
elsif @item.scope == 3 or @item.scope == 5
# ƒAƒNƒ^[‚Ì‘I‘ð‚ðŠJŽn
start_actor_select
# Œø‰Ê”͈͂ª’P‘Ì‚Å‚Í‚È‚¢ê‡
else
# ƒAƒNƒVƒ‡ƒ“‚ðÝ’è
@active_actor.current_action.kind = 2
# ƒAƒCƒeƒ€‚Ì‘I‘ð‚ðI—¹
end_item_select
# ŽŸ‚̃AƒNƒ^[‚̃Rƒ}ƒ“ƒh“ü—Í‚Ö
phase3_next_actor
end
return
end
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV (ƒAƒNƒ^[ƒRƒ}ƒ“ƒhƒtƒF[ƒY : ƒGƒlƒ~[‘I‘ð)
#--------------------------------------------------------------------------
def update_phase3_enemy_select
if fin?
# ƒGƒlƒ~[‚Ì‘I‘ð‚ðI—¹
end_enemy_select
return
end
# ƒRƒ}ƒ“ƒh‘I‘𒆂És“®•s”‚É‚È‚Á‚½ê‡
unless @active_actor.inputable?
@active_actor.current_action.clear
command_delete
# ŽŸ‚̃AƒNƒ^[‚̃Rƒ}ƒ“ƒh“ü—Í‚Ö
phase3_next_actor
return
end
# ƒGƒlƒ~[ƒAƒ[‚ðXV
@enemy_arrow.update
# B ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽê‡
if Input.trigger?(Input::B)
# ƒLƒƒƒ“ƒZƒ‹ SE ‚ð‰‰‘t
$game_system.se_play($data_system.cancel_se)
# ƒGƒlƒ~[‚Ì‘I‘ð‚ðI—¹
end_enemy_select
return
end
# C ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽê‡
if Input.trigger?(Input::C)
# Œˆ’è SE ‚ð‰‰‘t
$game_system.se_play($data_system.decision_se)
# ƒAƒNƒVƒ‡ƒ“‚ðÝ’è
@active_actor.current_action.kind = 0
@active_actor.current_action.basic = 0
@active_actor.current_action.target_index = @enemy_arrow.index
# ƒGƒlƒ~[‚Ì‘I‘ð‚ðI—¹
end_enemy_select
# ƒXƒLƒ‹ƒEƒBƒ“ƒhƒE•Ž¦’†‚Ìê‡
if @skill_window != nil
# ƒAƒNƒVƒ‡ƒ“‚ðÄÝ’è
@active_actor.current_action.kind = 1
# ƒXƒLƒ‹‚Ì‘I‘ð‚ðI—¹
end_skill_select
end
# ƒAƒCƒeƒ€ƒEƒBƒ“ƒhƒE•Ž¦’†‚Ìê‡
if @item_window != nil
# ƒAƒNƒVƒ‡ƒ“‚ðÄÝ’è
@active_actor.current_action.kind = 2
# ƒAƒCƒeƒ€‚Ì‘I‘ð‚ðI—¹
end_item_select
end
# ŽŸ‚̃AƒNƒ^[‚̃Rƒ}ƒ“ƒh“ü—Í‚Ö
phase3_next_actor
end
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV (ƒAƒNƒ^[ƒRƒ}ƒ“ƒhƒtƒF[ƒY : ƒAƒNƒ^[‘I‘ð)
#--------------------------------------------------------------------------
def update_phase3_actor_select
# ƒRƒ}ƒ“ƒh‘I‘𒆂És“®•s”‚É‚È‚Á‚½ê‡
unless @active_actor.inputable?
@active_actor.current_action.clear
command_delete
# ŽŸ‚̃AƒNƒ^[‚̃Rƒ}ƒ“ƒh“ü—Í‚Ö
phase3_next_actor
return
end
# ƒAƒNƒ^[ƒAƒ[‚ðXV
@actor_arrow.update
# B ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽê‡
if Input.trigger?(Input::B)
# ƒLƒƒƒ“ƒZƒ‹ SE ‚ð‰‰‘t
$game_system.se_play($data_system.cancel_se)
# ƒAƒNƒ^[‚Ì‘I‘ð‚ðI—¹
end_actor_select
return
end
# C ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽê‡
if Input.trigger?(Input::C)
# Œˆ’è SE ‚ð‰‰‘t
$game_system.se_play($data_system.decision_se)
# ƒAƒNƒVƒ‡ƒ“‚ðÝ’è
@active_actor.current_action.kind = 0
@active_actor.current_action.basic = 0
@active_actor.current_action.target_index = @actor_arrow.index
# ƒAƒNƒ^[‚Ì‘I‘ð‚ðI—¹
end_actor_select
# ƒXƒLƒ‹ƒEƒBƒ“ƒhƒE•Ž¦’†‚Ìê‡
if @skill_window != nil
# ƒAƒNƒVƒ‡ƒ“‚ðÄÝ’è
@active_actor.current_action.kind = 1
# ƒXƒLƒ‹‚Ì‘I‘ð‚ðI—¹
end_skill_select
end
# ƒAƒCƒeƒ€ƒEƒBƒ“ƒhƒE•Ž¦’†‚Ìê‡
if @item_window != nil
# ƒAƒNƒVƒ‡ƒ“‚ðÄÝ’è
@active_actor.current_action.kind = 2
# ƒAƒCƒeƒ€‚Ì‘I‘ð‚ðI—¹
end_item_select
end
# ŽŸ‚̃AƒNƒ^[‚̃Rƒ}ƒ“ƒh“ü—Í‚Ö
phase3_next_actor
end
end
#--------------------------------------------------------------------------
# œ ƒXƒLƒ‹‘I‘ðŠJŽn
#--------------------------------------------------------------------------
def start_skill_select
# ƒXƒLƒ‹ƒEƒBƒ“ƒhƒE‚ðì¬
@skill_window = Window_Skill.new(@active_actor)
# ƒwƒ‹ƒvƒEƒBƒ“ƒhƒE‚ðŠÖ˜A•t‚¯
@skill_window.help_window = @help_window
# ƒAƒNƒ^[ƒRƒ}ƒ“ƒhƒEƒBƒ“ƒhƒE‚𖳌ø‰»
@actor_command_window.active = false
@actor_command_window.visible = false
end
#==============================================================================
# ¡ Scene_Battle (•ªŠ„’è‹` 4)
#------------------------------------------------------------------------------
# @ƒoƒgƒ‹‰æ–ʂ̈—‚ðs‚¤ƒNƒ‰ƒX‚Å‚·B
#==============================================================================
#--------------------------------------------------------------------------
# œ ƒƒCƒ“ƒtƒF[ƒYŠJŽn
#--------------------------------------------------------------------------
def start_phase4
$game_temp.battle_main_phase = true
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV (ƒƒCƒ“ƒtƒF[ƒY ƒXƒeƒbƒv 1 : ƒAƒNƒVƒ‡ƒ“€”õ)
#--------------------------------------------------------------------------
def update_phase4_step1
# Ÿ”s”»’è
if judge
# Ÿ—˜‚Ü‚½‚Í”s–k‚Ìê‡ : ƒƒƒbƒhI—¹
return
end
# ƒAƒNƒVƒ‡ƒ“‚ð‹§‚³‚ê‚Ä‚¢‚éƒoƒgƒ‰[‚ª‘¶Ý‚µ‚È‚¢ê‡
if $game_temp.forcing_battler == nil
# ƒoƒgƒ‹ƒCƒxƒ“ƒg‚ðƒZƒbƒgƒAƒbƒv
setup_battle_event
# ƒoƒgƒ‹ƒCƒxƒ“ƒgŽÀs’†‚Ìê‡
if $game_system.battle_interpreter.running?
return
end
end
# ƒAƒNƒVƒ‡ƒ“‚ð‹§‚³‚ê‚Ä‚¢‚éƒoƒgƒ‰[‚ª‘¶Ý‚·‚éê‡
if $game_temp.forcing_battler != nil
# 擪‚ɒljÁ‚Ü‚½‚͈ړ®
battler = $game_temp.forcing_battler
@action_battlers.delete(battler)
@action_battlers.unshift(battler)
battler.at = @max
battler.atp = 100 * battler.at / @max
end
# –¢s“®ƒoƒgƒ‰[‚ª‘¶Ý‚µ‚È‚¢ê‡ (‘Sˆõs“®‚µ‚½)
if @action_battlers.size == 0
return
end
# ƒAƒjƒ[ƒVƒ‡ƒ“ ID ‚¨‚æ‚уRƒ‚ƒ“ƒCƒxƒ“ƒg ID ‚ð‰Šú‰»
@animation1_id = 0
@animation2_id = 0
@common_event_id = 0
# –¢s“®ƒoƒgƒ‰[”z—ñ‚Ì擪‚©‚çƒVƒtƒg
@active_battler = @action_battlers[0]
# ‚·‚Å‚É퓬‚©‚çŠO‚³‚ê‚Ä‚¢‚éê‡
if @active_battler.index == nil
@action_battlers.shift
anime_wait_return
return
end
# s“®‰Â”‚©‚Ç‚¤‚©”»’è
unless active?(@active_battler)
unless @active_battler.inputable?
@phase4_step = 6
return
end
end
# ƒXƒLƒ‹Žg—pŽžA‰r¥ŽžŠÔÝ’è
# ‹§ƒAƒNƒVƒ‡ƒ“‚©‚ @force ‚ª 2 ‚ÌŽž‚̓XƒLƒ‹‚𑦎ž”“®
if @active_battler.current_action.kind == 1 and
(not @active_battler.current_action.forcing or @force < 2)
if @active_battler.rtp == 0
# ƒXƒLƒ‹‰r¥’†‚È‚ç‚ÎA‰ðœ
skill_reset(@active_battler)
# ƒXƒLƒ‹‰r¥ŽžŠÔÝ’è
recite_time(@active_battler)
# ’P“ƂŃXƒLƒ‹‚ð‰r¥‚·‚éꇃAƒNƒVƒ‡ƒ“‚©‚çƒoƒgƒ‰[‚ðÁ‹Ž
if @active_battler.rtp > 0
@action_battlers.shift
end
# ˜AŒg‹ZÝ’è
synthe_spell(@active_battler)
# ƒXƒLƒ‹‚ð‰r¥‚·‚éê‡
# ‹§ƒAƒNƒVƒ‡ƒ“‚©‚ @force ‚ª 1 ‚ÌŽž‚͘AŒgƒXƒLƒ‹‚Ì‚Ý‘¦Žž”“®
if @active_battler.rtp > 0 and
(not @active_battler.current_action.forcing or
(@force < 1 or not synthe?(@active_battler)))
@active_battler.blink = true
anime_wait_return
if @active_battler.current_action.forcing
$game_temp.forcing_battler = nil
@active_battler.current_action.forcing = false
end
return
end
end
end
# ƒAƒNƒ^[‚Ì–¾–ŃGƒtƒFƒNƒg OFF
if @active_battler != nil
@active_battler.blink = false
end
# ƒXƒeƒbƒv 2 ‚ɈÚs
@phase4_step = 2
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV (ƒƒCƒ“ƒtƒF[ƒY ƒXƒeƒbƒv 2 : ƒAƒNƒVƒ‡ƒ“ŠJŽn)
#--------------------------------------------------------------------------
def update_phase4_step2
# ‹§ƒAƒNƒVƒ‡ƒ“‚Å‚È‚¯‚ê‚Î
unless @active_battler.current_action.forcing
# §–ñ‚ª [“G‚ð’ÊíUŒ‚‚·‚é] ‚© [–¡•û‚ð’ÊíUŒ‚‚·‚é] ‚Ìê‡
if @active_battler.restriction == 2 or @active_battler.restriction == 3
# ƒAƒNƒVƒ‡ƒ“‚ÉUŒ‚‚ðÝ’è
@active_battler.current_action.kind = 0
@active_battler.current_action.basic = 0
end
end
# ‘ÎÛƒoƒgƒ‰[‚ðƒNƒŠƒA
@target_battlers = []
# ƒAƒNƒVƒ‡ƒ“‚ÌŽí•Ê‚Å•ªŠò
case @active_battler.current_action.kind
when 0 # Šî–{
make_basic_action_result
when 1 # ƒXƒLƒ‹
make_skill_action_result
when 2 # ƒAƒCƒeƒ€
make_item_action_result
end
# ƒXƒeƒbƒv 3 ‚ɈÚs
if @phase4_step == 2
@phase4_step = 3
end
end
#--------------------------------------------------------------------------
# œ Šî–{ƒAƒNƒVƒ‡ƒ“ Œ‹‰Êì¬
#--------------------------------------------------------------------------
def make_basic_action_result
# UŒ‚‚Ìê‡
if @active_battler.current_action.basic == 0
# ƒAƒjƒ[ƒVƒ‡ƒ“ ID ‚ðÝ’è
@animation1_id = @active_battler.animation1_id
@animation2_id = @active_battler.animation2_id
# s“®‘¤ƒoƒgƒ‰[‚ªƒGƒlƒ~[‚Ìê‡
if @active_battler.is_a?(Game_Enemy)
if @active_battler.restriction == 3
target = $game_troop.random_target_enemy
elsif @active_battler.restriction == 2
target = $game_party.random_target_actor
else
index = @active_battler.current_action.target_index
target = $game_party.smooth_target_actor(index)
end
end
# s“®‘¤ƒoƒgƒ‰[‚ªƒAƒNƒ^[‚Ìê‡
if @active_battler.is_a?(Game_Actor)
if @active_battler.restriction == 3
target = $game_party.random_target_actor
elsif @active_battler.restriction == 2
target = $game_troop.random_target_enemy
else
index = @active_battler.current_action.target_index
target = $game_troop.smooth_target_enemy(index)
end
end
# ‘ÎÛ‘¤ƒoƒgƒ‰[‚Ì”z—ñ‚ðÝ’è
@target_battlers = [target]
# ’ÊíUŒ‚‚ÌŒø‰Ê‚ð“K—p
for target in @target_battlers
target.attack_effect(@active_battler)
end
return
end
# –hŒä‚Ìê‡
if @active_battler.current_action.basic == 1
# ƒwƒ‹ƒvƒEƒBƒ“ƒhƒE‚É "–hŒä" ‚𕎦
@help_window.set_text($data_system.words.guard, 1)
return
end
# “¦‚°‚é‚Ìê‡
if @active_battler.is_a?(Game_Enemy) and
@active_battler.current_action.basic == 2
# ƒwƒ‹ƒvƒEƒBƒ“ƒhƒE‚É "“¦‚°‚é" ‚𕎦
@help_window.set_text("“¦‚°‚é", 1)
# “¦‚°‚é
@active_battler.escape
return
end
# ‰½‚à‚µ‚È‚¢‚Ìê‡
if @active_battler.current_action.basic == 3
# ƒAƒNƒVƒ‡ƒ“‹§‘Îۂ̃oƒgƒ‰[‚ðƒNƒŠƒA
$game_temp.forcing_battler = nil
# ƒXƒeƒbƒv 6 ‚ɈÚs
@phase4_step = 6
return
end
end
#--------------------------------------------------------------------------
# œ ƒXƒLƒ‹ƒAƒNƒVƒ‡ƒ“ Œ‹‰Êì¬
#--------------------------------------------------------------------------
def make_skill_action_result
# ƒXƒLƒ‹‚ðŽæ“¾
@skill = $data_skills[@active_battler.current_action.skill_id]
# ˜AŒgƒXƒLƒ‹‚Å‚ ‚é‚©‚Ç‚¤‚©Šm”F
speller = synthe?(@active_battler)
# ‹§ƒAƒNƒVƒ‡ƒ“‚Å‚È‚¯‚ê‚Î
unless @active_battler.current_action.forcing
# SP Ø‚ê‚È‚Ç‚ÅŽg—p‚Å‚«‚È‚‚È‚Á‚½ê‡
if speller != nil
for battler in speller
if battler.current_action.spell_id == 0
unless battler.skill_can_use?(@skill.id)
$game_temp.forcing_battler = nil
@phase4_step = 6
return
end
else
unless battler.skill_can_use?(battler.current_action.spell_id)
$game_temp.forcing_battler = nil
@phase4_step = 6
return
end
end
end
else
unless @active_battler.skill_can_use?(@skill.id)
# ƒAƒNƒVƒ‡ƒ“‹§‘Îۂ̃oƒgƒ‰[‚ðƒNƒŠƒA
$game_temp.forcing_battler = nil
# ƒXƒeƒbƒv 6 ‚ɈÚs
@phase4_step = 6
return
end
end
end
# SP Á”ï
temp = false
if speller != nil
for battler in speller
if battler.current_action.spell_id == 0
battler.sp -= @skill.sp_cost
else
battler.sp -= $data_skills[battler.current_action.spell_id].sp_cost
end
end
else
@active_battler.sp -= @skill.sp_cost
end
# ƒXƒe[ƒ^ƒXƒEƒBƒ“ƒhƒE‚ðƒŠƒtƒŒƒbƒVƒ…
@status_window.refresh
# ƒwƒ‹ƒvƒEƒBƒ“ƒhƒE‚ɃXƒLƒ‹–¼‚𕎦
@help_window.set_text(@skill.name, 1)
# ƒAƒjƒ[ƒVƒ‡ƒ“ ID ‚ðÝ’è
@animation1_id = @skill.animation1_id
@animation2_id = @skill.animation2_id
# ƒRƒ‚ƒ“ƒCƒxƒ“ƒg ID ‚ðÝ’è
@common_event_id = @skill.common_event_id
# ‘ÎÛ‘¤ƒoƒgƒ‰[‚ðÝ’è
set_target_battlers(@skill.scope)
# ƒXƒLƒ‹‚ÌŒø‰Ê‚ð“K—p
for target in @target_battlers
if speller != nil
damage = 0
effective = false
for battler in speller
if battler.current_action.spell_id != 0
@skill = $data_skills[battler.current_action.spell_id]
end
effective |= target.skill_effect(battler, @skill)
if target.damage.class != String
damage += target.damage
elsif effective == true
effect = target.damage
end
end
if damage != 0
target.damage = damage
elsif effective = true
target.damage = effect
end
else
target.skill_effect(@active_battler, @skill)
end
end
end
#--------------------------------------------------------------------------
# œ ƒAƒCƒeƒ€ƒAƒNƒVƒ‡ƒ“ Œ‹‰Êì¬
#--------------------------------------------------------------------------
def make_item_action_result
# ƒAƒCƒeƒ€‚ðŽæ“¾
@item = $data_items[@active_battler.current_action.item_id]
# ƒAƒCƒeƒ€Ø‚ê‚È‚Ç‚ÅŽg—p‚Å‚«‚È‚‚È‚Á‚½ê‡
unless $game_party.item_can_use?(@item.id)
# ƒXƒeƒbƒv 6 ‚ɈÚs
@phase4_step = 6
return
end
# Á–Õ•i‚Ìê‡
if @item.consumable
# Žg—p‚µ‚½ƒAƒCƒeƒ€‚ð 1 Œ¸‚ç‚·
$game_party.lose_item(@item.id, 1)
end
# ƒwƒ‹ƒvƒEƒBƒ“ƒhƒE‚ɃAƒCƒeƒ€–¼‚𕎦
@help_window.set_text(@item.name, 1)
# ƒAƒjƒ[ƒVƒ‡ƒ“ ID ‚ðÝ’è
@animation1_id = @item.animation1_id
@animation2_id = @item.animation2_id
# ƒRƒ‚ƒ“ƒCƒxƒ“ƒg ID ‚ðÝ’è
@common_event_id = @item.common_event_id
# ‘ÎÛ‚ðŒˆ’è
index = @active_battler.current_action.target_index
target = $game_party.smooth_target_actor(index)
# ‘ÎÛ‘¤ƒoƒgƒ‰[‚ðÝ’è
set_target_battlers(@item.scope)
# ƒAƒCƒeƒ€‚ÌŒø‰Ê‚ð“K—p
for target in @target_battlers
target.item_effect(@item)
end
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV (ƒƒCƒ“ƒtƒF[ƒY ƒXƒeƒbƒv 3 : s“®‘¤ƒAƒjƒ[ƒVƒ‡ƒ“)
#--------------------------------------------------------------------------
def update_phase4_step3
# s“®‘¤ƒAƒjƒ[ƒVƒ‡ƒ“ (ID ‚ª 0 ‚Ìꇂ͔’ƒtƒ‰ƒbƒVƒ…)
if @animation1_id == 0
if (@active_battler.current_action.basic == 0) and
(@active_battler.current_action.kind == 0)
@active_battler.attack = true
end
@wait_count = 5
else
if (@active_battler.current_action.basic == 0) and
(@active_battler.current_action.kind == 0)
@active_battler.attack = true
elsif @active_battler.current_action.kind == 2
@active_battler.item = true
else
@active_battler.skill = true
end
@active_battler.animation_id = @animation1_id
@active_battler.animation_hit = true
speller = synthe?(@active_battler)
if speller != nil
for battler in speller
if battler != @active_battler
if battler.current_action.spell_id == 0
battler.animation_id = @animation1_id
battler.animation_hit = true
else
spell = battler.current_action.spell_id
battler.animation_id = $data_skills[spell].animation1_id
battler.animation_hit = true
battler.current_action.spell_id = 0
end
end
end
end
@wait_count = 2 * $data_animations[@animation1_id].frame_max - 10
end
# ƒXƒeƒbƒv 4 ‚ɈÚs
@phase4_step = 4
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV (ƒƒCƒ“ƒtƒF[ƒY ƒXƒeƒbƒv 4 : ‘ÎÛ‘¤ƒAƒjƒ[ƒVƒ‡ƒ“)
#--------------------------------------------------------------------------
def update_phase4_step4
# ‘ÎÛ‘¤ƒAƒjƒ[ƒVƒ‡ƒ“
for target in @target_battlers
target.animation_id = @animation2_id
target.animation_hit = (target.damage != "Miss")
unless @animation2_id == 0
@wait_count = 2 * $data_animations[@animation2_id].frame_max - 10
end
end
# ƒXƒeƒbƒv 5 ‚ɈÚs
@phase4_step = 5
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV (ƒƒCƒ“ƒtƒF[ƒY ƒXƒeƒbƒv 5 : ƒ_ƒ[ƒW•Ž¦)
#--------------------------------------------------------------------------
def update_phase4_step5
# ƒwƒ‹ƒvƒEƒBƒ“ƒhƒE‚ð‰B‚·
@help_window.visible = false
# ƒ_ƒ[ƒW•Ž¦
for target in @target_battlers
if target.damage != nil
target.damage_pop = true
target.damage_effect(@active_battler.current_action.kind)
@wait_count = @damage_wait
end
end
# ƒXƒe[ƒ^ƒXƒEƒBƒ“ƒhƒE‚ðƒŠƒtƒŒƒbƒVƒ…
@status_window.refresh
# ƒXƒeƒbƒv 6 ‚ɈÚs
@phase4_step = 6
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV (ƒƒCƒ“ƒtƒF[ƒY ƒXƒeƒbƒv 6 : ƒŠƒtƒŒƒbƒVƒ…)
#--------------------------------------------------------------------------
def update_phase4_step6
# ƒAƒNƒVƒ‡ƒ“‹§‘Îۂ̃oƒgƒ‰[‚ðƒNƒŠƒA
$game_temp.forcing_battler = nil
@active_battler.current_action.forcing = false
refresh_phase(@active_battler)
@action_battlers.shift
unless @active_battler.movable?
# ƒXƒeƒbƒv 1 ‚ɈÚs
@phase4_step = 1
return
end
speller = synthe?(@active_battler)
if speller != nil
for battler in speller
if battler != @active_battler
refresh_phase(battler)
end
end
synthe_delete(speller)
end
# ƒXƒe[ƒ^ƒXƒEƒBƒ“ƒhƒE‚ðƒŠƒtƒŒƒbƒVƒ…
@status_window.refresh
# ƒRƒ‚ƒ“ƒCƒxƒ“ƒg ID ‚ª—LŒø‚Ìê‡
if @common_event_id > 0
# ƒCƒxƒ“ƒg‚ðƒZƒbƒgƒAƒbƒv
common_event = $data_common_events[@common_event_id]
$game_system.battle_interpreter.setup(common_event.list, 0)
end
act = 0
for battler in $game_party.actors + $game_troop.enemies
if battler.movable?
act += 1
end
end
if @turn_cnt >= act
@turn_cnt %= act
$game_temp.battle_turn += 1
# ƒoƒgƒ‹ƒCƒxƒ“ƒg‚Ì‘Sƒy[ƒW‚ðŒŸõ
for index in 0...$data_troops[@troop_id].pages.size
# ƒCƒxƒ“ƒgƒy[ƒW‚ðŽæ“¾
page = $data_troops[@troop_id].pages[index]
# ‚±‚̃y[ƒW‚̃Xƒpƒ“‚ª [ƒ^[ƒ“] ‚Ìê‡
if page.span == 1
# ŽÀsς݃tƒ‰ƒO‚ðƒNƒŠƒA
$game_temp.battle_event_flags[index] = false
end
end
end
# ƒXƒeƒbƒv 1 ‚ɈÚs
@phase4_step = 1
end
#--------------------------------------------------------------------------
# œ ƒŠƒtƒŒƒbƒVƒ…
#--------------------------------------------------------------------------
def refresh_phase(battler)
battler.at %= @max
if battler.movable?
battler.atp = 100 * @active_battler.at / @max
end
spell_reset(battler)
# ƒXƒŠƒbƒvƒ_ƒ[ƒW
if battler.hp > 0 and battler.slip_damage?
battler.slip_damage_effect
battler.damage_pop = true
end
# ƒXƒe[ƒgŽ©‘R‰ðœ
battler.remove_states_auto
unless battler.movable?
return
end
# ƒ^[ƒ“”ƒJƒEƒ“ƒg
@turn_cnt += 1
end
#--------------------------------------------------------------------------
# œ ƒAƒjƒƒEƒFƒCƒg”»’fˆ—
#--------------------------------------------------------------------------
def anime_wait_return
if (@action_battlers.size == 0 or @anime_wait == false) and
not $game_system.battle_interpreter.running?
# ƒGƒlƒ~[ƒAƒ[‚ª—LŒø‚Ìê‡
if @enemy_arrow != nil
return [@active - 2, 0].min == 0
# ƒAƒNƒ^[ƒAƒ[‚ª—LŒø‚Ìê‡
elsif @actor_arrow != nil
return [@active - 2, 0].min == 0
# ƒXƒLƒ‹ƒEƒBƒ“ƒhƒE‚ª—LŒø‚Ìê‡
elsif @skill_window != nil
return [@active - 3, 0].min == 0
# ƒAƒCƒeƒ€ƒEƒBƒ“ƒhƒE‚ª—LŒø‚Ìê‡
elsif @item_window != nil
return [@active - 3, 0].min == 0
# ƒAƒNƒ^[ƒRƒ}ƒ“ƒhƒEƒBƒ“ƒhƒE‚ª—LŒø‚Ìê‡
elsif @actor_command_window.active
return [@active - 1, 0].min == 0
else
return true
end
else
return false
end
end
#--------------------------------------------------------------------------
# œ ƒAƒNƒ^[ƒRƒ}ƒ“ƒhÁ‹Ž”»’f
#--------------------------------------------------------------------------
def command_delete
# ƒGƒlƒ~[ƒAƒ[‚ª—LŒø‚Ìê‡
if @enemy_arrow != nil
end_enemy_select
# ƒAƒNƒ^[ƒAƒ[‚ª—LŒø‚Ìê‡
elsif @actor_arrow != nil
end_actor_select
end
# ƒXƒLƒ‹ƒEƒBƒ“ƒhƒE‚ª—LŒø‚Ìê‡
if @skill_window != nil
end_skill_select
# ƒAƒCƒeƒ€ƒEƒBƒ“ƒhƒE‚ª—LŒø‚Ìê‡
elsif @item_window != nil
end_item_select
end
# ƒAƒNƒ^[ƒRƒ}ƒ“ƒhƒEƒBƒ“ƒhƒE‚ª—LŒø‚Ìê‡
if @actor_command_window.active
@command.shift
@command_a = false
# ƒƒCƒ“ƒtƒF[ƒYƒtƒ‰ƒO‚ðƒZƒbƒg
$game_temp.battle_main_phase = true
# ƒAƒNƒ^[ƒRƒ}ƒ“ƒhƒEƒBƒ“ƒhƒE‚𖳌ø‰»
@actor_command_window.active = false
@actor_command_window.visible = false
# ƒAƒNƒ^[‚Ì–¾–ŃGƒtƒFƒNƒg OFF
if @active_actor != nil
@active_actor.blink = false
end
end
end
#--------------------------------------------------------------------------
# œ ƒXƒLƒ‹‰r¥ƒ^ƒCƒ€ì¬
#--------------------------------------------------------------------------
def recite_time(battler)
end
#--------------------------------------------------------------------------
# œ ‡¬ƒXƒLƒ‹”»•Ê
#--------------------------------------------------------------------------
def synthe_spell(battler)
end
#--------------------------------------------------------------------------
# œ s“®‰Â””»’è
#--------------------------------------------------------------------------
def active?(battler)
speller = synthe?(battler)
if speller != nil
if synthe_delete?(speller)
return false
end
else
unless battler.inputable?
spell_reset(battler)
unless battler.movable?
battler.atp = 0
return false
end
end
if battler.current_action.forcing
spell_reset(battler)
end
end
return true
end
#--------------------------------------------------------------------------
# œ ‡¬ƒXƒLƒ‹‰r¥’†‚©H
#--------------------------------------------------------------------------
def synthe?(battler)
for speller in @synthe
if speller.include?(battler)
return speller
end
end
return nil
end
#--------------------------------------------------------------------------
# œ ‡¬ƒXƒLƒ‹Á‹Ž”»’f
#--------------------------------------------------------------------------
def synthe_delete?(speller)
for battler in speller
unless battler.inputable?
synthe_delete(speller)
return true
end
end
return false
end
#--------------------------------------------------------------------------
# œ ‡¬ƒXƒLƒ‹Á‹Ž
#--------------------------------------------------------------------------
def synthe_delete(speller)
for battler in speller
spell_reset(battler)
@action_battlers.delete(battler)
end
@synthe.delete(speller)
end
#--------------------------------------------------------------------------
# œ ˜AŒgŠÜ‚ÞƒXƒLƒ‹‰r¥‰ðœ
#--------------------------------------------------------------------------
def skill_reset(battler)
speller = synthe?(battler)
if speller != nil
synthe_delete(speller)
else
spell_reset(battler)
end
end
#--------------------------------------------------------------------------
# œ ƒXƒLƒ‹‰r¥‰ðœ
#--------------------------------------------------------------------------
def spell_reset(battler)
battler.rt = 0
battler.rtp = 0
battler.blink = false
battler.spell = false
battler.current_action.spell_id = 0
@spell_p.delete(battler)
@spell_e.delete(battler)
end
#--------------------------------------------------------------------------
# œ “G‘S–Å”»’è
#--------------------------------------------------------------------------
def fin?
for battler in $game_troop.enemies
if battler.hp != 0
return false
end
end
return true
end
end
#==============================================================================
# ¡ Game_Battler (•ªŠ„’è‹` 1)
#------------------------------------------------------------------------------
# @ƒoƒgƒ‰[‚ðˆµ‚¤ƒNƒ‰ƒX‚Å‚·B‚±‚̃Nƒ‰ƒX‚Í Game_Actor ƒNƒ‰ƒX‚Æ Game_Enemy ƒNƒ‰
# ƒX‚̃X[ƒp[ƒNƒ‰ƒX‚Æ‚µ‚ÄŽg—p‚³‚ê‚Ü‚·B
#==============================================================================
class Game_Battler
#--------------------------------------------------------------------------
# œ ŒöŠJƒCƒ“ƒXƒ^ƒ“ƒX•Ï”’ljÁ
#--------------------------------------------------------------------------
attr_accessor :at # ATiƒ^ƒCƒ€ƒQ[ƒWj
attr_accessor :atp # ATi•Ž¦—pj
attr_accessor :rt # RPi‰r¥ƒQ[ƒWj
attr_accessor :rtp # RPi‰r¥•K—v—Êj
attr_accessor :spell # ‡¬ƒXƒLƒ‹”“®’†
attr_accessor :recover_hp # HP‰ñ•œ—Ê
attr_accessor :recover_sp # SP‰ñ•œ—Ê
attr_accessor :state_p # ƒXƒe[ƒ^ƒXˆÙí”z—ñ
attr_accessor :state_m # ƒXƒe[ƒ^ƒXˆÙí”z—ñ
#--------------------------------------------------------------------------
# œ ƒXƒe[ƒg‚̉ðœ
# state_id : ƒXƒe[ƒg ID
# force : ‹§‰ðœƒtƒ‰ƒO (ƒI[ƒgƒXƒe[ƒg‚̈—‚ÅŽg—p)
#--------------------------------------------------------------------------
def remove_state(state_id, force = false)
# ‚±‚̃Xƒe[ƒg‚ª•t‰Á‚³‚ê‚Ä‚¢‚éê‡
if state?(state_id)
# ‹§•t‰Á‚³‚ꂽƒXƒe[ƒg‚ÅA‚©‚‰𜂪‹§‚Å‚Í‚È‚¢ê‡
if @states_turn[state_id] == -1 and not force
# ƒƒƒbƒhI—¹
return
end
# Œ»Ý‚Ì HP ‚ª 0 ‚©‚ ƒIƒvƒVƒ‡ƒ“ [HP 0 ‚Ìó‘Ô‚Æ‚Ý‚È‚·] ‚ª—LŒø‚Ìê‡
if @hp == 0 and $data_states[state_id].zero_hp
# ‚Ù‚©‚É [HP 0 ‚Ìó‘Ô‚Æ‚Ý‚È‚·] ƒXƒe[ƒg‚ª‚ ‚é‚©‚Ç‚¤‚©”»’è
zero_hp = false
for i in @states
if i != state_id and $data_states[i].zero_hp
zero_hp = true
end
end
# 퓬•s”‚ð‰ðœ‚µ‚Ă悯‚ê‚ÎAHP ‚ð 1 ‚É•ÏX
if zero_hp == false
@hp = 1
end
end
unless self.movable?
# ƒXƒe[ƒg ID ‚ð @states ”z—ñ‚¨‚æ‚Ñ @states_turn ƒnƒbƒVƒ…‚©‚çíœ
@states.delete(state_id)
@states_turn.delete(state_id)
if self.movable?
self.at = 0
end
else
# ƒXƒe[ƒg ID ‚ð @states ”z—ñ‚¨‚æ‚Ñ @states_turn ƒnƒbƒVƒ…‚©‚çíœ
@states.delete(state_id)
@states_turn.delete(state_id)
end
end
# HP ‚¨‚æ‚Ñ SP ‚ÌÅ‘å’lƒ`ƒFƒbƒN
@hp = [@hp, self.maxhp].min
@sp = [@sp, self.maxsp].min
end
#--------------------------------------------------------------------------
# œ ’ÊíUŒ‚‚ÌŒø‰Ê“K—p
# attacker : UŒ‚ŽÒ (ƒoƒgƒ‰[)
#--------------------------------------------------------------------------
def attack_effect(attacker)
# ƒNƒŠƒeƒBƒJƒ‹ƒtƒ‰ƒO‚ðƒNƒŠƒA
self.critical = false
self.state_p = []
self.state_m = []
# ‘æˆê–½’†”»’è
hit_result = (rand(100) < attacker.hit)
# –½’†‚Ìê‡
if hit_result == true
# Šî–{ƒ_ƒ[ƒW‚ðŒvŽZ
atk = [attacker.atk - self.pdef / 2, 0].max
self.damage = atk * (20 + attacker.str) / 20
# ‘®«C³
self.damage *= elements_correct(attacker.element_set)
self.damage /= 100
# ƒ_ƒ[ƒW‚Ì•„†‚ª³‚Ìê‡
if self.damage > 0
# ƒNƒŠƒeƒBƒJƒ‹C³
if rand(100) < 4 * attacker.dex / self.agi
self.damage *= 2
self.critical = true
end
# –hŒäC³
if self.guarding?
self.damage /= 2
end
end
# •ªŽU
if self.damage.abs > 0
amp = [self.damage.abs * 15 / 100, 1].max
self.damage += rand(amp+1) + rand(amp+1) - amp
end
# ‘æ“ñ–½’†”»’è
eva = 8 * self.agi / attacker.dex + self.eva
hit = self.damage < 0 ? 100 : 100 - eva
hit = self.cant_evade? ? 100 : hit
hit_result = (rand(100) < hit)
end
# –½’†‚Ìê‡
if hit_result == true
# ƒXƒe[ƒgÕŒ‚‰ðœ
remove_states_shock
# HP ‚©‚çƒ_ƒ[ƒW‚ðŒ¸ŽZ
# ƒXƒe[ƒg•Ï‰»
@state_changed = false
states_plus(attacker.plus_state_set)
states_minus(attacker.minus_state_set)
# ƒ~ƒX‚Ìê‡
else
# ƒ_ƒ[ƒW‚É "Miss" ‚ðÝ’è
self.damage = "Miss"
# ƒNƒŠƒeƒBƒJƒ‹ƒtƒ‰ƒO‚ðƒNƒŠƒA
self.critical = false
end
# ƒƒƒbƒhI—¹
return true
end
#--------------------------------------------------------------------------
# œ ƒXƒLƒ‹‚ÌŒø‰Ê“K—p
# user : ƒXƒLƒ‹‚ÌŽg—pŽÒ (ƒoƒgƒ‰[)
# skill : ƒXƒLƒ‹
#--------------------------------------------------------------------------
def skill_effect(user, skill)
# ƒNƒŠƒeƒBƒJƒ‹ƒtƒ‰ƒO‚ðƒNƒŠƒA
self.critical = false
self.state_p = []
self.state_m = []
# ƒXƒLƒ‹‚ÌŒø‰Ê”͈͂ª HP 1 ˆÈã‚Ì–¡•û‚ÅAŽ©•ª‚Ì HP ‚ª 0A
# ‚Ü‚½‚̓XƒLƒ‹‚ÌŒø‰Ê”͈͂ª HP 0 ‚Ì–¡•û‚ÅAŽ©•ª‚Ì HP ‚ª 1 ˆÈã‚Ìê‡
if ((skill.scope == 3 or skill.scope == 4) and self.hp == 0) or
((skill.scope == 5 or skill.scope == 6) and self.hp >= 1)
# ƒƒƒbƒhI—¹
return false
end
# —LŒøƒtƒ‰ƒO‚ðƒNƒŠƒA
effective = false
# ƒRƒ‚ƒ“ƒCƒxƒ“ƒg ID ‚ª—LŒø‚Ìꇂ͗LŒøƒtƒ‰ƒO‚ðƒZƒbƒg
effective |= skill.common_event_id > 0
# ‘æˆê–½’†”»’è
hit = skill.hit
if skill.atk_f > 0
hit *= user.hit / 100
end
hit_result = (rand(100) < hit)
# •sŠmŽÀ‚ȃXƒLƒ‹‚Ìꇂ͗LŒøƒtƒ‰ƒO‚ðƒZƒbƒg
effective |= hit < 100
# –½’†‚Ìê‡
if hit_result == true
# ˆÐ—Í‚ðŒvŽZ
power = skill.power + user.atk * skill.atk_f / 100
if power > 0
power -= self.pdef * skill.pdef_f / 200
power -= self.mdef * skill.mdef_f / 200
power = [power, 0].max
end
# ”{—¦‚ðŒvŽZ
rate = 20
rate += (user.str * skill.str_f / 100)
rate += (user.dex * skill.dex_f / 100)
rate += (user.agi * skill.agi_f / 100)
rate += (user.int * skill.int_f / 100)
# Šî–{ƒ_ƒ[ƒW‚ðŒvŽZ
self.damage = power * rate / 20
# ‘®«C³
self.damage *= elements_correct(skill.element_set)
self.damage /= 100
# ƒ_ƒ[ƒW‚Ì•„†‚ª³‚Ìê‡
if self.damage > 0
# –hŒäC³
if self.guarding?
self.damage /= 2
end
end
# •ªŽU
if skill.variance > 0 and self.damage.abs > 0
amp = [self.damage.abs * skill.variance / 100, 1].max
self.damage += rand(amp+1) + rand(amp+1) - amp
end
# ‘æ“ñ–½’†”»’è
eva = 8 * self.agi / user.dex + self.eva
hit = self.damage < 0 ? 100 : 100 - eva * skill.eva_f / 100
hit = self.cant_evade? ? 100 : hit
hit_result = (rand(100) < hit)
# •sŠmŽÀ‚ȃXƒLƒ‹‚Ìꇂ͗LŒøƒtƒ‰ƒO‚ðƒZƒbƒg
effective |= hit < 100
end
# –½’†‚Ìê‡
if hit_result == true
# ˆÐ—Í 0 ˆÈŠO‚Ì•¨—UŒ‚‚Ìê‡
if skill.power != 0 and skill.atk_f > 0
# ƒXƒe[ƒgÕŒ‚‰ðœ
remove_states_shock
# —LŒøƒtƒ‰ƒO‚ðƒZƒbƒg
effective = true
end
# HP ‚Ì•Ï“®”»’è
last_hp = [[self.hp - self.damage, self.maxhp].min, 0].max
# Œø‰Ê”»’è
effective |= self.hp != last_hp
# ƒXƒe[ƒg•Ï‰»
@state_changed = false
effective |= states_plus(skill.plus_state_set)
effective |= states_minus(skill.minus_state_set)
unless $game_temp.in_battle
self.damage_effect(1)
end
# ˆÐ—Í‚ª 0 ‚Ìê‡
if skill.power == 0
# ƒ_ƒ[ƒW‚ɋ󕶎š—ñ‚ðÝ’è
self.damage = ""
# ƒXƒe[ƒg‚ɕω»‚ª‚È‚¢ê‡
unless @state_changed
# ƒ_ƒ[ƒW‚É "Miss" ‚ðÝ’è
self.damage = "Miss"
end
end
# ƒ~ƒX‚Ìê‡
else
# ƒ_ƒ[ƒW‚É "Miss" ‚ðÝ’è
self.damage = "Miss"
end
# 퓬’†‚Å‚È‚¢ê‡
unless $game_temp.in_battle
# ƒ_ƒ[ƒW‚É nil ‚ðÝ’è
self.damage = nil
end
# ƒƒƒbƒhI—¹
return effective
end
#--------------------------------------------------------------------------
# œ ƒAƒCƒeƒ€‚ÌŒø‰Ê“K—p
# item : ƒAƒCƒeƒ€
#--------------------------------------------------------------------------
def item_effect(item)
# ƒNƒŠƒeƒBƒJƒ‹ƒtƒ‰ƒO‚ðƒNƒŠƒA
self.critical = false
self.state_p = []
self.state_m = []
# ƒAƒCƒeƒ€‚ÌŒø‰Ê”͈͂ª HP 1 ˆÈã‚Ì–¡•û‚ÅAŽ©•ª‚Ì HP ‚ª 0A
# ‚Ü‚½‚̓AƒCƒeƒ€‚ÌŒø‰Ê”͈͂ª HP 0 ‚Ì–¡•û‚ÅAŽ©•ª‚Ì HP ‚ª 1 ˆÈã‚Ìê‡
if ((item.scope == 3 or item.scope == 4) and self.hp == 0) or
((item.scope == 5 or item.scope == 6) and self.hp >= 1)
# ƒƒƒbƒhI—¹
return false
end
# —LŒøƒtƒ‰ƒO‚ðƒNƒŠƒA
effective = false
# ƒRƒ‚ƒ“ƒCƒxƒ“ƒg ID ‚ª—LŒø‚Ìꇂ͗LŒøƒtƒ‰ƒO‚ðƒZƒbƒg
effective |= item.common_event_id > 0
# –½’†”»’è
hit_result = (rand(100) < item.hit)
# •sŠmŽÀ‚ȃXƒLƒ‹‚Ìꇂ͗LŒøƒtƒ‰ƒO‚ðƒZƒbƒg
effective |= item.hit < 100
# –½’†‚Ìê‡
if hit_result == true
# ‰ñ•œ—Ê‚ðŒvŽZ
self.recover_hp = maxhp * item.recover_hp_rate / 100 + item.recover_hp
self.recover_sp = maxsp * item.recover_sp_rate / 100 + item.recover_sp
if self.recover_hp < 0
self.recover_hp += self.pdef * item.pdef_f / 20
self.recover_hp += self.mdef * item.mdef_f / 20
self.recover_hp = [recover_hp, 0].min
end
# ‘®«C³
self.recover_hp *= elements_correct(item.element_set)
self.recover_hp /= 100
self.recover_sp *= elements_correct(item.element_set)
self.recover_sp /= 100
# •ªŽU
if item.variance > 0 and self.recover_hp.abs > 0
amp = [self.recover_hp.abs * item.variance / 100, 1].max
self.recover_hp += rand(amp+1) + rand(amp+1) - amp
end
if item.variance > 0 and self.recover_sp.abs > 0
amp = [self.recover_sp.abs * item.variance / 100, 1].max
self.recover_sp += rand(amp+1) + rand(amp+1) - amp
end
# ‰ñ•œ—Ê‚Ì•„†‚ª•‰‚Ìê‡
if self.recover_hp < 0
# –hŒäC³
if self.guarding?
self.recover_hp /= 2
end
end
# HP ‰ñ•œ—Ê‚Ì•„†‚𔽓]‚µAƒ_ƒ[ƒW‚Ì’l‚ÉÝ’è
self.damage = -self.recover_hp
# HP ‚¨‚æ‚Ñ SP ‚Ì•Ï“®”»’è
last_hp = [[self.hp + self.recover_hp, self.maxhp].min, 0].max
last_sp = [[self.sp + self.recover_sp, self.maxsp].min, 0].max
effective |= self.hp != last_hp
effective |= self.sp != last_sp
# ƒXƒe[ƒg•Ï‰»
@state_changed = false
effective |= states_plus(item.plus_state_set)
effective |= states_minus(item.minus_state_set)
unless $game_temp.in_battle
self.damage_effect(2)
end
# ƒpƒ‰ƒ[ƒ^㸒l‚ª—LŒø‚Ìê‡
if item.parameter_type > 0 and item.parameter_points != 0
# ƒpƒ‰ƒ[ƒ^‚Å•ªŠò
case item.parameter_type
when 1 # MaxHP
@maxhp_plus += item.parameter_points
when 2 # MaxSP
@maxsp_plus += item.parameter_points
when 3 # ˜r—Í
@str_plus += item.parameter_points
when 4 # Ší—p‚³
@dex_plus += item.parameter_points
when 5 # ‘f‘‚³
@agi_plus += item.parameter_points
when 6 # –‚—Í
@int_plus += item.parameter_points
end
# —LŒøƒtƒ‰ƒO‚ðƒZƒbƒg
effective = true
end
# HP ‰ñ•œ—¦‚Ɖñ•œ—Ê‚ª 0 ‚Ìê‡
if item.recover_hp_rate == 0 and item.recover_hp == 0
# ƒ_ƒ[ƒW‚ɋ󕶎š—ñ‚ðÝ’è
self.damage = ""
# SP ‰ñ•œ—¦‚Ɖñ•œ—Ê‚ª 0Aƒpƒ‰ƒ[ƒ^㸒l‚ª–³Œø‚Ìê‡
if item.recover_sp_rate == 0 and item.recover_sp == 0 and
(item.parameter_type == 0 or item.parameter_points == 0)
# ƒXƒe[ƒg‚ɕω»‚ª‚È‚¢ê‡
unless @state_changed
# ƒ_ƒ[ƒW‚É "Miss" ‚ðÝ’è
self.damage = "Miss"
end
end
end
# ƒ~ƒX‚Ìê‡
else
# ƒ_ƒ[ƒW‚É "Miss" ‚ðÝ’è
self.damage = "Miss"
end
# 퓬’†‚Å‚È‚¢ê‡
unless $game_temp.in_battle
# ƒ_ƒ[ƒW‚É nil ‚ðÝ’è
self.damage = nil
end
# ƒƒƒbƒhI—¹
return effective
end
#--------------------------------------------------------------------------
# œ ƒXƒe[ƒg•Ï‰» (+) ‚Ì“K—p
# plus_state_set : ƒXƒe[ƒg•Ï‰» (+)
#--------------------------------------------------------------------------
def states_plus(plus_state_set)
# —LŒøƒtƒ‰ƒO‚ðƒNƒŠƒA
effective = false
# ƒ‹[ƒv (•t‰Á‚·‚éƒXƒe[ƒg)
for i in plus_state_set
# ‚±‚̃Xƒe[ƒg‚ª–hŒä‚³‚ê‚Ä‚¢‚È‚¢ê‡
unless self.state_guard?(i)
# ‚±‚̃Xƒe[ƒg‚ªƒtƒ‹‚Å‚È‚¯‚ê‚ΗLŒøƒtƒ‰ƒO‚ðƒZƒbƒg
effective |= self.state_full?(i) == false
# ƒXƒe[ƒg‚ª [’ïR‚µ‚È‚¢] ‚Ìê‡
if $data_states[i].nonresistance
# ƒXƒe[ƒg•Ï‰»ƒtƒ‰ƒO‚ðƒZƒbƒg
@state_changed = true
# ƒXƒe[ƒg‚ð•t‰Á
add_state(i)
# ‚±‚̃Xƒe[ƒg‚ªƒtƒ‹‚Å‚Í‚È‚¢ê‡
elsif self.state_full?(i) == false
# ƒXƒe[ƒg—LŒø“x‚ðŠm—¦‚É•ÏŠ·‚µA—”‚Æ”äŠr
if rand(100) < [0,100,80,60,40,20,0][self.state_ranks[i]]
# ƒXƒe[ƒg•Ï‰»ƒtƒ‰ƒO‚ðƒZƒbƒg
@state_changed = true
# ƒXƒe[ƒg‚ð•t‰Á
self.state_p.push(i)
end
end
end
end
# ƒƒƒbƒhI—¹
return effective
end
#--------------------------------------------------------------------------
# œ ƒXƒe[ƒg•Ï‰» (-) ‚Ì“K—p
# minus_state_set : ƒXƒe[ƒg•Ï‰» (-)
#--------------------------------------------------------------------------
def states_minus(minus_state_set)
# —LŒøƒtƒ‰ƒO‚ðƒNƒŠƒA
effective = false
# ƒ‹[ƒv (‰ðœ‚·‚éƒXƒe[ƒg)
for i in minus_state_set
# ‚±‚̃Xƒe[ƒg‚ª•t‰Á‚³‚ê‚Ä‚¢‚ê‚ΗLŒøƒtƒ‰ƒO‚ðƒZƒbƒg
effective |= self.state?(i)
# ƒXƒe[ƒg•Ï‰»ƒtƒ‰ƒO‚ðƒZƒbƒg
@state_changed = true
# ƒXƒe[ƒg‚ð‰ðœ
self.state_m.push(i)
end
# ƒƒƒbƒhI—¹
return effective
end
#--------------------------------------------------------------------------
# œ ƒ_ƒ[ƒW‰‰ŽZ
#--------------------------------------------------------------------------
def damage_effect(item)
if item == 2
self.hp += self.recover_hp
self.sp += self.recover_sp
else
if self.damage.class != String
self.hp -= self.damage
end
end
for i in self.state_p
add_state(i)
end
for i in self.state_m
remove_state(i)
end
end
end
#==============================================================================
# ¡ Game_BattleAction
#------------------------------------------------------------------------------
# @ƒAƒNƒVƒ‡ƒ“ (퓬’†‚Ìs“®) ‚ðˆµ‚¤ƒNƒ‰ƒX‚Å‚·B‚±‚̃Nƒ‰ƒX‚Í Game_Battler ƒNƒ‰
# ƒX‚Ì“à•”‚ÅŽg—p‚³‚ê‚Ü‚·B
#==============================================================================
class Game_BattleAction
#--------------------------------------------------------------------------
# œ ŒöŠJƒCƒ“ƒXƒ^ƒ“ƒX•Ï”
#--------------------------------------------------------------------------
attr_accessor :spell_id # ‡‘Ì–‚–@—pƒXƒLƒ‹ ID
end
#==============================================================================
# ¡ Game_Actor
#------------------------------------------------------------------------------
# @ƒAƒNƒ^[‚ðˆµ‚¤ƒNƒ‰ƒX‚Å‚·B‚±‚̃Nƒ‰ƒX‚Í Game_Actors ƒNƒ‰ƒX ($game_actors)
# ‚Ì“à•”‚ÅŽg—p‚³‚êAGame_Party ƒNƒ‰ƒX ($game_party) ‚©‚ç‚àŽQÆ‚³‚ê‚Ü‚·B
#==============================================================================
class Game_Actor < Game_Battler
def skill_can_use?(skill_id)
return super
end
end
#==============================================================================
# ¡ Game_Enemy
#------------------------------------------------------------------------------
# @ƒGƒlƒ~[‚ðˆµ‚¤ƒNƒ‰ƒX‚Å‚·B‚±‚̃Nƒ‰ƒX‚Í Game_Troop ƒNƒ‰ƒX ($game_troop) ‚Ì
# “à•”‚ÅŽg—p‚³‚ê‚Ü‚·B
#==============================================================================
class Game_Enemy < Game_Battler
#--------------------------------------------------------------------------
# œ ƒAƒNƒVƒ‡ƒ“ì¬
#--------------------------------------------------------------------------
def make_action
# ƒJƒŒƒ“ƒgƒAƒNƒVƒ‡ƒ“‚ðƒNƒŠƒA
self.current_action.clear
# “®‚¯‚È‚¢ê‡
unless self.inputable?
# ƒƒƒbƒhI—¹
return
end
# Œ»Ý—LŒø‚ȃAƒNƒVƒ‡ƒ“‚ð’Šo
available_actions = []
rating_max = 0
for action in self.actions
# ƒ^[ƒ“ ðŒŠm”F
n = $game_temp.battle_turn
a = action.condition_turn_a
b = action.condition_turn_b
if (b == 0 and n != a) or
(b > 0 and (n < 1 or n < a or n % b != a % b))
next
end
# HP ðŒŠm”F
if self.hp * 100.0 / self.maxhp > action.condition_hp
next
end
# ƒŒƒxƒ‹ ðŒŠm”F
if $game_party.max_level < action.condition_level
next
end
# ƒXƒCƒbƒ` ðŒŠm”F
switch_id = action.condition_switch_id
if switch_id > 0 and $game_switches[switch_id] == false
next
end
# ƒXƒLƒ‹Žg—p‰Â” ðŒŠm”F
if action.kind == 1
unless self.skill_can_use?(action.skill_id)
next
end
end
# ðŒ‚ÉŠY“– : ‚±‚̃AƒNƒVƒ‡ƒ“‚ð’ljÁ
available_actions.push(action)
if action.rating > rating_max
rating_max = action.rating
end
end
# Å‘å‚̃Œ[ƒeƒBƒ“ƒO’l‚ð 3 ‚Æ‚µ‚ćŒv‚ðŒvŽZ (0 ˆÈ‰º‚ÍœŠO)
ratings_total = 0
for action in available_actions
if action.rating > rating_max - 3
ratings_total += action.rating - (rating_max - 3)
end
end
# ƒŒ[ƒeƒBƒ“ƒO‚̇Œv‚ª 0 ‚Å‚Í‚È‚¢ê‡
if ratings_total > 0
# —”‚ðì¬
value = rand(ratings_total)
# 쬂µ‚½—”‚ɑΉž‚·‚é‚à‚Ì‚ðƒJƒŒƒ“ƒgƒAƒNƒVƒ‡ƒ“‚ÉÝ’è
for action in available_actions
if action.rating > rating_max - 3
if value < action.rating - (rating_max - 3)
self.current_action.kind = action.kind
self.current_action.basic = action.basic
self.current_action.skill_id = action.skill_id
self.current_action.decide_random_target_for_enemy
return
else
value -= action.rating - (rating_max - 3)
end
end
end
end
end
end
#==============================================================================
# ¡ Window_BattleStatus
#------------------------------------------------------------------------------
# @ƒoƒgƒ‹‰æ–ʂŃp[ƒeƒBƒƒ“ƒo[‚̃Xƒe[ƒ^ƒX‚𕎦‚·‚éƒEƒBƒ“ƒhƒE‚Å‚·B
#==============================================================================
class Window_BattleStatus < Window_Base
#--------------------------------------------------------------------------
# œ ƒŠƒtƒŒƒbƒVƒ…
#--------------------------------------------------------------------------
def refresh
self.contents.clear
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
actor_x = i * 160 + 4
draw_actor_name(actor, actor_x, 0)
draw_actor_hp(actor, actor_x, 26, 120)
draw_actor_sp(actor, actor_x, 52, 120)
draw_actor_atg(actor, actor_x, 104, 120)
if @level_up_flags[i]
self.contents.font.color = normal_color
self.contents.draw_text(actor_x, 78, 120, 32, "LEVEL UP!")
else
draw_actor_state(actor, actor_x, 78)
end
end
end
#--------------------------------------------------------------------------
# œ ATƒQ[ƒWƒŠƒtƒŒƒbƒVƒ…
#--------------------------------------------------------------------------
def at_refresh
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
actor_x = i * 160 + 4
draw_actor_atg(actor, actor_x, 104, 120)
end
end
end
#==============================================================================
# ¡ Interpreter
#------------------------------------------------------------------------------
# @ƒCƒxƒ“ƒgƒRƒ}ƒ“ƒh‚ðŽÀs‚·‚éƒCƒ“ƒ^ƒvƒŠƒ^‚Å‚·B‚±‚̃Nƒ‰ƒX‚Í Game_System ƒNƒ‰
# ƒX‚â Game_Event ƒNƒ‰ƒX‚Ì“à•”‚ÅŽg—p‚³‚ê‚Ü‚·B
#==============================================================================
class Interpreter
#--------------------------------------------------------------------------
# œ ƒAƒNƒ^[‚Ì“ü‚ê‘Ö‚¦
#--------------------------------------------------------------------------
def command_129
# ƒAƒNƒ^[‚ðŽæ“¾
actor = $game_actors[@parameters[0]]
# ƒAƒNƒ^[‚ª—LŒø‚Ìê‡
if actor != nil
# ‘€ì‚Å•ªŠò
if @parameters[1] == 0
if @parameters[2] == 1
$game_actors[@parameters[0]].setup(@parameters[0])
end
$game_party.add_actor(@parameters[0])
$game_actors[@parameters[0]].at = 0
$game_actors[@parameters[0]].atp = 0
$game_actors[@parameters[0]].rt = 0
$game_actors[@parameters[0]].rtp = 0
$game_actors[@parameters[0]].spell = false
$game_actors[@parameters[0]].current_action.spell_id = 0
else
$game_party.remove_actor(@parameters[0])
end
end
# Œp‘±
return true
end
#--------------------------------------------------------------------------
# œ HP ‚Ì‘Œ¸
#--------------------------------------------------------------------------
alias :command_311_original :command_311
def command_311
command_311_original
if $game_temp.in_battle
$scene.status_window.refresh
end
end
#--------------------------------------------------------------------------
# œ SP ‚Ì‘Œ¸
#--------------------------------------------------------------------------
alias :command_312_original :command_312
def command_312
command_312_original
if $game_temp.in_battle
$scene.status_window.refresh
end
end
#--------------------------------------------------------------------------
# œ ƒXƒe[ƒg‚Ì•ÏX
#--------------------------------------------------------------------------
alias :command_313_original :command_313
def command_313
command_313_original
if $game_temp.in_battle
$scene.status_window.refresh
end
end
#--------------------------------------------------------------------------
# œ ‘S‰ñ•œ
#--------------------------------------------------------------------------
alias :command_314_original :command_314
def command_314
command_314_original
if $game_temp.in_battle
$scene.status_window.refresh
end
end
#--------------------------------------------------------------------------
# œ EXP ‚Ì‘Œ¸
#--------------------------------------------------------------------------
alias :command_315_original :command_315
def command_315
command_315_original
if $game_temp.in_battle
$scene.status_window.refresh
end
end
#--------------------------------------------------------------------------
# œ ƒŒƒxƒ‹‚Ì‘Œ¸
#--------------------------------------------------------------------------
alias :command_316_original :command_316
def command_316
command_316_original
if $game_temp.in_battle
$scene.status_window.refresh
end
end
#--------------------------------------------------------------------------
# œ ƒpƒ‰ƒ[ƒ^‚Ì‘Œ¸
#--------------------------------------------------------------------------
alias :command_317_original :command_317
def command_317
command_317_original
if $game_temp.in_battle
$scene.status_window.refresh
end
end
#--------------------------------------------------------------------------
# œ ‘•”õ‚Ì•ÏX
#--------------------------------------------------------------------------
alias :command_319_original :command_319
def command_319
command_319_original
if $game_temp.in_battle
$scene.status_window.refresh
end
end
#--------------------------------------------------------------------------
# œ ƒAƒNƒ^[‚Ì–¼‘O•ÏX
#--------------------------------------------------------------------------
alias :command_320_original :command_320
def command_320
command_320_original
if $game_temp.in_battle
$scene.status_window.refresh
end
end
#--------------------------------------------------------------------------
# œ ƒAƒNƒ^[‚̃Nƒ‰ƒX•ÏX
#--------------------------------------------------------------------------
alias :command_321_original :command_321
def command_321
command_321_original
if $game_temp.in_battle
$scene.status_window.refresh
end
end
#--------------------------------------------------------------------------
# œ ƒ_ƒ[ƒW‚̈—
#--------------------------------------------------------------------------
alias :command_338_original :command_338
def command_338
command_338_original
if $game_temp.in_battle
$scene.status_window.refresh
end
end
end
#==============================================================================
# ¡ BitmapŠg’£ƒNƒ‰ƒX
#------------------------------------------------------------------------------
# @BitmapƒNƒ‰ƒX‚ÉV‚½‚È‹@”‚ð’ljÁ‚µ‚Ü‚·B
#==============================================================================
class Bitmap
#--------------------------------------------------------------------------
# œ ‹éŒ`‚ðƒOƒ‰ƒf[ƒVƒ‡ƒ“•Ž¦
# color1 : ƒXƒ^[ƒgƒJƒ‰[
# color2 : ƒGƒ“ƒhƒJƒ‰[
# align : 0:‰¡‚ɃOƒ‰ƒf[ƒVƒ‡ƒ“
# 1:c‚ɃOƒ‰ƒf[ƒVƒ‡ƒ“
#--------------------------------------------------------------------------
def gradation_rect(x, y, width, height, color1, color2, align = 0)
if align == 0
for i in x...x + width
red = color1.red + (color2.red - color1.red) * (i - x) / (width - 1)
green = color1.green + (color2.green - color1.green) * (i - x) / (width - 1)
blue = color1.blue + (color2.blue - color1.blue) * (i - x) / (width - 1)
alpha = color1.alpha + (color2.alpha - color1.alpha) * (i - x) / (width - 1)
color = Color.new(red, green, blue, alpha)
fill_rect(i, y, 1, height, color)
end
elsif align == 1
for i in y...y + height
red = color1.red +
(color2.red - color1.red) * (i - y) / (height - 1)
green = color1.green +
(color2.green - color1.green) * (i - y) / (height - 1)
blue = color1.blue +
(color2.blue - color1.blue) * (i - y) / (height - 1)
alpha = color1.alpha +
(color2.alpha - color1.alpha) * (i - y) / (height - 1)
color = Color.new(red, green, blue, alpha)
fill_rect(x, i, width, 1, color)
end
end
end
end
스크립트인데... 뭐가뭔지 ㅎㅎ