rebf-gaiden/Scripts/_.29.rb
2025-04-26 17:06:34 -05:00

33 lines
No EOL
1.3 KiB
Ruby
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#==============================================================================
# ■ RGSS3 アイテム所持数制限 Ver1.00 by 星潟
#------------------------------------------------------------------------------
# 特定アイテムの所持数に制限を付与します。
# アイテムのメモ欄に特定の書式を記入する事で機能するようになります。
#
# 設定例
# <所持制限:20>
# このアイテムは20個までしか持つ事が出来なくなります。
#==============================================================================
module M_I_N_CHANGE
WORD = "所持制限"
end
class Game_Party < Game_Unit
#--------------------------------------------------------------------------
# ● アイテムの最大所持数取得
#--------------------------------------------------------------------------
alias max_item_number_max_change max_item_number
def max_item_number(item)
return if item == nil
memo_data = item.note
memo_data = memo_data.scan(/<#{M_I_N_CHANGE::WORD}[:](\d+)>/)
memo = memo_data.flatten
if memo != nil and not memo.empty?
data = memo[0].to_i+$game_variables[20] #紅茶走
return data
else
max_item_number_max_change(item)
end
end
end