From: hgn Date: Wed, 14 May 2025 00:26:43 +0000 (+0100) Subject: mowt X-Git-Url: https://harrygodden.com/git/?a=commitdiff_plain;h=385c557c7f6246dc40e04681de1729d925100725;p=carveJwlIkooP6JGAAIwe30JlM.git mowt --- diff --git a/content_skaterift/maps/mp_spawn/main.mdl b/content_skaterift/maps/mp_spawn/main.mdl index 99025d2..ca6fba1 100644 Binary files a/content_skaterift/maps/mp_spawn/main.mdl and b/content_skaterift/maps/mp_spawn/main.mdl differ diff --git a/shaders/scene_cubemapped.fs b/shaders/scene_cubemapped.fs index bc42df6..efff0d7 100644 --- a/shaders/scene_cubemapped.fs +++ b/shaders/scene_cubemapped.fs @@ -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 ); } diff --git a/src/ent_prop.c b/src/ent_prop.c index 3aab17a..3b95445 100644 --- a/src/ent_prop.c +++ b/src/ent_prop.c @@ -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 ); } } diff --git a/src/entity.h b/src/entity.h index fac8f63..a50c137 100644 --- a/src/entity.h +++ b/src/entity.h @@ -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 { diff --git a/src/scripts/city.c b/src/scripts/city.c index 8a47073..24b3d16 100644 --- a/src/scripts/city.c +++ b/src/scripts/city.c @@ -1,103 +1,155 @@ -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; } diff --git a/src/scripts/mtzero.c b/src/scripts/mtzero.c index eef2654..3efeb4f 100644 --- a/src/scripts/mtzero.c +++ b/src/scripts/mtzero.c @@ -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 ) ) { diff --git a/src/skaterift_script.c b/src/skaterift_script.c index fdc136e..e70cef5 100644 --- a/src/skaterift_script.c +++ b/src/skaterift_script.c @@ -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" }, diff --git a/src/world_render.c b/src/world_render.c index a406bea..c60ecf1 100644 --- a/src/world_render.c +++ b/src/world_render.c @@ -605,6 +605,8 @@ static void world_render_challenges( world_instance *world, struct world_pass *p for( u32 i=0; ient_challenge); i++ ) { ent_challenge *challenge = af_arritm( &world->ent_challenge, i ); + if( challenge->flags & k_ent_challenge_locked ) + continue; if( challenge->status ) count ++; total ++;