new license and idk what

This commit is contained in:
Kimapr 2019-12-31 14:25:41 +05:00
parent e994b5aa1d
commit c5ebe9f8d3
9 changed files with 331 additions and 84 deletions

61
COPYING Normal file
View File

@ -0,0 +1,61 @@
====================================================
Code (.lua files) is provided under following terms:
-------------------------------------- (MIT License)
Copyright (C)2019 Dmitriy Tillyaev (Kimapr) <dmitriy.tillyaev@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.
==========================================================================
Media (textures/*, sounds/*, models/*) are provided under following terms:
-------------------------------------------------------------------- (CC0)
Copyright (C)2019 Dmitriy Tillyaev (Kimapr) <dmitriy.tillyaev@gmail.com>
Portions (models/nc_ctf_crystal.obj) (C)2019 Warr1024
Statement of Purpose
The laws of most jurisdictions throughout the world automatically confer exclusive Copyright and Related Rights (defined below) upon the creator and subsequent owner(s) (each and all, an "owner") of an original work of authorship and/or a database (each, a "Work").
Certain owners wish to permanently relinquish those rights to a Work for the purpose of contributing to a commons of creative, cultural and scientific works ("Commons") that the public can reliably and without fear of later claims of infringement build upon, modify, incorporate in other works, reuse and redistribute as freely as possible in any form whatsoever and for any purposes, including without limitation commercial purposes. These owners may contribute to the Commons to promote the ideal of a free culture and the further production of creative, cultural and scientific works, or to gain reputation or greater distribution for their Work in part through the use and efforts of others.
For these and/or other purposes and motivations, and without any expectation of additional consideration or compensation, the person associating CC0 with a Work (the "Affirmer"), to the extent that he or she is an owner of Copyright and Related Rights in the Work, voluntarily elects to apply CC0 to the Work and publicly distribute the Work under its terms, with knowledge of his or her Copyright and Related Rights in the Work and the meaning and intended legal effect of CC0 on those rights.
1. Copyright and Related Rights. A Work made available under CC0 may be protected by copyright and related or neighboring rights ("Copyright and Related Rights"). Copyright and Related Rights include, but are not limited to, the following:
the right to reproduce, adapt, distribute, perform, display, communicate, and translate a Work;
moral rights retained by the original author(s) and/or performer(s);
publicity and privacy rights pertaining to a person's image or likeness depicted in a Work;
rights protecting against unfair competition in regards to a Work, subject to the limitations in paragraph 4(a), below;
rights protecting the extraction, dissemination, use and reuse of data in a Work;
database rights (such as those arising under Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, and under any national implementation thereof, including any amended or successor version of such directive); and
other similar, equivalent or corresponding rights throughout the world based on applicable law or treaty, and any national implementations thereof.
2. Waiver. To the greatest extent permitted by, but not in contravention of, applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and unconditionally waives, abandons, and surrenders all of Affirmer's Copyright and Related Rights and associated claims and causes of action, whether now known or unknown (including existing as well as future claims and causes of action), in the Work (i) in all territories worldwide, (ii) for the maximum duration provided by applicable law or treaty (including future time extensions), (iii) in any current or future medium and for any number of copies, and (iv) for any purpose whatsoever, including without limitation commercial, advertising or promotional purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each member of the public at large and to the detriment of Affirmer's heirs and successors, fully intending that such Waiver shall not be subject to revocation, rescission, cancellation, termination, or any other legal or equitable action to disrupt the quiet enjoyment of the Work by the public as contemplated by Affirmer's express Statement of Purpose.
3. Public License Fallback. Should any part of the Waiver for any reason be judged legally invalid or ineffective under applicable law, then the Waiver shall be preserved to the maximum extent permitted taking into account Affirmer's express Statement of Purpose. In addition, to the extent the Waiver is so judged Affirmer hereby grants to each affected person a royalty-free, non transferable, non sublicensable, non exclusive, irrevocable and unconditional license to exercise Affirmer's Copyright and Related Rights in the Work (i) in all territories worldwide, (ii) for the maximum duration provided by applicable law or treaty (including future time extensions), (iii) in any current or future medium and for any number of copies, and (iv) for any purpose whatsoever, including without limitation commercial, advertising or promotional purposes (the "License"). The License shall be deemed effective as of the date CC0 was applied by Affirmer to the Work. Should any part of the License for any reason be judged legally invalid or ineffective under applicable law, such partial invalidity or ineffectiveness shall not invalidate the remainder of the License, and in such case Affirmer hereby affirms that he or she will not (i) exercise any of his or her remaining Copyright and Related Rights in the Work or (ii) assert any associated claims and causes of action with respect to the Work, in either case contrary to Affirmer's express Statement of Purpose.
4. Limitations and Disclaimers.
No trademark or patent rights held by Affirmer are waived, abandoned, surrendered, licensed or otherwise affected by this document.
Affirmer offers the Work as-is and makes no representations or warranties of any kind concerning the Work, express, implied, statutory or otherwise, including without limitation warranties of title, merchantability, fitness for a particular purpose, non infringement, or the absence of latent or other defects, accuracy, or the present or absence of errors, whether or not discoverable, all to the greatest extent permissible under applicable law.
Affirmer disclaims responsibility for clearing rights of other persons that may apply to the Work or any use thereof, including without limitation any person's Copyright and Related Rights in the Work. Further, Affirmer disclaims responsibility for obtaining any necessary consents, permissions or other rights required for any use of the Work.
Affirmer understands and acknowledges that Creative Commons is not a party to this document and has no duty or obligation with respect to this CC0 or use of the Work.

21
LICENSE
View File

@ -1,21 +0,0 @@
Copyright (C)2019 Dmitriy Tillyaev (Kimapr) <dmitriy.tillyaev@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.

0
README Normal file
View File

161
init.lua
View File

@ -29,6 +29,7 @@ local TELEPORT_ROOM_RADIUS = cfg.TELEPORT_ROOM_RADIUS
ctf.player_count = 0
ctf.voted_count = 0
ctf.players = {}
ctf.spectators = {}
ctf.teams = {}
ctf.started = false
ctf.starting = false
@ -42,12 +43,86 @@ local function sign(x)
return x > 0 and 1 or (x < 0 and -1 or 0)
end
local function tspawn(name,pl)
if pl.team then
local pls = {}
for k,v in pairs(ctf.teams[pl.team].players) do
if v and k ~= name then
table.insert(pls,minetest.get_player_by_name(k):get_pos())
end
end
if #pls > 0 then
ctf.spawn(name,pls[math.random(1,#pls)])
else
ctf.spawn(name,vector.add(ctf.spawnpoint,SPAWN_OFFSET))
end
else
ctf.spawn(name,vector.add(ctf.spawnpoint,SPAWN_OFFSET))
end
end
function ctf.spectate(ref)
local name = ref:get_player_name()
if ctf.players[name] then
local hadteam = false
if ctf.players[name].team and ctf.teams[ctf.players[name].team] then
ctf.teams[ctf.players[name].team].players[name] = nil
hadteam = true
end
ctf.players[name].team = nil
if ctf.players[name].voted then
ctf.voted_count = ctf.voted_count-1
end
ctf.players[name].voted = false
if ctf.starting == math.huge then
ctf.starting = -math.huge
end
ctf.spectators[name] = ctf.players[name]
ctf.players[name] = nil
ctf.explode_inv(ref)
ctf.player_count = ctf.player_count - 1
ctf.set_text(name,S"You're a spectator")
if not hadteam then
tspawn(name,ctf.spectators[name])
end
return true
end
return false
end
function ctf.unspectate(ref)
local name = ref:get_player_name()
if ctf.spectators[name] then
ctf.players[name] = ctf.spectators[name]
ctf.spectators[name] = nil
ctf.player_count = ctf.player_count + 1
ctf.explode_inv(ref)
ctf.spectators[name] = nil
if ctf.started then
ctf.dist_player(name)
ctf.set_team_text(name)
else
ctf.set_text(name,S"The game hasn't started yet".."\n"..S"/vote to end the game")
end
tspawn(name,ctf.players[name])
return true
end
return false
end
function ctf.spawn(name,pos,call)
local ref = minetest.get_player_by_name(name)
local over = ref:get_physics_override()
local pl = ctf.players[name] or ctf.spectators[name]
local over = pl.over or ref:get_physics_override()
ref:set_pos(vector.add(TELEPORT_ROOM,{x=math.random(-8,8),y=math.random(-2,2),z=math.random(-8,8)}))
local n = math.random()
if pl.transid then
minetest.chat_send_player(name,S"<TELEPORT> Cancelling previous transportation")
else
do
pl.over = over
ref:set_physics_override({
gravity = 0,
gravity = 1/16,
})
ref:set_sky(0x000000, "plain", nil, false)
local r = TELEPORT_ROOM_RADIUS
@ -64,26 +139,22 @@ function ctf.spawn(name,pos,call)
end
end
end
ref:set_pos(vector.add(TELEPORT_ROOM,{x=math.random(-8,8),y=math.random(-2,2),z=math.random(-8,8)}))
local n = math.random()
local pl = ctf.players[name]
if pl.transid then
minetest.chat_send_player(name,S"<TELEPORT> Cancelling previous transportation")
end
pl.transid = n
pos = {x=f(pos.x),y=f(pos.y),z=f(pos.z)}
call = call or function()end
local limit = SPAWNFALL_LIMIT
minetest.chat_send_player(name,S"<TELEPORT> Configuring transportation processor...")
minetest.after(10,function()
--minetest.after(0,function()
minetest.emerge_area({x=pos.x,y=pos.y-limit,z=pos.z},{x=pos.x,y=pos.y+limit,z=pos.z},function(bp,act,crem)
if crem > 0 then return end
pl = ctf.players[name]
pl = ctf.players[name] or ctf.spectators[name]
if not pl then return end
if pl.transid ~= n then
return
end
pl.transid = nil
pl.over = nil
minetest.chat_send_player(name,S"<TELEPORT> Done. Sending transport coordinates...")
ref:set_sky(0x000000, "regular")
ref:set_physics_override(over)
@ -108,7 +179,7 @@ function ctf.spawn(name,pos,call)
call(ref,apos)
end
end)
end)
--end)
end
end
@ -130,7 +201,7 @@ minetest.register_on_chat_message(function(name, message)
end)
minetest.register_chatcommand("vote",{
desc = "Vote to do things",
desc = S"Vote to do things",
func = function(name,param)
if ctf.ended then
minetest.chat_send_player(name,S"<DEMOCRACY> Nothing to vote for")
@ -159,6 +230,20 @@ minetest.register_chatcommand("vote",{
end
})
minetest.register_chatcommand("spectate",{
desc = S"Start spectating",
func = function(name,param)
ctf.spectate(minetest.get_player_by_name(name))
end
})
minetest.register_chatcommand("unspectate",{
desc = S"Stop spectating",
func = function(name,param)
ctf.unspectate(minetest.get_player_by_name(name))
end
})
include("node")
ctf.crystals(teams)
@ -253,30 +338,11 @@ minetest.register_on_joinplayer(function(ref)
offset = {x=-20,y=20},
position = {x=1,y=0},
}
ctf.players[name] = {}
ctf.players[name].hud = {stat = id}
ctf.player_count = ctf.player_count + 1
ctf.spectators[name] = {}
ctf.spectators[name].hud = {stat = id}
ctf.explode_inv(ref)
minetest.after(1,function()
if ctf.started then
ctf.dist_player(name)
ctf.set_team_text(name)
local pls = {}
for k,v in pairs(ctf.teams[ctf.players[name].team].players) do
if v and k ~= name then
table.insert(pls,minetest.get_player_by_name(k):get_pos())
end
end
if #pls > 0 then
ctf.spawn(name,pls[math.random(1,#pls)])
else
ctf.spawn(name,vector.add(ctf.spawnpoint,SPAWN_OFFSET))
end
else
ctf.spawn(name,vector.add(ctf.spawnpoint,SPAWN_OFFSET))
end
end)
ctf.unspectate(ref)
end)
function ctf.explode_inv(ref)
@ -292,7 +358,7 @@ function ctf.explode_inv(ref)
end
function ctf.set_text(name,text,colornum)
local pl = ctf.players[name]
local pl = ctf.players[name] or ctf.spectators[name]
if pl and pl.hud then
local ref = minetest.get_player_by_name(name)
ref:hud_change(pl.hud.stat,"text",text)
@ -302,18 +368,8 @@ end
minetest.register_on_leaveplayer(function(ref)
local name = ref:get_player_name()
if ctf.players[name].team and ctf.teams[ctf.players[name].team] then
ctf.teams[ctf.players[name].team].players[name] = nil
end
if ctf.players[name].voted then
ctf.voted_count = ctf.voted_count-1
end
if ctf.starting == math.huge then
ctf.starting = -math.huge
end
ctf.players[name] = nil
ctf.explode_inv(ref)
ctf.player_count = ctf.player_count - 1
ctf.spectate(ref)
ctf.spectators[name] = nil
end)
function ur(n)
@ -504,6 +560,16 @@ do
end
end
end
for name,pl in pairs(ctf.spectators) do
if not minetest.check_player_privs(name,{server = true}) then
ctf.explode_inv(minetest.get_player_by_name(name))
local privs = minetest.get_player_privs(name)
privs.fast = true
privs.fly = true
privs.interact = nil
minetest.set_player_privs(name,privs)
end
end
if ctf.started and not ctf.ended then
ctf.check_win()
end
@ -554,6 +620,9 @@ function ctf.check_win()
ctf.explode_inv(minetest.get_player_by_name(k))
ctf.spawn(k,vector.add(ctf.spawnpoint,SPAWN_OFFSET))
end
for k,v in pairs(ctf.spectators) do
ctf.spawn(k,vector.add(ctf.spawnpoint,SPAWN_OFFSET))
end
minetest.after(5,function()
minetest.chat_send_all(S"<INFO> The game is over")
ctf.started = false

View File

@ -34,3 +34,6 @@ Water=Water
Air=Air
Magic=Magic
Sun=Sun
Start spectating=Start spectating
Stop spectating=Stop spectating
You're a spectator=You're a spectator

View File

@ -34,3 +34,6 @@ Water=Воды
Sky=Небя
Magic=Магии
Sun=Солнца
Start spectating=Начать наблюдать
Stop spectating=Прекратить наблюдать
You're a spectator=Вы наблюдатель

42
models/nc_ctf_crystal.mtl Normal file
View File

@ -0,0 +1,42 @@
# Blender MTL File: 'crystal.blend'
# Material Count: 4
newmtl bottom
Ns 225.000000
Ka 1.000000 1.000000 1.000000
Kd 1.000000 0.705656 0.000000
Ks 0.500000 0.500000 0.500000
Ke 0.0 0.0 0.0
Ni 1.000000
d 1.000000
illum 2
newmtl even
Ns 225.000000
Ka 1.000000 1.000000 1.000000
Kd 0.067403 1.000000 0.000000
Ks 0.500000 0.500000 0.500000
Ke 0.0 0.0 0.0
Ni 1.000000
d 1.000000
illum 2
newmtl odd
Ns 225.000000
Ka 1.000000 1.000000 1.000000
Kd 1.000000 0.000000 0.770662
Ks 0.500000 0.500000 0.500000
Ke 0.0 0.0 0.0
Ni 1.000000
d 1.000000
illum 2
newmtl top
Ns 225.000000
Ka 1.000000 1.000000 1.000000
Kd 0.000000 0.002425 1.000000
Ks 0.500000 0.500000 0.500000
Ke 0.0 0.0 0.0
Ni 1.000000
d 1.000000
illum 2

84
models/nc_ctf_crystal.obj Normal file
View File

@ -0,0 +1,84 @@
# Blender v2.80 (sub 75) OBJ File: 'crystal.blend'
# www.blender.org
mtllib nc_ctf_crystal.mtl
o Cube
v 0.268630 0.300528 -0.000000
v 0.135467 0.110351 0.232164
v 0.007324 -0.493753 0.000000
v 0.135467 0.110351 -0.232164
v -0.007324 0.493753 0.000000
v -0.135467 -0.110351 0.232164
v -0.273651 0.113399 -0.000000
v -0.140488 0.303576 -0.232164
v 0.273651 -0.113399 -0.000000
v 0.140488 -0.303576 0.232164
v 0.140488 -0.303576 -0.232164
v -0.140488 0.303576 0.232164
v -0.135467 -0.110351 -0.232164
v -0.268630 -0.300528 0.000000
vt 1.000000 1.000000
vt -0.000000 1.000000
vt 0.000000 0.000000
vt 1.000000 -0.000000
vt 1.000000 0.000000
vt 0.000000 0.937500
vt -0.000000 -0.000000
vt -0.000000 1.000000
vt 0.000000 0.000000
vt 1.000000 0.000000
vt 0.000000 0.000000
vt 1.000000 0.000000
vt 1.000000 1.000000
vt -0.000000 1.000000
vt 0.000000 1.000000
vt 0.000000 0.000000
vt 1.000000 0.000000
vt -0.000000 1.000000
vt 0.000000 0.000000
vt 1.000000 -0.000000
vt 1.000000 0.000000
vt 1.000000 1.000000
vt 0.000000 1.000000
vt 0.000000 0.000000
vt 0.000000 -0.000000
vt 1.000000 0.000000
vt 1.000000 1.000000
vt -0.000000 1.000000
vt -0.000000 1.000000
vt 0.000000 0.000000
vt 1.000000 -0.000000
vt 1.000000 1.000000
vt 1.000000 1.000000
vt 0.000000 1.000000
vt 1.000000 1.000000
vt -0.000000 -0.062500
vt 1.000000 1.000000
vn -0.8192 0.5736 0.0000
vn 0.4056 0.5792 0.7071
vn 0.4056 0.5792 -0.7071
vn 0.8192 -0.5736 -0.0000
vn -0.4056 -0.5792 0.7071
vn -0.4056 -0.5792 -0.7071
vn -0.0000 -0.0000 -1.0000
vn 0.8637 0.0105 0.5040
vn -0.8637 -0.0105 0.5040
vn 0.8637 0.0105 -0.5040
vn 0.0000 0.0000 1.0000
vn -0.8637 -0.0105 -0.5040
usemtl top
s off
f 5/1/1 8/2/1 7/3/1 12/4/1
f 1/5/2 5/1/2 12/6/2 2/7/2
f 5/1/3 1/8/3 4/9/3 8/10/3
usemtl bottom
f 9/11/4 10/12/4 3/13/4 11/14/4
f 10/15/5 6/16/5 14/17/5 3/13/5
f 3/13/6 14/18/6 13/19/6 11/20/6
usemtl odd
f 13/21/7 8/22/7 4/23/7 11/24/7
f 10/25/8 9/26/8 1/27/8 2/28/8
f 7/29/9 14/30/9 6/31/9 12/32/9
usemtl even
f 11/20/10 4/33/10 1/8/10 9/11/10
f 12/34/11 6/16/11 10/12/11 2/35/11
f 8/2/12 13/36/12 14/17/12 7/37/12

View File

@ -11,8 +11,14 @@ local function reg(name,color)
paramtype = "light",
sunlight_propagates = true,
light_source = 14,
mesh = "mese_crystal_ore4.obj",
mesh = "nc_ctf_crystal.obj",
groups = {crystal = 1,cracky=4,falling_node = 1},
selection_box = {
type = "fixed",
fixed = {
{-0.3,-0.5,-0.3, 0.3,0.5,0.3},
}
},
tiles = {
{name = "(nc_ctf_crystal_base.png^[multiply:"..color..")^nc_ctf_crystal_shine.png",
animation={