mowt
authorhgn <hgodden00@gmail.com>
Wed, 14 May 2025 00:26:43 +0000 (01:26 +0100)
committerhgn <hgodden00@gmail.com>
Wed, 14 May 2025 00:26:43 +0000 (01:26 +0100)
content_skaterift/maps/mp_spawn/main.mdl
shaders/scene_cubemapped.fs
src/ent_prop.c
src/entity.h
src/scripts/city.c
src/scripts/mtzero.c
src/skaterift_script.c
src/world_render.c

index 99025d207b2c736700d03c69700667c7373ad355..ca6fba16bc93e589911fc355be85423d98330d6d 100644 (file)
Binary files a/content_skaterift/maps/mp_spawn/main.mdl and b/content_skaterift/maps/mp_spawn/main.mdl differ
index bc42df67377cf848640b65030d279952e2c9572d..efff0d7a4c2fe7443d51603d2ea08bf08cbacc82 100644 (file)
@@ -23,12 +23,8 @@ void main()
       vfrag = vec3(0.5);
    }
 
-   vfrag = scene_compute_lighting( vfrag, qnorm, aWorldCo );
-   oColour = vec4( vfrag, 1.0 );
-
    vec3 halfdir = normalize( aWorldCo - uCamera );
    vec3 reflectdir = reflect( halfdir, qnorm );
-   oColour = mix( oColour, 
-                  vec4(texture(uTexCubemap,reflectdir).rgb * uColour.rgb, 1.0),
-                  uColour.a*wgarbage.b );
+   vfrag = mix( vfrag, texture(uTexCubemap,reflectdir).rgb * uColour.rgb, uColour.a*wgarbage.b );
+   oColour = vec4( scene_compute_lighting( vfrag, qnorm, aWorldCo ), 1.0 );
 }
index 3aab17af0419cb14815473eecf67ea89a95e9503..3b95445823b6a1f79a66c756bc2d5d6ec3549099 100644 (file)
@@ -9,5 +9,8 @@ void ent_prop_update( world_instance *world )
 
       if( prop->flags & k_prop_flag_spinning )
          q_axis_angle( prop->transform.q, (v3f){0,1,0}, vg.time );
+
+      if( prop->flags & k_prop_flag_spinning_fast )
+         q_axis_angle( prop->transform.q, (v3f){0,1,0}, vg.time*20.0 );
    }
 }
index fac8f63e5a97d4a8b42484fd328989dd825c8374..a50c1375ac5783400d0b6f36b6ea494c0bab4a08 100644 (file)
@@ -705,7 +705,8 @@ enum prop_flag
 {
    k_prop_flag_hidden = 0x1,
    k_prop_flag_spinning = 0x2,
-   k_prop_flag_collider = 0x4
+   k_prop_flag_collider = 0x4,
+   k_prop_flag_spinning_fast = 0x8,
 };
 
 struct ent_prop {
index 8a47073855955fd3738a2e752e28c0d0000eae60..24b3d164e8bfc6065ec0f5462d96c04cb9012859 100644 (file)
-static bool _skaterift_script_ch3s1( ent_script_event *event )
+static bool _skaterift_script_city( ent_script_event *event )
 {
-#if 0
-   static const struct cs_subtitle EN[] = 
+   if( on_nugget_once( event, "ch3s1_view" ) )
    {
-      { "j1",  KCOL_JOHN "Ohh this is it guys." },
-      { "j2",  KCOL_JOHN "Good enough!" },
-      { "m1",  KCOL_MIKE "Never even thought I'd visit the USA" },
-      { "m2",  KCOL_MIKE "But here we are I guess.." },
-      { "j3",  KCOL_JOHN "I've had weirder sundays." },
-      { "m3",  KCOL_MIKE "Somehow I'm not surprised." },
-      { NULL, NULL },
-   };
-   static const struct generic_cutscene cutscene = 
+      static const struct cs_subtitle EN[] = 
+      {
+         { "j1",  KCOL_JOHN "Ohh this is it guys." },
+         { "j2",  KCOL_JOHN "Good enough!" },
+         { "m1",  KCOL_MIKE "Never even thought I'd visit the USA" },
+         { "m2",  KCOL_MIKE "But here we are I guess.." },
+         { "j3",  KCOL_JOHN "I've had weirder sundays." },
+         { "m3",  KCOL_MIKE "Somehow I'm not surprised." },
+         { NULL, NULL },
+      };
+      _cutscene_load_and_play( "metascenes/ch3s1.ms", EN, 1 );
+   }
+
+   // REgion complete
+   if( on_function_trigger( event, 5 ) )
    {
-      .metascene_path = "metascenes/ch3s1.ms",
-      .freeze_player = 1,
-      .subtitles = EN,
-   };
-   generic_cutscene_wrapper( &cutscene, event );
+      if( _skaterift_script_nugget_status( "ch3s2_view" ) == 0 )
+         _skaterift_script_nugget_set( "ch3s2_view", 2 );
+   }
 
-   if( on_nugget_once( event, "ch3s1_view" ) )
+   // On activate finale challenge
+   if( on_function_trigger( event, 7 ) )
    {
-      play_generic_cutscene( event );
    }
-#endif
+
+   // On complete finale challenge
+   if( on_function_trigger( event, 8 ) )
+   {
+      _skaterift_script_nugget_set( "city_finale", 3 );
+      _skaterift_script_nugget_set( "ch3s3_view", 2 );
+   }
+
+   u64 status;
+   if( on_nugget_changed( event, "city_finale", &status ) )
+   {
+      _ent_list_set_visible( _ent_list_get_aliased( "finale" ), status > 0 );
+      _ent_list_set_visible( _ent_list_get_aliased( "finale_marker" ), status == 2 );
+   }
+
    return 1;
 }
 
 static bool _skaterift_script_ch3s2( ent_script_event *event )
 {
-#if 0
-   static const struct cs_subtitle EN[] = 
-   {
-      { "m1",  KCOL_MIKE "Is that the FBI??" },
-      { "m2",  KCOL_MIKE "I don't know about this man things are getting weird." },
-      { "m3",  KCOL_MIKE "Oh no that is not good" },
-      { "m4",  KCOL_MIKE "What do they even want with him?" },
-      { "m5",  KCOL_MIKE "Ahhh yeah, the aliens. That'l do it." },
-      { NULL, NULL },
-   };
-   static const struct generic_cutscene cutscene = 
+   u64 status;
+   if( on_nugget_changed( event, "ch3s2_view", &status ) )
+      _ent_list_set_visible( event->entity_list, status == 2 );
+
+   if( on_function_trigger( event, 0 ) )
    {
-      .metascene_path = "metascenes/ch3s2.ms",
-      .freeze_player = 1,
-      .subtitles = EN,
-   };
-   optional_video_wrapper( &cutscene, "ch3s2_view", 0, event );
-#endif
+      if( on_nugget_once( event, "ch3s2_view" ) )
+      {
+         _skaterift_script_nugget_set( "city_finale", 2 );
+
+         static const struct cs_subtitle EN[] = 
+         {
+            { "m1",  KCOL_MIKE "Is that the FBI??" },
+            { "m2",  KCOL_MIKE "I don't know about this man things are getting weird." },
+            { "m3",  KCOL_MIKE "Oh no that is not good" },
+            { "m4",  KCOL_MIKE "What do they even want with him?" },
+            { "m5",  KCOL_MIKE "Ahhh yeah, the aliens. That'l do it." },
+            { NULL, NULL },
+         };
+         _cutscene_load_and_play( "metascenes/ch3s2.ms", EN, 1 );
+      }
+   }
    return 1;
 }
 
+struct script_ch3s3_waiter
+{
+   bool go;
+};
+
 static bool _skaterift_script_ch3s3( ent_script_event *event )
 {
-#if 0
-   static const struct cs_subtitle EN[] = 
+   if( event->type == k_escript_event_allocate )
+   {
+      struct script_event_allocate *event_info = event->info;
+      struct script_ch3s3_waiter *waiter = vg_linear_alloc( event_info->heap, sizeof(struct script_ch3s3_waiter) );
+      waiter->go = 0;
+      event_info->userdata = waiter;
+      return 1;
+   }
+   struct script_ch1s6a_waiter *waiter = event->userdata;
+
+   u64 status;
+   if( on_nugget_changed( event, "ch3s3_view", &status ) )
+      _ent_list_set_visible( event->entity_list, status == 2 );
+
+   if( on_function_trigger( event, 0 ) )
    {
-      { "p1",  KCOL_PRES "Yall have some explaining to do here.." },
-      { "p2",  KCOL_PRES "Every single power plant in the USA is currently offline" },
-      { "p3",  KCOL_PRES "And yet.." },
-      { "p4",  KCOL_PRES "There is no national emergency?" },
-      { "p5",  KCOL_PRES "Nothing is wrong!" },
-      { "p6",  KCOL_PRES "So where the hell is all this power coming from?" },
-      { "p7",  KCOL_PRES "We traced it back here, to you guys" },
-      { "p8",  KCOL_PRES "Now, please. Enlighten me." },
-      { "p9",  KCOL_PRES "How exactly are you powering all of America?" },
-      { "p10", KCOL_PRES "From this one tiny establishment?" },
-      { "m1",  KCOL_MIKE "Look, this is gonna be a tough one to explain mate" },
-      { "m2",  KCOL_MIKE "And to be honest I don't really get it myself" },
-      { "p11", KCOL_PRES "Do your best!" },
-      { "m3",  KCOL_MIKE "Mr. President, we saw you take JC," },
-      { "m4",  KCOL_MIKE "Didn't he explain it to you already?" },
-      { "p12", KCOL_PRES "JC JC.." },
-      { "p13", KCOL_PRES "Ah! John Cockroach.." },
-      { "p14", KCOL_PRES "Of course. He's a friend of yours?" },
-      { "m5",  KCOL_MIKE "Yeah.. I'm an intern at his wood company." },
-      { "m6",  KCOL_MIKE "And this is just a friend of ours here." },
-      { "p15", KCOL_PRES "So what you're telling me is, and what he told me is," },
-      { "p16", KCOL_PRES "Three random people, from a wood company," },
-      { "p17", KCOL_PRES "in Tasmania, Australia" },
-      { "p18", KCOL_PRES "just happen to have nuclear fusion" },
-      { "m7",  KCOL_MIKE "Yeah I guess.." },
-      { "p19", KCOL_PRES "Man I cannot believe that old guy was telling the truth this whole time" },
-      { "m8",  KCOL_MIKE "Thats what I've been saying!" },
-      { "p20", KCOL_PRES "The world don't make sense any more" },
-      { "p21", KCOL_PRES "Well! Fortunately for you lot," },
-      { "p22", KCOL_PRES "you're coming with us!" },
-      { "p23", KCOL_PRES "We're sending you to Cambodia." },
-      { "m9",  KCOL_MIKE "What!?" },
-      { "m10", KCOL_MIKE "Can he even do that?" },
-      { "p24", KCOL_PRES "Yes I can. Now, get in." },
-      { NULL, NULL },
-   };
-   static const struct generic_cutscene cutscene = 
+      if( on_nugget_once( event, "ch3s3_view" ) )
+      {
+         _skaterift_script_nugget_set( "unlock_valley", 1 );
+
+         static const struct cs_subtitle EN[] = 
+         {
+            { "p1",  KCOL_PRES "Yall have some explaining to do here.." },
+            { "p2",  KCOL_PRES "Every single power plant in the USA is currently offline" },
+            { "p3",  KCOL_PRES "And yet.." },
+            { "p4",  KCOL_PRES "There is no national emergency?" },
+            { "p5",  KCOL_PRES "Nothing is wrong!" },
+            { "p6",  KCOL_PRES "So where the hell is all this power coming from?" },
+            { "p7",  KCOL_PRES "We traced it back here, to you guys" },
+            { "p8",  KCOL_PRES "Now, please. Enlighten me." },
+            { "p9",  KCOL_PRES "How exactly are you powering all of America?" },
+            { "p10", KCOL_PRES "From this one tiny establishment?" },
+            { "m1",  KCOL_MIKE "Look, this is gonna be a tough one to explain mate" },
+            { "m2",  KCOL_MIKE "And to be honest I don't really get it myself" },
+            { "p11", KCOL_PRES "Do your best!" },
+            { "m3",  KCOL_MIKE "Mr. President, we saw you take JC," },
+            { "m4",  KCOL_MIKE "Didn't he explain it to you already?" },
+            { "p12", KCOL_PRES "JC JC.." },
+            { "p13", KCOL_PRES "Ah! John Cockroach.." },
+            { "p14", KCOL_PRES "Of course. He's a friend of yours?" },
+            { "m5",  KCOL_MIKE "Yeah.. I'm an intern at his wood company." },
+            { "m6",  KCOL_MIKE "And this is just a friend of ours here." },
+            { "p15", KCOL_PRES "So what you're telling me is, and what he told me is," },
+            { "p16", KCOL_PRES "Three random people, from a wood company," },
+            { "p17", KCOL_PRES "in Tasmania, Australia" },
+            { "p18", KCOL_PRES "just happen to have nuclear fusion" },
+            { "m7",  KCOL_MIKE "Yeah I guess.." },
+            { "p19", KCOL_PRES "Man I cannot believe that old guy was telling the truth this whole time" },
+            { "m8",  KCOL_MIKE "Thats what I've been saying!" },
+            { "p20", KCOL_PRES "The world don't make sense any more" },
+            { "p21", KCOL_PRES "Well! Fortunately for you lot," },
+            { "p22", KCOL_PRES "you're coming with us!" },
+            { "p23", KCOL_PRES "We're sending you to Cambodia." },
+            { "m9",  KCOL_MIKE "What!?" },
+            { "m10", KCOL_MIKE "Can he even do that?" },
+            { "p24", KCOL_PRES "Yes I can. Now, get in." },
+            { NULL, NULL },
+         };
+         _cutscene_load_and_play( "metascenes/ch3s3.ms", EN, 1 );
+         waiter->go = 1;
+      }
+   }
+   if( event->type == k_escript_event_update )
    {
-      .metascene_path = "metascenes/ch3s3.ms",
-      .freeze_player = 1,
-      .subtitles = EN,
-   };
-   optional_video_wrapper( &cutscene, "ch3s3_view", 0, event );
-#endif
+      if( waiter->go )
+      {
+         if( _cutscene.state == k_cutscene_state_none )
+         {
+            waiter->go = 0;
+            skaterift_load_world_command( 1, (const char *[]){ "sr002-local-dev_hub" } );
+         }
+      }
+   }
    return 1;
 }
index eef26547ee9db5592dc8140cead7345bf40dbeac..3efeb4fbee61f35f573d592c540e82f8b20e7dc5 100644 (file)
@@ -245,7 +245,7 @@ static bool _skaterift_script_ch2s6( ent_script_event *event )
    if( on_nugget_changed( event, "ch2s6_view", &status ) )
       _ent_list_set_visible( event->entity_list, status == 2 );
 
-   // TODO: THERE ARE NO UNLOCK CONDITIONS FOR THIS YET!
+   // TODOX1: THERE ARE NO UNLOCK CONDITIONS FOR THIS YET!
 
    if( on_function_trigger( event, 0 ) )
    {
index fdc136e5a6077677c386e927b74692dfba2cfb96..e70cef5438f9804a55eef38b1ef3833d99155cd1 100644 (file)
@@ -664,7 +664,7 @@ struct ent_script_table_entry _ent_script_table[] =
    { "ch2s6", _skaterift_script_ch2s6 },
    { "ch2e1", _skaterift_script_ch2e1 },
 
-   { "ch3s1", _skaterift_script_ch3s1 },
+   { "city", _skaterift_script_city },
    { "ch3s2", _skaterift_script_ch3s2 },
    { "ch3s3", _skaterift_script_ch3s3 },
 
@@ -711,6 +711,7 @@ _skaterift_script_savedata[] =
    { "ch3s1_view" },
    { "ch3s2_view" },
    { "ch3s3_view" },
+   { "city_finale" },
 
    { "unlock_valley" },
    { "unlock_valley_view" },
index a406bea3592bb80a4f7831a8811b7d8b98a3c4a8..c60ecf17ba722748265db358a71b5d6f4225c3c2 100644 (file)
@@ -605,6 +605,8 @@ static void world_render_challenges( world_instance *world, struct world_pass *p
    for( u32 i=0; i<af_arrcount(&world->ent_challenge); i++ )
    {
       ent_challenge *challenge = af_arritm( &world->ent_challenge, i );
+      if( challenge->flags & k_ent_challenge_locked )
+         continue;
       if( challenge->status ) 
          count ++;
       total ++;