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

95 lines
No EOL
4.7 KiB
Ruby
Raw 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.

class Game_BattlerBase
#--------------------------------------------------------------------------
# ○ ノートに特定の文字列等が記されているかをチェック。
# nil対策として対象がnilの場合は参照前にfalseを返す
# flag特定の文字列等 valueアイテム等
#--------------------------------------------------------------------------
def note_check(value, flag)
return false if !value
value.note.include?(flag)
end
#--------------------------------------------------------------------------
# ○ Game_Actorクラスで使用
#--------------------------------------------------------------------------
def actor_check(str)
return false #エネミーは参照しないよう配慮
end
#--------------------------------------------------------------------------
# ○ Game_Actorクラスで使用
#--------------------------------------------------------------------------
def class_check(str)
return false #エネミーは参照しないよう配慮
end
#--------------------------------------------------------------------------
# ○ 特定の装備品を装備しているかの判定 文字列指定により色々応用可能
#--------------------------------------------------------------------------
def equip_check(str)
return false if enemy? #エネミーは装備品がないので参照しないよう配慮
equips.any?{|equip| note_check(equip, str)}
end
#--------------------------------------------------------------------------
# ○ 特定のステータス状態かの判定 文字列指定により色々応用可能
#--------------------------------------------------------------------------
def state_check(str)
states.any?{|state| note_check(state, str)}
end
#--------------------------------------------------------------------------
# ○ 特定のスキルを装備しているかの判定
#--------------------------------------------------------------------------
def equip_skill_check(str)
return false if enemy? #エネミーはスキル装備がないので
equip_class.any?{|skill| note_check(skill, str)}
end
#--------------------------------------------------------------------------
# ○ 特定の武器スキルがアクティブかの判定
#--------------------------------------------------------------------------
def weapon_skill_check(str)
return false if enemy? #エネミーは武器スキルがないので
weapon_skill.any?{|skill| note_check(skill, str)}
end
#--------------------------------------------------------------------------
# ○ 特定のステータス状態、または装備品を装備しているかの判定
#--------------------------------------------------------------------------
def all_note_check(str)
state_check(str) || equip_check(str) || equip_skill_check(str) || #パッシブ用に一個追加
actor_check(str) || class_check(str) || weapon_skill_check(str)
end
end
#==============================================================================
# ■ Game_Actor
#------------------------------------------------------------------------------
#  アクターを扱うクラスです。このクラスは Game_Actors クラス($game_actors
# の内部で使用され、Game_Party クラス($game_partyからも参照されます。
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# ○ アクターのノートのチェック
#--------------------------------------------------------------------------
def actor_check(str)
note_check(actor, str)
end
#--------------------------------------------------------------------------
# ○ 職業のノートのチェック
#--------------------------------------------------------------------------
def class_check(str)
note_check(self.class, str)
end
end
#==============================================================================
# ■ Game_Party
#------------------------------------------------------------------------------
#  パーティを扱うクラスです。所持金やアイテムなどの情報が含まれます。このクラ
# スのインスタンスは $game_party で参照されます。
#==============================================================================
class Game_Party < Game_Unit
#--------------------------------------------------------------------------
# ○ 特定の装備品やスキルを装備しているか?
#--------------------------------------------------------------------------
def extra_equip_include?(str)
all_members.any? {|actor| actor.all_note_check(str) }
end
end