120
121
122
123
124
125
126
127
128
129
130
131
132
133
|
i:set_stack('item',1,ItemStack())
end
end
local ink = i:get_stack('ink',1)
local paper = i:get_stack('paper',1)
ink:take_item(count) paper:take_item(count)
i:set_stack('ink',1,ink) i:set_stack('paper',1,paper)
local penstack = i:get_stack('pen',1)
local pen = penstack:get_definition()._sorcery
local uses = pen.material.data.durability * 0.10
local dmg = 65535 / math.random(math.floor(uses*0.5),uses)
print('adding damage',dmg,penstack:get_wear())
penstack:add_wear(dmg)
print('wear now',penstack:get_wear())
|
|
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
|
i:set_stack('item',1,ItemStack())
end
end
local ink = i:get_stack('ink',1)
local paper = i:get_stack('paper',1)
ink:take_item(count) paper:take_item(count)
i:set_stack('ink',1,ink) i:set_stack('paper',1,paper)
sorcery.lib.node.insert(ItemStack 'vessels:glass_bottle', 'ink', pos, user, i)
local penstack = i:get_stack('pen',1)
local pen = penstack:get_definition()._sorcery
local uses = pen.material.data.durability * 0.10
local dmg = 65535 / math.random(math.floor(uses*0.5),uses)
print('adding damage',dmg,penstack:get_wear())
penstack:add_wear(dmg)
print('wear now',penstack:get_wear())
|