#==============================================================================
# ■ Game_Actor
#------------------------------------------------------------------------------
# 处理角色的类。本类在 Game_Actors 类 ($game_actors)
# 的内部使用、Game_Party 类请参考 ($game_party) 。
#==============================================================================
class Game_Actor < Game_Battler
alias kds_setup setup
def setup(actor_id)
# 宠物id的数组
if @baby == nil
@baby = []
end
# 当前宠物的潜力点
if @qianli == nil
@qianli = 0
end
# 参战
if @kds_canzhan == nil
@kds_canzhan = 0
end
# 暂不明用途
@bbzh = []
# 设置宠物
kds_setup(actor_id)
end
# 返回 宠物id的数组
def kds_baby
return @baby
end
# 修改参战数据并返回
def kds_canzhan=(kds_canzhan)
@kds_canzhan = kds_canzhan
return @kds_canzhan
end
# 返回参战信息
def kds_canzhan
return @kds_canzhan
end
# 修改主人数据并返回
def zhuren=(zhuren)
@zhuren = zhuren
return @zhuren
end
# 返回主人信息
def zhuren
return @zhuren
end
# 以下暂不明用途
def ac_id=(ac_id)
@ac_id = ac_id
return @ac_id
end
def ac_id
return @ac_id
end
def bbzh
return @bbzh
end
end
#==============================================================================
# ■ Game_Party
#------------------------------------------------------------------------------
# 处理同伴的类。包含金钱以及物品的信息。本类的实例
# 请参考 $game_party。
#==============================================================================
class Game_Party
#--------------------------------------------------------------------------
# ● 加入同伴
# actor_id : 角色 ID
#--------------------------------------------------------------------------
def add_actor(actor_id)
# 获取角色
actor = $game_actors[actor_id]
# 小于50的为角色
if actor_id <= 50
# 同伴人数未满 5 人、本角色不在队伍中的情况下 (防止角色突破5个)
if @actors.size < 5 and not @actors.include?(actor)
# 添加角色
@actors.push(actor)
# 初始化HP、SP
$game_actors[actor_id].hp = $game_actors[actor_id].maxhp
$game_actors[actor_id].sp = $game_actors[actor_id].maxsp
# 初始化角色潜能
$game_actors[actor_id].qianli = 4 * $game_actors[actor_id].level
# 初始化属性点
$game_actors[actor_id].gg =
$game_actors[actor_id].lx =
$game_actors[actor_id].ll =
$game_actors[actor_id].mj = 1 * $game_actors[actor_id].level
# 刷新队伍
$game_player.refresh
elsif @actors.size == 5
$队伍满员 = true
end
# ** 宠物 $game_variables[1] 主人ID? 1号变量
# 设置角色可带召唤兽的数量
elsif $game_actors[$game_variables[1]].kds_baby.include?(actor_id) == false and
# 可以携带10只宠物
$game_actors[$game_variables[1]].kds_baby.size < 10
$game_actors[$game_variables[1]].kds_baby.push(actor_id)
# ** 确认$game_variables[1] 是主人
$game_actors[actor_id].zhuren = $game_variables[1]
end
end
#--------------------------------------------------------------------------
# ● 角色离开
# actor_id : 角色 ID
#--------------------------------------------------------------------------
def remove_actor(actor_id)
# 宠物的场合
if actor_id > 50
# 放生宠物
$game_actors[$game_variables[1]].kds_baby.delete(actor_id)
# 重新设置参战信息
if $game_actors[$game_variables[1]].kds_canzhan == actor_id
# 移除参战宠物【召还】
$game_actors[$game_variables[1]].kds_canzhan = 0
end
else
# 宠物离开队伍
$game_actors[actor_id].kds_baby.clear
# 角色离开队伍
@actors.delete($game_actors[actor_id])
end
# ** 刷新
$game_player.refresh
end
end