赞 | 153 |
VIP | 10 |
好人卡 | 39 |
积分 | 93 |
经验 | 146191 |
最后登录 | 2024-5-6 |
在线时间 | 2504 小时 |
Lv4.逐梦者
- 梦石
- 0
- 星屑
- 9280
- 在线时间
- 2504 小时
- 注册时间
- 2011-5-20
- 帖子
- 15389
|
- #本脚本来自百度贴吧
- #http://tieba.baidu.com/p/1437728543
- #作者:蹂躏の牙
- #oksh略作改动
- class Map_Damage
- attr_accessor :pic
-
- def initialize
- @pic=Sprite.new
- @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")
- @pic.bitmap=Bitmap.new(640,480)
- @pic.z=50
- end
- def mapupdate
- @pic.bitmap.clear
- return if $game_switches[56]==false#地图显示伤害的开关关闭则不显示伤害
- if $game_switches[8]==true and $game_switches[56]==true
- #必须打开8号开关与56号开关打开才有伤害显示
- 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=1
- end
- if damage>=999999 or $game_switches[8]==false
- @pic.bitmap.blt(i*32+8, j*32+20, @front6, Rect.new(0,0,24,12))
- else
- if damage>=$game_actors[$game_variables[1]+1].hp
- 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
- 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 damage<$game_actors[$game_variables[1]+1].hp/8
- 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,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
- 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
- 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-1,0,12,12))
- end
- end
- end#if结束
- end#def结束
-
- end
复制代码 其他请无视,重点是这里球加分歧的办法,我希望是在地图元件编号409以外的元件上才能显示伤害(就是409号图块上看不到,也可以说是优先级为0)
求应该怎样写分歧··· |
|