-static bool _skaterift_script_ch2s1( ent_script_event *event )
+static bool _skaterift_script_mtzero( ent_script_event *event )
{
-#if 0
- static const struct cs_subtitle EN[] =
- {
- { "j1", KCOL_JOHN "Eughhh boy" },
- { "j2", KCOL_JOHN "When we get off this thing I gotta go lay down for a bit" },
- { "j3", KCOL_JOHN "Oh look" },
- { "j4", KCOL_JOHN "There's Mike over there" },
- { "j5", KCOL_JOHN "HELLO MIKE!" },
- { "j7", KCOL_JOHN "Yeah listen.." },
- { "j8", KCOL_JOHN "I know things are a bit weird at the moment" },
- { "j9", KCOL_JOHN "but it'l make sense soon" },
- { "j10", KCOL_JOHN "I garuntee it" },
- { "j11", KCOL_JOHN "50%% probably garuntee it" },
- { "j12", KCOL_JOHN "I need you to go on, keep on setting some time trials here" },
- { "j13", KCOL_JOHN "We're gonna need your speed later" },
- { "j14", KCOL_JOHN "Its.. Why I picked you." },
- { NULL, NULL },
- };
- static const struct generic_cutscene cutscene =
- {
- .metascene_path = "metascenes/ch2s1.ms",
- .freeze_player = 1,
- .subtitles = EN,
- };
- generic_cutscene_wrapper( &cutscene, event );
-
+ /* intro movie */
if( on_nugget_once( event, "ch2s1_view" ) )
{
- play_generic_cutscene( event );
+ static const struct cs_subtitle EN[] =
+ {
+ { "j1", KCOL_JOHN "Eughhh boy" },
+ { "j2", KCOL_JOHN "When we get off this thing I gotta go lay down for a bit" },
+ { "j3", KCOL_JOHN "Oh look" },
+ { "j4", KCOL_JOHN "There's Mike over there" },
+ { "j5", KCOL_JOHN "HELLO MIKE!" },
+ { "j7", KCOL_JOHN "Yeah listen.." },
+ { "j8", KCOL_JOHN "I know things are a bit weird at the moment" },
+ { "j9", KCOL_JOHN "but it'l make sense soon" },
+ { "j10", KCOL_JOHN "I garuntee it" },
+ { "j11", KCOL_JOHN "50%% probably garuntee it" },
+ { "j12", KCOL_JOHN "I need you to go on, keep on setting some time trials here" },
+ { "j13", KCOL_JOHN "We're gonna need your speed later" },
+ { "j14", KCOL_JOHN "Its.. Why I picked you." },
+ { NULL, NULL },
+ };
+ _cutscene_load_and_play( "metascenes/ch1s2.ms", EN, 1 );
+ }
+
+ /* requirements for battery jump */
+ if( on_completion_changed( event ) )
+ {
+ bool requirements_met = 1;
+ struct ent_list_iter iter;
+ _ent_list_iter_start( &iter, _ent_list_get_aliased( "battery_requirements" ), k_ent_route );
+ while( _ent_list_iter( &iter ) )
+ {
+ ent_route *route = af_arritm( &_world.main.ent_route, iter.index );
+ if( !(route->flags & (k_ent_route_flag_achieve_gold|k_ent_route_flag_achieve_silver)) )
+ {
+ requirements_met = 0;
+ break;
+ }
+ }
+
+ if( requirements_met )
+ if( _skaterift_script_nugget_status( "ch2s3_view" ) == 0 )
+ _skaterift_script_nugget_set( "ch2s3_view", 2 );
}
-#endif
+
return 1;
}
-static bool _skaterift_script_ch2s2( ent_script_event *event )
+static bool _skaterift_script_mtzero_after( ent_script_event *event )
{
-#if 0
- static const struct cs_subtitle EN[] =
- {
- { "m1", KCOL_MIKE "Haha!" },
- { "m2", KCOL_MIKE "Usually you don't put up with JC's nonsense.." },
- { "m3", KCOL_MIKE "He's been banging on about how we need to set some kind of speed record" },
- { "m4", KCOL_MIKE "For his.. \"Experiment\"" },
- { "m5", KCOL_MIKE "To be honest..." },
- { "m6", KCOL_MIKE "I'm just pretending to go along with it at this point.." },
- { "m7", KCOL_MIKE "I don't want to loose my internship at the wood place.." },
- { "m7b", KCOL_MIKE "He is my boss after all" },
- { "m9", KCOL_MIKE "Anyway uh, speaking of" },
- { "m10", KCOL_MIKE "I gotta go take care of yet another catastrophe he's created back there." },
- { "m11", KCOL_MIKE "I won't go into it." },
- { "m12", KCOL_MIKE "But umm" },
- { "m13", KCOL_MIKE "Good to see you back again" },
- { "m14", KCOL_MIKE "Later." },
-
- { NULL, NULL },
- };
- static const struct generic_cutscene cutscene =
- {
- .metascene_path = "metascenes/ch2s2.ms",
- .freeze_player = 1,
- .subtitles = EN,
- };
- optional_video_wrapper( &cutscene, "ch2s2_view", 0, event );
-#endif
return 1;
}
-static bool _skaterift_script_first_mtzero( ent_script_event *event )
+static bool _skaterift_script_ch2s2( ent_script_event *event )
{
-#if 0
- if( on_function_trigger( event, 6 ) )
+ if( on_function_trigger( event, 0 ) )
{
- u64 status = _skaterift_script_nugget_status( "ch2s3_view" );
- if( status == 0 )
+ if( on_nugget_once( event, "ch2s2_view" ) )
{
- _skaterift_script_nugget_set( "ch2s3_view", 2 );
+ static const struct cs_subtitle EN[] =
+ {
+ { "m1", KCOL_MIKE "Haha!" },
+ { "m2", KCOL_MIKE "Usually you don't put up with JC's nonsense.." },
+ { "m3", KCOL_MIKE "He's been banging on about how we need to set some kind of speed record" },
+ { "m4", KCOL_MIKE "For his.. \"Experiment\"" },
+ { "m5", KCOL_MIKE "To be honest..." },
+ { "m6", KCOL_MIKE "I'm just pretending to go along with it at this point.." },
+ { "m7", KCOL_MIKE "I don't want to loose my internship at the wood place.." },
+ { "m7b", KCOL_MIKE "He is my boss after all" },
+ { "m9", KCOL_MIKE "Anyway uh, speaking of" },
+ { "m10", KCOL_MIKE "I gotta go take care of yet another catastrophe he's created back there." },
+ { "m11", KCOL_MIKE "I won't go into it." },
+ { "m12", KCOL_MIKE "But umm" },
+ { "m13", KCOL_MIKE "Good to see you back again" },
+ { "m14", KCOL_MIKE "Later." },
+ { NULL, NULL },
+ };
+ _cutscene_load_and_play( "metascenes/ch2s2.ms", EN, 1 );
}
}
-#endif
+ u64 status;
+ if( on_nugget_changed( event, "ch2s2_view", &status ) )
+ _ent_list_set_visible( event->entity_list, status == 0 );
return 1;
}
static bool _skaterift_script_ch2s3( ent_script_event *event )
{
-#if 0
- static const struct cs_subtitle EN[] =
- {
- { "m1", KCOL_MIKE "Holy! You actually bothered to do these?" },
- { "m2", KCOL_MIKE "I mean.." },
- { "m3", KCOL_MIKE "JC's gonna be over the moon obviously, but" },
- { "m4", KCOL_MIKE "Why?" },
- { "m5", KCOL_MIKE "Don't you think its.. pointless?" },
- { "m6", KCOL_MIKE "Myeah I'm heading back to the shop" },
- { "m7", KCOL_MIKE "Coming?" },
- { "m8", KCOL_MIKE "Ohh man.." },
- { "m9", KCOL_MIKE "What a **** racket" },
- { "m10", KCOL_MIKE "It's 8pm even." },
- { "j1", KCOL_JOHN "You guys can't be walking in and scaring me like that" },
- { "m11", KCOL_MIKE "John, " },
- { "m12", KCOL_MIKE "Whats that?" },
- { "j2", KCOL_JOHN "uhhh just uh just uhh" },
- { "j3", KCOL_JOHN "just cleaning something up for a client" },
- { "m13", KCOL_MIKE "A 20ft tall quaterpipe" },
- { "m14", KCOL_MIKE "for a client.." },
- { "m15", KCOL_MIKE "on an island full of pensioners?" },
- { "j4", KCOL_JOHN "Yeah why not?" },
- { "j5", KCOL_JOHN "Skating's taking off right now!" },
- { "m16", KCOL_MIKE "Come on mate.." },
- { "j6", KCOL_JOHN "Aight look.." },
- { "j7", KCOL_JOHN "I'm just skimming little bits from the surplus" },
- { "j8", KCOL_JOHN "I got this plan right." },
- { "j9", KCOL_JOHN "It's gonna be BIG" },
- { "j10", KCOL_JOHN "People from all over the world are gonna come to see it." },
- { "j11", KCOL_JOHN "You know how like uh..." },
- { "j12", KCOL_JOHN "You know how no one visits the west island?" },
- { "m17", KCOL_MIKE "Well.. yeah?" },
- { "j13", KCOL_JOHN "Behold!" },
- { "j14", KCOL_JOHN "Mango mega island!" },
- { "j15", KCOL_JOHN "A skaters dream.." },
- { "m18", KCOL_MIKE "Ohhh yeah john" },
- { "m19", KCOL_MIKE "Looks great!" },
- { "m20", KCOL_MIKE "And whos gonna build this.." },
- { "m21", KCOL_MIKE "gigantic skate thing then..?" },
- { "j16", KCOL_JOHN "Well uhhh" },
- { "j17", KCOL_JOHN "Thats where I need your guys help." },
- { "m22", KCOL_MIKE "What are we gonna help with exactly?" },
- { "m23", KCOL_MIKE "You always do this John." },
- { "m24", KCOL_MIKE "Have some grand idea and suddenly everyones onboard with it." },
- { "j18", KCOL_JOHN "Whens the last time I asked you for anything?" },
- { "m25", KCOL_MIKE "Yesterday.." },
- { "j19", KCOL_JOHN "Oh..." },
- { "j20", KCOL_JOHN "Yeah, anyway" },
- { "j21", KCOL_JOHN "All I need is for you guys to finish the time trials" },
- { "j22", KCOL_JOHN "Go work on those, and come back when you've got it." },
- { "m26", KCOL_MIKE "Yeah well I got news for you!" },
- { "m27", KCOL_MIKE "Bird here has smashed all of them already." },
- { "j23", KCOL_JOHN "wait what?" },
- { "j24", KCOL_JOHN "You did!?" },
- { "j25", KCOL_JOHN "really???" },
- { "j26", KCOL_JOHN "Holy I knew you were good!" },
- { "m28", KCOL_MIKE "Yeah but uhh.." },
- { "m29", KCOL_MIKE "What exactly does this have to do with building a world record size skatepark island?" },
- { "j27", KCOL_JOHN "You see.." },
- { "j28", KCOL_JOHN "It was the missing component. It was speed." },
- { "j29", KCOL_JOHN "It's all we needed, to build a time net" },
- { "j30", KCOL_JOHN "Large enough to create infinite energy." },
- { "m30", KCOL_MIKE "Infinite.. energy..?" },
- { "j31", KCOL_JOHN "Yeah! You know to uh contact Allen and Alvin." },
- { "j32", KCOL_JOHN "They're the ones who are gonna help us with this whole thing." },
- { "m31", KCOL_MIKE "Them! Ahhh no man" },
- { "m32", KCOL_MIKE "not the aliens again.." },
- { "m33", KCOL_MIKE "the tiny little dudes you saw in a drug induced coma" },
- { "m34", KCOL_MIKE "are gonna help us build a megapark, on an abandoned island" },
- { "m35", KCOL_MIKE "I dont even know why I asked.." },
- { "m36", KCOL_MIKE "I'm clocking out. See you later." },
- { "j33", KCOL_JOHN "Look..." },
- { "j34", KCOL_JOHN "I'm not crazy, I promise. Just trust me." },
- { "j35", KCOL_JOHN "Lemme prove it." },
- { "j36", KCOL_JOHN "Bring this with you, hold onto it." },
- { "j37", KCOL_JOHN "Skate those trails as fast as you can with it on you." },
- { "j38", KCOL_JOHN "You'll understand when it happens," },
- { "j39", KCOL_JOHN "And you'll see what I mean by that" },
- { "j40", KCOL_JOHN "You'll just see it.. and" },
- { "j41", KCOL_JOHN "If anyone asks, you didn't get this from me." },
- { "j42", KCOL_JOHN "But I'll be there, I'll be watching, just get on with it." },
- { NULL, NULL },
- };
- static const struct generic_cutscene cutscene =
- {
- .metascene_path = "metascenes/ch2s3a.ms",
- .freeze_player = 1,
- .subtitles = EN,
- };
- optional_video_wrapper( &cutscene, "ch2s3_view", 2, event );
-
- /* TODO: Unlocking the blocker thing here, for the final challenge */
-#endif
- return 1;
-}
-
-static bool _skaterift_script_ch2s4( ent_script_event *event )
-{
-#if 0
- static const struct cs_subtitle EN[] =
- {
- { "j1", KCOL_JOHN "Oh my god.." },
- { "j2", KCOL_JOHN "You **** did it now" },
- { "j3", KCOL_JOHN "I told you I am not crazy!" },
- { "j4", KCOL_JOHN "You've done me a real solid mate." },
- { "j5", KCOL_JOHN "When I switch this thing on" },
- { "j6", KCOL_JOHN "It's gonna broadcast our location to them.." },
- { "j7", KCOL_JOHN "We have just enough power. Thanks to you my friend" },
- { "j8", KCOL_JOHN "Okayyy any second" },
- { "j9", KCOL_JOHN "BOSH" },
- { "j10", KCOL_JOHN "HELLO MY FRIENDS" },
- { "j11", KCOL_JOHN "WE NEED HELP" },
- { "j12", KCOL_JOHN "THIS IS CAPTAIN JOHN COCROACH" },
- { "j13", KCOL_JOHN "PLEASE COME AS SOON AS YOU CAN TO MT.ZERO ISLAND" },
- { "j14", KCOL_JOHN "Our coordinates are...." },
- { NULL, NULL },
- };
- static const struct generic_cutscene cutscene =
+ if( on_function_trigger( event, 0 ) )
{
- .metascene_path = "metascenes/ch2s4.ms",
- .freeze_player = 1,
- .subtitles = EN,
- };
- optional_video_wrapper( &cutscene, "ch2s4_view", 2, event );
-#endif
+ if( on_nugget_once( event, "ch2s3_view" ) )
+ {
+ static const struct cs_subtitle EN[] =
+ {
+ { "m1", KCOL_MIKE "Holy! You actually bothered to do these?" },
+ { "m2", KCOL_MIKE "I mean.." },
+ { "m3", KCOL_MIKE "JC's gonna be over the moon obviously, but" },
+ { "m4", KCOL_MIKE "Why?" },
+ { "m5", KCOL_MIKE "Don't you think its.. pointless?" },
+ { "m6", KCOL_MIKE "Myeah I'm heading back to the shop" },
+ { "m7", KCOL_MIKE "Coming?" },
+ { "m8", KCOL_MIKE "Ohh man.." },
+ { "m9", KCOL_MIKE "What a **** racket" },
+ { "m10", KCOL_MIKE "It's 8pm even." },
+ { "j1", KCOL_JOHN "You guys can't be walking in and scaring me like that" },
+ { "m11", KCOL_MIKE "John, " },
+ { "m12", KCOL_MIKE "Whats that?" },
+ { "j2", KCOL_JOHN "uhhh just uh just uhh" },
+ { "j3", KCOL_JOHN "just cleaning something up for a client" },
+ { "m13", KCOL_MIKE "A 20ft tall quaterpipe" },
+ { "m14", KCOL_MIKE "for a client.." },
+ { "m15", KCOL_MIKE "on an island full of pensioners?" },
+ { "j4", KCOL_JOHN "Yeah why not?" },
+ { "j5", KCOL_JOHN "Skating's taking off right now!" },
+ { "m16", KCOL_MIKE "Come on mate.." },
+ { "j6", KCOL_JOHN "Aight look.." },
+ { "j7", KCOL_JOHN "I'm just skimming little bits from the surplus" },
+ { "j8", KCOL_JOHN "I got this plan right." },
+ { "j9", KCOL_JOHN "It's gonna be BIG" },
+ { "j10", KCOL_JOHN "People from all over the world are gonna come to see it." },
+ { "j11", KCOL_JOHN "You know how like uh..." },
+ { "j12", KCOL_JOHN "You know how no one visits the west island?" },
+ { "m17", KCOL_MIKE "Well.. yeah?" },
+ { "j13", KCOL_JOHN "Behold!" },
+ { "j14", KCOL_JOHN "Mango mega island!" },
+ { "j15", KCOL_JOHN "A skaters dream.." },
+ { "m18", KCOL_MIKE "Ohhh yeah john" },
+ { "m19", KCOL_MIKE "Looks great!" },
+ { "m20", KCOL_MIKE "And whos gonna build this.." },
+ { "m21", KCOL_MIKE "gigantic skate thing then..?" },
+ { "j16", KCOL_JOHN "Well uhhh" },
+ { "j17", KCOL_JOHN "Thats where I need your guys help." },
+ { "m22", KCOL_MIKE "What are we gonna help with exactly?" },
+ { "m23", KCOL_MIKE "You always do this John." },
+ { "m24", KCOL_MIKE "Have some grand idea and suddenly everyones onboard with it." },
+ { "j18", KCOL_JOHN "Whens the last time I asked you for anything?" },
+ { "m25", KCOL_MIKE "Yesterday.." },
+ { "j19", KCOL_JOHN "Oh..." },
+ { "j20", KCOL_JOHN "Yeah, anyway" },
+ { "j21", KCOL_JOHN "All I need is for you guys to finish the time trials" },
+ { "j22", KCOL_JOHN "Go work on those, and come back when you've got it." },
+ { "m26", KCOL_MIKE "Yeah well I got news for you!" },
+ { "m27", KCOL_MIKE "Bird here has smashed all of them already." },
+ { "j23", KCOL_JOHN "wait what?" },
+ { "j24", KCOL_JOHN "You did!?" },
+ { "j25", KCOL_JOHN "really???" },
+ { "j26", KCOL_JOHN "Holy I knew you were good!" },
+ { "m28", KCOL_MIKE "Yeah but uhh.." },
+ { "m29", KCOL_MIKE "What exactly does this have to do with building a world record size skatepark island?" },
+ { "j27", KCOL_JOHN "You see.." },
+ { "j28", KCOL_JOHN "It was the missing component. It was speed." },
+ { "j29", KCOL_JOHN "It's all we needed, to build a time net" },
+ { "j30", KCOL_JOHN "Large enough to create infinite energy." },
+ { "m30", KCOL_MIKE "Infinite.. energy..?" },
+ { "j31", KCOL_JOHN "Yeah! You know to uh contact Allen and Alvin." },
+ { "j32", KCOL_JOHN "They're the ones who are gonna help us with this whole thing." },
+ { "m31", KCOL_MIKE "Them! Ahhh no man" },
+ { "m32", KCOL_MIKE "not the aliens again.." },
+ { "m33", KCOL_MIKE "the tiny little dudes you saw in a drug induced coma" },
+ { "m34", KCOL_MIKE "are gonna help us build a megapark, on an abandoned island" },
+ { "m35", KCOL_MIKE "I dont even know why I asked.." },
+ { "m36", KCOL_MIKE "I'm clocking out. See you later." },
+ { "j33", KCOL_JOHN "Look..." },
+ { "j34", KCOL_JOHN "I'm not crazy, I promise. Just trust me." },
+ { "j35", KCOL_JOHN "Lemme prove it." },
+ { "j36", KCOL_JOHN "Bring this with you, hold onto it." },
+ { "j37", KCOL_JOHN "Skate those trails as fast as you can with it on you." },
+ { "j38", KCOL_JOHN "You'll understand when it happens," },
+ { "j39", KCOL_JOHN "And you'll see what I mean by that" },
+ { "j40", KCOL_JOHN "You'll just see it.. and" },
+ { "j41", KCOL_JOHN "If anyone asks, you didn't get this from me." },
+ { "j42", KCOL_JOHN "But I'll be there, I'll be watching, just get on with it." },
+ { NULL, NULL },
+ };
+ _cutscene_load_and_play( "metascenes/ch2s3a.ms", EN, 1 );
+ }
+ }
+ u64 status;
+ if( on_nugget_changed( event, "ch2s3_view", &status ) )
+ _ent_list_set_visible( event->entity_list, status == 2 );
return 1;
}
static bool _skaterift_script_ch2s5_before( ent_script_event *event )
{
-#if 0
u64 status;
if( on_nugget_changed( event, "ch2s5_view", &status ) )
- {
- bool visible = 0;
-
- if( status == 2 )
- visible = 1;
-
- ent_list_set_visible( event->world, event->entity_list, visible );
- }
+ _ent_list_set_visible( event->entity_list, status == 2 );
if( on_function_trigger( event, 0 ) )
{
_skaterift_script_nugget_set( "ch2s5_view", 3 );
skaterift_load_world_command( 1, (const char *[]){ "reload" } );
}
-#endif
return 1;
}
static bool _skaterift_script_ch2s5_after( ent_script_event *event )
{
-#if 0
- static const struct cs_subtitle EN[] =
- {
- { "m1", KCOL_MIKE "Hi mate, hows it goin?" },
- { "m2", KCOL_MIKE "Yeah yeah.. I get you.. um." },
- { "m3", KCOL_MIKE "I genuinely have no idea where he found that cell thing" },
- { "m4", KCOL_MIKE "I reckon it came of some kind of secret government tech or whatever" },
- { "m5", KCOL_MIKE "but.." },
- { "m6", KCOL_MIKE "Now you know what he was doing with all those stupid poles he put up across the island" },
- { "m7", KCOL_MIKE "I'm starting to think I might be going crazy but.." },
- { "m8", KCOL_MIKE "Did you see the whole west side has actually been taken over?" },
- { "m9", KCOL_MIKE "Just like JC was saying.." },
- { "m10", KCOL_MIKE "Are you telling me the aliens are actually real?" },
- { NULL, NULL },
- };
- static const struct generic_cutscene cutscene =
- {
- .metascene_path = "metascenes/ch2s5.ms",
- .freeze_player = 1,
- .subtitles = EN,
- };
-
- enum generic_cutscene_event cs_event = generic_cutscene_wrapper( &cutscene, event );
-
u64 status;
if( on_nugget_changed( event, "ch2s5_view", &status ) )
{
if( status == 3 )
{
_skaterift_script_nugget_set( "ch2s5_view", 1 );
- play_generic_cutscene( event );
+ static const struct cs_subtitle EN[] =
+ {
+ { "m1", KCOL_MIKE "Hi mate, hows it goin?" },
+ { "m2", KCOL_MIKE "Yeah yeah.. I get you.. um." },
+ { "m3", KCOL_MIKE "I genuinely have no idea where he found that cell thing" },
+ { "m4", KCOL_MIKE "I reckon it came of some kind of secret government tech or whatever" },
+ { "m5", KCOL_MIKE "but.." },
+ { "m6", KCOL_MIKE "Now you know what he was doing with all those stupid poles he put up across the island" },
+ { "m7", KCOL_MIKE "I'm starting to think I might be going crazy but.." },
+ { "m8", KCOL_MIKE "Did you see the whole west side has actually been taken over?" },
+ { "m9", KCOL_MIKE "Just like JC was saying.." },
+ { "m10", KCOL_MIKE "Are you telling me the aliens are actually real?" },
+ { NULL, NULL },
+ };
+ _cutscene_load_and_play( "metascenes/ch2s5.ms", EN, 1 );
}
}
-#endif
return 1;
}
+struct script_ch2s6_waiter
+{
+ bool go;
+};
+
static bool _skaterift_script_ch2s6( ent_script_event *event )
{
-#if 0
- static const struct cs_subtitle EN[] =
- {
- { "j1", KCOL_JOHN "Ello guys" },
- { "j2", KCOL_JOHN "Bout time you showed up" },
- { "j3", KCOL_JOHN "Look who I've got here!" },
- { "m1", KCOL_MIKE "Uhhhhhhhhhhhhhhhhhhhhhhhhhhh" },
- { "m2", KCOL_MIKE "Right then." },
- { "m3", KCOL_MIKE "I almost feel bad for these guys" },
- { "m4", KCOL_MIKE "Couldve' been any scientist across the planet" },
- { "m5", KCOL_MIKE "you know actually smart people" },
- { "m6", KCOL_MIKE "but no.." },
- { "m7", KCOL_MIKE "JC somehow contacts them first" },
- { "j4", KCOL_JOHN "Heyyy man." },
- { "j5", KCOL_JOHN "This required a special kind of science" },
- { "j6", KCOL_JOHN "The kinda stuff the world isn't quite ready for yet." },
- { "j7", KCOL_JOHN "But if you're done insulting me.." },
- { "j8", KCOL_JOHN "We're off to the states for a bit." },
- { "j9", KCOL_JOHN "Fancy a road trip?" },
- { NULL, NULL },
- };
- static const struct generic_cutscene cutscene =
+ if( event->type == k_escript_event_allocate )
{
- .metascene_path = "metascenes/ch2s6.ms",
- .freeze_player = 1,
- .subtitles = EN,
- };
- enum generic_cutscene_event cs_event = optional_video_wrapper( &cutscene, "ch2s6_view", 2, event );
+ struct script_event_allocate *event_info = event->info;
+ struct script_ch2s6_waiter *waiter = vg_linear_alloc( event_info->heap, sizeof(struct script_ch2s6_waiter) );
+ waiter->go = 0;
+ event_info->userdata = waiter;
+ return 1;
+ }
+ struct script_ch2s6_waiter *waiter = event->userdata;
+
+ u64 status;
+ if( on_nugget_changed( event, "ch2s6_view", &status ) )
+ _ent_list_set_visible( event->entity_list, status == 2 );
- if( cs_event == k_generic_cutscene_event_end )
+ // TODO: THERE ARE NO UNLOCK CONDITIONS FOR THIS YET!
+
+ if( on_function_trigger( event, 0 ) )
+ {
+ if( on_nugget_once( event, "ch2s6_view" ) )
+ {
+ _skaterift_script_nugget_set( "unlock_city", 1 );
+ _skaterift_script_nugget_set( "ch2s6_view", 1 );
+ static const struct cs_subtitle EN[] =
+ {
+ { "j1", KCOL_JOHN "Ello guys" },
+ { "j2", KCOL_JOHN "Bout time you showed up" },
+ { "j3", KCOL_JOHN "Look who I've got here!" },
+ { "m1", KCOL_MIKE "Uhhhhhhhhhhhhhhhhhhhhhhhhhhh" },
+ { "m2", KCOL_MIKE "Right then." },
+ { "m3", KCOL_MIKE "I almost feel bad for these guys" },
+ { "m4", KCOL_MIKE "Couldve' been any scientist across the planet" },
+ { "m5", KCOL_MIKE "you know actually smart people" },
+ { "m6", KCOL_MIKE "but no.." },
+ { "m7", KCOL_MIKE "JC somehow contacts them first" },
+ { "j4", KCOL_JOHN "Heyyy man." },
+ { "j5", KCOL_JOHN "This required a special kind of science" },
+ { "j6", KCOL_JOHN "The kinda stuff the world isn't quite ready for yet." },
+ { "j7", KCOL_JOHN "But if you're done insulting me.." },
+ { "j8", KCOL_JOHN "We're off to the states for a bit." },
+ { "j9", KCOL_JOHN "Fancy a road trip?" },
+ { NULL, NULL },
+ };
+ _cutscene_load_and_play( "metascenes/ch2s6.ms", EN, 1 );
+ }
+ }
+ if( event->type == k_escript_event_update )
{
- _skaterift_script_nugget_set( "unlock_city", 1 );
- skaterift_load_world_command( 1, (const char *[]){ "sr002-local-mp_spawn" } );
+ if( waiter->go )
+ {
+ waiter->go = 0;
+ if( _cutscene.state == k_cutscene_state_none )
+ {
+ skaterift_load_world_command( 1, (const char *[]){ "sr002-local-dev_hub" } );
+ }
+ }
}
-#endif
return 1;
}
static bool _skaterift_script_ch2e1( ent_script_event *event )
{
-#if 0
- static const struct cs_subtitle EN[] =
- {
- { "j1", KCOL_JOHN "Hey bird I'm just working on some boards here." },
- { "j2", KCOL_JOHN "If you wanna give me a graphic," },
- { "j3", KCOL_JOHN "I'll print it onto this plywood and press it" },
- { "j4", KCOL_JOHN "Mike'l griptape it and seal it" },
- { "j5", KCOL_JOHN "Ready to sell and skate!" },
- { NULL, NULL },
- };
- static const struct generic_cutscene cutscene =
+ if( on_function_trigger( event, 0 ) )
{
- .metascene_path = "metascenes/ch2e1.ms",
- .freeze_player = 1,
- .subtitles = EN,
- };
- enum generic_cutscene_event cs_event = optional_video_wrapper( &cutscene, "ch2e1_view", 2, event );
-
- if( cs_event == k_generic_cutscene_event_start )
- _skaterift_script_nugget_set( "board_maker_unlock", 1 );
-#endif
+ if( on_nugget_once( event, "ch2e1_view" ) )
+ {
+ _skaterift_script_nugget_set( "board_maker_unlock", 1 );
+ static const struct cs_subtitle EN[] =
+ {
+ { "j1", KCOL_JOHN "Hey bird I'm just working on some boards here." },
+ { "j2", KCOL_JOHN "If you wanna give me a graphic," },
+ { "j3", KCOL_JOHN "I'll print it onto this plywood and press it" },
+ { "j4", KCOL_JOHN "Mike'l griptape it and seal it" },
+ { "j5", KCOL_JOHN "Ready to sell and skate!" },
+ { NULL, NULL },
+ };
+ _cutscene_load_and_play( "metascenes/ch2e1.ms", EN, 1 );
+ }
+ }
+ u64 status;
+ if( on_nugget_changed( event, "ch2e1_view", &status ) )
+ _ent_list_set_visible( event->entity_list, status == 2 );
return 1;
}
+struct script_ch2s4_waiter
+{
+ bool go;
+ f32 timer;
+ ent_list *break_list;
+};
+
static bool _skaterift_script_battery_jump( ent_script_event *event )
{
-#if 0
- static const struct cs_subtitle EN[] = {
- { NULL, NULL },
- };
- static const struct generic_cutscene cutscene =
+ if( event->type == k_escript_event_allocate )
{
- .metascene_path = "metascenes/battery_intro.ms",
- .freeze_player = 1,
- .subtitles = EN,
- };
- challenge_video_wrapper( &cutscene, "battery_jump_view", event );
+ struct script_event_allocate *event_info = event->info;
+ struct script_ch2s4_waiter *waiter = vg_linear_alloc( event_info->heap, sizeof(struct script_ch2s4_waiter) );
+ waiter->go = 0;
+ waiter->timer = 0.0f;
+ waiter->break_list = NULL;
+ event_info->userdata = waiter;
+ return 1;
+ }
+ struct script_ch2s4_waiter *waiter = event->userdata;
+ if( on_cutscene_marker( event, "$break" ) )
+ _explode_template_boom( waiter->break_list );
- if( on_function_trigger( event, 7 ) )
+ if( on_function_trigger( event, 2 ) )
{
- // TODO
- vg_error( "WHY????????????\n" );
+ if( on_nugget_once( event, "ch2s4_view" ) )
+ {
+ _skaterift_script_nugget_set( "ch2s5_view", 2 );
+ waiter->go = 1;
+ }
}
- if( on_cutscene_marker( event, "$break" ) )
+ /* viewed ch2s3 means we allowing this challenge now */
+ u64 status;
+ if( on_nugget_changed( event, "ch2s3_view", &status ) )
+ _ent_list_set_visible( event->entity_list, status == 1 );
+
+ if( event->type == k_escript_event_update )
{
- _explode_template_boom( event );
+ if( waiter->go )
+ {
+ waiter->timer += vg.time_frame_delta;
+ if( waiter->timer > 2.0f )
+ {
+ waiter->go = 0;
+ static const struct cs_subtitle EN[] =
+ {
+ { "j1", KCOL_JOHN "Oh my god.." },
+ { "j2", KCOL_JOHN "You **** did it now" },
+ { "j3", KCOL_JOHN "I told you I am not crazy!" },
+ { "j4", KCOL_JOHN "You've done me a real solid mate." },
+ { "j5", KCOL_JOHN "When I switch this thing on" },
+ { "j6", KCOL_JOHN "It's gonna broadcast our location to them.." },
+ { "j7", KCOL_JOHN "We have just enough power. Thanks to you my friend" },
+ { "j8", KCOL_JOHN "Okayyy any second" },
+ { "j9", KCOL_JOHN "BOSH" },
+ { "j10", KCOL_JOHN "HELLO MY FRIENDS" },
+ { "j11", KCOL_JOHN "WE NEED HELP" },
+ { "j12", KCOL_JOHN "THIS IS CAPTAIN JOHN COCROACH" },
+ { "j13", KCOL_JOHN "PLEASE COME AS SOON AS YOU CAN TO MT.ZERO ISLAND" },
+ { "j14", KCOL_JOHN "Our coordinates are...." },
+ { NULL, NULL },
+ };
+ _cutscene_load_and_play( "metascenes/ch2s4.ms", EN, 1 );
+ }
+ }
}
- if( event->type == k_escript_event_world_start )
+ if( on_function_trigger( event, 0 ) )
{
- u32 status = _skaterift_script_nugget_status( "battery_jump_view" );
+ if( on_nugget_once( event, "battery_jump_view" ) )
+ {
+ _cutscene_load_and_play( "metascenes/battery_intro.ms", NULL, 1 );
+ waiter->break_list = _ent_list_get_aliased( "battery:locked" );
+ }
+ }
- if( status == 1 )
- ent_list_set_visible( event->world, event->entity_list, 0 );
+ if( event->type == k_escript_event_world_start )
+ {
+ _ent_list_set_visible( _ent_list_get_aliased( "battery:locked" ),
+ _skaterift_script_nugget_status( "battery_jump_view" ) == 0 );
}
-#endif
+
return 1;
}
for( u32 j=0; j<af_arrcount(&world->ent_audio); j++ )
{
ent_audio *audio = af_arritm( &world->ent_audio, j );
-
for( u32 k=0; k<audio->clip_count; k++ )
{
ent_audio_clip *clip = af_arritm( &world->ent_audio_clip, audio->clip_start+k );
-
if( clip->_.file.pack_size )
{
u32 size = clip->_.file.pack_size,
u32 type;
array_file_ptr *array;
}
- indexables[] = {
+ indexables[] =
+ {
{ k_ent_gate, &world->ent_gate },
{ k_ent_objective, &world->ent_objective },
{ k_ent_volume, &world->ent_volume },
indexed_count += af_arrcount( indexables[i].array );
vg_info( "indexing %u entities\n", indexed_count );
- world->entity_list = vg_linear_alloc( world->heap,
- vg_align8(indexed_count*sizeof(u32)));
+ world->entity_list = vg_linear_alloc( world->heap, vg_align8(indexed_count*sizeof(u32)));
u32 index=0;
for( u32 i=0; i<VG_ARRAY_LEN(indexables); i++ )
{
u32 type = indexables[i].type,
count = af_arrcount( indexables[i].array );
-
for( u32 j=0; j<count; j ++ )
world->entity_list[index ++] = mdl_entity_id( type, j );
}
for( u32 i=0; i<af_arrcount(&world->ent_marker); i++ )
{
ent_marker *marker = af_arritm( &world->ent_marker, i );
-
if( AF_STR_EQ( &world->meta.af, marker->pstr_alias, "tar_min" ) )
world->tar_min = marker->transform.co[1];
for( u32 i=0; i<af_arrcount(&world->ent_spawn); i++ )
{
r = af_arritm( &world->ent_spawn, i );
-
if( r->flags & k_ent_spawn_flag_locked )
continue;
float d = v3_dist2( r->transform.co, position );
- if( d < min_dist ){
+ if( d < min_dist )
+ {
min_dist = d;
rp = r;
}
}
- if( !rp ){
- if( af_arrcount(&world->ent_spawn) ){
+ if( !rp )
+ {
+ if( af_arrcount(&world->ent_spawn) )
+ {
vg_warn( "Invalid distances to spawns.. defaulting to first one.\n" );
return af_arritm( &world->ent_spawn, 0 );
}
- else{
+ else
vg_error( "There are no spawns in the level!\n" );
- }
}
return rp;
for( u32 i=0; i<af_arrcount(&world->ent_spawn); i++ )
{
r = af_arritm( &world->ent_spawn, i );
-
if( af_str_eq( &world->meta.af, r->pstr_name, name, hash ) )
{
rp = r;
call->id = volume->target;
if( volume->flags & k_ent_volume_flag_particles )
- {
vg_warn( "Invalid condition; calling leave on particle volume.\n" );
- }
else
{
call->function = volume->trigger.event_leave;
v3f sound_co;
if( call->function == k_ent_function_particle_spawn )
- {
v3_copy( call->data, sound_co );
- }
else if( call->function == k_ent_function_trigger )
- {
v3_copy( audio->transform.co, sound_co );
- }
else
return k_entity_call_result_unhandled;
type = mdl_entity_id_type( id ),
index = mdl_entity_id_id( id );
- if( type == k_ent_gate ){
+ if( type == k_ent_gate )
+ {
ent_gate *gate = af_arritm( &world->ent_gate, index );
boxf box = {{ -gate->dimensions[0], -gate->dimensions[1], -0.1f },
{ gate->dimensions[0], gate->dimensions[1], 0.1f }};
-
m4x3_expand_aabb_aabb( gate->to_world, bound, box );
}
- else if( type == k_ent_objective ){
+ else if( type == k_ent_objective )
+ {
ent_objective *objective = af_arritm( &world->ent_objective, index );
/* TODO: This might be more work than necessary. could maybe just get
mdl_transform_m4x3( &objective->transform, transform );
m4x3_expand_aabb_aabb( transform, bound, box );
}
- else if( type == k_ent_volume ){
+ else if( type == k_ent_volume )
+ {
ent_volume *volume = af_arritm( &world->ent_volume, index );
- m4x3_expand_aabb_aabb( volume->to_world, bound,
- (boxf){{-1.0f,-1.0f,-1.0f},{ 1.0f, 1.0f, 1.0f}} );
+ m4x3_expand_aabb_aabb( volume->to_world, bound, (boxf){{-1.0f,-1.0f,-1.0f},{ 1.0f, 1.0f, 1.0f}} );
}
- else if( type == k_ent_challenge ){
+ else if( type == k_ent_challenge )
+ {
ent_challenge *challenge = af_arritm( &world->ent_challenge, index );
-
boxf box = {{-1.2f*0.5f,-0.72f*0.5f,-0.01f*0.5f},
{ 1.2f*0.5f, 0.72f*0.5f, 0.01f*0.5f}};
m4x3f transform;
mdl_transform_m4x3( &challenge->transform, transform );
m4x3_expand_aabb_aabb( transform, bound, box );
}
- else if( type == k_ent_glider ){
+ else if( type == k_ent_glider )
+ {
ent_glider *glider = af_arritm( &world->ent_glider, index );
m4x3f transform;
mdl_transform_m4x3( &glider->transform, transform );
- m4x3_expand_aabb_aabb( transform, bound,
- (boxf){{-1.0f,-1.0f,-1.0f},{ 1.0f, 1.0f, 1.0f}} );
+ m4x3_expand_aabb_aabb( transform, bound, (boxf){{-1.0f,-1.0f,-1.0f},{ 1.0f, 1.0f, 1.0f}} );
}
- else{
+ else
vg_fatal_error( "Programming error\n" );
- }
}
float entity_bh_centroid( void *user, u32 item_index, int axis )
type = mdl_entity_id_type( id ),
index = mdl_entity_id_id( id );
- if( type == k_ent_gate ){
+ if( type == k_ent_gate )
+ {
ent_gate *gate = af_arritm( &world->ent_gate, index );
return gate->to_world[3][axis];
}
- else if( type == k_ent_objective ){
+ else if( type == k_ent_objective )
+ {
ent_objective *objective = af_arritm( &world->ent_objective, index );
return objective->transform.co[axis];
}
- else if( type == k_ent_volume ){
+ else if( type == k_ent_volume )
+ {
ent_volume *volume = af_arritm( &world->ent_volume, index );
return volume->transform.co[axis];
}
void entity_bh_swap( void *user, u32 ia, u32 ib )
{
world_instance *world = user;
-
u32 a = world->entity_list[ ia ],
b = world->entity_list[ ib ];
world->entity_list[ ib ] = a;
}
-void entity_bh_debug( void *user, u32 item_index ){
+void entity_bh_debug( void *user, u32 item_index )
+{
world_instance *world = user;
-
u32 id = world->entity_list[ item_index ],
type = mdl_entity_id_type( id ),
index = mdl_entity_id_id( id );
- if( type == k_ent_gate ){
+ if( type == k_ent_gate )
+ {
ent_gate *gate = af_arritm( &world->ent_gate, index );
boxf box = {{ -gate->dimensions[0], -gate->dimensions[1], -0.1f },
{ gate->dimensions[0], gate->dimensions[1], 0.1f }};
vg_line_boxf_transformed( gate->to_world, box, 0xf000ff00 );
}
- else if( type == k_ent_objective ){
+ else if( type == k_ent_objective )
+ {
ent_objective *objective = af_arritm( &world->ent_objective, index );
boxf box;
box_init_inf( box );
mdl_transform_m4x3( &objective->transform, transform );
vg_line_boxf_transformed( transform, box, 0xf000ff00 );
}
- else if( type == k_ent_volume ){
+ else if( type == k_ent_volume )
+ {
ent_volume *volume = af_arritm( &world->ent_volume, index );
- vg_line_boxf_transformed( volume->to_world,
- (boxf){{-1.0f,-1.0f,-1.0f},{ 1.0f, 1.0f, 1.0f}},
- 0xf000ff00 );
+ vg_line_boxf_transformed( volume->to_world, (boxf){{-1.0f,-1.0f,-1.0f},{ 1.0f, 1.0f, 1.0f}}, 0xf000ff00 );
}
- else if( type == k_ent_challenge ){
+ else if( type == k_ent_challenge )
+ {
ent_challenge *challenge = af_arritm( &world->ent_challenge, index );
-
boxf box = {{-1.2f*0.5f,-0.72f*0.5f,-0.01f*0.5f},
{ 1.2f*0.5f, 0.72f*0.5f, 0.01f*0.5f}};
m4x3f transform;
mdl_transform_m4x3( &challenge->transform, transform );
vg_line_boxf_transformed( transform, box, 0xf0ff0000 );
}
- else{
+ else
vg_fatal_error( "Programming error\n" );
- }
}
void update_ach_models(void)
type = mdl_entity_id_type( id ),
index = mdl_entity_id_id( id );
- if( type == k_ent_gate ){
+ if( type == k_ent_gate )
+ {
ent_gate *gate = af_arritm( &world->ent_gate, index );
v3_copy( gate->to_world[3], closest );
}
- else if( type == k_ent_objective ){
+ else if( type == k_ent_objective )
+ {
ent_objective *challenge = af_arritm( &world->ent_objective, index );
v3_copy( challenge->transform.co, closest );
}
- else if( type == k_ent_volume ){
+ else if( type == k_ent_volume )
+ {
ent_volume *volume = af_arritm( &world->ent_volume, index );
v3_copy( volume->to_world[3], closest );
}
- else if( type == k_ent_challenge ){
+ else if( type == k_ent_challenge )
+ {
ent_challenge *challenge = af_arritm( &world->ent_challenge, index );
v3_copy( challenge->transform.co, closest );
}
- else{
+ else
vg_fatal_error( "Programming error\n" );
- }
}
void world_entity_start( world_instance *world, vg_msg *sav )
vg_msg_getkvintg( sav, alias, k_vg_msg_u32, &result, NULL );
if( result )
- {
- ent_call call;
- call.data = NULL;
- call.function = 0;
- call.id = mdl_entity_id( k_ent_challenge, i );
- entity_call( world, &call );
- }
+ _ent_challenge_complete( challenge );
}
vg_msg routes_block = *sav;
- if( vg_msg_seekframe( &routes_block, "routes" ) ){
- for( u32 i=0; i<af_arrcount(&world->ent_route); i++ ){
+ if( vg_msg_seekframe( &routes_block, "routes" ) )
+ {
+ for( u32 i=0; i<af_arrcount(&world->ent_route); i++ )
+ {
ent_route *route = af_arritm( &world->ent_route, i );
-
vg_msg route_info = routes_block;
- if( vg_msg_seekframe( &route_info,
- af_str(&world->meta.af,route->pstr_name) ) )
+ if( vg_msg_seekframe( &route_info, af_str(&world->meta.af,route->pstr_name) ) )
{
-
u32 flags;
- vg_msg_getkvintg( &route_info, "flags", k_vg_msg_u32,
- &flags, NULL );
+ vg_msg_getkvintg( &route_info, "flags", k_vg_msg_u32, &flags, NULL );
route->flags |= flags;
- vg_msg_getkvintg( &route_info, "best_laptime", k_vg_msg_f64,
- &route->best_laptime, NULL );
+ vg_msg_getkvintg( &route_info, "best_laptime", k_vg_msg_f64, &route->best_laptime, NULL );
f32 sections[ route->checkpoints_count ];
vg_msg_cmd cmd;
- if( vg_msg_getkvcmd( &route_info, "sections", &cmd ) ){
- vg_msg_cast( cmd.value, cmd.code, sections,
- k_vg_msg_f32 |
- vg_msg_count_bits(route->checkpoints_count) );
+ if( vg_msg_getkvcmd( &route_info, "sections", &cmd ) )
+ {
+ vg_msg_cast( cmd.value, cmd.code, sections, k_vg_msg_f32 | vg_msg_count_bits(route->checkpoints_count) );
}
- else{
+ else
+ {
for( u32 j=0; j<route->checkpoints_count; j ++ )
sections[j] = 0.0f;
}
- for( u32 j=0; j<route->checkpoints_count; j ++ ){
- ent_checkpoint *cp = af_arritm( &world->ent_checkpoint,
- route->checkpoints_start + j );
-
+ for( u32 j=0; j<route->checkpoints_count; j ++ )
+ {
+ ent_checkpoint *cp = af_arritm( &world->ent_checkpoint, route->checkpoints_start + j );
cp->best_time = sections[j];
}
/* LEGACY: check if steam achievements can give us a medal */
- if( steam_ready && steam_stats_ready ){
- for( u32 j=0; j<VG_ARRAY_LEN(track_infos); j ++ ){
+ if( steam_ready && steam_stats_ready )
+ {
+ for( u32 j=0; j<VG_ARRAY_LEN(track_infos); j ++ )
+ {
struct track_info *inf = &track_infos[j];
- if( !strcmp(inf->name,
- af_str(&world->meta.af,route->pstr_name)))
+ if( !strcmp( inf->name, af_str(&world->meta.af,route->pstr_name)))
{
-
steamapi_bool set = 0;
- if( SteamAPI_ISteamUserStats_GetAchievement(
- hSteamUserStats, inf->achievement_id, &set ) )
+ if( SteamAPI_ISteamUserStats_GetAchievement( hSteamUserStats, inf->achievement_id, &set ) )
{
- if( set ){
+ if( set )
route->flags |= k_ent_route_flag_achieve_silver;
- }
}
}
}
void world_entity_serialize( world_instance *world, vg_msg *sav )
{
- for( u32 i=0; i<af_arrcount(&world->ent_challenge); i++ ){
+ for( u32 i=0; i<af_arrcount(&world->ent_challenge); i++ )
+ {
ent_challenge *challenge = af_arritm(&world->ent_challenge,i);
-
const char *alias = af_str( &world->meta.af, challenge->pstr_alias );
vg_msg_wkvnum( sav, alias, k_vg_msg_u32, 1, &challenge->status );
}
if( af_arrcount(&world->ent_route) )
{
vg_msg_frame( sav, "routes" );
- for( u32 i=0; i<af_arrcount(&world->ent_route); i++ ){
+ for( u32 i=0; i<af_arrcount(&world->ent_route); i++ )
+ {
ent_route *route = af_arritm( &world->ent_route, i );
-
vg_msg_frame( sav, af_str( &world->meta.af, route->pstr_name ) );
{
vg_msg_wkvnum( sav, "flags", k_vg_msg_u32, 1, &route->flags );
f32 sections[ route->checkpoints_count ];
- for( u32 j=0; j<route->checkpoints_count; j ++ ){
- ent_checkpoint *cp = af_arritm( &world->ent_checkpoint,
- route->checkpoints_start + j );
-
+ for( u32 j=0; j<route->checkpoints_count; j ++ )
+ {
+ ent_checkpoint *cp = af_arritm( &world->ent_checkpoint, route->checkpoints_start + j );
sections[j] = cp->best_time;
}