local player_choice

function onTalk()
    disableMovement()
    if getFlag("destruction") then
        say("hungery_aeternox_statusbad")
        player_choice = choice("hungery_aeternox_yes","hungery_aeternox_no")
        if player_choice==1 then
            say("hungery_aeternox_confirmation")
            player_choice = choice("hungery_aeternox_yes","hungery_aeternox_no")
            if player_choice==1 then
                setFlag("completion")
                miniTextbox("hungery_aeternox_dead")
                wait(1)
                completeArea(false,true,true)
            end
        end
    else
        player_choice=1
        while player_choice~=3 do
            if player_choice==1 then
                say("hungery_aeternox_statusgood")
            else
                say("hungery_aeternox_noshutdown")
            end
            player_choice = choice("hungery_aeternox_diagnostics","hungery_aeternox_shutdown","hungery_aeternox_quit")
        end
    end
    enableMovement()
end

function onEnd(room,wasSkipped)
    if getFlag("completion") then
        completeArea(false,true,true)
    end
    enableMovement()
end