From 77325b92fbe8235b5c2d8d1261ecd53e3385bab2 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sun, 24 Apr 2022 21:48:50 +0000 Subject: [PATCH] DevTest: Add more test weapons and armorball modes (#11870) Co-authored-by: sfan5 --- games/devtest/mods/basetools/init.lua | 105 ++++++++++++++++-- .../textures/basetools_bloodsword.png | Bin 0 -> 225 bytes .../textures/basetools_elementalsword.png | Bin 0 -> 252 bytes .../textures/basetools_healdagger.png | Bin 0 -> 262 bytes .../textures/basetools_healsword.png | Bin 0 -> 229 bytes .../textures/basetools_mesesword.png | Bin 0 -> 225 bytes .../textures/basetools_superhealsword.png | Bin 0 -> 272 bytes .../textures/basetools_titaniumsword.png | Bin 0 -> 225 bytes .../basetools/textures/basetools_usespick.png | Bin 0 -> 230 bytes .../textures/basetools_usessword.png | Bin 0 -> 248 bytes .../textures/basetools_wooddagger.png | Bin 0 -> 248 bytes games/devtest/mods/testentities/armor.lua | 30 ++++- .../textures/testentities_armorball.png | Bin 561 -> 1301 bytes .../mods/unittests/itemdescription.lua | 28 ++--- .../textures/unittests_description_test.png | Bin 0 -> 268 bytes 15 files changed, 129 insertions(+), 34 deletions(-) create mode 100644 games/devtest/mods/basetools/textures/basetools_bloodsword.png create mode 100644 games/devtest/mods/basetools/textures/basetools_elementalsword.png create mode 100644 games/devtest/mods/basetools/textures/basetools_healdagger.png create mode 100644 games/devtest/mods/basetools/textures/basetools_healsword.png create mode 100644 games/devtest/mods/basetools/textures/basetools_mesesword.png create mode 100644 games/devtest/mods/basetools/textures/basetools_superhealsword.png create mode 100644 games/devtest/mods/basetools/textures/basetools_titaniumsword.png create mode 100644 games/devtest/mods/basetools/textures/basetools_usespick.png create mode 100644 games/devtest/mods/basetools/textures/basetools_usessword.png create mode 100644 games/devtest/mods/basetools/textures/basetools_wooddagger.png create mode 100644 games/devtest/mods/unittests/textures/unittests_description_test.png diff --git a/games/devtest/mods/basetools/init.lua b/games/devtest/mods/basetools/init.lua index fd83b82eb..3ec69d39f 100644 --- a/games/devtest/mods/basetools/init.lua +++ b/games/devtest/mods/basetools/init.lua @@ -279,50 +279,135 @@ minetest.register_tool("basetools:sword_wood", { }) minetest.register_tool("basetools:sword_stone", { description = "Stone Sword".."\n".. - "Damage: fleshy=4", + "Damage: fleshy=5", inventory_image = "basetools_stonesword.png", tool_capabilities = { full_punch_interval = 1.0, max_drop_level=0, - damage_groups = {fleshy=4}, + damage_groups = {fleshy=5}, } }) minetest.register_tool("basetools:sword_steel", { description = "Steel Sword".."\n".. - "Damage: fleshy=6", + "Damage: fleshy=10", inventory_image = "basetools_steelsword.png", tool_capabilities = { full_punch_interval = 1.0, max_drop_level=1, - damage_groups = {fleshy=6}, + damage_groups = {fleshy=10}, + } +}) +minetest.register_tool("basetools:sword_titanium", { + description = "Titanium Sword".."\n".. + "Damage: fleshy=100", + inventory_image = "basetools_titaniumsword.png", + tool_capabilities = { + full_punch_interval = 1.0, + max_drop_level=1, + damage_groups = {fleshy=100}, + } +}) +minetest.register_tool("basetools:sword_blood", { + description = "Blood Sword".."\n".. + "Damage: fleshy=1000", + inventory_image = "basetools_bloodsword.png", + tool_capabilities = { + full_punch_interval = 1.0, + max_drop_level=1, + damage_groups = {fleshy=1000}, + } +}) + +-- Max. damage sword +minetest.register_tool("basetools:sword_mese", { + description = "Mese Sword".."\n".. + "Damage: fleshy=32767, fiery=32767, icy=32767".."\n".. + "Full Punch Interval: 0.0s", + inventory_image = "basetools_mesesword.png", + tool_capabilities = { + full_punch_interval = 0.0, + max_drop_level=1, + damage_groups = {fleshy=32767, fiery=32767, icy=32767}, } }) -- Fire/Ice sword: Deal damage to non-fleshy damage groups minetest.register_tool("basetools:sword_fire", { description = "Fire Sword".."\n".. - "Damage: icy=6", + "Damage: icy=10", inventory_image = "basetools_firesword.png", tool_capabilities = { full_punch_interval = 1.0, max_drop_level=0, - damage_groups = {icy=6}, + damage_groups = {icy=10}, } }) minetest.register_tool("basetools:sword_ice", { description = "Ice Sword".."\n".. - "Damage: fiery=6", + "Damage: fiery=10", inventory_image = "basetools_icesword.png", tool_capabilities = { full_punch_interval = 1.0, max_drop_level=0, - damage_groups = {fiery=6}, + damage_groups = {fiery=10}, } }) +minetest.register_tool("basetools:sword_elemental", { + description = "Elemental Sword".."\n".. + "Damage: fiery=10, icy=10", + inventory_image = "basetools_elementalsword.png", + tool_capabilities = { + full_punch_interval = 1.0, + max_drop_level=0, + damage_groups = {fiery=10, icy=10}, + } +}) + +-- Healing weapons: heal HP +minetest.register_tool("basetools:dagger_heal", { + description = "Healing Dagger".."\n".. + "Heal: fleshy=1".."\n".. + "Full Punch Interval: 0.5s", + inventory_image = "basetools_healdagger.png", + tool_capabilities = { + full_punch_interval = 0.5, + damage_groups = {fleshy=-1}, + } +}) +minetest.register_tool("basetools:sword_heal", { + description = "Healing Sword".."\n".. + "Heal: fleshy=10", + inventory_image = "basetools_healsword.png", + tool_capabilities = { + full_punch_interval = 1.0, + damage_groups = {fleshy=-10}, + } +}) +minetest.register_tool("basetools:sword_heal_super", { + description = "Super Healing Sword".."\n".. + "Heal: fleshy=32768, fiery=32768, icy=32768", + inventory_image = "basetools_superhealsword.png", + tool_capabilities = { + full_punch_interval = 1.0, + damage_groups = {fleshy=-32768, fiery=-32768, icy=-32768}, + } +}) + -- -- Dagger: Low damage, fast punch interval -- +minetest.register_tool("basetools:dagger_wood", { + description = "Wooden Dagger".."\n".. + "Damage: fleshy=1".."\n".. + "Full Punch Interval: 0.5s", + inventory_image = "basetools_wooddagger.png", + tool_capabilities = { + full_punch_interval = 0.5, + max_drop_level=0, + damage_groups = {fleshy=1}, + } +}) minetest.register_tool("basetools:dagger_steel", { description = "Steel Dagger".."\n".. "Damage: fleshy=2".."\n".. @@ -343,7 +428,7 @@ for i=1, #uses do minetest.register_tool("basetools:pick_uses_"..string.format("%05d", u), { description = u.."-Uses Pickaxe".."\n".. "Digs cracky=3", - inventory_image = "basetools_steelpick.png^[colorize:"..color..":127", + inventory_image = "basetools_usespick.png^[colorize:"..color..":127", tool_capabilities = { max_drop_level=0, groupcaps={ @@ -355,7 +440,7 @@ for i=1, #uses do minetest.register_tool("basetools:sword_uses_"..string.format("%05d", u), { description = u.."-Uses Sword".."\n".. "Damage: fleshy=1", - inventory_image = "basetools_woodsword.png^[colorize:"..color..":127", + inventory_image = "basetools_usessword.png^[colorize:"..color..":127", tool_capabilities = { damage_groups = {fleshy=1}, punch_attack_uses = u, diff --git a/games/devtest/mods/basetools/textures/basetools_bloodsword.png b/games/devtest/mods/basetools/textures/basetools_bloodsword.png new file mode 100644 index 0000000000000000000000000000000000000000..047adfef76c8b10abfed65b2916096c176624d62 GIT binary patch literal 225 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFL9FD0c~PGJXGS!-$OBzAsf0Rd4iu7F8< zqJb(HOM?7@862M7NCR<_yxm>6GA?`x19EIUT^vIy<|HRLus&rKm=()YT$Opb%$) zM`SSr1Gg{;GcwGYBLNiD4e$wZUApWikhy#J{|y`d|L>{%Rr30O&inrjIn$^A{}K4~ zzZyeiK_CtX{)l4Npe!&b3Ws}cZ0C|i_-tI2^61x~~0y*xUE{-7; zamfh|tgF==GW52yaU^>dF^3#rTFr2sX$3>LsEb3u2TLGPu%0bq>4GnFy#*$2XSY1S nbJBvbBXN@OLLNs)4rYcA4}_9aH%^ZN8p+`4>gTe~DWM4fb-hnv literal 0 HcmV?d00001 diff --git a/games/devtest/mods/basetools/textures/basetools_healdagger.png b/games/devtest/mods/basetools/textures/basetools_healdagger.png new file mode 100644 index 0000000000000000000000000000000000000000..f1ceaeb432ff4c002e436aedd60ec31dc64893d0 GIT binary patch literal 262 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPF8d@ zBeIx*fm;}a85w5HkpK#61^9%x&U!Y(|B8=Xi40Hx$Zmbu4CL0;)fM<@00lifJYsEC zoRl~!|L~cLG7Yv@RelF{r5}E)-fJ`g^ literal 0 HcmV?d00001 diff --git a/games/devtest/mods/basetools/textures/basetools_healsword.png b/games/devtest/mods/basetools/textures/basetools_healsword.png new file mode 100644 index 0000000000000000000000000000000000000000..e9d6dafee35f16c2c8235e0f262e16a6535ac2ed GIT binary patch literal 229 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPF?tE(&U(~v8X@$m47wN-Ia;?xvj z{l<3TGf)v@NswPKgTu2MX&_FLx4R3s{PiOTfE-&-7srr_xa0%})=W-;S-ujdJWTu= zxMn1ZCU`e+ZCH6QM5k$0LPtpRg*C=%jxJ$l8yY3w#09**!7UNM$iQI4tzXB^tP3=V N!PC{xWt~$(698|#KK%dy literal 0 HcmV?d00001 diff --git a/games/devtest/mods/basetools/textures/basetools_mesesword.png b/games/devtest/mods/basetools/textures/basetools_mesesword.png new file mode 100644 index 0000000000000000000000000000000000000000..2aecc167c07ad3a906c123584cc4e51ab620d949 GIT binary patch literal 225 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFGiGhHcvz`uiE`>go#oG(0>!Vr^BNlsGj-SX~lI z_W@NfmIV0)GdMiEkp|)?=Koi$v!2apec0@O#iy>WuE0-2u0+Pe!z0#K z#Yu@%Q-sxW_s*X{bxb8ee!&b3Ws}cZ0C|i_-tI2E-?k)v1#%KST^vIy;#5x=3N{!B zxLllTaU*!bg#wO_c8L=_N(Bz$Qdues8oOrk1@p{ad+)EM!2dQ5#W!mY7rWocYJVPS z&y~=@wZNS9LN`-}f3AvSw71By-$5I{mn23_Qhm69ZLW%a&3aMg8}paV16s!5>FVdQ I&MBb@0Ql%uB>(^b literal 0 HcmV?d00001 diff --git a/games/devtest/mods/basetools/textures/basetools_titaniumsword.png b/games/devtest/mods/basetools/textures/basetools_titaniumsword.png new file mode 100644 index 0000000000000000000000000000000000000000..f34ab9f4dedd89cc6e70c9b346a7d9699e20b948 GIT binary patch literal 225 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPF8d@ zBeIx*fm;}a85w5HkpK$H1^9%x0_j9$Edv9CKzS`)U0oFw6?u7iOAa9*P+{Q_exWP_ zRKZvh-K7*Y|JoZ!GJ%PTO;S@cu}SF3?Vi1G%m z0uu*T3!4P3We%YR9n}sQ#~ulFoG4-D>$v69!NT0q&BE{^ig(iNa~jKl<}i4=`njxg HN@xNAmHjr~ literal 0 HcmV?d00001 diff --git a/games/devtest/mods/basetools/textures/basetools_usespick.png b/games/devtest/mods/basetools/textures/basetools_usespick.png new file mode 100644 index 0000000000000000000000000000000000000000..5aa3a960c6c7f50e149d4650638b49b067315fad GIT binary patch literal 230 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPF8d@ zBeIx*fm;}a85w5HkpK!x1o(uw0_itz-n@SO`plU#Cr_S?wN-Ia;sgrDUD^B(NHLZK z`2{mLJiCzw;v{*yyReHTcDx31+&x_!Ln;_q4>}4q81OJ`u-W!{y5#|8Hnwo?FR|h` z)EN&%FW#Rg`kkMY|IY;A?D;^-r O7(8A5T-G@yGywq4=|(sJ literal 0 HcmV?d00001 diff --git a/games/devtest/mods/basetools/textures/basetools_usessword.png b/games/devtest/mods/basetools/textures/basetools_usessword.png new file mode 100644 index 0000000000000000000000000000000000000000..9742b9b8157c826823f3a4f3faeabae46e970061 GIT binary patch literal 248 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPF%cSa8DPwsn>;HD({X)+G3|DH~+K4m+!APl;663^j@Xd cpE8DjH-jZJ(hr+{1X{u1>FVdQ&MBb@0NB+@Y5)KL literal 0 HcmV?d00001 diff --git a/games/devtest/mods/basetools/textures/basetools_wooddagger.png b/games/devtest/mods/basetools/textures/basetools_wooddagger.png new file mode 100644 index 0000000000000000000000000000000000000000..67e37ee71313fae84c30a60d40a2861273e45479 GIT binary patch literal 248 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPF6`a978JNk`3CJ*f^Fh;YpM*bduz15@-`#Ea1}Hw7_Tv zqmV(Gfmx8Aeh8c4shfAZ4m_JOWr=9Bh&0+W4%xTYNB*=|s7aM4MBVW literal 0 HcmV?d00001 diff --git a/games/devtest/mods/testentities/armor.lua b/games/devtest/mods/testentities/armor.lua index 306953d50..3887c75fd 100644 --- a/games/devtest/mods/testentities/armor.lua +++ b/games/devtest/mods/testentities/armor.lua @@ -4,10 +4,19 @@ local phasearmor = { [0]={icy=100}, [1]={fiery=100}, - [2]={fleshy=100}, - [3]={immortal=1}, - [4]={punch_operable=1}, + [2]={icy=100, fiery=100}, + [3]={fleshy=-100}, + [4]={fleshy=1}, + [5]={fleshy=10}, + [6]={fleshy=50}, + [7]={fleshy=100}, + [8]={fleshy=200}, + [9]={fleshy=1000}, + [10]={fleshy=32767}, + [11]={immortal=1}, + [12]={punch_operable=1}, } +local max_phase = 12 minetest.register_entity("testentities:armorball", { initial_properties = { @@ -21,7 +30,7 @@ minetest.register_entity("testentities:armorball", { initial_sprite_basepos = {x=0, y=0}, }, - _phase = 2, + _phase = 7, on_activate = function(self, staticdata) minetest.log("action", "[testentities] armorball.on_activate") @@ -32,10 +41,21 @@ minetest.register_entity("testentities:armorball", { on_rightclick = function(self, clicker) -- Change armor group and sprite self._phase = self._phase + 1 - if self._phase >= 5 then + if self._phase >= max_phase + 1 then self._phase = 0 end self.object:set_sprite({x=0, y=self._phase}) self.object:set_armor_groups(phasearmor[self._phase]) end, + + on_punch = function(self, puncher, time_from_last_punch, tool_capabilities, dir, damage) + if not puncher then + return + end + local name = puncher:get_player_name() + if not name then + return + end + minetest.chat_send_player(name, "time_from_last_punch="..string.format("%.3f", time_from_last_punch).."; damage="..tostring(damage)) + end, }) diff --git a/games/devtest/mods/testentities/textures/testentities_armorball.png b/games/devtest/mods/testentities/textures/testentities_armorball.png index 88147bd1f77c3cb377158ee2df87f547f0b795f7..ffe33fbade7a0d39a543f1ef29f2f4057183ed7d 100644 GIT binary patch literal 1301 zcmXw2X;71A5Z-+6mjp1FKu8I(nyBE3h(bGosWgP3gv)SQP>7g@h=`g1RcZhO2tuiH z$#l3QC@3f@U^(RQLP6zFT7o8O>rqfHMZ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