#1 Proposta de código de Lunovox

Open
Lunovox wants to merge 5 commits from Lunovox/master into duckgo/master
9 changed files with 172 additions and 109 deletions
  1. 34 14
      README.md
  2. 18 24
      birdie/init.lua
  3. 6 1
      birdie/mod.conf
  4. 28 21
      dog/init.lua
  5. 6 6
      dog/mod.conf
  6. 64 34
      frog/init.lua
  7. 6 6
      frog/mod.conf
  8. 6 3
      modpack.conf
  9. 4 0
      settingtypes.txt

+ 34 - 14
README.md

@@ -1,18 +1,38 @@
+![screenshot]
 # Simple Animals ( WIP )
-![](https://notabug.org/duckgo/simpleanimals/raw/master/simpleanimals.png)
+[ [Minetet Mod][linkminetest] ]
 
-- BY : DUCKGO
-- CREDITS : TenPlus1
-- LICENSE : MIT
-- TEXTURE : CC-BY-4.0
-- VERSION : 0.01
-
-- Depends = default, mobs 
+" Simple animals, to add to the game along with mobs animals in Minetest. The dog has the same base as the cat, and the birdie the same behavior as "stand"...All animals are tamable!!! "
 
-" Simple animals, to add to the game along with mobs animals in Minetest.
-The dog has the same base as the cat, and the birdie the same behavior as "stand"...All animals are tamable!!! "
+- SPAWN MOBS: 
+  * Dog: Tamed with bone. 
+  * Frog: Temed with bees.
+  * Birdie:
+- Depends :
+  - Mandatory:
+	  * [default][linkminetest] : It comes with the game.
+	  * [mobs] : Engine of Mobs
+	  * [mobs_animal] : Some farm animals.
+  - optional:
+     * [ethereal] : add biomes and more collor mobs in each biome.
+- DEVELOPERS: 
+  * [TenPlus1]: Creator of engine mobs.
+  * [DUCKGO]: Creator of these mobs.
+  * [Lunovox]: Rebalance of mob spawn.
+- LICENSE : [MIT]
+- TEXTURE : CC-BY-4.0
+- VERSION : 
+  * [0.2.0] : Initial Release by Duckgo
+  * [0.3.1] : Lunovox Release
 
-- Animals :
-Dog ,
-Frog ,
-Birdie ...
+[0.2.0]:https://notabug.org/Lunovox/simpleanimals/src/0.02
+[0.3.1]:https://notabug.org/Lunovox/simpleanimals/src/0.3.1
+[linkminetest]:https://minetest.net
+[DUCKGO]:https://notabug.org/duckgo/
+[ethereal]:https://notabug.org/tenplus1/ethereal
+[MIT]:https://notabug.org/duckgo/simpleanimals/raw/8b7c61633ae1406e2958059e1f667ccc7a5e4997/LICENSE?inline=true
+[mobs]:https://notabug.org/TenPlus1/mobs_redo
+[mobs_animal]:https://notabug.org/tenplus1/mobs_animal
+[Lunovox]:https://gitlab.com/lunovox/
+[screenshot]:https://notabug.org/duckgo/simpleanimals/raw/master/simpleanimals.png
+[TenPlus1]:https://notabug.org/tenplus1/

+ 18 - 24
birdie/init.lua

@@ -2,16 +2,22 @@
 -- =============================================================================
 -- SOUND: https://freesound.org/people/yaplasut1843/sounds/523307/
 -- =============================================================================
+local getInitialName = function(mobName)
+	local isShowed = minetest.settings:get_bool("simpleanimals.initial_nametags")
+	if isShowed then
+		return mobName
+	end
+end
 
 mobs:register_mob("birdie:birdie", {
-	--nametag = "birdie" ,
+	nametag = getInitialName("BIRD"),
 	type = "animal",
 	passive = true,
 	pathfinding = true,
 	-- reach = 0,
 	-- damage = 0,
 	hp_min = 8,
-	hp_max = 5,
+	hp_max = 8,
 	armor = 100,
 	collisionbox = {-0.3, -0.5, -0.3, 0.3, 0.1, 0.3},
 	visual = "mesh",
@@ -37,11 +43,9 @@ mobs:register_mob("birdie:birdie", {
 	jump_height = 3,
 	stepheight = 2,
 	floats = 0,
-	view_range = 35,
+	view_range = 16, --smartphone player not see long distance.
 	drops = {
-	
 		{name = "mobs:chicken_feather", chance = 3, min = 0, max = 1},
-		
 	},
 	water_damage = 1,
 	lava_damage = 2,
@@ -63,9 +67,7 @@ mobs:register_mob("birdie:birdie", {
 	follow = {
 		"farming:seed_wheat", 
 		"farming:seed_cotton", 
-		
 	},
-	
 	on_rightclick = function(self, clicker)
 
 		if mobs:feed_tame(self, clicker, 4, true, true) then return end
@@ -74,7 +76,7 @@ mobs:register_mob("birdie:birdie", {
 
 		-- by right-clicking owner can switch between staying and walking
 		if self.owner and self.owner == clicker:get_player_name() then
-
+			minetest.sound_play("birdie", {pos=self.object:get_pos(), gain=1.0, max_hear_distance = 5})
 			if self.order ~= "stand" then
 				self.order = "stand"
 				self.state = "stand"
@@ -86,30 +88,21 @@ mobs:register_mob("birdie:birdie", {
 			end
 		end
 	end,
-
-
-
 })
-
-
---==============================================================================
---========================= SPAWN ==============================================
-
 mobs:spawn({
 	name = "birdie:birdie",
-	nodes = "air",
-	min_light = 14, 
-	chance = 12000,
+	nodes = {
+		--"air",
+		"default:leaves",
+		"default:jungleleaves",
+	},
+	min_light = 10, 
+	chance = 8000,
 	min_height = 0,
 	max_height = 200,
+	day_toggle = true,
 })
 
-
-
-
-
-
 mobs:register_egg("birdie:birdie", "Birdie", "birdieegg.png", 1)
 
 

+ 6 - 1
birdie/mod.conf

@@ -1,2 +1,7 @@
 name = birdie
-depends =  default , mobs
+title = Sky Birdie
+description = Adds birdie in the sky.
+depends =  default, mobs, mobs_animal
+optional_depends = ethereal
+release = 0.3.1
+author = DuckGo, TenPlus1, Lunovox

+ 28 - 21
dog/init.lua

@@ -3,19 +3,30 @@
 -- sounds : 
 -- https://freesound.org/people/ScouseMouseJB/sounds/276267/
 -- https://freesound.org/people/TobiasKosmos/sounds/163280/
+local getInitialName = function(mobName)
+	local isShowed = minetest.settings:get_bool("simpleanimals.initial_nametags")
+	if isShowed then
+		return mobName
+	end
+end
 
 mobs:register_mob("dog:dog", {
-	nametag = "dog",
+	nametag = getInitialName("DOG"),
 	type = "animal",
-        --specific_attack = {"mobs_animal:kitten"},
-        damage = 3,
+	specific_attack = {
+		--"mobs_animal:kkitten",
+		"mobs_skeletons:skeleton",
+		"mobs_skeletons:skeleton_archer",
+		"mobs_skeletons:skeleton_archer_dark",
+	},
+   damage = 3,
 	attack_type = "dogfight",
 	--attack_animals = true, -- so it can attack kitten?
 	group_attack = true,
 	reach = 2,
 	stepheight = 1.1,
 	passive = false,
-	hp_min = 5,
+	hp_min = 10,
 	hp_max = 10,
 	armor = 100,
 	collisionbox = {-0.3, -0.3, -0.3, 0.3, 0.1, 0.3},
@@ -44,8 +55,9 @@ mobs:register_mob("dog:dog", {
 	stepheight = 1,
 	drops = {
 		--{name = "", chance = 1, min = 0, max = 1},
+		{name = 'bonemeal:bone', chance = 20, min = 0, max = 2}
 	},
-	water_damage = 0,
+	water_damage = 1, --dogs unlike of water.
 	lava_damage = 5,
 	fear_height = 3,
 	animation = {
@@ -60,7 +72,7 @@ mobs:register_mob("dog:dog", {
 	follow = {
 		"mobs:chicken_raw", 
 		"mobs:meat_raw",
-		
+		"bonemeal:bone",
 	},
 	view_range = 10,
 	runaway = true , 
@@ -73,17 +85,15 @@ mobs:register_mob("dog:dog", {
 
 		-- by right-clicking owner can switch between staying and walking
 		if self.owner and self.owner == clicker:get_player_name() then
-
+			minetest.sound_play("bark", {pos=self.object:get_pos(), gain=1.0, max_hear_distance = 5})
 			if self.order ~= "stand" then
 				self.order = "stand"
 				self.state = "stand"
 				self.object:set_velocity({x = 0, y = 0, z = 0})
 				mobs:set_animation(self, "stand")
-			
 			else     
 				self.order = ""
 				mobs:set_animation(self, "walk")
-				
 			end
 		end
 	end,
@@ -92,23 +102,20 @@ mobs:register_mob("dog:dog", {
 })
 
 
-local spawn_on = "default:dirt_with_grass"
-
-if minetest.get_modpath("ethereal") then
-	spawn_on = "ethereal:grove_dirt"
-end
-
 if not mobs.custom_spawn_animal then
 mobs:spawn({
 	name = "dog:dog",
-	nodes = {spawn_on},
-	neighbors = {"group:grass"},
-	min_light = 14,
+	nodes = {
+		"default:dirt_with_grass",
+		"ethereal:grove_dirt",
+	},
+	--neighbors = {"group:grass"},
+	min_light = 4, --dogs hanter in night
 	interval = 60,
-	chance = 10000, -- 22000
-	min_height = 5,
+	chance = 8000, --same the cat
+	min_height = -5, --dogs exolore dig in surfaces caves
 	max_height = 50,
-	day_toggle = true,
+	--day_toggle = true,
 })
 end
 

+ 6 - 6
dog/mod.conf

@@ -1,7 +1,7 @@
 name = dog
-title = simple animals
-author = DuckGo , TenPlus1 
-depends =  default , mobs , mobs_animal
-description = Adds farm animals.
-release = 0.01
-
+title = Farm Dogs
+description = Adds farm dogs.
+depends =  default, mobs, mobs_animal
+optional_depends = ethereal
+release = 0.3.1
+author = DuckGo, TenPlus1, Lunovox

+ 64 - 34
frog/init.lua

@@ -1,8 +1,14 @@
 --SOUNDS :
 -- NORMAL : ??
+local getInitialName = function(mobName)
+	local isShowed = minetest.settings:get_bool("simpleanimals.initial_nametags")
+	if isShowed then
+		return mobName
+	end
+end
 
 mobs:register_mob("frog:frog", {
-	nametag = "frog" ,
+	nametag = getInitialName("FROG"),
 	type = "animal",
 	passive = false,
 	attack_type = "dogfight",
@@ -11,7 +17,7 @@ mobs:register_mob("frog:frog", {
 	pathfinding = true,
 	reach = 2,
 	damage = 5,
-	hp_min = 2,
+	hp_min = 5,
 	hp_max = 5,
 	armor = 150,
 	collisionbox = {-0.3, -1.0, -0.2, 0.2, 0.05, 0.2},
@@ -20,9 +26,8 @@ mobs:register_mob("frog:frog", {
 	rotate = 180,
 	textures = {
 		{"frog.png"},
-		{"frog_brown.png"},
-		{"frog_red.png"},
-		
+		--{"frog_brown.png"}, --colored in on_spawn
+		--{"frog_red.png"}, --colored in on_spawn
 	},
 	--blood_texture = "",
 	makes_footstep_sound = true,
@@ -34,16 +39,15 @@ mobs:register_mob("frog:frog", {
 	walk_velocity = 2,
 	run_velocity = 3,
 	jump = true,
-	jump_height = 6,
+	jump_height = 3.1, --hight jump
 	fly_in = {"default:water_source", "default:water_flowing"},
-	floats = 0,
-	stepheight = 1.1,
-	fall_damage = 1,
-	view_range = 20,
+	floats = 2, --nothing in the water.
+	stepheight = 1.1, 
+	--fall_damage = 1, --without damage in fall
+	view_range = 5, --less see distance
 	drops = {
 		--{name = "skulls:bone", chance = 2, min = 1, max = 1},
-		
-		
+		{name = "mobs_animal:bee", chance = 20, min = 0, max = 1}, --drop bee just death
 	},
 	water_damage = 0,
 	lava_damage = 5,
@@ -63,41 +67,67 @@ mobs:register_mob("frog:frog", {
 		punch_end = 140,
 		punch_speed = 30,
 	},
-	
-	
-	
-	        on_rightclick = function(self, clicker) -- No momento pode somente , repodruzir ou Curar...
-	         
+	on_rightclick = function(self, clicker) -- No momento pode somente , repodruzir ou Curar...
 		if mobs:feed_tame(self, clicker, 8, true, true) then
-		return 
+			return 
 		end
 		
-		
 		if mobs:protect(self, clicker) then return end
 		if mobs:capture_mob(self, clicker, 30, 50, 80, false, nil) then return end
-		end,
+	end,
+	on_spawn = function(self)
+		local frog_types = {
+			{--Spawn in Nether
+				nodes = {
+					"nether:rack",
+					"nether:rack_deep",
+				},
+				skins = {"frog_red.png"},
+			},
+			{--Spawn in Rain Firest
+				nodes = {"default:dirt_with_rainforest_litter"},
+				skins = {"frog_brown.png"},
+			},
+		}
+		local pos = self.object:get_pos() ; pos.y = pos.y - 1
+		local tmp
+		for n = 1, #frog_types do
+			tmp = frog_types[n]
+			if minetest.find_node_near(pos, 1, tmp.nodes) then
+				self.base_texture = tmp.skins
+				self.object:set_properties({textures = tmp.skins})
+				if tmp.drops then
+					self.drops = tmp.drops
+				end
+				return true
+			end
+		end
 
-	
-	
+		return true -- run only once, false/nil runs every activation
+	end,
 })
 
-
-
-
 mobs:spawn({
 	name = "frog:frog",
-	nodes = {"default:dirt_with_rainforest_litter"},
-	min_light = 8,
-	--max_light = 14,
-	chance = 10000,
-	min_height = 0,
+	nodes = {
+		"default:dirt_with_grass", "default:dirt", "default:water_source", "default:water_flowing",--green frog
+		"default:dirt_with_rainforest_litter", --brown frog
+		"nether:rack", "nether:rack_deep", --red frog
+	},
+	--[[  
+	neighbors = {--in surface of water, bat not in deep ocean. (Not is mandatiry exist water near.)
+		"air", 
+		"default:water_source", "default:water_flowing",
+	},
+	--]]
+	min_light = 0,
+	max_light = 10,
+	chance = 8000,
+	min_height = -10,
 	max_height = 200,
-	
+	--day_toggle = true,
 })
 
-
-
-
 mobs:register_egg("frog:frog", "Frog", "frogegg.png", 1)
 
 

+ 6 - 6
frog/mod.conf

@@ -1,7 +1,7 @@
 name = frog
-title = simple animals
-author = DuckGo , TenPlus1 ,Jordach / BFD
-depends =  default , mobs , mobs_animal
-description = Adds farm animals.
-release = 0.01
-
+title = Jungle Frogs
+description = Adds jungle frogs.
+depends =  default, mobs, mobs_animal
+optional_depends = ethereal
+release = 0.3.1
+author = DuckGo, TenPlus1, Lunovox

+ 6 - 3
modpack.conf

@@ -1,4 +1,7 @@
 name = simpleanimals
-description = More Animals
-
-
+title = Simple Animals
+description = Adds simole animals in many biomes.
+depends =  default, mobs, mobs_animal
+optional_depends = ethereal
+release = 0.3.1
+author = DuckGo, TenPlus1, Lunovox

+ 4 - 0
settingtypes.txt

@@ -0,0 +1,4 @@
+# SIMPLE ANIMALS
+#	Displays nametag on mob spawn.
+#	Default: false
+simpleanimals.initial_nametags (Display Initial Nametag) bool false