summaryrefslogtreecommitdiff
path: root/main.lua
blob: c19ae3c88638b98a7da1ee002673c7953944c20a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
local funsaac = RegisterMod("funsaac", 1)
require("messages")

local render_tick = 0
local s = 0;
local function onRender()
  WsClient:update()

  render_tick = render_tick + 1
  if render_tick >= 60 then
    render_tick = 0
    s = s + 1
  end
end

local function onEnemyDamage(_, entity, amount, damage_flags, source, countdown_frames)
  ScalarCmd(1)
end

funsaac:AddCallback(ModCallbacks.MC_POST_RENDER, onRender)
funsaac:AddCallback(ModCallbacks.MC_ENTITY_TAKE_DMG, onEnemyDamage)