class EFS_Battler < Game_Character
attr_accessor :character_name, :base_atk, :Xunzhang
attr_reader :soldier_id
def initialize(data_id)
super()
@character_name = Figter_data::CHARACTER_NAME[data_id]
@base_atk = Figter_data::BASE_ATK[data_id]
@base_base_atk = @base_atk
@soldier_id = data_id
@Xunzhang = []
如何在此定义里增加刷新@Xunzhang = [5]传递到 def refill
end
def refill
calculate_Xunzhang
end
def calculate_Xunzhang
@base_base_atk = get_Xunzhang_base_atk
end
def get_Xunzhang_base_atk(const = false)
n = const? Figter_data::BASE_ATK[@soldier_id] : @base_base_atk
@Xunzhang.each do |i|
next if i.nil?
n += Xunzhang_data::BASE_ATK[i]
end
n
end
end
class EFS_Battler < Game_Character
attr_accessor :character_name, :base_atk, :Xunzhang
attr_reader :soldier_id
def initialize(data_id)
super()
@character_name = Figter_data::CHARACTER_NAME[data_id]
@base_atk = Figter_data::BASE_ATK[data_id]
@base_base_atk = @base_atk
@soldier_id = data_id
@Xunzhang = []
如何在此定义里增加刷新@Xunzhang = [5]传递到 def refill
end
def refill
calculate_Xunzhang
end
def calculate_Xunzhang
@base_base_atk = get_Xunzhang_base_atk
end
def get_Xunzhang_base_atk(const = false)
n = const? Figter_data::BASE_ATK[@soldier_id] : @base_base_atk
@Xunzhang.each do |i|
next if i.nil?
n += Xunzhang_data::BASE_ATK[i]
end
n
end
end