Binding of Isaac: Rebirth Wiki
Register
m (Test)
m (Undo revision 243159 by Derugon (talk))
Tag: Undo
Line 7: Line 7:
   
 
function p.parse( f )
 
function p.parse( f )
p.x = p.x + 1
 
 
return data.values[w_frame.args( f )[1] or ''] or 0
 
return data.values[w_frame.args( f )[1] or ''] or 0
end
 
 
 
p.x = 10
 
p['parse count'] = function ( f )
 
return p.x
 
 
end
 
end
   

Revision as of 13:24, 2 May 2021


local p = {}

--local w_bit   = require( 'module:bit'   )
local w_frame = require( 'module:frame' )
local data = mw.loadData( 'module:dlc/data' )


function p.parse( f )
	return data.values[w_frame.args( f )[1] or ''] or 0
end


function p.test( f )
	local args = w_frame.args( f )
	return ( data.test[tonumber( args[1] )] or {} )[tonumber( args[2] ) or 15] or 0
	--[[
	local value   = args[1]
	local context = args[2]
	
	if context == 15 then
		return value
	end
	
	local filtered = w_bit['and']{ value, context }
	if filtered == 0 then
		return 0
	end
	
	if w_bit['or']{ value, context } == value then
		return 15
	end
	
	local limits = w_bit['and']{ 9, filtered }
	if limits == value then
	    return limits
	end
	]]
end


return p