diff --git a/src/defs.h b/src/defs.h index 0ca566e..849b907 100644 --- a/src/defs.h +++ b/src/defs.h @@ -100,7 +100,8 @@ enum ET_ENEMY, ET_TEEKA, ET_BOSS, - ET_HEART_CELL, + ET_HEART, + ET_CELL, ET_KEY, ET_ITEM, ET_CONSUMABLE, diff --git a/src/entities/items/cell.c b/src/entities/items/cell.c index 015ed11..5ac2213 100644 --- a/src/entities/items/cell.c +++ b/src/entities/items/cell.c @@ -28,7 +28,7 @@ Entity *initCell(void) i = (Item*)createItem(); - i->type = ET_HEART_CELL; + i->type = ET_CELL; i->isMissionTarget = 1; diff --git a/src/entities/items/heart.c b/src/entities/items/heart.c index 6be4ed5..b36eb9b 100644 --- a/src/entities/items/heart.c +++ b/src/entities/items/heart.c @@ -29,7 +29,7 @@ Entity *initHeart(Entity *e) i = (Item*)createItem(); - i->type = ET_HEART_CELL; + i->type = ET_HEART; i->isMissionTarget = 1; diff --git a/src/entities/items/item.c b/src/entities/items/item.c index ba9d877..e728c33 100644 --- a/src/entities/items/item.c +++ b/src/entities/items/item.c @@ -255,14 +255,25 @@ static void save(cJSON *root) i = (Item*)self; - if (i->type != ET_KEY) + switch (i->type) { - cJSON_AddStringToObject(root, "type", "Item"); - } - else - { - cJSON_AddStringToObject(root, "type", i->sprite[0]->name); + case ET_KEY: + cJSON_AddStringToObject(root, "type", i->sprite[0]->name); + break; + + case ET_HEART: + cJSON_AddStringToObject(root, "type", "Heart"); + break; + + case ET_CELL: + cJSON_AddStringToObject(root, "type", "Cell"); + break; + + default: + cJSON_AddStringToObject(root, "type", "Item"); + break; } + cJSON_AddNumberToObject(root, "canBeCarried", i->canBeCarried); cJSON_AddNumberToObject(root, "canBePickedUp", i->canBePickedUp); cJSON_AddNumberToObject(root, "isMissionTarget", i->isMissionTarget); diff --git a/src/hub/postMission.c b/src/hub/postMission.c index 37cc5a9..99c1652 100644 --- a/src/hub/postMission.c +++ b/src/hub/postMission.c @@ -235,7 +235,7 @@ static int getPostMissionStatus(void) { for (e = world.entityHead.next ; e != NULL ; e = e->next) { - if (e->type == ET_HEART_CELL) + if (e->type == ET_HEART || e->type == ET_CELL) { return MS_MISSING_HEART_CELL; } diff --git a/src/test/atlasTest.c b/src/test/atlasTest.c index 2b670e5..963710b 100644 --- a/src/test/atlasTest.c +++ b/src/test/atlasTest.c @@ -24,12 +24,12 @@ void initAtlasTest(void) { int test; - dev.debug = 0; + dev.debug = 1; dev.cheatStatic = 0; dev.cheatBlind = 1; dev.cheatNoEnemies = 0; dev.cheatKeys = 0; - dev.cheatPower = 0; + dev.cheatPower = 1; dev.cheatHealth = 0; dev.cheatLevels = 0; dev.takeScreenshots = 0; diff --git a/src/world/objectives.c b/src/world/objectives.c index 55f042e..70e36ca 100644 --- a/src/world/objectives.c +++ b/src/world/objectives.c @@ -175,7 +175,7 @@ static int isMissingHeartCell(char *targetName) { if (e->alive == ALIVE_ALIVE) { - if (e->type == ET_HEART_CELL) + if (e->type == ET_HEART || e->type == ET_CELL) { return 0; } diff --git a/src/world/radar.c b/src/world/radar.c index c79bbd5..1846a78 100644 --- a/src/world/radar.c +++ b/src/world/radar.c @@ -158,7 +158,8 @@ static void enableMarker(int type, int i) marker[i].visible = 1; break; - case ET_HEART_CELL: + case ET_HEART: + case ET_CELL: case ET_KEY: case ET_ITEM: case ET_DESTRUCTABLE: @@ -335,7 +336,8 @@ static int isValidBlip(Entity *e) case ET_MIA: case ET_TEEKA: case ET_BOSS: - case ET_HEART_CELL: + case ET_HEART: + case ET_CELL: case ET_KEY: case ET_ITEM: case ET_DESTRUCTABLE: @@ -373,7 +375,8 @@ static void getBlipColor(Entity *e, SDL_Color *c) break; - case ET_HEART_CELL: + case ET_HEART: + case ET_CELL: case ET_KEY: case ET_ITEM: c->g = 168;