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

Project1

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

如何在战斗时,我方角色头上或脚下显示红和蓝呢

 关闭 [复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
77 小时
注册时间
2008-5-17
帖子
39
跳转到指定楼层
1
发表于 2008-8-8 23:19:31 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
如题
此贴于 2008-8-10 13:39:06 被版主darkten提醒,请楼主看到后对本贴做出回应。
版务信息:版主帮忙结贴~
小小的我,生活在小小的世界里!

Lv1.梦旅人

梦石
0
星屑
60
在线时间
1 小时
注册时间
2008-6-24
帖子
149
2
发表于 2008-8-8 23:37:35 | 只看该作者
仿梦幻血条
http://rpg.blue/viewthread.php?t ... D8%2D8+15%3A31%3A00

系统信息:本贴由本区版主认可为正确答案,66RPG感谢您的热情解答~
回复 支持 反对

使用道具 举报

Lv1.梦旅人

随缘

梦石
0
星屑
55
在线时间
12 小时
注册时间
2007-12-16
帖子
671
3
发表于 2008-8-8 23:55:22 | 只看该作者


  1. #==============================================================================
  2. # ■ Window_Base
  3. #------------------------------------------------------------------------------
  4. #  游戏中全部窗口的超级类。
  5. #==============================================================================

  6. class Window_Base < Window
  7. #--------------------------------------------------------------------------
  8. # ● 描绘 HP
  9. #     actor : 角色
  10. #     x     : 描画目标 X 坐标
  11. #     y     : 描画目标 Y 坐标
  12. #     width : 描画目标的宽
  13. #--------------------------------------------------------------------------
  14. def draw_actor_hp1(actor, x, y, width = 72)
  15.    # 描绘字符串 "HP"
  16.    self.contents.font.color = system_color
  17.    self.contents.draw_text(x, y, 24, 24, $data_system.words.hp)
  18.    # 计算描绘 MaxHP 所需的空间
  19.    if width - 24 >= 32
  20.      hp_x = x + 32# + width - 24
  21.    end
  22.    # 描绘 HP
  23.    self.contents.font.color = actor.hp == 0 ? knockout_color :
  24.      actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
  25.    self.contents.draw_text(hp_x, y, 32, 24, actor.hp.to_s, 2)
  26. end
  27. #--------------------------------------------------------------------------
  28. # ● 描绘 SP
  29. #     actor : 角色
  30. #     x     : 描画目标 X 坐标
  31. #     y     : 描画目标 Y 坐标
  32. #     width : 描画目标的宽
  33. #--------------------------------------------------------------------------
  34. def draw_actor_sp1(actor, x, y, width = 72)
  35.    # 描绘字符串 "SP"
  36.    self.contents.font.color = system_color
  37.    self.contents.draw_text(x, y, 24, 24, $data_system.words.sp)
  38.    # 计算描绘 MaxSP 所需的空间
  39.    if width - 24 >= 32
  40.      sp_x = x + 32# + width - 24
  41.    end
  42.    # 描绘 SP
  43.    self.contents.font.color = actor.sp == 0 ? knockout_color :
  44.      actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
  45.    self.contents.draw_text(sp_x, y, 32, 24, actor.sp.to_s, 2)
  46. end
  47. end





  48. #==============================================================================
  49. # ■ Window_BattleStatus
  50. #------------------------------------------------------------------------------
  51. #  显示战斗画面同伴状态的窗口。
  52. #==============================================================================

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

  111. #--------------------------------------------------------------------------
  112. # ● 刷新画面
  113. #--------------------------------------------------------------------------
  114. def update
  115.    super
  116.    # 主界面的不透明度下降
  117.    if $game_temp.battle_main_phase
  118.      self.contents_opacity -= 50 if self.contents_opacity > 1
  119.    else
  120.      self.contents_opacity += 50 if self.contents_opacity < 255
  121.    end
  122. end
  123. end





  124. #==============================================================================
  125. # ■ Window_BattleStatus
  126. #==============================================================================
  127. class Window_BattleStatus < Window_Base
  128. #--------------------------------------------------------------------------
  129. # ● 初始化
  130. #--------------------------------------------------------------------------
  131. alias xrxs_bp2_refresh refresh
  132. def refresh
  133.    xrxs_bp2_refresh
  134.    @item_max = $game_party.actors.size
  135.     for i in 0...$game_party.actors.size
  136.      actor = $game_party.actors[i]
  137.      case i
  138.        when 0
  139.         x = 60
  140.         y = 400
  141.        when 1
  142.         x = 220
  143.         y = 400
  144.        when 2
  145.         x = 360
  146.         y = 400
  147.        when 3
  148.         x = 520
  149.         y = 400
  150.       end
  151.      draw_actor_hp_meter(actor, x, y, 50)
  152.      draw_actor_sp_meter(actor, x, y + 8, 50)
  153.    end
  154. end
  155. end
  156. #==============================================================================
  157. # ■ Window_Base
  158. #==============================================================================
  159. class Window_Base < Window
  160. #--------------------------------------------------------------------------
  161. # ● HP描画
  162. #--------------------------------------------------------------------------
  163. def draw_actor_hp_meter(actor, x, y, width = 156, type = 0)
  164.    if type == 1 and actor.hp == 0
  165.      return
  166.    end
  167.    self.contents.font.color = system_color
  168.    self.contents.fill_rect(x-1, y+27, width+2,6, Color.new(0, 0, 0, 25))
  169.    w = width * actor.hp / actor.maxhp
  170.    self.contents.fill_rect(x, y+28, w,1, Color.new(255, 96, 96, 255))
  171.    self.contents.fill_rect(x, y+29, w,1, Color.new(255, 0, 0, 255))
  172.    self.contents.fill_rect(x, y+30, w,1, Color.new(128, 0, 0, 255))
  173.    self.contents.fill_rect(x, y+31, w,1, Color.new(0, 0, 0, 255))
  174.    
  175.    end
  176. #--------------------------------------------------------------------------
  177. # ● SP描画
  178. #--------------------------------------------------------------------------
  179. def draw_actor_sp_meter(actor, x, y, width = 156, type = 0)
  180.    if type == 1 and actor.hp == 0
  181.      return
  182.    end
  183.    self.contents.font.color = system_color
  184.    self.contents.fill_rect(x-1, y+27, width+2,6, Color.new(0, 0, 0, 255))
  185.    w = width * actor.sp / actor.maxsp
  186.    self.contents.fill_rect(x, y+28, w,1, Color.new(128, 255, 255, 255))
  187.    self.contents.fill_rect(x, y+29, w,1, Color.new(0, 255, 255, 255))
  188.    self.contents.fill_rect(x, y+30, w,1, Color.new(0, 192, 192, 255))
  189.    self.contents.fill_rect(x, y+31, w,1, Color.new(0, 128, 128, 255))
  190. end
  191. end
复制代码
论坛:
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2025-9-16 20:10

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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