Project1

标题: 仿梦幻血条 [打印本页]

作者: 紫千修    时间: 2008-6-20 15:49
标题: 仿梦幻血条
下载地址:http://rpg.blue/upload_program/f ... 脚本_94376596.rar

脚本:
  1. class Window_Base < Window  
  2. #--------------------------------------------------------------------------
  3. # * Draw Slant Bar # 角色HP,SP 坐标在151 152 行 敌人坐标在 47行
  4. #--------------------------------------------------------------------------
  5. def draw_slant_bar(x, y, min, max, width = 152, height = 6,
  6.      bar_color = Color.new(231, 47, 35, 255), end_color = Color.new(150, 150, 150, 255))
  7.    # Draw Border
  8.    for i in 0..height
  9.      self.contents.fill_rect(x, y + height - i, width + 1, 1, Color.new(255, 255, 255, 255))
  10.    end
  11.    # Draw Background
  12.    for i in 1..(height - 1)
  13.      r = 100 * (height - i) / height + 0 * i / height
  14.      g = 100 * (height - i) / height + 0 * i / height
  15.      b = 100 * (height - i) / height + 0 * i / height
  16.      a = 255 * (height - i) / height + 255 * i / height
  17.      self.contents.fill_rect(x + 1, y + height - i, width - 1, 1, Color.new(r, b, g, a))
  18.    end
  19.    # Draws Bar
  20.    for i in 1..( (min / max.to_f) * width - 1)
  21.      for j in 1..(height - 1)
  22.        r = bar_color.red * (width - i) / width + end_color.red * i / width
  23.        g = bar_color.green * (width - i) / width + end_color.green * i / width
  24.        b = bar_color.blue * (width - i) / width + end_color.blue * i / width
  25.        a = bar_color.alpha * (width - i) / width + end_color.alpha * i / width
  26.        self.contents.fill_rect(x + i, y + height - j, 1, 1, Color.new(r, g, b, a))
  27.      end
  28.    end
  29. end
  30. end

  31. class Window_EnemyHP < Window_Base

  32. def initialize
  33.    super(0, 0, 640, 480)
  34.    self.contents = Bitmap.new(width - 32, height - 32)
  35.    self.opacity = 0
  36.    refresh
  37. end

  38. def refresh
  39.    self.contents.clear
  40.    for i in 0...$game_troop.enemies.size
  41.      @enemy = $game_troop.enemies[i]
  42.      @percent = (@enemy.hp * 100) / @enemy.maxhp
  43.      unless @enemy.hp == 0
  44.      draw_slant_bar(@enemy.screen_x - 50, @enemy.screen_y - 20, @enemy.hp, @enemy.maxhp, width = 55, height = 4, bar_color = Color.new(231, 47, 35, 255), end_color = Color.new(231, 47, 35, 255))
  45.      
  46.    end
  47. end
  48. end
  49. end


  50. class Scene_Battle

  51. alias raz_update update
  52. alias raz_update_phase5 update_phase5
  53. alias raz_update_phase4_step1 update_phase4_step1
  54. alias raz_update_phase4_step5 update_phase4_step5
  55. alias raz_enemy_hp_main main

  56.   def main
  57.    @troop_id = $game_temp.battle_troop_id
  58.    $game_troop.setup(@troop_id)
  59.    @enemy_window = Window_EnemyHP.new
  60.    
  61.    raz_enemy_hp_main
  62.    @enemy_window.dispose
  63. end


  64. def update
  65.    @enemy_window.update
  66.    raz_update
  67. end

  68. def update_phase5
  69.    # If wait count is larger than 0
  70.    if @phase5_wait_count > 0
  71.      # Decrease wait count
  72.      @phase5_wait_count -= 1
  73.      # If wait count reaches 0
  74.      if @phase5_wait_count == 0
  75.        @enemy_window.visible = false
  76.        # Show result window
  77.        @result_window.visible = true
  78.        # Clear main phase flag
  79.        $game_temp.battle_main_phase = false
  80.        # Refresh status window
  81.        @status_window.refresh
  82.        @enemy_window.refresh
  83.      end
  84.      return
  85.    end
  86.   raz_update_phase5
  87. end

  88. def update_phase4_step1
  89. raz_update_phase4_step1
  90. @enemy_window.refresh
  91. end

  92. def update_phase4_step5
  93.    # Hide help window
  94.    @help_window.visible = false
  95.    # Refresh status window
  96.    @status_window.refresh
  97.    @enemy_window.refresh
  98.    raz_update_phase4_step5
  99. end
  100. end



  101. class Window_BattleStatus < Window_Base
  102. #--------------------------------------------------------------------------
  103. # * Object Initialization
  104. #--------------------------------------------------------------------------
  105. def initialize
  106.    super(0, 0, 640, 480) #super(0, 320, 640, 160)
  107.    self.contents = Bitmap.new(width - 32, height - 32)
  108.    self.opacity = 0
  109.    @level_up_flags = [false, false, false, false]
  110.    refresh
  111. end
  112. #--------------------------------------------------------------------------
  113. # * Dispose
  114. #--------------------------------------------------------------------------
  115. def dispose
  116.    super
  117. end
  118. #--------------------------------------------------------------------------
  119. # * Set Level Up Flag
  120. #     actor_index : actor index
  121. #--------------------------------------------------------------------------
  122. def level_up(actor_index)
  123.    @level_up_flags[actor_index] = true
  124. end
  125. #--------------------------------------------------------------------------
  126. # * Refresh
  127. #--------------------------------------------------------------------------
  128. def refresh
  129.    self.contents.clear
  130.    @item_max = $game_party.actors.size
  131.    for i in 0...$game_party.actors.size
  132.      actor = $game_party.actors[i]
  133.      actor_x = actor.screen_x
  134.      actor_y = actor.screen_y
  135.      draw_slant_bar(actor_x-180,actor.screen_y - 120, actor.hp, actor.maxhp, 35, 4, bar_color = Color.new(231, 47, 35, 255), end_color = Color.new(231, 47, 35, 255))
  136.      draw_slant_bar(actor_x-180,actor.screen_y - 113, actor.sp, actor.maxsp, 35, 4, bar_color = Color.new(44, 102, 199, 225), end_color = Color.new(44, 102, 199, 2255))
  137.      draw_actor_name(actor, actor_x - 190,actor.screen_y - 30)
  138.      if @level_up_flags[i]
  139.        self.contents.font.color = normal_color
  140.        self.z = 0
  141.        self.contents.draw_text(actor_x, 96, 120, 32, "LEVEL UP!")
  142.      else
  143.       
  144.      end
  145.    end
  146. end

  147. #--------------------------------------------------------------------------
  148. # * Frame Update By ZiQianXiu
  149. #--------------------------------------------------------------------------
  150. def update
  151.    super
  152.    # Slightly lower opacity level during main phase
  153.    if $game_temp.battle_main_phase
  154.      self.contents_opacity -= 4 if self.contents_opacity > 191
  155.    else
  156.      self.contents_opacity += 4 if self.contents_opacity < 255
  157.    end
  158. end
  159. def draw_actor_name(actor, x, y)
  160.    self.contents.font.color = Color.new(0, 255, 0, 255)
  161.    self.contents.draw_text(x, y, 120, 32, actor.name)
  162. end
  163. end
复制代码

这个是根据主站的脚本更改,仿梦幻的也许大家需要就发了上来。(角色头上显血条脚下显姓名)
脚本冲突:与一些战斗脚本会有冲突吧~不过很少
另外这个脚本配合 16字体大小宋体 和文字描边效果更好(工程附,用的时候请复制)
有事请 Q我916984561


[LINE]1,#dddddd[/LINE]版务信息:本贴由楼主自主结贴~
作者: 怪乖小韩呀    时间: 2008-6-20 16:17
提示: 作者被禁止或删除 内容自动屏蔽
作者: yangff    时间: 2008-6-22 05:12
几乎无

应该听多的
作者: 李太黑    时间: 2008-6-22 05:24
提示: 作者被禁止或删除 内容自动屏蔽
作者: 心潇洒    时间: 2008-6-26 19:40
垃圾 [LINE]1,#dddddd[/LINE]版主对此帖的评论:『恶意侮辱,初犯扣60分』,积分『-60』。这些被扣积分的一半会用于对本帖正确答案的悬赏。
作者: lixian    时间: 2008-6-28 13:35
提示: 作者被禁止或删除 内容自动屏蔽




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1