Project1
标题: 求人看看这脚本怎么在神剑情天2 里不能用啊 [打印本页]
作者: shengyinyiji 时间: 2012-6-10 06:46
标题: 求人看看这脚本怎么在神剑情天2 里不能用啊
本帖最后由 忧雪の伤 于 2012-6-10 10:28 编辑
我想弄个自动攻击的脚本,于是找到了这个,可是显示41行有问题,怎么回事?- class Scene_Battle
- alias hzhj_next_actor phase3_next_actor
- alias hzhj_prior_actor phase3_prior_actor
- alias hzhj_setup_command_window phase3_setup_command_window
- alias update_hzhj_basic_command update_phase3_basic_command
- # alias s_e start_enemy_select
- # alias s_a start_actor_select
- alias battleback_map_main main
- def main
- @battleback_sprite = Spriteset_Map.new unless $BTEST
- battleback_map_main
- @battleback_sprite.dispose unless $BTEST
- end
- #--------------------------------------------------------------------------
- # ● 转到输入下一个角色的命令
- #--------------------------------------------------------------------------
- def phase3_next_actor
- @hzhj_arrow.dispose if not @hzhj_arrow.nil?
- @hzhj_arrow = nil
- @help_window.visible = false
- hzhj_next_actor
- end
- #--------------------------------------------------------------------------
- # ● 转向前一个角色的命令输入
- #--------------------------------------------------------------------------
- def phase3_prior_actor
- @hzhj_arrow.dispose if not @hzhj_arrow.nil?
- @hzhj_arrow = nil
- @help_window.visible = false
- hzhj_prior_actor
- end
- #--------------------------------------------------------------------------
- # ● 设置角色指令窗口
- #--------------------------------------------------------------------------
- def phase3_setup_command_window
- if Kboard.keyboard($R_Key_TAB)
- @hzhj_arrow = Arrow_Actor.new(@spriteset.viewport2)
- $按键[@active_battler.id] = 1
- else
- @hzhj_arrow = Arrow_Enemy.new(@spriteset.viewport4)
- $按键[@active_battler.id] = 0
- end
- @hzhj_arrow.help_window = @help_window
- hzhj_setup_command_window
- end
- #--------------------------------------------------------------------------
- # ● 刷新画面 (角色命令回合 : 基本命令)
- #--------------------------------------------------------------------------
- def update_phase3_basic_command
- @hzhj_arrow.visible = @actor_command_window.index == 0
- @help_window.visible = @hzhj_arrow.visible
- @hzhj_arrow.update if @hzhj_arrow.visible
- Mouse.click_unlock
- if Input.trigger?(Input::C)
- if @actor_command_window.index == 0
- $game_system.se_play($data_system.decision_se)
- @active_battler.current_action.kind = 0
- @active_battler.current_action.basic = 0
- @active_battler.current_action.target_index = @hzhj_arrow.index
- @actor_command_window.active = false
- @actor_command_window.visible = false
- phase3_next_actor
- return
- end
- end
- update_hzhj_basic_command
- end
- ################################################################
- def auto_battle
- $game_system.se_play($data_system.decision_se)
- if @active_battler.past_action == 1
- if @active_battler.skill_learn?(@active_battler.past_skill)
- @active_battler.current_action.kind = 1
- kds = rand($game_troop.enemies.size)
- @active_battler.current_action.skill_id = @active_battler.past_skill
- @active_battler.current_action.target_index = kds
- else
- $game_system.se_play($data_system.decision_se)
- @active_battler.current_action.kind = 0
- @active_battler.current_action.basic = 0
- if @active_battler.hp<(@active_battler.maxhp/8)and
- !@active_battler.skill_learn?(4)#吸血
- @active_battler.current_action.basic = 1
- end
- kds = rand($game_troop.enemies.size)
- @active_battler.current_action.target_index = kds
- phase3_next_actor
- end
- phase3_next_actor
- end
- start_phase4
- return
- end
- end
复制代码