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

92 lines
No EOL
4 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.

#==============================================================================
# ■ Game_Actor
#------------------------------------------------------------------------------
#  アクターを扱うクラスです。このクラスは Game_Actors クラス($game_actors
# の内部で使用され、Game_Party クラス($game_partyからも参照されます。
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# ● 定数(特徴)
#--------------------------------------------------------------------------
ALL_ATTACK_SKILL = 413 # 全体攻撃スキル
#--------------------------------------------------------------------------
# ● 通常攻撃のスキル ID を取得 ※オーバーライド
#--------------------------------------------------------------------------
def attack_skill_id
if weapons.empty?
return 1
else
return all_attacker? ? ALL_ATTACK_SKILL : weapons[0].atk_id
end
end
#--------------------------------------------------------------------------
# 敵全体攻撃の武器スキルを持っているか
#--------------------------------------------------------------------------
def all_attacker?
weapon_skill.compact.any? {|w_class| w_class.all_attacker }
end
end
class RPG::Weapon < RPG::EquipItem
def atk_id
return $1.to_i if self.note =~ /\<攻撃スキル:(\d+)\>/
return 1
end
end
class RPG::Class < RPG::BaseItem
def all_attacker
@all_attacker ||= self.note =~ /\<全体攻撃化\>/
end
end
#==============================================================================
# ■ Game_Actor
#------------------------------------------------------------------------------
#  アクターを扱うクラスです。このクラスは Game_Actors クラス($game_actors
# の内部で使用され、Game_Party クラス($game_partyからも参照されます。
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# ● 定数(特徴)
#--------------------------------------------------------------------------
ALL_ATTACK_SKILL = 413 # 全体攻撃スキル
MAGIC_PUNCH = 106 # 魔力殴打スキル
#--------------------------------------------------------------------------
# ● 通常攻撃のスキル ID を取得 ※オーバーライド
#--------------------------------------------------------------------------
alias magic_attack_skill_id attack_skill_id
def attack_skill_id
atk_id = magic_attack_skill_id
mp_skill = $data_skills[MAGIC_PUNCH]
return atk_id if !$game_switches[Option::MagicPunch] || !skill_learn?(mp_skill)
return MAGIC_PUNCH if atk_id == 1 && usable?(mp_skill)
return atk_id
end
#--------------------------------------------------------------------------
# 通常攻撃のスキル名表記
#--------------------------------------------------------------------------
def normal_attack_name
case attack_skill_id
when MAGIC_PUNCH ; return $data_skills[MAGIC_PUNCH].name
else ; return Vocab::attack
end
end
end
#==============================================================================
# ■ Window_ActorCommand
#------------------------------------------------------------------------------
#  バトル画面で、アクターの行動を選択するウィンドウです。
#==============================================================================
class Window_ActorCommand < Window_Command
#--------------------------------------------------------------------------
# ● 攻撃コマンドをリストに追加 ※再定義
#--------------------------------------------------------------------------
def add_attack_command
add_command(@actor.normal_attack_name, :attack, @actor.attack_usable?)
end
end