mirror of
https://bitbucket.org/kingarthursteam/cannons.git
synced 2024-10-05 17:33:06 +02:00
Move cannons config to minetest.conf
Warning: Please update the config, if you dont want griefer!
This commit is contained in:
parent
1836df7205
commit
0232bd25f3
@ -37,7 +37,7 @@ local exploding={
|
|||||||
end,
|
end,
|
||||||
|
|
||||||
}
|
}
|
||||||
if cannons.config:get_bool("enable_explosion") then
|
if minetest.settings:get_bool("cannons_enable_explosion") then
|
||||||
cannons.register_muni("cannons:ball_exploding_stack_1",exploding)
|
cannons.register_muni("cannons:ball_exploding_stack_1",exploding)
|
||||||
end
|
end
|
||||||
local fire={
|
local fire={
|
||||||
@ -73,7 +73,7 @@ local fire={
|
|||||||
end,
|
end,
|
||||||
|
|
||||||
}
|
}
|
||||||
if cannons.config:get_bool("enable_fire") then
|
if minetest.settings:get_bool("cannons_enable_fire") then
|
||||||
cannons.register_muni("cannons:ball_fire_stack_1",fire)
|
cannons.register_muni("cannons:ball_fire_stack_1",fire)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
27
init.lua
27
init.lua
@ -1,40 +1,19 @@
|
|||||||
cannons = {}
|
cannons = {}
|
||||||
cannons.MODPATH = minetest.get_modpath(minetest.get_current_modname())
|
cannons.MODPATH = minetest.get_modpath(minetest.get_current_modname())
|
||||||
local worldpath = minetest.get_worldpath()
|
|
||||||
cannons.config = Settings(worldpath.."/cannons.conf")
|
|
||||||
|
|
||||||
local conf_table = cannons.config:to_table()
|
|
||||||
|
|
||||||
--look into readme.txt how to change settings
|
|
||||||
local defaults = {
|
|
||||||
enable_explosion = "true",
|
|
||||||
enable_fire = "true",
|
|
||||||
convert_old_nodes = "false",
|
|
||||||
}
|
|
||||||
|
|
||||||
for k, v in pairs(defaults) do
|
|
||||||
if conf_table[k] == nil then
|
|
||||||
cannons.config:set(k, v)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
dofile(cannons.MODPATH .."/functions.lua")
|
dofile(cannons.MODPATH .."/functions.lua")
|
||||||
dofile(cannons.MODPATH .."/items.lua")
|
dofile(cannons.MODPATH .."/items.lua")
|
||||||
dofile(cannons.MODPATH .."/cannonballs.lua")
|
dofile(cannons.MODPATH .."/cannonballs.lua")
|
||||||
|
|
||||||
if cannons.config:get_bool("convert_old_nodes") then
|
|
||||||
dofile(cannons.MODPATH .."/convert.lua")
|
|
||||||
end
|
|
||||||
|
|
||||||
if minetest.get_modpath("tnt") then
|
if minetest.get_modpath("tnt") then
|
||||||
minetest.log("info","TNT mod is aviable. registering some TNT stuff")
|
minetest.log("info","TNT mod is aviable. registering some TNT stuff")
|
||||||
dofile(cannons.MODPATH .."/tnt.lua")
|
dofile(cannons.MODPATH .."/tnt.lua")
|
||||||
end
|
end
|
||||||
|
|
||||||
if minetest.get_modpath("locks") then
|
--if minetest.get_modpath("locks") then
|
||||||
minetest.log("warning","locks mod enabled. dont execute locks.lua because this is an unstable beta version!")
|
-- minetest.log("warning","locks mod enabled. dont execute locks.lua because this is an unstable beta version!")
|
||||||
--dofile(cannons.MODPATH .."/locks.lua")--if the locks mod is installed execute this file
|
--dofile(cannons.MODPATH .."/locks.lua")--if the locks mod is installed execute this file
|
||||||
end
|
--end
|
||||||
if minetest.get_modpath("moreores") then
|
if minetest.get_modpath("moreores") then
|
||||||
minetest.log("info","moreores mod enabled. execute moreores.lua")
|
minetest.log("info","moreores mod enabled. execute moreores.lua")
|
||||||
dofile(cannons.MODPATH .."/moreores.lua")--if the moreores mod is installed execute this file
|
dofile(cannons.MODPATH .."/moreores.lua")--if the moreores mod is installed execute this file
|
||||||
|
@ -117,7 +117,7 @@ minetest.register_craft({
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
if cannons.config:get_bool("enable_explosion") then
|
if minetest.settings:get_bool("cannons_enable_explosion") then
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = 'cannons:ball_exploding 2',
|
output = 'cannons:ball_exploding 2',
|
||||||
recipe = {
|
recipe = {
|
||||||
@ -128,7 +128,7 @@ minetest.register_craft({
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
if cannons.config:get_bool("enable_fire") then
|
if minetest.settings:get_bool("cannons_enable_fire") then
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = 'cannons:ball_fire 2',
|
output = 'cannons:ball_fire 2',
|
||||||
recipe = {
|
recipe = {
|
||||||
@ -372,7 +372,7 @@ cannons.generate_and_register_ball_node("cannons:ball_steel", {
|
|||||||
})
|
})
|
||||||
|
|
||||||
--explosion cannon ball
|
--explosion cannon ball
|
||||||
if cannons.config:get_bool("enable_explosion") then
|
if minetest.settings:get_bool("cannons_enable_explosion") then
|
||||||
cannons.generate_and_register_ball_node("cannons:ball_exploding", {
|
cannons.generate_and_register_ball_node("cannons:ball_exploding", {
|
||||||
description = "Exploding Cannon Ball",
|
description = "Exploding Cannon Ball",
|
||||||
stack_max = 99,
|
stack_max = 99,
|
||||||
@ -386,7 +386,7 @@ cannons.generate_and_register_ball_node("cannons:ball_exploding", {
|
|||||||
end
|
end
|
||||||
|
|
||||||
--fire cannon ball
|
--fire cannon ball
|
||||||
if cannons.config:get_bool("enable_fire") then
|
if minetest.settings:get_bool("cannons_enable_fire") then
|
||||||
cannons.generate_and_register_ball_node("cannons:ball_fire", {
|
cannons.generate_and_register_ball_node("cannons:ball_fire", {
|
||||||
description = "Burning Cannon Ball",
|
description = "Burning Cannon Ball",
|
||||||
stack_max = 99,
|
stack_max = 99,
|
||||||
|
6
mod.conf
Normal file
6
mod.conf
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
name = cannons
|
||||||
|
title = Cannons
|
||||||
|
description = Adds cannons to the game. To shoot insert muni and gunpowder and punch the cannon with a torch. The muni can destroy nodes and hurts players.
|
||||||
|
depends = default, bucket
|
||||||
|
optional_depends = mesecons, locks, moreores, tnt, fire
|
||||||
|
min_minetest_version = 5.0
|
41
readme.md
41
readme.md
@ -1,4 +1,5 @@
|
|||||||
# Welcome to the cannons mod #
|
# Welcome to the cannons mod #
|
||||||
|
|
||||||
cannons is a mod for the game minetest written by Kingarthurs Team
|
cannons is a mod for the game minetest written by Kingarthurs Team
|
||||||
(Semmett9, eythen, and addi)
|
(Semmett9, eythen, and addi)
|
||||||
|
|
||||||
@ -9,43 +10,34 @@ the cannonball will damage the other players.
|
|||||||
if it wears armor the damage will be calculated.
|
if it wears armor the damage will be calculated.
|
||||||
|
|
||||||
## configure cannons ##
|
## configure cannons ##
|
||||||
create a file caled cannons.conf in your world dir.
|
|
||||||
|
|
||||||
add the folowing lines to it:
|
change the settings in your minetest.conf:
|
||||||
|
|
||||||
|
```conf
|
||||||
|
cannons_enable_explosion = "true"
|
||||||
|
cannons_enable_fire = "true"
|
||||||
```
|
```
|
||||||
#!conf
|
|
||||||
|
|
||||||
|
|
||||||
enable_explosion = "true"
|
|
||||||
enable_fire = "true"
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
now you can change it. eg. if you want to disable fire then cange
|
|
||||||
*enable_fire = "true"*
|
|
||||||
to
|
|
||||||
*enable_fire = "false"*
|
|
||||||
|
|
||||||
thats all :-)
|
thats all :-)
|
||||||
|
|
||||||
## Dependencies
|
## Dependencies ##
|
||||||
|
|
||||||
* default
|
* default
|
||||||
* bucket
|
* bucket
|
||||||
* fire(optional)
|
* fire(optional)
|
||||||
|
|
||||||
## get cannons
|
## get cannons ##
|
||||||
|
|
||||||
relases are in the [donwloads Tab](https://bitbucket.org/kingarthursteam/cannons/downloads#tag-downloads)
|
relases are in the [donwloads Tab](https://bitbucket.org/kingarthursteam/cannons/downloads#tag-downloads)
|
||||||
swith there to tab 'Tags'
|
swith there to tab 'Tags'
|
||||||
|
|
||||||
its also aviable as a git repo:
|
its also aviable as a git repo:
|
||||||
|
|
||||||
```
|
```bash
|
||||||
$ git clone https://kingarthursteam@bitbucket.org/kingarthursteam/canons.git
|
git clone https://kingarthursteam@bitbucket.org/kingarthursteam/canons.git
|
||||||
```
|
```
|
||||||
|
|
||||||
## Craft Rezieps
|
## Craft Rezieps ##
|
||||||
|
|
||||||
Bucket with salt:
|
Bucket with salt:
|
||||||
|
|
||||||
@ -70,15 +62,15 @@ Stone Stand:
|
|||||||
|
|
||||||
![stone stand](https://bitbucket.org/kingarthursteam/cannons/wiki/crafts/stone_stand.png)
|
![stone stand](https://bitbucket.org/kingarthursteam/cannons/wiki/crafts/stone_stand.png)
|
||||||
|
|
||||||
## Screenshots
|
## Screenshots ##
|
||||||
|
|
||||||
![Cannon Tower](https://bitbucket.org/kingarthursteam/cannons/wiki/screenshots/screenshot_1531516.png)
|
![Cannon Tower](https://bitbucket.org/kingarthursteam/cannons/wiki/screenshots/screenshot_1531516.png)
|
||||||
![Cannon Tower 2](https://bitbucket.org/kingarthursteam/cannons/wiki/screenshots/screenshot_1849086.png)
|
![Cannon Tower 2](https://bitbucket.org/kingarthursteam/cannons/wiki/screenshots/screenshot_1849086.png)
|
||||||
![Cannon Tower 3](https://bitbucket.org/kingarthursteam/cannons/wiki/screenshots/screenshot_5781410.png)
|
![Cannon Tower 3](https://bitbucket.org/kingarthursteam/cannons/wiki/screenshots/screenshot_5781410.png)
|
||||||
|
|
||||||
## Create your own Cannonball!
|
## Create your own Cannonball ##
|
||||||
|
|
||||||
```
|
```lua
|
||||||
#!lua
|
|
||||||
|
|
||||||
local ball_wood={
|
local ball_wood={
|
||||||
physical = false,
|
physical = false,
|
||||||
@ -128,7 +120,4 @@ local ball_wood={
|
|||||||
cannons.register_muni("cannons:ball_wood",ball_wood)
|
cannons.register_muni("cannons:ball_wood",ball_wood)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Have fun!
|
Have fun!
|
5
settingtypes.txt
Normal file
5
settingtypes.txt
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# enables en exploding Cannonball
|
||||||
|
cannons_enable_explosion (Enable explotion) bool true
|
||||||
|
|
||||||
|
# enables an burning Cannonball
|
||||||
|
cannons_enable_fire (Enable Fire) bool true
|
Loading…
Reference in New Issue
Block a user