Skip to content

Commit 9e21e9f

Browse files
authored
Merge pull request #2969 from 2dos/not-not-not-not-not-not-not-not-not-not-cs-skip
Fixes
2 parents de261e7 + 016b4b8 commit 9e21e9f

File tree

11 files changed

+820
-845
lines changed

11 files changed

+820
-845
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,6 @@ tests/test_spoiler.py
193193
coloredbananas.txt
194194
balloons.txt
195195
static/py_libraries/dk64rando*.whl
196-
!cutscenes_skipped.csv
197196
test.bps
198197
rom_tester.html
199198
tools/dumps
Lines changed: 7 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,18 @@
11
"""Builds Cutscene Database from CSV."""
22

33
from BuildLib import newROMName
4+
from skipped_cutscenes import skipped
45

5-
csv_file = "assets/cutscenes/cutscenes_skipped.csv"
6-
write_file = "src/misc/cutscene_database.c"
7-
8-
# https://docs.google.com/spreadsheets/d/1X7lYw9l7xpfEcQjvD0WzucBwi3uUHW4FfsjrOqDwj_o/edit#gid=308050567
9-
10-
with open(csv_file, "r") as csv:
11-
rows = csv.read().split("\n")
12-
data = []
13-
for row in rows[2:]:
14-
data.append(row.split(","))
15-
map_data = []
6+
with open(newROMName, "r+b") as fh:
7+
fh.seek(0x1FF3800)
168
for map_index in range(216):
17-
cutscenes_skipped = []
18-
for cs in data:
19-
col = (2 * map_index) + 1
20-
cs_name = cs[2 * map_index]
21-
bool_v = False
22-
if cs_name != "":
23-
text = cs[col]
24-
bool_v = text == "TRUE"
25-
cutscenes_skipped.append(bool_v)
269
cs_lo = 0
2710
cs_hi = 0
28-
for cs_index, cs in enumerate(cutscenes_skipped):
29-
if cs:
11+
if map_index in list(skipped.keys()):
12+
for cs_index in skipped[map_index]:
3013
if cs_index < 32:
3114
cs_lo |= 1 << cs_index
3215
else:
3316
cs_hi |= 1 << (cs_index - 32)
34-
map_data.extend([cs_lo, cs_hi])
35-
with open(newROMName, "r+b") as fh:
36-
fh.seek(0x1FF3800)
37-
for m in map_data:
38-
fh.write(m.to_bytes(4, "big"))
17+
fh.write(cs_lo.to_bytes(4, "big"))
18+
fh.write(cs_hi.to_bytes(4, "big"))
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
"""Database of skipped cutscenes."""
2+
3+
from BuildEnums import Maps
4+
5+
skipped = {
6+
Maps.JapesMountain: [0, 1, 2],
7+
Maps.Japes: [2, 3, 4, 5, 7, 8, 9, 10, 11, 15, 16, 17, 19, 20, 26],
8+
Maps.JapesDillo: [2],
9+
Maps.JapesShell: [0, 1],
10+
Maps.JapesPainting: [0, 1, 2],
11+
Maps.AztecTinyTemple: [0, 1, 3, 5, 7, 8, 9, 10, 12],
12+
Maps.Helm: [0, 1, 2],
13+
Maps.AztecLlamaTemple: [0, 1, 2, 4, 5, 6, 7, 8, 9],
14+
Maps.Factory: [0, 1, 2, 3, 4, 5, 10, 11, 12, 13, 14, 21, 22, 25, 26, 27, 28, 32, 33, 34, 35, 36, 45],
15+
Maps.FactoryPowerShed: [1],
16+
Maps.Galleon: [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 25, 26, 27, 28, 32, 33, 34],
17+
Maps.JapesUnderground: [0, 1],
18+
Maps.Isles: [2, 3, 10, 11, 12, 13, 14, 15, 16, 20, 23],
19+
Maps.Aztec: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 15, 16, 18, 20, 22],
20+
Maps.Fungi: [1, 2, 4, 5, 6, 8, 13, 14, 16, 18, 23, 24, 25, 27, 32],
21+
Maps.GalleonLighthouse: [1],
22+
Maps.FungiAntHill: [0, 2],
23+
Maps.FungiMinecart: [0, 1, 3, 4],
24+
Maps.FungiDiddyBarn: [0],
25+
Maps.FungiLankyAttic: [0, 1],
26+
Maps.FungiDKBarn: [0, 1],
27+
Maps.FungiMillFront: [0, 3, 4],
28+
Maps.FungiMushroomSlam: [0],
29+
Maps.FungiGiantMushroom: [0, 1, 5],
30+
Maps.FungiShootingGame: [1],
31+
Maps.Caves: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 20, 21, 22, 23, 24],
32+
Maps.Caves5DITiny: [0, 1, 2],
33+
Maps.Caves5DILanky: [0, 1],
34+
Maps.Castle: [0, 1, 2, 3, 4, 5],
35+
Maps.CastleBallroom: [0, 1],
36+
Maps.CavesRotatingRoom: [0],
37+
Maps.Caves5DCChunky: [0],
38+
Maps.Caves5DCDK: [0],
39+
Maps.Caves5DCDiddyLow: [0, 1, 2],
40+
Maps.Caves5DCTiny: [0],
41+
Maps.CavesTileFlip: [4],
42+
Maps.Caves5DIDiddy: [0, 1, 2],
43+
Maps.CastleTower: [0, 1, 2, 3, 4],
44+
Maps.CastleCryptLankyTiny: [0, 1, 2],
45+
Maps.CastleCryptDKDiddyChunky: [1, 2, 3],
46+
Maps.CastleMuseum: [0, 1],
47+
Maps.CastleLibrary: [0, 1, 2, 3],
48+
Maps.CastleBasement: [0, 1, 2, 3],
49+
Maps.CastleTree: [0, 1, 2, 3, 4, 5, 6],
50+
Maps.CastleShed: [0, 1],
51+
Maps.CastleTrash: [0],
52+
Maps.CastleGreenhouse: [0, 1],
53+
Maps.HelmLobby: [0, 1],
54+
Maps.AztecLobby: [2, 3, 4],
55+
Maps.GalleonLobby: [2],
56+
Maps.FactoryLobby: [2, 3],
57+
Maps.CastleCrypt: [0, 1],
58+
Maps.CavesShackDiddyHigh: [0, 2],
59+
Maps.KRoolDiddy: [0],
60+
Maps.KRoolLanky: [0, 1],
61+
Maps.KRoolChunky: [0, 2],
62+
}

base-hack/assets/cutscenes/cutscenes_skipped.csv

Lines changed: 0 additions & 66 deletions
This file was deleted.

base-hack/src/instances/instances.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ int change_object_scripts(behaviour_data* behaviour_pointer, int id, int index,
388388
}
389389
} else if ((param2 == AZTEC_LLAMACOCONUT) || (param2 == AZTEC_LLAMAGRAPE) || (param2 == AZTEC_LLAMAFEATHER)) {
390390
if ((index == 0) && (param2 == AZTEC_LLAMACOCONUT)) {
391-
if (!Rando.cutscene_skip_setting != CSSKIP_AUTO) {
391+
if (Rando.cutscene_skip_setting != CSSKIP_AUTO) {
392392
PlayCutsceneFromModelTwoScript(behaviour_pointer,23,1,0);
393393
}
394394
} else if (index == 1) {
@@ -532,7 +532,7 @@ int change_object_scripts(behaviour_data* behaviour_pointer, int id, int index,
532532
}
533533
return Character == Rando.free_source_llama;
534534
} else if (param2 == LLAMA_LAVAGATE) {
535-
if (Rando.cutscene_skip_setting != CSSKIP_AUTO) {
535+
if (Rando.cutscene_skip_setting == CSSKIP_AUTO) {
536536
hideObject(behaviour_pointer);
537537
behaviour_pointer->pause_state = 1;
538538
}
@@ -812,7 +812,7 @@ int change_object_scripts(behaviour_data* behaviour_pointer, int id, int index,
812812
if (MovesBase[KONG_DIDDY].special_moves & MOVECHECK_CHARGE) {
813813
return 1;
814814
}
815-
if (Rando.cutscene_skip_setting != CSSKIP_AUTO) {
815+
if (Rando.cutscene_skip_setting == CSSKIP_AUTO) {
816816
return 1;
817817
}
818818
return 0;
@@ -1197,7 +1197,7 @@ int change_object_scripts(behaviour_data* behaviour_pointer, int id, int index,
11971197
}
11981198

11991199
//play grape switch cutscene
1200-
if (!Rando.cutscene_skip_setting != CSSKIP_AUTO) {
1200+
if (Rando.cutscene_skip_setting != CSSKIP_AUTO) {
12011201
PlayCutsceneFromModelTwoScript(behaviour_pointer, 0, 1, 0);
12021202
behaviour_pointer->timer = 110;
12031203
}

base-hack/src/lib.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1546,7 +1546,7 @@ void exitBoss(void) {
15461546
reference_map = MAP_KROOLTINY;
15471547
}
15481548
for (int i = 0; i < 5; i++) {
1549-
if (Rando.k_rool_order[i] == reference_map) {
1549+
if (getWorld(CurrentMap, 0) > LEVEL_CASTLE) {
15501550
initiateTransition(MAP_ISLES, 0xC);
15511551
return;
15521552
}

randomizer/Patching/Library/Generic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -802,7 +802,7 @@ def sumChecks(spoiler, ownedItems, locations: list) -> int:
802802

803803
def getHolidaySetting(settings):
804804
"""Get the holiday setting."""
805-
is_offseason = False
805+
is_offseason = True
806806
if is_offseason:
807807
return settings.holiday_setting_offseason
808808
return settings.holiday_setting

static/patches/shrink-dk64.bps

-71 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)