Charaktersystem komplett auf Original-Slots umgebaut: alle 4 Figuren mit echten Animationen, Toucan-Flug, Coco-Hangeln, Smacks Sprung/Duck-Fix, Anker aus BOB-Headern, Wasser-Sofortschaden
This commit is contained in:
+14
-3
@@ -201,10 +201,18 @@ def _parse_bob_executable(data):
|
||||
BOB_STRIDE = 84
|
||||
|
||||
class BobFrame:
|
||||
__slots__ = ('width', 'height', 'pixels') # pixels: list of palette indices, width*height, -1 = transparent
|
||||
def __init__(self, width, height):
|
||||
# pixels: list of palette indices, width*height, -1 = transparent.
|
||||
# slot/anchor_x/anchor_y kommen aus dem 14-Byte-Frame-Header (Felder
|
||||
# u0/u1/u2, Fund 26.07.2026): slot = Engine-Sprite-Index (0-49 rechts,
|
||||
# +50 = Blickrichtung links), anchor = Fusspunkt-Anker relativ zur
|
||||
# linken oberen Ecke (anchor_y > height z.B. bei Cocos Hangel-Frames).
|
||||
__slots__ = ('width', 'height', 'pixels', 'slot', 'anchor_x', 'anchor_y')
|
||||
def __init__(self, width, height, slot=0, anchor_x=0, anchor_y=0):
|
||||
self.width = width
|
||||
self.height = height
|
||||
self.slot = slot
|
||||
self.anchor_x = anchor_x
|
||||
self.anchor_y = anchor_y
|
||||
self.pixels = [-1] * (width * height)
|
||||
|
||||
def set(self, x, y, idx):
|
||||
@@ -221,6 +229,9 @@ def parse_bob(data):
|
||||
header = data[pos:pos+14]
|
||||
if len(header) < 14:
|
||||
raise ValueError(f'truncated header at {pos}')
|
||||
slot = struct.unpack_from('<h', header, 0)[0]
|
||||
anchor_x = struct.unpack_from('<h', header, 2)[0]
|
||||
anchor_y = struct.unpack_from('<h', header, 4)[0]
|
||||
width = struct.unpack_from('<h', header, 6)[0]
|
||||
height = struct.unpack_from('<h', header, 8)[0]
|
||||
ptr_seg_len = struct.unpack_from('<h', header, 10)[0]
|
||||
@@ -238,7 +249,7 @@ def parse_bob(data):
|
||||
if instrs is None:
|
||||
raise ValueError(f'failed to parse exec segment for frame {len(frames)} (len={len(exec_segment)})')
|
||||
|
||||
frame = BobFrame(width, height)
|
||||
frame = BobFrame(width, height, slot, anchor_x, anchor_y)
|
||||
for instr in instrs:
|
||||
for i, byte in enumerate(instr.data):
|
||||
p = instr.offset + i
|
||||
|
||||
Reference in New Issue
Block a user