本帖最后由 Cupidk爱呗茶 于 2021-8-13 23:49 编辑
非常抱歉最近有事回复迟了点 可以这样改
替换跨存档箱子中的这个方法
# 角色物品窗口 def update_item if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @Ngitem_window.active = true @item_window.active = false return end if Input.trigger?(Input::C) @item = @item_window.item id = NGVAR::NGTIMES_VARID max = $game_variables[id] * NGVAR::NGCASE_SIZE ngmax = NGVAR.get_data["NG_items"].inject(0) do |result, item| result + item[1] end # 演奏确定 SE num = 1 return $game_system.se_play($data_system.cancel_se) if ngmax + num > max if $game_party.items.include?(@item.id) && $game_party.item_number(@item.id) >= num $game_party.gain_item(@item.id, -num) if NGVAR.get_data["NG_items"][@item.id] NGVAR.get_data["NG_items"][@item.id] += num else NGVAR.get_data["NG_items"][@item.id] = num end $game_system.se_play($data_system.decision_se) name = "Data/NGdata.rxdata" save_data(NGVAR.get_data, name) @item_window.refresh @Ngitem_window.refresh else $game_system.se_play($data_system.cancel_se) end end end
# 角色物品窗口
def update_item
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@Ngitem_window.active = true
@item_window.active = false
return
end
if Input.trigger?(Input::C)
@item = @item_window.item
id = NGVAR::NGTIMES_VARID
max = $game_variables[id] * NGVAR::NGCASE_SIZE
ngmax = NGVAR.get_data["NG_items"].inject(0) do |result, item|
result + item[1]
end
# 演奏确定 SE
num = 1
return $game_system.se_play($data_system.cancel_se) if ngmax + num > max
if $game_party.items.include?(@item.id) && $game_party.item_number(@item.id) >= num
$game_party.gain_item(@item.id, -num)
if NGVAR.get_data["NG_items"][@item.id]
NGVAR.get_data["NG_items"][@item.id] += num
else
NGVAR.get_data["NG_items"][@item.id] = num
end
$game_system.se_play($data_system.decision_se)
name = "Data/NGdata.rxdata"
save_data(NGVAR.get_data, name)
@item_window.refresh
@Ngitem_window.refresh
else
$game_system.se_play($data_system.cancel_se)
end
end
end
|