# ————————————————————————————————————
# 本脚本来自www.66rpg.com,转载请保留此信息
# ————————————————————————————————————
#==============================================================================
# ■ Game_Actor
#------------------------------------------------------------------------------
# 处理角色的类。本类在 Game_Actors 类 ($game_actors)
# 的内部使用、Game_Party 类请参考 ($game_party) 。
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# ● 取得战斗画面的 X 坐标
#--------------------------------------------------------------------------
def screen_x
case self.index
when 0
return 350
when 1
return 430
when 2
return 510
when 3
return 580
else
return 600
end
end
#--------------------------------------------------------------------------
# ● 取得战斗画面的 Y 坐标
#--------------------------------------------------------------------------
def screen_y
case self.index
when 0
return 430
when 1
return 395
when 2
return 360
when 3
return 325
else
return 1000
end
end
#--------------------------------------------------------------------------
# ● 取得战斗画面的 Z 坐标
#--------------------------------------------------------------------------
def screen_z
case self.index
when 0
return 10
when 1
return 9
when 2
return 8
when 3
return 7
else
return 0
end
end
end
#==============================================================================
# ■ Window_Base
#------------------------------------------------------------------------------
# 游戏中全部窗口的超级类。
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# ● 描绘 HP
# actor : 角色
# x : 描画目标 X 坐标
# y : 描画目标 Y 坐标
# width : 描画目标的宽
#--------------------------------------------------------------------------
def draw_actor_hp1(actor, x, y, width = 72)
# 描绘字符串 "HP"
self.contents.font.color = system_color
self.contents.draw_text(x, y, 24, 24, $data_system.words.hp)
# 计算描绘 MaxHP 所需的空间
if width - 24 >= 32
hp_x = x + 32# + width - 24
end
# 描绘 HP
self.contents.font.color = actor.hp == 0 ? knockout_color :
actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
self.contents.draw_text(hp_x, y, 32, 24, actor.hp.to_s, 2)
end
#--------------------------------------------------------------------------
# ● 描绘 SP
# actor : 角色
# x : 描画目标 X 坐标
# y : 描画目标 Y 坐标
# width : 描画目标的宽
#--------------------------------------------------------------------------
def draw_actor_sp1(actor, x, y, width = 72)
# 描绘字符串 "SP"
self.contents.font.color = system_color
self.contents.draw_text(x, y, 24, 24, $data_system.words.sp)
# 计算描绘 MaxSP 所需的空间
if width - 24 >= 32
sp_x = x + 32# + width - 24
end
# 描绘 SP
self.contents.font.color = actor.sp == 0 ? knockout_color :
actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
self.contents.draw_text(sp_x, y, 32, 24, actor.sp.to_s, 2)
end
end
#==============================================================================
# ■ Window_BattleStatus
#------------------------------------------------------------------------------
# 显示战斗画面同伴状态的窗口。
#==============================================================================
class Window_BattleStatus < Window_Base
#--------------------------------------------------------------------------
# ● 初始化对像
#--------------------------------------------------------------------------
#$data_system_level_up_me = "Audio/ME/升级音乐"
def initialize
super(0, 0, 640, 480)
self.contents = Bitmap.new(width - 10, height - 32)
self.opacity = 0
@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] = true
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
self.contents.clear
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
actor = $game_party.actors
case i
when 0
x = 310
y = 390
when 1
x = 390
y = 340
when 2
x = 480
y = 300
when 3
x = 550
y = 270
end
if @level_up_flags
self.contents.font.color = normal_color
self.contents.draw_text(x, y, 80, 24, "LEVEL UP!")
Audio.me_stop
# Audio.me_play($data_system_level_up_me)
else
draw_actor_hp1(actor, x-15, y-15, 80)
draw_actor_sp1(actor, x-15, y+5, 80)
end
end
end
#--------------------------------------------------------------------------
# ● 刷新画面
#--------------------------------------------------------------------------
def update
super
# 主界面的不透明度下降
if $game_temp.battle_main_phase
self.contents_opacity -= 50 if self.contents_opacity > 1
else
self.contents_opacity += 50 if self.contents_opacity < 255
end
end
end
#==============================================================================
# ■ Window_BattleStatus
#==============================================================================
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
case i
when 0
x = 310
y = 390
when 1
x = 390
y = 340
when 2
x = 480
y = 300
when 3
x = 550
y = 270
end
draw_actor_hp_meter(actor, x, y, 50)
draw_actor_sp_meter(actor, x, y + 8, 50)
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.font.color = system_color
self.contents.fill_rect(x-1, y+27, width+2,6, Color.new(0, 0, 0, 25))
w = width * actor.hp / actor.maxhp
self.contents.fill_rect(x, y+28, w,1, Color.new(255, 96, 96, 255))
self.contents.fill_rect(x, y+29, w,1, Color.new(255, 0, 0, 255))
self.contents.fill_rect(x, y+30, w,1, Color.new(128, 0, 0, 255))
self.contents.fill_rect(x, y+31, w,1, Color.new(0, 0, 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.font.color = system_color
self.contents.fill_rect(x-1, y+27, width+2,6, Color.new(0, 0, 0, 255))
w = width * actor.sp / actor.maxsp
self.contents.fill_rect(x, y+28, w,1, Color.new(128, 255, 255, 255))
self.contents.fill_rect(x, y+29, w,1, Color.new(0, 255, 255, 255))
self.contents.fill_rect(x, y+30, w,1, Color.new(0, 192, 192, 255))
self.contents.fill_rect(x, y+31, w,1, Color.new(0, 128, 128, 255))
end
end
# 人物介绍 Ver. 1.1 作者: Claimh 翻译与修正:柳柳
#------------------------------------------------------------------------------
# http://www.k3.dion.ne.jp/~claimh/
#==============================================================================
#——功能简介:在状态页面按下回车键会进入人物介绍页面。
#——如果想自行建立功能,使用$scene = Scene_Charactor(角色编号).new即可
#——如果自行建立了功能不想使用默认的切换,去掉217行以后的内容
#——以下数组,如果人物超过8人,请自行继续添加(一般游戏没那么多主人公吧)
#——如果想更改内容,比如把“体重”改为“智商”,请修改102-107行的文字内容
# 从状态页面切换至人物介绍页面的按键
CHENGE_KEY = Input::C
#--------------------------------------------------------------------------
# 人物年龄 (自定义)
#--------------------------------------------------------------------------
CHARA_AGE = ["17","16","??","??","??","??","15","15"]
#--------------------------------------------------------------------------
# 人物出生地
#--------------------------------------------------------------------------
CHARA_FROM = ["希腊","罗马","??","??","??","??","雷都","日本东京"]
#--------------------------------------------------------------------------
# 人物身高
#--------------------------------------------------------------------------
CHARA_H = ["170","160","??","??","??","??","162","165"]
#--------------------------------------------------------------------------
# 人物体重
#--------------------------------------------------------------------------
CHARA_W = ["60","50","??","??","??","??","46","53"]
#--------------------------------------------------------------------------
# 人物介绍,可以写多行
#--------------------------------------------------------------------------
# 人物1号介绍
L1 = "RPG制作大师XP的标准主人公+形象代言人"
L2 = "是一个外表不经世事、内心坚强无比的小伙子"
L3 = ""
L_SET1 = [L1, L2, L3] # 人物1号的数组
# 人物2号介绍
L1 = "RPG制作大师XP的1号女主角"
L2 = "一个充满人性温情的女战士"
L3 = ""
L_SET2 = [L1, L2, L3] # 人物2号的数组
# 人物3号介绍
L1 = "史上最强的狂战士"
L2 = ""
L3 = ""
L_SET3 = [L1, L2, L3]
# 人物4号介绍
L1 = "年青的盗贼,冷血到无法言比喻"
L2 = "她执行任务从来没失败过"
L3 = "因为据说所有不小心见到她偷盗的人,都被一剑穿心"
L_SET4 = [L1, L2, L3]
# 人物5号介绍
L1 = "“如果有一天,鹤雪不在了,你还在”"
L2 = "“如果有一天,你不在了”"
L3 = "“——之要你的威名仍在,天下就仍存在着希望”"
L_SET5 = [L1, L2, L3]
# 人物6号介绍
L1 = "富家公子,战斗技能很差,只会用枪防身"
L2 = ""
L3 = ""
L_SET6 = [L1, L2, L3]
# 人物7号介绍
L1 = "充满冷酷的红魔法师"
L2 = "11岁,父母阵亡后加入了杀手组织"
L3 = "13岁,在一次行动失利中被抓到地牢严刑拷打长达半年"
L4 = "14岁,一个人杀光所有蹂躏她的狱卒,独自踏上旅途"
L_SET7 = [L1, L2, L3, L4]
# 人物8号介绍
L1 = "娇生惯养的贵族魔法师,从不懂人世艰难"
L2 = "自以为实力天下第一"
L3 = ""
L_SET8 = [L1, L2, L3]
# 人物介绍数组,如果不够继续添加。
CHARA_INFO = [L_SET1,L_SET2,L_SET3,L_SET4,L_SET5,L_SET6,L_SET7,L_SET8]
#==============================================================================
# Window_Charactor
#==============================================================================
class Window_Charactor < Window_Base
#--------------------------------------------------------------------------
# actor : 初始化的角色
#--------------------------------------------------------------------------
def initialize(actor)
super(0, 0, 640, 480)
self.contents = Bitmap.new(width - 32, height - 32)
@actor = actor
refresh
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def refresh
self.contents.clear
draw_battler_graphics(@actor, 100, 200)
self.contents.font.color.set(255, 255,50)
self.contents.draw_text(250, 10, 80, 32, "姓名")
self.contents.draw_text(250, 50, 80, 32, "年龄")
self.contents.draw_text(250, 90, 80, 32, "出生地")
self.contents.draw_text(250, 130, 80, 32, "身高")
self.contents.draw_text(250, 170, 80, 32, "体重")
self.contents.font.color = normal_color
draw_actor_name(@actor, 350, 10)
draw_actor_age(@actor, 350, 50)
draw_actor_from(@actor, 350, 90)
draw_actor_height(@actor, 350, 130)
draw_actor_weight(@actor, 350, 170)
draw_actor_other(@actor, 50, 250)
end
end
class Window_Base < Window
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def draw_battler_graphics(actor, x, y)
battler=RPG::Cache.battler(actor.battler_name, actor.battler_hue)
w = battler.width
h = battler.height
self.contents.blt(x-w/2, y-h, battler, Rect.new(0, 0, w,h))
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def draw_actor_age(actor, x, y)
self.contents.draw_text(x, y, 80, 32, CHARA_AGE[actor.id-1])
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def draw_actor_from(actor, x, y)
self.contents.draw_text(x, y, 180, 32, CHARA_FROM[actor.id-1])
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def draw_actor_height(actor, x, y)
self.contents.draw_text(x, y , 200, 32, CHARA_H[actor.id-1])
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def draw_actor_weight(actor, x, y)
self.contents.draw_text(x, y, 250, 32, CHARA_W[actor.id-1])
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def draw_actor_other(actor, x, y)
info = CHARA_INFO[actor.id-1]
for i in 0...info.size
self.contents.draw_text(x, y+32*i, 600, 32, info)
end
end
end
#==============================================================================
# Scene_Charactor
#==============================================================================
class Scene_Charactor
#--------------------------------------------------------------------------
# actor_index :角色编号
#--------------------------------------------------------------------------
def initialize(actor_index = 0, equip_index = 0)
@actor_index = actor_index
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def main
@actor = $game_party.actors[@actor_index]
@status_window = Window_Charactor.new(@actor)
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@status_window.dispose
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def update
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Menu.new(8)
return
end
if Input.trigger?(Input::R)
$game_system.se_play($data_system.cursor_se)
@actor_index += 1
@actor_index %= $game_party.actors.size
$scene = Scene_Charactor.new(@actor_index)
return
end
if Input.trigger?(Input::L)
$game_system.se_play($data_system.cursor_se)
@actor_index += $game_party.actors.size - 1
@actor_index %= $game_party.actors.size
$scene = Scene_Charactor.new(@actor_index)
return
end
end
end
#==============================================================================
# Scene_Status
#==============================================================================
class Scene_Status
alias update_chara update
def update
if Input.trigger?(CHENGE_KEY)
$game_system.se_play($data_system.decision_se)
$scene = Scene_Charactor.new(@actor_index)
return
end
update_chara
end
end
#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |