查看: 2715|回复: 7

[有事请教] 问一下这几个脚本能不能用于商业游戏

[复制链接]
梦石
0
星屑
4935
在线时间
918 小时
注册时间
2015-7-1
回帖
309
发表于 2018-12-9 20:44:07 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
本帖最后由 L7-wind 于 2018-12-9 20:43 编辑

这些脚本有些没有写出处,或者只是写来自p1,导致我不清楚作者,又或者写了作者但我不知道作者的联系方式,因为想用于商业游戏,所以在这里问一下大家
Fuki对话框优化版 v6

  1. #==============================================================================
  2. #    Fuki对话框优化版 v6
  3. #    原版作者:by パラ犬(日)
  4. #    汉化修正:by 66RPG.com
  5. #------------------------------------------------------------------------------
  6. #    2006年01月 汉化修改 by bbschat
  7. #    2007年02月 脚本更新 by KKME
  8. #    2007年07月 脚本更新 by 绫晓露雪萌
  9. #    2010年05月 脚本优化 by Linki Shy
  10. #    2011年10月 阴影修正 by 各种压力的猫君
  11. #    2011年11月 脚本增强 by 各种压力的猫君
  12. #==============================================================================
  13. #
  14. # 【脚本功能】
  15. #
  16. #   1. 此脚本主要是解决了在1.03版XP上的方块问题,以及增加了一些功能
  17. #
  18. #   2. 人名美化使用方法与以前一样
  19. #
  20. #   3. 默认人物头像在左边显示
  21. #      如果需要右边显示,在输入的名称之后加"@r"即可
  22. #      例: "阿尔西斯@r:"(注意必须小写)
  23. #
  24. #   4. 在对话中更改字体的方法:
  25. #       \f[X]:更改字号为X
  26. #
  27. #   5. 在对话中显示(技能 物品 武器 防具 人物)图标和名称的方法:
  28. #       \s[X]: 显示第X号技能图标和名称
  29. #       \i[X]: 显示第X号物品图标和名称
  30. #       \w[X]: 显示第X号武器图标和名称
  31. #       \a[X]: 显示第X号防具图标和名称
  32. #       \r[X]: 显示第X号人物图标和名称
  33. #
  34. #   6. 在对话中更改文字不透明度的方法:
  35. #       \o[X]: 把文字不透明度更改为X (取值范围为0~255)
  36. #   
  37. #   7. 在对话中关闭或开启拟声音效的方法:
  38. #       \q:默认开启时,执行一次关闭,再执行一次则开启
  39. #
  40. #   8. 如果需要自定义字体颜色,
  41. #       可以打开"Graphics/Windowskins"目录下的"Window.png"文件查看
  42. #       使用方法与VX类似
  43. #
  44. #   9. 追加了不为瞬间显示时确定键快速显示的功能
  45. #
  46. #  10. $mes_id = 0          代表本事件
  47. #      $mes_id = -1         代表主角
  48. #      $mes_id = 其他数值   代表事件编号
  49. #      $mes_id = nil        代表不使用fuki形式
  50. #
  51. #
  52. # 【素材要求】
  53. #
  54. #   1. 要求所有半身像朝向一致(默认是正面偏右)
  55. #
  56. #==============================================================================

  57. #==============================================================================
  58. # ■ Fuki_v6_Setup
  59. #------------------------------------------------------------------------------
  60. #    Fuki对话框优化版 v6 参数设置
  61. #==============================================================================

  62. module Fuki_v6_Setup
  63.    
  64.   #--------------------------------------------------------------------------
  65.   # ● 外观
  66.   #--------------------------------------------------------------------------
  67.   
  68.     # 窗口透明度
  69.     FUKI_OPACITY = 255         # 呼出对话框
  70.     MES_OPACITY  = 160         # 默认信息窗口
  71.    
  72.     # 角色高度尺寸
  73.     CHARACTOR_HEIGHT = 50
  74.    
  75.     # 呼出对话框的相对位置(纵坐标)
  76.     POP_SHIFT_TOP = 0          # 表示位置为上的时候
  77.     POP_SHIFT_UNDER = -4       # 表示位置为下的时候
  78.    
  79.     # 信息的表示速度(数字越小速度越快,0为瞬间表示)
  80.     # 游戏中可以随时用数字代入 $MES_SPEED 来改变消息表示速度。
  81.     MES_SPEED = 1
  82.    
  83.     # 名称修饰符(一对)(此处参考 沉影不器 的VX版对话框加强)
  84.     NAME_SYMBOL = "【】"
  85.    
  86.     # 名称颜色
  87.     NAME_COLOR = 7
  88.   
  89.   #--------------------------------------------------------------------------
  90.   # ● 功能( true / false )
  91.   #--------------------------------------------------------------------------
  92.    
  93.     # 是否显示尾巴
  94.     TAIL_SHOW = true
  95.    
  96.     # 是否播放打字音效
  97.     $play_voice = false
  98.    
  99.     # $MES_SPEED不为0时,是否可以用确定键快速显示对话
  100.     ENABLE_SKIP = true

  101.     # 窗口表示时是否根据画面大小自动改变窗口出现的位置
  102.     POS_FIX = true
  103.    
  104.   #--------------------------------------------------------------------------
  105.   # ● 字体
  106.   #--------------------------------------------------------------------------
  107.   
  108.     # 预设字体组
  109.     FONT_ARRAY = ["幼圆", "黑体", "宋体"]
  110.    
  111.     # 默认字号【已知BUG,当默认字号不为20时会导致各种奇怪问题……暂未修正】
  112.     MES_FONT_SIZE = 20
  113.    
  114.     # 默认字体颜色
  115.     FUKI_COLOR = Color.new(0, 0, 0, 255)
  116.   
  117.   #--------------------------------------------------------------------------
  118.   # ● 目录
  119.   #--------------------------------------------------------------------------
  120.   
  121.     # 呼出对话框用Skin名称(自动在 Graphics\Windowskins 内搜索)
  122.     FUKI_SKIN_NAME = "Window"
  123.    
  124.     # 设定头像图片保存目录
  125.     FACE_PIC_DIR = "Graphics/Faces/"

  126.   #--------------------------------------------------------------------------
  127.   # ● 头像对应表
  128.   #--------------------------------------------------------------------------
  129.   #    如果不想使用角色名字直接作为头像文件名
  130.   #    可在这里重新设定角色名字与文件名的对应关系
  131.   #
  132.   #  (这功能怎么用我自己也没搞明白……大家无视吧 by 各种压力的猫君)
  133.   #--------------------------------------------------------------------------
  134.   
  135.     NAME_TABLE = {"玩家"=>"维斯特"}
  136.    
  137. end
  138. #==============================================================================
  139.   
  140. "┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓"
  141. "┃        自定义内容到此结束,以下内容切勿随意修改        ┃"
  142. "┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛"

  143. #==============================================================================
  144. # ● 初始化全局变量并定义chat方法
  145. #==============================================================================
  146. $mes_id   = nil
  147. $mes_name = ""
  148. def chat(id = nil,name = "")
  149.   $mes_id = id
  150.   $mes_name = name
  151. end

  152. #==============================================================================
  153. # ■ Game_Temp
  154. #==============================================================================

  155. class Game_Temp
  156.   #--------------------------------------------------------------------------
  157.   # ● 定义实例变量
  158.   #--------------------------------------------------------------------------
  159.   attr_accessor:namebmp      # 记录角色名字和头像文件名对应关系
  160.   #--------------------------------------------------------------------------
  161.   # ● 初始化对像
  162.   #--------------------------------------------------------------------------
  163.   alias initialize_fuki initialize
  164.   def initialize
  165.     initialize_fuki
  166.     @namebmp = Fuki_v6_Setup::NAME_TABLE
  167.   end
  168. end

  169. #==============================================================================
  170. # ■ Window_InputNumber
  171. #==============================================================================

  172. class Window_InputNumber < Window_Base
  173.   #--------------------------------------------------------------------------
  174.   # ● 初始化对像
  175.   #     digits_max : 位数
  176.   #--------------------------------------------------------------------------
  177.   def initialize(digits_max)
  178.     @digits_max = digits_max
  179.     @number = 0
  180.     # 从数字的幅度计算(假定与 0~9 等幅)光标的幅度
  181.     dummy_bitmap = Bitmap.new(Fuki_v6_Setup::MES_FONT_SIZE, Fuki_v6_Setup::MES_FONT_SIZE)
  182.     @cursor_width = dummy_bitmap.text_size("0").width + 8
  183.     dummy_bitmap.dispose
  184.     super(0, 0, @cursor_width * @digits_max + 32, 64)
  185.     self.contents = Bitmap.new(width - 32, height - 32)
  186.     self.contents.font.size = Fuki_v6_Setup::MES_FONT_SIZE
  187.     self.contents.font.color = Fuki_v6_Setup::FUKI_COLOR
  188.     self.z += 9999
  189.     self.opacity = 0
  190.     @index = 0
  191.     refresh
  192.     update_cursor_rect
  193.   end
  194.   #--------------------------------------------------------------------------
  195.   # ● 更新光标矩形
  196.   #--------------------------------------------------------------------------
  197.   def update_cursor_rect
  198.     self.cursor_rect.set(@index * @cursor_width-4, 0, @cursor_width, Fuki_v6_Setup::MES_FONT_SIZE + 4)
  199.   end
  200.   #--------------------------------------------------------------------------
  201.   # ● 刷新
  202.   #--------------------------------------------------------------------------
  203.   def refresh
  204.     self.contents.clear
  205.     s = sprintf("%0*d", @digits_max, @number)
  206.     for i in 0...@digits_max
  207.       self.contents.draw_text(i * @cursor_width, 0, 24, Fuki_v6_Setup::MES_FONT_SIZE + 4, s[i,1])
  208.     end
  209.   end
  210. end

  211. #==============================================================================
  212. # ■ Window_Message
  213. #==============================================================================

  214. class Window_Message < Window_Selectable
  215.   
  216.   #--------------------------------------------------------------------------
  217.   # ● 初始化状态
  218.   #--------------------------------------------------------------------------
  219.   def initialize
  220.     super(80, 304, 480, 160)
  221.     self.contents = Bitmap.new(width - 32, height - 32)
  222.     self.contents.font.color = text_color(0)
  223.     self.visible = false
  224.     self.z = 9998
  225.     @fade_in = false
  226.     @fade_out = false
  227.     @contents_showing = false
  228.     @cursor_width = 0
  229.     self.active = false
  230.     self.index = -1
  231.     @w = 0
  232.     @h = 0
  233.     @wait = 0
  234.     @dx = 0
  235.     @dy = 0
  236.     $MES_SPEED = Fuki_v6_Setup::MES_SPEED
  237.     #------------------------
  238.     # ★ 特殊时期中断标志
  239.     #------------------------
  240.     @no_term_stop = false
  241.     @save_x = 0
  242.     @save_y = 0
  243.     @old_text_info = []
  244.     @show_right = false
  245.     @show_name  = false
  246.     @face_width = 0
  247.   end
  248.   #--------------------------------------------------------------------------
  249.   # ○ 决定窗口尺寸并生成窗口
  250.   #--------------------------------------------------------------------------
  251.   def refresh_create
  252.     unless @no_term_stop
  253.       @pic_skin.dispose if @pic_skin != nil
  254.       if $game_temp.message_text.include?(":")
  255.         if $game_temp.message_text.include?("@r")
  256.           @show_right = true
  257.           $game_temp.message_text.sub!(/\@r/, "")
  258.         end
  259.         @show_name = true
  260.         # 添加名称修饰符
  261.         unless Fuki_v6_Setup::NAME_SYMBOL.empty?
  262.           $game_temp.message_text = '\c[' + Fuki_v6_Setup::NAME_COLOR.to_s + ']' + Fuki_v6_Setup::NAME_SYMBOL[0,Fuki_v6_Setup::NAME_SYMBOL.size/2] + $game_temp.message_text
  263.           $game_temp.message_text.sub!(/\:/, Fuki_v6_Setup::NAME_SYMBOL[Fuki_v6_Setup::NAME_SYMBOL.size/2,Fuki_v6_Setup::NAME_SYMBOL.size/2] + '\c[0]')
  264.         end
  265.       end
  266.       self.contents.clear
  267.       self.contents.font.color = normal_color
  268.       # 取得窗口尺寸
  269.       get_windowsize
  270.       w = @w + 40
  271.       h = @h * (self.contents.font.size + 4) + 30
  272.       h = 64 if h < 64
  273.       # 生成呼出窗口
  274.       set_fukidasi(self.x, self.y, w, h)
  275.       draw_msg_face
  276.       create_backbmp
  277.     end
  278.     # 初始化信息表示使用的变量
  279.     @dx = @save_x
  280.     @dx += @face_width unless @show_right
  281.     @dy = @save_y
  282.     @cursor_width = 0
  283.     @contents_drawing = true
  284.     # 瞬间表示的情况下
  285.     if $MES_SPEED == 0
  286.       # 循环信息描绘处理
  287.       while $game_temp.message_text != ""
  288.         draw_massage
  289.       end
  290.       draw_opt_text
  291.       @contents_showing_end = true
  292.       @contents_drawing = false
  293.     else
  294.       # 一个一个描绘文字
  295.       refresh_drawtext
  296.     end
  297.   end
  298.   #--------------------------------------------------------------------------
  299.   # ○ 一个一个描绘文字
  300.   #--------------------------------------------------------------------------
  301.   def refresh_drawtext
  302.     # 当按下确定键的时候直接显示剩余的全部文字
  303.     if Input.trigger?(Input::C) and Fuki_v6_Setup::ENABLE_SKIP
  304.       # 循环信息描绘处理
  305.       while $game_temp.message_text != ""
  306.         draw_massage
  307.       end
  308.       draw_opt_text
  309.       @contents_showing_end = true
  310.       @contents_drawing = false
  311.     elsif $game_temp.message_text != ""
  312.       if @wait > 0
  313.         @wait -= 1
  314.       elsif @wait == 0
  315.         # 描绘处理
  316.         draw_massage
  317.         @wait = $MES_SPEED
  318.       end
  319.     else
  320.       draw_opt_text
  321.       @contents_showing_end = true
  322.       @contents_drawing = false
  323.     end
  324.   end
  325.   #--------------------------------------------------------------------------
  326.   # ○ 取得窗口尺寸
  327.   #--------------------------------------------------------------------------
  328.   def get_windowsize
  329.     get_face_width($mes_name)
  330.     x = y = 0
  331.     @h = @w = 0
  332.     @cursor_width = 0
  333.     # 有选择项的话,处理字的缩进
  334.     if $game_temp.choice_start == 0
  335.       x = 16
  336.     end
  337.     # 有等待显示的文字的情况下
  338.     if $game_temp.message_text != nil
  339.     text = $game_temp.message_text.clone
  340.       # 限制文字处理
  341.       begin
  342.         last_text = text.clone
  343.         text.gsub!(/\\[Vv]\[([0-9]+)\]/) { $game_variables[$1.to_i] }
  344.       end until text == last_text
  345.       text.gsub!(/\\[Nn]\[([0-9]+)\]/) do
  346.         $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
  347.       end
  348.       text.gsub!(/\\\\/)                 { "\x00" }
  349.       text.gsub!(/\\[Cc]\[([0-9]+)\]/)   { "\x01" }
  350.       text.gsub!(/\\[Gg]/)               { "\x02" }
  351.       text.gsub!(/\\[Ss]\[([0-9]+)\]/)   { "\x03" + $data_skills[$1.to_i].name }
  352.       text.gsub!(/\\[Ii]\[([0-9]+)\]/)   { "\x04" + $data_items[$1.to_i].name }
  353.       text.gsub!(/\\[Ww]\[([0-9]+)\]/)   { "\x05" + $data_weapons[$1.to_i].name }
  354.       text.gsub!(/\\[Aa]\[([0-9]+)\]/)   { "\x06" + $data_armors[$1.to_i].name }
  355.       text.gsub!(/\\[Rr]\[([0-9]+)\]/)   { "\x10" + $game_actors[$1.to_i].name }
  356.       # c 获取 1 个字 (如果不能取得文字就循环)
  357.       while ((c = text.slice!(/./m)) != nil)
  358.         if c == "\x00"
  359.           c = "\"
  360.         end
  361.         if c == "\x01" or c == "\x02"
  362.           next
  363.         end
  364.         if c == "\x03" or c == "\x04" or c == "\x05" or c == "\x06" or c == "\x010"
  365.           c = "   "
  366.         end
  367.         if c == "\n"
  368.           # y 累加 1
  369.           y += 1
  370.           # 取得纵横尺寸
  371.           @h = y
  372.           @w = x > @w ? x : @w
  373.           if y >= $game_temp.choice_start
  374.             @w = x + Fuki_v6_Setup::MES_FONT_SIZE > @w ? x + Fuki_v6_Setup::MES_FONT_SIZE : @w
  375.           end
  376.           x = 0
  377.           x = Fuki_v6_Setup::MES_FONT_SIZE if y >= $game_temp.choice_start
  378.           # 下面的文字
  379.           next
  380.         end
  381.         # x 为要描绘文字的宽度加法运算
  382.         x += self.contents.text_size(c).width
  383.       end
  384.     end
  385.     # 输入数值的情况
  386.     if $game_temp.num_input_variable_id > 0
  387.       digits_max = $game_temp.num_input_digits_max
  388.       number = $game_variables[$game_temp.num_input_variable_id]
  389.       @h += 1
  390.       x = digits_max * self.contents.font.size + 16
  391.       @w = x > @w ? x : @w
  392.     end
  393.     @w += @face_width
  394.     @w = 128 if @w < 128
  395.   end
  396.   #--------------------------------------------------------------------------
  397.   # ○ 描绘信息处理
  398.   #--------------------------------------------------------------------------
  399.   def draw_massage
  400.     # 有等待显示的文字的情况下
  401.     if $game_temp.message_text != nil or @old_text_info != nil
  402.       text = $game_temp.message_text
  403.       # 限制文字处理
  404.       begin
  405.         last_text = text.clone
  406.         text.gsub!(/\\[Vv]\[([0-9]+)\]/) { $game_variables[$1.to_i] }
  407.       end until text == last_text
  408.       text.gsub!(/\\[Nn]\[([0-9]+)\]/) do
  409.         $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
  410.       end
  411.       text.gsub!(/\\\\/)                 { "\x00" }
  412.       text.gsub!(/\\[Cc]\[([0-9]+)\]/)   { "\x01[#{$1}]" }
  413.       text.gsub!(/\\[Gg]/)               { "\x02" }
  414.       text.gsub!(/\\[Ss]\[([0-9]+)\]/)   { "\x03[#{$1}]" }
  415.       text.gsub!(/\\[Ii]\[([0-9]+)\]/)   { "\x04[#{$1}]" }
  416.       text.gsub!(/\\[Ww]\[([0-9]+)\]/)   { "\x05[#{$1}]" }
  417.       text.gsub!(/\\[Aa]\[([0-9]+)\]/)   { "\x06[#{$1}]" }
  418.       text.gsub!(/\\[Oo]\[([0-9]+)\]/)   { "\x07[#{$1}]" }
  419.       text.gsub!(/\\[Qq]/)               { "\x08" }
  420.       text.gsub!(/\\[Ff]\[([0-9]+)\]/)   { "\x09[#{$1}]" }
  421.       text.gsub!(/\\[Rr]\[([0-9]+)\]/)   { "\x10[#{$1}]" }
  422.       # c 获取 1 个字
  423.       c = text.slice!(/./m)
  424.       # 默认对话框采用默认颜色
  425.       self.contents.font.color = normal_color if $mes_id == nil
  426.       # 选择项的情况
  427.       if @dy >= $game_temp.choice_start
  428.         # 处理字的缩进
  429.         @dx = Fuki_v6_Setup::MES_FONT_SIZE
  430.         @dx += @face_width unless @show_right
  431.         @dx += Fuki_v6_Setup::MES_FONT_SIZE if @show_name
  432.         # 描绘文字
  433.         self.contents.draw_text(@dx, 24 * @dy, 24, 24, c)
  434.         # x 为要描绘文字宽度的加法运算
  435.         @dx += self.contents.text_size(c).width
  436.         # 循环
  437.         while ((c = text.slice!(/./m)) != "\n")
  438.           # 描绘文字
  439.           self.contents.draw_text(@dx, 24 * @dy, 24, 24, c)
  440.           # x 为要描绘文字宽度的加法运算
  441.           @dx += self.contents.text_size(c).width
  442.         end
  443.         if c == "\n"
  444.           # 更新光标宽度
  445.           @cursor_width = [@cursor_width, @dx - @face_width].max
  446.           # dy 累加 1
  447.           @dy += 1
  448.         end
  449.         return
  450.       end
  451.       case c
  452.       when "\x00"
  453.         c = "\"            
  454.       when "\x01"                  
  455.         text.sub!(/\[([0-9]+)\]/, "")
  456.         color = $1.to_i
  457.         self.contents.font.color = text_color(color)
  458.       when "\x02"
  459.         @contents_showing_end = true
  460.         @contents_drawing = false
  461.         terminate_messageX
  462.         @save_x = @dx
  463.         @save_y = @dy
  464.       when "\x03"
  465.         text.sub!(/\[([0-9]+)\]/, "")
  466.         last_character
  467.         draw_icon($data_skills[$1.to_i], 4 + @dx, 24 * @dy)
  468.         @dx += self.contents.text_size("   ").width
  469.       when "\x04"
  470.         text.sub!(/\[([0-9]+)\]/, "")
  471.         last_character
  472.         draw_icon($data_items[$1.to_i], 4 + @dx, 24 * @dy)
  473.         @dx += self.contents.text_size("   ").width
  474.       when "\x05"
  475.         text.sub!(/\[([0-9]+)\]/, "")
  476.         last_character
  477.         draw_icon($data_weapons[$1.to_i], 4 + @dx, 24 * @dy)
  478.         @dx += self.contents.text_size("   ").width
  479.       when "\x06"
  480.         text.sub!(/\[([0-9]+)\]/, "")
  481.         last_character
  482.         draw_icon($data_armors[$1.to_i], 4 + @dx, 24 * @dy)
  483.         @dx += self.contents.text_size("   ").width
  484.       when "\x07"
  485.         text.sub!(/\[([0-9]+)\]/, "")
  486.         self.contents.font.color.alpha = $1.to_i
  487.       when "\x08"
  488.         text.sub!(/\[([0-9]+)\]/, "")
  489.         $play_voice = !$play_voice
  490.       when "\x09"
  491.         text.sub!(/\[([0-9]+)\]/, "")
  492.         self.contents.font.name = Fuki_v6_Setup::FONT_ARRAY[$1.to_i]
  493.       when "\x10"
  494.         text.sub!(/\[([0-9]+)\]/, "")
  495.         last_character
  496.         draw_actor_graphic($game_actors[$1.to_i], 4 + @dx, 24 * @dy)
  497.         @dx += self.contents.text_size("   ").width
  498.       when "\n"
  499.         @dy += 1
  500.         @dx = 0
  501.         @dx += @face_width unless @show_right
  502.         @dx += Fuki_v6_Setup::MES_FONT_SIZE if @show_name
  503.         last_character
  504.       else
  505.         last_character
  506.         size_zy = 6  # 设定文字动态增大幅度
  507.         if c != nil
  508.           self.contents.font.size = Fuki_v6_Setup::MES_FONT_SIZE
  509.           font_size = self.contents.font.size += size_zy
  510.           @old_text_info.push(@dx , @dy , font_size, self.contents.font.color.clone, c)
  511.           self.contents.draw_text(4 + @dx, (font_size + 4 - size_zy) * @dy - size_zy / 2, font_size, font_size, c)
  512.           self.contents.font.size -= size_zy
  513.           Audio.se_play("Audio/SE/Voice", 90, 100) if $play_voice and c != " "
  514.           @dx += self.contents.text_size(c).width
  515.         end
  516.       end
  517.     end
  518.   end
  519.   #--------------------------------------------------------------------------
  520.   # ○ 完成上一个字符的描绘
  521.   #--------------------------------------------------------------------------
  522.   def last_character
  523.     size_zy = 6  # 设定文字动态增大幅度
  524.     unless @old_text_info == []
  525.       self.contents.fill_rect (4 + @old_text_info[0], (@old_text_info[2]+ 4 - size_zy) * @old_text_info[1] - size_zy / 2, @old_text_info[2], @old_text_info[2], Color.new(0,0,0,0))
  526.       color = self.contents.font.color.clone
  527.       self.contents.font.color = @old_text_info[3].clone
  528.       self.contents.font.size = @old_text_info[2] -= size_zy
  529.       self.contents.draw_text(4 + @old_text_info[0], (@old_text_info[2] + 4) * @old_text_info[1], @old_text_info[2], @old_text_info[2], @old_text_info[4])
  530.       self.contents.font.color = color
  531.       @old_text_info = []
  532.     end
  533.   end
  534.   #--------------------------------------------------------------------------
  535.   # ○ 选择项和输入数值的情况下
  536.   #--------------------------------------------------------------------------
  537.   def draw_opt_text
  538.     # 选择项的情况下
  539.     if $game_temp.choice_max > 0
  540.       @item_max = $game_temp.choice_max
  541.       self.active = true
  542.       self.index = 0
  543.     end
  544.     # 输入数值的情况下
  545.     if $game_temp.num_input_variable_id > 0
  546.       digits_max = $game_temp.num_input_digits_max
  547.       number = $game_variables[$game_temp.num_input_variable_id]
  548.       @input_number_window = Window_InputNumber.new(digits_max)
  549.       @input_number_window.number = number
  550.       @input_number_window.x = self.x + @face_width + Fuki_v6_Setup::MES_FONT_SIZE + 8
  551.       @input_number_window.y = self.y + $game_temp.num_input_start * (Fuki_v6_Setup::MES_FONT_SIZE + 2)
  552.     end
  553.   end
  554.   #--------------------------------------------------------------------------
  555.   # ○ 生成背景图片
  556.   #--------------------------------------------------------------------------
  557.   def create_backbmp
  558.     @pic_skin.dispose if @pic_skin != nil
  559.     @pic_skin = Sprite.new
  560.     @pic_skin.opacity = 0 unless @no_term_stop
  561.     @pic_skin.bitmap = Bitmap.new(self.width + 32, self.height + 32)
  562.     @pic_skin.x = self.x + 2
  563.     @pic_skin.y = self.y + 2
  564.     @pic_skin.z = self.z
  565.     bitmap = RPG::Cache.windowskin(Fuki_v6_Setup::FUKI_SKIN_NAME)
  566.     rect = Rect.new(0, 0, 32, 32)
  567.     @pic_skin.bitmap.blt(0, 0, bitmap, rect)
  568.     rect = Rect.new(96, 0, 32, 32)
  569.     @pic_skin.bitmap.blt(self.width-32, 0, bitmap, rect)
  570.     rect = Rect.new(0, 96, 32, 32)
  571.     @pic_skin.bitmap.blt(0, self.height-32, bitmap, rect)
  572.     rect = Rect.new(96, 96, 32, 32)
  573.     @pic_skin.bitmap.blt(self.width-32, self.height-32, bitmap, rect)
  574.     rect = Rect.new(0, 32, 32, 32)
  575.     @pic_skin.bitmap.stretch_blt(Rect.new(0, 32, 32, self.height - 64), bitmap, rect)
  576.     rect = Rect.new(96, 32, 32, 32)
  577.     @pic_skin.bitmap.stretch_blt(Rect.new(self.width-32,32,32,self.height-64), bitmap, rect)
  578.     rect = Rect.new(32, 0, 32, 32)
  579.     @pic_skin.bitmap.stretch_blt(Rect.new(32,0,self.width-64,self.height-32), bitmap, rect)
  580.     # 如果尾巴在底端的话,更改底边描绘方式以修正阴影
  581.     if @message_position == 0 and @tale != nil
  582.       # 乱七八糟的三个计算变量
  583.       above_tale_x = @tale.x - self.x + 14
  584.       above_tale_width1 = @tale.x - self.x - 16 - 2
  585.       above_tale_width2 = self.width - above_tale_width1 - 32 - 64
  586.       # 中部(尾巴上方)
  587.       rect = Rect.new(32, 96, 32, 16)
  588.       @pic_skin.bitmap.stretch_blt(Rect.new(above_tale_x , self.height-32, 32, 24), bitmap, rect)
  589.       # 左半部
  590.       rect = Rect.new(32, 96, 32, 32)
  591.       @pic_skin.bitmap.stretch_blt(Rect.new(32, self.height-32, above_tale_width1, 32), bitmap, rect)
  592.       # 右半部
  593.       @pic_skin.bitmap.stretch_blt(Rect.new(32+above_tale_x, self.height-32, above_tale_width2, 32), bitmap, rect)
  594.       bitmap.dispose
  595.     else # 除此之外的情况保留原来的底边描绘方式
  596.       rect = Rect.new(32, 96, 32, 32)
  597.       @pic_skin.bitmap.stretch_blt(Rect.new(32,self.height-32,self.width-64,32), bitmap, rect)
  598.       bitmap.dispose
  599.     end
  600.   end
  601.   #--------------------------------------------------------------------------
  602.   # ○ 设置呼出对话框
  603.   #--------------------------------------------------------------------------
  604.   def set_fukidasi(x, y, width, height)
  605.     begin
  606.       self.pause = false # 不显示暂停标志
  607.       pos = get_fuki_pos(width, height) # 取得对话框位置
  608.       x = pos[0]
  609.       y = pos[1]
  610.       self.windowskin = RPG::Cache.windowskin($game_system.windowskin_name)
  611.       self.x = x
  612.       self.y = y
  613.       self.height = height
  614.       self.width = width
  615.       unless @no_term_stop
  616.         self.contents.dispose
  617.         self.contents = Bitmap.new(width - 32, height - 32)
  618.         self.back_opacity = Fuki_v6_Setup::FUKI_OPACITY
  619.         self.contents.clear
  620.         self.contents.font.color = Color.new(0, 0, 0, 255)
  621.         self.contents.font.size = Fuki_v6_Setup::MES_FONT_SIZE
  622.       end
  623.       if $game_system.message_frame == 0
  624.         tale_pos = get_tale_pos
  625.         @tale = Sprite.new
  626.         @tale.bitmap = Bitmap.new(64, 32)
  627.         if Fuki_v6_Setup::TAIL_SHOW
  628.           case @message_position
  629.           when 0  # 上
  630.             bitmap = RPG::Cache.windowskin(Fuki_v6_Setup::FUKI_SKIN_NAME)
  631.             rect = Rect.new(32, 32, 64, 32)
  632.             @tale.bitmap.blt(0, 0, bitmap, rect)
  633.             bitmap.dispose
  634.             @tale.x = tale_pos[0]
  635.             @tale.x += 8 if @tale.x < 64
  636.             if @tale.x > 640 - 64
  637.               @tale.mirror = true
  638.               @tale.x -= 64
  639.             end
  640.             @tale.y = tale_pos[1]
  641.             @tale.z = self.z + 1
  642.           when 1  # 中
  643.             @tale.dispose
  644.             @tale = nil
  645.           when 2  # 下
  646.             bitmap = RPG::Cache.windowskin(Fuki_v6_Setup::FUKI_SKIN_NAME)
  647.             rect = Rect.new(32, 64, 64, 32)
  648.             @tale.bitmap.blt(0, 0, bitmap, rect)
  649.             bitmap.dispose
  650.             @tale.x = tale_pos[0]
  651.             @tale.x += 8 if @tale.x < 64
  652.             if @tale.x > 640 - 64
  653.               @tale.mirror = true
  654.               @tale.x -= 64
  655.             end
  656.             @tale.y = tale_pos[1]
  657.             @tale.z = self.z# + 1
  658.           end
  659.         end
  660.       end
  661.     rescue
  662.       del_fukidasi
  663.       reset_window(width, height)
  664.     end
  665.   end
  666.   #--------------------------------------------------------------------------
  667.   # ○ 计算呼出对话框的位置
  668.   #--------------------------------------------------------------------------
  669.   def get_fuki_pos(width, height)
  670.     # 取得角色
  671.     @character = get_character($mes_id)
  672.     if @character == nil
  673.       # 角色不存在的情况下使用默认信息框
  674.       
  675.       del_fukidasi
  676.       reset_window(width, height)
  677.       return
  678.     end
  679.     # 处理坐标
  680.     x = (@character.real_x - $game_map.display_x + 64) * 32 / 128 - (width / 2)
  681.     # 为尽量显示在画面内而移动横坐标
  682.     if x + width > 640
  683.       x = 640 - width
  684.     elsif x < 0
  685.       x = 0
  686.     end
  687.     # 决定窗口位置
  688.     case $game_system.message_position
  689.     when 0  # 上
  690.       y = (@character.real_y - $game_map.display_y + 64) * 32 / 128 - height - Fuki_v6_Setup::CHARACTOR_HEIGHT + Fuki_v6_Setup::POP_SHIFT_TOP
  691.     when 1  # 中
  692.       x = (640 - width) / 2
  693.       y = (480 - height) / 2
  694.     when 2  # 下
  695.       y =  (@character.real_y - $game_map.display_y + 64) * 32 / 128 + 32 + Fuki_v6_Setup::POP_SHIFT_UNDER
  696.     end
  697.     # 纪录文章显示位置
  698.     @message_position = $game_system.message_position
  699.     if Fuki_v6_Setup::POS_FIX
  700.       case @message_position
  701.       when 0  # 上
  702.         if y <= 0
  703.           @message_position = 2
  704.           y =  (@character.real_y - $game_map.display_y + 64) * 32 / 128 + 32 + Fuki_v6_Setup::POP_SHIFT_UNDER
  705.         end
  706.       when 2  # 下
  707.         if y + height >= 480
  708.           @message_position = 0
  709.           y = (@character.real_y - $game_map.display_y + 64) * 32 / 128 - height - Fuki_v6_Setup::CHARACTOR_HEIGHT + Fuki_v6_Setup::POP_SHIFT_TOP
  710.         end
  711.       end
  712.     end
  713.     return [x, y]
  714.   end
  715.   #--------------------------------------------------------------------------
  716.   # ○ 计算尾部图标的位置
  717.   #--------------------------------------------------------------------------
  718.   def get_tale_pos
  719.     case @message_position
  720.     when 0  # 上
  721.       # 处理坐标
  722.       x = ( @character.real_x - $game_map.display_x + 64 ) * 32 / 128 - 8
  723.       y = self.y + self.height - 6
  724.     when 1  # 中
  725.       x = nil
  726.       y = nil
  727.     when 2  # 下
  728.       # 处理坐标
  729.       x = ( @character.real_x - $game_map.display_x + 64 ) * 32 / 128 - 8
  730.       y = self.y - 18
  731.     end
  732.     return [x, y]
  733.   end
  734.   #--------------------------------------------------------------------------
  735.   # ○ 设置角色半身像窗口
  736.   #--------------------------------------------------------------------------
  737.   def draw_msg_face
  738.     @face_sprite.dispose if @face_sprite != nil
  739.     # $mes_name为空时不显示
  740.     if $mes_name == nil or $mes_name == ""
  741.       return
  742.     else
  743.       # 设定变量
  744.       mes_name = $mes_name
  745.       if $game_temp.namebmp[mes_name] == nil
  746.         sFile = Fuki_v6_Setup::FACE_PIC_DIR + mes_name
  747.       else
  748.         sFile = Fuki_v6_Setup::FACE_PIC_DIR + $game_temp.namebmp[mes_name]
  749.       end
  750.       bitmap = Bitmap.new(sFile)
  751.       @pic_width = bitmap.width
  752.       @pic_height = bitmap.height
  753.       @face_sprite = Sprite.new
  754.       @face_sprite.x = self.x + 26
  755.       @face_sprite.x = self.x + self.width - @pic_width - 26 if @show_right
  756.       @face_sprite.y = self.y + self.height - @pic_height - 6
  757.       @face_sprite.bitmap = bitmap
  758.       @face_sprite.z = self.z + 3
  759.       @face_sprite.mirror = @show_right
  760.       @face_sprite.opacity = 0
  761.     end
  762.   end
  763.   #--------------------------------------------------------------------------
  764.   # ○ 释放呼出对话框
  765.   #--------------------------------------------------------------------------
  766.   def del_fukidasi
  767.     self.opacity = 0
  768.     self.x = 80
  769.     self.width = 480
  770.     self.height = 160
  771.     self.contents.dispose
  772.     self.contents = Bitmap.new(width - 32, height - 32)
  773.     self.pause = true
  774.     if @tale != nil
  775.       @tale.dispose
  776.       @tale = nil
  777.     end
  778.   end
  779.   #--------------------------------------------------------------------------
  780.   # ○ 取得角色
  781.   #     parameter : 参数
  782.   #--------------------------------------------------------------------------
  783.   def get_character(parameter)
  784.     # 参数分歧
  785.     case parameter
  786.     when nil
  787.       return events == nil
  788.     when -1  # 玩家
  789.       return $game_player
  790.     when 0   # 该事件
  791.       events = $game_map.events
  792.       # 循环 (地图事件)
  793.       for event in $game_map.events.values
  794.         # 如果找到了启动中的事件
  795.         if event.starting
  796.           @event_id = event.id
  797.         end
  798.       end
  799.       return events == nil ? nil : events[@event_id]
  800.     else     # 特定事件
  801.       events = $game_map.events
  802.       return events == nil ? nil : events[parameter]
  803.     end
  804.   end
  805.   #--------------------------------------------------------------------------
  806.   # ● 设定窗口位置和不透明度
  807.   #--------------------------------------------------------------------------
  808.   def reset_window(width = nil, height = nil)
  809.     if $game_temp.in_battle
  810.       self.y = 16
  811.     else
  812.       case $game_system.message_position
  813.       when 0  # 上
  814.         self.y = 16
  815.       when 1  # 中
  816.         if height != nil and width != nil
  817.           self.y = (480 - height) / 2 - 32
  818.           self.x = (640 - width) / 2
  819.           self.width = width
  820.           self.height = height
  821.           self.contents.dispose
  822.           self.contents = Bitmap.new(width - 32, height - 32)
  823.         else
  824.           self.y = 160
  825.         end
  826.       when 2  # 下
  827.         self.y = 304
  828.       end
  829.     end
  830.     self.opacity = 0
  831.     if $game_system.message_frame == 0
  832.       self.back_opacity = Fuki_v6_Setup::MES_OPACITY
  833.     else
  834.       self.back_opacity = 0
  835.     end
  836.   end
  837.   #--------------------------------------------------------------------------
  838.   # ● 刷新画面
  839.   #--------------------------------------------------------------------------
  840.   def update
  841.     if $tale_need_dispose
  842.       del_fukidasi
  843.       $tale_need_dispose = false
  844.     end
  845.     super
  846.     update_fuki                 # 呼出模式下跟随事件移动
  847.     if @fade_in                 # 渐变的情况下
  848.       self.contents_opacity += 24
  849.       @pic_skin.opacity += 20 if $game_system.message_frame == 0
  850.       if @tale != nil
  851.         @face_sprite.opacity += 24 if @face_sprite != nil and !@face_sprite.disposed?
  852.         @tale.opacity += 20
  853.       end
  854.       @input_number_window.contents_opacity += 24 if @input_number_window != nil
  855.       @fade_in = false if self.contents_opacity == 255
  856.       return
  857.     end
  858.     if @contents_drawing        # 显示信息中的情况下
  859.       refresh_drawtext
  860.       return
  861.     end
  862.     update_input_number_window  # 输入数值的情况下
  863.     if @contents_showing_end    # 显示信息结束的情况下
  864.       if $game_temp.choice_max == 0 and @tale == nil
  865.         self.pause = true
  866.       else
  867.         self.pause = false
  868.       end
  869.       update_choose
  870.       return
  871.     end
  872.     if @fade_out == false and $game_temp.message_text != nil # 在渐变以外的状态下
  873.       @contents_showing = true
  874.       $game_temp.message_window_showing = true
  875.       reset_window
  876.       refresh_create
  877.       if @no_term_stop
  878.         self.visible = true        
  879.       else
  880.         @tale.opacity = 0 if @tale != nil
  881.         Graphics.frame_reset
  882.         self.visible = true
  883.         self.contents_opacity = 0
  884.         @input_number_window.contents_opacity = 0 if @input_number_window != nil
  885.         @fade_in = true
  886.       end
  887.       return
  888.     end
  889.     unless @no_term_stop # 没有可以显示的信息、但是窗口为可见的情况下
  890.       if self.visible
  891.         @fade_out = true
  892.         self.opacity -= 48
  893.         @face_sprite.opacity -= 48 if @face_sprite != nil and !@face_sprite.disposed?
  894.         @pic_skin.opacity -= 48 if @pic_skin != nil and !@pic_skin.disposed?
  895.         @tale.opacity -= 48 if @tale != nil and !@tale.disposed?
  896.         if (@face_sprite == nil) or @face_sprite.disposed? or (@face_sprite.opacity == 0)
  897.           self.visible = false
  898.           @face_sprite.dispose if @face_sprite != nil
  899.           @pic_skin.dispose
  900.           @fade_out = false
  901.           $game_temp.message_window_showing = false
  902.         end
  903.         return
  904.       end
  905.     else
  906.       $game_temp.message_window_showing = false   
  907.     end
  908.   end
  909.   #--------------------------------------------------------------------------
  910.   # ● 释放
  911.   #--------------------------------------------------------------------------
  912.   def dispose
  913.     terminate_message
  914.     $game_temp.message_window_showing = false
  915.     @input_number_window.dispose if @input_number_window != nil
  916.     super
  917.   end
  918.   #--------------------------------------------------------------------------
  919.   # ● 信息结束处理
  920.   #--------------------------------------------------------------------------
  921.   def terminate_message
  922.     self.active = false
  923.     self.pause = false
  924.     self.index = -1
  925.     self.contents.clear
  926.     # 清除显示中标志
  927.     @contents_showing = false
  928.     @contents_showing_end = false
  929.     $mes_name = ""
  930.     # 呼叫信息调用
  931.     $game_temp.message_proc.call if $game_temp.message_proc != nil
  932.     # 清除文章、选择项、输入数值的相关变量
  933.     $game_temp.message_text = nil
  934.     $game_temp.message_proc = nil
  935.     $game_temp.choice_start = 99
  936.     $game_temp.choice_max = 0
  937.     $game_temp.choice_cancel_type = 0
  938.     $game_temp.choice_proc = nil
  939.     $game_temp.num_input_start = 99
  940.     $game_temp.num_input_variable_id = 0
  941.     $game_temp.num_input_digits_max = 0
  942.     # 释放金钱窗口
  943.     if @gold_window != nil
  944.       @gold_window.dispose
  945.       @gold_window = nil
  946.     end
  947.     @no_term_stop = false
  948.     @save_x = 0
  949.     @save_y = 0
  950.     @show_right = false
  951.     @show_name  = false
  952.     @face_width = 0
  953.     $tale_need_dispose = true if @tale != nil
  954.   end
  955.   #--------------------------------------------------------------------------
  956.   # ● ★信息结束处理★
  957.   #--------------------------------------------------------------------------
  958.   def terminate_messageX
  959.     self.active = false
  960.     self.pause = false
  961.     self.index = -1
  962.     # 清除显示中标志
  963.     @contents_showing = false
  964.     @contents_showing_end = false
  965.     # 呼叫信息调用
  966.     $game_temp.message_proc.call if $game_temp.message_proc != nil
  967.     # 清除文章、选择项、输入数值的相关变量
  968.     $game_temp.message_text = nil
  969.     $game_temp.message_proc = nil
  970.     @no_term_stop = true
  971.     @show_right = false
  972.     @show_name  = false
  973.     @face_width = 0
  974.   end
  975.   #--------------------------------------------------------------------------
  976.   # ● 刷新光标矩形
  977.   #--------------------------------------------------------------------------
  978.   def update_cursor_rect
  979.     if @index >= 0
  980.       n = $game_temp.choice_start + @index
  981.       self.cursor_rect.set(Fuki_v6_Setup::MES_FONT_SIZE / 2, n * (Fuki_v6_Setup::MES_FONT_SIZE + 4), @cursor_width, Fuki_v6_Setup::MES_FONT_SIZE + 4)
  982.       self.cursor_rect.x += @face_width unless @show_right
  983.       self.cursor_rect.x += Fuki_v6_Setup::MES_FONT_SIZE / 2 if @show_name
  984.     else
  985.       self.cursor_rect.empty
  986.     end
  987.   end
  988.   #--------------------------------------------------------------------------
  989.   # ● 获取文字颜色色
  990.   #     n : 文字颜色编号 (0~31)
  991.   #--------------------------------------------------------------------------
  992.   def text_color(n)
  993.     return normal_color if n > 31
  994.     x = (n % 8) * 16
  995.     y = 128 + (n / 8) * 16
  996.     return RPG::Cache.windowskin(Fuki_v6_Setup::FUKI_SKIN_NAME).get_pixel(x, y)
  997.   end
  998.   #--------------------------------------------------------------------------
  999.   # ● 取得普通文字色
  1000.   #--------------------------------------------------------------------------
  1001.   def normal_color
  1002.     nil_color = Color.new(0,0,0,255)
  1003.     return Fuki_v6_Setup::FUKI_COLOR if Fuki_v6_Setup::FUKI_COLOR != nil_color
  1004.     return nil_color
  1005.   end
  1006.   #--------------------------------------------------------------------------
  1007.   # ● 获取头像宽度
  1008.   #--------------------------------------------------------------------------
  1009.   def get_face_width(face_name)
  1010.     return if $mes_name == ""
  1011.     filename = Fuki_v6_Setup::FACE_PIC_DIR + face_name
  1012.     bitmap = Bitmap.new(filename)
  1013.     @face_width = bitmap.width + Fuki_v6_Setup::MES_FONT_SIZE
  1014.     bitmap.dispose
  1015.   end
  1016.   #--------------------------------------------------------------------------
  1017.   # ● 描绘物品
  1018.   #     item : 物品
  1019.   #--------------------------------------------------------------------------
  1020.   def draw_icon(item, x, y)
  1021.     return if item == nil
  1022.     bitmap = RPG::Cache.icon(item.icon_name)
  1023.     self.contents.blt(x + 4, y, bitmap, Rect.new(0, 0, 24, 24))
  1024.     color = self.contents.font.color.clone
  1025.     self.contents.font.color = text_color(1)
  1026.     self.contents.draw_text(x + 28, y, self.contents.text_size(item.name).width + 5, 24, item.name)
  1027.     self.contents.font.color = color
  1028.     @dx += self.contents.text_size(item.name).width
  1029.   end
  1030.   #--------------------------------------------------------------------------
  1031.   # ● 图形的描绘
  1032.   #     actor : 角色
  1033.   #     x     : 描画目标 X 坐标
  1034.   #     y     : 描画目标 Y 坐标
  1035.   #--------------------------------------------------------------------------
  1036.   def draw_actor_graphic(actor, x, y)
  1037.     bitmap = RPG::Cache.character(actor.character_name, actor.character_hue)
  1038.     cw = bitmap.width / 4
  1039.     ch = bitmap.height / 4
  1040.     src_rect = Rect.new(0, 0, cw, ch)
  1041.     self.contents.blt(x, y - 4, bitmap, src_rect)
  1042.     color = self.contents.font.color.clone
  1043.     self.contents.font.color = text_color(1)
  1044.     self.contents.draw_text(x + 32, y, self.contents.text_size(actor.name).width + 5, 24, actor.name)
  1045.     self.contents.font.color = color
  1046.     @dx += self.contents.text_size(actor.name).width
  1047.   end
  1048.   #--------------------------------------------------------------------------
  1049.   # ● 刷新呼出对话框
  1050.   #--------------------------------------------------------------------------
  1051.   def update_fuki
  1052.     if @tale != nil
  1053.       pos = get_fuki_pos(self.width, self.height)
  1054.       self.x = pos[0]
  1055.       self.y = pos[1]
  1056.       tale_pos = get_tale_pos
  1057.       @tale.mirror = false
  1058.       @tale.x = tale_pos[0]
  1059.       @tale.x += 8 if @tale.x < 64
  1060.       if @tale.x > 640 - 64
  1061.         @tale.mirror = true
  1062.         @tale.x -= 64
  1063.       end
  1064.       @tale.y = tale_pos[1]
  1065.       @pic_skin.x = self.x + 2
  1066.       @pic_skin.y = self.y + 2
  1067.       if @face_sprite != nil and !@face_sprite.disposed?
  1068.         @face_sprite.x = self.x + 26
  1069.         @face_sprite.x = self.x + self.width - @pic_width - 26 if @show_right
  1070.         @face_sprite.y = self.y + self.height - @pic_height - 6
  1071.       end
  1072.     end
  1073.   end
  1074.   #--------------------------------------------------------------------------
  1075.   # ● 刷新数字输入框
  1076.   #--------------------------------------------------------------------------
  1077.   def update_input_number_window
  1078.     if @input_number_window != nil
  1079.       @input_number_window.update
  1080.       # 确定
  1081.       if Input.trigger?(Input::C)
  1082.         $game_system.se_play($data_system.decision_se)
  1083.         $game_variables[$game_temp.num_input_variable_id] = @input_number_window.number
  1084.         # 释放输入数值窗口
  1085.         @input_number_window.dispose
  1086.         @input_number_window = nil
  1087.         $game_map.need_refresh = true
  1088.         terminate_message
  1089.       end
  1090.       return
  1091.     end
  1092.   end
  1093.   #--------------------------------------------------------------------------
  1094.   # ● 刷新选择输入
  1095.   #--------------------------------------------------------------------------
  1096.   def update_choose
  1097.     if Input.trigger?(Input::B)
  1098.       if $game_temp.choice_max > 0 and $game_temp.choice_cancel_type > 0
  1099.         $game_system.se_play($data_system.cancel_se)
  1100.         $game_temp.choice_proc.call($game_temp.choice_cancel_type - 1)
  1101.         terminate_message
  1102.       end
  1103.     end
  1104.     if Input.trigger?(Input::C)
  1105.       if $game_temp.choice_max > 0
  1106.         $game_system.se_play($data_system.decision_se)
  1107.         $game_temp.choice_proc.call(self.index)
  1108.       end
  1109.       terminate_message
  1110.     end
  1111.   end
  1112. end
复制代码


覆盖存档的时候弹出对话框提示
  1. #==============================================================================
  2. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  3. #==============================================================================
  4. #在覆盖存档的时候弹出对话框提示
  5. class Scene_Save < Scene_File
  6. # -----------------------------
  7.   def initialize
  8.     super("Save Data")
  9.     @confirm_window = Window_Base.new(120, 188, 400, 64)
  10.     @confirm_window.contents = Bitmap.new(368, 32)
  11.     string = "确定要覆盖这个进度吗?"
  12.     @confirm_window.contents.font.name = "幼圆"
  13.     @confirm_window.contents.font.size = 24
  14.     @confirm_window.contents.draw_text(4, 0, 368, 32, string)
  15.     @yes_no_window = Window_Command.new(100, ["覆盖", "取消"])
  16.     @confirm_window.visible = false
  17.     @confirm_window.z = 1500
  18.     @yes_no_window.visible = false
  19.     @yes_no_window.active = false
  20.     @yes_no_window.index = 1
  21.     @yes_no_window.x = 270
  22.     @yes_no_window.y = 252
  23.     @yes_no_window.z = 1500
  24.     @mode = 0
  25.   end
  26. # -----------------------------
  27.   def on_decision(filename)
  28.     if FileTest.exist?(filename)
  29.       @confirm_window.visible = true
  30.       @yes_no_window.visible = true
  31.       @yes_no_window.active = true
  32.       @mode = 1
  33.     else
  34.       $game_system.se_play($data_system.save_se)
  35.       file = File.open(filename, "wb")
  36.       write_save_data(file)
  37.       file.close
  38.       if $game_temp.save_calling
  39.         $game_temp.save_calling = false
  40.         $scene = Scene_Map.new
  41.       return
  42.     end
  43.     $scene = Scene_Map.new
  44.     #$scene = Scene_Menu.new(4)
  45.     end
  46.   end
  47. # -----------------------------
  48.   def update
  49.     if @mode == 0
  50.       super
  51.     else
  52.       @help_window.update
  53.       @yes_no_window.update
  54.       if Input.trigger?(Input::C)
  55.         $game_system.se_play($data_system.decision_se)
  56.         if @yes_no_window.index == 0
  57.           @yes_no_window.visible = false
  58.           @yes_no_window.active = false
  59.           @confirm_window.visible = false
  60.           filename = make_filename(@file_index)
  61.           $game_system.se_play($data_system.save_se)
  62.           file = File.open(filename, "wb")
  63.           write_save_data(file)
  64.           file.close
  65.           if $game_temp.save_calling
  66.             $game_temp.save_calling = false
  67.             $scene = Scene_Map.new
  68.           else
  69.             $scene = Scene_Map.new
  70.             #$scene = Scene_Menu.new(4)
  71.           end
  72.         else
  73.           @confirm_window.visible = false
  74.           @yes_no_window.visible = false
  75.           @yes_no_window.active = false
  76.           @yes_no_window.index = 1
  77.           @mode = 0
  78.         end
  79.       end
  80.       if Input.trigger?(Input::B)
  81.         @confirm_window.visible = false
  82.         @yes_no_window.visible = false
  83.         @yes_no_window.active = false
  84.         @yes_no_window.index = 1
  85.         @mode = 0
  86.       return
  87.     end
  88.   end
  89. end
  90. # -----------------------------
  91.   def on_cancel
  92.     $game_system.se_play($data_system.cancel_se)
  93.     if $game_temp.save_calling
  94.       $game_temp.save_calling = false
  95.       $scene = Scene_Map.new
  96.       return
  97.     end
  98.     $scene = Scene_Map.new
  99.     #$scene = Scene_Menu.new(4)
  100.   end
  101. # -----------------------------
  102.   def write_save_data(file)
  103.     ###characters改为写入第一个角色的信息,增加写入地图信息###
  104.     characters = $game_party.actors[0]
  105.     mapinfo = load_data("Data/MapInfos.rxdata")
  106.     Marshal.dump(mapinfo[$game_map.map_id].name, file )
  107.     #-------------------------------------------------------------------------
  108.     Marshal.dump(characters, file)
  109.     Marshal.dump(Graphics.frame_count, file)
  110.     $game_system.save_count += 1
  111.     $game_system.magic_number = $data_system.magic_number
  112.     Marshal.dump($game_system, file)
  113.     Marshal.dump($game_switches, file)
  114.     Marshal.dump($game_variables, file)
  115.     Marshal.dump($game_self_switches, file)
  116.     Marshal.dump($game_screen, file)
  117.     Marshal.dump($game_actors, file)
  118.     Marshal.dump($game_party, file)
  119.     Marshal.dump($game_troop, file)
  120.     Marshal.dump($game_map, file)
  121.     Marshal.dump($game_player, file)
  122. end
  123. end
  124. class Scene_File
  125.   alias carol3_main main
  126.   def main
  127.     carol3_main
  128.     if self.is_a?(Scene_Save)
  129.       @confirm_window.dispose
  130.       @yes_no_window.dispose
  131.     end
  132.   end
  133. end
  134. #==============================================================================
  135. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  136. #==============================================================================
复制代码


存档扩位
  1. # --------------------------------------------------------------------
  2. class Scene_File
  3.   #——最大存档数量,一般我认为最多50足够了,20比较合适
  4.   SAVEFILE_MAX = 100
  5.   # -------------------
  6.   def initialize(help_text)
  7.     @help_text = help_text
  8.   end
  9.   # -------------------
  10.   def main
  11.     ###设置背景图片###
  12.     @sprite = Sprite.new
  13.     @sprite.bitmap = RPG::Cache.picture("background")
  14.     #---------------------------------------------------
  15.     @help_window = Window_Help.new
  16.     ###帮助窗口透明度改为0###
  17.     @help_window.opacity = 0
  18.     @help_window.set_text(@help_text)
  19.     @savefile_windows = []
  20.     @cursor_displace = 0
  21.     for i in 0..3
  22.       @savefile_windows.push(Window_SaveFile.new(i, make_filename(i), i))
  23.     end
  24.     @file_index = 0
  25.     @savefile_windows[@file_index].selected = true
  26.     Graphics.transition
  27.     loop do
  28.       Graphics.update
  29.       Input.update
  30.       update
  31.       if $scene != self
  32.         break
  33.       end
  34.     end
  35.     Graphics.freeze
  36.     @help_window.dispose
  37.     for i in @savefile_windows
  38.       i.dispose
  39.     end
  40.     ###释放背景图片###
  41.     @sprite.dispose
  42.   end
  43.   # -------------------
  44.   def update
  45.     @help_window.update
  46.     for i in @savefile_windows
  47.       i.update
  48.     end
  49.     if Input.trigger?(Input::C)
  50.       on_decision(make_filename(@file_index))
  51.       $game_temp.last_file_index = @file_index
  52.       return
  53.     end
  54.     if Input.trigger?(Input::B)
  55.       #@sprite.dispose
  56.       on_cancel
  57.       return
  58.     end
  59.     if Input.repeat?(Input::DOWN)
  60.       if Input.trigger?(Input::DOWN) or @file_index < SAVEFILE_MAX - 1
  61.         if @file_index == SAVEFILE_MAX - 1
  62.           $game_system.se_play($data_system.buzzer_se)
  63.           return
  64.         end
  65.         @cursor_displace += 1
  66.         if @cursor_displace == 4
  67.           @cursor_displace = 3
  68.           for i in @savefile_windows
  69.             i.dispose
  70.           end
  71.           @savefile_windows = []
  72.           for i in 0..3
  73.             f = i - 2 + @file_index
  74.             name = make_filename(f)
  75.             @savefile_windows.push(Window_SaveFile.new(f, name, i))
  76.             @savefile_windows[i].selected = false
  77.           end
  78.         end
  79.         $game_system.se_play($data_system.cursor_se)
  80.         @file_index = (@file_index + 1)
  81.         if @file_index == SAVEFILE_MAX
  82.           @file_index = SAVEFILE_MAX - 1
  83.         end
  84.         for i in 0..3
  85.           @savefile_windows[i].selected = false
  86.         end
  87.         @savefile_windows[@cursor_displace].selected = true
  88.         return
  89.       end
  90.     end
  91.     if Input.repeat?(Input::UP)
  92.       if Input.trigger?(Input::UP) or @file_index > 0
  93.         if @file_index == 0
  94.           $game_system.se_play($data_system.buzzer_se)
  95.           return
  96.         end
  97.         @cursor_displace -= 1
  98.         if @cursor_displace == -1
  99.           @cursor_displace = 0
  100.           for i in @savefile_windows
  101.             i.dispose
  102.           end
  103.           @savefile_windows = []
  104.           for i in 0..3
  105.             f = i - 1 + @file_index
  106.             name = make_filename(f)
  107.             @savefile_windows.push(Window_SaveFile.new(f, name, i))
  108.             @savefile_windows[i].selected = false
  109.           end
  110.         end
  111.         $game_system.se_play($data_system.cursor_se)
  112.         @file_index = (@file_index - 1)
  113.         if @file_index == -1
  114.           @file_index = 0
  115.         end
  116.         for i in 0..3
  117.           @savefile_windows[i].selected = false
  118.         end
  119.         @savefile_windows[@cursor_displace].selected = true
  120.         return
  121.       end
  122.     end
  123.   end
  124.   # -------------------
  125.   def make_filename(file_index)
  126.     return "Save/Save#{file_index + 1}.rxdata"
  127.   end
  128.   # -------------------
  129. end




  130. class Window_SaveFile < Window_Base
  131.   # -------------------
  132.   def initialize(file_index, filename, position)
  133.     #--------------------------------------------------------------------------
  134.     # ###修改窗口Y值、高度、不透明度###
  135.     #---------------------------------------------------------------------------
  136.     y = 46 + position * 104
  137.     super(0, y, 640, 134)
  138.     self.opacity = 0
  139.     #--------------------------------------------------------------------------
  140.     self.contents = Bitmap.new(width - 32, height - 32)
  141.     @file_index = file_index
  142.     @filename = "Save/Save#{@file_index + 1}.rxdata"
  143.     @time_stamp = Time.at(0)
  144.     @file_exist = FileTest.exist?(@filename)
  145.     if @file_exist
  146.       file = File.open(@filename, "r")
  147.       @time_stamp = file.mtime
  148.       @mapname = Marshal.load(file)
  149.       @characters = Marshal.load(file)
  150.       @frame_count = Marshal.load(file)
  151.       @game_system = Marshal.load(file)
  152.       @game_switches = Marshal.load(file)
  153.       @game_variables = Marshal.load(file)
  154.       @total_sec = @frame_count / Graphics.frame_rate
  155.       file.close
  156.     end
  157.     refresh
  158.     @selected = false
  159.   end
  160. end


  161. #==============================================================================
复制代码


全键盘按键
  1. #==============================================================================
  2. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  3. #==============================================================================

  4. #============================================================================
  5. # ■ Keyboard Script
  6. #----------------------------------------------------------------------------
  7. #  By: Cybersam
  8. #   Date: 25/05/05
  9. #   Version 4
  10. #============================================================================
  11. # 66对此脚本使用方法的说明(可能不是很准确,反正大体能用):
  12. #
  13. # ★、Kboard.keyboard(键位)  返回是否按下这个键的判断。
  14. #     比如条件分歧:Kboard.keyboard($R_Key_H)
  15. #                   则当按下键盘H键的时候条件分歧成立
  16. #Kboard.press?
  17. # ★、Kboard.keyb(键位) == 1 当连续按住某键返回真,否则为false
  18. #     比如条件分歧:Kboard.keyb($R_Key_U) == 1
  19. #                   则当持续按下键盘U的时候条件分歧成立
  20. #
  21. # ★、Kboard.key(键位,1) 似乎可以做开关用。按下一次变为true,再按变false
  22. #============================================================================

  23. module Kboard
  24.   #==========================================================================
  25.   # 以下是全键盘按键列表
  26.   #--------------------------------------------------------------------------
  27.   $Rmouse_BUTTON_L = 0x01        # left mouse button
  28.   $Rmouse_BUTTON_R = 0x02        # right mouse button
  29.   $Rmouse_BUTTON_M = 0x04        # middle mouse button
  30.   $Rmouse_BUTTON_4 = 0x05        # 4th mouse button
  31.   $Rmouse_BUTTON_5 = 0x06        # 5th mouse button
  32.   #--------------------------------------------------------------------------
  33.   $R_Key_BACK      = 0x08        # BACKSPACE key
  34.   $R_Key_TAB       = 0x09        # TAB key
  35.   $R_Key_RETURN    = 0x0D        # ENTER key
  36.   $R_Key_SHIFT     = 0x10        # SHIFT key
  37.   $R_Key_CTLR      = 0x11        # CTLR key
  38.   $R_Key_ALT       = 0x12        # ALT key
  39.   $R_Key_PAUSE     = 0x13        # PAUSE key
  40.   $R_Key_CAPITAL   = 0x14        # CAPS LOCK key
  41.   $R_Key_ESCAPE    = 0x1B        # ESC key
  42.   $R_Key_SPACE     = 0x20        # SPACEBAR
  43.   $R_Key_PRIOR     = 0x21        # PAGE UP key
  44.   $R_Key_NEXT      = 0x22        # PAGE DOWN key
  45.   $R_Key_END       = 0x23        # END key
  46.   $R_Key_HOME      = 0x24        # HOME key
  47.   $R_Key_LEFT      = 0x25        # LEFT ARROW key
  48.   $R_Key_UP        = 0x26        # UP ARROW key
  49.   $R_Key_RIGHT     = 0x27        # RIGHT ARROW key
  50.   $R_Key_DOWN      = 0x28        # DOWN ARROW key
  51.   $R_Key_SELECT    = 0x29        # SELECT key
  52.   $R_Key_PRINT     = 0x2A        # PRINT key
  53.   $R_Key_SNAPSHOT  = 0x2C        # PRINT SCREEN key
  54.   $R_Key_INSERT    = 0x2D        # INS key
  55.   $R_Key_DELETE    = 0x2E        # DEL key
  56.   #--------------------------------------------------------------------------
  57.   $R_Key_0         = 0x30        # 0 key
  58.   $R_Key_1         = 0x31        # 1 key
  59.   $R_Key_2         = 0x32        # 2 key
  60.   $R_Key_3         = 0x33        # 3 key
  61.   $R_Key_4         = 0x34        # 4 key
  62.   $R_Key_5         = 0x35        # 5 key
  63.   $R_Key_6         = 0x36        # 6 key
  64.   $R_Key_7         = 0x37        # 7 key
  65.   $R_Key_8         = 0x38        # 8 key
  66.   $R_Key_9         = 0x39        # 9 key
  67.   #--------------------------------------------------------------------------
  68.   $R_Key_A         = 0x41        # A key
  69.   $R_Key_B         = 0x42        # B key
  70.   $R_Key_C         = 0x43        # C key
  71.   $R_Key_D         = 0x44        # D key
  72.   $R_Key_E         = 0x45        # E key
  73.   $R_Key_F         = 0x46        # F key
  74.   $R_Key_G         = 0x47        # G key
  75.   $R_Key_H         = 0x48        # H key
  76.   $R_Key_I         = 0x49        # I key
  77.   $R_Key_J         = 0x4A        # J key
  78.   $R_Key_K         = 0x4B        # K key
  79.   $R_Key_L         = 0x4C        # L key
  80.   $R_Key_M         = 0x4D        # M key
  81.   $R_Key_N         = 0x4E        # N key
  82.   $R_Key_O         = 0x4F        # O key
  83.   $R_Key_P         = 0x50        # P key
  84.   $R_Key_Q         = 0x51        # Q key
  85.   $R_Key_R         = 0x52        # R key
  86.   $R_Key_S         = 0x53        # S key
  87.   $R_Key_T         = 0x54        # T key
  88.   $R_Key_U         = 0x55        # U key
  89.   $R_Key_V         = 0x56        # V key
  90.   $R_Key_W         = 0x57        # W key
  91.   $R_Key_X         = 0x58        # X key
  92.   $R_Key_Y         = 0x59        # Y key
  93.   $R_Key_Z         = 0x5A        # Z key
  94.   #--------------------------------------------------------------------------
  95.   $R_Key_LWIN      = 0x5B        # Left Windows key (Microsoft Natural keyboard)
  96.   $R_Key_RWIN      = 0x5C        # Right Windows key (Natural keyboard)
  97.   $R_Key_APPS      = 0x5D        # Applications key (Natural keyboard)
  98.   #--------------------------------------------------------------------------
  99.   $R_Key_NUMPAD0   = 0x60        # Numeric keypad 0 key
  100.   $R_Key_NUMPAD1   = 0x61        # Numeric keypad 1 key
  101.   $R_Key_NUMPAD2   = 0x62        # Numeric keypad 2 key
  102.   $R_Key_NUMPAD3   = 0x63        # Numeric keypad 3 key
  103.   $R_Key_NUMPAD4   = 0x64        # Numeric keypad 4 key
  104.   $R_Key_NUMPAD5   = 0x65        # Numeric keypad 5 key
  105.   $R_Key_NUMPAD6   = 0x66        # Numeric keypad 6 key
  106.   $R_Key_NUMPAD7   = 0x67        # Numeric keypad 7 key
  107.   $R_Key_NUMPAD8   = 0x68        # Numeric keypad 8 key
  108.   $R_Key_NUMPAD9  = 0x69        # Numeric keypad 9 key
  109.   $R_Key_MULTIPLY  = 0x6A        # Multiply key (*)
  110.   $R_Key_ADD       = 0x6B        # Add key (+)
  111.   $R_Key_SEPARATOR = 0x6C        # Separator key
  112.   $R_Key_SUBTRACT  = 0x6D        # Subtract key (-)
  113.   $R_Key_DECIMAL   = 0x6E        # Decimal key
  114.   $R_Key_DIVIDE    = 0x6F        # Divide key (/)
  115.   #--------------------------------------------------------------------------
  116.   $R_Key_F1        = 0x70        # F1 key
  117.   $R_Key_F2        = 0x71        # F2 key
  118.   $R_Key_F3        = 0x72        # F3 key
  119.   $R_Key_F4        = 0x73        # F4 key
  120.   $R_Key_F5        = 0x74        # F5 key
  121.   $R_Key_F6        = 0x75        # F6 key
  122.   $R_Key_F7        = 0x76        # F7 key
  123.   $R_Key_F8        = 0x77        # F8 key
  124.   $R_Key_F9        = 0x78        # F9 key
  125.   $R_Key_F10       = 0x79        # F10 key
  126.   $R_Key_F11       = 0x7A        # F11 key
  127.   $R_Key_F12       = 0x7B        # F12 key
  128.   #--------------------------------------------------------------------------
  129.   $R_Key_NUMLOCK   = 0x90        # NUM LOCK key
  130.   $R_Key_SCROLL    = 0x91        # SCROLL LOCK key
  131.   #--------------------------------------------------------------------------
  132.   $R_Key_LSHIFT    = 0xA0        # Left SHIFT key
  133.   $R_Key_RSHIFT    = 0xA1        # Right SHIFT key
  134.   $R_Key_LCONTROL  = 0xA2        # Left CONTROL key
  135.   $R_Key_RCONTROL  = 0xA3        # Right CONTROL key
  136.   $R_Key_L_ALT    = 0xA4        # Left ALT key
  137.   $R_Key_R_ALT    = 0xA5        # Right ALT key
  138.   #--------------------------------------------------------------------------
  139.   $R_Key_SEP      = 0xBC        # , key
  140.   $R_Key_DASH      = 0xBD        # - key
  141.   $R_Key_DOTT      = 0xBE        # . Key
  142.   #--------------------------------------------------------------------------
  143.   GetKeyState = Win32API.new("user32","GetAsyncKeyState",['I'],'I')
  144.   GetKeyboardState = Win32API.new("user32","GetKeyState",['I'],'I')
  145.   GetSetKeyState = Win32API.new("user32","SetKeyboardState",['I'],'I')
  146.   #--------------------------------------------------------------------------
  147.   module_function
  148.   #--------------------------------------------------------------------------
  149.   def keyb(rkey)
  150.      if GetKeyState.call(rkey) != 0
  151.        return 1
  152.      end
  153.      return 0
  154.   end
  155.    #--------------------------------------------------------------------------
  156.   def keyboard(rkey)
  157.     GetKeyState.call(rkey) & 0x01 == 1  #
  158.   end
  159.   #--------------------------------------------------------------------------
  160.   def key(rkey, key = 0)
  161.     GetKeyboardState.call(rkey) & 0x01 == key #
  162.   end
  163. end





  164. #============================================================================
  165. # ■ 全键盘脚本(夏娜改,优化)
  166. #============================================================================
  167. #原来常用的全键盘脚本使用方法比较诡异,这里夏娜进行了修改。
  168. #本脚本没有给出键值,请在此处查询:[url]http://www.66rpg.com/htm/news7.htm[/url] 。
  169. #本教学95%以上作者用不上,除非制作ARPG或者默认按键不够用了。
  170. #============================================================================
  171. # 1、Kboard.press?(key) 同 Input.press?(key)
  172. # 2、Kboard.repeat?(key) 同 Input.repeat?(key)
  173. # 3、Kboard.trigger?(key) 同 Input.trigger?(key)
  174. #============================================================================




  175. module Kboard

  176. module_function

  177. @R_Key_Hash = {}
  178. @R_Key_Repeat = {}

  179. GetKeyState = Win32API.new("user32","GetAsyncKeyState",['I'],'I')

  180. def press?(rkey)
  181.    return if rkey.nil?


  182.    return GetKeyState.call(rkey) != 0
  183. end

  184. def 任意键?(rkey, lkey=0)
  185.    for i in 8..190
  186.      if !rkey.nil? and Kboard.press?(i) and i != rkey and !Kboard.press?(rkey) and i != lkey and !Kboard.press?(lkey)
  187.    return GetKeyState.call(i) != 0
  188.    break
  189.    end
  190.    end
  191.    return
  192. end

  193. def repeat?(rkey)
  194.    return if rkey.nil?


  195.    result = GetKeyState.call(rkey)
  196.    if result != 0
  197.      if @R_Key_Repeat[rkey].nil?
  198.        @R_Key_Repeat[rkey] = 0
  199.        return true
  200.      end
  201.      @R_Key_Repeat[rkey] += 1
  202.    else
  203.      @R_Key_Repeat[rkey] = nil
  204.      @R_Key_Hash[rkey] = 0
  205.    end
  206.    if !@R_Key_Repeat[rkey].nil? and @R_Key_Repeat[rkey] > 4 # 4乃准确数字
  207.      @R_Key_Repeat[rkey] = 0
  208.      return true
  209.    else
  210.      return false
  211.    end
  212. end

  213. def trigger?(rkey)
  214.    return if rkey.nil?

  215.    result = GetKeyState.call(rkey)
  216.    if @R_Key_Hash[rkey] == 1 and result != 0
  217.      return false
  218.    end
  219.    if result != 0
  220.      @R_Key_Hash[rkey] = 1
  221.      return true
  222.    else
  223.      @R_Key_Hash[rkey] = 0
  224.      return false
  225.    end
  226. end

  227. end


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


变量显示
  1. #==========================================================================
  2. # 本脚本来自[url]www.66rpg.com[/url],用于任何游戏请保留此信息。
  3. #==========================================================================
  4. VAR_SWITCH = 155          # 1号开关打开此脚本才工作,关闭则停止运算,并且透明
  5. VAR_REFRESH_SWITCH = 156  # 2号开关控制强制刷新,使用时机:1、把窗口由透明变为不透明(包括第一次使用时),2、游戏中用脚本更改了$var
  6. $var = []
  7. $var = []#所有需要显示在地图并且刷新的变量,可在游戏中用脚本更改。格式:[变量编号,x坐标,y坐标]
  8. #==============================================================================
  9. # ■ Window_XY
  10. #------------------------------------------------------------------------------
  11. #  显示坐标的窗口。
  12. #==============================================================================
  13. class Window_Var < Window_Base#注意前面那个window_var是文件名
  14.   #--------------------------------------------------------------------------
  15.   # ● 初始化窗口
  16.   #--------------------------------------------------------------------------
  17.   def initialize
  18.     super(-16, -16, 640+32, 480+32)#最后面那个数字是宽要显示多个需要改大,前面一个是长~
  19.     self.contents = Bitmap.new(width - 32, height - 32)
  20.     self.back_opacity = 255  # 这个是背景透明
  21.     self.opacity = 255       # 这个是边框和背景都透明
  22.     self.contents_opacity = 255       # 这个是内容透明
  23.     self.visible = false
  24.     self.z=9999
  25.     @var = $var
  26.     @var_a = []
  27.     for var_draw in $var
  28.       @var_a[var_draw[0]] = $game_variables[var_draw[0]]
  29.     end   
  30.     refresh
  31.   end

  32.   #--------------------------------------------------------------------------
  33.   # ● 刷新
  34.   #--------------------------------------------------------------------------
  35.   def refresh
  36.     if $game_switches[VAR_SWITCH]
  37.       @var = $var         # 记录现在变量数组结构
  38.       self.contents.clear # 清除以前的东西
  39.       for var_draw in @var
  40.         @var_a[var_draw[0]] = $game_variables[var_draw[0]] # 记录现在的游戏变量
  41.         self.contents.draw_text(var_draw[1],var_draw[2],640,32,@var_a[var_draw[0]].to_s)
  42.       end
  43.     end
  44.   end
  45.   #--------------------------------------------------------------------------
  46.   # ● 判断文字刷新。节约内存用
  47.   #--------------------------------------------------------------------------
  48.   def judge
  49.     for var_draw in $var
  50.       if @var_a[var_draw[0]] != $game_variables[var_draw[0]] #如果现在记录的变量和游戏变量不同,刷新
  51.         return true
  52.       end
  53.     end
  54.     if $game_switches[VAR_REFRESH_SWITCH]  # 强制刷新的时候,刷新
  55.       $game_switches[VAR_REFRESH_SWITCH] = false
  56.       return true
  57.     end
  58.     return false
  59.   end
  60. end

  61. class Scene_Map
  62.   alias var_66rpg_main main
  63.   def main
  64.     @var_window = Window_Var.new
  65.     @var_window.opacity = 0
  66.     var_66rpg_main
  67.     @var_window.dispose
  68.   end
  69.   #--------------------------------------------------------------------------
  70.   # ● 刷新画面
  71.   #--------------------------------------------------------------------------
  72.   alias var_66rpg_update update
  73.   def update
  74.     var_66rpg_update
  75.     if $game_switches[VAR_SWITCH]
  76.       @var_window.visible = true      
  77.       @var_window.refresh if @var_window.judge
  78.     else
  79.       @var_window.visible = false
  80.     end
  81.   end
  82. end
  83. #========================================================================
  84. # 本脚本来自[url]www.66rpg.com[/url],用于任何游戏请保留此信息。
  85. #========================================================================
复制代码


远景图移动
  1. # ▼▲▼ XRXS34. パノラマスクロール ▼▲▼
  2. # by ぷのくー
  3. #——————————————————————————————————————
  4. # 这是一个非常简单的脚本,只要自定义自动滚动的地图编号和绝对不滚动的地图编号
  5. # 即可实现对远景的操作。
  6. #——————————————————————————————————————
  7. #==============================================================================
  8. # 初始化的一些常量
  9. #==============================================================================
  10. class Game_Map

  11.   # 远景横向飘移速度速度
  12.   PANORAMA_SX = 18

  13.   # 远景纵向飘移速度速度
  14.   PANORAMA_SY = 0


  15.   # 自动滚动远景的地图编号(编号为292、293的地图远景会自动移动)
  16.   AUTO_SCROLL_PANORAMA_IDS = [53,54,56,57,58,59,60,61,62,63,64,65,66,67,68,69]
  17. end

  18. class Spriteset_Map

  19.   # 锁定远景的地图编号(编号为1的地图远景会锁定)
  20.   SCROLL_FREEZE_PANORAMA_IDS = [1]   

  21.   #——说明:如果自动滚动和锁定都包括了某张地图,则该地图不滚动。
  22.   #——如果自动滚动和锁定都没有包括某图,则还是会使用默认效果。
  23. end
  24. #==============================================================================
  25. # ■ Game_Map
  26. #==============================================================================
  27. class Game_Map
  28.   attr_accessor :panorama_sx           
  29.   attr_accessor :panorama_sy            
  30.   attr_reader   :panorama_ox               
  31.   attr_reader   :panorama_oy            
  32.   def setup(map_id)
  33.     @map_id = map_id
  34.     @map = load_data(sprintf("Data/Map%03d.rxdata", @map_id))
  35.     tileset = $data_tilesets[@map.tileset_id]
  36.     @tileset_name = tileset.tileset_name
  37.     @autotile_names = tileset.autotile_names
  38.     @panorama_name = tileset.panorama_name
  39.     @panorama_hue = tileset.panorama_hue
  40.     @fog_name = tileset.fog_name
  41.     @fog_hue = tileset.fog_hue
  42.     @fog_opacity = tileset.fog_opacity
  43.     @fog_blend_type = tileset.fog_blend_type
  44.     @fog_zoom = tileset.fog_zoom
  45.     @fog_sx = tileset.fog_sx
  46.     @fog_sy = tileset.fog_sy
  47.     # ===================================
  48.      if AUTO_SCROLL_PANORAMA_IDS.include?(map_id)
  49.        @panorama_sx = PANORAMA_SX
  50.        @panorama_sy = PANORAMA_SY
  51.      else  
  52.        @panorama_sx = 0
  53.        @panorama_sy = 0
  54.      end
  55.     # ===================================  
  56.     @battleback_name = tileset.battleback_name
  57.     @passages = tileset.passages
  58.     @priorities = tileset.priorities
  59.     @terrain_tags = tileset.terrain_tags
  60.     @display_x = 0
  61.     @display_y = 0
  62.     @need_refresh = false
  63.     @events = {}
  64.     for i in @map.events.keys
  65.       @events[i] = Game_Event.new(@map_id, @map.events[i])
  66.     end
  67.     @common_events = {}
  68.     for i in 1...$data_common_events.size
  69.       @common_events[i] = Game_CommonEvent.new(i)
  70.     end
  71.     @fog_ox = 0
  72.     @fog_oy = 0
  73.     @panorama_ox = 0
  74.     @panorama_oy = 0
  75.     @fog_tone = Tone.new(0, 0, 0, 0)
  76.     @fog_tone_target = Tone.new(0, 0, 0, 0)
  77.     @fog_tone_duration = 0
  78.     @fog_opacity_duration = 0
  79.     @fog_opacity_target = 0
  80.     @scroll_direction = 2
  81.     @scroll_rest = 0
  82.     @scroll_speed = 4
  83.   end
  84.   def update
  85.     if $game_map.need_refresh
  86.       refresh
  87.     end
  88.     if @scroll_rest > 0
  89.       distance = 2 ** @scroll_speed
  90.       case @scroll_direction
  91.       when 2  # 下
  92.         scroll_down(distance)
  93.       when 4  # 左
  94.         scroll_left(distance)
  95.       when 6  # 右
  96.         scroll_right(distance)
  97.       when 8  # 上
  98.         scroll_up(distance)
  99.       end
  100.       @scroll_rest -= distance
  101.     end
  102.     for event in @events.values
  103.       event.update
  104.     end
  105.     for common_event in @common_events.values
  106.       common_event.update
  107.     end
  108.     @fog_ox -= @fog_sx / 8.0
  109.     @fog_oy -= @fog_sy / 8.0
  110.     # ===================================
  111.     @panorama_ox -= @panorama_sx / 8.0
  112.     @panorama_oy -= @panorama_sy / 8.0
  113.     # ===================================
  114.     if @fog_tone_duration >= 1
  115.       d = @fog_tone_duration
  116.       target = @fog_tone_target
  117.       @fog_tone.red = (@fog_tone.red * (d - 1) + target.red) / d
  118.       @fog_tone.green = (@fog_tone.green * (d - 1) + target.green) / d
  119.       @fog_tone.blue = (@fog_tone.blue * (d - 1) + target.blue) / d
  120.       @fog_tone.gray = (@fog_tone.gray * (d - 1) + target.gray) / d
  121.       @fog_tone_duration -= 1
  122.     end
  123.     if @fog_opacity_duration >= 1
  124.       d = @fog_opacity_duration
  125.       @fog_opacity = (@fog_opacity * (d - 1) + @fog_opacity_target) / d
  126.       @fog_opacity_duration -= 1
  127.     end
  128.   end
  129. end
  130. #==============================================================================
  131. # ■ Spriteset_Map
  132. #==============================================================================
  133. class Spriteset_Map
  134.   def update
  135.     if @panorama_name != $game_map.panorama_name or
  136.        @panorama_hue != $game_map.panorama_hue
  137.       @panorama_name = $game_map.panorama_name
  138.       @panorama_hue = $game_map.panorama_hue
  139.       if @panorama.bitmap != nil
  140.         @panorama.bitmap.dispose
  141.         @panorama.bitmap = nil
  142.       end
  143.       if @panorama_name != ""
  144.         @panorama.bitmap = RPG::Cache.panorama(@panorama_name, @panorama_hue)
  145.       end
  146.       Graphics.frame_reset
  147.     end
  148.     if @fog_name != $game_map.fog_name or @fog_hue != $game_map.fog_hue
  149.       @fog_name = $game_map.fog_name
  150.       @fog_hue = $game_map.fog_hue
  151.       if @fog.bitmap != nil
  152.         @fog.bitmap.dispose
  153.         @fog.bitmap = nil
  154.       end
  155.       if @fog_name != ""
  156.         @fog.bitmap = RPG::Cache.fog(@fog_name, @fog_hue)
  157.       end
  158.       Graphics.frame_reset
  159.     end
  160.     @tilemap.ox = $game_map.display_x / 4
  161.     @tilemap.oy = $game_map.display_y / 4
  162.     @tilemap.update
  163.     # ===================================
  164.     if SCROLL_FREEZE_PANORAMA_IDS.include?($game_map.map_id)
  165.      @panorama.ox = 0
  166.      @panorama.oy = 0
  167.     else  
  168.       @panorama.ox = $game_map.display_x / 8 +$game_map.panorama_ox
  169.       @panorama.oy = $game_map.display_y / 8 +$game_map.panorama_oy
  170.     end
  171.   # ===================================
  172.     @fog.zoom_x = $game_map.fog_zoom / 100.0
  173.     @fog.zoom_y = $game_map.fog_zoom / 100.0
  174.     @fog.opacity = $game_map.fog_opacity
  175.     @fog.blend_type = $game_map.fog_blend_type
  176.     @fog.ox = $game_map.display_x / 4 + $game_map.fog_ox
  177.     @fog.oy = $game_map.display_y / 4 + $game_map.fog_oy
  178.     @fog.tone = $game_map.fog_tone
  179.     for sprite in @character_sprites
  180.       sprite.update
  181.     end
  182.     @weather.type = $game_screen.weather_type
  183.     @weather.max = $game_screen.weather_max
  184.     @weather.ox = $game_map.display_x / 4
  185.     @weather.oy = $game_map.display_y / 4
  186.     @weather.update
  187.     for sprite in @picture_sprites
  188.       sprite.update
  189.     end
  190.     @timer_sprite.update
  191.     @viewport1.tone = $game_screen.tone
  192.     @viewport1.ox = $game_screen.shake
  193.     @viewport3.color = $game_screen.flash_color
  194.     @viewport1.update
  195.     @viewport3.update
  196.   end
  197. end
复制代码

【四季】已上架steam!欢迎大家来玩!

老鹰

梦石
40
星屑
38044
在线时间
7127 小时
注册时间
2012-5-26
回帖
3306

极短24评委极短23参与极短22参与极短21评委老司机慢点开短篇十吟唱者组别冠军开拓者剧作品鉴家

发表于 2018-12-10 11:05:41 | 显示全部楼层
来自6R的如果没有说明应该都是可以的吧(我记得)
第一个是改自fuki对话框,我觉得不行

点评

好的!谢谢!  发表于 2018-12-10 17:09
等等,我重新查了下,似乎有很多个fuki种类的hhhh,你的这个的原地址早就失联了,而且看起来是自由使用的  发表于 2018-12-10 16:58
emmm...我原以为fuki可以的...因为看到四块二茶会的沉睡的法则也是这种对话框...  发表于 2018-12-10 11:48
回复

使用道具 举报

梦石
0
星屑
35258
在线时间
4171 小时
注册时间
2007-12-15
回帖
9490
发表于 2018-12-11 09:06:13 | 显示全部楼层
本帖最后由 89444640 于 2018-12-11 09:07 编辑

存档扩展那个,我以前用过,如果你20以下没关系,我记得好像这个我就是扩展到100个了,翻页时候掉帧太厉害,卡的要死。
如果有需要的话可以看看
■ 存档位真·无限扩展 v2.1 by SailCat
我这边改过了……你得找原始版本的
猫大的这个存档扩展,不卡而且真无限存档,对于游戏时间很长的,便于自己测试用。

点评

请问下脚本作者,sailcat  发表于 2018-12-12 05:45
好的谢谢~顺便问下可以商业用吧?  发表于 2018-12-11 09:21
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部