| 
 
| 赞 | 152 |  
| VIP | 10 |  
| 好人卡 | 39 |  
| 积分 | 93 |  
| 经验 | 146191 |  
| 最后登录 | 2024-5-6 |  
| 在线时间 | 2504 小时 |  
 Lv4.逐梦者 
	梦石0 星屑9290 在线时间2504 小时注册时间2011-5-20帖子15389 
 | 
| 
本帖最后由 chd114 于 2012-7-8 17:40 编辑
x
加入我们,或者,欢迎回来。您需要 登录 才可以下载或查看,没有帐号?注册会员  
 
       以上脚本仅支持魔塔样板5161与7630,请配合下列图片使用!复制代码class Map_Damage
  attr_accessor :pic
  
  def initialize
    @pic=Sprite.new
    @front0=RPG::Cache.picture("front0")
    @front1=RPG::Cache.picture("front1")
    @front2=RPG::Cache.picture("front2")
    @front3=RPG::Cache.picture("front3")
    @front4=RPG::Cache.picture("front4")
    @front5=RPG::Cache.picture("front5")
    @front6=RPG::Cache.picture("front6")
    @front7=RPG::Cache.picture("front7")
    @front8=RPG::Cache.picture("front8")
    @front9=RPG::Cache.picture("front9")
    @front10=RPG::Cache.picture("front10")
    @pic.bitmap=Bitmap.new(640,480)
    @pic.z=50
  end
  def mapupdate
    @pic.bitmap.clear
    return if $game_variables[173]<3#地图显示伤害的开关关闭则不显示伤害
    if $game_variables[173]>=3
      #必须持有怪物手册,地图显示伤害开关打开才有伤害显示
      for i in $game_variables[90][0]...$game_variables[90][0]+$game_variables[90][1]
        for j in $game_variables[90][2]...$game_variables[90][2]+$game_variables[90][3]
          if $game_map.have_an_event?(i,j)#搜索全场景事件
            @iid=$game_map.check_event(i,j)
            if $game_map.events[@iid].event.name[0,6]=="怪物"
              draw_mapdamage($game_map.events[@iid].event.name[6,3].to_i,i,j)
              #获取怪物属性进入画伤害的脚本段
            end
          end
        end
      end
    end#持有怪物手册到此结束
  end
  def draw_mapdamage(number,i,j)
    
    e=Enemy_property.new(number)    
    if e.got_p(19)
      if $game_variables[104][$game_variables[1]][7]<1
        return#潜伏怪不显示伤害(持有反潜伏的物品后显示)
      else
        if ($game_map.events[@iid].x-$game_player.x).abs+($game_map.events[@iid].y-$game_player.y).abs<=$game_variables[104][$game_variables[1]][7]
        
        else
          return
        end
      end
    end
    if e.got_p(26)
      return if $game_map.events[@iid].iserase==true#重生怪打败后暂不显示伤害
    end
    damage=e.got_damage
    if e.got_p(30) and $game_switches[99]==true#伪装的随机开关必须打开
      damage=$game_variables[118]
    end
    
  if $game_switches[19]
    if damage>=999999 and $game_switches[19]==true #or $game_variables[173]<3#$game_switches[8]==false
      @pic.bitmap.blt(i*32+8, j*32+20, @front10, Rect.new(0,0,24,12))
    else
      if damage>=$game_actors[$game_variables[1]+1].hp and $game_switches[19]==true
        a=damage.to_s
        for q in 0...a.size
          @pic.bitmap.blt(i*32-a.size*8+q*8+32, j*32+20, @front9, Rect.new(a[q,1].to_i*15-1,0,12,12))
        end
      end
      if damage<$game_actors[$game_variables[1]+1].hp/25
        a=damage.to_s
        for q in 0...a.size
          @pic.bitmap.blt(i*32-a.size*8+q*8+32, j*32+20, @front5, Rect.new(a[q,1].to_i*15-1,0,12,12))
        end
      end
      if damage>=$game_actors[$game_variables[1]+1].hp/25 and damage<$game_actors[$game_variables[1]+1].hp/8 and $game_switches[19]==true
        a=damage.to_s
        for q in 0...a.size
          @pic.bitmap.blt(i*32-a.size*8+q*8+32, j*32+20, @front6, Rect.new(a[q,1].to_i*15,0,12,12))
        end
      end
      if damage>=$game_actors[$game_variables[1]+1].hp/8 and damage<$game_actors[$game_variables[1]+1].hp/3 and $game_switches[19]==true
        a=damage.to_s
        for q in 0...a.size
          @pic.bitmap.blt(i*32-a.size*8+q*8+32, j*32+20, @front7, Rect.new(a[q,1].to_i*15-1,0,12,12))
        end
      end
      if damage>=$game_actors[$game_variables[1]+1].hp/3 and damage<$game_actors[$game_variables[1]+1].hp and $game_switches[19]==true
        a=damage.to_s
        for q in 0...a.size
          @pic.bitmap.blt(i*32-a.size*8+q*8+32, j*32+20, @front8, Rect.new(a[q,1].to_i*15-1,0,12,12))
        end
      end
    end
  else  
    if damage>=999999 and $game_switches[19]==false #or $game_variables[173]<3#$game_switches[8]==false
      @pic.bitmap.blt(i*32+8, j*32+20, @front0, Rect.new(0,0,24,12))
    else
      if damage>=$game_actors[$game_variables[1]+1].hp and $game_switches[19]==false
        a=damage.to_s
        for q in 0...a.size
          @pic.bitmap.blt(i*32-a.size*8+q*8+32, j*32+20, @front1, Rect.new(a[q,1].to_i*15-1,0,12,12))
        end
      end
      if damage<$game_actors[$game_variables[1]+1].hp/25 and $game_switches[19]==false
        a=damage.to_s
        for q in 0...a.size
          @pic.bitmap.blt(i*32-a.size*8+q*8+32, j*32+20, @front5, Rect.new(a[q,1].to_i*15-1,0,12,12))
        end
      end
      if damage>=$game_actors[$game_variables[1]+1].hp/25 and damage<$game_actors[$game_variables[1]+1].hp/8 and $game_switches[19]==false
        a=damage.to_s
        for q in 0...a.size
          @pic.bitmap.blt(i*32-a.size*8+q*8+32, j*32+20, @front4, Rect.new(a[q,1].to_i*15,0,12,12))
        end
      end
      if damage>=$game_actors[$game_variables[1]+1].hp/8 and damage<$game_actors[$game_variables[1]+1].hp/3 and $game_switches[19]==false
          a=damage.to_s
      for q in 0...a.size
          @pic.bitmap.blt(i*32-a.size*8+q*8+32, j*32+20, @front3, Rect.new(a[q,1].to_i*15-1,0,12,12))
        end
      end
      if damage>=$game_actors[$game_variables[1]+1].hp/3 and damage<$game_actors[$game_variables[1]+1].hp and $game_switches[19]==false
        a=damage.to_s
        for q in 0...a.size
          @pic.bitmap.blt(i*32-a.size*8+q*8+32, j*32+20, @front2, Rect.new(a[q,1].to_i*15-1,0,12,12))
        end
      end
    end
  end#if结束
end#def结束
end
                 | 
 |