Files
ReSkate/contrib/plugins/reskate-test/plugin/main.lua
T
AyeZeeBB f37abef426 Plugins: trick events (trick_started, trick_landed, line_broken) and reskate.score.current
- With events.tricks a plugin hears the local skater's tricks: trick_started (where), trick_landed
  (points, multiplier, where it started and landed, how long it took) and line_broken (a slam or
  a wipeout); reskate.score.current() is the score HUD's line, multiplier and whether a trick is
  going on. Without the permission the events cannot be registered.
- The score HUD is read into the trick watch (Extension/Skater/score_hud.h, trick_watch.h) on the
  client tick only while a running plugin has events.tricks; a new level starts a new line.
  plugins::start takes the image base for it.
- reskate-test has a tricks module (skipped until a trick lands) and ptest trick, which waits 30 s
  for one and prints what its events said; reskate-hostile has trick-loop.

Not yet checked against real tricks in game.
2026-10-19 12:43:44 -05:00

23 lines
974 B
Lua

-- reskate-test: calls every plugin API and says what worked. Run `ptest all` in the console, or
-- `ptest <module>` for one (`ptest list` names them). Each API ReSkate adds gets a module here.
local harness = require("harness")
for _, name in {"base", "time", "level", "package", "json", "require", "console", "storage", "sandbox", "skater", "tricks"} do
require("checks/" .. name)
end
reskate.console.command("ptest", "Checks the plugin API: ptest all, ptest <module>, ptest list", function(args)
local what = args[1] or "all"
if what == "list" then
reskate.console.print("ptest modules: " .. table.concat(harness.names(), ", "))
elseif what == "all" then
harness.run(harness.names())
elseif harness.has(what) then
harness.run({what})
else
reskate.console.print("ptest: there is no module " .. what .. " (ptest list names them)")
end
end)
reskate.log("reskate-test loaded: ptest all checks every plugin API")