master
runs 2019-04-13 00:17:15 +02:00
parent edaced8226
commit e194e4d57f
20 changed files with 464 additions and 67 deletions

View File

@ -35,3 +35,6 @@ end
if petz.settings.calf_spawn then
assert(loadfile(modpath .. "/calf_"..petz.settings.type_api..".lua"))(S)
end
if petz.settings.panda_spawn then
assert(loadfile(modpath .. "/panda_"..petz.settings.type_api..".lua"))(S)
end

154
models/petz_bear Normal file
View File

@ -0,0 +1,154 @@
mtllib petz_bear.mtl
o converted_out
v 0.25 -0.5 0.25
v 0.25 -0.5 0.4375
v 0.25 -0.25 0.4375
v 0.25 -0.25 0.25
v 0.0625 -0.5 0.25
v 0.0625 -0.5 0.4375
v 0.0625 -0.25 0.4375
v 0.0625 -0.25 0.25
v 0.25 -0.5 -0.125
v 0.25 -0.5 0.0625
v 0.25 -0.25 0.0625
v 0.25 -0.25 -0.125
v 0.0625 -0.5 -0.125
v 0.0625 -0.5 0.0625
v 0.0625 -0.25 0.0625
v 0.0625 -0.25 -0.125
v -0.0625 -0.5 -0.125
v -0.0625 -0.5 0.0625
v -0.0625 -0.25 0.0625
v -0.0625 -0.25 -0.125
v -0.25 -0.5 -0.125
v -0.25 -0.5 0.0625
v -0.25 -0.25 0.0625
v -0.25 -0.25 -0.125
v -0.0625 -0.5 0.25
v -0.0625 -0.5 0.4375
v -0.0625 -0.25 0.4375
v -0.0625 -0.25 0.25
v -0.25 -0.5 0.25
v -0.25 -0.5 0.4375
v -0.25 -0.25 0.4375
v -0.25 -0.25 0.25
v 0.25 -0.25 -0.125
v 0.25 -0.25 0.4375
v 0.25 0.25 0.4375
v 0.25 0.25 -0.125
v -0.25 -0.25 -0.125
v -0.25 -0.25 0.4375
v -0.25 0.25 0.4375
v -0.25 0.25 -0.125
v 0.1875 -0.1875 -0.4375
v 0.1875 -0.1875 -0.125
v 0.1875 0.1875 -0.125
v 0.1875 0.1875 -0.4375
v -0.1875 -0.1875 -0.4375
v -0.1875 -0.1875 -0.125
v -0.1875 0.1875 -0.125
v -0.1875 0.1875 -0.4375
v 0.125 0.1875 -0.3125
v 0.125 0.1875 -0.25
v 0.125 0.25 -0.25
v 0.125 0.25 -0.3125
v 0.0625 0.1875 -0.3125
v 0.0625 0.1875 -0.25
v 0.0625 0.25 -0.25
v 0.0625 0.25 -0.3125
v 0.0625 -0.125 0.4375
v 0.0625 -0.125 0.5
v 0.0625 1.11759e-08 0.5
v 0.0625 1.11759e-08 0.4375
v -0.0625 -0.125 0.4375
v -0.0625 -0.125 0.5
v -0.0625 1.11759e-08 0.5
v -0.0625 1.11759e-08 0.4375
v -0.0625 0.1875 -0.3125
v -0.0625 0.1875 -0.25
v -0.0625 0.25 -0.25
v -0.0625 0.25 -0.3125
v -0.125 0.1875 -0.3125
v -0.125 0.1875 -0.25
v -0.125 0.25 -0.25
v -0.125 0.25 -0.3125
v 0.125 -0.1875 -0.5
v 0.125 -0.1875 -0.4375
v 0.125 -0.0625001 -0.4375
v 0.125 -0.0625001 -0.5
v -0.125 -0.1875 -0.5
v -0.125 -0.1875 -0.4375
v -0.125 -0.0625001 -0.4375
v -0.125 -0.0625001 -0.5
usemtl none
s off
g back_right_leg
f 1 2 3 4
f 5 6 7 8
f 1 4 8 5
f 2 3 7 6
f 1 2 6 5
f 4 3 7 8
g front_right_leg
f 9 10 11 12
f 13 14 15 16
f 9 12 16 13
f 10 11 15 14
f 9 10 14 13
f 12 11 15 16
g front_left_leg
f 17 18 19 20
f 21 22 23 24
f 17 20 24 21
f 18 19 23 22
f 17 18 22 21
f 20 19 23 24
g back_left_leg
f 25 26 27 28
f 29 30 31 32
f 25 28 32 29
f 26 27 31 30
f 25 26 30 29
f 28 27 31 32
g body
f 33 34 35 36
f 37 38 39 40
f 33 36 40 37
f 34 35 39 38
f 33 34 38 37
f 36 35 39 40
g head
f 41 42 43 44
f 45 46 47 48
f 41 44 48 45
f 42 43 47 46
f 41 42 46 45
f 44 43 47 48
g right_ear
f 49 50 51 52
f 53 54 55 56
f 49 52 56 53
f 50 51 55 54
f 49 50 54 53
f 52 51 55 56
g tail
f 57 58 59 60
f 61 62 63 64
f 57 60 64 61
f 58 59 63 62
f 57 58 62 61
f 60 59 63 64
g left_ear
f 65 66 67 68
f 69 70 71 72
f 65 68 72 69
f 66 67 71 70
f 65 66 70 69
f 68 67 71 72
g snout
f 73 74 75 76
f 77 78 79 80
f 73 76 80 77
f 74 75 79 78
f 73 74 78 77
f 76 75 79 80

BIN
models/petz_panda.b3d Normal file

Binary file not shown.

BIN
models/petz_panda.blend Normal file

Binary file not shown.

BIN
models/petz_panda.blend1 Normal file

Binary file not shown.

154
models/petz_panda.obj Normal file
View File

@ -0,0 +1,154 @@
mtllib petz_bear.mtl
o converted_out
v 0.25 -0.5 0.25
v 0.25 -0.5 0.4375
v 0.25 -0.25 0.4375
v 0.25 -0.25 0.25
v 0.0625 -0.5 0.25
v 0.0625 -0.5 0.4375
v 0.0625 -0.25 0.4375
v 0.0625 -0.25 0.25
v 0.25 -0.5 -0.125
v 0.25 -0.5 0.0625
v 0.25 -0.25 0.0625
v 0.25 -0.25 -0.125
v 0.0625 -0.5 -0.125
v 0.0625 -0.5 0.0625
v 0.0625 -0.25 0.0625
v 0.0625 -0.25 -0.125
v -0.0625 -0.5 -0.125
v -0.0625 -0.5 0.0625
v -0.0625 -0.25 0.0625
v -0.0625 -0.25 -0.125
v -0.25 -0.5 -0.125
v -0.25 -0.5 0.0625
v -0.25 -0.25 0.0625
v -0.25 -0.25 -0.125
v -0.0625 -0.5 0.25
v -0.0625 -0.5 0.4375
v -0.0625 -0.25 0.4375
v -0.0625 -0.25 0.25
v -0.25 -0.5 0.25
v -0.25 -0.5 0.4375
v -0.25 -0.25 0.4375
v -0.25 -0.25 0.25
v 0.25 -0.25 -0.125
v 0.25 -0.25 0.4375
v 0.25 0.25 0.4375
v 0.25 0.25 -0.125
v -0.25 -0.25 -0.125
v -0.25 -0.25 0.4375
v -0.25 0.25 0.4375
v -0.25 0.25 -0.125
v 0.1875 -0.1875 -0.4375
v 0.1875 -0.1875 -0.125
v 0.1875 0.1875 -0.125
v 0.1875 0.1875 -0.4375
v -0.1875 -0.1875 -0.4375
v -0.1875 -0.1875 -0.125
v -0.1875 0.1875 -0.125
v -0.1875 0.1875 -0.4375
v 0.125 0.1875 -0.3125
v 0.125 0.1875 -0.25
v 0.125 0.25 -0.25
v 0.125 0.25 -0.3125
v 0.0625 0.1875 -0.3125
v 0.0625 0.1875 -0.25
v 0.0625 0.25 -0.25
v 0.0625 0.25 -0.3125
v 0.0625 -0.125 0.4375
v 0.0625 -0.125 0.5
v 0.0625 1.11759e-08 0.5
v 0.0625 1.11759e-08 0.4375
v -0.0625 -0.125 0.4375
v -0.0625 -0.125 0.5
v -0.0625 1.11759e-08 0.5
v -0.0625 1.11759e-08 0.4375
v -0.0625 0.1875 -0.3125
v -0.0625 0.1875 -0.25
v -0.0625 0.25 -0.25
v -0.0625 0.25 -0.3125
v -0.125 0.1875 -0.3125
v -0.125 0.1875 -0.25
v -0.125 0.25 -0.25
v -0.125 0.25 -0.3125
v 0.125 -0.1875 -0.5
v 0.125 -0.1875 -0.4375
v 0.125 -0.0625001 -0.4375
v 0.125 -0.0625001 -0.5
v -0.125 -0.1875 -0.5
v -0.125 -0.1875 -0.4375
v -0.125 -0.0625001 -0.4375
v -0.125 -0.0625001 -0.5
usemtl none
s off
g back_right_leg
f 1 2 3 4
f 5 6 7 8
f 1 4 8 5
f 2 3 7 6
f 1 2 6 5
f 4 3 7 8
g front_right_leg
f 9 10 11 12
f 13 14 15 16
f 9 12 16 13
f 10 11 15 14
f 9 10 14 13
f 12 11 15 16
g front_left_leg
f 17 18 19 20
f 21 22 23 24
f 17 20 24 21
f 18 19 23 22
f 17 18 22 21
f 20 19 23 24
g back_left_leg
f 25 26 27 28
f 29 30 31 32
f 25 28 32 29
f 26 27 31 30
f 25 26 30 29
f 28 27 31 32
g body
f 33 34 35 36
f 37 38 39 40
f 33 36 40 37
f 34 35 39 38
f 33 34 38 37
f 36 35 39 40
g head
f 41 42 43 44
f 45 46 47 48
f 41 44 48 45
f 42 43 47 46
f 41 42 46 45
f 44 43 47 48
g right_ear
f 49 50 51 52
f 53 54 55 56
f 49 52 56 53
f 50 51 55 54
f 49 50 54 53
f 52 51 55 56
g tail
f 57 58 59 60
f 61 62 63 64
f 57 60 64 61
f 58 59 63 62
f 57 58 62 61
f 60 59 63 64
g left_ear
f 65 66 67 68
f 69 70 71 72
f 65 68 72 69
f 66 67 71 70
f 65 66 70 69
f 68 67 71 72
g snout
f 73 74 75 76
f 77 78 79 80
f 73 76 80 77
f 74 75 79 78
f 73 74 78 77
f 76 75 79 80

View File

@ -1,66 +0,0 @@
--
--PANDA
--
minetest.register_node("petz:panda_block", {
tiles = {
"petz_panda_top.png",
"petz_panda_bottom.png",
"petz_panda_right.png",
"petz_panda_left.png",
"petz_panda_back.png",
"petz_panda_front.png"
},
drawtype = "nodebox",
paramtype = "light",
node_box = {
type = "fixed",
fixed = {
{-0.25, -0.5, 0.25, -0.0625, -0.25, 0.4375}, -- back_right_leg
{-0.25, -0.5, -0.125, -0.0625, -0.25, 0.0625}, -- front_right_leg
{0.0625, -0.5, -0.125, 0.25, -0.25, 0.0625}, -- front_left_leg
{0.0625, -0.5, 0.25, 0.25, -0.25, 0.4375}, -- back_left_leg
{-0.25, -0.25, -0.125, 0.25, 0.25, 0.4375}, -- body
{-0.1875, -0.1875, -0.4375, 0.1875, 0.1875, -0.125}, -- head
{-0.125, 0.1875, -0.3125, -0.0625, 0.25, -0.25}, -- right_ear
{-0.0625, -0.125, 0.4375, 0.0625, 1.11759e-08, 0.5}, -- tail
{0.0625, 0.1875, -0.3125, 0.125, 0.25, -0.25}, -- left_ear
{-0.125, -0.1875, -0.5, 0.125, -0.0625001, -0.4375}, -- snout
}
}
})
mobs:register_mob("petz:panda", {
type = "animal",
rotate= 180,
passive = true,
hp_min = 4,
hp_max = 8,
armor = 200,
collisionbox = {-0.25, -0.75, -0.25, 0.25, -0.25, 0.25},
--selectionbox = {-0.25, -0.75, -0.25, 0.25, -0.25, 0.25},
visual = "wielditem",
visual_size = {x = 1.0, y = 1.0},
textures = {"petz:panda_block"},
makes_footstep_sound = false,
walk_velocity = 0.45,
run_velocity = 1.25,
runaway = true,
jump = true,
fear_height = 2,
drops = {
{name = "mobs:pork_raw",
chance = 1,
min = 1,
max = 2,},
},
drawtype = "front",
water_damage = 1,
lava_damage = 6,
light_damage = 0,
sounds = {
random = "petz_panda",
},
follow = {"default:apple"},
view_range = 5,
})

135
panda_mobs_redo.lua Normal file
View File

@ -0,0 +1,135 @@
--
--PANDA
--
local S = ...
local pet_name = "panda"
local mesh = nil
local scale_ducky = 1.0
local textures = {}
local fixed = {}
local tiles = {}
local collisionbox = {}
if petz.settings.type_model == "cubic" then
local node_name = "petz:"..pet_name.."_block"
fixed = {
{-0.25, -0.5, 0.25, -0.0625, -0.25, 0.4375}, -- back_right_leg
{-0.25, -0.5, -0.125, -0.0625, -0.25, 0.0625}, -- front_right_leg
{0.0625, -0.5, -0.125, 0.25, -0.25, 0.0625}, -- front_left_leg
{0.0625, -0.5, 0.25, 0.25, -0.25, 0.4375}, -- back_left_leg
{-0.25, -0.25, -0.125, 0.25, 0.25, 0.4375}, -- body
{-0.1875, -0.1875, -0.4375, 0.1875, 0.1875, -0.125}, -- head
{-0.125, 0.1875, -0.3125, -0.0625, 0.25, -0.25}, -- right_ear
{-0.0625, -0.125, 0.4375, 0.0625, 1.11759e-08, 0.5}, -- tail
{0.0625, 0.1875, -0.3125, 0.125, 0.25, -0.25}, -- left_ear
{-0.125, -0.1875, -0.5, 0.125, -0.0625001, -0.4375}, -- snout
}
tiles = {
"petz_panda_top.png",
"petz_panda_bottom.png",
"petz_panda_right.png",
"petz_panda_left.png",
"petz_panda_back.png",
"petz_panda_front.png"
}
petz.register_cubic(node_name, fixed, tiles)
textures= {"petz:panda_block"}
collisionbox = {-0.35, -0.75, -0.28, 0.35, -0.125, 0.28}
else
mesh = 'petz_panda.b3d'
textures= {"petz_panda.png"}
collisionbox = {-0.35, -0.75, -0.28, 0.5, 0.4, 0.5}
end
mobs:register_mob("petz:"..pet_name, {
type = "animal",
rotate = petz.settings.rotate,
damage = 8,
hp_min = 4,
hp_max = 8,
init_timer = true,
armor = 200,
visual = petz.settings.visual,
visual_size = petz.settings.visual_size,
mesh = mesh,
textures = textures,
collisionbox = collisionbox,
makes_footstep_sound = false,
walk_velocity = 0.75,
run_velocity = 1,
runaway = true,
pushable = true,
jump = true,
floats = 1,
follow = petz.settings.panda_follow,
drops = {
{name = "mobs:meat_raw",
chance = 1,
min = 1,
max = 1,},
},
stay_near= {
nodes = "petz:pet_bowl",
chance = 1,
},
water_damage = 0,
lava_damage = 6,
light_damage = 0,
sounds = {
random = "petz_panda_sound",
},
animation = {
speed_normal = 15, walk_start = 1, walk_end = 12,
speed_run = 25, run_start = 13, run_end = 25,
stand_start = 26, stand_end = 46,
stand2_start = 47, stand2_end = 59,
stand3_start = 60, stand3_end = 81,
},
view_range = 4,
fear_height = 3,
do_punch = function (self, hitter, time_from_last_punch, tool_capabilities, direction)
petz.do_punch(self, hitter, time_from_last_punch, tool_capabilities, direction)
end,
on_die = function(self, pos)
petz.on_die(self, pos)
end,
on_rightclick = function(self, clicker)
petz.on_rightclick(self, clicker)
end,
on_step = function(self, dtime)
petz.on_step(self, dtime)
end,
after_activate = function(self, staticdata, def, dtime)
self.init_timer = true
end,
do_custom = function(self, dtime)
if not self.custom_vars_set03 then
self.custom_vars_set03 = 0
self.petz_type = "panda"
self.is_pet = true
self.is_wild = false
self.give_orders = true
self.affinity = 100
self.init_timer = true
self.fed= false
self.brushed = false
self.beaver_oil_applied = false
end
petz.init_timer(self)
end,
})
mobs:register_egg("petz:panda", S("Panda"), "petz_spawnegg_panda.png", 0)
mobs:spawn({
name = "petz:panda",
nodes = {"default:dirt_with_grass"},
--neighbors = {"group:grass"},
min_light = 14,
interval = 90,
chance = petz.settings.panda_spawn_chance,
min_height = 5,
max_height = 200,
day_toggle = true,
})

View File

@ -47,3 +47,7 @@ lion_count_lashing_tame = 3
##Calf Specific
calf_follow = farming:wheat
calf_spawn_chance = 1200
##Panda Specific
panda_follow = default:papyrus
panda_spawn_chance = 1200

View File

@ -47,6 +47,9 @@ petz.settings.lion_count_lashing_tame = tonumber(settings:get("lion_count_lashin
petz.settings.calf_spawn = settings:get_bool("calf_spawn", true)
petz.settings.calf_spawn_chance = tonumber(settings:get("calf_spawn_chance"))
petz.settings.calf_follow = settings:get("calf_follow", "")
petz.settings.panda_spawn = settings:get_bool("panda_spawn", true)
petz.settings.panda_spawn_chance = tonumber(settings:get("panda_spawn_chance"))
petz.settings.panda_follow = settings:get("panda_follow", "")
if petz.settings.type_model == "mesh" then
petz.settings.visual = "mesh"

View File

@ -70,4 +70,14 @@ filename: petz_calf_moaning.ogg
Author: Alexander
http://www.orangefreesounds.com/moo-sound/
License: The sound effect is permitted for non-commercial use
under license “Attribution-NonCommercial 4.0 International (CC BY-NC 4.0)
under license “Attribution-NonCommercial 4.0 International (CC BY-NC 4.0)
--------------------------------------------
filename: petz_panda_sound.ogg
Author: San Diego Zoo
https://animals.sandiegozoo.org/animals/giant-panda
License: Unknown
--------------------------------------------
filename: petz_panda_moaning.ogg
Author: San Diego Zoo
https://animals.sandiegozoo.org/animals/giant-panda
License: Unknown

Binary file not shown.

BIN
sounds/petz_panda_sound.ogg Normal file

Binary file not shown.

BIN
textures/petz_panda.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 451 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 203 B

After

Width:  |  Height:  |  Size: 193 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 192 B

After

Width:  |  Height:  |  Size: 204 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 205 B

After

Width:  |  Height:  |  Size: 218 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 205 B

After

Width:  |  Height:  |  Size: 216 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 209 B

After

Width:  |  Height:  |  Size: 209 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 481 B