From 78c5f0cc09702a599fecf81b6b3da0d5881b7a9b Mon Sep 17 00:00:00 2001 From: crabman77 Date: Mon, 12 Oct 2015 22:47:00 +0200 Subject: [PATCH] remove spears mod in submodule --- mods/spears | 1 - mods/spears/README.txt | 107 ++++++++++++ mods/spears/defaults.lua | 5 + mods/spears/depends.txt | 1 + mods/spears/functions.lua | 55 ++++++ mods/spears/init.lua | 25 +++ mods/spears/sounds/spears_sound.ogg | Bin 0 -> 4759 bytes mods/spears/textures/spears_spear_diamond.png | Bin 0 -> 442 bytes mods/spears/textures/spears_spear_mithril.png | Bin 0 -> 426 bytes .../spears/textures/spears_spear_obsidian.png | Bin 0 -> 391 bytes mods/spears/textures/spears_spear_steel.png | Bin 0 -> 431 bytes mods/spears/textures/spears_spear_stone.png | Bin 0 -> 431 bytes mods/spears/tools.lua | 157 ++++++++++++++++++ 13 files changed, 350 insertions(+), 1 deletion(-) delete mode 160000 mods/spears create mode 100755 mods/spears/README.txt create mode 100755 mods/spears/defaults.lua create mode 100755 mods/spears/depends.txt create mode 100755 mods/spears/functions.lua create mode 100755 mods/spears/init.lua create mode 100755 mods/spears/sounds/spears_sound.ogg create mode 100755 mods/spears/textures/spears_spear_diamond.png create mode 100755 mods/spears/textures/spears_spear_mithril.png create mode 100755 mods/spears/textures/spears_spear_obsidian.png create mode 100755 mods/spears/textures/spears_spear_steel.png create mode 100755 mods/spears/textures/spears_spear_stone.png create mode 100755 mods/spears/tools.lua diff --git a/mods/spears b/mods/spears deleted file mode 160000 index 510ab936..00000000 --- a/mods/spears +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 510ab936b8af7f7edb46d48757020c2b7af408fb diff --git a/mods/spears/README.txt b/mods/spears/README.txt new file mode 100755 index 00000000..94002462 --- /dev/null +++ b/mods/spears/README.txt @@ -0,0 +1,107 @@ +=== SPEARS for MINETEST === + +This mod adds spears to Minetest. It aims at improving the ones introduced within throwing enhanced. + +How to install: +http://wiki.minetest.com/wiki/Installing_Mods + +How to use the mod: +Spear work similarly to other tools such as swords, even if being a little slower. Moreover, a spear can be thrown using the drop key ('Q') or + +License: +This mod was originally published by Jeija and reworked by PilzAdam +Sourcecode: LGPLv2.1 (see http://www.gnu.org/licenses/lgpl-2.1.html) +Grahpics & sounds: CC-BY 3.0 (see http://creativecommons.org/licenses/by/3.0/legalcode) + + +Changelog: + +Update 1.4.1: +- Fixed spears not retaining wear +- Improved textures +- Torch arrows have light trail + +Update 1.4: +- Added spears, capable of melee and ranged attacks +- Improved arrows textures + +Update 1.3: +- Added automated arbalest, the ultimate weapon +- New arbalest texture coherent with steel color + +Update 1.2: +- Added arbalest +- Defaults initialized + +Update 1.1: +- Added crossbow +- Code shrink +- Offensive arrows go through flora's and farming's +- Small fixes + +Update 1.0: +- Definitive reload, unload and shot system based on tool metadata, new global functions, no more "throw" privilege +- New textures for loaded bows +- Fireworks arrows to celebrate! + +Update 1.0rc2: +- Fixed "compare nil with number" due to self.break not being retained +- Filled conf.example's list +- Added Royal bow + +Update 1.0rc1: +- Added longbow and removed golden bow, definitive bow set for stable release. Feature freeze +- Fixed torch arrow recipe, thanks to Excalibur Zero +- Removed config.lua, configuration now goes int throwing.config, see example + +Update 0.9.8: +- New damage calculation for offensive arrows based on arrow's speed and material. Beware that dependency is more than linear for both, so that differences between arrows will be enhanced if they're shot at higher speed. +- Fixed bug that blocked ability to shot after shooting with empty arrow stack. +- Removed annoying debug symbols + +Update 0.9.7: +- Added visual feedback for reload +- Fixed reload for players who die while reloading and for multiplayer +- Changed license for the code to LGPLv2 + +Update 0.9.6: +- Any bow and arrow is now deactivable under config.lua, which won't be overwritten +- Changed license for media to CC-BY + +Update 0.9.5: +- Added shell arrows +- Revised sounds and some textures +- General balancing of bow's statistics + +Update 0.9.4: +- New bow texture +- Made recipes coherent + +Update 0.9.3: +- Added symmetric recipes, fixed golden bow recipe +- Adjusted few parameters + +Update 0.9.2: +- Added a chance to break for many arrows, so they don't last forever and outclass any other tool +- Build and torch arrows won't build on fluids and torches any more, build arrows won't place torches +- TNT arrow digs instead if removing blocks, eventual indestructible nodes are safe +- Added golden bow with possible new bow style +- Changed the (bit OP) composite bow resistance and new recipe +- New teleport arrow recipe, cheaper but single use + +Update 0.9.1: +- Good improvement for torch arrows, now they always attach and are often turned to the right direction +- Git repository will make things nicer + +Update 0.9: +- Now bows have reload times! They depend on weight and quality, anyway no more machine-gun-style shell swarms +- Fixed build arrow behavior, now it placed and consumes the node from the slot [b]right next to the arrow[/b] or drops the item beside it if not a node; no more disappearing nor 'CONTENT_IGNORE' errors +- Code cleanup and rationalization + +Update 0.8.1: +- Fixed wrong texture reference which made some arrows get a bad color during flight. +- Now bows have different stiffness besides wear resistances, which means that they shot arrows at different initial speed and learning to hit the target will become even harder. + Get rid of the old .env: API + Added new bows and new offensive, utility and harmful arrows (these are just my categories, they're not present into the code at all). + Removed stone bow, at least as long as somebody discovers an elastic rock ;) + Non-exploding arrows won't disappear any more after hitting target. \ No newline at end of file diff --git a/mods/spears/defaults.lua b/mods/spears/defaults.lua new file mode 100755 index 00000000..54a4e962 --- /dev/null +++ b/mods/spears/defaults.lua @@ -0,0 +1,5 @@ +DISABLE_STONE_SPEAR = false +DISABLE_STEEL_SPEAR = false +DISABLE_DIAMOND_SPEAR = false +DISABLE_OBSIDIAN_SPEAR = false +DISABLE_MITHRIL_SPEAR = false diff --git a/mods/spears/depends.txt b/mods/spears/depends.txt new file mode 100755 index 00000000..4ad96d51 --- /dev/null +++ b/mods/spears/depends.txt @@ -0,0 +1 @@ +default diff --git a/mods/spears/functions.lua b/mods/spears/functions.lua new file mode 100755 index 00000000..ba15b477 --- /dev/null +++ b/mods/spears/functions.lua @@ -0,0 +1,55 @@ + +function spears_shot (itemstack, player) + local spear = itemstack:get_name() .. '_entity' + local playerpos = player:getpos() + local obj = minetest.add_entity({x=playerpos.x,y=playerpos.y+1.5,z=playerpos.z}, spear) + local dir = player:get_look_dir() + obj:setvelocity({x=dir.x*14, y=dir.y*14, z=dir.z*14}) + obj:setacceleration({x=-dir.x*.5, y=-9.8, z=-dir.z*.5}) + obj:setyaw(player:get_look_yaw()+math.pi) + obj:get_luaentity().wear = itemstack:get_wear() + obj:get_luaentity().player = player:get_player_name() + obj:get_luaentity().lastpos = {x=playerpos.x,y=playerpos.y+1.5,z=playerpos.z} + minetest.sound_play("spears_sound", {pos=playerpos}) + return true +end + +function spears_is_player(name, obj) + return (obj:is_player() and obj:get_player_name() ~= name) +end + +function spears_is_entity(obj) + return (obj:get_luaentity() ~= nil + and not string.find(obj:get_luaentity().name, "spears:") + and obj:get_luaentity().name ~= "__builtin:item" + and obj:get_luaentity().name ~= "gauges:hp_bar" + and obj:get_luaentity().name ~= "signs:text") +end + +function spears_get_trajectoire(self, newpos) + if self.lastpos.x == nil then + return {newpos} + end + local coord = {} + local nx = (newpos["x"] - self.lastpos["x"])/3 + local ny = (newpos["y"] - self.lastpos["y"])/3 + local nz = (newpos["z"] - self.lastpos["z"])/3 + + if nx and ny and nz then + table.insert(coord, {x=self.lastpos["x"]+nx, y=self.lastpos["y"]+ny ,z=self.lastpos["z"]+nz }) + table.insert(coord, {x=newpos["x"]-nx, y=newpos["y"]-ny ,z=newpos["z"]-nz }) + end + table.insert(coord, newpos) + return coord +end + +function spears_touch(pos, objpos) + local rx = pos.x - objpos.x + local ry = pos.y - (objpos.y+1) + local rz = pos.z - objpos.z + if (ry < 1 and ry > -1) and (rx < 0.4 and rx > -0.4) and (rz < 0.4 and rz > -0.4) then + return true + end + return false +end + diff --git a/mods/spears/init.lua b/mods/spears/init.lua new file mode 100755 index 00000000..842d919b --- /dev/null +++ b/mods/spears/init.lua @@ -0,0 +1,25 @@ +dofile(minetest.get_modpath("spears").."/defaults.lua") + +local input = io.open(minetest.get_modpath("spears").."/spears.conf", "r") +if input then + dofile(minetest.get_modpath("spears").."/spears.conf") + input:close() + input = nil +end + +dofile(minetest.get_modpath("spears").."/functions.lua") + +dofile(minetest.get_modpath("spears").."/tools.lua") + + +if minetest.setting_get("log_mods") then + minetest.log("action", "spears loaded") +end + +--alias +minetest.register_alias("throwing:spear_stone", "spears:spear_stone") +minetest.register_alias("throwing:spear_steel", "spears:spear_steel") +minetest.register_alias("throwing:spear_diamond", "spears:spear_diamond") +minetest.register_alias("throwing:spear_obsidian", "spears:spear_obsidian") +minetest.register_alias("throwing:spear_mithril", "spears:spear_mithril") + diff --git a/mods/spears/sounds/spears_sound.ogg b/mods/spears/sounds/spears_sound.ogg new file mode 100755 index 0000000000000000000000000000000000000000..ebebd6150fb619f821b6f1cdab477a8e4c60d4c0 GIT binary patch literal 4759 zcmd57aJxum+N62+|j4q%Sqta9N#3gYN2Fm9Y@&iGFi=TemP@%}qzc*wj z3e4zS{R!E{0kcnp zhj{zDl@8Jfi?}oz+v_=aq<1S;XnC-&kdEltK|wE+n?ai(2%TSp$u|(@oHBr1A;_p2 zU+@%Pu#8+BPqopDfCE57P)C|IwaEJBS^L1d#J~ZcFnXqHEuF68Gl!6lCGD7xpi=xB z%1B5AuMpwMtmpQ@Hh8Bad>j>ie~jU+=8r~m72QCQLUD6 zd&v$J-0SWd2{(VwPM1U=C*fLU?Ie7ns;;WNl3|2*o!pSMdm{$OiJR44?6re{XVWYt zvz@L1YUwjImE)uWR4*Bb=m&T~12-)ML9W%Qqjz~P0MwVZ4PSG;5#B%KKDh_j>xEgH zv%3N7f4uGh#y2= z4kqpfp+R!c%(1b)Hs4iAJa@~r2N|?y&h>gsuD*)iU~#(HDloW36%~K_f<}@&=WcY; z>6XC&!U=H71ik+R;CM`IcNBVUM38fFQpp}A;bgUe-ko3($qmn&TpvH)KYBOU(@*3> z1-&__=U!0ge7dTH88gTl)p52jNFSZ%Kc41~4`pv>l(PQNKba0J5um+IJ{fWX6MxG^ zQ+;fc_itum!2>(O?5^#$_uFHCvzSOdMhZOVd3(S!_>E7Pb?`uhZzRumwApu96guWQ#--KEKYr zVBEjho?2Q@t$N0&-N}|F?1N7l=tU@q2-5K4rv&L!LhVy>?XrMcR&=eDEyGvHwF=q4 z>rVOrFNC1J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Og}V`7*)0im?)^z;ov|jlwQYB-ds|+8AYHlp0PeY~mAY|J%%!6~wE@hRNdR=QM2sI0Sw#m%) zjnSk0oPa#@8^?5!c7L&QTmCo_+P!yHCL6+@Qz~K1t8ecOG<_AjI{IN{M)&Pz<%+Ip$m3q`+_Ex* z>ErvZ7@bnhPAlBD)^Ka~l6g$j{);P!p`!g3uQPJ!;lz*+25pa3mfn!ymiQz)6}r1| z;^emz-^M)uZqzk^eiy|L>!6%;8eG3_rYH_7#A6~(41mSdp6*}jKBh(4Xt^GxR zNpyQTSeASBYTk}l&;~RKv(XZ^%lc?z+Gh?eKD2^3cYErl%a#{SsTtVjKZEquRJ_w=e>BZP|1u;&FwrnWliY}n=3iXB7fPkWx#xDo}gJc61125 z=xI8-L$RsY^by~=j(on3HMCp&nYyjPFlg=?Xf~xoxTRWlWtIAGzn}!iw^rErz}5JN z%ik}vsqxLe3^@%O`56-XDofWj-VcT@xLq^;=F;4=HBqV)i_iYp@BAlGfB#cwL+-H0 zgzVOlL%!$MR~F4P|KZ1uv70+6ZE4Yj%BKBG7rsoGItagRS(j7MduOZK0^Fa4CU3@3 zM~_g~3%kq>7jZ7F5gyq0{iXXcln2T=?H)PoyiMOze+k*p{q)SA%^s2s_Ko{fmImHF zNZjX$l23f(&)uurD>lr#)NdLYMHT^YVZ$D%%4SSHda?a~> So)^5D2CebO?xN=Wq5TgnoI5rE literal 0 HcmV?d00001 diff --git a/mods/spears/textures/spears_spear_diamond.png b/mods/spears/textures/spears_spear_diamond.png new file mode 100755 index 0000000000000000000000000000000000000000..820fa43a3a668d2612bd9ed68af4ed44afafec75 GIT binary patch literal 442 zcmV;r0Y(0aP)MM{LI9ZC?yFiC7=U>2MZG$iU320B={nl0 zsz}(ZaMBW)ADFa+%^OlmB6o{PN!X%cLrWAsWI{_=-_W5XypP#X61ME?D=Sg@M^je9 zhH7PBiD184Ux|=2p_fGPVWX&o#8g~JLTud1DLUT9# kQ^KHJX^B;A$8!mQZ`ePyh&7M6C;$Ke07*qoM6N<$f;tkgkN^Mx literal 0 HcmV?d00001 diff --git a/mods/spears/textures/spears_spear_mithril.png b/mods/spears/textures/spears_spear_mithril.png new file mode 100755 index 0000000000000000000000000000000000000000..d0ac2a381c259c7d5ba26a5581fb1c46e00e3971 GIT binary patch literal 426 zcmV;b0agBqP)K9h{3pUqkQ#x^z&7Cg3J? z60=Gt1BG&(5+!JpT<(AV#{`lepXBcTf5rXMa8fT169D!6I>$$8u3Rb+czc|(jrKGf zH^+N`v_vYfjrQDj+8p8^!d2i+pg!(D0dR#C*Ij0l4edh`t*D z;vv$9k4HlQJ{N(>gaA;p#m?I*PypfAFP&DLTr=VV*&6g(UL31>&Gt%S>-&`QF2 zvr$$;qAM;XA=Yjcm5`hZ3Q34}y?GKoCZm5P6rSpmgwNUVtc1dIWhJgL9j6iie`__b UfHR{tzW@LL07*qoM6N<$f;Y#fng9R* literal 0 HcmV?d00001 diff --git a/mods/spears/textures/spears_spear_obsidian.png b/mods/spears/textures/spears_spear_obsidian.png new file mode 100755 index 0000000000000000000000000000000000000000..922555026c49f68f6a10595299ee9ea8dcef5440 GIT binary patch literal 391 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdzwj^(N7lu5BI0h%hje(&+5zYdS z$YKTtZeb8+WSBKa0w~B{;_2(kexFlDl)-v(E8AuU21XH27srr@!$+^%^D#P#9RK)! zl1G?|veGO;QTBk>G6xt%`V{;Y6fjNA_Aud^o3{9X?2&DYlrHu-DG9ClYy8>Aet%8c zy?1A%rv$laroM`rz3W<<(JM(7_da`meglThp7Wh67QGN>knk6u_kvI6kT7rT!=k+# z@4tCcmSFM1E<5fEw@FFs)gs;lHWpPvstiEES-Bq~DtFIRxB0EqvHgSJ>Kqk8`DRtY zc;}@86B~s(<|nQb+}ISOl+?b%NrkJR(ZlAZnbK94*&SDkqC0%PZf-pBM>O3v;^*|u z3Tx(OWD16z|7ybVdV6$G%VcXi&O?#Qg~cCkx!>JfaPR9srw$vtMFL6<8Z8nJq@6@Q ia4PauxL#SM`flU?ozsQuP96sa8H1;*pUXO@geCyuN|5dV literal 0 HcmV?d00001 diff --git a/mods/spears/textures/spears_spear_steel.png b/mods/spears/textures/spears_spear_steel.png new file mode 100755 index 0000000000000000000000000000000000000000..1a6f9169db0677c1b065fd946b08222ed5b4a80b GIT binary patch literal 431 zcmV;g0Z{&lP)7Wixz)f%x zGX+GDRw$I~WGJC+lFR+i|Cm7XAR6GuOU&zR0YLYr zLUgDBh=)iXJ{0?zLgA_YlJGej{wksHTxp3*Ovi}? Zz&GnDvCJ(UxP1Ts002ovPDHLkV1gScvx@)# literal 0 HcmV?d00001 diff --git a/mods/spears/textures/spears_spear_stone.png b/mods/spears/textures/spears_spear_stone.png new file mode 100755 index 0000000000000000000000000000000000000000..a2145a34c74609c51ff1d1bad6ef5b9826bebdf5 GIT binary patch literal 431 zcmV;g0Z{&lP)D&*jc*tEwYIC0DT0Xp>I;?1GqR?2NUR4aFPb< zB2ESha-B>|Xq)76|MNd4ko@>0clZCR$#`r48bJWSRr>=#O&_1}QJOQC3d7I<+zk|) zWJkLdWcL81B{G3cvg5kf<&b_7FC%XPjmzd1fJ6En;_VgUWn@kYq5*!q#LQze*@PS6<>A({UyN Z@C9m1u5U+ScEkVx002ovPDHLkV1oG%tt