Compare commits
11 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
9c3af421ce | ||
![]() |
31aa8794fd | ||
![]() |
439fb9752a | ||
![]() |
84b7f3d795 | ||
![]() |
ff25cad5eb | ||
![]() |
6905d2d6f0 | ||
![]() |
227377f411 | ||
![]() |
a2520e2932 | ||
![]() |
ebcd4e8ab6 | ||
![]() |
05126557e4 | ||
![]() |
64f1a31167 |
3
.gitignore
vendored
@ -40,3 +40,6 @@ luac.out
|
|||||||
.idea
|
.idea
|
||||||
*.iml
|
*.iml
|
||||||
|
|
||||||
|
i18n.py
|
||||||
|
*.old
|
||||||
|
|
||||||
|
34
craft.lua
@ -1,3 +1,5 @@
|
|||||||
|
local S = minetest.get_translator("surface_effect")
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = 'surface_effect:dosimeter',
|
output = 'surface_effect:dosimeter',
|
||||||
recipe = {
|
recipe = {
|
||||||
@ -7,6 +9,16 @@ minetest.register_craft({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
--Задействовать если подключено два мода technic и unified_inventory
|
||||||
|
if minetest.get_modpath("technic") and minetest.get_modpath("unified_inventory") then
|
||||||
|
unified_inventory.register_craft_type("grinding", {
|
||||||
|
description = S("Grinder"),
|
||||||
|
icon = "technic_lv_grinder_front.png", -- Иконка для типа рецепта
|
||||||
|
width = 1,
|
||||||
|
height = 1
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
if minetest.get_modpath("technic") and minetest.get_modpath("space_travel") then
|
if minetest.get_modpath("technic") and minetest.get_modpath("space_travel") then
|
||||||
technic.register_grinder_recipe({
|
technic.register_grinder_recipe({
|
||||||
input = {'space_travel:irradiated_space_cobble'},
|
input = {'space_travel:irradiated_space_cobble'},
|
||||||
@ -21,3 +33,25 @@ if minetest.get_modpath("technic") and minetest.get_modpath("space_travel") then
|
|||||||
recipe={{'space_travel:space_gravel'}}
|
recipe={{'space_travel:space_gravel'}}
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--Исправление в зависимостях рецепта
|
||||||
|
if minetest.get_modpath("bunker") and minetest.get_modpath("technic") then
|
||||||
|
minetest.clear_craft({
|
||||||
|
output = "bunker:cement_powder"
|
||||||
|
})
|
||||||
|
|
||||||
|
technic.register_grinder_recipe({
|
||||||
|
input = {'default:clay_lump'},
|
||||||
|
output = 'bunker:cement_powder 1'
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
minetest.override_item("shields:shield_gold", {
|
||||||
|
groups = {not_in_creative_inventory = 1},
|
||||||
|
})
|
||||||
|
minetest.override_item("shields:shield_cactus", {
|
||||||
|
groups = {not_in_creative_inventory = 1},
|
||||||
|
})
|
||||||
|
minetest.override_item("shields:shield_enhanced_cactus", {
|
||||||
|
groups = {not_in_creative_inventory = 1},
|
||||||
|
})
|
6
init.lua
@ -9,6 +9,7 @@ dofile(minetest.get_modpath("surface_effect") .. "/function.lua")
|
|||||||
dofile(minetest.get_modpath("surface_effect") .. "/nodes.lua")
|
dofile(minetest.get_modpath("surface_effect") .. "/nodes.lua")
|
||||||
dofile(minetest.get_modpath("surface_effect") .. "/craft.lua")
|
dofile(minetest.get_modpath("surface_effect") .. "/craft.lua")
|
||||||
dofile(minetest.get_modpath("surface_effect") .. "/register_abm.lua")
|
dofile(minetest.get_modpath("surface_effect") .. "/register_abm.lua")
|
||||||
|
dofile(minetest.get_modpath("surface_effect") .. "/tablet.lua")
|
||||||
|
|
||||||
minetest.register_globalstep(function(dtime)
|
minetest.register_globalstep(function(dtime)
|
||||||
-- every 5 seconds
|
-- every 5 seconds
|
||||||
@ -28,6 +29,7 @@ minetest.register_globalstep(function(dtime)
|
|||||||
surface_effect.technicDetectUranium(player)
|
surface_effect.technicDetectUranium(player)
|
||||||
|
|
||||||
local pos = object:get_pos()
|
local pos = object:get_pos()
|
||||||
|
|
||||||
su.rediationDomage(player, pos)
|
su.rediationDomage(player, pos)
|
||||||
--minetest.chat_send_all(dump(areas:getAreasAtPos(pos)))
|
--minetest.chat_send_all(dump(areas:getAreasAtPos(pos)))
|
||||||
end
|
end
|
||||||
@ -167,6 +169,10 @@ if minetest.get_modpath("rangedweapons") then
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
minetest.clear_craft({
|
||||||
|
output = "vehicles:missile_2_item"
|
||||||
|
})
|
||||||
|
|
||||||
default.cool_lava = function(pos, node)
|
default.cool_lava = function(pos, node)
|
||||||
if node.name == "default:lava_source" then
|
if node.name == "default:lava_source" then
|
||||||
minetest.set_node(pos, {name = "default:obsidian"})
|
minetest.set_node(pos, {name = "default:obsidian"})
|
||||||
|
@ -1,7 +1,16 @@
|
|||||||
# textdomain: surface_effect
|
# textdomain: surface_effect
|
||||||
Attention! High levels of radiation.=Внимание! Высокий уровень радиации.
|
Grinder=Гриндер
|
||||||
Chemical protection status: @1%=Состояние химзащиты: @1%
|
Chemical protection status: @1%=Состояние химзащиты: @1%
|
||||||
|
Attention! High levels of radiation.=Внимание! Высокий уровень радиации.
|
||||||
#nodes lua
|
#nodes lua
|
||||||
Irradiated Earth=Облученная земля
|
Irradiated Earth=Облученная земля
|
||||||
Dosimeter (inserted into the charging slot)=Дозиметр (вставляется в слот для зарядки)
|
Dosimeter (inserted into the charging slot)=Дозиметр (вставляется в слот для зарядки)
|
||||||
|
Software version: @1=Версия ПО: @1
|
||||||
|
Tablet=Планшет
|
||||||
|
No charge, device needs to be charged=Не заряжается, устройство необходимо зарядить
|
||||||
|
Not charged, the device needs to be charged=Не заряжается, устройство необходимо зарядить
|
||||||
|
|
||||||
|
|
||||||
|
##### not used anymore #####
|
||||||
|
|
||||||
|
Air temperature: @1=Температура воздуха: @1
|
||||||
|
10
locale/template.txt
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
# textdomain: surface_effect
|
||||||
|
Grinder=
|
||||||
|
Chemical protection status: @1%=
|
||||||
|
Attention! High levels of radiation.=
|
||||||
|
Irradiated Earth=
|
||||||
|
Dosimeter (inserted into the charging slot)=
|
||||||
|
Software version: @1=
|
||||||
|
Tablet=
|
||||||
|
No charge, device needs to be charged=
|
||||||
|
Not charged, the device needs to be charged=
|
4
mod.conf
@ -1,7 +1,7 @@
|
|||||||
name = surface_effect
|
name = surface_effect
|
||||||
description = surface effect
|
description = surface effect
|
||||||
depends = default, persistent_effects, mobs_monster, radiant_damage, hazmat_suit
|
depends = default, persistent_effects, mobs_monster, radiant_damage, hazmat_suit, ethereal, 3d_armor
|
||||||
optional_depends = technic, farming, space_travel
|
optional_depends = technic, farming, space_travel, bunker, unified_inventory
|
||||||
min_minetest_version = 5.7
|
min_minetest_version = 5.7
|
||||||
title = Surface Effect
|
title = Surface Effect
|
||||||
release = 0
|
release = 0
|
||||||
|
@ -17,9 +17,78 @@ if minetest.get_modpath("areas") then
|
|||||||
interval = 10/speed,
|
interval = 10/speed,
|
||||||
chance = 50,
|
chance = 50,
|
||||||
action = function(pos)
|
action = function(pos)
|
||||||
if pos.y > -10 and pos.y < 1500 then
|
if pos.y > -10 and pos.y < 30 then
|
||||||
minetest.env:add_node(pos, {name="surface_effect:radioactive_earth"})
|
minetest.env:add_node(pos, {name="surface_effect:radioactive_earth"})
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
minetest.register_abm({
|
||||||
|
nodenames = {"group:flammable"},
|
||||||
|
interval = 30/speed,
|
||||||
|
chance = 2000,
|
||||||
|
action = function(pos)
|
||||||
|
local info_biome = minetest.get_biome_data(pos)
|
||||||
|
|
||||||
|
if pos.y > -10 and pos.y < 500 and info_biome.heat > 45 then
|
||||||
|
minetest.env:add_node(pos, {name="fire:basic_flame"})
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_abm({
|
||||||
|
nodenames = {"default:leaves"},
|
||||||
|
interval = 10/speed,
|
||||||
|
chance = 100,
|
||||||
|
action = function(pos)
|
||||||
|
if pos.y > -10 and pos.y < 1500 then
|
||||||
|
minetest.env:remove_node(pos)
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_abm({
|
||||||
|
nodenames = {"default:water_source"},
|
||||||
|
interval = 10/speed,
|
||||||
|
chance = 50,
|
||||||
|
action = function(pos)
|
||||||
|
local info_biome = minetest.get_biome_data(pos)
|
||||||
|
|
||||||
|
if pos.y > -10 and pos.y < 1500 and info_biome.heat > 45 then
|
||||||
|
minetest.env:remove_node(pos)
|
||||||
|
if minetest.env:get_node({x=pos.x, y=pos.y -1, z=pos.z}).name == "default:water_source" then
|
||||||
|
minetest.env:remove_node({x=pos.x, y=pos.y -1, z=pos.z})
|
||||||
|
end
|
||||||
|
if minetest.env:get_node({x=pos.x, y=pos.y +1, z=pos.z}).name == "default:water_source" then
|
||||||
|
minetest.env:remove_node({x=pos.x, y=pos.y +1, z=pos.z})
|
||||||
|
end
|
||||||
|
|
||||||
|
if minetest.env:get_node({x=pos.x -1, y=pos.y, z=pos.z}).name == "default:water_source" then
|
||||||
|
minetest.env:remove_node({x=pos.x -1, y=pos.y, z=pos.z})
|
||||||
|
end
|
||||||
|
if minetest.env:get_node({x=pos.x +1, y=pos.y, z=pos.z}).name == "default:water_source" then
|
||||||
|
minetest.env:remove_node({x=pos.x +1, y=pos.y, z=pos.z})
|
||||||
|
end
|
||||||
|
|
||||||
|
if minetest.env:get_node({x=pos.x, y=pos.y, z=pos.z -1}).name == "default:water_source" then
|
||||||
|
minetest.env:remove_node({x=pos.x, y=pos.y, z=pos.z -1})
|
||||||
|
end
|
||||||
|
if minetest.env:get_node({x=pos.x, y=pos.y, z=pos.z +1}).name == "default:water_source" then
|
||||||
|
minetest.env:remove_node({x=pos.x, y=pos.y, z=pos.z +1})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_abm({
|
||||||
|
nodenames = {"default:dirt_with_grass"},
|
||||||
|
interval = 30/speed,
|
||||||
|
chance = 2000,
|
||||||
|
action = function(pos)
|
||||||
|
if pos.y > -10 and pos.y < 100 then
|
||||||
|
local pos = {x = pos.x, y = pos.y, z = pos.z}
|
||||||
|
minetest.env:add_node(pos, {name="ethereal:dry_dirt"})
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
80
tablet.lua
Normal file
@ -0,0 +1,80 @@
|
|||||||
|
local S = minetest.get_translator("surface_effect")
|
||||||
|
|
||||||
|
local version = "0.0.1"
|
||||||
|
local width = 15
|
||||||
|
local height = 10
|
||||||
|
local winsize = "size["..width..",".. height .."]"
|
||||||
|
local bgimage = "no_prepend[] bgcolor[#FFFFFF;true] background[0,-1;15,11;surface_effect_tablet_bg.png]"
|
||||||
|
surface_effect.display = {}
|
||||||
|
|
||||||
|
local function get_charge_indicator(power)
|
||||||
|
local arm = 65535 / 100
|
||||||
|
local percent = (65535 - (power - 65535))/arm
|
||||||
|
|
||||||
|
if percent > 55 then
|
||||||
|
return 3
|
||||||
|
elseif percent > 15 then
|
||||||
|
return 2
|
||||||
|
elseif percent < 10 then
|
||||||
|
return 1
|
||||||
|
end
|
||||||
|
return 0
|
||||||
|
end
|
||||||
|
|
||||||
|
function surface_effect.display.main(player, power)
|
||||||
|
local pos = player:get_pos()
|
||||||
|
local info_biome = minetest.get_biome_data(pos)
|
||||||
|
--minetest.log(dump(info_biome))
|
||||||
|
local formspec = {
|
||||||
|
"formspec_version[4]",
|
||||||
|
winsize,
|
||||||
|
bgimage,
|
||||||
|
"container[0,0]",
|
||||||
|
"style_type[label;textcolor=green;bgcolor=red;font_size=20]",
|
||||||
|
"label[1.0,0.2;"..S("Software version: @1", minetest.colorize("#FF0000", version)).."]",
|
||||||
|
"image[".. width - 3 ..",0;0.8,0.5;surface_effect_antena0.png]",
|
||||||
|
"image[".. width - 2 ..",0;1.0,0.5;surface_effect_tablet_charge_level".. get_charge_indicator(power) .. ".png]",
|
||||||
|
"container_end[]",
|
||||||
|
"image[1.0,1.0;0.7,0.7;surface_effect_thermometer.png]",
|
||||||
|
"label[1.5,1.0;"..math.floor(info_biome.heat).."]",
|
||||||
|
"button[".. width / 2 .. ",".. height - 1 ..";0.5,0.5;home;|]"
|
||||||
|
--"style[weather;textcolor=black;size=2]",
|
||||||
|
--"image_button[0.5,0.5;1.5,1.5;surface_effect_weather_btn.png;weather;Weather]"
|
||||||
|
}
|
||||||
|
|
||||||
|
return table.concat(formspec, "")
|
||||||
|
end
|
||||||
|
|
||||||
|
minetest.register_tool("surface_effect:tablet", {
|
||||||
|
description = S("Tablet"),
|
||||||
|
inventory_image = "surface_effect_tablet.png",
|
||||||
|
wear_represents = "technic_RE_charge",
|
||||||
|
groups = {not_in_creative_inventory = 0},
|
||||||
|
on_use = function(stack, player, pointed)
|
||||||
|
local name = player:get_player_name()
|
||||||
|
local meta = stack:get_meta()
|
||||||
|
local charge = meta:get_int("technic:charge")
|
||||||
|
if charge == -1 then
|
||||||
|
minetest.chat_send_player(name, S("No charge, device needs to be charged"))
|
||||||
|
end
|
||||||
|
charge = charge - 1
|
||||||
|
|
||||||
|
if charge < 0 then
|
||||||
|
technic.set_RE_wear(stack, 0, 65535)
|
||||||
|
meta:set_int("technic:charge", -1)
|
||||||
|
minetest.chat_send_player(name, S("Not charged, the device needs to be charged"))
|
||||||
|
end
|
||||||
|
|
||||||
|
if charge > 0 then
|
||||||
|
technic.set_RE_wear(stack, charge, 65535)
|
||||||
|
meta:set_int("technic:charge", charge)
|
||||||
|
minetest.show_formspec(name, "surface_effect:display_main", surface_effect.display.main(player, charge))
|
||||||
|
--stack:set_stack()
|
||||||
|
end
|
||||||
|
return stack
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
if minetest.get_modpath("technic") then
|
||||||
|
technic.register_power_tool("surface_effect:tablet", 65535)
|
||||||
|
end
|
BIN
textures/surface_effect_antena0.png
Normal file
After Width: | Height: | Size: 687 B |
BIN
textures/surface_effect_antena1.png
Normal file
After Width: | Height: | Size: 687 B |
BIN
textures/surface_effect_antena2.png
Normal file
After Width: | Height: | Size: 685 B |
BIN
textures/surface_effect_antena3.png
Normal file
After Width: | Height: | Size: 685 B |
BIN
textures/surface_effect_antena_full.png
Normal file
After Width: | Height: | Size: 672 B |
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 17 KiB |
BIN
textures/surface_effect_tablet.png
Normal file
After Width: | Height: | Size: 3.0 KiB |
BIN
textures/surface_effect_tablet_bg.png
Normal file
After Width: | Height: | Size: 50 KiB |
BIN
textures/surface_effect_tablet_charge_level0.png
Normal file
After Width: | Height: | Size: 597 B |
BIN
textures/surface_effect_tablet_charge_level1.png
Normal file
After Width: | Height: | Size: 603 B |
BIN
textures/surface_effect_tablet_charge_level2.png
Normal file
After Width: | Height: | Size: 603 B |
BIN
textures/surface_effect_tablet_charge_level3.png
Normal file
After Width: | Height: | Size: 594 B |
BIN
textures/surface_effect_thermometer.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
textures/surface_effect_weather_btn.png
Normal file
After Width: | Height: | Size: 2.3 KiB |