Project1

标题: 45度战斗`` [打印本页]

作者: 天蚁    时间: 2008-7-15 00:00
标题: 45度战斗``
偶弄到45度战斗后``打起来的时候那个框框米了``但是是黑色的框框出来了``
请问怎么去掉``````````那个黑色的框框{/dk}谁教下 [LINE]1,#dddddd[/LINE]版务信息:本贴由楼主自主结贴~
作者: as295d    时间: 2008-7-15 00:01
请用这个脚本,不过不是去掉那个框而是把那个框的东西还原掉
  1. class Window_Base < Window  
  2.   #--------------------------------------------------------------------------
  3.   # * Draw Slant Bar
  4.   #--------------------------------------------------------------------------
  5.   def draw_slant_bar(x, y, min, max, width = 152, height = 6,
  6.       bar_color = Color.new(150, 0, 0, 255), end_color = Color.new(255, 255, 60, 255))
  7.     # Draw Border
  8.     for i in 0..height
  9.       self.contents.fill_rect(x + i, y + height - i, width + 1, 1, Color.new(50, 50, 50, 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 + i, y + height - i, width, 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 + j, 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.   
  33.   def initialize
  34.     super(0, 0, 640, 480)
  35.     self.contents = Bitmap.new(width - 32, height - 32)
  36.     self.opacity = 0
  37.     refresh
  38.   end
  39.   
  40.   def refresh
  41.     self.contents.clear
  42.     for i in 0...$game_troop.enemies.size
  43.       @enemy = $game_troop.enemies[i]
  44.       @percent = (@enemy.hp * 100) / @enemy.maxhp
  45.       unless @enemy.hp == 0
  46.       draw_slant_bar(@enemy.screen_x - 55, @enemy.screen_y - 10, @enemy.hp, @enemy.maxhp, width = 75, height = 6, bar_color = Color.new(150, 0, 0, 255), end_color = Color.new(255, 255, 60, 255))
  47.       self.contents.draw_text(@enemy.screen_x - 39, @enemy.screen_y - 22, 100, 32, "#{@percent}" + "%")
  48.     end
  49.   end
  50. end
  51. end

  52. class Scene_Battle
  53.   
  54.   alias raz_update update
  55.   alias raz_update_phase5 update_phase5
  56.   alias raz_update_phase4_step1 update_phase4_step1
  57.   alias raz_update_phase4_step5 update_phase4_step5
  58.   alias raz_enemy_hp_main main
  59.   
  60.    def main
  61.     @troop_id = $game_temp.battle_troop_id
  62.     $game_troop.setup(@troop_id)
  63.     @enemy_window = Window_EnemyHP.new
  64.     @enemy_window.z = 95
  65.     raz_enemy_hp_main
  66.     @enemy_window.dispose
  67.   end

  68.   
  69.   def update
  70.     @enemy_window.update
  71.     raz_update
  72.   end

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

  93. def update_phase4_step1
  94.   raz_update_phase4_step1
  95.   @enemy_window.refresh
  96. end

  97.   def update_phase4_step5
  98.     # Hide help window
  99.     @help_window.visible = false
  100.     # Refresh status window
  101.     @status_window.refresh
  102.     @enemy_window.refresh
  103.     raz_update_phase4_step5
  104.   end
  105. end

  106. class Window_BattleStatus < Window_Base
  107.   #--------------------------------------------------------------------------
  108.   # * Object Initialization
  109.   #--------------------------------------------------------------------------
  110.   def initialize
  111.     super(0, 320, 640, 160)
  112.     self.contents = Bitmap.new(width - 32, height - 32)
  113.     @level_up_flags = [false, false, false, false]
  114.     refresh
  115.   end
  116.   #--------------------------------------------------------------------------
  117.   # * Dispose
  118.   #--------------------------------------------------------------------------
  119.   def dispose
  120.     super
  121.   end
  122.   #--------------------------------------------------------------------------
  123.   # * Set Level Up Flag
  124.   #     actor_index : actor index
  125.   #--------------------------------------------------------------------------
  126.   def level_up(actor_index)
  127.     @level_up_flags[actor_index] = true
  128.   end
  129.   #--------------------------------------------------------------------------
  130.   # * Refresh
  131.   #--------------------------------------------------------------------------
  132.   def refresh
  133.     self.contents.clear
  134.     @item_max = $game_party.actors.size
  135.     for i in 0...$game_party.actors.size
  136.       actor = $game_party.actors[i]
  137.       actor_x = i * 160 + 4
  138.       draw_slant_bar(actor_x, 55, actor.hp, actor.maxhp, 120)
  139.       draw_slant_bar(actor_x, 88, actor.sp, actor.maxsp, 120, 6, bar_color = Color.new(150, 0, 150, 255), end_color = Color.new(0, 0, 255, 255))
  140.       draw_actor_name(actor, actor_x, 0)
  141.       draw_actor_hp(actor, actor_x, 32, 120)
  142.       draw_actor_sp(actor, actor_x, 64, 120)
  143.       if @level_up_flags[i]
  144.         self.contents.font.color = normal_color
  145.         self.contents.draw_text(actor_x, 96, 120, 32, "LEVEL UP!")
  146.       else
  147.         draw_actor_state(actor, actor_x, 96)
  148.       end
  149.     end
  150.   end
  151.   #--------------------------------------------------------------------------
  152.   # * Frame Update
  153.   #--------------------------------------------------------------------------
  154.   def update
  155.     super
  156.     # Slightly lower opacity level during main phase
  157.     if $game_temp.battle_main_phase
  158.       self.contents_opacity -= 4 if self.contents_opacity > 191
  159.     else
  160.       self.contents_opacity += 4 if self.contents_opacity < 255
  161.     end
  162.   end
  163. end

复制代码

作者: 天蚁    时间: 2008-7-15 00:03
请用这个脚本
class Window_Base < Window  
  #--------------------------------------------------------------------------
  # * Draw Slant Bar
  #--------------------------------------------------------------------------
  def draw_slant_bar(x, y, min, max, width = 152, height = 6,
      bar_color = Color.new(150, 0, 0, 255), end_color = Color.new(255, 255, 60, 255))
    # Draw Border
    for i in 0..height
      self.contents.fill_rect(x + i, y + height - i, width + 1, 1, Color.new(50, 50, 50, 255))
    end
    # Draw Background
    for i in 1..(height - 1)
      r = 100 * (height - i) / height + 0 * i / height
      g = 100 * (height - i) / height + 0 * i / height
      b = 100 * (height - i) / height + 0 * i / height
      a = 255 * (height - i) / height + 255 * i / height
      self.contents.fill_rect(x + i, y + height - i, width, 1, Color.new(r, b, g, a))
    end
    # Draws Bar
    for i in 1..( (min / max.to_f) * width - 1)
      for j in 1..(height - 1)
        r = bar_color.red * (width - i) / width + end_color.red * i / width
        g = bar_color.green * (width - i) / width + end_color.green * i / width
        b = bar_color.blue * (width - i) / width + end_color.blue * i / width
        a = bar_color.alpha * (width - i) / width + end_color.alpha * i / width
        self.contents.fill_rect(x + i + j, y + height - j, 1, 1, Color.new(r, g, b, a))
      end
    end
  end
end


class Window_EnemyHP < Window_Base
  
  def initialize
    super(0, 0, 640, 480)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.opacity = 0
    refresh
  end
  
  def refresh
    self.contents.clear
    for i in 0...$game_troop.enemies.size
      @enemy = $game_troop.enemies
      @percent = (@enemy.hp * 100) / @enemy.maxhp
      unless @enemy.hp == 0
      draw_slant_bar(@enemy.screen_x - 55, @enemy.screen_y - 10, @enemy.hp, @enemy.maxhp, width = 75, height = 6, bar_color = Color.new(150, 0, 0, 255), end_color = Color.new(255, 255, 60, 255))
      self.contents.draw_text(@enemy.screen_x - 39, @enemy.screen_y - 22, 100, 32, "#{@percent}" + "%")
    end
  end
end
end

class Scene_Battle
  
  alias raz_update update
  alias raz_update_phase5 update_phase5
  alias raz_update_phase4_step1 update_phase4_step1
  alias raz_update_phase4_step5 update_phase4_step5
  alias raz_enemy_hp_main main
  
   def main
    @troop_id = $game_temp.battle_troop_id
    $game_troop.setup(@troop_id)
    @enemy_window = Window_EnemyHP.new
    @enemy_window.z = 95
    raz_enemy_hp_main
    @enemy_window.dispose
  end

  
  def update
    @enemy_window.update
    raz_update
  end

  def update_phase5
    # If wait count is larger than 0
    if @phase5_wait_count > 0
      # Decrease wait count
      @phase5_wait_count -= 1
      # If wait count reaches 0
      if @phase5_wait_count == 0
        @enemy_window.visible = false
        # Show result window
        @result_window.visible = true
        # Clear main phase flag
        $game_temp.battle_main_phase = false
        # Refresh status window
        @status_window.refresh
        @enemy_window.refresh
      end
      return
    end
   raz_update_phase5
end

def update_phase4_step1
  raz_update_phase4_step1
  @enemy_window.refresh
end

  def update_phase4_step5
    # Hide help window
    @help_window.visible = false
    # Refresh status window
    @status_window.refresh
    @enemy_window.refresh
    raz_update_phase4_step5
  end
end

class Window_BattleStatus < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(0, 320, 640, 160)
    self.contents = Bitmap.new(width - 32, height - 32)
    @level_up_flags = [false, false, false, false]
    refresh
  end
  #--------------------------------------------------------------------------
  # * Dispose
  #--------------------------------------------------------------------------
  def dispose
    super
  end
  #--------------------------------------------------------------------------
  # * Set Level Up Flag
  #     actor_index : actor index
  #--------------------------------------------------------------------------
  def level_up(actor_index)
    @level_up_flags[actor_index] = true
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    @item_max = $game_party.actors.size
    for i in 0...$game_party.actors.size
      actor = $game_party.actors
      actor_x = i * 160 + 4
      draw_slant_bar(actor_x, 55, actor.hp, actor.maxhp, 120)
      draw_slant_bar(actor_x, 88, actor.sp, actor.maxsp, 120, 6, bar_color = Color.new(150, 0, 150, 255), end_color = Color.new(0, 0, 255, 255))
      draw_actor_name(actor, actor_x, 0)
      draw_actor_hp(actor, actor_x, 32, 120)
      draw_actor_sp(actor, actor_x, 64, 120)
      if @level_up_flags
        self.contents.font.color = normal_color
        self.contents.draw_text(actor_x, 96, 120, 32, "LEVEL UP!")
      else
        draw_actor_state(actor, actor_x, 96)
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    super
    # Slightly lower opacity level during main phase
    if $game_temp.battle_main_phase
      self.contents_opacity -= 4 if self.contents_opacity > 191
    else
      self.contents_opacity += 4 if self.contents_opacity < 255
    end
  end
end

怎么用?放到哪里?
作者: as295d    时间: 2008-7-15 00:04
当然是放到Main下拉!
作者: 迅雷進    时间: 2008-7-15 00:04
打开脚本(F11),
在main的上面插入(Insert)此脚本。
作者: 天蚁    时间: 2008-7-15 00:04
当然是放到Main下拉!

这个是45度的脚本?
作者: as295d    时间: 2008-7-15 00:05
这个是血条脚本!!!!!不过可以还原那个框
如果你不想要那个框,请

Sprites_Battle 中

def initialize
# 生成显示端口
@viewport1 = Viewport.new(0, 0, 640, 480)
以及106行的
@battleback_sprite.src_rect.set(0, 0, 640, 480)

中括号里的480全部改成640

作者: 天蚁    时间: 2008-7-15 00:15
```有米有45度的脚本``仙剑的45度脚本还要那个东东``偶做不来````
作者: as295d    时间: 2008-7-15 00:18
那就把答案认可了以后走人吧。。。。。 [LINE]1,#dddddd[/LINE]系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~




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