From 274c8f1261f62d965909af5a4310b9cf777ca1ce Mon Sep 17 00:00:00 2001 From: IamPyu Date: Sat, 7 Dec 2024 15:47:51 -0600 Subject: [PATCH] Pigs now spawn naturally, new hudbar textures, and add healing information to foods --- CHANGELOG.md | 2 +- mods/ENTITIES/pyutest_mobs/init.lua | 13 ++++++++++++- mods/ITEMS/pyutest_tools/api.lua | 2 +- mods/PLAYER/pyutest_hud/init.lua | 6 ++++-- textures/pyutest-bubble-empty.png | Bin 0 -> 145 bytes textures/pyutest-bubble.png | Bin 0 -> 163 bytes textures/pyutest-heart-empty.png | Bin 0 -> 162 bytes textures/pyutest-heart.png | Bin 0 -> 187 bytes textures/pyutest-pig.png | Bin 676 -> 668 bytes 9 files changed, 18 insertions(+), 5 deletions(-) create mode 100644 textures/pyutest-bubble-empty.png create mode 100644 textures/pyutest-bubble.png create mode 100644 textures/pyutest-heart-empty.png create mode 100644 textures/pyutest-heart.png diff --git a/CHANGELOG.md b/CHANGELOG.md index af21550..1edd7b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,7 +36,7 @@ Other Game Changes: - Make crop hitbox smaller - Fireworks now damage entities when they're too close to the explosion - Added new damage types `fireworks` and `projectile` - +- Add healing information to food descriptions Code Changes: diff --git a/mods/ENTITIES/pyutest_mobs/init.lua b/mods/ENTITIES/pyutest_mobs/init.lua index 573cf0f..28761a9 100644 --- a/mods/ENTITIES/pyutest_mobs/init.lua +++ b/mods/ENTITIES/pyutest_mobs/init.lua @@ -1,7 +1,6 @@ local modpath = core.get_modpath("pyutest_mobs") mobs.fallback_node = "pyutest_blocks:dirt_block" - dofile(modpath .. "/api.lua") dofile(modpath .. "/basic.lua") @@ -47,6 +46,18 @@ if not PyuTest.is_flat() then day_toggle = true, }) + mobs:spawn({ + name = "pyutest_mobs:pig", + nodes = { "group:ground" }, + interval = 3, + chance = 4, + active_object_count = 7, + min_light = 9, + max_light = 15, + min_height = PyuTest.OVERWORLD_SURFACE_BOTTOM, + day_toggle = true, + }) + mobs:spawn({ name = "pyutest_mobs:mimic", nodes = { "group:ground" }, diff --git a/mods/ITEMS/pyutest_tools/api.lua b/mods/ITEMS/pyutest_tools/api.lua index 8946dbd..4529b65 100644 --- a/mods/ITEMS/pyutest_tools/api.lua +++ b/mods/ITEMS/pyutest_tools/api.lua @@ -50,7 +50,7 @@ PyuTest.make_sword = function(nsname, desc, texture, damage, durability, atkspee end PyuTest.make_food = function(nsname, desc, wield_image, health_fill, cook_into, extra_code) - PyuTest.make_item(nsname, desc, { + PyuTest.make_item(nsname, desc .. string.format("\nHeals %d health", health_fill), { food = 1 }, wield_image, { on_use = function(itemstack, user, pt) diff --git a/mods/PLAYER/pyutest_hud/init.lua b/mods/PLAYER/pyutest_hud/init.lua index 1e9bb50..e308afb 100644 --- a/mods/PLAYER/pyutest_hud/init.lua +++ b/mods/PLAYER/pyutest_hud/init.lua @@ -52,7 +52,8 @@ local enable_damage = core.settings:get_bool("enable_damage") if enable_damage then PyuTest.Hudbar:add("health", { - text = "pyutest-bar-health.png", + text = "pyutest-heart.png", + text2 = "pyutest-heart-empty.png", number = core.PLAYER_MAX_HP_DEFAULT, item = core.PLAYER_MAX_HP_DEFAULT, }, function (idx, player) @@ -60,7 +61,8 @@ if enable_damage then end) PyuTest.Hudbar:add("breath", { - text = "pyutest-bar-breath.png", + text = "pyutest-bubble.png", + text2 = "pyutest-bubble-empty.png", number = core.PLAYER_MAX_BREATH_DEFAULT, item = core.PLAYER_MAX_BREATH_DEFAULT, }, function (idx, player) diff --git a/textures/pyutest-bubble-empty.png b/textures/pyutest-bubble-empty.png new file mode 100644 index 0000000000000000000000000000000000000000..a4185ec626670f5357e4ef49fd0765a35bd02981 GIT binary patch literal 145 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`5uPrNAr`%FC++5CP~dR!pPu-? zaE6<#UPhmfcs6pbSMe2SGWE<07LnV1^F`|? tRwo6&$8KfwZG$`>?JZI_Tx9rsW#wcUF^SSkVL&?=JYD@<);T3K0RRd$Fd6^= literal 0 HcmV?d00001 diff --git a/textures/pyutest-bubble.png b/textures/pyutest-bubble.png new file mode 100644 index 0000000000000000000000000000000000000000..8b712bf83904ca80817b96f65dedb455107cc840 GIT binary patch literal 163 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`S)MMAAr`&K2@3=ak_3PIcgdA7 z|1&l)Fz}gEEV=sJACXv|+7oOKuJ)W3P>Y%M_KeF$sfH!b>^Ct=%;KM0)q7d=MApm; zs+^f_>=JAf7D=vVT+-y2!VvUFh~-3$tax@)S&)(6WGK z`=q@-r9b08+)|vT;(vXI%1qlOA(sx%OqgI%p~~+0yVGk@&S#c~Y{oUqg?35+EoJa@ L^>bP0l+XkK-rTcN}q-Ia(y(@KP_SP%82XiM4)RJJYD@<);T3K0RT&LK#>3d literal 0 HcmV?d00001 diff --git a/textures/pyutest-pig.png b/textures/pyutest-pig.png index 6cb810f7eac60c0c955f1b3d853389efd39616be..24f355b07278107c4a2fedceb54e86b61b6d4002 100644 GIT binary patch delta 644 zcmV-~0($Utq zy;RT^OO%%zIiIjLMWt}<;z;QvBAX$~A*Pj7tI`Iwf~Rz-;uSC#7Jf3XvZyKzgVH(_ z-XE(8tQwG$sM4BY>19dk8Uq#qCBe;CinM~jPfC145pX*H!Zc0rykDb^P2&K^?;mi^!Q*y8J1`$#^1BpJ zUEp!M!1I31K8@%7nhaihuRv+Bs};c-2di_im0<0i-V!8~VUZBZO}0glx&Wn0TNO`e z0>S{S27OeDx5B^`7*YbI)NT$eCCIJdnDMCqLy_dV9*&=1tdFEUHX(&I(+x!c*8%F2 zPucV1xSz|L+6^wHN-ll41RVS%C4xfwI)*j0MfDoMeS%!<{u`m)6HvVf)=q(jhK7cQ ehK7cQz2Xl_UOcPx%UP(kjRCt{2T1!&HFbuUjKyQ(m+yr)T zitag3S(j6=>awoX{$okmI#BW!KW$DF|o*i35#PxJ^R2vlR5AT*T{(;XG zW9&48o^zKo=d>j3xC}vquYFb;Yy_+o>ItyZEV^RU5)cM1MSlVd0T}0UV^aTuh6Kh|%qLRAbpFs+ zcR5FG@0J6w4u4`01|qfZ_cl|uQC&dOkro8G6uuDvU0UvP7D)rB-CFWXHt*VCYJ%1$ zxsVFZfx9lC<;c2~AE1v4(qakoaiioD)F!JG?p+))orGmGggM02l4@Prpj7af4pqGZ zmcqhM=2aF}r9n_zhr;JmHGxzEN)nY@GsHfYc_Uqt_E?1! zmP|Jg0aORDZ$4+wkE33fSG60ArAjG%s08c`LQru3PN9Xi=w1V;Z;*=3-x1n80o{vW n?-Upq7#J8B7#JAXD*gb0C^`FpnmgtI0000