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

Project1

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

[已经解决] 关于va的升级加点脚本

[复制链接]

Lv6.析梦学徒

老鹰

梦石
40
星屑
33422
在线时间
6553 小时
注册时间
2012-5-26
帖子
3178

极短24评委极短23参与极短22参与极短21评委老司机慢点开短篇十吟唱者组别冠军开拓者剧作品鉴家

跳转到指定楼层
1
发表于 2012-7-31 22:45:36 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 百里_飞柳 于 2012-8-2 12:58 编辑

升级加点脚本如下
  1. #原作者:superufo
  2. #转换者:消失的三千
  3. #原脚本出处:http://rpg.blue/thread-73243-1-1.html
  4. #要修改加点的属性在280~318行
  5. LEVEL_UP_POINT = 3 #升级时所获得的点数
  6. LEVEL_UP_VARIABLE = 50 #控制角色属性点的变量
  7. #比如说角色ID1的属性变量就是51,ID2就是52,依此推类

  8. class Game_Actor < Game_Battler
  9. def level_up
  10. @level += 1
  11. $game_variables[self.id + LEVEL_UP_VARIABLE] += LEVEL_UP_POINT
  12. for learning in self.class.learnings
  13. learn_skill(learning.skill_id) if learning.level == @level
  14. end
  15. end
  16. end

  17. class Window_PointCommand < Window_Command
  18. def initialize
  19. super(0, 0)
  20. open
  21. end
  22. def window_width
  23. return 128
  24. end
  25. def make_command_list
  26. add_command(Vocab::param(0), :HPBoost)
  27. add_command(Vocab::param(1), :MPBoost)
  28. add_command(Vocab::param(2), :ATKBoost)
  29. add_command(Vocab::param(3), :DEFBoost)
  30. add_command(Vocab::param(4), :MATBoost)
  31. add_command(Vocab::param(5), :MDFBoost)
  32. add_command(Vocab::param(6), :AGIBoost)
  33. add_command(Vocab::param(7), :LUKBoost)
  34. add_command("重叠加点", :PointReset)
  35. add_command("确认加点", :PointBoost)
  36. end
  37. def point_enought
  38. $point > 0
  39. end
  40. end

  41. class Window_Base < Window
  42. def draw_actor_hp_lvup(actor, x, y)
  43. self.contents.font.color = system_color
  44. self.contents.draw_text(x , y, 96, 32, Vocab::param(0))
  45. if $temp_hp == 0
  46. self.contents.font.color = normal_color
  47. self.contents.draw_text(x + 120 , y, 48, 32, actor.mhp.to_s, 2)
  48. else
  49. mhp = actor.mhp + $temp_hp
  50. self.contents.font.color = Color.new(255, 128, 128, 255)
  51. self.contents.draw_text(x + 120 , y, 48, 32, mhp.to_s ,2)
  52. self.contents.font.color = normal_color
  53. if $temp_hp >=0
  54. self.contents.font.color = Color.new(255, 128, 128, 255)
  55. self.contents.draw_text(x + 184, y, 36, 32, " +",2)
  56. else
  57. self.contents.font.color = Color.new(255,255,0,255)
  58. self.contents.draw_text(x + 184, y, 36, 32, " -",2)
  59. end
  60. self.contents.draw_text(x + 232, y, 32, 32, $temp_hp.to_s, 1)
  61. self.contents.font.color = normal_color
  62. end
  63. end
  64. def draw_actor_mp_lvup(actor, x, y)
  65. self.contents.font.color = system_color
  66. self.contents.draw_text(x , y, 96, 32, Vocab::param(1))
  67. if $temp_mp == 0
  68. self.contents.font.color = normal_color
  69. self.contents.draw_text(x + 120 , y, 48, 32, actor.mmp.to_s, 2)
  70. else
  71. mmp = actor.mmp + $temp_mp
  72. self.contents.font.color = Color.new(255, 128, 128, 255)
  73. self.contents.draw_text(x + 120 , y, 48, 32, mmp.to_s ,2)
  74. self.contents.font.color = normal_color
  75. if $temp_mp >=0
  76. self.contents.font.color = Color.new(255, 128, 128, 255)
  77. self.contents.draw_text(x + 184, y, 36, 32, " +",2)
  78. else
  79. self.contents.font.color = Color.new(255,255,0,255)
  80. self.contents.draw_text(x + 184, y, 36, 32, " -",2)
  81. end
  82. self.contents.draw_text(x + 232, y, 32, 32, $temp_mp.to_s, 1)
  83. self.contents.font.color = normal_color
  84. end
  85. end
  86. def draw_actor_lvup(actor, x, y, type)
  87. lvup = normal_color
  88. upcolor = Color.new(255, 128, 128, 255)
  89. self.contents.font.color = normal_color
  90. case type
  91. when 0
  92. parameter_name = Vocab::param(2)
  93. parameter_value = actor.atk
  94. parameter_value_temp = parameter_value + $temp_atk
  95. if $temp_atk != 0
  96. lvup = upcolor
  97. if $temp_atk >= 0
  98. self.contents.font.color = lvup
  99. self.contents.draw_text(x + 205, y, 80, 32, "+",0)
  100. else
  101. self.contents.font.color = Color.new(255,255,0,255)
  102. self.contents.draw_text(x + 205, y, 80, 32, "-",0)
  103. end
  104. self.contents.draw_text(x + 205, y, 88, 32, $temp_atk.abs.to_s,1)
  105. self.contents.font.color = normal_color
  106. end
  107. when 1
  108. parameter_name = Vocab::param(3)
  109. parameter_value = actor.def
  110. parameter_value_temp = parameter_value + $temp_def
  111. if $temp_def != 0
  112. lvup = upcolor
  113. if $temp_def >= 0
  114. self.contents.font.color = lvup
  115. self.contents.draw_text(x + 205, y, 80, 32, "+",0)
  116. else
  117. self.contents.font.color = Color.new(255,255,0,255)
  118. self.contents.draw_text(x + 205, y, 80, 32, "-",0)
  119. end
  120. self.contents.draw_text(x + 205, y, 88, 32, $temp_def.abs.to_s,1)
  121. self.contents.font.color = normal_color
  122. end
  123. when 2
  124. parameter_name = Vocab::param(4)
  125. parameter_value = actor.mat
  126. parameter_value_temp = parameter_value + $temp_mat
  127. if $temp_mat != 0
  128. lvup = upcolor
  129. if $temp_mat >= 0
  130. self.contents.font.color = lvup
  131. self.contents.draw_text(x + 205, y, 80, 32, "+",0)
  132. else
  133. self.contents.font.color = Color.new(255,255,0,255)
  134. self.contents.draw_text(x + 205, y, 80, 32, "-",0)
  135. end
  136. self.contents.draw_text(x + 205, y, 88, 32, $temp_mat.abs.to_s,1)
  137. self.contents.font.color = normal_color
  138. end
  139. when 3
  140. parameter_name = Vocab::param(5)
  141. parameter_value = actor.mdf
  142. parameter_value_temp = parameter_value + $temp_mdf
  143. if $temp_mdf != 0
  144. lvup = upcolor
  145. if $temp_mdf >= 0
  146. self.contents.font.color = lvup
  147. self.contents.draw_text(x + 205, y, 80, 32, "+",0)
  148. else
  149. self.contents.font.color = Color.new(255,255,0,255)
  150. self.contents.draw_text(x + 205, y, 80, 32, "-",0)
  151. end
  152. self.contents.draw_text(x + 205, y, 88, 32, $temp_mdf.abs.to_s,1)
  153. self.contents.font.color = normal_color
  154. end
  155. when 4
  156. parameter_name = Vocab::param(6)
  157. parameter_value = actor.agi
  158. parameter_value_temp = parameter_value + $temp_agi
  159. if $temp_agi != 0
  160. lvup = upcolor
  161. if $temp_agi >= 0
  162. self.contents.font.color = lvup
  163. self.contents.draw_text(x + 205, y, 80, 32, "+",0)
  164. else
  165. self.contents.font.color = Color.new(255,255,0,255)
  166. self.contents.draw_text(x + 205, y, 80, 32, "-",0)
  167. end
  168. self.contents.draw_text(x + 205, y, 88, 32, $temp_agi.abs.to_s,1)
  169. self.contents.font.color = normal_color
  170. end
  171. when 5
  172. parameter_name = Vocab::param(7)
  173. parameter_value = actor.luk
  174. parameter_value_temp = parameter_value + $temp_luk
  175. if $temp_luk != 0
  176. lvup = upcolor
  177. if $temp_luk >= 0
  178. self.contents.font.color = lvup
  179. self.contents.draw_text(x + 205, y, 80, 32, "+",0)
  180. else
  181. self.contents.font.color = Color.new(255,255,0,255)
  182. self.contents.draw_text(x + 205, y, 80, 32, "-",0)
  183. end
  184. self.contents.draw_text(x + 205, y, 88, 32, $temp_luk.abs.to_s,1)
  185. self.contents.font.color = normal_color
  186. end
  187. end
  188. self.contents.font.color = system_color
  189. self.contents.draw_text(x, y, 120, 32, parameter_name)
  190. self.contents.font.color = normal_color
  191. self.contents.draw_text(x + 96, y, 36, 32, parameter_value.to_s)
  192. self.contents.draw_text(x + 120, y, 36, 32, "→")
  193. self.contents.font.color = lvup
  194. self.contents.draw_text(x + 156, y, 96, 32, parameter_value_temp.to_s)
  195. self.contents.font.color = normal_color
  196. end
  197. end

  198. class Window_Lvpoint < Window_Base
  199. def initialize
  200. super(416,358,128,58)
  201. refresh
  202. end
  203. def refresh
  204. self.contents.clear
  205. parameter_name = "剩余点数"
  206. parameter_value = $point
  207. self.contents.font.color = system_color
  208. self.contents.draw_text(0, 0, self.contents.width, self.contents.height, parameter_name)
  209. self.contents.font.color = normal_color
  210. self.contents.draw_text(0, 0, self.contents.width, self.contents.height, parameter_value.to_s,2)
  211. end
  212. end

  213. class Window_Lvup < Window_Base
  214. def initialize
  215. super(128, 60, 416, 256)
  216. self.contents = Bitmap.new(width - 32, height - 32)
  217. @actor = $game_party.menu_actor
  218. refresh
  219. end
  220. def refresh
  221. self.contents.clear
  222. draw_actor_face(@actor, 0, 32)
  223. draw_actor_name(@actor, 4, 0)
  224. draw_actor_class(@actor, 96, 0)
  225. draw_actor_level(@actor, 224, 0)
  226. draw_actor_hp_lvup(@actor, 96, 32)
  227. draw_actor_mp_lvup(@actor, 96, 56)
  228. draw_actor_lvup(@actor, 96, 80, 0)
  229. draw_actor_lvup(@actor, 96, 104, 1)
  230. draw_actor_lvup(@actor, 96, 128, 2)
  231. draw_actor_lvup(@actor, 96, 152, 3)
  232. draw_actor_lvup(@actor, 96, 176, 4)
  233. draw_actor_lvup(@actor, 96, 200, 5)
  234. end
  235. end



  236. class Scene_Lvup < Scene_Base
  237. def initialize
  238. @actor = $game_party.menu_actor
  239. set_data
  240. create_window
  241. end
  242. def dispose_background
  243. @background_sprite.dispose
  244. end
  245. def create_window
  246. @command_window = Window_PointCommand.new
  247. @command_window.set_handler(:HPBoost, method(:CommandHPBoost))
  248. @command_window.set_handler(:MPBoost, method(:CommandMPBoost))
  249. @command_window.set_handler(:ATKBoost, method(:CommandATKBoost))
  250. @command_window.set_handler(:DEFBoost, method(:CommandDEFBoost))
  251. @command_window.set_handler(:MATBoost, method(:CommandMATBoost))
  252. @command_window.set_handler(:MDFBoost, method(:CommandMDFBoost))
  253. @command_window.set_handler(:AGIBoost, method(:CommandAGIBoost))
  254. @command_window.set_handler(:LUKBoost, method(:CommandLUKBoost))
  255. @command_window.set_handler(:PointReset, method(:reset_point))
  256. @command_window.set_handler(:PointBoost, method(:process_point))
  257. @command_window.set_handler(:cancel, method(:return_scene))
  258. @command_window.y = 56
  259. @lvup_window = Window_Lvup.new
  260. @lvpoint_window = Window_Lvpoint.new
  261. end
  262. def set_data
  263. reset_point

  264. @hp_hp = 15;@hp_mp = 0
  265. @hp_atk = 0;@hp_def = 0
  266. @hp_mat = 0;@hp_mdf = 0
  267. @hp_agi = 0;@hp_luk = 0

  268. @mp_hp = 0;@mp_mp = 10
  269. @mp_atk = 0;@mp_def = 0
  270. @mp_mat = 0;@mp_mdf = 0
  271. @mp_agi = 0;@mp_luk = 0

  272. @atk_hp = 0;@atk_mp = 0
  273. @atk_atk = 1;@atk_def = 0
  274. @atk_mat = 0;@atk_mdf = 0
  275. @atk_agi = 0;@atk_luk = 0

  276. @def_hp = 0;@def_mp = 0
  277. @def_atk = 0;@def_def = 1
  278. @def_mat = 0;@def_mdf = 0
  279. @def_agi = 0;@def_luk = 0

  280. @mat_hp = 0;@mat_mp = 0
  281. @mat_atk = 0;@mat_def = 0
  282. @mat_mat = 1;@mat_mdf = 0
  283. @mat_agi = 0;@mat_luk = 0

  284. @mdf_hp = 0;@mdf_mp = 0
  285. @mdf_atk = 0;@mdf_def = 0
  286. @mdf_mat = 0;@mdf_mdf = 1
  287. @mdf_agi = 0;@mdf_luk = 0

  288. @agi_hp = 0;@agi_mp = 0
  289. @agi_atk = 0;@agi_def = 0
  290. @agi_mat = 0;@agi_mdf = 0
  291. @agi_agi = 1;@agi_luk = 0

  292. @luk_hp = 0;@luk_mp = 0
  293. @luk_atk = 0;@luk_def = 0
  294. @luk_mat = 0;@luk_mdf = 0
  295. @luk_agi = 0;@luk_luk = 1
  296. end
  297. def window_refresh
  298. @lvup_window.refresh
  299. @lvpoint_window.refresh
  300. @command_window.activate
  301. end
  302. def CommandHPBoost
  303. Sound.play_buzzer if $point == 0
  304. @command_window.activate if $point == 0
  305. return if $point == 0
  306. $temp_hp += @hp_hp
  307. $temp_mp += @hp_mp
  308. $temp_atk += @hp_atk
  309. $temp_def += @hp_def
  310. $temp_mat += @hp_mat
  311. $temp_mdf += @hp_mdf
  312. $temp_agi += @hp_agi
  313. $temp_luk += @hp_luk
  314. $point -= 1
  315. window_refresh
  316. end
  317. def CommandMPBoost
  318. Sound.play_buzzer if $point == 0
  319. @command_window.activate if $point == 0
  320. return if $point == 0
  321. $temp_hp += @mp_hp
  322. $temp_mp += @mp_mp
  323. $temp_atk += @mp_atk
  324. $temp_def += @mp_def
  325. $temp_mat += @mp_mat
  326. $temp_mdf += @mp_mdf
  327. $temp_agi += @mp_agi
  328. $temp_luk += @mp_luk
  329. $point -= 1
  330. window_refresh
  331. end
  332. def CommandATKBoost
  333. Sound.play_buzzer if $point == 0
  334. @command_window.activate if $point == 0
  335. return if $point == 0
  336. $temp_hp += @atk_hp
  337. $temp_mp += @atk_mp
  338. $temp_atk += @atk_atk
  339. $temp_def += @atk_def
  340. $temp_mat += @atk_mat
  341. $temp_mdf += @atk_mdf
  342. $temp_agi += @atk_agi
  343. $temp_luk += @atk_luk
  344. $point -= 1
  345. window_refresh
  346. end
  347. def CommandDEFBoost
  348. Sound.play_buzzer if $point == 0
  349. @command_window.activate if $point == 0
  350. return if $point == 0
  351. $temp_hp += @def_hp
  352. $temp_mp += @def_mp
  353. $temp_atk += @def_atk
  354. $temp_def += @def_def
  355. $temp_mat += @def_mat
  356. $temp_mdf += @def_mdf
  357. $temp_agi += @def_agi
  358. $temp_luk += @def_luk
  359. $point -= 1
  360. window_refresh
  361. end
  362. def CommandMATBoost
  363. Sound.play_buzzer if $point == 0
  364. @command_window.activate if $point == 0
  365. return if $point == 0
  366. $temp_hp += @mat_hp
  367. $temp_mp += @mat_mp
  368. $temp_atk += @mat_atk
  369. $temp_def += @mat_def
  370. $temp_mat += @mat_mat
  371. $temp_mdf += @mat_mdf
  372. $temp_agi += @mat_agi
  373. $temp_luk += @mat_luk
  374. $point -= 1
  375. window_refresh
  376. end
  377. def CommandMDFBoost
  378. Sound.play_buzzer if $point == 0
  379. @command_window.activate if $point == 0
  380. return if $point == 0
  381. $temp_hp += @mdf_hp
  382. $temp_mp += @mdf_mp
  383. $temp_atk += @mdf_atk
  384. $temp_def += @mdf_def
  385. $temp_mat += @mdf_mat
  386. $temp_mdf += @mdf_mdf
  387. $temp_agi += @mdf_agi
  388. $temp_luk += @mdf_luk
  389. $point -= 1
  390. window_refresh
  391. end
  392. def CommandAGIBoost
  393. Sound.play_buzzer if $point == 0
  394. @command_window.activate if $point == 0
  395. return if $point == 0
  396. $temp_hp += @agi_hp
  397. $temp_mp += @agi_mp
  398. $temp_atk += @agi_atk
  399. $temp_def += @agi_def
  400. $temp_mat += @agi_mat
  401. $temp_mdf += @agi_mdf
  402. $temp_agi += @agi_agi
  403. $temp_luk += @agi_luk
  404. $point -= 1
  405. window_refresh
  406. end
  407. def CommandLUKBoost
  408. Sound.play_buzzer if $point == 0
  409. @command_window.activate if $point == 0
  410. return if $point == 0
  411. $temp_hp += @luk_hp
  412. $temp_mp += @luk_mp
  413. $temp_atk += @luk_atk
  414. $temp_def += @luk_def
  415. $temp_mat += @luk_mat
  416. $temp_mdf += @luk_mdf
  417. $temp_agi += @luk_agi
  418. $temp_luk += @luk_luk
  419. $point -= 1
  420. window_refresh
  421. end
  422. def reset_point
  423. $point = $game_variables[@actor.id + LEVEL_UP_VARIABLE]
  424. $temp_hp = 0
  425. $temp_mp = 0
  426. $temp_atk = 0
  427. $temp_def = 0
  428. $temp_mat = 0
  429. $temp_mdf = 0
  430. $temp_agi = 0
  431. $temp_luk = 0
  432. window_refresh if @command_window != nil
  433. end
  434. def process_point
  435. if $temp_hp + $temp_mp + $temp_atk + $temp_def + $temp_mat + $temp_mdf + $temp_agi + $temp_luk < 1
  436. Sound.play_buzzer
  437. @command_window.activate
  438. return
  439. else
  440. $game_variables[@actor.id + LEVEL_UP_VARIABLE] = $point
  441. @actor.add_param(0, $temp_hp)
  442. @actor.add_param(1, $temp_mp)
  443. @actor.add_param(2, $temp_atk)
  444. @actor.add_param(3, $temp_def)
  445. @actor.add_param(4, $temp_mat)
  446. @actor.add_param(5, $temp_mdf)
  447. @actor.add_param(6, $temp_agi)
  448. @actor.add_param(7, $temp_luk)
  449. reset_point
  450. end
  451. end
  452. end
复制代码
插在main前面,插件脚本下面了。

然后制作者说要什么定义角色
  1. $game_party.menu_actor = $game_party.members[队列ID]
复制代码
可这句话按照
  1. $game_party.menu_actor = $game_party.members[1]
复制代码
插入总显示members未定义什么的。

然后不定义的话,进游戏呼叫窗口后
  1. SceneManager.call(Scene_Lvup)
复制代码
只能对1号角色进行加点,其他的都不能加。
求助!谢谢大家了!

Lv4.逐梦者

梦石
0
星屑
6545
在线时间
1666 小时
注册时间
2008-10-29
帖子
6710

贵宾

2
发表于 2012-7-31 23:23:22 | 只看该作者
本帖最后由 后知后觉 于 2012-7-31 23:27 编辑

队列ID是从0开始而不是从1开始.0代表第1个角色.1代表第2个角色
一般来说脚本作者还有上论坛的话你直接在这脚本的发布帖里问他会更高效











你知道得太多了

回复 支持 反对

使用道具 举报

Lv6.析梦学徒

老鹰

梦石
40
星屑
33422
在线时间
6553 小时
注册时间
2012-5-26
帖子
3178

极短24评委极短23参与极短22参与极短21评委老司机慢点开短篇十吟唱者组别冠军开拓者剧作品鉴家

3
 楼主| 发表于 2012-7-31 23:33:07 | 只看该作者
后知后觉 发表于 2012-7-31 23:23
队列ID是从0开始而不是从1开始.0代表第1个角色.1代表第2个角色
一般来说脚本作者还有上论坛的话你直接在这 ...



不过这样为什么没用啊。。

还有就是,脚本是从这里淘来的,看时间,我也不知道作者还在不在了
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
6545
在线时间
1666 小时
注册时间
2008-10-29
帖子
6710

贵宾

4
发表于 2012-8-1 10:30:24 | 只看该作者
$game_party 只有在点击【开始游戏】或者读取存档后才会存在











你知道得太多了

回复 支持 反对

使用道具 举报

Lv6.析梦学徒

老鹰

梦石
40
星屑
33422
在线时间
6553 小时
注册时间
2012-5-26
帖子
3178

极短24评委极短23参与极短22参与极短21评委老司机慢点开短篇十吟唱者组别冠军开拓者剧作品鉴家

5
 楼主| 发表于 2012-8-1 10:49:40 | 只看该作者
后知后觉 发表于 2012-8-1 10:30
$game_party 只有在点击【开始游戏】或者读取存档后才会存在

我知道是怎么回事了,这句脚本只能用在事件里,队列id是指当前队友所在顺序。可是会不会有个问题啊?1号角色升级得到点数,但2号角色通过整队换至1号位置,岂不是2号可以用1号的点了吗?
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
6545
在线时间
1666 小时
注册时间
2008-10-29
帖子
6710

贵宾

6
发表于 2012-8-1 12:31:02 | 只看该作者
队列ID是角色在队列里的位置编号从0开始
角色ID是角色在数据库里的编号从1开始
队列ID随便怎么变.角色ID是不会变的











你知道得太多了

回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
48
在线时间
331 小时
注册时间
2012-5-4
帖子
158
7
发表于 2012-11-2 13:17:18 | 只看该作者
百里_飞柳 发表于 2012-8-1 10:49
我知道是怎么回事了,这句脚本只能用在事件里,队列id是指当前队友所在顺序。可是会不会有个问题啊?1号 ...

老大你这个能不能给个范例?到底怎么调用啊?
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
120
在线时间
486 小时
注册时间
2007-5-27
帖子
807
8
发表于 2012-11-2 21:36:58 | 只看该作者
……
貌似是根据人物ID来的而不是队伍ID……
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-3 06:21

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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