aboutsummaryrefslogtreecommitdiff
path: root/nodes.lua
Commit message (Collapse)AuthorAge
* Lots of crafting tweaks, slight code cleanup.Calinou2014-04-30
|
* Compressed textures, glass uses glasslike_framed drawtype, new texture for ↵Calinou2014-04-30
| | | | glow glass, added texture for trap glow glass and trap super glow glass.
* update from calinouXanthin2014-04-08
|
* Merge ShadowNinja's rewrite.Calinou2014-03-09
ref='#n46'>46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
--
-- HP Change Reasons
--
local expect = nil
local function run_hpchangereason_tests(player)
	local old_hp = player:get_hp()

	player:set_hp(20)
	expect = { type = "set_hp", from = "mod" }
	player:set_hp(3)
	assert(expect == nil)

	expect = { a = 234, type = "set_hp", from = "mod" }
	player:set_hp(7, { a= 234 })
	assert(expect == nil)

	expect = { df = 3458973454, type = "fall", from = "mod" }
	player:set_hp(10, { type = "fall", df = 3458973454 })
	assert(expect == nil)

	player:set_hp(old_hp)
end

local function run_player_meta_tests(player)
	local meta = player:get_meta()
	meta:set_string("foo", "bar")
	assert(meta:contains("foo"))
	assert(meta:get_string("foo") == "bar")