1 #ifndef ENT_CHALLENGE_C
2 #define ENT_CHALLENGE_C
5 #include "world_load.h"
8 VG_STATIC
void ent_challenge_pass( world_instance
*world
,
9 ent_challenge
*challenge
){
10 if( challenge
->id_next
){
11 world
->challenge_timer
+= challenge
->filter
;
13 u32 index
= mdl_entity_id_id( challenge
->id_next
);
14 ent_challenge
*next
= mdl_arritm( &world
->ent_challenge
, index
);
15 world
->challenge_target
= next
;
17 vg_info( "pass challenge point\n" );
20 vg_success( "NYU Film school graduate SUCKAH\n" );
21 world
->challenge_target
= NULL
;
22 world
->challenge_timer
= 0.0f
;
26 VG_STATIC
void ent_challenge_call( world_instance
*world
, ent_call
*call
){
27 u32 index
= mdl_entity_id_id( call
->id
);
28 ent_challenge
*challenge
= mdl_arritm( &world
->ent_challenge
, index
);
30 if( call
->function
== 0 ){
31 if( world
->challenge_target
){
32 if( world
->challenge_target
== challenge
){
33 ent_challenge_pass( world
, challenge
);
36 vg_error( "womp womp\n" );
37 world
->challenge_target
= NULL
;
38 world
->challenge_timer
= 0.0f
;
42 else if( call
->function
== 1 ){
43 vg_info( "begin the challenge\n" );
44 world
->challenge_timer
= 0.0f
;
45 ent_challenge_pass( world
, challenge
);
49 vg_error( "Unhandled function id: %u\n", call
->function
);
53 #endif /* ENT_CHALLENGE_C */