Compare commits

...

5 Commits

Author SHA1 Message Date
Jordan Irwin c2bedc3816 [creatures] Make sure that 'self.last_node' not 'nil' (#22) 2018-04-23 22:45:05 -07:00
Diogo Gomes 2814ceb050 Release version 2.3.2
## Version 2.3.2

### Changed
- Update general information

### Fixed
- Fix Minetest Bower integration
2017-04-10 21:53:00 +01:00
BlockMen e3502a1c81 Push to Version 2.3.1 2016-02-16 23:24:03 +01:00
BlockMen 4096344c6f Add colored Sheep
Sheep spawn randomly with white, grey, brown or black wool
2016-02-16 23:21:35 +01:00
BlockMen ac569c49a9 Fix Oerrki spawn time 2016-02-15 14:37:26 +01:00
15 changed files with 419 additions and 238 deletions

0
.gitignore vendored Normal file
View File

180
CHANGELOG.md Normal file
View File

@ -0,0 +1,180 @@
# Change Log
All the remarkable changes of this project will be documented in this file.
This project adhere to [Semantic Versioning](http://semver.org/).
---
## [2.3.2][2.3.2] - 2017-04-10
### Changed
- Update general information
### Fixed
- Fix Minetest Bower integration
---
## [2.3.1][2.3.1] - 2016-02-16
### Added
- Add colored sheep
### Fixed
- Fix Oerrki spawning times (spawns on night as intended)
---
## [2.3.0][2.3.0] - 2016-02-11
### Added
- Add Oerrki
- Add fried eggs
### Fixed
- Fix moveing facement being reset
- Fix chicken model
- Fix sneaky variable not working
- Fix feathers being eatable
---
## [2.2.2][2.2.2] - 2016-02-03
### Added
- Add feature: Eggs can be thrown to spawn chicken (rare)
- Add feature: Chicken drop chicken meat and feather(s) on death
### Fixed
- Fix crash caused by not existing node
- Fix spawn eggs being endless in singleplayer
- Fix searching for target if in panic mode
---
## [2.2.0][2.2.0] - 2015-11-09
### Added
- Add chicken
- Add again sheep spawner (by LNJ)
- Add descriptions to spawners
- Add option to set custom panic and swim animations
### Fixed
- Fix possible crash (reported by bbaez)
---
## [2.1.0][2.1.0] - 2015-10-25
### Added
- Re-add zombies, ghosts and sheep
- Add feature "Feed sheep 5 times with wheat to tame"
- Add death animations
- Add missing documentation of combat values
### Changed
- Change license to modified zlib-License
- Complete rewrite and rename to Creatures MOB-Engine
- Clean up code
- Zombie spawners are now generated in dungeons (if they have more than 4 rooms)
- Reduce sheep model size
- Tweak codestyle a bit
### Fixed
- Fix bug that hostile mobs did sometimes not attack
---
## [1.1.5][1.1.5] - 2015-08-14
### Added
- Add description and screenshot files
### Changed
- Use [colorize instead of textures
### Fixed
- Fix "undeclared global variable" error
- Make sounds mono (fixes loud zombies, sheep)
- Fix sheep states
---
## [1.1.4][1.1.4] - 2014-08-05
### Added
- Add feature: Sheep drop meat when killed
### Changed
- Improve jump, decrease herd radius
### Removed
- Remove double-check
### Fixed
- Fix spawning
---
## [1.1.3][1.1.3] - 2014-05-25
### Changed
- Increase sheep detection radius
### Fixed
- Fix panic of sheep
- Fix crash caused by spawn control
- Fix mobs flood
---
## [1.1.2][1.1.2] - 2014-05-10
### Added
- Add shears
- Add recipe for shears
- Add feature: sheep follows player with wheat
### Fixed
- Fix the flood of the world with items
---
## [1.1.1][1.1.1] - 2014-04-27
### Added
- Add minetest.line_of_sight()
- Add experimental spawning control
### Changed
- Cleanup code
- Max lifetime for zombies
### Fixed
- Fix crashes
---
## [1.1.0][1.1.0] - 2014-03-13
### Added
- Add sheeps
### Changed
- Restructure code
### Fixed
- Fix issues
---
## [1.0.1][1.0.1] - 2014-03-13
---
[2.3.2]: https://github.com/minetest-mods/mob-engine/compare/2.3.1...2.3.2
[2.3.1]: https://github.com/minetest-mods/mob-engine/compare/2.3.0...2.3.1
[2.3.0]: https://github.com/minetest-mods/mob-engine/compare/2.2.2...2.3.0
[2.2.2]: https://github.com/minetest-mods/mob-engine/compare/2.2.0...2.2.2
[2.2.0]: https://github.com/minetest-mods/mob-engine/compare/2.1.0...2.2.0
[2.1.0]: https://github.com/minetest-mods/mob-engine/compare/1.1.5...2.1.0
[1.1.5]: https://github.com/minetest-mods/mob-engine/compare/1.1.4...1.1.5
[1.1.4]: https://github.com/minetest-mods/mob-engine/compare/1.1.3...1.1.4
[1.1.3]: https://github.com/minetest-mods/mob-engine/compare/1.1.2...1.1.3
[1.1.2]: https://github.com/minetest-mods/mob-engine/compare/1.1.1...1.1.2
[1.1.1]: https://github.com/minetest-mods/mob-engine/compare/1.1.0...1.1.1
[1.1.0]: https://github.com/minetest-mods/mob-engine/compare/1.0.1...1.1.0
[1.0.1]: https://github.com/minetest-mods/mob-engine/commit/d5db6af4deb62ac5aa09f221361854378596e5cc

47
README.md Normal file
View File

@ -0,0 +1,47 @@
# Mob Engine
**Mob Engine** *(formely Creatures MOB-Engine)* is a mod(pack) for [Minetest](http://www.minetest.net/) that provides a mob engine and several creatures to the game.
Currently includes:
- chickens
- ghosts
- mob engine
- oerrkis
- sheep
- zombies
**Mob Engine** was started as a fork of [BlockMen](https://github.com/BlockMen)'s [Creature MOB-Engine](https://github.com/BlockMen/cme) (when the developer abandoned the project) with the purpose of maintain.
**Version:** 2.3.2 ([change log](CHANGELOG.md))
---
## Install
### Minetest Bower *(recommended)*
**Mob Engine** is on **[Minetest Bower](https://minetest-bower.herokuapp.com)** *(a mod repository and package manager for Minetest)*
You can easily install with the command:
`bower install --save mob-engine`
More information [here](https://minetest-bower.herokuapp.com/mods/mob-engine).
### Manual
You can download the [latest release](https://github.com/minetest-mods/mob-engine/releases) and extract it to your `mods` folder.
More information [here](http://wiki.minetest.net/Installing_Mods).
---
## License
**Code (if not stated differently)**
Copyright 2015-2016 BlockMen; modified zlib-License
**Media (if not stated differently)**
Copyright (2014-2016) BlockMen; CC-BY-SA 3.0
*See [license](LICENSE) for more details.*

View File

@ -1,36 +0,0 @@
Mod/Modpack Creatures
=====================
Copyright (c) 2015-2016 BlockMen <blockmen2015@gmail.com>
Version: 2.3
A Mod(pack) for Minetest that provides a MOB-Engine and adds several creatures to the game.
Currently included: Ghosts, Zombies, Sheep, Chicken and Oerrki.
License:
~~~~~~~~
Code(if not stated differently):
(c) Copyright 2015-2016 BlockMen; modified zlib-License
see "LICENSE.txt" for details.
Media(if not stated differently):
(c) Copyright (2014-2016) BlockMen; CC-BY-SA 3.0
see each MOB-Module for detailed informations.
Github:
~~~~~~~
https://github.com/BlockMen/cme
Forum:
~~~~~~
https://forum.minetest.net/viewtopic.php?id=8638
Changelog:
~~~~~~~~~~
see Changelog.txt

View File

@ -1,25 +1,30 @@
{
"name": "Creatures MOB-Engine",
"description": "A Mod(pack) for Minetest that provides a MOB-Engine and adds several creatures to the game.\n",
"keywords": [
"creatures",
"mobs",
"MOB",
"MOB-Engine",
"Creatures MOB-Engine",
"cme",
"zombies",
"sheep",
"ghost",
"monsters",
"hostile"
],
"homepage": "https://github.com/BlockMen/cme",
"forum": "http://forum.minetest.net/viewtopic.php?f=11&t=8638",
"screenshots": [
"https://raw.githubusercontent.com/BlockMen/cme/master/screenshot.png"
],
"name": "mob-engine",
"description": "Mob Engine is a mod(pack) for Minetest game that provides a mob engine and adds several mobs to the game.",
"homepage": "https://github.com/minetest-mods/mob-engine",
"authors": [
"BlockMen"
"BlockMen - author",
"BrunoMine - maintainer",
"Diogo Gomes - maintainer",
"LNJ - maintainer"
],
"license": "Zlib",
"keywords": [
"chicken",
"friendly",
"ghost",
"hostile",
"mob",
"mobs",
"mob engine",
"mob-engine",
"monsters",
"oerrki",
"sheep",
"zombie"
],
"forum": "https://forum.minetest.net/viewtopic.php?f=9&t=17106",
"screenshots": [
"https://raw.githubusercontent.com/minetest-mods/mob-engine/master/screenshot.png"
]
}

View File

@ -1,35 +0,0 @@
Version 2.1
-----------
- Added death animations
- Zombie spawners are now generated in dungeons (if they have more than 4 rooms)
- Fixed bug that hostile mobs did sometimes not attack
- Reduced sheep model size
- Tweak codestyle a bit/ added missing documentation of combat values
Version 2.2
-----------
- Added chicken
- Readded sheep spawner (by LNJ)
- Fix possible crash (reported by bbaez)
- Added descriptions to spawners
- Added option to set custom panic and swim animations
Version 2.2.1
-------------
- Fixed crash caused by not existing node
Version 2.2.2
-------------
- Eggs can be thrown to spawn chicken (rare)
- Chicken drop chicken meat and feather(s) on death
- Fixed spawn eggs being endless in singleplayer
- Fix searching for target if in panic mode
Version 2.3
-----------
- Added Oerrki
- Added fried eggs
- Fixed moveing facement being reset
- Fixed chicken model
- Fixed sneaky variable not working
- Fixed feathers being eatable

View File

@ -480,7 +480,7 @@ creatures.on_step = function(self, dtime)
local sn = core.get_node_or_nil(p)
local eat_node
for _,name in pairs(nodes) do
if name == self.last_node.name then
if self.last_node ~= nil and name == self.last_node.name then
eat_node = current_pos
break
elseif sn and sn.name == name then

View File

@ -88,7 +88,7 @@ local def = {
abm_chance = 7800,
max_number = 1,
number = {min = 1, max = 3},
time_range = {min = 5100, max = 18300},
time_range = {min = 18500, max = 5100},
light = {min = 0, max = 8},
height_limit = {min = -200, max = 50},

View File

@ -1,12 +1,13 @@
Sheep for Creatures MOB-Engine
==============================
Copyright (c) 2015 BlockMen <blockmen2015@gmail.com>
Copyright (c) 2015-2016 BlockMen <blockmen2015@gmail.com>
Version: 2.0 Beta
Version: 2.1
Adds sheep to Minetest (requires Creatures MOB-Engine).
Sheep spawn only at day-time and are friendly and remain around 5 minutes in the world.
There are four different wool colors: white, grey, brown and black.
You can tame them by feading them with wheat. If there is grass they eat the grass
and regrow wool that way. They will follow you if you have Wheat in your hand.
Sheep have 8 HP and drop 1-2 wool when punched or 1-3 wool when using shears.
@ -20,11 +21,11 @@ ingot stick
License:
~~~~~~~~
Code:
(c) Copyright 2015 BlockMen; modified zlib-License
(c) Copyright 2015-2016 BlockMen; modified zlib-License
see "LICENSE.txt" for details.
Media(textures and meshes/models):
(c) Copyright (2014-2015) BlockMen; CC-BY-SA 3.0
(c) Copyright (2014-2016) BlockMen; CC-BY-SA 3.0
Sounds:
- creatures_sheep.1.ogg, confusion_music(https://freesound.org/people/confusion_music) CC-BY 3.0

View File

@ -1,5 +1,5 @@
--= Sheep for Creatures MOB-Engine (cme) =--
-- Copyright (c) 2015 BlockMen <blockmen2015@gmail.com>
-- Copyright (c) 2015-2016 BlockMen <blockmen2015@gmail.com>
--
-- init.lua
--
@ -34,163 +34,182 @@ core.register_craft({
}
})
local function shear(self, drop_count, sound)
if self.has_wool == true then
self.has_wool = false
local pos = self.object:getpos()
if sound then
core.sound_play("creatures_shears", {pos = pos, gain = 1, max_hear_distance = 10})
end
self.object:set_properties({textures = {"creatures_sheep.png"}})
creatures.dropItems(pos, {{"wool:white", drop_count}})
end
local function setColor(self)
if self and self.object then
local ext = ".png"
if self.has_wool ~= true then
ext = ".png^(creatures_sheep_shaved.png^[colorize:" .. self.wool_color:gsub("grey", "gray") .. ":50)"
end
self.object:set_properties({textures = {"creatures_sheep.png^creatures_sheep_" .. self.wool_color .. ext}})
end
end
local function shear(self, drop_count, sound)
if self.has_wool == true then
self.has_wool = false
local pos = self.object:getpos()
if sound then
core.sound_play("creatures_shears", {pos = pos, gain = 1, max_hear_distance = 10})
end
setColor(self)
creatures.dropItems(pos, {{"wool:" .. self.wool_color, drop_count}})
end
end
-- white, grey, brown, black (see wool colors as reference)
local colors = {"white", "grey", "brown", "black"}
local def = {
name = "creatures:sheep",
stats = {
hp = 8,
lifetime = 450, -- 7,5 Minutes
can_jump = 1,
can_swim = true,
can_burn = true,
can_panic = true,
has_falldamage = true,
has_kockback = true,
},
name = "creatures:sheep",
stats = {
hp = 8,
lifetime = 450, -- 7,5 Minutes
can_jump = 1,
can_swim = true,
can_burn = true,
can_panic = true,
has_falldamage = true,
has_kockback = true,
},
model = {
mesh = "creatures_sheep.b3d",
textures = {"creatures_sheep.png^creatures_sheep_white.png"},
collisionbox = {-0.5, -0.01, -0.55, 0.5, 1.1, 0.55},
rotation = -90.0,
animations = {
idle = {start = 1, stop = 60, speed = 15},
walk = {start = 81, stop = 101, speed = 18},
walk_long = {start = 81, stop = 101, speed = 18},
eat = {start = 107, stop = 170, speed = 12, loop = false},
follow = {start = 81, stop = 101, speed = 15},
death = {start = 171, stop = 191, speed = 32, loop = false, duration = 2.52},
},
},
model = {
mesh = "creatures_sheep.b3d",
textures = {"creatures_sheep.png^creatures_sheep_white.png"},
collisionbox = {-0.5, -0.01, -0.55, 0.5, 1.1, 0.55},
rotation = -90.0,
animations = {
idle = {start = 1, stop = 60, speed = 15},
walk = {start = 81, stop = 101, speed = 18},
walk_long = {start = 81, stop = 101, speed = 18},
eat = {start = 107, stop = 170, speed = 12, loop = false},
follow = {start = 81, stop = 101, speed = 15},
death = {start = 171, stop = 191, speed = 32, loop = false, duration = 2.52},
},
},
sounds = {
on_damage = {name = "creatures_sheep", gain = 1.0, distance = 10},
on_death = {name = "creatures_sheep", gain = 1.0, distance = 10},
swim = {name = "creatures_splash", gain = 1.0, distance = 10,},
random = {
idle = {name = "creatures_sheep", gain = 0.6, distance = 10, time_min = 23},
},
},
sounds = {
on_damage = {name = "creatures_sheep", gain = 1.0, distance = 10},
on_death = {name = "creatures_sheep", gain = 1.0, distance = 10},
swim = {name = "creatures_splash", gain = 1.0, distance = 10,},
random = {
idle = {name = "creatures_sheep", gain = 0.6, distance = 10, time_min = 23},
},
},
modes = {
idle = {chance = 0.5, duration = 10, update_yaw = 8},
walk = {chance = 0.14, duration = 4.5, moving_speed = 1.3},
walk_long = {chance = 0.11, duration = 8, moving_speed = 1.3, update_yaw = 5},
-- special modes
follow = {chance = 0, duration = 20, radius = 4, timer = 5, moving_speed = 1, items = {"farming:wheat"}},
eat = {chance = 0.25,
duration = 4,
nodes = {
"default:grass_1", "default:grass_2", "default:grass_3",
"default:grass_4", "default:grass_5", "default:dirt_with_grass"
}
},
},
modes = {
idle = {chance = 0.5, duration = 10, update_yaw = 8},
walk = {chance = 0.14, duration = 4.5, moving_speed = 1.3},
walk_long = {chance = 0.11, duration = 8, moving_speed = 1.3, update_yaw = 5},
-- special modes
follow = {chance = 0, duration = 20, radius = 4, timer = 5, moving_speed = 1, items = {"farming:wheat"}},
eat = { chance = 0.25,
duration = 4,
nodes = {
"default:grass_1", "default:grass_2", "default:grass_3",
"default:grass_4", "default:grass_5", "default:dirt_with_grass"
}
},
},
drops = function(self)
local items = {{"creatures:flesh"}}
if self.has_wool then
table.insert(items, {"wool:white", {min = 1, max = 2}})
end
creatures.dropItems(self.object:getpos(), items)
end,
drops = function(self)
local items = {{"creatures:flesh"}}
if self.has_wool then
table.insert(items, {"wool:" .. self.wool_color, {min = 1, max = 2}})
end
creatures.dropItems(self.object:getpos(), items)
end,
spawning = {
abm_nodes = {
spawn_on = {"default:dirt_with_grass"},
},
abm_interval = 55,
abm_chance = 7800,
max_number = 1,
number = {min = 1, max = 3},
time_range = {min = 5100, max = 18300},
light = {min = 10, max = 15},
height_limit = {min = 0, max = 25},
spawning = {
abm_nodes = {
spawn_on = {"default:dirt_with_grass"},
},
abm_interval = 55,
abm_chance = 7800,
max_number = 1,
number = {min = 1, max = 3},
time_range = {min = 5100, max = 18300},
light = {min = 10, max = 15},
height_limit = {min = 0, max = 25},
spawn_egg = {
description = "Sheep Spawn-Egg",
texture = "creatures_egg_sheep.png",
},
spawn_egg = {
description = "Sheep Spawn-Egg",
texture = "creatures_egg_sheep.png",
},
spawner = {
description = "Sheep Spawner",
range = 8,
player_range = 20,
number = 6,
}
},
spawner = {
description = "Sheep Spawner",
range = 8,
player_range = 20,
number = 6,
}
},
on_punch = function(self, puncher)
shear(self)
end,
on_punch = function(self, puncher)
shear(self)
end,
get_staticdata = function(self)
return {
has_wool = self.has_wool
}
end,
get_staticdata = function(self)
return {
has_wool = self.has_wool,
wool_color = self.wool_color,
}
end,
on_activate = function(self, staticdata)
if self.has_wool == false then
self.object:set_properties({textures = {"creatures_sheep.png"}})
end
end,
on_activate = function(self, staticdata)
if self.has_wool == nil then
self.has_wool = true
end
on_rightclick = function(self, clicker)
local item = clicker:get_wielded_item()
if item then
local name = item:get_name()
if name == "farming:wheat" then
self.target = clicker
self.mode = "follow"
self.modetimer = 0
if not self.wool_color then
self.wool_color = colors[math.random(1, #colors)]
end
-- update fur
setColor(self)
end,
if not self.tamed then
self.fed_cnt = (self.fed_cnt or 0) + 1
end
-- play eat sound?
item:take_item()
elseif name == "creatures:shears" and self.has_wool then
shear(self, math.random(2, 3), true)
item:add_wear(65535/100)
end
if not core.setting_getbool("creative_mode") then
clicker:set_wielded_item(item)
end
end
on_rightclick = function(self, clicker)
local item = clicker:get_wielded_item()
if item then
local name = item:get_name()
if name == "farming:wheat" then
self.target = clicker
self.mode = "follow"
self.modetimer = 0
return true
end,
if not self.tamed then
self.fed_cnt = (self.fed_cnt or 0) + 1
end
on_step = function(self, dtime)
if self.has_wool == nil then
self.has_wool = true
end
if self.mode == "eat" and self.eat_node then
self.regrow_wool = true
end
if self.last_mode == "eat" and (self.modetimer and self.modetimer == 0) and self.regrow_wool then
self.has_wool = true
self.regrow_wool = nil
self.object:set_properties({textures = {"creatures_sheep.png^creatures_sheep_white.png"}})
end
if self.fed_cnt and self.fed_cnt > 4 then
self.tamed = true
self.fed_cnt = nil
end
end
-- play eat sound?
item:take_item()
elseif name == "creatures:shears" and self.has_wool then
shear(self, math.random(2, 3), true)
item:add_wear(65535/100)
end
if not core.setting_getbool("creative_mode") then
clicker:set_wielded_item(item)
end
end
return true
end,
on_step = function(self, dtime)
if self.mode == "eat" and self.eat_node then
self.regrow_wool = true
end
if self.last_mode == "eat" and (self.modetimer and self.modetimer == 0) and self.regrow_wool then
self.has_wool = true
self.regrow_wool = nil
setColor(self)
end
if self.fed_cnt and self.fed_cnt > 4 then
self.tamed = true
self.fed_cnt = nil
end
end
}
creatures.register_mob(def)

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB