设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 3944|回复: 0
打印 上一主题 下一主题

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

[复制链接]

Lv1.梦旅人

梦石
0
星屑
263
在线时间
10 小时
注册时间
2013-1-21
帖子
3
跳转到指定楼层
1
 楼主| 发表于 2013-1-31 20:52:43 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

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

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


我现在的状况是


我是个新手对脚本高的不怎么明白
搞了一下午也没半点眉目在下面脚本里 添加过 出错了就删了
  1.       def create_status_window
  2.     @status_window = Window_MenuStatus.new(@command_window.width, 0)
  3.   end
复制代码
请大神指点
RUBY 代码复制
  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.  
  30. $imported = {} if $imported.nil?
  31. $imported["Gab_Ellipse_Menu"] = true
  32.  
  33. #=============================================================================
  34. # * 设定
  35. #=============================================================================
  36. module Gab
  37.   module Ellipse_Menu
  38.  
  39.     USECUSTOMICONS = false # 要使用自定义图标,请改为 true ,并修改下面的CUSTOMICONS
  40.  
  41.     # Graphics\Pictures目录中的自定义图标的名称 (Name of custom icons in Graphics\Pictures folder.)
  42.     # 依照次序,在引号中填写自定义图标的名称
  43.  
  44.     CUSTOMICONS = [
  45.       "Items Icon",     # Items 道具
  46.       "Skills Icon",    # Skills 技能
  47.       "Equipment Icon", # Equipment 装备
  48.       "Status Icon",    # Status 状态
  49.       "Formation Icon", # formation 队列
  50.       "Save Icon",      # Save 记录
  51.       "Game End Icon"   # Game End 退出游戏
  52.     ]
  53.  
  54.     # 从IconSet.png中的选择要用的图标的序号 (ID of icons)
  55.     ICONS = [
  56.       192, # Items 道具
  57.       112, # Skills 技能
  58.       169, # Equipment 装备
  59.        14, # Status 状态
  60.        12, # formation 队列
  61.       117, # Save 记录
  62.       121  # Game End 退出游戏
  63.     ]
  64.  
  65.     # 菜单字体 (Menu font)
  66.           USENEWFONT = false            # 如果要使用新字体,改为true ,并给FNAME指定字体名称
  67.     FNAME  = ""                   # 通过在引号中填写字体名称,来指定菜单所用的字体。(Name of font. )
  68.     FSIZE  = 19                   # 字体大小 (font size)
  69.     FCOLOR = [255, 255, 255, 200] # 字体颜色,格式 R(red)红,G(green)绿,B(blue)蓝,A(alpha)可见度 (color of the font(R,G,B,A).)
  70.  
  71.     # 椭圆形菜单的轴长 (axises of the ellipse menu)
  72.     SMAA = 90 # 半长轴 (semi-major axis)  
  73.     SMIA = 25 # 半短轴 (semi-minor axis),半长轴必须长于半短轴。  It is necessary that SMAA > SMIA.
  74.  
  75.     # 图标移动精细度,数值越大越精细,但速度也越慢 (Frequency of the icons movement. The bigger,the slower)
  76.     # 建议数值:(Suggested values:)
  77.     #  1 = 简略 (snapshot)
  78.     #  5 = 快速 (fast)
  79.     # 10 = 中速 (median)
  80.     # 20 = 慢速 (slow)
  81.     MV = 10
  82.  
  83.     # 角色移动频率,数值越大越精细,但速度也越慢 (Frequency of the characters movement. The bigger,the slower)
  84.     CFREQ = 15
  85.  
  86.     # 用来显示地图名称,游戏时间,和金钱数量的额外的窗口的参数设置。additional windows
  87.     Windows = {
  88.       mapName: [ # 地图名称       Map Name
  89.         true,    # 是否显示       display?
  90.            0,    # 窗口的X轴坐标  Position X
  91.            0,    # 窗口的Y轴坐标  Position Y
  92.          400,    # 窗口宽度       width
  93.          231,    # 显示图标的ID   icon id
  94.            0,    # 窗口的透明度   Opacity
  95.       ],
  96.  
  97.       time: [    # 游戏时间       Game time
  98.         true,    # 是否显示       display?
  99.            0,    # 窗口的X轴坐标  Position X
  100.           34,    # 窗口的Y轴坐标  Position Y
  101.          160,    # 窗口宽度       width
  102.          280,    # 显示图标的ID   icon id
  103.            0,    # 窗口的透明度   Opacity
  104.       ],
  105.  
  106.       gold: [    # 金钱           Money
  107.         true,    # 是否显示       display?
  108.            0,    # 窗口的X轴坐标  Position X
  109.           68,    # 窗口的Y轴坐标  Position Y
  110.          160,    # 窗口宽度       width
  111.          361,    # 显示图标的ID   icon id
  112.            0,    # 窗口的透明度   Opacity
  113.       ]
  114.     }
  115.  
  116.   end
  117. end    # 设置结束  (End of the configuration)
  118.  
  119.   #--------------------------------------------------------------------------
  120.   # ** 窗口菜单的基类 (Basis of the menu window)
  121.   #--------------------------------------------------------------------------
  122.   class MenuWindow < Window_Base
  123.     def initialize(x, y, width, icon, opacity)
  124.       super(x, y, width, fitting_height(1))
  125.       @icon  = icon
  126.       self.opacity = opacity
  127.       self.contents.font.name    = Gab::Ellipse_Menu::FNAME if Gab::Ellipse_Menu::USENEWFONT
  128.       self.contents.font.size    = Gab::Ellipse_Menu::FSIZE
  129.       self.contents.font.color   = Color.new(*Gab::Ellipse_Menu::FCOLOR)
  130.       self.contents.font.outline = false
  131.       self.contents.font.shadow  = true
  132.  
  133.       draw_icon(@icon, 0, 0)
  134.       @clear_rect = Rect.new(30, 0, contents.width - 31, contents.height)
  135.  
  136.       refresh
  137.     end
  138.  
  139.     def refresh
  140.       self.contents.clear_rect(@clear_rect)
  141.       text_size = self.contents.width - 32
  142.       self.contents.draw_text(30, 0, text_size, self.contents.height, text, align)
  143.     end
  144.  
  145.     def align
  146.       return 0
  147.     end
  148.  
  149.     def update
  150.       super
  151.       refresh if (Graphics.frame_count % Graphics.frame_rate) == 0
  152.     end
  153.  
  154.     def text
  155.       return ""
  156.     end
  157.   end
  158.  
  159.   #--------------------------------------------------------------------------
  160.   # ** 地图名称窗口 (Map name window)
  161.   #--------------------------------------------------------------------------
  162.   class MenuWindowMapName < MenuWindow
  163.     def text
  164.       $game_map.display_name
  165.     end
  166.  
  167.     def align
  168.       return 0
  169.     end
  170.   end
  171.  
  172.   #--------------------------------------------------------------------------
  173.   # ** 游戏时间窗口 (Game time window)
  174.   #--------------------------------------------------------------------------
  175.   class MenuWindowTime < MenuWindow
  176.     def text
  177.       total_sec = Graphics.frame_count / Graphics.frame_rate
  178.       hour = total_sec / 60 / 60
  179.       min  = total_sec / 60 % 60
  180.       sec  = total_sec % 60
  181.       sprintf("%03d:%02d:%02d", hour, min, sec)
  182.     end
  183.   end
  184.  
  185.   #--------------------------------------------------------------------------
  186.   # ** 金钱窗口  (Money window)
  187.   #--------------------------------------------------------------------------
  188.   class MenuWindowGold < MenuWindow
  189.     def text
  190.       $game_party.gold.to_s
  191.     end
  192.   end
  193.  
  194.  
  195. #=============================================================================
  196. # * 重定义Scene_Menu类 (rewrite Scene_Menu class)
  197. #=============================================================================
  198. class Scene_Menu < Scene_MenuBase
  199.   @@iconIndex     = 0    #图标索引
  200.   @@addIcons      = 0    #图标移动量
  201.   #--------------------------------------------------------------------------
  202.   # * 定义开始运行方法 (Redefine start method)
  203.   #--------------------------------------------------------------------------
  204.   def start
  205.     super
  206.    # 术语表,其顺序与 ICONS 相对应
  207.     @vocabulary = [     
  208.       Vocab::item,
  209.       Vocab::skill,
  210.       Vocab::equip,
  211.       Vocab::status,
  212.       Vocab::formation,
  213.       Vocab::save,
  214.       Vocab::game_end
  215.     ]
  216.  
  217.     @actorsNames = $game_party.members.map{|actor| actor.name}
  218.  
  219.     create_background
  220.  
  221.     [url=home.php?mod=space&uid=114926]@sprite[/url]     = Sprite_Character.new(@main_viewport, $game_player)
  222.     @actorIndex = 0
  223.     @stage      = 0
  224.     @pattern    = 1
  225.     @actor1     = nil
  226.  
  227.     precaculate
  228.  
  229.     if  Gab::Ellipse_Menu::USECUSTOMICONS
  230.       create_custom_icons
  231.     else
  232.       create_icons
  233.     end
  234.  
  235.     create_caption
  236.     create_actor_selection
  237.     create_windows
  238.   end
  239.   #--------------------------------------------------------------------------
  240.   # * 退出菜单时的处理 (Termination of the process)
  241.   #--------------------------------------------------------------------------
  242.   def terminate
  243.     super
  244.     @icons.each(&:dispose)
  245.     @actors.each(&:dispose)
  246.     @windows.each(&:dispose)
  247.     @sprite.dispose
  248.     @caption.dispose
  249.     Input.update
  250.     $game_map.autoplay
  251.   end
  252.  
  253.   #--------------------------------------------------------------------------
  254.   # * 预演算(Precaculate)
  255.   #--------------------------------------------------------------------------
  256.   def precaculate
  257.  
  258.     @iconElRa        = 2 * Math::PI / Gab::Ellipse_Menu::ICONS.size      # icon ellpise radian     
  259.     @iconBasePoint = @sprite.y + Gab::Ellipse_Menu::SMIA * (Math.sin(-@iconElRa) - 0.5)
  260.     @iconMaxDis    = @sprite.y + Gab::Ellipse_Menu::SMIA * Math.sin(@iconElRa) - @iconBasePoint #前排图标与背景图标的Y轴距离
  261.     @iconMoveRadian = @iconElRa / Gab::Ellipse_Menu::MV         # 图标旋转时,每次所移动弧度
  262.  
  263.     @actorElRa        = 2 * Math::PI / $game_party.members.size           # actor ellpise radian
  264.     @basePointActors = @sprite.y + (Gab::Ellipse_Menu::SMIA + 24) * Math.sin(-@iconElRa)
  265.     @actorMaxDis    = @sprite.y + (Gab::Ellipse_Menu::SMIA + 24) * Math.sin(@actorElRa) - @basePointActors
  266.     @moveTimesActors = @actorElRa / Gab::Ellipse_Menu::MV
  267.     @addActors       = 0
  268.  
  269.   end
  270.  
  271.   #--------------------------------------------------------------------------
  272.   # * 用自定义图片生成图标 (Creat icons)
  273.   #--------------------------------------------------------------------------
  274.   def create_custom_icons
  275.     @icons  = []
  276.  
  277.     Gab::Ellipse_Menu::CUSTOMICONS.each_with_index {|icon_name, index|
  278.  
  279.     sprite          = Sprite.new
  280.     sprite.bitmap   = Cache.picture(icon_name)
  281.     rect = Rect.new(0, 0, sprite.width, sprite.height)
  282.     sprite.ox       = sprite.width / 2
  283.     sprite.oy       = sprite.height / 2
  284.  
  285.     @icons << sprite
  286.     }
  287.  
  288.     @icons[5].tone = Tone.new(0, 0, 0, 255) if $game_system.save_disabled
  289.  
  290.     adjust_icons
  291.  
  292.   end
  293.  
  294.   #--------------------------------------------------------------------------
  295.   # * 从Iconset.png生成图标 (Creat icons)
  296.   #--------------------------------------------------------------------------
  297.   def create_icons
  298.     iconset = Cache.system("Iconset")
  299.     @icons  = []
  300.  
  301.     Gab::Ellipse_Menu::ICONS.each_with_index {|icon_index, index|
  302.     sprite          = Sprite.new
  303.     sprite.bitmap   = iconset
  304.     sprite.src_rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
  305.     sprite.ox       = sprite.width / 2
  306.     sprite.oy       = sprite.height / 2
  307.  
  308.     @icons << sprite
  309.     }
  310.  
  311.     @icons[5].tone = Tone.new(0, 0, 0, 255) if $game_system.save_disabled
  312.  
  313.     adjust_icons
  314.  
  315.   end
  316.   #--------------------------------------------------------------------------
  317.   # * 显示标题 (Create caption)
  318.   #--------------------------------------------------------------------------
  319.   def create_caption
  320.     base, c = Bitmap.new(1, 1), nil
  321.     base.font.name  = Gab::Ellipse_Menu::FNAME if Gab::Ellipse_Menu::USENEWFONT
  322.     base.font.size  = Gab::Ellipse_Menu::FSIZE
  323.     base.font.color = Color.new(*Gab::Ellipse_Menu::FCOLOR)
  324.  
  325.     maxLen = (@vocabulary + @actorsNames).inject(0){|a, b|
  326.       c = base.text_size(b)
  327.       c.width > a ? c.width : a
  328.     }
  329.  
  330.     @caption = Sprite.new
  331.     @caption.bitmap = Bitmap.new(maxLen + 5, c.height)
  332.     @caption.bitmap.font.name  = Gab::Ellipse_Menu::FNAME  if Gab::Ellipse_Menu::USENEWFONT
  333.     @caption.bitmap.font.size  = Gab::Ellipse_Menu::FSIZE
  334.     @caption.bitmap.font.color = Color.new(*Gab::Ellipse_Menu::FCOLOR)
  335.     @caption.ox = @caption.width  / 2
  336.     @caption.oy = @caption.height / 2
  337.     @caption.x  = @icons[@@iconIndex].x
  338.     @caption.y  = @icons[@@iconIndex].y  + @icons[@@iconIndex].height / 2 + 10  ###########
  339.  
  340.     base.dispose
  341.  
  342.     caption_refresh
  343.   end
  344.   #--------------------------------------------------------------------------
  345.   # * 建立角色选择画面 (Create actor selection scene)
  346.   #--------------------------------------------------------------------------
  347.   def create_actor_selection
  348.     @actors = $game_party.members.map{|char|
  349.       actor = Sprite.new
  350.       actor.bitmap = Cache.character(char.character_name)
  351.       sign = char.character_name[/^[\!\$]./]
  352.       if sign && sign.include?(''
  353.  
  354. )
  355.         cw = actor.bitmap.width / 3
  356.         ch = actor.bitmap.height / 4
  357.       else
  358.         cw = actor.bitmap.width / 12
  359.         ch = actor.bitmap.height / 8
  360.       end
  361.  
  362.       actor.ox = cw / 2
  363.       actor.oy = ch
  364.  
  365.       actor.x = @sprite.x + 1.5 * Gab::Ellipse_Menu::SMAA
  366.       actor.instance_variable_set(:@charData, [char, cw, ch])
  367.  
  368.       actor
  369.     }
  370.  
  371.     adjust_actors
  372.     update_actors_src
  373.   end
  374.  
  375.  
  376.  
  377.   #--------------------------------------------------------------------------
  378.   # * 建立地图名称、游戏时间、金钱窗口 (Create map_name window,game_time window and Gold window)
  379.   #--------------------------------------------------------------------------
  380.   def create_windows
  381.     windows = Gab::Ellipse_Menu::Windows
  382.     @windows = []
  383.  
  384.     @windows << MenuWindowMapName.new(*windows[:mapName][1,5]) if windows[:mapName][0]
  385.     @windows << MenuWindowTime.new(*windows[:time][1,5])       if windows[:time][0]
  386.     @windows << MenuWindowGold.new(*windows[:gold][1,5])       if windows[:gold][0]
  387.   end
  388.   #--------------------------------------------------------------------------
  389.   # * 调节图标的位置并调整图标的可见度和缩放比例(position icons and adjust opacity and zoom of the icons)
  390.   #--------------------------------------------------------------------------
  391.   def adjust_icons
  392.     t = 90/57.3 + @@addIcons
  393.  
  394.     @icons.each{|sprite|
  395.  
  396.           sprite.x =@sprite.x + Gab::Ellipse_Menu::SMAA * Math.cos(t)
  397.           sprite.y =@sprite.y + Gab::Ellipse_Menu::SMIA * (Math.sin(t) - 0.5)
  398.  
  399.     t += @iconElRa
  400.  
  401.     dif            = (sprite.y - @iconBasePoint) / @iconMaxDis
  402.     sprite.opacity = @stage == 0 ? 127 + 255 * dif : 0
  403.     sprite.zoom_x  = sprite.zoom_y = [0.55 + dif, 1].min
  404.  
  405.     }
  406.  
  407.   end
  408.   #--------------------------------------------------------------------------
  409.   # * 调节角色图标的位置并调整图标的可见度和缩放比例(position actors and adjust opacity and zoom of the actors)
  410.   #--------------------------------------------------------------------------
  411.   def adjust_actors
  412.           t = 90/57.3 + @addActors
  413.  
  414.     @actors.each{|sprite|
  415.       sprite.x       = @sprite.x + (Gab::Ellipse_Menu::SMAA + 24) * Math.cos(t)
  416.       sprite.y       = @sprite.y + (Gab::Ellipse_Menu::SMIA + 26) * Math.sin(t)
  417.       dif            = (sprite.y - @basePointActors) / (@actorMaxDis+26)
  418.       sprite.opacity = @stage != 0 ? 127 + 255 * dif : 0
  419.       sprite.zoom_x  = sprite.zoom_y = [0.6 + dif, 1].min
  420.             t += @actorElRa
  421.     }
  422.   end
  423.   #--------------------------------------------------------------------------
  424.   # * 旋转图标 (Movement of icons)
  425.   #--------------------------------------------------------------------------
  426.   def rotateIcons(dir)
  427.     @iconMoveRadian *= -1 if dir == :right
  428.  
  429.     Sound.play_cursor
  430.  
  431.     Gab::Ellipse_Menu::MV.times{|sprite|
  432.       @@addIcons += @iconMoveRadian
  433.       @@addIcons %= Math::PI * 2
  434.       adjust_icons
  435.       Graphics.update
  436.     }
  437.  
  438.     if dir == :right
  439.       @iconMoveRadian *= -1
  440.       @@iconIndex += 1
  441.     else
  442.       @@iconIndex -= 1
  443.     end
  444.     @@iconIndex %= @icons.size
  445.  
  446.     caption_refresh
  447.   end
  448.   #--------------------------------------------------------------------------
  449.   # * 旋转角色图标 (Movement of actors)
  450.   #--------------------------------------------------------------------------
  451.   def rotateActors(dir)
  452.     @moveTimesActors *= -1 if dir == :right
  453.  
  454.     Sound.play_cursor
  455.  
  456.     Gab::Ellipse_Menu::MV.times{|sprite|
  457.       @addActors += @moveTimesActors
  458.       @addActors %= Math::PI * 2
  459.       adjust_actors
  460.       Graphics.update
  461.     }
  462.  
  463.     if dir == :right
  464.       @moveTimesActors *= -1
  465.       @actorIndex += 1
  466.     else
  467.       @actorIndex -= 1
  468.     end
  469.     @actorIndex %= @actors.size
  470.  
  471.     caption_refresh
  472.   end
  473.   #--------------------------------------------------------------------------
  474.   # * 更新标题 (Update caption)
  475.   #--------------------------------------------------------------------------
  476.   def caption_refresh
  477.     @caption.bitmap.clear
  478.     text = @stage == 0 ? @vocabulary[@@iconIndex] : @actorsNames[@actorIndex]
  479.     @caption.bitmap.draw_text(@caption.bitmap.rect, text, 1)
  480.     @caption.update
  481.   end
  482.   #--------------------------------------------------------------------------
  483.   # * 初级更新(Update base)
  484.   #--------------------------------------------------------------------------
  485.   def update
  486.     super
  487.  
  488.     @windows.each(&:update)
  489.  
  490.     case @stage
  491.     when 0
  492.       update_main_input
  493.     when 1, 2
  494.       @stage == 1 ? update_actors_input : update_formation_input
  495.  
  496.       if (Graphics.frame_count % Gab::Ellipse_Menu::CFREQ) == 0
  497.         @pattern = (@pattern + 1) % 3
  498.       end
  499.       update_actors_src
  500.     end
  501.   end
  502.   #--------------------------------------------------------------------------
  503.   # * 更新初级指令输入 (Update standard input)
  504.   #--------------------------------------------------------------------------
  505.   def update_main_input
  506.     if Input.repeat?(:LEFT)
  507.       rotateIcons(:left)
  508.     elsif Input.repeat?(:RIGHT)
  509.       rotateIcons(:right)
  510.     elsif Input.trigger?(:B)
  511.       Sound.play_cancel
  512.       process_return
  513.     elsif Input.trigger?(:C)
  514.       process_confirm
  515.     end
  516.   end
  517.   #--------------------------------------------------------------------------
  518.   # * 更新角色选择画面的输入 (Update input in the actor selection scene)
  519.   #--------------------------------------------------------------------------
  520.   def update_actors_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.       Sound.play_ok
  530.       process_special_confirm
  531.     end
  532.   end
  533.  
  534.   #--------------------------------------------------------------------------
  535.   # * 更新队列变换(Update formation exchanging )
  536.   #--------------------------------------------------------------------------
  537.   def update_formation_input
  538.     if Input.repeat?(:LEFT)
  539.       rotateActors(:left)
  540.     elsif Input.repeat?(:RIGHT)
  541.       rotateActors(:right)
  542.     elsif Input.trigger?(:B)
  543.       Sound.play_cancel
  544.       process_return
  545.     elsif Input.trigger?(:C)
  546.       process_formation_confirm
  547.     end
  548.   end
  549.   #--------------------------------------------------------------------------
  550.   # * 处理玩家输入的“确定”指令 (Process confirm)
  551.   #--------------------------------------------------------------------------
  552.   def process_confirm
  553.     case @@iconIndex
  554.     when 0 # Item 物品
  555.       Sound.play_ok
  556.       SceneManager.call(Scene_Item)
  557.     when 1, 2, 3, 4 # Skill 技能, Equip 装备, Status 状态, Formation 整队
  558.       Sound.play_ok
  559.       @stage = @@iconIndex == 4 ? 2 : 1
  560.       adjust_actors
  561.       adjust_icons
  562.       caption_refresh
  563.       @caption.y -= @icons[@@iconIndex].height / 2 + 14
  564.     when 5 # Save 保存
  565.       if ($game_system.save_disabled)
  566.         Sound.play_buzzer
  567.       else
  568.         SceneManager.call(Scene_Save)
  569.         Sound.play_ok
  570.       end
  571.     when 6 # Game End 退出游戏
  572.       Sound.play_ok
  573.       SceneManager.call(Scene_End)
  574.     end
  575.   end
  576.   #--------------------------------------------------------------------------
  577.   # * 处理针对某一被选定的角色的技能、装备或状态窗口的请求(Processes the required confirmation of the specific actor)
  578.   #--------------------------------------------------------------------------
  579.   def process_special_confirm
  580.     $game_party.menu_actor = $game_party.members[@actorIndex]
  581.  
  582.     case @@iconIndex
  583.     when 1 # Skill
  584.       SceneManager.call(Scene_Skill)
  585.     when 2 # Equip
  586.       SceneManager.call(Scene_Equip)
  587.     when 3 # Status
  588.       SceneManager.call(Scene_Status)     
  589.     end
  590.   end
  591.   #--------------------------------------------------------------------------
  592.   # * 处理玩家在整队画面输入的“确定”指令 (Processes formation switching confirmation )
  593.   #--------------------------------------------------------------------------
  594.   def process_formation_confirm
  595.     if @actor1.nil?
  596.       @actor1 = @actorIndex
  597.       @actors[@actor1].tone = Tone.new(150, 150, 150, 0)
  598.       Sound.play_ok
  599.       return
  600.     end
  601.     if @actor1 == @actorIndex
  602.       return Sound.play_buzzer   
  603.     else   
  604.       Sound.play_ok
  605.  
  606.       $game_party.swap_order(@actor1,@actorIndex)
  607.       @actorsNames = $game_party.members.map{|actor| actor.name}
  608.  
  609.       @stage      = 0
  610.  
  611.       @actors.each {|sprite| sprite.bitmap.dispose }
  612.       @actors.each(&:dispose)
  613.  
  614.       @sprite.dispose
  615.       @sprite     = Sprite_Character.new(@main_viewport, $game_player)
  616.  
  617.       @addActors = 0
  618.       @actorIndex = 0
  619.  
  620.       create_actor_selection
  621.  
  622.       @actors[@actor1].tone = Tone.new(0, 0, 0, 0)
  623.  
  624.       @actor1     = nil
  625.  
  626.       adjust_icons   
  627.       caption_refresh
  628.       @caption.y += @icons[@@iconIndex].height / 2 + 14
  629.  
  630.     end
  631.   end
  632.   #--------------------------------------------------------------------------
  633.   # * 处理玩家的输入的“返回”指令 (Process return)
  634.   #--------------------------------------------------------------------------
  635.   def process_return
  636.     case @stage
  637.     when 0
  638.           @@iconIndex = 0
  639.       @@addIcons = 0
  640.       return_scene
  641.     when 1,2
  642.       case @@iconIndex
  643.       when 1, 2, 3
  644.         @stage = 0
  645.         adjust_actors
  646.         adjust_icons
  647.         caption_refresh
  648.         @caption.y += @icons[@@iconIndex].height / 2 + 14
  649.       when 4
  650.         if !@actor1.nil?
  651.           @actors[@actor1].tone = Tone.new(0, 0, 0, 0)
  652.           return @actor1 = nil
  653.         end
  654.  
  655.         @stage = 0
  656.         adjust_actors
  657.         adjust_icons
  658.         caption_refresh
  659.         @caption.y += @icons[@@iconIndex].height / 2  + 14
  660.       end
  661.     end
  662.   end
  663.   #--------------------------------------------------------------------------
  664.   # * 更新角色踏步动画 (Update character step_anime)
  665.   #--------------------------------------------------------------------------
  666.   def update_actors_src
  667.     @actors.each{|sprite|
  668.       char, cw, ch = sprite.instance_variable_get(:@charData)
  669.       index = char.character_index
  670.       sx = (index % 4 * 3 + @pattern) * cw
  671.       sy = (index / 4 * 4) * ch
  672.       sprite.src_rect.set(sx, sy, cw, ch)
  673.     }
  674.   end
  675. end
  676.  
  677. #=============================================================================
  678. # 完  end of script
  679. #=============================================================================
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2025-2-20 03:58

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表