Project1

标题: 帮我把一个XP脚本改成VA的脚本!谢谢了! [打印本页]

作者: wwwxuanye    时间: 2015-5-6 22:39
标题: 帮我把一个XP脚本改成VA的脚本!谢谢了!
脚本:
#==============================================================================
# ■ Window_BattleStatus
#------------------------------------------------------------------------------
#  显示战斗画面战斗者状态的窗口。       by 唐门草楹
#==============================================================================

class Window_BattleStatus
  #--------------------------------------------------------------------------
  # ● 初始化对像
  #--------------------------------------------------------------------------
  def initialize
    # 拥有图标的状态写在这里
    @str = ["冻伤","烧伤","害怕", "中毒", "麻痹", "疲劳", "山神之力"]
    $出战角色 = 0
    @viewport = Viewport.new(0, 0, 768, 544)
    @viewport.z = 1
    @sprites = []
    for i in 0..12
      @sprites[i] = Sprite.new(@viewport)
    end
    @sprites[0].bitmap = Bitmap.new("Graphics/Frame/HP ICON")
    @sprites[1].bitmap = Bitmap.new("Graphics/Frame/blood1")
    @sprites[2].bitmap = Bitmap.new("Graphics/Frame/blood2")
    @sprites[3].bitmap = Bitmap.new("Graphics/Frame/blood3")
    @sprites[4].bitmap = Bitmap.new("Graphics/Frame/blood1")
    @sprites[5].bitmap = Bitmap.new("Graphics/Frame/blood2")
    @sprites[6].bitmap = Bitmap.new("Graphics/Frame/blood3")  
    @sprites[7].bitmap = Bitmap.new("Graphics/Frame/HP ICON")
    @sprites[8].bitmap = Bitmap.new(220,25)
    @sprites[9].bitmap = Bitmap.new(220,25)
    @sprites[10].bitmap = Bitmap.new("Graphics/Frame/队员数")
    @sprites[11].bitmap = Bitmap.new(768,32)
    @sprites[12].bitmap = Bitmap.new(768,32)
    @sprites[0].x = 0
    @sprites[0].y = 50
    for i in 1..3
      @sprites[i].x = 56
      @sprites[i].y = 50
    end
    for i in 4..6
      @sprites[i].x = 443
      @sprites[i].y = 50
    end
    @sprites[7].x = 713
    @sprites[7].y = 50
    @sprites[8].y = 30
    @sprites[9].x = 445
    @sprites[9].y = 30  
    @sprites[11].x = 0
    @sprites[11].y = 95
    @sprites[12].y = 0
    @sprites[12].y = 95
    refresh
  end
  #--------------------------------------------------------------------------
  # ● 释放
  #--------------------------------------------------------------------------
  def dispose
    for i in 0..12
      @sprites[i].dispose
    end
  
  end

  #--------------------------------------------------------------------------
  # ● 刷新
  #--------------------------------------------------------------------------
  def refresh
    # 自己的血量
    str = $game_party.actors[$出战角色].hp.to_s
    @sprites[8].bitmap.clear
    for i in 1..str.size
      @sprites[8].bitmap.blt(22*(i-1),0,Bitmap.new("Graphics/Frame/HP字体"),Rect.new((str.slice(i - 1, 1).to_i)*22,0,22,25))
    end
    @sprites[8].x = 325 - 22 * str.size
    # 敌人的血量
    str = $game_troop.enemies[0].hp.to_s
    @sprites[9].bitmap.clear
    for i in 1..str.size
      @sprites[9].bitmap.blt(22*(i-1),0,Bitmap.new("Graphics/Frame/HP字体"),Rect.new((str.slice(i - 1, 1).to_i)*22,0,22,25))
    end
   
    # 自己的血条
    @sprites[2].bitmap.clear
    dest_rect = Rect.new(0,0,269 * $game_party.actors[$出战角色].hp/$game_party.actors[$出战角色].maxhp.to_f,45)
    src_rect = Rect.new(0,0,269,45)
    @sprites[2].bitmap.stretch_blt(dest_rect, Bitmap.new("Graphics/Frame/blood2"), src_rect)
    # 敌人的血条
    @sprites[5].bitmap.clear
    dest_rect = Rect.new(269 - 269 * $game_troop.enemies[0].hp/$game_troop.enemies[0].maxhp.to_f,0,269,45)
    src_rect = Rect.new(0,0,269 * $game_troop.enemies[0].hp/$game_troop.enemies[0].maxhp.to_f,45)
    @sprites[5].bitmap.stretch_blt(dest_rect, Bitmap.new("Graphics/Frame/blood2"), src_rect)
   
    # 统计队员数
    @sprites[10].bitmap.dispose
    @sprites[10].bitmap = Bitmap.new("Graphics/Frame/队员数")
    count = 0
    for actor in $game_party.actors
      if actor.hp > 0 then
        count += 1
      end
    end
    @sprites[10].bitmap.draw_text(9, 12, 20, 20, count.to_s,1)
    for i in 0..7
      @sprites[i].update
    end
   
    #显示队员状态
    statenum = 0
    for i in $game_party.actors[$出战角色].states
      if $data_states[i].rating >= 1 and @str.include?($data_states[i].name)
        @sprites[11].bitmap.blt(32*statenum,0,Bitmap.new("Graphics/Icons/" + $data_states[i].name),Rect.new(0,0,32,32))
        statenum += 1
      end
    end
    #显示敌人状态
    statenum = 0
    for i in $game_troop.enemies[0].states
      if $data_states[i].rating >= 1 and @str.include?($data_states[i].name)
        @sprites[12].bitmap.blt(736 - 32*statenum,0,Bitmap.new("Graphics/Icons/" + $data_states[i].name),Rect.new(0,0,32,32))
        statenum += 1
      end
    end   
  end
  #--------------------------------------------------------------------------
  # ● 刷新画面
  #--------------------------------------------------------------------------
  def update
    for i in 0..12
      @sprites[i].update
    end

  end
end

作者: VIPArcher    时间: 2015-5-6 22:40
代码用脚本框发,脚本效果用截图截下来说明希望达到的效果。
然而我回帖并不代表我就会去帮你移植,这点请注意
作者: wwwxuanye    时间: 2015-5-7 22:09
VIPArcher 发表于 2015-5-6 22:40
代码用脚本框发,脚本效果用截图截下来说明希望达到的效果。
然而我回帖并不代表我就会去帮你移植,这点请 ...

帮我把这个XP脚本改成VA的脚本!谢谢了!




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