Project1

标题: 这个升级提示脚本怎么改啊? [打印本页]

作者: 18925880845    时间: 2013-8-11 04:55
标题: 这个升级提示脚本怎么改啊?
本帖最后由 18925880845 于 2013-8-11 08:52 编辑

这个升级提示脚本怎么改啊?
图片显示位置,还有下面的学会特技不清楚,怎么改啊?
RUBY 代码复制
  1. #==============================================================================
  2. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  3. #==============================================================================
  4. #==============================================================================
  5. # 泛用型升级提示显示角色头像脚本
  6. #
  7. # 核心部分 By 叶子
  8. # 窗口部分 原作者:樱雅在土 修改:叶子
  9. # 后期修改 玄月
  10. #
  11. # Date: 2008.11.24
  12. #
  13. #==============================================================================
  14. #说明:
  15. # 在对话时,调用“增加EXP”或“增减等级”指令前,请等待3帧以上,否则对话框来不及消失。
  16. #
  17. # 当打开此号数的开关的时候,等级上升将不会提示,比如默认打开45号开关,等级上升不再提示
  18. $不显示升级窗口 = 45
  19. #——以下3个如果需要修改,直接输入文件名即可
  20. $data_system_level_up_se = "" #升级时的音效设置
  21. $data_system_level_up_me = "Audio/ME/007-Fanfare01" # 升级时播放的ME
  22. $data_system_skilllearn_se = "" # 学会特技时播放的声效。
  23. #这个可以修改图片文件的路径。
  24. Gengetu = "Graphics/LVUP/"
  25. #
  26. #==============================================================================
  27. class Game_Actor
  28. #--------------------------------------------------------------------------
  29. # ● 更改 EXP
  30. # exp : 新的 EXP
  31. #--------------------------------------------------------------------------
  32. def exp=(exp)
  33. # 记录旧等级
  34. last_level = [url=home.php?mod=space&uid=22147]@level[/url]
  35. @exp = [[exp, 9999999].min, 0].max
  36. # 升级
  37. while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
  38. @level += 1
  39. # 学会特技
  40. for j in $data_classes[@class_id].learnings
  41. if j.level == @level
  42. learn_skill(j.skill_id)
  43. end
  44. end
  45. end
  46. # 降级
  47. while @exp < @exp_list[@level]
  48. @level -= 1
  49. end
  50. # 修正当前的 HP 与 SP 超过最大值
  51. @hp = [@hp, self.maxhp].min
  52. @sp = [@sp, self.maxsp].min
  53. # 升级了的话,升级显示处理
  54. if @level > last_level and $game_switches[$不显示升级窗口] == false and
  55. not $BTEST
  56. show_level_up_result(last_level)
  57. end
  58. end
  59. #--------------------------------------------------------------------------
  60. # ● 升级显示处理
  61. #--------------------------------------------------------------------------
  62. def show_level_up_result(last_level)
  63. actor_parameters = self.last_parameters(last_level)
  64. last_maxhp = actor_parameters[0]
  65. last_maxsp = actor_parameters[1]
  66. last_str = actor_parameters[2]
  67. last_dex = actor_parameters[3]
  68. last_agi = actor_parameters[4]
  69. last_int = actor_parameters[5]
  70. level_up_window = Window_LevelUpWindow_A.new self,last_level,last_maxhp,
  71. last_maxsp,last_str,last_dex,last_agi,last_int
  72. level_up_window.visible = true
  73. skill_learning_window = Window_SkillLearning_A.new(@class_id,
  74. last_level, @level)
  75. # 循环
  76. loop do
  77. # 刷新游戏画面
  78. Graphics.update
  79. # 刷新输入信息
  80. Input.update
  81. # 按下C就关闭窗口
  82. if Input.trigger?(Input::C)
  83. unless skill_learning_window.refresh
  84. level_up_window.dispose
  85. skill_learning_window.dispose
  86. return true
  87. end
  88. end
  89. end
  90. end
  91. #--------------------------------------------------------------------------
  92. # ● 一次取得全部旧属性
  93. #--------------------------------------------------------------------------
  94. def last_parameters(level)
  95. #---------------------------
  96. # maxhp
  97. #---------------------------
  98. n = [[$data_actors[@actor_id].parameters[0, level] + @maxhp_plus, 1].max, 9999].min
  99. for i in @states
  100. n *= $data_states[i].maxhp_rate / 100.0
  101. end
  102. n = [[Integer(n), 1].max, 9999].min
  103. maxhp = n
  104. #---------------------------
  105. # maxsp
  106. #---------------------------
  107. n = [[$data_actors[@actor_id].parameters[1, level] + @maxsp_plus, 0].max, 9999].min
  108. for i in @states
  109. n *= $data_states[i].maxsp_rate / 100.0
  110. end
  111. n = [[Integer(n), 0].max, 9999].min
  112. maxsp = n
  113. #---------------------------
  114. # str
  115. #---------------------------
  116. n = $data_actors[@actor_id].parameters[2, level]
  117. weapon = $data_weapons[@weapon_id]
  118. armor1 = $data_armors[@armor1_id]
  119. armor2 = $data_armors[@armor2_id]
  120. armor3 = $data_armors[@armor3_id]
  121. armor4 = $data_armors[@armor4_id]
  122. n += weapon != nil ? weapon.str_plus : 0
  123. n += armor1 != nil ? armor1.str_plus : 0
  124. n += armor2 != nil ? armor2.str_plus : 0
  125. n += armor3 != nil ? armor3.str_plus : 0
  126. n += armor4 != nil ? armor4.str_plus : 0
  127. n = [[n + @str_plus, 1].max, 999].min
  128. for i in @states
  129. n *= $data_states[i].str_rate / 100.0
  130. end
  131. n = [[Integer(n), 1].max, 999].min
  132. str = n
  133. #---------------------------
  134. # dex
  135. #---------------------------
  136. n = $data_actors[@actor_id].parameters[3, level]
  137. weapon = $data_weapons[@weapon_id]
  138. armor1 = $data_armors[@armor1_id]
  139. armor2 = $data_armors[@armor2_id]
  140. armor3 = $data_armors[@armor3_id]
  141. armor4 = $data_armors[@armor4_id]
  142. n += weapon != nil ? weapon.dex_plus : 0
  143. n += armor1 != nil ? armor1.dex_plus : 0
  144. n += armor2 != nil ? armor2.dex_plus : 0
  145. n += armor3 != nil ? armor3.dex_plus : 0
  146. n += armor4 != nil ? armor4.dex_plus : 0
  147. n = [[n + @dex_plus, 1].max, 999].min
  148. for i in @states
  149. n *= $data_states[i].dex_rate / 100.0
  150. end
  151. n = [[Integer(n), 1].max, 999].min
  152. dex = n
  153. #---------------------------
  154. # agi
  155. #---------------------------
  156. n = $data_actors[@actor_id].parameters[4, level]
  157. weapon = $data_weapons[@weapon_id]
  158. armor1 = $data_armors[@armor1_id]
  159. armor2 = $data_armors[@armor2_id]
  160. armor3 = $data_armors[@armor3_id]
  161. armor4 = $data_armors[@armor4_id]
  162. n += weapon != nil ? weapon.agi_plus : 0
  163. n += armor1 != nil ? armor1.agi_plus : 0
  164. n += armor2 != nil ? armor2.agi_plus : 0
  165. n += armor3 != nil ? armor3.agi_plus : 0
  166. n += armor4 != nil ? armor4.agi_plus : 0
  167. n = [[n + @agi_plus, 1].max, 999].min
  168. for i in @states
  169. n *= $data_states[i].agi_rate / 100.0
  170. end
  171. n = [[Integer(n), 1].max, 999].min
  172. agi = n
  173. #---------------------------
  174. # int
  175. #---------------------------
  176. n = $data_actors[@actor_id].parameters[5, level]
  177. weapon = $data_weapons[@weapon_id]
  178. armor1 = $data_armors[@armor1_id]
  179. armor2 = $data_armors[@armor2_id]
  180. armor3 = $data_armors[@armor3_id]
  181. armor4 = $data_armors[@armor4_id]
  182. n += weapon != nil ? weapon.int_plus : 0
  183. n += armor1 != nil ? armor1.int_plus : 0
  184. n += armor2 != nil ? armor2.int_plus : 0
  185. n += armor3 != nil ? armor3.int_plus : 0
  186. n += armor4 != nil ? armor4.int_plus : 0
  187. n = [[n + @int_plus, 1].max, 999].min
  188. for i in @states
  189. n *= $data_states[i].int_rate / 100.0
  190. end
  191. n = [[Integer(n), 1].max, 999].min
  192. int = n
  193. return [maxhp, maxsp, str, dex, agi, int]
  194. end
  195. end
  196. # ————————————————————————————————————
  197. #
  198. # ▼▲▼ XRXS_BP10. LEVEL UP!能力上升表示 plus ▼▲▼
  199. # by 樱雅在土
  200. #==============================================================================
  201. # ■ Window_LevelUpWindow
  202. #------------------------------------------------------------------------------
  203. #  战斗结束时,在做了升级的情况时表示的窗口。
  204. #==============================================================================
  205. class Window_LevelUpWindow_A < Window_Base
  206. #--------------------------------------------------------------------------
  207. # ● 窗口初始化
  208. #--------------------------------------------------------------------------
  209. def initialize(actor, last_lv, up_hp, up_sp, up_str, up_dex, up_agi, up_int)
  210. super(120, 44, 384, 222)
  211. self.contents = Bitmap.new(width - 32, height - 32)
  212. self.visible = false
  213. self.back_opacity = 160
  214. # 防止被对话框遮住
  215. self.z = 9999
  216. @actor = actor
  217. refresh(actor, last_lv, up_hp, up_sp, up_str, up_dex, up_agi, up_int)
  218. # SEの再生
  219. if $data_system_level_up_se != ""
  220. Audio.se_play($data_system_level_up_se)
  221. end
  222. # MEの再生
  223. if $data_system_level_up_me != ""
  224. Audio.me_stop
  225. Audio.me_play($data_system_level_up_me)
  226. end
  227. end
  228. #--------------------------------------------------------------------------
  229. # ● 刷新
  230. #--------------------------------------------------------------------------
  231. def refresh(actor, last_lv, up_hp, up_sp, up_str, up_dex, up_agi, up_int)
  232. self.contents.clear
  233. lvuppic = @actor.name
  234. bitmap=Bitmap.new(Gengetu + "#{lvuppic}")
  235. src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
  236. self.contents.blt(- 32, -44, bitmap, src_rect)
  237. self.contents.font.color = text_color(6)
  238. self.contents.font.size = 20
  239. self.contents.draw_text(0+180, 0, 160, 24, actor.name.to_s)
  240. self.contents.font.color = system_color
  241. self.contents.font.size = 18
  242. self.contents.draw_text( 0+180, 26, 160, 24, "等级")
  243. self.contents.font.size = 18
  244. self.contents.draw_text( 0+180, 48, 80, 24, $data_system.words.hp)
  245. self.contents.draw_text( 0+180, 70, 80, 24, $data_system.words.sp)
  246. self.contents.draw_text( 0+180, 92, 80, 24, $data_system.words.str)
  247. self.contents.draw_text( 0+180, 114, 80, 24, $data_system.words.dex)
  248. self.contents.draw_text( 0+180, 136, 80, 24, $data_system.words.agi)
  249. self.contents.draw_text( 0+180, 158, 80, 24, $data_system.words.int)
  250. self.contents.draw_text(110+180, 26, 128, 24, "→")
  251. self.contents.draw_text(110+180, 48, 128, 24, "→")
  252. self.contents.draw_text(110+180, 70, 128, 24, "→")
  253. self.contents.draw_text(110+180, 92, 128, 24, "→")
  254. self.contents.draw_text(110+180, 114, 128, 24, "→")
  255. self.contents.draw_text(110+180, 136, 128, 24, "→")
  256. self.contents.draw_text(110+180, 158, 128, 24, "→")
  257. self.contents.font.color = normal_color
  258. self.contents.draw_text( 60+180, 26, 88, 24, last_lv.to_s)
  259. self.contents.draw_text( 60+180, 48, 72, 24, up_hp.to_s)
  260. self.contents.draw_text( 60+180, 70, 72, 24, up_sp.to_s)
  261. self.contents.draw_text( 60+180, 92, 72, 24, up_str.to_s)
  262. self.contents.draw_text( 60+180, 114, 72, 24, up_dex.to_s)
  263. self.contents.draw_text( 60+180, 136, 72, 24, up_agi.to_s)
  264. self.contents.draw_text( 60+180, 158, 72, 24, up_int.to_s)
  265. self.contents.draw_text( 145+180, 26, 128, 24, actor.level.to_s)
  266. self.contents.draw_text( 145+180, 48, 128, 24, actor.maxhp.to_s)
  267. self.contents.draw_text( 145+180, 70, 128, 24, actor.maxsp.to_s)
  268. self.contents.draw_text( 145+180, 92, 128, 24, actor.str.to_s)
  269. self.contents.draw_text( 145+180, 114, 128, 24, actor.dex.to_s)
  270. self.contents.draw_text( 145+180, 136, 128, 24, actor.agi.to_s)
  271. self.contents.draw_text( 145+180, 158, 128, 24, actor.int.to_s)
  272. end
  273. end
  274. #==============================================================================
  275. # ■ Window_SkillLearning
  276. #------------------------------------------------------------------------------
  277. #  当升级习得技能时所表示的窗口。
  278. #==============================================================================
  279. class Window_SkillLearning_A < Window_Base
  280. #--------------------------------------------------------------------------
  281. # ● 窗口初始化
  282. #--------------------------------------------------------------------------
  283. def initialize(class_id, last_lv, now_lv)
  284. super(120, 266, 384, 56)
  285. self.contents = Bitmap.new(width - 32, height - 16) # わざと▽を表示
  286. self.visible = false
  287. self.back_opacity = 160
  288. # 防止被对话框遮住
  289. self.z = 9999
  290. @learn_skills = []
  291. for i in 0...$data_classes[class_id].learnings.size
  292. learn_lv = $data_classes[class_id].learnings[i].level
  293. # 习得技能的时候显示的情况
  294. if learn_lv > last_lv and learn_lv <= now_lv
  295. @learn_skills.push $data_skills[
  296. $data_classes[class_id].learnings[i].skill_id].name
  297. end
  298. end
  299. refresh
  300. end
  301. #--------------------------------------------------------------------------
  302. # ● 刷新
  303. #--------------------------------------------------------------------------
  304. def refresh
  305. # 技能名的描写
  306. skill_name = @learn_skills.shift
  307. if skill_name == nil
  308. return false
  309. end
  310. # 播放SE
  311. if $data_system_skilllearn_se != ""
  312. Audio.se_play($data_system_skilllearn_se, 100, 70)
  313. end
  314. self.contents.clear
  315. self.contents.font.size = 18
  316. self.contents.font.color = text_color(0)
  317. self.contents.draw_text(0,0,156,24, "学会特技:"+skill_name)
  318. self.contents.font.color = text_color(6)
  319. self.contents.draw_text(0,0,156,24, " "+skill_name)
  320. self.contents.font.color = text_color(0)
  321. self.visible = true
  322. return true
  323. end
  324. end
  325. #==============================================================================
  326. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  327. #==============================================================================

作者: 紫英晓狼1130    时间: 2013-8-11 08:32
LZ能不能发代码框,这样数脚本行数是很费力的…
坐标应该是这行self.contents.blt(- 32, -44, bitmap, src_rect) 中的- 32和-44
学习技能是改这行:self.contents.draw_text(0,0,156,24, " "+skill_name)
把引号里加上"学会特技:"
作者: 18925880845    时间: 2013-8-11 22:27
紫英晓狼1130 发表于 2013-8-11 08:32
LZ能不能发代码框,这样数脚本行数是很费力的…
坐标应该是这行self.contents.blt(- 32, -44, bitmap, src_ ...

不是去掉学会特技,我是想问怎么去掉那里黄色的字
作者: 美丽晨露    时间: 2013-8-11 22:33
self.contents.font.color = text_color(6)
self.contents.draw_text(0,0,448,32, "          "+skill_name)  
改为
#self.contents.font.color = text_color(6)
#self.contents.draw_text(0,0,448,32, "          "+skill_name)




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1