new maps (dev)
authorhgn <hgodden00@gmail.com>
Mon, 24 Jan 2022 08:55:53 +0000 (08:55 +0000)
committerhgn <hgodden00@gmail.com>
Mon, 24 Jan 2022 08:55:53 +0000 (08:55 +0000)
fishladder_resources.h
maps/cmp_exact5.map [new file with mode: 0644]
maps/cmp_expander.map [new file with mode: 0644]
maps/cmp_pattern3.map [new file with mode: 0644]
maps/cmp_routing2.map [new file with mode: 0644]

index 90303019e2c7aa2e9a286b5f9e7ce7d555ba21ce..929d4a4565b5b79e81b52dbd7d375665958f38ef 100644 (file)
@@ -636,11 +636,11 @@ static struct cmp_level cmp_levels_tutorials[] =
                .is_tutorial = 1
        },
    {
-      .serial_id = 25,
+      .serial_id = 26,
       .title = "PRINCIPLE 7",
       .map_name = "cmp_p7",
       .description = "Emitters",
-      ._unlock = 26,
+      ._unlock = 27,
       .is_tutorial = 1
    }
 };
@@ -767,7 +767,35 @@ static struct cmp_level cmp_levels_basic[] =
 
                ._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[] =
@@ -927,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
@@ -945,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;
+         }
                }
        }
 }
diff --git a/maps/cmp_exact5.map b/maps/cmp_exact5.map
new file mode 100644 (file)
index 0000000..e1f0581
--- /dev/null
@@ -0,0 +1,15 @@
+#############;
+#############;
+##         ##;
+##         ##;
+##         ##;
+##         ##;
+##         ##;
+##         ##;
+##         ##;
+##         ##;
+#####      ##;
+#####      ##;
+###-#      ##;bbbbb
+###*####+####;bb,a
+#############;
diff --git a/maps/cmp_expander.map b/maps/cmp_expander.map
new file mode 100644 (file)
index 0000000..4f5ef5a
--- /dev/null
@@ -0,0 +1,12 @@
+###########;
+#####-#####;bbbb
+##       ##;
+##       ##;
+##       ##;
+##       ##;
+##       ##;
+##       ##;
+##       ##;
+##       ##;
+###+###*###;a,bb
+###########;
diff --git a/maps/cmp_pattern3.map b/maps/cmp_pattern3.map
new file mode 100644 (file)
index 0000000..b17aeb6
--- /dev/null
@@ -0,0 +1,14 @@
+##################;
+##################;
+########        ##;
+########        ##;
+########        ##;
+########        ##;
+########        ##;
+########        ##;
+########        ##;
+####-###        ##;ccdd:ddcc
+##     #        ##;
+##     #        ##;
+###*#*######+#+###;cc,dd,a:,:a
+##################;
diff --git a/maps/cmp_routing2.map b/maps/cmp_routing2.map
new file mode 100644 (file)
index 0000000..a3f212a
--- /dev/null
@@ -0,0 +1,17 @@
+#################;
+###-#########-###;bbbb,aaaa
+##             ##;
+##             ##;
+##             ##;
+#################;
+########-########;aaabbb
+##             ##;
+##             ##;
+##             ##;
+#####+##*##+#####;aa,ab,bb
+#################;
+##             ##;
+##             ##;
+##             ##;
+###+#########+###;aaaa,bbbb
+#################;