Re-label to 'sneeker'

This commit is contained in:
AntumDeluge 2017-05-27 19:54:26 -07:00
parent f50c7f37ca
commit b5c7aeb15d
14 changed files with 45 additions and 45 deletions

@ -1,4 +1,4 @@
# Sneaker mobile mod for Minetest # Sneeker mobile mod for Minetest
Adds some explosive nuisance. Adds some explosive nuisance.

@ -1,14 +1,14 @@
-- Functions for sneaker mod -- Functions for sneeker mod
-- Displays a message in log output -- Displays a message in log output
function sneaker.log(message) function sneeker.log(message)
minetest.log('action', '[' .. sneaker.modname .. '] ' .. message) minetest.log('action', '[' .. sneeker.modname .. '] ' .. message)
end end
-- Displays a message in log output only if 'sneaker.debug' is set to 'true' -- Displays a message in log output only if 'sneeker.debug' is set to 'true'
function sneaker.log_debug(message) function sneeker.log_debug(message)
if sneaker.debug then if sneeker.debug then
sneaker.log('[DEBUG] ' .. message) sneeker.log('[DEBUG] ' .. message)
end end
end end

@ -1,21 +1,21 @@
-- Original code by Rui: WTFPL -- Original code by Rui: WTFPL
sneaker = {} sneeker = {}
sneaker.modname = minetest.get_current_modname() sneeker.modname = minetest.get_current_modname()
sneaker.modpath = minetest.get_modpath(sneaker.modname) sneeker.modpath = minetest.get_modpath(sneeker.modname)
local log_mods = minetest.setting_getbool('log_mods') local log_mods = minetest.setting_getbool('log_mods')
if log_mods then if log_mods then
minetest.log('action', 'Loading mod "' .. sneaker.modname .. '" ...') minetest.log('action', 'Loading mod "' .. sneeker.modname .. '" ...')
end end
dofile(sneaker.modpath .. '/settings.lua') dofile(sneeker.modpath .. '/settings.lua')
dofile(sneaker.modpath .. '/functions.lua') dofile(sneeker.modpath .. '/functions.lua')
if log_mods then if log_mods then
sneaker.log('Spawn cap: ' .. tostring(sneaker.spawn_cap)) sneeker.log('Spawn cap: ' .. tostring(sneeker.spawn_cap))
end end
local scripts = { local scripts = {
@ -24,7 +24,7 @@ local scripts = {
} }
for I in pairs(scripts) do for I in pairs(scripts) do
dofile(sneaker.modpath .. '/' .. scripts[I] .. '.lua') dofile(sneeker.modpath .. '/' .. scripts[I] .. '.lua')
end end
local function jump(self,pos,direction) local function jump(self,pos,direction)
@ -77,7 +77,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 = {'sneaker.png'}, textures = {'sneeker.png'},
makes_footstep_sound = false, makes_footstep_sound = false,
-- Original -- Original
@ -110,12 +110,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 = {'sneaker_powered.png'}}) self.object:set_properties({textures = {'sneeker_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 = {'sneaker_powered.png'}}) self.object:set_properties({textures = {'sneeker_powered.png'}})
end end
end end
end end
@ -160,7 +160,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('sneaker_hiss',{pos=pos,gain=1.5,max_hear_distance=2*64}) minetest.sound_play('sneeker_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({
@ -251,8 +251,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()
sneaker.boom(pos,self.powered) sneeker.boom(pos,self.powered)
minetest.sound_play('sneaker_explode',{pos=pos,gain=1.5,max_hear_distance=2*64}) minetest.sound_play('sneeker_explode',{pos=pos,gain=1.5,max_hear_distance=2*64})
end end
end end
end end
@ -342,18 +342,18 @@ def.get_staticdata = function(self)
}) })
end end
minetest.register_entity('sneaker:sneaker',def) minetest.register_entity('sneeker:sneeker',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('sneaker:spawnegg',{ minetest.register_craftitem('sneeker:spawnegg',{
description = 'Sneaker Spawn Egg', description = 'Sneeker Spawn Egg',
inventory_image = 'sneaker_spawnegg.png', inventory_image = 'sneeker_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,'sneaker:sneaker') minetest.add_entity(pos,'sneeker:sneeker')
if not minetest.setting_getbool('creative_mode') then if not minetest.setting_getbool('creative_mode') then
itemstack:take_item() itemstack:take_item()
end end
@ -363,12 +363,12 @@ if minetest.get_modpath('spawneggs') and minetest.get_modpath('tnt') then
}) })
minetest.register_craft({ minetest.register_craft({
output = 'sneaker:spawnegg', output = 'sneeker:spawnegg',
type = 'shapeless', type = 'shapeless',
recipe = { recipe = {
'spawneggs:egg', 'tnt:tnt', 'spawneggs:egg', 'tnt:tnt',
}, },
}) })
minetest.register_alias('spawneggs:sneaker', 'sneaker:spawnegg') minetest.register_alias('spawneggs:sneeker', 'sneeker:spawnegg')
end end

@ -1 +1 @@
name = sneaker name = sneeker

@ -1,5 +1,5 @@
-- Settings for sneaker mod -- Settings for sneeker mod
sneaker.debug = minetest.setting_get('sneaker_debug') or false sneeker.debug = minetest.setting_get('sneeker_debug') or false
sneaker.spawn_cap = minetest.setting_get('sneaker_spawn_cap') or 50 sneeker.spawn_cap = minetest.setting_get('sneeker_spawn_cap') or 50

@ -1,12 +1,12 @@
# Logs debug output. # Logs debug output.
sneaker_debug (Log debug output) bool false sneeker_debug (Log debug output) bool false
# Sets maximum number of spawns that can exist in world. # Sets maximum number of spawns that can exist in world.
sneaker_spawn_cap (Maximum spawns) int 50 sneeker_spawn_cap (Maximum spawns) int 50
# Sets possibility for spawn. # Sets possibility for spawn.
sneaker_spawn_chance (Spawn chance) int 18000 sneeker_spawn_chance (Spawn chance) int 18000
# Sets frequency of spawn chance. # Sets frequency of spawn chance.
# Default 1200 is equivalent to 20 minutes (60 * 40). # Default 1200 is equivalent to 20 minutes (60 * 40).
sneaker_spawn_interval (Spawn interval) int 2400 sneeker_spawn_interval (Spawn interval) int 2400

@ -5,12 +5,12 @@ local time_min = 60
local time_hr = time_min * 60 local time_hr = time_min * 60
local time_day = time_hr * 24 local time_day = time_hr * 24
local spawn_chance = minetest.setting_get('sneaker_spawn_chance') or 18000 local spawn_chance = minetest.setting_get('sneeker_spawn_chance') or 18000
local spawn_interval = minetest.setting_get('sneaker_spawn_interval') or time_min * 40 -- Default interval is 40 minutes local spawn_interval = minetest.setting_get('sneeker_spawn_interval') or time_min * 40 -- Default interval is 40 minutes
if minetest.setting_getbool('log_mods') then if minetest.setting_getbool('log_mods') then
sneaker.log('Spawn chance: ' .. tostring(spawn_chance) .. ' (1/' .. tostring(spawn_chance) .. ')') sneeker.log('Spawn chance: ' .. tostring(spawn_chance) .. ' (1/' .. tostring(spawn_chance) .. ')')
sneaker.log('Spawn interval: ' .. tostring(spawn_interval) .. ' (' .. tostring(spawn_interval/60) .. ' minutes)') sneeker.log('Spawn interval: ' .. tostring(spawn_interval) .. ' (' .. tostring(spawn_interval/60) .. ' minutes)')
end end
minetest.register_abm({ minetest.register_abm({
@ -42,6 +42,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,'sneaker:sneaker') minetest.add_entity(pos,'sneeker:sneeker')
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

@ -131,7 +131,7 @@ local function add_effects(pos, radius)
maxexptime = 3, maxexptime = 3,
minsize = 8, minsize = 8,
maxsize = 16, maxsize = 16,
texture = 'sneaker_smoke.png', texture = 'sneeker_smoke.png',
}) })
end end
@ -183,12 +183,12 @@ local function explode(pos, radius)
return drops return drops
end end
function sneaker.boom(pos,large) function sneeker.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('sneaker_explode', {pos=pos, gain=1.5, max_hear_distance=2*64}) minetest.sound_play('sneeker_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)