Skip to content

Corlyone/canary-magic_roulette

Folders and files

NameName
Last commit message
Last commit date

Latest commit

a99234d · Jun 30, 2023

History

15 Commits
Jun 30, 2023
May 28, 2023
May 28, 2023
May 28, 2023

Repository files navigation

Magic Roulette for Canary Original created by Lyu

roulette

Dependencies

Class Helper (lib/core/class.lua)

https://gist.github.com/lyuz1n/6ef834507fbbeb57040ea5a325af6cbb

creature:setSpeed method (add to your source) no Canary

https://gist.github.com/Corlyone/f166260c3a471d1e3cfde6c57f321ecc

uuid function (add to data/global.lua)

local random = math.random
function uuid()
    local template ='xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'
    return string.gsub(template, '[xy]', function (c)
        local v = (c == 'x') and random(0, 0xf) or random(8, 0xb)
        return string.format('%x', v)
    end)
end

OnLook (temporary fix) function for Canary

search for (data/events/scripts/player.lua)

function Player:onLook(thing, position, distance)
	local description = "You see "

then replace for:

local Constants = dofile(DATA_DIRECTORY .. '/scripts/magic_roulette/lib/core/constants.lua')

function onRouletteLook(thing, position, distance, description)
	if thing:getName():lower() == Constants.ROULETTE_DUMMY_NAME then
		local item = ItemType(thing:getOutfit().lookTypeEx)

		return ('You see %s.\n%s'):format(
			item:getName(),
			item:getDescription()
		)
	end
	return description
end

function Player:onLook(thing, position, distance)
	local description = "You see "
	description = onRouletteLook(thing, position, distance, description)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages