project_files/HedgewarsMobile/Classes/CreationChamber.m
author antonc27 <antonc27@mail.ru>
Tue, 03 Nov 2015 22:57:01 +0100
branchios-revival
changeset 11287 9c021eadd374
parent 11194 d77ffd68e1cd
child 12877 00215a7ec5f5
permissions -rw-r--r--
- Added 'Air Mines' flag for Scheme Settings
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4281
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
     1
/*
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
     2
 * Hedgewars-iOS, a Hedgewars port for iOS devices
6700
e04da46ee43c the most important commit of the year
koda
parents: 6624
diff changeset
     3
 * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@gmail.com>
4281
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
     4
 *
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License as published by
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
     7
 * the Free Software Foundation; version 2 of the License
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
     8
 *
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    12
 * GNU General Public License for more details.
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    13
 *
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    15
 * along with this program; if not, write to the Free Software
10108
c68cf030eded update FSF address. note: two sdl include files (by Sam Lantinga) still have the old FSF address in their copyright - but I ain't gonna touch their copyright headers
sheepluva
parents: 8835
diff changeset
    16
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA.
4281
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    17
 */
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    18
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    19
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    20
#import "CreationChamber.h"
8835
01bcf9ea68c1 ios compiles again (using an old version of sdl)
koda
parents: 8441
diff changeset
    21
#import "weapons.h"
6832
fae8fd118da9 dates are no more!
koda
parents: 6822
diff changeset
    22
6103
55ecfbf834e3 convert creation chamber functions to class methods
koda
parents: 5984
diff changeset
    23
@implementation CreationChamber
55ecfbf834e3 convert creation chamber functions to class methods
koda
parents: 5984
diff changeset
    24
6865
fe19af8278e6 ios, this method belongs here
koda
parents: 6832
diff changeset
    25
#pragma mark Checking status
fe19af8278e6 ios, this method belongs here
koda
parents: 6832
diff changeset
    26
+(void) createFirstLaunch {
fe19af8278e6 ios, this method belongs here
koda
parents: 6832
diff changeset
    27
    DLog(@"Creating necessary files");
fe19af8278e6 ios, this method belongs here
koda
parents: 6832
diff changeset
    28
    NSInteger index;
fe19af8278e6 ios, this method belongs here
koda
parents: 6832
diff changeset
    29
fe19af8278e6 ios, this method belongs here
koda
parents: 6832
diff changeset
    30
    // SAVES - just delete and overwrite
fe19af8278e6 ios, this method belongs here
koda
parents: 6832
diff changeset
    31
    if ([[NSFileManager defaultManager] fileExistsAtPath:SAVES_DIRECTORY()])
fe19af8278e6 ios, this method belongs here
koda
parents: 6832
diff changeset
    32
        [[NSFileManager defaultManager] removeItemAtPath:SAVES_DIRECTORY() error:NULL];
fe19af8278e6 ios, this method belongs here
koda
parents: 6832
diff changeset
    33
    [[NSFileManager defaultManager] createDirectoryAtPath:SAVES_DIRECTORY()
fe19af8278e6 ios, this method belongs here
koda
parents: 6832
diff changeset
    34
                              withIntermediateDirectories:NO
fe19af8278e6 ios, this method belongs here
koda
parents: 6832
diff changeset
    35
                                               attributes:nil
fe19af8278e6 ios, this method belongs here
koda
parents: 6832
diff changeset
    36
                                                    error:NULL];
fe19af8278e6 ios, this method belongs here
koda
parents: 6832
diff changeset
    37
fe19af8278e6 ios, this method belongs here
koda
parents: 6832
diff changeset
    38
    // SCREENSHOTS - just create it the first time
fe19af8278e6 ios, this method belongs here
koda
parents: 6832
diff changeset
    39
    if ([[NSFileManager defaultManager] fileExistsAtPath:SCREENSHOTS_DIRECTORY()] == NO)
fe19af8278e6 ios, this method belongs here
koda
parents: 6832
diff changeset
    40
        [[NSFileManager defaultManager] createDirectoryAtPath:SCREENSHOTS_DIRECTORY()
fe19af8278e6 ios, this method belongs here
koda
parents: 6832
diff changeset
    41
                                  withIntermediateDirectories:NO
fe19af8278e6 ios, this method belongs here
koda
parents: 6832
diff changeset
    42
                                                   attributes:nil
fe19af8278e6 ios, this method belongs here
koda
parents: 6832
diff changeset
    43
                                                        error:NULL];
fe19af8278e6 ios, this method belongs here
koda
parents: 6832
diff changeset
    44
fe19af8278e6 ios, this method belongs here
koda
parents: 6832
diff changeset
    45
    // SETTINGS - nsuserdefaults ftw
fe19af8278e6 ios, this method belongs here
koda
parents: 6832
diff changeset
    46
    [self createSettings];
fe19af8278e6 ios, this method belongs here
koda
parents: 6832
diff changeset
    47
fe19af8278e6 ios, this method belongs here
koda
parents: 6832
diff changeset
    48
    // TEAMS - update exisiting teams with new format
fe19af8278e6 ios, this method belongs here
koda
parents: 6832
diff changeset
    49
    NSArray *teamNames = [[NSArray alloc] initWithObjects:@"Edit Me!",@"Ninjas",@"Pirates",@"Robots",nil];
fe19af8278e6 ios, this method belongs here
koda
parents: 6832
diff changeset
    50
    index = 0;
fe19af8278e6 ios, this method belongs here
koda
parents: 6832
diff changeset
    51
    for (NSString *name in teamNames)
fe19af8278e6 ios, this method belongs here
koda
parents: 6832
diff changeset
    52
        [self createTeamNamed:name ofType:index++ controlledByAI:[name isEqualToString:@"Robots"]];
fe19af8278e6 ios, this method belongs here
koda
parents: 6832
diff changeset
    53
    [teamNames release];
fe19af8278e6 ios, this method belongs here
koda
parents: 6832
diff changeset
    54
fe19af8278e6 ios, this method belongs here
koda
parents: 6832
diff changeset
    55
    // SCHEMES - always overwrite and delete custom ones
fe19af8278e6 ios, this method belongs here
koda
parents: 6832
diff changeset
    56
    if ([[NSFileManager defaultManager] fileExistsAtPath:SCHEMES_DIRECTORY()] == YES)
fe19af8278e6 ios, this method belongs here
koda
parents: 6832
diff changeset
    57
        [[NSFileManager defaultManager] removeItemAtPath:SCHEMES_DIRECTORY() error:NULL];
fe19af8278e6 ios, this method belongs here
koda
parents: 6832
diff changeset
    58
    NSArray *schemeNames = [[NSArray alloc] initWithObjects:@"Default",@"Pro Mode",@"Shoppa",@"Clean Slate",
fe19af8278e6 ios, this method belongs here
koda
parents: 6832
diff changeset
    59
                            @"Minefield",@"Barrel Mayhem",@"Tunnel Hogs",@"Fort Mode",@"Timeless",
11192
3dbea499390d - 'Construction Mode' ammo set and game parameters added to iOS front-end
antonc27 <antonc27@mail.ru>
parents: 11191
diff changeset
    60
                            @"Thinking with Portals",@"King Mode",@"Construction Mode",nil];
6865
fe19af8278e6 ios, this method belongs here
koda
parents: 6832
diff changeset
    61
    index = 0;
fe19af8278e6 ios, this method belongs here
koda
parents: 6832
diff changeset
    62
    for (NSString *name in schemeNames)
fe19af8278e6 ios, this method belongs here
koda
parents: 6832
diff changeset
    63
        [self createSchemeNamed:name ofType:index++];
fe19af8278e6 ios, this method belongs here
koda
parents: 6832
diff changeset
    64
    [schemeNames release];
fe19af8278e6 ios, this method belongs here
koda
parents: 6832
diff changeset
    65
fe19af8278e6 ios, this method belongs here
koda
parents: 6832
diff changeset
    66
    // WEAPONS - always overwrite as merge is not needed (missing weaps are 0ed automatically)
fe19af8278e6 ios, this method belongs here
koda
parents: 6832
diff changeset
    67
    NSArray *weaponNames = [[NSArray alloc] initWithObjects:@"Default",@"Crazy",@"Pro Mode",@"Shoppa",@"Clean Slate",
11194
d77ffd68e1cd - 'Shoppa Pro' ammo set added to iOS front-end
antonc27 <antonc27@mail.ru>
parents: 11192
diff changeset
    68
                            @"Minefield",@"Thinking with Portals",@"One of Everything",@"Highlander",@"Construction Mode",@"Shoppa Pro",nil];
6865
fe19af8278e6 ios, this method belongs here
koda
parents: 6832
diff changeset
    69
    index = 0;
fe19af8278e6 ios, this method belongs here
koda
parents: 6832
diff changeset
    70
    for (NSString *name in weaponNames)
fe19af8278e6 ios, this method belongs here
koda
parents: 6832
diff changeset
    71
        [self createWeaponNamed:name ofType:index++];
fe19af8278e6 ios, this method belongs here
koda
parents: 6832
diff changeset
    72
    [weaponNames release];
fe19af8278e6 ios, this method belongs here
koda
parents: 6832
diff changeset
    73
}
fe19af8278e6 ios, this method belongs here
koda
parents: 6832
diff changeset
    74
6103
55ecfbf834e3 convert creation chamber functions to class methods
koda
parents: 5984
diff changeset
    75
#pragma mark Settings
55ecfbf834e3 convert creation chamber functions to class methods
koda
parents: 5984
diff changeset
    76
+(void) createSettings {
5206
db775bddf771 settings.plist is no more, long live nsuserdefaults
koda
parents: 5200
diff changeset
    77
    NSUserDefaults *settings = [NSUserDefaults standardUserDefaults];
db775bddf771 settings.plist is no more, long live nsuserdefaults
koda
parents: 5200
diff changeset
    78
    [settings setObject:[NSNumber numberWithBool:NO] forKey:@"alternate"];
db775bddf771 settings.plist is no more, long live nsuserdefaults
koda
parents: 5200
diff changeset
    79
    [settings setObject:[NSNumber numberWithBool:YES] forKey:@"music"];
db775bddf771 settings.plist is no more, long live nsuserdefaults
koda
parents: 5200
diff changeset
    80
    [settings setObject:[NSNumber numberWithBool:YES] forKey:@"sound"];
5451
e359a79e3d08 rip out the sync weapons/schemes switch and place it into settings; also perform some runtime check on what can be enabled
koda
parents: 5376
diff changeset
    81
    [settings setObject:[NSNumber numberWithBool:YES] forKey:@"sync_ws"];
e359a79e3d08 rip out the sync weapons/schemes switch and place it into settings; also perform some runtime check on what can be enabled
koda
parents: 5376
diff changeset
    82
5207
4c9ae0f484da some general tweaks (more intelligent use of macros and more caching)
koda
parents: 5206
diff changeset
    83
    // don't overwrite these two strings when present
4c9ae0f484da some general tweaks (more intelligent use of macros and more caching)
koda
parents: 5206
diff changeset
    84
    if ([settings objectForKey:@"username"] == nil)
4c9ae0f484da some general tweaks (more intelligent use of macros and more caching)
koda
parents: 5206
diff changeset
    85
        [settings setObject:@"" forKey:@"username"];
4c9ae0f484da some general tweaks (more intelligent use of macros and more caching)
koda
parents: 5206
diff changeset
    86
    if ([settings objectForKey:@"password"] == nil)
4c9ae0f484da some general tweaks (more intelligent use of macros and more caching)
koda
parents: 5206
diff changeset
    87
        [settings setObject:@"" forKey:@"password"];
5206
db775bddf771 settings.plist is no more, long live nsuserdefaults
koda
parents: 5200
diff changeset
    88
db775bddf771 settings.plist is no more, long live nsuserdefaults
koda
parents: 5200
diff changeset
    89
    [settings synchronize];
db775bddf771 settings.plist is no more, long live nsuserdefaults
koda
parents: 5200
diff changeset
    90
}
4281
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    91
6103
55ecfbf834e3 convert creation chamber functions to class methods
koda
parents: 5984
diff changeset
    92
#pragma mark Teams
55ecfbf834e3 convert creation chamber functions to class methods
koda
parents: 5984
diff changeset
    93
+(void) createTeamNamed:(NSString *)nameWithoutExt {
6865
fe19af8278e6 ios, this method belongs here
koda
parents: 6832
diff changeset
    94
    [self createTeamNamed:nameWithoutExt ofType:0 controlledByAI:NO];
6103
55ecfbf834e3 convert creation chamber functions to class methods
koda
parents: 5984
diff changeset
    95
}
55ecfbf834e3 convert creation chamber functions to class methods
koda
parents: 5984
diff changeset
    96
55ecfbf834e3 convert creation chamber functions to class methods
koda
parents: 5984
diff changeset
    97
+(void) createTeamNamed:(NSString *)nameWithoutExt ofType:(NSInteger) type {
6865
fe19af8278e6 ios, this method belongs here
koda
parents: 6832
diff changeset
    98
    [self createTeamNamed:nameWithoutExt ofType:type controlledByAI:NO];
6103
55ecfbf834e3 convert creation chamber functions to class methods
koda
parents: 5984
diff changeset
    99
}
55ecfbf834e3 convert creation chamber functions to class methods
koda
parents: 5984
diff changeset
   100
6104
117bdf4e7af9 create teams programmatically
koda
parents: 6103
diff changeset
   101
+(void) createTeamNamed:(NSString *)nameWithoutExt ofType:(NSInteger) type controlledByAI:(BOOL) shouldAITakeOver {
4281
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   102
    NSString *teamsDirectory = TEAMS_DIRECTORY();
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   103
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   104
    if (![[NSFileManager defaultManager] fileExistsAtPath: teamsDirectory]) {
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   105
        [[NSFileManager defaultManager] createDirectoryAtPath:teamsDirectory
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   106
                                  withIntermediateDirectories:NO
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   107
                                                   attributes:nil
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   108
                                                        error:NULL];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   109
    }
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   110
6104
117bdf4e7af9 create teams programmatically
koda
parents: 6103
diff changeset
   111
    NSArray *customNames;
117bdf4e7af9 create teams programmatically
koda
parents: 6103
diff changeset
   112
    NSArray *customHats;
117bdf4e7af9 create teams programmatically
koda
parents: 6103
diff changeset
   113
    NSString *flag, *grave, *voicepack, *fort;
117bdf4e7af9 create teams programmatically
koda
parents: 6103
diff changeset
   114
    switch (type) {
117bdf4e7af9 create teams programmatically
koda
parents: 6103
diff changeset
   115
        default: // default
117bdf4e7af9 create teams programmatically
koda
parents: 6103
diff changeset
   116
            customNames = [[NSArray alloc] initWithObjects:@"No Name",@"Unnamed",@"Anonymous",@"Nameless",@"Incognito",@"Unidentified",
117bdf4e7af9 create teams programmatically
koda
parents: 6103
diff changeset
   117
                           @"Uknown",@"Secret",nil];
117bdf4e7af9 create teams programmatically
koda
parents: 6103
diff changeset
   118
            customHats = [[NSArray alloc] initWithObjects:@"NoHat",@"NoHat",@"NoHat",@"NoHat",@"NoHat",@"NoHat",@"NoHat",@"NoHat",nil];
117bdf4e7af9 create teams programmatically
koda
parents: 6103
diff changeset
   119
            flag = @"hedgewars";
117bdf4e7af9 create teams programmatically
koda
parents: 6103
diff changeset
   120
            grave = @"Statue";
117bdf4e7af9 create teams programmatically
koda
parents: 6103
diff changeset
   121
            voicepack = @"Default";
117bdf4e7af9 create teams programmatically
koda
parents: 6103
diff changeset
   122
            fort = @"Plane";
117bdf4e7af9 create teams programmatically
koda
parents: 6103
diff changeset
   123
            break;
117bdf4e7af9 create teams programmatically
koda
parents: 6103
diff changeset
   124
        case 1:  // ninjas
117bdf4e7af9 create teams programmatically
koda
parents: 6103
diff changeset
   125
            customNames = [[NSArray alloc] initWithObjects:@"Shinobi",@"Ukemi",@"Godai",@"Ninpo",@"Tatsujin",@"Arashi",@"Bushi",@"Itami",nil];
117bdf4e7af9 create teams programmatically
koda
parents: 6103
diff changeset
   126
            customHats = [[NSArray alloc] initWithObjects:@"NinjaFull",@"NinjaStraight",@"NinjaTriangle",@"NinjaFull",@"NinjaStraight",
117bdf4e7af9 create teams programmatically
koda
parents: 6103
diff changeset
   127
                          @"NinjaTriangle",@"NinjaFull",@"NinjaTriangle",nil];
117bdf4e7af9 create teams programmatically
koda
parents: 6103
diff changeset
   128
            flag = @"japan";
117bdf4e7af9 create teams programmatically
koda
parents: 6103
diff changeset
   129
            grave = @"bp2";
117bdf4e7af9 create teams programmatically
koda
parents: 6103
diff changeset
   130
            voicepack = @"Singer";
117bdf4e7af9 create teams programmatically
koda
parents: 6103
diff changeset
   131
            fort = @"Wood";
117bdf4e7af9 create teams programmatically
koda
parents: 6103
diff changeset
   132
            break;
117bdf4e7af9 create teams programmatically
koda
parents: 6103
diff changeset
   133
        case 2: // pirates
117bdf4e7af9 create teams programmatically
koda
parents: 6103
diff changeset
   134
            customNames = [[NSArray alloc] initWithObjects:@"Toothless Wayne",@"Long-nose Kidd",@"Eye-patch Jim",@"Rackham Blood",@"One-eyed Ayee",
117bdf4e7af9 create teams programmatically
koda
parents: 6103
diff changeset
   135
                           @"Dirty Ben",@"Morris",@"Cruise Seymour",nil];
117bdf4e7af9 create teams programmatically
koda
parents: 6103
diff changeset
   136
            customHats = [[NSArray alloc] initWithObjects:@"pirate_jack_bandana",@"pirate_jack",@"dwarf",@"pirate_jack_bandana",@"pirate_jack",
117bdf4e7af9 create teams programmatically
koda
parents: 6103
diff changeset
   137
                          @"dwarf",@"pirate_jack_bandana",@"pirate_jack",nil];
117bdf4e7af9 create teams programmatically
koda
parents: 6103
diff changeset
   138
            flag = @"cm_pirate";
117bdf4e7af9 create teams programmatically
koda
parents: 6103
diff changeset
   139
            grave = @"chest";
117bdf4e7af9 create teams programmatically
koda
parents: 6103
diff changeset
   140
            voicepack = @"Pirate";
117bdf4e7af9 create teams programmatically
koda
parents: 6103
diff changeset
   141
            fort = @"Hydrant";
117bdf4e7af9 create teams programmatically
koda
parents: 6103
diff changeset
   142
            break;
117bdf4e7af9 create teams programmatically
koda
parents: 6103
diff changeset
   143
        case 3: // robots
117bdf4e7af9 create teams programmatically
koda
parents: 6103
diff changeset
   144
            customNames = [[NSArray alloc] initWithObjects:@"HAL",@"R2-D2",@"Wall-E",@"Robocop",@"Optimus Prime",@"Terminator",@"C-3PO",@"KITT",nil];
117bdf4e7af9 create teams programmatically
koda
parents: 6103
diff changeset
   145
            customHats = [[NSArray alloc] initWithObjects:@"cyborg1",@"cyborg2",@"cyborg1",@"cyborg2",@"cyborg1",@"cyborg2",@"cyborg1",
117bdf4e7af9 create teams programmatically
koda
parents: 6103
diff changeset
   146
                          @"cyborg2",nil];
117bdf4e7af9 create teams programmatically
koda
parents: 6103
diff changeset
   147
            flag = @"cm_binary";
117bdf4e7af9 create teams programmatically
koda
parents: 6103
diff changeset
   148
            grave = @"Rip";
117bdf4e7af9 create teams programmatically
koda
parents: 6103
diff changeset
   149
            voicepack = @"Robot";
117bdf4e7af9 create teams programmatically
koda
parents: 6103
diff changeset
   150
            fort = @"UFO";
117bdf4e7af9 create teams programmatically
koda
parents: 6103
diff changeset
   151
            break;
117bdf4e7af9 create teams programmatically
koda
parents: 6103
diff changeset
   152
    }
4281
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   153
6104
117bdf4e7af9 create teams programmatically
koda
parents: 6103
diff changeset
   154
    NSMutableArray *hedgehogs = [[NSMutableArray alloc] initWithCapacity:HW_getMaxNumberOfHogs()];
4281
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   155
    for (int i = 0; i < HW_getMaxNumberOfHogs(); i++) {
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   156
        NSDictionary *hog = [[NSDictionary alloc] initWithObjectsAndKeys:
6104
117bdf4e7af9 create teams programmatically
koda
parents: 6103
diff changeset
   157
                             [NSNumber numberWithInt:(shouldAITakeOver ? 4 : 0)],@"level",
117bdf4e7af9 create teams programmatically
koda
parents: 6103
diff changeset
   158
                             [customNames objectAtIndex:i],@"hogname",
117bdf4e7af9 create teams programmatically
koda
parents: 6103
diff changeset
   159
                             [customHats objectAtIndex:i],@"hat",
4281
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   160
                             nil];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   161
        [hedgehogs addObject:hog];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   162
        [hog release];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   163
    }
6104
117bdf4e7af9 create teams programmatically
koda
parents: 6103
diff changeset
   164
    [customHats release];
117bdf4e7af9 create teams programmatically
koda
parents: 6103
diff changeset
   165
    [customNames release];
4281
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   166
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   167
    NSDictionary *theTeam = [[NSDictionary alloc] initWithObjectsAndKeys:
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   168
                             @"0",@"hash",
6104
117bdf4e7af9 create teams programmatically
koda
parents: 6103
diff changeset
   169
                             grave,@"grave",
117bdf4e7af9 create teams programmatically
koda
parents: 6103
diff changeset
   170
                             fort,@"fort",
117bdf4e7af9 create teams programmatically
koda
parents: 6103
diff changeset
   171
                             voicepack,@"voicepack",
117bdf4e7af9 create teams programmatically
koda
parents: 6103
diff changeset
   172
                             flag,@"flag",
4281
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   173
                             hedgehogs,@"hedgehogs",
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   174
                             nil];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   175
    [hedgehogs release];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   176
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   177
    NSString *teamFile = [[NSString alloc] initWithFormat:@"%@/%@.plist", teamsDirectory, nameWithoutExt];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   178
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   179
    [theTeam writeToFile:teamFile atomically:YES];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   180
    [teamFile release];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   181
    [theTeam release];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   182
}
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   183
6103
55ecfbf834e3 convert creation chamber functions to class methods
koda
parents: 5984
diff changeset
   184
#pragma mark Weapons
55ecfbf834e3 convert creation chamber functions to class methods
koda
parents: 5984
diff changeset
   185
+(void) createWeaponNamed:(NSString *)nameWithoutExt {
6865
fe19af8278e6 ios, this method belongs here
koda
parents: 6832
diff changeset
   186
    [self createWeaponNamed:nameWithoutExt ofType:0];
6103
55ecfbf834e3 convert creation chamber functions to class methods
koda
parents: 5984
diff changeset
   187
}
55ecfbf834e3 convert creation chamber functions to class methods
koda
parents: 5984
diff changeset
   188
55ecfbf834e3 convert creation chamber functions to class methods
koda
parents: 5984
diff changeset
   189
+(void) createWeaponNamed:(NSString *)nameWithoutExt ofType:(NSInteger) type {
4281
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   190
    NSString *weaponsDirectory = WEAPONS_DIRECTORY();
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   191
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   192
    if (![[NSFileManager defaultManager] fileExistsAtPath: weaponsDirectory]) {
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   193
        [[NSFileManager defaultManager] createDirectoryAtPath:weaponsDirectory
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   194
                                  withIntermediateDirectories:NO
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   195
                                                   attributes:nil
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   196
                                                        error:NULL];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   197
    }
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   198
5200
7440fe992e73 * move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents: 5185
diff changeset
   199
    NSInteger ammolineSize = HW_getNumberOfWeapons();
7440fe992e73 * move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents: 5185
diff changeset
   200
    NSString *qt, *prob, *delay, *crate;
4281
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   201
    switch (type) {
4607
7f683c2357a0 update weapons
koda
parents: 4605
diff changeset
   202
        default: //default
5200
7440fe992e73 * move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents: 5185
diff changeset
   203
            qt = [[NSString alloc] initWithBytes:AMMOLINE_DEFAULT_QT length:ammolineSize encoding:NSUTF8StringEncoding];
5376
ea8a74951948 copy pasta fail
koda
parents: 5207
diff changeset
   204
            prob = [[NSString alloc] initWithBytes:AMMOLINE_DEFAULT_PROB length:ammolineSize encoding:NSUTF8StringEncoding];
ea8a74951948 copy pasta fail
koda
parents: 5207
diff changeset
   205
            delay = [[NSString alloc] initWithBytes:AMMOLINE_DEFAULT_DELAY length:ammolineSize encoding:NSUTF8StringEncoding];
ea8a74951948 copy pasta fail
koda
parents: 5207
diff changeset
   206
            crate = [[NSString alloc] initWithBytes:AMMOLINE_DEFAULT_CRATE length:ammolineSize encoding:NSUTF8StringEncoding];
4281
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   207
            break;
6104
117bdf4e7af9 create teams programmatically
koda
parents: 6103
diff changeset
   208
        case 1:  //crazy
5200
7440fe992e73 * move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents: 5185
diff changeset
   209
            qt = [[NSString alloc] initWithBytes:AMMOLINE_CRAZY_QT length:ammolineSize encoding:NSUTF8StringEncoding];
7440fe992e73 * move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents: 5185
diff changeset
   210
            prob = [[NSString alloc] initWithBytes:AMMOLINE_CRAZY_PROB length:ammolineSize encoding:NSUTF8StringEncoding];
7440fe992e73 * move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents: 5185
diff changeset
   211
            delay = [[NSString alloc] initWithBytes:AMMOLINE_CRAZY_DELAY length:ammolineSize encoding:NSUTF8StringEncoding];
7440fe992e73 * move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents: 5185
diff changeset
   212
            crate = [[NSString alloc] initWithBytes:AMMOLINE_CRAZY_CRATE length:ammolineSize encoding:NSUTF8StringEncoding];
4281
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   213
            break;
6104
117bdf4e7af9 create teams programmatically
koda
parents: 6103
diff changeset
   214
        case 2:  //pro mode
5200
7440fe992e73 * move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents: 5185
diff changeset
   215
            qt = [[NSString alloc] initWithBytes:AMMOLINE_PROMODE_QT length:ammolineSize encoding:NSUTF8StringEncoding];
7440fe992e73 * move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents: 5185
diff changeset
   216
            prob = [[NSString alloc] initWithBytes:AMMOLINE_PROMODE_PROB length:ammolineSize encoding:NSUTF8StringEncoding];
7440fe992e73 * move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents: 5185
diff changeset
   217
            delay = [[NSString alloc] initWithBytes:AMMOLINE_PROMODE_DELAY length:ammolineSize encoding:NSUTF8StringEncoding];
7440fe992e73 * move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents: 5185
diff changeset
   218
            crate = [[NSString alloc] initWithBytes:AMMOLINE_PROMODE_CRATE length:ammolineSize encoding:NSUTF8StringEncoding];
4281
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   219
            break;
6104
117bdf4e7af9 create teams programmatically
koda
parents: 6103
diff changeset
   220
        case 3:  //shoppa
5200
7440fe992e73 * move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents: 5185
diff changeset
   221
            qt = [[NSString alloc] initWithBytes:AMMOLINE_SHOPPA_QT length:ammolineSize encoding:NSUTF8StringEncoding];
7440fe992e73 * move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents: 5185
diff changeset
   222
            prob = [[NSString alloc] initWithBytes:AMMOLINE_SHOPPA_PROB length:ammolineSize encoding:NSUTF8StringEncoding];
7440fe992e73 * move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents: 5185
diff changeset
   223
            delay = [[NSString alloc] initWithBytes:AMMOLINE_SHOPPA_DELAY length:ammolineSize encoding:NSUTF8StringEncoding];
7440fe992e73 * move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents: 5185
diff changeset
   224
            crate = [[NSString alloc] initWithBytes:AMMOLINE_SHOPPA_CRATE length:ammolineSize encoding:NSUTF8StringEncoding];
4281
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   225
            break;
6104
117bdf4e7af9 create teams programmatically
koda
parents: 6103
diff changeset
   226
        case 4:  //clean slate
5200
7440fe992e73 * move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents: 5185
diff changeset
   227
            qt = [[NSString alloc] initWithBytes:AMMOLINE_CLEAN_QT length:ammolineSize encoding:NSUTF8StringEncoding];
7440fe992e73 * move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents: 5185
diff changeset
   228
            prob = [[NSString alloc] initWithBytes:AMMOLINE_CLEAN_PROB length:ammolineSize encoding:NSUTF8StringEncoding];
7440fe992e73 * move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents: 5185
diff changeset
   229
            delay = [[NSString alloc] initWithBytes:AMMOLINE_CLEAN_DELAY length:ammolineSize encoding:NSUTF8StringEncoding];
7440fe992e73 * move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents: 5185
diff changeset
   230
            crate = [[NSString alloc] initWithBytes:AMMOLINE_CLEAN_CRATE length:ammolineSize encoding:NSUTF8StringEncoding];
4281
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   231
            break;
6104
117bdf4e7af9 create teams programmatically
koda
parents: 6103
diff changeset
   232
        case 5:  //minefield
5200
7440fe992e73 * move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents: 5185
diff changeset
   233
            qt = [[NSString alloc] initWithBytes:AMMOLINE_MINES_QT length:ammolineSize encoding:NSUTF8StringEncoding];
7440fe992e73 * move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents: 5185
diff changeset
   234
            prob = [[NSString alloc] initWithBytes:AMMOLINE_MINES_PROB length:ammolineSize encoding:NSUTF8StringEncoding];
7440fe992e73 * move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents: 5185
diff changeset
   235
            delay = [[NSString alloc] initWithBytes:AMMOLINE_MINES_DELAY length:ammolineSize encoding:NSUTF8StringEncoding];
7440fe992e73 * move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents: 5185
diff changeset
   236
            crate = [[NSString alloc] initWithBytes:AMMOLINE_MINES_CRATE length:ammolineSize encoding:NSUTF8StringEncoding];
4284
57a501a69e5f update iFrontend with new schemes and weaps, fix up smaller glitches
koda
parents: 4281
diff changeset
   237
            break;
6104
117bdf4e7af9 create teams programmatically
koda
parents: 6103
diff changeset
   238
        case 6:  //thinking with portals
5200
7440fe992e73 * move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents: 5185
diff changeset
   239
            qt = [[NSString alloc] initWithBytes:AMMOLINE_PORTALS_QT length:ammolineSize encoding:NSUTF8StringEncoding];
7440fe992e73 * move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents: 5185
diff changeset
   240
            prob = [[NSString alloc] initWithBytes:AMMOLINE_PORTALS_PROB length:ammolineSize encoding:NSUTF8StringEncoding];
7440fe992e73 * move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents: 5185
diff changeset
   241
            delay = [[NSString alloc] initWithBytes:AMMOLINE_PORTALS_DELAY length:ammolineSize encoding:NSUTF8StringEncoding];
7440fe992e73 * move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents: 5185
diff changeset
   242
            crate = [[NSString alloc] initWithBytes:AMMOLINE_PORTALS_CRATE length:ammolineSize encoding:NSUTF8StringEncoding];
4281
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   243
            break;
11190
ee8e2494eaee - 'One of everything' ammo set added to iOS front-end
antonc27 <antonc27@mail.ru>
parents: 10108
diff changeset
   244
        case 7:  //one of everything
ee8e2494eaee - 'One of everything' ammo set added to iOS front-end
antonc27 <antonc27@mail.ru>
parents: 10108
diff changeset
   245
            qt = [[NSString alloc] initWithBytes:AMMOLINE_ONEEVERY_QT length:ammolineSize encoding:NSUTF8StringEncoding];
ee8e2494eaee - 'One of everything' ammo set added to iOS front-end
antonc27 <antonc27@mail.ru>
parents: 10108
diff changeset
   246
            prob = [[NSString alloc] initWithBytes:AMMOLINE_ONEEVERY_PROB length:ammolineSize encoding:NSUTF8StringEncoding];
ee8e2494eaee - 'One of everything' ammo set added to iOS front-end
antonc27 <antonc27@mail.ru>
parents: 10108
diff changeset
   247
            delay = [[NSString alloc] initWithBytes:AMMOLINE_ONEEVERY_DELAY length:ammolineSize encoding:NSUTF8StringEncoding];
ee8e2494eaee - 'One of everything' ammo set added to iOS front-end
antonc27 <antonc27@mail.ru>
parents: 10108
diff changeset
   248
            crate = [[NSString alloc] initWithBytes:AMMOLINE_ONEEVERY_CRATE length:ammolineSize encoding:NSUTF8StringEncoding];
ee8e2494eaee - 'One of everything' ammo set added to iOS front-end
antonc27 <antonc27@mail.ru>
parents: 10108
diff changeset
   249
            break;
11191
fa6f6e8b927c - 'Highlander' ammo set added to iOS front-end
antonc27 <antonc27@mail.ru>
parents: 11190
diff changeset
   250
        case 8:  //highlander
fa6f6e8b927c - 'Highlander' ammo set added to iOS front-end
antonc27 <antonc27@mail.ru>
parents: 11190
diff changeset
   251
            qt = [[NSString alloc] initWithBytes:AMMOLINE_HIGHLANDER_QT length:ammolineSize encoding:NSUTF8StringEncoding];
fa6f6e8b927c - 'Highlander' ammo set added to iOS front-end
antonc27 <antonc27@mail.ru>
parents: 11190
diff changeset
   252
            prob = [[NSString alloc] initWithBytes:AMMOLINE_HIGHLANDER_PROB length:ammolineSize encoding:NSUTF8StringEncoding];
fa6f6e8b927c - 'Highlander' ammo set added to iOS front-end
antonc27 <antonc27@mail.ru>
parents: 11190
diff changeset
   253
            delay = [[NSString alloc] initWithBytes:AMMOLINE_HIGHLANDER_DELAY length:ammolineSize encoding:NSUTF8StringEncoding];
fa6f6e8b927c - 'Highlander' ammo set added to iOS front-end
antonc27 <antonc27@mail.ru>
parents: 11190
diff changeset
   254
            crate = [[NSString alloc] initWithBytes:AMMOLINE_HIGHLANDER_CRATE length:ammolineSize encoding:NSUTF8StringEncoding];
fa6f6e8b927c - 'Highlander' ammo set added to iOS front-end
antonc27 <antonc27@mail.ru>
parents: 11190
diff changeset
   255
            break;
11192
3dbea499390d - 'Construction Mode' ammo set and game parameters added to iOS front-end
antonc27 <antonc27@mail.ru>
parents: 11191
diff changeset
   256
        case 9:  //construction mode
3dbea499390d - 'Construction Mode' ammo set and game parameters added to iOS front-end
antonc27 <antonc27@mail.ru>
parents: 11191
diff changeset
   257
            qt = [[NSString alloc] initWithBytes:AMMOLINE_CONSTRUCTION_QT length:ammolineSize encoding:NSUTF8StringEncoding];
3dbea499390d - 'Construction Mode' ammo set and game parameters added to iOS front-end
antonc27 <antonc27@mail.ru>
parents: 11191
diff changeset
   258
            prob = [[NSString alloc] initWithBytes:AMMOLINE_CONSTRUCTION_PROB length:ammolineSize encoding:NSUTF8StringEncoding];
3dbea499390d - 'Construction Mode' ammo set and game parameters added to iOS front-end
antonc27 <antonc27@mail.ru>
parents: 11191
diff changeset
   259
            delay = [[NSString alloc] initWithBytes:AMMOLINE_CONSTRUCTION_DELAY length:ammolineSize encoding:NSUTF8StringEncoding];
3dbea499390d - 'Construction Mode' ammo set and game parameters added to iOS front-end
antonc27 <antonc27@mail.ru>
parents: 11191
diff changeset
   260
            crate = [[NSString alloc] initWithBytes:AMMOLINE_CONSTRUCTION_CRATE length:ammolineSize encoding:NSUTF8StringEncoding];
3dbea499390d - 'Construction Mode' ammo set and game parameters added to iOS front-end
antonc27 <antonc27@mail.ru>
parents: 11191
diff changeset
   261
            break;
11194
d77ffd68e1cd - 'Shoppa Pro' ammo set added to iOS front-end
antonc27 <antonc27@mail.ru>
parents: 11192
diff changeset
   262
        case 10:  //shoppa pro
d77ffd68e1cd - 'Shoppa Pro' ammo set added to iOS front-end
antonc27 <antonc27@mail.ru>
parents: 11192
diff changeset
   263
            qt = [[NSString alloc] initWithBytes:AMMOLINE_SHOPPAPRO_QT length:ammolineSize encoding:NSUTF8StringEncoding];
d77ffd68e1cd - 'Shoppa Pro' ammo set added to iOS front-end
antonc27 <antonc27@mail.ru>
parents: 11192
diff changeset
   264
            prob = [[NSString alloc] initWithBytes:AMMOLINE_SHOPPAPRO_PROB length:ammolineSize encoding:NSUTF8StringEncoding];
d77ffd68e1cd - 'Shoppa Pro' ammo set added to iOS front-end
antonc27 <antonc27@mail.ru>
parents: 11192
diff changeset
   265
            delay = [[NSString alloc] initWithBytes:AMMOLINE_SHOPPAPRO_DELAY length:ammolineSize encoding:NSUTF8StringEncoding];
d77ffd68e1cd - 'Shoppa Pro' ammo set added to iOS front-end
antonc27 <antonc27@mail.ru>
parents: 11192
diff changeset
   266
            crate = [[NSString alloc] initWithBytes:AMMOLINE_SHOPPAPRO_CRATE length:ammolineSize encoding:NSUTF8StringEncoding];
d77ffd68e1cd - 'Shoppa Pro' ammo set added to iOS front-end
antonc27 <antonc27@mail.ru>
parents: 11192
diff changeset
   267
            break;
4281
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   268
    }
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   269
5200
7440fe992e73 * move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents: 5185
diff changeset
   270
    NSDictionary *theWeapon = [[NSDictionary alloc] initWithObjectsAndKeys: qt,@"ammostore_initialqt",
7440fe992e73 * move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents: 5185
diff changeset
   271
                               prob,@"ammostore_probability", delay,@"ammostore_delay", crate,@"ammostore_crate", nil];
7440fe992e73 * move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents: 5185
diff changeset
   272
    [qt release];
7440fe992e73 * move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents: 5185
diff changeset
   273
    [prob release];
7440fe992e73 * move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents: 5185
diff changeset
   274
    [delay release];
7440fe992e73 * move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents: 5185
diff changeset
   275
    [crate release];
7440fe992e73 * move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents: 5185
diff changeset
   276
4281
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   277
    NSString *weaponFile = [[NSString alloc] initWithFormat:@"%@/%@.plist", weaponsDirectory, nameWithoutExt];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   278
    [theWeapon writeToFile:weaponFile atomically:YES];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   279
    [weaponFile release];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   280
    [theWeapon release];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   281
}
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   282
6103
55ecfbf834e3 convert creation chamber functions to class methods
koda
parents: 5984
diff changeset
   283
#pragma mark Schemes
55ecfbf834e3 convert creation chamber functions to class methods
koda
parents: 5984
diff changeset
   284
+(void) createSchemeNamed:(NSString *)nameWithoutExt {
6865
fe19af8278e6 ios, this method belongs here
koda
parents: 6832
diff changeset
   285
    [self createSchemeNamed:nameWithoutExt ofType:0];
6103
55ecfbf834e3 convert creation chamber functions to class methods
koda
parents: 5984
diff changeset
   286
}
55ecfbf834e3 convert creation chamber functions to class methods
koda
parents: 5984
diff changeset
   287
55ecfbf834e3 convert creation chamber functions to class methods
koda
parents: 5984
diff changeset
   288
+(void) createSchemeNamed:(NSString *)nameWithoutExt ofType:(NSInteger) type {
4281
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   289
    NSString *schemesDirectory = SCHEMES_DIRECTORY();
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   290
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   291
    if (![[NSFileManager defaultManager] fileExistsAtPath: schemesDirectory]) {
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   292
        [[NSFileManager defaultManager] createDirectoryAtPath:schemesDirectory
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   293
                                  withIntermediateDirectories:NO
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   294
                                                   attributes:nil
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   295
                                                        error:NULL];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   296
    }
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   297
5181
102fef5ca5fc add getawaytime and tagteam mode to ios
koda
parents: 4976
diff changeset
   298
    // load data to get the size of the arrays and their default values
5185
7607a64e1853 remove the trailing _en from scheme data and use the macros available instead of creating a string every time
koda
parents: 5181
diff changeset
   299
    NSArray *basicSettings = [[NSArray alloc] initWithContentsOfFile:BASICFLAGS_FILE()];
5181
102fef5ca5fc add getawaytime and tagteam mode to ios
koda
parents: 4976
diff changeset
   300
    NSMutableArray *basicArray  = [[NSMutableArray alloc] initWithCapacity:[basicSettings count]];
102fef5ca5fc add getawaytime and tagteam mode to ios
koda
parents: 4976
diff changeset
   301
    for (NSDictionary *basicDict in basicSettings)
102fef5ca5fc add getawaytime and tagteam mode to ios
koda
parents: 4976
diff changeset
   302
        [basicArray addObject:[basicDict objectForKey:@"default"]];
102fef5ca5fc add getawaytime and tagteam mode to ios
koda
parents: 4976
diff changeset
   303
    [basicSettings release];
4281
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   304
5185
7607a64e1853 remove the trailing _en from scheme data and use the macros available instead of creating a string every time
koda
parents: 5181
diff changeset
   305
    NSArray *mods = [[NSArray alloc] initWithContentsOfFile:GAMEMODS_FILE()];
5181
102fef5ca5fc add getawaytime and tagteam mode to ios
koda
parents: 4976
diff changeset
   306
    NSMutableArray *gamemodArray= [[NSMutableArray alloc] initWithCapacity:[mods count]];
6908
896ed2afcfb8 ios: turn on more warning messages and start correcting them
koda
parents: 6865
diff changeset
   307
    for (NSUInteger i = 0; i < [mods count]; i++)
5181
102fef5ca5fc add getawaytime and tagteam mode to ios
koda
parents: 4976
diff changeset
   308
        [gamemodArray addObject:[NSNumber numberWithBool:NO]];
102fef5ca5fc add getawaytime and tagteam mode to ios
koda
parents: 4976
diff changeset
   309
    [mods release];
102fef5ca5fc add getawaytime and tagteam mode to ios
koda
parents: 4976
diff changeset
   310
5984
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   311
    switch (type) {
6104
117bdf4e7af9 create teams programmatically
koda
parents: 6103
diff changeset
   312
        default: // default
5984
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   313
            [gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   314
            break;
6104
117bdf4e7af9 create teams programmatically
koda
parents: 6103
diff changeset
   315
        case 1:  // pro mode
5984
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   316
            [basicArray replaceObjectAtIndex:2 withObject:[NSNumber numberWithInt:15]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   317
            [basicArray replaceObjectAtIndex:7 withObject:[NSNumber numberWithInt:0]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   318
            [basicArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithInt:0]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   319
            [gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   320
            [gamemodArray replaceObjectAtIndex:14 withObject:[NSNumber numberWithBool:YES]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   321
            break;
6104
117bdf4e7af9 create teams programmatically
koda
parents: 6103
diff changeset
   322
        case 2:  // shoppa
5984
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   323
            [basicArray replaceObjectAtIndex:2 withObject:[NSNumber numberWithInt:30]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   324
            [basicArray replaceObjectAtIndex:3 withObject:[NSNumber numberWithInt:50]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   325
            [basicArray replaceObjectAtIndex:7 withObject:[NSNumber numberWithInt:1]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   326
            [basicArray replaceObjectAtIndex:8 withObject:[NSNumber numberWithInt:0]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   327
            [basicArray replaceObjectAtIndex:9 withObject:[NSNumber numberWithInt:25]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   328
            [basicArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithInt:0]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   329
            [basicArray replaceObjectAtIndex:13 withObject:[NSNumber numberWithInt:0]];
11287
9c021eadd374 - Added 'Air Mines' flag for Scheme Settings
antonc27 <antonc27@mail.ru>
parents: 11194
diff changeset
   330
            [basicArray replaceObjectAtIndex:15 withObject:[NSNumber numberWithInt:8]];
5984
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   331
            [gamemodArray replaceObjectAtIndex:1 withObject:[NSNumber numberWithBool:YES]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   332
            [gamemodArray replaceObjectAtIndex:2 withObject:[NSNumber numberWithBool:YES]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   333
            [gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   334
            [gamemodArray replaceObjectAtIndex:14 withObject:[NSNumber numberWithBool:YES]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   335
            [gamemodArray replaceObjectAtIndex:15 withObject:[NSNumber numberWithBool:YES]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   336
            [gamemodArray replaceObjectAtIndex:19 withObject:[NSNumber numberWithBool:YES]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   337
            break;
6104
117bdf4e7af9 create teams programmatically
koda
parents: 6103
diff changeset
   338
        case 3:  // clean slate
5984
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   339
            [gamemodArray replaceObjectAtIndex:6 withObject:[NSNumber numberWithBool:YES]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   340
            [gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   341
            [gamemodArray replaceObjectAtIndex:18 withObject:[NSNumber numberWithBool:YES]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   342
            [gamemodArray replaceObjectAtIndex:19 withObject:[NSNumber numberWithBool:YES]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   343
            break;
6104
117bdf4e7af9 create teams programmatically
koda
parents: 6103
diff changeset
   344
        case 4:  // minefield
5984
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   345
            [basicArray replaceObjectAtIndex:0 withObject:[NSNumber numberWithInt:50]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   346
            [basicArray replaceObjectAtIndex:2 withObject:[NSNumber numberWithInt:30]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   347
            [basicArray replaceObjectAtIndex:7 withObject:[NSNumber numberWithInt:0]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   348
            [basicArray replaceObjectAtIndex:10 withObject:[NSNumber numberWithInt:0]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   349
            [basicArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithInt:80]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   350
            [basicArray replaceObjectAtIndex:13 withObject:[NSNumber numberWithInt:0]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   351
            [gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   352
            [gamemodArray replaceObjectAtIndex:14 withObject:[NSNumber numberWithBool:YES]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   353
            [gamemodArray replaceObjectAtIndex:15 withObject:[NSNumber numberWithBool:YES]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   354
            break;
6104
117bdf4e7af9 create teams programmatically
koda
parents: 6103
diff changeset
   355
        case 5:  // barrel mayhem
5984
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   356
            [basicArray replaceObjectAtIndex:2 withObject:[NSNumber numberWithInt:30]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   357
            [basicArray replaceObjectAtIndex:7 withObject:[NSNumber numberWithInt:0]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   358
            [basicArray replaceObjectAtIndex:10 withObject:[NSNumber numberWithInt:0]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   359
            [basicArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithInt:0]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   360
            [basicArray replaceObjectAtIndex:13 withObject:[NSNumber numberWithInt:40]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   361
            [gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   362
            [gamemodArray replaceObjectAtIndex:14 withObject:[NSNumber numberWithBool:YES]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   363
            break;
6104
117bdf4e7af9 create teams programmatically
koda
parents: 6103
diff changeset
   364
        case 6:  // tunnel hogs
5984
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   365
            [basicArray replaceObjectAtIndex:2 withObject:[NSNumber numberWithInt:30]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   366
            [basicArray replaceObjectAtIndex:9 withObject:[NSNumber numberWithInt:3]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   367
            [basicArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithInt:10]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   368
            [basicArray replaceObjectAtIndex:12 withObject:[NSNumber numberWithInt:10]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   369
            [basicArray replaceObjectAtIndex:13 withObject:[NSNumber numberWithInt:10]];
11287
9c021eadd374 - Added 'Air Mines' flag for Scheme Settings
antonc27 <antonc27@mail.ru>
parents: 11194
diff changeset
   370
            [basicArray replaceObjectAtIndex:15 withObject:[NSNumber numberWithInt:4]];
5984
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   371
            [gamemodArray replaceObjectAtIndex:2 withObject:[NSNumber numberWithBool:YES]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   372
            [gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   373
            [gamemodArray replaceObjectAtIndex:14 withObject:[NSNumber numberWithBool:YES]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   374
            [gamemodArray replaceObjectAtIndex:15 withObject:[NSNumber numberWithBool:YES]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   375
            [gamemodArray replaceObjectAtIndex:16 withObject:[NSNumber numberWithBool:YES]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   376
            break;
6104
117bdf4e7af9 create teams programmatically
koda
parents: 6103
diff changeset
   377
        case 7:  // fort mode
5984
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   378
            [basicArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithInt:0]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   379
            [basicArray replaceObjectAtIndex:13 withObject:[NSNumber numberWithInt:0]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   380
            [gamemodArray replaceObjectAtIndex:2 withObject:[NSNumber numberWithBool:YES]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   381
            [gamemodArray replaceObjectAtIndex:3 withObject:[NSNumber numberWithBool:YES]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   382
            [gamemodArray replaceObjectAtIndex:10 withObject:[NSNumber numberWithBool:YES]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   383
            [gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   384
            break;
6104
117bdf4e7af9 create teams programmatically
koda
parents: 6103
diff changeset
   385
        case 8:  // timeless
5984
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   386
            [basicArray replaceObjectAtIndex:2 withObject:[NSNumber numberWithInt:100]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   387
            [basicArray replaceObjectAtIndex:4 withObject:[NSNumber numberWithInt:0]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   388
            [basicArray replaceObjectAtIndex:5 withObject:[NSNumber numberWithInt:0]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   389
            [basicArray replaceObjectAtIndex:9 withObject:[NSNumber numberWithInt:30]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   390
            [basicArray replaceObjectAtIndex:10 withObject:[NSNumber numberWithInt:5]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   391
            [basicArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithInt:3]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   392
            [basicArray replaceObjectAtIndex:12 withObject:[NSNumber numberWithInt:10]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   393
            [gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   394
            [gamemodArray replaceObjectAtIndex:20 withObject:[NSNumber numberWithBool:YES]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   395
            break;
6104
117bdf4e7af9 create teams programmatically
koda
parents: 6103
diff changeset
   396
        case 9:  // thinking with portals
5984
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   397
            [basicArray replaceObjectAtIndex:7 withObject:[NSNumber numberWithInt:2]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   398
            [basicArray replaceObjectAtIndex:8 withObject:[NSNumber numberWithInt:25]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   399
            [basicArray replaceObjectAtIndex:10 withObject:[NSNumber numberWithInt:4]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   400
            [basicArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithInt:5]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   401
            [basicArray replaceObjectAtIndex:13 withObject:[NSNumber numberWithInt:5]];
11287
9c021eadd374 - Added 'Air Mines' flag for Scheme Settings
antonc27 <antonc27@mail.ru>
parents: 11194
diff changeset
   402
            [basicArray replaceObjectAtIndex:15 withObject:[NSNumber numberWithInt:4]];
5984
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   403
            [gamemodArray replaceObjectAtIndex:9 withObject:[NSNumber numberWithBool:YES]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   404
            [gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   405
            break;
6104
117bdf4e7af9 create teams programmatically
koda
parents: 6103
diff changeset
   406
        case 10: // king mode
5984
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   407
            [gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   408
            [gamemodArray replaceObjectAtIndex:12 withObject:[NSNumber numberWithBool:YES]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   409
            break;
11192
3dbea499390d - 'Construction Mode' ammo set and game parameters added to iOS front-end
antonc27 <antonc27@mail.ru>
parents: 11191
diff changeset
   410
        case 11: // construction mode
3dbea499390d - 'Construction Mode' ammo set and game parameters added to iOS front-end
antonc27 <antonc27@mail.ru>
parents: 11191
diff changeset
   411
            [basicArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithInt:0]];
3dbea499390d - 'Construction Mode' ammo set and game parameters added to iOS front-end
antonc27 <antonc27@mail.ru>
parents: 11191
diff changeset
   412
            [basicArray replaceObjectAtIndex:13 withObject:[NSNumber numberWithInt:0]];
3dbea499390d - 'Construction Mode' ammo set and game parameters added to iOS front-end
antonc27 <antonc27@mail.ru>
parents: 11191
diff changeset
   413
            [gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]];
3dbea499390d - 'Construction Mode' ammo set and game parameters added to iOS front-end
antonc27 <antonc27@mail.ru>
parents: 11191
diff changeset
   414
            [gamemodArray replaceObjectAtIndex:15 withObject:[NSNumber numberWithBool:YES]];
3dbea499390d - 'Construction Mode' ammo set and game parameters added to iOS front-end
antonc27 <antonc27@mail.ru>
parents: 11191
diff changeset
   415
            [gamemodArray replaceObjectAtIndex:16 withObject:[NSNumber numberWithBool:YES]];
3dbea499390d - 'Construction Mode' ammo set and game parameters added to iOS front-end
antonc27 <antonc27@mail.ru>
parents: 11191
diff changeset
   416
            [gamemodArray replaceObjectAtIndex:18 withObject:[NSNumber numberWithBool:YES]];
3dbea499390d - 'Construction Mode' ammo set and game parameters added to iOS front-end
antonc27 <antonc27@mail.ru>
parents: 11191
diff changeset
   417
            [gamemodArray replaceObjectAtIndex:20 withObject:[NSNumber numberWithBool:YES]];
3dbea499390d - 'Construction Mode' ammo set and game parameters added to iOS front-end
antonc27 <antonc27@mail.ru>
parents: 11191
diff changeset
   418
            break;
5984
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   419
    }
5181
102fef5ca5fc add getawaytime and tagteam mode to ios
koda
parents: 4976
diff changeset
   420
4281
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   421
    NSMutableDictionary *theScheme = [[NSMutableDictionary alloc] initWithObjectsAndKeys:
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   422
                                      basicArray,@"basic",
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   423
                                      gamemodArray,@"gamemod",
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   424
                                      nil];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   425
    [gamemodArray release];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   426
    [basicArray release];
5984
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   427
4281
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   428
    NSString *schemeFile = [[NSString alloc] initWithFormat:@"%@/%@.plist", schemesDirectory, nameWithoutExt];
8441
a00b0fa0dbd7 some whitespaces from ios files
koda
parents: 6908
diff changeset
   429
4281
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   430
    [theScheme writeToFile:schemeFile atomically:YES];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   431
    [schemeFile release];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   432
    [theScheme release];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   433
}
6103
55ecfbf834e3 convert creation chamber functions to class methods
koda
parents: 5984
diff changeset
   434
55ecfbf834e3 convert creation chamber functions to class methods
koda
parents: 5984
diff changeset
   435
@end