-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathexplodingtoad.lua
More file actions
218 lines (183 loc) · 6.34 KB
/
Copy pathexplodingtoad.lua
File metadata and controls
218 lines (183 loc) · 6.34 KB
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
local S = minetest.get_translator("nativevillages")
mobs:register_mob("nativevillages:toad", {
stepheight = 3,
type = "monster",
passive = false,
attack_type = "explode",
explosion_radius = 2,
explosion_damage__radius = 6,
explosion_timer = 2,
attack_npcs = false,
attack_animals = false,
reach = 3,
damage = 18,
hp_min = 15,
hp_max = 30,
armor = 100,
collisionbox = {-0.268, -0.01, -0.268, 0.268, 0.25, 0.268},
visual = "mesh",
mesh = "Toad.b3d",
drawtype = "front",
textures = {
{"texturetoad.png"},
},
sounds = {
random = "",},
makes_footstep_sound = true,
walk_velocity = 1.5,
run_velocity = 2,
runaway = true,
runaway_from = {"animalworld:bear", "animalworld:crocodile", "animalworld:tiger", "animalworld:spider", "animalworld:spidermale", "animalworld:shark", "animalworld:hyena", "animalworld:kobra", "animalworld:monitor", "animalworld:snowleopard", "animalworld:volverine", "livingfloatlands:deinotherium", "livingfloatlands:carnotaurus", "livingfloatlands:lycaenops", "livingfloatlands:smilodon", "livingfloatlands:tyrannosaurus", "livingfloatlands:velociraptor", "animalworld:divingbeetle", "animalworld:scorpion"},
jump = true,
jump_height = 6,
sounds = {
attack = "nativevillages_toad",
random = "nativevillages_toad2",
damage = "nativevillages_toad",
death = "nativevillages_toad",
distance = 10,
},
drops = {
{name = "mobs:meat_raw", chance = 1, min = 1, max = 1},
},
water_damage = 0,
lava_damage = 4,
light_damage = 0,
fear_height = 6,
animation = {
speed_normal = 50,
stand_start = 1,
stand_end = 100,
walk_speed = 100,
walk_start = 100,
walk_end = 200,
fly_start = 300, -- swim animation
fly_end = 400,
},
fly_in = {"default:water_source", "default:river_water_source", "default:water_flowing", "default:river_water_flowing"},
floats = 0,
follow = {"fishing:bait:worm", "ethereal:worm", "animalworld:ant", "animalworld:termite"},
view_range = 13,
on_rightclick = function(self, clicker)
if mobs:feed_tame(self, clicker, 8, true, true) then return end
if mobs:protect(self, clicker) then return end
if mobs:capture_mob(self, clicker, 0, 25, 0, false, nil) then return end
end,
})
if minetest.get_modpath("ethereal") then
spawn_on = "ethereal:prairie_dirt", "default:dirt_with_grass", "ethereal:green_dirt"
end
if not mobs.custom_spawn_nativevillages then
mobs:spawn({
name = "nativevillages:toad",
nodes = {"default:dirt_with_grass"}, {"default:dirt_with_rainforest_litter"}, {"default:dry_dirt_with_dry_grass"},
neighbors = {"group:grass", "group:normal_grass"},
min_light = 0,
interval = 60,
chance = 2000, -- 15000
active_object_count = 1,
min_height = 1,
max_height = 15,
day_toogle = false
})
end
mobs:register_egg("nativevillages:toad", S("Toad"), "atoad.png", 0)
mobs:alias_mob("nativevillages:toad", "nativevillages:toad") -- compatibility
mobs:register_mob("nativevillages:toadtamed", {
stepheight = 3,
type = "NPC",
passive = false,
attack_type = "explode",
explosion_radius = 4,
explosion_damage__radius = 12,
explosion_timer = 4,
attack_npcs = false,
attack_animals = false,
attack_monsters = true,
reach = 3,
damage = 550,
hp_min = 25,
hp_max = 50,
armor = 100,
collisionbox = {-0.268, -0.01, -0.268, 0.268, 0.25, 0.268},
visual = "mesh",
mesh = "Toad.b3d",
drawtype = "front",
textures = {
{"texturetoad.png"},
},
sounds = {
random = "",},
makes_footstep_sound = true,
owner_loyal = true,
owner = "",
order = "follow",
pathfinding = true,
walk_velocity = 1.5,
run_velocity = 2,
runaway = false,
runaway_from = {"animalworld:bear", "animalworld:crocodile", "animalworld:tiger", "animalworld:spider", "animalworld:spidermale", "animalworld:shark", "animalworld:hyena", "animalworld:kobra", "animalworld:monitor", "animalworld:snowleopard", "animalworld:volverine", "livingfloatlands:deinotherium", "livingfloatlands:carnotaurus", "livingfloatlands:lycaenops", "livingfloatlands:smilodon", "livingfloatlands:tyrannosaurus", "livingfloatlands:velociraptor", "animalworld:divingbeetle", "animalworld:scorpion"},
jump = true,
jump_height = 6,
drops = {
{name = "mobs:meat_raw", chance = 1, min = 1, max = 1},
},
water_damage = 0,
lava_damage = 4,
light_damage = 0,
fear_height = 6,
animation = {
speed_normal = 50,
stand_start = 1,
stand_end = 100,
walk_speed = 100,
walk_start = 100,
walk_end = 200,
fly_start = 300, -- swim animation
fly_end = 400,
},
fly_in = {"default:water_source", "default:river_water_source", "default:water_flowing", "default:river_water_flowing"},
floats = 0,
follow = {"fishing:bait:worm", "ethereal:worm", "animalworld:ant", "animalworld:termite"},
view_range = 13,
on_rightclick = function(self, clicker)
-- feed to heal npc
if mobs:feed_tame(self, clicker, 8, true, true) then return end
-- capture npc with net or lasso
if mobs:capture_mob(self, clicker, nil, 5, 80, false, nil) then return end
-- protect npc with mobs:protector
if mobs:protect(self, clicker) then return end
local item = clicker:get_wielded_item()
local name = clicker:get_player_name()
-- by right-clicking owner can switch npc between follow and stand
if self.owner and self.owner == name then
if self.order == "follow" then
self.attack = nil
self.order = "stand"
self.state = "stand"
self:set_animation("stand")
self:set_velocity(0)
minetest.chat_send_player(name, S("Exploding Toad stands still."))
else
self.order = "follow"
minetest.chat_send_player(name, S("Exploding Toad will follow you."))
end
end
end,
})
mobs:register_egg("nativevillages:toadtamed", S("Tamed Exploding Toad"), "atoad.png", 0)
mobs:alias_mob("nativevillages:toadtamed", "nativevillages:toadtamed") -- compatibility
minetest.register_node("nativevillages:toadbag", {
description = S"Bag full of toads!",
tiles = {
"nativevillages_toadbag_top.png",
"nativevillages_toadbag_bottom.png",
"nativevillages_toadbag_right.png",
"nativevillages_toadbag_left.png",
"nativevillages_toadbag_back.png",
"nativevillages_toadbag_front.png"
},
groups = {crumbly = 3},
drop = "nativevillages:toadtamed 9",
sounds = default.node_sound_dirt_defaults(),
})