class Game_Party < Game_Unit
#--------------------------------------------------------------------------
# ● 获取我方实力浮动值
#--------------------------------------------------------------------------
def battle_times
times = 1
t_max = 1
t_min = 999999
for i in 0..6
if i != 5
members.each do |party|
t_max = [party.param(i),t_max].max
t_min = [party.param(i),t_min].min
end
times = [t_max*1.00/t_min*1.00,times].max
t_max = 1
t_min = 999999
end
end
return times
end
end
class Game_Enemy < Game_Battler
#--------------------------------------------------------------------------
# ● 浮动每个敌人的实力(每个敌人是有个浮动上限,需在注释添加内容)
#--------------------------------------------------------------------------
def float(times)
temp = 0
self.note.each_line do |line|
case line
when /\<(?:max_times)[ ]*(\d+)\>/i
val = $1.to_i/100.0
if(val<times)
temp = param(0).to_f*(val-1)
add_param(0,temp)
temp = param(1).to_f*(val-1)
add_param(1,temp)
temp = param(2).to_f*(val-1)
add_param(2,temp)
temp = param(3).to_f*(val-1)
add_param(3,temp)
temp = param(4).to_f*(val-1)
add_param(4,temp)
temp = param(6).to_f*(val-1)
add_param(6,temp)
@hp = (@hp*val).to_i
@mp = (@mp*val).to_i
else
temp = param(0).to_f*(times-1)
add_param(0,temp)
temp = param(1).to_f*(times-1)
add_param(1,temp)
temp = param(2).to_f*(times-1)
add_param(2,temp)
temp = param(3).to_f*(times-1)
add_param(3,temp)
temp = param(4).to_f*(times-1)
add_param(4,temp)
temp = param(6).to_f*(times-1)
add_param(6,temp)
end
@hp = param(0)
@mp = param(1)
msgbox(@hp)
end
end
end
end
class Game_Troop < Game_Unit
#--------------------------------------------------------------------------
# ● 浮动生命
#--------------------------------------------------------------------------
def float_param(times)
if times.to_i <= 0
return
end
members.each do |enemy|
enemy.float(times)
end
end
end