Finalize for release 0.5

This commit is contained in:
Functioning Member of Society 2022-11-27 14:08:38 -05:00
parent ac9ea6c4e0
commit 971dc82648
34 changed files with 379 additions and 49 deletions

View File

@ -80,7 +80,7 @@ minetest.register_abm({
interval = 40,
chance = 140,
action = function(pos, node, active_object_count, active_object_count_wider)
if cops.copsSpawned < 20 then
if cops.copsSpawned < 25 then
newPos = {x = pos.x, y = pos.y + 2, z = pos.z}
local i = math.random(0, 7)
if i < 2 then
@ -280,4 +280,5 @@ onCopDie = function(self, pos)
minetest.set_node(pos, {name = "literal_trash:bloodstain", param2 = 1})
destruction_counter.pigsKilled = destruction_counter.pigsKilled + 1
cops.copsSpawned = cops.copsSpawned - 1
destruction_counter.updateCounter()
end

View File

@ -50,14 +50,17 @@ end)
function destruction_counter.updateCounter(player)
if not player then
return
player = minetest.get_player_by_name("singleplayer")
end
local totalDestruction = destruction_counter.nodesDestroyed + destruction_counter.pigsKilled * 20 + destruction_counter.peopleKilled * 10 + math.floor(nodesDestroyedByHand / 10)
local percentage = (totalDestruction / 1000 * 4)
if percentage > 100 then
percentage = 100
local percentage = (totalDestruction / 2000 * 4)
if percentage > 4 then
percentage = 4
end
player:hud_change(idText, "text", "Destruction meter: " .. totalDestruction)
player:hud_change(idMeter, "scale", {x = percentage, y = 4})
end

Binary file not shown.

Before

Width:  |  Height:  |  Size: 314 B

After

Width:  |  Height:  |  Size: 6.6 KiB

9
mods/ip_help/init.lua Normal file
View File

@ -0,0 +1,9 @@
sfinv.register_page("ip_help:how_to_play", {
title = "How to Play",
get = function(self, player, context)
return sfinv.make_formspec(player, context, [[
bgcolor[#3A41EA]
hypertext[.1, .5; 5, 12;;<global halign=center color=yellow size=14 font=Regular>Here's how to play:The goal is to destroy as much stuff as you can. You can use pipebombs, firebombs (molotov cocktails), your fist, or even the batons that some cops drop upon death. You can craft molotov cocktails by surrounding a jerrycan with empty beer bottles. You get points by killing police officers, regular people, and destroying buildings.]
]], true)
end
})

3
mods/ip_help/mod.conf Normal file
View File

@ -0,0 +1,3 @@
title = Insane Protestor Help
name = ip_help
depends = sfinv

View File

@ -142,4 +142,5 @@ mobs:register_mob(":people:male", {
onPersonDie = function(self, pos)
minetest.set_node(pos, {name = "literal_trash:bloodstain", param2 = 1})
destruction_counter.peopleKilled = destruction_counter.peopleKilled + 1
destruction_counter.updateCounter()
end

View File

@ -205,7 +205,7 @@
tiles = {"infrastructure_truss.png"},
drawtype = "nodebox",
paramtype = "light",
groups = {cracky = 2},
groups = {cracky = 3, falling_node = 1},
node_box = {
type = "fixed",
fixed = {
@ -248,7 +248,7 @@
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = {cracky = 2},
groups = {cracky = 4},
node_box = {
type = "fixed",
fixed = {
@ -281,7 +281,7 @@
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = {cracky = 2},
groups = {cracky = 3},
node_box = {
type = "fixed",
fixed = {-1/2, -1/2, -1/2, 0, -3/8, 1/2}
@ -355,7 +355,7 @@
description = "Riffled Sheet",
tiles = {"infrastructure_riffled_sheet.png"},
is_ground_content = false,
groups = {cracky = 2},
groups = {cracky = 3},
sounds = default.node_sound_stone_defaults(),
paramtype2 = "wallmounted",
drawtype = "nodebox",
@ -374,9 +374,16 @@
tiles = {"infrastructure_corrugated_sheet.png"},
inventory_image = "infrastructure_corrugated_sheet.png",
wield_image = "infrastructure_corrugated_sheet.png",
drawtype = "raillike",
groups = {cracky = 3, oddly_breakable_by_hand = 1},
paramtype2 = "wallmounted",
drawtype = "nodebox",
paramtype = "light",
groups = {cracky = 2, oddly_breakable_by_hand = 1},
node_box = {
type = "wallmounted",
fixed = {
{-0.5, -0.5, 0.4375, 0.5, 0.5, 0.5},
}
}
})
-- **************************************************************************************************** ADVANCED ITEMS

View File

@ -40,7 +40,7 @@ minetest.register_node(":soviet:concrete", {
stairs.register_stair_and_slab(
"concrete",
"soviet:concrete",
{cracky = 2},
{cracky = 3},
{"soviet_concrete.png"},
"Concrete Stair",
"Concrete Slab",
@ -52,7 +52,7 @@ minetest.register_node(":soviet:concrete_window", {
description = "Chunk of Concrete with a Window in it",
tiles = {"soviet_concrete_window.png"},
is_ground_content = false,
groups = {cracky = 2},
groups = {cracky = 3},
sounds = default.node_sound_stone_defaults(),
})
@ -60,14 +60,14 @@ minetest.register_node(":soviet:staircase_flooring", {
description = "Apt Building Staircase/Lobby Flooring",
tiles = {"soviet_staircase_flooring.png"},
is_ground_content = false,
groups = {cracky = 2},
groups = {cracky = 3},
sounds = default.node_sound_stone_defaults(),
})
stairs.register_stair_and_slab(
"staircase_flooring",
"soviet:staircase_flooring",
{cracky = 2},
{cracky = 3},
{"soviet_staircase_flooring.png"},
"Apt Staircase/Lobby Flooring Stair",
"Apt Staircase/Lobby Flooring Slab",
@ -86,7 +86,7 @@ minetest.register_node(":soviet:glass",
sunlight_propagates = true,
sounds = default.node_sound_glass_defaults(),
is_ground_content = false,
groups = {cracky = 1},
groups = {cracky = 3},
})
-- Plantlike nodes
@ -122,7 +122,7 @@ minetest.register_node(":soviet:tea", {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25}
},
groups = {dig_immediate = 3, attached_node = 1},
groups = {cracky = 4, dig_immediate = 3, attached_node = 1},
sounds = default.node_sound_glass_defaults()
})
@ -137,7 +137,7 @@ minetest.register_node(":soviet:ceilling_light", {
light_source = 15,
is_ground_content = false,
walkable = false,
groups = {cracky = 1},
groups = {cracky = 3},
sounds = default.node_sound_glass_defaults(),
})
@ -178,7 +178,7 @@ minetest.register_node(":soviet:transradio", {
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = {cracky = 2},
groups = {cracky = 4},
node_box = {
type = "fixed",
fixed = {
@ -195,7 +195,7 @@ minetest.register_node(":soviet:concrete_thin", {
description = "Thin Concrete Wall",
tiles = {"soviet_concrete.png"},
is_ground_content = false,
groups = {cracky = 2},
groups = {cracky = 3},
sounds = default.node_sound_stone_defaults(),
paramtype2 = "wallmounted",
drawtype = "nodebox",
@ -212,7 +212,7 @@ minetest.register_node(":soviet:concrete_thin_lower", {
description = "Thin Concrete Wall",
tiles = {"soviet_concrete.png"},
is_ground_content = false,
groups = {cracky = 2},
groups = {cracky = 3},
sounds = default.node_sound_stone_defaults(),
paramtype2 = "facedir",
drawtype = "nodebox",
@ -224,20 +224,3 @@ minetest.register_node(":soviet:concrete_thin_lower", {
}
}
})
minetest.register_node(":soviet:concrete_thin", {
description = "Thin Concrete Wall",
tiles = {"soviet_concrete.png"},
is_ground_content = false,
groups = {cracky = 2},
sounds = default.node_sound_stone_defaults(),
paramtype2 = "wallmounted",
drawtype = "nodebox",
paramtype = "light",
node_box = {
type = "wallmounted",
fixed = {
{-0.5, -0.5, 0.4375, 0.5, 0.5, 0.5},
}
}
})

View File

@ -53,15 +53,14 @@ minetest.register_on_joinplayer(function(player)
end)
minetest.register_on_newplayer(function(ObjectRef)
minetest.place_schematic({x = 0, y = -1, z = 0}, minetest.get_modpath("ip_story") .. "/schems/citymap-v2.mts", "0", nil, true)
minetest.place_schematic({x = 0, y = -1, z = 0}, minetest.get_modpath("ip_story") .. "/schems/citymap-v3.mts", "0", nil, true)
minetest.after(4, function() minetest.fix_light({x = 20, y = 129, z = 191}, {x = 236, y = 12, z = 6}) end)
ObjectRef:set_pos({x = 180, y = 42, z = 145})
ObjectRef:set_pos({x = 185, y = 24, z = 152})
end)
minetest.register_on_respawnplayer(function(player)
minetest.after(.1, function()
player:set_pos({x = 180, y = 42, z = 145})
player:set_pos({x = 185, y = 24, z = 152})
end)
end)

View File

@ -26,7 +26,7 @@ minetest.register_node(":waterworks:pipe", {
paramtype = "light",
is_ground_content = false,
groups = {oddly_breakable_by_hand = 1, waterworks_pipe = 1},
groups = {cracky = 3, waterworks_pipe = 1},
--sounds = default.node_sound_metal_defaults(),
on_construct = function(pos)
waterworks.place_pipe(pos)
@ -57,7 +57,7 @@ minetest.register_node(":waterworks:valve_on", {
paramtype = "light",
is_ground_content = false,
groups = {oddly_breakable_by_hand = 1, waterworks_pipe = 1},
groups = {cracky = 3, waterworks_pipe = 1},
--sounds = default.node_sound_metal_defaults(),
on_construct = function(pos)
waterworks.place_pipe(pos)
@ -91,7 +91,7 @@ minetest.register_node(":waterworks:valve_off", {
drops = "waterworks:valve_on",
is_ground_content = false,
groups = {oddly_breakable_by_hand = 1, waterworks_inert = 1, not_in_creative_inventory = 1},
groups = {cracky = 3, waterworks_inert = 1, not_in_creative_inventory = 1},
--sounds = default.node_sound_metal_defaults(),
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
node.name = "waterworks:valve_on"
@ -121,7 +121,7 @@ minetest.register_node(":waterworks:inlet", {
},
paramtype2 = "facedir",
is_ground_content = false,
groups = {oddly_breakable_by_hand = 1, waterworks_connected = 1},
groups = {cracky = 3, waterworks_connected = 1},
--sounds = default.node_sound_metal_defaults(),
paramtype = "light",
drawtype = "nodebox",
@ -165,7 +165,7 @@ minetest.register_node(":waterworks:pumped_inlet", {
},
paramtype2 = "facedir",
is_ground_content = false,
groups = {oddly_breakable_by_hand = 1, waterworks_connected = 1},
groups = {cracky = 3, waterworks_connected = 1},
--sounds = default.node_sound_metal_defaults(),
paramtype = "light",
drawtype = "normal",
@ -205,7 +205,7 @@ minetest.register_node(":waterworks:outlet", {
},
paramtype2 = "facedir",
is_ground_content = false,
groups = {oddly_breakable_by_hand = 1, waterworks_connected = 1},
groups = {cracky = 3, waterworks_connected = 1},
paramtype = "light",
drawtype = "nodebox",
@ -251,7 +251,7 @@ minetest.register_node(":waterworks:grate", {
},
paramtype2 = "facedir",
is_ground_content = false,
groups = {oddly_breakable_by_hand = 1, waterworks_connected = 1},
groups = {cracky = 3, waterworks_connected = 1},
paramtype = "light",
drawtype = "nodebox",

18
mods/sfinv/README.txt Normal file
View File

@ -0,0 +1,18 @@
Minetest Game mod: sfinv
========================
See license.txt for license information.
Simple Fast Inventory.
A cleaner, simpler, solution to having an advanced inventory in Minetest.
See game_api.txt for this mod's API.
Available for use outside of MTG here:
https://forum.minetest.net/viewtopic.php?t=19765
Authors of source code
----------------------
rubenwardy (MIT)
Authors of media
----------------
paramat (CC BY-SA 3.0):
sfinv_crafting_arrow.png - derived from a texture by BlockMen (CC BY-SA 3.0)

189
mods/sfinv/api.lua Normal file
View File

@ -0,0 +1,189 @@
sfinv = {
pages = {},
pages_unordered = {},
contexts = {},
enabled = true
}
function sfinv.register_page(name, def)
assert(name, "Invalid sfinv page. Requires a name")
assert(def, "Invalid sfinv page. Requires a def[inition] table")
assert(def.get, "Invalid sfinv page. Def requires a get function.")
assert(not sfinv.pages[name], "Attempt to register already registered sfinv page " .. dump(name))
sfinv.pages[name] = def
def.name = name
table.insert(sfinv.pages_unordered, def)
end
function sfinv.override_page(name, def)
assert(name, "Invalid sfinv page override. Requires a name")
assert(def, "Invalid sfinv page override. Requires a def[inition] table")
local page = sfinv.pages[name]
assert(page, "Attempt to override sfinv page " .. dump(name) .. " which does not exist.")
for key, value in pairs(def) do
page[key] = value
end
end
function sfinv.get_nav_fs(player, context, nav, current_idx)
-- Only show tabs if there is more than one page
if #nav > 1 then
return "tabheader[0,0;sfinv_nav_tabs;" .. table.concat(nav, ",") ..
";" .. current_idx .. ";true;false]"
else
return ""
end
end
local theme_inv = [[
image[0,5.2;1,1;gui_hb_bg.png]
image[1,5.2;1,1;gui_hb_bg.png]
image[2,5.2;1,1;gui_hb_bg.png]
image[3,5.2;1,1;gui_hb_bg.png]
image[4,5.2;1,1;gui_hb_bg.png]
image[5,5.2;1,1;gui_hb_bg.png]
image[6,5.2;1,1;gui_hb_bg.png]
image[7,5.2;1,1;gui_hb_bg.png]
list[current_player;main;0,5.2;8,1;]
list[current_player;main;0,6.35;8,3;8]
]]
function sfinv.make_formspec(player, context, content, show_inv, size)
local tmp = {
size or "size[8,9.1]",
sfinv.get_nav_fs(player, context, context.nav_titles, context.nav_idx),
show_inv and theme_inv or "",
content
}
return table.concat(tmp, "")
end
function sfinv.get_homepage_name(player)
return "sfinv:crafting"
end
function sfinv.get_formspec(player, context)
-- Generate navigation tabs
local nav = {}
local nav_ids = {}
local current_idx = 1
for i, pdef in pairs(sfinv.pages_unordered) do
if not pdef.is_in_nav or pdef:is_in_nav(player, context) then
nav[#nav + 1] = pdef.title
nav_ids[#nav_ids + 1] = pdef.name
if pdef.name == context.page then
current_idx = #nav_ids
end
end
end
context.nav = nav_ids
context.nav_titles = nav
context.nav_idx = current_idx
-- Generate formspec
local page = sfinv.pages[context.page] or sfinv.pages["404"]
if page then
return page:get(player, context)
else
local old_page = context.page
local home_page = sfinv.get_homepage_name(player)
if old_page == home_page then
minetest.log("error", "[sfinv] Couldn't find " .. dump(old_page) ..
", which is also the old page")
return ""
end
context.page = home_page
assert(sfinv.pages[context.page], "[sfinv] Invalid homepage")
minetest.log("warning", "[sfinv] Couldn't find " .. dump(old_page) ..
" so switching to homepage")
return sfinv.get_formspec(player, context)
end
end
function sfinv.get_or_create_context(player)
local name = player:get_player_name()
local context = sfinv.contexts[name]
if not context then
context = {
page = sfinv.get_homepage_name(player)
}
sfinv.contexts[name] = context
end
return context
end
function sfinv.set_context(player, context)
sfinv.contexts[player:get_player_name()] = context
end
function sfinv.set_player_inventory_formspec(player, context)
local fs = sfinv.get_formspec(player,
context or sfinv.get_or_create_context(player))
player:set_inventory_formspec(fs)
end
function sfinv.set_page(player, pagename)
local context = sfinv.get_or_create_context(player)
local oldpage = sfinv.pages[context.page]
if oldpage and oldpage.on_leave then
oldpage:on_leave(player, context)
end
context.page = pagename
local page = sfinv.pages[pagename]
if page.on_enter then
page:on_enter(player, context)
end
sfinv.set_player_inventory_formspec(player, context)
end
function sfinv.get_page(player)
local context = sfinv.contexts[player:get_player_name()]
return context and context.page or sfinv.get_homepage_name(player)
end
minetest.register_on_joinplayer(function(player)
if sfinv.enabled then
sfinv.set_player_inventory_formspec(player)
end
end)
minetest.register_on_leaveplayer(function(player)
sfinv.contexts[player:get_player_name()] = nil
end)
minetest.register_on_player_receive_fields(function(player, formname, fields)
if formname ~= "" or not sfinv.enabled then
return false
end
-- Get Context
local name = player:get_player_name()
local context = sfinv.contexts[name]
if not context then
sfinv.set_player_inventory_formspec(player)
return false
end
-- Was a tab selected?
if fields.sfinv_nav_tabs and context.nav then
local tid = tonumber(fields.sfinv_nav_tabs)
if tid and tid > 0 then
local id = context.nav[tid]
local page = sfinv.pages[id]
if id and page then
sfinv.set_page(player, id)
end
end
else
-- Pass event to page
local page = sfinv.pages[context.page]
if page and page.on_player_receive_fields then
return page:on_player_receive_fields(player, context, fields)
end
end
end)

20
mods/sfinv/init.lua Normal file
View File

@ -0,0 +1,20 @@
-- sfinv/init.lua
dofile(minetest.get_modpath("sfinv") .. "/api.lua")
-- Load support for MT game translation.
local S = minetest.get_translator("sfinv")
sfinv.register_page("sfinv:crafting", {
title = S("Crafting"),
get = function(self, player, context)
return sfinv.make_formspec(player, context, [[
bgcolor[#3A41EA]
list[current_player;craft;1.75,0.5;3,3;]
list[current_player;craftpreview;5.75,1.5;1,1;]
image[4.75,1.5;1,1;sfinv_crafting_arrow.png]
listring[current_player;main]
listring[current_player;craft]
]], true)
end
})

59
mods/sfinv/license.txt Normal file
View File

@ -0,0 +1,59 @@
License of source code
----------------------
The MIT License (MIT)
Copyright (C) 2016-2018 rubenwardy <rubenwardy@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy of this
software and associated documentation files (the "Software"), to deal in the Software
without restriction, including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or
substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
For more details:
https://opensource.org/licenses/MIT
License of media
----------------
Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
Copyright (C) 2019 paramat
You are free to:
Share — copy and redistribute the material in any medium or format.
Adapt — remix, transform, and build upon the material for any purpose, even commercially.
The licensor cannot revoke these freedoms as long as you follow the license terms.
Under the following terms:
Attribution — You must give appropriate credit, provide a link to the license, and
indicate if changes were made. You may do so in any reasonable manner, but not in any way
that suggests the licensor endorses you or your use.
ShareAlike — If you remix, transform, or build upon the material, you must distribute
your contributions under the same license as the original.
No additional restrictions — You may not apply legal terms or technological measures that
legally restrict others from doing anything the license permits.
Notices:
You do not have to comply with the license for elements of the material in the public
domain or where your use is permitted by an applicable exception or limitation.
No warranties are given. The license may not give you all of the permissions necessary
for your intended use. For example, other rights such as publicity, privacy, or moral
rights may limit how you use the material.
For more details:
http://creativecommons.org/licenses/by-sa/3.0/

View File

@ -0,0 +1,2 @@
# textdomain: sfinv
Crafting=Fertigung

View File

@ -0,0 +1,2 @@
# textdomain: sfinv
Crafting=Konstruado

View File

@ -0,0 +1,2 @@
# textdomain: sfinv
Crafting=Creación

View File

@ -0,0 +1,2 @@
# textdomain: sfinv
Crafting=Artisanat

View File

@ -0,0 +1,2 @@
# textdomain: sfinv
Crafting=Kerajinan

View File

@ -0,0 +1,2 @@
# textdomain: sfinv
Crafting=Assemblaggio

View File

@ -0,0 +1,2 @@
# textdomain: sfinv
Crafting=クラフト

View File

@ -0,0 +1,2 @@
# textdomain: sfinv
Crafting=nu zbasu

View File

@ -0,0 +1,2 @@
# textdomain: sfinv
Crafting=Pertukangan

View File

@ -0,0 +1,2 @@
# textdomain: sfinv
Crafting=Konstruowanie

View File

@ -0,0 +1,2 @@
# textdomain: sfinv
Crafting=Construir

View File

@ -0,0 +1,2 @@
# textdomain: sfinv
Crafting=Крафтинг

View File

@ -0,0 +1,2 @@
# textdomain: sfinv
Crafting=Vytváranie

View File

@ -0,0 +1,2 @@
# textdomain: sfinv
Crafting=Tillverkning

View File

@ -0,0 +1,2 @@
# textdomain: sfinv
Crafting=Крафтинг

View File

@ -0,0 +1,2 @@
# textdomain: sfinv
Crafting=合成

View File

@ -0,0 +1,2 @@
# textdomain: sfinv
Crafting=合成

View File

@ -0,0 +1,2 @@
# textdomain: sfinv
Crafting=

2
mods/sfinv/mod.conf Normal file
View File

@ -0,0 +1,2 @@
name = sfinv
description = Minetest Game mod: sfinv

Binary file not shown.

After

Width:  |  Height:  |  Size: 188 B