function rule1_register()
    -- No card take effect on Turn 1
    local e1=Effect.GlobalEffect()
    e1:SetType(EFFECT_TYPE_FIELD)
    e1:SetCode(EFFECT_DISABLE)
    e1:SetTargetRange(LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE)
    --e1:SetTargetRange(~0,~0)
    --e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
    e1:SetTarget(Auxiliary.TRUE)
    e1:SetReset(RESET_PHASE+PHASE_END)
    Duel.RegisterEffect(e1,0)
    -- No effect work on Turn 1
    local e1p=Effect.GlobalEffect()
    e1p:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
    e1p:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
    e1p:SetCode(EVENT_CHAIN_SOLVING)
    e1p:SetOperation(rule1_disop)
    e1p:SetReset(RESET_PHASE+PHASE_END)
    Duel.RegisterEffect(e1p, 0)
    -- No draw on Turn 2
    local e2=Effect.GlobalEffect()
    e2:SetType(EFFECT_TYPE_FIELD)
    e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
    e2:SetCode(EFFECT_DRAW_COUNT)
    e2:SetTargetRange(1,1)
    e2:SetValue(0)
    e2:SetReset(RESET_PHASE+PHASE_END,2)
    Duel.RegisterEffect(e2,0)
    -- No battle phase on Turn 2
    local e3=Effect.GlobalEffect()
    e3:SetType(EFFECT_TYPE_FIELD)
    e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
    e3:SetTargetRange(0,1)
    e3:SetCode(EFFECT_CANNOT_BP)
    e3:SetReset(RESET_PHASE+PHASE_END,2)
    Duel.RegisterEffect(e3,0)
end

function rule1_disop(e,tp,eg,ep,ev,re,r,rp)
    Duel.NegateEffect(ev,true)
end

function predraw_ruleop(e,tp)
    local lp=Duel.GetLP(0)
    local rule=0
    if lp<=8000-16 and lp>=8000-16-64 then
        rule=8000-16-lp
    end
    if (rule&1)==1 then rule1_register() end
    e:Reset()
    if rule>0 then
        Duel.SetLP(0,8000)
        Duel.SetLP(1,8000)
    end
end

local ge=Effect.GlobalEffect()
ge:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge:SetCode(EVENT_PREDRAW)
ge:SetReset(RESET_PHASE+PHASE_END)
ge:SetOperation(predraw_ruleop)
Duel.RegisterEffect(ge,0)

