project_files/HedgewarsMobile/Classes/CommodityFunctions.m
changeset 3930 8b00b4f93242
parent 3926 668b71f31e51
child 3940 cc29628976cc
equal deleted inserted replaced
3928:2560731c860d 3930:8b00b4f93242
    72 
    72 
    73     NSDictionary *theWeapon = nil;
    73     NSDictionary *theWeapon = nil;
    74     switch (type) {
    74     switch (type) {
    75         case 0: //default
    75         case 0: //default
    76             theWeapon = [[NSDictionary alloc] initWithObjectsAndKeys:
    76             theWeapon = [[NSDictionary alloc] initWithObjectsAndKeys:
    77                          [NSNumber numberWithInt:HW_getNumberOfWeapons()],@"version",
       
    78                          @"939192942219912103223511100120100000021111010101",@"ammostore_initialqt",
    77                          @"939192942219912103223511100120100000021111010101",@"ammostore_initialqt",
    79                          @"040504054160065554655446477657666666615551010111",@"ammostore_probability",
    78                          @"040504054160065554655446477657666666615551010111",@"ammostore_probability",
    80                          @"000000000000020550000004000700400000000020000000",@"ammostore_delay",
    79                          @"000000000000020550000004000700400000000020000000",@"ammostore_delay",
    81                          @"131111031211111112311411111111111111121111110111",@"ammostore_crate", nil];
    80                          @"131111031211111112311411111111111111121111110111",@"ammostore_crate", nil];
    82             break;
    81             break;
    83         case 1: //crazy
    82         case 1: //crazy
    84             theWeapon = [[NSDictionary alloc] initWithObjectsAndKeys:
    83             theWeapon = [[NSDictionary alloc] initWithObjectsAndKeys:
    85                          [NSNumber numberWithInt:HW_getNumberOfWeapons()],@"version",
       
    86                          @"999999999999999999299999999999999929999999990999",@"ammostore_initialqt",
    84                          @"999999999999999999299999999999999929999999990999",@"ammostore_initialqt",
    87                          @"111111011111111111111111111111111111111111110111",@"ammostore_probability",
    85                          @"111111011111111111111111111111111111111111110111",@"ammostore_probability",
    88                          @"000000000000000000000000000000000000000000000000",@"ammostore_delay",
    86                          @"000000000000000000000000000000000000000000000000",@"ammostore_delay",
    89                          @"131111031211111112311411111111111111121111010111",@"ammostore_crate", nil];
    87                          @"131111031211111112311411111111111111121111010111",@"ammostore_crate", nil];
    90             break;
    88             break;
    91         case 2: //pro mode
    89         case 2: //pro mode
    92             theWeapon = [[NSDictionary alloc] initWithObjectsAndKeys:
    90             theWeapon = [[NSDictionary alloc] initWithObjectsAndKeys:
    93                          [NSNumber numberWithInt:HW_getNumberOfWeapons()],@"version",
       
    94                          @"909000900000000000000900000000000000000000000000",@"ammostore_initialqt",
    91                          @"909000900000000000000900000000000000000000000000",@"ammostore_initialqt",
    95                          @"000000000000000000000000000000000000000000000000",@"ammostore_probability",
    92                          @"000000000000000000000000000000000000000000000000",@"ammostore_probability",
    96                          @"000000000000020550000004000700400000000020000000",@"ammostore_delay",
    93                          @"000000000000020550000004000700400000000020000000",@"ammostore_delay",
    97                          @"111111111111111111111111111111111111111110010111",@"ammostore_crate", nil];
    94                          @"111111111111111111111111111111111111111110010111",@"ammostore_crate", nil];
    98             break;
    95             break;
    99         case 3: //shoppa
    96         case 3: //shoppa
   100             theWeapon = [[NSDictionary alloc] initWithObjectsAndKeys:
    97             theWeapon = [[NSDictionary alloc] initWithObjectsAndKeys:
   101                          [NSNumber numberWithInt:HW_getNumberOfWeapons()],@"version",
       
   102                          @"000000990000000000000000000000000000000000000000",@"ammostore_initialqt",
    98                          @"000000990000000000000000000000000000000000000000",@"ammostore_initialqt",
   103                          @"444441004424440221011212122242200000000200040001",@"ammostore_probability",
    99                          @"444441004424440221011212122242200000000200040001",@"ammostore_probability",
   104                          @"000000000000000000000000000000000000000000000000",@"ammostore_delay",
   100                          @"000000000000000000000000000000000000000000000000",@"ammostore_delay",
   105                          @"111111111111111111111111111111111111111110110111",@"ammostore_crate", nil];
   101                          @"111111111111111111111111111111111111111110110111",@"ammostore_crate", nil];
   106             break;
   102             break;
   107         case 4: //basketball
   103         case 4: //basketball
   108             theWeapon = [[NSDictionary alloc] initWithObjectsAndKeys:
   104             theWeapon = [[NSDictionary alloc] initWithObjectsAndKeys:
   109                          [NSNumber numberWithInt:HW_getNumberOfWeapons()],@"version",
       
   110                          @"939192942219912103223511100120100000021111010100",@"ammostore_initialqt",
   105                          @"939192942219912103223511100120100000021111010100",@"ammostore_initialqt",
   111                          @"000000000000000000000000000000000000000000000000",@"ammostore_probability",
   106                          @"000000000000000000000000000000000000000000000000",@"ammostore_probability",
   112                          @"000000000000000550000004000700400000000020000000",@"ammostore_delay",
   107                          @"000000000000000550000004000700400000000020000000",@"ammostore_delay",
   113                          @"111111111111111111111111111111111111111111110111",@"ammostore_crate", nil];
   108                          @"111111111111111111111111111111111111111111110111",@"ammostore_crate", nil];
   114             break;
   109             break;
   115         case 5: //minefield
   110         case 5: //minefield
   116             theWeapon = [[NSDictionary alloc] initWithObjectsAndKeys:
   111             theWeapon = [[NSDictionary alloc] initWithObjectsAndKeys:
   117                          [NSNumber numberWithInt:HW_getNumberOfWeapons()],@"version",
       
   118                          @"000000990009000000030000000000000000000000000000",@"ammostore_initialqt",
   112                          @"000000990009000000030000000000000000000000000000",@"ammostore_initialqt",
   119                          @"000000000000000000000000000000000000000000000000",@"ammostore_probability",
   113                          @"000000000000000000000000000000000000000000000000",@"ammostore_probability",
   120                          @"000000000000020550000004000700400000000020000000",@"ammostore_delay",
   114                          @"000000000000020550000004000700400000000020000000",@"ammostore_delay",
   121                          @"111111111111111111111111111111111111111111110111",@"ammostore_crate", nil];
   115                          @"111111111111111111111111111111111111111111110111",@"ammostore_crate", nil];
   122             break;
   116             break;
   229     natural_t mem_free = vm_stat.free_count * pagesize;
   223     natural_t mem_free = vm_stat.free_count * pagesize;
   230     natural_t mem_total = mem_used + mem_free;
   224     natural_t mem_total = mem_used + mem_free;
   231     DLog(@"used: %u free: %u total: %u", mem_used, mem_free, mem_total);
   225     DLog(@"used: %u free: %u total: %u", mem_used, mem_free, mem_total);
   232 }
   226 }
   233 
   227 
   234 BOOL isPhone () {
   228 BOOL inline isApplePhone () {
   235     return (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone);
   229     return (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone);
   236 }
   230 }
   237 
   231 
   238 NSString *modelType () {
   232 NSString *modelType () {
   239     size_t size;
   233     size_t size;