查看: 2971|回复: 1

[已经解决] TAT研究了好久,应该怎样给66对话加强搞个使用开关

[复制链接]
梦石
0
星屑
50
在线时间
76 小时
注册时间
2016-2-12
回帖
14
发表于 2016-4-7 10:31:45 | 显示全部楼层 |阅读模式
悬赏2星屑已解决
TAT 首先66对话加强脚本用的R大那个 >>>https://rpg.blue/forum.php?mod=viewthread&tid=382811

想给脚本加个使用开关,比如打开开关101就可以使用66对话加强,

搜索了论坛的贴子,参考了控制fuki对话框的这个>>>https://rpg.blue/thread-369362-1-1.html

一步步学还是没有头绪,跪求大大放工程参考。(;´Д`)

最佳答案

查看完整内容

打开13号开关则切回默认的对话框窗口。 在事件里打开/关闭开关13时,需要在开关操作的前后设置【等待3帧】,否则对话框来不及消失就会再次判断。
梦石
0
星屑
9557
在线时间
5074 小时
注册时间
2013-6-21
回帖
3459

开拓者贵宾剧作品鉴家

发表于 2016-4-7 10:31:46 | 显示全部楼层
本帖最后由 RyanBern 于 2016-4-8 09:35 编辑

打开13号开关则切回默认的对话框窗口。

在事件里打开/关闭开关13时,需要在开关操作的前后设置【等待3帧】,否则对话框来不及消失就会再次判断。

对话加强-重制版
  1. #==============================================================================
  2. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  3. #------------------------------------------------------------------------------
  4. # 原版:趙雲
  5. # 重制:RyanBern  2015.08.24
  6. #------------------------------------------------------------------------------
  7. # 更新记录:
  8. #     2015.09.06    少许BUG修复,附加战斗场景对话效果
  9. #     2015.11.05    修复临时更改字号功能
  10. #     2015.11.13    增加更改姓名颜色的功能,修复显示 BUG
  11. #     2016.01.19    增加大型半身像对话框设置,快捷方式设置,高级快捷方式设置
  12. #==============================================================================

  13. #——说明

  14. # 使用时,要在Graphics文件夹下新建一个名为Faces的文件夹,用于存储头像
  15. # 对话框的窗口素材可不必和系统窗口相同,请将对话框窗口素材放到
  16. # Graphics/Windowskins文件夹下,并附上两个气泡箭头素材,用于指向说话者,
  17. # 命名规则为“对话框窗口素材名-top”和“对话框窗口素材名-under”
  18. # 然后在本脚本的设置区域修改。

  19. # 默认为一个字一个字的方式,如果需要一次全部显示,
  20. # 请在游戏中使用脚本:$game_system.typing = true
  21.       
  22. # 默认对话字没有声音,如果需要声音,
  23. # 请在游戏中使用脚本:$game_system.soundname_on_speak = "这里输入文件名"
  24. # 我唯一一个见过“胡乱配音”的游戏是天使帝国2代,该游戏说话的时候每个字符随机发一个外星语音

  25. # 其他在对话中可以使用的功能:
  26.   
  27. # \n[1]:显示1号角色的姓名

  28. # \name[李逍遥]:显示一个“李逍遥”方框,表示说话人姓名
  29. # \nc[0-7]:更改姓名框颜色

  30. # 非战斗时,\p功能可以自动调整对话框位置
  31. # \p[1] :对话框出现在1号事件的上方
  32. # \p[0] :主人公上方出现对话框
  33. # \p[-1]:对话框出现在屏幕下方,这种特殊类型的对话框在有大型半身像时使用
  34. #——————————————————使用\p功能后可以自动调整对话框大小
  35. # 使用\p功能后,使用事件指令[更改文章选项]可更改对话框的位置
  36. #   [上] :对话框出现在说话者上方
  37. #   [下] :对话框出现在说话者下方
  38. #   [中] :对话框出现在屏幕正中
  39. # 战斗时,\p功能有所变化
  40. # \p[1]:对话框出现在ID为1的角色战斗图附近(这个角色必须是队伍中的成员)
  41. # \p[1001]:对话框出现在Index为1的敌人战斗图附近--也就是说敌人的位置从
  42. #           1001开始算起,1002则是代表Index为2的敌人。
  43. # 战斗时使用\p指令+[更改文章选项]依然是有效的,但是如果不使用\p指令,那么
  44. # 对话框则会一直出现在屏幕正上方。

  45. # \\:显示""这个符号

  46. # \v[1] :显示变量1

  47. # \v[a1] :显示防具1

  48. # \v[w1] :显示武器1

  49. # \v[i1] :显示物品1

  50. # \v[s1] :显示特技1

  51. # \ic[001-Weapon01] : 显示图标"001-Weapon01.png"

  52. # \c[0-7]:更改颜色

  53. # \g:显示金钱窗口

  54. # \a[SE文件名]:对话的时候播放SE

  55. # \s[1-19]:更改弹字的速度

  56. # \.   :停顿一刹那(1、2帧)
  57. # \|   :停顿片刻(20帧)

  58. # \>   :文字不用打字方式
  59. # \<   :文字使用打字方式

  60. # \!   :等待玩家按回车再继续
  61. # \~   :文字直接消失

  62. # \I   :下一行从这个位置开始

  63. # \o[123]:文字透明度改为123,模拟将死之人(汗)

  64. # \h[12]:改用12号字

  65. # \b[50]:空50象素

  66. # \K[今天天气不错]:在出现“今天天气不错”这几个字的时候播放$game_system.soundname_on_speak设置的音效

  67. # \L[001]:在左边显示图片“Graphics/Faces/001.png”,并左右镜像反转
  68. # \R[001]:在右边显示图片“Graphics/Faces/001.png”

  69. #==============================================================================
  70. # 设置区域
  71. #==============================================================================
  72. module RB
  73. end
  74. module RB::Mes_Config
  75.   # 主角名字字符缩写
  76.   Regex_Player_Name = /pn(\d+)/
  77.   # 字体大小
  78.   Size = 18
  79.   # 对话框窗口皮肤(不写为和系统皮肤相同)
  80.   Mes_Windowskin = "001-Blue01"
  81.   # 最大行数(初值为 4,尽量不要修改,如果考虑合并选择项和文章,可以设置为 6 以上)
  82.   # 此最大行数仅在 \p 指令下有效,如果不使用 \p 指令那么对话框还是 4 行的高度
  83.   Max_Lines = 4
  84.   # 快捷指令,定义后,可以直接在文本框中输入快捷指令
  85.   # 定义方式为 快捷指令 => 完整指令 ,使用方式为 \sc[快捷指令]
  86.   # 注意,指令中通常包含反斜线'\',因此需要使用单引号的字符串,
  87.   # 或者用"\"进行转义。下面是一个例子:
  88.   # 这样定义后,输入\sc[pn1]就等效为 \name[pn1]\r[L1]\p[-1]
  89.   Shortcuts = {
  90.     #'pn1' => '\name[pn1]\r[L1]\p[-1]'
  91.   }
  92.   # 高级快捷指令定义,类似于宏展开,需要借助正则表达式(高级用户使用)
  93.   Shortcuts_Regexp = {
  94.     /\\pn1/ => '\name[pn1]\r[L1]\p[-1]',
  95.     /\\[Rr]ed\[(.*?)\]/m => '\c[2]\1\c[0]',
  96.     /\\[Cc]ol\[(\d+)\]\{(.*?)\}/m => '\c[\1]\2\c[0]'
  97.   }
  98. end

  99. #==============================================================================
  100. # ■ Game_System
  101. #------------------------------------------------------------------------------
  102. #  处理系统附属数据的类。也可执行诸如 BGM 管理之类的功能。本类的实例请参考
  103. # $game_system 。
  104. #==============================================================================

  105. class Game_System
  106.   attr_accessor :typing
  107.   attr_accessor :soundname_on_speak
  108.   alias carol3_ini initialize
  109.   def initialize
  110.     carol3_ini
  111.     @typing = true
  112.     @soundname_on_speak = nil
  113.   end
  114. end
  115. $加密 = true
  116. $refresh = {}
  117. #==============================================================================
  118. # ■ Window_Message
  119. #------------------------------------------------------------------------------
  120. #   修改的对话框类。
  121. #==============================================================================
  122. class Window_Message_RB < Window_Selectable
  123.   include RB::Mes_Config
  124.   #--------------------------------------------------------------------------
  125.   # ● 初始化状态
  126.   #--------------------------------------------------------------------------
  127.   def initialize
  128.     super(80, 304, 480, 160)
  129.     self.contents = Bitmap.new(width - 32, height - 32)
  130.     self.visible = false
  131.     self.z = 9998
  132.     @fade_in = false
  133.     @fade_out = false
  134.     @contents_showing = false
  135.     @cursor_width = 0
  136.     self.active = false
  137.     self.index = -1
  138.     if $game_system.soundname_on_speak == nil then
  139.       $game_system.soundname_on_speak = ""
  140.     end
  141.     self.windowskin = RPG::Cache.windowskin(Mes_Windowskin) if Mes_Windowskin != ""
  142.     @opacity_text_buf = Bitmap.new(32, 32)
  143.   end
  144.   #--------------------------------------------------------------------------
  145.   # ● 释放
  146.   #--------------------------------------------------------------------------
  147.   def dispose
  148.     terminate_message
  149.     $game_temp.message_window_showing = false
  150.     if @input_number_window != nil
  151.       @input_number_window.dispose
  152.     end
  153.     super
  154.   end
  155.   #--------------------------------------------------------------------------
  156.   # ● 处理信息结束
  157.   #--------------------------------------------------------------------------
  158.   def terminate_message
  159.     $refresh["mess"] = false
  160.     self.active = false
  161.     self.pause = false
  162.     self.index = -1
  163.     self.contents.clear
  164.     # 清除显示中标志
  165.     @contents_showing = false
  166.     # 呼叫信息调用
  167.     if $game_temp.message_proc != nil
  168.       $game_temp.message_proc.call
  169.     end
  170.     # 清除文章、选择项、输入数值的相关变量
  171.     $game_temp.message_text = nil
  172.     $game_temp.message_proc = nil
  173.     $game_temp.choice_start = 99
  174.     $game_temp.choice_max = 0
  175.     $game_temp.choice_cancel_type = 0
  176.     $game_temp.choice_proc = nil
  177.     $game_temp.num_input_start = 99
  178.     $game_temp.num_input_variable_id = 0
  179.     $game_temp.num_input_digits_max = 0
  180.     # 释放金钱窗口
  181.     if @gold_window != nil
  182.       @gold_window.dispose
  183.       @gold_window = nil
  184.     end
  185.     # 释放姓名窗口
  186.     if @name_window_text != nil
  187.       @name_window_text.dispose
  188.       @name_window_text = nil
  189.     end
  190.     # 释放右侧立绘
  191.     if @right_picture != nil
  192.       @right_picture.dispose
  193.       @right_picture = nil
  194.     end   
  195.     # 释放左侧立绘
  196.     if @left_picture != nil
  197.       @left_picture.dispose
  198.       @left_picture = nil
  199.     end
  200.     # 释放姓名蓝条
  201.     if @bar != nil
  202.       @bar.bitmap.dispose
  203.       @bar.dispose
  204.       @bar = nil
  205.     end
  206.     # 释放气泡图标
  207.     if @k_tale != nil
  208.       @k_tale.dispose
  209.       @k_tale = nil
  210.     end
  211.   end
  212.   #--------------------------------------------------------------------------
  213.   # ● 刷新
  214.   #--------------------------------------------------------------------------
  215.   def refresh
  216.     $refresh["mess"] = true
  217.     # 初期化
  218.     self.contents.clear
  219.     self.contents.font.color = normal_color
  220.     self.contents.font.size = Size
  221.     @x = @y = @max_x = @max_y = @indent = @lines = 0
  222.     @face_indent = 0
  223.     @opacity = 255
  224.     @cursor_width = 0
  225.     @write_speed = 0
  226.     @write_wait = 0
  227.     @mid_stop = false
  228.     @popchar = -2
  229.     if $game_temp.choice_start == 0
  230.       @x = 8
  231.     end
  232.     if $game_temp.message_text != nil
  233.       @now_text = $game_temp.message_text
  234.       # Shortcuts 预处理
  235.       @now_text.gsub!(/\\sc\[(.*?)\]/) { Shortcuts[$1] || "" }
  236.       # Shortcuts_Regexp 预处理
  237.       Shortcuts_Regexp.each_pair do |regex, str|
  238.         @now_text.gsub!(regex, str)
  239.       end
  240.       #——左半身像设置
  241.       if (/\\[Ll]\[(.+?)\]/.match(@now_text)) != nil then
  242.         @face = $1
  243.         if $加密 == true
  244.           if @left_picture != nil
  245.             @left_picture.dispose
  246.           end
  247.           @left_picture = Sprite.new
  248.           @left_picture.bitmap = Bitmap.new("Graphics/Faces/#{@face}")
  249.           @left_picture.y = 480 - @left_picture.bitmap.height
  250.           @left_picture.x = 0
  251.           @left_picture.mirror = true
  252.           @x = @face_indent = @left_picture.bitmap.width
  253.           @now_text.gsub!(/\\[Ll]\[(.*?)\]/) { "" }
  254.         else         
  255.           if FileTest.exist?("Graphics/Faces/#{@face}")
  256.             if @left_picture != nil
  257.               @left_picture.dispose
  258.             end
  259.             @left_picture = Sprite.new
  260.             @left_picture.bitmap = Bitmap.new("Graphics/Faces/#{@face}")
  261.             @left_picture.y = 480 - @left_picture.bitmap.height
  262.             @left_picture.x = 0
  263.             @left_picture.mirror = true
  264.             @now_text.gsub!(/\\[Ll]\[(.*?)\]/) { "" }
  265.           end
  266.         end        
  267.       end
  268.       #——右半身像设置
  269.       if (/\\[Rr]\[(.+?)\]/.match(@now_text))!=nil then
  270.         @face = $1
  271.         if $加密 == true
  272.           if @right_picture != nil
  273.             @right_picture.dispose
  274.           end
  275.           @right_picture = Sprite.new
  276.           @right_picture.bitmap = Bitmap.new("Graphics/Faces/#{@face}")
  277.           @right_picture.y = 480 - @right_picture.bitmap.height
  278.           @right_picture.x = 640 - @right_picture.bitmap.width
  279.           @now_text.gsub!(/\\[Rr]\[(.*?)\]/) { "" }
  280.         else
  281.           if FileTest.exist?("Graphics/Faces/#{@face}")
  282.             if @right_picture != nil
  283.               @right_picture.dispose
  284.             end
  285.             @right_picture = Sprite.new
  286.             @right_picture.bitmap = Bitmap.new("Graphics/Faces/#{@face}")
  287.             @right_picture.y = 480 - @right_picture.bitmap.height
  288.             @right_picture.x = 640 - @right_picture.bitmap.width
  289.             @now_text.gsub!(/\\[Rr]\[(.*?)\]/) { "" }
  290.           end
  291.         end
  292.       end
  293.       # 显示人物姓名
  294.       name_window_set = false
  295.       if (/\\[Nn]ame\[(.+?)\]/.match(@now_text)) != nil
  296.         name_window_set = true
  297.         name_text = $1
  298.         if Regex_Player_Name =~ name_text
  299.           name_text = $game_actors[$1.to_i].name
  300.         end
  301.         @now_text.sub!(/\\[Nn]ame\[(.*?)\]/) { "" }
  302.       end
  303.       # 人物姓名颜色
  304.       name_color = text_color(0)
  305.       if (/\\[Nn]c\[(\d+)\]/.match(@now_text)) != nil
  306.         name_color = text_color($1.to_i)
  307.         @now_text.sub!(/\\[Nn]c\[(\d+)\]/) { "" }
  308.       end
  309.       # 文字位置的判定
  310.       if (/\\[Pp]\[([-1,0-9]+)\]/.match(@now_text)) != nil then
  311.         @popchar = $1.to_i
  312.         @now_text.gsub!(/\\[Pp]\[([-1,0-9]+)\]/) { "" }
  313.       end
  314.       # 开始替换文字(\v)
  315.       begin
  316.         last_text = @now_text.clone
  317.         @now_text.gsub!(/\\[Vv]\[([IiWwAaSs]?)([0-9]+)\]/) { convart_value($1, $2.to_i) }
  318.       end until @now_text == last_text
  319.       # 替换控制码
  320.       @now_text.gsub!(/\\[Nn]\[([0-9]+)\]/) do
  321.         $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
  322.       end
  323.       @now_text.gsub!(/\\\\/) { "\000" }
  324.       @now_text.gsub!(/\\[Cc]\[([0-9]+)\]/) { "\001[#{$1}]" }
  325.       @now_text.gsub!(/\\[Gg]/) { "\002" }
  326.       @now_text.gsub!(/\\[Ss]\[([0-9]+)\]/) { "\003[#{$1}]" }
  327.       @now_text.gsub!(/\\[Aa]\[(.*?)\]/) { "\004[#{$1}]" }
  328.       @now_text.gsub!(/\\[.]/) { "\005" }
  329.       @now_text.gsub!(/\\[|]/) { "\006" }
  330.       @now_text.gsub!(/\\[Ii]c\[(.*?)\]/) { "\030[#{$1}] "}
  331.       @now_text.gsub!(/\\[>]/) { "\016" }
  332.       @now_text.gsub!(/\\[<]/) { "\017" }
  333.       @now_text.gsub!(/\\[!]/) { "\020" }
  334.       @now_text.gsub!(/\\[~]/) { "\021" }
  335.       @now_text.gsub!(/\\[Ii]/) { "\023" }
  336.       @now_text.gsub!(/\\[Oo]\[([0-9]+)\]/) { "\024[#{$1}]" }
  337.       @now_text.gsub!(/\\[Hh]\[([0-9]+)\]/) { "\025[#{$1}]" }
  338.       @now_text.gsub!(/\\[Bb]\[([0-9]+)\]/) { "\026[#{$1}]" }
  339.       @now_text.gsub!(/\\[Kk]\[(.*?)\]/) { "\027[#{$1}]" }
  340.       # \p 的情况下调整文字大小
  341.       if @popchar >= 0
  342.         @text_save = @now_text.clone
  343.         process_real_text
  344.         @max_x = name_window_set ? contents.text_size(name_text).width : 0
  345.         @max_y = Max_Lines
  346.         for i in 0...Max_Lines
  347.           line = @text_save.split(/\n/)[Max_Lines-i-1]
  348.           @max_y -= 1 if line == nil && @max_y <= Max_Lines - i
  349.           next if line == nil
  350.           contents.font.size = Size
  351.           cx = contents.text_size(line).width
  352.           @max_x = cx if cx > @max_x
  353.         end
  354.         if @right_picture != nil && !@right_picture.disposed?
  355.           self.width = @max_x + 48 + @face_indent + @right_picture.bitmap.width
  356.         else
  357.           self.width = @max_x + 48 + @face_indent
  358.         end
  359.         if $game_temp.num_input_variable_id > 0
  360.           self.height = (@max_y - 1) * line_height + 96
  361.         else
  362.           self.height = (@max_y - 1) * line_height + 64
  363.         end
  364.       else
  365.         @max_x = self.width - 32 - @face_indent
  366.       end
  367.       reset_window
  368.       # 如果设置了姓名框
  369.       if name_window_set
  370.         off_x = 0
  371.         off_y = -40
  372.         space = 2
  373.         x = self.x + off_x - space / 2
  374.         y = self.y + off_y - space / 2
  375.         w = self.contents.text_size(name_text).width + 26 + space
  376.         h = 40 + space
  377.         x = self.x + off_x + 4
  378.         y = self.y + off_y
  379.         @name_window_text = Air_Text.new(self.x + @face_indent+4+8, self.y+16, name_text, name_color)
  380.         @name_window_text.z = self.z + 2
  381.         @bar = Sprite.new
  382.         @bar.bitmap = Bitmap.new(self.width, 24)
  383.         @bar.x = self.x + 8
  384.         @bar.y = self.y + 16
  385.         @bar.z = self.z + 2
  386.         @bar.bitmap.fill_rect(0,0,self.width-16,24,Color.new(120,180,250,80))
  387.       end
  388.     end
  389.     reset_window
  390.     # 如果选择项被设置
  391.     if $game_temp.choice_max > 0
  392.       @item_max = $game_temp.choice_max
  393.       self.active = true
  394.       self.index = 0
  395.     end
  396.     # 如果数值输入被设置
  397.     if $game_temp.num_input_variable_id > 0
  398.       digits_max = $game_temp.num_input_digits_max
  399.       number = $game_variables[$game_temp.num_input_variable_id]
  400.       @input_number_window = Window_InputNumber.new(digits_max)
  401.       @input_number_window.number = number
  402.       @input_number_window.x = self.x + @face_indent
  403.       @input_number_window.y = self.y + 8 + $game_temp.num_input_start * line_height
  404.     end
  405.   end
  406.   #--------------------------------------------------------------------------
  407.   # ● 更新
  408.   #--------------------------------------------------------------------------
  409.   def update
  410.     super
  411.     # 使用默认窗口外观的情况下,如果窗口的外关被变更了、再设置
  412.     if $game_system.windowskin_name != @windowskin_name && Mes_Windowskin == ""
  413.       @windowskin_name = $game_system.windowskin_name
  414.       self.windowskin = RPG::Cache.windowskin(@windowskin_name)
  415.     end
  416.     # 如果设置了气泡图标
  417.     if @k_tale != nil && @k_tale.visible && !$game_temp.in_battle
  418.       character = get_character(@popchar)
  419.       x = [[character.screen_x - self.width / 2, 4].max, 636 - self.width].min
  420.       if $game_system.message_position == 2
  421.         y = [[character.screen_y + 16, 4].max, 476 - self.height].min
  422.       elsif $game_system.message_position == 0
  423.         y = [[character.screen_y - process_y_shift(character) - self.height, 4].max, 476 - self.height].min
  424.       end
  425.       self.x = x
  426.       self.y = y
  427.       # 设置气泡图标坐标
  428.       @k_tale.x = ( character.real_x - $game_map.display_x + 64 ) * 32 / 128 - 16
  429.       if $game_system.message_position == 2
  430.         @k_tale.y = self.y - 16
  431.       elsif $game_system.message_position == 0
  432.         @k_tale.y = self.y + self.height - 16
  433.       end
  434.       # 设置左侧立绘坐标
  435.       if @left_picture != nil and !@left_picture.disposed?
  436.         @left_picture.x = x + 8
  437.         @left_picture.y = y - @left_picture.bitmap.height + self.height - 8
  438.       end
  439.       # 设置右侧立绘坐标
  440.       if @right_picture != nil and !@right_picture.disposed?
  441.         @right_picture.x = x+[email]self.width-@right_picture.bitmap.width[/email]-8
  442.         @right_picture.y = y - @right_picture.bitmap.height + self.height - 8
  443.       end
  444.       # 设置姓名空气文字坐标
  445.       if @name_window_text != nil
  446.         @name_window_text.x = self.x + @face_indent - 4
  447.         @name_window_text.y = self.y
  448.       end
  449.       # 设置姓名蓝条坐标
  450.       if @bar != nil
  451.         @bar.x = self.x + 8
  452.         @bar.y = self.y + 16
  453.       end
  454.     end
  455.     # 淡入中的情况下
  456.     if @fade_in
  457.       self.contents_opacity += 24
  458.       if @input_number_window != nil
  459.         @input_number_window.contents_opacity += 24
  460.       end
  461.       if self.contents_opacity == 255
  462.         @fade_in = false
  463.       end
  464.       return
  465.     end
  466.     @now_text = nil if @now_text == ""
  467.     # 逐个描绘文字
  468.     if @now_text != nil and @mid_stop == false
  469.       if @write_wait > 0
  470.         @write_wait -= 1
  471.         return
  472.       end
  473.       text_not_skip = $game_system.typing
  474.       while true
  475.         @max_x = @x if @max_x < @x
  476.         @max_y = @y if @max_y < @y
  477.         # 处理字符
  478.         if (c = @now_text.slice!(/./m)) != nil
  479.           # \\的情况下
  480.           if c == "\000"
  481.             c = "\"
  482.           end
  483.           # \c的情况下
  484.           if c == "\001"
  485.             @now_text.sub!(/\[([0-9]+)\]/, "")
  486.             color = $1.to_i
  487.             if color >= 0 and color <= 7
  488.               self.contents.font.color = text_color(color)
  489.             end
  490.             c = ""
  491.           end
  492.           # \g的情况下
  493.           if c == "\002"
  494.             if @gold_window == nil && @popchar <= 0
  495.               @gold_window = Window_Gold.new
  496.               @gold_window.x = 560 - @gold_window.width
  497.               if $game_temp.in_battle
  498.                 @gold_window.y = 192
  499.               else
  500.                 @gold_window.y = self.y >= 128 ? 32 : 384
  501.               end
  502.               @gold_window.opacity = self.opacity
  503.               @gold_window.back_opacity = self.back_opacity
  504.             end
  505.             c = ""
  506.           end
  507.           # \s的情况下
  508.           if c == "\003"
  509.             @now_text.sub!(/\[([0-9]+)\]/, "")
  510.             speed = $1.to_i
  511.             if speed >= 0 and speed <= 19
  512.               @write_speed = speed
  513.             end
  514.             c = ""
  515.           end
  516.           # \a的情况下
  517.           if c == "\004"
  518.             @now_text.sub!(/\[(.*?)\]/, "")
  519.             buftxt = $1.dup.to_s
  520.             if buftxt.match(/\//) == nil && buftxt != "" then
  521.               $game_system.soundname_on_speak = "Audio/SE/" + buftxt
  522.             else
  523.               $game_system.soundname_on_speak = buftxt.dup
  524.             end
  525.             c = ""
  526.           end
  527.           # \.的情况下
  528.           if c == "\005"
  529.             @write_wait += 5
  530.             c = ""
  531.           end
  532.           # \|的情况下
  533.           if c == "\006"
  534.             @write_wait += 20
  535.             c = ""
  536.           end
  537.           # \>的情况下
  538.           if c == "\016"
  539.             text_not_skip = false
  540.             c = ""
  541.           end
  542.           # \<的情况下
  543.           if c == "\017"
  544.             text_not_skip = true
  545.             c = ""
  546.           end
  547.           # \!的情况下
  548.           if c == "\020"
  549.             @mid_stop = true
  550.             c = ""
  551.           end
  552.           # \~的情况下
  553.           if c == "\021"
  554.             terminate_message
  555.             return
  556.           end
  557.           # \i的情况下
  558.           if c == "\023"
  559.             @indent = @x
  560.             c = ""
  561.           end
  562.           # \o的情况下
  563.           if c == "\024"
  564.             @now_text.sub!(/\[([0-9]+)\]/, "")
  565.             @opacity = $1.to_i
  566.             c = ""
  567.           end
  568.           # \h的情况下
  569.           if c == "\025"
  570.             @now_text.sub!(/\[([0-9]+)\]/, "")
  571.             self.contents.font.size = [[$1.to_i, 6].max, 32].min
  572.             c = ""
  573.           end
  574.           # \b的情况下
  575.           if c == "\026"
  576.             @now_text.sub!(/\[([0-9]+)\]/, "")
  577.             @x += $1.to_i
  578.             c = ""
  579.           end
  580.           # \k的情况下
  581.           if c == "\027"
  582.             @now_text.sub!(/\[(.*?)\]/, "")
  583.             @x += ruby_draw_text(self.contents, @x, @y * line_height + (line_height - self.contents.font.size), $1, @opacity)
  584.             if $game_system.soundname_on_speak != ""
  585.               Audio.se_play($game_system.soundname_on_speak)
  586.             end
  587.             c = ""
  588.           end
  589.           # 图标的情况
  590.           if c == "\030"
  591.             @now_text.sub!(/\[(.*?)\]/, "")
  592.             self.contents.blt(@x , @y * line_height + (line_height - 24) / 2, RPG::Cache.icon($1), Rect.new(0, 0, 24, 24))
  593.             if $game_system.soundname_on_speak != ""
  594.               Audio.se_play($game_system.soundname_on_speak)
  595.             end
  596.             @x += 24
  597.             c = ""
  598.           end
  599.           # 另起一行的情况下
  600.           if c == "\n"
  601.             if @lines >= $game_temp.choice_start
  602.               @cursor_width = [@cursor_width, @max_x - @face_indent].max
  603.             end
  604.             @lines += 1
  605.             @y += 1
  606.             @x = 0 + @indent + @face_indent
  607.             if @lines >= $game_temp.choice_start
  608.               @x = 8 + @indent + @face_indent
  609.             end
  610.             c = ""
  611.           end
  612.           if c != ""
  613.             # 文字描画
  614.             @x += opacity_draw_text(self.contents, @x, @y * line_height + (line_height - self.contents.font.size) / 2, c, @opacity)
  615.             if $game_system.soundname_on_speak != "" then
  616.               Audio.se_play($game_system.soundname_on_speak)
  617.             end
  618.           end
  619.           if Input.press?(Input::B)
  620.             text_not_skip = false
  621.           end
  622.         else
  623.           text_not_skip = true
  624.           break
  625.         end
  626.         # 終了判定
  627.         if text_not_skip
  628.           break
  629.         end
  630.       end
  631.       @write_wait += @write_speed
  632.       return
  633.     end
  634.     # 数值输入的处理
  635.     if @input_number_window != nil
  636.       @input_number_window.update
  637.       # 确认
  638.       if Input.trigger?(Input::C)
  639.         $game_system.se_play($data_system.decision_se)
  640.         $game_variables[$game_temp.num_input_variable_id] =
  641.           @input_number_window.number
  642.         $game_map.need_refresh = true
  643.         @input_number_window.dispose
  644.         @input_number_window = nil
  645.         terminate_message
  646.       end
  647.       return
  648.     end
  649.     # 文章显示中的情况下
  650.     if @contents_showing
  651.       if $game_temp.choice_max == 0
  652.         self.pause = true
  653.       end
  654.       # 取消
  655.       if Input.trigger?(Input::B)
  656.         if $game_temp.choice_max > 0 && $game_temp.choice_cancel_type > 0
  657.           $game_system.se_play($data_system.cancel_se)
  658.           $game_temp.choice_proc.call($game_temp.choice_cancel_type - 1)
  659.           terminate_message
  660.         end
  661.       end
  662.       # 确定
  663.       if Input.trigger?(Input::C)
  664.         # 释放气泡图标
  665.         if @k_tale != nil  
  666.           @k_tale.dispose
  667.           @k_tale = nil
  668.         end
  669.         if $game_temp.choice_max > 0
  670.           $game_system.se_play($data_system.decision_se)
  671.           $game_temp.choice_proc.call(self.index)
  672.         end
  673.         if @mid_stop
  674.           @mid_stop = false
  675.           return
  676.         else
  677.           terminate_message
  678.         end
  679.       end
  680.       return
  681.     end
  682.     if @fade_out == false and $game_temp.message_text != nil
  683.       @contents_showing = true
  684.       $game_temp.message_window_showing = true
  685.       refresh
  686.       Graphics.frame_reset
  687.       self.visible = true
  688.       self.contents_opacity = 0
  689.       if @input_number_window != nil
  690.         @input_number_window.contents_opacity = 0
  691.       end
  692.       @fade_in = true
  693.       return
  694.     end
  695.     if self.visible
  696.       @fade_out = true
  697.       self.opacity -= 48
  698.       if self.opacity == 0
  699.         self.visible = false
  700.         @fade_out = false
  701.         $game_temp.message_window_showing = false
  702.       end
  703.       return
  704.     end
  705.   end
  706.   #--------------------------------------------------------------------------
  707.   # ● 预览实际描绘内容(计算窗口宽用)
  708.   #--------------------------------------------------------------------------
  709.   #    实际对 @text_save 进行操作
  710.   #    此方法用于去除某些控制码引起窗口过长的影响
  711.   #--------------------------------------------------------------------------
  712.   def process_real_text
  713.     return if @text_save.nil?
  714.     regex = /[\001-\006\016\017\020\021\024](\[.*?\]){0,1}/
  715.     regex30 = /\030\[.*?\]/
  716.     @text_save.gsub!(regex, "")
  717.     @text_save.gsub!(regex30, "   ")
  718.   end
  719.   #--------------------------------------------------------------------------
  720.   # ● 获得角色(\p功能)
  721.   #--------------------------------------------------------------------------
  722.   def get_character(parameter)
  723.     case parameter
  724.     when 0
  725.       return $game_player
  726.     else
  727.       events = $game_map.events
  728.       return events == nil ? nil : events[parameter]
  729.     end
  730.   end
  731.   #--------------------------------------------------------------------------
  732.   # ● 获得战斗者(\p功能,此功能仅在战斗中有效)
  733.   #--------------------------------------------------------------------------
  734.   #    parameter : 1-999 表示主角 ID,1001-1008 表示索引为1-8的各个敌人
  735.   #--------------------------------------------------------------------------
  736.   def get_battler(parameter)
  737.     if parameter < 1000
  738.       return $game_actors[parameter]
  739.     else
  740.       return $game_troop.enemies[parameter - 1001]
  741.     end
  742.   end
  743.   #--------------------------------------------------------------------------
  744.   # ● 计算 y 偏移量(\p功能,这是考虑到不同战斗图/行走图的高度不同)
  745.   #--------------------------------------------------------------------------
  746.   #    character : 角色/战斗者
  747.   #--------------------------------------------------------------------------
  748.   def process_y_shift(character)
  749.     rate = character.is_a?(Game_Battler) ? 1 : 4
  750.     bmp = character.is_a?(Game_Battler) ?
  751.       RPG::Cache.battler(character.battler_name, character.battler_hue) :
  752.       RPG::Cache.character(character.character_name, character.character_hue)
  753.     return bmp.height / rate + 16
  754.   end
  755.   #--------------------------------------------------------------------------
  756.   # ● 重置窗口(位置,不透明度)
  757.   #--------------------------------------------------------------------------
  758.   def reset_window
  759.     # 判定
  760.     if @k_tale != nil  
  761.       @k_tale.dispose
  762.       @k_tale = nil
  763.     end
  764.     # 如果使用了 \p 设置位置
  765.     if @popchar >= 0
  766.       character = $game_temp.in_battle ? get_battler(@popchar) : get_character(@popchar)
  767.       if character != nil
  768.         x = [[character.screen_x - self.width / 2, 4].max, 636 - self.width].min
  769.         if $game_system.message_position == 2
  770.           y = [[character.screen_y + 16, 4].max, 476 - self.height].min
  771.         elsif $game_system.message_position == 0
  772.           y = [[character.screen_y - process_y_shift(character) - self.height, 4].max, 476 - self.height].min
  773.         else
  774.           x = 320 - self.width / 2
  775.           y = 240 - self.height / 2
  776.         end
  777.         self.x = x
  778.         self.y = y
  779.         # 设置气泡图标
  780.         @k_tale = Sprite.new
  781.         k_tale_filename = Mes_Windowskin == "" ? $game_system.windowskin_name : Mes_Windowskin
  782.         suffix = $game_system.message_position == 2 ? "-under" : "-top"
  783.         @k_tale.bitmap = RPG::Cache.windowskin(k_tale_filename + suffix)
  784.         @k_tale.x = character.is_a?(Game_Character) ?
  785.           ( character.real_x - $game_map.display_x + 64 ) * 32 / 128 - 16 :
  786.           character.screen_x
  787.         if $game_system.message_position == 2
  788.           @k_tale.y = self.y - 16
  789.         elsif $game_system.message_position == 0
  790.           @k_tale.y = self.y + self.height - 16
  791.         else
  792.           @k_tale.visible = false
  793.         end
  794.         @k_tale.z = 9999
  795.       end
  796.     elsif @popchar == -1
  797.       self.x = 0
  798.       self.width = 640
  799.       self.height = 64 + line_height * 3
  800.       self.y = 480 - self.height
  801.     else # 无 \p 的情况下
  802.       # 处于战斗中时
  803.       if $game_temp.in_battle
  804.         self.y = 16
  805.       else
  806.         # 显示文章位置的分支
  807.         case $game_system.message_position
  808.         when 0 # 上
  809.           self.y = 16
  810.         when 1 # 中
  811.           self.y = 160
  812.         when 2 # 下
  813.           self.y = 304
  814.         end
  815.       end
  816.       self.width = 480 * 0.8
  817.       self.height = 64 + line_height * 3
  818.       self.x = 320 - self.width / 2
  819.     end # of @popchar >= 0
  820.     # 设置左侧立绘
  821.     if @left_picture != nil and !@left_picture.disposed?
  822.       @left_picture.x = self.x + 8
  823.       @left_picture.y = self.y - @left_picture.bitmap.height + self.height - 8
  824.       @left_picture.z = self.z + 4
  825.     end
  826.     # 设置右侧立绘
  827.     if @right_picture != nil and !@right_picture.disposed?
  828.       @right_picture.x = self.x + self.width - @right_picture.bitmap.width - 8
  829.       @right_picture.y = self.y - @right_picture.bitmap.height + self.height - 8
  830.       @right_picture.z = self.z + 4
  831.     end
  832.     self.contents = Bitmap.new(self.width - 32, self.height - 32)
  833.     self.contents.font.size = Size
  834.     # 设置不透明度
  835.     if $game_system.message_frame == 0
  836.       self.opacity = 255
  837.       self.back_opacity = 200
  838.     else
  839.       self.opacity = 0
  840.       self.back_opacity = 200
  841.     end
  842.   end
  843.   #--------------------------------------------------------------------------
  844.   # ● line_height
  845.   #--------------------------------------------------------------------------
  846.   # 返回值 : 行高
  847.   #--------------------------------------------------------------------------
  848.   def line_height
  849.     return [[Size * 15 / 10, 18].max, 32].min
  850.   end
  851.   #--------------------------------------------------------------------------
  852.   # ● 文字描画
  853.   #--------------------------------------------------------------------------
  854.   # target :描绘的目标 bitmap 对象
  855.   # x      :x 坐标
  856.   # y      :y 坐标
  857.   # str   :描绘的文字
  858.   # opacity:不透明度(0~255)
  859.   # 返回值 :文字宽度(@x 的增加值)。
  860.   #--------------------------------------------------------------------------
  861.   def opacity_draw_text(target, x, y, str,opacity)
  862.     height = target.font.size
  863.     width = target.text_size(str).width
  864.     opacity = [[opacity, 0].max, 255].min
  865.     if opacity == 255
  866.       target.draw_text(x, y, width, height, str)
  867.       return width
  868.     else
  869.       if @opacity_text_buf.width < width or @opacity_text_buf.height < height
  870.         @opacity_text_buf.dispose
  871.         @opacity_text_buf = Bitmap.new(width, height)
  872.       else
  873.         @opacity_text_buf.clear
  874.       end
  875.       @opacity_text_buf.font.size = target.font.size
  876.       @opacity_text_buf.draw_text(0, 0, width, height, str)
  877.       target.blt(x, y, @opacity_text_buf, Rect.new(0, 0, width, height), opacity)
  878.     return width
  879.     end
  880.   end
  881.   def ruby_draw_text(target, x, y, str, opacity)
  882.     sizeback = target.font.size
  883.     target.font.size * 3 / 2 > 32 ? rubysize = 32 - target.font.size : rubysize = target.font.size / 2
  884.     rubysize = [rubysize, 6].max
  885.     opacity = [[opacity, 0].max, 255].min
  886.     split_s = str.split(/,/)
  887.     split_s[0] == nil ? split_s[0] = "" : nil
  888.     split_s[1] == nil ? split_s[1] = "" : nil
  889.     height = sizeback + rubysize
  890.     width = target.text_size(split_s[0]).width
  891.     target.font.size = rubysize
  892.     ruby_width = target.text_size(split_s[1]).width
  893.     target.font.size = sizeback
  894.     buf_width = [target.text_size(split_s[0]).width, ruby_width].max
  895.     width - ruby_width != 0 ? sub_x = (width - ruby_width) / 2 : sub_x = 0
  896.     if opacity == 255
  897.       target.font.size = rubysize
  898.       target.draw_text(x + sub_x, y - target.font.size, target.text_size(split_s[1]).width, target.font.size, split_s[1])
  899.       target.font.size = sizeback
  900.       target.draw_text(x, y, width, target.font.size, split_s[0])
  901.       return width
  902.     else
  903.       if @opacity_text_buf.width < buf_width or @opacity_text_buf.height < height
  904.         @opacity_text_buf.dispose
  905.         @opacity_text_buf = Bitmap.new(buf_width, height)
  906.       else
  907.         @opacity_text_buf.clear
  908.       end
  909.       @opacity_text_buf.font.size = rubysize
  910.       @opacity_text_buf.draw_text(0 , 0, buf_width, rubysize, split_s[1], 1)
  911.       @opacity_text_buf.font.size = sizeback
  912.       @opacity_text_buf.draw_text(0 , rubysize, buf_width, sizeback, split_s[0], 1)
  913.       if sub_x >= 0
  914.         target.blt(x, y - rubysize, @opacity_text_buf, Rect.new(0, 0, buf_width, height), opacity)
  915.       else
  916.         target.blt(x + sub_x, y - rubysize, @opacity_text_buf, Rect.new(0, 0, buf_width, height), opacity)
  917.       end
  918.       return width
  919.     end
  920.   end
  921.   #--------------------------------------------------------------------------
  922.   # ● \V 变换
  923.   #--------------------------------------------------------------------------
  924.   # option : 选项,'i'物品,'w'武器,'a'防具,'s'技能
  925.   # index  : 数据库的索引
  926.   #--------------------------------------------------------------------------
  927.   def convart_value(option, index)
  928.     option == nil ? option = "" : nil
  929.     option.downcase!
  930.     case option
  931.       when "i"
  932.         unless $data_items[index].name == nil
  933.           r = sprintf("\030[%s]%s", $data_items[index].icon_name, $data_items[index].name)
  934.         end
  935.       when "w"
  936.         unless $data_weapons[index].name == nil
  937.           r = sprintf("\030[%s]%s", $data_weapons[index].icon_name, $data_weapons[index].name)
  938.         end
  939.       when "a"
  940.         unless $data_armors[index].name == nil
  941.           r = sprintf("\030[%s]%s", $data_armors[index].icon_name, $data_armors[index].name)
  942.         end
  943.       when "s"
  944.         unless $data_skills[index].name == nil
  945.           r = sprintf("\030[%s]%s", $data_skills[index].icon_name, $data_skills[index].name)
  946.         end
  947.       else
  948.       r = $game_variables[index]
  949.     end
  950.     r == nil ? r = "" : nil
  951.     return r
  952.   end
  953.   #--------------------------------------------------------------------------
  954.   # ● 释放
  955.   #--------------------------------------------------------------------------
  956.   def dispose
  957.     terminate_message
  958.     unless @opacity_text_buf.disposed?
  959.       @opacity_text_buf.dispose
  960.     end
  961.     $game_temp.message_window_showing = false
  962.     if @input_number_window != nil
  963.       @input_number_window.dispose
  964.     end
  965.     super
  966.   end
  967.   #--------------------------------------------------------------------------
  968.   # ● 刷新光标矩形
  969.   #--------------------------------------------------------------------------
  970.   def update_cursor_rect
  971.     if @index >= 0
  972.       n = $game_temp.choice_start + @index
  973.       self.cursor_rect.set(4 + @indent + @face_indent, n * line_height, @cursor_width, line_height)
  974.     else
  975.       self.cursor_rect.empty
  976.     end
  977.   end
  978. end
  979. #==============================================================================
  980. # ■ Air_Text
  981. #------------------------------------------------------------------------------
  982. #   空气文字,借助窗口显示文字,但是不显示窗口载体。
  983. #==============================================================================
  984. class Air_Text < Window_Base
  985.   #--------------------------------------------------------------------------
  986.   # ● 对象初始化
  987.   #--------------------------------------------------------------------------
  988.   def initialize(x, y, designate_text, color)
  989.     super(x-16, y-16, 32 + designate_text.size * 12, 56)
  990.     self.opacity = 0
  991.     self.back_opacity = 0
  992.     self.contents = Bitmap.new(self.width - 32, self.height - 32)
  993.     self.contents.font.size = 20
  994.     self.contents.font.color = color
  995.     w = self.contents.width
  996.     h = self.contents.height
  997.     self.contents.draw_text(0, 0, w, h, designate_text)
  998.   end
  999.   #--------------------------------------------------------------------------
  1000.   # ● 释放
  1001.   #--------------------------------------------------------------------------
  1002.   def dispose
  1003.     self.contents.clear
  1004.     super
  1005.   end
  1006. end

  1007. class Interpreter
  1008.   #--------------------------------------------------------------------------
  1009.   # ● 显示文章
  1010.   #--------------------------------------------------------------------------
  1011.   def command_101
  1012.     # 另外的文章已经设置过 message_text 的情况下
  1013.     if $game_temp.message_text != nil
  1014.       # 结束
  1015.       return false
  1016.     end
  1017.     # 设置信息结束后待机和返回调用标志
  1018.     @message_waiting = true
  1019.     $game_temp.message_proc = Proc.new { @message_waiting = false }
  1020.     # message_text 设置为 1 行
  1021.     $game_temp.message_text = @list[@index].parameters[0] + "\n"
  1022.     line_count = 1
  1023.     max_lines = $game_switches[13] ? Window_Message_RB::Max_Lines : 4
  1024.     # 循环
  1025.     loop do
  1026.       # 下一个事件指令为文章两行以上的情况
  1027.       if @list[@index+1].code == 401
  1028.         # message_text 添加到第 2 行以下
  1029.         $game_temp.message_text += @list[@index+1].parameters[0] + "\n"
  1030.         line_count += 1
  1031.       # 事件指令不在文章两行以下的情况
  1032.       else
  1033.         # 下一个事件指令为显示选择项的情况下
  1034.         if @list[@index+1].code == 102
  1035.           # 如果选择项能收纳在画面里
  1036.           if @list[@index+1].parameters[0].size <= max_lines - line_count
  1037.             # 推进索引
  1038.             @index += 1
  1039.             # 设置选择项
  1040.             $game_temp.choice_start = line_count
  1041.             setup_choices(@list[@index].parameters)
  1042.           end
  1043.         # 下一个事件指令为处理输入数值的情况下
  1044.         elsif @list[@index+1].code == 103
  1045.           # 如果数值输入窗口能收纳在画面里
  1046.           if line_count < max_lines
  1047.             # 推进索引
  1048.             @index += 1
  1049.             # 设置输入数值
  1050.             $game_temp.num_input_start = line_count
  1051.             $game_temp.num_input_variable_id = @list[@index].parameters[0]
  1052.             $game_temp.num_input_digits_max = @list[@index].parameters[1]
  1053.           end
  1054.         end
  1055.         # 继续
  1056.         return true
  1057.       end
  1058.       # 推进索引
  1059.       @index += 1
  1060.     end
  1061.   end
  1062. end

  1063. class Scene_Map
  1064.   def main
  1065.     #####
  1066.     @rb_mes_disabled = $game_switches[13]
  1067.     # 生成活动块
  1068.     @spriteset = Spriteset_Map.new
  1069.     # 生成信息窗口
  1070.     @message_window = @rb_mes_disabled ? Window_Message.new : Window_Message_RB.new
  1071.     # 执行过渡
  1072.     Graphics.transition
  1073.     # 主循环
  1074.     loop do
  1075.       # 刷新游戏画面
  1076.       Graphics.update
  1077.       # 刷新输入信息
  1078.       Input.update
  1079.       # 刷新画面
  1080.       update
  1081.       # 如果画面切换的话就中断循环
  1082.       if $scene != self
  1083.         break
  1084.       end
  1085.     end
  1086.     # 准备过渡
  1087.     Graphics.freeze
  1088.     # 释放活动块
  1089.     @spriteset.dispose
  1090.     # 释放信息窗口
  1091.     @message_window.dispose
  1092.     # 标题画面切换中的情况下
  1093.     if $scene.is_a?(Scene_Title)
  1094.       # 淡入淡出画面
  1095.       Graphics.transition
  1096.       Graphics.freeze
  1097.     end
  1098.   end
  1099.   alias rb_update_20160408 update
  1100.   def update
  1101.     if @rb_mes_disabled != $game_switches[13]
  1102.       @rb_mes_disabled = $game_switches[13]
  1103.       @message_window.dispose
  1104.       @message_window = @rb_mes_disabled ? Window_Message.new : Window_Message_RB.new
  1105.     end
  1106.     rb_update_20160408
  1107.   end
  1108. end

  1109. class Scene_Battle
  1110.   def main
  1111.     #####
  1112.     @rb_mes_disabled = $game_switches[13]
  1113.     # 初始化战斗用的各种暂时数据
  1114.     $game_temp.in_battle = true
  1115.     $game_temp.battle_turn = 0
  1116.     $game_temp.battle_event_flags.clear
  1117.     $game_temp.battle_abort = false
  1118.     $game_temp.battle_main_phase = false
  1119.     $game_temp.battleback_name = $game_map.battleback_name
  1120.     $game_temp.forcing_battler = nil
  1121.     # 初始化战斗用事件解释器
  1122.     $game_system.battle_interpreter.setup(nil, 0)
  1123.     # 准备队伍
  1124.     @troop_id = $game_temp.battle_troop_id
  1125.     $game_troop.setup(@troop_id)
  1126.     # 生成角色命令窗口
  1127.     s1 = $data_system.words.attack
  1128.     s2 = $data_system.words.skill
  1129.     s3 = $data_system.words.guard
  1130.     s4 = $data_system.words.item
  1131.     @actor_command_window = Window_Command.new(160, [s1, s2, s3, s4])
  1132.     @actor_command_window.y = 160
  1133.     @actor_command_window.back_opacity = 160
  1134.     @actor_command_window.active = false
  1135.     @actor_command_window.visible = false
  1136.     # 生成其它窗口
  1137.     @party_command_window = Window_PartyCommand.new
  1138.     @help_window = Window_Help.new
  1139.     @help_window.back_opacity = 160
  1140.     @help_window.visible = false
  1141.     @status_window = Window_BattleStatus.new
  1142.     @message_window = @message_window = @rb_mes_disabled ? Window_Message.new : Window_Message_RB.new
  1143.     # 生成活动块
  1144.     @spriteset = Spriteset_Battle.new
  1145.     # 初始化等待计数
  1146.     @wait_count = 0
  1147.     # 执行过渡
  1148.     if $data_system.battle_transition == ""
  1149.       Graphics.transition(20)
  1150.     else
  1151.       Graphics.transition(40, "Graphics/Transitions/" +
  1152.         $data_system.battle_transition)
  1153.     end
  1154.     # 开始自由战斗回合
  1155.     start_phase1
  1156.     # 主循环
  1157.     loop do
  1158.       # 刷新游戏画面
  1159.       Graphics.update
  1160.       # 刷新输入信息
  1161.       Input.update
  1162.       # 刷新画面
  1163.       update
  1164.       # 如果画面切换的话就中断循环
  1165.       if $scene != self
  1166.         break
  1167.       end
  1168.     end
  1169.     # 刷新地图
  1170.     $game_map.refresh
  1171.     # 准备过渡
  1172.     Graphics.freeze
  1173.     # 释放窗口
  1174.     @actor_command_window.dispose
  1175.     @party_command_window.dispose
  1176.     @help_window.dispose
  1177.     @status_window.dispose
  1178.     @message_window.dispose
  1179.     if @skill_window != nil
  1180.       @skill_window.dispose
  1181.     end
  1182.     if @item_window != nil
  1183.       @item_window.dispose
  1184.     end
  1185.     if @result_window != nil
  1186.       @result_window.dispose
  1187.     end
  1188.     # 释放活动块
  1189.     @spriteset.dispose
  1190.     # 标题画面切换中的情况
  1191.     if $scene.is_a?(Scene_Title)
  1192.       # 淡入淡出画面
  1193.       Graphics.transition
  1194.       Graphics.freeze
  1195.     end
  1196.     # 战斗测试或者游戏结束以外的画面切换中的情况
  1197.     if $BTEST and not $scene.is_a?(Scene_Gameover)
  1198.       $scene = nil
  1199.     end
  1200.   end
  1201.   alias rb_update_20160408 update
  1202.   def update
  1203.     if @rb_mes_disabled != $game_switches[13]
  1204.       @rb_mes_disabled = $game_switches[13]
  1205.       @message_window.dispose
  1206.       @message_window = @rb_mes_disabled ? Window_Message.new : Window_Message_RB.new
  1207.     end
  1208.     rb_update_20160408
  1209.   end
  1210. end


  1211. #==============================================================================
  1212. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  1213. #==============================================================================
复制代码

点评

谢谢您!  发表于 2016-4-9 19:22
麻烦您了R大!  发表于 2016-4-8 01:48
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部