diff --git a/gfx/planets/torelliFireStorm.png b/gfx/planets/torelliFireStorm.png new file mode 100644 index 0000000..29fa4ca Binary files /dev/null and b/gfx/planets/torelliFireStorm.png differ diff --git a/src/battle/battle.c b/src/battle/battle.c index d007eff..9cad771 100644 --- a/src/battle/battle.c +++ b/src/battle/battle.c @@ -35,6 +35,7 @@ static void start(void); static void options(void); static void returnFromOptions(void); static void checkSuspicionLevel(void); +static void doTorelliFireStorm(void); static int show; static float ssx, ssy; @@ -159,6 +160,8 @@ static void doBattle(void) doPlayer(); checkSuspicionLevel(); + + doTorelliFireStorm(); if (player->alive == ALIVE_ALIVE) { @@ -213,6 +216,13 @@ static void draw(void) drawBackground(battle.background); blitScaled(battle.planetTexture, battle.planet.x, battle.planet.y, battle.planetWidth, battle.planetHeight); + if (battle.destroyTorelli) + { + SDL_SetRenderDrawBlendMode(app.renderer, SDL_BLENDMODE_BLEND); + SDL_SetTextureAlphaMod(battle.fireStormTexture, battle.torelliFireStormAlpha); + blitScaled(battle.fireStormTexture, battle.planet.x, battle.planet.y, battle.planetWidth, battle.planetHeight); + SDL_SetRenderDrawBlendMode(app.renderer, SDL_BLENDMODE_NONE); + } drawStars(); @@ -415,6 +425,14 @@ static void checkSuspicionLevel(void) } } +static void doTorelliFireStorm(void) +{ + if (battle.destroyTorelli) + { + battle.torelliFireStormAlpha = MIN(battle.torelliFireStormAlpha + 0.25, 255); + } +} + void destroyBattle(void) { Entity *ent; diff --git a/src/battle/script.c b/src/battle/script.c index f599564..385b521 100644 --- a/src/battle/script.c +++ b/src/battle/script.c @@ -299,6 +299,10 @@ static void executeNextLine(ScriptRunner *runner) { runScript = 0; } + else if (strcmp(command, "DESTROY_TORELLI") == 0) + { + battle.destroyTorelli = 1; + } else { SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_WARN, "ERROR: Unrecognised script command '%s'\n", command); diff --git a/src/galaxy/mission.c b/src/galaxy/mission.c index 8c3b610..69d4d80 100644 --- a/src/galaxy/mission.c +++ b/src/galaxy/mission.c @@ -154,6 +154,7 @@ void loadMission(char *filename) } battle.planetTexture = getTexture(planet); + battle.fireStormTexture = getTexture("gfx/planets/torelliFireStorm.png"); battle.planet.x = (SCREEN_WIDTH / 2) - (rand() % SCREEN_WIDTH) + (rand() % SCREEN_WIDTH); battle.planet.y = (SCREEN_HEIGHT / 2) - (rand() % SCREEN_HEIGHT) + (rand() % SCREEN_HEIGHT); @@ -163,6 +164,14 @@ void loadMission(char *filename) planetScale = 75 + (rand() % 125); planetScale *= 0.01; + + if (getJSONValue(root, "largePlanet", 0)) + { + battle.planet.x = (SCREEN_WIDTH / 2); + battle.planet.y = (SCREEN_HEIGHT / 2); + planetScale = 5; + } + battle.planetWidth *= planetScale; battle.planetHeight *= planetScale; } diff --git a/src/structs.h b/src/structs.h index 7e4b533..87dc52a 100644 --- a/src/structs.h +++ b/src/structs.h @@ -358,11 +358,13 @@ typedef struct { int suspicionLevel; int suspicionCoolOff; int zackariaSuspicionLevel; + int destroyTorelli; + float torelliFireStormAlpha; Entity *missionTarget; Entity *jumpgate; Entity *messageSpeaker; Entity *lastKilledPlayer; - SDL_Texture *background, *planetTexture; + SDL_Texture *background, *planetTexture, *fireStormTexture; PointF planet; int planetWidth, planetHeight; Entity entityHead, *entityTail;