koro 1.1.6__py3-none-any.whl → 2.0.0rc2__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- koro/__init__.py +8 -8
- koro/slot/__init__.py +21 -0
- koro/{file → slot}/bin.py +12 -36
- koro/slot/file.py +67 -0
- koro/slot/save.py +135 -0
- koro/slot/xml.py +783 -0
- koro/stage/__init__.py +98 -0
- koro/stage/model.py +284 -0
- koro/stage/part.py +1704 -0
- {koro-1.1.6.dist-info → koro-2.0.0rc2.dist-info}/METADATA +7 -2
- koro-2.0.0rc2.dist-info/RECORD +14 -0
- {koro-1.1.6.dist-info → koro-2.0.0rc2.dist-info}/WHEEL +1 -1
- koro/file/__init__.py +0 -40
- koro/file/dir.py +0 -212
- koro/file/lvl.py +0 -40
- koro/file/zip.py +0 -223
- koro/item/__init__.py +0 -0
- koro/item/group.py +0 -48
- koro/item/level.py +0 -108
- koro/item/save.py +0 -29
- koro-1.1.6.dist-info/RECORD +0 -15
- {koro-1.1.6.dist-info → koro-2.0.0rc2.dist-info}/LICENSE +0 -0
- {koro-1.1.6.dist-info → koro-2.0.0rc2.dist-info}/top_level.txt +0 -0
koro/stage/__init__.py
ADDED
@@ -0,0 +1,98 @@
|
|
1
|
+
from collections.abc import Iterable
|
2
|
+
from enum import Enum, unique
|
3
|
+
|
4
|
+
from .part import BasePart
|
5
|
+
|
6
|
+
__all__ = ["EditUser", "Stage", "Theme"]
|
7
|
+
|
8
|
+
|
9
|
+
@unique
|
10
|
+
class EditUser(Enum):
|
11
|
+
BEGINNER = 0
|
12
|
+
INTERMEDIATE = 1
|
13
|
+
EXPERT = 2
|
14
|
+
PROTECTED = 3
|
15
|
+
"""A level with this edit user can only be opened in expert, and will open a blank level when doing so."""
|
16
|
+
|
17
|
+
|
18
|
+
@unique
|
19
|
+
class Theme(Enum):
|
20
|
+
HAUNTED_HOUSE_DARKNESS = 12
|
21
|
+
NIGHT_CITY = 10
|
22
|
+
THE_EMPTY_LOT = 0
|
23
|
+
NEIGHBORS_HOUSE = 1
|
24
|
+
SIZZLIN_DESERT = 2
|
25
|
+
CHILL_MOUNTAIN = 3
|
26
|
+
OCEAN_TREASURE = 4
|
27
|
+
SPACE_STATION = 5
|
28
|
+
STUMP_TEMPLE = 6
|
29
|
+
TUTORIAL = 11
|
30
|
+
CANDY_ISLAND = 7
|
31
|
+
HAUNTED_HOUSE = 8
|
32
|
+
CITY = 9
|
33
|
+
|
34
|
+
def decorations_available(self) -> int:
|
35
|
+
return {
|
36
|
+
Theme.HAUNTED_HOUSE_DARKNESS: 8,
|
37
|
+
Theme.NIGHT_CITY: 7,
|
38
|
+
Theme.THE_EMPTY_LOT: 10,
|
39
|
+
Theme.NEIGHBORS_HOUSE: 5,
|
40
|
+
Theme.SIZZLIN_DESERT: 8,
|
41
|
+
Theme.CHILL_MOUNTAIN: 9,
|
42
|
+
Theme.OCEAN_TREASURE: 9,
|
43
|
+
Theme.SPACE_STATION: 7,
|
44
|
+
Theme.STUMP_TEMPLE: 6,
|
45
|
+
Theme.TUTORIAL: 12,
|
46
|
+
Theme.CANDY_ISLAND: 4,
|
47
|
+
Theme.HAUNTED_HOUSE: 8,
|
48
|
+
Theme.CITY: 7,
|
49
|
+
}[self]
|
50
|
+
|
51
|
+
|
52
|
+
class Stage(set[BasePart]):
|
53
|
+
__slots__ = ("_edit_user", "_theme", "_tilt_lock")
|
54
|
+
|
55
|
+
_edit_user: EditUser
|
56
|
+
_theme: Theme
|
57
|
+
_tilt_lock: bool
|
58
|
+
|
59
|
+
def __init__(
|
60
|
+
self,
|
61
|
+
iterable: Iterable[BasePart] = (),
|
62
|
+
/,
|
63
|
+
*,
|
64
|
+
edit_user: EditUser = EditUser.EXPERT,
|
65
|
+
theme: Theme,
|
66
|
+
tilt_lock: bool = False,
|
67
|
+
) -> None:
|
68
|
+
super().__init__(iterable)
|
69
|
+
self.edit_user = edit_user
|
70
|
+
self.theme = theme
|
71
|
+
self.tilt_lock = tilt_lock
|
72
|
+
|
73
|
+
@property
|
74
|
+
def edit_user(self) -> EditUser:
|
75
|
+
return self._edit_user
|
76
|
+
|
77
|
+
@edit_user.setter
|
78
|
+
def edit_user(self, value: EditUser, /) -> None:
|
79
|
+
self._edit_user = value
|
80
|
+
|
81
|
+
def __repr__(self) -> str:
|
82
|
+
return f"{type(self).__name__}({set(self)!r}, edit_user={self.edit_user!r}, theme={self.theme!r}, tilt_lock={self.tilt_lock!r})"
|
83
|
+
|
84
|
+
@property
|
85
|
+
def theme(self) -> Theme:
|
86
|
+
return self._theme
|
87
|
+
|
88
|
+
@theme.setter
|
89
|
+
def theme(self, value: Theme, /) -> None:
|
90
|
+
self._theme = value
|
91
|
+
|
92
|
+
@property
|
93
|
+
def tilt_lock(self) -> bool:
|
94
|
+
return self._tilt_lock
|
95
|
+
|
96
|
+
@tilt_lock.setter
|
97
|
+
def tilt_lock(self, value: bool, /) -> None:
|
98
|
+
self._tilt_lock = value
|
koro/stage/model.py
ADDED
@@ -0,0 +1,284 @@
|
|
1
|
+
from enum import Enum, unique
|
2
|
+
from typing import TypeAlias
|
3
|
+
|
4
|
+
|
5
|
+
__all__ = ["DecorationModel", "DeviceModel", "Model", "PartModel"]
|
6
|
+
|
7
|
+
|
8
|
+
@unique
|
9
|
+
class PartModel(Enum):
|
10
|
+
Tile10x10 = 9
|
11
|
+
Tile20x20 = 11
|
12
|
+
TileA30x30 = 13
|
13
|
+
TileB30x30 = 16
|
14
|
+
Tile10x90 = 10
|
15
|
+
Tile20x90 = 12
|
16
|
+
TileA30x90 = 14
|
17
|
+
TileB30x90 = 17
|
18
|
+
Tile90x90 = 15
|
19
|
+
MagmaTile = 20
|
20
|
+
"""Touching the magma will start you over."""
|
21
|
+
SlipperyTile = 21
|
22
|
+
"""This tile made of ice will make you slide."""
|
23
|
+
StickyTile = 22
|
24
|
+
"""Touching this tile makes it hard to roll."""
|
25
|
+
Wall10x10 = 48
|
26
|
+
Wall10x20 = 49
|
27
|
+
Wall10x30 = 50
|
28
|
+
Wall10x90 = 51
|
29
|
+
Wall5x30 = 52
|
30
|
+
Wall30x15 = 53
|
31
|
+
DecorativeWallA = 55
|
32
|
+
DecorativeWallB = 54
|
33
|
+
InvisibleTile = 34
|
34
|
+
HillA = 41
|
35
|
+
HillB = 42
|
36
|
+
HillC = 43
|
37
|
+
ObstacleHill = 44
|
38
|
+
HillWallA = 31
|
39
|
+
HillWallB = 32
|
40
|
+
HillWallC = 33
|
41
|
+
Arch = 39
|
42
|
+
ArchWall = 40
|
43
|
+
CurveS = 1
|
44
|
+
CurveM = 2
|
45
|
+
CurveL = 3
|
46
|
+
SpiralSet = 46
|
47
|
+
RoundPillar = 4
|
48
|
+
CurveWallS = 5
|
49
|
+
CurveWallM = 6
|
50
|
+
CurveWallL = 7
|
51
|
+
SpiralWallA = 37
|
52
|
+
SpiralWallB = 38
|
53
|
+
StraightRailA = 60
|
54
|
+
StraightRailB = 61
|
55
|
+
CurveRail = 56
|
56
|
+
ArchRail = 58
|
57
|
+
StraightRailLA = 62
|
58
|
+
StraightRailLB = 63
|
59
|
+
CurveRailL = 57
|
60
|
+
ArchRailL = 59
|
61
|
+
FunnelPipe = 23
|
62
|
+
StraightPipe = 24
|
63
|
+
CurvePipe = 25
|
64
|
+
SpiralPipe = 26
|
65
|
+
Tunnel = 47
|
66
|
+
Bridge = 0
|
67
|
+
RampA = 35
|
68
|
+
RampB = 36
|
69
|
+
Turnover = 8
|
70
|
+
DecorativeTile = 18
|
71
|
+
GuardTile = 19
|
72
|
+
MouseHole = 45
|
73
|
+
Hole30x30 = 27
|
74
|
+
HoleA90x90 = 28
|
75
|
+
HoleB90x90 = 29
|
76
|
+
HoleC90x90 = 30
|
77
|
+
|
78
|
+
|
79
|
+
@unique
|
80
|
+
class DecorationModel(Enum):
|
81
|
+
"""Decoration models are stored in a separate file; their appearance, size, shape, and availability varies depending on the theme."""
|
82
|
+
|
83
|
+
Decoration01 = 0
|
84
|
+
Decoration02 = 1
|
85
|
+
Decoration03 = 2
|
86
|
+
Decoration04 = 3
|
87
|
+
Decoration05 = 4
|
88
|
+
Decoration06 = 5
|
89
|
+
Decoration07 = 6
|
90
|
+
Decoration08 = 7
|
91
|
+
Decoration09 = 8
|
92
|
+
Decoration10 = 9
|
93
|
+
Decoration11 = 10
|
94
|
+
Decoration12 = 11
|
95
|
+
|
96
|
+
|
97
|
+
@unique
|
98
|
+
class DeviceModel(Enum):
|
99
|
+
Start = 0
|
100
|
+
"""This part marks the starting point."""
|
101
|
+
Goal = 1
|
102
|
+
"""This part marks the goal point."""
|
103
|
+
Crystal = 49
|
104
|
+
"""Crystals are placed throughout the stage."""
|
105
|
+
Respawn = 2
|
106
|
+
"""This part marks the restart point."""
|
107
|
+
MovingTile10x10 = 3
|
108
|
+
"""A tile that moves."""
|
109
|
+
MovingTile20x20 = 4
|
110
|
+
"""A tile that moves."""
|
111
|
+
MovingTile30x30 = 5
|
112
|
+
"""A tile that moves."""
|
113
|
+
MovingTile30x90 = 6
|
114
|
+
"""A tile that moves."""
|
115
|
+
MovingTile90x90A = 8
|
116
|
+
"""A tile that moves."""
|
117
|
+
MovingTile90x90B = 7
|
118
|
+
"""A tile that moves."""
|
119
|
+
MovingTile10x10Switch = 84
|
120
|
+
"""This tile moves when you get on it."""
|
121
|
+
MovingTile20x20Switch = 85
|
122
|
+
"""This tile moves when you get on it."""
|
123
|
+
MovingTile30x30Switch = 86
|
124
|
+
"""This tile moves when you get on it."""
|
125
|
+
MovingTile30x90Switch = 87
|
126
|
+
"""This tile moves when you get on it."""
|
127
|
+
MovingTile90x90ASwitch = 89
|
128
|
+
"""This tile moves when you get on it."""
|
129
|
+
MovingTile90x90BSwitch = 88
|
130
|
+
"""This tile moves when you get on it."""
|
131
|
+
MovingFunnelPipe = 37
|
132
|
+
"""A moving pipe."""
|
133
|
+
MovingStraightPipe = 38
|
134
|
+
"""A moving pipe."""
|
135
|
+
MovingCurveS = 46
|
136
|
+
"""A moving curve."""
|
137
|
+
MovingCurveM = 47
|
138
|
+
"""A moving curve."""
|
139
|
+
MovingCurveL = 48
|
140
|
+
"""A moving curve."""
|
141
|
+
SlidingTile = 11
|
142
|
+
"""This tile slides as you tilt the Wii Remote."""
|
143
|
+
ConveyorBelt = 23
|
144
|
+
"""This conveyor belt carries your ball."""
|
145
|
+
EndMagnet = 20
|
146
|
+
"""Your ball can stick to this magnet to travel."""
|
147
|
+
StraightMagnet = 17
|
148
|
+
"""Your ball can stick to this magnet to travel."""
|
149
|
+
CurveMagnetL = 18
|
150
|
+
"""Your ball can stick to this magnet to travel."""
|
151
|
+
CurveMagnetS = 19
|
152
|
+
"""Your ball can stick to this magnet to travel."""
|
153
|
+
DashTunnelA = 32
|
154
|
+
"""This tunnel speeds up your ball."""
|
155
|
+
DashTunnelB = 33
|
156
|
+
"""This tunnel speeds up your ball."""
|
157
|
+
SeesawLBlock = 13
|
158
|
+
"""This part rotates when tilting the Wii Remote."""
|
159
|
+
SeesawIBlock = 14
|
160
|
+
"""This part rotates when tilting the Wii Remote."""
|
161
|
+
AutoSeesawLBlock = 15
|
162
|
+
"""A rotating block."""
|
163
|
+
AutoSeesawIBlock = 16
|
164
|
+
"""A rotating block."""
|
165
|
+
Cannon = 21
|
166
|
+
"""Fires your ball into the air."""
|
167
|
+
Drawbridge = 44
|
168
|
+
"""Can be crossed if your ball bumps it down."""
|
169
|
+
Turntable = 35
|
170
|
+
"""A rotating disc."""
|
171
|
+
Bumper = 12
|
172
|
+
"""Your ball goes flying when touching it."""
|
173
|
+
PowerfulBumper = 51
|
174
|
+
"""Your ball goes flying when touching it."""
|
175
|
+
Thorn = 34
|
176
|
+
"""You have to start over when touching it."""
|
177
|
+
Gear = 39
|
178
|
+
"""A rotating gear."""
|
179
|
+
Fan = 45
|
180
|
+
"""This fan will blow your ball around."""
|
181
|
+
PowerfulFan = 52
|
182
|
+
"""A fan with strong wind power."""
|
183
|
+
TimerFan = 53
|
184
|
+
"""Its wind power is switched on and off."""
|
185
|
+
Spring = 30
|
186
|
+
"""This tile makes your ball bounce."""
|
187
|
+
Punch = 27
|
188
|
+
"""Pushes the ball forward with a strong punch."""
|
189
|
+
Press = 28
|
190
|
+
"""Pushes the ball forward."""
|
191
|
+
Scissors = 36
|
192
|
+
"""You'll start over if you ball is chopped."""
|
193
|
+
MagnifyingGlass = 29
|
194
|
+
"""You start over if the ball hits the light."""
|
195
|
+
UpsideDownStageDevice = 31
|
196
|
+
"""Flips the stage 180 degrees upside down."""
|
197
|
+
UpsideDownBall = 43
|
198
|
+
"""Flips gravity upside down."""
|
199
|
+
SmallTunnel = 25
|
200
|
+
"""Your ball shrinks when going through."""
|
201
|
+
BigTunnel = 26
|
202
|
+
"""Your ball grows when going through."""
|
203
|
+
ToyTrain = 58
|
204
|
+
"""Carries your ball."""
|
205
|
+
EndTracks = 57
|
206
|
+
LeftTracks = 56
|
207
|
+
RightTracks = 55
|
208
|
+
StraightTracks = 54
|
209
|
+
Warp = 41
|
210
|
+
"""Teleports your ball to another warp point."""
|
211
|
+
BlinkingTile = 40
|
212
|
+
"""Turns visible and invisible."""
|
213
|
+
MelodyTileLowG = 59
|
214
|
+
"""Makes a sound when the ball rolls over it."""
|
215
|
+
MelodyTileLowGSharp = 60
|
216
|
+
"""Makes a sound when the ball rolls over it."""
|
217
|
+
MelodyTileLowA = 61
|
218
|
+
"""Makes a sound when the ball rolls over it."""
|
219
|
+
MelodyTileLowASharp = 62
|
220
|
+
"""Makes a sound when the ball rolls over it."""
|
221
|
+
MelodyTileLowB = 63
|
222
|
+
"""Makes a sound when the ball rolls over it."""
|
223
|
+
MelodyTileC = 64
|
224
|
+
"""Makes a sound when the ball rolls over it."""
|
225
|
+
MelodyTileCSharp = 65
|
226
|
+
"""Makes a sound when the ball rolls over it."""
|
227
|
+
MelodyTileD = 66
|
228
|
+
"""Makes a sound when the ball rolls over it."""
|
229
|
+
MelodyTileDSharp = 67
|
230
|
+
"""Makes a sound when the ball rolls over it."""
|
231
|
+
MelodyTileE = 68
|
232
|
+
"""Makes a sound when the ball rolls over it."""
|
233
|
+
MelodyTileF = 69
|
234
|
+
"""Makes a sound when the ball rolls over it."""
|
235
|
+
MelodyTileFSharp = 70
|
236
|
+
"""Makes a sound when the ball rolls over it."""
|
237
|
+
MelodyTileG = 71
|
238
|
+
"""Makes a sound when the ball rolls over it."""
|
239
|
+
MelodyTileGSharp = 72
|
240
|
+
"""Makes a sound when the ball rolls over it."""
|
241
|
+
MelodyTileA = 73
|
242
|
+
"""Makes a sound when the ball rolls over it."""
|
243
|
+
MelodyTileASharp = 74
|
244
|
+
"""Makes a sound when the ball rolls over it."""
|
245
|
+
MelodyTileB = 75
|
246
|
+
"""Makes a sound when the ball rolls over it."""
|
247
|
+
MelodyTileHighC = 76
|
248
|
+
"""Makes a sound when the ball rolls over it."""
|
249
|
+
MelodyTileHighCSharp = 77
|
250
|
+
"""Makes a sound when the ball rolls over it."""
|
251
|
+
MelodyTileHighD = 78
|
252
|
+
"""Makes a sound when the ball rolls over it."""
|
253
|
+
MelodyTileHighDSharp = 79
|
254
|
+
"""Makes a sound when the ball rolls over it."""
|
255
|
+
MelodyTileHighE = 80
|
256
|
+
"""Makes a sound when the ball rolls over it."""
|
257
|
+
MelodyTileHighF = 81
|
258
|
+
"""Makes a sound when the ball rolls over it."""
|
259
|
+
MelodyTileHighFSharp = 82
|
260
|
+
"""Makes a sound when the ball rolls over it."""
|
261
|
+
MelodyTileHighG = 83
|
262
|
+
"""Makes a sound when the ball rolls over it."""
|
263
|
+
KororinCapsule = 95
|
264
|
+
GreenCrystal = 96
|
265
|
+
Ant = 97
|
266
|
+
|
267
|
+
# Extra models
|
268
|
+
MovingTile20x20Wall = 9
|
269
|
+
"""The wall that can be added to Moving Tile 20x20"""
|
270
|
+
MovingTile30x30Wall = 10
|
271
|
+
"""The wall that can be added to Moving Tile 30x30"""
|
272
|
+
CannonArrow = 22
|
273
|
+
"""The arrow used to show the trajectory from a Cannon"""
|
274
|
+
ConveyorBeltArrows = 24
|
275
|
+
"""The arrows used by the Conveyor Belt when changing direction"""
|
276
|
+
BlueLine = 42
|
277
|
+
"""The blue line used by moving tiles"""
|
278
|
+
OrangeLine = 50
|
279
|
+
"""The orange line used by switch moving tiles"""
|
280
|
+
QuestionMark = 94
|
281
|
+
"""An animated question mark with a glow beneath it"""
|
282
|
+
|
283
|
+
|
284
|
+
Model: TypeAlias = PartModel | DecorationModel | DeviceModel
|