intro api upgrade (#294)

* intro api upgrade

* api updates

* fix tests

* updated templates
This commit is contained in:
bryanthaboi
2026-07-27 08:37:11 -04:00
committed by GitHub
parent 08e8dfc416
commit be90e5b42c
42 changed files with 1880 additions and 153 deletions
+7 -6
View File
@@ -28,10 +28,11 @@ end
local FLASH_FRAMES = 220
local function frontSprite(game, species)
local def = game.data.pokemon[species]
if not (def and def.spriteFront) then return nil end
local ok, img = pcall(love.graphics.newImage, def.spriteFront)
local function frontSprite(game, species, mon)
local path = require("src.pokemon.Sprites").path(game.data, species, "front",
{ mon = mon, kind = "evolution" })
if not path then return nil end
local ok, img = pcall(love.graphics.newImage, path)
return ok and img or nil
end
@@ -46,8 +47,8 @@ function EvolutionState.new(game, mon, newSpecies, onDone, via)
-- B-cancel poll; level-up, stone and rare-candy evos are all cancelable.
self.cancelable = (via ~= "TRADE")
self.oldName = mon.nickname or game.data.pokemon[mon.species].name
self.oldSprite = frontSprite(game, mon.species)
self.newSprite = frontSprite(game, newSpecies)
self.oldSprite = frontSprite(game, mon.species, mon)
self.newSprite = frontSprite(game, newSpecies, mon)
self.t = 0
self.done = false
self.canceled = false