Relabel to 'sneaker'
@ -1,4 +1,4 @@
|
|||||||
# creeper
|
# sneaker
|
||||||
Adds some explosive nuisance.
|
Adds some explosive nuisance.
|
||||||
|
|
||||||
## Forum Topic
|
## Forum Topic
|
||||||
|
37
init.lua
@ -1,12 +1,7 @@
|
|||||||
creeper = {}
|
sneaker = {}
|
||||||
|
|
||||||
--[[
|
dofile(minetest.get_modpath("sneaker").."/tnt_function.lua")
|
||||||
-- DISABLED!!!
|
dofile(minetest.get_modpath("sneaker").."/spawn.lua")
|
||||||
do return end
|
|
||||||
--]]
|
|
||||||
|
|
||||||
dofile(minetest.get_modpath("creeper").."/tnt_function.lua")
|
|
||||||
dofile(minetest.get_modpath("creeper").."/spawn.lua")
|
|
||||||
|
|
||||||
local function jump(self,pos,direction)
|
local function jump(self,pos,direction)
|
||||||
local velocity = self.object:getvelocity()
|
local velocity = self.object:getvelocity()
|
||||||
@ -58,7 +53,7 @@ local def = {
|
|||||||
collisionbox = {-0.25,-0.7,-0.25, 0.25,0.8,0.25},
|
collisionbox = {-0.25,-0.7,-0.25, 0.25,0.8,0.25},
|
||||||
visual = "mesh",
|
visual = "mesh",
|
||||||
mesh = "character.b3d",
|
mesh = "character.b3d",
|
||||||
textures = {"creeper.png"},
|
textures = {"sneaker.png"},
|
||||||
makes_footstep_sound = false,
|
makes_footstep_sound = false,
|
||||||
|
|
||||||
-- Original
|
-- Original
|
||||||
@ -91,12 +86,12 @@ def.on_activate = function(self,staticdata)
|
|||||||
if data and type(data) == "table" then
|
if data and type(data) == "table" then
|
||||||
if data.powered == true then
|
if data.powered == true then
|
||||||
self.powered = true
|
self.powered = true
|
||||||
self.object:set_properties({textures = {"creeper_powered.png"}})
|
self.object:set_properties({textures = {"sneaker_powered.png"}})
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if math.random(0,20) == 20 then
|
if math.random(0,20) == 20 then
|
||||||
self.powered = true
|
self.powered = true
|
||||||
self.object:set_properties({textures = {"creeper_powered.png"}})
|
self.object:set_properties({textures = {"sneaker_powered.png"}})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -141,7 +136,7 @@ def.on_step = function(self, dtime)
|
|||||||
|
|
||||||
if self.chase and self.visualx < 2 then
|
if self.chase and self.visualx < 2 then
|
||||||
if self.hiss == false then
|
if self.hiss == false then
|
||||||
minetest.sound_play("creeper_hiss",{pos=pos,gain=1.5,max_hear_distance=2*64})
|
minetest.sound_play("sneaker_hiss",{pos=pos,gain=1.5,max_hear_distance=2*64})
|
||||||
end
|
end
|
||||||
self.visualx = self.visualx+0.05
|
self.visualx = self.visualx+0.05
|
||||||
self.object:set_properties({
|
self.object:set_properties({
|
||||||
@ -232,8 +227,8 @@ def.on_step = function(self, dtime)
|
|||||||
self.chase = true
|
self.chase = true
|
||||||
if self.visualx >= 2 then
|
if self.visualx >= 2 then
|
||||||
self.object:remove()
|
self.object:remove()
|
||||||
creeper.boom(pos,self.powered)
|
sneaker.boom(pos,self.powered)
|
||||||
minetest.sound_play("creeper_explode",{pos=pos,gain=1.5,max_hear_distance=2*64})
|
minetest.sound_play("sneaker_explode",{pos=pos,gain=1.5,max_hear_distance=2*64})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -323,18 +318,18 @@ def.get_staticdata = function(self)
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
minetest.register_entity("creeper:creeper",def)
|
minetest.register_entity("sneaker:sneaker",def)
|
||||||
|
|
||||||
if minetest.get_modpath('spawneggs') and minetest.get_modpath('tnt') then
|
if minetest.get_modpath('spawneggs') and minetest.get_modpath('tnt') then
|
||||||
minetest.register_craftitem("creeper:spawnegg",{
|
minetest.register_craftitem("sneaker:spawnegg",{
|
||||||
description = "Creeper Spawn Egg",
|
description = "Sneaker Spawn Egg",
|
||||||
inventory_image = "creeper_spawnegg.png",
|
inventory_image = "sneaker_spawnegg.png",
|
||||||
stack_max = 64,
|
stack_max = 64,
|
||||||
on_place = function(itemstack,placer,pointed_thing)
|
on_place = function(itemstack,placer,pointed_thing)
|
||||||
if pointed_thing.type == "node" then
|
if pointed_thing.type == "node" then
|
||||||
local pos = pointed_thing.above
|
local pos = pointed_thing.above
|
||||||
pos.y = pos.y+1
|
pos.y = pos.y+1
|
||||||
minetest.add_entity(pos,"creeper:creeper")
|
minetest.add_entity(pos,"sneaker:sneaker")
|
||||||
if not minetest.settings:get_bool("creative_mode") then
|
if not minetest.settings:get_bool("creative_mode") then
|
||||||
itemstack:take_item()
|
itemstack:take_item()
|
||||||
end
|
end
|
||||||
@ -344,12 +339,12 @@ if minetest.get_modpath('spawneggs') and minetest.get_modpath('tnt') then
|
|||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = 'creeper:spawnegg',
|
output = 'sneaker:spawnegg',
|
||||||
type = 'shapeless',
|
type = 'shapeless',
|
||||||
recipe = {
|
recipe = {
|
||||||
'spawneggs:egg', 'tnt:tnt',
|
'spawneggs:egg', 'tnt:tnt',
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_alias('spawneggs:creeper', 'creeper:spawnegg')
|
minetest.register_alias('spawneggs:sneaker', 'sneaker:spawnegg')
|
||||||
end
|
end
|
||||||
|
1
mod.conf
Normal file
@ -0,0 +1 @@
|
|||||||
|
name = sneaker
|
@ -33,6 +33,6 @@ minetest.register_abm({
|
|||||||
if minetest.get_node(pos).name ~= "air" then
|
if minetest.get_node(pos).name ~= "air" then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
minetest.add_entity(pos,"creeper:creeper")
|
minetest.add_entity(pos,"sneaker:sneaker")
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
Before Width: | Height: | Size: 353 B After Width: | Height: | Size: 353 B |
Before Width: | Height: | Size: 355 B After Width: | Height: | Size: 355 B |
Before Width: | Height: | Size: 139 B After Width: | Height: | Size: 139 B |
Before Width: | Height: | Size: 249 B After Width: | Height: | Size: 249 B |
@ -128,7 +128,7 @@ local function add_effects(pos, radius)
|
|||||||
maxexptime = 3,
|
maxexptime = 3,
|
||||||
minsize = 8,
|
minsize = 8,
|
||||||
maxsize = 16,
|
maxsize = 16,
|
||||||
texture = "creeper_smoke.png",
|
texture = "sneaker_smoke.png",
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -180,12 +180,12 @@ local function explode(pos, radius)
|
|||||||
return drops
|
return drops
|
||||||
end
|
end
|
||||||
|
|
||||||
function creeper.boom(pos,large)
|
function sneaker.boom(pos,large)
|
||||||
local radius = radius
|
local radius = radius
|
||||||
if large then
|
if large then
|
||||||
radius = large_radius
|
radius = large_radius
|
||||||
end
|
end
|
||||||
minetest.sound_play("creeper_explode", {pos=pos, gain=1.5, max_hear_distance=2*64})
|
minetest.sound_play("sneaker_explode", {pos=pos, gain=1.5, max_hear_distance=2*64})
|
||||||
minetest.set_node(pos, {name="tnt:boom"})
|
minetest.set_node(pos, {name="tnt:boom"})
|
||||||
minetest.get_node_timer(pos):start(0.5)
|
minetest.get_node_timer(pos):start(0.5)
|
||||||
local drops = explode(pos, radius)
|
local drops = explode(pos, radius)
|
||||||
|