赞 | 0 |
VIP | 1 |
好人卡 | 1 |
积分 | 1 |
经验 | 1826 |
最后登录 | 2012-6-25 |
在线时间 | 25 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 25 小时
- 注册时间
- 2008-11-8
- 帖子
- 145
|
3楼
楼主 |
发表于 2011-1-16 01:00:51
|
只看该作者
- #==============================================================================
- # ■ Window_BattleStatus
- #------------------------------------------------------------------------------
- # 显示战斗画面同伴状态的窗口。
- #==============================================================================
- class Window_BattleStatus < Window_Base
- #--------------------------------------------------------------------------
- # ● 初始化对像
- #--------------------------------------------------------------------------
- #$data_system_level_up_me = "Audio/ME/升级音乐"
- def initialize
- super(0, 0, 1200, 800)
- self.contents = Bitmap.new(width - 10, height - 20)
- self.opacity = 0
- self.contents.font.name = "Arial Black"
- @level_up_flags = [false, false, false, false]
- refresh
- end
- #--------------------------------------------------------------------------
- # ● 释放
- #--------------------------------------------------------------------------
- def dispose
- super
- end
- #--------------------------------------------------------------------------
- # ● 设置升级标志
- # actor_index : 角色索引
- #--------------------------------------------------------------------------
- def level_up(actor_index)
- @level_up_flags[actor_index] = false
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- @item_max = $game_party.actors.size
- for i in 0...$game_party.actors.size
- actor = $game_party.actors[i]
- x = i * 260
- b = i * 260
- a = actor.id.to_s + "_b"
- bitmap=Bitmap.new("Graphics/pictures/#{a}")
- src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
- self.contents.blt(46+ x , 320, bitmap, src_rect)
- #cinderelmini
- #draw_actor_hp(@actor, 96, 112, 172)
- #draw_actor_sp(@actor, 96, 144, 172)
- #由于前面没有“@actor = actor”这句,所以这里的"actor"前不要加"@"
- cinderelmini_hp(actor,b+179, 350+28)
- cinderelmini_sp(actor,b+179, 350+51)
- #cinderelmini
- #draw_actor_hp(actor, actor_x, 32, 120)
- #draw_actor_sp(actor, actor_x, 64, 120)
-
- if @level_up_flags[i]
- self.contents.font.color = normal_color
- self.contents.draw_text(b, 500, 120, 32, "LEVEL UP!")
- else
- draw_actor_state(actor, b, 500)
- end
- end
- end
- #==============================================================================
- # ■ Window_BattleStatus
- #==============================================================================
- class Window_BattleStatus < Window_Base
- #--------------------------------------------------------------------------
- # ● 初始化
- #--------------------------------------------------------------------------
- def refresh
- @item_max = $game_party.actors.size
- for i in 0...$game_party.actors.size
- actor = $game_party.actors[i]
- case i
- when 0
- x = 400
- y = 390
- when 1
- x = 390
- y = 340
- when 2
- x = 480
- y = 300
- when 3
- x = 550
- y = 270
- end
-
- end
- end
- end
- #--------------------------------------------------------------------------
- # ● 刷新画面
- #--------------------------------------------------------------------------
- def update
- super
- # 主界面的不透明度下降
- if $game_temp.battle_main_phase
- self.contents_opacity =255 if self.contents_opacity =255#> 191-= 4
- else
- self.contents_opacity =255 if self.contents_opacity =255#< 255 += 4
- end
- end
- end
-
复制代码 还有这个:- def cinderelmini_hp(actor, x, y, width = 100, height = 8) #宽度可调
- w = width * actor.hp / [actor.maxhp,1].max
- hp_color_1 = Color.new (236, 118, 0)#192(255, 0, 0 )(255, 255, 0)
- hp_color_2 = Color.new (244, 248, 129) #(218, 107, 7, 255)(220, 60 ,20, 255)
- self.contents.fill_rect(x+5, y+4, width, (height/4).floor, Color.new(0, 0, 0, 255))
- self.contents.fill_rect(x, y, width+3, (height/4).floor, Color.new(0, 0, 0, 255))
- self.contents.fill_rect(x+1, y-1, width+2, (height/4).floor, Color.new(0, 0, 0, 255))
- draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
- x -= 1
- y += (height/4).floor
- self.contents.fill_rect(x+5, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 255))
- self.contents.fill_rect(x, y, width+3, (height/4).ceil , Color.new(0, 0, 0, 255))
- draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
- x -= 1
- y += (height/4).ceil
- self.contents.fill_rect(x+5, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 255))
- self.contents.fill_rect(x, y, width+3, (height/4).ceil , Color.new(0, 0, 0, 255))
- draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
- x -= 1
- y += (height/4).ceil
- self.contents.fill_rect(x+5, y+4, width, (height/4).floor, Color.new(0, 0, 0, 255))
- self.contents.fill_rect(x, y, width+3, (height/4).floor, Color.new(0, 0, 0, 255))
- self.contents.fill_rect(x, y+1, width+2, (height/4).ceil , Color.new(0, 0, 0, 255))
- draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
-
- #====cinderelmini描绘HP量====
- self.contents.font.italic = PLAN_HPSP_DRAW::FONT_ITALIC
- self.contents.font.bold = PLAN_HPSP_DRAW::FONT_BOLD
- self.contents.font.size = 17
- self.contents.font.color = Color.new(0, 0, 0)
- self.contents.draw_text(x, y-31, 32, 32, "精")
- self.contents.font.color = Color.new(255,255,255)
- self.contents.draw_text(x, y-30, 32, 32, "精")
- self.contents.font.size = 27
- #self.contents.font.name = "Arial Black"
- self.contents.font.color = actor.hp == 0 ? knockout_color :
- actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
- self.contents.font.color = Color.new(0, 0, 0)
- self.contents.draw_text(x+70, y-26, 48, 32, actor.hp.to_s, 2)
- self.contents.font.color = normal_color
- self.contents.draw_text(x+70, y-25, 48, 32, actor.hp.to_s, 2)
- #self.contents.font.name = "黑体"
- self.contents.font.bold = nil
- self.contents.font.size = Font.default_size#21
- self.contents.font.italic = nil
- #====cinderelmini描绘HP量====
- end
- def cinderelmini_sp(actor, x, y, width = 100, height=9)
- w = width * actor.sp / [actor.maxsp,1].max
- hp_color_1 = Color.new(70, 70, 200)#(120, 0,150, 255)#( 0, 0, 255)
- hp_color_2 = Color.new(201, 236, 245)#( 0, 255, 255)
- =begin
- self.contents.fill_rect(x+5, y+4, width, (height/4).floor, Color.new(0, 0, 0, 255)) #128
- draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
- x -= 1
- y += (height/4).floor
- self.contents.fill_rect(x+5, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 255))
- draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
- x -= 1
- y += (height/4).ceil
- self.contents.fill_rect(x+5, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 255))
- draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
- x -= 1
- y += (height/4).ceil
- self.contents.fill_rect(x+5, y+4, width, (height/4).floor, Color.new(0, 0, 0, 255))
- draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
- =end
- self.contents.fill_rect(x+5, y+4, width, (height/4).floor, Color.new(0, 0, 0, 255))
- self.contents.fill_rect(x, y, width+3, (height/4).floor, Color.new(0, 0, 0, 255))
- self.contents.fill_rect(x+1, y-1, width+2, (height/4).floor, Color.new(0, 0, 0, 255))
- draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
- x -= 1
- y += (height/4).floor
- self.contents.fill_rect(x+5, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 255))
- self.contents.fill_rect(x, y, width+3, (height/4).ceil , Color.new(0, 0, 0, 255))
- draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
- x -= 1
- y += (height/4).ceil
- self.contents.fill_rect(x+5, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 255))
- self.contents.fill_rect(x, y, width+3, (height/4).ceil , Color.new(0, 0, 0, 255))
- draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
- x -= 1
- y += (height/4).ceil
- self.contents.fill_rect(x+5, y+4, width, (height/4).floor, Color.new(0, 0, 0, 255))
- self.contents.fill_rect(x, y, width+3, (height/4).floor, Color.new(0, 0, 0, 255))
- self.contents.fill_rect(x, y+1, width+2, (height/4).ceil , Color.new(0, 0, 0, 255))
- draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
-
- #====cinderelmini描绘SP量====
- self.contents.font.italic = PLAN_HPSP_DRAW::FONT_ITALIC
- self.contents.font.bold = PLAN_HPSP_DRAW::FONT_BOLD
- self.contents.font.size = 17
- self.contents.font.color = Color.new(0, 0, 0)
- self.contents.draw_text(x, y-31, 32, 32, "神")
- self.contents.font.color = Color.new(255,255,255)
- self.contents.draw_text(x, y-30, 32, 32, "神")
- self.contents.font.size = 27
- #self.contents.font.name = "Arial Black"
- self.contents.font.color = actor.sp == 0 ? knockout_color :
- actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
- self.contents.font.color = Color.new(0, 0, 0)
- self.contents.draw_text(x+70, y-26, 48, 32, actor.sp.to_s, 2)
- self.contents.font.color = normal_color
- self.contents.draw_text(x+70, y-25, 48, 32, actor.sp.to_s, 2)
- #self.contents.font.name = "黑体"
- self.contents.font.bold = nil
- self.contents.font.italic = nil
- self.contents.font.size = Font.default_size#21
- #====cinderelmini描绘SP量====
- end
- #--------------------------------------------------------------------------
- # ● ライン描画 by 桜雅 在土
- #--------------------------------------------------------------------------
- def draw_line(start_x, start_y, end_x, end_y, start_color, width = 1, end_color = start_color)
- # 描写距離の計算。大きめに直角時の長さ。
- distance = (start_x - end_x).abs + (start_y - end_y).abs
- # 描写開始
- if end_color == start_color
- for i in 1..distance
- x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
- y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
- if width == 1
- self.contents.set_pixel(x, y, start_color)
- else
- self.contents.fill_rect(x, y, width, width, start_color)
- end
- end
- else
- for i in 1..distance
- x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
- y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
- r = start_color.red * (distance-i)/distance + end_color.red * i/distance
- g = start_color.green * (distance-i)/distance + end_color.green * i/distance
- b = start_color.blue * (distance-i)/distance + end_color.blue * i/distance
- a = start_color.alpha * (distance-i)/distance + end_color.alpha * i/distance
- if width == 1
- self.contents.set_pixel(x, y, Color.new(r, g, b, a))
- else
- self.contents.fill_rect(x, y, width, width, Color.new(r, g, b, a))
- end
- end
- end
- end
复制代码 不知道哪个才是!麻烦了! |
|