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

113 lines
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.

module FRGP
#--------------------------------------------------------------------------
# ● 定数(属性アイコンの開始番号)
#--------------------------------------------------------------------------
ICON_ELEMENT_START = 96 # 炎:96 氷:97 雷:98 光:102 闇:103 物理:使うとしたら116 吸収:120
NO_ICON = [8,11] # アイコンを表示させない属性番号
ELEMENTS = [*(1..5),9,10,6,7,11] # 属性ID
ELEMENT_ICON = Hash[
1 => 116,
2 => 120,
3 => 96,
4 => 97,
5 => 98,
6 => 281,
7 => 122,
8 => 0,
9 => 102,
10 => 103,
11 => 481,
12 => 0,
]
end
#==============================================================================
# ■ Game_BattlerBase
#------------------------------------------------------------------------------
#  バトラーを扱う基本のクラスです。主に能力値計算のメソッドを含んでいます。こ
# のクラスは Game_Battler クラスのスーパークラスとして使用されます。
#==============================================================================
class Game_BattlerBase
#--------------------------------------------------------------------------
# ○ 弱点属性配列
#--------------------------------------------------------------------------
def most_weak
return []
end
end
#==============================================================================
# ■ Game_Enemy
#------------------------------------------------------------------------------
#  敵キャラを扱うクラスです。このクラスは Game_Troop クラス($game_troop
# 内部で使用されます。
#==============================================================================
class Game_Enemy < Game_Battler
#--------------------------------------------------------------------------
# ○ 敵の弱点属性配列
#--------------------------------------------------------------------------
def most_weak
@most_weak ||= weak_set
end
#--------------------------------------------------------------------------
# ○ 敵の弱点属性配列
#--------------------------------------------------------------------------
def weak_set
#weak = features(FEATURE_ELEMENT_RATE).select{|ft| select_rule(ft) }
#weak.sort! {|a, b| element_rate(b.data_id) - element_rate(a.data_id)}
#list = []
#weak.each{|ft| list.push(icon_number(ft))}
weak = FRGP::ELEMENTS.select {|id| select_rule(id) } #features(FEATURE_ELEMENT_RATE).select{|ft| select_rule(ft) }
weak.sort! {|a, b| element_rate(b) - element_rate(a) }
list = []
weak.each{|id| list.push(icon_number(id))}
return list
=begin
weak = super
if enemy.note.include?("弱点属性:")
enemy.note.each_line do |line|
case line
when /\<弱点属性:(\D+)\>/
weak.push(ICON_ELEMENT_START + $data_system.elements.index($1) - 3)
end
end
end
weak
=end
end
#--------------------------------------------------------------------------
# ○ 選別ルール
#--------------------------------------------------------------------------
def select_rule(id)#(ft)
element_rate(id) > 1.0 && !FRGP::NO_ICON.include?(id) #&& (ft.data_id >= 3 && ft.data_id <= 10)
#ft.value > 1.0 && !FRGP::NO_ICON.include?(ft.data_id) #&& (ft.data_id >= 3 && ft.data_id <= 10)
end
#--------------------------------------------------------------------------
# ○ アイコン数値
#--------------------------------------------------------------------------
def icon_number(id)#(ft)
#ICON_ELEMENT_START + (ft.data_id == 1 ? 23 : ft.data_id) - 3
#ICON_ELEMENT_START + ft.data_id - 3
FRGP::ELEMENT_ICON[id]#ft.data_id]
end
end
#==============================================================================
# ■ Game_Party
#------------------------------------------------------------------------------
#  パーティを扱うクラスです。所持金やアイテムなどの情報が含まれます。このクラ
# スのインスタンスは $game_party で参照されます。
#==============================================================================
class Game_Party < Game_Unit
#--------------------------------------------------------------------------
# ○ 特定の装備品やスキルを装備しているか?
#--------------------------------------------------------------------------
def weak_disclose?
extra_equip_include?("<#{FAKEREAL::DISCLOSE}:弱点>")
end
end