project_files/HedgewarsMobile/Classes/CreationChamber.m
author koda
Wed, 27 Apr 2011 02:34:38 +0200
changeset 5181 102fef5ca5fc
parent 4976 088d40d8aba2
child 5185 7607a64e1853
permissions -rw-r--r--
add getawaytime and tagteam mode to ios some tweaks to scheme creation
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
4976
088d40d8aba2 Happy 2011 :)
koda
parents: 4950
diff changeset
     3
 * Copyright (c) 2009-2011 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
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    16
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
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
 * File created on 12/11/2010.
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
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    21
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    22
#import "CreationChamber.h"
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    23
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    24
void createTeamNamed (NSString *nameWithoutExt) {
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    25
    NSString *teamsDirectory = TEAMS_DIRECTORY();
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    26
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    27
    if (![[NSFileManager defaultManager] fileExistsAtPath: teamsDirectory]) {
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    28
        [[NSFileManager defaultManager] createDirectoryAtPath:teamsDirectory
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    29
                                  withIntermediateDirectories:NO
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    30
                                                   attributes:nil
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    31
                                                        error:NULL];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    32
    }
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    33
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    34
    NSMutableArray *hedgehogs = [[NSMutableArray alloc] initWithCapacity: HW_getMaxNumberOfHogs()];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    35
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    36
    for (int i = 0; i < HW_getMaxNumberOfHogs(); i++) {
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    37
        NSString *hogName = [[NSString alloc] initWithFormat:@"hedgehog %d",i];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    38
        NSDictionary *hog = [[NSDictionary alloc] initWithObjectsAndKeys:
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    39
                             [NSNumber numberWithInt:0],@"level",
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    40
                             hogName,@"hogname",
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    41
                             @"NoHat",@"hat",
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    42
                             nil];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    43
        [hogName release];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    44
        [hedgehogs addObject:hog];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    45
        [hog release];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    46
    }
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    47
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    48
    NSDictionary *theTeam = [[NSDictionary alloc] initWithObjectsAndKeys:
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    49
                             @"0",@"hash",
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    50
                             @"Statue",@"grave",
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    51
                             @"Plane",@"fort",
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    52
                             @"Default",@"voicepack",
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    53
                             @"hedgewars",@"flag",
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    54
                             hedgehogs,@"hedgehogs",
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    55
                             nil];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    56
    [hedgehogs release];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    57
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    58
    NSString *teamFile = [[NSString alloc] initWithFormat:@"%@/%@.plist", teamsDirectory, nameWithoutExt];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    59
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    60
    [theTeam writeToFile:teamFile atomically:YES];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    61
    [teamFile release];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    62
    [theTeam release];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    63
}
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    64
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    65
void createWeaponNamed (NSString *nameWithoutExt, int type) {
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    66
    NSString *weaponsDirectory = WEAPONS_DIRECTORY();
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    67
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    68
    if (![[NSFileManager defaultManager] fileExistsAtPath: weaponsDirectory]) {
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    69
        [[NSFileManager defaultManager] createDirectoryAtPath:weaponsDirectory
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    70
                                  withIntermediateDirectories:NO
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    71
                                                   attributes:nil
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    72
                                                        error:NULL];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    73
    }
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    74
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    75
    NSDictionary *theWeapon = nil;
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    76
    switch (type) {
4607
7f683c2357a0 update weapons
koda
parents: 4605
diff changeset
    77
        default: //default
4945
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
    78
            theWeapon = [[NSDictionary alloc] initWithObjects:
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
    79
                         [NSArray arrayWithObjects:
4950
941f17b2dd9f disable the two last workinprogress weapons on the ios release
koda
parents: 4945
diff changeset
    80
                          @"93919294221991210322351110012010000002111101010111200",
941f17b2dd9f disable the two last workinprogress weapons on the ios release
koda
parents: 4945
diff changeset
    81
                          @"04050405416006555465544647765766666661555101011154100",
4945
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
    82
                          @"00000000000002055000000400070040000000002000000006000",
4950
941f17b2dd9f disable the two last workinprogress weapons on the ios release
koda
parents: 4945
diff changeset
    83
                          @"13111103121111111231141111111111111112111111011111200",
4945
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
    84
                          nil]
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
    85
                                                      forKeys: [NSArray arrayWithObjects:
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
    86
                                                                @"ammostore_initialqt",
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
    87
                                                                @"ammostore_probability",
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
    88
                                                                @"ammostore_delay",
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
    89
                                                                @"ammostore_crate", nil]];
4281
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    90
            break;
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    91
        case 1: //crazy
4945
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
    92
            theWeapon = [[NSDictionary alloc] initWithObjects:
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
    93
                         [NSArray arrayWithObjects:
4950
941f17b2dd9f disable the two last workinprogress weapons on the ios release
koda
parents: 4945
diff changeset
    94
                          @"99999999999999999929999999999999992999999999099999900",
941f17b2dd9f disable the two last workinprogress weapons on the ios release
koda
parents: 4945
diff changeset
    95
                          @"11111101111111111111111111111111111111111111011111100",
4945
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
    96
                          @"00000000000000000000000000000000000000000000000000000",
4950
941f17b2dd9f disable the two last workinprogress weapons on the ios release
koda
parents: 4945
diff changeset
    97
                          @"13111103121111111231141111111111111112111101011111100",
4945
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
    98
                          nil]
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
    99
                                                      forKeys: [NSArray arrayWithObjects:
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
   100
                                                                @"ammostore_initialqt",
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
   101
                                                                @"ammostore_probability",
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
   102
                                                                @"ammostore_delay",
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
   103
                                                                @"ammostore_crate", nil]];
4281
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   104
            break;
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   105
        case 2: //pro mode
4945
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
   106
            theWeapon = [[NSDictionary alloc] initWithObjects:
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
   107
                         [NSArray arrayWithObjects:
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
   108
                          @"90900090000000000000090000000000000000000000000000000",
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
   109
                          @"00000000000000000000000000000000000000000000000000000",
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
   110
                          @"00000000000002055000000400070040000000002000000000000",
4950
941f17b2dd9f disable the two last workinprogress weapons on the ios release
koda
parents: 4945
diff changeset
   111
                          @"11111111111111111111111111111111111111111001011111100",
4945
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
   112
                          nil]
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
   113
                                                      forKeys: [NSArray arrayWithObjects:
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
   114
                                                                @"ammostore_initialqt",
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
   115
                                                                @"ammostore_probability",
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
   116
                                                                @"ammostore_delay",
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
   117
                                                                @"ammostore_crate", nil]];
4281
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   118
            break;
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   119
        case 3: //shoppa
4945
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
   120
            theWeapon = [[NSDictionary alloc] initWithObjects:
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
   121
                         [NSArray arrayWithObjects:
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
   122
                          @"00000099000000000000000000000000000000000000000000000",
4950
941f17b2dd9f disable the two last workinprogress weapons on the ios release
koda
parents: 4945
diff changeset
   123
                          @"44444100442444022101121212224220000000020004000100100",
4945
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
   124
                          @"00000000000000000000000000000000000000000000000000000",
4950
941f17b2dd9f disable the two last workinprogress weapons on the ios release
koda
parents: 4945
diff changeset
   125
                          @"11111111111111111111111111111111111111111011011111100",
4945
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
   126
                          nil]
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
   127
                                                      forKeys: [NSArray arrayWithObjects:
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
   128
                                                                @"ammostore_initialqt",
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
   129
                                                                @"ammostore_probability",
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
   130
                                                                @"ammostore_delay",
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
   131
                                                                @"ammostore_crate", nil]];
4281
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   132
            break;
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   133
        case 4: //clean slate
4945
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
   134
            theWeapon = [[NSDictionary alloc] initWithObjects:
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
   135
                         [NSArray arrayWithObjects:
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
   136
                          @"10100090000100000110000000000000000000000000000010000",
4950
941f17b2dd9f disable the two last workinprogress weapons on the ios release
koda
parents: 4945
diff changeset
   137
                          @"04050405416006555465544647765766666661555101011154100",
4945
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
   138
                          @"00000000000000000000000000000000000000000000000000000",
4950
941f17b2dd9f disable the two last workinprogress weapons on the ios release
koda
parents: 4945
diff changeset
   139
                          @"13111103121111111231141111111111111112111111011111100",
4945
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
   140
                          nil]
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
   141
                                                      forKeys: [NSArray arrayWithObjects:
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
   142
                                                                @"ammostore_initialqt",
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
   143
                                                                @"ammostore_probability",
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
   144
                                                                @"ammostore_delay",
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
   145
                                                                @"ammostore_crate", nil]];
4281
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   146
            break;
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   147
        case 5: //minefield
4945
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
   148
            theWeapon = [[NSDictionary alloc] initWithObjects:
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
   149
                         [NSArray arrayWithObjects:
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
   150
                          @"00000099000900000003000000000000000000000000000000000",
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
   151
                          @"00000000000000000000000000000000000000000000000000000",
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
   152
                          @"00000000000002055000000400070040000000002000000006000",
4950
941f17b2dd9f disable the two last workinprogress weapons on the ios release
koda
parents: 4945
diff changeset
   153
                          @"11111111111111111111111111111111111111111111011111100",
4945
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
   154
                          nil]
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
   155
                                                      forKeys: [NSArray arrayWithObjects:
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
   156
                                                                @"ammostore_initialqt",
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
   157
                                                                @"ammostore_probability",
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
   158
                                                                @"ammostore_delay",
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
   159
                                                                @"ammostore_crate", nil]];
4284
57a501a69e5f update iFrontend with new schemes and weaps, fix up smaller glitches
koda
parents: 4281
diff changeset
   160
            break;
57a501a69e5f update iFrontend with new schemes and weaps, fix up smaller glitches
koda
parents: 4281
diff changeset
   161
        case 6: //thinking with portals
4945
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
   162
            theWeapon = [[NSDictionary alloc] initWithObjects:
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
   163
                         [NSArray arrayWithObjects:
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
   164
                          @"90000090020000000021000000000000001100000900000000000",
4950
941f17b2dd9f disable the two last workinprogress weapons on the ios release
koda
parents: 4945
diff changeset
   165
                          @"04050405416006555465544647765766666661555101011154100",
4945
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
   166
                          @"00000000000002055000000400070040000000002000000006000",
4950
941f17b2dd9f disable the two last workinprogress weapons on the ios release
koda
parents: 4945
diff changeset
   167
                          @"13111103121111111231141111111111111112111111011111100",
4945
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
   168
                          nil]
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
   169
                                                      forKeys: [NSArray arrayWithObjects:
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
   170
                                                                @"ammostore_initialqt",
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
   171
                                                                @"ammostore_probability",
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
   172
                                                                @"ammostore_delay",
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
   173
                                                                @"ammostore_crate", nil]];
4281
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   174
            break;
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   175
    }
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 *weaponFile = [[NSString alloc] initWithFormat:@"%@/%@.plist", weaponsDirectory, 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
    [theWeapon writeToFile:weaponFile atomically:YES];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   180
    [weaponFile release];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   181
    [theWeapon 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
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   184
void createSchemeNamed (NSString *nameWithoutExt) {
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   185
    NSString *schemesDirectory = SCHEMES_DIRECTORY();
5181
102fef5ca5fc add getawaytime and tagteam mode to ios
koda
parents: 4976
diff changeset
   186
    NSString *path = nil;
4281
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   187
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   188
    if (![[NSFileManager defaultManager] fileExistsAtPath: schemesDirectory]) {
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   189
        [[NSFileManager defaultManager] createDirectoryAtPath:schemesDirectory
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   190
                                  withIntermediateDirectories:NO
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   191
                                                   attributes:nil
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   192
                                                        error:NULL];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   193
    }
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   194
5181
102fef5ca5fc add getawaytime and tagteam mode to ios
koda
parents: 4976
diff changeset
   195
    // load data to get the size of the arrays and their default values
102fef5ca5fc add getawaytime and tagteam mode to ios
koda
parents: 4976
diff changeset
   196
    path = [NSString stringWithFormat:@"%@/basicFlags_en.plist",IFRONTEND_DIRECTORY()];
102fef5ca5fc add getawaytime and tagteam mode to ios
koda
parents: 4976
diff changeset
   197
    NSArray *basicSettings = [[NSArray alloc] initWithContentsOfFile:path];
102fef5ca5fc add getawaytime and tagteam mode to ios
koda
parents: 4976
diff changeset
   198
    NSMutableArray *basicArray  = [[NSMutableArray alloc] initWithCapacity:[basicSettings count]];
102fef5ca5fc add getawaytime and tagteam mode to ios
koda
parents: 4976
diff changeset
   199
    for (NSDictionary *basicDict in basicSettings)
102fef5ca5fc add getawaytime and tagteam mode to ios
koda
parents: 4976
diff changeset
   200
        [basicArray addObject:[basicDict objectForKey:@"default"]];
102fef5ca5fc add getawaytime and tagteam mode to ios
koda
parents: 4976
diff changeset
   201
    [basicSettings release];
4281
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   202
5181
102fef5ca5fc add getawaytime and tagteam mode to ios
koda
parents: 4976
diff changeset
   203
    path = [NSString stringWithFormat:@"%@/gameFlags_en.plist",IFRONTEND_DIRECTORY()];
102fef5ca5fc add getawaytime and tagteam mode to ios
koda
parents: 4976
diff changeset
   204
    NSArray *mods = [[NSArray alloc] initWithContentsOfFile:path];
102fef5ca5fc add getawaytime and tagteam mode to ios
koda
parents: 4976
diff changeset
   205
    NSMutableArray *gamemodArray= [[NSMutableArray alloc] initWithCapacity:[mods count]];
102fef5ca5fc add getawaytime and tagteam mode to ios
koda
parents: 4976
diff changeset
   206
    for (int i = 0; i < [mods count]; i++)
102fef5ca5fc add getawaytime and tagteam mode to ios
koda
parents: 4976
diff changeset
   207
        [gamemodArray addObject:[NSNumber numberWithBool:NO]];
102fef5ca5fc add getawaytime and tagteam mode to ios
koda
parents: 4976
diff changeset
   208
    [mods release];
102fef5ca5fc add getawaytime and tagteam mode to ios
koda
parents: 4976
diff changeset
   209
102fef5ca5fc add getawaytime and tagteam mode to ios
koda
parents: 4976
diff changeset
   210
    // workaround for randomorder that has to be set to YES
102fef5ca5fc add getawaytime and tagteam mode to ios
koda
parents: 4976
diff changeset
   211
    [gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]];
102fef5ca5fc add getawaytime and tagteam mode to ios
koda
parents: 4976
diff changeset
   212
4281
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   213
    NSMutableDictionary *theScheme = [[NSMutableDictionary alloc] initWithObjectsAndKeys:
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   214
                                      basicArray,@"basic",
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   215
                                      gamemodArray,@"gamemod",
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   216
                                      nil];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   217
    [gamemodArray release];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   218
    [basicArray release];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   219
    
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   220
    NSString *schemeFile = [[NSString alloc] initWithFormat:@"%@/%@.plist", schemesDirectory, nameWithoutExt];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   221
    
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   222
    [theScheme writeToFile:schemeFile atomically:YES];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   223
    [schemeFile release];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   224
    [theScheme release];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   225
}