Add WIP code
This commit is contained in:
commit
9bec96f2f2
0
CHANGES.txt
Normal file
0
CHANGES.txt
Normal file
21
LICENSE.txt
Normal file
21
LICENSE.txt
Normal file
@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright © 2021 Jordan Irwin (AntumDeluge)
|
||||
|
||||
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.
|
27
README.md
Normal file
27
README.md
Normal file
@ -0,0 +1,27 @@
|
||||
## Skeleton for Minetest
|
||||
|
||||
### Description:
|
||||
|
||||
A skeleton mob using the [cmer][] (Creatures Revived) API.
|
||||
|
||||
***Status:** currently not functional*
|
||||
|
||||
### Licensing:
|
||||
|
||||
- Code: [MIT](LICENSE.txt)
|
||||
|
||||
### Requirements:
|
||||
|
||||
Depends: [cmer][], [cmer_zombie][]
|
||||
|
||||
Optional depends: [asm_spawneggs][]
|
||||
|
||||
### Links:
|
||||
|
||||
- [Changelog](CHANGES.txt)
|
||||
- [TODO](TODO.txt)
|
||||
|
||||
|
||||
[cmer]: https://forum.minetest.net/viewtopic.php?t=26684
|
||||
[cmer_zombie]: https://github.com/AntumMT/mod-cmer/tree/zombie
|
||||
[asm_spawneggs]: https://content.minetest.net/packages/AntumDeluge/asm_spawneggs/
|
5
TODO.txt
Normal file
5
TODO.txt
Normal file
@ -0,0 +1,5 @@
|
||||
|
||||
TODO:
|
||||
- register skeleton entity with cmer
|
||||
- register egg with asm_spawneggs
|
||||
- add bone item
|
0
entity.lua
Normal file
0
entity.lua
Normal file
29
init.lua
Normal file
29
init.lua
Normal file
@ -0,0 +1,29 @@
|
||||
|
||||
cmer_skeleton = {}
|
||||
cmer_skeleton.modname = core.get_current.modname()
|
||||
cmer_skeleton.modpath = core.get_modpath(cmer_skeleton.modname)
|
||||
|
||||
function cmer_skeleton.log(lvl, msg)
|
||||
if not msg then
|
||||
msg = lvl
|
||||
lvl = nil
|
||||
end
|
||||
|
||||
msg = "[" .. cmer_skeleton.modname .. "] " .. msg
|
||||
|
||||
if not lvl then
|
||||
core.log(msg)
|
||||
else
|
||||
core.log(lvl, msg)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
local scripts = {
|
||||
"settings",
|
||||
"entity",
|
||||
}
|
||||
|
||||
for _, script in ipairs(scripts) do
|
||||
dofile(cmer_skeleton.modpath .. "/" .. script .. ".lua")
|
||||
end
|
6
mod.conf
Normal file
6
mod.conf
Normal file
@ -0,0 +1,6 @@
|
||||
name = cmer_skeleton
|
||||
title = Skeleton
|
||||
description = A skeleton mob using the cmer API.
|
||||
author = Jordan Irwin (AntumDeluge)
|
||||
license = MIT
|
||||
depends = cmer, cmer_zombie
|
24
settings.lua
Normal file
24
settings.lua
Normal file
@ -0,0 +1,24 @@
|
||||
|
||||
--- Entity lifespan.
|
||||
--
|
||||
-- @setting skeleton.lifetime
|
||||
-- @settype int
|
||||
-- @default 300
|
||||
cmer_skeleton.lifetime = tonumber(core.settings:get("skeleton.lifetime")) or 300
|
||||
|
||||
--- Spawn rate frequency.
|
||||
--
|
||||
--
|
||||
-- @setting skeleton.spawn_interval
|
||||
-- @settype int
|
||||
-- @default 600 (10 minutes)
|
||||
-- @see [ABM definition](http://minetest.gitlab.io/minetest/definition-tables.html#abm-activeblockmodifier-definition)
|
||||
cmer_skeleton.spawn_interval = tonumber(core.settings:get("skeleton.spawn_interval")) or 10 * 60
|
||||
|
||||
--- Chance of spawn at interval.
|
||||
--
|
||||
-- @setting skeleton.spawn_chance
|
||||
-- @settype int
|
||||
-- @default 9000
|
||||
-- @see [ABM definition](http://minetest.gitlab.io/minetest/definition-tables.html#abm-activeblockmodifier-definition)
|
||||
cmer_skeleton.spawn_chance = tonumber(core.settings:get("skeleton.spawn_chance")) or 9000
|
18
settingtypes.txt
Normal file
18
settingtypes.txt
Normal file
@ -0,0 +1,18 @@
|
||||
|
||||
# Entity lifespan.
|
||||
#
|
||||
# type: int
|
||||
# default: 300
|
||||
skeleton.lifetime (Lifespan) int 300 1
|
||||
|
||||
# Spawn interval in seconds.
|
||||
#
|
||||
# type: int
|
||||
# default: 600 (10 minutes)
|
||||
skeleton.spawn_interval (Spawn interval) int 600 1
|
||||
|
||||
# Chance of spawn at interval.
|
||||
#
|
||||
# type: int
|
||||
# default: 9000
|
||||
skeleton.spawn_chance (Spawn chance) int 9000 1
|
Loading…
x
Reference in New Issue
Block a user