New map, new creature, some fixes

This commit is contained in:
LoneWolfHT 2019-02-14 21:30:12 -08:00
parent 09295db951
commit 8a97597ab7
8 changed files with 55 additions and 7 deletions

View File

@ -23,6 +23,7 @@ function game.start_dungeon(name, level)
game.partyid = game.partyid + 1
player:set_pos(spawnpos)
minetest.remove_node(spawnpos)
minetest.chat_send_player(name, "You are now in "..game.registered_dungeons[dname].description)
meta:set_string("location", "dungeon");
game.party[name] = game.partyid
game.parties[game.partyid] = {[name] = 1}
@ -170,7 +171,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
end
end
table.sort(levels)
table.sort(levels, function(a,b) return a>b end)
if can_enter < level then
minetest.chat_send_player(name, "<Gatekeeper> You do not have the gear needed to go so deep, "..name)
@ -203,10 +204,17 @@ game.register_dungeon("fire_slime_maze", {
path = minetest.get_modpath("game").."/dungeons/fire_slime_maze.mts",
})
game.register_dungeon("slime valley", {
game.register_dungeon("slime_valley", {
description = "Slime Valley",
level = 1,
size = vector.new(10, 10, 70),
needs_clearing = true,
path = minetest.get_modpath("game").."/dungeons/slime_valley.mts",
})
game.register_dungeon("cave_party", {
description = "Cave Party",
level = 1,
size = vector.new(25, 10, 25),
path = minetest.get_modpath("game").."/dungeons/cave_party.mts",
})

Binary file not shown.

View File

@ -8,7 +8,8 @@ function game.register_mob(name, def)
pointable = def.pointable or true,
hp_max = def.hp,
hp = def.hp,
step_height = def.step_height or 1,
anim = "none",
stepheight = def.stepheight or 1.5,
time = 0,
attack_time = 0,
drops = def.drops,
@ -17,7 +18,7 @@ function game.register_mob(name, def)
visual_size = def.visual_size or {x=1, y=1, z=1},
textures = {def.texture},
collisionbox = def.collisionbox or {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
selection_box = def.selection_box or {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
selectionbox = def.selectionbox or {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
collide_with_objects = def.collide_with_objects or true,
on_step = function(self, dtime)
local pos = self.object:get_pos()
@ -53,10 +54,16 @@ function game.register_mob(name, def)
sighted = true
if vector.distance(ppos, pos) >= def.reach then
obj:set_animation(def.animations.walk.range, def.animations.walk.speed)
if self.anim ~= "walk" then
obj:set_animation(def.animations.walk.range, def.animations.walk.speed)
self.anim = "walk"
end
obj:set_velocity(vector.multiply(vel, def.speed))
else
obj:set_animation(def.animations.attack.range, def.animations.attack.speed)
if self.anim ~= "walk" then
self.anim = "attack"
end
if vector.distance(ppos, pos) <= def.reach/2 then
obj:set_velocity(vector.new(0, 0, 0))

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -32,7 +32,7 @@ game.register_mob("slime", {
game.register_mob("slime_fire", {
hp = 20,
mesh = "monsters_slime.b3d",
texture = "default_lava.png^monsters_slime_fire.png",
texture = "monsters_slime_fire.png",
view_range = 25,
speed = 4,
attack_capabilities = {
@ -59,4 +59,37 @@ game.register_mob("slime_fire", {
speed = 30,
}
},
})
game.register_mob("bat", {
hp = 10,
mesh = "monsters_bat.b3d",
texture = "monsters_bat.png",
view_range = 25,
speed = 5,
attack_capabilities = {
damage_groups = {fleshy = 4}
},
reach = 1.5,
face_offset = 0,
on_die = game.on_monster_death,
drops = {
["xp:xp 2"] = 1,
},
animations = {
walk = {
range = {x = 1, y = 40},
speed = 66,
},
idle = {
range = {x = 1, y = 40},
speed = 66,
},
attack = {
range = {x = 1, y = 40},
speed = 66,
}
},
selectionbox = {-0.4, 1.1, -0.4, 0.4, 1.6, 0.4},
collisionbox = {-0.4, -0.5, -0.4, 0.4, 1.6, 0.4},
})

Binary file not shown.

After

Width:  |  Height:  |  Size: 264 B