project_files/HedgewarsMobile/Classes/CreationChamber.m
changeset 6104 117bdf4e7af9
parent 6103 55ecfbf834e3
child 6624 e049b5bb0ad1
equal deleted inserted replaced
6103:55ecfbf834e3 6104:117bdf4e7af9
    50 
    50 
    51 +(void) createTeamNamed:(NSString *)nameWithoutExt ofType:(NSInteger) type {
    51 +(void) createTeamNamed:(NSString *)nameWithoutExt ofType:(NSInteger) type {
    52     [CreationChamber createTeamNamed:nameWithoutExt ofType:type controlledByAI:NO];
    52     [CreationChamber createTeamNamed:nameWithoutExt ofType:type controlledByAI:NO];
    53 }
    53 }
    54 
    54 
    55 +(void) createTeamNamed:(NSString *)nameWithoutExt ofType:(NSInteger) type controlledByAI:(BOOL) flag {
    55 +(void) createTeamNamed:(NSString *)nameWithoutExt ofType:(NSInteger) type controlledByAI:(BOOL) shouldAITakeOver {
    56     NSString *teamsDirectory = TEAMS_DIRECTORY();
    56     NSString *teamsDirectory = TEAMS_DIRECTORY();
    57 
    57 
    58     if (![[NSFileManager defaultManager] fileExistsAtPath: teamsDirectory]) {
    58     if (![[NSFileManager defaultManager] fileExistsAtPath: teamsDirectory]) {
    59         [[NSFileManager defaultManager] createDirectoryAtPath:teamsDirectory
    59         [[NSFileManager defaultManager] createDirectoryAtPath:teamsDirectory
    60                                   withIntermediateDirectories:NO
    60                                   withIntermediateDirectories:NO
    61                                                    attributes:nil
    61                                                    attributes:nil
    62                                                         error:NULL];
    62                                                         error:NULL];
    63     }
    63     }
    64 
    64 
    65     NSMutableArray *hedgehogs = [[NSMutableArray alloc] initWithCapacity: HW_getMaxNumberOfHogs()];
    65     NSArray *customNames;
    66 
    66     NSArray *customHats;
       
    67     NSString *flag, *grave, *voicepack, *fort;
       
    68     switch (type) {
       
    69         default: // default
       
    70             customNames = [[NSArray alloc] initWithObjects:@"No Name",@"Unnamed",@"Anonymous",@"Nameless",@"Incognito",@"Unidentified",
       
    71                            @"Uknown",@"Secret",nil];
       
    72             customHats = [[NSArray alloc] initWithObjects:@"NoHat",@"NoHat",@"NoHat",@"NoHat",@"NoHat",@"NoHat",@"NoHat",@"NoHat",nil];
       
    73             flag = @"hedgewars";
       
    74             grave = @"Statue";
       
    75             voicepack = @"Default";
       
    76             fort = @"Plane";
       
    77             break;
       
    78         case 1:  // ninjas
       
    79             customNames = [[NSArray alloc] initWithObjects:@"Shinobi",@"Ukemi",@"Godai",@"Ninpo",@"Tatsujin",@"Arashi",@"Bushi",@"Itami",nil];
       
    80             customHats = [[NSArray alloc] initWithObjects:@"NinjaFull",@"NinjaStraight",@"NinjaTriangle",@"NinjaFull",@"NinjaStraight",
       
    81                           @"NinjaTriangle",@"NinjaFull",@"NinjaTriangle",nil];
       
    82             flag = @"japan";
       
    83             grave = @"bp2";
       
    84             voicepack = @"Singer";
       
    85             fort = @"Wood";
       
    86             break;
       
    87         case 2: // pirates
       
    88             customNames = [[NSArray alloc] initWithObjects:@"Toothless Wayne",@"Long-nose Kidd",@"Eye-patch Jim",@"Rackham Blood",@"One-eyed Ayee",
       
    89                            @"Dirty Ben",@"Morris",@"Cruise Seymour",nil];
       
    90             customHats = [[NSArray alloc] initWithObjects:@"pirate_jack_bandana",@"pirate_jack",@"dwarf",@"pirate_jack_bandana",@"pirate_jack",
       
    91                           @"dwarf",@"pirate_jack_bandana",@"pirate_jack",nil];
       
    92             flag = @"cm_pirate";
       
    93             grave = @"chest";
       
    94             voicepack = @"Pirate";
       
    95             fort = @"Hydrant";
       
    96             break;
       
    97         case 3: // robots
       
    98             customNames = [[NSArray alloc] initWithObjects:@"HAL",@"R2-D2",@"Wall-E",@"Robocop",@"Optimus Prime",@"Terminator",@"C-3PO",@"KITT",nil];
       
    99             customHats = [[NSArray alloc] initWithObjects:@"cyborg1",@"cyborg2",@"cyborg1",@"cyborg2",@"cyborg1",@"cyborg2",@"cyborg1",
       
   100                           @"cyborg2",nil];
       
   101             flag = @"cm_binary";
       
   102             grave = @"Rip";
       
   103             voicepack = @"Robot";
       
   104             fort = @"UFO";
       
   105             break;
       
   106     }
       
   107 
       
   108     NSMutableArray *hedgehogs = [[NSMutableArray alloc] initWithCapacity:HW_getMaxNumberOfHogs()];
    67     for (int i = 0; i < HW_getMaxNumberOfHogs(); i++) {
   109     for (int i = 0; i < HW_getMaxNumberOfHogs(); i++) {
    68         NSString *hogName = [[NSString alloc] initWithFormat:@"hedgehog %d",i];
       
    69         NSDictionary *hog = [[NSDictionary alloc] initWithObjectsAndKeys:
   110         NSDictionary *hog = [[NSDictionary alloc] initWithObjectsAndKeys:
    70                              [NSNumber numberWithInt:0],@"level",
   111                              [NSNumber numberWithInt:(shouldAITakeOver ? 4 : 0)],@"level",
    71                              hogName,@"hogname",
   112                              [customNames objectAtIndex:i],@"hogname",
    72                              @"NoHat",@"hat",
   113                              [customHats objectAtIndex:i],@"hat",
    73                              nil];
   114                              nil];
    74         [hogName release];
       
    75         [hedgehogs addObject:hog];
   115         [hedgehogs addObject:hog];
    76         [hog release];
   116         [hog release];
    77     }
   117     }
       
   118     [customHats release];
       
   119     [customNames release];
    78 
   120 
    79     NSDictionary *theTeam = [[NSDictionary alloc] initWithObjectsAndKeys:
   121     NSDictionary *theTeam = [[NSDictionary alloc] initWithObjectsAndKeys:
    80                              @"0",@"hash",
   122                              @"0",@"hash",
    81                              @"Statue",@"grave",
   123                              grave,@"grave",
    82                              @"Plane",@"fort",
   124                              fort,@"fort",
    83                              @"Default",@"voicepack",
   125                              voicepack,@"voicepack",
    84                              @"hedgewars",@"flag",
   126                              flag,@"flag",
    85                              hedgehogs,@"hedgehogs",
   127                              hedgehogs,@"hedgehogs",
    86                              nil];
   128                              nil];
    87     [hedgehogs release];
   129     [hedgehogs release];
    88 
   130 
    89     NSString *teamFile = [[NSString alloc] initWithFormat:@"%@/%@.plist", teamsDirectory, nameWithoutExt];
   131     NSString *teamFile = [[NSString alloc] initWithFormat:@"%@/%@.plist", teamsDirectory, nameWithoutExt];
   115             qt = [[NSString alloc] initWithBytes:AMMOLINE_DEFAULT_QT length:ammolineSize encoding:NSUTF8StringEncoding];
   157             qt = [[NSString alloc] initWithBytes:AMMOLINE_DEFAULT_QT length:ammolineSize encoding:NSUTF8StringEncoding];
   116             prob = [[NSString alloc] initWithBytes:AMMOLINE_DEFAULT_PROB length:ammolineSize encoding:NSUTF8StringEncoding];
   158             prob = [[NSString alloc] initWithBytes:AMMOLINE_DEFAULT_PROB length:ammolineSize encoding:NSUTF8StringEncoding];
   117             delay = [[NSString alloc] initWithBytes:AMMOLINE_DEFAULT_DELAY length:ammolineSize encoding:NSUTF8StringEncoding];
   159             delay = [[NSString alloc] initWithBytes:AMMOLINE_DEFAULT_DELAY length:ammolineSize encoding:NSUTF8StringEncoding];
   118             crate = [[NSString alloc] initWithBytes:AMMOLINE_DEFAULT_CRATE length:ammolineSize encoding:NSUTF8StringEncoding];
   160             crate = [[NSString alloc] initWithBytes:AMMOLINE_DEFAULT_CRATE length:ammolineSize encoding:NSUTF8StringEncoding];
   119             break;
   161             break;
   120         case 1: //crazy
   162         case 1:  //crazy
   121             qt = [[NSString alloc] initWithBytes:AMMOLINE_CRAZY_QT length:ammolineSize encoding:NSUTF8StringEncoding];
   163             qt = [[NSString alloc] initWithBytes:AMMOLINE_CRAZY_QT length:ammolineSize encoding:NSUTF8StringEncoding];
   122             prob = [[NSString alloc] initWithBytes:AMMOLINE_CRAZY_PROB length:ammolineSize encoding:NSUTF8StringEncoding];
   164             prob = [[NSString alloc] initWithBytes:AMMOLINE_CRAZY_PROB length:ammolineSize encoding:NSUTF8StringEncoding];
   123             delay = [[NSString alloc] initWithBytes:AMMOLINE_CRAZY_DELAY length:ammolineSize encoding:NSUTF8StringEncoding];
   165             delay = [[NSString alloc] initWithBytes:AMMOLINE_CRAZY_DELAY length:ammolineSize encoding:NSUTF8StringEncoding];
   124             crate = [[NSString alloc] initWithBytes:AMMOLINE_CRAZY_CRATE length:ammolineSize encoding:NSUTF8StringEncoding];
   166             crate = [[NSString alloc] initWithBytes:AMMOLINE_CRAZY_CRATE length:ammolineSize encoding:NSUTF8StringEncoding];
   125             break;
   167             break;
   126         case 2: //pro mode
   168         case 2:  //pro mode
   127             qt = [[NSString alloc] initWithBytes:AMMOLINE_PROMODE_QT length:ammolineSize encoding:NSUTF8StringEncoding];
   169             qt = [[NSString alloc] initWithBytes:AMMOLINE_PROMODE_QT length:ammolineSize encoding:NSUTF8StringEncoding];
   128             prob = [[NSString alloc] initWithBytes:AMMOLINE_PROMODE_PROB length:ammolineSize encoding:NSUTF8StringEncoding];
   170             prob = [[NSString alloc] initWithBytes:AMMOLINE_PROMODE_PROB length:ammolineSize encoding:NSUTF8StringEncoding];
   129             delay = [[NSString alloc] initWithBytes:AMMOLINE_PROMODE_DELAY length:ammolineSize encoding:NSUTF8StringEncoding];
   171             delay = [[NSString alloc] initWithBytes:AMMOLINE_PROMODE_DELAY length:ammolineSize encoding:NSUTF8StringEncoding];
   130             crate = [[NSString alloc] initWithBytes:AMMOLINE_PROMODE_CRATE length:ammolineSize encoding:NSUTF8StringEncoding];
   172             crate = [[NSString alloc] initWithBytes:AMMOLINE_PROMODE_CRATE length:ammolineSize encoding:NSUTF8StringEncoding];
   131             break;
   173             break;
   132         case 3: //shoppa
   174         case 3:  //shoppa
   133             qt = [[NSString alloc] initWithBytes:AMMOLINE_SHOPPA_QT length:ammolineSize encoding:NSUTF8StringEncoding];
   175             qt = [[NSString alloc] initWithBytes:AMMOLINE_SHOPPA_QT length:ammolineSize encoding:NSUTF8StringEncoding];
   134             prob = [[NSString alloc] initWithBytes:AMMOLINE_SHOPPA_PROB length:ammolineSize encoding:NSUTF8StringEncoding];
   176             prob = [[NSString alloc] initWithBytes:AMMOLINE_SHOPPA_PROB length:ammolineSize encoding:NSUTF8StringEncoding];
   135             delay = [[NSString alloc] initWithBytes:AMMOLINE_SHOPPA_DELAY length:ammolineSize encoding:NSUTF8StringEncoding];
   177             delay = [[NSString alloc] initWithBytes:AMMOLINE_SHOPPA_DELAY length:ammolineSize encoding:NSUTF8StringEncoding];
   136             crate = [[NSString alloc] initWithBytes:AMMOLINE_SHOPPA_CRATE length:ammolineSize encoding:NSUTF8StringEncoding];
   178             crate = [[NSString alloc] initWithBytes:AMMOLINE_SHOPPA_CRATE length:ammolineSize encoding:NSUTF8StringEncoding];
   137             break;
   179             break;
   138         case 4: //clean slate
   180         case 4:  //clean slate
   139             qt = [[NSString alloc] initWithBytes:AMMOLINE_CLEAN_QT length:ammolineSize encoding:NSUTF8StringEncoding];
   181             qt = [[NSString alloc] initWithBytes:AMMOLINE_CLEAN_QT length:ammolineSize encoding:NSUTF8StringEncoding];
   140             prob = [[NSString alloc] initWithBytes:AMMOLINE_CLEAN_PROB length:ammolineSize encoding:NSUTF8StringEncoding];
   182             prob = [[NSString alloc] initWithBytes:AMMOLINE_CLEAN_PROB length:ammolineSize encoding:NSUTF8StringEncoding];
   141             delay = [[NSString alloc] initWithBytes:AMMOLINE_CLEAN_DELAY length:ammolineSize encoding:NSUTF8StringEncoding];
   183             delay = [[NSString alloc] initWithBytes:AMMOLINE_CLEAN_DELAY length:ammolineSize encoding:NSUTF8StringEncoding];
   142             crate = [[NSString alloc] initWithBytes:AMMOLINE_CLEAN_CRATE length:ammolineSize encoding:NSUTF8StringEncoding];
   184             crate = [[NSString alloc] initWithBytes:AMMOLINE_CLEAN_CRATE length:ammolineSize encoding:NSUTF8StringEncoding];
   143             break;
   185             break;
   144         case 5: //minefield
   186         case 5:  //minefield
   145             qt = [[NSString alloc] initWithBytes:AMMOLINE_MINES_QT length:ammolineSize encoding:NSUTF8StringEncoding];
   187             qt = [[NSString alloc] initWithBytes:AMMOLINE_MINES_QT length:ammolineSize encoding:NSUTF8StringEncoding];
   146             prob = [[NSString alloc] initWithBytes:AMMOLINE_MINES_PROB length:ammolineSize encoding:NSUTF8StringEncoding];
   188             prob = [[NSString alloc] initWithBytes:AMMOLINE_MINES_PROB length:ammolineSize encoding:NSUTF8StringEncoding];
   147             delay = [[NSString alloc] initWithBytes:AMMOLINE_MINES_DELAY length:ammolineSize encoding:NSUTF8StringEncoding];
   189             delay = [[NSString alloc] initWithBytes:AMMOLINE_MINES_DELAY length:ammolineSize encoding:NSUTF8StringEncoding];
   148             crate = [[NSString alloc] initWithBytes:AMMOLINE_MINES_CRATE length:ammolineSize encoding:NSUTF8StringEncoding];
   190             crate = [[NSString alloc] initWithBytes:AMMOLINE_MINES_CRATE length:ammolineSize encoding:NSUTF8StringEncoding];
   149             break;
   191             break;
   150         case 6: //thinking with portals
   192         case 6:  //thinking with portals
   151             qt = [[NSString alloc] initWithBytes:AMMOLINE_PORTALS_QT length:ammolineSize encoding:NSUTF8StringEncoding];
   193             qt = [[NSString alloc] initWithBytes:AMMOLINE_PORTALS_QT length:ammolineSize encoding:NSUTF8StringEncoding];
   152             prob = [[NSString alloc] initWithBytes:AMMOLINE_PORTALS_PROB length:ammolineSize encoding:NSUTF8StringEncoding];
   194             prob = [[NSString alloc] initWithBytes:AMMOLINE_PORTALS_PROB length:ammolineSize encoding:NSUTF8StringEncoding];
   153             delay = [[NSString alloc] initWithBytes:AMMOLINE_PORTALS_DELAY length:ammolineSize encoding:NSUTF8StringEncoding];
   195             delay = [[NSString alloc] initWithBytes:AMMOLINE_PORTALS_DELAY length:ammolineSize encoding:NSUTF8StringEncoding];
   154             crate = [[NSString alloc] initWithBytes:AMMOLINE_PORTALS_CRATE length:ammolineSize encoding:NSUTF8StringEncoding];
   196             crate = [[NSString alloc] initWithBytes:AMMOLINE_PORTALS_CRATE length:ammolineSize encoding:NSUTF8StringEncoding];
   155             break;
   197             break;
   195     for (int i = 0; i < [mods count]; i++)
   237     for (int i = 0; i < [mods count]; i++)
   196         [gamemodArray addObject:[NSNumber numberWithBool:NO]];
   238         [gamemodArray addObject:[NSNumber numberWithBool:NO]];
   197     [mods release];
   239     [mods release];
   198 
   240 
   199     switch (type) {
   241     switch (type) {
   200         case 0: // default
   242         default: // default
   201             [gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]];
   243             [gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]];
   202             break;
   244             break;
   203         case 1: // pro mode
   245         case 1:  // pro mode
   204             [basicArray replaceObjectAtIndex:2 withObject:[NSNumber numberWithInt:15]];
   246             [basicArray replaceObjectAtIndex:2 withObject:[NSNumber numberWithInt:15]];
   205             [basicArray replaceObjectAtIndex:7 withObject:[NSNumber numberWithInt:0]];
   247             [basicArray replaceObjectAtIndex:7 withObject:[NSNumber numberWithInt:0]];
   206             [basicArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithInt:0]];
   248             [basicArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithInt:0]];
   207             [gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]];
   249             [gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]];
   208             [gamemodArray replaceObjectAtIndex:14 withObject:[NSNumber numberWithBool:YES]];
   250             [gamemodArray replaceObjectAtIndex:14 withObject:[NSNumber numberWithBool:YES]];
   209             break;
   251             break;
   210         case 2: // shoppa
   252         case 2:  // shoppa
   211             [basicArray replaceObjectAtIndex:2 withObject:[NSNumber numberWithInt:30]];
   253             [basicArray replaceObjectAtIndex:2 withObject:[NSNumber numberWithInt:30]];
   212             [basicArray replaceObjectAtIndex:3 withObject:[NSNumber numberWithInt:50]];
   254             [basicArray replaceObjectAtIndex:3 withObject:[NSNumber numberWithInt:50]];
   213             [basicArray replaceObjectAtIndex:7 withObject:[NSNumber numberWithInt:1]];
   255             [basicArray replaceObjectAtIndex:7 withObject:[NSNumber numberWithInt:1]];
   214             [basicArray replaceObjectAtIndex:8 withObject:[NSNumber numberWithInt:0]];
   256             [basicArray replaceObjectAtIndex:8 withObject:[NSNumber numberWithInt:0]];
   215             [basicArray replaceObjectAtIndex:9 withObject:[NSNumber numberWithInt:25]];
   257             [basicArray replaceObjectAtIndex:9 withObject:[NSNumber numberWithInt:25]];
   220             [gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]];
   262             [gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]];
   221             [gamemodArray replaceObjectAtIndex:14 withObject:[NSNumber numberWithBool:YES]];
   263             [gamemodArray replaceObjectAtIndex:14 withObject:[NSNumber numberWithBool:YES]];
   222             [gamemodArray replaceObjectAtIndex:15 withObject:[NSNumber numberWithBool:YES]];
   264             [gamemodArray replaceObjectAtIndex:15 withObject:[NSNumber numberWithBool:YES]];
   223             [gamemodArray replaceObjectAtIndex:19 withObject:[NSNumber numberWithBool:YES]];
   265             [gamemodArray replaceObjectAtIndex:19 withObject:[NSNumber numberWithBool:YES]];
   224             break;
   266             break;
   225         case 3: // clean slate
   267         case 3:  // clean slate
   226             [gamemodArray replaceObjectAtIndex:6 withObject:[NSNumber numberWithBool:YES]];
   268             [gamemodArray replaceObjectAtIndex:6 withObject:[NSNumber numberWithBool:YES]];
   227             [gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]];
   269             [gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]];
   228             [gamemodArray replaceObjectAtIndex:18 withObject:[NSNumber numberWithBool:YES]];
   270             [gamemodArray replaceObjectAtIndex:18 withObject:[NSNumber numberWithBool:YES]];
   229             [gamemodArray replaceObjectAtIndex:19 withObject:[NSNumber numberWithBool:YES]];
   271             [gamemodArray replaceObjectAtIndex:19 withObject:[NSNumber numberWithBool:YES]];
   230             break;
   272             break;
   231         case 4: // minefield
   273         case 4:  // minefield
   232             [basicArray replaceObjectAtIndex:0 withObject:[NSNumber numberWithInt:50]];
   274             [basicArray replaceObjectAtIndex:0 withObject:[NSNumber numberWithInt:50]];
   233             [basicArray replaceObjectAtIndex:2 withObject:[NSNumber numberWithInt:30]];
   275             [basicArray replaceObjectAtIndex:2 withObject:[NSNumber numberWithInt:30]];
   234             [basicArray replaceObjectAtIndex:7 withObject:[NSNumber numberWithInt:0]];
   276             [basicArray replaceObjectAtIndex:7 withObject:[NSNumber numberWithInt:0]];
   235             [basicArray replaceObjectAtIndex:10 withObject:[NSNumber numberWithInt:0]];
   277             [basicArray replaceObjectAtIndex:10 withObject:[NSNumber numberWithInt:0]];
   236             [basicArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithInt:80]];
   278             [basicArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithInt:80]];
   237             [basicArray replaceObjectAtIndex:13 withObject:[NSNumber numberWithInt:0]];
   279             [basicArray replaceObjectAtIndex:13 withObject:[NSNumber numberWithInt:0]];
   238             [gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]];
   280             [gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]];
   239             [gamemodArray replaceObjectAtIndex:14 withObject:[NSNumber numberWithBool:YES]];
   281             [gamemodArray replaceObjectAtIndex:14 withObject:[NSNumber numberWithBool:YES]];
   240             [gamemodArray replaceObjectAtIndex:15 withObject:[NSNumber numberWithBool:YES]];
   282             [gamemodArray replaceObjectAtIndex:15 withObject:[NSNumber numberWithBool:YES]];
   241             break;
   283             break;
   242         case 5: // barrel mayhem
   284         case 5:  // barrel mayhem
   243             [basicArray replaceObjectAtIndex:2 withObject:[NSNumber numberWithInt:30]];
   285             [basicArray replaceObjectAtIndex:2 withObject:[NSNumber numberWithInt:30]];
   244             [basicArray replaceObjectAtIndex:7 withObject:[NSNumber numberWithInt:0]];
   286             [basicArray replaceObjectAtIndex:7 withObject:[NSNumber numberWithInt:0]];
   245             [basicArray replaceObjectAtIndex:10 withObject:[NSNumber numberWithInt:0]];
   287             [basicArray replaceObjectAtIndex:10 withObject:[NSNumber numberWithInt:0]];
   246             [basicArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithInt:0]];
   288             [basicArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithInt:0]];
   247             [basicArray replaceObjectAtIndex:13 withObject:[NSNumber numberWithInt:40]];
   289             [basicArray replaceObjectAtIndex:13 withObject:[NSNumber numberWithInt:40]];
   248             [gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]];
   290             [gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]];
   249             [gamemodArray replaceObjectAtIndex:14 withObject:[NSNumber numberWithBool:YES]];
   291             [gamemodArray replaceObjectAtIndex:14 withObject:[NSNumber numberWithBool:YES]];
   250             break;
   292             break;
   251         case 6: // tunnel hogs
   293         case 6:  // tunnel hogs
   252             [basicArray replaceObjectAtIndex:2 withObject:[NSNumber numberWithInt:30]];
   294             [basicArray replaceObjectAtIndex:2 withObject:[NSNumber numberWithInt:30]];
   253             [basicArray replaceObjectAtIndex:9 withObject:[NSNumber numberWithInt:3]];
   295             [basicArray replaceObjectAtIndex:9 withObject:[NSNumber numberWithInt:3]];
   254             [basicArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithInt:10]];
   296             [basicArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithInt:10]];
   255             [basicArray replaceObjectAtIndex:12 withObject:[NSNumber numberWithInt:10]];
   297             [basicArray replaceObjectAtIndex:12 withObject:[NSNumber numberWithInt:10]];
   256             [basicArray replaceObjectAtIndex:13 withObject:[NSNumber numberWithInt:10]];
   298             [basicArray replaceObjectAtIndex:13 withObject:[NSNumber numberWithInt:10]];
   258             [gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]];
   300             [gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]];
   259             [gamemodArray replaceObjectAtIndex:14 withObject:[NSNumber numberWithBool:YES]];
   301             [gamemodArray replaceObjectAtIndex:14 withObject:[NSNumber numberWithBool:YES]];
   260             [gamemodArray replaceObjectAtIndex:15 withObject:[NSNumber numberWithBool:YES]];
   302             [gamemodArray replaceObjectAtIndex:15 withObject:[NSNumber numberWithBool:YES]];
   261             [gamemodArray replaceObjectAtIndex:16 withObject:[NSNumber numberWithBool:YES]];
   303             [gamemodArray replaceObjectAtIndex:16 withObject:[NSNumber numberWithBool:YES]];
   262             break;
   304             break;
   263         case 7: // fort mode
   305         case 7:  // fort mode
   264             [basicArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithInt:0]];
   306             [basicArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithInt:0]];
   265             [basicArray replaceObjectAtIndex:13 withObject:[NSNumber numberWithInt:0]];
   307             [basicArray replaceObjectAtIndex:13 withObject:[NSNumber numberWithInt:0]];
   266             [gamemodArray replaceObjectAtIndex:2 withObject:[NSNumber numberWithBool:YES]];
   308             [gamemodArray replaceObjectAtIndex:2 withObject:[NSNumber numberWithBool:YES]];
   267             [gamemodArray replaceObjectAtIndex:3 withObject:[NSNumber numberWithBool:YES]];
   309             [gamemodArray replaceObjectAtIndex:3 withObject:[NSNumber numberWithBool:YES]];
   268             [gamemodArray replaceObjectAtIndex:10 withObject:[NSNumber numberWithBool:YES]];
   310             [gamemodArray replaceObjectAtIndex:10 withObject:[NSNumber numberWithBool:YES]];
   269             [gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]];
   311             [gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]];
   270             break;
   312             break;
   271         case 8: // timeless
   313         case 8:  // timeless
   272             [basicArray replaceObjectAtIndex:2 withObject:[NSNumber numberWithInt:100]];
   314             [basicArray replaceObjectAtIndex:2 withObject:[NSNumber numberWithInt:100]];
   273             [basicArray replaceObjectAtIndex:4 withObject:[NSNumber numberWithInt:0]];
   315             [basicArray replaceObjectAtIndex:4 withObject:[NSNumber numberWithInt:0]];
   274             [basicArray replaceObjectAtIndex:5 withObject:[NSNumber numberWithInt:0]];
   316             [basicArray replaceObjectAtIndex:5 withObject:[NSNumber numberWithInt:0]];
   275             [basicArray replaceObjectAtIndex:9 withObject:[NSNumber numberWithInt:30]];
   317             [basicArray replaceObjectAtIndex:9 withObject:[NSNumber numberWithInt:30]];
   276             [basicArray replaceObjectAtIndex:10 withObject:[NSNumber numberWithInt:5]];
   318             [basicArray replaceObjectAtIndex:10 withObject:[NSNumber numberWithInt:5]];
   277             [basicArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithInt:3]];
   319             [basicArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithInt:3]];
   278             [basicArray replaceObjectAtIndex:12 withObject:[NSNumber numberWithInt:10]];
   320             [basicArray replaceObjectAtIndex:12 withObject:[NSNumber numberWithInt:10]];
   279             [gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]];
   321             [gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]];
   280             [gamemodArray replaceObjectAtIndex:20 withObject:[NSNumber numberWithBool:YES]];
   322             [gamemodArray replaceObjectAtIndex:20 withObject:[NSNumber numberWithBool:YES]];
   281             break;
   323             break;
   282         case 9: // thinking with portals
   324         case 9:  // thinking with portals
   283             [basicArray replaceObjectAtIndex:7 withObject:[NSNumber numberWithInt:2]];
   325             [basicArray replaceObjectAtIndex:7 withObject:[NSNumber numberWithInt:2]];
   284             [basicArray replaceObjectAtIndex:8 withObject:[NSNumber numberWithInt:25]];
   326             [basicArray replaceObjectAtIndex:8 withObject:[NSNumber numberWithInt:25]];
   285             [basicArray replaceObjectAtIndex:10 withObject:[NSNumber numberWithInt:4]];
   327             [basicArray replaceObjectAtIndex:10 withObject:[NSNumber numberWithInt:4]];
   286             [basicArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithInt:5]];
   328             [basicArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithInt:5]];
   287             [basicArray replaceObjectAtIndex:13 withObject:[NSNumber numberWithInt:5]];
   329             [basicArray replaceObjectAtIndex:13 withObject:[NSNumber numberWithInt:5]];
   288             [gamemodArray replaceObjectAtIndex:9 withObject:[NSNumber numberWithBool:YES]];
   330             [gamemodArray replaceObjectAtIndex:9 withObject:[NSNumber numberWithBool:YES]];
   289             [gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]];
   331             [gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]];
   290             break;
   332             break;
   291         case 10:// king mode
   333         case 10: // king mode
   292             [gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]];
   334             [gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]];
   293             [gamemodArray replaceObjectAtIndex:12 withObject:[NSNumber numberWithBool:YES]];
   335             [gamemodArray replaceObjectAtIndex:12 withObject:[NSNumber numberWithBool:YES]];
   294             break;
       
   295         default:
       
   296             DLog(@"Impossible");
       
   297             break;
   336             break;
   298     }
   337     }
   299 
   338 
   300     NSMutableDictionary *theScheme = [[NSMutableDictionary alloc] initWithObjectsAndKeys:
   339     NSMutableDictionary *theScheme = [[NSMutableDictionary alloc] initWithObjectsAndKeys:
   301                                       basicArray,@"basic",
   340                                       basicArray,@"basic",