Comus_not_First_Introduction=false
A_SIDE12_CHECK_Unnamed2_Complished=false
RipanWinkle_First_Introduction_Triggered=false
function onTalk()
    --一些基础设置
    disableMovement()
    local dialog_choice=1
    --获取是否第一次与其对话
    Comus_not_First_Introduction=getFlag("Comus_not_First_Introduction")
    if Comus_not_First_Introduction==false then
        setFlag("Comus_not_First_Introduction",true)
        say("Comus_Introduction") 

    --如果不是第一次对话，则出现对话选择项
    else
        A_SIDE12_CHECK_Unnamed2_Complished=getFlag("A_SIDE12_CHECK_Unnamed2_Complished")
        RipanWinkle_First_Introduction_Triggered=getFlag("RipanWinkle_First_Introduction_Triggered")
        --如果前一个任务未完成，并且还没有遇到过RipanWinkle
        if A_SIDE12_CHECK_Unnamed2_Complished==false and  RipanWinkle_First_Introduction_Triggered==false then
            dialog_choice=choice("Comus_UI_1","Comus_UI_2","Comus_UI_3","Comus_UI_6")
            if dialog_choice==1 then
                say("Comus_Introduction")
            elseif dialog_choice==2 then
                say("Comus_Review_Tranquilla")
            elseif dialog_choice==3 then
                say("Comus_Review_Quakerish")
            end
        --如果前一个任务未完成，且已经遇到过RipanWinkle
        elseif A_SIDE12_CHECK_Unnamed2_Complished==false and RipanWinkle_First_Introduction_Triggered==true then
            dialog_choice=choice("Comus_UI_1","Comus_UI_2","Comus_UI_3","Comus_UI_4","Comus_UI_6")
            if dialog_choice==1 then
                say("Comus_Introduction")
            elseif dialog_choice==2 then
                say("Comus_Review_Tranquilla")
            elseif dialog_choice==3 then
                say("Comus_Review_Quakerish")
            elseif dialog_choice==4 then
                say("Comus_Review_RipanWinkle")
            end
        --如果前一个任务已完成，并且还没有遇到过RipanWinkle
        elseif A_SIDE12_CHECK_Unnamed2_Complished==true and RipanWinkle_First_Introduction_Triggered==false then
            dialog_choice=choice("Comus_UI_1","Comus_UI_2","Comus_UI_3","Comus_UI_5","Comus_UI_6")
            if dialog_choice==1 then
                say("Comus_Introduction")
            elseif dialog_choice==2 then
                say("Comus_Review_Tranquilla")
            elseif dialog_choice==3 then
                say("Comus_Review_Quakerish")
            elseif dialog_choice==4 then
                say("Comus_MiniGame_Intro")
                local mini_game_choice=choice("Comus_MiniGame_Answer_UI_1","Comus_MiniGame_Answer_UI_2")
                if mini_game_choice==1 then
                    say("Comus_MiniGame_Answer_1")
                else
                    say("Comus_MiniGame_Answer_2")
                    teleportTo(-562,-1001,"A_hidden_chanllenge2","WakeUp")
                    enableMovement()
                end
            end
        --如果前一个任务已完成，且已经遇到过RipanWinkle
        elseif A_SIDE12_CHECK_Unnamed2_Complished==true and RipanWinkle_First_Introduction_Triggered==true then
            dialog_choice=choice("Comus_UI_1","Comus_UI_2","Comus_UI_3","Comus_UI_4","Comus_UI_5","Comus_UI_6")
            if dialog_choice==1 then
                say("Comus_Introduction")
            elseif dialog_choice==2 then
                say("Comus_Review_Tranquilla")
            elseif dialog_choice==3 then
                say("Comus_Review_Quakerish")
            elseif dialog_choice==4 then
                say("Comus_Review_RipanWinkle")
            elseif dialog_choice==5 then
                say("Comus_MiniGame_Intro")
                local mini_game_choice=choice("Comus_MiniGame_Answer_UI_1","Comus_MiniGame_Answer_UI_2")
                if mini_game_choice==1 then
                    say("Comus_MiniGame_Answer_1")
                else
                    say("Comus_MiniGame_Answer_2")
                    teleportTo(-562,-1001,"A_hidden_chanllenge2","WakeUp")
                    enableMovement()
                end
            end
        end
    end

end

function onEnd()
    enableMovement()
end