module SHOW_ENMEY_INFO
ENABLE_SWITCH = 0
# 控制信息显示的开关编号
# 写0则固定开启,写-1则固定关闭
def self.enable?
return false if ENABLE_SWITCH < 0
return true if ENABLE_SWITCH == 0
$game_switches[ENABLE_SWITCH]
end
SYMBOL_START = "(" #属性有效度开始符号
SYMBOL_END = " )" #属性有效度结束符号
end
class Window_Help
alias :cld99_set_enemy :set_enemy
def set_enemy(enemy)
return cld99_set_enemy(enemy) unless SHOW_ENMEY_INFO.enable?
text = enemy.name
state_text = make_battler_state_text(enemy, 112, false)
if state_text != ""
text += " " + state_text
end
#==================================================================
text += enemy.element_status_string
#==================================================================
set_text(text, 1)
end
end
class Game_Enemy
include SHOW_ENMEY_INFO
def element_status_string
string = ""
element_id = 1
(1..$data_system.elements.size).each do |element_id|
string += SYMBOL_END if element_id == $data_system.elements.size
#最后一次加个右括号
rank = $data_enemies[@enemy_id].element_ranks[element_id]
#element_ranks 1:A,2:B,3:C,4:D,5:E,6:F
next if rank == 3 || rank.nil? #C
term = $data_system.elements[element_id]
effect = (Array.new(6){|i| sprintf("%c",64+i)})[rank]
string += SYMBOL_START unless string.index(SYMBOL_START) #第一次加个左括号
string += " #{term}:#{effect}"
end
string
end
end