It's a missile, not a missle

master
ShadowNinja 2014-07-12 20:21:05 -04:00
parent 67760f82d1
commit 76cbcb5e42
11 changed files with 40 additions and 41 deletions

View File

@ -2,7 +2,7 @@ Nuke mod by ShadowNinja
=======================
Nuke is a fast explosives mod for Minetest 0.4. It adds several variands of
TNT, and a (very unpolished) missle. It is also configurable and usable on
TNT, and a (very unpolished) missile. It is also configurable and usable on
servers, due to it's optional privilege requirements.
Configuration
@ -14,8 +14,8 @@ It contains the following settings:
* `mese_radius` (24) - Explosion radius of mese TNT.
* `iron_radius` (12) - Explosion radius of iron TNT.
* `tnt_radius` (3) - Explosion radius of TNT.
* `missle_radius` (16) - Explosion radius of the missle.
* `missle_misfire_radius` (5) - The explosion radius of the missle when it
* `missile_radius` (16) - Explosion radius of the missile.
* `missile_misfire_radius` (5) - The explosion radius of the missile when it
misfires (hits something before reaching it's max altitude).
* `fancy` (true) - Boolean flag enabling fancy effects like particles.
* `unprivileged_detonation` (false) - Boolean flag for whether detonation is
@ -28,6 +28,6 @@ Licenses
* Code: LGPLv3+ by ShadowNinja.
* Sounds: Unknown
* Iron and mese TNT textures: CC-BY-SA 3.0 by sfan5
* Missle model and texture: WTFPL by Jordach
* Missile model and texture: WTFPL by Jordach
* Everything else: CC-BY-SA 4.0 by ShadowNinja

View File

@ -3,8 +3,8 @@ local worldpath = minetest.get_worldpath()
nuke.config = Settings(worldpath..DIR_DELIM.."nuke.conf")
local defaults = {
missle_radius = "16",
missle_misfire_radius = "5",
missile_radius = "16",
missile_misfire_radius = "5",
mese_radius = "24",
iron_radius = "12",
tnt_radius = "3",

View File

@ -15,5 +15,5 @@ dofile(modpath .. "entity.lua")
dofile(modpath .. "api.lua")
dofile(modpath .. "internal.lua")
dofile(modpath .. "definitions.lua")
dofile(modpath .. "missles.lua")
dofile(modpath .. "missiles.lua")

View File

@ -1,20 +1,20 @@
local radius = assert(tonumber(nuke.config:get("missle_radius")),
"missle_radius must be convertible to a number")
local misfire_radius = assert(tonumber(nuke.config:get("missle_misfire_radius")),
"missle_misfire_radius must be convertible to a number")
local radius = assert(tonumber(nuke.config:get("missile_radius")),
"missile_radius must be convertible to a number")
local misfire_radius = assert(tonumber(nuke.config:get("missile_misfire_radius")),
"missile_misfire_radius must be convertible to a number")
local function get_missle(pos)
local function get_missile(pos)
for _, o in pairs(minetest.get_objects_inside_radius(pos, 1)) do
local e = o:get_luaentity()
if e and e.name == "nuke:missle" then
if e and e.name == "nuke:missile" then
return e
end
end
end
local function launch_missle(pos, strike_pos, player_name)
local e = get_missle(pos)
local function launch_missile(pos, strike_pos, player_name)
local e = get_missile(pos)
if not e then return end
e.state = 1
e.origin = pos
@ -48,10 +48,10 @@ local function get_controller_formspec(strike_pos)
.."button_exit[2,1;2,1;fire;Fire!]"
end
minetest.register_entity("nuke:missle", {
textures = {"nuke_missle.png"},
minetest.register_entity("nuke:missile", {
textures = {"nuke_missile.png"},
visual = "mesh",
mesh = "nuke_missle.x",
mesh = "nuke_missile.x",
visual_size = {x=3, y=3, z=3},
phisical = true,
collisionbox = {-0.5, -0.5, -0.5, 0.5, 4, 0.5},
@ -73,8 +73,7 @@ minetest.register_entity("nuke:missle", {
if not vector.equals(self.object:getvelocity(), {x=0, y=0, z=0}) then
-- We are in standby but moving, probably got unloaded
-- Drop ourselves
minetest.add_item(pos, "nuke:missle")
assert(false)
minetest.add_item(pos, "nuke:missile")
end
return
elseif self.state == 1 then
@ -97,7 +96,7 @@ minetest.register_entity("nuke:missle", {
end
end,
on_punch = function(self, player)
player:get_inventory():add_item("main", "nuke:missle")
player:get_inventory():add_item("main", "nuke:missile")
end,
get_staticdata = function(self)
if self.state == 0 then
@ -112,10 +111,10 @@ minetest.register_entity("nuke:missle", {
end,
})
minetest.register_node("nuke:missle_controller", {
tiles = {"nuke_missle_controller_top.png", "nuke_missle_controller.png",
"nuke_missle_controller.png", "nuke_missle_controller.png",
"nuke_missle_controller.png", "nuke_missle_controller.png"},
minetest.register_node("nuke:missile_controller", {
tiles = {"nuke_missile_controller_top.png", "nuke_missile_controller.png",
"nuke_missile_controller.png", "nuke_missile_controller.png",
"nuke_missile_controller.png", "nuke_missile_controller.png"},
groups = {cracky=1},
paramtype = "light",
paramtype2 = "facedir",
@ -132,7 +131,7 @@ minetest.register_node("nuke:missle_controller", {
local meta = minetest.get_meta(pos)
local pos_str = minetest.pos_to_string(pos)
meta:set_string("strikepos", pos_str)
meta:set_string("infotext", "Missle controller")
meta:set_string("infotext", "Missile controller")
meta:set_string("formspec", get_controller_formspec(pos))
end,
on_receive_fields = function(pos, formname, fields, player)
@ -151,19 +150,19 @@ minetest.register_node("nuke:missle_controller", {
if fields.fire then
if not nuke:can_detonate(player_name) then
minetest.chat_send_player(player_name,
"You can't launch missles!")
"You can't launch missiles!")
return
end
local dir = minetest.facedir_to_dir(node.param2)
dir = vector.multiply(dir, 2) -- The launcher is two nodes behind us
local launcher_pos = vector.add(pos, dir)
launch_missle(launcher_pos, strike_pos, player_name)
launch_missile(launcher_pos, strike_pos, player_name)
end
end,
})
minetest.register_node("nuke:missle_launcher", {
tiles = {"nuke_missle_launcher.png"},
minetest.register_node("nuke:missile_launcher", {
tiles = {"nuke_missile_launcher.png"},
groups = {cracky=1},
paramtype = "light",
paramtype2 = "facedir",
@ -181,32 +180,32 @@ minetest.register_node("nuke:missle_launcher", {
},
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("infotext", "Missle launcher")
meta:set_string("infotext", "Missile launcher")
end,
on_rightclick = function(pos, node, clicker, itemstack)
local meta = minetest.get_meta(pos)
if get_missle(pos) then
if get_missile(pos) then
return itemstack
end
if itemstack:get_name() == "nuke:missle" then
if itemstack:get_name() == "nuke:missile" then
itemstack:take_item()
minetest.add_entity(pos, "nuke:missle")
minetest.add_entity(pos, "nuke:missile")
end
return itemstack
end,
after_dig_node = function(pos, node, meta, player)
local e = get_missle(pos)
local e = get_missile(pos)
if e then
e.object:remove()
player:get_inventory():add_item("main", "nuke:missle")
player:get_inventory():add_item("main", "nuke:missile")
end
end,
})
minetest.register_craftitem("nuke:missle", {
description = "Missle",
inventory_image = "nuke_missle_wield.png",
wield_image = "nuke_missle_wield.png",
minetest.register_craftitem("nuke:missile", {
description = "Missile",
inventory_image = "nuke_missile_wield.png",
wield_image = "nuke_missile_wield.png",
stack_max = 1,
})

View File

@ -1912,7 +1912,7 @@ Frame Root {
96.078431;
0.500000; 0.500000; 0.500000;;
0.000000; 0.000000; 0.000000;;
TextureFilename {"nuke_missle.png";}
TextureFilename {"nuke_missile.png";}
}
} // End of Cube material list
} // End of Cube mesh

View File

Before

Width:  |  Height:  |  Size: 438 B

After

Width:  |  Height:  |  Size: 438 B

View File

Before

Width:  |  Height:  |  Size: 90 B

After

Width:  |  Height:  |  Size: 90 B

View File

Before

Width:  |  Height:  |  Size: 131 B

After

Width:  |  Height:  |  Size: 131 B

View File

Before

Width:  |  Height:  |  Size: 286 B

After

Width:  |  Height:  |  Size: 286 B

View File

Before

Width:  |  Height:  |  Size: 536 B

After

Width:  |  Height:  |  Size: 536 B

View File

Before

Width:  |  Height:  |  Size: 275 B

After

Width:  |  Height:  |  Size: 275 B