project_files/HedgewarsMobile/Classes/CreationChamber.m
author koda
Fri, 18 Feb 2011 00:21:36 +0100
changeset 4945 541d35d1f2e8
parent 4607 7f683c2357a0
child 4950 941f17b2dd9f
permissions -rw-r--r--
in the cocoa ammomenu show descriptions properly for lower weapons updated the way to update weaponset
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
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
     3
 * Copyright (c) 2009-2010 Vittorio Giovara <vittorio.giovara@gmail.com>
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:
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
    80
                          @"93919294221991210322351110012010000002111101010111299",
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
    81
                          @"04050405416006555465544647765766666661555101011154111",
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
    82
                          @"00000000000002055000000400070040000000002000000006000",
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
    83
                          @"13111103121111111231141111111111111112111111011111211",
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:
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
    94
                          @"99999999999999999929999999999999992999999999099999922",
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
    95
                          @"11111101111111111111111111111111111111111111011111111",
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
    96
                          @"00000000000000000000000000000000000000000000000000000",
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
    97
                          @"13111103121111111231141111111111111112111101011111111",
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",
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
   111
                          @"11111111111111111111111111111111111111111001011111111",
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",
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
   123
                          @"44444100442444022101121212224220000000020004000100111",
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
   124
                          @"00000000000000000000000000000000000000000000000000000",
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
   125
                          @"11111111111111111111111111111111111111111011011111111",
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",
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
   137
                          @"04050405416006555465544647765766666661555101011154111",
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
   138
                          @"00000000000000000000000000000000000000000000000000000",
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
   139
                          @"13111103121111111231141111111111111112111111011111111",
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",
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
   153
                          @"11111111111111111111111111111111111111111111011111111",
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",
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
   165
                          @"04050405416006555465544647765766666661555101011154111",
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
   166
                          @"00000000000002055000000400070040000000002000000006000",
541d35d1f2e8 in the cocoa ammomenu show descriptions properly for lower weapons
koda
parents: 4607
diff changeset
   167
                          @"13111103121111111231141111111111111112111111011111111",
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();
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   186
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   187
    if (![[NSFileManager defaultManager] fileExistsAtPath: schemesDirectory]) {
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   188
        [[NSFileManager defaultManager] createDirectoryAtPath:schemesDirectory
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   189
                                  withIntermediateDirectories:NO
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   190
                                                   attributes:nil
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   191
                                                        error:NULL];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   192
    }
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   193
4607
7f683c2357a0 update weapons
koda
parents: 4605
diff changeset
   194
    int basicFlags[] = {100, 100, 45, 15, 47, 5, 100, 5, 35, 25, 3, 4, 0, 2};
7f683c2357a0 update weapons
koda
parents: 4605
diff changeset
   195
    BOOL gameFlags[] = {NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, YES, NO, NO, NO, NO,
7f683c2357a0 update weapons
koda
parents: 4605
diff changeset
   196
        NO, NO, NO, NO, NO, NO, NO};
7f683c2357a0 update weapons
koda
parents: 4605
diff changeset
   197
4281
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   198
    NSMutableArray *basicArray  = [[NSMutableArray alloc] initWithObjects:
4607
7f683c2357a0 update weapons
koda
parents: 4605
diff changeset
   199
                                   [NSNumber numberWithInt:basicFlags[0]],          //initialhealth
7f683c2357a0 update weapons
koda
parents: 4605
diff changeset
   200
                                   [NSNumber numberWithInt:basicFlags[1]],          //damagemodifier
7f683c2357a0 update weapons
koda
parents: 4605
diff changeset
   201
                                   [NSNumber numberWithInt:basicFlags[2]],          //turntime
7f683c2357a0 update weapons
koda
parents: 4605
diff changeset
   202
                                   [NSNumber numberWithInt:basicFlags[3]],          //suddendeathtimeout
7f683c2357a0 update weapons
koda
parents: 4605
diff changeset
   203
                                   [NSNumber numberWithInt:basicFlags[4]],          //waterrise
7f683c2357a0 update weapons
koda
parents: 4605
diff changeset
   204
                                   [NSNumber numberWithInt:basicFlags[5]],          //healthdecrease
7f683c2357a0 update weapons
koda
parents: 4605
diff changeset
   205
                                   [NSNumber numberWithInt:basicFlags[6]],          //ropelength
7f683c2357a0 update weapons
koda
parents: 4605
diff changeset
   206
                                   [NSNumber numberWithInt:basicFlags[7]],          //cratedrops
7f683c2357a0 update weapons
koda
parents: 4605
diff changeset
   207
                                   [NSNumber numberWithInt:basicFlags[8]],          //healthprob
7f683c2357a0 update weapons
koda
parents: 4605
diff changeset
   208
                                   [NSNumber numberWithInt:basicFlags[9]],          //healthamount
7f683c2357a0 update weapons
koda
parents: 4605
diff changeset
   209
                                   [NSNumber numberWithInt:basicFlags[10]],         //minestime
7f683c2357a0 update weapons
koda
parents: 4605
diff changeset
   210
                                   [NSNumber numberWithInt:basicFlags[11]],         //minesnumber
7f683c2357a0 update weapons
koda
parents: 4605
diff changeset
   211
                                   [NSNumber numberWithInt:basicFlags[12]],         //dudmines
7f683c2357a0 update weapons
koda
parents: 4605
diff changeset
   212
                                   [NSNumber numberWithInt:basicFlags[13]],         //explosives
4281
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   213
                                   nil];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   214
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   215
    NSMutableArray *gamemodArray= [[NSMutableArray alloc] initWithObjects:
4607
7f683c2357a0 update weapons
koda
parents: 4605
diff changeset
   216
                                   [NSNumber numberWithBool:gameFlags[0]],          //fortmode
7f683c2357a0 update weapons
koda
parents: 4605
diff changeset
   217
                                   [NSNumber numberWithBool:gameFlags[1]],          //divideteam
7f683c2357a0 update weapons
koda
parents: 4605
diff changeset
   218
                                   [NSNumber numberWithBool:gameFlags[2]],          //solidland
7f683c2357a0 update weapons
koda
parents: 4605
diff changeset
   219
                                   [NSNumber numberWithBool:gameFlags[3]],          //addborder
7f683c2357a0 update weapons
koda
parents: 4605
diff changeset
   220
                                   [NSNumber numberWithBool:gameFlags[4]],          //lowgravity
7f683c2357a0 update weapons
koda
parents: 4605
diff changeset
   221
                                   [NSNumber numberWithBool:gameFlags[5]],          //lasersight
7f683c2357a0 update weapons
koda
parents: 4605
diff changeset
   222
                                   [NSNumber numberWithBool:gameFlags[6]],          //invulnerable
7f683c2357a0 update weapons
koda
parents: 4605
diff changeset
   223
                                   [NSNumber numberWithBool:gameFlags[7]],          //resethealth
7f683c2357a0 update weapons
koda
parents: 4605
diff changeset
   224
                                   [NSNumber numberWithBool:gameFlags[8]],          //vampirism
7f683c2357a0 update weapons
koda
parents: 4605
diff changeset
   225
                                   [NSNumber numberWithBool:gameFlags[9]],          //karma
7f683c2357a0 update weapons
koda
parents: 4605
diff changeset
   226
                                   [NSNumber numberWithBool:gameFlags[10]],         //artillery
7f683c2357a0 update weapons
koda
parents: 4605
diff changeset
   227
                                   [NSNumber numberWithBool:gameFlags[11]],         //randomorder
7f683c2357a0 update weapons
koda
parents: 4605
diff changeset
   228
                                   [NSNumber numberWithBool:gameFlags[12]],         //king
7f683c2357a0 update weapons
koda
parents: 4605
diff changeset
   229
                                   [NSNumber numberWithBool:gameFlags[13]],         //placehedgehogs
7f683c2357a0 update weapons
koda
parents: 4605
diff changeset
   230
                                   [NSNumber numberWithBool:gameFlags[14]],         //clansharesammo
7f683c2357a0 update weapons
koda
parents: 4605
diff changeset
   231
                                   [NSNumber numberWithBool:gameFlags[15]],         //disablegirders
7f683c2357a0 update weapons
koda
parents: 4605
diff changeset
   232
                                   [NSNumber numberWithBool:gameFlags[16]],         //disablelandobjects
7f683c2357a0 update weapons
koda
parents: 4605
diff changeset
   233
                                   [NSNumber numberWithBool:gameFlags[17]],         //aisurvival
7f683c2357a0 update weapons
koda
parents: 4605
diff changeset
   234
                                   [NSNumber numberWithBool:gameFlags[18]],         //infattack
7f683c2357a0 update weapons
koda
parents: 4605
diff changeset
   235
                                   [NSNumber numberWithBool:gameFlags[19]],         //resetweaps
7f683c2357a0 update weapons
koda
parents: 4605
diff changeset
   236
                                   [NSNumber numberWithBool:gameFlags[20]],         //perhogammo
7f683c2357a0 update weapons
koda
parents: 4605
diff changeset
   237
                                   [NSNumber numberWithBool:gameFlags[21]],         //nowind
7f683c2357a0 update weapons
koda
parents: 4605
diff changeset
   238
                                   [NSNumber numberWithBool:gameFlags[22]],         //morewind
4281
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   239
                                   nil];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   240
    
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   241
    NSMutableDictionary *theScheme = [[NSMutableDictionary alloc] initWithObjectsAndKeys:
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   242
                                      basicArray,@"basic",
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   243
                                      gamemodArray,@"gamemod",
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   244
                                      nil];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   245
    [gamemodArray release];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   246
    [basicArray release];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   247
    
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   248
    NSString *schemeFile = [[NSString alloc] initWithFormat:@"%@/%@.plist", schemesDirectory, nameWithoutExt];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   249
    
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   250
    [theScheme writeToFile:schemeFile atomically:YES];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   251
    [schemeFile release];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   252
    [theScheme release];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   253
}