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

Project1

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

[已经过期] 使用了装备拓展脚本 如何将商店购买时的提示也统一一下?

[复制链接]

Lv3.寻梦者 (版主)

  /) /)<

梦石
0
星屑
4212
在线时间
4890 小时
注册时间
2009-2-16
帖子
8434

开拓者短篇七成年组季军

跳转到指定楼层
1
发表于 2010-9-1 21:29:23 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
这个脚本把装备扩充为9种
这个时候想设置新装备就要在装备后面名字加序号 列表中装备种类为“盾牌”
比如“饰品II,4”“头上,7”“头中下,8”
这时候在商店购买时提示是混乱的 比如你买头饰他会提示你现在穿的鞋..
请问如何改可以让各类装备提示对应? 谢谢啦~

装备拓充脚本:
  1. # ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  2. #
  3. # <SPAN class=t_tag onclick=tagshow(event) href="tag.php?name=%B7%C0%BE%DF">防具</SPAN>类追加
  4. #
  5. # ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  6. module <SPAN class=t_tag onclick=tagshow(event) href="tag.php?name=RPG">RPG</SPAN>
  7. class Armor
  8. def name
  9. name = @name.split(/,/)[0]
  10. return name != nil ? name : ''
  11. end
  12. def kind
  13. kind = @name.split(/,/)[1]
  14. return kind != nil ? kind.to_i : @kind
  15. end
  16. end
  17. end
  18. # ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  19. #
  20. # Game_Actor添加新的防具ID,并对相关方法修正
  21. #
  22. # ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  23. class Game_Actor < Game_Battler
  24. attr_reader :armor5_id # 装饰品 ID
  25. attr_reader :armor6_id # 鞋 ID
  26. attr_reader :armor7_id # 披挂 ID (已和头上交换)
  27. attr_reader :armor8_id # 头中/下 ID
  28. #--------------------------------------------------------------------------
  29. # ● 设置
  30. # actor_id : <SPAN class=t_tag onclick=tagshow(event) href="tag.php?name=%BD%C7%C9%AB">角色</SPAN> ID
  31. #--------------------------------------------------------------------------
  32. alias old_setup setup
  33. def setup(actor_id)
  34. old_setup(actor_id)
  35. @armor5_id = 0
  36. @armor6_id = 0
  37. @armor7_id = 0
  38. @armor8_id = 0
  39. update_auto_state(nil, $data_armors[@armor5_id])
  40. update_auto_state(nil, $data_armors[@armor6_id])
  41. update_auto_state(nil, $data_armors[@armor7_id])
  42. update_auto_state(nil, $data_armors[@armor8_id])
  43. end
  44. #--------------------------------------------------------------------------
  45. # ● 取得<SPAN class=t_tag onclick=tagshow(event) href="tag.php?name=%CA%F4%D0%D4">属性</SPAN>修正值
  46. # element_id : 属性 ID
  47. #--------------------------------------------------------------------------
  48. def element_rate(element_id)
  49. # 获取对应属性有效度的数值
  50. table = [0,200,150,100,50,0,-100]
  51. result = table[$data_classes[@class_id].element_ranks[element_id]]
  52. # 防具能防御本属性的情况下<SPAN class=t_tag onclick=tagshow(event) href="tag.php?name=%D0%A7%B9%FB">效果</SPAN>减半
  53. for i in [@armor1_id, @armor2_id, @armor3_id, @armor4_id, @armor5_id, @armor6_id]
  54. armor = $data_armors[i]
  55. if armor != nil and armor.guard_element_set.include?(element_id)
  56. result /= 2
  57. end
  58. end
  59. # 状态能防御本属性的情况下效果减半
  60. for i in @states
  61. if $data_states[i].guard_element_set.include?(element_id)
  62. result /= 2
  63. end
  64. end
  65. # 过程结束
  66. return result
  67. end
  68. #--------------------------------------------------------------------------
  69. # ● 判定防御属性
  70. # state_id : 属性 ID
  71. #--------------------------------------------------------------------------
  72. def state_guard?(state_id)
  73. for i in [@armor1_id, @armor2_id, @armor3_id, @armor4_id, @armor5_id, @armor6_id]
  74. armor = $data_armors[i]
  75. if armor != nil
  76. if armor.guard_state_set.include?(state_id)
  77. return true
  78. end
  79. end
  80. end
  81. return false
  82. end
  83. #--------------------------------------------------------------------------
  84. # ● 获取基本力量
  85. #--------------------------------------------------------------------------
  86. def base_str
  87. n = $data_actors[@actor_id].parameters[2, @level]
  88. weapon = $data_weapons[@weapon_id]
  89. armor1 = $data_armors[@armor1_id]
  90. armor2 = $data_armors[@armor2_id]
  91. armor3 = $data_armors[@armor3_id]
  92. armor4 = $data_armors[@armor4_id]
  93. armor5 = $data_armors[@armor5_id]
  94. armor6 = $data_armors[@armor6_id]
  95. armor7 = $data_armors[@armor7_id]
  96. armor8 = $data_armors[@armor8_id]
  97. n += weapon != nil ? weapon.str_plus : 0
  98. n += armor1 != nil ? armor1.str_plus : 0
  99. n += armor2 != nil ? armor2.str_plus : 0
  100. n += armor3 != nil ? armor3.str_plus : 0
  101. n += armor4 != nil ? armor4.str_plus : 0
  102. n += armor5 != nil ? armor5.str_plus : 0
  103. n += armor6 != nil ? armor6.str_plus : 0
  104. n += armor7 != nil ? armor7.str_plus : 0
  105. n += armor8 != nil ? armor8.str_plus : 0
  106. return [[n, 1].max, 999].min
  107. end
  108. #--------------------------------------------------------------------------
  109. # ● 获取基本灵巧
  110. #--------------------------------------------------------------------------
  111. def base_dex
  112. n = $data_actors[@actor_id].parameters[3, @level]
  113. weapon = $data_weapons[@weapon_id]
  114. armor1 = $data_armors[@armor1_id]
  115. armor2 = $data_armors[@armor2_id]
  116. armor3 = $data_armors[@armor3_id]
  117. armor4 = $data_armors[@armor4_id]
  118. armor5 = $data_armors[@armor5_id]
  119. armor6 = $data_armors[@armor6_id]
  120. armor7 = $data_armors[@armor7_id]
  121. armor8 = $data_armors[@armor8_id]
  122. n += weapon != nil ? weapon.dex_plus : 0
  123. n += armor1 != nil ? armor1.dex_plus : 0
  124. n += armor2 != nil ? armor2.dex_plus : 0
  125. n += armor3 != nil ? armor3.dex_plus : 0
  126. n += armor4 != nil ? armor4.dex_plus : 0
  127. n += armor5 != nil ? armor5.dex_plus : 0
  128. n += armor6 != nil ? armor6.dex_plus : 0
  129. n += armor7 != nil ? armor7.str_plus : 0
  130. n += armor8 != nil ? armor8.str_plus : 0
  131. return [[n, 1].max, 999].min
  132. end
  133. #--------------------------------------------------------------------------
  134. # ● 获取基本速度
  135. #--------------------------------------------------------------------------
  136. def base_agi
  137. n = $data_actors[@actor_id].parameters[4, @level]
  138. weapon = $data_weapons[@weapon_id]
  139. armor1 = $data_armors[@armor1_id]
  140. armor2 = $data_armors[@armor2_id]
  141. armor3 = $data_armors[@armor3_id]
  142. armor4 = $data_armors[@armor4_id]
  143. armor5 = $data_armors[@armor5_id]
  144. armor6 = $data_armors[@armor6_id]
  145. armor7 = $data_armors[@armor7_id]
  146. armor8 = $data_armors[@armor8_id]
  147. n += weapon != nil ? weapon.agi_plus : 0
  148. n += armor1 != nil ? armor1.agi_plus : 0
  149. n += armor2 != nil ? armor2.agi_plus : 0
  150. n += armor3 != nil ? armor3.agi_plus : 0
  151. n += armor4 != nil ? armor4.agi_plus : 0
  152. n += armor5 != nil ? armor5.agi_plus : 0
  153. n += armor6 != nil ? armor6.agi_plus : 0
  154. n += armor7 != nil ? armor7.str_plus : 0
  155. n += armor8 != nil ? armor8.str_plus : 0
  156. return [[n, 1].max, 999].min
  157. end
  158. #--------------------------------------------------------------------------
  159. # ● 获取基本魔力
  160. #--------------------------------------------------------------------------
  161. def base_int
  162. n = $data_actors[@actor_id].parameters[5, @level]
  163. weapon = $data_weapons[@weapon_id]
  164. armor1 = $data_armors[@armor1_id]
  165. armor2 = $data_armors[@armor2_id]
  166. armor3 = $data_armors[@armor3_id]
  167. armor4 = $data_armors[@armor4_id]
  168. armor5 = $data_armors[@armor5_id]
  169. armor6 = $data_armors[@armor6_id]
  170. armor7 = $data_armors[@armor7_id]
  171. armor8 = $data_armors[@armor8_id]
  172. n += weapon != nil ? weapon.int_plus : 0
  173. n += armor1 != nil ? armor1.int_plus : 0
  174. n += armor2 != nil ? armor2.int_plus : 0
  175. n += armor3 != nil ? armor3.int_plus : 0
  176. n += armor4 != nil ? armor4.int_plus : 0
  177. n += armor5 != nil ? armor5.int_plus : 0
  178. n += armor6 != nil ? armor6.int_plus : 0
  179. n += armor7 != nil ? armor7.str_plus : 0
  180. n += armor8 != nil ? armor8.str_plus : 0
  181. return [[n, 1].max, 999].min
  182. end
  183. #--------------------------------------------------------------------------
  184. # ● 获取基本物理防御
  185. #--------------------------------------------------------------------------
  186. def base_pdef
  187. weapon = $data_weapons[@weapon_id]
  188. armor1 = $data_armors[@armor1_id]
  189. armor2 = $data_armors[@armor2_id]
  190. armor3 = $data_armors[@armor3_id]
  191. armor4 = $data_armors[@armor4_id]
  192. armor5 = $data_armors[@armor5_id]
  193. armor6 = $data_armors[@armor6_id]
  194. armor7 = $data_armors[@armor7_id]
  195. armor8 = $data_armors[@armor8_id]
  196. pdef1 = weapon != nil ? weapon.pdef : 0
  197. pdef2 = armor1 != nil ? armor1.pdef : 0
  198. pdef3 = armor2 != nil ? armor2.pdef : 0
  199. pdef4 = armor3 != nil ? armor3.pdef : 0
  200. pdef5 = armor4 != nil ? armor4.pdef : 0
  201. pdef6 = armor5 != nil ? armor5.pdef : 0
  202. pdef7 = armor6 != nil ? armor6.pdef : 0
  203. pdef8 = armor7 != nil ? armor7.pdef : 0
  204. pdef9 = armor8 != nil ? armor8.pdef : 0
  205. return pdef1 + pdef2 + pdef3 + pdef4 + pdef5 + pdef6 + pdef7 + pdef8 + pdef9
  206. end
  207. #--------------------------------------------------------------------------
  208. # ● 获取基本魔法防御
  209. #--------------------------------------------------------------------------
  210. def base_mdef
  211. weapon = $data_weapons[@weapon_id]
  212. armor1 = $data_armors[@armor1_id]
  213. armor2 = $data_armors[@armor2_id]
  214. armor3 = $data_armors[@armor3_id]
  215. armor4 = $data_armors[@armor4_id]
  216. armor5 = $data_armors[@armor5_id]
  217. armor6 = $data_armors[@armor6_id]
  218. armor7 = $data_armors[@armor7_id]
  219. armor8 = $data_armors[@armor8_id]
  220. mdef1 = weapon != nil ? weapon.mdef : 0
  221. mdef2 = armor1 != nil ? armor1.mdef : 0
  222. mdef3 = armor2 != nil ? armor2.mdef : 0
  223. mdef4 = armor3 != nil ? armor3.mdef : 0
  224. mdef5 = armor4 != nil ? armor4.mdef : 0
  225. mdef6 = armor5 != nil ? armor5.mdef : 0
  226. mdef7 = armor6 != nil ? armor6.mdef : 0
  227. mdef8 = armor7 != nil ? armor7.mdef : 0
  228. mdef9 = armor8 != nil ? armor8.mdef : 0
  229. return mdef1 + mdef2 + mdef3 + mdef4 + mdef5 + mdef6 + mdef7 + mdef8 + mdef9
  230. end
  231. #--------------------------------------------------------------------------
  232. # ● 获取基本回避修正
  233. #--------------------------------------------------------------------------
  234. def base_eva
  235. armor1 = $data_armors[@armor1_id]
  236. armor2 = $data_armors[@armor2_id]
  237. armor3 = $data_armors[@armor3_id]
  238. armor4 = $data_armors[@armor4_id]
  239. armor5 = $data_armors[@armor5_id]
  240. armor6 = $data_armors[@armor6_id]
  241. armor7 = $data_armors[@armor7_id]
  242. armor8 = $data_armors[@armor8_id]
  243. eva1 = armor1 != nil ? armor1.eva : 0
  244. eva2 = armor2 != nil ? armor2.eva : 0
  245. eva3 = armor3 != nil ? armor3.eva : 0
  246. eva4 = armor4 != nil ? armor4.eva : 0
  247. eva5 = armor5 != nil ? armor5.eva : 0
  248. eva6 = armor6 != nil ? armor6.eva : 0
  249. eva7 = armor7 != nil ? armor7.eva : 0
  250. eva8 = armor8 != nil ? armor8.eva : 0
  251. return eva1 + eva2 + eva3 + eva4 + eva5 + eva6 + eva7 + eva8
  252. end
  253. #--------------------------------------------------------------------------
  254. # ● 装备固定判定
  255. # equip_type : 装备类型
  256. #--------------------------------------------------------------------------
  257. def equip_fix?(equip_type)
  258. case equip_type
  259. when 0 # <SPAN class=t_tag onclick=tagshow(event) href="tag.php?name=%CE%E4%C6%F7">武器</SPAN>
  260. return $data_actors[@actor_id].weapon_fix
  261. when 1 # 盾
  262. return $data_actors[@actor_id].armor1_fix
  263. when 2 # 头
  264. return $data_actors[@actor_id].armor2_fix
  265. when 3 # 身体
  266. return $data_actors[@actor_id].armor3_fix
  267. when 4 # 装饰品
  268. return $data_actors[@actor_id].armor4_fix
  269. end
  270. return false
  271. end
  272. #--------------------------------------------------------------------------
  273. # ● 变更装备
  274. # equip_type : 装备类型
  275. # id : 武器 or 防具 ID (0 为解除装备)
  276. #--------------------------------------------------------------------------
  277. def equip(equip_type, id)
  278. case equip_type
  279. when 0 # 武器
  280. if id == 0 or $game_party.weapon_number(id) > 0
  281. $game_party.gain_weapon(@weapon_id, 1)
  282. @weapon_id = id
  283. $game_party.lose_weapon(id, 1)
  284. end
  285. when 1 # 盾
  286. if id == 0 or $game_party.armor_number(id) > 0
  287. update_auto_state($data_armors[@armor1_id], $data_armors[id])
  288. $game_party.gain_armor(@armor1_id, 1)
  289. @armor1_id = id
  290. $game_party.lose_armor(id, 1)
  291. end
  292. when 2 # 头
  293. if id == 0 or $game_party.armor_number(id) > 0
  294. update_auto_state($data_armors[@armor2_id], $data_armors[id])
  295. $game_party.gain_armor(@armor2_id, 1)
  296. @armor2_id = id
  297. $game_party.lose_armor(id, 1)
  298. end
  299. when 3 # 身体
  300. if id == 0 or $game_party.armor_number(id) > 0
  301. update_auto_state($data_armors[@armor3_id], $data_armors[id])
  302. $game_party.gain_armor(@armor3_id, 1)
  303. @armor3_id = id
  304. $game_party.lose_armor(id, 1)
  305. end
  306. when 4 # 装饰品
  307. if id == 0 or $game_party.armor_number(id) > 0
  308. update_auto_state($data_armors[@armor4_id], $data_armors[id])
  309. $game_party.gain_armor(@armor4_id, 1)
  310. @armor4_id = id
  311. $game_party.lose_armor(id, 1)
  312. end
  313. when 5 # 装饰品2
  314. if id == 0 or $game_party.armor_number(id) > 0
  315. update_auto_state($data_armors[@armor5_id], $data_armors[id])
  316. $game_party.gain_armor(@armor5_id, 1)
  317. @armor5_id = id
  318. $game_party.lose_armor(id, 1)
  319. end
  320. when 6 # 鞋
  321. if id == 0 or $game_party.armor_number(id) > 0
  322. update_auto_state($data_armors[@armor6_id], $data_armors[id])
  323. $game_party.gain_armor(@armor6_id, 1)
  324. @armor6_id = id
  325. $game_party.lose_armor(id, 1)
  326. end
  327. when 7 # 披挂
  328. if id == 0 or $game_party.armor_number(id) > 0
  329. update_auto_state($data_armors[@armor7_id], $data_armors[id])
  330. $game_party.gain_armor(@armor7_id, 1)
  331. @armor7_id = id
  332. $game_party.lose_armor(id, 1)
  333. end
  334. when 8 # 头中/下
  335. if id == 0 or $game_party.armor_number(id) > 0
  336. update_auto_state($data_armors[@armor8_id], $data_armors[id])
  337. $game_party.gain_armor(@armor8_id, 1)
  338. @armor8_id = id
  339. $game_party.lose_armor(id, 1)
  340. end
  341. end
  342. end
  343. #--------------------------------------------------------------------------
  344. # ● 更改职业 ID
  345. # class_id : 新的职业 ID
  346. #--------------------------------------------------------------------------
  347. def class_id=(class_id)
  348. if $data_classes[class_id] != nil
  349. @class_id = class_id
  350. # 避开无法装备的<SPAN class=t_tag onclick=tagshow(event) href="tag.php?name=%CE%EF%C6%B7">物品</SPAN>
  351. unless equippable?($data_weapons[@weapon_id])
  352. equip(0, 0)
  353. end
  354. unless equippable?($data_armors[@armor1_id])
  355. equip(1, 0)
  356. end
  357. unless equippable?($data_armors[@armor2_id])
  358. equip(2, 0)
  359. end
  360. unless equippable?($data_armors[@armor3_id])
  361. equip(3, 0)
  362. end
  363. unless equippable?($data_armors[@armor4_id])
  364. equip(4, 0)
  365. end
  366. unless equippable?($data_armors[@armor5_id])
  367. equip(5, 0)
  368. end
  369. unless equippable?($data_armors[@armor6_id])
  370. equip(6, 0)
  371. end
  372. unless equippable?($data_armors[@armor7_id])
  373. equip(7, 0)
  374. end
  375. unless equippable?($data_armors[@armor8_id])
  376. equip(8, 0)
  377. end
  378. end
  379. end
  380. end
  381. # ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  382. #
  383. # Window_Base美化,增加属性增减颜色,及全能力值描绘
  384. #
  385. # ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  386. #==============================================================================
  387. # ■ Window_Base
  388. #------------------------------------------------------------------------------
  389. #  <SPAN class=t_tag onclick=tagshow(event) href="tag.php?name=%D3%CE%CF%B7">游戏</SPAN>中全部窗口的<SPAN class=t_tag onclick=tagshow(event) href="tag.php?name=%B3%AC%BC%B6">超级</SPAN>类。
  390. #==============================================================================

  391. class Window_Base < Window
  392. ################## 属性增减颜色 ##############################
  393. def up_color
  394. return Color.new(255, 0, 0)
  395. end
  396. def down_color
  397. return Color.new(0, 255, 0)
  398. end
  399. #--------------------------------------------------------------------------
  400. # ● 描绘能力值
  401. # actor : 角色
  402. # x : 描画目标 X 坐标
  403. # y : 描画目标 Y 坐标
  404. # type : 能力值种类 (0~6)
  405. #--------------------------------------------------------------------------
  406. def draw_actor_parameter(actor, x, y, type)
  407. case type
  408. when 0
  409. parameter_name = $data_system.words.atk
  410. parameter_value = actor.atk
  411. when 1
  412. parameter_name = $data_system.words.pdef
  413. parameter_value = actor.pdef
  414. when 2
  415. parameter_name = $data_system.words.mdef
  416. parameter_value = actor.mdef
  417. when 3
  418. parameter_name = $data_system.words.str
  419. parameter_value = actor.str
  420. when 4
  421. parameter_name = $data_system.words.dex
  422. parameter_value = actor.dex
  423. when 5
  424. parameter_name = $data_system.words.agi
  425. parameter_value = actor.agi
  426. when 6
  427. parameter_name = $data_system.words.int
  428. parameter_value = actor.int
  429. when 7
  430. parameter_name = "回避"
  431. parameter_value = actor.eva
  432. end
  433. self.contents.font.color = system_color
  434. self.contents.draw_text(x, y, 120, 32, parameter_name)
  435. self.contents.font.color = normal_color
  436. self.contents.draw_text(x + 120, y, 36, 32, parameter_value.to_s, 2)
  437. end
  438. end
  439. # ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  440. #
  441. # 装备窗口美化,全能力值描绘并追加新的防具装备栏
  442. #
  443. # ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  444. #==============================================================================
  445. # ■ Window_EquipRight
  446. #------------------------------------------------------------------------------
  447. #  装备画面、显示角色现在装备的物品的窗口。
  448. #==============================================================================

  449. class Window_EquipRight < Window_Selectable
  450. #--------------------------------------------------------------------------
  451. # ● 初始化对像
  452. # actor : 角色
  453. #--------------------------------------------------------------------------
  454. def initialize(actor)
  455. super(272, 64, 368, 256)
  456. self.contents = Bitmap.new(width - 32, height - 32)
  457. @actor = actor
  458. refresh
  459. self.index = 0
  460. @column_max = 1
  461. end
  462. #--------------------------------------------------------------------------
  463. # ● 刷新
  464. #--------------------------------------------------------------------------
  465. def refresh
  466. self.contents.clear
  467. @data = []
  468. @data.push($data_weapons[@actor.weapon_id])
  469. @data.push($data_armors[@actor.armor1_id])
  470. @data.push($data_armors[@actor.armor2_id])
  471. @data.push($data_armors[@actor.armor3_id])
  472. @data.push($data_armors[@actor.armor4_id])
  473. @data.push($data_armors[@actor.armor5_id])
  474. @data.push($data_armors[@actor.armor6_id])
  475. @data.push($data_armors[@actor.armor7_id])
  476. @data.push($data_armors[@actor.armor8_id])
  477. @item_max = @data.size
  478. self.contents = Bitmap.new(width - 32, row_max * 32)
  479. self.contents.font.color = system_color
  480. self.contents.draw_text(4, 32 * 0, 92, 32, $data_system.words.weapon)
  481. self.contents.draw_text(4, 32 * 1, 92, 32, $data_system.words.armor1)
  482. self.contents.draw_text(4, 32 * 2, 92, 32, $data_system.words.armor2)
  483. self.contents.draw_text(4, 32 * 3, 92, 32, $data_system.words.armor3)
  484. self.contents.draw_text(4, 32 * 4, 92, 32, $data_system.words.armor4)
  485. self.contents.draw_text(4, 32 * 5, 92, 32, "饰品II")
  486. self.contents.draw_text(4, 32 * 6, 92, 32, "鞋子")
  487. self.contents.draw_text(4, 32 * 7, 92, 32, "头饰上")
  488. self.contents.draw_text(4, 32 * 8, 92, 32, "头饰中下")
  489. draw_item_name(@data[0], 92, 32 * 0)
  490. draw_item_name(@data[1], 92, 32 * 1)
  491. draw_item_name(@data[2], 92, 32 * 2)
  492. draw_item_name(@data[3], 92, 32 * 3)
  493. draw_item_name(@data[4], 92, 32 * 4)
  494. draw_item_name(@data[5], 92, 32 * 5)
  495. draw_item_name(@data[6], 92, 32 * 6)
  496. draw_item_name(@data[7], 92, 32 * 7)
  497. draw_item_name(@data[8], 92, 32 * 8)
  498. end
  499. end

  500. #==============================================================================
  501. # ■ Window_EquipLeft
  502. #------------------------------------------------------------------------------
  503. #  装备画面的、显示角色能力值变化的窗口。
  504. #==============================================================================

  505. class Window_EquipLeft < Window_Base
  506. #--------------------------------------------------------------------------
  507. # ● 初始化对像
  508. # actor : 角色
  509. #--------------------------------------------------------------------------
  510. def initialize(actor)
  511. super(0, 64, 272, 416)
  512. self.contents = Bitmap.new(width - 32, height - 32)
  513. @actor = actor
  514. refresh
  515. end
  516. #--------------------------------------------------------------------------
  517. # ● 刷新
  518. #--------------------------------------------------------------------------
  519. def refresh
  520. self.contents.clear
  521. draw_actor_name(@actor, 4, 0)
  522. draw_actor_level(@actor, 4, 32)

  523. draw_actor_parameter(@actor, 4, 64, 0)
  524. draw_actor_parameter(@actor, 4, 96, 1)
  525. draw_actor_parameter(@actor, 4, 128, 2)
  526. draw_actor_parameter(@actor, 4, 160, 7)
  527. draw_actor_parameter(@actor, 4, 192, 3)
  528. draw_actor_parameter(@actor, 4, 224, 4)
  529. draw_actor_parameter(@actor, 4, 256, 5)
  530. draw_actor_parameter(@actor, 4, 288, 6)
  531. # draw_actor_parameter(@actor, 4, 320, 7)
  532. # draw_actor_parameter(@actor, 4, 352, 8)
  533. if @new_atk != nil
  534. self.contents.font.color = system_color
  535. self.contents.draw_text(160, 64, 40, 32, "→", 1)
  536. self.contents.font.color = @new_atk>@actor.atk ? up_color : down_color
  537. self.contents.font.color = normal_color if @new_atk == @actor.atk
  538. self.contents.draw_text(200, 64, 36, 32, @new_atk.to_s, 2)
  539. end
  540. if @new_pdef != nil
  541. self.contents.font.color = system_color
  542. self.contents.draw_text(160, 96, 40, 32, "→", 1)
  543. self.contents.font.color = @new_pdef>@actor.pdef ? up_color : down_color
  544. self.contents.font.color = normal_color if @new_pdef == @actor.pdef
  545. self.contents.draw_text(200, 96, 36, 32, @new_pdef.to_s, 2)
  546. end
  547. if @new_mdef != nil
  548. self.contents.font.color = system_color
  549. self.contents.draw_text(160, 128, 40, 32, "→", 1)
  550. self.contents.font.color = @new_mdef>@actor.mdef ? up_color : down_color
  551. self.contents.font.color = normal_color if @new_mdef == @actor.mdef
  552. self.contents.draw_text(200, 128, 36, 32, @new_mdef.to_s, 2)
  553. end
  554. if @new_eva != nil
  555. self.contents.font.color = system_color
  556. self.contents.draw_text(160, 160, 40, 32, "→", 1)
  557. self.contents.font.color = @new_eva>@actor.eva ? up_color : down_color
  558. self.contents.font.color = normal_color if @new_eva == @actor.eva
  559. self.contents.draw_text(200, 160, 36, 32, @new_eva.to_s, 2)
  560. end
  561. if @new_str != nil
  562. self.contents.font.color = system_color
  563. self.contents.draw_text(160, 192, 40, 32, "→", 1)
  564. self.contents.font.color = @new_str>@actor.str ? up_color : down_color
  565. self.contents.font.color = normal_color if @new_str == @actor.str
  566. self.contents.draw_text(200, 192, 36, 32, @new_str.to_s, 2)
  567. end
  568. if @new_dex != nil
  569. self.contents.font.color = system_color
  570. self.contents.draw_text(160, 224, 40, 32, "→", 1)
  571. self.contents.font.color = @new_dex>@actor.dex ? up_color : down_color
  572. self.contents.font.color = normal_color if @new_dex == @actor.dex
  573. self.contents.draw_text(200, 224, 36, 32, @new_dex.to_s, 2)
  574. end
  575. if @new_agi != nil
  576. self.contents.font.color = system_color
  577. self.contents.draw_text(160, 256, 40, 32, "→", 1)
  578. self.contents.font.color = @new_agi>@actor.agi ? up_color : down_color
  579. self.contents.font.color = normal_color if @new_agi == @actor.agi
  580. self.contents.draw_text(200, 256, 36, 32, @new_agi.to_s, 2)
  581. end
  582. if @new_int != nil
  583. self.contents.font.color = system_color
  584. self.contents.draw_text(160, 288, 40, 32, "→", 1)
  585. self.contents.font.color = @new_int>@actor.int ? up_color : down_color
  586. self.contents.font.color = normal_color if @new_int == @actor.int
  587. self.contents.draw_text(200, 288, 36, 32, @new_int.to_s, 2)
  588. end
  589. end
  590. #--------------------------------------------------------------------------
  591. # ● 变更装备后的能力值设置
  592. # new_atk : 变更装备后的攻击力
  593. # new_pdef : 变更装备后的物理防御
  594. # new_mdef : 变更装备后的魔法防御
  595. #--------------------------------------------------------------------------
  596. def set_new_parameters(new_atk, new_pdef, new_mdef, new_eva, new_str, new_dex, new_agi, new_int)
  597. if @new_atk != new_atk or @new_pdef !=new_pdef or @new_mdef != new_mdef or @new_eva != new_eva or @new_str != new_str or @new_dex !=new_dex or @new_agi != new_agi or @new_int != new_int
  598. @new_atk = new_atk
  599. @new_pdef = new_pdef
  600. @new_mdef = new_mdef
  601. @new_eva = new_eva
  602. @new_str = new_str
  603. @new_dex = new_dex
  604. @new_agi = new_agi
  605. @new_int = new_int
  606. refresh
  607. end
  608. end
  609. end
  610. #==============================================================================
  611. # ■ Window_EquipItem
  612. #------------------------------------------------------------------------------
  613. #  装备画面、显示浏览变更装备的候补物品的窗口。
  614. #==============================================================================

  615. class Window_EquipItem < Window_Selectable
  616. #--------------------------------------------------------------------------
  617. # ● 初始化对像
  618. # actor : 角色
  619. # equip_type : 装备部位 (0~3)
  620. #--------------------------------------------------------------------------
  621. def initialize(actor, equip_type)
  622. super(272, 320, 368, 160)
  623. @actor = actor
  624. @equip_type = equip_type
  625. @column_max = 1
  626. refresh
  627. self.active = false
  628. self.index = -1
  629. end
  630. #--------------------------------------------------------------------------
  631. # ● 项目的描绘
  632. # index : 项目符号
  633. #--------------------------------------------------------------------------
  634. def draw_item(index)
  635. item = @data[index]
  636. x = 4
  637. y = index * 32
  638. case item
  639. when RPG::Weapon
  640. number = $game_party.weapon_number(item.id)
  641. when RPG::Armor
  642. number = $game_party.armor_number(item.id)
  643. end
  644. bitmap = RPG::Cache.icon(item.icon_name)
  645. self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
  646. self.contents.font.color = normal_color
  647. self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
  648. self.contents.draw_text(x + 240, y, 16, 32, ":", 1)
  649. self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
  650. end
  651. end

  652. class Scene_Equip
  653. #--------------------------------------------------------------------------
  654. # ● 主处理
  655. #--------------------------------------------------------------------------
  656. def main
  657. # 获取角色
  658. @actor = $game_party.actors[@actor_index]
  659. # 生成窗口
  660. @help_window = Window_Help.new
  661. @left_window = Window_EquipLeft.new(@actor)
  662. @right_window = Window_EquipRight.new(@actor)
  663. @item_window1 = Window_EquipItem.new(@actor, 0)
  664. @item_window2 = Window_EquipItem.new(@actor, 1)
  665. @item_window3 = Window_EquipItem.new(@actor, 2)
  666. @item_window4 = Window_EquipItem.new(@actor, 3)
  667. @item_window5 = Window_EquipItem.new(@actor, 4)
  668. @item_window6 = Window_EquipItem.new(@actor, 5)
  669. @item_window7 = Window_EquipItem.new(@actor, 6)
  670. @item_window8 = Window_EquipItem.new(@actor, 8)
  671. @item_window9 = Window_EquipItem.new(@actor, 9)
  672. # 关联帮助窗口
  673. @right_window.help_window = @help_window
  674. @item_window1.help_window = @help_window
  675. @item_window2.help_window = @help_window
  676. @item_window3.help_window = @help_window
  677. @item_window4.help_window = @help_window
  678. @item_window5.help_window = @help_window
  679. @item_window6.help_window = @help_window
  680. @item_window7.help_window = @help_window
  681. @item_window8.help_window = @help_window
  682. @item_window9.help_window = @help_window
  683. # 设置光标位置
  684. @right_window.index = @equip_index
  685. refresh
  686. # 执行过渡
  687. Graphics.transition
  688. # 主循环
  689. loop do
  690. # 刷新游戏画面
  691. Graphics.update
  692. # 刷新输入信息
  693. Input.update
  694. # 刷新画面
  695. update
  696. # 如果画面切换的话的就中断循环
  697. if $scene != self
  698. break
  699. end
  700. end
  701. # 准备过渡
  702. Graphics.freeze
  703. # 释放窗口
  704. @help_window.dispose
  705. @left_window.dispose
  706. @right_window.dispose
  707. @item_window1.dispose
  708. @item_window2.dispose
  709. @item_window3.dispose
  710. @item_window4.dispose
  711. @item_window5.dispose
  712. @item_window6.dispose
  713. @item_window7.dispose
  714. @item_window8.dispose
  715. @item_window9.dispose
  716. end
  717. #--------------------------------------------------------------------------
  718. # ● 刷新
  719. #--------------------------------------------------------------------------
  720. def refresh
  721. # 设置物品窗口的可视状态
  722. @item_window1.visible = (@right_window.index == 0)
  723. @item_window2.visible = (@right_window.index == 1)
  724. @item_window3.visible = (@right_window.index == 2)
  725. @item_window4.visible = (@right_window.index == 3)
  726. @item_window5.visible = (@right_window.index == 4)
  727. @item_window6.visible = (@right_window.index == 5)
  728. @item_window7.visible = (@right_window.index == 6)
  729. @item_window8.visible = (@right_window.index == 7)
  730. @item_window9.visible = (@right_window.index == 8)
  731. # 获取当前装备中的物品
  732. item1 = @right_window.item
  733. # 设置当前的物品窗口到 @item_window
  734. case @right_window.index
  735. when 0
  736. @item_window = @item_window1
  737. when 1
  738. @item_window = @item_window2
  739. when 2
  740. @item_window = @item_window3
  741. when 3
  742. @item_window = @item_window4
  743. when 4
  744. @item_window = @item_window5
  745. when 5
  746. @item_window = @item_window6
  747. when 6
  748. @item_window = @item_window7
  749. when 7
  750. @item_window = @item_window8
  751. when 8
  752. @item_window = @item_window9
  753. end
  754. # 右窗口被激活的情况下
  755. if @right_window.active
  756. # 删除变更装备后的能力
  757. ###############################################################
  758. @left_window.set_new_parameters(nil, nil, nil, nil, nil, nil, nil, nil)
  759. end
  760. # 物品窗口被激活的情况下
  761. if @item_window.active
  762. # 获取现在选中的物品
  763. item2 = @item_window.item
  764. # 变更装备
  765. last_hp = @actor.hp
  766. last_sp = @actor.sp
  767. @actor.equip(@right_window.index, item2 == nil ? 0 : item2.id)
  768. ###############################################################
  769. # 获取变更装备后的能力值
  770. new_atk = @actor.atk
  771. new_pdef = @actor.pdef
  772. new_mdef = @actor.mdef
  773. new_eva = @actor.eva
  774. new_str = @actor.str
  775. new_dex = @actor.dex
  776. new_agi = @actor.agi
  777. new_int = @actor.int
  778. # 返回到装备
  779. @actor.equip(@right_window.index, item1 == nil ? 0 : item1.id)
  780. @actor.hp = last_hp
  781. @actor.sp = last_sp
  782. # 描画左窗口
  783. ###############################################################
  784. @left_window.set_new_parameters(new_atk, new_pdef, new_mdef, new_eva, new_str, new_dex, new_agi, new_int)
  785. ###############################################################
  786. end
  787. end
  788. end
  789. # ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  790. #
  791. # 状态窗口美化,全防具装备栏描绘
  792. #
  793. # ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  794. #==============================================================================
  795. # ■ Window_Status
  796. #------------------------------------------------------------------------------
  797. #  显示状态画面、完全规格的状态窗口。
  798. #==============================================================================

  799. class Window_Status < Window_Base
  800. #--------------------------------------------------------------------------
  801. # ● 刷新
  802. #--------------------------------------------------------------------------
  803. def refresh
  804. self.contents.clear
  805. draw_actor_graphic(@actor, 40, 112)
  806. draw_actor_name(@actor, 4, 0)
  807. draw_actor_class(@actor, 4 + 144, 0)
  808. draw_actor_level(@actor, 96, 32)
  809. draw_actor_state(@actor, 96, 64)
  810. draw_actor_hp(@actor, 96, 112, 172)
  811. draw_actor_sp(@actor, 96, 144, 172)
  812. draw_actor_parameter(@actor, 96, 192, 0)
  813. draw_actor_parameter(@actor, 96, 224, 1)
  814. draw_actor_parameter(@actor, 96, 256, 2)
  815. draw_actor_parameter(@actor, 96, 304, 3)
  816. draw_actor_parameter(@actor, 96, 336, 4)
  817. draw_actor_parameter(@actor, 96, 368, 5)
  818. draw_actor_parameter(@actor, 96, 400, 6)
  819. self.contents.font.color = system_color
  820. self.contents.draw_text(320, 48, 80, 32, "EXP")
  821. self.contents.draw_text(320, 80, 80, 32, "NEXT")
  822. self.contents.font.color = normal_color
  823. self.contents.draw_text(320 + 80, 48, 84, 32, @actor.exp_s, 2)
  824. self.contents.draw_text(320 + 80, 80, 84, 32, @actor.next_rest_exp_s, 2)
  825. self.contents.font.color = system_color
  826. self.contents.draw_text(320, 160, 96, 32, "装备")
  827. draw_item_name($data_weapons[@actor.weapon_id], 320 + 16, 208)
  828. draw_item_name($data_armors[@actor.armor1_id], 320 + 16, 240)
  829. draw_item_name($data_armors[@actor.armor2_id], 320 + 16, 272)
  830. draw_item_name($data_armors[@actor.armor3_id], 320 + 16, 304)
  831. draw_item_name($data_armors[@actor.armor4_id], 320 + 16, 336)
  832. draw_item_name($data_armors[@actor.armor5_id], 320 + 16, 368)
  833. draw_item_name($data_armors[@actor.armor6_id], 320 + 16, 400)
  834. end
  835. def dummy
  836. self.contents.font.color = system_color
  837. self.contents.draw_text(320, 112, 96, 32, $data_system.words.weapon)
  838. self.contents.draw_text(320, 176, 96, 32, $data_system.words.armor1)
  839. self.contents.draw_text(320, 240, 96, 32, $data_system.words.armor2)
  840. self.contents.draw_text(320, 304, 96, 32, $data_system.words.armor3)
  841. self.contents.draw_text(320, 368, 96, 32, $data_system.words.armor4)
  842. draw_item_name($data_weapons[@actor.weapon_id], 320 + 24, 144)
  843. draw_item_name($data_armors[@actor.armor1_id], 320 + 24, 208)
  844. draw_item_name($data_armors[@actor.armor2_id], 320 + 24, 272)
  845. draw_item_name($data_armors[@actor.armor3_id], 320 + 24, 336)
  846. draw_item_name($data_armors[@actor.armor4_id], 320 + 24, 400)
  847. end
  848. end
  849. # ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  850. #
  851. # 商店购买窗口美化,增加对新装备位置的描述
  852. #
  853. # ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  854. #==============================================================================
  855. # ■ Window_ShopStatus
  856. #------------------------------------------------------------------------------
  857. #  商店画面、显示物品所持数与角色装备的窗口。
  858. #==============================================================================

  859. class Window_ShopStatus < Window_Base
  860. #--------------------------------------------------------------------------
  861. # ● 刷新
  862. #--------------------------------------------------------------------------
  863. def refresh
  864. self.contents.clear
  865. if @item == nil
  866. return
  867. end
  868. case @item
  869. when RPG::Item
  870. number = $game_party.item_number(@item.id)
  871. when RPG::Weapon
  872. number = $game_party.weapon_number(@item.id)
  873. when RPG::Armor
  874. number = $game_party.armor_number(@item.id)
  875. end
  876. self.contents.font.color = system_color
  877. self.contents.draw_text(4, 0, 200, 32, "拥有")
  878. self.contents.font.color = normal_color
  879. self.contents.draw_text(204, 0, 32, 32, number.to_s, 2)
  880. if @item.is_a?(RPG::Item)
  881. return
  882. end
  883. # 添加装备品信息
  884. for i in 0...$game_party.actors.size
  885. # 获取角色
  886. actor = $game_party.actors[i]
  887. # 可以装备为普通文字颜色、不能装备设置为无效文字颜色
  888. if actor.equippable?(@item)
  889. self.contents.font.color = normal_color
  890. else
  891. self.contents.font.color = disabled_color
  892. end
  893. # 描绘角色名字
  894. self.contents.draw_text(4, 64 + 64 * i, 120, 32, actor.name)
  895. # 获取当前的装备品
  896. if @item.is_a?(RPG::Weapon)
  897. item1 = $data_weapons[actor.weapon_id]
  898. elsif @item.kind == 0
  899. item1 = $data_armors[actor.armor1_id]
  900. elsif @item.kind == 1
  901. item1 = $data_armors[actor.armor2_id]
  902. elsif @item.kind == 2
  903. item1 = $data_armors[actor.armor3_id]
  904. elsif @item.kind == 3
  905. item1 = $data_armors[actor.armor4_id]
  906. elsif @item.kind == 4
  907. item1 = $data_armors[actor.armor5_id]
  908. else# if @item.kind == 5
  909. item1 = $data_armors[actor.armor6_id]
  910. end
  911. # 可以装备的情况
  912. if actor.equippable?(@item)
  913. # 武器的情况
  914. if @item.is_a?(RPG::Weapon)
  915. atk1 = item1 != nil ? item1.atk : 0
  916. atk2 = @item != nil ? @item.atk : 0
  917. change = atk2 - atk1
  918. end
  919. # 防具的情况
  920. if @item.is_a?(RPG::Armor)
  921. pdef1 = item1 != nil ? item1.pdef : 0
  922. mdef1 = item1 != nil ? item1.mdef : 0
  923. pdef2 = @item != nil ? @item.pdef : 0
  924. mdef2 = @item != nil ? @item.mdef : 0
  925. change = pdef2 - pdef1 + mdef2 - mdef1
  926. end
  927. # 描绘能力值变化
  928. self.contents.draw_text(124, 64 + 64 * i, 112, 32,
  929. sprintf("%+d", change), 2)
  930. end
  931. # 描绘物品
  932. if item1 != nil
  933. x = 4
  934. y = 64 + 64 * i + 32
  935. bitmap = RPG::Cache.icon(item1.icon_name)
  936. opacity = self.contents.font.color == normal_color ? 255 : 128
  937. self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
  938. self.contents.draw_text(x + 28, y, 212, 32, item1.name)
  939. end
  940. end
  941. end
  942. end
复制代码

Lv5.捕梦者 (管理员)

老黄鸡

梦石
0
星屑
42404
在线时间
7602 小时
注册时间
2009-7-6
帖子
13506

开拓者贵宾

2
发表于 2010-9-2 06:48:58 | 只看该作者
修改这里把
  1. self.contents.draw_text(4, 32 * 0, 92, 32, $data_system.words.weapon)

  2. self.contents.draw_text(4, 32 * 1, 92, 32, $data_system.words.armor1)

  3. self.contents.draw_text(4, 32 * 2, 92, 32, $data_system.words.armor2)

  4. self.contents.draw_text(4, 32 * 3, 92, 32, $data_system.words.armor3)

  5. self.contents.draw_text(4, 32 * 4, 92, 32, $data_system.words.armor4)

  6. self.contents.draw_text(4, 32 * 5, 92, 32, "饰品II")

  7. self.contents.draw_text(4, 32 * 6, 92, 32, "鞋子")

  8. self.contents.draw_text(4, 32 * 7, 92, 32, "头饰上")

  9. self.contents.draw_text(4, 32 * 8, 92, 32, "头饰中下")
复制代码
RGDirect - DirectX驱动的RGSS,点我了解.
RM全系列成套系统定制请联系QQ1213237796
不接受对其他插件维护的委托
回复 支持 反对

使用道具 举报

Lv3.寻梦者 (版主)

  /) /)<

梦石
0
星屑
4212
在线时间
4890 小时
注册时间
2009-2-16
帖子
8434

开拓者短篇七成年组季军

3
 楼主| 发表于 2010-9-2 13:24:01 | 只看该作者
修改这里把
fux2 发表于 2010-9-2 06:48

这里怎么改?
PS 这里貌似是描绘装备栏的?..我说的是商店里购买时候的数据对比提示

评分

参与人数 1星屑 -100 收起 理由
六祈 -100 愚者不是来帮忙的,只是来扣分的,不要连帖 ...

查看全部评分

回复 支持 反对

使用道具 举报

Lv3.寻梦者 (版主)

  /) /)<

梦石
0
星屑
4212
在线时间
4890 小时
注册时间
2009-2-16
帖子
8434

开拓者短篇七成年组季军

4
 楼主| 发表于 2010-9-3 14:01:09 | 只看该作者
顶下0 0
回复 支持 反对

使用道具 举报

Lv3.寻梦者 (版主)

  /) /)<

梦石
0
星屑
4212
在线时间
4890 小时
注册时间
2009-2-16
帖子
8434

开拓者短篇七成年组季军

5
 楼主| 发表于 2010-9-3 21:04:55 | 只看该作者
不会吧= = 这么难么..
回复 支持 反对

使用道具 举报

Lv3.寻梦者

宛若

梦石
0
星屑
1568
在线时间
526 小时
注册时间
2007-8-19
帖子
1493

极短24参与开拓者

6
发表于 2010-9-3 21:32:01 | 只看该作者
此脚本已有此功能- -
请看下下面有没有覆盖- -
[url=http://rpg.blue/thread-219730-1-1.html]http://unhero.sinaapp.com/wi.php[/url]
[color=Red]如你所见这是个死坑,没错这就是打我的脸用的[/color]
回复 支持 反对

使用道具 举报

Lv3.寻梦者 (版主)

  /) /)<

梦石
0
星屑
4212
在线时间
4890 小时
注册时间
2009-2-16
帖子
8434

开拓者短篇七成年组季军

7
 楼主| 发表于 2010-9-4 13:00:59 | 只看该作者
此脚本已有此功能- -
请看下下面有没有覆盖- -
逸豫 发表于 2010-9-3 21:32

不行.. 脚本放到最底下还是不能- -

回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-11-23 21:57

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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