project_files/HedgewarsMobile/Classes/CreationChamber.m
branchqmlfrontend
changeset 11408 b894922d58cc
parent 11287 9c021eadd374
child 12877 00215a7ec5f5
equal deleted inserted replaced
11076:fcbdee9cdd74 11408:b894922d58cc
    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",nil];
    68                             @"Minefield",@"Thinking with Portals",@"One of Everything",@"Highlander",@"Construction Mode",@"Shoppa Pro",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 }
   239             qt = [[NSString alloc] initWithBytes:AMMOLINE_PORTALS_QT length:ammolineSize encoding:NSUTF8StringEncoding];
   239             qt = [[NSString alloc] initWithBytes:AMMOLINE_PORTALS_QT length:ammolineSize encoding:NSUTF8StringEncoding];
   240             prob = [[NSString alloc] initWithBytes:AMMOLINE_PORTALS_PROB length:ammolineSize encoding:NSUTF8StringEncoding];
   240             prob = [[NSString alloc] initWithBytes:AMMOLINE_PORTALS_PROB length:ammolineSize encoding:NSUTF8StringEncoding];
   241             delay = [[NSString alloc] initWithBytes:AMMOLINE_PORTALS_DELAY length:ammolineSize encoding:NSUTF8StringEncoding];
   241             delay = [[NSString alloc] initWithBytes:AMMOLINE_PORTALS_DELAY length:ammolineSize encoding:NSUTF8StringEncoding];
   242             crate = [[NSString alloc] initWithBytes:AMMOLINE_PORTALS_CRATE length:ammolineSize encoding:NSUTF8StringEncoding];
   242             crate = [[NSString alloc] initWithBytes:AMMOLINE_PORTALS_CRATE length:ammolineSize encoding:NSUTF8StringEncoding];
   243             break;
   243             break;
       
   244         case 7:  //one of everything
       
   245             qt = [[NSString alloc] initWithBytes:AMMOLINE_ONEEVERY_QT length:ammolineSize encoding:NSUTF8StringEncoding];
       
   246             prob = [[NSString alloc] initWithBytes:AMMOLINE_ONEEVERY_PROB length:ammolineSize encoding:NSUTF8StringEncoding];
       
   247             delay = [[NSString alloc] initWithBytes:AMMOLINE_ONEEVERY_DELAY length:ammolineSize encoding:NSUTF8StringEncoding];
       
   248             crate = [[NSString alloc] initWithBytes:AMMOLINE_ONEEVERY_CRATE length:ammolineSize encoding:NSUTF8StringEncoding];
       
   249             break;
       
   250         case 8:  //highlander
       
   251             qt = [[NSString alloc] initWithBytes:AMMOLINE_HIGHLANDER_QT 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];
       
   254             crate = [[NSString alloc] initWithBytes:AMMOLINE_HIGHLANDER_CRATE length:ammolineSize encoding:NSUTF8StringEncoding];
       
   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;
       
   262         case 10:  //shoppa pro
       
   263             qt = [[NSString alloc] initWithBytes:AMMOLINE_SHOPPAPRO_QT length:ammolineSize encoding:NSUTF8StringEncoding];
       
   264             prob = [[NSString alloc] initWithBytes:AMMOLINE_SHOPPAPRO_PROB length:ammolineSize encoding:NSUTF8StringEncoding];
       
   265             delay = [[NSString alloc] initWithBytes:AMMOLINE_SHOPPAPRO_DELAY length:ammolineSize encoding:NSUTF8StringEncoding];
       
   266             crate = [[NSString alloc] initWithBytes:AMMOLINE_SHOPPAPRO_CRATE length:ammolineSize encoding:NSUTF8StringEncoding];
       
   267             break;
   244     }
   268     }
   245 
   269 
   246     NSDictionary *theWeapon = [[NSDictionary alloc] initWithObjectsAndKeys: qt,@"ammostore_initialqt",
   270     NSDictionary *theWeapon = [[NSDictionary alloc] initWithObjectsAndKeys: qt,@"ammostore_initialqt",
   247                                prob,@"ammostore_probability", delay,@"ammostore_delay", crate,@"ammostore_crate", nil];
   271                                prob,@"ammostore_probability", delay,@"ammostore_delay", crate,@"ammostore_crate", nil];
   248     [qt release];
   272     [qt release];
   301             [basicArray replaceObjectAtIndex:7 withObject:[NSNumber numberWithInt:1]];
   325             [basicArray replaceObjectAtIndex:7 withObject:[NSNumber numberWithInt:1]];
   302             [basicArray replaceObjectAtIndex:8 withObject:[NSNumber numberWithInt:0]];
   326             [basicArray replaceObjectAtIndex:8 withObject:[NSNumber numberWithInt:0]];
   303             [basicArray replaceObjectAtIndex:9 withObject:[NSNumber numberWithInt:25]];
   327             [basicArray replaceObjectAtIndex:9 withObject:[NSNumber numberWithInt:25]];
   304             [basicArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithInt:0]];
   328             [basicArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithInt:0]];
   305             [basicArray replaceObjectAtIndex:13 withObject:[NSNumber numberWithInt:0]];
   329             [basicArray replaceObjectAtIndex:13 withObject:[NSNumber numberWithInt:0]];
       
   330             [basicArray replaceObjectAtIndex:15 withObject:[NSNumber numberWithInt:8]];
   306             [gamemodArray replaceObjectAtIndex:1 withObject:[NSNumber numberWithBool:YES]];
   331             [gamemodArray replaceObjectAtIndex:1 withObject:[NSNumber numberWithBool:YES]];
   307             [gamemodArray replaceObjectAtIndex:2 withObject:[NSNumber numberWithBool:YES]];
   332             [gamemodArray replaceObjectAtIndex:2 withObject:[NSNumber numberWithBool:YES]];
   308             [gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]];
   333             [gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]];
   309             [gamemodArray replaceObjectAtIndex:14 withObject:[NSNumber numberWithBool:YES]];
   334             [gamemodArray replaceObjectAtIndex:14 withObject:[NSNumber numberWithBool:YES]];
   310             [gamemodArray replaceObjectAtIndex:15 withObject:[NSNumber numberWithBool:YES]];
   335             [gamemodArray replaceObjectAtIndex:15 withObject:[NSNumber numberWithBool:YES]];
   340             [basicArray replaceObjectAtIndex:2 withObject:[NSNumber numberWithInt:30]];
   365             [basicArray replaceObjectAtIndex:2 withObject:[NSNumber numberWithInt:30]];
   341             [basicArray replaceObjectAtIndex:9 withObject:[NSNumber numberWithInt:3]];
   366             [basicArray replaceObjectAtIndex:9 withObject:[NSNumber numberWithInt:3]];
   342             [basicArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithInt:10]];
   367             [basicArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithInt:10]];
   343             [basicArray replaceObjectAtIndex:12 withObject:[NSNumber numberWithInt:10]];
   368             [basicArray replaceObjectAtIndex:12 withObject:[NSNumber numberWithInt:10]];
   344             [basicArray replaceObjectAtIndex:13 withObject:[NSNumber numberWithInt:10]];
   369             [basicArray replaceObjectAtIndex:13 withObject:[NSNumber numberWithInt:10]];
       
   370             [basicArray replaceObjectAtIndex:15 withObject:[NSNumber numberWithInt:4]];
   345             [gamemodArray replaceObjectAtIndex:2 withObject:[NSNumber numberWithBool:YES]];
   371             [gamemodArray replaceObjectAtIndex:2 withObject:[NSNumber numberWithBool:YES]];
   346             [gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]];
   372             [gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]];
   347             [gamemodArray replaceObjectAtIndex:14 withObject:[NSNumber numberWithBool:YES]];
   373             [gamemodArray replaceObjectAtIndex:14 withObject:[NSNumber numberWithBool:YES]];
   348             [gamemodArray replaceObjectAtIndex:15 withObject:[NSNumber numberWithBool:YES]];
   374             [gamemodArray replaceObjectAtIndex:15 withObject:[NSNumber numberWithBool:YES]];
   349             [gamemodArray replaceObjectAtIndex:16 withObject:[NSNumber numberWithBool:YES]];
   375             [gamemodArray replaceObjectAtIndex:16 withObject:[NSNumber numberWithBool:YES]];
   371             [basicArray replaceObjectAtIndex:7 withObject:[NSNumber numberWithInt:2]];
   397             [basicArray replaceObjectAtIndex:7 withObject:[NSNumber numberWithInt:2]];
   372             [basicArray replaceObjectAtIndex:8 withObject:[NSNumber numberWithInt:25]];
   398             [basicArray replaceObjectAtIndex:8 withObject:[NSNumber numberWithInt:25]];
   373             [basicArray replaceObjectAtIndex:10 withObject:[NSNumber numberWithInt:4]];
   399             [basicArray replaceObjectAtIndex:10 withObject:[NSNumber numberWithInt:4]];
   374             [basicArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithInt:5]];
   400             [basicArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithInt:5]];
   375             [basicArray replaceObjectAtIndex:13 withObject:[NSNumber numberWithInt:5]];
   401             [basicArray replaceObjectAtIndex:13 withObject:[NSNumber numberWithInt:5]];
       
   402             [basicArray replaceObjectAtIndex:15 withObject:[NSNumber numberWithInt:4]];
   376             [gamemodArray replaceObjectAtIndex:9 withObject:[NSNumber numberWithBool:YES]];
   403             [gamemodArray replaceObjectAtIndex:9 withObject:[NSNumber numberWithBool:YES]];
   377             [gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]];
   404             [gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]];
   378             break;
   405             break;
   379         case 10: // king mode
   406         case 10: // king mode
   380             [gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]];
   407             [gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]];
   381             [gamemodArray replaceObjectAtIndex:12 withObject:[NSNumber numberWithBool:YES]];
   408             [gamemodArray replaceObjectAtIndex:12 withObject:[NSNumber numberWithBool:YES]];
       
   409             break;
       
   410         case 11: // construction mode
       
   411             [basicArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithInt:0]];
       
   412             [basicArray replaceObjectAtIndex:13 withObject:[NSNumber numberWithInt:0]];
       
   413             [gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]];
       
   414             [gamemodArray replaceObjectAtIndex:15 withObject:[NSNumber numberWithBool:YES]];
       
   415             [gamemodArray replaceObjectAtIndex:16 withObject:[NSNumber numberWithBool:YES]];
       
   416             [gamemodArray replaceObjectAtIndex:18 withObject:[NSNumber numberWithBool:YES]];
       
   417             [gamemodArray replaceObjectAtIndex:20 withObject:[NSNumber numberWithBool:YES]];
   382             break;
   418             break;
   383     }
   419     }
   384 
   420 
   385     NSMutableDictionary *theScheme = [[NSMutableDictionary alloc] initWithObjectsAndKeys:
   421     NSMutableDictionary *theScheme = [[NSMutableDictionary alloc] initWithObjectsAndKeys:
   386                                       basicArray,@"basic",
   422                                       basicArray,@"basic",