查看: 4503|回复: 0

[已经过期] 【求助】添加状态信息

[复制链接]
梦石
0
星屑
263
在线时间
10 小时
注册时间
2013-1-21
回帖
1
发表于 2013-1-31 20:52:43 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 du359107393 于 2013-1-31 20:54 编辑

发现一个一个3D环状菜单     想做成如下图中添加队员状态
QQ截图20130131203514.jpg

我现在的状况是
QQ截图20130131203943.jpg

我是个新手对脚本高的不怎么明白
搞了一下午也没半点眉目在下面脚本里 添加过 出错了就删了
  1.       def create_status_window
  2.     @status_window = Window_MenuStatus.new(@command_window.width, 0)
  3.   end
复制代码
请大神指点
  1. #=============================================================================
  2. # 环形菜单(仿3D)1.1
  3. #-----------------------------------------------------------------------------
  4. # 作者: Gab (2012.12.18)
  5. #
  6. #=============================================================================
  7. # 修改:褐衣
  8. #------------------------
  9. # 2012.12.20  [1.0] 版修改说明:
  10. # 1.修正了在整队画面选中一个角色后不能撤销的问题。
  11. # 2.将MenuWindow类移出
  12. # 3.取消了背景音乐(因为不能完全控制它)
  13. # 4.添加中文注释
  14. # 5.依照公式 x=h+a*cos(t),y=k+b*sin(t)修改了安置图标的方法。
  15. # 5.重命名了一些变量明
  16. # 6.从道具、技能、状态画面返回时,留在对应的图标处,而不是回到物品图标。
  17. #   ----------------------
  18. # 2012.12.23  [1.1] 版修改说明
  19. # 1.加入自定义菜单图标功能。使用时须将图片保存在Graphics\Pictures目录里。
  20. #   图片尺寸不宜过大,建议使用32*32像素左右的尺寸,并根据图片的大小适当
  21. #   调整椭圆的半长轴(SMAA)和半短轴(SMIA)。
  22. #   此功能默认状态为不开启。使用此功能请讲 USECUSTOMICONS 设置为 true ,并
  23. #   将对应的自定义图片名称写进 CUSTOMICONS 数组中。
  24. # 2.修改了标题的显示以及调整显示位置的公式。(为了配合自定义图标的使用)
  25. # 3. 1.1 版可以取代 1.0 版使用。
  26. # <span style="background-color: rgb(255, 255, 255);">4. 清理多余代码 (2012.12.26)</span>
  27. # 以上修改皆针对脚本功能的实用性,以及脚本自身的可读性。
  28. #=============================================================================

  29. $imported = {} if $imported.nil?
  30. $imported["Gab_Ellipse_Menu"] = true

  31. #=============================================================================
  32. # * 设定
  33. #=============================================================================
  34. module Gab
  35.   module Ellipse_Menu
  36.    
  37.     USECUSTOMICONS = false # 要使用自定义图标,请改为 true ,并修改下面的CUSTOMICONS
  38.   
  39.     # Graphics\Pictures目录中的自定义图标的名称 (Name of custom icons in Graphics\Pictures folder.)
  40.     # 依照次序,在引号中填写自定义图标的名称
  41.    
  42.     CUSTOMICONS = [
  43.       "Items Icon",     # Items 道具
  44.       "Skills Icon",    # Skills 技能
  45.       "Equipment Icon", # Equipment 装备
  46.       "Status Icon",    # Status 状态
  47.       "Formation Icon", # formation 队列
  48.       "Save Icon",      # Save 记录
  49.       "Game End Icon"   # Game End 退出游戏
  50.     ]

  51.     # 从IconSet.png中的选择要用的图标的序号 (ID of icons)
  52.     ICONS = [
  53.       192, # Items 道具
  54.       112, # Skills 技能
  55.       169, # Equipment 装备
  56.        14, # Status 状态
  57.        12, # formation 队列
  58.       117, # Save 记录
  59.       121  # Game End 退出游戏
  60.     ]
  61.    
  62.     # 菜单字体 (Menu font)
  63.           USENEWFONT = false            # 如果要使用新字体,改为true ,并给FNAME指定字体名称
  64.     FNAME  = ""                   # 通过在引号中填写字体名称,来指定菜单所用的字体。(Name of font. )
  65.     FSIZE  = 19                   # 字体大小 (font size)
  66.     FCOLOR = [255, 255, 255, 200] # 字体颜色,格式 R(red)红,G(green)绿,B(blue)蓝,A(alpha)可见度 (color of the font(R,G,B,A).)
  67.    
  68.     # 椭圆形菜单的轴长 (axises of the ellipse menu)
  69.     SMAA = 90 # 半长轴 (semi-major axis)  
  70.     SMIA = 25 # 半短轴 (semi-minor axis),半长轴必须长于半短轴。  It is necessary that SMAA > SMIA.
  71.    
  72.     # 图标移动精细度,数值越大越精细,但速度也越慢 (Frequency of the icons movement. The bigger,the slower)
  73.     # 建议数值:(Suggested values:)
  74.     #  1 = 简略 (snapshot)
  75.     #  5 = 快速 (fast)
  76.     # 10 = 中速 (median)
  77.     # 20 = 慢速 (slow)
  78.     MV = 10
  79.    
  80.     # 角色移动频率,数值越大越精细,但速度也越慢 (Frequency of the characters movement. The bigger,the slower)
  81.     CFREQ = 15
  82.    
  83.     # 用来显示地图名称,游戏时间,和金钱数量的额外的窗口的参数设置。additional windows
  84.     Windows = {
  85.       mapName: [ # 地图名称       Map Name
  86.         true,    # 是否显示       display?
  87.            0,    # 窗口的X轴坐标  Position X
  88.            0,    # 窗口的Y轴坐标  Position Y
  89.          400,    # 窗口宽度       width
  90.          231,    # 显示图标的ID   icon id
  91.            0,    # 窗口的透明度   Opacity
  92.       ],
  93.      
  94.       time: [    # 游戏时间       Game time
  95.         true,    # 是否显示       display?
  96.            0,    # 窗口的X轴坐标  Position X
  97.           34,    # 窗口的Y轴坐标  Position Y
  98.          160,    # 窗口宽度       width
  99.          280,    # 显示图标的ID   icon id
  100.            0,    # 窗口的透明度   Opacity
  101.       ],
  102.      
  103.       gold: [    # 金钱           Money
  104.         true,    # 是否显示       display?
  105.            0,    # 窗口的X轴坐标  Position X
  106.           68,    # 窗口的Y轴坐标  Position Y
  107.          160,    # 窗口宽度       width
  108.          361,    # 显示图标的ID   icon id
  109.            0,    # 窗口的透明度   Opacity
  110.       ]
  111.     }
  112.    
  113.   end
  114. end    # 设置结束  (End of the configuration)

  115.   #--------------------------------------------------------------------------
  116.   # ** 窗口菜单的基类 (Basis of the menu window)
  117.   #--------------------------------------------------------------------------
  118.   class MenuWindow < Window_Base
  119.     def initialize(x, y, width, icon, opacity)
  120.       super(x, y, width, fitting_height(1))
  121.       @icon  = icon
  122.       self.opacity = opacity
  123.       self.contents.font.name    = Gab::Ellipse_Menu::FNAME if Gab::Ellipse_Menu::USENEWFONT
  124.       self.contents.font.size    = Gab::Ellipse_Menu::FSIZE
  125.       self.contents.font.color   = Color.new(*Gab::Ellipse_Menu::FCOLOR)
  126.       self.contents.font.outline = false
  127.       self.contents.font.shadow  = true
  128.      
  129.       draw_icon(@icon, 0, 0)
  130.       @clear_rect = Rect.new(30, 0, contents.width - 31, contents.height)
  131.      
  132.       refresh
  133.     end
  134.    
  135.     def refresh
  136.       self.contents.clear_rect(@clear_rect)
  137.       text_size = self.contents.width - 32
  138.       self.contents.draw_text(30, 0, text_size, self.contents.height, text, align)
  139.     end
  140.    
  141.     def align
  142.       return 0
  143.     end
  144.    
  145.     def update
  146.       super
  147.       refresh if (Graphics.frame_count % Graphics.frame_rate) == 0
  148.     end
  149.    
  150.     def text
  151.       return ""
  152.     end
  153.   end

  154.   #--------------------------------------------------------------------------
  155.   # ** 地图名称窗口 (Map name window)
  156.   #--------------------------------------------------------------------------
  157.   class MenuWindowMapName < MenuWindow
  158.     def text
  159.       $game_map.display_name
  160.     end
  161.    
  162.     def align
  163.       return 0
  164.     end
  165.   end

  166.   #--------------------------------------------------------------------------
  167.   # ** 游戏时间窗口 (Game time window)
  168.   #--------------------------------------------------------------------------
  169.   class MenuWindowTime < MenuWindow
  170.     def text
  171.       total_sec = Graphics.frame_count / Graphics.frame_rate
  172.       hour = total_sec / 60 / 60
  173.       min  = total_sec / 60 % 60
  174.       sec  = total_sec % 60
  175.       sprintf("%03d:%02d:%02d", hour, min, sec)
  176.     end
  177.   end

  178.   #--------------------------------------------------------------------------
  179.   # ** 金钱窗口  (Money window)
  180.   #--------------------------------------------------------------------------
  181.   class MenuWindowGold < MenuWindow
  182.     def text
  183.       $game_party.gold.to_s
  184.     end
  185.   end


  186. #=============================================================================
  187. # * 重定义Scene_Menu类 (rewrite Scene_Menu class)
  188. #=============================================================================
  189. class Scene_Menu < Scene_MenuBase
  190.   @@iconIndex     = 0    #图标索引
  191.   @@addIcons      = 0    #图标移动量
  192.   #--------------------------------------------------------------------------
  193.   # * 定义开始运行方法 (Redefine start method)
  194.   #--------------------------------------------------------------------------
  195.   def start
  196.     super
  197.    # 术语表,其顺序与 ICONS 相对应
  198.     @vocabulary = [     
  199.       Vocab::item,
  200.       Vocab::skill,
  201.       Vocab::equip,
  202.       Vocab::status,
  203.       Vocab::formation,
  204.       Vocab::save,
  205.       Vocab::game_end
  206.     ]
  207.    
  208.     @actorsNames = $game_party.members.map{|actor| actor.name}
  209.    
  210.     create_background
  211.    
  212.     [url=home.php?mod=space&uid=114926]@sprite[/url]     = Sprite_Character.new(@main_viewport, $game_player)
  213.     @actorIndex = 0
  214.     @stage      = 0
  215.     @pattern    = 1
  216.     @actor1     = nil
  217.    
  218.     precaculate
  219.    
  220.     if  Gab::Ellipse_Menu::USECUSTOMICONS
  221.       create_custom_icons
  222.     else
  223.       create_icons
  224.     end
  225.       
  226.     create_caption
  227.     create_actor_selection
  228.     create_windows
  229.   end
  230.   #--------------------------------------------------------------------------
  231.   # * 退出菜单时的处理 (Termination of the process)
  232.   #--------------------------------------------------------------------------
  233.   def terminate
  234.     super
  235.     @icons.each(&:dispose)
  236.     @actors.each(&:dispose)
  237.     @windows.each(&:dispose)
  238.     @sprite.dispose
  239.     @caption.dispose
  240.     Input.update
  241.     $game_map.autoplay
  242.   end

  243.   #--------------------------------------------------------------------------
  244.   # * 预演算(Precaculate)
  245.   #--------------------------------------------------------------------------
  246.   def precaculate
  247.    
  248.     @iconElRa        = 2 * Math::PI / Gab::Ellipse_Menu::ICONS.size      # icon ellpise radian     
  249.     @iconBasePoint = @sprite.y + Gab::Ellipse_Menu::SMIA * (Math.sin(-@iconElRa) - 0.5)
  250.     @iconMaxDis    = @sprite.y + Gab::Ellipse_Menu::SMIA * Math.sin(@iconElRa) - @iconBasePoint #前排图标与背景图标的Y轴距离
  251.     @iconMoveRadian = @iconElRa / Gab::Ellipse_Menu::MV         # 图标旋转时,每次所移动弧度
  252.    
  253.     @actorElRa        = 2 * Math::PI / $game_party.members.size           # actor ellpise radian
  254.     @basePointActors = @sprite.y + (Gab::Ellipse_Menu::SMIA + 24) * Math.sin(-@iconElRa)
  255.     @actorMaxDis    = @sprite.y + (Gab::Ellipse_Menu::SMIA + 24) * Math.sin(@actorElRa) - @basePointActors
  256.     @moveTimesActors = @actorElRa / Gab::Ellipse_Menu::MV
  257.     @addActors       = 0
  258.    
  259.   end
  260.   
  261.   #--------------------------------------------------------------------------
  262.   # * 用自定义图片生成图标 (Creat icons)
  263.   #--------------------------------------------------------------------------
  264.   def create_custom_icons
  265.     @icons  = []
  266.    
  267.     Gab::Ellipse_Menu::CUSTOMICONS.each_with_index {|icon_name, index|

  268.     sprite          = Sprite.new
  269.     sprite.bitmap   = Cache.picture(icon_name)
  270.     rect = Rect.new(0, 0, sprite.width, sprite.height)
  271.     sprite.ox       = sprite.width / 2
  272.     sprite.oy       = sprite.height / 2
  273.      
  274.     @icons << sprite
  275.     }
  276.    
  277.     @icons[5].tone = Tone.new(0, 0, 0, 255) if $game_system.save_disabled
  278.    
  279.     adjust_icons
  280.    
  281.   end
  282.   
  283.   #--------------------------------------------------------------------------
  284.   # * 从Iconset.png生成图标 (Creat icons)
  285.   #--------------------------------------------------------------------------
  286.   def create_icons
  287.     iconset = Cache.system("Iconset")
  288.     @icons  = []
  289.    
  290.     Gab::Ellipse_Menu::ICONS.each_with_index {|icon_index, index|
  291.     sprite          = Sprite.new
  292.     sprite.bitmap   = iconset
  293.     sprite.src_rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
  294.     sprite.ox       = sprite.width / 2
  295.     sprite.oy       = sprite.height / 2
  296.      
  297.     @icons << sprite
  298.     }
  299.    
  300.     @icons[5].tone = Tone.new(0, 0, 0, 255) if $game_system.save_disabled
  301.    
  302.     adjust_icons
  303.    
  304.   end
  305.   #--------------------------------------------------------------------------
  306.   # * 显示标题 (Create caption)
  307.   #--------------------------------------------------------------------------
  308.   def create_caption
  309.     base, c = Bitmap.new(1, 1), nil
  310.     base.font.name  = Gab::Ellipse_Menu::FNAME if Gab::Ellipse_Menu::USENEWFONT
  311.     base.font.size  = Gab::Ellipse_Menu::FSIZE
  312.     base.font.color = Color.new(*Gab::Ellipse_Menu::FCOLOR)
  313.    
  314.     maxLen = (@vocabulary + @actorsNames).inject(0){|a, b|
  315.       c = base.text_size(b)
  316.       c.width > a ? c.width : a
  317.     }
  318.    
  319.     @caption = Sprite.new
  320.     @caption.bitmap = Bitmap.new(maxLen + 5, c.height)
  321.     @caption.bitmap.font.name  = Gab::Ellipse_Menu::FNAME  if Gab::Ellipse_Menu::USENEWFONT
  322.     @caption.bitmap.font.size  = Gab::Ellipse_Menu::FSIZE
  323.     @caption.bitmap.font.color = Color.new(*Gab::Ellipse_Menu::FCOLOR)
  324.     @caption.ox = @caption.width  / 2
  325.     @caption.oy = @caption.height / 2
  326.     @caption.x  = @icons[@@iconIndex].x
  327.     @caption.y  = @icons[@@iconIndex].y  + @icons[@@iconIndex].height / 2 + 10  ###########
  328.    
  329.     base.dispose
  330.    
  331.     caption_refresh
  332.   end
  333.   #--------------------------------------------------------------------------
  334.   # * 建立角色选择画面 (Create actor selection scene)
  335.   #--------------------------------------------------------------------------
  336.   def create_actor_selection
  337.     @actors = $game_party.members.map{|char|
  338.       actor = Sprite.new
  339.       actor.bitmap = Cache.character(char.character_name)
  340.       sign = char.character_name[/^[\!\$]./]
  341.       if sign && sign.include?(''

  342. )
  343.         cw = actor.bitmap.width / 3
  344.         ch = actor.bitmap.height / 4
  345.       else
  346.         cw = actor.bitmap.width / 12
  347.         ch = actor.bitmap.height / 8
  348.       end
  349.      
  350.       actor.ox = cw / 2
  351.       actor.oy = ch
  352.      
  353.       actor.x = @sprite.x + 1.5 * Gab::Ellipse_Menu::SMAA
  354.       actor.instance_variable_set(:@charData, [char, cw, ch])
  355.      
  356.       actor
  357.     }
  358.    
  359.     adjust_actors
  360.     update_actors_src
  361.   end
  362.   
  363.   
  364.   
  365.   #--------------------------------------------------------------------------
  366.   # * 建立地图名称、游戏时间、金钱窗口 (Create map_name window,game_time window and Gold window)
  367.   #--------------------------------------------------------------------------
  368.   def create_windows
  369.     windows = Gab::Ellipse_Menu::Windows
  370.     @windows = []
  371.    
  372.     @windows << MenuWindowMapName.new(*windows[:mapName][1,5]) if windows[:mapName][0]
  373.     @windows << MenuWindowTime.new(*windows[:time][1,5])       if windows[:time][0]
  374.     @windows << MenuWindowGold.new(*windows[:gold][1,5])       if windows[:gold][0]
  375.   end
  376.   #--------------------------------------------------------------------------
  377.   # * 调节图标的位置并调整图标的可见度和缩放比例(position icons and adjust opacity and zoom of the icons)
  378.   #--------------------------------------------------------------------------
  379.   def adjust_icons
  380.     t = 90/57.3 + @@addIcons
  381.    
  382.     @icons.each{|sprite|
  383.             
  384.           sprite.x =@sprite.x + Gab::Ellipse_Menu::SMAA * Math.cos(t)
  385.           sprite.y =@sprite.y + Gab::Ellipse_Menu::SMIA * (Math.sin(t) - 0.5)

  386.     t += @iconElRa

  387.     dif            = (sprite.y - @iconBasePoint) / @iconMaxDis
  388.     sprite.opacity = @stage == 0 ? 127 + 255 * dif : 0
  389.     sprite.zoom_x  = sprite.zoom_y = [0.55 + dif, 1].min
  390.    
  391.     }

  392.   end
  393.   #--------------------------------------------------------------------------
  394.   # * 调节角色图标的位置并调整图标的可见度和缩放比例(position actors and adjust opacity and zoom of the actors)
  395.   #--------------------------------------------------------------------------
  396.   def adjust_actors
  397.           t = 90/57.3 + @addActors
  398.    
  399.     @actors.each{|sprite|
  400.       sprite.x       = @sprite.x + (Gab::Ellipse_Menu::SMAA + 24) * Math.cos(t)
  401.       sprite.y       = @sprite.y + (Gab::Ellipse_Menu::SMIA + 26) * Math.sin(t)
  402.       dif            = (sprite.y - @basePointActors) / (@actorMaxDis+26)
  403.       sprite.opacity = @stage != 0 ? 127 + 255 * dif : 0
  404.       sprite.zoom_x  = sprite.zoom_y = [0.6 + dif, 1].min
  405.             t += @actorElRa
  406.     }
  407.   end
  408.   #--------------------------------------------------------------------------
  409.   # * 旋转图标 (Movement of icons)
  410.   #--------------------------------------------------------------------------
  411.   def rotateIcons(dir)
  412.     @iconMoveRadian *= -1 if dir == :right
  413.    
  414.     Sound.play_cursor
  415.    
  416.     Gab::Ellipse_Menu::MV.times{|sprite|
  417.       @@addIcons += @iconMoveRadian
  418.       @@addIcons %= Math::PI * 2
  419.       adjust_icons
  420.       Graphics.update
  421.     }
  422.    
  423.     if dir == :right
  424.       @iconMoveRadian *= -1
  425.       @@iconIndex += 1
  426.     else
  427.       @@iconIndex -= 1
  428.     end
  429.     @@iconIndex %= @icons.size
  430.    
  431.     caption_refresh
  432.   end
  433.   #--------------------------------------------------------------------------
  434.   # * 旋转角色图标 (Movement of actors)
  435.   #--------------------------------------------------------------------------
  436.   def rotateActors(dir)
  437.     @moveTimesActors *= -1 if dir == :right
  438.    
  439.     Sound.play_cursor
  440.    
  441.     Gab::Ellipse_Menu::MV.times{|sprite|
  442.       @addActors += @moveTimesActors
  443.       @addActors %= Math::PI * 2
  444.       adjust_actors
  445.       Graphics.update
  446.     }
  447.    
  448.     if dir == :right
  449.       @moveTimesActors *= -1
  450.       @actorIndex += 1
  451.     else
  452.       @actorIndex -= 1
  453.     end
  454.     @actorIndex %= @actors.size
  455.    
  456.     caption_refresh
  457.   end
  458.   #--------------------------------------------------------------------------
  459.   # * 更新标题 (Update caption)
  460.   #--------------------------------------------------------------------------
  461.   def caption_refresh
  462.     @caption.bitmap.clear
  463.     text = @stage == 0 ? @vocabulary[@@iconIndex] : @actorsNames[@actorIndex]
  464.     @caption.bitmap.draw_text(@caption.bitmap.rect, text, 1)
  465.     @caption.update
  466.   end
  467.   #--------------------------------------------------------------------------
  468.   # * 初级更新(Update base)
  469.   #--------------------------------------------------------------------------
  470.   def update
  471.     super
  472.    
  473.     @windows.each(&:update)
  474.    
  475.     case @stage
  476.     when 0
  477.       update_main_input
  478.     when 1, 2
  479.       @stage == 1 ? update_actors_input : update_formation_input

  480.       if (Graphics.frame_count % Gab::Ellipse_Menu::CFREQ) == 0
  481.         @pattern = (@pattern + 1) % 3
  482.       end
  483.       update_actors_src
  484.     end
  485.   end
  486.   #--------------------------------------------------------------------------
  487.   # * 更新初级指令输入 (Update standard input)
  488.   #--------------------------------------------------------------------------
  489.   def update_main_input
  490.     if Input.repeat?(:LEFT)
  491.       rotateIcons(:left)
  492.     elsif Input.repeat?(:RIGHT)
  493.       rotateIcons(:right)
  494.     elsif Input.trigger?(:B)
  495.       Sound.play_cancel
  496.       process_return
  497.     elsif Input.trigger?(:C)
  498.       process_confirm
  499.     end
  500.   end
  501.   #--------------------------------------------------------------------------
  502.   # * 更新角色选择画面的输入 (Update input in the actor selection scene)
  503.   #--------------------------------------------------------------------------
  504.   def update_actors_input
  505.     if Input.repeat?(:LEFT)
  506.       rotateActors(:left)
  507.     elsif Input.repeat?(:RIGHT)
  508.       rotateActors(:right)
  509.     elsif Input.trigger?(:B)
  510.       Sound.play_cancel
  511.       process_return
  512.     elsif Input.trigger?(:C)
  513.       Sound.play_ok
  514.       process_special_confirm
  515.     end
  516.   end

  517.   #--------------------------------------------------------------------------
  518.   # * 更新队列变换(Update formation exchanging )
  519.   #--------------------------------------------------------------------------
  520.   def update_formation_input
  521.     if Input.repeat?(:LEFT)
  522.       rotateActors(:left)
  523.     elsif Input.repeat?(:RIGHT)
  524.       rotateActors(:right)
  525.     elsif Input.trigger?(:B)
  526.       Sound.play_cancel
  527.       process_return
  528.     elsif Input.trigger?(:C)
  529.       process_formation_confirm
  530.     end
  531.   end
  532.   #--------------------------------------------------------------------------
  533.   # * 处理玩家输入的“确定”指令 (Process confirm)
  534.   #--------------------------------------------------------------------------
  535.   def process_confirm
  536.     case @@iconIndex
  537.     when 0 # Item 物品
  538.       Sound.play_ok
  539.       SceneManager.call(Scene_Item)
  540.     when 1, 2, 3, 4 # Skill 技能, Equip 装备, Status 状态, Formation 整队
  541.       Sound.play_ok
  542.       @stage = @@iconIndex == 4 ? 2 : 1
  543.       adjust_actors
  544.       adjust_icons
  545.       caption_refresh
  546.       @caption.y -= @icons[@@iconIndex].height / 2 + 14
  547.     when 5 # Save 保存
  548.       if ($game_system.save_disabled)
  549.         Sound.play_buzzer
  550.       else
  551.         SceneManager.call(Scene_Save)
  552.         Sound.play_ok
  553.       end
  554.     when 6 # Game End 退出游戏
  555.       Sound.play_ok
  556.       SceneManager.call(Scene_End)
  557.     end
  558.   end
  559.   #--------------------------------------------------------------------------
  560.   # * 处理针对某一被选定的角色的技能、装备或状态窗口的请求(Processes the required confirmation of the specific actor)
  561.   #--------------------------------------------------------------------------
  562.   def process_special_confirm
  563.     $game_party.menu_actor = $game_party.members[@actorIndex]
  564.    
  565.     case @@iconIndex
  566.     when 1 # Skill
  567.       SceneManager.call(Scene_Skill)
  568.     when 2 # Equip
  569.       SceneManager.call(Scene_Equip)
  570.     when 3 # Status
  571.       SceneManager.call(Scene_Status)     
  572.     end
  573.   end
  574.   #--------------------------------------------------------------------------
  575.   # * 处理玩家在整队画面输入的“确定”指令 (Processes formation switching confirmation )
  576.   #--------------------------------------------------------------------------
  577.   def process_formation_confirm
  578.     if @actor1.nil?
  579.       @actor1 = @actorIndex
  580.       @actors[@actor1].tone = Tone.new(150, 150, 150, 0)
  581.       Sound.play_ok
  582.       return
  583.     end
  584.     if @actor1 == @actorIndex
  585.       return Sound.play_buzzer   
  586.     else   
  587.       Sound.play_ok
  588.      
  589.       $game_party.swap_order(@actor1,@actorIndex)
  590.       @actorsNames = $game_party.members.map{|actor| actor.name}
  591.       
  592.       @stage      = 0
  593.       
  594.       @actors.each {|sprite| sprite.bitmap.dispose }
  595.       @actors.each(&:dispose)
  596.       
  597.       @sprite.dispose
  598.       @sprite     = Sprite_Character.new(@main_viewport, $game_player)
  599.       
  600.       @addActors = 0
  601.       @actorIndex = 0

  602.       create_actor_selection
  603.      
  604.       @actors[@actor1].tone = Tone.new(0, 0, 0, 0)
  605.       
  606.       @actor1     = nil

  607.       adjust_icons   
  608.       caption_refresh
  609.       @caption.y += @icons[@@iconIndex].height / 2 + 14

  610.     end
  611.   end
  612.   #--------------------------------------------------------------------------
  613.   # * 处理玩家的输入的“返回”指令 (Process return)
  614.   #--------------------------------------------------------------------------
  615.   def process_return
  616.     case @stage
  617.     when 0
  618.           @@iconIndex = 0
  619.       @@addIcons = 0
  620.       return_scene
  621.     when 1,2
  622.       case @@iconIndex
  623.       when 1, 2, 3
  624.         @stage = 0
  625.         adjust_actors
  626.         adjust_icons
  627.         caption_refresh
  628.         @caption.y += @icons[@@iconIndex].height / 2 + 14
  629.       when 4
  630.         if !@actor1.nil?
  631.           @actors[@actor1].tone = Tone.new(0, 0, 0, 0)
  632.           return @actor1 = nil
  633.         end
  634.      
  635.         @stage = 0
  636.         adjust_actors
  637.         adjust_icons
  638.         caption_refresh
  639.         @caption.y += @icons[@@iconIndex].height / 2  + 14
  640.       end
  641.     end
  642.   end
  643.   #--------------------------------------------------------------------------
  644.   # * 更新角色踏步动画 (Update character step_anime)
  645.   #--------------------------------------------------------------------------
  646.   def update_actors_src
  647.     @actors.each{|sprite|
  648.       char, cw, ch = sprite.instance_variable_get(:@charData)
  649.       index = char.character_index
  650.       sx = (index % 4 * 3 + @pattern) * cw
  651.       sy = (index / 4 * 4) * ch
  652.       sprite.src_rect.set(sx, sy, cw, ch)
  653.     }
  654.   end
  655. end

  656. #=============================================================================
  657. # 完  end of script
  658. #=============================================================================
复制代码
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

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

在本版发帖返回顶部