mirror of
https://github.com/minetest-mods/digtron.git
synced 2025-01-03 17:37:28 +01:00
add a bit of evil black smoke, why not
This commit is contained in:
parent
6af67133be
commit
795fc6ea93
@ -223,6 +223,13 @@ Pusher controller:
|
||||
Tips and tricks
|
||||
===============
|
||||
|
||||
To more easily visualize the operation of a Digtron, imagine that its cycle of operation follows these steps in order:
|
||||
|
||||
* Dig
|
||||
* Move
|
||||
* Build
|
||||
* Allow dust to settle (ie, sand and gravel fall)
|
||||
|
||||
If you're building a repeating pattern of nodes, your periodicity should be one larger than your largest offset. For example, if you've laid out builders to create a set of spiral stairs and the offsets are from 0 to 11, you'll want to use periodicity 12.
|
||||
|
||||
A good way to program a set of builders is to build a complete example of the structure you want them to create, then place builders against the structure and have them "read" all of its facings. This also lets you more easily visualize the tricks that might be needed to allow the digtron to pass through the structure as it's being built.
|
@ -19,6 +19,26 @@ local dig_dust = function(pos, facing)
|
||||
}
|
||||
end
|
||||
|
||||
local burn_smoke = function(pos, amount)
|
||||
return {
|
||||
amount = math.min(amount, 40),
|
||||
time = 1.0,
|
||||
minpos = vector.subtract(pos, vector.new(0.5,0.5,0.5)),
|
||||
maxpos = vector.add(pos, vector.new(0.5,0.5,0.5)),
|
||||
minvel = {x=0, y=2, z=0},
|
||||
maxvel = {x=0, y=5, z=0},
|
||||
minacc = {x=0, y=0, z=0},
|
||||
maxacc = {x=0, y=0, z=0},
|
||||
minexptime = 0.5,
|
||||
maxexptime = 1.5,
|
||||
minsize = 8,
|
||||
maxsize = 12,
|
||||
collisiondetection = false,
|
||||
vertical = false,
|
||||
texture = "default_item_smoke.png^[colorize:#000000DD",
|
||||
}
|
||||
end
|
||||
|
||||
-- returns newpos, status string
|
||||
local execute_cycle = function(pos, clicker)
|
||||
local meta = minetest.get_meta(pos)
|
||||
@ -198,11 +218,6 @@ local execute_cycle = function(pos, clicker)
|
||||
clicker:moveto(digtron.find_new_pos(player_pos, facing), true)
|
||||
end
|
||||
|
||||
-- Eyecandy
|
||||
for _, particles in pairs(particle_systems) do
|
||||
minetest.add_particlespawner(particles)
|
||||
end
|
||||
|
||||
local building_fuel_cost = 0
|
||||
local strange_failure = false
|
||||
-- execute_build on all digtron components that have one
|
||||
@ -234,13 +249,22 @@ local execute_cycle = function(pos, clicker)
|
||||
end
|
||||
|
||||
-- acutally burn the fuel needed
|
||||
fuel_burning = fuel_burning - (digging_fuel_cost + building_fuel_cost)
|
||||
local fuel_cost = digging_fuel_cost + building_fuel_cost
|
||||
fuel_burning = fuel_burning - fuel_cost
|
||||
if digtron.particle_effects then
|
||||
table.insert(particle_systems, burn_smoke(pos, fuel_cost))
|
||||
end
|
||||
if fuel_burning < 0 then
|
||||
fuel_burning = fuel_burning + digtron.burn(layout.fuelstores, -fuel_burning, false)
|
||||
end
|
||||
meta:set_float("fuel_burning", fuel_burning)
|
||||
status_text = status_text .. string.format("Heat remaining in controller furnace: %d", fuel_burning)
|
||||
|
||||
-- Eyecandy
|
||||
for _, particles in pairs(particle_systems) do
|
||||
minetest.add_particlespawner(particles)
|
||||
end
|
||||
|
||||
-- finally, dig out any nodes remaining to be dug. Some of these will have had their flag revoked because
|
||||
-- a builder put something there or because they're another digtron node.
|
||||
local node_to_dig, whether_to_dig = nodes_dug:pop()
|
||||
|
Loading…
Reference in New Issue
Block a user