| 
 | 
 
 楼主 |
发表于 2018-11-23 00:33:55
|
显示全部楼层
 
 
 
locate=function() 
        locatee() 
        create_timer_s('loclWait',1,'locatecheck') 
end 
locatecheck=function() 
    locatee() 
end 
 
local_exit=function(n,l,w) 
        EnableTimer('loclWait',false) 
        print('第五') 
    local cnt 
        localget=1 
    exit.locl=exit_set(w[3]) 
    local l_set=exit.locl 
    if roomNodir[locl.where] then 
       l_set=del_element(l_set,roomNodir[locl.where]) 
    end 
    cnt=table.getn(l_set) 
    if cnt==0 or cnt==nil then 
       cnt=1 
    end 
    cnt=math.random(1,cnt) 
    locl.dir=l_set[cnt] 
    if locl.dir==nil then 
       locl.dir='east' 
    end 
    for _,p in pairs(exit.locl) do 
       locl.exit[p]=true 
    end 
        if locate_finish~=0 then 
            return _G[locate_finish]() 
        end 
end 
 
注:这里其实结合了我第一课里说的ticktime,还给了locate一个出口,就是: 
        if locate_finish~=0 then 
            return _G[locate_finish]() 
        end |   
 
 
 
 |