From fc1fd99541d8caec0db604af90068a4ac9de8c0d Mon Sep 17 00:00:00 2001 From: echoes91 Date: Sun, 19 Apr 2020 21:53:10 +0200 Subject: [PATCH] Refinements and new textures --- README.txt | 7 +++++-- functions.lua | 9 +++++++-- textures/spears_spear_bronze.png | Bin 247 -> 227 bytes textures/spears_spear_copper.png | Bin 256 -> 266 bytes textures/spears_spear_diamond.png | Bin 272 -> 232 bytes textures/spears_spear_gold.png | Bin 0 -> 200 bytes textures/spears_spear_obsidian.png | Bin 276 -> 223 bytes textures/spears_spear_steel.png | Bin 273 -> 221 bytes textures/spears_spear_stone.png | Bin 277 -> 252 bytes tools.lua | 6 +++++- 10 files changed, 17 insertions(+), 5 deletions(-) create mode 100644 textures/spears_spear_gold.png diff --git a/README.txt b/README.txt index b66d590..ec772ba 100644 --- a/README.txt +++ b/README.txt @@ -12,18 +12,21 @@ Spears can be used to fight, but are slower and weaker than swords. Spears can be used to dig, but are slower and weaker and pickaxes. You can grab a spear on the fly (or maybe wait until it falls). If you feel even clever, throw a spear right above you and look at it to see what happens. -Someone was reported to have hit its own foot but it takes practice. +Someone once reported to have hit its own foot but it takes practice. CHANGELOG 2.0: - Cleaned, streamlined code without deprecated functions +- Spears hurt players - Spears animated in flight - Spears stick into nodes - New sound when hitting flesh - Changed receipt to fit with default tools -- +- New textures +- Drag depends on fluid +- New gold-plated spear to celebrate 1.1: - Make use of new on_secondary_use API, requires Minetest 5.2.0 diff --git a/functions.lua b/functions.lua index 8be4c87..8eec4e6 100644 --- a/functions.lua +++ b/functions.lua @@ -38,12 +38,17 @@ function spears_set_entity(spear_type, base_damage, toughness) initial_properties = { physical = false, visual = "item", - visual_size = {x = 0.3, y = 0.3, z = 0.3}, + visual_size = {x = 0.5, y = 0.5, z = 0.5}, wield_item = "spears:spear_" .. spear_type, collisionbox = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, + automatic_rotate = 10, }, - on_punch = function(self, puncher) + on_activate = function (self, staticdata, dtime_s) + self.object:set_armor_groups({immortal = 1}) + end, + + on_punch = function (self, puncher) if puncher:is_player() then local stack = {name='spears:spear_' .. spear_type, wear = self._wear} local inv = puncher:get_inventory() diff --git a/textures/spears_spear_bronze.png b/textures/spears_spear_bronze.png index 3993e457ba172f7f7fa6846e9afc84b0acf10f4c..e10ad94419f98db459560b88523b687ddcccd40f 100644 GIT binary patch delta 183 zcmV;o07(D$0pkIXG=G{&L_t(IjbnINZt#DaAOC*_G6B=P{g)ZMH5C~sF@&MsjQKyz zC97h@$ukIMNT8(*Nd_>%7|*}{XNX$&fI(W|I|C_(Fro`ss|x%#RAFX#`hk;S{qZLl z@&pYa#}KT*T2+9kFu`j&F)ktKJVJ&LZrNj+zQM`SSr1Gg{;GcwGYBf-GHFw@h;F~p)bxgsL(L;WoI|NoaU?f=h{ z!mzCJx4yB#j0)p|!cB$~k~uC{^H#UH``;<}#!PC{xWt~$(69A(^ BNs|Bo diff --git a/textures/spears_spear_copper.png b/textures/spears_spear_copper.png index 56b1ff9f9acd0295f5a845c9876a3f45f85b0b55..92890001d928810f6c2ed143efd267c5aac8f597 100644 GIT binary patch delta 222 zcmV<403rW?0*V5VG=ITKL_t(IjbnH?Dfa)0GVlKkWCEsn2d*<%$_O!#YX~C)0|P^S zkjeif2Tg|KPu?-S`}mn5Yvv(FVhvznU|?WqTz7_%fq~(_xF{FH?o0Pbasd;J@$k)O zhNb&1F-Qx1X9%>EA=*0_PPJAQ_;0Af%<%LBC&T*VPY8Mit5*V24Z#YmRR#V(oD}1Rv^C!=ds-J<8 zfq{V`FV5-z+2iLJ3{{vJo_^qDSbzKp(OyAOXss&npHxFI6itz82v!B87=lxhSVQod zPK+T0{Yc0VqCy&-+fiC&);w0Zb5MSQx#bnh&_^lH>v=IP2_LhE>Lj4AKJM z83HY3i1rSKQ>|46{u`<=Gd%sk$*}(T6M|mBs(@5OumWpUfkpoe|Ns0a9CSm-@(;`qxos~=cL5wgGavvCB3_S;ImkW$0000JNR5;6H*!us^|E~Xk{x=o){bwKpFnKdDFz__T zF>rCRF_2>jQ(n9q!=tC~7`Qmu7|x$ON3shT85kHC^5UHSpKU#Uj=@lcnc?XNPKNcz zpD>bS01Q~G3j8P45DZ168iG{;DTd&bB-RkTrW0cbK|c~Qgs70lX9&^pjmr>5Qc@i@ uLl{X-y6A>5l9L0G4I#?_m>~=d3=9AqZe4GW1{vl600003%dsB(V6e{qR_^;J*4*k1^0Q*oY=&~rXsQo?5L zc|#BGn)D97THk5P5_YnwKl0aVefa<1ee(atX+}@lPhK!;nJD4R6FNh3UfqL~i26UA uZBDHzw{E&DGZ*jelF{r5}E)F3`sHo literal 0 HcmV?d00001 diff --git a/textures/spears_spear_obsidian.png b/textures/spears_spear_obsidian.png index 6ec0ab4ddfba5dc5db816eeaa9343c1900624609..add0bf6e8561b56438856a6dc2730657ac23bb89 100644 GIT binary patch delta 195 zcmV;!06hPc0^b3UB!2{RLP=Bz2nYy#2xN!=005RrL_t(Ijbo6Pm;Wy!BJ!Vs0`Q+| zhGZrBl57YQlxFmH(qmAP6=opS5JqH9R-*5JrWeN;o_^qDSbzKpBQ8xi4PankV6avd z_;0AfOtc|b6_8>GPDx@7!D~7(h7j~4Aw!4?X?%tdWdJ@yh&(m`mmwq>fXxsVQVlqI x`vW5bgTQ}7mG2Dv{QUn(b^#LjFE208006A`Q%YG!6&?Tp002ovPDHLkV1gt`NW%aC delta 248 zcmV}i=l49CPq>WV9JYgVtDlQ9Rn998^igN=g4vaLvdc5)Bm%_&oLOPFf%;; zz{#-w_!CBw41fV^Re}Gc8iJvSR70>TAjJ@zlEfN<*K}eGA?Qa!h7c9f_zWRBzHu2s yQnJNn2qURU7u^s>a&jQDA!Hcscy6}L#`io+Bo1}xC9Ku@a6h1R=EIll zer;cm&rdiZY|{XE)7O># zJ{Pl)CWB6F^aG&KJWm(L5R22vKmG&3`uP3-^0hwvKJUPmQ1$s4@8LuDLfG{D%-D)} z60`L9(ks4vk!2QFmp=S+@^g^6y~ zfiXL@@&6L3riC3L&KtB8jtb0~bVRD@dPx$G;tO}DHUZH~KX??a_7zGV^6*-9IE_Pj trKk8^0k@(eg-wbnk_^Tzjg5_r44Hot^BIq5TmU+i!PC{xWt~$(69D(3TlW9} diff --git a/textures/spears_spear_stone.png b/textures/spears_spear_stone.png index fead8b353a2f2c8f9b80330c8df003ba0fd3c3a8..1d8759ea6f747547a25a2384be4281e5d2b13f89 100644 GIT binary patch delta 224 zcmV<603ZLA0{j7xB!2{RLP=Bz2nYy#2xN!=006T|L_t(IjblhlOZ%UgnE0Q8Ou+Q{ z^JfNDR#t|@#Kiwi1%4zO#K^$Fzz`W3`QKKPk>T6-Uku;A|6-_{u!)gq7cej|Fo?3g zWO(%S9Rn998^igN=SX(}0|Ns?UYyhav&YXd7^*NcJpI7Quvz~26QW#!p~zZQ;6Evb zU{yehAvh(8H3YBe#27-*kAw^%Dx~olLUe+`WeCv*;4*|H1F#uFvH|FZkYxbOkWb(L aFaQ8=Bx2s1aV~lQ0000pW`^#APfa}0(m z%nVOIa5Ahv{)CYv17N^fRp39VhF~Zn)ex)-NHGMbB(a9zHJunk2>OwbAw-2VK0}C( zZ(N3ul=iV1LUQIoH-uyZ&