赞 | 0 |
VIP | 0 |
好人卡 | 4 |
积分 | 5 |
经验 | 12981 |
最后登录 | 2024-6-25 |
在线时间 | 301 小时 |
Lv2.观梦者
- 梦石
- 0
- 星屑
- 501
- 在线时间
- 301 小时
- 注册时间
- 2010-7-3
- 帖子
- 133
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 a111a 于 2013-8-11 13:43 编辑
游戏工程包
这个是显示脚本
#==============================================================================
# ■ Window_BattleStatus
#------------------------------------------------------------------------------
# 显示战斗画面同伴状态的窗口。
#==============================================================================
#--------------------------------------#
# 大话西游单机论坛 rpg520.5d6d.com #
#--------------------------------------#
class Window_BattleStatus < Window_Base
#--------------------------------------------------------------------------
# ● 初始化对像
#--------------------------------------------------------------------------
def initialize
super(0, 0, 640, 480)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = 0
@level_up_flags = [false, false, false, false]
self.contents.font.size = 16 #字体大小
#==战斗显示坐标框=============
# if $game_switches[41]
# @xy_window = Window_xy.new
# @xy_window.x = -16
# @xy_window.y = -16
# @xy_window.opacity = 0
# @xy_window.back_opacity = 0
# @xy_window.contents_opacity = 255
# @xy_window.visible = true
# else
# @xy_window.visible = false
# end
#==========================
refresh # 刷新
end
#--------------------------------------------------------------------------
# ● 释放
#--------------------------------------------------------------------------
def dispose
super
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
self.contents.clear
for i in 0...$game_party.actors.size
actor = $game_party.actors
draw_actor_name(actor, actor.screen_x - 90,actor.screen_y - 56)
end
end
#--------------------------------------------------------------------------
# ● 设置升级标志
# actor_index : 角色索引
#--------------------------------------------------------------------------
def level_up(actor_index)
@level_up_flags[actor_index] = true
end
#--------------------------------------------------------------------------
#--------------------------------------------------
# ● 刷新画面
#--------------------------------------------------
def update
super
end
end
#--------------------------------------------------
class Game_Actor < Game_Battler
def now_exp
return @exp - @exp_list[@level]
end
def next_exp
return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
end
end
#==============================================================================
# 描绘角色血条
#==============================================================================
class Window_BattleStatus < Window_Base
#--------------------------------------------------------------------------
# ● 初始化
#--------------------------------------------------------------------------
alias xrxs_bp2_refresh refresh
def refresh
xrxs_bp2_refresh
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
actor = $game_party.actors
# 血条位置修改
actor_x = actor.screen_x - 30
actor_y = actor.screen_y - 230
x1=self.x
y1=self.y
if actor.dead? == false
draw_actor_hp_meter(actor, actor_x, 1+actor_y,35)
draw_actor_sp_meter(actor, actor_x, 10+actor_y, 35)
end
end
end
end
#==============================================================================
# ■ Window_Base
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# ● HP描画
#--------------------------------------------------------------------------
def draw_actor_hp_meter(actor, x, y, width = 156, type = 0)
if type == 1 and actor.hp == 0
return
end
self.contents.fill_rect(x-1, y+82, width+2,6, Color.new(0, 0, 0, 255))
w = width * actor.hp / [actor.maxhp,1].max
self.contents.fill_rect(x, y+84, w,1, Color.new(255, 140, 140, 255))
self.contents.fill_rect(x, y+85, w,1, Color.new(180, 18, 0, 255))
self.contents.fill_rect(x, y+86, w,1, Color.new(209, 33, 0,255))
self.contents.fill_rect(x, y+87, w,1, Color.new(180, 18, 0, 255))
end
#--------------------------------------------------------------------------
# ● SP描画
#--------------------------------------------------------------------------
def draw_actor_sp_meter(actor, x, y, width = 156, type = 0)
if type == 1 and actor.hp == 0
return
end
self.contents.fill_rect(x-1, y+82, width+2,6, Color.new(0, 0, 0, 255))
w = width * actor.sp / [actor.maxsp,1].max
self.contents.fill_rect(x, y+84, w,1, Color.new(40, 176, 255, 255))
self.contents.fill_rect(x, y+85, w,1, Color.new(78, 10, 175, 255))
self.contents.fill_rect(x, y+86, w,1, Color.new(94, 10, 214, 255))
self.contents.fill_rect(x, y+87, w,1, Color.new(78, 10, 175, 255))
end
#--------------------------------------------------------------------------
# ● exp描画
#--------------------------------------------------------------------------
def draw_actor_exp_meter(actor, x, y, width = 156, type = 0)
if type == 1 and actor.hp == 0
return
end
self.contents.fill_rect(x-1, y+83, width+2,6, Color.new(0, 0, 0, 255))
w = width * actor.now_exp/[ actor.next_exp,1].max
self.contents.fill_rect(x, y+83, w,1, Color.new(77, 140, 140, 255))
self.contents.fill_rect(x, y+85, w,1, Color.new(100, 220, 220, 255))
self.contents.fill_rect(x, y+86, w,1, Color.new(77, 173, 173, 255))
self.contents.fill_rect(x, y+87, w,1, Color.new(77, 207, 207, 255))
self.contents.fill_rect(x, y+87, w,1, Color.new(77, 173, 173, 255))
self.contents.fill_rect(x, y+87, w,1, Color.new(77, 140, 140, 255))
end
end
|
|