mirror of
https://github.com/tacigar/maidroid.git
synced 2025-01-10 08:10:17 +01:00
[ADD] Add some files, and commit before brush up APIs
This commit is contained in:
parent
5ec7455b1e
commit
e93d43f5cb
@ -57,6 +57,17 @@ function maidroid.get_core(self)
|
|||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- maidroid.register_core registers a definition of a new core.
|
||||||
|
function maidroid.register_core(core_name, def)
|
||||||
|
maidroid.registered_cores[core_name] = def
|
||||||
|
|
||||||
|
minetest.register_craftitem(core_name, {
|
||||||
|
stack_max = 1,
|
||||||
|
description = def.description,
|
||||||
|
inventory_image = def.inventory_image,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
-- maidroid.register_maidroid registers a definition of a new maidroid.
|
-- maidroid.register_maidroid registers a definition of a new maidroid.
|
||||||
function maidroid.register_maidroid(product_name, def)
|
function maidroid.register_maidroid(product_name, def)
|
||||||
|
|
||||||
@ -69,7 +80,6 @@ function maidroid.register_maidroid(product_name, def)
|
|||||||
if listname == "core" then
|
if listname == "core" then
|
||||||
local core_name = stack:get_name()
|
local core_name = stack:get_name()
|
||||||
local core = registered_cores[core_name]
|
local core = registered_cores[core_name]
|
||||||
|
|
||||||
core.initialize(self)
|
core.initialize(self)
|
||||||
self.core_name = core_name
|
self.core_name = core_name
|
||||||
end
|
end
|
||||||
@ -88,7 +98,6 @@ function maidroid.register_maidroid(product_name, def)
|
|||||||
on_take = function(inv, listname, index, stack, player)
|
on_take = function(inv, listname, index, stack, player)
|
||||||
if listname == "core" then
|
if listname == "core" then
|
||||||
local core = registered_cores[self.core_name]
|
local core = registered_cores[self.core_name]
|
||||||
|
|
||||||
self.core_name = ""
|
self.core_name = ""
|
||||||
core.finalize(self)
|
core.finalize(self)
|
||||||
end
|
end
|
||||||
|
@ -9,3 +9,4 @@ maidroid.modname = "maidroid"
|
|||||||
maidroid.modpath = maidroid.get_modpath(maidroid.modname)
|
maidroid.modpath = maidroid.get_modpath(maidroid.modname)
|
||||||
|
|
||||||
dofile(maidroid.modpath .. "/api.lua")
|
dofile(maidroid.modpath .. "/api.lua")
|
||||||
|
dofile(maidroid.modpath .. "/register.lua")
|
||||||
|
Before Width: | Height: | Size: 971 B After Width: | Height: | Size: 971 B |
BIN
maidroid/models/maidroid_mk2.png
Normal file
BIN
maidroid/models/maidroid_mk2.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1005 B |
BIN
maidroid/models/maidroid_mk3.png
Normal file
BIN
maidroid/models/maidroid_mk3.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 990 B |
25
maidroid/register.lua
Normal file
25
maidroid/register.lua
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
------------------------------------------------------------
|
||||||
|
-- Copyright (c) 2016 tacigar
|
||||||
|
-- https://github.com/tacigar/maidroid
|
||||||
|
------------------------------------------------------------
|
||||||
|
|
||||||
|
maidroid.register_maidroid("maidroid:maidroid_mk1", {
|
||||||
|
hp_max = 10,
|
||||||
|
weight = 20,
|
||||||
|
mesh = "maidroid.b3d",
|
||||||
|
textures = "maidroid_mk1.png",
|
||||||
|
})
|
||||||
|
|
||||||
|
maidroid.register_maidroid("maidroid:maidroid_mk2", {
|
||||||
|
hp_max = 10,
|
||||||
|
weight = 20,
|
||||||
|
mesh = "maidroid.b3d",
|
||||||
|
textures = "maidroid_mk2.png",
|
||||||
|
})
|
||||||
|
|
||||||
|
maidroid.register_maidroid("maidroid:maidroid_mk3", {
|
||||||
|
hp_max = 10,
|
||||||
|
weight = 20,
|
||||||
|
mesh = "maidroid.b3d",
|
||||||
|
textures = "maidroid_mk3.png",
|
||||||
|
})
|
Loading…
Reference in New Issue
Block a user