Created
May 31, 2021 09:57
-
-
Save cacao-soft/3975ee4a6d94dcf00589bba52ddfdc06 to your computer and use it in GitHub Desktop.
RGSS3 バトラー毎にスキル名を切り替え
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# アクターとエネミーでスキル名を切り替え by CACAO | |
# | |
# スキルのメモ欄に行頭を空けず行をわけて記述し、 | |
# 使用時メッセージに \name と入れるとメモ欄の名前に置き換えられる | |
# A:アクター時の名称 | |
# E:エネミー時の名称 | |
# A1:のように番号を入れるとそのキャラの時の名称となる | |
# ※ ただし、番号付きは上に記述しなければ全体の名称が使用される | |
# | |
# アクターおよびエネミーのメモ欄に 種族:●● と記述し種族での切り替えも可能 | |
# R●●:種族設定時の名称 | |
# | |
class Window_BattleLog < Window_Selectable | |
#-------------------------------------------------------------------------- | |
# ● スキル/アイテム使用の表示 | |
#-------------------------------------------------------------------------- | |
def display_use_item(subject, item) | |
if item.is_a?(RPG::Skill) | |
add_text(item_message(subject.name + item.message1, subject, item)) | |
unless item.message2.empty? | |
wait | |
add_text(item_message(item.message2, subject, item)) | |
end | |
else | |
message = sprintf(Vocab::UseItem, subject.name, item.name) | |
add_text(item_message(message, subject, item)) | |
end | |
end | |
#-------------------------------------------------------------------------- | |
# ● | |
#-------------------------------------------------------------------------- | |
def item_message(message, subject, item) | |
result = convert_escape_characters(message) | |
result.gsub!(/\ename/i) do | |
case | |
when subject.enemy? | |
key = "EE" | |
batter = subject.enemy | |
when subject.actor? | |
key = "AA" | |
batter = subject.actor | |
else | |
break item.name | |
end | |
race = batter.note[/^種族\s*[::]\s*(.+)/, 1] | |
regexp = /^(?:[#{key}](?:#{batter.id})?|[RR]#{race})\s*[::]\s*(.+)/ | |
item.note[regexp, 1] || item.name | |
end | |
result | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
スキル名は、上から検索されるので個別設定は上に記述する
種族別にスキル名を変更する場合は、種族の設定が必要