diff --git a/common.mk b/common.mk index 87b2a7e..aa8c07f 100644 --- a/common.mk +++ b/common.mk @@ -1,5 +1,5 @@ -VERSION = 1.0 -REVISION = 3 +VERSION = 1.1 +REVISION = 0 LOCALE_MO = $(patsubst %.po,%.mo,$(wildcard locale/*.po)) OUT = bin diff --git a/src/entities/evilBlobs/evilBlob.c b/src/entities/evilBlobs/evilBlob.c index 9a8a35c..a8b517f 100644 --- a/src/entities/evilBlobs/evilBlob.c +++ b/src/entities/evilBlobs/evilBlob.c @@ -252,7 +252,7 @@ static void lookForPlayer(void) r = randF(); - if (world.missionType == MT_OUTPOST) + if (world.missionType == MT_OUTPOST || game.plus) { r = randF() * 0.65; } diff --git a/src/entities/eyeDroids/eyeDroid.c b/src/entities/eyeDroids/eyeDroid.c index 9f1045f..ec2ed1c 100644 --- a/src/entities/eyeDroids/eyeDroid.c +++ b/src/entities/eyeDroids/eyeDroid.c @@ -223,7 +223,7 @@ static void lookForPlayer(void) r = randF(); - if (world.missionType == MT_OUTPOST) + if (world.missionType == MT_OUTPOST || game.plus) { r = randF() * 0.65; } diff --git a/src/entities/unit.c b/src/entities/unit.c index 0e3a693..b6b05f9 100644 --- a/src/entities/unit.c +++ b/src/entities/unit.c @@ -43,14 +43,6 @@ Unit *createUnit(void) u->oxygen = MAX_OXYGEN; - u->canCarryItem = rand() % 100 < 85; - - if (world.missionType == MT_OUTPOST) - { - u->canCarryItem = 1; - u->health = u->healthMax = rrnd(1, 4); - } - u->spriteTime = 0; u->spriteFrame = 0; @@ -80,6 +72,14 @@ static void init(void) u->startX = (int) u->x; u->startY = (int) u->y; } + + u->canCarryItem = rand() % 100 < 85; + + if (world.missionType == MT_OUTPOST || game.plus) + { + u->canCarryItem = 1; + u->health = u->healthMax = rrnd(1, 4); + } } static void tick(void) diff --git a/src/entities/unit.h b/src/entities/unit.h index 4407afc..1728bfa 100644 --- a/src/entities/unit.h +++ b/src/entities/unit.h @@ -37,4 +37,5 @@ extern void playBattleSound(int snd, int ch, int x, int y); extern int rrnd(int low, int high); extern Entity *self; +extern Game game; extern World world; diff --git a/src/main.c b/src/main.c index f1efeb3..5ba3e03 100644 --- a/src/main.c +++ b/src/main.c @@ -111,10 +111,11 @@ static long capFrameRate(const long then) static void handleCommandLine(int argc, char *argv[]) { - int i; + int i, plus; char *worldId; worldId = NULL; + plus = 0; for (i = 1 ; i < argc ; i++) { @@ -182,11 +183,16 @@ static void handleCommandLine(int argc, char *argv[]) initCredits(); return; } + + if (strcmp(argv[i], "-plus") == 0) + { + plus = 1; + } } if (worldId != NULL) { - initWorldTest(worldId); + initWorldTest(worldId, plus); } else { diff --git a/src/main.h b/src/main.h index 62cfeda..986e780 100644 --- a/src/main.h +++ b/src/main.h @@ -31,7 +31,7 @@ extern void init18N(int argc, char *argv[]); extern void initGameSystem(void); extern void initLookups(void); extern void initSDL(void); -extern void initWorldTest(char *worldId); +extern void initWorldTest(char *worldId, int plus); extern void initEnding(void); extern void initCredits(void); extern void prepareScene(void); diff --git a/src/structs.h b/src/structs.h index ce8801d..ec58990 100644 --- a/src/structs.h +++ b/src/structs.h @@ -370,6 +370,7 @@ typedef struct { char worldId[MAX_NAME_LENGTH]; int isComplete; int saveSlot; + int plus; Tuple keys[MAX_KEY_TYPES]; Tuple missionStatusHead, *missionStatusTail; Trophy trophyHead, *trophyTail; diff --git a/src/test/worldTest.c b/src/test/worldTest.c index ec71e8d..77273ae 100644 --- a/src/test/worldTest.c +++ b/src/test/worldTest.c @@ -20,7 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "worldTest.h" -void initWorldTest(char *worldId) +void initWorldTest(char *worldId, int plus) { loadGame(0); @@ -29,6 +29,9 @@ void initWorldTest(char *worldId) if (worldId != NULL) { STRNCPY(game.worldId, worldId, MAX_NAME_LENGTH); + + game.plus = 1; + initWorld(); } else diff --git a/src/world/worldLoader.c b/src/world/worldLoader.c index 61d3f63..72819ad 100644 --- a/src/world/worldLoader.c +++ b/src/world/worldLoader.c @@ -25,6 +25,7 @@ static void loadTriggers(cJSON *root); static void loadBob(cJSON *root); static void loadEntities(cJSON *root); static void loadObjectives(cJSON *root); +static void initPlusEnemyTypes(void); void loadWorld(char *id) { @@ -66,7 +67,14 @@ 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; - loadEnemyTypes(cJSON_GetObjectItem(root, "enemyTypes")->valuestring); + if (!game.plus) + { + loadEnemyTypes(cJSON_GetObjectItem(root, "enemyTypes")->valuestring); + } + else + { + initPlusEnemyTypes(); + } loadTriggers(cJSON_GetObjectItem(root, "triggers")); @@ -176,6 +184,11 @@ static void loadEntities(cJSON *root) { self->alive = ALIVE_DEAD; } + + if (self->type == ET_DOOR && game.plus) + { + self->alive = ALIVE_DEAD; + } } } @@ -198,5 +211,25 @@ static void loadObjectives(cJSON *root) o->targetValue = cJSON_GetObjectItem(node, "targetValue")->valueint; o->currentValue = cJSON_GetObjectItem(node, "currentValue")->valueint; o->required = cJSON_GetObjectItem(node, "required")->valueint; + + if (game.plus) + { + o->required = 1; + } } } + +static void initPlusEnemyTypes(void) +{ + world.numEnemyTypes = 7; + + world.enemyTypes = malloc(world.numEnemyTypes * sizeof(char*)); + + world.enemyTypes[0] = "Pistol"; + world.enemyTypes[1] = "Grenade"; + world.enemyTypes[2] = "MachineGun"; + world.enemyTypes[3] = "Shotgun"; + world.enemyTypes[4] = "Laser"; + world.enemyTypes[5] = "SpreadGun"; + world.enemyTypes[6] = "Plasma"; +}