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

Project1

 找回密码
 注册会员
搜索
查看: 1511|回复: 2

[已经过期] 想问一下状态剩余回合脚本和状态滚动脚本如何共用?

[复制链接]

Lv2.观梦者

梦石
0
星屑
718
在线时间
73 小时
注册时间
2018-1-19
帖子
22
发表于 2021-9-20 16:45:50 | 显示全部楼层 |阅读模式

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

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

x
rt,这两个脚本好像不能一起用......萌新想知道怎么把这两个效果都用上呢?
这个是状态剩余回合脚本
代码复制
  1. #==============================================================================
  2. # ■状态剩余回合数显示 for RGSS3 Ver1.01-β
  3. # □作成者 kure
  4. #==============================================================================
  5. #
  6. # 状态备注:  <不显示剩余回合数>   则不会显示剩余回合数
  7. #
  8.  
  9. #==============================================================================
  10. # ■ RPG::State(追加定義)
  11. #==============================================================================
  12. class RPG::State < RPG::BaseItem
  13.   #--------------------------------------------------------------------------
  14.   # ☆残りターン非表示の定義(追加定義)
  15.   #--------------------------------------------------------------------------  
  16.   def view_turns?
  17.     return true unless @note
  18.     return false if @note.include?("<不显示剩余回合数>")
  19.     return true
  20.   end
  21. end
  22.  
  23. #==============================================================================
  24. # ■ Window_Base
  25. #==============================================================================
  26. class Window_Base < Window
  27.   #--------------------------------------------------------------------------
  28.   # ● ステートおよび強化/弱体のアイコンを描画(再定義)
  29.   #--------------------------------------------------------------------------
  30.   def draw_actor_icons(actor, x, y, width = 96)
  31.     icons = (actor.state_icons_adv + actor.buff_icons_adv)[0, width / 24]
  32.  
  33.     last = contents.font.size
  34.     contents.font.size = 18
  35.     change_color(crisis_color)
  36.     icons.each_with_index {|n, i| draw_state_icon_turns(n, x + 24 * i, y) }
  37.     change_color(normal_color)
  38.     contents.font.size = last
  39.  
  40.   end
  41.   #--------------------------------------------------------------------------
  42.   # ● 残りのターンを加えたアイコンの描画(追加定義)
  43.   #--------------------------------------------------------------------------
  44.   def draw_state_icon_turns(data, x, y)
  45.     draw_icon(data[0], x, y)
  46.     if data[2] and $data_states[data[2]] and $data_states[data[2]].auto_removal_timing == 0
  47.       return
  48.     end
  49.     draw_text(x + 12, y + 8, 12, 18, data[1],2)
  50.   end
  51. end
  52.  
  53. #==============================================================================
  54. # ■ Game_BattlerBase
  55. #==============================================================================
  56. class Game_BattlerBase
  57.   #--------------------------------------------------------------------------
  58.   # ● 現在のステートをアイコンINDEX、残りターン、ステートIDで取得(追加定義)
  59.   #--------------------------------------------------------------------------
  60.   def state_icons_adv
  61.     icons = states.collect {|state| [state.icon_index, @state_turns[state.id], state.id] }
  62.     for i in 0..icons.size - 1
  63.       if icons[i][0] == 0
  64.         icons[i] = nil
  65.       else
  66.         icons[i][1] = "" if $data_states[icons[i][2]].auto_removal_timing == 0
  67.         icons[i][1] = "" unless $data_states[icons[i][2]].view_turns?
  68.       end
  69.     end
  70.     icons.compact!
  71.     return icons
  72.   end
  73.   #--------------------------------------------------------------------------
  74.   # ● 現在の強化/弱体をアイコンINDEX、残りターンで取得(追加定義)
  75.   #--------------------------------------------------------------------------
  76.   def buff_icons_adv
  77.     icons = []
  78.     @buffs.each_with_index {|lv, i| [icons.push(buff_icon_index(lv, i)),@buff_turns[i]] }
  79.     for i in 0..icons.size - 1
  80.       icons[i] = nil if icons[i][0] == 0
  81.     end
  82.     icons.compact!
  83.     return icons
  84.   end
  85. end


这个是状态滚动脚本
代码复制
  1. ###--------------------------------------------------------------------------###
  2. #  CP 滚动状态 VX script                                               #
  3. #  Version 1.1                                                                 #
  4. #                                                                              #
  5. #      Credits:                                                                #
  6. #  Original code by: Neon Black                                                #
  7. #  Modified by:                                                                #
  8. #                                                                              #
  9. #  This work is licensed under the Creative Commons Attribution-NonCommercial  #
  10. #  3.0 Unported License. To view a copy of this license, visit                 #
  11. #  http://creativecommons.org/licenses/by-nc/3.0/.                             #
  12. #  Permissions beyond the scope of this license are available at               #
  13. #  http://cphouseset.wordpress.com/liscense-and-terms-of-use/.                 #
  14. #                                                                              #
  15. #      Contact:                                                                #
  16. #  NeonBlack - [email protected] (e-mail) or "neonblack23" on skype         #
  17. ###--------------------------------------------------------------------------###
  18.  
  19. ###--------------------------------------------------------------------------###
  20. #      Revision information:                                                   #
  21. #  V1.1 - 11.14.2012                                                           #
  22. #   Improved state rectangle drawing                                           #
  23. #  V1.0 - 7.15.2012                                                            #
  24. #   Wrote and debugged main script                                             #
  25. ###--------------------------------------------------------------------------###
  26.  
  27. ###--------------------------------------------------------------------------###
  28. #      Compatibility:                                                          #
  29. #  Alias       - Window_Base: initialize, update                               #
  30. #  Overwrites  - Window_Base: draw_actor_icons                                 #
  31. #  New Objects - Window_Base: draw_icons_area, clear_all_icons                 #
  32. #                Scroll_States: initialize, change?, update_icons,             #
  33. #                               clear_icon_area                                #
  34. ###--------------------------------------------------------------------------###
  35.  
  36. ###--------------------------------------------------------------------------###
  37. #      Instructions:                                                           #
  38. #  Place this script in the "Materials" section of the scripts above main.     #
  39. #  This script is plug and play and overwrites how states, buff, and debuffs   #
  40. #  are displayed.  The only setting this script contains modifies the speed    #
  41. #  at which the states change and can be altered below.                        #
  42. ###--------------------------------------------------------------------------###
  43.  
  44. ###--------------------------------------------------------------------------###
  45. #      说明:                                                                 #
  46. #  可以让玩家处于多个状态时,依次滚动显示状态图标,请在下面设定滚动前等待的时间
  47. #                                                                              #
  48. module CP            # Do not                                                  #
  49. module SCROLL_STATES #  change these.                                          #
  50. #                                                                              #
  51. ###-----                                                                -----###
  52. # 图标切换前等待的时间,单位是帧.   #
  53. TRANS = 45 # 默认 = 45                                                      #
  54. #                                                                              #
  55. ###--------------------------------------------------------------------------###
  56.  
  57.  
  58. ###--------------------------------------------------------------------------###
  59. #  The following lines are the actual core code of the script.  While you are  #
  60. #  certainly invited to look, modifying it may result in undesirable results.  #
  61. #  Modify at your own risk!                                                    #
  62. ###--------------------------------------------------------------------------###
  63.  
  64. end
  65. end
  66.  
  67. $imported = {} if $imported == nil
  68. $imported["CP_SCROLLING_STATES"] = 1.1
  69.  
  70. class Scroll_States  ## This class holds the state icons for windows.
  71.   attr_reader   :x
  72.   attr_reader   :y
  73.   attr_reader   :width
  74.   attr_reader   :icons
  75.   attr_accessor :bitmap
  76.  
  77.   def initialize(x, y, width, states, level = 0)
  78.     @x = x  ## Sets up required aspects of the states class.
  79.     @y = y
  80.     @width = width
  81.     @states = states
  82.     @bitmap = Bitmap.new([width, 1].max, 24)
  83.     update_icons(level)
  84.   end
  85.  
  86.   def change?(level)  ## Determines if a refresh is required.
  87.     return false if (@width / 24 >= @states.size)
  88.     return true if (level % CP::SCROLL_STATES::TRANS == 0)
  89.     return false
  90.   end
  91.  
  92.   def update_icons(level)
  93.     return @icons = [0] if @states.empty?  ## Skip if no states.
  94.     total = @width / 24
  95.     return @icons = @states if total >= @states.size  ## No refresh needed.
  96.     start = (level / CP::SCROLL_STATES::TRANS) % @states.size
  97.     double = @states + @states  ## Doubles the states for overlap.
  98.     top = [double.size, start + total].min
  99.     @icons = []
  100.     for i in start...top  ## Create the shown states in order.
  101.       @icons.push(double[i])
  102.     end
  103.   end
  104. end
  105.  
  106. class Window_Base < Window
  107.   alias cp_sswb_initialize initialize
  108.   def initialize(x, y, width, height)
  109.     cp_sswb_initialize(x, y, width, height)
  110.     @icon_areas = {}  ## Sets up an array for the states.
  111.     @icon_scroll = false
  112.     @icon_timer = 0
  113.   end
  114.  
  115.   alias cp_sswb_update update
  116.   def update
  117.     cp_sswb_update
  118.     unless @icon_areas.empty?  ## Ignore if no states were drawn.
  119.       @icon_timer += 1  ## A timer used by states.
  120.       @icon_areas.each_value do |area|
  121.         next unless area.change?(@icon_timer)
  122.         draw_icons_area(area)
  123.       end
  124.     end
  125.   end
  126.  
  127.   def draw_icons_area(area)
  128.     contents.clear_rect(area.x, area.y, area.width, 24)  ## Clears state area.
  129.     contents.blt(area.x, area.y, area.bitmap, area.bitmap.rect)
  130.     area.update_icons(@icon_timer)  ## Updates the icons.
  131.     area.icons.each_with_index {|n, i| draw_icon(n, area.x + 24 * i, area.y) }
  132.   end
  133.  
  134.   def clear_all_icons  ## Clears all icon spots for redraw.
  135.     @icon_areas.each_key {|key| clear_icon_area(key)}
  136.     @icon_areas = {}  ## Resets the array.
  137.     @icon_scroll = false  ## Do not reset this frame.
  138.   end
  139.  
  140.   def clear_icon_area(key)
  141.     return if @icon_areas[key].nil?
  142.     area = @icon_areas[key]
  143.     contents.clear_rect(area.x, area.y, area.width, 24)
  144.     contents.blt(area.x, area.y, area.bitmap, area.bitmap.rect)
  145.     @icon_areas[key] = nil
  146.   end
  147.  
  148.   def draw_actor_icons(actor, x, y, width = 96)  ## Overwrite this method.
  149.     icons = (actor.state_icons + actor.buff_icons)
  150.     key = [x, y, width]
  151.     clear_icon_area(key)
  152.     temp = Scroll_States.new(x, y, width, icons)  ## Creates an icon holder.
  153.     @icon_areas[key] = temp
  154.     rect = Rect.new(x, y, width, 24)
  155.     @icon_areas[key].bitmap.blt(0, 0, contents, rect)
  156.     draw_icons_area(@icon_areas[key])  ## Draw the newest set.
  157.   end
  158. end
  159.  
  160.  
  161. ###--------------------------------------------------------------------------###
  162. #  End of script.                                                              #
  163. ###--------------------------------------------------------------------------##

Lv4.逐梦者

梦石
1
星屑
14499
在线时间
2086 小时
注册时间
2017-9-28
帖子
662
发表于 2021-9-20 18:43:51 | 显示全部楼层
可以两个功能都用星潟的

剩余回合数显示

状态滚动

评分

参与人数 1星屑 +20 收起 理由
alexncf125 + 20 搬动费~

查看全部评分

VA外站脚本汉化群:226308173   |    部分远古文件备份:https://wwzv.lanzoue.com/b02rac5pc  密码:acgm
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
718
在线时间
73 小时
注册时间
2018-1-19
帖子
22
 楼主| 发表于 2021-9-20 19:20:55 | 显示全部楼层
Nil2018 发表于 2021-9-20 18:43
可以两个功能都用星潟的

...

星潟的好像不太能和非原版战斗系统兼容,我战斗系统用的是SRPGconNEXT,然后现在只能显示回合数,滚动不了了
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-3-29 04:27

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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