forked from mrkubax10/industrialtest
Compare commits
2 Commits
mcla-suppo
...
temp
| Author | SHA1 | Date | |
|---|---|---|---|
| 71edb454bc | |||
| 960b2e5b45 |
4
api.lua
4
api.lua
@@ -647,7 +647,7 @@ end
|
|||||||
-- \returns nil
|
-- \returns nil
|
||||||
industrialtest.api.registerResourceDust=function(name,displayName,resources,color,registerMaceratorRecipe)
|
industrialtest.api.registerResourceDust=function(name,displayName,resources,color,registerMaceratorRecipe)
|
||||||
minetest.register_craftitem("industrialtest:"..name.."_dust",{
|
minetest.register_craftitem("industrialtest:"..name.."_dust",{
|
||||||
description=S("@1 Dust", displayName),
|
description=S(displayName.." Dust"),
|
||||||
inventory_image="industrialtest_dust.png",
|
inventory_image="industrialtest_dust.png",
|
||||||
color=color
|
color=color
|
||||||
})
|
})
|
||||||
@@ -693,7 +693,7 @@ industrialtest.api.registerStorageCell=function(name,displayName,node,modname)
|
|||||||
modname="industrialtest"
|
modname="industrialtest"
|
||||||
end
|
end
|
||||||
minetest.register_craftitem("industrialtest:"..name.."_cell",{
|
minetest.register_craftitem("industrialtest:"..name.."_cell",{
|
||||||
description=S("@1 Cell", displayName),
|
description=S(displayName.." Cell"),
|
||||||
inventory_image=modname.."_"..name.."_cell.png",
|
inventory_image=modname.."_"..name.."_cell.png",
|
||||||
on_place=function(itemstack,user,pointed)
|
on_place=function(itemstack,user,pointed)
|
||||||
if pointed.type~="node" or not user or not user:is_player() then
|
if pointed.type~="node" or not user or not user:is_player() then
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ end
|
|||||||
|
|
||||||
local function registerCable(name,displayName,size,flow,registerInsulated)
|
local function registerCable(name,displayName,size,flow,registerInsulated)
|
||||||
local definition={
|
local definition={
|
||||||
description=S("@1 Cable", displayName),
|
description=S(displayName.." Cable"),
|
||||||
inventory_image="industrialtest_"..name.."_cable_inv.png",
|
inventory_image="industrialtest_"..name.."_cable_inv.png",
|
||||||
tiles={"industrialtest_"..name.."_cable.png"},
|
tiles={"industrialtest_"..name.."_cable.png"},
|
||||||
wield_image="industrialtest_"..name.."_cable_inv.png",
|
wield_image="industrialtest_"..name.."_cable_inv.png",
|
||||||
@@ -142,7 +142,7 @@ local function registerCable(name,displayName,size,flow,registerInsulated)
|
|||||||
minetest.register_node("industrialtest:"..name.."_cable",definition)
|
minetest.register_node("industrialtest:"..name.."_cable",definition)
|
||||||
if registerInsulated then
|
if registerInsulated then
|
||||||
definition=table.copy(definition)
|
definition=table.copy(definition)
|
||||||
definition.description=S("Insulated @1 Cable", displayName)
|
definition.description=S("Insulated "..displayName.." Cable")
|
||||||
definition.inventory_image="industrialtest_insulated_"..name.."_cable_inv.png"
|
definition.inventory_image="industrialtest_insulated_"..name.."_cable_inv.png"
|
||||||
definition.tiles={"industrialtest_insulated_"..name.."_cable.png"}
|
definition.tiles={"industrialtest_insulated_"..name.."_cable.png"}
|
||||||
definition.wield_image="industrialtest_insulated_"..name.."_cable_inv.png"
|
definition.wield_image="industrialtest_insulated_"..name.."_cable_inv.png"
|
||||||
|
|||||||
@@ -93,11 +93,13 @@ override={
|
|||||||
if meta:get_int("meseconPowered")==1 then
|
if meta:get_int("meseconPowered")==1 then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local chambers=minetest.deserialize(meta:get_string("chambers"))
|
if meta:contains("chambers") then
|
||||||
for _,chamber in ipairs(chambers) do
|
local chambers=minetest.deserialize(meta:get_string("chambers"))
|
||||||
local chamberMeta=minetest.get_meta(chamber)
|
for _,chamber in ipairs(chambers) do
|
||||||
if chamberMeta:get_int("meseconPowered")==1 then
|
local chamberMeta=minetest.get_meta(chamber)
|
||||||
return
|
if chamberMeta:get_int("meseconPowered")==1 then
|
||||||
|
return
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -94,15 +94,15 @@ end
|
|||||||
if industrialtest.mclAvailable then
|
if industrialtest.mclAvailable then
|
||||||
industrialtest.internal.registerMetal=function(name,displayName,oreBlastResistance,oreHardness,rawBlockBlastResistance,rawBlockHardness,blockBlastResistance,blockHardness)
|
industrialtest.internal.registerMetal=function(name,displayName,oreBlastResistance,oreHardness,rawBlockBlastResistance,rawBlockHardness,blockBlastResistance,blockHardness)
|
||||||
minetest.register_craftitem("industrialtest:raw_"..name,{
|
minetest.register_craftitem("industrialtest:raw_"..name,{
|
||||||
description=S("Raw @1", displayName),
|
description=S("Raw "..displayName),
|
||||||
inventory_image="industrialtest_mcl_raw_"..name..".png"
|
inventory_image="industrialtest_mcl_raw_"..name..".png"
|
||||||
})
|
})
|
||||||
minetest.register_craftitem("industrialtest:"..name.."_ingot",{
|
minetest.register_craftitem("industrialtest:"..name.."_ingot",{
|
||||||
description=S("@1 Ingot", displayName),
|
description=S(displayName.." Ingot"),
|
||||||
inventory_image="industrialtest_mcl_"..name.."_ingot.png"
|
inventory_image="industrialtest_mcl_"..name.."_ingot.png"
|
||||||
})
|
})
|
||||||
minetest.register_node("industrialtest:stone_with_"..name,{
|
minetest.register_node("industrialtest:stone_with_"..name,{
|
||||||
description=S("@1 Ore", displayName),
|
description=S(displayName.." Ore"),
|
||||||
tiles={"default_stone.png^industrialtest_mcl_stone_with_"..name..".png"},
|
tiles={"default_stone.png^industrialtest_mcl_stone_with_"..name..".png"},
|
||||||
sounds=mcl_sounds.node_sound_stone_defaults(),
|
sounds=mcl_sounds.node_sound_stone_defaults(),
|
||||||
drop="industrialtest:raw_"..name,
|
drop="industrialtest:raw_"..name,
|
||||||
@@ -114,7 +114,7 @@ if industrialtest.mclAvailable then
|
|||||||
_mcl_fortune_drop = mcl_core.fortune_drop_ore,
|
_mcl_fortune_drop = mcl_core.fortune_drop_ore,
|
||||||
})
|
})
|
||||||
minetest.register_node("industrialtest:deepslate_with_"..name,{
|
minetest.register_node("industrialtest:deepslate_with_"..name,{
|
||||||
description=S("Deepslate with @1", displayName),
|
description=S("Deepslate with "..displayName),
|
||||||
tiles={"mcl_deepslate_top.png^industrialtest_mcl_stone_with_"..name..".png","mcl_deepslate_top.png^industrialtest_mcl_stone_with_"..name..".png","mcl_deepslate.png^industrialtest_mcl_stone_with_"..name..".png"},
|
tiles={"mcl_deepslate_top.png^industrialtest_mcl_stone_with_"..name..".png","mcl_deepslate_top.png^industrialtest_mcl_stone_with_"..name..".png","mcl_deepslate.png^industrialtest_mcl_stone_with_"..name..".png"},
|
||||||
sounds=mcl_sounds.node_sound_stone_defaults(),
|
sounds=mcl_sounds.node_sound_stone_defaults(),
|
||||||
drop="industrialtest:raw_"..name,
|
drop="industrialtest:raw_"..name,
|
||||||
@@ -128,7 +128,7 @@ if industrialtest.mclAvailable then
|
|||||||
_mcl_fortune_drop = mcl_core.fortune_drop_ore,
|
_mcl_fortune_drop = mcl_core.fortune_drop_ore,
|
||||||
})
|
})
|
||||||
minetest.register_node("industrialtest:raw_"..name.."_block",{
|
minetest.register_node("industrialtest:raw_"..name.."_block",{
|
||||||
description=S("Raw @1 Block", displayName),
|
description=S("Raw "..displayName.." Block"),
|
||||||
tiles={"industrialtest_mcl_raw_"..name.."_block.png"},
|
tiles={"industrialtest_mcl_raw_"..name.."_block.png"},
|
||||||
groups={pickaxey=2,building_block=1,blast_furnace_smeltable=1},
|
groups={pickaxey=2,building_block=1,blast_furnace_smeltable=1},
|
||||||
sounds=mcl_sounds.node_sound_metal_defaults(),
|
sounds=mcl_sounds.node_sound_metal_defaults(),
|
||||||
@@ -136,7 +136,7 @@ if industrialtest.mclAvailable then
|
|||||||
_mcl_hardness=rawBlockHardness,
|
_mcl_hardness=rawBlockHardness,
|
||||||
})
|
})
|
||||||
minetest.register_node("industrialtest:"..name.."_block",{
|
minetest.register_node("industrialtest:"..name.."_block",{
|
||||||
description=S("Block of @1", displayName),
|
description=S("Block of "..displayName),
|
||||||
tiles={"industrialtest_"..name.."_block.png"},
|
tiles={"industrialtest_"..name.."_block.png"},
|
||||||
groups={pickaxey=2,building_block=1},
|
groups={pickaxey=2,building_block=1},
|
||||||
sounds=mcl_sounds.node_sound_metal_defaults(),
|
sounds=mcl_sounds.node_sound_metal_defaults(),
|
||||||
@@ -192,7 +192,7 @@ if industrialtest.mclAvailable then
|
|||||||
end
|
end
|
||||||
industrialtest.registerToolset=function(material,materialItem,materialDisplayName,config)
|
industrialtest.registerToolset=function(material,materialItem,materialDisplayName,config)
|
||||||
minetest.register_tool("industrialtest:"..material.."_pickaxe",{
|
minetest.register_tool("industrialtest:"..material.."_pickaxe",{
|
||||||
description=S("@1 Pickaxe", materialDisplayName),
|
description=S(materialDisplayName.." Pickaxe"),
|
||||||
inventory_image="industrialtest_mcl_"..material.."_pickaxe.png",
|
inventory_image="industrialtest_mcl_"..material.."_pickaxe.png",
|
||||||
groups={tool=1,pickaxe=1,dig_speed_class=config.digSpeedClass},
|
groups={tool=1,pickaxe=1,dig_speed_class=config.digSpeedClass},
|
||||||
tool_capabilities={
|
tool_capabilities={
|
||||||
@@ -208,7 +208,7 @@ if industrialtest.mclAvailable then
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
minetest.register_tool("industrialtest:"..material.."_shovel",{
|
minetest.register_tool("industrialtest:"..material.."_shovel",{
|
||||||
description=S("@1 Shovel", materialDisplayName),
|
description=S(materialDisplayName.." Shovel"),
|
||||||
inventory_image="industrialtest_mcl_"..material.."_shovel.png",
|
inventory_image="industrialtest_mcl_"..material.."_shovel.png",
|
||||||
groups={tool=1,shovel=1,dig_speed_class=config.digSpeedClass},
|
groups={tool=1,shovel=1,dig_speed_class=config.digSpeedClass},
|
||||||
tool_capabilities={
|
tool_capabilities={
|
||||||
@@ -260,7 +260,7 @@ if industrialtest.mclAvailable then
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
minetest.register_tool("industrialtest:"..material.."_axe",{
|
minetest.register_tool("industrialtest:"..material.."_axe",{
|
||||||
description=S("@1 Axe", materialDisplayName),
|
description=S(materialDisplayName.." Axe"),
|
||||||
inventory_image="industrialtest_mcl_"..material.."_axe.png",
|
inventory_image="industrialtest_mcl_"..material.."_axe.png",
|
||||||
groups={tool=1,axe=1,dig_speed_class=config.digSpeedClass},
|
groups={tool=1,axe=1,dig_speed_class=config.digSpeedClass},
|
||||||
tool_capabilities={
|
tool_capabilities={
|
||||||
@@ -277,7 +277,7 @@ if industrialtest.mclAvailable then
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
minetest.register_tool("industrialtest:"..material.."_sword",{
|
minetest.register_tool("industrialtest:"..material.."_sword",{
|
||||||
description=S("@1 Sword", materialDisplayName),
|
description=S(materialDisplayName.." Sword"),
|
||||||
inventory_image="industrialtest_mcl_"..material.."_sword.png",
|
inventory_image="industrialtest_mcl_"..material.."_sword.png",
|
||||||
groups={weapon=1,sword=1,dig_speed_class=config.digSpeedClass},
|
groups={weapon=1,sword=1,dig_speed_class=config.digSpeedClass},
|
||||||
tool_capabilities={
|
tool_capabilities={
|
||||||
@@ -294,7 +294,7 @@ if industrialtest.mclAvailable then
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
minetest.register_tool("industrialtest:"..material.."_hoe",{
|
minetest.register_tool("industrialtest:"..material.."_hoe",{
|
||||||
description=S("@1 Hoe", materialDisplayName),
|
description=S(materialDisplayName.." Hoe"),
|
||||||
inventory_image="industrialtest_mcl_"..material.."_hoe.png",
|
inventory_image="industrialtest_mcl_"..material.."_hoe.png",
|
||||||
groups={tool=1,hoe=1},
|
groups={tool=1,hoe=1},
|
||||||
tool_capabilities={
|
tool_capabilities={
|
||||||
@@ -552,7 +552,7 @@ if industrialtest.mclAvailable then
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
industrialtest.elementKeys.bronzeIngot="industrialtest:bronze_ingot"
|
industrialtest.elementKeys.bronzeIngot="industrialtest:bronze_ingot"
|
||||||
industrialtest.registerToolset("bronze","bronze_ingot",S("Bronze"),{
|
industrialtest.registerToolset("bronze","bronze_ingot","Bronze",{
|
||||||
digSpeedClass=4,
|
digSpeedClass=4,
|
||||||
dropLevel=4,
|
dropLevel=4,
|
||||||
speed=6,
|
speed=6,
|
||||||
@@ -617,22 +617,22 @@ elseif industrialtest.mtgAvailable then
|
|||||||
|
|
||||||
industrialtest.internal.registerMetal=function(name,displayName,hardness)
|
industrialtest.internal.registerMetal=function(name,displayName,hardness)
|
||||||
minetest.register_craftitem("industrialtest:"..name.."_lump",{
|
minetest.register_craftitem("industrialtest:"..name.."_lump",{
|
||||||
description=S("@1 Lump", displayName),
|
description=S(displayName.." Lump"),
|
||||||
inventory_image="industrialtest_mtg_"..name.."_lump.png"
|
inventory_image="industrialtest_mtg_"..name.."_lump.png"
|
||||||
})
|
})
|
||||||
minetest.register_craftitem("industrialtest:"..name.."_ingot",{
|
minetest.register_craftitem("industrialtest:"..name.."_ingot",{
|
||||||
description=S("@1 Ingot", displayName),
|
description=S(displayName.." Ingot"),
|
||||||
inventory_image="industrialtest_mtg_"..name.."_ingot.png"
|
inventory_image="industrialtest_mtg_"..name.."_ingot.png"
|
||||||
})
|
})
|
||||||
minetest.register_node("industrialtest:stone_with_"..name,{
|
minetest.register_node("industrialtest:stone_with_"..name,{
|
||||||
description=S("@1 Ore", displayName),
|
description=S(displayName.." Ore"),
|
||||||
tiles={"default_stone.png^industrialtest_mtg_stone_with_"..name..".png"},
|
tiles={"default_stone.png^industrialtest_mtg_stone_with_"..name..".png"},
|
||||||
sounds=default.node_sound_stone_defaults(),
|
sounds=default.node_sound_stone_defaults(),
|
||||||
drop="industrialtest:"..name.."_lump",
|
drop="industrialtest:"..name.."_lump",
|
||||||
groups={cracky=hardness},
|
groups={cracky=hardness},
|
||||||
})
|
})
|
||||||
minetest.register_node("industrialtest:"..name.."_block",{
|
minetest.register_node("industrialtest:"..name.."_block",{
|
||||||
description=S("Block of @1", displayName),
|
description=S("Block of "..displayName),
|
||||||
tiles={"industrialtest_"..name.."_block.png"},
|
tiles={"industrialtest_"..name.."_block.png"},
|
||||||
groups={cracky=hardness,level=2},
|
groups={cracky=hardness,level=2},
|
||||||
sounds=default.node_sound_metal_defaults(),
|
sounds=default.node_sound_metal_defaults(),
|
||||||
|
|||||||
@@ -561,6 +561,17 @@ industrialtest.api.registerPlate("lead_plate",S("Lead Plate"),{
|
|||||||
}
|
}
|
||||||
},"#eafef8ff",true)
|
},"#eafef8ff",true)
|
||||||
|
|
||||||
|
industrialtest.api.registerPlate("iridium_plate",S("Iridium Plate"),{},false,"#ffffffff")
|
||||||
|
minetest.register_craft({
|
||||||
|
type="shaped",
|
||||||
|
output="industrialtest:iridium_plate",
|
||||||
|
recipe={
|
||||||
|
{"industrialtest:iridium_ingot","industrialtest:advanced_alloy","industrialtest:iridium_ingot"},
|
||||||
|
{"industrialtest:advanced_alloy",industrialtest.elementKeys.diamond,"industrialtest:advanced_alloy"},
|
||||||
|
{"industrialtest:iridium_ingot","industrialtest:advanced_alloy","industrialtest:iridium_ingot"}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
-- Cells
|
-- Cells
|
||||||
minetest.register_craftitem("industrialtest:empty_cell",{
|
minetest.register_craftitem("industrialtest:empty_cell",{
|
||||||
description=S("Empty Cell"),
|
description=S("Empty Cell"),
|
||||||
|
|||||||
1
init.lua
1
init.lua
@@ -66,6 +66,7 @@ dofile(modpath.."/tools/nano_suit.lua")
|
|||||||
dofile(modpath.."/tools/solar_helmet.lua")
|
dofile(modpath.."/tools/solar_helmet.lua")
|
||||||
dofile(modpath.."/tools/static_boots.lua")
|
dofile(modpath.."/tools/static_boots.lua")
|
||||||
dofile(modpath.."/tools/treetap.lua")
|
dofile(modpath.."/tools/treetap.lua")
|
||||||
|
dofile(modpath.."/tools/quantum_suit.lua")
|
||||||
dofile(modpath.."/tools/wrench.lua")
|
dofile(modpath.."/tools/wrench.lua")
|
||||||
|
|
||||||
dofile(modpath.."/upgrades.lua")
|
dofile(modpath.."/upgrades.lua")
|
||||||
|
|||||||
@@ -1,140 +0,0 @@
|
|||||||
# textdomain: industrialtest
|
|
||||||
@1@n@2 / @3 EU=
|
|
||||||
@1@n@2 / @3 mB=
|
|
||||||
@1 Dust=
|
|
||||||
@1 Cell=
|
|
||||||
@1 Cable=
|
|
||||||
Insulated @1 Cable=
|
|
||||||
Raw @1=
|
|
||||||
@1 Ingot=
|
|
||||||
@1 Ore=
|
|
||||||
Deepslate with @1=
|
|
||||||
Raw @1 Block=
|
|
||||||
Block of @1=
|
|
||||||
@1 Pickaxe=
|
|
||||||
@1 Shovel=
|
|
||||||
@1 Axe=
|
|
||||||
@1 Sword=
|
|
||||||
@1 Hoe=
|
|
||||||
Bronze Ingot=
|
|
||||||
Bronze Nugget=
|
|
||||||
Bronze=
|
|
||||||
Block of Bronze=
|
|
||||||
@1 Lump=
|
|
||||||
RE-Battery=
|
|
||||||
Advanced RE-Battery=
|
|
||||||
Energy Crystal=
|
|
||||||
Lapotron Crystal=
|
|
||||||
Refined Iron Ingot=
|
|
||||||
Mixed Metal Ingot=
|
|
||||||
Sticky Resin=
|
|
||||||
Rubber=
|
|
||||||
Raw Carbon Fibre=
|
|
||||||
Raw Carbon Mesh=
|
|
||||||
Hydrated Coal Dust=
|
|
||||||
Hydrated Coal=
|
|
||||||
Bronze Plate=
|
|
||||||
Copper Plate=
|
|
||||||
Advanced Alloy=
|
|
||||||
Carbon Plate=
|
|
||||||
Tin Plate=
|
|
||||||
Lead Plate=
|
|
||||||
Empty Cell=
|
|
||||||
Uranium Cell=
|
|
||||||
Coolant Cell=
|
|
||||||
Bio Cell=
|
|
||||||
Biofuel Cell=
|
|
||||||
Hydrated Coal Cell=
|
|
||||||
Coalfuel Cell=
|
|
||||||
Electronic Circuit=
|
|
||||||
Advanced Electronic Circuit=
|
|
||||||
Scrap=
|
|
||||||
UU-Matter=
|
|
||||||
Plantball=
|
|
||||||
Compressed Plantball=
|
|
||||||
Fuel Can=
|
|
||||||
Cable Former=
|
|
||||||
Canning Machine=
|
|
||||||
BatBox Chargepad=
|
|
||||||
CESU Chargepad=
|
|
||||||
MFE Chargepad=
|
|
||||||
MFSU Chargepad=
|
|
||||||
Charge=
|
|
||||||
Discharge=
|
|
||||||
Compressor=
|
|
||||||
Electric Furnace=
|
|
||||||
Extractor=
|
|
||||||
Geothermal Generator=
|
|
||||||
Water Mill=
|
|
||||||
Generator=
|
|
||||||
Heat: @1 %=
|
|
||||||
Induction Furnace=
|
|
||||||
Iron Furnace=
|
|
||||||
Macerator=
|
|
||||||
Mass Fabricator=
|
|
||||||
Start=
|
|
||||||
Stop=
|
|
||||||
Nuclear Reactor=
|
|
||||||
Nuclear Reactor Chamber=
|
|
||||||
BatBox=
|
|
||||||
CESU=
|
|
||||||
MFE=
|
|
||||||
MFSU=
|
|
||||||
Recycler=
|
|
||||||
Don't maintain speed=
|
|
||||||
Maintain speed=
|
|
||||||
Speed: @1=
|
|
||||||
Rotary Macerator=
|
|
||||||
Solar Panel=
|
|
||||||
LV Solar Array=
|
|
||||||
MV Solar Array=
|
|
||||||
HV Solar Array=
|
|
||||||
Tool Workshop=
|
|
||||||
LV Transformer=
|
|
||||||
MV Transformer=
|
|
||||||
HV Transformer=
|
|
||||||
EV Transformer=
|
|
||||||
Wind Mill=
|
|
||||||
Machine Block=
|
|
||||||
Advanced Machine Block=
|
|
||||||
Rubber Wood=
|
|
||||||
Rubber Leaves=
|
|
||||||
Rubber Sapling=
|
|
||||||
BatPack=
|
|
||||||
LapPack=
|
|
||||||
Electric Chainsaw=
|
|
||||||
Diamond Electric Chainsaw=
|
|
||||||
Electric Drill=
|
|
||||||
Diamond Electric Drill=
|
|
||||||
Electric Hoe=
|
|
||||||
Diamond Electric Hoe=
|
|
||||||
Electric Saber=
|
|
||||||
Diamond Electric Saber=
|
|
||||||
Jetpack=
|
|
||||||
Electric Jetpack=
|
|
||||||
Mining Laser (Mode @1)=
|
|
||||||
Mining Laser (Mode 1)=
|
|
||||||
Nano Helmet=
|
|
||||||
Nano Bodyarmor=
|
|
||||||
Nano Leggings=
|
|
||||||
Nano Boots=
|
|
||||||
Solar Helmet=
|
|
||||||
Static Boots=
|
|
||||||
Treetap=
|
|
||||||
Electric Treetap=
|
|
||||||
Wrench=
|
|
||||||
Electric Wrench=
|
|
||||||
Overclocker Upgrade=
|
|
||||||
Transformer Upgrade=
|
|
||||||
Power Storage Upgrade=
|
|
||||||
Power Storage Inspector=
|
|
||||||
Power Capacity: @1=
|
|
||||||
Power Flow: @1=
|
|
||||||
Power Amount: @1=
|
|
||||||
Power IO Config: @1=
|
|
||||||
Power Capacity=
|
|
||||||
Power Flow=
|
|
||||||
Power Amount=
|
|
||||||
Power IO Config=
|
|
||||||
Update=
|
|
||||||
Connections:=
|
|
||||||
@@ -38,7 +38,8 @@ local function registerNanoSuitPart(config)
|
|||||||
_industrialtest_powerStorage=true,
|
_industrialtest_powerStorage=true,
|
||||||
_industrialtest_powerCapacity=1000000,
|
_industrialtest_powerCapacity=1000000,
|
||||||
_industrialtest_powerFlow=industrialtest.api.evPowerFlow,
|
_industrialtest_powerFlow=industrialtest.api.evPowerFlow,
|
||||||
_industrialtest_damageReduction=config.damageReduction
|
_industrialtest_damageReduction=config.damageReduction,
|
||||||
|
industrialtest_powerPerDamage=5000
|
||||||
})
|
})
|
||||||
elseif industrialtest.mclAvailable then
|
elseif industrialtest.mclAvailable then
|
||||||
groups.armor=1
|
groups.armor=1
|
||||||
@@ -58,7 +59,8 @@ local function registerNanoSuitPart(config)
|
|||||||
_industrialtest_powerStorage=true,
|
_industrialtest_powerStorage=true,
|
||||||
_industrialtest_powerCapacity=1000000,
|
_industrialtest_powerCapacity=1000000,
|
||||||
_industrialtest_powerFlow=industrialtest.api.evPowerFlow,
|
_industrialtest_powerFlow=industrialtest.api.evPowerFlow,
|
||||||
_industrialtest_damageReduction=config.damageReduction
|
_industrialtest_damageReduction=config.damageReduction,
|
||||||
|
_industrialtest_powerPerDamage=5000
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -149,12 +151,12 @@ minetest.register_on_player_hpchange(function(player,hpChange)
|
|||||||
if def.groups and def.groups._industrialtest_nanoSuit then
|
if def.groups and def.groups._industrialtest_nanoSuit then
|
||||||
local meta=stack:get_meta()
|
local meta=stack:get_meta()
|
||||||
local targetReducedDamage=math.floor(math.abs(hpChange)*def._industrialtest_damageReduction)
|
local targetReducedDamage=math.floor(math.abs(hpChange)*def._industrialtest_damageReduction)
|
||||||
local requiredPower=targetReducedDamage*5000
|
local requiredPower=targetReducedDamage*def._industrialtest_powerPerDamage
|
||||||
local availablePower=math.min(meta:get_int("industrialtest.powerAmount"),requiredPower)
|
local availablePower=math.min(meta:get_int("industrialtest.powerAmount"),requiredPower)
|
||||||
local reducedDamage=math.floor(availablePower/5000)
|
local reducedDamage=math.floor(availablePower/def._industrialtest_powerPerDamage)
|
||||||
if reducedDamage>0 then
|
if reducedDamage>0 then
|
||||||
result=result+reducedDamage
|
result=result+reducedDamage
|
||||||
industrialtest.api.addPowerToItem(stack,-reducedDamage*5000)
|
industrialtest.api.addPowerToItem(stack,-reducedDamage*def._industrialtest_powerPerDamage)
|
||||||
inv:set_stack("armor",i,stack)
|
inv:set_stack("armor",i,stack)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
252
tools/quantum_suit.lua
Normal file
252
tools/quantum_suit.lua
Normal file
@@ -0,0 +1,252 @@
|
|||||||
|
-- IndustrialTest
|
||||||
|
-- Copyright (C) 2024 mrkubax10
|
||||||
|
|
||||||
|
-- This program is free software: you can redistribute it and/or modify
|
||||||
|
-- it under the terms of the GNU General Public License as published by
|
||||||
|
-- the Free Software Foundation, either version 3 of the License, or
|
||||||
|
-- (at your option) any later version.
|
||||||
|
|
||||||
|
-- This program is distributed in the hope that it will be useful,
|
||||||
|
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
-- GNU General Public License for more details.
|
||||||
|
|
||||||
|
-- You should have received a copy of the GNU General Public License
|
||||||
|
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
local S=minetest.get_translator("industrialtest")
|
||||||
|
|
||||||
|
local quantumSuit={}
|
||||||
|
quantumSuit.leggingsSpeedOpPower=125
|
||||||
|
quantumSuit.leggingsSpeedMaxVel=4
|
||||||
|
quantumSuit.bootsJumpOpPower=50
|
||||||
|
quantumSuit.bootsFallDamageReductionOpPower=900
|
||||||
|
|
||||||
|
local playerPositions={}
|
||||||
|
local playerLeggingsSpeedEnabled={}
|
||||||
|
local playerBootsJumpEnabled={}
|
||||||
|
|
||||||
|
local function registerQuantumSuitPart(config)
|
||||||
|
config.groups=config.groups or {}
|
||||||
|
config.groups._industrialtest_nanoSuit=1
|
||||||
|
if config.element=="head" then
|
||||||
|
config.groups.armor_head=1
|
||||||
|
elseif config.element=="torso" then
|
||||||
|
config.groups.armor_torso=1
|
||||||
|
elseif config.element=="legs" then
|
||||||
|
config.groups.armor_legs=1
|
||||||
|
elseif config.element=="feet" then
|
||||||
|
config.groups.armor_feet=1
|
||||||
|
end
|
||||||
|
local definition={
|
||||||
|
description=config.displayName,
|
||||||
|
inventory_image="industrialtest_"..config.name.."_inv.png",
|
||||||
|
groups=config.groups,
|
||||||
|
_industrialtest_powerStorage=true,
|
||||||
|
_industrialtest_powerCapacity=10000000,
|
||||||
|
_industrialtest_powerFlow=industrialtest.api.ivPowerFlow,
|
||||||
|
_industrialtest_damageReduction=config.damageReduction,
|
||||||
|
_industrialtest_powerPerDamage=30
|
||||||
|
}
|
||||||
|
if config.customKeys then
|
||||||
|
for k,v in pairs(config.customKeys) do
|
||||||
|
definition[k]=v
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if industrialtest.mtgAvailable then
|
||||||
|
definition.groups.armor_heal=0
|
||||||
|
armor:register_armor("industrialtest:"..config.name,definition)
|
||||||
|
elseif industrialtest.mclAvailable then
|
||||||
|
definition.groups.armor=1
|
||||||
|
definition.groups.non_combat_armor=1
|
||||||
|
definition.sounds={
|
||||||
|
_mcl_armor_equip="mcl_armor_equip_iron",
|
||||||
|
_mcl_armor_unequip="mcl_armor_unequip_iron"
|
||||||
|
}
|
||||||
|
definition.on_place=mcl_armor.equip_on_use
|
||||||
|
definition.on_secondary_use=mcl_armor.equip_on_use
|
||||||
|
definition._mcl_armor_element=config.element
|
||||||
|
definition._mcl_armor_texture=(config.element=="feet" and "industrialtest_mcl_" or "industrialtest_")..config.name..".png"
|
||||||
|
minetest.register_tool("industrialtest:"..config.name,definition)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local function findInPlayerArmorList(player,itemname)
|
||||||
|
local inv
|
||||||
|
if industrialtest.mclAvailable then
|
||||||
|
inv=player:get_inventory()
|
||||||
|
elseif industrialtest.mtgAvailable then
|
||||||
|
_,inv=armor:get_valid_player(player,"")
|
||||||
|
end
|
||||||
|
local armorList=inv:get_list("armor")
|
||||||
|
for i,stack in ipairs(armorList) do
|
||||||
|
if stack:get_name()==itemname then
|
||||||
|
return i,stack,inv
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
quantumSuit.tryFly=function(itemstack)
|
||||||
|
local meta=itemstack:get_meta()
|
||||||
|
if meta:get_int("industrialtest.powerAmount")<10 then
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
industrialtest.api.addPowerToItem(itemstack,-10)
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
registerQuantumSuitPart({
|
||||||
|
name="quantum_helmet",
|
||||||
|
displayName=S("Quantum Helmet"),
|
||||||
|
element="head",
|
||||||
|
damageReduction=0.15
|
||||||
|
})
|
||||||
|
|
||||||
|
registerQuantumSuitPart({
|
||||||
|
name="quantum_bodyarmor",
|
||||||
|
displayName=S("Quantum Bodyarmor"),
|
||||||
|
element="torso",
|
||||||
|
damageReduction=0.4,
|
||||||
|
groups={
|
||||||
|
_industrialtest_jetpack=1
|
||||||
|
},
|
||||||
|
customKeys={
|
||||||
|
_industrialtest_tryFly=quantumSuit.tryFly
|
||||||
|
}
|
||||||
|
})
|
||||||
|
minetest.register_craft({
|
||||||
|
type="shaped",
|
||||||
|
output="industrialtest:quantum_bodyarmor",
|
||||||
|
recipe={
|
||||||
|
{"industrialtest:advanced_alloy","industrialtest:nano_bodyarmor","industrialtest:advanced_alloy"},
|
||||||
|
{"industrialtest:iridium_plate","industrialtest:lapotron_crystal","industrialtest:iridium_plate"},
|
||||||
|
{"industrialtest:iridium_plate","industrialtest:electric_jetpack","industrialtest:iridium_plate"}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
registerQuantumSuitPart({
|
||||||
|
name="quantum_leggings",
|
||||||
|
displayName=S("Quantum Leggings"),
|
||||||
|
element="legs",
|
||||||
|
damageReduction=0.30
|
||||||
|
})
|
||||||
|
minetest.register_craft({
|
||||||
|
type="shaped",
|
||||||
|
output="industrialtest:quantum_leggings",
|
||||||
|
recipe={
|
||||||
|
{"industrialtest:machine_block","industrialtest:lapotron_crystal","industrialtest:machine_block"},
|
||||||
|
{"industrialtest:iridium_plate","industrialtest:nano_leggings","industrialtest:iridium_plate"},
|
||||||
|
{industrialtest.elementKeys.yellowDust,"",industrialtest.elementKeys.yellowDust}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
registerQuantumSuitPart({
|
||||||
|
name="quantum_boots",
|
||||||
|
displayName=S("Quantum Boots"),
|
||||||
|
element="feet",
|
||||||
|
damageReduction=0.15
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_globalstep(function(dtime)
|
||||||
|
local players=minetest.get_connected_players()
|
||||||
|
for _,player in ipairs(players) do
|
||||||
|
local control=player:get_player_control()
|
||||||
|
local playerName=player:get_player_name()
|
||||||
|
if playerLeggingsSpeedEnabled[playerName] then
|
||||||
|
local shouldStopSpeed=true
|
||||||
|
if control.up and control.aux1 then
|
||||||
|
local index,stack,inv=findInPlayerArmorList(player,"industrialtest:quantum_leggings")
|
||||||
|
if index and stack and inv then
|
||||||
|
local meta=stack:get_meta()
|
||||||
|
local requiredPower=vector.distance(player:get_pos(),playerPositions[playerName])*quantumSuit.leggingsSpeedOpPower
|
||||||
|
if meta:get_int("industrialtest.powerAmount")>=requiredPower then
|
||||||
|
industrialtest.api.addPowerToItem(stack,-requiredPower)
|
||||||
|
inv:set_stack("armor",index,stack)
|
||||||
|
shouldStopSpeed=false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if shouldStopSpeed then
|
||||||
|
player:set_physics_override({
|
||||||
|
speed=1
|
||||||
|
})
|
||||||
|
playerLeggingsSpeedEnabled[playerName]=false
|
||||||
|
end
|
||||||
|
elseif control.up and control.aux1 then
|
||||||
|
local index,stack,inv=findInPlayerArmorList(player,"industrialtest:quantum_leggings")
|
||||||
|
if index and stack and inv then
|
||||||
|
local meta=stack:get_meta()
|
||||||
|
local requiredPower=vector.distance(player:get_pos(),playerPositions[playerName])*quantumSuit.leggingsSpeedOpPower
|
||||||
|
if meta:get_int("industrialtest.powerAmount")>=requiredPower then
|
||||||
|
player:set_physics_override({
|
||||||
|
speed=quantumSuit.leggingsSpeedMaxVel
|
||||||
|
})
|
||||||
|
playerLeggingsSpeedEnabled[playerName]=true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if playerBootsJumpEnabled[playerName] then
|
||||||
|
local shouldStopJump=not control.aux1
|
||||||
|
if control.jump and control.aux1 then
|
||||||
|
local index,stack,inv=findInPlayerArmorList(player,"industrialtest:quantum_boots")
|
||||||
|
if index and stack and inv then
|
||||||
|
local meta=stack:get_meta()
|
||||||
|
if meta:get_int("industrialtest.powerAmount")>=quantumSuit.bootsJumpOpPower then
|
||||||
|
industrialtest.api.addPowerToItem(stack,-quantumSuit.bootsJumpOpPower)
|
||||||
|
inv:set_stack("armor",index,stack)
|
||||||
|
shouldStopJump=false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if shouldStopJump then
|
||||||
|
player:set_physics_override({
|
||||||
|
jump=1
|
||||||
|
})
|
||||||
|
playerBootsJumpEnabled[playerName]=false
|
||||||
|
end
|
||||||
|
elseif control.aux1 then
|
||||||
|
local index,stack,inv=findInPlayerArmorList(player,"industrialtest:quantum_boots")
|
||||||
|
if index and stack and inv then
|
||||||
|
local meta=stack:get_meta()
|
||||||
|
local requiredPower=vector.distance(player:get_pos(),playerPositions[playerName])*quantumSuit.leggingsSpeedOpPower
|
||||||
|
if meta:get_int("industrialtest.powerAmount")>=quantumSuit.bootsJumpOpPower then
|
||||||
|
player:set_physics_override({
|
||||||
|
jump=2
|
||||||
|
})
|
||||||
|
playerBootsJumpEnabled[playerName]=true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if player:get_breath()<10 then
|
||||||
|
minetest.debug(player:get_breath())
|
||||||
|
local index,stack,inv=findInPlayerArmorList(player,"industrialtest:quantum_helmet")
|
||||||
|
if index and stack and inv then
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
playerPositions[playerName]=player:get_pos()
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
|
minetest.register_on_player_hpchange(function(player,hpChange,reason)
|
||||||
|
if reason.type~="fall" then
|
||||||
|
return hpChange
|
||||||
|
end
|
||||||
|
|
||||||
|
local index,stack,inv=findInPlayerArmorList(player,"industrialtest:quantum_boots")
|
||||||
|
if not index or not stack or not inv then
|
||||||
|
return hpChange
|
||||||
|
end
|
||||||
|
|
||||||
|
local damage=math.abs(hpChange)
|
||||||
|
local meta=stack:get_meta()
|
||||||
|
local reducedDamage=math.min(damage,math.floor(meta:get_int("industrialtest.powerAmount")/(damage*quantumSuit.bootsFallDamageReductionOpPower)))
|
||||||
|
industrialtest.api.addPowerToItem(stack,-reducedDamage*quantumSuit.bootsFallDamageReductionOpPower)
|
||||||
|
inv:set_stack("armor",index,stack)
|
||||||
|
|
||||||
|
return hpChange+reducedDamage
|
||||||
|
end,true)
|
||||||
Reference in New Issue
Block a user