zombies4test/tankzombie/init.lua

161 lines
3.2 KiB
Lua
Raw Normal View History

2023-01-29 19:25:14 +03:00
-- Sound :
-- https://freesound.org/people/missozzy/sounds/169985/
-- https://freesound.org/people/zglar/sounds/232289/
2023-01-23 04:13:39 +03:00
local zombienods = {
"default:dirt",
"default:dirt_with_rainforest",
"default:dirt_with_grass",
"default:dirt_with_dry_grass",
"default:dry_dirt_with_dry_grass",
"default:dirt_with_coniferous_litter",
"default:stone",
"default:ice",
"default:snowblock",
"default:dirt_with_snow",
"default:desert_sand",
"default:desert_stone",
"default:stone",
"default:desert_stone",
"default:ice",
2023-02-20 21:53:55 +03:00
"nodex:road",
"nodex:road2",
"nodex:road3",
2023-01-23 04:13:39 +03:00
}
---- SKULL SWORD ------------------------------------------------------------------------------------------------------
mobs:register_mob("tankzombie:tankzombie", {
2023-01-27 22:07:50 +03:00
--nametag = "Tank Zombie" ,
2023-01-23 04:13:39 +03:00
type = "monster",
passive = false,
attack_type = "dogfight",
2023-01-24 19:55:52 +03:00
--attack_animals = true,
2023-05-01 04:56:35 +03:00
pathfinding = 1,
2023-01-23 04:13:39 +03:00
reach = 5,
2023-01-27 22:07:50 +03:00
damage = 12,
hp_min = 250,
hp_max = 250,
2023-02-23 05:00:51 +03:00
armor = 60,
2023-01-23 04:13:39 +03:00
collisionbox = {-0.4, 0, -0.4, 0.4, 3.0, 0.4},
visual = "mesh",
2023-05-01 04:56:35 +03:00
mesh = "ztank.b3d",
visual_size = {x=12, y=12},
2023-01-23 04:13:39 +03:00
--rotate = 180,
textures = {
{"tankzombiex.png"},
--{""},
},
--glow = 4,
--blood_texture = " ",
makes_footstep_sound = true,
sounds = {
2023-01-29 19:25:14 +03:00
random ="missozzy",
2023-01-23 04:13:39 +03:00
--attack = "zombie_hit",
2023-01-29 19:25:14 +03:00
death = "roar ",
2023-01-23 04:13:39 +03:00
},
walk_velocity = 1,
run_velocity = 3,
2023-02-23 05:00:51 +03:00
jump_height = 7,
2023-01-27 22:07:50 +03:00
stepheight = 1.7,
2023-01-23 04:13:39 +03:00
floats = 0,
view_range = 35,
drops = {
2023-01-27 22:07:50 +03:00
{name = "default:diamondblock", chance = 2, min = 1, max = 1},
2023-01-23 04:13:39 +03:00
},
water_damage = 0,
2023-01-29 19:25:14 +03:00
lava_damage = 0,
2023-01-23 04:13:39 +03:00
light_damage = 0,
2023-01-29 19:25:14 +03:00
immune_to = {
{"fortification:wirefence", -10} ,
{"fortification:barbed_wire", -10} ,
{"fortification:punji_sticks", -10} ,
},
2023-01-23 04:13:39 +03:00
animation = {
speed_normal = 15,
stand_start = 0,
stand_end = 80,
walk_start = 100,
walk_end = 180,
run_speed = 45,
run_start = 100,
run_end = 180,
punch_speed = 25,
punch_start = 200,
punch_end = 250,
2023-05-01 04:56:35 +03:00
die_speed = 15,
2023-01-23 04:13:39 +03:00
die_start = 260,
2023-05-01 04:56:35 +03:00
die_end = 399,
2023-01-23 04:13:39 +03:00
},
2023-05-07 20:24:23 +03:00
on_spawn = function(self)
--local pos = self.object:get_pos()
-- Adicionar animação
self.object:set_animation({x=430, y=490},30, 0, false)
-- Pós animação
minetest.after(3, function()
mobs:set_animation(self, "walk")
end)
end,
2023-01-23 04:13:39 +03:00
2023-01-29 19:25:14 +03:00
2023-05-01 04:56:35 +03:00
--[[
2023-01-29 19:25:14 +03:00
on_die = function(self, pos) -- POSIÇÃO
2023-05-01 04:56:35 +03:00
self.object:set_animation({x=260, y=380}, 20, 0)
2023-01-29 19:25:14 +03:00
for _,players in pairs(minetest.get_objects_inside_radius(pos,64)) do -- CONSEGUIR RADIUS ( POSIÇÃO ,64 NODES?)
if players:is_player() then -- SE PLAYER
awards.unlock(players:get_player_name(), "tank") -- DESBLOQUEAR CONQUISTAS?
end
end
end
2023-01-23 04:13:39 +03:00
--custom_attack = function()
--end,
2023-05-01 04:56:35 +03:00
]]
2023-01-23 04:13:39 +03:00
})
2023-03-01 14:39:48 +03:00
-- ADICIONANDO ATAQUE QUE MUDA O POSIÇÃO
minetest.register_on_punchplayer(function(player, hitter, time_from_last_punch, tool_capabilities, dir)
if hitter:get_luaentity().name == "tankzombie:tankzombie" then
player:set_pos({x=player:get_pos().x+5,y=player:get_pos().y+5,z=player:get_pos().z})
end
end)
2023-01-23 04:13:39 +03:00
2023-05-01 04:56:35 +03:00
2023-01-23 04:13:39 +03:00
mobs:spawn({
name = "tankzombie:tankzombie",
nodes = hunternods,
min_light = 0,
max_light = 7, -- 14
2023-01-27 22:07:50 +03:00
chance = 16000,
2023-01-23 04:13:39 +03:00
min_height = 0,
max_height = 200,
--max_height = 200,
active_object_count =1,
})
2023-01-25 15:47:20 +03:00
mobs:register_egg("tankzombie:tankzombie", "Tank Zombie", "zombies_egg.png", 0)
2023-01-23 04:13:39 +03:00