本帖最后由 张咚咚 于 2017-7-17 18:11 编辑
$技能更改 = { 80=>[1,"新名称","新说明",5,[2]], # 80号技能,开关1为on且2号状态持有使用新名称、新说明、5号新动画ID } $技能恢复 = {} class Window_BattleLog < Window_Selectable #-------------------------------------------------------------------------- # ● 显示使用技能/物品 #-------------------------------------------------------------------------- alias qqeat_display_use_item display_use_item def display_use_item(subject, item) ######################################################################## #角色、技能、有设定 if subject.is_a?(Game_Actor) and item.is_a?(RPG::Skill) and $技能更改.keys.include?(item.id) #获取满足的状态数量 state_id = 0 subject.states.each{|s|$技能更改[item.id][4].each{|i|state_id += 1 if s.id == i}} #获取技能对应的下标 skill_index = {} 0.upto(subject.skills.length-1){|i|skill_index[subject.skills[i].id] = i} #开关满足、状态满足 if ($技能更改[item.id][0] == -1 or $game_switches[$技能更改[item.id][0]]) and state_id == $技能更改[item.id][4].length #记录原来的名称、说明、动画ID $技能恢复[item.id] = [item.name,item.message1,item.animation_id] if $技能恢复[item.id] == nil #更改使用 item.name = $技能更改[item.id][1] item.message1 = $技能更改[item.id][2] item.animation_id = $技能更改[item.id][3] #更改实际 subject.skills[skill_index[item.id]].name = $技能更改[item.id][1] elsif $技能恢复[item.id] != nil #恢复原来的名称、说明、动画ID skill = subject.skills[skill_index[item.id]] skill.name = $技能恢复[item.id][0] skill.message1 = $技能恢复[item.id][1] skill.animation_id = $技能恢复[item.id][2] end end ######################################################################## qqeat_display_use_item(subject, item) end end
$技能更改 = {
80=>[1,"新名称","新说明",5,[2]], # 80号技能,开关1为on且2号状态持有使用新名称、新说明、5号新动画ID
}
$技能恢复 = {}
class Window_BattleLog < Window_Selectable
#--------------------------------------------------------------------------
# ● 显示使用技能/物品
#--------------------------------------------------------------------------
alias qqeat_display_use_item display_use_item
def display_use_item(subject, item)
########################################################################
#角色、技能、有设定
if subject.is_a?(Game_Actor) and item.is_a?(RPG::Skill) and $技能更改.keys.include?(item.id)
#获取满足的状态数量
state_id = 0
subject.states.each{|s|$技能更改[item.id][4].each{|i|state_id += 1 if s.id == i}}
#获取技能对应的下标
skill_index = {}
0.upto(subject.skills.length-1){|i|skill_index[subject.skills[i].id] = i}
#开关满足、状态满足
if ($技能更改[item.id][0] == -1 or $game_switches[$技能更改[item.id][0]]) and state_id == $技能更改[item.id][4].length
#记录原来的名称、说明、动画ID
$技能恢复[item.id] = [item.name,item.message1,item.animation_id] if $技能恢复[item.id] == nil
#更改使用
item.name = $技能更改[item.id][1]
item.message1 = $技能更改[item.id][2]
item.animation_id = $技能更改[item.id][3]
#更改实际
subject.skills[skill_index[item.id]].name = $技能更改[item.id][1]
elsif $技能恢复[item.id] != nil
#恢复原来的名称、说明、动画ID
skill = subject.skills[skill_index[item.id]]
skill.name = $技能恢复[item.id][0]
skill.message1 = $技能恢复[item.id][1]
skill.animation_id = $技能恢复[item.id][2]
end
end
########################################################################
qqeat_display_use_item(subject, item)
end
end
|