设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 2409|回复: 0
打印 上一主题 下一主题

[RMXP发布] 魔塔样板5161专用APRP地图显示伤害脚本

[复制链接]

Lv4.逐梦者

梦石
0
星屑
9280
在线时间
2504 小时
注册时间
2011-5-20
帖子
15389

开拓者

跳转到指定楼层
1
发表于 2012-7-8 17:07:33 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 chd114 于 2012-7-8 17:40 编辑

  1. class Map_Damage
  2.   attr_accessor :pic
  3.   
  4.   def initialize
  5.     @pic=Sprite.new
  6.     @front0=RPG::Cache.picture("front0")
  7.     @front1=RPG::Cache.picture("front1")
  8.     @front2=RPG::Cache.picture("front2")
  9.     @front3=RPG::Cache.picture("front3")
  10.     @front4=RPG::Cache.picture("front4")
  11.     @front5=RPG::Cache.picture("front5")
  12.     @front6=RPG::Cache.picture("front6")
  13.     @front7=RPG::Cache.picture("front7")
  14.     @front8=RPG::Cache.picture("front8")
  15.     @front9=RPG::Cache.picture("front9")
  16.     @front10=RPG::Cache.picture("front10")
  17.     @pic.bitmap=Bitmap.new(640,480)
  18.     @pic.z=50
  19.   end

  20.   def mapupdate
  21.     @pic.bitmap.clear

  22.     return if $game_variables[173]<3#地图显示伤害的开关关闭则不显示伤害
  23.     if $game_variables[173]>=3
  24.       #必须持有怪物手册,地图显示伤害开关打开才有伤害显示
  25.       for i in $game_variables[90][0]...$game_variables[90][0]+$game_variables[90][1]
  26.         for j in $game_variables[90][2]...$game_variables[90][2]+$game_variables[90][3]
  27.           if $game_map.have_an_event?(i,j)#搜索全场景事件
  28.             @iid=$game_map.check_event(i,j)
  29.             if $game_map.events[@iid].event.name[0,6]=="怪物"
  30.               draw_mapdamage($game_map.events[@iid].event.name[6,3].to_i,i,j)
  31.               #获取怪物属性进入画伤害的脚本段
  32.             end
  33.           end
  34.         end
  35.       end
  36.     end#持有怪物手册到此结束
  37.   end

  38.   def draw_mapdamage(number,i,j)
  39.    
  40.     e=Enemy_property.new(number)   
  41.     if e.got_p(19)
  42.       if $game_variables[104][$game_variables[1]][7]<1
  43.         return#潜伏怪不显示伤害(持有反潜伏的物品后显示)
  44.       else
  45.         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]
  46.         
  47.         else
  48.           return
  49.         end
  50.       end
  51.     end
  52.     if e.got_p(26)
  53.       return if $game_map.events[@iid].iserase==true#重生怪打败后暂不显示伤害
  54.     end

  55.     damage=e.got_damage
  56.     if e.got_p(30) and $game_switches[99]==true#伪装的随机开关必须打开
  57.       damage=$game_variables[118]
  58.     end
  59.    
  60.   if $game_switches[19]
  61.     if damage>=999999 and $game_switches[19]==true #or $game_variables[173]<3#$game_switches[8]==false
  62.       @pic.bitmap.blt(i*32+8, j*32+20, @front10, Rect.new(0,0,24,12))
  63.     else
  64.       if damage>=$game_actors[$game_variables[1]+1].hp and $game_switches[19]==true
  65.         a=damage.to_s
  66.         for q in 0...a.size
  67.           @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))
  68.         end
  69.       end
  70.       if damage<$game_actors[$game_variables[1]+1].hp/25
  71.         a=damage.to_s
  72.         for q in 0...a.size
  73.           @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))
  74.         end
  75.       end
  76.       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
  77.         a=damage.to_s
  78.         for q in 0...a.size
  79.           @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))
  80.         end
  81.       end
  82.       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
  83.         a=damage.to_s
  84.         for q in 0...a.size
  85.           @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))
  86.         end
  87.       end
  88.       if damage>=$game_actors[$game_variables[1]+1].hp/3 and damage<$game_actors[$game_variables[1]+1].hp and $game_switches[19]==true
  89.         a=damage.to_s
  90.         for q in 0...a.size
  91.           @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))
  92.         end
  93.       end
  94.     end
  95.   else  
  96.     if damage>=999999 and $game_switches[19]==false #or $game_variables[173]<3#$game_switches[8]==false
  97.       @pic.bitmap.blt(i*32+8, j*32+20, @front0, Rect.new(0,0,24,12))
  98.     else
  99.       if damage>=$game_actors[$game_variables[1]+1].hp and $game_switches[19]==false
  100.         a=damage.to_s
  101.         for q in 0...a.size
  102.           @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))
  103.         end
  104.       end
  105.       if damage<$game_actors[$game_variables[1]+1].hp/25 and $game_switches[19]==false
  106.         a=damage.to_s
  107.         for q in 0...a.size
  108.           @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))
  109.         end
  110.       end
  111.       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
  112.         a=damage.to_s
  113.         for q in 0...a.size
  114.           @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))
  115.         end
  116.       end
  117.       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
  118.           a=damage.to_s
  119.       for q in 0...a.size
  120.           @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))
  121.         end
  122.       end
  123.       if damage>=$game_actors[$game_variables[1]+1].hp/3 and damage<$game_actors[$game_variables[1]+1].hp and $game_switches[19]==false
  124.         a=damage.to_s
  125.         for q in 0...a.size
  126.           @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))
  127.         end
  128.       end
  129.     end
  130.   end#if结束
  131. end#def结束
  132. end
复制代码
以上脚本仅支持魔塔样板5161与7630,请配合下列图片使用!
[img]http://service.t.sina.com.cn/widget/qmd/5339802982/c02e16bd/7.png
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-6-19 10:53

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表