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

Project1

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

[已经过期] 求能在左上角显示HP、SP的脚本

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
19 小时
注册时间
2012-12-20
帖子
9
跳转到指定楼层
1
发表于 2014-2-27 20:22:00 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
试了好多方法都不行= =

Lv3.寻梦者

○赛

梦石
0
星屑
1249
在线时间
1276 小时
注册时间
2013-1-22
帖子
2246

贵宾

2
发表于 2014-3-1 16:48:40 | 只看该作者
  1. class Window_Xxx < Window_Base
  2. def initialize
  3. super(0,0,200,150)
  4. self.contents = Bitmap.new(width - 32, height - 32)
  5. self.x = 0 # x坐标
  6. self.y = 0 # y坐标
  7. self.width = 200 # 窗口的宽
  8. self.hieght = 150 # 窗口的高
  9. refresh
  10. end
  11. def refresh
  12. if @h != $game_party.actors[0].hp or @s != $game_party.actors[0].sp
  13. self.contents.clear
  14. @h = $game_party.actors[0].hp.to_s
  15. @s = $game_party.actors[0].sp.to_s
  16. cw = contents.text_size(@h).width
  17. self.contents.draw_text(0,0,cw,22,@h)
  18. cw = contents.text_size(@s).width
  19. self.contents.draw_text(0,32,cw,22,@s)
  20. end
  21. end
  22. end
  23. class Scene_Map
  24. alias old_main main
  25. def main
  26. @xx = Window_Xxx.new
  27. old_main
  28. @xx.dispose
  29. end
  30. alias old_update update
  31. def update
  32. old_update
  33. @xx.update
  34. end
  35. end
复制代码
没有测试过……如果有错的话我重新写一个好了 0v0
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
439 小时
注册时间
2013-3-2
帖子
710
3
发表于 2014-3-3 21:55:40 | 只看该作者




1号开关开启
  1. DT_SWITCH = 1
  2. #有问题,找蚂蚁 redant修改
  3. #_______________________________________________________________________________
  4. # MOG_MPW HUD Elena V2.0           
  5. #_______________________________________________________________________________
  6. # By Moghunter
  7. # http://www.atelier-rgss.com
  8. #_______________________________________________________________________________
  9. module MOG
  10. #HUD Position.
  11. STMAPX = 470   # X Pos
  12. STMAPY = - 16 # Y Pos
  13. #Disable HUD Switch ID.  
  14. STMAPVIS = 1
  15. #Windowskin name.
  16. STMAPSKIN = ""
  17. #Window Opacity.
  18. STMAPOPA = 0
  19. end
  20. $mogscript = {} if $mogscript == nil
  21. $mogscript["mpstelen"] = true
  22. ###############
  23. # Window_Base #
  24. ###############
  25. class Window_Base < Window   

  26. def draw_maphp2(actor, x, y)
  27. text = RPG::Cache.picture("HP_Tx")   
  28. cw = text.width
  29. ch = text.height
  30. src_rect = Rect.new(0, 0, cw, ch)
  31. self.contents.blt( 75, 0, text, src_rect)
  32. meter = RPG::Cache.picture("HP_Meter")   
  33. cw = meter.width  * actor.hp / actor.maxhp
  34. ch = meter.height
  35. src_rect = Rect.new(0, 0, cw, ch)
  36. self.contents.blt( 94 ,16 , meter, src_rect)
  37. end  

  38. #def draw_mapsp2(actor, x, y)
  39. #meter = RPG::Cache.picture("SP_Meter")   
  40. #cw = meter.width  
  41. #ch = meter.height *  actor.sp / actor.maxsp
  42. #src_rect = Rect.new(0, 0,  cw, ch)
  43. #self.contents.blt( 81, 2, meter,  src_rect)
  44. #end

  45. def draw_mapsp2(actor, x, y)
  46. meter = RPG::Cache.picture("SP_Meter")   
  47. cw = meter.width  
  48. ch = 60 - meter.height *  actor.sp / actor.maxsp
  49. src_rect = Rect.new(0, 0,  cw, ch)
  50. self.contents.blt( 81, 2, meter,  src_rect)
  51. end


  52. def draw_mexp(actor, x, y)
  53. actor = $game_party.actors[0]
  54. if actor.next_exp != 0
  55. rate = actor.now_exp.to_f / actor.next_exp
  56. else
  57. rate = 1
  58. end
  59. bitmap = RPG::Cache.picture("Exp_Meter")
  60. #bitmap.z = 10
  61. if actor.level < 99
  62. cw = bitmap.width
  63. else
  64. cw = bitmap.width
  65. end   
  66. ch = bitmap.height - bitmap.height * rate
  67. src_rect = Rect.new(0, 0, cw, ch)
  68. self.contents.blt(88 , 6, bitmap, src_rect)

  69. end
  70. def nada
  71. face = RPG::Cache.picture("")
  72. end  
  73. def draw_heroface(actor,x,y) #"Graphics/system/menu/headp/" + actor.name + ".png"
  74. face = RPG::Cache.picture("../system/menu/HeadP/"+actor.name+"【地图】.png" ) rescue nada
  75. cw = face.width
  76. ch = face.height
  77. src_rect = Rect.new(0, 0, cw, ch)
  78. self.contents.blt(93 , 8, face, src_rect)
  79. end  

  80. end
  81. ##############
  82. # Game_Actor #
  83. ##############
  84. class Game_Actor < Game_Battler
  85. def now_exp
  86. return [url=home.php?mod=space&uid=13302]@exp[/url] - @exp_list[@level]
  87. end
  88. def next_exp
  89. return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
  90. end
  91. end
  92. #####################
  93. # Window_Status_Map #
  94. #####################
  95. class Window_Sthero < Window_Base
  96. def initialize
  97. super(0, 0, 310, 120)
  98. self.contents = Bitmap.new(width - 32, height - 32)
  99. self.windowskin = RPG::Cache.windowskin(MOG::STMAPSKIN)   
  100. self.contents.font.bold = true
  101. self.contents.font.size = 20
  102. self.contents.font.name = "Georgia"
  103. self.opacity = MOG::STMAPOPA

  104. refresh
  105. end  
  106. def refresh
  107.    if $game_switches[DT_SWITCH]
  108. #actor = $game_party.actors[0]

  109. #draw_maphp2(actor, 35, 35)
  110. #draw_mapsp2(actor, - 40, 60)
  111. #draw_mexp(actor, 100, 10)
  112. #draw_heroface(actor, 0, 70) 游啊游
  113.      self.contents.clear
  114. actor = $game_party.actors[0]

  115. draw_maphp2(actor, 35, 35)
  116. draw_mapsp2(actor, - 40, 60)
  117. draw_mexp(actor, 100, 10)
  118. draw_heroface(actor, 0, 70)
  119. end

  120. # draw_actor_statemap(actor, 200, 60, 70)
  121. #draw_actor_levelmap(actor, 80, 10)   

  122. end
  123. end
  124. ###############
  125. # Game_Player #
  126. ###############
  127. class Game_Player < Game_Character
  128. attr_accessor :wref
  129. end
  130. #############
  131. # Scene_Map #
  132. #############
  133. class Scene_Map
  134. alias mog11_main main
  135. def main
  136. @sthero = Window_Sthero.new
  137. @sthero.x = MOG::STMAPX
  138. @sthero.y = MOG::STMAPY
  139. if $game_switches[MOG::STMAPVIS] == false
  140. @sthero.visible = true  
  141. else
  142. @sthero.visible = false  
  143. end  
  144. mog11_main
  145. @sthero.dispose
  146. end
  147. alias mog11_update update
  148. def update
  149. mog11_update
  150. if $game_switches[MOG::STMAPVIS] == false
  151. @sthero.visible = true  
  152. else
  153. @sthero.visible = false  
  154. end
  155. if $game_switches[DT_SWITCH]
  156.     @sthero.visible = true
  157.     if $game_player.wref == true
  158. @sthero.refresh
  159. $game_player.wref = false
  160. end
  161.     else
  162.     @sthero.visible = false  
  163.      $game_player.wref = false
  164.   end
  165.   
  166. #if $game_switches[MOG::STMAPVIS] == false游啊游
  167. #@sthero.visible = true  
  168. #else
  169. #@sthero.visible = false  
  170. #end  
  171. #if $game_player.wref == true
  172. #@sthero.refresh
  173. #$game_player.wref = false
  174. #end
  175. #else
  176. # @sthero.visible = false  
  177.   #$game_player.wref = false

  178. #end

  179. end
  180. end  
  181. ##############
  182. # Game_Party #
  183. ###############
  184. class Game_Party
  185. alias mog11_check_map_slip_damage check_map_slip_damage  
  186. def check_map_slip_damage
  187. for actor in @actors
  188. if actor.hp > 0 and actor.slip_damage?
  189. $game_player.wref = true
  190. end
  191. end
  192. mog11_check_map_slip_damage  
  193. end
  194. end
  195. ###############
  196. # Interpreter #
  197. ###############
  198. class Interpreter
  199. alias mog11_command_311 command_311
  200. def command_311
  201. mog11_command_311
  202. $game_player.wref = true   
  203. end   
  204. alias mog11_command_312 command_312
  205. def command_312
  206. mog11_command_312
  207. $game_player.wref = true   
  208. end   
  209. alias mog11_command_313 command_313
  210. def command_313
  211. mog11_command_313
  212. $game_player.wref = true   
  213. end   
  214. alias mog11_command_314 command_314
  215. def command_314
  216. mog11_command_314
  217. $game_player.wref = true   
  218. end   
  219. alias mog11_command_315 command_315
  220. def command_315
  221. mog11_command_315
  222. $game_player.wref = true   
  223. end   
  224. end   
  225. ################
  226. # Game_Battler #
  227. ################
  228. class Game_Battler
  229. alias mog11_attack_effect attack_effect
  230. def attack_effect(attacker)
  231. mog11_attack_effect(attacker)  
  232. $game_player.wref = true
  233. end
  234. alias mog11_skill_effect skill_effect
  235. def skill_effect(user, skill)
  236. mog11_skill_effect(user, skill)
  237. $game_player.wref = true  
  238. end  
  239. alias mog11_item_effect item_effect
  240. def item_effect(item)
  241. mog11_item_effect(item)
  242. $game_player.wref = true  
  243. end
  244. alias mog11_add_state add_state
  245. def add_state(state_id, force = false)
  246. mog11_add_state(state_id, force = false)
  247. $game_player.wref = true  
  248. end
  249. end
复制代码

战斗系统B.rar

40.61 KB, 下载次数: 47

素材


   
【RMXP共享】50个脚本整合的系统
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
19 小时
注册时间
2012-12-20
帖子
9
4
 楼主| 发表于 2014-3-6 20:55:25 | 只看该作者
天地有正气 发表于 2014-3-1 16:48
没有测试过……如果有错的话我重新写一个好了 0v0

第八行错了

点评

怎么不试试我的?  发表于 2014-3-11 23:02
回复 支持 反对

使用道具 举报

Lv3.寻梦者 (版主)

梦石
0
星屑
2315
在线时间
5539 小时
注册时间
2011-1-10
帖子
6619

青铜编剧史诗剧作家剧作品鉴家

5
发表于 2014-3-6 21:57:50 | 只看该作者
http://rpg.blue/thread-341475-1-1.html
( ﹁ ﹁ ) ~→  纯事件血条,可供参考
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-9-22 07:02

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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