赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 0 |
经验 | 0 |
最后登录 | 2012-6-10 |
在线时间 | 0 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 275
- 在线时间
- 0 小时
- 注册时间
- 2012-5-12
- 帖子
- 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
复制代码 |
评分
-
查看全部评分
|