- 'Construction Mode' ammo set and game parameters added to iOS front-end ios-revival
authorantonc27 <antonc27@mail.ru>
Sun, 20 Sep 2015 02:52:49 +0200
branchios-revival
changeset 11192 3dbea499390d
parent 11191 fa6f6e8b927c
child 11193 0fdef687de65
- 'Construction Mode' ammo set and game parameters added to iOS front-end
project_files/HedgewarsMobile/Classes/CreationChamber.m
--- a/project_files/HedgewarsMobile/Classes/CreationChamber.m	Sun Sep 20 02:08:12 2015 +0200
+++ b/project_files/HedgewarsMobile/Classes/CreationChamber.m	Sun Sep 20 02:52:49 2015 +0200
@@ -57,7 +57,7 @@
         [[NSFileManager defaultManager] removeItemAtPath:SCHEMES_DIRECTORY() error:NULL];
     NSArray *schemeNames = [[NSArray alloc] initWithObjects:@"Default",@"Pro Mode",@"Shoppa",@"Clean Slate",
                             @"Minefield",@"Barrel Mayhem",@"Tunnel Hogs",@"Fort Mode",@"Timeless",
-                            @"Thinking with Portals",@"King Mode",nil];
+                            @"Thinking with Portals",@"King Mode",@"Construction Mode",nil];
     index = 0;
     for (NSString *name in schemeNames)
         [self createSchemeNamed:name ofType:index++];
@@ -65,7 +65,7 @@
 
     // WEAPONS - always overwrite as merge is not needed (missing weaps are 0ed automatically)
     NSArray *weaponNames = [[NSArray alloc] initWithObjects:@"Default",@"Crazy",@"Pro Mode",@"Shoppa",@"Clean Slate",
-                            @"Minefield",@"Thinking with Portals",@"One of Everything",@"Highlander",nil];
+                            @"Minefield",@"Thinking with Portals",@"One of Everything",@"Highlander",@"Construction Mode",nil];
     index = 0;
     for (NSString *name in weaponNames)
         [self createWeaponNamed:name ofType:index++];
@@ -253,6 +253,12 @@
             delay = [[NSString alloc] initWithBytes:AMMOLINE_HIGHLANDER_DELAY length:ammolineSize encoding:NSUTF8StringEncoding];
             crate = [[NSString alloc] initWithBytes:AMMOLINE_HIGHLANDER_CRATE length:ammolineSize encoding:NSUTF8StringEncoding];
             break;
+        case 9:  //construction mode
+            qt = [[NSString alloc] initWithBytes:AMMOLINE_CONSTRUCTION_QT length:ammolineSize encoding:NSUTF8StringEncoding];
+            prob = [[NSString alloc] initWithBytes:AMMOLINE_CONSTRUCTION_PROB length:ammolineSize encoding:NSUTF8StringEncoding];
+            delay = [[NSString alloc] initWithBytes:AMMOLINE_CONSTRUCTION_DELAY length:ammolineSize encoding:NSUTF8StringEncoding];
+            crate = [[NSString alloc] initWithBytes:AMMOLINE_CONSTRUCTION_CRATE length:ammolineSize encoding:NSUTF8StringEncoding];
+            break;
     }
 
     NSDictionary *theWeapon = [[NSDictionary alloc] initWithObjectsAndKeys: qt,@"ammostore_initialqt",
@@ -392,6 +398,15 @@
             [gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]];
             [gamemodArray replaceObjectAtIndex:12 withObject:[NSNumber numberWithBool:YES]];
             break;
+        case 11: // construction mode
+            [basicArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithInt:0]];
+            [basicArray replaceObjectAtIndex:13 withObject:[NSNumber numberWithInt:0]];
+            [gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]];
+            [gamemodArray replaceObjectAtIndex:15 withObject:[NSNumber numberWithBool:YES]];
+            [gamemodArray replaceObjectAtIndex:16 withObject:[NSNumber numberWithBool:YES]];
+            [gamemodArray replaceObjectAtIndex:18 withObject:[NSNumber numberWithBool:YES]];
+            [gamemodArray replaceObjectAtIndex:20 withObject:[NSNumber numberWithBool:YES]];
+            break;
     }
 
     NSMutableDictionary *theScheme = [[NSMutableDictionary alloc] initWithObjectsAndKeys: