diff --git a/assets_src/living_buildings.gif b/assets_src/living_buildings.gif new file mode 100644 index 0000000..f1ac2f2 Binary files /dev/null and b/assets_src/living_buildings.gif differ diff --git a/assets_src/static_frames/adblocker.png b/assets_src/static_frames/adblocker.png new file mode 100644 index 0000000..b24b94b Binary files /dev/null and b/assets_src/static_frames/adblocker.png differ diff --git a/assets_src/static_frames/algorithm.png b/assets_src/static_frames/algorithm.png new file mode 100644 index 0000000..243a130 Binary files /dev/null and b/assets_src/static_frames/algorithm.png differ diff --git a/assets_src/static_frames/ampstack.png b/assets_src/static_frames/ampstack.png new file mode 100644 index 0000000..7b7ea48 Binary files /dev/null and b/assets_src/static_frames/ampstack.png differ diff --git a/assets_src/static_frames/datacentre.png b/assets_src/static_frames/datacentre.png new file mode 100644 index 0000000..a7bf3b9 Binary files /dev/null and b/assets_src/static_frames/datacentre.png differ diff --git a/assets_src/static_frames/droneport.png b/assets_src/static_frames/droneport.png new file mode 100644 index 0000000..92a1e43 Binary files /dev/null and b/assets_src/static_frames/droneport.png differ diff --git a/assets_src/static_frames/garage.png b/assets_src/static_frames/garage.png new file mode 100644 index 0000000..4b34d3f Binary files /dev/null and b/assets_src/static_frames/garage.png differ diff --git a/assets_src/static_frames/hornpit.png b/assets_src/static_frames/hornpit.png new file mode 100644 index 0000000..3a16891 Binary files /dev/null and b/assets_src/static_frames/hornpit.png differ diff --git a/assets_src/static_frames/lacquer.png b/assets_src/static_frames/lacquer.png new file mode 100644 index 0000000..7ec6f4e Binary files /dev/null and b/assets_src/static_frames/lacquer.png differ diff --git a/assets_src/static_frames/launchramp.png b/assets_src/static_frames/launchramp.png new file mode 100644 index 0000000..7a12691 Binary files /dev/null and b/assets_src/static_frames/launchramp.png differ diff --git a/assets_src/static_frames/mastering.png b/assets_src/static_frames/mastering.png new file mode 100644 index 0000000..3b081f6 Binary files /dev/null and b/assets_src/static_frames/mastering.png differ diff --git a/assets_src/static_frames/merchtable.png b/assets_src/static_frames/merchtable.png new file mode 100644 index 0000000..110c8ef Binary files /dev/null and b/assets_src/static_frames/merchtable.png differ diff --git a/assets_src/static_frames/podfarm.png b/assets_src/static_frames/podfarm.png new file mode 100644 index 0000000..f22f652 Binary files /dev/null and b/assets_src/static_frames/podfarm.png differ diff --git a/assets_src/static_frames/popupshop.png b/assets_src/static_frames/popupshop.png new file mode 100644 index 0000000..8527d1a Binary files /dev/null and b/assets_src/static_frames/popupshop.png differ diff --git a/assets_src/static_frames/pressplant.png b/assets_src/static_frames/pressplant.png new file mode 100644 index 0000000..9891bbf Binary files /dev/null and b/assets_src/static_frames/pressplant.png differ diff --git a/assets_src/static_frames/printfarm.png b/assets_src/static_frames/printfarm.png new file mode 100644 index 0000000..4855403 Binary files /dev/null and b/assets_src/static_frames/printfarm.png differ diff --git a/assets_src/static_frames/streamhub.png b/assets_src/static_frames/streamhub.png new file mode 100644 index 0000000..a170661 Binary files /dev/null and b/assets_src/static_frames/streamhub.png differ diff --git a/assets_src/static_frames/transcoder.png b/assets_src/static_frames/transcoder.png new file mode 100644 index 0000000..a321cdd Binary files /dev/null and b/assets_src/static_frames/transcoder.png differ diff --git a/assets_src/static_frames/vault.png b/assets_src/static_frames/vault.png new file mode 100644 index 0000000..a23cd02 Binary files /dev/null and b/assets_src/static_frames/vault.png differ diff --git a/assets_src/static_frames/waxseed.png b/assets_src/static_frames/waxseed.png new file mode 100644 index 0000000..d3b1a49 Binary files /dev/null and b/assets_src/static_frames/waxseed.png differ diff --git a/mods/vinylgod/maps/shellmap/map.yaml b/mods/vinylgod/maps/shellmap/map.yaml index 3b4bab1..f89d370 100644 --- a/mods/vinylgod/maps/shellmap/map.yaml +++ b/mods/vinylgod/maps/shellmap/map.yaml @@ -22,35 +22,39 @@ Players: OwnsWorld: True NonCombatant: True Faction: Random - PlayerReference@Creeps: - Name: Creeps - NonCombatant: True - Faction: Random + PlayerReference@ShowA: + Name: ShowA + Faction: vinylgod + Enemies: ShowB + PlayerReference@ShowB: + Name: ShowB + Faction: stream + Enemies: ShowA Actors: Actor1: pressplant - Owner: Creeps + Owner: ShowA Location: 12,12 Actor2: digger - Owner: Creeps + Owner: ShowA Location: 15,14 Actor3: ampstack - Owner: Creeps + Owner: ShowA Location: 10,14 Actor4: popupshop - Owner: Creeps + Owner: ShowA Location: 18,12 Actor5: hornpit - Owner: Creeps + Owner: ShowA Location: 16,16 Actor6: streamhub - Owner: Creeps + Owner: ShowB Location: 24,24 Actor7: transcoder - Owner: Creeps + Owner: ShowB Location: 21,25 Actor8: adblocker - Owner: Creeps + Owner: ShowB Location: 25,22 waxseed0: waxseed Owner: Neutral @@ -58,3 +62,5 @@ Actors: waxseed1: waxseed Owner: Neutral Location: 18,10 + +Rules: rules.yaml diff --git a/mods/vinylgod/maps/shellmap/rules.yaml b/mods/vinylgod/maps/shellmap/rules.yaml new file mode 100644 index 0000000..bdb9568 --- /dev/null +++ b/mods/vinylgod/maps/shellmap/rules.yaml @@ -0,0 +1,3 @@ +world: + LuaScript: + Scripts: shellmap.lua diff --git a/mods/vinylgod/maps/shellmap/shellmap.lua b/mods/vinylgod/maps/shellmap/shellmap.lua new file mode 100644 index 0000000..a6ab855 --- /dev/null +++ b/mods/vinylgod/maps/shellmap/shellmap.lua @@ -0,0 +1,43 @@ +-- Menu diorama battle: two lua-driven sides skirmish forever behind the UI. +-- No Bot: players (bot clients stall shellmap order managers — see MEGAPLAN). + +Ticks = 0 +WaveA = { "djgrunt", "djgrunt", "spinner" } +WaveB = { "bufferbot", "bufferbot", "bufferbot", "drmwalker" } + +CountUnits = function(p) + return #Utils.Where(Map.ActorsInWorld, function(a) + return a.Owner == p and a.HasProperty("Move") + end) +end + +Spawn = function(owner, types, cx, cy) + Utils.Do(types, function(t) + local a = Actor.Create(t, true, { + Owner = owner, + Location = CPos.New(cx + Utils.RandomInteger(-1, 2), cy + Utils.RandomInteger(-1, 2)), + }) + if a.HasProperty("Hunt") then + a.Hunt() + end + end) +end + +WorldLoaded = function() + print("SHELLMAP live") + A = Player.GetPlayer("ShowA") + B = Player.GetPlayer("ShowB") +end + +Tick = function() + Ticks = Ticks + 1 + -- a fresh clash roughly every 30 seconds, kept small + if Ticks % 750 == 250 and A ~= nil then + if CountUnits(A) < 8 then + Spawn(A, WaveA, 14, 15) + end + if CountUnits(B) < 8 then + Spawn(B, WaveB, 23, 23) + end + end +end diff --git a/mods/vinylgod/rules/economy.yaml b/mods/vinylgod/rules/economy.yaml index f81e843..66bab5f 100644 --- a/mods/vinylgod/rules/economy.yaml +++ b/mods/vinylgod/rules/economy.yaml @@ -106,6 +106,9 @@ djgrunt: ^EconBuilding: Inherits: ^EconSprite + ShakeOnDeath: + Duration: 12 + Intensity: 2 -HiddenUnderFog: FrozenUnderFog: WithDamageOverlay: diff --git a/mods/vinylgod/rules/stream.yaml b/mods/vinylgod/rules/stream.yaml index 72067eb..8892fc5 100644 --- a/mods/vinylgod/rules/stream.yaml +++ b/mods/vinylgod/rules/stream.yaml @@ -153,7 +153,7 @@ scraper: SearchFromProcRadius: 15 SearchFromHarvesterRadius: 8 StoresResources: - Capacity: 14 + Capacity: 18 Resources: Wax DockClientManager: @@ -170,7 +170,7 @@ bufferbot: Tooltip: Name: actor-bufferbot.name Health: - HP: 3500 + HP: 5000 Armor: Type: None Mobile: @@ -190,7 +190,7 @@ drmwalker: BuildPaletteOrder: 51 Prerequisites: printfarm Valued: - Cost: 900 + Cost: 750 Tooltip: Name: actor-drmwalker.name Health: diff --git a/mods/vinylgod/rules/world.yaml b/mods/vinylgod/rules/world.yaml index b0cd3e9..d002eeb 100644 --- a/mods/vinylgod/rules/world.yaml +++ b/mods/vinylgod/rules/world.yaml @@ -73,6 +73,10 @@ world: Sequences: wax01 Name: resource-wax ResourceClaimLayer: + ScreenShaker: + SmudgeLayer@SCORCH: + Type: Scorch + Sequence: scorches editorworld: Inherits: ^baseworld diff --git a/mods/vinylgod/sequences/assets/adblocker.png b/mods/vinylgod/sequences/assets/adblocker.png index b24b94b..bacbc40 100644 Binary files a/mods/vinylgod/sequences/assets/adblocker.png and b/mods/vinylgod/sequences/assets/adblocker.png differ diff --git a/mods/vinylgod/sequences/assets/algorithm.png b/mods/vinylgod/sequences/assets/algorithm.png index 243a130..4d625d8 100644 Binary files a/mods/vinylgod/sequences/assets/algorithm.png and b/mods/vinylgod/sequences/assets/algorithm.png differ diff --git a/mods/vinylgod/sequences/assets/ampstack.png b/mods/vinylgod/sequences/assets/ampstack.png index 7b7ea48..0ee4c6b 100644 Binary files a/mods/vinylgod/sequences/assets/ampstack.png and b/mods/vinylgod/sequences/assets/ampstack.png differ diff --git a/mods/vinylgod/sequences/assets/datacentre.png b/mods/vinylgod/sequences/assets/datacentre.png index a7bf3b9..18ffdb9 100644 Binary files a/mods/vinylgod/sequences/assets/datacentre.png and b/mods/vinylgod/sequences/assets/datacentre.png differ diff --git a/mods/vinylgod/sequences/assets/droneport.png b/mods/vinylgod/sequences/assets/droneport.png index 92a1e43..ede1cb7 100644 Binary files a/mods/vinylgod/sequences/assets/droneport.png and b/mods/vinylgod/sequences/assets/droneport.png differ diff --git a/mods/vinylgod/sequences/assets/garage.png b/mods/vinylgod/sequences/assets/garage.png index 4b34d3f..bbbcf14 100644 Binary files a/mods/vinylgod/sequences/assets/garage.png and b/mods/vinylgod/sequences/assets/garage.png differ diff --git a/mods/vinylgod/sequences/assets/hornpit.png b/mods/vinylgod/sequences/assets/hornpit.png index 3a16891..fe8a6cb 100644 Binary files a/mods/vinylgod/sequences/assets/hornpit.png and b/mods/vinylgod/sequences/assets/hornpit.png differ diff --git a/mods/vinylgod/sequences/assets/lacquer.png b/mods/vinylgod/sequences/assets/lacquer.png index 7ec6f4e..0a4a584 100644 Binary files a/mods/vinylgod/sequences/assets/lacquer.png and b/mods/vinylgod/sequences/assets/lacquer.png differ diff --git a/mods/vinylgod/sequences/assets/launchramp.png b/mods/vinylgod/sequences/assets/launchramp.png index 7a12691..0653d60 100644 Binary files a/mods/vinylgod/sequences/assets/launchramp.png and b/mods/vinylgod/sequences/assets/launchramp.png differ diff --git a/mods/vinylgod/sequences/assets/mastering.png b/mods/vinylgod/sequences/assets/mastering.png index 3b081f6..06f4ee6 100644 Binary files a/mods/vinylgod/sequences/assets/mastering.png and b/mods/vinylgod/sequences/assets/mastering.png differ diff --git a/mods/vinylgod/sequences/assets/merchtable.png b/mods/vinylgod/sequences/assets/merchtable.png index 110c8ef..159c7dd 100644 Binary files a/mods/vinylgod/sequences/assets/merchtable.png and b/mods/vinylgod/sequences/assets/merchtable.png differ diff --git a/mods/vinylgod/sequences/assets/podfarm.png b/mods/vinylgod/sequences/assets/podfarm.png index f22f652..f4ece41 100644 Binary files a/mods/vinylgod/sequences/assets/podfarm.png and b/mods/vinylgod/sequences/assets/podfarm.png differ diff --git a/mods/vinylgod/sequences/assets/popupshop.png b/mods/vinylgod/sequences/assets/popupshop.png index 8527d1a..ec267b3 100644 Binary files a/mods/vinylgod/sequences/assets/popupshop.png and b/mods/vinylgod/sequences/assets/popupshop.png differ diff --git a/mods/vinylgod/sequences/assets/pressplant.png b/mods/vinylgod/sequences/assets/pressplant.png index 9891bbf..a8478d0 100644 Binary files a/mods/vinylgod/sequences/assets/pressplant.png and b/mods/vinylgod/sequences/assets/pressplant.png differ diff --git a/mods/vinylgod/sequences/assets/printfarm.png b/mods/vinylgod/sequences/assets/printfarm.png index 4855403..cc6adf4 100644 Binary files a/mods/vinylgod/sequences/assets/printfarm.png and b/mods/vinylgod/sequences/assets/printfarm.png differ diff --git a/mods/vinylgod/sequences/assets/scorch1.png b/mods/vinylgod/sequences/assets/scorch1.png new file mode 100644 index 0000000..7950a04 Binary files /dev/null and b/mods/vinylgod/sequences/assets/scorch1.png differ diff --git a/mods/vinylgod/sequences/assets/scorch2.png b/mods/vinylgod/sequences/assets/scorch2.png new file mode 100644 index 0000000..0af0111 Binary files /dev/null and b/mods/vinylgod/sequences/assets/scorch2.png differ diff --git a/mods/vinylgod/sequences/assets/scorch3.png b/mods/vinylgod/sequences/assets/scorch3.png new file mode 100644 index 0000000..c9d76ef Binary files /dev/null and b/mods/vinylgod/sequences/assets/scorch3.png differ diff --git a/mods/vinylgod/sequences/assets/scorch4.png b/mods/vinylgod/sequences/assets/scorch4.png new file mode 100644 index 0000000..dec4ca5 Binary files /dev/null and b/mods/vinylgod/sequences/assets/scorch4.png differ diff --git a/mods/vinylgod/sequences/assets/streamhub.png b/mods/vinylgod/sequences/assets/streamhub.png index a170661..7e1b982 100644 Binary files a/mods/vinylgod/sequences/assets/streamhub.png and b/mods/vinylgod/sequences/assets/streamhub.png differ diff --git a/mods/vinylgod/sequences/assets/transcoder.png b/mods/vinylgod/sequences/assets/transcoder.png index a321cdd..2eb3e74 100644 Binary files a/mods/vinylgod/sequences/assets/transcoder.png and b/mods/vinylgod/sequences/assets/transcoder.png differ diff --git a/mods/vinylgod/sequences/assets/vault.png b/mods/vinylgod/sequences/assets/vault.png index a23cd02..429dd5c 100644 Binary files a/mods/vinylgod/sequences/assets/vault.png and b/mods/vinylgod/sequences/assets/vault.png differ diff --git a/mods/vinylgod/sequences/assets/waxseed.png b/mods/vinylgod/sequences/assets/waxseed.png index d3b1a49..c19d1d3 100644 Binary files a/mods/vinylgod/sequences/assets/waxseed.png and b/mods/vinylgod/sequences/assets/waxseed.png differ diff --git a/mods/vinylgod/sequences/economy.yaml b/mods/vinylgod/sequences/economy.yaml index 5d221f5..96eca25 100644 --- a/mods/vinylgod/sequences/economy.yaml +++ b/mods/vinylgod/sequences/economy.yaml @@ -29,36 +29,48 @@ djgrunt: popupshop: idle: Filename: sequences/assets/popupshop.png + Length: 6 + Tick: 130 icon: Filename: sequences/assets/icon_popupshop.png pressplant: idle: Filename: sequences/assets/pressplant.png + Length: 6 + Tick: 130 icon: Filename: sequences/assets/icon_pressplant.png ampstack: idle: Filename: sequences/assets/ampstack.png + Length: 6 + Tick: 130 icon: Filename: sequences/assets/icon_ampstack.png vault: idle: Filename: sequences/assets/vault.png + Length: 6 + Tick: 130 icon: Filename: sequences/assets/icon_vault.png merchtable: idle: Filename: sequences/assets/merchtable.png + Length: 6 + Tick: 130 icon: Filename: sequences/assets/icon_merchtable.png garage: idle: Filename: sequences/assets/garage.png + Length: 6 + Tick: 130 icon: Filename: sequences/assets/icon_garage.png @@ -92,6 +104,8 @@ roadie: mastering: idle: Filename: sequences/assets/mastering.png + Length: 6 + Tick: 130 icon: Filename: sequences/assets/icon_mastering.png @@ -105,30 +119,40 @@ streamvan: streamhub: idle: Filename: sequences/assets/streamhub.png + Length: 6 + Tick: 130 icon: Filename: sequences/assets/icon_streamhub.png datacentre: idle: Filename: sequences/assets/datacentre.png + Length: 6 + Tick: 130 icon: Filename: sequences/assets/icon_datacentre.png transcoder: idle: Filename: sequences/assets/transcoder.png + Length: 6 + Tick: 130 icon: Filename: sequences/assets/icon_transcoder.png podfarm: idle: Filename: sequences/assets/podfarm.png + Length: 6 + Tick: 130 icon: Filename: sequences/assets/icon_podfarm.png printfarm: idle: Filename: sequences/assets/printfarm.png + Length: 6 + Tick: 130 icon: Filename: sequences/assets/icon_printfarm.png @@ -168,12 +192,16 @@ explosion: hornpit: idle: Filename: sequences/assets/hornpit.png + Length: 6 + Tick: 130 icon: Filename: sequences/assets/icon_hornpit.png adblocker: idle: Filename: sequences/assets/adblocker.png + Length: 6 + Tick: 130 icon: Filename: sequences/assets/icon_adblocker.png @@ -198,6 +226,8 @@ icon: algorithm: idle: Filename: sequences/assets/algorithm.png + Length: 6 + Tick: 130 icon: Filename: sequences/assets/icon_algorithm.png @@ -229,12 +259,16 @@ curator: launchramp: idle: Filename: sequences/assets/launchramp.png + Length: 6 + Tick: 130 icon: Filename: sequences/assets/icon_launchramp.png droneport: idle: Filename: sequences/assets/droneport.png + Length: 6 + Tick: 130 icon: Filename: sequences/assets/icon_droneport.png @@ -269,7 +303,21 @@ compressor: waxseed: idle: Filename: sequences/assets/waxseed.png + Length: 6 + Tick: 130 lacquer: idle: Filename: sequences/assets/lacquer.png + Length: 6 + Tick: 130 + +scorches: + sc1: + Filename: sequences/assets/scorch1.png + sc2: + Filename: sequences/assets/scorch2.png + sc3: + Filename: sequences/assets/scorch3.png + sc4: + Filename: sequences/assets/scorch4.png diff --git a/mods/vinylgod/weapons/vinylgod.yaml b/mods/vinylgod/weapons/vinylgod.yaml index 2ca502d..9e114c2 100644 --- a/mods/vinylgod/weapons/vinylgod.yaml +++ b/mods/vinylgod/weapons/vinylgod.yaml @@ -90,6 +90,9 @@ bass_ring: Wood: 100 Light: 75 Heavy: 40 + Warhead@3Smu: LeaveSmudge + SmudgeType: Scorch + ValidTargets: Ground ping: Inherits: ^GroundWeapon @@ -121,6 +124,9 @@ BuildingExplode: Explosions: bigboom ImpactSounds: audio/sfx_boom.wav ValidTargets: Ground, GroundActor + Warhead@3Smu: LeaveSmudge + SmudgeType: Scorch + ValidTargets: Ground thedrop_impact: ValidTargets: Ground, GroundActor, Structure @@ -137,6 +143,9 @@ thedrop_impact: Explosions: bigboom ImpactSounds: audio/sfx_boom.wav ValidTargets: Ground, GroundActor + Warhead@3Smu: LeaveSmudge + SmudgeType: Scorch + ValidTargets: Ground theshuffle_impact: ValidTargets: Ground, GroundActor, Structure @@ -153,6 +162,9 @@ theshuffle_impact: Explosions: bigboom ImpactSounds: audio/sfx_boom.wav ValidTargets: Ground, GroundActor + Warhead@3Smu: LeaveSmudge + SmudgeType: Scorch + ValidTargets: Ground # --- round 5: heroes, scouts, air --- diff --git a/tools/animate_sprites.py b/tools/animate_sprites.py new file mode 100644 index 0000000..75e96b2 --- /dev/null +++ b/tools/animate_sprites.py @@ -0,0 +1,96 @@ +#!/usr/bin/env python3 +"""Turn static building sprites into looping pulse animations. + +For each building sprite: find its glowing pixels (high saturation or very +bright — the pink trims, blue rings, neon), then emit N frames where those +pixels breathe between base and boosted brightness on a sine. WithSpriteBody +PlayRepeating()s the idle sequence, so multi-frame sheets animate for free. + +Regenerates .png in sequences/assets as an N-frame sheet and rewrites the +matching `idle:` block in sequences/economy.yaml (Length + Tick). +Safe to re-run: it always starts from assets_src frame-0 backups it maintains. +""" +import math, os, re, shutil +from PIL import Image +from PIL.PngImagePlugin import PngInfo + +ROOT = os.path.join(os.path.dirname(__file__), '..') +ASSETS = os.path.join(ROOT, 'mods', 'vinylgod', 'sequences', 'assets') +BACKUP = os.path.join(ROOT, 'assets_src', 'static_frames') +os.makedirs(BACKUP, exist_ok=True) + +FRAMES = 6 +TICK = 130 # ms per frame -> ~0.8s pulse + +BUILDINGS = ['popupshop', 'pressplant', 'ampstack', 'vault', 'merchtable', 'garage', + 'mastering', 'hornpit', 'streamhub', 'datacentre', 'transcoder', 'podfarm', + 'printfarm', 'adblocker', 'algorithm', 'launchramp', 'droneport', 'waxseed', + 'lacquer'] + + +def glow_mask(im): + """Alpha-scaled mask of 'lit' pixels: saturated or very bright.""" + hsv = im.convert('RGB').convert('HSV') + h, s, v = hsv.split() + a = im.getchannel('A') + mask = Image.new('L', im.size, 0) + mp, sp, vp, ap = mask.load(), s.load(), v.load(), a.load() + for y in range(im.height): + for x in range(im.width): + if ap[x, y] > 40 and (sp[x, y] > 130 and vp[x, y] > 110 or vp[x, y] > 225): + mp[x, y] = ap[x, y] + return mask + + +def brighten(im, factor): + r, g, b, a = im.split() + out = Image.merge('RGBA', tuple(ch.point(lambda p: min(255, int(p * factor))) for ch in (r, g, b)) + (a,)) + return out + + +def animate(name): + src = os.path.join(ASSETS, f'{name}.png') + if not os.path.exists(src): + return None + back = os.path.join(BACKUP, f'{name}.png') + if not os.path.exists(back): + im = Image.open(src).convert('RGBA') + # if this is already a sheet somehow, keep frame 0 + if im.width > im.height: + im = im.crop((0, 0, im.height, im.height)) + im.save(back) + base = Image.open(back).convert('RGBA') + w, h = base.size + mask = glow_mask(base) + + sheet = Image.new('RGBA', (w * FRAMES, h), (0, 0, 0, 0)) + for i in range(FRAMES): + t = 0.5 + 0.5 * math.sin(2 * math.pi * i / FRAMES) + lit = brighten(base, 1.0 + 0.55 * t) + frame = Image.composite(lit, base, mask.point(lambda p: int(p * t))) + sheet.paste(frame, (i * w, 0)) + meta = PngInfo() + meta.add_text('FrameSize', f'{w},{h}') + sheet.save(src, pnginfo=meta) + return w + + +def patch_sequences(done): + p = os.path.join(ROOT, 'mods', 'vinylgod', 'sequences', 'economy.yaml') + s = open(p).read() + for name in done: + # idle block: add/replace Length+Tick right after the Filename line + pat = re.compile( + rf'(^{name}:\n\tidle:\n\t\tFilename: sequences/assets/{name}\.png\n)(?:\t\tLength: \d+\n)?(?:\t\tTick: \d+\n)?', + re.M) + s = pat.sub(rf'\g<1>\t\tLength: {FRAMES}\n\t\tTick: {TICK}\n', s) + open(p, 'w').write(s) + + +done = [] +for b in BUILDINGS: + if animate(b): + done.append(b) + print(f'animated {b}') +patch_sequences(done) +print(f'{len(done)} sprites animated, sequences patched')