#encoding:utf-8
#==============================================================================
# ■ Game_Actor
#------------------------------------------------------------------------------
# 管理角色的类。
# 本类在 Game_Actors 类 ($game_actors) 的内部使用。
# 具体使用请查看 Game_Party 类 ($game_party) 。
#==============================================================================
module SUIT
# 套装数据库
SUITS = []
# 写法:SUITS[x] = [套装状态, 防具部件1, 防具部件2, ...]
SUITS[0] = [25, 1, 2, 3]
SUITS[1] = [24, 1, 2]
end
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# ● 设置
#--------------------------------------------------------------------------
def setup(actor_id)
@actor_id = actor_id
@name = actor.name
@nickname = actor.nickname
init_graphics
@class_id = actor.class_id
[url=home.php?mod=space&uid=22147]@level[/url] = actor.initial_level
[url=home.php?mod=space&uid=13302]@exp[/url] = {}
@equips = []
@actor_sets = []
init_exp
init_skills
init_equips(actor.equips)
clear_param_plus
recover_all_init
end
alias old_refresh refresh
def refresh
process_suiting if SUIT::SUITS.size > 0
old_refresh
end
def process_suiting
@old_actor_sets = @actor_sets
@actor_sets = []
# 所有套装依次判定
SUIT::SUITS.each_with_index { |sets, index|
have_sets = false
# 套装部件依次判定
sets.each_with_index { |part, index|
if index > 0 # 跳过状态索引
# 如果角色装备不符合任意套装要求,返回false
have_sets = (armors.include?($data_armors[part]) ? true : false)
break if (have_sets == false)
end
}
@actor_sets.push(index) if (have_sets == true)
}
process_suiting_states(@old_actor_sets, @actor_sets)
end
def process_suiting_states(old_sets, sets)
# 移出旧套装状态
old_sets.each { |old_set|
@states.delete(SUIT::SUITS[old_set][0])
}
# 附加新套装状态
sets.each { |set|
@states.push(SUIT::SUITS[set][0])
}
@hp = [[@hp, mhp].min, 0].max
@mp = [[@mp, mmp].min, 0].max
end
#--------------------------------------------------------------------------
# ● 完全恢复
#--------------------------------------------------------------------------
def recover_all_init
@states.delete(1)
@hp = mhp
@mp = mmp
end
end
#==============================================================================
# ■ Game_Party
#------------------------------------------------------------------------------
# 管理队伍的类。保存有金钱及物品的信息。本类的实例请参考 $game_party 。
#==============================================================================
class Game_Party < Game_Unit
#--------------------------------------------------------------------------
# ● 设置战斗测试用队伍
#--------------------------------------------------------------------------
def setup_battle_test_members
$data_system.test_battlers.each do |battler|
actor = $game_actors[battler.actor_id]
actor.change_level(battler.level, false)
actor.init_equips(battler.equips)
actor.recover_all_init
add_actor(actor.id)
end
end
end