赞 | 153 |
VIP | 10 |
好人卡 | 39 |
积分 | 93 |
经验 | 146191 |
最后登录 | 2024-5-6 |
在线时间 | 2504 小时 |
Lv4.逐梦者
- 梦石
- 0
- 星屑
- 9280
- 在线时间
- 2504 小时
- 注册时间
- 2011-5-20
- 帖子
- 15389
|
4楼
楼主 |
发表于 2012-6-26 19:46:14
|
只看该作者
kangxi0109 发表于 2012-6-26 19:20
可以,但我先前没研究过这类的,所以不敢打包票。 - 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
- if $game_switches[56]==true and $game_switches[8]==true
- @pic.bitmap.clear
- 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)
- k=$game_map.check_event(i,j)
- if $game_map.events[k].event.name[0,6]=="怪物" and $game_map.events[k].event.name[10,1]!="h"
- draw_mapdamage($game_map.events[k].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(11)
- e=Enemy_property.new(number)
- damage=e.got_damage
- if damage>=999999999999999999999999999999999 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
- end
- end
- end
复制代码 那你帮我看下吧···表示这脚本改得很纠结···front1、2什么的是图片名称··· |
|