forked from Skandarella/animalworld
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ant.lua
146 lines (133 loc) · 3.59 KB
/
ant.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
mobs:register_mob("animalworld:ant", {
type = "monster",
passive = false,
attack_type = "dogfight",
reach = 1,
damage = 1,
hp_min = 1,
hp_max = 10,
armor = 100,
collisionbox = {-0.1, -0.01, -0.1, 0.1, 0.1, 0.1},
visual = "mesh",
mesh = "Ant.b3d",
visual_size = {x = 1, y = 1},
textures = {
"textureant.png", "textureant.png", "textureant.png", "textureant.png", "textureant.png",
"textureant.png", "textureant.png", "textureant.png", "textureant.png", "textureant.png",
"textureant.png", "textureant.png", "textureant.png", "textureant.png", "textureant.png",
"textureant.png", "textureant.png", "textureant.png", "textureant.png", "textureant.png"
},
sounds = {
random = "animalworld_ant",
attack = "animalworld_ant",
},
makes_footstep_sound = true,
stay_near = {"animalworld:anthill", 5},
view_range = 3,
walk_velocity = 0.5,
walk_chance = 70,
run_velocity = 0.7,
runaway = false,
jump = false,
jump_height = 0,
stepheight = 3,
drops = {
{name = "animalworld:ant", chance = 1, min = 1, max = 1},
},
water_damage = 1,
lava_damage = 4,
light_damage = 0,
fear_height = 3,
animation = {
speed_normal = 200,
stand_start = 0,
stand_end = 0,
walk_start = 0,
walk_end = 100,
punch_start = 100,
punch_end = 200,
-- 50-70 is slide/water idle
},
})
if not mobs.custom_spawn_animalworld then
mobs:spawn({
name = "animalworld:ant",
nodes = {"default:dirt_with_coniferous_litter"},
neighbors = {"animalworld:anthill"},
min_light = 0,
interval = 30,
chance = 1, -- 15000
active_object_count = 7,
min_height = 0,
max_height = 50,
day_toggle = true
})
end
mobs:register_egg("animalworld:ant", ("Ant"), "aant.png")
mobs:alias_mob("animalworld:ant", "animalworld:ant")
minetest.register_craftitem(":animalworld:anteggs_raw", {
description = ("Raw Ant Eggs"),
inventory_image = "animalworld_anteggs_raw.png",
on_use = minetest.item_eat(2),
groups = {food_meat_raw = 1, flammable = 2},
})
minetest.register_craftitem(":animalworld:anteggs_cooked", {
description = ("Cooked Ant Eggs"),
inventory_image = "animalworld_anteggs_cooked.png",
on_use = minetest.item_eat(6),
groups = {food_meat = 1, flammable = 2},
})
minetest.register_craft({
type = "cooking",
output = "animalworld:anteggs_cooked",
recipe = "animalworld:anteggs_raw",
cooktime = 5,
})
minetest.register_decoration({
deco_type = "simple",
place_on = {"default:dirt_with_coniferous_litter"},
sidelen = 16,
noise_params = {
offset = 0.0012,
scale = 0.0007,
spread = {x = 250, y = 250, z = 250},
seed = 2,
octaves = 3,
persist = 0.66
},
y_max = 50,
y_min = 0,
decoration = "animalworld:anthill"
})
minetest.register_node("animalworld:anthill", {
description = "Anthill",
visual_scale = 0.5,
mesh = "Anthil.b3d",
tiles = {"textureanthil.png"},
inventory_image = "aanthil.png",
paramtype = "light",
paramtype2 = "facedir",
groups = {choppy = 3},
drawtype = "mesh",
collision_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, 0.1, 0.5},
--[[{-0.5, -0.5, -0.5, 0.5, 0.1, 0.5},
{-0.5, -0.5, -0.5, 0.5, 0.1, 0.5}]]
}
},
selection_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, 0.1, 0.5}
}
},
drop = "animalworld:anteggs_raw",
sounds = default.node_sound_dirt_defaults(),
})
minetest.register_craft({
type = "fuel",
recipe = "animalworld:anthill",
burntime = 1,
})