#==============================================================================
# ■ Game_Actor
#------------------------------------------------------------------------------
# 处理角色的类。本类在 Game_Actors 类 ($game_actors)
# 的内部使用、Game_Party 类请参考 ($game_party) 。
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# ● 定义实例变量
#--------------------------------------------------------------------------
attr_reader :name # 名称
attr_reader :character_name # 角色 文件名
attr_reader :character_hue # 角色 色相
attr_reader :class_id # 职业 ID
attr_reader :weapon_id # 武器 ID
attr_reader :armor1_id # 盾 ID
attr_reader :armor2_id # 头防具 ID
attr_reader :armor3_id # 身体体防具 ID
attr_reader :armor4_id # 装饰品 ID
attr_reader :level # 等级
attr_reader :exp # EXP
attr_reader :skills # 特技
#--------------------------------------------------------------------------
# ● 初始化对像
# actor_id : 角色 ID
#--------------------------------------------------------------------------
def initialize(actor_id)
super()
setup(actor_id)
end
#--------------------------------------------------------------------------
# ● 设置
# actor_id : 角色 ID
#--------------------------------------------------------------------------
def setup(actor_id)
actor = $data_actors[actor_id]
@actor_id = actor_id
@name = actor.name
@character_name = actor.character_name
@character_hue = actor.character_hue
@battler_name = actor.battler_name
@battler_hue = actor.battler_hue
@class_id = actor.class_id
@weapon_id = actor.weapon_id
@armor1_id = actor.armor1_id
@armor2_id = actor.armor2_id
@armor3_id = actor.armor3_id
@armor4_id = actor.armor4_id
@level = actor.initial_level
@exp_list = Array.new(101)
make_exp_list
@exp = @exp_list[@level]
@skills = []
@hp = maxhp
@sp = maxsp
@states = []
#************************************************
@states_name = ""
#************************************************
@states_turn = {}
@maxhp_plus = 0
@maxsp_plus = 0
@str_plus = 0
@dex_plus = 0
@agi_plus = 0
@int_plus = 0
# 学会特技
for i in 1..@level
for j in $data_classes[@class_id].learnings
if j.level == i
learn_skill(j.skill_id)
end
end
end
# 刷新自动状态
update_auto_state(nil, $data_armors[@armor1_id])
update_auto_state(nil, $data_armors[@armor2_id])
update_auto_state(nil, $data_armors[@armor3_id])
update_auto_state(nil, $data_armors[@armor4_id])
end
#-------------------------------------------------------------------------
# ● 设置状态名称*********************************************************
#-------------------------------------------------------------------------
def states_name
for i in @states
case i
when 1
name = "死亡"
when 2
name = "眩晕"
when 3
name = "中毒"
when 4
name = "幻惑"
when 5
name = ""
when 6
name = ""
when 7
name = ""
when 8
name = ""
when 9
name = ""
when 10
name = ""
when 11
name = ""
when 12
name = ""
when 13
name = ""
when 14
name = ""
when 15
name = ""
when 16
name = ""
when 17
name = ""
when 18
name = ""
when 19
name = ""
when 20
name = ""
end
end
return name
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
# ● 获取角色 ID
#--------------------------------------------------------------------------
def id
return @actor_id
end