| 赞 | 8 |
| VIP | |
| 好人卡 | |
| 积分 | 23 |
| 经验 | |
| 最后登录 | 2026-6-12 |
| 在线时间 | 1010 小时 |
- 梦石
- 0
- 星屑
- 2306
- 在线时间
- 1010 小时
- 注册时间
- 2012-4-30
- 回帖
- 1455

|
发表于 2012-6-7 19:43:58
|
显示全部楼层
本帖最后由 铅笔描绘的思念 于 2012-6-7 19:45 编辑
如果是加个窗口来确定是否逃跑的话。。。脚本送上
[pre lang="ruby" line="1"]#==============================================================================
# ■ Window_ConfirmRun
#------------------------------------------------------------------------------
# 战斗界面中确定逃跑两个选项的窗口
#==============================================================================
class Window_ConfirmRun < Window_HorzCommand
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize(yes, no)
@yes = yes
@no = no
super(544/2, 416/2) #
self.visible = false
self.active = false
@index = 0
end
#--------------------------------------------------------------------------
# ● 桁数の取得
#--------------------------------------------------------------------------
def col_max
return 2
end
#--------------------------------------------------------------------------
# ● コマンドリストの作成
#--------------------------------------------------------------------------
def make_command_list
add_command(@yes, :yes)
add_command(@no, :cancel)
end
#--------------------------------------------------------------------------
# ● 決定ボタンが押されたときの処理
#--------------------------------------------------------------------------
def process_ok
Input.update
call_ok_handler
end
#--------------------------------------------------------------------------
# ● 按下取消键时的处理
#--------------------------------------------------------------------------
def process_cancel
Input.update
call_cancel_handler
end
#--------------------------------------------------------------------------
# ● 启用窗口
#--------------------------------------------------------------------------
def activate
temp = self.y + self.height - Graphics.height
if temp > 0
self.y -= (temp + 12)
end
self.active = true
self
end
end
class Scene_Battle < Scene_Base
#--------------------------------------------------------------------------
# ● 生成所有窗口
#--------------------------------------------------------------------------
def create_all_windows
create_message_window
create_scroll_text_window
create_log_window
create_status_window
create_info_viewport
create_party_command_window
create_actor_command_window
create_help_window
create_skill_window
create_item_window
create_actor_window
create_enemy_window
create_confirm_window
end
def create_confirm_window
@window_confirm = Window_ConfirmRun.new("逃跑", "我手贱")
@window_confirm.set_handler(:yes, method(:do_escape))
@window_confirm.set_handler(:cancel, method(:do_cancel))
@window_confirm.hide
end
def do_escape
turn_start unless BattleManager.process_escape
end
def do_cancel
Sound.play_cancel
@window_confirm.index = 0
@window_confirm.visible = false
@window_confirm.deactivate
@window_confirm.hide
@party_command_window.setup
end
#--------------------------------------------------------------------------
# ● 指令“撤退”
#--------------------------------------------------------------------------
def command_escape
@window_confirm.show
@window_confirm.activate
@window_confirm.visible = true
@window_confirm.refresh
end
end [/pre] |
评分
-
| 参与人数 1 | 星屑 +200 |
梦石 +2 |
收起
理由
|
迷糊的安安
| + 200 |
+ 2 |
认可答案 附赠66RPG提供的精美好人卡一张^^. |
查看全部评分
|