new maps (dev)
[fishladder.git] / fishladder_resources.h
index a3a2a87bc08ce8ba3b180035e11d866a00d92661..929d4a4565b5b79e81b52dbd7d375665958f38ef 100644 (file)
@@ -634,7 +634,15 @@ static struct cmp_level cmp_levels_tutorials[] =
 
                ._unlock = 18,
                .is_tutorial = 1
-       }
+       },
+   {
+      .serial_id = 26,
+      .title = "PRINCIPLE 7",
+      .map_name = "cmp_p7",
+      .description = "Emitters",
+      ._unlock = 27,
+      .is_tutorial = 1
+   }
 };
 
 static struct cmp_level cmp_levels_basic[] =
@@ -757,9 +765,37 @@ static struct cmp_level cmp_levels_basic[] =
                .map_name = "cmp_xor",
                .description =  "",
 
-               ._unlock = 13,
+               ._unlock = 25,
                .achievement = "GRADUATE"
-       }
+       },
+   {
+      .serial_id = 27,
+      .title = "EXPAND",
+      .map_name = "cmp_expander",
+      .description = "",
+
+      ._unlock = 28
+   },
+   {
+      .serial_id = 28,
+      .title = "PATTERNS 3",
+      .map_name = "cmp_pattern3",
+      .description = "",
+      ._linked = 29
+   },
+   {
+      .serial_id = 29,
+      .title = "ROUTING PROBLEM 2",
+      .map_name = "cmp_routing2",
+      .description = "Spaghetti!",
+      ._linked = 30
+   },
+   {
+      .serial_id = 30,
+      .title = "EXACTLY 5",
+      .map_name = "cmp_exact5",
+      .description = ""
+   }
 };
 
 static struct cmp_level cmp_levels_grad[] =
@@ -807,7 +843,23 @@ static struct cmp_level cmp_levels_computer[] =
                .serial_id = 23,
                .title = "3 BIT BINARY",
                .map_name = "cmp_binary",
-               .description = "",
+               .description = "convert amount to binary",
+      .strings =
+      {
+         {
+            .placement = k_placement_bottom,
+            .str = 
+"\t\t\t\t\t\t\t\t\t\t\x83                   \x84\n"
+"\t\t\t\t\t\t\t\t\t\t\x83                   \x84 Binary\n"
+"\t\t\t\t\t\t\t\t\t\t\x83 4       2       1 \x84"
+         },
+         {
+            .placement = k_placement_top,
+            .str =
+"\n"
+"\t\t\t\t\t\t\t\t\t\t\t Count"
+         }
+      },
                
                ._unlock = 24
        },
@@ -841,7 +893,18 @@ static struct cmp_level cmp_levels_computer[] =
                .serial_id = 25,
                .title = "3x3 PLOT",
                .map_name = "cmp_plot3x3",
-               .description = ""
+               .description = "2 bit x/y",
+
+      .strings =
+      {
+         {
+            .placement = k_placement_top,
+            .str=
+"\t\t\t\t\t\t\t\t\x8A 2       1 \x8B           \x8A 2       1 \x8B\n"
+"\t\t\t\t\t\t\t\t\x83           \x84 X       Y \x83           \x84\n"
+"\t\t\t\t\t\t\t\t\x83           \x84           \x83           \x84"
+         }
+      }
        }
 };
 
@@ -892,14 +955,23 @@ career_packs[] =
 static void career_local_data_init(void)
 {
        struct cmp_level *level_ptrs[ NUM_CAMPAIGN_LEVELS ];
-       
+       for( int i = 0; i < NUM_CAMPAIGN_LEVELS; i ++ )
+      level_ptrs[i] = NULL;
+
        // COllect pointers
        for( int i = 0; i < vg_list_size( career_packs ); i ++ )
        {
                struct career_level_pack *set = &career_packs[i];
                
                for( int j = 0; j < set->count; j ++ )
-                       level_ptrs[ set->pack[j].serial_id ] = &set->pack[j];
+      {
+         int id = set->pack[j].serial_id;
+
+         if( level_ptrs[ id ] )
+            vg_error( "Serial id %u already used!\n", id );
+         else
+                          level_ptrs[ set->pack[j].serial_id ] = &set->pack[j];
+      }
        }
        
        // Apply
@@ -910,8 +982,18 @@ static void career_local_data_init(void)
                for( int j = 0; j < set->count; j ++ )
                {
                        struct cmp_level *lvl = &set->pack[j];
-                       lvl->unlock = lvl->_unlock? level_ptrs[ lvl->_unlock ]: NULL;
-                       lvl->linked = lvl->_linked? level_ptrs[ lvl->_linked ]: NULL;
+
+         if( lvl->_unlock >= NUM_CAMPAIGN_LEVELS ||
+             lvl->_linked >= NUM_CAMPAIGN_LEVELS )
+         {
+            vg_error( "_unlock / _linked out of range (%d, %d)\n",
+               lvl->_unlock, lvl->_linked );
+         }
+         else
+         {
+                          lvl->unlock = lvl->_unlock? level_ptrs[ lvl->_unlock ]: NULL;
+                          lvl->linked = lvl->_linked? level_ptrs[ lvl->_linked ]: NULL;
+         }
                }
        }
 }