Replace double-quoted strings with single-quoted

This commit is contained in:
AntumDeluge 2017-05-27 17:26:10 -07:00
parent 83c26a3a41
commit e8a37511ea
3 changed files with 55 additions and 55 deletions

@ -1,7 +1,7 @@
sneaker = {}
dofile(minetest.get_modpath("sneaker").."/tnt_function.lua")
dofile(minetest.get_modpath("sneaker").."/spawn.lua")
dofile(minetest.get_modpath('sneaker')..'/tnt_function.lua')
dofile(minetest.get_modpath('sneaker')..'/spawn.lua')
local function jump(self,pos,direction)
local velocity = self.object:getvelocity()
@ -23,7 +23,7 @@ local function jump(self,pos,direction)
end
if def and def.walkable
and def2 and not def2.walkable
and def.drawtype ~= "fencelike" then
and def.drawtype ~= 'fencelike' then
self.object:setvelocity({
x=velocity.x*2.2,
y=self.jump_height,
@ -36,11 +36,11 @@ local function random_turn(self)
if self.turn_timer > math.random(2,5) then
local select_turn = math.random(1,3)
if select_turn == 1 then
self.turn = "left"
self.turn = 'left'
elseif select_turn == 2 then
self.turn = "right"
self.turn = 'right'
elseif select_turn == 3 then
self.turn = "straight"
self.turn = 'straight'
end
self.turn_timer = 0
self.turn_speed = 0.05*math.random()
@ -51,9 +51,9 @@ local def = {
hp_max = 20,
physical = true,
collisionbox = {-0.25,-0.7,-0.25, 0.25,0.8,0.25},
visual = "mesh",
mesh = "character.b3d",
textures = {"sneaker.png"},
visual = 'mesh',
mesh = 'character.b3d',
textures = {'sneaker.png'},
makes_footstep_sound = false,
-- Original
@ -83,15 +83,15 @@ def.on_activate = function(self,staticdata)
self.old_y = self.object:getpos().y
local data = minetest.deserialize(staticdata)
if data and type(data) == "table" then
if data and type(data) == 'table' then
if data.powered == true then
self.powered = true
self.object:set_properties({textures = {"sneaker_powered.png"}})
self.object:set_properties({textures = {'sneaker_powered.png'}})
end
else
if math.random(0,20) == 20 then
self.powered = true
self.object:set_properties({textures = {"sneaker_powered.png"}})
self.object:set_properties({textures = {'sneaker_powered.png'}})
end
end
end
@ -119,24 +119,24 @@ def.on_step = function(self, dtime)
if not self.chase
and self.timer > math.random(2,5) then
if math.random() > 0.8 then
self.state = "stand"
self.state = 'stand'
else
self.state = "walk"
self.state = 'walk'
end
self.timer = 0
end
if self.turn == "right" then
if self.turn == 'right' then
self.yaw = self.yaw+self.turn_speed
self.object:setyaw(self.yaw)
elseif self.turn == "left" then
elseif self.turn == 'left' then
self.yaw = self.yaw-self.turn_speed
self.object:setyaw(self.yaw)
end
if self.chase and self.visualx < 2 then
if self.hiss == false then
minetest.sound_play("sneaker_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
self.visualx = self.visualx+0.05
self.object:set_properties({
@ -155,11 +155,11 @@ def.on_step = function(self, dtime)
for _,object in ipairs(inside) do
if object:is_player() then
self.state = "chase"
self.state = 'chase'
end
end
if self.state == "stand" then
if self.state == 'stand' then
if self.anim ~= ANIM_STAND then
self.object:set_animation({x=animation.stand_START,y=animation.stand_END},anim_speed,0)
self.anim = ANIM_STAND
@ -173,7 +173,7 @@ def.on_step = function(self, dtime)
end
end
if self.state == "walk" then
if self.state == 'walk' then
if self.anim ~= ANIM_WALK then
self.object:set_animation({x=animation.walk_START,y=animation.walk_END},anim_speed,0)
self.anim = ANIM_WALK
@ -195,9 +195,9 @@ def.on_step = function(self, dtime)
or minetest.registered_nodes[minetest.get_node(npos).name].walkable then
local select_turn = math.random(1,2)
if select_turn == 1 then
self.turn = "left"
self.turn = 'left'
elseif select_turn == 2 then
self.turn = "right"
self.turn = 'right'
end
self.turn_timer = 0
self.turn_speed = 0.05*math.random()
@ -210,13 +210,13 @@ def.on_step = function(self, dtime)
end
end
if self.state == "chase" then
if self.state == 'chase' then
if self.anim ~= ANIM_WALK then
self.object:set_animation({x=animation.walk_START,y=animation.walk_END},anim_speed,0)
self.anim = ANIM_WALK
end
self.turn = "straight"
self.turn = 'straight'
local inside_2 = minetest.get_objects_inside_radius(pos,2)
@ -228,7 +228,7 @@ def.on_step = function(self, dtime)
if self.visualx >= 2 then
self.object:remove()
sneaker.boom(pos,self.powered)
minetest.sound_play("sneaker_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
@ -271,13 +271,13 @@ def.on_step = function(self, dtime)
end
end
else
self.state = "stand"
self.state = 'stand'
end
end
-- Swim
local node = minetest.get_node(pos)
if minetest.get_item_group(node.name,"water") ~= 0 then
if minetest.get_item_group(node.name,'water') ~= 0 then
self.object:setacceleration({x=0,y=1,z=0})
local velocity = self.object:getvelocity()
if self.object:getvelocity().y > 5 then
@ -305,10 +305,10 @@ def.on_punch = function(self,puncher,time_from_last_punch,tool_capabilities,dir)
local z = 1/math.random(1,5)*dir.z
local p = {x=pos.x+x,y=pos.y,z=pos.z+z}
local node = minetest.get_node_or_nil(p)
if node == nil or not node.name or node.name ~= "air" then
if node == nil or not node.name or node.name ~= 'air' then
p = pos
end
local obj = minetest.add_item(p, {name="tnt:gunpowder",count=math.random(0,2)})
local obj = minetest.add_item(p, {name='tnt:gunpowder',count=math.random(0,2)})
end
end
@ -318,19 +318,19 @@ def.get_staticdata = function(self)
})
end
minetest.register_entity("sneaker:sneaker",def)
minetest.register_entity('sneaker:sneaker',def)
if minetest.get_modpath('spawneggs') and minetest.get_modpath('tnt') then
minetest.register_craftitem("sneaker:spawnegg",{
description = "Sneaker Spawn Egg",
inventory_image = "sneaker_spawnegg.png",
minetest.register_craftitem('sneaker:spawnegg',{
description = 'Sneaker Spawn Egg',
inventory_image = 'sneaker_spawnegg.png',
stack_max = 64,
on_place = function(itemstack,placer,pointed_thing)
if pointed_thing.type == "node" then
if pointed_thing.type == 'node' then
local pos = pointed_thing.above
pos.y = pos.y+1
minetest.add_entity(pos,"sneaker:sneaker")
if not minetest.settings:get_bool("creative_mode") then
minetest.add_entity(pos,'sneaker:sneaker')
if not minetest.settings:get_bool('creative_mode') then
itemstack:take_item()
end
return itemstack

@ -5,8 +5,8 @@ local time_hr = time_min * 60
local time_day = time_hr * 24
minetest.register_abm({
nodenames = {"default:dirt_with_grass","default:stone"},
neighbors = {"air"},
nodenames = {'default:dirt_with_grass','default:stone'},
neighbors = {'air'},
interval = time_min * 20, -- Run spawn function every 20 minutes
chance = 9000,
action = function(pos, node, _, active_object_count_wider)
@ -26,13 +26,13 @@ minetest.register_abm({
if pos.y > 31000 then
return
end
if minetest.get_node(pos).name ~= "air" then
if minetest.get_node(pos).name ~= 'air' then
return
end
pos.y = pos.y+1
if minetest.get_node(pos).name ~= "air" then
if minetest.get_node(pos).name ~= 'air' then
return
end
minetest.add_entity(pos,"sneaker:sneaker")
minetest.add_entity(pos,'sneaker:sneaker')
end
})

@ -1,10 +1,10 @@
-- From TNT
local cid_data = {}
local radius = tonumber(minetest.settings:get("tnt_radius") or 3)
local radius = tonumber(minetest.settings:get('tnt_radius') or 3)
local large_radius = 5
local loss_prob = {
["default:cobble"] = 3,
["default:dirt"] = 4,
['default:cobble'] = 3,
['default:dirt'] = 4,
}
minetest.after(0, function()
for name, def in pairs(minetest.registered_nodes) do
@ -62,7 +62,7 @@ local function add_drop(drops, item)
end
local function destroy(drops, pos, cid)
if minetest.is_protected(pos, "") then
if minetest.is_protected(pos, '') then
return
end
local def = cid_data[cid]
@ -72,7 +72,7 @@ local function destroy(drops, pos, cid)
end
minetest.remove_node(pos)
if def then
local node_drops = minetest.get_node_drops(def.name, "")
local node_drops = minetest.get_node_drops(def.name, '')
for _, item in ipairs(node_drops) do
add_drop(drops, item)
end
@ -128,7 +128,7 @@ local function add_effects(pos, radius)
maxexptime = 3,
minsize = 8,
maxsize = 16,
texture = "sneaker_smoke.png",
texture = 'sneaker_smoke.png',
})
end
@ -146,12 +146,12 @@ local function explode(pos, radius)
local drops = {}
local p = {}
local c_air = minetest.get_content_id("air")
local c_tnt = minetest.get_content_id("tnt:tnt")
local c_tnt_burning = minetest.get_content_id("tnt:tnt_burning")
local c_gunpowder = minetest.get_content_id("tnt:gunpowder")
local c_gunpowder_burning = minetest.get_content_id("tnt:gunpowder_burning")
local c_boom = minetest.get_content_id("tnt:boom")
local c_air = minetest.get_content_id('air')
local c_tnt = minetest.get_content_id('tnt:tnt')
local c_tnt_burning = minetest.get_content_id('tnt:tnt_burning')
local c_gunpowder = minetest.get_content_id('tnt:gunpowder')
local c_gunpowder_burning = minetest.get_content_id('tnt:gunpowder_burning')
local c_boom = minetest.get_content_id('tnt:boom')
for z = -radius, radius do
for y = -radius, radius do
@ -185,8 +185,8 @@ function sneaker.boom(pos,large)
if large then
radius = large_radius
end
minetest.sound_play("sneaker_explode", {pos=pos, gain=1.5, max_hear_distance=2*64})
minetest.set_node(pos, {name="tnt:boom"})
minetest.sound_play('sneaker_explode', {pos=pos, gain=1.5, max_hear_distance=2*64})
minetest.set_node(pos, {name='tnt:boom'})
minetest.get_node_timer(pos):start(0.5)
local drops = explode(pos, radius)
entity_physics(pos, radius)