First commit

master
ezhh 2016-07-23 12:24:14 +01:00
commit 0cc1e4e110
24 changed files with 193 additions and 0 deletions

3
depends.txt Normal file
View File

@ -0,0 +1,3 @@
default
fire
abriglass?

180
init.lua Normal file
View File

@ -0,0 +1,180 @@
--[[
Abriflame by Shara Redcat
]]--
local function smoke(pos, node, clicker, enable)
local meta = minetest.get_meta(pos)
local handler = meta:get_int("sound")
local particle = meta:get_int("smoke")
if particle ~= 0 or enable ~= true then
if handler then
minetest.sound_stop(handler)
end
minetest.delete_particlespawner(particle)
meta:set_int("smoke", nil)
meta:set_int("sound", nil)
return
end
local node = minetest.get_node({x = pos.x, y = pos.y + 1, z = pos.z}).name
if node ~= "air" or particle ~= 0 then
return
end
particle = minetest.add_particlespawner({
amount = 4,
time = 0,
collisiondetection = true,
minpos = {x = pos.x - 0.25, y = pos.y + 0.4, z = pos.z-0.25},
maxpos = {x = pos.x + 0.25, y = pos.y + 5, z = pos.z + 0.25},
minvel = {x = -0.2, y = 0.3, z = -0.2},
maxvel = {x = 0.2, y = 1, z = 0.2},
minacc = {x = 0, y = 0, z = 0},
maxacc = {x = 0, y = 0.5, z = 0},
minexptime = 1,
maxexptime = 3,
minsize = 4,
maxsize = 8,
texture = "smoke_particle.png",
})
handler = minetest.sound_play("fire_small", {
pos = pos,
max_hear_distance = 5,
loop = true
})
meta:set_int("smoke", particle)
meta:set_int("sound", handler)
end
-- FLAME TYPES
local flame_types = {
"green", "yellow", "black", "orange", "cyan",
"magenta", "purple", "blue", "red", "frosted"
}
for _, f in pairs(flame_types) do
minetest.register_node("abriflame:" .. f .. "_fire", {
inventory_image = f .. "_fire_inv.png",
wield_image = f .. "_fire_inv.png",
description = f .. " fire",
drawtype = "plantlike",
paramtype = "light",
groups = {dig_immediate = 3, not_in_creative_inventory = 1},
sunlight_propagates = true,
buildable_to = true,
walkable = false,
light_source = 14,
waving = 1,
drop = "",
tiles = {{
name = f .. "_fire_animated.png",
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 1.5
},
}},
on_rightclick = function (pos, node, clicker)
smoke(pos, node, clicker, true)
end,
on_destruct = function (pos)
smoke(pos, nil, nil, false)
minetest.sound_play("fire_extinguish_flame", {
pos = pos,
max_hear_distance = 5,
gain = 0.25
})
end,
})
end
-- FLINT and STEEL override
minetest.register_craftitem("abriflame:flint", {
description = "Fire Starter",
inventory_image = "fire_flint_steel.png",
stack_max = 1,
liquids_pointable = false,
on_use = function(itemstack, user, pointed_thing)
if pointed_thing.type ~= "node"
or minetest.get_node(pointed_thing.above).name ~= "air"
or minetest.is_protected(pointed_thing.above, user:get_player_name()) then
return itemstack
end
local nod = minetest.get_node(pointed_thing.under).name
local pos = pointed_thing.under ; pos.y = pos.y + 1
if nod == "abriglass:stained_glass_green" then
minetest.set_node(pos, {name = "abriflame:green_fire"})
elseif nod == "abriglass:stained_glass_yellow" then
minetest.set_node(pos, {name = "abriflame:yellow_fire"})
elseif nod == "abriglass:stained_glass_black" then
minetest.set_node(pos, {name = "abriflame:black_fire"})
elseif nod == "abriglass:stained_glass_orange" then
minetest.set_node(pos, {name = "abriflame:orange_fire"})
elseif nod == "abriglass:stained_glass_cyan" then
minetest.set_node(pos, {name = "abriflame:cyan_fire"})
elseif nod == "abriglass:stained_glass_magenta" then
minetest.set_node(pos, {name = "abriflame:magenta_fire"})
elseif nod == "abriglass:stained_glass_purple" then
minetest.set_node(pos, {name = "abriflame:purple_fire"})
elseif nod == "abriglass:stained_glass_blue" then
minetest.set_node(pos, {name = "abriflame:blue_fire"})
elseif nod == "abriglass:stained_glass_red" then
minetest.set_node(pos, {name = "abriflame:red_fire"})
elseif nod == "abriglass:stained_glass_frosted" then
minetest.set_node(pos, {name = "abriflame:frosted_fire"})
end
itemstack:add_wear(65535 / 65)
return itemstack
end,
})
minetest.register_craft({
output = "abriflame:flint",
recipe = {
{"default:mese_crystal_fragment", "default:steel_ingot"}
}
})

10
license.txt Normal file
View File

@ -0,0 +1,10 @@
Mod by Shara RedCat.
Textures are modified copies of originals from Semmett9's fake_fire. Semmett9's original version of fake_fire did not state a license and is believed to have been under WTFPL or similar license. (If someone can confirm, please let me know).
Code by Shara RedCat and tenplus1 can be considered under WTFPL.

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

BIN
textures/black_fire_inv.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

BIN
textures/blue_fire_inv.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

BIN
textures/cyan_fire_inv.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

BIN
textures/green_fire_inv.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

BIN
textures/red_fire_inv.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

BIN
textures/smoke_particle.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 358 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB