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

Project1

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

[已经解决] 求解如何增加这个角色仓库的人数上限?

[复制链接]

Lv1.梦旅人

梦石
0
星屑
86
在线时间
280 小时
注册时间
2010-7-18
帖子
45
跳转到指定楼层
1
发表于 2014-4-30 20:07:57 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
5星屑
本帖最后由 77767264 于 2014-5-1 13:27 编辑

我需要添加很多的人物,但这个仓库的上限貌似只有20人好像,远远满足不了我的要求...

注释是英文的,不过似乎也没有说怎么增加上限,只是说了些添加去除锁定等...

脚本里面应该有,但我是脚本盲,没有注释的情况下完全看不懂....

求支招...

RUBY 代码复制
  1. #===============================================================================
  2. # ● [VX] ? Party Manager/Switcher ?
  3. #-------------------------------------------------------------------------------
  4. # ? By Prexus
  5. # ? Edit by GSorby [[email][email protected][/email]]
  6. # ? RPG Revolution
  7. # ? Released on: 27/12/2009
  8. # ? Version: 1.1
  9. #-------------------------------------------------------------------------------
  10. # This is a Party Manager/Switcher which allows the player to switch current
  11. # party member with ones that are on standby. You can also make a Party Member
  12. # unavailible or locked. There is also a function so that you can show and hide
  13. # party members in the manager.
  14. #===============================================================================
  15. # To open the party manager, use the code below:
  16. #
  17. # $scene = Scene_Party.new
  18. #-------------------------------------------------------------------------------
  19. # To make an actor visible in the Party Window, use the code below:
  20. #
  21. # $data_actors[ID].found = true
  22. #-------------------------------------------------------------------------------
  23. # To make an actor unavailable (Grayed out)/unmoveable, use the code below:
  24. #
  25. # $data_actors[ID].unavailable = true
  26. #-------------------------------------------------------------------------------
  27. # To lock the leader, use the code below:
  28. #
  29. # $game_party.members[0].actor.required = true
  30. #-------------------------------------------------------------------------------
  31. # To unlock the leader, use the code below:
  32. #
  33. # $game_party.members[0].actor.required = false
  34. #-------------------------------------------------------------------------------
  35. # To remove an actor from your reserves, use the code below:
  36. #
  37. # $data_actors[ID].found = false
  38. #===============================================================================
  39. # Credits to Prexus for the main script.
  40. # Credits to GSorby for the edit of the script.
  41. # *Don't edit anything past this point unless you know what you're doing.*
  42. #===============================================================================
  43.  
  44. module RPG
  45. class Actor
  46. def setup
  47. @found = false
  48. @unavailable = false
  49. @required = false
  50. end
  51. attr_accessor :found
  52. attr_accessor :unavailable
  53. attr_accessor :required
  54. end
  55. end
  56.  
  57. class Game_Actors
  58. attr_reader :data
  59. alias prex_party_g_actors_initialize initialize
  60. def initialize
  61. prex_party_g_actors_initialize
  62. $data_actors.each do |actor|
  63. actor.setup if actor
  64. @data[actor.id] = Game_Actor.new(actor.id) if actor
  65. end
  66. end
  67. end
  68.  
  69. class Scene_File < Scene_Base
  70. alias prex_party_s_file_write_save_data write_save_data
  71. alias prex_party_s_file_read_save_data read_save_data
  72. def write_save_data(file)
  73. prex_party_s_file_write_save_data(file)
  74. Marshal.dump($data_actors, file)
  75. end
  76. def read_save_data(file)
  77. prex_party_s_file_read_save_data(file)
  78. $data_actors = Marshal.load(file)
  79. end
  80. end
  81.  
  82. class Scene_Title < Scene_Base
  83. alias prex_party_s_title_command_new_game command_new_game
  84. def command_new_game
  85. prex_party_s_title_command_new_game
  86. $game_party.members.each {|s| s.actor.found = true if s}
  87. end
  88. end
  89.  
  90. class Window_Base < Window
  91. def draw_item_name(item, x, y, enabled = true, width = 172)
  92. if item != nil
  93. draw_icon(item.icon_index, x, y, enabled)
  94. self.contents.font.color = normal_color
  95. self.contents.font.color.alpha = enabled ? 255 : 128
  96. self.contents.draw_text(x + 24, y, width, WLH, item.name)
  97. end
  98. end
  99. end
  100.  
  101. class Scene_Party < Scene_Base
  102. def start
  103. super
  104. create_menu_background
  105. create_windows
  106. end
  107. def create_windows
  108. @member_window = Window_CurrentMember.new
  109. @party_window = Window_CurrentParty.new
  110. @party_window.active = true
  111. @selectable_window = Window_SelectMember.new
  112. end
  113. def update_windows
  114. @member_window.update
  115. @party_window.update
  116. @selectable_window.update
  117. if @party_window.active
  118. @member_window.set_member(@party_window.member)
  119. elsif @selectable_window.active
  120. @member_window.set_member(@selectable_window.member)
  121. end
  122. end
  123. def terminate
  124. super
  125. @member_window.dispose
  126. @party_window.dispose
  127. @selectable_window.dispose
  128. end
  129. def update
  130. super
  131. update_windows
  132. update_input
  133. end
  134. def update_input
  135. if Input.trigger?(Input::A)
  136. if @member_window.mode == 1
  137. @member_window.set_mode(0)
  138. elsif @member_window.mode == 0
  139. @member_window.set_mode(1)
  140. end
  141. end
  142. if @party_window.active
  143. if Input.trigger?(Input::B)
  144. Sound.play_cancel
  145. $scene = Scene_Menu.new
  146. elsif Input.trigger?(Input::C)
  147. member = @party_window.member
  148. if member != nil
  149. if member.actor.unavailable or member.actor.required
  150. Sound.play_buzzer
  151. return
  152. end
  153. end
  154. Sound.play_decision
  155. @party_window.active = false
  156. @selectable_window.active = true
  157. @selectable_window.index = 0
  158. end
  159. elsif @selectable_window.active
  160. if Input.trigger?(Input::B)
  161. Sound.play_cancel
  162. @selectable_window.index = -1
  163. @selectable_window.active = false
  164. @party_window.active = true
  165. elsif Input.trigger?(Input::C)
  166. member = @selectable_window.member
  167. if member != nil
  168. if member.actor.unavailable
  169. Sound.play_buzzer
  170. return
  171. end
  172. end
  173. Sound.play_decision
  174. $game_party.remove_actor(@party_window.member.id) if @party_window.member != nil
  175. $game_party.add_actor(@selectable_window.member.id) if @selectable_window.member != nil
  176. @selectable_window.refresh
  177. @party_window.refresh
  178. @selectable_window.index = -1
  179. @selectable_window.active = false
  180. @party_window.active = true
  181. end
  182. end
  183. end
  184. end
  185.  
  186. class Window_CurrentMember < Window_Base
  187. attr_reader :mode
  188. def initialize(member = nil, mode = 0)
  189. super(284, 47, 242, 306)
  190. create_contents
  191. @member = member
  192. @mode = 0
  193. refresh
  194. end
  195. def member
  196. return @member
  197. end
  198. def set_member(member)
  199. old_member = @member
  200. @member = member
  201. refresh if old_member != @member
  202. end
  203. def set_mode(mode)
  204. @mode = mode if [0, 1].include?(mode)
  205. refresh
  206. end
  207. def refresh
  208. self.contents.clear
  209. return unless @member
  210. x, y = 0, 0
  211. self.draw_actor_face(@member, x, y, 96)
  212. self.draw_actor_name(@member, x + 102, y)
  213. self.draw_actor_class(@member, x + 102, y + WLH)
  214. self.draw_actor_level(@member, x + 102, y + WLH*2)
  215. case @mode
  216. when 0
  217. self.draw_icon(0, self.contents.width - 24, y + WLH*2)
  218. self.draw_actor_hp(@member, x, y + WLH*5, 160)
  219. self.draw_actor_mp(@member, x, y + WLH*6, 160)
  220. self.draw_actor_parameter(@member, x, y + WLH*7, 0)
  221. self.draw_actor_parameter(@member, x, y + WLH*8, 1)
  222. self.draw_actor_parameter(@member, x, y + WLH*9, 2)
  223. self.draw_actor_parameter(@member, x, y + WLH*10, 3)
  224. when 1
  225. self.draw_icon(143, self.contents.width - 24, y + WLH*2)
  226. self.contents.draw_text(x, y + WLH*2, self.contents.width - 12, WLH, 'Stat', 2)
  227. for i in [email]0...@member.equips.size[/email]
  228. item = @member.equips[i]
  229. self.draw_item_name(item, x, y + WLH*(3+i), true, self.contents.width - 24)
  230. end
  231. end
  232. end
  233. end
  234.  
  235. class Window_CurrentParty < Window_Selectable
  236. def initialize
  237. super(18, 60, 256, 64)
  238. @item_max = 4
  239. @column_max = @item_max
  240. create_contents
  241. self.index = 0
  242. refresh
  243. end
  244. def member
  245. return $game_party.members[self.index]
  246. end
  247. def refresh
  248. for i in 0...@item_max
  249. rect = item_rect(i)
  250. self.contents.clear_rect(rect)
  251. end
  252. for i in 0...$game_party.members.size
  253. rect = item_rect(i)
  254. bitmap = Cache.character($game_party.members[i].character_name)
  255. sign = $game_party.members[i].character_name[/^[\!\$]./]
  256. if sign != nil and sign.include?('$')
  257. cw = bitmap.width / 3
  258. ch = bitmap.height / 4
  259. else
  260. cw = bitmap.width / 12
  261. ch = bitmap.height / 8
  262. end
  263. n = $game_party.members[i].character_index
  264. src_rect = Rect.new((n%4*3+1)*cw, (n/4*4)*ch, cw, ch)
  265. if $game_party.members[i].actor.unavailable
  266. self.contents.blt(rect.x, rect.y, bitmap, src_rect, 128)
  267. else
  268. self.contents.blt(rect.x, rect.y, bitmap, src_rect, 255)
  269. end
  270. if $game_party.members[i].actor.required
  271. lock_bitmap = Cache.system("Locked")
  272. self.contents.blt(rect.x + rect.width - lock_bitmap.width,
  273. rect.y + rect.height - lock_bitmap.height,
  274. lock_bitmap, lock_bitmap.rect)
  275. end
  276. end
  277. end
  278. def item_rect(index)
  279. rect = Rect.new(0, 0, 0, 0)
  280. rect.width = (contents.width + @spacing) / @column_max - @spacing
  281. rect.height = 32
  282. rect.x = index % @column_max * (rect.width + @spacing)
  283. rect.y = index / @column_max * 32
  284. return rect
  285. end
  286. end
  287.  
  288. class Window_SelectMember < Window_Selectable
  289. def initialize
  290. super(18, 144, 256, 192)
  291. calculate_actors
  292. @item_max = @actors.size + 1
  293. @column_max = 4
  294. self.index = -1
  295. self.active = false
  296. refresh
  297. end
  298. def calculate_actors
  299. @actors = []
  300. for a in $game_actors.data
  301. @actors << a if a != nil and a.actor.found and !$game_party.members.include?(a)
  302. end
  303. end
  304. def member
  305. return @actors[self.index]
  306. end
  307. def refresh
  308. self.contents.clear
  309. calculate_actors
  310. @item_max = @actors.size + 1
  311. for i in [email]0...@actors.size[/email]
  312. rect = item_rect(i)
  313. bitmap = Cache.character(@actors[i].character_name)
  314. sign = @actors[i].character_name[/^[\!\$]./]
  315. if sign != nil and sign.include?('$')
  316. cw = bitmap.width / 3
  317. ch = bitmap.height / 4
  318. else
  319. cw = bitmap.width / 12
  320. ch = bitmap.height / 8
  321. end
  322. n = @actors[i].character_index
  323. src_rect = Rect.new((n%4*3+1)*cw, (n/4*4)*ch, cw, ch)
  324. if @actors[i].actor.unavailable
  325. self.contents.blt(rect.x, rect.y, bitmap, src_rect, 128)
  326. else
  327. self.contents.blt(rect.x, rect.y, bitmap, src_rect, 255)
  328. end
  329. if @actors[i].actor.required
  330. lock_bitmap = Cache.system("Locked")
  331. self.contents.blt(rect.x + rect.width - lock_bitmap.width,
  332. rect.y + rect.height - lock_bitmap.height,
  333. lock_bitmap, lock_bitmap.rect)
  334. end
  335. end
  336. end
  337. def item_rect(index)
  338. rect = Rect.new(0, 0, 0, 0)
  339. rect.width = (contents.width + @spacing) / @column_max - @spacing
  340. rect.height = 32
  341. rect.x = index % @column_max * (rect.width + @spacing)
  342. rect.y = index / @column_max * 32
  343. return rect
  344. end
  345. end

点评

我的表弟@奇奇 因等级不够,不能点评主楼,我特地为他转达他对LZ的谢意  发表于 2014-5-1 13:32

Lv1.梦旅人

梦石
0
星屑
50
在线时间
108 小时
注册时间
2014-5-1
帖子
220
2
发表于 2014-4-30 20:07:58 | 只看该作者
Project1.rar (244.99 KB, 下载次数: 79)

评分

参与人数 1星屑 +10 收起 理由
77767264 + 10 认可答案

查看全部评分

回复

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-11-15 12:22

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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