project_files/HedgewarsMobile/Classes/CreationChamber.m
branchios-revival
changeset 11188 3dbea499390d
parent 11187 fa6f6e8b927c
child 11190 d77ffd68e1cd
equal deleted inserted replaced
11187:fa6f6e8b927c 11188:3dbea499390d
    55     // SCHEMES - always overwrite and delete custom ones
    55     // SCHEMES - always overwrite and delete custom ones
    56     if ([[NSFileManager defaultManager] fileExistsAtPath:SCHEMES_DIRECTORY()] == YES)
    56     if ([[NSFileManager defaultManager] fileExistsAtPath:SCHEMES_DIRECTORY()] == YES)
    57         [[NSFileManager defaultManager] removeItemAtPath:SCHEMES_DIRECTORY() error:NULL];
    57         [[NSFileManager defaultManager] removeItemAtPath:SCHEMES_DIRECTORY() error:NULL];
    58     NSArray *schemeNames = [[NSArray alloc] initWithObjects:@"Default",@"Pro Mode",@"Shoppa",@"Clean Slate",
    58     NSArray *schemeNames = [[NSArray alloc] initWithObjects:@"Default",@"Pro Mode",@"Shoppa",@"Clean Slate",
    59                             @"Minefield",@"Barrel Mayhem",@"Tunnel Hogs",@"Fort Mode",@"Timeless",
    59                             @"Minefield",@"Barrel Mayhem",@"Tunnel Hogs",@"Fort Mode",@"Timeless",
    60                             @"Thinking with Portals",@"King Mode",nil];
    60                             @"Thinking with Portals",@"King Mode",@"Construction Mode",nil];
    61     index = 0;
    61     index = 0;
    62     for (NSString *name in schemeNames)
    62     for (NSString *name in schemeNames)
    63         [self createSchemeNamed:name ofType:index++];
    63         [self createSchemeNamed:name ofType:index++];
    64     [schemeNames release];
    64     [schemeNames release];
    65 
    65 
    66     // WEAPONS - always overwrite as merge is not needed (missing weaps are 0ed automatically)
    66     // WEAPONS - always overwrite as merge is not needed (missing weaps are 0ed automatically)
    67     NSArray *weaponNames = [[NSArray alloc] initWithObjects:@"Default",@"Crazy",@"Pro Mode",@"Shoppa",@"Clean Slate",
    67     NSArray *weaponNames = [[NSArray alloc] initWithObjects:@"Default",@"Crazy",@"Pro Mode",@"Shoppa",@"Clean Slate",
    68                             @"Minefield",@"Thinking with Portals",@"One of Everything",@"Highlander",nil];
    68                             @"Minefield",@"Thinking with Portals",@"One of Everything",@"Highlander",@"Construction Mode",nil];
    69     index = 0;
    69     index = 0;
    70     for (NSString *name in weaponNames)
    70     for (NSString *name in weaponNames)
    71         [self createWeaponNamed:name ofType:index++];
    71         [self createWeaponNamed:name ofType:index++];
    72     [weaponNames release];
    72     [weaponNames release];
    73 }
    73 }
   251             qt = [[NSString alloc] initWithBytes:AMMOLINE_HIGHLANDER_QT length:ammolineSize encoding:NSUTF8StringEncoding];
   251             qt = [[NSString alloc] initWithBytes:AMMOLINE_HIGHLANDER_QT length:ammolineSize encoding:NSUTF8StringEncoding];
   252             prob = [[NSString alloc] initWithBytes:AMMOLINE_HIGHLANDER_PROB length:ammolineSize encoding:NSUTF8StringEncoding];
   252             prob = [[NSString alloc] initWithBytes:AMMOLINE_HIGHLANDER_PROB length:ammolineSize encoding:NSUTF8StringEncoding];
   253             delay = [[NSString alloc] initWithBytes:AMMOLINE_HIGHLANDER_DELAY length:ammolineSize encoding:NSUTF8StringEncoding];
   253             delay = [[NSString alloc] initWithBytes:AMMOLINE_HIGHLANDER_DELAY length:ammolineSize encoding:NSUTF8StringEncoding];
   254             crate = [[NSString alloc] initWithBytes:AMMOLINE_HIGHLANDER_CRATE length:ammolineSize encoding:NSUTF8StringEncoding];
   254             crate = [[NSString alloc] initWithBytes:AMMOLINE_HIGHLANDER_CRATE length:ammolineSize encoding:NSUTF8StringEncoding];
   255             break;
   255             break;
       
   256         case 9:  //construction mode
       
   257             qt = [[NSString alloc] initWithBytes:AMMOLINE_CONSTRUCTION_QT length:ammolineSize encoding:NSUTF8StringEncoding];
       
   258             prob = [[NSString alloc] initWithBytes:AMMOLINE_CONSTRUCTION_PROB length:ammolineSize encoding:NSUTF8StringEncoding];
       
   259             delay = [[NSString alloc] initWithBytes:AMMOLINE_CONSTRUCTION_DELAY length:ammolineSize encoding:NSUTF8StringEncoding];
       
   260             crate = [[NSString alloc] initWithBytes:AMMOLINE_CONSTRUCTION_CRATE length:ammolineSize encoding:NSUTF8StringEncoding];
       
   261             break;
   256     }
   262     }
   257 
   263 
   258     NSDictionary *theWeapon = [[NSDictionary alloc] initWithObjectsAndKeys: qt,@"ammostore_initialqt",
   264     NSDictionary *theWeapon = [[NSDictionary alloc] initWithObjectsAndKeys: qt,@"ammostore_initialqt",
   259                                prob,@"ammostore_probability", delay,@"ammostore_delay", crate,@"ammostore_crate", nil];
   265                                prob,@"ammostore_probability", delay,@"ammostore_delay", crate,@"ammostore_crate", nil];
   260     [qt release];
   266     [qt release];
   390             break;
   396             break;
   391         case 10: // king mode
   397         case 10: // king mode
   392             [gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]];
   398             [gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]];
   393             [gamemodArray replaceObjectAtIndex:12 withObject:[NSNumber numberWithBool:YES]];
   399             [gamemodArray replaceObjectAtIndex:12 withObject:[NSNumber numberWithBool:YES]];
   394             break;
   400             break;
       
   401         case 11: // construction mode
       
   402             [basicArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithInt:0]];
       
   403             [basicArray replaceObjectAtIndex:13 withObject:[NSNumber numberWithInt:0]];
       
   404             [gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]];
       
   405             [gamemodArray replaceObjectAtIndex:15 withObject:[NSNumber numberWithBool:YES]];
       
   406             [gamemodArray replaceObjectAtIndex:16 withObject:[NSNumber numberWithBool:YES]];
       
   407             [gamemodArray replaceObjectAtIndex:18 withObject:[NSNumber numberWithBool:YES]];
       
   408             [gamemodArray replaceObjectAtIndex:20 withObject:[NSNumber numberWithBool:YES]];
       
   409             break;
   395     }
   410     }
   396 
   411 
   397     NSMutableDictionary *theScheme = [[NSMutableDictionary alloc] initWithObjectsAndKeys:
   412     NSMutableDictionary *theScheme = [[NSMutableDictionary alloc] initWithObjectsAndKeys:
   398                                       basicArray,@"basic",
   413                                       basicArray,@"basic",
   399                                       gamemodArray,@"gamemod",
   414                                       gamemodArray,@"gamemod",