Add botete

master
Lean Rada 2015-01-21 14:36:18 +08:00
parent 664031c2ad
commit b33fdef99b
4 changed files with 51 additions and 13 deletions

View File

@ -23,7 +23,7 @@ director.spawn_list = {
group_min = 21,
group_max = 24,
probability = 0.8,
day_start = 1,
day_start = 2,
spawn_time = 21.0,
spawn_location = "ground",
},
@ -35,7 +35,7 @@ director.spawn_list = {
group_min = 1,
group_max = 4,
probability = 0.2,
day_start = 2,
day_start = 1,
spawn_time = 14.0,
spawn_location = "air",
},
@ -47,10 +47,22 @@ director.spawn_list = {
group_min = 1,
group_max = 1,
probability = 0.2,
day_start = 1,
day_start = 3,
spawn_time = 19.0,
spawn_location = "ground",
},
{
description = "Botete",
name = "defense:botete",
intensity_min = 0,
intensity_max = 0.4,
group_min = 1,
group_max = 1,
probability = 0.2,
day_start = 4,
spawn_time = 21.0,
spawn_location = "air",
},
}
director.intensity = 0.5
@ -61,7 +73,7 @@ local last_average_health = 1.0
local last_mob_count = 0
for i,m in ipairs(director.spawn_list) do
spawn_timers[m.description] = m.spawn_time
spawn_timers[m.description] = m.spawn_time/2
end
function director:on_interval()
@ -262,16 +274,18 @@ function director:save()
end
function director:load()
local file = assert(io.open(minetest.get_worldpath() .. "/defense.txt", "r"))
local data = minetest.deserialize(file:read("*all"))
if data then
self.intensity = data.intensity
self.cooldown_timer = data.cooldown_timer
spawn_timers = data.spawn_timers
last_average_health = data.last_average_health
last_mob_count = data.last_mob_count
local file = io.open(minetest.get_worldpath() .. "/defense.txt", "r")
if file then
local data = minetest.deserialize(file:read("*all"))
if data then
self.intensity = data.intensity
self.cooldown_timer = data.cooldown_timer
spawn_timers = data.spawn_timers
last_average_health = data.last_average_health
last_mob_count = data.last_mob_count
end
assert(file:close())
end
assert(file:close())
end
minetest.register_on_shutdown(function()

View File

@ -15,6 +15,7 @@ dofile2("mob.lua")
dofile2("mobs/unggoy.lua")
dofile2("mobs/sarangay.lua")
dofile2("mobs/paniki.lua")
dofile2("mobs/botete.lua")
dofile2("director.lua")
dofile2("initial_stuff.lua")

View File

@ -0,0 +1,23 @@
defense.mobs.register_mob("defense:botete", {
hp_max = 2,
collisionbox = {-0.4,-0.4,-0.4, 0.4,0.4,0.4},
mesh = "defense_botete
.b3d",
textures = {"defense_botete
.png"},
makes_footstep_sound = false,
animation = {
-- idle = {a=0, b=29, rate=50},
-- attack = {a=60, b=89, rate=50},
-- move = {a=30, b=59, rate=75},
-- move_attack = {a=60, b=89, rate=75},
},
mass = 1,
movement = "air",
move_speed = 6,
attack_damage = 0,
attack_range = 8,
attack_interval = 2.2,
})

Binary file not shown.