#include "kkj_11.h"

EvtScript N(EVS_ProvideDemoInputs) = {
    Call(DemoJoystickXY, -75, -44)
    Wait(41)
    Call(DemoJoystickXY, -74, -44)
    Wait(1)
    Call(DemoJoystickXY, -74, -42)
    Wait(1)
    Call(DemoJoystickXY, -74, -40)
    Wait(1)
    Call(DemoJoystickXY, -74, -39)
    Wait(1)
    Call(DemoJoystickXY, -75, -37)
    Wait(1)
    Call(DemoJoystickXY, -75, -35)
    Wait(2)
    Call(DemoJoystickXY, -75, -33)
    Wait(1)
    Call(DemoJoystickXY, -75, -32)
    Wait(1)
    Call(DemoJoystickXY, -76, -31)
    Wait(1)
    Call(DemoJoystickXY, -76, -30)
    Wait(1)
    Call(DemoJoystickXY, -76, -29)
    Wait(4)
    Call(DemoJoystickXY, -76, -28)
    Wait(1)
    Call(DemoJoystickXY, -78, -23)
    Wait(1)
    Call(DemoJoystickXY, -79, -15)
    Wait(1)
    Call(DemoJoystickXY, -81, -7)
    Wait(1)
    Call(DemoJoystickXY, -82, -2)
    Wait(5)
    Call(DemoJoystickXY, -82, 0)
    Wait(1)
    Call(DemoJoystickXY, -81, 2)
    Wait(1)
    Call(DemoJoystickXY, -80, 5)
    Wait(1)
    Call(DemoJoystickXY, -80, 7)
    Wait(1)
    Call(DemoJoystickXY, -79, 9)
    Wait(1)
    Call(DemoJoystickXY, -79, 12)
    Wait(1)
    Call(DemoJoystickXY, -78, 18)
    Wait(1)
    Call(DemoJoystickXY, -77, 21)
    Wait(12)
    Call(DemoJoystickXY, -76, 22)
    Wait(1)
    Call(DemoJoystickXY, -75, 27)
    Wait(1)
    Call(DemoJoystickXY, -74, 30)
    Wait(1)
    Call(DemoJoystickXY, -74, 31)
    Wait(2)
    Call(DemoJoystickXY, -73, 31)
    Wait(2)
    Call(DemoJoystickXY, -73, 33)
    Wait(1)
    Call(DemoJoystickXY, -73, 34)
    Wait(1)
    Call(DemoJoystickXY, -72, 36)
    Wait(1)
    Call(DemoJoystickXY, -71, 38)
    Wait(10)
    Call(DemoJoystickXY, -70, 38)
    Wait(1)
    Call(DemoJoystickXY, -32, 23)
    Wait(1)
    Call(DemoJoystickXY, -1, 0)
    Wait(5)
    Call(DemoJoystickXY, -1, -3)
    Wait(1)
    Call(DemoJoystickXY, 0, -27)
    Wait(1)
    Call(DemoJoystickXY, -1, -64)
    Wait(1)
    Call(DemoJoystickXY, -12, -81)
    Wait(1)
    Call(DemoJoystickXY, -14, -82)
    Wait(1)
    Call(DemoJoystickXY, -24, -81)
    Wait(1)
    Call(DemoJoystickXY, -32, -80)
    Wait(1)
    Call(DemoJoystickXY, -35, -79)
    Wait(1)
    Call(DemoJoystickXY, -43, -77)
    Wait(1)
    Call(DemoJoystickXY, -52, -75)
    Wait(1)
    Call(DemoJoystickXY, -60, -73)
    Wait(1)
    Call(DemoJoystickXY, -66, -72)
    Wait(5)
    Call(DemoJoystickXY, -67, -71)
    Wait(1)
    Call(DemoJoystickXY, -68, -63)
    Wait(1)
    Call(DemoJoystickXY, -71, -53)
    Wait(1)
    Call(DemoJoystickXY, -75, -32)
    Wait(1)
    Call(DemoJoystickXY, -79, -16)
    Wait(1)
    Call(DemoJoystickXY, -82, -2)
    Wait(1)
    Call(DemoJoystickXY, -82, 0)
    Wait(1)
    Call(DemoJoystickXY, -81, 1)
    Wait(1)
    Call(DemoJoystickXY, -81, 2)
    Wait(1)
    Call(DemoJoystickXY, -81, 3)
    Wait(2)
    Call(DemoJoystickXY, -80, 5)
    Wait(1)
    Call(DemoJoystickXY, -80, 7)
    Wait(1)
    Call(DemoJoystickXY, -79, 11)
    Wait(1)
    Call(DemoJoystickXY, -77, 20)
    Wait(1)
    Call(DemoJoystickXY, -73, 33)
    Wait(1)
    Call(DemoJoystickXY, -70, 48)
    Wait(1)
    Call(DemoJoystickXY, -65, 66)
    Wait(5)
    Call(DemoJoystickXY, -65, 67)
    Wait(28)
    Call(DemoJoystickXY, -65, 66)
    Wait(4)
    Call(DemoJoystickXY, -65, 65)
    Wait(1)
    Call(DemoJoystickXY, -60, 59)
    Wait(1)
    Call(DemoJoystickXY, -48, 49)
    Wait(1)
    Call(DemoJoystickXY, -29, 31)
    Wait(1)
    Call(DemoJoystickXY, -13, 15)
    Wait(1)
    Call(DemoJoystickXY, -1, 0)
    Wait(5)
    Call(DemoJoystickXY, 0, 0)
    Wait(1)
    Call(DemoJoystickXY, 2, 0)
    Wait(1)
    Call(DemoJoystickXY, 10, 1)
    Wait(2)
    Call(DemoJoystickXY, -1, 0)
    Wait(15)
    Call(DemoJoystickXY, -2, 9)
    Wait(1)
    Call(DemoJoystickXY, -19, 33)
    Wait(1)
    Call(DemoJoystickXY, -40, 67)
    Wait(1)
    Call(DemoJoystickXY, -44, 71)
    Wait(5)
    Call(DemoJoystickXY, -44, 72)
    Wait(1)
    Call(DemoJoystickXY, -44, 73)
    Wait(1)
    Call(DemoJoystickXY, -43, 73)
    Wait(1)
    Call(DemoJoystickXY, -43, 74)
    Wait(8)
    Call(DemoJoystickXY, -42, 74)
    Wait(1)
    Call(DemoJoystickXY, -41, 74)
    Wait(3)
    Call(DemoJoystickXY, -39, 75)
    Wait(1)
    Call(DemoJoystickXY, -36, 75)
    Wait(1)
    Call(DemoJoystickXY, -31, 76)
    Wait(51)
    Call(DemoJoystickXY, -29, 76)
    IfEq(GF_DemoSceneDone, TRUE)
        Return
    EndIf
    Set(GF_DemoSceneDone, TRUE)
    Call(GotoMapSpecial, Ref("kkj_11"), kkj_11_ENTRY_2, TRANSITION_END_DEMO_SCENE_BLACK)
    Wait(110)
    Return
    End
};

EvtScript N(EVS_MonitorDemoState) = {
    Wait(10)
    Loop(0)
        Call(GetDemoState, LVar0)
        IfEq(LVar0, DEMO_STATE_CHANGE_MAP)
            BreakLoop
        EndIf
        Wait(1)
    EndLoop
    IfEq(GF_DemoSceneDone, TRUE)
        Return
    EndIf
    Set(GF_DemoSceneDone, TRUE)
    Call(GotoMapSpecial, Ref("kkj_11"), kkj_11_ENTRY_2, TRANSITION_END_DEMO_SCENE_WHITE)
    Wait(100)
    Return
    End
};

EvtScript N(EVS_PlayDemoScene) = {
    Set(GF_DemoSceneDone, FALSE)
    Exec(N(EVS_MonitorDemoState))
    Exec(N(EVS_ProvideDemoInputs))
    Return
    End
};
