lunariafantasia/Scripts/_.47.rb
2024-01-12 03:12:38 -06:00

118 lines
No EOL
4.8 KiB
Ruby
Raw 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.

=begin
#==============================================================================
# ■ Game_Actor
#------------------------------------------------------------------------------
#  アクターを扱うクラスです。このクラスは Game_Actors クラス($game_actors
# の内部で使用され、Game_Party クラス($game_partyからも参照されます。
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# ○ 公開インスタンス変数
#--------------------------------------------------------------------------
attr_reader :bp # バッドポイント(堕落度)
attr_accessor :virgin # 処女判定変数
#--------------------------------------------------------------------------
# ● オブジェクト初期化 ※エイリアス
#--------------------------------------------------------------------------
alias bad_point_initialize initialize
def initialize(actor_id)
@bp = 0
@virgin = true
bad_point_initialize(actor_id)
end
#--------------------------------------------------------------------------
# ○
#--------------------------------------------------------------------------
def bp=(bp)
@bp = [[bp, 100].min, 0].max
end
#--------------------------------------------------------------------------
# ○ バッドポイントによる能力値の低下率 最大で半減 HPMPは除外
#--------------------------------------------------------------------------
def bad_point(param_id)
if param_id == 0 || param_id == 1 || pureness
1
else
1 - @bp * 0.005
end
end
#--------------------------------------------------------------------------
# ● 通常能力値の基本値取得 ※エイリアス 
#  BPによる低下は装備後の値ではなく基本能力値のみ
#--------------------------------------------------------------------------
alias bad_point_param_base param_base
def param_base(param_id)
(bad_point_param_base(param_id) * bad_point(param_id)).to_i
end
#--------------------------------------------------------------------------
# ○ バッドポイント無効判定
#--------------------------------------------------------------------------
def pureness
all_note_check("<ピュアネス>")
end
#--------------------------------------------------------------------------
# ○ 処女判定
#--------------------------------------------------------------------------
def virgin?
@virgin
end
end
#==============================================================================
# ■ Game_Battler
#------------------------------------------------------------------------------
#  スプライトや行動に関するメソッドを追加したバトラーのクラスです。このクラス
# は Game_Actor クラスと Game_Enemy クラスのスーパークラスとして使用されます。
#==============================================================================
class Game_Battler < Game_BattlerBase
#--------------------------------------------------------------------------
# ● 使用効果TP 増加 ※エイリアス BP浄化追加
# BP浄化を行う際は TP増加を0% と設定する必要あり
#--------------------------------------------------------------------------
alias bad_heal_item_effect_gain_tp item_effect_gain_tp
def item_effect_gain_tp(user, item, effect)
if item.note =~ /\<BP浄化:(\d+)\>/
value = $1.to_i
#@result.success = true
self.bp -= value
else
bad_heal_item_effect_gain_tp(user, item, effect)
end
end
#--------------------------------------------------------------------------
# ● 使用効果のテスト ※再定義
#--------------------------------------------------------------------------
def item_effect_test(user, item, effect)
case effect.code
when EFFECT_RECOVER_HP
hp < mhp || effect.value1 < 0 || effect.value2 < 0
when EFFECT_RECOVER_MP
mp < mmp || effect.value1 < 0 || effect.value2 < 0
when EFFECT_GAIN_TP #追加
if item.note =~ /\<BP浄化:(\d+)\>/
@bp > 0
else
tp < max_tp || effect.value1 < 0 || effect.value2 < 0
end
when EFFECT_ADD_STATE
!state?(effect.data_id)
when EFFECT_REMOVE_STATE
state?(effect.data_id)
when EFFECT_ADD_BUFF
!buff_max?(effect.data_id)
when EFFECT_ADD_DEBUFF
!debuff_max?(effect.data_id)
when EFFECT_REMOVE_BUFF
buff?(effect.data_id)
when EFFECT_REMOVE_DEBUFF
debuff?(effect.data_id)
when EFFECT_LEARN_SKILL
actor? && !skills.include?($data_skills[effect.data_id])
else
true
end
end
end
=end