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

Project1

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

[已经解决] 45°战斗发生冲突

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
47 小时
注册时间
2013-7-14
帖子
46
跳转到指定楼层
1
发表于 2013-7-20 16:20:20 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
我用了一个45°战斗脚本后,发现以前的”状态叠加,图标化“和”显示敌人血条“没用了好像是被覆盖了。
这是45°脚本
RUBY 代码复制
  1. # ————————————————————————————————————
  2. # 本脚本来自[url]http://rpg.blue/web/[/url],转载请保留此信息
  3. # ————————————————————————————————————
  4. #==============================================================================
  5. # ■ Game_Actor
  6. #------------------------------------------------------------------------------
  7. #  处理角色的类。本类在 Game_Actors 类 ($game_actors)
  8. # 的内部使用、Game_Party 类请参考 ($game_party) 。
  9. #==============================================================================
  10. class Game_Actor < Game_Battler
  11. #--------------------------------------------------------------------------
  12. # ● 取得战斗画面的 X 坐标
  13. #--------------------------------------------------------------------------
  14. def screen_x
  15. case self.index
  16. when 0
  17. return 370
  18. when 1
  19. return 450
  20. when 2
  21. return 530
  22. when 3
  23. return 580
  24. else
  25. return 600
  26. end
  27. end
  28. #--------------------------------------------------------------------------
  29. # ● 取得战斗画面的 Y 坐标
  30. #--------------------------------------------------------------------------
  31. def screen_y
  32. case self.index
  33. when 0
  34. return 475
  35. when 1
  36. return 395
  37. when 2
  38. return 360
  39. when 3
  40. return 325
  41. else
  42. return 1000
  43. end
  44. end
  45. #--------------------------------------------------------------------------
  46. # ● 取得战斗画面的 Z 坐标
  47. #--------------------------------------------------------------------------
  48. def screen_z
  49. case self.index
  50. when 0
  51. return 10
  52. when 1
  53. return 9
  54. when 2
  55. return 8
  56. when 3
  57. return 7
  58. else
  59. return 0
  60. end
  61. end
  62. end
  63.  
  64. #==============================================================================
  65. # ■ Window_Base
  66. #------------------------------------------------------------------------------
  67. #  游戏中全部窗口的超级类。
  68. #==============================================================================
  69. class Window_Base < Window
  70. #--------------------------------------------------------------------------
  71. # ● 描绘 HP
  72. # actor : 角色
  73. # x : 描画目标 X 坐标
  74. # y : 描画目标 Y 坐标
  75. # width : 描画目标的宽
  76. #--------------------------------------------------------------------------
  77. def draw_actor_hp1(actor, x, y, width = 72)
  78. # 描绘字符串 "HP"
  79. self.contents.font.color = system_color
  80. self.contents.draw_text(x, y, 24, 24, $data_system.words.hp)
  81. # 计算描绘 MaxHP 所需的空间
  82. if width - 24 >= 32
  83. hp_x = x + 32# + width - 24
  84. end
  85. # 描绘 HP
  86. self.contents.font.color = actor.hp == 0 ? knockout_color :
  87. actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
  88. self.contents.draw_text(hp_x, y, 32, 24, actor.hp.to_s, 2)
  89. end
  90. #--------------------------------------------------------------------------
  91. # ● 描绘 SP
  92. # actor : 角色
  93. # x : 描画目标 X 坐标
  94. # y : 描画目标 Y 坐标
  95. # width : 描画目标的宽
  96. #--------------------------------------------------------------------------
  97. def draw_actor_sp1(actor, x, y, width = 72)
  98. # 描绘字符串 "SP"
  99. self.contents.font.color = system_color
  100. self.contents.draw_text(x, y, 24, 24, $data_system.words.sp)
  101. # 计算描绘 MaxSP 所需的空间
  102. if width - 24 >= 32
  103. sp_x = x + 32# + width - 24
  104. end
  105. # 描绘 SP
  106. self.contents.font.color = actor.sp == 0 ? knockout_color :
  107. actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
  108. self.contents.draw_text(sp_x, y, 32, 24, actor.sp.to_s, 2)
  109. end
  110. end
  111.  
  112.  
  113. #==============================================================================
  114. # ■ Window_BattleStatus
  115. #------------------------------------------------------------------------------
  116. #  显示战斗画面同伴状态的窗口。
  117. #==============================================================================
  118. class Window_BattleStatus < Window_Base
  119. #--------------------------------------------------------------------------
  120. # ● 初始化对像
  121. #--------------------------------------------------------------------------
  122. #$data_system_level_up_me = "Audio/ME/升级音乐"
  123. def initialize
  124. super(0, 0, 640, 480)
  125. self.contents = Bitmap.new(width - 10, height - 32)
  126. self.opacity = 0
  127. @level_up_flags = [false, false, false, false]
  128. refresh
  129. end
  130. #--------------------------------------------------------------------------
  131. # ● 释放
  132. #--------------------------------------------------------------------------
  133. def dispose
  134. super
  135. end
  136. #--------------------------------------------------------------------------
  137. # ● 设置升级标志
  138. # actor_index : 角色索引
  139. #--------------------------------------------------------------------------
  140. def level_up(actor_index)
  141. @level_up_flags[actor_index] = true
  142. end
  143. #--------------------------------------------------------------------------
  144. # ● 刷新
  145. #--------------------------------------------------------------------------
  146. def refresh
  147. self.contents.clear
  148. @item_max = $game_party.actors.size
  149. for i in 0...$game_party.actors.size
  150. actor = $game_party.actors[i]
  151. case i
  152. when 0
  153. x = 310
  154. y = 390
  155. when 1
  156. x = 390
  157. y = 340
  158. when 2
  159. x = 480
  160. y = 300
  161. when 3
  162. x = 550
  163. y = 270
  164. end
  165. if @level_up_flags[i]
  166. self.contents.font.color = normal_color
  167. self.contents.draw_text(x, y, 80, 24, "LEVEL UP!")
  168. Audio.me_stop
  169. # Audio.me_play($data_system_level_up_me)
  170. else
  171. draw_actor_hp1(actor, x-15, y-15, 80)
  172. draw_actor_sp1(actor, x-15, y+5, 80)
  173. end
  174. end
  175. end
  176. #--------------------------------------------------------------------------
  177. # ● 刷新画面
  178. #--------------------------------------------------------------------------
  179. def update
  180. super
  181. # 主界面的不透明度下降
  182. if $game_temp.battle_main_phase
  183. self.contents_opacity -= 50 if self.contents_opacity > 1
  184. else
  185. self.contents_opacity += 50 if self.contents_opacity < 255
  186. end
  187. end
  188. end
  189.  
  190.  
  191. #==============================================================================
  192. # ■ Window_BattleStatus
  193. #==============================================================================
  194. class Window_BattleStatus < Window_Base
  195. #--------------------------------------------------------------------------
  196. # ● 初始化
  197. #--------------------------------------------------------------------------
  198. alias xrxs_bp2_refresh refresh
  199. def refresh
  200. xrxs_bp2_refresh
  201. @item_max = $game_party.actors.size
  202. for i in 0...$game_party.actors.size
  203. actor = $game_party.actors[i]
  204. case i
  205. when 0
  206. x = 310
  207. y = 390
  208. when 1
  209. x = 390
  210. y = 340
  211. when 2
  212. x = 480
  213. y = 300
  214. when 3
  215. x = 550
  216. y = 270
  217. end
  218. draw_actor_hp_meter(actor, x, y, 50)
  219. draw_actor_sp_meter(actor, x, y + 8, 50)
  220. end
  221. end
  222. end
  223. #==============================================================================
  224. # ■ Window_Base
  225. #==============================================================================
  226. class Window_Base < Window
  227. #--------------------------------------------------------------------------
  228. # ● HP描画
  229. #--------------------------------------------------------------------------
  230. def draw_actor_hp_meter(actor, x, y, width = 156, type = 0)
  231. if type == 1 and actor.hp == 0
  232. return
  233. end
  234. self.contents.font.color = system_color
  235. self.contents.fill_rect(x-1, y+27, width+2,6, Color.new(0, 0, 0, 25))
  236. w = width * actor.hp / actor.maxhp
  237. self.contents.fill_rect(x, y+28, w,1, Color.new(255, 96, 96, 255))
  238. self.contents.fill_rect(x, y+29, w,1, Color.new(255, 0, 0, 255))
  239. self.contents.fill_rect(x, y+30, w,1, Color.new(128, 0, 0, 255))
  240. self.contents.fill_rect(x, y+31, w,1, Color.new(0, 0, 0, 255))
  241. end
  242. #--------------------------------------------------------------------------
  243. # ● SP描画
  244. #--------------------------------------------------------------------------
  245. def draw_actor_sp_meter(actor, x, y, width = 156, type = 0)
  246. if type == 1 and actor.hp == 0
  247. return
  248. end
  249. self.contents.font.color = system_color
  250. self.contents.fill_rect(x-1, y+27, width+2,6, Color.new(0, 0, 0, 255))
  251. w = width * actor.sp / actor.maxsp
  252. self.contents.fill_rect(x, y+28, w,1, Color.new(128, 255, 255, 255))
  253. self.contents.fill_rect(x, y+29, w,1, Color.new(0, 255, 255, 255))
  254. self.contents.fill_rect(x, y+30, w,1, Color.new(0, 192, 192, 255))
  255. self.contents.fill_rect(x, y+31, w,1, Color.new(0, 128, 128, 255))
  256. end
  257. end

Lv1.梦旅人

梦石
0
星屑
50
在线时间
47 小时
注册时间
2013-7-14
帖子
46
2
 楼主| 发表于 2013-7-20 16:23:28 | 只看该作者
这是血条的:

#==============================================================================
# 本脚本来自,使用和转载请保留此信息
#==============================================================================

class Window_Help < Window_Base
  def set_enemy(actor)
    self.contents.clear
    draw_actor_name(actor, 4, 0)
    draw_actor_state(actor, 140, 0)
    carol3_draw_hp_bar(actor, 284, 0)
    carol3_draw_sp_bar(actor, 460, 0)
  
    @text = nil
    self.visible = true
  end
  def carol3_draw_hp_bar(actor, x, y, width = 128) #宽度可调
    self.contents.font.color = system_color
    w = width * actor.hp / [actor.maxhp,1].max
    if actor.maxhp != 0
      rate = actor.hp.to_f / actor.maxhp
    else
      rate = 0
    end
    color1 = Color.new(240 - 72 * rate, 240 * rate, 62 * rate, 150)
    self.contents.fill_rect(x+1, y+15, width+2,1, Color.new(0, 0, 0, 255))
    self.contents.fill_rect(x+1, y+16, width+2,1, Color.new(255, 255, 192, 192))
    self.contents.fill_rect(x+1, y+17, w,6,color1)
    self.contents.fill_rect(x+1, y+23, width+2,1, Color.new(255, 255, 192, 192))
    self.contents.fill_rect(x+1, y+24, width+2,1, Color.new(0, 0, 0, 255))
    self.contents.fill_rect(x, y+16, 1,8, Color.new(255, 255, 192, 192))
    self.contents.fill_rect(x-1, y+15, 1,10, Color.new(0, 0, 0, 255))
    self.contents.fill_rect(x+129, y+16, 1,8, Color.new(255, 255, 192, 192))
    self.contents.fill_rect(x+130, y+15, 1,10, Color.new(0, 0, 0, 255))
    self.contents.draw_text(x-53,y,128,32,$data_system.words.hp,1)
    if actor.hp>actor.maxhp/3
      self.contents.font.color = Color.new(255, 255, 255, 250)
    end
    if actor.hp>=actor.maxhp/6 and actor.maxhp/3>actor.hp
      self.contents.font.color = Color.new(200, 200, 0, 255)
    end
    if actor.maxhp/6>actor.hp
      self.contents.font.color = Color.new(200, 0, 0, 255)
    end
    self.contents.draw_text(x+47,y,128,32,actor.hp.to_s,1)
  end
  def carol3_draw_sp_bar(actor, x, y, width = 128)
    self.contents.font.color = system_color
    if actor.maxsp != 0
      rate = actor.sp.to_f / actor.maxsp
    else
      rate = 0
    end
    color2 = Color.new(62 * rate, 240 - 72 * rate, 240 * rate, 192)
    w = width * actor.sp / [actor.maxsp,1].max
    self.contents.fill_rect(x+1, y+15, width+2,1, Color.new(0, 0, 0, 255))
    self.contents.fill_rect(x+1, y+16, width+2,1, Color.new(255, 255, 192, 192))
    self.contents.fill_rect(x+1, y+17, w,6,color2)
    self.contents.fill_rect(x+1, y+23, width+2,1, Color.new(255, 255, 192, 192))
    self.contents.fill_rect(x+1, y+24, width+2,1, Color.new(0, 0, 0, 255))
    self.contents.fill_rect(x, y+16, 1,8, Color.new(255, 255, 192, 192))
    self.contents.fill_rect(x-1, y+15, 1,10, Color.new(0, 0, 0, 255))
    self.contents.fill_rect(x+129, y+16, 1,8, Color.new(255, 255, 192, 192))
    self.contents.fill_rect(x+130, y+15, 1,10, Color.new(0, 0, 0, 255))
    self.contents.draw_text(x-53,y,128,32,$data_system.words.sp,1)
    if actor.hp>actor.maxsp/3
      self.contents.font.color = Color.new(255, 255, 255, 250)
    end
    if actor.hp>=actor.maxsp/6 and actor.maxsp/3>actor.sp
      self.contents.font.color = Color.new(200, 200, 0, 255)
    end
    if actor.maxsp/6>actor.sp
      self.contents.font.color = Color.new(200, 0, 0, 255)
    end
    self.contents.draw_text(x+47,y,128,32,actor.sp.to_s,1)
  end
end
#==============================================================================
# 本脚本来自,使用和转载请保留此信息
#==============================================================================
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
47 小时
注册时间
2013-7-14
帖子
46
3
 楼主| 发表于 2013-7-20 16:24:13 | 只看该作者
这是状态叠加,图标化的
  1. #==============================================================================
  2. # Date 12-31-2005
  3. # 重定义类:Window_Base, Window_Help
  4. #==============================================================================
  5. # 脚本功能:
  6. # 实现战斗中和菜单中用图标显示状态,代替原来的文字显示。
  7. # 默认最多同时显示5个状态
  8. #------------------------------------------------------------------------------
  9. # 设置方法:
  10. # 一个状态对应的图标文件名为“状态的动画ID.png”
  11. # 例如某状态的动画ID为50,那么它的图标就是“Icons\50.png”
  12. # 如果找不到对应的文件,会报错
  13. #==============================================================================

  14. # 注意,在ICON_STATE_IDS中写上需要带图标的状态ID
  15. # ICON_STATE_IDS是一个数组,数组的方法请参考帮助文件
  16. # 例如:
  17. # 只要1,5,8号状态带图标,就这样:ICON_STATE_IDS = [1,5,8]
  18. # 要20到50号状态带图标:ICON_STATE_IDS = 20..50

  19. ICON_STATE_IDS = [2..10]

  20. #==============================================================================
  21. # ■ Window_Base
  22. #------------------------------------------------------------------------------
  23. #  游戏中全部窗口的超级类。
  24. #==============================================================================

  25. class Window_Base < Window
  26. #--------------------------------------------------------------------------
  27. # ● 描绘状态
  28. #     actor : 角色
  29. #     x     : 描画目标 X 坐标
  30. #     y     : 描画目标 Y 坐标
  31. #     width : 描画目标的宽
  32. #--------------------------------------------------------------------------
  33. def draw_actor_state(actor, x, y, width = 120)
  34.   state_size = 0
  35.   for state in actor.states
  36.     # 图标数量超出宽度就中断循环
  37.     if state_size >= width / 1
  38.       break
  39.     end
  40.     # 此状态不带图标就跳过
  41.     if !ICON_STATE_IDS.include?(state)
  42.       next
  43.     end
  44.     bitmap = RPG::Cache.icon($data_states[state].name + "_sta.png")
  45.     if actor.states_turn[state] >= $data_states[state].hold_turn/2
  46.       opacity = 255
  47.     else
  48.       opacity = 100
  49.     end
  50.     # 这里的图标大小默认是24x24,要改就改下面那个Rect.new(0, 0, 24, 24)
  51.     self.contents.blt(x + 24 * state_size ,y ,bitmap, Rect.new(0, 0, 24, 24), opacity)
  52.     state_size += 1
  53.   end
  54. end
  55. end


  56. #==============================================================================
  57. # ■ Window_Help
  58. #------------------------------------------------------------------------------
  59. #  特技及物品的说明、角色的状态显示的窗口。
  60. #==============================================================================

  61. class Window_Help < Window_Base
  62. #--------------------------------------------------------------------------
  63. # ● 设置敌人
  64. #     enemy : 要显示名字和状态的敌人
  65. #--------------------------------------------------------------------------
  66. def set_enemy(enemy)
  67.   # 描绘状态图标
  68.   state_size = 0
  69.   for state in enemy.states
  70.     # 图标数量超出宽度就中断循环
  71.     if state_size >= width / 16
  72.       break
  73.     end
  74.     # 此状态不带图标就跳过
  75.     if !ICON_STATE_IDS.include?(state)
  76.       next
  77.     end
  78.     bitmap = RPG::Cache.icon($data_states[state].name + "_sta.png")
  79.     if enemy.states_turn[state] >= $data_states[state].hold_turn/2
  80.       opacity = 255
  81.     else
  82.       opacity = 100
  83.     end
  84.     self.contents.blt(70 + 16 * state_size, 0, bitmap, Rect.new(0, 0, 24, 24), opacity)
  85.     state_size += 1
  86.   end
  87.   # 描绘敌人名字
  88.   set_text(enemy.name, 1)
  89. end
  90. end

  91. class Game_Battler
  92. attr_reader :states_turn       # 声明状态剩余回合
  93. end
复制代码
回复 支持 反对

使用道具 举报

Lv5.捕梦者

梦石
0
星屑
33272
在线时间
5096 小时
注册时间
2012-11-19
帖子
4877

开拓者

4
发表于 2013-7-20 16:34:21 | 只看该作者
不是被覆盖了,而是没用以前的战斗状态窗口了,用的是那个 45 度 战斗自带的窗口。
感觉LZ用的脚本好杂,如果要达到LZ的要求,就需要整合。
但不知LZ的要求是怎么样的,没有一个模版:比如 敌人血条放哪儿?状态图标显示在哪个位置?
冒然整合也不符合LZ的要求。
xp vx va mv  va mz 各类型脚本/插件定制
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
47 小时
注册时间
2013-7-14
帖子
46
5
 楼主| 发表于 2013-7-21 09:57:12 | 只看该作者
在攻击敌人的时候,把敌人的血条显示在最上面那个框上,状态都在人物的左边
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
47 小时
注册时间
2013-7-14
帖子
46
6
 楼主| 发表于 2013-7-21 17:58:31 | 只看该作者
急!!!!快来回复呀
回复 支持 反对

使用道具 举报

Lv5.捕梦者 (版主)

梦石
20
星屑
1840
在线时间
6925 小时
注册时间
2012-12-14
帖子
11485

短篇十战斗者组别冠军开拓者贵宾短篇九勇士组亚军

7
发表于 2013-7-21 18:13:45 | 只看该作者
脚本好乱啊
看不下去了
能提供一下工程范例的话,可以会比较好解决······
大家好,这里是晨露的说。请多多指教。
刚入门RM软件制作,请大家多多帮助我哦。
落雪君的欢乐像素教程,欢迎查阅。

回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
47 小时
注册时间
2013-7-14
帖子
46
8
 楼主| 发表于 2013-7-22 13:02:36 | 只看该作者
就这个

Project1.zip

205.13 KB, 下载次数: 19

回复 支持 反对

使用道具 举报

Lv5.捕梦者 (版主)

梦石
20
星屑
1840
在线时间
6925 小时
注册时间
2012-12-14
帖子
11485

短篇十战斗者组别冠军开拓者贵宾短篇九勇士组亚军

9
发表于 2013-7-22 13:15:05 | 只看该作者
Project1.zip (204.19 KB, 下载次数: 24)
修改好了

点评

发现露露现在水平超高的说  发表于 2013-7-22 13:41
我不懂脚本······  发表于 2013-7-22 13:22
目前 指的是现在这个时刻..  发表于 2013-7-22 13:16
帮我看一下我的问题吧= = 发现目前论坛里懂脚本木有几个..  发表于 2013-7-22 13:16

评分

参与人数 1星屑 +105 收起 理由
弗雷德 + 105 认可答案

查看全部评分

大家好,这里是晨露的说。请多多指教。
刚入门RM软件制作,请大家多多帮助我哦。
落雪君的欢乐像素教程,欢迎查阅。

回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
47 小时
注册时间
2013-7-14
帖子
46
10
 楼主| 发表于 2013-7-22 13:20:18 | 只看该作者
哇!你修改的哪里呀?
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2025-6-26 07:14

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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