# ● 判定防御属性
# state_id : 属性 ID
#--------------------------------------------------------------------------
def state_guard?(state_id)
for i in [@armor1_id, @armor2_id, @armor3_id, @armor4_id]
armor = $data_armors
if armor != nil
if armor.guard_state_set.include?(state_id)
return true
end
end
end
return false
end
好的,请教下那个for i in [@armor1_id, @armor2_id, @armor3_id, @armor4_id]
是神马意思呢?相当于for i in @armor1_id && for i in @armor2_id && for i in @armor3_id && for i in @armor3_id 吗?
for i in[@armor1_id, @armor2_id, @armor3_id, @armor4_id]
armor = $data_armors[i]
if armor != nil
if armor.guard_state_set.include?(state_id)
returntrue
end
end
end
returnfalse
end
def state_guard?(state_id)
for i in[@armor1_id, @armor2_id, @armor3_id, @armor4_id]
armor = $data_armors[i]
if armor != nil
if armor.guard_state_set.include?(state_id)
returntrue
end
end
end
returnfalse
end
那个for i in [@armor1_id, @armor2_id, @armor3_id, @armor4_id]
当然不是相当于for i in @armor1_id && for i in @armor2_id && for i in @armor3_id && for i in @armor3_id了
而是相当于