|
@@ -21,37 +21,30 @@
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
int optimize_parse_arguments(
|
|
int optimize_parse_arguments(
|
|
|
- int argc, char argv[][128], char id[64], char *level,
|
|
|
|
|
- int *sets, int *stats, struct Stats *min_stats, char *gui,
|
|
|
|
|
- char *storage, char excluded_teams[128][8], char excluded_units[128][8]
|
|
|
|
|
|
|
+ int argc, char argv[][128], Optimizer_Options *options
|
|
|
){
|
|
){
|
|
|
// Get unit identifier
|
|
// Get unit identifier
|
|
|
if (argc < 1){
|
|
if (argc < 1){
|
|
|
fprintf(stderr, "No unit specified for optimization\n");
|
|
fprintf(stderr, "No unit specified for optimization\n");
|
|
|
return ERROR_INPUT_OPTIMIZE_NO_UNIT;
|
|
return ERROR_INPUT_OPTIMIZE_NO_UNIT;
|
|
|
}
|
|
}
|
|
|
- //strncpy(id, argv[0], 64);
|
|
|
|
|
if (strlen(argv[0]) > 63){
|
|
if (strlen(argv[0]) > 63){
|
|
|
- strncpy(id, argv[0], 63);
|
|
|
|
|
- id[63] = '\0';
|
|
|
|
|
|
|
+ strncpy(options->id, argv[0], 63);
|
|
|
|
|
+ options->id[63] = '\0';
|
|
|
}
|
|
}
|
|
|
else{
|
|
else{
|
|
|
- strcpy(id, argv[0]);
|
|
|
|
|
|
|
+ strcpy(options->id, argv[0]);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // Assign default values for non-value arguments
|
|
|
|
|
- *storage = 0;
|
|
|
|
|
- *gui = 0;
|
|
|
|
|
-
|
|
|
|
|
// Loop command line arguments
|
|
// Loop command line arguments
|
|
|
for (int i = 1; i < argc; i ++){
|
|
for (int i = 1; i < argc; i ++){
|
|
|
|
|
|
|
|
// Rune level arguments
|
|
// Rune level arguments
|
|
|
if (strcmp("--level", argv[i]) == 0 || strcmp("-l", argv[i]) == 0){
|
|
if (strcmp("--level", argv[i]) == 0 || strcmp("-l", argv[i]) == 0){
|
|
|
if (i < argc - 1){
|
|
if (i < argc - 1){
|
|
|
- if (strcmp("current", argv[i + 1]) == 0) *level = 0;
|
|
|
|
|
- else if (strcmp("12", argv[i + 1]) == 0) *level = 12;
|
|
|
|
|
- else if (strcmp("15", argv[i + 1]) == 0) *level = 15;
|
|
|
|
|
|
|
+ if (strcmp("current", argv[i + 1]) == 0) options->level = 0;
|
|
|
|
|
+ else if (strcmp("12", argv[i + 1]) == 0) options->level = 12;
|
|
|
|
|
+ else if (strcmp("15", argv[i + 1]) == 0) options->level = 15;
|
|
|
else{
|
|
else{
|
|
|
fprintf(
|
|
fprintf(
|
|
|
stderr,
|
|
stderr,
|
|
@@ -79,7 +72,6 @@ int optimize_parse_arguments(
|
|
|
){
|
|
){
|
|
|
if (i < argc - 1){
|
|
if (i < argc - 1){
|
|
|
// Separate string by commas
|
|
// Separate string by commas
|
|
|
- int j = 0;
|
|
|
|
|
// Returns first token
|
|
// Returns first token
|
|
|
char opt_list[128];
|
|
char opt_list[128];
|
|
|
strcpy(opt_list, argv[i + 1]);
|
|
strcpy(opt_list, argv[i + 1]);
|
|
@@ -88,9 +80,12 @@ int optimize_parse_arguments(
|
|
|
// Keep printing tokens while one of the
|
|
// Keep printing tokens while one of the
|
|
|
// delimiters present in the list, or until its complete
|
|
// delimiters present in the list, or until its complete
|
|
|
while (token != NULL){
|
|
while (token != NULL){
|
|
|
- strcpy(excluded_teams[j], token);
|
|
|
|
|
|
|
+ strcpy(
|
|
|
|
|
+ options->excluded_teams[options->total_excluded_teams],
|
|
|
|
|
+ token
|
|
|
|
|
+ );
|
|
|
|
|
+ options->total_excluded_teams ++;
|
|
|
token = strtok(NULL, ",");
|
|
token = strtok(NULL, ",");
|
|
|
- j ++;
|
|
|
|
|
}
|
|
}
|
|
|
i ++; // Advance one position in argument reading
|
|
i ++; // Advance one position in argument reading
|
|
|
}
|
|
}
|
|
@@ -110,7 +105,6 @@ int optimize_parse_arguments(
|
|
|
){
|
|
){
|
|
|
if (i < argc - 1){
|
|
if (i < argc - 1){
|
|
|
// Separate string by commas
|
|
// Separate string by commas
|
|
|
- int j = 0;
|
|
|
|
|
// Returns first token
|
|
// Returns first token
|
|
|
char opt_list[128];
|
|
char opt_list[128];
|
|
|
strcpy(opt_list, argv[i + 1]);
|
|
strcpy(opt_list, argv[i + 1]);
|
|
@@ -119,9 +113,12 @@ int optimize_parse_arguments(
|
|
|
// Keep printing tokens while one of the
|
|
// Keep printing tokens while one of the
|
|
|
// delimiters present in the list, or until its complete
|
|
// delimiters present in the list, or until its complete
|
|
|
while (token != NULL){
|
|
while (token != NULL){
|
|
|
- strcpy(excluded_units[j], token);
|
|
|
|
|
|
|
+ strcpy(
|
|
|
|
|
+ options->excluded_units[options->total_excluded_units],
|
|
|
|
|
+ token
|
|
|
|
|
+ );
|
|
|
|
|
+ options->total_excluded_units ++;
|
|
|
token = strtok(NULL, ",");
|
|
token = strtok(NULL, ",");
|
|
|
- j ++;
|
|
|
|
|
}
|
|
}
|
|
|
i ++; // Advance one position in argument reading
|
|
i ++; // Advance one position in argument reading
|
|
|
}
|
|
}
|
|
@@ -131,11 +128,11 @@ int optimize_parse_arguments(
|
|
|
"Argument %s requires a comma-separated list of values.\n",
|
|
"Argument %s requires a comma-separated list of values.\n",
|
|
|
argv[i]
|
|
argv[i]
|
|
|
);
|
|
);
|
|
|
- return ERROR_INPUT_OPTIMIZE_NO_SET;
|
|
|
|
|
|
|
+ return ERROR_INPUT_OPTIMIZE_NO_UNITS;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // Rune sets argument
|
|
|
|
|
|
|
+ // Mandatory rune sets argument
|
|
|
else if (strcmp("--sets", argv[i]) == 0 || strcmp("-e", argv[i]) == 0){
|
|
else if (strcmp("--sets", argv[i]) == 0 || strcmp("-e", argv[i]) == 0){
|
|
|
if (i < argc - 1){
|
|
if (i < argc - 1){
|
|
|
// Separate string by commas
|
|
// Separate string by commas
|
|
@@ -146,29 +143,120 @@ int optimize_parse_arguments(
|
|
|
// Keep printing tokens while one of the
|
|
// Keep printing tokens while one of the
|
|
|
// delimiters present in the list, or until its complete
|
|
// delimiters present in the list, or until its complete
|
|
|
while (token != NULL && j < 3){
|
|
while (token != NULL && j < 3){
|
|
|
- if (strcmp(token, "energy") == 0) sets[j] = ENERGY;
|
|
|
|
|
- else if (strcmp(token, "guard") == 0) sets[j] = GUARD;
|
|
|
|
|
- else if (strcmp(token, "swift") == 0) sets[j] = SWIFT;
|
|
|
|
|
- else if (strcmp(token, "blade") == 0) sets[j] = BLADE;
|
|
|
|
|
- else if (strcmp(token, "rage") == 0) sets[j] = RAGE;
|
|
|
|
|
- else if (strcmp(token, "focus") == 0) sets[j] = FOCUS;
|
|
|
|
|
- else if (strcmp(token, "endure") == 0) sets[j] = ENDURE;
|
|
|
|
|
- else if (strcmp(token, "fatal") == 0) sets[j] = FATAL;
|
|
|
|
|
- else if (strcmp(token, "despair") == 0) sets[j] = DESPAIR;
|
|
|
|
|
- else if (strcmp(token, "vampire") == 0) sets[j] = VAMPIRE;
|
|
|
|
|
- else if (strcmp(token, "violent") == 0) sets[j] = VIOLENT;
|
|
|
|
|
- else if (strcmp(token, "nemesis") == 0) sets[j] = NEMESIS;
|
|
|
|
|
- else if (strcmp(token, "will") == 0) sets[j] = WILL;
|
|
|
|
|
- else if (strcmp(token, "shield") == 0) sets[j] = SHIELD;
|
|
|
|
|
- else if (strcmp(token, "revenge") == 0) sets[j] = REVENGE;
|
|
|
|
|
- else if (strcmp(token, "destroy") == 0) sets[j] = DESTROY;
|
|
|
|
|
- else if (strcmp(token, "fight") == 0) sets[j] = FIGHT;
|
|
|
|
|
|
|
+ if (strcmp(token, "energy") == 0)
|
|
|
|
|
+ options->sets[j] = ENERGY;
|
|
|
|
|
+ else if (strcmp(token, "guard") == 0)
|
|
|
|
|
+ options->sets[j] = GUARD;
|
|
|
|
|
+ else if (strcmp(token, "swift") == 0)
|
|
|
|
|
+ options->sets[j] = SWIFT;
|
|
|
|
|
+ else if (strcmp(token, "blade") == 0)
|
|
|
|
|
+ options->sets[j] = BLADE;
|
|
|
|
|
+ else if (strcmp(token, "rage") == 0)
|
|
|
|
|
+ options->sets[j] = RAGE;
|
|
|
|
|
+ else if (strcmp(token, "focus") == 0)
|
|
|
|
|
+ options->sets[j] = FOCUS;
|
|
|
|
|
+ else if (strcmp(token, "endure") == 0)
|
|
|
|
|
+ options->sets[j] = ENDURE;
|
|
|
|
|
+ else if (strcmp(token, "fatal") == 0)
|
|
|
|
|
+ options->sets[j] = FATAL;
|
|
|
|
|
+ else if (strcmp(token, "despair") == 0)
|
|
|
|
|
+ options->sets[j] = DESPAIR;
|
|
|
|
|
+ else if (strcmp(token, "vampire") == 0)
|
|
|
|
|
+ options->sets[j] = VAMPIRE;
|
|
|
|
|
+ else if (strcmp(token, "violent") == 0)
|
|
|
|
|
+ options->sets[j] = VIOLENT;
|
|
|
|
|
+ else if (strcmp(token, "nemesis") == 0)
|
|
|
|
|
+ options->sets[j] = NEMESIS;
|
|
|
|
|
+ else if (strcmp(token, "will") == 0)
|
|
|
|
|
+ options->sets[j] = WILL;
|
|
|
|
|
+ else if (strcmp(token, "shield") == 0)
|
|
|
|
|
+ options->sets[j] = SHIELD;
|
|
|
|
|
+ else if (strcmp(token, "revenge") == 0)
|
|
|
|
|
+ options->sets[j] = REVENGE;
|
|
|
|
|
+ else if (strcmp(token, "destroy") == 0)
|
|
|
|
|
+ options->sets[j] = DESTROY;
|
|
|
|
|
+ else if (strcmp(token, "fight") == 0)
|
|
|
|
|
+ options->sets[j] = FIGHT;
|
|
|
else if (strcmp(token, "determination") == 0)
|
|
else if (strcmp(token, "determination") == 0)
|
|
|
- sets[j] = DETERMINATION;
|
|
|
|
|
- else if (strcmp(token, "enhance") == 0) sets[j] = ENHANCE;
|
|
|
|
|
- else if (strcmp(token, "accuracy") == 0) sets[j] = ACCURACY;
|
|
|
|
|
|
|
+ options->sets[j] = DETERMINATION;
|
|
|
|
|
+ else if (strcmp(token, "enhance") == 0)
|
|
|
|
|
+ options->sets[j] = ENHANCE;
|
|
|
|
|
+ else if (strcmp(token, "accuracy") == 0)
|
|
|
|
|
+ options->sets[j] = ACCURACY;
|
|
|
else if (strcmp(token, "tolerance") == 0)
|
|
else if (strcmp(token, "tolerance") == 0)
|
|
|
- sets[j] = TOLERANCE;
|
|
|
|
|
|
|
+ options->sets[j] = TOLERANCE;
|
|
|
|
|
+ else{
|
|
|
|
|
+ fprintf(stderr, "Unknown rune set %s.\n", token);
|
|
|
|
|
+ return ERROR_INPUT_OPTIMIZE_INVALID_SET;
|
|
|
|
|
+ }
|
|
|
|
|
+ token = strtok(NULL, ",");
|
|
|
|
|
+ j ++;
|
|
|
|
|
+ }
|
|
|
|
|
+ i ++; // Advance one position in argument reading
|
|
|
|
|
+ }
|
|
|
|
|
+ else{
|
|
|
|
|
+ fprintf(
|
|
|
|
|
+ stderr,
|
|
|
|
|
+ "Argument %s requires a comma-separated list of values.\n",
|
|
|
|
|
+ argv[i]
|
|
|
|
|
+ );
|
|
|
|
|
+ return ERROR_INPUT_OPTIMIZE_NO_SET;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // Optional rune sets argument
|
|
|
|
|
+ else if (strcmp("--opt-sets", argv[i]) == 0 || strcmp("-i", argv[i]) == 0){
|
|
|
|
|
+ if (i < argc - 1){
|
|
|
|
|
+ // Separate string by commas
|
|
|
|
|
+ int j = 0;
|
|
|
|
|
+ // Returns first token
|
|
|
|
|
+ char *token = strtok(argv[i + 1], ",");
|
|
|
|
|
+
|
|
|
|
|
+ // Keep printing tokens while one of the
|
|
|
|
|
+ // delimiters present in the list, or until its complete
|
|
|
|
|
+ while (token != NULL){
|
|
|
|
|
+ if (strcmp(token, "energy") == 0)
|
|
|
|
|
+ options->optional_sets[ENERGY] = TRUE;
|
|
|
|
|
+ else if (strcmp(token, "guard") == 0)
|
|
|
|
|
+ options->optional_sets[GUARD] = TRUE;
|
|
|
|
|
+ else if (strcmp(token, "swift") == 0)
|
|
|
|
|
+ options->optional_sets[SWIFT] = TRUE;
|
|
|
|
|
+ else if (strcmp(token, "blade") == 0)
|
|
|
|
|
+ options->optional_sets[BLADE] = TRUE;
|
|
|
|
|
+ else if (strcmp(token, "rage") == 0)
|
|
|
|
|
+ options->optional_sets[RAGE] = TRUE;
|
|
|
|
|
+ else if (strcmp(token, "focus") == 0)
|
|
|
|
|
+ options->optional_sets[FOCUS] = TRUE;
|
|
|
|
|
+ else if (strcmp(token, "endure") == 0)
|
|
|
|
|
+ options->optional_sets[ENDURE] = TRUE;
|
|
|
|
|
+ else if (strcmp(token, "fatal") == 0)
|
|
|
|
|
+ options->optional_sets[FATAL] = TRUE;
|
|
|
|
|
+ else if (strcmp(token, "despair") == 0)
|
|
|
|
|
+ options->optional_sets[DESPAIR] = TRUE;
|
|
|
|
|
+ else if (strcmp(token, "vampire") == 0)
|
|
|
|
|
+ options->optional_sets[VAMPIRE] = TRUE;
|
|
|
|
|
+ else if (strcmp(token, "violent") == 0)
|
|
|
|
|
+ options->optional_sets[VIOLENT] = TRUE;
|
|
|
|
|
+ else if (strcmp(token, "nemesis") == 0)
|
|
|
|
|
+ options->optional_sets[NEMESIS] = TRUE;
|
|
|
|
|
+ else if (strcmp(token, "will") == 0)
|
|
|
|
|
+ options->optional_sets[WILL] = TRUE;
|
|
|
|
|
+ else if (strcmp(token, "shield") == 0)
|
|
|
|
|
+ options->optional_sets[SHIELD] = TRUE;
|
|
|
|
|
+ else if (strcmp(token, "revenge") == 0)
|
|
|
|
|
+ options->optional_sets[REVENGE] = TRUE;
|
|
|
|
|
+ else if (strcmp(token, "destroy") == 0)
|
|
|
|
|
+ options->optional_sets[DESTROY] = TRUE;
|
|
|
|
|
+ else if (strcmp(token, "fight") == 0)
|
|
|
|
|
+ options->optional_sets[FIGHT] = TRUE;
|
|
|
|
|
+ else if (strcmp(token, "determination") == 0)
|
|
|
|
|
+ options->optional_sets[DETERMINATION] = TRUE;
|
|
|
|
|
+ else if (strcmp(token, "enhance") == 0)
|
|
|
|
|
+ options->optional_sets[ENHANCE] = TRUE;
|
|
|
|
|
+ else if (strcmp(token, "accuracy") == 0)
|
|
|
|
|
+ options->optional_sets[ACCURACY] = TRUE;
|
|
|
|
|
+ else if (strcmp(token, "tolerance") == 0)
|
|
|
|
|
+ options->optional_sets[TOLERANCE] = TRUE;
|
|
|
else{
|
|
else{
|
|
|
fprintf(stderr, "Unknown rune set %s.\n", token);
|
|
fprintf(stderr, "Unknown rune set %s.\n", token);
|
|
|
return ERROR_INPUT_OPTIMIZE_INVALID_SET;
|
|
return ERROR_INPUT_OPTIMIZE_INVALID_SET;
|
|
@@ -192,30 +280,39 @@ int optimize_parse_arguments(
|
|
|
else if (strcmp("--stats", argv[i]) == 0 || strcmp("-t", argv[i]) == 0){
|
|
else if (strcmp("--stats", argv[i]) == 0 || strcmp("-t", argv[i]) == 0){
|
|
|
if (i < argc - 1){
|
|
if (i < argc - 1){
|
|
|
// Separate string by commas
|
|
// Separate string by commas
|
|
|
- int j = 0;
|
|
|
|
|
// Returns first token
|
|
// Returns first token
|
|
|
char *token = strtok(argv[i + 1], ",");
|
|
char *token = strtok(argv[i + 1], ",");
|
|
|
|
|
|
|
|
// Keep printing tokens while one of the
|
|
// Keep printing tokens while one of the
|
|
|
// delimiters present in the list, or until its complete
|
|
// delimiters present in the list, or until its complete
|
|
|
- while (token != NULL && j < 3){
|
|
|
|
|
- if (strcmp(token, "hp") == 0) stats[j] = HP_PERCENT;
|
|
|
|
|
- else if (strcmp(token, "atk") == 0) stats[j] = ATK_PERCENT;
|
|
|
|
|
- else if (strcmp(token, "def") == 0) stats[j] = DEF_PERCENT;
|
|
|
|
|
- else if (strcmp(token, "hpflat") == 0) stats[j] = HP_FLAT;
|
|
|
|
|
- else if (strcmp(token, "atkflat") == 0) stats[j] = ATK_FLAT;
|
|
|
|
|
- else if (strcmp(token, "defflat") == 0) stats[j] = DEF_FLAT;
|
|
|
|
|
- else if (strcmp(token, "spd") == 0) stats[j] = SPD;
|
|
|
|
|
- else if (strcmp(token, "crr") == 0) stats[j] = CRR;
|
|
|
|
|
- else if (strcmp(token, "crd") == 0) stats[j] = CRD;
|
|
|
|
|
- else if (strcmp(token, "res") == 0) stats[j] = RES;
|
|
|
|
|
- else if (strcmp(token, "acc") == 0) stats[j] = ACC;
|
|
|
|
|
|
|
+ while (token != NULL){
|
|
|
|
|
+ if (strcmp(token, "hp") == 0)
|
|
|
|
|
+ options->stats[HP_PERCENT] = TRUE;
|
|
|
|
|
+ else if (strcmp(token, "atk") == 0)
|
|
|
|
|
+ options->stats[ATK_PERCENT] = TRUE;
|
|
|
|
|
+ else if (strcmp(token, "def") == 0)
|
|
|
|
|
+ options->stats[DEF_PERCENT] = TRUE;
|
|
|
|
|
+ else if (strcmp(token, "hpflat") == 0)
|
|
|
|
|
+ options->stats[HP_FLAT] = TRUE;
|
|
|
|
|
+ else if (strcmp(token, "atkflat") == 0)
|
|
|
|
|
+ options->stats[ATK_FLAT] = TRUE;
|
|
|
|
|
+ else if (strcmp(token, "defflat") == 0)
|
|
|
|
|
+ options->stats[DEF_FLAT] = TRUE;
|
|
|
|
|
+ else if (strcmp(token, "spd") == 0)
|
|
|
|
|
+ options->stats[SPD] = TRUE;
|
|
|
|
|
+ else if (strcmp(token, "crr") == 0)
|
|
|
|
|
+ options->stats[CRR] = TRUE;
|
|
|
|
|
+ else if (strcmp(token, "crd") == 0)
|
|
|
|
|
+ options->stats[CRD] = TRUE;
|
|
|
|
|
+ else if (strcmp(token, "res") == 0)
|
|
|
|
|
+ options->stats[RES] = TRUE;
|
|
|
|
|
+ else if (strcmp(token, "acc") == 0)
|
|
|
|
|
+ options->stats[ACC] = TRUE;
|
|
|
else{
|
|
else{
|
|
|
fprintf(stderr, "Unknown rune stat %s.\n", token);
|
|
fprintf(stderr, "Unknown rune stat %s.\n", token);
|
|
|
return ERROR_INPUT_OPTIMIZE_INVALID_STAT;
|
|
return ERROR_INPUT_OPTIMIZE_INVALID_STAT;
|
|
|
}
|
|
}
|
|
|
token = strtok(NULL, ",");
|
|
token = strtok(NULL, ",");
|
|
|
- j ++;
|
|
|
|
|
}
|
|
}
|
|
|
i ++; // Advance one position in argument reading
|
|
i ++; // Advance one position in argument reading
|
|
|
}
|
|
}
|
|
@@ -236,7 +333,7 @@ int optimize_parse_arguments(
|
|
|
if (i < argc - 1){
|
|
if (i < argc - 1){
|
|
|
unsigned short stat_tmp = atoi(argv[i + 1]);
|
|
unsigned short stat_tmp = atoi(argv[i + 1]);
|
|
|
if (stat_tmp == 1) stat_tmp = 0;
|
|
if (stat_tmp == 1) stat_tmp = 0;
|
|
|
- min_stats->hp = stat_tmp;
|
|
|
|
|
|
|
+ options->min_stats->hp = stat_tmp;
|
|
|
i ++; // Advance one position in argument reading
|
|
i ++; // Advance one position in argument reading
|
|
|
}
|
|
}
|
|
|
else{
|
|
else{
|
|
@@ -252,7 +349,7 @@ int optimize_parse_arguments(
|
|
|
if (i < argc - 1){
|
|
if (i < argc - 1){
|
|
|
unsigned short stat_tmp = atoi(argv[i + 1]);
|
|
unsigned short stat_tmp = atoi(argv[i + 1]);
|
|
|
if (stat_tmp == 1) stat_tmp = 0;
|
|
if (stat_tmp == 1) stat_tmp = 0;
|
|
|
- min_stats->atk = stat_tmp;
|
|
|
|
|
|
|
+ options->min_stats->atk = stat_tmp;
|
|
|
i ++; // Advance one position in argument reading
|
|
i ++; // Advance one position in argument reading
|
|
|
}
|
|
}
|
|
|
else{
|
|
else{
|
|
@@ -268,7 +365,7 @@ int optimize_parse_arguments(
|
|
|
if (i < argc - 1){
|
|
if (i < argc - 1){
|
|
|
unsigned short stat_tmp = atoi(argv[i + 1]);
|
|
unsigned short stat_tmp = atoi(argv[i + 1]);
|
|
|
if (stat_tmp == 1) stat_tmp = 0;
|
|
if (stat_tmp == 1) stat_tmp = 0;
|
|
|
- min_stats->def = stat_tmp;
|
|
|
|
|
|
|
+ options->min_stats->def = stat_tmp;
|
|
|
i ++; // Advance one position in argument reading
|
|
i ++; // Advance one position in argument reading
|
|
|
}
|
|
}
|
|
|
else{
|
|
else{
|
|
@@ -284,7 +381,7 @@ int optimize_parse_arguments(
|
|
|
if (i < argc - 1){
|
|
if (i < argc - 1){
|
|
|
unsigned short stat_tmp = atoi(argv[i + 1]);
|
|
unsigned short stat_tmp = atoi(argv[i + 1]);
|
|
|
if (stat_tmp == 1) stat_tmp = 0;
|
|
if (stat_tmp == 1) stat_tmp = 0;
|
|
|
- min_stats->spd = stat_tmp;
|
|
|
|
|
|
|
+ options->min_stats->spd = stat_tmp;
|
|
|
i ++; // Advance one position in argument reading
|
|
i ++; // Advance one position in argument reading
|
|
|
}
|
|
}
|
|
|
else{
|
|
else{
|
|
@@ -301,7 +398,7 @@ int optimize_parse_arguments(
|
|
|
unsigned short stat_tmp = atoi(argv[i + 1]);
|
|
unsigned short stat_tmp = atoi(argv[i + 1]);
|
|
|
if (stat_tmp == 1) stat_tmp = 0;
|
|
if (stat_tmp == 1) stat_tmp = 0;
|
|
|
else if (stat_tmp > 100) stat_tmp = 100;
|
|
else if (stat_tmp > 100) stat_tmp = 100;
|
|
|
- min_stats->crr = stat_tmp;
|
|
|
|
|
|
|
+ options->min_stats->crr = stat_tmp;
|
|
|
// Advance one position in argument reading
|
|
// Advance one position in argument reading
|
|
|
i ++;
|
|
i ++;
|
|
|
}
|
|
}
|
|
@@ -318,7 +415,7 @@ int optimize_parse_arguments(
|
|
|
if (i < argc - 1){
|
|
if (i < argc - 1){
|
|
|
unsigned short stat_tmp = atoi(argv[i + 1]);
|
|
unsigned short stat_tmp = atoi(argv[i + 1]);
|
|
|
if (stat_tmp == 1) stat_tmp = 0;
|
|
if (stat_tmp == 1) stat_tmp = 0;
|
|
|
- min_stats->crd = stat_tmp;
|
|
|
|
|
|
|
+ options->min_stats->crd = stat_tmp;
|
|
|
i ++; // Advance one position in argument reading
|
|
i ++; // Advance one position in argument reading
|
|
|
}
|
|
}
|
|
|
else{
|
|
else{
|
|
@@ -335,7 +432,7 @@ int optimize_parse_arguments(
|
|
|
unsigned short stat_tmp = atoi(argv[i + 1]);
|
|
unsigned short stat_tmp = atoi(argv[i + 1]);
|
|
|
if (stat_tmp == 1) stat_tmp = 0;
|
|
if (stat_tmp == 1) stat_tmp = 0;
|
|
|
else if (stat_tmp > 100) stat_tmp = 100;
|
|
else if (stat_tmp > 100) stat_tmp = 100;
|
|
|
- min_stats->res = stat_tmp;
|
|
|
|
|
|
|
+ options->min_stats->res = stat_tmp;
|
|
|
i ++; // Advance one position in argument reading
|
|
i ++; // Advance one position in argument reading
|
|
|
}
|
|
}
|
|
|
else{
|
|
else{
|
|
@@ -352,7 +449,7 @@ int optimize_parse_arguments(
|
|
|
unsigned short stat_tmp = atoi(argv[i + 1]);
|
|
unsigned short stat_tmp = atoi(argv[i + 1]);
|
|
|
if (stat_tmp == 1) stat_tmp = 0;
|
|
if (stat_tmp == 1) stat_tmp = 0;
|
|
|
else if (stat_tmp > 85) stat_tmp = 85;
|
|
else if (stat_tmp > 85) stat_tmp = 85;
|
|
|
- min_stats->acc = stat_tmp;
|
|
|
|
|
|
|
+ options->min_stats->acc = stat_tmp;
|
|
|
i ++; // Advance one position in argument reading
|
|
i ++; // Advance one position in argument reading
|
|
|
}
|
|
}
|
|
|
else{
|
|
else{
|
|
@@ -368,7 +465,7 @@ int optimize_parse_arguments(
|
|
|
if (i < argc - 1){
|
|
if (i < argc - 1){
|
|
|
unsigned int stat_tmp = atoi(argv[i + 1]);
|
|
unsigned int stat_tmp = atoi(argv[i + 1]);
|
|
|
if (stat_tmp == 1) stat_tmp = 0;
|
|
if (stat_tmp == 1) stat_tmp = 0;
|
|
|
- min_stats->ehp = stat_tmp;
|
|
|
|
|
|
|
+ options->min_stats->ehp = stat_tmp;
|
|
|
i ++; // Advance one position in argument reading
|
|
i ++; // Advance one position in argument reading
|
|
|
}
|
|
}
|
|
|
else{
|
|
else{
|
|
@@ -384,7 +481,7 @@ int optimize_parse_arguments(
|
|
|
if (i < argc - 1){
|
|
if (i < argc - 1){
|
|
|
unsigned short stat_tmp = atoi(argv[i + 1]);
|
|
unsigned short stat_tmp = atoi(argv[i + 1]);
|
|
|
if (stat_tmp == 1) stat_tmp = 0;
|
|
if (stat_tmp == 1) stat_tmp = 0;
|
|
|
- min_stats->dmg = stat_tmp;
|
|
|
|
|
|
|
+ options->min_stats->dmg = stat_tmp;
|
|
|
i ++; // Advance one position in argument reading
|
|
i ++; // Advance one position in argument reading
|
|
|
}
|
|
}
|
|
|
else{
|
|
else{
|
|
@@ -394,15 +491,21 @@ int optimize_parse_arguments(
|
|
|
return ERROR_INPUT_OPTIMIZE_NO_DMG;
|
|
return ERROR_INPUT_OPTIMIZE_NO_DMG;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ // Allow broken sets?
|
|
|
|
|
+ else if (
|
|
|
|
|
+ strcmp("--broken", argv[i]) == 0 || strcmp("-k", argv[i]) == 0
|
|
|
|
|
+ ){
|
|
|
|
|
+ options->broken_sets = TRUE;
|
|
|
|
|
+ }
|
|
|
// Storage option?
|
|
// Storage option?
|
|
|
else if (
|
|
else if (
|
|
|
strcmp("--storage", argv[i]) == 0 || strcmp("-o", argv[i]) == 0
|
|
strcmp("--storage", argv[i]) == 0 || strcmp("-o", argv[i]) == 0
|
|
|
){
|
|
){
|
|
|
- *storage = 1;
|
|
|
|
|
|
|
+ options->storage = TRUE;
|
|
|
}
|
|
}
|
|
|
// GUI invoked?
|
|
// GUI invoked?
|
|
|
else if (strcmp("--gui", argv[i]) == 0 || strcmp("-g", argv[i]) == 0){
|
|
else if (strcmp("--gui", argv[i]) == 0 || strcmp("-g", argv[i]) == 0){
|
|
|
- *gui = 1;
|
|
|
|
|
|
|
+ options->gui = TRUE;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|