Compare commits

...

4 Commits

4 changed files with 58 additions and 6 deletions

View File

@ -1156,6 +1156,56 @@ local pages={
<left>||Picture 2. Water Mill in water.||</left>
]]
}
},
{
name="windMill",
title=S("Wind Mill"),
icon="industrialtest:wind_mill",
content={
[[
<big>||Wind Mill||</big>
<left>
||Wind Mill can be used to produce energy from wind moving it's fan. The amount of produced power depends on height where Wind Mill is put, the higher the more power and it is indicated by icon in formspec. Wind Mill can't be put next to any node or otherwise it won't produce power.||
</left>
]],
createMachineInformationTable({
{
name="outputVoltage",
value="LV"
},
{
name="powerCapacity",
value=string.format("%d EU",industrialtest.WindMill.capacity)
}
},S("Wind Mill")),
[[
<img name="industrialtest_guide_wind_mill.png">
<left>||Picture 1. Wind Mill producing some power.||</left>
]]
}
},
{
name="upgrades",
title=S("Machine upgrades"),
icon="industrialtest:overclocker_upgrade",
content={
[[
<big>||Machine upgrades||</big>
<left>
||Upgrades can be put into special slots in machine formspec for this purpose. They increase machine capabilities while changing other properties. Not all machines can accept upgrades, however this can be determined by presence of four slots on right of formspec where upgrades are put. The following are all machine upgrades:||
</left>
<left>
||<item name="industrialtest:overclocker_upgrade" height="{{ITEM_HEIGHT}}"> <b>Overclocker Upgrade</b> - speeds up the machine.||
||<item name="industrialtest:power_storage_upgrade" height="{{ITEM_HEIGHT}}"> <b>Power Storage Upgrade</b> - increases the amount of power that machine can store.||
||<item name="industrialtest:transformer_upgrade" height="{{ITEM_HEIGHT}}"> <b>Transformer Upgrade</b> - allows machine to be connected to higher voltage by one level.||
</left>
<mono>--</mono>
<img name="industrialtest_guide_upgrades.png">
<left>||Picture 1. <item name="industrialtest:electric_furnace" height="{{ITEM_HEIGHT}}"> <b>Electric Furnace</b> with <item name="industrialtest:overclocker_upgrade" height="{{ITEM_HEIGHT}}"> <b>Overclocker Upgrade</b>.||</left>
]]
}
}
}
@ -1165,9 +1215,10 @@ local function preprocessHypertext(content,vars)
return S(sourceString)
end)
for key,value in pairs(vars) do
content=string.gsub(content,string.format("{{%s}}",key),value)
end
-- Replace all sequences which should be treated as variables with values provided in vars
content=string.gsub(content,"{{([^{}]+)}}",function(var)
return vars[var] or "nil"
end)
return content
end

View File

@ -76,13 +76,14 @@ function industrialtest.WindMill.action(self,pos)
local dimMax=31000
local dim=mcl_worlds.pos_to_dimension(pos)
if dim=="overworld" then
dimMax=mcl_vars.mg_overworld_max
dimMax=mcl_vars.mg_overworld_max_official
elseif dim=="nether" then
dimMax=mcl_vars.mg_nether_max
elseif dim=="end" then
dimMax=mcl_vars.mg_end_max
dimMax=mcl_vars.mg_end_max_official
end
charging=math.max(mcl_worlds.layer_to_y(pos.y,dim),0)/dimMax
local layer,_=mcl_worlds.y_to_layer(pos.y)
charging=math.min(math.max((layer or 0),0)/dimMax,1.0)
end
local neighbourPositions={
vector.offset(pos,-1,0,0),

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB