Compare commits
5 Commits
38e5aa61ee
...
04546bd126
Author | SHA1 | Date |
---|---|---|
Nathaniel Freeman | 04546bd126 | |
Nathaniel Freeman | 7fc49924f3 | |
Nathaniel Freeman | 33d37a1047 | |
Nathaniel Freeman | 14786de887 | |
Nathaniel Freeman | 6e160704b4 |
|
@ -0,0 +1,50 @@
|
|||
# UwU Mod (MineClone2)
|
||||
|
||||
[![ContentDB](https://content.minetest.net/packages/Psyco/uwu/shields/downloads/)](https://content.minetest.net/packages/Psyco/uwu/)
|
||||
|
||||
|
||||
![Screenshot](screenshot.png)
|
||||
|
||||
|
||||
Original by PsycoJaker
|
||||
|
||||
Maintained by Nathaniel Freeman
|
||||
|
||||
|
||||
## Description
|
||||
|
||||
UwU mod is for [MineClone2](https://content.minetest.net/packages/Wuzzy/mineclone2/) Game, dont work with MTG
|
||||
|
||||
This mod add:
|
||||
|
||||
* uwu ore.
|
||||
* uwu tools.
|
||||
* uwu deco crystal.
|
||||
* uwu pet block, eat food and give love.
|
||||
|
||||
## Copying
|
||||
|
||||
> Copyright (C) 2020, 2021 PsycoJaker
|
||||
>
|
||||
> UwU mod 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
|
||||
> any later version.
|
||||
>
|
||||
> UwU mod 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 UwU mod. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
## Bug repport / Suggestions
|
||||
|
||||
Feel free to contribute, send MR/PR or issues.
|
||||
|
||||
[Issues](https://notabug.org/PsycoJaker/uwu/issues)
|
||||
|
||||
|
||||
![Screenshot](uwu.png)
|
41
README.org
41
README.org
|
@ -1,41 +0,0 @@
|
|||
* UwU Mod (MineClone2)
|
||||
|
||||
Original by PsycoJaker
|
||||
|
||||
Maintained by Nathaniel Freeman
|
||||
|
||||
|
||||
[[file:uwu.png]]
|
||||
|
||||
|
||||
** Description
|
||||
|
||||
UwU mod is for [[https://content.minetest.net/packages/Wuzzy/mineclone2/][MineClone2]] Game, dont work with MTG
|
||||
|
||||
This mod add:
|
||||
- uwu ore.
|
||||
- uwu tools.
|
||||
- uwu deco crystal.
|
||||
- uwu pet block, eat food and give love.
|
||||
|
||||
** Copying
|
||||
|
||||
Copyright (C) 2020, 2021 PsycoJaker
|
||||
|
||||
UwU mod 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
|
||||
any later version.
|
||||
|
||||
UwU mod 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 UwU mod. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
** Bug repport / Suggestions
|
||||
|
||||
[[https://notabug.org/PsycoJaker/uwu/issues][Issues]]
|
|
@ -0,0 +1,140 @@
|
|||
|
||||
|
||||
-- Copyright (C) 2020 2021 PsycoJaker
|
||||
|
||||
-- This file is part of UwU Mod Minetest Mod.
|
||||
|
||||
-- UwU Mod 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
|
||||
-- any later version.
|
||||
|
||||
-- UwU Mod 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 UwU Mod. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
local S = core.get_translator(core.get_current_modname())
|
||||
|
||||
uwu = {}
|
||||
|
||||
uwu.timer = math.random(30, 50)
|
||||
uwu.growhappiness = 50
|
||||
|
||||
function uwu.newpos(pos)
|
||||
-- return nearest air node pos or nil
|
||||
local up = {x=pos.x, y=pos.y+1, z=pos.z}
|
||||
local down = {x=pos.x, y=pos.y-1, z=pos.z}
|
||||
local side1 = {x=pos.x+1, y=pos.y, z=pos.z}
|
||||
local side2 = {x=pos.x-1, y=pos.y, z=pos.z}
|
||||
local side3 = {x=pos.x, y=pos.y, z=pos.z+1}
|
||||
local side4 = {x=pos.x, y=pos.y, z=pos.z-1}
|
||||
local r = math.random(1, 6)
|
||||
if r == 1 and core.get_node(side1).name == "air" then
|
||||
return side1
|
||||
elseif r == 2 and core.get_node(side2).name == "air" then
|
||||
return side2
|
||||
elseif r == 3 and core.get_node(side3).name == "air" then
|
||||
return side3
|
||||
elseif r == 4 and core.get_node(side4).name == "air" then
|
||||
return side4
|
||||
elseif r == 5 and core.get_node(up).name == "air" then
|
||||
return up
|
||||
elseif r == 6 and core.get_node(down).name == "air" then
|
||||
return down
|
||||
else
|
||||
return nil
|
||||
end
|
||||
end
|
||||
|
||||
function uwu.walk(pos)
|
||||
local oldnode = core.get_node(pos)
|
||||
local oldnodemeta = core.get_meta(pos):to_table()
|
||||
local newpos = uwu.newpos(pos)
|
||||
if newpos then
|
||||
core.set_node(newpos, oldnode)
|
||||
core.get_meta(newpos):from_table(oldnodemeta)
|
||||
core.get_node_timer(newpos):start(uwu.timer)
|
||||
core.set_node(pos, {name = "air"})
|
||||
end
|
||||
end
|
||||
|
||||
function uwu.add_happiness(pos, num, prob)
|
||||
-- if prob take happiness 1/prob times
|
||||
local meta = core.get_meta(pos)
|
||||
local happiness = meta:get_int("happiness")
|
||||
local rprob = prob or 1
|
||||
local r = math.random(1, rprob)
|
||||
if r == 1 and happiness+num >= 0 then
|
||||
meta:set_int("happiness", happiness+num)
|
||||
if happiness+num <= 0 then
|
||||
meta:set_string("infotext", S("UnU happiness: @1", happiness+num) )
|
||||
else
|
||||
meta:set_string("infotext", S("UwU happiness: @1", happiness+num) )
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function uwu.burp (pos, prob)
|
||||
local rprob = prob or 1
|
||||
local r = math.random(1, rprob)
|
||||
if r == 1 then
|
||||
core.sound_play("burp", {
|
||||
pos = pos,
|
||||
gain = 22,
|
||||
max_hear_distance = 20,
|
||||
pitch = math.random(70,110)/100
|
||||
})
|
||||
else
|
||||
core.sound_play("mcl_hunger_bite", {pos = pos, gain = 0.2})
|
||||
end
|
||||
end
|
||||
|
||||
function uwu.say_uwu(pos, prob)
|
||||
local rprob = prob or 1
|
||||
local r = math.random(1, rprob)
|
||||
local nodename = core.get_node(pos).name
|
||||
local pitch = 1
|
||||
if r == 1 then
|
||||
if nodename == "uwu:little" then pitch = 2 end
|
||||
core.sound_play("uwu", {
|
||||
pos = pos,
|
||||
gain = 5,
|
||||
pitch = pitch
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
function uwu.on_rightclick(pos, node, clicker, itemstack)
|
||||
local itemname = itemstack:get_name()
|
||||
local isfood = core.get_item_group(itemname, "food") -- int num
|
||||
local energy = core.get_item_group(itemname, "eatable") or 1
|
||||
if isfood >= 1 then
|
||||
itemstack:take_item()
|
||||
uwu.add_happiness(pos, energy)
|
||||
uwu.burp(pos, 5)
|
||||
end
|
||||
end
|
||||
|
||||
function uwu.grow(pos)
|
||||
local nodename = core.get_node(pos).name
|
||||
local newpos = uwu.newpos(pos)
|
||||
if nodename == "uwu:block" then
|
||||
if newpos then
|
||||
core.set_node(newpos, {name = "uwu:little"} )
|
||||
uwu.add_happiness(pos, 1-uwu.growhappiness)
|
||||
uwu.add_happiness(newpos, 1-uwu.growhappiness)
|
||||
core.get_node_timer(newpos):start(uwu.timer)
|
||||
uwu.say_uwu(pos)
|
||||
end
|
||||
end
|
||||
if nodename == "uwu:little" then
|
||||
core.set_node(pos, {name = "uwu:block"} )
|
||||
uwu.add_happiness(pos, 1-uwu.growhappiness)
|
||||
uwu.say_uwu(pos)
|
||||
end
|
||||
end
|
3
init.lua
3
init.lua
|
@ -23,9 +23,10 @@
|
|||
|
||||
local modpath = core.get_modpath(core.get_current_modname())
|
||||
|
||||
dofile(modpath .. "/nodes.lua")
|
||||
dofile(modpath .. "/tools.lua")
|
||||
dofile(modpath .. "/crafts.lua")
|
||||
dofile(modpath .. "/functions.lua")
|
||||
dofile(modpath .. "/nodes.lua")
|
||||
|
||||
|
||||
-- UwU Gen
|
||||
|
|
|
@ -1,13 +1,17 @@
|
|||
# textdomain: uwu
|
||||
|
||||
|
||||
### functions.lua ###
|
||||
|
||||
UnU happiness: @1=
|
||||
UwU happiness: @1=
|
||||
|
||||
### nodes.lua ###
|
||||
|
||||
UnU Pet happiness: @1=
|
||||
Little UwU Block=
|
||||
UwU Block=
|
||||
UwU Crystal=
|
||||
UwU Ore=
|
||||
UwU Pet happiness: @1=
|
||||
|
||||
### tools.lua ###
|
||||
|
||||
|
|
|
@ -1,13 +1,17 @@
|
|||
# textdomain: uwu
|
||||
|
||||
|
||||
### functions.lua ###
|
||||
|
||||
UnU happiness: @1=Felicidad de el cubito UnU: @1
|
||||
UwU happiness: @1=Felicidad de el cubito UwU: @1
|
||||
|
||||
### nodes.lua ###
|
||||
|
||||
UnU Pet happiness: @1=Felicidad de el cubito UnU: @1
|
||||
Little UwU Block=Uwito
|
||||
UwU Block=Cubito UwU
|
||||
UwU Crystal=Cristalcito UwU
|
||||
UwU Ore=Mena de UwU
|
||||
UwU Pet happiness: @1=Felicidad de el cubito UwU: @1
|
||||
|
||||
### tools.lua ###
|
||||
|
||||
|
|
140
nodes.lua
140
nodes.lua
|
@ -22,46 +22,14 @@
|
|||
|
||||
local S = core.get_translator(core.get_current_modname())
|
||||
|
||||
local uwutimer = math.random(600, 1200)
|
||||
|
||||
local function uwuwalk(pos)
|
||||
local oldnode = core.get_node(pos)
|
||||
local oldnodemeta = core.get_meta(pos):to_table()
|
||||
local up = {x=pos.x, y=pos.y+1, z=pos.z}
|
||||
local down = {x=pos.x, y=pos.y-1, z=pos.z}
|
||||
local side1 = {x=pos.x+1, y=pos.y, z=pos.z}
|
||||
local side2 = {x=pos.x-1, y=pos.y, z=pos.z}
|
||||
local side3 = {x=pos.x, y=pos.y, z=pos.z+1}
|
||||
local side4 = {x=pos.x, y=pos.y, z=pos.z-1}
|
||||
local newpos
|
||||
local r = math.random(1, 6)
|
||||
if r == 1 and core.get_node(side1).name == "air" then
|
||||
newpos = side1
|
||||
elseif r == 2 and core.get_node(side2).name == "air" then
|
||||
newpos = side2
|
||||
elseif r == 3 and core.get_node(side3).name == "air" then
|
||||
newpos = side3
|
||||
elseif r == 4 and core.get_node(side4).name == "air" then
|
||||
newpos = side4
|
||||
elseif r == 5 and core.get_node(up).name == "air" then
|
||||
newpos = up
|
||||
elseif r == 6 and core.get_node(down).name == "air" then
|
||||
newpos = down
|
||||
else
|
||||
return
|
||||
end
|
||||
core.set_node(newpos, oldnode)
|
||||
core.get_meta(newpos):from_table(oldnodemeta)
|
||||
core.get_node_timer(newpos):start(uwutimer)
|
||||
core.set_node(pos, {name = "air"})
|
||||
end
|
||||
|
||||
|
||||
-- UwU Bloque
|
||||
-- UwU Block
|
||||
core.register_node("uwu:block", {
|
||||
description = S("UwU Block"),
|
||||
tiles = {"uwu_yellow.png", "uwu_yellow.png", "uwu_yellow.png^uwu_face.png"},
|
||||
inventory_image = "uwu_yellow.png^uwu_face.png",
|
||||
is_ground_content = false,
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
stack_max = 64,
|
||||
groups = {pickaxey=1, handy=1, uwu=1, building_block=1},
|
||||
|
@ -70,56 +38,82 @@ core.register_node("uwu:block", {
|
|||
_mcl_hardness = 0.3,
|
||||
|
||||
after_place_node = function(pos, placer, itemstack, pointed_thing)
|
||||
local meta = core.get_meta(pos)
|
||||
meta:set_int("happiness", 1)
|
||||
meta:set_string("infotext", S("UwU Pet happiness: @1", 1) )
|
||||
core.get_node_timer(pos):start(uwutimer)
|
||||
uwu.add_happiness(pos, 1)
|
||||
core.get_node_timer(pos):start(uwu.timer)
|
||||
end,
|
||||
|
||||
on_rightclick = function(pos, node, clicker, itemstack)
|
||||
local wielditem = clicker:get_wielded_item()
|
||||
local itemname = wielditem:get_name()
|
||||
local isfood = core.get_item_group(itemname, "food") -- int num
|
||||
local energy = core.get_item_group(itemname, "eatable") or 1
|
||||
local meta = core.get_meta(pos)
|
||||
local happiness = meta:get_int("happiness") -- if nil "get_int()" convert in 0 Magic!
|
||||
local pitch
|
||||
if happiness <= 0 then pitch = -1/happiness end
|
||||
if isfood == 2 then
|
||||
itemstack:take_item()
|
||||
meta:set_int("happiness", happiness+energy)
|
||||
core.sound_play("burp", {
|
||||
pos = pos,
|
||||
gain = 22,
|
||||
max_hear_distance = 20,
|
||||
pitch = math.random(70,110)/100
|
||||
})
|
||||
meta:set_string("infotext", S("UwU Pet happiness: @1", happiness+energy) )
|
||||
return
|
||||
end
|
||||
core.sound_play("uwu", {
|
||||
pos = pos,
|
||||
gain = 15,
|
||||
max_hear_distance = 20,
|
||||
pitch = pitch
|
||||
})
|
||||
uwu.on_rightclick(pos, node, clicker, itemstack)
|
||||
end,
|
||||
|
||||
on_timer = function(pos, elapsed)
|
||||
local meta = core.get_meta(pos)
|
||||
local happiness = meta:get_int("happiness")
|
||||
meta:set_int("happiness", happiness-1)
|
||||
core.get_node_timer(pos):start(uwutimer)
|
||||
if happiness-1 <= 0 then
|
||||
meta:set_string("infotext", S("UnU Pet happiness: @1", happiness-1) )
|
||||
if happiness >= uwu.growhappiness then
|
||||
uwu.grow(pos)
|
||||
else
|
||||
meta:set_string("infotext", S("UwU Pet happiness: @1", happiness-1) )
|
||||
uwu.add_happiness(pos, -1, 5)
|
||||
uwu.say_uwu(pos, 20)
|
||||
uwu.walk(pos)
|
||||
end
|
||||
uwuwalk(pos)
|
||||
core.get_node_timer(pos):start(uwu.timer)
|
||||
end,
|
||||
})
|
||||
|
||||
-- UwU Mena
|
||||
local lituwubox = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-4/16, -8/16, -4/16, 4/16, 0/16, 4/16}
|
||||
}
|
||||
}
|
||||
|
||||
-- Little UwU
|
||||
core.register_node("uwu:little", {
|
||||
description = S("Little UwU Block"),
|
||||
drawtype = "nodebox",
|
||||
tiles = {"uwu_yellow.png", "uwu_yellow.png", "uwu_yellow.png^uwu_little_face.png"},
|
||||
is_ground_content = false,
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
selection_box = lituwubox,
|
||||
node_box = lituwubox,
|
||||
stack_max = 64,
|
||||
groups = {pickaxey=1, handy=1, uwu=1, building_block=1},
|
||||
sounds = mcl_sounds.node_sound_glass_defaults(),
|
||||
_mcl_blast_resistance = 1,
|
||||
_mcl_hardness = 0.3,
|
||||
|
||||
after_place_node = function(pos, placer, itemstack, pointed_thing)
|
||||
uwu.add_happiness(pos, 1)
|
||||
core.get_node_timer(pos):start(uwu.timer)
|
||||
end,
|
||||
|
||||
on_rightclick = function(pos, node, clicker, itemstack)
|
||||
uwu.on_rightclick(pos, node, clicker, itemstack)
|
||||
end,
|
||||
|
||||
on_timer = function(pos, elapsed)
|
||||
local meta = core.get_meta(pos)
|
||||
local happiness = meta:get_int("happiness")
|
||||
if happiness >= uwu.growhappiness then
|
||||
uwu.grow(pos)
|
||||
else
|
||||
uwu.add_happiness(pos, -1, 5)
|
||||
uwu.say_uwu(pos, 20)
|
||||
uwu.walk(pos)
|
||||
end
|
||||
core.get_node_timer(pos):start(uwu.timer)
|
||||
end,
|
||||
|
||||
on_punch = function(pos, node, puncher, pointed_thing)
|
||||
uwu.walk(pos)
|
||||
end
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
-- UwU ore
|
||||
core.register_node("uwu:ore", {
|
||||
description = S("UwU Ore"),
|
||||
tiles = {"default_stone.png^uwu_ore.png"},
|
||||
|
@ -143,7 +137,7 @@ core.register_node("uwu:ore", {
|
|||
})
|
||||
|
||||
|
||||
-- UwU Cristalcito
|
||||
-- UwU Crystal
|
||||
core.register_node("uwu:crystal", {
|
||||
description = S("UwU Crystal"),
|
||||
drawtype = "plantlike",
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 350 KiB |
Binary file not shown.
After Width: | Height: | Size: 145 B |
Binary file not shown.
Before Width: | Height: | Size: 271 B After Width: | Height: | Size: 144 B |
BIN
uwu_bloque.png
BIN
uwu_bloque.png
Binary file not shown.
Before Width: | Height: | Size: 72 KiB |
Loading…
Reference in New Issue