加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 shiyatestzn 于 2013-9-20 15:00 编辑
module XAS_CT_SYSTEM # 初始设定的每个角色的CT。 # ACTOR_INITIAL_CT = {A=>[B,C]} # A = Actor ID # B = CT Max # C = CT speed ACTOR_INITIAL_CT = { 2=>[200,4] } end class Game_Actor < Game_Battler attr_accessor :ct attr_accessor :ct_max attr_accessor :ct_speed #---------------------------------------------------- # ● Setup Initial CT #---------------------------------------------------- def setup_initial_ct(actor_id) ct_par = XAS_CT_SYSTEM::ACTOR_INITIAL_CT[actor_id] if ct_par != nil @ct_max = ct_par[0] @ct_speed = ct_par[1] @ct = @ct_max end end
module XAS_CT_SYSTEM
# 初始设定的每个角色的CT。
# ACTOR_INITIAL_CT = {A=>[B,C]}
# A = Actor ID
# B = CT Max
# C = CT speed
ACTOR_INITIAL_CT = {
2=>[200,4]
}
end
class Game_Actor < Game_Battler
attr_accessor :ct
attr_accessor :ct_max
attr_accessor :ct_speed
#----------------------------------------------------
# ● Setup Initial CT
#----------------------------------------------------
def setup_initial_ct(actor_id)
ct_par = XAS_CT_SYSTEM::ACTOR_INITIAL_CT[actor_id]
if ct_par != nil
@ct_max = ct_par[0]
@ct_speed = ct_par[1]
@ct = @ct_max
end
end
1.求问临时变量ct_par = XAS_CT_SYSTEM::ACTOR_INITIAL_CT[actor_id] 这句话。意思是不是将ACTOR_INITIAL_CT所指哈希表所有内容
都带入到ct_par里? 临时变量ct_par所指是数组还是哈希表?
2.求问 ct_par[0] ct_par[1] 各代表什么?
|