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

Project1

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

战斗菜单如何显示在每个人的头上

 关闭 [复制链接]
头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2008-3-25
帖子
178
跳转到指定楼层
1
发表于 2008-8-5 16:57:10 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
提示: 作者被禁止或删除 内容自动屏蔽

Lv1.梦旅人

B

梦石
0
星屑
50
在线时间
26 小时
注册时间
2007-8-26
帖子
3693
2
发表于 2008-8-5 19:18:24 | 只看该作者
1.理解不能

2.
  1. #==============================================================================
  2. # ■ Window_Base
  3. #------------------------------------------------------------------------------
  4. #  游戏中全部窗口的超级类。
  5. #==============================================================================
  6. $hp_size = 15   #  hp 字符的大小
  7. $sp_size = 15   #  sp 字符的大小
  8. class Window_Base < Window
  9. #--------------------------------------------------------------------------
  10. # ● 描绘 HP
  11. #     actor : 角色
  12. #     x     : 描画目标 X 坐标
  13. #     y     : 描画目标 Y 坐标
  14. #     width : 描画目标的宽
  15. #--------------------------------------------------------------------------
  16. def draw_actor_hp1(actor, x, y, width = 72)
  17. # 描绘字符串 "HP"
  18. self.contents.font.color = system_color
  19. #--------------------------------------------------------------------------

  20. self.contents.font.size = $hp_size

  21. #--------------------------------------------------------------------------
  22. self.contents.draw_text(x, y, 30, 30, $data_system.words.hp)
  23. # 计算描绘 MaxHP 所需的空间
  24. if width - 30 >= 32
  25.    hp_x = x + 32# + width - 30
  26. end
  27. # 描绘 HP
  28. self.contents.font.color = actor.hp == 0 ? knockout_color :
  29.    actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
  30. self.contents.draw_text(hp_x, y, 32, 30, actor.hp.to_s, 2)
  31. end
  32. #--------------------------------------------------------------------------
  33. # ● 描绘 SP
  34. #     actor : 角色
  35. #     x     : 描画目标 X 坐标
  36. #     y     : 描画目标 Y 坐标
  37. #     width : 描画目标的宽
  38. #--------------------------------------------------------------------------
  39. def draw_actor_sp1(actor, x, y, width = 72)
  40. # 描绘字符串 "SP"
  41. self.contents.font.color = system_color
  42. #--------------------------------------------------------------------------

  43. self.contents.font.size = $sp_size

  44. #--------------------------------------------------------------------------
  45. self.contents.draw_text(x, y, 30, 30, $data_system.words.sp)
  46. # 计算描绘 MaxSP 所需的空间
  47. if width - 30 >= 32
  48.    sp_x = x + 32# + width - 15
  49. end
  50. # 描绘 SP
  51. self.contents.font.color = actor.sp == 0 ? knockout_color :
  52.    actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
  53. self.contents.draw_text(sp_x, y, 32, 30, actor.sp.to_s, 2)
  54. end
  55. end





  56. #==============================================================================
  57. # ■ Window_BattleStatus
  58. #------------------------------------------------------------------------------
  59. #  显示战斗画面同伴状态的窗口。
  60. #==============================================================================

  61. class Window_BattleStatus < Window_Base
  62. #--------------------------------------------------------------------------
  63. # ● 初始化对像
  64. #--------------------------------------------------------------------------
  65. #$data_system_level_up_me = "Audio/ME/升级音乐"
  66. def initialize
  67. super(0, 0, 640, 480)
  68. self.contents = Bitmap.new(width - 32, height - 32)
  69. self.opacity = 0
  70. @level_up_flags = [false, false, false, false]
  71. refresh
  72. end
  73. #--------------------------------------------------------------------------
  74. # ● 释放
  75. #--------------------------------------------------------------------------
  76. def dispose
  77. super
  78. end
  79. #--------------------------------------------------------------------------
  80. # ● 设置升级标志
  81. #     actor_index : 角色索引
  82. #--------------------------------------------------------------------------
  83. def level_up(actor_index)
  84. @level_up_flags[actor_index] = true
  85. end
  86. #--------------------------------------------------------------------------
  87. # ● 刷新
  88. #--------------------------------------------------------------------------
  89. def refresh
  90. self.contents.clear
  91. @item_max = $game_party.actors.size
  92.   for i in 0...$game_party.actors.size
  93.    actor = $game_party.actors[i]
  94.    case i
  95.      when 0
  96.       x = 300
  97.       y = 320
  98.      when 1
  99.       x = 380
  100.       y = 280
  101.      when 2
  102.       x = 460  #+向右 -向左
  103.       y = 238  #+向下 -向上
  104.      when 3
  105.       x = 550
  106.       y = 207
  107.     end
  108.    if @level_up_flags[i]
  109.      self.contents.font.color = normal_color
  110.      self.contents.draw_text(x, y, 80, 24, "LEVEL UP!")
  111.      Audio.me_stop
  112. #        Audio.me_play($data_system_level_up_me)
  113.    else
  114.    draw_actor_hp1(actor, x-15, y-15, 80)
  115.    draw_actor_sp1(actor, x-15, y+5, 80)
  116.   end
  117. end
  118. end

  119. #--------------------------------------------------------------------------
  120. # ● 刷新画面
  121. #--------------------------------------------------------------------------
  122. def update
  123. super
  124. # 主界面的不透明度下降
  125. if $game_temp.battle_main_phase
  126.    self.contents_opacity -= 50 if self.contents_opacity > 1
  127. else
  128.    self.contents_opacity += 50 if self.contents_opacity < 255
  129. end
  130. end
  131. end





  132. #==============================================================================
  133. # ■ Window_BattleStatus
  134. #==============================================================================
  135. class Window_BattleStatus < Window_Base
  136. #--------------------------------------------------------------------------
  137. # ● 初始化
  138. #--------------------------------------------------------------------------
  139. alias xrxs_bp2_refresh refresh
  140. def refresh
  141. xrxs_bp2_refresh
  142. @item_max = $game_party.actors.size
  143.   for i in 0...$game_party.actors.size
  144.    actor = $game_party.actors[i]
  145.    case i
  146.      when 0
  147.       x = 300
  148.       y = 300
  149.      when 1
  150.       x = 380
  151.       y = 260
  152.      when 2
  153.       x = 460
  154.       y = 210
  155.      when 3
  156.       x = 550
  157.       y = 185
  158.     end
  159.    draw_actor_hp_meter(actor, x, y, 50)
  160.    draw_actor_sp_meter(actor, x, y + 8, 50)
  161. end
  162. end
  163. end
  164. #==============================================================================
  165. # ■ Window_Base
  166. #==============================================================================
  167. class Window_Base < Window
  168. #--------------------------------------------------------------------------
  169. # ● HP描画
  170. #--------------------------------------------------------------------------
  171. def draw_actor_hp_meter(actor, x, y, width = 156, type = 0)
  172. if type == 1 and actor.hp == 0
  173.    return
  174. end
  175. self.contents.font.color = system_color
  176. self.contents.fill_rect(x-1, y+27, width+2,6, Color.new(0, 0, 0, 25))
  177. w = width * actor.hp / actor.maxhp
  178. self.contents.fill_rect(x, y+28, w,1, Color.new(200, 0, 0, 255))
  179. self.contents.fill_rect(x, y+29, w,1, Color.new(255, 0, 0, 255))
  180. self.contents.fill_rect(x, y+30, w,1, Color.new(128, 0, 0, 255))
  181. self.contents.fill_rect(x, y+31, w,1, Color.new(0, 0, 0, 255))

  182. end
  183. #--------------------------------------------------------------------------
  184. # ● SP描画
  185. #--------------------------------------------------------------------------
  186. def draw_actor_sp_meter(actor, x, y, width = 156, type = 0)
  187. if type == 1 and actor.hp == 0
  188.    return
  189. end
  190. self.contents.font.color = system_color
  191. self.contents.fill_rect(x-1, y+27, width+2,6, Color.new(0, 0, 0, 255))
  192. w = width * actor.sp / actor.maxsp
  193. self.contents.fill_rect(x, y+28, w,1, Color.new(128, 255, 255, 255))
  194. self.contents.fill_rect(x, y+29, w,1, Color.new(0, 255, 255, 255))
  195. self.contents.fill_rect(x, y+30, w,1, Color.new(0, 192, 192, 255))
  196. self.contents.fill_rect(x, y+31, w,1, Color.new(0, 128, 128, 255))
  197. end
  198. end
复制代码


3.   Scene_Battle 1
     30行
   
s5 = "逃跑"
    @actor_command_window = Window_Command.new(160, [s1, s2, s3, s4,s5])


     Scene_Battle 3
     152
        when 4
        # 不能逃跑的情况下
        if $game_temp.battle_can_escape == false
          # 演奏冻结 SE
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        # 演奏确定 SE
        $game_system.se_play($data_system.decision_se)
        # 逃走处理
        update_phase2_escape


回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2008-3-25
帖子
178
3
 楼主| 发表于 2008-8-5 19:29:01 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

Lv1.梦旅人

B

梦石
0
星屑
50
在线时间
26 小时
注册时间
2007-8-26
帖子
3693
4
发表于 2008-8-5 19:43:22 | 只看该作者
start_item_select 下面

1.Scene_Battle 3
  80 行
  覆盖 @actor_command_window.x
   case @actor_index
     when 0
      x = 300
      y = 320
     when 1
      x = 380
      y = 280
     when 2
      x = 460  #+向右 -向左
      y = 238  #+向下 -向上
     when 3
      x = 550
      y = 207
    end
    @actor_command_window.y = y - 160
    @actor_command_window.x = x - 50
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2008-3-25
帖子
178
5
 楼主| 发表于 2008-8-5 20:02:51 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

Lv1.梦旅人

B

梦石
0
星屑
50
在线时间
26 小时
注册时间
2007-8-26
帖子
3693
6
发表于 2008-8-5 20:04:48 | 只看该作者
站上有个范例

http://rpg.blue/UP_PIC/200801/逃跑.rar
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2008-3-25
帖子
178
7
 楼主| 发表于 2008-8-5 20:26:27 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

Lv1.梦旅人

B

梦石
0
星屑
50
在线时间
26 小时
注册时间
2007-8-26
帖子
3693
8
发表于 2008-8-5 21:10:29 | 只看该作者
打开Game.ini
换成以下的
[Game]
Library=RGSS102J.dll
Scripts=Data\Scripts.rxdata
Title=Project13
RTP1=Standard
RTP2=
RTP3=


999999999999
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2008-3-25
帖子
178
9
 楼主| 发表于 2008-8-5 21:25:15 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

Lv1.梦旅人

B

梦石
0
星屑
50
在线时间
26 小时
注册时间
2007-8-26
帖子
3693
10
发表于 2008-8-5 21:28:24 | 只看该作者
def draw_actor_hp1(actor, x, y, width = 72)
def draw_actor_sp1(actor, x, y, width = 72)
width = 72 是 宽度



这是答案

以下引用ONEWateR于2008-8-5 11:43:22的发言:



1.Scene_Battle 3
80 行
覆盖 @actor_command_window.x

  case @actor_index
    when 0
     x = 300
     y = 320
    when 1
     x = 380
     y = 280
    when 2
     x = 460  #+向右 -向左
     y = 238  #+向下 -向上
    when 3
     x = 550
     y = 207
   end
   @actor_command_window.y = y - 160
   @actor_command_window.x = x - 50

回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2025-8-14 03:06

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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