Project1
标题:
技能脚本出错,求助。
[打印本页]
作者:
江南小帅瓜
时间:
2014-5-17 20:23
标题:
技能脚本出错,求助。
本帖最后由 江南小帅瓜 于 2014-5-18 16:00 编辑
使用技能是出错,提示:
(, 下载次数: 48)
上传
点击文件名下载附件
提示的出错脚本为:
@skill_window = Window_Skill2.new(@active_actor, skill_kind)
作者:
芯☆淡茹水
时间:
2014-5-17 21:50
参数错误,请帖上脚本:Window_Skill2
作者:
江南小帅瓜
时间:
2014-5-17 22:26
芯☆淡茹水 发表于 2014-5-17 21:50
参数错误,请帖上脚本:Window_Skill2
#==============================================================================
# ■ Window_Skill 2
#################################################################
class Window_Skill2 < Window_Selectable
def initialize(actor, skill_kind)
super(0, 328, 460, 352)
[url=home.php?mod=space&uid=95897]@actor[/url] = actor
@skill_kind = skill_kind
@column_max = 2
refresh
self.index = 0
if $game_temp.in_battle
self.y = 343
self.z = 99999
self.height = 137
self.contents.font.size = 20
self.back_opacity = 230
self.contents.font.name = "Georgia"
self.contents.font.bold = true
self.contents.font.italic = true
end
end
def skill
return @data[self.index]
end
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
for i in 0...@actor.skills.size
skill = $data_skills[@actor.skills[i]]
if skill != nil and skill.element_set.include?(@skill_kind)
@data.push(skill)
end
end
@item_max = @data.size
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * 32)
for i in 0...@item_max
draw_item(i)
end
end
end
def draw_item(index)
skill = @data[index]
if @actor.skill_can_use?(skill.id)
self.contents.font.color = normal_color
else
self.contents.font.color = disabled_color
end
x = 2 + index % 2 * (180 + 32)
y = index / 2 * 32
rect = Rect.new(x, y, self.width / @column_max - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon(skill.icon_name)
opacity = self.contents.font.color == normal_color ? 255 : 128
self.contents.font.bold = true
self.contents.font.italic = true
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
self.contents.draw_text(x + 28, y, 120, 32, skill.name, 0)
self.contents.font.name = "Georgia"
self.contents.font.color = Color.new( 50, 160, 255, 192)
self.contents.font.name = "Arial"
self.contents.draw_text(x + 155, y,48, 32, skill.sp_cost.to_s, 2)
self.contents.font.name = "Georgia"
self.contents.font.color = text_color(5)
##############Mogslayer########################################
#Nota caso você não quiser desenho do SP na janela, apague
#a linha abaixo.
draw_sp (x +163,y +23)
###############################################################
end
def update_help
@help_window.set_text(self.skill == nil ? "" : self.skill.description)
end
end
复制代码
会不会是脚本排序问题,我是整合系统的。
作者:
江南小帅瓜
时间:
2014-5-17 22:57
江南小帅瓜 发表于 2014-5-17 22:26
会不会是脚本排序问题,我是整合系统的。
把系统菜单技能脚本:
#_______________________________________________________________________________
# MOG Scene Skill Nami V2.0
#_______________________________________________________________________________
# By Moghunter
# http://www.atelier-rgss.com
#_______________________________________________________________________________
module MOG
#Transition Time.
MSK_TT = 20
#Transition Type(Name).
MSK_TTT = "004-Blind04"
end
$mogscript = {} if $mogscript == nil
$mogscript["menu_nami"] = true
##############
# Game_Actor #
##############
class Game_Actor < Game_Battler
def now_exp
return [url=home.php?mod=space&uid=13302]@exp[/url] - @exp_list[@level]
end
def next_exp
return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
end
end
###############
# Window_Base #
###############
class Window_Base < Window
def nada
face = RPG::Cache.picture("")
end
def drw_face(actor,x,y)
face = RPG::Cache.picture(actor.name + "_fc") rescue nada
cw = face.width
ch = face.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x , y - ch, face, src_rect)
end
def draw_lay(x,y)
lay = RPG::Cache.picture("MSK_Status")
cw = lay.width
ch = lay.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x , y - ch, lay, src_rect)
end
def nada
face = RPG::Cache.picture("")
end
def draw_heroface3(actor,x,y)
face = RPG::Cache.picture(actor.name + "_fc3") rescue nada
cw = face.width
ch = face.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x , y - ch, face, src_rect)
end
def draw_maphp3(actor, x, y)
back = RPG::Cache.picture("BAR0")
cw = back.width
ch = back.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 65, y - ch + 30, back, src_rect)
meter = RPG::Cache.picture("HP_Bar")
cw = meter.width * actor.hp / actor.maxhp
ch = meter.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 65, y - ch + 30, meter, src_rect)
text = RPG::Cache.picture("HP_Tx")
cw = text.width
ch = text.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 35, y - ch + 30, text, src_rect)
self.contents.font.color = Color.new(0,0,0,255)
self.contents.draw_text(x + 81, y - 1, 48, 32, actor.hp.to_s, 2)
self.contents.font.color = Color.new(255,255,255,255)
self.contents.draw_text(x + 80, y - 2, 48, 32, actor.hp.to_s, 2)
end
def draw_mapsp3(actor, x, y)
back = RPG::Cache.picture("BAR0")
cw = back.width
ch = back.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 65, y - ch + 30, back, src_rect)
meter = RPG::Cache.picture("SP_Bar")
cw = meter.width * actor.sp / actor.maxsp
ch = meter.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 65, y - ch + 30, meter, src_rect)
text = RPG::Cache.picture("SP_Tx")
cw = text.width
ch = text.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 35, y - ch + 30, text, src_rect)
self.contents.font.color = Color.new(0,0,0,255)
self.contents.draw_text(x + 81, y - 1, 48, 32, actor.sp.to_s, 2)
self.contents.font.color = Color.new(255,255,255,255)
self.contents.draw_text(x + 80, y - 2, 48, 32, actor.sp.to_s, 2)
end
def draw_maphp4(actor, x, y)
back = RPG::Cache.picture("BAR")
cw = back.width
ch = back.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 65, y - ch + 30, back, src_rect)
meter = RPG::Cache.picture("HP_Bar2")
cw = meter.width * actor.hp / actor.maxhp
ch = meter.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 65, y - ch + 30, meter, src_rect)
self.contents.font.color = Color.new(0,0,0,255)
self.contents.draw_text(x + 66, y - 1, 100, 32, actor.hp.to_s + "/" + actor.maxhp.to_s, 1)
self.contents.font.color = Color.new(250,255,255,255)
self.contents.draw_text(x + 65, y - 2, 100, 32, actor.hp.to_s + "/" + actor.maxhp.to_s, 1)
end
def draw_mapsp4(actor, x, y)
back = RPG::Cache.picture("BAR")
cw = back.width
ch = back.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 65 , y - ch + 30, back, src_rect)
meter = RPG::Cache.picture("SP_Bar2")
cw = meter.width * actor.sp / actor.maxsp
ch = meter.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 65 , y - ch + 30, meter, src_rect)
self.contents.font.color = Color.new(0,0,0,255)
self.contents.draw_text(x + 66, y - 1, 100, 32, actor.sp.to_s + "/" + actor.maxsp.to_s, 1)
self.contents.font.color = Color.new(250,255,255,255)
self.contents.draw_text(x + 65, y - 2, 100, 32, actor.sp.to_s + "/" + actor.maxsp.to_s, 1)
end
def draw_mexp4(actor, x, y)
actor = $game_party.actors[0]
bitmap2 = RPG::Cache.picture("Exp_Back")
cw = bitmap2.width
ch = bitmap2.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 60 , y - ch + 30, bitmap2, src_rect)
if actor.next_exp != 0
rate = actor.now_exp.to_f / actor.next_exp
else
rate = 1
end
bitmap = RPG::Cache.picture("Exp_Meter")
if actor.level < 99
cw = bitmap.width * rate
else
cw = bitmap.width
end
ch = bitmap.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 60 , y - ch + 30, bitmap, src_rect)
self.contents.font.color = Color.new(0,0,0,255)
self.contents.draw_text(x + 55, y + 1, 84, 32, "Exp",0)
self.contents.font.color = Color.new(255,255,255,255)
self.contents.draw_text(x + 54, y, 84, 32, "Exp",0)
self.contents.font.color = Color.new(0,0,0,255)
self.contents.draw_text(x + 190, y - 125, 60, 32,"LV " + actor.level.to_s, 1)
self.contents.font.color = Color.new(255,255,255,255)
self.contents.draw_text(x + 191, y - 124, 60, 32,"LV " + actor.level.to_s, 1)
end
def draw_mexp_it(actor, x, y)
lv_tx = RPG::Cache.picture("LV_tx")
cw = lv_tx.width
ch = lv_tx.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 60 , y - ch + 32, lv_tx, src_rect)
self.contents.font.color = Color.new(0,0,0,255)
self.contents.draw_text(x + 101, y + 5, 24, 32, actor.level.to_s, 1)
self.contents.font.color = Color.new(255,255,255,255)
self.contents.draw_text(x + 100, y + 4, 24, 32, actor.level.to_s, 1)
end
def draw_actor_state_it(actor, x, y, width = 80)
text = make_battler_state_text(actor, width, true)
self.contents.font.color = actor.hp == 0 ? knockout_color : normal_color
self.contents.draw_text(x, y, width, 32, text,1)
end
end
######################
# Window_Target_Item #
######################
class Window_Target_face < Window_Selectable
def initialize
super(0, 130, 280, 300)
self.contents = Bitmap.new(width - 32, height - 32)
#self.contents.font.name = "Georgia"
self.z += 10
@item_max = $game_party.actors.size
refresh
end
def refresh
self.contents.clear
for i in 0...$game_party.actors.size
x = 4
y = i * 65
actor = $game_party.actors[i]
drw_face(actor,x,y + 55)
if $mogscript["TP_System"] == true
draw_actor_tp(actor, x + 168, y + 27 ,4)
else
draw_mexp_it(actor, x + 110, y + 25 )
end
draw_actor_state_it(actor, x + 165, y )
draw_maphp3(actor, x + 20, y + 0)
draw_mapsp3(actor, x + 20, y + 32)
end
end
def update_cursor_rect
if [url=home.php?mod=space&uid=370741]@Index[/url] <= -2
self.cursor_rect.set(0, (@index + 10) * 65, self.width - 32, 60)
elsif @index == -1
self.cursor_rect.set(0, 0, self.width - 32, @item_max * 64 )
else
self.cursor_rect.set(0, @index * 65, self.width - 32, 60)
end
end
end
#######################
# Window_SkillStatus2 #
#######################
class Window_SkillStatus2 < Window_Base
def initialize(actor)
super(350, 75, 290, 340)
self.contents = Bitmap.new(width - 32, height - 32)
[url=home.php?mod=space&uid=95897]@actor[/url] = actor
self.opacity = 0
#self.contents.font.name = "Georgia"
refresh
end
def refresh
self.contents.clear
draw_lay(0,300)
draw_heroface3(@actor,50,140)
draw_actor_name(@actor, 15, 10)
draw_actor_state(@actor, 120, 140)
draw_mexp4(@actor, -30, 135)
draw_maphp4(@actor, 5, 195)
draw_mapsp4(@actor, 5, 240)
if $mogscript["TP_System"] == true
draw_actor_tp(@actor, 40, 265,1)
end
end
end
#################
# Window_Skill2 #
#################
class Window_Skill2 < Window_Selectable
def initialize(actor)
super(0, 95, 335, 290)
@actor = actor
@column_max = 1
refresh
self.index = 0
end
def skill
return @data[self.index]
end
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
for i in 0...@actor.skills.size
skill = $data_skills[@actor.skills[i]]
if skill != nil
@data.push(skill)
end
end
@item_max = @data.size
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * 32)
for i in 0...@item_max
draw_item(i)
end
end
end
def draw_item(index)
skill = @data[index]
if @actor.skill_can_use?(skill.id)
self.contents.font.color = normal_color
else
self.contents.font.color = disabled_color
end
#self.contents.font.name = "Georgia"
x = index % 1 * (288)
y = index / 1 * 32
rect = Rect.new(x, y, self.width / @column_max - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon(skill.icon_name)
opacity = self.contents.font.color == normal_color ? 255 : 128
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
self.contents.draw_text(x + 28, y, 204, 32, skill.name, 0)
self.contents.draw_text(x + 232, y, 48, 32, skill.sp_cost.to_s, 2)
if $mogscript["TP_System"] == true
tp_cost = MOG::TP_COST[skill.id]
if tp_cost != nil
self.contents.font.color = Color.new(50,250,150,255)
self.contents.draw_text(x + 170, y, 48, 32, MOG::TP_NAME, 2)
else
self.contents.font.color = Color.new(200,200,0,255)
self.contents.draw_text(x + 170, y, 48, 32, $data_system.words.sp, 2)
end
else
self.contents.font.color = Color.new(200,200,0,255)
self.contents.draw_text(x + 170, y, 48, 32, $data_system.words.sp, 2)
end
end
def update_help
@help_window.set_text(self.skill == nil ? "" : self.skill.description)
end
end
###############
# Scene_Skill #
###############
class Scene_Skill
def initialize(actor_index = 0, equip_index = 0)
@actor_index = actor_index
end
def main
@actor = $game_party.actors[@actor_index]
@msk_lay = Sprite.new
@msk_lay.bitmap = RPG::Cache.picture("MSK_Lay")
@msk_lay.z = 100
@msk_back1 = Plane.new
@msk_back1.bitmap = RPG::Cache.picture("MN_BK")
@msk_back1.z = 10
@help_window = Window_Help.new
@help_window.y = 500
@status_window = Window_SkillStatus2.new(@actor)
@status_window.z = 110
@status_window.x = 640
@skill_window = Window_Skill2.new(@actor)
@skill_window.help_window = @help_window
@skill_window.help_window.y = 500
@target_window = Window_Target_face.new
@target_window.x = 640
@target_window.y = 100
@target_window.opacity = 0
@target_window.visible = false
@target_window.active = false
@skill_window.opacity = 0
@help_window.opacity = 0
@slide = true
Graphics.transition(MOG::MSK_TT, "Graphics/Transitions/" + MOG::MSK_TTT)
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
for i in 0..30
@status_window.x += 25
@target_window.x += 25
Graphics.update
end
Graphics.freeze
@help_window.dispose
@status_window.dispose
@skill_window.dispose
@target_window.dispose
@msk_lay.dispose
@msk_back1.dispose
end
def update
if @target_window.active == true
@target_window.visible = true
if @target_window.x > 340
@target_window.x -= 15
elsif @target_window.x <= 340
@target_window.x = 340
end
else
if @target_window.x < 640
@target_window.x += 15
elsif @target_window.x >= 640
@target_window.x = 640
@target_window.visible = false
end
end
if @slide == true
@status_window.visible = true
if @status_window.x > 350
@status_window.x -= 15
elsif @status_window.x <= 350
@status_window.x = 350
end
else
if @status_window.x < 640
@status_window.x += 15
elsif @status_window.x >= 640
@status_window.x = 640
@status_window.visible = false
end
end
@help_window.update
@status_window.update
@skill_window.update
@target_window.update
@msk_back1.ox += 1
@msk_back1.oy += 1
if @skill_window.help_window.y > 425
@skill_window.help_window.y -= 5
elsif @skill_window.help_window.y <= 425
@skill_window.help_window.y = 425
end
if @skill_window.active
update_skill
return
end
if @target_window.active
update_target
return
end
end
def update_skill
if Input.trigger?(Input::UP) or Input.trigger?(Input::DOWN)
@help_window.y = 500
end
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Menu.new(1)
return
end
if Input.trigger?(Input::C)
[url=home.php?mod=space&uid=260100]@skill[/url] = @skill_window.skill
if @skill == nil or not @actor.skill_can_use?(@skill.id)
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
if @skill.scope >= 3
@skill_window.active = false
@target_window.active = true
@slide = false
if @skill.scope == 4 || @skill.scope == 6
@target_window.index = -1
elsif @skill.scope == 7
@target_window.index = @actor_index - 10
else
@target_window.index = 0
end
else
if @skill.common_event_id > 0
$game_temp.common_event_id = @skill.common_event_id
$game_system.se_play(@skill.menu_se)
@actor.sp -= @skill.sp_cost
@status_window.refresh
@skill_window.refresh
@target_window.refresh
$scene = Scene_Map.new
return
end
end
return
end
if Input.trigger?(Input::R) or Input.trigger?(Input::RIGHT)
$game_system.se_play($data_system.cursor_se)
@actor_index += 1
@actor_index %= $game_party.actors.size
$scene = Scene_Skill.new(@actor_index)
return
end
if Input.trigger?(Input::L) or Input.trigger?(Input::LEFT)
$game_system.se_play($data_system.cursor_se)
@actor_index += $game_party.actors.size - 1
@actor_index %= $game_party.actors.size
$scene = Scene_Skill.new(@actor_index)
return
end
end
def update_target
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@skill_window.active = true
@target_window.active = false
@slide = true
return
end
if Input.trigger?(Input::C)
unless @actor.skill_can_use?(@skill.id)
$game_system.se_play($data_system.buzzer_se)
return
end
if @target_window.index == -1
used = false
for i in $game_party.actors
used |= i.skill_effect(@actor, @skill)
end
end
if @target_window.index <= -2
target = $game_party.actors[@target_window.index + 10]
used = target.skill_effect(@actor, @skill)
end
if @target_window.index >= 0
target = $game_party.actors[@target_window.index]
used = target.skill_effect(@actor, @skill)
end
if used
$game_system.se_play(@skill.menu_se)
@actor.sp -= @skill.sp_cost
@status_window.refresh
@skill_window.refresh
@target_window.refresh
if $game_party.all_dead?
$scene = Scene_Gameover.new
return
end
if @skill.common_event_id > 0
$game_temp.common_event_id = @skill.common_event_id
$scene = Scene_Map.new
return
end
end
unless used
$game_system.se_play($data_system.buzzer_se)
end
return
end
end
end
复制代码
放在战斗技能脚本:
class Scene_Battle
attr_reader :status_window
attr_accessor :force
attr_writer :external_wait
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
if $game_system.timer_working and $game_system.timer == 0
$game_temp.battle_abort = true
end
@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
$game_system.bgm_play($game_temp.map_bgm)
battle_end(1)
return
end
if @external_wait = true
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
end
end
def update_phase4
if @external_wait
return
end
case @phase4_step
when 1
update_phase4_step1
when 2
update_phase4_step2
when 3
update_phase4_step3
when 4
update_phase4_step4
when 5
update_phase4_step5
when 6
update_phase4_step6
end
end
def atb_setup
##########################################################################
###################### CUSTOMIZAÇÃO ######################################
##########################################################################
speed = 100 #Velocidade da batalha.
@active = 0 #Definição do sistema de turnos
#0 = ESPERA
# Os inimigos não atacam quando o battler estiver ativo
# Os inimigos não atacam quando estiver acessando os menus
# Os inimigos não atacam quando estiver posicionando o cursor
# sobre o alvo.
#1 = SEMI ATIVO 1
# Os inimigos não atacam quando estiver acessando os menus.
# Os inimigos não atacam quando estiver posicionando o cursor
# sobre o alvo.
#2 = SEMI ATIVO 2
# Os inimigos não atacam quando estiver posicionando o cursor
# sobre o alvo.
#3 = ATIVO
# Ação tota.
@anime_wait = true
# Sistema de tempo real vai esperar a animação.
@damage_wait = 3
# Tempo para acionar a próxima ação apos o dano.
##########################################################################
[url=home.php?mod=space&uid=316545]@force[/url] = 2
@escape == false
[url=home.php?mod=space&uid=25307]@Max[/url] = 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
def battle_end(result)
$game_temp.in_battle = false
$game_party.clear_actions
for actor in $game_party.actors
actor.remove_states_battle
end
$game_troop.enemies.clear
if $game_temp.battle_proc != nil
$game_temp.battle_proc.call(result)
$game_temp.battle_proc = nil
end
$scene = Scene_Map.new
@status_window.visible = false
# @spriteset.dispose
Graphics.transition
if result == 0
display_lv_up(@exp, @gold, @treasures)
loop do
Graphics.update
Input.update
if Input.trigger?(Input::C)
break
end
Audio.me_stop
end
trash_lv_up
end
end
def main
if $data_system.battle_transition == ""
Graphics.transition(20)
else
Graphics.transition(60, "Graphics/Transitions/" + "gradation16")
end
Graphics.freeze
@lvup_window = []
@show_dummies = true
$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)
atb_setup
@actor_command_windows = []
setup_actor_command_windows
@party_command_window = Window_PartyCommand.new
@help_window = Window_Help3.new
@help_window.back_opacity = 255
@help_window.opacity = 255
@help_window.visible = false
#-------------------------------------------
@help_window2 = Window_Help2.new
@help_window2.opacity = 0
@help_window2.visible = false
@help_window3 = Window_Help4.new
@help_window3.opacity = 0
@help_window3.visible = false
@status_window = Window_BattleStatus.new
@status_window.y = 130
@status_window.contents_opacity = 0
#-----------------------------------------------------------------
if ($luz != nil)
@luz = Plane.new
@luz.z = -10
@luz.bitmap = RPG::Cache.picture($luz)
end
#-----------------------------------------------------------------
@message_window = Window_Message.new
@spriteset = Spriteset_Battle.new
@wait_count = 0
if $data_system.battle_transition == ""
Graphics.transition(20)
else
Graphics.transition(60, "Graphics/Transitions/" +
$data_system.battle_transition)
end
start_phase1
loop do
Graphics.update
if @status_window.y > -25
@status_window.y -= 4
@status_window.contents_opacity += 4
end
#-----------------------------------------------
Input.update
update
if $scene != self
break
end
end
$game_map.refresh
Graphics.freeze
for i in 0..$game_party.actors.size - 1
@actor_command_windows[i].dispose
end
#--------------------------------------------------------------------------
if ($luz != nil)
@luz.dispose
end
#--------------------------------------------------------------------------
if (@vitoria != nil)
@vitoria.dispose
end
if (@vitoria2 != nil)
@vitoria2.dispose
end
@help_window2.dispose
@help_window3.dispose
#---------------------------------------------------------------------------
@help_window.dispose
@party_command_window.dispose
@status_window.dispose
@message_window.dispose
@spriteset.dispose
@lvup_window = nil
@level_up = nil
@ch_stats = nil
@ch_compare_stats = nil
if @skill_window != nil
@skill_window.dispose
end
#----------------------------
if @skill_window2 != nil
@skill_window2.dispose
end
#----------------------------
if @item_window != nil
@item_window.dispose
end
if @result_window != nil
@result_window.dispose
end
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 ($luz_x != nil)
@luz.ox += $luz_x
end
if ($luz_y != nil)
@luz.oy += $luz_y
end
#-------------------------------
if $game_system.battle_interpreter.running?
if @command.size > 0
@command_a = false
@command = []
command_delete
end
@status_window.at_refresh
$game_system.battle_interpreter.update
if $game_temp.forcing_battler == nil
unless $game_system.battle_interpreter.running?
unless judge
@status_window.refresh
setup_battle_event
end
end
end
end
$game_system.update
$game_screen.update
if $game_system.timer_working and $game_system.timer == 0
$game_temp.battle_abort = true
end
@help_window.update
@help_window2.update
@help_window3.update
@party_command_window.update
for i in 0..$game_party.actors.size - 1
member = $game_party.actors[i]
if member.battle_commands != @actor_command_windows[i].commands
setup_actor_command_windows
end
if member != nil
@actor_command_windows[i].update
end
end
@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(80, "Graphics/Transitions/" +
$game_temp.transition_name)
end
end
if $game_temp.message_window_showing
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
$game_system.bgm_play($game_temp.map_bgm)
battle_end(1)
return
end
case @phase
when 0
if anime_wait_return
update_phase0
end
when 1
update_phase1
return
when 2
update_phase2
return
when 5
update_phase5
return
end
if $scene != self
return
end
if @phase == 0
if @command.size != 0
if @command_a == false
start_phase3
end
update_phase3
end
if @wait_count > 0
@wait_count -= 1
return
end
update_phase4
end
end
def update_phase0
if $game_temp.battle_turn == 0
$game_temp.battle_turn = 1
end
if @command_a == false and @party == false
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@party = true
end
end
if @party == true and @phase4_step == 1
start_phase2
return
end
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
@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
def start_phase2
@phase = 2
@party = false
@actor_index = -1
for i in 0..3
if $game_party.actors[i] != nil
@actor_command_windows[i].active = false
@actor_command_windows[i].visible = false
end
end
if @command.size != 0
if @active_actor != nil
@active_actor.blink = false
end
end
$game_temp.battle_main_phase = false
end
def update_phase2
@escape = false
@phase = 0
if $game_temp.battle_turn == 0
$game_temp.battle_turn = 1
end
if @command_a == true
start_phase3
else
$game_temp.battle_main_phase = true
end
end
#-------Tela de Vitória-----------------
def start_phase5
for actor in $game_party.actors
actor.victory = true
end
@phase = 5
case rand(2)
when 0
Audio.me_play("Audio/me/Vit02", 100, 100)
when 1
Audio.me_play("Audio/me/Vit03", 100, 100)
end
$game_system.bgm_play($game_temp.map_bgm)
exp = 0
gold = 0
treasures = []
if @active_actor != nil
@active_actor.blink = false
end
$game_temp.battle_main_phase = true
@party_command_window.active = false
@party_command_window.visible = false
for i in 0..$game_party.actors.size - 1
if $game_party.actors[i] != nil
@actor_command_windows[i].active = false
@actor_command_windows[i].visible = false
end
end
if @skill_window != nil
@skill_window.dispose
@skill_window = nil
end
if @item_window != nil
@item_window.dispose
@item_window = nil
end
@help_window.visible = false
@help_window2.visible = false
@help_window3.visible = false
for enemy in $game_troop.enemies
unless enemy.hidden
exp += enemy.exp
gold += enemy.gold
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
@treasures = treasures
@exp = exp
@gold = gold
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
@phase5_wait_count = 130
end
def update_phase5
if @phase5_wait_count > 0
@phase5_wait_count -= 1
if @phase5_wait_count == 0
$game_temp.battle_main_phase = false
end
return
end
battle_end(0)
end
def display_lv_up(exp, gold, treasures)
$d_dum = false
d_extra = 0
i = 0
for actor in $game_party.actors
@lvup_window[i] = Window_LevelUp.new($game_party.actors[i], i)
i += 1
end
if @show_dummies == true
$d_dum = true
for m in i..3
@lvup_window[m] = Window_LevelUp.new(m, m)
end
end
###### #inicio da tela de Vitória
@vitoria = Plane.new
@vitoria.bitmap = RPG::Cache.picture("menu_vit")
@vitoria.opacity = 255
@vitoria.z = 9999
@vitoria2 = Window_Sup.new
@exp_window = Window_EXP.new(exp)
@exp_window.z = 10000
@exp_window.x = 600
@exp_window.y = 315
@exp_window.opacity = 0
@m_i_window = Window_Money_Items.new(gold, treasures)
@m_i_window.z = 111000
@m_i_window.visible = true
@m_i_window.opacity = 0
@press_enter = nil
gainedexp = exp
@level_up = [0, 0, 0, 0]
@d_new_skill = ["", "", "", ""]
@d_breakout = false
@m_i_window.refresh(gold)
wait_for_OK
@d_remember = $game_system.bgs_memorize
for i in 0..50
if @exp_window.x > 260
@exp_window.x -= 10
end
Graphics.update
end
Audio.bgs_play("Audio/SE/032-Switch01.ogg", 100, 300)
for n in 0..gainedexp - 1
exp -= 1
if @d_breakout == false
Input.update
end
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 += 1
if @d_breakout == false
@lvup_window[i].refresh
@exp_window.refresh(exp)
end
if actor.level > last_level
@level_up[i] = 15
Audio.se_play("Audio/SE/056-Right02.ogg", 70, 150)
if $d_new_skill
@d_new_skill[i] = $d_new_skill
end
end
if @level_up[i] == 0
@d_new_skill[i] = ""
end
if @level_up[i] > 0
@lvup_window[i].level_up
if @d_new_skill[i] != ""
@lvup_window[i].learn_skill(@d_new_skill[i])
end
end
if Input.trigger?(Input::C)
@d_breakout = true
Audio.me_stop
end
end
if @d_breakout == false
if @level_up[i] > 0
#@level_up[i] -= 1
end
Graphics.update
end
end
if @d_breakout == true
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
actor.exp += exp
end
exp = 0
break
end
end
Audio.bgs_stop
@d_remember = $game_system.bgs_restore
for i in 0...$game_party.actors.size
@lvup_window[i].refresh
end
@exp_window.refresh(exp)
Audio.se_play("Audio/SE/006-System06.ogg", 70, 150)
$game_party.gain_gold(gold)
@m_i_window.refresh(0)
Graphics.update
end
def trash_lv_up
i=0
for i in 0 ... 4
@lvup_window[i].visible = false
end
@exp_window.visible = false
@m_i_window.visible = false
@lvup_window = nil
@exp_window = nil
@m_i_window = nil
end
def wait_for_OK
loop do
Input.update
Graphics.update
if Input.trigger?(Input::C)
# Audio.me_fade(800)
# Audio.me_stop
break
end
end
end
##Fim da tela de Vitória###############################################################
def start_phase3
$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
def phase3_setup_command_window
@party_command_window.active = false
@party_command_window.visible = false
for i in 0..$game_party.actors.size - 1
if $game_party.actors[i] != nil
@actor_command_windows[i].active = false
@actor_command_windows[i].visible = false
end
end
@actor_command_windows[@actor_index].active = true
@actor_command_windows[@actor_index].visible = true
@actor_command_windows[@actor_index].index = 0
end
def phase3_next_actor
@command.shift
@command_a = false
$game_temp.battle_main_phase = true
for i in 0..$game_party.actors.size - 1
if $game_party.actors[i] != nil
@actor_command_windows[i].active = false
@actor_command_windows[i].visible = false
end
end
if @active_actor != nil
@active_actor.blink = false
end
@action_battlers.push(@active_actor)
return
end
def enemy_action(number)
enemy = $game_troop.enemies[number]
unless enemy.current_action.forcing
enemy.make_action
end
@action_battlers.push(enemy)
end
def update_phase3
if @enemy_arrow != nil
update_phase3_enemy_select
return
elsif @actor_arrow != nil
update_phase3_actor_select
return
elsif @skill_window != nil
update_phase3_skill_select
return
elsif @item_window != nil
update_phase3_item_select
return
end
for i in 0..$game_party.actors.size - 1
if @actor_command_windows[i].active
update_phase3_basic_command
return
end
end
end
def start_skill_select_for_type(skill_kind)
@skill_window = Window_Skill2.new(@active_actor, skill_kind)
@skill_window2 = Window_Skill3.new(@active_actor)
@skill_window.help_window = @help_window
for i in 0..$game_party.actors.size - 1
if $game_party.actors[i] != nil
@actor_command_windows[i].active = false
@actor_command_windows[i].visible = false
end
end
end
def update_phase3_basic_command
unless @active_actor.inputable?
@active_actor.current_action.clear
phase3_next_actor
return
end
if Input.trigger?(Input::B) and @party == false
$game_system.se_play($data_system.cancel_se)
@party = true
end
if @party == true and @phase4_step == 1
start_phase2
return
end
if Input.trigger?(Input::C)
y = @active_actor.battle_commands
x = y[@actor_command_windows[@actor_index].index]
case x
when "Atacar"
$game_system.se_play($data_system.decision_se)
@active_actor.current_action.kind = 0
@active_actor.current_action.basic = 0
start_enemy_select
when "Habilidade"
$game_system.se_play($data_system.decision_se)
@active_actor.current_action.kind = 1
@active_actor.skill_kind = "Skill"
start_skill_select_for_type(-1)
when "Defender"
$game_system.se_play($data_system.decision_se)
@active_actor.current_action.kind = 0
@active_actor.current_action.basic = 1
phase3_next_actor
when "Item"
$game_system.se_play($data_system.decision_se)
@active_actor.current_action.kind = 2
start_item_select
when "Fugir"
if $game_temp.battle_can_escape == false
@help_window.set_text("Não pode escapar!")
else
$game_system.se_play($data_system.decision_se)
@active_actor.current_action.kind = 3
phase3_next_actor
end
when $SKILL_KINDS[0]
$game_system.se_play($data_system.decision_se)
@active_actor.current_action.kind = 1
@active_actor.skill_kind = $SKILL_KINDS[0]
start_skill_select_for_type(0 + $SKILL_OFFSET)
when $SKILL_KINDS[1]
$game_system.se_play($data_system.decision_se)
@active_actor.current_action.kind = 1
@active_actor.skill_kind = $SKILL_KINDS[1]
start_skill_select_for_type(1 + $SKILL_OFFSET)
when $SKILL_KINDS[2]
$game_system.se_play($data_system.decision_se)
@active_actor.current_action.kind = 1
@active_actor.skill_kind = $SKILL_KINDS[2]
start_skill_select_for_type(2 + $SKILL_OFFSET)
when $SKILL_KINDS[3]
$game_system.se_play($data_system.decision_se)
@active_actor.current_action.kind = 1
@active_actor.skill_kind = $SKILL_KINDS[3]
start_skill_select_for_type(3 + $SKILL_OFFSET)
when $SKILL_KINDS[4]
$game_system.se_play($data_system.decision_se)
@active_actor.current_action.kind = 1
@active_actor.skill_kind = $SKILL_KINDS[4]
start_skill_select_for_type(4 + $SKILL_OFFSET)
# Caso quiser mais comandos, copie os códigos acima
#e cole aqui
end
return
end
if Input.trigger?(Input::R)
$game_system.se_play($data_system.cursor_se)
@party = false
if @active_actor != nil
@active_actor.blink = false
end
@command.push(@command[0])
@command.shift
@command_a = false
$game_temp.battle_main_phase = true
for i in 0..$game_party.actors.size - 1
if $game_party.actors[i] != nil
@actor_command_windows[i].active = false
@actor_command_windows[i].visible = false
end
end
end
if Input.trigger?(Input::L)
$game_system.se_play($data_system.cursor_se)
@party = false
if @active_actor != nil
@active_actor.blink = false
end
@command.unshift(@command[@command.size - 1])
@command.delete_at(@command.size - 1)
@command_a = false
$game_temp.battle_main_phase = true
for i in 0..$game_party.actors.size - 1
if $game_party.actors[i] != nil
@actor_command_windows[i].active = false
@actor_command_windows[i].visible = false
end
end
end
if Input.trigger?(Input::DOWN)
$game_system.se_play($data_system.cursor_se)
@party = false
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
$game_temp.battle_main_phase = true
for i in 0..$game_party.actors.size - 1
if $game_party.actors[i] != nil
@actor_command_windows[i].active = false
@actor_command_windows[i].visible = false
end
end
end
if Input.trigger?(Input::UP)
$game_system.se_play($data_system.cursor_se)
@party = false
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
$game_temp.battle_main_phase = true
for i in 0..$game_party.actors.size - 1
if $game_party.actors[i] != nil
@actor_command_windows[i].active = false
@actor_command_windows[i].visible = false
end
end
end
end
def start_enemy_select
@enemy_arrow = Arrow_Enemy.new(@spriteset.viewport1)
@enemy_arrow.help_window = @help_window
for i in 0..$game_party.actors.size - 1
if $game_party.actors[i] != nil
@actor_command_windows[i].active = false
@actor_command_windows[i].visible = false
end
end
end
def end_enemy_select
@enemy_arrow.dispose
@enemy_arrow = nil
y = @active_actor.battle_commands
x = y[@actor_command_windows[@actor_index].index]
if x == "Atacar"
@actor_command_windows[@actor_index].active = true
@actor_command_windows[@actor_index].visible = true
@help_window.visible = false
@help_window2.visible = false
end
end
def start_actor_select
@actor_arrow = Arrow_Actor.new(@spriteset.viewport2)
@actor_arrow.index = @actor_index
@actor_arrow.help_window = @help_window
for i in 0..$game_party.actors.size - 1
if $game_party.actors[i] != nil
@actor_command_windows[i].active = false
@actor_command_windows[i].visible = false
end
end
end
def end_skill_select
@skill_window.dispose
@skill_window2.dispose
@skill_window2 = nil
@skill_window = nil
@help_window.visible = false
@help_window2.visible = false
@help_window3.visible = false
@actor_command_windows[@actor_index].active = true
@actor_command_windows[@actor_index].visible = true
end
def start_item_select
@item_window = Window_Item2.new
@item_window.help_window = @help_window
for i in 0..$game_party.actors.size - 1
if $game_party.actors[i] != nil
@actor_command_windows[i].active = false
@actor_command_windows[i].visible = false
end
end
end
def end_item_select
@item_window.dispose
@item_window = nil
@help_window.visible = false
@help_window2.visible = false
@help_window3.visible = false
@actor_command_windows[@actor_index].active = true
@actor_command_windows[@actor_index].visible = true
end
def setup_actor_command_windows
if @actor_command_windows != []
for i in 0..@actor_command_windows.size - 1
@actor_command_windows[i].dispose
end
end
@actor_command_windows = []
for i in 0..$game_party.actors.size - 1
member = $game_party.actors[i]
if member != nil
@actor_command_windows[i] = Window_BattleCommand.new(member, 640)
@actor_command_windows[i].x = 0
@actor_command_windows[i].y = 0
@actor_command_windows[i].back_opacity = 160
@actor_command_windows[i].active = false
@actor_command_windows[i].visible = false
@actor_command_windows[i].height = 320 + member.battle_commands.length * 32 + 50
# @actor_command_windows[i].height = member.battle_commands.length * 32 + 32
end
end
end
def update_phase3_skill_select
unless @active_actor.inputable?
@active_actor.current_action.clear
command_delete
phase3_next_actor
return
end
@skill_window.visible = true
@skill_window.update
@skill_window2.update
@skill_window2.visible = true
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
end_skill_select
return
end
if Input.trigger?(Input::C)
@skill = @skill_window.skill
if @skill == nil or not @active_actor.skill_can_use?(@skill.id)
$game_system.se_play($data_system.buzzer_se)
return
end
if @skill.scope == 1 or @skill.scope == 2
if fin?
$game_system.se_play($data_system.buzzer_se)
return
end
end
$game_system.se_play($data_system.decision_se)
@active_actor.current_action.skill_id = @skill.id
#@skill_window.visible = false
if @skill.scope == 1
start_enemy_select
elsif @skill.scope == 3 or @skill.scope == 5
start_actor_select
else
@active_actor.current_action.kind = 1
end_skill_select
phase3_next_actor
end
return
end
end
def update_phase3_item_select
unless @active_actor.inputable?
@active_actor.current_action.clear
command_delete
phase3_next_actor
return
end
@item_window.visible = true
@item_window.update
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
end_item_select
return
end
if Input.trigger?(Input::C)
@item = @item_window.item
unless $game_party.item_can_use?(@item.id)
$game_system.se_play($data_system.buzzer_se)
return
end
if @item.scope == 1 or @item.scope == 2
if fin?
$game_system.se_play($data_system.buzzer_se)
return
end
end
$game_system.se_play($data_system.decision_se)
@active_actor.current_action.item_id = @item.id
@item_window.visible = true#false
if @item.scope == 1
start_enemy_select
elsif @item.scope == 3 or @item.scope == 5
start_actor_select
else
@active_actor.current_action.kind = 2
end_item_select
phase3_next_actor
end
return
end
end
def update_phase3_enemy_select
if fin?
end_enemy_select
return
end
unless @active_actor.inputable?
@active_actor.current_action.clear
command_delete
phase3_next_actor
return
end
@enemy_arrow.update
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
end_enemy_select
return
end
if Input.trigger?(Input::C)
$game_system.se_play($data_system.decision_se)
@active_actor.current_action.kind = 0
@active_actor.current_action.basic = 0
@active_actor.current_action.target_index = @enemy_arrow.index
end_enemy_select
if @skill_window != nil
@active_actor.current_action.kind = 1
end_skill_select
end
if @item_window != nil
@active_actor.current_action.kind = 2
end_item_select
end
phase3_next_actor
end
end
def update_phase3_actor_select
unless @active_actor.inputable?
@active_actor.current_action.clear
command_delete
phase3_next_actor
return
end
@actor_arrow.update
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
end_actor_select
return
end
if Input.trigger?(Input::C)
$game_system.se_play($data_system.decision_se)
@active_actor.current_action.kind = 0
@active_actor.current_action.basic = 0
@active_actor.current_action.target_index = @actor_arrow.index
end_actor_select
if @skill_window != nil
@active_actor.current_action.kind = 1
end_skill_select
end
if @item_window != nil
@active_actor.current_action.kind = 2
end_item_select
end
phase3_next_actor
end
end
def start_skill_select
@skill_window = Window_Skill.new(@active_actor)
@skill_window.help_window = @help_window
@actor_command_window.active = false
@actor_command_window.visible = false
end
def start_phase4
$game_temp.battle_main_phase = true
end
def update_phase4_step1
if judge
return
end
if $game_temp.forcing_battler == nil
setup_battle_event
if $game_system.battle_interpreter.running?
return
end
end
if $game_temp.forcing_battler != nil
battler = $game_temp.forcing_battler
@action_battlers.delete(battler)
@action_battlers.unshift(battler)
battler.at = @max
battler.atp = 100 * battler.at / @max
end
if @action_battlers.size == 0
return
end
@animation1_id = 0
@animation2_id = 0
@common_event_id = 0
@active_battler = @action_battlers[0]
if @active_battler.index == nil
@action_battlers.shift
anime_wait_return
return
end
unless active?(@active_battler)
unless @active_battler.inputable?
@phase4_step = 6
return
end
end
if @active_battler.current_action.kind == 1 and
(not @active_battler.current_action.forcing or @force < 2)
if @active_battler.rtp == 0
skill_reset(@active_battler)
recite_time(@active_battler)
if @active_battler.rtp > 0
@action_battlers.shift
end
synthe_spell(@active_battler)
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
if @active_battler != nil
@active_battler.blink = false
end
@phase4_step = 2
end
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
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
when 3
@phase4_step = 6
update_phase2_escape
@wait_count = 5
end
if @phase4_step == 2
@phase4_step = 3
end
end
def make_basic_action_result
if @active_battler.current_action.basic == 0
@animation1_id = @active_battler.animation1_id
@animation2_id = @active_battler.animation2_id
if @active_battler.is_a?(Game_Enemy)
if @active_battler.restriction == 3
target = $game_troop.random_target_enemy
elsif @active_battler.restriction == 2
target = $game_party.random_target_actor
else
index = @active_battler.current_action.target_index
target = $game_party.smooth_target_actor(index)
end
end
if @active_battler.is_a?(Game_Actor)
if @active_battler.restriction == 3
target = $game_party.random_target_actor
elsif @active_battler.restriction == 2
target = $game_troop.random_target_enemy
else
index = @active_battler.current_action.target_index
target = $game_troop.smooth_target_enemy(index)
end
end
@active_battler.target_x = target.screen_x
@active_battler.target_y = target.screen_y
@active_battler.target = target
@target_battlers = [target]
return
end
if @active_battler.current_action.basic == 1
@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
@help_window.set_text("“¦‚°‚é", 1)
@active_battler.escape
return
end
if @active_battler.current_action.basic == 3
$game_temp.forcing_battler = nil
@phase4_step = 6
return
end
end
def make_skill_action_result
@skill = $data_skills[@active_battler.current_action.skill_id]
speller = synthe?(@active_battler)
unless @active_battler.current_action.forcing
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)
$game_temp.forcing_battler = nil
@phase4_step = 6
return
end
end
end
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
@status_window.refresh
@help_window2.set_text(@skill.name, 1)
@animation1_id = @skill.animation1_id
@animation2_id = @skill.animation2_id
@common_event_id = @skill.common_event_id
set_target_battlers(@skill.scope)
for target in @target_battlers
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
def make_item_action_result
@item = $data_items[@active_battler.current_action.item_id]
unless $game_party.item_can_use?(@item.id)
@phase4_step = 6
return
end
if @item.consumable
$game_party.lose_item(@item.id, 1)
end
@help_window3.set_text(@item.name, 1)
@animation1_id = @item.animation1_id
@animation2_id = @item.animation2_id
@common_event_id = @item.common_event_id
index = @active_battler.current_action.target_index
target = $game_party.smooth_target_actor(index)
set_target_battlers(@item.scope)
for target in @target_battlers
target.item_effect(@item)
end
end
def update_phase4_step3
if @animation1_id == 0
if (@active_battler.current_action.basic == 0) and
(@active_battler.current_action.kind == 0)
@active_battler.moving = true
@active_battler.move_init = true
@external_wait = true
end
@wait_count = 15
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
@phase4_step = 4
end
def update_phase4_step4
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
#
if @active_battler.current_action.kind == 0
if target.damage != nil
target.damage_pop = true
$active_battler = @active_battler
target.damage_effect(@active_battler.current_action.kind)
@wait_count = @damage_wait
end
end
#
end
@phase4_step = 5
end
def update_phase4_step5
@help_window.visible = false
@help_window2.visible = false
@help_window3.visible = false
for target in @target_battlers
if target.damage != nil and
@active_battler.current_action.kind != 0
target.damage_pop = true
$active_battler = @active_battler
target.damage_effect(@active_battler.current_action.kind)
@wait_count = @damage_wait
end
end
@status_window.refresh
@phase4_step = 6
end
def update_phase4_step6
$game_temp.forcing_battler = nil
@active_battler.current_action.forcing = false
refresh_phase(@active_battler)
@action_battlers.shift
unless @active_battler.movable?
@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
@status_window.refresh
if @common_event_id > 0
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
for index in 0...$data_troops[@troop_id].pages.size
page = $data_troops[@troop_id].pages[index]
if page.span == 1
$game_temp.battle_event_flags[index] = false
end
end
end
@phase4_step = 1
end
def refresh_phase(battler)
battler.at %= @max
if battler.movable?
battler.atp = 100 * @active_battler.at / @max
end
spell_reset(battler)
if battler.hp > 0 and battler.slip_damage?
battler.slip_damage_effect
battler.damage_pop = true
end
battler.remove_states_auto
unless battler.movable?
return
end
@turn_cnt += 1
end
def anime_wait_return
if (@action_battlers.size == 0 or @anime_wait == false) and
not $game_system.battle_interpreter.running?
if @enemy_arrow != nil
return [@active - 2, 0].min == 0
elsif @actor_arrow != nil
return [@active - 2, 0].min == 0
elsif @skill_window != nil
return [@active - 3, 0].min == 0
elsif @item_window != nil
return [@active - 3, 0].min == 0
else
for i in 0..$game_party.actors.size - 1
if @actor_command_windows[i].active
return [@active - 1, 0].min == 0
end
end
return true
end
else
return false
end
end
def command_delete
if @enemy_arrow != nil
end_enemy_select
elsif @actor_arrow != nil
end_actor_select
end
if @skill_window != nil
end_skill_select
elsif @item_window != nil
end_item_select
end
for i in 0..$game_party.actors.size - 1
if @actor_command_windows[i].active
@command.shift
@command_a = false
$game_temp.battle_main_phase = true
for i in 0..$game_party.actors.size - 1
if $game_party.actors[i] != nil
@actor_command_windows[i].active = false
@actor_command_windows[i].visible = false
end
end
if @active_actor != nil
@active_actor.blink = false
end
end
end
end
def recite_time(battler)
end
def synthe_spell(battler)
end
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
def synthe?(battler)
for speller in @synthe
if speller.include?(battler)
return speller
end
end
return nil
end
def synthe_delete?(speller)
for battler in speller
unless battler.inputable?
synthe_delete(speller)
return true
end
end
return false
end
def synthe_delete(speller)
for battler in speller
spell_reset(battler)
@action_battlers.delete(battler)
end
@synthe.delete(speller)
end
def skill_reset(battler)
speller = synthe?(battler)
if speller != nil
synthe_delete(speller)
else
spell_reset(battler)
end
end
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
def fin?
for battler in $game_troop.enemies
if battler.hp != 0
return false
end
end
return true
end
end
复制代码
上面的话,战斗技能菜单正常,系统技能菜单出错,放在下面的话,系统技能菜单正常,战斗技能菜单出错。
作者:
江南小帅瓜
时间:
2014-5-17 23:44
芯☆淡茹水 发表于 2014-5-17 21:50
参数错误,请帖上脚本:Window_Skill2
自己解决了,还是要谢谢你。。。
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X5.0