查看: 3619|回复: 2

[已经解决] 请问怎么给自己加一个最经典的血条

[复制链接]
梦石
0
星屑
476
在线时间
30 小时
注册时间
2019-8-23
回帖
42
发表于 2019-8-23 19:48:05 | 显示全部楼层 |阅读模式

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

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

×
我看了一下敌人的血条的脚本都可以不用图片直接显示最经典的,但是我自己的没有...求一个自己的血条显示,拜托大佬们
梦石
0
星屑
431
在线时间
43 小时
注册时间
2009-5-6
回帖
58
发表于 2019-8-23 22:15:08 | 显示全部楼层
本帖最后由 yumeyuuya 于 2019-8-23 22:16 编辑

我方血条等

  1. #==============================================================================
  2. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  3. #==============================================================================


  4. # ————————————————————————————————————

  5. # HP/SP/EXPゲージ表示スクリプト Ver 1.00
  6. # 配布元・サポートURL
  7. # http://members.jcom.home.ne.jp/cogwheel/

  8. #==============================================================================
  9. # ■ Game_Actor
  10. #------------------------------------------------------------------------------
  11. #  アクターを扱うクラスです。このクラスは Game_Actors クラス ($game_actors)
  12. # の内部で使用され、Game_Party クラス ($game_party) からも参照されます。
  13. #==============================================================================

  14. class Game_Actor < Game_Battler
  15.   def now_exp
  16.     return @exp - @exp_list[@level]
  17.   end
  18.   def next_exp
  19.     return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
  20.   end
  21. end

  22. #==============================================================================
  23. # ■ Window_Base
  24. #------------------------------------------------------------------------------
  25. #  ゲーム中のすべてのウィンドウのスーパークラスです。
  26. #==============================================================================

  27. class Window_Base < Window
  28.   #--------------------------------------------------------------------------
  29.   # ● HP ゲージの描画
  30.   #--------------------------------------------------------------------------
  31.   # オリジナルのHP描画を draw_actor_hp_original と名前変更
  32.   alias :draw_actor_hp_original :draw_actor_hp
  33.   def draw_actor_hp(actor, x, y, width = 144)
  34.     # 変数rateに 現在のHP/MHPを代入
  35.     if actor.maxhp != 0
  36.       rate = actor.hp.to_f / actor.maxhp
  37.     else
  38.       rate = 0
  39.     end
  40.     # plus_x:X座標の位置補正 rate_x:X座標の位置補正(%) plus_y:Y座標の位置補正
  41.     # plus_width:幅の補正 rate_width:幅の補正(%) height:縦幅
  42.     # align1:描画タイプ1 0:左詰め 1:中央揃え 2:右詰め
  43.     # align2:描画タイプ2 0:上詰め 1:中央揃え 2:下詰め
  44.     # align3:ゲージタイプ 0:左詰め 1:右詰め
  45.     plus_x = 0
  46.     rate_x = 0
  47.     plus_y = 25
  48.     plus_width = 0
  49.     rate_width = 100
  50.     height = 10
  51.     align1 = 1
  52.     align2 = 2
  53.     align3 = 0
  54.     # 渐变设定   grade1:空量规    grade2:实量规
  55.     # (0:横向渐变 1:纵向渐变 2:斜向渐变(过重))
  56.     grade1 = 1
  57.     grade2 = 0
  58.     # 颜色设置。color1:边框,color2:中框
  59.     # color3:空槽深色,  color4:空槽深色
  60.     # color5:深色测量器, color6:真色测量器
  61.     color1 = Color.new(0, 0, 0, 192)
  62.     color2 = Color.new(255, 255, 192, 192)
  63.     color3 = Color.new(0, 0, 0, 192)
  64.     color4 = Color.new(64, 0, 0, 192)
  65.     color5 = Color.new(80 - 24 * rate, 80 * rate, 14 * rate, 192)
  66.     color6 = Color.new(240 - 72 * rate, 240 * rate, 62 * rate, 192)
  67.     # 変数spに描画するゲージの幅を代入
  68.     if actor.maxhp != 0
  69.       hp = (width + plus_width) * actor.hp * rate_width / 100 / actor.maxhp
  70.     else
  71.       hp = 0
  72.     end
  73.     # ゲージの描画
  74.     gauge_rect(x + plus_x + width * rate_x / 100, y + plus_y,
  75.                 width, plus_width + width * rate_width / 100,
  76.                 height, hp, align1, align2, align3,
  77.                 color1, color2, color3, color4, color5, color6, grade1, grade2)
  78.     # オリジナルのHP描画処理を呼び出し
  79.     draw_actor_hp_original(actor, x, y, width)
  80.   end
  81. #--------------------------------------------------------------------------
  82.   # ● SP ゲージの描画
  83.   #--------------------------------------------------------------------------
  84.   # オリジナルのSP描画を draw_actor_sp_original と名前変更
  85.   alias :draw_actor_sp_original :draw_actor_sp
  86.   def draw_actor_sp(actor, x, y, width = 144)
  87.     # 変数rateに 現在のSP/MSPを代入
  88.     if actor.maxsp != 0
  89.       rate = actor.sp.to_f / actor.maxsp
  90.     else
  91.       rate = 1
  92.     end
  93.     # plus_x:X座標の位置補正 rate_x:X座標の位置補正(%) plus_y:Y座標の位置補正
  94.     # plus_width:幅の補正 rate_width:幅の補正(%) height:縦幅
  95.     # align1:描画タイプ1 0:左詰め 1:中央揃え 2:右詰め
  96.     # align2:描画タイプ2 0:上詰め 1:中央揃え 2:下詰め
  97.     # align3:ゲージタイプ 0:左詰め 1:右詰め
  98.     plus_x = 0
  99.     rate_x = 0
  100.     plus_y = 25
  101.     plus_width = 0
  102.     rate_width = 100
  103.     height = 10
  104.     align1 = 1
  105.     align2 = 2
  106.     align3 = 0
  107.     # グラデーション設定 grade1:空ゲージ grade2:実ゲージ
  108.     # (0:横にグラデーション 1:縦にグラデーション 2:斜めにグラデーション(激重))
  109.     grade1 = 1
  110.     grade2 = 0
  111.     # 色設定。color1:外枠,color2:中枠
  112.     # color3:空ゲージダークカラー,color4:空ゲージライトカラー
  113.     # color5:実ゲージダークカラー,color6:実ゲージライトカラー
  114.     color1 = Color.new(0, 0, 0, 192)
  115.     color2 = Color.new(255, 255, 192, 192)
  116.     color3 = Color.new(0, 0, 0, 192)
  117.     color4 = Color.new(0, 64, 0, 192)
  118.     color5 = Color.new(14 * rate, 80 - 24 * rate, 80 * rate, 192)
  119.     color6 = Color.new(62 * rate, 240 - 72 * rate, 240 * rate, 192)
  120.     # 変数spに描画するゲージの幅を代入
  121.     if actor.maxsp != 0
  122.       sp = (width + plus_width) * actor.sp * rate_width / 100 / actor.maxsp
  123.     else
  124.       sp = (width + plus_width) * rate_width / 100
  125.     end
  126.     # ゲージの描画
  127.     gauge_rect(x + plus_x + width * rate_x / 100, y + plus_y,
  128.                 width, plus_width + width * rate_width / 100,
  129.                 height, sp, align1, align2, align3,
  130.                 color1, color2, color3, color4, color5, color6, grade1, grade2)
  131.     # オリジナルのSP描画処理を呼び出し
  132.     draw_actor_sp_original(actor, x, y, width)
  133.   end
  134.   #--------------------------------------------------------------------------
  135.   # ● EXP ゲージの描画
  136.   #--------------------------------------------------------------------------
  137.   # オリジナルのEXP描画を draw_actor_sp_original と名前変更
  138.   alias :draw_actor_exp_original :draw_actor_exp
  139.   def draw_actor_exp(actor, x, y, width = 144)#204)
  140.     # 変数rateに 現在のexp/nextexpを代入
  141.     if actor.next_exp != 0
  142.       rate = actor.now_exp.to_f / actor.next_exp
  143.     else
  144.       rate = 1
  145.     end
  146.     # plus_x:X座標の位置補正 rate_x:X座標の位置補正(%) plus_y:Y座標の位置補正
  147.     # plus_width:幅の補正 rate_width:幅の補正(%) height:縦幅
  148.     # align1:描画タイプ1 0:左詰め 1:中央揃え 2:右詰め
  149.     # align2:描画タイプ2 0:上詰め 1:中央揃え 2:下詰め
  150.     # align3:ゲージタイプ 0:左詰め 1:右詰め
  151.     plus_x = 0
  152.     rate_x = 0
  153.     plus_y = 25
  154.     plus_width = 0
  155.     rate_width = 100
  156.     height = 10
  157.     align1 = 1
  158.     align2 = 2
  159.     align3 = 0
  160.     # グラデーション設定 grade1:空ゲージ grade2:実ゲージ
  161.     # (0:横にグラデーション 1:縦にグラデーション 2:斜めにグラデーション(激重))
  162.     grade1 = 1
  163.     grade2 = 0
  164.     # 色設定。color1:外枠,color2:中枠
  165.     # color3:空ゲージダークカラー,color4:空ゲージライトカラー
  166.     # color5:実ゲージダークカラー,color6:実ゲージライトカラー
  167.     color1 = Color.new(0, 0, 0, 192)
  168.     color2 = Color.new(255, 255, 192, 192)
  169.     color3 = Color.new(0, 0, 0, 192)
  170.     color4 = Color.new(64, 0, 0, 192)
  171.     color5 = Color.new(10 * rate, 70 - 10 * rate ** 2, 70  * rate, 192)
  172.     color6 = Color.new(10 * rate, 240 - 10 * rate ** 2, 240 * rate, 192)
  173.     #color5 = Color.new(80 * rate, 80 - 80 * rate ** 2, 80 - 80 * rate, 192)
  174.     #color6 = Color.new(240 * rate, 240 - 240 * rate ** 2, 240 - 240 * rate, 192)
  175.     # 変数expに描画するゲージの幅を代入
  176.     if actor.next_exp != 0
  177.       exp = (width + plus_width) * actor.now_exp * rate_width/100/actor.next_exp
  178.     else
  179.       exp = (width + plus_width) * rate_width / 100
  180.     end
  181.     # ゲージの描画
  182.     gauge_rect(x + plus_x + width * rate_x / 100, y + plus_y,
  183.                 width, plus_width + width * rate_width / 100,
  184.                 height, exp, align1, align2, align3,
  185.                 color1, color2, color3, color4, color5, color6, grade1, grade2)
  186.     # オリジナルのEXP描画処理を呼び出し
  187.     draw_actor_exp_original(actor, x, y)
  188.   end
  189.   #--------------------------------------------------------------------------
  190.   # ● ゲージの描画
  191.   #--------------------------------------------------------------------------
  192.   def gauge_rect(x, y, rect_width, width, height, gauge, align1, align2, align3,
  193.                 color1, color2, color3, color4, color5, color6, grade1, grade2)
  194.     case align1
  195.     when 1
  196.       x += (rect_width - width) / 2
  197.     when 2
  198.       x += rect_width - width
  199.     end
  200.     case align2
  201.     when 1
  202.       y -= height / 2
  203.     when 2
  204.       y -= height
  205.     end
  206.     # 枠描画
  207.     self.contents.fill_rect(x, y, width, height, color1)
  208.     self.contents.fill_rect(x + 1, y + 1, width - 2, height - 2, color2)
  209.     if align3 == 0
  210.       if grade1 == 2
  211.         grade1 = 3
  212.       end
  213.       if grade2 == 2
  214.         grade2 = 3
  215.       end
  216.     end
  217.     if (align3 == 1 and grade1 == 0) or grade1 > 0
  218.       color = color3
  219.       color3 = color4
  220.       color4 = color
  221.     end
  222.     if (align3 == 1 and grade2 == 0) or grade2 > 0
  223.       color = color5
  224.       color5 = color6
  225.       color6 = color
  226.     end
  227.     # 空ゲージの描画
  228.     self.contents.gradation_rect(x + 2, y + 2, width - 4, height - 4,
  229.                                   color3, color4, grade1)
  230.     if align3 == 1
  231.       x += width - gauge
  232.     end
  233.     # 実ゲージの描画
  234.     self.contents.gradation_rect(x + 2, y + 2, gauge - 4, height - 4,
  235.                                   color5, color6, grade2)
  236.   end
  237. end

  238. #------------------------------------------------------------------------------
  239. #  Bitmapクラスに新たな機能を追加します。
  240. #==============================================================================

  241. class Bitmap
  242.   #--------------------------------------------------------------------------
  243.   # ● 矩形をグラデーション表示
  244.   #     color1 : スタートカラー
  245.   #     color2 : エンドカラー
  246.   #     align  :  0:横にグラデーション
  247.   #               1:縦にグラデーション
  248.   #               2:斜めにグラデーション(激重につき注意)
  249.   #--------------------------------------------------------------------------
  250.   def gradation_rect(x, y, width, height, color1, color2, align = 0)
  251.     if align == 0
  252.       for i in x...x + width
  253.         red   = color1.red + (color2.red - color1.red) * (i - x) / (width - 1)
  254.         green = color1.green +
  255.                 (color2.green - color1.green) * (i - x) / (width - 1)
  256.         blue  = color1.blue +
  257.                 (color2.blue - color1.blue) * (i - x) / (width - 1)
  258.         alpha = color1.alpha +
  259.                 (color2.alpha - color1.alpha) * (i - x) / (width - 1)
  260.         color = Color.new(red, green, blue, alpha)
  261.         fill_rect(i, y, 1, height, color)
  262.       end
  263.     elsif align == 1
  264.       for i in y...y + height
  265.         red   = color1.red +
  266.                 (color2.red - color1.red) * (i - y) / (height - 1)
  267.         green = color1.green +
  268.                 (color2.green - color1.green) * (i - y) / (height - 1)
  269.         blue  = color1.blue +
  270.                 (color2.blue - color1.blue) * (i - y) / (height - 1)
  271.         alpha = color1.alpha +
  272.                 (color2.alpha - color1.alpha) * (i - y) / (height - 1)
  273.         color = Color.new(red, green, blue, alpha)
  274.         fill_rect(x, i, width, 1, color)
  275.       end
  276.     elsif align == 2
  277.       for i in x...x + width
  278.         for j in y...y + height
  279.           red   = color1.red + (color2.red - color1.red) *
  280.                   ((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
  281.           green = color1.green + (color2.green - color1.green) *
  282.                   ((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
  283.           blue  = color1.blue + (color2.blue - color1.blue) *
  284.                   ((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
  285.           alpha = color1.alpha + (color2.alpha - color1.alpha) *
  286.                   ((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
  287.           color = Color.new(red, green, blue, alpha)
  288.           set_pixel(i, j, color)
  289.         end
  290.       end
  291.     elsif align == 3
  292.       for i in x...x + width
  293.         for j in y...y + height
  294.           red   = color1.red + (color2.red - color1.red) *
  295.                 ((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
  296.           green = color1.green + (color2.green - color1.green) *
  297.                 ((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
  298.           blue  = color1.blue + (color2.blue - color1.blue) *
  299.                 ((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
  300.           alpha = color1.alpha + (color2.alpha - color1.alpha) *
  301.                 ((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
  302.           color = Color.new(red, green, blue, alpha)
  303.           set_pixel(i, j, color)
  304.         end
  305.       end
  306.     end
  307.   end
  308. end

  309. #==============================================================================
  310. # ■ Spriteモジュール
  311. #------------------------------------------------------------------------------
  312. #  アニメーションの管理を行うモジュールです。
  313. #==============================================================================

  314. module RPG
  315.   class Sprite < ::Sprite
  316.     def damage(value, critical)
  317.       dispose_damage
  318.       if value.is_a?(Numeric)
  319.         damage_string = value.abs.to_s
  320.       else
  321.         damage_string = value.to_s
  322.       end
  323.       bitmap = Bitmap.new(160, 48)
  324.       bitmap.font.name = "Arial Black"
  325.       bitmap.font.size = 32
  326.       bitmap.font.color.set(0, 0, 0)
  327.       bitmap.draw_text(-1, 12-1, 160, 36, damage_string, 1)
  328.       bitmap.draw_text(+1, 12-1, 160, 36, damage_string, 1)
  329.       bitmap.draw_text(-1, 12+1, 160, 36, damage_string, 1)
  330.       bitmap.draw_text(+1, 12+1, 160, 36, damage_string, 1)
  331.       if value.is_a?(Numeric) and value < 0
  332.         bitmap.font.color.set(176, 255, 144)
  333.       else
  334.         bitmap.font.color.set(255, 255, 255)
  335.       end
  336.       bitmap.draw_text(0, 12, 160, 36, damage_string, 1)
  337.       if critical
  338.         bitmap.font.size = 20
  339.         bitmap.font.color.set(0, 0, 0)
  340.         bitmap.draw_text(-1, -1, 160, 20, "必杀", 1)
  341.         bitmap.draw_text(+1, -1, 160, 20, "必杀", 1)
  342.         bitmap.draw_text(-1, +1, 160, 20, "必杀", 1)
  343.         bitmap.draw_text(+1, +1, 160, 20, "必杀", 1)
  344.         bitmap.font.color.set(255, 255, 255)
  345.         bitmap.draw_text(0, 0, 160, 20, "必杀", 1)
  346.       end
  347.       @_damage_sprite = ::Sprite.new
  348.       @_damage_sprite.bitmap = bitmap
  349.       @_damage_sprite.ox = 80 + self.viewport.ox
  350.       @_damage_sprite.oy = 20 + self.viewport.oy
  351.       @_damage_sprite.x = self.x + self.viewport.rect.x
  352.       @_damage_sprite.y = self.y - self.oy / 2 + self.viewport.rect.y
  353.       @_damage_sprite.z = 3000
  354.       @_damage_duration = 40
  355.     end
  356.     def animation(animation, hit)
  357.       dispose_animation
  358.       @_animation = animation
  359.       return if @_animation == nil
  360.       @_animation_hit = hit
  361.       @_animation_duration = @_animation.frame_max
  362.       animation_name = @_animation.animation_name
  363.       animation_hue = @_animation.animation_hue
  364.       bitmap = RPG::Cache.animation(animation_name, animation_hue)
  365.       if @@_reference_count.include?(bitmap)
  366.         @@_reference_count[bitmap] += 1
  367.       else
  368.         @@_reference_count[bitmap] = 1
  369.       end
  370.       @_animation_sprites = []
  371.       if @_animation.position != 3 or not @@_animations.include?(animation)
  372.         for i in 0..15
  373.           sprite = ::Sprite.new
  374.           sprite.bitmap = bitmap
  375.           sprite.visible = false
  376.           @_animation_sprites.push(sprite)
  377.         end
  378.         unless @@_animations.include?(animation)
  379.           @@_animations.push(animation)
  380.         end
  381.       end
  382.       update_animation
  383.     end
  384.     def loop_animation(animation)
  385.       return if animation == @_loop_animation
  386.       dispose_loop_animation
  387.       @_loop_animation = animation
  388.       return if @_loop_animation == nil
  389.       @_loop_animation_index = 0
  390.       animation_name = @_loop_animation.animation_name
  391.       animation_hue = @_loop_animation.animation_hue
  392.       bitmap = RPG::Cache.animation(animation_name, animation_hue)
  393.       if @@_reference_count.include?(bitmap)
  394.         @@_reference_count[bitmap] += 1
  395.       else
  396.         @@_reference_count[bitmap] = 1
  397.       end
  398.       @_loop_animation_sprites = []
  399.       for i in 0..15
  400.         sprite = ::Sprite.new
  401.         sprite.bitmap = bitmap
  402.         sprite.visible = false
  403.         @_loop_animation_sprites.push(sprite)
  404.       end
  405.       update_loop_animation
  406.     end
  407.     def animation_set_sprites(sprites, cell_data, position)
  408.       for i in 0..15
  409.         sprite = sprites[i]
  410.         pattern = cell_data[i, 0]
  411.         if sprite == nil or pattern == nil or pattern == -1
  412.           sprite.visible = false if sprite != nil
  413.           next
  414.         end
  415.         sprite.visible = true
  416.         sprite.src_rect.set(pattern % 5 * 192, pattern / 5 * 192, 192, 192)
  417.         if position == 3
  418.           if self.viewport != nil
  419.             sprite.x = self.viewport.rect.width / 2
  420.             sprite.y = self.viewport.rect.height - 160
  421.           else
  422.             sprite.x = 320
  423.             sprite.y = 240
  424.           end
  425.         else
  426.           sprite.x = self.x + self.viewport.rect.x -
  427.                       self.ox + self.src_rect.width / 2
  428.           sprite.y = self.y + self.viewport.rect.y -
  429.                       self.oy + self.src_rect.height / 2
  430.           sprite.y -= self.src_rect.height / 4 if position == 0
  431.           sprite.y += self.src_rect.height / 4 if position == 2
  432.         end
  433.         sprite.x += cell_data[i, 1]
  434.         sprite.y += cell_data[i, 2]
  435.         sprite.z = 2000
  436.         sprite.ox = 96
  437.         sprite.oy = 96
  438.         sprite.zoom_x = cell_data[i, 3] / 100.0
  439.         sprite.zoom_y = cell_data[i, 3] / 100.0
  440.         sprite.angle = cell_data[i, 4]
  441.         sprite.mirror = (cell_data[i, 5] == 1)
  442.         sprite.opacity = cell_data[i, 6] * self.opacity / 255.0
  443.         sprite.blend_type = cell_data[i, 7]
  444.       end
  445.     end
  446.   end
  447. end

  448. #==============================================================================
  449. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  450. #==============================================================================
复制代码


敌方血条

  1. #敌人血条
  2. class Window_Help < Window_Base
  3.   def set_enemy(actor)
  4.    self.contents.clear
  5.     draw_actor_name(actor, 4, 0)
  6.     draw_actor_state(actor, 140, 0)
  7.     carol3_draw_hp_bar(actor, 284, 0)
  8.     carol3_draw_sp_bar(actor, 460, 0)
  9.      @text = nil
  10.    self.visible = true
  11.    end
  12.    
  13.    def carol3_draw_hp_bar(actor, x, y, width = 128) #宽度可调
  14.     self.contents.font.color = system_color
  15.      w = width * actor.hp / [actor.maxhp,1].max
  16.       if actor.maxhp != 0
  17.        rate = actor.hp.to_f / actor.maxhp
  18.       else
  19.        rate = 0
  20.     end

  21.     color1 = Color.new(240 - 72 * rate, 240 * rate, 62 * rate, 150)
  22.      self.contents.fill_rect(x+1, y+15, width+2,1, Color.new(0, 0, 0, 255))
  23.      self.contents.fill_rect(x+1, y+16, width+2,1, Color.new(255, 255, 192, 192))
  24.      self.contents.fill_rect(x+1, y+17, w,6,color1)
  25.      self.contents.fill_rect(x+1, y+23, width+2,1, Color.new(255, 255, 192, 192))
  26.      self.contents.fill_rect(x+1, y+24, width+2,1, Color.new(0, 0, 0, 255))
  27.      self.contents.fill_rect(x, y+16, 1,8, Color.new(255, 255, 192, 192))
  28.      self.contents.fill_rect(x-1, y+15, 1,10, Color.new(0, 0, 0, 255))
  29.      self.contents.fill_rect(x+129, y+16, 1,8, Color.new(255, 255, 192, 192))
  30.      self.contents.fill_rect(x+130, y+15, 1,10, Color.new(0, 0, 0, 255))
  31.      self.contents.draw_text(x-53,y,128,32,$data_system.words.hp,1)
  32.      #这里隐藏掉的是敌人的HP数值
  33.      #if actor.hp>actor.maxhp/3
  34.         #self.contents.font.color = Color.new(255, 255, 255, 250)
  35.        #end
  36.       #if actor.hp>=actor.maxhp/6 and actor.maxhp/3>actor.hp
  37.         #self.contents.font.color = Color.new(200, 200, 0, 255)
  38.        #end
  39.       #if actor.maxhp/6>actor.hp
  40.         #self.contents.font.color = Color.new(200, 0, 0, 255)
  41.        #end
  42.         #self.contents.draw_text(x+47,y,128,32,actor.hp.to_s,1)
  43.        end
  44.    
  45.     def carol3_draw_sp_bar(actor, x, y, width = 128)
  46.      self.contents.font.color = system_color
  47.       if actor.maxsp != 0
  48.          rate = actor.sp.to_f / actor.maxsp
  49.        else
  50.          rate = 0
  51.        end

  52.     color2 = Color.new(62 * rate, 240 - 72 * rate, 240 * rate, 192)
  53.       w = width * actor.sp / [actor.maxsp,1].max
  54.       self.contents.fill_rect(x+1, y+15, width+2,1, Color.new(0, 0, 0, 255))
  55.       self.contents.fill_rect(x+1, y+16, width+2,1, Color.new(255, 255, 192, 192))
  56.       self.contents.fill_rect(x+1, y+17, w,6,color2)
  57.       self.contents.fill_rect(x+1, y+23, width+2,1, Color.new(255, 255, 192, 192))
  58.       self.contents.fill_rect(x+1, y+24, width+2,1, Color.new(0, 0, 0, 255))
  59.       self.contents.fill_rect(x, y+16, 1,8, Color.new(255, 255, 192, 192))
  60.       self.contents.fill_rect(x-1, y+15, 1,10, Color.new(0, 0, 0, 255))
  61.       self.contents.fill_rect(x+129, y+16, 1,8, Color.new(255, 255, 192, 192))
  62.       self.contents.fill_rect(x+130, y+15, 1,10, Color.new(0, 0, 0, 255))
  63.       self.contents.draw_text(x-53,y,128,32,$data_system.words.sp,1)
  64.       #这里隐藏掉的是敌人的SP数值
  65.       #if actor.hp>actor.maxsp/3
  66.          #self.contents.font.color = Color.new(255, 255, 255, 250)
  67.         #end
  68.        #if actor.hp>=actor.maxsp/6 and actor.maxsp/3>actor.sp
  69.          #self.contents.font.color = Color.new(200, 200, 0, 255)
  70.         #end
  71.        #if actor.maxsp/6>actor.sp
  72.          #self.contents.font.color = Color.new(200, 0, 0, 255)
  73.         #end
  74.          #self.contents.draw_text(x+47,y,128,32,actor.sp.to_s,1)
  75.          end
  76.     end
复制代码

点评

爱死你了,兄嘚,RPXP能用的我找了一个小时  发表于 2020-4-19 22:42

评分

参与人数 3星屑 +30 赞 +2 收起 理由
ODF01746 + 1 认可答案
guoxiaomi + 30 认可答案
2945835390 + 1 认可答案

查看全部评分

回复 2 0

使用道具 举报

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

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部