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 3993e45..e10ad94 100644 Binary files a/textures/spears_spear_bronze.png and b/textures/spears_spear_bronze.png differ diff --git a/textures/spears_spear_copper.png b/textures/spears_spear_copper.png index 56b1ff9..9289000 100644 Binary files a/textures/spears_spear_copper.png and b/textures/spears_spear_copper.png differ diff --git a/textures/spears_spear_diamond.png b/textures/spears_spear_diamond.png index 7a852b9..f4f2f1b 100644 Binary files a/textures/spears_spear_diamond.png and b/textures/spears_spear_diamond.png differ diff --git a/textures/spears_spear_gold.png b/textures/spears_spear_gold.png new file mode 100644 index 0000000..bb39d7f Binary files /dev/null and b/textures/spears_spear_gold.png differ diff --git a/textures/spears_spear_obsidian.png b/textures/spears_spear_obsidian.png index 6ec0ab4..add0bf6 100644 Binary files a/textures/spears_spear_obsidian.png and b/textures/spears_spear_obsidian.png differ diff --git a/textures/spears_spear_steel.png b/textures/spears_spear_steel.png index 1fa930c..5cb795c 100644 Binary files a/textures/spears_spear_steel.png and b/textures/spears_spear_steel.png differ diff --git a/textures/spears_spear_stone.png b/textures/spears_spear_stone.png index fead8b3..1d8759e 100644 Binary files a/textures/spears_spear_stone.png and b/textures/spears_spear_stone.png differ diff --git a/tools.lua b/tools.lua index 283f45e..53272c7 100644 --- a/tools.lua +++ b/tools.lua @@ -4,7 +4,7 @@ function spears_register_spear(spear_type, desc, base_damage, toughness, materia description = desc .. " spear", wield_image = "spears_spear_" .. spear_type .. ".png", inventory_image = "spears_spear_" .. spear_type .. ".png^[transform4", - wield_scale= {x=2,y=1,z=1}, + wield_scale= {x = 2, y = 2, z = 1}, on_secondary_use = function(itemstack, user, pointed_thing) spears_throw(itemstack, user, pointed_thing) if not minetest.setting_getbool("creative_mode") then @@ -73,3 +73,7 @@ end if not DISABLE_DIAMOND_SPEAR then spears_register_spear('diamond', 'Diamond', 8, 40, 'default:diamond') end + +if not DISABLE_GOLD_SPEAR then + spears_register_spear('gold', 'Golden', 5, 40, 'default:gold_ingot') +end