Start of custom mission plus settings.
This commit is contained in:
parent
60d8020c4e
commit
181fc83632
13
src/defs.h
13
src/defs.h
|
@ -434,10 +434,9 @@ enum
|
||||||
ST_MAX
|
ST_MAX
|
||||||
};
|
};
|
||||||
|
|
||||||
enum
|
#define PLUS_NONE 0
|
||||||
{
|
#define PLUS_BASIC (2 << 0)
|
||||||
PLUS_NONE,
|
#define PLUS_STRONGER (2 << 1)
|
||||||
PLUS,
|
#define PLUS_RANDOM (2 << 2)
|
||||||
PLUS_PLUS,
|
#define PLUS_KILL_ALL (2 << 3)
|
||||||
PLUS_PLUS_PLUS
|
#define PLUS_MIRROR (2 << 4)
|
||||||
};
|
|
||||||
|
|
|
@ -81,7 +81,7 @@ static void init(void)
|
||||||
u->health = u->healthMax = rrnd(1, 4);
|
u->health = u->healthMax = rrnd(1, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (game.plus == PLUS_PLUS_PLUS)
|
if (game.plus & PLUS_STRONGER)
|
||||||
{
|
{
|
||||||
u->canCarryItem = 1;
|
u->canCarryItem = 1;
|
||||||
u->health = u->healthMax = rrnd(4, 8);
|
u->health = u->healthMax = rrnd(4, 8);
|
||||||
|
|
|
@ -370,7 +370,7 @@ typedef struct {
|
||||||
char worldId[MAX_NAME_LENGTH];
|
char worldId[MAX_NAME_LENGTH];
|
||||||
int isComplete;
|
int isComplete;
|
||||||
int saveSlot;
|
int saveSlot;
|
||||||
int plus;
|
unsigned int plus;
|
||||||
Tuple keys[MAX_KEY_TYPES];
|
Tuple keys[MAX_KEY_TYPES];
|
||||||
Tuple missionStatusHead, *missionStatusTail;
|
Tuple missionStatusHead, *missionStatusTail;
|
||||||
Trophy trophyHead, *trophyTail;
|
Trophy trophyHead, *trophyTail;
|
||||||
|
|
|
@ -30,8 +30,8 @@ static HashTable table;
|
||||||
|
|
||||||
void setLanguage(char *applicationName, char *languageCode)
|
void setLanguage(char *applicationName, char *languageCode)
|
||||||
{
|
{
|
||||||
char language[MAX_LINE_LENGTH], c[MAX_LINE_LENGTH];
|
char language[MAX_LINE_LENGTH];
|
||||||
char **key, **value;
|
char **key, **value, *c;
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
char *lang;
|
char *lang;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -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->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;
|
world.isEliminateAllEnemies = 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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, "outpost", 7) == 0 ? MT_OUTPOST : world.missionType;
|
||||||
world.missionType = strncmp(world.id, "boss", 4) == 0 ? MT_BOSS : 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);
|
loadEnemyTypes(cJSON_GetObjectItem(root, "enemyTypes")->valuestring);
|
||||||
}
|
}
|
||||||
|
@ -229,7 +229,7 @@ static void loadObjectives(cJSON *root)
|
||||||
world.numObjectives++;
|
world.numObjectives++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (game.plus == PLUS_PLUS_PLUS && !hasEliminateAll)
|
if ((game.plus & PLUS_KILL_ALL) && !hasEliminateAll)
|
||||||
{
|
{
|
||||||
o = malloc(sizeof(Objective));
|
o = malloc(sizeof(Objective));
|
||||||
memset(o, 0, sizeof(Objective));
|
memset(o, 0, sizeof(Objective));
|
||||||
|
|
Loading…
Reference in New Issue