赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 445 |
最后登录 | 2012-12-7 |
在线时间 | 24 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 24 小时
- 注册时间
- 2012-9-6
- 帖子
- 45
|
在脚本的原设定中,强化成功后装备的附加四项主属性也会变化,如果原来装备没有附加属性也会附加上四条主属性。
我想修改为强化成功后装备原本有的属性被加强,不生成新的属性,原脚本和修改过的脚本如下,但是修改后的实际效果是强化成功后所有附加属性都没了。。。==求问
修改脚本:
#---------------------------------------------------------------------
# ● 生成新的數據
#---------------------------------------------------------------------
new_str = add_str + main_str if main_str > 0 # 新的str_plus
new_str = main_str if main_str = 0
new_dex = add_dex + main_dex if main_dex > 0 # 新的dex_plus
new_dex = main_dex if main_dex = 0
new_agi = add_agi + main_agi if main_agi > 0 # 新的agi_plus
new_agi = main_agi if main_agi = 0
new_int = add_int + main_int if main_int > 0 # 新的int_plus
new_int = main_dex if main_int = 0
new_pdef = add_pdef + main_pdef if main_pdef > 0 # 新的物防
new_pdef = main_pdef if main_pdef = 0
new_mdef = add_mdef + main_mdef if main_mdef > 0 # 新的魔防
new_mdef = main_mdef if main_mdef = 0
new_name = main_name
new_des = main_des
new_element = main_element
new_atk = add_atk + main_atk if type == "weapon"
原脚本:
#---------------------------------------------------------------------
# ● 失敗/成功 的情况下,修正等級并取得提升/下降 值
#---------------------------------------------------------------------
case result
when "failture"
new_lv = lv - 1
add_atk = -@minus["common"]["atk"]
add_pdef = -@minus["common"]["pdef"]
add_mdef = -@minus["common"]["mdef"]
add_str = -@minus["common"]["str"]
add_dex = -@minus["common"]["dex"]
add_agi = -@minus["common"]["agi"]
add_int = -@minus["common"]["int"]
deduction = -@minus["common"]["deduction"] if @switches["deduct"]
when "success"
new_lv = lv + 1
add_atk = @plus["common"]["atk"]
add_pdef = @plus["common"]["pdef"]
add_mdef = @plus["common"]["mdef"]
add_str = @plus["common"]["str"]
add_dex = @plus["common"]["dex"]
add_agi = @plus["common"]["agi"]
add_int = @plus["common"]["int"]
deduction = @plus["common"]["deduction"] if @switches["deduct"]
end
#---------------------------------------------------------------------
# ● 處理隨機折損
#---------------------------------------------------------------------
if @switches["deduct"]
add_atk -= rand(deduction * 2)
add_pdef -= rand(deduction)
add_mdef -= rand(deduction)
add_str -= rand(deduction)
add_dex -= rand(deduction)
add_agi -= rand(deduction)
add_int -= rand(deduction)
end
#---------------------------------------------------------------------
# ● 取得原生數據
#---------------------------------------------------------------------
case type
when "weapon"
equipment = $data_weapons[id]
main_atk = equipment.atk
main_element = equipment.element_set
main_state = equipment.plus_state_set
when "armor"
equipment = $data_armors[id]
main_state = equipment.guard_state_set # 防禦狀態組
main_element = equipment.guard_element_set # 防禦屬性組
end
main_pdef = equipment.pdef
main_mdef = equipment.mdef
main_str = equipment.str_plus
main_dex = equipment.dex_plus
main_agi = equipment.agi_plus
main_int = equipment.int_plus
main_name = equipment.name
main_des = equipment.description
#---------------------------------------------------------------------
# ● 生成新的數據
#---------------------------------------------------------------------
new_str = add_str + main_str# 新的str_plus
new_dex = add_dex + main_dex # 新的dex_plus
new_agi = add_agi + main_agi # 新的agi_plus
new_int = add_int + main_int # 新的int_plus
new_pdef = add_pdef + main_pdef # 新的物防
new_mdef = add_mdef + main_mdef # 新的魔防
new_name = main_name
new_des = main_des
new_element = main_element
new_atk = add_atk + main_atk if type == "weapon"
|
|