【RMXP】装备附带技能
说明:
使装备附带技能,使用装备时习得技能,卸下装备后即遗忘该技能。
对于事件中的“变更装备”也一样有效。=begin
装备附带技能V1.0
作者:失落的乐章
说明:使装备附带技能,使用装备时习得技能,卸下装备后即遗忘该技能。
对于事件中的“变更装备”也一样有效。
=end
module SGS_ES
#以下是对装备及其附属技能的设定。格式为“武器ID => 技能ID”,如下。
#
WPSKILL ={ 4 => 60, #武器附带技能
3 => 59
}
A1SKILL = { } #防具1(默认为盾)附带技能
A2SKILL = { } #防具2(默认为头部防具)附带技能
A3SKILL = { } #防具3(默认为身体防具)附带技能
A4SKILL = { 29 => 7 } #防具4(默认为装饰品)附带技能
def self.forget_skill(actor)
WPSKILL.each { |wq,sk| actor.forget_skill(sk) if actor.weapon_id == wq }
A1SKILL.each { |wq,sk| actor.forget_skill(sk) if actor.armor1_id == wq }
A2SKILL.each { |wq,sk| actor.forget_skill(sk) if actor.armor2_id == wq }
A3SKILL.each { |wq,sk| actor.forget_skill(sk) if actor.armor3_id == wq }
A4SKILL.each { |wq,sk| actor.forget_skill(sk) if actor.armor4_id == wq }
end
def self.learn_skill(actor)
WPSKILL.each { |wq,sk| actor.learn_skill(sk) if actor.weapon_id == wq }
A1SKILL.each { |wq,sk| actor.learn_skill(sk) if actor.armor1_id == wq }
A2SKILL.each { |wq,sk| actor.learn_skill(sk) if actor.armor2_id == wq }
A3SKILL.each { |wq,sk| actor.learn_skill(sk) if actor.armor3_id == wq }
A4SKILL.each { |wq,sk| actor.learn_skill(sk) if actor.armor4_id == wq }
end
end
class Interpreter
#--------------------------------------------------------------------------
# ● 变更装备
#--------------------------------------------------------------------------
def command_319
# 获取角色
actor = $game_actors[@parameters]
# 变更角色
if actor != nil
SGS_ES.forget_skill(actor)
actor.equip(@parameters, @parameters)
SGS_ES.learn_skill(actor)
end
# 继续
return true
end
end
class Scene_Equip
def update_item
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@right_window.active = true
@item_window.active = false
@item_window.index = -1
return
end
if Input.trigger?(Input::C)
$game_system.se_play($data_system.equip_se)
item = @item_window.item
actemp = $game_actors[@actor_index+1]
SGS_ES.forget_skill(actemp)
@actor.equip(@right_window.index, item == nil ? 0 : item.id)
SGS_ES.learn_skill(actemp)
@right_window.active = true
@item_window.active = false
@item_window.index = -1
@right_window.refresh
@item_window.refresh
return
end
end
end
页:
[1]