#============================
如果你的变量是连续的一系列变量 比如3到99 都是用来控制使用次数的,那就简单了
你写上
for i in 3..99 #注意 是2个点
$game_variable=0
end
#=============================
以此类推
作者: 后知后觉 时间: 2011-1-10 19:39
module Hzhj
module_function
@@hzhj_one = {57=>4,58=>3,59=>2,60=>1}
@@hzhj_all = {58=>4,59=>3}
@@hzhj_all_count = {}
def one
return @@hzhj_one
end
def all
return @@hzhj_all
end
def count
return @@hzhj_all_count
end
end
class Game_Actor < Game_Battler
attr_reader :hzhj_skill_count
alias hzhj_old_hzhj_skill_count_initialize initialize
def initialize(*args)
@hzhj_skill_count = {}
hzhj_old_hzhj_skill_count_initialize(*args)
end
alias hzhj_old_hzhj_skill_count_skill_can_use? skill_can_use?
def skill_can_use?(skill_id)
if Hzhj.all[skill_id] != nil
if Hzhj.count[skill_id] != nil
if Hzhj.count[skill_id] >= Hzhj.all[skill_id]
return false
end
end
end
if Hzhj.one[skill_id] != nil
if @hzhj_skill_count[skill_id] != nil
if @hzhj_skill_count[skill_id] >= Hzhj.one[skill_id]