From 8a7dcafe778ebd430b4acc5b8584d0108145a448 Mon Sep 17 00:00:00 2001 From: IamPyu Date: Thu, 19 Dec 2024 14:15:22 -0600 Subject: [PATCH] Improve projectiles, hunger timer max 135 -> 200 --- mods/ENTITIES/pyutest_projectiles/api.lua | 13 +++++++++---- mods/PLAYER/pyutest_effects/init.lua | 2 +- mods/PLAYER/pyutest_hunger/init.lua | 3 ++- mods/WORLD/pyutest_mapgen/api.lua | 9 ++++++++- textures/pyutest-cooked-pork.png | Bin 233 -> 233 bytes 5 files changed, 20 insertions(+), 7 deletions(-) diff --git a/mods/ENTITIES/pyutest_projectiles/api.lua b/mods/ENTITIES/pyutest_projectiles/api.lua index 0d58b57..d515580 100644 --- a/mods/ENTITIES/pyutest_projectiles/api.lua +++ b/mods/ENTITIES/pyutest_projectiles/api.lua @@ -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) diff --git a/mods/PLAYER/pyutest_effects/init.lua b/mods/PLAYER/pyutest_effects/init.lua index 80c3e1c..f5c811c 100644 --- a/mods/PLAYER/pyutest_effects/init.lua +++ b/mods/PLAYER/pyutest_effects/init.lua @@ -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 }) diff --git a/mods/PLAYER/pyutest_hunger/init.lua b/mods/PLAYER/pyutest_hunger/init.lua index 07e5b08..3a91998 100644 --- a/mods/PLAYER/pyutest_hunger/init.lua +++ b/mods/PLAYER/pyutest_hunger/init.lua @@ -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 diff --git a/mods/WORLD/pyutest_mapgen/api.lua b/mods/WORLD/pyutest_mapgen/api.lua index 6d2f191..e65d1e9 100644 --- a/mods/WORLD/pyutest_mapgen/api.lua +++ b/mods/WORLD/pyutest_mapgen/api.lua @@ -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", diff --git a/textures/pyutest-cooked-pork.png b/textures/pyutest-cooked-pork.png index fbd5d36b85dfa53cc328c9fd3248fa64ffc01a24..af9e3df143b61a1bd9b580490da47df19b65527c 100644 GIT binary patch delta 195 zcmV;!06hQc0qFsdE`Je&FbqW>xil_(9>^^P1F!*eu|Wo)pk*MAg3_t%vxGw65_Piw z|N37(!;jV6z$S}(RUi#rD-OnK2525P9GG=QAPrs1y6xuW^BcL35rE*GDRQ=hl6&2D zf_DeNIL#j;2-|tOSB0NQr&t~k&lb%fN%D1e$&$H>o^1w4x78f5hVuVpF2#SZkQ xt-dB(I}o|Gh$bH#XpuU*Mb-!Uvz%f7S8sL(Suf}B<97f6002ovPDHLkV1m+`SqT6D delta 195 zcmV;!06hQc0qFsdE`Jq+FbqULd1+L6APO1^24Dl`VuK7oL6af_QMq&~`^iEf@Dg>h z?@o8}GyGW11#I%TX9dzU^wq(R8DGscNj*!N#t$>!KW8`Pd0zAdC26;We