This commit is contained in:
Ally 2024-02-16 13:20:18 +09:00 committed by GitHub
commit 4160f3396f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 63 additions and 19 deletions

View File

@ -273,7 +273,7 @@ editorclass::editorclass(void)
register_tilecol(EditorTileset_WARP_ZONE, 3, "basic", 89, "none", 129); register_tilecol(EditorTileset_WARP_ZONE, 3, "basic", 89, "none", 129);
register_tilecol(EditorTileset_WARP_ZONE, 4, "basic", 92, "none", 132); register_tilecol(EditorTileset_WARP_ZONE, 4, "basic", 92, "none", 132);
register_tilecol(EditorTileset_WARP_ZONE, 5, "basic", 95, "none", 135); register_tilecol(EditorTileset_WARP_ZONE, 5, "basic", 95, "none", 135);
register_tilecol(EditorTileset_WARP_ZONE, 6, "basic", 98, "none", 138); register_tilecol(EditorTileset_WARP_ZONE, 6, "basic", 98, "none", 740);
register_tilecol(EditorTileset_SHIP, 0, "basic", 101, "basic", 741); register_tilecol(EditorTileset_SHIP, 0, "basic", 101, "basic", 741);
register_tilecol(EditorTileset_SHIP, 1, "basic", 104, "basic", 744); register_tilecol(EditorTileset_SHIP, 1, "basic", 104, "basic", 744);
@ -3860,7 +3860,7 @@ bool editorclass::is_warp_zone_background(int tile)
return false; return false;
} }
return (tile == 120 || tile == 123 || tile == 126 || tile == 129 || tile == 132 || tile == 135 || tile == 138); return (tile == 120 || tile == 123 || tile == 126 || tile == 129 || tile == 132 || tile == 135 || tile == 138 || tile == 740);
} }
int editorclass::autotile(const int x, const int y) int editorclass::autotile(const int x, const int y)

View File

@ -2712,11 +2712,10 @@ void Graphics::updatebackground(int t)
else else
{ {
// draw the whole thing for the first time! // draw the whole thing for the first time!
backoffset = 0;
clear(); clear();
for (int j = 0; j < 15; j++) for (int j = 0; j < 15; j++)
{ {
for (int i = 0; i < 21; i++) for (int i = 0; i < 22; i++)
{ {
drawtile2((i * 16) - backoffset - 3, (j * 16), temp + 40); drawtile2((i * 16) - backoffset - 3, (j * 16), temp + 40);
drawtile2((i * 16) - backoffset + 8 - 3, (j * 16), temp + 41); drawtile2((i * 16) - backoffset + 8 - 3, (j * 16), temp + 41);
@ -2755,9 +2754,8 @@ void Graphics::updatebackground(int t)
else else
{ {
// draw the whole thing for the first time! // draw the whole thing for the first time!
backoffset = 0;
clear(); clear();
for (int j = 0; j < 16; j++) for (int j = 0; j < 17; j++)
{ {
for (int i = 0; i < 21; i++) for (int i = 0; i < 21; i++)
{ {
@ -2821,7 +2819,14 @@ void Graphics::drawmap(void)
} }
else else
{ {
tile = map.contents[TILE_IDX(x, y)]; if (map.finalstretch && map.custommode)
{
tile = map.finalat(x, y);
}
else
{
tile = map.contents[TILE_IDX(x, y)];
}
tileset = map.tileset; tileset = map.tileset;
} }

View File

@ -504,7 +504,7 @@ void gamelogic(void)
else else
{ {
//Update colour thingy //Update colour thingy
if (map.finalmode) if (map.finalmode || map.custommode)
{ {
if (map.final_colormode) if (map.final_colormode)
{ {
@ -1409,7 +1409,7 @@ void gamelogic(void)
} }
//Update colour cycling for final level //Update colour cycling for final level
if (map.finalmode && map.final_colormode) if ((map.finalmode || map.custommode) && map.final_colormode)
{ {
map.final_aniframedelay--; map.final_aniframedelay--;
if (map.final_aniframedelay == 0) if (map.final_aniframedelay == 0)

View File

@ -507,7 +507,8 @@ void mapclass::changefinalcol(int t)
//change the map to colour t - for the game's final stretch. //change the map to colour t - for the game's final stretch.
//First up, the tiles. This is just a setting: //First up, the tiles. This is just a setting:
final_mapcol = t; final_mapcol = t;
const int temp = 6 - t; graphics.rcol = 6 - t;
graphics.backgrounddrawn = false;
//Next, entities //Next, entities
for (size_t i = 0; i < obj.entities.size(); i++) for (size_t i = 0; i < obj.entities.size(); i++)
{ {
@ -515,28 +516,35 @@ void mapclass::changefinalcol(int t)
{ {
if (obj.entities[i].animate == 10 || obj.entities[i].animate == 11) //treadmill if (obj.entities[i].animate == 10 || obj.entities[i].animate == 11) //treadmill
{ {
if(temp<3) if (custommode)
{ {
obj.entities[i].tile = 907 + (temp * 80); obj.entities[i].tile = 568 + (graphics.rcol * 12);
}
else if (graphics.rcol < 3)
{
obj.entities[i].tile = 907 + (graphics.rcol * 80);
} }
else else
{ {
obj.entities[i].tile = 911 + ((temp-3) * 80); obj.entities[i].tile = 911 + ((graphics.rcol - 3) * 80);
}
if (obj.entities[i].animate == 10)
{
obj.entities[i].tile += custommode ? 4 : 40;
} }
if(obj.entities[i].animate == 10) obj.entities[i].tile += 40;
} }
else if (obj.entities[i].isplatform) else if (obj.entities[i].isplatform)
{ {
obj.entities[i].tile = 915+(temp*40); obj.entities[i].tile = custommode ? 564 + (graphics.rcol * 12) : 915 + (graphics.rcol * 40);
} }
else //just an enemy else // just an enemy
{ {
obj.entities[i].colour = maptiletoenemycol(temp); obj.entities[i].colour = maptiletoenemycol(graphics.rcol);
} }
} }
else if (obj.entities[i].type == 2) //disappearing platforms else if (obj.entities[i].type == 2) // disappearing platforms
{ {
obj.entities[i].tile = 915+(temp*40); obj.entities[i].tile = custommode ? 564 + (graphics.rcol * 12) : 915 + (graphics.rcol * 40);
} }
} }
} }
@ -1958,6 +1966,12 @@ void mapclass::loadlevel(int rx, int ry)
} }
} }
if (finalstretch)
{
graphics.rcol = 6 - final_mapcol;
changefinalcol(final_mapcol);
}
//do the appear/remove roomname here //do the appear/remove roomname here
break; break;
} }

View File

@ -1483,6 +1483,31 @@ void scriptclass::run(void)
map.finalmode = true; map.finalmode = true;
map.gotoroom(ss_toi(words[1]), ss_toi(words[2])); map.gotoroom(ss_toi(words[1]), ss_toi(words[2]));
} }
else if (words[0] == "finalstretch")
{
if (words[1] == "on")
{
map.finalstretch = true;
map.final_colormode = true;
map.final_colorframe = 1;
graphics.foregrounddrawn = false;
map.final_colorframedelay = 40;
int temp = 1 + (int)(fRandom() * 5);
if (temp == 0) temp = 6;
map.changefinalcol(temp);
}
else if (words[1] == "off")
{
map.finalstretch = false;
map.final_colormode = false;
map.final_mapcol = 0;
map.final_colorframe = 0;
graphics.foregrounddrawn = false;
map.changefinalcol(0);
}
}
else if (words[0] == "rescued") else if (words[0] == "rescued")
{ {
if (words[1] == "red") if (words[1] == "red")