king-exit/Scripts/_.59.rb
2024-08-31 14:17:23 -05:00

82 lines
No EOL
3.3 KiB
Ruby
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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 星潟
#------------------------------------------------------------------------------
# 使用時にレベルが増加するアイテム・スキルを作成できるようになります。
# 以下、追加されるイベントコマンド(スクリプトで使用)の解説です。
# 戦闘中でも使えますが、最低限の要素しか考慮していませんので
# 非戦闘時限定にするのが妥当かと思われます。
#
# 使用例
# アイテムのメモ欄に<レベルアップ効果:5>と記入すると
# 使用時にレベルが5上昇します。
#==============================================================================
module L_U_Item
#レベルアップアイテムのメモ欄に記入するキーワードを指定します。
WORD = "レベルアップ効果"
#戦闘不能時も有効かどうかを決定します。(true 可能/false 不可能)
#なお、戦闘時に使用した場合、元々戦闘不能者に有効な設定でなければ
#ここでの設定に関わらず、非戦闘不能者へ効果対象が変更されます。
DEAD = false
#非戦闘時のレベルアップメッセージの表示可否を設定します。(true 表示/false 非表示)
LVNB = true
#戦闘時のレベルアップメッセージの表示可否を設定します。(true 表示/false 非表示)
LVIB = false
end
class Game_Battler < Game_BattlerBase
#--------------------------------------------------------------------------
# ● スキル/アイテムの適用テスト
# 使用対象が全快しているときの回復禁止などを判定する。
#--------------------------------------------------------------------------
alias item_test_lui item_test
def item_test(user, item)
data = item_test_lui(user, item)
return data unless lui_check(item)
return true
end
#--------------------------------------------------------------------------
# ● 使用効果のテスト
#--------------------------------------------------------------------------
alias item_effect_test_lui item_effect_test
def item_effect_test(user, item, effect)
data = item_effect_test_lui(user, item, effect)
return data unless lui_check(item)
return true
end
#--------------------------------------------------------------------------
# ● 使用効果の適用
#--------------------------------------------------------------------------
alias item_apply_lui item_apply
def item_apply(user, item)
item_apply_lui(user, item)
return unless @result.hit? == true
return if !actor?
return if dead? && !L_U_Item::DEAD
return if level >= max_level
memo = item.note.scan(/<#{L_U_Item::WORD}[:](\S+)>/)
memo = memo.flatten
if memo != nil and !memo.empty?
if SceneManager.scene_is?(Scene_Battle)
change_level(level + memo[0].to_i, L_U_Item::LVIB)
else
change_level(level + memo[0].to_i, L_U_Item::LVNB)
end
@result.success = true
end
end
def lui_check(item)
return false if !actor?
return false if dead? && !L_U_Item::DEAD
return false if !item.note.include?(L_U_Item::WORD)
return false if level >= max_level
return true
end
end