Improve projectiles, hunger timer max 135 -> 200
This commit is contained in:
parent
86bcc9f073
commit
8a7dcafe77
@ -1,5 +1,6 @@
|
||||
local class = {
|
||||
_owner = nil
|
||||
_owner = nil,
|
||||
_collided = false
|
||||
}
|
||||
|
||||
function class:on_step(dtime, moveresult)
|
||||
@ -18,13 +19,17 @@ function class:on_step(dtime, moveresult)
|
||||
|
||||
for _, v in pairs(moveresult.collisions) do
|
||||
if v.type == "node" then
|
||||
self._collided = true
|
||||
self:_on_hit_node(v.node_pos, core.get_node(v.node_pos))
|
||||
self.object:remove()
|
||||
elseif v.type == "object" then
|
||||
self._collided = true
|
||||
self:_on_hit_object(v.object)
|
||||
self.object:remove()
|
||||
end
|
||||
end
|
||||
|
||||
if self._collided then
|
||||
self.object:remove()
|
||||
end
|
||||
end
|
||||
|
||||
PyuTest.make_projectile = function (name, properties, options, functions)
|
||||
@ -58,7 +63,7 @@ PyuTest.shoot_projectile_from_object = function(name, object, velocity)
|
||||
|
||||
if object:is_player() then
|
||||
local dir = object:get_look_dir()
|
||||
|
||||
|
||||
pos = vector.add(pos, dir)
|
||||
|
||||
local projectile = core.add_entity(pos, name)
|
||||
|
@ -63,7 +63,7 @@ core.register_globalstep(function ()
|
||||
local gravity = 1 * PyuTest.status_effect_get(name, "low_gravity")
|
||||
|
||||
v:set_physics_override({
|
||||
speed = 1.15 * speed_multiplier,
|
||||
speed = 1 * speed_multiplier,
|
||||
jump = 1 * jump_boost,
|
||||
gravity = 1 * gravity
|
||||
})
|
||||
|
@ -1,4 +1,5 @@
|
||||
PyuTest.HUNGER_MAX = 20
|
||||
PyuTest.HUNGER_RUNOUT = 200
|
||||
|
||||
local storage = core.get_mod_storage()
|
||||
local hungers = core.deserialize(storage:get("player_hungers")) or {}
|
||||
@ -83,7 +84,7 @@ core.register_globalstep(function (dtime)
|
||||
timers[name].damage = timers[name].damage + 5 * dtime
|
||||
timers[name].health = timers[name].health + 8 * dtime
|
||||
|
||||
if timers[name].hunger > 135 then
|
||||
if timers[name].hunger > PyuTest.HUNGER_RUNOUT then
|
||||
PyuTest.hunger_add(name, -2)
|
||||
timers[name].hunger = 0
|
||||
end
|
||||
|
@ -173,7 +173,13 @@ PyuTest.register_overworld_biome = function(name, type, opts, only_base)
|
||||
nopts["_enable_beaches"] = true
|
||||
end
|
||||
|
||||
local y_min = (nopts["_enable_beaches"] and not only_base) and (nopts["y_min"] + 2) or nopts["y_min"]
|
||||
local y_min --(nopts["_enable_beaches"] and not only_base) and (nopts["y_min"] + 2) or nopts["y_min"]
|
||||
if nopts["_enable_beaches"] and not only_base then
|
||||
y_min = nopts["y_min"] + 2
|
||||
else
|
||||
y_min = opts["y_min"]
|
||||
end
|
||||
y_min = y_min + 1
|
||||
|
||||
core.register_biome(PyuTest.util.tableconcat(nopts, {
|
||||
_pyutest_biome_type = type,
|
||||
@ -184,6 +190,7 @@ PyuTest.register_overworld_biome = function(name, type, opts, only_base)
|
||||
return
|
||||
end
|
||||
|
||||
core.log(string.format("%s: %d", name, y_min))
|
||||
if nopts["_enable_beaches"] then
|
||||
core.register_biome(PyuTest.util.tableconcat(nopts, {
|
||||
name = name .. "_beach",
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 233 B After Width: | Height: | Size: 233 B |
Loading…
x
Reference in New Issue
Block a user