diff --git a/src/defs.h b/src/defs.h index 04fcad9..3161543 100644 --- a/src/defs.h +++ b/src/defs.h @@ -434,10 +434,9 @@ enum ST_MAX }; -enum -{ - PLUS_NONE, - PLUS, - PLUS_PLUS, - PLUS_PLUS_PLUS -}; +#define PLUS_NONE 0 +#define PLUS_BASIC (2 << 0) +#define PLUS_STRONGER (2 << 1) +#define PLUS_RANDOM (2 << 2) +#define PLUS_KILL_ALL (2 << 3) +#define PLUS_MIRROR (2 << 4) diff --git a/src/entities/unit.c b/src/entities/unit.c index 186b966..850fe5d 100644 --- a/src/entities/unit.c +++ b/src/entities/unit.c @@ -81,7 +81,7 @@ static void init(void) u->health = u->healthMax = rrnd(1, 4); } - if (game.plus == PLUS_PLUS_PLUS) + if (game.plus & PLUS_STRONGER) { u->canCarryItem = 1; u->health = u->healthMax = rrnd(4, 8); diff --git a/src/structs.h b/src/structs.h index a2d0dcf..9d44f82 100644 --- a/src/structs.h +++ b/src/structs.h @@ -370,7 +370,7 @@ typedef struct { char worldId[MAX_NAME_LENGTH]; int isComplete; int saveSlot; - int plus; + unsigned int plus; Tuple keys[MAX_KEY_TYPES]; Tuple missionStatusHead, *missionStatusTail; Trophy trophyHead, *trophyTail; diff --git a/src/system/i18n.c b/src/system/i18n.c index 7f83fc3..e5af69b 100644 --- a/src/system/i18n.c +++ b/src/system/i18n.c @@ -30,8 +30,8 @@ static HashTable table; void setLanguage(char *applicationName, char *languageCode) { - char language[MAX_LINE_LENGTH], c[MAX_LINE_LENGTH]; - char **key, **value; + char language[MAX_LINE_LENGTH]; + char **key, **value, *c; #ifndef _WIN32 char *lang; #endif diff --git a/src/world/objectives.c b/src/world/objectives.c index cc9e18a..f00ae97 100644 --- a/src/world/objectives.c +++ b/src/world/objectives.c @@ -52,13 +52,13 @@ void initObjectives(void) } } - if (world.isReturnVisit || game.plus != PLUS_NONE) + if (world.isReturnVisit || game.plus & PLUS_KILL_ALL) { o->targetValue = o->totalValue; - o->required = game.plus != PLUS_NONE; + o->required = game.plus & PLUS_KILL_ALL; } - if ((strcmp(o->targetName, "ENEMY") == 0 && o->targetValue == o->totalValue) || game.plus != PLUS_PLUS_PLUS) + if ((strcmp(o->targetName, "ENEMY") == 0 && o->targetValue == o->totalValue) || game.plus & PLUS_KILL_ALL) { world.isEliminateAllEnemies = 1; } diff --git a/src/world/worldLoader.c b/src/world/worldLoader.c index 75585e2..09fc467 100644 --- a/src/world/worldLoader.c +++ b/src/world/worldLoader.c @@ -66,7 +66,7 @@ void loadWorld(char *id) world.missionType = strncmp(world.id, "outpost", 7) == 0 ? MT_OUTPOST : world.missionType; world.missionType = strncmp(world.id, "boss", 4) == 0 ? MT_BOSS : world.missionType; - if (game.plus < PLUS_PLUS) + if (!(game.plus & PLUS_RANDOM)) { loadEnemyTypes(cJSON_GetObjectItem(root, "enemyTypes")->valuestring); } @@ -229,7 +229,7 @@ static void loadObjectives(cJSON *root) world.numObjectives++; } - if (game.plus == PLUS_PLUS_PLUS && !hasEliminateAll) + if ((game.plus & PLUS_KILL_ALL) && !hasEliminateAll) { o = malloc(sizeof(Objective)); memset(o, 0, sizeof(Objective));