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

54 lines
2.2 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.0
#==============================================================================
=begin
作者tomoaky
webサイトひきも記は閉鎖しました。 (http://hikimoki.sakura.ne.jp/)
能力値を乗算ではなく加算で補正するステートを追加します。
ステートのメモ欄に <hp 100> などのタグを使って設定します。
hp, mp, atk, def, mat, mdf, agi, luk がそれぞれ
最大HP, 最大MP, 攻撃力, 防御力, 魔法攻撃, 魔法防御, 敏捷性, 運 に対応します。
2014.10.14 Ver1.0
公開
=end
#==============================================================================
# ■ RPG::State
#==============================================================================
class RPG::State
#--------------------------------------------------------------------------
# ○ 加算能力値を返す
#--------------------------------------------------------------------------
def params(param_id)
case param_id
when 0; /<hp\s*(\-*\d+)\s*>/i =~ @note ? $1.to_i : 0
when 1; /<mp\s*(\-*\d+)\s*>/i =~ @note ? $1.to_i : 0
when 2; /<atk\s*(\-*\d+)\s*>/i =~ @note ? $1.to_i : 0
when 3; /<def\s*(\-*\d+)\s*>/i =~ @note ? $1.to_i : 0
when 4; /<mat\s*(\-*\d+)\s*>/i =~ @note ? $1.to_i : 0
when 5; /<mdf\s*(\-*\d+)\s*>/i =~ @note ? $1.to_i : 0
when 6; /<agi\s*(\-*\d+)\s*>/i =~ @note ? $1.to_i : 0
when 7; /<luk\s*(\-*\d+)\s*>/i =~ @note ? $1.to_i : 0
end
end
end
#==============================================================================
# ■ Game_BattlerBase
#==============================================================================
class Game_BattlerBase
#--------------------------------------------------------------------------
# ● 通常能力値の加算値取得
#--------------------------------------------------------------------------
alias tmpstate_game_battlerbase_param_plus param_plus
def param_plus(param_id)
states.inject(tmpstate_game_battlerbase_param_plus(param_id)) {|r, state|
r + state.params(param_id) }
end
end