Skip to content

Commit

Permalink
Merge pull request #1 from patataofcourse/puzzle
Browse files Browse the repository at this point in the history
Puzzle extraction command
  • Loading branch information
patataofcourse authored Jul 2, 2021
2 parents 79c0836 + 24b1f73 commit 8930d37
Show file tree
Hide file tree
Showing 9 changed files with 504 additions and 7 deletions.
18 changes: 15 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
## A modding tool for Professor Layton games

### Supported games
* Professor Layton and the Curious Village (only tested in the EU version)
* Professor Layton and the Curious Village (all versions: JP, JP Friendly Version, US, EU/AUS, KO)
+ Warning: the only version with guaranteed compatibility is EU/AUS. Please specify the region of your ROM when reporting a bug or opening an issue.

### Current utilities
* GDS script extracting and repacking to a custom readable format.
Expand All @@ -22,14 +23,25 @@ Go to Flora's main directory and use `python main.py` to see all available comma
### Objectives
Currently, Flora development is focused on simplifiying puzzle editing, making it possibly a one-step process. After that goal is achieved, Flora 1.0 will be released, and focus will shift to a different goal (notably, editing the actual main game).

### Game titles
British/Australian titles (Pandora's Box / Lost Future / Spectre's Call) will take precedence over American titles (Diabolical Box / Unwound Future / Last Specter) due to the first being the title for all EU versions, only translated to their respective languages (and, not gonna lie, a lil' bit of spite). Exception: the US region versions of said games.

### Puzzles:
To use the puzzle command, you should use either the number of the puzzle (1) if it's a standard puzzle, or the weekly puzzle's EU/AUS number preceded by 'W' (W16). Full support for weekly puzzles exclusive to the US and JP ROMs will arrive at a future update.

You can also extract the match puzzle tutorial (from puzzle #10) using "match_tutorial" and, in the EU and KO versions, the unused puzzle using "1_unused".

Some unused variants of puzzles can't be extracted yet through Flora, as well as some Japanese-exclusive weekly puzzles, however, this will be fixed in a future update.

### Requirements
* Python 3
* [click](https://pypi.org/project/click/)
* [pillow](https://pypi.org/project/pillow/)
* [ndspy](https://pypi.org/project/ndspy/)

To install all modules, use: `pip install click pillow ndspy`  /  `py -m pip install click pillow ndspy`
To install all modules, use: `pip install click pillow ndspy`  /  `py -m pip install click pillow ndspy`

### Special thanks to:
* [pleonex](https://github.com/pleonex/) for his tool [Tinke](https://github.com/pleonex/Tinke), which gave me a base for file formats
* Villa for dealing with my bullshit (srry) and cheering me on!
* [Professor Layton and the Curious Village Walkthrough](http://professorlaytonwalkthrough.blogspot.com), a Blogger guide for this game that supplied an accurate puzzle list for both the US and the EU/AUS versions.
* Duel for dealing with my bullshit (srry) and cheering me on!
166 changes: 166 additions & 0 deletions data/puzzles.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
{
"A5F": {
"match_tutorial": 0,
"9": 1,
"26": 2,
"16": 3,
"4": 4,
"88": 5,
"46": 6,
"48": 7,
"15": 8,
"25": 9,
"20": 10,
"6": 11,
"7": 12,
"58": 13,
"23": 14,
"24": 15,
"80": 16,
"81": 17,
"82": 18,
"83": 19,
"130": 20,
"89": 21,
"52": 22,
"2": 23,
"1": 24,
"18": 25,
"92": 26,
"54": 27,
"93": 28,
"131": 29,
"53": 30,
"35": 31,
"41": 32,
"49": 33,
"99": 34,
"57": 35,
"71": 36,
"33": 37,
"36": 38,
"31": 39,
"3": 40,
"11": 41,
"17": 42,
"38": 43,
"30": 44,
"21": 45,
"94": 46,
"40": 47,
"96": 48,
"87": 49,
"51": 50,
"77": 51,
"84": 52,
"101": 53,
"32": 54,
"64": 55,
"28": 56,
"50": 57,
"10": 60,
"W7": 61,
"69": 62,
"98": 63,
"45": 64,
"14": 65,
"72": 66,
"29": 67,
"65": 68,
"43": 69,
"13": 70,
"63": 71,
"74": 72,
"8": 73,
"42": 74,
"W16": 75,
"W17": 76,
"103": 77,
"104": 78,
"12": 79,
"19": 80,
"134": 81,
"76": 82,
"47": 83,
"22": 84,
"68": 85,
"100": 86,
"86": 87,
"61": 88,
"W3": 89,
"105": 90,
"128": 91,
"126": 92,
"62": 93,
"106": 94,
"56": 95,
"27": 96,
"W6": 97,
"107": 98,
"133": 99,
"W8": 100,
"59": 101,
"91": 102,
"34": 103,
"W19": 104,
"37": 105,
"108": 106,
"5": 107,
"73": 108,
"55": 109,
"W20": 110,
"109": 111,
"95": 112,
"110": 113,
"W9": 114,
"111": 115,
"112": 116,
"113": 117,
"114": 118,
"W1": 119,
"44": 120,
"123": 121,
"121": 122,
"60": 123,
"79": 124,
"115": 125,
"W2": 126,
"W21": 127,
"W10": 128,
"66": 129,
"85": 130,
"70": 131,
"W13": 132,
"124": 133,
"39": 134,
"127": 135,
"135": 136,
"125": 137,
"W18": 138,
"W27": 139,
"67": 140,
"78": 141,
"132": 142,
"97": 143,
"116": 144,
"117": 145,
"W11": 146,
"W22": 147,
"W25": 148,
"W15": 149,
"W26": 150,
"118": 151,
"75": 152,
"W23": 153,
"W4": 154,
"119": 155,
"W12": 156,
"W24": 157,
"W5": 158,
"90": 159,
"120": 160,
"129": 161,
"W14": 162,
"1_unused": 163
}
}
84 changes: 84 additions & 0 deletions data/titles.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
{
"roms_long" : {
"A5FJ": "不思議な町 [Curious Village] (Japan)",
"A5FE": "Curious Village (America)",
"A5FP": "Curious Village (Europe / Australia)",
"A5FK": "이상한 마을 [Curious Village] (Korea)",
"YLTJ": "悪魔の箱 [Pandora's Box] (Japan)",
"YLTE": "Diabolical Box [Pandora's Box] (America)",
"YLTD": "Schatulle der Pandora [Pandora's Box] (Europe - German)",
"YLTP": "Pandora's Box (Europe / Australia - English)",
"YLTS": "Caja de Pandora [Pandora's Box] (Europe - Spanish)",
"YLTF": "Boîte de Pandore [Pandora's Box] (Europe - French)",
"YLTI": "Scrigno di Pandora [Pandora's Box] (Europe - Italian)",
"YLTH": "Doos van Pandora [Pandora's Box] (Europe - Dutch)",
"YLTK": "악마의 상자 [Pandora's Box] (Korea)",
"C3JJ": "最後の時間旅行 [Lost Future] (Japan)",
"C3JE": "Unwound Future [Lost Future] (America)",
"C3JD": "Verlorene Zukunft [Lost Future] (Europe - German)",
"C3JP": "Lost Future (Europe / Australia - English)",
"C3JS": "Futuro perdido [Lost Future] (Europe - Spanish)",
"C3JF": "Destin Perdu [Lost Future] (Europe - French)",
"C3JI": "Futuro perduto [Lost Future] (Europe - Italian)",
"C3JH": "Verloren Toekomst [Lost Future] (Europe - Dutch)",
"C3JK": "최후의 시간여행 [Lost Future] (Korea)",
"BLFJ": "魔神の笛 [Spectre's Call] (Japan)",
"BLFE": "Last Specter [Spectre's Call] (America)",
"BLFD": "Ruf des Phantoms [Spectre's Call] (Europe - German)",
"BLFP": "Spectre's Call (Europe / Australia - English)",
"BLFS": "Llamada del espectro [Last Specter / Spectre's Call] (Europe - Spanish)",
"BLFF": "Appel du Spectre [Spectre's Call] (Europe - French)",
"BLFI": "Richiamo dello spettro [Spectre's Call] (Europe - Italian)",
"BLFH": "Melodie van het Spook [Spectre's Call] (Europe - Dutch)",
"BLFK": "마신의 피리 [Spectre's Call] (Korea)"
},

"roms" : {
"A5FJ": "Curious Village (Japan)",
"A5FE": "Curious Village (America)",
"A5FP": "Curious Village (Europe / Australia)",
"A5FK": "Curious Village (Korea)",
"YLTJ": "Pandora's Box (Japan)",
"YLTE": "Diabolical Box (America)",
"YLTD": "Pandora's Box (Europe - German)",
"YLTP": "Pandora's Box (Europe / Australia - English)",
"YLTS": "Pandora's Box (Europe - Spanish)",
"YLTF": "Pandora's Box (Europe - French)",
"YLTI": "Pandora's Box (Europe - Italian)",
"YLTH": "Pandora's Box (Europe - Dutch)",
"YLTK": "Pandora's Box (Korea)",
"C3JJ": "Lost Future (Japan)",
"C3JE": "Unwound Future (America)",
"C3JD": "Lost Future (Europe - German)",
"C3JP": "Lost Future (Europe / Australia - English)",
"C3JS": "Lost Future (Europe - Spanish)",
"C3JF": "Lost Future (Europe - French)",
"C3JI": "Lost Future (Europe - Italian)",
"C3JH": "Lost Future (Europe - Dutch)",
"C3JK": "Lost Future (Korea)",
"BLFJ": "Spectre's Call (Japan)",
"BLFE": "Last Specter (America)",
"BLFD": "Spectre's Call (Europe - German)",
"BLFP": "Spectre's Call (Europe / Australia - English)",
"BLFS": "Spectre's Call (Europe - Spanish)",
"BLFF": "Spectre's Call (Europe - French)",
"BLFI": "Spectre's Call (Europe - Italian)",
"BLFH": "Spectre's Call (Europe - Dutch)",
"BLFK": "Spectre's Call (Korea)"
},

"checksums": {

},

"supported_roms": [
"A5FP",
"A5FE",
"A5FJ",
"A5FK"
],

"tested_roms" : [
"A5FP"
]
}
2 changes: 1 addition & 1 deletion formats/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from formats import gds, bg, pcm
from formats import gds, bg, pcm, puzzle, rom
4 changes: 2 additions & 2 deletions formats/pcm.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ def extract(input, output, file):
try:
os.mkdir(output)
except FileExistsError:
print(f"Directory {output} already exists! Delete it, then try again.")
quit()
#raise Exception(f"Directory {output} already exists! Delete it, then try again.")
pass

input = lz10.decompress(input)
pcm = PCM(input)
Expand Down
Loading

0 comments on commit 8930d37

Please sign in to comment.