local ____lualib = require("lualib_bundle")
local __TS__Class = ____lualib.__TS__Class
local __TS__ClassExtends = ____lualib.__TS__ClassExtends
local ____exports = {}
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
local EffectVariant = ____isaac_2Dtypescript_2Ddefinitions.EffectVariant
local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
local ____effects = require("functions.effects")
local isCloseEnoughToTriggerDiceFloor = ____effects.isCloseEnoughToTriggerDiceFloor
local ____players = require("functions.players")
local getClosestPlayer = ____players.getClosestPlayer
local ____CustomCallback = require("classes.private.CustomCallback")
local CustomCallback = ____CustomCallback.CustomCallback
local v = {room = {diceRoomActivated = false}}
____exports.PostDiceRoomActivated = __TS__Class()
local PostDiceRoomActivated = ____exports.PostDiceRoomActivated
PostDiceRoomActivated.name = "PostDiceRoomActivated"
__TS__ClassExtends(PostDiceRoomActivated, CustomCallback)
function PostDiceRoomActivated.prototype.____constructor(self)
    CustomCallback.prototype.____constructor(self)
    self.v = v
    self.shouldFire = function(____, fireArgs, optionalArgs)
        local _player, diceFloorSubType = table.unpack(fireArgs)
        local callbackDiceFloorSubType = table.unpack(optionalArgs)
        return callbackDiceFloorSubType == nil or diceFloorSubType == callbackDiceFloorSubType
    end
    self.postEffectUpdateDiceFloor = function(____, effect)
        if v.room.diceRoomActivated then
            return
        end
        if effect.FrameCount == 0 then
            return
        end
        local closestPlayer = getClosestPlayer(nil, effect.Position)
        if isCloseEnoughToTriggerDiceFloor(nil, closestPlayer, effect) then
            v.room.diceRoomActivated = true
            self:fire(closestPlayer, effect.SubType)
        end
    end
    self.callbacksUsed = {{ModCallback.POST_EFFECT_UPDATE, self.postEffectUpdateDiceFloor, {EffectVariant.DICE_FLOOR}}}
end
return ____exports
